Ë
    úmxiŠ  ã                  óh   — d Z ddlmZ ddlZddlZddlmZ ddlmZm	Z	 dd„Z
dd„Zdd„Zdd	„Zdd
„Zy)zUtilities related to the CLI.é    )ÚannotationsN)ÚAny)Úenv_utilÚerrorsc                ól   — 	 ddl } |j                  | fi |¤Ž y# t        $ r t        | d¬«       Y yw xY w)z¶Print a message to the terminal using click if available, else print
    using the built-in print function.

    You can provide any keyword arguments that click.secho supports.
    r   NT)Úflush)ÚclickÚsechoÚImportErrorÚprint©ÚmessageÚkwargsr	   s      úI/home/htdocs/ttos/venv/lib/python3.12/site-packages/streamlit/cli_util.pyÚprint_to_clir      s6   € ð#Ûàˆ�‰�GÑ&˜vÓ&øÜò #Üˆg˜T×"ð#ús   ‚ š3²3c                óT   — 	 ddl } |j                  | fi |¤ŽS # t        $ r | cY S w xY w)z›Style a message using click if available, else return the message
    unchanged.

    You can provide any keyword arguments that click.style supports.
    r   N)r	   Ústyler   r   s      r   Ústyle_for_clir   (   s4   € ðÛàˆu�{‰{˜7Ñ- fÑ-Ð-øÜò ØŠðús   ‚ ™'¦'c                ó.   — dd l }|j                  | «       y )Nr   )Ú
webbrowserÚopen)Úurlr   s     r   Ú_open_browser_with_webbrowserr   7   s   € Ûà‡O�O�CÕó    c                ó¶   — | |g}t        t        j                  d«      5 }t        j                  ||t        j
                  ¬«       d d d «       y # 1 sw Y   y xY w)NÚw)ÚstdoutÚstderr)r   ÚosÚdevnullÚ
subprocessÚPopenÚSTDOUT)Úcommandr   Úcmd_liner    s       r   Ú_open_browser_with_commandr&   =   sL   € Ø˜ˆ~€HÜ	Œb�j‰j˜#Ó	ð M 'Ü×Ñ˜¨'¼*×:KÑ:KÕL÷M÷ Mñ Mús   Ÿ'AÁAc                óF  — t         j                  rt        | «       yt         j                  r.t        j                  d«      rt        d| «       yt        | «       yt         j                  rt        d| «       yddl}t        j                  d|j                  «       › d�«      ‚)a¦  Open a web browser pointing to a given URL.

    We use this function instead of Python's `webbrowser` module because this
    way we can capture stdout/stderr to avoid polluting the terminal with the
    browser's messages. For example, Chrome always prints things like "Created
    new window in existing browser session", and those get on the user's way.

    url : str
        The URL. Must include the protocol.

    Nzxdg-openr   r   z!Cannot open browser in platform "ú")r   Ú
IS_WINDOWSr   ÚIS_LINUX_OR_BSDÚis_executable_in_pathr&   Ú	IS_DARWINÚplatformr   ÚErrorÚsystem)r   r-   s     r   Úopen_browserr0   C   s�   € ô0 ×ÒÜ% cÔ*ØÜ×ÒÜ×)Ñ)¨*Ô5Ü& z°3Ô7ØÜ% cÔ*ØÜ×ÒÜ" 6¨3Ô/Øãä
�,‰,Ð:¸8¿?¹?Ó;LÐ:MÈQÐOÓ
PÐPr   )r   Ústrr   r   ÚreturnÚNone)r   r1   r   r   r2   r1   )r   r1   r2   r3   )r$   r1   r   r1   r2   r3   )Ú__doc__Ú
__future__r   r   r!   Útypingr   Ú	streamlitr   r   r   r   r   r&   r0   © r   r   ú<module>r9      s4   ðñ $å "ã 	Û Ý ç &ó#óóóMô'Qr   