
    Oj                       U d dl mZ d dlZd dlZd dlZd dlZd dlmZ d dlm	Z	m
Z
mZmZmZmZmZmZ d dlmZ d dlZd dlmZ ddlmZmZmZmZ dd	lmZmZmZmZm Z  dd
l!m"Z" ddl#m$Z$m%Z% ddl&m'Z'm(Z( ddl)m*Z*m+Z+ ddl,m-Z- ddl.m/Z/ ddl0m1Z1 ddl2m3Z3 ddl4m5Z5 ddl6m7Z7 ddl8m9Z9m:Z:m;Z; ddl<m=Z= ddl>m?Z? ddl@mAZA ddlBmCZC ddlDmEZE e	rd dlFmGZH d dlImGZJ ddlKmLZLmMZM ddgZN ej                  eP      ZQdeRd<    G d  de'      ZS G d! de(      ZT G d" d#      ZU G d$ d%      ZV G d& d'      ZW G d( d)      ZX G d* d+      ZY G d, d-eY      ZZ G d. d/eY      Z[ G d0 d1eY      Z\ G d2 d3eY      Z] G d4 d5eY      Z^ G d6 d7eY      Z_ G d8 d9eY      Z` G d: d;      Za G d< d=ea      Zb G d> d?ea      Zc G d@ dAea      Zd G dB dCea      Ze G dD dEea      Zf G dF dGea      Zg G dH dIea      Zhy)J    )annotationsN)TracebackType)TYPE_CHECKINGAnyUnionCallableIteratorOptional	Awaitablecast)AsyncIterator)	BaseModel   )OmitQueryHeadersomit)is_givenpath_templatemaybe_transformstrip_not_givenasync_maybe_transform)cached_property)FinalRequestOptionsconstruct_type_unchecked)SyncAPIResourceAsyncAPIResource)OpenAIErrorWebSocketConnectionClosedError)	SendQueue)_merge_mappings)EventHandlerRegistry)
ErrorEvent)ForkClientEvent)ForkServerEvent)ReconnectingEventReconnectingOverridesis_recoverable_close)ForkClientEventParam)WebSocketConnectionOptions)ForkSessionConfigParam)SessionUpdateConfigParam)ResponseInputItemParam)ClientConnection)OpenAIAsyncOpenAIForks
AsyncForkszlogging.Loggerlogc            	      N    e Zd Zi i i dddddd	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZy)	r1   N         ?       @   extra_queryextra_headerswebsocket_connection_optionson_reconnectingmax_retriesinitial_delay	max_delaymax_queue_sizec       	        @    t        | j                  ||||||||	|
      S zFork a stored Live session over WebSocket.

        Send session.start with an overrides object (which may be empty), then wait for session.started. The model is inherited.
        )
clientr:   r;   r<   r=   r>   r?   r@   rA   
session_id)ForksConnectionManager_client
selfrE   r:   r;   r<   r=   r>   r?   r@   rA   s
             r/var/www/origus_pro_usr/data/www/origus.pro/core/.venv/lib/python3.12/site-packages/openai/resources/live/forks.pyconnectzForks.connect/   s3    " &<<#')E+#')!
 	
    )rE   strr:   r   r;   r   r<   r*   r=   BCallable[[ReconnectingEvent], ReconnectingOverrides | None] | Noner>   intr?   floatr@   rP   rA   rO   returnrF   __name__
__module____qualname__rK    rL   rJ   r1   r1   .   s    
  !#CE^b"'
 
 	

 
 'A
 \
 
 
 
 
 
 
rL   c            	      N    e Zd Zi i i dddddd	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZy)	r2   Nr5   r6   r7   r8   r9   c       	        @    t        | j                  ||||||||	|
      S rC   )AsyncForksConnectionManagerrG   rH   s
             rJ   rK   zAsyncForks.connectO   s3    " +<<#')E+#')!
 	
rL   )rE   rM   r:   r   r;   r   r<   r*   r=   rN   r>   rO   r?   rP   r@   rP   rA   rO   rQ   rY   rR   rV   rL   rJ   r2   r2   N   s    
  !#CE^b"'
 
 	

 
 'A
 \
 
 
 
 
 
%
rL   c            	          e Zd ZU dZded<   ded<   ded<   ddd	d
di i dd	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZddZd dZd!dZd"dZ	d#dZ
dddd$dZd%dZd&dZd'dZ	 d(	 	 	 	 	 d)dZd*dZ	 d(	 	 	 	 	 d)dZd'dZy)+AsyncForksConnection7Represents a live WebSocket connection to the Forks APIAsyncForksSessionResourcesessionAsyncForksResponseResourceresponseAsyncWebSocketConnection_connectionNr5   r6   r7   make_wsr=   r>   r?   r@   r:   r;   
send_queuec               &   || _         || _        || _        || _        d| _        || _        || _        || _        || _        d| _	        d| _
        |	xs
 t               | _        t        d      | _        t        |       | _        t#        |       | _        y )Nr   Fuse_lock)rb   _make_ws_on_reconnecting_max_retries_reconnect_attempt_initial_delay
_max_delay_extra_query_extra_headers_intentionally_closed_is_reconnectingr    _send_queuer"   _event_handler_registryr]   r^   r_   r`   
rI   
connectionrd   r=   r>   r?   r@   r:   r;   re   s
             rJ   __init__zAsyncForksConnection.__init__v   s     & /'"#+#'+%*" %%4';U'K$06248rL   c                 K   ddl m}m} 	 	 | j                          d{    7 # |$ r Y y|$ rO}| j	                  |       d{  7  s+| j
                  j                         }|rt        d|      | Y d}~Xd}~ww xY wwzq
        An infinite-iterator that will continue to yield events until
        the connection is closed.
        r   )ConnectionClosedOKConnectionClosedErrorNz0WebSocket connection closed with unsent messages)unsent_messageswebsockets.exceptionsrz   r{   recv
_reconnectrs   drainr   rI   rz   r{   excunsents        rJ   	__aiter__zAsyncForksConnection.__aiter__   s     
 	T IIK'' '% ( !__S111!--335F<N,2  ##  2sL   
B+ )+ B+ BBBB 
A0B ;B BBc                (  K   | j                  | j                          d{         }t        t        t        |      t
              rt        d|      j                  d      nt        |dd      }t        |t              r|r|dk7  rd| _	        |S 7 nw)
        Receive the next message from the connection and parses it into a `ForkServerEvent` object.

        Canceling this method is safe. There's no risk of losing data.
        Ndict[str, object]typeerrorr   
parse_event
recv_bytes
isinstancer   objectdictgetgetattrrM   rl   rI   event
event_types      rJ   r   zAsyncForksConnection.recv   s        t'8!89 $vu-t4 $e,008- 	 j#&:*:O&'D# "9s   BBA/Bc                  K   | j                   j                  d       d{   }t        j                  dt	        |             | j
                  ra	 t        j                  |      }t        |t              rt        d|      j                  d      nd}t        |t              r|r|dk7  rd| _        |S 7 # t        t        f$ r |cY S w xY ww)	  Receive the next message from the connection as raw bytes.

        Canceling this method is safe. There's no risk of losing data.

        If you want to parse the message into a `ForkServerEvent` object like `.recv()` does,
        then you can call `.parse_event(data)`.
        FdecodeN$Received WebSocket message: %i bytesr   r   r   r   rb   r   r3   debuglenrl   jsonloads
ValueErrorRecursionErrorr   r   r   r   rM   rI   message
event_datar   s       rJ   r   zAsyncForksConnection.recv_bytes   s      ((--U-;;		8#g,G""%)ZZ%8
 OYYceiNj1:>BB6JptJ*c*zjG>S*+' < / s4    CB5/CB7 (AC7CC
CCc                  K   t        |t              r|j                  ddd      n*t        j                  t        |t               d {         }| j                  r| j                  j                  |       y 	 | j                  j                  |       d {    y 7 U7 # t        $ r | j                  j                  |        w xY wwNTuse_api_namesexclude_defaultsexclude_unset)r   r   to_jsonr   dumpsr   r)   rr   rs   enqueuerb   send	ExceptionrI   r   datas      rJ   r   zAsyncForksConnection.send   s      %+ MMtSWMX"7?S"TTU 	
   $$T*	""''--- U . 	$$T*	s<   AC	B
0C;B# B!B# C!B# #&C		Cc                   K   | j                   r?t        |t              r|n|j                  d      }| j                  j                  |       y | j                  j                  |       d {    y 7 wNutf-8rr   r   rM   r   rs   r   rb   r   rI   r   raws      rJ   send_rawzAsyncForksConnection.send_raw   sY       $T3/$T[[5IC$$S)##D)))s   A*A4,A2-A4   codereasonc               h   K   d| _         | j                  j                  ||       d {    y 7 wNTr   rq   rb   closerI   r   r   s      rJ   r   zAsyncForksConnection.close   s-     %)"$$$v$>>>s   (202c           
         t        t        t        t        j                  |      t        t
        t                          S z
        Converts a raw `str` or `bytes` message into a `ForkServerEvent` object.

        This is helpful if you're using `.recv_bytes()`.
        )valuetype_r   r%   r   r   r   r   rI   r   s     rJ   r   z AsyncForksConnection.parse_event   ,     O%=DJJtDT\`adfu\v%wxxrL   c           	       K   ddl }| j                  | j                  yddlm} d}t        ||      r"|j                  |j                  j                  }t        |      syd| _	        t        | j                  dz   | j                  dz         D ]  }|| _        t        | j                  d|dz
  z  z  | j                        }d	t!        j                          d
z  z   }||z  }t#        || j                  ||| j$                  | j&                        }		 | j                  |	      }
|
|
j+                  d      r	d| _	         y|
d|
v r
|
d   | _        d|
v r
|
d   | _        t,        j/                  d|| j                  |       |j1                  |       d{    | j2                  r	d| _	         y	 | j                  | j$                  | j&                         d{   | _        t,        j/                  d       d| _	        | j7                          d{     y d| _	        y# t(        $ r d| _	        Y  yw xY w7 7 a7 *# t(        $ r Y w xY ww)Attempt to reconnect after a connection failure.

        Returns ``True`` if a new connection was established, ``False`` if the
        caller should re-raise the original exception.
        r   NFr{     T            ?      ?attemptmax_attemptsdelay
close_coder:   r;   abortr:   r;   ?Reconnecting to WebSocket API (attempt %d/%d) after %.1fs delayReconnected to WebSocket API)asynciorj   ri   r~   r{   r   rcvdr   r(   rr   rangerl   rk   minrm   rn   randomr&   ro   rp   r   r   r3   infosleeprq   rb   _flush_send_queue)rI   r   r   r{   r   r   
base_delayjitterr   r   results              rJ   r   zAsyncForksConnection._reconnect   sM     	  (DMM,A?
c01chh6JJ#J/ $T44q8$:K:Ka:OP 2	G&-D#T00A'A+4FGYJFMMOd22F'E%!..% --"11E..u5
 !fjj&9(-%! F*(.}(=D%"f,*0*AD'HHQ!!	 --&&&))(-%)-t7H7H$J]J])^#^ 78(-%,,...a2	h !&I  (-%( ' $_ / s   DIH #A0IH7I.)H=H98H=H;H=I H40I3H44I9H=;H==	I
I	I

Ic                    K   d fd}	  j                   j                  |       d{    y7 # t        $ r t        j	                  d       Y yw xY ww)5Send all queued messages over the current connection.c                X   K   j                   j                  |        d {    y 7 wNrb   r   r   rI   s    rJ   _sendz5AsyncForksConnection._flush_send_queue.<locals>._sendC  s!     ""''---s   *(*N*Failed to flush send queue after reconnect)r   rM   rQ   None)rs   flush_asyncr   r3   warning)rI   r   s   ` rJ   r   z&AsyncForksConnection._flush_send_queue@  sI     	.	F""..u555 	FKKDE	Fs1   A1 /1 A1 AAAAc                X     | j                   j                  |        S d fd}|S )a-  Adds the handler to the end of the handlers list for the given event type.

        No checks are made to see if the handler has already been added. Multiple calls
        passing the same combination of event type and handler will result in the handler
        being added, and called, multiple times.

        Can be used as a method (returns ``self`` for chaining)::

            connection.on("session.started", my_handler)

        Or as a decorator::

            @connection.on("session.started")
            async def my_handler(event): ...
        c                @    j                   j                  |        | S r   rt   addfnr   rI   s    rJ   	decoratorz*AsyncForksConnection.on.<locals>.decoratora      ((,,Z<IrL   r   Callable[..., Any]rQ   r   r   rI   r   handlerr   s   ``  rJ   onzAsyncForksConnection.onK  3    $ ((,,ZAK	 rL   c                >    | j                   j                  ||       | S z-Remove a previously registered event handler.rt   removerI   r   r   s      rJ   offzAsyncForksConnection.offg      $$++J@rL   c                \     |  j                   j                  |d        S d fd}|S )bRegister a one-time event handler.

        Automatically removed after first invocation.
        Toncec                D    j                   j                  | d       | S NTr  r   r   s    rJ   r   z,AsyncForksConnection.once.<locals>.decoratorw  #    ((,,Z$,GIrL   r   r   r   s   ``  rJ   r  zAsyncForksConnection.oncel  8     ((,,Zt,LK	 rL   c                  K   ddl }| 2 3 d{   }|j                  }| j                  j                  |      }| j                  j                  d      }|dk(  r"|s |st	        |t
              rt        d|       |D ]&  } ||      }|j                  |      s| d{    ( |D ]&  } ||      }|j                  |      s| d{    ( 7 7 47 6 yw)al  Run the event loop, dispatching received events to registered handlers.

        Blocks until the connection is closed. This is the push-based
        alternative to iterating with ``async for event in connection``.

        If an ``"error"`` event arrives and no handler is registered for
        ``"error"`` or ``"event"``, an ``OpenAIError`` is raised.
        r   Nr   r   WebSocket error: )r   r   rt   get_handlersr   r#   r   iscoroutine)rI   r   r   r   specificgenericr   r   s           rJ   dispatch_eventsz$AsyncForksConnection.dispatch_events}  s      	 	! 	!%J33@@LH22??HGW$XgeZ0%(9%&ABB# ! &&v. LL!
 # ! &&v. LL!	! !
 !#  sV   CCCCBCCC $CC
CCCCCC)rv   ra   rd   zFCallable[[Query, Headers], Awaitable[AsyncWebSocketConnection]] | Noner=   rN   r>   rO   r?   rP   r@   rP   r:   r   r;   r   re   SendQueue | NonerQ   r   )rQ   zAsyncIterator[ForkServerEvent]rQ   r%   rQ   bytesr   z&ForkClientEvent | ForkClientEventParamrQ   r   r   zbytes | strrQ   r   r   rO   r   rM   rQ   r   r   zstr | bytesrQ   r%   r   r   rQ   boolrQ   r   r   )r   rM   r   Callable[..., Any] | NonerQ   zOUnion[AsyncForksConnection, Callable[[Callable[..., Any]], Callable[..., Any]]])r   rM   r   r   rQ   r[   )rS   rT   rU   __doc____annotations__rw   r   r   r   r   r   r   r   r   r   r   r  r  r  rV   rL   rJ   r[   r[   n   s&   A&&(()) [_^b"!#'+9,9 X	9
 \9 9 9 9 9 9 %9 
9<,$** *.R ?yKZ	F EI(A	X8 EI(A	X"!rL   r[   c                      e Zd ZdZdddddd	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZdd	Z	 d	 	 	 	 	 dd
ZddZ	 d	 	 	 	 	 ddZddZ	e	Z
ddZddZ	 	 	 	 	 	 	 	 ddZy)rY   a*  
    Context manager over a `AsyncForksConnection` that is returned by `live.forks.connect()`

    This context manager ensures that the connection will be closed when it exits.

    ---

    Note that if your application doesn't work well with the context manager approach then you
    can call the `.enter()` method directly to initiate a connection.

    **Warning**: You must remember to close the connection with `.close()`.

    ```py
    connection = await client.live.forks.connect(...).enter()
    # ...
    await connection.close()
    ```
    Nr5   r6   r7   r8   r=   r>   r?   r@   rA   c       
            || _         || _        d | _        || _        || _        || _        || _        || _        || _        |	| _	        t        |
      | _        t        d      | _        y )N	max_bytesFrg   )$_AsyncForksConnectionManager__client(_AsyncForksConnectionManager__session_id(_AsyncForksConnectionManager__connection)_AsyncForksConnectionManager__extra_query+_AsyncForksConnectionManager__extra_headers:_AsyncForksConnectionManager__websocket_connection_options-_AsyncForksConnectionManager__on_reconnecting)_AsyncForksConnectionManager__max_retries+_AsyncForksConnectionManager__initial_delay'_AsyncForksConnectionManager__max_delayr    (_AsyncForksConnectionManager__send_queuer"   4_AsyncForksConnectionManager__event_handler_registryrI   rD   rE   r:   r;   r<   r=   r>   r?   r@   rA   s              rJ   rw   z$AsyncForksConnectionManager.__init__  sm     &9=(,.J+!0(,$%?(<e(L%rL   c                    t        |t              r|j                  ddd      n"t        j                  t        |t                    }| j                  j                  |       yzQueue a message to be sent when the connection is established.

        This can be called before entering the context manager. Queued messages
        are automatically sent once the WebSocket connection opens.
        Tr   N)	r   r   r   r   r   r   r)   r1  r   r   s      rJ   r   z AsyncForksConnectionManager.send  R     %+ MMtSWMXOE3GHI 	
 	!!$'rL   c                X     | j                   j                  |        S d fd}|S )zRegister an event handler before the connection is established.

        Handlers are transferred to the connection on enter. Supports the
        same method and decorator forms as ``AsyncForksConnection.on``.
        c                @    j                   j                  |        | S r   r2  r   r   s    rJ   r   z1AsyncForksConnectionManager.on.<locals>.decorator      ))--j"=IrL   r   r9  r   s   ``  rJ   r   zAsyncForksConnectionManager.on  3     ))--j'BK	 rL   c                >    | j                   j                  ||       | S r   )r2  r  r  s      rJ   r  zAsyncForksConnectionManager.off      %%,,ZArL   c                \     |  j                   j                  |d        S d fd}|S )GRegister a one-time event handler before the connection is established.Tr  c                D    j                   j                  | d       | S r
  r9  r   s    rJ   r   z3AsyncForksConnectionManager.once.<locals>.decorator  #    ))--j"4-HIrL   r   r9  r   s   ``  rJ   r  z AsyncForksConnectionManager.once  8     ))--j'-MK	 rL   c                  K   | j                  | j                  | j                         d{   }t        || j                  | j                   nd| j                  | j
                  | j                  | j                  | j                  | j                  | j                  	      | _	        | j                  j                  | j                  j                         | j                  j                          d{    | j                  S 7 7 w)a  
        If your application doesn't work well with the context manager approach then you
        can call this method directly to initiate a connection.

        **Warning**: You must remember to close the connection with `.close()`.

        ```py
        connection = await client.live.forks.connect(...).enter()
        # ...
        await connection.close()
        ```
        Nrc   )_connect_wsr*  r+  r[   r-  r.  r/  r0  r1  r)  r2  
merge_intort   r   rI   wss     rJ   
__aenter__z&AsyncForksConnectionManager.__aenter__  s      ##D$6$68L8LMM0(,(>(>(JD$$PT 22**..&&**..((

 	%%001B1B1Z1Z[11333   # N 	4s"   *D	DCD	4D5D	D	c           
     Z  K   	 ddl m} | j	                         j                  i | j                  j                  j                  |      }|j                  dddj                  |j                  |j                              }| j                  j                  t        j                  d	t        |      t        |      d
di             d {   }| j                  j	                  |j                         j#                  | j                  j$                  j'                  t)        t*        |j                                    }|j                  dddj                  |j                  |j                              }| j                  j,                  i | j                  j.                  t1        |j2                        r|j2                  ni fD 	ci c]-  }|j5                         D ]  \  }}	|j7                         ||	f / }
}}}	t8        j;                  d       | j<                  rt8        j;                  d        |t        |      fd t?        t        |
jA                               i       d| j<                   d {   S # t        $ r}t        d      |d }~ww xY w7 c c}	}}w 7 +w)Nr   )_WebSocketConnect9You need to install `openai[realtime]` to use this methodparamsrG  wsshttphttpsschemer   bearer_authTmethodurlheaderssecurityConnecting to WebSocket API,Custom WebSocket connection options provideduser_agent_headeradditional_headers)!lib._websocketrJ  ImportErrorr   _prepare_url	copy_withr'  base_urlrM  r   rS  _prepare_optionsr   	constructrM   r   rW  copy_merge_paramsqs	stringifyr   r   auth_headersdefault_headersr   rX  itemslowerr3   r   r,  r!   valuesrI   r:   r;   rK   r   rW  options
header_setkeyr   rX  s              rJ   rD  z'AsyncForksConnectionManager._connect_ws  sd    	dF !++--((// , 
 mmD5#A#E#EcjjRUR\R\#]m^66))H]+'.	
 
 mm((5GGMM&&tC'@A
 mmD5#A#E#EcjjRUR\R\#]m^ **--#+GOO#<"		
 	
 )..0	
 U IIK#u%	
	
 	
 			/0..IIDEH
".tGNN4D/ErJ
 11	
 
 	
I  	dYZ`cc	d
	

sT   J+J CJ+JC?J+2J" A=J+=J)>J+	JJJJ+"J+c                   | j                   j                  *t        j                  | j                   j                        }nO| j                   j                  j
                  }|dk(  rdnd}| j                   j                  j                  |      }|j                  j                  d      t        d| j                        j                  d      z   }|j                  |	      S 
NrP  rG  rN  rR     /z /live/sessions/{session_id}/fork)rE   r   )raw_path)r'  websocket_base_urlhttpx2URL	_base_urlrS  rb  ru  rstripr   r(  encoderI   rc  rS  	ws_schememerge_raw_paths        rJ   ra  z(AsyncForksConnectionManager._prepare_urlM      ==++7zz$--"B"BCH]],,33F && 0eI}}..88	8JH!**11$7-.4;L;L;

&/ !!>!::rL   c                n   K   | j                   #| j                   j                          d {    y y 7 wr   )r)  r   rI   exc_typer   exc_tbs       rJ   	__aexit__z%AsyncForksConnectionManager.__aexit__Z  s4      (##))+++ )+s   *535)rD   r0   rE   rM   r:   r   r;   r   r<   r*   r=   rN   r>   rO   r?   rP   r@   rP   rA   rO   rQ   r   r  r   )r   rM   r   r  rQ   zVUnion[AsyncForksConnectionManager, Callable[[Callable[..., Any]], Callable[..., Any]]])r   rM   r   r   rQ   rY   )rQ   r[   )r:   r   r;   r   rQ   ra   rQ   z
httpx2.URLr  ztype[BaseException] | Noner   zBaseException | Noner  zTracebackType | NonerQ   r   )rS   rT   rU   r   rw   r   r   r  r  rH  enterrD  ra  r  rV   rL   rJ   rY   rY     s*   6 _c"'M M 	M
 M M 'AM \M M M M M 
M6( EI(A	_$ EI(A	_!@ E,
\;,2,9M,Wk,	,rL   rY   c            	          e Zd ZU dZded<   ded<   ded<   ddd	d
di i dd	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZddZd dZd!dZd"dZ	d#dZ
dddd$dZd%dZd&dZd'dZ	 d(	 	 	 	 	 d)dZd*dZ	 d(	 	 	 	 	 d)dZd'dZy)+ForksConnectionr\   ForksSessionResourcer^   ForksResponseResourcer`   WebSocketConnectionrb   Nr5   r6   r7   rc   c               &   || _         || _        || _        || _        d| _        || _        || _        || _        || _        d| _	        d| _
        |	xs
 t               | _        t        d      | _        t        |       | _        t#        |       | _        y )Nr   FTrg   )rb   ri   rj   rk   rl   rm   rn   ro   rp   rq   rr   r    rs   r"   rt   r  r^   r  r`   ru   s
             rJ   rw   zForksConnection.__init__i  s     & /'"#+#'+%*" %%4';T'J$+D1-d3rL   c              #     K   ddl m}m} 	 	 | j                          # |$ r Y y|$ rF}| j	                  |      s+| j
                  j                         }|rt        d|      | Y d}~Md}~ww xY wwry   r}   r   s        rJ   __iter__zForksConnection.__iter__  s     
 	Tiik!  & ( s+!--335F<N,2  ##  ,s4   
A4  A4A1A4A1<A,'A4,A11A4c                   | j                  | j                               }t        t        t        |      t
              rt        d|      j                  d      nt        |dd      }t        |t              r|r|dk7  rd| _	        |S )r   r   r   Nr   r   r   r   s      rJ   r   zForksConnection.recv  sy       !23 $vu-t4 $e,008- 	 j#&:*:O&'D#rL   c                   | j                   j                  d      }t        j                  dt	        |             | j
                  ra	 t        j                  |      }t        |t              rt        d|      j                  d      nd}t        |t              r|r|dk7  rd| _        |S # t        t        f$ r |cY S w xY w)	r   Fr   r   r   r   Nr   r   r   r   s       rJ   r   zForksConnection.recv_bytes  s     ""''u'5		8#g,G""%)ZZ%8
 OYYceiNj1:>BB6JptJ*c*zjG>S*+' / s   	B+ +B?>B?c                l   t        |t              r|j                  ddd      n"t        j                  t        |t                    }| j                  r| j                  j                  |       y 	 | j                  j                  |       y # t        $ r | j                  j                  |        w xY wr   )r   r   r   r   r   r   r)   rr   rs   r   rb   r   r   r   s      rJ   r   zForksConnection.send  s     %+ MMtSWMXOE3GHI 	
   $$T*	!!$' 	$$T*	s   1B &B3c                    | j                   r?t        |t              r|n|j                  d      }| j                  j                  |       y | j                  j                  |       y r   r   r   s      rJ   r   zForksConnection.send_raw  sO      $T3/$T[[5IC$$S)d#rL   r   r   r   c               L    d| _         | j                  j                  ||       y r   r   r   s      rJ   r   zForksConnection.close  s#    %)"D8rL   c           
         t        t        t        t        j                  |      t        t
        t                          S r   r   r   s     rJ   r   zForksConnection.parse_event  r   rL   c           	     Z   | j                   | j                  yddlm} d}t	        ||      r"|j
                  |j
                  j                  }t        |      syd| _        t        | j                  dz   | j                  dz         D ]q  }|| _
        t        | j                  d|dz
  z  z  | j                        }dt        j                         d	z  z   }||z  }t!        || j                  ||| j"                  | j$                  
      }	 | j                  |      }	|	|	j)                  d      r	d| _         y|	d|	v r
|	d   | _        d|	v r
|	d   | _        t*        j-                  d|| j                  |       t/        j0                  |       | j2                  r	d| _         y	 | j                  | j"                  | j$                        | _        t*        j-                  d       d| _        | j7                           y d| _        y# t&        $ r d| _        Y  yw xY w# t&        $ r Y w xY w)r   Fr   r   r   Tr   r   r   r   r   r   r:   r;   r   r   )rj   ri   r~   r{   r   r   r   r(   rr   r   rl   rk   r   rm   rn   r   r&   ro   rp   r   r   r3   r   timer   rq   rb   r   )
rI   r   r{   r   r   r   r   r   r   r   s
             rJ   r   zForksConnection._reconnect  s(      (DMM,A?
c01chh6JJ#J/ $T44q8$:K:Ka:OP 2	G&-D#T00A'A+4FGYJFMMOd22F'E%!..% --"11E..u5
 !fjj&9(-%! F*(.}(=D%"f,*0*AD'HHQ!!	 JJu))(-%#'==1B1BDDWDW#X 78(-%&&(a2	h !&I  (-%@  s%   H$AHHH	H*)H*c                     	  j                   j                   fd       y# t        $ r t        j	                  d       Y yw xY w)r   c                :    j                   j                  |       S r   r   r   s    rJ   <lambda>z3ForksConnection._flush_send_queue.<locals>.<lambda>4  s    T5E5E5J5J45P rL   r   N)rs   
flush_syncr   r3   r   rI   s   `rJ   r   z!ForksConnection._flush_send_queue1  s<    	F''(PQ 	FKKDE	Fs   " AAc                X     | j                   j                  |        S d fd}|S )a'  Adds the handler to the end of the handlers list for the given event type.

        No checks are made to see if the handler has already been added. Multiple calls
        passing the same combination of event type and handler will result in the handler
        being added, and called, multiple times.

        Can be used as a method (returns ``self`` for chaining)::

            connection.on("session.started", my_handler)

        Or as a decorator::

            @connection.on("session.started")
            def my_handler(event): ...
        c                @    j                   j                  |        | S r   r   r   s    rJ   r   z%ForksConnection.on.<locals>.decoratorN  r   rL   r   r   r   s   ``  rJ   r   zForksConnection.on8  r   rL   c                >    | j                   j                  ||       | S r   r   r  s      rJ   r  zForksConnection.offT  r  rL   c                \     |  j                   j                  |d        S d fd}|S )r  Tr  c                D    j                   j                  | d       | S r
  r   r   s    rJ   r   z'ForksConnection.once.<locals>.decoratord  r  rL   r   r   r   s   ``  rJ   r  zForksConnection.onceY  r  rL   c                    | D ]  }|j                   }| j                  j                  |      }| j                  j                  d      }|dk(  r"|s |st        |t              rt        d|       |D ]
  } ||        |D ]
  } ||         y)ay  Run the event loop, dispatching received events to registered handlers.

        Blocks the current thread until the connection is closed. This is the push-based
        alternative to iterating with ``for event in connection``.

        If an ``"error"`` event arrives and no handler is registered for
        ``"error"`` or ``"event"``, an ``OpenAIError`` is raised.
        r   r   r  N)r   rt   r  r   r#   r   )rI   r   r   r  r  r   s         rJ   r  zForksConnection.dispatch_eventsj  s      	EJ33@@LH22??HGW$XgeZ0%(9%&ABB#  # 	rL   )rv   r  rd   z6Callable[[Query, Headers], WebSocketConnection] | Noner=   rN   r>   rO   r?   rP   r@   rP   r:   r   r;   r   re   r  rQ   r   )rQ   zIterator[ForkServerEvent]r  r  r  r  r  r  r  r  r   )r   rM   r   r  rQ   zJUnion[ForksConnection, Callable[[Callable[..., Any]], Callable[..., Any]]])r   rM   r   r   rQ   r  )rS   rT   rU   r   r!  rw   r  r   r   r   r   r   r   r   r   r   r  r  r  rV   rL   rJ   r  r  a  s&   A!!##$$ KO^b"!#'+4'4 H	4
 \4 4 4 4 4 4 %4 
4<,$*$ $(r 9yIVF EI(A	S8 EI(A	S"rL   r  c                      e Zd ZdZdddddd	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddZdd	Z	 d	 	 	 	 	 dd
ZddZ	 d	 	 	 	 	 ddZddZ	e	Z
ddZddZ	 	 	 	 	 	 	 	 ddZy)rF   a  
    Context manager over a `ForksConnection` that is returned by `live.forks.connect()`

    This context manager ensures that the connection will be closed when it exits.

    ---

    Note that if your application doesn't work well with the context manager approach then you
    can call the `.enter()` method directly to initiate a connection.

    **Warning**: You must remember to close the connection with `.close()`.

    ```py
    connection = client.live.forks.connect(...).enter()
    # ...
    connection.close()
    ```
    Nr5   r6   r7   r8   r#  c       
            || _         || _        d | _        || _        || _        || _        || _        || _        || _        |	| _	        t        |
      | _        t        d      | _        y )Nr%  Trg   )_ForksConnectionManager__client#_ForksConnectionManager__session_id#_ForksConnectionManager__connection$_ForksConnectionManager__extra_query&_ForksConnectionManager__extra_headers5_ForksConnectionManager__websocket_connection_options(_ForksConnectionManager__on_reconnecting$_ForksConnectionManager__max_retries&_ForksConnectionManager__initial_delay"_ForksConnectionManager__max_delayr    #_ForksConnectionManager__send_queuer"   /_ForksConnectionManager__event_handler_registryr3  s              rJ   rw   zForksConnectionManager.__init__  sm     &48(,.J+!0(,$%?(<d(K%rL   c                    t        |t              r|j                  ddd      n"t        j                  t        |t                    }| j                  j                  |       yr5  )	r   r   r   r   r   r   r)   r  r   r   s      rJ   r   zForksConnectionManager.send  r6  rL   c                X     | j                   j                  |        S d fd}|S )zRegister an event handler before the connection is established.

        Handlers are transferred to the connection on enter. Supports the
        same method and decorator forms as ``ForksConnection.on``.
        c                @    j                   j                  |        | S r   r  r   r   s    rJ   r   z,ForksConnectionManager.on.<locals>.decorator  r:  rL   r   r  r   s   ``  rJ   r   zForksConnectionManager.on  r;  rL   c                >    | j                   j                  ||       | S r   )r  r  r  s      rJ   r  zForksConnectionManager.off  r=  rL   c                \     |  j                   j                  |d        S d fd}|S )r?  Tr  c                D    j                   j                  | d       | S r
  r  r   s    rJ   r   z.ForksConnectionManager.once.<locals>.decorator  rA  rL   r   r  r   s   ``  rJ   r  zForksConnectionManager.once  rB  rL   c                   | j                  | j                  | j                        }t        || j                  | j                   nd| j                  | j
                  | j                  | j                  | j                  | j                  | j                  	      | _	        | j                  j                  | j                  j                         | j                  j                          | j                  S )as  
        If your application doesn't work well with the context manager approach then you
        can call this method directly to initiate a connection.

        **Warning**: You must remember to close the connection with `.close()`.

        ```py
        connection = client.live.forks.connect(...).enter()
        # ...
        connection.close()
        ```
        Nrc   )rD  r  r  r  r  r  r  r  r  r  r  rE  rt   r   rF  s     rJ   	__enter__z ForksConnectionManager.__enter__  s     d00$2F2FG+(,(>(>(JD$$PT 22**..&&**..((

 	%%001B1B1Z1Z[++-   rL   c           
     (   	 ddl m} | j	                         j                  i | j                  j                  j                  |      }|j                  dddj                  |j                  |j                              }| j                  j                  t        j                  d	t        |      t        |      d
di            }| j                  j	                  |j                         j#                  | j                  j$                  j'                  t)        t*        |j                                    }|j                  dddj                  |j                  |j                              }| j                  j,                  i | j                  j.                  t1        |j2                        r|j2                  ni fD 	ci c]-  }|j5                         D ]  \  }}	|j7                         ||	f / }
}}}	t8        j;                  d       | j<                  rt8        j;                  d        |t        |      fd t?        t        |
jA                               i       d| j<                  S # t        $ r}t        d      |d }~ww xY wc c}	}}w )Nr   )rK   rK  rL  rG  rN  rO  rR  r   rT  TrU  rZ  r[  r\  )!websockets.sync.clientrK   r`  r   ra  rb  r  rc  rM  r   rS  rd  r   re  rM   r   rW  rf  rg  rh  r   r   ri  rj  r   rX  rk  rl  r3   r   r  r!   rm  rn  s              rJ   rD  z"ForksConnectionManager._connect_ws  sK   	d6 !++--((// , 
 mmD5#A#E#EcjjRUR\R\#]m^--00))H]+'.	
 mm((5GGMM&&tC'@A
 mmD5#A#E#EcjjRUR\R\#]m^ **--#+GOO#<"		
 	
 )..0	
 U IIK#u%	
	
 	
 			/0..IIDEH
".tGNN4D/ErJ
 11	
 	
I  	dYZ`cc	d,	
s   I0 2J0	J
9JJ
c                   | j                   j                  *t        j                  | j                   j                        }nO| j                   j                  j
                  }|dk(  rdnd}| j                   j                  j                  |      }|j                  j                  d      t        d| j                        j                  d      z   }|j                  |	      S rs  )r  rv  rw  rx  ry  rS  rb  ru  rz  r   r  r{  r|  s        rJ   ra  z#ForksConnectionManager._prepare_url4  r  rL   c                R    | j                   | j                   j                          y y r   )r  r   r  s       rJ   __exit__zForksConnectionManager.__exit__A  s'     (##% )rL   )rD   r/   rE   rM   r:   r   r;   r   r<   r*   r=   rN   r>   rO   r?   rP   r@   rP   rA   rO   rQ   r   r  r   )r   rM   r   r  rQ   zQUnion[ForksConnectionManager, Callable[[Callable[..., Any]], Callable[..., Any]]])r   rM   r   r   rQ   rF   )rQ   r  )r:   r   r;   r   rQ   r  r  r  )rS   rT   rU   r   rw   r   r   r  r  r  r  rD  ra  r  rV   rL   rJ   rF   rF     s*   6 _c"'L L 	L
 L L 'AL \L L L L L 
L6( EI(A	Z$ EI(A	Z!@ E,
\;&2&9M&Wk&	&rL   rF   c                      e Zd ZddZy)BaseForksConnectionResourcec                    || _         y r   rb   rI   rv   s     rJ   rw   z$BaseForksConnectionResource.__init__I  
    %rL   N)rv   r  rQ   r   rS   rT   rU   rw   rV   rL   rJ   r  r  H      &rL   r  c                  ~    e Zd Zed
d       Zedd       Zedd       Zedd       ZedddZ	edddZ
edddZy	)r  c                ,    t        | j                        S r   )ForksSessionCommentaryResourcerb   r  s    rJ   
commentaryzForksSessionResource.commentaryN      -d.>.>??rL   c                ,    t        | j                        S r   )ForksSessionInputAudioResourcerb   r  s    rJ   input_audioz ForksSessionResource.input_audioR  r  rL   c                ,    t        | j                        S r   ) ForksSessionInstructionsResourcerb   r  s    rJ   instructionsz!ForksSessionResource.instructionsV  s    /0@0@AArL   c                ,    t        | j                        S r   )ForksSessionThinkingResourcerb   r  s    rJ   thinkingzForksSessionResource.thinkingZ  s    +D,<,<==rL   event_idc               p    | j                   j                  t        t        t	        d||d                   yu   
        Start a Live session after connecting to a stored session’s fork WebSocket.

        Send an empty `session` object to use the stored configuration.
        zsession.startr   r^   r  Nrb   r   r   r)   r   rI   r^   r  s      rJ   startzForksSessionResource.start^  s3     	$WZb cd	
rL   c          
     n    | j                   j                  t        t        t	        d|d                   yzRequest that the Live session close.

        The terminal `session.closed` event contains the close reason and final usage.
        zsession.closer   r  Nr  rI   r  s     rJ   r   zForksSessionResource.closek  s.    
 	%]e7f'gh	
rL   c               p    | j                   j                  t        t        t	        d||d                   yzUpdate the delegation settings of an active Live session.

        The server acknowledges accepted changes with `session.updated`.
        zsession.updater  Nr  r  s      rJ   updatezForksSessionResource.updatet  s4    
 	$)9g[c de	
rL   N)rQ   r  )rQ   r  )rQ   r  )rQ   r  r^   r+   r  Optional[str] | OmitrQ   r   r  r  rQ   r   r^   r,   r  r  rQ   r   rS   rT   rU   r   r  r  r  r  r   r  r   r  rV   rL   rJ   r  r  M  sx    @ @ @ @ B B > > Z^ 
 9= 
 ]a 

rL   r  c                      e Zd ZedddZy)r  r  c               r    | j                   j                  t        t        t	        d|||d                   yz{
        Provide context the Live model can communicate to the user, optionally for an existing client delegation.
        zsession.commentary.appendr   contentdelegation_idr  Nr  rI   r  r  r  s       rJ   appendz%ForksSessionCommentaryResource.append  s<     	$ ;#*)6$,	
	
rL   Nr  rM   r  zOptional[str]r  r  rQ   r   rS   rT   rU   r   r  rV   rL   rJ   r  r    
    ei 
rL   r  c                  6    e Zd ZedddZedddZedddZy)r  r  c               p    | j                   j                  t        t        t	        d||d                   yzSend audio to a Live session over its primary WebSocket.

        WebRTC and SIP sessions send audio over their media transport.
        zsession.input_audio.append)r   audior  Nr  rI   r  r  s      rJ   r  z%ForksSessionInputAudioResource.append  s5    
 	$)EPUck lm	
rL   c          
     n    | j                   j                  t        t        t	        d|d                   yzMute audio input to the Live model without closing the session.

        The server acknowledges with `session.input_audio.muted`.
        zsession.input_audio.muter  Nr  r  s     rJ   mutez#ForksSessionInputAudioResource.mute  s/    
 	%@Zhp7q'rs	
rL   c          
     n    | j                   j                  t        t        t	        d|d                   yzResume audio input to a Live model after muting it.

        The server acknowledges with `session.input_audio.unmuted`.
        zsession.input_audio.unmuter  Nr  r  s     rJ   unmutez%ForksSessionInputAudioResource.unmute  s/    
 	%@\jr7s'tu	
rL   Nr  rM   r  r  rQ   r   r  rS   rT   rU   r   r  r  r  rV   rL   rJ   r  r    s    EI 

 8< 
 :> 
rL   r  c                      e Zd ZedddZy)r  r  c               r    | j                   j                  t        t        t	        d|||d                   yz
        Append instructions to the Live conversation while it is running, optionally associating them with an existing client delegation.
        zsession.instructions.appendr  Nr  r  s       rJ   r  z'ForksSessionInstructionsResource.append  s<     	$ =#*)6$,	
	
rL   Nr  r  rV   rL   rJ   r  r    r  rL   r  c                      e Zd ZedddZy)r  r  c               r    | j                   j                  t        t        t	        d|||d                   yz
        Provide silent reasoning or progress context to the Live model, optionally for an existing client delegation.
        zsession.thinking.appendr  Nr  r  s       rJ   r  z#ForksSessionThinkingResource.append  s<     	$ 9#*)6$,	
	
rL   Nr  r  rV   rL   rJ   r  r    r  rL   r  c                  ,    e Zd Zedd       ZedddZy)r  c                ,    t        | j                        S r   )ForksResponseItemResourcerb   r  s    rJ   itemzForksResponseResource.item  s    ()9)9::rL   r  c          
     n    | j                   j                  t        t        t	        d|d                   yu   
        Request a response from the Live session’s Responses backend, or continue a
        delegated response waiting for tool results.

        Requires Responses delegation.
        zresponse.creater  Nr  r  s     rJ   createzForksResponseResource.create  s/     	%@Q_g7h'ij	
rL   N)rQ   r	  r  rS   rT   rU   r   r
  r   r  rV   rL   rJ   r  r    s    ; ; :> 	
rL   r  c                      e Zd ZedddZy)r	  r  c               p    | j                   j                  t        t        t	        d||d                   yu   Add an input item to the Live session’s Responses backend.

        Requires Responses delegation; use `response.create` to request a response.
        zresponse.item.create)r   r
  r  Nr  rI   r
  r  s      rJ   r  z ForksResponseItemResource.create  s4    
 	$)?[c de	
rL   Nr
  r-   r  r  rQ   r   rS   rT   rU   r   r  rV   rL   rJ   r	  r	    s
    W[ 

rL   r	  c                      e Zd ZddZy) BaseAsyncForksConnectionResourcec                    || _         y r   r  r  s     rJ   rw   z)BaseAsyncForksConnectionResource.__init__  r  rL   N)rv   r[   rQ   r   r  rV   rL   rJ   r  r    r  rL   r  c                  ~    e Zd Zed
d       Zedd       Zedd       Zedd       ZedddZ	edddZ
edddZy	)r]   c                ,    t        | j                        S r   )#AsyncForksSessionCommentaryResourcerb   r  s    rJ   r  z$AsyncForksSessionResource.commentary      243C3CDDrL   c                ,    t        | j                        S r   )#AsyncForksSessionInputAudioResourcerb   r  s    rJ   r  z%AsyncForksSessionResource.input_audio  r  rL   c                ,    t        | j                        S r   )%AsyncForksSessionInstructionsResourcerb   r  s    rJ   r  z&AsyncForksSessionResource.instructions
  s    4T5E5EFFrL   c                ,    t        | j                        S r   )!AsyncForksSessionThinkingResourcerb   r  s    rJ   r  z"AsyncForksSessionResource.thinking  s    01A1ABBrL   r  c                  K   | j                   j                  t        t        t	        d||d                   d{    y7 wr  r  r  s      rJ   r  zAsyncForksSessionResource.start  sA      ##$WZb cd
 	
 	
   :AAAc          
        K   | j                   j                  t        t        t	        d|d                   d{    y7 wr  r  r  s     rJ   r   zAsyncForksSessionResource.close  s<     
 ##%]e7f'gh
 	
 	
   9AAAc                  K   | j                   j                  t        t        t	        d||d                   d{    y7 wr  r  r  s      rJ   r  z AsyncForksSessionResource.update(  sB     
 ##$)9g[c de
 	
 	
r#  N)rQ   r  )rQ   r  )rQ   r  )rQ   r!  r  r  r  r  rV   rL   rJ   r]   r]     s{    E E E E G G C C `d 
 ?C 
 cg 

rL   r]   c                  (    e Zd Zed	 	 	 	 	 	 	 ddZy)r  r  c                  K   | j                   j                  t        t        t	        d|||d                   d{    y7 wr  r  r  s       rJ   r  z*AsyncForksSessionCommentaryResource.append6  sJ      ##$ ;#*)6$,	

 	
 	
   ;AAANr  r  rV   rL   rJ   r  r  5  *    ^b

.;
G[
	
rL   r  c                  6    e Zd ZedddZedddZedddZy)r  r  c                  K   | j                   j                  t        t        t	        d||d                   d{    y7 wr  r  r  s      rJ   r  z*AsyncForksSessionInputAudioResource.appendL  sC     
 ##$)EPUck lm
 	
 	
r#  c          
        K   | j                   j                  t        t        t	        d|d                   d{    y7 wr  r  r  s     rJ   r  z(AsyncForksSessionInputAudioResource.muteX  s=     
 ##%@Zhp7q'rs
 	
 	
r%  c          
        K   | j                   j                  t        t        t	        d|d                   d{    y7 wr  r  r  s     rJ   r  z*AsyncForksSessionInputAudioResource.unmutea  s=     
 ##%@\jr7s'tu
 	
 	
r%  Nr  r  r   rV   rL   rJ   r  r  K  s!    KO 

 >B 
 @D 
rL   r  c                  (    e Zd Zed	 	 	 	 	 	 	 ddZy)r  r  c                  K   | j                   j                  t        t        t	        d|||d                   d{    y7 wr  r  r  s       rJ   r  z,AsyncForksSessionInstructionsResource.appendl  sJ      ##$ =#*)6$,	

 	
 	
r)  Nr  r  rV   rL   rJ   r  r  k  r*  rL   r  c                  (    e Zd Zed	 	 	 	 	 	 	 ddZy)r!  r  c                  K   | j                   j                  t        t        t	        d|||d                   d{    y7 wr  r  r  s       rJ   r  z(AsyncForksSessionThinkingResource.append  sJ      ##$ 9#*)6$,	

 	
 	
r)  Nr  r  rV   rL   rJ   r!  r!    r*  rL   r!  c                  ,    e Zd Zedd       ZedddZy)r_   c                ,    t        | j                        S r   )AsyncForksResponseItemResourcerb   r  s    rJ   r
  zAsyncForksResponseResource.item  r  rL   r  c          
        K   | j                   j                  t        t        t	        d|d                   d{    y7 wr  r  r  s     rJ   r  z!AsyncForksResponseResource.create  s=      ##%@Q_g7h'ij
 	
 	
r%  N)rQ   r5  r  r  rV   rL   rJ   r_   r_     s"    @ @ @D 	
rL   r_   c                      e Zd ZedddZy)r5  r  c                  K   | j                   j                  t        t        t	        d||d                   d{    y7 wr  r  r  s      rJ   r  z%AsyncForksResponseItemResource.create  sB     
 ##$)?[c de
 	
 	
r#  Nr  r  rV   rL   rJ   r5  r5    s
    ]a 

rL   r5  )i
__future__r   r   r  r   loggingtypesr   typingr   r   r   r   r	   r
   r   r   typing_extensionsr   rw  pydanticr   _typesr   r   r   r   _utilsr   r   r   r   r   _compatr   _modelsr   r   	_resourcer   r   _exceptionsr   r   rs   r    _base_clientr!   _event_handlerr"   types.live.error_eventr#   types.live.fork_client_eventr$   types.live.fork_server_eventr%   types.websocket_reconnectionr&   r'   r(   "types.live.fork_client_event_paramr)   "types.websocket_connection_optionsr*   $types.live.fork_session_config_paramr+   &types.live.session_update_config_paramr,   )types.responses.response_input_item_paramr-   r  r.   r  websockets.asyncio.clientra   rG   r/   r0   __all__	getLoggerrS   r3   r!  r1   r2   r[   rY   r  rF   r  r  r  r  r  r  r  r	  r  r]   r  r  r  r!  r_   r5  rV   rL   rJ   <module>rS     s   #      [ [ [ +   0 0 f f & D : F $ + 2 0 ; ; j j F L J N ONV.L
!'g''1^ 1
O 
@
! 
@k! k!\	B, B,J_ _D	B& B&J& &
1
6 1
h
%@ 
(
%@ 
@
'B 
(
#> 
(
7 
"
 ; 
& &
1
 @ 1
h
*J 
,
*J 
@
,L 
,
(H 
,
!A 
"
%E 
rL   