� ���ge;����ddlmZddlZddlZddlmZddlmZdZej d��Z ej d ��Z ej d ej ej z��Zd Zd Zd �ee���Zeed�Zgd�ZdZdd�d�eD����zdzZdezdzZdezdzezdzZdZej d��Zej dezdz��Zej dezdz��Zej dezdz��Zej dedd�zdz��Zej dezd z��Z d!e�de�de�d"�Z!ej e!ej ej z��Z"e#d#��Z$e#d$��Z%e$e%zd%hzZ&e&d&d'hzZ'e'd(hzxZ(Z)Gd)�d*ej*d*d+ej+e,fd,ej+e,fd-ej+e,fd.ej+e-fd/ej+e,fd0ej+e,fd1ej+e,fg����Z.ej/dGd7���Z0ej/dHd9���Z0dId;�Z0dJd<�Z1ej/dKd=���Z2ej/dLd>���Z2dMd?�Z2dNdB�Z3dOdD�Z4dPdF�Z5dS)Q�)� annotationsN�)�LocationParseError�)�to_str)�http�httpsNz%[a-fA-F0-9]{2}z^(?:[a-zA-Z][a-zA-Z0-9+-]*:|/)zS^(?:([a-zA-Z][a-zA-Z0-9+.-]*):)?(?://([^\\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$z(?:[0-9]{1,3}\.){3}[0-9]{1,3}z[0-9A-Fa-f]{1,4}z(?:{hex}:{hex}|{ipv4}))�hex�ipv4)r �ls32) z(?:%(hex)s:){6}%(ls32)sz::(?:%(hex)s:){5}%(ls32)sz%(?:%(hex)s)?::(?:%(hex)s:){4}%(ls32)sz2(?:(?:%(hex)s:)?%(hex)s)?::(?:%(hex)s:){3}%(ls32)sz6(?:(?:%(hex)s:){0,2}%(hex)s)?::(?:%(hex)s:){2}%(ls32)sz/(?:(?:%(hex)s:){0,3}%(hex)s)?::%(hex)s:%(ls32)sz'(?:(?:%(hex)s:){0,4}%(hex)s)?::%(ls32)sz&(?:(?:%(hex)s:){0,5}%(hex)s)?::%(hex)sz(?:(?:%(hex)s:){0,6}%(hex)s)?::zCABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789._\-~z(?:�|c�"�g|] }|tz�� S�)�_subs)�.0�xs �`/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/urllib3/util/url.py� <listcomp>r4s��=�=�=�A�a�%�i�=�=�=��)z (?:%25|%)(?:[z]|%[a-fA-F0-9]{2})+z\[z)?\]z!(?:[^\[\]%:/?#]|%[a-fA-F0-9]{2})*z!^(/[^?#]*)(?:\?([^#]*))?(?:#.*)?$�^�$������(z)\]$z^(z)(?::0*?(|0|[1-9][0-9]{0,4}))?$zBABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789._-~z !$&'()*+,;=�:�@�/�?c���eZdZdZ dd�fd � Zedd���Zedd���Zedd���Zedd���Z edd���Z dd�Z �xZ S)�Urlz� Data structure for representing an HTTP URL. Used as a return value for :func:`parse_url`. Both the scheme and host are normalized as they are both case-insensitive according to RFC 3986. N�scheme� str | None�auth�host�port� int | None�path�query�fragmentc ���|r|�d��sd|z}|�|���}t���||||||||��S)Nr)� startswith�lower�super�__new__) �clsr!r#r$r%r'r(r)� __class__s �rr.z Url.__new__ds`��� � �����,�,� ���:�D� � ��\�\�^�^�F��w�w���s�F�D�$��d�E�8�T�T�Tr�returnc��|jS)z@For backwards-compatibility with urlparse. We're nice like that.)r$��selfs r�hostnamez Url.hostnamets ���y�r�strc�@�|jpd}|j� |d|jzz }|S)z)Absolute path including the query string.rNr)r'r()r4�uris r� request_urizUrl.request_uriys.���i��3�� �:� !� �3���#� #�C�� rc�8�|j}|j}|�|�|S|�d|��S)z� Authority component as defined in RFC 3986 3.2. This includes userinfo (auth), host and port. i.e. userinfo@host:port Nr)r#�netloc)r4�userinfor;s r� authorityz Url.authority�s5���9����� �>�X�-��M��)�)��)�)� )rc�R�|j�dS|jr|j�d|j��S|jS)z� Network location including host and port. If you need the equivalent of urllib.parse's ``netloc``, use the ``authority`` property instead. Nr)r$r%r3s rr;z Url.netloc�s;�� �9� ��4� �9� .��i�-�-�$�)�-�-� -��y�rc��|\}}}}}}}d}|�||dzz }|�||dzz }|�||z }|�|dt|��zz }|�||z }|�|d|zz }|�|d|zz }|S)a2 Convert self into a url This function should more or less round-trip with :func:`.parse_url`. The returned url may not be exactly the same as the url inputted to :func:`.parse_url`, but it should be equivalent by the RFC (e.g., urls with a blank port will have : removed). Example: .. code-block:: python import urllib3 U = urllib3.util.parse_url("https://google.com/mail/") print(U.url) # "https://google.com/mail/" print( urllib3.util.Url("https", "username:password", "host.com", 80, "/path", "query", "fragment" ).url ) # "https://username:password@host.com:80/path?query#fragment" �Nz://rrr�#)r6) r4r!r#r$r%r'r(r)�urls rrBzUrl.url�s���6;?�7���d�D�$��x��� � � �6�E�>� !�C� � � �4�#�:� �C� � � �4�K�C� � � �3��T���?� "�C� � � �4�K�C� � � �3��;� �C� � � �3��>� !�C�� rc��|jS�N)rBr3s r�__str__z Url.__str__�s ���x�r)NNNNNNN)r!r"r#r"r$r"r%r&r'r"r(r"r)r")r1r")r1r6) �__name__� __module__� __qualname__�__doc__r.�propertyr5r9r=r;rBrE� __classcell__)r0s@rr r Ps���������"����� �#�U�U�U�U�U�U�U� �����X�������X��� *� *� *��X� *�� � � ��X� ��-�-�-��X�-�^�������rr r!r#r$r%r'r(r)� componentr6� allowed_chars�typing.Container[str]r1c��dSrDr�rLrMs r�_encode_invalid_charsrQ�� ���Cr�Nonec��dSrDrrPs rrQrQ�rRrr"c��|�|St|��}t�d�|��\}}|�dd��}||�d��k}t ��}t dt|����D]�}|||dz�}t|��}|r|dks|dkr|� ��|vr||z }�H|� dt|��d d����� d ��� ��z����|� ��S) zfPercent-encodes a URI component without reapplying onto an already percent-encoded component. Nc�P�|�d�����S)Nr)�group�upper)�matchs r�<lambda>z'_encode_invalid_chars.<locals>.<lambda>�s��e�k�k�!�n�n�*�*�,�,�rzutf-8� surrogatepass�%rr�r)r� _PERCENT_RE�subn�encode�count� bytearray�range�len�ord�decode�extendr �zfillrX) rLrM�percent_encodings� uri_bytes�is_percent_encoded�encoded_component�i�byte�byte_ords rrQrQ�sT�� �����y�!�!�I� $/�#3�#3�,�,�i�$�$� �I� �� � ��/�:�:�I�*�i�o�o�d�.C�.C�C��!� � �� �1�c�)�n�n� %� %� W� W����Q��U��#���t�9�9�� � �4�4�<�<� �s�N�N�t�{�{�}�}� �=�=� �� %� � �� � ���X���q�r�r�):�)A�)A�)C�)C�)I�)I�!�)L�)L�)R�)R�)T�)T�!U�V�V�V�V� � #� #� %� %�%rc��|�d��}g}|D];}|dkr� |dkr|�|���%|r|����<|�d��r |r|dr|�dd��|�d��r|�d��d�|��S)Nr�.z..rr@)z/.z/..)�split�append�popr+�insert�endswith�join)r'�segments�output�segments r�_remove_path_dot_segmentsr{s����z�z�#���H� �F�� � �� �c�>�>� � �d�?�?� �M�M�'� "� "� "� "�� � �J�J�L�L�L�� ���s����V��v�a�y��� � �a����� �}�}�]�#�#��� � �b���� �8�8�F� � �rc��dSrDr�r$r!s r�_normalize_hostr~%s��=@�Src��dSrDrr}s rr~r~)s��;>�3rc��|�rB|tv�r8t�|��}|r�t�|��}|r�|�d��\}}|||�}|�d��r|dkr |dd�}n |dd�}t|t��}|d|�� ���d|�||d���S|� ��St�|��s@td� d�|� d��D����d��S|S) Nrz%25��%�.c�,�g|]}t|����Sr)� _idna_encode)r�labels rrz#_normalize_host.<locals>.<listcomp>Ds ��P�P�P�u�|�E�2�2�P�P�Prrq�ascii)�_NORMALIZABLE_SCHEMES�_IPV6_ADDRZ_RErY� _ZONE_ID_RE�search�spanr+rQ�_UNRESERVED_CHARSr,�_IPV4_RErrwrr)r$r!�is_ipv6rY�start�end�zone_ids rr~r~-sU�� �� �*� *� *�$�*�*�4�0�0�G�� �$�*�*�4�0�0��� (�!&���A���J�E�3�"�5��9�o�G��)�)�%�0�0�.�W��5E�5E�")�!�"�"�+���")�!�"�"�+��3�G�=N�O�O�G�"�6�E�6�l�0�0�2�2�J�J�W�J�d�3�4�4�j�J�J�J��:�:�<�<�'��^�^�D�)�)� ���I�I�P�P�� � �3���P�P�P�Q�Q����� �Kr�name�bytesc�Z�|���sq ddl}n#t$rtd��d�wxYw |�|���dd���S#|j$rtd|�d���d�wxYw|����d��S)Nrz-Unable to parse URL without the 'idna' moduleT)�strict� std3_ruleszName 'z' is not a valid IDNA labelr�)�isascii�idna� ImportErrorrr`r,� IDNAError)r�r�s rr�r�Js��� �<�<�>�>� � � �K�K�K�K��� � � �$�?���� � ����  ��;�;�t�z�z�|�|�D�T�;�J�J� J���~� � � �$�:��:�:�:���� � ���� �:�:�<�<� � �w� '� '�'s��6�)A$�$B�targetc���t�|��}|st|�d����|���\}}t |t ��}|�t |t ��}|d|zz }|S)z�Percent-encodes a request target so that there are no invalid characters Pre-condition for this function is that 'target' must start with '/'. If that is the case then _TARGET_RE will always produce a match. z is not a valid request URINr)� _TARGET_RErYr�groupsrQ� _PATH_CHARS� _QUERY_CHARS)r�rYr'r(�encoded_targets r�_encode_targetr�]s��� � � �V� $� $�E� �K� �F�!I�!I�!I�J�J�J��,�,�.�.�K�D�%�*�4��=�=�N� ��%�e�\�:�:���#��+�%�� �rrBc ���|st��S|}t�|��sd|z} t�|�����\}}}}}|dup|���tv}|r|���}|rn|�d��\}} } |pd}t�| �����\} } |r|rt|t��}| dkrd} nd\}} } | �.t| ��} d| cxkrdksnt|���nd} t| |��} |r&|r$t|��}t|t ��}|r|rt|t"��}|r|rt|t$��}n)#t&t(f$r}t|��|�d}~wwxYw|s |�|�d}nd}t||| | |||���S) a� Given a url, return a parsed :class:`.Url` namedtuple. Best-effort is performed to parse incomplete urls. Fields not provided will be None. This parser is RFC 3986 and RFC 6874 compliant. The parser logic and helper functions are based heavily on work done in the ``rfc3986`` module. :param str url: URL to parse into a :class:`.Url` namedtuple. Partly backwards-compatible with :mod:`urllib.parse`. Example: .. code-block:: python import urllib3 print( urllib3.util.parse_url('http://google.com/mail/')) # Url(scheme='http', host='google.com', port=None, path='/mail/', ...) print( urllib3.util.parse_url('google.com:80')) # Url(scheme=None, host='google.com', port=80, path=None, ...) print( urllib3.util.parse_url('/foo?bar')) # Url(scheme=None, host=None, port=None, path='/foo', query='bar', ...) z//Nrr@)NNNri��)r!r#r$r%r'r(r))r � _SCHEME_REr��_URI_RErYr�r,r�� rpartition� _HOST_PORT_RErQ�_USERINFO_CHARS�intrr~r{r�r��_FRAGMENT_CHARS� ValueError�AttributeError)rB� source_urlr!r=r'r(r)� normalize_urir#�_� host_portr$r%�port_int�es r� parse_urlr�osd��8 ���u�u� ��J� � � �S� !� !���S�j��$4�3:�=�=��3E�3E�3L�3L�3N�3N�0�� �4����$��Q�&�,�,�.�.�<Q�*Q� � � $��\�\�^�^�F� � 0�!*�!5�!5�c�!:�!:� �D�!�Y��<�4�D�&�,�,�Y�7�7�>�>�@�@�J�D�$�� D� � D�,�T�?�C�C���r�z�z����/� �D�$�� � ��4�y�y�H���*�*�*�*�U�*�*�*�*�(��-�-�-�+��H��t�V�,�,�� � <�T� <�,�T�2�2�D�(��{�;�;�D� � ?�U� ?�)�%��>�>�E� � H�X� H�,�X��G�G�H��� �� '�4�4�4� ��,�,�!�3�����4���� �� � �� 4��D�D��D� �� � � � ��� � � �s�E9F-�-G�>G�G)rLr6rMrNr1r6)rLrSrMrNr1rS)rLr"rMrNr1r")r'r6r1r6)r$rSr!r"r1rS)r$r6r!r"r1r6)r$r"r!r"r1r")r�r6r1r�)r�r6r1r6)rBr6r1r )6� __future__r�re�typing� exceptionsr�utilrr��compiler^r��UNICODE�DOTALLr�� _IPV4_PAT�_HEX_PAT�format� _LS32_PATr� _variations�_UNRESERVED_PATrw� _IPV6_PAT� _ZONE_ID_PAT�_IPV6_ADDRZ_PAT� _REG_NAME_PATr�r��_IPV6_REr��_BRACELESS_IPV6_ADDRZ_REr��_HOST_PORT_PATr��setr��_SUB_DELIM_CHARSr�r�r�r�� NamedTuple�Optionalr6r�r �overloadrQr{r~r�r�r�rrr�<module>r�s/��"�"�"�"�"�"� � � � � � � � �+�+�+�+�+�+�������0���b�j�+�,�,� � �R�Z�9� :� :� � �"�*�� �J����  � �� -� � �� $� +� +��y� +� I� I� ��)�,�,����� �*Y�� �C�H�H�=�=��=�=�=�>�>� >�� D� ���0�3H�H� ��)�#�f�,�|�;�g�E��4� � �R�Z�<� =� =� � �2�:�c�I�o��+� ,� ,�� �2�:�c�I�o��+� ,� ,�����C�/�1�C�7�8�8��%�2�:�c�O�A�b�D�,A�&A�C�&G�H�H���b�j��|�+�g�5�6�6� � ��M�M� �I�I��O�O��� �� �>�2�:�� �+A�B�B� ��C�H�����3�}�%�%��#�&6�6�#��>����c� �*� �!,��u�!4�4� ��B�B�B�B�B��F�� � �v��s�+� ,� �V�_�S�)� *� �V�_�S�)� *� �V�_�S�)� *� �V�_�S�)� *� �f�o�c�*� +� ����-� .� � � �B�B�B�J�������� �������� !&�!&�!&�!&�H����<��@�@�@���@���>�>�>���>�����:(�(�(�(�&����$f�f�f�f�f�fr
Memory