
    q"h7                        S SK Jr  S SKrS SKJr  SSKJr  SSKJr  / SQr	Sr
\R                  " S	5      r\R                  " S
5      r\R                  " S\R                  \R                  -  5      rSrSrSR'                  \\S9r\\S.r/ SQrSrSSR1                  \ V s/ s H  o \-  PM	     sn 5      -   S-   rS\-   S-   rS\-   S-   \-   S-   rSr\R                  " S5      r\R                  " S\-   S-   5      r\R                  " S\-   S-   5      r\R                  " S\-   S-   5      r \R                  " S\SS -   S-   5      r!\R                  " S\-   S -   5      r"S!\< S\< S\< S"3r#\R                  " \#\R                  \R                  -  5      r$\%" S#5      r&\%" S$5      r'\&\'-  S%1-  r(\(S&S'1-  r)\)S(1-  =r*r+ " S) S*\" S*\	5      5      r,S+ r-S3S, jr.S- r/S. r0S/ r1S0 r2S1 r3S2 r4gs  sn f )4    )absolute_importN)
namedtuple   )LocationParseError)sixschemeauthhostportpathqueryfragment)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(?:|)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                      ^  \ rS rSrSrSr       S
U 4S jjr\S 5       r\S 5       r	\S 5       r
\S 5       rS	 rSrU =r$ )UrlR   z
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.
 c           
         > U(       a  UR                  S5      (       d  SU-   nUb  UR                  5       n[        [        U ]  XX#XEXg5      $ )Nr   )
startswithlowersuperr    __new__)	clsr	   r
   r   r   r   r   r   	__class__s	           N/var/www/html/env/lib/python3.13/site-packages/pip/_vendor/urllib3/util/url.pyr'   Url.__new__[   sM     ,,:D\\^FS#&T
 	
    c                     U R                   $ )z@For backwards-compatibility with urlparse. We're nice like that.)r   selfs    r*   hostnameUrl.hostnamem   s     yyr,   c                 n    U R                   =(       d    SnU R                  b  USU R                  -   -  nU$ )z)Absolute path including the query string.r   r   )r   r   )r/   uris     r*   request_uriUrl.request_urir   s4     ii3::!3##C
r,   c                 r    U R                   (       a  SU R                  U R                   4-  $ U R                  $ )z(Network location including host and portz%s:%d)r   r   r.   s    r*   netloc
Url.netloc|   s-     99dii333yyr,   c                     U u  pp4pVnSnUb  XS-   -  nUb  XS-   -  nUb  X-  nUb  US[        U5      -   -  nUb  X-  nUb  USU-   -  nUb  USU-   -  nU$ )a   
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: ::

    >>> U = parse_url('http://google.com/mail/')
    >>> U.url
    'http://google.com/mail/'
    >>> Url('http', 'username:password', 'host.com', 80,
    ... '/path', 'query', 'fragment').url
    'http://username:password@host.com:80/path?query#fragment'
 z://r   r   r   #)str)	r/   r	   r
   r   r   r   r   r   urls	            r*   r=   Url.url   s    & ;?7d$x F?"C$;CKC4#d)##CKC4%<C4(?"C
r,   c                     U R                   $ N)r=   r.   s    r*   __str__Url.__str__   s    xxr,   )NNNNNNN)__name__
__module____qualname____firstlineno____doc__	__slots__r'   propertyr0   r4   r7   r=   rA   __static_attributes____classcell__)r)   s   @r*   r    r    R   s     I 
$       % %N r,   r    c                     SnSnU H*  nU R                  U5      nUS:  a  M  Ub  XR:  d  M&  UnUnM,     Ub  US:  a  U SS4$ U SU XS-   S U4$ )a  
.. deprecated:: 1.25

Given a string and an iterable of delimiters, split on the first found
delimiter. Return two split parts and the matched delimiter.

If not found, then the first part is the full input string.

Example::

    >>> split_first('foo/bar?baz', '?/=')
    ('foo', 'bar?baz', '/')
    >>> split_first('foo/bar?baz', '123')
    ('foo/bar?baz', '', None)

Scales linearly with number of delims. Not ideal for large number of delims.
Nr   r:      )find)sdelimsmin_idx	min_delimdidxs         r*   split_firstrU      sw    $ GIffQi7?cmGI  'A+"d{Xg;A+-()33r,   c                 6   U c  U $ [         R                  " U 5      n [        R                  S U 5      u  pU R	                  SS5      nX4R                  S5      :H  n[        5       n[        S[        U5      5       H  nXGUS-    n[        U5      n	U(       a  US:X  d  U	S:  a  UR                  5       U;   a  Xh-  nMB  UR                  S[        U	5      S	S R	                  5       R                  S	5      R                  5       -   5        M     UR                  U5      $ )
z^Percent-encodes a URI component without reapplying
onto an already percent-encoded component.
Nc                 @    U R                  S5      R                  5       $ )Nr   )groupupper)matchs    r*   <lambda>'_encode_invalid_chars.<locals>.<lambda>   s    ekk!n**,r,   utf-8surrogatepass   %r   rM      r   )r   ensure_text
PERCENT_REsubnencodecount	bytearrayrangelenorddecodeextendr   zfillrY   )
	componentallowed_charsencodingpercent_encodings	uri_bytesis_percent_encodedencoded_componentibytebyte_ords
             r*   _encode_invalid_charsrw      s    	*I
 $.??,i$ I   /:I*ood.CC!1c)n%QU#t944<sNt{{}=%  Xqr):)A)A)C)I)I!)L)R)R)T!UV & ##H--r,   c                    U R                  S5      n/ nU H=  nUS:X  a  M  US:w  a  UR                  U5        M$  U(       d  M-  UR                  5         M?     U R                  S5      (       a#  U(       a
  US   (       a  UR	                  SS5        U R                  S5      (       a  UR                  S5        SR                  U5      $ )Nr   .z..r   r:   )z/.z/..)splitappendpopr$   insertendswithjoin)r   segmentsoutputsegments       r*   _remove_path_dot_segmentsr      s    zz#HFc>_MM'" VJJL  sVvaya }}]##b88Fr,   c           
         U (       Ga\  [        U [        R                  5      (       a  [        R                  " U 5      n U[        ;   Ga  [
        R                  U 5      nU(       a  [        R                  U 5      nU(       al  UR                  S5      u  pEXU nUR                  S5      (       a  US:w  a  USS  nOUSS  nS[        U[        5      -   nU S U R                  5       U-   XS  -   $ U R                  5       $ [        R                  U 5      (       dN  [        R                  " SR                  U R!                  S5       Vs/ s H  n[#        U5      PM     sn5      5      $ U $ s  snf )NrM   z%25   %   .ry   )
isinstancer   binary_type
ensure_strNORMALIZABLE_SCHEMESIPV6_ADDRZ_RErZ   
ZONE_ID_REsearchspanr$   rw   UNRESERVED_CHARSr%   IPV4_REr   rz   _idna_encode)r   r	   is_ipv6rZ   startendzone_idlabels           r*   _normalize_hostr     s2   dCOO,,>>$'D))#))$/G #))$/!&AJE"oG))%00W5E")!"+")!"+!$9'CS$TTG<--/'9DJFF::<']]4((~~II

3Pu|E2PQ  K Qs   E'c                    U (       a>  [        S U  5       5      (       a'   SSKJn   WR                  U R                  5       SSS9$ U R                  5       R                  S5      $ ! [         a#    [        R
                  " [        S5      S 5         Nkf = f! WR                   a&    [        R
                  " [        SU -  5      S 5         Nf = f)	Nc              3   >   #    U  H  n[        U5      S :  v   M     g7f)r`   N)ri   ).0xs     r*   	<genexpr>_idna_encode.<locals>.<genexpr>2  s     04aCFcM4s   r   )idnaz-Unable to parse URL without the 'idna' moduleT)strict
std3_rulesz#Name '%s' is not a valid IDNA labelascii)
anypip._vendorr   ImportErrorr   
raise_fromr   rd   r%   	IDNAError)namer   s     r*   r   r   1  s    04000	(	;;tzz|DT;JJ
 ::<w''  	NN"#RS	 ~~ 	NN"#ID#PQSW	s"   A% B %*BB3C
Cc                     [         R                  U 5      R                  5       u  p[        U[        5      n [        U[
        5      nUb  U SU-   -  n U $ )zHPercent-encodes a request target so that there are no invalid charactersr   )	TARGET_RErZ   groupsrw   
PATH_CHARSQUERY_CHARS)targetr   r   s      r*   _encode_targetr   C  sL    //&)002KD"44F!%5E#+Mr,   c                   ^ U (       d
  [        5       $ U n[        R                  U 5      (       d  SU -   n  [        R	                  U 5      R                  5       u  p#pEnUSL =(       d    UR                  5       [        ;   nU(       a  UR                  5       nU(       ak  UR                  S5      u  pn
U=(       d    Sn[        R	                  U
5      R                  5       u  pU(       a  U(       a  [        U[        5      nUS:X  a  SnOSu  pnUb%  [        U5      nSUs=::  a  S::  d  O  [        U 5      e[        X5      nU(       a"  U(       a  [        U5      n[        U[         5      nU(       a  U(       a  [        U["        5      nU(       a  U(       a  [        U[$        5      nU(       d  Uc  Ub  SnOSn[/        U [*        R0                  5      (       a  [*        R2                  mO[*        R4                  mU4S jn[        U" U5      U" U5      U" U5      UU" U5      U" U5      U" U5      S	9$ ! [&        [(        4 a#    [*        R,                  " [        U5      S5      s $ f = f)
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:`urlparse`.

Example::

    >>> parse_url('http://google.com/mail/')
    Url(scheme='http', host='google.com', port=None, path='/mail/', ...)
    >>> parse_url('google.com:80')
    Url(scheme=None, host='google.com', port=80, path=None, ...)
    >>> parse_url('/foo?bar')
    Url(scheme=None, host=None, port=None, path='/foo', query='bar', ...)
z//Nr   r:   )NNNr   i  c                    > U c  U $ T" U 5      $ r@   r"   )r   ensure_funcs    r*   ensure_typeparse_url.<locals>.ensure_type  s    Iq1;q>1r,   r   )r    	SCHEME_REr   URI_RErZ   r   r%   r   
rpartition_HOST_PORT_RErw   USERINFO_CHARSintr   r   r   r   r   FRAGMENT_CHARS
ValueErrorAttributeErrorr   r   r   	text_typera   r   )r=   
source_urlr	   	authorityr   r   r   normalize_urir
   _	host_portr   r   r   r   s                 @r*   	parse_urlr   M  s   , uJC  Sj"D39<<3D3K3K3M04$P&,,.<P*P\\^F!*!5!5c!:DY<4D&,,Y7>>@JD,T>Brz/Dt9D&&(--t,T,T2D(z:DU)%=EX,X~FH  4DD #s}}%%oonn2 6"% X& / ' D~~0<dCCDs   E/H/ /0I"!I"c                 p    [        U 5      nUR                  =(       d    SUR                  UR                  4$ )z,
Deprecated. Use :func:`parse_url` instead.
r   )r   r	   r0   r   )r=   ps     r*   get_hostr     s+     	#A88vqzz16611r,   )r]   )5
__future__r   recollectionsr   
exceptionsr   packagesr   	url_attrsr   compilerb   r   UNICODEDOTALLr   IPV4_PATHEX_PATformatLS32_PAT_subs_variationsUNRESERVED_PATr   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   r    rU   rw   r   r   r   r   r   r   )r   s   0r*   <module>r      sG   & 	 " + K	 /  ZZ*+
JJ89		
 JJ
 ,
#**wX*F** X388<1Y<==C.1FF!F*[87B3JJ;<	
**S8^c)
*
**S8^c)
*

3/#56**S>!B+?%?#%EF ZZk)G34
 
 

>2::		+ABH  m$!O3se;sCj(
)SE1 1nZ*UI
& Zz 4F.D<>($^B2q =s    G-
