o
    ˷e                     @   s  U d Z ddlmZmZmZ ddlmZmZmZm	Z	m
Z
mZmZ g dZG dd de
Z	 edddddddddd		Zg d
Zddddddddddd
Zeeef ed< ee ees_J ee ee@ rkJ G dd dedZG dd deZG dd deZdS )z#
The base classes for the styling.
    )ABCMetaabstractmethodabstractproperty)CallableDictHashableList
NamedTupleOptionalTuple)AttrsDEFAULT_ATTRSANSI_COLOR_NAMESANSI_COLOR_NAMES_ALIASES	BaseStyle
DummyStyleDynamicStylec                   @   sz   e Zd ZU ee ed< ee ed< ee ed< ee ed< ee ed< ee ed< ee ed< ee ed< ee ed	< d
S )r   colorbgcolorbold	underlinestrikeitalicblinkreversehiddenN)__name__
__module____qualname__r
   str__annotations__bool r"   r"   Q/var/www/ideatree/venv/lib/python3.10/site-packages/prompt_toolkit/styles/base.pyr      s   
 r    F)	r   r   r   r   r   r   r   r   r   )ansidefault	ansiblackansired	ansigreen
ansiyellowansiblueansimagentaansicyanansigrayansibrightblackansibrightredansibrightgreenansibrightyellowansibrightblueansibrightmagentaansibrightcyan	ansiwhiter.   r,   r4   r)   r+   r3   r-   r'   r(   r*   )
ansidarkgrayansitealansiturquoise	ansibrown
ansipurpleansifuchsiaansilightgrayansidarkredansidarkgreenansidarkbluer   c                   @   s^   e Zd ZdZeefdededefddZe	de
eeef  fddZedefd	d
ZdS )r   z8
    Abstract base class for prompt_toolkit styles.
    	style_strdefaultreturnc                 C      dS )a  
        Return :class:`.Attrs` for the given style string.

        :param style_str: The style string. This can contain inline styling as
            well as classnames (e.g. "class:title").
        :param default: `Attrs` to be used if no styling was defined.
        Nr"   selfr@   rA   r"   r"   r#   get_attrs_for_style_stro       z!BaseStyle.get_attrs_for_style_strc                 C      g S )z
        The list of style rules, used to create this style.
        (Required for `DynamicStyle` and `_MergedStyle` to work.)
        r"   rE   r"   r"   r#   style_rules{   s   zBaseStyle.style_rulesc                 C   rC   )z
        Invalidation hash for the style. When this changes over time, the
        renderer knows that something in the style changed, and that everything
        has to be redrawn.
        Nr"   rI   r"   r"   r#   invalidation_hash   rG   zBaseStyle.invalidation_hashN)r   r   r   __doc__r   r   r   r   rF   r   r   r   rJ   r   rK   r"   r"   r"   r#   r   j   s    r   )	metaclassc                   @   sV   e Zd ZdZefdededefddZdefddZ	e
deeeef  fd	d
ZdS )r   z.
    A style that doesn't style anything.
    r@   rA   rB   c                 C   s   |S Nr"   rD   r"   r"   r#   rF      s   z"DummyStyle.get_attrs_for_style_strc                 C   rC   )N   r"   rI   r"   r"   r#   rK      s   zDummyStyle.invalidation_hashc                 C   rH   rN   r"   rI   r"   r"   r#   rJ      s   zDummyStyle.style_rulesN)r   r   r   rL   r   r   r   rF   r   rK   propertyr   r   rJ   r"   r"   r"   r#   r      s    
 r   c                   @   sp   e Zd ZdZdeg ee f fddZefde	de
de
fdd	Zdefd
dZedeee	e	f  fddZdS )r   z
    Style class that can dynamically returns an other Style.

    :param get_style: Callable that returns a :class:`.Style` instance.
    	get_stylec                 C   s   || _ t | _d S rN   )rQ   r   _dummy)rE   rQ   r"   r"   r#   __init__   s   zDynamicStyle.__init__r@   rA   rB   c                 C   s   |   p| j}|||S rN   )rQ   rR   rF   )rE   r@   rA   styler"   r"   r#   rF      s   z$DynamicStyle.get_attrs_for_style_strc                 C   s   |   p| j S rN   )rQ   rR   rK   rI   r"   r"   r#   rK      s   zDynamicStyle.invalidation_hashc                 C   s   |   p| jjS rN   )rQ   rR   rJ   rI   r"   r"   r#   rJ      s   zDynamicStyle.style_rulesN)r   r   r   rL   r   r
   r   rS   r   r   r   rF   r   rK   rP   r   r   rJ   r"   r"   r"   r#   r      s    
 r   N)rL   abcr   r   r   typingr   r   r   r   r	   r
   r   __all__r   r   r   r   r   r    setvaluesissubsetkeysr   r   r   r"   r"   r"   r#   <module>   sD    $"