§
    JŠtjÏ  ã                  ó8   — d dl mZ d dlmZ  G d„ d¦  «        ZdS )é    )Úannotations)Ú	Generatorc                  óR   — 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dS )Ú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.

    ÚreturnÚNonec                ó:   — t          ¦   «         | _        d| _        d S )NF)Ú	bytearrayÚbufferÚeof©Úselfs    úP/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/websockets/streams.pyÚ__init__zStreamReader.__init__   s   € Ý‘k”kˆŒØˆŒˆˆó    ÚmÚintúGenerator[None, None, bytes]c              #  óf  K  — d}d}	 | j                              d|¦  «        dz   }|dk    rnOt          | j         ¦  «        }||k    rt          d|› d|› d�¦  «        ‚| j        rt          d|› d	�¦  «        ‚d
V — Œt||k    rt          d|› d|› d�¦  «        ‚| j         d
|…         }| j         d
|…= |S )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   Tó   
é   úread ú bytes, expected no more than ú bytesústream ends after z bytes, before end of lineN)r   ÚfindÚlenÚRuntimeErrorr   ÚEOFError)r   r   ÚnÚpÚrs        r   Ú	read_linezStreamReader.read_line   sú   è è € ð  ˆØˆð		Ø”× Ò  ¨Ñ*Ô*¨QÑ.ˆAØ�1ŠuˆuØÝ�D”KÑ Ô ˆAØ�1ŠuˆuÝ"Ð#U¨1Ð#UÐ#UÈAÐ#UÐ#UÐ#UÑVÔVÐVØŒxð SÝÐQ°AÐQÐQÐQÑRÔRÐRØˆEˆEˆEð		ð ˆqŠ5ˆ5ÝÐQ qÐQÐQÈÐQÐQÐQÑRÔRÐRØŒK˜˜˜ŒOˆØŒK˜˜˜ˆOØˆr   r    c              #  ó  K  — |dk    sJ ‚t          | j        ¦  «        |k     rM| j        r*t          | j        ¦  «        }t          d|› d|› d�¦  «        ‚dV — t          | j        ¦  «        |k     °M| j        d|…         }| j        d|…= |S )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ˆvˆvÝ�$”+ÑÔ Ò"Ð"ØŒxð SÝ˜œÑ$Ô$�ÝÐQ°AÐQÐQÈÐQÐQÐQÑRÔRÐRØˆEˆEˆEõ	 �$”+ÑÔ Ò"Ð"ð
 ŒK˜˜˜ŒOˆØŒK˜˜˜ˆOØˆr   c              #  óÀ   K  — | j         s;t          | j        ¦  «        }||k    rt          d|› d|› d�¦  «        ‚dV — | j         ¯;| j        dd…         }| j        dd…= |S )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   s„   è è € ð ”(ð 	Ý�D”KÑ Ô ˆAØ�1ŠuˆuÝ"Ð#U¨1Ð#UÐ#UÈAÐ#UÐ#UÐ#UÑVÔVÐVØˆEˆEˆEð	 ”(ð 	ð
 ŒK˜˜˜ŒNˆØŒK˜˜˜ˆNØˆr   úGenerator[None, None, bool]c              #  ó6   K  — 	 | j         rdS | j        rdS dV — Œ)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   s9   è è € ð	ØŒ{ð Ø�uØŒxð Ø�tð ˆEˆEˆEð	r   ÚdataÚbytesc                óR   — | j         rt          d¦  «        ‚| xj        |z  c_        dS )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   r+   s     r   Ú	feed_datazStreamReader.feed_datas   s0   € ð Œ8ð 	+Ý˜>Ñ*Ô*Ð*ØˆŒ�tÑˆŒˆˆr   c                ó@   — | j         rt          d¦  «        ‚d| _         dS )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ð 	+Ý˜>Ñ*Ô*Ð*ØˆŒˆˆr   c                ó   — | j         dd…= dS )zG
        Discard all buffered data, but don't end the stream.

        N)r   r   s    r   ÚdiscardzStreamReader.discard’   s   € ð
 ŒK˜˜˜ˆNˆNˆNr   N)r   r   )r   r   r   r   )r    r   r   r   )r   r(   )r+   r,   r   r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r#   r%   r'   r*   r/   r1   r3   © r   r   r   r      s¿   € € € € € ðð ðð ð ð ð ð  ð  ð  ðDð ð ð ð.ð ð ð ð,ð ð ð ð ð ð ð ð"ð ð ð ðð ð ð ð ð r   r   N)Ú
__future__r   Úcollections.abcr   r   r8   r   r   ú<module>r;      se   ðØ "Ð "Ð "Ð "Ð "Ð "à %Ð %Ð %Ð %Ð %Ð %ðQð Qð Qð Qð Qñ Qô Qð Qð Qð Qr   