Ë
    	°ëj9  ã                  óB  — d Z ddlmZ ddlZddlmZ g d¢Z G d„ de«      Z G d	„ d
e«      Z	 G d„ de	«      Z
 G d„ de	«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ d e«      Z G d!„ d"e«      Z G d#„ d$e«      Z G d%„ d&e«      Z G d'„ d(e«      Z G d)„ d*e«      Z G d+„ d,e«      Z G d-„ d.e«      Z G d/„ d0e«      Z G d1„ d2e«      Z G d3„ d4e«      Z G d5„ d6e«      Z G d7„ d8e«      Z  G d9„ d:e «      Z! G d;„ d<e «      Z" G d=„ d>e «      Z# G d?„ d@e«      Z$ G dA„ dBe«      Z% G dC„ dDe«      Z& G dE„ dFee'«      Z( G dG„ dHee)«      Z*ddIl+m,Z,m-Z-  e e.«       dJdJdJdJdKœ¬L«       y)MaM  
:mod:`websockets.exceptions` defines the following hierarchy of exceptions.

* :exc:`WebSocketException`
    * :exc:`ConnectionClosed`
        * :exc:`ConnectionClosedOK`
        * :exc:`ConnectionClosedError`
    * :exc:`InvalidURI`
    * :exc:`InvalidProxy`
    * :exc:`InvalidHandshake`
        * :exc:`SecurityError`
            * :exc:`RequestLineTooLong`
            * :exc:`StatusLineTooLong`
            * :exc:`HeaderLineTooLong`
            * :exc:`TooManyHeaders`
        * :exc:`ProxyError`
            * :exc:`InvalidProxyMessage`
            * :exc:`InvalidProxyStatus`
        * :exc:`InvalidMessage`
        * :exc:`InvalidMethod`
        * :exc:`InvalidProtocol`
        * :exc:`InvalidStatus`
        * :exc:`InvalidStatusCode` (legacy)
        * :exc:`InvalidHeader`
            * :exc:`InvalidHeaderFormat`
            * :exc:`InvalidHeaderValue`
            * :exc:`InvalidOrigin`
            * :exc:`InvalidUpgrade`
        * :exc:`NegotiationError`
            * :exc:`DuplicateParameter`
            * :exc:`InvalidParameterName`
            * :exc:`InvalidParameterValue`
        * :exc:`AbortHandshake` (legacy)
        * :exc:`RedirectHandshake` (legacy)
    * :exc:`ProtocolError` (Sans-I/O)
    * :exc:`PayloadTooBig` (Sans-I/O)
    * :exc:`TooManyFragments`
    * :exc:`InvalidState` (Sans-I/O)
    * :exc:`ConcurrencyError`

é    )ÚannotationsNé   )Úlazy_import)!ÚWebSocketExceptionÚConnectionClosedÚConnectionClosedOKÚConnectionClosedErrorÚ
InvalidURIÚInvalidProxyÚInvalidHandshakeÚSecurityErrorÚRequestLineTooLongÚStatusLineTooLongÚHeaderLineTooLongÚTooManyHeadersÚTooManyFragmentsÚ
ProxyErrorÚInvalidProxyMessageÚInvalidProxyStatusÚInvalidMessageÚInvalidMethodÚInvalidProtocolÚInvalidStatusÚInvalidHeaderÚInvalidHeaderFormatÚInvalidHeaderValueÚInvalidOriginÚInvalidUpgradeÚNegotiationErrorÚDuplicateParameterÚInvalidParameterNameÚInvalidParameterValueÚProtocolErrorÚPayloadTooBigÚInvalidStateÚConcurrencyErrorc                  ó   — e Zd ZdZy)r   z?
    Base class for all exceptions defined by websockets.

    N©Ú__name__Ú
__module__Ú__qualname__Ú__doc__© ó    úb/home/oem/CyberBrain26-unified/dev-env/.venv/lib/python3.12/site-packages/websockets/exceptions.pyr   r   W   ó   „ òr.   r   c                  óV   — e Zd ZdZ	 d	 	 	 	 	 	 	 dd„Zd	d„Zed
d„«       Zed	d„«       Zy)r   a  
    Raised when trying to interact with a closed connection.

    Attributes:
        rcvd: If a close frame was received, its code and reason are available
            in ``rcvd.code`` and ``rcvd.reason``.
        sent: If a close frame was sent, its code and reason are available
            in ``sent.code`` and ``sent.reason``.
        rcvd_then_sent: If close frames were received and sent, this attribute
            tells in which order this happened, from the perspective of this
            side of the connection.

    Nc                óŒ   — || _         || _        || _        | j                  d u | j                   d u xs | j                  d u k(  sJ ‚y ©N©ÚrcvdÚsentÚrcvd_then_sent)Úselfr5   r6   r7   s       r/   Ú__init__zConnectionClosed.__init__m   sK   € ð ˆŒ	ØˆŒ	Ø,ˆÔØ×#Ñ# tÐ+°·±¸dÐ1BÒ1WÀdÇiÁiÐSWÐFWÒXÐXÑXr.   c                ó  — | j                   €| j                  €yd| j                  › d�S | j                  €d| j                   › d�S | j                  rd| j                   › d| j                  › �S d| j                  › d| j                   › �S )Nzno close frame received or sentzsent z; no close frame receivedz	received z; no close frame sentz; then sent z; then received r4   ©r8   s    r/   Ú__str__zConnectionClosed.__str__x   s‹   € Ø�9‰9ÐØ�y‰yÐ Ø8à˜tŸy™y˜kÐ)BÐCÐCà�y‰yÐ Ø" 4§9¡9 +Ð-BÐCÐCà×&Ò&Ø& t§y¡y k°¸d¿i¹i¸[ÐIÐIà" 4§9¡9 +Ð-=¸d¿i¹i¸[ÐIÐIr.   c                ó®   — t        j                  dt        «       | j                  €t        j
                  j                  S | j                  j                  S )NzZConnectionClosed.code is deprecated; use Protocol.close_code or ConnectionClosed.rcvd.code)ÚwarningsÚwarnÚDeprecationWarningr5   ÚframesÚ	CloseCodeÚABNORMAL_CLOSUREÚcoder;   s    r/   rD   zConnectionClosed.code‰   sC   € ä�‰ðDäô	
ð
 �9‰9ÐÜ×#Ñ#×4Ñ4Ð4Ø�y‰y�~‰~Ðr.   c                ó|   — t        j                  dt        «       | j                  €y| j                  j                  S )Nz`ConnectionClosed.reason is deprecated; use Protocol.close_reason or ConnectionClosed.rcvd.reasonÚ )r>   r?   r@   r5   Úreasonr;   s    r/   rG   zConnectionClosed.reason”   s6   € ä�‰ðHäô	
ð
 �9‰9ÐØØ�y‰y×ÑÐr.   r3   )r5   úframes.Close | Noner6   rH   r7   zbool | NoneÚreturnÚNone©rI   Ústr)rI   Úint)	r)   r*   r+   r,   r9   r<   ÚpropertyrD   rG   r-   r.   r/   r   r   ^   sj   „ ñð$ '+ð		Yà!ð	Yð "ð	Yð $ð		Yð
 
ó	YóJð" òó ðð ò ó ñ r.   r   c                  ó   — e Zd ZdZy)r   z¹
    Like :exc:`ConnectionClosed`, when the connection terminated properly.

    A close code with code 1000 (OK) or 1001 (going away) or without a code was
    received and sent.

    Nr(   r-   r.   r/   r   r       ó   „ òr.   r   c                  ó   — e Zd ZdZy)r	   zì
    Like :exc:`ConnectionClosed`, when the connection terminated with an error.

    A close frame with a code other than 1000 (OK) or 1001 (going away) was
    received or sent, or the closing handshake didn't complete properly.

    Nr(   r-   r.   r/   r	   r	   ª   rP   r.   r	   c                  ó    — e Zd ZdZdd„Zdd„Zy)r
   zL
    Raised when connecting to a URI that isn't a valid WebSocket URI.

    c                ó    — || _         || _        y r3   ©ÚuriÚmsg)r8   rU   rV   s      r/   r9   zInvalidURI.__init__º   s   € ØˆŒØˆ�r.   c                ó8   — | j                   › d| j                  › �S )Nz isn't a valid URI: rT   r;   s    r/   r<   zInvalidURI.__str__¾   s   € Ø—(‘(�Ð/°·±¨zÐ:Ð:r.   N)rU   rL   rV   rL   rI   rJ   rK   ©r)   r*   r+   r,   r9   r<   r-   r.   r/   r
   r
   ´   s   „ ñó
ô;r.   r
   c                  ó    — e Zd ZdZdd„Zdd„Zy)r   z?
    Raised when connecting via a proxy that isn't valid.

    c                ó    — || _         || _        y r3   ©ÚproxyrV   )r8   r\   rV   s      r/   r9   zInvalidProxy.__init__È   s   € ØˆŒ
Øˆ�r.   c                ó8   — | j                   › d| j                  › �S )Nz isn't a valid proxy: r[   r;   s    r/   r<   zInvalidProxy.__str__Ì   s   € Ø—*‘*�Ð3°D·H±H°:Ð>Ð>r.   N)r\   rL   rV   rL   rI   rJ   rK   rX   r-   r.   r/   r   r   Â   s   „ ñó
ô?r.   r   c                  ó   — e Zd ZdZy)r   zM
    Base class for exceptions raised when the opening handshake fails.

    Nr(   r-   r.   r/   r   r   Ð   r0   r.   r   c                  ó   — e Zd ZdZy)r   zµ
    Raised when a handshake request or response breaks a security rule.

    Security limits can be configured with :doc:`environment variables
    <../reference/variables>`.

    Nr(   r-   r.   r/   r   r   ×   rP   r.   r   c                  ó   — e Zd ZdZy)r   zK
    Raised when the request line of a handshake request is too long.

    Nr(   r-   r.   r/   r   r   á   r0   r.   r   c                  ó   — e Zd ZdZy)r   zK
    Raised when the status line of a handshake response is too long.

    Nr(   r-   r.   r/   r   r   è   r0   r.   r   c                  ó   — e Zd ZdZy)r   zT
    Raised when a header line of a handshake request or response is too long.

    Nr(   r-   r.   r/   r   r   ï   r0   r.   r   c                  ó   — e Zd ZdZy)r   zL
    Raised when a handshake request or response has too many headers.

    Nr(   r-   r.   r/   r   r   ö   r0   r.   r   c                  ó   — e Zd ZdZy)r   z5
    Raised when failing to connect to a proxy.

    Nr(   r-   r.   r/   r   r   ý   r0   r.   r   c                  ó   — e Zd ZdZy)r   z;
    Raised when an HTTP proxy response is malformed.

    Nr(   r-   r.   r/   r   r     r0   r.   r   c                  ó    — e Zd ZdZdd„Zdd„Zy)r   z<
    Raised when an HTTP proxy rejects the connection.

    c                ó   — || _         y r3   ©Úresponse©r8   ri   s     r/   r9   zInvalidProxyStatus.__init__  ó	   € Ø ˆ�r.   c                ó6   — d| j                   j                  d›�S )Nz proxy rejected connection: HTTP Úd©ri   Ústatus_coder;   s    r/   r<   zInvalidProxyStatus.__str__  s   € Ø1°$·-±-×2KÑ2KÈAÐ1NÐOÐOr.   N©ri   zhttp11.ResponserI   rJ   rK   rX   r-   r.   r/   r   r     s   „ ñó
!ôPr.   r   c                  ó   — e Zd ZdZy)r   zD
    Raised when a handshake request or response is malformed.

    Nr(   r-   r.   r/   r   r     r0   r.   r   c                  ó    — e Zd ZdZdd„Zdd„Zy)r   z@
    Raised when a handshake request doesn't use HTTP GET.

    c                ó   — || _         y r3   ©Úmethod)r8   ru   s     r/   r9   zInvalidMethod.__init__%  s	   € Øˆ�r.   c                ó    — d| j                   › �S )Nzunsupported HTTP method: rt   r;   s    r/   r<   zInvalidMethod.__str__(  s   € Ø*¨4¯;©;¨-Ð8Ð8r.   N)ru   rL   rI   rJ   rK   rX   r-   r.   r/   r   r     s   „ ñó
ô9r.   r   c                  ó    — e Zd ZdZdd„Zdd„Zy)r   z@
    Raised when a handshake request doesn't use HTTP/1.1.

    c                ó   — || _         y r3   ©Úprotocol)r8   rz   s     r/   r9   zInvalidProtocol.__init__2  rk   r.   c                ó    — d| j                   › �S )Nzunsupported HTTP version: ry   r;   s    r/   r<   zInvalidProtocol.__str__5  s   € Ø+¨D¯M©M¨?Ð;Ð;r.   N)rz   rL   rI   rJ   rK   rX   r-   r.   r/   r   r   ,  s   „ ñó
!ô<r.   r   c                  ó    — e Zd ZdZdd„Zdd„Zy)r   zJ
    Raised when a handshake response rejects the WebSocket upgrade.

    c                ó   — || _         y r3   rh   rj   s     r/   r9   zInvalidStatus.__init__?  rk   r.   c                ó6   — d| j                   j                  d›�S )Nz+server rejected WebSocket connection: HTTP rm   rn   r;   s    r/   r<   zInvalidStatus.__str__B  s   € à9¸$¿-¹-×:SÑ:SÐTUÐ9VÐWð	
r.   Nrp   rK   rX   r-   r.   r/   r   r   9  s   „ ñó
!ô
r.   r   c                  ó"   — e Zd ZdZddd„Zdd„Zy)r   zK
    Raised when an HTTP header doesn't have a valid format or value.

    Nc                ó    — || _         || _        y r3   ©ÚnameÚvalue©r8   r‚   rƒ   s      r/   r9   zInvalidHeader.__init__N  ó   € ØˆŒ	Øˆ�
r.   c                ó°   — | j                   €d| j                  › d�S | j                   dk(  rd| j                  › d�S d| j                  › d| j                   › �S )Nzmissing z headerrF   zempty zinvalid z	 header: ©rƒ   r‚   r;   s    r/   r<   zInvalidHeader.__str__R  sY   € Ø�:‰:ÐØ˜dŸi™i˜[¨Ð0Ð0Ø�Z‰Z˜2ÒØ˜DŸI™I˜; gÐ.Ð.à˜dŸi™i˜[¨	°$·*±*°Ð>Ð>r.   r3   ©r‚   rL   rƒ   ú
str | NonerI   rJ   rK   rX   r-   r.   r/   r   r   H  s   „ ñô
ô?r.   r   c                  ó$   ‡ — e Zd ZdZdˆ fd„Zˆ xZS )r   z€
    Raised when an HTTP header cannot be parsed.

    The format of the header doesn't match the grammar for that header.

    c                ó6   •— t         ‰| �  ||› d|› d|› �«       y )Nz at z in ©Úsuperr9   )r8   r‚   ÚerrorÚheaderÚposÚ	__class__s        €r/   r9   zInvalidHeaderFormat.__init__c  s#   ø€ Ü‰Ñ˜ % ¨¨S¨E°°f°XÐ>Õ?r.   )
r‚   rL   rŽ   rL   r�   rL   r�   rM   rI   rJ   ©r)   r*   r+   r,   r9   Ú__classcell__©r‘   s   @r/   r   r   [  s   ø„ ñ÷@ñ @r.   r   c                  ó   — e Zd ZdZy)r   z�
    Raised when an HTTP header has a wrong value.

    The format of the header is correct but the value isn't acceptable.

    Nr(   r-   r.   r/   r   r   g  s   „ òr.   r   c                  ó$   ‡ — e Zd ZdZdˆ fd„Zˆ xZS )r   zD
    Raised when the Origin header in a request isn't allowed.

    c                ó&   •— t         ‰| �  d|«       y )NÚOriginrŒ   )r8   Úoriginr‘   s     €r/   r9   zInvalidOrigin.__init__v  s   ø€ Ü‰Ñ˜ 6Õ*r.   )r™   r‰   rI   rJ   r’   r”   s   @r/   r   r   p  s   ø„ ñ÷
+ñ +r.   r   c                  ó   — e Zd ZdZy)r   zF
    Raised when the Upgrade or Connection header isn't correct.

    Nr(   r-   r.   r/   r   r   z  r0   r.   r   c                  ó   — e Zd ZdZy)r   zG
    Raised when negotiating an extension or a subprotocol fails.

    Nr(   r-   r.   r/   r   r   �  r0   r.   r   c                  ó    — e Zd ZdZdd„Zdd„Zy)r    zK
    Raised when a parameter name is repeated in an extension header.

    c                ó   — || _         y r3   ©r‚   ©r8   r‚   s     r/   r9   zDuplicateParameter.__init__Ž  ó	   € Øˆ�	r.   c                ó    — d| j                   › �S )Nzduplicate parameter: rž   r;   s    r/   r<   zDuplicateParameter.__str__‘  s   € Ø& t§y¡y kÐ2Ð2r.   N©r‚   rL   rI   rJ   rK   rX   r-   r.   r/   r    r    ˆ  s   „ ñó
ô3r.   r    c                  ó    — e Zd ZdZdd„Zdd„Zy)r!   zJ
    Raised when a parameter name in an extension header is invalid.

    c                ó   — || _         y r3   rž   rŸ   s     r/   r9   zInvalidParameterName.__init__›  r    r.   c                ó    — d| j                   › �S )Nzinvalid parameter name: rž   r;   s    r/   r<   zInvalidParameterName.__str__ž  s   € Ø)¨$¯)©)¨Ð5Ð5r.   Nr¢   rK   rX   r-   r.   r/   r!   r!   •  s   „ ñó
ô6r.   r!   c                  ó    — e Zd ZdZdd„Zdd„Zy)r"   zK
    Raised when a parameter value in an extension header is invalid.

    c                ó    — || _         || _        y r3   r�   r„   s      r/   r9   zInvalidParameterValue.__init__¨  r…   r.   c                ó¬   — | j                   €d| j                  › �S | j                   dk(  rd| j                  › �S d| j                  › d| j                   › �S )Nzmissing value for parameter rF   zempty value for parameter zinvalid value for parameter z: r‡   r;   s    r/   r<   zInvalidParameterValue.__str__¬  sU   € Ø�:‰:ÐØ1°$·)±)°Ð=Ð=Ø�Z‰Z˜2ÒØ/°·	±	¨{Ð;Ð;à1°$·)±)°¸B¸t¿z¹z¸lÐKÐKr.   Nrˆ   rK   rX   r-   r.   r/   r"   r"   ¢  s   „ ñó
ôLr.   r"   c                  ó   — e Zd ZdZy)r#   a  
    Raised when receiving or sending a frame that breaks the protocol.

    The Sans-I/O implementation raises this exception when:

    * receiving or sending a frame that contains invalid data;
    * receiving or sending an invalid sequence of frames.

    Nr(   r-   r.   r/   r#   r#   µ  s   „ òr.   r#   c                  ó<   — e Zd ZdZ	 	 d	 	 	 	 	 	 	 dd„Zdd„Zd	d„Zy)
r$   aU  
    Raised when parsing a frame with a payload that exceeds the maximum size.

    The Sans-I/O layer uses this exception internally. It doesn't bubble up to
    the I/O layer.

    The :meth:`~websockets.extensions.Extension.decode` method of extensions
    must raise :exc:`PayloadTooBig` if decoding a frame would exceed the limit.

    Nc                óÚ   — t        |t        «      r*|�J ‚|�J ‚t        j                  dt        «       || _        y d | _        || _        |€J ‚|| _        d | _        | j                  |«       y )NzMPayloadTooBig(message) is deprecated; change to PayloadTooBig(size, max_size))
Ú
isinstancerL   r>   r?   r@   ÚmessageÚsizeÚmax_sizeÚcurrent_sizeÚset_current_size)r8   Úsize_or_messager¯   r°   s       r/   r9   zPayloadTooBig.__init__Í  sz   € ô �o¤sÔ+ØÐ#Ð#Ð#ØÐ'Ð'Ð'Ü�M‰Mð:ä"ôð
 (7ˆD�LàˆDŒLØ$3ˆDŒIØÐ'Ð'Ð'Ø!)ˆDŒMØ,0ˆDÔØ×!Ñ! ,Õ/r.   c                óÜ   — | j                   �| j                   S d}| j                  �|d| j                  › d�z  }| j                  �|d| j                  › d�z  }|d| j                  › d�z  }|S )Nzframe zwith z bytes zafter reading zexceeds limit of z bytes)r­   r®   r°   r¯   )r8   r­   s     r/   r<   zPayloadTooBig.__str__ä  s   € Ø�<‰<Ð#Ø—<‘<ÐàˆGØ�y‰yÐ$Ø˜U 4§9¡9 +¨WÐ5Ñ5�Ø× Ñ Ð,Ø˜^¨D×,=Ñ,=Ð+>¸gÐFÑF�ØÐ*¨4¯=©=¨/¸Ð@Ñ@ˆGØˆNr.   c                ó^   — | j                   �J ‚|�| xj                  |z  c_        || _         y y r3   )r°   r¯   )r8   r°   s     r/   r±   zPayloadTooBig.set_current_sizeð  s5   € Ø× Ñ Ð(Ð(Ð(ØÐ#Ø�MŠM˜\Ñ)�MØ ,ˆDÕð $r.   )NN)r²   zint | None | strr¯   ú
int | Noner°   rµ   rI   rJ   rK   )r°   rµ   rI   rJ   )r)   r*   r+   r,   r9   r<   r±   r-   r.   r/   r$   r$   Á  sD   „ ñ	ð  $Ø#'ð	0à)ð0ð ð0ð !ð	0ð
 
ó0ó.
ô-r.   r$   c                  ó$   ‡ — e Zd ZdZdˆ fd„Zˆ xZS )r   z?Raised when reassembling message that contains too many frames.c                ó,   •— t         ‰| �  d|› d�«       y )Nz$fragmented message exceeds limit of z framesrŒ   )r8   Úmax_fragmentsr‘   s     €r/   r9   zTooManyFragments.__init__ú  s   ø€ Ü‰ÑÐ?À¸ÈgÐVÕWr.   )r¸   rM   rI   rJ   r’   r”   s   @r/   r   r   ÷  s   ø„ ÙI÷Xñ Xr.   r   c                  ó   — e Zd ZdZy)r%   až  
    Raised when sending a frame is forbidden in the current state.

    Specifically, the Sans-I/O layer raises this exception when:

    * sending a data frame to a connection in a state other
      :attr:`~websockets.protocol.State.OPEN`;
    * sending a control frame to a connection in a state other than
      :attr:`~websockets.protocol.State.OPEN` or
      :attr:`~websockets.protocol.State.CLOSING`.

    Nr(   r-   r.   r/   r%   r%   þ  s   „ òr.   r%   c                  ó   — e Zd ZdZy)r&   zÜ
    Raised when receiving or sending messages concurrently.

    WebSocket is a connection-oriented protocol. Reads must be serialized; so
    must be writes. However, reading and writing concurrently is possible.

    Nr(   r-   r.   r/   r&   r&     rP   r.   r&   )rA   Úhttp11z.legacy.exceptions)ÚAbortHandshakeÚInvalidStatusCodeÚRedirectHandshakeÚWebSocketProtocolError)Údeprecated_aliases)/r,   Ú
__future__r   r>   Úimportsr   Ú__all__Ú	Exceptionr   r   r   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r   ÚAssertionErrorr%   ÚRuntimeErrorr&   rF   rA   r»   Úglobalsr-   r.   r/   ú<module>rÈ      sõ  ðñ(õT #ã å  ò"€ôJ˜ô ô? Ð)ô ? ôDÐ)ô ôÐ,ô ô;Ð#ô ;ô?Ð%ô ?ôÐ)ô ôÐ$ô ô˜ô ô˜ô ô˜ô ô�]ô ôÐ!ô ô˜*ô ô
P˜ô 
PôÐ%ô ô
9Ð$ô 
9ô
<Ð&ô 
<ô
Ð$ô 
ô?Ð$ô ?ô&	@˜-ô 	@ô˜ô ô+�Mô +ô�]ô ôÐ'ô ô
3Ð)ô 
3ô
6Ð+ô 
6ôLÐ,ô Lô&	Ð&ô 	ô3-Ð&ô 3-ôlXÐ)ô XôÐ% ~ô ôÐ)¨<ô ÷ ñ ÙƒIð /Ø1Ø1Ø"6ñö	r.   