
    ,he;                       d dl mZ d dlZd dlZddlmZ ddlmZ dZ ej                  d      Z
 ej                  d	      Z ej                  d
ej                  ej                  z        ZdZdZdj#                  ee      ZeedZg dZdZddj-                  eD  cg c]  } | ez  	 c}       z   dz   Zdez   dz   Zdez   dz   ez   dz   ZdZ ej                  d      Z ej                  dez   dz         Z ej                  dez   dz         Z ej                  dez   dz         Z ej                  dedd z   dz         Z ej                  dez   dz         Z d ededed!Z! ej                  e!ej                  ej                  z        Z" e#d"      Z$ e#d#      Z%e$e%z  d$hz  Z&e&d%d&hz  Z'e'd'hz  xZ(Z) G d( d) ejT                  d)d*ejV                  e,   fd+ejV                  e,   fd,ejV                  e,   fd-ejV                  e-   fd.ejV                  e,   fd/ejV                  e,   fd0ejV                  e,   fg            Z.ej^                  	 	 	 	 	 	 d;d1       Z0ej^                  	 	 	 	 	 	 d<d2       Z0	 	 	 	 	 	 d=d3Z0d>d4Z1ej^                  d?d5       Z2ej^                  d@d6       Z2dAd7Z2dBd8Z3dCd9Z4dDd:Z5yc c} w )E    )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(?:|)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                       e Zd ZdZ	 	 	 	 	 	 	 d		 	 	 	 	 	 	 	 	 	 	 	 	 d
 fdZedd       Zedd       Zedd       Zedd       Z	edd       Z
ddZ xZ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.
    c           
         |r|j                  d      sd|z   }||j                         }t        |   | |||||||      S )Nr   )
startswithlowersuper__new__)	clsschemeauthhostportpathqueryfragment	__class__s	           R/var/www/html/Resume-Scraper/venv/lib/python3.12/site-packages/urllib3/util/url.pyr   zUrl.__new__d   sJ     ,:D\\^FwsFD$dE8TT    c                    | j                   S )z@For backwards-compatibility with urlparse. We're nice like that.)r!   selfs    r'   hostnamezUrl.hostnamet   s     yyr(   c                b    | j                   xs d}| j                  |d| j                  z   z  }|S )z)Absolute path including the query string.r   r   )r#   r$   )r+   uris     r'   request_urizUrl.request_uriy   s4     ii3::!3##C
r(   c                L    | 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
        r   )r    netloc)r+   userinfor1   s      r'   	authorityzUrl.authority   s6     99>X-MZq))r(   c                    | j                   y| j                  r| j                    d| j                   S | j                   S )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"   r*   s    r'   r1   z
Url.netloc   s;     9999ii[$))--yyr(   c                    | \  }}}}}}}d}|||dz   z  }|||dz   z  }|||z  }||dt        |      z   z  }|||z  }||d|z   z  }||d|z   z  }|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"
         z://r   r   r   #)str)	r+   r   r    r!   r"   r#   r$   r%   urls	            r'   r9   zUrl.url   s    6 ;?7dD$x 6E>!C4#:C4KC3T?"C4KC3;C3>!C
r(   c                    | j                   S N)r9   r*   s    r'   __str__zUrl.__str__   s    xxr(   )NNNNNNN)r   
str | Noner    r=   r!   r=   r"   z
int | Noner#   r=   r$   r=   r%   r=   )returnr=   )r>   r8   )__name__
__module____qualname____doc__r   propertyr,   r/   r3   r1   r9   r<   __classcell__)r&   s   @r'   r   r   P   s     " #UU U 	U
 U U U U      * *   - -^r(   r   r   r    r!   r"   r#   r$   r%   c                     y r;    	componentallowed_charss     r'   _encode_invalid_charsrJ           r(   c                     y r;   rF   rG   s     r'   rJ   rJ      rK   r(   c                   | | S t        |       } t        j                  d |       \  } }| j                  dd      }||j	                  d      k(  }t               }t        dt        |            D ]  }|||dz    }t        |      }|r|dk(  s|dk  r|j                         |v r||z  }:|j                  dt        |      d	d j                         j                  d	      j                         z           |j                         S )
zfPercent-encodes a URI component without reapplying
    onto an already percent-encoded component.
    Nc                @    | j                  d      j                         S )Nr   )groupupper)matchs    r'   <lambda>z'_encode_invalid_chars.<locals>.<lambda>   s    ekk!n**, r(   zutf-8surrogatepass   %r   r      r   )r   _PERCENT_REsubnencodecount	bytearrayrangelenorddecodeextendr
   zfillrP   )	rH   rI   percent_encodings	uri_bytesis_percent_encodedencoded_componentibytebyte_ords	            r'   rJ   rJ      s    y!I
 $/#3#3,i$ I    /:I*iood.CC!1c)n% 	WQU#t944<sNt{{}=%  Xqr):)A)A)C)I)I!)L)R)R)T!UV	W ##%%r(   c                P   | j                  d      }g }|D ]2  }|dk(  r	|dk7  r|j                  |        |s#|j                          4 | j                  d      r|r|d   r|j	                  dd       | j                  d      r|j                  d       dj                  |      S )Nr   .z..r   r6   )z/.z/..)splitappendpopr   insertendswithjoin)r#   segmentsoutputsegments       r'   _remove_path_dot_segmentsrs     s    zz#HF 
c>d?MM'" JJL
 sVvaya }}]#b88Fr(   c                     y r;   rF   r!   r   s     r'   _normalize_hostrv   %  s    =@r(   c                     y r;   rF   ru   s     r'   rv   rv   )  s    ;>r(   c           
        | r|t         v rt        j                  |       }|rt        j	                  |       }|rg|j                  d      \  }}| || }|j                  d      r|dk7  r|dd  }n|dd  }t        |t              }| d | j                          d| | |d   S | j                         S t        j                  |       sAt        dj                  | j                  d      D cg c]  }t        |       c}      d      S | S c c}w )Nr   z%25   %   .ri   ascii)_NORMALIZABLE_SCHEMES_IPV6_ADDRZ_RErQ   _ZONE_ID_REsearchspanr   rJ   _UNRESERVED_CHARSr   _IPV4_REr   ro   rj   _idna_encode)r!   r   is_ipv6rQ   startendzone_idlabels           r'   rv   rv   -  s   **$**40G $**40!&AJE3"5oG))%0W5E")!"+")!"+3G=NOG"6El00231WId34j\JJ::<'^^D)II

3Pu|E2PQ  K Qs   )D	c                (   | j                         s(	 dd l}	 |j	                  | j                         dd      S | j                         j	                  d      S # t        $ r t        d      d w xY w# |j                  $ r t        d|  d      d w xY w)Nr   z-Unable to parse URL without the 'idna' moduleT)strict
std3_ruleszName 'z' is not a valid IDNA labelr|   )isasciiidnaImportErrorr   rX   r   	IDNAError)namer   s     r'   r   r   J  s    <<>		;;tzz|DT;JJ ::<w''  	$?	 ~~ 	$9:	s   A !A1 A.1 Bc                    t         j                  |       }|st        | d      |j                         \  }}t	        |t
              }|t	        |t              }|d|z   z  }|S )zPercent-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 URIr   )
_TARGET_RErQ   r   groupsrJ   _PATH_CHARS_QUERY_CHARS)targetrQ   r#   r$   encoded_targets        r'   _encode_targetr   ]  sk     V$E F:-H!IJJ,,.KD%*4=N%e\:#+%r(   c           	     T   | s
t               S | }t        j                  |       sd| z   } 	 t        j	                  |       j                         \  }}}}}|du xs |j                         t        v }|r|j                         }|r]|j                  d      \  }}	}
|xs d}t        j	                  |
      j                         \  }}|r|rt        |t              }|dk(  r	d}nd\  }}}|-t        |      }d|cxk  rdk  st        |        t        |       d}t        ||      }|r|rt        |      }t        |t               }|r|rt        |t"              }|r|rt        |t$              }|s	||d}nd}t        |||||||      S # t&        t(        f$ r}t        |      |d}~ww xY w)	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//Nr   r6   )NNNr   i  )r   r    r!   r"   r#   r$   r%   )r   
_SCHEME_REr   _URI_RErQ   r   r   r}   
rpartition_HOST_PORT_RErJ   _USERINFO_CHARSintr   rv   rs   r   r   _FRAGMENT_CHARS
ValueErrorAttributeError)r9   
source_urlr   r3   r#   r$   r%   normalize_urir    _	host_portr!   r"   port_intes                  r'   	parse_urlr   o  s   8 uJS!Sj$43:==3E3L3L3N0	4$Q&,,.<Q*Q\\^F!*!5!5c!:D!Y<4D&,,Y7>>@JD$,T?Crz/D$4yH*U*(-- +(--HtV,T,T2D({;DU)%>EX,XGH  4DD  ' 4 ,!34s   E F F'F""F')rH   r8   rI   typing.Container[str]r>   r8   )rH   NonerI   r   r>   r   )rH   r=   rI   r   r>   r=   )r#   r8   r>   r8   )r!   r   r   r=   r>   r   )r!   r8   r   r=   r>   r8   )r!   r=   r   r=   r>   r=   )r   r8   r>   bytes)r   r8   r>   r8   )r9   r8   r>   r   )6
__future__r   retyping
exceptionsr   utilr   r}   compilerV   r   UNICODEDOTALLr   	_IPV4_PAT_HEX_PATformat	_LS32_PAT_subs_variations_UNRESERVED_PATro   	_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Optionalr8   r   r   overloadrJ   rs   rv   r   r   r   )xs   0r'   <module>r      sp   " 	  +  0  bjj+,RZZ9:

"**
 JJ -	$++y+I	),* YCHH=Aa%i=>>D	03HH)#f,|;gE4RZZ<=
2::cIo+,2::cIo+,C/1C78%2::cOAb,A&AC&GH bjj|+g56 
 

>2::		+ABH  }% #&66#>c
*!,u!4 4BFvs+,V__S)*V__S)*V__S)*V__S)*fooc*+-.	
BJ #8  $9	 !&!&*?!&!&H<  @  @  >  >:(&$fw	 >s   J;
