@shumai-one/shumai 0.6.1 → 0.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (225) hide show
  1. package/bin/chunk-01052ssf.js +32 -0
  2. package/bin/{chunk-w4ydfy9d.js → chunk-02fvcrej.js} +4 -4
  3. package/bin/chunk-0bj887zm.js +2 -0
  4. package/bin/chunk-167z646e.js +2 -0
  5. package/bin/chunk-1ktk6764.js +10 -0
  6. package/bin/{chunk-p1ed0pa6.js → chunk-1nvd90g2.js} +1 -1
  7. package/bin/{chunk-kywdke0y.js → chunk-1wfg56z3.js} +5 -5
  8. package/bin/{chunk-ahgq10a7.js → chunk-257dcd2f.js} +2 -2
  9. package/bin/chunk-26qn7fek.js +2 -0
  10. package/bin/chunk-2cdxm1cp.js +55 -0
  11. package/bin/chunk-2jj4j8cn.js +3 -0
  12. package/bin/chunk-2ne2b54t.js +2 -0
  13. package/bin/{chunk-qqj2m1b1.js → chunk-2nhgdqdg.js} +2 -2
  14. package/bin/chunk-2vbeqczj.js +1 -0
  15. package/bin/chunk-37p6bcx2.js +1 -0
  16. package/bin/chunk-3ckkwdjx.js +13 -0
  17. package/bin/chunk-3knfx6dm.js +1 -0
  18. package/bin/chunk-3z85zxkn.js +1 -0
  19. package/bin/chunk-4mws03es.js +5 -0
  20. package/bin/chunk-54tbfvya.js +2 -0
  21. package/bin/chunk-55h9ze53.js +2 -0
  22. package/bin/chunk-56kh5fxc.js +1 -0
  23. package/bin/chunk-576nj64j.js +2 -0
  24. package/bin/{chunk-dfecgpce.js → chunk-5wapd171.js} +13 -13
  25. package/bin/chunk-6cnqjngz.js +1 -0
  26. package/bin/chunk-73yncv54.js +2 -0
  27. package/bin/chunk-7g46e1wy.js +3 -0
  28. package/bin/{chunk-jq3pq545.js → chunk-7naa7tpn.js} +2 -2
  29. package/bin/{chunk-am6dg0a5.js → chunk-7sgrtxbt.js} +2 -2
  30. package/bin/{chunk-3me1v3z5.js → chunk-7v7mypc6.js} +2 -2
  31. package/bin/chunk-82tps5n1.js +2 -0
  32. package/bin/chunk-84x8p7v5.js +1 -0
  33. package/bin/{chunk-fxtzy5f5.js → chunk-88jg9dq5.js} +2 -2
  34. package/bin/chunk-8cjet7pp.js +12 -0
  35. package/bin/chunk-8fyg9dy4.js +2 -0
  36. package/bin/chunk-8gtfgkrn.js +2 -0
  37. package/bin/chunk-8mqbztj8.js +2 -0
  38. package/bin/chunk-8xb6yz11.js +2 -0
  39. package/bin/chunk-8yjsmr7g.js +2 -0
  40. package/bin/chunk-91rb0jpb.js +2 -0
  41. package/bin/chunk-96qpjght.js +2 -0
  42. package/bin/chunk-9f1xk1nt.js +1 -0
  43. package/bin/chunk-9mk9cvbk.js +1 -0
  44. package/bin/{chunk-r5g84kj4.js → chunk-9n1w5dw1.js} +3 -3
  45. package/bin/chunk-9nw5w8vh.js +1 -0
  46. package/bin/{chunk-3j82q2gj.js → chunk-9t3p4xp6.js} +1 -1
  47. package/bin/chunk-9xhjy897.js +11 -0
  48. package/bin/chunk-9zsv6d2f.js +1 -0
  49. package/bin/chunk-a411xhmm.js +7 -0
  50. package/bin/{chunk-s01p4w8d.js → chunk-a74g6h8a.js} +2 -2
  51. package/bin/chunk-ah8fjb6f.js +2 -0
  52. package/bin/chunk-atfz7g7e.js +2 -0
  53. package/bin/{chunk-swz6v48q.js → chunk-b5rhvzv9.js} +2 -2
  54. package/bin/{chunk-bg6waaf9.js → chunk-b7bnp021.js} +2 -2
  55. package/bin/chunk-cf5axr8c.js +1 -0
  56. package/bin/chunk-cgmebxx6.js +2 -0
  57. package/bin/chunk-cwat1jwx.js +3 -0
  58. package/bin/chunk-cz13a82m.js +3 -0
  59. package/bin/chunk-dk42gf7v.js +2 -0
  60. package/bin/chunk-e4f56spj.js +4 -0
  61. package/bin/chunk-e4yscwen.js +18 -0
  62. package/bin/chunk-eb7mzbfm.js +1 -0
  63. package/bin/chunk-er14d498.js +3 -0
  64. package/bin/{chunk-bs6saf4d.js → chunk-eyjfhdp9.js} +2 -2
  65. package/bin/chunk-f25fe9th.js +393 -0
  66. package/bin/chunk-f6avg5qe.js +129 -0
  67. package/bin/chunk-fatmqnp1.js +2 -0
  68. package/bin/chunk-fvx9k1dc.js +2 -0
  69. package/bin/{chunk-h6f2gyt5.js → chunk-g22wmpk1.js} +2 -2
  70. package/bin/chunk-g6sdezec.js +2 -0
  71. package/bin/chunk-gtf19jc1.js +2 -0
  72. package/bin/chunk-gxepkvt2.js +2 -0
  73. package/bin/chunk-h1n7jqnw.js +1 -0
  74. package/bin/chunk-hfm82066.js +2 -0
  75. package/bin/chunk-hnkcgvcj.js +3 -0
  76. package/bin/{chunk-agcnbjxk.js → chunk-hpbn0k9n.js} +2 -2
  77. package/bin/{chunk-d4hk62q2.js → chunk-hpwv4am3.js} +4 -4
  78. package/bin/{chunk-acmr8v0d.js → chunk-hw6czrya.js} +1 -1
  79. package/bin/{chunk-r9gp9yqw.js → chunk-hzkjgcre.js} +1 -1
  80. package/bin/chunk-j2s311yc.js +3 -0
  81. package/bin/{chunk-6hzktewz.js → chunk-jt02kpfc.js} +2 -2
  82. package/bin/{chunk-c60j1b4w.js → chunk-jt0ykktx.js} +1 -1
  83. package/bin/{chunk-sd6w0z6a.js → chunk-jzgbxqdg.js} +2 -2
  84. package/bin/chunk-kj6h5j5a.js +4 -0
  85. package/bin/chunk-km4gn6b6.js +1 -0
  86. package/bin/chunk-knj2s8mg.js +16 -0
  87. package/bin/{chunk-1eqw2dpx.js → chunk-kvhf12b4.js} +2 -2
  88. package/bin/chunk-m0q2cgfg.js +2 -0
  89. package/bin/chunk-m82tkhaa.js +11 -0
  90. package/bin/chunk-m9adtgzk.js +2 -0
  91. package/bin/{chunk-0tvnfy4k.js → chunk-mcj1xpcc.js} +2 -2
  92. package/bin/chunk-mcw198kg.js +13 -0
  93. package/bin/{chunk-9s0k533c.js → chunk-mwktrwtx.js} +1 -1
  94. package/bin/{chunk-wsprap60.js → chunk-mzsw9var.js} +2 -2
  95. package/bin/chunk-ns33grgx.js +2 -0
  96. package/bin/{chunk-xsfy8hz3.js → chunk-ny1kbmxt.js} +2 -2
  97. package/bin/{chunk-16n160h1.js → chunk-p3f5aevs.js} +1 -1
  98. package/bin/chunk-p3j6ydk1.js +1 -0
  99. package/bin/chunk-p4s95471.js +2 -0
  100. package/bin/chunk-pk406dgy.js +2 -0
  101. package/bin/chunk-q2bew2vc.js +2 -0
  102. package/bin/chunk-q5vkxee3.js +5 -0
  103. package/bin/{chunk-hzv1mhr5.js → chunk-q83h0hkx.js} +2 -2
  104. package/bin/{chunk-fre31bhw.js → chunk-q8w4mbw4.js} +2 -2
  105. package/bin/{chunk-b7qs7hxg.js → chunk-qwpkcp8d.js} +2 -2
  106. package/bin/chunk-r1xer8gn.js +5 -0
  107. package/bin/chunk-s1e4qy3q.js +14 -0
  108. package/bin/{chunk-b9d8xdhb.js → chunk-s9ksftq2.js} +1 -1
  109. package/bin/chunk-srxp5jav.js +42 -0
  110. package/bin/chunk-swtwaaqe.js +1 -0
  111. package/bin/chunk-tagdrg7p.js +1 -0
  112. package/bin/{chunk-d18v5vmp.js → chunk-tekwpkjf.js} +2 -2
  113. package/bin/chunk-twtxnzbv.js +2 -0
  114. package/bin/{chunk-c6f8x05m.js → chunk-v05rrxp5.js} +2 -2
  115. package/bin/{chunk-ht5rht98.js → chunk-v5cn90cf.js} +2 -2
  116. package/bin/chunk-v5mcjwxy.js +2 -0
  117. package/bin/{chunk-jb8vbeb0.js → chunk-vcrmjtcz.js} +2 -2
  118. package/bin/chunk-vkzasgxw.js +2 -0
  119. package/bin/chunk-vp3czaeh.js +7 -0
  120. package/bin/chunk-x03jwaga.js +8 -0
  121. package/bin/chunk-x342vzdx.js +2 -0
  122. package/bin/chunk-x8mjh387.js +5 -0
  123. package/bin/chunk-xc54vhfz.js +2 -0
  124. package/bin/chunk-xvkwbczx.js +3 -0
  125. package/bin/chunk-y241cxff.js +1 -0
  126. package/bin/chunk-yk12hydf.js +7 -0
  127. package/bin/chunk-ympbfzz4.js +2 -0
  128. package/bin/{chunk-n412a1hp.js → chunk-yq32evnn.js} +6 -6
  129. package/bin/chunk-z1p13dnc.js +2 -0
  130. package/bin/chunk-zarz3sqn.js +211 -0
  131. package/bin/chunk-zezje74z.js +4 -0
  132. package/bin/chunk-zrszykjf.js +3 -0
  133. package/bin/shumai-app.html +1 -1
  134. package/bin/shumai-app.js +942 -1015
  135. package/package.json +7 -7
  136. package/prisma/migrations/20261026024507_hash_api_tokens/migration.sql +28 -0
  137. package/prisma/migrations/20261026031904_add_audit_log_via/migration.sql +2 -0
  138. package/prisma/migrations/20261029024626_add_oauth_and_jwks/migration.sql +205 -0
  139. package/prisma/migrations/20261029030321_default_empty_arrays_oauth/migration.sql +25 -0
  140. package/prisma/schema.prisma +186 -1
  141. package/bin/chunk-0502p2k7.js +0 -3
  142. package/bin/chunk-0b0t6y8h.js +0 -11
  143. package/bin/chunk-1vt9ss7d.js +0 -2
  144. package/bin/chunk-23780yj6.js +0 -3
  145. package/bin/chunk-2cpsfc87.js +0 -1
  146. package/bin/chunk-2w0d9veg.js +0 -2
  147. package/bin/chunk-2xp9prpq.js +0 -1
  148. package/bin/chunk-3gqs15zq.js +0 -2
  149. package/bin/chunk-3pw7z25v.js +0 -3
  150. package/bin/chunk-3tx9v8kj.js +0 -2
  151. package/bin/chunk-3wdtp4ht.js +0 -1
  152. package/bin/chunk-57axjy7y.js +0 -1
  153. package/bin/chunk-5aqthcm6.js +0 -5
  154. package/bin/chunk-5gq4q1bb.js +0 -2
  155. package/bin/chunk-5r1br11d.js +0 -2
  156. package/bin/chunk-61hrdg0g.js +0 -1
  157. package/bin/chunk-6aa4xmnw.js +0 -2
  158. package/bin/chunk-6mrgtn78.js +0 -18
  159. package/bin/chunk-6s55r0z9.js +0 -1
  160. package/bin/chunk-6vkfzzvt.js +0 -5
  161. package/bin/chunk-7dprpnm6.js +0 -2
  162. package/bin/chunk-7rycq6wb.js +0 -129
  163. package/bin/chunk-895gzdtp.js +0 -7
  164. package/bin/chunk-8d1p8qpv.js +0 -1
  165. package/bin/chunk-8r3k84dh.js +0 -2
  166. package/bin/chunk-99sarrvt.js +0 -3
  167. package/bin/chunk-b21z62fj.js +0 -1
  168. package/bin/chunk-bv589v2m.js +0 -3
  169. package/bin/chunk-c8kjpmfe.js +0 -2
  170. package/bin/chunk-c9xyejnk.js +0 -2
  171. package/bin/chunk-cb9peqy5.js +0 -2
  172. package/bin/chunk-ckczqmrz.js +0 -5
  173. package/bin/chunk-cr33cs6j.js +0 -2
  174. package/bin/chunk-cxet91kt.js +0 -2
  175. package/bin/chunk-d7e351jd.js +0 -6
  176. package/bin/chunk-ebcfbn00.js +0 -2
  177. package/bin/chunk-f0b4a9y3.js +0 -2
  178. package/bin/chunk-fkn6f4qt.js +0 -4
  179. package/bin/chunk-g78vapcm.js +0 -2
  180. package/bin/chunk-gdpfwxea.js +0 -4
  181. package/bin/chunk-gwqqq0b1.js +0 -32
  182. package/bin/chunk-h3cwf9aw.js +0 -2
  183. package/bin/chunk-h4ty530v.js +0 -16
  184. package/bin/chunk-h58yfx7w.js +0 -2
  185. package/bin/chunk-h9ngpxyd.js +0 -1
  186. package/bin/chunk-hbr17jvr.js +0 -13
  187. package/bin/chunk-hc0xbmtt.js +0 -5
  188. package/bin/chunk-j9t7tvt5.js +0 -2
  189. package/bin/chunk-jvt8q0eg.js +0 -2
  190. package/bin/chunk-jzgtthsj.js +0 -3
  191. package/bin/chunk-jzjhg7ng.js +0 -1
  192. package/bin/chunk-k547syp2.js +0 -2
  193. package/bin/chunk-k7sjpke6.js +0 -2
  194. package/bin/chunk-k8ct1qgv.js +0 -3
  195. package/bin/chunk-k9q4nn8b.js +0 -11
  196. package/bin/chunk-keetdtxb.js +0 -2
  197. package/bin/chunk-kjjw8mbg.js +0 -1
  198. package/bin/chunk-mey80kv9.js +0 -54
  199. package/bin/chunk-nfncawpm.js +0 -12
  200. package/bin/chunk-nvwt8atc.js +0 -1
  201. package/bin/chunk-p1d500sf.js +0 -211
  202. package/bin/chunk-q0vs124k.js +0 -2
  203. package/bin/chunk-q5795f3s.js +0 -2
  204. package/bin/chunk-q5j3b0h5.js +0 -3
  205. package/bin/chunk-qd7pvaxb.js +0 -2
  206. package/bin/chunk-qhpt7170.js +0 -2
  207. package/bin/chunk-qt78vs3g.js +0 -2
  208. package/bin/chunk-ra6mdjr0.js +0 -1
  209. package/bin/chunk-ryfvaz6v.js +0 -3
  210. package/bin/chunk-s22eapcc.js +0 -2
  211. package/bin/chunk-sbg86tch.js +0 -2
  212. package/bin/chunk-sbqy6m8t.js +0 -1
  213. package/bin/chunk-sdp9w627.js +0 -14
  214. package/bin/chunk-sn0nypvd.js +0 -42
  215. package/bin/chunk-sv92vkyh.js +0 -2
  216. package/bin/chunk-t6cn018t.js +0 -3
  217. package/bin/chunk-ts4d1mxf.js +0 -2
  218. package/bin/chunk-wkdkc12e.js +0 -4
  219. package/bin/chunk-xgnvktq6.js +0 -10
  220. package/bin/chunk-xjw3mpvx.js +0 -1
  221. package/bin/chunk-xznq2axj.js +0 -1
  222. package/bin/chunk-y4v08wq7.js +0 -1
  223. package/bin/chunk-yncvy335.js +0 -3
  224. package/bin/chunk-ytzddcj2.js +0 -1
  225. package/bin/chunk-zxqasmvz.js +0 -2
@@ -1,2 +0,0 @@
1
- import{I}from"./chunk-p1d500sf.js";var e=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],ec=I("square",e);
2
- export{ec};
@@ -1,3 +0,0 @@
1
- // @bun
2
- function as(_){if(_===void 0)return;let n=Array.from(_);if(n.length<=64)return _;return n.slice(0,64).join("")}
3
- export{as};
@@ -1 +0,0 @@
1
- import{m,E,t,Z,ze,g,gt,Tt,hm}from"./chunk-p1d500sf.js";import"./chunk-7rycq6wb.js";import"./chunk-sdp9w627.js";import"./chunk-c8kjpmfe.js";import"./chunk-qt78vs3g.js";import"./chunk-cxet91kt.js";import"./chunk-xgnvktq6.js";import"./chunk-keetdtxb.js";import"./chunk-j9t7tvt5.js";import"./chunk-sbg86tch.js";import"./chunk-k7sjpke6.js";import"./chunk-fkn6f4qt.js";import"./chunk-6vkfzzvt.js";import"./chunk-5aqthcm6.js";import{Yn}from"./chunk-h3cwf9aw.js";import{tr}from"./chunk-qd7pvaxb.js";import"./chunk-ahgq10a7.js";import"./chunk-1vt9ss7d.js";import"./chunk-agcnbjxk.js";import"./chunk-zxqasmvz.js";import"./chunk-ts4d1mxf.js";import"./chunk-xsfy8hz3.js";import"./chunk-1eqw2dpx.js";import"./chunk-b7qs7hxg.js";import"./chunk-ht5rht98.js";E();function c(){let{projectId:e}=f.useParams(),{teamId:r,ensureTeamIdForProject:n}=gt();m(()=>{n(e)},[e,n]);let{data:a}=tr(hm(e)),o=a?.rootFolder,{data:s}=Z({queryKey:["folders",o],queryFn:async()=>{let d=await g.api.folders[":folderId"].$get({param:{folderId:o}});if(!d.ok)throw Error("failed to fetch folder");return await d.json()},enabled:!!o});if(!r||!o||!s)return t(Tt,{});return t(Yn,{teamId:r,projectId:e,projectName:a.name??"",assetId:o,rootFolderId:o})}var f=ze("/projects/$projectId/")({component:c});export{f as Route};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Ot}from"./chunk-k9q4nn8b.js";import{Ge,Ht}from"./chunk-6mrgtn78.js";import{H}from"./chunk-t6cn018t.js";var A=H(Ot()),f=H(Ge());var g=H(Ge()),P=H(Ht());import{createHash as F,createPrivateKey as L,createPublicKey as O,sign as K}from"crypto";import{promises as x}from"fs";import{homedir as _}from"os";import{dirname as v,join as I}from"path";class h{profileData;init;callerClientConfig;static REFRESH_THRESHOLD=300000;constructor(e,t,s){this.profileData=e,this.init=t,this.callerClientConfig=s}async loadCredentials(){let e=await this.loadToken();if(!e)throw new g.CredentialsProviderError(`Failed to load a token for session ${this.loginSession}, please re-authenticate using aws login`,{tryNextLink:!1,logger:this.logger});let t=e.accessToken,s=Date.now();if(new Date(t.expiresAt).getTime()-s<=h.REFRESH_THRESHOLD)return this.refresh(e);return this.toCredentials(e.accessToken)}get logger(){return this.init?.logger}get loginSession(){return this.profileData.login_session}toCredentials(e){return{accessKeyId:e.accessKeyId,secretAccessKey:e.secretAccessKey,sessionToken:e.sessionToken,accountId:e.accountId,expiration:new Date(e.expiresAt)}}async refresh(e){let t=await this.loadToken().catch(()=>e),s=Date.now(),r=new Date(t.accessToken.expiresAt).getTime(),n=new Date(e.accessToken.expiresAt).getTime(),o=r<=s&&n>s?e:t;if(new Date(o.accessToken.expiresAt).getTime()-Date.now()>h.REFRESH_THRESHOLD)return this.toCredentials(o.accessToken);let{SigninClient:p,CreateOAuth2TokenCommand:w}=await import("./chunk-3tx9v8kj.js"),{logger:y,userAgentAppId:m}=this.callerClientConfig??{},T=((i)=>i?.metadata?.handlerProtocol==="h2")(this.callerClientConfig?.requestHandler)?void 0:this.callerClientConfig?.requestHandler,d=this.profileData.region??await this.callerClientConfig?.region?.()??process.env.AWS_REGION,u=new p({credentials:{accessKeyId:"",secretAccessKey:""},region:d,requestHandler:T,logger:y,userAgentAppId:m,...this.init?.clientConfig});this.createDPoPInterceptor(u.middlewareStack);let S={tokenInput:{clientId:o.clientId,refreshToken:o.refreshToken,grantType:"refresh_token"}};try{let i=await u.send(new w(S)),{accessKeyId:c,secretAccessKey:k,sessionToken:l}=i.tokenOutput?.accessToken??{},{refreshToken:D,expiresIn:N}=i.tokenOutput??{};if(!c||!k||!l||!D)throw new g.CredentialsProviderError("Token refresh response missing required fields",{logger:this.logger,tryNextLink:!1});let R=(N??900)*1000,b=new Date(Date.now()+R),C={...o,accessToken:{...o.accessToken,accessKeyId:c,secretAccessKey:k,sessionToken:l,expiresAt:b.toISOString()},refreshToken:D};return await this.saveToken(C),this.toCredentials(C.accessToken)}catch(i){if(i.name==="AccessDeniedException"){let k=i.error,l;switch(k){case"TOKEN_EXPIRED":l="Your session has expired. Please reauthenticate.";break;case"USER_CREDENTIALS_CHANGED":l="Unable to refresh credentials because of a change in your password. Please reauthenticate with your new password.";break;case"INSUFFICIENT_PERMISSIONS":l="Unable to refresh credentials due to insufficient permissions. You may be missing permission for the 'CreateOAuth2Token' action.";break;default:l=`Failed to refresh token: ${String(i)}. Please re-authenticate using \`aws login\``}throw new g.CredentialsProviderError(l,{logger:this.logger,tryNextLink:!1})}if(new Date(o.accessToken.expiresAt).getTime()>Date.now())return this.logger?.warn?.(`Failed to refresh token: ${String(i)}. Using existing token until expiry.`),this.toCredentials(o.accessToken);throw new g.CredentialsProviderError(`Failed to refresh token: ${String(i)}. Please re-authenticate using aws login`,{logger:this.logger})}}async loadToken(){let e=this.getTokenFilePath();try{let t=await x.readFile(e,"utf8"),s=JSON.parse(t),r=["accessToken","clientId","refreshToken","dpopKey"].filter((n)=>!s[n]);if(!s.accessToken?.accountId)r.push("accountId");if(r.length>0)throw new g.CredentialsProviderError(`Token validation failed, missing fields: ${r.join(", ")}`,{logger:this.logger,tryNextLink:!1});return s}catch(t){throw new g.CredentialsProviderError(`Failed to load token from ${e}: ${String(t)}`,{logger:this.logger,tryNextLink:!1})}}async saveToken(e){let t=this.getTokenFilePath(),s=v(t);try{await x.mkdir(s,{recursive:!0})}catch(r){}await x.writeFile(t,JSON.stringify(e,null,2),"utf8")}getTokenFilePath(){let e=process.env.AWS_LOGIN_CACHE_DIRECTORY??I(_(),".aws","login","cache"),t=Buffer.from(this.loginSession,"utf8"),s=F("sha256").update(t).digest("hex");return I(e,`${s}.json`)}derToRawSignature(e){let t=2;if(e[t]!==2)throw Error("Invalid DER signature");t++;let s=e[t++],r=e.subarray(t,t+s);if(t+=s,e[t]!==2)throw Error("Invalid DER signature");t++;let n=e[t++],o=e.subarray(t,t+n);r=r[0]===0?r.subarray(1):r,o=o[0]===0?o.subarray(1):o;let a=Buffer.concat([Buffer.alloc(32-r.length),r]),p=Buffer.concat([Buffer.alloc(32-o.length),o]);return Buffer.concat([a,p])}createDPoPInterceptor(e){e.add((t)=>async(s)=>{if(P.HttpRequest.isInstance(s.request)){let r=s.request,n=`${r.protocol}//${r.hostname}${r.port?`:${r.port}`:""}${r.path}`,o=await this.generateDpop(r.method,n);r.headers={...r.headers,DPoP:o}}return t(s)},{step:"finalizeRequest",name:"dpopInterceptor",override:!0})}async generateDpop(e="POST",t){let s=await this.loadToken();try{let r=L({key:s.dpopKey,format:"pem",type:"sec1"}),o=O(r).export({format:"der",type:"spki"}),a=-1;for(let c=0;c<o.length;c++)if(o[c]===4){a=c;break}let p=o.slice(a+1,a+33),w=o.slice(a+33,a+65),y={alg:"ES256",typ:"dpop+jwt",jwk:{kty:"EC",crv:"P-256",x:p.toString("base64url"),y:w.toString("base64url")}},m={jti:crypto.randomUUID(),htm:e,htu:t,iat:Math.floor(Date.now()/1000)},E=Buffer.from(JSON.stringify(y)).toString("base64url"),T=Buffer.from(JSON.stringify(m)).toString("base64url"),d=`${E}.${T}`,u=K("sha256",Buffer.from(d),r),i=this.derToRawSignature(u).toString("base64url");return`${d}.${i}`}catch(r){throw new g.CredentialsProviderError(`Failed to generate Dpop proof: ${r instanceof Error?r.message:String(r)}`,{logger:this.logger,tryNextLink:!1})}}}var B=(e)=>async({callerClientConfig:t}={})=>{e?.logger?.debug?.("@aws-sdk/credential-providers - fromLoginCredentials");let s=await f.parseKnownFiles(e||{}),r=f.getProfileName({profile:e?.profile??t?.profile}),n=s[r];if(!n?.login_session)throw new f.CredentialsProviderError(`Profile ${r} does not contain login_session.`,{tryNextLink:!0,logger:e?.logger});let a=await new h(n,e,t).loadCredentials();return A.setCredentialFeature(a,"CREDENTIALS_LOGIN","AD")};export{B as fromLoginCredentials};
@@ -1 +0,0 @@
1
- import{m,_,u,E,L,t,o,G,Ta,Z,B,Pe,ze,g,I,rr,O,Me,pe,Ne,C,S,Ce,Ie,Te,ge,Ae,_e,K,c0,u0,I_,Re,vy,Zy,jy,jf,ht,_b,yb,Ib,cv,Ov,Fv,Yc,Ax,nE,JE,rC,Fd,sC,iC,aC,lC,Hg,cC,eI,Qs,tu,Ll,kT,Zl,ru,nu,PT,ou,DT,f1,rM,sM,lM,cM,am,su,nt,ot,st,it,at,lt,ct,ut,de,ce,me,He,ue,Et,z,Ft,M,e0,W,ke,br}from"./chunk-p1d500sf.js";import{tc}from"./chunk-sbg86tch.js";import{Gl}from"./chunk-sv92vkyh.js";import{ga}from"./chunk-jvt8q0eg.js";import{po}from"./chunk-1eqw2dpx.js";import{_n}from"./chunk-b7qs7hxg.js";import"./chunk-ht5rht98.js";var Se=[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["path",{d:"M11 4h10",key:"1w87gc"}],["path",{d:"M11 8h7",key:"djye34"}],["path",{d:"M11 12h4",key:"q8tih4"}]],te=I("arrow-down-wide-narrow",Se);var $e=[["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M12 21v-9",key:"17s77i"}],["path",{d:"M12 8V3",key:"13r4qs"}],["path",{d:"M17 16h4",key:"h1uq16"}],["path",{d:"M19 12V3",key:"o1uvq1"}],["path",{d:"M19 21v-5",key:"qua636"}],["path",{d:"M3 14h4",key:"bcjad9"}],["path",{d:"M5 10V3",key:"cb8scm"}],["path",{d:"M5 21v-7",key:"1w1uti"}]],se=I("sliders-vertical",$e);E();function ie({open:a,onOpenChange:c,mode:d,teamId:y,project:l}){let v=G(),f=Pe(),[n,w]=u(""),[F,N]=u(!0),[T,x]=u(void 0),[P,b]=u(void 0),[h,A]=u(!1),D=_(null);m(()=>{if(a)if(d==="edit"&&l)w(l.name||""),x(l.coverImageKey),b(l.coverImage),N(l.enableNotification!==!1);else w(""),x(void 0),b(void 0),N(!0)},[a,d,l]);let q=g.api.teams[":teamId"].projects.$post,{mutate:X}=B({mutationFn:async(i)=>{let s=await q({param:{teamId:y},json:i});if(!s.ok)throw Error(cv());return await s.json()},onSuccess:(i)=>{v.invalidateQueries({queryKey:["teams",y,"projects"]}),c(!1);let s=i;if(s&&typeof s.id==="string")f({to:"/projects/$projectId",params:{projectId:s.id}})}}),R=g.api.projects[":projectId"].$put,{mutate:Y}=B({mutationFn:async(i)=>{let s=await R({param:{projectId:l.id},json:i});if(!s.ok)throw Error(Ov());return await s.json()},onSuccess:()=>{v.invalidateQueries({queryKey:["teams",y,"projects"]}),c(!1)}}),J=g.api.teams[":teamId"].files.$post,{mutate:U}=B({mutationFn:async({file:i})=>{let s=await J({param:{teamId:y},form:{file:i}});if(!s.ok)throw Error(Yc());return await s.json()},onSuccess:(i)=>{let s=i;if(s&&typeof s.key==="string")x(s.key);A(!1)},onError:()=>{A(!1)}}),p=(i)=>{let s=i.target.files?.[0];if(s){A(!0);let ee=URL.createObjectURL(s);b(ee),U({file:s})}},j=()=>{D.current?.click()},Q=(i)=>{i.stopPropagation(),x(void 0),b(void 0)},k=()=>{if(!n.trim())return;if(d==="create")X({name:n.trim(),coverImageKey:T,enableNotification:F});else if(d==="edit"&&l?.id)Y({name:n.trim(),coverImageKey:T,enableNotification:F})};return t(de,{open:a,onOpenChange:c,children:o(ce,{className:"sm:max-w-[550px] overflow-hidden rounded-2xl border border-border/60 bg-background/95 backdrop-blur-md shadow-2xl p-0 gap-0",children:[o(me,{className:"relative overflow-hidden bg-gradient-to-br from-primary/5 to-transparent p-6 border-b border-border/40",children:[t("div",{className:"absolute top-0 right-0 w-24 h-24 bg-primary/10 rounded-full blur-2xl pointer-events-none"}),t("div",{className:"absolute bottom-0 left-10 w-32 h-12 bg-primary/5 rounded-full blur-xl pointer-events-none"}),t("div",{className:"flex items-center gap-3",children:o("div",{children:[t(ue,{className:"text-xl font-semibold tracking-tight text-foreground",children:d==="create"?jy():Hg()}),t(Et,{className:"text-xs text-muted-foreground/80 mt-1",children:d==="create"?vy():Ax()})]})})]}),o("div",{className:"space-y-6 p-6 max-h-[75vh] overflow-y-auto",children:[o("div",{className:"space-y-2",children:[t(W,{htmlFor:"name",className:"text-sm font-semibold tracking-tight text-foreground",children:Fd()}),o("div",{className:"relative",children:[t(z,{id:"name",value:n,onChange:(i)=>w(i.target.value),placeholder:iC(),className:"h-11 px-4 rounded-xl border-border/80 focus-visible:ring-ring/25 focus-visible:border-primary transition-all shadow-xs pr-10"}),n.trim()&&t("div",{className:"absolute inset-y-0 right-3 flex items-center",children:t(Me,{className:"w-4 h-4 text-primary"})})]}),t("p",{className:"text-[11px] text-muted-foreground",children:sC()})]}),o("div",{className:"space-y-3 border-t border-border/40 pt-5",children:[o("div",{className:"flex items-center justify-between",children:[o(W,{className:"text-sm font-semibold tracking-tight text-foreground flex items-center gap-1.5",children:[t(_n,{className:"w-4 h-4 text-primary"}),rC()]}),P&&o("button",{type:"button",onClick:Q,className:"text-xs text-muted-foreground hover:text-destructive hover:bg-destructive/5 px-2.5 py-1 rounded-lg transition-all flex items-center gap-1 font-medium",children:[t(Ne,{className:"w-3.5 h-3.5"}),eI()]})]}),o("div",{className:"relative aspect-square w-48 mx-auto rounded-2xl border border-dashed border-border flex items-center justify-center cursor-pointer overflow-hidden group shadow-inner bg-muted/20 transition-all duration-300 hover:border-primary/50 hover:bg-muted/40",onClick:j,children:[t("input",{type:"file",ref:D,className:"hidden",accept:"image/*",onChange:p}),h&&t("div",{className:"absolute inset-0 bg-background/70 backdrop-blur-xs flex flex-col items-center justify-center gap-2 z-20",children:o("div",{className:"flex items-center gap-2 px-3 py-1.5 bg-background border rounded-full shadow-lg",children:[t(O,{className:"w-4 h-4 animate-spin text-primary"}),t("span",{className:"text-xs font-semibold text-foreground",children:su()})]})}),P?o(L,{children:[t("img",{src:P,alt:Zy(),className:"w-full h-full object-cover transition-transform duration-500 group-hover:scale-105"}),o("div",{className:"absolute inset-0 bg-black/45 opacity-0 group-hover:opacity-100 transition-opacity duration-300 flex flex-col items-center justify-center gap-1.5 text-white z-10",children:[t(po,{className:"w-5 h-5 transform translate-y-1 group-hover:translate-y-0 transition-transform duration-300"}),t("span",{className:"text-xs font-semibold",children:am()})]})]}):o("div",{className:"flex flex-col items-center gap-2 text-center p-4",children:[t("div",{className:"p-2.5 rounded-full bg-background border shadow-xs group-hover:scale-110 transition-transform duration-300",children:t(po,{className:"w-4 h-4 text-muted-foreground"})}),o("div",{children:[t("p",{className:"text-xs font-medium text-foreground",children:lM()}),t("p",{className:"text-[11px] text-muted-foreground mt-0.5 max-w-[140px] mx-auto leading-normal",children:cM()})]})]})]})]}),o("div",{className:"space-y-3 border-t border-border/40 pt-5",children:[o(W,{className:"text-sm font-semibold tracking-tight text-foreground flex items-center gap-1.5",children:[t(se,{className:"w-4 h-4 text-primary"}),lC()]}),o("div",{className:"flex items-start justify-between rounded-xl border border-border/50 bg-muted/10 p-4 transition-all duration-300 hover:bg-muted/20",children:[o("div",{className:"space-y-1 pr-4",children:[o("div",{className:"text-sm font-semibold flex items-center gap-2 text-foreground",children:[t(ga,{className:"w-4 h-4 text-primary"}),c0()]}),t("p",{className:"text-xs text-muted-foreground leading-normal",children:u0()})]}),t(ke,{checked:F,onCheckedChange:N,disabled:h,className:"mt-0.5"})]})]})]}),o(He,{className:"flex items-center justify-end gap-3 px-6 py-4 bg-muted/20 border-t border-border/40",children:[t(S,{type:"button",variant:"ghost",onClick:()=>c(!1),disabled:h,className:"rounded-xl h-10 px-4 hover:bg-muted font-medium text-sm text-muted-foreground hover:text-foreground transition-colors",children:Re()}),t(S,{type:"submit",onClick:k,disabled:!n.trim()||h,className:"rounded-xl h-10 px-5 bg-primary text-primary-foreground hover:bg-primary/90 font-semibold text-sm shadow-lg shadow-primary/10 hover:shadow-primary/20 active:scale-98 transition-all flex items-center gap-2",children:h?o(L,{children:[t(O,{className:"w-4 h-4 animate-spin"}),JE()]}):d==="create"?jf():Qs()})]})]})})}function le({sortBy:a,sortDirection:c,onSortChange:d}){let y=(n)=>{d(n,c)},l=()=>{d(a,c==="asc"?"desc":"asc")},v=(n)=>{switch(n){case"name":return Zl();case"created_at":return kT();case"updated_at":return PT();default:return n}},f=c==="asc";return o(ge,{children:[t(Ae,{asChild:!0,children:o(S,{variant:"outline",className:"gap-2 bg-muted/50",children:[t("span",{className:"text-muted-foreground",children:DT()}),t("span",{className:"font-medium text-foreground",children:v(a)})]})}),o(_e,{align:"end",className:"w-56 p-2",children:[t("div",{className:"text-xs font-semibold text-muted-foreground mb-2 px-2",children:Ll()}),o(ge,{children:[t(Ae,{asChild:!0,children:o(S,{variant:"ghost",className:"w-full justify-between font-normal px-2 h-10 bg-muted/50 hover:bg-muted mb-2 border",children:[t("span",{children:v(a)}),t(te,{className:"h-4 w-4 opacity-50"})]})}),t(_e,{className:"w-52",children:["name","created_at","updated_at"].map((n)=>o(K,{onClick:()=>y(n),className:"justify-between",children:[v(n),a===n&&t(Me,{className:"h-4 w-4"})]},n))})]}),o(S,{variant:"ghost",className:"w-full justify-between font-normal px-2 h-10 bg-muted/50 hover:bg-muted border",onClick:l,children:[t("span",{className:"text-muted-foreground",children:a==="name"?f?t(L,{children:tu()}):t(L,{children:ou()}):f?t(L,{children:nu()}):t(L,{children:ru()})}),f?t(Gl,{className:"h-4 w-4 opacity-50"}):t(te,{className:"h-4 w-4 opacity-50"})]})]})]})}E();function Le(){let{teamId:a}=Ke.useParams(),{canEdit:c,canAdmin:d}=Ft(),y=Pe(),l=G(),[v,f]=u(null),[n,w]=u(!1),[F,N]=u("create"),[T,x]=u(void 0),[P,b]=u(!1),[h,A]=u(void 0),[D,q]=u(""),[X,R]=u(!1),{metadata:Y,setMetadata:J}=br(),U=`team:${a}:projects:sort`,p=Y[U],[j,Q]=u(()=>p?.sortBy||"name"),[k,i]=u(()=>p?.sortDirection||"asc");m(()=>{if(p?.sortBy&&p.sortBy!==j)Q(p.sortBy);if(p?.sortDirection&&p.sortDirection!==k)i(p.sortDirection)},[p]);let s=g.api.teams[":teamId"].projects.$get,{data:ee}=Z({queryKey:["teams",a,"projects",j,k],queryFn:async()=>{let e=await s({param:{teamId:a},query:{sortBy:j,sortDirection:k}});if(!e.ok)throw Error("Failed to fetch projects");return await e.json()},placeholderData:Ta}),{data:oe}=Z({queryKey:["teams",a,"members"],queryFn:async()=>{let e=await g.api.teams[":teamId"].members.$get({param:{teamId:a},query:{}});if(!e.ok)throw Error("Failed to fetch members");return await e.json()}}),{data:re}=Z({queryKey:["teams",a,"me"],queryFn:async()=>{let e=await g.api.teams[":teamId"].me.$get({param:{teamId:a}});if(!e.ok)throw Error("Failed to fetch me");return await e.json()}}),fe=g.api.teams[":teamId"].invite.$post,ve=B({mutationFn:async(e)=>{let r=await fe(e);if(!r.ok)throw Error("Failed to invite");return await r.json()}}),H=B({mutationFn:async(e)=>{if(!(await g.api.projects[":projectId"].$delete({param:{projectId:e}})).ok)throw Error("Failed to delete project")},onSuccess:()=>{l.invalidateQueries({queryKey:["teams",a,"projects"]})}}),he=B({mutationFn:async(e)=>{let r=await g.api.projects[":projectId"].$put({param:{projectId:e.id},json:{enableNotification:!e.enableNotification}});if(!r.ok)throw Error("Failed to update project notification settings");return await r.json()},onSuccess:()=>{l.invalidateQueries({queryKey:["teams",a,"projects"]}),M.success(aC())},onError:(e)=>{M.error(e instanceof Error?e.message:Fv())}}),ae=()=>{N("create"),x(void 0),w(!0)},ye=()=>{f("create"),setTimeout(()=>{f(null)},100),setTimeout(()=>{ae()},200)},be=(e)=>{N("edit"),x(e),w(!0)},we=(e)=>{A(e),q(""),b(!0)},xe=async()=>{if(h&&D==="delete")try{await H.mutateAsync(h.id),b(!1)}catch(e){console.error(e)}},De=(e,r)=>{if(r.detail>1)return;f(e),setTimeout(()=>{f(null)},100),setTimeout(()=>{y({to:"/projects/$projectId",params:{projectId:e}})},200)},je=async(e)=>(await ve.mutateAsync({param:{teamId:a},json:{role:e}})).code,Fe=B({mutationFn:async({userId:e,role:r})=>{if(!(await g.api.teams[":teamId"].members[":userId"].$patch({param:{teamId:a,userId:e},json:{role:r}})).ok)throw Error("Failed to update member role")},onSuccess:()=>{l.invalidateQueries({queryKey:["teams",a,"members"]})}}),Ee=B({mutationFn:async(e)=>{if(!(await g.api.teams[":teamId"].members[":userId"].$delete({param:{teamId:a,userId:e}})).ok)throw Error("Failed to remove member")},onSuccess:()=>{l.invalidateQueries({queryKey:["teams",a,"members"]})}}),qe=(e)=>{if(!e)return"??";return e.split(" ").map((r)=>r[0]).slice(0,2).join("").toUpperCase()},Be=(e,r)=>{Q(e),i(r),J(a,U,{sortBy:e,sortDirection:r})},V=Array.isArray(oe)?oe:[];return o("div",{className:"flex-1 overflow-y-auto p-4",children:[o("div",{className:"flex flex-wrap items-center justify-between mb-4 gap-4",children:[t("h1",{className:"text-2xl font-bold",children:cC()}),o("div",{className:"flex flex-wrap items-center gap-4",children:[o("div",{className:"flex items-center -space-x-2 cursor-pointer hover:opacity-90",onClick:()=>R(!0),"data-testid":"team-members-trigger",children:[V.slice(0,3).map((e)=>o(Ce,{className:"border-2 border-background w-8 h-8",children:[e.image&&t(Ie,{src:e.image,alt:e.name,className:"object-cover"}),t(Te,{className:"text-[10px]",children:qe(e.name)})]},e.id)),V.length>3&&o("div",{className:"flex items-center justify-center w-8 h-8 rounded-full border-2 border-background bg-muted text-[10px] font-medium",children:["+",V.length-3]})]}),t(le,{sortBy:j,sortDirection:k,onSortChange:Be}),c&&o(S,{className:"bg-orange-600 hover:bg-orange-700 text-white gap-2",onClick:ae,children:[t(pe,{className:"w-4 h-4"}),jf()]})]})]}),o("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-6 gap-4",children:[ee?.data?.map((e)=>t("div",{className:C("shadow-md relative border rounded-xl overflow-hidden cursor-pointer transition-transform duration-100 ease-in-out",v===e.id?"scale-95":"scale-100"),onClick:(r)=>De(e.id,r),children:o("div",{className:"flex flex-col",children:[o("div",{className:"relative w-full h-full aspect-square flex items-center justify-center bg-zinc-400/20",children:[e.coverImage?t("img",{src:e.coverImage,alt:e.name,className:"w-full h-full object-cover rounded"}):o("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 180.95 164.7",preserveAspectRatio:"xMidYMid slice",className:"w-full h-full object-cover rounded",children:[t("polygon",{fill:"#FC9F8E",points:"0 18.5 0 76.0 151.69 164.7 180.95 164.7 180.95 113.6"}),t("polygon",{fill:"#FEBAB8",points:"0 0 74.58 61.5 90.53 51.6 110.33 63.9 180.95 18.9 180.95 0"}),t("polyline",{fill:"#FAA5A5",points:"0 18.5 74.58 61.5 90.53 51.6 110.33 63.9 180.95 18.9 180.95 0 0 0"}),t("polygon",{fill:"#EC5B6C",points:"0 76.0 0 164.7 151.69 164.7"}),t("polygon",{fill:"#E85C71",points:"180.95 18.9 110.33 63.9 117.37 68.0 117.26 73.4 180.95 113.6"}),t("polygon",{fill:"#C8405B",points:"117.26 73.4 117.37 99.0 90.53 114.9 174.35 164.7 180.95 164.7 180.95 113.6"}),t("polygon",{fill:"#FFCCBE",points:"90.53 51.6 63.69 68.1 90.53 83.4"}),t("path",{fill:"#FB9991",d:"M 90.53 51.6 L 90.53 61.3 L 100.87 67.4 L 90.53 73.5 L 90.53 83.4 L 117.37 68.0 C 117.15 67.6 90.53 51.6 90.53 51.6 Z"}),t("path",{fill:"#FFEACD",d:"M 63.69 68.1 C 63.47 68.5 64.02 99.3 64.02 99.3 C 64.02 99.3 64.46 99.6 64.9 99.9 L 90.53 83.4 L 63.69 68.1 Z"}),t("polygon",{fill:"#FFCFB5",points:"64.02 99.3 90.53 114.9 90.53 83.4"}),t("path",{fill:"#F67D73",d:"M 90.53 83.4 L 90.53 114.9 L 117.37 99.0 Z"}),t("path",{fill:"#F26560",d:"M 90.53 83.4 L 117.37 99.0 L 117.37 68.0 Z"}),t("polygon",{fill:"#EB5F5B",points:"80.08 67.5 90.53 73.5 90.53 61.3"}),t("polygon",{fill:"#DB4D50",points:"90.53 61.3 90.53 73.5 100.87 67.4"})]}),t("div",{className:"absolute bottom-0 left-0 w-full h-[65%] bg-linear-to-t from-black/35 to-black/0"}),t("p",{className:"absolute left-1 bottom-2 text-white",children:e.name})]}),o("div",{className:"px-2 h-10 flex justify-between items-center",children:[o("p",{className:"truncate pr-1 text-xs text-muted-foreground",children:[sM()," ",e0(e.updatedAt??"")]}),t("div",{onClick:(r)=>r.stopPropagation(),children:o(ge,{modal:!1,children:[t(Ae,{asChild:!0,children:t("button",{className:"hover:bg-muted outline-none flex px-1",children:t(rr,{className:"w-5 h-5 text-muted-foreground"})})}),o(_e,{align:"end",children:[c&&t(K,{onClick:(r)=>{r.stopPropagation(),be(e)},children:Hg()}),o(K,{className:"flex items-center justify-between gap-4 cursor-pointer",onSelect:(r)=>{r.preventDefault(),he.mutate(e)},children:[t("span",{children:nE()}),t(ke,{checked:e.enableNotification??!0,className:"pointer-events-none"})]}),d&&t(K,{className:"text-destructive focus:text-destructive",onClick:()=>we(e),children:ht()})]})]})})]})]})},e.id)),c&&t("div",{className:C("shadow-md relative border rounded-xl overflow-hidden cursor-pointer transition-transform duration-100 ease-in-out border-dashed hover:border-orange-600/50 group",v==="create"?"scale-95":"scale-100"),onClick:ye,children:o("div",{className:"flex flex-col",children:[t("div",{className:"relative w-full aspect-square flex items-center justify-center bg-zinc-400/5 group-hover:bg-orange-600/5 transition-colors",children:t(pe,{className:"w-8 h-8 text-zinc-400 group-hover:text-orange-600 transition-colors"})}),t("div",{className:"px-2 h-10 flex items-center justify-center bg-zinc-400/10 border-t group-hover:bg-orange-600/10 transition-colors",children:t("p",{className:"text-sm text-muted-foreground group-hover:text-orange-600 transition-colors",children:jf()})})]})})]}),t(ie,{open:n,onOpenChange:w,mode:F,teamId:a,project:T}),t(nt,{open:P,onOpenChange:b,children:o(ot,{children:[o(st,{children:[t(at,{children:I_()}),o(lt,{children:[yb({name:h?.name??""}),o("div",{className:"mt-4 flex flex-col gap-2 text-foreground",children:[t("span",{className:"text-sm font-medium",children:rM()}),t(z,{value:D,onChange:(e)=>q(e.target.value),placeholder:_b(),className:"h-9",autoFocus:!0})]})]})]}),o(it,{children:[t(ut,{disabled:H.isPending,children:Re()}),t(ct,{onClick:(e)=>{e.preventDefault(),xe()},disabled:D!=="delete"||H.isPending,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:H.isPending?Ib():ht()})]})]})}),t(tc,{open:X,onOpenChange:R,title:f1(),type:"team",members:V,isOwner:re?.role==="owner",onInvite:je,onUpdateRole:async(e,r)=>{await Fe.mutateAsync({userId:e,role:r})},onRemoveMember:async(e)=>{await Ee.mutateAsync(e)},currentUserId:re?.id})]})}var Ke=ze("/teams/$teamId/")({component:Le});export{Ke as Route};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{al}from"./chunk-jzgtthsj.js";export default al();
@@ -1,3 +0,0 @@
1
- // @bun
2
- function bn(n){let e={};for(let[t,r]of n.entries())e[t]=r;return e}function Hi(n){if(!n)return;let e={};for(let[t,r]of Object.entries(n))if(r!==null)e[t]=r;return Object.keys(e).length>0?e:void 0}
3
- export{bn,Hi};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Ls,Qo}from"./chunk-n412a1hp.js";import{Ko}from"./chunk-hc0xbmtt.js";import{Wo,vo,Ot}from"./chunk-k9q4nn8b.js";import{wn,sr,Ge,nn,er,xo,Ht}from"./chunk-6mrgtn78.js";var{awsEndpointFunctions:De,emitWarningIfUnsupportedVersion:Ne,createDefaultUserAgentProvider:we,NODE_APP_ID_CONFIG_OPTIONS:$e,getAwsRegionExtensionConfiguration:Ue,resolveAwsRegionExtensionConfiguration:Fe,resolveUserAgentConfig:be,resolveHostHeaderConfig:qe,getUserAgentPlugin:Me,getHostHeaderPlugin:He,getLoggerPlugin:Ve,getRecursionDetectionPlugin:We}=Ot(),{NoAuthSigner:Le,getHttpAuthSchemeEndpointRuleSetPlugin:ze,DefaultIdentityProviderConfig:Be,getHttpSigningPlugin:je}=vo(),{normalizeProvider:se,getSmithyContext:Ke,ServiceException:Xe,NoOpLogger:Qe,emitWarningIfUnsupportedVersion:Ye,loadConfigsForDefaultMode:Je,getDefaultExtensionConfiguration:Ze,resolveDefaultRuntimeConfig:et,Client:ne,makeBuilder:tt,createAggregatedClient:st}=sr(),{Command:nt}=sr();var $s=nt,Us=ne;var{resolveDefaultsModeConfig:ot,loadConfig:E,NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS:rt,NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS:it,NODE_REGION_CONFIG_OPTIONS:at,NODE_REGION_CONFIG_FILE_OPTIONS:ct,resolveRegionConfig:ut}=Ge(),{BinaryDecisionDiagram:pt,EndpointCache:dt,decideEndpoint:ht,customEndpointFunctions:gt,resolveEndpointConfig:lt,getEndpointPlugin:Et}=nn(),{parseUrl:mt,getHttpHandlerExtensionConfiguration:At,resolveHttpHandlerRuntimeConfig:_t,getContentLengthPlugin:St}=Ht(),{DEFAULT_RETRY_MODE:It,NODE_RETRY_MODE_CONFIG_OPTIONS:Ct,NODE_MAX_ATTEMPT_CONFIG_OPTIONS:Rt,resolveRetryConfig:vt,getRetryPlugin:ft}=Wo(),{TypeRegistry:oe,getSchemaSerdePlugin:Pt}=wn(),{resolveAwsSdkSigV4Config:Tt,AwsSdkSigV4Signer:kt,NODE_AUTH_SCHEME_PREFERENCE_OPTIONS:xt}=Qo(),{toUtf8:yt,fromUtf8:Dt,toBase64:Nt,fromBase64:wt,calculateBodyLength:$t}=er(),{streamCollector:Ut,NodeHttpHandler:Ft}=Ko(),{AwsRestJsonProtocol:bt}=Ls(),{Sha256:qt}=xo(),Mt=async(e,s,n)=>({operation:Ke(s).operation,region:await se(e.region)()||(()=>{throw Error("expected `region` to be configured for `aws.auth#sigv4`")})()});function Vt(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"signin",region:e.region},propertiesExtractor:(s,n)=>({signingProperties:{config:s,context:n}})}}function Wt(e){return{schemeId:"smithy.api#noAuth"}}var Lt=(e)=>{let s=[];switch(e.operation){case"CreateOAuth2Token":{s.push(Wt());break}default:s.push(Vt(e))}return s},zt=(e)=>{let s=Tt(e);return Object.assign(s,{authSchemePreference:se(e.authSchemePreference??[])})},Bt=(e)=>Object.assign(e,{useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:"signin"}),jt={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},Gt="3.997.43",Kt={version:Gt},h="ref",p=-1,V=!1,m=!0,W="isSet",A="booleanEquals",L="coalesce",w="PartitionResult",u="stringEquals",k="getAttr",z="https://signin.{Region}.{PartitionResult#dualStackDnsSuffix}",B={[h]:"Endpoint"},d={fn:k,argv:[{[h]:w},"name"]},re={[h]:"Region"},j={[h]:w},S={authSchemes:[{name:"sigv4",signingName:"signin",signingRegion:"{Region}"}]},r={},G=[re],K={conditions:[[W,G],[A,[{fn:L,argv:[{[h]:"IsControlPlane"},V]},m]],[W,[B]],["aws.partition",G,w],[A,[{[h]:"UseFIPS"},m]],[u,[d,"aws"]],[A,[{fn:L,argv:[{[h]:"IsOAuthEndpoint"},V]},m]],[A,[{[h]:"UseDualStack"},m]],[u,[d,"aws-cn"]],[u,[re,"us-gov-west-1"]],[u,[d,"aws-us-gov"]],[A,[{fn:k,argv:[j,"supportsFIPS"]},m]],[u,[d,"aws-iso"]],[u,[d,"aws-iso-b"]],[u,[d,"aws-iso-f"]],[u,[d,"aws-iso-e"]],[u,[d,"aws-eusc"]],[A,[{fn:k,argv:[j,"supportsDualStack"]},m]]],results:[[p],["https://signin.{Region}.api.aws",S],["https://signin.{Region}.api.amazonwebservices.com.cn",S],[z,S],[p,"FIPS endpoints are not supported for OAuth operations. Disable FIPS or use a non-OAuth operation."],["https://{Region}.oauth.signin.aws",S],["https://{Region}.signin.aws.amazon.com",r],["https://{Region}.signin.amazonaws.cn",r],["https://{Region}.signin.amazonaws-us-gov.com",r],["https://{Region}.signin.c2shome.ic.gov",r],["https://{Region}.signin.sc2shome.sgov.gov",r],["https://{Region}.signin.csphome.hci.ic.gov",r],["https://{Region}.signin.csphome.adc-e.uk",r],["https://{Region}.signin.amazonaws-eusc.eu",r],["https://signin-fips.amazonaws-us-gov.com",r],["https://{Region}.signin-fips.amazonaws-us-gov.com",r],["https://{Region}.signin.{PartitionResult#dnsSuffix}",r],[p,"Invalid Configuration: FIPS and custom endpoint are not supported"],[p,"Invalid Configuration: Dualstack and custom endpoint are not supported"],[B,r],["https://signin-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",r],[p,"FIPS and DualStack are enabled, but this partition does not support one or both"],["https://signin-fips.{Region}.{PartitionResult#dnsSuffix}",r],[p,"FIPS is enabled but this partition does not support FIPS"],[z,r],[p,"DualStack is enabled but this partition does not support DualStack"],["https://signin.{Region}.{PartitionResult#dnsSuffix}",r],[p,"Invalid Configuration: Missing Region"]]},Xt=2,t=1e8,Qt=new Int32Array([-1,1,-1,0,6,3,2,36,4,4,5,t+27,6,t+4,t+27,1,29,7,2,36,8,3,9,31,4,22,10,5,19,11,7,21,12,8,t+7,13,10,t+8,14,12,t+9,15,13,t+10,16,14,t+11,17,15,t+12,18,16,t+13,t+16,6,t+5,20,7,21,t+6,17,t+24,t+25,6,t+4,23,7,27,24,9,t+14,25,10,t+15,26,11,t+22,t+23,11,28,t+21,17,t+20,t+21,2,35,30,3,39,31,4,32,t+27,6,t+4,33,7,t+27,34,9,t+14,t+27,3,39,36,4,38,37,7,t+18,t+19,6,t+4,t+17,5,t+1,40,8,t+2,t+3]),Yt=pt.from(Qt,Xt,K.conditions,K.results),Jt=new dt({size:50,params:["Endpoint","IsControlPlane","IsOAuthEndpoint","Region","UseDualStack","UseFIPS"]}),Zt=(e,s={})=>Jt.get(e,()=>ht(Yt,{endpointParams:e,logger:s.logger}));gt.aws=De;class l extends Xe{constructor(e){super(e);Object.setPrototypeOf(this,l.prototype)}}class C extends l{name="AccessDeniedException";$fault="client";error;constructor(e){super({name:"AccessDeniedException",$fault:"client",...e});Object.setPrototypeOf(this,C.prototype),this.error=e.error}}class R extends l{name="InternalServerException";$fault="server";error;constructor(e){super({name:"InternalServerException",$fault:"server",...e});Object.setPrototypeOf(this,R.prototype),this.error=e.error}}class v extends l{name="TooManyRequestsError";$fault="client";error;constructor(e){super({name:"TooManyRequestsError",$fault:"client",...e});Object.setPrototypeOf(this,v.prototype),this.error=e.error}}class f extends l{name="ValidationException";$fault="client";error;constructor(e){super({name:"ValidationException",$fault:"client",...e});Object.setPrototypeOf(this,f.prototype),this.error=e.error}}var es="AccessDeniedException",ts="AccessToken",ss="CreateOAuth2Token",ns="CreateOAuth2TokenRequest",os="CreateOAuth2TokenRequestBody",rs="CreateOAuth2TokenResponseBody",is="CreateOAuth2TokenResponse",as="CreateOAuth2TokenWithIAM",cs="CreateOAuth2TokenWithIAMRequest",us="CreateOAuth2TokenWithIAMResponse",ps="InternalServerException",ds="OAuthAccessToken",hs="RefreshToken",gs="TooManyRequestsError",ls="ValidationException",X="accessKeyId",x="accessToken",Es="access_token",U="client",Q="clientId",Y="codeVerifier",ms="code",g="error",y="expiresIn",As="expires_in",D="grantType",_s="grant_type",ie="http",F="httpError",J="idToken",o="jsonName",P="message",Os="resource",I="refreshToken",Z="redirectUri",ae="smithy.ts.sdk.synthetic.com.amazonaws.signin",ee="secretAccessKey",te="sessionToken",Ss="server",Is="tokenInput",Cs="tokenOutput",N="tokenType",Rs="token_type",i="com.amazonaws.signin",ce=oe.for(ae),ue=[-3,ae,"SigninServiceException",0,[],[]];ce.registerError(ue,l);var _=oe.for(i),pe=[-3,i,es,{[g]:U},[g,P],[0,0],2];_.registerError(pe,C);var de=[-3,i,ps,{[g]:Ss,[F]:500},[g,P],[0,0],2];_.registerError(de,R);var he=[-3,i,gs,{[g]:U,[F]:429},[g,P],[0,0],2];_.registerError(he,v);var ge=[-3,i,ls,{[g]:U,[F]:400},[g,P],[0,0],2];_.registerError(ge,f);var le=[ce,_],vs=[0,i,ds,8,0],Ee=[0,i,hs,8,0],me=[3,i,ts,8,[X,ee,te],[[0,{[o]:X}],[0,{[o]:ee}],[0,{[o]:te}]],3],Ae=[3,i,ns,0,[Is],[[()=>_e,16]],1],_e=[3,i,os,0,[Q,D,ms,Z,Y,I],[[0,{[o]:Q}],[0,{[o]:D}],0,[0,{[o]:Z}],[0,{[o]:Y}],[()=>Ee,{[o]:I}]],2],Oe=[3,i,is,0,[Cs],[[()=>Se,16]],1],Se=[3,i,rs,0,[x,N,y,I,J],[[()=>me,{[o]:x}],[0,{[o]:N}],[1,{[o]:y}],[()=>Ee,{[o]:I}],[0,{[o]:J}]],4],Ie=[3,i,cs,0,[D,Os],[[0,{[o]:_s}],0],2],Ce=[3,i,us,0,[x,N,y],[[()=>vs,{[o]:Es}],[0,{[o]:Rs}],[1,{[o]:As}]],3],Re=[9,i,ss,{[ie]:["POST","/v1/token",200]},()=>Ae,()=>Oe],ve=[9,i,as,{[ie]:["POST","/v1/token?x-amz-client-auth-method=iam",200]},()=>Ie,()=>Ce],fs=(e)=>({apiVersion:"2023-01-01",base64Decoder:e?.base64Decoder??wt,base64Encoder:e?.base64Encoder??Nt,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??Zt,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??Lt,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(s)=>s.getIdentityProvider("aws.auth#sigv4"),signer:new kt},{schemeId:"smithy.api#noAuth",identityProvider:(s)=>s.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new Le}],logger:e?.logger??new Qe,protocol:e?.protocol??bt,protocolSettings:e?.protocolSettings??{defaultNamespace:"com.amazonaws.signin",errorTypeRegistries:le,version:"2023-01-01",serviceTarget:"Signin"},serviceId:e?.serviceId??"Signin",sha256:e?.sha256??qt,urlParser:e?.urlParser??mt,utf8Decoder:e?.utf8Decoder??Dt,utf8Encoder:e?.utf8Encoder??yt}),Ps=(e)=>{Ye(process.version);let s=ot(e),n=()=>s().then(Je),c=fs(e);Ne(process.version);let a={profile:e?.profile,logger:c.logger};return{...c,...e,runtime:"node",defaultsMode:s,authSchemePreference:e?.authSchemePreference??E(xt,a),bodyLengthChecker:e?.bodyLengthChecker??$t,defaultUserAgentProvider:e?.defaultUserAgentProvider??we({serviceId:c.serviceId,clientVersion:Kt.version}),maxAttempts:e?.maxAttempts??E(Rt,e),region:e?.region??E(at,{...ct,...a}),requestHandler:Ft.create(e?.requestHandler??n),retryMode:e?.retryMode??E({...Ct,default:async()=>(await n()).retryMode||It},e),streamCollector:e?.streamCollector??Ut,useDualstackEndpoint:e?.useDualstackEndpoint??E(it,a),useFipsEndpoint:e?.useFipsEndpoint??E(rt,a),userAgentAppId:e?.userAgentAppId??E($e,a)}},Ts=(e)=>{let{httpAuthSchemes:s,httpAuthSchemeProvider:n,credentials:c}=e;return{setHttpAuthScheme(a){let O=s.findIndex((T)=>T.schemeId===a.schemeId);if(O===-1)s.push(a);else s.splice(O,1,a)},httpAuthSchemes(){return s},setHttpAuthSchemeProvider(a){n=a},httpAuthSchemeProvider(){return n},setCredentials(a){c=a},credentials(){return c}}},ks=(e)=>({httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()}),xs=(e,s)=>{let n=Object.assign(Ue(e),Ze(e),At(e),Ts(e));return s.forEach((c)=>c.configure(n)),Object.assign(e,Fe(n),et(n),_t(n),ks(n))};class b extends ne{config;constructor(...[e]){let s=Ps(e||{});super(s);this.initConfig=s;let n=Bt(s),c=be(n),a=vt(c),O=ut(a),T=qe(O),Te=lt(T),ke=zt(Te),xe=xs(ke,e?.extensions||[]);this.config=xe,this.middlewareStack.use(Pt(this.config)),this.middlewareStack.use(Me(this.config)),this.middlewareStack.use(ft(this.config)),this.middlewareStack.use(St(this.config)),this.middlewareStack.use(He(this.config)),this.middlewareStack.use(Ve(this.config)),this.middlewareStack.use(We(this.config)),this.middlewareStack.use(ze(this.config,{httpAuthSchemeParametersProvider:Mt,identityProviderConfigProvider:async(ye)=>new Be({"aws.auth#sigv4":ye.credentials})})),this.middlewareStack.use(je(this.config))}destroy(){super.destroy()}}var fe=tt(jt,"Signin","SigninClient",Et),ys={IsControlPlane:{type:"staticContextParams",value:!1}},Ds={IsOAuthEndpoint:{type:"staticContextParams",value:!0}},Pe=(e,s,n,c)=>[];class q extends fe(ys,Pe,"CreateOAuth2Token",Re){}class M extends fe(Ds,Pe,"CreateOAuth2TokenWithIAM",ve){}var Ns={CreateOAuth2TokenCommand:q,CreateOAuth2TokenWithIAMCommand:M};class H extends b{}st(Ns,H);var ws={AUTHCODE_EXPIRED:"AUTHCODE_EXPIRED",CONFLICT:"CONFLICT",INSUFFICIENT_PERMISSIONS:"INSUFFICIENT_PERMISSIONS",INVALID_REQUEST:"INVALID_REQUEST",RESOURCE_NOT_FOUND:"RESOURCE_NOT_FOUND",SERVER_ERROR:"server_error",SERVICE_QUOTA_EXCEEDED:"SERVICE_QUOTA_EXCEEDED",TOKEN_EXPIRED:"TOKEN_EXPIRED",USER_CREDENTIALS_CHANGED:"USER_CREDENTIALS_CHANGED"};var Fs=C,bs=pe,qs=me,Ms=Re,Hs=q,Vs=Ae,Ws=_e,zs=Oe,Bs=Se,js=ve,Gs=M,Ks=Ie,Xs=Ce,Qs=R,Ys=de,Js=ws,Zs=H,en=b,tn=l,sn=ue,on=v,rn=he,an=f,cn=ge,un=le;export{$s as $Command,Us as __Client,Fs as AccessDeniedException,bs as AccessDeniedException$,qs as AccessToken$,Ms as CreateOAuth2Token$,Hs as CreateOAuth2TokenCommand,Vs as CreateOAuth2TokenRequest$,Ws as CreateOAuth2TokenRequestBody$,zs as CreateOAuth2TokenResponse$,Bs as CreateOAuth2TokenResponseBody$,js as CreateOAuth2TokenWithIAM$,Gs as CreateOAuth2TokenWithIAMCommand,Ks as CreateOAuth2TokenWithIAMRequest$,Xs as CreateOAuth2TokenWithIAMResponse$,Qs as InternalServerException,Ys as InternalServerException$,Js as OAuth2ErrorCode,Zs as Signin,en as SigninClient,tn as SigninServiceException,sn as SigninServiceException$,on as TooManyRequestsError,rn as TooManyRequestsError$,an as ValidationException,cn as ValidationException$,un as errorTypeRegistries};
@@ -1 +0,0 @@
1
- import{m,E,t,Z,ze,g,gt,Tt,Am}from"./chunk-p1d500sf.js";import"./chunk-7rycq6wb.js";import"./chunk-sdp9w627.js";import"./chunk-c8kjpmfe.js";import"./chunk-qt78vs3g.js";import"./chunk-cxet91kt.js";import"./chunk-xgnvktq6.js";import"./chunk-keetdtxb.js";import"./chunk-j9t7tvt5.js";import"./chunk-sbg86tch.js";import"./chunk-k7sjpke6.js";import"./chunk-fkn6f4qt.js";import"./chunk-6vkfzzvt.js";import"./chunk-5aqthcm6.js";import{Yn}from"./chunk-h3cwf9aw.js";import{tr}from"./chunk-qd7pvaxb.js";import"./chunk-ahgq10a7.js";import"./chunk-1vt9ss7d.js";import"./chunk-agcnbjxk.js";import"./chunk-zxqasmvz.js";import"./chunk-ts4d1mxf.js";import"./chunk-xsfy8hz3.js";import"./chunk-1eqw2dpx.js";import"./chunk-b7qs7hxg.js";import"./chunk-ht5rht98.js";E();function s(){let{projectId:o}=c.useParams(),{teamId:r,ensureTeamIdForProject:n}=gt();m(()=>{n(o)},[o,n]);let{data:d}=tr(Am(o)),e=d?.rootFolder,{data:a}=Z({queryKey:["folders",e],queryFn:()=>(async()=>await(await g.api.folders[":folderId"].$get({param:{folderId:e}})).json())(),enabled:!!e});if(!r||!e||!a)return t(Tt,{});return t(Yn,{teamId:r,projectId:o,projectName:d.name??"",assetId:"recently-deleted",rootFolderId:e})}var c=ze("/projects/$projectId/recently-deleted")({component:s});export{c as Route};
@@ -1 +0,0 @@
1
- import{t,ze}from"./chunk-p1d500sf.js";import"./chunk-sdp9w627.js";import"./chunk-c8kjpmfe.js";import"./chunk-qt78vs3g.js";import"./chunk-7rycq6wb.js";import"./chunk-cxet91kt.js";import"./chunk-sbg86tch.js";import"./chunk-k7sjpke6.js";import"./chunk-fkn6f4qt.js";import"./chunk-6vkfzzvt.js";import"./chunk-xgnvktq6.js";import"./chunk-f0b4a9y3.js";import"./chunk-5aqthcm6.js";import{Ti}from"./chunk-8r3k84dh.js";import"./chunk-ahgq10a7.js";import"./chunk-1vt9ss7d.js";import"./chunk-zxqasmvz.js";import"./chunk-ts4d1mxf.js";import"./chunk-xsfy8hz3.js";import"./chunk-1eqw2dpx.js";import"./chunk-b7qs7hxg.js";import"./chunk-ht5rht98.js";function r(){let{shareId:e}=a.useParams();return t(Ti,{shareId:e})}var a=ze("/share/$shareId/")({component:r});export{a as Route};
@@ -1,5 +0,0 @@
1
- import{m,_,u,E,t,o}from"./chunk-p1d500sf.js";E();var Mr=({onResize:n,className:i=""})=>{let[s,a]=u(!1),r=_(0);m(()=>{if(!s)return;let e=(c)=>{let v=c.clientX-r.current;r.current=c.clientX,n(v)},l=()=>{a(!1),document.body.style.cursor=""};return document.addEventListener("mousemove",e),document.addEventListener("mouseup",l),document.body.style.cursor="col-resize",()=>{document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",l),document.body.style.cursor=""}},[s,n]);let d=(e)=>{e.preventDefault(),e.stopPropagation(),a(!0),r.current=e.clientX},p=()=>t("div",{className:"absolute inset-y-0 -left-4 -right-4 z-20 cursor-col-resize touch-none"});return o("div",{className:`group relative z-20 flex h-full w-[2px] cursor-col-resize items-center justify-center bg-border transition-all hover:bg-transparent ${i}`,onMouseDown:d,children:[t(p,{}),t("div",{className:`absolute inset-y-0 w-[2px] transition-all duration-300 ease-out
2
- ${s?"bg-blue-600 shadow-[0_0_15px_rgba(37,99,235,0.6)] opacity-100":"bg-blue-400 opacity-0 group-hover:opacity-100 group-hover:shadow-[0_0_8px_rgba(96,165,250,0.5)]"}
3
- `}),t("div",{className:`absolute top-1/2 left-1/2 h-10 w-1.5 -translate-x-1/2 -translate-y-1/2 rounded-full bg-blue-600 transition-all duration-300 ease-out
4
- ${s?"opacity-100 scale-100 shadow-[0_0_10px_rgba(37,99,235,0.5)]":"opacity-0 scale-75 group-hover:opacity-100 group-hover:scale-100"}`})]})};
5
- export{Mr};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Ot}from"./chunk-k9q4nn8b.js";import{Ge}from"./chunk-6mrgtn78.js";import{H}from"./chunk-t6cn018t.js";var a=H(Ot()),t=H(Ge());import{readFileSync as p}from"fs";var c=(e)=>async(s)=>{e.logger?.debug("@aws-sdk/credential-provider-web-identity - fromWebToken");let{roleArn:o,roleSessionName:r,webIdentityToken:i,providerId:n,policyArns:m,policy:f,durationSeconds:g}=e,{roleAssumerWithWebIdentity:l}=e;if(!l){let{getDefaultRoleAssumerWithWebIdentity:E}=await import("./chunk-r9gp9yqw.js");l=E({...e.clientConfig,credentialProviderLogger:e.logger,parentClientConfig:{...s?.callerClientConfig,...e.parentClientConfig}},e.clientPlugins)}return l({RoleArn:o,RoleSessionName:r??`aws-sdk-js-session-${Date.now()}`,WebIdentityToken:i,ProviderId:n,PolicyArns:m,Policy:f,DurationSeconds:g})};var d="AWS_WEB_IDENTITY_TOKEN_FILE",_="AWS_ROLE_ARN",S="AWS_ROLE_SESSION_NAME",T=(e={})=>async(s)=>{e.logger?.debug("@aws-sdk/credential-provider-web-identity - fromTokenFile");let o=e?.webIdentityTokenFile??process.env[d],r=e?.roleArn??process.env[_],i=e?.roleSessionName??process.env[S];if(!o||!r)throw new t.CredentialsProviderError("Web identity configuration not specified",{logger:e.logger});let n=await c({...e,webIdentityToken:t.externalDataInterceptor?.getTokenRecord?.()[o]??p(o,{encoding:"ascii"}),roleArn:r,roleSessionName:i})(s);if(o===process.env[d])a.setCredentialFeature(n,"CREDENTIALS_ENV_VARS_STS_WEB_ID_TOKEN","h");return n};export{T as fromTokenFile};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{De,gr}from"./chunk-yncvy335.js";import{qn,rn,Nn}from"./chunk-bv589v2m.js";var n=class{get supportsCreateIfNotExists(){return!0}get supportsTransactionalDdl(){return!1}get supportsReturning(){return!0}async acquireMigrationLock(){}async releaseMigrationLock(){}get supportsOutput(){return!0}},s=class{#e;#t=new o;#r;#a;constructor(e){this.#e={...e}}async init(){if(this.#r=this.#e.database,this.#a=new i(this.#r),this.#e.onCreateConnection)await this.#e.onCreateConnection(this.#a)}async acquireConnection(){return await this.#t.lock(),this.#a}async beginTransaction(e){await e.executeQuery(gr.raw("begin"))}async commitTransaction(e){await e.executeQuery(gr.raw("commit"))}async rollbackTransaction(e){await e.executeQuery(gr.raw("rollback"))}async releaseConnection(){this.#t.unlock()}async destroy(){this.#r?.close()}},i=class{#e;constructor(e){this.#e=e}executeQuery(e){let{sql:r,parameters:a}=e,t=this.#e.prepare(r).all(...a);return Promise.resolve({rows:t})}async*streamQuery(){throw Error("Streaming query is not supported by SQLite driver.")}},o=class{#e;#t;async lock(){while(this.#e!==void 0)await this.#e;this.#e=new Promise((e)=>{this.#t=e})}unlock(){let e=this.#t;this.#e=void 0,this.#t=void 0,e?.()}},c=class{#e;constructor(e){this.#e=e}async getSchemas(){return[]}async getTables(e={withInternalKyselyTables:!1}){let r=this.#e.selectFrom("sqlite_schema").where("type","=","table").where("name","not like","sqlite_%").select("name").$castTo();if(!e.withInternalKyselyTables)r=r.where("name","!=",rn).where("name","!=",Nn);let a=await r.execute();return Promise.all(a.map(({name:t})=>this.#t(t)))}async getMetadata(e){return{tables:await this.getTables(e)}}async#t(e){let r=this.#e,a=(await r.selectFrom("sqlite_master").where("name","=",e).select("sql").$castTo().execute())[0]?.sql?.split(/[\(\),]/)?.find((t)=>t.toLowerCase().includes("autoincrement"))?.split(/\s+/)?.[0]?.replace(/["`]/g,"");return{name:e,columns:(await r.selectFrom(De`pragma_table_info(${e})`.as("table_info")).select(["name","type","notnull","dflt_value"]).execute()).map((t)=>({name:t.name,dataType:t.type,isNullable:!t.notnull,isAutoIncrementing:t.name===a,hasDefaultValue:t.dflt_value!=null})),isView:!0}}},l=class extends qn{getCurrentParameterPlaceholder(){return"?"}getLeftIdentifierWrapper(){return'"'}getRightIdentifierWrapper(){return'"'}getAutoIncrement(){return"autoincrement"}},m=class{#e;constructor(e){this.#e={...e}}createDriver(){return new s(this.#e)}createQueryCompiler(){return new l}createAdapter(){return new n}createIntrospector(e){return new c(e)}};export{m as NodeSqliteDialect};
@@ -1 +0,0 @@
1
- import{t,ze}from"./chunk-p1d500sf.js";import"./chunk-sdp9w627.js";import"./chunk-c8kjpmfe.js";import"./chunk-qt78vs3g.js";import"./chunk-7rycq6wb.js";import"./chunk-cxet91kt.js";import"./chunk-sbg86tch.js";import"./chunk-k7sjpke6.js";import"./chunk-fkn6f4qt.js";import"./chunk-6vkfzzvt.js";import"./chunk-xgnvktq6.js";import"./chunk-f0b4a9y3.js";import"./chunk-5aqthcm6.js";import{Ti}from"./chunk-8r3k84dh.js";import"./chunk-ahgq10a7.js";import"./chunk-1vt9ss7d.js";import"./chunk-zxqasmvz.js";import"./chunk-ts4d1mxf.js";import"./chunk-xsfy8hz3.js";import"./chunk-1eqw2dpx.js";import"./chunk-b7qs7hxg.js";import"./chunk-ht5rht98.js";function n(){let{shareId:r,fileId:a}=e.useParams(),{start:i,version:o,compare:c,cmpLeft:m,cmpRight:s,cmpActive:p}=e.useSearch();return t(Ti,{shareId:r,initialFileId:a,startTime:i,versionId:o,compare:c,compareLeftId:m,compareRightId:s,compareActiveSide:p})}var e=ze("/share/$shareId/files/$fileId")({component:n});export{e as Route};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Fc,Lc,$u}from"./chunk-c9xyejnk.js";export{Fc as ENV_KEY,Lc as ENV_SECRET,$u as fromEnv};
@@ -1,18 +0,0 @@
1
- // @bun
2
- import{w,V}from"./chunk-t6cn018t.js";var Ca=w(function(Eo){var ut;(function(e){e.HEADER="header",e.QUERY="query"})(ut||(ut={}));var lt;(function(e){e.HEADER="header",e.QUERY="query"})(lt||(lt={}));var dt;(function(e){e.HTTP="http",e.HTTPS="https"})(dt||(dt={}));var ue;(function(e){e.MD5="md5",e.CRC32="crc32",e.CRC32C="crc32c",e.SHA1="sha1",e.SHA256="sha256"})(ue||(ue={}));var mo=(e)=>{let t=[];if(e.sha256!==void 0)t.push({algorithmId:()=>ue.SHA256,checksumConstructor:()=>e.sha256});if(e.md5!=null)t.push({algorithmId:()=>ue.MD5,checksumConstructor:()=>e.md5});return{addChecksumAlgorithm(r){t.push(r)},checksumAlgorithms(){return t}}},go=(e)=>{let t={};return e.checksumAlgorithms().forEach((r)=>{t[r.algorithmId()]=r.checksumConstructor()}),t},yo=(e)=>mo(e),bo=(e)=>go(e),ht;(function(e){e[e.HEADER=0]="HEADER",e[e.TRAILER=1]="TRAILER"})(ht||(ht={}));var So="__smithy_context",pt;(function(e){e.PROFILE="profile",e.SSO_SESSION="sso-session",e.SERVICES="services"})(pt||(pt={}));var mt;(function(e){e.HTTP_0_9="http/0.9",e.HTTP_1_0="http/1.0",e.TDS_8_0="tds/8.0"})(mt||(mt={}));Eo.AlgorithmId=ue;Eo.EndpointURLScheme=dt;Eo.FieldPosition=ht;Eo.HttpApiKeyAuthLocation=lt;Eo.HttpAuthLocation=ut;Eo.IniSectionType=pt;Eo.RequestHandlerProtocol=mt;Eo.SMITHY_CONTEXT_KEY=So;Eo.getDefaultClientConfiguration=yo;Eo.resolveDefaultRuntimeConfig=bo});var wo=w(function(ko){var{SMITHY_CONTEXT_KEY:Er}=Ca(),$o=(e)=>e[Er]||(e[Er]={});function Tr(e,t){return Object.prototype.hasOwnProperty.call(e,t)}class Re{method;protocol;hostname;port;path;query;headers;username;password;fragment;body;constructor(e){this.method=e.method||"GET",this.hostname=e.hostname||"localhost",this.port=e.port,this.query=e.query||{},this.headers=e.headers||{},this.body=e.body,this.protocol=e.protocol?e.protocol.slice(-1)!==":"?`${e.protocol}:`:e.protocol:"https:",this.path=e.path?e.path.charAt(0)!=="/"?`/${e.path}`:e.path:"/",this.username=e.username,this.password=e.password,this.fragment=e.fragment}static clone(e){let t=new Re({...e,headers:{...e.headers}});if(t.query)t.query=Uo(t.query);return t}static isInstance(e){if(!e)return!1;let t=e;return"method"in t&&"protocol"in t&&"hostname"in t&&"path"in t&&typeof t.query==="object"&&typeof t.headers==="object"}clone(){return Re.clone(this)}}function Uo(e){return Object.keys(e).reduce((t,r)=>{let n=e[r];return{...t,[r]:Array.isArray(n)?[...n]:n}},{})}class Cr{statusCode;reason;headers;body;constructor(e){this.statusCode=e.statusCode,this.reason=e.reason,this.headers=e.headers||{},this.body=e.body}static isInstance(e){if(!e)return!1;let t=e;return typeof t.statusCode==="number"&&typeof t.headers==="object"}}var Lo=new RegExp("^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$"),Ir=(e,t=!1)=>{if(!t)return Lo.test(e);let r=e.split(".");for(let n of r)if(!Ir(n))return!1;return!0};function Do(e){return/^[a-z0-9][a-z0-9.-]*[a-z0-9]$/.test(e)}var Po=(e)=>{if(typeof e==="function")return e;let t=Promise.resolve(e);return()=>t};function Nr(e){let t={};if(e=e.replace(/^\?/,""),e)for(let r of e.split("&")){let[n,s=null]=r.split("=");if(n=decodeURIComponent(n),s)s=decodeURIComponent(s);if(!(n in t))t[n]=s;else if(Array.isArray(t[n]))t[n].push(s);else t[n]=[t[n],s]}return t}var Me=(e)=>{if(typeof e==="string")return Me(new URL(e));let{hostname:t,pathname:r,port:n,protocol:s,search:o}=e,i;if(o)i=Nr(o);return{hostname:t,port:n?parseInt(n):void 0,protocol:s,path:r,query:i}},Fo=(e)=>{if(typeof e==="object"){if("url"in e){let t=Me(e.url);if(e.headers){t.headers={};for(let r in e.headers){if(!Tr(e.headers,r))continue;t.headers[r.toLowerCase()]=e.headers[r].join(", ")}}return t}return e}return Me(e)};ko.HttpRequest=Re;ko.HttpResponse=Cr;ko.getSmithyContext=$o;ko.hasOwn=Tr;ko.isValidHostLabel=Ir;ko.isValidHostname=Do;ko.normalizeProvider=Po;ko.parseQueryString=Nr;ko.parseUrl=Me;ko.toEndpointV1=Fo});var wn=w(function(fi){var{getSmithyContext:Or,HttpResponse:Qo,toEndpointV1:Xo}=wo(),$e=(e)=>{if(typeof e==="function")return e();return e},bt=(e,t,r,n,s)=>({name:t,namespace:e,traits:r,input:n,output:s}),Zo=(e)=>(t,r)=>async(n)=>{let{response:s}=await t(n),{operationSchema:o}=Or(r),[,i,a,c,u,d]=o??[];try{let f=await e.protocol.deserializeResponse(bt(i,a,c,u,d),{...e,...r},s);return{response:s,output:f}}catch(f){if(Object.defineProperty(f,"$response",{value:s,enumerable:!1,writable:!1,configurable:!1}),!("$metadata"in f)){try{f.message+=`
3
- Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.`}catch(h){if(!r.logger||r.logger?.constructor?.name==="NoOpLogger")console.warn("Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.");else r.logger?.warn?.("Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.")}if(typeof f.$responseBodyText<"u"){if(f.$response)f.$response.body=f.$responseBodyText}try{if(Qo.isInstance(s)){let{headers:h={},statusCode:p}=s,g=Object.entries(h);f.$metadata={httpStatusCode:p,requestId:gt(/^x-[\w-]+-request-?id$/,g),extendedRequestId:gt(/^x-[\w-]+-id-2$/,g),cfId:gt(/^x-[\w-]+-cf-id$/,g)}}}catch(h){}}throw f}},gt=(e,t)=>(t.find(([r])=>r.match(e))||[void 0,void 0])[1],Yo=(e)=>(t,r)=>async(n)=>{let{operationSchema:s}=Or(r),[,o,i,a,c,u]=s??[],d=r.endpointV2?async()=>Xo(r.endpointV2):e.endpoint,f=await e.protocol.serializeRequest(bt(o,i,a,c,u),n.input,{...e,...r,endpoint:d});return t({...n,request:f})},Ar={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},_r={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};function ei(e){return{applyToStack:(t)=>{t.add(Yo(e),_r),t.add(Zo(e),Ar),e.protocol.setSerdeContext(e)}}}class I{name;namespace;traits;static assign(e,t){return Object.assign(e,t)}static[Symbol.hasInstance](e){let t=this.prototype.isPrototypeOf(e);if(!t&&typeof e==="object"&&e!==null)return e.symbol===this.symbol;return t}getName(){return this.namespace+"#"+this.name}}class Pe extends I{static symbol=Symbol.for("@smithy/lis");valueSchema;symbol=Pe.symbol}var ti=(e,t,r,n)=>I.assign(new Pe,{name:t,namespace:e,traits:r,valueSchema:n});class Fe extends I{static symbol=Symbol.for("@smithy/map");keySchema;valueSchema;symbol=Fe.symbol}var ri=(e,t,r,n,s)=>I.assign(new Fe,{name:t,namespace:e,traits:r,keySchema:n,valueSchema:s});class ke extends I{static symbol=Symbol.for("@smithy/ope");input;output;symbol=ke.symbol}var ni=(e,t,r,n,s)=>I.assign(new ke,{name:t,namespace:e,traits:r,input:n,output:s});class pe extends I{static symbol=Symbol.for("@smithy/str");memberNames;memberList;symbol=pe.symbol}var si=(e,t,r,n,s)=>I.assign(new pe,{name:t,namespace:e,traits:r,memberNames:n,memberList:s});class Be extends pe{static symbol=Symbol.for("@smithy/err");ctor;symbol=Be.symbol}var oi=(e,t,r,n,s,o)=>I.assign(new Be,{name:t,namespace:e,traits:r,memberNames:n,memberList:s,ctor:null}),Ue=[];function he(e){if(typeof e==="object")return e;if(e=e|0,Ue[e])return Ue[e];let t={},r=0;for(let n of["httpLabel","idempotent","idempotencyToken","sensitive","httpPayload","httpResponseCode","httpQueryParams"])if((e>>r++&1)===1)t[n]=1;return Ue[e]=t}var le={it:Symbol.for("@smithy/nor-struct-it"),ns:Symbol.for("@smithy/ns")},Le=[],De={};class U{ref;memberName;static symbol=Symbol.for("@smithy/nor");symbol=U.symbol;name;schema;_isMemberSchema;traits;memberTraits;normalizedTraits;constructor(e,t){this.ref=e,this.memberName=t;let r=[],n=e,s=e;this._isMemberSchema=!1;while(yt(n))r.push(n[1]),n=n[0],s=$e(n),this._isMemberSchema=!0;if(r.length>0){this.memberTraits={};for(let o=r.length-1;o>=0;--o){let i=r[o];Object.assign(this.memberTraits,he(i))}}else this.memberTraits=0;if(s instanceof U){let o=this.memberTraits;Object.assign(this,s),this.memberTraits=Object.assign({},o,s.getMemberTraits(),this.getMemberTraits()),this.normalizedTraits=void 0,this.memberName=t??s.memberName;return}if(this.schema=$e(s),vr(this.schema))this.name=`${this.schema[1]}#${this.schema[2]}`,this.traits=this.schema[3];else this.name=this.memberName??String(s),this.traits=0;if(this._isMemberSchema&&!t)throw Error(`@smithy/core/schema - NormalizedSchema member init ${this.getName(!0)} missing member name.`)}static[Symbol.hasInstance](e){let t=this.prototype.isPrototypeOf(e);if(!t&&typeof e==="object"&&e!==null)return e.symbol===this.symbol;return t}static of(e){let t=typeof e==="function"||typeof e==="object"&&e!==null;if(typeof e==="number"){if(Le[e])return Le[e]}else if(typeof e==="string"){if(De[e])return De[e]}else if(t){if(e[le.ns])return e[le.ns]}let r=$e(e);if(r instanceof U)return r;if(yt(r)){let[s,o]=r;if(s instanceof U)return Object.assign(s.getMergedTraits(),he(o)),s;throw Error(`@smithy/core/schema - may not init unwrapped member schema=${JSON.stringify(e,null,2)}.`)}let n=new U(r);if(t)return e[le.ns]=n;if(typeof r==="string")return De[r]=n;if(typeof r==="number")return Le[r]=n;return n}getSchema(){let e=this.schema;if(Array.isArray(e)&&e[0]===0)return e[4];return e}getName(e=!1){let{name:t}=this;return!e&&t&&t.includes("#")?t.split("#")[1]:t||void 0}getMemberName(){return this.memberName}isMemberSchema(){return this._isMemberSchema}isListSchema(){let e=this.getSchema();return typeof e==="number"?e>=64&&e<128:e[0]===1}isMapSchema(){let e=this.getSchema();return typeof e==="number"?e>=128&&e<=255:e[0]===2}isStructSchema(){let e=this.getSchema();if(typeof e!=="object")return!1;let t=e[0];return t===3||t===-3||t===4}isUnionSchema(){let e=this.getSchema();if(typeof e!=="object")return!1;return e[0]===4}isBlobSchema(){let e=this.getSchema();return e===21||e===42}isTimestampSchema(){let e=this.getSchema();return typeof e==="number"&&e>=4&&e<=7}isUnitSchema(){return this.getSchema()==="unit"}isDocumentSchema(){return this.getSchema()===15}isStringSchema(){return this.getSchema()===0}isBooleanSchema(){return this.getSchema()===2}isNumericSchema(){return this.getSchema()===1}isBigIntegerSchema(){return this.getSchema()===17}isBigDecimalSchema(){return this.getSchema()===19}isStreaming(){let{streaming:e}=this.getMergedTraits();return!!e||this.getSchema()===42}isIdempotencyToken(){return!!this.getMergedTraits().idempotencyToken}getMergedTraits(){return this.normalizedTraits??(this.normalizedTraits={...this.getOwnTraits(),...this.getMemberTraits()})}getMemberTraits(){return he(this.memberTraits)}getOwnTraits(){return he(this.traits)}getKeySchema(){let[e,t]=[this.isDocumentSchema(),this.isMapSchema()];if(!e&&!t)throw Error(`@smithy/core/schema - cannot get key for non-map: ${this.getName(!0)}`);let r=this.getSchema(),n=e?15:r[4]??0;return de([n,0],"key")}getValueSchema(){let e=this.getSchema(),[t,r,n]=[this.isDocumentSchema(),this.isMapSchema(),this.isListSchema()],s=typeof e==="number"?63&e:e&&typeof e==="object"&&(r||n)?e[3+e[0]]:t?15:void 0;if(s!=null)return de([s,0],r?"value":"member");throw Error(`@smithy/core/schema - ${this.getName(!0)} has no value member.`)}getMemberSchema(e){let t=this.getSchema();if(this.isStructSchema()&&t[4].includes(e)){let r=t[4].indexOf(e),n=t[5][r];return de(yt(n)?n:[n,0],e)}if(this.isDocumentSchema())return de([15,0],e);throw Error(`@smithy/core/schema - ${this.getName(!0)} has no member=${e}.`)}getMemberSchemas(){let e={};try{for(let[t,r]of this.structIterator())e[t]=r}catch(t){}return e}getEventStreamMember(){if(this.isStructSchema()){for(let[e,t]of this.structIterator())if(t.isStreaming()&&t.isStructSchema())return e}return""}*structIterator(){if(this.isUnitSchema())return;if(!this.isStructSchema())throw Error("@smithy/core/schema - cannot iterate non-struct schema.");let e=this.getSchema(),t=e[4].length,r=e[le.it];if(r&&t===r.length){yield*r;return}r=Array(t);for(let n=0;n<t;++n){let s=e[4][n],o=de([e[5][n],0],s);yield r[n]=[s,o]}e[le.it]=r}}function de(e,t){if(e instanceof U)return Object.assign(e,{memberName:t,_isMemberSchema:!0});return new U(e,t)}var yt=(e)=>Array.isArray(e)&&e.length===2,vr=(e)=>Array.isArray(e)&&e.length>=5;class me extends I{static symbol=Symbol.for("@smithy/sim");schemaRef;symbol=me.symbol}var ii=(e,t,r,n)=>I.assign(new me,{name:t,namespace:e,traits:n,schemaRef:r}),ai=(e,t,r,n)=>I.assign(new me,{name:t,namespace:e,traits:r,schemaRef:n}),ci={BLOB:21,STREAMING_BLOB:42,BOOLEAN:2,STRING:0,NUMERIC:1,BIG_INTEGER:17,BIG_DECIMAL:19,DOCUMENT:15,TIMESTAMP_DEFAULT:4,TIMESTAMP_DATE_TIME:5,TIMESTAMP_HTTP_DATE:6,TIMESTAMP_EPOCH_SECONDS:7,LIST_MODIFIER:64,MAP_MODIFIER:128};class M{namespace;schemas;exceptions;static registries=new Map;constructor(e,t=new Map,r=new Map){this.namespace=e,this.schemas=t,this.exceptions=r}static for(e){if(!M.registries.has(e))M.registries.set(e,new M(e));return M.registries.get(e)}copyFrom(e){let{schemas:t,exceptions:r}=this;for(let[n,s]of e.schemas)if(!t.has(n))t.set(n,s);for(let[n,s]of e.exceptions)if(!r.has(n))r.set(n,s)}register(e,t){let r=this.normalizeShapeId(e);for(let n of[this,M.for(r.split("#")[0])])n.schemas.set(r,t)}getSchema(e){let t=this.normalizeShapeId(e);if(!this.schemas.has(t)){if(!e.includes("#")){let r="#"+e,n=[];for(let[s,o]of this.schemas.entries())if(s.endsWith(r))n.push(o);if(n.length===1)return n[0]}throw Error(`@smithy/core/schema - schema not found for ${t}`)}return this.schemas.get(t)}registerError(e,t){let r=e,n=r[1];for(let s of[this,M.for(n)])s.schemas.set(n+"#"+r[2],r),s.exceptions.set(r,t)}getErrorCtor(e){let t=e;if(this.exceptions.has(t))return this.exceptions.get(t);return M.for(t[1]).exceptions.get(t)}getBaseException(){for(let e of this.exceptions.keys())if(Array.isArray(e)){let[,t,r]=e,n=t+"#"+r;if(n.startsWith("smithy.ts.sdk.synthetic.")&&n.endsWith("ServiceException"))return e}return}find(e){for(let t of this.schemas.values())if(e(t))return t;return}clear(){this.schemas.clear(),this.exceptions.clear()}normalizeShapeId(e){if(e.includes("#"))return e;return this.namespace+"#"+e}}fi.ErrorSchema=Be;fi.ListSchema=Pe;fi.MapSchema=Fe;fi.NormalizedSchema=U;fi.OperationSchema=ke;fi.SCHEMA=ci;fi.Schema=I;fi.SimpleSchema=me;fi.StructureSchema=pe;fi.TypeRegistry=M;fi.deref=$e;fi.deserializerMiddlewareOption=Ar;fi.error=oi;fi.getSchemaSerdePlugin=ei;fi.isStaticSchema=vr;fi.list=ti;fi.map=ri;fi.op=ni;fi.operation=bt;fi.serializerMiddlewareOption=_r;fi.sim=ii;fi.simAdapter=ai;fi.simpleSchemaCacheN=Le;fi.simpleSchemaCacheS=De;fi.struct=si;fi.traitsCache=Ue;fi.translateTraits=he});var sr=w(function(ga){var{hasOwn:be}=wo(),{getSmithyContext:Pi,normalizeProvider:Fi}=wo();ga.getSmithyContext=Pi;ga.normalizeProvider=Fi;var{SMITHY_CONTEXT_KEY:ki,AlgorithmId:ge}=Ca();ga.AlgorithmId=ge;var{NormalizedSchema:Bi}=wn(),j=(e,t)=>{let r=[];if(e)r.push(e);if(t)for(let n of t)r.push(n);return r},k=(e,t)=>`${e||"anonymous"}${t&&t.length>0?` (a.k.a. ${t.join(",")})`:""}`,ye=()=>{let e=[],t=[],r=!1,n=new Set,s=(f)=>f.sort((l,h)=>Rr[h.step]-Rr[l.step]||Mr[h.priority||"normal"]-Mr[l.priority||"normal"]),o=(f)=>{let l=!1,h=(p)=>{let g=j(p.name,p.aliases);if(g.includes(f)){l=!0;for(let m of g)n.delete(m);return!1}return!0};return e=e.filter(h),t=t.filter(h),l},i=(f)=>{let l=!1,h=(p)=>{if(p.middleware===f){l=!0;for(let g of j(p.name,p.aliases))n.delete(g);return!1}return!0};return e=e.filter(h),t=t.filter(h),l},a=(f)=>(e.forEach((l)=>{f.add(l.middleware,{...l})}),t.forEach((l)=>{f.addRelativeTo(l.middleware,{...l})}),f.identifyOnResolve?.(d.identifyOnResolve()),f),c=(f)=>{let l=[];return f.before.forEach((h)=>{if(h.before.length===0&&h.after.length===0)l.push(h);else l.push(...c(h))}),l.push(f),f.after.reverse().forEach((h)=>{if(h.before.length===0&&h.after.length===0)l.push(h);else l.push(...c(h))}),l},u=(f=!1)=>{let l=[],h=[],p={};return e.forEach((m)=>{let y={...m,before:[],after:[]};for(let b of j(y.name,y.aliases))p[b]=y;l.push(y)}),t.forEach((m)=>{let y={...m,before:[],after:[]};for(let b of j(y.name,y.aliases))p[b]=y;h.push(y)}),h.forEach((m)=>{if(m.toMiddleware){let y=p[m.toMiddleware];if(y===void 0){if(f)return;throw Error(`${m.toMiddleware} is not found when adding ${k(m.name,m.aliases)} middleware ${m.relation} ${m.toMiddleware}`)}if(m.relation==="after")y.after.push(m);if(m.relation==="before")y.before.push(m)}}),s(l).map(c).reduce((m,y)=>(m.push(...y),m),[])},d={add:(f,l={})=>{let{name:h,override:p,aliases:g}=l,m={step:"initialize",priority:"normal",middleware:f,...l},y=j(h,g);if(y.length>0){if(y.some((b)=>n.has(b))){if(!p)throw Error(`Duplicate middleware name '${k(h,g)}'`);for(let b of y){let S=e.findIndex((F)=>F.name===b||F.aliases?.some((N)=>N===b));if(S===-1)continue;let x=e[S];if(x.step!==m.step||m.priority!==x.priority)throw Error(`"${k(x.name,x.aliases)}" middleware with ${x.priority} priority in ${x.step} step cannot be overridden by "${k(h,g)}" middleware with ${m.priority} priority in ${m.step} step.`);e.splice(S,1)}}for(let b of y)n.add(b)}e.push(m)},addRelativeTo:(f,l)=>{let{name:h,override:p,aliases:g}=l,m={middleware:f,...l},y=j(h,g);if(y.length>0){if(y.some((b)=>n.has(b))){if(!p)throw Error(`Duplicate middleware name '${k(h,g)}'`);for(let b of y){let S=t.findIndex((F)=>F.name===b||F.aliases?.some((N)=>N===b));if(S===-1)continue;let x=t[S];if(x.toMiddleware!==m.toMiddleware||x.relation!==m.relation)throw Error(`"${k(x.name,x.aliases)}" middleware ${x.relation} "${x.toMiddleware}" middleware cannot be overridden by "${k(h,g)}" middleware ${m.relation} "${m.toMiddleware}" middleware.`);t.splice(S,1)}}for(let b of y)n.add(b)}t.push(m)},clone:()=>a(ye()),use:(f)=>{f.applyToStack(d)},remove:(f)=>{if(typeof f==="string")return o(f);else return i(f)},removeByTag:(f)=>{let l=!1,h=(p)=>{let{tags:g,name:m,aliases:y}=p;if(g&&g.includes(f)){let b=j(m,y);for(let S of b)n.delete(S);return l=!0,!1}return!0};return e=e.filter(h),t=t.filter(h),l},concat:(f)=>{let l=a(ye());return l.use(f),l.identifyOnResolve(r||l.identifyOnResolve()||(f.identifyOnResolve?.()??!1)),l},applyToStack:a,identify:()=>u(!0).map((f)=>{let l=f.step??f.relation+" "+f.toMiddleware;return k(f.name,f.aliases)+" - "+l}),identifyOnResolve(f){if(typeof f==="boolean")r=f;return r},resolve:(f,l)=>{for(let h of u().map((p)=>p.middleware).reverse())f=h(f,l);if(r)console.log(d.identify());return f}};return d},Rr={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},Mr={high:3,normal:2,low:1},zi=(e)=>()=>{throw Error(e)},Hi=(e)=>()=>Promise.reject(e),ze=()=>{let e=new WeakSet;return(t,r)=>{if(typeof r==="object"&&r!==null){if(e.has(r))return"[Circular]";e.add(r)}return r}},Vi=(e)=>new Promise((t)=>setTimeout(t,e*1000)),Lr={minDelay:2,maxDelay:120},A;(function(e){e.ABORTED="ABORTED",e.FAILURE="FAILURE",e.SUCCESS="SUCCESS",e.RETRY="RETRY",e.TIMEOUT="TIMEOUT"})(A||(A={}));var qi=(e)=>{if(e.state===A.ABORTED){let t=Error(`${JSON.stringify({...e,reason:"Request was aborted"},ze())}`);throw t.name="AbortError",t}else if(e.state===A.TIMEOUT){let t=Error(`${JSON.stringify({...e,reason:"Waiter has timed out"},ze())}`);throw t.name="TimeoutError",t}else if(e.state!==A.SUCCESS)throw Error(`${JSON.stringify(e,ze())}`);return e},ji=async({minDelay:e,maxDelay:t,maxWaitTime:r,abortController:n,client:s,abortSignal:o},i,a)=>{let c={},[u,d]=[e*1000,t*1000],f=0,l=Date.now()+r*1000,h=Date.now()+60000,p=!1;while(!0){if(f>0){let y=Ji(u,d,f,l);if(n?.signal?.aborted||o?.aborted)return c["AbortController signal aborted."]|=0,c["AbortController signal aborted."]+=1,{state:A.ABORTED,observedResponses:c};if(Date.now()+y>l)return{state:A.TIMEOUT,observedResponses:c};await Vi(y/1000)}let{state:g,reason:m}=await a(s,i);if(m){let y=Gi(m);c[y]|=0,c[y]+=1}if(g!==A.RETRY)return{state:g,reason:m,final:m,observedResponses:c};if(f+=1,!p&&Date.now()>=h)Wi(c,s),p=!0}},Wi=(e={},t)=>{let r=Object.keys(e),n=0;for(let i of r){let a=e[i]|0;if(i.startsWith("403:"))n+=a}let s=t?.config?.logger,o=typeof s?.warn==="function"&&!s.constructor?.name?.includes?.("NoOpLogger")?s:console;if(n>=3||r[r.length-1]?.startsWith("403:"))o.warn("@smithy/util-waiter WARN - 403 status code encountered during waiter polling.")},Gi=(e)=>{let t=e?.$response?.statusCode??e?.$metadata?.httpStatusCode;if(e?.$responseBodyText)return`${t?t+": ":""}Deserialization error for body: ${e.$responseBodyText}`;if(t){if(e?.$response||e?.message)return`${t??"Unknown"}: ${e?.message}`;return`${t}: OK`}return String(e?.message??JSON.stringify(e,ze())??"Unknown")},Ji=(e,t,r,n)=>{let s=Math.log(t/e)/Math.log(2)+1;if(r>s)return t;let o=e*2**(r-1),i=Math.min(o,t),a=Ki(e,i);if(Date.now()+a>n){let c=n-Date.now();return Math.max(0,c-500)}return a},Ki=(e,t)=>e+Math.random()*(t-e),Qi=(e)=>{if(e.maxWaitTime<=0)throw Error("WaiterConfiguration.maxWaitTime must be greater than 0");else if(e.minDelay<=0)throw Error("WaiterConfiguration.minDelay must be greater than 0");else if(e.maxDelay<=0)throw Error("WaiterConfiguration.maxDelay must be greater than 0");else if(e.maxWaitTime<=e.minDelay)throw Error(`WaiterConfiguration.maxWaitTime [${e.maxWaitTime}] must be greater than WaiterConfiguration.minDelay [${e.minDelay}] for this waiter`);else if(e.maxDelay<e.minDelay)throw Error(`WaiterConfiguration.maxDelay [${e.maxDelay}] must be greater than WaiterConfiguration.minDelay [${e.minDelay}] for this waiter`)},$r=(e)=>{let t,r=new Promise((n)=>{if(t=()=>n({state:A.ABORTED}),typeof e.addEventListener==="function")e.addEventListener("abort",t);else e.onabort=t});return{clearListener(){if(typeof e.removeEventListener==="function")e.removeEventListener("abort",t)},aborted:r}},Xi=async(e,t,r)=>{let n={...Lr,...e};Qi(n);let s=[ji(n,t,r)],o=[];if(e.abortSignal){let{aborted:i,clearListener:a}=$r(e.abortSignal);o.push(a),s.push(i)}if(e.abortController?.signal){let{aborted:i,clearListener:a}=$r(e.abortController.signal);o.push(a),s.push(i)}return Promise.race(s).then((i)=>{for(let a of o)a();return i})};class Dr{config;middlewareStack=ye();initConfig;handlers;constructor(e){this.config=e;let{protocol:t,protocolSettings:r}=e;if(r){if(typeof t==="function")e.protocol=new t(r)}}send(e,t,r){let n=typeof t!=="function"?t:void 0,s=typeof t==="function"?t:r,o=n===void 0&&this.config.cacheMiddleware===!0,i;if(o){if(!this.handlers)this.handlers=new WeakMap;let a=this.handlers;if(a.has(e.constructor))i=a.get(e.constructor);else i=e.resolveMiddleware(this.middlewareStack,this.config,n),a.set(e.constructor,i)}else delete this.handlers,i=e.resolveMiddleware(this.middlewareStack,this.config,n);if(s)i(e).then((a)=>s(null,a.output),(a)=>s(a)).catch(()=>{});else return i(e).then((a)=>a.output)}destroy(){this.config?.requestHandler?.destroy?.(),delete this.handlers}}var wt="***SensitiveInformation***";function He(e,t){if(t==null)return t;let r=Bi.of(e);if(r.getMergedTraits().sensitive)return wt;if(r.isListSchema()){if(!!r.getValueSchema().getMergedTraits().sensitive)return wt}else if(r.isMapSchema()){if(!!r.getKeySchema().getMergedTraits().sensitive||!!r.getValueSchema().getMergedTraits().sensitive)return wt}else if(r.isStructSchema()&&typeof t==="object"){let n=t,s={};for(let[o,i]of r.structIterator())if(n[o]!=null)s[o]=He(i,n[o]);return s}return t}class Ve{middlewareStack=ye();schema;static classBuilder(){return new Pr}resolveMiddlewareWithContext(e,t,r,{middlewareFn:n,clientName:s,commandName:o,inputFilterSensitiveLog:i,outputFilterSensitiveLog:a,smithyContext:c,additionalContext:u,CommandCtor:d}){for(let m of n.bind(this)(d,e,t,r))this.middlewareStack.use(m);let f=e.concat(this.middlewareStack),{logger:l}=t,h={logger:l,clientName:s,commandName:o,inputFilterSensitiveLog:i,outputFilterSensitiveLog:a,[ki]:{commandInstance:this,...c},...u},{requestHandler:p}=t,g=r??{};if(c.eventStream)g={isEventStream:!0,...g};return f.resolve((m)=>p.handle(m.request,g),h)}}class Pr{_init=()=>{};_ep={};_middlewareFn=()=>[];_commandName="";_clientName="";_additionalContext={};_smithyContext={};_inputFilterSensitiveLog=void 0;_outputFilterSensitiveLog=void 0;_serializer=null;_deserializer=null;_operationSchema;init(e){this._init=e}ep(e){return this._ep=e,this}m(e){return this._middlewareFn=e,this}s(e,t,r={}){return this._smithyContext={service:e,operation:t,...r},this}c(e={}){return this._additionalContext=e,this}n(e,t){return this._clientName=e,this._commandName=t,this}f(e=(r)=>r,t=(r)=>r){return this._inputFilterSensitiveLog=e,this._outputFilterSensitiveLog=t,this}ser(e){return this._serializer=e,this}de(e){return this._deserializer=e,this}sc(e){return this._operationSchema=e,this._smithyContext.operationSchema=e,this}build(){let e=this,t;return t=class extends Ve{input;static getEndpointParameterInstructions(){return e._ep}constructor(...[r]){super();this.input=r??{},e._init(this),this.schema=e._operationSchema}resolveMiddleware(r,n,s){let o=e._operationSchema,i=o?.[4]??o?.input,a=o?.[5]??o?.output;return this.resolveMiddlewareWithContext(r,n,s,{CommandCtor:t,middlewareFn:e._middlewareFn,clientName:e._clientName,commandName:e._commandName,inputFilterSensitiveLog:e._inputFilterSensitiveLog??(o?He.bind(null,i):(c)=>c),outputFilterSensitiveLog:e._outputFilterSensitiveLog??(o?He.bind(null,a):(c)=>c),smithyContext:e._smithyContext,additionalContext:e._additionalContext})}serialize=e._serializer;deserialize=e._deserializer}}}var Zi="***SensitiveInformation***",Yi=(e,t,r)=>{for(let[o,i]of Object.entries(e)){let a=async function(u,d,f){let l=new i(u);if(typeof d==="function")this.send(l,d);else if(typeof f==="function"){if(typeof d!=="object")throw Error(`Expected http options but got ${typeof d}`);this.send(l,d||{},f)}else return this.send(l,d)},c=(o[0].toLowerCase()+o.slice(1)).replace(/Command$/,"");t.prototype[c]=a}let{paginators:n={},waiters:s={}}=r??{};for(let[o,i]of Object.entries(n))if(t.prototype[o]===void 0)t.prototype[o]=function(a={},c,...u){return i({...c,client:this},a,...u)};for(let[o,i]of Object.entries(s))if(t.prototype[o]===void 0)t.prototype[o]=async function(a={},c,...u){let d=c;if(typeof c==="number")d={maxWaitTime:c};return i({...d,client:this},a,...u)}};class X extends Error{$fault;$response;$retryable;$metadata;constructor(e){super(e.message);Object.setPrototypeOf(this,Object.getPrototypeOf(this).constructor.prototype),this.name=e.name,this.$fault=e.$fault,this.$metadata=e.$metadata}static isInstance(e){if(!e)return!1;let t=e;return X.prototype.isPrototypeOf(t)||Boolean(t.$fault)&&Boolean(t.$metadata)&&(t.$fault==="client"||t.$fault==="server")}static[Symbol.hasInstance](e){if(!e)return!1;let t=e;if(this===X)return X.isInstance(e);if(X.isInstance(e)){if(t.name&&this.name)return this.prototype.isPrototypeOf(e)||t.name===this.name;return this.prototype.isPrototypeOf(e)}return!1}}var Fr=(e,t={})=>{Object.entries(t).filter(([,n])=>n!==void 0).forEach(([n,s])=>{if(e[n]==null||e[n]==="")e[n]=s});let r=e.message||e.Message||"UnknownError";return e.message=r,delete e.Message,e},kr=({output:e,parsedBody:t,exceptionCtor:r,errorCode:n})=>{let s=ta(e),o=s.httpStatusCode?s.httpStatusCode+"":void 0,i=new r({name:t?.code||t?.Code||n||o||"UnknownError",$fault:"client",$metadata:s});throw Fr(i,t)},ea=(e)=>({output:t,parsedBody:r,errorCode:n})=>{kr({output:t,parsedBody:r,exceptionCtor:e,errorCode:n})},ta=(e)=>({httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}),ra=(e)=>{switch(e){case"standard":return{retryMode:"standard",connectionTimeout:3100};case"in-region":return{retryMode:"standard",connectionTimeout:1100};case"cross-region":return{retryMode:"standard",connectionTimeout:3100};case"mobile":return{retryMode:"standard",connectionTimeout:30000};default:return{}}},Ur=!1,na=(e)=>{if(e&&!Ur&&parseInt(e.substring(1,e.indexOf(".")))<16)Ur=!0},Br=Object.values(ge),zr=(e)=>{let t=[];for(let r in ge){if(!be(ge,r))continue;let n=ge[r];if(e[n]===void 0)continue;t.push({algorithmId:()=>n,checksumConstructor:()=>e[n]})}for(let[r,n]of Object.entries(e.checksumAlgorithms??{}))t.push({algorithmId:()=>r,checksumConstructor:()=>n});return{addChecksumAlgorithm(r){e.checksumAlgorithms=e.checksumAlgorithms??{};let n=r.algorithmId(),s=r.checksumConstructor();if(Br.includes(n))e.checksumAlgorithms[n.toUpperCase()]=s;else e.checksumAlgorithms[n]=s;t.push(r)},checksumAlgorithms(){return t}}},Hr=(e)=>{let t={};return e.checksumAlgorithms().forEach((r)=>{let n=r.algorithmId();if(Br.includes(n))t[n]=r.checksumConstructor()}),t},Vr=(e)=>({setRetryStrategy(t){e.retryStrategy=t},retryStrategy(){return e.retryStrategy}}),qr=(e)=>{let t={};return t.retryStrategy=e.retryStrategy(),t},jr=(e)=>Object.assign(zr(e),Vr(e)),sa=jr,oa=(e)=>Object.assign(Hr(e),qr(e)),ia=(e)=>Array.isArray(e)?e:[e],Wr=(e)=>{for(let r in e){if(!be(e,r))continue;if(e[r]["#text"]!==void 0)e[r]=e[r]["#text"];else if(typeof e[r]==="object"&&e[r]!==null)e[r]=Wr(e[r])}return e},aa=(e)=>e!=null;class Gr{trace(){}debug(){}info(){}warn(){}error(){}}function Jr(e,t,r){let n,s,o;if(typeof t>"u"&&typeof r>"u")n={},o=e;else if(n=e,typeof t==="function")return s=t,o=r,ua(n,s,o);else o=t;for(let i in o){if(!be(o,i))continue;if(!Array.isArray(o[i])){n[i]=o[i];continue}Kr(n,null,o,i)}return n}var ca=(e)=>{let t={};for(let[r,n]of Object.entries(e||{}))t[r]=[,n];return t},fa=(e,t)=>{let r={};for(let n in t){if(!be(t,n))continue;Kr(r,e,t,n)}return r},ua=(e,t,r)=>Jr(e,Object.entries(r).reduce((n,[s,o])=>{if(Array.isArray(o))n[s]=o;else if(typeof o==="function")n[s]=[t,o()];else n[s]=[t,o];return n},{})),Kr=(e,t,r,n)=>{if(t!==null){let i=r[n];if(typeof i==="function")i=[,i];let[a=la,c=da,u=n]=i;if(typeof a==="function"&&a(t[u])||typeof a!=="function"&&!!a)e[n]=c(t[u]);return}let[s,o]=r[n];if(typeof o==="function"){let i,a=s===void 0&&(i=o())!=null,c=typeof s==="function"&&!!s(void 0)||typeof s!=="function"&&!!s;if(a)e[n]=i;else if(c)e[n]=o()}else{let i=s===void 0&&o!=null,a=typeof s==="function"&&!!s(o)||typeof s!=="function"&&!!s;if(i||a)e[n]=o}},la=(e)=>e!=null,da=(e)=>e,ha=(e)=>{if(e!==e)return"NaN";switch(e){case 1/0:return"Infinity";case-1/0:return"-Infinity";default:return e}},pa=(e)=>e.toISOString().replace(".000Z","Z"),St=(e)=>{if(e==null)return{};if(Array.isArray(e))return e.filter((t)=>t!=null).map(St);if(typeof e==="object"){let t={};for(let r in e){if(!be(e,r))continue;if(e[r]==null)continue;t[r]=St(e[r])}return t}return e};function ma(e,t,r,n){return function(o,i,a,c,u={}){let d=Object.assign({},e,o);return Ve.classBuilder().ep(d).m(function(f,l,h,p){let g=i.call(this,f,l,h,p);return g.unshift(n(h,f.getEndpointParameterInstructions())),g}).s(t,a,u).n(r,a.charAt(0).toUpperCase()+a.slice(1)+"Command").sc(c).build()}}ga.Client=Dr;ga.Command=Ve;ga.NoOpLogger=Gr;ga.SENSITIVE_STRING=Zi;ga.ServiceException=X;ga.WaiterState=A;ga._json=St;ga.checkExceptions=qi;ga.constructStack=ye;ga.convertMap=ca;ga.createAggregatedClient=Yi;ga.createWaiter=Xi;ga.decorateServiceException=Fr;ga.emitWarningIfUnsupportedVersion=na;ga.getArrayIfSingleItem=ia;ga.getChecksumConfiguration=zr;ga.getDefaultClientConfiguration=sa;ga.getDefaultExtensionConfiguration=jr;ga.getRetryConfiguration=Vr;ga.getValueFromTextNode=Wr;ga.invalidFunction=zi;ga.invalidProvider=Hi;ga.isSerializableHeaderValue=aa;ga.loadConfigsForDefaultMode=ra;ga.makeBuilder=ma;ga.map=Jr;ga.resolveChecksumRuntimeConfig=Hr;ga.resolveDefaultRuntimeConfig=oa;ga.resolveRetryRuntimeConfig=qr;ga.schemaLogFilter=He;ga.serializeDateTime=pa;ga.serializeFloat=ha;ga.take=fa;ga.throwDefaultError=kr;ga.waiterServiceDefaults=Lr;ga.withBaseException=ea});var Ge=w(function(sf){var{homedir:nc}=V("os"),{sep:sc,join:we}=V("path"),{createHash:oc}=V("crypto"),{readFile:on}=V("fs/promises"),{IniSectionType:qe}=Ca(),{normalizeProvider:je}=sr(),{isValidHostLabel:ic}=wo();class Z extends Error{name="ProviderError";tryNextLink;constructor(e,t=!0){let r,n=!0;if(typeof t==="boolean")r=void 0,n=t;else if(t!=null&&typeof t==="object")r=t.logger,n=t.tryNextLink??!0;super(e);this.tryNextLink=n,Object.setPrototypeOf(this,Z.prototype),r?.debug?.(`@smithy/property-provider ${n?"->":"(!)"} ${e}`)}static from(e,t=!0){return Object.assign(new this(e.message,t),e)}}class Se extends Z{name="CredentialsProviderError";constructor(e,t=!0){super(e,t);Object.setPrototypeOf(this,Se.prototype)}}class It extends Z{name="TokenProviderError";constructor(e,t=!0){super(e,t);Object.setPrototypeOf(this,It.prototype)}}var an=(...e)=>async()=>{if(e.length===0)throw new Z("No providers in chain");let t;for(let r of e)try{return await r()}catch(n){if(t=n,n?.tryNextLink)continue;throw n}throw t},cn=(e)=>()=>Promise.resolve(e),Nt=(e,t,r)=>{let n,s,o,i=!1,a=async()=>{if(!s)s=e();try{n=await s,o=!0,i=!1}finally{s=void 0}return n};if(t===void 0)return async(c)=>{if(!o||c?.forceRefresh)n=await a();return n};return async(c)=>{if(!o||c?.forceRefresh)n=await a();if(i)return n;if(r&&!r(n))return i=!0,n;if(t(n))return await a(),n;return n}},L=(e,t,r)=>{if(!(t in e))return;if(e[t]==="true")return!0;if(e[t]==="false")return!1;throw Error(`Cannot load ${r} "${t}". Expected "true" or "false", got ${e[t]}.`)},ac=(e,t,r)=>{if(!(t in e))return;let n=parseInt(e[t],10);if(Number.isNaN(n))throw TypeError(`Cannot load ${r} '${t}'. Expected number, got '${e[t]}'.`);return n},O;(function(e){e.ENV="env",e.CONFIG="shared config entry"})(O||(O={}));var xt={},cc=()=>{if(process&&process.geteuid)return`${process.geteuid()}`;return"DEFAULT"},xe=()=>{let{HOME:e,USERPROFILE:t,HOMEPATH:r,HOMEDRIVE:n=`C:${sc}`}=process.env;if(e)return e;if(t)return t;if(r)return`${n}${r}`;let s=cc();if(!xt[s])xt[s]=nc();return xt[s]},fn="AWS_PROFILE",un="default",ln=(e)=>e.profile||process.env[fn]||un,dn=(e)=>{let r=oc("sha1").update(e).digest("hex");return we(xe(),".aws","sso","cache",`${r}.json`)},We={},fc=async(e)=>{if(We[e])return We[e];let t=dn(e),r=await on(t,"utf8");return JSON.parse(r)},W=".",uc=(e)=>Object.entries(e).filter(([t])=>{let r=t.indexOf(W);if(r===-1)return!1;return Object.values(qe).includes(t.substring(0,r))}).reduce((t,[r,n])=>{let s=r.indexOf(W),o=r.substring(0,s)===qe.PROFILE?r.substring(s+1):r;return t[o]=n,t},{...e.default&&{default:e.default}}),lc="AWS_CONFIG_FILE",hn=()=>process.env[lc]||we(xe(),".aws","config"),dc="AWS_SHARED_CREDENTIALS_FILE",hc=()=>process.env[dc]||we(xe(),".aws","credentials"),pc=/^([\w-]+)\s(["'])?([\w-@+.%:/]+)\2$/,mc=["__proto__","profile __proto__"],Tt=(e)=>{let t={},r,n;for(let s of e.split(/\r?\n/)){let o=s.split(/(^|\s)[;#]/)[0].trim();if(o[0]==="["&&o[o.length-1]==="]"){r=void 0,n=void 0;let a=o.substring(1,o.length-1),c=pc.exec(a);if(c){let[,u,,d]=c;if(Object.values(qe).includes(u))r=[u,d].join(W)}else r=a;if(mc.includes(a))throw Error(`Found invalid profile name "${a}"`)}else if(r){let a=o.indexOf("=");if(![0,-1].includes(a)){let[c,u]=[o.substring(0,a).trim(),o.substring(a+1).trim()];if(u==="")n=c;else{if(n&&s.trimStart()===s)n=void 0;t[r]=t[r]||{};let d=n?[n,c].join(W):c;t[r][d]=u}}}}return t},Et={},Je={},Ke=(e,t)=>{if(Je[e]!==void 0)return Je[e];if(!Et[e]||t?.ignoreCache)Et[e]=on(e,"utf8");return Et[e]},Qr=()=>({}),Ot=async(e={})=>{let{filepath:t=hc(),configFilepath:r=hn()}=e,n=xe(),s="~/",o=t;if(t.startsWith("~/"))o=we(n,t.slice(2));let i=r;if(r.startsWith("~/"))i=we(n,r.slice(2));let a=await Promise.all([Ke(i,{ignoreCache:e.ignoreCache}).then(Tt).then(uc).catch(Qr),Ke(o,{ignoreCache:e.ignoreCache}).then(Tt).catch(Qr)]);return{configFile:a[0],credentialsFile:a[1]}},gc=(e)=>Object.entries(e).filter(([t])=>t.startsWith(qe.SSO_SESSION+W)).reduce((t,[r,n])=>({...t,[r.substring(r.indexOf(W)+1)]:n}),{}),yc=()=>({}),bc=async(e={})=>Ke(e.configFilepath??hn()).then(Tt).then(gc).catch(yc),wc=(...e)=>{let t={};for(let r of e)for(let[n,s]of Object.entries(r))if(t[n]!==void 0)Object.assign(t[n],s);else t[n]=s;return t},Sc=async(e)=>{let t=await Ot(e);return wc(t.configFile,t.credentialsFile)},xc={getFileRecord(){return Je},interceptFile(e,t){Je[e]=Promise.resolve(t)},getTokenRecord(){return We},interceptToken(e,t){We[e]=t}};function pn(e){try{let t=new Set(Array.from(e.match(/([A-Z_]){3,}/g)??[]));return t.delete("CONFIG"),t.delete("CONFIG_PREFIX_SEPARATOR"),t.delete("ENV"),[...t].join(", ")}catch(t){return e}}var Ec=(e,t)=>async()=>{try{let r=e(process.env,t);if(r===void 0)throw Error();return r}catch(r){throw new Se(r.message||`Not found in ENV: ${pn(e.toString())}`,{logger:t?.logger})}},Tc=(e,{preferredFile:t="config",...r}={})=>async()=>{let n=ln(r),{configFile:s,credentialsFile:o}=await Ot(r),i=o[n]||{},a=s[n]||{},c=t==="config"?{...i,...a}:{...a,...i};try{let d=e(c,t==="config"?s:o);if(d===void 0)throw Error();return d}catch(u){throw new Se(u.message||`Not found in config files w/ profile [${n}]: ${pn(e.toString())}`,{logger:r.logger})}},Cc=(e)=>typeof e==="function",mn=(e)=>Cc(e)?async()=>await e():cn(e),Ct=({environmentVariableSelector:e,configFileSelector:t,default:r},n={})=>{let{signingName:s,logger:o}=n;return Nt(an(Ec(e,{signingName:s,logger:o}),Tc(t,n),mn(r)))},At="AWS_USE_DUALSTACK_ENDPOINT",_t="use_dualstack_endpoint",Ic=!1,Nc={environmentVariableSelector:(e)=>L(e,At,O.ENV),configFileSelector:(e)=>L(e,_t,O.CONFIG),default:!1},Oc={environmentVariableSelector:(e)=>L(e,At,O.ENV),configFileSelector:(e)=>L(e,_t,O.CONFIG),default:void 0},vt="AWS_USE_FIPS_ENDPOINT",Rt="use_fips_endpoint",Ac=!1,_c={environmentVariableSelector:(e)=>L(e,vt,O.ENV),configFileSelector:(e)=>L(e,Rt,O.CONFIG),default:!1},vc={environmentVariableSelector:(e)=>L(e,vt,O.ENV),configFileSelector:(e)=>L(e,Rt,O.CONFIG),default:void 0},Rc=(e)=>{let{tls:t,endpoint:r,urlParser:n,useDualstackEndpoint:s}=e;return Object.assign(e,{tls:t??!0,endpoint:je(typeof r==="string"?n(r):r),isCustomEndpoint:!0,useDualstackEndpoint:je(s??!1)})},Mc=async(e)=>{let{tls:t=!0}=e,r=await e.region();if(!new RegExp(/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$/).test(r))throw Error("Invalid region in client config");let s=await e.useDualstackEndpoint(),o=await e.useFipsEndpoint(),{hostname:i}=await e.regionInfoProvider(r,{useDualstackEndpoint:s,useFipsEndpoint:o})??{};if(!i)throw Error("Cannot resolve hostname from client config");return e.urlParser(`${t?"https:":"http:"}//${i}`)},$c=(e)=>{let t=je(e.useDualstackEndpoint??!1),{endpoint:r,useFipsEndpoint:n,urlParser:s,tls:o}=e;return Object.assign(e,{tls:o??!0,endpoint:r?je(typeof r==="string"?s(r):r):()=>Mc({...e,useDualstackEndpoint:t,useFipsEndpoint:n}),isCustomEndpoint:!!r,useDualstackEndpoint:t})},Uc="AWS_EXECUTION_ENV",Xr="AWS_REGION",Zr="AWS_DEFAULT_REGION",Lc="AWS_EC2_METADATA_DISABLED",Dc=["in-region","cross-region","mobile","standard","legacy"],Pc="/latest/meta-data/placement/region",Fc="/latest/api/token",kc="x-aws-ec2-metadata-token",Bc="x-aws-ec2-metadata-token-ttl-seconds",Yr=1000,zc=60000,gn=0,yn=async()=>{if(process.env[Lc])return;if(Date.now()<gn)return;try{let e=Hc(),t=(await tn({...e,path:Fc,method:"PUT",headers:{[Bc]:"21600"}})).toString();return(await tn({...e,path:Pc,method:"GET",headers:{[kc]:t}})).toString().trim()||en()}catch{return en()}},en=()=>{gn=Date.now()+zc;return},Hc=()=>{let e=process.env.AWS_EC2_METADATA_SERVICE_ENDPOINT;if(e){let t=new URL(e);return{hostname:t.hostname.replace(/^\[(.+)]$/,"$1"),port:t.port?Number(t.port):void 0}}if(process.env.AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE==="IPv6")return{hostname:"fd00:ec2::254"};return{hostname:"169.254.169.254"}},tn=async(e)=>{let{request:t}=V("http");return new Promise((r,n)=>{let s=t({hostname:e.hostname,port:e.port,path:e.path,method:e.method,headers:e.headers,timeout:Yr,signal:AbortSignal.timeout(Yr)});s.on("error",(o)=>{n(o),s.destroy()}),s.on("timeout",()=>{n(Error("TimeoutError from instance metadata service")),s.destroy()}),s.on("response",(o)=>{let{statusCode:i=400}=o;if(i<200||i>=300){n(Object.assign(Error("Error response received from instance metadata service"),{statusCode:i})),s.destroy();return}let a=[];o.on("data",(c)=>a.push(c)),o.on("end",()=>{r(Buffer.concat(a)),s.destroy()})}),s.end()})},bn="AWS_REGION",Sn="region",xn={environmentVariableSelector:(e)=>e[bn],configFileSelector:(e)=>e[Sn],default:async()=>{let e=await yn();if(e)return e;throw Error("Region is missing")}},Vc={preferredFile:"credentials"},rn=new Set,qc=(e,t=ic)=>{if(!rn.has(e)&&!t(e))if(e==="*")console.warn('@smithy/config-resolver WARN - Please use the caller region instead of "*". See "sigv4a" in https://github.com/aws/aws-sdk-js-v3/blob/main/supplemental-docs/CLIENTS.md.');else throw Error(`Region not accepted: region="${e}" is not a valid hostname component.`);else rn.add(e)},En=(e)=>typeof e==="string"&&(e.startsWith("fips-")||e.endsWith("-fips")),jc=(e)=>En(e)?["fips-aws-global","aws-fips"].includes(e)?"us-east-1":e.replace(/fips-(dkr-|prod-)?|-fips/,""):e,Wc=(e)=>{let{region:t,useFipsEndpoint:r}=e;if(!t)throw Error("Region is missing");return Object.assign(e,{region:async()=>{let n=typeof t==="function"?await t():t,s=jc(n);return qc(s),s},useFipsEndpoint:async()=>{let n=typeof t==="string"?t:await t();if(En(n))return!0;return typeof r!=="function"?Promise.resolve(!!r):r()}})},sn=(e=[],{useFipsEndpoint:t,useDualstackEndpoint:r})=>e.find(({tags:n})=>t===n.includes("fips")&&r===n.includes("dualstack"))?.hostname,Gc=(e,{regionHostname:t,partitionHostname:r})=>t?t:r?r.replace("{region}",e):void 0,Jc=(e,{partitionHash:t})=>Object.keys(t||{}).find((r)=>t[r].regions.includes(e))??"aws",Kc=(e,{signingRegion:t,regionRegex:r,useFipsEndpoint:n})=>{if(t)return t;else if(n){let s=r.replace("\\\\","\\").replace(/^\^/g,"\\.").replace(/\$$/g,"\\."),o=e.match(s);if(o)return o[0].slice(1,-1)}},Qc=(e,{useFipsEndpoint:t=!1,useDualstackEndpoint:r=!1,signingService:n,regionHash:s,partitionHash:o})=>{let i=Jc(e,{partitionHash:o}),a=e in s?e:o[i]?.endpoint??e,c={useFipsEndpoint:t,useDualstackEndpoint:r},u=sn(s[a]?.variants,c),d=sn(o[i]?.variants,c),f=Gc(a,{regionHostname:u,partitionHostname:d});if(f===void 0)throw Error(`Endpoint resolution failed for: ${{resolvedRegion:a,useFipsEndpoint:t,useDualstackEndpoint:r}}`);let l=Kc(f,{signingRegion:s[a]?.signingRegion,regionRegex:o[i].regionRegex,useFipsEndpoint:t});return{partition:i,signingService:n,hostname:f,...l&&{signingRegion:l},...s[a]?.signingService&&{signingService:s[a].signingService}}},Xc="AWS_DEFAULTS_MODE",Yc="defaults_mode",ef={environmentVariableSelector:(e)=>e[Xc],configFileSelector:(e)=>e[Yc],default:"legacy"},tf=({region:e=Ct(xn),defaultsMode:t=Ct(ef)}={})=>Nt(async()=>{let r=typeof t==="function"?await t():t;switch(r?.toLowerCase()){case"auto":return rf(e);case"in-region":case"cross-region":case"mobile":case"standard":case"legacy":return Promise.resolve(r?.toLocaleLowerCase());case void 0:return Promise.resolve("legacy");default:throw Error(`Invalid parameter for "defaultsMode", expect ${Dc.join(", ")}, got ${r}`)}}),rf=async(e)=>{if(e){let t=typeof e==="function"?await e():e,r=await nf();if(!r)return"standard";if(t===r)return"in-region";else return"cross-region"}return"standard"},nf=async()=>{if(process.env[Uc]&&(process.env[Xr]||process.env[Zr]))return process.env[Xr]??process.env[Zr];return yn()};sf.CONFIG_PREFIX_SEPARATOR=W;sf.CONFIG_USE_DUALSTACK_ENDPOINT=_t;sf.CONFIG_USE_FIPS_ENDPOINT=Rt;sf.CredentialsProviderError=Se;sf.DEFAULT_PROFILE=un;sf.DEFAULT_USE_DUALSTACK_ENDPOINT=Ic;sf.DEFAULT_USE_FIPS_ENDPOINT=Ac;sf.ENV_PROFILE=fn;sf.ENV_USE_DUALSTACK_ENDPOINT=At;sf.ENV_USE_FIPS_ENDPOINT=vt;sf.NODE_REGION_CONFIG_FILE_OPTIONS=Vc;sf.NODE_REGION_CONFIG_OPTIONS=xn;sf.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS=Nc;sf.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS=_c;sf.ProviderError=Z;sf.REGION_ENV_NAME=bn;sf.REGION_INI_NAME=Sn;sf.SelectorType=O;sf.TokenProviderError=It;sf.booleanSelector=L;sf.chain=an;sf.externalDataInterceptor=xc;sf.fromStatic=mn;sf.fromValue=cn;sf.getHomeDir=xe;sf.getProfileName=ln;sf.getRegionInfo=Qc;sf.getSSOTokenFilepath=dn;sf.getSSOTokenFromFile=fc;sf.loadConfig=Ct;sf.loadSharedConfigFiles=Ot;sf.loadSsoSessionData=bc;sf.memoize=Nt;sf.nodeDualstackConfigSelectors=Oc;sf.nodeFipsConfigSelectors=vc;sf.numberSelector=ac;sf.parseKnownFiles=Sc;sf.readFile=Ke;sf.resolveCustomEndpointsConfig=Rc;sf.resolveDefaultsModeConfig=tf;sf.resolveEndpointsConfig=$c;sf.resolveRegionConfig=Wc});var nn=w(function(Lu){var{CONFIG_PREFIX_SEPARATOR:Tn,booleanSelector:Cn,SelectorType:In,loadConfig:Nn}=Ge(),{toEndpointV1:Qe,getSmithyContext:Jf,normalizeProvider:Mt,isValidHostLabel:_n,hasOwn:Kf}=wo();Lu.isValidHostLabel=_n;Lu.middlewareEndpointToEndpointV1=Qe;Lu.toEndpointV1=Qe;var{EndpointURLScheme:Lt}=Ca(),On="AWS_ENDPOINT_URL",An="endpoint_url",Qf=(e)=>({environmentVariableSelector:(t)=>{let r=e.split(" ").map((o)=>o.toUpperCase()),n=t[[On,...r].join("_")];if(n)return n;let s=t[On];if(s)return s;return},configFileSelector:(t,r)=>{if(t.services){let s=["services",t.services].join(Tn);if(!r||!r[s])throw Error(`The services section "${t.services}" specified in the profile is not present in the shared configuration file.`);let o=r[s],i=e.split(" ").map((c)=>c.toLowerCase()),a=o[[i.join("_"),An].join(Tn)];if(a)return a}let n=t[An];if(n)return n;return},default:void 0}),Xf="AWS_IGNORE_CONFIGURED_ENDPOINT_URLS",Zf="ignore_configured_endpoint_urls",Yf={environmentVariableSelector:(e)=>Cn(e,Xf,In.ENV),configFileSelector:(e)=>Cn(e,Zf,In.CONFIG),default:!1},Xe=async(e)=>{if(await Nn(Yf)())return;return Nn(Qf(e??""))()},eu=async(e)=>{let t=e?.Bucket||"";if(typeof e.Bucket==="string")e.Bucket=t.replace(/#/g,encodeURIComponent("#")).replace(/\?/g,encodeURIComponent("?"));if(ou(t)){if(e.ForcePathStyle===!0)throw Error("Path-style addressing cannot be used with ARN buckets")}else if(!su(t)||t.indexOf(".")!==-1&&!String(e.Endpoint).startsWith("http:")||t.toLowerCase()!==t||t.length<3)e.ForcePathStyle=!0;if(e.DisableMultiRegionAccessPoints)e.disableMultiRegionAccessPoints=!0,e.DisableMRAP=!0;return e},tu=/^[a-z0-9][a-z0-9.-]{1,61}[a-z0-9]$/,ru=/(\d+\.){3}\d+/,nu=/\.\./,su=(e)=>tu.test(e)&&!ru.test(e)&&!nu.test(e),ou=(e)=>{let[t,r,n,,,s]=e.split(":"),o=t==="arn"&&e.split(":").length>=6,i=Boolean(o&&r&&n&&s);if(o&&!i)throw Error(`Invalid ARN: ${e} was an invalid ARN.`);return i},iu=(e,t,r,n=!1)=>{let s=async()=>{let o;if(n)o=r.clientContextParams?.[e]??r[e]??r[t];else o=r[e]??r[t];if(typeof o==="function")return o();return o};if(e==="credentialScope"||t==="CredentialScope")return async()=>{let o=typeof r.credentials==="function"?await r.credentials():r.credentials;return o?.credentialScope??o?.CredentialScope};if(e==="accountId"||t==="AccountId")return async()=>{let o=typeof r.credentials==="function"?await r.credentials():r.credentials;return o?.accountId??o?.AccountId};if(e==="endpoint"||t==="endpoint")return async()=>{if(r.isCustomEndpoint===!1)return;let o=await s();if(o&&typeof o==="object"){if("url"in o)return o.url.href;if("hostname"in o){let{protocol:i,hostname:a,port:c,path:u}=o;return`${i}//${a}${c?":"+c:""}${u}`}}return o};return s};function vn(e){return async(t,r,n,s)=>{if(!n.isCustomEndpoint&&!n.ignoreConfiguredEndpointUrls){let a;if(n.serviceConfiguredEndpoint)a=await n.serviceConfiguredEndpoint();else a=await e(n.serviceId);if(a)n.endpoint=()=>Promise.resolve(Qe(a)),n.isCustomEndpoint=!0,s?.logger?.debug?.(`@smithy/core/endpoints - resolved endpoint from config: ${a}`)}let o=await Rn(t,r,n);if(typeof n.endpointProvider!=="function")throw Error("config.endpointProvider is not set.");let i=n.endpointProvider(o,s);if(n.isCustomEndpoint&&n.endpoint){let a=await n.endpoint();if(a?.headers){i.headers??={};for(let[c,u]of Object.entries(a.headers))i.headers[c]=Array.isArray(u)?u:[u]}}return i}}var Rn=async(e,t,r)=>{let n={},s=t?.getEndpointParameterInstructions?.()||{};for(let[o,i]of Object.entries(s))switch(i.type){case"staticContextParams":n[o]=i.value;break;case"contextParams":n[o]=e[i.name];break;case"clientContextParams":case"builtInParams":n[o]=await iu(i.name,o,r,i.type!=="builtInParams")();break;case"operationContextParams":n[o]=i.get(e);break;default:throw Error("Unrecognized endpoint parameter instruction: "+JSON.stringify(i))}if(Object.keys(s).length===0)Object.assign(n,r);if(String(r.serviceId).toLowerCase()==="s3")await eu(n);return n};function au(e,t,r){if(!e.__smithy_context)e.__smithy_context={features:{}};else if(!e.__smithy_context.features)e.__smithy_context.features={};e.__smithy_context.features[t]=r}function Mn(e){let t=vn(e);return({config:r,instructions:n})=>(s,o)=>async(i)=>{if(r.isCustomEndpoint)au(o,"ENDPOINT_OVERRIDE","N");let a=await t(i.input,{getEndpointParameterInstructions(){return n}},{...r},o);o.endpointV2=a,o.authSchemes=a.properties?.authSchemes;let c=o.authSchemes?.[0];if(c){o.signing_region=c.signingRegion,o.signing_service=c.signingName;let d=Jf(o)?.selectedHttpAuthScheme?.httpAuthOption;if(d)d.signingProperties=Object.assign(d.signingProperties||{},{signing_region:c.signingRegion,signingRegion:c.signingRegion,signing_service:c.signingName,signingName:c.signingName,signingRegionSet:c.signingRegionSet},c.properties)}return s({...i})}}var cu={name:"serializerMiddleware"},$n={step:"serialize",tags:["ENDPOINT_PARAMETERS","ENDPOINT_V2","ENDPOINT"],name:"endpointV2Middleware",override:!0,relation:"before",toMiddleware:cu.name};function fu(e){let t=Mn(e);return(r,n)=>({applyToStack:(s)=>{s.addRelativeTo(t({config:r,instructions:n}),$n)}})}function uu(e){return(t)=>{let r=t.tls??!0,{endpoint:n,useDualstackEndpoint:s,useFipsEndpoint:o}=t,i=n!=null?async()=>Qe(await Mt(n)()):void 0,c=Object.assign(t,{endpoint:i,tls:r,isCustomEndpoint:!!n,useDualstackEndpoint:Mt(s??!1),useFipsEndpoint:Mt(o??!1),ignoreConfiguredEndpointUrls:!!t.ignoreConfiguredEndpointUrls}),u=void 0;return c.serviceConfiguredEndpoint=async()=>{if(t.serviceId&&!u)u=e(t.serviceId);return u},c}}class Dt{nodes;root;conditions;results;constructor(e,t,r,n){this.nodes=e,this.root=t,this.conditions=r,this.results=n}static from(e,t,r,n){return new Dt(e,t,r,n)}}class Un{capacity;data=new Map;parameters=[];constructor({size:e,params:t}){if(this.capacity=e??50,t)this.parameters=t}get(e,t){let r=this.hash(e);if(r===!1)return t();if(!this.data.has(r)){if(this.data.size>this.capacity+10){let n=this.data.keys(),s=0;while(!0){let{value:o,done:i}=n.next();if(this.data.delete(o),i||++s>10)break}}this.data.set(r,t())}return this.data.get(r)}size(){return this.data.size}hash(e){let t="",{parameters:r}=this;if(r.length===0)return!1;for(let n of r){let s=String(e[n]??"");if(s.includes("|;"))return!1;t+=s+"|;"}return t}}class E extends Error{constructor(e){super(e);this.name="EndpointError"}}var Ee="endpoints";function B(e){if(typeof e!=="object"||e==null)return e;if("ref"in e)return`$${B(e.ref)}`;if("fn"in e)return`${e.fn}(${(e.argv||[]).map(B).join(", ")})`;return JSON.stringify(e,null,2)}var Ln={},lu=(e,t)=>e===t;function du(...e){for(let t of e)if(t!=null)return t;return}var hu=(e)=>{let t=e.split("."),r=[];for(let n of t){let s=n.indexOf("[");if(s!==-1){if(n.indexOf("]")!==n.length-1)throw new E(`Path: '${e}' does not end with ']'`);let o=n.slice(s+1,-1);if(Number.isNaN(parseInt(o)))throw new E(`Invalid array index: '${o}' in path: '${e}'`);if(s!==0)r.push(n.slice(0,s));r.push(o)}else r.push(n)}return r},Dn=(e,t)=>hu(t).reduce((r,n)=>{if(typeof r!=="object")throw new E(`Index '${n}' in '${t}' not found in '${JSON.stringify(e)}'`);else if(Array.isArray(r)){let s=parseInt(n);return r[s<0?r.length+s:s]}return r[n]},e),pu=(e)=>e!=null;function mu(e,t,r){return e?t:r}var gu=(e)=>!e,yu=new RegExp("^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$"),Pn=(e)=>yu.test(e)||e.startsWith("[")&&e.endsWith("]"),$t={[Lt.HTTP]:80,[Lt.HTTPS]:443},bu=(e)=>{let t=(()=>{try{if(e instanceof URL)return e;if(typeof e==="object"&&"hostname"in e){let{hostname:l,port:h,protocol:p="",path:g="",query:m={}}=e,y=new URL(`${p}//${l}${h?`:${h}`:""}${g}`);return y.search=Object.entries(m).map(([b,S])=>`${b}=${S}`).join("&"),y}return new URL(e)}catch(l){return null}})();if(!t)return console.error(`Unable to parse ${JSON.stringify(e)} as a whatwg URL.`),null;let r=t.href,{host:n,hostname:s,pathname:o,protocol:i,search:a}=t;if(a)return null;let c=i.slice(0,-1);if(!Object.values(Lt).includes(c))return null;let u=Pn(s),d=r.includes(`${n}:${$t[c]}`)||typeof e==="string"&&e.includes(`${n}:${$t[c]}`),f=`${n}${d?`:${$t[c]}`:""}`;return{scheme:c,authority:f,path:o,normalizedPath:o.endsWith("/")?o:`${o}/`,isIp:u}};function wu(e,t,r){if(r===1)return[e];if(e==="")return[""];let n=e.split(t);if(r===0)return n;return n.slice(0,r-1).concat(n.slice(1).join(t))}var Su=(e,t)=>e===t,xu=(e,t,r,n)=>{if(e==null||t>=r||e.length<r||/[^\u0000-\u007f]/.test(e))return null;if(!n)return e.substring(t,r);return e.substring(e.length-r,e.length-t)},Eu=(e)=>encodeURIComponent(e).replace(/[!*'()]/g,(t)=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`),Tu={booleanEquals:lu,coalesce:du,getAttr:Dn,isSet:pu,isValidHostLabel:_n,ite:mu,not:gu,parseURL:bu,split:wu,stringEquals:Su,substring:xu,uriEncode:Eu},Fn=(e,t)=>{let r=[],{referenceRecord:n,endpointParams:s}=t,o=0;while(o<e.length){let i=e.indexOf("{",o);if(i===-1){r.push(e.slice(o));break}r.push(e.slice(o,i));let a=e.indexOf("}",i);if(a===-1){r.push(e.slice(i));break}if(e[i+1]==="{"&&e[a+1]==="}")r.push(e.slice(i+1,a)),o=a+2;let c=e.substring(i+1,a);if(c.includes("#")){let[u,d]=c.split("#");r.push(Dn(n[u]??s[u],d))}else r.push(n[c]??s[c]);o=a+1}return r.join("")},Cu=({ref:e},t)=>t.referenceRecord[e]??t.endpointParams[e],Te=(e,t,r)=>{if(typeof e==="string")return Fn(e,r);else if(e.fn)return Bn.callFunction(e,r);else if(e.ref)return Cu(e,r);throw new E(`'${t}': ${String(e)} is not a string, function or reference.`)},kn=({fn:e,argv:t},r)=>{let n=Array(t.length);for(let i=0;i<n.length;++i){let a=t[i];if(typeof a==="boolean"||typeof a==="number")n[i]=a;else n[i]=Bn.evaluateExpression(a,"arg",r)}let s=e.indexOf(".");if(s!==-1){let a=Ln[e.slice(0,s)]?.[e.slice(s+1)];if(typeof a==="function")return a(...n)}let o=Tu[e];if(typeof o==="function")return o(...n);throw Error(`function ${e} not loaded in endpointFunctions.`)},Bn={evaluateExpression:Te,callFunction:kn},zn=(e,t)=>{let{assign:r}=e;if(r&&r in t.referenceRecord)throw new E(`'${r}' is already defined in Reference Record.`);let n=kn(e,t);t.logger?.debug?.(`${Ee} evaluateCondition: ${B(e)} = ${B(n)}`);let s=n===""?!0:!!n;if(r!=null)return{result:s,toAssign:{name:r,value:n}};return{result:s}},Hn=(e,t)=>Object.entries(e??{}).reduce((r,[n,s])=>(r[n]=s.map((o)=>{let i=Te(o,"Header value entry",t);if(typeof i!=="string")throw new E(`Header '${n}' value '${i}' is not a string`);return i}),r),{}),Pt=(e,t)=>Object.entries(e).reduce((r,[n,s])=>(r[n]=qn.getEndpointProperty(s,t),r),{}),Vn=(e,t)=>{if(Array.isArray(e))return e.map((r)=>Vn(r,t));switch(typeof e){case"string":return Fn(e,t);case"object":if(e===null)throw new E(`Unexpected endpoint property: ${e}`);return qn.getEndpointProperties(e,t);case"boolean":return e;default:throw new E(`Unexpected endpoint property type: ${typeof e}`)}},qn={getEndpointProperty:Vn,getEndpointProperties:Pt},jn=(e,t)=>{let r=Te(e,"Endpoint URL",t);if(typeof r==="string")try{return new URL(r)}catch(n){throw console.error(`Failed to construct URL with ${r}`,n),n}throw new E(`Endpoint URL must be a string, got ${typeof r}`)},Ut=1e8,Iu=(e,t)=>{let{nodes:r,root:n,results:s,conditions:o}=e,i=n,a={},c={referenceRecord:a,endpointParams:t.endpointParams,logger:t.logger};while(i!==1&&i!==-1&&i<Ut){let u=3*(Math.abs(i)-1),[d,f,l]=[r[u],r[u+1],r[u+2]],[h,p,g]=o[d],m=zn({fn:h,assign:g,argv:p},c);if(m.toAssign){let{name:y,value:b}=m.toAssign;a[y]=b}i=i>=0===m.result?f:l}if(i>=Ut){let u=s[i-Ut];if(u[0]===-1){let[,h]=u;throw new E(Te(h,"Error",c))}let[d,f,l]=u;return{url:jn(d,c),properties:Pt(f,c),headers:Hn(l??{},c)}}throw new E("No matching endpoint.")},Ft=(e=[],t)=>{let r={},n={...t,referenceRecord:{...t.referenceRecord}},s=!1;for(let o of e){let{result:i,toAssign:a}=zn(o,n);if(!i)return{result:i};if(a)s=!0,r[a.name]=a.value,n.referenceRecord[a.name]=a.value,t.logger?.debug?.(`${Ee} assign: ${a.name} := ${B(a.value)}`)}if(s)return{result:!0,referenceRecord:r};return{result:!0}},Nu=(e,t)=>{let{conditions:r,endpoint:n}=e,{result:s,referenceRecord:o}=Ft(r,t);if(!s)return;let i=o?{...t,referenceRecord:{...t.referenceRecord,...o}}:t,{url:a,properties:c,headers:u}=n;t.logger?.debug?.(`${Ee} Resolving endpoint from template: ${B(n)}`);let d={url:jn(a,i)};if(u!=null)d.headers=Hn(u,i);if(c!=null)d.properties=Pt(c,i);return d},Ou=(e,t)=>{let{conditions:r,error:n}=e,{result:s,referenceRecord:o}=Ft(r,t);if(!s)return;let i=o?{...t,referenceRecord:{...t.referenceRecord,...o}}:t;throw new E(Te(n,"Error",i))},Wn=(e,t)=>{for(let r of e)if(r.type==="endpoint"){let n=Nu(r,t);if(n)return n}else if(r.type==="error")Ou(r,t);else if(r.type==="tree"){let n=Gn.evaluateTreeRule(r,t);if(n)return n}else throw new E(`Unknown endpoint rule: ${r}`);throw new E("Rules evaluation failed")},Au=(e,t)=>{let{conditions:r,rules:n}=e,{result:s,referenceRecord:o}=Ft(r,t);if(!s)return;let i=o?{...t,referenceRecord:{...t.referenceRecord,...o}}:t;return Gn.evaluateRules(n,i)},Gn={evaluateRules:Wn,evaluateTreeRule:Au},_u=(e,t)=>{let{endpointParams:r,logger:n}=t,{parameters:s,rules:o}=e;t.logger?.debug?.(`${Ee} Initial EndpointParams: ${B(r)}`);for(let a in s){if(!Kf(s,a))continue;let c=s[a],u=r[a];if(u==null&&c.default!=null){r[a]=c.default;continue}if(c.required&&u==null)throw new E(`Missing required parameter: '${a}'`)}let i=Wn(o,{endpointParams:r,logger:n,referenceRecord:{}});return t.logger?.debug?.(`${Ee} Resolved endpoint: ${B(i)}`),i},vu=(e)=>{let{endpoint:t}=e;if(t===void 0)e.endpoint=async()=>{throw Error("@smithy/middleware-endpoint: (default endpointRuleSet) endpoint is not set - you must configure an endpoint.")};return e},Ru=vn(Xe),Mu=uu(Xe),$u=Mn(Xe),Uu=fu(Xe);Lu.BinaryDecisionDiagram=Dt;Lu.EndpointCache=Un;Lu.EndpointError=E;Lu.customEndpointFunctions=Ln;Lu.decideEndpoint=Iu;Lu.endpointMiddleware=$u;Lu.endpointMiddlewareOptions=$n;Lu.getEndpointFromInstructions=Ru;Lu.getEndpointPlugin=Uu;Lu.isIpAddress=Pn;Lu.resolveEndpoint=_u;Lu.resolveEndpointConfig=Mu;Lu.resolveEndpointRequiredConfig=vu;Lu.resolveParams=Rn});var er=w(function(Od){var{createHmac:Yu,createHash:el,getRandomValues:tl}=V("crypto"),{hasOwn:ts,HttpResponse:rl}=wo();Od.hasOwn=ts;var{ReadStream:nl,lstatSync:sl,fstatSync:ol}=V("fs"),{toEndpointV1:il}=nn(),{Readable:Y,Writable:rs,PassThrough:Jn}=V("stream"),ns=(e)=>typeof ArrayBuffer==="function"&&e instanceof ArrayBuffer||Object.prototype.toString.call(e)==="[object ArrayBuffer]",te=(e,t=0,r=e.byteLength-t)=>{if(!ns(e))throw TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof e} (${e})`);return Buffer.from(e,t,r)},tt=(e,t)=>{if(typeof e!=="string")throw TypeError(`The "input" argument must be of type string. Received type ${typeof e} (${e})`);return t?Buffer.from(e,t):Buffer.from(e)},al=/^[A-Za-z0-9+/]*={0,2}$/,ss=(e)=>{if(e.length*3%4!==0)throw TypeError("Incorrect padding on base64 string.");if(!al.exec(e))throw TypeError("Invalid base64 string.");let t=tt(e,"base64");return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)},rt=(e)=>{let t=tt(e,"utf8");return new Uint8Array(t.buffer,t.byteOffset,t.byteLength/Uint8Array.BYTES_PER_ELEMENT)},Gt=(e)=>{let t;if(typeof e==="string")t=rt(e);else t=e;if(typeof t!=="object"||typeof t.byteOffset!=="number"||typeof t.byteLength!=="number")throw Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");return te(t.buffer,t.byteOffset,t.byteLength).toString("base64")};function cl(e,t,r,n){return class s extends Uint8Array{static fromString(o,i="utf-8"){if(typeof o==="string"){if(i==="base64")return s.mutate(n(o));return s.mutate(t(o))}throw Error(`Unsupported conversion from ${typeof o} to Uint8ArrayBlobAdapter.`)}static mutate(o){return Object.setPrototypeOf(o,s.prototype),o}transformToString(o="utf-8"){if(o==="base64")return r(this);return e(this)}}}var os=(e)=>{if(typeof e==="string")return e;if(typeof e!=="object"||typeof e.byteOffset!=="number"||typeof e.byteLength!=="number")throw Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return te(e.buffer,e.byteOffset,e.byteLength).toString("utf8")},C=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function fl(e){if(typeof crypto<"u"&&typeof crypto.randomUUID==="function")return()=>crypto.randomUUID();return()=>{let t=new Uint8Array(16);return e(t),t[6]=t[6]&15|64,t[8]=t[8]&63|128,C[t[0]]+C[t[1]]+C[t[2]]+C[t[3]]+"-"+C[t[4]]+C[t[5]]+"-"+C[t[6]]+C[t[7]]+"-"+C[t[8]]+C[t[9]]+"-"+C[t[10]]+C[t[11]]+C[t[12]]+C[t[13]]+C[t[14]]+C[t[15]]}}var ul=(e,t,r=(n)=>n)=>e,ll=(e)=>{switch(e){case"true":return!0;case"false":return!1;default:throw Error(`Unable to parse boolean value "${e}"`)}},dl=(e)=>{if(e===null||e===void 0)return;if(typeof e==="number"){if(e===0||e===1)Oe.warn(Ye(`Expected boolean, got ${typeof e}: ${e}`));if(e===0)return!1;if(e===1)return!0}if(typeof e==="string"){let t=e.toLowerCase();if(t==="false"||t==="true")Oe.warn(Ye(`Expected boolean, got ${typeof e}: ${e}`));if(t==="false")return!1;if(t==="true")return!0}if(typeof e==="boolean")return e;throw TypeError(`Expected boolean, got ${typeof e}: ${e}`)},Ie=(e)=>{if(e===null||e===void 0)return;if(typeof e==="string"){let t=parseFloat(e);if(!Number.isNaN(t)){if(String(t)!==String(e))Oe.warn(Ye(`Expected number but observed string: ${e}`));return t}}if(typeof e==="number")return e;throw TypeError(`Expected number, got ${typeof e}: ${e}`)},hl=Math.ceil(340282346638528860000000000000000000000),Ze=(e)=>{let t=Ie(e);if(t!==void 0&&!Number.isNaN(t)&&t!==1/0&&t!==-1/0){if(Math.abs(t)>hl)throw TypeError(`Expected 32-bit float, got ${e}`)}return t},Ne=(e)=>{if(e===null||e===void 0)return;if(Number.isInteger(e)&&!Number.isNaN(e))return e;throw TypeError(`Expected integer, got ${typeof e}: ${e}`)},pl=Ne,Vt=(e)=>Jt(e,32),qt=(e)=>Jt(e,16),jt=(e)=>Jt(e,8),Jt=(e,t)=>{let r=Ne(e);if(r!==void 0&&ml(r,t)!==r)throw TypeError(`Expected ${t}-bit integer, got ${e}`);return r},ml=(e,t)=>{switch(t){case 32:return Int32Array.of(e)[0];case 16:return Int16Array.of(e)[0];case 8:return Int8Array.of(e)[0]}},gl=(e,t)=>{if(e===null||e===void 0){if(t)throw TypeError(`Expected a non-null value for ${t}`);throw TypeError("Expected a non-null value")}return e},is=(e)=>{if(e===null||e===void 0)return;if(typeof e==="object"&&!Array.isArray(e))return e;let t=Array.isArray(e)?"array":typeof e;throw TypeError(`Expected object, got ${t}: ${e}`)},yl=(e)=>{if(e===null||e===void 0)return;if(typeof e==="string")return e;if(["boolean","number","bigint"].includes(typeof e))return Oe.warn(Ye(`Expected string, got ${typeof e}: ${e}`)),String(e);throw TypeError(`Expected string, got ${typeof e}: ${e}`)},bl=(e)=>{if(e===null||e===void 0)return;let t=is(e),r=[];for(let n in t){if(!ts(t,n))continue;if(t[n]!=null)r.push(n)}if(r.length===0)throw TypeError("Unions must have exactly one non-null member. None were found.");if(r.length>1)throw TypeError(`Unions must have exactly one non-null member. Keys ${r} were not null.`);return t},Kt=(e)=>{if(typeof e=="string")return Ie(se(e));return Ie(e)},wl=Kt,as=(e)=>{if(typeof e=="string")return Ze(se(e));return Ze(e)},Sl=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,se=(e)=>{let t=e.match(Sl);if(t===null||t[0].length!==e.length)throw TypeError("Expected real number, got implicit NaN");return parseFloat(e)},Qt=(e)=>{if(typeof e=="string")return cs(e);return Ie(e)},xl=Qt,El=Qt,Tl=(e)=>{if(typeof e=="string")return cs(e);return Ze(e)},cs=(e)=>{switch(e){case"NaN":return NaN;case"Infinity":return 1/0;case"-Infinity":return-1/0;default:throw Error(`Unable to parse float value: ${e}`)}},fs=(e)=>{if(typeof e==="string")return Ne(se(e));return Ne(e)},Cl=fs,Il=(e)=>{if(typeof e==="string")return Vt(se(e));return Vt(e)},re=(e)=>{if(typeof e==="string")return qt(se(e));return qt(e)},us=(e)=>{if(typeof e==="string")return jt(se(e));return jt(e)},Ye=(e)=>String(TypeError(e).stack||e).split(`
4
- `).slice(0,5).filter((t)=>!t.includes("stackTraceWarning")).join(`
5
- `),Oe={warn:console.warn},Nl=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Xt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ol(e){let t=e.getUTCFullYear(),r=e.getUTCMonth(),n=e.getUTCDay(),s=e.getUTCDate(),o=e.getUTCHours(),i=e.getUTCMinutes(),a=e.getUTCSeconds(),c=s<10?`0${s}`:`${s}`,u=o<10?`0${o}`:`${o}`,d=i<10?`0${i}`:`${i}`,f=a<10?`0${a}`:`${a}`;return`${Nl[n]}, ${c} ${Xt[r]} ${t} ${u}:${d}:${f} GMT`}var Al=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/),_l=(e)=>{if(e===null||e===void 0)return;if(typeof e!=="string")throw TypeError("RFC-3339 date-times must be expressed as strings");let t=Al.exec(e);if(!t)throw TypeError("Invalid RFC-3339 date-time value");let[r,n,s,o,i,a,c,u]=t,d=re(ne(n)),f=_(s,"month",1,12),l=_(o,"day",1,31);return Ce(d,f,l,{hours:i,minutes:a,seconds:c,fractionalMilliseconds:u})},vl=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}:\d{2})|[zZ])$/),Rl=(e)=>{if(e===null||e===void 0)return;if(typeof e!=="string")throw TypeError("RFC-3339 date-times must be expressed as strings");let t=vl.exec(e);if(!t)throw TypeError("Invalid RFC-3339 date-time value");let[r,n,s,o,i,a,c,u,d]=t,f=re(ne(n)),l=_(s,"month",1,12),h=_(o,"day",1,31),p=Ce(f,l,h,{hours:i,minutes:a,seconds:c,fractionalMilliseconds:u});if(d.toUpperCase()!="Z")p.setTime(p.getTime()-ql(d));return p},Ml=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),$l=new RegExp(/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),Ul=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/),Ll=(e)=>{if(e===null||e===void 0)return;if(typeof e!=="string")throw TypeError("RFC-7231 date-times must be expressed as strings");let t=Ml.exec(e);if(t){let[r,n,s,o,i,a,c,u]=t;return Ce(re(ne(o)),kt(s),_(n,"day",1,31),{hours:i,minutes:a,seconds:c,fractionalMilliseconds:u})}if(t=$l.exec(e),t){let[r,n,s,o,i,a,c,u]=t;return kl(Ce(Pl(o),kt(s),_(n,"day",1,31),{hours:i,minutes:a,seconds:c,fractionalMilliseconds:u}))}if(t=Ul.exec(e),t){let[r,n,s,o,i,a,c,u]=t;return Ce(re(ne(u)),kt(n),_(s.trimLeft(),"day",1,31),{hours:o,minutes:i,seconds:a,fractionalMilliseconds:c})}throw TypeError("Invalid RFC-7231 date-time value")},Dl=(e)=>{if(e===null||e===void 0)return;let t;if(typeof e==="number")t=e;else if(typeof e==="string")t=Kt(e);else if(typeof e==="object"&&e.tag===1)t=e.value;else throw TypeError("Epoch timestamps must be expressed as floating point numbers or their string representation");if(Number.isNaN(t)||t===1/0||t===-1/0)throw TypeError("Epoch timestamps must be valid, non-Infinite, non-NaN numerics");return new Date(Math.round(t*1000))},Ce=(e,t,r,n)=>{let s=t-1;return zl(e,s,r),new Date(Date.UTC(e,s,r,_(n.hours,"hour",0,23),_(n.minutes,"minute",0,59),_(n.seconds,"seconds",0,60),Vl(n.fractionalMilliseconds)))},Pl=(e)=>{let t=new Date().getUTCFullYear(),r=Math.floor(t/100)*100+re(ne(e));if(r<t)return r+100;return r},Fl=1576800000000,kl=(e)=>{if(e.getTime()-new Date().getTime()>Fl)return new Date(Date.UTC(e.getUTCFullYear()-100,e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds()));return e},kt=(e)=>{let t=Xt.indexOf(e);if(t<0)throw TypeError(`Invalid month: ${e}`);return t+1},Bl=[31,28,31,30,31,30,31,31,30,31,30,31],zl=(e,t,r)=>{let n=Bl[t];if(t===1&&Hl(e))n=29;if(r>n)throw TypeError(`Invalid day for ${Xt[t]} in ${e}: ${r}`)},Hl=(e)=>e%4===0&&(e%100!==0||e%400===0),_=(e,t,r,n)=>{let s=us(ne(e));if(s<r||s>n)throw TypeError(`${t} must be between ${r} and ${n}, inclusive`);return s},Vl=(e)=>{if(e===null||e===void 0)return 0;return as("0."+e)*1000},ql=(e)=>{let t=e[0],r=1;if(t=="+")r=1;else if(t=="-")r=-1;else throw TypeError(`Offset direction, ${t}, must be "+" or "-"`);let n=Number(e.substring(1,3)),s=Number(e.substring(4,6));return r*(n*60+s)*60*1000},ne=(e)=>{let t=0;while(t<e.length-1&&e.charAt(t)==="0")t++;if(t===0)return e;return e.slice(t)},G=function(t){return Object.assign(new String(t),{deserializeJSON(){return JSON.parse(String(t))},toString(){return String(t)},toJSON(){return String(t)}})};G.from=(e)=>{if(e&&typeof e==="object"&&(e instanceof G||("deserializeJSON"in e)))return e;else if(typeof e==="string"||Object.getPrototypeOf(e)===String.prototype)return G(String(e));return G(JSON.stringify(e))};G.fromObject=G.from;function jl(e){if(e.includes(",")||e.includes('"'))e=`"${e.replace(/"/g,"\\\"")}"`;return e}var Zt="(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)(?:[ne|u?r]?s?day)?",Yt="(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)",tr="(\\d?\\d):(\\d{2}):(\\d{2})(?:\\.(\\d+))?",ls="(\\d?\\d)",ds="(\\d{4})",Wl=new RegExp(/^(\d{4})-(\d\d)-(\d\d)[tT](\d\d):(\d\d):(\d\d)(\.(\d+))?(([-+]\d\d:\d\d)|[zZ])$/),Gl=new RegExp(`^${Zt}, ${ls} ${Yt} ${ds} ${tr} GMT$`),Jl=new RegExp(`^${Zt}, ${ls}-${Yt}-(\\d\\d) ${tr} GMT$`),Kl=new RegExp(`^${Zt} ${Yt} ( [1-9]|\\d\\d) ${tr} ${ds}$`),Ql=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Xl=(e)=>{if(e==null)return;let t=NaN;if(typeof e==="number")t=e;else if(typeof e==="string"){if(!/^-?\d*\.?\d+$/.test(e))throw TypeError("parseEpochTimestamp - numeric string invalid.");t=Number.parseFloat(e)}else if(typeof e==="object"&&e.tag===1)t=e.value;if(isNaN(t)||Math.abs(t)===1/0)throw TypeError("Epoch timestamps must be valid finite numbers.");return new Date(Math.round(t*1000))},Zl=(e)=>{if(e==null)return;if(typeof e!=="string")throw TypeError("RFC3339 timestamps must be strings");let t=Wl.exec(e);if(!t)throw TypeError(`Invalid RFC3339 timestamp format ${e}`);let[,r,n,s,o,i,a,,c,u]=t;D(n,1,12),D(s,1,31),D(o,0,23),D(i,0,59),D(a,0,60);let d=new Date(Date.UTC(Number(r),Number(n)-1,Number(s),Number(o),Number(i),Number(a),Number(c)?Math.round(parseFloat(`0.${c}`)*1000):0));if(d.setUTCFullYear(Number(r)),u.toUpperCase()!="Z"){let[,f,l,h]=/([+-])(\d\d):(\d\d)/.exec(u)||[void 0,"+",0,0],p=f==="-"?1:-1;d.setTime(d.getTime()+p*(Number(l)*60*60*1000+Number(h)*60*1000))}return d},Yl=(e)=>{if(e==null)return;if(typeof e!=="string")throw TypeError("RFC7231 timestamps must be strings.");let t,r,n,s,o,i,a,c;if(c=Gl.exec(e))[,t,r,n,s,o,i,a]=c;else if(c=Jl.exec(e))[,t,r,n,s,o,i,a]=c,n=(Number(n)+1900).toString();else if(c=Kl.exec(e))[,r,t,s,o,i,a,n]=c;if(n&&i){let u=Date.UTC(Number(n),Ql.indexOf(r),Number(t),Number(s),Number(o),Number(i),a?Math.round(parseFloat(`0.${a}`)*1000):0);D(t,1,31),D(s,0,23),D(o,0,59),D(i,0,60);let d=new Date(u);return d.setUTCFullYear(Number(n)),d}throw TypeError(`Invalid RFC7231 date-time value ${e}.`)};function D(e,t,r){let n=Number(e);if(n<t||n>r)throw Error(`Value ${n} out of range [${t}, ${r}]`)}function ed(e,t,r){if(r<=0||!Number.isInteger(r))throw Error("Invalid number of delimiters ("+r+") for splitEvery.");let n=e.split(t);if(r===1)return n;let s=[],o="";for(let i=0;i<n.length;i++){if(o==="")o=n[i];else o+=t+n[i];if((i+1)%r===0)s.push(o),o=""}if(o!=="")s.push(o);return s}var td=(e)=>{let t=e.length,r=[],n=!1,s=void 0,o=0;for(let i=0;i<t;++i){let a=e[i];switch(a){case'"':if(s!=="\\")n=!n;break;case",":if(!n)r.push(e.slice(o,i)),o=i+1;break}s=a}return r.push(e.slice(o)),r.map((i)=>{i=i.trim();let a=i.length;if(a<2)return i;if(i[0]==='"'&&i[a-1]==='"')i=i.slice(1,a-1);return i.replace(/\\"/g,'"')})},Kn=/^-?((0|[1-9]\d*)(\.\d+)?|\.\d+)([eE][+-]?\d+)?$/;class nt{string;type;constructor(e,t){if(this.string=e,this.type=t,!Kn.test(e))throw Error(`@smithy/core/serde - NumericValue string must conform to the Smithy bigDecimal format. Received: "${e}"`)}toString(){return this.string}static[Symbol.hasInstance](e){if(!e||typeof e!=="object")return!1;let t=e;return nt.prototype.isPrototypeOf(e)||t.type==="bigDecimal"&&Kn.test(t.string)}}function rd(e){return new nt(String(e),"bigDecimal")}var hs={},Wt={};for(let e=0;e<256;e++){let t=e.toString(16).toLowerCase();if(t.length===1)t=`0${t}`;hs[e]=t,Wt[t]=e}function nd(e){if(e.length%2!==0)throw Error("Hex encoded strings must have an even number length");let t=new Uint8Array(e.length/2);for(let r=0;r<e.length;r+=2){let n=e.slice(r,r+2).toLowerCase();if(n in Wt)t[r/2]=Wt[n];else throw Error(`Cannot decode unrecognized sequence ${n} as hexadecimal`)}return t}function ps(e){let t="";for(let r=0;r<e.byteLength;r++)t+=hs[e[r]];return t}var sd=(e)=>{if(!e)return 0;if(typeof e==="string")return Buffer.byteLength(e);else if(typeof e.byteLength==="number")return e.byteLength;else if(typeof e.size==="number")return e.size;else if(typeof e.start==="number"&&typeof e.end==="number")return e.end+1-e.start;else if(e instanceof nl){if(e.path!=null)return sl(e.path).size;else if(typeof e.fd==="number")return ol(e.fd).size}throw Error(`Body Length computation failed for ${e}`)},ms=(e)=>{if(e instanceof Uint8Array)return e;if(typeof e==="string")return rt(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT);return new Uint8Array(e)};function st(e,t){if(t===void 0){t=0;for(let s of e)t+=s.byteLength}let r=new Uint8Array(t),n=0;for(let s of e)r.set(s,n),n+=s.byteLength;return r}var gs=(e,t)=>(r,n)=>async(s)=>{let{response:o}=await r(s);try{let i=await t(o,e);return{response:o,output:i}}catch(i){if(Object.defineProperty(i,"$response",{value:o,enumerable:!1,writable:!1,configurable:!1}),!("$metadata"in i)){try{i.message+=`
6
- Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.`}catch(c){if(!n.logger||n.logger?.constructor?.name==="NoOpLogger")console.warn("Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.");else n.logger?.warn?.("Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.")}if(typeof i.$responseBodyText<"u"){if(i.$response)i.$response.body=i.$responseBodyText}try{if(rl.isInstance(o)){let{headers:c={}}=o,u=Object.entries(c);i.$metadata={httpStatusCode:o.statusCode,requestId:Bt(/^x-[\w-]+-request-?id$/,u),extendedRequestId:Bt(/^x-[\w-]+-id-2$/,u),cfId:Bt(/^x-[\w-]+-cf-id$/,u)}}}catch(c){}}throw i}},Bt=(e,t)=>(t.find(([r])=>r.match(e))||[void 0,void 0])[1],ys=(e,t)=>(r,n)=>async(s)=>{let o=e,i=n.endpointV2?async()=>il(n.endpointV2):o.endpoint;if(!i)throw Error("No valid endpoint provider available.");let a=await t(s.input,{...e,endpoint:i});return r({...s,request:a})},bs={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},ws={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0};function od(e,t,r){return{applyToStack:(n)=>{n.add(gs(e,r),bs),n.add(ys(e,t),ws)}}}class Ss{algorithmIdentifier;secret;hash;constructor(e,t){this.algorithmIdentifier=e,this.secret=t,this.reset()}update(e,t){this.hash.update(ms(Qn(e,t)))}digest(){return Promise.resolve(this.hash.digest())}reset(){this.hash=this.secret?Yu(this.algorithmIdentifier,Qn(this.secret)):el(this.algorithmIdentifier)}}function Qn(e,t){if(Buffer.isBuffer(e))return e;if(typeof e==="string")return tt(e,t);if(ArrayBuffer.isView(e))return te(e.buffer,e.byteOffset,e.byteLength);return te(e)}var xs=class extends Y{expectedChecksum;checksumSourceLocation;checksum;source;base64Encoder;constructor({expectedChecksum:t,checksum:r,source:n,checksumSourceLocation:s,base64Encoder:o}){super();if(typeof n.pipe!=="function")throw Error(`@smithy/util-stream: unsupported source type ${n?.constructor?.name??n} in ChecksumStream.`);this.source=n,this.base64Encoder=o??Gt,this.expectedChecksum=t,this.checksum=r,this.checksumSourceLocation=s,this.source.on("data",this.onSourceData),this.source.on("end",this.onSourceEnd),this.source.on("error",this.onSourceError),this.source.on("close",this.onSourceClose),this.source.pause()}onSourceData=(t)=>{if(this.destroyed)return;try{this.checksum.update(t)}catch(r){this.destroy(r);return}if(!this.push(t))this.source.pause()};onSourceEnd=async()=>{if(this.destroyed)return;try{let t=await this.checksum.digest(),r=this.base64Encoder(t);if(this.expectedChecksum!==r){this.destroy(Error(`Checksum mismatch: expected "${this.expectedChecksum}" but received "${r}" in response header "${this.checksumSourceLocation}".`));return}}catch(t){this.destroy(t);return}this.push(null)};onSourceError=(t)=>{this.destroy(t)};onSourceClose=()=>{if(!this.destroyed&&!this.source.readableEnded)this.destroy(Error("Connection lost or stream closed before all data was received."))};_read(t){this.source.resume()}_destroy(t,r){this.source?.removeListener("data",this.onSourceData),this.source?.removeListener("end",this.onSourceEnd),this.source?.removeListener("error",this.onSourceError),this.source?.removeListener("close",this.onSourceClose),this.source?.destroy(),r(t)}},v=(e)=>typeof ReadableStream==="function"&&(e?.constructor?.name===ReadableStream.name||e instanceof ReadableStream),ot=(e)=>typeof Blob==="function"&&(e?.constructor?.name===Blob.name||e instanceof Blob),id=(e)=>new TextEncoder().encode(e),Es="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";Object.entries(Es).reduce((e,[t,r])=>(e[r]=Number(t),e),{});var ad=Es.split(""),zt=6,Xn=8,cd=63;function Ts(e){let t;if(typeof e==="string")t=id(e);else t=e;let r=typeof t==="object"&&typeof t.length==="number",n=typeof t==="object"&&typeof t.byteOffset==="number"&&typeof t.byteLength==="number";if(!r&&!n)throw Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");let s="";for(let o=0;o<t.length;o+=3){let i=0,a=0;for(let u=o,d=Math.min(o+3,t.length);u<d;u++)i|=t[u]<<(d-u-1)*Xn,a+=Xn;let c=Math.ceil(a/zt);i<<=c*zt-a;for(let u=1;u<=c;u++){let d=(c-u)*zt;s+=ad[(i&cd<<d)>>d]}s+="==".slice(0,4-c)}return s}var fd=typeof ReadableStream==="function"?ReadableStream:function(){};class Cs extends fd{}var ud=({expectedChecksum:e,checksum:t,source:r,checksumSourceLocation:n,base64Encoder:s})=>{if(!v(r))throw Error(`@smithy/util-stream: unsupported source type ${r?.constructor?.name??r} in ChecksumStream.`);let o=s??Ts;if(typeof TransformStream!=="function")throw Error("@smithy/util-stream: unable to instantiate ChecksumStream because API unavailable: ReadableStream/TransformStream.");let i=new TransformStream({start(){},async transform(c,u){t.update(c),u.enqueue(c)},async flush(c){let u=await t.digest(),d=o(u);if(e!==d){let f=Error(`Checksum mismatch: expected "${e}" but received "${d}" in response header "${n}".`);c.error(f)}else c.terminate()}});r.pipeThrough(i);let a=i.readable;return Object.setPrototypeOf(a,Cs.prototype),a};function ld(e){if(typeof ReadableStream==="function"&&v(e.source))return ud(e);return new xs(e)}class et{allocByteArray;byteLength=0;byteArrays=[];constructor(e){this.allocByteArray=e}push(e){this.byteArrays.push(e),this.byteLength+=e.byteLength}flush(){if(this.byteArrays.length===1){let r=this.byteArrays[0];return this.reset(),r}let e=this.allocByteArray(this.byteLength),t=0;for(let r=0;r<this.byteArrays.length;++r){let n=this.byteArrays[r];e.set(n,t),t+=n.byteLength}return this.reset(),e}reset(){this.byteArrays=[],this.byteLength=0}}function dd(e,t,r){let n=e.getReader(),s=!1,o=0,i=["",new et((u)=>new Uint8Array(u))],a=-1,c=async(u)=>{let{value:d,done:f}=await n.read(),l=d;if(f){if(a!==-1){let h=ee(i,a);if(z(h)>0)u.enqueue(h)}u.close()}else{let h=Ns(l,!1);if(a!==h){if(a>=0)u.enqueue(ee(i,a));a=h}if(a===-1){u.enqueue(l);return}let p=z(l);o+=p;let g=z(i[a]);if(p>=t&&g===0)u.enqueue(l);else{let m=Is(i,a,l);if(!s&&o>t*2)s=!0,r?.warn(`@smithy/util-stream - stream chunk size ${p} is below threshold of ${t}, automatically buffering.`);if(m>=t)u.enqueue(ee(i,a));else await c(u)}}};return new ReadableStream({pull:c})}function Is(e,t,r){switch(t){case 0:return e[0]+=r,z(e[0]);case 1:case 2:return e[t].push(r),z(e[t])}}function ee(e,t){switch(t){case 0:let r=e[0];return e[0]="",r;case 1:case 2:return e[t].flush()}throw Error(`@smithy/util-stream - invalid index ${t} given to flush()`)}function z(e){return e?.byteLength??e?.length??0}function Ns(e,t=!0){if(t&&typeof Buffer<"u"&&e instanceof Buffer)return 2;if(e instanceof Uint8Array)return 1;if(typeof e==="string")return 0;return-1}function hd(e,t,r){if(v(e))return dd(e,t,r);let n=new Y({read(){}}),s=!1,o=0,i=["",new et((c)=>new Uint8Array(c)),new et((c)=>Buffer.from(new Uint8Array(c)))],a=-1;return e.on("data",(c)=>{let u=Ns(c,!0);if(a!==u){if(a>=0)n.push(ee(i,a));a=u}if(a===-1){n.push(c);return}let d=z(c);o+=d;let f=z(i[a]);if(d>=t&&f===0)n.push(c);else{let l=Is(i,a,c);if(!s&&o>t*2)s=!0,r?.warn(`@smithy/util-stream - stream chunk size ${d} is below threshold of ${t}, automatically buffering.`);if(l>=t)n.push(ee(i,a))}}),e.on("end",()=>{if(a!==-1){let c=ee(i,a);if(z(c)>0)n.push(c)}n.push(null)}),n}var pd=(e,t)=>{let{base64Encoder:r,bodyLengthChecker:n,checksumAlgorithmFn:s,checksumLocationName:o,streamHasher:i}=t,a=r!==void 0&&n!==void 0&&s!==void 0&&o!==void 0&&i!==void 0,c=a?i(s,e):void 0,u=e.getReader();return new ReadableStream({async pull(d){let{value:f,done:l}=await u.read();if(l){if(d.enqueue(`0\r
7
- `),a){let h=r(await c);d.enqueue(`${o}:${h}\r
8
- `),d.enqueue(`\r
9
- `)}d.close()}else d.enqueue(`${(n(f)||0).toString(16)}\r
10
- ${f}\r
11
- `)}})};function md(e,t){let r=e,n=e;if(v(n))return pd(n,t);let{base64Encoder:s,bodyLengthChecker:o,checksumAlgorithmFn:i,checksumLocationName:a,streamHasher:c}=t,u=s!==void 0&&i!==void 0&&a!==void 0&&c!==void 0,d=u?c(i,r):void 0,f=new Y({read:()=>{}});return r.on("data",(l)=>{let h=o(l)||0;if(h===0)return;f.push(`${h.toString(16)}\r
12
- `),f.push(l),f.push(`\r
13
- `)}),r.on("end",async()=>{if(f.push(`0\r
14
- `),u){let l=s(await d);f.push(`${a}:${l}\r
15
- `),f.push(`\r
16
- `)}f.push(null)}),f}async function gd(e,t){let r=0,n=[],s=e.getReader(),o=!1;while(!o){let{done:c,value:u}=await s.read();if(u)n.push(u),r+=u?.byteLength??0;if(r>=t)break;o=c}s.releaseLock();let i=new Uint8Array(Math.min(t,r)),a=0;for(let c of n){if(c.byteLength>i.byteLength-a){i.set(c.subarray(0,i.byteLength-a),a);break}else i.set(c,a);a+=c.length}return i}var yd=(e,t)=>{if(v(e))return gd(e,t);return new Promise((r,n)=>{let s=new bd;s.limit=t,e.pipe(s),e.on("error",(o)=>{s.end(),n(o)}),s.on("error",n),s.on("finish",function(){let o=st(this.buffers);r(o)})})},bd=class extends rs{buffers=[];limit=1/0;bytesBuffered=0;_write(t,r,n){if(this.buffers.push(t),this.bytesBuffered+=t.byteLength??0,this.bytesBuffered>=this.limit){let s=this.bytesBuffered-this.limit,o=this.buffers[this.buffers.length-1];this.buffers[this.buffers.length-1]=o.subarray(0,o.byteLength-s),this.emit("finish")}n()}},wd=(e)=>{if(typeof e==="string")return e;if(typeof e!=="object"||typeof e.byteOffset!=="number"||typeof e.byteLength!=="number")throw Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return new TextDecoder("utf-8").decode(e)},Sd=async(e)=>{if(ot(e))return Os(e);return As(e)};async function Os(e){return e.arrayBuffer().then((t)=>new Uint8Array(t))}async function As(e){let t=[],r=e.getReader(),n=0;while(!0){let{done:s,value:o}=await r.read();if(o)t.push(o),n+=o.length;if(s)break}return st(t,n)}var Zn="The stream has already been transformed.",xd=(e)=>{if(!Yn(e)&&!v(e)){let s=e?.__proto__?.constructor?.name||e;throw Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${s}`)}let t=!1,r=async()=>{if(t)throw Error(Zn);return t=!0,await Sd(e)},n=(s)=>{if(typeof s.stream!=="function")throw Error(`Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled.
17
- If you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body`);return s.stream()};return Object.assign(e,{transformToByteArray:r,transformToString:async(s)=>{let o=await r();if(s==="base64")return Ts(o);else if(s==="hex")return ps(o);else if(s===void 0||s==="utf8"||s==="utf-8")return wd(o);else if(typeof TextDecoder==="function")return new TextDecoder(s).decode(o);else throw Error("TextDecoder is not available, please make sure polyfill is provided.")},transformToWebStream:()=>{if(t)throw Error(Zn);if(t=!0,Yn(e))return n(e);else if(v(e))return e;else throw Error(`Cannot transform payload to web stream, got ${e}`)}})},Yn=(e)=>typeof Blob==="function"&&e instanceof Blob,_s=(e)=>{if(ot(e))return Os(e);if(v(e))return As(e);return new Promise((t,r)=>{let n=new vs,s=e;s.pipe(n),s.on("error",(o)=>{n.end(),r(o)}),n.on("error",r),n.on("finish",function(){let o=st(this.bufferedBytes);t(o)})})};class vs extends rs{bufferedBytes=[];_write(e,t,r){this.bufferedBytes.push(e),r()}}var es="The stream has already been transformed.",Ed=(e)=>{if(!(e instanceof Y))try{return xd(e)}catch(n){let s=e?.__proto__?.constructor?.name||e;throw Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${s}`)}let t=!1,r=async()=>{if(t)throw Error(es);return t=!0,await _s(e)};return Object.assign(e,{transformToByteArray:r,transformToString:async(n)=>{let s=await r();if(n===void 0||Buffer.isEncoding(n))return te(s.buffer,s.byteOffset,s.byteLength).toString(n);else return new TextDecoder(n).decode(s)},transformToWebStream:()=>{if(t)throw Error(es);if(e.readableFlowing!==null)throw Error("The stream has been consumed by other callbacks.");if(typeof Y.toWeb!=="function")throw Error("Readable.toWeb() is not supported. Please ensure a polyfill is available.");return t=!0,Y.toWeb(e)}})};async function Td(e){if(typeof e.stream==="function")e=e.stream();return e.tee()}async function Cd(e){if(v(e)||ot(e))return Td(e);let t=new Jn,r=new Jn;return e.pipe(t),e.pipe(r),[t,r]}class Rs extends cl(os,rt,Gt,ss){}var Id=tl,Ms=fl(Id),Nd=Ms;Od.ChecksumStream=xs;Od.Hash=Ss;Od.LazyJsonString=G;Od.NumericValue=nt;Od.Uint8ArrayBlobAdapter=Rs;Od._parseEpochTimestamp=Xl;Od._parseRfc3339DateTimeWithOffset=Zl;Od._parseRfc7231DateTime=Yl;Od.calculateBodyLength=sd;Od.concatBytes=st;Od.copyDocumentWithTransform=ul;Od.createBufferedReadable=hd;Od.createChecksumStream=ld;Od.dateToUtcString=Ol;Od.deserializerMiddleware=gs;Od.deserializerMiddlewareOption=bs;Od.expectBoolean=dl;Od.expectByte=jt;Od.expectFloat32=Ze;Od.expectInt=pl;Od.expectInt32=Vt;Od.expectLong=Ne;Od.expectNonNull=gl;Od.expectNumber=Ie;Od.expectObject=is;Od.expectShort=qt;Od.expectString=yl;Od.expectUnion=bl;Od.fromArrayBuffer=te;Od.fromBase64=ss;Od.fromHex=nd;Od.fromString=tt;Od.fromUtf8=rt;Od.generateIdempotencyToken=Nd;Od.getAwsChunkedEncodingStream=md;Od.getSerdePlugin=od;Od.handleFloat=xl;Od.headStream=yd;Od.isArrayBuffer=ns;Od.isBlob=ot;Od.isReadableStream=v;Od.limitedParseDouble=Qt;Od.limitedParseFloat=El;Od.limitedParseFloat32=Tl;Od.logger=Oe;Od.nv=rd;Od.parseBoolean=ll;Od.parseEpochTimestamp=Dl;Od.parseRfc3339DateTime=_l;Od.parseRfc3339DateTimeWithOffset=Rl;Od.parseRfc7231DateTime=Ll;Od.quoteHeader=jl;Od.sdkStreamMixin=Ed;Od.serializerMiddleware=ys;Od.serializerMiddlewareOption=ws;Od.splitEvery=ed;Od.splitHeader=td;Od.splitStream=Cd;Od.streamCollector=_s;Od.strictParseByte=us;Od.strictParseDouble=Kt;Od.strictParseFloat=wl;Od.strictParseFloat32=as;Od.strictParseInt=Cl;Od.strictParseInt32=Il;Od.strictParseLong=fs;Od.strictParseShort=re;Od.toBase64=Gt;Od.toHex=ps;Od.toUint8Array=ms;Od.toUtf8=os;Od.v4=Ms});var xo=w(function(mp){var{createReadStream:Gh}=V("fs"),{Writable:Jh}=V("stream"),{toUint8Array:oe,concatBytes:Kh}=er(),{createHash:Ae,createHmac:Qh}=V("crypto"),at=V("zlib");async function Ps(e,t,r=1048576){let n=e.size,s=0;while(s<n){let o=e.slice(s,Math.min(n,s+r));t(new Uint8Array(await o.arrayBuffer())),s+=o.size}}var Xh=async function(t,r){let n=new t;return await Ps(r,(s)=>{n.update(s)}),n.digest()};class or extends Jh{hash;constructor(e,t){super(t);this.hash=e}_write(e,t,r){try{this.hash.update(oe(e))}catch(n){return r(n)}r()}}var Zh=(e,t)=>new Promise((r,n)=>{if(!Yh(t)){n(Error("Unable to calculate hash for non-file streams."));return}let s=Gh(t.path,{start:t.start,end:t.end}),o=new e,i=new or(o);s.pipe(i),s.on("error",(a)=>{i.end(),n(a)}),i.on("error",n),i.on("finish",function(){o.digest().then(r).catch(n)})}),Yh=(e)=>typeof e.path==="string",ep=(e,t)=>{if(t.readableFlowing!==null)throw Error("Unable to calculate hash for flowing readable stream");let r=new e,n=new or(r);return t.pipe(n),new Promise((s,o)=>{t.on("error",(i)=>{n.end(),o(i)}),n.on("error",o),n.on("finish",()=>{r.digest().then(s).catch(o)})})};class ir{digestLength=16;state=Uint32Array.from($s);writeBuffer=new DataView(new ArrayBuffer(64));bufferLength=0;bytesHashed=0;update(e){let t=oe(e),r=0,n=t.byteLength;this.bytesHashed+=n;while(n>0)if(this.writeBuffer.setUint8(this.bufferLength++,t[r++]),--n,this.bufferLength===64)rr(this.state,this.writeBuffer),this.bufferLength=0}async digest(){let e=Uint32Array.from(this.state),t=new DataView(this.writeBuffer.buffer.slice(0)),r=this.bufferLength,n=this.bytesHashed*8;if(t.setUint8(r++,128),this.bufferLength%64>=56){for(let i=r;i<64;++i)t.setUint8(i,0);rr(e,t),r=0}for(let i=r;i<56;++i)t.setUint8(i,0);t.setUint32(56,n>>>0,!0),t.setUint32(60,Math.floor(n/4294967296),!0),rr(e,t);let s=new Uint8Array(16),o=new DataView(s.buffer);for(let i=0;i<4;++i)o.setUint32(i*4,e[i],!0);return s}reset(){this.state.set($s),this.writeBuffer=new DataView(new ArrayBuffer(64)),this.bufferLength=0,this.bytesHashed=0}}var $s=[1732584193,4023233417,2562383102,271733878],H=4294967295,tp=Uint8Array.of(7,12,17,22,5,9,14,20,4,11,16,23,6,10,15,21),rp=Array.from({length:64},(e,t)=>Math.abs(Math.sin(t+1))*4294967296>>>0);function rr(e,t){let r=e[0],n=e[1],s=e[2],o=e[3];for(let i=0;i<64;++i){let a,c;if(i<16)a=n&s|~n&o,c=i;else if(i<32)a=o&n|s&~o,c=(5*i+1)%16;else if(i<48)a=n^s^o,c=(3*i+5)%16;else a=s^(n|~o),c=7*i%16;let u=t.getUint32(c*4,!0),d=o;o=s,s=n;let f=tp[(i>>4)*4+(i&3)],l=(r+a&H)+(u+rp[i]&H)&H;n=n+((l<<f|l>>>32-f)>>>0)&H,r=d}e[0]=e[0]+r&H,e[1]=e[1]+n&H,e[2]=e[2]+s&H,e[3]=e[3]+o&H}var np=(()=>{try{return Ae("md5"),!0}catch{return!1}})(),Fs=np?sp():ir;function sp(){return class{digestLength=16;hash=Ae("md5");update(t){this.hash.update(oe(t))}async digest(){let t=this.hash.copy().digest();return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}reset(){this.hash=Ae("md5")}}}var ks=new Uint32Array(256);for(let e=0;e<256;++e){let t=e;for(let r=0;r<8;++r)t=t&1?3988292384^t>>>1:t>>>1;ks[e]=t>>>0}var nr=4294967295;class ar{digestLength=4;checksum=nr;update(e){for(let t=0;t<e.length;++t)this.checksum=this.checksum>>>8^ks[(this.checksum^e[t])&255]}digestSync(){return(this.checksum^nr)>>>0}async digest(){let e=this.digestSync(),t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,e,!1),t}reset(){this.checksum=nr}}var Us=typeof at.crc32==="function"?at.crc32:void 0,Bs=Us?op(Us):ar;function op(e){return class{digestLength=4;value=0;update(r){this.value=e(r,this.value)}digestSync(){return this.value>>>0}async digest(){let r=new Uint8Array(4);return new DataView(r.buffer).setUint32(0,this.digestSync(),!1),r}reset(){this.value=0}}}var T=64,Ls=32,ip=9007199254740991;class P{digestLength=Ls;state=Int32Array.from(Ds);w;buffer=new Uint8Array(64);bufferLength=0;bytesHashed=0;finished=!1;inner;outer;constructor(e){if(e){let t=P.normalizeKey(e);this.inner=new P,this.outer=new P;let{inner:r,outer:n}=this,s=new Uint8Array(T*2);for(let o=0;o<T;++o)s[o]=54^t[o],s[o+T]=92^t[o];r.update(s.subarray(0,T)),n.update(s.subarray(T))}}update(e){if(this.finished)throw Error("Attempted to update an already finished HMAC.");if(this.inner){this.inner.update(e);return}let t=oe(e),r=0,{byteLength:n}=t;if(this.bytesHashed+=n,this.bytesHashed*8>ip)throw Error("Cannot hash more than 2^53 - 1 bits");while(n>0)if(this.buffer[this.bufferLength++]=t[r++],n--,this.bufferLength===T)this.hashBuffer(),this.bufferLength=0}async digest(){let{inner:e,outer:t}=this;if(e&&t){if(this.finished)throw Error("Attempted to digest an already finished HMAC.");this.finished=!0;let r=e.digestSync();return t.update(r),t.digestSync()}return this.digestSync()}reset(){this.state=Int32Array.from(Ds),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0}digestSync(){let e=this.state.slice(),t=this.buffer.slice(),r=this.bufferLength,n=this.bytesHashed*8,s=new DataView(t.buffer,t.byteOffset,t.byteLength);if(s.setUint8(r++,128),(r-1)%T>=T-8){for(let i=r;i<T;++i)s.setUint8(i,0);this.hashBufferWith(e,t),r=0}for(let i=r;i<T-8;++i)s.setUint8(i,0);s.setUint32(T-8,Math.floor(n/4294967296),!1),s.setUint32(T-4,n,!1),this.hashBufferWith(e,t);let o=new Uint8Array(Ls);for(let i=0;i<8;++i)o[i*4]=e[i]>>>24&255,o[i*4+1]=e[i]>>>16&255,o[i*4+2]=e[i]>>>8&255,o[i*4+3]=e[i]>>>0&255;return o}static normalizeKey(e){let t=oe(e);if(t.byteLength>T){let r=new P;r.update(t);let n=r.digestSync(),s=new Uint8Array(T);return s.set(n),s}if(t.byteLength<T){let r=new Uint8Array(T);return r.set(t),r}return t}hashBuffer(){this.hashBufferWith(this.state,this.buffer)}hashBufferWith(e,t){let r=this.w??=new Int32Array(64),n=e[0],s=e[1],o=e[2],i=e[3],a=e[4],c=e[5],u=e[6],d=e[7];for(let f=0;f<T;++f){if(f<16)r[f]=(t[f*4]&255)<<24|(t[f*4+1]&255)<<16|(t[f*4+2]&255)<<8|t[f*4+3]&255;else{let p=r[f-2],g=(p>>>17|p<<15)^(p>>>19|p<<13)^p>>>10;p=r[f-15];let m=(p>>>7|p<<25)^(p>>>18|p<<14)^p>>>3;r[f]=(g+r[f-7]|0)+(m+r[f-16]|0)}let l=(((a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7))+(a&c^~a&u)|0)+(d+(ap[f]+r[f]|0)|0)|0,h=((n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10))+(n&s^n&o^s&o)|0;d=u,u=c,c=a,a=i+l|0,i=o,o=s,s=n,n=l+h|0}e[0]+=n,e[1]+=s,e[2]+=o,e[3]+=i,e[4]+=a,e[5]+=c,e[6]+=u,e[7]+=d}}var Ds=new Int32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),ap=new Int32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),cp=(()=>{try{return Ae("sha256"),!0}catch{return!1}})(),zs=cp?fp():P;function fp(){return class{digestLength=32;secret;hash;isHmac;finished=!1;constructor(t){this.secret=t,this.isHmac=!!t,this.hash=this.createHash()}update(t){if(this.finished)throw Error("Attempted to update an already finished hash.");this.hash.update(t)}async digest(){let t;if(this.isHmac)this.finished=!0,t=this.hash.digest();else t=this.hash.copy().digest();return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}reset(){this.hash=this.createHash(),this.finished=!1}createHash(){return this.secret?Qh("sha256",up(this.secret)):Ae("sha256")}}}function up(e){if(typeof e==="string")return e;if(ArrayBuffer.isView(e))return Buffer.from(e.buffer,e.byteOffset,e.byteLength);return Buffer.from(e)}var{digest:lp,sign:dp,importKey:hp}=globalThis?.crypto?.subtle??{},it=typeof lp==="function"&&typeof dp==="function"&&typeof hp==="function"?globalThis.crypto.subtle:void 0,pp=8388608;class Hs{digestLength=32;secret;pending=[];pendingBytes=0;fallback;finished=!1;constructor(e){if(e)this.secret=oe(e)}update(e){if(this.finished)throw Error("Attempted to update an already finished HMAC.");if(this.fallback){this.fallback.update(e);return}if(this.pending.push(e.slice()),this.pendingBytes+=e.byteLength,this.pendingBytes>=pp)this.switchToFallback()}async digest(){if(this.fallback)return this.fallback.digest();if(this.secret&&this.finished)throw Error("Attempted to digest an already finished HMAC.");let e=Kh(this.pending);if(it){if(this.secret){this.finished=!0;let n=await it.importKey("raw",this.secret,{name:"HMAC",hash:"SHA-256"},!1,["sign"]),s=await it.sign("HMAC",n,e);return new Uint8Array(s)}let r=await it.digest("SHA-256",e);return new Uint8Array(r)}let t=new P(this.secret);return t.update(e),t.digest()}reset(){this.pending=[],this.pendingBytes=0,this.fallback=void 0,this.finished=!1}switchToFallback(){let e=new P(this.secret);for(let t of this.pending)e.update(t);this.fallback=e,this.pending=[],this.pendingBytes=0}}mp.Crc32=Bs;mp.Crc32Js=ar;mp.Crc32Node=Bs;mp.Md5=Fs;mp.Md5Js=ir;mp.Md5Node=Fs;mp.Sha256=zs;mp.Sha256Js=P;mp.Sha256Node=zs;mp.Sha256WebCrypto=Hs;mp.blobHasher=Xh;mp.blobReader=Ps;mp.fileStreamHasher=Zh;mp.readableStreamHasher=ep});var Zc=w(function(Yp){var{Crc32:Ws}=xo(),{hasOwn:ct}=wo(),{toHex:ie,fromHex:vp,toUtf8:Rp,fromUtf8:Mp}=er(),{Readable:$p}=V("stream"),{TypeRegistry:Up}=wn();class ae{bytes;constructor(e){if(this.bytes=e,e.byteLength!==8)throw Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(e){if(e>9223372036854776000||e<-9223372036854776000)throw Error(`${e} is too large (or, if negative, too small) to represent as an Int64`);let t=new Uint8Array(8);for(let r=7,n=Math.abs(Math.round(e));r>-1&&n>0;r--,n/=256)t[r]=n;if(e<0)Vs(t);return new ae(t)}valueOf(){let e=this.bytes.slice(0),t=e[0]&128;if(t)Vs(e);return parseInt(ie(e),16)*(t?-1:1)}toString(){return String(this.valueOf())}}function Vs(e){for(let t=0;t<8;t++)e[t]^=255;for(let t=7;t>-1;t--)if(e[t]++,e[t]!==0)break}class cr{toUtf8;fromUtf8;constructor(e,t){this.toUtf8=e,this.fromUtf8=t}format(e){let t=[];for(let s in e){if(!ct(e,s))continue;let o=this.fromUtf8(s);t.push(Uint8Array.from([o.byteLength]),o,this.formatHeaderValue(e[s]))}let r=new Uint8Array(t.reduce((s,o)=>s+o.byteLength,0)),n=0;for(let s of t)r.set(s,n),n+=s.byteLength;return r}formatHeaderValue(e){switch(e.type){case"boolean":return Uint8Array.from([e.value?0:1]);case"byte":return Uint8Array.from([2,e.value]);case"short":let t=new DataView(new ArrayBuffer(3));return t.setUint8(0,3),t.setInt16(1,e.value,!1),new Uint8Array(t.buffer);case"integer":let r=new DataView(new ArrayBuffer(5));return r.setUint8(0,4),r.setInt32(1,e.value,!1),new Uint8Array(r.buffer);case"long":let n=new Uint8Array(9);return n[0]=5,n.set(e.value.bytes,1),n;case"binary":let s=new DataView(new ArrayBuffer(3+e.value.byteLength));s.setUint8(0,6),s.setUint16(1,e.value.byteLength,!1);let o=new Uint8Array(s.buffer);return o.set(e.value,3),o;case"string":let i=this.fromUtf8(e.value),a=new DataView(new ArrayBuffer(3+i.byteLength));a.setUint8(0,7),a.setUint16(1,i.byteLength,!1);let c=new Uint8Array(a.buffer);return c.set(i,3),c;case"timestamp":let u=new Uint8Array(9);return u[0]=8,u.set(ae.fromNumber(e.value.valueOf()).bytes,1),u;case"uuid":if(!Vp.test(e.value))throw Error(`Invalid UUID received: ${e.value}`);let d=new Uint8Array(17);return d[0]=9,d.set(vp(e.value.replace(/-/g,"")),1),d}}parse(e){let t={},r=0;while(r<e.byteLength){let n=e.getUint8(r++),s=this.toUtf8(new Uint8Array(e.buffer,e.byteOffset+r,n));switch(r+=n,e.getUint8(r++)){case 0:t[s]={type:js,value:!0};break;case 1:t[s]={type:js,value:!1};break;case 2:t[s]={type:Lp,value:e.getInt8(r++)};break;case 3:t[s]={type:Dp,value:e.getInt16(r,!1)},r+=2;break;case 4:t[s]={type:Pp,value:e.getInt32(r,!1)},r+=4;break;case 5:t[s]={type:Fp,value:new ae(new Uint8Array(e.buffer,e.byteOffset+r,8))},r+=8;break;case 6:let o=e.getUint16(r,!1);r+=2,t[s]={type:kp,value:new Uint8Array(e.buffer,e.byteOffset+r,o)},r+=o;break;case 7:let i=e.getUint16(r,!1);r+=2,t[s]={type:Bp,value:this.toUtf8(new Uint8Array(e.buffer,e.byteOffset+r,i))},r+=i;break;case 8:t[s]={type:zp,value:new Date(new ae(new Uint8Array(e.buffer,e.byteOffset+r,8)).valueOf())},r+=8;break;case 9:let a=new Uint8Array(e.buffer,e.byteOffset+r,16);r+=16,t[s]={type:Hp,value:`${ie(a.subarray(0,4))}-${ie(a.subarray(4,6))}-${ie(a.subarray(6,8))}-${ie(a.subarray(8,10))}-${ie(a.subarray(10))}`};break;default:throw Error("Unrecognized header type tag")}}return t}}var qs;(function(e){e[e.boolTrue=0]="boolTrue",e[e.boolFalse=1]="boolFalse",e[e.byte=2]="byte",e[e.short=3]="short",e[e.integer=4]="integer",e[e.long=5]="long",e[e.byteArray=6]="byteArray",e[e.string=7]="string",e[e.timestamp=8]="timestamp",e[e.uuid=9]="uuid"})(qs||(qs={}));var js="boolean",Lp="byte",Dp="short",Pp="integer",Fp="long",kp="binary",Bp="string",zp="timestamp",Hp="uuid",Vp=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/,Gs=4,q=Gs*2,J=4,qp=q+J*2;function jp({byteLength:e,byteOffset:t,buffer:r}){if(e<qp)throw Error("Provided message too short to accommodate event stream message overhead");let n=new DataView(r,t,e),s=n.getUint32(0,!1);if(e!==s)throw Error("Reported message length does not match received message length");let o=n.getUint32(Gs,!1),i=n.getUint32(q,!1),a=n.getUint32(e-J,!1),c=new Ws;if(c.update(new Uint8Array(r,t,q)),i!==c.digestSync())throw Error(`The prelude checksum specified in the message (${i}) does not match the calculated CRC32 checksum (${c.digestSync()})`);if(c.update(new Uint8Array(r,t+q,e-(q+J))),a!==c.digestSync())throw Error(`The message checksum (${c.digestSync()}) did not match the expected value of ${a}`);return{headers:new DataView(r,t+q+J,o),body:new Uint8Array(r,t+q+J+o,s-o-(q+J+J))}}class fr{headerMarshaller;messageBuffer;isEndOfStream;constructor(e,t){this.headerMarshaller=new cr(e,t),this.messageBuffer=[],this.isEndOfStream=!1}feed(e){this.messageBuffer.push(this.decode(e))}endOfStream(){this.isEndOfStream=!0}getMessage(){let e=this.messageBuffer.pop(),t=this.isEndOfStream;return{getMessage(){return e},isEndOfStream(){return t}}}getAvailableMessages(){let e=this.messageBuffer;this.messageBuffer=[];let t=this.isEndOfStream;return{getMessages(){return e},isEndOfStream(){return t}}}encode({headers:e,body:t}){let r=this.headerMarshaller.format(e),n=r.byteLength+t.byteLength+16,s=new Uint8Array(n),o=new DataView(s.buffer,s.byteOffset,s.byteLength),i=new Ws;return o.setUint32(0,n,!1),o.setUint32(4,r.byteLength,!1),i.update(s.subarray(0,8)),o.setUint32(8,i.digestSync(),!1),s.set(r,12),s.set(t,r.byteLength+12),i.update(s.subarray(8,n-4)),o.setUint32(n-4,i.digestSync(),!1),s}decode(e){let{headers:t,body:r}=jp(e);return{headers:this.headerMarshaller.parse(t),body:r}}formatHeaders(e){return this.headerMarshaller.format(e)}}class ur{options;constructor(e){this.options=e}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let e of this.options.inputStream)yield this.options.decoder.decode(e)}}class lr{options;constructor(e){this.options=e}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let e of this.options.messageStream)yield this.options.encoder.encode(e);if(this.options.includeEndFrame)yield new Uint8Array(0)}}class dr{options;constructor(e){this.options=e}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let e of this.options.messageStream){let t=await this.options.deserializer(e);if(t===void 0)continue;yield t}}}class hr{options;constructor(e){this.options=e}[Symbol.asyncIterator](){return this.asyncIterator()}async*asyncIterator(){for await(let e of this.options.inputStream)yield this.options.serializer(e)}}function Js(e){let t=0,r=0,n=null,s=null,o=(a)=>{if(typeof a!=="number")throw Error("Attempted to allocate an event message where size was not a number: "+a);t=a,r=4,n=new Uint8Array(a),new DataView(n.buffer).setUint32(0,a,!1)},i=async function*(){let a=e[Symbol.asyncIterator]();while(!0){let{value:c,done:u}=await a.next();if(u){if(!t)return;else if(t===r)yield n;else throw Error("Truncated event message received.");return}let d=c.length,f=0;while(f<d){if(!n){let h=d-f;if(!s)s=new Uint8Array(4);let p=Math.min(4-r,h);if(s.set(c.slice(f,f+p),r),r+=p,f+=p,r<4)break;o(new DataView(s.buffer).getUint32(0,!1)),s=null}let l=Math.min(t-r,d-f);if(n.set(c.slice(f,f+l),r),r+=l,f+=l,t&&t===r)yield n,n=null,t=0,r=0}}};return{[Symbol.asyncIterator]:i}}function Wp(e,t){let r=pr(t.deserializer,t.toUtf8);return{[Symbol.asyncIterator]:async function*(){for await(let n of e){let s=t.eventStreamCodec.decode(n),o=await r(s);if(o===void 0)continue;yield o}}}}function pr(e,t){return async function(r){let{value:n}=r.headers[":message-type"];if(n==="error"){let s=Error(r.headers[":error-message"].value||"UnknownError");throw s.name=r.headers[":error-code"].value,s}else if(n==="exception"){let s=r.headers[":exception-type"].value,o={[s]:r},i=await e(o);if(i.$unknown){let a=Error(t(r.body));throw a.name=s,a}throw i[s]}else if(n==="event"){let s={[r.headers[":event-type"].value]:r},o=await e(s);if(o.$unknown)return;return o}else throw Error(`Unrecognizable event type: ${r.headers[":event-type"].value}`)}}var mr=class{eventStreamCodec;utfEncoder;constructor({utf8Encoder:t,utf8Decoder:r}){this.eventStreamCodec=new fr(t,r),this.utfEncoder=t}deserialize(t,r){let n=Js(t);return new dr({messageStream:new ur({inputStream:n,decoder:this.eventStreamCodec}),deserializer:pr(r,this.utfEncoder)})}serialize(t,r){return new lr({messageStream:new hr({inputStream:t,serializer:r}),encoder:this.eventStreamCodec,includeEndFrame:!0})}},Gp=(e)=>new mr(e);class gr{universalMarshaller;constructor({utf8Encoder:e,utf8Decoder:t}){this.universalMarshaller=new mr({utf8Decoder:t,utf8Encoder:e})}deserialize(e,t){let r=typeof e[Symbol.asyncIterator]==="function"?e:Kp(e);return this.universalMarshaller.deserialize(r,t)}serialize(e,t){return $p.from(this.universalMarshaller.serialize(e,t))}}var Jp=(e)=>new gr(e);async function*Kp(e){let t=!1,r=!1,n=[];e.on("error",(s)=>{if(!t)t=!0;if(s)throw s}),e.on("data",(s)=>{n.push(s)}),e.on("end",()=>{t=!0});while(!r){let s=await new Promise((o)=>setTimeout(()=>o(n.shift()),0));if(s)yield s;r=t&&n.length===0}}var Qp=(e)=>({[Symbol.asyncIterator]:async function*(){let t=e.getReader();try{while(!0){let{done:r,value:n}=await t.read();if(r)return;yield n}}finally{t.releaseLock()}}}),Xp=(e)=>{let t=e[Symbol.asyncIterator]();return new ReadableStream({async pull(r){let{done:n,value:s}=await t.next();if(n)return r.close();r.enqueue(s)}})},Zp=(e)=>Object.assign(e,{eventStreamMarshaller:e.eventStreamSerdeProvider(e)});class Ks{marshaller;serializer;deserializer;serdeContext;defaultContentType;compositeErrorRegistry;constructor({marshaller:e,serializer:t,deserializer:r,serdeContext:n,defaultContentType:s,compositeErrorRegistry:o}){this.marshaller=e,this.serializer=t,this.deserializer=r,this.serdeContext=n,this.defaultContentType=s,this.compositeErrorRegistry=o}async serializeEventStream({eventStream:e,requestSchema:t,initialRequest:r,initialMessageType:n}){let s=this.marshaller,o=t.getEventStreamMember(),i=t.getMemberSchema(o),a=this.serializer,c=this.defaultContentType,u=Symbol("initialRequestMarker"),d={async*[Symbol.asyncIterator](){if(r){let f={":event-type":{type:"string",value:n??"initial-request"},":message-type":{type:"string",value:"event"},":content-type":{type:"string",value:c}};a.write(t,r);let l=a.flush();yield{[u]:!0,headers:f,body:l}}for await(let f of e)yield f}};return s.serialize(d,(f)=>{if(f[u])return{headers:f.headers,body:f.body};let l="";for(let b in f){if(!ct(f,b))continue;if(b!=="__type"){l=b;break}}let{additionalHeaders:h,body:p,eventType:g,explicitPayloadContentType:m}=this.writeEventBody(l,i,f);return{headers:{":event-type":{type:"string",value:g},":message-type":{type:"string",value:"event"},":content-type":{type:"string",value:m??c},...h},body:p}})}async deserializeEventStream({response:e,responseSchema:t,initialResponseContainer:r,initialMessageType:n}){let s=this.marshaller,o=t.getEventStreamMember(),a=t.getMemberSchema(o).getMemberSchemas(),c=Symbol("initialResponseMarker"),u=s.deserialize(e.body,async(l)=>{let h="";for(let g in l){if(!ct(l,g))continue;if(g!=="__type"){h=g;break}}let p=l[h].body;if(h===(n??"initial-response")){let g=await this.deserializer.read(t,p);return delete g[o],{[c]:!0,...g}}else if(h in a){let g=a[h];if(g.isStructSchema()){let m={},y=!1;for(let[b,S]of g.structIterator()){let{eventHeader:x,eventPayload:F}=S.getMergedTraits();if(y=y||Boolean(x||F),F){if(S.isBlobSchema())m[b]=p;else if(S.isStringSchema())m[b]=(this.serdeContext?.utf8Encoder??Rp)(p);else if(S.isStructSchema())m[b]=await this.deserializer.read(S,p)}else if(x){let N=l[h].headers[b]?.value;if(N!=null)if(S.isNumericSchema())if(N&&typeof N==="object"&&"bytes"in N)m[b]=BigInt(N.toString());else m[b]=Number(N);else m[b]=N}}return{[h]:await this.readEventMember(g,p,y,m)}}return{[h]:await this.deserializer.read(g,p)}}else return{$unknown:l}}),d=u[Symbol.asyncIterator](),f=await d.next();if(f.done)return u;if(f.value?.[c]){if(!t)throw Error("@smithy::core/protocols - initial-response event encountered in event stream but no response schema given.");for(let l in f.value){if(!ct(f.value,l))continue;r[l]=f.value[l]}}return{async*[Symbol.asyncIterator](){if(!f?.value?.[c])yield f.value;while(!0){let{done:l,value:h}=await d.next();if(l)break;yield h}}}}async readEventMember(e,t,r,n){let s,o=e.getSchema();if(Array.isArray(o)&&o[0]===-3){let a=o[1],c=Up.for(a);this.compositeErrorRegistry?.copyFrom(c),s=(this.compositeErrorRegistry??c)?.getErrorCtor(o)}let i=r?n:t.byteLength===0?{}:await this.deserializer.read(e,t);if(s){let a=i.message??i.Message??"Unknown",c={},u=e.getMergedTraits().error;if(u)c.$fault=u;return Object.assign(new s({}),c,{message:a},i)}return i}writeEventBody(e,t,r){let n=this.serializer,s=e,o=null,i,a=(()=>t.getSchema()[4].includes(e))(),c={};if(!a){let[f,l]=r[e];s=f,n.write(15,l)}else{let f=t.getMemberSchema(e);if(f.isStructSchema()){for(let[l,h]of f.structIterator()){let{eventHeader:p,eventPayload:g}=h.getMergedTraits();if(g)o=l;else if(p){let m=r[e][l],y="binary";if(h.isNumericSchema())if(-2147483648<=m&&m<=2147483647)y="integer";else y="long";else if(h.isTimestampSchema())y="timestamp";else if(h.isStringSchema())y="string";else if(h.isBooleanSchema())y="boolean";if(m!=null)c[l]={type:y,value:m},delete r[e][l]}}if(o!==null){let l=f.getMemberSchema(o);if(l.isBlobSchema())i="application/octet-stream";else if(l.isStringSchema())i="text/plain";n.write(l,r[e][o])}else n.write(f,r[e])}else if(f.isUnitSchema())n.write(f,{});else throw Error("@smithy/core/event-streams - non-struct member not supported in event stream union.")}let u=n.flush()??new Uint8Array;return{body:typeof u==="string"?(this.serdeContext?.utf8Decoder??Mp)(u):u,eventType:s,explicitPayloadContentType:i,additionalHeaders:c}}}Yp.EventStreamCodec=fr;Yp.EventStreamMarshaller=gr;Yp.EventStreamSerde=Ks;Yp.HeaderMarshaller=cr;Yp.Int64=ae;Yp.MessageDecoderStream=ur;Yp.MessageEncoderStream=lr;Yp.SmithyMessageDecoderStream=dr;Yp.SmithyMessageEncoderStream=hr;Yp.UniversalEventStreamMarshaller=mr;Yp.eventStreamSerdeProvider=Jp;Yp.getChunkedStream=Js;Yp.getMessageUnmarshaller=pr;Yp.getUnmarshalledStream=Wp;Yp.iterableToReadableStream=Xp;Yp.readableStreamToIterable=Qp;Yp.resolveEventStreamSerdeConfig=Zp;Yp.universalEventStreamSerdeProvider=Gp});var Ht=w(function(km){var{Uint8ArrayBlobAdapter:yr,sdkStreamMixin:bm,splitEvery:wm,splitHeader:Ys,fromBase64:Qs,_parseEpochTimestamp:Sm,_parseRfc7231DateTime:xm,_parseRfc3339DateTimeWithOffset:Em,LazyJsonString:eo,NumericValue:Tm,toUtf8:to,fromUtf8:Cm,generateIdempotencyToken:Im,toBase64:Xs,dateToUtcString:Nm,quoteHeader:Om}=er(),{HttpRequest:ce,HttpResponse:ro,hasOwn:K,isValidHostname:no}=wo(),{parseQueryString:Am,parseUrl:_m}=wo();km.HttpRequest=ce;km.HttpResponse=ro;km.isValidHostname=no;km.parseQueryString=Am;km.parseUrl=_m;var{TypeRegistry:vm,NormalizedSchema:R,translateTraits:so}=wn(),{FieldPosition:Rm}=Ca(),Q=async(e=new Uint8Array,t)=>{if(e instanceof Uint8Array)return yr.mutate(e);if(!e)return yr.mutate(new Uint8Array);let r=t.streamCollector(e);return yr.mutate(await r)};function ve(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})}class fe{serdeContext;setSerdeContext(e){this.serdeContext=e}}class ft extends fe{options;compositeErrorRegistry;constructor(e){super();this.options=e,this.compositeErrorRegistry=vm.for(e.defaultNamespace);for(let t of e.errorTypeRegistries??[])this.compositeErrorRegistry.copyFrom(t)}getRequestType(){return ce}getResponseType(){return ro}setSerdeContext(e){if(this.serdeContext=e,this.serializer.setSerdeContext(e),this.deserializer.setSerdeContext(e),this.getPayloadCodec())this.getPayloadCodec().setSerdeContext(e)}updateServiceEndpoint(e,t){if("url"in t){if(e.protocol=t.url.protocol,e.hostname=t.url.hostname,e.port=t.url.port?Number(t.url.port):void 0,e.path=t.url.pathname,e.fragment=t.url.hash||void 0,e.username=t.url.username||void 0,e.password=t.url.password||void 0,!e.query)e.query={};for(let[r,n]of t.url.searchParams.entries())e.query[r]=n;if(t.headers)for(let r in t.headers){if(!K(t.headers,r))continue;e.headers[r]=t.headers[r].join(", ")}return e}else{if(e.protocol=t.protocol,e.hostname=t.hostname,e.port=t.port?Number(t.port):void 0,e.path=t.path,e.query={...t.query},t.headers)for(let r in t.headers){if(!K(t.headers,r))continue;e.headers[r]=t.headers[r]}return e}}setHostPrefix(e,t,r){if(this.serdeContext?.disableHostPrefix)return;let n=R.of(t.input),s=so(t.traits??{});if(s.endpoint){let o=s.endpoint?.[0];if(typeof o==="string"){for(let[i,a]of n.structIterator()){if(!a.getMergedTraits().hostLabel)continue;let c=r[i];if(typeof c!=="string")throw Error(`@smithy/core/schema - ${i} in input must be a string as hostLabel.`);o=o.replace(`{${i}}`,c)}if(e.hostname=o+e.hostname,!no(e.hostname))throw Error(`[${e.hostname}] is not a valid hostname.`)}}}deserializeMetadata(e){return{httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]}}async serializeEventStream({eventStream:e,requestSchema:t,initialRequest:r}){return(await this.loadEventStreamCapability()).serializeEventStream({eventStream:e,requestSchema:t,initialRequest:r})}async deserializeEventStream({response:e,responseSchema:t,initialResponseContainer:r}){return(await this.loadEventStreamCapability()).deserializeEventStream({response:e,responseSchema:t,initialResponseContainer:r})}async loadEventStreamCapability(){let{EventStreamSerde:e,eventStreamSerdeProvider:t}=Zc(),r=this.resolveEventStreamMarshaller(t);return new e({marshaller:r,serializer:this.serializer,deserializer:this.deserializer,serdeContext:this.serdeContext,defaultContentType:this.getDefaultContentType(),compositeErrorRegistry:this.compositeErrorRegistry})}resolveEventStreamMarshaller(e){let t=this.serdeContext;if(t.eventStreamMarshaller)return t.eventStreamMarshaller;return e(this.serdeContext)}getDefaultContentType(){throw Error(`@smithy/core/protocols - ${this.constructor.name} getDefaultContentType() implementation missing.`)}async deserializeHttpMessage(e,t,r,n,s){return[]}getEventStreamMarshaller(){let e=this.serdeContext;if(!e.eventStreamMarshaller)throw Error("@smithy/core - HttpProtocol: eventStreamMarshaller missing in serdeContext.");return e.eventStreamMarshaller}}class oo extends ft{async serializeRequest(e,t,r){let n=t&&typeof t==="object"?t:{},s=this.serializer,o={},i={},a=await r.endpoint(),c=R.of(e?.input),u=[],d=[],f=!1,l,h=new ce({protocol:"",hostname:"",port:void 0,path:"",fragment:void 0,query:o,headers:i,body:void 0});if(a){this.updateServiceEndpoint(h,a),this.setHostPrefix(h,e,n);let p=so(e.traits);if(p.http){h.method=p.http[0];let[g,m]=p.http[1].split("?");if(h.path=="/")h.path=g;else h.path+=g;let y=new URLSearchParams(m??"");for(let[b,S]of y)o[b]=S}}for(let[p,g]of c.structIterator()){let m=g.getMergedTraits()??{},y=n[p];if(y==null&&!g.isIdempotencyToken()){if(m.httpLabel){if(h.path.includes(`{${p}+}`)||h.path.includes(`{${p}}`))throw Error(`No value provided for input HTTP label: ${p}.`)}continue}if(m.httpPayload)if(g.isStreaming())if(g.isStructSchema()){if(n[p])l=await this.serializeEventStream({eventStream:n[p],requestSchema:c})}else l=y;else s.write(g,y),l=s.flush();else if(m.httpLabel){s.write(g,y);let b=s.flush();if(h.path.includes(`{${p}+}`))h.path=h.path.replace(`{${p}+}`,b.split("/").map(ve).join("/"));else if(h.path.includes(`{${p}}`))h.path=h.path.replace(`{${p}}`,ve(b))}else if(m.httpHeader)s.write(g,y),i[m.httpHeader.toLowerCase()]=String(s.flush());else if(typeof m.httpPrefixHeaders==="string")for(let b in y){if(!K(y,b))continue;let S=y[b],x=m.httpPrefixHeaders+b;s.write([g.getValueSchema(),{httpHeader:x}],S),i[x.toLowerCase()]=s.flush()}else if(m.httpQuery||m.httpQueryParams)this.serializeQuery(g,y,o);else f=!0,u.push(p),d.push(g)}if(f&&n){let[p,g]=(c.getName(!0)??"#Unknown").split("#"),m=c.getSchema()[6],y=[3,p,g,c.getMergedTraits(),u,d,void 0];if(m)y[6]=m;else y.pop();s.write(y,n),l=s.flush()}return h.headers=i,h.query=o,h.body=l,h}serializeQuery(e,t,r){let n=this.serializer,s=e.getMergedTraits();if(s.httpQueryParams){for(let o in t){if(!K(t,o))continue;if(!(o in r)){let i=t[o],a=e.getValueSchema();Object.assign(a.getMergedTraits(),{...s,httpQuery:o,httpQueryParams:void 0}),this.serializeQuery(a,i,r)}}return}if(e.isListSchema()){let o=!!e.getMergedTraits().sparse,i=[];for(let a of t){n.write([e.getValueSchema(),s],a);let c=n.flush();if(o||c!==void 0)i.push(c)}r[s.httpQuery]=i}else n.write([e,s],t),r[s.httpQuery]=n.flush()}async deserializeResponse(e,t,r){let n=this.deserializer,s=R.of(e.output),o={};if(r.statusCode>=300){let a=await Q(r.body,t);if(a.byteLength>0)Object.assign(o,await n.read(15,a));throw await this.handleError(e,t,r,o,this.deserializeMetadata(r)),Error("@smithy/core/protocols - HTTP Protocol error handler failed to throw.")}for(let a in r.headers){if(!K(r.headers,a))continue;let c=r.headers[a];delete r.headers[a],r.headers[a.toLowerCase()]=c}let i=await this.deserializeHttpMessage(s,t,r,o);if(i.length){let a=await Q(r.body,t);if(a.byteLength>0){let c=await n.read(s,a);for(let u of i)if(c[u]!=null)o[u]=c[u]}}else if(i.discardResponseBody)await Q(r.body,t);return o.$metadata=this.deserializeMetadata(r),o}async deserializeHttpMessage(e,t,r,n,s){let o;if(n instanceof Set)o=s;else o=n;let i=!0,a=this.deserializer,c=R.of(e),u=[];for(let[d,f]of c.structIterator()){let l=f.getMemberTraits();if(l.httpPayload){if(i=!1,f.isStreaming())if(f.isStructSchema())o[d]=await this.deserializeEventStream({response:r,responseSchema:c});else o[d]=bm(r.body);else if(r.body){let p=await Q(r.body,t);if(p.byteLength>0)o[d]=await a.read(f,p)}}else if(l.httpHeader){let h=String(l.httpHeader).toLowerCase(),p=r.headers[h];if(p!=null)if(f.isListSchema()){let g=f.getValueSchema();g.getMergedTraits().httpHeader=h;let m;if(g.isTimestampSchema()&&g.getSchema()===4)m=wm(p,",",2);else m=Ys(p);let y=[];for(let b of m)y.push(await a.read(g,b.trim()));o[d]=y}else o[d]=await a.read(f,p)}else if(l.httpPrefixHeaders!==void 0){o[d]={};for(let h in r.headers){if(!K(r.headers,h))continue;if(h.startsWith(l.httpPrefixHeaders)){let p=r.headers[h],g=f.getValueSchema();g.getMergedTraits().httpHeader=h,o[d][h.slice(l.httpPrefixHeaders.length)]=await a.read(g,p)}}}else if(l.httpResponseCode)o[d]=r.statusCode;else u.push(d)}return u.discardResponseBody=i,u}}class io extends ft{async serializeRequest(e,t,r){let n=this.serializer,s={},o={},i=await r.endpoint(),a=R.of(e?.input),c=a.getSchema(),u,d=t&&typeof t==="object"?t:{},f=new ce({protocol:"",hostname:"",port:void 0,path:"/",fragment:void 0,query:s,headers:o,body:void 0});if(i)this.updateServiceEndpoint(f,i),this.setHostPrefix(f,e,d);if(d){let l=a.getEventStreamMember();if(l){if(d[l]){let h={};for(let[p]of a.structIterator())if(p!==l&&d[p]!=null)h[p]=d[p];u=await this.serializeEventStream({eventStream:d[l],requestSchema:a,initialRequest:h})}}else n.write(c,d),u=n.flush()}return f.headers=Object.assign(f.headers,o),f.query=s,f.body=u,f.method="POST",f}async deserializeResponse(e,t,r){let n=this.deserializer,s=R.of(e.output),o={};if(r.statusCode>=300){let a=await Q(r.body,t);if(a.byteLength>0)Object.assign(o,await n.read(15,a));throw await this.handleError(e,t,r,o,this.deserializeMetadata(r)),Error("@smithy/core/protocols - RPC Protocol error handler failed to throw.")}for(let a in r.headers){if(!K(r.headers,a))continue;let c=r.headers[a];delete r.headers[a],r.headers[a.toLowerCase()]=c}let i=s.getEventStreamMember();if(i)o[i]=await this.deserializeEventStream({response:r,responseSchema:s,initialResponseContainer:o});else{let a=await Q(r.body,t);if(a.byteLength>0)Object.assign(o,await n.read(s,a))}return o.$metadata=this.deserializeMetadata(r),o}}var ao=(e,t,r,n,s,o)=>{if(t!=null&&t[r]!==void 0){let i=n();if(i==null||i.length<=0)throw Error("Empty value provided for input HTTP label: "+r+".");e=e.replace(s,o?i.split("/").map((a)=>ve(a)).join("/"):ve(i))}else throw Error("No value provided for input HTTP label: "+r+".");return e};function Mm(e,t){return new br(e,t)}class br{input;context;query={};method="";headers={};path="";body=null;hostname="";resolvePathStack=[];constructor(e,t){this.input=e,this.context=t}async build(){let{hostname:e,protocol:t="https",port:r,path:n}=await this.context.endpoint();this.path=n;for(let s of this.resolvePathStack)s(this.path);return new ce({protocol:t,hostname:this.hostname||e,port:r,method:this.method,path:this.path,query:this.query,body:this.body,headers:this.headers})}hn(e){return this.hostname=e,this}bp(e){return this.resolvePathStack.push((t)=>{this.path=`${t?.endsWith("/")?t.slice(0,-1):t||""}`+e}),this}p(e,t,r,n){return this.resolvePathStack.push((s)=>{this.path=ao(s,this.input,e,t,r,n)}),this}h(e){return this.headers=e,this}q(e){return this.query=e,this}b(e){return this.body=e,this}m(e){return this.method=e,this}}function wr(e,t){if(t.timestampFormat.useTrait){if(e.isTimestampSchema()&&(e.getSchema()===5||e.getSchema()===6||e.getSchema()===7))return e.getSchema()}let{httpLabel:r,httpPrefixHeaders:n,httpHeader:s,httpQuery:o}=e.getMergedTraits();return(t.httpBindings?typeof n==="string"||Boolean(s)?6:Boolean(o)||Boolean(r)?5:void 0:void 0)??t.timestampFormat.default}class Sr extends fe{settings;constructor(e){super();this.settings=e}read(e,t){let r=R.of(e);if(r.isListSchema())return Ys(t).map((n)=>this.read(r.getValueSchema(),n));if(r.isBlobSchema())return(this.serdeContext?.base64Decoder??Qs)(t);if(r.isTimestampSchema())switch(wr(r,this.settings)){case 5:return Em(t);case 6:return xm(t);case 7:return Sm(t);default:return console.warn("Missing timestamp format, parsing value with Date constructor:",t),new Date(t)}if(r.isStringSchema()){let n=r.getMergedTraits().mediaType,s=t;if(n){if(r.getMergedTraits().httpHeader)s=this.base64ToUtf8(s);if(n==="application/json"||n.endsWith("+json"))s=eo.from(s);return s}}if(r.isNumericSchema())return Number(t);if(r.isBigIntegerSchema())return BigInt(t);if(r.isBigDecimalSchema())return new Tm(t,"bigDecimal");if(r.isBooleanSchema())return String(t).toLowerCase()==="true";return t}base64ToUtf8(e){return(this.serdeContext?.utf8Encoder??to)((this.serdeContext?.base64Decoder??Qs)(e))}}class co extends fe{codecDeserializer;stringDeserializer;constructor(e,t){super();this.codecDeserializer=e,this.stringDeserializer=new Sr(t)}setSerdeContext(e){this.stringDeserializer.setSerdeContext(e),this.codecDeserializer.setSerdeContext(e),this.serdeContext=e}read(e,t){let r=R.of(e),n=r.getMergedTraits(),s=this.serdeContext?.utf8Encoder??to;if(n.httpHeader||n.httpResponseCode)return this.stringDeserializer.read(r,s(t));if(n.httpPayload){if(r.isBlobSchema()){let o=this.serdeContext?.utf8Decoder??Cm;if(typeof t==="string")return o(t);return t}else if(r.isStringSchema()){if("byteLength"in t)return s(t);return t}}return this.codecDeserializer.read(r,t)}}class xr extends fe{settings;stringBuffer="";constructor(e){super();this.settings=e}write(e,t){let r=R.of(e);switch(typeof t){case"object":if(t===null){this.stringBuffer="null";return}if(r.isTimestampSchema()){if(!(t instanceof Date))throw Error(`@smithy/core/protocols - received non-Date value ${t} when schema expected Date in ${r.getName(!0)}`);switch(wr(r,this.settings)){case 5:this.stringBuffer=t.toISOString().replace(".000Z","Z");break;case 6:this.stringBuffer=Nm(t);break;case 7:this.stringBuffer=String(t.getTime()/1000);break;default:console.warn("Missing timestamp format, using epoch seconds",t),this.stringBuffer=String(t.getTime()/1000)}return}if(r.isBlobSchema()&&"byteLength"in t){this.stringBuffer=(this.serdeContext?.base64Encoder??Xs)(t);return}if(r.isListSchema()&&Array.isArray(t)){let o="";for(let i of t){this.write([r.getValueSchema(),r.getMergedTraits()],i);let a=this.flush(),c=r.getValueSchema().isTimestampSchema()?a:Om(a);if(o!=="")o+=", ";o+=c}this.stringBuffer=o;return}this.stringBuffer=JSON.stringify(t,null,2);break;case"string":let n=r.getMergedTraits().mediaType,s=t;if(n){if(n==="application/json"||n.endsWith("+json"))s=eo.from(s);if(r.getMergedTraits().httpHeader){this.stringBuffer=(this.serdeContext?.base64Encoder??Xs)(s.toString());return}}this.stringBuffer=t;break;default:if(r.isIdempotencyToken())this.stringBuffer=Im();else this.stringBuffer=String(t)}}flush(){let e=this.stringBuffer;return this.stringBuffer="",e}}class fo{codecSerializer;stringSerializer;buffer;constructor(e,t,r=new xr(t)){this.codecSerializer=e,this.stringSerializer=r}setSerdeContext(e){this.codecSerializer.setSerdeContext(e),this.stringSerializer.setSerdeContext(e)}write(e,t){let r=R.of(e),n=r.getMergedTraits();if(n.httpHeader||n.httpLabel||n.httpQuery){this.stringSerializer.write(r,t),this.buffer=this.stringSerializer.flush();return}return this.codecSerializer.write(r,t)}flush(){if(this.buffer!==void 0){let e=this.buffer;return this.buffer=void 0,e}return this.codecSerializer.flush()}}class uo{name;kind;values;constructor({name:e,kind:t=Rm.HEADER,values:r=[]}){this.name=e,this.kind=t,this.values=r}add(e){this.values.push(e)}set(e){this.values=e}remove(e){this.values=this.values.filter((t)=>t!==e)}toString(){return this.values.map((e)=>e.includes(",")||e.includes(" ")?`"${e}"`:e).join(", ")}get(){return this.values}}class lo{entries={};encoding;constructor({fields:e=[],encoding:t="utf-8"}){e.forEach(this.setField.bind(this)),this.encoding=t}setField(e){this.entries[e.name.toLowerCase()]=e}getField(e){return this.entries[e.toLowerCase()]}removeField(e){delete this.entries[e.toLowerCase()]}getByType(e){return Object.values(this.entries).filter((t)=>t.kind===e)}}var $m=(e)=>{if(e.logger&&e.logger.constructor?.name!=="NoOpLogger")e.requestHandler?.updateHttpClientConfig?.(Symbol.for("logger"),e.logger);return{setHttpHandler(t){e.requestHandler=t},httpHandler(){return e.requestHandler},updateHttpClientConfig(t,r){e.requestHandler?.updateHttpClientConfig(t,r)},httpHandlerConfigs(){return e.requestHandler.httpHandlerConfigs()}}},Um=(e)=>({requestHandler:e.httpHandler()}),Zs="content-length";function ho(e){return(t)=>async(r)=>{let n=r.request;if(ce.isInstance(n)){let{body:s,headers:o}=n;if(s&&Object.keys(o).map((i)=>i.toLowerCase()).indexOf(Zs)===-1)try{let i=e(s);if(i!=null)n.headers={...n.headers,[Zs]:String(i)}}catch(i){}}return t({...r,request:n})}}var po={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0},Lm=(e)=>({applyToStack:(t)=>{t.add(ho(e.bodyLengthChecker),po)}}),_e=(e)=>encodeURIComponent(e).replace(/[!'()*]/g,Dm),Dm=(e)=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`,Pm=(e)=>e.split("/").map(_e).join("/");function Fm(e){let t=[];for(let r of Object.keys(e).sort()){let n=e[r];if(r=_e(r),Array.isArray(n))for(let s=0,o=n.length;s<o;s++)t.push(`${r}=${_e(n[s])}`);else{let s=r;if(n||typeof n==="string")s+=`=${_e(n)}`;t.push(s)}}return t.join("&")}km.Field=uo;km.Fields=lo;km.FromStringShapeDeserializer=Sr;km.HttpBindingProtocol=oo;km.HttpInterceptingShapeDeserializer=co;km.HttpInterceptingShapeSerializer=fo;km.HttpProtocol=ft;km.RequestBuilder=br;km.RpcProtocol=io;km.SerdeContext=fe;km.ToStringShapeSerializer=xr;km.buildQueryString=Fm;km.collectBody=Q;km.contentLengthMiddleware=ho;km.contentLengthMiddlewareOptions=po;km.determineTimestampFormat=wr;km.escapeUri=_e;km.escapeUriPath=Pm;km.extendedEncodeURIComponent=ve;km.getContentLengthPlugin=Lm;km.getHttpHandlerExtensionConfiguration=$m;km.requestBuilder=Mm;km.resolveHttpHandlerRuntimeConfig=Um;km.resolvedPath=ao});
18
- export{Ca,wo,wn,sr,Ge,nn,er,xo,Zc,Ht};
@@ -1 +0,0 @@
1
- import{m,N,u,E,L,t,o,G,B,pt,Pe,ze,g,O,Gn,Hs,Pa,S,Ce,Ie,Te,a0,h_,py,Hf,Qc,Gs,lx,Ml,KS,_C,dT,Sn,gt,Nt,M,Sr,ke,Gt,Tt,ym}from"./chunk-p1d500sf.js";import{Mr}from"./chunk-5aqthcm6.js";import{$l}from"./chunk-jq3pq545.js";import{tr}from"./chunk-qd7pvaxb.js";import{hn,gn,An,fr,Ye,Qe}from"./chunk-g78vapcm.js";import{mo}from"./chunk-fxtzy5f5.js";import{wr}from"./chunk-ht5rht98.js";E();var P=(a)=>{if(!a)return"??";return a.split(" ").map((i)=>i[0]).slice(0,2).join("").toUpperCase()};function H(){let{projectId:a}=R.useParams(),{teamId:i,ensureTeamIdForProject:d}=gt(),w=G(),k=Pe();m(()=>{d(a)},[a,d]);let{data:n}=tr(ym(a)),c=n?.rootFolder,[C,I]=u(240),{shareConfigLeftSidebarCollapsed:p,setShareConfigLeftSidebarCollapsed:T}=Gt(),{data:f,isLoading:j,fetchNextPage:b,hasNextPage:x,isFetchingNextPage:l}=pt({queryKey:["shares",a],queryFn:async({pageParam:e})=>{let r=await g.api.projects[":projectId"].shares.$get({param:{projectId:a},query:{first:"20",after:e}});if(!r.ok)throw Error("Failed to fetch share links");return await r.json()},initialPageParam:"",getNextPageParam:(e)=>e.pageInfo?.cursor||void 0,enabled:!!a}),{ref:_,inView:h}=Nt();m(()=>{if(h&&x&&!l)b()},[h,x,l,b]);let v=N(()=>f?.pages.flatMap((e)=>e.data)||[],[f]),{mutate:F}=B({mutationFn:async({id:e,isDisabled:r})=>{let s=await g.api.shares[":shareId"].$put({param:{shareId:e},json:{isDisabled:r}});if(!s.ok)throw Error("Failed to update share link");return await s.json()},onSuccess:()=>{w.invalidateQueries({queryKey:["shares",a]}),M.success(dT())},onError:(e)=>{M.error(Gs({message:e.message}))}});if(!i||!c||!n)return t(Tt,{});let y=async(e)=>{let r=`${window.location.origin}/share/${e}`;if(await mo(r))M.success(lx())};return t("div",{className:"flex flex-1 flex-col bg-background min-h-0",children:o("div",{className:"flex flex-1 overflow-hidden relative",children:[!p&&t("div",{className:"md:hidden fixed inset-0 bg-black/50 z-40",onClick:()=>T(!0)}),!p&&o(L,{children:[t("div",{className:"bg-background",style:{width:C},children:t(Sr,{teamId:i,projectId:a,projectName:n.name??"",rootFolderId:c})}),t(Mr,{onResize:(e)=>{I((r)=>Math.max(180,Math.min(400,r+e)))},className:"hidden md:block"})]}),o("div",{className:"flex-1 flex flex-col min-h-0 bg-card overflow-hidden",children:[t("header",{className:"h-14 border-b flex items-center justify-between px-6 shrink-0 bg-background/50 backdrop-blur-sm sticky top-0 z-10",children:o("div",{className:"flex items-center gap-2",children:[t(Pa,{className:"h-5 w-5 text-primary"}),t("h1",{className:"font-bold text-lg text-foreground",children:h_()})]})}),t("div",{className:"flex-1 overflow-y-auto p-6",children:j?t("div",{className:"flex justify-center items-center h-64",children:t("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"})}):v.length===0?o("div",{className:"flex flex-col items-center justify-center h-64 text-muted-foreground gap-3",children:[t(Hs,{className:"h-10 w-10 text-muted-foreground/50"}),t("p",{children:KS()})]}):o("div",{className:"border border-border rounded-xl bg-background overflow-hidden shadow-xs",children:[o(hn,{children:[t(gn,{children:o(fr,{className:"hover:bg-transparent bg-muted/20",children:[t(Ye,{className:"font-semibold px-4 py-3",children:Ml()}),t(Ye,{className:"font-semibold px-4 py-3",children:_C()}),t(Ye,{className:"font-semibold px-4 py-3",children:Qc()}),t(Ye,{className:"font-semibold px-4 py-3 w-[150px]",children:Hf()}),t(Ye,{className:"font-semibold px-4 py-3 text-right w-[120px]",children:a0()})]})}),t(An,{children:v.map((e)=>{let r=`${window.location.origin}/share/${e.id}`;return o(fr,{className:"hover:bg-muted/10 transition-colors",children:[t(Qe,{className:"font-medium px-4 py-3.5",children:t("span",{className:"cursor-pointer hover:underline text-foreground",onClick:()=>k({to:"/projects/$projectId/shares/$shareId",params:{projectId:a,shareId:e.id}}),children:e.name})}),t(Qe,{className:"px-4 py-3.5 max-w-[300px]",children:o("div",{className:"flex items-center gap-2 group",children:[t("span",{className:"truncate text-xs font-mono bg-muted/50 text-muted-foreground px-2 py-1 rounded-md border border-border cursor-pointer hover:bg-muted transition-colors flex-1",onClick:()=>y(e.id),title:py(),children:r}),t(S,{variant:"ghost",size:"icon-sm",className:"h-7 w-7 opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>y(e.id),children:t(wr,{className:"h-3.5 w-3.5"})}),t("a",{href:r,target:"_blank",rel:"noreferrer",className:"text-muted-foreground hover:text-foreground inline-flex items-center",children:t($l,{className:"h-3.5 w-3.5"})})]})}),t(Qe,{className:"px-4 py-3.5",children:o("div",{className:"flex items-center gap-2",children:[o(Ce,{className:"h-6 w-6",children:[e.creator?.image&&t(Ie,{src:e.creator.image,alt:e.creator.name,className:"object-cover"}),t(Te,{className:"text-[10px]",children:P(e.creator?.name)})]}),t("span",{className:"text-sm font-medium text-foreground truncate max-w-[150px]",children:e.creator?.name||Sn()})]})}),t(Qe,{className:"px-4 py-3.5 text-muted-foreground text-sm",children:o("div",{className:"flex items-center gap-2",children:[t(Gn,{className:"h-3.5 w-3.5 text-muted-foreground/70"}),t("span",{children:new Date(e.createdAt).toLocaleDateString()})]})}),t(Qe,{className:"px-4 py-3.5 text-right",children:t("div",{className:"flex justify-end",children:t(ke,{checked:!e.isDisabled,onCheckedChange:(s)=>F({id:e.id,isDisabled:!s})})})})]},e.id)})})]}),t("div",{ref:_,className:"h-10 w-full flex items-center justify-center",children:l&&t(O,{className:"h-6 w-6 animate-spin text-primary"})})]})})]})]})})}var R=ze("/projects/$projectId/shares/")({component:H});export{R as Route};