Ë
    Õ±1hÏ  ã                  ó0   — d dl mZ d dlmZ  G d„ d«      Zy)é    )Úannotations)Ú	Generatorc                  óP   — e Zd ZdZdd„Zdd„Zdd„Zdd„Zdd„Zdd„Z	dd„Z
dd	„Zy
)ÚStreamReaderzÄ
    Generator-based stream reader.

    This class doesn't support concurrent calls to :meth:`read_line`,
    :meth:`read_exact`, or :meth:`read_to_eof`. Make sure calls are
    serialized.

    c                ó0   — t        «       | _        d| _        y )NF)Ú	bytearrayÚbufferÚeof©Úselfs    úP/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/websockets/streams.pyÚ__init__zStreamReader.__init__   s   € Ü“kˆŒØˆ�ó    c              #  ód  K  — d}d}	 | j                   j                  d|«      dz   }|dkD  rnLt        | j                   «      }||kD  rt        d|› d|› d�«      ‚| j                  rt        d|› d�«      ‚d	–— Œq||kD  rt        d|› d|› d�«      ‚| j                   d	| }| j                   d	|…= |S ­w)
a…  
        Read a LF-terminated line from the stream.

        This is a generator-based coroutine.

        The return value includes the LF character.

        Args:
            m: Maximum number bytes to read; this is a security limit.

        Raises:
            EOFError: If the stream ends without a LF.
            RuntimeError: If the stream ends in more than ``m`` bytes.

        r   ó   
é   úread ú bytes, expected no more than ú bytesústream ends after z bytes, before end of lineN)r	   ÚfindÚlenÚRuntimeErrorr
   ÚEOFError)r   ÚmÚnÚpÚrs        r   Ú	read_linezStreamReader.read_line   sÖ   è ø€ ð  ˆØˆØØ—‘× Ñ  ¨Ó*¨QÑ.ˆAØ�1ŠuØÜ�D—K‘KÓ ˆAØ�1ŠuÜ" U¨1¨#Ð-KÈAÈ3ÈfÐ#UÓVÐVØ�xŠxÜÐ!3°A°3Ð6PÐQÓRÐRÛð ð ˆqŠ5Ü  q cÐ)GÈÀsÈ&ÐQÓRÐRØ�K‰K˜˜ˆOˆØ�K‰K˜˜˜ˆOØˆùs   ‚B.B0c              #  ó(  K  — |dk\  sJ ‚t        | j                  «      |k  rP| j                  r't        | j                  «      }t        d|› d|› d�«      ‚d–— t        | j                  «      |k  rŒP| j                  d| }| j                  d|…= |S ­w)zø
        Read a given number of bytes from the stream.

        This is a generator-based coroutine.

        Args:
            n: How many bytes to read.

        Raises:
            EOFError: If the stream ends in less than ``n`` bytes.

        r   r   z bytes, expected r   N)r   r	   r
   r   )r   r   r   r   s       r   Ú
read_exactzStreamReader.read_exact6   s�   è ø€ ð �AŠvˆˆvÜ�$—+‘+Ó Ò"Ø�xŠxÜ˜Ÿ™Ó$�ÜÐ!3°A°3Ð6GÈÀsÈ&ÐQÓRÐRÛô	 �$—+‘+Ó Ó"ð
 �K‰K˜˜ˆOˆØ�K‰K˜˜˜ˆOØˆùs   ‚A/BÁ2 Bc              #  óÜ   K  — | j                   s=t        | j                  «      }||kD  rt        d|› d|› d�«      ‚d–— | j                   sŒ=| j                  dd }| j                  dd…= |S ­w)a  
        Read all bytes from the stream.

        This is a generator-based coroutine.

        Args:
            m: Maximum number bytes to read; this is a security limit.

        Raises:
            RuntimeError: If the stream ends in more than ``m`` bytes.

        r   r   r   N)r
   r   r	   r   )r   r   r   r   s       r   Úread_to_eofzStreamReader.read_to_eofM   sj   è ø€ ð —(’(Ü�D—K‘KÓ ˆAØ�1ŠuÜ" U¨1¨#Ð-KÈAÈ3ÈfÐ#UÓVÐVÛð	 —(“(ð
 �K‰K™ˆNˆØ�K‰KšˆNØˆùs   ‚A	A,Á A,c              #  óJ   K  — 	 | j                   ry| j                  ryd–— Œ­w)zy
        Tell whether the stream has ended and all data was read.

        This is a generator-based coroutine.

        TFN)r	   r
   r   s    r   Úat_eofzStreamReader.at_eofc   s)   è ø€ ð Ø�{Š{ØØ�xŠxØó ð ùs   ‚!#c                ó\   — | j                   rt        d«      ‚| xj                  |z  c_        y)zà
        Write data to the stream.

        :meth:`feed_data` cannot be called after :meth:`feed_eof`.

        Args:
            data: Data to write.

        Raises:
            EOFError: If the stream has ended.

        ústream endedN)r
   r   r	   )r   Údatas     r   Ú	feed_datazStreamReader.feed_datas   s$   € ð �8Š8Ü˜>Ó*Ð*Ø�Š�tÑŽr   c                ó@   — | j                   rt        d«      ‚d| _         y)z�
        End the stream.

        :meth:`feed_eof` cannot be called more than once.

        Raises:
            EOFError: If the stream has ended.

        r'   TN)r
   r   r   s    r   Úfeed_eofzStreamReader.feed_eof„   s   € ð �8Š8Ü˜>Ó*Ð*Øˆ�r   c                ó"   — | j                   dd…= y)zG
        Discard all buffered data, but don't end the stream.

        N)r	   r   s    r   ÚdiscardzStreamReader.discard’   s   € ð
 �K‰Kš‰Nr   N)ÚreturnÚNone)r   Úintr.   úGenerator[None, None, bytes])r   r0   r.   r1   )r.   zGenerator[None, None, bool])r(   Úbytesr.   r/   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r!   r#   r%   r)   r+   r-   © r   r   r   r      s0   „ ñóó óDó.ó,ó ó"ôr   r   N)Ú
__future__r   Úcollections.abcr   r   r7   r   r   ú<module>r:      s   ðÝ "å %÷Qò Qr   