§
    ß·iˆ  ã                  ó~   — d dl mZ d dlZd dlmZ ddlmZ ddlm	Z	 ddl
mZ d!d„Z	 	 d"d#d„Z	 	 	 d$d%d„Z	 	 d"d&d „ZdS )'é    )ÚannotationsN)Úquoteé   )Ú
_plain_int)ÚSecurityError)Ú
uri_to_iriÚhostnameú
str | NoneÚtrusted_listút.Iterable[str]ÚreturnÚboolc                ó(  — | sdS 	 |                       d¦  «        d                              d¦  «                             d¦  «        } n# t          $ r Y dS w xY wt	          |t
          ¦  «        r|g}|D ]ž}|                     d¦  «        r|dd…         }d	}nd}	 |                      d¦  «        d                              d¦  «                             d¦  «        }n# t          $ r Y  dS w xY w|| k    s|r|                      d|› �¦  «        r d	S ŒŸdS )
zôCheck if a host matches a list of trusted names.

    :param hostname: The name to check.
    :param trusted_list: A list of valid names to match. If a name
        starts with a dot it will match all subdomains.

    .. versionadded:: 0.9
    Fú:r   ÚidnaÚasciiú.é   NT)Ú	partitionÚencodeÚdecodeÚUnicodeEncodeErrorÚ
isinstanceÚstrÚ
startswithÚendswith)r	   r   ÚrefÚsuffix_matchs       úZ/home/mmwave/public_html/mmwave/venv/lib/python3.11/site-packages/werkzeug/sansio/utils.pyÚhost_is_trustedr       sV  € ð ð ØˆuðØ×%Ò% cÑ*Ô*¨1Ô-×4Ò4°VÑ<Ô<×CÒCÀGÑLÔLˆˆøÝð ð ð Øˆuˆuðøøøõ �,¥Ñ$Ô$ð &Ø$�~ˆàð ð ˆØ�>Š>˜#ÑÔð 	!Ø�a�b�b”'ˆCØˆLˆLà ˆLð	Ø—-’- Ñ$Ô$ QÔ'×.Ò.¨vÑ6Ô6×=Ò=¸gÑFÔFˆCˆCøÝ!ð 	ð 	ð 	Ø�5�5�5ð	øøøð �(Š?ˆ?˜|ˆ?°×0AÒ0AÀ)ÀcÀ)À)Ñ0LÔ0Lˆ?Ø�4�4øàˆ5s%   †AA Á
AÁAÂACÃ
C+Ã*C+Úschemer   Úhost_headerÚserverútuple[str, int | None] | NoneÚtrusted_hostsút.Iterable[str] | Nonec                óV  — d}|�|}n5|�3|d         }d|v r|d         dk    rd|› d�}|d         �|› d|d         › �}| dv r |                      d	¦  «        r|dd
…         }n#| dv r|                      d¦  «        r
|dd…         }|�#t          ||¦  «        st          d|›d�¦  «        ‚|S )a€  Return the host for the given parameters.

    This first checks the ``host_header``. If it's not present, then
    ``server`` is used. The host will only contain the port if it is
    different than the standard port for the protocol.

    Optionally, verify that the host is trusted using
    :func:`host_is_trusted` and raise a
    :exc:`~werkzeug.exceptions.SecurityError` if it is not.

    :param scheme: The protocol the request used, like ``"https"``.
    :param host_header: The ``Host`` header value.
    :param server: Address of the server. ``(host, port)``, or
        ``(path, None)`` for unix sockets.
    :param trusted_hosts: A list of trusted host names.

    :return: Host, with port if necessary.
    :raise ~werkzeug.exceptions.SecurityError: If the host is not
        trusted.

    .. versionchanged:: 3.1.3
        If ``SERVER_NAME`` is IPv6, it is wrapped in ``[]``.
    Ú Nr   r   ú[ú]r   >   ÚwsÚhttpz:80éýÿÿÿ>   ÚwssÚhttpsz:443éüÿÿÿzHost z is not trusted.)r   r    r   )r!   r"   r#   r%   Úhosts        r   Úget_hostr2   1   s÷   € ð: €DàÐØˆˆØ	Ð	Ø�aŒyˆð �$ˆ;ˆ;˜4 œ7 cš>˜>Ø�t�;�;�;ˆDà�!Œ9Ð ØÐ(Ð(˜V AœYÐ(Ð(ˆDà�ÐÐ D§M¢M°%Ñ$8Ô$8ÐØ�C�R�CŒyˆˆØ	Ð#Ð	#Ð	#¨¯ª°fÑ(=Ô(=Ð	#Ø�C�R�CŒyˆàÐ Ý˜t ]Ñ3Ô3ð 	BÝÐ @¨Ð @Ð @Ð @ÑAÔAÐAà€Kó    r1   Ú	root_pathÚpathÚquery_stringúbytes | Nonec                ó†  — | d|g}|€7|                      d¦  «         t          d                     |¦  «        ¦  «        S |                      t          |                     d¦  «        d¬¦  «        ¦  «         |                      d¦  «         |€"t          d                     |¦  «        ¦  «        S |                      t          |                     d¦  «        d¬¦  «        ¦  «         |r9|                      d¦  «         |                      t          |d¬¦  «        ¦  «         t          d                     |¦  «        ¦  «        S )	aƒ  Recreate the URL for a request. If an optional part isn't
    provided, it and subsequent parts are not included in the URL.

    The URL is an IRI, not a URI, so it may contain Unicode characters.
    Use :func:`~werkzeug.urls.iri_to_uri` to convert it to ASCII.

    :param scheme: The protocol the request used, like ``"https"``.
    :param host: The host the request was made to. See :func:`get_host`.
    :param root_path: Prefix that the application is mounted under. This
        is prepended to ``path``.
    :param path: The path part of the URL after ``root_path``.
    :param query_string: The portion of the URL after the "?".
    z://Nú/r(   z!$&'()*+,/:;=@%)Úsafeú?z!$&'()*+,/:;=?@%)Úappendr   Újoinr   ÚrstripÚlstrip)r!   r1   r4   r5   r6   Úurls         r   Úget_current_urlrA   i   s  € ð( �5˜$Ð
€CàÐØ�
Š
�3‰ŒˆÝ˜"Ÿ'š' #™,œ,Ñ'Ô'Ð'ð ‡J‚J�u�Y×%Ò% cÑ*Ô*Ð1BÐCÑCÔCÑDÔDÐDØ‡J‚Jˆs�O„O€Oà€|Ý˜"Ÿ'š' #™,œ,Ñ'Ô'Ð'à‡J‚J�u�T—[’[ Ñ%Ô%Ð,=Ð>Ñ>Ô>Ñ?Ô?Ð?àð AØ�
Š
�3‰ŒˆØ�
Š
•5˜Ð,>Ð?Ñ?Ô?Ñ@Ô@Ð@å�b—g’g˜c‘l”lÑ#Ô#Ð#r3   Úhttp_content_lengthÚhttp_transfer_encodingú
int | Nonec                ót   — |dk    s| €dS 	 t          dt          | ¦  «        ¦  «        S # t          $ r Y dS w xY w)a¥  Return the ``Content-Length`` header value as an int. If the header is not given
    or the ``Transfer-Encoding`` header is ``chunked``, ``None`` is returned to indicate
    a streaming request. If the value is not an integer, or negative, 0 is returned.

    :param http_content_length: The Content-Length HTTP header.
    :param http_transfer_encoding: The Transfer-Encoding HTTP header.

    .. versionadded:: 2.2
    ÚchunkedNr   )Úmaxr   Ú
ValueError)rB   rC   s     r   Úget_content_lengthrI   ”   sZ   € ð  Ò*Ð*Ð.AÐ.IØˆtðÝ�1•jÐ!4Ñ5Ô5Ñ6Ô6Ð6øÝð ð ð Øˆqˆqðøøøs   Œ) ©
7¶7)r	   r
   r   r   r   r   )NN)
r!   r   r"   r
   r#   r$   r%   r&   r   r   )NNN)r!   r   r1   r   r4   r
   r5   r
   r6   r7   r   r   )rB   r
   rC   r
   r   rD   )Ú
__future__r   ÚtypingÚtÚurllib.parser   Ú	_internalr   Ú
exceptionsr   Úurlsr   r    r2   rA   rI   © r3   r   ú<module>rR      sò   ðØ "Ð "Ð "Ð "Ð "Ð "à Ð Ð Ð Ø Ð Ð Ð Ð Ð à "Ð "Ð "Ð "Ð "Ð "Ø &Ð &Ð &Ð &Ð &Ð &Ø Ð Ð Ð Ð Ð ð#ð #ð #ð #ðR -1Ø,0ð	5ð 5ð 5ð 5ð 5ðv !ØØ!%ð($ð ($ð ($ð ($ð ($ðX '+Ø)-ðð ð ð ð ð ð r3   