o
    h                     @  s   d dl mZ d dlmZmZ 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 er4ddlmZ g d	ZG d
d deZG dd deZeeedf ZG dd deZG dd deZG dd deZdddZdS )    )annotations)ABCabstractmethod)Enum)TYPE_CHECKINGAnyCallableUnion)EditingMode)	InputMode   )Application)CursorShapeCursorShapeConfigSimpleCursorShapeConfigModalCursorShapeConfigDynamicCursorShapeConfigto_cursor_shape_configc                   @  s(   e Zd ZdZdZdZdZdZdZdZ	dS )	r   _NEVER_CHANGEBLOCKBEAM	UNDERLINEBLINKING_BLOCKBLINKING_BEAMBLINKING_UNDERLINEN)
__name__
__module____qualname__r   r   r   r   r   r   r    r   r   ^/var/www/html/optinet_system/venv/lib/python3.10/site-packages/prompt_toolkit/cursor_shapes.pyr      s    	r   c                   @  s   e Zd ZedddZdS )	r   applicationApplication[Any]returnr   c                 C  s   dS )zJ
        Return the cursor shape to be used in the current state.
        Nr   selfr    r   r   r   get_cursor_shape+   s    z"CursorShapeConfig.get_cursor_shapeNr    r!   r"   r   )r   r   r   r   r%   r   r   r   r   r   *   s    r   Nc                   @  s*   e Zd ZdZejfdddZdd
dZdS )r   z-
    Always show the given cursor shape.
    cursor_shaper   r"   Nonec                 C  
   || _ d S Nr'   )r$   r'   r   r   r   __init__:   s   
z SimpleCursorShapeConfig.__init__r    r!   c                 C  s   | j S r*   r+   r#   r   r   r   r%   =   s   z(SimpleCursorShapeConfig.get_cursor_shapeN)r'   r   r"   r(   r&   )r   r   r   __doc__r   r   r,   r%   r   r   r   r   r   5   s    r   c                   @  s   e Zd ZdZd	ddZdS )
r   z@
    Show cursor shape according to the current input mode.
    r    r!   r"   r   c                 C  st   |j tjkr.|jjtjhv rtjS |jjtj	tj
hv rtjS |jjtjtjhv r+tjS tjS |j tjkr7tjS tjS r*   )editing_moder
   VIvi_state
input_moder   
NAVIGATIONr   r   INSERTINSERT_MULTIPLEr   REPLACEREPLACE_SINGLEr   EMACSr#   r   r   r   r%   F   s&   z'ModalCursorShapeConfig.get_cursor_shapeNr&   )r   r   r   r-   r%   r   r   r   r   r   A   s    r   c                   @  s    e Zd ZdddZdd
dZdS )r   get_cursor_shape_config"Callable[[], AnyCursorShapeConfig]r"   r(   c                 C  r)   r*   )r8   )r$   r8   r   r   r   r,   _   s   
z!DynamicCursorShapeConfig.__init__r    r!   r   c                 C  s   t |  |S r*   )r   r8   r%   r#   r   r   r   r%   d   s   z)DynamicCursorShapeConfig.get_cursor_shapeN)r8   r9   r"   r(   r&   )r   r   r   r,   r%   r   r   r   r   r   ^   s    
r   valueAnyCursorShapeConfigr"   c                 C  s$   | du rt  S t| trt | S | S )zj
    Take a `CursorShape` instance or `CursorShapeConfig` and turn it into a
    `CursorShapeConfig`.
    N)r   
isinstancer   )r:   r   r   r   r   j   s
   
r   )r:   r;   r"   r   )
__future__r   abcr   r   enumr   typingr   r   r   r	   prompt_toolkit.enumsr
   #prompt_toolkit.key_binding.vi_stater   r    r   __all__r   r   r;   r   r   r   r   r   r   r   r   <module>   s     
