ó
    NÎh·!  ã                  óÀ  • S SK Jr  S SKrS SKrS SKrS SKrS SKJr  S SKJ	r	J
r
JrJrJrJrJr  S SKJr  / SQrS\R$                  ;   r\" SS	S
9r " S S\\   5      r " S S\
S   5      r " S S\\\4   5      r\" 5       rSS jrS S jrS S jrS S jrS S jrS S jr S S jr!S!S jr"\" S5      r#      S"S jr$S#S jr%S$S jr&\\	/ \'4   \'4   r(S%S jr)S&S'S jjr*g)(é    )ÚannotationsN)Údeque)ÚCallableÚContextManagerÚDictÚ	GeneratorÚGenericÚTypeVarÚUnion)Úwcwidth)ÚEventÚDummyContextÚ
get_cwidthÚsuspend_to_background_supportedÚis_conemu_ansiÚ
is_windowsÚin_main_threadÚget_bell_environment_variableÚget_term_environment_variableÚtake_using_weightsÚto_strÚto_intÚAnyFloatÚto_floatÚis_dumb_terminalzsphinx.ext.autodocÚ_SenderT)Ú	covariantc                  ón   • \ rS rSrSr S     SS jjrSS jrSS jrSS jrSS jr	SS	 jr
SS
 jrSrg)r   é-   a}  
Simple event to which event handlers can be attached. For instance::

    class Cls:
        def __init__(self):
            # Define event. The first parameter is the sender.
            self.event = Event(self)

    obj = Cls()

    def handler(sender):
        pass

    # Add event handler by using the += operator.
    obj.event += handler

    # Fire event.
    obj.event()
Nc                ó.   • Xl         / U l        Ub  X-  n g g ©N)ÚsenderÚ	_handlers)Úselfr"   Úhandlers      ÚQ/home/mande/repo/quber/.venv/lib/python3.13/site-packages/prompt_toolkit/utils.pyÚ__init__ÚEvent.__init__B   s"   € ð ŒØ:<ˆŒàÑØ‰O‰Dð ó    c                óN   • U R                    H  nU" U R                  5        M     g)zFire event.N©r#   r"   ©r$   r%   s     r&   Ú__call__ÚEvent.__call__K   s   € à—~”~ˆGÙ�D—K‘KÖ ò &r)   c                ó   • U " 5         g)z!Alias for just calling the event.N© ©r$   s    r&   ÚfireÚ
Event.fireP   s   € á�r)   c                ó:   • U R                   R                  U5        g)z{
Add another handler to this callback.
(Handler should be a callable that takes exactly one parameter: the
sender object.)
N)r#   Úappendr,   s     r&   Úadd_handlerÚEvent.add_handlerT   s   € ð 	�‰×Ñ˜gÕ&r)   c                óZ   • XR                   ;   a  U R                   R                  U5        gg)z&
Remove a handler from this callback.
N)r#   Úremover,   s     r&   Úremove_handlerÚEvent.remove_handler]   s%   € ð —n‘nÓ$Ø�N‰N×!Ñ! 'Õ*ð %r)   c                ó(   • U R                  U5        U $ )z3
`event += handler` notation for adding a handler.
)r6   r,   s     r&   Ú__iadd__ÚEvent.__iadd__d   s   € ð 	×Ñ˜Ô!Øˆr)   c                ó(   • U R                  U5        U $ )z5
`event -= handler` notation for removing a handler.
)r:   r,   s     r&   Ú__isub__ÚEvent.__isub__k   s   € ð 	×Ñ˜GÔ$Øˆr)   r+   r!   )r"   r   r%   z Callable[[_Sender], None] | NoneÚreturnÚNone©rB   rC   )r%   úCallable[[_Sender], None]rB   rC   )r%   rE   rB   zEvent[_Sender])Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r'   r-   r2   r6   r:   r=   r@   Ú__static_attributes__r0   r)   r&   r   r   -   sI   † ñð* LPðØðØ(Hðà	õô!ô
ô'ô+ô÷r)   r   c                  ó,   • \ rS rSrSrSS jrSS jrSrg)	r   és   z-
(contextlib.nested is not available on Py3)
c                ó   • g r!   r0   r1   s    r&   Ú	__enter__ÚDummyContext.__enter__x   ó   € Ør)   c                ó   • g r!   r0   )r$   Úas     r&   Ú__exit__ÚDummyContext.__exit__{   rQ   r)   r0   NrD   )rS   ÚobjectrB   rC   )rF   rG   rH   rI   rJ   rO   rT   rK   r0   r)   r&   r   r   s   s   † ñô÷r)   r   c                  óB   ^ • \ rS rSrSrSrSrSU 4S jjrS	S jrSr	U =r
$ )
Ú_CharSizesCacheé   z
Cache for wcwidth sizes.
é@   é   c                ó@   >• [         TU ]  5         [        5       U l        g r!   )Úsuperr'   r   Ú_long_strings)r$   Ú	__class__s    €r&   r'   Ú_CharSizesCache.__init__‡   s   ø€ Ü‰ÑÔä).«ˆÕr)   c                óV  ^ • [        U5      S:X  a  [        S[        U5      5      nO[        U 4S jU 5       5      nUT U'   [        U5      T R                  :”  aO  T R
                  nUR                  U5        [        U5      T R                  :”  a  UR                  5       nUT ;   a  T U	 U$ )Né   r   c              3  ó.   >#   • U  H
  nTU   v •  M     g 7fr!   r0   )Ú.0Úcr$   s     €r&   Ú	<genexpr>Ú._CharSizesCache.__missing__.<locals>.<genexpr>•   s   øé € Ð1ª& Q˜˜ažª&ùs   ƒ)	ÚlenÚmaxr   ÚsumÚLONG_STRING_MIN_LENr^   r5   ÚMAX_LONG_STRINGSÚpopleft)r$   ÚstringÚresultÚlong_stringsÚkey_to_removes   `    r&   Ú__missing__Ú_CharSizesCache.__missing__Œ   sŸ   ø€ ô ˆv‹;˜!ÓÜ˜œG F›OÓ,‰FäÔ1©&Ó1Ó1ˆFð ˆˆV‰ô ˆv‹;˜×1Ñ1Ó1Ø×-Ñ-ˆLØ×Ñ Ô'ä�<Ó  4×#8Ñ#8Ó8Ø ,× 4Ñ 4Ó 6�Ø  DÓ(Ø˜]Ð+àˆr)   )r^   rD   ©rn   ÚstrrB   Úint)rF   rG   rH   rI   rJ   rk   rl   r'   rr   rK   Ú__classcell__)r_   s   @r&   rX   rX      s%   ø† ñð ÐØÐ÷1÷
ò r)   rX   c                ó   • [         U    $ )z7
Return width of a string. Wrapper around ``wcwidth``.
)Ú_CHAR_SIZES_CACHE)rn   s    r&   r   r   «   s   € ô ˜VÑ$Ð$r)   c                 ó"   • [        [        S5      $ )z}
Returns `True` when the Python implementation supports
suspend-to-background. This is typically `False' on Windows systems.
ÚSIGTSTP)ÚhasattrÚsignalr0   r)   r&   r   r   ²   s   € ô
 ”6˜9Ó%Ð%r)   c                 ó(   • [         R                  S:H  $ )z!
True when we are using Windows.
Úwin32)ÚsysÚplatformr0   r)   r&   r   r   º   s   € ô �<‰<˜7Ñ"Ð"r)   c                 óF   • [         R                  S:X  a  SSKJn   U " 5       $ g)zK
True when we are using Windows, but VT100 escape sequences are supported.
r   r   ©Úis_win_vt100_enabledF)r€   r�   Úprompt_toolkit.output.windows10r„   rƒ   s    r&   Úis_windows_vt100_supportedr†   Á   s   € ô ‡|�|�wÓåHá#Ó%Ð%àr)   c                 ó|   • [         R                  S:H  =(       a#    [        R                  R	                  SS5      S:H  $ )z/
True when the ConEmu Windows console is used.
r   Ú
ConEmuANSIÚOFFÚON)r€   r�   ÚosÚenvironÚgetr0   r)   r&   r   r   Î   s,   € ô �<‰<˜7Ñ"×R¤r§z¡z§~¡~°lÀEÓ'JÈdÑ'RÐRr)   c                 óZ   • [         R                  " 5       R                  R                  S:H  $ )z2
True when the current thread is the main thread.
Ú_MainThread)Ú	threadingÚcurrent_threadr_   rF   r0   r)   r&   r   r   Õ   s$   € ô ×#Ò#Ó%×/Ñ/×8Ñ8¸MÑIÐIr)   c                 óh   • [         R                  R                  SS5      n U R                  5       S;   $ )z<
True if env variable is set to true (true, TRUE, True, 1).
ÚPROMPT_TOOLKIT_BELLÚtrue)Ú1r”   )r‹   rŒ   r�   Úlower©Úvalues    r&   r   r   Ü   s*   € ô �J‰J�N‰NÐ0°&Ó9€EØ�;‰;‹=˜MÑ)Ð)r)   c                 óB   • [         R                  R                  SS5      $ )z&Return the $TERM environment variable.ÚTERMÚ )r‹   rŒ   r�   r0   r)   r&   r   r   ä   s   € ä�:‰:�>‰>˜& "Ó%Ð%r)   Ú_Tc              #  ó8  #   • [        U 5      [        U5      :X  d   e[        U 5      S:”  d   e/ n/ n[        X5       H/  u  pEUS:”  d  M  UR                  U5        UR                  U5        M1     Un UnU (       d  [        S5      eU  Vs/ s H  nSPM     nn[        U 5      n[	        U5      n	Sn Sn
U
(       aT  Sn
[        [        U5      X5       H0  u  p´nX{   Xl-  [        U	5      -  :  d  M  Uv •  X{==   S-  ss'   Sn
M2     U
(       a  MT  US-  nMd  s  snf 7f)aÆ  
Generator that keeps yielding items from the items list, in proportion to
their weight. For instance::

    # Getting the first 70 items from this generator should have yielded 10
    # times A, 20 times B and 40 times C, all distributed equally..
    take_using_weights(['A', 'B', 'C'], [5, 10, 20])

:param items: List of items to take from.
:param weights: Integers representing the weight. (Numbers have to be
                integers, not floats.)
r   z+Did't got any items with a positive weight.TFrb   )rh   Úzipr5   Ú
ValueErrorri   ÚrangeÚfloat)ÚitemsÚweightsÚitems2Úweights2ÚitemÚwÚiÚalready_takenÚ
item_countÚ
max_weightÚaddingÚitem_iÚweights                r&   r   r   ì   s*  é € ô ˆu‹:œ˜W›Ó%Ð%Ð%Üˆu‹:˜‹>Ðˆ>ð €FØ€HÜ�uÖ&‰ˆØˆq�5Ø�M‰M˜$ÔØ�O‰O˜AÖñ 'ð
 €EØ€Gö ÜÐFÓGÐGñ !&Ó&¢˜1“Q¡€MÐ&Ü�U“€JÜ�W“€Jà	€AØ
àˆÞØˆFä(+¬E°*Ó,=¸uÖ(NÑ$�˜fØ Ñ(¨1©:¼¸jÓ8IÑ+IÕIØ’JØ!Ó)¨QÑ.Ó)Ø!’Fñ	 )O÷ ˆfð 	
ˆQ‰ˆñ ùò 'ùs&   ‚ADÁ
A DÂ
DÂADÃ/DÄDc                óX   • [        U 5      (       a  [        U " 5       5      $ [        U 5      $ )z$Turn callable or string into string.)Úcallabler   ru   r—   s    r&   r   r   "  ó!   € ä�‡�Ü‘e“g‹Ðä�5‹zÐr)   c                óX   • [        U 5      (       a  [        U " 5       5      $ [        U 5      $ )zTurn callable or int into int.)r°   r   rv   r—   s    r&   r   r   *  r±   r)   c                óX   • [        U 5      (       a  [        U " 5       5      $ [        U 5      $ )z"Turn callable or float into float.)r°   r   r¡   r—   s    r&   r   r   5  s"   € ä�‡�Ü™›Ó Ð ä�U‹|Ðr)   c                ó€   • U c)  [        [        R                  R                  SS5      5      $ U R	                  5       S;   $ )z«
True if this terminal type is considered "dumb".

If so, we should fall back to the simplest possible form of line editing,
without cursor positioning and color support.
rš   r›   )ÚdumbÚunknown)r   r‹   rŒ   r�   r–   )Úterms    r&   r   r   =  s5   € ð �|Ü¤§
¡
§¡¨v°rÓ :Ó;Ð;à�:‰:‹<Ð.Ñ.Ð.r)   rt   )rB   Úbool)rB   ru   )r¢   zlist[_T]r£   z	list[int]rB   zGenerator[_T, None, None])r˜   zCallable[[], str] | strrB   ru   )r˜   zCallable[[], int] | intrB   rv   )r˜   r   rB   r¡   r!   )r·   z
str | NonerB   r¸   )+Ú
__future__r   r‹   r}   r€   r�   Úcollectionsr   Útypingr   r   r   r   r	   r
   r   r   Ú__all__ÚmodulesÚSPHINX_AUTODOC_RUNNINGr   r   r   ru   rv   rX   ry   r   r   r   r†   r   r   r   r   rœ   r   r   r   r¡   r   r   r   r0   r)   r&   Ú<module>r¿      s  ðÝ "ã 	Û Û 
Û Ý ÷÷ ñ õ ò€ð( .°·±Ñ<Ð á
�) tÑ
,€ôCˆG�GÑô CôL	�> $Ñ'ô 	ô&�d˜3 ˜8‘nô &ñR $Ó%Ð ô%ô&ô#ô
ôSôJô*ô&ñ
 ˆTƒ]€ð3Øð3Ø'ð3àô3ôlôð �˜"˜e˜)Ñ$ eÐ+Ñ,€ô÷
/r)   