+
    Ri'                       a  0 t $ ^ RIHt ^ RIHt ^ RIHtHt ^ RIH	t	 ^ RI
Ht ^ RIHt ]'       d   ^RIHt RR	.t ! R
 R	4      t]	! ]RR7      tR]R&   Rt ! R R4      t ! R R4      tR# )    )annotationsdefaultdict)TYPE_CHECKINGCallable)FastDictCache)Point)
get_cwidth)WindowScreenCharc                     ] tR t^t$ RtRt/ RRbRRbRRbRR	bR
RbRRbRRbRRbRRbRRbRRbRRbRRbRRbRRbR R!bR"R#b/ R$R%bR&R'bR(R)bR*R+bR,R-bR.R/bR0R1bR2R3bR4R5bR6R7bR8R9bR:R;bR<R=bR>R?bR@RAbRBRCbRDREbC/ RFRGbRHRIbRJRKbRLRMbRNRObRPRQbRRRSbRTRUbRVRWbRXRYbRZR[bR\R]bR^R_bR`RabRbRcbRdRebRfRgbCRhRiRjRkRlRmRnRoRpRqRrRsRtRuRvRwRxRyRzR{R|R}R~RRRRRRR/CtR]R&   RR R lltR R lt	R R lt
]'       g   ]	t]
tR R ltRtR# )r   z
Represent a single character in a :class:`.Screen`.

This should be considered immutable.

:param char: A single character (can be a double-width character).
:param style: A style string. (Can contain classnames.)
 z^@z^Az^Bz^Cz^Dz^Ez^Fz^Gz^H	z^I
z^Jz^Kz^Lz^Mz^Nz^Oz^Pz^Qz^Rz^Sz^Tz^Uz^Vz^Wz^Xz^Yz^Zz^[z^\z^]z^^z^_z^?   z<80>   z<81>   z<82>   z<83>   z<84>   z<85>   z<86>   z<87>   z<88>   z<89>   z<8a>   z<8b>   z<8c>   z<8d>   z<8e>   z<8f>   z<90>   z<91>   z<92>   z<93>   z<94>   z<95>   z<96>   z<97>   z<98>   z<99>   z<9a>   z<9b>   z<9c>   z<9d>   z<9e>   z<9f>     zdict[str, str]display_mappingsc               $    V ^8  d   QhRRRRRR/# )   charstrstylereturnNone )formats   "[/home/ubuntu/hermes-agent/venv/lib/python3.14/site-packages/prompt_toolkit/layout/screen.py__annotate__Char.__annotate__l   s!     & &S &s &D &    c                	    WP                   9   d.   VR 8X  d   VR,          pM	VR,          pV P                   V,          pWn        W n        \        V4      V n        R# )rP   z class:nbsp z class:control-character N)rR   rU   rW   r
   width)selfrU   rW   s   &&&r\   __init__Char.__init__l   sR    (((v~'44((.D	
  %
r_   c                    V ^8  d   QhRRRR/# rT   otherr   rX   boolrZ   )r[   s   "r\   r]   r^      s     E ED ET Er_   c                	v    V P                   VP                   8H  ;'       d    V P                  VP                  8H  # NrU   rW   rb   rg   s   &&r\   _equalChar._equal   s*    yyEJJ&DD4::+DDr_   c                    V ^8  d   QhRRRR/# rf   rZ   )r[   s   "r\   r]   r^      s     D D D Dr_   c                	v    V P                   VP                   8g  ;'       g    V P                  VP                  8g  # rj   rk   rl   s   &&r\   
_not_equalChar._not_equal   s,     yyEJJ&CC$***CCr_   c                   V ^8  d   QhRR/# rT   rX   rV   rZ   )r[   s   "r\   r]   r^      s     K K# Kr_   c                	l    V P                   P                   R V P                  : RV P                  : R2# )(z, ))	__class____name__rU   rW   rb   s   &r\   __repr__Char.__repr__   s.    ..))*!DII=4::.JJr_   )rU   rW   ra   N)rQ    )ry   
__module____qualname____firstlineno____doc__	__slots__rR   __annotations__rc   rm   rq   r   __eq____ne__r{   __static_attributes__rZ   r_   r\   r   r      s^    +I
G(G(G( 	G( 		G(
 	G( 	G( 	G( 	G( 	G( 	G( 	G( 	G( 	G( 	G( 	G(  	!G(" 	#G($ 	%G(& 	'G(( 	)G(* 	+G(, 	-G(. 	/G(0 	1G(2 	3G(4 	5G(6 	7G(8 	9G(: 	;G(< 	=G(> 	?G(@ 	AG(B 	CG(F 	GG(H 	IG(J 	KG(L 	MG(N 	OG(P 	QG(R 	SG(T 	UG(V 	WG(X 	YG(Z 	[G(\ 	]G(^ 	_G(` 	aG(b 	cG(d 	eG(f 	gG(h 	iG(j 	 	MG(n GR&(ED
 K Kr_   )sizez$FastDictCache[tuple[str, str], Char]_CHAR_CACHEz[transparent]c                      ] tR t^tRtRR R llt]R R l4       tR R ltR	 R
 lt	R R lt
R R ltR R ltR R ltR R ltRR R lltRtR# )r   z5
Two dimensional buffer of :class:`.Char` instances.
Nc               (    V ^8  d   QhRRRRRRRR/# )rT   default_charzChar | Noneinitial_widthintinitial_heightrX   rY   rZ   )r[   s   "r\   r]   Screen.__annotate__   s8     .N .N!.N .N 	.N
 
.Nr_   c                	  a Vf   \         R\        3,          oMVo\        V3R l4      V n        \        R 4      V n        / V n        RV n        / V n        T;'       g    ^ V n        T;'       g    ^ V n	        / V n
        . V n        R # )NrQ   c                 "   < \        V 3R  l4      # )c                    < S # rj   rZ   default_char2s   r\   <lambda>3Screen.__init__.<locals>.<lambda>.<locals>.<lambda>   s    r_   r   r   s   r\   r   !Screen.__init__.<locals>.<lambda>   s    K 56r_   c                      \        \        4      # rj   )r   rV   rZ   r_   r\   r   r      s	    K$r_   T)r   Transparentr   data_bufferzero_width_escapescursor_positionsshow_cursormenu_positionsra   height"visible_windows_to_write_positions_draw_float_functions)rb   r   r   r   r   s   &&&&@r\   rc   Screen.__init__   s     '[(89M(MEP6F

 LW$L
  	
    	 #''a
$)) PR/ LN"r_   c                   V ^8  d   QhRR/# )rT   rX   zlist[Window]rZ   )r[   s   "r\   r]   r      s     D D Dr_   c                	H    \        V P                  P                  4       4      # rj   )listr   keysrz   s   &r\   visible_windowsScreen.visible_windows   s    D;;@@BCCr_   c               $    V ^8  d   QhRRRRRR/# rT   windowr   positionr	   rX   rY   rZ   )r[   s   "r\   r]   r      s!     1 1& 1E 1d 1r_   c                "    W P                   V&   R# z-
Set the cursor position for a given window.
N)r   rb   r   r   s   &&&r\   set_cursor_positionScreen.set_cursor_position   s     )1f%r_   c               $    V ^8  d   QhRRRRRR/# r   rZ   )r[   s   "r\   r]   r      s!     / / /% /D /r_   c                "    W P                   V&   R# r   )r   r   s   &&&r\   set_menu_positionScreen.set_menu_position   s     '/F#r_   c                    V ^8  d   QhRRRR/# rT   r   r   rX   r	   rZ   )r[   s   "r\   r]   r      s     # #& #U #r_   c                f     V P                   V,          #   \         d    \        ^ ^ R7      u # i ; i)z@
Get the cursor position for a given window.
Returns a `Point`.
xy)r   KeyErrorr	   rb   r   s   &&r\   get_cursor_positionScreen.get_cursor_position   s3    
	#((00 	#1?"	#s    00c                    V ^8  d   QhRRRR/# r   rZ   )r[   s   "r\   r]   r      s     ' ' '5 'r_   c                     V P                   V,          #   \         d8     T P                  T,          u #   \         d    \        ^ ^ R7      u u # i ; ii ; i)zq
Get the menu position for a given window.
(This falls back to the cursor position if no menu position was set.)
r   )r   r   r   r	   r   s   &&r\   get_menu_positionScreen.get_menu_position   sX    
	'&&v.. 	'',,V44 'qA&'	's)    A6AAAAAc               $    V ^8  d   QhRRRRRR/# )rT   z_indexr   	draw_funczCallable[[], None]rX   rY   rZ   )r[   s   "r\   r]   r      s(     @ @ @9K @PT @r_   c                >    V P                   P                  W34       R# )zx
Add a draw-function for a `Window` which has a >= 0 z_index.
This will be postponed until `draw_all_floats` is called.
N)r   append)rb   r   r   s   &&&r\   draw_with_z_indexScreen.draw_with_z_index   s    
 	""))7*>?r_   c                   V ^8  d   QhRR/# )rT   rX   rY   rZ   )r[   s   "r\   r]   r      s       r_   c                    V P                   '       d>   \        V P                   R R7      pVR,          V n         V^ ,          ^,          ! 4        KO  R# )z/
Draw all float functions in order of z-index.
c                    V ^ ,          # )r   rZ   )items   &r\   r   (Screen.draw_all_floats.<locals>.<lambda>  s	    DQRGr_   )key:   NNN)r   sorted)rb   	functionss   & r\   draw_all_floatsScreen.draw_all_floats   sD     (((t99?STI *32D&aLO )r_   c                    V ^8  d   QhRRRR/# )rT   	style_strrV   rX   rY   rZ   )r[   s   "r\   r]   r     s     J J J Jr_   c                    V P                   p\        pRV,           pVP                  4        FE  w  rVVP                  4        F,  w  rxW8P                  VP                  V,           3,          Wg&   K.  	  KG  	  R# )zV
For all the characters in the screen.
Set the style string to the given `style_str`.
rQ   N)r   r   itemsrU   rW   )	rb   r   b
char_cacheappend_styler   rowr   rU   s	   &&       r\   append_style_to_contentScreen.append_style_to_content  s]    
  
YggiFA99;#IItzzL/H$HI '  r_   c               (    V ^8  d   QhRRRRRRRR/# )	rT   write_positionWritePositionrW   rV   afterrh   rX   rY   rZ   )r[   s   "r\   r]   r     s,      +47EI	r_   c                   VP                  4       '       g   R# VP                  pVP                  VP                  ,           p\        pV P                  pV'       d   RV,           pRp	MRpVR,           p	\        VP                  VP                  VP                  ,           4       FS  p
Wz,          p\        WE4       F9  pW,          pVVP                  WP                  ,           V,           3,          W&   K;  	  KU  	  R# )zq
Fill the content of this area, using the given `style`.
The style is prepended before whatever was here before.
NrQ   r}   )
stripxposra   r   r   rangeyposr   rU   rW   )rb   r   rW   r   xminxmaxr   r   r   prepend_styler   r   r   cells   &&&&          r\   	fill_areaScreen.fill_area  s     {{}}""""^%9%99 
&&;LML!CKM!4!4~7L7L!L
A .C4&v#II}zz9LHH '	
r_   )	r   r   r   r   r   r   r   ra   r   )Nr   r   )r}   F)ry   r~   r   r   r   rc   propertyr   r   r   r   r   r   r   r   r   r   rZ   r_   r\   r   r      sS    .N` D D1/#'@J r_   c                  .    ] tR tRtR R ltR R ltRtR# )r   i7  c          
     ,    V ^8  d   QhRRRRRRRRRR/# )rT   r   r   r   ra   r   rX   rY   rZ   )r[   s   "r\   r]   WritePosition.__annotate__8  s/      S  C   r_   c                	Z    V^ 8  g   Q hV^ 8  g   Q hWn         W n        W0n        W@n        R# )r   N)r   r   ra   r   )rb   r   r   ra   r   s   &&&&&r\   rc   WritePosition.__init__8  s0    {{zz 		
r_   c                   V ^8  d   QhRR/# rt   rZ   )r[   s   "r\   r]   r   B  s     | |# |r_   c           
     	    V P                   P                   R V P                  : RV P                  : RV P                  : RV P
                  : R2
# )z(x=z, y=z, width=z	, height=rw   )rx   ry   r   r   ra   r   rz   s   &r\   r{   WritePosition.__repr__B  sL    ..))*#dii]$tyym8TXT^T^Saajkokvkvjyyz{{r_   )r   ra   r   r   N)ry   r~   r   r   rc   r{   r   rZ   r_   r\   r   r   7  s    | |r_   r   Ni@B )__conditional_annotations__
__future__r   collectionsr   typingr   r   prompt_toolkit.cacher   prompt_toolkit.data_structuresr	   prompt_toolkit.utilsr
   
containersr   __all__r   r   r   r   r   r   )r   s   @r\   <module>r     sy    " " # * . 0 +" 
yK yKx 5B{51  ^ ^B| |r_   