+
    NV-j¿X  ã                   óÂ  a € RP t[0 t R t^ RIt^ RIt^ RIHt Rt] ^ k ]P                  R8X  d   ]P                  ! ]P                  4      tM]
! ] R24      h^ RIt^ RIHtHtHt ^ RIHtHtHtHt ^ RIHt ^ RIHt RQt^t]P4                  t ! R	 R
]4      t ! R R]4      t ! R R]4      t ! R R]P                  4      t ]PB                  PD                  t#]PH                  .]#n%        ]PL                  ]#n'        ]3R R llt"]PB                  PP                  t)]PL                  ]PT                  .])n%        ]PV                  ])n'        R R lt(]PB                  PX                  t-]PL                  ]P\                  ]PH                  ]! ]],          ]4      ]P^                  ! ]PH                  4      .]-n%        ]PV                  ]-n'        R R lt0]PB                  Pb                  t2]PL                  ]Pf                  ]PH                  ]! ]],          ]4      ]P^                  ! ]PH                  4      .]2n%        ]PV                  ]2n'        R R lt1]PB                  Ph                  t5]PL                  ]Pf                  .]5n%        ]PV                  ]5n'        R R lt4]PB                  Pl                  t7]PL                  ]P^                  ! ]4      .]7n%        ]PV                  ]7n'        R R lt6]PB                  Pp                  t9]PL                  ]! ]],          ]4      .]9n%        ]PV                  ]9n'        R R lt8]PB                  Pt                  t;]PL                  ]P^                  ! ] 4      .];n%        ]PV                  ];n'        R R  lt:]PB                  Px                  t=]PL                  ]P^                  ! ] 4      .]=n%        ]PV                  ]=n'        R! R" lt<]PB                  P|                  t?]P€                  .]?n%        ]PV                  ]?n'        R# R$ ltA ! R% R&4      tB]R'8X  Ed»   ]"! 4       tC^ R(IDHEtE ]E! 4       tF]B! ]PŽ                  4      tH]HP“                  R)4       ]! R*R+R,7      tJ]P–                  ! R-4      tL]FP›                  R.4       ]FP�                  R/4       ]FP�                  R04       ]FP�                  R14       ]FP�                  R24       ]FP�                  R34       ]FP�                  R44       ]FP�                  R54       ]FP�                  R64       ]FP�                  R74       ]FP�                  R84       ]FP�                  R94       ]FP�                  R:4       ]FP�                  R;4       ]FP�                  R<4       ]FP�                  R=4       ]FP›                  R>4       ]FP�                  4        ]HPŸ                  4        ]HPŸ                  4        ]HP¡                  R?4       ]P¢                  ! ^4       ]HP¥                  4        ]HP¡                  R@4       ]P¢                  ! ^4       ]HP§                  4        ]HP¡                  RA4       ]P¢                  ! ^4       ]HP¥                  4        ]HPŸ                  4        ]HPŸ                  4        ]HP¡                  RB4       ]P¢                  ! ^4       ]HP§                  4        ]HPŸ                  4        ]HPŸ                  4        ]HP¡                  RC4       ]P¢                  ! ^4       ]HP©                  4        ]FP�                  4        ]FP›                  RD4       ]FP�                  RE4       ]HP¡                  RF4       ]P¢                  ! ^4       ]HP«                  ^4       ]HP­                  RG]P–                  ! RH4      4       ]HPŸ                  4        ]P¢                  ! ^4       ]HP¯                  4        ]P¢                  ! ^4       ]FP�                  RI4       ]HP¡                  RF4       ]P¢                  ! ^4       ]HP«                  ^4       ]HP­                  RJ]P–                  ! RH4      4       ]P¢                  ! ^4       ]HP±                  4        ]P¢                  ! ^4       ]FP�                  RK4       ]HP­                  RL]P–                  ! RM4      RN7       ]P¢                  ! ^4       ]HP³                  4        ]HPµ                  4        ]N! RO4       R# R# )RzÐLight wrapper around the Win32 Console API - this module should only be imported on Windows

The API that this module wraps is documented at https://docs.microsoft.com/en-us/windows/console/console-functions
N)ÚAnyÚwin32z  can only be imported on Windows)Ú	StructureÚbyrefÚwintypes)ÚIOÚ
NamedTupleÚTypeÚcast)ÚColorSystem)ÚStylec                   ó   € ] tR t^tRtR# )ÚLegacyWindowsError© N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__static_attributes__r   ó    Úd/Volumes/fast/ai/experiments/ui-tars-smoke/.venv/lib/python3.14/site-packages/rich/_win32_console.pyr   r      s   † Ûr   r   c                   óL   a € ] tR t^!t o Rt]V 3R lR l4       tV 3R ltRtV t	R# )ÚWindowsCoordinateszäCoordinates in the Windows Console API are (y, x), not (x, y).
This class is intended to prevent that confusion.
Rows and columns are indexed from 0.
This class can be used in place of wintypes._COORD in arguments and argtypes.
c                ó$   <€ V ^8„  d   QhRRRS[ /# )é   Úvaluer   Úreturn)ÚCOORD)ÚformatÚ__classdict__s   "€r   Ú__annotate__ÚWindowsCoordinates.__annotate__,   s   ø€ ÷ 
+ñ 
+Ð3ð 
+¹ñ 
+r   c                óB   € \        VP                  VP                  4      # )a  Converts a WindowsCoordinates into a wintypes _COORD structure.
This classmethod is internally called by ctypes to perform the conversion.

Args:
    value (WindowsCoordinates): The input coordinates to convert.

Returns:
    wintypes._COORD: The converted coordinates struct.
)r   ÚcolÚrow)Úclsr   s   &&r   Ú
from_paramÚWindowsCoordinates.from_param+   s   € ô �U—Y‘Y §	¡	Ó*Ð*r   c                ó2   <€ V ^8„  d   Qh/ S[ ;R&   S[ ;R&   # )r   r$   r#   ©Úint)r   r   s   "€r   r    r!   !   s   ø‡ ‚ ñ 
�Hñ ñ 
�Hò r   r   N)
r   r   r   r   Ú__doc__Úclassmethodr&   Ú__annotate_func__r   Ú__classdictcell__©r   s   @r   r   r   !   s%   ø‡ € ñð ÷
+ó ð
+÷ ƒ r   r   c                   ó`   € ] tR t^9tR]3R]3R]P                  3R]P                  3R]3.tRt	R# )ÚCONSOLE_SCREEN_BUFFER_INFOÚdwSizeÚdwCursorPositionÚwAttributesÚsrWindowÚdwMaximumWindowSizer   N)
r   r   r   r   r   r   ÚWORDÚ
SMALL_RECTÚ_fields_r   r   r   r   r1   r1   9   s;   † à	�5ÐØ	˜UÐ#Ø	˜Ÿ™Ð&Ø	�X×(Ñ(Ð)Ø	 Ð&ð„Hr   r1   c                   óN   € ] tR t^CtR]P
                  3R]P                  3.tRtR# )ÚCONSOLE_CURSOR_INFOr2   ÚbVisibler   N)	r   r   r   r   r   ÚDWORDÚBOOLr9   r   r   r   r   r;   r;   C   s   † Ø˜8Ÿ>™>Ð*¨Z¸¿¹Ð,GÐH„Hr   r;   c                óD   € V ^8„  d   QhR\         R\        P                  /# )r   Úhandler   )r*   r   ÚHANDLE)r   s   "r   r    r    N   s   € ÷ 	8ñ 	8œð 	8¬(¯/©/ñ 	8r   c                óH   € \        \        P                  \        V 4      4      # )zêRetrieves a handle to the specified standard device (standard input, standard output, or standard error).

Args:
    handle (int): Integer identifier for the handle. Defaults to -11 (stdout).

Returns:
    wintypes.HANDLE: The handle
)r
   r   rA   Ú_GetStdHandle)r@   s   &r   ÚGetStdHandlerD   N   s   € ô ”—‘¤¨vÓ!6Ó7Ð7r   c                óD   € V ^8„  d   QhR\         P                  R\        /# ©r   Ú
std_handler   )r   rA   r*   )r   s   "r   r    r    _   s   € ÷ ñ œxŸ™ð ´3ñ r   c                ó’   € \         P                  ! 4       p\        \        W4      4      pV'       g   \	        R4      hVP
                  # )aß  Retrieves the current input mode of a console's input buffer
or the current output mode of a console screen buffer.

Args:
    std_handle (wintypes.HANDLE): A handle to the console input buffer or the console screen buffer.

Raises:
    LegacyWindowsError: If any error occurs while calling the Windows console API.

Returns:
    int: Value representing the current console mode as documented at
        https://docs.microsoft.com/en-us/windows/console/getconsolemode#parameters
z)Unable to get legacy Windows Console Mode)r   r=   ÚboolÚ_GetConsoleModer   r   )rG   Úconsole_modeÚsuccesss   &  r   ÚGetConsoleModerM   _   s:   € ô —>’>Ó#€LÜ”? :Ó<Ó=€GßÜ Ð!LÓMÐMØ×ÑÐr   c          
      óh   € V ^8„  d   QhR\         P                  R\        R\        R\        R\        /# )r   rG   ÚcharÚlengthÚstartr   )r   rA   Ústrr*   r   )r   s   "r   r    r    €   s>   € ÷ ñ Ü—‘ðä
ðô ðô ð	ô
 	ñr   c           	     óê   € \         P                  ! VP                  4       4      p\        P                  ! V4      p\        P                  ! ^ 4      p\        V VVV\        V4      4       VP                  # )aß  Writes a character to the console screen buffer a specified number of times, beginning at the specified coordinates.

Args:
    std_handle (wintypes.HANDLE): A handle to the console input buffer or the console screen buffer.
    char (str): The character to write. Must be a string of length 1.
    length (int): The number of times to write the character.
    start (WindowsCoordinates): The coordinates to start writing at.

Returns:
    int: The number of characters written.
)ÚctypesÚc_charÚencoder   r=   Ú_FillConsoleOutputCharacterWr   r   )rG   rO   rP   rQ   Ú	characterÚnum_charactersÚnum_writtens   &&&&   r   ÚFillConsoleOutputCharacterr[   €   s^   € ô" —’˜dŸk™k›mÓ,€IÜ—^’^ FÓ+€NÜ—.’. Ó#€KÜ ØØØØÜˆkÓôð ×ÑÐr   c          
      óh   € V ^8„  d   QhR\         P                  R\        R\        R\        R\        /# )r   rG   Ú
attributesrP   rQ   r   )r   rA   r*   r   )r   s   "r   r    r    ©   s>   € ÷ ñ Ü—‘ðäðô ðô ð	ô
 	ñr   c           	     óÊ   € \         P                  ! V4      p\         P                  ! V4      p\         P                  ! ^ 4      p\        WWC\	        V4      4       VP
                  # )aH  Sets the character attributes for a specified number of character cells,
beginning at the specified coordinates in a screen buffer.

Args:
    std_handle (wintypes.HANDLE): A handle to the console input buffer or the console screen buffer.
    attributes (int): Integer value representing the foreground and background colours of the cells.
    length (int): The number of cells to set the output attribute of.
    start (WindowsCoordinates): The coordinates of the first cell whose attributes are to be set.

Returns:
    int: The number of cells whose attributes were actually set.
)r   r=   r7   Ú_FillConsoleOutputAttributer   r   )rG   r]   rP   rQ   Ú	num_cellsÚstyle_attrsrZ   s   &&&&   r   ÚFillConsoleOutputAttributerb   ©   sP   € ô$ —’˜vÓ&€IÜ—-’- 
Ó+€KÜ—.’. Ó#€KÜØ ´5¸Ó3Eôð ×ÑÐr   c                ód   € V ^8„  d   QhR\         P                  R\         P                  R\        /# )r   rG   r]   r   )r   rA   r7   rI   )r   s   "r   r    r    Ì   s1   € ÷ Bñ BÜ—‘ðBÜ-5¯]©]ðBä	ñBr   c                ó*   € \        \        W4      4      # )ad  Set the colour attributes for all text written after this function is called.

Args:
    std_handle (wintypes.HANDLE): A handle to the console input buffer or the console screen buffer.
    attributes (int): Integer value representing the foreground and background colours.


Returns:
    bool: True if the attribute was set successfully, otherwise False.
)rI   Ú_SetConsoleTextAttribute)rG   r]   s   &&r   ÚSetConsoleTextAttributerf   Ì   s   € ô Ô(¨Ó@ÓAÐAr   c                óD   € V ^8„  d   QhR\         P                  R\        /# rF   )r   rA   r1   )r   s   "r   r    r    ä   s    € ÷ &ñ &Ü—‘ð&äñ&r   c                óD   € \        4       p\        V \        V4      4       V# )a]  Retrieves information about the specified console screen buffer.

Args:
    std_handle (wintypes.HANDLE): A handle to the console input buffer or the console screen buffer.

Returns:
    CONSOLE_SCREEN_BUFFER_INFO: A CONSOLE_SCREEN_BUFFER_INFO ctype struct contain information about
        screen size, cursor position, colour attributes, and more.)r1   Ú_GetConsoleScreenBufferInfor   )rG   Úconsole_screen_buffer_infos   & r   ÚGetConsoleScreenBufferInfork   ä   s#   € ô "<Ó!=ÐÜ 
¬EÐ2LÓ,MÔNØ%Ð%r   c                óP   € V ^8„  d   QhR\         P                  R\        R\        /# )r   rG   Úcoordsr   )r   rA   r   rI   )r   s   "r   r    r    ü   s(   € ÷ ?ñ ?Ü—‘ð?Ü);ð?ä	ñ?r   c                ó*   € \        \        W4      4      # )a-  Set the position of the cursor in the console screen

Args:
    std_handle (wintypes.HANDLE): A handle to the console input buffer or the console screen buffer.
    coords (WindowsCoordinates): The coordinates to move the cursor to.

Returns:
    bool: True if the function succeeds, otherwise False.
)rI   Ú_SetConsoleCursorPosition)rG   rm   s   &&r   ÚSetConsoleCursorPositionrp   ü   s   € ô Ô)¨*Ó=Ó>Ð>r   c                óP   € V ^8„  d   QhR\         P                  R\        R\        /# ©r   rG   Úcursor_infor   ©r   rA   r;   rI   )r   s   "r   r    r      s-   € ÷ Gñ GÜ—‘ðGÜ.AðGä	ñGr   c                ó>   € \        \        V \        V4      4      4      # )av  Get the cursor info - used to get cursor visibility and width

Args:
    std_handle (wintypes.HANDLE): A handle to the console input buffer or the console screen buffer.
    cursor_info (CONSOLE_CURSOR_INFO): CONSOLE_CURSOR_INFO ctype struct that receives information
        about the console's cursor.

Returns:
      bool: True if the function succeeds, otherwise False.
)rI   Ú_GetConsoleCursorInfor   ©rG   rs   s   &&r   ÚGetConsoleCursorInforx     s   € ô Ô% j´%¸Ó2DÓEÓFÐFr   c                óP   € V ^8„  d   QhR\         P                  R\        R\        /# rr   rt   )r   s   "r   r    r    +  s-   € ÷ Gñ GÜ—‘ðGÜ.AðGä	ñGr   c                ó>   € \        \        V \        V4      4      4      # )a_  Set the cursor info - used for adjusting cursor visibility and width

Args:
    std_handle (wintypes.HANDLE): A handle to the console input buffer or the console screen buffer.
    cursor_info (CONSOLE_CURSOR_INFO): CONSOLE_CURSOR_INFO ctype struct containing the new cursor info.

Returns:
      bool: True if the function succeeds, otherwise False.
)rI   Ú_SetConsoleCursorInfor   rw   s   &&r   ÚSetConsoleCursorInfor|   +  s   € ô Ô% j´%¸Ó2DÓEÓFÐFr   c                ó0   € V ^8„  d   QhR\         R\        /# )r   Útitler   )rR   rI   )r   s   "r   r    r    ?  s   € ÷ 	)ñ 	)œ3ð 	)¤4ñ 	)r   c                ó*   € \        \        V 4      4      # )z®Sets the title of the current console window

Args:
    title (str): The new title of the console window.

Returns:
    bool: True if the function succeeds, otherwise False.
)rI   Ú_SetConsoleTitle)r~   s   &r   ÚSetConsoleTitler�   ?  s   € ô Ô  Ó'Ó(Ð(r   c                   óˆ  a € ] tR tRt o Rt^t. R)OtV 3R lR lt]V 3R lR l4       t	]V 3R lR l4       t
V 3R	 lR
 ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR ltV 3R lR  ltV 3R! lR" ltV 3R# lR$ ltV 3R% lR& ltR'tV tR(# )*ÚLegacyWindowsTermiK  an  This class allows interaction with the legacy Windows Console API. It should only be used in the context
of environments where virtual terminal processing is not available. However, if it is used in a Windows environment,
the entire API should work.

Args:
    file (IO[str]): The file which the Windows Console API HANDLE is retrieved from, defaults to sys.stdout.
c                ó"   <€ V ^8„  d   QhRRRR/# )r   ÚfilezIO[str]r   Nr   )r   r   s   "€r   r    ÚLegacyWindowsTerm.__annotate__j  s   ø€ ÷  ñ  ˜Yð  ¨4ñ  r   c                óN  € \        \        4      pW n        \        V4      P                  pW0n        V^,          V n        V^,	          ^,          V n        V P                  V P                  ^,          ,          V n        Wn	        VP                  V n
        VP                  V n        R# )é   N)rD   ÚSTDOUTÚ_handlerk   r4   Ú_default_textÚ_default_foreÚ_default_backÚ_default_attrsÚ_fileÚwriteÚflush)Úselfr…   r@   Údefault_texts   &&  r   Ú__init__ÚLegacyWindowsTerm.__init__j  s   € ÜœfÓ%ˆØŒÜ1°&Ó9×EÑEˆØ)Ôà)¨AÕ-ˆÔØ*¨aÕ/°1Õ4ˆÔØ"×0Ñ0°D×4FÑ4FÈ!Õ4KÕLˆÔàŒ
Ø—Z‘ZˆŒ
Ø—Z‘ZˆŽ
r   c                ó    <€ V ^8„  d   QhRS[ /# ©r   r   ©r   )r   r   s   "€r   r    r†   y  s   ø€ ÷ <ñ <Ñ!3ñ <r   c                ó‚   € \        V P                  4      P                  p\        VP                  VP
                  R7      # )ztReturns the current position of the cursor (0-based)

Returns:
    WindowsCoordinates: The current cursor position.
©r$   r#   )rk   rŠ   r3   r   ÚYÚX)r’   Úcoords   & r   Úcursor_positionÚ!LegacyWindowsTerm.cursor_positionx  s-   € ô 2°$·,±,Ó?×PÑPˆÜ! e§g¡g°5·7±7Ô;Ð;r   c                ó    <€ V ^8„  d   QhRS[ /# r—   r˜   )r   r   s   "€r   r    r†   ƒ  s   ø€ ÷ Hñ HÑ/ñ Hr   c                ó‚   € \        V P                  4      P                  p\        VP                  VP
                  R7      # )z±Returns the current size of the console screen buffer, in character columns and rows

Returns:
    WindowsCoordinates: The width and height of the screen as WindowsCoordinates.
rš   )rk   rŠ   r2   r   r›   rœ   )r’   Úscreen_sizes   & r   r¢   ÚLegacyWindowsTerm.screen_size‚  s-   € ô 8¸¿¹ÓE×LÑLˆÜ! k§m¡m¸¿¹ÔGÐGr   c                ó$   <€ V ^8„  d   QhRS[ RR/# )r   Útextr   N©rR   )r   r   s   "€r   r    r†   Œ  s   ø€ ÷ ñ ™sð  tñ r   c                óH   € V P                  V4       V P                  4        R# )zWrite text directly to the terminal without any modification of styles

Args:
    text (str): The text to write to the console
N)r�   r‘   )r’   r¥   s   &&r   Ú
write_textÚLegacyWindowsTerm.write_textŒ  s   € ð 	�
‰
�4ÔØ�
‰
Žr   c                ó*   <€ V ^8„  d   QhRS[ RS[RR/# )r   r¥   Ústyler   N)rR   r   )r   r   s   "€r   r    r†   •  s'   ø€ ÷ %Mñ %M¡ð %M©Uð %M°tñ %Mr   c                ó@  € VP                   pVP                  pVP                  '       d   YCrCV'       d�   VP                  \        P
                  4      P                  pVe   TM^pVP                  '       d   WPP                  ,          pVP                  '       d   WPP                  ( ,          pV P                  V,          pMV P                  pV'       dF   VP                  \        P
                  4      P                  pVe   TM^ pV P                  V,          pMV P                  pVf   Q hVf   Q h\        V P                  \        P                   ! WV^,          ,          4      R7       V P#                  V4       \        V P                  V P$                  R7       R# )zuWrite styled text to the terminal.

Args:
    text (str): The text to write
    style (Style): The style of the text
N)r]   )ÚcolorÚbgcolorÚreverseÚ	downgrader   ÚWINDOWSÚnumberÚboldÚ
BRIGHT_BITÚdimÚANSI_TO_WINDOWSrŒ   r�   rf   rŠ   rT   Úc_ushortr¨   r‹   )r’   r¥   r«   r­   r®   ÚforeÚbacks   &&&    r   Úwrite_styledÚLegacyWindowsTerm.write_styled•  s6  € ð —‘ˆØ—-‘-ˆØ�=�=ˆ=Ø$�7çØ—?‘?¤;×#6Ñ#6Ó7×>Ñ>ˆDØÒ+‘4°ˆDØ�z�zˆzØŸo™oÕ-�Ø�y�yˆyØŸ™Ð.Õ.�Ø×'Ñ'¨Õ-‰Dà×%Ñ%ˆDçØ×$Ñ$¤[×%8Ñ%8Ó9×@Ñ@ˆDØÒ+‘4°ˆDØ×'Ñ'¨Õ-‰Dà×%Ñ%ˆDàÒÐÐØÒÐÐäØ�L‰L¤V§_¢_°TÀQ½YÕ5GÓ%Hõ	
ð 	�‰˜ÔÜ §¡¸×9KÑ9K×Lr   c                ó$   <€ V ^8„  d   QhRS[ RR/# )r   Únew_positionr   Nr˜   )r   r   s   "€r   r    r†   ¼  s    ø€ ÷ Dñ DÑ+=ð DÀ$ñ Dr   c                ó|   € VP                   ^ 8  g   VP                  ^ 8  d   R# \        V P                  VR7       R# )z‘Set the position of the cursor

Args:
    new_position (WindowsCoordinates): The WindowsCoordinates representing the new position of the cursor.
N©rm   )r#   r$   rp   rŠ   )r’   r½   s   &&r   Úmove_cursor_toÚ LegacyWindowsTerm.move_cursor_to¼  s0   € ð ×Ñ˜aÔ <×#3Ñ#3°aÔ#7ÙÜ  §¡°l×Cr   c                ó   <€ V ^8„  d   QhRR/# ©r   r   Nr   )r   r   s   "€r   r    r†   Æ  s   ø€ ÷ 
ñ 
˜Dñ 
r   c                óò   € V P                   pV P                  pVP                  p\        VP                  ^ R7      p\        V P                  RW4R7       \        V P                  V P                  VVR7       R# )z@Erase all content on the line the cursor is currently located atrš   Ú ©rP   rQ   N)	r¢   rž   r#   r   r$   r[   rŠ   rb   rŽ   )r’   r¢   rž   Úcells_to_eraseÚstart_coordinatess   &    r   Ú
erase_lineÚLegacyWindowsTerm.erase_lineÆ  sg   € à×&Ñ&ˆØ×.Ñ.ˆØ$Ÿ™ˆÜ.°?×3FÑ3FÈAÔNÐÜ"Ø�L‰L˜# nõ	
ô 	#Ø�L‰LØ×ÑØ!Ø#÷		
r   c                ó   <€ V ^8„  d   QhRR/# rÃ   r   )r   r   s   "€r   r    r†   Ö  s   ø€ ÷ 
ñ 
 4ñ 
r   c                óâ   € V P                   pV P                  P                  VP                  ,
          p\        V P                  RW!R7       \        V P                  V P                  VVR7       R# )zBErase all content from the cursor position to the end of that linerÅ   rÆ   N)rž   r¢   r#   r[   rŠ   rb   rŽ   )r’   rž   rÇ   s   &  r   Úerase_end_of_lineÚ#LegacyWindowsTerm.erase_end_of_lineÖ  s\   € à×.Ñ.ˆØ×)Ñ)×-Ñ-°×0CÑ0CÕCˆÜ"Ø�L‰L˜# nõ	
ô 	#Ø�L‰LØ×ÑØ!Ø!÷		
r   c                ó   <€ V ^8„  d   QhRR/# rÃ   r   )r   r   s   "€r   r    r†   ä  s   ø€ ÷ 
ñ 
 Tñ 
r   c                ó®   € V P                   w  r\        V^ 4      p\        V P                  RW#R7       \	        V P                  V P
                  W#R7       R# )zDErase all content from the cursor position to the start of that linerÅ   rÆ   N)rž   r   r[   rŠ   rb   rŽ   )r’   r$   r#   rQ   s   &   r   Úerase_start_of_lineÚ%LegacyWindowsTerm.erase_start_of_lineä  sD   € à×'Ñ'‰ˆÜ" 3¨Ó*ˆÜ" 4§<¡<°¸SÕNÜ"Ø�L‰L˜$×-Ñ-°c÷	
r   c                ó   <€ V ^8„  d   QhRR/# rÃ   r   )r   r   s   "€r   r    r†   í  s   ø€ ÷ 
ñ 
 ñ 
r   c                ó˜   € V P                   p\        V P                  \        VP                  ^,
          VP
                  R7      R7       R# )z Move the cursor up a single cellrš   r¿   N©rž   rp   rŠ   r   r$   r#   ©r’   rž   s   & r   Úmove_cursor_upÚ LegacyWindowsTerm.move_cursor_upí  s:   € à×.Ñ.ˆÜ Ø�L‰LÜ%Ø#×'Ñ'¨!Õ+°×1DÑ1Dô÷	
r   c                ó   <€ V ^8„  d   QhRR/# rÃ   r   )r   r   s   "€r   r    r†   ÷  s   ø€ ÷ 	
ñ 	
 $ñ 	
r   c                ó˜   € V P                   p\        V P                  \        VP                  ^,           VP
                  R7      R7       R# )z"Move the cursor down a single cellrš   r¿   NrÕ   rÖ   s   & r   Úmove_cursor_downÚ"LegacyWindowsTerm.move_cursor_down÷  s;   € à×.Ñ.ˆÜ Ø�L‰LÜ%Ø#×'Ñ'¨!Õ+Ø#×'Ñ'ô÷	
r   c                ó   <€ V ^8„  d   QhRR/# rÃ   r   )r   r   s   "€r   r    r†     s   ø€ ÷ 

ñ 

 Tñ 

r   c                óÐ   € V P                   w  rW P                  P                  ^,
          8X  d   V^,          p^ pM	V^,          p\        V P                  \        WR7      R7       R# )zIMove the cursor forward a single cell. Wrap to the next line if required.rš   r¿   N©rž   r¢   r#   rp   rŠ   r   ©r’   r$   r#   s   &  r   Úmove_cursor_forwardÚ%LegacyWindowsTerm.move_cursor_forward  sT   € à×'Ñ'‰ˆØ×"Ñ"×&Ñ&¨Õ*Ô*Ø�1�HˆCØ‰Cà�1�HˆCÜ Ø�L‰LÔ!3¸Ô!E÷	
r   c                ó$   <€ V ^8„  d   QhRS[ RR/# )r   Úcolumnr   Nr)   )r   r   s   "€r   r    r†     s   ø€ ÷ Wñ W©Cð W°Dñ Wr   c                ób   € V P                   w  r#\        V P                  \        W!4      R7       R# )z¨Move cursor to the column specified by the zero-based column index, staying on the same row

Args:
    column (int): The zero-based column index to move the cursor to.
r¿   N)rž   rp   rŠ   r   )r’   rä   r$   Ú_s   &&  r   Úmove_cursor_to_columnÚ'LegacyWindowsTerm.move_cursor_to_column  s%   € ð ×%Ñ%‰ˆÜ  §¡Ô6HÈÓ6U×Vr   c                ó   <€ V ^8„  d   QhRR/# rÃ   r   )r   r   s   "€r   r    r†     s   ø€ ÷ 

ñ 

 dñ 

r   c                óÒ   € V P                   w  rV^ 8X  d(   V^,          pV P                  P                  ^,
          pM	V^,          p\        V P                  \        WR7      R7       R# )zNMove the cursor backward a single cell. Wrap to the previous line if required.rš   r¿   Nrß   rà   s   &  r   Úmove_cursor_backwardÚ&LegacyWindowsTerm.move_cursor_backward  sU   € à×'Ñ'‰ˆØ�!Œ8Ø�1�HˆCØ×"Ñ"×&Ñ&¨Õ*‰Cà�1�HˆCÜ Ø�L‰LÔ!3¸Ô!E÷	
r   c                ó   <€ V ^8„  d   QhRR/# rÃ   r   )r   r   s   "€r   r    r†   #  s   ø€ ÷ Iñ I˜Tñ Ir   c                ón   € V P                  4       p\        V^ R7      p\        V P                  VR7       R# )zHide the cursor©r2   r<   ©rs   N©Ú_get_cursor_sizer;   r|   rŠ   )r’   Úcurrent_cursor_sizeÚinvisible_cursors   &  r   Úhide_cursorÚLegacyWindowsTerm.hide_cursor#  s/   € à"×3Ñ3Ó5ÐÜ.Ð6IÐTUÔVÐÜ˜TŸ\™\Ð7G×Hr   c                ó   <€ V ^8„  d   QhRR/# rÃ   r   )r   r   s   "€r   r    r†   )  s   ø€ ÷ Gñ G˜Tñ Gr   c                ón   € V P                  4       p\        V^R7      p\        V P                  VR7       R# )zShow the cursorrï   rð   Nrñ   )r’   ró   Úvisible_cursors   &  r   Úshow_cursorÚLegacyWindowsTerm.show_cursor)  s-   € à"×3Ñ3Ó5ÐÜ,Ð4GÐRSÔTˆÜ˜TŸ\™\°~×Fr   c                ó$   <€ V ^8„  d   QhRS[ RR/# )r   r~   r   Nr¦   )r   r   s   "€r   r    r†   /  s   ø€ ÷ ñ ™sð  tñ r   c                óJ   € \        V4      ^ÿ8  g   Q R4       h\        V4       R# )zaSet the title of the terminal window

Args:
    title (str): The new title of the console window
z.Console title must be less than 255 charactersN)Úlenr�   )r’   r~   s   &&r   Ú	set_titleÚLegacyWindowsTerm.set_title/  s$   € ô �5‹z˜CÔÐQÐ!QÓQÐÜ˜Ör   c                ó    <€ V ^8„  d   QhRS[ /# r—   r)   )r   r   s   "€r   r    r†   8  s   ø€ ÷ 'ñ '¡#ñ 'r   c                ón   € \        4       p\        V P                  VR7       \        VP                  4      # )zEGet the percentage of the character cell that is filled by the cursorrð   )r;   rx   rŠ   r*   r2   )r’   rs   s   & r   rò   Ú"LegacyWindowsTerm._get_cursor_size8  s)   € ä)Ó+ˆÜ˜TŸ\™\°{ÕCÜ�;×%Ñ%Ó&Ð&r   )rŽ   r�   rŒ   r‹   r�   rŠ   r‘   r�   N)é    é   r   é   é   é   é   rˆ   é   é   é
   é   é	   é   é   é   )r   r   r   r   r+   r´   r¶   r”   Úpropertyrž   r¢   r¨   rº   rÀ   rÉ   rÍ   rÑ   r×   rÛ   rá   rç   rë   rõ   rú   rÿ   rò   r   r.   r/   s   @r   rƒ   rƒ   K  sí   ø‡ € ñð €Jò€O÷& ð  ð ÷<ó ð<ð ÷Hó ðH÷ð ÷%Mð %M÷NDð D÷
ð 
÷ 
ð 
÷
ð 
÷
ð 
÷	
ð 	
÷

ð 

÷Wð W÷

ð 

÷Ið I÷Gð G÷ð ÷'ö 'r   rƒ   Ú__main__)ÚConsolezWin32 Console ExamplesÚblackÚred)r­   r®   zblack on greenzChecking colour outputz[on red]on red!z[blue]blue!z[yellow]yellow!z[bold yellow]bold yellow!z[bright_yellow]bright_yellow!z%[dim bright_yellow]dim bright_yellow!z[italic cyan]italic cyan!z'[bold white on blue]bold white on blue!z7[reverse bold white on blue]reverse bold white on blue!z'[bold black on cyan]bold black on cyan!z[black on green]black on green!z[blue on green]blue on green!z[white on black]white on black!z[black on white]black on white!z'[#1BB152 on #DA812D]#1BB152 on #DA812D!zChecking cursor movementz"went back and wrapped to prev linezwe go upzand downzwe went up and back 2zwe went down and back 2zChecking line erasingz(
...Deleting to the start of the line...z?The red arrow shows the cursor location, and direction of eraseÚ<zblack on redz"

...And to the end of the line...Ú>z)

...Now the whole line will be erased...zI'm going to disappear!zblack on cyan)r«   Ú
c                ó@   € V ^8„  d   Qh/ ^ \         9   d
   \        ;R&   # )r   Úwindll)Ú__conditional_annotations__r   )r   s   "r   r    r       s   € ÷ ñ ÷ Ò ŒÑ òr   iõÿÿÿ)\r  r+   rT   ÚsysÚtypingr   r  ÚplatformÚLibraryLoaderÚWinDLLÚImportErrorr   Útimer   r   r   r   r   r	   r
   Ú
rich.colorr   Ú
rich.styler   r‰   Ú"ENABLE_VIRTUAL_TERMINAL_PROCESSINGÚ_COORDr   Ú	Exceptionr   r   r1   r;   Úkernel32rD   rC   r=   ÚargtypesrA   ÚrestyperM   rJ   ÚLPDWORDr>   ÚFillConsoleOutputCharacterWrW   rU   ÚPOINTERr[   rb   r_   r7   rf   re   rk   ri   rp   ro   rx   rv   r|   r{   ÚSetConsoleTitleWr€   ÚLPCWSTRr�   rƒ   r@   Úrich.consoler  ÚconsoleÚstdoutÚtermrÿ   r«   ÚparseÚheadingÚruleÚprintrë   r¨   Úsleepr×   rÛ   rõ   rç   rº   rÑ   rÍ   rÉ   rú   r    )r  s   @r   Ú<module>r:     s  øðöó
 Û 
Ý à€Ó Ø‡<�<�7ÔØ×!Ò! &§-¡-Ó0�Fá
˜˜
Ð"BÐCÓ
DÐDã ß -Ñ -ß -Ó -å "Ý à	€Ø%&Ð "à�‰€ô	˜ô 	ô+˜ô +ô0 ô ôI˜&×*Ñ*ô Ið —‘×,Ñ,€à‡N�Nð€Ô ð !Ÿ™€Ô ð  &÷ 	8ð —/‘/×0Ñ0€Ø$ŸO™O¨X×-=Ñ-=Ð>€Ô Ø"Ÿ-™-€Ô õð,  &Ÿ™×JÑJÐ à‡O�OØ
‡M�MØ‡N�NÙˆˆe�Ð(Ó)Ø
‡N‚N�8—>‘>Ó"ð)Ð Ô %ð (0§}¡}Ð Ô $õð< %Ÿo™o×HÑHÐ à‡O�OØ‡M�MØ‡N�NÙˆˆe�Ð(Ó)Ø
‡N‚N�8—>‘>Ó"ð(Ð Ô $ð '/§m¡mÐ Ô #õð6 "Ÿ?™?×BÑBÐ à‡O�OØ‡M�Mð%Ð Ô !ð $,§=¡=Ð Ô  õBð  %Ÿo™o×HÑHÐ à‡O�OØ
‡N‚NÐ-Ó.ð(Ð Ô $ð '/§m¡mÐ Ô #õ&ð  #ŸO™O×DÑDÐ à‡O�OÙˆˆe�Ð(Ó)ð&Ð Ô "ð %-§M¡MÐ Ô !õ?ð Ÿ™×<Ñ<Ð à‡O�OØ
‡N‚NÐ&Ó'ð"Ð Ô ð !)§¡Ð Ô õGð  Ÿ™×<Ñ<Ð à‡O�OØ
‡N‚NÐ&Ó'ð"Ð Ô ð !)§¡Ð Ô õGð —?‘?×3Ñ3Ð Ø%×-Ñ-Ð.Ð Ô Ø#Ÿ=™=Ð Ô õ	)÷q'ñ q'ðh ˆzÕÙ‹^€Få$á‹i€Gá˜SŸZ™ZÓ(€DØ‡N�NÐ+Ô,á˜¨Ô/€Eà�kŠkÐ*Ó+€Gð ‡L�LÐ)Ô*Ø‡M�MÐ#Ô$Ø‡M�M�-Ô Ø‡M�MÐ#Ô$Ø‡M�MÐ-Ô.Ø‡M�MÐ1Ô2Ø‡M�MÐ9Ô:Ø‡M�MÐ-Ô.Ø‡M�MÐ;Ô<Ø‡M�MÐKÔLØ‡M�MÐ;Ô<Ø‡M�MÐ3Ô4Ø‡M�MÐ1Ô2Ø‡M�MÐ3Ô4Ø‡M�MÐ3Ô4Ø‡M�MÐ;Ô<ð ‡L�LÐ+Ô,Ø‡M�M„OØ×ÑÔØ×ÑÔØ‡O�OÐ8Ô9Ø‡J‚Jˆq„MØ×ÑÔØ‡O�O�JÔØ‡J‚Jˆq„MØ×ÑÔØ‡O�O�JÔØ‡J‚Jˆq„MØ×ÑÔØ×ÑÔØ×ÑÔØ‡O�OÐ+Ô,Ø‡J‚Jˆq„MØ×ÑÔØ×ÑÔØ×ÑÔØ‡O�OÐ-Ô.Ø‡J‚Jˆq„Mð 	×ÑÔØ‡M�M„OØ‡L�LÐ(Ô)Ø‡M�MÐ=Ô>Ø‡O�OÐUÔVØ‡J‚Jˆq„MØ×Ñ˜rÔ"Ø×Ñ�c˜5Ÿ;š; ~Ó6Ô7Ø×ÑÔØ‡J‚Jˆq„MØ×ÑÔØ‡J‚Jˆq„Mà‡M�MÐ8Ô9Ø‡O�OÐUÔVØ‡J‚Jˆq„Mà×Ñ˜rÔ"Ø×Ñ�c˜5Ÿ;š; ~Ó6Ô7Ø‡J‚Jˆq„MØ×ÑÔØ‡J‚Jˆq„Mà‡M�MÐ?Ô@Ø×ÑÐ/°u·{²{À?Ó7SÐÔTØ‡J‚Jˆq„MØ‡O�OÔà×ÑÔÙ	ˆ$†Kñm r   