
    ;3h                        d dl mZ d dlmZmZ d dlmZmZ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
        G d
 de             Zy)    )annotations)MappingSequence)TYPE_CHECKINGLiteral	TypedDict)document)	Component)Events)Timerc                  ,    e Zd ZU ded<   ded<   ded<   y)	Parameterstrtypedescription
str | NonedefaultN)__name__
__module____qualname____annotations__     ]/var/www/html/audio-gradio/venv/lib/python3.12/site-packages/gradio/components/paramviewer.pyr   r      s    
Ir   r   c                       e Zd ZdZej
                  ej                  gZ	 	 	 	 	 	 	 	 	 	 d	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d	 fdZd
dZ	ddZ
d Zd Zd Z xZS )ParamViewera  
    Displays an interactive table of parameters and their descriptions and default values with syntax highlighting. For each parameter,
    the user should provide a type (e.g. a `str`), a human-readable description, and a default value. As this component does not accept user input,
    it is rarely used as an input component. Internally, this component is used to display the parameters of components in the Custom
    Component Gallery (https://www.gradio.app/custom-components/gallery).
    c                ~    |xs i | _         || _        || _        |	| _        |
| _        t
        |   ||||||       y)a3  
        Parameters:
            value: A dictionary of dictionaries. The key in the outer dictionary is the parameter name, while the inner dictionary has keys "type", "description", and "default" for each parameter. Markdown links are supported in "description".
            language: The language to display the code in. One of "python" or "typescript".
            linkify: A list of strings to linkify. If any of these strings is found in the description, it will be rendered as a link.
            every: Continously calls `value` to recalculate it if `value` is a function (has no effect otherwise). Can provide a Timer whose tick resets `value`, or a float that provides the regular interval for the reset Timer.
            inputs: Components that are used as inputs to calculate `value` if `value` is a function (has no effect otherwise). `value` is recalculated any time the inputs change.
            render: If False, component will not render be rendered in the Blocks context. Should be used if the intention is to assign event listeners now but render the component later.
            key: in a gr.render, Components with the same key across re-renders are treated as the same component, not a new component. Properties set in 'preserved_by_key' are not reset across a re-render.
            preserved_by_key: A list of parameters from this component's constructor. Inside a gr.render() function, if a component is re-rendered with the same key, these (and only these) parameters will be preserved in the UI (if they have been changed by the user or an event listener) instead of re-rendered based on the values provided during constructor.
            header: The header to display above the table of parameters, also includes a toggle button that closes/opens all details at once. If None, no header will be displayed.
            anchor_links: If True, creates anchor links for each parameter that can be used to link directly to that parameter. If a string, creates anchor links with the given string as the prefix to prevent conflicts with other ParamViewer components.
        )everyinputsvaluerenderkeypreserved_by_keyN)r    languagelinkifyheaderanchor_linkssuper__init__)selfr    r$   r%   r   r   r!   r"   r#   r&   r'   	__class__s              r   r)   zParamViewer.__init__#   sQ    4 [b
 (- 	 	
r   c                    |S )a  
        Parameters:
            payload: A `dict[str, dict]`. The key in the outer dictionary is the parameter name, while the inner dictionary has keys "type", "description", and "default" for each parameter.
        Returns:
            (Rarely used) passes value as a `dict[str, dict]`. The key in the outer dictionary is the parameter name, while the inner dictionary has keys "type", "description", and "default" for each parameter.
        r   )r*   payloads     r   
preprocesszParamViewer.preprocessK   s	     r   c                    |S )a  
        Parameters:
            value: Expects value as a `dict[str, dict]`. The key in the outer dictionary is the parameter name, while the inner dictionary has keys "type", "description", and "default" for each parameter.
        Returns:
            The same value.
        r   )r*   r    s     r   postprocesszParamViewer.postprocessT   s	     r   c                    dddddiS Narraynumpyany valid jsonNone)r   r   r   r   r*   s    r   example_payloadzParamViewer.example_payload]       /!
 	
r   c                    dddddiS r2   r   r7   s    r   example_valuezParamViewer.example_valuef   r9   r   c                    i ddS )Nr5   )r   r   r   r7   s    r   api_infozParamViewer.api_infoo   s    +;<<r   )
NpythonNNNTNr    
ParametersF)r    zMapping[str, Parameter] | Noner$   zLiteral['python', 'typescript']r%   zlist[str] | Noner   zTimer | float | Noner   z7Component | Sequence[Component] | set[Component] | Noner!   boolr"   z(int | str | tuple[int | str, ...] | Noner#   zlist[str] | str | Noner&   r   r'   z
bool | str)r-   dict[str, Parameter]returnrA   )r    rA   rB   rA   )r   r   r   __doc__r   changeuploadEVENTSr)   r.   r0   r8   r;   r=   __classcell__)r+   s   @r   r   r      s     	F 154<$(&*JN8<3:)#(&
-&
 2&
 "	&

 $&
 H&
 &
 6&
 1&
 &
 !&
P

=r   r   N)
__future__r   collections.abcr   r   typingr   r   r   gradio_client.documentationr	   gradio.components.baser
   gradio.eventsr   gradio.componentsr   r   r   r   r   r   <module>rO      sL    " - 4 4 0 ,  '	  
Z=) Z= Z=r   