
    tnieW                        d dl Z d dlZd dlZd dlZd dlZd dlmZ d dlmZ d dl	m
Z
 d dlmZ d dlmZmZmZmZ d dlZd dlZd dlZd dlmZ d dlmZmZmZmZ d d	lmZ d d
lmZ d dl m!Z! d dl"m#Z# d dl$m%Z%m&Z&m'Z' d dl(m)Z)m*Z*m+Z+ d dl,m-Z- d dl.m/Z/m0Z0  ej1        e2          Z3de4ddfdZ5de
de4fdZ6de
de7fdZ8de
de
de
fdZ9 G d de          Z:de;e:         fdZ< G d de          Z=de4de4de=fd Z> G d! d"e4e          Z? G d# d$e          Z@d%e4de@fd&ZA G d' d(e          ZBde4d)e
ddfd*ZCd+e4dee=         fd,ZDde4de;e=         fd-ZEg d.ZFg d/ZGd0ed1e
de)fd2ZHd0ed%e4d3e@ddfd4ZI G d5 d6e          ZJd7eJd0eddfd8ZKd0eddfd9ZL	 	 	 dFdeee
df          ejM        d;<          f         d=ee7 ej!        d>d?<          f         d@eee4df          ej!        dAdBdCD          f         defdEZNdS )G    N)Enum)cycle)Path)dedent)	AnnotatedAnyOptionalUnion)Client)	BaseModelEmailStrTypeAdapterValidationError)Text)RichToolkit)Option)login)	APIClientStreamLogErrorTooManyRetriesError)	AppConfigget_app_configwrite_app_config)Identity)get_rich_toolkithandle_http_errorsdeployment_idreturnc                    t                               d|            	 t                      5 }|                    d|  d          }|                                 t                               d           d d d            d S # 1 swxY w Y   d S # t
          $ r&}t                               d|           Y d }~d S d }~ww xY w)Nz$Cancelling upload for deployment: %s/deployments/z/upload-cancelledz2Upload cancellation notification sent successfullyz5Failed to notify server about upload cancellation: %s)loggerdebugr   postraise_for_status	Exception)r   clientresponsees       ^/var/www/html/gpu-tools/venv/lib/python3.11/site-packages/fastapi_cloud_cli/commands/deploy.py_cancel_uploadr*      s)   
LL7GGGQ[[ 	OF{{#S=#S#S#STTH%%'''LLMNNN		O 	O 	O 	O 	O 	O 	O 	O 	O 	O 	O 	O 	O 	O 	O 	O 	O 	O
  Q Q QLaPPPPPPPPPQs;   B AB 3B  BB BB 
B=B88B=pathc                     | j         S N)name)r+   s    r)   _get_app_namer/   +   s
    9    c                      g d}t           fd|D                       rdS  j        dk    rdS  j        dk    s j                            d          rdS dS )N)z.venv__pycache__z.mypy_cachez.pytest_cachez.gitz
.gitignore.fastapicloudignorec              3   *   K   | ]}|j         v V  d S r-   )parts).0partr+   s     r)   	<genexpr>z(_should_exclude_entry.<locals>.<genexpr>;   s*      
;
;$44:
;
;
;
;
;
;r0   Tz.pycz.envz.env.F)anysuffixr.   
startswith)r+   parts_to_excludes   ` r)   _should_exclude_entryr=   0   s       
;
;
;
;*:
;
;
;;; t{ftyFdi227;;t5r0   tar_pathc                    t                               d|            t          j        | t          dgd          }t                               d|           d}t          j        |d          5 }|D ]c}|                                r|                    |           }t                               d|           |	                    ||	           |d
z  }d	 d d d            n# 1 swxY w Y   t                               d|           |S )Nz&Starting archive creation for path: %sr3   F)should_exclude_entryadditional_ignore_pathsignore_hiddenzArchive will be created at: %sr   zw:zstzAdding %s to archive)arcname   z*Archive created successfully with %s files)
r!   r"   rignorewalkr=   fastaropenis_dirrelative_toappend)r+   r>   files
file_counttarfilenamerC   s          r)   archiverP   G   sJ   
LL94@@@L2!6 7	  E LL18<<<J	Xw	'	' 3 	 	H   **400GLL/999JJxJ111!OJJ	               LL=zJJJOs   ,A'C  C$'C$c                   .    e Zd ZU eed<   eed<   eed<   dS )Teamidslugr.   N__name__
__module____qualname__str__annotations__ r0   r)   rR   rR   a   s+         GGG
III
IIIIIr0   rR   c                      t                      5 } |                     d          }|                                 |                                d         }d d d            n# 1 swxY w Y   d |D             S )Nz/teams/datac                 B    g | ]}t                               |          S r[   )rR   model_validater6   teams     r)   
<listcomp>z_get_teams.<locals>.<listcomp>n   s&    777$D%%777r0   r   getr$   json)r&   r'   r]   s      r)   
_get_teamsrf   g   s    	 '::i((!!###}}v&	' ' ' ' ' ' ' ' ' ' ' ' ' ' ' 87$7777s   AAA#&A#c                   $    e Zd ZU eed<   eed<   dS )AppResponserS   rT   NrU   r[   r0   r)   rh   rh   q   s"         GGG
IIIIIr0   rh   team_idapp_namec                    t                      5 }|                    d|| d          }|                                 t                              |                                          cd d d            S # 1 swxY w Y   d S )N/apps/)r.   ri   re   )r   r#   r$   rh   r_   re   )ri   rj   r&   r'   s       r)   _create_apprn   v   s    	 ;;;"w77  
 

 	!!###))(--//::; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;s   AA66A:=A:c                   f    e Zd ZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZdZdZdZedd defd            ZdS )DeploymentStatuswaiting_uploadready_for_buildbuilding
extractingextracting_failedbuilding_imagebuilding_image_failed	deployingdeploying_failed	verifyingverifying_failedverifying_skippedsuccessfailedstatusr   c                     | j         d| j        d| j        d| j        d| j        d| j        d| j        d| j        d| j        d	| j	        d
| j
        d| j        d| j        d| j        di|         S )NzWaiting for uploadzReady for buildBuilding
ExtractingzExtracting failedzBuilding imagezBuild failed	DeployingzDeploying failed	VerifyingzVerifying failedzVerification skippedSuccessFailed)rq   rr   rs   rt   ru   rv   rw   rx   ry   rz   r{   r|   r}   r~   )clsr   s     r)   to_human_readablez"DeploymentStatus.to_human_readable   s      4!2L*NL!#6 0%~M; "4M; "4!#9KJ
  	r0   N)rV   rW   rX   rq   rr   rs   rt   ru   rv   rw   rx   ry   rz   r{   r|   r}   r~   classmethodrY   r   r[   r0   r)   rp   rp      s        %N'OHJ+%N3I)I)+GF'9 c    [  r0   rp   c                   L    e Zd ZU eed<   eed<   eed<   eed<   eed<   eed<   dS )CreateDeploymentResponserS   app_idrT   r   dashboard_urlurlN)rV   rW   rX   rY   rZ   rp   r[   r0   r)   r   r      sL         GGGKKK
III	HHHHHr0   r   r   c                    t                      5 }|                    d|  d          }|                                 t                              |                                          cd d d            S # 1 swxY w Y   d S )Nrl   r    )r   r#   r$   r   r_   re   )r   r&   r'   s      r)   _create_deploymentr      s    	 H;;====>>!!###'66x}}GG	H H H H H H H H H H H H H H H H H Hs   AA55A9<A9c                   4    e Zd ZU eed<   eeef         ed<   dS )RequestUploadResponser   fieldsN)rV   rW   rX   rY   rZ   dictr[   r0   r)   r   r      s/         	HHHcNr0   r   archive_pathc           	      L   t                               d|            t                               d||                                j                   t	                      5 }t                      5 }t                               d           |                    d|  d          }|                                 t          	                    |
                                          }t                               d|j                   t                               d           t          |d          5 }|                    |j        |j        d	|i
          }d d d            n# 1 swxY w Y   |                                 t                               d           t                               d           |                    d|  d          }|                                 t                               d           d d d            n# 1 swxY w Y   d d d            d S # 1 swxY w Y   d S )Nz-Starting deployment upload for deployment: %sz Archive path: %s, size: %s byteszRequesting upload URL from APIr    z/uploadzReceived upload URL: %szStarting file upload to S3rbfile)r]   rL   z"File upload completed successfullyz%Notifying API that upload is completez/upload-completez%Upload notification sent successfully)r!   r"   statst_sizer   r   r#   r$   r   r_   re   r   rH   r   )	r   r   fastapi_clientr&   r'   upload_dataarchive_fileupload_responsenotify_responses	            r)   _upload_deploymentr      s   
LL7   LL*#   
 > >F5666!&&'M}'M'M'MNN!!###+::8==??KK.@@@1222,%% 	$kk '|, *  O	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	((***9::: 	<===(--;M;;;
 
 	((***<===7> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >s\   H,B>H*%EHEH"E#BH5HH	HH		HH Happ_slugc                 4   t                      5 }|                    d|            }|j        dk    r	 d d d            d S |                                 |                                }d d d            n# 1 swxY w Y   t
                              |          S )Nrl   i  )r   rd   status_coder$   re   rh   r_   )r   r&   r'   r]   s       r)   _get_appr      s    	 ::1x11223&&	        	!!###}}               %%d+++s   %A5(A55A9<A9c                     t                      5 }|                    dd| i          }|                                 |                                d         }d d d            n# 1 swxY w Y   d |D             S )Nrl   ri   )paramsr]   c                 B    g | ]}t                               |          S r[   )rh   r_   r6   apps     r)   rb   z_get_apps.<locals>.<listcomp>   s&    <<<K&&s++<<<r0   rc   )ri   r&   r'   r]   s       r)   	_get_appsr      s    	 '::h	7/C:DD!!###}}v&	' ' ' ' ' ' ' ' ' ' ' ' ' ' ' =<t<<<<s   AA##A'*A')
u+   🚀 Preparing for liftoff! Almost there...uA   👹 Sneaking past the dependency gremlins... Don't wake them up!u>   🤏 Squishing code into a tiny digital sandwich. Nom nom nom.u;   🐱 Removing cat videos from our servers to free up space.uM   🐢 Uploading at blazing speeds of 1 byte per hour. Patience, young padawan.uN   🔌 Connecting to server... Please stand by while we argue with the firewall.uQ   💥 Oops! We've angered the Python God. Sacrificing a rubber duck to appease it.u3   🧙 Sprinkling magic deployment dust. Abracadabra!uB   👀 Hoping that @tiangolo doesn't find out about this deployment.uF   🍪 Cookie monster detected on server. Deploying anti-cookie shields.)uS   😅 Well, that's embarrassing. We're still waiting for the deployment to finish...u9   🤔 Maybe we should have brought snacks for this wait...u   🥱 Yawn... Still waiting...uK   🤯 Time is relative... Especially when you're waiting for a deployment...toolkitpath_to_deployc           
         |                      d| dd           |                                  |                     d          5 }t          |d          5  t	                      }d d d            n# 1 swxY w Y   d d d            n# 1 swxY w Y   |                                  |                     dd	d
 |D                       }|                                  |                     ddd          }|                                  d }|s|                     d          5 }t          |d          5  t          |j                  }d d d            n# 1 swxY w Y   d d d            n# 1 swxY w Y   |                                  |s)|                      d           t          j
        d          |                     dd |D                       }|r|j        n#|                     dt          |                    }|                                  |                      dd           |                                  |                      d|j         d           |                      d| d           |                                  |                     ddt          d d!d"          t          d#d$d"          g          }	|                                  |	d$k    r)|                      d%           t          j
        d&          |r|}
n|                     d'(          5 }t          |          5  t!          |j        |          }
d d d            n# 1 swxY w Y   |                    d)|
j                    d d d            n# 1 swxY w Y   t%          |
j        |j        *          }t'          ||           |S )+NzSetting up and deploying [blue]z[/blue]r+   tagzFetching teams...z-Error fetching teams. Please try again later.)messagez&Select the team you want to deploy to:ra   c                 <    g | ]}t          |j        |d           S r.   value)r   r.   r`   s     r)   rb   z"_configure_app.<locals>.<listcomp>"  s*    NNNT::;;NNNr0   r   optionsz Do you want to create a new app?r   T)r   defaultzFetching apps...z,Error fetching apps. Please try again later.z=No apps found in this team. You can create a new app instead.rD   z%Select the app you want to deploy to:c                 <    g | ]}t          |j        |d           S r   )r   rT   r   s     r)   rb   z"_configure_app.<locals>.<listcomp>A  s*    NNN#VSX<<==NNNr0   )r   zWhat's your app name?)titler   zDeployment configuration:summaryzTeam: [bold]z[/bold]zApp name: [bold]zDoes everything look right?confirmzYes, start the deployment!deployr   zNo, let me start overcancelzDeployment cancelled.r   zCreating app...r   z$App created successfully! App slug: )r   ri   )print
print_lineprogressr   rf   askr   r   rS   typerExitrT   inputr/   r.   r   rn   logr   r   )r   r   r   teamsra   create_new_appselected_appappsrj   choicer   
app_configs               r)   _configure_appr     s   MMKNKKKQWMXXX			-	.	. !(M
 
 
 	! 	! LLE	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	!! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ;;0NNNNN   D __*t %  N *.L 
011 	*X#"P   * * !))* * * * * * * * * * * * * * *	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	 	 MMO   *Q--{{3NNNNN # 
 
 	
]])!.11  
 
  MM-9M===MM3333444MM6X666777[[%88LLMM3hGGHH
   F -...jmm L$566 	L(#H-- 5 5!$'8445 5 5 5 5 5 5 5 5 5 5 5 5 5 5 LLJJJKKK		L 	L 	L 	L 	L 	L 	L 	L 	L 	L 	L 	L 	L 	L 	L #&$':::J^Z000s   B	A2&B	2A6	6B	9A6	:B		BB#E-5E
E-E	E-E	E--E14E1'N7MNM	N M	! NNN
deploymentc                 x   t          t                    }|                     dd           |                                  |                     d|j         d|j         d           |                                  d}t          j                    }t          j                    }|                     t          |          dd	
          5 }t                      5 }	 |
                    |j                  D ]}	t          j                    |z
  }|	j        dk    r>|                    t          j        |	j                                                             |	j        dk    rx|                    d           |                    d|j         d|j         d           |                    d           |                    d|j         d|j         d            n|	j        dk    rO|                    d           |                    d|j         d|j         d           t'          j        d          |dk    rt          t*                    }t          j                    |z
  dk    r't          |          |_        t          j                    }n|# t.          t0          t2          f$ rb}
|                    t7          d|
 d|j         d|j         d                                                     t'          j        d          d d }
~
ww xY wd d d            n# 1 swxY w Y   d d d            d S # 1 swxY w Y   d S )Nu+   Checking the status of your deployment 👀cloudr   z'You can also check the status at [link=][/link]g        T   )inline_logslines_to_showr   complete z)You can also check the app logs at [link=u3   🐔 Ready the chicken! Your app is ready at [link=r~   u>   😔 Oh no! Something went wrong. Check out the logs at [link=rD         z4
                [error]Build log streaming failed: zX[/]

                Unable to stream build logs. Check the dashboard for status: [link=z[/link]
                )r   WAITING_MESSAGESr   r   r   time	monotonicr   nextr   stream_build_logsrS   typer   r   	from_ansir   rstripr   r   r   LONG_WAIT_MESSAGESr   r   r   TimeoutError	set_errorr   strip)r   r   r   messagestime_elapsed
started_atlast_message_changed_atr   r&   r   r(   s              r)   _wait_for_deploymentr   s  s-    %&&HMM5     MMn*2JnnZMennn   L!!J"n.. 	NNB 	 	
 	
3* 	3* -	*//
>> !? !?#~//*<8y((LL0B0B0D0D!E!EFFF8z))LL$$$LL AJD\  A  A_i_w  A  A  A   LL$$$LLvjnvv_i_mvvv   E8x''LL$$$LL VYcYq  V  Vt~  uM  V  V  V    *Q--'"$$$%788HN$$'>>!CC%)(^^HN.2n.>.>+ 3\B 		* 		* 		* 45  U_Tl  pz  pH     UWW   *Q--T)		*U3* 3* 3* 3* 3* 3* 3* 3* 3* 3* 3* 3* 3* 3* 3* 3* 3* 3* 3* 3* 3* 3* 3* 3* 3* 3* 3* 3* 3* 3* 3* 3* 3*s\   L/LF6JLL&ALLLL/L	L/L	L//L36L3c                       e Zd ZU eed<   dZee         ed<   dZee         ed<   dZ	ee         ed<   dZ
ee         ed<   dZee         ed<   dZee         ed<   dZee         ed	<   dS )
SignupToWaitingListemailNr.   organizationrole	team_sizelocationuse_casesecret_code)rV   rW   rX   r   rZ   r.   r	   rY   r   r   r   r   r   r   r[   r0   r)   r   r     s         OOOD(3-"&L(3-&&&D(3-#Ix}###"Hhsm""""Hhsm"""!%K#%%%%%r0   r   resultc                    |                     d          5 }t                      5 }t          |          5  |                    d|                                           }|                                 d d d            n# 1 swxY w Y   d d d            n# 1 swxY w Y   |                    d           d d d            d S # 1 swxY w Y   d S )NzSending your request...z/users/waiting-listrm   u9   Let's go! Thanks for your interest in FastAPI Cloud! 🚀)r   r   r   r#   
model_dumpr$   r   )r   r   r   r&   r'   s        r)   _send_waitlist_formr     s    
		3	4	4 R[[ 	,F#H-- , ,!;;'<6CTCTCVCV;WW))+++, , , , , , , , , , , , , , ,	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	PQQQR R R R R R R R R R R R R R R R R RsW   CB>A?3B?BBBB
CB	CB	CC
Cc                    ddl m} |                     dd           |                                  |                     ddt          t                              }|                                  t                              d	|i          }| 	                    d
d          r(|                                   |d| j
                  }|                    ddd           |                    ddd           |                    ddd           |                    ddd           |                    ddd           |                    ddd           |                    d d!d"           |                                }	 t                              d	|i|          }n&# t          $ r |                     d#           Y d S w xY w|                                  | 	                    d$d%          r|                                  t          ||            t          j        t"                    5  t%          j        g d&t$          j        t$          j        d'(           d d d            d S # 1 swxY w Y   d S d S ))Nr   )FormzkWe're currently in private beta. If you want to be notified when we launch, please fill out the form below.waitlistr   zEnter your email:T)required	validatorr   z?Do you want to get access faster by giving us more information?zWaitlist form)styler.   NamezJohn Doe)labelplaceholderr   Organizationz	Acme Inc.ra   rR   zTeam Ar   Role	Developerr   LocationzSan Franciscor   z%How do you plan to use FastAPI Cloud?zI'm building a web appr   zSecret code123456z.[error]Invalid form data. Please try again.[/]zDo you agree to
- Terms of Service: [link=https://fastapicloud.com/legal/terms]https://fastapicloud.com/legal/terms[/link]
- Privacy Policy: [link=https://fastapicloud.com/legal/privacy-policy]https://fastapicloud.com/legal/privacy-policy[/link]
terms)rH   z-gu!   raycast://confetti?emojis=🐔⚡F)stdoutstderrcheck)rich_toolkit.formr   r   r   r   r   r   r   r_   r   r   	add_inputrunr   r   
contextlibsuppressr%   
subprocessDEVNULL)r   r   r   r   forms        r)   _waitlist_formr    s1   &&&&&&MMu    
 MMh''   E  //%0@AAFI    ! 	tO7=999vVDDD~^UUUvVBBBvVEEEzQQQ90 	 	
 	
 	

 	}MxPPP	(77U FF  	 	 	MM@   FF	 K      		
 	
 	

  ++ 	 	NCCC!)!)	   	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 s$   F& &G	G	4/I00I47I4Fz:A path to the folder containing the app you want to deploy)help	skip_waitz	--no-waitz"Skip waiting for deployment statusprovided_app_idz--app-idzApplication ID to deploy toFASTAPI_CLOUD_APP_ID)r  envvarc                    t                               d           t                               d| ||           t                      }t                      5 }|                                st                               d           |                    dd           |                                 |                    dd           |                                 |                    d	d
t          ddd          t          ddd          g          }|                                 |dk    rt                       n#t          |           t          j        d          |                    dd           |                                 | pt          j                    }t                               d|           t!          |          }|rn|rl|j        |k    ra|                    d| d|j         d           |                                 |                    dd           t          j        d          d|r|}nP|r|j        }nFt                               d           t%          ||          }|                                 |j        }|r|                    d| d           n|                    d           |                                 |                    dd !          5 }	t)          |	          5  t                               d"|           t+          |          }
ddd           n# 1 swxY w Y   |
s/t                               d#           |	                    d$           ddd           n# 1 swxY w Y   |
sA|                                 |s|                    d%d           t          j        d          t/          j                    5 }t                               d&           t          |          d'z  }t3          | pt          j                    |           |                    d()          5 }	t)          |	          5  t                               d*|
j                   t7          |
j                  }	 |	                    d+|j                    |	                    d,           t=          |j        |           |	                    d-           n## t>          $ r tA          |j                    w xY w	 ddd           n# 1 swxY w Y   ddd           n# 1 swxY w Y   ddd           n# 1 swxY w Y   |                                 |s2t                               d.           tC          ||
j        |/           n@t                               d0           |                    d1|j"         d2|j"         d3           ddd           dS # 1 swxY w Y   dS )4uB   
    Deploy a [bold]FastAPI[/bold] app to FastAPI Cloud. 🚀
    zDeploy command startedz*Deploy path: %s, skip_wait: %s, app_id: %sz3User not logged in, prompting for login or waitlistzWelcome to FastAPI Cloud!FastAPIr   z4You need to be logged in to deploy to FastAPI Cloud.infozWhat would you like to do?authzLogin to my existing accountr   r   zJoin the waiting listr   r   rD   zStarting deploymentzDeploying from path: %sz[error]Error: Provided app ID (z#) does not match the local config (z).[/]zRun [bold]fastapi cloud unlink[/] to remove the local config, or remove --app-id / unset FASTAPI_CLOUD_APP_ID to use the configured app.tipNz(No app config found, configuring new app)r   zDeploying to app [blue]z
[/blue]...zDeploying app...zChecking app...T)	transientzChecking app with ID: %szApp not found in APIz>App not found. Make sure you're logged in the correct account.zeIf you deleted this app, you can run [bold]fastapi cloud unlink[/] to unlink the local configuration.zCreating archive for deploymentzarchive.tarzCreating deploymentr   zCreating deployment for app: %sz2Deployment created successfully! Deployment slug: zUploading deployment...z!Deployment uploaded successfully!z"Waiting for deployment to complete)r   z%Skipping deployment wait as requestedz-Check the status of your deployment at [link=r   r   )#r!   r"   r   r   is_logged_inprint_titler   r   r   r   r   r  r   r   r   cwdr   r   r   r   r   r   r   tempfileTemporaryDirectoryrP   rS   r   r   rT   r   KeyboardInterruptr*   r   r   )r+   r  r  identityr   r   r   r   target_app_idr   r   temp_dirr   r   s                 r)   r   r   )  s   , LL)***
LL4dI   zzH			 w$$&& 	$LLNOOO ;KKK   MMF        [[,$BWUUVV$;jQQRR !  F      w'''jmm#1yAAA+.???#N33
 	*/ 	*j.??.R.RMM4/ 4 4%,4 4 4      MM]     *Q--T) 
	.+MM 	.&-MMLLCDDD'OOOJ   &-M 	.MMMMMMMNNNNMM,---/4@@ 		H#H-- . .7GGG}--. . . . . . . . . . . . . . .  3444""T  		 		 		 		 		 		 		 		 		 		 		 		 		 		 		  	    " {     *Q--(** 	hLL:;;;>>M9LD&DHJJ555   '< ==AI"8,,  >GGG/77
LL^Z_^^   LL!:;;;&z}lCCCLL!DEEEE(   ":=111 F!                             	 	 	 	 	 	 	 	 	 	 	 	 	 	 	4 	 	LL=>>> #&ZHHHHHLL@AAAMM|
@X||[e[s|||  {                 s   JW!*M9:+L1%M91L55M98L594M9-W!9M=	=W! M=	AW!A&U T*5T	AS#"T	# TT	T*TT*TT*U*T..U1T.2U5W!U	W!U		BW!!W%(W%)NFN)Or  loggingr  r!  r   enumr   	itertoolsr   pathlibr   textwrapr   typingr   r   r	   r
   rG   rE   r   httpxr   pydanticr   r   r   r   	rich.textr   rich_toolkitr   rich_toolkit.menur    fastapi_cloud_cli.commands.loginr   fastapi_cloud_cli.utils.apir   r   r   fastapi_cloud_cli.utils.appsr   r   r   fastapi_cloud_cli.utils.authr   fastapi_cloud_cli.utils.clir   r   	getLoggerrV   r!   rY   r*   r/   boolr=   rP   rR   listrf   rh   rn   rp   r   r   r   r   r   r   r   r   r   r   r   r   r  Argumentr   r[   r0   r)   <module>r;     s                                      2 2 2 2 2 2 2 2 2 2 2 2          F F F F F F F F F F F F       $ $ $ $ $ $ $ $ $ $ $ $ 2 2 2 2 2 2 V V V V V V V V V V T T T T T T T T T T 1 1 1 1 1 1 L L L L L L L L		8	$	$
Q# 
Q$ 
Q 
Q 
Q 
Q     
     .$ $ 4    4    9   8DJ 8 8 8 8    )   
	; 	; 	; 	; 	; 	; 	;! ! ! ! !sD ! ! !H    y   Hs H'? H H H H    I   
&>c &> &>$ &> &> &> &>R,s ,x4 , , , ,=s =tK0 = = = =      ^K ^ ^) ^ ^ ^ ^BI*I*"%I*3KI*	I* I* I* I*X& & & & &) & & &RRR 
R R R RNK ND N N N Nn 	 	 	#\ \
dDjM	
 	
 	
	\ lel;-QRRRR\ c4i.)	
 	
 	
	\$ 	%\ \ \ \ \ \r0   