
    Fg                        S r SSKJr  SSKrSSKrSSKJrJr  SSKJ	r	J
r
  SSKJr  SSKJrJr  SSKJr  \	(       a  SS	KJr  \" 5        " S
 S\5      5       rg)zgr.Slider() component.    )annotationsN)CallableSequence)TYPE_CHECKINGAny)document)	ComponentFormComponent)Events)Timerc                  .  ^  \ rS rSrSr\R                  \R                  \R                  /r	   SSSSSSSSSSSSSSSSSSS.                                       SU 4S jjjjr
SS	 jrSS
 jrSS jrS rSS jrSS jrSrU =r$ )Slider   z
Creates a slider that ranges from {minimum} to {maximum} with a step size of {step}.

Demos: sentence_builder, slider_release, interface_random_slider, blocks_random_slider
Guides: create-your-own-friends-with-a-gan
NT   F)steplabelinfoeveryinputs
show_label	containerscale	min_widthinteractivevisibleelem_idelem_classesrenderkey	randomizeshow_reset_buttonc                 > Xl         X l        Uc<  X!-
  n[        R                  " [        R                  " U5      S-
  5      nSU-  U l        OX@l        UU l        U(       a  U R                  n[        TU ]%  UUUUU	U
UUUUUUUUUS9  g)aG  
Parameters:
    minimum: minimum value for slider.
    maximum: maximum value for slider.
    value: default value for slider. If a function is provided, the function will be called each time the app loads to set the initial value of this component. Ignored if randomized=True.
    step: increment between slider values.
    label: the label for this component, displayed above the component if `show_label` is `True` and is also used as the header if there are a table of examples for this component. If None and used in a `gr.Interface`, the label will be the name of the parameter this component corresponds to.
    info: additional component description, appears below the label in smaller font. Supports markdown / HTML syntax.
    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.
    show_label: if True, will display label.
    container: If True, will place the component in a container - providing some extra padding around the border.
    scale: relative size compared to adjacent Components. For example if Components A and B are in a Row, and A has scale=2, and B has scale=1, A will be twice as wide as B. Should be an integer. scale applies in Rows, and to top-level Components in Blocks where fill_height=True.
    min_width: minimum pixel width, will wrap if not sufficient screen space to satisfy this value. If a certain scale value results in this Component being narrower than min_width, the min_width parameter will be respected first.
    interactive: if True, slider will be adjustable; if False, adjusting will be disabled. If not provided, this is inferred based on whether the component is used as an input or output.
    visible: If False, component will be hidden.
    elem_id: An optional string that is assigned as the id of this component in the HTML DOM. Can be used for targeting CSS styles.
    elem_classes: An optional list of strings that are assigned as the classes of this component in the HTML DOM. Can be used for targeting CSS styles.
    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: if assigned, will be used to assume identity across a re-render. Components that have the same key across a re-render will have their value preserved.
    randomize: If True, the value of the slider when the app loads is taken uniformly at random from the range given by the minimum and maximum.
    show_reset_button: if False, will hide button to reset slider to default value.
N   
   )r   r   r   r   r   r   r   r   r   r   r   r   r   r   value)
minimummaximummathfloorlog10r   r!   get_random_valuesuper__init__)selfr&   r'   r%   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r    r!   
differencepower	__class__s                          i/Users/admin/workspace/ai/PDFMathTranslate/myenv/lib/python3.13/site-packages/gradio/components/slider.pyr-   Slider.__init__   s    ^ < *JJJtzz*59:EE	DII!2))E!#% 	 	
    c                @    SSU R                    SU R                   3S.$ )Nnumberznumeric value between z and )typedescription)r&   r'   r.   s    r2   api_infoSlider.api_infoj   s'    3DLL>t||nU
 	
r4   c                    U R                   $ Nr&   r9   s    r2   example_payloadSlider.example_payloadp       ||r4   c                    U R                   $ r=   r>   r9   s    r2   example_valueSlider.example_values   rA   r4   c                T   [        U R                  U R                  -
  U R                  -  5      n[        R
                  " SU5      nU R                  X R                  -  -   n[        [        U R                  5      S S S2   R                  S5      S5      nU(       a  [        X45      nU$ )Nr   .)
intr'   r&   r   randomrandintmaxstrfindround)r.   n_stepsr   r%   
n_decimalss        r2   r+   Slider.get_random_valuev   s    t||dll2dii?@~~a)tii//TYY"-2237;
%,Er4   c                $    Uc  U R                   $ U$ )z
Parameters:
    value: Expects an {int} or {float} returned from function and sets slider value to it as long as it is within range (otherwise, sets to minimum value).
Returns:
    The value of the slider within the range.
r>   )r.   r%   s     r2   postprocessSlider.postprocess   s      %}t||7%7r4   c                    U$ )zh
Parameters:
    payload: slider value
Returns:
    Passes slider value as a {float} into the function.
 )r.   payloads     r2   
preprocessSlider.preprocess   s	     r4   )r'   r&   r!   r   )r   d   N)(r&   floatr'   r[   r%   zfloat | Callable | Noner   float | Noner   
str | Noner   r]   r   zTimer | float | Noner   z7Component | Sequence[Component] | set[Component] | Noner   bool | Noner   boolr   z
int | Noner   rH   r   r^   r   r_   r   r]   r   zlist[str] | str | Noner   r_   r   zint | str | Noner    r_   r!   r_   )returnzdict[str, Any])r`   r   )r%   r\   r`   r[   )rW   r[   r`   r[   )__name__
__module____qualname____firstlineno____doc__r   changeinputreleaseEVENTSr-   r:   r?   rC   r+   rS   rX   __static_attributes____classcell__)r1   s   @r2   r   r      ss    mmV\\6>>:F )-	J
 " &*JN"& #'"/3 $"&-J
J
 J
 '	J
 J
 J
 J
 $J
 HJ
  J
 J
 J
 J
 !J
  !J
" #J
$ -%J
& 'J
( )J
* +J
,  -J
 J
X
8 r4   r   )re   
__future__r   r(   rI   collections.abcr   r   typingr   r   gradio_client.documentationr   gradio.components.baser	   r
   gradio.eventsr   gradio.componentsr   r   rV   r4   r2   <module>rs      sF     "   . % 0 ;  ' 
|] | |r4   