Ë
    ”2ÚiS)  ã                   óü   — d Z ddlmZ ddlZddlmZ dZddd	d
dœZi Zd„ Z	d„ Z
d„ Z G d„ de«      Z e
d«      Z e
d«      Z e
d«      Zd d„Zd„ Zedfd„Zd d„Zd„ Zedfd„Zd„ Z G d„ de«      Z G d„ de«      Zy)!a  

    webencodings
    ~~~~~~~~~~~~

    This is a Python implementation of the `WHATWG Encoding standard
    <http://encoding.spec.whatwg.org/>`. See README for details.

    :copyright: Copyright 2012 by Simon Sapin
    :license: BSD, see LICENSE for details.

é    )Úunicode_literalsNé   )ÚLABELSz0.5.1z
iso-8859-8zmac-cyrillicz	mac-romanÚcp874)ziso-8859-8-izx-mac-cyrillicÚ	macintoshzwindows-874c                 ó^   — | j                  d«      j                  «       j                  d«      S )a9  Transform (only) ASCII letters to lower case: A-Z is mapped to a-z.

    :param string: An Unicode string.
    :returns: A new Unicode string.

    This is used for `ASCII case-insensitive
    <http://encoding.spec.whatwg.org/#ascii-case-insensitive>`_
    matching of encoding labels.
    The same matching is also used, among other things,
    for `CSS keywords <http://dev.w3.org/csswg/css-values/#keywords>`_.

    This is different from the :meth:`~py:str.lower` method of Unicode strings
    which also affect non-ASCII characters,
    sometimes mapping them into the ASCII range:

        >>> keyword = u'Bac\N{KELVIN SIGN}ground'
        >>> assert keyword.lower() == u'background'
        >>> assert ascii_lower(keyword) != keyword.lower()
        >>> assert ascii_lower(keyword) == u'bac\N{KELVIN SIGN}ground'

    Úutf8)ÚencodeÚlowerÚdecode)Ústrings    úL/var/www/html/acx/venv/lib/python3.12/site-packages/webencodings/__init__.pyÚascii_lowerr   #   s'   € ð. �=‰=˜Ó ×&Ñ&Ó(×/Ñ/°Ó7Ð7ó    c                 ó0  — t        | j                  d«      «      } t        j                  | «      }|€yt        j                  |«      }|€L|dk(  rddlm} n+t        j                  ||«      }t        j                  |«      }t        ||«      }|t        |<   |S )u<  
    Look for an encoding by its label.
    This is the specâ€™s `get an encoding
    <http://encoding.spec.whatwg.org/#concept-encoding-get>`_ algorithm.
    Supported labels are listed there.

    :param label: A string.
    :returns:
        An :class:`Encoding` object, or :obj:`None` for an unknown label.

    z	
 Nzx-user-definedr   )Ú
codec_info)r   Ústripr   ÚgetÚCACHEÚx_user_definedr   ÚPYTHON_NAMESÚcodecsÚlookupÚEncoding)ÚlabelÚnameÚencodingr   Úpython_names        r   r   r   =   s†   € ô ˜Ÿ™ KÓ0Ó1€EÜ�:‰:�eÓ€DØ€|ØÜ�y‰y˜‹€HØÐØÐ#Ò#Þ2ä&×*Ñ*¨4°Ó6ˆKäŸ™ {Ó3ˆJÜ˜D *Ó-ˆØŒˆd‰Ø€Or   c                 óX   — t        | d«      r| S t        | «      }|€t        d| z  «      ‚|S )zç
    Accept either an encoding object or label.

    :param encoding: An :class:`Encoding` object or a label string.
    :returns: An :class:`Encoding` object.
    :raises: :exc:`~exceptions.LookupError` for an unknown label.

    r   zUnknown encoding label: %r)Úhasattrr   ÚLookupError)Úencoding_or_labelr   s     r   Ú_get_encodingr#   [   s=   € ô Ð  ,Ô/Ø Ð äÐ'Ó(€HØÐÜÐ6Ð9JÑJÓKÐKØ€Or   c                   ó   — e Zd ZdZd„ Zd„ Zy)r   aO  Reresents a character encoding such as UTF-8,
    that can be used for decoding or encoding.

    .. attribute:: name

        Canonical name of the encoding

    .. attribute:: codec_info

        The actual implementation of the encoding,
        a stdlib :class:`~codecs.CodecInfo` object.
        See :func:`codecs.register`.

    c                 ó    — || _         || _        y ©N)r   r   )Úselfr   r   s      r   Ú__init__zEncoding.__init__|   s   € ØˆŒ	Ø$ˆ�r   c                 ó    — d| j                   z  S )Nz<Encoding %s>)r   )r'   s    r   Ú__repr__zEncoding.__repr__€   s   € Ø §¡Ñ*Ð*r   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r(   r*   © r   r   r   r   m   s   „ ñò%ó+r   r   zutf-8zutf-16lezutf-16bec                 ó‚   — t        |«      }t        | «      \  }} |xs |}|j                  j                  | |«      d   |fS )aÖ  
    Decode a single string.

    :param input: A byte string
    :param fallback_encoding:
        An :class:`Encoding` object or a label string.
        The encoding to use if :obj:`input` does note have a BOM.
    :param errors: Type of error handling. See :func:`codecs.register`.
    :raises: :exc:`~exceptions.LookupError` for an unknown encoding label.
    :return:
        A ``(output, encoding)`` tuple of an Unicode string
        and an :obj:`Encoding`.

    r   )r#   Ú_detect_bomr   r   )ÚinputÚfallback_encodingÚerrorsÚbom_encodingr   s        r   r   r   ‹   sM   € ô  &Ð&7Ó8ÐÜ% eÓ,Ñ€L�%ØÒ0Ð0€HØ×Ñ×%Ñ% e¨VÓ4°QÑ7¸ÐAÐAr   c                 ó²   — | j                  d«      rt        | dd fS | j                  d«      rt        | dd fS | j                  d«      rt        | dd fS d| fS )zBReturn (bom_encoding, input), with any BOM removed from the input.s   ÿþé   Ns   þÿs   ï»¿é   )Ú
startswithÚ_UTF16LEÚ_UTF16BEÚUTF8)r2   s    r   r1   r1   ¡   sh   € à×Ñ˜Ô$Ü˜˜q˜r˜Ð"Ð"Ø×Ñ˜Ô$Ü˜˜q˜r˜Ð"Ð"Ø×Ñ˜Ô(Ü�U˜1˜2�YˆÐØ�ˆ;Ðr   Ústrictc                 óR   — t        |«      j                  j                  | |«      d   S )a;  
    Encode a single string.

    :param input: An Unicode string.
    :param encoding: An :class:`Encoding` object or a label string.
    :param errors: Type of error handling. See :func:`codecs.register`.
    :raises: :exc:`~exceptions.LookupError` for an unknown encoding label.
    :return: A byte string.

    r   )r#   r   r
   )r2   r   r4   s      r   r
   r
   ¬   s'   € ô ˜Ó"×-Ñ-×4Ñ4°U¸FÓCÀAÑFÐFr   c                 óP   — t        ||«      }t        | |«      }t        |«      }||fS )aâ  
    "Pull"-based decoder.

    :param input:
        An iterable of byte strings.

        The input is first consumed just enough to determine the encoding
        based on the precense of a BOM,
        then consumed on demand when the return value is.
    :param fallback_encoding:
        An :class:`Encoding` object or a label string.
        The encoding to use if :obj:`input` does note have a BOM.
    :param errors: Type of error handling. See :func:`codecs.register`.
    :raises: :exc:`~exceptions.LookupError` for an unknown encoding label.
    :returns:
        An ``(output, encoding)`` tuple.
        :obj:`output` is an iterable of Unicode strings,
        :obj:`encoding` is the :obj:`Encoding` that is being used.

    )ÚIncrementalDecoderÚ_iter_decode_generatorÚnext)r2   r3   r4   ÚdecoderÚ	generatorr   s         r   Úiter_decoderE   º   s1   € ô, !Ð!2°FÓ;€GÜ& u¨gÓ6€IÜ�I‹€HØ�hÐÐr   c              #   óH  K  — |j                   }t        | «      } | D ].  } ||«      }|sŒ|j                  €J ‚|j                  –— |–—  n.  |dd¬«      }|j                  €J ‚|j                  –— |r|–— y| D ]  } ||«      }|sŒ|–— Œ  |dd¬«      }|r|–— yy­w)zqReturn a generator that first yields the :obj:`Encoding`,
    then yields output chukns as Unicode strings.

    Nr   T©Úfinal)r   Úiterr   )r2   rC   r   ÚchunckÚoutputs        r   rA   rA   Ö   sÍ   è ø€ ð
 �^‰^€FÜ�‹K€EØò ˆÙ˜“ˆÚØ×#Ñ#Ð/Ð/Ð/Ø×"Ñ"Ò"ØŠLÙðñ ˜ 4Ô(ˆØ×ÑÐ+Ð+Ð+Ø×ÑÒÙØŠLØàò ˆÙ˜“ˆÚØ‹Lðñ �C˜tÔ$€FÙØ‹ð ùs   ‚'B"ªAB"Â
B"c                 óF   — t        ||«      j                  }t        | |«      S )uY  
    â€œPullâ€�-based encoder.

    :param input: An iterable of Unicode strings.
    :param encoding: An :class:`Encoding` object or a label string.
    :param errors: Type of error handling. See :func:`codecs.register`.
    :raises: :exc:`~exceptions.LookupError` for an unknown encoding label.
    :returns: An iterable of byte strings.

    )ÚIncrementalEncoderr
   Ú_iter_encode_generator)r2   r   r4   r
   s       r   Úiter_encoderO   ö   s#   € ô   ¨&Ó1×8Ñ8€FÜ! %¨Ó0Ð0r   c              #   óZ   K  — | D ]  } ||«      }|sŒ|–— Œ  |dd¬«      }|r|–— y y ­w)NÚ TrG   r/   )r2   r
   rJ   rK   s       r   rN   rN     sA   è ø€ Øò ˆÙ˜“ˆÚØ‹Lðñ �B˜dÔ#€FÙØ‹ð ùs   ‚+“+c                   ó    — e Zd ZdZdd„Zdd„Zy)r@   uO  
    â€œPushâ€�-based decoder.

    :param fallback_encoding:
        An :class:`Encoding` object or a label string.
        The encoding to use if :obj:`input` does note have a BOM.
    :param errors: Type of error handling. See :func:`codecs.register`.
    :raises: :exc:`~exceptions.LookupError` for an unknown encoding label.

    c                 ó\   — t        |«      | _        || _        d| _        d | _        d | _        y )Nr   )r#   Ú_fallback_encodingÚ_errorsÚ_bufferÚ_decoderr   )r'   r3   r4   s      r   r(   zIncrementalDecoder.__init__  s.   € ä"/Ð0AÓ"BˆÔØˆŒØˆŒØˆŒð
 ˆ�r   c                 óB  — | j                   }|�	 |||«      S | j                  |z   }t        |«      \  }}|€$t        |«      dk  r
|s|| _        y| j                  }|j
                  j                  | j                  «      j                  }|| _         || _	         |||«      S )zùDecode one chunk of the input.

        :param input: A byte string.
        :param final:
            Indicate that no more input is available.
            Must be :obj:`True` if this is the last call.
        :returns: An Unicode string.

        r8   rQ   )
rW   rV   r1   ÚlenrT   r   ÚincrementaldecoderrU   r   r   )r'   r2   rH   rC   r   s        r   r   zIncrementalDecoder.decode'  sŸ   € ð —-‘-ˆØÐÙ˜5 %Ó(Ð(à—‘˜uÑ$ˆÜ% eÓ,‰ˆ�%ØÐÜ�5‹z˜AŠ~¡eØ$�”Øà×2Ñ2�Ø×%Ñ%×8Ñ8¸¿¹ÓF×MÑMˆØˆŒØ ˆŒÙ�u˜eÓ$Ð$r   N©Úreplace)F)r+   r,   r-   r.   r(   r   r/   r   r   r@   r@     s   „ ñ	ó
ô%r   r@   c                   ó   — e Zd ZdZedfd„Zy)rM   uù  
    â€œPushâ€�-based encoder.

    :param encoding: An :class:`Encoding` object or a label string.
    :param errors: Type of error handling. See :func:`codecs.register`.
    :raises: :exc:`~exceptions.LookupError` for an unknown encoding label.

    .. method:: encode(input, final=False)

        :param input: An Unicode string.
        :param final:
            Indicate that no more input is available.
            Must be :obj:`True` if this is the last call.
        :returns: A byte string.

    r=   c                 ón   — t        |«      }|j                  j                  |«      j                  | _        y r&   )r#   r   Úincrementalencoderr
   )r'   r   r4   s      r   r(   zIncrementalEncoder.__init__T  s*   € Ü  Ó*ˆØ×)Ñ)×<Ñ<¸VÓD×KÑKˆ�r   N)r+   r,   r-   r.   r<   r(   r/   r   r   rM   rM   C  s   „ ñð  !%¨Xô Lr   rM   r[   )r.   Ú
__future__r   r   Úlabelsr   ÚVERSIONr   r   r   r   r#   Úobjectr   r<   r:   r;   r   r1   r
   rE   rA   rO   rN   r@   rM   r/   r   r   ú<module>rd      sÁ   ðñõ (ã å ð €ð
 !Ø$ØØñ	€ð 	€ò8ò4ò<ô$+ˆvô +ñ0 ˆgƒ€á�*Ó€Ù�*Ó€óBò,ð  ¨ó Góò8ð@ !%¨Xó 1ò ô0%˜ô 0%ôfL˜õ Lr   