
    hMh                        d Z ddlmZmZ ddlmZ ddlmZmZm	Z	 ddl
mZ ddlmZmZmZ ddlmZ dd	lmZmZmZ  G d
 dee          Ze G d de                      Ze G d de                      Ze G d de                      Ze G d de                      Z G d deee          Ze G d de                      Ze G d de                      Ze G d de                      Ze G d de                      Ze G d de                      Z e G d  d!e                       Z!e G d" d#e                       Z"d$S )%z;String class.

Represents a unicode string using a widget.
   )DescriptionStyleDescriptionWidget)ValueWidget)CallbackDispatcherregisterwidget_serialization)
CoreWidget)ColorInstanceDict
TypedTuple)deprecation    )UnicodeBoolIntc                      e Zd ZdZ ed                              d          Z eddd                              d          Z eddd                              d          Z e	ddd	                              d          Z
dS )
_StringStyleText input style widget.StringStyleModelTsyncNzBackground specifications.
allow_nonehelpzText font size.z
Text color)__name__
__module____qualname____doc__r   tag_model_name
background	font_sizer
   
text_color     `/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/ipywidgets/widgets/widget_string.pyr   r      s        ""',--11t1<<K$5QRRRVV\`VaaJ4EFFFJJPTJUUIt<@@@DD$DOOJJJr%   r   c                      e Zd ZdZ ed                              d          Z eddd                              d          Z eddd                              d          Z eddd	                              d          Z	 eddd
                              d          Z
 eddd                              d          ZdS )
LabelStylezLabel style widget.LabelStyleModelTr   NzLabel text font family.r   zLabel text font style.zLabel text font variant.zLabel text font weight.zLabel text decoration.)r   r   r   r   r   r   r    font_family
font_stylefont_variantfont_weighttext_decorationr$   r%   r&   r(   r(      s       '+,,00d0;;K'$46OPPPTTZ^T__K$5MNNNRRX\R]]J74D7QRRRVV\`VaaL'$46OPPPTTZ^T__Kgdt:RSSSWW]aWbbOOOr%   r(   c                   P    e Zd ZdZ ed                              d          ZdS )	TextStyler   TextStyleModelTr   Nr   r   r   r   r   r   r    r$   r%   r&   r0   r0   %   s5        ""'*++//T/::KKKr%   r0   c                   P    e Zd ZdZ ed                              d          ZdS )	HTMLStylezHTML style widget.HTMLStyleModelTr   Nr2   r$   r%   r&   r4   r4   *   s5        '*++//T/::KKKr%   r4   c                   P    e Zd ZdZ ed                              d          ZdS )HTMLMathStylezHTML with math style widget.HTMLMathStyleModelTr   Nr2   r$   r%   r&   r7   r7   /   s5        &&'.//333>>KKKr%   r7   c                       e Zd ZdZ ed                              d          Z edd                              d          Z  ee	          j        dddie
Zd fd
	Z ed                              d          Z xZS )_Stringz:Base class used to create widgets that represent a string.zString valuer   Tr   u   ​z7Placeholder text to display when nothing has been typedr   Nc                 H    |||d<    t                      j        di | d S )Nvaluer$   )super__init__)selfr=   kwargs	__class__s      r&   r?   z_String.__init__@   s5    #F7O""6"""""r%   StringModelr$   N)r   r   r   r   r   r   r=   placeholderr   r   r   styler?   r    __classcell__rB   s   @r&   r:   r:   5   s        DDG(((,,$,77E
 '()bcccggmqgrrK*LL&&*MMM8LMME# # # # # #
 '-((,,$,77KKKKKr%   r:   c                       e Zd ZdZ ed                              d          Z ed                              d          Z  ee	          j        dddie
ZdS )	HTMLz#Renders the string `value` as HTML.HTMLViewTr   	HTMLModelr   Nr$   )r   r   r   r   r   r   
_view_namer    r   r4   r   rF   r$   r%   r&   rJ   rJ   G   s|        --$$((d(33J'+&&***55K'LL##'JJTJ5IJJEEEr%   rJ   c                       e Zd ZdZ ed                              d          Z ed                              d          Z  ee	          j        dddie
ZdS )	HTMLMathz;Renders the string `value` as HTML, and render mathematics.HTMLMathViewTr   HTMLMathModelr   Nr$   )r   r   r   r   r   r   rM   r    r   r7   r   rF   r$   r%   r&   rO   rO   N   s|        EE((,,$,77J'/**..D.99K+LL''+NNN9MNNEEEr%   rO   c                       e Zd ZdZ ed                              d          Z ed                              d          Z  ee	          j        dddie
ZdS )	LabelzLabel widget.

    It also renders math inside the string `value` as Latex (requires $ $ or
    $$ $$ and similar latex tags).
    	LabelViewTr   
LabelModelr   Nr$   )r   r   r   r   r   r   rM   r    r   r(   r   rF   r$   r%   r&   rS   rS   V   s         
 %%))t)44J',''+++66K(LL$$(KKdK6JKKEEEr%   rS   c                      e Zd ZdZ ed                              d          Z ed                              d          Z eddd                              d          Z	 e
d	d
                              d          Z e
dd                              d          Z  ee          j        dddieZdS )TextareazMultiline text area widget.TextareaViewTr   TextareaModelNzThe number of rows to display.r   FEnable or disable user changesr;   lUpdate the value as the user types. If False, update on submission, e.g., pressing Enter or navigating away.r   r$   )r   r   r   r   r   r   rM   r    r   rowsr   disabledcontinuous_updater   r0   r   rF   r$   r%   r&   rW   rW   b   s       %%((,,$,77J'/**..D.99K3t+KLLLPPVZP[[DtE @AAAEE4EPPHT  )W  X  X  X  \  \  bf  \  g  g'LL##'JJTJ5IJJEEEr%   rW   c                   `    e Zd ZdZ ed                              d          Z ed                              d          Z edd                              d          Z	 edd	                              d          Z
  ee          j        dd
dieZ fdZd ZddZ xZS )TextSingle line textbox widget.TextViewTr   	TextModelFrZ   r;   r[   r   c                      t                      j        |i | t                      | _        |                     | j                   d S rD   )r>   r?   r   _submission_callbackson_msg_handle_string_msg)r@   argsrA   rB   s      r&   r?   zText.__init__u   sH    $)&)))%7%9%9"D+,,,,,r%   c                 h    |                     dd          dk    r|                     |            dS dS )zHandle a msg from the front-end.

        Parameters
        ----------
        content: dict
            Content of the msg.
        event submitN)getre   )r@   _contentbufferss       r&   rg   zText._handle_string_msgz   s?     ;;w##x//&&t,,,,, 0/r%   c                 \    t          d           | j                            ||           dS )aE  (Un)Register a callback to handle text submission.

        Triggered when the user clicks enter.

        Parameters
        ----------
        callback: callable
            Will be called with exactly one argument: the Widget instance
        remove: bool (optional)
            Whether to unregister the callback
        zon_submit is deprecated. Instead, set the .continuous_update attribute to False and observe the value changing with: mywidget.observe(callback, 'value').)removeN)r   re   register_callback)r@   callbackrr   s      r&   	on_submitzText.on_submit   sA     	  p  	q  	q  	q"44Xf4MMMMMr%   r$   )F)r   r   r   r   r   r   rM   r    r   r]   r^   r   r0   r   rF   r?   rg   ru   rG   rH   s   @r&   r`   r`   l   s>       %%$$((d(33J'+&&***55KtE @AAAEE4EPPHT  )W  X  X  X  \  \  bf  \  g  g'LL##'JJTJ5IJJE- - - - -
	- 	- 	-N N N N N N N Nr%   r`   c                        e Zd ZdZ ed                              d          Z ed                              d          Z edd                              d          Z	 fd	Z
 xZS )
Passwordra   PasswordViewTr   PasswordModelFrZ   r;   c              #   j   K   t                                                      }|D ]}|dk    r|V  d S )Nr=   )r>   
_repr_keys)r@   
super_keyskeyrB   s      r&   r{   zPassword._repr_keys   sH      WW''))
 	 	Cg~~				 	r%   )r   r   r   r   r   r   rM   r    r   r]   r{   rG   rH   s   @r&   rw   rw      s        %%((,,$,77J'/**..D.99KtE @AAAEE4EPPH        r%   rw   c                   "   e Zd ZdZ ed                              d          Z ed                              d          Z e e            d                              d          Z	 e
dd	
                              d          ZdS )ComboboxzCSingle line textbox widget with a dropdown and autocompletion.
    ComboboxModelTr   ComboboxViewz!Dropdown options for the combobox)traitr   FzDIf set, ensure value is in options. Implies continuous_update=False.r;   N)r   r   r   r   r   r   r    rM   r   optionsr   ensure_optionr$   r%   r&   r   r      s         '/**..D.99K((,,$,77Jjgii0   
ctcnn 
 DS   
ctcnn MMr%   r   N)#r   widget_descriptionr   r   valuewidgetr   widgetr   r   r   widget_corer	   trait_typesr
   r   r   utilsr   	traitletsr   r   r   r   r(   r0   r4   r7   r:   rJ   rO   rS   rW   r`   rw   r   r$   r%   r&   <module>r      s   
 D C C C C C C C $ $ $ $ $ $ F F F F F F F F F F # # # # # # 8 8 8 8 8 8 8 8 8 8       ( ( ( ( ( ( ( ( ( (P P P P P#Z P P P 
c c c c c c c 
c 
; ; ; ; ; ; ; 
; 
; ; ; ; ; ; ; 
; 
? ? ? ? ?L ? ? 
?
8 8 8 8 8j 8 8 8$ 
K K K K K7 K K 
K 
O O O O Ow O O 
O 
L L L L LG L L 
L 
K K K K Kw K K 
K 
%N %N %N %N %N7 %N %N 
%NP 
    t   
 
    t   
  r%   