@bkm016/basalt 0.1.4 → 0.1.6

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 (288) hide show
  1. package/README.md +61 -11
  2. package/{chunk-y648fzx0.js → chunk-0039s4jt.js} +3 -3
  3. package/{chunk-rmj5b73e.js → chunk-053vb71h.js} +1 -1
  4. package/{chunk-whvj83b7.js → chunk-063vbmtp.js} +2 -2
  5. package/{chunk-7tbya5b5.js → chunk-0javrjcm.js} +22 -22
  6. package/{chunk-y7nma9rk.js → chunk-10p3mb40.js} +2 -2
  7. package/{chunk-jk25nt60.js → chunk-39vwrg8n.js} +2 -2
  8. package/chunk-3k627vf2.js +3 -0
  9. package/{chunk-q7t30zz2.js → chunk-6kdgk70p.js} +5 -5
  10. package/{chunk-3x94302m.js → chunk-6ptv4g5e.js} +3 -3
  11. package/chunk-75434aay.js +2 -0
  12. package/{chunk-2zp1mv3q.js → chunk-7hr6zw2m.js} +1 -1
  13. package/{chunk-g2t6t8fk.js → chunk-7jezts2n.js} +2 -2
  14. package/{chunk-y58ygzn9.js → chunk-818nd6s1.js} +3 -3
  15. package/{chunk-k23t7vhs.js → chunk-8gw5bvh3.js} +5 -5
  16. package/{chunk-vv7fp27r.js → chunk-8mezk0cb.js} +2 -2
  17. package/{chunk-zggzfa7j.js → chunk-8saewt61.js} +2 -2
  18. package/{chunk-362g64pd.js → chunk-8wj32837.js} +1 -1
  19. package/{chunk-fjtvjrkg.js → chunk-8wv5t0w6.js} +5 -5
  20. package/{chunk-vk1gxk1t.js → chunk-8x21n7y9.js} +1 -1
  21. package/chunk-a0c989ky.js +2 -0
  22. package/{chunk-4w17tzp5.js → chunk-a5apjjcn.js} +12 -12
  23. package/chunk-a81p46j7.js +2 -0
  24. package/chunk-agsfy9w7.js +2 -0
  25. package/{chunk-fw2bpqmw.js → chunk-arcqjt91.js} +1 -1
  26. package/chunk-bdy4jksd.js +2 -0
  27. package/{chunk-qe0teyn1.js → chunk-benrzwea.js} +1 -1
  28. package/{chunk-0y7ne3d0.js → chunk-bwawt15q.js} +2 -2
  29. package/{chunk-pxsrqrd0.js → chunk-c4qr1f41.js} +2 -2
  30. package/{chunk-981f9dw8.js → chunk-c7rcw9fb.js} +6 -6
  31. package/{chunk-cjc90f84.js → chunk-ca982n62.js} +3 -3
  32. package/chunk-d20p02ny.js +2 -0
  33. package/{chunk-97rzj7f6.js → chunk-d6p2hgxh.js} +1 -1
  34. package/{chunk-k6w6y71k.js → chunk-dnx91jrd.js} +2 -2
  35. package/{chunk-8d46jtbj.js → chunk-dpz4hwqb.js} +2 -2
  36. package/{chunk-aky4tztg.js → chunk-ebpyvs1d.js} +2 -2
  37. package/{chunk-m40gxwq4.js → chunk-ecf896fz.js} +3 -3
  38. package/{chunk-pjyn2s97.js → chunk-ejsneb6f.js} +1 -1
  39. package/{chunk-pbcy6zdt.js → chunk-ey15ye2h.js} +1 -1
  40. package/{chunk-kp22kaez.js → chunk-f156y565.js} +2 -2
  41. package/{chunk-9rmqgc3c.js → chunk-f544p9rh.js} +15 -15
  42. package/chunk-fmq3zwzk.js +2 -0
  43. package/{chunk-em187cy3.js → chunk-fx7f4m3c.js} +2 -2
  44. package/{chunk-r7fpkb49.js → chunk-g0t9c3gv.js} +1 -1
  45. package/{chunk-mvfsxdx6.js → chunk-gv7wqkey.js} +10 -10
  46. package/chunk-hksqjts3.js +3884 -0
  47. package/{chunk-ztsjgssj.js → chunk-j7yvh0ae.js} +1 -1
  48. package/chunk-kns4kv7b.js +3 -0
  49. package/{chunk-nmca5h6m.js → chunk-n85qs7cs.js} +1 -1
  50. package/{chunk-8wc8qdx8.js → chunk-n981vx1t.js} +6 -6
  51. package/{chunk-3ct2tkr8.js → chunk-npez1492.js} +2 -2
  52. package/{chunk-t6zs4kw0.js → chunk-peja51xv.js} +2 -2
  53. package/{chunk-r0scgfwx.js → chunk-pg5nkf1y.js} +2 -2
  54. package/{chunk-7afmgncg.js → chunk-prgm07j4.js} +1 -1
  55. package/{chunk-jwdb0ccj.js → chunk-q9dd6fhj.js} +3 -3
  56. package/{chunk-ykens1hy.js → chunk-r8vvcp6c.js} +1 -1
  57. package/chunk-rfb85nj7.js +2 -0
  58. package/{chunk-ev6yvy5y.js → chunk-rfdt992v.js} +15 -15
  59. package/{chunk-xfvvh1s5.js → chunk-s6dejhfj.js} +1 -1
  60. package/{chunk-xh3vr5vz.js → chunk-s7skpgm2.js} +1 -1
  61. package/chunk-tgfbtehh.js +480 -0
  62. package/{chunk-m8vkwdgr.js → chunk-w67dvqtb.js} +4 -4
  63. package/{chunk-f3xadvab.js → chunk-whj87h4r.js} +2 -2
  64. package/{chunk-2hbfk5xd.js → chunk-wnzvnskb.js} +2 -2
  65. package/{chunk-vexrrw1b.js → chunk-xtq1xpq0.js} +2 -2
  66. package/{chunk-1vd0f74z.js → chunk-y8dkfpmj.js} +5 -5
  67. package/{chunk-shadcb9z.js → chunk-z02sj1je.js} +2 -2
  68. package/{chunk-akr0a8nc.js → chunk-zxkq9m8e.js} +1 -1
  69. package/compiled.js +12 -12
  70. package/package.json +1 -1
  71. package/ui-test-worker.js +32 -32
  72. package/web/{chunk-t4c8xavd.js → chunk-03dmzvaq.js} +7 -7
  73. package/web/{chunk-n8sky2q6.js → chunk-07agqp8h.js} +1 -1
  74. package/web/chunk-0fgaepwm.js +3 -0
  75. package/web/chunk-0gg00f86.js +292 -0
  76. package/web/chunk-0pecj6d7.js +1 -0
  77. package/web/{chunk-ts7zrf5b.js → chunk-0whceqes.js} +2 -2
  78. package/web/chunk-0wt1dgny.js +1 -0
  79. package/web/{chunk-sfg2wkhe.js → chunk-12xxh71x.js} +6 -6
  80. package/web/chunk-1ves7sq5.js +1 -0
  81. package/web/chunk-1yj79b48.js +1 -0
  82. package/web/chunk-296hgy6k.js +370 -0
  83. package/web/{chunk-f4tacm06.js → chunk-2bmq1whf.js} +1 -1
  84. package/web/chunk-2wqxhqr9.js +1 -0
  85. package/web/{chunk-2j4m0bh1.js → chunk-30b33r2w.js} +2 -2
  86. package/web/{chunk-sspfxp5e.js → chunk-30zfw7zg.js} +1 -1
  87. package/web/chunk-39ng8zwx.css +1 -0
  88. package/web/chunk-3de552rg.js +70 -0
  89. package/web/chunk-3nbzj48p.js +36 -0
  90. package/web/{chunk-0z0y25zf.js → chunk-3zebd9fq.js} +3 -3
  91. package/web/chunk-4r1n98zx.js +2 -0
  92. package/web/chunk-59678wmg.js +1 -0
  93. package/web/{chunk-ds7srg4p.js → chunk-5nda24gv.js} +1 -1
  94. package/web/chunk-5v44qv67.js +303 -0
  95. package/web/chunk-5wdk97mk.js +4 -0
  96. package/web/chunk-64rafq66.js +78 -0
  97. package/web/chunk-6bwgdvf6.js +1 -0
  98. package/web/chunk-6kkw9ptc.js +1 -0
  99. package/web/chunk-718mr5gc.js +2 -0
  100. package/web/chunk-7hs57qdr.js +1 -0
  101. package/web/chunk-7kp237t3.js +106 -0
  102. package/web/chunk-86p42kym.js +1 -0
  103. package/web/chunk-8n79cqyd.js +1 -0
  104. package/web/chunk-8r0s8tx7.js +1 -0
  105. package/web/chunk-96v2avmw.js +40 -0
  106. package/web/chunk-9an6wcnr.js +1 -0
  107. package/web/{chunk-5z4jcqct.js → chunk-9c1yt2ex.js} +20 -20
  108. package/web/chunk-9w5tf22s.js +1 -0
  109. package/web/{chunk-pws2seas.js → chunk-a7gtb4kg.js} +19 -19
  110. package/web/chunk-ahztazsg.js +1 -0
  111. package/web/chunk-b985y17w.js +2 -0
  112. package/web/chunk-bz2v64xe.js +1 -0
  113. package/web/{chunk-n1dmrz44.js → chunk-c01176kn.js} +2 -2
  114. package/web/chunk-c3nn0vvc.js +1 -0
  115. package/web/chunk-cb2rxtq9.js +2 -0
  116. package/web/{chunk-b1bgzz66.js → chunk-ck8rr0sr.js} +1 -1
  117. package/web/{chunk-aqfpnhmt.js → chunk-cktmyc13.js} +19 -19
  118. package/web/{chunk-rvrf0f3h.js → chunk-cm92fyr3.js} +2 -2
  119. package/web/chunk-cwtn2kdm.js +1 -0
  120. package/web/chunk-czq1yz51.js +99 -0
  121. package/web/chunk-d22wq71s.js +1 -0
  122. package/web/{chunk-pjkdrgm0.js → chunk-d4z2rgpx.js} +1 -1
  123. package/web/{chunk-hvw3gn2a.js → chunk-d6tbw8br.js} +20 -20
  124. package/web/{chunk-cg3jterp.js → chunk-d9wdsjkk.js} +2 -2
  125. package/web/{chunk-ttg6tbwx.js → chunk-da7m1kva.js} +2 -2
  126. package/web/chunk-dpkyygej.js +1 -0
  127. package/web/{chunk-0b47eyrf.js → chunk-dwajwrpk.js} +1 -1
  128. package/web/chunk-et5ess72.js +1 -0
  129. package/web/chunk-ez8b6neq.js +1 -0
  130. package/web/{chunk-bhsaj6qq.js → chunk-f5txt81n.js} +1 -1
  131. package/web/chunk-fd1kqwe3.js +1 -0
  132. package/web/chunk-fmthkpff.js +1 -0
  133. package/web/chunk-fp48zz2e.js +2 -0
  134. package/web/{chunk-n90cqdvg.js → chunk-fv6vm14n.js} +2 -2
  135. package/web/chunk-fx0n2g22.js +89 -0
  136. package/web/{chunk-9cx1be43.js → chunk-fxs4nb93.js} +16 -16
  137. package/web/chunk-g6k9z8zt.js +1 -0
  138. package/web/{chunk-42e3b9hv.js → chunk-g81h1e6n.js} +19 -19
  139. package/web/{chunk-pz9ps2jm.js → chunk-gsh80797.js} +12 -12
  140. package/web/{chunk-54thej0t.js → chunk-gyp6v7jd.js} +2 -2
  141. package/web/chunk-h0c42zy3.js +1 -0
  142. package/web/{chunk-6m69hczt.js → chunk-h6k1x096.js} +2 -2
  143. package/web/chunk-hs5x78fb.js +1 -0
  144. package/web/{chunk-zx8zec24.js → chunk-ht1dzftc.js} +56 -56
  145. package/web/{chunk-d11v5s7w.js → chunk-hy4m34qp.js} +6 -6
  146. package/web/chunk-hyd5hzpa.js +1 -0
  147. package/web/chunk-hyt1nkaw.js +1 -0
  148. package/web/{chunk-24mfx6w1.js → chunk-j1bw5v1g.js} +2 -2
  149. package/web/chunk-j6a4z530.js +1139 -0
  150. package/web/{chunk-0pbjgdgp.js → chunk-ja7w629n.js} +2 -2
  151. package/web/{chunk-zbj1trar.js → chunk-jam45rqg.js} +2 -2
  152. package/web/chunk-jfvxxp5c.js +1 -0
  153. package/web/{chunk-kmr7r9xj.js → chunk-jve1zc80.js} +2 -2
  154. package/web/chunk-kegv14sg.js +2 -0
  155. package/web/chunk-kw9emsqw.js +1 -0
  156. package/web/{chunk-df5zx17h.js → chunk-kyawkpv2.js} +1 -1
  157. package/web/chunk-m2prjwk3.js +4 -0
  158. package/web/chunk-m9bzz9m0.js +19 -0
  159. package/web/chunk-mqsyzzgt.js +30 -0
  160. package/web/chunk-mz9b5bsa.js +1 -0
  161. package/web/chunk-n1jpg57t.js +169 -0
  162. package/web/{chunk-ybrf9mhz.js → chunk-nyn9tghz.js} +4 -4
  163. package/web/{chunk-1eg9sbbt.js → chunk-nywdeb4m.js} +2 -2
  164. package/web/chunk-prvh9syp.js +324 -0
  165. package/web/chunk-pxkhm40r.js +2 -0
  166. package/web/{chunk-6cnek1xh.js → chunk-q9ekgjh6.js} +1 -1
  167. package/web/{chunk-xzp7jf7e.js → chunk-qcge7d6s.js} +2 -2
  168. package/web/chunk-r3mj50zs.js +1 -0
  169. package/web/{chunk-wnskxerq.js → chunk-rf9dt6bg.js} +5 -5
  170. package/web/{chunk-nvhmq4z5.js → chunk-s2920f21.js} +6 -6
  171. package/web/chunk-sc0ghp25.js +24 -0
  172. package/web/{chunk-ydtrc1ay.js → chunk-sd3cdqcm.js} +2 -2
  173. package/web/{chunk-rykfak98.js → chunk-sf101c23.js} +2 -2
  174. package/web/{chunk-4gavbw65.js → chunk-sy7e4dmq.js} +1 -1
  175. package/web/chunk-t74r2n8h.js +1 -0
  176. package/web/{chunk-0h0vb6gt.js → chunk-t851gdjh.js} +4 -4
  177. package/web/{chunk-a408enpy.js → chunk-t9mvsgt9.js} +1 -1
  178. package/web/chunk-thbqwq6b.js +1 -0
  179. package/web/{chunk-v5cnt7c8.js → chunk-twdy2f67.js} +1 -1
  180. package/web/chunk-v4yqrx5y.js +140 -0
  181. package/web/{chunk-b53bfkys.js → chunk-vf4vkcf9.js} +1 -1
  182. package/web/chunk-vnt34mkb.js +1 -0
  183. package/web/chunk-vtxw9rmr.js +1 -0
  184. package/web/{chunk-92ssjk2y.js → chunk-vw1pbv1x.js} +40 -40
  185. package/web/chunk-x19v2sxv.js +1 -0
  186. package/web/{chunk-3re8y26v.js → chunk-x5s7zr5f.js} +7 -7
  187. package/web/chunk-xc2sq3t5.js +2 -0
  188. package/web/chunk-xce8n339.js +1 -0
  189. package/web/chunk-xtss82z2.js +1 -0
  190. package/web/chunk-xvcfp1zh.js +2 -0
  191. package/web/chunk-y21zy3eh.js +1 -0
  192. package/web/chunk-ya3ghn3n.js +2 -0
  193. package/web/chunk-yd74yxzt.js +8 -0
  194. package/web/{chunk-74j07k8k.js → chunk-z1geewdf.js} +2 -2
  195. package/web/chunk-z4ha8181.js +1 -0
  196. package/web/chunk-z8rarqe6.js +1 -0
  197. package/web/{chunk-kwccs9f6.js → chunk-zp3qrrkb.js} +11 -11
  198. package/web/chunk-zsxw5fj7.js +39 -0
  199. package/web/index.html +1 -1
  200. package/worker.js +1 -1
  201. package/chunk-06hdzq5n.js +0 -2
  202. package/chunk-5dfbezv9.js +0 -2
  203. package/chunk-5x1sankd.js +0 -3753
  204. package/chunk-71h08f4g.js +0 -2
  205. package/chunk-7nzhdrv9.js +0 -2
  206. package/chunk-7q51n619.js +0 -2
  207. package/chunk-9mmz6wt3.js +0 -2
  208. package/chunk-fvn32nzj.js +0 -478
  209. package/chunk-n6e43rvk.js +0 -3
  210. package/chunk-ry0z4ev6.js +0 -2
  211. package/chunk-vkpvcxjr.js +0 -2
  212. package/web/chunk-0rmkpsgp.js +0 -1
  213. package/web/chunk-0s80zw00.js +0 -1
  214. package/web/chunk-0xkyryrq.js +0 -1
  215. package/web/chunk-1gbd61z0.js +0 -2
  216. package/web/chunk-2s0bmrkv.js +0 -39
  217. package/web/chunk-2z1rwr28.js +0 -2
  218. package/web/chunk-344bq59c.js +0 -89
  219. package/web/chunk-3t0211rw.js +0 -1
  220. package/web/chunk-44rmrmcn.js +0 -1
  221. package/web/chunk-4bzqrwr0.js +0 -1139
  222. package/web/chunk-4d3a7xs2.js +0 -1
  223. package/web/chunk-4jmazh6x.js +0 -370
  224. package/web/chunk-4re74xwm.js +0 -140
  225. package/web/chunk-4rm1vy7w.js +0 -1
  226. package/web/chunk-59kqahb3.js +0 -1
  227. package/web/chunk-5qtyq3ce.js +0 -292
  228. package/web/chunk-5z6x2n5h.js +0 -1
  229. package/web/chunk-6beqrmtq.js +0 -1
  230. package/web/chunk-6f5ke0x9.js +0 -1
  231. package/web/chunk-6xaqxcq8.js +0 -1
  232. package/web/chunk-7q6wvv2x.js +0 -1
  233. package/web/chunk-7qsa4p8h.js +0 -1
  234. package/web/chunk-8nja0ygy.js +0 -1
  235. package/web/chunk-8y64fkpz.js +0 -24
  236. package/web/chunk-9ad7v7bm.js +0 -8
  237. package/web/chunk-9dzxv335.js +0 -4
  238. package/web/chunk-9t5dnjaz.js +0 -19
  239. package/web/chunk-a497tykb.js +0 -70
  240. package/web/chunk-b6k9w215.js +0 -2
  241. package/web/chunk-cjfssg3m.js +0 -2
  242. package/web/chunk-cqp1d4p0.js +0 -1
  243. package/web/chunk-dy2gm1fs.js +0 -1
  244. package/web/chunk-e0zre35a.js +0 -1
  245. package/web/chunk-e9twvs9n.js +0 -3
  246. package/web/chunk-f2kgtyfp.js +0 -1
  247. package/web/chunk-f8bn5tzf.js +0 -1
  248. package/web/chunk-f91wzwtk.js +0 -1
  249. package/web/chunk-fdp9bsj7.js +0 -1
  250. package/web/chunk-fh2vj0wv.js +0 -2
  251. package/web/chunk-g1ev11wx.js +0 -1
  252. package/web/chunk-gmzqdm7v.js +0 -1
  253. package/web/chunk-hfaffkrh.js +0 -1
  254. package/web/chunk-j2vt8c8v.js +0 -1
  255. package/web/chunk-ka3q31t1.js +0 -1
  256. package/web/chunk-khxcn8tt.js +0 -106
  257. package/web/chunk-kqqmp1am.js +0 -1
  258. package/web/chunk-m2d1sp30.js +0 -1
  259. package/web/chunk-nbgqbxcy.js +0 -1
  260. package/web/chunk-ncpnpe9w.js +0 -99
  261. package/web/chunk-ne0v8mfb.js +0 -2
  262. package/web/chunk-ngx2cp8x.js +0 -2
  263. package/web/chunk-nxcgf7ec.js +0 -1
  264. package/web/chunk-p0kvmf28.js +0 -2
  265. package/web/chunk-p3k7m5nr.js +0 -1
  266. package/web/chunk-pggaffrh.js +0 -169
  267. package/web/chunk-pxe3vna4.js +0 -1
  268. package/web/chunk-qh15dxav.css +0 -1
  269. package/web/chunk-qpmbxhh6.js +0 -1
  270. package/web/chunk-r0rctnxz.js +0 -1
  271. package/web/chunk-rn3dnqm8.js +0 -1
  272. package/web/chunk-rtf2zzzv.js +0 -1
  273. package/web/chunk-srrfphes.js +0 -1
  274. package/web/chunk-tdr6x2xc.js +0 -1
  275. package/web/chunk-tncvg1nn.js +0 -1
  276. package/web/chunk-vyp0ns1f.js +0 -2
  277. package/web/chunk-wvdehm9y.js +0 -303
  278. package/web/chunk-x7ahcpj7.js +0 -1
  279. package/web/chunk-y38bf0wm.js +0 -1
  280. package/web/chunk-y56aaba5.js +0 -2
  281. package/web/chunk-ye58t45p.js +0 -4
  282. package/web/chunk-yqbnps3a.js +0 -1
  283. package/web/chunk-z1h20s8c.js +0 -78
  284. package/web/chunk-zj4q9jth.js +0 -36
  285. package/web/chunk-zj5k94dk.js +0 -40
  286. package/web/chunk-zqch0sc8.js +0 -30
  287. package/web/install.ps1 +0 -91
  288. package/web/install.sh +0 -177
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{jo,Ue,ot}from"./chunk-fjtvjrkg.js";import{Fe}from"./chunk-m40gxwq4.js";import{qe,ve,L}from"./chunk-jwdb0ccj.js";import{be,Y,b,Se,X,Qe,B}from"./chunk-981f9dw8.js";import{r}from"./chunk-0y7ne3d0.js";var fe=r(function(Dt){var{SignatureV4:kt,signatureV4aContainer:de}=jo(),O={CrtSignerV4:null},ge="X-Amz-S3session-Token".toLowerCase();class Z extends kt{async signWithCredentials(e,t,s){let o=pe(t);e.headers[ge]=t.sessionToken;let n=this;return he(n,o),n.signRequest(e,s??{})}async presignWithCredentials(e,t,s){let o=pe(t);return delete e.headers[ge],e.headers["X-Amz-S3session-Token"]=t.sessionToken,e.query=e.query??{},e.query["X-Amz-S3session-Token"]=t.sessionToken,he(this,o),this.presign(e,s)}}function pe(e){return{accessKeyId:e.accessKeyId,secretAccessKey:e.secretAccessKey,expiration:e.expiration}}function he(e,t){let s=e.credentialProvider;e.credentialProvider=()=>(e.credentialProvider=s,Promise.resolve(t))}class me{sigv4aSigner;sigv4Signer;signerOptions;static sigv4aDependency(){if(typeof O.CrtSignerV4==="function")return"crt";else if(typeof de.SignatureV4a==="function")return"js";return"none"}constructor(e){this.sigv4Signer=new Z(e),this.signerOptions=e}async sign(e,t={}){if(t.signingRegion==="*")return this.getSigv4aSigner().sign(e,t);return this.sigv4Signer.sign(e,t)}async signWithCredentials(e,t,s={}){if(s.signingRegion==="*"){let o=this.getSigv4aSigner(),n=O.CrtSignerV4;if(n&&o instanceof n)return o.signWithCredentials(e,t,s);else throw Error(`signWithCredentials with signingRegion '*' is only supported when using the CRT dependency @aws-sdk/signature-v4-crt. Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. You must also register the package by calling [require("@aws-sdk/signature-v4-crt");] or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt`)}return this.sigv4Signer.signWithCredentials(e,t,s)}async presign(e,t={}){if(t.signingRegion==="*"){let s=this.getSigv4aSigner(),o=O.CrtSignerV4;if(o&&s instanceof o)return s.presign(e,t);else throw Error(`presign with signingRegion '*' is only supported when using the CRT dependency @aws-sdk/signature-v4-crt. Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. You must also register the package by calling [require("@aws-sdk/signature-v4-crt");] or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt`)}return this.sigv4Signer.presign(e,t)}async presignWithCredentials(e,t,s={}){if(s.signingRegion==="*")throw Error("Method presignWithCredentials is not supported for [signingRegion=*].");return this.sigv4Signer.presignWithCredentials(e,t,s)}getSigv4aSigner(){if(!this.sigv4aSigner){let e=O.CrtSignerV4,t=de.SignatureV4a;if(this.signerOptions.runtime==="node"){if(!e&&!t)throw Error("Neither CRT nor JS SigV4a implementation is available. Please load either @aws-sdk/signature-v4-crt or @aws-sdk/signature-v4a. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt");if(e&&typeof e==="function")this.sigv4aSigner=new e({...this.signerOptions,signingAlgorithm:1});else if(t&&typeof t==="function")this.sigv4aSigner=new t({...this.signerOptions});else throw Error("Available SigV4a implementation is not a valid constructor. Please ensure you've properly imported @aws-sdk/signature-v4-crt or @aws-sdk/signature-v4a.For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt")}else{if(!t||typeof t!=="function")throw Error("JS SigV4a implementation is not available or not a valid constructor. Please check whether you have installed the @aws-sdk/signature-v4a package explicitly. The CRT implementation is not available for browsers. You must also register the package by calling [require('@aws-sdk/signature-v4a');] or an ESM equivalent such as [import '@aws-sdk/signature-v4a';]. For more information please go to https://github.com/aws/aws-sdk-js-v3#using-javascript-non-crt-implementation-of-sigv4a");this.sigv4aSigner=new t({...this.signerOptions})}}return this.sigv4aSigner}}Dt.SignatureV4MultiRegion=me;Dt.SignatureV4SignWithCredentials=Z;Dt.signatureV4CrtContainer=O});var{awsEndpointFunctions:Nt,emitWarningIfUnsupportedVersion:Wt,createDefaultUserAgentProvider:Ht,NODE_APP_ID_CONFIG_OPTIONS:Ut,getAwsRegionExtensionConfiguration:qt,resolveAwsRegionExtensionConfiguration:Ft,resolveUserAgentConfig:Vt,resolveHostHeaderConfig:Lt,getUserAgentPlugin:Kt,getHostHeaderPlugin:Mt,getLoggerPlugin:jt,getRecursionDetectionPlugin:zt,setCredentialFeature:se,stsRegionDefaultResolver:Gt}=L(),{NoAuthSigner:_e,getHttpAuthSchemeEndpointRuleSetPlugin:Yt,DefaultIdentityProviderConfig:Qt,getHttpSigningPlugin:Bt}=ve(),{normalizeProvider:xe,getSmithyContext:Te,ServiceException:Jt,NoOpLogger:Xt,emitWarningIfUnsupportedVersion:Zt,loadConfigsForDefaultMode:es,getDefaultExtensionConfiguration:ts,resolveDefaultRuntimeConfig:ss,Client:ke,makeBuilder:ns,createAggregatedClient:os}=Y(),{Command:rs}=Y();var io=rs,ao=ke;var{resolveDefaultsModeConfig:is,loadConfig:y,NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS:as,NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS:cs,NODE_REGION_CONFIG_OPTIONS:us,NODE_REGION_CONFIG_FILE_OPTIONS:ls,resolveRegionConfig:ds}=b(),{BinaryDecisionDiagram:gs,EndpointCache:ps,decideEndpoint:hs,customEndpointFunctions:ms,resolveParams:Ss,resolveEndpointConfig:vs,getEndpointPlugin:fs}=Se(),{parseUrl:Ps,getHttpHandlerExtensionConfiguration:ys,resolveHttpHandlerRuntimeConfig:Es,getContentLengthPlugin:As}=B(),{DEFAULT_RETRY_MODE:Is,NODE_RETRY_MODE_CONFIG_OPTIONS:ws,NODE_MAX_ATTEMPT_CONFIG_OPTIONS:Rs,resolveRetryConfig:Cs,getRetryPlugin:_s}=qe(),{TypeRegistry:De,getSchemaSerdePlugin:xs}=be(),{resolveAwsSdkSigV4Config:Ts,resolveAwsSdkSigV4AConfig:ks,AwsSdkSigV4Signer:Oe,AwsSdkSigV4ASigner:$e,NODE_SIGV4A_CONFIG_OPTIONS:Ds,NODE_AUTH_SCHEME_PREFERENCE_OPTIONS:bs}=Ue(),{SignatureV4MultiRegion:Ne}=fe(),{toUtf8:Os,fromUtf8:$s,toBase64:Ns,fromBase64:Ws,calculateBodyLength:Hs}=X(),{streamCollector:Us,NodeHttpHandler:qs}=Fe(),{AwsQueryProtocol:Fs}=ot(),{Sha256:Vs}=Qe(),D="ref",I=-1,N=!0,Pe="isSet",We="PartitionResult",W="booleanEquals",l="stringEquals",ee="getAttr",ye="us-east-1",Ee="sigv4",Ae="sts",Ie="https://sts.{Region}.{PartitionResult#dnsSuffix}",we={[D]:"Endpoint"},d={[D]:"Region"},te={[D]:We},k={},Re=[d],Ce={conditions:[[Pe,[we]],[Pe,Re],["aws.partition",Re,We],[W,[{[D]:"UseFIPS"},N]],[W,[{[D]:"UseDualStack"},N]],[l,[d,"aws-global"]],[W,[{[D]:"UseGlobalEndpoint"},N]],[l,[d,"eu-central-1"]],[W,[{fn:ee,argv:[te,"supportsDualStack"]},N]],[W,[{fn:ee,argv:[te,"supportsFIPS"]},N]],[l,[d,"ap-south-1"]],[l,[d,"eu-north-1"]],[l,[d,"eu-west-1"]],[l,[d,"eu-west-2"]],[l,[d,"eu-west-3"]],[l,[d,"sa-east-1"]],[l,[d,ye]],[l,[d,"us-east-2"]],[l,[d,"us-west-2"]],[l,[d,"us-west-1"]],[l,[d,"ca-central-1"]],[l,[d,"ap-southeast-1"]],[l,[d,"ap-northeast-1"]],[l,[d,"ap-southeast-2"]],[l,[{fn:ee,argv:[te,"name"]},"aws-us-gov"]]],results:[[I],["https://sts.amazonaws.com",{authSchemes:[{name:Ee,signingName:Ae,signingRegion:ye}]}],[Ie,{authSchemes:[{name:Ee,signingName:Ae,signingRegion:"{Region}"}]}],[I,"Invalid Configuration: FIPS and custom endpoint are not supported"],[I,"Invalid Configuration: Dualstack and custom endpoint are not supported"],[we,k],["https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",k],[I,"FIPS and DualStack are enabled, but this partition does not support one or both"],["https://sts.{Region}.amazonaws.com",k],["https://sts-fips.{Region}.{PartitionResult#dnsSuffix}",k],[I,"FIPS is enabled but this partition does not support FIPS"],["https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}",k],[I,"DualStack is enabled but this partition does not support DualStack"],[Ie,k],[I,"Invalid Configuration: Missing Region"]]},Ls=2,i=1e8,Ks=new Int32Array([-1,1,-1,0,30,3,1,4,i+14,2,5,i+14,3,25,6,4,24,7,5,i+1,8,6,9,i+13,7,i+1,10,10,i+1,11,11,i+1,12,12,i+1,13,13,i+1,14,14,i+1,15,15,i+1,16,16,i+1,17,17,i+1,18,18,i+1,19,19,i+1,20,20,i+1,21,21,i+1,22,22,i+1,23,23,i+1,i+2,8,i+11,i+12,4,28,26,9,27,i+10,24,i+8,i+9,8,29,i+7,9,i+6,i+7,3,i+3,31,4,i+4,i+5]),Ms=gs.from(Ks,Ls,Ce.conditions,Ce.results),js=new ps({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS","UseGlobalEndpoint"]}),He=(e,t={})=>js.get(e,()=>hs(Ms,{endpointParams:e,logger:t.logger}));ms.aws=Nt;var zs=(e)=>async(t,s,o)=>{if(!o)throw Error("Could not find `input` for `defaultEndpointRuleSetHttpAuthSchemeParametersProvider`");let n=await e(t,s,o),u=Te(s)?.commandInstance?.constructor?.getEndpointParameterInstructions;if(!u)throw Error(`getEndpointParameterInstructions() is not defined on '${s.commandName}'`);let a=await Ss(o,{getEndpointParameterInstructions:u},t);return Object.assign(n,a)},Gs=async(e,t,s)=>({operation:Te(t).operation,region:await xe(e.region)()||(()=>{throw Error("expected `region` to be configured for `aws.auth#sigv4`")})()}),Ys=zs(Gs);function Ve(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sts",region:e.region},propertiesExtractor:(t,s)=>({signingProperties:{config:t,context:s}})}}function ne(e){return{schemeId:"aws.auth#sigv4a",signingProperties:{name:"sts",region:e.region},propertiesExtractor:(t,s)=>({signingProperties:{config:t,context:s}})}}function Le(e){return{schemeId:"smithy.api#noAuth"}}var Qs=(e,t,s)=>(n)=>{let a=e(n).properties?.authSchemes;if(!a)return t(n);let g=[];for(let S of a){let{name:p,properties:v={},...A}=S,f=p.toLowerCase();if(p!==f)console.warn(`HttpAuthScheme has been normalized with lowercasing: '${p}' to '${f}'`);let m;if(f==="sigv4a"){m="aws.auth#sigv4a";let Q=a.find((J)=>{let le=J.name.toLowerCase();return le!=="sigv4a"&&le.startsWith("sigv4")});if(Ne.sigv4aDependency()==="none"&&Q)continue}else if(f.startsWith("sigv4"))m="aws.auth#sigv4";else throw Error(`Unknown HttpAuthScheme found in '@smithy.rules#endpointRuleSet': '${f}'`);let T=s[m];if(!T)throw Error(`Could not find HttpAuthOption create function for '${m}'`);let P=T(n);P.schemeId=m,P.signingProperties={...P.signingProperties||{},...A,...v},g.push(P)}return g},Bs=(e)=>{let t=[];switch(e.operation){case"AssumeRoleWithWebIdentity":{t.push(Le()),t.push(ne(e));break}default:t.push(Ve(e)),t.push(ne(e))}return t},Js=Qs(He,Bs,{"aws.auth#sigv4":Ve,"aws.auth#sigv4a":ne,"smithy.api#noAuth":Le}),Xs=(e)=>{let t=Ts(e),s=ks(t);return Object.assign(s,{authSchemePreference:xe(e.authSchemePreference??[])})},Zs=(e)=>Object.assign(e,{useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,useGlobalEndpoint:e.useGlobalEndpoint??!1,defaultSigningName:"sts"}),en={UseGlobalEndpoint:{type:"builtInParams",name:"useGlobalEndpoint"},UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},tn="3.997.47",sn={version:tn};class h extends Jt{static shapeId="smithy.ts.sdk.synthetic.com.amazonaws.sts#STSServiceException";constructor(e){super(e);Object.setPrototypeOf(this,h.prototype)}}class U extends h{static shapeId="com.amazonaws.sts#ExpiredTokenException";name="ExpiredTokenException";$fault="client";constructor(e){super({name:"ExpiredTokenException",$fault:"client",...e});Object.setPrototypeOf(this,U.prototype)}}class q extends h{static shapeId="com.amazonaws.sts#MalformedPolicyDocumentException";name="MalformedPolicyDocumentException";$fault="client";constructor(e){super({name:"MalformedPolicyDocumentException",$fault:"client",...e});Object.setPrototypeOf(this,q.prototype)}}class F extends h{static shapeId="com.amazonaws.sts#PackedPolicyTooLargeException";name="PackedPolicyTooLargeException";$fault="client";constructor(e){super({name:"PackedPolicyTooLargeException",$fault:"client",...e});Object.setPrototypeOf(this,F.prototype)}}class V extends h{static shapeId="com.amazonaws.sts#RegionDisabledException";name="RegionDisabledException";$fault="client";constructor(e){super({name:"RegionDisabledException",$fault:"client",...e});Object.setPrototypeOf(this,V.prototype)}}class K extends h{static shapeId="com.amazonaws.sts#IDPRejectedClaimException";name="IDPRejectedClaimException";$fault="client";constructor(e){super({name:"IDPRejectedClaimException",$fault:"client",...e});Object.setPrototypeOf(this,K.prototype)}}class M extends h{static shapeId="com.amazonaws.sts#InvalidIdentityTokenException";name="InvalidIdentityTokenException";$fault="client";constructor(e){super({name:"InvalidIdentityTokenException",$fault:"client",...e});Object.setPrototypeOf(this,M.prototype)}}class j extends h{static shapeId="com.amazonaws.sts#IDPCommunicationErrorException";name="IDPCommunicationErrorException";$fault="client";$retryable={};constructor(e){super({name:"IDPCommunicationErrorException",$fault:"client",...e});Object.setPrototypeOf(this,j.prototype)}}var nn="Arn",on="AccessKeyId",rn="AssumeRole",an="AssumedRoleId",cn="AssumeRoleRequest",un="AssumeRoleResponse",oe="AssumedRoleUser",ln="AssumeRoleWithWebIdentity",dn="AssumeRoleWithWebIdentityRequest",gn="AssumeRoleWithWebIdentityResponse",pn="Audience",re="Credentials",hn="ContextAssertion",Ke="DurationSeconds",mn="Expiration",Sn="ExternalId",vn="ExpiredTokenException",fn="IDPCommunicationErrorException",Pn="IDPRejectedClaimException",yn="InvalidIdentityTokenException",En="Key",An="MalformedPolicyDocumentException",Me="MinimumSessionTokenSize",je="Policy",ze="PolicyArns",In="ProviderArn",wn="ProvidedContexts",Rn="ProvidedContextsListType",Cn="ProvidedContext",_n="PolicyDescriptorType",xn="ProviderId",Ge="PackedPolicySize",Tn="PackedPolicyTooLargeException",kn="Provider",Ye="RoleArn",Dn="RegionDisabledException",Be="RoleSessionName",bn="SecretAccessKey",On="SubjectFromWebIdentityToken",ie="SourceIdentity",$n="SerialNumber",Nn="SessionToken",Je="SessionTokenSize",Xe="SessionTokenUtilization",Wn="Tags",Hn="TokenCode",Un="TransitiveTagKeys",qn="Tag",Fn="Value",Vn="WebIdentityToken",Ln="arn",Kn="accessKeySecretType",w="awsQueryError",R="client",Mn="clientTokenType",C="error",_="httpError",x="message",jn="policyDescriptorListType",Ze="smithy.ts.sdk.synthetic.com.amazonaws.sts",zn="tagListType",c="com.amazonaws.sts",et=new De(Ze),tt=[-3,Ze,"STSServiceException",0,[],[]];et.registerError(tt,h);var E=new De(c),st=[-3,c,vn,{[w]:["ExpiredTokenException",400],[C]:R,[_]:400},[x],[0]];E.registerError(st,U);var nt=[-3,c,fn,{[w]:["IDPCommunicationError",400],[C]:R,[_]:400},[x],[0]];E.registerError(nt,j);var rt=[-3,c,Pn,{[w]:["IDPRejectedClaim",403],[C]:R,[_]:403},[x],[0]];E.registerError(rt,K);var it=[-3,c,yn,{[w]:["InvalidIdentityToken",400],[C]:R,[_]:400},[x],[0]];E.registerError(it,M);var at=[-3,c,An,{[w]:["MalformedPolicyDocument",400],[C]:R,[_]:400},[x],[0]];E.registerError(at,q);var ct=[-3,c,Tn,{[w]:["PackedPolicyTooLarge",400],[C]:R,[_]:400},[x],[0]];E.registerError(ct,F);var ut=[-3,c,Dn,{[w]:["RegionDisabledException",403],[C]:R,[_]:403},[x],[0]];E.registerError(ut,V);var lt=[et,E],Gn=[0,c,Kn,8,0],Yn=[0,c,Mn,8,0],ae=[3,c,oe,0,[an,nn],[0,0],2],dt=[3,c,cn,0,[Ye,Be,ze,je,Ke,Wn,Un,Sn,$n,Hn,ie,wn,Me],[0,0,()=>ft,0,1,()=>Bn,64,0,0,0,0,()=>Qn,1],2],gt=[3,c,un,0,[re,oe,Ge,ie,Xe,Je],[[()=>ce,0],()=>ae,1,0,1,1]],pt=[3,c,dn,0,[Ye,Be,Vn,xn,ze,je,Ke,Me],[0,0,[()=>Yn,0],0,()=>ft,0,1,1],3],ht=[3,c,gn,0,[re,On,oe,Ge,kn,pn,ie,Xe,Je],[[()=>ce,0],0,()=>ae,1,0,0,0,1,1]],ce=[3,c,re,0,[on,bn,Nn,mn],[0,[()=>Gn,0],0,4],4],mt=[3,c,_n,0,[Ln],[0]],St=[3,c,Cn,0,[In,hn],[0,0]],vt=[3,c,qn,0,[En,Fn],[0,0],2],ft=[1,c,jn,0,()=>mt],Qn=[1,c,Rn,0,()=>St],Bn=[1,c,zn,0,()=>vt],Pt=[9,c,rn,0,()=>dt,()=>gt],yt=[9,c,ln,0,()=>pt,()=>ht],Jn=(e)=>({apiVersion:"2011-06-15",base64Decoder:e?.base64Decoder??Ws,base64Encoder:e?.base64Encoder??Ns,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??He,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??Js,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(t)=>t.getIdentityProvider("aws.auth#sigv4"),signer:new Oe},{schemeId:"aws.auth#sigv4a",identityProvider:(t)=>t.getIdentityProvider("aws.auth#sigv4a"),signer:new $e},{schemeId:"smithy.api#noAuth",identityProvider:(t)=>t.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new _e}],logger:e?.logger??new Xt,protocol:e?.protocol??Fs,protocolSettings:e?.protocolSettings??{defaultNamespace:"com.amazonaws.sts",errorTypeRegistries:lt,xmlNamespace:"https://sts.amazonaws.com/doc/2011-06-15/",version:"2011-06-15",serviceTarget:"AWSSecurityTokenServiceV20110615"},serviceId:e?.serviceId??"STS",sha256:e?.sha256??Vs,signerConstructor:e?.signerConstructor??Ne,urlParser:e?.urlParser??Ps,utf8Decoder:e?.utf8Decoder??$s,utf8Encoder:e?.utf8Encoder??Os}),Xn=(e)=>{Zt(process.version);let t=is(e),s=()=>t().then(es),o=Jn(e);Wt(process.version);let n={profile:e?.profile,logger:o.logger};return{...o,...e,runtime:"node",defaultsMode:t,authSchemePreference:e?.authSchemePreference??y(bs,n),bodyLengthChecker:e?.bodyLengthChecker??Hs,defaultUserAgentProvider:e?.defaultUserAgentProvider??Ht({serviceId:o.serviceId,clientVersion:sn.version}),httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(u)=>u.getIdentityProvider("aws.auth#sigv4")||(async(a)=>await e.credentialDefaultProvider(a?.__config||{})()),signer:new Oe},{schemeId:"aws.auth#sigv4a",identityProvider:(u)=>u.getIdentityProvider("aws.auth#sigv4a"),signer:new $e},{schemeId:"smithy.api#noAuth",identityProvider:(u)=>u.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new _e}],maxAttempts:e?.maxAttempts??y(Rs,e),region:e?.region??y(us,{...ls,...n}),requestHandler:qs.create(e?.requestHandler??s),retryMode:e?.retryMode??y({...ws,default:async()=>(await s()).retryMode||Is},e),sigv4aSigningRegionSet:e?.sigv4aSigningRegionSet??y(Ds,n),streamCollector:e?.streamCollector??Us,useDualstackEndpoint:e?.useDualstackEndpoint??y(cs,n),useFipsEndpoint:e?.useFipsEndpoint??y(as,n),userAgentAppId:e?.userAgentAppId??y(Ut,n)}},Zn=(e)=>{let{httpAuthSchemes:t,httpAuthSchemeProvider:s,credentials:o}=e;return{setHttpAuthScheme(n){let u=t.findIndex((a)=>a.schemeId===n.schemeId);if(u===-1)t.push(n);else t.splice(u,1,n)},httpAuthSchemes(){return t},setHttpAuthSchemeProvider(n){s=n},httpAuthSchemeProvider(){return s},setCredentials(n){o=n},credentials(){return o}}},eo=(e)=>({httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()}),to=(e,t)=>{let s=Object.assign(qt(e),ts(e),ys(e),Zn(e));return t.forEach((o)=>o.configure(s)),Object.assign(e,Ft(s),ss(s),Es(s),eo(s))};class H extends ke{config;constructor(...[e]){let t=Xn(e||{});super(t);this.initConfig=t;let s=Zs(t),o=Vt(s),n=Cs(o),u=ds(n),a=Lt(u),g=vs(a),S=Xs(g),p=to(S,e?.extensions||[]);this.config=p,this.middlewareStack.use(xs(this.config)),this.middlewareStack.use(Kt(this.config)),this.middlewareStack.use(_s(this.config)),this.middlewareStack.use(As(this.config)),this.middlewareStack.use(Mt(this.config)),this.middlewareStack.use(jt(this.config)),this.middlewareStack.use(zt(this.config)),this.middlewareStack.use(Yt(this.config,{httpAuthSchemeParametersProvider:Ys,identityProviderConfigProvider:async(v)=>new Qt({"aws.auth#sigv4":v.credentials,"aws.auth#sigv4a":v.credentials})})),this.middlewareStack.use(Bt(this.config))}destroy(){super.destroy()}}var Et=ns(en,"AWSSecurityTokenServiceV20110615","STSClient",fs),At={},It=(e,t,s,o)=>[];class z extends Et(At,It,"AssumeRole",Pt){}class G extends Et(At,It,"AssumeRoleWithWebIdentity",yt){}var so={AssumeRoleCommand:z,AssumeRoleWithWebIdentityCommand:G};class ue extends H{}os(so,ue);var wt=(e)=>{if(typeof e?.Arn==="string"){let t=e.Arn.split(":");if(t.length>4&&t[4]!=="")return t[4]}return},Rt=async(e,t,s,o={})=>{let n=typeof e==="function"?await e():e,u=typeof t==="function"?await t():t,a="",g=n??u??(a=await Gt(o)());return s?.debug?.("@aws-sdk/client-sts::resolveRegion","accepting first of:",`${n} (credential provider clientConfig)`,`${u} (contextual client)`,`${a} (STS default: AWS_REGION, profile region, or us-east-1)`),g},no=(e,t)=>{let s,o;return async(n,u)=>{if(o=n,!s){let{logger:v=e?.parentClientConfig?.logger,profile:A=e?.parentClientConfig?.profile,region:f,requestHandler:m=e?.parentClientConfig?.requestHandler,credentialProviderLogger:T,userAgentAppId:P=e?.parentClientConfig?.userAgentAppId}=e,Q=await Rt(f,e?.parentClientConfig?.region,T,{logger:v,profile:A}),J=!Ct(m);s=new t({...e,userAgentAppId:P,profile:A,credentialDefaultProvider:()=>async()=>o,region:Q,requestHandler:J?m:void 0,logger:v})}let{Credentials:a,AssumedRoleUser:g}=await s.send(new z(u));if(!a||!a.AccessKeyId||!a.SecretAccessKey)throw Error(`Invalid response from STS.assumeRole call with role ${u.RoleArn}`);let S=wt(g),p={accessKeyId:a.AccessKeyId,secretAccessKey:a.SecretAccessKey,sessionToken:a.SessionToken,expiration:a.Expiration,...a.CredentialScope&&{credentialScope:a.CredentialScope},...S&&{accountId:S}};return se(p,"CREDENTIALS_STS_ASSUME_ROLE","i"),p}},oo=(e,t)=>{let s;return async(o)=>{if(!s){let{logger:S=e?.parentClientConfig?.logger,profile:p=e?.parentClientConfig?.profile,region:v,requestHandler:A=e?.parentClientConfig?.requestHandler,credentialProviderLogger:f,userAgentAppId:m=e?.parentClientConfig?.userAgentAppId}=e,T=await Rt(v,e?.parentClientConfig?.region,f,{logger:S,profile:p}),P=!Ct(A);s=new t({...e,userAgentAppId:m,profile:p,region:T,requestHandler:P?A:void 0,logger:S})}let{Credentials:n,AssumedRoleUser:u}=await s.send(new G(o));if(!n||!n.AccessKeyId||!n.SecretAccessKey)throw Error(`Invalid response from STS.assumeRoleWithWebIdentity call with role ${o.RoleArn}`);let a=wt(u),g={accessKeyId:n.AccessKeyId,secretAccessKey:n.SecretAccessKey,sessionToken:n.SessionToken,expiration:n.Expiration,...n.CredentialScope&&{credentialScope:n.CredentialScope},...a&&{accountId:a}};if(a)se(g,"RESOLVED_ACCOUNT_ID","T");return se(g,"CREDENTIALS_STS_ASSUME_ROLE_WEB_ID","k"),g}},Ct=(e)=>e?.metadata?.handlerProtocol==="h2",_t=(e,t)=>{if(!t)return e;else return class extends e{constructor(o){super(o);for(let n of t)this.middlewareStack.use(n)}}},xt=(e={},t)=>no(e,_t(H,t)),Tt=(e={},t)=>oo(e,_t(H,t)),ro=(e)=>(t)=>e({roleAssumer:xt(t),roleAssumerWithWebIdentity:Tt(t),...t});var co=Pt,uo=z,lo=dt,go=gt,po=yt,ho=G,mo=pt,So=ht,vo=ae,fo=ce,Po=U,yo=st,Eo=j,Ao=nt,Io=K,wo=rt,Ro=M,Co=it,_o=q,xo=at,To=F,ko=ct,Do=mt,bo=St,Oo=V,$o=ut,No=ue,Wo=H,Ho=h,Uo=tt,qo=vt,Fo=ro,Vo=lt,Lo=xt,Ko=Tt;export{io as $Command,ao as __Client,co as AssumeRole$,uo as AssumeRoleCommand,lo as AssumeRoleRequest$,go as AssumeRoleResponse$,po as AssumeRoleWithWebIdentity$,ho as AssumeRoleWithWebIdentityCommand,mo as AssumeRoleWithWebIdentityRequest$,So as AssumeRoleWithWebIdentityResponse$,vo as AssumedRoleUser$,fo as Credentials$,Po as ExpiredTokenException,yo as ExpiredTokenException$,Eo as IDPCommunicationErrorException,Ao as IDPCommunicationErrorException$,Io as IDPRejectedClaimException,wo as IDPRejectedClaimException$,Ro as InvalidIdentityTokenException,Co as InvalidIdentityTokenException$,_o as MalformedPolicyDocumentException,xo as MalformedPolicyDocumentException$,To as PackedPolicyTooLargeException,ko as PackedPolicyTooLargeException$,Do as PolicyDescriptorType$,bo as ProvidedContext$,Oo as RegionDisabledException,$o as RegionDisabledException$,No as STS,Wo as STSClient,Ho as STSServiceException,Uo as STSServiceException$,qo as Tag$,Fo as decorateDefaultCredentialProvider,Vo as errorTypeRegistries,Lo as getDefaultRoleAssumer,Ko as getDefaultRoleAssumerWithWebIdentity};
2
+ import{Ko,Ue,it}from"./chunk-8wv5t0w6.js";import{Be}from"./chunk-ecf896fz.js";import{qe,ve,L}from"./chunk-q9dd6fhj.js";import{be,X,b,Se,J,Qe,H}from"./chunk-c7rcw9fb.js";import{r}from"./chunk-bwawt15q.js";var fe=r(function(Dt){var{SignatureV4:kt,signatureV4aContainer:de}=Ko(),O={CrtSignerV4:null},ge="X-Amz-S3session-Token".toLowerCase();class Z extends kt{async signWithCredentials(e,t,s){let o=pe(t);e.headers[ge]=t.sessionToken;let n=this;return he(n,o),n.signRequest(e,s??{})}async presignWithCredentials(e,t,s){let o=pe(t);return delete e.headers[ge],e.headers["X-Amz-S3session-Token"]=t.sessionToken,e.query=e.query??{},e.query["X-Amz-S3session-Token"]=t.sessionToken,he(this,o),this.presign(e,s)}}function pe(e){return{accessKeyId:e.accessKeyId,secretAccessKey:e.secretAccessKey,expiration:e.expiration}}function he(e,t){let s=e.credentialProvider;e.credentialProvider=()=>(e.credentialProvider=s,Promise.resolve(t))}class me{sigv4aSigner;sigv4Signer;signerOptions;static sigv4aDependency(){if(typeof O.CrtSignerV4==="function")return"crt";else if(typeof de.SignatureV4a==="function")return"js";return"none"}constructor(e){this.sigv4Signer=new Z(e),this.signerOptions=e}async sign(e,t={}){if(t.signingRegion==="*")return this.getSigv4aSigner().sign(e,t);return this.sigv4Signer.sign(e,t)}async signWithCredentials(e,t,s={}){if(s.signingRegion==="*"){let o=this.getSigv4aSigner(),n=O.CrtSignerV4;if(n&&o instanceof n)return o.signWithCredentials(e,t,s);else throw Error(`signWithCredentials with signingRegion '*' is only supported when using the CRT dependency @aws-sdk/signature-v4-crt. Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. You must also register the package by calling [require("@aws-sdk/signature-v4-crt");] or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt`)}return this.sigv4Signer.signWithCredentials(e,t,s)}async presign(e,t={}){if(t.signingRegion==="*"){let s=this.getSigv4aSigner(),o=O.CrtSignerV4;if(o&&s instanceof o)return s.presign(e,t);else throw Error(`presign with signingRegion '*' is only supported when using the CRT dependency @aws-sdk/signature-v4-crt. Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. You must also register the package by calling [require("@aws-sdk/signature-v4-crt");] or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt`)}return this.sigv4Signer.presign(e,t)}async presignWithCredentials(e,t,s={}){if(s.signingRegion==="*")throw Error("Method presignWithCredentials is not supported for [signingRegion=*].");return this.sigv4Signer.presignWithCredentials(e,t,s)}getSigv4aSigner(){if(!this.sigv4aSigner){let e=O.CrtSignerV4,t=de.SignatureV4a;if(this.signerOptions.runtime==="node"){if(!e&&!t)throw Error("Neither CRT nor JS SigV4a implementation is available. Please load either @aws-sdk/signature-v4-crt or @aws-sdk/signature-v4a. For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt");if(e&&typeof e==="function")this.sigv4aSigner=new e({...this.signerOptions,signingAlgorithm:1});else if(t&&typeof t==="function")this.sigv4aSigner=new t({...this.signerOptions});else throw Error("Available SigV4a implementation is not a valid constructor. Please ensure you've properly imported @aws-sdk/signature-v4-crt or @aws-sdk/signature-v4a.For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt")}else{if(!t||typeof t!=="function")throw Error("JS SigV4a implementation is not available or not a valid constructor. Please check whether you have installed the @aws-sdk/signature-v4a package explicitly. The CRT implementation is not available for browsers. You must also register the package by calling [require('@aws-sdk/signature-v4a');] or an ESM equivalent such as [import '@aws-sdk/signature-v4a';]. For more information please go to https://github.com/aws/aws-sdk-js-v3#using-javascript-non-crt-implementation-of-sigv4a");this.sigv4aSigner=new t({...this.signerOptions})}}return this.sigv4aSigner}}Dt.SignatureV4MultiRegion=me;Dt.SignatureV4SignWithCredentials=Z;Dt.signatureV4CrtContainer=O});var{awsEndpointFunctions:Nt,emitWarningIfUnsupportedVersion:Wt,createDefaultUserAgentProvider:Ht,NODE_APP_ID_CONFIG_OPTIONS:Ut,getAwsRegionExtensionConfiguration:qt,resolveAwsRegionExtensionConfiguration:Ft,resolveUserAgentConfig:Vt,resolveHostHeaderConfig:Lt,getUserAgentPlugin:Kt,getHostHeaderPlugin:Mt,getLoggerPlugin:jt,getRecursionDetectionPlugin:zt,setCredentialFeature:se,stsRegionDefaultResolver:Gt}=L(),{NoAuthSigner:_e,getHttpAuthSchemeEndpointRuleSetPlugin:Yt,DefaultIdentityProviderConfig:Qt,getHttpSigningPlugin:Bt}=ve(),{normalizeProvider:xe,getSmithyContext:Te,ServiceException:Jt,NoOpLogger:Xt,emitWarningIfUnsupportedVersion:Zt,loadConfigsForDefaultMode:es,getDefaultExtensionConfiguration:ts,resolveDefaultRuntimeConfig:ss,Client:ke,makeBuilder:ns,createAggregatedClient:os}=X(),{Command:rs}=X();var io=rs,ao=ke;var{resolveDefaultsModeConfig:is,loadConfig:y,NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS:as,NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS:cs,NODE_REGION_CONFIG_OPTIONS:us,NODE_REGION_CONFIG_FILE_OPTIONS:ls,resolveRegionConfig:ds}=b(),{BinaryDecisionDiagram:gs,EndpointCache:ps,decideEndpoint:hs,customEndpointFunctions:ms,resolveParams:Ss,resolveEndpointConfig:vs,getEndpointPlugin:fs}=Se(),{parseUrl:Ps,getHttpHandlerExtensionConfiguration:ys,resolveHttpHandlerRuntimeConfig:Es,getContentLengthPlugin:As}=H(),{DEFAULT_RETRY_MODE:Is,NODE_RETRY_MODE_CONFIG_OPTIONS:ws,NODE_MAX_ATTEMPT_CONFIG_OPTIONS:Rs,resolveRetryConfig:Cs,getRetryPlugin:_s}=qe(),{TypeRegistry:De,getSchemaSerdePlugin:xs}=be(),{resolveAwsSdkSigV4Config:Ts,resolveAwsSdkSigV4AConfig:ks,AwsSdkSigV4Signer:Oe,AwsSdkSigV4ASigner:$e,NODE_SIGV4A_CONFIG_OPTIONS:Ds,NODE_AUTH_SCHEME_PREFERENCE_OPTIONS:bs}=Ue(),{SignatureV4MultiRegion:Ne}=fe(),{toUtf8:Os,fromUtf8:$s,toBase64:Ns,fromBase64:Ws,calculateBodyLength:Hs}=J(),{streamCollector:Us,NodeHttpHandler:qs}=Be(),{AwsQueryProtocol:Fs}=it(),{Sha256:Vs}=Qe(),D="ref",I=-1,N=!0,Pe="isSet",We="PartitionResult",W="booleanEquals",l="stringEquals",ee="getAttr",ye="us-east-1",Ee="sigv4",Ae="sts",Ie="https://sts.{Region}.{PartitionResult#dnsSuffix}",we={[D]:"Endpoint"},d={[D]:"Region"},te={[D]:We},k={},Re=[d],Ce={conditions:[[Pe,[we]],[Pe,Re],["aws.partition",Re,We],[W,[{[D]:"UseFIPS"},N]],[W,[{[D]:"UseDualStack"},N]],[l,[d,"aws-global"]],[W,[{[D]:"UseGlobalEndpoint"},N]],[l,[d,"eu-central-1"]],[W,[{fn:ee,argv:[te,"supportsDualStack"]},N]],[W,[{fn:ee,argv:[te,"supportsFIPS"]},N]],[l,[d,"ap-south-1"]],[l,[d,"eu-north-1"]],[l,[d,"eu-west-1"]],[l,[d,"eu-west-2"]],[l,[d,"eu-west-3"]],[l,[d,"sa-east-1"]],[l,[d,ye]],[l,[d,"us-east-2"]],[l,[d,"us-west-2"]],[l,[d,"us-west-1"]],[l,[d,"ca-central-1"]],[l,[d,"ap-southeast-1"]],[l,[d,"ap-northeast-1"]],[l,[d,"ap-southeast-2"]],[l,[{fn:ee,argv:[te,"name"]},"aws-us-gov"]]],results:[[I],["https://sts.amazonaws.com",{authSchemes:[{name:Ee,signingName:Ae,signingRegion:ye}]}],[Ie,{authSchemes:[{name:Ee,signingName:Ae,signingRegion:"{Region}"}]}],[I,"Invalid Configuration: FIPS and custom endpoint are not supported"],[I,"Invalid Configuration: Dualstack and custom endpoint are not supported"],[we,k],["https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",k],[I,"FIPS and DualStack are enabled, but this partition does not support one or both"],["https://sts.{Region}.amazonaws.com",k],["https://sts-fips.{Region}.{PartitionResult#dnsSuffix}",k],[I,"FIPS is enabled but this partition does not support FIPS"],["https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}",k],[I,"DualStack is enabled but this partition does not support DualStack"],[Ie,k],[I,"Invalid Configuration: Missing Region"]]},Ls=2,i=1e8,Ks=new Int32Array([-1,1,-1,0,30,3,1,4,i+14,2,5,i+14,3,25,6,4,24,7,5,i+1,8,6,9,i+13,7,i+1,10,10,i+1,11,11,i+1,12,12,i+1,13,13,i+1,14,14,i+1,15,15,i+1,16,16,i+1,17,17,i+1,18,18,i+1,19,19,i+1,20,20,i+1,21,21,i+1,22,22,i+1,23,23,i+1,i+2,8,i+11,i+12,4,28,26,9,27,i+10,24,i+8,i+9,8,29,i+7,9,i+6,i+7,3,i+3,31,4,i+4,i+5]),Ms=gs.from(Ks,Ls,Ce.conditions,Ce.results),js=new ps({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS","UseGlobalEndpoint"]}),He=(e,t={})=>js.get(e,()=>hs(Ms,{endpointParams:e,logger:t.logger}));ms.aws=Nt;var zs=(e)=>async(t,s,o)=>{if(!o)throw Error("Could not find `input` for `defaultEndpointRuleSetHttpAuthSchemeParametersProvider`");let n=await e(t,s,o),u=Te(s)?.commandInstance?.constructor?.getEndpointParameterInstructions;if(!u)throw Error(`getEndpointParameterInstructions() is not defined on '${s.commandName}'`);let a=await Ss(o,{getEndpointParameterInstructions:u},t);return Object.assign(n,a)},Gs=async(e,t,s)=>({operation:Te(t).operation,region:await xe(e.region)()||(()=>{throw Error("expected `region` to be configured for `aws.auth#sigv4`")})()}),Ys=zs(Gs);function Fe(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sts",region:e.region},propertiesExtractor:(t,s)=>({signingProperties:{config:t,context:s}})}}function ne(e){return{schemeId:"aws.auth#sigv4a",signingProperties:{name:"sts",region:e.region},propertiesExtractor:(t,s)=>({signingProperties:{config:t,context:s}})}}function Ve(e){return{schemeId:"smithy.api#noAuth"}}var Qs=(e,t,s)=>(n)=>{let a=e(n).properties?.authSchemes;if(!a)return t(n);let g=[];for(let S of a){let{name:p,properties:v={},...A}=S,f=p.toLowerCase();if(p!==f)console.warn(`HttpAuthScheme has been normalized with lowercasing: '${p}' to '${f}'`);let m;if(f==="sigv4a"){m="aws.auth#sigv4a";let Q=a.find((B)=>{let le=B.name.toLowerCase();return le!=="sigv4a"&&le.startsWith("sigv4")});if(Ne.sigv4aDependency()==="none"&&Q)continue}else if(f.startsWith("sigv4"))m="aws.auth#sigv4";else throw Error(`Unknown HttpAuthScheme found in '@smithy.rules#endpointRuleSet': '${f}'`);let T=s[m];if(!T)throw Error(`Could not find HttpAuthOption create function for '${m}'`);let P=T(n);P.schemeId=m,P.signingProperties={...P.signingProperties||{},...A,...v},g.push(P)}return g},Bs=(e)=>{let t=[];switch(e.operation){case"AssumeRoleWithWebIdentity":{t.push(Ve()),t.push(ne(e));break}default:t.push(Fe(e)),t.push(ne(e))}return t},Js=Qs(He,Bs,{"aws.auth#sigv4":Fe,"aws.auth#sigv4a":ne,"smithy.api#noAuth":Ve}),Xs=(e)=>{let t=Ts(e),s=ks(t);return Object.assign(s,{authSchemePreference:xe(e.authSchemePreference??[])})},Zs=(e)=>Object.assign(e,{useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,useGlobalEndpoint:e.useGlobalEndpoint??!1,defaultSigningName:"sts"}),en={UseGlobalEndpoint:{type:"builtInParams",name:"useGlobalEndpoint"},UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},tn="3.997.47",sn={version:tn};class h extends Jt{static shapeId="smithy.ts.sdk.synthetic.com.amazonaws.sts#STSServiceException";constructor(e){super(e);Object.setPrototypeOf(this,h.prototype)}}class q extends h{static shapeId="com.amazonaws.sts#ExpiredTokenException";name="ExpiredTokenException";$fault="client";constructor(e){super({name:"ExpiredTokenException",$fault:"client",...e});Object.setPrototypeOf(this,q.prototype)}}class F extends h{static shapeId="com.amazonaws.sts#MalformedPolicyDocumentException";name="MalformedPolicyDocumentException";$fault="client";constructor(e){super({name:"MalformedPolicyDocumentException",$fault:"client",...e});Object.setPrototypeOf(this,F.prototype)}}class V extends h{static shapeId="com.amazonaws.sts#PackedPolicyTooLargeException";name="PackedPolicyTooLargeException";$fault="client";constructor(e){super({name:"PackedPolicyTooLargeException",$fault:"client",...e});Object.setPrototypeOf(this,V.prototype)}}class K extends h{static shapeId="com.amazonaws.sts#RegionDisabledException";name="RegionDisabledException";$fault="client";constructor(e){super({name:"RegionDisabledException",$fault:"client",...e});Object.setPrototypeOf(this,K.prototype)}}class M extends h{static shapeId="com.amazonaws.sts#IDPRejectedClaimException";name="IDPRejectedClaimException";$fault="client";constructor(e){super({name:"IDPRejectedClaimException",$fault:"client",...e});Object.setPrototypeOf(this,M.prototype)}}class j extends h{static shapeId="com.amazonaws.sts#InvalidIdentityTokenException";name="InvalidIdentityTokenException";$fault="client";constructor(e){super({name:"InvalidIdentityTokenException",$fault:"client",...e});Object.setPrototypeOf(this,j.prototype)}}class z extends h{static shapeId="com.amazonaws.sts#IDPCommunicationErrorException";name="IDPCommunicationErrorException";$fault="client";$retryable={};constructor(e){super({name:"IDPCommunicationErrorException",$fault:"client",...e});Object.setPrototypeOf(this,z.prototype)}}var nn="Arn",on="AccessKeyId",rn="AssumeRole",an="AssumedRoleId",cn="AssumeRoleRequest",un="AssumeRoleResponse",oe="AssumedRoleUser",ln="AssumeRoleWithWebIdentity",dn="AssumeRoleWithWebIdentityRequest",gn="AssumeRoleWithWebIdentityResponse",pn="Audience",re="Credentials",hn="ContextAssertion",Le="DurationSeconds",mn="Expiration",Sn="ExternalId",vn="ExpiredTokenException",fn="IDPCommunicationErrorException",Pn="IDPRejectedClaimException",yn="InvalidIdentityTokenException",En="Key",An="MalformedPolicyDocumentException",Ke="MinimumSessionTokenSize",Me="Policy",je="PolicyArns",In="ProviderArn",wn="ProvidedContexts",Rn="ProvidedContextsListType",Cn="ProvidedContext",_n="PolicyDescriptorType",xn="ProviderId",ze="PackedPolicySize",Tn="PackedPolicyTooLargeException",kn="Provider",Ge="RoleArn",Dn="RegionDisabledException",Ye="RoleSessionName",bn="SecretAccessKey",On="SubjectFromWebIdentityToken",ie="SourceIdentity",$n="SerialNumber",Nn="SessionToken",Je="SessionTokenSize",Xe="SessionTokenUtilization",Wn="Tags",Hn="TokenCode",Un="TransitiveTagKeys",qn="Tag",Fn="Value",Vn="WebIdentityToken",Ln="arn",Kn="accessKeySecretType",w="awsQueryError",R="client",Mn="clientTokenType",C="error",_="httpError",x="message",jn="policyDescriptorListType",Ze="smithy.ts.sdk.synthetic.com.amazonaws.sts",zn="tagListType",c="com.amazonaws.sts",et=new De(Ze),tt=[-3,Ze,"STSServiceException",0,[],[]];et.registerError(tt,h);var E=new De(c),st=[-3,c,vn,{[w]:["ExpiredTokenException",400],[C]:R,[_]:400},[x],[0]];E.registerError(st,q);var nt=[-3,c,fn,{[w]:["IDPCommunicationError",400],[C]:R,[_]:400},[x],[0]];E.registerError(nt,z);var ot=[-3,c,Pn,{[w]:["IDPRejectedClaim",403],[C]:R,[_]:403},[x],[0]];E.registerError(ot,M);var rt=[-3,c,yn,{[w]:["InvalidIdentityToken",400],[C]:R,[_]:400},[x],[0]];E.registerError(rt,j);var at=[-3,c,An,{[w]:["MalformedPolicyDocument",400],[C]:R,[_]:400},[x],[0]];E.registerError(at,F);var ct=[-3,c,Tn,{[w]:["PackedPolicyTooLarge",400],[C]:R,[_]:400},[x],[0]];E.registerError(ct,V);var ut=[-3,c,Dn,{[w]:["RegionDisabledException",403],[C]:R,[_]:403},[x],[0]];E.registerError(ut,K);var lt=[et,E],Gn=[0,c,Kn,8,0],Yn=[0,c,Mn,8,0],ae=[3,c,oe,0,[an,nn],[0,0],2],dt=[3,c,cn,0,[Ge,Ye,je,Me,Le,Wn,Un,Sn,$n,Hn,ie,wn,Ke],[0,0,()=>ft,0,1,()=>Bn,64,0,0,0,0,()=>Qn,1],2],gt=[3,c,un,0,[re,oe,ze,ie,Xe,Je],[[()=>ce,0],()=>ae,1,0,1,1]],pt=[3,c,dn,0,[Ge,Ye,Vn,xn,je,Me,Le,Ke],[0,0,[()=>Yn,0],0,()=>ft,0,1,1],3],ht=[3,c,gn,0,[re,On,oe,ze,kn,pn,ie,Xe,Je],[[()=>ce,0],0,()=>ae,1,0,0,0,1,1]],ce=[3,c,re,0,[on,bn,Nn,mn],[0,[()=>Gn,0],0,4],4],mt=[3,c,_n,0,[Ln],[0]],St=[3,c,Cn,0,[In,hn],[0,0]],vt=[3,c,qn,0,[En,Fn],[0,0],2],ft=[1,c,jn,0,()=>mt],Qn=[1,c,Rn,0,()=>St],Bn=[1,c,zn,0,()=>vt],Pt=[9,c,rn,0,()=>dt,()=>gt],yt=[9,c,ln,0,()=>pt,()=>ht],Jn=(e)=>({apiVersion:"2011-06-15",base64Decoder:e?.base64Decoder??Ws,base64Encoder:e?.base64Encoder??Ns,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??He,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??Js,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(t)=>t.getIdentityProvider("aws.auth#sigv4"),signer:new Oe},{schemeId:"aws.auth#sigv4a",identityProvider:(t)=>t.getIdentityProvider("aws.auth#sigv4a"),signer:new $e},{schemeId:"smithy.api#noAuth",identityProvider:(t)=>t.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new _e}],logger:e?.logger??new Xt,protocol:e?.protocol??Fs,protocolSettings:e?.protocolSettings??{defaultNamespace:"com.amazonaws.sts",errorTypeRegistries:lt,xmlNamespace:"https://sts.amazonaws.com/doc/2011-06-15/",version:"2011-06-15",serviceTarget:"AWSSecurityTokenServiceV20110615"},serviceId:e?.serviceId??"STS",sha256:e?.sha256??Vs,signerConstructor:e?.signerConstructor??Ne,urlParser:e?.urlParser??Ps,utf8Decoder:e?.utf8Decoder??$s,utf8Encoder:e?.utf8Encoder??Os}),Xn=(e)=>{Zt(process.version);let t=is(e),s=()=>t().then(es),o=Jn(e);Wt(process.version);let n={profile:e?.profile,logger:o.logger};return{...o,...e,runtime:"node",defaultsMode:t,authSchemePreference:e?.authSchemePreference??y(bs,n),bodyLengthChecker:e?.bodyLengthChecker??Hs,defaultUserAgentProvider:e?.defaultUserAgentProvider??Ht({serviceId:o.serviceId,clientVersion:sn.version}),httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(u)=>u.getIdentityProvider("aws.auth#sigv4")||(async(a)=>await e.credentialDefaultProvider(a?.__config||{})()),signer:new Oe},{schemeId:"aws.auth#sigv4a",identityProvider:(u)=>u.getIdentityProvider("aws.auth#sigv4a"),signer:new $e},{schemeId:"smithy.api#noAuth",identityProvider:(u)=>u.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new _e}],maxAttempts:e?.maxAttempts??y(Rs,e),region:e?.region??y(us,{...ls,...n}),requestHandler:qs.create(e?.requestHandler??s),retryMode:e?.retryMode??y({...ws,default:async()=>(await s()).retryMode||Is},e),sigv4aSigningRegionSet:e?.sigv4aSigningRegionSet??y(Ds,n),streamCollector:e?.streamCollector??Us,useDualstackEndpoint:e?.useDualstackEndpoint??y(cs,n),useFipsEndpoint:e?.useFipsEndpoint??y(as,n),userAgentAppId:e?.userAgentAppId??y(Ut,n)}},Zn=(e)=>{let{httpAuthSchemes:t,httpAuthSchemeProvider:s,credentials:o}=e;return{setHttpAuthScheme(n){let u=t.findIndex((a)=>a.schemeId===n.schemeId);if(u===-1)t.push(n);else t.splice(u,1,n)},httpAuthSchemes(){return t},setHttpAuthSchemeProvider(n){s=n},httpAuthSchemeProvider(){return s},setCredentials(n){o=n},credentials(){return o}}},eo=(e)=>({httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()}),to=(e,t)=>{let s=Object.assign(qt(e),ts(e),ys(e),Zn(e));return t.forEach((o)=>o.configure(s)),Object.assign(e,Ft(s),ss(s),Es(s),eo(s))};class U extends ke{config;constructor(...[e]){let t=Xn(e||{});super(t);this.initConfig=t;let s=Zs(t),o=Vt(s),n=Cs(o),u=ds(n),a=Lt(u),g=vs(a),S=Xs(g),p=to(S,e?.extensions||[]);this.config=p,this.middlewareStack.use(xs(this.config)),this.middlewareStack.use(Kt(this.config)),this.middlewareStack.use(_s(this.config)),this.middlewareStack.use(As(this.config)),this.middlewareStack.use(Mt(this.config)),this.middlewareStack.use(jt(this.config)),this.middlewareStack.use(zt(this.config)),this.middlewareStack.use(Yt(this.config,{httpAuthSchemeParametersProvider:Ys,identityProviderConfigProvider:async(v)=>new Qt({"aws.auth#sigv4":v.credentials,"aws.auth#sigv4a":v.credentials})})),this.middlewareStack.use(Bt(this.config))}destroy(){super.destroy()}}var Et=ns(en,"AWSSecurityTokenServiceV20110615","STSClient",fs),At={},It=(e,t,s,o)=>[];class G extends Et(At,It,"AssumeRole",Pt){}class Y extends Et(At,It,"AssumeRoleWithWebIdentity",yt){}var so={AssumeRoleCommand:G,AssumeRoleWithWebIdentityCommand:Y};class ue extends U{}os(so,ue);var wt=(e)=>{if(typeof e?.Arn==="string"){let t=e.Arn.split(":");if(t.length>4&&t[4]!=="")return t[4]}return},Rt=async(e,t,s,o={})=>{let n=typeof e==="function"?await e():e,u=typeof t==="function"?await t():t,a="",g=n??u??(a=await Gt(o)());return s?.debug?.("@aws-sdk/client-sts::resolveRegion","accepting first of:",`${n} (credential provider clientConfig)`,`${u} (contextual client)`,`${a} (STS default: AWS_REGION, profile region, or us-east-1)`),g},no=(e,t)=>{let s,o;return async(n,u)=>{if(o=n,!s){let{logger:v=e?.parentClientConfig?.logger,profile:A=e?.parentClientConfig?.profile,region:f,requestHandler:m=e?.parentClientConfig?.requestHandler,credentialProviderLogger:T,userAgentAppId:P=e?.parentClientConfig?.userAgentAppId}=e,Q=await Rt(f,e?.parentClientConfig?.region,T,{logger:v,profile:A}),B=!Ct(m);s=new t({...e,userAgentAppId:P,profile:A,credentialDefaultProvider:()=>async()=>o,region:Q,requestHandler:B?m:void 0,logger:v})}let{Credentials:a,AssumedRoleUser:g}=await s.send(new G(u));if(!a||!a.AccessKeyId||!a.SecretAccessKey)throw Error(`Invalid response from STS.assumeRole call with role ${u.RoleArn}`);let S=wt(g),p={accessKeyId:a.AccessKeyId,secretAccessKey:a.SecretAccessKey,sessionToken:a.SessionToken,expiration:a.Expiration,...a.CredentialScope&&{credentialScope:a.CredentialScope},...S&&{accountId:S}};return se(p,"CREDENTIALS_STS_ASSUME_ROLE","i"),p}},oo=(e,t)=>{let s;return async(o)=>{if(!s){let{logger:S=e?.parentClientConfig?.logger,profile:p=e?.parentClientConfig?.profile,region:v,requestHandler:A=e?.parentClientConfig?.requestHandler,credentialProviderLogger:f,userAgentAppId:m=e?.parentClientConfig?.userAgentAppId}=e,T=await Rt(v,e?.parentClientConfig?.region,f,{logger:S,profile:p}),P=!Ct(A);s=new t({...e,userAgentAppId:m,profile:p,region:T,requestHandler:P?A:void 0,logger:S})}let{Credentials:n,AssumedRoleUser:u}=await s.send(new Y(o));if(!n||!n.AccessKeyId||!n.SecretAccessKey)throw Error(`Invalid response from STS.assumeRoleWithWebIdentity call with role ${o.RoleArn}`);let a=wt(u),g={accessKeyId:n.AccessKeyId,secretAccessKey:n.SecretAccessKey,sessionToken:n.SessionToken,expiration:n.Expiration,...n.CredentialScope&&{credentialScope:n.CredentialScope},...a&&{accountId:a}};if(a)se(g,"RESOLVED_ACCOUNT_ID","T");return se(g,"CREDENTIALS_STS_ASSUME_ROLE_WEB_ID","k"),g}},Ct=(e)=>e?.metadata?.handlerProtocol==="h2",_t=(e,t)=>{if(!t)return e;else return class extends e{constructor(o){super(o);for(let n of t)this.middlewareStack.use(n)}}},xt=(e={},t)=>no(e,_t(U,t)),Tt=(e={},t)=>oo(e,_t(U,t)),ro=(e)=>(t)=>e({roleAssumer:xt(t),roleAssumerWithWebIdentity:Tt(t),...t});var co=Pt,uo=G,lo=dt,go=gt,po=yt,ho=Y,mo=pt,So=ht,vo=ae,fo=ce,Po=q,yo=st,Eo=z,Ao=nt,Io=M,wo=ot,Ro=j,Co=rt,_o=F,xo=at,To=V,ko=ct,Do=mt,bo=St,Oo=K,$o=ut,No=ue,Wo=U,Ho=h,Uo=tt,qo=vt,Fo=ro,Vo=lt,Lo=xt,Mo=Tt;export{io as $Command,ao as __Client,co as AssumeRole$,uo as AssumeRoleCommand,lo as AssumeRoleRequest$,go as AssumeRoleResponse$,po as AssumeRoleWithWebIdentity$,ho as AssumeRoleWithWebIdentityCommand,mo as AssumeRoleWithWebIdentityRequest$,So as AssumeRoleWithWebIdentityResponse$,vo as AssumedRoleUser$,fo as Credentials$,Po as ExpiredTokenException,yo as ExpiredTokenException$,Eo as IDPCommunicationErrorException,Ao as IDPCommunicationErrorException$,Io as IDPRejectedClaimException,wo as IDPRejectedClaimException$,Ro as InvalidIdentityTokenException,Co as InvalidIdentityTokenException$,_o as MalformedPolicyDocumentException,xo as MalformedPolicyDocumentException$,To as PackedPolicyTooLargeException,ko as PackedPolicyTooLargeException$,Do as PolicyDescriptorType$,bo as ProvidedContext$,Oo as RegionDisabledException,$o as RegionDisabledException$,No as STS,Wo as STSClient,Ho as STSServiceException,Uo as STSServiceException$,qo as Tag$,Fo as decorateDefaultCredentialProvider,Vo as errorTypeRegistries,Lo as getDefaultRoleAssumer,Mo as getDefaultRoleAssumerWithWebIdentity};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{dr,kt,zt,jt,Vt,Kt,mr,hr,Rt,fr,gr,yr,br,Sr,xr}from"./chunk-9rmqgc3c.js";import{_}from"./chunk-pxsrqrd0.js";import{ee}from"./chunk-tvm4zmgj.js";import{q,j}from"./chunk-y69ewdn2.js";import{V}from"./chunk-whvj83b7.js";import{g}from"./chunk-n6e43rvk.js";import{fe}from"./chunk-x4874m8e.js";import{N,pe,ne,Le,Q,H}from"./chunk-8wc8qdx8.js";import{M}from"./chunk-shadcb9z.js";var b="v1",O="gcp-vertex-credentials",R=0,y=(e,o,t)=>{let i=new M,u=Le(o);return(async()=>{let n={role:"assistant",content:[],api:"google-vertex",provider:e.provider,model:e.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"pending",timestamp:Date.now()};try{if(t?.fetch&&t.fetch!==globalThis.fetch)throw Error("Custom fetch is not supported by the Google Vertex adapter");let c=L(t),d=c?S(e,c,t?.headers):I(e,P(t),U(t),t?.headers,t?.env),p=D(e,u,t),k=await t?.onPayload?.(p,e);if(k!==void 0)p=k;let f=await xr(()=>d.models.generateContentStream(p),t);i.push({type:"start",partial:n});let r=null,m=n.content,l=()=>m.length-1;for await(let s of f){await t?.onProviderStreamEvent?.(s,e),n.responseId||=s.responseId;let C=s.candidates?.[0];if(C?.content?.parts)for(let a of C.content.parts){if(a.text!==void 0){let h=hr(a);if(!r||h&&r.type!=="thinking"||!h&&r.type!=="text"){if(r)if(r.type==="text")i.push({type:"text_end",contentIndex:m.length-1,content:r.text,partial:n});else i.push({type:"thinking_end",contentIndex:l(),content:r.thinking,partial:n});if(h)r={type:"thinking",thinking:"",thinkingSignature:void 0},n.content.push(r),i.push({type:"thinking_start",contentIndex:l(),partial:n});else r={type:"text",text:""},n.content.push(r),i.push({type:"text_start",contentIndex:l(),partial:n})}if(r.type==="thinking")r.thinking+=a.text,r.thinkingSignature=Rt(r.thinkingSignature,a.thoughtSignature),i.push({type:"thinking_delta",contentIndex:l(),delta:a.text,partial:n});else r.text+=a.text,r.textSignature=Rt(r.textSignature,a.thoughtSignature),i.push({type:"text_delta",contentIndex:l(),delta:a.text,partial:n})}if(a.functionCall){if(r){if(r.type==="text")i.push({type:"text_end",contentIndex:l(),content:r.text,partial:n});else i.push({type:"thinking_end",contentIndex:l(),content:r.thinking,partial:n});r=null}let h=a.functionCall.id,x={type:"toolCall",id:!h||n.content.some((T)=>T.type==="toolCall"&&T.id===h)?`${a.functionCall.name}_${Date.now()}_${++R}`:h,name:a.functionCall.name||"",arguments:a.functionCall.args??{},...a.thoughtSignature&&{thoughtSignature:a.thoughtSignature}};n.content.push(x),i.push({type:"toolcall_start",contentIndex:l(),partial:n}),i.push({type:"toolcall_delta",contentIndex:l(),delta:JSON.stringify(x.arguments),partial:n}),i.push({type:"toolcall_end",contentIndex:l(),toolCall:x,partial:n})}}if(C?.finishReason){if(n.rawStopReason=C.finishReason,n.stopReason=Sr(C.finishReason),n.content.some((a)=>a.type==="toolCall")&&n.stopReason==="stop")n.stopReason="toolUse"}if(s.usageMetadata)n.usage={input:(s.usageMetadata.promptTokenCount||0)-(s.usageMetadata.cachedContentTokenCount||0),output:(s.usageMetadata.candidatesTokenCount||0)+(s.usageMetadata.thoughtsTokenCount||0),cacheRead:s.usageMetadata.cachedContentTokenCount||0,cacheWrite:0,reasoning:s.usageMetadata.thoughtsTokenCount||0,totalTokens:s.usageMetadata.totalTokenCount||0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},Q(e,n.usage)}if(r)if(r.type==="text")i.push({type:"text_end",contentIndex:l(),content:r.text,partial:n});else i.push({type:"thinking_end",contentIndex:l(),content:r.thinking,partial:n});if(t?.signal?.aborted)throw Error("Request was aborted");if(n.stopReason==="pending")throw Error("Google Vertex stream ended without a finish reason");if(n.stopReason==="aborted"||n.stopReason==="error"){let s=n.rawStopReason?`Provider stopped with: ${n.rawStopReason}`:"An unknown error occurred";throw Error(s)}i.push({type:"done",reason:n.stopReason,message:n}),i.end()}catch(c){for(let d of n.content)if("index"in d)delete d.index;n.stopReason=t?.signal?.aborted?"aborted":"error",n.errorMessage=j(q(c)),i.push({type:"error",reason:n.stopReason,error:n}),i.end()}})(),i},ue=(e,o,t)=>{let i={...V(e,o,t,void 0),toolChoice:t?.toolChoice};if(!t?.reasoning)return y(e,o,{...i,thinking:{enabled:!1}});let u=H(e,t.reasoning);if(u==="off")return y(e,o,{...i,thinking:{enabled:!1}});let n=zt(e,u);if(jt(e))return y(e,o,{...i,thinking:{enabled:!0,level:Vt(n)}});return y(e,o,{...i,thinking:{enabled:!0,budgetTokens:K(e,n,t.thinkingBudgets)}})};function I(e,o,t,i,u){let n=G(u);return new kt({vertexai:!0,project:o,location:t,apiVersion:b,...n?{googleAuthOptions:n}:{},httpOptions:v(e,i)})}function S(e,o,t){return new kt({vertexai:!0,apiKey:o,apiVersion:b,httpOptions:v(e,t)})}function v(e,o){let t={},i=w(e.baseUrl);if(i){if(t.baseUrl=i,t.baseUrlResourceScope=dr.COLLECTION,E(i))t.apiVersion=""}let u=fe({"User-Agent":ee(),...e.headers,...o});if(u)t.headers=u;return Object.keys(t).length>0?t:void 0}function w(e){let o=e.trim();if(!o||o.includes("{location}"))return;return o}function E(e){try{return new URL(e).pathname.split("/").some((t)=>/^v\d+(?:beta\d*)?$/.test(t))}catch{return/(?:^|\/)v\d+(?:beta\d*)?(?:\/|$)/.test(e)}}function G(e){let o=_("GOOGLE_APPLICATION_CREDENTIALS",e);return o?{keyFilename:o}:void 0}function L(e){let o=e?.apiKey?.trim();if(!o||o===O||A(o))return;return o}function A(e){return/^<[^>]+>$/.test(e)}function P(e){let o=e?.project||_("GOOGLE_CLOUD_PROJECT",e?.env)||_("GCLOUD_PROJECT",e?.env);if(!o)throw Error("Vertex AI requires a project ID. Set GOOGLE_CLOUD_PROJECT/GCLOUD_PROJECT or pass project in options.");return o}function U(e){let o=e?.location||_("GOOGLE_CLOUD_LOCATION",e?.env);if(!o)throw Error("Vertex AI requires a location. Set GOOGLE_CLOUD_LOCATION or pass location in options.");return o}function D(e,o,t={}){let i=fr(e,o),u=pe(o.messages),n=ne(o.messages),c={};if(t.temperature!==void 0)c.temperature=t.temperature;if(t.maxTokens!==void 0)c.maxOutputTokens=t.maxTokens;let d=yr(e.id),p=n.length>0?br(n,t.toolChoice,d):void 0,k=u?N(u):"",f={...Object.keys(c).length>0&&c,...k&&{systemInstruction:g(k)},...n.length>0&&{tools:gr(n,!1,d)},...p!==void 0&&{toolConfig:{functionCallingConfig:{mode:p}}}};if(t.thinking?.enabled&&e.reasoning){let m={includeThoughts:!0};if(t.thinking.level!==void 0)m.thinkingLevel=Kt(t.thinking.level);else if(t.thinking.budgetTokens!==void 0)m.thinkingBudget=t.thinking.budgetTokens;f.thinkingConfig=m}else if(e.reasoning&&t.thinking&&!t.thinking.enabled)f.thinkingConfig=mr(e);if(t.signal){if(t.signal.aborted)throw Error("Request aborted");f.abortSignal=t.signal}return{model:e.id,contents:i,config:f}}function K(e,o,t){if(t?.[o]!==void 0)return t[o];if(e.id.includes("2.5-pro"))return{minimal:128,low:2048,medium:8192,high:32768}[o];if(e.id.includes("2.5-flash"))return{minimal:128,low:2048,medium:8192,high:24576}[o];return-1}export{y as stream,ue as streamSimple};
2
+ import{fr,kt,zt,jt,Vt,Kt,gr,yr,Rt,br,Sr,xr,wr,vr,_r}from"./chunk-f544p9rh.js";import{P}from"./chunk-c4qr1f41.js";import{ee}from"./chunk-tvm4zmgj.js";import{q,j}from"./chunk-y69ewdn2.js";import{V}from"./chunk-063vbmtp.js";import{y}from"./chunk-3k627vf2.js";import{fe}from"./chunk-x4874m8e.js";import{N,pe,ne,Le,Q,G}from"./chunk-n981vx1t.js";import{M}from"./chunk-z02sj1je.js";var b="v1",O="gcp-vertex-credentials",R=0,C=(e,o,t)=>{let i=new M,u=Le(o);return(async()=>{let n={role:"assistant",content:[],api:"google-vertex",provider:e.provider,model:e.id,usage:{input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},stopReason:"pending",timestamp:Date.now()};try{if(t?.fetch&&t.fetch!==globalThis.fetch)throw Error("Custom fetch is not supported by the Google Vertex adapter");let c=L(t),g=c?S(e,c,t?.headers):I(e,U(t),D(t),t?.headers,t?.env),h=K(e,u,t),m=await t?.onPayload?.(h,e);if(m!==void 0)h=m;let p=await _r(()=>g.models.generateContentStream(h),t);i.push({type:"start",partial:n});let r=null,f=n.content,l=()=>f.length-1;for await(let s of p){await t?.onProviderStreamEvent?.(s,e),n.responseId||=s.responseId;let k=s.candidates?.[0];if(k?.content?.parts)for(let a of k.content.parts){if(a.text!==void 0){let d=yr(a);if(!r||d&&r.type!=="thinking"||!d&&r.type!=="text"){if(r)if(r.type==="text")i.push({type:"text_end",contentIndex:f.length-1,content:r.text,partial:n});else i.push({type:"thinking_end",contentIndex:l(),content:r.thinking,partial:n});if(d)r={type:"thinking",thinking:"",thinkingSignature:void 0},n.content.push(r),i.push({type:"thinking_start",contentIndex:l(),partial:n});else r={type:"text",text:""},n.content.push(r),i.push({type:"text_start",contentIndex:l(),partial:n})}if(r.type==="thinking")r.thinking+=a.text,r.thinkingSignature=Rt(r.thinkingSignature,a.thoughtSignature),i.push({type:"thinking_delta",contentIndex:l(),delta:a.text,partial:n});else r.text+=a.text,r.textSignature=Rt(r.textSignature,a.thoughtSignature),i.push({type:"text_delta",contentIndex:l(),delta:a.text,partial:n})}if(a.functionCall){if(r){if(r.type==="text")i.push({type:"text_end",contentIndex:l(),content:r.text,partial:n});else i.push({type:"thinking_end",contentIndex:l(),content:r.thinking,partial:n});r=null}let d=a.functionCall.id,x={type:"toolCall",id:!d||n.content.some((T)=>T.type==="toolCall"&&T.id===d)?`${a.functionCall.name}_${Date.now()}_${++R}`:d,name:a.functionCall.name||"",arguments:a.functionCall.args??{},...a.thoughtSignature&&{thoughtSignature:a.thoughtSignature}};n.content.push(x),i.push({type:"toolcall_start",contentIndex:l(),partial:n}),i.push({type:"toolcall_delta",contentIndex:l(),delta:JSON.stringify(x.arguments),partial:n}),i.push({type:"toolcall_end",contentIndex:l(),toolCall:x,partial:n})}}if(k?.finishReason){if(n.rawStopReason=k.finishReason,n.stopReason=vr(k.finishReason),n.content.some((a)=>a.type==="toolCall")&&n.stopReason==="stop")n.stopReason="toolUse"}if(s.usageMetadata)n.usage={input:(s.usageMetadata.promptTokenCount||0)-(s.usageMetadata.cachedContentTokenCount||0),output:(s.usageMetadata.candidatesTokenCount||0)+(s.usageMetadata.thoughtsTokenCount||0),cacheRead:s.usageMetadata.cachedContentTokenCount||0,cacheWrite:0,reasoning:s.usageMetadata.thoughtsTokenCount||0,totalTokens:s.usageMetadata.totalTokenCount||0,cost:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0}},Q(e,n.usage)}if(r)if(r.type==="text")i.push({type:"text_end",contentIndex:l(),content:r.text,partial:n});else i.push({type:"thinking_end",contentIndex:l(),content:r.thinking,partial:n});if(t?.signal?.aborted)throw Error("Request was aborted");if(n.stopReason==="pending")throw Error("Google Vertex stream ended without a finish reason");if(n.stopReason==="aborted"||n.stopReason==="error"){let s=n.rawStopReason?`Provider stopped with: ${n.rawStopReason}`:"An unknown error occurred";throw Error(s)}i.push({type:"done",reason:n.stopReason,message:n}),i.end()}catch(c){for(let g of n.content)if("index"in g)delete g.index;n.stopReason=t?.signal?.aborted?"aborted":"error",n.errorMessage=j(q(c)),i.push({type:"error",reason:n.stopReason,error:n}),i.end()}})(),i},ue=(e,o,t)=>{let i={...V(e,o,t,void 0),toolChoice:t?.toolChoice};if(!t?.reasoning)return C(e,o,{...i,thinking:{enabled:!1}});let u=G(e,t.reasoning);if(u==="off")return C(e,o,{...i,thinking:{enabled:!1}});let n=zt(e,u);if(jt(e))return C(e,o,{...i,thinking:{enabled:!0,level:Vt(n)}});return C(e,o,{...i,thinking:{enabled:!0,budgetTokens:B(e,n,t.thinkingBudgets)}})};function I(e,o,t,i,u){let n=E(u);return new kt({vertexai:!0,project:o,location:t,apiVersion:b,...n?{googleAuthOptions:n}:{},httpOptions:v(e,i)})}function S(e,o,t){return new kt({vertexai:!0,apiKey:o,apiVersion:b,httpOptions:v(e,t)})}function v(e,o){let t={},i=w(e.baseUrl);if(i){if(t.baseUrl=i,t.baseUrlResourceScope=fr.COLLECTION,_(i))t.apiVersion=""}let u=fe({"User-Agent":ee(),...e.headers,...o});if(u)t.headers=u;return Object.keys(t).length>0?t:void 0}function w(e){let o=e.trim();if(!o||o.includes("{location}"))return;return o}function _(e){try{return new URL(e).pathname.split("/").some((t)=>/^v\d+(?:beta\d*)?$/.test(t))}catch{return/(?:^|\/)v\d+(?:beta\d*)?(?:\/|$)/.test(e)}}function E(e){let o=P("GOOGLE_APPLICATION_CREDENTIALS",e);return o?{keyFilename:o}:void 0}function L(e){let o=e?.apiKey?.trim();if(!o||o===O||A(o))return;return o}function A(e){return/^<[^>]+>$/.test(e)}function U(e){let o=e?.project||P("GOOGLE_CLOUD_PROJECT",e?.env)||P("GCLOUD_PROJECT",e?.env);if(!o)throw Error("Vertex AI requires a project ID. Set GOOGLE_CLOUD_PROJECT/GCLOUD_PROJECT or pass project in options.");return o}function D(e){let o=e?.location||P("GOOGLE_CLOUD_LOCATION",e?.env);if(!o)throw Error("Vertex AI requires a location. Set GOOGLE_CLOUD_LOCATION or pass location in options.");return o}function K(e,o,t={}){let i=br(e,o),u=pe(o.messages),n=ne(o.messages),c={};if(t.temperature!==void 0)c.temperature=t.temperature;if(t.maxTokens!==void 0)c.maxOutputTokens=t.maxTokens;let g=xr(e.id),h=n.length>0?wr(n,t.toolChoice,g):void 0,m=u?N(u):"",p={...Object.keys(c).length>0&&c,...m&&{systemInstruction:y(m)},...n.length>0&&{tools:Sr(n,!1,g)},...h!==void 0&&{toolConfig:{functionCallingConfig:{mode:h}}}};if(t.thinking?.enabled&&e.reasoning){let f={includeThoughts:!0};if(t.thinking.level!==void 0)f.thinkingLevel=Kt(t.thinking.level);else if(t.thinking.budgetTokens!==void 0)f.thinkingBudget=t.thinking.budgetTokens;p.thinkingConfig=f}else if(e.reasoning&&t.thinking&&!t.thinking.enabled)p.thinkingConfig=gr(e);if(t.signal){if(t.signal.aborted)throw Error("Request aborted");p.abortSignal=t.signal}return{model:e.id,contents:i,config:p}}function B(e,o,t){if(t?.[o]!==void 0)return t[o];if(e.id.includes("2.5-pro"))return{minimal:128,low:2048,medium:8192,high:32768}[o];if(e.id.includes("2.5-flash"))return{minimal:128,low:2048,medium:8192,high:24576}[o];return-1}export{C as stream,ue as streamSimple};