
    ch                        % S SK Jr  S SKrS SKJrJr  S SKJr  S SKJ	r	  \S   r
S\S'   \R                  " S	5      rS
\S'   SS jrSS jr S     SS jjrSS jrg)    )annotationsN)FinalLiteral)urlparse)	TypeAlias)httphttpsmailtodatar   	UrlSchemazt(?P<base>https:\/\/?(gist\.)?github.com\/)(?P<account>([\w\.]+\/){1,2})(?P<blob_or_raw>(blob|raw))?(?P<suffix>(.+)?)r   _GITBLOB_REc                    [         R                  U 5      nU(       a;  UR                  5       nUS   S:X  a  SR                  " S0 UD6$ US   S:X  a  U $ U S-   $ U $ )zCheck url to see if it describes a GitHub Gist "blob" URL.

If so, returns a new URL to get the "raw" script.
If not, returns URL unchanged.
blob_or_rawblobz{base}{account}raw{suffix}rawz/raw )r   match	groupdictformat)urlr   mdicts      eC:\Users\julio\OneDrive\Documentos\Trabajo\Ideas Frescas\venv\Lib\site-packages\streamlit/url_util.pyprocess_gitblob_urlr   #   si     c"E!6)/66??? 5(J V|J    c                F    SU ;  a  SU  3n [        U 5      nUR                  $ )z8Return the hostname of a URL (with or without protocol).z://zhttp://)r   hostname)r   parseds     r   get_hostnamer   <   s*     Cuoc]F??r   c                    [        [        U 5      5      nUR                  U;  a  gUR                  S;   a  [        UR                  5      $ UR                  S;   a  [        UR
                  5      $  g! [         a     gf = f)zCheck if a string looks like an URL.

This doesn't check if the URL is actually valid or reachable.

Parameters
----------
url : str
    The URL to check.

allowed_schemas : Tuple[str]
    The allowed URL schemas. Default is ("http", "https").
Fr   r	   )r
   r   )r   strschemeboolnetlocpath
ValueError)r   allowed_schemasresults      r   is_urlr)   G   sz     #c(#==/==--&&==..$$ /
   s   $A3 $A3 $A3 3
B ?B c                l    U R                  S5      n U (       a  SU -   n UR                  S5      nU  SU 3$ )zMake a URL from a base URL and a path.

Parameters
----------
base_url : str
    The base URL.
path : str
    The path to append to the base URL.

Returns
-------
str
    The resulting URL.
/)striplstrip)base_urlr%   s     r   make_url_pathr/   f   s=     ~~c"H>;;sDZqr   )r   r!   returnr!   )r   r!   r0   z
str | None)r    )r   r!   r'   ztuple[UrlSchema, ...]r0   r#   )r.   r!   r%   r!   r0   r!   )
__future__r   retypingr   r   urllib.parser   typing_extensionsr   r   __annotations__compiler   r   r   r)   r/   r   r   r   <module>r8      su    # 	 ! ! '@A	9 A ZZU 2 .?	* 
> r   