Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.12/site-packages/werkzeug/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.12/site-packages/werkzeug/__pycache__/http.cpython-312.pyc

�

'ٜgP���	�ddlmZddlZddlZddlZddlZddlm	Z	ddlmZddlm
Z
ddlmZddlmZddl
mZdd	lmZdd
l
mZddl
mZddlmZdd
lmZddlmZddlmZddlmZej8rddlmZed�Z ejBd�Z"egd��Z#egd��Z$idd�dd�dd�dd�dd �d!d"�d#d$�d%d&�d'd(�d)d*�d+d,�d-d.�d/d0�d1d2�d3d4�d5d6�d7d8�id9d:�d;d<�d=d>�d?d@�dAdB�dCdD�dEdF�dGdH�dIdJ�dKdL�dMdN�dOdP�dQdR�dSdT�dUdV�dWdX�dYdZ��id[d\�d]d^�d_d`�dadb�dcdd�dedf�dgdh�didj�dkdl�dmdn�dodp�dqdr�dsdt�dudv�dwdx�dydz�d{d|��d}d~dd�d�d�d�d�d�d�d�d�d�d��
�Z%Gd��d�e�Z&Gd��d�e�Z'd�d�d��Z(d�d��Z)d�d��Z*d�d��Z+d�d��Z,d�d��Z-d�d��Z.ejBd�ej^���Z0ejBd�ej^���Z1ejBd�ej^ejdz�Z3ejBd�ej^�Z4d�d��Z5ejBd�ej^�Z6ejnd�d����Z8ejrd�d���Z:ejrd�d���Z:	d�					d�d��Z:ejnd�d����Z;ejr	d�					d�d���Z<ejr		d�							d�d���Z<		d�							d�d��Z<ejnd�d����Z=ejr	d�					d�d���Z>ejr		d�							d�d���Z>		d�							d�d��Z>	d�					d�d��Z?d�d��Z@	d�					d�d��ZA	d�					d�d��ZBd�d�d��ZCejrd�d���ZDejrd�d���ZD				d�d��ZDd�d��ZEd�d��ZFd�d��ZG	d�			d�d��ZHd�d�d��ZId�d�d��ZJ				d�											d�d��ZK	d�					d�d��ZLd�d��ZMd�d��ZNd�d��ZO	d�					d�d��ZPejBd�ej��ZRejBd�ej��ZSd�d�dŜZTeTj�dƄgeVdǫ�dȢeVd�dʫ�D��											d�																									d�d˄ZW								d�d̄ZXdd�lYmZZ[dd�l\m]Z^y)��)�annotationsN��date)�datetime)�time)�	timedelta)�timezone)�Enum)�sha1)�mktime)�struct_time)�quote)�unquote)�parse_http_list�)�
_dt_as_utc)�
_plain_int)�WSGIEnvironmentzM!#$%&'*+-.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ^_`abcdefghijklmnopqrstuvwxyz|~z&([Ww]/)?(?:"(.*?)"|(.*?))(?:\s*,\s*|$))
�allowzcontent-encodingzcontent-languagezcontent-length�content-locationzcontent-md5z
content-rangezcontent-type�expiresz
last-modified)�
connectionz
keep-alivezproxy-authenticatezproxy-authorization�te�trailerztransfer-encoding�upgrade�d�Continue�ezSwitching Protocols�f�
Processing�gzEarly Hints���OK���Created���Accepted��zNon Authoritative Information��z
No Content��z
Reset Content��zPartial Content��zMulti Status��zAlready Reported��zIM Usedi,zMultiple Choicesi-zMoved Permanentlyi.�Foundi/z	See Otheri0zNot Modifiedi1z	Use Proxyi2zSwitch Proxyi3zTemporary Redirecti4zPermanent Redirecti�zBad Requesti��Unauthorizedi�zPayment Requiredi��	Forbiddeni�z	Not Foundi�zMethod Not Allowedi�zNot Acceptablei�zProxy Authentication Requiredi�zRequest Timeouti��Conflicti��Gonei�zLength Requiredi�zPrecondition Failedi�zRequest Entity Too Largei�zRequest URI Too Longi�zUnsupported Media Typei�zRequested Range Not Satisfiablei�zExpectation Failedi�zI'm a teapoti�zMisdirected Requesti�zUnprocessable Entityi��Lockedi�zFailed Dependencyi�z	Too Earlyi�zUpgrade Requiredi�zPrecondition Requiredi�zToo Many Requestsi�zRequest Header Fields Too Largez
Retry WithzUnavailable For Legal ReasonszInternal Server ErrorzNot ImplementedzBad GatewayzService UnavailablezGateway TimeoutzHTTP Version Not SupportedzVariant Also NegotiateszInsufficient Storagez
Loop DetectedzNot ExtendedzNetwork Authentication Failed)
i�i�i�i�i�i�i�i�i�i�i�i�i�c��eZdZdZdZdZy)�COEPzCross Origin Embedder Policies�unsafe-nonezrequire-corpN)�__name__�
__module__�__qualname__�__doc__�UNSAFE_NONE�REQUIRE_CORP���8/usr/local/lib/python3.12/site-packages/werkzeug/http.pyr6r6|s��(��K�!�Lr?r6c��eZdZdZdZdZdZy)�COOPzCross Origin Opener Policiesr7zsame-origin-allow-popupszsame-originN)r8r9r:r;r<�SAME_ORIGIN_ALLOW_POPUPS�SAME_ORIGINr>r?r@rBrB�s��&��K�9���Kr?rBc��t|�}|sy|rt}|j|�r|S|jdd�jdd�}d|�d�S)a�Add double quotes around a header value. If the header contains only ASCII token
    characters, it will be returned unchanged. If the header contains ``"`` or ``\``
    characters, they will be escaped with an additional ``\`` character.

    This is the reverse of :func:`unquote_header_value`.

    :param value: The value to quote. Will be converted to a string.
    :param allow_token: Disable to quote the value even if it only has token characters.

    .. versionchanged:: 3.0
        Passing bytes is not supported.

    .. versionchanged:: 3.0
        The ``extra_chars`` parameter is removed.

    .. versionchanged:: 2.3
        The value is quoted if it is the empty string.

    .. versionadded:: 0.5
    z""�\�\\�"�\")�str�_token_chars�
issuperset�replace)�value�allow_token�	value_str�token_charss    r@�quote_header_valuerR�s]��*�E�
�I����"���!�!�)�,����!�!�$��/�7�7��U�C�I�
�y�k���r?c��t|�dk\r<|d|dcxk(rdk(r+n|S|dd}|jdd�jdd�S|S)	aRemove double quotes and decode slash-escaped ``"`` and ``\`` characters in a
    header value.

    This is the reverse of :func:`quote_header_value`.

    :param value: The header value to unquote.

    .. versionchanged:: 3.0
        The ``is_filename`` parameter is removed.
    �r���rHrrGrFrI)�lenrM�rNs r@�unquote_header_valuerX�sZ���5�z�Q��5��8�u�R�y�7�C�7��L��a�����}�}�V�T�*�2�2�5�#�>�>��Lr?c��g}|�|j|�|j�D]F\}}|��	|ddk(r|j|�d|����(|j|�dt|�����Hdj|�S)aAProduce a header value and ``key=value`` parameters separated by semicolons
    ``;``. For example, the ``Content-Type`` header.

    .. code-block:: python

        dump_options_header("text/html", {"charset": "UTF-8"})
        'text/html; charset=UTF-8'

    This is the reverse of :func:`parse_options_header`.

    If a value contains non-token characters, it will be quoted.

    If a value is ``None``, the parameter is skipped.

    In some keys for some headers, a UTF-8 value can be encoded using a special
    ``key*=UTF-8''value`` form, where ``value`` is percent encoded. This function will
    not produce that format automatically, but if a given key ends with an asterisk
    ``*``, the value is assumed to have that form and will not be quoted further.

    :param header: The primary header value.
    :param options: Parameters to encode as ``key=value`` pairs.

    .. versionchanged:: 2.3
        Keys with ``None`` values are skipped rather than treated as a bare key.

    .. versionchanged:: 2.2.3
        If a key ends with ``*``, its value will not be quoted.
    rU�*�=�; )�append�itemsrR�join)�header�options�segments�keyrNs     r@�dump_options_headerrd�s���:�H�
��������m�m�o�
��U��=���r�7�c�>��O�O�s�e�1�U�G�,�-��O�O�s�e�1�%7��%>�$?�@�A�&��9�9�X��r?c�X�t|t�rmg}|j�D]W\}}|�|j|��|ddk(r|j|�d|����9|j|�dt	|�����Yn|D�cgc]
}t	|���}}dj|�Scc}w)a'Produce a header value from a list of items or ``key=value`` pairs, separated by
    commas ``,``.

    This is the reverse of :func:`parse_list_header`, :func:`parse_dict_header`, and
    :func:`parse_set_header`.

    If a value contains non-token characters, it will be quoted.

    If a value is ``None``, the key is output alone.

    In some keys for some headers, a UTF-8 value can be encoded using a special
    ``key*=UTF-8''value`` form, where ``value`` is percent encoded. This function will
    not produce that format automatically, but if a given key ends with an asterisk
    ``*``, the value is assumed to have that form and will not be quoted further.

    .. code-block:: python

        dump_header(["foo", "bar baz"])
        'foo, "bar baz"'

        dump_header({"foo": "bar baz"})
        'foo="bar baz"'

    :param iterable: The items to create a header from.

    .. versionchanged:: 3.0
        The ``allow_token`` parameter is removed.

    .. versionchanged:: 2.2.3
        If a key ends with ``*``, its value will not be quoted.
    rUrZr[z, )�
isinstance�dictr^r]rRr_)�iterabler^rcrN�xs     r@�dump_headerrj�s���@�(�D�!���"�.�.�*�J�C���}����S�!��R��C������u�A�e�W�-�.�����u�A�&8��&?�%@�A�B�
+�19�9��1�#�A�&���9��9�9�U����:s�B'�ds.ContentSecurityPolicyc�N�djd�|j�D��S)z�Dump a Content Security Policy header.

    These are structured into policies such as "default-src 'self';
    script-src 'self'".

    .. versionadded:: 1.0.0
       Support for Content Security Policy headers was added.

    r\c3�0K�|]\}}|�d|�����y�w)� Nr>)�.0rcrNs   r@�	<genexpr>z"dump_csp_header.<locals>.<genexpr>)s ����G��*�#�u��u�A�e�W�%��s�)r_r^�r`s r@�dump_csp_headerrrs���9�9�G�����G�G�Gr?c��g}t|�D]:}t|�dk\r|d|dcxk(rdk(rnn|dd}|j|��<|S)a�Parse a header value that consists of a list of comma separated items according
    to `RFC 9110 <https://httpwg.org/specs/rfc9110.html#abnf.extension>`__.

    This extends :func:`urllib.request.parse_http_list` to remove surrounding quotes
    from values.

    .. code-block:: python

        parse_list_header('token, "quoted value"')
        ['token', 'quoted value']

    This is the reverse of :func:`dump_header`.

    :param value: The header value to parse.
    rTrrUrHr)�_parse_list_headerrVr])rN�result�items   r@�parse_list_headerrw,sU�� �F�"�5�)���t�9��>�d�1�g��b��8�S�8���"�:�D��
�
�d��	*��Mr?c��i}t|�D]�}|jd�\}}}|j�}|s�+|sd||<�3|j�}d}|ddk(rP|dd}tj	|�}|r#|j�\}}|j
�}|dvr
t||��}t|�dk\r|d|dcxk(rd	k(rnn|d
d}|||<��|S)a~Parse a list header using :func:`parse_list_header`, then parse each item as a
    ``key=value`` pair.

    .. code-block:: python

        parse_dict_header('a=b, c="d, e", f')
        {"a": "b", "c": "d, e", "f": None}

    This is the reverse of :func:`dump_header`.

    If a key does not have a value, it is ``None``.

    This handles charsets for values as described in
    `RFC 2231 <https://www.rfc-editor.org/rfc/rfc2231#section-3>`__. Only ASCII, UTF-8,
    and ISO-8859-1 charsets are accepted, otherwise the value remains quoted.

    :param value: The header value to parse.

    .. versionchanged:: 3.0
        Passing bytes is not supported.

    .. versionchanged:: 3.0
        The ``cls`` argument is removed.

    .. versionchanged:: 2.3
        Added support for ``key*=charset''value`` encoded items.

    .. versionchanged:: 0.9
       The ``cls`` argument was added.
    r[NrUrZ>�ascii�utf-8�us-ascii�
iso-8859-1��encodingrTrrHr)	rw�	partition�strip�_charset_value_re�match�groups�lowerrrV)rNrurvrc�	has_valuer~r�s       r@�parse_dict_headerr�Gs���>%'�F�!�%�(�� $���s� 3���Y���i�i�k������F�3�K�����
��#���r�7�c�>��c�r�(�C�%�+�+�E�2�E��"'�,�,�.���%�#�>�>�+��
�G�G����9���u�:��?�u�Q�x�5��9�;��;��!�B�K�E���s��I)�L�Mr?z([\w!#$%&'*+\-.^`|~]+)=)�flagsz[\w!#$%&'*+\-.^`|~]+z�
    ([\w!#$%&*+\-.^`|~]*)'  # charset part, could be empty
    [\w!#$%&*+\-.^`|~]*'  # don't care about language part, usually empty
    ([\w!#$%&'*+\-.^`|~]+)  # one or more token chars with percent encoding
    z\*(\d+)$c��|�difS|jd�\}}}|j�}|j�}|r|s|ifSg}	tj|�x}��|j	d�j�}||j
�d}tj|�x}�"|j||j	�f�n_|dddk(rWd}t|�}||krE|||dzdvr|dz
}n/||dk(r"|j||d|dzf�||dzd}n|dz
}||kr�E|jd�x}dk(rn||dzdj�}��i}	d}
d}|D]�\}}|dd	k(rV|dd}tj|�}
|
r#|
j�\}
}|
j�}
|
s|}
|
d
vr|
}t||
��}|d|dcxk(rdk(r8nn5|ddjd
d�jdd�jdd�}t j#|�}
|
r,|d|
j%�}|	j'|d�|z|	|<��||	|<��||	fS)a�Parse a header that consists of a value with ``key=value`` parameters separated
    by semicolons ``;``. For example, the ``Content-Type`` header.

    .. code-block:: python

        parse_options_header("text/html; charset=UTF-8")
        ('text/html', {'charset': 'UTF-8'})

        parse_options_header("")
        ("", {})

    This is the reverse of :func:`dump_options_header`.

    This parses valid parameter parts as described in
    `RFC 9110 <https://httpwg.org/specs/rfc9110.html#parameter>`__. Invalid parts are
    skipped.

    This handles continuations and charsets as described in
    `RFC 2231 <https://www.rfc-editor.org/rfc/rfc2231#section-3>`__, although not as
    strictly as the RFC. Only ASCII, UTF-8, and ISO-8859-1 charsets are accepted,
    otherwise the value remains quoted.

    Clients may not be consistent in how they handle a quote character within a quoted
    value. The `HTML Standard <https://html.spec.whatwg.org/#multipart-form-data>`__
    replaces it with ``%22`` in multipart form data.
    `RFC 9110 <https://httpwg.org/specs/rfc9110.html#quoted.strings>`__ uses backslash
    escapes in HTTP headers. Both are decoded to the ``"`` character.

    Clients may not be consistent in how they handle non-ASCII characters. HTML
    documents must declare ``<meta charset=UTF-8>``, otherwise browsers may replace with
    HTML character references, which can be decoded using :func:`html.unescape`.

    :param value: The header value to parse.
    :return: ``(value, options)``, where ``options`` is a dict

    .. versionchanged:: 2.3
        Invalid parts, such as keys with no value, quoted keys, and incorrectly quoted
        values, are discarded instead of treating as ``None``.

    .. versionchanged:: 2.3
        Only ASCII, UTF-8, and ISO-8859-1 are accepted for charset values.

    .. versionchanged:: 2.3
        Escaped quotes in quoted values, like ``%22`` and ``\"``, are handled.

    .. versionchanged:: 2.2
        Option names are always converted to lowercase.

    .. versionchanged:: 2.2
        The ``multiple`` parameter was removed.

    .. versionchanged:: 0.15
        :rfc:`2231` parameter continuations are handled.

    .. versionadded:: 0.5
    N��;rrHrT>rIrGrUrZ>ryrzr{r|r}rrGrFrIz%22)rr��_parameter_key_rer��groupr��end�_parameter_token_value_rer]rV�find�lstripr�r�rrM�_continuation_re�search�start�get)rN�_�rest�parts�m�pk�pos�lengthr�rar~�continued_encoding�pvr�s              r@�parse_options_headerr��s���r
�}��2�v�
��_�_�S�)�N�E�1�d��K�K�M�E��:�:�<�D����b�y��$&�E�
�"�(�(��.�.�A�;������!�!�#�B������	�?�D�/�4�4�T�:�:��G����b�!�'�'�)�_�-��b�q��S�����T����F�l��C�#��'�*�o�=��q����c��c�)����b�$�y��q��/�%:�;�#�C�!�G�I�����q����F�l��9�9�S�>�!�C�b�(���C�!�G�I��%�%�'��?�B!�G��H�%)�����B�
�b�6�S�=��C�R��B�%�+�+�B�/�E��$�|�|�~���"�#�>�>�+���-��
�G�G�
&.�"��R�(�3���a�5�B�r�F�!�c�!��A�b��!�!�&�$�/�7�7��s�C�K�K�E�SV�W�B� �'�'��+����O�e�k�k�m�$�B�!�+�+�b�"�-��2�G�B�K��G�B�K�Q�T�'�>�r?z
-?\d+(\.\d+)?�_TAnyAccept�	ds.Accept)�boundc��y�Nr>rWs r@�parse_accept_headerr�@s��9<r?c��yr�r>)rN�clss  r@r�r�Ds��SVr?c��|�/tjtttj
�}|s|d�Sg}t
|�D]�}t|�\}}d|vrK|jd�j�}tj|���Jt|�}|dks|dkDr�`d}|rt||�}|j||f���||�S)akParse an ``Accept`` header according to
    `RFC 9110 <https://httpwg.org/specs/rfc9110.html#field.accept>`__.

    Returns an :class:`.Accept` instance, which can sort and inspect items based on
    their quality parameter. When parsing ``Accept-Charset``, ``Accept-Encoding``, or
    ``Accept-Language``, pass the appropriate :class:`.Accept` subclass.

    :param value: The header value to parse.
    :param cls: The :class:`.Accept` class to wrap the result in.
    :return: An instance of ``cls``.

    .. versionchanged:: 2.3
        Parse according to RFC 9110. Items with invalid ``q`` values are skipped.
    N�qrr)�t�cast�typer��ds�Acceptrwr��popr��_q_value_re�	fullmatch�floatrdr])rNr�rurvra�q_strr�s       r@r�r�Hs���"�{��f�f�T�+�&��	�	�2����4�y��
�F�!�%�(��,�T�2�
��g��'�>��K�K��$�*�*�,�E��$�$�U�+�3���e��A��1�u��A����A��&�t�W�5�D��
�
�t�Q�i� �/)�2�v�;�r?�_TAnyCCzds.cache_control._CacheControlc��yr�r>�rN�	on_updates  r@�parse_cache_control_headerr��s��!r?c��yr�r>�rNr�r�s   r@r�r��s��
r?c��|�$tjdtj�}|s	|d|�S|t	|�|�S)aParse a cache control header.  The RFC differs between response and
    request cache control, this method does not.  It's your responsibility
    to not use the wrong control statements.

    .. versionadded:: 0.5
       The `cls` was added.  If not specified an immutable
       :class:`~werkzeug.datastructures.RequestCacheControl` is returned.

    :param value: a cache control header to be parsed.
    :param on_update: an optional callable that is called every time a value
                      on the :class:`~werkzeug.datastructures.CacheControl`
                      object is changed.
    :param cls: the class for the returned object.  By default
                :class:`~werkzeug.datastructures.RequestCacheControl` is used.
    :return: a `cls` object.
    �
type[_TAnyCC]r>)r�r�r��RequestCacheControlr�r�s   r@r�r��sB��*�{��f�f�_�b�&<�&<�=����2�y�!�!�� ��'��3�3r?�_TAnyCSPc��yr�r>r�s  r@�parse_csp_headerr��s�� #r?c��yr�r>r�s   r@r�r��s��
r?c�t�|�$tjdtj�}|�	|d|�Sg}|j	d�D]i}|j�}d|vs�|j�j	dd�\}}|j
|j�|j�f��k|||�S)a�Parse a Content Security Policy header.

    .. versionadded:: 1.0.0
       Support for Content Security Policy headers was added.

    :param value: a csp header to be parsed.
    :param on_update: an optional callable that is called every time a value
                      on the object is changed.
    :param cls: the class for the returned object.  By default
                :class:`~werkzeug.datastructures.ContentSecurityPolicy` is used.
    :return: a `cls` object.
    �type[_TAnyCSP]r>r�rnr)r�r�r��ContentSecurityPolicy�splitr�r])rNr�r�r^�policy�	directives      r@r�r��s���"�{��f�f�%�r�'?�'?�@���}��2�y�!�!��E��+�+�c�"��������&�=�%�|�|�~�3�3�C��;��I�u��L�L�)�/�/�+�U�[�[�]�;�<�
#��u�i� � r?c�p�|stjd|�Stjt|�|�S)aParse a set-like header and return a
    :class:`~werkzeug.datastructures.HeaderSet` object:

    >>> hs = parse_set_header('token, "quoted value"')

    The return value is an object that treats the items case-insensitively
    and keeps the order of the items:

    >>> 'TOKEN' in hs
    True
    >>> hs.index('quoted value')
    1
    >>> hs
    HeaderSet(['token', 'quoted value'])

    To create a header from the :class:`HeaderSet` again, use the
    :func:`dump_header` function.

    :param value: a set header to be parsed.
    :param on_update: an optional callable that is called every time a
                      value on the :class:`~werkzeug.datastructures.HeaderSet`
                      object is changed.
    :return: a :class:`~werkzeug.datastructures.HeaderSet`
    N)r��	HeaderSetrwr�s  r@�parse_set_headerr��s/��8��|�|�D�)�,�,�
�<�<�)�%�0�)�<�<r?c��|stj�St|�}|�tj|��Stjt|�d�S)z�Parses an if-range header which can be an etag or a date.  Returns
    a :class:`~werkzeug.datastructures.IfRange` object.

    .. versionchanged:: 2.0
        If the value represents a datetime, it is timezone-aware.

    .. versionadded:: 0.7
    rr)r��IfRange�
parse_date�unquote_etag)rNrs  r@�parse_if_range_headerr�sK����z�z�|���e��D����z�z�t�$�$�
�:�:�l�5�)�!�,�-�-r?c��|rd|vryg}d}|jdd�\}}|j�j�}|jd�D]�}|j�}d|vry|jd�r|dkry	t	|�}d}d}nqd|vrm|jdd�\}	}
|	j�}	|
j�}
	t	|	�}||ks|dkry|
r	t	|
�dz}||k\ryd}|�|nd}|j
f���tj||�S#t
$rYywxYw#t
$rYywxYw#t
$rYywxYw)aParses a range header into a :class:`~werkzeug.datastructures.Range`
    object.  If the header is missing or malformed `None` is returned.
    `ranges` is a list of ``(start, stop)`` tuples where the ranges are
    non-inclusive.

    .. versionadded:: 0.7
    r[Nrr�,�-rU)	r�r�r��
startswithr�
ValueErrorr]r��Range)rN�make_inclusive�ranges�last_end�units�rngrv�beginr��	begin_str�end_strs           r@�parse_range_headerr�s����C�u�$��
�F��H����S�!�$�J�E�3��K�K�M���!�E��	�	�#����z�z�|���d�?���?�?�3���!�|��
�"�4�(���C��H�
�D�[�!%���C��!3��I�w�!���)�I��m�m�o�G�
�"�9�-���x��8�a�<��� �$�W�-��1�C��C�<����!�o�s�2�H��
�
�u�c�l�#�I�L�8�8�E�6�"�"��;�
��
���
��
��"� �� �s6�D.�D>�&E�.	D;�:D;�>	E�
E�	E�Ec� �|�y	|xsdj�jdd�\}}d|vry|jdd�\}}|dk(rd}n	t|�}|dk(r(t	dd|�sytj|dd||��Sd|vry|jdd�\}}	t|�}	t|�dz}
t	|	|
|�rtj||	|
||��Sy#t$rYywxYw#t$rYywxYw#t$rYywxYw)a�Parses a range header into a
    :class:`~werkzeug.datastructures.ContentRange` object or `None` if
    parsing is not possible.

    .. versionadded:: 0.7

    :param value: a content range header to be parsed.
    :param on_update: an optional callable that is called every time a value
                      on the :class:`~werkzeug.datastructures.ContentRange`
                      object is changed.
    Nr�r�/rZ)r�r�)r�r�r�r�is_byte_range_validr��ContentRange)rNr�r��rangedefr��
length_strr��	start_str�stop_strr��stops           r@�parse_content_range_headerr�Qs@��
�}��� �;�B�-�-�/�5�5�d�A�>���x��(����n�n�S�!�,�O�C���S����	��
�+�F��c�z�"�4��v�6�����u�d�D�&�I�N�N�	�C����)�)�C��+��I�x���9�%���(�#�a�'���5�$��/����u�e�T�6�Y�O�O���A������	��	������s5�'C#�C2�"D�#	C/�.C/�2	C>�=C>�	D
�D
c�>�d|vrtd��d|�d�}|rd|��}|S)ziQuote an etag.

    :param etag: the etag to quote.
    :param weak: set to `True` to tag it "weak".
    rHzinvalid etag�W/)r���etag�weaks  r@�
quote_etagr��s6���d�{���(�(�
�t�f�A�;�D���D�6�{���Kr?c��yr�r>�r�s r@r�r��s��14r?c��yr�r>r�s r@r�r��s��36r?c��|sy|j�}d}|jd�rd}|dd}|dd|ddcxk(rd	k(rn||fS|dd}||fS)
z�Unquote a single etag:

    >>> unquote_etag('W/"bar"')
    ('bar', True)
    >>> unquote_etag('"bar"')
    ('bar', False)

    :param etag: the etag identifier to unquote.
    :return: a ``(etag, weak)`` tuple.
    �NNF)r�zw/TrTNrrUrH)r�r�r�s  r@r�r��sp�����:�:�<�D��D����|�$����A�B�x���B�Q�x�4���9�#��#���:���A�b�z����:�r?c��|stj�Sg}g}t|�}d}||kr�tj	||�}|�nn|j�\}}}|dk(rtjd��S|r|}|r|j
|�n|j
|�|j�}||kr��tj||�S)z�Parse an etag header.

    :param value: the tag header to parse
    :return: an :class:`~werkzeug.datastructures.ETags` object.
    rrZT)�star_tag)r��ETagsrV�_etag_rer�r�r]r�)	rN�strongr�r�r�r��is_weak�quoted�raws	         r@�parse_etagsr��s�����x�x�z��
�F�
�D�

�e�*�C�
�C�

��)����u�c�*���=��$�|�|�~������#�:��8�8�T�*�*�
��C���K�K����M�M�#���i�i�k����)��8�8�F�D�!�!r?c�4�t|�j�S)z�Generate an etag for some data.

    .. versionchanged:: 2.0
        Use SHA-1. MD5 may not be available in some environments.
    )r�	hexdigest)�datas r@�
generate_etagr��s����:���!�!r?c���|�y	tjj|�}|j
� |j
tj��S|S#ttf$rYywxYw)aKParse an :rfc:`2822` date into a timezone-aware
    :class:`datetime.datetime` object, or ``None`` if parsing fails.

    This is a wrapper for :func:`email.utils.parsedate_to_datetime`. It
    returns ``None`` if parsing fails instead of raising an exception,
    and always returns a timezone-aware datetime object. If the string
    doesn't have timezone information, it is assumed to be UTC.

    :param value: A string with a supported date format.

    .. versionchanged:: 2.0
        Return a timezone-aware datetime object. Use
        ``email.utils.parsedate_to_datetime``.
    N��tzinfo)	�email�utils�parsedate_to_datetime�	TypeErrorr�rrMr	�utc)rN�dts  r@r�r��sd��
�}���
�[�[�
.�
.�u�
5��
�y�y���z�z����z�.�.�
�I��

�z�"����s�A�A$�#A$c�p�t|t�rkt|t�s/tj|t	�t
j��}nt|�}tjj|d��St|t�rt|�}tjj|d��S)a�Format a datetime object or timestamp into an :rfc:`2822` date
    string.

    This is a wrapper for :func:`email.utils.format_datetime`. It
    assumes naive datetime objects are in UTC instead of raising an
    exception.

    :param timestamp: The datetime or timestamp to format. Defaults to
        the current time.

    .. versionchanged:: 2.0
        Use ``email.utils.format_datetime``. Accept ``date`` objects.
    rT)�usegmt)rfrr�combinerr	rrrr�format_datetimer
r�
formatdate)�	timestamps r@�	http_dater�s��� �)�T�"��)�X�.� �(�(��D�F�8�<�<�P�I�#�9�-�I��{�{�*�*�9�T�*�B�B��)�[�)��9�%�	��;�;�!�!�)�D�!�9�9r?c��|sy	t|�}|dkry	t|��S#t$rYywxYw#t$rYywxYw)z�Parses a base-10 integer count of seconds into a timedelta.

    If parsing fails, the return value is `None`.

    :param value: a string consisting of an integer represented in base-10
    :return: a :class:`datetime.timedelta` object or `None`.
    Nr)�seconds)�intr�r�
OverflowError)rNrs  r@�	parse_agers[������e�*����{�����)�)�����������s�#�2�	/�/�	>�>c��|�yt|t�rt|j��}nt|�}|dkrt	d��t|�S)z�Formats the duration as a base-10 integer.

    :param age: should be an integer number of seconds,
                a :class:`datetime.timedelta` object, or,
                if the age is unknown, `None` (default).
    Nrzage cannot be negative)rfrr�
total_secondsr�rJ)�ages r@�dump_ager+sN���{���#�y�!��#�#�#�%�&���#�h��
�Q�w��1�2�2��s�8�Or?c���tj|jd�|jd�|jd�|jd�|jd�||||��	S)a2Convenience method for conditional requests.

    :param environ: the WSGI environment of the request to be checked.
    :param etag: the etag for the response for comparison.
    :param data: or alternatively the data of the response to automatically
                 generate an etag using :func:`generate_etag`.
    :param last_modified: an optional date of the last modification.
    :param ignore_if_range: If `False`, `If-Range` header will be taken into
                            account.
    :return: `True` if the resource was modified, otherwise `False`.

    .. versionchanged:: 2.0
        SHA-1 is used to generate an etag value for the data. MD5 may
        not be available in some environments.

    .. versionchanged:: 1.0.0
        The check is run for methods other than ``GET`` and ``HEAD``.
    �
HTTP_RANGE�
HTTP_IF_RANGE�HTTP_IF_MODIFIED_SINCE�HTTP_IF_NONE_MATCH�
HTTP_IF_MATCH)	�
http_range�
http_if_range�http_if_modified_since�http_if_none_match�
http_if_matchr�r��
last_modified�ignore_if_range)�_sansio_http�is_resource_modifiedr�)�environr�r�r$r%s     r@r'r'?sa��2�,�,��;�;�|�,��k�k�/�2�&�{�{�+C�D�"�;�;�';�<��k�k�/�2�
�
�#�'�
�
r?c���|D�chc]}|j���}}|D��cgc]&\}}t|�r|j�|vr||f��(c}}|ddycc}wcc}}w)aRemove all entity headers from a list or :class:`Headers` object.  This
    operation works in-place.  `Expires` and `Content-Location` headers are
    by default not removed.  The reason for this is :rfc:`2616` section
    10.3.5 which specifies some entity headers that should be sent.

    .. versionchanged:: 0.5
       added `allowed` parameter.

    :param headers: a list or :class:`Headers` object.
    :param allowed: a list of headers that should still be allowed even though
                    they are entity headers.
    N)r��is_entity_header)�headers�allowedrircrNs     r@�remove_entity_headersr-esh�� #*�*�'�Q�q�w�w�y�'�G�*�"��!�J�C����$��	�	��w�(>�

�e��!��G�A�J��+��s
�A�+Ac�\�|D��cgc]\}}t|�r�||f��c}}|ddycc}}w)z�Remove all HTTP/1.1 "Hop-by-Hop" headers from a list or
    :class:`Headers` object.  This operation works in-place.

    .. versionadded:: 0.5

    :param headers: a list or :class:`Headers` object.
    N)�is_hop_by_hop_header)r+rcrNs   r@�remove_hop_by_hop_headersr0}s6��(/��'.���e�6J�3�6O��e��w��G�A�J��s�(�(c�.�|j�tvS)z�Check if a header is an entity header.

    .. versionadded:: 0.5

    :param header: the header to test.
    :return: `True` if it's an entity header, `False` otherwise.
    )r��_entity_headersrqs r@r*r*�s���<�<�>�_�,�,r?c�.�|j�tvS)z�Check if a header is an HTTP/1.1 "Hop-by-Hop" header.

    .. versionadded:: 0.5

    :param header: the header to test.
    :return: `True` if it's an HTTP/1.1 "Hop-by-Hop" header, `False` otherwise.
    )r��_hop_by_hop_headersrqs r@r/r/�s���<�<�>�0�0�0r?c��t|t�r|jd�}n|}|r|jd�j	�}tj||��S)aOParse a cookie from a string or WSGI environ.

    The same key can be provided multiple times, the values are stored
    in-order. The default :class:`MultiDict` will have the first value
    first, and all values can be retrieved with
    :meth:`MultiDict.getlist`.

    :param header: The cookie header as a string, or a WSGI environ dict
        with a ``HTTP_COOKIE`` key.
    :param cls: A dict-like class to store the parsed cookies in.
        Defaults to :class:`MultiDict`.

    .. versionchanged:: 3.0
        Passing bytes, and the ``charset`` and ``errors`` parameters, were removed.

    .. versionchanged:: 1.0
        Returns a :class:`MultiDict` instead of a ``TypeConversionDict``.

    .. versionchanged:: 0.5
        Returns a :class:`TypeConversionDict` instead of a regular dict. The ``cls``
        parameter was added.
    �HTTP_COOKIE�latin1)�cookier�)rfrgr��encode�decoder&�parse_cookie)r`r�r8s   r@r;r;�sN��4�&�$�����M�*����
����x�(�/�/�1���$�$�F��<�<r?z#[\w!#$%&'()*+\-./:<=>?@\[\]^`{|}~]*s[\x00-\x19\",;\\\x7f-\xff]s\"s\\)�"�\c#�JK�|]}|jdd�d|zf���y�w)r�bigs\%03oN)�to_bytes)ro�vs  r@rprp�s,�����
6���Z�Z��5��9�q�=�)�
6�s�!#� s,;��c
�H�|�
t|d��}|rA|jd�djd�jd�j	d�}t|t�rt|j��}|�t|t�sNt|�}nB|�@|r>ttjtj��j�|z�}|
�|
j!�}
|
d	vrt#d
��|rd}t$j'|�s:t(j+d�|j��j	d�}d
|�d
�}|j�j	d��d|��g}d|fd|fd|fd|fd|fd|fd|
fd|ffD]8\}
}|�|dur�
|dur|j-|
��#|j-|
�d|����:dj/|�}t1|�}|	r:||	kDr5t1|�}t3j4d|�d|�d||z
�d|�d|	�d�d �!�|S)"a:Create a Set-Cookie header without the ``Set-Cookie`` prefix.

    The return value is usually restricted to ascii as the vast majority
    of values are properly escaped, but that is no guarantee. It's
    tunneled through latin1 as required by :pep:`3333`.

    The return value is not ASCII safe if the key contains unicode
    characters.  This is technically against the specification but
    happens in the wild.  It's strongly recommended to not use
    non-ASCII values for the keys.

    :param max_age: should be a number of seconds, or `None` (default) if
                    the cookie should last only as long as the client's
                    browser session.  Additionally `timedelta` objects
                    are accepted, too.
    :param expires: should be a `datetime` object or unix timestamp.
    :param path: limits the cookie to a given path, per default it will
                 span the whole domain.
    :param domain: Use this if you want to set a cross-domain cookie. For
                   example, ``domain="example.com"`` will set a cookie
                   that is readable by the domain ``www.example.com``,
                   ``foo.example.com`` etc. Otherwise, a cookie will only
                   be readable by the domain that set it.
    :param secure: The cookie will only be available via HTTPS
    :param httponly: disallow JavaScript to access the cookie.  This is an
                     extension to the cookie standard and probably not
                     supported by all browsers.
    :param charset: the encoding for string values.
    :param sync_expires: automatically set expires if max_age is defined
                         but expires not.
    :param max_size: Warn if the final header value exceeds this size. The
        default, 4093, should be safely `supported by most browsers
        <cookie_>`_. Set to 0 to disable this check.
    :param samesite: Limits the scope of the cookie such that it will
        only be attached to requests if those requests are same-site.
    :param partitioned: Opts the cookie into partitioned storage. This
        will also set secure to True

    .. _`cookie`: http://browsercookielimits.squawky.net/

    .. versionchanged:: 3.1
        The ``partitioned`` parameter was added.

    .. versionchanged:: 3.0
        Passing bytes, and the ``charset`` parameter, were removed.

    .. versionchanged:: 2.3.3
        The ``path`` parameter is ``/`` by default.

    .. versionchanged:: 2.3.1
        The value allows more characters without quoting.

    .. versionchanged:: 2.3
        ``localhost`` and other names without a dot are allowed for the domain. A
        leading dot is ignored.

    .. versionchanged:: 2.3
        The ``path`` parameter is ``None`` by default.

    .. versionchanged:: 1.0.0
        The string ``'None'`` is accepted for ``samesite``.
    z%!$&'()*+,/:=@)�safe�:r�.�idnary)�tz>�Lax�None�Strictz,SameSite must be 'Strict', 'Lax', or 'None'.Tc�0�t|j�Sr�)�_cookie_slash_mapr�)r�s r@�<lambda>zdump_cookie.<locals>.<lambda>:s��'����	�2r?rHr7r[�Domain�ExpireszMax-Age�Secure�HttpOnly�Path�SameSite�PartitionedFr\zThe 'z%' cookie is too large: the value was z bytes but the header required z! extra bytes. The final size was z bytes but the limit is z> bytes. Browsers may silently ignore cookies larger than this.rT)�
stacklevel)rrr�r9r:rfrrrrJrr�nowr	rr�titler��_cookie_no_quote_rer��_cookie_slash_re�subr]r_rV�warnings�warn)rcrN�max_ager�path�domain�secure�httponly�sync_expires�max_size�samesite�partitioned�buf�krA�rv�cookie_size�
value_sizes                  r@�dump_cookiern�s_��X���T� 0�1��
��!�!�#�&�q�)�0�0��5�<�<�V�D�K�K�G�T���'�9�%��g�+�+�-�.�����'�3�'���(�G�	�	���H�L�L�H�L�L�9�C�C�E��O�P�����>�>�#���4�4��K�L�L�����(�(��/� �$�$�2�E�L�L�N�
�
�&��/�	��E�7�!����j�j�l�!�!�(�+�
,�A�e�W�5�
6�C�
�6��	�G��	�G��	�6��	�X��	���	�X��	��$�	���1�
�9��U�
����9��J�J�q�M���
�
�a�S��!��:��#	�&
���3��B�
�b�'�K��K�(�*���Z�
��
�
��C�5�=�j�\�J � +�j� 8�9�:��=� 8��
�C9�
9��	
��Ir?c��|du|duk7ry|�|duxs|dk\S|�d|cxkxr|kScS||k\ryd|cxkxr|kScS)zcChecks if a given byte content range is valid for the given length.

    .. versionadded:: 0.7
    NFrr>)r�r�r�s   r@r�r�isj��	��
�4�4�<�(��	����~�,��1��,�	���E� �D� � � � �	�$����������r?)�datastructures)�http)T)rNzt.AnyrO�bool�returnrJ)rNrJrsrJ)r`�
str | Nonerazt.Mapping[str, t.Any]rsrJ)rhz$dict[str, t.Any] | t.Iterable[t.Any]rsrJ)r`rkrsrJ)rNrJrsz	list[str])rNrJrszdict[str, str | None])rNrtrsztuple[str, dict[str, str]])rNrtrsr�)rNrtr�ztype[_TAnyAccept]rsr�r�)rNrtr�ztype[_TAnyAccept] | Nonersr�)rNrtr��9t.Callable[[ds.cache_control._CacheControl], None] | Nonerszds.RequestCacheControl)N.)rNrtr�rur�r�rsr�r�)rNrtr�rur�ztype[_TAnyCC] | Nonersr�)rNrtr��3t.Callable[[ds.ContentSecurityPolicy], None] | Nonersrk)rNrtr�rvr�r�rsr�)rNrtr�rvr�ztype[_TAnyCSP] | Nonersr�)rNrtr�z't.Callable[[ds.HeaderSet], None] | Nonerszds.HeaderSet)rNrtrsz
ds.IfRange)rNrtr�rrrszds.Range | None)rNrtr�z*t.Callable[[ds.ContentRange], None] | Nonerszds.ContentRange | None)F)r�rJr�rrrsrJ)r�rJrsztuple[str, bool])r�rLrsztuple[None, None])r�rtrsz$tuple[str, bool] | tuple[None, None])rNrtrszds.ETags)r��bytesrsrJ)rNrtrszdatetime | None)rz2datetime | date | int | float | struct_time | NonersrJ)rNrtrsztimedelta | None)r�timedelta | int | Nonersrt)NNNT)r(rr�rtr�zbytes | Noner$zdatetime | str | Noner%rrrsrr))rr)r+�"ds.Headers | list[tuple[str, str]]r,zt.Iterable[str]rsrL)r+ryrsrL)r`rJrsrr)r`zWSGIEnvironment | str | Noner�z#type[ds.MultiDict[str, str]] | Nonerszds.MultiDict[str, str])r�NNr�NFFTi�NF)rcrJrNrJr`rxrz#str | datetime | int | float | NonerartrbrtrcrrrdrrrerrrfrrgrtrhrrrsrJ)r��
int | Noner�rzr�rzrsrr)_�
__future__r�email.utilsr�re�typingr�r^rrrrr	�enumr
�hashlibrrr
�urllib.parserr�urllib.requestrrt�	_internalrr�
TYPE_CHECKING�_typeshed.wsgir�	frozensetrK�compiler�r2r4�HTTP_STATUS_CODESr6rBrRrXrdrjrrrwr��ASCIIr�r��VERBOSEr�r�r�r��TypeVarr��overloadr�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrr'r-r0r*r/r;�Ar[r\rO�update�rangernr�r�rpr��sansiorqr&r>r?r@�<module>r�s;	��"��	������������� �@�!�!��?�?�.��S����2�:�:�?�@����
�� �	���A���A��	�A���A���	A�
��A���
A���A��	(�A���A���A��	�A���A��	�A���A��	�A� �	�!A�"��#A�$��%A�&��'A�(��)A�*��+A�,�	�-A�.�	�/A�0��1A�2��3A�4�	�5A�6��7A�8��9A�:�	�;A�<�	�=A�>�	(�?A�@�	�AA�B��CA�D��EA�F�	�GA�H�	�IA�J�	#�KA�L�	�MA�N�	!�OA�P�	*�QA�R�	�SA�T��UA�V�	�WA�X�	�YA�Z��[A�\�	�]A�^��_A�`�	�aA�b�	 �cA�d�	�eA�f�	*�gA�h
�	(�	 �	�	�	�	�	%�	"�	�	�	�	(�AA��H"�4�"� �4� �!�H�$+�\-�`
H��6G�V�B�J�J�9����J��&�B�J�J�'>�b�h�h�O���B�J�J��
�H�H�r�z�z��
���2�:�:�k�2�8�8�4��X�v�b�j�j�)�2�8�8�4���a�i�i�
�[�9�����<��<����V��V�8<�2��2�4�2��2�j�!�)�)�I�%E�
F�����LP�!��!�H�!��!��!����LP�����H��
��
�	���LP� $�4��4�H�4�
�4�
�	4�<�1�9�9�Z�'A�B�����FJ�#��#�B�#��#��#����FJ�����B��
���	���FJ�!%�!!��!!�B�!!�
�!!��	!!�L:>�=��=�6�=��=�B.�&/3�8#��8#�'+�8#��8#�z=A�3��3�9�3��3�l����4��4����6��6��
��)��2"�:"��<EI�:�A�:��:�@�,�,��+/� �#�
�#�
�#��#�)�	#�
�#�
�
#�P ?��
/��
��
��0
�-�1�04�"=�(�"=�	,�"=��"=�J!�b�j�j�!G����N���2�:�:�<�b�d�d�C��!�'�2������
6�u�T�{�
6�U�
6�U�4��%5�
6����&*�37���������X�	�X��X�$�X�1�	X�
�X�
�
X�
�X��X��X��X��X��X�	�X�v���'��1;��	��&#�(r?

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists