
    g                    n    d dl mZ d dlmZ d dlmZ d dlmZ d dlm	Z	 d dl
mZ dZ ed      dd	       Zy
)    )annotations)runtime)show_deprecation_warning)gather_metrics)get_script_run_ctx)BrowserWebSocketHandlerzThe `_get_websocket_headers` function is deprecated and will be removed in a future version of Streamlit. Please use `st.context.headers` instead._get_websocket_headersc                    t        t               t               } | yt        j                         j                  | j                        }|yt        |t              st        d| d      t        |j                  j                        S )a  Return a copy of the HTTP request headers for the current session's
    WebSocket connection. If there's no active session, return None instead.

    Raise an error if the server is not running.

    Note to the intrepid: this is an UNSUPPORTED, INTERNAL API. (We don't have plans
    to remove it without a replacement, but we don't consider this a production-ready
    function, and its signature may change without a deprecation warning.)
    Nz1SessionClient is not a BrowserWebSocketHandler! ())r   $_GET_WEBSOCKET_HEADERS_DEPRECATE_MSGr   r   get_instance
get_client
session_id
isinstancer   RuntimeErrordictrequestheaders)ctxsession_clients     [/var/www/openai/venv/lib/python3.12/site-packages/streamlit/web/server/websocket_headers.pyr	   r	      s     AB

C
{))+66s~~FNn&=>??OqQ
 	
 &&..//    N)returnzdict[str, str] | None)
__future__r   	streamlitr   streamlit.deprecation_utilr   streamlit.runtime.metrics_utilr   7streamlit.runtime.scriptrunner_utils.script_run_contextr   .streamlit.web.server.browser_websocket_handlerr   r   r	    r   r   <module>r!      s>    #  ? 9 V RQ % ()0 *0r   