+
    i                        ^ RI Ht ^ RIt^ RIHtHt ^ RIHtHtH	t	 ^RI
HtHt ^RIHtHt ^RIHtHt  ^RIHt  ! R	 R
]	4      tR R ltR R lt]t^RIHt R R ltR R ltR#   ] d
    ^RIHt  L<i ; i)    )annotationsN)	AwaitableSequence)AnyCallable
NamedTuple)
extensionsframes)PayloadTooBigProtocolError)	BytesLikeDataLike)
apply_maskc                      ] tR t^t$ R]R&   R]R&   R]R&   RtR]R&   RtR]R	&   RtR]R
&   ]R R l4       t	R R lt
R R lt]RRRR/R R ll4       tRR/R R lltRtR# )Frameboolfinzframes.Opcodeopcoder   dataFrsv1rsv2rsv3c                   V ^8  d   QhRR/# )   returnzframes.Frame )formats   "`/home/wkmabra/.openclaw/workspace/venv/lib/python3.14/site-packages/websockets/legacy/framing.py__annotate__Frame.__annotate__   s     
 
< 
    c                	    \         P                  ! V P                  V P                  V P                  V P
                  V P                  V P                  4      # N)r
   r   r   r   r   r   r   r   selfs   &r   	new_frameFrame.new_frame   s=    ||KKIIHHIIIIII
 	
r!   c                   V ^8  d   QhRR/# )r   r   strr   )r   s   "r   r   r    %   s     # # #r!   c                	,    \        V P                  4      # r#   )r)   r&   r$   s   &r   __str__Frame.__str__%   s    4>>""r!   c                   V ^8  d   QhRR/# )r   r   Noner   )r   s   "r   r   r    (   s     & &t &r!   c                	6    V P                   P                  4       # r#   )r&   checkr$   s   &r   r0   Frame.check(   s    ~~##%%r!   max_sizeNr	   c          
     ,    V ^8  d   QhRRRRRRRRR	R
/# )r   readerz!Callable[[int], Awaitable[bytes]]maskr   r2   z
int | Noner	   %Sequence[extensions.Extension] | Noner   r   r   )r   s   "r   r   r    ,   sC     L
 L
1L
 	L

 L
 :L
 
L
r!   c               |  "   V! ^4      G Rj  xL
 p\         P                  ! RV4      w  rgV^,          '       d   RMRpV^@,          '       d   RMRp	V^ ,          '       d   RMRp
V^,          '       d   RMRp \        P                  ! V^,          4      pT^,          '       d   RMRT8w  d   \        R4      hT^,          pT^~8X  d+   T! ^4      G Rj  xL
 p\         P                  ! RT4      w  pM0T^8X  d*   T! ^4      G Rj  xL
 p\         P                  ! RT4      w  pTe   Y8  d   \        Y4      hT'       d   T! ^4      G Rj  xL
 pT! T4      G Rj  xL
 pT'       d   \        TX4      p\        P                  ! YYY4      pTf   . p\        T4       F  pTP                  TTR	7      pK  	  TP                  4        T ! TP                  TP                  TP                  TP                  TP                   TP"                  4      #  EL  \         d   p\        R4      ThRp?ii ; i EL^ EL0 L L5i)
a  
Read a WebSocket frame.

Args:
    reader: Coroutine that reads exactly the requested number of
        bytes, unless the end of file is reached.
    mask: Whether the frame should be masked i.e. whether the read
        happens on the server side.
    max_size: Maximum payload size in bytes.
    extensions: List of extensions, applied in reverse order.

Raises:
    PayloadTooBig: If the frame exceeds ``max_size``.
    ProtocolError: If the frame contains incorrect values.

Nz!BBTFzinvalid opcodezincorrect maskingz!Hz!Q)r2   )structunpackr
   Opcode
ValueErrorr   r   r   r   reverseddecoder0   r   r   r   r   r   r   )clsr4   r5   r2   r	   r   head1head2r   r   r   r   r   exclength	mask_bitsr&   	extensions   &&$$$             r   read
Frame.read+   s    6 AY}}UD1 j((dez))tuz))tuz))tu	;]]5:#56F J&&DEd: 344#S=?DdD1IVs]?DdD1IVF$511$QiI F^#dI.DLLs$E	J!*-I!((X(FI . 	MMNNNNNNNN
 	
W   	; 01s:	; # #
 ( $s   H<H>H<H<!H<4H<9H H<%/H<H20H<H59H< H<H8H<H:H<(B)H<H/H**H//H<5H<8H<:H<c               (    V ^8  d   QhRRRRRRRR/# )	r   writezCallable[[bytes], Any]r5   r   r	   r6   r   r.   r   )r   s   "r   r   r    z   s8     J J%J 	J
 :J 
Jr!   c               J    V! V P                   P                  W#R7      4       R# )aF  
Write a WebSocket frame.

Args:
    frame: Frame to write.
    write: Function that writes bytes.
    mask: Whether the frame should be masked i.e. whether the write
        happens on the client side.
    extensions: List of extensions, applied in order.

Raises:
    ProtocolError: If the frame contains incorrect values.

)r5   r	   N)r&   	serialize)r%   rH   r5   r	   s   &&$$r   rH   Frame.writez   s    0 	dnn&&D&HIr!   r   )__name__
__module____qualname____firstlineno____annotations__r   r   r   propertyr&   r+   r0   classmethodrE   rH   __static_attributes__r   r!   r   r   r      s    	I
OD$D$D$
 
#& L

  $L
 =AL
 L
\J
 =AJ Jr!   r   c                    V ^8  d   QhRRRR/# )r   r   r   r   ztuple[int, BytesLike]r   )r   s   "r   r   r      s     : :x :$9 :r!   c                    \        V \        4      '       d+   \        P                  P                  V P                  4       3# \        V \        4      '       d   \        P                  P                  V 3# \        R4      h)az  
Convert a string or byte-like object to an opcode and a bytes-like object.

This function is designed for data frames.

If ``data`` is a :class:`str`, return ``OP_TEXT`` and a :class:`bytes`
object encoding ``data`` in UTF-8.

If ``data`` is a bytes-like object, return ``OP_BINARY`` and a bytes-like
object.

Raises:
    TypeError: If ``data`` doesn't have a supported type.

data must be str or bytes-like)	
isinstancer)   r
   r:   TEXTencoder   BINARY	TypeErrorr   s   &r   prepare_datar]      sZ      $}}!!4;;=00	D)	$	$}}##T))899r!   c                    V ^8  d   QhRRRR/# )r   r   r   r   bytesr   )r   s   "r   r   r      s     : :x :E :r!   c                    \        V \        4      '       d   V P                  4       # \        V \        4      '       d   \	        V 4      # \        R4      h)aI  
Convert a string or byte-like object to bytes.

This function is designed for ping and pong frames.

If ``data`` is a :class:`str`, return a :class:`bytes` object encoding
``data`` in UTF-8.

If ``data`` is a bytes-like object, return a :class:`bytes` object.

Raises:
    TypeError: If ``data`` doesn't have a supported type.

rV   )rW   r)   rY   r   r_   r[   r\   s   &r   prepare_ctrlra      s@     ${{}	D)	$	$T{899r!   )Closec                    V ^8  d   QhRRRR/# )r   r   r_   r   ztuple[int, str]r   )r   s   "r   r   r      s     $ $e $ $r!   c                ^    \         P                  ! V 4      pVP                  VP                  3# )z
Parse the payload from a close frame.

Returns:
    Close code and reason.

Raises:
    ProtocolError: If data is ill-formed.
    UnicodeDecodeError: If the reason isn't valid UTF-8.

)rb   parsecodereason)r   closes   & r   parse_closeri      s%     KKE::u||##r!   c               $    V ^8  d   QhRRRRRR/# )r   rf   intrg   r)   r   r_   r   )r   s   "r   r   r      s!     + +# +s +u +r!   c                4    \        W4      P                  4       # )z+
Serialize the payload for a close frame.

)rb   rJ   )rf   rg   s   &&r   serialize_closerm      s    
 ((**r!   )
__future__r   r8   collections.abcr   r   typingr   r   r    r	   r
   
exceptionsr   r   r   r   speedupsr   ImportErrorutilsr   r]   ra   encode_datarb   ri   rm   r   r!   r   <module>rw      sk    "  / , , ! 5 (#%
@JJ @JF:0:0  $ +[  #"#s   A) )A98A9