@qitqode/qitqode-android-arm64 0.2.7 → 0.2.9

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 (387) hide show
  1. package/bundle/{chunk-ga6wc979.js → chunk-03zpnwk2.js} +1 -1
  2. package/bundle/{chunk-qdvnscxm.js → chunk-0a4pmkc9.js} +1 -1
  3. package/bundle/chunk-0aqdzyar.js +2 -0
  4. package/bundle/{chunk-drnj1a14.js → chunk-0egrckx0.js} +1 -1
  5. package/bundle/{chunk-aqcpk2vg.js → chunk-0eh3yc6e.js} +1 -1
  6. package/bundle/{chunk-14d301ze.js → chunk-0mh600tv.js} +1 -1
  7. package/bundle/{chunk-yd94wz5v.js → chunk-0s4cp6q2.js} +1 -1
  8. package/bundle/{chunk-368jx5dp.js → chunk-0tcggtwv.js} +1 -1
  9. package/bundle/{chunk-0qpqd7nz.js → chunk-0tm6589k.js} +2 -2
  10. package/bundle/{chunk-0gsw04hw.js → chunk-0w19vmd7.js} +2 -2
  11. package/bundle/{chunk-j6xmgn63.js → chunk-0z1keh2w.js} +1 -1
  12. package/bundle/{chunk-djqxbnwc.js → chunk-13jq2ygc.js} +1 -1
  13. package/bundle/{chunk-znmbfx70.js → chunk-1a6q1f5n.js} +1 -1
  14. package/bundle/{chunk-w43kmnm9.js → chunk-1acn5me8.js} +357 -357
  15. package/bundle/{chunk-aa2n02qk.js → chunk-1bxfzd6r.js} +2 -2
  16. package/bundle/{chunk-hrtze4c5.js → chunk-1har4t9a.js} +1 -1
  17. package/bundle/{chunk-33jcxsbe.js → chunk-1p9s5jj1.js} +1 -1
  18. package/bundle/{chunk-p40z6510.js → chunk-1v0khv7p.js} +1 -1
  19. package/bundle/{chunk-eeq0krp7.js → chunk-27saej0r.js} +2 -2
  20. package/bundle/{chunk-ppy0jy6j.js → chunk-29gwtcey.js} +1 -1
  21. package/bundle/{chunk-yjqww6ag.js → chunk-29q89bge.js} +2 -2
  22. package/bundle/chunk-2a5gjgvp.js +2 -0
  23. package/bundle/{chunk-bn71wqqf.js → chunk-2caaqmec.js} +1 -1
  24. package/bundle/{chunk-hhk2sp5n.js → chunk-2kh0tg92.js} +1 -1
  25. package/bundle/{chunk-bd505nsd.js → chunk-2nheahmq.js} +1 -1
  26. package/bundle/{chunk-42q8vj0w.js → chunk-2phyc1c0.js} +1 -1
  27. package/bundle/chunk-2pkfphgb.js +2 -0
  28. package/bundle/{chunk-4fy08jcj.js → chunk-2vaphpz0.js} +1 -1
  29. package/bundle/{chunk-qbrj9wzd.js → chunk-30wp95w1.js} +1 -1
  30. package/bundle/chunk-32fpqd0n.js +2 -0
  31. package/bundle/{chunk-yxttz5z5.js → chunk-35fj1sfm.js} +1 -1
  32. package/bundle/{chunk-1vpx7szf.js → chunk-3bb4aqh9.js} +1 -1
  33. package/bundle/chunk-3f2cjzb4.js +2 -0
  34. package/bundle/chunk-3qvap1kv.js +2 -0
  35. package/bundle/{chunk-c8prg3jx.js → chunk-3va85mbe.js} +2 -2
  36. package/bundle/{chunk-wvb17w0z.js → chunk-3z2zn8rj.js} +1 -1
  37. package/bundle/{chunk-84pjdenq.js → chunk-42hvspe7.js} +1 -1
  38. package/bundle/chunk-452tk6v3.js +2 -0
  39. package/bundle/{chunk-w3zhy5vq.js → chunk-48gap82w.js} +1 -1
  40. package/bundle/{chunk-4ftjx7ss.js → chunk-4gqb1hps.js} +1 -1
  41. package/bundle/{chunk-gww0skmn.js → chunk-4pmvxnkj.js} +1 -1
  42. package/bundle/chunk-4y9wbfd2.js +8 -0
  43. package/bundle/chunk-50qgz5ka.js +2 -0
  44. package/bundle/{chunk-4zhrg3rv.js → chunk-52xvhxek.js} +1 -1
  45. package/bundle/chunk-539cw9r0.js +2 -0
  46. package/bundle/{chunk-nfzpegqx.js → chunk-53jstmdp.js} +1 -1
  47. package/bundle/{chunk-8hmt3avx.js → chunk-56wq8cqj.js} +1 -1
  48. package/bundle/{chunk-mbbxedsq.js → chunk-59csnjc3.js} +2 -2
  49. package/bundle/chunk-5b0xyq5z.js +2 -0
  50. package/bundle/{chunk-0ggvqmnm.js → chunk-5bv63rqj.js} +1 -1
  51. package/bundle/{chunk-vfb72vdy.js → chunk-5cw8235e.js} +1 -1
  52. package/bundle/chunk-5j4nxpdy.js +2 -0
  53. package/bundle/chunk-5nxgk6hw.js +2 -0
  54. package/bundle/chunk-5qkvhr6y.js +2 -0
  55. package/bundle/{chunk-5zh91zk2.js → chunk-5r7c6vvx.js} +1 -1
  56. package/bundle/{chunk-c6cajbyj.js → chunk-5wx962mw.js} +1 -1
  57. package/bundle/{chunk-7sq5dyv1.js → chunk-5xkp27b1.js} +1 -1
  58. package/bundle/chunk-6dpdkzrk.js +2 -0
  59. package/bundle/chunk-6p6m5956.js +3 -0
  60. package/bundle/{chunk-n4qxj391.js → chunk-6ps30qax.js} +1 -1
  61. package/bundle/{chunk-kmzpeq8k.js → chunk-6tqbnxar.js} +1 -1
  62. package/bundle/{chunk-b6eypnbj.js → chunk-6vnqbejg.js} +1 -1
  63. package/bundle/{chunk-ghap1n1m.js → chunk-702bt91p.js} +4 -4
  64. package/bundle/{chunk-2c26kxp4.js → chunk-705qkpra.js} +1 -1
  65. package/bundle/{chunk-2pex3ak9.js → chunk-72crs18f.js} +1 -1
  66. package/bundle/chunk-76c400ze.js +2 -0
  67. package/bundle/{chunk-mghnkwp8.js → chunk-7adsab4h.js} +1 -1
  68. package/bundle/{chunk-n0g4983e.js → chunk-7bxxc4a3.js} +1 -1
  69. package/bundle/chunk-7g59hc61.js +2 -0
  70. package/bundle/{chunk-52rdms56.js → chunk-7jy53zqy.js} +1 -1
  71. package/bundle/chunk-7p88j56s.js +2 -0
  72. package/bundle/{chunk-5b3v1x2c.js → chunk-7pckez5z.js} +2 -2
  73. package/bundle/{chunk-q6p92zyn.js → chunk-7r92d7v9.js} +1 -1
  74. package/bundle/{chunk-t4b2fm7z.js → chunk-7thhd7ds.js} +1 -1
  75. package/bundle/chunk-7trngc9g.js +2 -0
  76. package/bundle/{chunk-4fvbexr8.js → chunk-85wh85pk.js} +1 -1
  77. package/bundle/chunk-8cebbmtf.js +2 -0
  78. package/bundle/chunk-8j1xcdmd.js +2 -0
  79. package/bundle/{chunk-ntpn0w9m.js → chunk-8jmb5bd4.js} +2 -2
  80. package/bundle/{chunk-pf3nqf00.js → chunk-8ysp6vf8.js} +1 -1
  81. package/bundle/{chunk-3k7016c2.js → chunk-8yzghzjq.js} +1 -1
  82. package/bundle/chunk-90r2z49k.js +2 -0
  83. package/bundle/{chunk-amp6mvbp.js → chunk-92r1gw2j.js} +1 -1
  84. package/bundle/{chunk-ktp2b4t4.js → chunk-94mjwy22.js} +1 -1
  85. package/bundle/{chunk-y5q9v80n.js → chunk-9bw6bx5c.js} +1 -1
  86. package/bundle/{chunk-f84hw65n.js → chunk-9cf2ktyh.js} +1 -1
  87. package/bundle/{chunk-x55h5qdc.js → chunk-a1z8rnq7.js} +3 -3
  88. package/bundle/{chunk-c3szabpf.js → chunk-a48mx917.js} +2 -2
  89. package/bundle/{chunk-prbxhnza.js → chunk-a8bjcvda.js} +1 -1
  90. package/bundle/chunk-aenrd7dk.js +2 -0
  91. package/bundle/{chunk-dw70wds9.js → chunk-afr8m0q1.js} +1 -1
  92. package/bundle/{chunk-7p6mxch0.js → chunk-ag8wxwwz.js} +1 -1
  93. package/bundle/{chunk-22qetqnp.js → chunk-ahmy80vb.js} +1 -1
  94. package/bundle/chunk-avn12jkt.js +2 -0
  95. package/bundle/{chunk-tc9xbn1t.js → chunk-ax64ngf2.js} +1 -1
  96. package/bundle/{chunk-0crgymtr.js → chunk-az3nss5m.js} +2 -2
  97. package/bundle/{chunk-73xryfgn.js → chunk-b5ym419d.js} +2 -2
  98. package/bundle/{chunk-dt1wwt7m.js → chunk-b7sr9rn3.js} +1 -1
  99. package/bundle/{chunk-9qzwmt76.js → chunk-bc2krtaf.js} +1 -1
  100. package/bundle/{chunk-jxkrhrp0.js → chunk-bhg69t69.js} +1 -1
  101. package/bundle/{chunk-ns8xnkjb.js → chunk-bkfafcbw.js} +1 -1
  102. package/bundle/{chunk-tkzctbxq.js → chunk-bnw744ej.js} +2 -2
  103. package/bundle/{chunk-twvmjsxf.js → chunk-bpfq8fz4.js} +1 -1
  104. package/bundle/chunk-brk6bge4.js +3 -0
  105. package/bundle/{chunk-s06t769q.js → chunk-bwadggys.js} +1 -1
  106. package/bundle/{chunk-spzd8rev.js → chunk-c76cjhn0.js} +1 -1
  107. package/bundle/{chunk-abv0fskc.js → chunk-c987bemn.js} +1 -1
  108. package/bundle/{chunk-705xnxbc.js → chunk-ccf4pgkr.js} +1 -1
  109. package/bundle/chunk-ce5e7j62.js +2 -0
  110. package/bundle/{chunk-2bjfz4fb.js → chunk-cf9m9m9q.js} +1 -1
  111. package/bundle/{chunk-z7kswv9r.js → chunk-cfwz1hgr.js} +3 -3
  112. package/bundle/{chunk-dgva3y5v.js → chunk-cghz0855.js} +1 -1
  113. package/bundle/{chunk-a76w2jwm.js → chunk-cr5tknvb.js} +1 -1
  114. package/bundle/chunk-cw1gwjx9.js +2 -0
  115. package/bundle/chunk-czw30fjs.js +2 -0
  116. package/bundle/{chunk-x80d0zh7.js → chunk-d30k7dpf.js} +1 -1
  117. package/bundle/{chunk-x9fyt3vx.js → chunk-d839fr0w.js} +1 -1
  118. package/bundle/{chunk-q87fw8dk.js → chunk-dcv6wj9x.js} +1 -1
  119. package/bundle/{chunk-4byvnx78.js → chunk-dgcannw0.js} +1 -1
  120. package/bundle/{chunk-4rpgwgx9.js → chunk-dhvx9p54.js} +1 -1
  121. package/bundle/{chunk-z744mz4w.js → chunk-dt3bsmfe.js} +2 -2
  122. package/bundle/chunk-dtcvqrmn.js +2 -0
  123. package/bundle/chunk-dwhsvpag.js +2 -0
  124. package/bundle/{chunk-4j76bf4j.js → chunk-dwkrqtbc.js} +1 -1
  125. package/bundle/{chunk-vzrc2fmt.js → chunk-dwqvcdmf.js} +1 -1
  126. package/bundle/chunk-e0hfpdje.js +2 -0
  127. package/bundle/{chunk-ajp53ksp.js → chunk-e0hha3be.js} +1 -1
  128. package/bundle/{chunk-f2pv705d.js → chunk-e0vrxetq.js} +1 -1
  129. package/bundle/{chunk-59kk0mce.js → chunk-e2wfj86b.js} +1 -1
  130. package/bundle/chunk-e5jk67xh.js +2 -0
  131. package/bundle/{chunk-ae7b11np.js → chunk-eacpc64g.js} +2 -2
  132. package/bundle/{chunk-hqjc4wgg.js → chunk-eewe7tx1.js} +2 -2
  133. package/bundle/{chunk-etv6c77a.js → chunk-eg1m81ax.js} +1 -1
  134. package/bundle/chunk-eg4pq4hv.js +2 -0
  135. package/bundle/{chunk-9xxnwb33.js → chunk-ejhhrece.js} +3 -3
  136. package/bundle/chunk-ew3yz97p.js +2 -0
  137. package/bundle/{chunk-19pspc1p.js → chunk-f2v4g7t1.js} +1 -1
  138. package/bundle/chunk-f2yfyhh8.js +2 -0
  139. package/bundle/{chunk-vp3yf46q.js → chunk-fa8pwdwv.js} +1 -1
  140. package/bundle/{chunk-vhzx5bxd.js → chunk-fd8x2nb4.js} +1 -1
  141. package/bundle/{chunk-dz3bec8g.js → chunk-fej5x648.js} +1 -1
  142. package/bundle/{chunk-0tqmm8b8.js → chunk-fh3d0wce.js} +1 -1
  143. package/bundle/{chunk-twd6r7nf.js → chunk-fjftb2sz.js} +1 -1
  144. package/bundle/{chunk-xhh70g8j.js → chunk-fs1vb39f.js} +2 -2
  145. package/bundle/{chunk-9g9katgy.js → chunk-ftvvm4r5.js} +2 -2
  146. package/bundle/chunk-fv5mrdyc.js +5 -0
  147. package/bundle/{chunk-gdew7bwm.js → chunk-fveaq0pb.js} +1 -1
  148. package/bundle/{chunk-ptwex14s.js → chunk-fw1f47de.js} +1 -1
  149. package/bundle/{chunk-y2t5pmqw.js → chunk-g26redah.js} +1 -1
  150. package/bundle/{chunk-acd72413.js → chunk-g3n465ee.js} +1 -1
  151. package/bundle/{chunk-hfefq104.js → chunk-g4tyaj0m.js} +1 -1
  152. package/bundle/{chunk-a610qd3x.js → chunk-g6y2c5az.js} +1 -1
  153. package/bundle/{chunk-tezrgfc6.js → chunk-g7v6sp3c.js} +2 -2
  154. package/bundle/{chunk-4bewbvvr.js → chunk-g878zd6e.js} +1 -1
  155. package/bundle/{chunk-na1wr2qf.js → chunk-g9nwqwqp.js} +1 -1
  156. package/bundle/chunk-gbvm6dpv.js +2 -0
  157. package/bundle/{chunk-xcxqt8ag.js → chunk-ggncq8w8.js} +1 -1
  158. package/bundle/chunk-gkbx6edf.js +2 -0
  159. package/bundle/{chunk-skxg3s8z.js → chunk-gq9hb2e8.js} +1 -1
  160. package/bundle/{chunk-gwrnxcdn.js → chunk-gsg6zn7e.js} +1 -1
  161. package/bundle/{chunk-v3nmnm57.js → chunk-gswhjd1h.js} +2 -2
  162. package/bundle/{chunk-4jpab7ag.js → chunk-gznt3dv8.js} +1 -1
  163. package/bundle/{chunk-defj5zs6.js → chunk-h1bvqstw.js} +1 -1
  164. package/bundle/chunk-h5w91zr4.js +2 -0
  165. package/bundle/{chunk-qp3hxqg5.js → chunk-h8mfbbjh.js} +1 -1
  166. package/bundle/chunk-hmpb3c21.js +2 -0
  167. package/bundle/chunk-hq7s4f75.js +2 -0
  168. package/bundle/{chunk-6gqs1k7m.js → chunk-hz02vrqs.js} +1 -1
  169. package/bundle/{chunk-3xdmxm5t.js → chunk-j10a984e.js} +1 -1
  170. package/bundle/chunk-j1h64m65.js +2 -0
  171. package/bundle/chunk-j32rr7rt.js +2 -0
  172. package/bundle/chunk-j871xzr7.js +2 -0
  173. package/bundle/{chunk-kfj37631.js → chunk-jmmtcr2r.js} +1 -1
  174. package/bundle/{chunk-h7658zxy.js → chunk-jpn9zfj5.js} +1 -1
  175. package/bundle/{chunk-wgt1tqw9.js → chunk-jqj1ay7x.js} +1 -1
  176. package/bundle/{chunk-e4g4mvak.js → chunk-jr80q31w.js} +1 -1
  177. package/bundle/{chunk-9a6p1gdn.js → chunk-k1qd8ecm.js} +7 -7
  178. package/bundle/{chunk-8jvfqh3b.js → chunk-k3m7jfdh.js} +1 -1
  179. package/bundle/{chunk-gbxf6e5d.js → chunk-k6981ysw.js} +3 -3
  180. package/bundle/{chunk-k6zwfstj.js → chunk-kckr30tf.js} +1 -1
  181. package/bundle/{chunk-8rfqv5he.js → chunk-kgv68cpb.js} +1 -1
  182. package/bundle/{chunk-55way0em.js → chunk-kveztc6k.js} +1 -1
  183. package/bundle/chunk-kx88qekb.js +2 -0
  184. package/bundle/chunk-m4g4djss.js +2 -0
  185. package/bundle/{chunk-nbckdba0.js → chunk-m4r8sepw.js} +1 -1
  186. package/bundle/{chunk-6ychs4wx.js → chunk-m7tmgvh6.js} +1 -1
  187. package/bundle/{chunk-npzx3yd5.js → chunk-maa21rh9.js} +1 -1
  188. package/bundle/{chunk-egkhynj5.js → chunk-makegrxs.js} +1 -1
  189. package/bundle/{chunk-438faz6b.js → chunk-mr17tppa.js} +1 -1
  190. package/bundle/{chunk-4ngmjk8j.js → chunk-mrq35ftw.js} +1 -1
  191. package/bundle/{chunk-9aafddkw.js → chunk-mt2by7rx.js} +1 -1
  192. package/bundle/{chunk-yzpc5kj2.js → chunk-mv7q6ach.js} +1 -1
  193. package/bundle/chunk-mwkms65j.js +3 -0
  194. package/bundle/chunk-n61e0znt.js +2 -0
  195. package/bundle/{chunk-kry4vcrf.js → chunk-n6tqtk6h.js} +2 -2
  196. package/bundle/{chunk-k3g28tbw.js → chunk-nas631g2.js} +1 -1
  197. package/bundle/chunk-ndd4cn3z.js +2 -0
  198. package/bundle/{chunk-dd4qnh8s.js → chunk-nsp1za8t.js} +1 -1
  199. package/bundle/chunk-nsw5x43k.js +2 -0
  200. package/bundle/{chunk-bk7f59fn.js → chunk-ntr0ezf2.js} +1 -1
  201. package/bundle/{chunk-cth373se.js → chunk-p2fte9vz.js} +2 -2
  202. package/bundle/chunk-p5b5ekhh.js +2 -0
  203. package/bundle/chunk-pf23nw4z.js +2 -0
  204. package/bundle/{chunk-whw18cn9.js → chunk-phf37x1c.js} +1 -1
  205. package/bundle/{chunk-r73e8gsp.js → chunk-phpxxd48.js} +1 -1
  206. package/bundle/{chunk-1ay97v74.js → chunk-pqg1wjb5.js} +1 -1
  207. package/bundle/chunk-pw3cv89g.js +2 -0
  208. package/bundle/{chunk-0am156m5.js → chunk-qbnt4ynd.js} +1 -1
  209. package/bundle/{chunk-mjrqhbp2.js → chunk-qgek59e6.js} +1 -1
  210. package/bundle/{chunk-v9w88wpy.js → chunk-qgkb6n8k.js} +1 -1
  211. package/bundle/{chunk-2c41dncf.js → chunk-qk1jkc0n.js} +1 -1
  212. package/bundle/{chunk-wb1d3mqw.js → chunk-qk5vy2pr.js} +1 -1
  213. package/bundle/{chunk-r4kg0z96.js → chunk-qsme16gk.js} +1 -1
  214. package/bundle/{chunk-d1tb1jd0.js → chunk-qwmae3vk.js} +1 -1
  215. package/bundle/chunk-rdk62809.js +2 -0
  216. package/bundle/{chunk-5r05d901.js → chunk-rdreeyv0.js} +2 -2
  217. package/bundle/chunk-rew6r516.js +2 -0
  218. package/bundle/{chunk-0bgssfvq.js → chunk-rjcz4kbm.js} +1 -1
  219. package/bundle/chunk-rmsqb6r4.js +10 -0
  220. package/bundle/{chunk-qph2c2v7.js → chunk-rva2ekrt.js} +1 -1
  221. package/bundle/{chunk-7z96r2px.js → chunk-rwnwjm82.js} +1 -1
  222. package/bundle/{chunk-ts2k13g0.js → chunk-rwwvy89t.js} +1 -1
  223. package/bundle/{chunk-tz3s8dvy.js → chunk-rye1yjnr.js} +1 -1
  224. package/bundle/{chunk-t9qyzzsz.js → chunk-ryrxgn6d.js} +1 -1
  225. package/bundle/{chunk-wjz42325.js → chunk-s2tc3qs0.js} +2 -2
  226. package/bundle/{chunk-p847g35y.js → chunk-s5aefff0.js} +1 -1
  227. package/bundle/{chunk-msh249db.js → chunk-sa0rrreh.js} +2 -2
  228. package/bundle/{chunk-dbpkq7ba.js → chunk-sbjymf20.js} +2 -2
  229. package/bundle/{chunk-n5p7cn4w.js → chunk-scnbt714.js} +1 -1
  230. package/bundle/chunk-skgr9ypq.js +2 -0
  231. package/bundle/{chunk-rhrcgvb8.js → chunk-sm1g81cv.js} +1 -1
  232. package/bundle/chunk-sv40pwe2.js +2 -0
  233. package/bundle/{chunk-qprbef09.js → chunk-sy9w1t2y.js} +1 -1
  234. package/bundle/{chunk-bd84t3fb.js → chunk-sz0favtz.js} +1 -1
  235. package/bundle/{chunk-xb3sxa6f.js → chunk-t18ka1e7.js} +1 -1
  236. package/bundle/{chunk-va2qfh0x.js → chunk-t3w43rft.js} +1 -1
  237. package/bundle/{chunk-n9twhc5d.js → chunk-t6zz47zk.js} +1 -1
  238. package/bundle/{chunk-wd8hbven.js → chunk-t8fjgkp8.js} +1 -1
  239. package/bundle/chunk-tax3ecy5.js +2 -0
  240. package/bundle/{chunk-6r48fje7.js → chunk-tbx741en.js} +1 -1
  241. package/bundle/chunk-tfhpjmny.js +2 -0
  242. package/bundle/{chunk-2cjfezfr.js → chunk-tk4z6r09.js} +1 -1
  243. package/bundle/chunk-tnete6ye.js +2 -0
  244. package/bundle/{chunk-2y87m7pe.js → chunk-tpyq7ycb.js} +1 -1
  245. package/bundle/chunk-tr0rm1ka.js +2 -0
  246. package/bundle/{chunk-nftbj8g9.js → chunk-trstb8ee.js} +1 -1
  247. package/bundle/{chunk-77h8tytk.js → chunk-ty14zznd.js} +1 -1
  248. package/bundle/chunk-v5h5wxw5.js +2 -0
  249. package/bundle/chunk-v6141yq1.js +2 -0
  250. package/bundle/{chunk-vjn54xj5.js → chunk-vbfej8ds.js} +2 -2
  251. package/bundle/{chunk-5nhwqg7c.js → chunk-vd8cmdpv.js} +1 -1
  252. package/bundle/{chunk-76h0f86f.js → chunk-vgt3artc.js} +1 -1
  253. package/bundle/chunk-vjs69r6x.js +2 -0
  254. package/bundle/{chunk-yy7r3t3w.js → chunk-vkkz40je.js} +1 -1
  255. package/bundle/chunk-vmhar83s.js +2 -0
  256. package/bundle/{chunk-zp5sr5nx.js → chunk-vph4w4yy.js} +1 -1
  257. package/bundle/chunk-vpjyk76v.js +2 -0
  258. package/bundle/chunk-vqvnw12p.js +2 -0
  259. package/bundle/{chunk-0g0jpw0z.js → chunk-vr8nwzp0.js} +1 -1
  260. package/bundle/{chunk-nrk29616.js → chunk-vs3s49jw.js} +1 -1
  261. package/bundle/{chunk-v0c3k797.js → chunk-vsqvnxbz.js} +1 -1
  262. package/bundle/{chunk-rqedtjz9.js → chunk-w0nc0gcx.js} +1 -1
  263. package/bundle/chunk-w0sztk4y.js +2 -0
  264. package/bundle/chunk-w6bb320d.js +2 -0
  265. package/bundle/{chunk-t8sy5sgx.js → chunk-w7a33cwa.js} +2 -2
  266. package/bundle/{chunk-agqss9ga.js → chunk-wb47k8ah.js} +2 -2
  267. package/bundle/{chunk-rfzra502.js → chunk-wd8f9r4k.js} +1 -1
  268. package/bundle/{chunk-hwsqqkrv.js → chunk-wgkcyqn1.js} +2 -2
  269. package/bundle/{chunk-dy2k5rdx.js → chunk-wm9nh9nb.js} +2 -2
  270. package/bundle/{chunk-6nxebcf8.js → chunk-wn63q3xp.js} +1 -1
  271. package/bundle/{chunk-z6kcnpsj.js → chunk-wqk1v8t0.js} +2 -2
  272. package/bundle/chunk-wqw6yjrg.js +2 -0
  273. package/bundle/{chunk-q3pt4p9f.js → chunk-wr6rnxr5.js} +1 -1
  274. package/bundle/chunk-ws08rxge.js +2 -0
  275. package/bundle/{chunk-dw7yrk1g.js → chunk-wtt5wms9.js} +1 -1
  276. package/bundle/{chunk-93pmbdz7.js → chunk-wtxh5m6j.js} +6 -6
  277. package/bundle/{chunk-q6mcnq9p.js → chunk-wwvek9zf.js} +1 -1
  278. package/bundle/chunk-wz3dvc3g.js +2 -0
  279. package/bundle/chunk-x2pmqvdc.js +2 -0
  280. package/bundle/chunk-x4wfq39v.js +2 -0
  281. package/bundle/chunk-x7a3kqe5.js +2 -0
  282. package/bundle/chunk-xb22grz6.js +2 -0
  283. package/bundle/{chunk-3623jvcm.js → chunk-xy8arehp.js} +1 -1
  284. package/bundle/{chunk-16srrzjr.js → chunk-y31f8k5f.js} +1 -1
  285. package/bundle/chunk-y3eeva80.js +2 -0
  286. package/bundle/{chunk-mhxyv9c8.js → chunk-y3gy62q5.js} +1 -1
  287. package/bundle/chunk-yb6m08zj.js +2 -0
  288. package/bundle/{chunk-b79z8f94.js → chunk-ybcqkgs7.js} +1 -1
  289. package/bundle/{chunk-95am490c.js → chunk-ydgst3h8.js} +2 -2
  290. package/bundle/{chunk-twfvrafb.js → chunk-ykpj10nz.js} +1 -1
  291. package/bundle/{chunk-e0zb6sw6.js → chunk-ynf17943.js} +1 -1
  292. package/bundle/{chunk-01e3v1xz.js → chunk-z0kbyr00.js} +2 -2
  293. package/bundle/{chunk-4vzjdmts.js → chunk-zfrftgcy.js} +1 -1
  294. package/bundle/chunk-zj1jc1xt.js +2 -0
  295. package/bundle/{chunk-9sv53kb4.js → chunk-zm0m0504.js} +1 -1
  296. package/bundle/chunk-zq32jhj1.js +2 -0
  297. package/bundle/{chunk-gdj7mqrd.js → chunk-zqdjk4rf.js} +1 -1
  298. package/bundle/{chunk-7x2q1w0f.js → chunk-zsg29gba.js} +1 -1
  299. package/bundle/{chunk-1c0yp2gv.js → chunk-zwhmg9dj.js} +1 -1
  300. package/bundle/chunk-zxwjxszn.js +2 -0
  301. package/bundle/index.js +3 -3
  302. package/bundle/parser.worker.js +2 -2
  303. package/bundle/worker.js +1 -1
  304. package/package.json +1 -1
  305. package/bundle/chunk-0dzpjk7x.js +0 -2
  306. package/bundle/chunk-12fwmmcp.js +0 -2
  307. package/bundle/chunk-1a95ysv3.js +0 -2
  308. package/bundle/chunk-1akh8pk2.js +0 -2
  309. package/bundle/chunk-2d2a92kj.js +0 -2
  310. package/bundle/chunk-2qrvkef8.js +0 -2
  311. package/bundle/chunk-2tppw8j9.js +0 -2
  312. package/bundle/chunk-3ft1dn9j.js +0 -2
  313. package/bundle/chunk-3rgct4bd.js +0 -11
  314. package/bundle/chunk-4656qm05.js +0 -2
  315. package/bundle/chunk-46knch5z.js +0 -2
  316. package/bundle/chunk-4sgy87h5.js +0 -2
  317. package/bundle/chunk-54hktc8h.js +0 -2
  318. package/bundle/chunk-59m55866.js +0 -2
  319. package/bundle/chunk-5js5nw7r.js +0 -2
  320. package/bundle/chunk-61jn7908.js +0 -2
  321. package/bundle/chunk-61txdqz1.js +0 -2
  322. package/bundle/chunk-668g9wkg.js +0 -2
  323. package/bundle/chunk-6frhjpmt.js +0 -2
  324. package/bundle/chunk-6k14c8x1.js +0 -5
  325. package/bundle/chunk-6r1jpj0h.js +0 -2
  326. package/bundle/chunk-73fn4dqd.js +0 -2
  327. package/bundle/chunk-78j2c2je.js +0 -2
  328. package/bundle/chunk-78jt24ht.js +0 -2
  329. package/bundle/chunk-7j2vpavd.js +0 -2
  330. package/bundle/chunk-7nkxgm72.js +0 -2
  331. package/bundle/chunk-859pkecc.js +0 -2
  332. package/bundle/chunk-8p249svd.js +0 -2
  333. package/bundle/chunk-8rqbx4jw.js +0 -2
  334. package/bundle/chunk-8s3krfsm.js +0 -2
  335. package/bundle/chunk-9wbe0dkx.js +0 -2
  336. package/bundle/chunk-aj5z8qd5.js +0 -2
  337. package/bundle/chunk-b0c2mvc0.js +0 -2
  338. package/bundle/chunk-bbwcsdy9.js +0 -2
  339. package/bundle/chunk-bbzjdbb9.js +0 -2
  340. package/bundle/chunk-bh4s1yct.js +0 -2
  341. package/bundle/chunk-crqcppwq.js +0 -2
  342. package/bundle/chunk-d09zpgj1.js +0 -2
  343. package/bundle/chunk-dexcptaz.js +0 -3
  344. package/bundle/chunk-dgqkak21.js +0 -2
  345. package/bundle/chunk-dhgvh7c3.js +0 -2
  346. package/bundle/chunk-dmd101ja.js +0 -2
  347. package/bundle/chunk-dwb39jdf.js +0 -2
  348. package/bundle/chunk-dx4zxex7.js +0 -2
  349. package/bundle/chunk-e2pqvscp.js +0 -2
  350. package/bundle/chunk-efe6kj3d.js +0 -2
  351. package/bundle/chunk-emac0dss.js +0 -2
  352. package/bundle/chunk-encfnt6w.js +0 -2
  353. package/bundle/chunk-fg2nyz2x.js +0 -2
  354. package/bundle/chunk-ge19ff9d.js +0 -2
  355. package/bundle/chunk-gt0q07xq.js +0 -2
  356. package/bundle/chunk-h4dnjfr2.js +0 -2
  357. package/bundle/chunk-h8fx619t.js +0 -2
  358. package/bundle/chunk-jnvb3s7f.js +0 -2
  359. package/bundle/chunk-jrq2xw6e.js +0 -2
  360. package/bundle/chunk-jwckmhjm.js +0 -2
  361. package/bundle/chunk-jz27ypm5.js +0 -2
  362. package/bundle/chunk-jzrs878d.js +0 -2
  363. package/bundle/chunk-jzx700tb.js +0 -2
  364. package/bundle/chunk-k1x8469r.js +0 -3
  365. package/bundle/chunk-m483jvn8.js +0 -2
  366. package/bundle/chunk-makecdh6.js +0 -8
  367. package/bundle/chunk-menbcmkq.js +0 -2
  368. package/bundle/chunk-np8h66t0.js +0 -2
  369. package/bundle/chunk-nwwmns3w.js +0 -2
  370. package/bundle/chunk-pe5dpzec.js +0 -2
  371. package/bundle/chunk-q8f6a074.js +0 -2
  372. package/bundle/chunk-qqaevt32.js +0 -2
  373. package/bundle/chunk-qzpvz708.js +0 -2
  374. package/bundle/chunk-reyjr2e0.js +0 -2
  375. package/bundle/chunk-t178njgb.js +0 -2
  376. package/bundle/chunk-tjpev5t6.js +0 -2
  377. package/bundle/chunk-tzq7wjgv.js +0 -3
  378. package/bundle/chunk-v1s16wwd.js +0 -2
  379. package/bundle/chunk-v6b29nx4.js +0 -2
  380. package/bundle/chunk-v6rgd1j5.js +0 -2
  381. package/bundle/chunk-v9dnetq8.js +0 -2
  382. package/bundle/chunk-vd5mpvcc.js +0 -2
  383. package/bundle/chunk-wwct4z7j.js +0 -2
  384. package/bundle/chunk-xr9wz961.js +0 -2
  385. package/bundle/chunk-zfegnt1e.js +0 -2
  386. package/bundle/chunk-zg7kesbp.js +0 -2
  387. package/bundle/chunk-zy06fe4r.js +0 -2
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{be as q}from"./chunk-f4mnp6xd.js";import{eg as v}from"./chunk-s06t769q.js";import{Ch as S}from"./chunk-w43kmnm9.js";import"./chunk-nrk29616.js";import"./chunk-kre93a89.js";import"./chunk-060wbpz4.js";import"./chunk-zrhw1szj.js";import"./chunk-wd8hbven.js";import"./chunk-drnj1a14.js";import"./chunk-9a6p1gdn.js";import"./chunk-jxkrhrp0.js";import{Fl as Q,Ol as H}from"./chunk-6k14c8x1.js";import"./chunk-5r05d901.js";import"./chunk-3rgct4bd.js";import"./chunk-5b3v1x2c.js";import"./chunk-gbxf6e5d.js";import"./chunk-msh249db.js";import"./chunk-95am490c.js";import"./chunk-kmzpeq8k.js";import"./chunk-0gsw04hw.js";import"./chunk-hqjc4wgg.js";import"./chunk-makecdh6.js";import"./chunk-dy2k5rdx.js";import"./chunk-n5p7cn4w.js";import"./chunk-cqtkxwd8.js";import"./chunk-mhxyv9c8.js";import"./chunk-0crgymtr.js";import"./chunk-cth373se.js";import"./chunk-xcxqt8ag.js";import"./chunk-va2qfh0x.js";import"./chunk-ae7b11np.js";import"./chunk-eeq0krp7.js";import"./chunk-73xryfgn.js";import"./chunk-yjqww6ag.js";import"./chunk-z6kcnpsj.js";import"./chunk-ts2k13g0.js";import{lt as K}from"./chunk-01e3v1xz.js";import"./chunk-dbpkq7ba.js";import"./chunk-z744mz4w.js";import"./chunk-vjn54xj5.js";import"./chunk-0qpqd7nz.js";import"./chunk-gdew7bwm.js";import"./chunk-v3nmnm57.js";import"./chunk-hwsqqkrv.js";import"./chunk-mbbxedsq.js";import"./chunk-aa2n02qk.js";import"./chunk-k1x8469r.js";import"./chunk-c3szabpf.js";import"./chunk-c8prg3jx.js";import"./chunk-t8sy5sgx.js";import"./chunk-tezrgfc6.js";import"./chunk-wjz42325.js";import"./chunk-kry4vcrf.js";import"./chunk-f2pv705d.js";var P=q({command:"pr <number>",describe:"fetch and checkout a GitHub PR branch, then run qitqode",builder:(Y)=>Y.positional("number",{type:"number",describe:"PR number to checkout",demandOption:!0}),async handler(Y){await H.provide({directory:process.cwd(),async fn(){if(H.project.vcs!=="git")v.error("Could not find git repository. Please run this command from a git repository."),process.exit(1);let J=Y.number,Z=`pr/${J}`;if(v.println(`Fetching and checking out PR #${J}...`),(await K.run(["gh","pr","checkout",`${J}`,"--branch",Z,"--force"],{nothrow:!0})).code!==0)v.error(`Failed to checkout PR #${J}. Make sure you have gh CLI installed and authenticated.`),process.exit(1);let _=await K.text(["gh","pr","view",`${J}`,"--json","headRepository,headRepositoryOwner,isCrossRepository,headRefName,body"],{nothrow:!0}),V;if(_.code===0){let j=_.text;if(j.trim()){let z=JSON.parse(j);if(z&&z.isCrossRepository&&z.headRepository&&z.headRepositoryOwner){let L=z.headRepositoryOwner.login,W=z.headRepository.name,C=L;if(!(await S.runPromise(Q.Service.use((F)=>F.run(["remote"],{cwd:H.worktree}))).then((F)=>F.text().trim())).split(`
2
+ import{be as q}from"./chunk-f4mnp6xd.js";import{eg as v}from"./chunk-bwadggys.js";import{Ch as S}from"./chunk-1acn5me8.js";import"./chunk-vs3s49jw.js";import"./chunk-kre93a89.js";import"./chunk-060wbpz4.js";import"./chunk-zrhw1szj.js";import"./chunk-t8fjgkp8.js";import"./chunk-0egrckx0.js";import"./chunk-k1qd8ecm.js";import"./chunk-bhg69t69.js";import{Fl as Q,Ol as H}from"./chunk-fv5mrdyc.js";import"./chunk-rdreeyv0.js";import"./chunk-rmsqb6r4.js";import"./chunk-7pckez5z.js";import"./chunk-k6981ysw.js";import"./chunk-sa0rrreh.js";import"./chunk-ydgst3h8.js";import"./chunk-6tqbnxar.js";import"./chunk-0w19vmd7.js";import"./chunk-eewe7tx1.js";import"./chunk-4y9wbfd2.js";import"./chunk-wm9nh9nb.js";import"./chunk-scnbt714.js";import"./chunk-cqtkxwd8.js";import"./chunk-y3gy62q5.js";import"./chunk-az3nss5m.js";import"./chunk-p2fte9vz.js";import"./chunk-ggncq8w8.js";import"./chunk-t3w43rft.js";import"./chunk-eacpc64g.js";import"./chunk-27saej0r.js";import"./chunk-b5ym419d.js";import"./chunk-29q89bge.js";import"./chunk-wqk1v8t0.js";import"./chunk-rwwvy89t.js";import{Or as K}from"./chunk-z0kbyr00.js";import"./chunk-sbjymf20.js";import"./chunk-dt3bsmfe.js";import"./chunk-vbfej8ds.js";import"./chunk-0tm6589k.js";import"./chunk-fveaq0pb.js";import"./chunk-gswhjd1h.js";import"./chunk-wgkcyqn1.js";import"./chunk-59csnjc3.js";import"./chunk-1bxfzd6r.js";import"./chunk-6p6m5956.js";import"./chunk-a48mx917.js";import"./chunk-3va85mbe.js";import"./chunk-w7a33cwa.js";import"./chunk-g7v6sp3c.js";import"./chunk-s2tc3qs0.js";import"./chunk-n6tqtk6h.js";import"./chunk-e0vrxetq.js";var P=q({command:"pr <number>",describe:"fetch and checkout a GitHub PR branch, then run qitqode",builder:(Y)=>Y.positional("number",{type:"number",describe:"PR number to checkout",demandOption:!0}),async handler(Y){await H.provide({directory:process.cwd(),async fn(){if(H.project.vcs!=="git")v.error("Could not find git repository. Please run this command from a git repository."),process.exit(1);let J=Y.number,Z=`pr/${J}`;if(v.println(`Fetching and checking out PR #${J}...`),(await K.run(["gh","pr","checkout",`${J}`,"--branch",Z,"--force"],{nothrow:!0})).code!==0)v.error(`Failed to checkout PR #${J}. Make sure you have gh CLI installed and authenticated.`),process.exit(1);let _=await K.text(["gh","pr","view",`${J}`,"--json","headRepository,headRepositoryOwner,isCrossRepository,headRefName,body"],{nothrow:!0}),V;if(_.code===0){let j=_.text;if(j.trim()){let z=JSON.parse(j);if(z&&z.isCrossRepository&&z.headRepository&&z.headRepositoryOwner){let L=z.headRepositoryOwner.login,W=z.headRepository.name,C=L;if(!(await S.runPromise(Q.Service.use((F)=>F.run(["remote"],{cwd:H.worktree}))).then((F)=>F.text().trim())).split(`
3
3
  `).includes(C))await S.runPromise(Q.Service.use((F)=>F.run(["remote","add",C,`https://github.com/${L}/${W}.git`],{cwd:H.worktree}))),v.println(`Added fork remote: ${C}`);let X=z.headRefName;await S.runPromise(Q.Service.use((F)=>F.run(["branch",`--set-upstream-to=${C}/${X}`,Z],{cwd:H.worktree})))}if(z&&z.body){let L=z.body.match(/https:\/\/opncd\.ai\/s\/([a-zA-Z0-9_-]+)/);if(L){let W=L[0];v.println(`Found qitqode session: ${W}`),v.println("Importing session...");let C=await K.text(["qitqode","import",W],{nothrow:!0});if(C.code===0){let X=C.text.trim().match(/Imported session: ([a-zA-Z0-9_-]+)/);if(X)V=X[1],v.println(`Session imported: ${V}`)}}}}}v.println(`Successfully checked out PR #${J} as branch '${Z}'`),v.println(),v.println("Starting qitqode..."),v.println();let D=V?["-s",V]:[],$=await K.spawn(["qitqode",...D],{stdin:"inherit",stdout:"inherit",stderr:"inherit",cwd:process.cwd()}).exited;if($!==0)throw Error(`qitqode exited with code ${$}`)}})}});export{P as PrCommand};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{an as a,bn as b,cn as c,dn as d,en as e}from"./chunk-rmsqb6r4.js";import"./chunk-e0vrxetq.js";export{e as drizzle,b as SQLiteBunTransaction,a as SQLiteBunSession,d as SQLiteBunDatabase,c as PreparedQuery};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{ie as a}from"./chunk-ax64ngf2.js";import"./chunk-ejhhrece.js";import"./chunk-0a4pmkc9.js";import"./chunk-35fj1sfm.js";import"./chunk-e0vrxetq.js";export{a as fromIni};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Lg as t}from"./chunk-qgkb6n8k.js";import{xO as n}from"./chunk-e0vrxetq.js";async function a(){try{let{JSONSchema:e}=await import("./chunk-mv7q6ach.js");return(r)=>e.make(r)}catch{throw new t("effect")}}export{a as default};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Ng as a}from"./chunk-dcv6wj9x.js";import{Ch as c,ch as t}from"./chunk-1acn5me8.js";import"./chunk-vs3s49jw.js";import"./chunk-kre93a89.js";import"./chunk-060wbpz4.js";import"./chunk-zrhw1szj.js";import"./chunk-t8fjgkp8.js";import"./chunk-0egrckx0.js";import"./chunk-k1qd8ecm.js";import"./chunk-bhg69t69.js";import"./chunk-fv5mrdyc.js";import"./chunk-rdreeyv0.js";import"./chunk-rmsqb6r4.js";import"./chunk-7pckez5z.js";import"./chunk-k6981ysw.js";import"./chunk-sa0rrreh.js";import"./chunk-ydgst3h8.js";import"./chunk-6tqbnxar.js";import"./chunk-0w19vmd7.js";import"./chunk-eewe7tx1.js";import"./chunk-4y9wbfd2.js";import"./chunk-wm9nh9nb.js";import"./chunk-scnbt714.js";import"./chunk-cqtkxwd8.js";import"./chunk-y3gy62q5.js";import"./chunk-az3nss5m.js";import"./chunk-p2fte9vz.js";import"./chunk-ggncq8w8.js";import"./chunk-t3w43rft.js";import"./chunk-eacpc64g.js";import"./chunk-27saej0r.js";import"./chunk-b5ym419d.js";import"./chunk-29q89bge.js";import"./chunk-wqk1v8t0.js";import"./chunk-rwwvy89t.js";import"./chunk-z0kbyr00.js";import"./chunk-sbjymf20.js";import"./chunk-dt3bsmfe.js";import"./chunk-vbfej8ds.js";import"./chunk-0tm6589k.js";import"./chunk-fveaq0pb.js";import"./chunk-gswhjd1h.js";import"./chunk-wgkcyqn1.js";import"./chunk-59csnjc3.js";import"./chunk-1bxfzd6r.js";import{mt as i}from"./chunk-6p6m5956.js";import"./chunk-a48mx917.js";import"./chunk-3va85mbe.js";import"./chunk-w7a33cwa.js";import"./chunk-g7v6sp3c.js";import"./chunk-s2tc3qs0.js";import"./chunk-n6tqtk6h.js";import"./chunk-e0vrxetq.js";var n=i.object({name:a.shape.name,branch:a.shape.branch.unwrap(),directory:a.shape.directory.unwrap()}),d={name:"Worktree",description:"Create a git worktree",async configure(e){let r=await c.runPromise(t.Service.use((o)=>o.makeWorktreeInfo()));return{...e,name:r.name,branch:r.branch,directory:r.directory}},async create(e){let r=n.parse(e);await c.runPromise(t.Service.use((o)=>o.createFromInfo({name:r.name,directory:r.directory,branch:r.branch})))},async remove(e){let r=n.parse(e);await c.runPromise(t.Service.use((o)=>o.remove({directory:r.directory})))},target(e){return{type:"local",directory:n.parse(e).directory}}};export{d as WorktreeAdaptor};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Ud as q,Vd as K,Wd as D,Zd as L,_d as N}from"./chunk-2kh0tg92.js";import"./chunk-52xvhxek.js";import{eg as B}from"./chunk-bwadggys.js";import{Ch as G}from"./chunk-1acn5me8.js";import"./chunk-vs3s49jw.js";import"./chunk-kre93a89.js";import"./chunk-060wbpz4.js";import"./chunk-zrhw1szj.js";import"./chunk-t8fjgkp8.js";import"./chunk-0egrckx0.js";import"./chunk-k1qd8ecm.js";import{gl as C}from"./chunk-bhg69t69.js";import"./chunk-fv5mrdyc.js";import"./chunk-rdreeyv0.js";import"./chunk-rmsqb6r4.js";import"./chunk-7pckez5z.js";import"./chunk-k6981ysw.js";import"./chunk-sa0rrreh.js";import"./chunk-ydgst3h8.js";import"./chunk-6tqbnxar.js";import"./chunk-0w19vmd7.js";import"./chunk-eewe7tx1.js";import"./chunk-4y9wbfd2.js";import"./chunk-wm9nh9nb.js";import"./chunk-scnbt714.js";import"./chunk-cqtkxwd8.js";import"./chunk-y3gy62q5.js";import"./chunk-az3nss5m.js";import"./chunk-p2fte9vz.js";import"./chunk-ggncq8w8.js";import"./chunk-t3w43rft.js";import"./chunk-eacpc64g.js";import"./chunk-27saej0r.js";import"./chunk-b5ym419d.js";import"./chunk-29q89bge.js";import"./chunk-wqk1v8t0.js";import"./chunk-rwwvy89t.js";import"./chunk-z0kbyr00.js";import"./chunk-sbjymf20.js";import"./chunk-dt3bsmfe.js";import"./chunk-vbfej8ds.js";import"./chunk-0tm6589k.js";import"./chunk-fveaq0pb.js";import{es as J}from"./chunk-gswhjd1h.js";import"./chunk-wgkcyqn1.js";import"./chunk-59csnjc3.js";import"./chunk-1bxfzd6r.js";import"./chunk-6p6m5956.js";import"./chunk-a48mx917.js";import"./chunk-3va85mbe.js";import"./chunk-w7a33cwa.js";import"./chunk-g7v6sp3c.js";import"./chunk-s2tc3qs0.js";import"./chunk-n6tqtk6h.js";import"./chunk-e0vrxetq.js";var X={command:"upgrade [target]",describe:"upgrade qitqode to the latest or a specific version",builder:(z)=>{return z.positional("target",{describe:"version to upgrade to, for ex '0.1.48' or 'v0.1.48'",type:"string"}).option("method",{alias:"m",describe:"installation method to use",type:"string",choices:["curl","npm","pnpm","bun","brew","choco","scoop"]})},handler:async(z)=>{B.empty(),B.println(B.logo(" ")),B.empty(),K("Upgrade");let O=await G.runPromise(C.Service.use((j)=>j.method())),E=z.method??O;if(E==="unknown"){if(q.error(`qitqode is installed to ${process.execPath} and may be managed by a package manager`),!await N({message:"Install anyways?",options:[{label:"Yes",value:!0},{label:"No",value:!1}],initialValue:!1})){D("Done");return}}q.info("Using method: "+E);let F=z.target?z.target.replace(/^v/,""):await G.runPromise(C.Service.use((j)=>j.latest()));if(J===F){q.warn(`qitqode upgrade skipped: ${F} is already installed`),D("Done");return}q.info(`From ${J} \u2192 ${F}`);let H=L();H.start("Upgrading...");let x=await G.runPromise(C.Service.use((j)=>j.upgrade(E,F))).catch((j)=>j);if(x){if(H.stop("Upgrade failed",1),x instanceof C.UpgradeFailedError)if(E==="choco"&&x.stderr.includes("not running from an elevated command shell"))q.error("Please run the terminal as Administrator and try again");else q.error(x.stderr);else if(x instanceof Error)q.error(x.message);D("Done");return}H.stop("Upgrade complete"),D("Done")}};export{X as UpgradeCommand};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import"./chunk-f2pv705d.js";var ln=Object.defineProperty,br=(t)=>{throw TypeError(t)},we=(t,e)=>{for(var r in e)ln(t,r,{get:e[r],enumerable:!0})},Ar=(t,e,r)=>e.has(t)||br("Cannot "+r),$=(t,e,r)=>(Ar(t,e,"read from private field"),r?r.call(t):e.get(t)),Kt=(t,e,r)=>e.has(t)?br("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),Y=(t,e,r,n)=>(Ar(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r),Dr={};we(Dr,{languages:()=>ya,parsers:()=>zr,printers:()=>Du});var cn=(t,e,r,n)=>{if(!(t&&e==null))return e.replaceAll?e.replaceAll(r,n):r.global?e.replace(r,n):e.split(r).join(n)},vr=cn,Er="string",Cr="array",Sr="cursor",Be="indent",xe="align",kr="trim",Te="group",Ne="fill",Fe="if-break",wr="indent-if-break",Br="line-suffix",xr="line-suffix-boundary",wt="line",Tr="label",Pe="break-parent",Nr=new Set([Sr,Be,xe,kr,Te,Ne,Fe,wr,Br,xr,wt,Tr,Pe]),hn=(t,e,r)=>{if(!(t&&e==null))return Array.isArray(e)||typeof e=="string"?e[r<0?e.length+r:r]:e.at(r)},ht=hn;function pn(t){if(typeof t=="string")return Er;if(Array.isArray(t))return Cr;if(!t)return;let{type:e}=t;if(Nr.has(e))return e}var Fr=pn,dn=(t)=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(t);function mn(t){let e=t===null?"null":typeof t;if(e!=="string"&&e!=="object")return`Unexpected doc '${e}',
2
+ import"./chunk-e0vrxetq.js";var ln=Object.defineProperty,br=(t)=>{throw TypeError(t)},we=(t,e)=>{for(var r in e)ln(t,r,{get:e[r],enumerable:!0})},Ar=(t,e,r)=>e.has(t)||br("Cannot "+r),$=(t,e,r)=>(Ar(t,e,"read from private field"),r?r.call(t):e.get(t)),Kt=(t,e,r)=>e.has(t)?br("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),Y=(t,e,r,n)=>(Ar(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r),Dr={};we(Dr,{languages:()=>ya,parsers:()=>zr,printers:()=>Du});var cn=(t,e,r,n)=>{if(!(t&&e==null))return e.replaceAll?e.replaceAll(r,n):r.global?e.replace(r,n):e.split(r).join(n)},vr=cn,Er="string",Cr="array",Sr="cursor",Be="indent",xe="align",kr="trim",Te="group",Ne="fill",Fe="if-break",wr="indent-if-break",Br="line-suffix",xr="line-suffix-boundary",wt="line",Tr="label",Pe="break-parent",Nr=new Set([Sr,Be,xe,kr,Te,Ne,Fe,wr,Br,xr,wt,Tr,Pe]),hn=(t,e,r)=>{if(!(t&&e==null))return Array.isArray(e)||typeof e=="string"?e[r<0?e.length+r:r]:e.at(r)},ht=hn;function pn(t){if(typeof t=="string")return Er;if(Array.isArray(t))return Cr;if(!t)return;let{type:e}=t;if(Nr.has(e))return e}var Fr=pn,dn=(t)=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(t);function mn(t){let e=t===null?"null":typeof t;if(e!=="string"&&e!=="object")return`Unexpected doc '${e}',
3
3
  Expected it to be 'string' or 'object'.`;if(Fr(t))throw Error("doc is valid.");let r=Object.prototype.toString.call(t);if(r!=="[object Object]")return`Unexpected doc '${r}'.`;let n=dn([...Nr].map((a)=>`'${a}'`));return`Unexpected doc.type '${t.type}'.
4
4
  Expected it to be ${n}.`}var fn=class extends Error{name="InvalidDocError";constructor(t){super(mn(t)),this.doc=t}},gn=fn;function yn(t,e){if(typeof t=="string")return e(t);let r=new Map;return n(t);function n(u){if(r.has(u))return r.get(u);let i=a(u);return r.set(u,i),i}function a(u){switch(Fr(u)){case Cr:return e(u.map(n));case Ne:return e({...u,parts:u.parts.map(n)});case Fe:return e({...u,breakContents:n(u.breakContents),flatContents:n(u.flatContents)});case Te:{let{expandedStates:i,contents:o}=u;return i?(i=i.map(n),o=i[0]):o=n(o),e({...u,contents:o,expandedStates:i})}case xe:case Be:case wr:case Tr:case Br:return e({...u,contents:n(u.contents)});case Er:case Sr:case kr:case xr:case wt:case Pe:return e(u);default:throw new gn(u)}}}function bn(t,e=Cn){return yn(t,(r)=>typeof r=="string"?It(e,r.split(`
5
5
  `)):r)}var Le=()=>{},St=Le,Pr=Le,An=Le;function q(t){return St(t),{type:Be,contents:t}}function Dn(t,e){return St(e),{type:xe,contents:e,n:t}}function O(t,e={}){return St(t),Pr(e.expandedStates,!0),{type:Te,id:e.id,contents:t,break:!!e.shouldBreak,expandedStates:e.expandedStates}}function ye(t){return Dn(-1,t)}function Ke(t){return An(t),{type:Ne,parts:t}}function Qe(t,e="",r={}){return St(t),e!==""&&St(e),{type:Fe,breakContents:t,flatContents:e,groupId:r.groupId}}var Lr={type:Pe},vn={type:wt,hard:!0},En={type:wt,hard:!0,literal:!0},N={type:wt},H={type:wt,soft:!0},mt=[vn,Lr],Cn=[En,Lr];function It(t,e){St(t),Pr(e);let r=[];for(let n=0;n<e.length;n++)n!==0&&r.push(t),r.push(e[n]);return r}var Ht="'",Je='"';function Sn(t,e){let r=e===!0||e===Ht?Ht:Je,n=r===Ht?Je:Ht,a=0,u=0;for(let i of t)i===r?a++:i===n&&u++;return a>u?n:r}var be=Sn;function kn(t){if(typeof t!="string")throw TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var R,wn=class{constructor(t){Kt(this,R),Y(this,R,new Set(t))}getLeadingWhitespaceCount(t){let e=$(this,R),r=0;for(let n=0;n<t.length&&e.has(t.charAt(n));n++)r++;return r}getTrailingWhitespaceCount(t){let e=$(this,R),r=0;for(let n=t.length-1;n>=0&&e.has(t.charAt(n));n--)r++;return r}getLeadingWhitespace(t){let e=this.getLeadingWhitespaceCount(t);return t.slice(0,e)}getTrailingWhitespace(t){let e=this.getTrailingWhitespaceCount(t);return t.slice(t.length-e)}hasLeadingWhitespace(t){return $(this,R).has(t.charAt(0))}hasTrailingWhitespace(t){return $(this,R).has(ht(!1,t,-1))}trimStart(t){let e=this.getLeadingWhitespaceCount(t);return t.slice(e)}trimEnd(t){let e=this.getTrailingWhitespaceCount(t);return t.slice(0,t.length-e)}trim(t){return this.trimEnd(this.trimStart(t))}split(t,e=!1){let r=`[${kn([...$(this,R)].join(""))}]+`,n=new RegExp(e?`(${r})`:r,"u");return t.split(n)}hasWhitespaceCharacter(t){let e=$(this,R);return Array.prototype.some.call(t,(r)=>e.has(r))}hasNonWhitespaceCharacter(t){let e=$(this,R);return Array.prototype.some.call(t,(r)=>!e.has(r))}isWhitespaceOnly(t){let e=$(this,R);return Array.prototype.every.call(t,(r)=>e.has(r))}};R=new WeakMap;var Bn=wn,xn=["\t",`
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{Eo as E,Fo as c,Go as M,Ho as i}from"./chunk-5b3v1x2c.js";import{Jo as g,Lo as n,Mo as k,Po as d,Qo as u,cp as e,dp as _0,ep as I,fp as O0}from"./chunk-gbxf6e5d.js";import{mp as r}from"./chunk-95am490c.js";import{It as G,Nt as y}from"./chunk-v3nmnm57.js";import{cu as s}from"./chunk-hwsqqkrv.js";import{lu as X,uu as o}from"./chunk-mbbxedsq.js";import{Bu as x,Fu as K,Ku as T}from"./chunk-aa2n02qk.js";import{Lu as j}from"./chunk-k1x8469r.js";import{EI as w,MJ as f,ZC as v,bG as L,rP as A}from"./chunk-tezrgfc6.js";import{UP as p}from"./chunk-f2pv705d.js";var F={};p(F,{waitForDependencies:()=>M0,layer:()=>V0,get:()=>R0,defaultLayer:()=>W0,TuiConfig:()=>F,Service:()=>z,Info:()=>Z0});import l from"path";var J={};p(J,{Keybinds:()=>B0,ConfigKeybinds:()=>J});var _=(O,Z)=>A.String.pipe(A.optional,A.withDecodingDefault(w.succeed(O))).annotate({description:Z}),j0=process.platform==="win32"?"ctrl+z,ctrl+-,super+z":"ctrl+-,super+z",w0=A.Struct({leader:_("ctrl+x","Leader key for keybind combinations"),app_exit:_("ctrl+c,ctrl+d,<leader>q","Exit the application"),editor_open:_("<leader>e","Open external editor"),theme_list:_("<leader>t","List available themes"),sidebar_toggle:_("<leader>b","Toggle sidebar"),scrollbar_toggle:_("none","Toggle session scrollbar"),status_view:_("<leader>s","View status"),session_export:_("<leader>x","Export session to editor"),session_new:_("<leader>n","Create a new session"),session_list:_("<leader>l","List all sessions"),session_timeline:_("<leader>g","Show session timeline"),session_fork:_("none","Fork session from message"),session_rename:_("ctrl+r","Rename session"),session_delete:_("ctrl+d","Delete session"),stash_delete:_("ctrl+d","Delete stash entry"),model_provider_list:_("ctrl+a","Open provider list from model dialog"),model_favorite_toggle:_("ctrl+f","Toggle model favorite status"),session_share:_("none","Share current session"),session_unshare:_("none","Unshare current session"),session_interrupt:_("escape","Interrupt current session"),session_compact:_("<leader>c","Compact the session"),messages_page_up:_("pageup,ctrl+alt+b","Scroll messages up by one page"),messages_page_down:_("pagedown,ctrl+alt+f","Scroll messages down by one page"),messages_line_up:_("ctrl+alt+y","Scroll messages up by one line"),messages_line_down:_("ctrl+alt+e","Scroll messages down by one line"),messages_half_page_up:_("ctrl+alt+u","Scroll messages up by half page"),messages_half_page_down:_("ctrl+alt+d","Scroll messages down by half page"),messages_first:_("ctrl+g,home","Navigate to first message"),messages_last:_("ctrl+alt+g,end","Navigate to last message"),messages_next:_("none","Navigate to next message"),messages_previous:_("none","Navigate to previous message"),messages_last_user:_("none","Navigate to last user message"),messages_copy:_("<leader>y","Copy message"),messages_undo:_("<leader>u","Undo message"),messages_redo:_("<leader>r","Redo message"),messages_toggle_conceal:_("<leader>h","Toggle code block concealment in messages"),tool_details:_("none","Toggle tool details visibility"),model_list:_("<leader>m","List available models"),model_cycle_recent:_("f2","Next recently used model"),model_cycle_recent_reverse:_("shift+f2","Previous recently used model"),model_cycle_favorite:_("none","Next favorite model"),model_cycle_favorite_reverse:_("none","Previous favorite model"),command_list:_("ctrl+p","List available commands"),agent_list:_("<leader>a","List agents"),agent_cycle:_("ctrl+space","Next agent"),agent_cycle_reverse:_("none","Previous agent"),variant_cycle:_("ctrl+t","Cycle model variants"),variant_list:_("none","List model variants"),input_clear:_("ctrl+c","Clear input field"),input_paste:_("super+v,ctrl+v","Paste from clipboard"),input_submit:_("return","Submit input"),input_newline:_("shift+return,ctrl+return,alt+return,ctrl+j","Insert newline in input"),input_move_left:_("left,ctrl+b","Move cursor left in input"),input_move_right:_("right,ctrl+f","Move cursor right in input"),input_move_up:_("up","Move cursor up in input"),input_move_down:_("down","Move cursor down in input"),input_select_left:_("shift+left","Select left in input"),input_select_right:_("shift+right","Select right in input"),input_select_up:_("shift+up","Select up in input"),input_select_down:_("shift+down","Select down in input"),input_line_home:_("ctrl+a","Move to start of line in input"),input_line_end:_("ctrl+e","Move to end of line in input"),input_select_line_home:_("ctrl+shift+a","Select to start of line in input"),input_select_line_end:_("ctrl+shift+e","Select to end of line in input"),input_visual_line_home:_("alt+a","Move to start of visual line in input"),input_visual_line_end:_("alt+e","Move to end of visual line in input"),input_select_visual_line_home:_("alt+shift+a","Select to start of visual line in input"),input_select_visual_line_end:_("alt+shift+e","Select to end of visual line in input"),input_buffer_home:_("home","Move to start of buffer in input"),input_buffer_end:_("end","Move to end of buffer in input"),input_select_buffer_home:_("shift+home","Select to start of buffer in input"),input_select_buffer_end:_("shift+end","Select to end of buffer in input"),input_delete_line:_("ctrl+shift+d","Delete line in input"),input_delete_to_line_end:_("ctrl+k","Delete to end of line in input"),input_delete_to_line_start:_("ctrl+u","Delete to start of line in input"),input_backspace:_("backspace,shift+backspace","Backspace in input"),input_delete:_("ctrl+d,delete,shift+delete","Delete character in input"),input_undo:_(j0,"Undo in input"),input_redo:_("ctrl+.,super+shift+z","Redo in input"),input_word_forward:_("alt+f,alt+right,ctrl+right","Move word forward in input"),input_word_backward:_("alt+b,alt+left,ctrl+left","Move word backward in input"),input_select_word_forward:_("alt+shift+f,alt+shift+right","Select word forward in input"),input_select_word_backward:_("alt+shift+b,alt+shift+left","Select word backward in input"),input_delete_word_forward:_("alt+d,alt+delete,ctrl+delete","Delete word forward in input"),input_delete_word_backward:_("ctrl+w,ctrl+backspace,alt+backspace","Delete word backward in input"),history_previous:_("up","Previous history item"),history_next:_("down","Next history item"),session_child_first:_("<leader>down","Go to first child session"),session_child_cycle:_("<leader>right","Go to next child session"),session_child_cycle_reverse:_("<leader>left","Go to previous child session"),session_parent:_("<leader>up","Go to parent session"),session_main:_("<leader>escape","Back to the main conversation"),terminal_suspend:_("ctrl+z","Suspend terminal"),terminal_title_toggle:_("none","Toggle terminal title"),tips_toggle:_("<leader>h","Toggle tips on home screen"),plugin_manager:_("none","Open plugin manager dialog"),display_thinking:_("none","Toggle thinking blocks visibility")}).annotate({identifier:"KeybindsConfig"}),B0=r(w0);var K0=j.object(Object.fromEntries(Object.keys(J.Keybinds.shape).map((O)=>[O,j.string().optional()]))).strict(),R=j.object({scroll_speed:j.number().min(0.001).optional().describe("TUI scroll speed"),scroll_acceleration:j.object({enabled:j.boolean().describe("Enable scroll acceleration")}).optional().describe("Scroll acceleration settings"),diff_style:j.enum(["auto","stacked"]).optional().describe("Control diff rendering style: 'auto' adapts to terminal width, 'stacked' always shows single column"),mouse:j.boolean().optional().describe("Enable or disable mouse capture (default: true on desktop, false on Android/Termux)"),accessible:j.boolean().optional().describe("Screen-reader friendly mode: linear main-screen rendering, no mouse capture, reduced motion, no sound (default: false)"),reduce_motion:j.boolean().optional().describe("Disable spinners and other animations, showing static text instead (default: false)"),sound:j.boolean().optional().describe("Enable or disable sound cues (default: true)"),announcements:j.enum(["quiet","normal","verbose"]).optional().describe("Verbosity of accessible-mode screen-reader announcements: 'quiet' announces only turn boundaries, errors, and stops; 'normal' adds tool-start lines; 'verbose' adds tool-completion lines (default: normal). Errors are always announced.")}),P=j.object({$schema:j.string().optional(),theme:j.string().optional(),keybinds:K0.optional(),plugin:M.Spec.zod.array().optional(),plugin_enabled:j.record(j.string(),j.boolean()).optional()}).extend(R.shape).strict();var D=o.create({service:"tui.migrate"}),X0="https://qitqode.com/tui.json",Y0=P.shape.theme.optional(),b=j.record(j.string(),j.unknown()).optional(),H0=j.object({scroll_speed:R.shape.scroll_speed.catch(void 0),scroll_acceleration:R.shape.scroll_acceleration.catch(void 0),diff_style:R.shape.diff_style.catch(void 0)}).strip();async function t(O){let Z=await G0(O);for(let V of Z){let $=await K.readText(V).catch((m)=>{D.warn("failed to read config for tui migration",{path:V,error:m});return});if(!$)continue;let Q=[],B=g($,Q,{allowTrailingComma:!0});if(Q.length||!B||typeof B!=="object"||Array.isArray(B))continue;let W=Y0.safeParse("theme"in B?B.theme:void 0),Y=b.safeParse("keybinds"in B?B.keybinds:void 0),N=b.safeParse("tui"in B?B.tui:void 0),H={theme:W.success?W.data:void 0,keybinds:Y.success?Y.data:void 0,tui:N.success?N.data:void 0},S=H.tui?J0(H.tui):void 0;if(H.theme===void 0&&H.keybinds===void 0&&!S)continue;let U=l.join(l.dirname(V),"tui.json");if(await K.exists(U))continue;let C={$schema:X0};if(H.theme!==void 0)C.theme=H.theme;if(H.keybinds!==void 0)C.keybinds=H.keybinds;if(S)Object.assign(C,S);if(!await K.write(U,JSON.stringify(C,null,2)).then(()=>!0).catch((m)=>{return D.warn("failed to write tui migration target",{from:V,to:U,error:m}),!1}))continue;if(!await D0(V,$)){D.warn("tui config migrated but source file was not stripped",{from:V,to:U});continue}D.info("migrated tui config",{from:V,to:U})}}function J0(O){let Z=H0.parse(O);if(Z.scroll_speed===void 0&&Z.diff_style===void 0&&Z.scroll_acceleration===void 0)return;return Z}async function D0(O,Z){let V=O+".tui-migration.bak";if(!(await K.exists(V)?!0:await K.write(V,Z).then(()=>!0).catch((W)=>{return D.warn("failed to backup source config during tui migration",{path:O,backup:V,error:W}),!1})))return!1;let B=["theme","keybinds","tui"].reduce((W,Y)=>{let N=n(W,[Y],void 0,{formattingOptions:{insertSpaces:!0,tabSize:2}});if(!N.length)return W;return k(W,N)},Z);return K.write(O,B).then(()=>{return D.info("stripped tui keys from server config",{path:O,backup:V}),!0}).catch((W)=>{return D.warn("failed to strip legacy tui keys from server config",{path:O,backup:V,error:W}),!1})}async function G0(O){let Z=[...I(T.Path.config,"qitqode"),...await K.findUp(["qitqode.json","qitqode.jsonc"],O.cwd,void 0,{rootFirst:!0})];for(let $ of G(O.directories))Z.push(...I($,"qitqode"));if(X.QITQODE_CONFIG)Z.push(X.QITQODE_CONFIG);return(await Promise.all(G(Z).map(async($)=>{return await K.exists($)?$:void 0}))).filter(($)=>!!$)}var a=v.Reference("CurrentWorkingDirectory",{defaultValue:()=>process.cwd()});var h=o.create({service:"tui.config"}),Z0=P;class z extends v.Service()("@qitqode/TuiConfig"){}function I0(O,Z){if(K.contains(Z.directory,O))return"local";return"global"}function N0(O){let Z={...O};if(!("tui"in Z))return Z;if(!s(Z.tui))return delete Z.tui,Z;let V=Z.tui;return delete Z.tui,{...V,...Z}}async function U0(O,Z){if(!O.plugin)return O;for(let V=0;V<O.plugin.length;V++)O.plugin[V]=await M.resolvePluginSpec(O.plugin[V],Z);return O}async function q(O,Z,V){let $=await z0(Z);if(O.result=y(O.result,$),!$.plugin?.length)return;let Q=I0(Z,V),B=M.deduplicatePluginOrigins([...O.result.plugin_origins??[],...$.plugin.map((W)=>({spec:W,scope:Q,source:Z}))]);O.result.plugin=B.map((W)=>W.spec),O.result.plugin_origins=B}var A0=w.fn("TuiConfig.loadState")(function*(O){let Z=yield*_0(O.directory);yield*w.promise(()=>t({directories:Z,cwd:O.directory}));let V=X.QITQODE_DISABLE_PROJECT_CONFIG?[]:yield*e("tui",O.directory),$={result:{}};for(let W of I(T.Path.config,"tui"))yield*w.promise(()=>q($,W,O)).pipe(w.orDie);if(X.QITQODE_TUI_CONFIG){let W=X.QITQODE_TUI_CONFIG;yield*w.promise(()=>q($,W,O)).pipe(w.orDie),h.debug("loaded custom tui config",{path:W})}for(let W of V)yield*w.promise(()=>q($,W,O)).pipe(w.orDie);let Q=G(Z).filter((W)=>W.endsWith(".qitqode")||W===X.QITQODE_CONFIG_DIR);for(let W of Q){if(!W.endsWith(".qitqode")&&W!==X.QITQODE_CONFIG_DIR)continue;for(let Y of I(W,"tui"))yield*w.promise(()=>q($,Y,O)).pipe(w.orDie)}let B={...$.result.keybinds??{}};if(process.platform==="win32")B.terminal_suspend="none",B.input_undo??=G(["ctrl+z",...J.Keybinds.shape.input_undo.parse(void 0).split(",")]).join(",");return $.result.keybinds=J.Keybinds.parse(B),{config:$.result,dirs:$.result.plugin?.length?Q:[]}}),V0=L.effect(z,w.gen(function*(){let O=yield*a,Z=yield*u.Service,V=yield*x.Service,$=yield*A0({directory:O}),Q=yield*w.forEach($.dirs,(Y)=>i.install({fs:V,npm:Z,dir:Y}).pipe(w.forkScoped),{concurrency:"unbounded"}),B=w.fn("TuiConfig.get")(()=>w.succeed($.config)),W=w.fn("TuiConfig.waitForDependencies")(()=>w.forEach(Q,f.join,{concurrency:"unbounded"}).pipe(w.ignore(),w.asVoid));return z.of({get:B,waitForDependencies:W})}).pipe(w.withSpan("TuiConfig.layer"))),W0=V0.pipe(L.provide(u.defaultLayer),L.provide(x.defaultLayer)),{runPromise:$0}=d(z,W0);async function M0(){await $0((O)=>O.waitForDependencies())}async function R0(){return $0((O)=>O.get())}async function z0(O){let Z=await O0(O);if(!Z)return{};return C0(Z,O).catch((V)=>{return h.warn("failed to load tui config",{path:O,error:V}),{}})}async function C0(O,Z){return c.substitute({text:O,type:"path",path:Z,missing:"empty"}).then((V)=>E.jsonc(V,Z)).then((V)=>{if(!s(V))return{};return E.schema(Z0,N0(V),Z)}).then((V)=>U0(V,Z)).catch((V)=>{return h.warn("invalid tui config",{path:Z,error:V}),{}})}
2
+ import{fn as E,gn as c,hn as M,in as i}from"./chunk-7pckez5z.js";import{Fn as e,Gn as _0,Hn as I,In as O0,kn as g,mn as n,nn as k,qn as d,rn as u}from"./chunk-k6981ysw.js";import{Pn as r}from"./chunk-ydgst3h8.js";import{js as G,os as y}from"./chunk-gswhjd1h.js";import{Fs as s}from"./chunk-wgkcyqn1.js";import{Os as X,Xs as o}from"./chunk-59csnjc3.js";import{ct as x,gt as K,lt as T}from"./chunk-1bxfzd6r.js";import{mt as j}from"./chunk-6p6m5956.js";import{AB as v,EE as L,UN as A,fH as w,nI as f}from"./chunk-g7v6sp3c.js";import{vO as p}from"./chunk-e0vrxetq.js";var F={};p(F,{waitForDependencies:()=>M0,layer:()=>V0,get:()=>R0,defaultLayer:()=>W0,TuiConfig:()=>F,Service:()=>z,Info:()=>Z0});import l from"path";var J={};p(J,{Keybinds:()=>B0,ConfigKeybinds:()=>J});var _=(O,Z)=>A.String.pipe(A.optional,A.withDecodingDefault(w.succeed(O))).annotate({description:Z}),j0=process.platform==="win32"?"ctrl+z,ctrl+-,super+z":"ctrl+-,super+z",w0=A.Struct({leader:_("ctrl+x","Leader key for keybind combinations"),app_exit:_("ctrl+c,ctrl+d,<leader>q","Exit the application"),editor_open:_("<leader>e","Open external editor"),theme_list:_("<leader>t","List available themes"),sidebar_toggle:_("<leader>b","Toggle sidebar"),scrollbar_toggle:_("none","Toggle session scrollbar"),status_view:_("<leader>s","View status"),session_export:_("<leader>x","Export session to editor"),session_new:_("<leader>n","Create a new session"),session_list:_("<leader>l","List all sessions"),session_timeline:_("<leader>g","Show session timeline"),session_fork:_("none","Fork session from message"),session_rename:_("ctrl+r","Rename session"),session_delete:_("ctrl+d","Delete session"),stash_delete:_("ctrl+d","Delete stash entry"),model_provider_list:_("ctrl+a","Open provider list from model dialog"),model_favorite_toggle:_("ctrl+f","Toggle model favorite status"),session_share:_("none","Share current session"),session_unshare:_("none","Unshare current session"),session_interrupt:_("escape","Interrupt current session"),session_compact:_("<leader>c","Compact the session"),messages_page_up:_("pageup,ctrl+alt+b","Scroll messages up by one page"),messages_page_down:_("pagedown,ctrl+alt+f","Scroll messages down by one page"),messages_line_up:_("ctrl+alt+y","Scroll messages up by one line"),messages_line_down:_("ctrl+alt+e","Scroll messages down by one line"),messages_half_page_up:_("ctrl+alt+u","Scroll messages up by half page"),messages_half_page_down:_("ctrl+alt+d","Scroll messages down by half page"),messages_first:_("ctrl+g,home","Navigate to first message"),messages_last:_("ctrl+alt+g,end","Navigate to last message"),messages_next:_("none","Navigate to next message"),messages_previous:_("none","Navigate to previous message"),messages_last_user:_("none","Navigate to last user message"),messages_copy:_("<leader>y","Copy message"),messages_undo:_("<leader>u","Undo message"),messages_redo:_("<leader>r","Redo message"),messages_toggle_conceal:_("<leader>h","Toggle code block concealment in messages"),tool_details:_("none","Toggle tool details visibility"),model_list:_("<leader>m","List available models"),model_cycle_recent:_("f2","Next recently used model"),model_cycle_recent_reverse:_("shift+f2","Previous recently used model"),model_cycle_favorite:_("none","Next favorite model"),model_cycle_favorite_reverse:_("none","Previous favorite model"),command_list:_("ctrl+p","List available commands"),agent_list:_("<leader>a","List agents"),agent_cycle:_("ctrl+space","Next agent"),agent_cycle_reverse:_("none","Previous agent"),variant_cycle:_("ctrl+t","Cycle model variants"),variant_list:_("none","List model variants"),input_clear:_("ctrl+c","Clear input field"),input_paste:_("super+v,ctrl+v","Paste from clipboard"),input_submit:_("return","Submit input"),input_newline:_("shift+return,ctrl+return,alt+return,ctrl+j","Insert newline in input"),input_move_left:_("left,ctrl+b","Move cursor left in input"),input_move_right:_("right,ctrl+f","Move cursor right in input"),input_move_up:_("up","Move cursor up in input"),input_move_down:_("down","Move cursor down in input"),input_select_left:_("shift+left","Select left in input"),input_select_right:_("shift+right","Select right in input"),input_select_up:_("shift+up","Select up in input"),input_select_down:_("shift+down","Select down in input"),input_line_home:_("ctrl+a","Move to start of line in input"),input_line_end:_("ctrl+e","Move to end of line in input"),input_select_line_home:_("ctrl+shift+a","Select to start of line in input"),input_select_line_end:_("ctrl+shift+e","Select to end of line in input"),input_visual_line_home:_("alt+a","Move to start of visual line in input"),input_visual_line_end:_("alt+e","Move to end of visual line in input"),input_select_visual_line_home:_("alt+shift+a","Select to start of visual line in input"),input_select_visual_line_end:_("alt+shift+e","Select to end of visual line in input"),input_buffer_home:_("home","Move to start of buffer in input"),input_buffer_end:_("end","Move to end of buffer in input"),input_select_buffer_home:_("shift+home","Select to start of buffer in input"),input_select_buffer_end:_("shift+end","Select to end of buffer in input"),input_delete_line:_("ctrl+shift+d","Delete line in input"),input_delete_to_line_end:_("ctrl+k","Delete to end of line in input"),input_delete_to_line_start:_("ctrl+u","Delete to start of line in input"),input_backspace:_("backspace,shift+backspace","Backspace in input"),input_delete:_("ctrl+d,delete,shift+delete","Delete character in input"),input_undo:_(j0,"Undo in input"),input_redo:_("ctrl+.,super+shift+z","Redo in input"),input_word_forward:_("alt+f,alt+right,ctrl+right","Move word forward in input"),input_word_backward:_("alt+b,alt+left,ctrl+left","Move word backward in input"),input_select_word_forward:_("alt+shift+f,alt+shift+right","Select word forward in input"),input_select_word_backward:_("alt+shift+b,alt+shift+left","Select word backward in input"),input_delete_word_forward:_("alt+d,alt+delete,ctrl+delete","Delete word forward in input"),input_delete_word_backward:_("ctrl+w,ctrl+backspace,alt+backspace","Delete word backward in input"),history_previous:_("up","Previous history item"),history_next:_("down","Next history item"),session_child_first:_("<leader>down","Go to first child session"),session_child_cycle:_("<leader>right","Go to next child session"),session_child_cycle_reverse:_("<leader>left","Go to previous child session"),session_parent:_("<leader>up","Go to parent session"),session_main:_("<leader>escape","Back to the main conversation"),terminal_suspend:_("ctrl+z","Suspend terminal"),terminal_title_toggle:_("none","Toggle terminal title"),tips_toggle:_("<leader>h","Toggle tips on home screen"),plugin_manager:_("none","Open plugin manager dialog"),display_thinking:_("none","Toggle thinking blocks visibility")}).annotate({identifier:"KeybindsConfig"}),B0=r(w0);var K0=j.object(Object.fromEntries(Object.keys(J.Keybinds.shape).map((O)=>[O,j.string().optional()]))).strict(),R=j.object({scroll_speed:j.number().min(0.001).optional().describe("TUI scroll speed"),scroll_acceleration:j.object({enabled:j.boolean().describe("Enable scroll acceleration")}).optional().describe("Scroll acceleration settings"),diff_style:j.enum(["auto","stacked"]).optional().describe("Control diff rendering style: 'auto' adapts to terminal width, 'stacked' always shows single column"),mouse:j.boolean().optional().describe("Enable or disable mouse capture (default: true on desktop, false on Android/Termux)"),accessible:j.boolean().optional().describe("Screen-reader friendly mode: linear main-screen rendering, no mouse capture, reduced motion, no sound (default: false)"),reduce_motion:j.boolean().optional().describe("Disable spinners and other animations, showing static text instead (default: false)"),sound:j.boolean().optional().describe("Enable or disable sound cues (default: true)"),announcements:j.enum(["quiet","normal","verbose"]).optional().describe("Verbosity of accessible-mode screen-reader announcements: 'quiet' announces only turn boundaries, errors, and stops; 'normal' adds tool-start lines; 'verbose' adds tool-completion lines (default: normal). Errors are always announced.")}),P=j.object({$schema:j.string().optional(),theme:j.string().optional(),keybinds:K0.optional(),plugin:M.Spec.zod.array().optional(),plugin_enabled:j.record(j.string(),j.boolean()).optional()}).extend(R.shape).strict();var D=o.create({service:"tui.migrate"}),X0="https://qitqode.com/tui.json",Y0=P.shape.theme.optional(),b=j.record(j.string(),j.unknown()).optional(),H0=j.object({scroll_speed:R.shape.scroll_speed.catch(void 0),scroll_acceleration:R.shape.scroll_acceleration.catch(void 0),diff_style:R.shape.diff_style.catch(void 0)}).strip();async function t(O){let Z=await G0(O);for(let V of Z){let $=await K.readText(V).catch((m)=>{D.warn("failed to read config for tui migration",{path:V,error:m});return});if(!$)continue;let Q=[],B=g($,Q,{allowTrailingComma:!0});if(Q.length||!B||typeof B!=="object"||Array.isArray(B))continue;let W=Y0.safeParse("theme"in B?B.theme:void 0),Y=b.safeParse("keybinds"in B?B.keybinds:void 0),N=b.safeParse("tui"in B?B.tui:void 0),H={theme:W.success?W.data:void 0,keybinds:Y.success?Y.data:void 0,tui:N.success?N.data:void 0},S=H.tui?J0(H.tui):void 0;if(H.theme===void 0&&H.keybinds===void 0&&!S)continue;let U=l.join(l.dirname(V),"tui.json");if(await K.exists(U))continue;let C={$schema:X0};if(H.theme!==void 0)C.theme=H.theme;if(H.keybinds!==void 0)C.keybinds=H.keybinds;if(S)Object.assign(C,S);if(!await K.write(U,JSON.stringify(C,null,2)).then(()=>!0).catch((m)=>{return D.warn("failed to write tui migration target",{from:V,to:U,error:m}),!1}))continue;if(!await D0(V,$)){D.warn("tui config migrated but source file was not stripped",{from:V,to:U});continue}D.info("migrated tui config",{from:V,to:U})}}function J0(O){let Z=H0.parse(O);if(Z.scroll_speed===void 0&&Z.diff_style===void 0&&Z.scroll_acceleration===void 0)return;return Z}async function D0(O,Z){let V=O+".tui-migration.bak";if(!(await K.exists(V)?!0:await K.write(V,Z).then(()=>!0).catch((W)=>{return D.warn("failed to backup source config during tui migration",{path:O,backup:V,error:W}),!1})))return!1;let B=["theme","keybinds","tui"].reduce((W,Y)=>{let N=n(W,[Y],void 0,{formattingOptions:{insertSpaces:!0,tabSize:2}});if(!N.length)return W;return k(W,N)},Z);return K.write(O,B).then(()=>{return D.info("stripped tui keys from server config",{path:O,backup:V}),!0}).catch((W)=>{return D.warn("failed to strip legacy tui keys from server config",{path:O,backup:V,error:W}),!1})}async function G0(O){let Z=[...I(T.Path.config,"qitqode"),...await K.findUp(["qitqode.json","qitqode.jsonc"],O.cwd,void 0,{rootFirst:!0})];for(let $ of G(O.directories))Z.push(...I($,"qitqode"));if(X.QITQODE_CONFIG)Z.push(X.QITQODE_CONFIG);return(await Promise.all(G(Z).map(async($)=>{return await K.exists($)?$:void 0}))).filter(($)=>!!$)}var a=v.Reference("CurrentWorkingDirectory",{defaultValue:()=>process.cwd()});var h=o.create({service:"tui.config"}),Z0=P;class z extends v.Service()("@qitqode/TuiConfig"){}function I0(O,Z){if(K.contains(Z.directory,O))return"local";return"global"}function N0(O){let Z={...O};if(!("tui"in Z))return Z;if(!s(Z.tui))return delete Z.tui,Z;let V=Z.tui;return delete Z.tui,{...V,...Z}}async function U0(O,Z){if(!O.plugin)return O;for(let V=0;V<O.plugin.length;V++)O.plugin[V]=await M.resolvePluginSpec(O.plugin[V],Z);return O}async function q(O,Z,V){let $=await z0(Z);if(O.result=y(O.result,$),!$.plugin?.length)return;let Q=I0(Z,V),B=M.deduplicatePluginOrigins([...O.result.plugin_origins??[],...$.plugin.map((W)=>({spec:W,scope:Q,source:Z}))]);O.result.plugin=B.map((W)=>W.spec),O.result.plugin_origins=B}var A0=w.fn("TuiConfig.loadState")(function*(O){let Z=yield*_0(O.directory);yield*w.promise(()=>t({directories:Z,cwd:O.directory}));let V=X.QITQODE_DISABLE_PROJECT_CONFIG?[]:yield*e("tui",O.directory),$={result:{}};for(let W of I(T.Path.config,"tui"))yield*w.promise(()=>q($,W,O)).pipe(w.orDie);if(X.QITQODE_TUI_CONFIG){let W=X.QITQODE_TUI_CONFIG;yield*w.promise(()=>q($,W,O)).pipe(w.orDie),h.debug("loaded custom tui config",{path:W})}for(let W of V)yield*w.promise(()=>q($,W,O)).pipe(w.orDie);let Q=G(Z).filter((W)=>W.endsWith(".qitqode")||W===X.QITQODE_CONFIG_DIR);for(let W of Q){if(!W.endsWith(".qitqode")&&W!==X.QITQODE_CONFIG_DIR)continue;for(let Y of I(W,"tui"))yield*w.promise(()=>q($,Y,O)).pipe(w.orDie)}let B={...$.result.keybinds??{}};if(process.platform==="win32")B.terminal_suspend="none",B.input_undo??=G(["ctrl+z",...J.Keybinds.shape.input_undo.parse(void 0).split(",")]).join(",");return $.result.keybinds=J.Keybinds.parse(B),{config:$.result,dirs:$.result.plugin?.length?Q:[]}}),V0=L.effect(z,w.gen(function*(){let O=yield*a,Z=yield*u.Service,V=yield*x.Service,$=yield*A0({directory:O}),Q=yield*w.forEach($.dirs,(Y)=>i.install({fs:V,npm:Z,dir:Y}).pipe(w.forkScoped),{concurrency:"unbounded"}),B=w.fn("TuiConfig.get")(()=>w.succeed($.config)),W=w.fn("TuiConfig.waitForDependencies")(()=>w.forEach(Q,f.join,{concurrency:"unbounded"}).pipe(w.ignore(),w.asVoid));return z.of({get:B,waitForDependencies:W})}).pipe(w.withSpan("TuiConfig.layer"))),W0=V0.pipe(L.provide(u.defaultLayer),L.provide(x.defaultLayer)),{runPromise:$0}=d(z,W0);async function M0(){await $0((O)=>O.waitForDependencies())}async function R0(){return $0((O)=>O.get())}async function z0(O){let Z=await O0(O);if(!Z)return{};return C0(Z,O).catch((V)=>{return h.warn("failed to load tui config",{path:O,error:V}),{}})}async function C0(O,Z){return c.substitute({text:O,type:"path",path:Z,missing:"empty"}).then((V)=>E.jsonc(V,Z)).then((V)=>{if(!s(V))return{};return E.schema(Z0,N0(V),Z)}).then((V)=>U0(V,Z)).catch((V)=>{return h.warn("invalid tui config",{path:Z,error:V}),{}})}
3
3
  export{Z0 as u,z as v,V0 as w,W0 as x,M0 as y,R0 as z,F as A};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{o as L}from"./chunk-702bt91p.js";import"./chunk-maa21rh9.js";import{A as K}from"./chunk-y31f8k5f.js";import{B as N}from"./chunk-gsez13bg.js";import{C as F,E as J}from"./chunk-c8k32724.js";import"./chunk-vgt3artc.js";import"./chunk-53jstmdp.js";import"./chunk-gbkz04ke.js";import"./chunk-c987bemn.js";import{$ as M}from"./chunk-4pmvxnkj.js";import"./chunk-a1z8rnq7.js";import"./chunk-5r7c6vvx.js";import"./chunk-rk0fnvp5.js";import"./chunk-8p0t8qah.js";import"./chunk-52xvhxek.js";import{be as B}from"./chunk-f4mnp6xd.js";import"./chunk-mr17tppa.js";import"./chunk-h8mfbbjh.js";import"./chunk-13jq2ygc.js";import{eg as z}from"./chunk-bwadggys.js";import"./chunk-mrq35ftw.js";import"./chunk-nsp1za8t.js";import"./chunk-1acn5me8.js";import"./chunk-vs3s49jw.js";import"./chunk-kre93a89.js";import"./chunk-060wbpz4.js";import"./chunk-zrhw1szj.js";import"./chunk-t8fjgkp8.js";import"./chunk-0egrckx0.js";import"./chunk-k1qd8ecm.js";import"./chunk-bhg69t69.js";import"./chunk-fv5mrdyc.js";import"./chunk-rdreeyv0.js";import"./chunk-rmsqb6r4.js";import"./chunk-7pckez5z.js";import"./chunk-k6981ysw.js";import"./chunk-sa0rrreh.js";import"./chunk-ydgst3h8.js";import"./chunk-6tqbnxar.js";import"./chunk-0w19vmd7.js";import"./chunk-eewe7tx1.js";import"./chunk-4y9wbfd2.js";import"./chunk-wm9nh9nb.js";import"./chunk-scnbt714.js";import"./chunk-cqtkxwd8.js";import"./chunk-y3gy62q5.js";import"./chunk-az3nss5m.js";import"./chunk-p2fte9vz.js";import"./chunk-ggncq8w8.js";import"./chunk-t3w43rft.js";import"./chunk-eacpc64g.js";import"./chunk-27saej0r.js";import"./chunk-b5ym419d.js";import"./chunk-29q89bge.js";import"./chunk-wqk1v8t0.js";import"./chunk-rwwvy89t.js";import"./chunk-z0kbyr00.js";import"./chunk-sbjymf20.js";import"./chunk-dt3bsmfe.js";import"./chunk-vbfej8ds.js";import"./chunk-8jmb5bd4.js";import"./chunk-0tm6589k.js";import"./chunk-fveaq0pb.js";import"./chunk-gswhjd1h.js";import"./chunk-wgkcyqn1.js";import"./chunk-59csnjc3.js";import"./chunk-1bxfzd6r.js";import"./chunk-6p6m5956.js";import"./chunk-a48mx917.js";import"./chunk-3va85mbe.js";import"./chunk-w7a33cwa.js";import"./chunk-g7v6sp3c.js";import"./chunk-s2tc3qs0.js";import"./chunk-n6tqtk6h.js";import"./chunk-e0vrxetq.js";var x=B({command:"attach <url>",describe:"attach to a running qitqode server",builder:(j)=>j.positional("url",{type:"string",describe:"http://localhost:4096",demandOption:!0}).option("dir",{type:"string",description:"directory to run in"}).option("continue",{alias:["c"],describe:"continue the last session",type:"boolean"}).option("session",{alias:["s"],type:"string",describe:"session id to continue"}).option("fork",{type:"boolean",describe:"fork the session when continuing (use with --continue or --session)"}).option("password",{alias:["p"],type:"string",describe:"basic auth password (defaults to QITQODE_SERVER_PASSWORD)"}),handler:async(j)=>{let Q=J();try{F();let q=N(j);if(q){z.error(q),process.exitCode=1;return}let R=(()=>{if(!j.dir)return;try{return process.chdir(j.dir),process.cwd()}catch{return j.dir}})(),S=M({password:j.password}),V=await K.get();await L({url:j.url,config:V,args:{continue:j.continue,sessionID:j.session,fork:j.fork},directory:R,headers:S})}finally{Q?.()}}});export{x as AttachCommand};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
2
  var R;(function($){$.assertEqual=(W)=>{};function q(W){}$.assertIs=q;function _(W){throw Error()}$.assertNever=_,$.arrayToEnum=(W)=>{let H={};for(let J of W)H[J]=J;return H},$.getValidEnumValues=(W)=>{let H=$.objectKeys(W).filter((Y)=>typeof W[W[Y]]!=="number"),J={};for(let Y of H)J[Y]=W[Y];return $.objectValues(J)},$.objectValues=(W)=>{return $.objectKeys(W).map(function(H){return W[H]})},$.objectKeys=typeof Object.keys==="function"?(W)=>Object.keys(W):(W)=>{let H=[];for(let J in W)if(Object.prototype.hasOwnProperty.call(W,J))H.push(J);return H},$.find=(W,H)=>{for(let J of W)if(H(J))return J;return},$.isInteger=typeof Number.isInteger==="function"?(W)=>Number.isInteger(W):(W)=>typeof W==="number"&&Number.isFinite(W)&&Math.floor(W)===W;function G(W,H=" | "){return W.map((J)=>typeof J==="string"?`'${J}'`:J).join(H)}$.joinValues=G,$.jsonStringifyReplacer=(W,H)=>{if(typeof H==="bigint")return H.toString();return H}})(R||(R={}));var U$;(function($){$.mergeShapes=(q,_)=>{return{...q,..._}}})(U$||(U$={}));var Q=R.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),F=($)=>{switch(typeof $){case"undefined":return Q.undefined;case"string":return Q.string;case"number":return Number.isNaN($)?Q.nan:Q.number;case"boolean":return Q.boolean;case"function":return Q.function;case"bigint":return Q.bigint;case"symbol":return Q.symbol;case"object":if(Array.isArray($))return Q.array;if($===null)return Q.null;if($.then&&typeof $.then==="function"&&$.catch&&typeof $.catch==="function")return Q.promise;if(typeof Map<"u"&&$ instanceof Map)return Q.map;if(typeof Set<"u"&&$ instanceof Set)return Q.set;if(typeof Date<"u"&&$ instanceof Date)return Q.date;return Q.object;default:return Q.unknown}};var X=R.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class A extends Error{get errors(){return this.issues}constructor($){super();this.issues=[],this.addIssue=(_)=>{this.issues=[...this.issues,_]},this.addIssues=(_=[])=>{this.issues=[...this.issues,..._]};let q=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,q);else this.__proto__=q;this.name="ZodError",this.issues=$}format($){let q=$||function(W){return W.message},_={_errors:[]},G=(W)=>{for(let H of W.issues)if(H.code==="invalid_union")H.unionErrors.map(G);else if(H.code==="invalid_return_type")G(H.returnTypeError);else if(H.code==="invalid_arguments")G(H.argumentsError);else if(H.path.length===0)_._errors.push(q(H));else{let J=_,Y=0;while(Y<H.path.length){let M=H.path[Y];if(Y!==H.path.length-1)J[M]=J[M]||{_errors:[]};else J[M]=J[M]||{_errors:[]},J[M]._errors.push(q(H));J=J[M],Y++}}};return G(this),_}static assert($){if(!($ instanceof A))throw Error(`Not a ZodError: ${$}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,R.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten($=(q)=>q.message){let q={},_=[];for(let G of this.issues)if(G.path.length>0){let W=G.path[0];q[W]=q[W]||[],q[W].push($(G))}else _.push($(G));return{formErrors:_,fieldErrors:q}}get formErrors(){return this.flatten()}}A.create=($)=>{return new A($)};var D$=($,q)=>{let _;switch($.code){case X.invalid_type:if($.received===Q.undefined)_="Required";else _=`Expected ${$.expected}, received ${$.received}`;break;case X.invalid_literal:_=`Invalid literal value, expected ${JSON.stringify($.expected,R.jsonStringifyReplacer)}`;break;case X.unrecognized_keys:_=`Unrecognized key(s) in object: ${R.joinValues($.keys,", ")}`;break;case X.invalid_union:_="Invalid input";break;case X.invalid_union_discriminator:_=`Invalid discriminator value. Expected ${R.joinValues($.options)}`;break;case X.invalid_enum_value:_=`Invalid enum value. Expected ${R.joinValues($.options)}, received '${$.received}'`;break;case X.invalid_arguments:_="Invalid function arguments";break;case X.invalid_return_type:_="Invalid function return type";break;case X.invalid_date:_="Invalid date";break;case X.invalid_string:if(typeof $.validation==="object")if("includes"in $.validation){if(_=`Invalid input: must include "${$.validation.includes}"`,typeof $.validation.position==="number")_=`${_} at one or more positions greater than or equal to ${$.validation.position}`}else if("startsWith"in $.validation)_=`Invalid input: must start with "${$.validation.startsWith}"`;else if("endsWith"in $.validation)_=`Invalid input: must end with "${$.validation.endsWith}"`;else R.assertNever($.validation);else if($.validation!=="regex")_=`Invalid ${$.validation}`;else _="Invalid";break;case X.too_small:if($.type==="array")_=`Array must contain ${$.exact?"exactly":$.inclusive?"at least":"more than"} ${$.minimum} element(s)`;else if($.type==="string")_=`String must contain ${$.exact?"exactly":$.inclusive?"at least":"over"} ${$.minimum} character(s)`;else if($.type==="number")_=`Number must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${$.minimum}`;else if($.type==="bigint")_=`Number must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${$.minimum}`;else if($.type==="date")_=`Date must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${new Date(Number($.minimum))}`;else _="Invalid input";break;case X.too_big:if($.type==="array")_=`Array must contain ${$.exact?"exactly":$.inclusive?"at most":"less than"} ${$.maximum} element(s)`;else if($.type==="string")_=`String must contain ${$.exact?"exactly":$.inclusive?"at most":"under"} ${$.maximum} character(s)`;else if($.type==="number")_=`Number must be ${$.exact?"exactly":$.inclusive?"less than or equal to":"less than"} ${$.maximum}`;else if($.type==="bigint")_=`BigInt must be ${$.exact?"exactly":$.inclusive?"less than or equal to":"less than"} ${$.maximum}`;else if($.type==="date")_=`Date must be ${$.exact?"exactly":$.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number($.maximum))}`;else _="Invalid input";break;case X.custom:_="Invalid input";break;case X.invalid_intersection_types:_="Intersection results could not be merged";break;case X.not_multiple_of:_=`Number must be a multiple of ${$.multipleOf}`;break;case X.not_finite:_="Number must be finite";break;default:_=q.defaultError,R.assertNever($)}return{message:_}},I=D$;var f$=I;function u(){return f$}var w;(function($){$.errToObj=(q)=>typeof q==="string"?{message:q}:q||{},$.toString=(q)=>typeof q==="string"?q:q?.message})(w||(w={}));var G$=($)=>{let{data:q,path:_,errorMaps:G,issueData:W}=$,H=[..._,...W.path||[]],J={...W,path:H};if(W.message!==void 0)return{...W,path:H,message:W.message};let Y="",M=G.filter((S)=>!!S).slice().reverse();for(let S of M)Y=S(J,{data:q,defaultError:Y}).message;return{...W,path:H,message:Y}};function B($,q){let _=u(),G=G$({issueData:q,data:$.data,path:$.path,errorMaps:[$.common.contextualErrorMap,$.schemaErrorMap,_,_===I?void 0:I].filter((W)=>!!W)});$.common.issues.push(G)}class V{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray($,q){let _=[];for(let G of q){if(G.status==="aborted")return z;if(G.status==="dirty")$.dirty();_.push(G.value)}return{status:$.value,value:_}}static async mergeObjectAsync($,q){let _=[];for(let G of q){let W=await G.key,H=await G.value;_.push({key:W,value:H})}return V.mergeObjectSync($,_)}static mergeObjectSync($,q){let _={};for(let G of q){let{key:W,value:H}=G;if(W.status==="aborted")return z;if(H.status==="aborted")return z;if(W.status==="dirty")$.dirty();if(H.status==="dirty")$.dirty();if(W.value!=="__proto__"&&(typeof H.value<"u"||G.alwaysSet))_[W.value]=H.value}return{status:$.value,value:_}}}var z=Object.freeze({status:"aborted"}),x=($)=>({status:"dirty",value:$}),U=($)=>({status:"valid",value:$}),j$=($)=>$.status==="aborted",b$=($)=>$.status==="dirty",h=($)=>$.status==="valid",p=($)=>typeof Promise<"u"&&$ instanceof Promise;class L{constructor($,q,_,G){this._cachedPath=[],this.parent=$,this.data=q,this._path=_,this._key=G}get path(){if(!this._cachedPath.length)if(Array.isArray(this._key))this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}var A$=($,q)=>{if(h(q))return{success:!0,data:q.value};else{if(!$.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let _=new A($.common.issues);return this._error=_,this._error}}}};function b($){if(!$)return{};let{errorMap:q,invalid_type_error:_,required_error:G,description:W}=$;if(q&&(_||G))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(q)return{errorMap:q,description:W};return{errorMap:(J,Y)=>{let{message:M}=$;if(J.code==="invalid_enum_value")return{message:M??Y.defaultError};if(typeof Y.data>"u")return{message:M??G??Y.defaultError};if(J.code!=="invalid_type")return{message:Y.defaultError};return{message:M??_??Y.defaultError}},description:W}}class O{get description(){return this._def.description}_getType($){return F($.data)}_getOrReturnCtx($,q){return q||{common:$.parent.common,data:$.data,parsedType:F($.data),schemaErrorMap:this._def.errorMap,path:$.path,parent:$.parent}}_processInputParams($){return{status:new V,ctx:{common:$.parent.common,data:$.data,parsedType:F($.data),schemaErrorMap:this._def.errorMap,path:$.path,parent:$.parent}}}_parseSync($){let q=this._parse($);if(p(q))throw Error("Synchronous parse encountered promise.");return q}_parseAsync($){let q=this._parse($);return Promise.resolve(q)}parse($,q){let _=this.safeParse($,q);if(_.success)return _.data;throw _.error}safeParse($,q){let _={common:{issues:[],async:q?.async??!1,contextualErrorMap:q?.errorMap},path:q?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:F($)},G=this._parseSync({data:$,path:_.path,parent:_});return A$(_,G)}"~validate"($){let q={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:F($)};if(!this["~standard"].async)try{let _=this._parseSync({data:$,path:[],parent:q});return h(_)?{value:_.value}:{issues:q.common.issues}}catch(_){if(_?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;q.common={issues:[],async:!0}}return this._parseAsync({data:$,path:[],parent:q}).then((_)=>h(_)?{value:_.value}:{issues:q.common.issues})}async parseAsync($,q){let _=await this.safeParseAsync($,q);if(_.success)return _.data;throw _.error}async safeParseAsync($,q){let _={common:{issues:[],contextualErrorMap:q?.errorMap,async:!0},path:q?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:F($)},G=this._parse({data:$,path:_.path,parent:_}),W=await(p(G)?G:Promise.resolve(G));return A$(_,W)}refine($,q){let _=(G)=>{if(typeof q==="string"||typeof q>"u")return{message:q};else if(typeof q==="function")return q(G);else return q};return this._refinement((G,W)=>{let H=$(G),J=()=>W.addIssue({code:X.custom,..._(G)});if(typeof Promise<"u"&&H instanceof Promise)return H.then((Y)=>{if(!Y)return J(),!1;else return!0});if(!H)return J(),!1;else return!0})}refinement($,q){return this._refinement((_,G)=>{if(!$(_))return G.addIssue(typeof q==="function"?q(_,G):q),!1;else return!0})}_refinement($){return new f({schema:this,typeName:j.ZodEffects,effect:{type:"refinement",refinement:$}})}superRefine($){return this._refinement($)}constructor($){this.spa=this.safeParseAsync,this._def=$,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:(q)=>this["~validate"](q)}}optional(){return D.create(this,this._def)}nullable(){return P.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return N.create(this)}promise(){return c.create(this,this._def)}or($){return a.create([this,$],this._def)}and($){return s.create(this,$,this._def)}transform($){return new f({...b(this._def),schema:this,typeName:j.ZodEffects,effect:{type:"transform",transform:$}})}default($){let q=typeof $==="function"?$:()=>$;return new q$({...b(this._def),innerType:this,defaultValue:q,typeName:j.ZodDefault})}brand(){return new E$({typeName:j.ZodBranded,type:this,...b(this._def)})}catch($){let q=typeof $==="function"?$:()=>$;return new _$({...b(this._def),innerType:this,catchValue:q,typeName:j.ZodCatch})}describe($){return new this.constructor({...this._def,description:$})}pipe($){return w$.create(this,$)}readonly(){return W$.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var F$=/^c[^\s-]{8,}$/i,K$=/^[0-9a-z]+$/,k$=/^[0-9A-HJKMNP-TV-Z]{26}$/i,C$=/^[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,g$=/^[a-z0-9_-]{21}$/i,I$=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,P$=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,h$=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,T$="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",S$,l$=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,x$=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,m$=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,y$=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Z$=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,n$=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,v$="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",c$=new RegExp(`^${v$}$`);function L$($){let q="[0-5]\\d";if($.precision)q=`${q}\\.\\d{${$.precision}}`;else if($.precision==null)q=`${q}(\\.\\d+)?`;let _=$.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${q})${_}`}function u$($){return new RegExp(`^${L$($)}$`)}function p$($){let q=`${v$}T${L$($)}`,_=[];if(_.push($.local?"Z?":"Z"),$.offset)_.push("([+-]\\d{2}:?\\d{2})");return q=`${q}(${_.join("|")})`,new RegExp(`^${q}$`)}function i$($,q){if((q==="v4"||!q)&&l$.test($))return!0;if((q==="v6"||!q)&&m$.test($))return!0;return!1}function r$($,q){if(!I$.test($))return!1;try{let[_]=$.split(".");if(!_)return!1;let G=_.replace(/-/g,"+").replace(/_/g,"/").padEnd(_.length+(4-_.length%4)%4,"="),W=JSON.parse(atob(G));if(typeof W!=="object"||W===null)return!1;if("typ"in W&&W?.typ!=="JWT")return!1;if(!W.alg)return!1;if(q&&W.alg!==q)return!1;return!0}catch{return!1}}function o$($,q){if((q==="v4"||!q)&&x$.test($))return!0;if((q==="v6"||!q)&&y$.test($))return!0;return!1}class k extends O{_parse($){if(this._def.coerce)$.data=String($.data);if(this._getType($)!==Q.string){let W=this._getOrReturnCtx($);return B(W,{code:X.invalid_type,expected:Q.string,received:W.parsedType}),z}let _=new V,G=void 0;for(let W of this._def.checks)if(W.kind==="min"){if($.data.length<W.value)G=this._getOrReturnCtx($,G),B(G,{code:X.too_small,minimum:W.value,type:"string",inclusive:!0,exact:!1,message:W.message}),_.dirty()}else if(W.kind==="max"){if($.data.length>W.value)G=this._getOrReturnCtx($,G),B(G,{code:X.too_big,maximum:W.value,type:"string",inclusive:!0,exact:!1,message:W.message}),_.dirty()}else if(W.kind==="length"){let H=$.data.length>W.value,J=$.data.length<W.value;if(H||J){if(G=this._getOrReturnCtx($,G),H)B(G,{code:X.too_big,maximum:W.value,type:"string",inclusive:!0,exact:!0,message:W.message});else if(J)B(G,{code:X.too_small,minimum:W.value,type:"string",inclusive:!0,exact:!0,message:W.message});_.dirty()}}else if(W.kind==="email"){if(!h$.test($.data))G=this._getOrReturnCtx($,G),B(G,{validation:"email",code:X.invalid_string,message:W.message}),_.dirty()}else if(W.kind==="emoji"){if(!S$)S$=new RegExp(T$,"u");if(!S$.test($.data))G=this._getOrReturnCtx($,G),B(G,{validation:"emoji",code:X.invalid_string,message:W.message}),_.dirty()}else if(W.kind==="uuid"){if(!C$.test($.data))G=this._getOrReturnCtx($,G),B(G,{validation:"uuid",code:X.invalid_string,message:W.message}),_.dirty()}else if(W.kind==="nanoid"){if(!g$.test($.data))G=this._getOrReturnCtx($,G),B(G,{validation:"nanoid",code:X.invalid_string,message:W.message}),_.dirty()}else if(W.kind==="cuid"){if(!F$.test($.data))G=this._getOrReturnCtx($,G),B(G,{validation:"cuid",code:X.invalid_string,message:W.message}),_.dirty()}else if(W.kind==="cuid2"){if(!K$.test($.data))G=this._getOrReturnCtx($,G),B(G,{validation:"cuid2",code:X.invalid_string,message:W.message}),_.dirty()}else if(W.kind==="ulid"){if(!k$.test($.data))G=this._getOrReturnCtx($,G),B(G,{validation:"ulid",code:X.invalid_string,message:W.message}),_.dirty()}else if(W.kind==="url")try{new URL($.data)}catch{G=this._getOrReturnCtx($,G),B(G,{validation:"url",code:X.invalid_string,message:W.message}),_.dirty()}else if(W.kind==="regex"){if(W.regex.lastIndex=0,!W.regex.test($.data))G=this._getOrReturnCtx($,G),B(G,{validation:"regex",code:X.invalid_string,message:W.message}),_.dirty()}else if(W.kind==="trim")$.data=$.data.trim();else if(W.kind==="includes"){if(!$.data.includes(W.value,W.position))G=this._getOrReturnCtx($,G),B(G,{code:X.invalid_string,validation:{includes:W.value,position:W.position},message:W.message}),_.dirty()}else if(W.kind==="toLowerCase")$.data=$.data.toLowerCase();else if(W.kind==="toUpperCase")$.data=$.data.toUpperCase();else if(W.kind==="startsWith"){if(!$.data.startsWith(W.value))G=this._getOrReturnCtx($,G),B(G,{code:X.invalid_string,validation:{startsWith:W.value},message:W.message}),_.dirty()}else if(W.kind==="endsWith"){if(!$.data.endsWith(W.value))G=this._getOrReturnCtx($,G),B(G,{code:X.invalid_string,validation:{endsWith:W.value},message:W.message}),_.dirty()}else if(W.kind==="datetime"){if(!p$(W).test($.data))G=this._getOrReturnCtx($,G),B(G,{code:X.invalid_string,validation:"datetime",message:W.message}),_.dirty()}else if(W.kind==="date"){if(!c$.test($.data))G=this._getOrReturnCtx($,G),B(G,{code:X.invalid_string,validation:"date",message:W.message}),_.dirty()}else if(W.kind==="time"){if(!u$(W).test($.data))G=this._getOrReturnCtx($,G),B(G,{code:X.invalid_string,validation:"time",message:W.message}),_.dirty()}else if(W.kind==="duration"){if(!P$.test($.data))G=this._getOrReturnCtx($,G),B(G,{validation:"duration",code:X.invalid_string,message:W.message}),_.dirty()}else if(W.kind==="ip"){if(!i$($.data,W.version))G=this._getOrReturnCtx($,G),B(G,{validation:"ip",code:X.invalid_string,message:W.message}),_.dirty()}else if(W.kind==="jwt"){if(!r$($.data,W.alg))G=this._getOrReturnCtx($,G),B(G,{validation:"jwt",code:X.invalid_string,message:W.message}),_.dirty()}else if(W.kind==="cidr"){if(!o$($.data,W.version))G=this._getOrReturnCtx($,G),B(G,{validation:"cidr",code:X.invalid_string,message:W.message}),_.dirty()}else if(W.kind==="base64"){if(!Z$.test($.data))G=this._getOrReturnCtx($,G),B(G,{validation:"base64",code:X.invalid_string,message:W.message}),_.dirty()}else if(W.kind==="base64url"){if(!n$.test($.data))G=this._getOrReturnCtx($,G),B(G,{validation:"base64url",code:X.invalid_string,message:W.message}),_.dirty()}else R.assertNever(W);return{status:_.value,value:$.data}}_regex($,q,_){return this.refinement((G)=>$.test(G),{validation:q,code:X.invalid_string,...w.errToObj(_)})}_addCheck($){return new k({...this._def,checks:[...this._def.checks,$]})}email($){return this._addCheck({kind:"email",...w.errToObj($)})}url($){return this._addCheck({kind:"url",...w.errToObj($)})}emoji($){return this._addCheck({kind:"emoji",...w.errToObj($)})}uuid($){return this._addCheck({kind:"uuid",...w.errToObj($)})}nanoid($){return this._addCheck({kind:"nanoid",...w.errToObj($)})}cuid($){return this._addCheck({kind:"cuid",...w.errToObj($)})}cuid2($){return this._addCheck({kind:"cuid2",...w.errToObj($)})}ulid($){return this._addCheck({kind:"ulid",...w.errToObj($)})}base64($){return this._addCheck({kind:"base64",...w.errToObj($)})}base64url($){return this._addCheck({kind:"base64url",...w.errToObj($)})}jwt($){return this._addCheck({kind:"jwt",...w.errToObj($)})}ip($){return this._addCheck({kind:"ip",...w.errToObj($)})}cidr($){return this._addCheck({kind:"cidr",...w.errToObj($)})}datetime($){if(typeof $==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:$});return this._addCheck({kind:"datetime",precision:typeof $?.precision>"u"?null:$?.precision,offset:$?.offset??!1,local:$?.local??!1,...w.errToObj($?.message)})}date($){return this._addCheck({kind:"date",message:$})}time($){if(typeof $==="string")return this._addCheck({kind:"time",precision:null,message:$});return this._addCheck({kind:"time",precision:typeof $?.precision>"u"?null:$?.precision,...w.errToObj($?.message)})}duration($){return this._addCheck({kind:"duration",...w.errToObj($)})}regex($,q){return this._addCheck({kind:"regex",regex:$,...w.errToObj(q)})}includes($,q){return this._addCheck({kind:"includes",value:$,position:q?.position,...w.errToObj(q?.message)})}startsWith($,q){return this._addCheck({kind:"startsWith",value:$,...w.errToObj(q)})}endsWith($,q){return this._addCheck({kind:"endsWith",value:$,...w.errToObj(q)})}min($,q){return this._addCheck({kind:"min",value:$,...w.errToObj(q)})}max($,q){return this._addCheck({kind:"max",value:$,...w.errToObj(q)})}length($,q){return this._addCheck({kind:"length",value:$,...w.errToObj(q)})}nonempty($){return this.min(1,w.errToObj($))}trim(){return new k({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new k({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new k({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(($)=>$.kind==="datetime")}get isDate(){return!!this._def.checks.find(($)=>$.kind==="date")}get isTime(){return!!this._def.checks.find(($)=>$.kind==="time")}get isDuration(){return!!this._def.checks.find(($)=>$.kind==="duration")}get isEmail(){return!!this._def.checks.find(($)=>$.kind==="email")}get isURL(){return!!this._def.checks.find(($)=>$.kind==="url")}get isEmoji(){return!!this._def.checks.find(($)=>$.kind==="emoji")}get isUUID(){return!!this._def.checks.find(($)=>$.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(($)=>$.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(($)=>$.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(($)=>$.kind==="cuid2")}get isULID(){return!!this._def.checks.find(($)=>$.kind==="ulid")}get isIP(){return!!this._def.checks.find(($)=>$.kind==="ip")}get isCIDR(){return!!this._def.checks.find(($)=>$.kind==="cidr")}get isBase64(){return!!this._def.checks.find(($)=>$.kind==="base64")}get isBase64url(){return!!this._def.checks.find(($)=>$.kind==="base64url")}get minLength(){let $=null;for(let q of this._def.checks)if(q.kind==="min"){if($===null||q.value>$)$=q.value}return $}get maxLength(){let $=null;for(let q of this._def.checks)if(q.kind==="max"){if($===null||q.value<$)$=q.value}return $}}k.create=($)=>{return new k({checks:[],typeName:j.ZodString,coerce:$?.coerce??!1,...b($)})};function d$($,q){let _=($.toString().split(".")[1]||"").length,G=(q.toString().split(".")[1]||"").length,W=_>G?_:G,H=Number.parseInt($.toFixed(W).replace(".","")),J=Number.parseInt(q.toFixed(W).replace(".",""));return H%J/10**W}class y extends O{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse($){if(this._def.coerce)$.data=Number($.data);if(this._getType($)!==Q.number){let W=this._getOrReturnCtx($);return B(W,{code:X.invalid_type,expected:Q.number,received:W.parsedType}),z}let _=void 0,G=new V;for(let W of this._def.checks)if(W.kind==="int"){if(!R.isInteger($.data))_=this._getOrReturnCtx($,_),B(_,{code:X.invalid_type,expected:"integer",received:"float",message:W.message}),G.dirty()}else if(W.kind==="min"){if(W.inclusive?$.data<W.value:$.data<=W.value)_=this._getOrReturnCtx($,_),B(_,{code:X.too_small,minimum:W.value,type:"number",inclusive:W.inclusive,exact:!1,message:W.message}),G.dirty()}else if(W.kind==="max"){if(W.inclusive?$.data>W.value:$.data>=W.value)_=this._getOrReturnCtx($,_),B(_,{code:X.too_big,maximum:W.value,type:"number",inclusive:W.inclusive,exact:!1,message:W.message}),G.dirty()}else if(W.kind==="multipleOf"){if(d$($.data,W.value)!==0)_=this._getOrReturnCtx($,_),B(_,{code:X.not_multiple_of,multipleOf:W.value,message:W.message}),G.dirty()}else if(W.kind==="finite"){if(!Number.isFinite($.data))_=this._getOrReturnCtx($,_),B(_,{code:X.not_finite,message:W.message}),G.dirty()}else R.assertNever(W);return{status:G.value,value:$.data}}gte($,q){return this.setLimit("min",$,!0,w.toString(q))}gt($,q){return this.setLimit("min",$,!1,w.toString(q))}lte($,q){return this.setLimit("max",$,!0,w.toString(q))}lt($,q){return this.setLimit("max",$,!1,w.toString(q))}setLimit($,q,_,G){return new y({...this._def,checks:[...this._def.checks,{kind:$,value:q,inclusive:_,message:w.toString(G)}]})}_addCheck($){return new y({...this._def,checks:[...this._def.checks,$]})}int($){return this._addCheck({kind:"int",message:w.toString($)})}positive($){return this._addCheck({kind:"min",value:0,inclusive:!1,message:w.toString($)})}negative($){return this._addCheck({kind:"max",value:0,inclusive:!1,message:w.toString($)})}nonpositive($){return this._addCheck({kind:"max",value:0,inclusive:!0,message:w.toString($)})}nonnegative($){return this._addCheck({kind:"min",value:0,inclusive:!0,message:w.toString($)})}multipleOf($,q){return this._addCheck({kind:"multipleOf",value:$,message:w.toString(q)})}finite($){return this._addCheck({kind:"finite",message:w.toString($)})}safe($){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:w.toString($)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:w.toString($)})}get minValue(){let $=null;for(let q of this._def.checks)if(q.kind==="min"){if($===null||q.value>$)$=q.value}return $}get maxValue(){let $=null;for(let q of this._def.checks)if(q.kind==="max"){if($===null||q.value<$)$=q.value}return $}get isInt(){return!!this._def.checks.find(($)=>$.kind==="int"||$.kind==="multipleOf"&&R.isInteger($.value))}get isFinite(){let $=null,q=null;for(let _ of this._def.checks)if(_.kind==="finite"||_.kind==="int"||_.kind==="multipleOf")return!0;else if(_.kind==="min"){if(q===null||_.value>q)q=_.value}else if(_.kind==="max"){if($===null||_.value<$)$=_.value}return Number.isFinite(q)&&Number.isFinite($)}}y.create=($)=>{return new y({checks:[],typeName:j.ZodNumber,coerce:$?.coerce||!1,...b($)})};class Z extends O{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse($){if(this._def.coerce)try{$.data=BigInt($.data)}catch{return this._getInvalidInput($)}if(this._getType($)!==Q.bigint)return this._getInvalidInput($);let _=void 0,G=new V;for(let W of this._def.checks)if(W.kind==="min"){if(W.inclusive?$.data<W.value:$.data<=W.value)_=this._getOrReturnCtx($,_),B(_,{code:X.too_small,type:"bigint",minimum:W.value,inclusive:W.inclusive,message:W.message}),G.dirty()}else if(W.kind==="max"){if(W.inclusive?$.data>W.value:$.data>=W.value)_=this._getOrReturnCtx($,_),B(_,{code:X.too_big,type:"bigint",maximum:W.value,inclusive:W.inclusive,message:W.message}),G.dirty()}else if(W.kind==="multipleOf"){if($.data%W.value!==BigInt(0))_=this._getOrReturnCtx($,_),B(_,{code:X.not_multiple_of,multipleOf:W.value,message:W.message}),G.dirty()}else R.assertNever(W);return{status:G.value,value:$.data}}_getInvalidInput($){let q=this._getOrReturnCtx($);return B(q,{code:X.invalid_type,expected:Q.bigint,received:q.parsedType}),z}gte($,q){return this.setLimit("min",$,!0,w.toString(q))}gt($,q){return this.setLimit("min",$,!1,w.toString(q))}lte($,q){return this.setLimit("max",$,!0,w.toString(q))}lt($,q){return this.setLimit("max",$,!1,w.toString(q))}setLimit($,q,_,G){return new Z({...this._def,checks:[...this._def.checks,{kind:$,value:q,inclusive:_,message:w.toString(G)}]})}_addCheck($){return new Z({...this._def,checks:[...this._def.checks,$]})}positive($){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:w.toString($)})}negative($){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:w.toString($)})}nonpositive($){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:w.toString($)})}nonnegative($){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:w.toString($)})}multipleOf($,q){return this._addCheck({kind:"multipleOf",value:$,message:w.toString(q)})}get minValue(){let $=null;for(let q of this._def.checks)if(q.kind==="min"){if($===null||q.value>$)$=q.value}return $}get maxValue(){let $=null;for(let q of this._def.checks)if(q.kind==="max"){if($===null||q.value<$)$=q.value}return $}}Z.create=($)=>{return new Z({checks:[],typeName:j.ZodBigInt,coerce:$?.coerce??!1,...b($)})};class H$ extends O{_parse($){if(this._def.coerce)$.data=Boolean($.data);if(this._getType($)!==Q.boolean){let _=this._getOrReturnCtx($);return B(_,{code:X.invalid_type,expected:Q.boolean,received:_.parsedType}),z}return U($.data)}}H$.create=($)=>{return new H$({typeName:j.ZodBoolean,coerce:$?.coerce||!1,...b($)})};class r extends O{_parse($){if(this._def.coerce)$.data=new Date($.data);if(this._getType($)!==Q.date){let W=this._getOrReturnCtx($);return B(W,{code:X.invalid_type,expected:Q.date,received:W.parsedType}),z}if(Number.isNaN($.data.getTime())){let W=this._getOrReturnCtx($);return B(W,{code:X.invalid_date}),z}let _=new V,G=void 0;for(let W of this._def.checks)if(W.kind==="min"){if($.data.getTime()<W.value)G=this._getOrReturnCtx($,G),B(G,{code:X.too_small,message:W.message,inclusive:!0,exact:!1,minimum:W.value,type:"date"}),_.dirty()}else if(W.kind==="max"){if($.data.getTime()>W.value)G=this._getOrReturnCtx($,G),B(G,{code:X.too_big,message:W.message,inclusive:!0,exact:!1,maximum:W.value,type:"date"}),_.dirty()}else R.assertNever(W);return{status:_.value,value:new Date($.data.getTime())}}_addCheck($){return new r({...this._def,checks:[...this._def.checks,$]})}min($,q){return this._addCheck({kind:"min",value:$.getTime(),message:w.toString(q)})}max($,q){return this._addCheck({kind:"max",value:$.getTime(),message:w.toString(q)})}get minDate(){let $=null;for(let q of this._def.checks)if(q.kind==="min"){if($===null||q.value>$)$=q.value}return $!=null?new Date($):null}get maxDate(){let $=null;for(let q of this._def.checks)if(q.kind==="max"){if($===null||q.value<$)$=q.value}return $!=null?new Date($):null}}r.create=($)=>{return new r({checks:[],coerce:$?.coerce||!1,typeName:j.ZodDate,...b($)})};class J$ extends O{_parse($){if(this._getType($)!==Q.symbol){let _=this._getOrReturnCtx($);return B(_,{code:X.invalid_type,expected:Q.symbol,received:_.parsedType}),z}return U($.data)}}J$.create=($)=>{return new J$({typeName:j.ZodSymbol,...b($)})};class o extends O{_parse($){if(this._getType($)!==Q.undefined){let _=this._getOrReturnCtx($);return B(_,{code:X.invalid_type,expected:Q.undefined,received:_.parsedType}),z}return U($.data)}}o.create=($)=>{return new o({typeName:j.ZodUndefined,...b($)})};class d extends O{_parse($){if(this._getType($)!==Q.null){let _=this._getOrReturnCtx($);return B(_,{code:X.invalid_type,expected:Q.null,received:_.parsedType}),z}return U($.data)}}d.create=($)=>{return new d({typeName:j.ZodNull,...b($)})};class X$ extends O{constructor(){super(...arguments);this._any=!0}_parse($){return U($.data)}}X$.create=($)=>{return new X$({typeName:j.ZodAny,...b($)})};class T extends O{constructor(){super(...arguments);this._unknown=!0}_parse($){return U($.data)}}T.create=($)=>{return new T({typeName:j.ZodUnknown,...b($)})};class C extends O{_parse($){let q=this._getOrReturnCtx($);return B(q,{code:X.invalid_type,expected:Q.never,received:q.parsedType}),z}}C.create=($)=>{return new C({typeName:j.ZodNever,...b($)})};class Q$ extends O{_parse($){if(this._getType($)!==Q.undefined){let _=this._getOrReturnCtx($);return B(_,{code:X.invalid_type,expected:Q.void,received:_.parsedType}),z}return U($.data)}}Q$.create=($)=>{return new Q$({typeName:j.ZodVoid,...b($)})};class N extends O{_parse($){let{ctx:q,status:_}=this._processInputParams($),G=this._def;if(q.parsedType!==Q.array)return B(q,{code:X.invalid_type,expected:Q.array,received:q.parsedType}),z;if(G.exactLength!==null){let H=q.data.length>G.exactLength.value,J=q.data.length<G.exactLength.value;if(H||J)B(q,{code:H?X.too_big:X.too_small,minimum:J?G.exactLength.value:void 0,maximum:H?G.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:G.exactLength.message}),_.dirty()}if(G.minLength!==null){if(q.data.length<G.minLength.value)B(q,{code:X.too_small,minimum:G.minLength.value,type:"array",inclusive:!0,exact:!1,message:G.minLength.message}),_.dirty()}if(G.maxLength!==null){if(q.data.length>G.maxLength.value)B(q,{code:X.too_big,maximum:G.maxLength.value,type:"array",inclusive:!0,exact:!1,message:G.maxLength.message}),_.dirty()}if(q.common.async)return Promise.all([...q.data].map((H,J)=>{return G.type._parseAsync(new L(q,H,q.path,J))})).then((H)=>{return V.mergeArray(_,H)});let W=[...q.data].map((H,J)=>{return G.type._parseSync(new L(q,H,q.path,J))});return V.mergeArray(_,W)}get element(){return this._def.type}min($,q){return new N({...this._def,minLength:{value:$,message:w.toString(q)}})}max($,q){return new N({...this._def,maxLength:{value:$,message:w.toString(q)}})}length($,q){return new N({...this._def,exactLength:{value:$,message:w.toString(q)}})}nonempty($){return this.min(1,$)}}N.create=($,q)=>{return new N({type:$,minLength:null,maxLength:null,exactLength:null,typeName:j.ZodArray,...b(q)})};function m($){if($ instanceof E){let q={};for(let _ in $.shape){let G=$.shape[_];q[_]=D.create(m(G))}return new E({...$._def,shape:()=>q})}else if($ instanceof N)return new N({...$._def,type:m($.element)});else if($ instanceof D)return D.create(m($.unwrap()));else if($ instanceof P)return P.create(m($.unwrap()));else if($ instanceof g)return g.create($.items.map((q)=>m(q)));else return $}class E extends O{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let $=this._def.shape(),q=R.objectKeys($);return this._cached={shape:$,keys:q},this._cached}_parse($){if(this._getType($)!==Q.object){let M=this._getOrReturnCtx($);return B(M,{code:X.invalid_type,expected:Q.object,received:M.parsedType}),z}let{status:_,ctx:G}=this._processInputParams($),{shape:W,keys:H}=this._getCached(),J=[];if(!(this._def.catchall instanceof C&&this._def.unknownKeys==="strip")){for(let M in G.data)if(!H.includes(M))J.push(M)}let Y=[];for(let M of H){let S=W[M],v=G.data[M];Y.push({key:{status:"valid",value:M},value:S._parse(new L(G,v,G.path,M)),alwaysSet:M in G.data})}if(this._def.catchall instanceof C){let M=this._def.unknownKeys;if(M==="passthrough")for(let S of J)Y.push({key:{status:"valid",value:S},value:{status:"valid",value:G.data[S]}});else if(M==="strict"){if(J.length>0)B(G,{code:X.unrecognized_keys,keys:J}),_.dirty()}else if(M==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let M=this._def.catchall;for(let S of J){let v=G.data[S];Y.push({key:{status:"valid",value:S},value:M._parse(new L(G,v,G.path,S)),alwaysSet:S in G.data})}}if(G.common.async)return Promise.resolve().then(async()=>{let M=[];for(let S of Y){let v=await S.key,V$=await S.value;M.push({key:v,value:V$,alwaysSet:S.alwaysSet})}return M}).then((M)=>{return V.mergeObjectSync(_,M)});else return V.mergeObjectSync(_,Y)}get shape(){return this._def.shape()}strict($){return w.errToObj,new E({...this._def,unknownKeys:"strict",...$!==void 0?{errorMap:(q,_)=>{let G=this._def.errorMap?.(q,_).message??_.defaultError;if(q.code==="unrecognized_keys")return{message:w.errToObj($).message??G};return{message:G}}}:{}})}strip(){return new E({...this._def,unknownKeys:"strip"})}passthrough(){return new E({...this._def,unknownKeys:"passthrough"})}extend($){return new E({...this._def,shape:()=>({...this._def.shape(),...$})})}merge($){return new E({unknownKeys:$._def.unknownKeys,catchall:$._def.catchall,shape:()=>({...this._def.shape(),...$._def.shape()}),typeName:j.ZodObject})}setKey($,q){return this.augment({[$]:q})}catchall($){return new E({...this._def,catchall:$})}pick($){let q={};for(let _ of R.objectKeys($))if($[_]&&this.shape[_])q[_]=this.shape[_];return new E({...this._def,shape:()=>q})}omit($){let q={};for(let _ of R.objectKeys(this.shape))if(!$[_])q[_]=this.shape[_];return new E({...this._def,shape:()=>q})}deepPartial(){return m(this)}partial($){let q={};for(let _ of R.objectKeys(this.shape)){let G=this.shape[_];if($&&!$[_])q[_]=G;else q[_]=G.optional()}return new E({...this._def,shape:()=>q})}required($){let q={};for(let _ of R.objectKeys(this.shape))if($&&!$[_])q[_]=this.shape[_];else{let W=this.shape[_];while(W instanceof D)W=W._def.innerType;q[_]=W}return new E({...this._def,shape:()=>q})}keyof(){return N$(R.objectKeys(this.shape))}}E.create=($,q)=>{return new E({shape:()=>$,unknownKeys:"strip",catchall:C.create(),typeName:j.ZodObject,...b(q)})};E.strictCreate=($,q)=>{return new E({shape:()=>$,unknownKeys:"strict",catchall:C.create(),typeName:j.ZodObject,...b(q)})};E.lazycreate=($,q)=>{return new E({shape:$,unknownKeys:"strip",catchall:C.create(),typeName:j.ZodObject,...b(q)})};class a extends O{_parse($){let{ctx:q}=this._processInputParams($),_=this._def.options;function G(W){for(let J of W)if(J.result.status==="valid")return J.result;for(let J of W)if(J.result.status==="dirty")return q.common.issues.push(...J.ctx.common.issues),J.result;let H=W.map((J)=>new A(J.ctx.common.issues));return B(q,{code:X.invalid_union,unionErrors:H}),z}if(q.common.async)return Promise.all(_.map(async(W)=>{let H={...q,common:{...q.common,issues:[]},parent:null};return{result:await W._parseAsync({data:q.data,path:q.path,parent:H}),ctx:H}})).then(G);else{let W=void 0,H=[];for(let Y of _){let M={...q,common:{...q.common,issues:[]},parent:null},S=Y._parseSync({data:q.data,path:q.path,parent:M});if(S.status==="valid")return S;else if(S.status==="dirty"&&!W)W={result:S,ctx:M};if(M.common.issues.length)H.push(M.common.issues)}if(W)return q.common.issues.push(...W.ctx.common.issues),W.result;let J=H.map((Y)=>new A(Y));return B(q,{code:X.invalid_union,unionErrors:J}),z}}get options(){return this._def.options}}a.create=($,q)=>{return new a({options:$,typeName:j.ZodUnion,...b(q)})};var K=($)=>{if($ instanceof t)return K($.schema);else if($ instanceof f)return K($.innerType());else if($ instanceof e)return[$.value];else if($ instanceof l)return $.options;else if($ instanceof $$)return R.objectValues($.enum);else if($ instanceof q$)return K($._def.innerType);else if($ instanceof o)return[void 0];else if($ instanceof d)return[null];else if($ instanceof D)return[void 0,...K($.unwrap())];else if($ instanceof P)return[null,...K($.unwrap())];else if($ instanceof E$)return K($.unwrap());else if($ instanceof W$)return K($.unwrap());else if($ instanceof _$)return K($._def.innerType);else return[]};class R$ extends O{_parse($){let{ctx:q}=this._processInputParams($);if(q.parsedType!==Q.object)return B(q,{code:X.invalid_type,expected:Q.object,received:q.parsedType}),z;let _=this.discriminator,G=q.data[_],W=this.optionsMap.get(G);if(!W)return B(q,{code:X.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[_]}),z;if(q.common.async)return W._parseAsync({data:q.data,path:q.path,parent:q});else return W._parseSync({data:q.data,path:q.path,parent:q})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create($,q,_){let G=new Map;for(let W of q){let H=K(W.shape[$]);if(!H.length)throw Error(`A discriminator value for key \`${$}\` could not be extracted from all schema options`);for(let J of H){if(G.has(J))throw Error(`Discriminator property ${String($)} has duplicate value ${String(J)}`);G.set(J,W)}}return new R$({typeName:j.ZodDiscriminatedUnion,discriminator:$,options:q,optionsMap:G,...b(_)})}}function O$($,q){let _=F($),G=F(q);if($===q)return{valid:!0,data:$};else if(_===Q.object&&G===Q.object){let W=R.objectKeys(q),H=R.objectKeys($).filter((Y)=>W.indexOf(Y)!==-1),J={...$,...q};for(let Y of H){let M=O$($[Y],q[Y]);if(!M.valid)return{valid:!1};J[Y]=M.data}return{valid:!0,data:J}}else if(_===Q.array&&G===Q.array){if($.length!==q.length)return{valid:!1};let W=[];for(let H=0;H<$.length;H++){let J=$[H],Y=q[H],M=O$(J,Y);if(!M.valid)return{valid:!1};W.push(M.data)}return{valid:!0,data:W}}else if(_===Q.date&&G===Q.date&&+$===+q)return{valid:!0,data:$};else return{valid:!1}}class s extends O{_parse($){let{status:q,ctx:_}=this._processInputParams($),G=(W,H)=>{if(j$(W)||j$(H))return z;let J=O$(W.value,H.value);if(!J.valid)return B(_,{code:X.invalid_intersection_types}),z;if(b$(W)||b$(H))q.dirty();return{status:q.value,value:J.data}};if(_.common.async)return Promise.all([this._def.left._parseAsync({data:_.data,path:_.path,parent:_}),this._def.right._parseAsync({data:_.data,path:_.path,parent:_})]).then(([W,H])=>G(W,H));else return G(this._def.left._parseSync({data:_.data,path:_.path,parent:_}),this._def.right._parseSync({data:_.data,path:_.path,parent:_}))}}s.create=($,q,_)=>{return new s({left:$,right:q,typeName:j.ZodIntersection,...b(_)})};class g extends O{_parse($){let{status:q,ctx:_}=this._processInputParams($);if(_.parsedType!==Q.array)return B(_,{code:X.invalid_type,expected:Q.array,received:_.parsedType}),z;if(_.data.length<this._def.items.length)return B(_,{code:X.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),z;if(!this._def.rest&&_.data.length>this._def.items.length)B(_,{code:X.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),q.dirty();let W=[..._.data].map((H,J)=>{let Y=this._def.items[J]||this._def.rest;if(!Y)return null;return Y._parse(new L(_,H,_.path,J))}).filter((H)=>!!H);if(_.common.async)return Promise.all(W).then((H)=>{return V.mergeArray(q,H)});else return V.mergeArray(q,W)}get items(){return this._def.items}rest($){return new g({...this._def,rest:$})}}g.create=($,q)=>{if(!Array.isArray($))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new g({items:$,typeName:j.ZodTuple,rest:null,...b(q)})};class Y$ extends O{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse($){let{status:q,ctx:_}=this._processInputParams($);if(_.parsedType!==Q.object)return B(_,{code:X.invalid_type,expected:Q.object,received:_.parsedType}),z;let G=[],W=this._def.keyType,H=this._def.valueType;for(let J in _.data)G.push({key:W._parse(new L(_,J,_.path,J)),value:H._parse(new L(_,_.data[J],_.path,J)),alwaysSet:J in _.data});if(_.common.async)return V.mergeObjectAsync(q,G);else return V.mergeObjectSync(q,G)}get element(){return this._def.valueType}static create($,q,_){if(q instanceof O)return new Y$({keyType:$,valueType:q,typeName:j.ZodRecord,...b(_)});return new Y$({keyType:k.create(),valueType:$,typeName:j.ZodRecord,...b(q)})}}class M$ extends O{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse($){let{status:q,ctx:_}=this._processInputParams($);if(_.parsedType!==Q.map)return B(_,{code:X.invalid_type,expected:Q.map,received:_.parsedType}),z;let G=this._def.keyType,W=this._def.valueType,H=[..._.data.entries()].map(([J,Y],M)=>{return{key:G._parse(new L(_,J,_.path,[M,"key"])),value:W._parse(new L(_,Y,_.path,[M,"value"]))}});if(_.common.async){let J=new Map;return Promise.resolve().then(async()=>{for(let Y of H){let M=await Y.key,S=await Y.value;if(M.status==="aborted"||S.status==="aborted")return z;if(M.status==="dirty"||S.status==="dirty")q.dirty();J.set(M.value,S.value)}return{status:q.value,value:J}})}else{let J=new Map;for(let Y of H){let{key:M,value:S}=Y;if(M.status==="aborted"||S.status==="aborted")return z;if(M.status==="dirty"||S.status==="dirty")q.dirty();J.set(M.value,S.value)}return{status:q.value,value:J}}}}M$.create=($,q,_)=>{return new M$({valueType:q,keyType:$,typeName:j.ZodMap,...b(_)})};class n extends O{_parse($){let{status:q,ctx:_}=this._processInputParams($);if(_.parsedType!==Q.set)return B(_,{code:X.invalid_type,expected:Q.set,received:_.parsedType}),z;let G=this._def;if(G.minSize!==null){if(_.data.size<G.minSize.value)B(_,{code:X.too_small,minimum:G.minSize.value,type:"set",inclusive:!0,exact:!1,message:G.minSize.message}),q.dirty()}if(G.maxSize!==null){if(_.data.size>G.maxSize.value)B(_,{code:X.too_big,maximum:G.maxSize.value,type:"set",inclusive:!0,exact:!1,message:G.maxSize.message}),q.dirty()}let W=this._def.valueType;function H(Y){let M=new Set;for(let S of Y){if(S.status==="aborted")return z;if(S.status==="dirty")q.dirty();M.add(S.value)}return{status:q.value,value:M}}let J=[..._.data.values()].map((Y,M)=>W._parse(new L(_,Y,_.path,M)));if(_.common.async)return Promise.all(J).then((Y)=>H(Y));else return H(J)}min($,q){return new n({...this._def,minSize:{value:$,message:w.toString(q)}})}max($,q){return new n({...this._def,maxSize:{value:$,message:w.toString(q)}})}size($,q){return this.min($,q).max($,q)}nonempty($){return this.min(1,$)}}n.create=($,q)=>{return new n({valueType:$,minSize:null,maxSize:null,typeName:j.ZodSet,...b(q)})};class i extends O{constructor(){super(...arguments);this.validate=this.implement}_parse($){let{ctx:q}=this._processInputParams($);if(q.parsedType!==Q.function)return B(q,{code:X.invalid_type,expected:Q.function,received:q.parsedType}),z;function _(J,Y){return G$({data:J,path:q.path,errorMaps:[q.common.contextualErrorMap,q.schemaErrorMap,u(),I].filter((M)=>!!M),issueData:{code:X.invalid_arguments,argumentsError:Y}})}function G(J,Y){return G$({data:J,path:q.path,errorMaps:[q.common.contextualErrorMap,q.schemaErrorMap,u(),I].filter((M)=>!!M),issueData:{code:X.invalid_return_type,returnTypeError:Y}})}let W={errorMap:q.common.contextualErrorMap},H=q.data;if(this._def.returns instanceof c){let J=this;return U(async function(...Y){let M=new A([]),S=await J._def.args.parseAsync(Y,W).catch((z$)=>{throw M.addIssue(_(Y,z$)),M}),v=await Reflect.apply(H,this,S);return await J._def.returns._def.type.parseAsync(v,W).catch((z$)=>{throw M.addIssue(G(v,z$)),M})})}else{let J=this;return U(function(...Y){let M=J._def.args.safeParse(Y,W);if(!M.success)throw new A([_(Y,M.error)]);let S=Reflect.apply(H,this,M.data),v=J._def.returns.safeParse(S,W);if(!v.success)throw new A([G(S,v.error)]);return v.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...$){return new i({...this._def,args:g.create($).rest(T.create())})}returns($){return new i({...this._def,returns:$})}implement($){return this.parse($)}strictImplement($){return this.parse($)}static create($,q,_){return new i({args:$?$:g.create([]).rest(T.create()),returns:q||T.create(),typeName:j.ZodFunction,...b(_)})}}class t extends O{get schema(){return this._def.getter()}_parse($){let{ctx:q}=this._processInputParams($);return this._def.getter()._parse({data:q.data,path:q.path,parent:q})}}t.create=($,q)=>{return new t({getter:$,typeName:j.ZodLazy,...b(q)})};class e extends O{_parse($){if($.data!==this._def.value){let q=this._getOrReturnCtx($);return B(q,{received:q.data,code:X.invalid_literal,expected:this._def.value}),z}return{status:"valid",value:$.data}}get value(){return this._def.value}}e.create=($,q)=>{return new e({value:$,typeName:j.ZodLiteral,...b(q)})};function N$($,q){return new l({values:$,typeName:j.ZodEnum,...b(q)})}class l extends O{_parse($){if(typeof $.data!=="string"){let q=this._getOrReturnCtx($),_=this._def.values;return B(q,{expected:R.joinValues(_),received:q.parsedType,code:X.invalid_type}),z}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has($.data)){let q=this._getOrReturnCtx($),_=this._def.values;return B(q,{received:q.data,code:X.invalid_enum_value,options:_}),z}return U($.data)}get options(){return this._def.values}get enum(){let $={};for(let q of this._def.values)$[q]=q;return $}get Values(){let $={};for(let q of this._def.values)$[q]=q;return $}get Enum(){let $={};for(let q of this._def.values)$[q]=q;return $}extract($,q=this._def){return l.create($,{...this._def,...q})}exclude($,q=this._def){return l.create(this.options.filter((_)=>!$.includes(_)),{...this._def,...q})}}l.create=N$;class $$ extends O{_parse($){let q=R.getValidEnumValues(this._def.values),_=this._getOrReturnCtx($);if(_.parsedType!==Q.string&&_.parsedType!==Q.number){let G=R.objectValues(q);return B(_,{expected:R.joinValues(G),received:_.parsedType,code:X.invalid_type}),z}if(!this._cache)this._cache=new Set(R.getValidEnumValues(this._def.values));if(!this._cache.has($.data)){let G=R.objectValues(q);return B(_,{received:_.data,code:X.invalid_enum_value,options:G}),z}return U($.data)}get enum(){return this._def.values}}$$.create=($,q)=>{return new $$({values:$,typeName:j.ZodNativeEnum,...b(q)})};class c extends O{unwrap(){return this._def.type}_parse($){let{ctx:q}=this._processInputParams($);if(q.parsedType!==Q.promise&&q.common.async===!1)return B(q,{code:X.invalid_type,expected:Q.promise,received:q.parsedType}),z;let _=q.parsedType===Q.promise?q.data:Promise.resolve(q.data);return U(_.then((G)=>{return this._def.type.parseAsync(G,{path:q.path,errorMap:q.common.contextualErrorMap})}))}}c.create=($,q)=>{return new c({type:$,typeName:j.ZodPromise,...b(q)})};class f extends O{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===j.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse($){let{status:q,ctx:_}=this._processInputParams($),G=this._def.effect||null,W={addIssue:(H)=>{if(B(_,H),H.fatal)q.abort();else q.dirty()},get path(){return _.path}};if(W.addIssue=W.addIssue.bind(W),G.type==="preprocess"){let H=G.transform(_.data,W);if(_.common.async)return Promise.resolve(H).then(async(J)=>{if(q.value==="aborted")return z;let Y=await this._def.schema._parseAsync({data:J,path:_.path,parent:_});if(Y.status==="aborted")return z;if(Y.status==="dirty")return x(Y.value);if(q.value==="dirty")return x(Y.value);return Y});else{if(q.value==="aborted")return z;let J=this._def.schema._parseSync({data:H,path:_.path,parent:_});if(J.status==="aborted")return z;if(J.status==="dirty")return x(J.value);if(q.value==="dirty")return x(J.value);return J}}if(G.type==="refinement"){let H=(J)=>{let Y=G.refinement(J,W);if(_.common.async)return Promise.resolve(Y);if(Y instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return J};if(_.common.async===!1){let J=this._def.schema._parseSync({data:_.data,path:_.path,parent:_});if(J.status==="aborted")return z;if(J.status==="dirty")q.dirty();return H(J.value),{status:q.value,value:J.value}}else return this._def.schema._parseAsync({data:_.data,path:_.path,parent:_}).then((J)=>{if(J.status==="aborted")return z;if(J.status==="dirty")q.dirty();return H(J.value).then(()=>{return{status:q.value,value:J.value}})})}if(G.type==="transform")if(_.common.async===!1){let H=this._def.schema._parseSync({data:_.data,path:_.path,parent:_});if(!h(H))return z;let J=G.transform(H.value,W);if(J instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:q.value,value:J}}else return this._def.schema._parseAsync({data:_.data,path:_.path,parent:_}).then((H)=>{if(!h(H))return z;return Promise.resolve(G.transform(H.value,W)).then((J)=>({status:q.value,value:J}))});R.assertNever(G)}}f.create=($,q,_)=>{return new f({schema:$,typeName:j.ZodEffects,effect:q,...b(_)})};f.createWithPreprocess=($,q,_)=>{return new f({schema:q,effect:{type:"preprocess",transform:$},typeName:j.ZodEffects,...b(_)})};class D extends O{_parse($){if(this._getType($)===Q.undefined)return U(void 0);return this._def.innerType._parse($)}unwrap(){return this._def.innerType}}D.create=($,q)=>{return new D({innerType:$,typeName:j.ZodOptional,...b(q)})};class P extends O{_parse($){if(this._getType($)===Q.null)return U(null);return this._def.innerType._parse($)}unwrap(){return this._def.innerType}}P.create=($,q)=>{return new P({innerType:$,typeName:j.ZodNullable,...b(q)})};class q$ extends O{_parse($){let{ctx:q}=this._processInputParams($),_=q.data;if(q.parsedType===Q.undefined)_=this._def.defaultValue();return this._def.innerType._parse({data:_,path:q.path,parent:q})}removeDefault(){return this._def.innerType}}q$.create=($,q)=>{return new q$({innerType:$,typeName:j.ZodDefault,defaultValue:typeof q.default==="function"?q.default:()=>q.default,...b(q)})};class _$ extends O{_parse($){let{ctx:q}=this._processInputParams($),_={...q,common:{...q.common,issues:[]}},G=this._def.innerType._parse({data:_.data,path:_.path,parent:{..._}});if(p(G))return G.then((W)=>{return{status:"valid",value:W.status==="valid"?W.value:this._def.catchValue({get error(){return new A(_.common.issues)},input:_.data})}});else return{status:"valid",value:G.status==="valid"?G.value:this._def.catchValue({get error(){return new A(_.common.issues)},input:_.data})}}removeCatch(){return this._def.innerType}}_$.create=($,q)=>{return new _$({innerType:$,typeName:j.ZodCatch,catchValue:typeof q.catch==="function"?q.catch:()=>q.catch,...b(q)})};class B$ extends O{_parse($){if(this._getType($)!==Q.nan){let _=this._getOrReturnCtx($);return B(_,{code:X.invalid_type,expected:Q.nan,received:_.parsedType}),z}return{status:"valid",value:$.data}}}B$.create=($)=>{return new B$({typeName:j.ZodNaN,...b($)})};var zq=Symbol("zod_brand");class E$ extends O{_parse($){let{ctx:q}=this._processInputParams($),_=q.data;return this._def.type._parse({data:_,path:q.path,parent:q})}unwrap(){return this._def.type}}class w$ extends O{_parse($){let{status:q,ctx:_}=this._processInputParams($);if(_.common.async)return(async()=>{let W=await this._def.in._parseAsync({data:_.data,path:_.path,parent:_});if(W.status==="aborted")return z;if(W.status==="dirty")return q.dirty(),x(W.value);else return this._def.out._parseAsync({data:W.value,path:_.path,parent:_})})();else{let G=this._def.in._parseSync({data:_.data,path:_.path,parent:_});if(G.status==="aborted")return z;if(G.status==="dirty")return q.dirty(),{status:"dirty",value:G.value};else return this._def.out._parseSync({data:G.value,path:_.path,parent:_})}}static create($,q){return new w$({in:$,out:q,typeName:j.ZodPipeline})}}class W$ extends O{_parse($){let q=this._def.innerType._parse($),_=(G)=>{if(h(G))G.value=Object.freeze(G.value);return G};return p(q)?q.then((G)=>_(G)):_(q)}unwrap(){return this._def.innerType}}W$.create=($,q)=>{return new W$({innerType:$,typeName:j.ZodReadonly,...b(q)})};var jq={object:E.lazycreate},j;(function($){$.ZodString="ZodString",$.ZodNumber="ZodNumber",$.ZodNaN="ZodNaN",$.ZodBigInt="ZodBigInt",$.ZodBoolean="ZodBoolean",$.ZodDate="ZodDate",$.ZodSymbol="ZodSymbol",$.ZodUndefined="ZodUndefined",$.ZodNull="ZodNull",$.ZodAny="ZodAny",$.ZodUnknown="ZodUnknown",$.ZodNever="ZodNever",$.ZodVoid="ZodVoid",$.ZodArray="ZodArray",$.ZodObject="ZodObject",$.ZodUnion="ZodUnion",$.ZodDiscriminatedUnion="ZodDiscriminatedUnion",$.ZodIntersection="ZodIntersection",$.ZodTuple="ZodTuple",$.ZodRecord="ZodRecord",$.ZodMap="ZodMap",$.ZodSet="ZodSet",$.ZodFunction="ZodFunction",$.ZodLazy="ZodLazy",$.ZodLiteral="ZodLiteral",$.ZodEnum="ZodEnum",$.ZodEffects="ZodEffects",$.ZodNativeEnum="ZodNativeEnum",$.ZodOptional="ZodOptional",$.ZodNullable="ZodNullable",$.ZodDefault="ZodDefault",$.ZodCatch="ZodCatch",$.ZodPromise="ZodPromise",$.ZodBranded="ZodBranded",$.ZodPipeline="ZodPipeline",$.ZodReadonly="ZodReadonly"})(j||(j={}));var bq=k.create,Sq=y.create,Oq=B$.create,Rq=Z.create,Eq=H$.create,Vq=r.create,Uq=J$.create,Aq=o.create,vq=d.create,Lq=X$.create,Nq=T.create,Dq=C.create,fq=Q$.create,Fq=N.create,Kq=E.create,kq=E.strictCreate,Cq=a.create,gq=R$.create,Iq=s.create,Pq=g.create,hq=Y$.create,Tq=M$.create,lq=n.create,xq=i.create,mq=t.create,yq=e.create,Zq=l.create,nq=$$.create,cq=c.create,uq=f.create,pq=D.create,iq=P.create,rq=f.createWithPreprocess,oq=w$.create;
3
- export{j as yr};
3
+ export{j as $p};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import"./chunk-e0vrxetq.js";var k="./opentui-drfwd3v7.dll";export{k as default};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Jd as a}from"./chunk-eyr5ymt8.js";import"./chunk-rk0fnvp5.js";import"./chunk-f2pv705d.js";export{a as dict};
2
+ import{Jd as a}from"./chunk-eyr5ymt8.js";import"./chunk-rk0fnvp5.js";import"./chunk-e0vrxetq.js";export{a as dict};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{Lu as L}from"./chunk-k1x8469r.js";import{EI as M,LC as C,iJ as F}from"./chunk-tezrgfc6.js";var g=(q)=>(H)=>Object.assign(H,q(H));function k(){return(q,H)=>{class G{static make(J){return J}}return Object.setPrototypeOf(G,H),G}}var y=Symbol.for("effect-zod/override"),A=Symbol.for("effect-zod/preprocess"),B=new WeakMap,N={};function n(q){return V(q.ast)}function V(q){let H=B.get(q);if(H)return H;let G=D(q);return B.set(q,G),G}function D(q){let H=q.annotations?.[y];if(H)return H;let X=q.encoding?.length&&q._tag!=="Declaration"&&!(F.isOptional(q)&&_(q)!==void 0)?I(q):x(q),R=q.checks?.length?E(X,q.checks,q):X,Y=q.annotations?.[A],W=Y?L.preprocess(Y,R):R,U=F.resolveDescription(q),j=F.resolveIdentifier(q),Z=U?W.describe(U):W;return j?Z.meta({ref:j}):Z}function I(q){let H=q.encoding;return H.reduce((G,J)=>G.transform((X)=>P(J.transformation,X)),V(H[0].to))}function P(q,H){let G=M.runSyncExit(q.decode.run(C.some(H),N));if(G._tag==="Failure")throw Error(`effect-zod: transform failed: ${String(G.cause)}`);return C.getOrElse(G.value,()=>H)}function E(q,H,G){let J=[],X=(W)=>{if(W._tag==="FilterGroup")W.checks.forEach(X);else J.push(W)};H.forEach(X);let R=[],Y=J.reduce((W,U)=>{let j=O(W,U);if(j)return j;return R.push(U),W},q);if(R.length===0)return Y;return Y.superRefine((W,U)=>{for(let j of R){let Z=j.run(W,G,N);if(!Z)continue;let Q=b(Z)??j.annotations?.message??"Validation failed";U.addIssue({code:"custom",message:Q})}})}function O(q,H){let G=H.annotations?.meta;if(!G||typeof G._tag!=="string")return;switch(G._tag){case"isInt":return K(q,"int");case"isFinite":return K(q,"finite");case"isGreaterThan":return K(q,"gt",G.exclusiveMinimum);case"isGreaterThanOrEqualTo":return K(q,"gte",G.minimum);case"isLessThan":return K(q,"lt",G.exclusiveMaximum);case"isLessThanOrEqualTo":return K(q,"lte",G.maximum);case"isBetween":{let J=G.exclusiveMinimum?K(q,"gt",G.minimum):K(q,"gte",G.minimum);if(!J)return;return G.exclusiveMaximum?K(J,"lt",G.maximum):K(J,"lte",G.maximum)}case"isMultipleOf":return K(q,"multipleOf",G.divisor);case"isMinLength":return K(q,"min",G.minLength);case"isMaxLength":return K(q,"max",G.maxLength);case"isLengthBetween":{let J=K(q,"min",G.minimum);if(!J)return;return K(J,"max",G.maximum)}case"isPattern":return K(q,"regex",G.regExp);case"isStartsWith":return K(q,"startsWith",G.startsWith);case"isEndsWith":return K(q,"endsWith",G.endsWith);case"isIncludes":return K(q,"includes",G.includes);case"isUUID":return K(q,"uuid");case"isULID":return K(q,"ulid");case"isBase64":return K(q,"base64");case"isBase64Url":return K(q,"base64url")}return}function K(q,H,...G){let J=q[H];return typeof J==="function"?J.apply(q,G):void 0}function b(q){if(typeof q?.annotations?.message==="string")return q.annotations.message;if(typeof q?.message==="string")return q.message;return}function x(q){if(F.isOptional(q))return T(q);switch(q._tag){case"String":return L.string();case"Number":return L.number();case"Boolean":return L.boolean();case"Null":return L.null();case"Undefined":return L.undefined();case"Any":case"Unknown":return L.unknown();case"Never":return L.never();case"Literal":return L.literal(q.literal);case"Union":return v(q);case"Objects":return w(q);case"Arrays":return S(q);case"Declaration":return z(q);default:return $(q)}}function T(q){if(q._tag!=="Union")return $(q);let H=q.types.filter((X)=>X._tag!=="Undefined"),G=H.length===1?V(H[0]):H.length>1?L.union(H.map(V)):L.undefined(),J=_(q);if(J!==void 0)return G.default(J.value);return G.optional()}function _(q){let H=q.encoding;if(!H?.length)return;for(let G of H){let J=M.runSyncExit(G.transformation.decode.run(C.none(),{}));if(J._tag!=="Success")continue;if(C.isSome(J.value))return{value:J.value.value}}return}function v(q){if(q.types.length>=2&&q.types.every((J)=>J._tag==="Literal"&&typeof J.literal==="string"))return L.enum(q.types.map((J)=>J.literal));let H=q.types.map(V);if(H.length===1)return H[0];if(H.length<2)return $(q);let G=q.annotations?.discriminator;if(typeof G==="string")return L.discriminatedUnion(G,H);return L.union(H)}function w(q){if(q.propertySignatures.length===0&&q.indexSignatures.length===1){let G=q.indexSignatures[0];if(G.parameter._tag!=="String")return $(q);return L.record(L.string(),V(G.type))}if(q.indexSignatures.length===0)return L.object(Object.fromEntries(q.propertySignatures.map((G)=>[String(G.name),V(G.type)])));if(q.indexSignatures.length!==1)return $(q);let H=q.indexSignatures[0];if(H.parameter._tag!=="String")return $(q);return L.object(Object.fromEntries(q.propertySignatures.map((G)=>[String(G.name),V(G.type)]))).catchall(V(H.type))}function S(q){if(q.elements.length===0){if(q.rest.length!==1)return $(q);return L.array(V(q.rest[0]))}if(q.rest.length>0)return $(q);let H=q.elements.map(V);return L.tuple(H)}function z(q){if(q.typeParameters.length!==1)return $(q);return V(q.typeParameters[0])}function $(q){let H=F.resolveIdentifier(q);throw Error(`unsupported effect schema: ${H??q._tag}`)}
3
- export{g as ip,k as jp,y as kp,A as lp,n as mp};
2
+ import{mt as L}from"./chunk-6p6m5956.js";import{LH as F,fH as M,mB as C}from"./chunk-g7v6sp3c.js";var g=(q)=>(H)=>Object.assign(H,q(H));function k(){return(q,H)=>{class G{static make(J){return J}}return Object.setPrototypeOf(G,H),G}}var y=Symbol.for("effect-zod/override"),A=Symbol.for("effect-zod/preprocess"),B=new WeakMap,N={};function n(q){return V(q.ast)}function V(q){let H=B.get(q);if(H)return H;let G=D(q);return B.set(q,G),G}function D(q){let H=q.annotations?.[y];if(H)return H;let X=q.encoding?.length&&q._tag!=="Declaration"&&!(F.isOptional(q)&&_(q)!==void 0)?I(q):x(q),R=q.checks?.length?E(X,q.checks,q):X,Y=q.annotations?.[A],W=Y?L.preprocess(Y,R):R,U=F.resolveDescription(q),j=F.resolveIdentifier(q),Z=U?W.describe(U):W;return j?Z.meta({ref:j}):Z}function I(q){let H=q.encoding;return H.reduce((G,J)=>G.transform((X)=>P(J.transformation,X)),V(H[0].to))}function P(q,H){let G=M.runSyncExit(q.decode.run(C.some(H),N));if(G._tag==="Failure")throw Error(`effect-zod: transform failed: ${String(G.cause)}`);return C.getOrElse(G.value,()=>H)}function E(q,H,G){let J=[],X=(W)=>{if(W._tag==="FilterGroup")W.checks.forEach(X);else J.push(W)};H.forEach(X);let R=[],Y=J.reduce((W,U)=>{let j=O(W,U);if(j)return j;return R.push(U),W},q);if(R.length===0)return Y;return Y.superRefine((W,U)=>{for(let j of R){let Z=j.run(W,G,N);if(!Z)continue;let Q=b(Z)??j.annotations?.message??"Validation failed";U.addIssue({code:"custom",message:Q})}})}function O(q,H){let G=H.annotations?.meta;if(!G||typeof G._tag!=="string")return;switch(G._tag){case"isInt":return K(q,"int");case"isFinite":return K(q,"finite");case"isGreaterThan":return K(q,"gt",G.exclusiveMinimum);case"isGreaterThanOrEqualTo":return K(q,"gte",G.minimum);case"isLessThan":return K(q,"lt",G.exclusiveMaximum);case"isLessThanOrEqualTo":return K(q,"lte",G.maximum);case"isBetween":{let J=G.exclusiveMinimum?K(q,"gt",G.minimum):K(q,"gte",G.minimum);if(!J)return;return G.exclusiveMaximum?K(J,"lt",G.maximum):K(J,"lte",G.maximum)}case"isMultipleOf":return K(q,"multipleOf",G.divisor);case"isMinLength":return K(q,"min",G.minLength);case"isMaxLength":return K(q,"max",G.maxLength);case"isLengthBetween":{let J=K(q,"min",G.minimum);if(!J)return;return K(J,"max",G.maximum)}case"isPattern":return K(q,"regex",G.regExp);case"isStartsWith":return K(q,"startsWith",G.startsWith);case"isEndsWith":return K(q,"endsWith",G.endsWith);case"isIncludes":return K(q,"includes",G.includes);case"isUUID":return K(q,"uuid");case"isULID":return K(q,"ulid");case"isBase64":return K(q,"base64");case"isBase64Url":return K(q,"base64url")}return}function K(q,H,...G){let J=q[H];return typeof J==="function"?J.apply(q,G):void 0}function b(q){if(typeof q?.annotations?.message==="string")return q.annotations.message;if(typeof q?.message==="string")return q.message;return}function x(q){if(F.isOptional(q))return T(q);switch(q._tag){case"String":return L.string();case"Number":return L.number();case"Boolean":return L.boolean();case"Null":return L.null();case"Undefined":return L.undefined();case"Any":case"Unknown":return L.unknown();case"Never":return L.never();case"Literal":return L.literal(q.literal);case"Union":return v(q);case"Objects":return w(q);case"Arrays":return S(q);case"Declaration":return z(q);default:return $(q)}}function T(q){if(q._tag!=="Union")return $(q);let H=q.types.filter((X)=>X._tag!=="Undefined"),G=H.length===1?V(H[0]):H.length>1?L.union(H.map(V)):L.undefined(),J=_(q);if(J!==void 0)return G.default(J.value);return G.optional()}function _(q){let H=q.encoding;if(!H?.length)return;for(let G of H){let J=M.runSyncExit(G.transformation.decode.run(C.none(),{}));if(J._tag!=="Success")continue;if(C.isSome(J.value))return{value:J.value.value}}return}function v(q){if(q.types.length>=2&&q.types.every((J)=>J._tag==="Literal"&&typeof J.literal==="string"))return L.enum(q.types.map((J)=>J.literal));let H=q.types.map(V);if(H.length===1)return H[0];if(H.length<2)return $(q);let G=q.annotations?.discriminator;if(typeof G==="string")return L.discriminatedUnion(G,H);return L.union(H)}function w(q){if(q.propertySignatures.length===0&&q.indexSignatures.length===1){let G=q.indexSignatures[0];if(G.parameter._tag!=="String")return $(q);return L.record(L.string(),V(G.type))}if(q.indexSignatures.length===0)return L.object(Object.fromEntries(q.propertySignatures.map((G)=>[String(G.name),V(G.type)])));if(q.indexSignatures.length!==1)return $(q);let H=q.indexSignatures[0];if(H.parameter._tag!=="String")return $(q);return L.object(Object.fromEntries(q.propertySignatures.map((G)=>[String(G.name),V(G.type)]))).catchall(V(H.type))}function S(q){if(q.elements.length===0){if(q.rest.length!==1)return $(q);return L.array(V(q.rest[0]))}if(q.rest.length>0)return $(q);let H=q.elements.map(V);return L.tuple(H)}function z(q){if(q.typeParameters.length!==1)return $(q);return V(q.typeParameters[0])}function $(q){let H=F.resolveIdentifier(q);throw Error(`unsupported effect schema: ${H??q._tag}`)}
3
+ export{g as Ln,k as Mn,y as Nn,A as On,n as Pn};
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{Ne as oe}from"./chunk-9xxnwb33.js";import{If as _}from"./chunk-yxttz5z5.js";import{SP as m,WP as ee}from"./chunk-f2pv705d.js";var p=m(_(),1);var K=(e)=>e&&(typeof e.sso_start_url==="string"||typeof e.sso_account_id==="string"||typeof e.sso_session==="string"||typeof e.sso_region==="string"||typeof e.sso_role_name==="string");var R=m(oe(),1);var c=m(_(),1);var b=300000,k="To refresh this SSO session run 'aws sso login' with the corresponding profile.";var H=async(e,o={},r)=>{let{SSOOIDCClient:t}=await import("./chunk-t9qyzzsz.js"),n=(f)=>o.clientConfig?.[f]??o.parentClientConfig?.[f]??r?.[f];return new t(Object.assign({},o.clientConfig??{},{region:e??o.clientConfig?.region,logger:n("logger"),userAgentAppId:n("userAgentAppId")}))};var U=async(e,o,r={},t)=>{let{CreateTokenCommand:n}=await import("./chunk-t9qyzzsz.js");return(await H(o,r,t)).send(new n({clientId:e.clientId,clientSecret:e.clientSecret,refreshToken:e.refreshToken,grantType:"refresh_token"}))};var q=m(_(),1);var C=(e)=>{if(e.expiration&&e.expiration.getTime()<Date.now())throw new q.TokenProviderError(`Token is expired. ${k}`,!1)};var W=m(_(),1);var w=(e,o,r=!1)=>{if(typeof o>"u")throw new W.TokenProviderError(`Value not present for '${e}' in SSO Token${r?". Cannot refresh":""}. ${k}`,!1)};var j=m(_(),1);import{promises as Q}from"fs";var{writeFile:Z}=Q,X=(e,o)=>{let r=j.getSSOTokenFilepath(e),t=JSON.stringify(o,null,2);return Z(r,t)};var z=new Date(0),J=(e={})=>async({callerClientConfig:o}={})=>{e.logger?.debug("@aws-sdk/token-providers - fromSso");let r=await c.parseKnownFiles(e),t=c.getProfileName({profile:e.profile??o?.profile}),n=r[t];if(!n)throw new c.TokenProviderError(`Profile '${t}' could not be found in shared credentials file.`,!1);else if(!n.sso_session)throw new c.TokenProviderError(`Profile '${t}' is missing required property 'sso_session'.`);let a=n.sso_session,S=(await c.loadSsoSessionData(e))[a];if(!S)throw new c.TokenProviderError(`Sso session '${a}' could not be found in shared credentials file.`,!1);for(let i of["sso_start_url","sso_region"])if(!S[i])throw new c.TokenProviderError(`Sso session '${a}' is missing required property '${i}'.`,!1);let{sso_start_url:g,sso_region:O}=S,s;try{s=await c.getSSOTokenFromFile(a)}catch(i){throw new c.TokenProviderError(`The SSO session token associated with profile=${t} was not found or is invalid. ${k}`,!1)}w("accessToken",s.accessToken),w("expiresAt",s.expiresAt);let{accessToken:x,expiresAt:T}=s,l={token:x,expiration:new Date(T)};if(l.expiration.getTime()-Date.now()>b)return l;if(Date.now()-z.getTime()<30000)return C(l),l;w("clientId",s.clientId,!0),w("clientSecret",s.clientSecret,!0),w("refreshToken",s.refreshToken,!0);try{z.setTime(Date.now());let i=await U(s,O,e,o);w("accessToken",i.accessToken),w("expiresIn",i.expiresIn);let y=new Date(Date.now()+i.expiresIn*1000);try{await X(a,{...s,accessToken:i.accessToken,expiresAt:y.toISOString(),refreshToken:i.refreshToken})}catch(I){}return{token:i.accessToken,expiration:y}}catch(i){return C(l),l}};var d=m(_(),1),E=!1,v=async({ssoStartUrl:e,ssoSession:o,ssoAccountId:r,ssoRegion:t,ssoRoleName:n,ssoClient:a,clientConfig:f,parentClientConfig:S,callerClientConfig:g,profile:O,filepath:s,configFilepath:x,ignoreCache:T,logger:l})=>{let i,y="To refresh this SSO session run aws sso login with the corresponding profile.";if(o)try{let h=await J({profile:O,filepath:s,configFilepath:x,ignoreCache:T})();i={accessToken:h.token,expiresAt:new Date(h.expiration).toISOString()}}catch(h){throw new d.CredentialsProviderError(h.message,{tryNextLink:E,logger:l})}else try{i=await d.getSSOTokenFromFile(e)}catch(h){throw new d.CredentialsProviderError("The SSO session associated with this profile is invalid. To refresh this SSO session run aws sso login with the corresponding profile.",{tryNextLink:E,logger:l})}if(new Date(i.expiresAt).getTime()-Date.now()<=0)throw new d.CredentialsProviderError("The SSO session associated with this profile has expired. To refresh this SSO session run aws sso login with the corresponding profile.",{tryNextLink:E,logger:l});let{accessToken:I}=i,{SSOClient:u,GetRoleCredentialsCommand:A}=await import("./chunk-4jpab7ag.js"),B=a||new u(Object.assign({},f??{},{logger:f?.logger??g?.logger??S?.logger,region:f?.region??t,userAgentAppId:f?.userAgentAppId??g?.userAgentAppId??S?.userAgentAppId})),F;try{F=await B.send(new A({accountId:r,roleName:n,accessToken:I}))}catch(h){throw new d.CredentialsProviderError(h,{tryNextLink:E,logger:l})}let{roleCredentials:{accessKeyId:P,secretAccessKey:D,sessionToken:$,expiration:L,credentialScope:M,accountId:G}={}}=F;if(!P||!D||!$||!L)throw new d.CredentialsProviderError("SSO returns an invalid temporary credential.",{tryNextLink:E,logger:l});let N={accessKeyId:P,secretAccessKey:D,sessionToken:$,expiration:new Date(L),...M&&{credentialScope:M},...G&&{accountId:G}};if(o)R.setCredentialFeature(N,"CREDENTIALS_SSO","s");else R.setCredentialFeature(N,"CREDENTIALS_SSO_LEGACY","u");return N};var V=m(_(),1),Y=(e,o)=>{let{sso_start_url:r,sso_account_id:t,sso_region:n,sso_role_name:a}=e;if(!r||!t||!n||!a)throw new V.CredentialsProviderError(`Profile is configured with invalid SSO credentials. Required parameters "sso_account_id", "sso_region", "sso_role_name", "sso_start_url". Got ${Object.keys(e).join(", ")}
2
+ import{Ne as oe}from"./chunk-ejhhrece.js";import{If as _}from"./chunk-35fj1sfm.js";import{tO as m,xO as ee}from"./chunk-e0vrxetq.js";var p=m(_(),1);var K=(e)=>e&&(typeof e.sso_start_url==="string"||typeof e.sso_account_id==="string"||typeof e.sso_session==="string"||typeof e.sso_region==="string"||typeof e.sso_role_name==="string");var R=m(oe(),1);var c=m(_(),1);var b=300000,k="To refresh this SSO session run 'aws sso login' with the corresponding profile.";var H=async(e,o={},r)=>{let{SSOOIDCClient:t}=await import("./chunk-ryrxgn6d.js"),n=(f)=>o.clientConfig?.[f]??o.parentClientConfig?.[f]??r?.[f];return new t(Object.assign({},o.clientConfig??{},{region:e??o.clientConfig?.region,logger:n("logger"),userAgentAppId:n("userAgentAppId")}))};var U=async(e,o,r={},t)=>{let{CreateTokenCommand:n}=await import("./chunk-ryrxgn6d.js");return(await H(o,r,t)).send(new n({clientId:e.clientId,clientSecret:e.clientSecret,refreshToken:e.refreshToken,grantType:"refresh_token"}))};var q=m(_(),1);var C=(e)=>{if(e.expiration&&e.expiration.getTime()<Date.now())throw new q.TokenProviderError(`Token is expired. ${k}`,!1)};var W=m(_(),1);var w=(e,o,r=!1)=>{if(typeof o>"u")throw new W.TokenProviderError(`Value not present for '${e}' in SSO Token${r?". Cannot refresh":""}. ${k}`,!1)};var j=m(_(),1);import{promises as Q}from"fs";var{writeFile:Z}=Q,X=(e,o)=>{let r=j.getSSOTokenFilepath(e),t=JSON.stringify(o,null,2);return Z(r,t)};var z=new Date(0),J=(e={})=>async({callerClientConfig:o}={})=>{e.logger?.debug("@aws-sdk/token-providers - fromSso");let r=await c.parseKnownFiles(e),t=c.getProfileName({profile:e.profile??o?.profile}),n=r[t];if(!n)throw new c.TokenProviderError(`Profile '${t}' could not be found in shared credentials file.`,!1);else if(!n.sso_session)throw new c.TokenProviderError(`Profile '${t}' is missing required property 'sso_session'.`);let a=n.sso_session,S=(await c.loadSsoSessionData(e))[a];if(!S)throw new c.TokenProviderError(`Sso session '${a}' could not be found in shared credentials file.`,!1);for(let i of["sso_start_url","sso_region"])if(!S[i])throw new c.TokenProviderError(`Sso session '${a}' is missing required property '${i}'.`,!1);let{sso_start_url:g,sso_region:O}=S,s;try{s=await c.getSSOTokenFromFile(a)}catch(i){throw new c.TokenProviderError(`The SSO session token associated with profile=${t} was not found or is invalid. ${k}`,!1)}w("accessToken",s.accessToken),w("expiresAt",s.expiresAt);let{accessToken:x,expiresAt:T}=s,l={token:x,expiration:new Date(T)};if(l.expiration.getTime()-Date.now()>b)return l;if(Date.now()-z.getTime()<30000)return C(l),l;w("clientId",s.clientId,!0),w("clientSecret",s.clientSecret,!0),w("refreshToken",s.refreshToken,!0);try{z.setTime(Date.now());let i=await U(s,O,e,o);w("accessToken",i.accessToken),w("expiresIn",i.expiresIn);let y=new Date(Date.now()+i.expiresIn*1000);try{await X(a,{...s,accessToken:i.accessToken,expiresAt:y.toISOString(),refreshToken:i.refreshToken})}catch(I){}return{token:i.accessToken,expiration:y}}catch(i){return C(l),l}};var d=m(_(),1),E=!1,v=async({ssoStartUrl:e,ssoSession:o,ssoAccountId:r,ssoRegion:t,ssoRoleName:n,ssoClient:a,clientConfig:f,parentClientConfig:S,callerClientConfig:g,profile:O,filepath:s,configFilepath:x,ignoreCache:T,logger:l})=>{let i,y="To refresh this SSO session run aws sso login with the corresponding profile.";if(o)try{let h=await J({profile:O,filepath:s,configFilepath:x,ignoreCache:T})();i={accessToken:h.token,expiresAt:new Date(h.expiration).toISOString()}}catch(h){throw new d.CredentialsProviderError(h.message,{tryNextLink:E,logger:l})}else try{i=await d.getSSOTokenFromFile(e)}catch(h){throw new d.CredentialsProviderError("The SSO session associated with this profile is invalid. To refresh this SSO session run aws sso login with the corresponding profile.",{tryNextLink:E,logger:l})}if(new Date(i.expiresAt).getTime()-Date.now()<=0)throw new d.CredentialsProviderError("The SSO session associated with this profile has expired. To refresh this SSO session run aws sso login with the corresponding profile.",{tryNextLink:E,logger:l});let{accessToken:I}=i,{SSOClient:u,GetRoleCredentialsCommand:A}=await import("./chunk-gznt3dv8.js"),B=a||new u(Object.assign({},f??{},{logger:f?.logger??g?.logger??S?.logger,region:f?.region??t,userAgentAppId:f?.userAgentAppId??g?.userAgentAppId??S?.userAgentAppId})),F;try{F=await B.send(new A({accountId:r,roleName:n,accessToken:I}))}catch(h){throw new d.CredentialsProviderError(h,{tryNextLink:E,logger:l})}let{roleCredentials:{accessKeyId:P,secretAccessKey:D,sessionToken:$,expiration:L,credentialScope:M,accountId:G}={}}=F;if(!P||!D||!$||!L)throw new d.CredentialsProviderError("SSO returns an invalid temporary credential.",{tryNextLink:E,logger:l});let N={accessKeyId:P,secretAccessKey:D,sessionToken:$,expiration:new Date(L),...M&&{credentialScope:M},...G&&{accountId:G}};if(o)R.setCredentialFeature(N,"CREDENTIALS_SSO","s");else R.setCredentialFeature(N,"CREDENTIALS_SSO_LEGACY","u");return N};var V=m(_(),1),Y=(e,o)=>{let{sso_start_url:r,sso_account_id:t,sso_region:n,sso_role_name:a}=e;if(!r||!t||!n||!a)throw new V.CredentialsProviderError(`Profile is configured with invalid SSO credentials. Required parameters "sso_account_id", "sso_region", "sso_role_name", "sso_start_url". Got ${Object.keys(e).join(", ")}
3
3
  Reference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html`,{tryNextLink:!1,logger:o});return e};var Oe=(e={})=>async({callerClientConfig:o}={})=>{e.logger?.debug("@aws-sdk/credential-provider-sso - fromSSO");let{ssoStartUrl:r,ssoAccountId:t,ssoRegion:n,ssoRoleName:a,ssoSession:f}=e,{ssoClient:S}=e,g=p.getProfileName({profile:e.profile??o?.profile});if(!r&&!t&&!n&&!a&&!f){let s=(await p.parseKnownFiles(e))[g];if(!s)throw new p.CredentialsProviderError(`Profile ${g} was not found.`,{logger:e.logger});if(!K(s))throw new p.CredentialsProviderError(`Profile ${g} is not configured with SSO credentials.`,{logger:e.logger});if(s?.sso_session){let u=(await p.loadSsoSessionData(e))[s.sso_session],A=` configurations in profile ${g} and sso-session ${s.sso_session}`;if(n&&n!==u.sso_region)throw new p.CredentialsProviderError("Conflicting SSO region"+A,{tryNextLink:!1,logger:e.logger});if(r&&r!==u.sso_start_url)throw new p.CredentialsProviderError("Conflicting SSO start_url"+A,{tryNextLink:!1,logger:e.logger});s.sso_region=u.sso_region,s.sso_start_url=u.sso_start_url}let{sso_start_url:x,sso_account_id:T,sso_region:l,sso_role_name:i,sso_session:y}=Y(s,e.logger);return v({ssoStartUrl:x,ssoSession:y,ssoAccountId:T,ssoRegion:l,ssoRoleName:i,ssoClient:S,clientConfig:e.clientConfig,parentClientConfig:e.parentClientConfig,callerClientConfig:e.callerClientConfig,profile:g,filepath:e.filepath,configFilepath:e.configFilepath,ignoreCache:e.ignoreCache,logger:e.logger})}else if(!r||!t||!n||!a)throw new p.CredentialsProviderError('Incomplete configuration. The fromSSO() argument hash must include "ssoStartUrl", "ssoAccountId", "ssoRegion", "ssoRoleName"',{tryNextLink:!1,logger:e.logger});else return v({ssoStartUrl:r,ssoSession:f,ssoAccountId:t,ssoRegion:n,ssoRoleName:a,ssoClient:S,clientConfig:e.clientConfig,parentClientConfig:e.parentClientConfig,callerClientConfig:e.callerClientConfig,profile:g,filepath:e.filepath,configFilepath:e.configFilepath,ignoreCache:e.ignoreCache,logger:e.logger})};export{K as ce,Y as de,Oe as ee};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Se as T,Ue as VG,We as c,_e as h,jf as l,kf as R,lf as b,pf as f,qf as i,rf as v}from"./chunk-gwrnxcdn.js";import{lr as KG,mr as s,rr as BG,tr as S}from"./chunk-n5p7cn4w.js";import{hv as G}from"./chunk-c3szabpf.js";var EG=G.object({error:G.object({message:G.string(),type:G.string().nullish(),param:G.any().nullish(),code:G.union([G.string(),G.number()]).nullish()})}),n={errorSchema:EG,errorToMessage:(Q)=>Q.error.message};function $G(Q){var Y,Z,$,U,z,j;if(Q==null)return{inputTokens:{total:void 0,noCache:void 0,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:void 0,text:void 0,reasoning:void 0},raw:void 0};let K=(Y=Q.prompt_tokens)!=null?Y:0,W=(Z=Q.completion_tokens)!=null?Z:0,X=(U=($=Q.prompt_tokens_details)==null?void 0:$.cached_tokens)!=null?U:0,J=(j=(z=Q.completion_tokens_details)==null?void 0:z.reasoning_tokens)!=null?j:0;return{inputTokens:{total:K,noCache:K-X,cacheRead:X,cacheWrite:void 0},outputTokens:{total:W,text:W-J,reasoning:J},raw:Q}}function C(Q){var Y,Z;return(Z=(Y=Q==null?void 0:Q.providerOptions)==null?void 0:Y.openaiCompatible)!=null?Z:{}}function HG(Q){switch(Q){case"audio/wav":return"wav";case"audio/mp3":case"audio/mpeg":return"mp3";default:return null}}function AG(Q){var Y,Z,$;let U=[];for(let{role:z,content:j,...K}of Q){let W=C({...K});switch(z){case"system":{U.push({role:"system",content:j,...W});break}case"user":{if(j.length===1&&j[0].type==="text"){U.push({role:"user",content:j[0].text,...C(j[0])});break}U.push({role:"user",content:j.map((X)=>{var J;let B=C(X);switch(X.type){case"text":return{type:"text",text:X.text,...B};case"file":{if(X.mediaType.startsWith("image/")){let L=X.mediaType==="image/*"?"image/jpeg":X.mediaType;return{type:"image_url",image_url:{url:X.data instanceof URL?X.data.toString():`data:${L};base64,${c(X.data)}`},...B}}if(X.mediaType.startsWith("audio/")){if(X.data instanceof URL)throw new S({functionality:"audio file parts with URLs"});let L=HG(X.mediaType);if(L===null)throw new S({functionality:`audio media type ${X.mediaType}`});return{type:"input_audio",input_audio:{data:c(X.data),format:L},...B}}if(X.mediaType==="application/pdf"){if(X.data instanceof URL)throw new S({functionality:"PDF file parts with URLs"});return{type:"file",file:{filename:(J=X.filename)!=null?J:"document.pdf",file_data:`data:application/pdf;base64,${c(X.data)}`},...B}}if(X.mediaType.startsWith("text/"))return{type:"text",text:X.data instanceof URL?X.data.toString():typeof X.data==="string"?new TextDecoder().decode(VG(X.data)):new TextDecoder().decode(X.data),...B};throw new S({functionality:`file part media type ${X.mediaType}`})}}}),...W});break}case"assistant":{let X="",J="",B=[];for(let L of j){let N=C(L);switch(L.type){case"text":{X+=L.text;break}case"reasoning":{J+=L.text;break}case"tool-call":{let H=(Z=(Y=L.providerOptions)==null?void 0:Y.google)==null?void 0:Z.thoughtSignature;B.push({id:L.toolCallId,type:"function",function:{name:L.toolName,arguments:JSON.stringify(L.input)},...N,...H?{extra_content:{google:{thought_signature:String(H)}}}:{}});break}}}U.push({role:"assistant",content:X,...J.length>0?{reasoning_content:J}:{},tool_calls:B.length>0?B:void 0,...W});break}case"tool":{for(let X of j){if(X.type==="tool-approval-response")continue;let J=X.output,B;switch(J.type){case"text":case"error-text":B=J.value;break;case"execution-denied":B=($=J.reason)!=null?$:"Tool execution denied.";break;case"content":case"json":case"error-json":B=JSON.stringify(J.value);break}let L=C(X);U.push({role:"tool",tool_call_id:X.toolCallId,content:B,...L})}break}default:throw Error(`Unsupported role: ${z}`)}}return U}function JG({id:Q,model:Y,created:Z}){return{id:Q!=null?Q:void 0,modelId:Y!=null?Y:void 0,timestamp:Z!=null?new Date(Z*1000):void 0}}function UG(Q){switch(Q){case"stop":return"stop";case"length":return"length";case"content_filter":return"content-filter";case"function_call":case"tool_calls":return"tool-calls";default:return"other"}}var d=G.object({user:G.string().optional(),reasoningEffort:G.string().optional(),textVerbosity:G.string().optional(),strictJsonSchema:G.boolean().optional()});function PG({tools:Q,toolChoice:Y}){Q=(Q==null?void 0:Q.length)?Q:void 0;let Z=[];if(Q==null)return{tools:void 0,toolChoice:void 0,toolWarnings:Z};let $=[];for(let z of Q)if(z.type==="provider")Z.push({type:"unsupported",feature:`provider-defined tool ${z.id}`});else $.push({type:"function",function:{name:z.name,description:z.description,parameters:z.inputSchema,...z.strict!=null?{strict:z.strict}:{}}});if(Y==null)return{tools:$,toolChoice:void 0,toolWarnings:Z};let U=Y.type;switch(U){case"auto":case"none":case"required":return{tools:$,toolChoice:U,toolWarnings:Z};case"tool":return{tools:$,toolChoice:{type:"function",function:{name:Y.toolName}},toolWarnings:Z};default:throw new S({functionality:`tool choice type: ${U}`})}}var CG=class{constructor(Q,Y){this.specificationVersion="v3";var Z,$;this.modelId=Q,this.config=Y;let U=(Z=Y.errorStructure)!=null?Z:n;this.chunkSchema=DG(U.errorSchema),this.failedResponseHandler=f(U),this.supportsStructuredOutputs=($=Y.supportsStructuredOutputs)!=null?$:!1}get provider(){return this.config.provider}get providerOptionsName(){return this.config.provider.split(".")[0].trim()}get supportedUrls(){var Q,Y,Z;return(Z=(Y=(Q=this.config).supportedUrls)==null?void 0:Y.call(Q))!=null?Z:{}}transformRequestBody(Q){var Y,Z,$;return($=(Z=(Y=this.config).transformRequestBody)==null?void 0:Z.call(Y,Q))!=null?$:Q}async getArgs({prompt:Q,maxOutputTokens:Y,temperature:Z,topP:$,topK:U,frequencyPenalty:z,presencePenalty:j,providerOptions:K,stopSequences:W,responseFormat:X,seed:J,toolChoice:B,tools:L}){var N,H,E,V,q;let A=[],I=await R({provider:"openai-compatible",providerOptions:K,schema:d});if(I!=null)A.push({type:"other",message:"The 'openai-compatible' key in providerOptions is deprecated. Use 'openaiCompatible' instead."});let D=Object.assign(I!=null?I:{},(N=await R({provider:"openaiCompatible",providerOptions:K,schema:d}))!=null?N:{},(H=await R({provider:this.providerOptionsName,providerOptions:K,schema:d}))!=null?H:{}),P=(E=D==null?void 0:D.strictJsonSchema)!=null?E:!0;if(U!=null)A.push({type:"unsupported",feature:"topK"});if((X==null?void 0:X.type)==="json"&&X.schema!=null&&!this.supportsStructuredOutputs)A.push({type:"unsupported",feature:"responseFormat",details:"JSON response format schema is only supported with structuredOutputs"});let{tools:w,toolChoice:y,toolWarnings:u}=PG({tools:L,toolChoice:B});return{args:{model:this.modelId,user:D.user,max_tokens:Y,temperature:Z,top_p:$,frequency_penalty:z,presence_penalty:j,response_format:(X==null?void 0:X.type)==="json"?this.supportsStructuredOutputs===!0&&X.schema!=null?{type:"json_schema",json_schema:{schema:X.schema,strict:P,name:(V=X.name)!=null?V:"response",description:X.description}}:{type:"json_object"}:void 0,stop:W,seed:J,...Object.fromEntries(Object.entries((q=K==null?void 0:K[this.providerOptionsName])!=null?q:{}).filter(([g])=>!Object.keys(d.shape).includes(g))),reasoning_effort:D.reasoningEffort,verbosity:D.textVerbosity,messages:AG(Q),tools:w,tool_choice:y},warnings:[...A,...u]}}async doGenerate(Q){var Y,Z,$,U,z,j,K,W;let{args:X,warnings:J}=await this.getArgs({...Q}),B=this.transformRequestBody(X),L=JSON.stringify(B),{responseHeaders:N,value:H,rawValue:E}=await b({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:T(this.config.headers(),Q.headers),body:B,failedResponseHandler:this.failedResponseHandler,successfulResponseHandler:v(qG),abortSignal:Q.abortSignal,fetch:this.config.fetch}),V=H.choices[0],q=[],A=V.message.content;if(A!=null&&A.length>0)q.push({type:"text",text:A});let I=(Y=V.message.reasoning_content)!=null?Y:V.message.reasoning;if(I!=null&&I.length>0)q.push({type:"reasoning",text:I});if(V.message.tool_calls!=null)for(let w of V.message.tool_calls){let y=($=(Z=w.extra_content)==null?void 0:Z.google)==null?void 0:$.thought_signature;q.push({type:"tool-call",toolCallId:(U=w.id)!=null?U:h(),toolName:w.function.name,input:w.function.arguments,...y?{providerMetadata:{[this.providerOptionsName]:{thoughtSignature:y}}}:{}})}let D={[this.providerOptionsName]:{},...await((j=(z=this.config.metadataExtractor)==null?void 0:z.extractMetadata)==null?void 0:j.call(z,{parsedBody:E}))},P=(K=H.usage)==null?void 0:K.completion_tokens_details;if((P==null?void 0:P.accepted_prediction_tokens)!=null)D[this.providerOptionsName].acceptedPredictionTokens=P==null?void 0:P.accepted_prediction_tokens;if((P==null?void 0:P.rejected_prediction_tokens)!=null)D[this.providerOptionsName].rejectedPredictionTokens=P==null?void 0:P.rejected_prediction_tokens;return{content:q,finishReason:{unified:UG(V.finish_reason),raw:(W=V.finish_reason)!=null?W:void 0},usage:$G(H.usage),providerMetadata:D,request:{body:L},response:{...JG(H),headers:N,body:E},warnings:J}}async doStream(Q){var Y;let{args:Z,warnings:$}=await this.getArgs({...Q}),U=this.transformRequestBody({...Z,stream:!0,stream_options:this.config.includeUsage?{include_usage:!0}:void 0}),z=(Y=this.config.metadataExtractor)==null?void 0:Y.createStreamExtractor(),{responseHeaders:j,value:K}=await b({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:T(this.config.headers(),Q.headers),body:U,failedResponseHandler:this.failedResponseHandler,successfulResponseHandler:i(this.chunkSchema),abortSignal:Q.abortSignal,fetch:this.config.fetch}),W=[],X={unified:"other",raw:void 0},J=void 0,B=!0,L=this.providerOptionsName,N=!1,H=!1;return{stream:K.pipeThrough(new TransformStream({start(E){E.enqueue({type:"stream-start",warnings:$})},transform(E,V){var q,A,I,D,P,w,y,u,g,a,r,t,e,o,GG,QG,XG,YG;if(Q.includeRawChunks)V.enqueue({type:"raw",rawValue:E.rawValue});if(!E.success){X={unified:"error",raw:void 0},V.enqueue({type:"error",error:E.error});return}if(z==null||z.processChunk(E.rawValue),"error"in E.value){X={unified:"error",raw:void 0},V.enqueue({type:"error",error:E.value.error.message});return}let _=E.value;if(B)B=!1,V.enqueue({type:"response-metadata",...JG(_)});if(_.usage!=null)J=_.usage;let O=_.choices[0];if((O==null?void 0:O.finish_reason)!=null)X={unified:UG(O.finish_reason),raw:(q=O.finish_reason)!=null?q:void 0};if((O==null?void 0:O.delta)==null)return;let k=O.delta,ZG=(A=k.reasoning_content)!=null?A:k.reasoning;if(ZG){if(!N)V.enqueue({type:"reasoning-start",id:"reasoning-0"}),N=!0;V.enqueue({type:"reasoning-delta",id:"reasoning-0",delta:ZG})}if(k.content){if(N)V.enqueue({type:"reasoning-end",id:"reasoning-0"}),N=!1;if(!H)V.enqueue({type:"text-start",id:"txt-0"}),H=!0;V.enqueue({type:"text-delta",id:"txt-0",delta:k.content})}if(k.tool_calls!=null){if(N)V.enqueue({type:"reasoning-end",id:"reasoning-0"}),N=!1;for(let x of k.tool_calls){let m=(I=x.index)!=null?I:W.length;if(W[m]==null){if(x.id==null)throw new s({data:x,message:"Expected 'id' to be a string."});if(((D=x.function)==null?void 0:D.name)==null)throw new s({data:x,message:"Expected 'function.name' to be a string."});V.enqueue({type:"tool-input-start",id:x.id,toolName:x.function.name}),W[m]={id:x.id,type:"function",function:{name:x.function.name,arguments:(P=x.function.arguments)!=null?P:""},hasFinished:!1,thoughtSignature:(u=(y=(w=x.extra_content)==null?void 0:w.google)==null?void 0:y.thought_signature)!=null?u:void 0};let M=W[m];if(((g=M.function)==null?void 0:g.name)!=null&&((a=M.function)==null?void 0:a.arguments)!=null){if(M.function.arguments.length>0)V.enqueue({type:"tool-input-delta",id:M.id,delta:M.function.arguments});if(l(M.function.arguments))V.enqueue({type:"tool-input-end",id:M.id}),V.enqueue({type:"tool-call",toolCallId:(r=M.id)!=null?r:h(),toolName:M.function.name,input:M.function.arguments,...M.thoughtSignature?{providerMetadata:{[L]:{thoughtSignature:M.thoughtSignature}}}:{}}),M.hasFinished=!0}continue}let F=W[m];if(F.hasFinished)continue;if(((t=x.function)==null?void 0:t.arguments)!=null)F.function.arguments+=(o=(e=x.function)==null?void 0:e.arguments)!=null?o:"";if(V.enqueue({type:"tool-input-delta",id:F.id,delta:(GG=x.function.arguments)!=null?GG:""}),((QG=F.function)==null?void 0:QG.name)!=null&&((XG=F.function)==null?void 0:XG.arguments)!=null&&l(F.function.arguments))V.enqueue({type:"tool-input-end",id:F.id}),V.enqueue({type:"tool-call",toolCallId:(YG=F.id)!=null?YG:h(),toolName:F.function.name,input:F.function.arguments,...F.thoughtSignature?{providerMetadata:{[L]:{thoughtSignature:F.thoughtSignature}}}:{}}),F.hasFinished=!0}}},flush(E){var V,q,A,I,D;if(N)E.enqueue({type:"reasoning-end",id:"reasoning-0"});if(H)E.enqueue({type:"text-end",id:"txt-0"});for(let w of W.filter((y)=>!y.hasFinished))E.enqueue({type:"tool-input-end",id:w.id}),E.enqueue({type:"tool-call",toolCallId:(V=w.id)!=null?V:h(),toolName:w.function.name,input:w.function.arguments,...w.thoughtSignature?{providerMetadata:{[L]:{thoughtSignature:w.thoughtSignature}}}:{}});let P={[L]:{},...z==null?void 0:z.buildMetadata()};if(((q=J==null?void 0:J.completion_tokens_details)==null?void 0:q.accepted_prediction_tokens)!=null)P[L].acceptedPredictionTokens=(A=J==null?void 0:J.completion_tokens_details)==null?void 0:A.accepted_prediction_tokens;if(((I=J==null?void 0:J.completion_tokens_details)==null?void 0:I.rejected_prediction_tokens)!=null)P[L].rejectedPredictionTokens=(D=J==null?void 0:J.completion_tokens_details)==null?void 0:D.rejected_prediction_tokens;E.enqueue({type:"finish",finishReason:X,usage:$G(J),providerMetadata:P})}})),request:{body:U},response:{headers:j}}}},WG=G.looseObject({prompt_tokens:G.number().nullish(),completion_tokens:G.number().nullish(),total_tokens:G.number().nullish(),prompt_tokens_details:G.object({cached_tokens:G.number().nullish()}).nullish(),completion_tokens_details:G.object({reasoning_tokens:G.number().nullish(),accepted_prediction_tokens:G.number().nullish(),rejected_prediction_tokens:G.number().nullish()}).nullish()}).nullish(),qG=G.looseObject({id:G.string().nullish(),created:G.number().nullish(),model:G.string().nullish(),choices:G.array(G.object({message:G.object({role:G.literal("assistant").nullish(),content:G.string().nullish(),reasoning_content:G.string().nullish(),reasoning:G.string().nullish(),tool_calls:G.array(G.object({id:G.string().nullish(),function:G.object({name:G.string(),arguments:G.string()}),extra_content:G.object({google:G.object({thought_signature:G.string().nullish()}).nullish()}).nullish()})).nullish()}),finish_reason:G.string().nullish()})),usage:WG}),wG=G.looseObject({id:G.string().nullish(),created:G.number().nullish(),model:G.string().nullish(),choices:G.array(G.object({delta:G.object({role:G.enum(["assistant"]).nullish(),content:G.string().nullish(),reasoning_content:G.string().nullish(),reasoning:G.string().nullish(),tool_calls:G.array(G.object({index:G.number().nullish(),id:G.string().nullish(),function:G.object({name:G.string().nullish(),arguments:G.string().nullish()}),extra_content:G.object({google:G.object({thought_signature:G.string().nullish()}).nullish()}).nullish()})).nullish()}).nullish(),finish_reason:G.string().nullish()})),usage:WG}),DG=(Q)=>G.union([wG,Q]);function jG(Q){var Y,Z;if(Q==null)return{inputTokens:{total:void 0,noCache:void 0,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:void 0,text:void 0,reasoning:void 0},raw:void 0};let $=(Y=Q.prompt_tokens)!=null?Y:0,U=(Z=Q.completion_tokens)!=null?Z:0;return{inputTokens:{total:$,noCache:$,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:U,text:U,reasoning:void 0},raw:Q}}function xG({prompt:Q,user:Y="user",assistant:Z="assistant"}){let $="";if(Q[0].role==="system")$+=`${Q[0].content}
2
+ import{Se as T,Ue as VG,We as c,_e as h,jf as l,kf as R,lf as b,pf as f,qf as i,rf as v}from"./chunk-gsg6zn7e.js";import{Op as KG,Pp as s,Up as BG,Wp as S}from"./chunk-scnbt714.js";import{Kt as G}from"./chunk-a48mx917.js";var EG=G.object({error:G.object({message:G.string(),type:G.string().nullish(),param:G.any().nullish(),code:G.union([G.string(),G.number()]).nullish()})}),n={errorSchema:EG,errorToMessage:(Q)=>Q.error.message};function $G(Q){var Y,Z,$,U,z,j;if(Q==null)return{inputTokens:{total:void 0,noCache:void 0,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:void 0,text:void 0,reasoning:void 0},raw:void 0};let K=(Y=Q.prompt_tokens)!=null?Y:0,W=(Z=Q.completion_tokens)!=null?Z:0,X=(U=($=Q.prompt_tokens_details)==null?void 0:$.cached_tokens)!=null?U:0,J=(j=(z=Q.completion_tokens_details)==null?void 0:z.reasoning_tokens)!=null?j:0;return{inputTokens:{total:K,noCache:K-X,cacheRead:X,cacheWrite:void 0},outputTokens:{total:W,text:W-J,reasoning:J},raw:Q}}function C(Q){var Y,Z;return(Z=(Y=Q==null?void 0:Q.providerOptions)==null?void 0:Y.openaiCompatible)!=null?Z:{}}function HG(Q){switch(Q){case"audio/wav":return"wav";case"audio/mp3":case"audio/mpeg":return"mp3";default:return null}}function AG(Q){var Y,Z,$;let U=[];for(let{role:z,content:j,...K}of Q){let W=C({...K});switch(z){case"system":{U.push({role:"system",content:j,...W});break}case"user":{if(j.length===1&&j[0].type==="text"){U.push({role:"user",content:j[0].text,...C(j[0])});break}U.push({role:"user",content:j.map((X)=>{var J;let B=C(X);switch(X.type){case"text":return{type:"text",text:X.text,...B};case"file":{if(X.mediaType.startsWith("image/")){let L=X.mediaType==="image/*"?"image/jpeg":X.mediaType;return{type:"image_url",image_url:{url:X.data instanceof URL?X.data.toString():`data:${L};base64,${c(X.data)}`},...B}}if(X.mediaType.startsWith("audio/")){if(X.data instanceof URL)throw new S({functionality:"audio file parts with URLs"});let L=HG(X.mediaType);if(L===null)throw new S({functionality:`audio media type ${X.mediaType}`});return{type:"input_audio",input_audio:{data:c(X.data),format:L},...B}}if(X.mediaType==="application/pdf"){if(X.data instanceof URL)throw new S({functionality:"PDF file parts with URLs"});return{type:"file",file:{filename:(J=X.filename)!=null?J:"document.pdf",file_data:`data:application/pdf;base64,${c(X.data)}`},...B}}if(X.mediaType.startsWith("text/"))return{type:"text",text:X.data instanceof URL?X.data.toString():typeof X.data==="string"?new TextDecoder().decode(VG(X.data)):new TextDecoder().decode(X.data),...B};throw new S({functionality:`file part media type ${X.mediaType}`})}}}),...W});break}case"assistant":{let X="",J="",B=[];for(let L of j){let N=C(L);switch(L.type){case"text":{X+=L.text;break}case"reasoning":{J+=L.text;break}case"tool-call":{let H=(Z=(Y=L.providerOptions)==null?void 0:Y.google)==null?void 0:Z.thoughtSignature;B.push({id:L.toolCallId,type:"function",function:{name:L.toolName,arguments:JSON.stringify(L.input)},...N,...H?{extra_content:{google:{thought_signature:String(H)}}}:{}});break}}}U.push({role:"assistant",content:X,...J.length>0?{reasoning_content:J}:{},tool_calls:B.length>0?B:void 0,...W});break}case"tool":{for(let X of j){if(X.type==="tool-approval-response")continue;let J=X.output,B;switch(J.type){case"text":case"error-text":B=J.value;break;case"execution-denied":B=($=J.reason)!=null?$:"Tool execution denied.";break;case"content":case"json":case"error-json":B=JSON.stringify(J.value);break}let L=C(X);U.push({role:"tool",tool_call_id:X.toolCallId,content:B,...L})}break}default:throw Error(`Unsupported role: ${z}`)}}return U}function JG({id:Q,model:Y,created:Z}){return{id:Q!=null?Q:void 0,modelId:Y!=null?Y:void 0,timestamp:Z!=null?new Date(Z*1000):void 0}}function UG(Q){switch(Q){case"stop":return"stop";case"length":return"length";case"content_filter":return"content-filter";case"function_call":case"tool_calls":return"tool-calls";default:return"other"}}var d=G.object({user:G.string().optional(),reasoningEffort:G.string().optional(),textVerbosity:G.string().optional(),strictJsonSchema:G.boolean().optional()});function PG({tools:Q,toolChoice:Y}){Q=(Q==null?void 0:Q.length)?Q:void 0;let Z=[];if(Q==null)return{tools:void 0,toolChoice:void 0,toolWarnings:Z};let $=[];for(let z of Q)if(z.type==="provider")Z.push({type:"unsupported",feature:`provider-defined tool ${z.id}`});else $.push({type:"function",function:{name:z.name,description:z.description,parameters:z.inputSchema,...z.strict!=null?{strict:z.strict}:{}}});if(Y==null)return{tools:$,toolChoice:void 0,toolWarnings:Z};let U=Y.type;switch(U){case"auto":case"none":case"required":return{tools:$,toolChoice:U,toolWarnings:Z};case"tool":return{tools:$,toolChoice:{type:"function",function:{name:Y.toolName}},toolWarnings:Z};default:throw new S({functionality:`tool choice type: ${U}`})}}var CG=class{constructor(Q,Y){this.specificationVersion="v3";var Z,$;this.modelId=Q,this.config=Y;let U=(Z=Y.errorStructure)!=null?Z:n;this.chunkSchema=DG(U.errorSchema),this.failedResponseHandler=f(U),this.supportsStructuredOutputs=($=Y.supportsStructuredOutputs)!=null?$:!1}get provider(){return this.config.provider}get providerOptionsName(){return this.config.provider.split(".")[0].trim()}get supportedUrls(){var Q,Y,Z;return(Z=(Y=(Q=this.config).supportedUrls)==null?void 0:Y.call(Q))!=null?Z:{}}transformRequestBody(Q){var Y,Z,$;return($=(Z=(Y=this.config).transformRequestBody)==null?void 0:Z.call(Y,Q))!=null?$:Q}async getArgs({prompt:Q,maxOutputTokens:Y,temperature:Z,topP:$,topK:U,frequencyPenalty:z,presencePenalty:j,providerOptions:K,stopSequences:W,responseFormat:X,seed:J,toolChoice:B,tools:L}){var N,H,E,V,q;let A=[],I=await R({provider:"openai-compatible",providerOptions:K,schema:d});if(I!=null)A.push({type:"other",message:"The 'openai-compatible' key in providerOptions is deprecated. Use 'openaiCompatible' instead."});let D=Object.assign(I!=null?I:{},(N=await R({provider:"openaiCompatible",providerOptions:K,schema:d}))!=null?N:{},(H=await R({provider:this.providerOptionsName,providerOptions:K,schema:d}))!=null?H:{}),P=(E=D==null?void 0:D.strictJsonSchema)!=null?E:!0;if(U!=null)A.push({type:"unsupported",feature:"topK"});if((X==null?void 0:X.type)==="json"&&X.schema!=null&&!this.supportsStructuredOutputs)A.push({type:"unsupported",feature:"responseFormat",details:"JSON response format schema is only supported with structuredOutputs"});let{tools:w,toolChoice:y,toolWarnings:u}=PG({tools:L,toolChoice:B});return{args:{model:this.modelId,user:D.user,max_tokens:Y,temperature:Z,top_p:$,frequency_penalty:z,presence_penalty:j,response_format:(X==null?void 0:X.type)==="json"?this.supportsStructuredOutputs===!0&&X.schema!=null?{type:"json_schema",json_schema:{schema:X.schema,strict:P,name:(V=X.name)!=null?V:"response",description:X.description}}:{type:"json_object"}:void 0,stop:W,seed:J,...Object.fromEntries(Object.entries((q=K==null?void 0:K[this.providerOptionsName])!=null?q:{}).filter(([g])=>!Object.keys(d.shape).includes(g))),reasoning_effort:D.reasoningEffort,verbosity:D.textVerbosity,messages:AG(Q),tools:w,tool_choice:y},warnings:[...A,...u]}}async doGenerate(Q){var Y,Z,$,U,z,j,K,W;let{args:X,warnings:J}=await this.getArgs({...Q}),B=this.transformRequestBody(X),L=JSON.stringify(B),{responseHeaders:N,value:H,rawValue:E}=await b({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:T(this.config.headers(),Q.headers),body:B,failedResponseHandler:this.failedResponseHandler,successfulResponseHandler:v(qG),abortSignal:Q.abortSignal,fetch:this.config.fetch}),V=H.choices[0],q=[],A=V.message.content;if(A!=null&&A.length>0)q.push({type:"text",text:A});let I=(Y=V.message.reasoning_content)!=null?Y:V.message.reasoning;if(I!=null&&I.length>0)q.push({type:"reasoning",text:I});if(V.message.tool_calls!=null)for(let w of V.message.tool_calls){let y=($=(Z=w.extra_content)==null?void 0:Z.google)==null?void 0:$.thought_signature;q.push({type:"tool-call",toolCallId:(U=w.id)!=null?U:h(),toolName:w.function.name,input:w.function.arguments,...y?{providerMetadata:{[this.providerOptionsName]:{thoughtSignature:y}}}:{}})}let D={[this.providerOptionsName]:{},...await((j=(z=this.config.metadataExtractor)==null?void 0:z.extractMetadata)==null?void 0:j.call(z,{parsedBody:E}))},P=(K=H.usage)==null?void 0:K.completion_tokens_details;if((P==null?void 0:P.accepted_prediction_tokens)!=null)D[this.providerOptionsName].acceptedPredictionTokens=P==null?void 0:P.accepted_prediction_tokens;if((P==null?void 0:P.rejected_prediction_tokens)!=null)D[this.providerOptionsName].rejectedPredictionTokens=P==null?void 0:P.rejected_prediction_tokens;return{content:q,finishReason:{unified:UG(V.finish_reason),raw:(W=V.finish_reason)!=null?W:void 0},usage:$G(H.usage),providerMetadata:D,request:{body:L},response:{...JG(H),headers:N,body:E},warnings:J}}async doStream(Q){var Y;let{args:Z,warnings:$}=await this.getArgs({...Q}),U=this.transformRequestBody({...Z,stream:!0,stream_options:this.config.includeUsage?{include_usage:!0}:void 0}),z=(Y=this.config.metadataExtractor)==null?void 0:Y.createStreamExtractor(),{responseHeaders:j,value:K}=await b({url:this.config.url({path:"/chat/completions",modelId:this.modelId}),headers:T(this.config.headers(),Q.headers),body:U,failedResponseHandler:this.failedResponseHandler,successfulResponseHandler:i(this.chunkSchema),abortSignal:Q.abortSignal,fetch:this.config.fetch}),W=[],X={unified:"other",raw:void 0},J=void 0,B=!0,L=this.providerOptionsName,N=!1,H=!1;return{stream:K.pipeThrough(new TransformStream({start(E){E.enqueue({type:"stream-start",warnings:$})},transform(E,V){var q,A,I,D,P,w,y,u,g,a,r,t,e,o,GG,QG,XG,YG;if(Q.includeRawChunks)V.enqueue({type:"raw",rawValue:E.rawValue});if(!E.success){X={unified:"error",raw:void 0},V.enqueue({type:"error",error:E.error});return}if(z==null||z.processChunk(E.rawValue),"error"in E.value){X={unified:"error",raw:void 0},V.enqueue({type:"error",error:E.value.error.message});return}let _=E.value;if(B)B=!1,V.enqueue({type:"response-metadata",...JG(_)});if(_.usage!=null)J=_.usage;let O=_.choices[0];if((O==null?void 0:O.finish_reason)!=null)X={unified:UG(O.finish_reason),raw:(q=O.finish_reason)!=null?q:void 0};if((O==null?void 0:O.delta)==null)return;let k=O.delta,ZG=(A=k.reasoning_content)!=null?A:k.reasoning;if(ZG){if(!N)V.enqueue({type:"reasoning-start",id:"reasoning-0"}),N=!0;V.enqueue({type:"reasoning-delta",id:"reasoning-0",delta:ZG})}if(k.content){if(N)V.enqueue({type:"reasoning-end",id:"reasoning-0"}),N=!1;if(!H)V.enqueue({type:"text-start",id:"txt-0"}),H=!0;V.enqueue({type:"text-delta",id:"txt-0",delta:k.content})}if(k.tool_calls!=null){if(N)V.enqueue({type:"reasoning-end",id:"reasoning-0"}),N=!1;for(let x of k.tool_calls){let m=(I=x.index)!=null?I:W.length;if(W[m]==null){if(x.id==null)throw new s({data:x,message:"Expected 'id' to be a string."});if(((D=x.function)==null?void 0:D.name)==null)throw new s({data:x,message:"Expected 'function.name' to be a string."});V.enqueue({type:"tool-input-start",id:x.id,toolName:x.function.name}),W[m]={id:x.id,type:"function",function:{name:x.function.name,arguments:(P=x.function.arguments)!=null?P:""},hasFinished:!1,thoughtSignature:(u=(y=(w=x.extra_content)==null?void 0:w.google)==null?void 0:y.thought_signature)!=null?u:void 0};let M=W[m];if(((g=M.function)==null?void 0:g.name)!=null&&((a=M.function)==null?void 0:a.arguments)!=null){if(M.function.arguments.length>0)V.enqueue({type:"tool-input-delta",id:M.id,delta:M.function.arguments});if(l(M.function.arguments))V.enqueue({type:"tool-input-end",id:M.id}),V.enqueue({type:"tool-call",toolCallId:(r=M.id)!=null?r:h(),toolName:M.function.name,input:M.function.arguments,...M.thoughtSignature?{providerMetadata:{[L]:{thoughtSignature:M.thoughtSignature}}}:{}}),M.hasFinished=!0}continue}let F=W[m];if(F.hasFinished)continue;if(((t=x.function)==null?void 0:t.arguments)!=null)F.function.arguments+=(o=(e=x.function)==null?void 0:e.arguments)!=null?o:"";if(V.enqueue({type:"tool-input-delta",id:F.id,delta:(GG=x.function.arguments)!=null?GG:""}),((QG=F.function)==null?void 0:QG.name)!=null&&((XG=F.function)==null?void 0:XG.arguments)!=null&&l(F.function.arguments))V.enqueue({type:"tool-input-end",id:F.id}),V.enqueue({type:"tool-call",toolCallId:(YG=F.id)!=null?YG:h(),toolName:F.function.name,input:F.function.arguments,...F.thoughtSignature?{providerMetadata:{[L]:{thoughtSignature:F.thoughtSignature}}}:{}}),F.hasFinished=!0}}},flush(E){var V,q,A,I,D;if(N)E.enqueue({type:"reasoning-end",id:"reasoning-0"});if(H)E.enqueue({type:"text-end",id:"txt-0"});for(let w of W.filter((y)=>!y.hasFinished))E.enqueue({type:"tool-input-end",id:w.id}),E.enqueue({type:"tool-call",toolCallId:(V=w.id)!=null?V:h(),toolName:w.function.name,input:w.function.arguments,...w.thoughtSignature?{providerMetadata:{[L]:{thoughtSignature:w.thoughtSignature}}}:{}});let P={[L]:{},...z==null?void 0:z.buildMetadata()};if(((q=J==null?void 0:J.completion_tokens_details)==null?void 0:q.accepted_prediction_tokens)!=null)P[L].acceptedPredictionTokens=(A=J==null?void 0:J.completion_tokens_details)==null?void 0:A.accepted_prediction_tokens;if(((I=J==null?void 0:J.completion_tokens_details)==null?void 0:I.rejected_prediction_tokens)!=null)P[L].rejectedPredictionTokens=(D=J==null?void 0:J.completion_tokens_details)==null?void 0:D.rejected_prediction_tokens;E.enqueue({type:"finish",finishReason:X,usage:$G(J),providerMetadata:P})}})),request:{body:U},response:{headers:j}}}},WG=G.looseObject({prompt_tokens:G.number().nullish(),completion_tokens:G.number().nullish(),total_tokens:G.number().nullish(),prompt_tokens_details:G.object({cached_tokens:G.number().nullish()}).nullish(),completion_tokens_details:G.object({reasoning_tokens:G.number().nullish(),accepted_prediction_tokens:G.number().nullish(),rejected_prediction_tokens:G.number().nullish()}).nullish()}).nullish(),qG=G.looseObject({id:G.string().nullish(),created:G.number().nullish(),model:G.string().nullish(),choices:G.array(G.object({message:G.object({role:G.literal("assistant").nullish(),content:G.string().nullish(),reasoning_content:G.string().nullish(),reasoning:G.string().nullish(),tool_calls:G.array(G.object({id:G.string().nullish(),function:G.object({name:G.string(),arguments:G.string()}),extra_content:G.object({google:G.object({thought_signature:G.string().nullish()}).nullish()}).nullish()})).nullish()}),finish_reason:G.string().nullish()})),usage:WG}),wG=G.looseObject({id:G.string().nullish(),created:G.number().nullish(),model:G.string().nullish(),choices:G.array(G.object({delta:G.object({role:G.enum(["assistant"]).nullish(),content:G.string().nullish(),reasoning_content:G.string().nullish(),reasoning:G.string().nullish(),tool_calls:G.array(G.object({index:G.number().nullish(),id:G.string().nullish(),function:G.object({name:G.string().nullish(),arguments:G.string().nullish()}),extra_content:G.object({google:G.object({thought_signature:G.string().nullish()}).nullish()}).nullish()})).nullish()}).nullish(),finish_reason:G.string().nullish()})),usage:WG}),DG=(Q)=>G.union([wG,Q]);function jG(Q){var Y,Z;if(Q==null)return{inputTokens:{total:void 0,noCache:void 0,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:void 0,text:void 0,reasoning:void 0},raw:void 0};let $=(Y=Q.prompt_tokens)!=null?Y:0,U=(Z=Q.completion_tokens)!=null?Z:0;return{inputTokens:{total:$,noCache:$,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:U,text:U,reasoning:void 0},raw:Q}}function xG({prompt:Q,user:Y="user",assistant:Z="assistant"}){let $="";if(Q[0].role==="system")$+=`${Q[0].content}
3
3
 
4
4
  `,Q=Q.slice(1);for(let{role:U,content:z}of Q)switch(U){case"system":throw new KG({message:"Unexpected system message in prompt: ${content}",prompt:Q});case"user":{let j=z.map((K)=>{switch(K.type){case"text":return K.text}}).filter(Boolean).join("");$+=`${Y}:
5
5
  ${j}
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{mt as Q}from"./chunk-dbpkq7ba.js";import{fu as K}from"./chunk-hwsqqkrv.js";import{SP as F,UP as N}from"./chunk-f2pv705d.js";var V={};N(V,{text:()=>P,stop:()=>S,spawn:()=>M,run:()=>Z,lines:()=>T,RunFailedError:()=>Y});var L=F(Q(),1);import{buffer as I}from"stream/consumers";var A=["QITQODE_AUTH_CONTENT","QITQODE_SERVER_PASSWORD","QITQODE_KEY"];function C(B){let z={...B};for(let G of A)delete z[G];return z}function D(){return C(process.env)}class Y extends Error{cmd;code;stdout;stderr;constructor(B,z,G,H){let J=H.toString().trim();super(J?`Command failed with code ${z}: ${B.join(" ")}
2
+ import{Pr as Q}from"./chunk-sbjymf20.js";import{Is as K}from"./chunk-wgkcyqn1.js";import{tO as F,vO as N}from"./chunk-e0vrxetq.js";var V={};N(V,{text:()=>P,stop:()=>S,spawn:()=>M,run:()=>Z,lines:()=>T,RunFailedError:()=>Y});var L=F(Q(),1);import{buffer as I}from"stream/consumers";var A=["QITQODE_AUTH_CONTENT","QITQODE_SERVER_PASSWORD","QITQODE_KEY"];function C(B){let z={...B};for(let G of A)delete z[G];return z}function D(){return C(process.env)}class Y extends Error{cmd;code;stdout;stderr;constructor(B,z,G,H){let J=H.toString().trim();super(J?`Command failed with code ${z}: ${B.join(" ")}
3
3
  ${J}`:`Command failed with code ${z}: ${B.join(" ")}`);this.name="ProcessRunFailedError",this.cmd=[...B],this.code=z,this.stdout=G,this.stderr=H}}function M(B,z={}){if(B.length===0)throw Error("Command is required");z.abort?.throwIfAborted();let G=L.default(B[0],B.slice(1),{cwd:z.cwd,shell:z.shell,env:z.env===null?{}:{...D(),...z.env},stdio:[z.stdin??"ignore",z.stdout??"ignore",z.stderr??"ignore"],windowsHide:process.platform==="win32"}),H=!1,J,O=()=>{if(H)return;if(G.exitCode!==null||G.signalCode!==null)return;H=!0,G.kill(z.kill??"SIGTERM");let W=z.timeout??5000;if(W<=0)return;J=setTimeout(()=>G.kill("SIGKILL"),W)},U=new Promise((W,j)=>{let k=()=>{if(z.abort?.removeEventListener("abort",O),J)clearTimeout(J)};G.once("exit",(X,q)=>{k(),W(X??(q?1:0))}),G.once("error",(X)=>{k(),j(X)})});if(U.catch(()=>{return}),z.abort){if(z.abort.addEventListener("abort",O,{once:!0}),z.abort.aborted)O()}let $=G;return $.exited=U,$}async function Z(B,z={}){let G=M(B,{cwd:z.cwd,env:z.env,stdin:z.stdin,shell:z.shell,abort:z.abort,kill:z.kill,timeout:z.timeout,stdout:"pipe",stderr:"pipe"});if(!G.stdout||!G.stderr)throw Error("Process output not available");let H=await Promise.all([G.exited,I(G.stdout),I(G.stderr)]).then(([J,O,U])=>({code:J,stdout:O,stderr:U})).catch((J)=>{if(!z.nothrow)throw J;return{code:1,stdout:Buffer.alloc(0),stderr:Buffer.from(K(J))}});if(H.code===0||z.nothrow)return H;throw new Y(B,H.code,H.stdout,H.stderr)}async function S(B){if(B.exitCode!==null||B.signalCode!==null)return;if(process.platform!=="win32"||!B.pid){B.kill();return}if((await Z(["taskkill","/pid",String(B.pid),"/T","/F"],{nothrow:!0})).code===0)return;B.kill()}async function P(B,z={}){let G=await Z(B,z);return{...G,text:G.stdout.toString()}}async function T(B,z={}){return(await P(B,z)).text.split(/\r?\n/).filter(Boolean)}
4
- export{D as ht,M as it,Z as jt,P as kt,V as lt};
4
+ export{D as Kr,M as Lr,Z as Mr,P as Nr,V as Or};