+
    iL;                      a  0 t $ ^ RIHt ^ RIt^ RIHtHtHt ^ RIH	t	 ^ RI
HtHtHtHtHtHtHtHtHt ^RIHt ^RIHtHtHtHtHt ^RIHt ^R	IHt ^R
I H!t! ^RI"H#t#H$t$ ^RI%H&t& ^RI'H(t( ]'       d   ^ RI)H*t*  ! R R]4      t+ ! R R]!]4      t,]-R8X  EdI   ^ RI.t.^ RI/t/^ RI0H1t1 ^ RI
H2t2HtH3t3 ^RI4H5t5 ^RIHt ^RI6H,t, ^RI7H8t8 ^RI9H:t: ^RI;H<t< ^RI=H>t> ]! 4       t]<! RRRR 7      t;]>! R!R"R#4      t=]=P                  R$R%R&4       R']8! R(4      R)]=R*R+R,R-R./R/];]:! R04      .	t@]1! ]@4      tA. R@OtB],! ]R17      ;_uu_ 4       tC/ tDR2]ER3&   ]F! ^d4       EF  tG]B]G]H! ]B4      ,          ,          tI]B EF_  tJ]J]I8X  d   K  ]/P                  ! R44       ].P                  ! ^ ^
4      ^8  d   ]P                  ]N! ]A4      4       ^].P\                  ! 4       R5,          ^,           ,          ]D]I]J3&   ]H! ]D4      ]H! ]B4      ^,
          8  d-   ]DP                  ]P! ]DP                  4       4      ^ ,          4       ]>! R6R77      t=]=P                  R84       ]=P                  R94       ]=P                  R:4       ]DP                  4        F/  w  w  tTtUtV]=P                  ]T]U](! ]VR; ]VR<8  d   R=MR>R?7      4       K1  	  ]CP                  ]5P                  ! ]=4      4       EKb  	  EK  	  RRR4       R# R#   + '       g   i     R# ; i)A    )annotationsN)EventRLockThread)TracebackType)	IOTYPE_CHECKINGAnyCallableListOptionalTextIOTypecast)get_console)ConsoleConsoleRenderableGroupRenderableType
RenderHook)Control)	FileProxy)JupyterMixin)
LiveRenderVerticalOverflowMethod)Screen)Text)Selfc                  J   a  ] tR t^tRtR V 3R lltR R ltR R ltRtV ;t	# )	_RefreshThreadz3A thread that calls refresh() at regular intervals.c               $    V ^8  d   QhRRRRRR/# )   livez'Live'refresh_per_secondfloatreturnNone )formats   "\/home/wkmabra/.openclaw/workspace/venv/lib/python3.14/site-packages/pip/_vendor/rich/live.py__annotate___RefreshThread.__annotate__   s!     & &V & &4 &    c                	^   < Wn         W n        \        4       V n        \        SV `  R R7       R# )T)daemonN)r#   r$   r   donesuper__init__)selfr#   r$   	__class__s   &&&r*   r2   _RefreshThread.__init__   s'    	"4G	%r-   c                   V ^8  d   QhRR/# r"   r&   r'   r(   )r)   s   "r*   r+   r,      s      d r-   c                	:    V P                   P                  4        R # N)r0   setr3   s   &r*   stop_RefreshThread.stop   s    		r-   c                   V ^8  d   QhRR/# r7   r(   )r)   s   "r*   r+   r,   "   s     ( (T (r-   c                	X   V P                   P                  ^V P                  ,          4      '       gd   V P                  P                  ;_uu_ 4        V P                   P                  4       '       g   V P                  P                  4        RRR4       K  R#   + '       g   i     K  ; i)   N)r0   waitr$   r#   _lockis_setrefreshr;   s   &r*   run_RefreshThread.run"   sd    ))..T%<%<!<==yy''))II%%' ! > s   ;BB)	)r0   r#   r$   )
__name__
__module____qualname____firstlineno____doc__r2   r<   rE   __static_attributes____classcell__)r4   s   @r*   r    r       s    =& &( (r-   r    c                     ] tR t^)tRtR+RRRRRRR^R	RR
RRRRRRR/	R R lllt]R R l4       tR R ltR,R R l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4       tR#R/R$ R% lltR& R' ltR( R) ltR*tR# )-Livea  Renders an auto-updating live display of any given renderable.

Args:
    renderable (RenderableType, optional): The renderable to live display. Defaults to displaying nothing.
    console (Console, optional): Optional Console instance. Defaults to an internal Console instance writing to stdout.
    screen (bool, optional): Enable alternate screen mode. Defaults to False.
    auto_refresh (bool, optional): Enable auto refresh. If disabled, you will need to call `refresh()` or `update()` with refresh flag. Defaults to True
    refresh_per_second (float, optional): Number of times per second to refresh the live display. Defaults to 4.
    transient (bool, optional): Clear the renderable on exit (has no effect when screen=True). Defaults to False.
    redirect_stdout (bool, optional): Enable redirection of stdout, so ``print`` may be used. Defaults to True.
    redirect_stderr (bool, optional): Enable redirection of stderr. Defaults to True.
    vertical_overflow (VerticalOverflowMethod, optional): How to handle renderable when it is too tall for the console. Defaults to "ellipsis".
    get_renderable (Callable[[], RenderableType], optional): Optional callable to get renderable. Defaults to None.
NconsolescreenFauto_refreshTr$   	transientredirect_stdoutredirect_stderrvertical_overflowellipsisget_renderablec               D    V ^8  d   QhRRRRRRRRRR	R
RRRRRRRRRRR/# )r"   
renderablezOptional[RenderableType]rP   zOptional[Console]rQ   boolrR   r$   r%   rS   rT   rU   rV   r   rX   z&Optional[Callable[[], RenderableType]]r&   r'   r(   )r)   s   "r*   r+   Live.__annotate__9   sx     ' ',' #	'
 ' ' "' ' ' ' 2' ?' 
'r-   c       	        	   V^ 8  g   Q R4       hWn         Ve   TM	\        4       V n        W0n        RV n        Wpn        Wn        RV n        RV n        \        4       V n
        RV n        W@n        RV n        V'       d   RMTV n        RV n        WPn        Wn        Wn        \'        V P)                  4       V	R7      V n        RV n        R# )r   zrefresh_per_second must be > 0NFT)rV   )_renderabler   rP   _screen_alt_screen_redirect_stdout_redirect_stderr_restore_stdout_restore_stderrr   rB   
ipy_widgetrR   _startedrS   _refresh_threadr$   rV   _get_renderabler   rX   _live_render_nested)r3   rZ   rP   rQ   rR   r$   rS   rT   rU   rV   rX   s   &&$$$$$$$$$r*   r2   Live.__init__9   s     "A%G'GG%%")"5w;=  / /2626W
)-(#!'Y9="4!2-&!5F
 r-   c                   V ^8  d   QhRR/# )r"   r&   r[   r(   )r)   s   "r*   r+   r\   c   s      D r-   c                    V P                   # )z'Check if live display has been started.)rf   r;   s   &r*   
is_startedLive.is_startedb   s     }}r-   c                   V ^8  d   QhRR/# r"   r&   r   r(   )r)   s   "r*   r+   r\   g   s          r-   c                	n    V P                   e   V P                  4       MV P                  pT;'       g    R# )N )rh   r^   )r3   rZ   s   & r*   rX   Live.get_renderableg   s<     ##/   "!! 	
 Rr-   c                    V ^8  d   QhRRRR/# )r"   rD   r[   r&   r'   r(   )r)   s   "r*   r+   r\   o   s      -  -T  -d  -r-   c                   V P                   ;_uu_ 4        V P                  '       d    RRR4       R# RV n        V P                  P                  V 4      '       g   RV n         RRR4       R# V P
                  '       d!   V P                  P                  R4      V n        V P                  P                  R4       V P                  4        V P                  P                  V 4       V'       d    V P                  4        V P                  '       d5   \        W P                   4      V n        V P"                  P%                  4        RRR4       R#   \         d    T P                  4        h i ; i  + '       g   i     R# ; i)zdStart live rendering display.

Args:
    refresh (bool, optional): Also refresh. Defaults to False.
NTF)rB   rf   rP   set_liverj   r_   set_alt_screenr`   show_cursor_enable_redirect_iopush_render_hookrD   	Exceptionr<   rR   r    r$   rg   start)r3   rD   s   &&r*   r}   
Live.starto   s    ZZZ}}} Z !DM<<((..# Z |||#'<<#>#>t#D LL$$U+$$&LL))$/LLN    '5d<S<S'T$$$**,5 Z" ! 
 IIK# ZZsA   E.'E.E.-E.?A-E..E>E.4E.E++E..E?	c                   V ^8  d   QhRR/# r7   r(   )r)   s   "r*   r+   r\      s      0  0d  0r-   c           
     6   V P                   ;_uu_ 4        V P                  '       g    RRR4       R# RV n        V P                  P                  4        V P                  '       dC   V P
                  '       g&   V P                  P                  V P                  4        RRR4       R# V P                  '       d0   V P                  e"   V P                  P                  4        RV n	        RV n        V P                  ;_uu_ 4         V P                  '       g-   V P                  P                  '       g   V P                  4        V P                  4        V P                  P!                  4        V P                  '       g7   V P                  P"                  '       d   V P                  P%                  4        V P                  P'                  R4       V P                  '       d   V P                  P)                  R4       V P
                  '       dF   V P                  '       g4   V P                  P+                  V P,                  P/                  4       4       V P0                  e-   V P
                  '       d   V P0                  P3                  4        RRR4       RRR4       R#   T P                  4        T P                  P!                  4        T P                  '       g7   T P                  P"                  '       d   T P                  P%                  4        T P                  P'                  R4       T P                  '       d   T P                  P)                  R4       T P
                  '       dF   T P                  '       g4   T P                  P+                  T P,                  P/                  4       4       T P0                  e/   T P
                  '       d   T P0                  P3                  4        i i i ; i  + '       g   i     ELm; i  + '       g   i     R# ; i)zStop live rendering display.NFvisibleT)rB   rf   rP   
clear_liverj   rS   printrZ   rR   rg   r<   rV   r`   
is_jupyterrD   _disable_redirect_iopop_render_hookis_terminallinery   rx   controlri   restore_cursorre   closer;   s   &r*   r<   	Live.stop   s   ZZZ=== Z "DMLL##%|||~~~LL&&t7 Z    T%9%9%E$$))+'+$%.D"0+++DLL4K4K4K--/LL002+++0H0H0H))+LL,,T2'''33E:~~~d.>.>.>,,T->->-M-M-OP2t~~~--/  Z( --/LL002+++0H0H0H))+LL,,T2'''33E:~~~d.>.>.>,,T->->-M-M-OP2t~~~--/ 8F2  ZZs   P2P&P8&P(P:A
PO3	-J!4J!AO3	AO3	#,O3	O3	"AO3	5O3	P!AO0:AO0,O0.O0 AO0O00O3	3P>	PP	c                   V ^8  d   QhRR/# )r"   r&   r   r(   )r)   s   "r*   r+   r\      s      4 r-   c                	B    V P                  V P                  R JR7       V # )N)rD   )r}   r^   r;   s   &r*   	__enter__Live.__enter__   s     

4++47
8r-   c               (    V ^8  d   QhRRRRRRRR/# )	r"   exc_typezOptional[Type[BaseException]]exc_valzOptional[BaseException]exc_tbzOptional[TracebackType]r&   r'   r(   )r)   s   "r*   r+   r\      s2      / ) (	
 
r-   c                	&    V P                  4        R # r9   )r<   )r3   r   r   r   s   &&&&r*   __exit__Live.__exit__   s     			r-   c                   V ^8  d   QhRR/# r7   r(   )r)   s   "r*   r+   r\      s     Q QT Qr-   c                   V P                   P                  '       g   V P                   P                  '       Ed   V P                  '       dq   \	        \
        P                  \        4      '       gM   \
        P                  V n        \        R\        V P                   \
        P                  4      4      \
        n        V P                  '       du   \	        \
        P                  \        4      '       gO   \
        P                  V n        \        R\        V P                   \
        P                  4      4      \
        n        R# R# R# R# )z&Enable redirecting of stdout / stderr.r   N)rP   r   r   ra   
isinstancesysstdoutr   rc   r   rb   stderrrd   r;   s   &r*   rz   Live._enable_redirect_io   s    <<###t||'>'>'>$$$Z

I-N-N'*zz$!(IdllCJJ,OP
$$$Z

I-N-N'*zz$!(IdllCJJ,OP
 .O$	 (?r-   c                   V ^8  d   QhRR/# r7   r(   )r)   s   "r*   r+   r\      s     ( (d (r-   c                    V P                   '       d'   \        RV P                   4      \        n        RV n         V P                  '       d)   \        RV P                  4      \        n        RV n        R# R# )z'Disable redirecting of stdout / stderr.r   N)rc   r   r   r   rd   r   r;   s   &r*   r   Live._disable_redirect_io   sW    h(<(<=CJ#'D h(<(<=CJ#'D   r-   c                   V ^8  d   QhRR/# rq   r(   )r)   s   "r*   r+   r\      s     F FN Fr-   c                   V P                   P                  pV'       d4   W^ ,          J d(   \        V Uu. uF  q"P                  4       NK  	  up!  pMV P                  4       pV P                  '       d   \        V4      # T# u upi )z_Get the renderable that is being displayed

Returns:
    RenderableType: Displayed renderable.
)rP   _live_stackr   rX   r`   r   )r3   
live_stackr#   rZ   s   &   r*   rZ   Live.renderable   sn     \\--
$Q-/: N:4!4!4!6: NOJ,,.J%)%5%5%5vj!E:E !Os   BrD   c               $    V ^8  d   QhRRRRRR/# )r"   rZ   r   rD   r[   r&   r'   r(   )r)   s   "r*   r+   r\      s!       T d r-   c                  \        V\        4      '       d   V P                  P                  V4      pV P                  ;_uu_ 4        Wn        V'       d   V P                  4        RRR4       R#   + '       g   i     R# ; i)zUpdate the renderable that is being displayed

Args:
    renderable (RenderableType): New renderable to use.
    refresh (bool, optional): Refresh the display. Defaults to False.
N)r   strrP   
render_strrB   r^   rD   )r3   rZ   rD   s   &&$r*   updateLive.update   sL     j#&&00<JZZZ) ZZZs   A//B 	c                   V ^8  d   QhRR/# r7   r(   )r)   s   "r*   r+   r\      s      2  2  2r-   c           	     n   V P                   ;_uu_ 4        V P                  P                  V P                  4       V P                  '       dS   V P
                  P                  '       d,   V P
                  P                  ^ ,          P                  4         RRR4       R# V P
                  P                  '       d    ^ RI	H
p ^ RIHp V P                  f   V! 4       V n        V! V P                  4       V P                  ;_uu_ 4        V P                  P                  RR7       V P
                  P                  V P                  P                  4       RRR4       MV P
                  P&                  '       d^   V P
                  P(                  '       gB   V P
                  ;_uu_ 4        V P
                  P                  \+        4       4       RRR4       MdV P,                  '       gS   V P.                  '       gA   V P
                  ;_uu_ 4        V P
                  P                  \+        4       4       RRR4       RRR4       R#   + '       g   i     L; i  \          d    ^ RIpTP%                  R4        L?i ; i  + '       g   i     LS; i  + '       g   i     Lf; i  + '       g   i     R# ; i)z&Update the display of the Live Render.N)display)OutputT)rA   z(install "ipywidgets" for Jupyter support)rB   ri   set_renderablerZ   rj   rP   r   rD   r   IPython.displayr   
ipywidgetsr   re   clear_outputr   ImportErrorwarningswarnr   is_dumb_terminalr   rf   rS   )r3   r   r   r   s   &   r*   rD   Live.refresh   s   ZZZ,,T__=|||<<+++LL,,Q/779 Z ||&&&I71 .*0(044$4?**4+<+<+G+GH ) )))$,,2O2O2O\\\LL&&wy1 "\ MMM$...\\\LL&&wy1 "; Z( ) # N#MM"LMN "\
 "\; ZZs   AJ#),J#J#<IA J#AI	$J#9J#J#)$I=	J#(J#:J#$J	2J#IJ# I:7J#9I::J#=JJ#J J##J4	c                    V ^8  d   QhRRRR/# )r"   renderableszList[ConsoleRenderable]r&   r(   )r)   s   "r*   r+   r\     s      2	 r-   c                   V P                   V P                  n         V P                  P                  '       dr   V P                  ;_uu_ 4        V P
                  '       d   \        P                  ! 4       MV P                  P                  4       pV.VOV P                  NpRRR4       V# V P                  '       g#   V P                  '       g   . VOV P                  NpV#   + '       g   i     T# ; i)z;Process renderables to restore cursor and display progress.N)rV   ri   rP   is_interactiverB   r`   r   homeposition_cursorrf   rS   )r3   r   resets   && r*   process_renderablesLive.process_renderables  s     /3.D.D+<<&&& ''' LLN**::< 
  %F{FD4E4EF  	 dnnn;K;):):;K  s   ACC0	)r`   rh   ri   rB   rj   rb   ra   rg   r^   rd   rc   r_   rf   rR   rP   re   r$   rS   rV   r9   )F)rG   rH   rI   rJ   rK   r2   propertyrn   rX   r}   r<   r   r   rz   r   rZ   r   rD   r   rL   r(   r-   r*   rO   rO   )   s    ' &*	'
 ' "' %&'  ' !%' !%' 5?' BF' 'R    -D 0DQ( F FE  2D r-   rO   __main__)cycle)Dictr   Tuple)Align)r   )rO   )Panel)Rule)Syntax)Tablea~  def loop_last(values: Iterable[T]) -> Iterable[Tuple[bool, T]]:
    """Iterate and generate a tuple with a flag for last value."""
    iter_values = iter(values)
    try:
        previous_value = next(iter_values)
    except StopIteration:
        return
    for value in iter_values:
        yield False, previous_value
        previous_value = value
    yield True, previous_valuepythonT)line_numbersfoobarbaz123zYou can make the terminal shorter and taller to see the live table hideText may be printed while the progress bars are rendering.z(In fact, [i]any[/i] renderable will workzSuch as [magenta]tables[/]...zPretty printed structures...typeexampletextzPretty printedz	Syntax...zGive it a try!)rP   zDict[Tuple[str, str], float]exchange_rate_dictg?i@  zExchange Rates)titlezSource CurrencyzDestination CurrencyzExchange Ratez.4fg      ?redgreen)style)SGDMYREURUSDAUDJPYCNHHKDCADINRDKKGBPRUBNZDMXNIDRTWDTHBVND)Y__conditional_annotations__
__future__r   r   	threadingr   r   r   typesr   typingr   r	   r
   r   r   r   r   r   r   rs   r   rP   r   r   r   r   r   r   r   
file_proxyr   jupyterr   live_renderr   r   rQ   r   r   r   typing_extensionsr   r    rO   rG   randomtime	itertoolsr   r   r   alignr   r#   panelr   ruler   syntaxr   tabler   add_rowprogress_renderablesexamples	exchanges
live_tabler   __annotations__rangeindexlenselect_exchangeexchangesleeprandintlognextpoplistkeys
add_columnitemssourcedestexchange_rater   center)r   s   @r*   <module>r     s   " " 
 * *  W W W  R R  ! ! ;  &(V (&|< |~ z(( "iG
	" 	F  %&E	MM#sC 	E89'&	F$45 )*HI* 
g		*;=8=3ZE'I(>?O%.

3>>!R(1,KKX/BE]]_s*a/C"OX#>? )*S^a-??&**40B0G0G0I+J1+MN$45  !23  !78  15G5M5M5O1NVTMMM,S1+83+>%G 6P !!%,,u"567 &   
	O N 
		s   FK&&K7	