+
    Ri(                       R t ^ RIHt ^ RIHtHt ^ RIHtHt ^ RI	H
t
Ht ^ RIHtHtHt ^ RIHt ^RIHt ]'       d   ^RIHt . ROt ! R R	]R7      t ! R R
]4      t ! R R]4      t ! R R]4      t ! R R]4      tR# )zQ
Margin implementations for a :class:`~prompt_toolkit.layout.containers.Window`.
)annotations)ABCMetaabstractmethod)TYPE_CHECKINGCallable)FilterOrBool	to_filter)StyleAndTextTuplesfragment_list_to_textto_formatted_text)
get_cwidth)	UIContent)WindowRenderInfoMarginNumberedMarginScrollbarMarginConditionalMarginPromptMarginc                  F    ] tR t^ tRt]R R l4       t]R R l4       tRtR# )r   z
Base interface for a margin.
c                    V ^8  d   QhRRRR/#    get_ui_contentzCallable[[], UIContent]returnint )formats   "\/home/ubuntu/hermes-agent/venv/lib/python3.14/site-packages/prompt_toolkit/layout/margins.py__annotate__Margin.__annotate__&   s      (? C     c                    ^ # )z
Return the width that this margin is going to consume.

:param get_ui_content: Callable that asks the user control to create
    a :class:`.UIContent` instance. This can be used for instance to
    obtain the number of lines.
r   selfr   s   &&r   	get_widthMargin.get_width%   s     r    c               (    V ^8  d   QhRRRRRRRR/# r   window_render_infor   widthr   heightr   r	   r   )r   s   "r   r   r   1   s,      "2;>HK	r    c                    . # )aS  
Creates a margin.
This should return a list of (style_str, text) tuples.

:param window_render_info:
    :class:`~prompt_toolkit.layout.containers.WindowRenderInfo`
    instance, generated after rendering and copying the visible part of
    the :class:`~prompt_toolkit.layout.controls.UIControl` into the
    :class:`~prompt_toolkit.layout.containers.Window`.
:param width: The width that's available for this margin. (As reported
    by :meth:`.get_width`.)
:param height: The height that's available for this margin. (The height
    of the :class:`~prompt_toolkit.layout.containers.Window`.)
r   r#   r(   r)   r*   s   &&&&r   create_marginMargin.create_margin0   s	    $ 	r    r   N)	__name__
__module____qualname____firstlineno____doc__r   r$   r-   __static_attributes__r   r    r   r   r       s/        r    )	metaclassc                  B    ] tR t^EtRtR
R R lltR R ltR R ltRtR	# )r   z
Margin that displays the line numbers.

:param relative: Number relative to the cursor position. Similar to the Vi
                 'relativenumber' option.
:param display_tildes: Display tildes after the end of the document, just
    like Vi does.
c               $    V ^8  d   QhRRRRRR/# )r   relativer   display_tildesr   Noner   )r   s   "r   r   NumberedMargin.__annotate__O   s$     8 8$8>J8	8r    c                	F    \        V4      V n        \        V4      V n        R # N)r   r8   r9   )r#   r8   r9   s   &&&r   __init__NumberedMargin.__init__O   s     "(+'7r    c                    V ^8  d   QhRRRR/# r   r   )r   s   "r   r   r;   U   s     0 0(? 0C 0r    c                	^    V! 4       P                   p\        ^\        V 4      ^,           4      # )   )
line_countmaxlen)r#   r   rC   s   && r   r$   NumberedMargin.get_widthU   s)    #%00
1cZL*Q.//r    c               (    V ^8  d   QhRRRRRRRR/# r'   r   )r   s   "r   r   r;   Y   s,     - -"2-;>-HK-	-r    c                	   V P                  4       pR pRpVP                  P                  P                  p. pRp	\	        VP
                  4       F  w  rW8w  d   Vf   MW8X  d\   V'       d#   VP                  VRV^,           ,          34       MVP                  VRV^,           ,          P                  V4      34       MPV'       d   \        W,
          4      ^,
          pVP                  VRV^,           ,          P                  V4      34       Tp	VP                  R4       K  	  V P                  4       '       d.   X
VP                  8  d   VP                  R4       V
^,          p
K-  V# )zclass:line-numberzclass:line-number.currentNz%iz%i  
)zclass:tildez~
)r8   
ui_contentcursor_positiony	enumeratedisplayed_linesappendrjustabsr9   window_height)r#   r(   r)   r*   r8   stylestyle_currentcurrent_linenoresultlast_linenorN   linenos   &&&&        r   r-   NumberedMargin.create_marginY   s8    ==?#3 ,66FFHH &("#5#E#EFIA$>-}dfqj6I&JK*Ufqj-A,H,H,OP
  !$V%<!=!AMM55FQJ+?*F*Fu*M"NO KMM*%- G2   (66645Qr    )r9   r8   N)FF	r/   r0   r1   r2   r3   r>   r$   r-   r4   r   r    r   r   r   E   s    80- -r    c                  >    ] tR t^tRtR R ltR R ltR R ltRtR	# )
r   zB
Wrapper around other :class:`.Margin` classes to show/hide them.
c               $    V ^8  d   QhRRRRRR/# )r   marginr   filterr   r   r:   r   )r   s   "r   r   ConditionalMargin.__annotate__   s!     ( (v (| ( (r    c                	2    Wn         \        V4      V n        R # r=   )r_   r   r`   )r#   r_   r`   s   &&&r   r>   ConditionalMargin.__init__   s    'r    c                    V ^8  d   QhRRRR/# r   r   )r   s   "r   r   ra      s      (? C r    c                	h    V P                  4       '       d   V P                  P                  V4      # ^ # )    )r`   r_   r$   r"   s   &&r   r$   ConditionalMargin.get_width   s%    ;;==;;((88r    c               (    V ^8  d   QhRRRRRRRR/# r'   r   )r   s   "r   r   ra      s,      "2;>HK	r    c                	z    V'       d3   V P                  4       '       d   V P                  P                  WV4      # . # r=   )r`   r_   r-   r,   s   &&&&r   r-   ConditionalMargin.create_margin   s.     T[[]];;,,-?OOIr    )r`   r_   Nr\   r   r    r   r   r      s    ( r    c                  B    ] tR t^tRtR
R R lltR R ltR R ltRtR	# )r   zW
Margin displaying a scrollbar.

:param display_arrows: Display scroll up/down arrows.
c               (    V ^8  d   QhRRRRRRRR/# )r   display_arrowsr   up_arrow_symbolstrdown_arrow_symbolr   r:   r   )r   s   "r   r   ScrollbarMargin.__annotate__   s2     3 3$3 3 	3
 
3r    c                	>    \        V4      V n        W n        W0n        R # r=   )r   rm   rn   rp   )r#   rm   rn   rp   s   &&&&r   r>   ScrollbarMargin.__init__   s     (7.!2r    c                    V ^8  d   QhRRRR/# r   r   )r   s   "r   r   rq      s      (? C r    c                	    ^# )   r   r"   s   &&r   r$   ScrollbarMargin.get_width   s    r    c               (    V ^8  d   QhRRRRRRRR/# r'   r   )r   s   "r   r   rq      s,     ? ?"2?;>?HK?	?r    c           
     	  aa VP                   pVP                  pV P                  4       pV'       d
   V^,          p \        VP                  4      \        V4      ,          pVP                  \        V4      ,          p\        \        V\        ^WW,          4      4      4      o\        WX,          4      oR VV3R llp	. p
V'       d    V
P                  RV P                  3R	.4       RpRpRpRp\        V4       F  pV	! V4      '       d>   V	! V^,           4      '       g   V
P                  VR34       MPV
P                  VR34       M<V	! V^,           4      '       d   V
P                  VR34       MV
P                  VR34       V
P                  R
4       K  	  V'       d   V
P                  RV P                  34       V
#   \         d    . u # i ; i)r   c                    V ^8  d   QhRRRR/# )r   rowr   r   boolr   )r   s   "r   r   3ScrollbarMargin.create_margin.<locals>.__annotate__   s     P Pc Pd Pr    c                >   < ST u;8*  ;'       d    SS,           8*  # u # )z/True if we should display a button on this row.r   )r{   scrollbar_heightscrollbar_tops   &r   is_scroll_button7ScrollbarMargin.create_margin.<locals>.is_scroll_button   s"    $OO}?O/OOOOOr    zclass:scrollbar.arrowzclass:scrollbar.backgroundz*class:scrollbar.background,scrollbar.startzclass:scrollbar.buttonz$class:scrollbar.button,scrollbar.end )zclass:scrollbarrK   rI   )content_heightrT   rm   rE   rP   floatvertical_scrollr   minrD   extendrn   rangerQ   rp   ZeroDivisionError)r#   r(   r)   r*   r   rT   rm   fraction_visiblefraction_abover   rX   scrollbar_backgroundscrollbar_background_startscrollbar_buttonscrollbar_button_endir   r   s   &&&&            @@r   r-   ScrollbarMargin.create_margin   s    ,::*88,,.QM5	"#5#E#EFJ   0??%BWWN"M3q-*J#KL    >?M
P P
 *,F0$2F2FG1 $@ )U&7#I =)#A&&+AE22 ';S&AB'7&=>'A..'A3&GH';S&ABj) *  68N8NOPMW ! 	I	s   A7G   GG)rm   rp   rn   N)F^vr\   r   r    r   r   r      s    3? ?r    c                  B    ] tR t^tRtR
R R lltR R ltR R ltR	tR# )r   ab  
[Deprecated]

Create margin that displays a prompt.
This can display one prompt at the first line, and a continuation prompt
(e.g, just dots) on all the following lines.

This `PromptMargin` implementation has been largely superseded in favor of
the `get_line_prefix` attribute of `Window`. The reason is that a margin is
always a fixed width, while `get_line_prefix` can return a variable width
prefix in front of every line, making it more powerful, especially for line
continuations.

:param get_prompt: Callable returns formatted text or a list of
    `(style_str, type)` tuples to be shown as the prompt at the first line.
:param get_continuation: Callable that takes three inputs. The width (int),
    line_number (int), and is_soft_wrap (bool). It should return formatted
    text or a list of `(style_str, type)` tuples for the next lines of the
    input.
Nc               $    V ^8  d   QhRRRRRR/# )r   
get_promptz Callable[[], StyleAndTextTuples]get_continuationz5None | Callable[[int, int, bool], StyleAndTextTuples]r   r:   r   )r   s   "r   r   PromptMargin.__annotate__  s(     1 141;1
 
1r    c                	    Wn         W n        R # r=   )r   r   )r#   r   r   s   &&&r   r>   PromptMargin.__init__  s     % 0r    c                    V ^8  d   QhRRRR/# r   r   )r   s   "r   r   r     s        (?  C  r    c                J    \        V P                  4       4      p\        V4      # )z Width to report to the `Window`.)r
   r   r   )r#   r   texts   && r   r$   PromptMargin.get_width  s      %T__%67$r    c               (    V ^8  d   QhRRRRRRRR/# r'   r   )r   s   "r   r   r     s,      "2;>HK	r    c                	&   V P                   p. pVP                  \        V P                  4       4      4       V'       dS   R pVP                  R,           F9  pVP                  R4       VP                  \        V! W'Wv8H  4      4      4       TpK;  	  V# )N:rv   NNrI   )r   r   r   r   rP   rQ   )r#   r(   r)   r*   r   rX   last_yrN   s   &&&&    r   r-   PromptMargin.create_margin  s      00%' 	'(9:; F'77;;j)%&6u&MN  < r    )r   r   r=   r\   r   r    r   r   r      s    *1  r    N)r   r   r   r   r   )r3   
__future__r   abcr   r   typingr   r   prompt_toolkit.filtersr   r   prompt_toolkit.formatted_textr	   r
   r   prompt_toolkit.utilsr   controlsr   
containersr   __all__r   r   r   r   r   r   r    r   <module>r      sz    # ' * : 
 , ,"w "JAV AH 0Sf Sl96 9r    