§
    ŒŸjOY  ã                   óô  — d dl Z d dlZd dlZd dlZd dlmZmZ ddlmZ ddl	m
Z
 dZdZ ej        d¦  «        Z ed	d
h¦  «        Z eh d£¦  «        Z eh d£¦  «        Z eh d£¦  «        Z eddh¦  «        Z eh d£¦  «        Z eddh¦  «        Z e ed¦  «         ed¦  «        h¦  «        Z e ed	¦  «         ed¦  «        h¦  «        Z G d„ de¦  «        Z G d„ de¦  «        Z G d„ de¦  «        Z G d„ de¦  «        Zdedefd„Z de!de!de"fd„Z#d e!de$fd!„Z%d ede!fd"„Z&d#ee$e!f         de"fd$„Z'd%ee$e!f         d&e"de"fd'„Z(d=d#e!d)e"de"fd*„Z)d#e!de"fd+„Z*d#e!de"fd,„Z+d#e!ddfd-„Z,d#e!d.ede"fd/„Z-d=d#e!d.ed0e"de"fd1„Z.d#ee!e$e/f         ddfd2„Z0d#e!de$fd3„Z1d#ee!e$e/f         de!fd4„Z2d>d%e!d6e"d7e"de!fd8„Z3	 	 	 	 d?d ee!e$e/f         d9e"d:e"d6e"d7e"de$fd;„Z4	 	 	 d@d ee!e$e/f         d9e"d:e"d6e"de!f
d<„Z5dS )Aé    N)ÚOptionalÚUnioné   )Úidnadata)Úintranges_containé	   s   xn--u   [.ã€‚ï¼Žï½¡]ÚRÚAL>   r	   r
   ÚAN>
   r	   r
   r   ÚBNÚCSÚENÚESÚETÚONÚNSM>   r	   r
   r   r   r   r   >   ÚLr   r   r   r   r   r   r   r   ÚDc                   ó   — e Zd ZdZdS )Ú	IDNAErrorz5Base exception for all IDNA-encoding related problemsN©Ú__name__Ú
__module__Ú__qualname__Ú__doc__© ó    úV/var/www/finuniver-perm.ru/html/student/venv/lib/python3.11/site-packages/idna/core.pyr   r      s   € € € € € Ø?Ð?Ð?Ð?r   r   c                   ó   — e Zd ZdZdS )ÚIDNABidiErrorz;Exception when bidirectional requirements are not satisfiedNr   r   r   r   r    r       s   € € € € € ØEÐEÐEÐEr   r    c                   ó   — e Zd ZdZdS )ÚInvalidCodepointz<Exception when a disallowed or unallocated codepoint is usedNr   r   r   r   r"   r"   #   s   € € € € € ØFÐFÐFÐFr   r"   c                   ó   — e Zd ZdZdS )ÚInvalidCodepointContextzCException when the codepoint is not valid in the context it is usedNr   r   r   r   r$   r$   '   s   € € € € € ØMÐMÐMÐMr   r$   ÚcpÚreturnc                 ó´   — t          j        t          | ¦  «        ¦  «        }|dk    r0t          j        t          | ¦  «        ¦  «        st	          d¦  «        ‚|S )Nr   z Unknown character in unicodedata)ÚunicodedataÚ	combiningÚchrÚnameÚ
ValueError)r%   Úvs     r   Ú_combining_classr.   +   sJ   € ÝÔ�c "™gœgÑ&Ô&€AØˆA‚v€v•kÔ&¥s¨2¡w¤wÑ/Ô/€vÝÐ;Ñ<Ô<Ð<Ø€Hr   Úscriptc                 ó\   — t          t          | ¦  «        t          j        |         ¦  «        S )N)r   Úordr   Úscripts)r%   r/   s     r   Ú
_is_scriptr3   2   s    € Ý�S ™WœW¥hÔ&6°vÔ&>Ñ?Ô?Ð?r   Úsc                 ó,   — |                       d¦  «        S )NÚpunycode)Úencode©r4   s    r   Ú	_punycoder9   6   s   € Ø�8Š8�JÑÔÐr   c                 ó   — d| d›�S )NzU+Ú04Xr   r8   s    r   Ú_unotr<   :   s   € Ø�ˆ<ˆ<ˆ<Ðr   Úlabelc                 ó(   — t          | ¦  «        dk    S )uÍ  Check that a label does not exceed the maximum permitted length.

    Per :rfc:`1035` (and :rfc:`5891` Â§4.2.4) a DNS label must not exceed
    63 octets. The argument may be either a :class:`str` (a U-label, where
    length is measured in characters) or :class:`bytes` (an A-label, where
    length is measured in octets).

    :param label: The label to check.
    :returns: ``True`` if the label is within the length limit, otherwise
        ``False``.
    é?   ©Úlen©r=   s    r   Úvalid_label_lengthrC   >   s   € õ ˆu‰:Œ:˜ÒÐr   ÚdomainÚtrailing_dotc                 ó0   — t          | ¦  «        |rdndk    S )a¶  Check that a full domain name does not exceed the maximum length.

    Per :rfc:`1035`, a domain name is limited to 253 octets when no trailing
    dot is present, or 254 octets when one is included.

    :param domain: The full (possibly multi-label) domain name.
    :param trailing_dot: ``True`` if ``domain`` includes a trailing ``.``.
    :returns: ``True`` if the domain is within the length limit, otherwise
        ``False``.
    éþ   éý   r@   )rD   rE   s     r   Úvalid_string_lengthrI   M   s   € õ ˆv‰;Œ; ,Ð7˜3˜3°CÒ8Ð8r   FÚ	check_ltrc                 óÄ  — d}t          | d¦  «        D ]?\  }}t          j        |¦  «        }|dk    rt          d| ›d|› �¦  «        ‚|t          v rd}Œ@|s|sdS t          j        | d         ¦  «        }|t
          v rd}n|dk    rd}nt          d	| ›d
�¦  «        ‚d}d}t          | d¦  «        D ]Ÿ\  }}t          j        |¦  «        }|rT|t          vrt          d|› d�¦  «        ‚|t          v rd}n|dk    rd}|t          v r|s|}ŒY||k    rt          d¦  «        ‚Œo|t          vrt          d|› d�¦  «        ‚|t          v rd}Œ—|dk    rd}Œ |st          d¦  «        ‚dS )a!  Validate the Bidi Rule from :rfc:`5893` for a single label.

    The Bidi Rule constrains how bidirectional characters (Hebrew, Arabic,
    etc.) may appear within a label. By default the check is only applied
    when the label contains at least one right-to-left character (Unicode
    bidirectional categories ``R``, ``AL``, or ``AN``); set ``check_ltr``
    to ``True`` to apply it to LTR-only labels as well.

    :param label: The label to validate, as a Unicode string.
    :param check_ltr: If ``True``, apply the rules even when the label
        contains no RTL characters.
    :returns: ``True`` if the label satisfies the Bidi Rule.
    :raises IDNABidiError: If any of Bidi Rule conditions 1-6 are violated,
        or if the directional category of a codepoint cannot be determined.
    Fr   Ú z Unknown directionality in label ú at position Tr   r   zFirst codepoint in label z" must be directionality L, R or ALNz,Invalid direction for codepoint at position z in a right-to-left labelr   z2Can not mix numeral types in a right-to-left labelz in a left-to-right labelz0Label ends with illegal codepoint directionality)Ú	enumerater(   Úbidirectionalr    Ú_bidi_rtl_categoriesÚ_bidi_rtl_firstÚ_bidi_rtl_allowedÚ_bidi_rtl_valid_endingÚ_bidi_rtl_numericÚ_bidi_ltr_allowedÚ_bidi_ltr_valid_ending)	r=   rJ   Ú
bidi_labelÚidxr%   Ú	directionÚrtlÚvalid_endingÚnumber_types	            r   Ú
check_bidir]   [   s  € ð" €JÝ˜U AÑ&Ô&ð ð ‰ˆˆRÝÔ-¨bÑ1Ô1ˆ	Ø˜Š?ˆ?åÐ ^À5Ð ^Ð ^ÐY\Ð ^Ð ^Ñ_Ô_Ð_ØÕ,Ð,Ð,ØˆJøØð ˜ið Øˆtõ Ô)¨%°¬(Ñ3Ô3€IØ•OÐ#Ð#ØˆˆØ	�cÒ	Ð	ØˆˆåÐc¸ÐcÐcÐcÑdÔdÐdà€LØ!%€KÝ˜U AÑ&Ô&ð %ð %‰ˆˆRÝÔ-¨bÑ1Ô1ˆ	àð 	%àÕ 1Ð1Ð1Ý#Ð$qÐSVÐ$qÐ$qÐ$qÑrÔrÐràÕ2Ð2Ð2Ø#��Ø˜eÒ#Ð#Ø$�àÕ-Ð-Ð-Ø"ð ^Ø"+�K�KØ  IÒ-Ð-Ý'Ð(\Ñ]Ô]Ð]øð Õ 1Ð1Ð1Ý#Ð$qÐSVÐ$qÐ$qÐ$qÑrÔrÐràÕ2Ð2Ð2Ø#��Ø˜eÒ#Ð#Ø$�øàð PÝÐNÑOÔOÐOàˆ4r   c                 ól   — t          j        | d         ¦  «        d         dk    rt          d¦  «        ‚dS )u^  Reject labels that begin with a combining mark.

    Per :rfc:`5891` Â§4.2.3.2 a label must not start with a character of
    Unicode general category ``M`` (Mark).

    :param label: The label to check.
    :returns: ``True`` if the first character is not a combining mark.
    :raises IDNAError: If the label begins with a combining character.
    r   ÚMz0Label begins with an illegal combining characterT)r(   Úcategoryr   rB   s    r   Úcheck_initial_combinerra   ¤   s7   € õ Ô˜E !œHÑ%Ô% aÔ(¨CÒ/Ð/ÝÐJÑKÔKÐKØˆ4r   c                 óŽ   — | dd…         dk    rt          d¦  «        ‚| d         dk    s| d         dk    rt          d¦  «        ‚d	S )
u§  Validate the hyphen restrictions for a label.

    Per :rfc:`5891` Â§4.2.3.1 a label must not start or end with a hyphen
    (``U+002D``), and must not have hyphens in both the third and fourth
    positions (the prefix reserved for A-labels).

    :param label: The label to check.
    :returns: ``True`` if the hyphen restrictions are satisfied.
    :raises IDNAError: If any of the hyphen restrictions are violated.
    é   é   z--z4Label has disallowed hyphens in 3rd and 4th positionr   ú-éÿÿÿÿz)Label must not start or end with a hyphenT)r   rB   s    r   Úcheck_hyphen_okrg   ³   sU   € ð ˆQˆqˆS„z�TÒÐÝÐNÑOÔOÐOØˆQ„x�3‚€˜% œ) sÒ*Ð*ÝÐCÑDÔDÐDØˆ4r   c                 óV   — t          j        d| ¦  «        | k    rt          d¦  «        ‚dS )z¬Require that a label is in Unicode Normalization Form C.

    :param label: The label to check.
    :raises IDNAError: If ``label`` differs from its NFC normalisation.
    ÚNFCz%Label must be in Normalization Form CN)r(   Ú	normalizer   rB   s    r   Ú	check_nfcrk   Å   s3   € õ Ô˜U EÑ*Ô*¨eÒ3Ð3ÝÐ?Ñ@Ô@Ð@ð 4Ð3r   Úposc                 ó  — t          | |         ¦  «        }|dk    �r.|dk    r0t          t          | |dz
           ¦  «        ¦  «        t          k    rdS d}t          |dz
  dd¦  «        D ]\}t	          j        ¦   «                              t          | |         ¦  «        ¦  «        }|t          d¦  «        k    rŒO|t          v rd} n |sdS d}t          |dz   t          | ¦  «        ¦  «        D ]\}t	          j        ¦   «                              t          | |         ¦  «        ¦  «        }|t          d¦  «        k    rŒO|t          v rd} n |S |dk    r4|dk    o-t          t          | |dz
           ¦  «        ¦  «        t          k    S dS )	aŸ  Validate the CONTEXTJ rules from :rfc:`5892` Appendix A.

    These rules govern the contextual use of the joiner codepoints
    ``U+200C`` (ZERO WIDTH NON-JOINER, Appendix A.1) and ``U+200D``
    (ZERO WIDTH JOINER, Appendix A.2) within a label.

    :param label: The label containing the codepoint.
    :param pos: Index of the joiner codepoint within ``label``.
    :returns: ``True`` if the codepoint at ``pos`` satisfies its CONTEXTJ
        rule, ``False`` otherwise (including when the codepoint at
        ``pos`` is not a recognised joiner).
    :raises ValueError: If an adjacent codepoint has no Unicode name when
        determining its combining class.
    i   r   r   TFrf   ÚTi   )
r1   r.   Ú_virama_combining_classÚranger   Újoining_typesÚgetÚ_bidi_joiner_l_or_drA   Ú_bidi_joiner_r_or_d)r=   rl   Úcp_valueÚokÚiÚjoining_types         r   Úvalid_contextjry   Ï   s’  € õ �5˜”:‰Œ€Hà�6ÒÑØ�Š7ˆ7Õ'­¨E°#¸±'¬NÑ(;Ô(;Ñ<Ô<Õ@WÒWÐWØ�4àˆÝ�s˜Q‘w  BÑ'Ô'ð 	ð 	ˆAÝ#Ô1Ñ3Ô3×7Ò7½¸EÀ!¼H¹¼ÑFÔFˆLØ�s 3™xœxÒ'Ð'ØØÕ2Ð2Ð2Ø�Ø�Øàð 	Ø�5àˆÝ�s˜Q‘w¥ E¡
¤
Ñ+Ô+ð 	ð 	ˆAÝ#Ô1Ñ3Ô3×7Ò7½¸EÀ!¼H¹¼ÑFÔFˆLØ�s 3™xœxÒ'Ð'ØØÕ2Ð2Ð2Ø�Ø�ØØˆ	à�6ÒÐØ�QŠwÐ[Õ+­C°°c¸A±g´Ñ,?Ô,?Ñ@Ô@ÕD[Ò[Ð[àˆ5r   Ú	exceptionc                 ó   — t          | |         ¦  «        }|dk    rXd|cxk     ot          | ¦  «        dz
  k     nc o7t          | |dz
           ¦  «        dk    ot          | |dz            ¦  «        dk    S |dk    rD|t          | ¦  «        dz
  k     r,t          | ¦  «        dk    rt          | |dz            d¦  «        S dS |dv r!|dk    rt          | |dz
           d	¦  «        S dS |d
k    rA| D ]<}|dk    rŒ	t          |d¦  «        s t          |d¦  «        st          |d¦  «        r dS Œ=dS d|cxk    rdk    rn nt          d„ | D ¦   «         ¦  «         S d|cxk    rdk    rn nt          d„ | D ¦   «         ¦  «         S dS )a‹  Validate the CONTEXTO rules from :rfc:`5892` Appendix A.

    Covers the contextual rules for codepoints such as MIDDLE DOT
    (``U+00B7``), Greek lower numeral sign, Hebrew punctuation, Katakana
    middle dot, and the Arabic-Indic / Extended Arabic-Indic digit ranges.

    :param label: The label containing the codepoint.
    :param pos: Index of the codepoint within ``label``.
    :param exception: Reserved for forward compatibility; currently unused.
    :returns: ``True`` if the codepoint at ``pos`` satisfies its CONTEXTO
        rule, ``False`` otherwise (including when the codepoint is not a
        recognised CONTEXTO codepoint).
    é·   r   r   él   iu  ÚGreekF>   éó  éô  ÚHebrewiû0  u   ãƒ»ÚHiraganaÚKatakanaÚHanTé`  éi  c              3   óP   K  — | ]!}d t          |¦  «        cxk    odk    nc V — Œ"dS )éð  éù  N©r1   ©Ú.0r%   s     r   ú	<genexpr>z!valid_contexto.<locals>.<genexpr>(  óD   è è € ÐBÐB°b�u¥ B¡¤Ð1Ð1Ò1Ð1¨6Ò1Ð1Ð1Ð1ÐBÐBÐBÐBÐBÐBr   rˆ   r‰   c              3   óP   K  — | ]!}d t          |¦  «        cxk    odk    nc V — Œ"dS )r…   r†   NrŠ   r‹   s     r   r�   z!valid_contexto.<locals>.<genexpr>+  rŽ   r   )r1   rA   r3   Úany)r=   rl   rz   ru   r%   s        r   Úvalid_contextor‘     s÷  € õ �5˜”:‰Œ€Hà�6ÒÐØ�3Ð'Ð'Ò'Ð'�˜U™œ a™Ò'Ð'Ð'Ð'Ðk­C°°c¸A±g´Ñ,?Ô,?À6Ò,IÐkÍcÐRWÐX[Ð^_ÑX_ÔR`ÑNaÔNaÐekÒNkÐkà�6ÒÐØ•�U‘”˜a‘ÒÐ¥C¨¡J¤J°¢N NÝ˜e C¨!¡Gœn¨gÑ6Ô6Ð6ØˆuàÐ#Ð#Ð#Ø�Š7ˆ7Ý˜e C¨!¡Gœn¨hÑ7Ô7Ð7Øˆuà�6ÒÐØð 	ð 	ˆBØ�XŠ~ˆ~ØÝ˜"˜jÑ)Ô)ð ­Z¸¸JÑ-GÔ-Gð Í:ÐVXÐZ_ÑK`ÔK`ð Ø�t�tðàˆuà�Ð!Ð!Ò!Ð!˜EÒ!Ð!Ð!Ð!Ð!ÝÐBÐB¸EÐBÑBÔBÑBÔBÐBÐBà�Ð!Ð!Ò!Ð!˜EÒ!Ð!Ð!Ð!Ð!ÝÐBÐB¸EÐBÑBÔBÑBÔBÐBÐBàˆ5r   c           
      ó  — t          | t          t          f¦  «        r|                      d¦  «        } t	          | ¦  «        dk    rt          d¦  «        ‚t          | d¬¦  «        st          d¦  «        ‚t          | ¦  «         t          | ¦  «         t          | ¦  «         t          | ¦  «        D �]L\  }}t          |¦  «        }t          |t          j        d         ¦  «        rŒ6t          |t          j        d         ¦  «        ru	 t          | |¦  «        s(t!          d	t#          |¦  «        › d
|dz   › d| ›�¦  «        ‚Œ�# t$          $ r.}t          dt#          |¦  «        › d|dz   › d| ›�¦  «        |‚d}~ww xY wt          |t          j        d         ¦  «        r:t'          | |¦  «        s(t!          dt#          |¦  «        › d
|dz   › d| ›�¦  «        ‚�Œ%t)          dt#          |¦  «        › d|dz   › d| ›d�¦  «        ‚t+          | ¦  «         dS )a8  Run the full set of IDNA 2008 validity checks on a single label.

    Applies, in order: NFC normalisation (:func:`check_nfc`), hyphen
    restrictions (:func:`check_hyphen_ok`), the no-leading-combiner rule
    (:func:`check_initial_combiner`), per-codepoint validity (PVALID,
    CONTEXTJ, CONTEXTO classes from :rfc:`5892`), and the Bidi Rule
    (:func:`check_bidi`).

    :param label: The label to validate. ``bytes`` or ``bytearray`` input
        is decoded as UTF-8 first.
    :raises IDNAError: If the label is empty or fails a structural rule.
    :raises InvalidCodepoint: If the label contains a DISALLOWED or
        UNASSIGNED codepoint.
    :raises InvalidCodepointContext: If a CONTEXTJ or CONTEXTO codepoint
        is not valid in its context.
    :raises IDNABidiError: If the Bidi Rule is violated.
    zutf-8r   zEmpty LabelT©rE   úLabel too longÚPVALIDÚCONTEXTJzJoiner ú not allowed at position r   ú in z%Unknown codepoint adjacent to joiner rM   NÚCONTEXTOú
Codepoint z of z not allowed)Ú
isinstanceÚbytesÚ	bytearrayÚdecoderA   r   rI   rk   rg   ra   rN   r1   r   r   Úcodepoint_classesry   r$   r<   r,   r‘   r"   r]   )r=   rl   r%   ru   Úerrs        r   Úcheck_labelr¡   0  s`  € õ$ �%�%¥Ð+Ñ,Ô,ð &Ø—’˜WÑ%Ô%ˆÝ
ˆ5�z„z�Q‚€Ý˜Ñ&Ô&Ð&õ ˜u°4Ð8Ñ8Ô8ð *ÝÐ(Ñ)Ô)Ð)åˆeÑÔÐÝ�EÑÔÐÝ˜5Ñ!Ô!Ð!å˜UÑ#Ô#ð rñ r‰ˆˆRÝ�r‘7”7ˆÝ˜X¥xÔ'AÀ(Ô'KÑLÔLð 	ØÝ˜X¥xÔ'AÀ*Ô'MÑNÔNð 	rðÝ% e¨SÑ1Ô1ð ~Ý1Ð2|½EÀ(¹O¼OÐ2|Ð2|ÐfiÐlmÑfmÐ2|Ð2|ÐsxÐ2|Ð2|Ñ}Ô}Ð}ð~øåð ð ð ÝØp½EÀ(¹O¼OÐpÐpÐZ]Ð`aÑZaÐpÐpÐglÐpÐpñô àðøøøøðøøøõ ˜x­Ô)CÀJÔ)OÑPÔPð 	rÝ! %¨Ñ-Ô-ð }Ý-Ð.{½5À¹?¼?Ð.{Ð.{ÐehÐklÑelÐ.{Ð.{ÐrwÐ.{Ð.{Ñ|Ô|Ð|ñ}õ #Ð#pµ°h±´Ð#pÐ#pÈcÐTUÉgÐ#pÐ#pÐ[`Ð#pÐ#pÐ#pÑqÔqÐqåˆuÑÔÐÐÐs   Ä8E Å 
E8Å
)E3Å3E8c                 ó8  — 	 |                       d¦  «        }t          |¦  «         t          |¦  «        st          d¦  «        ‚|S # t          $ r Y nw xY wt          | ¦  «         t          t          | ¦  «        z   }t          |¦  «        st          d¦  «        ‚|S )u  Convert a single U-label into its A-label form.

    The result is the ASCII-Compatible Encoding (ACE) form per :rfc:`5891`
    Â§4: the label is validated, Punycode-encoded, and prefixed with
    ``xn--``. Pure ASCII labels that are already valid IDNA labels are
    returned unchanged (as :class:`bytes`).

    :param label: The label to convert, as a Unicode string.
    :returns: The A-label as ASCII-encoded :class:`bytes`.
    :raises IDNAError: If the label is invalid or the resulting A-label
        exceeds 63 octets.
    Úasciir”   )r7   ÚulabelrC   r   ÚUnicodeEncodeErrorr¡   Ú_alabel_prefixr9   )r=   Úlabel_bytess     r   Úalabelr¨   e  s¶   € ðØ—l’l 7Ñ+Ô+ˆõ 	ˆ{ÑÔÐÝ! +Ñ.Ô.ð 	.ÝÐ,Ñ-Ô-Ð-ØÐøõ ð ð ð Øˆðøøøõ �ÑÔÐÝ ¥9¨UÑ#3Ô#3Ñ3€Kå˜kÑ*Ô*ð *ÝÐ(Ñ)Ô)Ð)àÐs   ‚A Á
AÁAc                 ó¤  — t          | t          t          f¦  «        s8	 |                      d¦  «        }n0# t          $ r t          | ¦  «         | cY S w xY wt          | ¦  «        }|                     ¦   «         }|                     t          ¦  «        rR|t          t          ¦  «        d…         }|st          d¦  «        ‚|                     d¦  «        rt          d¦  «        ‚n$t          |¦  «         |                     d¦  «        S 	 |                     d¦  «        } n"# t          $ r}t          d¦  «        |‚d}~ww xY wt          | ¦  «         | S )aÿ  Convert a single A-label into its U-label form.

    Performs the inverse of :func:`alabel`: an ``xn--``-prefixed label is
    Punycode-decoded and validated. Labels that are already Unicode (or
    plain ASCII without the ACE prefix) are validated and returned as a
    Unicode string.

    :param label: The label to convert. ``bytes`` or ``bytearray`` input
        is treated as ASCII.
    :returns: The U-label as a Unicode string.
    :raises IDNAError: If the label is malformed or fails validation.
    r£   Nz5Malformed A-label, no Punycode eligible content foundó   -z"A-label must not end with a hyphenr6   zInvalid A-label)r›   rœ   r�   r7   r¥   r¡   ÚlowerÚ
startswithr¦   rA   r   Úendswithrž   ÚUnicodeError)r=   r§   r    s      r   r¤   r¤   …  sv  € õ �e�e¥YÐ/Ñ0Ô0ð #ð	ØŸ,š, wÑ/Ô/ˆKˆKøÝ!ð 	ð 	ð 	Ý˜ÑÔÐØˆLˆLˆLð	øøøõ ˜E‘l”lˆà×#Ò#Ñ%Ô%€KØ×Ò�nÑ-Ô-ð +Ø!¥#¥nÑ"5Ô"5Ð"7Ð"7Ô8ˆØð 	UÝÐSÑTÔTÐTØ×Ò Ñ%Ô%ð 	BÝÐ@ÑAÔAÐAð	Bõ 	�KÑ Ô Ð Ø×!Ò! 'Ñ*Ô*Ð*ð4Ø×"Ò" :Ñ.Ô.ˆˆøÝð 4ð 4ð 4ÝÐ)Ñ*Ô*°Ð3øøøøð4øøøå�ÑÔÐØ€Ls'   ž4 ´AÁAÄ	D Ä
D>Ä)D9Ä9D>TÚ
std3_rulesÚtransitionalc           	      ó  — ddl m } d}t          | ¦  «        D ]Ú\  }}t          |¦  «        }||dk     r|nt          j        ||df¦  «        dz
           }|d         }	d}
t          |¦  «        dk    r|d         }
|	d	k    p|	d
k    r| p|	dk    o| o|
du }|
duo|	dk    p|	dk    r| p|	d
k    o|}|r||z  }Œ |r
|
€J ‚||
z  }Œ¬|	dk    rŒ³t          dt          |¦  «        › d|dz   › d| ›�¦  «        ‚t          j	        d|¦  «        S )u®  Apply the UTS #46 character mapping to a domain string.

    Implements the mapping table from `UTS #46 Â§4
    <https://www.unicode.org/reports/tr46/>`_: each character is kept,
    replaced, or rejected based on its status (``V``, ``M``, ``D``, ``3``,
    ``I``). The result is returned in Normalisation Form C.

    :param domain: The full domain name to remap.
    :param std3_rules: If ``True``, apply the stricter STD3 ASCII rules
        (status ``3`` codepoints raise instead of being kept or mapped).
    :param transitional: If ``True``, use transitional processing (status
        ``D`` codepoints are mapped instead of kept). Transitional
        processing has been removed from UTS #46 and this option is
        retained only for backwards compatibility.
    :returns: The remapped domain, in Normalisation Form C.
    :raises InvalidCodepoint: If the domain contains a disallowed
        codepoint under the chosen rules.
    r   )Ú	uts46datarL   é   ÚZNé   rc   ÚVr   Ú3r_   ÚIrš   r—   r˜   ri   )
r²   rN   r1   ÚbisectÚbisect_leftrA   r"   r<   r(   rj   )rD   r¯   r°   r²   Úoutputrl   ÚcharÚ
code_pointÚuts46rowÚstatusÚreplacementÚ
keep_as_isÚuse_replacements                r   Úuts46_remaprÃ   ®  s£  € ð& %Ð$Ð$Ð$Ð$Ð$à€Få˜vÑ&Ô&ð uð u‰	ˆˆTÝ˜‘Y”Yˆ
Ø¨:¸Ò+;Ð+;˜Z˜ZÅÔASÐT]Ð`jÐloÐ_pÑAqÔAqÐtuÑAuÔvˆØ˜!”ˆØ%)ˆÝˆx‰=Œ=˜AÒÐØ" 1œ+ˆKð
 �cŠMÐ˜f¨šmÐ@°LÐ0@ÐÀfÐPSÂmÐF~Ð\fÐXfÐF~ÐkvÐz~Ðk~ð 	ð
 &¨TÐ1ð 
Ø�cŠMÐc˜f¨šmÐ>°J°ÐcÀFÈcÂMÐDbÐVbð 	ð ð 	uØ�d‰NˆFˆFØð 	uØÐ*Ð*Ð*Ø�kÑ!ˆFˆFØ�sŠ]ˆ]Øå"Ð#sµ°jÑ0AÔ0AÐ#sÐ#sÐ\_ÐbcÑ\cÐ#sÐ#sÐioÐ#sÐ#sÑtÔtÐtåÔ  ¨Ñ/Ô/Ð/r   ÚstrictÚuts46c                 ó  — |rt          j        dt          d¬¦  «         t          | t          ¦  «        s;	 t	          | d¦  «        } n)# t
          t          f$ r}t          d¦  «        |‚d}~ww xY w|rt          | ||¦  «        } t          | d¬¦  «        st          d	¦  «        ‚d
}g }|r|  
                    d¦  «        nt           
                    | ¦  «        }|r|dgk    rt          d¦  «        ‚|d         dk    r|d= d}|D ]7}	t          |	¦  «        } | r|                     | ¦  «         Œ)t          d¦  «        ‚|r|                     d¦  «         d                     |¦  «        } t          | |¦  «        st          d	¦  «        ‚| S )aA  Encode a Unicode domain name into its ASCII (A-label) form.

    Splits the input on label separators (only ``U+002E`` if ``strict`` is
    set; otherwise also IDEOGRAPHIC FULL STOP ``U+3002``, FULLWIDTH FULL
    STOP ``U+FF0E``, and HALFWIDTH IDEOGRAPHIC FULL STOP ``U+FF61``),
    encodes each label with :func:`alabel`, and rejoins them with ``.``.
    Optionally pre-processes the input through :func:`uts46_remap`.

    :param s: The domain name to encode.
    :param strict: If ``True``, only ``U+002E`` is recognised as a label
        separator.
    :param uts46: If ``True``, apply UTS #46 mapping before encoding.
    :param std3_rules: Forwarded to :func:`uts46_remap` when ``uts46`` is
        ``True``.
    :param transitional: Forwarded to :func:`uts46_remap` when ``uts46``
        is ``True``. Deprecated: emits a :class:`DeprecationWarning` and
        will be removed in a future version.
    :returns: The encoded domain as ASCII :class:`bytes`.
    :raises IDNAError: If the domain is empty, contains an invalid label,
        or exceeds the maximum domain length.
    zuTransitional processing has been removed from UTS #46. The transitional argument will be removed in a future version.rc   )Ú
stacklevelr£   zGshould pass a unicode string to the function rather than a byte string.NTr“   úDomain too longFú.rL   úEmpty domainrf   úEmpty labelr   ó   .)ÚwarningsÚwarnÚDeprecationWarningr›   ÚstrÚUnicodeDecodeErrorÚ	TypeErrorr   rÃ   rI   ÚsplitÚ_unicode_dots_rer¨   ÚappendÚjoin)
r4   rÄ   rÅ   r¯   r°   r    rE   ÚresultÚlabelsr=   s
             r   r7   r7   å  sÖ  € ð8 ð 
ÝŒðMåØð		
ñ 	
ô 	
ð 	
õ �a�ÑÔð pð	pÝ�A�w‘”ˆAˆAøÝ"¥IÐ.ð 	pð 	pð 	pÝÐeÑfÔfÐloÐoøøøøð	pøøøàð 5Ý˜˜: |Ñ4Ô4ˆõ ˜q¨tÐ4Ñ4Ô4ð +ÝÐ)Ñ*Ô*Ð*à€LØ€FØ#ÐBˆQ�WŠW�S‰\Œ\ˆ\Õ)9×)?Ò)?ÀÑ)BÔ)B€FØð (�V ˜t’^�^Ý˜Ñ'Ô'Ð'Øˆb„z�RÒÐØ�2ˆJØˆØð +ð +ˆÝ�5‰MŒMˆØð 	+Ø�MŠM˜!ÑÔÐÐå˜MÑ*Ô*Ð*Øð Ø�Š�cÑÔÐØ�	Š	�&ÑÔ€AÝ˜q ,Ñ/Ô/ð +ÝÐ)Ñ*Ô*Ð*Ø€Hs   µA ÁA,ÁA'Á'A,c                 óˆ  — t          | t          ¦  «        s;	 t          | d¦  «        } n)# t          t          f$ r}t	          d¦  «        |‚d}~ww xY w|rt          | |d¦  «        } t          | d¬¦  «        st	          d¦  «        ‚d}g }|r|                      d¦  «        nt                               | ¦  «        }|r|d	gk    rt	          d
¦  «        ‚|d         s|d= d}|D ]7}t          |¦  «        } | r| 
                    | ¦  «         Œ)t	          d¦  «        ‚|r| 
                    d	¦  «         d                     |¦  «        S )aà  Decode an A-label-encoded domain name back to Unicode.

    Splits the input on label separators (see :func:`encode` for the
    rules), decodes each label with :func:`ulabel`, and rejoins them
    with ``.``. Optionally pre-processes the input through
    :func:`uts46_remap`.

    :param s: The domain name to decode.
    :param strict: If ``True``, only ``U+002E`` is recognised as a label
        separator.
    :param uts46: If ``True``, apply UTS #46 mapping before decoding.
    :param std3_rules: Forwarded to :func:`uts46_remap` when ``uts46`` is
        ``True``.
    :returns: The decoded domain as a Unicode string.
    :raises IDNAError: If the input is not valid ASCII, contains an
        invalid label, or is empty.
    r£   zInvalid ASCII in A-labelNFTr“   rÈ   rÉ   rL   rÊ   rf   rË   )r›   rÐ   rÑ   rÒ   r   rÃ   rI   rÓ   rÔ   r¤   rÕ   rÖ   )	r4   rÄ   rÅ   r¯   r    rE   r×   rØ   r=   s	            r   rž   rž   +  s~  € õ. �a�ÑÔð Að	AÝ�A�w‘”ˆAˆAøÝ"¥IÐ.ð 	Að 	Að 	AÝÐ6Ñ7Ô7¸SÐ@øøøøð	Aøøøàð .Ý˜˜: uÑ-Ô-ˆõ ˜q¨tÐ4Ñ4Ô4ð +ÝÐ)Ñ*Ô*Ð*Ø€LØ€FØ#ÐBˆQ�WŠW�S‰\Œ\ˆ\Õ)9×)?Ò)?ÀÑ)BÔ)B€FØð (�V ˜t’^�^Ý˜Ñ'Ô'Ð'Ø�"Œ:ð Ø�2ˆJØˆØð +ð +ˆÝ�5‰MŒMˆØð 	+Ø�MŠM˜!ÑÔÐÐå˜MÑ*Ô*Ð*Øð Ø�Š�bÑÔÐØ�8Š8�FÑÔÐs   —( ¨A¹A	Á	A)F)TF)FFFF)FFF)6r¹   Úrer(   rÍ   Útypingr   r   rL   r   Ú	intrangesr   ro   r¦   ÚcompilerÔ   Ú	frozensetrQ   rP   rR   rS   rT   rU   rV   r1   rs   rt   r®   r   r    r"   r$   Úintr.   rÐ   Úboolr3   rœ   r9   r<   rC   rI   r]   ra   rg   rk   ry   r‘   r�   r¡   r¨   r¤   rÃ   r7   rž   r   r   r   ú<module>rá      s¾  ðØ €€€Ø 	€	€	€	Ø Ð Ð Ð Ø €€€Ø "Ð "Ð "Ð "Ð "Ð "Ð "Ð "à Ð Ð Ð Ð Ð Ø (Ð (Ð (Ð (Ð (Ð (àÐ Ø€Ø�2”:Ð:Ñ;Ô;Ð ð �)˜S $˜KÑ(Ô(€Ø �yÐ!2Ð!2Ð!2Ñ3Ô3Ð Ø�IÐZÐZÐZÑ[Ô[Ð Ø"˜Ð#:Ð#:Ð#:Ñ;Ô;Ð Ø�I˜t T˜lÑ+Ô+Ð Ø�IÐNÐNÐNÑOÔOÐ Ø"˜ C¨ ;Ñ/Ô/Ð Ø�i   S¡¤¨3¨3¨s©8¬8Ð 4Ñ5Ô5Ð Ø�i   S¡¤¨3¨3¨s©8¬8Ð 4Ñ5Ô5Ð ð@ð @ð @ð @ð @�ñ @ô @ð @ðFð Fð Fð Fð F�Iñ Fô Fð FðGð Gð Gð Gð G�yñ Gô Gð GðNð Nð Nð Nð N˜iñ Nô Nð Nð˜ð  ð ð ð ð ð@�3ð @ ð @¨ð @ð @ð @ð @ð �ð  ˜ð  ð  ð  ð  ðˆSð �Sð ð ð ð ð˜e E¨3 JÔ/ð °Dð ð ð ð ð9  e¨S jÔ 1ð 9Àð 9È$ð 9ð 9ð 9ð 9ðFð F�cð F dð F°tð Fð Fð Fð FðR #ð ¨$ð ð ð ð ð˜3ð  4ð ð ð ð ð$A�Sð A˜Tð Að Að Að Að0˜#ð 0 Cð 0¨Dð 0ð 0ð 0ð 0ðf+ð +˜#ð + Cð +°Dð +ÀTð +ð +ð +ð +ð\2�u˜S %¨Ð2Ô3ð 2¸ð 2ð 2ð 2ð 2ðj�#ð ˜%ð ð ð ð ð@&�%˜˜U IÐ-Ô.ð &°3ð &ð &ð &ð &ðR40ð 40˜ð 40¨ð 40ÀDð 40ÐUXð 40ð 40ð 40ð 40ðr ØØØðCð CØˆS�%˜Ð"Ô#ðCàðCð ðCð ð	Cð
 ðCð ðCð Cð Cð CðP ØØð	2ð 2ØˆS�%˜Ð"Ô#ð2àð2ð ð2ð ð	2ð
 	ð2ð 2ð 2ð 2ð 2ð 2r   