o
    h"                     @  s  U d dl mZ d dlZd dlZd dlZd dlZd dlmZ d dlm	Z	m
Z
mZ d dlmZ d dlm  mZ d dlmZmZ d dlmZ d dlmZ d d	lmZmZ d d
lmZ d dlmZ d dl m!Z!m"Z"m#Z#m$Z$m%Z% d dl&m'Z' d dl(m)Z) d dl*m+Z+m,Z, d dl-m.Z. d dl/m0Z0 d dl1m2Z2m3Z3m4Z4 d dl5m6Z6 d dl7m8Z8 d dl9m:Z: d dl;m<Z< e	rd dl=m>Z> d dl?m@Z@ d dlAmBZB d dlCmDZD d dlEmFZF d dlGmHZHmIZI eeJZKdeLd< G dd  d eZMd7d#d$ZNG d%d& d&ZOd8d(d)ZPd9d-d.ZQd:d;d2d3ZRd<d5d6ZSdS )=    )annotationsN)Enum)TYPE_CHECKINGCallableFinal)	ParseDict)configruntime)
get_logger)ClientState)FileURLsFileURLsRequest)
ForwardMsg)GitInfo)ConfigCustomThemeConfigFontFace
NewSessionUserInfo)caching)ForwardMsgQueue)FragmentStorageMemoryFragmentStorage)Installation)PagesManager)	RerunDataScriptRunnerScriptRunnerEvent)secrets_singleton)to_snake_case)STREAMLIT_VERSION_STRING)LocalSourcesWatcher)BackMsg)
ScriptData)ScriptCacheSessionState)UploadedFileManager)PageHashPageInfor   _LOGGERc                   @  s   e Zd ZdZdZdZdS )AppSessionStateAPP_NOT_RUNNINGAPP_IS_RUNNINGSHUTDOWN_REQUESTEDN)__name__
__module____qualname__r,   r-   r.    r2   r2   Q/var/www/vscode/kcb/lib/python3.10/site-packages/streamlit/runtime/app_session.pyr+   >   s    r+   returnstrc                   C  s   t t S )z5Randomly generate a unique ID for a script execution.)r5   uuiduuid4r2   r2   r2   r3   _generate_scriptrun_idD      r8   c                   @  s  e Zd ZdZ	dudvddZdwddZdwddZdwddZdxddZdwddZ	dyd d!Z
dzd#d$Zd{d'd(Zd|d+d,Zdwd-d.Zdwd/d0Zd}d3d4Zed~d6d7Zdd;d<Zdudd=d>Zdwd?d@ZduddCdDZ						dddPdQZ						dddRdSZddTdUZddVdWZ		dddXdYZdd\d]Zdd^d_Zdwd`daZ	dud|dbdcZdwdddeZ dwdfdgZ!dwdhdiZ"ddkdlZ#ddodpZ$ddsdtZ%dS )
AppSessiona!  
    Contains session data for a single "user" of an active app
    (that is, a connected browser tab).

    Each AppSession has its own ScriptData, root DeltaGenerator, ScriptRunner,
    and widget state.

    An AppSession is attached to each thread involved in running its script.

    Nscript_datar#   uploaded_file_managerr'   script_cacher$   message_enqueued_callbackCallable[[], None] | None	user_infodict[str, str | bool | None]session_id_override
str | Noner4   Nonec                 C  s   |pt t | _t | _|| _|| _|| _	t
|j| j	| _t | _|| _tj| _t | _d| _d| _d| _tddkrB|   td| _d| _ddlm} | | _|| _ d| _!t" | _#t$%d| j dS )a  Initialize the AppSession.

        Parameters
        ----------
        script_data
            Object storing parameters related to running a script

        uploaded_file_manager
            Used to manage files uploaded by users via the Streamlit web client.

        script_cache
            The app's ScriptCache instance. Stores cached user scripts. ScriptRunner
            uses the ScriptCache to avoid having to reload user scripts from disk
            on each rerun.

        message_enqueued_callback
            After enqueuing a message, this callable notification will be invoked.

        user_info
            A dict that contains information about the current user. For now,
            it only contains the user's email address.

            {
                "email": "example@example.com"
            }

            Information about the current user is optionally provided when a
            websocket connection is initialized via the "X-Streamlit-User" header.

        session_id_override
            The ID to assign to this session. Setting this can be useful when the
            service that a Streamlit Runtime is running in wants to tie the lifecycle of
            a Streamlit session to some other session-like object that it manages.
        Nzserver.fileWatcherTypenonezserver.runOnSaver   r%   zAppSession initialized (id=%s))&r5   r6   r7   idasyncioget_running_loop_event_loop_script_data_uploaded_file_mgr_script_cacher   main_script_path_pages_managerr   _browser_queue_message_enqueued_callbackr+   r,   _stater   _client_state_local_sources_watcher_stop_config_listener_stop_pages_listenerr   
get_optionregister_file_watchers_run_on_save_scriptrunnerstreamlit.runtime.stater&   _session_state
_user_info_debug_last_backmsg_idr   _fragment_storager*   debug)selfr;   r<   r=   r>   r@   rB   r&   r2   r2   r3   __init__U   s2   -
zAppSession.__init__c                 C     |    dS )zGEnsure that we call shutdown() when an AppSession is garbage collected.N)shutdownr`   r2   r2   r3   __del__   r9   zAppSession.__del__c                 C  sH   | j du rt| j| _ | j | j tj| jdd| _tj	
| j dS )a8  Register handlers to be called when various files are changed.

        Files that we watch include:
          - source files that already exist (for edits)
          - `.py` files in the the main script's `pages/` directory (for file additions
            and deletions)
          - project and user-level config.toml files
          - the project-level secrets.toml files

        This method is called automatically on AppSession construction, but it may be
        called again in the case when a session is disconnected and is being reconnect
        to.
        NT)force_connect)rS   r!   rN   register_file_change_callback_on_source_file_changedr   on_config_parsedrT   r   file_change_listenerconnect_on_secrets_file_changedrd   r2   r2   r3   rW      s   
z!AppSession.register_file_watchersc                 C  s\   | j dur
| j   | jdur|   | jdur|   tj| j d| _ d| _d| _dS )zJDisconnect the file watcher handlers registered by register_file_watchers.N)rS   closerT   rU   r   rj   
disconnectrl   rd   r2   r2   r3   disconnect_file_watchers   s   




z#AppSession.disconnect_file_watcherslist[ForwardMsg]c                 C  s
   | j  S )ai  Clear the forward message queue and return the messages it contained.

        The Server calls this periodically to deliver new messages
        to the browser connected to this app.

        Returns
        -------
        list[ForwardMsg]
            The messages that were removed from the queue and should
            be delivered to the browser.

        )rO   flushrd   r2   r2   r3   flush_browser_queue   s   
zAppSession.flush_browser_queuec                 C  sp   | j tjkr6td| j | j| j t	 r(t
 }|j| j |j  |   tj| _ |   dS dS )ziShut down the AppSession.

        It's an error to use a AppSession after it's been shut down.

        zShutting down (id=%s)N)rQ   r+   r.   r*   r_   rF   rK   remove_session_filesr	   existsget_instancemedia_file_mgrclear_session_refsremove_orphaned_filesrequest_script_stopro   )r`   rtr2   r2   r3   rc      s   
zAppSession.shutdownmsgr   c                 C  s0   | j r| j |_| j| | jr|   dS dS )zEnqueue a new ForwardMsg to our browser queue.

        This can be called on both the main thread and a ScriptRunner
        run thread.

        Parameters
        ----------
        msg : ForwardMsg
            The message to enqueue

        N)r]   debug_last_backmsg_idrO   enqueuerP   r`   r{   r2   r2   r3   _enqueue_forward_msg  s   zAppSession._enqueue_forward_msgr"   c              
   C  s  zh| d}|dkr|jr|j| _| |j W dS |dkr%|   W dS |dkr0|   W dS |dkr;|   W dS |dkrH| |j	 W dS |dkrS| 
  W dS |dkr`| |j W dS td	| W dS  ty } ztd
 | | W Y d}~dS d}~ww )zProcess a BackMsg.typererun_scriptload_git_infoclear_cacheapp_heartbeatset_run_on_savestop_scriptfile_urls_requestzNo handler for "%s"zError processing back messageN)
WhichOneofr|   r]   _handle_rerun_script_requestr   _handle_git_information_request_handle_clear_cache_request_handle_app_heartbeat_request_handle_set_run_on_save_requestr   _handle_stop_script_request_handle_file_urls_requestr   r*   warning	Exception	exceptionhandle_backmsg_exception)r`   r{   msg_typeexr2   r2   r3   handle_backmsg  s0   

zAppSession.handle_backmsgeBaseExceptionc                   sN    jtj j jtjdd  jtj j fdd dS )zGHandle an Exception raised while processing a BackMsg from the browser. )page_script_hashc                     s     S N)r   _create_exception_messager2   r   r`   r2   r3   <lambda>P      z5AppSession.handle_backmsg_exception.<locals>.<lambda>N)_on_scriptrunner_eventrY   r   SCRIPT_STOPPED_WITH_SUCCESSSCRIPT_STARTEDrI   call_soon_threadsafe)r`   r   r2   r   r3   r   6  s   	z#AppSession.handle_backmsg_exceptionclient_stateClientState | Nonec              	   C  s   | j tjkrtd dS |rH|j}|r%| j|s%td| d dS |	dr2| j
j|j t|j|j|j|j|r?|nd|j|jd}nt }| jdurmttdrc|jsc| j  d| _n
| j|}|rmdS | | dS )a  Signal that we're interested in running the script.

        If the script is not already running, it will be started immediately.
        Otherwise, a rerun will be requested.

        Parameters
        ----------
        client_state : streamlit.proto.ClientState_pb2.ClientState | None
            The ClientState protobuf to run the script with, or None
            to use previous client state.

        z'Discarding rerun request after shutdownNzThe fragment with id zW does not exist anymore - it might have been removed during a preceding full-app rerun.context_info)fragment_idis_auto_rerunr   zrunner.fastReruns)rQ   r+   r.   r*   r   r   r^   containsinfoHasFieldrR   r   CopyFromr   query_stringwidget_statesr   	page_namer   rY   boolr   rV   request_stoprequest_rerun_create_scriptrunner)r`   r   r   
rerun_datasuccessr2   r2   r3   r   S  sB   






zAppSession.request_rerunc                 C  s   | j dur| j   dS dS )zgRequest that the scriptrunner stop execution.

        Does nothing if no scriptrunner exists.
        N)rY   r   rd   r2   r2   r3   ry     s   
zAppSession.request_script_stopc                 C  s   | j   dS )z%Clear the user info for this session.N)r\   clearrd   r2   r2   r3   clear_user_info  s   zAppSession.clear_user_infoinitial_rerun_datar   c                 C  sL   t | j| jj| j| j| j|| j| j| j	d	| _
| j
j| j | j
  dS )z;Create and run a new ScriptRunner with the given RerunData.)	
session_idrM   session_stateuploaded_file_mgrr=   r   r@   fragment_storagepages_managerN)r   rF   rJ   rM   r[   rK   rL   r\   r^   rN   rY   on_eventrk   r   start)r`   r   r2   r2   r3   r     s   zAppSession._create_scriptrunnerr&   c                 C  s   | j S r   )r[   rd   r2   r2   r3   r     s   zAppSession.session_statefilepathr5   r   c                   s@   | j  tt fddd }|d ur| jj}||kS dS )Nc                   s   |  d  kS )Nscript_pathr2   )kr   pagesr2   r3   r     r   z9AppSession._should_rerun_on_file_change.<locals>.<lambda>T)rN   	get_pagesnextfilterrR   r   )r`   r   changed_page_script_hashcurrent_page_script_hashr2   r   r3   _should_rerun_on_file_change  s   
z'AppSession._should_rerun_on_file_changec                 C  sH   | j   |dur| |sdS | jr| | j dS | |   dS )zfOne of our source files changed. Clear the cache and schedule a rerun if
        appropriate.
        N)rL   r   r   rX   r   rR   r   _create_file_change_message)r`   r   r2   r2   r3   rh     s   
z"AppSession._on_source_file_changedc                 C  rb   )z:Called when `secrets.file_change_listener` emits a Signal.N)rh   )r`   _r2   r2   r3   rl     s   
z#AppSession._on_secrets_file_changedfragment_ids_this_runlist[str] | Nonec                 C  s   | j jd|d d S )NT)retain_lifecycle_msgsr   )rO   r   )r`   r   r2   r2   r3   _clear_queue  s   
zAppSession._clear_queuesenderScriptRunner | Noneeventr   forward_msgForwardMsg | Noner   BaseException | Noner   r   dict[PageHash, PageInfo] | Nonec	           	        s(   j  f	dd dS )a  Called when our ScriptRunner emits an event.

        This is generally called from the sender ScriptRunner's script thread.
        We forward the event on to _handle_scriptrunner_event_on_event_loop,
        which will be called on the main thread.
        c                
     s     S r   )(_handle_scriptrunner_event_on_event_loopr2   	r   r   r   r   r   r   r   r`   r   r2   r3   r     s    z3AppSession._on_scriptrunner_event.<locals>.<lambda>N)rI   r   )	r`   r   r   r   r   r   r   r   r   r2   r   r3   r     s   z!AppSession._on_scriptrunner_eventc	                 C  sF  | j t ksJ d|| jurtd| dS | j}	|tjkrL| jt	j
kr*t	j| _|dus2J d|| jjkr<|| j_| | | | ||| n|tjks[|tjks[|tjkr| jt	j
kret	j| _|tjkrntj}
n|tjkrwtj}
ntj}
| | |
 d| _|tjks|tjkr| jr| j  | j  nk|dusJ dt }t|j j!| | | nR|tj"krt	j| _| | tj# | jr| j  n7|tj$kr|dusJ d| jt	j
krt%& j'(| j) || _d| _n|tj*kr|dusJ d| | |	t	jk}| jt	jk}||kr!| | +  dS dS )a#  Handle a ScriptRunner event.

        This function must only be called on our eventloop thread.

        Parameters
        ----------
        sender : ScriptRunner | None
            The ScriptRunner that emitted the event. (This may be set to
            None when called from `handle_backmsg_exception`, if no
            ScriptRunner was active when the backmsg exception was raised.)

        event : ScriptRunnerEvent
            The event type.

        forward_msg : ForwardMsg | None
            The ForwardMsg to send to the frontend. Set only for the
            ENQUEUE_FORWARD_MSG event.

        exception : BaseException | None
            An exception thrown during compilation. Set only for the
            SCRIPT_STOPPED_WITH_COMPILE_ERROR event.

        client_state : streamlit.proto.ClientState_pb2.ClientState | None
            The ScriptRunner's final ClientState. Set only for the
            SHUTDOWN event.

        page_script_hash : str | None
            A hash of the script path corresponding to the page currently being
            run. Set only for the SCRIPT_STARTED event.

        fragment_ids_this_run : list[str] | None
            The fragment IDs of the fragments being executed in this script run. Only
            set for the SCRIPT_STARTED event. If this value is falsy, this script run
            must be for the full script.

        clear_forward_msg_queue : bool
            If set (the default), clears the queue of forward messages to be sent to the
            browser. Set only for the SCRIPT_STARTED event.
        zXThis function must only be called on the eventloop thread the AppSession was created on.z0Ignoring event from non-current ScriptRunner: %sNz9page_script_hash must be set for the SCRIPT_STARTED eventzEexception must be set for the SCRIPT_STOPPED_WITH_COMPILE_ERROR eventz/client_state must be set for the SHUTDOWN eventz-null forward_msg in ENQUEUE_FORWARD_MSG event),rI   rG   rH   rY   r*   r_   rQ   r   r   r+   r.   r-   rR   r   r   r   _create_new_session_messager   !SCRIPT_STOPPED_WITH_COMPILE_ERRORFRAGMENT_STOPPED_WITH_SUCCESSr,   r   FINISHED_SUCCESSFULLY"FINISHED_FRAGMENT_RUN_SUCCESSFULLYFINISHED_WITH_COMPILE_ERROR_create_script_finished_messager]   rS   update_watched_modulesupdate_watched_pagesexception_utilsmarshallsession_eventscript_compilation_exceptionSCRIPT_STOPPED_FOR_RERUNFINISHED_EARLY_FOR_RERUNSHUTDOWNr	   ru   rv   rw   rF   ENQUEUE_FORWARD_MSG&_create_session_status_changed_message)r`   r   r   r   r   r   r   r   r   
prev_statestatusr{   app_was_runningapp_is_runningr2   r2   r3   r     s   3




















z3AppSession._handle_scriptrunner_event_on_event_loopc                 C  s$   t  }| j|j_| jtjk|j_|S )z6Create and return a session_status_changed ForwardMsg.)r   rX   session_status_changedrun_on_saverQ   r+   r-   script_is_runningr~   r2   r2   r3   r     s
   

z1AppSession._create_session_status_changed_messagec                 C  s   t  }d|j_|S )z8Create and return a 'script_changed_on_disk' ForwardMsg.T)r   r   script_changed_on_diskr~   r2   r2   r3   r     s   z&AppSession._create_file_change_messagec                 C  s   t  }t |j_| jj|j_| jj|j_| jj|j_||j_	|r'|jj
| | |j|p1| j  t|jj t|jj t|jjjdtjjj  |jj}t|j t|j_dtttj |j_!| j"|j#_$| j%t&j'k|j#_(| jj)|_)| j*|_+|S )z+Create and return a new_session ForwardMsg.ztheme..),r   r8   new_sessionscript_run_idrJ   namerN   rM   main_script_hashr   r   extend_populate_app_pagesr   _populate_config_msgr   _populate_theme_msgcustom_themesidebarCustomThemeCategoriesSIDEBARvalue
initialize_populate_user_info_msgr@   r    environment_infostreamlit_versionjoinmapr5   sysversion_infopython_versionrX   session_statusr   rQ   r+   r-   r   is_hellorF   r   )r`   r   r   r   r{   imsgr2   r2   r3   r     s6   
	



z&AppSession._create_new_session_messager   )ForwardMsg.ScriptFinishedStatus.ValueTypec                 C  s   t  }||_|S )z/Create and return a script_finished ForwardMsg.)r   script_finished)r`   r   r{   r2   r2   r3   r     s   z*AppSession._create_script_finished_messagec                 C  s   t  }t|jjj| |S )z*Create and return an Exception ForwardMsg.)r   r   r   deltanew_elementr   )r`   r   r{   r2   r2   r3   r     s   z$AppSession._create_exception_messagec           	   
   C  s  t  }zeddlm} || jj}| }|d u rW d S |\}}}|d}||j_||j_	||j_
|j|jjd d < |j|jjd d < |jrMtjj|j_nt|jdkr[tjj|j_ntjj|j_| | W d S  ty } ztjd|d W Y d }~d S d }~ww )Nr   )GitRepoz.gitz+Obtaining Git information produced an errorexc_info)r   streamlit.git_utilr  rJ   rM   get_repo_inforemovesuffixgit_info_changed
repositorybranchmoduleuntracked_filesuncommitted_filesis_head_detachedr   	GitStatesHEAD_DETACHEDstatelenahead_commitsAHEAD_OF_REMOTEDEFAULTr   r   r*   r_   )	r`   r{   r  repo	repo_inforepository_namer  r  r   r2   r2   r3   r     s0   

z*AppSession._handle_git_information_requestc                 C  s   |  | dS )a  Tell the ScriptRunner to re-run its script.

        Parameters
        ----------
        client_state : streamlit.proto.ClientState_pb2.ClientState | None
            The ClientState protobuf to run the script with, or None
            to use previous client state.

        N)r   )r`   r   r2   r2   r3   r   %  s   z'AppSession._handle_rerun_script_requestc                 C  rb   )z1Tell the ScriptRunner to stop running its script.N)ry   rd   r2   r2   r3   r   3  r9   z&AppSession._handle_stop_script_requestc                 C  s"   t j  t j  | j  dS )zjClear this app's cache.

        Because this cache is global, it will be cleared for all users.

        N)r   
cache_datar   cache_resourcer[   rd   r2   r2   r3   r   7  s   

z&AppSession._handle_clear_cache_requestc                 C  s   dS )zHandle an incoming app heartbeat.

        The heartbeat indicates the frontend is active and keeps the
        websocket from going idle and disconnecting.

        The actual handler here is a noop

        Nr2   rd   r2   r2   r3   r   A  s   	z(AppSession._handle_app_heartbeat_request	new_valuec                 C  s   || _ | |   dS )zChange our run_on_save flag to the given value.

        The browser will be notified of the change.

        Parameters
        ----------
        new_value : bool
            New run_on_save value

        N)rX   r   r   )r`   r+  r2   r2   r3   r   L  s   z*AppSession._handle_set_run_on_save_requestr   r   c                 C  sX   t  }|j|j_| j| j|j}|D ]}|jj	t
|j|j|jd q| | dS )z6Handle a file_urls_request BackMsg sent by the client.)file_id
upload_url
delete_urlN)r   
request_idfile_urls_responseresponse_idrK   get_upload_urlsrF   
file_names	file_urlsappendr   r,  r-  r.  r   )r`   r   r{   upload_url_infosupload_url_infor2   r2   r3   r   Z  s   
z$AppSession._handle_file_urls_requestr   dict[PageHash, PageInfo]c                 C  sL   |  D ]\}}|j }||_|d dd|_|d |_|d |_qd S )Nr   r    icon)items	app_pagesaddr   replacer   url_pathnamer:  )r`   r{   r   r   	page_info
page_protor2   r2   r3   r   n  s   

zAppSession._populate_app_pagesr   )r;   r#   r<   r'   r=   r$   r>   r?   r@   rA   rB   rC   r4   rD   )r4   rD   )r4   rp   )r{   r   r4   rD   )r{   r"   r4   rD   )r   r   r4   rD   )r   r   r4   rD   )r   r   r4   rD   )r4   r&   )r   r5   r4   r   )r   rC   r4   rD   )r   r   r4   rD   )NNNNNN)r   r   r   r   r   r   r   r   r   r   r   rC   r   r   r   r   r4   rD   )r4   r   )NN)r   r5   r   r   r   r   r4   r   )r   r  r4   r   )r   r   r4   r   )r+  r   r4   rD   )r   r   r4   rD   )r{   r   r   r8  r4   rD   )&r/   r0   r1   __doc__ra   re   rW   ro   rr   rc   r   r   r   r   ry   r   r   propertyr   r   rh   rl   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r2   r2   r2   r3   r:   I   sj    
Z








R



	" 
$
		
1

%





r:   Config.ToolbarMode.ValueTypec                  C  s^   d} t | }ttj| }|d u r-ddd tj D }td| d| d| |S )Nzclient.toolbarModez, c                 s  s    | ]}|  V  qd S r   )lower).0r   r2   r2   r3   	<genexpr>      z$_get_toolbar_mode.<locals>.<genexpr>zConfig z. expects to have one of the following values: z. Current value: )	r   rV   getattrr   ToolbarModeupperr  keys
ValueError)
config_keyconfig_value
enum_valueallowed_valuesr2   r2   r3   _get_toolbar_mode  s   

rR  r{   r   rD   c                 C  sP   t d| _t d| _t d| _t d| _t ddu r"d| _t | _d S )Nzbrowser.gatherUsageStatszglobal.maxCachedMessageAgezserver.allowRunOnSavezui.hideTopBarzclient.showSidebarNavigationFT)	r   rV   gather_usage_statsmax_cached_message_ageallow_run_on_savehide_top_barhide_sidebar_navrR  toolbar_moder{   r2   r2   r3   r     s   r   themer   sectionc                 C  s  t |}tdd | D rd S | D ]\}}|dvr*|d ur*t| t|| q| jj| jj	d}|
dd }|d urX||vrStd| dt|  d n|| | _|
d	d }|rc|| _|
d
d }t|trzt|}W n ty }	 ztjd| d|	d d }W Y d }	~	nd }	~	ww |d ur|D ]-}
z| jt|
t  W q ty }	 ztjd|
 d|	d W Y d }	~	qd }	~	ww d S d S )Nc                 s  s    | ]}|d u V  qd S r   r2   )rF  valr2   r2   r3   rG    rH  z&_populate_theme_msg.<locals>.<genexpr>>   basefont	fontFaces)lightdarkr]  "z=" is an invalid value for theme.base. Allowed values include z . Setting theme.base to "light".r^  r_  zCFailed to parse the theme.fontFaces config option with json.loads: r   r  z3Failed to parse the theme.fontFaces config option: )r   get_options_for_sectionallvaluesr;  setattrr   	BaseThemeLIGHTDARKgetr*   r   listrL  r]  	body_font
isinstancer5   jsonloadsr   
font_facesr5  r   r   )r{   r[  
theme_optsoption_name
option_valbase_mapr]  rl  rp  r   	font_facer2   r2   r3   r     sb   




r   r   c                 C  s   t  j| _t  j| _d S r   )r   instanceinstallation_idinstallation_id_v3rY  r2   r2   r3   r    s   r  )r4   r5   )r4   rD  )r{   r   r4   rD   )rZ  )r{   r   r[  r5   r4   rD   )r{   r   r4   rD   )T
__future__r   rG   rn  r  r6   enumr   typingr   r   r   google.protobuf.json_formatr   streamlit.elements.exceptionelementsr   r   	streamlitr   r	   streamlit.loggerr
   streamlit.proto.ClientState_pb2r   streamlit.proto.Common_pb2r   r   streamlit.proto.ForwardMsg_pb2r   streamlit.proto.GitInfo_pb2r   streamlit.proto.NewSession_pb2r   r   r   r   r   streamlit.runtimer   #streamlit.runtime.forward_msg_queuer   streamlit.runtime.fragmentr   r   streamlit.runtime.metrics_utilr   streamlit.runtime.pages_managerr   streamlit.runtime.scriptrunnerr   r   r   streamlit.runtime.secretsr   streamlit.string_utilr   streamlit.versionr    streamlit.watcherr!   streamlit.proto.BackMsg_pb2r"   streamlit.runtime.script_datar#   +streamlit.runtime.scriptrunner.script_cacher$   rZ   r&   'streamlit.runtime.uploaded_file_managerr'   streamlit.source_utilr(   r)   r/   r*   __annotations__r+   r8   r:   rR  r   r   r  r2   r2   r2   r3   <module>   s^   
      
<

>