
    &e?)                        d dl mZ d dlmZmZmZ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 dlmZ erd d	lmZ  G d
 de          Zeeeed         f                  Zeeeef                  Z G d d          ZdS )    )Enum)TYPE_CHECKINGOptionalUnioncast)Literal)StreamlitAPIException)Heading)gather_metrics)
clean_text)SupportsStr)DeltaGeneratorc                       e Zd ZdZdZdZdS )HeadingProtoTagh1h2h3N)__name__
__module____qualname__	TITLE_TAG
HEADER_TAGSUBHEADER_TAG     :lib/python3.11/site-packages/streamlit/elements/heading.pyr   r      s        IJMMMr   r   Fc                   |   e Zd Z ed          	 dddddededee         ded	d
f
d            Z	 ed          	 dddddededee         ded	d
f
d            Z
 ed          	 ddddededee         d	d
fd            Zedd            Zed             Ze	 	 	 ddedededee         ded	efd            ZdS )HeadingMixinheaderNF)helpdividerbodyanchorr    r!   returnr   c          
          | j                             dt                              t          j        ||||                    S )u*  Display text in header formatting.

        Parameters
        ----------
        body : str
            The text to display as Github-flavored Markdown. Syntax
            information can be found at: https://github.github.com/gfm.

            This also supports:

            * Emoji shortcodes, such as ``:+1:``  and ``:sunglasses:``.
              For a list of all supported codes,
              see https://share.streamlit.io/streamlit/emoji-shortcodes.

            * LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"
              must be on their own lines). Supported LaTeX functions are listed
              at https://katex.org/docs/supported.html.

            * Colored text, using the syntax ``:color[text to be colored]``,
              where ``color`` needs to be replaced with any of the following
              supported colors: blue, green, orange, red, violet, gray/grey, rainbow.

        anchor : str or False
            The anchor name of the header that can be accessed with #anchor
            in the URL. If omitted, it generates an anchor using the body.
            If False, the anchor is not shown in the UI.

        help : str
            An optional tooltip that gets displayed next to the header.

        divider : bool or “blue”, “green”, “orange”, “red”, “violet”, “gray”/"grey", or “rainbow”
            Shows a colored divider below the header. If True, successive
            headers will cycle through divider colors. That is, the first
            header will have a blue line, the second header will have a
            green line, and so on. If a string, the color can be set to one of
            the following: blue, green, orange, red, violet, gray/grey, or
            rainbow.

        Examples
        --------
        >>> import streamlit as st
        >>>
        >>> st.header('This is a header with a divider', divider='rainbow')
        >>> st.header('_Streamlit_ is :blue[cool] :sunglasses:')

        .. output::
           https://doc-header.streamlit.app/
           height: 220px

        headingtagr"   r#   r    r!   )dg_enqueuer   _create_heading_protor   r   selfr"   r#   r    r!   s        r   r   zHeadingMixin.header)   sL    v w..#. /  	
 	
 		
r   	subheaderc          
          | j                             dt                              t          j        ||||                    S )u<  Display text in subheader formatting.

        Parameters
        ----------
        body : str
            The text to display as Github-flavored Markdown. Syntax
            information can be found at: https://github.github.com/gfm.

            This also supports:

            * Emoji shortcodes, such as ``:+1:``  and ``:sunglasses:``.
              For a list of all supported codes,
              see https://share.streamlit.io/streamlit/emoji-shortcodes.

            * LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"
              must be on their own lines). Supported LaTeX functions are listed
              at https://katex.org/docs/supported.html.

            * Colored text, using the syntax ``:color[text to be colored]``,
              where ``color`` needs to be replaced with any of the following
              supported colors: blue, green, orange, red, violet, gray/grey, rainbow.

        anchor : str or False
            The anchor name of the header that can be accessed with #anchor
            in the URL. If omitted, it generates an anchor using the body.
            If False, the anchor is not shown in the UI.

        help : str
            An optional tooltip that gets displayed next to the subheader.

        divider : bool or “blue”, “green”, “orange”, “red”, “violet”, “gray”/"grey", or “rainbow”
            Shows a colored divider below the header. If True, successive
            headers will cycle through divider colors. That is, the first
            header will have a blue line, the second header will have a
            green line, and so on. If a string, the color can be set to one of
            the following: blue, green, orange, red, violet, gray/grey, or
            rainbow.

        Examples
        --------
        >>> import streamlit as st
        >>>
        >>> st.subheader('This is a subheader with a divider', divider='rainbow')
        >>> st.subheader('_Streamlit_ is :blue[cool] :sunglasses:')

        .. output::
           https://doc-subheader.streamlit.app/
           height: 220px

        r&   r'   )r)   r*   r   r+   r   r   r,   s        r   r.   zHeadingMixin.subheadero   sL    v w..#1 /  	
 	
 		
r   title)r    c          	          | j                             dt                              t          j        |||                    S )aY  Display text in title formatting.

        Each document should have a single `st.title()`, although this is not
        enforced.

        Parameters
        ----------
        body : str
            The text to display as Github-flavored Markdown. Syntax
            information can be found at: https://github.github.com/gfm.

            This also supports:

            * Emoji shortcodes, such as ``:+1:``  and ``:sunglasses:``.
              For a list of all supported codes,
              see https://share.streamlit.io/streamlit/emoji-shortcodes.

            * LaTeX expressions, by wrapping them in "$" or "$$" (the "$$"
              must be on their own lines). Supported LaTeX functions are listed
              at https://katex.org/docs/supported.html.

            * Colored text, using the syntax ``:color[text to be colored]``,
              where ``color`` needs to be replaced with any of the following
              supported colors: blue, green, orange, red, violet, gray/grey, rainbow.

        anchor : str or False
            The anchor name of the header that can be accessed with #anchor
            in the URL. If omitted, it generates an anchor using the body.
            If False, the anchor is not shown in the UI.

        help : str
            An optional tooltip that gets displayed next to the title.

        Examples
        --------
        >>> import streamlit as st
        >>>
        >>> st.title('This is a title')
        >>> st.title('_Streamlit_ is :blue[cool] :sunglasses:')

        .. output::
           https://doc-title.streamlit.app/
           height: 220px

        r&   )r(   r"   r#   r    )r)   r*   r   r+   r   r   )r-   r"   r#   r    s       r   r0   zHeadingMixin.title   sF    j w..#-Dd /  
 
 	
r   c                 "    t          d|           S )zGet our DeltaGenerator.r   )r   )r-   s    r   r)   zHeadingMixin.dg   s     $d+++r   c                 t    | du rdS g d}| |v r| S t          d|  dd                    |           d          )NTauto)bluegreenorangeredvioletgraygreyrainbowz&Divider parameter has invalid value: `z`. Please choose from: z, .)r	   join)r!   valid_colorss     r   _handle_divider_colorz"HeadingMixin._handle_divider_color   sk    d??6	
 	
 	
 l""N'sssY]YbYbcoYpYpsss  r   r(   c                    t                      }| j        |_        t          |          |_        |rt
                              |          |_        |c|du rd|_        nWt          |t                    r||_        n:|du rt          d|z            t          dt          |          j        z            |r||_        |S )NFTzSAnchor parameter has invalid value: %s. Supported values: None, any string or FalsezRAnchor parameter has invalid type: %s. Supported values: None, any string or False)HeadingProtovaluer(   r   r"   r   r@   r!   hide_anchor
isinstancestrr#   r	   typer   r    )r(   r"   r#   r    r!   protos         r   r+   z"HeadingMixin._create_heading_proto  s     I	%%
 	H(>>wGGEM$(!!FC(( %4+BDJK  
 ,B6ll+,    	EJr   )N)r$   r   )NNF)r   r   r   r   r   Anchorr   rF   Dividerr   r.   r0   propertyr)   staticmethodr@   r   rB   r+   r   r   r   r   r   (   s8       ^H C

 # C
 C
 C
C
 C

 smC
 C
 
C
 C
 C
 C
J ^K   C

 # C
 C
 C
C
 C

 smC
 C
 
C
 C
 C
 ! C
J ^G 9

 #9
 9
 9
9
 9

 sm9
 
9
 9
 9
 9
v , , , X,   \(  "    sm	
  
   \  r   r   N)enumr   typingr   r   r   r   typing_extensionsr   streamlit.errorsr	   streamlit.proto.Heading_pb2r
   rB   streamlit.runtime.metrics_utilr   streamlit.string_utilr   streamlit.type_utilr   streamlit.delta_generatorr   r   rF   rI   boolrJ   r   r   r   r   <module>rW      sV         7 7 7 7 7 7 7 7 7 7 7 7 % % % % % % 2 2 2 2 2 2 ? ? ? ? ? ? 9 9 9 9 9 9 , , , , , , + + + + + + 9888888    d    
%WU^+,	-
5s#
$C C C C C C C C C Cr   