ó
    Ú°›jÀk  ã                  óh  • % S SK Jr  S SKJr  S SKrS SKrS SKrS SK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  SSKJr  SSKJr  SSKJr  SS	KJr  \R,                  (       a  S S
KJr  SSKJr  \
R6                  S:X  a  \R8                  S   rS\S'   O\R8                  S   rS\S'   \\ \!   \!\4   r"S\S'    " S S5      r#\RH                  S"S j5       r% " S S5      r& " S S\RN                  5      r( " S S5      r) " S S\RT                  5      r+      S#S jr, " S S5      r- " S  S!5      r.g)$é    )ÚannotationsN)ÚTracebackTypeé   )Ú_compat)Ú
formatting)Útermui)Úutils)Ú_find_binary_reader)ÚReadableBuffer)ÚCommandÚwin32Úsyszt.TypeAliasÚCaptureMode)r   ÚfdÚExceptionInfoc                  óš   • \ rS rSr% S\S'   S\S'   S\S'   SS jrSS jrSS	 jrSSS
 jjrSSS jjr	SSS jjr
SS jrSS jrSS jrSrg)ÚEchoingStdiné    ú
t.BinaryIOÚ_inputÚ_outputÚboolÚ_pausedc                ó*   • Xl         X l        SU l        g )NF©r   r   r   )ÚselfÚinputÚoutputs      ÚJ/home/mande/repo/quber/.venv/lib/python3.13/site-packages/click/testing.pyÚ__init__ÚEchoingStdin.__init__%   s   € ØŒØŒØˆ�ó    c                ó.   • [        U R                  U5      $ ©N)Úgetattrr   ©r   Úxs     r   Ú__getattr__ÚEchoingStdin.__getattr__*   s   € Ü�t—{‘{ AÓ&Ð&r"   c                ó^   • U R                   (       d  U R                  R                  U5        U$ r$   )r   r   Úwrite)r   Úrvs     r   Ú_echoÚEchoingStdin._echo-   s    € Ø�|�|Ø�L‰L×Ñ˜rÔ"àˆ	r"   c                óV   • U R                  U R                  R                  U5      5      $ r$   )r-   r   Úread©r   Úns     r   r0   ÚEchoingStdin.read3   s    € Ø�z‰z˜$Ÿ+™+×*Ñ*¨1Ó-Ó.Ð.r"   c                óV   • U R                  U R                  R                  U5      5      $ r$   )r-   r   Úread1r1   s     r   r5   ÚEchoingStdin.read16   s    € Ø�z‰z˜$Ÿ+™+×+Ñ+¨AÓ.Ó/Ð/r"   c                óV   • U R                  U R                  R                  U5      5      $ r$   )r-   r   Úreadliner1   s     r   r8   ÚEchoingStdin.readline9   s    € Ø�z‰z˜$Ÿ+™+×.Ñ.¨qÓ1Ó2Ð2r"   c                ó~   • U R                   R                  5        Vs/ s H  oR                  U5      PM     sn$ s  snf r$   )r   Ú	readlinesr-   r&   s     r   r;   ÚEchoingStdin.readlines<   s/   € Ø'+§{¡{×'<Ñ'<Ô'>Ó?Ò'> !—
‘
˜1–Ñ'>Ñ?Ð?ùÒ?s   �:c                óB   ^ • [        U 4S jT R                   5       5      $ )Nc              3  óF   >#   • U  H  nTR                  U5      v •  M     g 7fr$   )r-   )Ú.0r'   r   s     €r   Ú	<genexpr>Ú(EchoingStdin.__iter__.<locals>.<genexpr>@   s   øé € Ð7ª; a�D—J‘J˜q—M�Mª;ùs   ƒ!)Úiterr   ©r   s   `r   Ú__iter__ÚEchoingStdin.__iter__?   s   ø€ ÜÔ7¨4¯;ª;Ó7Ó7Ð7r"   c                ó,   • [        U R                  5      $ r$   )Úreprr   rC   s    r   Ú__repr__ÚEchoingStdin.__repr__B   s   € Ü�D—K‘KÓ Ð r"   r   N)r   r   r   r   ÚreturnÚNone)r'   ÚstrrJ   út.Any)r,   ÚbytesrJ   rN   )éÿÿÿÿ)r2   ÚintrJ   rN   )rJ   zlist[bytes])rJ   zcabc.Iterator[bytes]©rJ   rL   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__annotations__r    r(   r-   r0   r5   r8   r;   rD   rH   Ú__static_attributes__© r"   r   r   r       sA   ‡ ØÓØÓØƒMôô
'ôö/ö0ö3ô@ô8÷!r"   r   c              #  ó@   #   • U c  S v •  g SU l         S v •  SU l         g 7f)NTF)r   )Ústreams    r   Ú_pause_echor[   F   s   é € à�~ÜàˆŒÛØˆ�ùs   ‚c                  óV   • \ rS rSr% SrS\S'   S\S'   S\S'   SS jrSS	 jrSS
 jrSr	g)Ú
_FDCaptureéP   a>  Redirect a file descriptor to a temporary file for capture.

Saves the current target of *targetfd* via :func:`os.dup`, then
redirects it to a temporary file via :func:`os.dup2`. On
:meth:`stop`, restores the original ``fd`` and returns the captured
bytes. Inspired by Pytest's ``FDCapture``.

.. versionadded:: 8.4.0
rP   Ú	_targetfdÚsaved_fdzt.BinaryIO | NoneÚ_tmpfilec                ó,   • Xl         SU l        S U l        g ©NrO   )r_   r`   ra   )r   Útargetfds     r   r    Ú_FDCapture.__init___   s   € Ø!ŒØˆŒØˆ�r"   c                óò   • [         R                  " U R                  5      U l        [        R
                  " SS9U l        [         R                  " U R                  R                  5       U R                  5        g )Nr   )Ú	buffering)	ÚosÚdupr_   r`   ÚtempfileÚTemporaryFilera   Údup2ÚfilenorC   s    r   ÚstartÚ_FDCapture.startd   sG   € ÜŸš˜tŸ~™~Ó.ˆŒÜ ×.Ò.¸Ñ;ˆŒÜ
�Š�—‘×$Ñ$Ó&¨¯©Õ7r"   c                ó~  • U R                   c   S5       e[        R                  " U R                  U R                  5        [        R
                  " U R                  5        SU l        U R                   R                  S5        U R                   R                  5       nU R                   R                  5         S U l         U$ )Nz!_FDCapture.start() was not calledrO   r   )ra   rh   rl   r`   r_   ÚcloseÚseekr0   )r   Údatas     r   ÚstopÚ_FDCapture.stopi   s…   € Ø�}‰}Ñ(ÐMÐ*MÓMÐ(Ü
�Š�—‘˜tŸ~™~Ô.Ü
�Š�—‘ÔØˆŒØ�‰×Ñ˜1ÔØ�}‰}×!Ñ!Ó#ˆØ�‰×ÑÔØˆŒØˆr"   )r_   ra   r`   N)rd   rP   rJ   rK   ©rJ   rK   )rJ   rN   )
rR   rS   rT   rU   Ú__doc__rV   r    rn   rt   rW   rX   r"   r   r]   r]   P   s(   ‡ ñð ƒNØƒMØÓôô
8÷
	r"   r]   c                  ó\   ^ • \ rS rSr% SrS\S'   S	U 4S jjrS
U 4S jjrSU 4S jjrSr	U =r
$ )ÚBytesIOCopyéu   z\Patch ``io.BytesIO`` to let the written stream be copied to another.

.. versionadded:: 8.2
ú
io.BytesIOÚcopy_toc                ó.   >• [         TU ]  5         Xl        g r$   )Úsuperr    r|   )r   r|   Ú	__class__s     €r   r    ÚBytesIOCopy.__init__}   s   ø€ Ü‰ÑÔØ�r"   c                óV   >• [         TU ]  5         U R                  R                  5         g r$   )r~   Úflushr|   ©r   r   s    €r   r‚   ÚBytesIOCopy.flush�   s   ø€ Ü‰‰ŒØ�‰×ÑÕr"   c                óX   >• U R                   R                  U5        [        TU ]  U5      $ r$   )r|   r+   r~   )r   Úbr   s     €r   r+   ÚBytesIOCopy.write…   s$   ø€ Ø�‰×Ñ˜1ÔÜ‰w‰}˜QÓÐr"   ©r|   )r|   r{   rJ   rK   rv   )r†   r   rJ   rP   )rR   rS   rT   rU   rw   rV   r    r‚   r+   rW   Ú__classcell__©r   s   @r   ry   ry   u   s$   ø‡ ñð
 Ó÷÷÷ õ  r"   ry   c                  óB   • \ rS rSr% SrS\S'   S\S'   S\S'   SS jrS	rg
)ÚStreamMixeréŠ   zvMixes `<stdout>` and `<stderr>` streams.

The result is available in the ``output`` attribute.

.. versionadded:: 8.2
r{   r   ry   ÚstdoutÚstderrc                ó˜   • [         R                  " 5       U l        [        U R                  S9U l        [        U R                  S9U l        g )Nrˆ   )ÚioÚBytesIOr   ry   rŽ   r�   rC   s    r   r    ÚStreamMixer.__init__–   s/   € Ü—j’j“lˆŒÜ!¨$¯+©+Ñ6ˆŒÜ!¨$¯+©+Ñ6ˆ�r"   )r   r�   rŽ   Nrv   )rR   rS   rT   rU   rw   rV   r    rW   rX   r"   r   rŒ   rŒ   Š   s    ‡ ñð ÓØÓØÓ÷7r"   rŒ   c                  ó¦   ^ • \ rS rSr% SrS\S'   S\S'   S\S'             SU 4S jjrSS	 jrSU 4S
 jjr\	SS j5       r
\	SS j5       rSrU =r$ )Ú_NamedTextIOWrapperéœ   aá  A :class:`~io.TextIOWrapper` with custom ``name`` and ``mode``
that does not close its underlying buffer.

When ``CliRunner`` runs in ``fd`` mode, ``_original_fd`` is patched to
point at the saved (pre-redirection) ``fd``, so C-level consumers that call
:meth:`fileno` (like ``faulthandler`` or ``subprocess``) keep working. In
the default ``sys`` mode ``_original_fd`` stays at ``-1`` and
:meth:`fileno` raises :exc:`io.UnsupportedOperation`, matching the
pre-``8.3.3`` behavior.
rL   Ú_nameÚ_moderP   Ú_original_fdc                óN   >• [         TU ]  " U40 UD6  X l        X0l        SU l        g rc   )r~   r    r—   r˜   r™   )r   ÚbufferÚnameÚmodeÚkwargsr   s        €r   r    Ú_NamedTextIOWrapper.__init__¬   s)   ø€ ô 	‰Ò˜Ñ* 6Ò*ØŒ
ØŒ
ØˆÕr"   c                ó   • g)z£The buffer this object contains belongs to some other object,
so prevent the default ``__del__`` implementation from closing
that buffer.

.. versionadded:: 8.3.2
NrX   rC   s    r   rq   Ú_NamedTextIOWrapper.close¸   s   � r"   c                óX   >• U R                   S:¼  a  U R                   $ [        TU ]	  5       $ )zßReturn the file descriptor of the saved original stream when
``CliRunner`` runs in ``fd`` mode. Otherwise delegate to
:class:`~io.TextIOWrapper`, which raises
:exc:`io.UnsupportedOperation` for a ``BytesIO``-backed buffer.
r   )r™   r~   rm   rƒ   s    €r   rm   Ú_NamedTextIOWrapper.filenoÀ   s,   ø€ ð ×Ñ Ó!Ø×$Ñ$Ð$Ü‰w‰~ÓÐr"   c                ó   • U R                   $ r$   )r—   rC   s    r   rœ   Ú_NamedTextIOWrapper.nameÊ   ó   € à�z‰zÐr"   c                ó   • U R                   $ r$   )r˜   rC   s    r   r�   Ú_NamedTextIOWrapper.modeÎ   r¦   r"   )r˜   r—   r™   )
r›   r   rœ   rL   r�   rL   rž   rM   rJ   rK   rv   )rJ   rP   rQ   )rR   rS   rT   rU   rw   rV   r    rq   rm   Úpropertyrœ   r�   rW   r‰   rŠ   s   @r   r•   r•   œ   s�   ø‡ ñ	ð ƒJØƒJØÓð
àð
ð ð
ð ð	
ð
 ð
ð 
÷
ô÷ ð óó ðð óó ör"   r•   c                ó  • [        U S5      (       a0  [        [        R                  " SU 5      5      nUb  U$ [	        S5      eU c  Sn O&[        U [        5      (       a  U R                  U5      n [        R                  " U 5      $ )Nr0   zt.IO[t.Any]z.Could not find binary reader for input stream.r"   )
Úhasattrr
   ÚtÚcastÚ	TypeErrorÚ
isinstancerL   Úencoder‘   r’   )r   Úcharsetr,   s      r   Úmake_input_streamr²   Ó   sp   € ô ˆu�f×ÑÜ ¤§¢¨°uÓ!=Ó>ˆà‰>ØˆIäÐHÓIÐIà�}Ø‰Ü	�Eœ3×	Ñ	Ø—‘˜WÓ%ˆä�:Š:�eÓÐr"   c                  óâ   • \ rS rSr% SrS\S'   S\S'   S\S'   S\S'   S	\S
'   S\S'   S\S'   S\S'    S                 SS jjr\SS j5       r\SS j5       r	\SS j5       r
SS jrSrg)ÚResultéç   a  Holds the captured result of an invoked CLI script.

:param runner: The runner that created the result
:param stdout_bytes: The standard output as bytes.
:param stderr_bytes: The standard error as bytes.
:param output_bytes: A mix of ``stdout_bytes`` and ``stderr_bytes``, as the
    user would see  it in its terminal.
:param return_value: The value returned from the invoked command.
:param exit_code: The exit code as integer.
:param exception: The exception that happened if one did.
:param exc_info: Exception information (exception type, exception instance,
    traceback type).

.. versionchanged:: 8.2
    ``stderr_bytes`` no longer optional, ``output_bytes`` introduced and
    ``mix_stderr`` has been removed.

.. versionadded:: 8.0
    Added ``return_value``.
Ú	CliRunnerÚrunnerrN   Ústdout_bytesÚstderr_bytesÚoutput_bytesrM   Úreturn_valuerP   Ú	exit_codeúBaseException | NoneÚ	exceptionúExceptionInfo | NoneÚexc_infoNc	                ód   • Xl         X l        X0l        X@l        XPl        X`l        Xpl        X€l        g r$   ©r·   r¸   r¹   rº   r»   r¼   r¾   rÀ   )	r   r·   r¸   r¹   rº   r»   r¼   r¾   rÀ   s	            r   r    ÚResult.__init__  s0   € ð ŒØ(ÔØ(ÔØ(ÔØ(ÔØ"ŒØ"ŒØ �r"   c                ó‚   • U R                   R                  U R                  R                  S5      R	                  SS5      $ )zöThe terminal output as unicode string, as the user would see it.

.. versionchanged:: 8.2
    No longer a proxy for ``self.stdout``. Now has its own independent stream
    that is mixing `<stdout>` and `<stderr>`, in the order they were written.
Úreplaceú
Ú
)rº   Údecoder·   r±   rÅ   rC   s    r   r   ÚResult.output  s9   € ð × Ñ ×'Ñ'¨¯©×(;Ñ(;¸YÓG×OÑOØ�Dó
ð 	
r"   c                ó‚   • U R                   R                  U R                  R                  S5      R	                  SS5      $ )z&The standard output as unicode string.rÅ   rÆ   rÇ   )r¸   rÈ   r·   r±   rÅ   rC   s    r   rŽ   ÚResult.stdout&  s9   € ð × Ñ ×'Ñ'¨¯©×(;Ñ(;¸YÓG×OÑOØ�Dó
ð 	
r"   c                ó‚   • U R                   R                  U R                  R                  S5      R	                  SS5      $ )z‡The standard error as unicode string.

.. versionchanged:: 8.2
    No longer raise an exception, always returns the `<stderr>` string.
rÅ   rÆ   rÇ   )r¹   rÈ   r·   r±   rÅ   rC   s    r   r�   ÚResult.stderr-  s9   € ð × Ñ ×'Ñ'¨¯©×(;Ñ(;¸YÓG×OÑOØ�Dó
ð 	
r"   c                óŠ   • U R                   (       a  [        U R                   5      OSnS[        U 5      R                   SU S3$ )NÚokayÚ<Ú Ú>)r¾   rG   ÚtyperR   )r   Úexc_strs     r   rH   ÚResult.__repr__8  s8   € Ø*.¯.¯.”$�t—~‘~Ô&¸fˆØ”4˜“:×&Ñ&Ð' q¨¨	°Ð3Ð3r"   )rÀ   r¾   r¼   rº   r»   r·   r¹   r¸   r$   )r·   r¶   r¸   rN   r¹   rN   rº   rN   r»   rM   r¼   rP   r¾   r½   rÀ   r¿   rJ   rK   rQ   )rR   rS   rT   rU   rw   rV   r    r©   r   rŽ   r�   rH   rW   rX   r"   r   r´   r´   ç   sÛ   ‡ ñð* ÓØÓØÓØÓØÓØƒNØ#Ó#Ø"Ó"ð *.ð!àð!ð ð!ð ð	!ð
 ð!ð ð!ð ð!ð (ð!ð 'ð!ð 
õ!ð( ó	
ó ð	
ð ó
ó ð
ð ó
ó ð
÷4r"   r´   c                  óD  • \ rS rSr% SrS\S'   S\S'   S\S'   S\S	'   S
\S'        S           SS jjrSS jr S   SS jjr\	R                     S       SS jj5       r     S               SS jjr\	R                   S   SS jj5       rSrg)r¶   i=  a  The CLI runner provides functionality to invoke a Click command line
script for unittesting purposes in a isolated environment.  This only
works in single-threaded systems without any concurrency as it changes the
global interpreter state.

:param charset: the character set for the input and output data.
:param env: a dictionary with environment variables for overriding.
:param echo_stdin: if this is set to `True`, then reading from `<stdin>` writes
                   to `<stdout>`.  This is useful for showing examples in
                   some circumstances.  Note that regular prompts
                   will automatically echo the input.
:param catch_exceptions: Whether to catch any exceptions other than
                         ``SystemExit`` when running :meth:`~CliRunner.invoke`.
:param capture: Selects the output capture strategy. ``sys`` (default)
    captures Python-level writes only and leaves
    :meth:`sys.stdout.fileno` raising :exc:`io.UnsupportedOperation`, so
    user code that calls :func:`os.dup2` on ``sys.stdout.fileno()`` cannot
    clobber the host runner's stdout. ``fd`` redirects file descriptors
    ``1`` and ``2`` via :func:`os.dup2` to a temporary file, also catching
    output from stale stream references, C extensions, and subprocesses.
    ``fd`` is not supported on Windows.

.. versionchanged:: 8.4.0
    Added the ``capture`` parameter. The default ``sys`` mode no longer
    exposes the original fd through :meth:`fileno`, reverting the change
    introduced in ``8.3.3`` that broke Pytest's ``fd``-level capture
    teardown. Use ``capture="fd"`` to restore that behavior with proper
    isolation. :issue:`3384`

.. versionchanged:: 8.2
    Added the ``catch_exceptions`` parameter.

.. versionchanged:: 8.2
    ``mix_stderr`` parameter has been removed.
rL   r±   úcabc.Mapping[str, str | None]Úenvr   Ú
echo_stdinÚcatch_exceptionsr   ÚcaptureNc                óÔ   • US;  a  [        SU< S35      eUS:X  a$  [        R                  S:X  a  [        SU< S35      eXl        U=(       d    0 U l        X0l        X@l        XPl        g )N>   r   r   zcapture=z) is not valid. Choose from 'sys' or 'fd'.r   r   z( is not supported on Windows. Use 'sys'.)Ú
ValueErrorr   Úplatformr±   rØ   rÙ   rÚ   rÛ   )r   r±   rØ   rÙ   rÚ   rÛ   s         r   r    ÚCliRunner.__init__h  sv   € ð ˜-Ó'ÜØ˜7™+Ð%NÐOóð ð �d‹?œsŸ|™|¨wÓ6ÜØ˜7™+Ð%MÐNóð ð ŒØ—9˜"ˆŒØ$ŒØ 0ÔØ�r"   c                ó,   • UR                   =(       d    S$ )z†Given a command object it will return the default program name
for it.  The default is the `name` attribute or ``"root"`` if not
set.
Úroot)rœ   )r   Úclis     r   Úget_default_prog_nameÚCliRunner.get_default_prog_name~  s   € ð
 �x‰x×!˜6Ð!r"   c                ó`   • [        U R                  5      nU(       a  UR                  U5        U$ )z8Returns the environment overrides for invoking a script.)ÚdictrØ   Úupdate)r   Ú	overridesr,   s      r   Úmake_envÚCliRunner.make_env…  s%   € ô �$—(‘(‹^ˆÞØ�I‰I�iÔ Øˆ	r"   c              #  óz	  ^^^#   • [        XR                  5      nSn[        R                  n[        R                  n[        R
                  n[        R                  n	S[        l        U R                  U5      n[        5       n
U R                  (       a9  [        R                  " [        R                  [        XJR                  5      5      =pE[        X@R                  SSS9=[        l        mU R                  (       a  STl        [        U
R                  U R                  SSS9[        l        [        U
R
                  U R                  S	SS
S9[        l        [#        U5      SSU4S jjj5       n[#        U5      SSU4S jjj5       n[#        U5      SS j5       nUm S     SU4S jjjn[$        R&                  n[$        R(                  n[$        R*                  n[,        R.                  n[0        R.                  n[2        R4                  R6                  mU[$        l        U[$        l        U[$        l        U[,        l        U[0        l           S           SU4S jjjnU[2        R4                  l        0 n UR9                  5        HR  u  nn[:        R<                  R?                  U5      UU'   Uc   [:        R<                  U	 M?  U[:        R<                  U'   MT     U
R                  U
R
                  U
RB                  4v •  UR9                  5        H0  u  nnUc   [:        R<                  U	 M  U[:        R<                  U'   M2     U[        l        U[        l        U[        l        U[$        l        U[$        l        U[$        l        U[,        l        U[0        l        U	[        l        T[2        R4                  l        g! [@         a     GMF  f = f! [@         a     MÌ  f = f! UR9                  5        HA  u  nnUc%   [:        R<                  U	 M  ! [@         a     M*  f = fU[:        R<                  U'   MC     U[        l        U[        l        U[        l        U[$        l        U[$        l        U[$        l        U[,        l        U[0        l        U	[        l        T[2        R4                  l        f = f7f)a¼  A context manager that sets up the isolation for invoking of a
command line tool.  This sets up `<stdin>` with the given input data
and `os.environ` with the overrides from the given dictionary.
This also rebinds some internals in Click to be mocked (like the
prompt functionality).

This is automatically done in the :meth:`invoke` method.

:param input: the input stream to put into `sys.stdin`.
:param env: the environment overrides as dictionary.
:param color: whether the output should contain color codes. The
              application can still override this explicitly.

.. versionadded:: 8.2
    An additional output stream is returned, which is a mix of
    `<stdout>` and `<stderr>` streams.

.. versionchanged:: 8.2
    Always returns the `<stderr>` stream.

.. versionchanged:: 8.0
    `<stderr>` is opened with ``errors="backslashreplace"``
    instead of the default ``"strict"``.

.. versionchanged:: 4.0
    Added the ``color`` parameter.
Nr^   z<stdin>Úr)Úencodingrœ   r�   r   z<stdout>Úwz<stderr>Úbackslashreplace)rí   rœ   r�   Úerrorsc                óH  >• [         R                  R                  U =(       d    S5         [        T5      R	                  S5      n[         R                  R                  U S35        [         R                  R                  5         U$ ! [
         a  n[        5       UeS nAff = f)NÚ rÆ   rÇ   )r   rŽ   r+   ÚnextÚrstripÚStopIterationÚEOFErrorr‚   )ÚpromptÚvalÚeÚ
text_inputs      €r   Úvisible_inputÚ*CliRunner.isolation.<locals>.visible_inputÚ  s~   ø€ ä�J‰J×Ñ˜VŸ\ rÔ*ð(Ü˜:Ó&×-Ñ-¨fÓ5�ô �J‰J×Ñ ˜u B˜ZÔ(Ü�J‰J×ÑÔØˆJøô	 !ó (Ü“j aÐ'ûð(ús   «B Â
B!ÂBÂB!c                ó  >• [         R                  R                  U =(       d    S S35        [         R                  R                  5          [	        T5      R                  S5      $ ! [         a  n[        5       UeS nAff = f)Nrò   rÇ   rÆ   )r   rŽ   r+   r‚   ró   rô   rõ   rö   )r÷   rù   rú   s     €r   Úhidden_inputÚ)CliRunner.isolation.<locals>.hidden_inputå  se   ø€ ä�J‰J×Ñ §¨"˜~¨RÐ0Ô1Ü�J‰J×ÑÔð(Ü˜JÓ'×.Ñ.¨vÓ6Ð6øÜ ó (Ü“j aÐ'ûð(ús   ÁA& Á&
B Á0A;Á;B c                óÌ   • [         R                  R                  S5      nU (       a  [         R                  R	                  U5        [         R                  R                  5         U$ )Nr   )r   Ústdinr0   rŽ   r+   r‚   )ÚechoÚchars     r   Ú_getcharÚ%CliRunner.isolation.<locals>._getcharî  s>   € ä—9‘9—>‘> !Ó$ˆDæÜ—
‘
× Ñ  Ô&ä�J‰J×ÑÔØˆKr"   c                ó&   >• Uc  T(       + $ U(       + $ r$   rX   )rZ   ÚcolorÚdefault_colors     €r   Úshould_strip_ansiÚ.CliRunner.isolation.<locals>.should_strip_ansiú  s   ø€ ð ‰}Ø(Ô(Ð(Ø”9Ðr"   c                ój   >• Uc  [         R                  nUc  [         R                  nT" U 4XUS.UD6  g)aŠ  Default ``pdb.Pdb`` to real terminal streams during
``CliRunner`` isolation.

Without this patch, ``pdb.Pdb.__init__`` inherits from
``cmd.Cmd`` which falls back to ``sys.stdin``/``sys.stdout``
when no explicit streams are provided. During isolation
those are ``BytesIO``-backed wrappers, so the debugger
reads from an empty buffer and writes to captured output,
making interactive debugging impossible.

By defaulting to ``sys.__stdin__``/``sys.__stdout__`` (the
original terminal streams Python preserves regardless of
redirection), debuggers can interact with the user while
``click.echo`` output is still captured normally.

This covers ``pdb.set_trace()``, ``breakpoint()``,
``pdb.post_mortem()``, and debuggers that subclass
``pdb.Pdb`` (ipdb, pdbpp). Explicit ``stdin``/``stdout``
arguments are honored and not overridden. Debuggers that
do not subclass ``pdb.Pdb`` (pudb, debugpy) are not
covered.
N)Úcompletekeyr  rŽ   )r   Ú	__stdin__Ú
__stdout__)r   r  r  rŽ   rž   Úold_pdb_inits        €r   Ú_patched_pdb_initÚ.CliRunner.isolation.<locals>._patched_pdb_init  s>   ø€ ð: ‰}ÜŸ™�Ø‰~ÜŸ™�ÙØðØ"-À6ñØMSór"   r$   )r÷   z
str | NonerJ   rL   )r  r   rJ   rL   )NN)rZ   zt.IO[t.Any] | Noner  úbool | NonerJ   r   )ÚtabNN)r   zpdb.Pdbr  rL   r  út.IO[str] | NonerŽ   r  rž   rM   rJ   rK   )"r²   r±   r   r  rŽ   r�   r   ÚFORCED_WIDTHré   rŒ   rÙ   r¬   r­   ÚBinaryIOr   r•   Ú_CHUNK_SIZEr[   r   Úvisible_prompt_funcÚhidden_prompt_funcr  r	   r	  r   ÚpdbÚPdbr    Úitemsrh   ÚenvironÚgetÚ	Exceptionr   )r   r   rØ   r  Úbytes_inputÚ
echo_inputÚ	old_stdinÚ
old_stdoutÚ
old_stderrÚold_forced_widthÚstream_mixerrû   rþ   r  r	  Úold_visible_prompt_funcÚold_hidden_prompt_funcÚold__getchar_funcÚold_should_strip_ansiÚold__compat_should_strip_ansir  Úold_envÚkeyÚvaluer  r  rú   s                           @@@r   Ú	isolationÚCliRunner.isolationŽ  s%  úé € ôD (¨¯|©|Ó<ˆØˆ
ä—I‘Iˆ	Ü—Z‘Zˆ
Ü—Z‘Zˆ
Ü%×2Ñ2ÐØ"$Œ
Ôà�m‰m˜CÓ ˆä"“}ˆà�?�?Ü'(§v¢vÜ—
‘
œL¨×6IÑ6IÓJó(ð ˆKô "5Ø§,¡,°YÀSñ"
ð 	
ŒŒ	�Jð �?�?ð &'ˆJÔ"ä(Ø×ÑØ—\‘\ØØñ	
ŒŒ
ô )Ø×ÑØ—\‘\ØØØ%ñ
ŒŒ
ô 
�ZÓ	 ÷	ð 	ó 
!ð	ô 
�ZÓ	 ÷	(ð 	(ó 
!ð	(ô 
�ZÓ	 ó	ó 
!ð	ð ˆð EIð	Ø&ð	Ø6Að	à÷	ð 	ô #)×"<Ñ"<ÐÜ!'×!:Ñ!:ÐÜ"ŸO™OÐÜ %× 7Ñ 7ÐÜ(/×(AÑ(AÐ%Ü—w‘w×'Ñ'ˆØ%2ŒÔ"Ø$0ŒÔ!Ø"ŒŒØ"3ŒÔØ$5ŒÔ!ð  %Ø&*Ø'+ð	#	Øð#	àð#	ð $ð#	ð %ð	#	ð
 ð#	ð ÷#	ð #	ðJ -Œ�‰Ôàˆð	,Ø!Ÿi™ižk‘
��UÜ!Ÿz™zŸ~™~¨cÓ2�˜‘Ø‘=ðÜŸJ™J sšOð ',”B—J‘J˜s“Oñ *ð  ×&Ñ&¨×(;Ñ(;¸\×=PÑ=PÐQÒQà%Ÿm™mžo‘
��UØ‘=ðÜŸJ™J sšOð ',”B—J‘J˜s“Oñ .ð $ŒCŒJØ#ŒCŒJØ!ŒCŒIØ)@ŒFÔ&Ø(>ŒFÔ%Ø/ŒFŒOØ&;ŒEÔ#Ø(EŒGÔ%Ø&6ŒJÔ#Ø+ŒC�G‰GÕøô/ %ó Ûðûô %ó Úðûð	 &Ÿm™mžo‘
��UØ‘=ðÜŸJ™J sšOøÜ$ó Úðúð ',”B—J‘J˜s“Oñ .ð $ŒCŒJØ#ŒCŒJØ!ŒCŒIØ)@ŒFÔ&Ø(>ŒFÔ%Ø/ŒFŒOØ&;ŒEÔ#Ø(EŒGÔ%Ø&6ŒJÔ#Ø+ŒC�G‰GÕüsŒ   …I8R;É>;O) Ê:OË>O) Ì	R;Ì#OÌ4BR;Ï
OÏO) ÏOÏO) Ï
O&Ï"R;Ï%O&Ï&R;Ï)R8ÐPÐR8Ð
P%	Ð!R8Ð$P%	Ð%BR8Ò8R;c                ó  • SnUc  U R                   nSn	Sn
U R                  S:X  a7  [        S5      n	[        S5      n
 U	R                  5         U
R                  5         U R                  X4US9 nU	bA  U
b>  U	R                  [        R                  l	        U
R                  [        R                  l	        SnSnSn[        U[        5      (       a  [        R                  " U5      n UR                  S5      n UR$                  " SU=(       d    SUS	.UD6n[        R                  R7                  5         [        R                  R7                  5         U	bY  U
bV  U	R9                  5       nU
R9                  5       nU(       a  US   R3                  U5        U(       a  US   R3                  U5        US   R;                  5       nUS   R;                  5       nUS   R;                  5       n SSS5        [=        U WWWWWWUS9$ ! [         a    S=pš GN±f = f! [          a    U R#                  U5      n GN;f = f! [&         a®  n[        R(                  " 5       n[*        R,                  " S
UR.                  5      nUc  SnUS:w  a  Un[        U[0        5      (       dI  [        R                  R3                  [        U5      5        [        R                  R3                  S5        SnUn SnAGNÓSnAf[4         a,  nU(       d  e UnSn[        R(                  " 5       n SnAGNSnAff = f! [        R                  R7                  5         [        R                  R7                  5         U	bY  U
bV  U	R9                  5       nU
R9                  5       nU(       a  US   R3                  U5        U(       a  US   R3                  U5        US   R;                  5       nUS   R;                  5       nUS   R;                  5       nf = f! , (       d  f       GN= f)ak  Invokes a command in an isolated environment.  The arguments are
forwarded directly to the command line script, the `extra` keyword
arguments are passed to the :meth:`~clickpkg.Command.main` function of
the command.

This returns a :class:`Result` object.

:param cli: the command to invoke
:param args: the arguments to invoke. It may be given as an iterable
             or a string. When given as string it will be interpreted
             as a Unix shell command. More details at
             :func:`shlex.split`.
:param input: the input data for `sys.stdin`.
:param env: the environment overrides.
:param catch_exceptions: Whether to catch any other exceptions than
                         ``SystemExit``. If :data:`None`, the value
                         from :class:`CliRunner` is used.
:param extra: the keyword arguments to pass to :meth:`main`.
:param color: whether the output should contain color codes. The
              application can still override this explicitly.

.. versionadded:: 8.2
    The result object has the ``output_bytes`` attribute with
    the mix of ``stdout_bytes`` and ``stderr_bytes``, as the user would
    see it in its terminal.

.. versionchanged:: 8.2
    The result object always returns the ``stderr_bytes`` stream.

.. versionchanged:: 8.0
    The result object has the ``return_value`` attribute with
    the value returned from the invoked command.

.. versionchanged:: 4.0
    Added the ``color`` parameter.

.. versionchanged:: 3.0
    Added the ``catch_exceptions`` parameter.

.. versionchanged:: 3.0
    The result object has the ``exc_info`` attribute with the
    traceback if available.
Nr   r   é   )r   rØ   r  r   Ú	prog_namerX   )Úargsr3  zint | t.Any | NonerÇ   rÂ   )rÚ   rÛ   r]   rn   ÚOSErrorr/  r`   r   rŽ   r™   r�   r¯   rL   ÚshlexÚsplitÚpopÚKeyErrorrã   ÚmainÚ
SystemExitrÀ   r¬   r­   ÚcoderP   r+   r  r‚   rt   Úgetvaluer´   )r   râ   r4  r   rØ   rÚ   r  ÚextrarÀ   Úcap_outÚcap_errÚ
outstreamsr»   r¾   r¼   r3  rù   Úe_codeÚfd_outÚfd_errrŽ   r�   r   s                          r   ÚinvokeÚCliRunner.invokeT  sj  € ðj ˆØÑ#Ø#×4Ñ4Ðð &*ˆØ%)ˆà�<‰<˜4ÓÜ  “mˆGÜ  “mˆGð)Ø—‘”Ø—‘”ð �^‰^ %¸ˆ^Ñ>À*ð Ñ" wÑ':Ø*1×*:Ñ*:”—
‘
Ô'Ø*1×*:Ñ*:”—
‘
Ô'àˆLØ.2ˆIØˆIä˜$¤×$Ñ$Ü—{’{ 4Ó(�ð<Ø!ŸI™I kÓ2�	ð*2Ø"ŸxšxÐV¨T¯Z°RÀ9ÑVÐPUÑV�ô2 —
‘
× Ñ Ô"Ü—
‘
× Ñ Ô"ð
 Ñ&¨7Ñ+>Ø$Ÿ\™\›^�FØ$Ÿ\™\›^�FÞØ" 1™×+Ñ+¨FÔ3ÞØ" 1™×+Ñ+¨FÔ3à# A™×/Ñ/Ó1�Ø# A™×/Ñ/Ó1�Ø# A™×/Ñ/Ó1‘÷} ?ô@ ØØØØØ%ØØØñ	
ð 		
øôG ó )Ø$(Ð(�š'ð)ûô( ó <Ø ×6Ñ6°sÓ;“	ð<ûô
 ó #ÜŸ<š<›>�ÜŸšÐ 4°a·f±fÓ=�à‘>Ø�Fà˜Q“;Ø !�Iä! &¬#×.Ñ.Ü—J‘J×$Ñ$¤S¨£[Ô1Ü—J‘J×$Ñ$ TÔ*Ø�Fà"–	ûäó *Þ'ØØ�	Ø�	ÜŸ<š<›>–ûð*ûô —
‘
× Ñ Ô"Ü—
‘
× Ñ Ô"ð
 Ñ&¨7Ñ+>Ø$Ÿ\™\›^�FØ$Ÿ\™\›^�FÞØ" 1™×+Ñ+¨FÔ3ÞØ" 1™×+Ñ+¨FÔ3à# A™×/Ñ/Ó1�Ø# A™×/Ñ/Ó1�Ø# A™×/Ñ/Ó1‘ú÷} ?Ö>ús‡   ½ G> Á-A6O9Ã$HÃ6H4ÄCO9Ç>HÈHÈH1È-O9È0H1È1O9È4
L È>B#K'Ë!L#Ë'L Ë4!LÌL#ÌL Ì L#Ì#CO6Ï6O9Ï9
Pc              #  óÐ  #   • SSK nUR                  S[        SS9  [        R                  " 5       n[
        R                  " US9n[        R                  " U5         Uv •  [        R                  " U5        Uc  SSKn UR                  U5        gg! [         a     gf = f! [        R                  " U5        Uc'  SSKn UR                  U5        f ! [         a     f f = ff = f7f)aK  A context manager that creates a temporary directory and
changes the current working directory to it. This isolates tests
that affect the contents of the CWD to prevent them from
interfering with each other.

.. warning::
    This helper predates Python 3 and modern pytest, and is not
    thread-safe: it relies on :func:`os.chdir`, which mutates
    process-global state, and :meth:`invoke` swaps the
    process-global standard streams too. Parallelize tests with
    processes (``pytest-xdist``), not threads. Locking the
    runner (:pr:`3511`, :pr:`3520`, :pr:`3530`) and a
    ``set_filesystem()`` API (:issue:`3123`) were declined:
    neither removes the global-state mutation. See :issue:`3700`
    and :issue:`3501`.

:param temp_dir: Create the temporary directory under this
    directory. If given, the created directory is not removed
    when exiting.

.. deprecated:: 8.5.0
    Will be removed in Click 9.0. Use
    :class:`tempfile.TemporaryDirectory` or pytest's
    ``tmp_path`` fixture with absolute paths instead.

.. versionchanged:: 8.0
    Added the ``temp_dir`` parameter.
r   Nz£'isolated_filesystem' is deprecated and will be removed in Click 9.0. Use 'tempfile.TemporaryDirectory' or pytest's 'tmp_path' fixture with absolute paths instead.é   )Ú
stacklevel)Údir)ÚwarningsÚwarnÚDeprecationWarningrh   Úgetcwdrj   ÚmkdtempÚchdirÚshutilÚrmtreer5  )r   Útemp_dirrK  ÚcwdÚdtrQ  s         r   Úisolated_filesystemÚCliRunner.isolated_filesystemå  s×   é € ó@ 	à�‰ð4ô Øð 	ñ 	
ô �iŠi‹kˆÜ×Ò (Ñ+ˆÜ
�Š�Œð	ØŠHä�HŠH�SŒMàÑÛðØ—M‘M "Õ%ð	  øô
 ó Ùðûô �HŠH�SŒMàÑÛðØ—M‘M "Õ%øÜó Ùðúð  üsf   ‚AC&ÁB! Á C&Á>B ÂC&Â
BÂC&ÂBÂC&Â!C#Ã CÃC#Ã
CÃC#ÃCÃC#Ã#C&)rÛ   rÚ   r±   rÙ   rØ   )zutf-8NFTr   )r±   rL   rØ   ú$cabc.Mapping[str, str | None] | NonerÙ   r   rÚ   r   rÛ   r   rJ   rK   )râ   r   rJ   rL   r$   )rè   rX  rJ   r×   )NNF)r   ú str | bytes | t.IO[t.Any] | NonerØ   rX  r  r   rJ   z9cabc.Generator[tuple[io.BytesIO, io.BytesIO, io.BytesIO]])NNNNF)râ   r   r4  zstr | cabc.Sequence[str] | Noner   rY  rØ   rX  rÚ   r  r  r   r>  rM   rJ   r´   )rS  zstr | os.PathLike[str] | NonerJ   zcabc.Generator[str])rR   rS   rT   rU   rw   rV   r    rã   ré   Ú
contextlibÚcontextmanagerr/  rE  rV  rW   rX   r"   r   r¶   r¶   =  s†  ‡ ñ"ðH ƒLØ	&Ó&ØÓØÓØÓð Ø48Ø Ø!%Ø$ðàðð 2ðð ð	ð
 ðð ðð 
õô,"ð AEðØ=ðà	&õð ×Ñð 37Ø48Øð	C,à/ðC,ð 2ðC,ð ð	C,ð
 
CôC,ó ðC,ðP 15Ø26Ø48Ø(,ØðO
àðO
ð .ðO
ð 0ð	O
ð
 2ðO
ð &ðO
ð ðO
ð ðO
ð 
õO
ðb ×Ñà8<ð8Ø5ð8à	ô8ó ó8r"   r¶   )rZ   zEchoingStdin | NonerJ   zcabc.Generator[None])r   rY  r±   rL   rJ   r   )/Ú
__future__r   Úcollections.abcÚabcÚcabcrZ  r‘   rh   r  r6  r   rj   Útypingr¬   Útypesr   rò   r   r   r   r	   r
   ÚTYPE_CHECKINGÚ	_typeshedr   Úcorer   rÞ   ÚLiteralr   rV   ÚtuplerÓ   ÚBaseExceptionr   r   r[  r[   r]   r’   ry   rŒ   ÚTextIOWrapperr•   r²   r´   r¶   rX   r"   r   Ú<module>ri     s"  ðÞ "å Û Û 	Û 	Û 
Û Û 
Û Û Ý å Ý Ý Ý Ý (à‡?‡?Ý(åà‡<�<�7ÓØ Ÿy™y¨Ñ/€K�Ô/à Ÿy™y¨Ñ5€K�Ó5Ø" 4¨Ñ#6¸À}Ð#TÑU€ˆ{Ó U÷#!ñ #!ðL ×Ñóó ð÷"ñ "ôJ �"—*‘*ô  ÷*7ñ 7ô$4˜"×*Ñ*ô 4ðnØ+ðØ69ðàô÷(S4ñ S4÷laò ar"   