@qitqode/qitqode-android-arm64 0.1.35 → 0.1.36

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 (451) hide show
  1. package/bundle/{chunk-7311jry1.js → chunk-00sr2gwz.js} +2 -2
  2. package/bundle/{chunk-azhw650z.js → chunk-02xcb52z.js} +2 -2
  3. package/bundle/{chunk-gws1rn1v.js → chunk-08q55ya0.js} +1 -1
  4. package/bundle/chunk-092bx2yw.js +2 -0
  5. package/bundle/{chunk-xgr6jnd6.js → chunk-0g25z230.js} +1 -1
  6. package/bundle/chunk-0j6dhrew.js +2 -0
  7. package/bundle/chunk-0jrgk6vk.js +2 -0
  8. package/bundle/chunk-0qn52zsd.js +2 -0
  9. package/bundle/chunk-10accb7b.js +2 -0
  10. package/bundle/{chunk-t3eymzg1.js → chunk-132tcp2j.js} +2 -2
  11. package/bundle/chunk-13kpdfr7.js +2 -0
  12. package/bundle/chunk-15s8zwgf.js +2 -0
  13. package/bundle/{chunk-nj4d554m.js → chunk-1bx2sjn6.js} +1 -1
  14. package/bundle/chunk-1kgyfja6.js +2 -0
  15. package/bundle/{chunk-bv29k2pf.js → chunk-1mcsf4yb.js} +2 -2
  16. package/bundle/{chunk-kwx9ewe0.js → chunk-1wpjmwnh.js} +1 -1
  17. package/bundle/chunk-1yv5h8k4.js +2 -0
  18. package/bundle/chunk-24rw1br0.js +3 -0
  19. package/bundle/{chunk-snr44en9.js → chunk-25bp7pcm.js} +2 -2
  20. package/bundle/{chunk-kmcsz8yv.js → chunk-2dkrfc1s.js} +1 -1
  21. package/bundle/chunk-364ccew0.js +3 -0
  22. package/bundle/{chunk-aa8hymcv.js → chunk-37dvnent.js} +2 -2
  23. package/bundle/chunk-3bkdbqjj.js +2 -0
  24. package/bundle/chunk-3bnqw3xp.js +3 -0
  25. package/bundle/{chunk-08m0hkdz.js → chunk-3dr4469n.js} +1 -1
  26. package/bundle/{chunk-hv6eccx1.js → chunk-3gw6r3hf.js} +179 -179
  27. package/bundle/{chunk-n96tvjgj.js → chunk-3mepk08v.js} +2 -2
  28. package/bundle/chunk-3sz6gw10.js +3 -0
  29. package/bundle/chunk-41x11r2s.js +3 -0
  30. package/bundle/{chunk-xqdrr7xg.js → chunk-45mjcxqk.js} +1 -1
  31. package/bundle/{chunk-qrtc3etn.js → chunk-4fa390yr.js} +2 -2
  32. package/bundle/chunk-4gs87ghj.js +3 -0
  33. package/bundle/chunk-4kqdzdv5.js +3 -0
  34. package/bundle/{chunk-3k2b05fv.js → chunk-4sazy0nq.js} +1 -1
  35. package/bundle/chunk-4tbqsrsn.js +2 -0
  36. package/bundle/{chunk-ngccf7ga.js → chunk-52b1v7mn.js} +1 -1
  37. package/bundle/chunk-53kns5wy.js +2 -0
  38. package/bundle/{chunk-11v7vz3y.js → chunk-549ptbaj.js} +1 -1
  39. package/bundle/chunk-559ek1ym.js +2 -0
  40. package/bundle/{chunk-34p46th6.js → chunk-5bate758.js} +1 -1
  41. package/bundle/{chunk-kdcnder5.js → chunk-5kmfnkzv.js} +1 -1
  42. package/bundle/{chunk-w1n4rf6n.js → chunk-5pkg052s.js} +2 -2
  43. package/bundle/chunk-5yfzzmv0.js +2 -0
  44. package/bundle/{chunk-rsszcqxd.js → chunk-60qyqqxx.js} +1 -1
  45. package/bundle/{chunk-94pcpztx.js → chunk-64s7vfj7.js} +2 -2
  46. package/bundle/{chunk-bzgj60w4.js → chunk-6sfhbckv.js} +1 -1
  47. package/bundle/{chunk-8762ty72.js → chunk-70pb4kcm.js} +2 -2
  48. package/bundle/{chunk-04hvaaje.js → chunk-72zxassf.js} +1 -1
  49. package/bundle/{chunk-yz6898wy.js → chunk-73ckx171.js} +1 -1
  50. package/bundle/chunk-7cbj28fp.js +2 -0
  51. package/bundle/chunk-7dep7g7c.js +2 -0
  52. package/bundle/{chunk-gj0wt0cy.js → chunk-7fawtcnn.js} +1 -1
  53. package/bundle/{chunk-zfn0z4sh.js → chunk-7gbytqkn.js} +2 -2
  54. package/bundle/{chunk-x66ycpfs.js → chunk-7jhrxzjx.js} +2 -2
  55. package/bundle/{chunk-09pkckr1.js → chunk-7vftsy04.js} +1 -1
  56. package/bundle/{chunk-zfd70p01.js → chunk-8dxdeksr.js} +1 -1
  57. package/bundle/{chunk-6styp5dn.js → chunk-8fgamz4y.js} +1 -1
  58. package/bundle/{chunk-9qdr9t8c.js → chunk-8q6z6emx.js} +1 -1
  59. package/bundle/{chunk-4ttf9rjd.js → chunk-8r3410c2.js} +1 -1
  60. package/bundle/{chunk-3mzcr3fw.js → chunk-8tp4whyw.js} +1 -1
  61. package/bundle/chunk-8yn64y27.js +2 -0
  62. package/bundle/{chunk-41v0x1jk.js → chunk-8yr682pv.js} +2 -2
  63. package/bundle/chunk-8ywa7az5.js +2 -0
  64. package/bundle/chunk-8ywdddts.js +2 -0
  65. package/bundle/chunk-8zmreqxx.js +2 -0
  66. package/bundle/chunk-92zjark4.js +2 -0
  67. package/bundle/chunk-983rqajz.js +7 -0
  68. package/bundle/{chunk-kjyw00jp.js → chunk-9cw4cnz0.js} +1 -1
  69. package/bundle/{chunk-2swch6mx.js → chunk-9dh9bc9d.js} +1 -1
  70. package/bundle/{chunk-y437vyza.js → chunk-9fkmhmh6.js} +1 -1
  71. package/bundle/{chunk-7vd91wsd.js → chunk-9nk0ts0s.js} +1 -1
  72. package/bundle/{chunk-p9cnzxb8.js → chunk-9s4whpg1.js} +2 -2
  73. package/bundle/{chunk-yajd975f.js → chunk-9xvctnjr.js} +1 -1
  74. package/bundle/chunk-9yakc5yv.js +28 -0
  75. package/bundle/{chunk-4wxxyrxn.js → chunk-9zre5e54.js} +1 -1
  76. package/bundle/chunk-a42q5mx4.js +3 -0
  77. package/bundle/{chunk-yt3f3j35.js → chunk-a9y27zd2.js} +1 -1
  78. package/bundle/{chunk-mex0fe9s.js → chunk-acyj91wq.js} +1 -1
  79. package/bundle/chunk-aq28ejhv.js +2 -0
  80. package/bundle/{chunk-pkc4ddw1.js → chunk-atpzz901.js} +1 -1
  81. package/bundle/chunk-ax1y4699.js +2 -0
  82. package/bundle/{chunk-dctj3c22.js → chunk-b0jh0rby.js} +2 -2
  83. package/bundle/chunk-b0x888w9.js +2 -0
  84. package/bundle/chunk-b10px5g4.js +2 -0
  85. package/bundle/chunk-b1qhpxee.js +2 -0
  86. package/bundle/chunk-b4ysd5b4.js +9 -0
  87. package/bundle/chunk-bcs2gvmp.js +2 -0
  88. package/bundle/{chunk-7mxt5b0h.js → chunk-bjcb9kt0.js} +1 -1
  89. package/bundle/{chunk-67d5d8mr.js → chunk-bnz0mxak.js} +1 -1
  90. package/bundle/{chunk-er38zew1.js → chunk-brh35yt5.js} +2 -2
  91. package/bundle/chunk-bs020a3x.js +2 -0
  92. package/bundle/{chunk-7eexey82.js → chunk-c72jajx9.js} +1 -1
  93. package/bundle/{chunk-81trveht.js → chunk-cagk1sjd.js} +1 -1
  94. package/bundle/{chunk-1byd3wma.js → chunk-cdh26622.js} +2 -2
  95. package/bundle/chunk-cjxcnhmq.js +14 -0
  96. package/bundle/{chunk-zddknkw7.js → chunk-cx0j6mpq.js} +1 -1
  97. package/bundle/{chunk-zh3fny3z.js → chunk-cx7p4ezk.js} +2 -2
  98. package/bundle/chunk-d0xs3j5h.js +2 -0
  99. package/bundle/{chunk-pxmhe36r.js → chunk-d1rn44wz.js} +1 -1
  100. package/bundle/chunk-d72rty3t.js +2 -0
  101. package/bundle/{chunk-0c6ep9mc.js → chunk-d93z6hrn.js} +1 -1
  102. package/bundle/{chunk-seghf5fc.js → chunk-dgx4rq86.js} +1 -1
  103. package/bundle/{chunk-qzj6027k.js → chunk-dh1h513y.js} +1 -1
  104. package/bundle/chunk-dj951pms.js +2 -0
  105. package/bundle/chunk-dp6zktka.js +2 -0
  106. package/bundle/{chunk-ba3h1pzs.js → chunk-dshnn54c.js} +1 -1
  107. package/bundle/{chunk-73myw3bj.js → chunk-dt899wbf.js} +2 -2
  108. package/bundle/chunk-dvqdtdza.js +2 -0
  109. package/bundle/{chunk-6ynxf3q7.js → chunk-dvxk6mr6.js} +2 -2
  110. package/bundle/chunk-dx7h5r8j.js +2 -0
  111. package/bundle/{chunk-bnss5dkk.js → chunk-dykqn0nj.js} +2 -2
  112. package/bundle/chunk-e03tgfpb.js +8 -0
  113. package/bundle/chunk-e07dbha4.js +2 -0
  114. package/bundle/chunk-e88wd9ex.js +2 -0
  115. package/bundle/{chunk-y9zstzed.js → chunk-eaqfnwdj.js} +1 -1
  116. package/bundle/chunk-ebabnv33.js +3 -0
  117. package/bundle/chunk-ebdpg3cn.js +2 -0
  118. package/bundle/{chunk-8vg4fmg2.js → chunk-ebkztnpf.js} +180 -178
  119. package/bundle/chunk-ec7pznsp.js +2 -0
  120. package/bundle/chunk-et7kz7kx.js +2 -0
  121. package/bundle/{chunk-kfmz2p27.js → chunk-ev3a2sxv.js} +2 -2
  122. package/bundle/{chunk-d00c1k9w.js → chunk-ewpzqnj4.js} +1 -1
  123. package/bundle/chunk-eyc6tb5h.js +2 -0
  124. package/bundle/chunk-eywryd3k.js +2 -0
  125. package/bundle/chunk-eze57bty.js +2 -0
  126. package/bundle/{chunk-qddt2gcs.js → chunk-ezrskm25.js} +1 -1
  127. package/bundle/chunk-f36ctnbp.js +3 -0
  128. package/bundle/{chunk-9ayxg9mq.js → chunk-f77nxt23.js} +2 -2
  129. package/bundle/chunk-fa47vzfc.js +2 -0
  130. package/bundle/chunk-fe397ph0.js +2 -0
  131. package/bundle/chunk-fjm9kstr.js +5 -0
  132. package/bundle/{chunk-exmw8jfa.js → chunk-fmxm4kaj.js} +2 -2
  133. package/bundle/chunk-fr75ytdr.js +2 -0
  134. package/bundle/chunk-fw2tnbt6.js +2 -0
  135. package/bundle/chunk-fwr2qgqb.js +2 -0
  136. package/bundle/chunk-g204pt98.js +2 -0
  137. package/bundle/chunk-g5prcvq2.js +14 -0
  138. package/bundle/{chunk-ggydr1ze.js → chunk-g794ey6w.js} +1 -1
  139. package/bundle/chunk-gcgmwqhh.js +2 -0
  140. package/bundle/{chunk-rmve21dh.js → chunk-gg7bg3ek.js} +1 -1
  141. package/bundle/{chunk-9x25d115.js → chunk-gkj4a27z.js} +1 -1
  142. package/bundle/chunk-gvtjxg0d.js +2 -0
  143. package/bundle/chunk-gw36mrg4.js +2 -0
  144. package/bundle/{chunk-z8gdmvgg.js → chunk-gwfx7tx7.js} +2 -2
  145. package/bundle/{chunk-q8hd01j7.js → chunk-gxmxx8jb.js} +1 -1
  146. package/bundle/{chunk-tge53d52.js → chunk-h1kg35mn.js} +1 -1
  147. package/bundle/chunk-h36qec67.js +2 -0
  148. package/bundle/{chunk-0msqaywp.js → chunk-h7w35n7w.js} +1 -1
  149. package/bundle/chunk-h9gtymfm.js +2 -0
  150. package/bundle/chunk-h9qn35pn.js +2 -0
  151. package/bundle/{chunk-mr8j7rc6.js → chunk-hb9mc5f9.js} +1 -1
  152. package/bundle/{chunk-5a7fs1hg.js → chunk-hbh2034m.js} +1 -1
  153. package/bundle/{chunk-df2aswz3.js → chunk-hcy77w6t.js} +1 -1
  154. package/bundle/{chunk-6a7c7wnf.js → chunk-hgsykghj.js} +2 -2
  155. package/bundle/chunk-hhjkezfz.js +2 -0
  156. package/bundle/chunk-hnz570f9.js +3 -0
  157. package/bundle/{chunk-tbgczapt.js → chunk-htkwc2se.js} +2 -2
  158. package/bundle/chunk-j21dnncc.js +4 -0
  159. package/bundle/{chunk-1yt5rsew.js → chunk-j63fkt6n.js} +1 -1
  160. package/bundle/chunk-ja18tvc7.js +2 -0
  161. package/bundle/{chunk-03xppy47.js → chunk-jcjaw7tk.js} +2 -2
  162. package/bundle/{chunk-jkh6eg7d.js → chunk-jf6ry79j.js} +4 -4
  163. package/bundle/{chunk-ke7n9t5p.js → chunk-jgz1a29w.js} +3 -3
  164. package/bundle/{chunk-ebcdxmdd.js → chunk-jngchw38.js} +1 -1
  165. package/bundle/{chunk-j5ymkhry.js → chunk-jqn27885.js} +1 -1
  166. package/bundle/chunk-jr2q5295.js +3 -0
  167. package/bundle/{chunk-hj3ddt53.js → chunk-jts0dma5.js} +2 -2
  168. package/bundle/chunk-jw16f6t0.js +4 -0
  169. package/bundle/chunk-jxg15t11.js +2 -0
  170. package/bundle/{chunk-7hm0c2yg.js → chunk-kqhh2pm9.js} +1 -1
  171. package/bundle/{chunk-0h8wdch6.js → chunk-kt0ej3nq.js} +1 -1
  172. package/bundle/chunk-kwzawx7r.js +2 -0
  173. package/bundle/{chunk-n6msxne8.js → chunk-kx2dp8ch.js} +1 -1
  174. package/bundle/chunk-m0mek3es.js +2 -0
  175. package/bundle/chunk-m31d2n6h.js +2 -0
  176. package/bundle/{chunk-egn55fa2.js → chunk-mcc5ynma.js} +3 -3
  177. package/bundle/{chunk-md8161zd.js → chunk-mdzzcrf9.js} +2 -2
  178. package/bundle/{chunk-gckgaqqr.js → chunk-mqtqcc10.js} +2 -2
  179. package/bundle/{chunk-ynwkr3yh.js → chunk-mvnxwwe7.js} +2 -2
  180. package/bundle/{chunk-6a77w77q.js → chunk-mvsrzvc4.js} +4 -4
  181. package/bundle/{chunk-b4knxpqh.js → chunk-mw2hr4pd.js} +1 -1
  182. package/bundle/{chunk-vszbqv24.js → chunk-mzbr0m2v.js} +1 -1
  183. package/bundle/{chunk-bj00xk8k.js → chunk-n0trgp1c.js} +2 -2
  184. package/bundle/chunk-n14qktbg.js +2 -0
  185. package/bundle/{chunk-yjk6zv2z.js → chunk-n2ygpy76.js} +1 -1
  186. package/bundle/{chunk-54wh8b12.js → chunk-n7xgfm5x.js} +2 -2
  187. package/bundle/{chunk-06k6egt2.js → chunk-neqy8j4n.js} +1 -1
  188. package/bundle/{chunk-nj61v4n7.js → chunk-njkserae.js} +1 -1
  189. package/bundle/{chunk-n6gtdx5h.js → chunk-nq495be3.js} +1 -1
  190. package/bundle/chunk-nr4q9fv7.js +2 -0
  191. package/bundle/{chunk-p3qkexpk.js → chunk-nsjp44fp.js} +1 -1
  192. package/bundle/chunk-nzzsj54n.js +2 -0
  193. package/bundle/chunk-p19qfw59.js +2 -0
  194. package/bundle/chunk-p2yxj9s4.js +2 -0
  195. package/bundle/{chunk-1dtzxt2w.js → chunk-p3rp99na.js} +1 -1
  196. package/bundle/chunk-p8czsxp0.js +3 -0
  197. package/bundle/chunk-p8k48st6.js +5 -0
  198. package/bundle/{chunk-79agp7v3.js → chunk-p8kpqyxb.js} +2 -2
  199. package/bundle/{chunk-9fxkh84w.js → chunk-p9zrk16q.js} +1 -1
  200. package/bundle/{chunk-6ged58yw.js → chunk-pmv8yr8c.js} +2 -2
  201. package/bundle/{chunk-ee23d2nz.js → chunk-pnq1h5az.js} +2 -2
  202. package/bundle/chunk-pq3qwxa8.js +2 -0
  203. package/bundle/{chunk-wfd5h6ax.js → chunk-pqnbdygz.js} +2 -2
  204. package/bundle/chunk-ps9p14y6.js +2 -0
  205. package/bundle/{chunk-zfcp509b.js → chunk-pxx2hz0g.js} +2 -2
  206. package/bundle/{chunk-txbwmwxj.js → chunk-q7rt76qw.js} +1 -1
  207. package/bundle/{chunk-rq4w0by4.js → chunk-q81m4m9z.js} +1 -1
  208. package/bundle/chunk-qagc6v17.js +2 -0
  209. package/bundle/{chunk-mq6jn47r.js → chunk-qb35hqm4.js} +1 -1
  210. package/bundle/chunk-qc0zhbhm.js +2 -0
  211. package/bundle/{chunk-keveg5gx.js → chunk-qdcf1ay5.js} +2 -2
  212. package/bundle/chunk-qp9y0g73.js +3 -0
  213. package/bundle/chunk-qpd0gab8.js +2 -0
  214. package/bundle/{chunk-axdzm75h.js → chunk-qqne79vp.js} +2 -2
  215. package/bundle/{chunk-g4gjz7sq.js → chunk-qs4wef8c.js} +1 -1
  216. package/bundle/chunk-r0ewmh6f.js +2 -0
  217. package/bundle/chunk-r3df289z.js +2 -0
  218. package/bundle/{chunk-by855es0.js → chunk-r58gzg6m.js} +1 -1
  219. package/bundle/{chunk-fmq0m4k5.js → chunk-r6ndvzd0.js} +1 -1
  220. package/bundle/chunk-r78kfhvz.js +2 -0
  221. package/bundle/{chunk-dyv2hqvc.js → chunk-rcyhqkv5.js} +1 -1
  222. package/bundle/{chunk-t2vm08v6.js → chunk-rd4x4tsv.js} +1 -1
  223. package/bundle/chunk-rebsz3bj.js +2 -0
  224. package/bundle/{chunk-yp5bypsp.js → chunk-rexdr63q.js} +2 -2
  225. package/bundle/{chunk-1me21qdc.js → chunk-rgxy4ngt.js} +1 -1
  226. package/bundle/chunk-rph5xswc.js +2 -0
  227. package/bundle/{chunk-dcndy4sr.js → chunk-rph9zj24.js} +1 -1
  228. package/bundle/chunk-rqmvj7f4.js +3 -0
  229. package/bundle/{chunk-ryfqwsft.js → chunk-rrd0jf5m.js} +1 -1
  230. package/bundle/{chunk-mpygdb5a.js → chunk-s8mghr5a.js} +2 -2
  231. package/bundle/chunk-schtpyjs.js +2 -0
  232. package/bundle/{chunk-nmehsm3w.js → chunk-shwjjrj8.js} +1 -1
  233. package/bundle/{chunk-08f4khsw.js → chunk-snt1kefv.js} +3 -3
  234. package/bundle/{chunk-s8hq6trz.js → chunk-srxx88nb.js} +1 -1
  235. package/bundle/{chunk-gy0wm7e1.js → chunk-std2bgv7.js} +2 -2
  236. package/bundle/{chunk-dffhkd30.js → chunk-swcgsrbj.js} +1 -1
  237. package/bundle/chunk-sy3n0qhc.js +800 -0
  238. package/bundle/{chunk-wgk7ynt3.js → chunk-t01bhw5h.js} +3 -3
  239. package/bundle/chunk-t0jjes17.js +2 -0
  240. package/bundle/{chunk-yprmd5b7.js → chunk-t5tfppwv.js} +2 -2
  241. package/bundle/chunk-t8rke5fr.js +8 -0
  242. package/bundle/chunk-tabcpx7t.js +4 -0
  243. package/bundle/{chunk-gmzrvxnv.js → chunk-tdmn21z0.js} +2 -2
  244. package/bundle/{chunk-71zw0qhf.js → chunk-tdxbm1nd.js} +1 -1
  245. package/bundle/{chunk-p825vsjy.js → chunk-te5tfq79.js} +1 -1
  246. package/bundle/chunk-tf4xwqz7.js +2 -0
  247. package/bundle/{chunk-fg35hwa0.js → chunk-tgd5ctnt.js} +2 -2
  248. package/bundle/chunk-tqazneg6.js +2 -0
  249. package/bundle/{chunk-qa2j0qmy.js → chunk-txqc7543.js} +2 -2
  250. package/bundle/chunk-tzg4z74d.js +2 -0
  251. package/bundle/{chunk-a3a1trap.js → chunk-v3x5nrc4.js} +2 -2
  252. package/bundle/chunk-v8dd6tyn.js +2 -0
  253. package/bundle/chunk-v8ksjgc3.js +2 -0
  254. package/bundle/chunk-v8vcwx23.js +2 -0
  255. package/bundle/chunk-vc4e6xc4.js +10 -0
  256. package/bundle/chunk-vcrakhgy.js +3 -0
  257. package/bundle/{chunk-a1hzeejj.js → chunk-vdpd4akk.js} +2 -2
  258. package/bundle/{chunk-6p7yg5sr.js → chunk-vftqwdpg.js} +1 -1
  259. package/bundle/chunk-vg41rtdy.js +2 -0
  260. package/bundle/{chunk-r0k21apr.js → chunk-vgaxv70x.js} +2 -2
  261. package/bundle/{chunk-nkk4fyqf.js → chunk-vgnddhdj.js} +1 -1
  262. package/bundle/{chunk-xd3xc1vv.js → chunk-vm58fkrv.js} +1 -1
  263. package/bundle/{chunk-qg2vk5fw.js → chunk-vsys768k.js} +1 -1
  264. package/bundle/{chunk-s4qtphwx.js → chunk-w03fdrxe.js} +1 -1
  265. package/bundle/chunk-w1ypf53m.js +3 -0
  266. package/bundle/chunk-w24660y4.js +3 -0
  267. package/bundle/{chunk-z1ay3qd0.js → chunk-w3bmf3zz.js} +1 -1
  268. package/bundle/{chunk-5e4fxy99.js → chunk-w57j3pgz.js} +82 -82
  269. package/bundle/{chunk-vsr8mnj6.js → chunk-w5940jxm.js} +1 -1
  270. package/bundle/chunk-w6rf2knb.js +2 -0
  271. package/bundle/chunk-w9pdvcf9.js +3 -0
  272. package/bundle/{chunk-yk97q51d.js → chunk-wev34grp.js} +2 -2
  273. package/bundle/chunk-wh7r96t3.js +2 -0
  274. package/bundle/{chunk-1pg6pv0m.js → chunk-wm77svwm.js} +1 -1
  275. package/bundle/chunk-wnjqaxze.js +2 -0
  276. package/bundle/{chunk-qkjdr337.js → chunk-x6rr6ss1.js} +1 -1
  277. package/bundle/{chunk-bbzztav6.js → chunk-xdacgfba.js} +1 -1
  278. package/bundle/{chunk-6p94fpbn.js → chunk-xdjwapwy.js} +2 -2
  279. package/bundle/chunk-xfz698bh.js +2 -0
  280. package/bundle/{chunk-zwnhf4z1.js → chunk-xhbb8b5g.js} +1 -1
  281. package/bundle/chunk-xqwvx3qq.js +2 -0
  282. package/bundle/chunk-xxj3sgd5.js +2 -0
  283. package/bundle/chunk-xyjehgzm.js +3 -0
  284. package/bundle/{chunk-cs38g1bx.js → chunk-y0ydzdfc.js} +1 -1
  285. package/bundle/{chunk-wvf5q2hz.js → chunk-y1b2h15z.js} +1 -1
  286. package/bundle/{chunk-1gf116rg.js → chunk-yacccwf6.js} +1 -1
  287. package/bundle/chunk-ydc6ypjt.js +77 -0
  288. package/bundle/{chunk-dhqaqeq6.js → chunk-yeq7b87a.js} +1 -1
  289. package/bundle/chunk-yfp9y71y.js +2 -0
  290. package/bundle/chunk-yg9c1v8v.js +2 -0
  291. package/bundle/{chunk-e6xnynaz.js → chunk-yha554nm.js} +2 -2
  292. package/bundle/{chunk-rv1stdvb.js → chunk-yj6rbe9p.js} +2 -2
  293. package/bundle/chunk-yjjh339w.js +2 -0
  294. package/bundle/{chunk-sjw56r2n.js → chunk-yjp0btmq.js} +3 -3
  295. package/bundle/{chunk-c5pb87yf.js → chunk-ymtcm4xd.js} +1 -1
  296. package/bundle/chunk-yt6vd7a5.js +2 -0
  297. package/bundle/{chunk-ssk8tkwd.js → chunk-yw9pfqxt.js} +1 -1
  298. package/bundle/{chunk-g6cyhxwg.js → chunk-yykjvt7f.js} +2 -2
  299. package/bundle/{chunk-sfes6pp1.js → chunk-yzh4rmrt.js} +1 -1
  300. package/bundle/chunk-yzq3c3dq.js +2 -0
  301. package/bundle/{chunk-prh3c44x.js → chunk-yzwgvjzd.js} +1 -1
  302. package/bundle/chunk-z1j25911.js +2 -0
  303. package/bundle/{chunk-rkwrjphh.js → chunk-z1rshv6g.js} +1 -1
  304. package/bundle/chunk-z29ahthm.js +2 -0
  305. package/bundle/{chunk-jgjnz82k.js → chunk-zaan8jk6.js} +1 -1
  306. package/bundle/{chunk-6gb65bv1.js → chunk-zbqzm65q.js} +1 -1
  307. package/bundle/{chunk-bk4phk66.js → chunk-zesbm9k1.js} +1 -1
  308. package/bundle/{chunk-c6vfwjg4.js → chunk-zfcfyagt.js} +1 -1
  309. package/bundle/{chunk-ywkvq7zb.js → chunk-zfnbk5gy.js} +1 -1
  310. package/bundle/chunk-zgre4gc2.js +2 -0
  311. package/bundle/{chunk-z7430qxg.js → chunk-zrmx397j.js} +1 -1
  312. package/bundle/chunk-zthkjx33.js +2 -0
  313. package/bundle/chunk-zxddasg8.js +2 -0
  314. package/bundle/index.js +3 -3
  315. package/bundle/parser.worker.js +2 -2
  316. package/bundle/worker.js +1 -1
  317. package/package.json +1 -1
  318. package/bundle/chunk-0442cmw2.js +0 -2
  319. package/bundle/chunk-085pvqr4.js +0 -2
  320. package/bundle/chunk-0x5jn813.js +0 -2
  321. package/bundle/chunk-11g2rpv8.js +0 -3
  322. package/bundle/chunk-28t9akfn.js +0 -2
  323. package/bundle/chunk-2h1fcqvf.js +0 -2
  324. package/bundle/chunk-2kens6wh.js +0 -2
  325. package/bundle/chunk-2scyp9ns.js +0 -2
  326. package/bundle/chunk-2tw58kwb.js +0 -2
  327. package/bundle/chunk-2vxx0tax.js +0 -2
  328. package/bundle/chunk-2ybt3p5z.js +0 -2
  329. package/bundle/chunk-2zpkw3ge.js +0 -2
  330. package/bundle/chunk-31g86yn6.js +0 -2
  331. package/bundle/chunk-397be2x0.js +0 -2
  332. package/bundle/chunk-3c78nkgn.js +0 -2
  333. package/bundle/chunk-3d91q2qd.js +0 -2
  334. package/bundle/chunk-43yv7tz1.js +0 -2
  335. package/bundle/chunk-496ajawz.js +0 -2
  336. package/bundle/chunk-499gp5g5.js +0 -2
  337. package/bundle/chunk-4hzm14xt.js +0 -3
  338. package/bundle/chunk-4xw14sed.js +0 -2
  339. package/bundle/chunk-536naqqv.js +0 -2
  340. package/bundle/chunk-57nvmhjq.js +0 -2
  341. package/bundle/chunk-5he3d7cy.js +0 -2
  342. package/bundle/chunk-5qr286w8.js +0 -2
  343. package/bundle/chunk-606vpgc4.js +0 -4
  344. package/bundle/chunk-6a1skxcj.js +0 -3
  345. package/bundle/chunk-6cj7cn5x.js +0 -2
  346. package/bundle/chunk-6hybp2mt.js +0 -2
  347. package/bundle/chunk-6y423jax.js +0 -3
  348. package/bundle/chunk-72ghkgcn.js +0 -2
  349. package/bundle/chunk-741teh8k.js +0 -2
  350. package/bundle/chunk-7b3wx6kn.js +0 -2
  351. package/bundle/chunk-891yevv2.js +0 -2
  352. package/bundle/chunk-8c1ypgw5.js +0 -3
  353. package/bundle/chunk-8ktgy41r.js +0 -2
  354. package/bundle/chunk-8q73cjyj.js +0 -2
  355. package/bundle/chunk-8rt63jbm.js +0 -2
  356. package/bundle/chunk-8y623qdx.js +0 -2
  357. package/bundle/chunk-921vn745.js +0 -2
  358. package/bundle/chunk-945ebhte.js +0 -2
  359. package/bundle/chunk-9548cc0c.js +0 -2
  360. package/bundle/chunk-9yrypq1r.js +0 -14
  361. package/bundle/chunk-a0rp7gh4.js +0 -77
  362. package/bundle/chunk-a48t0g95.js +0 -3
  363. package/bundle/chunk-a949at1c.js +0 -3
  364. package/bundle/chunk-akk84fnc.js +0 -2
  365. package/bundle/chunk-aw7j7brm.js +0 -2
  366. package/bundle/chunk-b6cybdj3.js +0 -2
  367. package/bundle/chunk-c5fa8cb1.js +0 -2
  368. package/bundle/chunk-ca4r31we.js +0 -2
  369. package/bundle/chunk-ckbwdrm3.js +0 -2
  370. package/bundle/chunk-cqj21rfj.js +0 -3
  371. package/bundle/chunk-cz3h5n1v.js +0 -3
  372. package/bundle/chunk-dhc6e1t7.js +0 -2
  373. package/bundle/chunk-dk6rbqvp.js +0 -2
  374. package/bundle/chunk-dk975etf.js +0 -3
  375. package/bundle/chunk-dwajajaq.js +0 -2
  376. package/bundle/chunk-dxcrggvq.js +0 -2
  377. package/bundle/chunk-dyt3n3fe.js +0 -2
  378. package/bundle/chunk-e74efvj2.js +0 -800
  379. package/bundle/chunk-e7ah0e61.js +0 -2
  380. package/bundle/chunk-e7v9trve.js +0 -11
  381. package/bundle/chunk-e8ws454m.js +0 -2
  382. package/bundle/chunk-efndtzby.js +0 -2
  383. package/bundle/chunk-eq2pepce.js +0 -2
  384. package/bundle/chunk-eva3nqqb.js +0 -14
  385. package/bundle/chunk-f3bnn9rf.js +0 -8
  386. package/bundle/chunk-f693s9vn.js +0 -2
  387. package/bundle/chunk-ftepqwyq.js +0 -2
  388. package/bundle/chunk-g18ax6yp.js +0 -2
  389. package/bundle/chunk-gadyp6mb.js +0 -2
  390. package/bundle/chunk-ge8315te.js +0 -5
  391. package/bundle/chunk-gk28ffhg.js +0 -2
  392. package/bundle/chunk-gpfc4z4v.js +0 -2
  393. package/bundle/chunk-gqvg02zp.js +0 -2
  394. package/bundle/chunk-gsyt2sv7.js +0 -2
  395. package/bundle/chunk-h3k1dk9m.js +0 -2
  396. package/bundle/chunk-h8c3dcqt.js +0 -2
  397. package/bundle/chunk-hfq11w4h.js +0 -2
  398. package/bundle/chunk-hw5qyht3.js +0 -3
  399. package/bundle/chunk-hwf58w1k.js +0 -2
  400. package/bundle/chunk-jyczz3yh.js +0 -8
  401. package/bundle/chunk-k8k8z6b7.js +0 -3
  402. package/bundle/chunk-kk3ve911.js +0 -2
  403. package/bundle/chunk-kv72hxkp.js +0 -3
  404. package/bundle/chunk-m4j7jyrd.js +0 -3
  405. package/bundle/chunk-mf3sm0pk.js +0 -2
  406. package/bundle/chunk-mkng9ykt.js +0 -2
  407. package/bundle/chunk-mxvypy3s.js +0 -2
  408. package/bundle/chunk-n5ypgxrn.js +0 -28
  409. package/bundle/chunk-n9xw9kqc.js +0 -2
  410. package/bundle/chunk-nc4wbc89.js +0 -2
  411. package/bundle/chunk-ngk67rt3.js +0 -3
  412. package/bundle/chunk-nj2bbtmx.js +0 -2
  413. package/bundle/chunk-nr1g57b2.js +0 -2
  414. package/bundle/chunk-p0ahbpxv.js +0 -2
  415. package/bundle/chunk-p7y8z5rd.js +0 -2
  416. package/bundle/chunk-pt26gerr.js +0 -2
  417. package/bundle/chunk-qkk1as5n.js +0 -2
  418. package/bundle/chunk-qsm9xw87.js +0 -2
  419. package/bundle/chunk-qw980y8h.js +0 -2
  420. package/bundle/chunk-r2w3gr8d.js +0 -2
  421. package/bundle/chunk-r5bqcpkz.js +0 -2
  422. package/bundle/chunk-r67c858b.js +0 -2
  423. package/bundle/chunk-r9fvfkee.js +0 -2
  424. package/bundle/chunk-rcn0dhbj.js +0 -2
  425. package/bundle/chunk-rq47pn3r.js +0 -2
  426. package/bundle/chunk-rvt1tdy8.js +0 -2
  427. package/bundle/chunk-ry7q8xn6.js +0 -2
  428. package/bundle/chunk-s27xvrft.js +0 -2
  429. package/bundle/chunk-s5nde2kd.js +0 -5
  430. package/bundle/chunk-scy39p6q.js +0 -2
  431. package/bundle/chunk-srpe3v8e.js +0 -9
  432. package/bundle/chunk-st5jaszz.js +0 -3
  433. package/bundle/chunk-t5qamf96.js +0 -2
  434. package/bundle/chunk-t9mz17gb.js +0 -3
  435. package/bundle/chunk-tns5x4w0.js +0 -3
  436. package/bundle/chunk-ttevj0pj.js +0 -2
  437. package/bundle/chunk-v7c54cyj.js +0 -2
  438. package/bundle/chunk-vgefaens.js +0 -2
  439. package/bundle/chunk-vv59b4re.js +0 -2
  440. package/bundle/chunk-vwqy7n3g.js +0 -2
  441. package/bundle/chunk-vysa9hp4.js +0 -7
  442. package/bundle/chunk-wn076jwj.js +0 -2
  443. package/bundle/chunk-x0m1qye9.js +0 -2
  444. package/bundle/chunk-xvntsbb1.js +0 -3
  445. package/bundle/chunk-y70aachh.js +0 -2
  446. package/bundle/chunk-yqk58hf6.js +0 -3
  447. package/bundle/chunk-ysgxt83y.js +0 -2
  448. package/bundle/chunk-ze9e6nt3.js +0 -3
  449. package/bundle/chunk-znzan00b.js +0 -3
  450. package/bundle/chunk-zrp55k47.js +0 -2
  451. package/bundle/chunk-zwdnh860.js +0 -2
@@ -0,0 +1,7 @@
1
+ // @bun
2
+ import{I}from"./chunk-a9y27zd2.js";import{J as i,L as r}from"./chunk-pmv8yr8c.js";import{ud as c}from"./chunk-h1kg35mn.js";import{vd as g}from"./chunk-8dxdeksr.js";import{wd as y}from"./chunk-jqn27885.js";import{xd as k}from"./chunk-vm58fkrv.js";import{yd as A}from"./chunk-6sfhbckv.js";import{Dd as w,Ed as u,Gd as W,Hd as L,Id as T,Kd as p,Ld as o,Md as b,Nd as P}from"./chunk-7jhrxzjx.js";import"./chunk-jcjaw7tk.js";import{Pd as z}from"./chunk-9xvctnjr.js";import{Sf as Y}from"./chunk-9s4whpg1.js";import{Xg as M}from"./chunk-w57j3pgz.js";import"./chunk-ebkztnpf.js";import"./chunk-pxx2hz0g.js";import"./chunk-rexdr63q.js";import"./chunk-kqhh2pm9.js";import"./chunk-7fawtcnn.js";import"./chunk-mdzzcrf9.js";import"./chunk-wev34grp.js";import{Mj as R,dl as a,sl as s}from"./chunk-sy3n0qhc.js";import{El as V}from"./chunk-364ccew0.js";import{am as n}from"./chunk-vdpd4akk.js";import"./chunk-yjp0btmq.js";import"./chunk-1bx2sjn6.js";import"./chunk-g5prcvq2.js";import"./chunk-t5tfppwv.js";import"./chunk-25bp7pcm.js";import"./chunk-qdcf1ay5.js";import"./chunk-45mjcxqk.js";import"./chunk-qqne79vp.js";import"./chunk-64s7vfj7.js";import"./chunk-e03tgfpb.js";import"./chunk-gwfx7tx7.js";import"./chunk-1wpjmwnh.js";import"./chunk-cqtkxwd8.js";import"./chunk-ymtcm4xd.js";import"./chunk-yykjvt7f.js";import"./chunk-3mepk08v.js";import"./chunk-atpzz901.js";import"./chunk-0g25z230.js";import"./chunk-w9pdvcf9.js";import"./chunk-4gs87ghj.js";import"./chunk-brh35yt5.js";import"./chunk-vcrakhgy.js";import"./chunk-xdjwapwy.js";import"./chunk-7dep7g7c.js";import{zt as l}from"./chunk-tabcpx7t.js";import"./chunk-cx7p4ezk.js";import"./chunk-tgd5ctnt.js";import"./chunk-p8kpqyxb.js";import"./chunk-3sz6gw10.js";import"./chunk-xqwvx3qq.js";import{Yt as d}from"./chunk-qp9y0g73.js";import"./chunk-xyjehgzm.js";import"./chunk-j21dnncc.js";import{_u as v}from"./chunk-vc4e6xc4.js";import"./chunk-hnz570f9.js";import"./chunk-tdmn21z0.js";import"./chunk-s8mghr5a.js";import"./chunk-pqnbdygz.js";import{UI as O}from"./chunk-ydc6ypjt.js";import"./chunk-ev3a2sxv.js";import"./chunk-pnq1h5az.js";import{kQ as H1}from"./chunk-4sazy0nq.js";import f from"path";import{pathToFileURL as J1}from"url";import Q1 from"os";import{access as S1,readdir as X1}from"fs/promises";var q1={en:A,zh:k,ja:c,fr:y,ru:g},B1=q1[I()]??A;function U($,B){let J=B1[$]??A[$]??$;if(!B)return J;return J.replace(/\{(\w+)\}/g,(X,H)=>(H in B)?String(B[H]):`{${H}}`)}import{text as Z1}from"stream/consumers";var D=($,B)=>M.runPromise(O.gen(function*(){yield*(yield*R.Service).set($,B)}));async function t(){let $=await p({message:"Enter your API key",validate:(B)=>B&&B.length>0?void 0:"Required"});if(w($))throw new Y.CancelledError;return $}async function h($,B){let J=$.provider??B;if("refresh"in $){let{type:X,provider:H,refresh:Z,access:j,expires:q,metadata:S,...G}=$;await D(J,{type:"oauth",refresh:Z,access:j,expires:q,...G})}if("key"in $)await D(J,{type:"api",key:$.key,...$.metadata?{metadata:$.metadata}:{}})}async function x($,B,J){let X=0;if(J){let j=$.auth.methods.findIndex((q)=>q.label.toLowerCase()===J.toLowerCase());if(j===-1)W.error(`Unknown method "${J}" for ${B}. Available: ${$.auth.methods.map((q)=>q.label).join(", ")}`),process.exit(1);X=j}else if($.auth.methods.length>1){let j=await b({message:"Login method",options:$.auth.methods.map((q,S)=>({label:q.label,value:S.toString()}))});if(w(j))throw new Y.CancelledError;X=parseInt(j)}let H=$.auth.methods[X];await new Promise((j)=>setTimeout(j,10));let Z={};if(H.prompts)for(let j of H.prompts){if(j.when){let q=Z[j.when.key];if(q===void 0)continue;if(!(j.when.op==="eq"?q===j.when.value:q!==j.when.value))continue}if(j.condition&&!j.condition(Z))continue;if(j.type==="select"){let q=await b({message:j.message,options:j.options});if(w(q))throw new Y.CancelledError;Z[j.key]=q}else{let q=await P({message:j.message,placeholder:j.placeholder,validate:j.validate?(S)=>j.validate(S??""):void 0});if(w(q))throw new Y.CancelledError;Z[j.key]=q}}if(H.type==="oauth"){let j=await H.authorize(Z);if(j.url)W.info("Go to: "+j.url);if(j.method==="auto"){if(j.instructions)W.info(j.instructions);let q=o();q.start("Waiting for authorization...");let S=await j.callback();if(S.type==="failed")q.stop("Failed to authorize",1);if(S.type==="success")await h(S,B),q.stop("Login successful")}if(j.method==="code"){let q=await P({message:"Paste the authorization code here: ",validate:(G)=>G&&G.length>0?void 0:"Required"});if(w(q))throw new Y.CancelledError;let S=await j.callback(q);if(S.type==="failed")W.error("Failed to authorize");if(S.type==="success")await h(S,B),W.success("Login successful")}return T("Done"),!0}if(H.type==="api"){if(H.authorize){let j=await t(),q=await H.authorize(Z);if(q.type==="failed")W.error("Failed to authorize");if(q.type==="success"){let S=q.provider??B;await D(S,{type:"api",key:q.key??j}),W.success("Login successful")}return T("Done"),!0}}return!1}function G1($){let B=new Set,J=[];for(let X of $.hooks){if(!X.auth)continue;let H=X.auth.provider;if(B.has(H))continue;if(B.add(H),Object.hasOwn($.existingProviders,H))continue;if($.disabled.has(H))continue;if($.enabled&&!$.enabled.has(H))continue;J.push({id:H,name:$.providerNames[H]??H})}return J}function m($){let B=$?.loginExtension;if(!B||typeof B!=="object")return;let J=B;if(typeof J.id!=="string"||typeof J.run!=="function")return;return J}async function W1(){try{let J=await import("./chunk-fr75ytdr.js");for(let X of Object.values(J.modules??{})){let H=m(X);if(H)return H}}catch{}let $=f.join(import.meta.dir,"..","..","ext");await S1($).catch(()=>{return});let B=await X1($).catch(()=>[]);for(let J of B.filter((X)=>X.endsWith(".ts")&&!X.endsWith(".d.ts")))try{let X=m(await import(J1(f.join($,J)).href));if(X)return X}catch{}return}var l1=z({command:"providers",aliases:["auth"],describe:"manage AI providers and credentials",builder:($)=>$.command(Y1).command(_1).command(F1).command(K1).demandCommand(),async handler(){}}),Y1=z({command:"list",aliases:["ls"],describe:"list providers and credentials",async handler($){Y.empty();let B=f.join(v.Path.data,"auth.json"),J=Q1.homedir(),X=B===J||B.startsWith(J+f.sep)?"~"+B.slice(J.length):B;L(`Credentials ${Y.Style.TEXT_DIM}${X}`);let H=await M.runPromise(O.gen(function*(){let q=yield*R.Service;return Object.entries(yield*q.all())})),Z=await V.get();for(let[q,S]of H){let G=Z[q]?.name||q;W.info(`${G} ${Y.Style.TEXT_DIM}${S.type}`)}T(`${H.length} credentials`);let j=[];for(let[q,S]of Object.entries(Z))for(let G of S.env)if(process.env[G])j.push({provider:S.name||q,envVar:G});if(j.length>0){Y.empty(),L("Environment");for(let{provider:q,envVar:S}of j)W.info(`${q} ${Y.Style.TEXT_DIM}${S}`);T(`${j.length} environment variable`+(j.length===1?"":"s"))}}}),_1=z({command:"login [url]",describe:"log in to a provider",builder:($)=>$.positional("url",{describe:"qitqode auth provider",type:"string"}).option("provider",{alias:["p"],describe:"provider id or name to log in to (skips provider selection)",type:"string"}).option("method",{alias:["m"],describe:"login method label (skips method selection)",type:"string"}),async handler($){await n.provide({directory:process.cwd(),async fn(){if(Y.empty(),L("Add credential"),$.url){let Q=$.url.replace(/\/+$/,""),_=await fetch(`${Q}/.well-known/opencode`).then((j1)=>j1.json());W.info(`Running \`${_.auth.command.join(" ")}\``);let F=l.spawn(_.auth.command,{stdout:"pipe"});if(!F.stdout){W.error("Failed"),T("Done");return}let[C,N]=await Promise.all([F.exited,Z1(F.stdout)]);if(C!==0){W.error("Failed"),T("Done");return}await D(Q,{type:"wellknown",key:_.auth.env,token:N.trim()}),W.success("Logged into "+Q),T("Done");return}await V.refresh(!0).catch(()=>{});let B=await M.runPromise(s.Service.use((Q)=>Q.get())),J=new Set(B.disabled_providers??[]),X=B.enabled_providers?new Set(B.enabled_providers):void 0,H=await V.get().then((Q)=>{let _={};for(let[F,C]of Object.entries(Q))if((X?X.has(F):!0)&&!J.has(F))_[F]=C;return _}),Z=await M.runPromise(O.gen(function*(){return yield*(yield*a.Service).list()})),j=i,q=G1({hooks:Z,existingProviders:H,disabled:J,enabled:X,providerNames:Object.fromEntries(Object.entries(B.provider??{}).map(([Q,_])=>[Q,_.name]))}),S=[...r(d(H),j,(Q)=>({openai:"ChatGPT Plus/Pro or API key"})[Q.id]),...q.map((Q)=>({label:Q.name,value:Q.id,hint:"plugin"}))],G=await W1(),e=G?[G.id,...G.aliases??[]]:[],K;if(G&&$.provider&&e.includes($.provider)){await G.run();return}else if($.provider){let Q=$.provider,_=S.find((N)=>N.value===Q),F=S.find((N)=>N.label.toLowerCase()===Q.toLowerCase()),C=_??F;if(!C)W.error(`Unknown provider "${Q}"`),process.exit(1);K=C.value}else{let Q=await b({message:U("cli.providers.select"),options:[...G?.menu?[{label:G.menu.label,value:G.id,hint:G.menu.hint}]:[],{label:U("cli.providers.other"),value:"__other__"}]});if(w(Q))throw new Y.CancelledError;if(G&&Q===G.id){await G.run();return}let _=await u({message:U("cli.providers.select"),maxItems:8,options:[...S,{value:"other",label:"Other"}]});if(w(_))throw new Y.CancelledError;K=_}let E=Z.findLast((Q)=>Q.auth?.provider===K);if(E&&E.auth){if(await x({auth:E.auth},K,$.method))return}if(K==="other"){let Q=await P({message:"Enter provider id",validate:(F)=>F&&F.match(/^[0-9a-z-]+$/)?void 0:"a-z, 0-9 and hyphens only"});if(w(Q))throw new Y.CancelledError;K=Q.replace(/^@ai-sdk\//,"");let _=Z.findLast((F)=>F.auth?.provider===K);if(_&&_.auth){if(await x({auth:_.auth},K,$.method))return}W.warn(`This only stores a credential for ${K} - you will need configure it in qitqode.json, check the docs for examples.`)}if(K==="amazon-bedrock")W.info(`Amazon Bedrock authentication priority:
3
+ 1. Bearer token (AWS_BEARER_TOKEN_BEDROCK or /connect)
4
+ 2. AWS credential chain (profile, access keys, IAM roles, EKS IRSA)
5
+
6
+ Configure via qitqode.json options (profile, region, endpoint) or
7
+ AWS environment variables (AWS_PROFILE, AWS_REGION, AWS_ACCESS_KEY_ID, AWS_WEB_IDENTITY_TOKEN_FILE).`);if(K==="opencode")W.info("Create an api key at https://opencode.ai/auth");if(K==="vercel")W.info("You can create an api key at https://vercel.link/ai-gateway-token");if(["cloudflare","cloudflare-ai-gateway"].includes(K))W.info("Cloudflare AI Gateway can be configured with CLOUDFLARE_GATEWAY_ID, CLOUDFLARE_ACCOUNT_ID, and CLOUDFLARE_API_TOKEN environment variables. Read more: https://opencode.ai/docs/providers/#cloudflare-ai-gateway");let $1=await t();await D(K,{type:"api",key:$1}),T("Done")}})}}),F1=z({command:"logout",describe:"log out from a configured provider",async handler($){Y.empty();let B=await M.runPromise(O.gen(function*(){let Z=yield*R.Service;return Object.entries(yield*Z.all())}));if(L("Remove credential"),B.length===0){W.error("No credentials found");return}let J=await V.get(),X=await b({message:"Select provider",options:B.map(([Z,j])=>({label:(J[Z]?.name||Z)+Y.Style.TEXT_DIM+" ("+j.type+")",value:Z}))});if(w(X))throw new Y.CancelledError;let H=X;await M.runPromise(O.gen(function*(){yield*(yield*R.Service).remove(H)})),T("Logout successful")}}),K1=z({command:"whoami",describe:"show current logged-in user info",async handler($){Y.empty(),L("Current auth"),W.info("Run `qode auth list` to see all authenticated providers."),T("")}});export{G1 as resolvePluginProviders,K1 as ProvidersWhoamiCommand,F1 as ProvidersLogoutCommand,_1 as ProvidersLoginCommand,Y1 as ProvidersListCommand,l1 as ProvidersCommand};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{$v as K,$w as Ka,$x as Jb,$y as Jc,$z as Jd,Av as j,Aw as ja,Ax as jb,Ay as ic,Az as id,Bv as k,Bw as ka,Bx as kb,By as jc,Bz as jd,Cv as l,Cw as la,Cx as lb,Cy as kc,Cz as kd,Dv as m,Dw as ma,Dx as mb,Dy as lc,Dz as ld,Ev as n,Ew as na,Ex as nb,Ey as mc,Ez as md,Fv as o,Fw as oa,Fx as ob,Fy as nc,Fz as nd,Gv as p,Gw as pa,Gx as pb,Gy as oc,Gz as od,Hv as q,Hw as qa,Hx as qb,Hy as pc,Hz as pd,Iv as r,Iw as ra,Ix as rb,Iy as qc,Iz as qd,Jv as s,Jw as sa,Jx as sb,Jy as rc,Jz as rd,Kv as t,Kw as ta,Kx as tb,Ky as sc,Kz as sd,Lv as u,Lw as ua,Lx as ub,Ly as tc,Lz as td,Mv as v,Mw as va,Mx as vb,My as uc,Mz as ud,Nv as w,Nw as wa,Nx as wb,Ny as vc,Nz as vd,Ov as x,Ow as xa,Ox as xb,Oy as wc,Oz as wd,Pv as y,Pw as ya,Px as yb,Py as xc,Pz as xd,Qv as z,Qw as za,Qx as zb,Qy as yc,Qz as yd,Rv as A,Rw as Aa,Rx as Ab,Ry as zc,Rz as zd,Sv as B,Sw as Ba,Sx as Bb,Sy as Ac,Sz as Ad,Tv as C,Tw as Ca,Tx as Cb,Ty as Bc,Tz as Bd,Uv as D,Uw as Da,Ux as Db,Uy as Cc,Uz as Cd,Vv as E,Vw as Ea,Vy as Dc,Vz as Dd,Wv as F,Ww as Fa,Wx as Eb,Wy as Ec,Wz as Ed,Xv as G,Xw as Ga,Xx as Fb,Xy as Fc,Xz as Fd,Yv as H,Yw as Ha,Yx as Gb,Yy as Gc,Yz as Gd,Zv as I,Zw as Ia,Zx as Hb,Zy as Hc,Zz as Hd,_v as J,_w as Ja,_x as Ib,_y as Ic,_z as Id,aA as Kd,aw as L,ax as La,ay as Kb,az as Kc,bA as Ld,bw as M,bx as Ma,by as Lb,bz as Lc,cA as Md,cw as N,cx as Na,cy as Mb,cz as Mc,dA as Nd,dw as O,dx as Oa,dy as Nb,dz as Nc,eA as Od,ew as P,ex as Pa,ey as Ob,ez as Oc,fw as Q,fx as Qa,fy as Pb,fz as Pc,gw as R,gx as Ra,gy as Qb,gz as Qc,hw as S,hx as Sa,hy as Rb,hz as Rc,iw as T,ix as Ta,iy as Sb,iz as Sc,jw as U,jx as Ua,jy as Tb,jz as Tc,kw as V,kx as Va,ky as Ub,kz as Uc,lw as W,lx as Wa,ly as Vb,lz as Vc,mw as X,mx as Xa,my as Wb,mz as Wc,nw as Y,nx as Ya,ny as Xb,nz as Xc,ow as Z,ox as Za,oy as Yb,oz as Yc,pw as _,px as _a,py as Zb,pz as Zc,qv as a,qw as $,qx as $a,qy as _b,qz as _c,rv as b,rw as aa,rx as ab,ry as $b,rz as $c,sv as c,sw as ba,sx as bb,sy as ac,sz as ad,tv as d,tw as ca,tx as cb,ty as bc,tz as bd,uv as e,uw as da,ux as db,uy as cc,uz as cd,vv as f,vw as ea,vx as eb,vy as dc,vz as dd,wv as g,ww as fa,wx as fb,wy as ec,wz as ed,xw as ga,xx as gb,xy as fc,xz as fd,yv as h,yw as ha,yx as hb,yy as gc,yz as gd,zv as i,zw as ia,zx as ib,zy as hc,zz as hd}from"./chunk-mpygdb5a.js";import"./chunk-3k2b05fv.js";export{ka as version,i as util,n as treeifyError,Nd as toJSONSchema,o as toDotPath,x as safeParseAsync,v as safeParse,L as safeEncodeAsync,H as safeEncode,N as safeDecodeAsync,J as safeDecode,Ib as registry,O as regexes,p as prettifyError,t as parseAsync,r as parse,Eb as locales,Ma as isValidJWT,Ja as isValidBase64URL,Ha as isValidBase64,Jb as globalRegistry,f as globalConfig,m as formatError,l as flattenError,D as encodeAsync,z as encode,F as decodeAsync,B as decode,g as config,h as clone,Yb as _xid,Ec as _void,Rb as _uuidv7,Qb as _uuidv6,Pb as _uuidv4,Ob as _uuid,Sb as _url,Zc as _uppercase,Cc as _unknown,jd as _union,zc as _undefined,Xb as _ulid,xc as _uint64,rc as _uint32,md as _tuple,fd as _trim,ud as _transform,hd as _toUpperCase,gd as _toLowerCase,Dd as _templateLiteral,yc as _symbol,Id as _superRefine,zd as _success,Kd as _stringbool,Ld as _stringFormat,Kb as _string,$c as _startsWith,Tc as _size,pd as _set,w as _safeParseAsync,u as _safeParse,K as _safeEncodeAsync,G as _safeEncode,M as _safeDecodeAsync,I as _safeDecode,Xc as _regex,Hd as _refine,nd as _record,Cd as _readonly,bd as _property,Fd as _promise,Mc as _positive,Bd as _pipe,s as _parseAsync,q as _parse,dd as _overwrite,vd as _optional,lc as _number,wd as _nullable,Ac as _null,ed as _normalize,Oc as _nonpositive,yd as _nonoptional,Pc as _nonnegative,Dc as _never,Nc as _negative,rd as _nativeEnum,Ub as _nanoid,Hc as _nan,Qc as _multipleOf,Sc as _minSize,Vc as _minLength,Lc as _min,cd as _mime,Rc as _maxSize,Uc as _maxLength,Jc as _max,od as _map,Jc as _lte,Ic as _lt,Yc as _lowercase,sd as _literal,Wc as _length,Ed as _lazy,Zb as _ksuid,fc as _jwt,jc as _isoTime,kc as _isoDuration,hc as _isoDateTime,ic as _isoDate,$b as _ipv6,_b as _ipv4,ld as _intersection,wc as _int64,qc as _int32,nc as _int,_c as _includes,Nb as _guid,Lc as _gte,Kc as _gt,pc as _float64,oc as _float32,td as _file,qd as _enum,ad as _endsWith,C as _encodeAsync,y as _encode,Tb as _emoji,Mb as _email,ec as _e164,kd as _discriminatedUnion,xd as _default,E as _decodeAsync,A as _decode,Fc as _date,Gd as _custom,Wb as _cuid2,Vb as _cuid,Lb as _coercedString,mc as _coercedNumber,Gc as _coercedDate,tc as _coercedBoolean,vc as _coercedBigint,bc as _cidrv6,ac as _cidrv4,Jd as _check,Ad as _catch,sc as _boolean,uc as _bigint,dc as _base64url,cc as _base64,id as _array,Bc as _any,gc as TimePrecision,a as NEVER,Md as JSONSchemaGenerator,Od as JSONSchema,ja as Doc,Fb as $output,Gb as $input,b as $constructor,c as $brand,xa as $ZodXID,_a as $ZodVoid,Ya as $ZodUnknown,db as $ZodUnion,Va as $ZodUndefined,pa as $ZodUUID,ra as $ZodURL,wa as $ZodULID,la as $ZodType,gb as $ZodTuple,nb as $ZodTransform,zb as $ZodTemplateLiteral,Ua as $ZodSymbol,tb as $ZodSuccess,na as $ZodStringFormat,ma as $ZodString,jb as $ZodSet,Hb as $ZodRegistry,hb as $ZodRecord,k as $ZodRealError,yb as $ZodReadonly,Bb as $ZodPromise,rb as $ZodPrefault,wb as $ZodPipe,ob as $ZodOptional,cb as $ZodObjectJIT,bb as $ZodObject,Qa as $ZodNumberFormat,Pa as $ZodNumber,pb as $ZodNullable,Wa as $ZodNull,sb as $ZodNonOptional,Za as $ZodNever,ta as $ZodNanoID,vb as $ZodNaN,ib as $ZodMap,lb as $ZodLiteral,Cb as $ZodLazy,ya as $ZodKSUID,Na as $ZodJWT,fb as $ZodIntersection,Ba as $ZodISOTime,Ca as $ZodISODuration,za as $ZodISODateTime,Aa as $ZodISODate,Ea as $ZodIPv6,Da as $ZodIPv4,oa as $ZodGUID,Ab as $ZodFunction,mb as $ZodFile,j as $ZodError,kb as $ZodEnum,e as $ZodEncodeError,sa as $ZodEmoji,qa as $ZodEmail,La as $ZodE164,eb as $ZodDiscriminatedUnion,qb as $ZodDefault,$a as $ZodDate,Oa as $ZodCustomStringFormat,Db as $ZodCustom,xb as $ZodCodec,ca as $ZodCheckUpperCase,$ as $ZodCheckStringFormat,ea as $ZodCheckStartsWith,X as $ZodCheckSizeEquals,aa as $ZodCheckRegex,ga as $ZodCheckProperty,ia as $ZodCheckOverwrite,T as $ZodCheckNumberFormat,S as $ZodCheckMultipleOf,W as $ZodCheckMinSize,Z as $ZodCheckMinLength,ha as $ZodCheckMimeType,V as $ZodCheckMaxSize,Y as $ZodCheckMaxLength,ba as $ZodCheckLowerCase,Q as $ZodCheckLessThan,_ as $ZodCheckLengthEquals,da as $ZodCheckIncludes,R as $ZodCheckGreaterThan,fa as $ZodCheckEndsWith,U as $ZodCheckBigIntFormat,P as $ZodCheck,ub as $ZodCatch,va as $ZodCUID2,ua as $ZodCUID,Ga as $ZodCIDRv6,Fa as $ZodCIDRv4,Ra as $ZodBoolean,Ta as $ZodBigIntFormat,Sa as $ZodBigInt,Ka as $ZodBase64URL,Ia as $ZodBase64,d as $ZodAsyncError,ab as $ZodArray,Xa as $ZodAny};
2
+ import{$v as C,$w as Ca,$x as Cb,$y as Bc,$z as Bd,Av as c,Aw as ba,Ax as bb,Ay as ac,Az as ad,Bv as d,Bw as ca,Bx as cb,By as bc,Bz as bd,Cv as e,Cw as da,Cx as db,Cy as cc,Cz as cd,Dv as f,Dw as ea,Dx as eb,Dy as dc,Dz as dd,Ev as g,Ew as fa,Ex as fb,Ey as ec,Ez as ed,Fw as ga,Fx as gb,Fy as fc,Fz as fd,Gv as h,Gw as ha,Gx as hb,Gy as gc,Gz as gd,Hv as i,Hw as ia,Hx as ib,Hy as hc,Hz as hd,Iv as j,Iw as ja,Ix as jb,Iy as ic,Iz as id,Jv as k,Jw as ka,Jx as kb,Jy as jc,Jz as jd,Kv as l,Kw as la,Kx as lb,Ky as kc,Kz as kd,Lv as m,Lw as ma,Lx as mb,Ly as lc,Lz as ld,Mv as n,Mw as na,Mx as nb,My as mc,Mz as md,Nv as o,Nw as oa,Nx as ob,Ny as nc,Nz as nd,Ov as p,Ow as pa,Ox as pb,Oy as oc,Oz as od,Pv as q,Pw as qa,Px as qb,Py as pc,Pz as pd,Qv as r,Qw as ra,Qx as rb,Qy as qc,Qz as qd,Rv as s,Rw as sa,Rx as sb,Ry as rc,Rz as rd,Sv as t,Sw as ta,Sx as tb,Sy as sc,Sz as sd,Tv as u,Tw as ua,Tx as ub,Ty as tc,Tz as td,Uv as v,Uw as va,Ux as vb,Uy as uc,Uz as ud,Vv as w,Vw as wa,Vx as wb,Vy as vc,Vz as vd,Wv as x,Ww as xa,Wx as xb,Wy as wc,Wz as wd,Xv as y,Xw as ya,Xx as yb,Xy as xc,Xz as xd,Yv as z,Yw as za,Yx as zb,Yy as yc,Yz as yd,Zv as A,Zw as Aa,Zx as Ab,Zy as zc,Zz as zd,_v as B,_w as Ba,_x as Bb,_y as Ac,_z as Ad,aA as Cd,aw as D,ax as Da,ay as Db,az as Cc,bA as Dd,bw as E,bx as Ea,bz as Dc,cA as Ed,cw as F,cx as Fa,cy as Eb,cz as Ec,dA as Fd,dw as G,dx as Ga,dy as Fb,dz as Fc,eA as Gd,ew as H,ex as Ha,ey as Gb,ez as Gc,fA as Hd,fw as I,fx as Ia,fy as Hb,fz as Hc,gA as Id,gw as J,gx as Ja,gy as Ib,gz as Ic,hA as Jd,hw as K,hx as Ka,hy as Jb,hz as Jc,iA as Kd,iw as L,ix as La,iy as Kb,iz as Kc,jA as Ld,jw as M,jx as Ma,jy as Lb,jz as Lc,kA as Md,kw as N,kx as Na,ky as Mb,kz as Mc,lA as Nd,lw as O,lx as Oa,ly as Nb,lz as Nc,mA as Od,mw as P,mx as Pa,my as Ob,mz as Oc,nw as Q,nx as Qa,ny as Pb,nz as Pc,ow as R,ox as Ra,oy as Qb,oz as Qc,pw as S,px as Sa,py as Rb,pz as Rc,qw as T,qx as Ta,qy as Sb,qz as Sc,rw as U,rx as Ua,ry as Tb,rz as Tc,sw as V,sx as Va,sy as Ub,sz as Uc,tw as W,tx as Wa,ty as Vb,tz as Vc,uw as X,ux as Xa,uy as Wb,uz as Wc,vw as Y,vx as Ya,vy as Xb,vz as Xc,ww as Z,wx as Za,wy as Yb,wz as Yc,xw as _,xx as _a,xy as Zb,xz as Zc,yv as a,yw as $,yx as $a,yy as _b,yz as _c,zv as b,zw as aa,zx as ab,zy as $b,zz as $c}from"./chunk-s8mghr5a.js";import"./chunk-4sazy0nq.js";export{ka as version,i as util,n as treeifyError,Nd as toJSONSchema,o as toDotPath,x as safeParseAsync,v as safeParse,L as safeEncodeAsync,H as safeEncode,N as safeDecodeAsync,J as safeDecode,Ib as registry,O as regexes,p as prettifyError,t as parseAsync,r as parse,Eb as locales,Ma as isValidJWT,Ja as isValidBase64URL,Ha as isValidBase64,Jb as globalRegistry,f as globalConfig,m as formatError,l as flattenError,D as encodeAsync,z as encode,F as decodeAsync,B as decode,g as config,h as clone,Yb as _xid,Ec as _void,Rb as _uuidv7,Qb as _uuidv6,Pb as _uuidv4,Ob as _uuid,Sb as _url,Zc as _uppercase,Cc as _unknown,jd as _union,zc as _undefined,Xb as _ulid,xc as _uint64,rc as _uint32,md as _tuple,fd as _trim,ud as _transform,hd as _toUpperCase,gd as _toLowerCase,Dd as _templateLiteral,yc as _symbol,Id as _superRefine,zd as _success,Kd as _stringbool,Ld as _stringFormat,Kb as _string,$c as _startsWith,Tc as _size,pd as _set,w as _safeParseAsync,u as _safeParse,K as _safeEncodeAsync,G as _safeEncode,M as _safeDecodeAsync,I as _safeDecode,Xc as _regex,Hd as _refine,nd as _record,Cd as _readonly,bd as _property,Fd as _promise,Mc as _positive,Bd as _pipe,s as _parseAsync,q as _parse,dd as _overwrite,vd as _optional,lc as _number,wd as _nullable,Ac as _null,ed as _normalize,Oc as _nonpositive,yd as _nonoptional,Pc as _nonnegative,Dc as _never,Nc as _negative,rd as _nativeEnum,Ub as _nanoid,Hc as _nan,Qc as _multipleOf,Sc as _minSize,Vc as _minLength,Lc as _min,cd as _mime,Rc as _maxSize,Uc as _maxLength,Jc as _max,od as _map,Jc as _lte,Ic as _lt,Yc as _lowercase,sd as _literal,Wc as _length,Ed as _lazy,Zb as _ksuid,fc as _jwt,jc as _isoTime,kc as _isoDuration,hc as _isoDateTime,ic as _isoDate,$b as _ipv6,_b as _ipv4,ld as _intersection,wc as _int64,qc as _int32,nc as _int,_c as _includes,Nb as _guid,Lc as _gte,Kc as _gt,pc as _float64,oc as _float32,td as _file,qd as _enum,ad as _endsWith,C as _encodeAsync,y as _encode,Tb as _emoji,Mb as _email,ec as _e164,kd as _discriminatedUnion,xd as _default,E as _decodeAsync,A as _decode,Fc as _date,Gd as _custom,Wb as _cuid2,Vb as _cuid,Lb as _coercedString,mc as _coercedNumber,Gc as _coercedDate,tc as _coercedBoolean,vc as _coercedBigint,bc as _cidrv6,ac as _cidrv4,Jd as _check,Ad as _catch,sc as _boolean,uc as _bigint,dc as _base64url,cc as _base64,id as _array,Bc as _any,gc as TimePrecision,a as NEVER,Md as JSONSchemaGenerator,Od as JSONSchema,ja as Doc,Fb as $output,Gb as $input,b as $constructor,c as $brand,xa as $ZodXID,_a as $ZodVoid,Ya as $ZodUnknown,db as $ZodUnion,Va as $ZodUndefined,pa as $ZodUUID,ra as $ZodURL,wa as $ZodULID,la as $ZodType,gb as $ZodTuple,nb as $ZodTransform,zb as $ZodTemplateLiteral,Ua as $ZodSymbol,tb as $ZodSuccess,na as $ZodStringFormat,ma as $ZodString,jb as $ZodSet,Hb as $ZodRegistry,hb as $ZodRecord,k as $ZodRealError,yb as $ZodReadonly,Bb as $ZodPromise,rb as $ZodPrefault,wb as $ZodPipe,ob as $ZodOptional,cb as $ZodObjectJIT,bb as $ZodObject,Qa as $ZodNumberFormat,Pa as $ZodNumber,pb as $ZodNullable,Wa as $ZodNull,sb as $ZodNonOptional,Za as $ZodNever,ta as $ZodNanoID,vb as $ZodNaN,ib as $ZodMap,lb as $ZodLiteral,Cb as $ZodLazy,ya as $ZodKSUID,Na as $ZodJWT,fb as $ZodIntersection,Ba as $ZodISOTime,Ca as $ZodISODuration,za as $ZodISODateTime,Aa as $ZodISODate,Ea as $ZodIPv6,Da as $ZodIPv4,oa as $ZodGUID,Ab as $ZodFunction,mb as $ZodFile,j as $ZodError,kb as $ZodEnum,e as $ZodEncodeError,sa as $ZodEmoji,qa as $ZodEmail,La as $ZodE164,eb as $ZodDiscriminatedUnion,qb as $ZodDefault,$a as $ZodDate,Oa as $ZodCustomStringFormat,Db as $ZodCustom,xb as $ZodCodec,ca as $ZodCheckUpperCase,$ as $ZodCheckStringFormat,ea as $ZodCheckStartsWith,X as $ZodCheckSizeEquals,aa as $ZodCheckRegex,ga as $ZodCheckProperty,ia as $ZodCheckOverwrite,T as $ZodCheckNumberFormat,S as $ZodCheckMultipleOf,W as $ZodCheckMinSize,Z as $ZodCheckMinLength,ha as $ZodCheckMimeType,V as $ZodCheckMaxSize,Y as $ZodCheckMaxLength,ba as $ZodCheckLowerCase,Q as $ZodCheckLessThan,_ as $ZodCheckLengthEquals,da as $ZodCheckIncludes,R as $ZodCheckGreaterThan,fa as $ZodCheckEndsWith,U as $ZodCheckBigIntFormat,P as $ZodCheck,ub as $ZodCatch,va as $ZodCUID2,ua as $ZodCUID,Ga as $ZodCIDRv6,Fa as $ZodCIDRv4,Ra as $ZodBoolean,Ta as $ZodBigIntFormat,Sa as $ZodBigInt,Ka as $ZodBase64URL,Ia as $ZodBase64,d as $ZodAsyncError,ab as $ZodArray,Xa as $ZodAny};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{ZP as B}from"./chunk-ee23d2nz.js";import{$P as z,cQ as A}from"./chunk-3k2b05fv.js";var F=z((k)=>{Object.defineProperty(k,"__esModule",{value:!0});k.getMachineId=void 0;var C=A("fs"),D=B();async function E(){let v=["/etc/machine-id","/var/lib/dbus/machine-id"];for(let w of v)try{return(await C.promises.readFile(w,{encoding:"utf8"})).trim()}catch(b){D.diag.debug(`error reading machine id: ${b}`)}return}k.getMachineId=E});export default F();
2
+ import{fQ as B}from"./chunk-pnq1h5az.js";import{hQ as z,kQ as A}from"./chunk-4sazy0nq.js";var F=z((k)=>{Object.defineProperty(k,"__esModule",{value:!0});k.getMachineId=void 0;var C=A("fs"),D=B();async function E(){let v=["/etc/machine-id","/var/lib/dbus/machine-id"];for(let w of v)try{return(await C.promises.readFile(w,{encoding:"utf8"})).trim()}catch(b){D.diag.debug(`error reading machine id: ${b}`)}return}k.getMachineId=E});export default F();
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{De as u,Ee as S,Fe as v}from"./chunk-1byd3wma.js";import{$e as A,Ge as q,Le as U,Pe as k,Se as y,Ve as $,We as D,_e as N,df as E,ff as H,hf as O}from"./chunk-dctj3c22.js";import"./chunk-kwx9ewe0.js";import"./chunk-cqtkxwd8.js";import"./chunk-c5pb87yf.js";import{pv as j}from"./chunk-gmzrvxnv.js";import"./chunk-mpygdb5a.js";import"./chunk-3k2b05fv.js";var C=$(()=>D(j.object({error:j.object({message:j.string()})}))),f=$(()=>D(j.object({id:j.string().nullish(),model:j.string().nullish(),results:j.array(j.object({index:j.number(),relevance_score:j.number()})),usage:j.object({prompt_tokens:j.number(),completion_tokens:j.number(),total_tokens:j.number()})}))),M=$(()=>D(j.object({rankFields:j.array(j.string()).optional()}))),h=class{constructor(F,G){this.specificationVersion="v3",this.modelId=F,this.config=G}get provider(){return this.config.provider}async doRerank({documents:F,headers:G,query:K,topN:V,abortSignal:W,providerOptions:Y}){var J,P;let Z=await N({provider:"togetherai",providerOptions:Y,schema:M}),{responseHeaders:X,value:B,rawValue:x}=await A({url:`${this.config.baseURL}/rerank`,headers:q(this.config.headers(),G),body:{model:this.modelId,documents:F.values,query:K,top_n:V,rank_fields:Z==null?void 0:Z.rankFields,return_documents:!1},failedResponseHandler:E({errorSchema:C,errorToMessage:(Q)=>Q.error.message}),successfulResponseHandler:H(f),abortSignal:W,fetch:this.config.fetch});return{ranking:B.results.map((Q)=>({index:Q.index,relevanceScore:Q.relevance_score})),response:{id:(J=B.id)!=null?J:void 0,modelId:(P=B.model)!=null?P:void 0,headers:X,body:x}}}},I=class{constructor(F,G){this.modelId=F,this.config=G,this.specificationVersion="v3",this.maxImagesPerCall=1}get provider(){return this.config.provider}async doGenerate({prompt:F,n:G,size:K,seed:V,providerOptions:W,headers:Y,abortSignal:J,files:P,mask:Z}){var X,B,x;let Q=[];if(Z!=null)throw Error("Together AI does not support mask-based image editing. Use FLUX Kontext models (e.g., black-forest-labs/FLUX.1-kontext-pro) with a reference image and descriptive prompt instead.");if(K!=null)Q.push({type:"unsupported",feature:"aspectRatio",details:"This model does not support the `aspectRatio` option. Use `size` instead."});let _=(x=(B=(X=this.config._internal)==null?void 0:X.currentDate)==null?void 0:B.call(X))!=null?x:new Date,R=await N({provider:"togetherai",providerOptions:W,schema:m}),w;if(P!=null&&P.length>0){if(w=U(P[0]),P.length>1)Q.push({type:"other",message:"Together AI only supports a single input image. Additional images are ignored."})}let T=K==null?void 0:K.split("x"),{value:b,responseHeaders:z}=await A({url:`${this.config.baseURL}/images/generations`,headers:q(this.config.headers(),Y),body:{model:this.modelId,prompt:F,seed:V,...G>1?{n:G}:{},...T&&{width:parseInt(T[0]),height:parseInt(T[1])},...w!=null?{image_url:w}:{},response_format:"base64",...R!=null?R:{}},failedResponseHandler:E({errorSchema:g,errorToMessage:(L)=>L.error.message}),successfulResponseHandler:H(c),abortSignal:J,fetch:this.config.fetch});return{images:b.data.map((L)=>L.b64_json),warnings:Q,response:{timestamp:_,modelId:this.modelId,headers:z}}}},c=j.object({data:j.array(j.object({b64_json:j.string()}))}),g=j.object({error:j.object({message:j.string()})}),m=$(()=>D(j.object({steps:j.number().nullish(),guidance:j.number().nullish(),negative_prompt:j.string().nullish(),disable_safety_checker:j.boolean().nullish()}).passthrough())),p="2.0.41";function l(){if(typeof process>"u")return;if(typeof process.env.TOGETHER_API_KEY==="string")return;let F=process.env.TOGETHER_AI_API_KEY;if(typeof F==="string")console.warn("TOGETHER_AI_API_KEY is deprecated and will be removed in a future release. Please use TOGETHER_API_KEY instead.");return F}function n(F={}){var G;let K=O((G=F.baseURL)!=null?G:"https://api.together.xyz/v1/"),V=()=>{var x;return k({Authorization:`Bearer ${y({apiKey:(x=F.apiKey)!=null?x:l(),environmentVariableName:"TOGETHER_API_KEY",description:"TogetherAI"})}`,...F.headers},`ai-sdk/togetherai/${p}`)},W=(x)=>({provider:`togetherai.${x}`,url:({path:Q})=>`${K}${Q}`,headers:V,fetch:F.fetch}),Y=(x)=>{return new u(x,W("chat"))},J=(x)=>new S(x,W("completion")),P=(x)=>new v(x,W("embedding")),Z=(x)=>new I(x,{...W("image"),baseURL:K!=null?K:"https://api.together.xyz/v1/"}),X=(x)=>new h(x,{...W("reranking"),baseURL:K!=null?K:"https://api.together.xyz/v1/"}),B=(x)=>Y(x);return B.specificationVersion="v3",B.completionModel=J,B.languageModel=Y,B.chatModel=Y,B.embeddingModel=P,B.textEmbeddingModel=P,B.image=Z,B.imageModel=Z,B.reranking=X,B.rerankingModel=X,B}var xj=n();export{xj as togetherai,n as createTogetherAI,p as VERSION};
2
+ import{Be as u,Ce as S,De as v}from"./chunk-cdh26622.js";import{Ee as q,Je as U,Ne as k,Qe as y,Te as $,Ue as D,Ye as N,Ze as A,bf as E,df as H,ff as O}from"./chunk-b0jh0rby.js";import"./chunk-1wpjmwnh.js";import"./chunk-cqtkxwd8.js";import"./chunk-ymtcm4xd.js";import{xv as j}from"./chunk-tdmn21z0.js";import"./chunk-s8mghr5a.js";import"./chunk-4sazy0nq.js";var C=$(()=>D(j.object({error:j.object({message:j.string()})}))),f=$(()=>D(j.object({id:j.string().nullish(),model:j.string().nullish(),results:j.array(j.object({index:j.number(),relevance_score:j.number()})),usage:j.object({prompt_tokens:j.number(),completion_tokens:j.number(),total_tokens:j.number()})}))),M=$(()=>D(j.object({rankFields:j.array(j.string()).optional()}))),h=class{constructor(F,G){this.specificationVersion="v3",this.modelId=F,this.config=G}get provider(){return this.config.provider}async doRerank({documents:F,headers:G,query:K,topN:V,abortSignal:W,providerOptions:Y}){var J,P;let Z=await N({provider:"togetherai",providerOptions:Y,schema:M}),{responseHeaders:X,value:B,rawValue:x}=await A({url:`${this.config.baseURL}/rerank`,headers:q(this.config.headers(),G),body:{model:this.modelId,documents:F.values,query:K,top_n:V,rank_fields:Z==null?void 0:Z.rankFields,return_documents:!1},failedResponseHandler:E({errorSchema:C,errorToMessage:(Q)=>Q.error.message}),successfulResponseHandler:H(f),abortSignal:W,fetch:this.config.fetch});return{ranking:B.results.map((Q)=>({index:Q.index,relevanceScore:Q.relevance_score})),response:{id:(J=B.id)!=null?J:void 0,modelId:(P=B.model)!=null?P:void 0,headers:X,body:x}}}},I=class{constructor(F,G){this.modelId=F,this.config=G,this.specificationVersion="v3",this.maxImagesPerCall=1}get provider(){return this.config.provider}async doGenerate({prompt:F,n:G,size:K,seed:V,providerOptions:W,headers:Y,abortSignal:J,files:P,mask:Z}){var X,B,x;let Q=[];if(Z!=null)throw Error("Together AI does not support mask-based image editing. Use FLUX Kontext models (e.g., black-forest-labs/FLUX.1-kontext-pro) with a reference image and descriptive prompt instead.");if(K!=null)Q.push({type:"unsupported",feature:"aspectRatio",details:"This model does not support the `aspectRatio` option. Use `size` instead."});let _=(x=(B=(X=this.config._internal)==null?void 0:X.currentDate)==null?void 0:B.call(X))!=null?x:new Date,R=await N({provider:"togetherai",providerOptions:W,schema:m}),w;if(P!=null&&P.length>0){if(w=U(P[0]),P.length>1)Q.push({type:"other",message:"Together AI only supports a single input image. Additional images are ignored."})}let T=K==null?void 0:K.split("x"),{value:b,responseHeaders:z}=await A({url:`${this.config.baseURL}/images/generations`,headers:q(this.config.headers(),Y),body:{model:this.modelId,prompt:F,seed:V,...G>1?{n:G}:{},...T&&{width:parseInt(T[0]),height:parseInt(T[1])},...w!=null?{image_url:w}:{},response_format:"base64",...R!=null?R:{}},failedResponseHandler:E({errorSchema:g,errorToMessage:(L)=>L.error.message}),successfulResponseHandler:H(c),abortSignal:J,fetch:this.config.fetch});return{images:b.data.map((L)=>L.b64_json),warnings:Q,response:{timestamp:_,modelId:this.modelId,headers:z}}}},c=j.object({data:j.array(j.object({b64_json:j.string()}))}),g=j.object({error:j.object({message:j.string()})}),m=$(()=>D(j.object({steps:j.number().nullish(),guidance:j.number().nullish(),negative_prompt:j.string().nullish(),disable_safety_checker:j.boolean().nullish()}).passthrough())),p="2.0.41";function l(){if(typeof process>"u")return;if(typeof process.env.TOGETHER_API_KEY==="string")return;let F=process.env.TOGETHER_AI_API_KEY;if(typeof F==="string")console.warn("TOGETHER_AI_API_KEY is deprecated and will be removed in a future release. Please use TOGETHER_API_KEY instead.");return F}function n(F={}){var G;let K=O((G=F.baseURL)!=null?G:"https://api.together.xyz/v1/"),V=()=>{var x;return k({Authorization:`Bearer ${y({apiKey:(x=F.apiKey)!=null?x:l(),environmentVariableName:"TOGETHER_API_KEY",description:"TogetherAI"})}`,...F.headers},`ai-sdk/togetherai/${p}`)},W=(x)=>({provider:`togetherai.${x}`,url:({path:Q})=>`${K}${Q}`,headers:V,fetch:F.fetch}),Y=(x)=>{return new u(x,W("chat"))},J=(x)=>new S(x,W("completion")),P=(x)=>new v(x,W("embedding")),Z=(x)=>new I(x,{...W("image"),baseURL:K!=null?K:"https://api.together.xyz/v1/"}),X=(x)=>new h(x,{...W("reranking"),baseURL:K!=null?K:"https://api.together.xyz/v1/"}),B=(x)=>Y(x);return B.specificationVersion="v3",B.completionModel=J,B.languageModel=Y,B.chatModel=Y,B.embeddingModel=P,B.textEmbeddingModel=P,B.image=Z,B.imageModel=Z,B.reranking=X,B.rerankingModel=X,B}var xj=n();export{xj as togetherai,n as createTogetherAI,p as VERSION};
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import"./chunk-3k2b05fv.js";function BX(G){if(G===void 0)return{BS_PRIVATE_NESTED_SOME_NONE:0};else if(G!==null&&G.BS_PRIVATE_NESTED_SOME_NONE!==void 0)return{BS_PRIVATE_NESTED_SOME_NONE:G.BS_PRIVATE_NESTED_SOME_NONE+1|0};else return G}function qG(G){if(G===null||G.BS_PRIVATE_NESTED_SOME_NONE===void 0)return G;let Q=G.BS_PRIVATE_NESTED_SOME_NONE;if(Q===0)return;else return{BS_PRIVATE_NESTED_SOME_NONE:Q-1|0}}function _Y(G){if(Array.isArray(G))return{TAG:"Array",_0:G};else return{TAG:"Single",_0:G}}var IY={classify:_Y},MQ={};function vY(G){let Q=MQ[G];if(Q!==void 0){let X=Q+1|0;return MQ[G]=X,G+("/"+X)}return MQ[G]=1,G}var DX={},gQ=[];function OY(G){return G.slice(0,1).toUpperCase()+G.slice(1)}var JQ=(G)=>({...G});function YG(G){let Q=0;while(!0){let X=Q,Y=G[X];if(Y===void 0)return'"'+G+'"';switch(Y){case'"':case`
2
+ import"./chunk-4sazy0nq.js";function BX(G){if(G===void 0)return{BS_PRIVATE_NESTED_SOME_NONE:0};else if(G!==null&&G.BS_PRIVATE_NESTED_SOME_NONE!==void 0)return{BS_PRIVATE_NESTED_SOME_NONE:G.BS_PRIVATE_NESTED_SOME_NONE+1|0};else return G}function qG(G){if(G===null||G.BS_PRIVATE_NESTED_SOME_NONE===void 0)return G;let Q=G.BS_PRIVATE_NESTED_SOME_NONE;if(Q===0)return;else return{BS_PRIVATE_NESTED_SOME_NONE:Q-1|0}}function _Y(G){if(Array.isArray(G))return{TAG:"Array",_0:G};else return{TAG:"Single",_0:G}}var IY={classify:_Y},MQ={};function vY(G){let Q=MQ[G];if(Q!==void 0){let X=Q+1|0;return MQ[G]=X,G+("/"+X)}return MQ[G]=1,G}var DX={},gQ=[];function OY(G){return G.slice(0,1).toUpperCase()+G.slice(1)}var JQ=(G)=>({...G});function YG(G){let Q=0;while(!0){let X=Q,Y=G[X];if(Y===void 0)return'"'+G+'"';switch(Y){case'"':case`
3
3
  `:return JSON.stringify(G);default:Q=X+1|0;continue}}}function WX(G){if(G==="")return[];else return JSON.parse(G.split('"]["').join('","'))}var fQ="sury",HQ=Symbol(fQ),qQ=Symbol(fQ+":item"),jY=vY("Sury.Error"),b="const";function xY(G){switch(G.type){case"undefined":return!0;case"union":return"undefined"in G.has;default:return!1}}function wX(G,Q){return(G&Q)!==0}var y={unknown:1,string:2,number:4,boolean:8,undefined:16,null:32,object:64,array:128,union:256,ref:512,bigint:1024,nan:2048,function:4096,instance:8192,never:16384,symbol:32768};function eG(G){let Q=y[typeof G];if(Q&16)return"undefined";if(!(Q&64))if(Q&2)return'"'+G+'"';else if(Q&1024)return G+"n";else return G.toString();if(G===null)return"null";if(Array.isArray(G)){let Z="[";for(let J=0,H=G.length;J<H;++J){if(J!==0)Z=Z+", ";Z=Z+eG(G[J])}return Z+"]"}if(G.constructor!==Object)return Object.prototype.toString.call(G);let X=Object.keys(G),Y="{ ";for(let Z=0,J=X.length;Z<J;++Z){let H=X[Z],q=G[H];Y=Y+H+": "+eG(q)+"; "}return Y+"}"}function j(G){let{type:Q,const:X,name:Y}=G;if(Y!==void 0)return Y;if(X!==void 0)return eG(X);let{format:Z,anyOf:J}=G;if(J!==void 0)return J.map(j).join(" | ");if(Z!==void 0)return Z;switch(Q){case"nan":return"NaN";case"object":let{additionalItems:H,properties:q}=G,U=Object.keys(q);if(U.length===0)if(typeof H==="object")return"{ [key: string]: "+j(H)+"; }";else return"{}";else return"{ "+U.map((z)=>z+": "+j(q[z])+";").join(" ")+" }";default:if(G.b)return Q;switch(Q){case"instance":return G.class.name;case"array":let{additionalItems:z,items:K}=G;if(typeof z!=="object")return"["+K.map((B)=>j(B.schema)).join(", ")+"]";let D=j(z);return(z.type==="union"?"("+D+")":D)+"[]";default:return Q}}}class BG extends Error{constructor(G,Q,X){super();this.flag=Q,this.code=G,this.path=X}}var TG=Object.defineProperty,dG=BG.prototype;TG(dG,"message",{get(){return LX(this)}});TG(dG,"reason",{get(){return UQ(this)}});TG(dG,"name",{value:"SuryError"});TG(dG,"s",{value:HQ});TG(dG,"_1",{get(){return this}});TG(dG,"RE_EXN_ID",{value:jY});var F=function(G){this.type=G},bQ=Object.create(null);TG(bQ,"with",{get(){return(G,...Q)=>G(this,...Q)}});F.prototype=bQ;function zQ(G){if(G&&G.s===HQ)return G;throw G}function UQ(G,Q){let X=Q!==void 0?Q:0,Y=G.code;if(typeof Y!=="object")return"Encountered unexpected async transform or refine. Use parseAsyncOrThrow operation instead";switch(Y.TAG){case"OperationFailed":return Y._0;case"InvalidOperation":return Y.description;case"InvalidType":let Z=Y.unionErrors,J="Expected "+j(Y.expected)+", received "+eG(Y.received);if(Z!==void 0){let H=`
4
4
  `+" ".repeat(X<<1),q={};for(let U=0,z=Z.length;U<z;++U){let K=Z[U],D=UQ(K,X+1),B=K.path,w="- "+(B===""?"":"At "+B+": ")+D;if(!q[w])q[w]=1,J=J+H+w}}return J;case"UnsupportedTransformation":return"Unsupported transformation from "+j(Y.from)+" to "+j(Y.to);case"ExcessField":return'Unrecognized key "'+Y._0+'"';case"InvalidJsonSchema":return j(Y._0)+" is not valid JSON"}}function LX(G){let Q=G.flag,X="Failed ";if(Q&2)X=X+"async ";if(X=X+(Q&1?Q&4?"asserting":"parsing":"converting"),Q&8)X=X+" to JSON"+(Q&16?" string":"");let Y=G.path,Z=Y===""?"":" at "+Y;return X+Z+": "+UQ(G,void 0)}var f={m:LX,d:void 0,a:"strip",n:!1},hG="as",VY={get:(G,Q)=>{let X=G[hG];if(X===void 0)return G[Q];if(Q===hG)return G[Q];let Y=qG(X),Z="Schema S."+Y+" is not enabled. To start using it, add S.enable"+OY(Y)+"() at the project root.";throw Error("[Sury] "+Z)}};function PX(G){let Q=new F("never");return Q[hG]=G,new Proxy(Q,VY)}var ZG=new F("unknown"),KQ=new F("boolean"),RX=new F("symbol"),c=new F("string"),yG=new F("number");yG.format="int32";var AG=new F("number"),EX=new F("bigint"),s=new F("undefined");s.const=void 0;var h=(G)=>{let Q=new F(G.type);for(let X in G)if(X>"a"||X==="$ref"||X==="$defs")Q[X]=G[X];return Q};function n(G,Q){let X=h(G),Y=X;while(Y.to){let Z=h(Y.to);Y.to=Z,Y=Z}return Q(Y),X}var yY=(G)=>{for(let Q in G)if(Number(Q[0]))delete G[Q]},SY=BG;function $Y(G,Q,X){return new BG(G,Q,X)}var NX={value:SY,constructor:$Y};function _(G,Q){let X=G.g.e,Y=X.length;return X[Y]=Q,"e["+Y+"]"}function BQ(G,Q){let X=y[Q.type],Y=Q.const;if(X&16)return"void 0";else if(X&2)return YG(Y);else if(X&1024)return Y+"n";else if(X&45056)return _(G,Q.const);else return Y}function UG(G,Q){let X='"'+Q+'"',Y=G.g[X];if(Y!==void 0)return Y;let Z=YG(Q);return G.g[X]=Z,Z}function gY(G){let Q=this;Q.l=Q.l+","+G}function JG(G){let Q=this;Q.l=G,Q.a=gY}function TX(G,Q){let X={c:"",l:"",a:JG,v:-1,o:G,f:"",e:[],d:Q};return X.g=X,X}function DG(G){delete G.a;let Q=G.l;if(Q==="")return G.f+G.c;else return G.f+"let "+Q+";"+G.c}function u(G){let Q=G.v+1;return G.v=Q,"v"+Q}function EG(G){return this.i}function i(G){let Q=this,X=u(G.g),Y=Q.i;if(Y==="")Q.b.a(X);else if(G.a!==void 0)G.a(X+"="+Y);else G.c=G.c+(X+"="+Y+";"),G.g.a(X);return Q.v=EG,Q.i=X,X}function GQ(G,Q){let X=u(G.g);return G.a(X),{b:G,v:EG,i:X,f:0,type:Q.type}}function $(G,Q,X){return{b:G,v:i,i:Q,f:0,type:X.type}}function RG(G,Q){return{b:G,v:i,i:BQ(G,Q),f:0,type:Q.type,const:Q.const}}function lG(G,Q){return{b:G,v:i,i:Q,f:2,type:"unknown"}}function fY(G,Q){return G+":"+Q+","}function bY(G,Q){return Q+","}function $G(G,Q){return{b:G,v:i,i:"",f:0,type:Q?"array":"object",properties:{},additionalItems:"strict",j:Q?bY:fY,c:0,r:""}}function _G(G,Q,X){let Y=UG(G.b,Q);if(G.properties[Q]=X,X.f&2)G.r=G.r+X.i+",",G.i=G.i+G.j(Y,"a["+G.c+++"]");else G.i=G.i+G.j(Y,X.i)}function dY(G,Q){let X=Object.keys(Q.properties);for(let Y=0,Z=X.length;Y<Z;++Y){let J=X[Y];_G(G,J,Q.properties[J])}}function gG(G,Q){if(G.i=Q?"["+G.i+"]":"{"+G.i+"}",G.c)G.f=G.f|2,G.i="Promise.all(["+G.r+"]).then(a=>("+G.i+"))";return G.additionalItems="strict",G}function dQ(G,Q,X,Y){return Q.v(G)+"["+X+"]="+Y.i}function JX(G,Q,X){if(Q===X)return"";let Y=Q.v(G),Z=Q.f&2,J=X.f&2;if(Z){if(!J)return Y+"=Promise.resolve("+X.i+")"}else if(J)return Q.f=Q.f|2,Y+"="+X.i;return Y+"="+X.i}function fG(G,Q,X){let Y=Q.properties,Z=Y[X];if(Z!==void 0)return Z;let J=Q.additionalItems,H;if(J==="strip"||J==="strict"){if(J==="strip")throw Error("[Sury] The schema doesn't have additional items");throw Error("[Sury] The schema doesn't have additional items")}else H=J;let q={b:G,v:i,i:Q.v(G)+("["+YG(X)+"]"),f:0,type:H.type};return Y[X]=q,q}function lY(G,Q,X){return Q.v(G)+"="+X}function kX(G,Q){return{b:Q.b,v:i,i:G+"("+Q.i+")",f:0,type:"unknown"}}function OG(G,Q,X){throw new BG(Q,G.g.o,X)}function CQ(G,Q,X){if(Q.f&2)return lG(Q.b,Q.i+".then("+_(G,X)+")");else return kX(_(G,X),Q)}function QG(G,Q,X,Y){return _(G,(Z)=>OG(G,X(Z),Q))+"("+Y+")"}function S(G,Q,X){return _(G,()=>OG(G,{TAG:"OperationFailed",_0:Q},X))+"()"}function FQ(G,Q,X){return{schema:Q,fail:(Y,Z)=>{return OG(G,{TAG:"OperationFailed",_0:Y},X+(Z!==void 0?Z:""))}}}function tG(G,Q,X){return OG(G,{TAG:"InvalidOperation",description:X},Q)}function sG(G,Q,X,Y,Z,J){if(X===""&&Y===void 0)return J(G,Q,X);try{let H=(E,N)=>{E.c=N+".path="+YG(X)+"+"+(Y!==void 0?`'["'+`+Y+`+'"]'+`:"")+N+".path"},q=(E)=>J(E,Q,""),U=G.c;G.c="";let z=u(G.g),K=H(G,z),D="if("+(z+"&&"+z+".s===s")+"){"+G.c;G.c="";let B={c:"",l:"",a:JG,f:"",g:G.g},W=q(B);G.c=G.c+DG(B);let w=W.i===Q.i&&G.c==="";if(Z!==void 0)Z(G,W);if(w)return W;let L=W.f&2,R=Q===W?Q:Z!==void 0?W:{b:G,v:i,i:"",f:L?2:0,type:"unknown"},P=K!==void 0?(E)=>D+(E===1?"return "+K.i:JX(G,R,K))+("}else{throw "+z+"}"):(E)=>D+"}throw "+z;return G.c=U+("try{"+G.c+(L?lY(G,R,W.i+".catch("+z+"=>{"+P(1)+"})"):JX(G,R,W))+"}catch("+z+"){"+P(0)+"}"),R}catch(H){let q=zQ(H);throw new BG(q.code,q.flag,X+"[]"+q.path)}}function SG(G,Q,X,Y){let Z=Y?"!==":"===",J=Y?"||":"&&",H=Y?"!":"",q=X.type,U=y[q];if(U&2048)return H+("Number.isNaN("+Q+")");if(b in X)return Q+Z+BQ(G,X);if(U&4)return"typeof "+Q+Z+'"'+q+'"';if(U&64)return"typeof "+Q+Z+'"'+q+'"'+J+H+Q;if(U&128)return H+"Array.isArray("+Q+")";if(!(U&8192))return"typeof "+Q+Z+'"'+q+'"';let z=Q+" instanceof "+_(G,X.class);if(Y)return"!("+z+")";else return z}function oG(G,Q,X,Y){let Z=Y?"!==":"===",J=Y?"||":"&&",H=Y?"":"!",q=Y?">":"<",U=Y?"<":">",z=X.type,K,D=0;if(X.const!==void 0)return"";let W=X.format;if(W!==void 0)switch(W){case"int32":return J+Q+q+"2147483647"+J+Q+U+"-2147483648"+J+Q+"%1"+Z+"0";case"port":case"json":D=2;break}else D=2;if(D===2)switch(z){case"number":if(f.n)return"";else return J+H+"Number.isNaN("+Q+")";case"array":case"object":K=z;break;default:return""}let{additionalItems:w,items:L}=X,R=L.length,P=K==="array"?w==="strip"||w==="strict"?w==="strip"?J+Q+".length"+U+R:J+Q+".length"+Z+R:"":w==="strip"?"":J+H+"Array.isArray("+Q+")";for(let E=0,N=L.length;E<N;++E){let M=L[E],C=M.location,T=M.schema,k;if(b in T||X.unnest){let A=UG(G,C);k=SG(G,Q+("["+A+"]"),T,Y)}else if(T.items){let A=UG(G,C),I=Q+("["+A+"]");k=SG(G,I,T,Y)+oG(G,I,T,Y)}else k="";if(k!=="")P=P+J+k}return P}function MX(G,Q,X){let Y={b:G,v:Q.v,i:Q.i,f:Q.f,type:X.type},Z=(J,H)=>{if(b in H)J.const=H.const;let q=H.items;if(q===void 0)return;let U={};q.forEach((z)=>{let K=z.schema,D=b in K;if(!(D||K.items))return;let B;if(D)B=BQ(G,K);else{let w=UG(G,z.location);B=J.v(G)+("["+w+"]")}let W={b:J.b,v:i,i:B,f:0,type:K.type};Z(W,K),U[z.location]=W}),J.properties=U,J.additionalItems=ZG};return Z(Y,X),Y}function _Q(G,Q,X,Y){if(Q.noValidation||y[Q.type]&17153)return"";let Z=X.v(G);return"if("+SG(G,Z,Q,!0)+oG(G,Z,Q,!0)+"){"+QG(G,Y,(J)=>({TAG:"InvalidType",expected:Q,received:J}),Z)+"}"}function DQ(G,Q,X,Y){return OG(G,{TAG:"UnsupportedTransformation",from:Q,to:X},Y)}function uY(G){return G}function CX(G,Q){G[Q==="union"||Q==="ref"?"unknown":Q]=!0}var LG="JSON",GG=PX("jsonString");function IQ(G,Q){return $(G,'""+'+Q.i,c)}function d(G,Q,X,Y){let Z={c:"",l:"",a:JG,f:"",g:G.g};if(Q.$defs)Z.g.d=Q.$defs;let J=X,H=b in J,q=b in Q,U=J.type===Q.type,z=y[Q.type],K=y[J.type],D=!1;if(!(z&257||Q.format==="json")){if(Q.name===LG&&!(K&1)){if(!(K&14))if(K&1024)J=IQ(Z,J);else D=!0}else if(q)if(H){if(J.const!==Q.const)J=RG(Z,Q)}else if(K&2&&z&3132){let w=J.v(Z);Z.f=Q.noValidation?"":J.i+'==="'+Q.const+'"||'+QG(Z,Y,(L)=>({TAG:"InvalidType",expected:Q,received:L}),w)+";",J=RG(Z,Q)}else if(Q.noValidation)J=RG(Z,Q);else Z.f=_Q(G,Q,J,Y),J.type=Q.type,J.const=Q.const;else if(H&&!q){if(!U)if(z&2&&K&3132){let w=""+J.const;J={b:Z,v:i,i:'"'+w+'"',f:0,type:"string",const:w}}else D=!0}else if(K&1){let w=Q.$ref;if(w!==void 0){let L=Z.g.d,R=w.slice(8),P=L[R],E=Q.noValidation?(Z.g.o|1)^1:Z.g.o,N=P[E],M;if(N!==void 0){let C=qG(N);M=C===0?_(Z,P)+("["+E+"]"):_(Z,C)}else{P[E]=0;let C=AX(P,E,Z.g.d);P[E]=C,M=_(Z,C)}J=sG(Z,J,Y,void 0,void 0,(C,T,k)=>{let A=kX(M,T);if(P.isAsync===void 0){let I=JQ(L);I[R]=ZG,pY(P,I)}if(P.isAsync)A.f=A.f|2;return A}),J.v(Z)}else{if(Z.g.o&1)Z.f=_Q(G,Q,J,Y);let L=MX(Z,J,Q);if(J.type=L.type,J.i=L.i,J.v=L.v,J.additionalItems=L.additionalItems,J.properties=L.properties,b in L)J.const=L.const}}else if(z&2&&K&1036)J=IQ(Z,J);else if(!U)if(K&2){let w=J.v(Z);if(z&8){let L=GQ(Z,Q);Z.c=Z.c+("("+L.i+"="+w+'==="true")||'+w+'==="false"||'+QG(Z,Y,(R)=>({TAG:"InvalidType",expected:Q,received:R}),w)+";"),J=L}else if(z&4){let L=$(Z,"+"+w,Q),R=L.v(Z),P=Q.format;Z.c=Z.c+(P!==void 0?"("+oG(Z,R,Q,!0).slice(2)+")":"Number.isNaN("+R+")")+("&&"+QG(Z,Y,(E)=>({TAG:"InvalidType",expected:Q,received:E}),w)+";"),J=L}else if(z&1024){let L=GQ(Z,Q);Z.c=Z.c+("try{"+L.i+"=BigInt("+w+")}catch(_){"+QG(Z,Y,(R)=>({TAG:"InvalidType",expected:Q,received:R}),w)+"}"),J=L}else D=!0}else if(K&4&&z&1024)J=$(Z,"BigInt("+J.i+")",Q);else D=!0}if(D)DQ(Z,J,Q,Y);let B=Q.compiler;if(B!==void 0)J=B(Z,J,Q,Y);if(J.t!==!0){let w=Q.refiner;if(w!==void 0)Z.c=Z.c+w(Z,J.v(Z),Q,Y)}let W=Q.to;if(W!==void 0){let w=Q.parser;if(w!==void 0)J=w(Z,J,Q,Y);if(J.t!==!0)J=d(Z,W,J,Y)}return G.c=G.c+DG(Z),J}function KG(G){while(!0){let Q=G,X=Q.to;if(X===void 0)return Q;G=X;continue}}function PG(G,Q,X,Y){let Z=y[G.type];if(Z&48129||Z&16&&Q.type!=="object")throw new BG({TAG:"InvalidJsonSchema",_0:Q},Y,X);if(Z&256){G.anyOf.forEach((q)=>PG(q,Q,X,Y));return}if(!(Z&192))return;let J=G.additionalItems;if(J==="strip"||J==="strict");else PG(J,Q,X,Y);let H=G.properties;if(H!==void 0){let q=Object.keys(H);for(let U=0,z=q.length;U<z;++U){let K=q[U];PG(H[K],Q,X,Y)}return}G.items.forEach((q)=>PG(q.schema,G,X+("["+YG(q.location)+"]"),Y))}function XG(G){let Q,X=G;while(X){let Y=h(X),Z=Y.to,J=Q;if(J!==void 0)Y.to=J;else delete Y.to;let{parser:H,serializer:q}=Y;if(q!==void 0)Y.parser=q;else delete Y.parser;if(H!==void 0)Y.serializer=H;else delete Y.serializer;let{fromDefault:U,default:z}=Y;if(z!==void 0)Y.fromDefault=z;else delete Y.fromDefault;if(U!==void 0)Y.default=U;else delete Y.default;let K=Y.items;if(K!==void 0){let W={},w=Array(K.length);for(let R=0,P=K.length;R<P;++R){let E=K[R],N=XG(E.schema),M=E.location,C={schema:N,location:M};if(E.r)C.r=E.r;W[E.location]=N,w[R]=C}if(Y.items=w,Y.properties!==void 0)Y.properties=W}if(typeof Y.additionalItems==="object")Y.additionalItems=XG(Y.additionalItems);let D=Y.anyOf;if(D!==void 0){let W={},w=[];for(let L=0,R=D.length;L<R;++L){let P=D[L],E=XG(P);w.push(E),CX(W,E.type)}Y.has=W,Y.anyOf=w}let B=Y.$defs;if(B!==void 0){let W={};for(let w=0,L=Object.keys(B).length;w<L;++w){let R=Object.keys(B)[w];W[R]=XG(B[R])}Y.$defs=W}Q=Y,X=Z}return Q}function AX(G,Q,X){let Y=TX(Q,X);if(Q&8){let B=XG(G);PG(B,B,"",Q)}let Z={b:Y,v:EG,i:"i",f:0,type:"unknown"},J=Q&4?n(G,(B)=>{let W=new F(s.type);W.const=s.const,W.noValidation=!0,B.to=W}):Q&16?n(G,(B)=>{B.to=GG}):G,H=d(Y,J,Z,""),q=DG(Y),U=wX(H.f,2);if(J.isAsync=U,q===""&&H===Z&&!(Q&2))return uY;let z=H.i;if(Q&2&&!U&&!X)z="Promise.resolve("+z+")";let K="i=>{"+q+"return "+z+"}",D=Y.g.e;return Function("e","s","return "+K)(D,HQ)}function pY(G,Q){try{let X=TX(2,Q),Z=d(X,G,{b:X,v:EG,i:"i",f:0,type:"unknown"},""),J=wX(Z.f,2);return G.isAsync=J,J}catch(X){return zQ(X),!1}}function o(G,Q){if(Q in G)return G[Q];let X=AX(Q&32?XG(G):G,Q,0);return G[Q]=X,X}TG(bQ,"~standard",{get:function(){let G=this;return{version:1,vendor:fQ,validate:(Q)=>{try{return{value:o(G,1)(Q)}}catch(X){let Y=zQ(X);return{issues:[{message:UQ(Y,void 0),path:Y.path===""?void 0:WX(Y.path)}]}}}}}});function FX(G,Q,X,Y,Z){let J=Z!==void 0?Z:!0,H=0,q=0;switch(X){case"Output":case"Input":q=1;break;case"Assert":H=H|4;break;case"Json":H=H|8;break;case"JsonString":H=H|24;break}if(q===1&&X===Q)throw Error("[Sury] Can't compile operation to converting value to self");if(Y!=="Sync")H=H|2;if(J)H=H|1;if(Q==="Output")H=H|32;let U=o(G,H);if(Q!=="JsonString")return U;let z=H;return(K)=>{try{return U(JSON.parse(K))}catch(D){throw new BG({TAG:"OperationFailed",_0:D.message},z,"")}}}function WQ(G,Q){return o(Q,1)(G)}function _X(G,Q){let X;try{X=JSON.parse(G)}catch(Y){throw new BG({TAG:"OperationFailed",_0:Y.message},1,"")}return WQ(X,Q)}function IX(G,Q){return o(Q,3)(G)}function vX(G,Q){return o(Q,0)(G)}function OX(G,Q){return o(Q,8)(G)}function jX(G,Q){return o(Q,24)(G)}function xX(G,Q){return o(Q,32)(G)}function lQ(G,Q){return o(Q,40)(G)}function VX(G,Q,X){let Y=X!==void 0?X:0;return JSON.stringify(lQ(G,Q),null,Y)}function wG(G,Q){return o(Q,5)(G)}var wQ=new F("null");wQ.const=null;function IG(G){if(G===null)return wQ;let Q=typeof G,X;if(Q==="object"){let Y=new F("instance");Y.class=G.constructor,X=Y}else X=Q==="undefined"?s:Q==="number"?Number.isNaN(G)?new F("nan"):new F(Q):new F(Q);return X.const=G,X}function vQ(G){if(G&&G.s===HQ)return{success:!1,error:G};throw G}function yX(G){try{return{success:!0,value:G()}}catch(Q){return vQ(Q)}}function SX(G){try{return G().then((Q)=>({success:!0,value:Q}),vQ)}catch(Q){return Promise.resolve(vQ(Q))}}function uQ(G,Q,X){let Y=h(G);return Y[Q]=X,Y}var pQ="#/$defs/";function $X(G,Q){let X=pQ+G,Y=new F("ref");Y.$ref=X,Y.name=G;let Z=f.d;if(!Z)f.d={};let J=Q(Y);if(J.name)Y.name=J.name;else J.name=G;if(f.d[G]=J,Z)return Y;let H=new F("ref");return H.name=J.name,H.$ref=X,H.$defs=f.d,f.d=void 0,H}function gX(G,Q){let X=h(G);return X.noValidation=Q,X}function fX(G,Q){if(G!==void 0)return(X,Y,Z,J)=>G(X,Y,Z,J)+Q(X,Y,Z,J);else return Q}function rQ(G,Q){return n(G,(X)=>{X.refiner=fX(X.refiner,Q)})}function rG(G,Q){return rQ(G,(X,Y,Z,J)=>_(X,Q(FQ(X,Z,J)))+"("+Y+");")}function g(G,Q,X,Y){let Z=G[Q];return rQ(uQ(G,Q,Z!==void 0?Z.concat(X):[X]),Y)}function LQ(G,Q){return n(G,(X)=>{X.parser=(Z,J,H,q)=>{let U=Q(FQ(Z,H,q)),z=U.p;if(z!==void 0)if(U.a!==void 0)return tG(Z,q,"The S.transform doesn't allow parser and asyncParser at the same time. Remove parser in favor of asyncParser");else return CQ(Z,J,z);let K=U.a;if(K!==void 0){if(!(Z.g.o&2))OG(Z,"UnexpectedAsync","");let D=CQ(Z,J,K);return D.f=D.f|2,D}else if(U.s!==void 0)return tG(Z,q,"The S.transform parser is missing");else return J};let Y=new F("unknown");X.to=(Y.serializer=(Z,J,H,q)=>{let U=Q(FQ(Z,H,q)),z=U.s;if(z!==void 0)return CQ(Z,J,z);else if(U.a!==void 0||U.p!==void 0)return tG(Z,q,"The S.transform serializer is missing");else return J},Y),delete X.isAsync})}var PQ=new F("null");PQ.const=null;PQ.to=s;function OQ(G,Q,X,Y){return G.c=G.c+QG(G,Y,(Z)=>({TAG:"InvalidType",expected:X,received:Z}),Q.i)+";",Q}var RQ=new F("never");RQ.compiler=OQ;var FG="BS_PRIVATE_NESTED_SOME_NONE";function AQ(G,Q,X,Y,Z,J){try{let H=G.g.o;if(Z)G.g.o=H|1;let q={c:"",l:"",a:JG,f:"",g:G.g},U=Z?JQ(X):MX(q,X,Q),z=d(q,Q,U,J);if(z!==U){if(z.b=q,z.f&2)Y.f=Y.f|2;q.c=q.c+(Y.v(G)+"="+z.i)}return G.g.o=H,DG(q)}catch(H){return"throw "+_(G,zQ(H))}}function HX(G,Q){if(G&8320&&"object"in Q)return!0;else if(G&2048)return"number"in Q;else return!1}function rY(G,Q){return Q.every((X,Y)=>{let Z=G[Y];if(Z!==void 0&&!(y[X.type]&9152)&&X.type===Z.type)return X.const===Z.const;else return!1})}function bX(G,Q,X,Y){let Z=X.anyOf,J=Q.anyOf;if(J!==void 0)if(rY(Z,J))return Q;else return DQ(G,Q,X,Y);let H=(T)=>_(G,function(){let k=arguments;return OG(G,{TAG:"InvalidType",expected:X,received:k[0],unionErrors:k.length>1?Array.from(k).slice(1):void 0},Y)})+"("+Q.v(G)+T+")",q=G.g.o&1,U=Q.i,z=-1,K=Z.length-1|0,D={},B=[];for(let T=0;T<=K;++T){let k=X.to,A=k!==void 0&&!X.parser&&k.type!=="union"?n(Z[T],(p)=>{let V=X.refiner;if(V!==void 0)p.refiner=fX(p.refiner,V);p.to=k}):Z[T],I=A.type,x=y[I];if(!(x&16&&("fromDefault"in X)))if(x&17153||!(y[Q.type]&1)&&Q.type!==I)z=T,D={},B=[];else{let p=x&8192?A.class.name:I,V=D[p];if(V!==void 0){if(x&64&&FG in A.properties)V.unshift(A);else if(!(x&2096))V.push(A)}else{if(HX(x,D))B.unshift(p);else B.push(p);D[p]=[A]}}}let W=z,w=D,L=B,R="",P="",E="",N=!1;if(W!==-1){for(let T=0;T<=W;++T)if(!N){let k=Z[T],A=AQ(G,k,Q,Q,!0,Y);if(A){let I="e"+T;R=R+("try{"+A+"}catch("+I+"){"),P="}"+P,E=E+","+I}else N=!0}}if(!N){let T=!1,k="";for(let A=0,I=L.length;A<I;++A){let x=w[L[A]],p=x.length>1,V=x[0],WG=0,kG;if(p){let l=Q.v(G),O="",uG="",HG=!1,a={contents:""},mG="",jG={},MG=0,TQ=x.length-1|0;while(MG<=TQ){let r=x[MG],t=(b in r?SG(G,l,r,!1):"")+oG(G,l,r,!1).slice(2),xG=AQ(G,r,Q,Q,!1,Y);if(t)if(xG){let e=jG[t];if(e!==void 0)if(typeof e==="string")jG[t]=[e,xG];else e.push(xG);else jG[t]=xG}else a.contents=a.contents?a.contents+"||"+t:t;if(!t||MG===TQ){let e=Object.keys(jG);for(let iG=0,CY=e.length;iG<CY;++iG){let YX=e[iG];O=O+(HG?"else if":"if")+("("+YX+"){");let pG=jG[YX];if(typeof pG==="string")O=O+pG+"}";else{let kQ="";for(let aG=0,AY=pG.length;aG<AY;++aG){let FY=pG[aG],ZX="e"+aG;O=O+("try{"+FY+"}catch("+ZX+"){"),kQ=kQ+","+ZX}O=O+H(kQ)+"}".repeat(pG.length)+"}"}HG=!0}jG={}}if(!t)if(xG){if(a.contents)O=O+(HG?"else if":"if")+("(!("+a.contents+")){"),uG="}"+uG,a.contents="",HG=!1;let e="e"+MG;O=O+((HG?"else{":"")+"try{"+xG+"}catch("+e+"){"),uG=(HG?"}":"")+"}"+uG,mG=mG+","+e,HG=!1}else a.contents="",MG=TQ;MG=MG+1}if(WG=(r)=>SG(G,r,{type:V.type,parser:0},!1),a.contents)if(O){if(q)O=O+(HG?"else if":"if")+("(!("+a.contents+")){"+H(mG)+"}")}else{let r=WG;WG=(t)=>r(t)+("&&("+a.contents+")")}else if(q&&O){let r=H(mG);O=O+(HG?"else{"+r+"}":r)}kG=O+uG}else WG=(l)=>SG(G,l,V,!1)+oG(G,l,V,!1),kG=AQ(G,V,Q,Q,!1,Y);if(kG||HX(y[V.type],w))R=R+(T?"else if":"if")+("("+WG(Q.v(G))+"){"+kG+"}"),T=!0;else if(q){let l=WG(Q.v(G));k=k?k+"||"+l:l}}if(q||W===K){let A=H(E),I;if(k)I=(T?"else if":"if")+("(!("+k+")){"+A+"}");else I=T?"else{"+A+"}":A;R=R+I}}G.c=G.c+R+P;let M=Q.f&2?lG(G,"Promise.resolve("+Q.i+")"):Q.v===EG?G.c===""&&Q.b.c===""&&(Q.b.l===Q.i+"="+U||U==="i")?(Q.b.l="",Q.b.a=JG,Q.v=i,Q.i=U,Q):JQ(Q):Q;M.anyOf=X.anyOf;let C=X.to;return M.type=C!==void 0&&C.type!=="union"?(M.t=!0,KG(C).type):"union",M}function zG(G){let Q=G.length;if(Q===1)return G[0];if(Q!==0){let X={},Y=new Set;for(let J=0,H=G.length;J<H;++J){let q=G[J];if(q.type==="union"&&q.to===void 0)q.anyOf.forEach((U)=>{Y.add(U)}),Object.assign(X,q.has);else Y.add(q),CX(X,q.type)}let Z=new F("union");return Z.anyOf=Array.from(Y),Z.compiler=bX,Z.has=X,Z}throw Error("[Sury] S.union requires at least one item")}function hY(){let G=IG(0),Q={schema:G,location:FG},X={};return X[FG]=G,{type:"object",serializer:(Y,Z,J,H)=>RG(Y,J.to),additionalItems:"strip",items:[Q],properties:X}}function oY(G,Q,X,Y){return $(G,"{"+FG+":"+KG(X).items[0].schema.const+"}",X.to)}function qX(G){return n(G,(Q)=>{Q.to=hY(),Q.parser=oY})}function EQ(G,Q){let X=Q!==void 0?Q:s,Y=KG(G);switch(Y.type){case"undefined":return zG([X,qX(G)]);case"union":let{has:J,anyOf:H}=Y;return n(G,(q)=>{let U=JQ(J),z=[];for(let K=0,D=H.length;K<D;++K){let B=H[K],W=KG(B),w=W.type,L;if(w==="undefined")U[X.type]=!0,z.push(X),L=qX(B);else{let R=W.properties;if(R!==void 0){let P=R[FG];L=P!==void 0?n(B,(E)=>{let N={type:P.type,parser:P.parser,const:P.const+1},M={schema:N,location:FG},C={};C[FG]=N,E.items=[M],E.properties=C}):B}else L=B}z.push(L)}if(z.length===H.length)U[X.type]=!0,z.push(X);q.anyOf=z,q.has=U});default:return zG([G,X])}}function vG(G,Q){return n(G,(X)=>{let Y=X.anyOf;if(Y!==void 0){let Z,J;for(let K=0,D=Y.length;K<D;++K){let B=Y[K],W=KG(B);if(W.type!=="undefined"){if(Z!==void 0){let R="Can't set default for "+j(X);throw Error("[Sury] "+R)}Z=B,J=W}}let H=Z,q;if(H!==void 0)q=H;else{let K="Can't set default for "+j(X);throw Error("[Sury] "+K)}X.parser=(K,D,B,W)=>{let w=(N,M)=>{let C=M.v(N),T;return T=Q.TAG==="Value"?BQ(N,IG(Q._0)):_(N,Q._0)+"()",$(N,C+"===void 0?"+T+":"+C,B.to)};if(!(D.f&2))return w(K,D);let L={c:"",l:"",a:JG,f:"",g:K.g},R={b:K,v:EG,i:u(L.g),f:0,type:"unknown"},P=w(L,R),E=DG(L);return lG(D.b,D.i+".then("+R.v(K)+"=>{"+E+"return "+P.i+"})")};let U=h(J),z=U.compiler;if(z!==void 0)U.serializer=z,delete U.compiler;else U.serializer=(K,D,B,W)=>D;if(X.to=U,Q.TAG!=="Value")return;try{X.default=o(q,32)(Q._0);return}catch(K){return}}else{let Z="Can't set default for "+j(X);throw Error("[Sury] "+Z)}})}var NQ="m:Array.refinements";function cY(G){let Q=G[NQ];if(Q!==void 0)return Q;else return[]}function sY(G,Q,X,Y){let Z=X.additionalItems,J=Q.v(G),H=u(G.g),q={c:"",l:"",a:JG,f:"",g:G.g},U=$(q,J+"["+H+"]",ZG),z=sG(q,U,Y,H,void 0,(W,w,L)=>d(W,Z,w,L)),K=DG(q),D=U!==z,B=D?$(G,"new Array("+J+".length)",X):Q;if(B.type=X.type,B.additionalItems=X.additionalItems,D||K!=="")G.c=G.c+("for(let "+H+"=0;"+H+"<"+J+".length;++"+H+"){"+K+(D?dQ(G,B,H,z):"")+"}");if(z.f&2)return lG(B.b,"Promise.all("+B.i+")");else return B}function cG(G){let Q=new F("array");return Q.additionalItems=G,Q.items=gQ,Q.compiler=sY,Q}function nG(G,Q,X){let Y=G.additionalItems;if(Y===void 0)return G;let Z=G.items;if(Y===Q||typeof Y==="object")return G;let J=h(G);if(J.additionalItems=Q,X){let H=[],q={};for(let U=0,z=Z.length;U<z;++U){let K=Z[U],D=nG(K.schema,Q,X),B=D===K.schema?K:{schema:D,location:K.location};q[K.location]=D,H.push(B)}J.items=H,J.properties=q}return J}function dX(G){return nG(G,"strip",!1)}function lX(G){return nG(G,"strip",!0)}function QQ(G){return nG(G,"strict",!1)}function uX(G){return nG(G,"strict",!0)}function nY(G,Q,X,Y){let Z=X.additionalItems,J=Q.v(G),H=u(G.g),q={c:"",l:"",a:JG,f:"",g:G.g},U=$(q,J+"["+H+"]",ZG),z=sG(q,U,Y,H,void 0,(E,N,M)=>d(E,Z,N,M)),K=DG(q),D=U!==z,B=D?$(G,"{}",X):Q;if(B.type=X.type,B.additionalItems=X.additionalItems,D||K!=="")G.c=G.c+("for(let "+H+" in "+J+"){"+K+(D?dQ(G,B,H,z):"")+"}");if(!(z.f&2))return B;let W=u(G.g),w=u(G.g),L=u(G.g),R=u(G.g),P=B.v(G);return lG(G,"new Promise(("+W+","+w+")=>{let "+R+"=Object.keys("+P+").length;for(let "+H+" in "+P+"){"+P+"["+H+"].then("+L+"=>{"+P+"["+H+"]="+L+";if("+R+"--===1){"+W+"("+P+")}},"+w+")}})")}function XQ(G){let Q=new F("object");return Q.properties=DX,Q.items=gQ,Q.additionalItems=G,Q.compiler=nY,Q}var m="m:String.refinements";function mY(G){let Q=G[m];if(Q!==void 0)return Q;else return[]}var iY=/^c[^\s-]{8,}$/i,aY=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,tY=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,eY=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?Z$/,v=PX("json");function pX(){if(!v[hG])return;delete v.as;let G=new F("ref");G.$ref=pQ+LG,G.name=LG,v.type=G.type,v.$ref=G.$ref,v.name=LG;let Q={};Q[LG]={type:"union",compiler:bX,name:LG,has:{string:!0,boolean:!0,number:!0,null:!0,object:!0,array:!0},anyOf:[c,KQ,AG,wQ,XQ(G),cG(G)]},v.$defs=Q}function zX(G,Q,X,Y){let Z=y[Q.type],J=Q.const;if(Z&48)return'"null"';else if(Z&2)return JSON.stringify(YG(J));else if(Z&1024)return'"\\"'+J+'\\""';else if(Z&12)return'"'+J+'"';else return DQ(G,Q,X,Y)}function rX(){if(GG[hG]){delete GG.as,GG.type="string",GG.format="json",GG.name=LG+" string",GG.compiler=(G,Q,X,Y)=>{let Z=y[Q.type],J=Q;if(Z&1){let H=X.to;if(H&&b in H){let q=J.v(G);G.f=q+"==="+zX(G,H,X,Y)+"||"+QG(G,Y,(U)=>({TAG:"InvalidType",expected:H,received:U}),q)+";",J=RG(G,H)}else if(!(H&&H.format==="json")){let q=J.v(G),U=G.g.o&1;if(U)G.f=_Q(G,c,J,Y);if(H||U){let z;if(H){PG(H,H,Y,G.g.o);let K=GQ(G,ZG);J=K,z=K.i+"="}else z="";G.c=G.c+("try{"+z+"JSON.parse("+q+")}catch(t){"+QG(G,Y,(K)=>({TAG:"InvalidType",expected:X,received:K}),q)+"}")}}}else{if(b in J)J=$(G,zX(G,J,X,Y),c);else if(Z&2){if(J.format!=="json")J=$(G,"JSON.stringify("+J.i+")",c)}else if(Z&12)J=IQ(G,J);else if(Z&1024)J=$(G,'"\\""+'+J.i+'+"\\""',c);else if(Z&192){PG(J,J,Y,G.g.o);let H=X.space;J=$(G,"JSON.stringify("+J.i+(H!==void 0&&H!==0?",null,"+H:"")+")",c)}else DQ(G,J,X,Y);J.format="json"}return J};return}}function hX(G){let Q=h(GG);return Q.space=G,Q}var hQ="m:Int.refinements";function GZ(G){let Q=G[hQ];if(Q!==void 0)return Q;else return[]}var oQ="m:Float.refinements";function QZ(G){let Q=G[oQ];if(Q!==void 0)return Q;else return[]}function oX(G,Q){if(G===Q)return G;else return n(G,(X)=>{X.to=Q})}function cX(G){let Q=new F("instance");return Q.class=G,Q}function cQ(G,Q){let X=h(G),Y=Q.name;if(Y!==void 0)if(Y==="")X.name=void 0;else X.name=Y;let Z=Q.title;if(Z!==void 0)if(Z==="")X.title=void 0;else X.title=Z;let J=Q.description;if(J!==void 0)if(J==="")X.description=void 0;else X.description=J;let H=Q.deprecated;if(H!==void 0)X.deprecated=H;let q=Q.examples;if(q!==void 0)if(q.length!==0)X.examples=q.map(o(G,32));else X.examples=void 0;return X}function sX(G,Q){let X=h(G);return X.name=Q,X}function nX(G){switch(G.k){case 0:return"["+YG(G.location)+"]";case 1:return nX(G.of)+G.p;case 2:return G.p}}function sQ(G,Q,X,Y){if(b in Y)return RG(G,Y);let Z=Q[qQ];if(Z!==void 0)return X(Z);let J=y[Y.type]&128,H=$G(G,J);return Y.items.forEach((q)=>_G(H,q.location,sQ(G,Q[q.location],X,q.schema))),gG(H,J)}function nQ(G,Q,X,Y,Z){if(!(Y.type==="object"&&Y.additionalItems==="strict"&&G.g.o&1))return;let H=GQ(G,ZG).i;if(G.c=G.c+("for("+H+" in "+Q.v(G)+"){if("),X.length!==0)for(let q=0,U=X.length;q<U;++q){let z=X[q];if(q!==0)G.c=G.c+"&&";G.c=G.c+(H+"!=="+UG(G,z.location))}else G.c=G.c+"true";G.c=G.c+("){"+QG(G,Z,(q)=>({TAG:"ExcessField",_0:q}),H)+"}}")}function bG(G){return new Proxy(DX,{get:(Q,X)=>{if(X===qQ)return G;let Y=YG(X),Z=KG(G.schema),J=Z.items,H=Z.properties,q;if(H!==void 0)q=H[X];else if(J!==void 0){let U=J[X];q=U!==void 0?U.schema:void 0}else q=void 0;if(q===void 0){let U="Cannot read property "+Y+" of "+j(Z);throw Error("[Sury] "+U)}return bG({k:1,location:X,schema:q,of:G,p:"["+Y+"]"})}})}function YQ(G,Q,X,Y){let{additionalItems:Z,items:J}=X,H=y[X.type]&128;if(G.g.o&64){let U=$G(G,H);for(let z=0,K=J.length;z<K;++z){let B=J[z].location;_G(U,B,Q.properties[B])}return gG(U,H)}let q=$G(G,H);for(let U=0,z=J.length;U<z;++U){let K=J[U],D=K.location,B=fG(G,Q,D),W=UG(G,D),w=Y+("["+W+"]");_G(q,D,d(G,K.schema,B,w))}if(nQ(G,Q,J,X,Y),(Z!=="strip"||G.g.o&32)&&J.every((U)=>q.properties[U.location]===Q.properties[U.location]))return Q.additionalItems="strip",Q;else return gG(q,H)}function mX(G){let Q=this,X="~"+G,Y=Q[X];if(Y!==void 0)return qG(Y);let Z={},J=[],H=new F("object");H.items=J,H.properties=Z,H.additionalItems=f.a,H.compiler=YQ;let q=Q.f(G,H)[qQ],U=(W,w)=>{let L=YG(W);if(W in Z)throw Error("[Sury] "+("The field "+L+" defined twice"));let R="["+L+"]",P={k:1,location:W,schema:w,of:q,p:R};return Z[W]=w,J.push(P),bG(P)},B={field:U,f:U,fieldOr:(W,w,L)=>{let R=EQ(w,void 0);return U(W,vG(R,{TAG:"Value",_0:L}))},tag:(W,w)=>{U(W,NG(w))},nested:mX,flatten:(W)=>{if(W.type==="object"){let{to:R,items:P}=W;if(R){let N="Unsupported nested flatten for transformed object schema "+j(W);throw Error("[Sury] "+N)}let E={};for(let N=0,M=P.length;N<M;++N){let C=P[N];E[C.location]=U(C.location,C.schema)}return E}let L="Can't flatten "+j(W)+" schema";throw Error("[Sury] "+L)}};return Q[X]=B,B}function NG(G){if(typeof G!=="object"||G===null)return IG(G);if(G["~standard"])return G;if(Array.isArray(G)){for(let q=0,U=G.length;q<U;++q){let z=NG(G[q]),K=q.toString();G[q]={schema:z,location:K}}let H=new F("array");return H.items=G,H.additionalItems="strict",H.compiler=YQ,H}let Q=G.constructor;if(Q&&Q!==Object)return{type:"instance",const:G,class:Q};let X=Object.keys(G),Y=X.length,Z=[];for(let H=0;H<Y;++H){let q=X[H],U=NG(G[q]),z={schema:U,location:q};G[q]=U,Z[H]=z}let J=new F("object");return J.items=Z,J.properties=G,J.additionalItems=f.a,J.compiler=YQ,J}function jQ(G,Q,X){if(typeof G!=="object"||G===null)return{k:1,p:Q,s:h(IG(G))};let Y=G[qQ];if(Y!==void 0){let U=h(KG(Y.schema));delete U.serializer;let z={k:0,p:Q,s:U};return Y.r=z,X[nX(Y)]=z,z}if(Array.isArray(G)){let U=[];for(let K=0,D=G.length;K<D;++K){let B=K.toString(),W='"'+B+'"',R={schema:jQ(G[K],Q+("["+W+"]"),X).s,location:B};U[K]=R}let z=new F("array");return{k:2,p:Q,s:(z.items=U,z.additionalItems="strict",z.serializer=OQ,z)}}let Z=Object.keys(G),J={},H=[];for(let U=0,z=Z.length;U<z;++U){let K=Z[U],D=YG(K),W=jQ(G[K],Q+("["+D+"]"),X).s,w={schema:W,location:K};H[U]=w,J[K]=W}let q=new F("object");return{k:2,p:Q,s:(q.items=H,q.properties=J,q.additionalItems=f.a,q.serializer=OQ,q)}}function mQ(G,Q,X){let Y={},J=jQ(G,"",Y).s;return delete J.refiner,delete J.compiler,J.serializer=(H,q,U,z)=>{let K=(P)=>{let E=P.p;if(E==="")return q;let N=q,M=WX(E);while(!0){let C=M,T=N;if(C.length===0)return T;let k=C[0];M=C.slice(1),N=fG(H,T,k);continue}},D=(P,E)=>{let N=KG(P);if(b in N)return RG(H,N);if(b in P)return d(H,P,RG(H,P),z);let{type:M,additionalItems:C,items:T}=N;if(T!==void 0&&typeof C==="string"){let A=y[M]&128,I=$G(H,A);for(let x=0,p=T.length;x<p;++x){let V=T[x],WG=UG(H,V.location),kG=E+("["+WG+"]"),l=Y[kG],O=l!==void 0?d(H,V.schema,K(l),l.p):D(V.schema,kG);_G(I,V.location,O)}return gG(I,A)}let k=E===""?"Schema isn't registered":"Schema for "+E+" isn't registered";return tG(H,z,k)},B=(P,E,N)=>{let M=P.r;if(M===void 0)return D(P.schema,E);let C=N?XG(P.schema):E===""?KG(P.schema):P.schema,T=K(M),k=z+M.p;return d(H,C,T,k)};if(Q!==void 0)return B(Q,"",!1);let W=U.to;nQ(H,q,U.items,U,z);let w=W.type==="array",L=W.items,R=$G(H,w);if(X!==void 0)for(let P=0,E=X.length;P<E;++P)dY(R,B(X[P],"",!0));for(let P=0,E=L.length;P<E;++P){let N=L[P];if(!(N.location in R.properties)){let M=UG(H,N.location);_G(R,N.location,B(N,"["+M+"]",!1))}}return gG(R,w)},J}function iX(G,Q){return(X,Y,Z,J)=>{let H=X.g.o&64,q=H?Y.properties:{};if(!H){let z=Z.items;for(let K=0,D=z.length;K<D;++K){let B=z[K],W=B.location,w=fG(X,Y,W),L=UG(X,W),R=J+("["+L+"]");q[W]=d(X,B.schema,w,R)}nQ(X,Y,z,Z,J)}if(Q!==void 0){let z=X.g.o;X.g.o=z|64;for(let K=0,D=Q.length;K<D;++K){let B=Q[K];q[B.i]=d(X,B.schema,Y,J)}X.g.o=z}let U=(z)=>{switch(z.k){case 0:return q[z.location];case 1:return fG(X,U(z.of),z.location);case 2:return q[z.i]}};return sQ(X,G,U,Z.to)}}function aX(G,Q){return n(G,(X)=>{let Y={k:2,schema:G,p:"",i:0},Z=Q(bG(Y));X.parser=(J,H,q,U)=>{let z=(K)=>{switch(K.k){case 1:return fG(J,z(K.of),K.location);case 0:case 2:return H}};return sQ(J,Z,z,q.to)},X.to=mQ(Z,Y,void 0)})}function ZQ(G){let Q=void 0,X=[],Y={},Z=(D)=>{if(D.type==="object"){let w=D.items;for(let E=0,N=w.length;E<N;++E){let M=w[E],C=M.location,T=M.schema,k=Y[C];if(k!==void 0){if(k!==T)throw Error("[Sury] "+('The field "'+C+'" defined twice with incompatible schemas'))}else{let A={k:0,schema:T,location:C};X.push(A),Y[C]=T}}let L=Q||(Q=[]),R=L.length,P={k:2,schema:D,p:"",i:R};return L.push(P),bG(P)}let W="The '"+j(D)+"' schema can't be flattened";throw Error("[Sury] "+W)},J=(D,B)=>{if(D in Y)throw Error("[Sury] "+('The field "'+D+'" defined twice with incompatible schemas'));let W={k:0,schema:B,location:D};return Y[D]=B,X.push(W),bG(W)},z=G({field:J,f:J,fieldOr:(D,B,W)=>{let w=EQ(B,void 0);return J(D,vG(w,{TAG:"Value",_0:W}))},tag:(D,B)=>{J(D,NG(B))},nested:mX,flatten:Z}),K=new F("object");return K.items=X,K.properties=Y,K.additionalItems=f.a,K.parser=iX(z,Q),K.to=mQ(z,void 0,Q),K}function iQ(G){let Q=[],X=(q,U)=>{let z=q.toString();if(Q[q])throw Error("[Sury] "+("The item ["+z+"] is defined multiple times"));let K={k:0,schema:U,location:z};return Q[q]=K,bG(K)},J=G({item:X,tag:(q,U)=>{X(q,NG(U))}});for(let q=0,U=Q.length;q<U;++q)if(!Q[q]){let z=q.toString(),K={schema:s,location:z};Q[q]=K}let H=new F("array");return H.items=Q,H.additionalItems="strict",H.parser=iX(J,void 0),H.to=mQ(J,void 0,void 0),H}function XZ(G){return EQ(G,PQ)}var aQ=NG;function YZ(G,Q,X,Y){let Z=X.additionalItems,J=Z.items,H=Q.v(G),q=u(G.g),U=u(G.g),z={c:"",l:"",a:JG,f:"",g:G.g},K={b:z,v:EG,i:H+"["+q+"]",f:0,type:"unknown"},D=sG(z,K,Y,q,(W,w)=>{let L="",R="";for(let P=0,E=J.length;P<E;++P){let N=J[P];L=L+("new Array("+H+".length),"),R=R+(U+"["+P+"]["+q+"]="+fG(G,w,N.location).i+";")}G.a(U+"=["+L+"]"),W.c=W.c+R},(W,w,L)=>d(W,Z,w,L)),B=DG(z);if(G.c=G.c+("for(let "+q+"=0;"+q+"<"+H+".length;++"+q+"){"+B+"}"),D.f&2)return{b:G,v:i,i:"Promise.all("+U+")",f:2,type:"array"};else return{b:G,v:EG,i:U,f:0,type:"array"}}function tX(G){if(G.type==="object"){let Q=G.items;if(Q.length===0)throw Error("[Sury] Invalid empty object for S.unnest schema.");let X=new F("array");X.items=Q.map((Z,J)=>{let H=J.toString();return{schema:cG(Z.schema),location:H}}),X.additionalItems="strict",X.parser=(Z,J,H,q)=>{let U=J.v(Z),z=u(Z.g),K={c:"",l:"",a:JG,f:"",g:Z.g},D=$G(K,!1),B="";for(let P=0,E=Q.length;P<E;++P){let N=Q[P];_G(D,N.location,$(K,U+"["+P+"]["+z+"]",ZG)),B=B+(U+"["+P+"].length,")}let W=$(Z,"new Array(Math.max("+B+"))",H.to),w=W.v(Z),L=sG(K,gG(D,!1),q,z,(P,E)=>{P.c=P.c+dQ(P,W,z,E)+";"},(P,E,N)=>d(P,G,E,N)),R=DG(K);if(Z.c=Z.c+("for(let "+z+"=0;"+z+"<"+w+".length;++"+z+"){"+R+"}"),L.f&2)return lG(W.b,"Promise.all("+W.i+")");else return W};let Y=new F("array");return Y.items=gQ,Y.additionalItems=G,Y.serializer=YZ,X.unnest=!0,X.to=Y,X}throw Error("[Sury] S.unnest supports only object schemas.")}function UX(G){return EQ(G,s)}function xQ(G,Q,X){let Y=X!==void 0?X:"Number must be greater than or equal to "+Q;return g(G,hQ,{kind:{TAG:"Min",value:Q},message:Y},(Z,J,H,q)=>"if("+J+"<"+_(Z,Q)+"){"+S(Z,Y,q)+"}")}function VQ(G,Q,X){let Y=X!==void 0?X:"Number must be lower than or equal to "+Q;return g(G,hQ,{kind:{TAG:"Max",value:Q},message:Y},(Z,J,H,q)=>"if("+J+">"+_(Z,Q)+"){"+S(Z,Y,q)+"}")}function eX(G,Q){let X=rQ(G,(Y,Z,J,H)=>Z+">0&&"+Z+"<65536&&"+Z+"%1===0||"+(Q!==void 0?S(Y,Q,H):QG(Y,H,(q)=>({TAG:"InvalidType",expected:J,received:q}),Z))+";");return X.format="port",XG(X).format="port",X}function yQ(G,Q,X){let Y=X!==void 0?X:"Number must be greater than or equal to "+Q;return g(G,oQ,{kind:{TAG:"Min",value:Q},message:Y},(Z,J,H,q)=>"if("+J+"<"+_(Z,Q)+"){"+S(Z,Y,q)+"}")}function SQ(G,Q,X){let Y=X!==void 0?X:"Number must be lower than or equal to "+Q;return g(G,oQ,{kind:{TAG:"Max",value:Q},message:Y},(Z,J,H,q)=>"if("+J+">"+_(Z,Q)+"){"+S(Z,Y,q)+"}")}function GY(G,Q,X){let Y=X!==void 0?X:"Array must be "+Q+" or more items long";return g(G,NQ,{kind:{TAG:"Min",length:Q},message:Y},(Z,J,H,q)=>"if("+J+".length<"+_(Z,Q)+"){"+S(Z,Y,q)+"}")}function QY(G,Q,X){let Y=X!==void 0?X:"Array must be "+Q+" or fewer items long";return g(G,NQ,{kind:{TAG:"Max",length:Q},message:Y},(Z,J,H,q)=>"if("+J+".length>"+_(Z,Q)+"){"+S(Z,Y,q)+"}")}function XY(G,Q,X){let Y=X!==void 0?X:"String must be "+Q+" or more characters long";return g(G,m,{kind:{TAG:"Min",length:Q},message:Y},(Z,J,H,q)=>"if("+J+".length<"+_(Z,Q)+"){"+S(Z,Y,q)+"}")}function YY(G,Q,X){let Y=X!==void 0?X:"String must be "+Q+" or fewer characters long";return g(G,m,{kind:{TAG:"Max",length:Q},message:Y},(Z,J,H,q)=>"if("+J+".length>"+_(Z,Q)+"){"+S(Z,Y,q)+"}")}function tQ(G,Q){let X=Q!==void 0?Q:"Invalid email address";return g(G,m,{kind:"Email",message:X},(Y,Z,J,H)=>"if(!"+_(Y,tY)+".test("+Z+")){"+S(Y,X,H)+"}")}function eQ(G,Q){let X=Q!==void 0?Q:"Invalid UUID";return g(G,m,{kind:"Uuid",message:X},(Y,Z,J,H)=>"if(!"+_(Y,aY)+".test("+Z+")){"+S(Y,X,H)+"}")}function ZY(G,Q){let X=Q!==void 0?Q:"Invalid CUID";return g(G,m,{kind:"Cuid",message:X},(Y,Z,J,H)=>"if(!"+_(Y,iY)+".test("+Z+")){"+S(Y,X,H)+"}")}function GX(G,Q){let X=Q!==void 0?Q:"Invalid url";return g(G,m,{kind:"Url",message:X},(Y,Z,J,H)=>"try{new URL("+Z+")}catch(_){"+S(Y,X,H)+"}")}function QX(G,Q,X){let Y=X!==void 0?X:"Invalid";return g(G,m,{kind:{TAG:"Pattern",re:Q},message:Y},(Z,J,H,q)=>(Q.global?_(Z,Q)+".lastIndex=0;":"")+("if(!"+_(Z,Q)+".test("+J+")){"+S(Z,Y,q)+"}"))}function XX(G,Q){let X=Q!==void 0?Q:"Invalid datetime string! Expected UTC",Y={kind:"Datetime",message:X},Z=G[m];return LQ(uQ(G,m,Z!==void 0?Z.concat(Y):[Y]),(J)=>({p:(H)=>{if(!eY.test(H))J.fail(X,void 0);return new Date(H)},s:(H)=>H.toISOString()}))}function JY(G){let Q=(X)=>X.trim();return LQ(G,(X)=>({p:Q,s:Q}))}function HY(G){return zG([G,s,wQ])}function qY(G){return zG(G.map(NG))}function zY(G,Q,X){return LQ(G,(Y)=>({p:Q!==void 0?(Z)=>Q(Z,Y):void 0,s:X!==void 0?(Z)=>X(Z,Y):void 0}))}function UY(G,Q){return rG(G,(X)=>(Y)=>Q(Y,X))}function ZZ(G){return G}function KY(G,Q){return LQ(G,(X)=>({a:(Y)=>Q(Y,X).then(()=>Y),s:ZZ}))}function BY(G,Q){let X=zG([G,s]);if(Q===void 0)return X;let Y=qG(Q);if(typeof Y==="function")return vG(X,{TAG:"Callback",_0:Y});else return vG(X,{TAG:"Value",_0:Y})}function DY(G,Q){let X=zG([G,PQ]);if(Q===void 0)return X;let Y=qG(Q);if(typeof Y==="function")return vG(X,{TAG:"Callback",_0:Y});else return vG(X,{TAG:"Value",_0:Y})}function WY(G,Q){let X;if(G.type==="object"&&Q.type==="object"){let Y=G.additionalItems;if(typeof Y==="string"&&typeof Q.additionalItems==="string"&&!G.to&&!Q.to){let Z=Q.items,J=G.items,H={},q=[],U=[];for(let K=0,D=J.length;K<D;++K){let B=J[K];q.push(B.location),H[B.location]=B.schema}for(let K=0,D=Z.length;K<D;++K){let B=Z[K];if(!(B.location in H))q.push(B.location);H[B.location]=B.schema}for(let K=0,D=q.length;K<D;++K){let B=q[K];U.push({schema:H[B],location:B})}let z=new F("object");z.items=U,z.properties=H,z.additionalItems=Y,z.compiler=YQ,X=z}else X=void 0}else X=void 0;if(X!==void 0)return X;throw Error("[Sury] The merge supports only structured object schemas without transformations")}function wY(G){let Q=G.defaultAdditionalItems;f.a=Q!==void 0?Q:"strip";let X=f.n,Y=G.disableNanNumberValidation;if(f.n=Y!==void 0?Y:!1,X!==f.n)return yY(AG)}var $Q="m:JSONSchema";function CG(G,Q){let X={};switch(G.type){case"never":X.not={};break;case"unknown":break;case"string":let z=G.const;if(X.type="string",mY(G).forEach((T)=>{let k=T.kind;if(typeof k!=="object")switch(k){case"Email":X.format="email";return;case"Uuid":X.format="uuid";return;case"Cuid":return;case"Url":X.format="uri";return;case"Datetime":X.format="date-time";return}else switch(k.TAG){case"Min":X.minLength=k.length;return;case"Max":X.maxLength=k.length;return;case"Length":let A=k.length;X.minLength=A,X.maxLength=A;return;case"Pattern":X.pattern=String(k.re);return}}),z!==void 0)X.const=z;break;case"number":let{format:K,const:D}=G;if(K!==void 0)if(K==="int32")X.type="integer",GZ(G).forEach((T)=>{let k=T.kind;if(k.TAG==="Min")X.minimum=k.value;else X.maximum=k.value});else X.type="integer",X.maximum=65535,X.minimum=0;else X.type="number",QZ(G).forEach((T)=>{let k=T.kind;if(k.TAG==="Min")X.minimum=k.value;else X.maximum=k.value});if(D!==void 0)X.const=D;break;case"boolean":let B=G.const;if(X.type="boolean",B!==void 0)X.const=B;break;case"null":X.type="null";break;case"array":let W=G.additionalItems,w=0;if(W==="strip"||W==="strict")w=1;else X.items=CG(W,Q),X.type="array",cY(G).forEach((T)=>{let k=T.kind;switch(k.TAG){case"Min":X.minItems=k.length;return;case"Max":X.maxItems=k.length;return;case"Length":let A=k.length;X.maxItems=A,X.minItems=A;return}});if(w===1){let T=G.items.map((A)=>CG(A.schema,Q)),k=T.length;X.items=BX(T),X.type="array",X.minItems=k,X.maxItems=k}break;case"object":let L=G.additionalItems,R=0;if(L==="strip"||L==="strict")R=1;else X.type="object",X.additionalProperties=CG(L,Q);if(R===1){let T={},k=[];G.items.forEach((I)=>{let x=CG(I.schema,Q);if(!xY(I.schema))k.push(I.location);T[I.location]=x}),X.type="object",X.properties=T;let A;if(A=L==="strip"||L==="strict"?L==="strip":!0,X.additionalProperties=A,k.length!==0)X.required=k}break;case"union":let P=[],E=[];G.anyOf.forEach((T)=>{if(T.type==="undefined")return;if(E.push(CG(T,Q)),b in T){P.push(T.const);return}});let N=E.length,M=G.default;if(M!==void 0)X.default=qG(M);if(N===1)Object.assign(X,E[0]);else if(P.length===N)X.enum=P;else X.anyOf=E;break;case"ref":let C=G.$ref;if(C===pQ+LG);else X.$ref=C;break;default:throw Error("[Sury] Unexpected schema type")}let Y=G.description;if(Y!==void 0)X.description=Y;let Z=G.title;if(Z!==void 0)X.title=Z;let J=G.deprecated;if(J!==void 0)X.deprecated=J;let H=G.examples;if(H!==void 0)X.examples=H;let q=G.$defs;if(q!==void 0)Object.assign(Q,q);let U=G[$Q];if(U!==void 0)Object.assign(X,U);return X}function LY(G){PG(G,G,"",8);let Q={},X=CG(G,Q);delete Q.JSON;let Y=Object.keys(Q);if(Y.length)Y.forEach((Z)=>{Q[Z]=CG(Q[Z],0)}),X.$defs=Q;return X}function PY(G,Q){let X=G[$Q];return uQ(G,$Q,X!==void 0?Object.assign({},X,Q):Q)}var JZ=IG;function KX(G){let Q=G.minimum,X;if(Q!==void 0)X=xQ(yG,Q|0,void 0);else{let J=G.exclusiveMinimum;X=J!==void 0?xQ(yG,J+1|0,void 0):yG}let Y=G.maximum;if(Y!==void 0)return VQ(X,Y|0,void 0);let Z=G.exclusiveMinimum;if(Z!==void 0)return VQ(X,Z-1|0,void 0);else return X}function HZ(G){if(typeof G!=="object")return;else return G.default}function VG(G){let Q=(H)=>{if(typeof H!=="object")if(H===!1)return RQ;else return v;else return VG(H)},X=G.type,Y,Z=0,J=0;if(G.nullable)Y=XZ(VG(Object.assign({},G,{nullable:!1})));else if(X!==void 0){let H=qG(X);if(H==="object"){let q=G.properties;if(q!==void 0){let U=ZQ((K)=>{let D={};return Object.keys(q).forEach((B)=>{let W=q[B],w=Q(W),L=G.required,R,P=0;if(L!==void 0&&L.includes(B))R=w;else P=1;if(P===1){let E=HZ(W);if(E!==void 0){let N=UX(w);R=vG(N,{TAG:"Value",_0:E})}else R=UX(w)}D[B]=K.f(B,R)}),D});Y=G.additionalProperties===!1?QQ(U):U}else{let U=G.additionalProperties;Y=U!==void 0?typeof U!=="object"?U===!1?QQ(ZQ((z)=>{})):XQ(v):XQ(VG(U)):NG()}}else if(H==="array"){let q=G.items,U;if(q!==void 0){let B=IY.classify(qG(q));if(B.TAG==="Single")U=cG(Q(B._0));else{let W=B._0;U=iQ((w)=>W.map((L,R)=>w.item(R,Q(L))))}}else U=cG(v);let z=G.minItems,K=z!==void 0?GY(U,z,void 0):U,D=G.maxItems;Y=D!==void 0?QY(K,D,void 0):K}else J=2}else J=2;if(J===2){let{enum:H,allOf:q,anyOf:U}=G;if(U!==void 0){let z=U.length;Y=z!==1?z!==0?zG(U.map(Q)):v:Q(U[0])}else if(q!==void 0){let z=q.length;Y=z!==1?z!==0?rG(v,(K)=>(D)=>{q.forEach((B)=>{try{return wG(D,Q(B))}catch(W){return K.fail("Should pass for all schemas of the allOf property.",void 0)}})}):v:Q(q[0])}else{let z=G.oneOf;if(z!==void 0){let K=z.length;Y=K!==1?K!==0?rG(v,(D)=>(B)=>{let W={contents:!1};if(z.forEach((w)=>{let L;try{wG(B,Q(w)),L=!0}catch(R){L=!1}if(L){if(W.contents)D.fail("Should pass single schema according to the oneOf property.",void 0);W.contents=!0;return}}),!W.contents)return D.fail("Should pass at least one schema according to the oneOf property.",void 0)}):v:Q(z[0])}else{let K=G.not;if(K!==void 0)Y=rG(v,(D)=>(B)=>{let W;try{wG(B,Q(K)),W=!0}catch(w){W=!1}if(W)return D.fail("Should NOT be valid against schema in the not property.",void 0)});else if(H!==void 0){let D=H.length;Y=D!==1?D!==0?zG(H.map(JZ)):v:IG(H[0])}else{let D=G.const;if(D!==void 0)Y=IG(D);else if(X!==void 0){let B=qG(X),W=0,w=0;if(Array.isArray(B))Y=zG(B.map((L)=>VG(Object.assign({},G,{type:BX(L)}))));else if(B==="string"){let L=G.pattern,R=L!==void 0?QX(c,new RegExp(L),void 0):c,P=G.minLength,E=P!==void 0?XY(R,P,void 0):R,N=G.maxLength,M=N!==void 0?YY(E,N,void 0):E;switch(G.format){case"date-time":Y=XX(M,void 0);break;case"email":Y=tQ(M,void 0);break;case"uri":Y=GX(M,void 0);break;case"uuid":Y=eQ(M,void 0);break;default:Y=M}}else if(B==="integer"||G.format==="int64"&&B==="number")Y=KX(G);else w=4;if(w===4)if(G.multipleOf!==1||B!=="number")W=3;else Y=KX(G);if(W===3)if(B==="number"){let L=G.minimum,R;if(L!==void 0)R=yQ(AG,L,void 0);else{let E=G.exclusiveMinimum;R=E!==void 0?yQ(AG,E+1,void 0):AG}let P=G.maximum;if(P!==void 0)Y=SQ(R,P,void 0);else{let E=G.exclusiveMinimum;Y=E!==void 0?SQ(R,E-1,void 0):R}}else if(B==="boolean")Y=KQ;else if(B==="null")Y=aQ(null);else Z=1}else Z=1}}}}if(Z===1){let H=G.if;if(H!==void 0){let q=G.then;if(q!==void 0){let U=G.else;if(U!==void 0){let z=Q(H),K=Q(q),D=Q(U);Y=rG(v,(B)=>(W)=>{let w;try{wG(W,z),w=!0}catch(L){w=!1}if(w)return wG(W,K);else return wG(W,D)})}else Y=v}else Y=v}else Y=v}if(G.description===void 0&&G.deprecated===void 0&&G.examples===void 0&&G.title===void 0)return Y;return cQ(Y,{title:G.title,description:G.description,deprecated:G.deprecated,examples:G.examples})}function RY(G,Q,X){switch(G.type){case"string":return XY(G,Q,X);case"number":if(G.format!==void 0)return xQ(G,Q,X);else return yQ(G,Q,X);case"array":return GY(G,Q,X);default:let Y="S.min is not supported for "+j(G)+" schema. Coerce the schema to string, number or array using S.to first.";throw Error("[Sury] "+Y)}}function EY(G,Q,X){switch(G.type){case"string":return YY(G,Q,X);case"number":if(G.format!==void 0)return VQ(G,Q,X);else return SQ(G,Q,X);case"array":return QY(G,Q,X);default:let Y="S.max is not supported for "+j(G)+" schema. Coerce the schema to string, number or array using S.to first.";throw Error("[Sury] "+Y)}}function NY(G,Q,X){switch(G.type){case"string":let Y=X!==void 0?X:"String must be exactly "+Q+" characters long";return g(G,m,{kind:{TAG:"Length",length:Q},message:Y},(H,q,U,z)=>"if("+q+".length!=="+_(H,Q)+"){"+S(H,Y,z)+"}");case"array":let Z=X!==void 0?X:"Array must be exactly "+Q+" items long";return g(G,NQ,{kind:{TAG:"Length",length:Q},message:Z},(H,q,U,z)=>"if("+q+".length!=="+_(H,Q)+"){"+S(H,Z,z)+"}");default:let J="S.length is not supported for "+j(G)+" schema. Coerce the schema to string or array using S.to first.";throw Error("[Sury] "+J)}}var TY=cG,kY=XQ;var MY=WQ;var UZ=NX.value,KZ=c,BZ=KQ,DZ=yG,WZ=AG,wZ=EX,LZ=RX,PZ=v,RZ=RQ,EZ=ZG,NZ=ZG,TZ=BY,kZ=DY,MZ=HY,CZ=TY,AZ=cX,FZ=tX,_Z=kY,IZ=GG,vZ=hX,OZ=qY,jZ=ZQ,xZ=aQ,VZ=yX,yZ=SX,SZ=XG,$Z=vX,gZ=OX,fZ=jX,bZ=xX,dZ=lQ,lZ=VX,uZ=WQ,pZ=MY,rZ=_X,hZ=IX,oZ=wG,cZ=$X,sZ=WY,nZ=QQ,mZ=uX,iZ=dX,aZ=lX,tZ=oX,eZ=LY,G0=VG,Q0=PY,X0=aX,Y0=iQ,Z0=KY,J0=UY,H0=zY,q0=cQ,z0=j,U0=gX,K0=FX,B0=eX,D0=RY,W0=EY,w0=NY,L0=tQ,P0=eQ,R0=ZY,E0=GX,N0=QX,T0=XX,k0=JY,M0=pX,C0=rX,A0=wY,F0=sX;export{s as void,P0 as uuid,E0 as url,FZ as unnest,EZ as unknown,OZ as union,Y0 as tuple,k0 as trim,H0 as transform,eZ as toJSONSchema,z0 as toExpression,tZ as to,LZ as symbol,iZ as strip,KZ as string,nZ as strict,X0 as shape,xZ as schema,yZ as safeAsync,VZ as safe,lZ as reverseConvertToJsonStringOrThrow,dZ as reverseConvertToJsonOrThrow,bZ as reverseConvertOrThrow,SZ as reverse,J0 as refine,cZ as recursive,_Z as record,B0 as port,N0 as pattern,uZ as parseOrThrow,rZ as parseJsonStringOrThrow,pZ as parseJsonOrThrow,hZ as parseAsyncOrThrow,TZ as optional,jZ as object,WZ as number,MZ as nullish,kZ as nullable,U0 as noValidation,RZ as never,D0 as min,q0 as meta,sZ as merge,W0 as max,w0 as length,vZ as jsonStringWithSpace,IZ as jsonString,PZ as json,DZ as int32,AZ as instance,A0 as global,G0 as fromJSONSchema,Q0 as extendJSONSchema,C0 as enableJsonString,M0 as enableJson,L0 as email,aZ as deepStrip,mZ as deepStrict,T0 as datetime,R0 as cuid,fZ as convertToJsonStringOrThrow,gZ as convertToJsonOrThrow,$Z as convertOrThrow,K0 as compile,F0 as brand,BZ as boolean,wZ as bigint,Z0 as asyncParserRefine,oZ as assertOrThrow,CZ as array,NZ as any,UZ as Error};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{pt as _}from"./chunk-kv72hxkp.js";import{Tu as h}from"./chunk-m4j7jyrd.js";import{aQ as X,cQ as L}from"./chunk-3k2b05fv.js";var E={};X(E,{println:()=>g,print:()=>a,markdown:()=>G,logo:()=>I,input:()=>w,error:()=>A,empty:()=>D,UI:()=>E,Style:()=>m,CancelledError:()=>N});import{EOL as x}from"os";var T={left:[" "," "," \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557","\u2588\u2588\u2554\u2550\u2550\u2550\u2588\u2588\u2557 \u2588\u2588\u2551 \u255A\u2550\u2550\u2588\u2588\u2554\u2550\u2550\u255D","\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 ","\u2588\u2588\u2551\u2584\u2584 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 ","\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D \u2588\u2588\u2551 \u2588\u2588\u2551 "," \u255A\u2550\u2550\u2580\u2580\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D "],right:[" "," "," \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557","\u2588\u2588\u2554\u2550\u2550\u2550\u2588\u2588\u2557 \u2588\u2588\u2554\u2550\u2550\u2550\u2588\u2588\u2557 \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557 \u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D","\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2588\u2588\u2588\u2557 ","\u2588\u2588\u2551\u2584\u2584 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2554\u2550\u2550\u255D ","\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D \u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D \u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557"," \u255A\u2550\u2550\u2580\u2580\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D"]},R={left:[" "," ","\u2588\u2580\u2580\u2588 \u2588 \u2580\u2580\u2580","\u2588 \u2584\u2588 \u2588 \u2588 ","\u2580\u2580\u2580\u2580 \u2580 \u2580 "],right:[" "," ","\u2588\u2580\u2580\u2588 \u2588\u2580\u2580\u2588 \u2588\u2580\u2580\u2584 \u2588\u2580\u2580\u2580","\u2588 \u2584\u2588 \u2588 \u2588 \u2588 \u2588 \u2588\u2580\u2580 ","\u2580\u2580\u2580\u2580 \u2580\u2580\u2580\u2580 \u2580\u2580\u2580 \u2580\u2580\u2580\u2580"]};var O=["\u2800 ","\u2588\u2580\u2580\u2588 \u2588 \u2580\u2580\u2580 \u2588\u2580\u2580\u2588 \u2588\u2580\u2580\u2588 \u2588\u2580\u2580\u2584 \u2588\u2580\u2580\u2580","\u2588 \u2584\u2588 \u2588 \u2588 \u2588 \u2584\u2588 \u2588 \u2588 \u2588 \u2588 \u2588\u2580\u2580 ","\u2580\u2580\u2580\u2580 \u2580 \u2580 \u2580\u2580\u2580\u2580 \u2580\u2580\u2580\u2580 \u2580\u2580\u2580 \u2580\u2580\u2580\u2580"],N=_.create("UICancelledError",h.void()),m={TEXT_HIGHLIGHT:"\x1B[96m",TEXT_HIGHLIGHT_BOLD:"\x1B[96m\x1B[1m",TEXT_DIM:"\x1B[90m",TEXT_DIM_BOLD:"\x1B[90m\x1B[1m",TEXT_NORMAL:"\x1B[0m",TEXT_NORMAL_BOLD:"\x1B[1m",TEXT_WARNING:"\x1B[93m",TEXT_WARNING_BOLD:"\x1B[93m\x1B[1m",TEXT_DANGER:"\x1B[91m",TEXT_DANGER_BOLD:"\x1B[91m\x1B[1m",TEXT_SUCCESS:"\x1B[92m",TEXT_SUCCESS_BOLD:"\x1B[92m\x1B[1m",TEXT_INFO:"\x1B[94m",TEXT_INFO_BOLD:"\x1B[94m\x1B[1m"};function g(...r){a(...r),process.stderr.write(x)}function a(...r){f=!1,process.stderr.write(r.join(" "))}var f=!1;function D(){if(f)return;g(""+m.TEXT_NORMAL),f=!0}function I(r){if(!process.stdout.isTTY&&!process.stderr.isTTY){let o=[];for(let s of O){if(r)o.push(r);o.push(s),o.push(x)}return o.join("").trimEnd()}let n=[],t="\x1B[0m",i={fg:"\x1B[90m",shadow:"\x1B[38;5;235m",bg:"\x1B[48;5;235m"},c={fg:t,shadow:"\x1B[38;5;238m",bg:"\x1B[48;5;238m"},d=" ",b=(o,s,u,l)=>{let e=[];for(let p of o){if(p==="_"){e.push(l," ",t);continue}if(p==="^"){e.push(s,l,"\u2580",t);continue}if(p==="~"){e.push(u,"\u2580",t);continue}if(p===" "){e.push(" ");continue}e.push(s,p,t)}return e.join("")};return T.left.forEach((o,s)=>{if(r)n.push(r);n.push(b(o,i.fg,i.shadow,i.bg)),n.push(d);let u=T.right[s]??"";n.push(b(u,c.fg,c.shadow,c.bg)),n.push(x)}),n.join("").trimEnd()}async function w(r){let t=L("readline").createInterface({input:process.stdin,output:process.stdout});return new Promise((i)=>{t.question(r,(c)=>{t.close(),i(c.trim())})})}function A(r){if(r.startsWith("Error: "))r=r.slice(7);g(m.TEXT_DANGER_BOLD+"Error: "+m.TEXT_NORMAL+r)}function G(r){return r}
3
- export{T as Tf,R as Uf,E as Vf};
2
+ import{Ot as _}from"./chunk-3sz6gw10.js";import{$u as h}from"./chunk-hnz570f9.js";import{iQ as X,kQ as L}from"./chunk-4sazy0nq.js";var E={};X(E,{println:()=>g,print:()=>a,markdown:()=>G,logo:()=>I,input:()=>w,error:()=>A,empty:()=>D,UI:()=>E,Style:()=>m,CancelledError:()=>N});import{EOL as x}from"os";var T={left:[" "," "," \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557","\u2588\u2588\u2554\u2550\u2550\u2550\u2588\u2588\u2557 \u2588\u2588\u2551 \u255A\u2550\u2550\u2588\u2588\u2554\u2550\u2550\u255D","\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 ","\u2588\u2588\u2551\u2584\u2584 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 ","\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D \u2588\u2588\u2551 \u2588\u2588\u2551 "," \u255A\u2550\u2550\u2580\u2580\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D "],right:[" "," "," \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557","\u2588\u2588\u2554\u2550\u2550\u2550\u2588\u2588\u2557 \u2588\u2588\u2554\u2550\u2550\u2550\u2588\u2588\u2557 \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557 \u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D","\u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2588\u2588\u2588\u2557 ","\u2588\u2588\u2551\u2584\u2584 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2554\u2550\u2550\u255D ","\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D \u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D \u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557"," \u255A\u2550\u2550\u2580\u2580\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D"]},R={left:[" "," ","\u2588\u2580\u2580\u2588 \u2588 \u2580\u2580\u2580","\u2588 \u2584\u2588 \u2588 \u2588 ","\u2580\u2580\u2580\u2580 \u2580 \u2580 "],right:[" "," ","\u2588\u2580\u2580\u2588 \u2588\u2580\u2580\u2588 \u2588\u2580\u2580\u2584 \u2588\u2580\u2580\u2580","\u2588 \u2584\u2588 \u2588 \u2588 \u2588 \u2588 \u2588\u2580\u2580 ","\u2580\u2580\u2580\u2580 \u2580\u2580\u2580\u2580 \u2580\u2580\u2580 \u2580\u2580\u2580\u2580"]};var O=["\u2800 ","\u2588\u2580\u2580\u2588 \u2588 \u2580\u2580\u2580 \u2588\u2580\u2580\u2588 \u2588\u2580\u2580\u2588 \u2588\u2580\u2580\u2584 \u2588\u2580\u2580\u2580","\u2588 \u2584\u2588 \u2588 \u2588 \u2588 \u2584\u2588 \u2588 \u2588 \u2588 \u2588 \u2588\u2580\u2580 ","\u2580\u2580\u2580\u2580 \u2580 \u2580 \u2580\u2580\u2580\u2580 \u2580\u2580\u2580\u2580 \u2580\u2580\u2580 \u2580\u2580\u2580\u2580"],N=_.create("UICancelledError",h.void()),m={TEXT_HIGHLIGHT:"\x1B[96m",TEXT_HIGHLIGHT_BOLD:"\x1B[96m\x1B[1m",TEXT_DIM:"\x1B[90m",TEXT_DIM_BOLD:"\x1B[90m\x1B[1m",TEXT_NORMAL:"\x1B[0m",TEXT_NORMAL_BOLD:"\x1B[1m",TEXT_WARNING:"\x1B[93m",TEXT_WARNING_BOLD:"\x1B[93m\x1B[1m",TEXT_DANGER:"\x1B[91m",TEXT_DANGER_BOLD:"\x1B[91m\x1B[1m",TEXT_SUCCESS:"\x1B[92m",TEXT_SUCCESS_BOLD:"\x1B[92m\x1B[1m",TEXT_INFO:"\x1B[94m",TEXT_INFO_BOLD:"\x1B[94m\x1B[1m"};function g(...r){a(...r),process.stderr.write(x)}function a(...r){f=!1,process.stderr.write(r.join(" "))}var f=!1;function D(){if(f)return;g(""+m.TEXT_NORMAL),f=!0}function I(r){if(!process.stdout.isTTY&&!process.stderr.isTTY){let o=[];for(let s of O){if(r)o.push(r);o.push(s),o.push(x)}return o.join("").trimEnd()}let n=[],t="\x1B[0m",i={fg:"\x1B[90m",shadow:"\x1B[38;5;235m",bg:"\x1B[48;5;235m"},c={fg:t,shadow:"\x1B[38;5;238m",bg:"\x1B[48;5;238m"},d=" ",b=(o,s,u,l)=>{let e=[];for(let p of o){if(p==="_"){e.push(l," ",t);continue}if(p==="^"){e.push(s,l,"\u2580",t);continue}if(p==="~"){e.push(u,"\u2580",t);continue}if(p===" "){e.push(" ");continue}e.push(s,p,t)}return e.join("")};return T.left.forEach((o,s)=>{if(r)n.push(r);n.push(b(o,i.fg,i.shadow,i.bg)),n.push(d);let u=T.right[s]??"";n.push(b(u,c.fg,c.shadow,c.bg)),n.push(x)}),n.join("").trimEnd()}async function w(r){let t=L("readline").createInterface({input:process.stdin,output:process.stdout});return new Promise((i)=>{t.question(r,(c)=>{t.close(),i(c.trim())})})}function A(r){if(r.startsWith("Error: "))r=r.slice(7);g(m.TEXT_DANGER_BOLD+"Error: "+m.TEXT_NORMAL+r)}function G(r){return r}
3
+ export{T as Qf,R as Rf,E as Sf};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
2
  function t(o){return o}
3
- export{t as Rd};
3
+ export{t as Pd};
@@ -0,0 +1,28 @@
1
+ // @bun
2
+ import{mf as GH}from"./chunk-std2bgv7.js";import{Pp as DH,Tp as o,jq as NH}from"./chunk-e03tgfpb.js";import"./chunk-gwfx7tx7.js";import"./chunk-1wpjmwnh.js";import"./chunk-cqtkxwd8.js";import"./chunk-ymtcm4xd.js";import"./chunk-7dep7g7c.js";import"./chunk-tabcpx7t.js";import"./chunk-cx7p4ezk.js";import{Qt as Q}from"./chunk-xqwvx3qq.js";import"./chunk-qp9y0g73.js";import{su as VH}from"./chunk-xyjehgzm.js";import{Bu as i,Ju as WH}from"./chunk-j21dnncc.js";import"./chunk-vc4e6xc4.js";import"./chunk-hnz570f9.js";import"./chunk-tdmn21z0.js";import"./chunk-s8mghr5a.js";import"./chunk-pqnbdygz.js";import"./chunk-ydc6ypjt.js";import"./chunk-4sazy0nq.js";var wH=0.9,RH=256,HH="[Earlier tool result removed to fit the request size limit]",f;function b(H){return Buffer.byteLength(JSON.stringify(H),"utf8")}function $H(){return i.QITQODE_QLEX_MAX_REQUEST_BYTES??f}function n(H){let X=i.QITQODE_QLEX_MAX_REQUEST_BYTES;if(X!==void 0)return X;let Z=Math.max(1,Math.min(Math.floor(H*wH),Math.floor(H)-1));return f=f===void 0?Z:Math.min(f,Z),f}function y(H,X){return!!H&&typeof H==="object"&&H.role===X}function XH(H){let X=[],Z=0;while(Z<H.length){let $=Z,J=H[Z];if(Z++,y(J,"assistant")&&Array.isArray(J?.tool_calls)&&J.tool_calls.length>0)while(Z<H.length&&y(H[Z],"tool"))Z++;X.push({start:$,end:Z})}return X}function ZH(H,X){if(X.length===0)return[];let Z=-1;for(let $=X.length-1;$>=0;$--){let J=X[$],K=!1;for(let z=J.start;z<J.end;z++)if(y(H[z],"user"))K=!0;if(K){Z=$;break}}return X.filter(($,J)=>{if(J===X.length-1)return!1;if(J===Z)return!1;if($.start===0&&y(H[0],"system"))return!1;return!0})}function l(H,X){let Z=b(H),$={toolResultsElided:0,unitsDropped:0},J=()=>({body:H,bytes:Z,originalBytes:Z,reduced:!1,actions:$});if(!H||typeof H!=="object")return J();let K=H.messages;if(!Array.isArray(K))return J();let z=K.map((N)=>N&&typeof N==="object"?{...N}:N),Y=()=>({...H,messages:z}),V=()=>b(Y())<=X;{let N=z;for(let F of ZH(N,XH(N))){let L=!1;for(let S=F.start;S<F.end;S++){let E=N[S];if(!y(E,"tool"))continue;let R=E?.content;if(typeof R!=="string"||R.length<RH)continue;if(R===HH)continue;N[S]={...E,content:HH},$.toolResultsElided++,L=!0}if(L&&V())break}}if(!V())for(;;){let N=z,L=ZH(N,XH(N))[0];if(!L)break;if(z=[...N.slice(0,L.start),...N.slice(L.end)],$.unitsDropped++,V())break}let G=Y(),D=b(G);return{body:G,bytes:D,originalBytes:Z,reduced:D<Z&&D<=X,actions:$}}var w=WH({service:"provider.qlex"}),IH=Q.streamUrl(),AH=Q.omniqueryBaseUrl()+"/runOrchestrated";function T(H,X){let Z=H;if(X.status!==void 0)Z.status=X.status;if(X.upstreamCode!==void 0)Z.upstreamCode=X.upstreamCode;if(Z.category=X.category,Z.retryable=X.retryable,X.outputBudgetRecoveryAvailable!==void 0)Z.outputBudgetRecoveryAvailable=X.outputBudgetRecoveryAvailable;if(X.outputBudgetRecoveryTokens!==void 0)Z.outputBudgetRecoveryTokens=X.outputBudgetRecoveryTokens}function B(H,X){return{...H,...X}}class jH extends Error{name="QlexNotLoggedInError";constructor(H){super(Q.copy().notLoggedIn);T(this,B({category:"invalid_credentials",retryable:!1},H))}}class _H extends Error{name="QlexInsufficientBalanceError";constructor(H,X){super(Q.copy().insufficientBalance(H));T(this,B({status:402,category:"billing",retryable:!1},X))}}class UH extends Error{name="QlexRateLimitError";constructor(H){super(Q.copy().rateLimit);T(this,B({status:429,category:"rate_limited",retryable:!0},H))}}class FH extends Error{name="QlexInvalidCredentialsError";constructor(H,X){super(Q.copy().invalidCredentials(H));T(this,B({status:401,category:"invalid_credentials",retryable:!1},X))}}class OH extends Error{name="QlexRequestRejectedError";constructor(H,X,Z){super(Q.copy().requestRejected(H,X));T(this,B({status:400,category:"request_rejected",retryable:!1},Z))}}class m extends Error{name="QlexRequestTooLargeError";stage;constructor(H="irreducible",X,Z){super(H==="after-reduction"?Q.copy().requestTooLargeAfterReduction(X):Q.copy().requestTooLargeIrreducible(X));this.stage=H,T(this,B({status:413,category:"request_too_large",retryable:!1},Z))}}class LH extends Error{name="QlexRequestNotSentError";constructor(H,X){super(Q.copy().requestNotSent(H));T(this,B({category:"request_rejected",retryable:!1},X))}}class v extends Error{name="QlexGatewayError";constructor(H,X){super(Q.copy().gatewayUnavailable(H));T(this,B({category:"gateway_routing",retryable:!1},X))}}var TH=60000;function FX(H){return Q.sanitizeUpstreamError(H)}class h extends Error{name="QlexStreamError";constructor(H,X){let Z=B({category:"unknown",retryable:!1},X);super(Z.category==="output_budget_exhausted"?Q.copy().outputBudgetExhausted():Z.category==="empty_output"?Q.copy().emptyOutput():Z.category==="stream_truncated"?Q.copy().streamCutOff():Q.copy().streamFailed(H));T(this,Z),VH(this)}}var BH=[{match:/\b(unauthori[sz]ed|forbidden|invalid[ _-]?(api[ _-]?key|token|credential)|expired[ _-]?token|authentication[ _-]?(failed|error)|401|403)\b/i,category:"invalid_credentials",retryable:!1},{match:/(output (?:token )?budget|maximum output tokens|max_tokens|finish[_ -]?reason.{0,20}(length|budget)|reasoning.{0,20}(budget|tokens))/i,category:"output_budget_exhausted",retryable:!1},{match:/\b(no visible output|empty output|produced no (?:visible )?(?:text|output)|nothing to display)\b/i,category:"empty_output",retryable:!1},{match:/\b(insufficient[ _-]?(credits?|qredits?|balance|funds)|payment[ _-]?required|quota[ _-]?exceeded|out[ _-]?of[ _-]?(credits?|qredits?)|402)\b/i,category:"billing",retryable:!1},{match:/\b(rate[ _-]?limit(ed|s)?|too[ _-]?many[ _-]?requests|429)\b/i,category:"rate_limited",retryable:!0},{match:/(unexpected end of (json|input|stream|data)|premature (close|end)|socket hang ?up|incomplete (response|output|json|message)|truncated|stream (ended|closed|terminated) (early|unexpectedly|prematurely)|\bECONNRESET\b|\bEPIPE\b)/i,category:"stream_truncated",retryable:!0},{match:/\b(overloaded|at capacity|service[ _-]?unavailable|temporarily[ _-]?unavailable|bad[ _-]?gateway|gateway[ _-]?time(d[ _-]?out|out)|timed[ _-]?out|502|503|504)\b/i,category:"transient",retryable:!0}];function bH(H){let X=H??"";for(let Z of BH)if(Z.match.test(X))return{category:Z.category,retryable:Z.retryable};return{category:"unknown",retryable:!1}}function xH(H){return DH(H)}function qH(H,X){let Z,$,J,K=!1;try{let G=JSON.parse(X);if(G&&typeof G==="object"){let D=G.error&&typeof G.error==="object"?G.error:void 0;if(typeof D?.code==="string")Z=D.code;else if(typeof G.code==="string")Z=G.code;if(typeof D?.message==="string")$=D.message;else if(typeof G.message==="string")$=G.message;if(typeof G.details?.field==="string")J=G.details.field}}catch(G){K=/^\s*[\[{]/.test(X)&&(hH(X)||/unexpected end|end of json|unterminated string/i.test(String(G)))}let z=Z?.toUpperCase()??"",Y=(()=>{if(K)return"stream_truncated";if(H===402)return"billing";if(H===413)return"request_too_large";if(H===429)return"rate_limited";if(H===401||H===403)return z==="ERR_GATEWAY_REQUIRED"||xH(X)?"gateway_routing":"invalid_credentials";if(z.includes("CONFIG"))return"configuration";if(H>=500)return"transient";if(H>=400)return"request_rejected";return"unknown"})(),V={status:H,category:Y,retryable:Y==="transient"||Y==="rate_limited"||Y==="stream_truncated"};if(Z!==void 0)V.upstreamCode=Z;if($!==void 0)V.upstreamMessage=$;if(J!==void 0)V.field=J;return V}function hH(H){let X=0,Z=!1,$=!1;for(let J of H){if(Z){if($)$=!1;else if(J==="\\")$=!0;else if(J==='"')Z=!1;continue}if(J==='"')Z=!0;else if(J==="{"||J==="[")X++;else if(J==="}"||J==="]")X--;if(X<0)return!1}return Z||X>0}var vH=new Set(["coding","agent","research","review","chat"]);function fH(H){if(H===void 0)return;if(typeof H==="string"&&vH.has(H))return H;throw Error(`invalid Qortex posture: ${String(H)}`)}function yH(H){if(H===void 0)return;let X=Array.isArray(H)?H:[H];if(X.every((Z)=>typeof Z==="string"&&/^[^/\s]+\/[^/\s]+$/.test(Z)))return Array.isArray(H)?X:H;throw Error(`invalid Qortex directive registry key: ${String(H)}`)}function c(H){if(typeof H==="string")return H;if(Array.isArray(H))return H.map((X)=>{if(typeof X==="string")return X;if(X&&typeof X==="object"){let Z=X;if(typeof Z.text==="string")return Z.text;if(typeof Z.content==="string")return Z.content}return""}).join("");if(H===void 0||H===null)return"";return String(H)}var gH="[Tool call]",pH="[Tool returned no output]";function MH(H){if(!Array.isArray(H))return{messages:H,dropped:[]};let X=[];return{messages:H.flatMap(($,J)=>{if(!$||typeof $!=="object")return X.push({index:J,role:typeof $,reason:"not-an-object"}),[];let K=$,z=c(K.content);if(z.trim().length>0)return[{...K,content:z}];if(K.role==="assistant"&&Array.isArray(K.tool_calls)&&K.tool_calls.length>0)return[{...K,content:gH}];if(K.role==="tool"&&typeof K.tool_call_id==="string"&&K.tool_call_id.trim().length>0)return[{...K,content:pH}];return X.push({index:J,role:typeof K.role==="string"?K.role:"unknown",reason:"empty-content"}),[]}),dropped:X}}function uH(H){return MH(H).messages}function cH(H){if(!Array.isArray(H))return!1;return H.some((X)=>!!X&&typeof X==="object"&&X.role==="user")}function mH(H){if(!Array.isArray(H))return!1;return H.some((X)=>{if(!X||typeof X!=="object")return!1;let Z=X;if(Z.role!=="user")return!1;return c(Z.content).trim().length>0})}function dH(H){if(!Array.isArray(H))return H;let X=(K)=>!!K&&typeof K==="object"&&K.role==="system",Z=0;while(Z<H.length&&X(H[Z]))Z++;if(Z<=1)return H;let $=H.slice(0,Z),J=$.map((K)=>typeof K.content==="string"?K.content:String(K.content??"")).filter((K)=>K.length>0).join(`
3
+
4
+ `);return[{...$[0],role:"system",content:J},...H.slice(Z)]}var g="<tool_call>",p="</tool_call>";function iH(H){if(!Array.isArray(H)||H.length===0)return;let X=H.map((Z)=>{try{return JSON.stringify(Z)}catch{return}}).filter((Z)=>Z!==void 0);if(X.length===0)return;return["# Tools","","You may call one or more functions to assist with the user query.","","You are provided with function signatures within <tools></tools> XML tags:","<tools>",...X,"</tools>","","For each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:","<tool_call>",'{"name": <function-name>, "arguments": <args-json-object>}',"</tool_call>","","Function results will be provided within <tool_response></tool_response> XML tags. Do not write <tool_response> blocks yourself.","Only use the functions declared above. Never invent function names, and never write out a function-call-like block in any other format."].join(`
5
+ `)}var nH=3;function s(H){let X=H;for(let Z=0;Z<nH;Z++){if(X!==null&&typeof X==="object")return X;if(typeof X!=="string")return;try{X=JSON.parse(X)}catch{return}}return}function lH(H){let X=H?.tool_calls;if(!Array.isArray(X))return;for(let Z of X){let $=Z?.function;if(!$)continue;w.debug("tool call ingress",{tool:typeof $.name==="string"?$.name:"?",source:"native",args:a($.arguments)})}}function a(H,X=300){let Z;try{Z=typeof H==="string"?H:JSON.stringify(H)??String(H)}catch{Z="<unrenderable>"}return Z.length<=X?Z:`${Z.slice(0,X)}\u2026 (${Z.length} chars total)`}function rH(H){let X=H.function??{},Z=typeof X.name==="string"?X.name:"",$=X.arguments===void 0?{}:s(X.arguments);if($===void 0)w.warn("dropping unrecoverable tool-call arguments while re-encoding history",{tool:Z,raw:a(X.arguments)});return`${g}
6
+ ${JSON.stringify({name:Z,arguments:$??{}})}
7
+ ${p}`}function QH(H,X){if(!Array.isArray(H))return H;let Z=H.map((J)=>{if(!J||typeof J!=="object")return J;let K=J;if(K.role==="assistant"&&Array.isArray(K.tool_calls)){let z=K.tool_calls.map(rH).join(`
8
+ `),Y=c(K.content),{tool_calls:V,...G}=K;return{...G,content:Y.length>0?`${Y}
9
+ ${z}`:z}}if(K.role==="tool"){let{tool_call_id:z,name:Y,...V}=K;return{...V,role:"user",content:`<tool_response>
10
+ ${c(K.content)}
11
+ </tool_response>`}}return J}),$=iH(X);if($){let J=0;while(J<Z.length&&!!Z[J]&&typeof Z[J]==="object"&&Z[J].role==="system")J++;Z.splice(J,0,{role:"system",content:$})}return Z}function oH(){return process.env.QITQODE_TOOL_PROTOCOL==="text"?"text":"native"}function sH(H){if(Array.isArray(H.tools)&&H.tools.length>0)return!0;let X=H.messages;if(!Array.isArray(X))return!1;return X.some((Z)=>{if(!Z||typeof Z!=="object")return!1;let $=Z;return $.role==="tool"||$.role==="assistant"&&Array.isArray($.tool_calls)})}function JH(H,X){let Z=X?.toolMode??"native",$=H.model??"default",J={stream:H.stream??!0};if(H.temperature!==void 0)J.temperature=H.temperature;if(H.max_tokens!==void 0)J.max_tokens=H.max_tokens;let K=X?.outputAdvisory;if(K){let D=K.tierOutputLimit;if(J.max_tokens!==void 0){if(D!==void 0&&J.max_tokens>D)J.max_tokens=D}else{let N=K.recommendedTotalTokens??K.tierRecommendedStepTokens??D,F=N===void 0?void 0:D===void 0?N:Math.min(N,D);if(F!==void 0)J.max_tokens=F}if(X?.outputBudgetRecoveryTokens!==void 0){let N=typeof J.max_tokens==="number"?J.max_tokens:0,F=K.tierOutputLimit??X.outputBudgetRecoveryTokens;if(X.outputBudgetRecoveryTokens>N)J.max_tokens=Math.min(X.outputBudgetRecoveryTokens,F)}}if(H.tools!==void 0)J.tools=H.tools;if(H.tool_choice!==void 0)J.tool_choice=H.tool_choice;if(H.stream_options!==void 0)J.stream_options=H.stream_options;let z=Z==="text"?QH(H.messages,H.tools):H.messages,Y={},V=fH(H.posture);if(V!==void 0)Y.posture=V;let G=yH(H.directive);if(G!==void 0)Y.directive=G;if(H.modelPersona!==void 0)Y.modelPersona=H.modelPersona;return{tier:$,messages:dH(uH(z)),opts:J,...Y}}var d=new Map;function x(H){return typeof H==="number"&&Number.isFinite(H)&&H>0?H:void 0}function aH(H,X){let Z={},$=x(X.tierOutputLimit),J=x(X.tierRecommendedStepTokens),K=x(X.reasoningReserveTokens),z=x(X.visibleOutputFloorTokens),Y=x(X.recommendedTotalTokens),V=x(X.viableTotalFloorTokens),G=x(X.budgetPolicyVersion);if($!==void 0)Z.tierOutputLimit=$;if(J!==void 0)Z.tierRecommendedStepTokens=J;if(K!==void 0)Z.reasoningReserveTokens=K;if(z!==void 0)Z.visibleOutputFloorTokens=z;if(Y!==void 0)Z.recommendedTotalTokens=Y;if(V!==void 0)Z.viableTotalFloorTokens=V;if(typeof X.reasoningReported==="boolean")Z.reasoningReported=X.reasoningReported;if(G!==void 0)Z.budgetPolicyVersion=G;if(Object.keys(Z).length===0)return;d.set(H,Z)}function tH(H){return d.get(H)}function OX(){d.clear()}function eH(H){let X=(Z)=>typeof Z==="string"&&(Z.startsWith("qlex")||Z.startsWith("qortex"));return X(H.id)||X(H.object)}function HX(H){let X=[],Z=H.indexOf(`
12
+ `)===-1?[H]:H.split(`
13
+ `);for(let z of Z){let Y=z.endsWith("\r")?z.slice(0,-1):z;if(!Y.startsWith("data:"))continue;let V=Y.slice(5);if(V.startsWith(" "))V=V.slice(1);X.push(V)}if(X.length===0)return{kind:"skip"};let $=X.length===1?X[0]:X.join(`
14
+ `);if($==="")return{kind:"skip"};if($==="[DONE]")return{kind:"done"};if($.startsWith("[ERROR]"))return{kind:"error",message:$.slice(7).trim()||"qlex stream error"};let J=$.charCodeAt(0),K=J===123||J===91||J===32||J===9||J===10||J===13;try{if(!K)return{kind:"token",content:$};let z=JSON.parse($);if(z&&typeof z==="object"){let Y=z.id;if(Y==="qlex-cost"||Y==="qortex-cost")return{kind:"cost",cost:z};if(Y==="qlex-stream"&&z.usage&&typeof z.usage==="object"){let D=z.choices,N;if(Array.isArray(D)&&D[0]&&typeof D[0]==="object"){let F=D[0].finish_reason;if(typeof F==="string")N=F}return{kind:"usage",usage:z.usage,finishReason:N}}if(Array.isArray(z.choices))return{kind:"passthrough",chunk:z};let V=z,G=typeof V.content==="string"?V.content:typeof V.text==="string"?V.text:typeof V.delta==="string"?V.delta:void 0;if(G!==void 0)return{kind:"token",content:G};if(eH(z)){let D=z.object;return{kind:"control",control:typeof D==="string"&&D.endsWith(".tier.outputLimits")?"tier-output-limits":"unknown",chunk:z}}}}catch{}return{kind:"token",content:$}}function XX(H,X){let Z=Math.min(H.length,X.length-1);for(let $=Z;$>=1;$--)if(X.startsWith(H.slice(H.length-$)))return $;return 0}function ZX(H){if(typeof H==="string"){try{let Z=JSON.parse(H);if(Z!==null&&typeof Z==="object")return H}catch{}let X=s(H);return JSON.stringify(X??H)}return JSON.stringify(H??{})}class SH{onText;onToolCall;pending="";inBlock=!1;constructor(H,X){this.onText=H;this.onToolCall=X}feed(H){this.pending+=H,this.drain(!1)}flush(){if(this.drain(!0),this.inBlock)this.emitBlock(this.pending,!0),this.inBlock=!1;else if(this.pending.length>0)this.onText(this.pending);this.pending=""}drain(H){while(!0)if(!this.inBlock){let X=this.pending.indexOf(g);if(X===-1){let Z=H?0:XX(this.pending,g),$=this.pending.length-Z;if($>0)this.onText(this.pending.slice(0,$)),this.pending=Z>0?this.pending.slice($):"";return}if(X>0)this.onText(this.pending.slice(0,X));this.pending=this.pending.slice(X+g.length),this.inBlock=!0}else{let X=this.pending.indexOf(p);if(X===-1)return;if(this.emitBlock(this.pending.slice(0,X),!1),this.pending=this.pending.slice(X+p.length),this.pending.startsWith(`\r
15
+ `))this.pending=this.pending.slice(2);else if(this.pending.startsWith(`
16
+ `))this.pending=this.pending.slice(1);this.inBlock=!1}}emitBlock(H,X){try{let Z=JSON.parse(H.trim());if(Z&&typeof Z==="object"&&typeof Z.name==="string"){this.onToolCall({name:Z.name,arguments:ZX(Z.arguments)});return}}catch{}this.onText(`${g}${H}${X?"":p}`)}}function r(H,X,Z){let $={id:"qlex-stream",object:"chat.completion.chunk",created:Math.floor(Date.now()/1000),model:"qlex",choices:[{index:0,delta:H,finish_reason:X}]};if(Z)$.usage=Z;return`data: ${JSON.stringify($)}
17
+
18
+ `}function $X(H,X){let Z=X?.toolProtocolEnabled===!0,$=X?.tier,J=X?.requestedOutputBudget,K=H.getReader(),z=new TextDecoder,Y=new TextEncoder,V="",G=!1,D=!1,N,F,L,S,E=!1,R=!1,C=0;return new ReadableStream({async start(P){let A=(_)=>{if(_.length>0)E=!0;let W=G?{content:_}:{role:"assistant",content:_};G=!0,P.enqueue(Y.encode(r(W,null)))},q=0,I=Z?new SH(A,(_)=>{w.debug("tool call ingress",{tool:_.name,source:"text-shim",args:a(_.arguments),objectShaped:s(_.arguments)!==void 0});let W={...G?{}:{role:"assistant"},tool_calls:[{index:q,id:`qlexcall_${Date.now().toString(36)}_${q}`,type:"function",function:{name:_.name,arguments:_.arguments}}]};G=!0,R=!0,q++,P.enqueue(Y.encode(r(W,null)))}):void 0,t=(_)=>I?I.feed(_):A(_),O=()=>{I?.flush();let W=N||F!==void 0||L!==void 0?{prompt_tokens:N?.tokens.prompt??L?.prompt??0,completion_tokens:N?.tokens.completion??L?.completion??0,total_tokens:N?.tokens.total??(N?.tokens.prompt??L?.prompt??0)+(N?.tokens.completion??L?.completion??0),cost_usd:N?.cost_usd,cost_credits:N?.cost_credits??N?.cost_qredits,context_window:F}:void 0,j=q>0?"tool_calls":S??"stop";if(j==="length"||j==="max_tokens"){let U=u($??"default",J),k=U!==void 0;w.debug("qlex output budget exhausted",{tier:$,contentStreamed:E,outputBudgetRecoveryAvailable:k}),P.error(new h("output budget exhausted",{category:"output_budget_exhausted",retryable:!1,outputBudgetRecoveryAvailable:k,outputBudgetRecoveryTokens:U})),D=!0;return}if(!E&&!R&&S!=="tool_calls"){let U=u($??"default",J),k=U!==void 0;w.debug("qlex completed without visible output",{tier:$,outputBudgetRecoveryAvailable:k}),P.error(new h("empty output",{category:"empty_output",retryable:!1,outputBudgetRecoveryAvailable:k,outputBudgetRecoveryTokens:U})),D=!0;return}if(P.enqueue(Y.encode(r({},j,W))),P.enqueue(Y.encode(`data: [DONE]
19
+
20
+ `)),!N&&$!==void 0)w.info("qlex cost frame absent on stream finish",{tier:$});P.close(),D=!0},M=(_)=>{let W=HX(_);switch(C++,W.kind){case"skip":return!1;case"token":return t(W.content),!1;case"passthrough":{let j=W.chunk.choices;if(Array.isArray(j)&&j[0]&&typeof j[0]==="object"){let U=j[0].finish_reason;if(typeof U==="string")S=U;let k=j[0].delta;if(typeof k?.content==="string"&&k.content.length>0)E=!0;if(Array.isArray(k?.tool_calls))R=!0;lH(j[0].delta)}return G=!0,P.enqueue(Y.encode(`data: ${JSON.stringify(W.chunk)}
21
+
22
+ `)),!1}case"cost":if(W.cost.final)N=W.cost;return!1;case"usage":if(W.usage.context_window!==void 0)F=W.usage.context_window;if(W.usage.prompt_tokens!==void 0&&W.usage.completion_tokens!==void 0)L={prompt:W.usage.prompt_tokens,completion:W.usage.completion_tokens};if(W.finishReason!==void 0)S=W.finishReason;return!1;case"control":{if(W.control==="tier-output-limits"){let j=W.chunk;if($!==void 0)aH($,j);w.debug("qlex tier output limits",{tierOutputLimit:j.tierOutputLimit,tierRecommendedStepTokens:j.tierRecommendedStepTokens,tierStepGuidance:j.tierStepGuidance,reasoningReserveTokens:j.reasoningReserveTokens,visibleOutputFloorTokens:j.visibleOutputFloorTokens,recommendedTotalTokens:j.recommendedTotalTokens,viableTotalFloorTokens:j.viableTotalFloorTokens,reasoningReported:j.reasoningReported,budgetPolicyVersion:j.budgetPolicyVersion})}else w.debug("qlex control frame dropped",{id:W.chunk.id,object:W.chunk.object});return!1}case"done":return O(),!0;case"error":{let j=bH(W.message);w.debug("qlex stream error frame",{tier:$,raw:W.message,frameIndex:C,contentStreamed:G,category:j.category,retryable:j.retryable});let U=j.category==="output_budget_exhausted"||j.category==="empty_output"?u($??"default",J):void 0;if(j.retryable===!1&&U!==void 0)j.outputBudgetRecoveryAvailable=!0,j.outputBudgetRecoveryTokens=U;return P.error(new h(W.message,j)),D=!0,!0}}};try{while(!0){let{done:W,value:j}=await K.read();if(W)break;V+=z.decode(j,{stream:!0});let U;while((U=V.indexOf(`
23
+
24
+ `))!==-1){let k=V.slice(0,U);if(V=V.slice(U+2),M(k))return}}V+=z.decode();let _=V.replace(/\r?\n$/,"");if(_.length>0&&M(_))return;if(!D)O()}catch(_){if(!D)P.error(_ instanceof h?_:new h(_ instanceof Error?_.message:String(_)))}finally{K.releaseLock()}},cancel(P){K.cancel(P).catch(()=>{})}})}function PH(H){return{content:typeof H.content==="string"?H.content:H.choices?.[0]?.message?.content??"",finishReason:H.choices?.[0]?.finish_reason??"stop"}}function JX(H){let X=H??{},{content:Z,finishReason:$}=PH(X),J=X.usage??{},K=J.prompt_tokens??0,z=J.completion_tokens??0,Y="orch-"+Date.now().toString(36),V=Math.floor(Date.now()/1000),G=(S,E,R)=>{let C={id:Y,object:"chat.completion.chunk",created:V,model:"orchestrated",choices:[{index:0,delta:S,finish_reason:E}]};if(R)C.usage=R;return`data: ${JSON.stringify(C)}
25
+
26
+ `},D={prompt_tokens:K,completion_tokens:z,total_tokens:J.total_tokens??K+z};if(typeof J.cost_usd==="number")D.cost_usd=J.cost_usd;if(typeof J.cost_credits==="number")D.cost_credits=J.cost_credits;if(typeof J.context_window==="number")D.context_window=J.context_window;let N=[G({role:"assistant",content:""},null),G({content:Z},null),G({},$,D),`data: [DONE]
27
+
28
+ `],F=new TextEncoder,L=new ReadableStream({start(S){for(let E of N)S.enqueue(F.encode(E));S.close()}});return new Response(L,{status:200,headers:{"content-type":"text/event-stream"}})}function LX(H){let X=H??{},{content:Z,finishReason:$}=PH(X),J=X.usage??{},K=J.prompt_tokens??0,z=J.completion_tokens??0,Y={id:"orch-"+Date.now(),object:"chat.completion",created:Math.floor(Date.now()/1000),model:"orchestrated",choices:[{index:0,message:{role:"assistant",content:Z},finish_reason:$}],usage:{prompt_tokens:K,completion_tokens:z,total_tokens:J.total_tokens??K+z,...typeof J.cost_usd==="number"?{cost_usd:J.cost_usd}:{},...typeof J.context_window==="number"?{context_window:J.context_window}:{}}};return new Response(JSON.stringify(Y),{status:200,headers:{"content-type":"application/json"}})}async function KX(H,X,Z){let $=qH(H,X),J=X?`HTTP ${H}: ${X}`:`HTTP ${H}`;switch(w.error("gateway rejected request",{tier:Z.tier,status:H,category:$.category,upstreamCode:$.upstreamCode,field:$.field,retryable:$.retryable}),$.category){case"billing":return new _H(X||void 0,$);case"rate_limited":return new UH($);case"gateway_routing":return new v(`HTTP ${H}`,$);case"invalid_credentials":return await Z.onInvalidCredentials?.().catch(()=>{}),new FH(J,$);case"request_too_large":return new m("irreducible",$.upstreamMessage??X??void 0,$);case"request_rejected":case"tool_protocol":return new OH($.upstreamMessage??X??void 0,$.field,$);case"configuration":case"transient":case"unknown":default:return new v(J,$)}}function KH(H){let X=$H();if(X===void 0)return H;let Z=b(H);if(Z<=X)return H;let $=l(H,X);return w.warn("request over known size ceiling, reducing before send",{tier:H.tier,bytes:Z,ceiling:X,reducedBytes:$.bytes,fits:$.reduced,...$.actions}),$.bytes<Z?$.body:H}function zH(H){let X=b(H),Z=n(X),$=l(H,Z);if(!$.reduced)throw w.error("request too large and cannot be reduced further",{tier:H.tier,rejectedBytes:X,ceiling:Z,reducedBytes:$.bytes,...$.actions}),new m("irreducible");return w.warn("request too large, retrying once with reduced history",{tier:H.tier,rejectedBytes:X,ceiling:Z,reducedBytes:$.bytes,...$.actions,notice:Q.copy().requestTooLargeRecovering()}),$.body}function YH(H){let X=b(H);throw n(X),w.error("reduced request still too large",{tier:H.tier,rejectedBytes:X}),new m("after-reduction")}function zX(H,X=globalThis.fetch,Z,$){let J=$?.responseTimeoutMs??TH;return async(K,z)=>{if(z?.method==="POST"&&typeof z?.body==="string"){let Y;try{Y=JSON.parse(z.body)}catch{return X(K,z)}let V=oH(),G=tH(Y.model??"default"),D=JH(Y,{toolMode:V,outputAdvisory:G});if(cH(Y.messages)&&!mH(D.messages)){let{dropped:O}=MH(V==="text"?QH(Y.messages,Y.tools):Y.messages);throw w.error("refusing to send: user message lost in normalization",{tier:D.tier,toolMode:V,inputRoles:Array.isArray(Y.messages)?Y.messages.map((M)=>M&&typeof M==="object"?String(M.role):"?"):"not-an-array",droppedCount:O.length,dropped:O}),new LH("your message could not be turned into sendable content")}let N=await H(),F=typeof N==="string"?{key:N,method:"sso"}:N;if(!F?.key)throw new jH;let L=new Headers(z.headers),S=()=>{if(F.method==="api-key")L.delete("Authorization"),L.set("x-api-key",F.key);else L.delete("x-api-key"),L.set("Authorization",`Bearer ${F.key}`)};S(),L.set("Content-Type","application/json");let E=!1,R=async(O,M)=>{let _=qH(O,M),W=async()=>({retry:!1,error:await KX(O,M,{onInvalidCredentials:Z,tier:D.tier})});if(_.category!=="invalid_credentials"||E)return W();E=!0;let j=o(F),U=await NH(F);if(U.kind==="recovered"&&o(U.credential)!==j)return F=U.credential,S(),{retry:!0};if(U.kind==="inconclusive")return{retry:!1,error:new v(`HTTP ${O}: ${U.reason}`,_)};return W()};if(D.tier==="orchestrated"){let O=z.signal,M=async(j)=>{let U=new AbortController,k=()=>U.abort(O?.reason);if(O)if(O.aborted)U.abort(O.reason);else O.addEventListener("abort",k,{once:!0});let e=!1,kH=setTimeout(()=>{e=!0,U.abort()},J);try{return await X(AH,{method:"POST",headers:L,body:JSON.stringify(j),signal:U.signal})}catch(EH){if(e)throw new v(`no response within ${Math.round(J/1000)}s`);throw EH}finally{clearTimeout(kH),O?.removeEventListener("abort",k)}},_=KH(D),W=await M(_);if(W.status===413){if(await W.body?.cancel().catch(()=>{}),_=zH(_),W=await M(_),W.status===413)await W.body?.cancel().catch(()=>{}),YH(_)}while(!W.ok){let j=await W.text().catch(()=>""),U=await R(W.status,j);if(!U.retry)throw U.error;W=await M(_)}return JX(await W.json())}let C=z.signal,P=async(O)=>{let M=new AbortController,_=()=>M.abort(C?.reason);if(C)if(C.aborted)M.abort(C.reason);else C.addEventListener("abort",_,{once:!0});let W=()=>C?.removeEventListener("abort",_),j=!1,U=setTimeout(()=>{j=!0,M.abort()},J);try{return{res:await X(IH,{method:"POST",headers:L,body:JSON.stringify(O),signal:M.signal}),detach:W}}catch(k){if(W(),j)throw new v(`no response within ${Math.round(J/1000)}s`);throw k}finally{clearTimeout(U)}},A=KH(D),{res:q,detach:I}=await P(A);if(q.status===400&&V==="native"&&sH(Y))I(),await q.body?.cancel().catch(()=>{}),A=JH(Y,{toolMode:"text",outputAdvisory:G}),{res:q,detach:I}=await P(A);if(q.status===413){if(I(),await q.body?.cancel().catch(()=>{}),A=zH(A),{res:q,detach:I}=await P(A),q.status===413)I(),await q.body?.cancel().catch(()=>{}),YH(A)}try{while(!q.ok){let O=await q.text().catch(()=>""),M=await R(q.status,O);if(I(),!M.retry)throw M.error;({res:q,detach:I}=await P(A))}}catch(O){throw I(),O}if(Y.stream!==!1&&q.body){let O=Array.isArray(Y.tools)&&Y.tools.length>0;return new Response($X(q.body,{toolProtocolEnabled:O,tier:D.tier,requestedOutputBudget:D.opts.max_tokens}),{status:q.status,statusText:q.statusText,headers:{"content-type":"text/event-stream"}})}return q}return X(K,z)}}function qX(H){let X=H.getToken??(async()=>H.bearerToken),Z=zX(X,globalThis.fetch,H.onInvalidCredentials);return GH({name:H.name??"qlex",baseURL:Q.streamBaseUrl(),fetch:Z})}function MX(H,X){return u(H,X)!==void 0}var YX=2;function u(H,X){let Z=d.get(H),$=Z?.tierOutputLimit;if(!Z||!$)return;let J=X??Z.recommendedTotalTokens??Z.tierRecommendedStepTokens;if(!J||J>=$)return;let K=Z.recommendedTotalTokens??Z.tierRecommendedStepTokens??J,z=Math.min($,Math.max(J+1,J*YX,K));return z>J?z:void 0}export{$X as transformQlexStream,JX as toOrchestratedSSEStream,LX as toOpenAICompletion,FX as sanitizeUpstreamProviderError,oH as resolveToolMode,iH as renderToolProtocolPrompt,aH as recordTierOutputAdvisory,XX as partialTagSuffixLength,HX as parseQlexFrame,qH as parseQlexError,MH as normalizeQlexMessagesWithReport,uH as normalizeQlexMessages,dH as mergeLeadingSystemMessages,xH as isGatewayRequiredError,cH as hasUserRoleMessage,mH as hasUsableUserMessage,sH as hasToolContext,u as getTierOutputBudgetRecovery,tH as getTierOutputAdvisory,c as flattenMessageContent,QH as encodeToolProtocolMessages,ZX as encodeExtractedArguments,s as decodeToolArgumentsToObject,qX as createQlexProvider,zX as createCustomFetch,OX as clearTierOutputAdvisories,bH as classifyQlexStreamError,MX as canIncreaseTierOutputBudget,JH as buildQlexBody,SH as ToolCallExtractor,g as TOOL_CALL_OPEN,p as TOOL_CALL_CLOSE,h as QlexStreamError,m as QlexRequestTooLargeError,OH as QlexRequestRejectedError,LH as QlexRequestNotSentError,UH as QlexRateLimitError,jH as QlexNotLoggedInError,FH as QlexInvalidCredentialsError,_H as QlexInsufficientBalanceError,v as QlexGatewayError,IH as QLEX_STREAM_URL,TH as QLEX_RESPONSE_TIMEOUT_MS,AH as QLEX_ORCHESTRATED_URL};