@qitqode/qitqode-android-arm64 0.1.27 → 0.1.29

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 (399) hide show
  1. package/bundle/{chunk-1rp1cvmc.js → chunk-0626rvy2.js} +1 -1
  2. package/bundle/chunk-07c1mvy1.js +2 -0
  3. package/bundle/{chunk-h7yya9pv.js → chunk-09j71kp6.js} +3 -3
  4. package/bundle/chunk-0p7qcm51.js +2 -0
  5. package/bundle/chunk-0pmb7zzh.js +2 -0
  6. package/bundle/{chunk-wz0zcddf.js → chunk-0wdtbn59.js} +2 -2
  7. package/bundle/{chunk-nt4e3em9.js → chunk-0xm85ayc.js} +1 -1
  8. package/bundle/{chunk-0eqwm9a8.js → chunk-0yqbyres.js} +1 -1
  9. package/bundle/{chunk-r08957sm.js → chunk-11d987sj.js} +1 -1
  10. package/bundle/{chunk-dhjp0zx2.js → chunk-18vygvnc.js} +1 -1
  11. package/bundle/{chunk-v965rsr8.js → chunk-19sa03c1.js} +2 -2
  12. package/bundle/{chunk-zyhdxggp.js → chunk-1d9f53sk.js} +2 -2
  13. package/bundle/{chunk-k7gq9bra.js → chunk-1fz0383p.js} +1 -1
  14. package/bundle/{chunk-j6emx6jn.js → chunk-1rn0vmvv.js} +2 -2
  15. package/bundle/chunk-1s9ctg0d.js +2 -0
  16. package/bundle/{chunk-g7rjtehn.js → chunk-1xw68zak.js} +1 -1
  17. package/bundle/{chunk-whxjkz9a.js → chunk-20d0cd1j.js} +2 -2
  18. package/bundle/chunk-2f9fn9xr.js +2 -0
  19. package/bundle/chunk-2fhcvfyg.js +2 -0
  20. package/bundle/{chunk-2ahqhh4z.js → chunk-2hw0jzv4.js} +1 -1
  21. package/bundle/{chunk-2jmxt3fb.js → chunk-2mjc44ev.js} +1 -1
  22. package/bundle/{chunk-yhk7d1j0.js → chunk-2p2ch1k2.js} +1 -1
  23. package/bundle/{chunk-jje0srjq.js → chunk-2p9py4rw.js} +1 -1
  24. package/bundle/{chunk-j94bdaav.js → chunk-2w20mhch.js} +1 -1
  25. package/bundle/{chunk-cdhmc0t0.js → chunk-2xxefrps.js} +1 -1
  26. package/bundle/{chunk-vsjyr170.js → chunk-2ztdqtnk.js} +1 -1
  27. package/bundle/{chunk-zb0me4kk.js → chunk-31wxbws4.js} +1 -1
  28. package/bundle/{chunk-ppfjf7qx.js → chunk-3h4y7n1a.js} +1 -1
  29. package/bundle/chunk-3mfj0x4p.js +2 -0
  30. package/bundle/{chunk-2tnarng3.js → chunk-3n49y4kh.js} +1 -1
  31. package/bundle/{chunk-g1dwbvkg.js → chunk-3q6650we.js} +1 -1
  32. package/bundle/{chunk-1dwcga8g.js → chunk-3rt2k5sc.js} +1 -1
  33. package/bundle/chunk-3shnje9k.js +2 -0
  34. package/bundle/chunk-3tz1qhpt.js +2 -0
  35. package/bundle/{chunk-vfdhqf4h.js → chunk-3vmh2ge6.js} +1 -1
  36. package/bundle/{chunk-9t84mh6t.js → chunk-43ae3chd.js} +2 -2
  37. package/bundle/chunk-44jpsp97.js +2 -0
  38. package/bundle/{chunk-j5y10dn6.js → chunk-45jqjyk9.js} +1 -1
  39. package/bundle/chunk-4dtbdycg.js +2 -0
  40. package/bundle/{chunk-kfsb2stm.js → chunk-4fk4se02.js} +1 -1
  41. package/bundle/{chunk-yp0a8q29.js → chunk-4fspp5fg.js} +3 -3
  42. package/bundle/{chunk-k9b1jcqw.js → chunk-4kpvceap.js} +1 -1
  43. package/bundle/{chunk-qjjch1zt.js → chunk-4mrz9b6d.js} +2 -2
  44. package/bundle/chunk-4pz8av2y.js +2 -0
  45. package/bundle/chunk-4r4xh8a6.js +2 -0
  46. package/bundle/{chunk-t12xrrfr.js → chunk-4vemws1t.js} +2 -2
  47. package/bundle/{chunk-m612agnk.js → chunk-4vze3djr.js} +1 -1
  48. package/bundle/{chunk-w87a3mzm.js → chunk-50w28xj1.js} +1 -1
  49. package/bundle/chunk-5hpq59t1.js +2 -0
  50. package/bundle/{chunk-d6r4xwtg.js → chunk-5n4hpc4f.js} +3 -3
  51. package/bundle/chunk-5s90ehww.js +2 -0
  52. package/bundle/{chunk-nxbkh4k9.js → chunk-5z7mjwwa.js} +1 -1
  53. package/bundle/{chunk-ydp0q1hk.js → chunk-61yatzp8.js} +1 -1
  54. package/bundle/chunk-63kcg127.js +2 -0
  55. package/bundle/{chunk-b9za12y1.js → chunk-6528bthc.js} +1 -1
  56. package/bundle/{chunk-mgk9sh16.js → chunk-6bsgrr5h.js} +1 -1
  57. package/bundle/chunk-6fejrpht.js +2 -0
  58. package/bundle/{chunk-4qqkqrn9.js → chunk-6hdjkvr1.js} +2 -2
  59. package/bundle/{chunk-1t9jne14.js → chunk-6hmj972a.js} +1 -1
  60. package/bundle/{chunk-njnwdgvd.js → chunk-6jewfaqa.js} +2 -2
  61. package/bundle/{chunk-y062spw2.js → chunk-6saj1dhz.js} +1 -1
  62. package/bundle/{chunk-n8h6x2en.js → chunk-6scqd8fh.js} +1 -1
  63. package/bundle/chunk-6zzdw7q1.js +2 -0
  64. package/bundle/{chunk-dqed63ek.js → chunk-71pmrpkc.js} +1 -1
  65. package/bundle/{chunk-26nfphsg.js → chunk-74zgcxeg.js} +1 -1
  66. package/bundle/chunk-78m8rayq.js +2 -0
  67. package/bundle/{chunk-2km50rd3.js → chunk-7926bzm7.js} +1 -1
  68. package/bundle/chunk-7j6p5j2g.js +2 -0
  69. package/bundle/{chunk-apbgb4h0.js → chunk-7m8fdp5p.js} +1 -1
  70. package/bundle/{chunk-b7mg883n.js → chunk-7mc8nxve.js} +1 -1
  71. package/bundle/chunk-7tjd6ba1.js +2 -0
  72. package/bundle/{chunk-2wcv3sq5.js → chunk-7wthn44y.js} +2 -2
  73. package/bundle/{chunk-kqn9h2gk.js → chunk-81h5f8ev.js} +1 -1
  74. package/bundle/{chunk-drs1gv2b.js → chunk-88dhcv37.js} +1 -1
  75. package/bundle/{chunk-h0rpmne5.js → chunk-89f8v2y8.js} +1 -1
  76. package/bundle/{chunk-fnbpap62.js → chunk-8d2ddmf0.js} +1 -1
  77. package/bundle/chunk-8d8efdry.js +2 -0
  78. package/bundle/{chunk-a1pw9r6f.js → chunk-8f0g7d7k.js} +1 -1
  79. package/bundle/{chunk-deae0y1j.js → chunk-8jzjvmaz.js} +1 -1
  80. package/bundle/{chunk-qhc90p4a.js → chunk-8k55xz7z.js} +1 -1
  81. package/bundle/{chunk-f45tp3e3.js → chunk-8kz3n8ye.js} +1 -1
  82. package/bundle/chunk-93jxndr8.js +2 -0
  83. package/bundle/{chunk-zxaaxb99.js → chunk-94qmhz2p.js} +2 -2
  84. package/bundle/{chunk-a2qz9m10.js → chunk-95qs7wnz.js} +1 -1
  85. package/bundle/{chunk-b75gpv0q.js → chunk-97h0jx8y.js} +1 -1
  86. package/bundle/{chunk-vj62pc0h.js → chunk-98vfbn0h.js} +1 -1
  87. package/bundle/chunk-99ve54r6.js +2 -0
  88. package/bundle/{chunk-3bmzjznz.js → chunk-9atkgkaq.js} +1 -1
  89. package/bundle/{chunk-qrey2gwb.js → chunk-9epjgend.js} +2 -2
  90. package/bundle/{chunk-2dzk5txw.js → chunk-9kjj44cr.js} +1 -1
  91. package/bundle/chunk-9ksaqyb2.js +2 -0
  92. package/bundle/chunk-9p7t748e.js +2 -0
  93. package/bundle/{chunk-zrc54vc4.js → chunk-a2g69pv6.js} +1 -1
  94. package/bundle/{chunk-1bhvt33f.js → chunk-a2qerqgd.js} +1 -1
  95. package/bundle/chunk-a69jgepp.js +2 -0
  96. package/bundle/{chunk-a1p2f16h.js → chunk-a8p9aggx.js} +2 -2
  97. package/bundle/{chunk-4ypcf4tg.js → chunk-a94s0jks.js} +1 -1
  98. package/bundle/{chunk-d5bxan80.js → chunk-abtn6nec.js} +1 -1
  99. package/bundle/chunk-ar310tc3.js +2 -0
  100. package/bundle/{chunk-zcm2jdr5.js → chunk-asmfntjm.js} +1 -1
  101. package/bundle/chunk-at03h9eq.js +2 -0
  102. package/bundle/{chunk-b8tw709r.js → chunk-awav98j0.js} +1 -1
  103. package/bundle/chunk-ay9p70xx.js +2 -0
  104. package/bundle/{chunk-ab6cabxh.js → chunk-az9hsk6z.js} +1 -1
  105. package/bundle/{chunk-9j1qqdr2.js → chunk-azx0zxnx.js} +1 -1
  106. package/bundle/{chunk-ct48575c.js → chunk-b1ntb3dh.js} +1 -1
  107. package/bundle/{chunk-qjn86fc0.js → chunk-b20xjnpw.js} +1 -1
  108. package/bundle/{chunk-b0syck9r.js → chunk-b4qd109w.js} +1 -1
  109. package/bundle/chunk-b6dsv601.js +3 -0
  110. package/bundle/{chunk-knpt9n8f.js → chunk-b73s2h43.js} +1 -1
  111. package/bundle/{chunk-exh6cg1r.js → chunk-b9hstp7h.js} +1 -1
  112. package/bundle/{chunk-vg2fmyje.js → chunk-b9nwaaqs.js} +2 -2
  113. package/bundle/chunk-bajtytm5.js +2 -0
  114. package/bundle/chunk-bh8v3mfg.js +2 -0
  115. package/bundle/chunk-bn0h9dny.js +10 -0
  116. package/bundle/chunk-bp8sxnrm.js +2 -0
  117. package/bundle/{chunk-4tbwha3m.js → chunk-bsf6n350.js} +2 -2
  118. package/bundle/{chunk-xpc2zgj7.js → chunk-bv8pf0m1.js} +2 -2
  119. package/bundle/chunk-bw5e8thn.js +2 -0
  120. package/bundle/{chunk-c01z3cvg.js → chunk-bx6kyvg7.js} +1 -1
  121. package/bundle/{chunk-wsy0m70r.js → chunk-byc7ev8p.js} +1 -1
  122. package/bundle/{chunk-xrxyrr00.js → chunk-bzgj60w4.js} +1 -1
  123. package/bundle/{chunk-yq3m8190.js → chunk-bzrsnv2k.js} +2 -2
  124. package/bundle/{chunk-ecn8gbtz.js → chunk-c19t7e8s.js} +1 -1
  125. package/bundle/chunk-c8ajbhv3.js +2 -0
  126. package/bundle/{chunk-ad46r434.js → chunk-c8n72r2k.js} +3 -3
  127. package/bundle/chunk-ccddzk10.js +2 -0
  128. package/bundle/{chunk-j5kb0y1m.js → chunk-cd867geb.js} +1 -1
  129. package/bundle/chunk-ce5t444d.js +2 -0
  130. package/bundle/{chunk-3nyqh1d6.js → chunk-cev2qj7w.js} +1 -1
  131. package/bundle/{chunk-7jbz3dgt.js → chunk-cfxjwfn4.js} +1 -1
  132. package/bundle/chunk-ch8cx9jn.js +2 -0
  133. package/bundle/{chunk-7ppd2phw.js → chunk-cjfgs1x8.js} +1 -1
  134. package/bundle/chunk-cm4jtnkg.js +2 -0
  135. package/bundle/chunk-cq7j5tv5.js +2 -0
  136. package/bundle/{chunk-1sgby720.js → chunk-csdm3n24.js} +1 -1
  137. package/bundle/{chunk-wy46mbwt.js → chunk-csyw14fj.js} +1 -1
  138. package/bundle/chunk-cttqh20d.js +2 -0
  139. package/bundle/chunk-cvvfa1jf.js +2 -0
  140. package/bundle/{chunk-btz9jvec.js → chunk-d0qqgxs4.js} +1 -1
  141. package/bundle/{chunk-gsvdt4kq.js → chunk-d7t0bcvk.js} +6 -6
  142. package/bundle/{chunk-tj78jsp9.js → chunk-d86ma6zk.js} +1 -1
  143. package/bundle/{chunk-4z4p492c.js → chunk-dd3m74rc.js} +1 -1
  144. package/bundle/chunk-dfja6dj6.js +5 -0
  145. package/bundle/chunk-e3qtndrt.js +2 -0
  146. package/bundle/chunk-e8cac405.js +2 -0
  147. package/bundle/{chunk-371r2111.js → chunk-ed723mw1.js} +1 -1
  148. package/bundle/{chunk-3nwve06r.js → chunk-ef2b07fm.js} +1 -1
  149. package/bundle/{chunk-j9pcnkkq.js → chunk-ekndhwnn.js} +2 -2
  150. package/bundle/{chunk-47b084yv.js → chunk-eqcd9k9p.js} +122 -122
  151. package/bundle/chunk-ez92ah9y.js +2 -0
  152. package/bundle/{chunk-brpx707p.js → chunk-f29n7826.js} +1 -1
  153. package/bundle/chunk-fazvedgy.js +2 -0
  154. package/bundle/{chunk-eb9mytjq.js → chunk-fhdpp77n.js} +1 -1
  155. package/bundle/{chunk-04tw0r4s.js → chunk-fj7kd4gc.js} +1 -1
  156. package/bundle/{chunk-be216spx.js → chunk-fsy279s5.js} +2 -2
  157. package/bundle/{chunk-37n34pzd.js → chunk-g06rv5fq.js} +1 -1
  158. package/bundle/{chunk-pekm54ce.js → chunk-g0mbbysk.js} +1 -1
  159. package/bundle/{chunk-vn7nkrqb.js → chunk-g3ch14a1.js} +1 -1
  160. package/bundle/{chunk-ggqst87g.js → chunk-gd45tjbd.js} +1 -1
  161. package/bundle/chunk-gd5stg49.js +2 -0
  162. package/bundle/{chunk-ds69qc8b.js → chunk-geccvf9d.js} +1 -1
  163. package/bundle/{chunk-stezw26z.js → chunk-gf5pwww1.js} +1 -1
  164. package/bundle/{chunk-x067eetw.js → chunk-gjvymdhp.js} +1 -1
  165. package/bundle/chunk-gtzcm5sb.js +2 -0
  166. package/bundle/{chunk-ngchsw2g.js → chunk-h8chkene.js} +1 -1
  167. package/bundle/{chunk-m67tcnk4.js → chunk-hbtd620x.js} +1 -1
  168. package/bundle/{chunk-qt2c4bty.js → chunk-hd2kb05a.js} +1 -1
  169. package/bundle/{chunk-b3dqcbsc.js → chunk-hevb7k95.js} +1 -1
  170. package/bundle/{chunk-v2zp22r3.js → chunk-hgbkg85g.js} +1 -1
  171. package/bundle/{chunk-5fgx6fa4.js → chunk-hhgjbag9.js} +1 -1
  172. package/bundle/{chunk-12bssxd4.js → chunk-hn1f6rne.js} +2 -2
  173. package/bundle/{chunk-hj5y7fvk.js → chunk-hpfqnjfz.js} +1 -1
  174. package/bundle/chunk-j0znryc6.js +9 -0
  175. package/bundle/{chunk-09kba1hg.js → chunk-j2zay4da.js} +2 -2
  176. package/bundle/{chunk-48fvrggx.js → chunk-j5ymkhry.js} +1 -1
  177. package/bundle/{chunk-tr8sf0dk.js → chunk-jkm54mha.js} +1 -1
  178. package/bundle/{chunk-v4xcysh0.js → chunk-jntqzhxr.js} +1 -1
  179. package/bundle/{chunk-p68rwmhc.js → chunk-js9wdh67.js} +1 -1
  180. package/bundle/{chunk-m02zt1a3.js → chunk-jwtev7b7.js} +2 -2
  181. package/bundle/chunk-k095hd3c.js +2 -0
  182. package/bundle/{chunk-q1v2pytx.js → chunk-k16s2dnx.js} +1 -1
  183. package/bundle/{chunk-sermjas1.js → chunk-k20nrwbg.js} +1 -1
  184. package/bundle/{chunk-6qy1ghrx.js → chunk-k7dcfqjs.js} +1 -1
  185. package/bundle/chunk-kfgn4apg.js +2 -0
  186. package/bundle/{chunk-jm1ptn8n.js → chunk-kkae8ead.js} +1 -1
  187. package/bundle/{chunk-m1h5a4vg.js → chunk-ktqrbbkh.js} +1 -1
  188. package/bundle/{chunk-0x3sbyny.js → chunk-kw09hbrb.js} +1 -1
  189. package/bundle/chunk-kzrw6h8t.js +2 -0
  190. package/bundle/{chunk-wrw22v0a.js → chunk-m2ny1en7.js} +4 -4
  191. package/bundle/{chunk-wnqwb6fd.js → chunk-m6wceqay.js} +1 -1
  192. package/bundle/{chunk-jh6yvzee.js → chunk-ma0m6kpj.js} +1 -1
  193. package/bundle/{chunk-g3dhsmbt.js → chunk-mb4wvwfw.js} +3 -3
  194. package/bundle/chunk-mjrvj2cg.js +2 -0
  195. package/bundle/chunk-mpebdv59.js +2 -0
  196. package/bundle/chunk-n20v44zr.js +2 -0
  197. package/bundle/{chunk-17psxhve.js → chunk-n34y5gp6.js} +2 -2
  198. package/bundle/{chunk-27yxgy03.js → chunk-n3t52cz2.js} +1 -1
  199. package/bundle/{chunk-szr0f7k2.js → chunk-n4gjpgnk.js} +1 -1
  200. package/bundle/{chunk-5qam3c8r.js → chunk-n5sh2790.js} +1 -1
  201. package/bundle/{chunk-5fz8tph5.js → chunk-n86s4fw4.js} +1 -1
  202. package/bundle/{chunk-6hv59ere.js → chunk-ndmrg80b.js} +1 -1
  203. package/bundle/{chunk-cpmmvwgw.js → chunk-nfzmvy30.js} +1 -1
  204. package/bundle/chunk-nksathh4.js +2 -0
  205. package/bundle/{chunk-yjtdgcq5.js → chunk-nv2r4cns.js} +1 -1
  206. package/bundle/{chunk-xs3xtz6x.js → chunk-nxn4arcf.js} +1 -1
  207. package/bundle/{chunk-m2ekhbdp.js → chunk-p5360c2q.js} +1 -1
  208. package/bundle/{chunk-1qshjfzm.js → chunk-p7h2qd7z.js} +1 -1
  209. package/bundle/{chunk-2rs39vj2.js → chunk-pg8dz1rq.js} +1 -1
  210. package/bundle/{chunk-vkskqhag.js → chunk-pq2prhb2.js} +1 -1
  211. package/bundle/{chunk-scnz207s.js → chunk-ps6jk326.js} +1 -1
  212. package/bundle/{chunk-gm85xefs.js → chunk-pycjksh4.js} +1 -1
  213. package/bundle/{chunk-gf0pdgjs.js → chunk-q0xzbad1.js} +1 -1
  214. package/bundle/chunk-q14890p6.js +2 -0
  215. package/bundle/chunk-q4n02cwv.js +2 -0
  216. package/bundle/{chunk-m2x9xhha.js → chunk-q5363rr9.js} +2 -2
  217. package/bundle/chunk-q7s17j1b.js +2 -0
  218. package/bundle/{chunk-msegx0t7.js → chunk-qje3683x.js} +1 -1
  219. package/bundle/{chunk-y2v09y71.js → chunk-qk9vccja.js} +1 -1
  220. package/bundle/chunk-qm07wesh.js +2 -0
  221. package/bundle/{chunk-chmrvbbj.js → chunk-qredfmch.js} +1 -1
  222. package/bundle/chunk-qrrg9v3d.js +2 -0
  223. package/bundle/{chunk-c0796v8j.js → chunk-qsszerj7.js} +2 -2
  224. package/bundle/chunk-qtsmgjk7.js +2 -0
  225. package/bundle/{chunk-dfnv7vkn.js → chunk-qzcfjz9g.js} +1 -1
  226. package/bundle/{chunk-bss414qz.js → chunk-qzjpea91.js} +1 -1
  227. package/bundle/{chunk-ksyh6h3a.js → chunk-r4mnbhe1.js} +1 -1
  228. package/bundle/chunk-rdqgss38.js +2 -0
  229. package/bundle/{chunk-mdck9s88.js → chunk-rf524gez.js} +1 -1
  230. package/bundle/{chunk-2q96x1t5.js → chunk-rptvpa1v.js} +1 -1
  231. package/bundle/{chunk-z8g819cz.js → chunk-rqgcz2zr.js} +1 -1
  232. package/bundle/{chunk-dzxzcb2e.js → chunk-rs1698xs.js} +1 -1
  233. package/bundle/chunk-rzc528ym.js +2 -0
  234. package/bundle/{chunk-xc5044tm.js → chunk-s1sepxdp.js} +1 -1
  235. package/bundle/{chunk-ak5ngp50.js → chunk-s2za1n7h.js} +2 -2
  236. package/bundle/{chunk-c5e6sk9c.js → chunk-s6me101a.js} +1 -1
  237. package/bundle/chunk-sbv96mj0.js +3 -0
  238. package/bundle/{chunk-qt1wffbh.js → chunk-sbx9z70j.js} +1 -1
  239. package/bundle/{chunk-crx18k6g.js → chunk-scqxmv8k.js} +1 -1
  240. package/bundle/{chunk-dq9kpj4a.js → chunk-sv48x9h8.js} +1 -1
  241. package/bundle/{chunk-q6ztpfcs.js → chunk-svrxk3vf.js} +2 -2
  242. package/bundle/{chunk-snm5q21k.js → chunk-t299e2aw.js} +2 -2
  243. package/bundle/{chunk-nzehfpxp.js → chunk-t35n89t9.js} +1 -1
  244. package/bundle/{chunk-fddsgvjy.js → chunk-t3q7qakr.js} +1 -1
  245. package/bundle/{chunk-mk6cddvd.js → chunk-t3tkp1em.js} +1 -1
  246. package/bundle/chunk-tge53d52.js +3 -0
  247. package/bundle/chunk-th78zcds.js +2 -0
  248. package/bundle/{chunk-5a5t01ka.js → chunk-thk93j3e.js} +1 -1
  249. package/bundle/{chunk-xck0sq3k.js → chunk-tj00kzk4.js} +1 -1
  250. package/bundle/chunk-tqsx2m1j.js +2 -0
  251. package/bundle/{chunk-b2z0kjss.js → chunk-tsb9g1nz.js} +1 -1
  252. package/bundle/chunk-tv26mwx5.js +2 -0
  253. package/bundle/{chunk-fkgv2hqd.js → chunk-v00cptj6.js} +1 -1
  254. package/bundle/chunk-v69n6mef.js +2 -0
  255. package/bundle/{chunk-7yrhe3xq.js → chunk-v7deh7aj.js} +1 -1
  256. package/bundle/{chunk-cvwa142e.js → chunk-v9bmpndq.js} +1 -1
  257. package/bundle/{chunk-xn2ds2s4.js → chunk-v9xnk9pz.js} +1 -1
  258. package/bundle/chunk-vegwb3t0.js +2 -0
  259. package/bundle/chunk-w9seyn69.js +2 -0
  260. package/bundle/chunk-wanf4se3.js +2 -0
  261. package/bundle/chunk-wdhzmk1b.js +2 -0
  262. package/bundle/{chunk-14n6rvh2.js → chunk-wnwesaap.js} +1 -1
  263. package/bundle/chunk-wxqtda70.js +2 -0
  264. package/bundle/chunk-wzb6s9rk.js +2 -0
  265. package/bundle/chunk-x0dg9rg6.js +2 -0
  266. package/bundle/{chunk-mskwkcgj.js → chunk-x6nbck7p.js} +1 -1
  267. package/bundle/chunk-xd3xc1vv.js +3 -0
  268. package/bundle/{chunk-89q1y7tc.js → chunk-xhncwg5v.js} +1 -1
  269. package/bundle/{chunk-jg7s9rqz.js → chunk-xk1nh1ay.js} +2 -2
  270. package/bundle/{chunk-qv2s39dv.js → chunk-xk7je9y8.js} +1 -1
  271. package/bundle/chunk-xmnzrzbs.js +2 -0
  272. package/bundle/{chunk-1fbeendk.js → chunk-xn5v8wgh.js} +1 -1
  273. package/bundle/{chunk-s07j8hfy.js → chunk-xn61fgrh.js} +1 -1
  274. package/bundle/chunk-xzf62kc6.js +2 -0
  275. package/bundle/{chunk-s3yna2wm.js → chunk-y212x7ws.js} +1 -1
  276. package/bundle/{chunk-6nbzdb0r.js → chunk-yaj9ywvz.js} +1 -1
  277. package/bundle/{chunk-463f9wre.js → chunk-yj73ehjd.js} +1 -1
  278. package/bundle/{chunk-aztre27e.js → chunk-yjj4cvqg.js} +1 -1
  279. package/bundle/{chunk-kavhpdvb.js → chunk-yk8kk25c.js} +1 -1
  280. package/bundle/{chunk-cafzcmrg.js → chunk-yn05n0az.js} +2 -2
  281. package/bundle/{chunk-89v6dgpp.js → chunk-yn576pje.js} +2 -2
  282. package/bundle/chunk-yned6vmd.js +3 -0
  283. package/bundle/{chunk-cvdxgsq1.js → chunk-yp3dj4wh.js} +1 -1
  284. package/bundle/{chunk-bvkq0a5q.js → chunk-ypthfv6d.js} +1 -1
  285. package/bundle/chunk-yra49yga.js +2 -0
  286. package/bundle/{chunk-srh4xvsj.js → chunk-yt2k9ga8.js} +1 -1
  287. package/bundle/chunk-ytye0p7f.js +2 -0
  288. package/bundle/chunk-yv2mxxbq.js +2 -0
  289. package/bundle/{chunk-phxrg7aw.js → chunk-yvqbewmc.js} +2 -2
  290. package/bundle/{chunk-h9pvnp5c.js → chunk-yyqrbv2f.js} +1 -1
  291. package/bundle/{chunk-2vepzgek.js → chunk-z160s5p5.js} +1 -1
  292. package/bundle/{chunk-baet4zev.js → chunk-z29fwg61.js} +1 -1
  293. package/bundle/chunk-z2fqqer0.js +2 -0
  294. package/bundle/chunk-z3qanc8m.js +2 -0
  295. package/bundle/{chunk-jnabd9gn.js → chunk-z44m19vm.js} +1 -1
  296. package/bundle/{chunk-yfkvjphe.js → chunk-z4nay2ef.js} +1 -1
  297. package/bundle/{chunk-2bn4b42t.js → chunk-z5yrvg40.js} +1 -1
  298. package/bundle/{chunk-61c62e5s.js → chunk-zasd8cz8.js} +1 -1
  299. package/bundle/{chunk-ztc3gm8y.js → chunk-zbq60sw6.js} +1 -1
  300. package/bundle/chunk-zcagdtab.js +2 -0
  301. package/bundle/chunk-zervk6c5.js +2 -0
  302. package/bundle/{chunk-va316nee.js → chunk-zfd70p01.js} +1 -1
  303. package/bundle/{chunk-pget15wc.js → chunk-zqjp7jdd.js} +1 -1
  304. package/bundle/{chunk-6fp8a9ek.js → chunk-zqxmr01r.js} +1 -1
  305. package/bundle/index.js +3 -3
  306. package/bundle/parser.worker.js +2 -2
  307. package/bundle/worker.js +1 -1
  308. package/package.json +1 -1
  309. package/bundle/chunk-02y04bsz.js +0 -2
  310. package/bundle/chunk-07ws99b1.js +0 -2
  311. package/bundle/chunk-09c4ngag.js +0 -2
  312. package/bundle/chunk-0jgst767.js +0 -2
  313. package/bundle/chunk-0psrr9vp.js +0 -2
  314. package/bundle/chunk-0srrmwqs.js +0 -2
  315. package/bundle/chunk-0zkejr6k.js +0 -2
  316. package/bundle/chunk-1fja3j80.js +0 -2
  317. package/bundle/chunk-1j73cnvz.js +0 -2
  318. package/bundle/chunk-1yddn03z.js +0 -2
  319. package/bundle/chunk-38g8yzw0.js +0 -2
  320. package/bundle/chunk-3bkd0ar3.js +0 -2
  321. package/bundle/chunk-3c7d3dqt.js +0 -3
  322. package/bundle/chunk-4amgp4yd.js +0 -3
  323. package/bundle/chunk-4k7kbhps.js +0 -2
  324. package/bundle/chunk-4sz3jbc5.js +0 -2
  325. package/bundle/chunk-55b9699f.js +0 -2
  326. package/bundle/chunk-6d9wsjxm.js +0 -2
  327. package/bundle/chunk-6gz9cthq.js +0 -2
  328. package/bundle/chunk-6q87abbr.js +0 -2
  329. package/bundle/chunk-730a2d1k.js +0 -2
  330. package/bundle/chunk-7bd0x9vf.js +0 -2
  331. package/bundle/chunk-7czkntef.js +0 -2
  332. package/bundle/chunk-7ex57nyh.js +0 -2
  333. package/bundle/chunk-7gpczxbh.js +0 -2
  334. package/bundle/chunk-7j0bgeh2.js +0 -2
  335. package/bundle/chunk-7py443fe.js +0 -2
  336. package/bundle/chunk-8cdm8gh2.js +0 -2
  337. package/bundle/chunk-90q5sae0.js +0 -2
  338. package/bundle/chunk-90zd5rss.js +0 -5
  339. package/bundle/chunk-9grvepmd.js +0 -2
  340. package/bundle/chunk-9hrh15p2.js +0 -2
  341. package/bundle/chunk-av6ezvxm.js +0 -2
  342. package/bundle/chunk-beksar7w.js +0 -2
  343. package/bundle/chunk-bg66rqrx.js +0 -2
  344. package/bundle/chunk-btneef3z.js +0 -2
  345. package/bundle/chunk-c7yy1km8.js +0 -2
  346. package/bundle/chunk-ct6dv8st.js +0 -2
  347. package/bundle/chunk-cy9s1ma5.js +0 -2
  348. package/bundle/chunk-dtv1vp0d.js +0 -2
  349. package/bundle/chunk-dvk2wwjj.js +0 -2
  350. package/bundle/chunk-e0jy9qxd.js +0 -2
  351. package/bundle/chunk-erg0ske8.js +0 -2
  352. package/bundle/chunk-ew51rwdp.js +0 -9
  353. package/bundle/chunk-f72pppr7.js +0 -2
  354. package/bundle/chunk-fff3151r.js +0 -2
  355. package/bundle/chunk-gbyy8sh5.js +0 -2
  356. package/bundle/chunk-gk34kh8p.js +0 -2
  357. package/bundle/chunk-gn50xqbd.js +0 -2
  358. package/bundle/chunk-h7s2w1e2.js +0 -2
  359. package/bundle/chunk-hgxdg1y5.js +0 -2
  360. package/bundle/chunk-hmv2cdnz.js +0 -2
  361. package/bundle/chunk-ht81ensf.js +0 -2
  362. package/bundle/chunk-j59ktwny.js +0 -2
  363. package/bundle/chunk-jh3nw7fd.js +0 -2
  364. package/bundle/chunk-jmz2mq3t.js +0 -2
  365. package/bundle/chunk-k309zez0.js +0 -3
  366. package/bundle/chunk-k3fn3yed.js +0 -2
  367. package/bundle/chunk-kpw6nghv.js +0 -2
  368. package/bundle/chunk-m5ghbt5y.js +0 -2
  369. package/bundle/chunk-m8yv4sd2.js +0 -3
  370. package/bundle/chunk-mn41f9qv.js +0 -2
  371. package/bundle/chunk-mqjf9sbm.js +0 -2
  372. package/bundle/chunk-n5gwrrbb.js +0 -2
  373. package/bundle/chunk-nfjhem1c.js +0 -2
  374. package/bundle/chunk-nj4d554m.js +0 -11
  375. package/bundle/chunk-nx90tvwg.js +0 -2
  376. package/bundle/chunk-nxyyn2ra.js +0 -2
  377. package/bundle/chunk-p5tceb4k.js +0 -2
  378. package/bundle/chunk-qjgm3e2p.js +0 -2
  379. package/bundle/chunk-r1616dce.js +0 -2
  380. package/bundle/chunk-sbyey0qb.js +0 -2
  381. package/bundle/chunk-sj5v361q.js +0 -2
  382. package/bundle/chunk-smtvgr3w.js +0 -2
  383. package/bundle/chunk-tpndnprb.js +0 -2
  384. package/bundle/chunk-vwxfgea7.js +0 -2
  385. package/bundle/chunk-w0kgcz1t.js +0 -2
  386. package/bundle/chunk-wajmd3r7.js +0 -2
  387. package/bundle/chunk-wksczmes.js +0 -2
  388. package/bundle/chunk-wsxta33r.js +0 -2
  389. package/bundle/chunk-xjyhtm8r.js +0 -2
  390. package/bundle/chunk-xxbqhg9n.js +0 -3
  391. package/bundle/chunk-y9p87bfd.js +0 -2
  392. package/bundle/chunk-ygc5qegv.js +0 -2
  393. package/bundle/chunk-yhwx62yf.js +0 -2
  394. package/bundle/chunk-yjqmzm51.js +0 -2
  395. package/bundle/chunk-z4z8hk7e.js +0 -2
  396. package/bundle/chunk-z7y9pdj7.js +0 -2
  397. package/bundle/chunk-zqv7fx25.js +0 -2
  398. package/bundle/chunk-zs2a1f20.js +0 -2
  399. package/bundle/chunk-zt1nbwmm.js +0 -2
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{pf as Lh}from"./chunk-ztc3gm8y.js";import{qf as Mt}from"./chunk-gf0pdgjs.js";import"./chunk-qhc90p4a.js";import{yf as eh}from"./chunk-cvdxgsq1.js";import{Bf as gt,zf as hh}from"./chunk-n8h6x2en.js";import{Fq as _t,Iq as Lt,Jq as ft,Kq as wt,Pq as jt,Qq as o,Sq as St,Uq as dt,Vq as et,Xq as pt,Zq as ot,ar as v,br as r,hr as E,ir as k,kr as _,nr as th,or as Ct,pq as Y,tq as vt,vq as lt,wq as bt}from"./chunk-yq3m8190.js";import{Br as kt,Dr as I,sr as rt}from"./chunk-btz9jvec.js";import"./chunk-cqtkxwd8.js";import"./chunk-fkgv2hqd.js";import{qv as h}from"./chunk-09kba1hg.js";import"./chunk-t12xrrfr.js";import{$P as ut}from"./chunk-aztre27e.js";var Ft=ut(Mt(),1);var J=ut(eh(),1);class ht{bytes;constructor(t){if(this.bytes=t,t.byteLength!==8)throw Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(t){if(t>9223372036854776000||t<-9223372036854776000)throw Error(`${t} is too large (or, if negative, too small) to represent as an Int64`);let s=new Uint8Array(8);for(let a=7,y=Math.abs(Math.round(t));a>-1&&y>0;a--,y/=256)s[a]=y;if(t<0)Qt(s);return new ht(s)}valueOf(){let t=this.bytes.slice(0),s=t[0]&128;if(s)Qt(t);return parseInt(J.toHex(t),16)*(s?-1:1)}toString(){return String(this.valueOf())}}function Qt(t){for(let s=0;s<8;s++)t[s]^=255;for(let s=7;s>-1;s--)if(t[s]++,t[s]!==0)break}class Ut{toUtf8;fromUtf8;constructor(t,s){this.toUtf8=t,this.fromUtf8=s}format(t){let s=[];for(let w of Object.keys(t)){let f=this.fromUtf8(w);s.push(Uint8Array.from([f.byteLength]),f,this.formatHeaderValue(t[w]))}let a=new Uint8Array(s.reduce((w,f)=>w+f.byteLength,0)),y=0;for(let w of s)a.set(w,y),y+=w.byteLength;return a}formatHeaderValue(t){switch(t.type){case"boolean":return Uint8Array.from([t.value?0:1]);case"byte":return Uint8Array.from([2,t.value]);case"short":let s=new DataView(new ArrayBuffer(3));return s.setUint8(0,3),s.setInt16(1,t.value,!1),new Uint8Array(s.buffer);case"integer":let a=new DataView(new ArrayBuffer(5));return a.setUint8(0,4),a.setInt32(1,t.value,!1),new Uint8Array(a.buffer);case"long":let y=new Uint8Array(9);return y[0]=5,y.set(t.value.bytes,1),y;case"binary":let w=new DataView(new ArrayBuffer(3+t.value.byteLength));w.setUint8(0,6),w.setUint16(1,t.value.byteLength,!1);let f=new Uint8Array(w.buffer);return f.set(t.value,3),f;case"string":let S=this.fromUtf8(t.value),g=new DataView(new ArrayBuffer(3+S.byteLength));g.setUint8(0,7),g.setUint16(1,S.byteLength,!1);let c=new Uint8Array(g.buffer);return c.set(S,3),c;case"timestamp":let T=new Uint8Array(9);return T[0]=8,T.set(ht.fromNumber(t.value.valueOf()).bytes,1),T;case"uuid":if(!Gh.test(t.value))throw Error(`Invalid UUID received: ${t.value}`);let N=new Uint8Array(17);return N[0]=9,N.set(J.fromHex(t.value.replace(/\-/g,"")),1),N}}parse(t){let s={},a=0;while(a<t.byteLength){let y=t.getUint8(a++),w=this.toUtf8(new Uint8Array(t.buffer,t.byteOffset+a,y));switch(a+=y,t.getUint8(a++)){case 0:s[w]={type:Zt,value:!0};break;case 1:s[w]={type:Zt,value:!1};break;case 2:s[w]={type:gh,value:t.getInt8(a++)};break;case 3:s[w]={type:Ah,value:t.getInt16(a,!1)},a+=2;break;case 4:s[w]={type:mh,value:t.getInt32(a,!1)},a+=4;break;case 5:s[w]={type:Uh,value:new ht(new Uint8Array(t.buffer,t.byteOffset+a,8))},a+=8;break;case 6:let f=t.getUint16(a,!1);a+=2,s[w]={type:zh,value:new Uint8Array(t.buffer,t.byteOffset+a,f)},a+=f;break;case 7:let S=t.getUint16(a,!1);a+=2,s[w]={type:Nh,value:this.toUtf8(new Uint8Array(t.buffer,t.byteOffset+a,S))},a+=S;break;case 8:s[w]={type:Th,value:new Date(new ht(new Uint8Array(t.buffer,t.byteOffset+a,8)).valueOf())},a+=8;break;case 9:let g=new Uint8Array(t.buffer,t.byteOffset+a,16);a+=16,s[w]={type:$h,value:`${J.toHex(g.subarray(0,4))}-${J.toHex(g.subarray(4,6))}-${J.toHex(g.subarray(6,8))}-${J.toHex(g.subarray(8,10))}-${J.toHex(g.subarray(10))}`};break;default:throw Error("Unrecognized header type tag")}}return s}}var xt;(function(t){t[t.boolTrue=0]="boolTrue",t[t.boolFalse=1]="boolFalse",t[t.byte=2]="byte",t[t.short=3]="short",t[t.integer=4]="integer",t[t.long=5]="long",t[t.byteArray=6]="byteArray",t[t.string=7]="string",t[t.timestamp=8]="timestamp",t[t.uuid=9]="uuid"})(xt||(xt={}));var Zt="boolean",gh="byte",Ah="short",mh="integer",Uh="long",zh="binary",Nh="string",Th="timestamp",$h="uuid",Gh=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;var Dt=ut(Mt(),1),Vt=4,l=Vt*2,p=4,Xh=l+p*2;function qt({byteLength:t,byteOffset:s,buffer:a}){if(t<Xh)throw Error("Provided message too short to accommodate event stream message overhead");let y=new DataView(a,s,t),w=y.getUint32(0,!1);if(t!==w)throw Error("Reported message length does not match received message length");let f=y.getUint32(Vt,!1),S=y.getUint32(l,!1),g=y.getUint32(t-p,!1),c=new Dt.Crc32().update(new Uint8Array(a,s,l));if(S!==c.digest())throw Error(`The prelude checksum specified in the message (${S}) does not match the calculated CRC32 checksum (${c.digest()})`);if(c.update(new Uint8Array(a,s+l,t-(l+p))),g!==c.digest())throw Error(`The message checksum (${c.digest()}) did not match the expected value of ${g}`);return{headers:new DataView(a,s+l+p,f),body:new Uint8Array(a,s+l+p+f,w-f-(l+p+p))}}class zt{headerMarshaller;messageBuffer;isEndOfStream;constructor(t,s){this.headerMarshaller=new Ut(t,s),this.messageBuffer=[],this.isEndOfStream=!1}feed(t){this.messageBuffer.push(this.decode(t))}endOfStream(){this.isEndOfStream=!0}getMessage(){let t=this.messageBuffer.pop(),s=this.isEndOfStream;return{getMessage(){return t},isEndOfStream(){return s}}}getAvailableMessages(){let t=this.messageBuffer;this.messageBuffer=[];let s=this.isEndOfStream;return{getMessages(){return t},isEndOfStream(){return s}}}encode({headers:t,body:s}){let a=this.headerMarshaller.format(t),y=a.byteLength+s.byteLength+16,w=new Uint8Array(y),f=new DataView(w.buffer,w.byteOffset,w.byteLength),S=new Ft.Crc32;return f.setUint32(0,y,!1),f.setUint32(4,a.byteLength,!1),f.setUint32(8,S.update(w.subarray(0,8)).digest(),!1),w.set(a,12),w.set(s,a.byteLength+12),f.setUint32(y-4,S.update(w.subarray(8,y-4)).digest(),!1),w}decode(t){let{headers:s,body:a}=qt(t);return{headers:this.headerMarshaller.parse(s),body:a}}formatHeaders(t){return this.headerMarshaller.format(t)}}var At=ut(Lh(),1);var Tt=new TextEncoder,bh={appstream2:"appstream",cloudhsmv2:"cloudhsm",email:"ses",marketplace:"aws-marketplace",mobile:"AWSMobileHubService",pinpoint:"mobiletargeting",queue:"sqs","git-codecommit":"codecommit","mturk-requester-sandbox":"mturk-requester","personalize-runtime":"personalize"},jh=new Set(["authorization","content-type","content-length","user-agent","presigned-expires","expect","x-amzn-trace-id","range","connection"]);class $t{constructor({method:t,url:s,headers:a,body:y,accessKeyId:w,secretAccessKey:f,sessionToken:S,service:g,region:c,cache:T,datetime:N,signQuery:j,appendSessionToken:e,allHeaders:A,singleEncode:m}){if(s==null)throw TypeError("url is a required option");if(w==null)throw TypeError("accessKeyId is a required option");if(f==null)throw TypeError("secretAccessKey is a required option");this.method=t||(y?"POST":"GET"),this.url=new URL(s),this.headers=new Headers(a||{}),this.body=y,this.accessKeyId=w,this.secretAccessKey=f,this.sessionToken=S;let $,i;if(!g||!c)[$,i]=Ch(this.url,this.headers);if(this.service=g||$||"",this.region=c||i||"us-east-1",this.cache=T||new Map,this.datetime=N||new Date().toISOString().replace(/[:-]|\.\d{3}/g,""),this.signQuery=j,this.appendSessionToken=e||this.service==="iotdevicegateway",this.headers.delete("Host"),this.service==="s3"&&!this.signQuery&&!this.headers.has("X-Amz-Content-Sha256"))this.headers.set("X-Amz-Content-Sha256","UNSIGNED-PAYLOAD");let H=this.signQuery?this.url.searchParams:this.headers;if(H.set("X-Amz-Date",this.datetime),this.sessionToken&&!this.appendSessionToken)H.set("X-Amz-Security-Token",this.sessionToken);if(this.signableHeaders=["host",...this.headers.keys()].filter((u)=>A||!jh.has(u)).sort(),this.signedHeaders=this.signableHeaders.join(";"),this.canonicalHeaders=this.signableHeaders.map((u)=>u+":"+(u==="host"?this.url.host:(this.headers.get(u)||"").replace(/\s+/g," "))).join(`
2
+ import{pf as Lh}from"./chunk-zbq60sw6.js";import{qf as Mt}from"./chunk-q0xzbad1.js";import"./chunk-8k55xz7z.js";import{yf as eh}from"./chunk-yp3dj4wh.js";import{Bf as gt,zf as hh}from"./chunk-6scqd8fh.js";import{Ap as ot,Dp as v,Ep as r,Kp as E,Lp as k,Np as _,Qp as th,Rp as Ct,So as Y,Wo as vt,Yo as lt,Zo as bt,gp as _t,jp as Lt,kp as ft,lp as wt,qp as jt,rp as o,tp as St,vp as dt,wp as et,yp as pt}from"./chunk-bzrsnv2k.js";import{Vp as rt,cq as kt,eq as I}from"./chunk-d0qqgxs4.js";import"./chunk-cqtkxwd8.js";import"./chunk-v00cptj6.js";import{Tt as h}from"./chunk-j2zay4da.js";import"./chunk-4vemws1t.js";import{CO as ut}from"./chunk-yjj4cvqg.js";var Ft=ut(Mt(),1);var J=ut(eh(),1);class ht{bytes;constructor(t){if(this.bytes=t,t.byteLength!==8)throw Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(t){if(t>9223372036854776000||t<-9223372036854776000)throw Error(`${t} is too large (or, if negative, too small) to represent as an Int64`);let s=new Uint8Array(8);for(let a=7,y=Math.abs(Math.round(t));a>-1&&y>0;a--,y/=256)s[a]=y;if(t<0)Qt(s);return new ht(s)}valueOf(){let t=this.bytes.slice(0),s=t[0]&128;if(s)Qt(t);return parseInt(J.toHex(t),16)*(s?-1:1)}toString(){return String(this.valueOf())}}function Qt(t){for(let s=0;s<8;s++)t[s]^=255;for(let s=7;s>-1;s--)if(t[s]++,t[s]!==0)break}class Ut{toUtf8;fromUtf8;constructor(t,s){this.toUtf8=t,this.fromUtf8=s}format(t){let s=[];for(let w of Object.keys(t)){let f=this.fromUtf8(w);s.push(Uint8Array.from([f.byteLength]),f,this.formatHeaderValue(t[w]))}let a=new Uint8Array(s.reduce((w,f)=>w+f.byteLength,0)),y=0;for(let w of s)a.set(w,y),y+=w.byteLength;return a}formatHeaderValue(t){switch(t.type){case"boolean":return Uint8Array.from([t.value?0:1]);case"byte":return Uint8Array.from([2,t.value]);case"short":let s=new DataView(new ArrayBuffer(3));return s.setUint8(0,3),s.setInt16(1,t.value,!1),new Uint8Array(s.buffer);case"integer":let a=new DataView(new ArrayBuffer(5));return a.setUint8(0,4),a.setInt32(1,t.value,!1),new Uint8Array(a.buffer);case"long":let y=new Uint8Array(9);return y[0]=5,y.set(t.value.bytes,1),y;case"binary":let w=new DataView(new ArrayBuffer(3+t.value.byteLength));w.setUint8(0,6),w.setUint16(1,t.value.byteLength,!1);let f=new Uint8Array(w.buffer);return f.set(t.value,3),f;case"string":let S=this.fromUtf8(t.value),g=new DataView(new ArrayBuffer(3+S.byteLength));g.setUint8(0,7),g.setUint16(1,S.byteLength,!1);let c=new Uint8Array(g.buffer);return c.set(S,3),c;case"timestamp":let T=new Uint8Array(9);return T[0]=8,T.set(ht.fromNumber(t.value.valueOf()).bytes,1),T;case"uuid":if(!Gh.test(t.value))throw Error(`Invalid UUID received: ${t.value}`);let N=new Uint8Array(17);return N[0]=9,N.set(J.fromHex(t.value.replace(/\-/g,"")),1),N}}parse(t){let s={},a=0;while(a<t.byteLength){let y=t.getUint8(a++),w=this.toUtf8(new Uint8Array(t.buffer,t.byteOffset+a,y));switch(a+=y,t.getUint8(a++)){case 0:s[w]={type:Zt,value:!0};break;case 1:s[w]={type:Zt,value:!1};break;case 2:s[w]={type:gh,value:t.getInt8(a++)};break;case 3:s[w]={type:Ah,value:t.getInt16(a,!1)},a+=2;break;case 4:s[w]={type:mh,value:t.getInt32(a,!1)},a+=4;break;case 5:s[w]={type:Uh,value:new ht(new Uint8Array(t.buffer,t.byteOffset+a,8))},a+=8;break;case 6:let f=t.getUint16(a,!1);a+=2,s[w]={type:zh,value:new Uint8Array(t.buffer,t.byteOffset+a,f)},a+=f;break;case 7:let S=t.getUint16(a,!1);a+=2,s[w]={type:Nh,value:this.toUtf8(new Uint8Array(t.buffer,t.byteOffset+a,S))},a+=S;break;case 8:s[w]={type:Th,value:new Date(new ht(new Uint8Array(t.buffer,t.byteOffset+a,8)).valueOf())},a+=8;break;case 9:let g=new Uint8Array(t.buffer,t.byteOffset+a,16);a+=16,s[w]={type:$h,value:`${J.toHex(g.subarray(0,4))}-${J.toHex(g.subarray(4,6))}-${J.toHex(g.subarray(6,8))}-${J.toHex(g.subarray(8,10))}-${J.toHex(g.subarray(10))}`};break;default:throw Error("Unrecognized header type tag")}}return s}}var xt;(function(t){t[t.boolTrue=0]="boolTrue",t[t.boolFalse=1]="boolFalse",t[t.byte=2]="byte",t[t.short=3]="short",t[t.integer=4]="integer",t[t.long=5]="long",t[t.byteArray=6]="byteArray",t[t.string=7]="string",t[t.timestamp=8]="timestamp",t[t.uuid=9]="uuid"})(xt||(xt={}));var Zt="boolean",gh="byte",Ah="short",mh="integer",Uh="long",zh="binary",Nh="string",Th="timestamp",$h="uuid",Gh=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/;var Dt=ut(Mt(),1),Vt=4,l=Vt*2,p=4,Xh=l+p*2;function qt({byteLength:t,byteOffset:s,buffer:a}){if(t<Xh)throw Error("Provided message too short to accommodate event stream message overhead");let y=new DataView(a,s,t),w=y.getUint32(0,!1);if(t!==w)throw Error("Reported message length does not match received message length");let f=y.getUint32(Vt,!1),S=y.getUint32(l,!1),g=y.getUint32(t-p,!1),c=new Dt.Crc32().update(new Uint8Array(a,s,l));if(S!==c.digest())throw Error(`The prelude checksum specified in the message (${S}) does not match the calculated CRC32 checksum (${c.digest()})`);if(c.update(new Uint8Array(a,s+l,t-(l+p))),g!==c.digest())throw Error(`The message checksum (${c.digest()}) did not match the expected value of ${g}`);return{headers:new DataView(a,s+l+p,f),body:new Uint8Array(a,s+l+p+f,w-f-(l+p+p))}}class zt{headerMarshaller;messageBuffer;isEndOfStream;constructor(t,s){this.headerMarshaller=new Ut(t,s),this.messageBuffer=[],this.isEndOfStream=!1}feed(t){this.messageBuffer.push(this.decode(t))}endOfStream(){this.isEndOfStream=!0}getMessage(){let t=this.messageBuffer.pop(),s=this.isEndOfStream;return{getMessage(){return t},isEndOfStream(){return s}}}getAvailableMessages(){let t=this.messageBuffer;this.messageBuffer=[];let s=this.isEndOfStream;return{getMessages(){return t},isEndOfStream(){return s}}}encode({headers:t,body:s}){let a=this.headerMarshaller.format(t),y=a.byteLength+s.byteLength+16,w=new Uint8Array(y),f=new DataView(w.buffer,w.byteOffset,w.byteLength),S=new Ft.Crc32;return f.setUint32(0,y,!1),f.setUint32(4,a.byteLength,!1),f.setUint32(8,S.update(w.subarray(0,8)).digest(),!1),w.set(a,12),w.set(s,a.byteLength+12),f.setUint32(y-4,S.update(w.subarray(8,y-4)).digest(),!1),w}decode(t){let{headers:s,body:a}=qt(t);return{headers:this.headerMarshaller.parse(s),body:a}}formatHeaders(t){return this.headerMarshaller.format(t)}}var At=ut(Lh(),1);var Tt=new TextEncoder,bh={appstream2:"appstream",cloudhsmv2:"cloudhsm",email:"ses",marketplace:"aws-marketplace",mobile:"AWSMobileHubService",pinpoint:"mobiletargeting",queue:"sqs","git-codecommit":"codecommit","mturk-requester-sandbox":"mturk-requester","personalize-runtime":"personalize"},jh=new Set(["authorization","content-type","content-length","user-agent","presigned-expires","expect","x-amzn-trace-id","range","connection"]);class $t{constructor({method:t,url:s,headers:a,body:y,accessKeyId:w,secretAccessKey:f,sessionToken:S,service:g,region:c,cache:T,datetime:N,signQuery:j,appendSessionToken:e,allHeaders:A,singleEncode:m}){if(s==null)throw TypeError("url is a required option");if(w==null)throw TypeError("accessKeyId is a required option");if(f==null)throw TypeError("secretAccessKey is a required option");this.method=t||(y?"POST":"GET"),this.url=new URL(s),this.headers=new Headers(a||{}),this.body=y,this.accessKeyId=w,this.secretAccessKey=f,this.sessionToken=S;let $,i;if(!g||!c)[$,i]=Ch(this.url,this.headers);if(this.service=g||$||"",this.region=c||i||"us-east-1",this.cache=T||new Map,this.datetime=N||new Date().toISOString().replace(/[:-]|\.\d{3}/g,""),this.signQuery=j,this.appendSessionToken=e||this.service==="iotdevicegateway",this.headers.delete("Host"),this.service==="s3"&&!this.signQuery&&!this.headers.has("X-Amz-Content-Sha256"))this.headers.set("X-Amz-Content-Sha256","UNSIGNED-PAYLOAD");let H=this.signQuery?this.url.searchParams:this.headers;if(H.set("X-Amz-Date",this.datetime),this.sessionToken&&!this.appendSessionToken)H.set("X-Amz-Security-Token",this.sessionToken);if(this.signableHeaders=["host",...this.headers.keys()].filter((u)=>A||!jh.has(u)).sort(),this.signedHeaders=this.signableHeaders.join(";"),this.canonicalHeaders=this.signableHeaders.map((u)=>u+":"+(u==="host"?this.url.host:(this.headers.get(u)||"").replace(/\s+/g," "))).join(`
3
3
  `),this.credentialString=[this.datetime.slice(0,8),this.region,this.service,"aws4_request"].join("/"),this.signQuery){if(this.service==="s3"&&!H.has("X-Amz-Expires"))H.set("X-Amz-Expires","86400");H.set("X-Amz-Algorithm","AWS4-HMAC-SHA256"),H.set("X-Amz-Credential",this.accessKeyId+"/"+this.credentialString),H.set("X-Amz-SignedHeaders",this.signedHeaders)}if(this.service==="s3")try{this.encodedPath=decodeURIComponent(this.url.pathname.replace(/\+/g," "))}catch(u){this.encodedPath=this.url.pathname}else this.encodedPath=this.url.pathname.replace(/\/+/g,"/");if(!m)this.encodedPath=encodeURIComponent(this.encodedPath).replace(/%2F/g,"/");this.encodedPath=Yt(this.encodedPath);let C=new Set;this.encodedSearch=[...this.url.searchParams].filter(([u])=>{if(!u)return!1;if(this.service==="s3"){if(C.has(u))return!1;C.add(u)}return!0}).map((u)=>u.map((X)=>Yt(encodeURIComponent(X)))).sort(([u,X],[L,W])=>u<L?-1:u>L?1:X<W?-1:X>W?1:0).map((u)=>u.join("=")).join("&")}async sign(){if(this.signQuery){if(this.url.searchParams.set("X-Amz-Signature",await this.signature()),this.sessionToken&&this.appendSessionToken)this.url.searchParams.set("X-Amz-Security-Token",this.sessionToken)}else this.headers.set("Authorization",await this.authHeader());return{method:this.method,url:this.url,headers:this.headers,body:this.body}}async authHeader(){return["AWS4-HMAC-SHA256 Credential="+this.accessKeyId+"/"+this.credentialString,"SignedHeaders="+this.signedHeaders,"Signature="+await this.signature()].join(", ")}async signature(){let t=this.datetime.slice(0,8),s=[this.secretAccessKey,t,this.region,this.service].join(),a=this.cache.get(s);if(!a){let y=await at("AWS4"+this.secretAccessKey,t),w=await at(y,this.region),f=await at(w,this.service);a=await at(f,"aws4_request"),this.cache.set(s,a)}return Nt(await at(a,await this.stringToSign()))}async stringToSign(){return["AWS4-HMAC-SHA256",this.datetime,this.credentialString,Nt(await Pt(await this.canonicalString()))].join(`
4
4
  `)}async canonicalString(){return[this.method.toUpperCase(),this.encodedPath,this.encodedSearch,this.canonicalHeaders+`
5
5
  `,this.signedHeaders,await this.hexBodyHash()].join(`
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import"./chunk-yjj4cvqg.js";var e="./libopentui-xtk56e94.so";export{e as default};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{Fq as a,Kq as o,Lq as GG,Oq as JG,Sq as NG,Vq as QG,_q as g,ar as v,br as k,hr as b,ir as R,jr as XG,kr as I,or as d,pq as V,rq as l,vq as e,wq as t}from"./chunk-yq3m8190.js";import{Ar as m,Dr as O,qr as f,wr as C}from"./chunk-btz9jvec.js";import"./chunk-cqtkxwd8.js";import"./chunk-fkgv2hqd.js";import{qv as G}from"./chunk-09kba1hg.js";import"./chunk-t12xrrfr.js";import"./chunk-aztre27e.js";function c(J){var Q,$,K,j,z,q;if(J==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 A=(Q=J.prompt_tokens)!=null?Q:0,Z=($=J.completion_tokens)!=null?$:0,N=(j=(K=J.prompt_tokens_details)==null?void 0:K.cached_tokens)!=null?j:0,X=(q=(z=J.completion_tokens_details)==null?void 0:z.reasoning_tokens)!=null?q:0;return{inputTokens:{total:A,noCache:A-N,cacheRead:N,cacheWrite:void 0},outputTokens:{total:Z,text:Z-X,reasoning:X},raw:J}}function _(J){switch(J){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"}}function u({id:J,model:Q,created:$}){return{id:J!=null?J:void 0,modelId:Q!=null?Q:void 0,timestamp:$!=null?new Date($*1000):void 0}}function i({tools:J,toolChoice:Q}){J=(J==null?void 0:J.length)?J:void 0;let $=[];if(J==null)return{tools:void 0,toolChoice:void 0,toolWarnings:$};let K=[];for(let z of J)if(z.type==="provider")$.push({type:"unsupported",feature:`provider-defined tool ${z.id}`});else K.push({type:"function",function:{name:z.name,description:z.description,parameters:z.inputSchema,...z.strict!=null?{strict:z.strict}:{}}});if(Q==null)return{tools:K,toolChoice:void 0,toolWarnings:$};let j=Q.type;switch(j){case"auto":case"none":case"required":return{tools:K,toolChoice:j,toolWarnings:$};case"tool":return{tools:K,toolChoice:{type:"function",function:{name:Q.toolName}},toolWarnings:$};default:throw new O({functionality:`tool choice type: ${j}`})}}var $G=G.object({enableThinking:G.boolean().optional(),thinkingBudget:G.number().positive().optional(),parallelToolCalls:G.boolean().optional()});function p(J){var Q,$,K,j;let z=c(J),q=($=(Q=J==null?void 0:J.prompt_tokens_details)==null?void 0:Q.cache_creation_input_tokens)!=null?$:0,A=((K=z.inputTokens.total)!=null?K:0)-((j=z.inputTokens.cacheRead)!=null?j:0)-q;return{...z,inputTokens:{...z.inputTokens,cacheWrite:q,noCache:A}}}function zG({data:J,mediaType:Q}){return J instanceof URL?J.toString():`data:${Q};base64,${t(J)}`}function BG({prompt:J,cacheControlValidator:Q}){var $,K;let j=[];for(let{role:z,content:q,...A}of J){let Z=Q==null?void 0:Q.getCacheControl(A.providerOptions);switch(z){case"system":{if(Z)j.push({role:"system",content:[{type:"text",text:q,cache_control:Z}]});else j.push({role:"system",content:q});break}case"user":{j.push({role:"user",content:q.map((N,X)=>{var E;let L=X===q.length-1,B=(E=Q==null?void 0:Q.getCacheControl(N.providerOptions))!=null?E:L?Z:void 0;switch(N.type){case"text":return{type:"text",text:N.text,...B?{cache_control:B}:{}};case"file":if(N.mediaType.startsWith("image/")){let U=N.mediaType==="image/*"?"image/jpeg":N.mediaType;return{type:"image_url",image_url:{url:zG({data:N.data,mediaType:U})},...B?{cache_control:B}:{}}}else throw new O({functionality:"Only image file parts are supported"})}})});break}case"assistant":{let N="",X=[];for(let E of q)switch(E.type){case"text":{N+=E.text;break}case"tool-call":{X.push({id:E.toolCallId,type:"function",function:{name:E.toolName,arguments:JSON.stringify(E.input)}});break}case"reasoning":{N+=E.text;break}}j.push({role:"assistant",content:Z?[{type:"text",text:N,cache_control:Z}]:N||null,tool_calls:X.length>0?X:void 0});break}case"tool":{let N=q.filter((X)=>X.type!=="tool-approval-response");for(let X=0;X<N.length;X++){let E=N[X],L=E.output,B=X===N.length-1,U=($=Q==null?void 0:Q.getCacheControl(E.providerOptions))!=null?$:B?Z:void 0,Y;switch(L.type){case"text":case"error-text":Y=L.value;break;case"execution-denied":Y=(K=L.reason)!=null?K:"Tool execution denied.";break;case"content":case"json":case"error-json":Y=JSON.stringify(L.value);break}j.push({role:"tool",tool_call_id:E.toolCallId,content:U?[{type:"text",text:Y,cache_control:U}]:Y})}break}default:throw Error(`Unsupported role: ${z}`)}}return j}var r=4;function EG(J){var Q;let $=J==null?void 0:J.alibaba;return(Q=$==null?void 0:$.cacheControl)!=null?Q:$==null?void 0:$.cache_control}var jG=class{constructor(){this.breakpointCount=0,this.warnings=[]}getCacheControl(J){let Q=EG(J);if(!Q)return;if(this.breakpointCount++,this.breakpointCount>r)this.warnings.push({type:"other",message:`Max breakpoint limit exceeded. Only the last ${r} cache markers will take effect.`});return Q}getWarnings(){return this.warnings}},KG=class{constructor(J,Q){this.specificationVersion="v3",this.supportedUrls={"image/*":[/^https?:\/\/.*$/]},this.modelId=J,this.config=Q}get provider(){return this.config.provider}async getArgs({prompt:J,maxOutputTokens:Q,temperature:$,topP:K,topK:j,frequencyPenalty:z,presencePenalty:q,stopSequences:A,responseFormat:Z,seed:N,providerOptions:X,tools:E,toolChoice:L}){var B;let U=[],Y=new jG,P=await v({provider:"alibaba",providerOptions:X,schema:$G});if(z!=null)U.push({type:"unsupported",feature:"frequencyPenalty"});let w={model:this.modelId,max_tokens:Q,temperature:$,top_p:K,top_k:j,presence_penalty:q,stop:A,seed:N,response_format:(Z==null?void 0:Z.type)==="json"?Z.schema!=null?{type:"json_schema",json_schema:{schema:Z.schema,name:(B=Z.name)!=null?B:"response",description:Z.description}}:{type:"json_object"}:void 0,...(P==null?void 0:P.enableThinking)!=null?{enable_thinking:P.enableThinking}:{},...(P==null?void 0:P.thinkingBudget)!=null?{thinking_budget:P.thinkingBudget}:{},messages:BG({prompt:J,cacheControlValidator:Y})},{tools:y,toolChoice:S,toolWarnings:F}=i({tools:E,toolChoice:L});return U.push(...Y.getWarnings()),{args:{...w,tools:y,tool_choice:S,...y!=null&&(P==null?void 0:P.parallelToolCalls)!==void 0?{parallel_tool_calls:P.parallelToolCalls}:{}},warnings:[...U,...F]}}async doGenerate(J){var Q;let{args:$,warnings:K}=await this.getArgs(J),{responseHeaders:j,value:z,rawValue:q}=await k({url:`${this.config.baseURL}/chat/completions`,headers:V(this.config.headers(),J.headers),body:$,failedResponseHandler:s,successfulResponseHandler:I(qG),abortSignal:J.abortSignal,fetch:this.config.fetch}),A=z.choices[0],Z=[],N=A.message.content;if(N!=null&&N.length>0)Z.push({type:"text",text:N});let X=A.message.reasoning_content;if(X!=null&&X.length>0)Z.push({type:"reasoning",text:X});if(A.message.tool_calls!=null)for(let E of A.message.tool_calls)Z.push({type:"tool-call",toolCallId:E.id,toolName:E.function.name,input:E.function.arguments});return{content:Z,finishReason:{unified:_(A.finish_reason),raw:(Q=A.finish_reason)!=null?Q:void 0},usage:p(z.usage),request:{body:JSON.stringify($)},response:{...u(z),headers:j,body:q},warnings:K}}async doStream(J){let{args:Q,warnings:$}=await this.getArgs(J),K={...Q,stream:!0,stream_options:this.config.includeUsage?{include_usage:!0}:void 0},{responseHeaders:j,value:z}=await k({url:`${this.config.baseURL}/chat/completions`,headers:V(this.config.headers(),J.headers),body:K,failedResponseHandler:s,successfulResponseHandler:XG(AG),abortSignal:J.abortSignal,fetch:this.config.fetch}),q={unified:"other",raw:void 0},A=void 0,Z=!0,N=!1,X=null,E=[];return{stream:z.pipeThrough(new TransformStream({start(L){L.enqueue({type:"stream-start",warnings:$})},transform(L,B){var U,Y,P,w;if(J.includeRawChunks)B.enqueue({type:"raw",rawValue:L.rawValue});if(!L.success){B.enqueue({type:"error",error:L.error});return}let y=L.value;if(Z)Z=!1,B.enqueue({type:"response-metadata",...u(y)});if(y.usage!=null)A=y.usage;if(y.choices.length===0)return;let S=y.choices[0],F=S.delta;if(F.reasoning_content!=null&&F.reasoning_content.length>0){if(X==null){if(N)B.enqueue({type:"text-end",id:"0"}),N=!1;X=a(),B.enqueue({type:"reasoning-start",id:X})}B.enqueue({type:"reasoning-delta",id:X,delta:F.reasoning_content})}if(F.content!=null&&F.content.length>0){if(X!=null)B.enqueue({type:"reasoning-end",id:X}),X=null;if(!N)B.enqueue({type:"text-start",id:"0"}),N=!0;B.enqueue({type:"text-delta",id:"0",delta:F.content})}if(F.tool_calls!=null){if(X!=null)B.enqueue({type:"reasoning-end",id:X}),X=null;if(N)B.enqueue({type:"text-end",id:"0"}),N=!1;for(let W of F.tool_calls){let M=(U=W.index)!=null?U:E.length;if(E[M]==null){if(W.id==null)throw new C({data:W,message:"Expected 'id' to be a string."});if(((Y=W.function)==null?void 0:Y.name)==null)throw new C({data:W,message:"Expected 'function.name' to be a string."});B.enqueue({type:"tool-input-start",id:W.id,toolName:W.function.name}),E[M]={id:W.id,type:"function",function:{name:W.function.name,arguments:(P=W.function.arguments)!=null?P:""},hasFinished:!1};let D=E[M];if(D.function.arguments.length>0)B.enqueue({type:"tool-input-delta",id:D.id,delta:D.function.arguments});if(g(D.function.arguments))B.enqueue({type:"tool-input-end",id:D.id}),B.enqueue({type:"tool-call",toolCallId:D.id,toolName:D.function.name,input:D.function.arguments}),D.hasFinished=!0;continue}let H=E[M];if(H.hasFinished)continue;if(((w=W.function)==null?void 0:w.arguments)!=null)H.function.arguments+=W.function.arguments,B.enqueue({type:"tool-input-delta",id:H.id,delta:W.function.arguments});if(g(H.function.arguments))B.enqueue({type:"tool-input-end",id:H.id}),B.enqueue({type:"tool-call",toolCallId:H.id,toolName:H.function.name,input:H.function.arguments}),H.hasFinished=!0}}if(S.finish_reason!=null)q={unified:_(S.finish_reason),raw:S.finish_reason}},flush(L){if(X!=null)L.enqueue({type:"reasoning-end",id:X});if(N)L.enqueue({type:"text-end",id:"0"});L.enqueue({type:"finish",finishReason:q,usage:p(A)})}})),request:{body:JSON.stringify(K)},response:{headers:j}}}},YG=G.object({prompt_tokens:G.number(),completion_tokens:G.number(),total_tokens:G.number(),prompt_tokens_details:G.object({cached_tokens:G.number().nullish(),cache_creation_input_tokens:G.number().nullish()}).nullish(),completion_tokens_details:G.object({reasoning_tokens:G.number().nullish()}).nullish()}),qG=G.object({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(),tool_calls:G.array(G.object({id:G.string(),type:G.literal("function"),function:G.object({name:G.string(),arguments:G.string()})})).nullish()}),finish_reason:G.string().nullish(),index:G.number()})),usage:YG.nullish()}),AG=G.object({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(),tool_calls:G.array(G.object({index:G.number().nullish(),id:G.string().nullish(),type:G.literal("function").nullish(),function:G.object({name:G.string().nullish(),arguments:G.string().nullish()}).nullish()})).nullish()}),finish_reason:G.string().nullish(),index:G.number()})),usage:YG.nullish()}),HG=NG(()=>QG(G.object({negativePrompt:G.string().nullish(),audioUrl:G.string().nullish(),promptExtend:G.boolean().nullish(),shotType:G.enum(["single","multi"]).nullish(),watermark:G.boolean().nullish(),audio:G.boolean().nullish(),referenceUrls:G.array(G.string()).nullish(),pollIntervalMs:G.number().positive().nullish(),pollTimeoutMs:G.number().positive().nullish()}).passthrough())),LG=G.object({code:G.string().nullish(),message:G.string(),request_id:G.string().nullish()}),n=R({errorSchema:LG,errorToMessage:(J)=>J.message}),PG=G.object({output:G.object({task_status:G.string(),task_id:G.string()}).nullish(),request_id:G.string().nullish()}),WG=G.object({output:G.object({task_id:G.string(),task_status:G.string(),video_url:G.string().nullish(),submit_time:G.string().nullish(),scheduled_time:G.string().nullish(),end_time:G.string().nullish(),orig_prompt:G.string().nullish(),actual_prompt:G.string().nullish(),code:G.string().nullish(),message:G.string().nullish()}).nullish(),usage:G.object({duration:G.number().nullish(),output_video_duration:G.number().nullish(),SR:G.number().nullish(),size:G.string().nullish()}).nullish(),request_id:G.string().nullish()});function UG(J){if(J.includes("-i2v"))return"i2v";if(J.includes("-r2v"))return"r2v";return"t2v"}var wG=class{constructor(J,Q){this.modelId=J,this.config=Q,this.specificationVersion="v3",this.maxVideosPerCall=1}get provider(){return this.config.provider}async doGenerate(J){var Q,$,K,j,z,q,A,Z,N,X,E;let L=(K=($=(Q=this.config._internal)==null?void 0:Q.currentDate)==null?void 0:$.call(Q))!=null?K:new Date,B=[],U=UG(this.modelId),Y=await v({provider:"alibaba",providerOptions:J.providerOptions,schema:HG}),P={};if(J.prompt!=null)P.prompt=J.prompt;if((Y==null?void 0:Y.negativePrompt)!=null)P.negative_prompt=Y.negativePrompt;if((Y==null?void 0:Y.audioUrl)!=null)P.audio_url=Y.audioUrl;if(U==="i2v"&&J.image!=null)if(J.image.type==="url")P.img_url=J.image.url;else{let x=typeof J.image.data==="string"?J.image.data:e(J.image.data);P.img_url=x}if(U==="r2v"&&(Y==null?void 0:Y.referenceUrls)!=null)P.reference_urls=Y.referenceUrls;let w={};if(J.duration!=null)w.duration=J.duration;if(J.seed!=null)w.seed=J.seed;if(J.resolution!=null)if(U==="i2v"){let x={"1280x720":"720P","720x1280":"720P","960x960":"720P","1088x832":"720P","832x1088":"720P","1920x1080":"1080P","1080x1920":"1080P","1440x1440":"1080P","1632x1248":"1080P","1248x1632":"1080P","832x480":"480P","480x832":"480P","624x624":"480P"};w.resolution=x[J.resolution]||J.resolution}else w.size=J.resolution.replace("x","*");if((Y==null?void 0:Y.promptExtend)!=null)w.prompt_extend=Y.promptExtend;if((Y==null?void 0:Y.shotType)!=null)w.shot_type=Y.shotType;if((Y==null?void 0:Y.watermark)!=null)w.watermark=Y.watermark;if((Y==null?void 0:Y.audio)!=null)w.audio=Y.audio;if(J.aspectRatio)B.push({type:"unsupported",feature:"aspectRatio",details:"Alibaba video models use explicit size/resolution dimensions. Use the resolution option or providerOptions.alibaba for size control."});if(J.fps)B.push({type:"unsupported",feature:"fps",details:"Alibaba video models do not support custom FPS."});if(J.n!=null&&J.n>1)B.push({type:"unsupported",feature:"n",details:"Alibaba video models only support generating 1 video per call."});let{value:y}=await k({url:`${this.config.baseURL}/api/v1/services/aigc/video-generation/video-synthesis`,headers:V(await b(this.config.headers),J.headers,{"X-DashScope-Async":"enable"}),body:{model:this.modelId,input:P,parameters:w},successfulResponseHandler:I(PG),failedResponseHandler:n,abortSignal:J.abortSignal,fetch:this.config.fetch}),S=(j=y.output)==null?void 0:j.task_id;if(!S)throw new f({name:"ALIBABA_VIDEO_GENERATION_ERROR",message:`No task_id returned from Alibaba API. Response: ${JSON.stringify(y)}`});let F=(z=Y==null?void 0:Y.pollIntervalMs)!=null?z:5000,W=(q=Y==null?void 0:Y.pollTimeoutMs)!=null?q:600000,M=Date.now(),H,D;while(!0){if(await l(F,{abortSignal:J.abortSignal}),Date.now()-M>W)throw new f({name:"ALIBABA_VIDEO_GENERATION_TIMEOUT",message:`Video generation timed out after ${W}ms`});let{value:x,responseHeaders:ZG}=await GG({url:`${this.config.baseURL}/api/v1/tasks/${S}`,headers:V(await b(this.config.headers),J.headers),successfulResponseHandler:I(WG),failedResponseHandler:n,abortSignal:J.abortSignal,fetch:this.config.fetch});D=ZG;let T=(A=x.output)==null?void 0:A.task_status;if(T==="SUCCEEDED"){H=x;break}if(T==="FAILED"||T==="CANCELED")throw new f({name:"ALIBABA_VIDEO_GENERATION_FAILED",message:`Video generation ${T.toLowerCase()}. Task ID: ${S}. ${(N=(Z=x.output)==null?void 0:Z.message)!=null?N:""}`})}let h=(X=H==null?void 0:H.output)==null?void 0:X.video_url;if(!h)throw new f({name:"ALIBABA_VIDEO_GENERATION_ERROR",message:`No video URL in response. Task ID: ${S}`});return{videos:[{type:"url",url:h,mediaType:"video/mp4"}],warnings:B,response:{timestamp:L,modelId:this.modelId,headers:D},providerMetadata:{alibaba:{taskId:S,videoUrl:h,...((E=H==null?void 0:H.output)==null?void 0:E.actual_prompt)?{actualPrompt:H.output.actual_prompt}:{},...(H==null?void 0:H.usage)?{usage:{duration:H.usage.duration,outputVideoDuration:H.usage.output_video_duration,resolution:H.usage.SR,size:H.usage.size}}:{}}}}}},SG="1.0.17",FG=G.object({error:G.object({message:G.string(),code:G.string().nullish(),type:G.string().nullish()})}),s=R({errorSchema:FG,errorToMessage:(J)=>J.error.message});function DG(J={}){var Q,$;let K=(Q=d(J.baseURL))!=null?Q:"https://dashscope-intl.aliyuncs.com/compatible-mode/v1",j=($=d(J.videoBaseURL))!=null?$:"https://dashscope-intl.aliyuncs.com",z=()=>o({Authorization:`Bearer ${JG({apiKey:J.apiKey,environmentVariableName:"ALIBABA_API_KEY",description:"Alibaba Cloud (DashScope)"})}`,...J.headers},`ai-sdk/alibaba/${SG}`),q=(N)=>{var X;return new KG(N,{provider:"alibaba.chat",baseURL:K,headers:z,fetch:J.fetch,includeUsage:(X=J.includeUsage)!=null?X:!0})},A=(N)=>new wG(N,{provider:"alibaba.video",baseURL:j,headers:z,fetch:J.fetch}),Z=function(N){if(new.target)throw Error("The Alibaba model function cannot be called with the new keyword.");return q(N)};return Z.specificationVersion="v3",Z.languageModel=q,Z.chatModel=q,Z.video=A,Z.videoModel=A,Z.imageModel=(N)=>{throw new m({modelId:N,modelType:"imageModel"})},Z.embeddingModel=(N)=>{throw new m({modelId:N,modelType:"embeddingModel"})},Z}var gG=DG();export{DG as createAlibaba,gG as alibaba,SG as VERSION};
2
+ import{Bp as g,Dp as v,Ep as k,Kp as b,Lp as R,Mp as XG,Np as I,Rp as d,So as V,Uo as l,Yo as e,Zo as t,gp as a,lp as o,mp as GG,pp as JG,tp as NG,wp as QG}from"./chunk-bzrsnv2k.js";import{Tp as f,Zp as C,bq as m,eq as O}from"./chunk-d0qqgxs4.js";import"./chunk-cqtkxwd8.js";import"./chunk-v00cptj6.js";import{Tt as G}from"./chunk-j2zay4da.js";import"./chunk-4vemws1t.js";import"./chunk-yjj4cvqg.js";function c(J){var Q,$,K,j,z,q;if(J==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 A=(Q=J.prompt_tokens)!=null?Q:0,Z=($=J.completion_tokens)!=null?$:0,N=(j=(K=J.prompt_tokens_details)==null?void 0:K.cached_tokens)!=null?j:0,X=(q=(z=J.completion_tokens_details)==null?void 0:z.reasoning_tokens)!=null?q:0;return{inputTokens:{total:A,noCache:A-N,cacheRead:N,cacheWrite:void 0},outputTokens:{total:Z,text:Z-X,reasoning:X},raw:J}}function _(J){switch(J){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"}}function u({id:J,model:Q,created:$}){return{id:J!=null?J:void 0,modelId:Q!=null?Q:void 0,timestamp:$!=null?new Date($*1000):void 0}}function i({tools:J,toolChoice:Q}){J=(J==null?void 0:J.length)?J:void 0;let $=[];if(J==null)return{tools:void 0,toolChoice:void 0,toolWarnings:$};let K=[];for(let z of J)if(z.type==="provider")$.push({type:"unsupported",feature:`provider-defined tool ${z.id}`});else K.push({type:"function",function:{name:z.name,description:z.description,parameters:z.inputSchema,...z.strict!=null?{strict:z.strict}:{}}});if(Q==null)return{tools:K,toolChoice:void 0,toolWarnings:$};let j=Q.type;switch(j){case"auto":case"none":case"required":return{tools:K,toolChoice:j,toolWarnings:$};case"tool":return{tools:K,toolChoice:{type:"function",function:{name:Q.toolName}},toolWarnings:$};default:throw new O({functionality:`tool choice type: ${j}`})}}var $G=G.object({enableThinking:G.boolean().optional(),thinkingBudget:G.number().positive().optional(),parallelToolCalls:G.boolean().optional()});function p(J){var Q,$,K,j;let z=c(J),q=($=(Q=J==null?void 0:J.prompt_tokens_details)==null?void 0:Q.cache_creation_input_tokens)!=null?$:0,A=((K=z.inputTokens.total)!=null?K:0)-((j=z.inputTokens.cacheRead)!=null?j:0)-q;return{...z,inputTokens:{...z.inputTokens,cacheWrite:q,noCache:A}}}function zG({data:J,mediaType:Q}){return J instanceof URL?J.toString():`data:${Q};base64,${t(J)}`}function BG({prompt:J,cacheControlValidator:Q}){var $,K;let j=[];for(let{role:z,content:q,...A}of J){let Z=Q==null?void 0:Q.getCacheControl(A.providerOptions);switch(z){case"system":{if(Z)j.push({role:"system",content:[{type:"text",text:q,cache_control:Z}]});else j.push({role:"system",content:q});break}case"user":{j.push({role:"user",content:q.map((N,X)=>{var E;let L=X===q.length-1,B=(E=Q==null?void 0:Q.getCacheControl(N.providerOptions))!=null?E:L?Z:void 0;switch(N.type){case"text":return{type:"text",text:N.text,...B?{cache_control:B}:{}};case"file":if(N.mediaType.startsWith("image/")){let U=N.mediaType==="image/*"?"image/jpeg":N.mediaType;return{type:"image_url",image_url:{url:zG({data:N.data,mediaType:U})},...B?{cache_control:B}:{}}}else throw new O({functionality:"Only image file parts are supported"})}})});break}case"assistant":{let N="",X=[];for(let E of q)switch(E.type){case"text":{N+=E.text;break}case"tool-call":{X.push({id:E.toolCallId,type:"function",function:{name:E.toolName,arguments:JSON.stringify(E.input)}});break}case"reasoning":{N+=E.text;break}}j.push({role:"assistant",content:Z?[{type:"text",text:N,cache_control:Z}]:N||null,tool_calls:X.length>0?X:void 0});break}case"tool":{let N=q.filter((X)=>X.type!=="tool-approval-response");for(let X=0;X<N.length;X++){let E=N[X],L=E.output,B=X===N.length-1,U=($=Q==null?void 0:Q.getCacheControl(E.providerOptions))!=null?$:B?Z:void 0,Y;switch(L.type){case"text":case"error-text":Y=L.value;break;case"execution-denied":Y=(K=L.reason)!=null?K:"Tool execution denied.";break;case"content":case"json":case"error-json":Y=JSON.stringify(L.value);break}j.push({role:"tool",tool_call_id:E.toolCallId,content:U?[{type:"text",text:Y,cache_control:U}]:Y})}break}default:throw Error(`Unsupported role: ${z}`)}}return j}var r=4;function EG(J){var Q;let $=J==null?void 0:J.alibaba;return(Q=$==null?void 0:$.cacheControl)!=null?Q:$==null?void 0:$.cache_control}var jG=class{constructor(){this.breakpointCount=0,this.warnings=[]}getCacheControl(J){let Q=EG(J);if(!Q)return;if(this.breakpointCount++,this.breakpointCount>r)this.warnings.push({type:"other",message:`Max breakpoint limit exceeded. Only the last ${r} cache markers will take effect.`});return Q}getWarnings(){return this.warnings}},KG=class{constructor(J,Q){this.specificationVersion="v3",this.supportedUrls={"image/*":[/^https?:\/\/.*$/]},this.modelId=J,this.config=Q}get provider(){return this.config.provider}async getArgs({prompt:J,maxOutputTokens:Q,temperature:$,topP:K,topK:j,frequencyPenalty:z,presencePenalty:q,stopSequences:A,responseFormat:Z,seed:N,providerOptions:X,tools:E,toolChoice:L}){var B;let U=[],Y=new jG,P=await v({provider:"alibaba",providerOptions:X,schema:$G});if(z!=null)U.push({type:"unsupported",feature:"frequencyPenalty"});let w={model:this.modelId,max_tokens:Q,temperature:$,top_p:K,top_k:j,presence_penalty:q,stop:A,seed:N,response_format:(Z==null?void 0:Z.type)==="json"?Z.schema!=null?{type:"json_schema",json_schema:{schema:Z.schema,name:(B=Z.name)!=null?B:"response",description:Z.description}}:{type:"json_object"}:void 0,...(P==null?void 0:P.enableThinking)!=null?{enable_thinking:P.enableThinking}:{},...(P==null?void 0:P.thinkingBudget)!=null?{thinking_budget:P.thinkingBudget}:{},messages:BG({prompt:J,cacheControlValidator:Y})},{tools:y,toolChoice:S,toolWarnings:F}=i({tools:E,toolChoice:L});return U.push(...Y.getWarnings()),{args:{...w,tools:y,tool_choice:S,...y!=null&&(P==null?void 0:P.parallelToolCalls)!==void 0?{parallel_tool_calls:P.parallelToolCalls}:{}},warnings:[...U,...F]}}async doGenerate(J){var Q;let{args:$,warnings:K}=await this.getArgs(J),{responseHeaders:j,value:z,rawValue:q}=await k({url:`${this.config.baseURL}/chat/completions`,headers:V(this.config.headers(),J.headers),body:$,failedResponseHandler:s,successfulResponseHandler:I(qG),abortSignal:J.abortSignal,fetch:this.config.fetch}),A=z.choices[0],Z=[],N=A.message.content;if(N!=null&&N.length>0)Z.push({type:"text",text:N});let X=A.message.reasoning_content;if(X!=null&&X.length>0)Z.push({type:"reasoning",text:X});if(A.message.tool_calls!=null)for(let E of A.message.tool_calls)Z.push({type:"tool-call",toolCallId:E.id,toolName:E.function.name,input:E.function.arguments});return{content:Z,finishReason:{unified:_(A.finish_reason),raw:(Q=A.finish_reason)!=null?Q:void 0},usage:p(z.usage),request:{body:JSON.stringify($)},response:{...u(z),headers:j,body:q},warnings:K}}async doStream(J){let{args:Q,warnings:$}=await this.getArgs(J),K={...Q,stream:!0,stream_options:this.config.includeUsage?{include_usage:!0}:void 0},{responseHeaders:j,value:z}=await k({url:`${this.config.baseURL}/chat/completions`,headers:V(this.config.headers(),J.headers),body:K,failedResponseHandler:s,successfulResponseHandler:XG(AG),abortSignal:J.abortSignal,fetch:this.config.fetch}),q={unified:"other",raw:void 0},A=void 0,Z=!0,N=!1,X=null,E=[];return{stream:z.pipeThrough(new TransformStream({start(L){L.enqueue({type:"stream-start",warnings:$})},transform(L,B){var U,Y,P,w;if(J.includeRawChunks)B.enqueue({type:"raw",rawValue:L.rawValue});if(!L.success){B.enqueue({type:"error",error:L.error});return}let y=L.value;if(Z)Z=!1,B.enqueue({type:"response-metadata",...u(y)});if(y.usage!=null)A=y.usage;if(y.choices.length===0)return;let S=y.choices[0],F=S.delta;if(F.reasoning_content!=null&&F.reasoning_content.length>0){if(X==null){if(N)B.enqueue({type:"text-end",id:"0"}),N=!1;X=a(),B.enqueue({type:"reasoning-start",id:X})}B.enqueue({type:"reasoning-delta",id:X,delta:F.reasoning_content})}if(F.content!=null&&F.content.length>0){if(X!=null)B.enqueue({type:"reasoning-end",id:X}),X=null;if(!N)B.enqueue({type:"text-start",id:"0"}),N=!0;B.enqueue({type:"text-delta",id:"0",delta:F.content})}if(F.tool_calls!=null){if(X!=null)B.enqueue({type:"reasoning-end",id:X}),X=null;if(N)B.enqueue({type:"text-end",id:"0"}),N=!1;for(let W of F.tool_calls){let M=(U=W.index)!=null?U:E.length;if(E[M]==null){if(W.id==null)throw new C({data:W,message:"Expected 'id' to be a string."});if(((Y=W.function)==null?void 0:Y.name)==null)throw new C({data:W,message:"Expected 'function.name' to be a string."});B.enqueue({type:"tool-input-start",id:W.id,toolName:W.function.name}),E[M]={id:W.id,type:"function",function:{name:W.function.name,arguments:(P=W.function.arguments)!=null?P:""},hasFinished:!1};let D=E[M];if(D.function.arguments.length>0)B.enqueue({type:"tool-input-delta",id:D.id,delta:D.function.arguments});if(g(D.function.arguments))B.enqueue({type:"tool-input-end",id:D.id}),B.enqueue({type:"tool-call",toolCallId:D.id,toolName:D.function.name,input:D.function.arguments}),D.hasFinished=!0;continue}let H=E[M];if(H.hasFinished)continue;if(((w=W.function)==null?void 0:w.arguments)!=null)H.function.arguments+=W.function.arguments,B.enqueue({type:"tool-input-delta",id:H.id,delta:W.function.arguments});if(g(H.function.arguments))B.enqueue({type:"tool-input-end",id:H.id}),B.enqueue({type:"tool-call",toolCallId:H.id,toolName:H.function.name,input:H.function.arguments}),H.hasFinished=!0}}if(S.finish_reason!=null)q={unified:_(S.finish_reason),raw:S.finish_reason}},flush(L){if(X!=null)L.enqueue({type:"reasoning-end",id:X});if(N)L.enqueue({type:"text-end",id:"0"});L.enqueue({type:"finish",finishReason:q,usage:p(A)})}})),request:{body:JSON.stringify(K)},response:{headers:j}}}},YG=G.object({prompt_tokens:G.number(),completion_tokens:G.number(),total_tokens:G.number(),prompt_tokens_details:G.object({cached_tokens:G.number().nullish(),cache_creation_input_tokens:G.number().nullish()}).nullish(),completion_tokens_details:G.object({reasoning_tokens:G.number().nullish()}).nullish()}),qG=G.object({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(),tool_calls:G.array(G.object({id:G.string(),type:G.literal("function"),function:G.object({name:G.string(),arguments:G.string()})})).nullish()}),finish_reason:G.string().nullish(),index:G.number()})),usage:YG.nullish()}),AG=G.object({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(),tool_calls:G.array(G.object({index:G.number().nullish(),id:G.string().nullish(),type:G.literal("function").nullish(),function:G.object({name:G.string().nullish(),arguments:G.string().nullish()}).nullish()})).nullish()}),finish_reason:G.string().nullish(),index:G.number()})),usage:YG.nullish()}),HG=NG(()=>QG(G.object({negativePrompt:G.string().nullish(),audioUrl:G.string().nullish(),promptExtend:G.boolean().nullish(),shotType:G.enum(["single","multi"]).nullish(),watermark:G.boolean().nullish(),audio:G.boolean().nullish(),referenceUrls:G.array(G.string()).nullish(),pollIntervalMs:G.number().positive().nullish(),pollTimeoutMs:G.number().positive().nullish()}).passthrough())),LG=G.object({code:G.string().nullish(),message:G.string(),request_id:G.string().nullish()}),n=R({errorSchema:LG,errorToMessage:(J)=>J.message}),PG=G.object({output:G.object({task_status:G.string(),task_id:G.string()}).nullish(),request_id:G.string().nullish()}),WG=G.object({output:G.object({task_id:G.string(),task_status:G.string(),video_url:G.string().nullish(),submit_time:G.string().nullish(),scheduled_time:G.string().nullish(),end_time:G.string().nullish(),orig_prompt:G.string().nullish(),actual_prompt:G.string().nullish(),code:G.string().nullish(),message:G.string().nullish()}).nullish(),usage:G.object({duration:G.number().nullish(),output_video_duration:G.number().nullish(),SR:G.number().nullish(),size:G.string().nullish()}).nullish(),request_id:G.string().nullish()});function UG(J){if(J.includes("-i2v"))return"i2v";if(J.includes("-r2v"))return"r2v";return"t2v"}var wG=class{constructor(J,Q){this.modelId=J,this.config=Q,this.specificationVersion="v3",this.maxVideosPerCall=1}get provider(){return this.config.provider}async doGenerate(J){var Q,$,K,j,z,q,A,Z,N,X,E;let L=(K=($=(Q=this.config._internal)==null?void 0:Q.currentDate)==null?void 0:$.call(Q))!=null?K:new Date,B=[],U=UG(this.modelId),Y=await v({provider:"alibaba",providerOptions:J.providerOptions,schema:HG}),P={};if(J.prompt!=null)P.prompt=J.prompt;if((Y==null?void 0:Y.negativePrompt)!=null)P.negative_prompt=Y.negativePrompt;if((Y==null?void 0:Y.audioUrl)!=null)P.audio_url=Y.audioUrl;if(U==="i2v"&&J.image!=null)if(J.image.type==="url")P.img_url=J.image.url;else{let x=typeof J.image.data==="string"?J.image.data:e(J.image.data);P.img_url=x}if(U==="r2v"&&(Y==null?void 0:Y.referenceUrls)!=null)P.reference_urls=Y.referenceUrls;let w={};if(J.duration!=null)w.duration=J.duration;if(J.seed!=null)w.seed=J.seed;if(J.resolution!=null)if(U==="i2v"){let x={"1280x720":"720P","720x1280":"720P","960x960":"720P","1088x832":"720P","832x1088":"720P","1920x1080":"1080P","1080x1920":"1080P","1440x1440":"1080P","1632x1248":"1080P","1248x1632":"1080P","832x480":"480P","480x832":"480P","624x624":"480P"};w.resolution=x[J.resolution]||J.resolution}else w.size=J.resolution.replace("x","*");if((Y==null?void 0:Y.promptExtend)!=null)w.prompt_extend=Y.promptExtend;if((Y==null?void 0:Y.shotType)!=null)w.shot_type=Y.shotType;if((Y==null?void 0:Y.watermark)!=null)w.watermark=Y.watermark;if((Y==null?void 0:Y.audio)!=null)w.audio=Y.audio;if(J.aspectRatio)B.push({type:"unsupported",feature:"aspectRatio",details:"Alibaba video models use explicit size/resolution dimensions. Use the resolution option or providerOptions.alibaba for size control."});if(J.fps)B.push({type:"unsupported",feature:"fps",details:"Alibaba video models do not support custom FPS."});if(J.n!=null&&J.n>1)B.push({type:"unsupported",feature:"n",details:"Alibaba video models only support generating 1 video per call."});let{value:y}=await k({url:`${this.config.baseURL}/api/v1/services/aigc/video-generation/video-synthesis`,headers:V(await b(this.config.headers),J.headers,{"X-DashScope-Async":"enable"}),body:{model:this.modelId,input:P,parameters:w},successfulResponseHandler:I(PG),failedResponseHandler:n,abortSignal:J.abortSignal,fetch:this.config.fetch}),S=(j=y.output)==null?void 0:j.task_id;if(!S)throw new f({name:"ALIBABA_VIDEO_GENERATION_ERROR",message:`No task_id returned from Alibaba API. Response: ${JSON.stringify(y)}`});let F=(z=Y==null?void 0:Y.pollIntervalMs)!=null?z:5000,W=(q=Y==null?void 0:Y.pollTimeoutMs)!=null?q:600000,M=Date.now(),H,D;while(!0){if(await l(F,{abortSignal:J.abortSignal}),Date.now()-M>W)throw new f({name:"ALIBABA_VIDEO_GENERATION_TIMEOUT",message:`Video generation timed out after ${W}ms`});let{value:x,responseHeaders:ZG}=await GG({url:`${this.config.baseURL}/api/v1/tasks/${S}`,headers:V(await b(this.config.headers),J.headers),successfulResponseHandler:I(WG),failedResponseHandler:n,abortSignal:J.abortSignal,fetch:this.config.fetch});D=ZG;let T=(A=x.output)==null?void 0:A.task_status;if(T==="SUCCEEDED"){H=x;break}if(T==="FAILED"||T==="CANCELED")throw new f({name:"ALIBABA_VIDEO_GENERATION_FAILED",message:`Video generation ${T.toLowerCase()}. Task ID: ${S}. ${(N=(Z=x.output)==null?void 0:Z.message)!=null?N:""}`})}let h=(X=H==null?void 0:H.output)==null?void 0:X.video_url;if(!h)throw new f({name:"ALIBABA_VIDEO_GENERATION_ERROR",message:`No video URL in response. Task ID: ${S}`});return{videos:[{type:"url",url:h,mediaType:"video/mp4"}],warnings:B,response:{timestamp:L,modelId:this.modelId,headers:D},providerMetadata:{alibaba:{taskId:S,videoUrl:h,...((E=H==null?void 0:H.output)==null?void 0:E.actual_prompt)?{actualPrompt:H.output.actual_prompt}:{},...(H==null?void 0:H.usage)?{usage:{duration:H.usage.duration,outputVideoDuration:H.usage.output_video_duration,resolution:H.usage.SR,size:H.usage.size}}:{}}}}}},SG="1.0.17",FG=G.object({error:G.object({message:G.string(),code:G.string().nullish(),type:G.string().nullish()})}),s=R({errorSchema:FG,errorToMessage:(J)=>J.error.message});function DG(J={}){var Q,$;let K=(Q=d(J.baseURL))!=null?Q:"https://dashscope-intl.aliyuncs.com/compatible-mode/v1",j=($=d(J.videoBaseURL))!=null?$:"https://dashscope-intl.aliyuncs.com",z=()=>o({Authorization:`Bearer ${JG({apiKey:J.apiKey,environmentVariableName:"ALIBABA_API_KEY",description:"Alibaba Cloud (DashScope)"})}`,...J.headers},`ai-sdk/alibaba/${SG}`),q=(N)=>{var X;return new KG(N,{provider:"alibaba.chat",baseURL:K,headers:z,fetch:J.fetch,includeUsage:(X=J.includeUsage)!=null?X:!0})},A=(N)=>new wG(N,{provider:"alibaba.video",baseURL:j,headers:z,fetch:J.fetch}),Z=function(N){if(new.target)throw Error("The Alibaba model function cannot be called with the new keyword.");return q(N)};return Z.specificationVersion="v3",Z.languageModel=q,Z.chatModel=q,Z.video=A,Z.videoModel=A,Z.imageModel=(N)=>{throw new m({modelId:N,modelType:"imageModel"})},Z.embeddingModel=(N)=>{throw new m({modelId:N,modelType:"embeddingModel"})},Z}var gG=DG();export{DG as createAlibaba,gG as alibaba,SG as VERSION};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{Id as q,Jd as K,Kd as D,Nd as L,Od as N}from"./chunk-2p9py4rw.js";import"./chunk-n3t52cz2.js";import{Vf as B}from"./chunk-cjfgs1x8.js";import{hh as G}from"./chunk-m2ny1en7.js";import"./chunk-09j71kp6.js";import"./chunk-js9wdh67.js";import"./chunk-0a0vat1h.js";import"./chunk-z8v2tsz2.js";import"./chunk-j8efst22.js";import"./chunk-8f0g7d7k.js";import"./chunk-abtn6nec.js";import"./chunk-d7t0bcvk.js";import{Fl as C}from"./chunk-7mc8nxve.js";import"./chunk-dfja6dj6.js";import"./chunk-n34y5gp6.js";import"./chunk-bn0h9dny.js";import"./chunk-q5363rr9.js";import"./chunk-7wthn44y.js";import"./chunk-a8p9aggx.js";import"./chunk-0xm85ayc.js";import"./chunk-s2za1n7h.js";import"./chunk-19sa03c1.js";import"./chunk-csdm3n24.js";import"./chunk-xk1nh1ay.js";import"./chunk-bsf6n350.js";import"./chunk-4vze3djr.js";import"./chunk-bzrsnv2k.js";import"./chunk-d0qqgxs4.js";import"./chunk-cqtkxwd8.js";import"./chunk-v00cptj6.js";import"./chunk-1d9f53sk.js";import"./chunk-svrxk3vf.js";import"./chunk-kkae8ead.js";import"./chunk-s6me101a.js";import"./chunk-jwtev7b7.js";import"./chunk-b9nwaaqs.js";import"./chunk-qsszerj7.js";import"./chunk-6jewfaqa.js";import"./chunk-6hdjkvr1.js";import"./chunk-1rn0vmvv.js";import"./chunk-fsy279s5.js";import"./chunk-hn1f6rne.js";import"./chunk-4kpvceap.js";import{Wr as J}from"./chunk-94qmhz2p.js";import"./chunk-20d0cd1j.js";import"./chunk-yn576pje.js";import"./chunk-b6dsv601.js";import"./chunk-j2zay4da.js";import"./chunk-4vemws1t.js";import"./chunk-yvqbewmc.js";import"./chunk-t299e2aw.js";import"./chunk-bv8pf0m1.js";import"./chunk-4mrz9b6d.js";import"./chunk-yjj4cvqg.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{N as R9}from"./chunk-vkskqhag.js";import{Ed as E9}from"./chunk-qt1wffbh.js";import{Fd as P6,Id as p$,Jd as S9,Kd as U9,Nd as H9,Od as q6}from"./chunk-jje0srjq.js";import"./chunk-27yxgy03.js";import{Rd as T0}from"./chunk-yajd975f.js";import{Vf as O}from"./chunk-7ppd2phw.js";import{Wg as j9,dh as I9,hh as E$}from"./chunk-wrw22v0a.js";import"./chunk-h7yya9pv.js";import"./chunk-p68rwmhc.js";import"./chunk-0a0vat1h.js";import"./chunk-z8v2tsz2.js";import"./chunk-j8efst22.js";import"./chunk-a1pw9r6f.js";import"./chunk-d5bxan80.js";import{Cl as b9,Xj as T9,lk as O6,mk as M0,rl as w9,tl as D9}from"./chunk-gsvdt4kq.js";import{Pl as N9}from"./chunk-b7mg883n.js";import{cm as A0,lm as T$}from"./chunk-90zd5rss.js";import"./chunk-17psxhve.js";import"./chunk-nj4d554m.js";import"./chunk-m2x9xhha.js";import"./chunk-2wcv3sq5.js";import"./chunk-a1p2f16h.js";import"./chunk-nt4e3em9.js";import"./chunk-ak5ngp50.js";import"./chunk-v965rsr8.js";import"./chunk-1sgby720.js";import"./chunk-jg7s9rqz.js";import"./chunk-4tbwha3m.js";import"./chunk-m612agnk.js";import"./chunk-yq3m8190.js";import"./chunk-btz9jvec.js";import"./chunk-cqtkxwd8.js";import"./chunk-fkgv2hqd.js";import"./chunk-zyhdxggp.js";import"./chunk-q6ztpfcs.js";import"./chunk-jm1ptn8n.js";import"./chunk-c5e6sk9c.js";import"./chunk-m02zt1a3.js";import"./chunk-vg2fmyje.js";import"./chunk-c0796v8j.js";import"./chunk-njnwdgvd.js";import"./chunk-4qqkqrn9.js";import"./chunk-j6emx6jn.js";import"./chunk-be216spx.js";import"./chunk-12bssxd4.js";import"./chunk-k9b1jcqw.js";import{At as R6,Bt as L9,Gt as F9,xt as V9}from"./chunk-zxaaxb99.js";import{Hu as C6,Su as A9}from"./chunk-whxjkz9a.js";import"./chunk-89v6dgpp.js";import"./chunk-k309zez0.js";import"./chunk-09kba1hg.js";import"./chunk-t12xrrfr.js";import"./chunk-phxrg7aw.js";import{PI as M9}from"./chunk-snm5q21k.js";import"./chunk-xpc2zgj7.js";import"./chunk-qjjch1zt.js";import{$P as q0,aQ as D,dQ as E}from"./chunk-aztre27e.js";var JZ=D((zZ)=>{/*!
2
+ import{N as R9}from"./chunk-pq2prhb2.js";import{Ed as E9}from"./chunk-sbx9z70j.js";import{Fd as P6,Id as p$,Jd as S9,Kd as U9,Nd as H9,Od as q6}from"./chunk-2p9py4rw.js";import"./chunk-n3t52cz2.js";import{Rd as T0}from"./chunk-yajd975f.js";import{Vf as O}from"./chunk-cjfgs1x8.js";import{Wg as j9,dh as I9,hh as E$}from"./chunk-m2ny1en7.js";import"./chunk-09j71kp6.js";import"./chunk-js9wdh67.js";import"./chunk-0a0vat1h.js";import"./chunk-z8v2tsz2.js";import"./chunk-j8efst22.js";import"./chunk-8f0g7d7k.js";import"./chunk-abtn6nec.js";import{Cl as b9,Xj as T9,lk as O6,mk as M0,rl as w9,tl as D9}from"./chunk-d7t0bcvk.js";import{Pl as N9}from"./chunk-7mc8nxve.js";import{cm as A0,lm as T$}from"./chunk-dfja6dj6.js";import"./chunk-n34y5gp6.js";import"./chunk-bn0h9dny.js";import"./chunk-q5363rr9.js";import"./chunk-7wthn44y.js";import"./chunk-a8p9aggx.js";import"./chunk-0xm85ayc.js";import"./chunk-s2za1n7h.js";import"./chunk-19sa03c1.js";import"./chunk-csdm3n24.js";import"./chunk-xk1nh1ay.js";import"./chunk-bsf6n350.js";import"./chunk-4vze3djr.js";import"./chunk-bzrsnv2k.js";import"./chunk-d0qqgxs4.js";import"./chunk-cqtkxwd8.js";import"./chunk-v00cptj6.js";import"./chunk-1d9f53sk.js";import"./chunk-svrxk3vf.js";import"./chunk-kkae8ead.js";import"./chunk-s6me101a.js";import"./chunk-jwtev7b7.js";import"./chunk-b9nwaaqs.js";import"./chunk-qsszerj7.js";import"./chunk-6jewfaqa.js";import"./chunk-6hdjkvr1.js";import"./chunk-1rn0vmvv.js";import"./chunk-fsy279s5.js";import"./chunk-hn1f6rne.js";import"./chunk-4kpvceap.js";import{_r as V9,bs as R6,cs as L9,hs as F9}from"./chunk-94qmhz2p.js";import{it as C6,tt as A9}from"./chunk-20d0cd1j.js";import"./chunk-yn576pje.js";import"./chunk-b6dsv601.js";import"./chunk-j2zay4da.js";import"./chunk-4vemws1t.js";import"./chunk-yvqbewmc.js";import{qH as M9}from"./chunk-t299e2aw.js";import"./chunk-bv8pf0m1.js";import"./chunk-4mrz9b6d.js";import{CO as q0,DO as D,GO as E}from"./chunk-yjj4cvqg.js";var JZ=D((zZ)=>{/*!
3
3
  * content-type
4
4
  * Copyright(c) 2015 Douglas Christopher Wilson
5
5
  * MIT Licensed
@@ -1,3 +1,3 @@
1
1
  // @bun
2
- import{rm as f,sm as Gj,tm as Rj,um as Hj,xm as s}from"./chunk-17psxhve.js";import{Fp as xj}from"./chunk-a1p2f16h.js";import{aq as vj}from"./chunk-1sgby720.js";import{Bs as P,Cs as wj,Is as k,Js as Kj}from"./chunk-4qqkqrn9.js";import{ku as Ij,lu as Jj,ou as Nj,pu as I,tt as a,ut as y,yu as h}from"./chunk-zxaaxb99.js";import{Su as i}from"./chunk-whxjkz9a.js";import{Uu as j}from"./chunk-k309zez0.js";import{HG as d,PI as Q,ZD as Wj,mG as o,oP as l,pO as C}from"./chunk-snm5q21k.js";import{$P as Mj,bQ as Oj,dQ as Ej}from"./chunk-aztre27e.js";var tj={};Oj(tj,{stopRefresh:()=>aj,startRefresh:()=>sj,refresh:()=>jj,readModelCatalogResponse:()=>Pj,get:()=>fj,Provider:()=>cj,Model:()=>pj,MODEL_CATALOG_MAX_BYTES:()=>Aj,Data:()=>S});import hj from"path";var U={};Oj(U,{layer:()=>Bj,isPreview:()=>ij,isNewerVersion:()=>qj,isLocal:()=>mj,getReleaseType:()=>yj,defaultLayer:()=>uj,UpgradeFailedError:()=>x,USER_AGENT:()=>Sj,Service:()=>E,Installation:()=>U,Info:()=>Uj,Event:()=>Cj});var _j=(J)=>J.pipe(k.retryTransient({retryOn:"errors-and-responses",times:2,schedule:d.exponential(200).pipe(d.jittered)}));import Yj from"path";var z=Mj(xj(),1);import n from"crypto";import v from"fs";import Zj from"path";class H extends Error{constructor(J){super(J);this.name="SelfUpdateError"}}function $j(J){let V=J?.platform??process.platform,_=J?.arch??process.arch,$=J?.libc??"bionic",W=["qitqode",V==="win32"?"windows":V,_];if(_==="x64")W.push("baseline");if(V==="linux"&&$==="musl")W.push("musl");return`@qitqode/${W.join("-")}`}function kj(J,V){if(V.integrity){let _=V.integrity.match(/^(sha512|sha384|sha256)-([A-Za-z0-9+/=]+)$/);if(!_)throw new H(`registry returned an unrecognized integrity string: ${V.integrity}`);if(n.createHash(_[1]).update(J).digest("base64")!==_[2])throw new H(`checksum mismatch: downloaded tarball does not match the registry ${_[1]} integrity value; refusing to install`);return}if(V.shasum){if(n.createHash("sha1").update(J).digest("hex")!==V.shasum.toLowerCase())throw new H("checksum mismatch: downloaded tarball does not match the registry shasum; refusing to install");return}throw new H("registry provided no integrity metadata for the tarball; refusing to install")}function Qj(J,V){let _=(w,R)=>{let G=w,q=w+R;while(G<q&&J[G]!==0)G++;return new TextDecoder().decode(J.subarray(w,G))},$=0,W;while($+512<=J.length){if(J.subarray($,$+512).every((Z)=>Z===0))break;let R=_($+124,12).trim(),G=R?parseInt(R,8):0;if(!Number.isFinite(G)||G<0)throw new H("downloaded tarball is corrupt (bad tar header)");let q=String.fromCharCode(J[$+156]),B=_($,100),N=_($+345,155);if(N)B=`${N}/${B}`;if(W)B=W,W=void 0;let b=$+512,X=b+G;if(q==="L")W=new TextDecoder().decode(J.subarray(b,X)).replace(/\0+$/,"");else if((q==="0"||q==="\x00"||q==="")&&B===V)return J.slice(b,X);$=b+Math.ceil(G/512)*512}return}var A=(J)=>String(J instanceof Error?J.message:J),u=(J)=>Q.fail(new H(J)),p=(J,V)=>Q.try({try:J,catch:(_)=>new H(V(_))}),Xj=Q.fnUntraced(function*(J){let{target:V,execPath:_,packageName:$,registry:W}=J,w=J.gunzip??((K)=>Bun.gunzipSync(K)),R=Zj.dirname(_);yield*p(()=>v.accessSync(R,v.constants.W_OK),()=>`no write permission for ${R}; cannot replace ${_}. Fix the directory permissions or re-run with sufficient privileges.`);let G=`${W}/${$}/${encodeURIComponent(V)}`,B=(yield*J.fetchJson(G).pipe(Q.mapError((K)=>new H(`download failed: could not fetch ${$}@${V} from ${W} (${A(K)}). Check your network connection and that version ${V} exists.`))))?.dist;if(!B?.tarball)return yield*u(`registry response for ${$}@${V} has no tarball URL; cannot self-update`);let N=B.tarball,b=yield*J.fetchBytes(N).pipe(Q.mapError((K)=>new H(`download failed: could not download ${N} (${A(K)}). Check your network connection and try again.`)));yield*Q.try({try:()=>kj(b,B),catch:(K)=>K instanceof H?K:new H(A(K))});let X=yield*Q.try({try:()=>w(b),catch:()=>new H("downloaded tarball is corrupt (gunzip failed); try again")}),Z=Qj(X,"package/bin/qitqode")??Qj(X,"package/bin/qitqode.exe");if(!Z||Z.length===0)return yield*u(`tarball for ${$}@${V} does not contain the expected binary at bin/qitqode`);let O=Zj.join(R,`.qitqode-upgrade-${process.pid}`),Y=`${_}.backup-${process.pid}`,D=(K)=>{try{v.rmSync(K,{force:!0})}catch{}};yield*p(()=>v.writeFileSync(O,Z,{mode:493}),(K)=>{return D(O),`no write permission: could not write ${O} (${A(K)})`});let L=yield*J.runVersion(O).pipe(Q.mapError((K)=>{return D(O),new H(`downloaded binary failed its --version check (${A(K)}); keeping the current installation`)}));if(L.code!==0)return D(O),yield*u(`downloaded binary failed its --version check (exit ${L.code}); keeping the current installation`);let m=L.stdout.trim();if(m&&!m.includes(V))return D(O),yield*u(`downloaded binary reports version "${m}" instead of ${V}; keeping the current installation`);yield*p(()=>v.renameSync(_,Y),(K)=>{return D(O),`could not move the current binary aside (${A(K)}); check permissions on ${_}`}),yield*Q.try({try:()=>v.renameSync(O,_),catch:(K)=>{try{v.renameSync(Y,_)}catch{return new H(`failed to install the new binary AND failed to restore the old one; your previous binary is preserved at ${Y} \u2014 move it back to ${_} manually`)}return D(O),new H(`could not install the new binary (${A(K)}); the previous version was restored`)}}),D(Y)});var c=h.create({service:"installation"}),M="@qitqode/cli";function qj(J,V){if(!z.default.valid(J)||!z.default.valid(V))return!1;return z.default.gt(V,J)}var Cj={Updated:s.define("installation.updated",j.object({version:j.string()})),UpdateAvailable:s.define("installation.update-available",j.object({version:j.string()}))};function yj(J,V){if(!qj(J,V))throw Error(`Version ${V} is not newer than ${J}`);let _=z.default.major(J),$=z.default.minor(J),W=z.default.major(V),w=z.default.minor(V);if(W>_)return"major";if(w>$)return"minor";return"patch"}var Uj=j.object({version:j.string(),latest:j.string()}).meta({ref:"InstallationInfo"}),Sj=`qitqode/${y}/${a}/${I.QITQODE_CLIENT}`;function ij(){return y!=="latest"}function mj(){return y==="local"}class x extends C.TaggedErrorClass()("UpgradeFailedError",{stderr:C.String}){}var nj=C.Struct({version:C.String});class E extends Wj.Service()("@qitqode/Installation"){}var Bj=o.effect(E,Q.gen(function*(){let J=yield*k.HttpClient,V=k.filterStatusOk(_j(J)),_=yield*f.ChildProcessSpawner,$=(X,Z)=>Gj.make(X[0],X.slice(1),{cwd:Z?.cwd,env:Z?.env,extendEnv:!0}),W=Q.fnUntraced(function*(X){let Z=yield*Hj(_,X);return{code:Z.code,stdout:Z.text,stderr:Z.stderr}},Q.scoped),w=Q.fnUntraced(function*(X,Z){let O=yield*_.spawn($(X,Z)),Y=yield*l.mkString(l.decodeText(O.stdout));return yield*O.exitCode,Y},Q.scoped,Q.catch(()=>Q.succeed(""))),R=Q.fnUntraced(function*(X,Z){return yield*W($(X,Z))},Q.catch(()=>Q.succeed({code:f.ExitCode(1),stdout:"",stderr:""}))),G=Q.fn("Installation.method")(function*(){if(process.execPath.includes(Yj.join(".qitqode","bin")))return"curl";if(process.execPath.includes(Yj.join(".local","bin")))return"curl";let X=process.execPath.toLowerCase(),Z=[{name:"npm",command:()=>w(["npm","list","-g","--depth=0"])},{name:"pnpm",command:()=>w(["pnpm","list","-g","--depth=0"])},{name:"bun",command:()=>w(["bun","pm","ls","-g"])}];Z.sort((O,Y)=>{let D=X.includes(O.name),L=X.includes(Y.name);if(D&&!L)return-1;if(!D&&L)return 1;return 0});for(let O of Z)if((yield*O.command()).includes(M))return O.name;return"unknown"}),q=Q.fn("Installation.latest")(function*(X){let Z=X||(yield*G());if(Z==="curl"){let Y=(yield*w(["curl","-sI","https://github.com/qitqode/qitqode/releases/latest"])).match(/^location:.*\/tag\/v([0-9][^\s/]*)/im);if(Y)return Y[1];return yield*Q.die(Error("failed to resolve latest version from GitHub releases redirect"))}if(Z==="npm"||Z==="bun"||Z==="pnpm"){let Y=(yield*w(["npm","config","get","registry"])).trim()||"https://registry.npmjs.org",D=Y.endsWith("/")?Y.slice(0,-1):Y,L=yield*V.execute(P.get(`${D}/${encodeURIComponent(M)}/${y}`).pipe(P.acceptJson));return(yield*wj.schemaBodyJson(nj)(L)).version}return c.warn("unsupported update channel, skipping",{method:Z}),yield*Q.die(Error(`unsupported update channel: ${Z}`))},Q.orDie),B=Q.fnUntraced(function*(){let Z=(yield*w(["npm","config","get","registry"])).trim()||"https://registry.npmjs.org";return Z.endsWith("/")?Z.slice(0,-1):Z}),N=Q.fnUntraced(function*(X){let Z=yield*B();yield*Xj({target:X,execPath:process.env.QITQODE_SELF_UPDATE_TARGET_BINARY||process.execPath,packageName:$j(),registry:Z,fetchJson:(O)=>V.execute(P.get(O).pipe(P.acceptJson)).pipe(Q.flatMap((Y)=>Y.json)),fetchBytes:(O)=>V.execute(P.get(O)).pipe(Q.flatMap((Y)=>Y.arrayBuffer),Q.map((Y)=>new Uint8Array(Y))),runVersion:(O)=>R([O,"--version"]).pipe(Q.map((Y)=>({code:Y.code,stdout:Y.stdout})))}).pipe(Q.mapError((O)=>new x({stderr:O.message})))}),b=Q.fn("Installation.upgrade")(function*(X,Z){if(X==="curl"){yield*N(Z),c.info("upgraded",{method:X,target:Z});return}let Y=yield*(()=>{if(X==="npm")return R(["npm","install","-g",`${M}@${Z}`]);if(X==="pnpm")return R(["pnpm","install","-g",`${M}@${Z}`]);if(X==="bun")return R(["bun","install","-g",`${M}@${Z}`]);return new x({stderr:`Unknown method: ${X}`})})();if(Y.code!==0){let D=Y.stderr||"";return yield*new x({stderr:D})}c.info("upgraded",{method:X,target:Z,stdout:Y.stdout,stderr:Y.stderr}),yield*w([process.execPath,"--version"])});return E.of({info:Q.fn("Installation.info")(function*(){return{version:a,latest:yield*q()}}),method:G,latest:q,upgrade:b})})),uj=Bj.pipe(o.provide(Kj.layer),o.provide(Rj));var t=j.lazy(()=>j.union([j.string(),j.number(),j.boolean(),j.null(),j.array(t),j.record(j.string(),t)])),Dj=j.object({input:j.number(),output:j.number(),cache_read:j.number().optional(),cache_write:j.number().optional(),context_over_200k:j.object({input:j.number(),output:j.number(),cache_read:j.number().optional(),cache_write:j.number().optional()}).optional()}),r=j.object({id:j.string(),name:j.string(),family:j.string().optional(),release_date:j.string(),attachment:j.boolean(),reasoning:j.boolean(),temperature:j.boolean().optional(),tool_call:j.boolean(),interleaved:j.union([j.literal(!0),j.object({field:j.enum(["reasoning_content","reasoning_details"])}).strict()]).optional(),cost:Dj.optional(),limit:j.object({context:j.number(),input:j.number().optional(),output:j.number()}),modalities:j.object({input:j.array(j.enum(["text","audio","image","video","pdf"])),output:j.array(j.enum(["text","audio","image","video","pdf"]))}).optional(),experimental:j.object({modes:j.record(j.string(),j.object({cost:Dj.optional(),provider:j.object({body:j.record(j.string(),t).optional(),headers:j.record(j.string(),j.string()).optional()}).optional()})).optional()}).optional(),status:j.enum(["alpha","beta","deprecated"]).optional(),provider:j.object({npm:j.string().optional(),api:j.string().optional()}).optional()}),e=j.object({api:j.string().optional(),name:j.string(),env:j.array(j.string()),id:j.string(),npm:j.string().optional(),models:j.record(j.string(),r)});var Vj=h.create({service:"models.dev"}),bj=Fj(),F=hj.join(Nj.Path.cache,bj==="https://models.dev"?"models.json":`models-${Ij.fast(bj)}.json`),gj=300000,Aj=8388608,T,dj=j.record(j.string(),e),pj=r,cj=e;function Fj(){return I.QITQODE_MODELS_URL||"https://models.dev"}function lj(){return Date.now()-Number(i.stat(F)?.mtimeMs??0)<gj}function Lj(J){return!J&&lj()}function g(J){let V=dj.parse(typeof J==="string"?JSON.parse(J):J);for(let[_,$]of Object.entries(V))if($.id!==_)throw Error(`Invalid model provider: ${_}`);return V}async function zj(J){let V=await i.readJson(J).catch(()=>{return});if(!V)return;try{return g(V)}catch(_){Vj.warn("Ignoring invalid model catalog cache",{file:J,error:_});return}}async function Pj(J,V,_=Aj){let $=J.headers.get("content-type")?.split(";")[0]?.trim().toLowerCase();if($!=="application/json"&&!$?.endsWith("+json"))throw Error(`Invalid model catalog content type: ${$||"missing"}`);let W=Number(J.headers.get("content-length"));if(Number.isFinite(W)&&W>_)throw Error("Model catalog response is too large");if(!J.body)return"";let w=J.body.getReader(),R=()=>void w.cancel(V.reason);V.addEventListener("abort",R,{once:!0});let G=new Uint8Array(_),q=0;try{for(;;){let B=await w.read();if(B.done)break;if(q+=B.value.byteLength,q>_)throw await w.cancel(),Error("Model catalog response is too large");G.set(B.value,q-B.value.byteLength)}}finally{V.removeEventListener("abort",R)}return new TextDecoder().decode(G.subarray(0,q))}var Tj=async()=>{let J=AbortSignal.timeout(1e4),V=await fetch(`${Fj()}/api.json`,{headers:{"User-Agent":U.USER_AGENT},signal:J});if(!V.ok)return;let _=g(await Pj(V,J));return JSON.stringify(_)},S=vj(async()=>{let J=await zj(I.QITQODE_MODELS_PATH??F);if(J)return J;let V=await import("./chunk-1bhvt33f.js").then((_)=>g(_.snapshot)).catch(()=>{return});if(V)return V;if(I.QITQODE_DISABLE_MODELS_FETCH)return{};return Jj.withLock(`models-dev:${F}`,async()=>{let _=await zj(I.QITQODE_MODELS_PATH??F);if(_)return _;let $=await Tj();if($)return await i.write(F,$).catch((W)=>{Vj.error("Failed to write models cache",{error:W})}),g($);return{}})});async function fj(){return S()}async function jj(J=!1){if(Lj(J))return S.reset();await Jj.withLock(`models-dev:${F}`,async()=>{if(Lj(J))return S.reset();let V=await Tj();if(!V)return;await i.write(F,V),S.reset()}).catch((V)=>{Vj.error("Failed to fetch models.dev",{error:V})})}function sj(){if(T||I.QITQODE_DISABLE_MODELS_FETCH||process.argv.includes("--get-yargs-completions"))return;jj(),T=setInterval(async()=>{await jj()},3600000),T.unref()}function aj(){if(!T)return;clearInterval(T),T=void 0}
2
+ import{rm as f,sm as Gj,tm as Rj,um as Hj,xm as s}from"./chunk-n34y5gp6.js";import{go as xj}from"./chunk-a8p9aggx.js";import{Do as vj}from"./chunk-csdm3n24.js";import{cr as P,dr as wj,jr as k,kr as Kj}from"./chunk-6hdjkvr1.js";import{$s as h,Ns as Ij,Os as Jj,Rs as Nj,Ss as I,Wr as a,Xr as y}from"./chunk-94qmhz2p.js";import{tt as i}from"./chunk-20d0cd1j.js";import{vt as j}from"./chunk-b6dsv601.js";import{AC as Wj,PE as o,RN as l,SM as C,iF as d,qH as Q}from"./chunk-t299e2aw.js";import{CO as Mj,EO as Oj,GO as Ej}from"./chunk-yjj4cvqg.js";var tj={};Oj(tj,{stopRefresh:()=>aj,startRefresh:()=>sj,refresh:()=>jj,readModelCatalogResponse:()=>Pj,get:()=>fj,Provider:()=>cj,Model:()=>pj,MODEL_CATALOG_MAX_BYTES:()=>Aj,Data:()=>S});import hj from"path";var U={};Oj(U,{layer:()=>Bj,isPreview:()=>ij,isNewerVersion:()=>qj,isLocal:()=>mj,getReleaseType:()=>yj,defaultLayer:()=>uj,UpgradeFailedError:()=>x,USER_AGENT:()=>Sj,Service:()=>E,Installation:()=>U,Info:()=>Uj,Event:()=>Cj});var _j=(J)=>J.pipe(k.retryTransient({retryOn:"errors-and-responses",times:2,schedule:d.exponential(200).pipe(d.jittered)}));import Yj from"path";var z=Mj(xj(),1);import n from"crypto";import v from"fs";import Zj from"path";class H extends Error{constructor(J){super(J);this.name="SelfUpdateError"}}function $j(J){let V=J?.platform??process.platform,_=J?.arch??process.arch,$=J?.libc??"bionic",W=["qitqode",V==="win32"?"windows":V,_];if(_==="x64")W.push("baseline");if(V==="linux"&&$==="musl")W.push("musl");return`@qitqode/${W.join("-")}`}function kj(J,V){if(V.integrity){let _=V.integrity.match(/^(sha512|sha384|sha256)-([A-Za-z0-9+/=]+)$/);if(!_)throw new H(`registry returned an unrecognized integrity string: ${V.integrity}`);if(n.createHash(_[1]).update(J).digest("base64")!==_[2])throw new H(`checksum mismatch: downloaded tarball does not match the registry ${_[1]} integrity value; refusing to install`);return}if(V.shasum){if(n.createHash("sha1").update(J).digest("hex")!==V.shasum.toLowerCase())throw new H("checksum mismatch: downloaded tarball does not match the registry shasum; refusing to install");return}throw new H("registry provided no integrity metadata for the tarball; refusing to install")}function Qj(J,V){let _=(w,R)=>{let G=w,q=w+R;while(G<q&&J[G]!==0)G++;return new TextDecoder().decode(J.subarray(w,G))},$=0,W;while($+512<=J.length){if(J.subarray($,$+512).every((Z)=>Z===0))break;let R=_($+124,12).trim(),G=R?parseInt(R,8):0;if(!Number.isFinite(G)||G<0)throw new H("downloaded tarball is corrupt (bad tar header)");let q=String.fromCharCode(J[$+156]),B=_($,100),N=_($+345,155);if(N)B=`${N}/${B}`;if(W)B=W,W=void 0;let b=$+512,X=b+G;if(q==="L")W=new TextDecoder().decode(J.subarray(b,X)).replace(/\0+$/,"");else if((q==="0"||q==="\x00"||q==="")&&B===V)return J.slice(b,X);$=b+Math.ceil(G/512)*512}return}var A=(J)=>String(J instanceof Error?J.message:J),u=(J)=>Q.fail(new H(J)),p=(J,V)=>Q.try({try:J,catch:(_)=>new H(V(_))}),Xj=Q.fnUntraced(function*(J){let{target:V,execPath:_,packageName:$,registry:W}=J,w=J.gunzip??((K)=>Bun.gunzipSync(K)),R=Zj.dirname(_);yield*p(()=>v.accessSync(R,v.constants.W_OK),()=>`no write permission for ${R}; cannot replace ${_}. Fix the directory permissions or re-run with sufficient privileges.`);let G=`${W}/${$}/${encodeURIComponent(V)}`,B=(yield*J.fetchJson(G).pipe(Q.mapError((K)=>new H(`download failed: could not fetch ${$}@${V} from ${W} (${A(K)}). Check your network connection and that version ${V} exists.`))))?.dist;if(!B?.tarball)return yield*u(`registry response for ${$}@${V} has no tarball URL; cannot self-update`);let N=B.tarball,b=yield*J.fetchBytes(N).pipe(Q.mapError((K)=>new H(`download failed: could not download ${N} (${A(K)}). Check your network connection and try again.`)));yield*Q.try({try:()=>kj(b,B),catch:(K)=>K instanceof H?K:new H(A(K))});let X=yield*Q.try({try:()=>w(b),catch:()=>new H("downloaded tarball is corrupt (gunzip failed); try again")}),Z=Qj(X,"package/bin/qitqode")??Qj(X,"package/bin/qitqode.exe");if(!Z||Z.length===0)return yield*u(`tarball for ${$}@${V} does not contain the expected binary at bin/qitqode`);let O=Zj.join(R,`.qitqode-upgrade-${process.pid}`),Y=`${_}.backup-${process.pid}`,D=(K)=>{try{v.rmSync(K,{force:!0})}catch{}};yield*p(()=>v.writeFileSync(O,Z,{mode:493}),(K)=>{return D(O),`no write permission: could not write ${O} (${A(K)})`});let L=yield*J.runVersion(O).pipe(Q.mapError((K)=>{return D(O),new H(`downloaded binary failed its --version check (${A(K)}); keeping the current installation`)}));if(L.code!==0)return D(O),yield*u(`downloaded binary failed its --version check (exit ${L.code}); keeping the current installation`);let m=L.stdout.trim();if(m&&!m.includes(V))return D(O),yield*u(`downloaded binary reports version "${m}" instead of ${V}; keeping the current installation`);yield*p(()=>v.renameSync(_,Y),(K)=>{return D(O),`could not move the current binary aside (${A(K)}); check permissions on ${_}`}),yield*Q.try({try:()=>v.renameSync(O,_),catch:(K)=>{try{v.renameSync(Y,_)}catch{return new H(`failed to install the new binary AND failed to restore the old one; your previous binary is preserved at ${Y} \u2014 move it back to ${_} manually`)}return D(O),new H(`could not install the new binary (${A(K)}); the previous version was restored`)}}),D(Y)});var c=h.create({service:"installation"}),M="@qitqode/cli";function qj(J,V){if(!z.default.valid(J)||!z.default.valid(V))return!1;return z.default.gt(V,J)}var Cj={Updated:s.define("installation.updated",j.object({version:j.string()})),UpdateAvailable:s.define("installation.update-available",j.object({version:j.string()}))};function yj(J,V){if(!qj(J,V))throw Error(`Version ${V} is not newer than ${J}`);let _=z.default.major(J),$=z.default.minor(J),W=z.default.major(V),w=z.default.minor(V);if(W>_)return"major";if(w>$)return"minor";return"patch"}var Uj=j.object({version:j.string(),latest:j.string()}).meta({ref:"InstallationInfo"}),Sj=`qitqode/${y}/${a}/${I.QITQODE_CLIENT}`;function ij(){return y!=="latest"}function mj(){return y==="local"}class x extends C.TaggedErrorClass()("UpgradeFailedError",{stderr:C.String}){}var nj=C.Struct({version:C.String});class E extends Wj.Service()("@qitqode/Installation"){}var Bj=o.effect(E,Q.gen(function*(){let J=yield*k.HttpClient,V=k.filterStatusOk(_j(J)),_=yield*f.ChildProcessSpawner,$=(X,Z)=>Gj.make(X[0],X.slice(1),{cwd:Z?.cwd,env:Z?.env,extendEnv:!0}),W=Q.fnUntraced(function*(X){let Z=yield*Hj(_,X);return{code:Z.code,stdout:Z.text,stderr:Z.stderr}},Q.scoped),w=Q.fnUntraced(function*(X,Z){let O=yield*_.spawn($(X,Z)),Y=yield*l.mkString(l.decodeText(O.stdout));return yield*O.exitCode,Y},Q.scoped,Q.catch(()=>Q.succeed(""))),R=Q.fnUntraced(function*(X,Z){return yield*W($(X,Z))},Q.catch(()=>Q.succeed({code:f.ExitCode(1),stdout:"",stderr:""}))),G=Q.fn("Installation.method")(function*(){if(process.execPath.includes(Yj.join(".qitqode","bin")))return"curl";if(process.execPath.includes(Yj.join(".local","bin")))return"curl";let X=process.execPath.toLowerCase(),Z=[{name:"npm",command:()=>w(["npm","list","-g","--depth=0"])},{name:"pnpm",command:()=>w(["pnpm","list","-g","--depth=0"])},{name:"bun",command:()=>w(["bun","pm","ls","-g"])}];Z.sort((O,Y)=>{let D=X.includes(O.name),L=X.includes(Y.name);if(D&&!L)return-1;if(!D&&L)return 1;return 0});for(let O of Z)if((yield*O.command()).includes(M))return O.name;return"unknown"}),q=Q.fn("Installation.latest")(function*(X){let Z=X||(yield*G());if(Z==="curl"){let Y=(yield*w(["curl","-sI","https://github.com/qitqode/qitqode/releases/latest"])).match(/^location:.*\/tag\/v([0-9][^\s/]*)/im);if(Y)return Y[1];return yield*Q.die(Error("failed to resolve latest version from GitHub releases redirect"))}if(Z==="npm"||Z==="bun"||Z==="pnpm"){let Y=(yield*w(["npm","config","get","registry"])).trim()||"https://registry.npmjs.org",D=Y.endsWith("/")?Y.slice(0,-1):Y,L=yield*V.execute(P.get(`${D}/${encodeURIComponent(M)}/${y}`).pipe(P.acceptJson));return(yield*wj.schemaBodyJson(nj)(L)).version}return c.warn("unsupported update channel, skipping",{method:Z}),yield*Q.die(Error(`unsupported update channel: ${Z}`))},Q.orDie),B=Q.fnUntraced(function*(){let Z=(yield*w(["npm","config","get","registry"])).trim()||"https://registry.npmjs.org";return Z.endsWith("/")?Z.slice(0,-1):Z}),N=Q.fnUntraced(function*(X){let Z=yield*B();yield*Xj({target:X,execPath:process.env.QITQODE_SELF_UPDATE_TARGET_BINARY||process.execPath,packageName:$j(),registry:Z,fetchJson:(O)=>V.execute(P.get(O).pipe(P.acceptJson)).pipe(Q.flatMap((Y)=>Y.json)),fetchBytes:(O)=>V.execute(P.get(O)).pipe(Q.flatMap((Y)=>Y.arrayBuffer),Q.map((Y)=>new Uint8Array(Y))),runVersion:(O)=>R([O,"--version"]).pipe(Q.map((Y)=>({code:Y.code,stdout:Y.stdout})))}).pipe(Q.mapError((O)=>new x({stderr:O.message})))}),b=Q.fn("Installation.upgrade")(function*(X,Z){if(X==="curl"){yield*N(Z),c.info("upgraded",{method:X,target:Z});return}let Y=yield*(()=>{if(X==="npm")return R(["npm","install","-g",`${M}@${Z}`]);if(X==="pnpm")return R(["pnpm","install","-g",`${M}@${Z}`]);if(X==="bun")return R(["bun","install","-g",`${M}@${Z}`]);return new x({stderr:`Unknown method: ${X}`})})();if(Y.code!==0){let D=Y.stderr||"";return yield*new x({stderr:D})}c.info("upgraded",{method:X,target:Z,stdout:Y.stdout,stderr:Y.stderr}),yield*w([process.execPath,"--version"])});return E.of({info:Q.fn("Installation.info")(function*(){return{version:a,latest:yield*q()}}),method:G,latest:q,upgrade:b})})),uj=Bj.pipe(o.provide(Kj.layer),o.provide(Rj));var t=j.lazy(()=>j.union([j.string(),j.number(),j.boolean(),j.null(),j.array(t),j.record(j.string(),t)])),Dj=j.object({input:j.number(),output:j.number(),cache_read:j.number().optional(),cache_write:j.number().optional(),context_over_200k:j.object({input:j.number(),output:j.number(),cache_read:j.number().optional(),cache_write:j.number().optional()}).optional()}),r=j.object({id:j.string(),name:j.string(),family:j.string().optional(),release_date:j.string(),attachment:j.boolean(),reasoning:j.boolean(),temperature:j.boolean().optional(),tool_call:j.boolean(),interleaved:j.union([j.literal(!0),j.object({field:j.enum(["reasoning_content","reasoning_details"])}).strict()]).optional(),cost:Dj.optional(),limit:j.object({context:j.number(),input:j.number().optional(),output:j.number()}),modalities:j.object({input:j.array(j.enum(["text","audio","image","video","pdf"])),output:j.array(j.enum(["text","audio","image","video","pdf"]))}).optional(),experimental:j.object({modes:j.record(j.string(),j.object({cost:Dj.optional(),provider:j.object({body:j.record(j.string(),t).optional(),headers:j.record(j.string(),j.string()).optional()}).optional()})).optional()}).optional(),status:j.enum(["alpha","beta","deprecated"]).optional(),provider:j.object({npm:j.string().optional(),api:j.string().optional()}).optional()}),e=j.object({api:j.string().optional(),name:j.string(),env:j.array(j.string()),id:j.string(),npm:j.string().optional(),models:j.record(j.string(),r)});var Vj=h.create({service:"models.dev"}),bj=Fj(),F=hj.join(Nj.Path.cache,bj==="https://models.dev"?"models.json":`models-${Ij.fast(bj)}.json`),gj=300000,Aj=8388608,T,dj=j.record(j.string(),e),pj=r,cj=e;function Fj(){return I.QITQODE_MODELS_URL||"https://models.dev"}function lj(){return Date.now()-Number(i.stat(F)?.mtimeMs??0)<gj}function Lj(J){return!J&&lj()}function g(J){let V=dj.parse(typeof J==="string"?JSON.parse(J):J);for(let[_,$]of Object.entries(V))if($.id!==_)throw Error(`Invalid model provider: ${_}`);return V}async function zj(J){let V=await i.readJson(J).catch(()=>{return});if(!V)return;try{return g(V)}catch(_){Vj.warn("Ignoring invalid model catalog cache",{file:J,error:_});return}}async function Pj(J,V,_=Aj){let $=J.headers.get("content-type")?.split(";")[0]?.trim().toLowerCase();if($!=="application/json"&&!$?.endsWith("+json"))throw Error(`Invalid model catalog content type: ${$||"missing"}`);let W=Number(J.headers.get("content-length"));if(Number.isFinite(W)&&W>_)throw Error("Model catalog response is too large");if(!J.body)return"";let w=J.body.getReader(),R=()=>void w.cancel(V.reason);V.addEventListener("abort",R,{once:!0});let G=new Uint8Array(_),q=0;try{for(;;){let B=await w.read();if(B.done)break;if(q+=B.value.byteLength,q>_)throw await w.cancel(),Error("Model catalog response is too large");G.set(B.value,q-B.value.byteLength)}}finally{V.removeEventListener("abort",R)}return new TextDecoder().decode(G.subarray(0,q))}var Tj=async()=>{let J=AbortSignal.timeout(1e4),V=await fetch(`${Fj()}/api.json`,{headers:{"User-Agent":U.USER_AGENT},signal:J});if(!V.ok)return;let _=g(await Pj(V,J));return JSON.stringify(_)},S=vj(async()=>{let J=await zj(I.QITQODE_MODELS_PATH??F);if(J)return J;let V=await import("./chunk-a2qerqgd.js").then((_)=>g(_.snapshot)).catch(()=>{return});if(V)return V;if(I.QITQODE_DISABLE_MODELS_FETCH)return{};return Jj.withLock(`models-dev:${F}`,async()=>{let _=await zj(I.QITQODE_MODELS_PATH??F);if(_)return _;let $=await Tj();if($)return await i.write(F,$).catch((W)=>{Vj.error("Failed to write models cache",{error:W})}),g($);return{}})});async function fj(){return S()}async function jj(J=!1){if(Lj(J))return S.reset();await Jj.withLock(`models-dev:${F}`,async()=>{if(Lj(J))return S.reset();let V=await Tj();if(!V)return;await i.write(F,V),S.reset()}).catch((V)=>{Vj.error("Failed to fetch models.dev",{error:V})})}function sj(){if(T||I.QITQODE_DISABLE_MODELS_FETCH||process.argv.includes("--get-yargs-completions"))return;jj(),T=setInterval(async()=>{await jj()},3600000),T.unref()}function aj(){if(!T)return;clearInterval(T),T=void 0}
3
3
  export{_j as El,U as Fl,Aj as Gl,pj as Hl,cj as Il,Pj as Jl,S as Kl,fj as Ll,jj as Ml,sj as Nl,aj as Ol,tj as Pl};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{A as g,u as a,v as b,w as c,x as d,y as e,z as f}from"./chunk-r4mnbhe1.js";import"./chunk-q5363rr9.js";import"./chunk-7wthn44y.js";import"./chunk-a8p9aggx.js";import"./chunk-0xm85ayc.js";import"./chunk-19sa03c1.js";import"./chunk-6jewfaqa.js";import"./chunk-6hdjkvr1.js";import"./chunk-1rn0vmvv.js";import"./chunk-hn1f6rne.js";import"./chunk-94qmhz2p.js";import"./chunk-20d0cd1j.js";import"./chunk-yn576pje.js";import"./chunk-b6dsv601.js";import"./chunk-j2zay4da.js";import"./chunk-4vemws1t.js";import"./chunk-yvqbewmc.js";import"./chunk-t299e2aw.js";import"./chunk-yjj4cvqg.js";export{e as waitForDependencies,c as layer,f as get,d as defaultLayer,g as TuiConfig,b as Service,a as Info};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Fp as a0}from"./chunk-a1p2f16h.js";import{ns as f0,ps as l0}from"./chunk-njnwdgvd.js";import{nt as o0}from"./chunk-j6emx6jn.js";import{qt as T0}from"./chunk-12bssxd4.js";import{ku as C0,mu as s,ou as H0,pu as r,yt as P0}from"./chunk-zxaaxb99.js";import{Iu as n0,Ou as f,Su as S,zu as a}from"./chunk-whxjkz9a.js";import{Uu as p}from"./chunk-k309zez0.js";import{wA as u0}from"./chunk-phxrg7aw.js";import{CI as N0,HG as C,PI as J,UC as L,ZD as R0,mG as g,pO as w,wP as s0,xB as p0}from"./chunk-snm5q21k.js";import{$P as X0,bQ as i0,dQ as _2}from"./chunk-aztre27e.js";function h0(Z,Q){let z,$=()=>z??=u0.make(g.provideMerge(Q,f0.layer),{memoMap:l0});return{runSync:(X)=>$().runSync(Z.use(X)),runPromiseExit:(X,Y)=>$().runPromiseExit(Z.use(X),Y),runPromise:(X,Y)=>$().runPromise(Z.use(X),Y),runFork:(X)=>$().runFork(Z.use(X)),runCallback:(X)=>$().runCallback(Z.use(X))}}var Y0={};i0(Y0,{which:()=>w2,sanitize:()=>t0,outdated:()=>K2,layer:()=>e0,install:()=>N2,defaultLayer:()=>Z2,add:()=>F2,Service:()=>z0,Npm:()=>Y0,InstallFailedError:()=>V0});var r0=X0(o0(),1),b0=X0(a0(),1);import k from"path";import I0 from"path";import A2 from"os";import{randomUUID as D2}from"crypto";var B0;((Q0)=>{class Z extends w.TaggedErrorClass()("LockTimeoutError",{key:w.String}){}Q0.LockTimeoutError=Z;class Q extends w.TaggedErrorClass()("LockCompromisedError",{detail:w.String}){}Q0.LockCompromisedError=Q;class z extends w.TaggedErrorClass()("ReleaseError",{detail:w.String,cause:w.optional(w.Defect)}){get message(){return this.detail}}class $ extends w.TaggedErrorClass()("NotAcquired",{}){}let X=60000,Y=300000,U=100,G=2000,W=Math.max(100,Math.floor(X/3)),I=C.exponential(U,1.7).pipe(C.either(C.spaced(G)),C.jittered,C.while((j)=>j.elapsed<Y)),H=w.fromJsonString(w.Struct({token:w.String,pid:w.Number,hostname:w.String,createdAt:w.String})),q=w.decodeUnknownSync(H),R=w.encodeSync(H);class N extends R0.Service()("EffectFlock"){}Q0.Service=N;function A(){return performance.timeOrigin+performance.now()}let O=(j)=>L.getOrElse(j.mtime,()=>new Date(0)).getTime(),K=(j)=>j.reason._tag==="NotFound"||j.reason._tag==="Unknown";Q0.layer=g.effect(N,J.gen(function*(){let j=yield*s.Service,_=yield*f.Service,V=I0.join(j.state,"locks"),B=A2.hostname(),M=new Set,m=(D)=>_.stat(D).pipe(J.catchIf(K,()=>J.void),J.orDie),l=(D)=>_.remove(D,{recursive:!0}).pipe(J.ignore),d=(D)=>_.makeDirectory(D,{mode:448}).pipe(J.as(!0),J.catchIf((T)=>T.reason._tag==="AlreadyExists",()=>J.succeed(!1)),J.orDie),M0=(D,T,E,P)=>_.writeFileString(D,T,{flag:"wx"}).pipe(J.catch(()=>J.gen(function*(){return yield*l(E),yield*new Q({detail:P})}))),w0=J.fnUntraced(function*(D){let T=yield*m(D);if(T&&A()-O(T)>X)yield*l(D);return!1}),Z0=J.fnUntraced(function*(D){if(M.has(D))return;yield*_.makeDirectory(D,{recursive:!0}).pipe(J.orDie),M.add(D)}),F=J.fnUntraced(function*(D,T,E){let P=A(),h=yield*m(T);if(h)return P-O(h)>X;let $0=yield*m(E);if($0)return P-O($0)>X;let q0=yield*m(D);if(!q0)return!1;return P-O(q0)>X}),b=(D,T)=>J.gen(function*(){let E=D2(),P=I0.join(D,"meta.json"),h=I0.join(D,"heartbeat");if(!(yield*d(D))){if(!(yield*F(D,h,P)))return yield*new $;let O0=D+".breaker";if(!(yield*_.makeDirectory(O0,{mode:448}).pipe(J.as(!0),J.catchIf((V2)=>V2.reason._tag==="AlreadyExists",()=>w0(O0)),J.catchIf(K,()=>J.succeed(!1)),J.orDie)))return yield*new $;if(!(yield*J.gen(function*(){if(!(yield*F(D,h,P)))return!1;return yield*l(D),yield*d(D)}).pipe(J.ensuring(l(O0)))))return yield*new $}yield*M0(h,"",D,"heartbeat already existed");let q0=R({token:E,pid:process.pid,hostname:B,createdAt:new Date().toISOString()});return yield*M0(P,q0,D,"meta.json already existed"),{token:E,metaPath:P,heartbeatPath:h,lockDir:D}}).pipe(J.withSpan("EffectFlock.tryAcquire",{attributes:{key:T}})),U0=(D,T)=>b(D,T).pipe(J.retry({while:(E)=>E._tag==="NotAcquired",schedule:I}),J.catchTag("NotAcquired",()=>J.fail(new Z({key:T})))),i=(D)=>J.gen(function*(){let T=yield*_.readFileString(D.metaPath).pipe(J.catch((P)=>{if(K(P))return J.die(new z({detail:"metadata missing"}));return J.die(P)}));if((yield*J.try({try:()=>q(T),catch:(P)=>new z({detail:"metadata invalid",cause:P})}).pipe(J.orDie)).token!==D.token)return yield*J.die(new z({detail:"token mismatch"}));yield*l(D.lockDir)}),k0=J.fn("EffectFlock.acquire")(function*(D,T){let E=T??V;yield*Z0(E);let P=I0.join(E,C0.fast(D)+".lock"),h=yield*J.acquireRelease(U0(P,D),($0)=>i($0));yield*_.utimes(h.heartbeatPath,new Date,new Date).pipe(J.ignore,J.repeat(C.spaced(W)),J.forkScoped)}),B2=p0.dual((D)=>J.isEffect(D[0]),(D,T,E)=>J.scoped(J.gen(function*(){return yield*k0(T,E),yield*D})));return N.of({acquire:k0,withLock:B2})})),Q0.defaultLayer=Q0.layer.pipe(g.provide(f.defaultLayer),g.provide(s.layer))})(B0||={});class V0 extends w.TaggedErrorClass()("NpmInstallFailedError",{add:w.Array(w.String).pipe(w.optional),dir:w.String,cause:w.optional(w.Defect)}){}class z0 extends R0.Service()("@qitqode/Npm"){}var c0=process.platform==="win32"?new Set(["<",">",":",'"',"|","?","*"]):void 0;function t0(Z){if(!c0)return Z;return Array.from(Z,(Q)=>c0.has(Q)||Q.charCodeAt(0)<32?"_":Q).join("")}var d0=(Z,Q)=>{let z;try{let $=typeof Bun<"u"?import.meta.resolve(Z,Q):import.meta.resolve(Q);z=L.some($)}catch{z=L.none()}return{directory:Q,entrypoint:z}},e0=g.effect(z0,J.gen(function*(){let Z=yield*f.Service,Q=yield*s.Service,z=yield*s0.FileSystem,$=yield*B0.Service,X=(H)=>k.join(Q.cache,"packages",t0(H)),Y=(H)=>J.gen(function*(){yield*$.acquire(`npm-install:${H.dir}`);let{Arborist:q}=yield*J.promise(()=>import("./chunk-yp0a8q29.js").then((m)=>X0(m.default,1))),R=new q({path:H.dir,binLinks:!0,progress:!1,savePrefix:"",ignoreScripts:!0});return yield*J.tryPromise({try:()=>R.reify({add:H?.add||[],save:!0,saveType:"prod"}),catch:(N)=>new V0({cause:N,add:H?.add,dir:H.dir})})}).pipe(J.withSpan("Npm.reify",{attributes:H})),U=J.fn("Npm.outdated")(function*(H,q){let R=yield*J.tryPromise({try:()=>fetch(`https://registry.npmjs.org/${H}`),catch:()=>{return}}).pipe(J.orElseSucceed(()=>{return}));if(!R||!R.ok)return!1;let A=(yield*J.tryPromise({try:()=>R.json(),catch:()=>{return}}).pipe(J.orElseSucceed(()=>{return})))?.["dist-tags"]?.latest;if(!A)return!1;if(/[\s^~*xX<>|=]/.test(q))return!b0.default.satisfies(A,q);return b0.default.lt(q,A)}),G=J.fn("Npm.add")(function*(H){let q=X(H),R=(()=>{try{return r0.default(H).name??H}catch{return H}})();if(yield*Z.existsSafe(q))return d0(R,k.join(q,"node_modules",R));let A=(yield*Y({dir:q,add:[H]})).edgesOut.values().next().value?.to;if(!A)return yield*new V0({add:[H],dir:q});return d0(A.name,A.path)},J.scoped),W=J.fn("Npm.install")(function*(H,q){if(!(yield*Z.access(H,{writable:!0}).pipe(J.as(!0),J.orElseSucceed(()=>!1))))return;let N=q?.add.map((A)=>[A.name,A.version].filter(Boolean).join("@"))??[];if(yield*J.gen(function*(){if(!(yield*Z.existsSafe(k.join(H,"node_modules"))))return yield*Y({add:N,dir:H}),!0;return!1}).pipe(J.withSpan("Npm.checkNodeModules")))return;yield*J.gen(function*(){let A=yield*Z.readJson(k.join(H,"package.json")).pipe(J.orElseSucceed(()=>({}))),O=yield*Z.readJson(k.join(H,"package-lock.json")).pipe(J.orElseSucceed(()=>({}))),K=A,y=O,v=new Set([...Object.keys(K?.dependencies||{}),...Object.keys(K?.devDependencies||{}),...Object.keys(K?.peerDependencies||{}),...Object.keys(K?.optionalDependencies||{}),...(q?.add||[]).map((V)=>V.name)]),j=y?.packages?.[""]||{},_=new Set([...Object.keys(j?.dependencies||{}),...Object.keys(j?.devDependencies||{}),...Object.keys(j?.peerDependencies||{}),...Object.keys(j?.optionalDependencies||{})]);for(let V of v)if(!_.has(V)){yield*Y({dir:H,add:N});return}}).pipe(J.withSpan("Npm.checkDirty"));return},J.scoped),I=J.fn("Npm.which")(function*(H){let q=X(H),R=k.join(q,"node_modules",".bin"),N=J.fnUntraced(function*(){let A=yield*z.readDirectory(R).pipe(J.catch(()=>J.succeed([])));if(A.length===0)return L.none();if(A.length===1)return L.some(A[0]);let O=yield*Z.readJson(k.join(q,"node_modules",H,"package.json")).pipe(J.option);if(L.isSome(O)){let K=O.value;if(K?.bin){let y=H.startsWith("@")?H.split("/")[1]:H,v=K.bin;if(typeof v==="string")return L.some(y);let j=Object.keys(v);if(j.length===1)return L.some(j[0]);return v[y]?L.some(y):L.some(j[0])}}return L.some(A[0])});return yield*J.gen(function*(){let A=yield*N();if(L.isSome(A))return L.some(k.join(R,A.value));yield*z.remove(k.join(q,"package-lock.json")).pipe(J.orElseSucceed(()=>{})),yield*G(H);let O=yield*N();if(L.isNone(O))return L.none();return L.some(k.join(R,O.value))}).pipe(J.scoped,J.orElseSucceed(()=>L.none()))});return z0.of({add:G,install:W,outdated:U,which:I})})),Z2=e0.pipe(g.provide(B0.layer),g.provide(f.layer),g.provide(s.layer),g.provide(n0.layer)),{runPromise:A0}=h0(z0,Z2);async function N2(...Z){return A0((Q)=>Q.install(...Z))}async function F2(...Z){let Q=await A0((z)=>z.add(...Z));return{directory:Q.directory,entrypoint:L.getOrUndefined(Q.entrypoint)}}async function K2(...Z){return A0((Q)=>Q.outdated(...Z))}async function w2(...Z){let Q=await A0((z)=>z.which(...Z));return L.getOrUndefined(Q)}var Q2=X0(o0(),1),D0=X0(a0(),1);import u from"path";import{fileURLToPath as _0,pathToFileURL as n}from"url";var O2=["opencode-openai-codex-auth","opencode-copilot-auth"];function _Z(Z){return O2.some((Q)=>Z.includes(Q))}function z2(Z){try{return Q2.default(Z)}catch{}}function NZ(Z){let Q=z2(Z);if(Q?.type==="alias"&&!Q.name){let z=Q.subSpec;if(z?.name){let $=!z.rawSpec||z.rawSpec==="*"?"latest":z.rawSpec;return{pkg:z.name,version:$}}}if(!Q?.name)return{pkg:Z,version:""};if(Q.raw===Q.name)return{pkg:Q.name,version:"latest"};return{pkg:Q.name,version:Q.rawSpec}}var b2=["index.ts","index.tsx","index.js","index.mjs","index.cjs"];function X2(Z){if(J2(Z))return"file";return"npm"}function L2(Z,Q){if(Z.startsWith("file://"))return _0(Z);if(u.isAbsolute(Z))return Z;return u.resolve(Q,Z)}function Y2(Z){return u.isAbsolute(Z)||/^[A-Za-z]:[\\/]/.test(Z)}function T2(Z){if(typeof Z==="string")return Z;if(!a(Z))return;for(let Q of["import","default"]){let z=Z[Q];if(typeof z==="string")return z}return}function y2(Z){let Q=Z.json.main;if(typeof Q!=="string")return;let z=Q.trim();if(!z)return;return z}function H2(Z,Q,z,$){let X=L2(Q,$.dir),Y=S.resolve($.dir),U=S.resolve(X);if(!S.contains(Y,U))throw Error(`Plugin ${Z} resolved ${z} entry outside plugin directory`);return U}function $2(Z,Q,z,$){return n(H2(Z,Q,z,$)).href}function P2(Z,Q,z){let $=z.json.exports;if(a($)){let Y=T2($[`./${Q}`]);if(Y)return $2(Z,Y,Q,z)}if(Q!=="server")return;let X=y2(z);if(!X)return;return $2(Z,X,Q,z)}function S2(Z){if(Z.startsWith("file://"))return _0(Z);if(u.isAbsolute(Z))return Z}async function L0(Z){for(let Q of b2){let z=u.join(Z,Q);if(await S.exists(z))return z}}async function m2(Z){let Q=S2(Z);if(!Q)return;if(!(await S.statAsync(Q))?.isDirectory())return;return Q}async function E2(Z,Q,z,$){let X=X2(Z),Y=$??(X==="npm"?await o(Q):await o(Q).catch(()=>{return}));if(!Y)return Q;let U=P2(Z,z,Y);if(U)return U;let G=await m2(Q);if(z==="tui"){if(X==="file"&&G){let W=await L0(G);if(W)return n(W).href}if(X==="npm")return;if(G)return;return Q}if(G&&a(Y.json.exports)){if(X==="file"){let W=await L0(G);if(W)return n(W).href}return}return Q}function J2(Z){return Z.startsWith("file://")||Z.startsWith(".")||Y2(Z)}async function v2(Z){let Q=Z.startsWith("file://")?_0(Z):Z,z=u.isAbsolute(Q)||/^[A-Za-z]:[\\/]/.test(Q)?Q:u.resolve(Q);if(!(await S.statAsync(z))?.isDirectory()){if(Z.startsWith("file://"))return Z;return n(z).href}if(await S.exists(u.join(z,"package.json")))return n(z).href;let X=await L0(z);if(X)return n(X).href;throw Error(`Plugin directory ${z} is missing package.json or index file`)}async function FZ(Z,Q,z){if(!D0.default.valid(Q)||D0.default.major(Q)===0)return;let $=z??await o(Z).catch(()=>{return});if(!$)return;let X=$.json.engines;if(!a(X))return;let Y=X.qitqode??X.opencode;if(typeof Y!=="string")return;if(!D0.default.satisfies(Q,Y))throw Error(`Plugin requires qitqode ${Y} but running ${Q}`)}async function KZ(Z){if(J2(Z))return v2(Z);let Q=z2(Z),z=Q?.name&&Q.raw===Q.name?`${Q.name}@latest`:Z;return(await Y0.add(z)).directory}async function o(Z){let Q=Z.startsWith("file://")?_0(Z):Z,$=(await S.statAsync(Q))?.isDirectory()?Q:u.dirname(Q),X=u.join($,"package.json"),Y=await S.readJson(X);return{dir:$,pkg:X,json:Y}}async function wZ(Z,Q,z){let $=X2(Z),X=$==="npm"?await o(Q):await o(Q).catch(()=>{return}),Y=await E2(Z,Q,z,X);return{spec:Z,source:$,target:Q,pkg:X,entry:Y}}function OZ(Z,Q){let z=Q.json["oc-themes"];if(z===void 0)return[];if(!Array.isArray(z))throw TypeError(`Plugin ${Z} has invalid oc-themes field`);let $=z.map((X)=>{if(typeof X!=="string")throw TypeError(`Plugin ${Z} has invalid oc-themes entry`);let Y=X.trim();if(!Y)throw TypeError(`Plugin ${Z} has empty oc-themes entry`);if(Y.startsWith("file://")||Y2(Y))throw TypeError(`Plugin ${Z} oc-themes entry must be relative: ${X}`);return H2(Z,Y,"oc-themes",Q)});return Array.from(new Set($))}function bZ(Z,Q){if(Z===void 0)return;if(typeof Z!=="string")throw TypeError(`Plugin ${Q} has invalid id type ${typeof Z}`);let z=Z.trim();if(!z)throw TypeError(`Plugin ${Q} has an empty id`);return z}function LZ(Z,Q,z,$="strict"){let X=Z.default;if(!a(X)){if($==="detect")return;throw TypeError(`Plugin ${Q} must default export an object with ${z}()`)}if($==="detect"&&!("id"in X)&&!("server"in X)&&!("tui"in X))return;let Y="server"in X?X.server:void 0,U="tui"in X?X.tui:void 0;if(Y!==void 0&&typeof Y!=="function")throw TypeError(`Plugin ${Q} has invalid server export`);if(U!==void 0&&typeof U!=="function")throw TypeError(`Plugin ${Q} has invalid tui export`);if(Y!==void 0&&U!==void 0)throw TypeError(`Plugin ${Q} must default export either server() or tui(), not both`);if(z==="server"&&Y===void 0)throw TypeError(`Plugin ${Q} must default export an object with server()`);if(z==="tui"&&U===void 0)throw TypeError(`Plugin ${Q} must default export an object with tui()`);return X}async function TZ(Z,Q,z,$,X){if(Z==="file"){if($)return $;throw TypeError(`Path plugin ${Q} must export id`)}if($)return $;let Y=X??await o(z);if(typeof Y.json.name!=="string"||!Y.json.name.trim())throw TypeError(`Plugin package ${Y.pkg} is missing name`);return Y.json.name.trim()}var S0={};i0(S0,{readFile:()=>l2,files:()=>g2,fileInDirectory:()=>f2,directories:()=>k2,claudeCommandDirectories:()=>u2,ConfigPaths:()=>S0});import y0 from"path";var W2=T0.create("ConfigJsonError",p.object({path:p.string(),message:p.string().optional()})),mZ=T0.create("ConfigInvalidError",p.object({path:p.string(),issues:p.custom().optional(),message:p.string().optional()}));var g2=N0("ConfigPaths.projectFiles")(function*(Z,Q,z){return(yield*(yield*f.Service).up({targets:[`${Z}.jsonc`,`${Z}.json`],start:Q,stop:z})).toReversed()}),k2=N0("ConfigPaths.directories")(function*(Z,Q){let z=yield*f.Service;return P0([H0.Path.config,...!r.QITQODE_DISABLE_PROJECT_CONFIG?yield*z.up({targets:[".qitqode"],start:Z,stop:Q}):[],...yield*z.up({targets:[".qitqode"],start:H0.Path.home,stop:H0.Path.home}),...r.QITQODE_CONFIG_DIR?[r.QITQODE_CONFIG_DIR]:[]])}),u2=N0("ConfigPaths.claudeCommandDirectories")(function*(Z,Q){if(r.QITQODE_DISABLE_CLAUDE_CODE_COMMANDS)return[];let z=yield*f.Service;return P0([y0.join(H0.Path.home,".claude"),...!r.QITQODE_DISABLE_PROJECT_CONFIG?yield*z.up({targets:[".claude"],start:Z,stop:Q}):[]])});function f2(Z,Q){return[y0.join(Z,`${Q}.json`),y0.join(Z,`${Q}.jsonc`)]}async function l2(Z){return S.readText(Z).catch((Q)=>{if(Q.code==="ENOENT")return;throw new W2({path:Z},{cause:Q})})}function W0(Z,Q=!1){let z=Z.length,$=0,X="",Y=0,U=16,G=0,W=0,I=0,H=0,q=0;function R(j,_){let V=0,B=0;while(V<j||!_){let M=Z.charCodeAt($);if(M>=48&&M<=57)B=B*16+M-48;else if(M>=65&&M<=70)B=B*16+M-65+10;else if(M>=97&&M<=102)B=B*16+M-97+10;else break;$++,V++}if(V<j)B=-1;return B}function N(j){$=j,X="",Y=0,U=16,q=0}function A(){let j=$;if(Z.charCodeAt($)===48)$++;else{$++;while($<Z.length&&t(Z.charCodeAt($)))$++}if($<Z.length&&Z.charCodeAt($)===46)if($++,$<Z.length&&t(Z.charCodeAt($))){$++;while($<Z.length&&t(Z.charCodeAt($)))$++}else return q=3,Z.substring(j,$);let _=$;if($<Z.length&&(Z.charCodeAt($)===69||Z.charCodeAt($)===101)){if($++,$<Z.length&&Z.charCodeAt($)===43||Z.charCodeAt($)===45)$++;if($<Z.length&&t(Z.charCodeAt($))){$++;while($<Z.length&&t(Z.charCodeAt($)))$++;_=$}else q=3}return Z.substring(j,_)}function O(){let j="",_=$;while(!0){if($>=z){j+=Z.substring(_,$),q=2;break}let V=Z.charCodeAt($);if(V===34){j+=Z.substring(_,$),$++;break}if(V===92){if(j+=Z.substring(_,$),$++,$>=z){q=2;break}switch(Z.charCodeAt($++)){case 34:j+='"';break;case 92:j+="\\";break;case 47:j+="/";break;case 98:j+="\b";break;case 102:j+="\f";break;case 110:j+=`
2
+ import{go as a0}from"./chunk-a8p9aggx.js";import{Qq as f0,Sq as l0}from"./chunk-6jewfaqa.js";import{Qr as o0}from"./chunk-1rn0vmvv.js";import{Tr as T0}from"./chunk-hn1f6rne.js";import{$r as P0,Ns as C0,Ps as s,Rs as H0,Ss as r}from"./chunk-94qmhz2p.js";import{at as a,jt as n0,pt as f,tt as S}from"./chunk-20d0cd1j.js";import{vt as p}from"./chunk-b6dsv601.js";import{Zy as u0}from"./chunk-yvqbewmc.js";import{AC as R0,PE as g,SM as w,ZN as s0,_z as p0,dH as N0,iF as C,qH as J,vB as L}from"./chunk-t299e2aw.js";import{CO as X0,EO as i0,GO as _2}from"./chunk-yjj4cvqg.js";function h0(Z,Q){let z,$=()=>z??=u0.make(g.provideMerge(Q,f0.layer),{memoMap:l0});return{runSync:(X)=>$().runSync(Z.use(X)),runPromiseExit:(X,Y)=>$().runPromiseExit(Z.use(X),Y),runPromise:(X,Y)=>$().runPromise(Z.use(X),Y),runFork:(X)=>$().runFork(Z.use(X)),runCallback:(X)=>$().runCallback(Z.use(X))}}var Y0={};i0(Y0,{which:()=>w2,sanitize:()=>t0,outdated:()=>K2,layer:()=>e0,install:()=>N2,defaultLayer:()=>Z2,add:()=>F2,Service:()=>z0,Npm:()=>Y0,InstallFailedError:()=>V0});var r0=X0(o0(),1),b0=X0(a0(),1);import k from"path";import I0 from"path";import A2 from"os";import{randomUUID as D2}from"crypto";var B0;((Q0)=>{class Z extends w.TaggedErrorClass()("LockTimeoutError",{key:w.String}){}Q0.LockTimeoutError=Z;class Q extends w.TaggedErrorClass()("LockCompromisedError",{detail:w.String}){}Q0.LockCompromisedError=Q;class z extends w.TaggedErrorClass()("ReleaseError",{detail:w.String,cause:w.optional(w.Defect)}){get message(){return this.detail}}class $ extends w.TaggedErrorClass()("NotAcquired",{}){}let X=60000,Y=300000,U=100,G=2000,W=Math.max(100,Math.floor(X/3)),I=C.exponential(U,1.7).pipe(C.either(C.spaced(G)),C.jittered,C.while((j)=>j.elapsed<Y)),H=w.fromJsonString(w.Struct({token:w.String,pid:w.Number,hostname:w.String,createdAt:w.String})),q=w.decodeUnknownSync(H),R=w.encodeSync(H);class N extends R0.Service()("EffectFlock"){}Q0.Service=N;function A(){return performance.timeOrigin+performance.now()}let O=(j)=>L.getOrElse(j.mtime,()=>new Date(0)).getTime(),K=(j)=>j.reason._tag==="NotFound"||j.reason._tag==="Unknown";Q0.layer=g.effect(N,J.gen(function*(){let j=yield*s.Service,_=yield*f.Service,V=I0.join(j.state,"locks"),B=A2.hostname(),M=new Set,m=(D)=>_.stat(D).pipe(J.catchIf(K,()=>J.void),J.orDie),l=(D)=>_.remove(D,{recursive:!0}).pipe(J.ignore),d=(D)=>_.makeDirectory(D,{mode:448}).pipe(J.as(!0),J.catchIf((T)=>T.reason._tag==="AlreadyExists",()=>J.succeed(!1)),J.orDie),M0=(D,T,E,P)=>_.writeFileString(D,T,{flag:"wx"}).pipe(J.catch(()=>J.gen(function*(){return yield*l(E),yield*new Q({detail:P})}))),w0=J.fnUntraced(function*(D){let T=yield*m(D);if(T&&A()-O(T)>X)yield*l(D);return!1}),Z0=J.fnUntraced(function*(D){if(M.has(D))return;yield*_.makeDirectory(D,{recursive:!0}).pipe(J.orDie),M.add(D)}),F=J.fnUntraced(function*(D,T,E){let P=A(),h=yield*m(T);if(h)return P-O(h)>X;let $0=yield*m(E);if($0)return P-O($0)>X;let q0=yield*m(D);if(!q0)return!1;return P-O(q0)>X}),b=(D,T)=>J.gen(function*(){let E=D2(),P=I0.join(D,"meta.json"),h=I0.join(D,"heartbeat");if(!(yield*d(D))){if(!(yield*F(D,h,P)))return yield*new $;let O0=D+".breaker";if(!(yield*_.makeDirectory(O0,{mode:448}).pipe(J.as(!0),J.catchIf((V2)=>V2.reason._tag==="AlreadyExists",()=>w0(O0)),J.catchIf(K,()=>J.succeed(!1)),J.orDie)))return yield*new $;if(!(yield*J.gen(function*(){if(!(yield*F(D,h,P)))return!1;return yield*l(D),yield*d(D)}).pipe(J.ensuring(l(O0)))))return yield*new $}yield*M0(h,"",D,"heartbeat already existed");let q0=R({token:E,pid:process.pid,hostname:B,createdAt:new Date().toISOString()});return yield*M0(P,q0,D,"meta.json already existed"),{token:E,metaPath:P,heartbeatPath:h,lockDir:D}}).pipe(J.withSpan("EffectFlock.tryAcquire",{attributes:{key:T}})),U0=(D,T)=>b(D,T).pipe(J.retry({while:(E)=>E._tag==="NotAcquired",schedule:I}),J.catchTag("NotAcquired",()=>J.fail(new Z({key:T})))),i=(D)=>J.gen(function*(){let T=yield*_.readFileString(D.metaPath).pipe(J.catch((P)=>{if(K(P))return J.die(new z({detail:"metadata missing"}));return J.die(P)}));if((yield*J.try({try:()=>q(T),catch:(P)=>new z({detail:"metadata invalid",cause:P})}).pipe(J.orDie)).token!==D.token)return yield*J.die(new z({detail:"token mismatch"}));yield*l(D.lockDir)}),k0=J.fn("EffectFlock.acquire")(function*(D,T){let E=T??V;yield*Z0(E);let P=I0.join(E,C0.fast(D)+".lock"),h=yield*J.acquireRelease(U0(P,D),($0)=>i($0));yield*_.utimes(h.heartbeatPath,new Date,new Date).pipe(J.ignore,J.repeat(C.spaced(W)),J.forkScoped)}),B2=p0.dual((D)=>J.isEffect(D[0]),(D,T,E)=>J.scoped(J.gen(function*(){return yield*k0(T,E),yield*D})));return N.of({acquire:k0,withLock:B2})})),Q0.defaultLayer=Q0.layer.pipe(g.provide(f.defaultLayer),g.provide(s.layer))})(B0||={});class V0 extends w.TaggedErrorClass()("NpmInstallFailedError",{add:w.Array(w.String).pipe(w.optional),dir:w.String,cause:w.optional(w.Defect)}){}class z0 extends R0.Service()("@qitqode/Npm"){}var c0=process.platform==="win32"?new Set(["<",">",":",'"',"|","?","*"]):void 0;function t0(Z){if(!c0)return Z;return Array.from(Z,(Q)=>c0.has(Q)||Q.charCodeAt(0)<32?"_":Q).join("")}var d0=(Z,Q)=>{let z;try{let $=typeof Bun<"u"?import.meta.resolve(Z,Q):import.meta.resolve(Q);z=L.some($)}catch{z=L.none()}return{directory:Q,entrypoint:z}},e0=g.effect(z0,J.gen(function*(){let Z=yield*f.Service,Q=yield*s.Service,z=yield*s0.FileSystem,$=yield*B0.Service,X=(H)=>k.join(Q.cache,"packages",t0(H)),Y=(H)=>J.gen(function*(){yield*$.acquire(`npm-install:${H.dir}`);let{Arborist:q}=yield*J.promise(()=>import("./chunk-4fspp5fg.js").then((m)=>X0(m.default,1))),R=new q({path:H.dir,binLinks:!0,progress:!1,savePrefix:"",ignoreScripts:!0});return yield*J.tryPromise({try:()=>R.reify({add:H?.add||[],save:!0,saveType:"prod"}),catch:(N)=>new V0({cause:N,add:H?.add,dir:H.dir})})}).pipe(J.withSpan("Npm.reify",{attributes:H})),U=J.fn("Npm.outdated")(function*(H,q){let R=yield*J.tryPromise({try:()=>fetch(`https://registry.npmjs.org/${H}`),catch:()=>{return}}).pipe(J.orElseSucceed(()=>{return}));if(!R||!R.ok)return!1;let A=(yield*J.tryPromise({try:()=>R.json(),catch:()=>{return}}).pipe(J.orElseSucceed(()=>{return})))?.["dist-tags"]?.latest;if(!A)return!1;if(/[\s^~*xX<>|=]/.test(q))return!b0.default.satisfies(A,q);return b0.default.lt(q,A)}),G=J.fn("Npm.add")(function*(H){let q=X(H),R=(()=>{try{return r0.default(H).name??H}catch{return H}})();if(yield*Z.existsSafe(q))return d0(R,k.join(q,"node_modules",R));let A=(yield*Y({dir:q,add:[H]})).edgesOut.values().next().value?.to;if(!A)return yield*new V0({add:[H],dir:q});return d0(A.name,A.path)},J.scoped),W=J.fn("Npm.install")(function*(H,q){if(!(yield*Z.access(H,{writable:!0}).pipe(J.as(!0),J.orElseSucceed(()=>!1))))return;let N=q?.add.map((A)=>[A.name,A.version].filter(Boolean).join("@"))??[];if(yield*J.gen(function*(){if(!(yield*Z.existsSafe(k.join(H,"node_modules"))))return yield*Y({add:N,dir:H}),!0;return!1}).pipe(J.withSpan("Npm.checkNodeModules")))return;yield*J.gen(function*(){let A=yield*Z.readJson(k.join(H,"package.json")).pipe(J.orElseSucceed(()=>({}))),O=yield*Z.readJson(k.join(H,"package-lock.json")).pipe(J.orElseSucceed(()=>({}))),K=A,y=O,v=new Set([...Object.keys(K?.dependencies||{}),...Object.keys(K?.devDependencies||{}),...Object.keys(K?.peerDependencies||{}),...Object.keys(K?.optionalDependencies||{}),...(q?.add||[]).map((V)=>V.name)]),j=y?.packages?.[""]||{},_=new Set([...Object.keys(j?.dependencies||{}),...Object.keys(j?.devDependencies||{}),...Object.keys(j?.peerDependencies||{}),...Object.keys(j?.optionalDependencies||{})]);for(let V of v)if(!_.has(V)){yield*Y({dir:H,add:N});return}}).pipe(J.withSpan("Npm.checkDirty"));return},J.scoped),I=J.fn("Npm.which")(function*(H){let q=X(H),R=k.join(q,"node_modules",".bin"),N=J.fnUntraced(function*(){let A=yield*z.readDirectory(R).pipe(J.catch(()=>J.succeed([])));if(A.length===0)return L.none();if(A.length===1)return L.some(A[0]);let O=yield*Z.readJson(k.join(q,"node_modules",H,"package.json")).pipe(J.option);if(L.isSome(O)){let K=O.value;if(K?.bin){let y=H.startsWith("@")?H.split("/")[1]:H,v=K.bin;if(typeof v==="string")return L.some(y);let j=Object.keys(v);if(j.length===1)return L.some(j[0]);return v[y]?L.some(y):L.some(j[0])}}return L.some(A[0])});return yield*J.gen(function*(){let A=yield*N();if(L.isSome(A))return L.some(k.join(R,A.value));yield*z.remove(k.join(q,"package-lock.json")).pipe(J.orElseSucceed(()=>{})),yield*G(H);let O=yield*N();if(L.isNone(O))return L.none();return L.some(k.join(R,O.value))}).pipe(J.scoped,J.orElseSucceed(()=>L.none()))});return z0.of({add:G,install:W,outdated:U,which:I})})),Z2=e0.pipe(g.provide(B0.layer),g.provide(f.layer),g.provide(s.layer),g.provide(n0.layer)),{runPromise:A0}=h0(z0,Z2);async function N2(...Z){return A0((Q)=>Q.install(...Z))}async function F2(...Z){let Q=await A0((z)=>z.add(...Z));return{directory:Q.directory,entrypoint:L.getOrUndefined(Q.entrypoint)}}async function K2(...Z){return A0((Q)=>Q.outdated(...Z))}async function w2(...Z){let Q=await A0((z)=>z.which(...Z));return L.getOrUndefined(Q)}var Q2=X0(o0(),1),D0=X0(a0(),1);import u from"path";import{fileURLToPath as _0,pathToFileURL as n}from"url";var O2=["opencode-openai-codex-auth","opencode-copilot-auth"];function _Z(Z){return O2.some((Q)=>Z.includes(Q))}function z2(Z){try{return Q2.default(Z)}catch{}}function NZ(Z){let Q=z2(Z);if(Q?.type==="alias"&&!Q.name){let z=Q.subSpec;if(z?.name){let $=!z.rawSpec||z.rawSpec==="*"?"latest":z.rawSpec;return{pkg:z.name,version:$}}}if(!Q?.name)return{pkg:Z,version:""};if(Q.raw===Q.name)return{pkg:Q.name,version:"latest"};return{pkg:Q.name,version:Q.rawSpec}}var b2=["index.ts","index.tsx","index.js","index.mjs","index.cjs"];function X2(Z){if(J2(Z))return"file";return"npm"}function L2(Z,Q){if(Z.startsWith("file://"))return _0(Z);if(u.isAbsolute(Z))return Z;return u.resolve(Q,Z)}function Y2(Z){return u.isAbsolute(Z)||/^[A-Za-z]:[\\/]/.test(Z)}function T2(Z){if(typeof Z==="string")return Z;if(!a(Z))return;for(let Q of["import","default"]){let z=Z[Q];if(typeof z==="string")return z}return}function y2(Z){let Q=Z.json.main;if(typeof Q!=="string")return;let z=Q.trim();if(!z)return;return z}function H2(Z,Q,z,$){let X=L2(Q,$.dir),Y=S.resolve($.dir),U=S.resolve(X);if(!S.contains(Y,U))throw Error(`Plugin ${Z} resolved ${z} entry outside plugin directory`);return U}function $2(Z,Q,z,$){return n(H2(Z,Q,z,$)).href}function P2(Z,Q,z){let $=z.json.exports;if(a($)){let Y=T2($[`./${Q}`]);if(Y)return $2(Z,Y,Q,z)}if(Q!=="server")return;let X=y2(z);if(!X)return;return $2(Z,X,Q,z)}function S2(Z){if(Z.startsWith("file://"))return _0(Z);if(u.isAbsolute(Z))return Z}async function L0(Z){for(let Q of b2){let z=u.join(Z,Q);if(await S.exists(z))return z}}async function m2(Z){let Q=S2(Z);if(!Q)return;if(!(await S.statAsync(Q))?.isDirectory())return;return Q}async function E2(Z,Q,z,$){let X=X2(Z),Y=$??(X==="npm"?await o(Q):await o(Q).catch(()=>{return}));if(!Y)return Q;let U=P2(Z,z,Y);if(U)return U;let G=await m2(Q);if(z==="tui"){if(X==="file"&&G){let W=await L0(G);if(W)return n(W).href}if(X==="npm")return;if(G)return;return Q}if(G&&a(Y.json.exports)){if(X==="file"){let W=await L0(G);if(W)return n(W).href}return}return Q}function J2(Z){return Z.startsWith("file://")||Z.startsWith(".")||Y2(Z)}async function v2(Z){let Q=Z.startsWith("file://")?_0(Z):Z,z=u.isAbsolute(Q)||/^[A-Za-z]:[\\/]/.test(Q)?Q:u.resolve(Q);if(!(await S.statAsync(z))?.isDirectory()){if(Z.startsWith("file://"))return Z;return n(z).href}if(await S.exists(u.join(z,"package.json")))return n(z).href;let X=await L0(z);if(X)return n(X).href;throw Error(`Plugin directory ${z} is missing package.json or index file`)}async function FZ(Z,Q,z){if(!D0.default.valid(Q)||D0.default.major(Q)===0)return;let $=z??await o(Z).catch(()=>{return});if(!$)return;let X=$.json.engines;if(!a(X))return;let Y=X.qitqode??X.opencode;if(typeof Y!=="string")return;if(!D0.default.satisfies(Q,Y))throw Error(`Plugin requires qitqode ${Y} but running ${Q}`)}async function KZ(Z){if(J2(Z))return v2(Z);let Q=z2(Z),z=Q?.name&&Q.raw===Q.name?`${Q.name}@latest`:Z;return(await Y0.add(z)).directory}async function o(Z){let Q=Z.startsWith("file://")?_0(Z):Z,$=(await S.statAsync(Q))?.isDirectory()?Q:u.dirname(Q),X=u.join($,"package.json"),Y=await S.readJson(X);return{dir:$,pkg:X,json:Y}}async function wZ(Z,Q,z){let $=X2(Z),X=$==="npm"?await o(Q):await o(Q).catch(()=>{return}),Y=await E2(Z,Q,z,X);return{spec:Z,source:$,target:Q,pkg:X,entry:Y}}function OZ(Z,Q){let z=Q.json["oc-themes"];if(z===void 0)return[];if(!Array.isArray(z))throw TypeError(`Plugin ${Z} has invalid oc-themes field`);let $=z.map((X)=>{if(typeof X!=="string")throw TypeError(`Plugin ${Z} has invalid oc-themes entry`);let Y=X.trim();if(!Y)throw TypeError(`Plugin ${Z} has empty oc-themes entry`);if(Y.startsWith("file://")||Y2(Y))throw TypeError(`Plugin ${Z} oc-themes entry must be relative: ${X}`);return H2(Z,Y,"oc-themes",Q)});return Array.from(new Set($))}function bZ(Z,Q){if(Z===void 0)return;if(typeof Z!=="string")throw TypeError(`Plugin ${Q} has invalid id type ${typeof Z}`);let z=Z.trim();if(!z)throw TypeError(`Plugin ${Q} has an empty id`);return z}function LZ(Z,Q,z,$="strict"){let X=Z.default;if(!a(X)){if($==="detect")return;throw TypeError(`Plugin ${Q} must default export an object with ${z}()`)}if($==="detect"&&!("id"in X)&&!("server"in X)&&!("tui"in X))return;let Y="server"in X?X.server:void 0,U="tui"in X?X.tui:void 0;if(Y!==void 0&&typeof Y!=="function")throw TypeError(`Plugin ${Q} has invalid server export`);if(U!==void 0&&typeof U!=="function")throw TypeError(`Plugin ${Q} has invalid tui export`);if(Y!==void 0&&U!==void 0)throw TypeError(`Plugin ${Q} must default export either server() or tui(), not both`);if(z==="server"&&Y===void 0)throw TypeError(`Plugin ${Q} must default export an object with server()`);if(z==="tui"&&U===void 0)throw TypeError(`Plugin ${Q} must default export an object with tui()`);return X}async function TZ(Z,Q,z,$,X){if(Z==="file"){if($)return $;throw TypeError(`Path plugin ${Q} must export id`)}if($)return $;let Y=X??await o(z);if(typeof Y.json.name!=="string"||!Y.json.name.trim())throw TypeError(`Plugin package ${Y.pkg} is missing name`);return Y.json.name.trim()}var S0={};i0(S0,{readFile:()=>l2,files:()=>g2,fileInDirectory:()=>f2,directories:()=>k2,claudeCommandDirectories:()=>u2,ConfigPaths:()=>S0});import y0 from"path";var W2=T0.create("ConfigJsonError",p.object({path:p.string(),message:p.string().optional()})),mZ=T0.create("ConfigInvalidError",p.object({path:p.string(),issues:p.custom().optional(),message:p.string().optional()}));var g2=N0("ConfigPaths.projectFiles")(function*(Z,Q,z){return(yield*(yield*f.Service).up({targets:[`${Z}.jsonc`,`${Z}.json`],start:Q,stop:z})).toReversed()}),k2=N0("ConfigPaths.directories")(function*(Z,Q){let z=yield*f.Service;return P0([H0.Path.config,...!r.QITQODE_DISABLE_PROJECT_CONFIG?yield*z.up({targets:[".qitqode"],start:Z,stop:Q}):[],...yield*z.up({targets:[".qitqode"],start:H0.Path.home,stop:H0.Path.home}),...r.QITQODE_CONFIG_DIR?[r.QITQODE_CONFIG_DIR]:[]])}),u2=N0("ConfigPaths.claudeCommandDirectories")(function*(Z,Q){if(r.QITQODE_DISABLE_CLAUDE_CODE_COMMANDS)return[];let z=yield*f.Service;return P0([y0.join(H0.Path.home,".claude"),...!r.QITQODE_DISABLE_PROJECT_CONFIG?yield*z.up({targets:[".claude"],start:Z,stop:Q}):[]])});function f2(Z,Q){return[y0.join(Z,`${Q}.json`),y0.join(Z,`${Q}.jsonc`)]}async function l2(Z){return S.readText(Z).catch((Q)=>{if(Q.code==="ENOENT")return;throw new W2({path:Z},{cause:Q})})}function W0(Z,Q=!1){let z=Z.length,$=0,X="",Y=0,U=16,G=0,W=0,I=0,H=0,q=0;function R(j,_){let V=0,B=0;while(V<j||!_){let M=Z.charCodeAt($);if(M>=48&&M<=57)B=B*16+M-48;else if(M>=65&&M<=70)B=B*16+M-65+10;else if(M>=97&&M<=102)B=B*16+M-97+10;else break;$++,V++}if(V<j)B=-1;return B}function N(j){$=j,X="",Y=0,U=16,q=0}function A(){let j=$;if(Z.charCodeAt($)===48)$++;else{$++;while($<Z.length&&t(Z.charCodeAt($)))$++}if($<Z.length&&Z.charCodeAt($)===46)if($++,$<Z.length&&t(Z.charCodeAt($))){$++;while($<Z.length&&t(Z.charCodeAt($)))$++}else return q=3,Z.substring(j,$);let _=$;if($<Z.length&&(Z.charCodeAt($)===69||Z.charCodeAt($)===101)){if($++,$<Z.length&&Z.charCodeAt($)===43||Z.charCodeAt($)===45)$++;if($<Z.length&&t(Z.charCodeAt($))){$++;while($<Z.length&&t(Z.charCodeAt($)))$++;_=$}else q=3}return Z.substring(j,_)}function O(){let j="",_=$;while(!0){if($>=z){j+=Z.substring(_,$),q=2;break}let V=Z.charCodeAt($);if(V===34){j+=Z.substring(_,$),$++;break}if(V===92){if(j+=Z.substring(_,$),$++,$>=z){q=2;break}switch(Z.charCodeAt($++)){case 34:j+='"';break;case 92:j+="\\";break;case 47:j+="/";break;case 98:j+="\b";break;case 102:j+="\f";break;case 110:j+=`
3
3
  `;break;case 114:j+="\r";break;case 116:j+="\t";break;case 117:let M=R(4,!0);if(M>=0)j+=String.fromCharCode(M);else q=4;break;default:q=5}_=$;continue}if(V>=0&&V<=31)if(J0(V)){j+=Z.substring(_,$),q=2;break}else q=6;$++}return j}function K(){if(X="",q=0,Y=$,W=G,H=I,$>=z)return Y=z,U=17;let j=Z.charCodeAt($);if(m0(j)){do $++,X+=String.fromCharCode(j),j=Z.charCodeAt($);while(m0(j));return U=15}if(J0(j)){if($++,X+=String.fromCharCode(j),j===13&&Z.charCodeAt($)===10)$++,X+=`
4
4
  `;return G++,I=$,U=14}switch(j){case 123:return $++,U=1;case 125:return $++,U=2;case 91:return $++,U=3;case 93:return $++,U=4;case 58:return $++,U=6;case 44:return $++,U=5;case 34:return $++,X=O(),U=10;case 47:let _=$-1;if(Z.charCodeAt($+1)===47){$+=2;while($<z){if(J0(Z.charCodeAt($)))break;$++}return X=Z.substring(_,$),U=12}if(Z.charCodeAt($+1)===42){$+=2;let V=z-1,B=!1;while($<V){let M=Z.charCodeAt($);if(M===42&&Z.charCodeAt($+1)===47){$+=2,B=!0;break}if($++,J0(M)){if(M===13&&Z.charCodeAt($)===10)$++;G++,I=$}}if(!B)$++,q=1;return X=Z.substring(_,$),U=13}return X+=String.fromCharCode(j),$++,U=16;case 45:if(X+=String.fromCharCode(j),$++,$===z||!t(Z.charCodeAt($)))return U=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return X+=A(),U=11;default:while($<z&&y(j))$++,j=Z.charCodeAt($);if(Y!==$){switch(X=Z.substring(Y,$),X){case"true":return U=8;case"false":return U=9;case"null":return U=7}return U=16}return X+=String.fromCharCode(j),$++,U=16}}function y(j){if(m0(j)||J0(j))return!1;switch(j){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function v(){let j;do j=K();while(j>=12&&j<=15);return j}return{setPosition:N,getPosition:()=>$,scan:Q?v:K,getToken:()=>U,getTokenValue:()=>X,getTokenOffset:()=>Y,getTokenLength:()=>$-Y,getTokenStartLine:()=>W,getTokenStartCharacter:()=>Y-H,getTokenError:()=>q}}function m0(Z){return Z===32||Z===9}function J0(Z){return Z===10||Z===13}function t(Z){return Z>=48&&Z<=57}var G2;(function(Z){Z[Z.lineFeed=10]="lineFeed",Z[Z.carriageReturn=13]="carriageReturn",Z[Z.space=32]="space",Z[Z._0=48]="_0",Z[Z._1=49]="_1",Z[Z._2=50]="_2",Z[Z._3=51]="_3",Z[Z._4=52]="_4",Z[Z._5=53]="_5",Z[Z._6=54]="_6",Z[Z._7=55]="_7",Z[Z._8=56]="_8",Z[Z._9=57]="_9",Z[Z.a=97]="a",Z[Z.b=98]="b",Z[Z.c=99]="c",Z[Z.d=100]="d",Z[Z.e=101]="e",Z[Z.f=102]="f",Z[Z.g=103]="g",Z[Z.h=104]="h",Z[Z.i=105]="i",Z[Z.j=106]="j",Z[Z.k=107]="k",Z[Z.l=108]="l",Z[Z.m=109]="m",Z[Z.n=110]="n",Z[Z.o=111]="o",Z[Z.p=112]="p",Z[Z.q=113]="q",Z[Z.r=114]="r",Z[Z.s=115]="s",Z[Z.t=116]="t",Z[Z.u=117]="u",Z[Z.v=118]="v",Z[Z.w=119]="w",Z[Z.x=120]="x",Z[Z.y=121]="y",Z[Z.z=122]="z",Z[Z.A=65]="A",Z[Z.B=66]="B",Z[Z.C=67]="C",Z[Z.D=68]="D",Z[Z.E=69]="E",Z[Z.F=70]="F",Z[Z.G=71]="G",Z[Z.H=72]="H",Z[Z.I=73]="I",Z[Z.J=74]="J",Z[Z.K=75]="K",Z[Z.L=76]="L",Z[Z.M=77]="M",Z[Z.N=78]="N",Z[Z.O=79]="O",Z[Z.P=80]="P",Z[Z.Q=81]="Q",Z[Z.R=82]="R",Z[Z.S=83]="S",Z[Z.T=84]="T",Z[Z.U=85]="U",Z[Z.V=86]="V",Z[Z.W=87]="W",Z[Z.X=88]="X",Z[Z.Y=89]="Y",Z[Z.Z=90]="Z",Z[Z.asterisk=42]="asterisk",Z[Z.backslash=92]="backslash",Z[Z.closeBrace=125]="closeBrace",Z[Z.closeBracket=93]="closeBracket",Z[Z.colon=58]="colon",Z[Z.comma=44]="comma",Z[Z.dot=46]="dot",Z[Z.doubleQuote=34]="doubleQuote",Z[Z.minus=45]="minus",Z[Z.openBrace=123]="openBrace",Z[Z.openBracket=91]="openBracket",Z[Z.plus=43]="plus",Z[Z.slash=47]="slash",Z[Z.formFeed=12]="formFeed",Z[Z.tab=9]="tab"})(G2||(G2={}));var x=Array(20).fill(0).map((Z,Q)=>{return" ".repeat(Q)});var E0={" ":{"\n":Array(200).fill(0).map((Z,Q)=>{return`
5
5
  `+" ".repeat(Q)}),"\r":Array(200).fill(0).map((Z,Q)=>{return"\r"+" ".repeat(Q)}),"\r\n":Array(200).fill(0).map((Z,Q)=>{return`\r
@@ -14,4 +14,4 @@ import{Fp as a0}from"./chunk-a1p2f16h.js";import{ns as f0,ps as l0}from"./chunk-
14
14
  `}return Z&&Z.eol||`
15
15
  `}function G0(Z,Q){return`\r
16
16
  `.indexOf(Z.charAt(Q))!==-1}var j0;(function(Z){Z.DEFAULT={allowTrailingComma:!1}})(j0||(j0={}));function M2(Z,Q=[],z=j0.DEFAULT){let $=null,X=[],Y=[];function U(W){if(Array.isArray(X))X.push(W);else if($!==null)X[$]=W}return g0(Z,{onObjectBegin:()=>{let W={};U(W),Y.push(X),X=W,$=null},onObjectProperty:(W)=>{$=W},onObjectEnd:()=>{X=Y.pop()},onArrayBegin:()=>{let W=[];U(W),Y.push(X),X=W,$=null},onArrayEnd:()=>{X=Y.pop()},onLiteralValue:U,onError:(W,I,H)=>{Q.push({error:W,offset:I,length:H})}},z),X[0]}function x0(Z,Q=[],z=j0.DEFAULT){let $={type:"array",offset:-1,length:-1,children:[],parent:void 0};function X(W){if($.type==="property")$.length=W-$.offset,$=$.parent}function Y(W){return $.children.push(W),W}g0(Z,{onObjectBegin:(W)=>{$=Y({type:"object",offset:W,length:-1,parent:$,children:[]})},onObjectProperty:(W,I,H)=>{$=Y({type:"property",offset:I,length:-1,parent:$,children:[]}),$.children.push({type:"string",value:W,offset:I,length:H,parent:$})},onObjectEnd:(W,I)=>{X(W+I),$.length=W+I-$.offset,$=$.parent,X(W+I)},onArrayBegin:(W,I)=>{$=Y({type:"array",offset:W,length:-1,parent:$,children:[]})},onArrayEnd:(W,I)=>{$.length=W+I-$.offset,$=$.parent,X(W+I)},onLiteralValue:(W,I,H)=>{Y({type:d2(W),offset:I,length:H,parent:$,value:W}),X(I+H)},onSeparator:(W,I,H)=>{if($.type==="property"){if(W===":")$.colonOffset=I;else if(W===",")X(I)}},onError:(W,I,H)=>{Q.push({error:W,offset:I,length:H})}},z);let G=$.children[0];if(G)delete G.parent;return G}function F0(Z,Q){if(!Z)return;let z=Z;for(let $ of Q)if(typeof $==="string"){if(z.type!=="object"||!Array.isArray(z.children))return;let X=!1;for(let Y of z.children)if(Array.isArray(Y.children)&&Y.children[0].value===$&&Y.children.length===2){z=Y.children[1],X=!0;break}if(!X)return}else{let X=$;if(z.type!=="array"||X<0||!Array.isArray(z.children)||X>=z.children.length)return;z=z.children[X]}return z}function g0(Z,Q,z=j0.DEFAULT){let $=W0(Z,!1),X=[],Y=0;function U(F){return F?()=>Y===0&&F($.getTokenOffset(),$.getTokenLength(),$.getTokenStartLine(),$.getTokenStartCharacter()):()=>!0}function G(F){return F?(b)=>Y===0&&F(b,$.getTokenOffset(),$.getTokenLength(),$.getTokenStartLine(),$.getTokenStartCharacter()):()=>!0}function W(F){return F?(b)=>Y===0&&F(b,$.getTokenOffset(),$.getTokenLength(),$.getTokenStartLine(),$.getTokenStartCharacter(),()=>X.slice()):()=>!0}function I(F){return F?()=>{if(Y>0)Y++;else if(F($.getTokenOffset(),$.getTokenLength(),$.getTokenStartLine(),$.getTokenStartCharacter(),()=>X.slice())===!1)Y=1}:()=>!0}function H(F){return F?()=>{if(Y>0)Y--;if(Y===0)F($.getTokenOffset(),$.getTokenLength(),$.getTokenStartLine(),$.getTokenStartCharacter())}:()=>!0}let q=I(Q.onObjectBegin),R=W(Q.onObjectProperty),N=H(Q.onObjectEnd),A=I(Q.onArrayBegin),O=H(Q.onArrayEnd),K=W(Q.onLiteralValue),y=G(Q.onSeparator),v=U(Q.onComment),j=G(Q.onError),_=z&&z.disallowComments,V=z&&z.allowTrailingComma;function B(){while(!0){let F=$.scan();switch($.getTokenError()){case 4:M(14);break;case 5:M(15);break;case 3:M(13);break;case 1:if(!_)M(11);break;case 2:M(12);break;case 6:M(16);break}switch(F){case 12:case 13:if(_)M(10);else v();break;case 16:M(1);break;case 15:case 14:break;default:return F}}}function M(F,b=[],U0=[]){if(j(F),b.length+U0.length>0){let i=$.getToken();while(i!==17){if(b.indexOf(i)!==-1){B();break}else if(U0.indexOf(i)!==-1)break;i=B()}}}function m(F){let b=$.getTokenValue();if(F)K(b);else R(b),X.push(b);return B(),!0}function l(){switch($.getToken()){case 11:let F=$.getTokenValue(),b=Number(F);if(isNaN(b))M(2),b=0;K(b);break;case 7:K(null);break;case 8:K(!0);break;case 9:K(!1);break;default:return!1}return B(),!0}function d(){if($.getToken()!==10)return M(3,[],[2,5]),!1;if(m(!1),$.getToken()===6){if(y(":"),B(),!Z0())M(4,[],[2,5])}else M(5,[],[2,5]);return X.pop(),!0}function M0(){q(),B();let F=!1;while($.getToken()!==2&&$.getToken()!==17){if($.getToken()===5){if(!F)M(4,[],[]);if(y(","),B(),$.getToken()===2&&V)break}else if(F)M(6,[],[]);if(!d())M(4,[],[2,5]);F=!0}if(N(),$.getToken()!==2)M(7,[2],[]);else B();return!0}function w0(){A(),B();let F=!0,b=!1;while($.getToken()!==4&&$.getToken()!==17){if($.getToken()===5){if(!b)M(4,[],[]);if(y(","),B(),$.getToken()===4&&V)break}else if(b)M(6,[],[]);if(F)X.push(0),F=!1;else X[X.length-1]++;if(!Z0())M(4,[],[4,5]);b=!0}if(O(),!F)X.pop();if($.getToken()!==4)M(8,[4],[]);else B();return!0}function Z0(){switch($.getToken()){case 3:return w0();case 1:return M0();case 10:return m(!0);default:return l()}}if(B(),$.getToken()===17){if(z.allowEmptyContent)return!0;return M(4,[],[]),!1}if(!Z0())return M(4,[],[]),!1;if($.getToken()!==17)M(9,[],[]);return!0}function d2(Z){switch(typeof Z){case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"object":{if(!Z)return"null";else if(Array.isArray(Z))return"array";return"object"}default:return"null"}}function U2(Z,Q,z,$){let X=Q.slice(),U=x0(Z,[]),G=void 0,W=void 0;while(X.length>0)if(W=X.pop(),G=F0(U,X),G===void 0&&z!==void 0)if(typeof W==="string")z={[W]:z};else z=[z];else break;if(!G){if(z===void 0)throw Error("Can not delete in empty document");return c(Z,{offset:U?U.offset:0,length:U?U.length:0,content:JSON.stringify(z)},$)}else if(G.type==="object"&&typeof W==="string"&&Array.isArray(G.children)){let I=F0(G,[W]);if(I!==void 0)if(z===void 0){if(!I.parent)throw Error("Malformed AST");let H=G.children.indexOf(I.parent),q,R=I.parent.offset+I.parent.length;if(H>0){let N=G.children[H-1];q=N.offset+N.length}else if(q=G.offset+1,G.children.length>1)R=G.children[1].offset;return c(Z,{offset:q,length:R-q,content:""},$)}else return c(Z,{offset:I.offset,length:I.length,content:JSON.stringify(z)},$);else{if(z===void 0)return[];let H=`${JSON.stringify(W)}: ${JSON.stringify(z)}`,q=$.getInsertionIndex?$.getInsertionIndex(G.children.map((N)=>N.children[0].value)):G.children.length,R;if(q>0){let N=G.children[q-1];R={offset:N.offset+N.length,length:0,content:","+H}}else if(G.children.length===0)R={offset:G.offset+1,length:0,content:H};else R={offset:G.offset+1,length:0,content:H+","};return c(Z,R,$)}}else if(G.type==="array"&&typeof W==="number"&&Array.isArray(G.children)){let I=W;if(I===-1){let H=`${JSON.stringify(z)}`,q;if(G.children.length===0)q={offset:G.offset+1,length:0,content:H};else{let R=G.children[G.children.length-1];q={offset:R.offset+R.length,length:0,content:","+H}}return c(Z,q,$)}else if(z===void 0&&G.children.length>=0){let H=W,q=G.children[H],R;if(G.children.length===1)R={offset:G.offset+1,length:G.length-2,content:""};else if(G.children.length-1===H){let N=G.children[H-1],A=N.offset+N.length,O=G.offset+G.length;R={offset:A,length:O-2-A,content:""}}else R={offset:q.offset,length:G.children[H+1].offset-q.offset,content:""};return c(Z,R,$)}else if(z!==void 0){let H,q=`${JSON.stringify(z)}`;if(!$.isArrayInsertion&&G.children.length>W){let R=G.children[W];H={offset:R.offset,length:R.length,content:q}}else if(G.children.length===0||W===0)H={offset:G.offset+1,length:0,content:G.children.length===0?q:q+","};else{let R=W>G.children.length?G.children.length:W,N=G.children[R-1];H={offset:N.offset+N.length,length:0,content:","+q}}return c(Z,H,$)}else throw Error(`Can not ${z===void 0?"remove":$.isArrayInsertion?"insert":"modify"} Array index ${I} as length is not sufficient`)}else throw Error(`Can not add ${typeof W!=="number"?"index":"property"} to parent of type ${G.type}`)}function c(Z,Q,z){if(!z.formattingOptions)return[Q];let $=K0(Z,Q),X=Q.offset,Y=Q.offset+Q.content.length;if(Q.length===0||Q.content.length===0){while(X>0&&!G0($,X-1))X--;while(Y<$.length&&!G0($,Y))Y++}let U=v0($,{offset:X,length:Y-X},{...z.formattingOptions,keepLines:!1});for(let W=U.length-1;W>=0;W--){let I=U[W];$=K0($,I),X=Math.min(X,I.offset),Y=Math.max(Y,I.offset+I.length),Y+=I.content.length-I.length}let G=Z.length-($.length-Y)-X;return[{offset:X,length:G,content:$.substring(X,Y)}]}function K0(Z,Q){return Z.substring(0,Q.offset)+Q.content+Z.substring(Q.offset+Q.length)}var q2;(function(Z){Z[Z.None=0]="None",Z[Z.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",Z[Z.UnexpectedEndOfString=2]="UnexpectedEndOfString",Z[Z.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",Z[Z.InvalidUnicode=4]="InvalidUnicode",Z[Z.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",Z[Z.InvalidCharacter=6]="InvalidCharacter"})(q2||(q2={}));var I2;(function(Z){Z[Z.OpenBraceToken=1]="OpenBraceToken",Z[Z.CloseBraceToken=2]="CloseBraceToken",Z[Z.OpenBracketToken=3]="OpenBracketToken",Z[Z.CloseBracketToken=4]="CloseBracketToken",Z[Z.CommaToken=5]="CommaToken",Z[Z.ColonToken=6]="ColonToken",Z[Z.NullKeyword=7]="NullKeyword",Z[Z.TrueKeyword=8]="TrueKeyword",Z[Z.FalseKeyword=9]="FalseKeyword",Z[Z.StringLiteral=10]="StringLiteral",Z[Z.NumericLiteral=11]="NumericLiteral",Z[Z.LineCommentTrivia=12]="LineCommentTrivia",Z[Z.BlockCommentTrivia=13]="BlockCommentTrivia",Z[Z.LineBreakTrivia=14]="LineBreakTrivia",Z[Z.Trivia=15]="Trivia",Z[Z.Unknown=16]="Unknown",Z[Z.EOF=17]="EOF"})(I2||(I2={}));var rZ=M2;var R2;(function(Z){Z[Z.InvalidSymbol=1]="InvalidSymbol",Z[Z.InvalidNumberFormat=2]="InvalidNumberFormat",Z[Z.PropertyNameExpected=3]="PropertyNameExpected",Z[Z.ValueExpected=4]="ValueExpected",Z[Z.ColonExpected=5]="ColonExpected",Z[Z.CommaExpected=6]="CommaExpected",Z[Z.CloseBraceExpected=7]="CloseBraceExpected",Z[Z.CloseBracketExpected=8]="CloseBracketExpected",Z[Z.EndOfFileExpected=9]="EndOfFileExpected",Z[Z.InvalidCommentToken=10]="InvalidCommentToken",Z[Z.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",Z[Z.UnexpectedEndOfString=12]="UnexpectedEndOfString",Z[Z.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",Z[Z.InvalidUnicode=14]="InvalidUnicode",Z[Z.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",Z[Z.InvalidCharacter=16]="InvalidCharacter"})(R2||(R2={}));function tZ(Z){switch(Z){case 1:return"InvalidSymbol";case 2:return"InvalidNumberFormat";case 3:return"PropertyNameExpected";case 4:return"ValueExpected";case 5:return"ColonExpected";case 6:return"CommaExpected";case 7:return"CloseBraceExpected";case 8:return"CloseBracketExpected";case 9:return"EndOfFileExpected";case 10:return"InvalidCommentToken";case 11:return"UnexpectedEndOfComment";case 12:return"UnexpectedEndOfString";case 13:return"UnexpectedEndOfNumber";case 14:return"InvalidUnicode";case 15:return"InvalidEscapeCharacter";case 16:return"InvalidCharacter"}return"<unknown ParseErrorCode>"}function eZ(Z,Q,z,$){return U2(Z,Q,z,$)}function Z$(Z,Q){let z=Q.slice(0).sort((X,Y)=>{let U=X.offset-Y.offset;if(U===0)return X.length-Y.length;return U}),$=Z.length;for(let X=z.length-1;X>=0;X--){let Y=z[X];if(Y.offset+Y.length<=$)Z=K0(Z,Y);else throw Error("Overlapping edit");$=Y.offset}return Z}
17
- export{B0 as ep,rZ as fp,tZ as gp,eZ as hp,Z$ as ip,W2 as jp,mZ as kp,h0 as lp,Y0 as mp,_Z as np,NZ as op,X2 as pp,J2 as qp,v2 as rp,FZ as sp,KZ as tp,o as up,wZ as vp,OZ as wp,bZ as xp,LZ as yp,TZ as zp,g2 as Ap,k2 as Bp,f2 as Cp,l2 as Dp,S0 as Ep};
17
+ export{B0 as Hn,rZ as In,tZ as Jn,eZ as Kn,Z$ as Ln,W2 as Mn,mZ as Nn,h0 as On,Y0 as Pn,_Z as Qn,NZ as Rn,X2 as Sn,J2 as Tn,v2 as Un,FZ as Vn,KZ as Wn,o as Xn,wZ as Yn,OZ as Zn,bZ as _n,LZ as $n,TZ as ao,g2 as bo,k2 as co,f2 as do,l2 as eo,S0 as fo};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{dv as k}from"./chunk-09kba1hg.js";import{$x as j,ay as z,eA as u}from"./chunk-t12xrrfr.js";import"./chunk-aztre27e.js";var q=(Q)=>typeof Q==="object"&&Q!==null&&("_zod"in Q),b=(Q,G,X)=>{if(!Q)return;let Y={};for(let[K,W]of Object.entries(Q))Y[K]=G.addExample(W,[...X,K]);return Y},y=(Q,G,X)=>{let{schema:Y,examples:K,...W}=Q,F=W;if(q(Y))F.schema=G.registry.addSchema(Y,[...X,"schema"],{io:G.io,source:{type:"mediaType"}});else F.schema=Y;if(K)F.examples=b(K,G.registry,[...X,"examples"]);return F},C=(Q,G,X)=>{let Y={};for(let[K,W]of Object.entries(Q))if(W)Y[K]=y(W,G,[...X,K]);return Y},E=(Q,G,X)=>{let Y=Q._zod.def;switch(Y.type){case"object":return Q;case"lazy":return E(Y.getter(),G,X);case"pipe":if(G==="input")return E(Y.in,G,X);return E(Y.out,G,X)}throw Error(`Failed to unwrap ZodObject from type: ${Q._zod.def.type} at ${X.join(" > ")}`)},f=(Q,G)=>{if(G==="input")return Q._zod.optin===void 0;return Q._zod.optout===void 0},m=(Q,G,X)=>{if(!Q)return;if(q(Q)){let Y=E(Q,"output",X),K={};for(let[W,F]of Object.entries(Y._zod.def.shape))K[W]=G.addHeader(F,[...X,W]);return K}return Q},p=(Q,G,X)=>{if(!Q)return;let Y={};for(let[K,W]of Object.entries(Q))Y[K]=G.addLink(W,[...X,K]);return Y},$=(Q,G,X)=>{if(!Q)return;let Y=[];for(let K of Q){if(q(K)){let W=G.addParameter(K,[...X,"parameters"]);Y.push(W);continue}Y.push(K)}return Y},i=(Q,G,X)=>{if(!Q)return;let Y=[];for(let[K,W]of Object.entries(Q??{})){let F=E(W,"input",X);for(let[V,L]of Object.entries(F._zod.def.shape)){let M=G.addParameter(L,[...X,K,V],{location:{in:K,name:V}});Y.push(M)}}return Y},T=(Q)=>Q.startsWith("x-"),n=(Q,G,X)=>{if(!Q)return;let Y={};for(let[K,W]of Object.entries(Q)){if(T(K)){Y[K]=W;continue}Y[K]=G.addCallback(W,[...X,K])}return Y},o=(Q,G,X)=>{if(!Q)return;let Y={};for(let[K,W]of Object.entries(Q)){if(!W)continue;if(T(K)){Y[K]=W;continue}if("$ref"in W){Y[K]=W;continue}Y[K]=G.addResponse(W,[...X,K])}return Y},c=(Q,G,X)=>{let{parameters:Y,requestParams:K,requestBody:W,responses:F,callbacks:V,...L}=Q,M=L,H=$(Y,G,[...X,"parameters"]),N=i(K,G,[...X,"requestParams"]);if(N||H)M.parameters=[...N??[],...H??[]];let A=W&&G.addRequestBody(W,X);if(A)M.requestBody=A;let Z=o(F,G,[...X,"responses"]);if(Z)M.responses=Z;let J=n(V,G,[...X,"callbacks"]);if(J)M.callbacks=J;return M},R=(Q,G,X)=>{if(!Q)return;let Y={};for(let[K,W]of Object.entries(Q)){if(T(K)){Y[K]=W;continue}Y[K]=G.addPathItem(W,[...X,K])}return Y},S=["3.0.0","3.0.1","3.0.2","3.0.3","3.1.0","3.1.1"],_=(Q,G)=>S.indexOf(Q)>=S.indexOf(G),a=(Q)=>{let G=Q.zodSchema._zod.def;switch(G.type){case"bigint":Q.jsonSchema.type="integer",Q.jsonSchema.format="int64";break;case"union":{if("discriminator"in G&&typeof G.discriminator==="string"){Q.jsonSchema.oneOf??=Q.jsonSchema.anyOf,delete Q.jsonSchema.anyOf,Q.jsonSchema.type="object",Q.jsonSchema.discriminator={propertyName:G.discriminator};let Y={};for(let[K,W]of Object.entries(Q.jsonSchema.oneOf)){let F=W.$ref;if(!F){delete Q.jsonSchema.discriminator;return}let V=G.options[Number(K)]._zod.propValues?.[G.discriminator];if(!V?.size)return;for(let L of[...V??[]]){if(typeof L!=="string"&&typeof L!=="number"&&typeof L!=="boolean")return;Y[String(L)]=F}}Q.jsonSchema.discriminator.mapping=Y}let X=z.get(Q.zodSchema);if(typeof X?.unionOneOf==="boolean"){if(X.unionOneOf)Q.jsonSchema.oneOf=Q.jsonSchema.anyOf,delete Q.jsonSchema.anyOf;delete Q.jsonSchema.unionOneOf}break}case"date":Q.jsonSchema.type="string";break;case"literal":if(G.values.includes(void 0))break;break;case"undefined":Q.jsonSchema.not={};break}},l=(Q,G,X)=>{if(X.context&&Q.zodSchema._zod.parent!==X.context.zodSchema){if(X.context.zodSchema._zod.def.type==="pipe")throw Error(`Zod transform found at ${X.context.path.join(" > ")} are not supported in output schemas. Please use \`.overwrite()\` or wrap the schema in a \`.pipe()\` or assign it manual metadata with \`.meta()\``);throw Error(`Zod schema of type \`${X.context.zodSchema._zod.def.type}\` at ${X.context?.path.join(" > ")} cannot be represented in OpenAPI. Please assign it metadata with \`.meta()\``)}if(X.context=void 0,Object.keys(Q.jsonSchema).length)return;let Y=Q.zodSchema._zod.def,K=G.allowEmptySchema?.[Y.type];if(K===!0||K?.[Q.io])return;switch(Y.type){case"optional":l({...Q,zodSchema:Y.innerType},G,X);return;case"any":return;case"unknown":return;case"pipe":if(Q.io==="output"){if(!Q.zodSchema._zod.parent){X.context=Q;return}}return;case"transform":if(Q.io==="output")return;break;case"literal":if(Y.values.includes(void 0))throw Error(`Zod literal at ${Q.path.join(" > ")} cannot include \`undefined\` as a value. Please use \`z.undefined()\` or \`.optional()\` instead.`);return;case"custom":if(!Q.zodSchema._zod.parent){X.context=Q;return}}throw Error(`Zod schema of type \`${Y.type}\` at ${Q.path.join(" > ")} cannot be represented in OpenAPI. Please assign it metadata with \`.meta()\``)},r=(Q,G,X,Y)=>{let K=new Map;if(X.io==="input")return K;let W=new Map,F=new Map;for(let[V,L]of Object.entries(Q)){let M=JSON.stringify(L),H=new RegExp(`"${Y}([^"]+)"`,"g"),N=M.matchAll(H),A=new Set;for(let Z of N){let J=Z[1];if(J!==V)A.add(J)}F.set(V,M),W.set(V,{dependencies:A})}for(let[V]of F){if(!X.registry.components.schemas.ids.get(V))continue;if(x(W,F,X.registry,V))continue;let L=G.get(V)??`${V}${X.opts.outputIdSuffix??"Output"}`;K.set(V,L),Q[L]=Q[V],delete Q[V]}return K},x=(Q,G,X,Y,K=new Set)=>{if(K.has(Y))return!0;let W=Q.get(Y);if(W.pure!==void 0)return W.pure;let F=G.get(Y),V=X.components.schemas.ids.get(Y);if(V&&F!==JSON.stringify(V))return W.pure=!1,!1;K.add(Y);let L=[...W.dependencies].every((M)=>x(Q,G,X,M,new Set(K)));return W.pure=L,L},s=(Q,G={})=>{G.registry??=P({schemas:G.schemaComponents}),G.opts??={},G.io??="output";let X=Object.fromEntries(G.registry.components.schemas[G.io]),Y={zodOpenApiCreateSchema:{zodType:Q}};Object.assign(Y,X);let K=g(Y,{registry:G.registry,io:G.io,opts:{...G.opts,schemaRefPath:G.schemaRefPath},openapiVersion:G.openapiVersion});return{schema:K.schemas.zodOpenApiCreateSchema,components:K.components}},t=["param","header","unusedIO","override","outputId"],e=(Q)=>{t.forEach((G)=>{delete Q[G]})},v=(Q)=>{delete Q.$schema,delete Q.id,delete Q.$id},g=(Q,G)=>{let X=G.opts.schemaRefPath??"#/components/schemas/",Y={};for(let[D,{zodType:w}]of Object.entries(Q))Y[D]=w;let K=j();K.add(k(Y),{id:"zodOpenApiCreateSchema"});for(let[D,{zodType:w}]of G.registry.components.schemas.manual)K.add(w,{id:D});let W=new Map,F=_(G.openapiVersion??"3.1.0","3.1.0")?"$defs":"definitions",V={},L=u(K,{override(D){let w=z.get(D.zodSchema);if(w?.outputId&&w?.id)W.set(w.id,w.outputId);if(D.jsonSchema.$ref)return;let B={...D,io:G.io};if(a(B),typeof G.opts.override==="function")G.opts.override(B);if(typeof w?.override==="function")w.override(B),delete D.jsonSchema.override;if(typeof w?.override==="object"&&w.override!==null)Object.assign(D.jsonSchema,w.override),delete D.jsonSchema.override;v(D.jsonSchema),e(D.jsonSchema),l(B,G.opts,V)},io:G.io,unrepresentable:"any",reused:G.opts.reused,cycles:G.opts.cycles,target:_(G.openapiVersion??"3.1.0","3.1.0")?void 0:"openapi-3.0",uri:(D)=>D==="__shared"?`#ZOD_OPENAPI/${D}`:`#ZOD_OPENAPI/__shared#/${F}/${D}`}),M=L.schemas.__shared?.[F]??{};L.schemas.__shared??={[F]:M};let H=new Map;for(let[D,w]of Object.entries(M))if(v(w),/^schema\d+$/.test(D)){let B=`__schema${G.registry.components.schemas.dynamicSchemaCount++}`;if(H.set(D,`"${X}${B}"`),B!==D)M[B]=w,delete M[D]}for(let[D]of G.registry.components.schemas.manual){let w=L.schemas[D];if(!w)continue;v(w)}let N={},A=JSON.parse(JSON.stringify(L).replace(/"#ZOD_OPENAPI\/__shared#\/(?:\$defs|definitions)\/([^"]+)"/g,(D,w)=>{let B=H.get(w);if(B)return B;if(G.registry.components.schemas.manual.get(w))N[w]=!0;return`"${X}${w}"`})),Z=A.schemas.__shared?.[F]??{};A.schemas.__shared??={[F]:Z};for(let[D]of G.registry.components.schemas.manual){let w=A.schemas[D];if(!w)continue;if(N[D]){if(Z[D])throw Error(`Component "${D}" is already registered as a component in the registry`);Z[D]=w}}let J=r(Z,W,G,X);if(!J.size){let D=A.schemas.zodOpenApiCreateSchema?.properties;return delete A.schemas.zodOpenApiCreateSchema,delete A.schemas.__shared,{schemas:D,components:Z,manual:A.schemas}}let U=JSON.parse(JSON.stringify(A).replace(new RegExp(`"${X}([^"]+)"`,"g"),(D,w)=>{let B=J.get(w);if(B)return`"${X}${B}"`;return`"${X}${w}"`})),I=U.schemas.zodOpenApiCreateSchema?.properties,h=U.schemas.__shared?.[F]??{};return delete U.schemas.zodOpenApiCreateSchema,delete U.schemas.__shared,{schemas:I,components:h,manual:U.schemas}},P=(Q)=>{let G={components:{schemas:{dynamicSchemaCount:0,input:new Map,output:new Map,ids:new Map,manual:new Map},headers:{ids:new Map,seen:new WeakMap},requestBodies:{ids:new Map,seen:new WeakMap},responses:{ids:new Map,seen:new WeakMap},parameters:{ids:new Map,seen:new WeakMap},callbacks:{ids:new Map,seen:new WeakMap},pathItems:{ids:new Map,seen:new WeakMap},securitySchemes:{ids:new Map,seen:new WeakMap},links:{ids:new Map,seen:new WeakMap},examples:{ids:new Map,seen:new WeakMap}},addSchema:(X,Y,K)=>{let W={};return G.components.schemas[K.io].set(Y.join(" > "),{schemaObject:W,zodType:X,source:{path:Y,...K?.source}}),W},addParameter:(X,Y,K)=>{let W=G.components.parameters.seen.get(X);if(W)return W;let F=z.get(X),V=K?.location?.name??F?.param?.name,L=K?.location?.in??F?.param?.in;if(K?.location?.name&&F?.param?.name||K?.location?.in&&F?.param?.in)throw Error(`Parameter at ${Y.join(" > ")} has both \`.meta({ param: { name, in } })\` and \`.meta({ param: { location: { in, name } } })\` information`);if(!V||!L)throw Error(`Parameter at ${Y.join(" > ")} is missing \`.meta({ param: { name, in } })\` information`);let M=G.addSchema(X,[...Y,L,V,"schema"],{io:"input",source:{type:"parameter",location:{in:L,name:V}}}),{id:H,examples:N,...A}=F?.param??{},Z={in:L,name:V,schema:M,...A},J=b(N,G,[...Y,L,V,"examples"]);if(J)Z.examples=J;if(f(X,"input"))Z.required=!0;if(!Z.description&&F?.description)Z.description=F.description;let U=H??K?.manualId;if(U){if(G.components.parameters.ids.has(U))throw Error(`Schema "${U}" at ${Y.join(" > ")} is already registered`);let I={$ref:`#/components/parameters/${U}`};if(G.components.parameters.seen.set(X,I),G.components.parameters.ids.set(U,Z),K?.manualId)return Z;return I}if(K?.location?.name||K?.location?.in)return Z;return G.components.parameters.seen.set(X,Z),Z},addHeader:(X,Y,K)=>{let W=G.components.headers.seen.get(X);if(W)return W;let F=z.get(X),{id:V,...L}=F?.header??{},M=V??K?.manualId,H=L;if(f(X,"output"))H.required=!0;if(!H.description&&F?.description)H.description=F.description;if(H.schema=G.addSchema(X,[...Y,"schema"],{io:"output",source:{type:"header"}}),M){if(G.components.schemas.ids.has(M))throw Error(`Schema "${M}" at ${Y.join(" > ")} is already registered`);let N={$ref:`#/components/headers/${M}`};if(G.components.headers.ids.set(M,H),G.components.headers.seen.set(X,N),K?.manualId)return H;return N}return G.components.headers.seen.set(X,H),H},addRequestBody:(X,Y,K)=>{let W=G.components.requestBodies.seen.get(X);if(W)return W;let{content:F,id:V,...L}=X,M={...L,content:C(F,{registry:G,io:"input"},[...Y,"content"])},H=V??K?.manualId;if(H){if(G.components.requestBodies.ids.has(H))throw Error(`RequestBody "${H}" at ${Y.join(" > ")} is already registered`);let N={$ref:`#/components/requestBodies/${H}`};if(G.components.requestBodies.ids.set(H,M),G.components.requestBodies.seen.set(X,N),K?.manualId)return M;return N}return G.components.requestBodies.seen.set(X,M),M},addPathItem:(X,Y,K)=>{let W=G.components.pathItems.seen.get(X);if(W)return W;let F={},{id:V,...L}=X,M=V??K?.manualId;for(let[H,N]of Object.entries(L)){if(T(H)){F[H]=N;continue}if(H==="get"||H==="put"||H==="post"||H==="delete"||H==="options"||H==="head"||H==="patch"||H==="trace"){F[H]=c(N,G,[...Y,H]);continue}if(H==="parameters"){F[H]=$(N,G,[...Y,H]);continue}F[H]=N}if(M){if(G.components.pathItems.ids.has(M))throw Error(`PathItem "${M}" at ${Y.join(" > ")} is already registered`);let H={$ref:`#/components/pathItems/${M}`};if(G.components.pathItems.ids.set(M,F),G.components.pathItems.seen.set(X,H),K?.manualId)return F;return H}return G.components.pathItems.seen.set(X,F),F},addResponse:(X,Y,K)=>{let W=G.components.responses.seen.get(X);if(W)return W;let{content:F,headers:V,links:L,id:M,...H}=X,N=H,A=m(V,G,[...Y,"headers"]);if(A)N.headers=A;if(F)N.content=C(F,{registry:G,io:"output"},[...Y,"content"]);if(L)N.links=p(L,G,[...Y,"links"]);let Z=M??K?.manualId;if(Z){if(G.components.responses.ids.has(Z))throw Error(`Response "${Z}" at ${Y.join(" > ")} is already registered`);let J={$ref:`#/components/responses/${Z}`};if(G.components.responses.ids.set(Z,N),G.components.responses.seen.set(X,J),K?.manualId)return N;return J}return G.components.responses.seen.set(X,N),N},addCallback:(X,Y,K)=>{let W=G.components.callbacks.seen.get(X);if(W)return W;let{id:F,...V}=X,L={};for(let[H,N]of Object.entries(V)){if(T(H)){L[H]=N;continue}L[H]=G.addPathItem(N,[...Y,H])}let M=F??K?.manualId;if(M){if(G.components.callbacks.ids.has(M))throw Error(`Callback "${M}" at ${Y.join(" > ")} is already registered`);let H={$ref:`#/components/callbacks/${M}`};if(G.components.callbacks.ids.set(M,L),G.components.callbacks.seen.set(X,H),K?.manualId)return L;return H}return G.components.callbacks.seen.set(X,L),L},addSecurityScheme:(X,Y,K)=>{let W=G.components.securitySchemes.seen.get(X);if(W)return W;let{id:F,...V}=X,L=V,M=F??K?.manualId;if(M){if(G.components.securitySchemes.ids.has(M))throw Error(`SecurityScheme "${M}" at ${Y.join(" > ")} is already registered`);let H={$ref:`#/components/securitySchemes/${M}`};if(G.components.securitySchemes.ids.set(M,L),G.components.securitySchemes.seen.set(X,H),K?.manualId)return L;return H}return G.components.securitySchemes.seen.set(X,L),L},addLink:(X,Y,K)=>{let W=G.components.links.seen.get(X);if(W)return W;let{id:F,...V}=X,L=V,M=F??K?.manualId;if(M){if(G.components.links.ids.has(M))throw Error(`Link "${M}" at ${Y.join(" > ")} is already registered`);let H={$ref:`#/components/links/${M}`};if(G.components.links.ids.set(M,L),G.components.links.seen.set(X,H),K?.manualId)return L;return H}return G.components.links.seen.set(X,L),L},addExample:(X,Y,K)=>{let W=G.components.examples.seen.get(X);if(W)return W;let{id:F,...V}=X,L=V,M=F??K?.manualId;if(M){if(G.components.examples.ids.has(M))throw Error(`Example "${M}" at ${Y.join(" > ")} is already registered`);let H={$ref:`#/components/examples/${M}`};if(G.components.examples.ids.set(M,L),G.components.examples.seen.set(X,H),K?.manualId)return L;return H}return G.components.examples.seen.set(X,L),L}};return GG(Q?.schemas,G),QG(Q?.parameters,G),XG(Q?.headers,G),YG(Q?.responses,G),FG(Q?.pathItems,G),KG(Q?.requestBodies,G),WG(Q?.callbacks,G),HG(Q?.securitySchemes,G),MG(Q?.links,G),LG(Q?.examples,G),G},GG=(Q,G)=>{if(!Q)return;for(let[X,Y]of Object.entries(Q)){if(q(Y)){let K=z.get(Y)?.id??X;G.components.schemas.manual.set(K,{input:{schemaObject:{}},output:{schemaObject:{}},zodType:Y});continue}G.components.schemas.ids.set(X,Y)}},QG=(Q,G)=>{if(!Q)return;for(let[X,Y]of Object.entries(Q)){if(q(Y)){let K=["components","parameters",X];G.addParameter(Y,K,{manualId:X});continue}G.components.parameters.ids.set(X,Y)}},XG=(Q,G)=>{if(!Q)return;for(let[X,Y]of Object.entries(Q)){if(q(Y)){let K=["components","headers",X];G.addHeader(Y,K,{manualId:X});continue}G.components.headers.ids.set(X,Y)}},YG=(Q,G)=>{if(!Q)return;for(let[X,Y]of Object.entries(Q)){let K=G.addResponse(Y,["components","responses",X],{manualId:X});G.components.responses.ids.set(X,K),G.components.responses.seen.set(Y,K)}},KG=(Q,G)=>{if(!Q)return;for(let[X,Y]of Object.entries(Q)){if(q(Y)){G.addRequestBody(Y,["components","requestBodies",X],{manualId:X});continue}G.components.requestBodies.ids.set(X,Y)}},WG=(Q,G)=>{if(!Q)return;for(let[X,Y]of Object.entries(Q))G.addCallback(Y,["components","callbacks",X],{manualId:X})},FG=(Q,G)=>{if(!Q)return;for(let[X,Y]of Object.entries(Q))G.addPathItem(Y,["components","pathItems",X],{manualId:X})},HG=(Q,G)=>{if(!Q)return;for(let[X,Y]of Object.entries(Q))G.addSecurityScheme(Y,["components","securitySchemes",X],{manualId:X})},MG=(Q,G)=>{if(!Q)return;for(let[X,Y]of Object.entries(Q))G.addLink(Y,["components","links",X],{manualId:X})},LG=(Q,G)=>{if(!Q)return;for(let[X,Y]of Object.entries(Q))G.components.examples.ids.set(X,Y)},O=(Q)=>{let{schemas:G,components:X,manual:Y}=g(Object.fromEntries(Q.registry.components.schemas[Q.io]),Q);for(let[K,W]of Object.entries(X))Q.registry.components.schemas.ids.set(K,W);for(let[K,W]of Object.entries(G)){let F=Q.registry.components.schemas[Q.io].get(K);if(F)Object.assign(F.schemaObject,W)}for(let[K,W]of Object.entries(Y)){let F=Q.registry.components.schemas.manual.get(K);if(!F)continue;if(X[K])F[Q.io].used=!0;Object.assign(F[Q.io].schemaObject,W)}},VG=(Q)=>{for(let[G,X]of Q.components.schemas.manual)if(!X.input.used){let Y=X[z.get(X.zodType)?.unusedIO??"output"].schemaObject;Q.components.schemas.ids.set(G,Y)}},d=(Q,G,X)=>{O({registry:Q,io:"input",opts:G,openapiVersion:X}),O({registry:Q,io:"output",opts:G,openapiVersion:X}),VG(Q);let Y={};if(Q.components.schemas.ids.size>0)Y.schemas=Object.fromEntries(Q.components.schemas.ids);if(Q.components.headers.ids.size>0)Y.headers=Object.fromEntries(Q.components.headers.ids);if(Q.components.requestBodies.ids.size>0)Y.requestBodies=Object.fromEntries(Q.components.requestBodies.ids);if(Q.components.responses.ids.size>0)Y.responses=Object.fromEntries(Q.components.responses.ids);if(Q.components.parameters.ids.size>0)Y.parameters=Object.fromEntries(Q.components.parameters.ids);if(Q.components.callbacks.ids.size>0)Y.callbacks=Object.fromEntries(Q.components.callbacks.ids);if(Q.components.pathItems.ids.size>0)Y.pathItems=Object.fromEntries(Q.components.pathItems.ids);if(Q.components.securitySchemes.ids.size>0)Y.securitySchemes=Object.fromEntries(Q.components.securitySchemes.ids);if(Q.components.links.ids.size>0)Y.links=Object.fromEntries(Q.components.links.ids);if(Q.components.examples.ids.size>0)Y.examples=Object.fromEntries(Q.components.examples.ids);return Y};var AG=(Q,G={})=>{let{paths:X,webhooks:Y,components:K,...W}=Q,F=W,V=P(K),L=R(X,V,["paths"]);if(L)F.paths=L;let M=R(Y,V,["webhooks"]);if(M)F.webhooks=M;let H=d(V,G,Q.openapi);if(Object.keys(H).length>0)F.components=H;return F},JG={};export{JG as oas31,s as createSchema,AG as createDocument};
2
+ import{Gt as k}from"./chunk-j2zay4da.js";import{Cw as j,Dw as z,Hy as u}from"./chunk-4vemws1t.js";import"./chunk-yjj4cvqg.js";var q=(Q)=>typeof Q==="object"&&Q!==null&&("_zod"in Q),b=(Q,G,X)=>{if(!Q)return;let Y={};for(let[K,W]of Object.entries(Q))Y[K]=G.addExample(W,[...X,K]);return Y},y=(Q,G,X)=>{let{schema:Y,examples:K,...W}=Q,F=W;if(q(Y))F.schema=G.registry.addSchema(Y,[...X,"schema"],{io:G.io,source:{type:"mediaType"}});else F.schema=Y;if(K)F.examples=b(K,G.registry,[...X,"examples"]);return F},C=(Q,G,X)=>{let Y={};for(let[K,W]of Object.entries(Q))if(W)Y[K]=y(W,G,[...X,K]);return Y},E=(Q,G,X)=>{let Y=Q._zod.def;switch(Y.type){case"object":return Q;case"lazy":return E(Y.getter(),G,X);case"pipe":if(G==="input")return E(Y.in,G,X);return E(Y.out,G,X)}throw Error(`Failed to unwrap ZodObject from type: ${Q._zod.def.type} at ${X.join(" > ")}`)},f=(Q,G)=>{if(G==="input")return Q._zod.optin===void 0;return Q._zod.optout===void 0},m=(Q,G,X)=>{if(!Q)return;if(q(Q)){let Y=E(Q,"output",X),K={};for(let[W,F]of Object.entries(Y._zod.def.shape))K[W]=G.addHeader(F,[...X,W]);return K}return Q},p=(Q,G,X)=>{if(!Q)return;let Y={};for(let[K,W]of Object.entries(Q))Y[K]=G.addLink(W,[...X,K]);return Y},$=(Q,G,X)=>{if(!Q)return;let Y=[];for(let K of Q){if(q(K)){let W=G.addParameter(K,[...X,"parameters"]);Y.push(W);continue}Y.push(K)}return Y},i=(Q,G,X)=>{if(!Q)return;let Y=[];for(let[K,W]of Object.entries(Q??{})){let F=E(W,"input",X);for(let[V,L]of Object.entries(F._zod.def.shape)){let M=G.addParameter(L,[...X,K,V],{location:{in:K,name:V}});Y.push(M)}}return Y},T=(Q)=>Q.startsWith("x-"),n=(Q,G,X)=>{if(!Q)return;let Y={};for(let[K,W]of Object.entries(Q)){if(T(K)){Y[K]=W;continue}Y[K]=G.addCallback(W,[...X,K])}return Y},o=(Q,G,X)=>{if(!Q)return;let Y={};for(let[K,W]of Object.entries(Q)){if(!W)continue;if(T(K)){Y[K]=W;continue}if("$ref"in W){Y[K]=W;continue}Y[K]=G.addResponse(W,[...X,K])}return Y},c=(Q,G,X)=>{let{parameters:Y,requestParams:K,requestBody:W,responses:F,callbacks:V,...L}=Q,M=L,H=$(Y,G,[...X,"parameters"]),N=i(K,G,[...X,"requestParams"]);if(N||H)M.parameters=[...N??[],...H??[]];let A=W&&G.addRequestBody(W,X);if(A)M.requestBody=A;let Z=o(F,G,[...X,"responses"]);if(Z)M.responses=Z;let J=n(V,G,[...X,"callbacks"]);if(J)M.callbacks=J;return M},R=(Q,G,X)=>{if(!Q)return;let Y={};for(let[K,W]of Object.entries(Q)){if(T(K)){Y[K]=W;continue}Y[K]=G.addPathItem(W,[...X,K])}return Y},S=["3.0.0","3.0.1","3.0.2","3.0.3","3.1.0","3.1.1"],_=(Q,G)=>S.indexOf(Q)>=S.indexOf(G),a=(Q)=>{let G=Q.zodSchema._zod.def;switch(G.type){case"bigint":Q.jsonSchema.type="integer",Q.jsonSchema.format="int64";break;case"union":{if("discriminator"in G&&typeof G.discriminator==="string"){Q.jsonSchema.oneOf??=Q.jsonSchema.anyOf,delete Q.jsonSchema.anyOf,Q.jsonSchema.type="object",Q.jsonSchema.discriminator={propertyName:G.discriminator};let Y={};for(let[K,W]of Object.entries(Q.jsonSchema.oneOf)){let F=W.$ref;if(!F){delete Q.jsonSchema.discriminator;return}let V=G.options[Number(K)]._zod.propValues?.[G.discriminator];if(!V?.size)return;for(let L of[...V??[]]){if(typeof L!=="string"&&typeof L!=="number"&&typeof L!=="boolean")return;Y[String(L)]=F}}Q.jsonSchema.discriminator.mapping=Y}let X=z.get(Q.zodSchema);if(typeof X?.unionOneOf==="boolean"){if(X.unionOneOf)Q.jsonSchema.oneOf=Q.jsonSchema.anyOf,delete Q.jsonSchema.anyOf;delete Q.jsonSchema.unionOneOf}break}case"date":Q.jsonSchema.type="string";break;case"literal":if(G.values.includes(void 0))break;break;case"undefined":Q.jsonSchema.not={};break}},l=(Q,G,X)=>{if(X.context&&Q.zodSchema._zod.parent!==X.context.zodSchema){if(X.context.zodSchema._zod.def.type==="pipe")throw Error(`Zod transform found at ${X.context.path.join(" > ")} are not supported in output schemas. Please use \`.overwrite()\` or wrap the schema in a \`.pipe()\` or assign it manual metadata with \`.meta()\``);throw Error(`Zod schema of type \`${X.context.zodSchema._zod.def.type}\` at ${X.context?.path.join(" > ")} cannot be represented in OpenAPI. Please assign it metadata with \`.meta()\``)}if(X.context=void 0,Object.keys(Q.jsonSchema).length)return;let Y=Q.zodSchema._zod.def,K=G.allowEmptySchema?.[Y.type];if(K===!0||K?.[Q.io])return;switch(Y.type){case"optional":l({...Q,zodSchema:Y.innerType},G,X);return;case"any":return;case"unknown":return;case"pipe":if(Q.io==="output"){if(!Q.zodSchema._zod.parent){X.context=Q;return}}return;case"transform":if(Q.io==="output")return;break;case"literal":if(Y.values.includes(void 0))throw Error(`Zod literal at ${Q.path.join(" > ")} cannot include \`undefined\` as a value. Please use \`z.undefined()\` or \`.optional()\` instead.`);return;case"custom":if(!Q.zodSchema._zod.parent){X.context=Q;return}}throw Error(`Zod schema of type \`${Y.type}\` at ${Q.path.join(" > ")} cannot be represented in OpenAPI. Please assign it metadata with \`.meta()\``)},r=(Q,G,X,Y)=>{let K=new Map;if(X.io==="input")return K;let W=new Map,F=new Map;for(let[V,L]of Object.entries(Q)){let M=JSON.stringify(L),H=new RegExp(`"${Y}([^"]+)"`,"g"),N=M.matchAll(H),A=new Set;for(let Z of N){let J=Z[1];if(J!==V)A.add(J)}F.set(V,M),W.set(V,{dependencies:A})}for(let[V]of F){if(!X.registry.components.schemas.ids.get(V))continue;if(x(W,F,X.registry,V))continue;let L=G.get(V)??`${V}${X.opts.outputIdSuffix??"Output"}`;K.set(V,L),Q[L]=Q[V],delete Q[V]}return K},x=(Q,G,X,Y,K=new Set)=>{if(K.has(Y))return!0;let W=Q.get(Y);if(W.pure!==void 0)return W.pure;let F=G.get(Y),V=X.components.schemas.ids.get(Y);if(V&&F!==JSON.stringify(V))return W.pure=!1,!1;K.add(Y);let L=[...W.dependencies].every((M)=>x(Q,G,X,M,new Set(K)));return W.pure=L,L},s=(Q,G={})=>{G.registry??=P({schemas:G.schemaComponents}),G.opts??={},G.io??="output";let X=Object.fromEntries(G.registry.components.schemas[G.io]),Y={zodOpenApiCreateSchema:{zodType:Q}};Object.assign(Y,X);let K=g(Y,{registry:G.registry,io:G.io,opts:{...G.opts,schemaRefPath:G.schemaRefPath},openapiVersion:G.openapiVersion});return{schema:K.schemas.zodOpenApiCreateSchema,components:K.components}},t=["param","header","unusedIO","override","outputId"],e=(Q)=>{t.forEach((G)=>{delete Q[G]})},v=(Q)=>{delete Q.$schema,delete Q.id,delete Q.$id},g=(Q,G)=>{let X=G.opts.schemaRefPath??"#/components/schemas/",Y={};for(let[D,{zodType:w}]of Object.entries(Q))Y[D]=w;let K=j();K.add(k(Y),{id:"zodOpenApiCreateSchema"});for(let[D,{zodType:w}]of G.registry.components.schemas.manual)K.add(w,{id:D});let W=new Map,F=_(G.openapiVersion??"3.1.0","3.1.0")?"$defs":"definitions",V={},L=u(K,{override(D){let w=z.get(D.zodSchema);if(w?.outputId&&w?.id)W.set(w.id,w.outputId);if(D.jsonSchema.$ref)return;let B={...D,io:G.io};if(a(B),typeof G.opts.override==="function")G.opts.override(B);if(typeof w?.override==="function")w.override(B),delete D.jsonSchema.override;if(typeof w?.override==="object"&&w.override!==null)Object.assign(D.jsonSchema,w.override),delete D.jsonSchema.override;v(D.jsonSchema),e(D.jsonSchema),l(B,G.opts,V)},io:G.io,unrepresentable:"any",reused:G.opts.reused,cycles:G.opts.cycles,target:_(G.openapiVersion??"3.1.0","3.1.0")?void 0:"openapi-3.0",uri:(D)=>D==="__shared"?`#ZOD_OPENAPI/${D}`:`#ZOD_OPENAPI/__shared#/${F}/${D}`}),M=L.schemas.__shared?.[F]??{};L.schemas.__shared??={[F]:M};let H=new Map;for(let[D,w]of Object.entries(M))if(v(w),/^schema\d+$/.test(D)){let B=`__schema${G.registry.components.schemas.dynamicSchemaCount++}`;if(H.set(D,`"${X}${B}"`),B!==D)M[B]=w,delete M[D]}for(let[D]of G.registry.components.schemas.manual){let w=L.schemas[D];if(!w)continue;v(w)}let N={},A=JSON.parse(JSON.stringify(L).replace(/"#ZOD_OPENAPI\/__shared#\/(?:\$defs|definitions)\/([^"]+)"/g,(D,w)=>{let B=H.get(w);if(B)return B;if(G.registry.components.schemas.manual.get(w))N[w]=!0;return`"${X}${w}"`})),Z=A.schemas.__shared?.[F]??{};A.schemas.__shared??={[F]:Z};for(let[D]of G.registry.components.schemas.manual){let w=A.schemas[D];if(!w)continue;if(N[D]){if(Z[D])throw Error(`Component "${D}" is already registered as a component in the registry`);Z[D]=w}}let J=r(Z,W,G,X);if(!J.size){let D=A.schemas.zodOpenApiCreateSchema?.properties;return delete A.schemas.zodOpenApiCreateSchema,delete A.schemas.__shared,{schemas:D,components:Z,manual:A.schemas}}let U=JSON.parse(JSON.stringify(A).replace(new RegExp(`"${X}([^"]+)"`,"g"),(D,w)=>{let B=J.get(w);if(B)return`"${X}${B}"`;return`"${X}${w}"`})),I=U.schemas.zodOpenApiCreateSchema?.properties,h=U.schemas.__shared?.[F]??{};return delete U.schemas.zodOpenApiCreateSchema,delete U.schemas.__shared,{schemas:I,components:h,manual:U.schemas}},P=(Q)=>{let G={components:{schemas:{dynamicSchemaCount:0,input:new Map,output:new Map,ids:new Map,manual:new Map},headers:{ids:new Map,seen:new WeakMap},requestBodies:{ids:new Map,seen:new WeakMap},responses:{ids:new Map,seen:new WeakMap},parameters:{ids:new Map,seen:new WeakMap},callbacks:{ids:new Map,seen:new WeakMap},pathItems:{ids:new Map,seen:new WeakMap},securitySchemes:{ids:new Map,seen:new WeakMap},links:{ids:new Map,seen:new WeakMap},examples:{ids:new Map,seen:new WeakMap}},addSchema:(X,Y,K)=>{let W={};return G.components.schemas[K.io].set(Y.join(" > "),{schemaObject:W,zodType:X,source:{path:Y,...K?.source}}),W},addParameter:(X,Y,K)=>{let W=G.components.parameters.seen.get(X);if(W)return W;let F=z.get(X),V=K?.location?.name??F?.param?.name,L=K?.location?.in??F?.param?.in;if(K?.location?.name&&F?.param?.name||K?.location?.in&&F?.param?.in)throw Error(`Parameter at ${Y.join(" > ")} has both \`.meta({ param: { name, in } })\` and \`.meta({ param: { location: { in, name } } })\` information`);if(!V||!L)throw Error(`Parameter at ${Y.join(" > ")} is missing \`.meta({ param: { name, in } })\` information`);let M=G.addSchema(X,[...Y,L,V,"schema"],{io:"input",source:{type:"parameter",location:{in:L,name:V}}}),{id:H,examples:N,...A}=F?.param??{},Z={in:L,name:V,schema:M,...A},J=b(N,G,[...Y,L,V,"examples"]);if(J)Z.examples=J;if(f(X,"input"))Z.required=!0;if(!Z.description&&F?.description)Z.description=F.description;let U=H??K?.manualId;if(U){if(G.components.parameters.ids.has(U))throw Error(`Schema "${U}" at ${Y.join(" > ")} is already registered`);let I={$ref:`#/components/parameters/${U}`};if(G.components.parameters.seen.set(X,I),G.components.parameters.ids.set(U,Z),K?.manualId)return Z;return I}if(K?.location?.name||K?.location?.in)return Z;return G.components.parameters.seen.set(X,Z),Z},addHeader:(X,Y,K)=>{let W=G.components.headers.seen.get(X);if(W)return W;let F=z.get(X),{id:V,...L}=F?.header??{},M=V??K?.manualId,H=L;if(f(X,"output"))H.required=!0;if(!H.description&&F?.description)H.description=F.description;if(H.schema=G.addSchema(X,[...Y,"schema"],{io:"output",source:{type:"header"}}),M){if(G.components.schemas.ids.has(M))throw Error(`Schema "${M}" at ${Y.join(" > ")} is already registered`);let N={$ref:`#/components/headers/${M}`};if(G.components.headers.ids.set(M,H),G.components.headers.seen.set(X,N),K?.manualId)return H;return N}return G.components.headers.seen.set(X,H),H},addRequestBody:(X,Y,K)=>{let W=G.components.requestBodies.seen.get(X);if(W)return W;let{content:F,id:V,...L}=X,M={...L,content:C(F,{registry:G,io:"input"},[...Y,"content"])},H=V??K?.manualId;if(H){if(G.components.requestBodies.ids.has(H))throw Error(`RequestBody "${H}" at ${Y.join(" > ")} is already registered`);let N={$ref:`#/components/requestBodies/${H}`};if(G.components.requestBodies.ids.set(H,M),G.components.requestBodies.seen.set(X,N),K?.manualId)return M;return N}return G.components.requestBodies.seen.set(X,M),M},addPathItem:(X,Y,K)=>{let W=G.components.pathItems.seen.get(X);if(W)return W;let F={},{id:V,...L}=X,M=V??K?.manualId;for(let[H,N]of Object.entries(L)){if(T(H)){F[H]=N;continue}if(H==="get"||H==="put"||H==="post"||H==="delete"||H==="options"||H==="head"||H==="patch"||H==="trace"){F[H]=c(N,G,[...Y,H]);continue}if(H==="parameters"){F[H]=$(N,G,[...Y,H]);continue}F[H]=N}if(M){if(G.components.pathItems.ids.has(M))throw Error(`PathItem "${M}" at ${Y.join(" > ")} is already registered`);let H={$ref:`#/components/pathItems/${M}`};if(G.components.pathItems.ids.set(M,F),G.components.pathItems.seen.set(X,H),K?.manualId)return F;return H}return G.components.pathItems.seen.set(X,F),F},addResponse:(X,Y,K)=>{let W=G.components.responses.seen.get(X);if(W)return W;let{content:F,headers:V,links:L,id:M,...H}=X,N=H,A=m(V,G,[...Y,"headers"]);if(A)N.headers=A;if(F)N.content=C(F,{registry:G,io:"output"},[...Y,"content"]);if(L)N.links=p(L,G,[...Y,"links"]);let Z=M??K?.manualId;if(Z){if(G.components.responses.ids.has(Z))throw Error(`Response "${Z}" at ${Y.join(" > ")} is already registered`);let J={$ref:`#/components/responses/${Z}`};if(G.components.responses.ids.set(Z,N),G.components.responses.seen.set(X,J),K?.manualId)return N;return J}return G.components.responses.seen.set(X,N),N},addCallback:(X,Y,K)=>{let W=G.components.callbacks.seen.get(X);if(W)return W;let{id:F,...V}=X,L={};for(let[H,N]of Object.entries(V)){if(T(H)){L[H]=N;continue}L[H]=G.addPathItem(N,[...Y,H])}let M=F??K?.manualId;if(M){if(G.components.callbacks.ids.has(M))throw Error(`Callback "${M}" at ${Y.join(" > ")} is already registered`);let H={$ref:`#/components/callbacks/${M}`};if(G.components.callbacks.ids.set(M,L),G.components.callbacks.seen.set(X,H),K?.manualId)return L;return H}return G.components.callbacks.seen.set(X,L),L},addSecurityScheme:(X,Y,K)=>{let W=G.components.securitySchemes.seen.get(X);if(W)return W;let{id:F,...V}=X,L=V,M=F??K?.manualId;if(M){if(G.components.securitySchemes.ids.has(M))throw Error(`SecurityScheme "${M}" at ${Y.join(" > ")} is already registered`);let H={$ref:`#/components/securitySchemes/${M}`};if(G.components.securitySchemes.ids.set(M,L),G.components.securitySchemes.seen.set(X,H),K?.manualId)return L;return H}return G.components.securitySchemes.seen.set(X,L),L},addLink:(X,Y,K)=>{let W=G.components.links.seen.get(X);if(W)return W;let{id:F,...V}=X,L=V,M=F??K?.manualId;if(M){if(G.components.links.ids.has(M))throw Error(`Link "${M}" at ${Y.join(" > ")} is already registered`);let H={$ref:`#/components/links/${M}`};if(G.components.links.ids.set(M,L),G.components.links.seen.set(X,H),K?.manualId)return L;return H}return G.components.links.seen.set(X,L),L},addExample:(X,Y,K)=>{let W=G.components.examples.seen.get(X);if(W)return W;let{id:F,...V}=X,L=V,M=F??K?.manualId;if(M){if(G.components.examples.ids.has(M))throw Error(`Example "${M}" at ${Y.join(" > ")} is already registered`);let H={$ref:`#/components/examples/${M}`};if(G.components.examples.ids.set(M,L),G.components.examples.seen.set(X,H),K?.manualId)return L;return H}return G.components.examples.seen.set(X,L),L}};return GG(Q?.schemas,G),QG(Q?.parameters,G),XG(Q?.headers,G),YG(Q?.responses,G),FG(Q?.pathItems,G),KG(Q?.requestBodies,G),WG(Q?.callbacks,G),HG(Q?.securitySchemes,G),MG(Q?.links,G),LG(Q?.examples,G),G},GG=(Q,G)=>{if(!Q)return;for(let[X,Y]of Object.entries(Q)){if(q(Y)){let K=z.get(Y)?.id??X;G.components.schemas.manual.set(K,{input:{schemaObject:{}},output:{schemaObject:{}},zodType:Y});continue}G.components.schemas.ids.set(X,Y)}},QG=(Q,G)=>{if(!Q)return;for(let[X,Y]of Object.entries(Q)){if(q(Y)){let K=["components","parameters",X];G.addParameter(Y,K,{manualId:X});continue}G.components.parameters.ids.set(X,Y)}},XG=(Q,G)=>{if(!Q)return;for(let[X,Y]of Object.entries(Q)){if(q(Y)){let K=["components","headers",X];G.addHeader(Y,K,{manualId:X});continue}G.components.headers.ids.set(X,Y)}},YG=(Q,G)=>{if(!Q)return;for(let[X,Y]of Object.entries(Q)){let K=G.addResponse(Y,["components","responses",X],{manualId:X});G.components.responses.ids.set(X,K),G.components.responses.seen.set(Y,K)}},KG=(Q,G)=>{if(!Q)return;for(let[X,Y]of Object.entries(Q)){if(q(Y)){G.addRequestBody(Y,["components","requestBodies",X],{manualId:X});continue}G.components.requestBodies.ids.set(X,Y)}},WG=(Q,G)=>{if(!Q)return;for(let[X,Y]of Object.entries(Q))G.addCallback(Y,["components","callbacks",X],{manualId:X})},FG=(Q,G)=>{if(!Q)return;for(let[X,Y]of Object.entries(Q))G.addPathItem(Y,["components","pathItems",X],{manualId:X})},HG=(Q,G)=>{if(!Q)return;for(let[X,Y]of Object.entries(Q))G.addSecurityScheme(Y,["components","securitySchemes",X],{manualId:X})},MG=(Q,G)=>{if(!Q)return;for(let[X,Y]of Object.entries(Q))G.addLink(Y,["components","links",X],{manualId:X})},LG=(Q,G)=>{if(!Q)return;for(let[X,Y]of Object.entries(Q))G.components.examples.ids.set(X,Y)},O=(Q)=>{let{schemas:G,components:X,manual:Y}=g(Object.fromEntries(Q.registry.components.schemas[Q.io]),Q);for(let[K,W]of Object.entries(X))Q.registry.components.schemas.ids.set(K,W);for(let[K,W]of Object.entries(G)){let F=Q.registry.components.schemas[Q.io].get(K);if(F)Object.assign(F.schemaObject,W)}for(let[K,W]of Object.entries(Y)){let F=Q.registry.components.schemas.manual.get(K);if(!F)continue;if(X[K])F[Q.io].used=!0;Object.assign(F[Q.io].schemaObject,W)}},VG=(Q)=>{for(let[G,X]of Q.components.schemas.manual)if(!X.input.used){let Y=X[z.get(X.zodType)?.unusedIO??"output"].schemaObject;Q.components.schemas.ids.set(G,Y)}},d=(Q,G,X)=>{O({registry:Q,io:"input",opts:G,openapiVersion:X}),O({registry:Q,io:"output",opts:G,openapiVersion:X}),VG(Q);let Y={};if(Q.components.schemas.ids.size>0)Y.schemas=Object.fromEntries(Q.components.schemas.ids);if(Q.components.headers.ids.size>0)Y.headers=Object.fromEntries(Q.components.headers.ids);if(Q.components.requestBodies.ids.size>0)Y.requestBodies=Object.fromEntries(Q.components.requestBodies.ids);if(Q.components.responses.ids.size>0)Y.responses=Object.fromEntries(Q.components.responses.ids);if(Q.components.parameters.ids.size>0)Y.parameters=Object.fromEntries(Q.components.parameters.ids);if(Q.components.callbacks.ids.size>0)Y.callbacks=Object.fromEntries(Q.components.callbacks.ids);if(Q.components.pathItems.ids.size>0)Y.pathItems=Object.fromEntries(Q.components.pathItems.ids);if(Q.components.securitySchemes.ids.size>0)Y.securitySchemes=Object.fromEntries(Q.components.securitySchemes.ids);if(Q.components.links.ids.size>0)Y.links=Object.fromEntries(Q.components.links.ids);if(Q.components.examples.ids.size>0)Y.examples=Object.fromEntries(Q.components.examples.ids);return Y};var AG=(Q,G={})=>{let{paths:X,webhooks:Y,components:K,...W}=Q,F=W,V=P(K),L=R(X,V,["paths"]);if(L)F.paths=L;let M=R(Y,V,["webhooks"]);if(M)F.webhooks=M;let H=d(V,G,Q.openapi);if(Object.keys(H).length>0)F.components=H;return F},JG={};export{JG as oas31,s as createSchema,AG as createDocument};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import"./chunk-kdcnder5.js";import"./chunk-aztre27e.js";var e={"ui.sessionReview.title":"Promjene sesije","ui.sessionReview.title.lastTurn":"Promjene u posljednjem potezu","ui.sessionReview.diffStyle.unified":"Ujedinjeno","ui.sessionReview.diffStyle.split":"Podijeljeno","ui.sessionReview.openFile":"Otvori fajl","ui.sessionReview.selection.line":"linija {{line}}","ui.sessionReview.selection.lines":"linije {{start}}-{{end}}","ui.sessionReview.expandAll":"Pro\u0161iri sve","ui.sessionReview.collapseAll":"Sa\u017Emi sve","ui.sessionReview.change.added":"Dodano","ui.sessionReview.change.removed":"Uklonjeno","ui.sessionReview.change.modified":"Izmijenjeno","ui.sessionReview.image.loading":"U\u010Ditavanje...","ui.sessionReview.image.placeholder":"Slika","ui.sessionReview.largeDiff.title":"Diff je prevelik za prikaz","ui.sessionReview.largeDiff.meta":"Limit: {{limit}} izmijenjenih linija. Trenutno: {{current}} izmijenjenih linija.","ui.sessionReview.largeDiff.renderAnyway":"Prika\u017Ei svejedno","ui.fileMedia.kind.image":"slika","ui.fileMedia.kind.audio":"audio","ui.fileMedia.state.removed":"Uklonjeno: {{kind}}","ui.fileMedia.state.loading":"U\u010Ditavanje: {{kind}}...","ui.fileMedia.state.error":"Gre\u0161ka pri u\u010Ditavanju: {{kind}}","ui.fileMedia.state.unavailable":"Nedostupno: {{kind}}","ui.fileMedia.binary.title":"Binarni fajl","ui.fileMedia.binary.description.path":"{{path}} se ne mo\u017Ee prikazati jer je binarni fajl.","ui.fileMedia.binary.description.default":"Ovaj fajl se ne mo\u017Ee prikazati jer je binarni.","ui.lineComment.label.prefix":"Komentar na ","ui.lineComment.label.suffix":"","ui.lineComment.editorLabel.prefix":"Komentari\u0161e\u0161 ","ui.lineComment.editorLabel.suffix":"","ui.lineComment.placeholder":"Dodaj komentar","ui.lineComment.submit":"Komentari\u0161i","ui.sessionTurn.steps.show":"Prika\u017Ei korake","ui.sessionTurn.steps.hide":"Sakrij korake","ui.sessionTurn.summary.response":"Odgovor","ui.sessionTurn.diff.showMore":"Prika\u017Ei jo\u0161 izmjena ({{count}})","ui.sessionTurn.retry.retrying":"ponovni poku\u0161aj","ui.sessionTurn.retry.inSeconds":"za {{seconds}}s","ui.sessionTurn.retry.attempt":"poku\u0161aj #{{attempt}}","ui.sessionTurn.retry.attemptLine":"{{line}} - poku\u0161aj #{{attempt}}","ui.sessionTurn.retry.geminiHot":"gemini je trenutno preoptere\u0107en","ui.sessionTurn.error.freeUsageExceeded":"Besplatna upotreba prema\u0161ena","ui.sessionTurn.error.addQredits":"Dodaj kredite","ui.sessionTurn.status.delegating":"Delegiranje posla","ui.sessionTurn.status.planning":"Planiranje sljede\u0107ih koraka","ui.sessionTurn.status.gatheringContext":"Istra\u017Eivanje","ui.sessionTurn.status.gatheredContext":"Istra\u017Eeno","ui.sessionTurn.status.searchingCodebase":"Pretra\u017Eivanje baze koda","ui.sessionTurn.status.searchingWeb":"Pretra\u017Eivanje weba","ui.sessionTurn.status.makingEdits":"Pravljenje izmjena","ui.sessionTurn.status.runningCommands":"Pokretanje komandi","ui.sessionTurn.status.thinking":"Razmi\u0161ljanje","ui.sessionTurn.status.thinkingWithTopic":"Razmi\u0161ljanje - {{topic}}","ui.sessionTurn.status.gatheringThoughts":"Sre\u0111ivanje misli","ui.sessionTurn.status.consideringNextSteps":"Razmatranje sljede\u0107ih koraka","ui.messagePart.questions.dismissed":"Pitanja odba\u010Dena","ui.messagePart.compaction":"Sesija sa\u017Eeta","ui.messagePart.context.read.one":"{{count}} \u010Ditanje","ui.messagePart.context.read.other":"{{count}} \u010Ditanja","ui.messagePart.context.search.one":"{{count}} pretraga","ui.messagePart.context.search.other":"{{count}} pretrage","ui.messagePart.context.list.one":"{{count}} lista","ui.messagePart.context.list.other":"{{count}} liste","ui.messagePart.diagnostic.error":"Gre\u0161ka","ui.messagePart.title.edit":"Uredi","ui.messagePart.title.write":"Napi\u0161i","ui.messagePart.option.typeOwnAnswer":"Unesi svoj odgovor","ui.messagePart.review.title":"Pregledaj svoje odgovore","ui.list.loading":"U\u010Ditavanje","ui.list.empty":"Nema rezultata","ui.list.clearFilter":"O\u010Disti filter","ui.list.emptyWithFilter.prefix":"Nema rezultata za","ui.list.emptyWithFilter.suffix":"","ui.messageNav.newMessage":"Nova poruka","ui.textField.copyToClipboard":"Kopiraj u me\u0111uspremnik","ui.textField.copyLink":"Kopiraj link","ui.textField.copied":"Kopirano","ui.imagePreview.alt":"Pregled slike","ui.scrollView.ariaLabel":"sadr\u017Eaj za pomjeranje","ui.tool.read":"\u010Citanje","ui.tool.loaded":"U\u010Ditano","ui.tool.list":"Listanje","ui.tool.glob":"Glob","ui.tool.grep":"Grep","ui.tool.webfetch":"Web preuzimanje","ui.tool.websearch":"Pretraga weba","ui.tool.codesearch":"Pretraga koda","ui.tool.shell":"Shell","ui.tool.patch":"Patch","ui.tool.todos":"Lista zadataka","ui.tool.todos.read":"\u010Citanje liste zadataka","ui.tool.questions":"Pitanja","ui.tool.agent":"{{type}} agent","ui.tool.agent.default":"agent","ui.common.file.one":"datoteka","ui.common.file.other":"datoteke","ui.common.question.one":"pitanje","ui.common.question.other":"pitanja","ui.common.add":"Dodaj","ui.common.back":"Nazad","ui.common.cancel":"Otka\u017Ei","ui.common.confirm":"Potvrdi","ui.common.dismiss":"Odbaci","ui.common.close":"Zatvori","ui.common.next":"Dalje","ui.common.submit":"Po\u0161alji","ui.permission.deny":"Zabrani","ui.permission.allowAlways":"Uvijek dozvoli","ui.permission.allowOnce":"Dozvoli jednom","ui.message.expand":"Pro\u0161iri poruku","ui.message.collapse":"Sa\u017Emi poruku","ui.message.copy":"Kopiraj","ui.message.copyMessage":"Kopiraj poruku","ui.message.forkMessage":"Forkaj u novu sesiju","ui.message.revertMessage":"Resetuj na ovu ta\u010Dku","ui.message.copyResponse":"Kopiraj odgovor","ui.message.copied":"Kopirano!","ui.message.interrupted":"Prekinuto","ui.message.queued":"U redu","ui.message.attachment.alt":"prilog","ui.patch.action.deleted":"Obrisano","ui.patch.action.created":"Kreirano","ui.patch.action.moved":"Premje\u0161teno","ui.patch.action.patched":"Primijenjeno","ui.question.subtitle.answered":"{{count}} odgovoreno","ui.question.answer.none":"(nema odgovora)","ui.question.review.notAnswered":"(nije odgovoreno)","ui.question.multiHint":"Odaberi sve \u0161to va\u017Ei","ui.question.singleHint":"Odaberi jedan odgovor","ui.question.custom.placeholder":"Unesi svoj odgovor...","ui.fileSearch.placeholder":"Prona\u0111i","ui.fileSearch.previousMatch":"Prethodno","ui.fileSearch.nextMatch":"Sljede\u0107e","ui.fileSearch.close":"Zatvori pretragu","ui.tool.task":"Zadatak","ui.tool.skill":"Vje\u0161tina","ui.basicTool.called":"Pozvan `{{tool}}`","ui.toolErrorCard.failed":"Neuspje\u0161no","ui.toolErrorCard.copyError":"Kopiraj gre\u0161ku","ui.message.duration.seconds":"{{count}}s","ui.message.duration.minutesSeconds":"{{minutes}}m {{seconds}}s"};export{e as dict};
2
+ import"./chunk-kdcnder5.js";import"./chunk-yjj4cvqg.js";var e={"ui.sessionReview.title":"Promjene sesije","ui.sessionReview.title.lastTurn":"Promjene u posljednjem potezu","ui.sessionReview.diffStyle.unified":"Ujedinjeno","ui.sessionReview.diffStyle.split":"Podijeljeno","ui.sessionReview.openFile":"Otvori fajl","ui.sessionReview.selection.line":"linija {{line}}","ui.sessionReview.selection.lines":"linije {{start}}-{{end}}","ui.sessionReview.expandAll":"Pro\u0161iri sve","ui.sessionReview.collapseAll":"Sa\u017Emi sve","ui.sessionReview.change.added":"Dodano","ui.sessionReview.change.removed":"Uklonjeno","ui.sessionReview.change.modified":"Izmijenjeno","ui.sessionReview.image.loading":"U\u010Ditavanje...","ui.sessionReview.image.placeholder":"Slika","ui.sessionReview.largeDiff.title":"Diff je prevelik za prikaz","ui.sessionReview.largeDiff.meta":"Limit: {{limit}} izmijenjenih linija. Trenutno: {{current}} izmijenjenih linija.","ui.sessionReview.largeDiff.renderAnyway":"Prika\u017Ei svejedno","ui.fileMedia.kind.image":"slika","ui.fileMedia.kind.audio":"audio","ui.fileMedia.state.removed":"Uklonjeno: {{kind}}","ui.fileMedia.state.loading":"U\u010Ditavanje: {{kind}}...","ui.fileMedia.state.error":"Gre\u0161ka pri u\u010Ditavanju: {{kind}}","ui.fileMedia.state.unavailable":"Nedostupno: {{kind}}","ui.fileMedia.binary.title":"Binarni fajl","ui.fileMedia.binary.description.path":"{{path}} se ne mo\u017Ee prikazati jer je binarni fajl.","ui.fileMedia.binary.description.default":"Ovaj fajl se ne mo\u017Ee prikazati jer je binarni.","ui.lineComment.label.prefix":"Komentar na ","ui.lineComment.label.suffix":"","ui.lineComment.editorLabel.prefix":"Komentari\u0161e\u0161 ","ui.lineComment.editorLabel.suffix":"","ui.lineComment.placeholder":"Dodaj komentar","ui.lineComment.submit":"Komentari\u0161i","ui.sessionTurn.steps.show":"Prika\u017Ei korake","ui.sessionTurn.steps.hide":"Sakrij korake","ui.sessionTurn.summary.response":"Odgovor","ui.sessionTurn.diff.showMore":"Prika\u017Ei jo\u0161 izmjena ({{count}})","ui.sessionTurn.retry.retrying":"ponovni poku\u0161aj","ui.sessionTurn.retry.inSeconds":"za {{seconds}}s","ui.sessionTurn.retry.attempt":"poku\u0161aj #{{attempt}}","ui.sessionTurn.retry.attemptLine":"{{line}} - poku\u0161aj #{{attempt}}","ui.sessionTurn.retry.geminiHot":"gemini je trenutno preoptere\u0107en","ui.sessionTurn.error.freeUsageExceeded":"Besplatna upotreba prema\u0161ena","ui.sessionTurn.error.addQredits":"Dodaj kredite","ui.sessionTurn.status.delegating":"Delegiranje posla","ui.sessionTurn.status.planning":"Planiranje sljede\u0107ih koraka","ui.sessionTurn.status.gatheringContext":"Istra\u017Eivanje","ui.sessionTurn.status.gatheredContext":"Istra\u017Eeno","ui.sessionTurn.status.searchingCodebase":"Pretra\u017Eivanje baze koda","ui.sessionTurn.status.searchingWeb":"Pretra\u017Eivanje weba","ui.sessionTurn.status.makingEdits":"Pravljenje izmjena","ui.sessionTurn.status.runningCommands":"Pokretanje komandi","ui.sessionTurn.status.thinking":"Razmi\u0161ljanje","ui.sessionTurn.status.thinkingWithTopic":"Razmi\u0161ljanje - {{topic}}","ui.sessionTurn.status.gatheringThoughts":"Sre\u0111ivanje misli","ui.sessionTurn.status.consideringNextSteps":"Razmatranje sljede\u0107ih koraka","ui.messagePart.questions.dismissed":"Pitanja odba\u010Dena","ui.messagePart.compaction":"Sesija sa\u017Eeta","ui.messagePart.context.read.one":"{{count}} \u010Ditanje","ui.messagePart.context.read.other":"{{count}} \u010Ditanja","ui.messagePart.context.search.one":"{{count}} pretraga","ui.messagePart.context.search.other":"{{count}} pretrage","ui.messagePart.context.list.one":"{{count}} lista","ui.messagePart.context.list.other":"{{count}} liste","ui.messagePart.diagnostic.error":"Gre\u0161ka","ui.messagePart.title.edit":"Uredi","ui.messagePart.title.write":"Napi\u0161i","ui.messagePart.option.typeOwnAnswer":"Unesi svoj odgovor","ui.messagePart.review.title":"Pregledaj svoje odgovore","ui.list.loading":"U\u010Ditavanje","ui.list.empty":"Nema rezultata","ui.list.clearFilter":"O\u010Disti filter","ui.list.emptyWithFilter.prefix":"Nema rezultata za","ui.list.emptyWithFilter.suffix":"","ui.messageNav.newMessage":"Nova poruka","ui.textField.copyToClipboard":"Kopiraj u me\u0111uspremnik","ui.textField.copyLink":"Kopiraj link","ui.textField.copied":"Kopirano","ui.imagePreview.alt":"Pregled slike","ui.scrollView.ariaLabel":"sadr\u017Eaj za pomjeranje","ui.tool.read":"\u010Citanje","ui.tool.loaded":"U\u010Ditano","ui.tool.list":"Listanje","ui.tool.glob":"Glob","ui.tool.grep":"Grep","ui.tool.webfetch":"Web preuzimanje","ui.tool.websearch":"Pretraga weba","ui.tool.codesearch":"Pretraga koda","ui.tool.shell":"Shell","ui.tool.patch":"Patch","ui.tool.todos":"Lista zadataka","ui.tool.todos.read":"\u010Citanje liste zadataka","ui.tool.questions":"Pitanja","ui.tool.agent":"{{type}} agent","ui.tool.agent.default":"agent","ui.common.file.one":"datoteka","ui.common.file.other":"datoteke","ui.common.question.one":"pitanje","ui.common.question.other":"pitanja","ui.common.add":"Dodaj","ui.common.back":"Nazad","ui.common.cancel":"Otka\u017Ei","ui.common.confirm":"Potvrdi","ui.common.dismiss":"Odbaci","ui.common.close":"Zatvori","ui.common.next":"Dalje","ui.common.submit":"Po\u0161alji","ui.permission.deny":"Zabrani","ui.permission.allowAlways":"Uvijek dozvoli","ui.permission.allowOnce":"Dozvoli jednom","ui.message.expand":"Pro\u0161iri poruku","ui.message.collapse":"Sa\u017Emi poruku","ui.message.copy":"Kopiraj","ui.message.copyMessage":"Kopiraj poruku","ui.message.forkMessage":"Forkaj u novu sesiju","ui.message.revertMessage":"Resetuj na ovu ta\u010Dku","ui.message.copyResponse":"Kopiraj odgovor","ui.message.copied":"Kopirano!","ui.message.interrupted":"Prekinuto","ui.message.queued":"U redu","ui.message.attachment.alt":"prilog","ui.patch.action.deleted":"Obrisano","ui.patch.action.created":"Kreirano","ui.patch.action.moved":"Premje\u0161teno","ui.patch.action.patched":"Primijenjeno","ui.question.subtitle.answered":"{{count}} odgovoreno","ui.question.answer.none":"(nema odgovora)","ui.question.review.notAnswered":"(nije odgovoreno)","ui.question.multiHint":"Odaberi sve \u0161to va\u017Ei","ui.question.singleHint":"Odaberi jedan odgovor","ui.question.custom.placeholder":"Unesi svoj odgovor...","ui.fileSearch.placeholder":"Prona\u0111i","ui.fileSearch.previousMatch":"Prethodno","ui.fileSearch.nextMatch":"Sljede\u0107e","ui.fileSearch.close":"Zatvori pretragu","ui.tool.task":"Zadatak","ui.tool.skill":"Vje\u0161tina","ui.basicTool.called":"Pozvan `{{tool}}`","ui.toolErrorCard.failed":"Neuspje\u0161no","ui.toolErrorCard.copyError":"Kopiraj gre\u0161ku","ui.message.duration.seconds":"{{count}}s","ui.message.duration.minutesSeconds":"{{minutes}}m {{seconds}}s"};export{e as dict};