
    Z[tj	Y                        d dl Z d dlZd dlZd dlZd dlmZmZ d dlmZm	Z	m
Z
mZmZmZ ddlmZ ddlmZ ddlmZ erddlmZmZ dd	lmZ  ed      Zee	   Zd
Z G d dej8                        Z G d dej:                        Z G d de      Z G d dej@                        Z! G d dejD                        Z# G d dejH                        Z% G d d      Z& ed      Z' eded
e	f         Z(de'de'fdZ) G d d       Z* G d! d"      Z+ G d# d$      Z, G d% d&e,      Z- G d' d(e,      Z. G d) d*      Z/ G d+ d,      Z0 G d- d.ejb                        Z2y)/    N)CallableSequence)TYPE_CHECKINGAnyClassVarOptionalTypeVarcast   )_click)types)CompletionItem)TyperCommand
TyperGroup)Typer.c                       e Zd ZdZy)ContextaB  
    The [`Context`](https://click.palletsprojects.com/en/stable/api/#click.Context) has some additional data about the current execution of your program.
    When declaring it in a [callback](https://typer.tiangolo.com/tutorial/options/callback-and-context/) function,
    you can access this additional information.
    N__name__
__module____qualname____doc__     u/home/cube/projects/richard/traning coach/task-12-independent-verification-r8/tests/profile-test-deps/typer/models.pyr   r      s     	r   r   c                       e Zd ZdZy)FileTexta  
    Gives you a file-like object for reading text, and you will get a `str` data from it.
    The default mode of this class is `mode="r"`.

    **Example**

    ```python
    from typing import Annotated

    import typer

    app = typer.Typer()

    @app.command()
    def main(config: Annotated[typer.FileText, typer.Option()]):
        for line in config:
            print(f"Config line: {line}")

    if __name__ == "__main__":
        app()
    ```
    Nr   r   r   r   r   r   )       . 	r   r   c                       e Zd ZdZy)FileTextWritea  
    You can use this class for writing text. Alternatively, you can use `FileText` with `mode="w"`.
    The default mode of this class is `mode="w"`.

    **Example**

    ```python
    from typing import Annotated

    import typer

    app = typer.Typer()

    @app.command()
    def main(config: Annotated[typer.FileTextWrite, typer.Option()]):
        config.write("Some config written by the app")
        print("Config written")

    if __name__ == "__main__":
        app()
    ```
    Nr   r   r   r   r    r    D   r   r   r    c                       e Zd ZdZy)FileBinaryReada  
    You can use this class to read binary data, receiving `bytes`.
    The default mode of this class is `mode="rb"`.
    It is useful for reading binary files like images:

    **Example**

    ```python
    from typing import Annotated

    import typer

    app = typer.Typer()

    @app.command()
    def main(file: Annotated[typer.FileBinaryRead, typer.Option()]):
        processed_total = 0
        for bytes_chunk in file:
            # Process the bytes in bytes_chunk
            processed_total += len(bytes_chunk)
            print(f"Processed bytes total: {processed_total}")

    if __name__ == "__main__":
        app()
    ```
    Nr   r   r   r   r"   r"   _   s    6 	r   r"   c                       e Zd ZdZy)FileBinaryWriteut  
    You can use this class to write binary data: you pass `bytes` to it instead of strings.
    The default mode of this class is `mode="wb"`.
    It is useful for writing binary files like images:

    **Example**

    ```python
    from typing import Annotated

    import typer

    app = typer.Typer()

    @app.command()
    def main(file: Annotated[typer.FileBinaryWrite, typer.Option()]):
        first_line_str = "some settings\n"
        # You cannot write str directly to a binary file; encode it first
        first_line_bytes = first_line_str.encode("utf-8")
        # Then you can write the bytes
        file.write(first_line_bytes)
        # This is already bytes, it starts with b"
        second_line = b"la cigÃ¼eÃ±a trae al niÃ±o"
        file.write(second_line)
        print("Binary file written")

    if __name__ == "__main__":
        app()
    ```
    Nr   r   r   r   r$   r$   ~   s    > 	r   r$   c                       e Zd ZdZy)CallbackParamz
    In a callback function, you can declare a function parameter with type `CallbackParam`
    to access the specific Click [`Parameter`](https://click.palletsprojects.com/en/stable/api/#click.Parameter) object.
    Nr   r   r   r   r&   r&      s    
 	r   r&   c                   (    e Zd ZdZdefdZdefdZy)DefaultPlaceholderz
    You shouldn't use this class directly.

    It's used internally to recognize when a default value has been overwritten, even
    if the new value is `None`.
    valuec                     || _         y Nr)   selfr)   s     r   __init__zDefaultPlaceholder.__init__   s	    
r   returnc                 ,    t        | j                        S r+   )boolr)   )r.   s    r   __bool__zDefaultPlaceholder.__bool__   s    DJJr   N)r   r   r   r   r   r/   r2   r3   r   r   r   r(   r(      s    c  $  r   r(   DefaultTypeCommandFunctionType)boundr)   r0   c                     t        |       S )z
    You shouldn't use this function directly.

    It's used internally to recognize when a default value has been overwritten, even
    if the new value is `None`.
    )r(   r,   s    r   Defaultr8      s     e$$r   c                       e Zd Z	 dddddddddddddddedz  ded   dz  d	eeef   dz  d
edef   dz  dedz  dedz  dedz  dededededededz  fdZ	y)CommandInfoN	[OPTIONS]TF)clscontext_settingscallbackhelpepilog
short_helpoptions_metavaradd_help_optionno_args_is_helphidden
deprecatedrich_help_panelnamer<   r   r=   r>   .r?   r@   rA   rB   rC   rD   rE   rF   rG   c                    || _         || _        || _        || _        || _        || _        || _        || _        |	| _        |
| _	        || _
        || _        || _        y r+   )rH   r<   r=   r>   r?   r@   rA   rB   rC   rD   rE   rF   rG   )r.   rH   r<   r=   r>   r?   r@   rA   rB   rC   rD   rE   rF   rG   s                 r   r/   zCommandInfo.__init__   sd    $ 	 0 	$...$.r   r+   )
r   r   r   strtypedictr   r   r2   r/   r   r   r   r:   r:      s      / ,026.2!!%* $ % &*!/Dj/ .!D(	/
 sCx.4// 38$t+/ Dj/ d
/ $J/ / / / / /  t!/r   r:   c            '          e Zd Z ed      f ed       ed       ed       ed       ed       ed       ed       ed       ed       ed       ed       ed       ed       ed       ed       ed       ed      dded   dedz  d	ed
   dz  dedededz  dedede	f   dz  de
e	e	f   dz  dede	f   dz  dedz  dedz  dedz  dedededededz  f$dZy)	TyperInfoNFr;   T)rH   r<   invoke_without_commandrD   subcommand_metavarchainresult_callbackr=   r>   r?   r@   rA   rB   rC   rE   rF   rG   typer_instancer   rH   r<   r   rO   rD   rP   rQ   rR   .r=   r>   r?   r@   rA   rB   rC   rE   rF   rG   c                    || _         || _        || _        || _        || _        || _        || _        || _        |	| _        |
| _	        || _
        || _        || _        || _        || _        || _        || _        || _        y r+   )rS   rH   r<   rO   rD   rP   rQ   rR   r=   r>   r?   r@   rA   rB   rC   rE   rF   rG   )r.   rS   rH   r<   rO   rD   rP   rQ   rR   r=   r>   r?   r@   rA   rB   rC   rE   rF   rG   s                      r   r/   zTyperInfo.__init__   s    0 -	&<#."4
. 0 	$..$.r   )r   r   r   r8   r   rJ   rK   r2   r   r   rL   r/   r   r   r   rN   rN      s    -4DM)/ #4=)0'.u~ ')0en5<T]29$-.5dm"4=$T]!(&{3 'u~"5>&-dm-)/ ))/ Dj	)/
 ,$&)/ !%)/ )/  $J)/ )/ "#s(+d2)/ sCx.4/)/ 38$t+)/ Dj)/ d
)/  $J!)/" #)/$ %)/& ')/( ))/, t-)/r   rN   c            J       ,   e Zd Zddddddddddddddddddddddddddddddddddddd$dedz  dee   dz  ded	ef   dz  d
edz  dededeee   z  dz  dee	j                  e	j                  eged   ee   z  f   dz  ded	ef   dz  deg ef   dz  deegef   dz  dej                  dz  deez  dedededz  dededeez  dz  deez  dz  dedee   dz  dedz  dedz  d edz  d!edz  d"ed#ed$ed%ed&ed'ed(ed)ed*dee   z  ee   z  d+edz  fHd,Zy)-ParameterInfoNTFstrict$defaultparam_declsr>   metavarexpose_valueis_eagerenvvarshell_completeautocompletiondefault_factoryparser
click_typeshow_defaultshow_choicesshow_envvarr?   rE   case_sensitiveminmaxclampformatsmodeencodingerrorslazyatomicexists	file_okaydir_okaywritablereadableresolve_path
allow_dash	path_typerG   rY   rZ   r>   .r[   r\   r]   r^   r_   r   r`   ra   rb   rc   rd   re   rf   r?   rE   rg   rh   ri   rj   rk   rl   rm   rn   ro   rp   rq   rr   rs   rt   ru   rv   rw   rx   rG   c       $            |r|rt        d      || _        || _        || _        || _        || _        || _        || _        || _        |	| _	        |
| _
        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        || _        | | _         |!| _!        |"| _"        |#| _#        |$| _$        y )NzZMultiple custom type parsers provided. `parser` and `click_type` may not both be provided.)%
ValueErrorrY   rZ   r>   r[   r\   r]   r^   r_   r`   ra   rb   rc   rd   re   rf   r?   rE   rg   rh   ri   rj   rk   rl   rm   rn   ro   rp   rq   rr   rs   rt   ru   rv   rw   rx   rG   )%r.   rY   rZ   r>   r[   r\   r]   r^   r_   r`   ra   rb   rc   rd   re   rf   r?   rE   rg   rh   ri   rj   rk   rl   rm   rn   ro   rp   rq   rr   rs   rt   ru   rv   rw   rx   rG   s%                                        r   r/   zParameterInfo.__init__  s&   n jF 
 & ( ,,.$((&	,
	 	"   ($".r   )r   r   r   r   r   rJ   r   r2   listr   r   	Parameterr   	ParamTypeintfloatrK   bytesr/   r   r   r   rV   rV     s    #,0.2"!)- 4848.2-1#'! #"&"&$(#% " 48&*ih/ th/ c]T)	h/
 38$t+h/ th/ h/ h/ d3i$&h/ !^^V--s3!"T#Y.0
 	h/" !c*T1#h/$ ""c'*T1%h/( #$t+)h/* OOd*+h/. Sj/h/0 1h/2 3h/4 Dj5h/6 7h/: ;h/> 5[4?h/@ 5[4Ah/B Ch/F cT!Gh/J DjKh/L *Mh/N d
Oh/P TkQh/R Sh/V Wh/X Yh/Z [h/\ ]h/^ _h/` ah/b ch/d $s)#d5k1eh/h tih/r   rV   c            Z       z    e Zd Zddddddddddddddddddddddddddddddddddddddddddddd,dedz  dee   dz  ded	ef   dz  d
edz  dededeee   z  dz  dee	j                  e	j                  eged   ee   z  f   dz  ded	ef   dz  deg ef   dz  deegef   dz  dej                  dz  deez  deez  dededededz  dedz  dedededz  deded ed!ed"eez  dz  d#eez  dz  d$ed%ee   dz  d&edz  d'edz  d(edz  d)edz  d*ed+ed,ed-ed.ed/ed0ed1ed2dee   z  ee   z  d3edz  fX fd4Z xZS )5
OptionInfoNTFrW   ),rY   rZ   r>   r[   r\   r]   r^   r_   r`   ra   rb   rc   rd   promptconfirmation_promptprompt_required
hide_inputis_flag
flag_valuecountallow_from_autoenvr?   rE   re   rf   rg   rh   ri   rj   rk   rl   rm   rn   ro   rp   rq   rr   rs   rt   ru   rv   rw   rx   rG   rY   rZ   r>   .r[   r\   r]   r^   r_   r   r`   ra   rb   rc   rd   r   r   r   r   r   r   r   r   r?   rE   re   rf   rg   rh   ri   rj   rk   rl   rm   rn   ro   rp   rq   rr   rs   rt   ru   rv   rw   rx   rG   c       ,            t        .|   d)i d|d|d|d|d|d|d|d|d	|	d
|
d|d|d|d|d|d|d|d|d|d|d|d|d|d| d|!d|"d|#d|$d|%d|&d|'d |(d!|)d"|*d#|+d$|, ||d%d l}-|-j                  d&t        d'(       || _        || _        || _        || _        || _	        || _
        y )*NrY   rZ   r>   r[   r\   r]   r^   r_   r`   ra   rb   rc   rd   re   rf   r?   rE   rg   rh   ri   rj   rk   rl   rm   rn   ro   rp   rq   rr   rs   rt   ru   rv   rw   rx   rG   r   zvThe 'is_flag' and 'flag_value' parameters are not supported by Typer and will be removed entirely in a future release.   )
stacklevelr   )superr/   warningswarnDeprecationWarningr   r   r   r   r   r   )/r.   rY   rZ   r>   r[   r\   r]   r^   r_   r`   ra   rb   rc   rd   r   r   r   r   r   r   r   r   r?   rE   re   rf   rg   rh   ri   rj   rk   rl   rm   rn   ro   rp   rq   rr   rs   rt   ru   rv   rw   rx   rG   r   	__class__s/                                                 r   r/   zOptionInfo.__init__  s   @ 	 -	
-	
#-	
 -	
 	-	

 &-	
 -	
 -	
 *-	
 *-	
 ,-	
 -	
 "-	
 &-	
  &!-	
" $#-	
$ %-	
& '-	
* *+-	
. /-	
0 1-	
2 3-	
6 7-	
: ;-	
< =-	
> ?-	
@ A-	
B C-	
F G-	
H  I-	
J K-	
L M-	
N O-	
P &Q-	
R "S-	
T  U-	
X ,Y-	
\ *"8MMD"	   #6 .$
"4r   r   r   r   r   r   rJ   r   r2   r{   r   r   r|   r   r}   r~   r   rK   r   r/   __classcell__r   s   @r   r   r     s   
 #,0.2"!)- 4848.2-1#'"$) $ #!%#'! #"&"&$(#% " 48&*}|5 t	|5
 c]T)|5 38$t+|5 t|5 |5 |5 d3i$&|5 !^^V--s3!"T#Y.0
 	|5$ !c*T1%|5& ""c'*T1'|5* #$t++|5, OOd*-|50 Sj1|52 s
3|54 "5|56 7|58 9|5< =|5> $J?|5@ A|5B !C|5D DjE|5F G|5H I|5J K|5N O|5R 5[4S|5T 5[4U|5V W|5Z cT![|5^ Dj_|5` *a|5b d
c|5d Tke|5f g|5j k|5l m|5n o|5p q|5r s|5t u|5v w|5x $s)#d5k1y|5| t}|5 |5r   r   c            J       8    e Zd Zddddddddddddddddddddddddddddddddddddd$dedz  dee   dz  ded	ef   dz  d
edz  dededeee   z  dz  dee	j                  e	j                  eged   ee   z  f   dz  ded	ef   dz  deg ef   dz  deegef   dz  dej                  dz  deez  dedededz  dededeez  dz  deez  dz  dedee   dz  dedz  dedz  d edz  d!edz  d"ed#ed$ed%ed&ed'ed(ed)ed*dee   z  ee   z  d+edz  fH fd,Z xZS )-ArgumentInfoNTFrW   rX   rY   rZ   r>   .r[   r\   r]   r^   r_   r   r`   ra   rb   rc   rd   re   rf   r?   rE   rg   rh   ri   rj   rk   rl   rm   rn   ro   rp   rq   rr   rs   rt   ru   rv   rw   rx   rG   c       $             t        %|   d%i d|d|d|d|d|d|d|d|d	|	d
|
d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d|d | d!|!d"|"d#|#d$|$ y )&NrY   rZ   r>   r[   r\   r]   r^   r_   r`   ra   rb   rc   rd   re   rf   r?   rE   rg   rh   ri   rj   rk   rl   rm   rn   ro   rp   rq   rr   rs   rt   ru   rv   rw   rx   rG   r   )r   r/   )&r.   rY   rZ   r>   r[   r\   r]   r^   r_   r`   ra   rb   rc   rd   re   rf   r?   rE   rg   rh   ri   rj   rk   rl   rm   rn   ro   rp   rq   rr   rs   rt   ru   rv   rw   rx   rG   r   s&                                        r   r/   zArgumentInfo.__init__  s   n 	 -	
-	
#-	
 -	
 	-	

 &-	
 -	
 -	
 *-	
 *-	
 ,-	
 -	
 "-	
 &-	
  &!-	
" $#-	
$ %-	
& '-	
* *+-	
. /-	
0 1-	
2 3-	
6 7-	
: ;-	
< =-	
> ?-	
@ A-	
B C-	
F G-	
H  I-	
J K-	
L M-	
N O-	
P &Q-	
R "S-	
T  U-	
X ,Y-	
r   r   r   s   @r   r   r     s   
 #,0.2"!)- 4848.2-1#'! #"&"&$(#% " 48&*kd
 t	d

 c]T)d
 38$t+d
 td
 d
 d
 d3i$&d
 !^^V--s3!"T#Y.0
 	d
$ !c*T1%d
& ""c'*T1'd
* #$t++d
, OOd*-d
0 Sj1d
2 3d
4 5d
6 Dj7d
8 9d
< =d
@ 5[4Ad
B 5[4Cd
D Ed
H cT!Id
L DjMd
N *Od
P d
Qd
R TkSd
T Ud
X Yd
Z [d
\ ]d
^ _d
` ad
b cd
d ed
f $s)#d5k1gd
j tkd
 d
r   r   c            	           e Zd Zej                  j
                  Zej                  j
                  ej                  j
                  ddedededdfdZy)	ParamMeta)rY   
annotationrH   rY   r   r0   Nc                .    || _         || _        || _        y r+   )rH   rY   r   )r.   rH   rY   r   s       r   r/   zParamMeta.__init__o  s     	$r   )	r   r   r   inspectr|   emptyrJ   r   r/   r   r   r   r   r   l  s`    ##E ((..!++11	% 	% 		%
 	% 
	%r   r   c            	       .    e Zd ZdddddedededdfdZy)	DeveloperExceptionConfigTpretty_exceptions_enablepretty_exceptions_show_localspretty_exceptions_shortr   r   r   r0   Nc                .    || _         || _        || _        y r+   r   )r.   r   r   r   s       r   r/   z!DeveloperExceptionConfig.__init__|  s     )A%-J*'>$r   )r   r   r   r2   r/   r   r   r   r   r   {  s:     *..2(,	? #'	? (,		?
 "&	? 
	?r   r   c                      e Zd ZU ej                  j
                  Zee   e	d<   	 	 	 	 	 	 	 	 dde
de
de
de
de
de
d	e
d
ee   dz  fdZdeej                  e   z  deez  ej                  e   z  fdZdeej                  e   z  dej$                  dz  dedz  deez  ej                  e   z  fdZdej&                  dej$                  dedee   fdZy)	TyperPathenvvar_list_splitterNrq   rr   rs   rt   ru   rv   rw   rx   c	                    || _         || _        || _        || _        || _        || _        || _        || _        | j                  r| j                  sd| _        y | j                  r| j                  sd| _        y d| _        y )Nfile	directorypath)	rq   rr   rs   ru   rt   rv   rw   rK   rH   )	r.   rq   rr   rs   rt   ru   rv   rw   rx   s	            r   r/   zTyperPath.__init__  sl     "   ($	>>$--DI]]4>>#DIDIr   r)   r0   c                    | j                   t        || j                         si| j                   t        u rt        j                  |      S | j                   t
        u rt        j                  |      S t        d| j                  |            S |S )Nzos.PathLike[str])rK   
isinstancerJ   osfsdecoder   fsencoder
   r-   s     r   coerce_path_resultzTyperPath.coerce_path_result  sm     99 E499)E		S {{5))e#{{5)).		%0@AAr   paramctxc                    |}| j                   xr | j                  xr |dv }|s| j                  rt        j                  j                  |      }	 t        j                  |      }| j                  j                         }t!        t        j                  j                  |            }| j                   s8t        j"                  j$                        r| j                  | d| d||       | j&                  s8t        j(                  j$                        r| j                  | d| d||       | j*                  r=t        j,                  |t        j.                        s| j                  | d| d||       | j0                  r=t        j,                  |t        j2                        s| j                  | d| d||       | j                  |      S # t        $ rq | j                  s| j                  |      cY S | j                  | j                  j                          dt        j                  j                  |      d||       Y w xY w)N)   -- z does not exist.z is a file.z is a directory.z is not readable.z is not writable.)rr   rw   rv   r   r   realpathstatOSErrorrq   r   failrH   titler   utilsformat_filenamereprS_ISREGst_moders   S_ISDIRru   accessR_OKrt   W_OK)	r.   r)   r   r   rvis_dashstrH   locs	            r   convertzTyperPath.convert  s    ..JT__J{9J  WW%%b)	WWR[ 99??$Dv||33E:;C>>dll2::&>		TF!C54eSA==T\\"**%=		TF!C5(895#F}}RYYr277%;		TF!C5(9:E3G}}RYYr277%;		TF!C5(9:E3G&&r**/  {{22266		yy()6<<+G+G+N*QQabs   G &I<AII
incompletec                     g S )zwReturn an empty list so that the autocompletion functionality
        will work properly from the commandline.
        r   )r.   r   r   r   s       r   r_   zTyperPath.shell_complete  s	     	r   )FTTFTFFN)r   r   r   r   r   pathsepr   r   rJ   __annotations__r2   rK   r   r/   PathLiker   r   r   r|   r   r   r{   r   r_   r   r   r   r   r     sU    +-''//(3-9 " &*  	
     9t#62;;s++	ur{{3'	''+R[[%%'+ $&'+ t^	'+
 
ur{{3'	''+R>>*0*:*:HK	n	r   r   )3r   ior   r   collections.abcr   r   typingr   r   r   r   r	   r
    r   r   _click.shell_completionr   corer   r   mainr   rK   NoneTypeAnyTypeRequiredr   TextIOWrapperr   r    BufferedReaderr"   BufferedWriterr$   r|   r&   r(   r4   r5   r8   r:   rN   rV   r   r   r   r   r}   r   r   r   r   <module>r      sW    	 	  .    3. :
s)	fnn 		r 	6	H 	6	R&& 	> 	b''  	F	F$$ 	    m$38CH;MN %; %; % /  /F*/ */Zi/ i/X}5 }5@e
= e
P% %
? 
?_ _r   