
    Ii              	          S SK r S SKrS SKrS SKr\ R                  R                  SS5      r\(       d   S SKJr  \" \	5      R                  R                  r\" \S-  S-  S5       r\ HM  r\R                  S5      (       d  M  \R!                  S	S
5      S
   R#                  5       R#                  S5      rMO     SSS5        SS\S\S\S\4S jjrg! , (       d  f       N= f! \ a     N)f = f)    NVERCEL_API_TOKEN )Pathconfigzsecrets.envrzVERCEL_API_TOKEN==   z"'html_contentproject_name	file_namereturnc                   #    [         (       d  [        S5        gS[          3SS.nU R                  S5      n[        U5      n[        R
                  " U5      R                  5       n[        R                  " 5        ISh  vN nS[          3U[        U5      S.n[        S	U S
U S35        UR                  SUUS9I Sh  vN n	U	R                  S;  a*  [        SU	R                   35         SSS5      ISh  vN   g[        S	U S35        UUUUS./SS0SS.n
UR                  SUU
S9I Sh  vN nUR                  S;  a*  [        SUR                   35         SSS5      ISh  vN   gUR                  5       nUR                  SS5      n[        S	U SU 35        SU 3sSSS5      ISh  vN   $  GN9 N N N NW N! , ISh  vN  (       d  f       g= f7f)z`
Deploys a raw HTML string directly to Vercel using their REST API.
Returns the deployment URL.
zE[Vercel Deploy] VERCEL_API_TOKEN not found. Skipping live deployment.z"deploy-skipped-no-token.vercel.appzBearer zapplication/json)AuthorizationzContent-Typezutf-8N)r   zx-now-digestzx-now-length[z#] Uploading file to Vercel (SHA-1: z)...z#https://api.vercel.com/v2/now/files)headerscontent)      z$[Vercel Deploy] File upload failed: zdeployment-failed.vercel.appz5] Creating deployment alias on Vercel Edge Network...)fileshasize	framework
production)namefilesprojectSettingstargetz&https://api.vercel.com/v13/deployments)r   jsonz,[Vercel Deploy] Deployment creation failed: urlzurl-not-found.vercel.appu   ] ⚡ LIVE: https://zhttps://)r   printencodelenhashlibsha1	hexdigesthttpxAsyncClientstrpoststatus_codetextr   get)r
   r   r   r   content_bytescontent_lengthsha1_digestclientupload_headersupload_responsedeploy_payloaddeploy_responsedata
deploy_urls                 ,e:\genesis-system\scripts\vercel_deployer.pydeploy_to_vercelr8      s    
 UV3 ##3"45*G !''0M'N,,}-779K  ""f  ''7&89'/
 	,B;-tTU &1"! !, !
 
 &&j889M9M8NOP1# #""( 	,TUV  &&* T  #
 !'4 !, !
 
 &&j8@AUAU@VWX1Y #""\ ##%XXe%?@
,6zlCD*&e #""
 #H
I #"""s   A=G?F8 G=G F;-G.G9F=:G?1G0F?1-GG)G*G/7G&G2G3G;G=G?GGGGGGG)z
index.html)osr#   r&   asyncioenvironr,   r   pathlibr   __file__parentBASE_DIRopenfline
startswithsplitstrip	Exceptionr(   r8        r7   <module>rI      s    	   ::>>"4b9   >((//(X%5s;q??#677'+zz#q'9!'<'B'B'D'J'J5'Q$  <E' E'C E'C E'cf E' <;  s5   1C# &C6C:C# 
C C#  C# #C,+C,