
    gt                    $   U d dl mZ d dlZd dlmZmZmZmZmZ d dl	Z	d dl	m
Z
 d dlmZ  ee      Zded<    eded	ef   
      Z ede
      ZddZddZ	 	 d	 	 	 	 	 	 	 	 	 	 	 ddZ	 	 d	 	 	 	 	 	 	 	 	 	 	 ddZ	 d	 	 	 	 	 	 	 	 	 	 	 ddZddZy)    )annotationsN)AnyCallableFinalTypeVarcast)config)
get_loggerr   _LOGGERTFunc.)boundTObjc                 >    t        t        j                  d            S )z<True if we should print deprecation warnings to the browser.zclient.showErrorDetails)boolr	   
get_option     O/var/www/openai/venv/lib/python3.12/site-packages/streamlit/deprecation_util.py+_should_show_deprecation_warning_in_browserr      s    !!";<==r   c                l    t               rt        j                  |        t        j                  |        y)z#Show a deprecation warning message.N)r   	streamlitwarningr   )messages    r   show_deprecation_warningr   #   s$    24'" OOGr   c           	     P    |r
d|  } d| }d|  d| d|  d| d	|rd| z   S dz   S )	Nzst.zPlease replace `z` with `z`.

`z` will be removed after .z

 r   )old_namenew_nameremoval_dateextra_messageinclude_st_prefixs        r   make_deprecated_name_warningr#   ,   sk     
#
# 8*HXJ 7:-l^1	>%2T-!	< 9;	<r   c                     t        j                          fd       }|_         j                  |_        t	        t
        |      S )a  Wrap an `st` function whose name has changed.

    Wrapped functions will run as normal, but will also show an st.warning
    saying that the old name will be removed after removal_date.

    (We generally set `removal_date` to 3 months from the deprecation date.)

    Parameters
    ----------
    func
        The `st.` function whose name has changed.

    old_name
        The function's deprecated name within __init__.py.

    removal_date
        A date like "2020-01-01", indicating the last day we'll guarantee
        support for the deprecated name.

    extra_message
        An optional extra message to show in the deprecation warning.

    name_override
        An optional name to use in place of func.__name__.
    c                 b     | i |}t        t        xs j                               |S N)r   r#   __name__)argskwargsresultr!   funcname_overrider   r    s      r   wrapped_funcz)deprecate_func_name.<locals>.wrapped_func_   s;    t&v& (-84==,	

 r   )	functoolswrapsr'   __doc__r   r   )r+   r   r    r!   r,   r-   s   ````` r   deprecate_func_namer1   >   sD    B __T  %L<<L|$$r   c                .    t        | fd      S )a  Wrap an `st` object whose name has changed.

    Wrapped objects will behave as normal, but will also show an st.warning
    saying that the old name will be removed after `removal_date`.

    (We generally set `removal_date` to 3 months from the deprecation date.)

    Parameters
    ----------
    obj
        The `st.` object whose name has changed.

    old_name
        The object's deprecated name within __init__.py.

    new_name
        The object's new name within __init__.py.

    removal_date
        A date like "2020-01-01", indicating the last day we'll guarantee
        support for the deprecated name.

    include_st_prefix
        If False, does not prefix each of the object names in the deprecation
        essage with `st.*`. Defaults to True.
    c                 4    t        t                     S )N)r"   )r   r#   )r"   r   r   r    s   r   <lambda>z$deprecate_obj_name.<locals>.<lambda>   s    (((LDU
r   )_create_deprecated_obj_wrapper)objr   r   r    r"   s    ````r   deprecate_obj_namer7   o   s    D *	
 r   c                d     ddfd G  fdd      t        t                      S )zCreate a wrapper for an object that has been deprecated. The first
    time one of the object's properties or functions is accessed, the
    given `show_warning` callback will be called.
    Fc                      s
d          y y NTr   )has_shown_warningshow_warnings   r   maybe_show_warningz:_create_deprecated_obj_wrapper.<locals>.maybe_show_warning   s     ! $N !r   c                  N    e Zd Z fdZfdZedd       Zefd       Zy)/_create_deprecated_obj_wrapper.<locals>.Wrapperc           
         j                  j                        D ]1  }t        | j                  |t        | j	                  |                   3 y r&   )_get_magic_functions	__class__setattrproperty_make_magic_function_proxy)selfnameWrapperr6   s     r   __init__z8_create_deprecated_obj_wrapper.<locals>.Wrapper.__init__   sB    44S]]CNNT<<TBC Dr   c                ^    || j                   v rt        | |      S          t        |      S r&   )__dict__getattr)rF   attrr=   r6   s     r   __getattr__z;_create_deprecated_obj_wrapper.<locals>.Wrapper.__getattr__   s1    
 t}}$tT** 3%%r   c                l    d}t        |       D cg c]  }||vr|j                  d      r| c}S c c}w )N)rB   rK   __getattribute__rN   __)dir
startswith)clsignorerG   s      r   rA   zD_create_deprecated_obj_wrapper.<locals>.Wrapper._get_magic_functions   sH     RF  H$Dv%$//$*? $  s   1c                      fd}|S )Nc                *             t              S r&   )rL   )rF   r(   r=   rG   r6   s     r   proxyzY_create_deprecated_obj_wrapper.<locals>.Wrapper._make_magic_function_proxy.<locals>.proxy   s    "$sD))r   r   )rG   rX   r=   r6   s   ` r   rE   zJ_create_deprecated_obj_wrapper.<locals>.Wrapper._make_magic_function_proxy   s    * Lr   N)returnz	list[str])r'   
__module____qualname__rI   rN   staticmethodrA   rE   )rH   r=   r6   s   r   rH   r?      s5    			& 
	 
	 
	 
	r   rH   )rY   None)r   r   )r6   r<   rH   r;   r=   s   ``@@@r   r5   r5      s,    
 & &P gi  r   )rY   r   )r   strrY   r]   r:   )r   r^   r   r^   r    r^   r!   
str | Noner"   r   rY   r^   )NN)r+   r   r   r^   r    r^   r!   r_   r,   r_   rY   r   )T)r6   r   r   r^   r   r^   r    r^   r"   r   rY   r   )r6   r   r<   zCallable[[], Any]rY   r   )
__future__r   r.   typingr   r   r   r   r   r   r	   streamlit.loggerr
   r'   r   __annotations__r   objectr   r   r   r#   r1   r7   r5   r   r   r   <module>re      s)   #  6 6   'H% %xS12vV$>
 !%"  	
  	, !% $.%
.%.% .% 	.%
 .% .%l #)	)) ) 	)
 ) 
)X6!r   