Ë
    $Æ%h.  ã                   ó`  — d dl Z d dlmZ d dlmZ d dlmZmZmZ ddl	m
Z
mZ ddlmZmZ ddlmZmZmZ g d	¢Z e j(                   e
j*                  d
«      «      Z e j(                   ej*                  d
«      «      Z G d„ de«      Z edd¬«       G d„ de«      «       Z edd¬«       G d„ de«      «       Z edd¬«       G d„ de«      «       Z edd¬«       G d„ de«      «       Z edd¬«       G d„ de«      «       Z edd¬«       G d„ de«      «       Z ed¬«       G d„ de«      «       Zy)é    N)ÚABC)Ú	dataclass)ÚListÚTupleÚUnioné   )ÚmethodÚrequest_target)ÚHeadersÚnormalize_and_validate)ÚbytesifyÚLocalProtocolErrorÚvalidate)ÚEventÚRequestÚInformationalResponseÚResponseÚDataÚEndOfMessageÚConnectionClosedÚasciic                   ó   — e Zd ZdZdZy)r   z$
    Base class for h11 events.
    © N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú	__slots__r   ó    úI/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/h11/_events.pyr   r       s   „ ñð �Ir   r   FT)ÚinitÚfrozenc                   óÀ   ‡ — e Zd ZU dZdZeed<   eed<   eed<   eed<   ddd	œdeee	f   deee
eeef      e
ee	e	f      f   deee	f   deee	f   d
eddfˆ fd„ZdZˆ xZS )r   an  The beginning of an HTTP request.

    Fields:

    .. attribute:: method

       An HTTP method, e.g. ``b"GET"`` or ``b"POST"``. Always a byte
       string. :term:`Bytes-like objects <bytes-like object>` and native
       strings containing only ascii characters will be automatically
       converted to byte strings.

    .. attribute:: target

       The target of an HTTP request, e.g. ``b"/index.html"``, or one of the
       more exotic formats described in `RFC 7320, section 5.3
       <https://tools.ietf.org/html/rfc7230#section-5.3>`_. Always a byte
       string. :term:`Bytes-like objects <bytes-like object>` and native
       strings containing only ascii characters will be automatically
       converted to byte strings.

    .. attribute:: headers

       Request headers, represented as a list of (name, value) pairs. See
       :ref:`the header normalization rules <headers-format>` for details.

    .. attribute:: http_version

       The HTTP protocol version, represented as a byte string like
       ``b"1.1"``. See :ref:`the HTTP version normalization rules
       <http_version-format>` for details.

    )r	   ÚheadersÚtargetÚhttp_versionr	   r$   r%   r&   ó   1.1F)r&   Ú_parsedr(   ÚreturnNc                ó  •— t         ‰	| �  «        t        |t        «      rt        j                  | d|«       n"t        j                  | dt        ||¬«      «       |sat        j                  | dt        |«      «       t        j                  | dt        |«      «       t        j                  | dt        |«      «       nEt        j                  | d|«       t        j                  | d|«       t        j                  | d|«       d}| j                  D ]  \  }}|dk(  sŒ|dz  }Œ | j                  d	k(  r|dk(  rt        d
«      ‚|dkD  rt        d«      ‚t        t        | j                  d«       t        t        | j                  d«       y )Nr$   ©r(   r	   r%   r&   r   s   hostr   r'   zMissing mandatory Host: headerzFound multiple Host: headerszIllegal method characterszIllegal target characters)ÚsuperÚ__init__Ú
isinstancer   ÚobjectÚ__setattr__r   r   r$   r&   r   r   Ú	method_rer	   Úrequest_target_rer%   )
Úselfr	   r$   r%   r&   r(   Ú
host_countÚnameÚvalueÚ	__class__s
            €r    r-   zRequest.__init__R   sO  ø€ ô 	‰ÑÔÜ�gœwÔ'Ü×Ñ˜t Y°Õ8ä×ÑØ�iÔ!7¸ÈÔ!Qôñ Ü×Ñ˜t X¬x¸Ó/?Ô@Ü×Ñ˜t X¬x¸Ó/?Ô@Ü×Ñ˜t ^´X¸lÓ5KÕLä×Ñ˜t X¨vÔ6Ü×Ñ˜t X¨vÔ6Ü×Ñ˜t ^°\ÔBð ˆ
ØŸ<™<ò 	 ‰KˆD�%Ø�w‹Ø˜a‘‘
ð	 ð ×Ñ Ò&¨:¸ª?Ü$Ð%EÓFÐFØ˜Š>Ü$Ð%CÓDÐDä”˜DŸK™KÐ)DÔEÜÔ" D§K¡KÐ1LÕMr   )r   r   r   r   r   ÚbytesÚ__annotations__r   r   Ústrr   r   Úboolr-   Ú__hash__Ú__classcell__©r7   s   @r    r   r   (   sÁ   ø… ñðB @€IàƒMØÓØƒMØÓð +1Øò(Nð �e˜S�jÑ!ð(Nð �w  U¨5°%¨<Ñ%8Ñ 9¸4ÀÀcÈ3ÀhÁÑ;PÐPÑQð	(Nð
 �e˜S�jÑ!ð(Nð ˜E 3˜JÑ'ð(Nð ð(Nð 
õ(NðV „Hr   r   c                   ó¼   ‡ — e Zd ZU dZeed<   eed<   eed<   eed<   dddd	œdeee	e
eef      e	e
eef      f   dedeeef   deeef   d
eddfˆ fd„Zdd„ZdZˆ xZS )Ú_ResponseBase)r$   r&   ÚreasonÚstatus_coder$   r&   rA   rB   r'   r   F)r&   rA   r(   r(   r)   Nc                ó\  •— t         ‰| �  «        t        |t        «      rt        j                  | d|«       n"t        j                  | dt        ||¬«      «       |s|t        j                  | dt        |«      «       t        j                  | dt        |«      «       t        |t        «      st        d«      ‚t        j                  | dt        |«      «       nEt        j                  | d|«       t        j                  | d|«       t        j                  | d|«       | j                  «        y )Nr$   r+   rA   r&   zstatus code must be integerrB   )r,   r-   r.   r   r/   r0   r   r   Úintr   Ú__post_init__)r3   r$   rB   r&   rA   r(   r7   s         €r    r-   z_ResponseBase.__init__‰   sí   ø€ ô 	‰ÑÔÜ�gœwÔ'Ü×Ñ˜t Y°Õ8ä×ÑØ�iÔ!7¸ÈÔ!Qôñ Ü×Ñ˜t X¬x¸Ó/?Ô@Ü×Ñ˜t ^´X¸lÓ5KÔLÜ˜k¬3Ô/Ü(Ð)FÓGÐGô ×Ñ˜t ]´C¸Ó4DÕEä×Ñ˜t X¨vÔ6Ü×Ñ˜t ^°\ÔBÜ×Ñ˜t ]°KÔ@à×ÑÕr   c                  ó   — y )Nr   ©r3   s    r    rE   z_ResponseBase.__post_init__¨   s   € Ør   ©r)   N)r   r   r   r   r   r9   r8   rD   r   r   r   r:   r;   r-   rE   r<   r=   r>   s   @r    r@   r@   €   s°   ø… àD€IàÓØÓØƒMØÓð +1Ø$'Øòð �w  U¨5°%¨<Ñ%8Ñ 9¸4ÀÀcÈ3ÀhÁÑ;PÐPÑQðð ð	ð
 ˜E 3˜JÑ'ðð �e˜S�jÑ!ðð ðð 
õó>ð „Hr   r@   c                   ó   — e Zd ZdZdd„ZdZy)r   a  An HTTP informational response.

    Fields:

    .. attribute:: status_code

       The status code of this response, as an integer. For an
       :class:`InformationalResponse`, this is always in the range [100,
       200).

    .. attribute:: headers

       Request headers, represented as a list of (name, value) pairs. See
       :ref:`the header normalization rules <headers-format>` for
       details.

    .. attribute:: http_version

       The HTTP protocol version, represented as a byte string like
       ``b"1.1"``. See :ref:`the HTTP version normalization rules
       <http_version-format>` for details.

    .. attribute:: reason

       The reason phrase of this response, as a byte string. For example:
       ``b"OK"``, or ``b"Not Found"``.

    Nc                 óz   — d| j                   cxk  rdk  s&n t        dj                  | j                   «      «      ‚y )Néd   éÈ   zGInformationalResponse status_code should be in range [100, 200), not {}©rB   r   ÚformatrG   s    r    rE   z#InformationalResponse.__post_init__Î   s<   € Ø�t×'Ñ'Ô-¨#Ô-Ü$ð%ß%+¡V¨D×,<Ñ,<Ó%=óð ð .r   rH   ©r   r   r   r   rE   r<   r   r   r    r   r   ¯   s   „ ñó:ð �Hr   r   c                   ó   — e Zd ZdZdd„ZdZy)r   añ  The beginning of an HTTP response.

    Fields:

    .. attribute:: status_code

       The status code of this response, as an integer. For an
       :class:`Response`, this is always in the range [200,
       1000).

    .. attribute:: headers

       Request headers, represented as a list of (name, value) pairs. See
       :ref:`the header normalization rules <headers-format>` for details.

    .. attribute:: http_version

       The HTTP protocol version, represented as a byte string like
       ``b"1.1"``. See :ref:`the HTTP version normalization rules
       <http_version-format>` for details.

    .. attribute:: reason

       The reason phrase of this response, as a byte string. For example:
       ``b"OK"``, or ``b"Not Found"``.

    Nc                 óz   — d| j                   cxk  rdk  s&n t        dj                  | j                   «      «      ‚y )NrL   iè  z;Response status_code should be in range [200, 1000), not {}rM   rG   s    r    rE   zResponse.__post_init__÷   s>   € Ø�t×'Ñ'Ô.¨$Ô.Ü$ØM×TÑTØ×$Ñ$óóð ð /r   rH   rO   r   r   r    r   r   Ù   s   „ ñó8ð �Hr   r   c            	       óT   — e Zd ZU dZdZeed<   eed<   eed<   	 d	dedededdfd„ZdZ	y)
r   a  Part of an HTTP message body.

    Fields:

    .. attribute:: data

       A :term:`bytes-like object` containing part of a message body. Or, if
       using the ``combine=False`` argument to :meth:`Connection.send`, then
       any object that your socket writing code knows what to do with, and for
       which calling :func:`len` returns the number of bytes that will be
       written -- see :ref:`sendfile` for details.

    .. attribute:: chunk_start

       A marker that indicates whether this data object is from the start of a
       chunked transfer encoding chunk. This field is ignored when when a Data
       event is provided to :meth:`Connection.send`: it is only valid on
       events emitted from :meth:`Connection.next_event`. You probably
       shouldn't use this attribute at all; see
       :ref:`chunk-delimiters-are-bad` for details.

    .. attribute:: chunk_end

       A marker that indicates whether this data object is the last for a
       given chunked transfer encoding chunk. This field is ignored when when
       a Data event is provided to :meth:`Connection.send`: it is only valid
       on events emitted from :meth:`Connection.next_event`. You probably
       shouldn't use this attribute at all; see
       :ref:`chunk-delimiters-are-bad` for details.

    )ÚdataÚchunk_startÚ	chunk_endrS   rT   rU   r)   Nc                 óŽ   — t         j                  | d|«       t         j                  | d|«       t         j                  | d|«       y )NrS   rT   rU   )r/   r0   )r3   rS   rT   rU   s       r    r-   zData.__init__+  s:   € ô 	×Ñ˜4 ¨Ô.Ü×Ñ˜4 °Ô<Ü×Ñ˜4 ¨iÕ8r   )FF)
r   r   r   r   r   r8   r9   r;   r-   r<   r   r   r    r   r     sR   … ñð@ 5€Ià
ƒKØÓØƒOð INñ9Øð9Ø(,ð9ØAEð9à	ó9ð �Hr   r   c            	       óz   ‡ — e Zd ZU dZdZeed<   dddœdeeee	e
e
f      ee	eef      df   deddfˆ fd	„ZdZˆ xZS )
r   aj  The end of an HTTP message.

    Fields:

    .. attribute:: headers

       Default value: ``[]``

       Any trailing headers attached to this message, represented as a list of
       (name, value) pairs. See :ref:`the header normalization rules
       <headers-format>` for details.

       Must be empty unless ``Transfer-Encoding: chunked`` is in use.

    )r$   r$   NF)r$   r(   r(   r)   c                ó¦   •— t         ‰| �  «        |€t        g «      }nt        |t        «      st	        ||¬«      }t
        j                  | d|«       y )Nr+   r$   )r,   r-   r   r.   r   r/   r0   )r3   r$   r(   r7   s      €r    r-   zEndOfMessage.__init__Q  sF   ø€ ô 	‰ÑÔØˆ?Ü˜b“k‰GÜ˜G¤WÔ-Ü,¨W¸gÔFˆGä×Ñ˜4 ¨GÕ4r   )r   r   r   r   r   r   r9   r   r   r   r8   r:   r;   r-   r<   r=   r>   s   @r    r   r   ;  ss   ø… ñð  €IàÓð Øò5ð Ø�T˜%  u Ñ-Ñ.°°U¸3À¸8±_Ñ0EÀtÐKñ
ð5ð ð5ð 
õ5ð" „Hr   r   )r"   c                   ó   — e Zd ZdZy)r   aA  This event indicates that the sender has closed their outgoing
    connection.

    Note that this does not necessarily mean that they can't *receive* further
    data, because TCP connections are composed to two one-way channels which
    can be closed independently. See :ref:`closing` for details.

    No fields.
    N)r   r   r   r   r   r   r    r   r   e  s   „ ñð 	r   r   ) ÚreÚabcr   Údataclassesr   Útypingr   r   r   Ú_abnfr	   r
   Ú_headersr   r   Ú_utilr   r   r   Ú__all__ÚcompileÚencoder1   r2   r   r   r@   r   r   r   r   r   r   r   r    ú<module>rd      sf  ðó 
Ý Ý !ß %Ñ %ç )ß 5ß 9Ñ 9ò€ð ˆB�J‰J�}�v—}‘} WÓ-Ó.€	Ø�B—J‘JÐ4˜~×4Ñ4°WÓ=Ó>Ð ôˆCô ñ �˜dÔ#ôTˆeó Tó $ðTñn �˜dÔ#ô+�Eó +ó $ð+ñ\ �˜dÔ#ô&˜Mó &ó $ð&ñR �˜dÔ#ô&ˆ}ó &ó $ð&ñR �˜dÔ#ô/ˆ5ó /ó $ð/ñn �˜dÔ#ô&�5ó &ó $ð&ñR �$Ôô	�uó 	ó ñ	r   