@qitqode/qitqode-android-arm64 0.2.9 → 0.2.11

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 (432) hide show
  1. package/bundle/chunk-06j0gaen.js +2 -0
  2. package/bundle/{chunk-g4tyaj0m.js → chunk-075gkea2.js} +1 -1
  3. package/bundle/{chunk-8ysp6vf8.js → chunk-09n24ztn.js} +1 -1
  4. package/bundle/chunk-0bn86djg.js +3 -0
  5. package/bundle/chunk-0mm40z8g.js +2 -0
  6. package/bundle/{chunk-s2tc3qs0.js → chunk-0tya4pqb.js} +2 -2
  7. package/bundle/{chunk-0s4cp6q2.js → chunk-1dnvdeat.js} +2 -2
  8. package/bundle/chunk-1h9sc0gy.js +2 -0
  9. package/bundle/chunk-1mqfhw0f.js +2 -0
  10. package/bundle/{chunk-b5ym419d.js → chunk-1p39y33b.js} +2 -2
  11. package/bundle/{chunk-5cw8235e.js → chunk-1pd943m9.js} +1 -1
  12. package/bundle/{chunk-m7tmgvh6.js → chunk-1rsabv4p.js} +1 -1
  13. package/bundle/{chunk-dwkrqtbc.js → chunk-1tdy73ha.js} +2 -2
  14. package/bundle/{chunk-phf37x1c.js → chunk-1yh1f9yj.js} +1 -1
  15. package/bundle/chunk-22wa8zty.js +2 -0
  16. package/bundle/chunk-28kte9rt.js +2 -0
  17. package/bundle/chunk-2dhjehxe.js +2 -0
  18. package/bundle/{chunk-kre93a89.js → chunk-2h8b0csf.js} +2 -2
  19. package/bundle/chunk-2nnfxbd2.js +2 -0
  20. package/bundle/{chunk-j10a984e.js → chunk-2ts74cgq.js} +2 -2
  21. package/bundle/{chunk-cfwz1hgr.js → chunk-2vsqsxe1.js} +3 -3
  22. package/bundle/chunk-2w5zmgpb.js +2 -0
  23. package/bundle/{chunk-8yzghzjq.js → chunk-32x2901e.js} +1 -1
  24. package/bundle/chunk-34qt3fqj.js +2 -0
  25. package/bundle/{chunk-5r7c6vvx.js → chunk-3amgvg81.js} +2 -2
  26. package/bundle/{chunk-0w19vmd7.js → chunk-3hawwbw6.js} +2 -2
  27. package/bundle/chunk-3p0xvt47.js +2 -0
  28. package/bundle/chunk-3pzx5ret.js +2 -0
  29. package/bundle/{chunk-nsp1za8t.js → chunk-3tf7xfw5.js} +2 -2
  30. package/bundle/chunk-3y4rmqmm.js +2 -0
  31. package/bundle/{chunk-wd8f9r4k.js → chunk-42gd2vx4.js} +1 -1
  32. package/bundle/{chunk-702bt91p.js → chunk-43eqr0ds.js} +4 -4
  33. package/bundle/{chunk-1p9s5jj1.js → chunk-43x9n8rp.js} +1 -1
  34. package/bundle/{chunk-13jq2ygc.js → chunk-44685nzw.js} +2 -2
  35. package/bundle/chunk-46ewdxgh.js +2 -0
  36. package/bundle/{chunk-makegrxs.js → chunk-4805mxf7.js} +1 -1
  37. package/bundle/chunk-486874bd.js +2 -0
  38. package/bundle/{chunk-7adsab4h.js → chunk-48y4n9ne.js} +1 -1
  39. package/bundle/{chunk-vr8nwzp0.js → chunk-49brdmgp.js} +1 -1
  40. package/bundle/{chunk-az3nss5m.js → chunk-49we3vy1.js} +2 -2
  41. package/bundle/chunk-4bcbvfsw.js +2 -0
  42. package/bundle/{chunk-eewe7tx1.js → chunk-4c6d1wy1.js} +2 -2
  43. package/bundle/{chunk-p8ak162p.js → chunk-4d9s7cgr.js} +1 -1
  44. package/bundle/{chunk-scnbt714.js → chunk-4ngvj758.js} +1 -1
  45. package/bundle/{chunk-060wbpz4.js → chunk-4q14whpc.js} +1 -1
  46. package/bundle/chunk-4t1ysdag.js +2 -0
  47. package/bundle/{chunk-g9nwqwqp.js → chunk-50knjq36.js} +1 -1
  48. package/bundle/{chunk-fs1vb39f.js → chunk-51vn4f06.js} +3 -3
  49. package/bundle/{chunk-ag8wxwwz.js → chunk-5mgmq6yz.js} +1 -1
  50. package/bundle/chunk-5q7a4h2w.js +2 -0
  51. package/bundle/{chunk-rdreeyv0.js → chunk-5qydhr42.js} +3 -3
  52. package/bundle/{chunk-maa21rh9.js → chunk-611wfdn3.js} +1 -1
  53. package/bundle/{chunk-n6tqtk6h.js → chunk-63t0rhc9.js} +2 -2
  54. package/bundle/chunk-63vamhf7.js +2 -0
  55. package/bundle/chunk-6hhv3n7c.js +2 -0
  56. package/bundle/{chunk-gbkz04ke.js → chunk-6p848y99.js} +1 -1
  57. package/bundle/{chunk-f2v4g7t1.js → chunk-6xx66mr1.js} +1 -1
  58. package/bundle/{chunk-7thhd7ds.js → chunk-71h3pmnn.js} +1 -1
  59. package/bundle/{chunk-k3m7jfdh.js → chunk-78e76m4h.js} +1 -1
  60. package/bundle/{chunk-vbfej8ds.js → chunk-78yvbv9b.js} +2 -2
  61. package/bundle/chunk-7a9kfb2n.js +2 -0
  62. package/bundle/chunk-7b5vney6.js +2 -0
  63. package/bundle/{chunk-fh3d0wce.js → chunk-7jvx29js.js} +1 -1
  64. package/bundle/{chunk-zqdjk4rf.js → chunk-7wshaze9.js} +2 -2
  65. package/bundle/{chunk-rye1yjnr.js → chunk-7x4g7h04.js} +1 -1
  66. package/bundle/chunk-7x9m1smk.js +2 -0
  67. package/bundle/chunk-82mnr6sf.js +2 -0
  68. package/bundle/{chunk-0egrckx0.js → chunk-84qx54nf.js} +2 -2
  69. package/bundle/{chunk-1acn5me8.js → chunk-88hmeyf5.js} +327 -313
  70. package/bundle/{chunk-gsg6zn7e.js → chunk-89b6ttzs.js} +2 -2
  71. package/bundle/chunk-8bea2r6p.js +2 -0
  72. package/bundle/{chunk-pqg1wjb5.js → chunk-8gn7r4kb.js} +1 -1
  73. package/bundle/chunk-8h6mhzhg.js +2 -0
  74. package/bundle/chunk-8n1cmvr7.js +2 -0
  75. package/bundle/{chunk-e2wfj86b.js → chunk-8qbhnwej.js} +1 -1
  76. package/bundle/{chunk-0ffmwhw7.js → chunk-8rbbt1s8.js} +1 -1
  77. package/bundle/{chunk-zfrftgcy.js → chunk-8rc7cvex.js} +1 -1
  78. package/bundle/{chunk-rk0fnvp5.js → chunk-8t17w67q.js} +1 -1
  79. package/bundle/{chunk-h8mfbbjh.js → chunk-8y03p2md.js} +2 -2
  80. package/bundle/{chunk-3bb4aqh9.js → chunk-8z65v9c9.js} +1 -1
  81. package/bundle/{chunk-ggncq8w8.js → chunk-92xxg12q.js} +1 -1
  82. package/bundle/chunk-955zj1y6.js +2 -0
  83. package/bundle/{chunk-m4r8sepw.js → chunk-95tec4gm.js} +1 -1
  84. package/bundle/chunk-95vp9bvk.js +2 -0
  85. package/bundle/{chunk-cf9m9m9q.js → chunk-96nmxprr.js} +1 -1
  86. package/bundle/{chunk-jpn9zfj5.js → chunk-98z5pfvj.js} +1 -1
  87. package/bundle/{chunk-s5aefff0.js → chunk-9d2mtevw.js} +1 -1
  88. package/bundle/{chunk-qk5vy2pr.js → chunk-9d8meavf.js} +1 -1
  89. package/bundle/{chunk-fw1f47de.js → chunk-9gs4en9v.js} +1 -1
  90. package/bundle/{chunk-e0vrxetq.js → chunk-9svh74gt.js} +1 -1
  91. package/bundle/chunk-9wzxnwv7.js +2 -0
  92. package/bundle/chunk-9zve998d.js +2 -0
  93. package/bundle/chunk-a2pd7nt5.js +2 -0
  94. package/bundle/{chunk-ntr0ezf2.js → chunk-a4cmpa56.js} +1 -1
  95. package/bundle/chunk-a9bkr9x4.js +2 -0
  96. package/bundle/chunk-ac5vzpzt.js +2 -0
  97. package/bundle/{chunk-qbnt4ynd.js → chunk-ajgwyrcf.js} +2 -2
  98. package/bundle/{chunk-c8k32724.js → chunk-ajyfms68.js} +1 -1
  99. package/bundle/{chunk-5wx962mw.js → chunk-akrcbxfa.js} +1 -1
  100. package/bundle/{chunk-vs3s49jw.js → chunk-aykvrqrp.js} +2 -2
  101. package/bundle/{chunk-f4mnp6xd.js → chunk-b274mb6v.js} +1 -1
  102. package/bundle/{chunk-1v0khv7p.js → chunk-b79bb2g3.js} +1 -1
  103. package/bundle/{chunk-wtxh5m6j.js → chunk-bd66q24j.js} +3 -3
  104. package/bundle/{chunk-72crs18f.js → chunk-bffm0wv9.js} +1 -1
  105. package/bundle/{chunk-zwhmg9dj.js → chunk-bh1zbz62.js} +1 -1
  106. package/bundle/chunk-bqqxvagz.js +14 -0
  107. package/bundle/{chunk-gznt3dv8.js → chunk-bw0951fs.js} +1 -1
  108. package/bundle/chunk-bwzbcwff.js +2 -0
  109. package/bundle/{chunk-4y9wbfd2.js → chunk-bxc3z38f.js} +2 -2
  110. package/bundle/{chunk-kveztc6k.js → chunk-bzz2expb.js} +1 -1
  111. package/bundle/chunk-c1exgasy.js +2 -0
  112. package/bundle/{chunk-dt3bsmfe.js → chunk-c53ev0da.js} +2 -2
  113. package/bundle/{chunk-0tm6589k.js → chunk-c5n49vrd.js} +2 -2
  114. package/bundle/{chunk-e0hha3be.js → chunk-ccghr6pm.js} +1 -1
  115. package/bundle/{chunk-52xvhxek.js → chunk-cg7zeppb.js} +2 -2
  116. package/bundle/chunk-cgxzmkkf.js +2 -0
  117. package/bundle/{chunk-0z1keh2w.js → chunk-cm7yp259.js} +1 -1
  118. package/bundle/chunk-cs3cbfm8.js +2 -0
  119. package/bundle/{chunk-w7a33cwa.js → chunk-cshsqavb.js} +2 -2
  120. package/bundle/{chunk-2kh0tg92.js → chunk-csmdhh7r.js} +2 -2
  121. package/bundle/{chunk-w0nc0gcx.js → chunk-cydpdkx7.js} +1 -1
  122. package/bundle/{chunk-vsqvnxbz.js → chunk-czfjmrrq.js} +1 -1
  123. package/bundle/{chunk-bc2krtaf.js → chunk-d1j8frtq.js} +1 -1
  124. package/bundle/chunk-d29te4c1.js +2 -0
  125. package/bundle/{chunk-sz0favtz.js → chunk-d39e4fa8.js} +1 -1
  126. package/bundle/chunk-d6q42p18.js +2 -0
  127. package/bundle/{chunk-ax64ngf2.js → chunk-d6qs2pbx.js} +1 -1
  128. package/bundle/{chunk-wgkcyqn1.js → chunk-datctfgt.js} +2 -2
  129. package/bundle/chunk-dfbexagg.js +2 -0
  130. package/bundle/chunk-dfkcp43a.js +2 -0
  131. package/bundle/chunk-dps1p1g1.js +2 -0
  132. package/bundle/{chunk-z0kbyr00.js → chunk-dzw0j790.js} +2 -2
  133. package/bundle/chunk-e1fzgez5.js +2 -0
  134. package/bundle/chunk-e5cds19n.js +4 -0
  135. package/bundle/{chunk-wr6rnxr5.js → chunk-e6ckxkj8.js} +1 -1
  136. package/bundle/chunk-e7a50j2w.js +2 -0
  137. package/bundle/chunk-e9vh8d52.js +8 -0
  138. package/bundle/chunk-eftk07r3.js +3 -0
  139. package/bundle/chunk-egcvm4x2.js +3 -0
  140. package/bundle/chunk-ek3b08ed.js +2 -0
  141. package/bundle/chunk-ep92grvg.js +808 -0
  142. package/bundle/{chunk-7pckez5z.js → chunk-ex47pb9n.js} +2 -2
  143. package/bundle/{chunk-dhvx9p54.js → chunk-eya9c81t.js} +1 -1
  144. package/bundle/chunk-f78yth0b.js +2 -0
  145. package/bundle/{chunk-kgv68cpb.js → chunk-fd6qxjtf.js} +1 -1
  146. package/bundle/{chunk-b7sr9rn3.js → chunk-fnmq42y5.js} +1 -1
  147. package/bundle/chunk-fqvrxy41.js +2 -0
  148. package/bundle/{chunk-wtt5wms9.js → chunk-fqvsxg00.js} +1 -1
  149. package/bundle/{chunk-sy9w1t2y.js → chunk-fsagyvkz.js} +1 -1
  150. package/bundle/{chunk-trstb8ee.js → chunk-fzxqn4j0.js} +1 -1
  151. package/bundle/{chunk-7jy53zqy.js → chunk-g7jwp73v.js} +1 -1
  152. package/bundle/{chunk-27saej0r.js → chunk-g83d3a0t.js} +2 -2
  153. package/bundle/chunk-gamnnfna.js +2 -0
  154. package/bundle/{chunk-0a4pmkc9.js → chunk-gfer8ch3.js} +2 -2
  155. package/bundle/{chunk-2nheahmq.js → chunk-ghdegwnr.js} +1 -1
  156. package/bundle/chunk-gjxhz1a6.js +2 -0
  157. package/bundle/chunk-gpm39v12.js +2 -0
  158. package/bundle/chunk-gr8emzzx.js +2 -0
  159. package/bundle/chunk-gt6h68pk.js +2 -0
  160. package/bundle/{chunk-3z2zn8rj.js → chunk-gz8k40ty.js} +1 -1
  161. package/bundle/{chunk-bwadggys.js → chunk-h6kmpgak.js} +2 -2
  162. package/bundle/{chunk-t3w43rft.js → chunk-h8yf5e2e.js} +1 -1
  163. package/bundle/{chunk-ryrxgn6d.js → chunk-hama2v6a.js} +1 -1
  164. package/bundle/{chunk-3va85mbe.js → chunk-hav9pgf3.js} +2 -2
  165. package/bundle/chunk-hj588j4f.js +2 -0
  166. package/bundle/{chunk-nas631g2.js → chunk-hntsg7q4.js} +1 -1
  167. package/bundle/chunk-hqtex91e.js +2 -0
  168. package/bundle/{chunk-mr17tppa.js → chunk-hts68y73.js} +2 -2
  169. package/bundle/{chunk-2vaphpz0.js → chunk-j5dnzqjy.js} +1 -1
  170. package/bundle/{chunk-6tqbnxar.js → chunk-j7d3v0x2.js} +1 -1
  171. package/bundle/{chunk-1rgt2vmt.js → chunk-jcn8bg31.js} +1 -1
  172. package/bundle/{chunk-8p0t8qah.js → chunk-jf4zyy7r.js} +1 -1
  173. package/bundle/{chunk-sm1g81cv.js → chunk-jfe9f2wv.js} +1 -1
  174. package/bundle/{chunk-k6981ysw.js → chunk-jh2za7y4.js} +3 -3
  175. package/bundle/chunk-jmgpr5th.js +2 -0
  176. package/bundle/chunk-jt79yt0t.js +2 -0
  177. package/bundle/{chunk-t8fjgkp8.js → chunk-jt7g0r2j.js} +2 -2
  178. package/bundle/chunk-jtz5re73.js +2 -0
  179. package/bundle/{chunk-g6y2c5az.js → chunk-k232ny9m.js} +1 -1
  180. package/bundle/{chunk-vkkz40je.js → chunk-k4ajben7.js} +2 -2
  181. package/bundle/chunk-k4bj677f.js +3 -0
  182. package/bundle/{chunk-mv7q6ach.js → chunk-k4d8gwxe.js} +1 -1
  183. package/bundle/{chunk-h1bvqstw.js → chunk-k558fr15.js} +1 -1
  184. package/bundle/{chunk-85wh85pk.js → chunk-k56zj08h.js} +1 -1
  185. package/bundle/{chunk-a1z8rnq7.js → chunk-k5swnh8m.js} +4 -4
  186. package/bundle/{chunk-bkfafcbw.js → chunk-k8zbhj2p.js} +2 -2
  187. package/bundle/{chunk-vd8cmdpv.js → chunk-kr975sx0.js} +1 -1
  188. package/bundle/{chunk-ydgst3h8.js → chunk-krk24aqm.js} +2 -2
  189. package/bundle/{chunk-eg1m81ax.js → chunk-kt982884.js} +1 -1
  190. package/bundle/chunk-kw5z5awx.js +2 -0
  191. package/bundle/{chunk-d839fr0w.js → chunk-kxdw2vtq.js} +2 -2
  192. package/bundle/chunk-m8phqgxp.js +7 -0
  193. package/bundle/{chunk-kckr30tf.js → chunk-mazakqr7.js} +1 -1
  194. package/bundle/{chunk-1bxfzd6r.js → chunk-mnxcykeq.js} +4 -4
  195. package/bundle/chunk-mp42gb6q.js +2 -0
  196. package/bundle/{chunk-eyr5ymt8.js → chunk-mp5m0acf.js} +1 -1
  197. package/bundle/chunk-mq0733qh.js +2 -0
  198. package/bundle/chunk-mrcsatmn.js +2 -0
  199. package/bundle/{chunk-0tcggtwv.js → chunk-n230jbn9.js} +1 -1
  200. package/bundle/chunk-n24yx79r.js +5 -0
  201. package/bundle/{chunk-cr5tknvb.js → chunk-n2ytaxyn.js} +1 -1
  202. package/bundle/chunk-n4fwztya.js +2 -0
  203. package/bundle/{chunk-bpfq8fz4.js → chunk-n5dxwryh.js} +1 -1
  204. package/bundle/{chunk-dwqvcdmf.js → chunk-n9969djm.js} +1 -1
  205. package/bundle/{chunk-vgt3artc.js → chunk-ncvr75f6.js} +2 -2
  206. package/bundle/chunk-ng2g9kkk.js +2 -0
  207. package/bundle/chunk-ngfhfyjs.js +2 -0
  208. package/bundle/{chunk-y31f8k5f.js → chunk-nvvja3ch.js} +1 -1
  209. package/bundle/{chunk-c76cjhn0.js → chunk-nwkp2f8e.js} +1 -1
  210. package/bundle/{chunk-53jstmdp.js → chunk-nwygsfhk.js} +2 -2
  211. package/bundle/chunk-p0dnmrqp.js +2 -0
  212. package/bundle/{chunk-g878zd6e.js → chunk-p5p4jh9s.js} +1 -1
  213. package/bundle/chunk-p6h2ydcp.js +2 -0
  214. package/bundle/{chunk-wn63q3xp.js → chunk-pcmsxhrb.js} +1 -1
  215. package/bundle/{chunk-ccf4pgkr.js → chunk-pdcj2rfz.js} +2 -2
  216. package/bundle/{chunk-dgcannw0.js → chunk-pfd8gzy4.js} +1 -1
  217. package/bundle/{chunk-a8bjcvda.js → chunk-ph46s66y.js} +1 -1
  218. package/bundle/chunk-pkm3w0ks.js +3 -0
  219. package/bundle/{chunk-g26redah.js → chunk-pnmadk2h.js} +1 -1
  220. package/bundle/{chunk-y0h3jfkj.js → chunk-q65qzc9w.js} +1 -1
  221. package/bundle/{chunk-qk1jkc0n.js → chunk-q8qx38kz.js} +1 -1
  222. package/bundle/chunk-qhakedgs.js +2 -0
  223. package/bundle/{chunk-2caaqmec.js → chunk-qsgpbt4t.js} +1 -1
  224. package/bundle/{chunk-ejhhrece.js → chunk-qtdxy2q1.js} +3 -3
  225. package/bundle/chunk-r18zetwf.js +2 -0
  226. package/bundle/{chunk-t18ka1e7.js → chunk-r1936yb5.js} +1 -1
  227. package/bundle/{chunk-qgkb6n8k.js → chunk-r4qpsa4e.js} +2 -2
  228. package/bundle/chunk-r6055kk0.js +3 -0
  229. package/bundle/chunk-r6rgrz25.js +2 -0
  230. package/bundle/{chunk-rva2ekrt.js → chunk-r9ng8xx5.js} +1 -1
  231. package/bundle/chunk-rk4vp09j.js +2 -0
  232. package/bundle/{chunk-tk4z6r09.js → chunk-rkmg0gbq.js} +1 -1
  233. package/bundle/{chunk-t6zz47zk.js → chunk-rpc0he6b.js} +2 -2
  234. package/bundle/{chunk-sbjymf20.js → chunk-rvev3cy6.js} +2 -2
  235. package/bundle/{chunk-1har4t9a.js → chunk-rx29zmw2.js} +1 -1
  236. package/bundle/{chunk-4pmvxnkj.js → chunk-rxh160jr.js} +2 -2
  237. package/bundle/chunk-s3hbwksw.js +5 -0
  238. package/bundle/{chunk-sa0rrreh.js → chunk-s3zmxfz2.js} +2 -2
  239. package/bundle/chunk-s4jp4zce.js +2 -0
  240. package/bundle/{chunk-c987bemn.js → chunk-s6vhscvd.js} +2 -2
  241. package/bundle/{chunk-zrhw1szj.js → chunk-s81ck6bw.js} +1 -1
  242. package/bundle/{chunk-hz02vrqs.js → chunk-sbj816s8.js} +1 -1
  243. package/bundle/chunk-sec9y622.js +2 -0
  244. package/bundle/{chunk-dcv6wj9x.js → chunk-seda5sfd.js} +2 -2
  245. package/bundle/{chunk-ynf17943.js → chunk-sjtq9bbb.js} +2 -2
  246. package/bundle/chunk-sn7q178t.js +2 -0
  247. package/bundle/chunk-st0h54dm.js +2 -0
  248. package/bundle/{chunk-cghz0855.js → chunk-sxtfssjv.js} +1 -1
  249. package/bundle/chunk-sz75fx13.js +2 -0
  250. package/bundle/{chunk-6ps30qax.js → chunk-t076hwsv.js} +2 -2
  251. package/bundle/{chunk-phpxxd48.js → chunk-t3e19wdp.js} +1 -1
  252. package/bundle/{chunk-ftvvm4r5.js → chunk-t7s475b2.js} +2 -2
  253. package/bundle/chunk-tefh2cgk.js +2 -0
  254. package/bundle/chunk-tfez99qv.js +2 -0
  255. package/bundle/chunk-tjk1hymv.js +2 -0
  256. package/bundle/{chunk-48gap82w.js → chunk-tpw1ewqn.js} +1 -1
  257. package/bundle/{chunk-fej5x648.js → chunk-tqnf1p88.js} +1 -1
  258. package/bundle/chunk-tyk97q7c.js +2 -0
  259. package/bundle/chunk-tz1sv9kt.js +3 -0
  260. package/bundle/{chunk-g7v6sp3c.js → chunk-tz60e15h.js} +2 -2
  261. package/bundle/{chunk-d30k7dpf.js → chunk-tzwm08yc.js} +1 -1
  262. package/bundle/chunk-v1098rqc.js +2 -0
  263. package/bundle/chunk-v30ezr68.js +11 -0
  264. package/bundle/{chunk-jmmtcr2r.js → chunk-v5j3ypfv.js} +1 -1
  265. package/bundle/chunk-v5wn741w.js +2 -0
  266. package/bundle/{chunk-xy8arehp.js → chunk-vamwvx0x.js} +1 -1
  267. package/bundle/{chunk-wm9nh9nb.js → chunk-vbcekkw2.js} +2 -2
  268. package/bundle/chunk-vf75j9wd.js +2 -0
  269. package/bundle/{chunk-wqk1v8t0.js → chunk-vhh80d5j.js} +2 -2
  270. package/bundle/{chunk-5bv63rqj.js → chunk-vm8htc6d.js} +1 -1
  271. package/bundle/{chunk-56wq8cqj.js → chunk-vnz9n9z0.js} +1 -1
  272. package/bundle/chunk-vp6ttkct.js +2 -0
  273. package/bundle/chunk-vpcsmwsb.js +2 -0
  274. package/bundle/{chunk-afr8m0q1.js → chunk-vrt8wd3r.js} +1 -1
  275. package/bundle/chunk-vyf77kq1.js +29 -0
  276. package/bundle/{chunk-vph4w4yy.js → chunk-w32xhz0x.js} +2 -2
  277. package/bundle/{chunk-fjftb2sz.js → chunk-wdy0fsp8.js} +2 -2
  278. package/bundle/{chunk-tbx741en.js → chunk-wkepvmgt.js} +1 -1
  279. package/bundle/{chunk-rwwvy89t.js → chunk-wp0xd7at.js} +1 -1
  280. package/bundle/{chunk-y3gy62q5.js → chunk-wpkr3vzf.js} +1 -1
  281. package/bundle/{chunk-jqj1ay7x.js → chunk-wpx2vmf5.js} +1 -1
  282. package/bundle/{chunk-35fj1sfm.js → chunk-wqkvsj5y.js} +2 -2
  283. package/bundle/{chunk-8jmb5bd4.js → chunk-wspbjh74.js} +2 -2
  284. package/bundle/{chunk-6vnqbejg.js → chunk-wzfb19t6.js} +1 -1
  285. package/bundle/chunk-x23s1s8k.js +2 -0
  286. package/bundle/{chunk-59csnjc3.js → chunk-x28chfpz.js} +2 -2
  287. package/bundle/{chunk-bhg69t69.js → chunk-xf1y0sc6.js} +2 -2
  288. package/bundle/{chunk-zsg29gba.js → chunk-xfsccqsm.js} +1 -1
  289. package/bundle/{chunk-qsme16gk.js → chunk-xmt17jd4.js} +2 -2
  290. package/bundle/{chunk-a48mx917.js → chunk-xphzr4wg.js} +2 -2
  291. package/bundle/chunk-xr6js4ek.js +2 -0
  292. package/bundle/chunk-y078gb3n.js +2 -0
  293. package/bundle/{chunk-ykpj10nz.js → chunk-y24yxs9g.js} +2 -2
  294. package/bundle/{chunk-wb47k8ah.js → chunk-y565z8n2.js} +2 -2
  295. package/bundle/{chunk-p2fte9vz.js → chunk-y7cqyeve.js} +2 -2
  296. package/bundle/{chunk-g3n465ee.js → chunk-y8bxvp3c.js} +2 -2
  297. package/bundle/{chunk-29gwtcey.js → chunk-y8tx9x5b.js} +1 -1
  298. package/bundle/{chunk-5xkp27b1.js → chunk-ya6r72ng.js} +1 -1
  299. package/bundle/chunk-yewjnqee.js +2 -0
  300. package/bundle/{chunk-29q89bge.js → chunk-yg0rs4g1.js} +2 -2
  301. package/bundle/{chunk-rwnwjm82.js → chunk-yhr7s8qm.js} +2 -2
  302. package/bundle/chunk-ykk9e9as.js +2 -0
  303. package/bundle/chunk-yqn88gjf.js +2 -0
  304. package/bundle/chunk-yrxg3dex.js +2 -0
  305. package/bundle/{chunk-eacpc64g.js → chunk-yvtbt12y.js} +2 -2
  306. package/bundle/chunk-z1xeqrgd.js +2 -0
  307. package/bundle/chunk-z5j46dem.js +2 -0
  308. package/bundle/{chunk-mrq35ftw.js → chunk-zj5snrsa.js} +2 -2
  309. package/bundle/{chunk-9cf2ktyh.js → chunk-zjfdptdj.js} +1 -1
  310. package/bundle/chunk-zq0hpja9.js +2 -0
  311. package/bundle/chunk-zqzh5hp3.js +2 -0
  312. package/bundle/{chunk-qgek59e6.js → chunk-zr1cvkpb.js} +1 -1
  313. package/bundle/{chunk-fa8pwdwv.js → chunk-zr89enb8.js} +1 -1
  314. package/bundle/{chunk-jr80q31w.js → chunk-zskjqrmc.js} +1 -1
  315. package/bundle/{chunk-92r1gw2j.js → chunk-ztjrm8m0.js} +2 -2
  316. package/bundle/chunk-zv89qwjc.js +2 -0
  317. package/bundle/index.js +3 -3
  318. package/bundle/parser.worker.js +2 -2
  319. package/bundle/worker.js +1 -1
  320. package/package.json +1 -1
  321. package/bundle/chunk-03zpnwk2.js +0 -2
  322. package/bundle/chunk-0aqdzyar.js +0 -2
  323. package/bundle/chunk-0eh3yc6e.js +0 -2
  324. package/bundle/chunk-0mh600tv.js +0 -2
  325. package/bundle/chunk-1a6q1f5n.js +0 -7
  326. package/bundle/chunk-2a5gjgvp.js +0 -2
  327. package/bundle/chunk-2phyc1c0.js +0 -2
  328. package/bundle/chunk-2pkfphgb.js +0 -2
  329. package/bundle/chunk-30wp95w1.js +0 -2
  330. package/bundle/chunk-32fpqd0n.js +0 -2
  331. package/bundle/chunk-3f2cjzb4.js +0 -2
  332. package/bundle/chunk-3qvap1kv.js +0 -2
  333. package/bundle/chunk-42hvspe7.js +0 -2
  334. package/bundle/chunk-452tk6v3.js +0 -2
  335. package/bundle/chunk-4gqb1hps.js +0 -2
  336. package/bundle/chunk-50qgz5ka.js +0 -2
  337. package/bundle/chunk-539cw9r0.js +0 -2
  338. package/bundle/chunk-5b0xyq5z.js +0 -2
  339. package/bundle/chunk-5j4nxpdy.js +0 -2
  340. package/bundle/chunk-5nxgk6hw.js +0 -2
  341. package/bundle/chunk-5qkvhr6y.js +0 -2
  342. package/bundle/chunk-6dpdkzrk.js +0 -2
  343. package/bundle/chunk-6p6m5956.js +0 -3
  344. package/bundle/chunk-705qkpra.js +0 -28
  345. package/bundle/chunk-76c400ze.js +0 -2
  346. package/bundle/chunk-7bxxc4a3.js +0 -2
  347. package/bundle/chunk-7g59hc61.js +0 -2
  348. package/bundle/chunk-7p88j56s.js +0 -2
  349. package/bundle/chunk-7r92d7v9.js +0 -14
  350. package/bundle/chunk-7trngc9g.js +0 -2
  351. package/bundle/chunk-8cebbmtf.js +0 -2
  352. package/bundle/chunk-8j1xcdmd.js +0 -2
  353. package/bundle/chunk-90r2z49k.js +0 -2
  354. package/bundle/chunk-94mjwy22.js +0 -2
  355. package/bundle/chunk-9bw6bx5c.js +0 -2
  356. package/bundle/chunk-aenrd7dk.js +0 -2
  357. package/bundle/chunk-ahmy80vb.js +0 -2
  358. package/bundle/chunk-avn12jkt.js +0 -2
  359. package/bundle/chunk-bnw744ej.js +0 -8
  360. package/bundle/chunk-brk6bge4.js +0 -3
  361. package/bundle/chunk-ce5e7j62.js +0 -2
  362. package/bundle/chunk-cw1gwjx9.js +0 -2
  363. package/bundle/chunk-czw30fjs.js +0 -2
  364. package/bundle/chunk-dtcvqrmn.js +0 -2
  365. package/bundle/chunk-dwhsvpag.js +0 -2
  366. package/bundle/chunk-e0hfpdje.js +0 -2
  367. package/bundle/chunk-e5jk67xh.js +0 -2
  368. package/bundle/chunk-eg4pq4hv.js +0 -2
  369. package/bundle/chunk-ew3yz97p.js +0 -2
  370. package/bundle/chunk-f2yfyhh8.js +0 -2
  371. package/bundle/chunk-fd8x2nb4.js +0 -2
  372. package/bundle/chunk-fv5mrdyc.js +0 -5
  373. package/bundle/chunk-fveaq0pb.js +0 -2
  374. package/bundle/chunk-gbvm6dpv.js +0 -2
  375. package/bundle/chunk-gkbx6edf.js +0 -2
  376. package/bundle/chunk-gq9hb2e8.js +0 -2
  377. package/bundle/chunk-gsez13bg.js +0 -3
  378. package/bundle/chunk-gswhjd1h.js +0 -3
  379. package/bundle/chunk-h5w91zr4.js +0 -2
  380. package/bundle/chunk-hmpb3c21.js +0 -2
  381. package/bundle/chunk-hq7s4f75.js +0 -2
  382. package/bundle/chunk-j1h64m65.js +0 -2
  383. package/bundle/chunk-j32rr7rt.js +0 -2
  384. package/bundle/chunk-j871xzr7.js +0 -2
  385. package/bundle/chunk-k1qd8ecm.js +0 -808
  386. package/bundle/chunk-kx88qekb.js +0 -2
  387. package/bundle/chunk-m4g4djss.js +0 -2
  388. package/bundle/chunk-mt2by7rx.js +0 -3
  389. package/bundle/chunk-mwkms65j.js +0 -3
  390. package/bundle/chunk-n61e0znt.js +0 -2
  391. package/bundle/chunk-ndd4cn3z.js +0 -2
  392. package/bundle/chunk-nr2j8ytn.js +0 -3
  393. package/bundle/chunk-nsw5x43k.js +0 -2
  394. package/bundle/chunk-p5b5ekhh.js +0 -2
  395. package/bundle/chunk-pf23nw4z.js +0 -2
  396. package/bundle/chunk-pw3cv89g.js +0 -2
  397. package/bundle/chunk-qwmae3vk.js +0 -5
  398. package/bundle/chunk-rdk62809.js +0 -2
  399. package/bundle/chunk-rew6r516.js +0 -2
  400. package/bundle/chunk-rjcz4kbm.js +0 -2
  401. package/bundle/chunk-rmsqb6r4.js +0 -10
  402. package/bundle/chunk-skgr9ypq.js +0 -2
  403. package/bundle/chunk-sv40pwe2.js +0 -2
  404. package/bundle/chunk-tax3ecy5.js +0 -2
  405. package/bundle/chunk-tfhpjmny.js +0 -2
  406. package/bundle/chunk-tnete6ye.js +0 -2
  407. package/bundle/chunk-tpyq7ycb.js +0 -2
  408. package/bundle/chunk-tr0rm1ka.js +0 -2
  409. package/bundle/chunk-ty14zznd.js +0 -2
  410. package/bundle/chunk-v5h5wxw5.js +0 -2
  411. package/bundle/chunk-v6141yq1.js +0 -2
  412. package/bundle/chunk-vjs69r6x.js +0 -2
  413. package/bundle/chunk-vmhar83s.js +0 -2
  414. package/bundle/chunk-vpjyk76v.js +0 -2
  415. package/bundle/chunk-vqvnw12p.js +0 -2
  416. package/bundle/chunk-w0sztk4y.js +0 -2
  417. package/bundle/chunk-w6bb320d.js +0 -2
  418. package/bundle/chunk-wqw6yjrg.js +0 -2
  419. package/bundle/chunk-ws08rxge.js +0 -2
  420. package/bundle/chunk-wwvek9zf.js +0 -3
  421. package/bundle/chunk-wz3dvc3g.js +0 -2
  422. package/bundle/chunk-x2pmqvdc.js +0 -2
  423. package/bundle/chunk-x4wfq39v.js +0 -2
  424. package/bundle/chunk-x7a3kqe5.js +0 -2
  425. package/bundle/chunk-xb22grz6.js +0 -2
  426. package/bundle/chunk-y3eeva80.js +0 -2
  427. package/bundle/chunk-yb6m08zj.js +0 -2
  428. package/bundle/chunk-ybcqkgs7.js +0 -2
  429. package/bundle/chunk-zj1jc1xt.js +0 -2
  430. package/bundle/chunk-zm0m0504.js +0 -2
  431. package/bundle/chunk-zq32jhj1.js +0 -2
  432. package/bundle/chunk-zxwjxszn.js +0 -2
package/bundle/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Uf as eD,Vf as g0}from"./chunk-13jq2ygc.js";import{Xf as s0,Yf as r0,ag as a0,bg as e0}from"./chunk-qsme16gk.js";import{eg as Ku}from"./chunk-bwadggys.js";import{as as l0}from"./chunk-8jmb5bd4.js";import{bs as d0}from"./chunk-0tm6589k.js";import"./chunk-fveaq0pb.js";import{Ds as y0,es as Lu,fs as o0,gs as k0,hs as hF}from"./chunk-gswhjd1h.js";import{Is as GF}from"./chunk-wgkcyqn1.js";import"./chunk-59csnjc3.js";import"./chunk-1bxfzd6r.js";import"./chunk-6p6m5956.js";import"./chunk-a48mx917.js";import"./chunk-3va85mbe.js";import"./chunk-w7a33cwa.js";import"./chunk-g7v6sp3c.js";import{tO as v2,uO as p2,xO as p}from"./chunk-e0vrxetq.js";var eF=p2((j3,aF)=>{aF.exports=function(u){if(u===void 0)u=2;if(u>=Error.stackTraceLimit)throw TypeError("getCallerFile(position) requires position be less then Error.stackTraceLimit but position was: `"+u+"` and Error.stackTraceLimit was: `"+Error.stackTraceLimit+"`");var F=Error.prepareStackTrace;Error.prepareStackTrace=function(C,f){return f};var E=Error().stack;if(Error.prepareStackTrace=F,E!==null&&typeof E==="object")return E[u]?E[u].getFileName():void 0}});import{notStrictEqual as m2,strictEqual as i2}from"assert";var E2={right:f2,center:$2};class XF{constructor(D){var u;this.width=D.width,this.wrap=(u=D.wrap)!==null&&u!==void 0?u:!0,this.rows=[]}span(...D){let u=this.div(...D);u.span=!0}resetOutput(){this.rows=[]}div(...D){if(D.length===0)this.div("");if(this.wrap&&this.shouldApplyLayoutDSL(...D)&&typeof D[0]==="string")return this.applyLayoutDSL(D[0]);let u=D.map((F)=>{if(typeof F==="string")return this.colFromString(F);return F});return this.rows.push(u),u}shouldApplyLayoutDSL(...D){return D.length===1&&typeof D[0]==="string"&&/[\t\n]/.test(D[0])}applyLayoutDSL(D){let u=D.split(`
2
+ import{Qf as eD,Rf as g0}from"./chunk-44685nzw.js";import{Tf as s0,Uf as r0,Yf as a0,Zf as e0}from"./chunk-xmt17jd4.js";import{ag as Ku}from"./chunk-h6kmpgak.js";import{xu as l0}from"./chunk-wspbjh74.js";import{yu as d0}from"./chunk-c5n49vrd.js";import"./chunk-bwzbcwff.js";import{Bu as Lu,Cu as o0,Du as k0,Eu as hF,_u as y0}from"./chunk-r6055kk0.js";import{dv as GF}from"./chunk-datctfgt.js";import"./chunk-x28chfpz.js";import"./chunk-mnxcykeq.js";import"./chunk-0bn86djg.js";import"./chunk-xphzr4wg.js";import"./chunk-hav9pgf3.js";import"./chunk-cshsqavb.js";import"./chunk-tz60e15h.js";import{QQ as v2,RQ as p2,UQ as p}from"./chunk-9svh74gt.js";var eF=p2((j3,aF)=>{aF.exports=function(u){if(u===void 0)u=2;if(u>=Error.stackTraceLimit)throw TypeError("getCallerFile(position) requires position be less then Error.stackTraceLimit but position was: `"+u+"` and Error.stackTraceLimit was: `"+Error.stackTraceLimit+"`");var F=Error.prepareStackTrace;Error.prepareStackTrace=function(C,f){return f};var E=Error().stack;if(Error.prepareStackTrace=F,E!==null&&typeof E==="object")return E[u]?E[u].getFileName():void 0}});import{notStrictEqual as m2,strictEqual as i2}from"assert";var E2={right:f2,center:$2};class XF{constructor(D){var u;this.width=D.width,this.wrap=(u=D.wrap)!==null&&u!==void 0?u:!0,this.rows=[]}span(...D){let u=this.div(...D);u.span=!0}resetOutput(){this.rows=[]}div(...D){if(D.length===0)this.div("");if(this.wrap&&this.shouldApplyLayoutDSL(...D)&&typeof D[0]==="string")return this.applyLayoutDSL(D[0]);let u=D.map((F)=>{if(typeof F==="string")return this.colFromString(F);return F});return this.rows.push(u),u}shouldApplyLayoutDSL(...D){return D.length===1&&typeof D[0]==="string"&&/[\t\n]/.test(D[0])}applyLayoutDSL(D){let u=D.split(`
3
3
  `).map((E)=>E.split("\t")),F=0;return u.forEach((E)=>{if(E.length>1&&JD.stringWidth(E[0])>F)F=Math.min(Math.floor(this.width*0.5),JD.stringWidth(E[0]))}),u.forEach((E)=>{this.div(...E.map((C,f)=>{return{text:C.trim(),padding:this.measurePadding(C),width:f===0&&E.length>1?F:void 0}}))}),this.rows[this.rows.length-1]}colFromString(D){return{text:D,padding:this.measurePadding(D)}}measurePadding(D){let u=JD.stripAnsi(D);return[0,u.match(/\s*$/)[0].length,0,u.match(/^\s*/)[0].length]}toString(){let D=[];return this.rows.forEach((u)=>{this.rowToString(u,D)}),D.filter((u)=>!u.hidden).map((u)=>u.text).join(`
4
4
  `)}rowToString(D,u){return this.rasterize(D).forEach((F,E)=>{let C="";F.forEach((f,$)=>{let{width:G}=D[$],J=this.negatePadding(D[$]),Y=f;if(J>JD.stringWidth(f))Y+=" ".repeat(J-JD.stringWidth(f));if(D[$].align&&D[$].align!=="left"&&this.wrap){let Q=E2[D[$].align];if(Y=Q(Y,J),JD.stringWidth(Y)<J)Y+=" ".repeat((G||0)-JD.stringWidth(Y)-1)}let U=D[$].padding||[0,0,0,0];if(U[3])C+=" ".repeat(U[3]);if(C+=ZF(D[$],Y,"| "),C+=Y,C+=ZF(D[$],Y," |"),U[1])C+=" ".repeat(U[1]);if(E===0&&u.length>0)C=this.renderInline(C,u[u.length-1])}),u.push({text:C.replace(/ +$/,""),span:D.span})}),u}renderInline(D,u){let F=D.match(/^ */),E=F?F[0].length:0,C=u.text,f=JD.stringWidth(C.trimRight());if(!u.span)return D;if(!this.wrap)return u.hidden=!0,C+D;if(E<f)return D;return u.hidden=!0,C.trimRight()+" ".repeat(E-f)+D.trimLeft()}rasterize(D){let u=[],F=this.columnWidths(D),E;return D.forEach((C,f)=>{if(C.width=F[f],this.wrap)E=JD.wrap(C.text,this.negatePadding(C),{hard:!0}).split(`
5
5
  `);else E=C.text.split(`
@@ -77,5 +77,5 @@ ${W.join(`
77
77
  `;Z.forEach((W)=>{O+=W}),u.fail(O)}};let J={};f.conflicts=function(Q,Z){if(q("<string|object> [array|string]",[Q,Z],arguments.length),typeof Q==="object")Object.keys(Q).forEach((O)=>{f.conflicts(O,Q[O])});else{if(D.global(Q),!J[Q])J[Q]=[];if(Array.isArray(Z))Z.forEach((O)=>f.conflicts(Q,O));else J[Q].push(Z)}},f.getConflicting=()=>J,f.conflicting=function(Q){if(Object.keys(Q).forEach((Z)=>{if(J[Z])J[Z].forEach((O)=>{if(O&&Q[Z]!==void 0&&Q[O]!==void 0)u.fail(E("Arguments %s and %s are mutually exclusive",Z,O))})}),D.getInternalMethods().getParserConfiguration()["strip-dashed"])Object.keys(J).forEach((Z)=>{J[Z].forEach((O)=>{if(O&&Q[F.Parser.camelCase(Z)]!==void 0&&Q[F.Parser.camelCase(O)]!==void 0)u.fail(E("Arguments %s and %s are mutually exclusive",Z,O))})})},f.recommendCommands=function(Q,Z){Z=Z.sort((A,v)=>v.length-A.length);let W=null,X=1/0;for(let A=0,v;(v=Z[A])!==void 0;A++){let n=O0(Q,v);if(n<=3&&n<X)X=n,W=v}if(W)u.fail(E("Did you mean %s?",W))},f.reset=function(Q){return $=xD($,(Z)=>!Q[Z]),J=xD(J,(Z)=>!Q[Z]),f};let Y=[];return f.freeze=function(){Y.push({implied:$,conflicting:J})},f.unfreeze=function(){let Q=Y.pop();ZD(Q,void 0,F),{implied:$,conflicting:J}=Q},f}var su=[],$u;function hu(D,u,F,E){$u=E;let C={};if(Object.prototype.hasOwnProperty.call(D,"extends")){if(typeof D.extends!=="string")return C;let f=/\.json|\..*rc$/.test(D.extends),$=null;if(!f)try{$=import.meta.resolve(D.extends)}catch(G){return D}else $=Z8(u,D.extends);M8($),su.push($),C=f?JSON.parse($u.readFileSync($,"utf8")):E.require(D.extends),delete D.extends,C=hu(C,$u.path.dirname($),F,$u)}return su=[],F?W0(C,D):Object.assign({},C,D)}function M8(D){if(su.indexOf(D)>-1)throw new DD(`Circular extended configurations: '${D}'.`)}function Z8(D,u){return $u.path.resolve(D,u)}function W0(D,u){let F={};function E(C){return C&&typeof C==="object"&&!Array.isArray(C)}Object.assign(F,D);for(let C of Object.keys(u))if(E(u[C])&&E(F[C]))F[C]=W0(D[C],u[C]);else F[C]=u[C];return F}var H=function(D,u,F,E,C){if(E==="m")throw TypeError("Private method is not writable");if(E==="a"&&!C)throw TypeError("Private accessor was defined without a setter");if(typeof u==="function"?D!==u||!C:!u.has(D))throw TypeError("Cannot write private member to an object whose class did not declare it");return E==="a"?C.call(D,F):C?C.value=F:u.set(D,F),F},B=function(D,u,F,E){if(F==="a"&&!E)throw TypeError("Private accessor was defined without a getter");if(typeof u==="function"?D!==u||!E:!u.has(D))throw TypeError("Cannot read private member from an object whose class did not declare it");return F==="m"?E:F==="a"?E.call(D):E?E.value:u.get(D)},uD,vD,zu,XD,QD,Wu,wD,mD,Uu,WD,Nu,UD,VD,OD,ND,Ru,iD,hD,K,ju,qu,TD,dD,Fu,oD,bD,Hu,P,kD,gD,yD,b,Iu,_D,r;function c0(D){return(u=[],F=D.process.cwd(),E)=>{let C=new p0(u,F,E,D);return Object.defineProperty(C,"argv",{get:()=>{return C.parse()},enumerable:!0}),C.help(),C.version(),C}}var U0=Symbol("copyDoubleDash"),N0=Symbol("copyDoubleDash"),ru=Symbol("deleteFromParserHintObject"),R0=Symbol("emitWarning"),j0=Symbol("freeze"),q0=Symbol("getDollarZero"),lD=Symbol("getParserConfiguration"),H0=Symbol("getUsageConfiguration"),au=Symbol("guessLocale"),I0=Symbol("guessVersion"),V0=Symbol("parsePositionalNumbers"),eu=Symbol("pkgUp"),tD=Symbol("populateParserHintArray"),Eu=Symbol("populateParserHintSingleValueDictionary"),DF=Symbol("populateParserHintArrayDictionary"),uF=Symbol("populateParserHintDictionary"),FF=Symbol("sanitizeKey"),EF=Symbol("setKey"),CF=Symbol("unfreeze"),_0=Symbol("validateAsync"),K0=Symbol("getCommandInstance"),L0=Symbol("getContext"),A0=Symbol("getHasOutput"),S0=Symbol("getLoggerInstance"),x0=Symbol("getParseContext"),P0=Symbol("getUsageInstance"),w0=Symbol("getValidationInstance"),Vu=Symbol("hasParseCallback"),b0=Symbol("isGlobalContext"),sD=Symbol("postProcess"),t0=Symbol("rebase"),BF=Symbol("reset"),Gu=Symbol("runYargsParserAndExecuteCommands"),fF=Symbol("runValidation"),n0=Symbol("setHasOutput"),rD=Symbol("kTrackManuallySetKeys"),X8="en_US";class p0{constructor(D=[],u,F,E){this.customScriptName=!1,this.parsed=!1,uD.set(this,void 0),vD.set(this,void 0),zu.set(this,{commands:[],fullCommands:[]}),XD.set(this,null),QD.set(this,null),Wu.set(this,"show-hidden"),wD.set(this,null),mD.set(this,!0),Uu.set(this,{}),WD.set(this,!0),Nu.set(this,[]),UD.set(this,void 0),VD.set(this,{}),OD.set(this,!1),ND.set(this,null),Ru.set(this,!0),iD.set(this,void 0),hD.set(this,""),K.set(this,void 0),ju.set(this,void 0),qu.set(this,{}),TD.set(this,null),dD.set(this,null),Fu.set(this,{}),oD.set(this,{}),bD.set(this,void 0),Hu.set(this,!1),P.set(this,void 0),kD.set(this,!1),gD.set(this,!1),yD.set(this,!1),b.set(this,void 0),Iu.set(this,{}),_D.set(this,null),r.set(this,void 0),H(this,P,E,"f"),H(this,bD,D,"f"),H(this,vD,u,"f"),H(this,ju,F,"f"),H(this,UD,new yu(this),"f"),this.$0=this[q0](),this[BF](),H(this,uD,B(this,uD,"f"),"f"),H(this,b,B(this,b,"f"),"f"),H(this,r,B(this,r,"f"),"f"),H(this,K,B(this,K,"f"),"f"),B(this,K,"f").showHiddenOpt=B(this,Wu,"f"),H(this,iD,this[N0](),"f"),B(this,P,"f").y18n.setLocale(X8)}addHelpOpt(D,u){if(q("[string|boolean] [string]",[D,u],arguments.length),B(this,ND,"f"))this[ru](B(this,ND,"f")),H(this,ND,null,"f");if(D===!1&&u===void 0)return this;return H(this,ND,typeof D==="string"?D:"help","f"),this.boolean(B(this,ND,"f")),this.describe(B(this,ND,"f"),u||B(this,b,"f").deferY18nLookup("Show help")),this}help(D,u){return this.addHelpOpt(D,u)}addShowHiddenOpt(D,u){if(q("[string|boolean] [string]",[D,u],arguments.length),D===!1&&u===void 0)return this;let F=typeof D==="string"?D:B(this,Wu,"f");return this.boolean(F),this.describe(F,u||B(this,b,"f").deferY18nLookup("Show hidden options")),B(this,K,"f").showHiddenOpt=F,this}showHidden(D,u){return this.addShowHiddenOpt(D,u)}alias(D,u){return q("<object|string|array> [string|array]",[D,u],arguments.length),this[DF](this.alias.bind(this),"alias",D,u),this}array(D){return q("<array|string>",[D],arguments.length),this[tD]("array",D),this[rD](D),this}boolean(D){return q("<array|string>",[D],arguments.length),this[tD]("boolean",D),this[rD](D),this}check(D,u){return q("<function> [boolean]",[D,u],arguments.length),this.middleware((F,E)=>{return pD(()=>{return D(F,E.getOptions())},(C)=>{if(!C)B(this,b,"f").fail(B(this,P,"f").y18n.__("Argument check failed: %s",D.toString()));else if(typeof C==="string"||C instanceof Error)B(this,b,"f").fail(C.toString(),C);return F},(C)=>{return B(this,b,"f").fail(C.message?C.message:C.toString(),C),F})},!1,u),this}choices(D,u){return q("<object|string|array> [string|array]",[D,u],arguments.length),this[DF](this.choices.bind(this),"choices",D,u),this}coerce(D,u){if(q("<object|string|array> [function]",[D,u],arguments.length),Array.isArray(D)){if(!u)throw new DD("coerce callback must be provided");for(let E of D)this.coerce(E,u);return this}else if(typeof D==="object"){for(let E of Object.keys(D))this.coerce(E,D[E]);return this}if(!u)throw new DD("coerce callback must be provided");let F=D;return B(this,K,"f").key[F]=!0,B(this,UD,"f").addCoerceMiddleware((E,C)=>{var f;let $=(f=C.getAliases()[F])!==null&&f!==void 0?f:[],G=[F,...$].filter((J)=>Object.prototype.hasOwnProperty.call(E,J));if(G.length===0)return E;return pD(()=>{return u(E[G[0]])},(J)=>{return G.forEach((Y)=>{E[Y]=J}),E},(J)=>{throw new DD(J.message)})},F),this}conflicts(D,u){return q("<string|object> [string|array]",[D,u],arguments.length),B(this,r,"f").conflicts(D,u),this}config(D="config",u,F){if(q("[object|string] [string|function] [function]",[D,u,F],arguments.length),typeof D==="object"&&!Array.isArray(D))return D=hu(D,B(this,vD,"f"),this[lD]()["deep-merge-config"]||!1,B(this,P,"f")),B(this,K,"f").configObjects=(B(this,K,"f").configObjects||[]).concat(D),this;if(typeof u==="function")F=u,u=void 0;return this.describe(D,u||B(this,b,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(D)?D:[D]).forEach((E)=>{B(this,K,"f").config[E]=F||!0}),this}completion(D,u,F){if(q("[string] [string|boolean|function] [function]",[D,u,F],arguments.length),typeof u==="function")F=u,u=void 0;if(H(this,QD,D||B(this,QD,"f")||"completion","f"),!u&&u!==!1)u="generate completion script";if(this.command(B(this,QD,"f"),u),F)B(this,XD,"f").registerFunction(F);return this}command(D,u,F,E,C,f){return q("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[D,u,F,E,C,f],arguments.length),B(this,uD,"f").addHandler(D,u,F,E,C,f),this}commands(D,u,F,E,C,f){return this.command(D,u,F,E,C,f)}commandDir(D,u){q("<string> [object]",[D,u],arguments.length);let F=B(this,ju,"f")||B(this,P,"f").require;return B(this,uD,"f").addDirectory(D,F,B(this,P,"f").getCallerFile(),u),this}count(D){return q("<array|string>",[D],arguments.length),this[tD]("count",D),this[rD](D),this}default(D,u,F){if(q("<object|string|array> [*] [string]",[D,u,F],arguments.length),F)gu(D,B(this,P,"f")),B(this,K,"f").defaultDescription[D]=F;if(typeof u==="function"){if(gu(D,B(this,P,"f")),!B(this,K,"f").defaultDescription[D])B(this,K,"f").defaultDescription[D]=B(this,b,"f").functionDescription(u);u=u.call()}return this[Eu](this.default.bind(this),"default",D,u),this}defaults(D,u,F){return this.default(D,u,F)}demandCommand(D=1,u,F,E){if(q("[number] [number|string] [string|null|undefined] [string|null|undefined]",[D,u,F,E],arguments.length),typeof u!=="number")F=u,u=1/0;return this.global("_",!1),B(this,K,"f").demandedCommands._={min:D,max:u,minMsg:F,maxMsg:E},this}demand(D,u,F){if(Array.isArray(u))u.forEach((E)=>{ZD(F,!0,B(this,P,"f")),this.demandOption(E,F)}),u=1/0;else if(typeof u!=="number")F=u,u=1/0;if(typeof D==="number")ZD(F,!0,B(this,P,"f")),this.demandCommand(D,u,F,F);else if(Array.isArray(D))D.forEach((E)=>{ZD(F,!0,B(this,P,"f")),this.demandOption(E,F)});else if(typeof F==="string")this.demandOption(D,F);else if(F===!0||typeof F>"u")this.demandOption(D);return this}demandOption(D,u){return q("<object|string|array> [string]",[D,u],arguments.length),this[Eu](this.demandOption.bind(this),"demandedOptions",D,u),this}deprecateOption(D,u){return q("<string> [string|boolean]",[D,u],arguments.length),B(this,K,"f").deprecatedOptions[D]=u,this}describe(D,u){return q("<object|string|array> [string]",[D,u],arguments.length),this[EF](D,!0),B(this,b,"f").describe(D,u),this}detectLocale(D){return q("<boolean>",[D],arguments.length),H(this,mD,D,"f"),this}env(D){if(q("[string|boolean]",[D],arguments.length),D===!1)delete B(this,K,"f").envPrefix;else B(this,K,"f").envPrefix=D||"";return this}epilogue(D){return q("<string>",[D],arguments.length),B(this,b,"f").epilog(D),this}epilog(D){return this.epilogue(D)}example(D,u){if(q("<string|array> [string]",[D,u],arguments.length),Array.isArray(D))D.forEach((F)=>this.example(...F));else B(this,b,"f").example(D,u);return this}exit(D,u){if(H(this,OD,!0,"f"),H(this,wD,u,"f"),B(this,WD,"f"))B(this,P,"f").process.exit(D)}exitProcess(D=!0){return q("[boolean]",[D],arguments.length),H(this,WD,D,"f"),this}fail(D){if(q("<function|boolean>",[D],arguments.length),typeof D==="boolean"&&D!==!1)throw new DD("Invalid first argument. Expected function or boolean 'false'");return B(this,b,"f").failFn(D),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(D,u){if(q("<array> [function]",[D,u],arguments.length),!u)return new Promise((F,E)=>{B(this,XD,"f").getCompletion(D,(C,f)=>{if(C)E(C);else F(f)})});else return B(this,XD,"f").getCompletion(D,u)}getDemandedOptions(){return q([],0),B(this,K,"f").demandedOptions}getDemandedCommands(){return q([],0),B(this,K,"f").demandedCommands}getDeprecatedOptions(){return q([],0),B(this,K,"f").deprecatedOptions}getDetectLocale(){return B(this,mD,"f")}getExitProcess(){return B(this,WD,"f")}getGroups(){return Object.assign({},B(this,VD,"f"),B(this,oD,"f"))}getHelp(){if(H(this,OD,!0,"f"),!B(this,b,"f").hasCachedHelpMessage()){if(!this.parsed){let u=this[Gu](B(this,bD,"f"),void 0,void 0,0,!0);if(y(u))return u.then(()=>{return B(this,b,"f").help()})}let D=B(this,uD,"f").runDefaultBuilderOn(this);if(y(D))return D.then(()=>{return B(this,b,"f").help()})}return Promise.resolve(B(this,b,"f").help())}getOptions(){return B(this,K,"f")}getStrict(){return B(this,kD,"f")}getStrictCommands(){return B(this,gD,"f")}getStrictOptions(){return B(this,yD,"f")}global(D,u){if(q("<string|array> [boolean]",[D,u],arguments.length),D=[].concat(D),u!==!1)B(this,K,"f").local=B(this,K,"f").local.filter((F)=>D.indexOf(F)===-1);else D.forEach((F)=>{if(!B(this,K,"f").local.includes(F))B(this,K,"f").local.push(F)});return this}group(D,u){q("<string|array> <string>",[D,u],arguments.length);let F=B(this,oD,"f")[u]||B(this,VD,"f")[u];if(B(this,oD,"f")[u])delete B(this,oD,"f")[u];let E={};return B(this,VD,"f")[u]=(F||[]).concat(D).filter((C)=>{if(E[C])return!1;return E[C]=!0}),this}hide(D){return q("<string>",[D],arguments.length),B(this,K,"f").hiddenOptions.push(D),this}implies(D,u){return q("<string|object> [number|string|array]",[D,u],arguments.length),B(this,r,"f").implies(D,u),this}locale(D){if(q("[string]",[D],arguments.length),D===void 0)return this[au](),B(this,P,"f").y18n.getLocale();return H(this,mD,!1,"f"),B(this,P,"f").y18n.setLocale(D),this}middleware(D,u,F){return B(this,UD,"f").addMiddleware(D,!!u,F)}nargs(D,u){return q("<string|object|array> [number]",[D,u],arguments.length),this[Eu](this.nargs.bind(this),"narg",D,u),this}normalize(D){return q("<array|string>",[D],arguments.length),this[tD]("normalize",D),this}number(D){return q("<array|string>",[D],arguments.length),this[tD]("number",D),this[rD](D),this}option(D,u){if(q("<string|object> [object]",[D,u],arguments.length),typeof D==="object")Object.keys(D).forEach((F)=>{this.options(F,D[F])});else{if(typeof u!=="object")u={};if(this[rD](D),B(this,_D,"f")&&(D==="version"||(u===null||u===void 0?void 0:u.alias)==="version"))this[R0](['"version" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join(`
78
78
  `),void 0,"versionWarning");if(B(this,K,"f").key[D]=!0,u.alias)this.alias(D,u.alias);let F=u.deprecate||u.deprecated;if(F)this.deprecateOption(D,F);let E=u.demand||u.required||u.require;if(E)this.demand(D,E);if(u.demandOption)this.demandOption(D,typeof u.demandOption==="string"?u.demandOption:void 0);if(u.conflicts)this.conflicts(D,u.conflicts);if("default"in u)this.default(D,u.default);if(u.implies!==void 0)this.implies(D,u.implies);if(u.nargs!==void 0)this.nargs(D,u.nargs);if(u.config)this.config(D,u.configParser);if(u.normalize)this.normalize(D);if(u.choices)this.choices(D,u.choices);if(u.coerce)this.coerce(D,u.coerce);if(u.group)this.group(D,u.group);if(u.boolean||u.type==="boolean"){if(this.boolean(D),u.alias)this.boolean(u.alias)}if(u.array||u.type==="array"){if(this.array(D),u.alias)this.array(u.alias)}if(u.number||u.type==="number"){if(this.number(D),u.alias)this.number(u.alias)}if(u.string||u.type==="string"){if(this.string(D),u.alias)this.string(u.alias)}if(u.count||u.type==="count")this.count(D);if(typeof u.global==="boolean")this.global(D,u.global);if(u.defaultDescription)B(this,K,"f").defaultDescription[D]=u.defaultDescription;if(u.skipValidation)this.skipValidation(D);let C=u.describe||u.description||u.desc,f=B(this,b,"f").getDescriptions();if(!Object.prototype.hasOwnProperty.call(f,D)||typeof C==="string")this.describe(D,C);if(u.hidden)this.hide(D);if(u.requiresArg)this.requiresArg(D)}return this}options(D,u){return this.option(D,u)}parse(D,u,F){if(q("[string|array] [function|boolean|object] [function]",[D,u,F],arguments.length),this[j0](),typeof D>"u")D=B(this,bD,"f");if(typeof u==="object")H(this,dD,u,"f"),u=F;if(typeof u==="function")H(this,TD,u,"f"),u=!1;if(!u)H(this,bD,D,"f");if(B(this,TD,"f"))H(this,WD,!1,"f");let E=this[Gu](D,!!u),C=this.parsed;if(B(this,XD,"f").setParsed(this.parsed),y(E))return E.then((f)=>{if(B(this,TD,"f"))B(this,TD,"f").call(this,B(this,wD,"f"),f,B(this,hD,"f"));return f}).catch((f)=>{if(B(this,TD,"f"))B(this,TD,"f")(f,this.parsed.argv,B(this,hD,"f"));throw f}).finally(()=>{this[CF](),this.parsed=C});else{if(B(this,TD,"f"))B(this,TD,"f").call(this,B(this,wD,"f"),E,B(this,hD,"f"));this[CF](),this.parsed=C}return E}parseAsync(D,u,F){let E=this.parse(D,u,F);return!y(E)?Promise.resolve(E):E}parseSync(D,u,F){let E=this.parse(D,u,F);if(y(E))throw new DD(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return E}parserConfiguration(D){return q("<object>",[D],arguments.length),H(this,qu,D,"f"),this}pkgConf(D,u){q("<string> [string]",[D,u],arguments.length);let F=null,E=this[eu](u||B(this,vD,"f"));if(E[D]&&typeof E[D]==="object")F=hu(E[D],u||B(this,vD,"f"),this[lD]()["deep-merge-config"]||!1,B(this,P,"f")),B(this,K,"f").configObjects=(B(this,K,"f").configObjects||[]).concat(F);return this}positional(D,u){q("<string> <object>",[D,u],arguments.length);let F=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];u=xD(u,(f,$)=>{if(f==="type"&&!["string","number","boolean"].includes($))return!1;return F.includes(f)});let E=B(this,zu,"f").fullCommands[B(this,zu,"f").fullCommands.length-1],C=E?B(this,uD,"f").cmdToParseOptions(E):{array:[],alias:{},default:{},demand:{}};return Du(C).forEach((f)=>{let $=C[f];if(Array.isArray($)){if($.indexOf(D)!==-1)u[f]=!0}else if($[D]&&!(f in u))u[f]=$[D]}),this.group(D,B(this,b,"f").getPositionalGroupName()),this.option(D,u)}recommendCommands(D=!0){return q("[boolean]",[D],arguments.length),H(this,Hu,D,"f"),this}required(D,u,F){return this.demand(D,u,F)}require(D,u,F){return this.demand(D,u,F)}requiresArg(D){if(q("<array|string|object> [number]",[D],arguments.length),typeof D==="string"&&B(this,K,"f").narg[D])return this;else this[Eu](this.requiresArg.bind(this),"narg",D,NaN);return this}showCompletionScript(D,u){return q("[string] [string]",[D,u],arguments.length),D=D||this.$0,B(this,iD,"f").log(B(this,XD,"f").generateCompletionScript(D,u||B(this,QD,"f")||"completion")),this}showHelp(D){if(q("[string|function]",[D],arguments.length),H(this,OD,!0,"f"),!B(this,b,"f").hasCachedHelpMessage()){if(!this.parsed){let F=this[Gu](B(this,bD,"f"),void 0,void 0,0,!0);if(y(F))return F.then(()=>{B(this,b,"f").showHelp(D)}),this}let u=B(this,uD,"f").runDefaultBuilderOn(this);if(y(u))return u.then(()=>{B(this,b,"f").showHelp(D)}),this}return B(this,b,"f").showHelp(D),this}scriptName(D){return this.customScriptName=!0,this.$0=D,this}showHelpOnFail(D,u){return q("[boolean|string] [string]",[D,u],arguments.length),B(this,b,"f").showHelpOnFail(D,u),this}showVersion(D){return q("[string|function]",[D],arguments.length),B(this,b,"f").showVersion(D),this}skipValidation(D){return q("<array|string>",[D],arguments.length),this[tD]("skipValidation",D),this}strict(D){return q("[boolean]",[D],arguments.length),H(this,kD,D!==!1,"f"),this}strictCommands(D){return q("[boolean]",[D],arguments.length),H(this,gD,D!==!1,"f"),this}strictOptions(D){return q("[boolean]",[D],arguments.length),H(this,yD,D!==!1,"f"),this}string(D){return q("<array|string>",[D],arguments.length),this[tD]("string",D),this[rD](D),this}terminalWidth(){return q([],0),B(this,P,"f").process.stdColumns}updateLocale(D){return this.updateStrings(D)}updateStrings(D){return q("<object>",[D],arguments.length),H(this,mD,!1,"f"),B(this,P,"f").y18n.updateLocale(D),this}usage(D,u,F,E){if(q("<string|null|undefined> [string|boolean] [function|object] [function]",[D,u,F,E],arguments.length),u!==void 0)if(ZD(D,null,B(this,P,"f")),(D||"").match(/^\$0( |$)/))return this.command(D,u,F,E);else throw new DD(".usage() description must start with $0 if being used as alias for .command()");else return B(this,b,"f").usage(D),this}usageConfiguration(D){return q("<object>",[D],arguments.length),H(this,Iu,D,"f"),this}version(D,u,F){if(q("[boolean|string] [string] [string]",[D,u,F],arguments.length),B(this,_D,"f"))this[ru](B(this,_D,"f")),B(this,b,"f").version(void 0),H(this,_D,null,"f");if(arguments.length===0)F=this[I0](),D="version";else if(arguments.length===1){if(D===!1)return this;F=D,D="version"}else if(arguments.length===2)F=u,u=void 0;return H(this,_D,typeof D==="string"?D:"version","f"),u=u||B(this,b,"f").deferY18nLookup("Show version number"),B(this,b,"f").version(F||void 0),this.boolean(B(this,_D,"f")),this.describe(B(this,_D,"f"),u),this}wrap(D){return q("<number|null|undefined>",[D],arguments.length),B(this,b,"f").wrap(D),this}[(uD=new WeakMap,vD=new WeakMap,zu=new WeakMap,XD=new WeakMap,QD=new WeakMap,Wu=new WeakMap,wD=new WeakMap,mD=new WeakMap,Uu=new WeakMap,WD=new WeakMap,Nu=new WeakMap,UD=new WeakMap,VD=new WeakMap,OD=new WeakMap,ND=new WeakMap,Ru=new WeakMap,iD=new WeakMap,hD=new WeakMap,K=new WeakMap,ju=new WeakMap,qu=new WeakMap,TD=new WeakMap,dD=new WeakMap,Fu=new WeakMap,oD=new WeakMap,bD=new WeakMap,Hu=new WeakMap,P=new WeakMap,kD=new WeakMap,gD=new WeakMap,yD=new WeakMap,b=new WeakMap,Iu=new WeakMap,_D=new WeakMap,r=new WeakMap,U0)](D){if(!D._||!D["--"])return D;D._.push.apply(D._,D["--"]);try{delete D["--"]}catch(u){}return D}[N0](){return{log:(...D)=>{if(!this[Vu]())console.log(...D);if(H(this,OD,!0,"f"),B(this,hD,"f").length)H(this,hD,B(this,hD,"f")+`
79
79
  `,"f");H(this,hD,B(this,hD,"f")+D.join(" "),"f")},error:(...D)=>{if(!this[Vu]())console.error(...D);if(H(this,OD,!0,"f"),B(this,hD,"f").length)H(this,hD,B(this,hD,"f")+`
80
- `,"f");H(this,hD,B(this,hD,"f")+D.join(" "),"f")}}}[ru](D){Du(B(this,K,"f")).forEach((u)=>{if(((E)=>E==="configObjects")(u))return;let F=B(this,K,"f")[u];if(Array.isArray(F)){if(F.includes(D))F.splice(F.indexOf(D),1)}else if(typeof F==="object")delete F[D]}),delete B(this,b,"f").getDescriptions()[D]}[R0](D,u,F){if(!B(this,Uu,"f")[F])B(this,P,"f").process.emitWarning(D,u),B(this,Uu,"f")[F]=!0}[j0](){B(this,Nu,"f").push({options:B(this,K,"f"),configObjects:B(this,K,"f").configObjects.slice(0),exitProcess:B(this,WD,"f"),groups:B(this,VD,"f"),strict:B(this,kD,"f"),strictCommands:B(this,gD,"f"),strictOptions:B(this,yD,"f"),completionCommand:B(this,QD,"f"),output:B(this,hD,"f"),exitError:B(this,wD,"f"),hasOutput:B(this,OD,"f"),parsed:this.parsed,parseFn:B(this,TD,"f"),parseContext:B(this,dD,"f")}),B(this,b,"f").freeze(),B(this,r,"f").freeze(),B(this,uD,"f").freeze(),B(this,UD,"f").freeze()}[q0](){let D="",u;if(/\b(node|iojs|electron)(\.exe)?$/.test(B(this,P,"f").process.argv()[0]))u=B(this,P,"f").process.argv().slice(1,2);else u=B(this,P,"f").process.argv().slice(0,1);if(D=u.map((F)=>{let E=this[t0](B(this,vD,"f"),F);return F.match(/^(\/|([a-zA-Z]:)?\\)/)&&E.length<F.length?E:F}).join(" ").trim(),B(this,P,"f").getEnv("_")&&B(this,P,"f").getProcessArgvBin()===B(this,P,"f").getEnv("_"))D=B(this,P,"f").getEnv("_").replace(`${B(this,P,"f").path.dirname(B(this,P,"f").process.execPath())}/`,"");return D}[lD](){return B(this,qu,"f")}[H0](){return B(this,Iu,"f")}[au](){if(!B(this,mD,"f"))return;let D=B(this,P,"f").getEnv("LC_ALL")||B(this,P,"f").getEnv("LC_MESSAGES")||B(this,P,"f").getEnv("LANG")||B(this,P,"f").getEnv("LANGUAGE")||"en_US";this.locale(D.replace(/[.:].*/,""))}[I0](){return this[eu]().version||"unknown"}[V0](D){let u=D["--"]?D["--"]:D._;for(let F=0,E;(E=u[F])!==void 0;F++)if(B(this,P,"f").Parser.looksLikeNumber(E)&&Number.isSafeInteger(Math.floor(parseFloat(`${E}`))))u[F]=Number(E);return D}[eu](D){let u=D||"*";if(B(this,Fu,"f")[u])return B(this,Fu,"f")[u];let F={};try{let E=D||B(this,P,"f").mainFilename;if(B(this,P,"f").path.extname(E))E=B(this,P,"f").path.dirname(E);let C=B(this,P,"f").findUp(E,(f,$)=>{if($.includes("package.json"))return"package.json";else return});ZD(C,void 0,B(this,P,"f")),F=JSON.parse(B(this,P,"f").readFileSync(C,"utf8"))}catch(E){}return B(this,Fu,"f")[u]=F||{},B(this,Fu,"f")[u]}[tD](D,u){u=[].concat(u),u.forEach((F)=>{F=this[FF](F),B(this,K,"f")[D].push(F)})}[Eu](D,u,F,E){this[uF](D,u,F,E,(C,f,$)=>{B(this,K,"f")[C][f]=$})}[DF](D,u,F,E){this[uF](D,u,F,E,(C,f,$)=>{B(this,K,"f")[C][f]=(B(this,K,"f")[C][f]||[]).concat($)})}[uF](D,u,F,E,C){if(Array.isArray(F))F.forEach((f)=>{D(f,E)});else if(((f)=>typeof f==="object")(F))for(let f of Du(F))D(f,F[f]);else C(u,this[FF](F),E)}[FF](D){if(D==="__proto__")return"___proto___";return D}[EF](D,u){return this[Eu](this[EF].bind(this),"key",D,u),this}[CF](){var D,u,F,E,C,f,$,G,J,Y,U,Q;let Z=B(this,Nu,"f").pop();ZD(Z,void 0,B(this,P,"f"));let O;D=this,u=this,F=this,E=this,C=this,f=this,$=this,G=this,J=this,Y=this,U=this,Q=this,{options:{set value(W){H(D,K,W,"f")}}.value,configObjects:O,exitProcess:{set value(W){H(u,WD,W,"f")}}.value,groups:{set value(W){H(F,VD,W,"f")}}.value,output:{set value(W){H(E,hD,W,"f")}}.value,exitError:{set value(W){H(C,wD,W,"f")}}.value,hasOutput:{set value(W){H(f,OD,W,"f")}}.value,parsed:this.parsed,strict:{set value(W){H($,kD,W,"f")}}.value,strictCommands:{set value(W){H(G,gD,W,"f")}}.value,strictOptions:{set value(W){H(J,yD,W,"f")}}.value,completionCommand:{set value(W){H(Y,QD,W,"f")}}.value,parseFn:{set value(W){H(U,TD,W,"f")}}.value,parseContext:{set value(W){H(Q,dD,W,"f")}}.value}=Z,B(this,K,"f").configObjects=O,B(this,b,"f").unfreeze(),B(this,r,"f").unfreeze(),B(this,uD,"f").unfreeze(),B(this,UD,"f").unfreeze()}[_0](D,u){return pD(u,(F)=>{return D(F),F})}getInternalMethods(){return{getCommandInstance:this[K0].bind(this),getContext:this[L0].bind(this),getHasOutput:this[A0].bind(this),getLoggerInstance:this[S0].bind(this),getParseContext:this[x0].bind(this),getParserConfiguration:this[lD].bind(this),getUsageConfiguration:this[H0].bind(this),getUsageInstance:this[P0].bind(this),getValidationInstance:this[w0].bind(this),hasParseCallback:this[Vu].bind(this),isGlobalContext:this[b0].bind(this),postProcess:this[sD].bind(this),reset:this[BF].bind(this),runValidation:this[fF].bind(this),runYargsParserAndExecuteCommands:this[Gu].bind(this),setHasOutput:this[n0].bind(this)}}[K0](){return B(this,uD,"f")}[L0](){return B(this,zu,"f")}[A0](){return B(this,OD,"f")}[S0](){return B(this,iD,"f")}[x0](){return B(this,dD,"f")||{}}[P0](){return B(this,b,"f")}[w0](){return B(this,r,"f")}[Vu](){return!!B(this,TD,"f")}[b0](){return B(this,Ru,"f")}[sD](D,u,F,E){if(F)return D;if(y(D))return D;if(!u)D=this[U0](D);if(this[lD]()["parse-positional-numbers"]||this[lD]()["parse-positional-numbers"]===void 0)D=this[V0](D);if(E)D=cD(D,this,B(this,UD,"f").getMiddleware(),!1);return D}[BF](D={}){H(this,K,B(this,K,"f")||{},"f");let u={};u.local=B(this,K,"f").local||[],u.configObjects=B(this,K,"f").configObjects||[];let F={};u.local.forEach((f)=>{F[f]=!0,(D[f]||[]).forEach(($)=>{F[$]=!0})}),Object.assign(B(this,oD,"f"),Object.keys(B(this,VD,"f")).reduce((f,$)=>{let G=B(this,VD,"f")[$].filter((J)=>!(J in F));if(G.length>0)f[$]=G;return f},{})),H(this,VD,{},"f");let E=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],C=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];if(E.forEach((f)=>{u[f]=(B(this,K,"f")[f]||[]).filter(($)=>!F[$])}),C.forEach((f)=>{u[f]=xD(B(this,K,"f")[f],($)=>!F[$])}),u.envPrefix=B(this,K,"f").envPrefix,H(this,K,u,"f"),H(this,b,B(this,b,"f")?B(this,b,"f").reset(F):M0(this,B(this,P,"f")),"f"),H(this,r,B(this,r,"f")?B(this,r,"f").reset(F):Y0(this,B(this,b,"f"),B(this,P,"f")),"f"),H(this,uD,B(this,uD,"f")?B(this,uD,"f").reset():h0(B(this,b,"f"),B(this,r,"f"),B(this,UD,"f"),B(this,P,"f")),"f"),!B(this,XD,"f"))H(this,XD,Q0(this,B(this,b,"f"),B(this,uD,"f"),B(this,P,"f")),"f");return B(this,UD,"f").reset(),H(this,QD,null,"f"),H(this,hD,"","f"),H(this,wD,null,"f"),H(this,OD,!1,"f"),this.parsed=!1,this}[t0](D,u){return B(this,P,"f").path.relative(D,u)}[Gu](D,u,F,E=0,C=!1){var f,$,G,J;let Y=!!F||C;D=D||B(this,bD,"f"),B(this,K,"f").__=B(this,P,"f").y18n.__,B(this,K,"f").configuration=this[lD]();let U=!!B(this,K,"f").configuration["populate--"],Q=Object.assign({},B(this,K,"f").configuration,{"populate--":!0}),Z=B(this,P,"f").Parser.detailed(D,Object.assign({},B(this,K,"f"),{configuration:{"parse-positional-numbers":!1,...Q}})),O=Object.assign(Z.argv,B(this,dD,"f")),W=void 0,X=Z.aliases,A=!1,v=!1;if(Object.keys(O).forEach((n)=>{if(n===B(this,ND,"f")&&O[n])A=!0;else if(n===B(this,_D,"f")&&O[n])v=!0}),O.$0=this.$0,this.parsed=Z,E===0)B(this,b,"f").clearCachedHelpMessage();try{if(this[au](),u)return this[sD](O,U,!!F,!1);if(B(this,ND,"f")){if([B(this,ND,"f")].concat(X[B(this,ND,"f")]||[]).filter((ED)=>ED.length>1).includes(""+O._[O._.length-1]))O._.pop(),A=!0}H(this,Ru,!1,"f");let n=B(this,uD,"f").getCommands(),GD=((f=B(this,XD,"f"))===null||f===void 0?void 0:f.completionKey)?[($=B(this,XD,"f"))===null||$===void 0?void 0:$.completionKey,...(J=this.getAliases()[(G=B(this,XD,"f"))===null||G===void 0?void 0:G.completionKey])!==null&&J!==void 0?J:[]].some((g)=>Object.prototype.hasOwnProperty.call(O,g)):!1,t=A||GD||C;if(O._.length){if(n.length){let g;for(let ED=E||0,a;O._[ED]!==void 0;ED++)if(a=String(O._[ED]),n.includes(a)&&a!==B(this,QD,"f")){let ID=B(this,uD,"f").runCommand(a,this,Z,ED+1,C,A||v||C);return this[sD](ID,U,!!F,!1)}else if(!g&&a!==B(this,QD,"f")){g=a;break}if(!B(this,uD,"f").hasDefaultCommand()&&B(this,Hu,"f")&&g&&!t)B(this,r,"f").recommendCommands(g,n)}if(B(this,QD,"f")&&O._.includes(B(this,QD,"f"))&&!GD){if(B(this,WD,"f"))PD(!0);this.showCompletionScript(),this.exit(0)}}if(B(this,uD,"f").hasDefaultCommand()&&!t){let g=B(this,uD,"f").runCommand(null,this,Z,0,C,A||v||C);return this[sD](g,U,!!F,!1)}if(GD){if(B(this,WD,"f"))PD(!0);D=[].concat(D);let g=D.slice(D.indexOf(`--${B(this,XD,"f").completionKey}`)+1);return B(this,XD,"f").getCompletion(g,(ED,a)=>{if(ED)throw new DD(ED.message);(a||[]).forEach((ID)=>{B(this,iD,"f").log(ID)}),this.exit(0)}),this[sD](O,!U,!!F,!1)}if(!B(this,OD,"f")){if(A){if(B(this,WD,"f"))PD(!0);Y=!0,this.showHelp((g)=>{B(this,iD,"f").log(g),this.exit(0)})}else if(v){if(B(this,WD,"f"))PD(!0);Y=!0,B(this,b,"f").showVersion("log"),this.exit(0)}}if(!Y&&B(this,K,"f").skipValidation.length>0)Y=Object.keys(O).some((g)=>B(this,K,"f").skipValidation.indexOf(g)>=0&&O[g]===!0);if(!Y){if(Z.error)throw new DD(Z.error.message);if(!GD){let g=this[fF](X,{},Z.error);if(!F)W=cD(O,this,B(this,UD,"f").getMiddleware(),!0);if(W=this[_0](g,W!==null&&W!==void 0?W:O),y(W)&&!F)W=W.then(()=>{return cD(O,this,B(this,UD,"f").getMiddleware(),!1)})}}}catch(n){if(n instanceof DD)B(this,b,"f").fail(n.message,n);else throw n}return this[sD](W!==null&&W!==void 0?W:O,U,!!F,!0)}[fF](D,u,F,E){let C={...this.getDemandedOptions()};return(f)=>{if(F)throw new DD(F.message);B(this,r,"f").nonOptionCount(f),B(this,r,"f").requiredArguments(f,C);let $=!1;if(B(this,gD,"f"))$=B(this,r,"f").unknownCommands(f);if(B(this,kD,"f")&&!$)B(this,r,"f").unknownArguments(f,D,u,!!E);else if(B(this,yD,"f"))B(this,r,"f").unknownArguments(f,D,{},!1,!1);B(this,r,"f").limitedChoices(f),B(this,r,"f").implications(f),B(this,r,"f").conflicting(f)}}[n0](){H(this,OD,!0,"f")}[rD](D){if(typeof D==="string")B(this,K,"f").key[D]=!0;else for(let u of D)B(this,K,"f").key[u]=!0}}function z0(D){return!!D&&typeof D.getInternalMethods==="function"}var J8=c0(ku),v0=J8;import{EOL as HD}from"os";import D2 from"path";import Q8 from"fs";function m0(D=process.env){if(!D.QITQODE_KEY&&D.QORTEX_KEY)D.QITQODE_KEY=D.QORTEX_KEY;if(!D.QLEX_API_KEY&&D.QITQODE_KEY)D.QLEX_API_KEY=D.QITQODE_KEY}m0();var i0=y0("main");l0("main");var RD=du(process.argv),u2=new Set(["--version","-v"]);if(RD.length===1&&u2.has(RD[0]))process.stdout.write(Lu+HD),process.exit();if(RD.length===2&&RD.some((D)=>u2.has(D))&&RD.includes("--verbose")){let D=process.argv[1],u=(()=>{if(!D||D.startsWith("-"))return;if(D.startsWith("/$bunfs/")||/^B:[\\/]~BUN[\\/]/.test(D))return;let E=D2.resolve(D);if(E===process.execPath)return;try{if(!Q8.statSync(E).isFile())return}catch{return}return E})(),F=[`version: ${Lu}`,`channel: ${o0}`,`commit: ${k0}`,`binary: ${process.execPath}`,...u?[`bundle: ${u}`]:[]];process.stdout.write(F.join(HD)+HD),process.exit()}var _u={acp:()=>import("./chunk-e0hha3be.js").then((D)=>D.AcpCommand),mcp:()=>import("./chunk-nas631g2.js").then((D)=>D.McpCommand),attach:()=>import("./chunk-y3eeva80.js").then((D)=>D.AttachCommand),run:()=>import("./chunk-mt2by7rx.js").then((D)=>D.RunCommand),generate:()=>import("./chunk-mwkms65j.js").then((D)=>D.GenerateCommand),debug:()=>import("./chunk-fd8x2nb4.js").then((D)=>D.DebugCommand),console:()=>import("./chunk-0eh3yc6e.js").then((D)=>D.ConsoleCommand),providers:()=>import("./chunk-1a6q1f5n.js").then((D)=>D.ProvidersCommand),agent:()=>import("./chunk-7bxxc4a3.js").then((D)=>D.AgentCommand),upgrade:()=>import("./chunk-xb22grz6.js").then((D)=>D.UpgradeCommand),uninstall:()=>import("./chunk-qwmae3vk.js").then((D)=>D.UninstallCommand),serve:()=>import("./chunk-gq9hb2e8.js").then((D)=>D.ServeCommand),models:()=>import("./chunk-tax3ecy5.js").then((D)=>D.ModelsCommand),stats:()=>import("./chunk-0mh600tv.js").then((D)=>D.StatsCommand),usage:()=>import("./chunk-9bw6bx5c.js").then((D)=>D.UsageCommand),export:()=>import("./chunk-30wp95w1.js").then((D)=>D.ExportCommand),import:()=>import("./chunk-2phyc1c0.js").then((D)=>D.ImportCommand),github:()=>import("./chunk-6vnqbejg.js").then((D)=>D.GithubCommand),pr:()=>import("./chunk-wwvek9zf.js").then((D)=>D.PrCommand),session:()=>import("./chunk-ty14zznd.js").then((D)=>D.SessionCommand),plugin:()=>import("./chunk-s5aefff0.js").then((D)=>D.PluginCommand),plug:()=>import("./chunk-s5aefff0.js").then((D)=>D.PluginCommand),auth:()=>import("./chunk-gkbx6edf.js").then((D)=>D.AuthCommand),qredits:()=>import("./chunk-rjcz4kbm.js").then((D)=>D.QreditsCommand),batch:()=>import("./chunk-dwqvcdmf.js").then((D)=>D.BatchCommand),db:()=>import("./chunk-tk4z6r09.js").then((D)=>D.DbCommand),default:()=>import("./chunk-bnw744ej.js").then((D)=>D.TuiThreadCommand)};function l(D,u,F){return{command:D,describe:u,aliases:F,handler:async()=>{}}}function $F(){return[l("acp","start ACP (Agent Client Protocol) server"),l("mcp","manage MCP (Model Context Protocol) servers"),{command:"$0 [project]",describe:"start qitqode tui",builder:(D)=>D.positional("project",{type:"string",describe:"path to start qitqode in"}).options(r0).options(a0).option("never-ask",{type:"boolean",describe:"start in never-ask mode, auto-decide without asking (permissions excluded)",default:!1}),handler:async()=>{}},l("attach <url>","attach to a running qitqode server"),l("run [message..]","run qitqode with a message"),l("generate","generate files"),l("debug","debugging and troubleshooting tools"),l("console","manage qitqode accounts"),l("providers","manage AI providers and credentials",["auth"]),l("agent","manage agents"),l("upgrade [target]","upgrade qitqode to the latest or a specific version"),l("uninstall","uninstall qitqode and remove all related files"),l("serve","starts a headless qitqode server"),l("models [provider]","list all available models"),l("stats","show token usage and cost statistics"),l("usage [sessionID]","show per-turn token usage and cost"),l("export [sessionID]","export a complete session transcript as JSON or Markdown"),l("import <file>","import session data from JSON file or URL"),l("github","manage GitHub agent"),l("pr <number>","fetch and checkout a GitHub PR branch, then run qitqode"),l("session","manage sessions"),l("plugin <module>","install plugin and update config",["plug"]),l("auth <command>","Sign in or out of Forgewise"),l("qredits <command>","Check Qredits balance and spend history"),l("batch <command>","Submit and poll async batch LLM jobs"),l("db","database tools")]}function zF(D){let u=new Set(["--log-level","--model","-m","--session","-s","--prompt","--agent","--port","--hostname","--mdns-domain","--cors"]);for(let F=0;F<D.length;F++){let E=D[F];if(E==="--")return;if(E.startsWith("-")){if(u.has(E))F++;continue}return E}}function O8(D){return D.length>0&&D.every((u)=>u==="--help"||u==="-h")}function T8(D){return D.includes("--help")||D.includes("-h")}async function Y8(D){let u=zF(D);if(D.includes("--get-yargs-completions")||u==="completion")return $F();if(O8(D))return $F();else if(u&&u in _u)return[await _u[u]()];else if(T8(D))return $F();else return[await _u.default()]}function F2(D){let u=D.trimStart();if(!u.startsWith("qitqode ")){process.stderr.write(Ku.logo()+HD+HD),process.stderr.write(u);return}process.stderr.write(D)}var Mu=s0(v0(RD)).middleware(async(D)=>{if(D.pure)process.env.QITQODE_PURE="1";let u=await import("./chunk-rew6r516.js"),{Filesystem:F}=await import("./chunk-nsw5x43k.js"),{Heap:E}=await import("./chunk-j1h64m65.js"),{Global:C}=await import("./chunk-vmhar83s.js");await u.init({print:process.argv.includes("--print-logs"),dev:hF,level:(()=>{if(D.logLevel)return D.logLevel;if(hF)return"DEBUG";return"INFO"})()}),E.start(),(await import("./chunk-539cw9r0.js")).startRefresh(),process.env.AGENT="1",process.env.QITQODE="1",process.env.QITQODE_PID=String(process.pid),u.Default.info("qitqode",{version:Lu,command:zF(RD)??"tui",process_role:i0.processRole,run_id:i0.runID});let $=D2.join(C.Path.data,"qitqode.db");if(!await F.exists($)){let{JsonMigration:G,Database:J}=await import("./chunk-vpjyk76v.js"),{drizzle:Y}=await import("./chunk-wz3dvc3g.js"),U=process.stderr.isTTY;process.stderr.write("Performing one time database migration, may take a few minutes..."+HD);let Q=-1;if(U)process.stderr.write("\x1B[?25l");try{await G.run(Y({client:J.Client().$client}),{progress:(Z)=>{let O=Math.floor(Z.current/Z.total*100);if(O===Q&&Z.current!==Z.total)return;if(Q=O,U){if(process.stderr.write(e0(O,`${Z.label.padEnd(12)} ${Z.current}/${Z.total}`)),Z.current===Z.total)process.stderr.write(`
81
- `)}else process.stderr.write(`sqlite-migration:${O}${HD}`)}})}finally{if(U)process.stderr.write("\x1B[?25h");else process.stderr.write(`sqlite-migration:done${HD}`)}process.stderr.write("Database migration complete."+HD)}if(!process.env.QITQODE_DISABLE_CLAUDE_IMPORT&&!process.env.QITQODE_CLAUDE_IMPORTED){process.env.QITQODE_CLAUDE_IMPORTED="1";let G=async()=>{try{let{ClaudeImport:U}=await import("./chunk-zq32jhj1.js");await U.run()}catch(U){u.Default.warn("claude-import failed",{e:GF(U)})}},J=zF(RD);if(!J||!(J in _u))G();else await G()}}).usage("").completion("completion","generate shell completion script");for(let D of await Y8(RD))Mu.command(D);Mu.fail((D,u)=>{if(D?.startsWith("Unknown argument")||D?.startsWith("Not enough non-option arguments")||D?.startsWith("Invalid values:")){if(u)throw u;Mu.showHelp(F2)}if(u)throw u;process.exit(1)}).strict();try{if(RD.includes("-h")||RD.includes("--help"))await Mu.parse(RD,(D,u,F)=>{if(D)throw D;if(!F)return;F2(F)});else await Mu.parse()}catch(D){let u={};if(D instanceof d0){let C=D.toObject();Object.assign(u,{...C.data})}if(D instanceof Error)Object.assign(u,{name:D.name,message:D.message,cause:D.cause?.toString(),stack:D.stack});if(D instanceof ResolveMessage)Object.assign(u,{name:D.name,message:D.message,code:D.code,specifier:D.specifier,referrer:D.referrer,position:D.position,importKind:D.importKind});let F=await import("./chunk-rew6r516.js");F.Default.error("fatal",u);let E=g0(D);if(E)Ku.error(E);if(E===void 0)Ku.error("Unexpected error, check log file at "+F.file()+" for more details"+HD),process.stderr.write(GF(D)+HD);process.exitCode=1}finally{process.exit()}
80
+ `,"f");H(this,hD,B(this,hD,"f")+D.join(" "),"f")}}}[ru](D){Du(B(this,K,"f")).forEach((u)=>{if(((E)=>E==="configObjects")(u))return;let F=B(this,K,"f")[u];if(Array.isArray(F)){if(F.includes(D))F.splice(F.indexOf(D),1)}else if(typeof F==="object")delete F[D]}),delete B(this,b,"f").getDescriptions()[D]}[R0](D,u,F){if(!B(this,Uu,"f")[F])B(this,P,"f").process.emitWarning(D,u),B(this,Uu,"f")[F]=!0}[j0](){B(this,Nu,"f").push({options:B(this,K,"f"),configObjects:B(this,K,"f").configObjects.slice(0),exitProcess:B(this,WD,"f"),groups:B(this,VD,"f"),strict:B(this,kD,"f"),strictCommands:B(this,gD,"f"),strictOptions:B(this,yD,"f"),completionCommand:B(this,QD,"f"),output:B(this,hD,"f"),exitError:B(this,wD,"f"),hasOutput:B(this,OD,"f"),parsed:this.parsed,parseFn:B(this,TD,"f"),parseContext:B(this,dD,"f")}),B(this,b,"f").freeze(),B(this,r,"f").freeze(),B(this,uD,"f").freeze(),B(this,UD,"f").freeze()}[q0](){let D="",u;if(/\b(node|iojs|electron)(\.exe)?$/.test(B(this,P,"f").process.argv()[0]))u=B(this,P,"f").process.argv().slice(1,2);else u=B(this,P,"f").process.argv().slice(0,1);if(D=u.map((F)=>{let E=this[t0](B(this,vD,"f"),F);return F.match(/^(\/|([a-zA-Z]:)?\\)/)&&E.length<F.length?E:F}).join(" ").trim(),B(this,P,"f").getEnv("_")&&B(this,P,"f").getProcessArgvBin()===B(this,P,"f").getEnv("_"))D=B(this,P,"f").getEnv("_").replace(`${B(this,P,"f").path.dirname(B(this,P,"f").process.execPath())}/`,"");return D}[lD](){return B(this,qu,"f")}[H0](){return B(this,Iu,"f")}[au](){if(!B(this,mD,"f"))return;let D=B(this,P,"f").getEnv("LC_ALL")||B(this,P,"f").getEnv("LC_MESSAGES")||B(this,P,"f").getEnv("LANG")||B(this,P,"f").getEnv("LANGUAGE")||"en_US";this.locale(D.replace(/[.:].*/,""))}[I0](){return this[eu]().version||"unknown"}[V0](D){let u=D["--"]?D["--"]:D._;for(let F=0,E;(E=u[F])!==void 0;F++)if(B(this,P,"f").Parser.looksLikeNumber(E)&&Number.isSafeInteger(Math.floor(parseFloat(`${E}`))))u[F]=Number(E);return D}[eu](D){let u=D||"*";if(B(this,Fu,"f")[u])return B(this,Fu,"f")[u];let F={};try{let E=D||B(this,P,"f").mainFilename;if(B(this,P,"f").path.extname(E))E=B(this,P,"f").path.dirname(E);let C=B(this,P,"f").findUp(E,(f,$)=>{if($.includes("package.json"))return"package.json";else return});ZD(C,void 0,B(this,P,"f")),F=JSON.parse(B(this,P,"f").readFileSync(C,"utf8"))}catch(E){}return B(this,Fu,"f")[u]=F||{},B(this,Fu,"f")[u]}[tD](D,u){u=[].concat(u),u.forEach((F)=>{F=this[FF](F),B(this,K,"f")[D].push(F)})}[Eu](D,u,F,E){this[uF](D,u,F,E,(C,f,$)=>{B(this,K,"f")[C][f]=$})}[DF](D,u,F,E){this[uF](D,u,F,E,(C,f,$)=>{B(this,K,"f")[C][f]=(B(this,K,"f")[C][f]||[]).concat($)})}[uF](D,u,F,E,C){if(Array.isArray(F))F.forEach((f)=>{D(f,E)});else if(((f)=>typeof f==="object")(F))for(let f of Du(F))D(f,F[f]);else C(u,this[FF](F),E)}[FF](D){if(D==="__proto__")return"___proto___";return D}[EF](D,u){return this[Eu](this[EF].bind(this),"key",D,u),this}[CF](){var D,u,F,E,C,f,$,G,J,Y,U,Q;let Z=B(this,Nu,"f").pop();ZD(Z,void 0,B(this,P,"f"));let O;D=this,u=this,F=this,E=this,C=this,f=this,$=this,G=this,J=this,Y=this,U=this,Q=this,{options:{set value(W){H(D,K,W,"f")}}.value,configObjects:O,exitProcess:{set value(W){H(u,WD,W,"f")}}.value,groups:{set value(W){H(F,VD,W,"f")}}.value,output:{set value(W){H(E,hD,W,"f")}}.value,exitError:{set value(W){H(C,wD,W,"f")}}.value,hasOutput:{set value(W){H(f,OD,W,"f")}}.value,parsed:this.parsed,strict:{set value(W){H($,kD,W,"f")}}.value,strictCommands:{set value(W){H(G,gD,W,"f")}}.value,strictOptions:{set value(W){H(J,yD,W,"f")}}.value,completionCommand:{set value(W){H(Y,QD,W,"f")}}.value,parseFn:{set value(W){H(U,TD,W,"f")}}.value,parseContext:{set value(W){H(Q,dD,W,"f")}}.value}=Z,B(this,K,"f").configObjects=O,B(this,b,"f").unfreeze(),B(this,r,"f").unfreeze(),B(this,uD,"f").unfreeze(),B(this,UD,"f").unfreeze()}[_0](D,u){return pD(u,(F)=>{return D(F),F})}getInternalMethods(){return{getCommandInstance:this[K0].bind(this),getContext:this[L0].bind(this),getHasOutput:this[A0].bind(this),getLoggerInstance:this[S0].bind(this),getParseContext:this[x0].bind(this),getParserConfiguration:this[lD].bind(this),getUsageConfiguration:this[H0].bind(this),getUsageInstance:this[P0].bind(this),getValidationInstance:this[w0].bind(this),hasParseCallback:this[Vu].bind(this),isGlobalContext:this[b0].bind(this),postProcess:this[sD].bind(this),reset:this[BF].bind(this),runValidation:this[fF].bind(this),runYargsParserAndExecuteCommands:this[Gu].bind(this),setHasOutput:this[n0].bind(this)}}[K0](){return B(this,uD,"f")}[L0](){return B(this,zu,"f")}[A0](){return B(this,OD,"f")}[S0](){return B(this,iD,"f")}[x0](){return B(this,dD,"f")||{}}[P0](){return B(this,b,"f")}[w0](){return B(this,r,"f")}[Vu](){return!!B(this,TD,"f")}[b0](){return B(this,Ru,"f")}[sD](D,u,F,E){if(F)return D;if(y(D))return D;if(!u)D=this[U0](D);if(this[lD]()["parse-positional-numbers"]||this[lD]()["parse-positional-numbers"]===void 0)D=this[V0](D);if(E)D=cD(D,this,B(this,UD,"f").getMiddleware(),!1);return D}[BF](D={}){H(this,K,B(this,K,"f")||{},"f");let u={};u.local=B(this,K,"f").local||[],u.configObjects=B(this,K,"f").configObjects||[];let F={};u.local.forEach((f)=>{F[f]=!0,(D[f]||[]).forEach(($)=>{F[$]=!0})}),Object.assign(B(this,oD,"f"),Object.keys(B(this,VD,"f")).reduce((f,$)=>{let G=B(this,VD,"f")[$].filter((J)=>!(J in F));if(G.length>0)f[$]=G;return f},{})),H(this,VD,{},"f");let E=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],C=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];if(E.forEach((f)=>{u[f]=(B(this,K,"f")[f]||[]).filter(($)=>!F[$])}),C.forEach((f)=>{u[f]=xD(B(this,K,"f")[f],($)=>!F[$])}),u.envPrefix=B(this,K,"f").envPrefix,H(this,K,u,"f"),H(this,b,B(this,b,"f")?B(this,b,"f").reset(F):M0(this,B(this,P,"f")),"f"),H(this,r,B(this,r,"f")?B(this,r,"f").reset(F):Y0(this,B(this,b,"f"),B(this,P,"f")),"f"),H(this,uD,B(this,uD,"f")?B(this,uD,"f").reset():h0(B(this,b,"f"),B(this,r,"f"),B(this,UD,"f"),B(this,P,"f")),"f"),!B(this,XD,"f"))H(this,XD,Q0(this,B(this,b,"f"),B(this,uD,"f"),B(this,P,"f")),"f");return B(this,UD,"f").reset(),H(this,QD,null,"f"),H(this,hD,"","f"),H(this,wD,null,"f"),H(this,OD,!1,"f"),this.parsed=!1,this}[t0](D,u){return B(this,P,"f").path.relative(D,u)}[Gu](D,u,F,E=0,C=!1){var f,$,G,J;let Y=!!F||C;D=D||B(this,bD,"f"),B(this,K,"f").__=B(this,P,"f").y18n.__,B(this,K,"f").configuration=this[lD]();let U=!!B(this,K,"f").configuration["populate--"],Q=Object.assign({},B(this,K,"f").configuration,{"populate--":!0}),Z=B(this,P,"f").Parser.detailed(D,Object.assign({},B(this,K,"f"),{configuration:{"parse-positional-numbers":!1,...Q}})),O=Object.assign(Z.argv,B(this,dD,"f")),W=void 0,X=Z.aliases,A=!1,v=!1;if(Object.keys(O).forEach((n)=>{if(n===B(this,ND,"f")&&O[n])A=!0;else if(n===B(this,_D,"f")&&O[n])v=!0}),O.$0=this.$0,this.parsed=Z,E===0)B(this,b,"f").clearCachedHelpMessage();try{if(this[au](),u)return this[sD](O,U,!!F,!1);if(B(this,ND,"f")){if([B(this,ND,"f")].concat(X[B(this,ND,"f")]||[]).filter((ED)=>ED.length>1).includes(""+O._[O._.length-1]))O._.pop(),A=!0}H(this,Ru,!1,"f");let n=B(this,uD,"f").getCommands(),GD=((f=B(this,XD,"f"))===null||f===void 0?void 0:f.completionKey)?[($=B(this,XD,"f"))===null||$===void 0?void 0:$.completionKey,...(J=this.getAliases()[(G=B(this,XD,"f"))===null||G===void 0?void 0:G.completionKey])!==null&&J!==void 0?J:[]].some((g)=>Object.prototype.hasOwnProperty.call(O,g)):!1,t=A||GD||C;if(O._.length){if(n.length){let g;for(let ED=E||0,a;O._[ED]!==void 0;ED++)if(a=String(O._[ED]),n.includes(a)&&a!==B(this,QD,"f")){let ID=B(this,uD,"f").runCommand(a,this,Z,ED+1,C,A||v||C);return this[sD](ID,U,!!F,!1)}else if(!g&&a!==B(this,QD,"f")){g=a;break}if(!B(this,uD,"f").hasDefaultCommand()&&B(this,Hu,"f")&&g&&!t)B(this,r,"f").recommendCommands(g,n)}if(B(this,QD,"f")&&O._.includes(B(this,QD,"f"))&&!GD){if(B(this,WD,"f"))PD(!0);this.showCompletionScript(),this.exit(0)}}if(B(this,uD,"f").hasDefaultCommand()&&!t){let g=B(this,uD,"f").runCommand(null,this,Z,0,C,A||v||C);return this[sD](g,U,!!F,!1)}if(GD){if(B(this,WD,"f"))PD(!0);D=[].concat(D);let g=D.slice(D.indexOf(`--${B(this,XD,"f").completionKey}`)+1);return B(this,XD,"f").getCompletion(g,(ED,a)=>{if(ED)throw new DD(ED.message);(a||[]).forEach((ID)=>{B(this,iD,"f").log(ID)}),this.exit(0)}),this[sD](O,!U,!!F,!1)}if(!B(this,OD,"f")){if(A){if(B(this,WD,"f"))PD(!0);Y=!0,this.showHelp((g)=>{B(this,iD,"f").log(g),this.exit(0)})}else if(v){if(B(this,WD,"f"))PD(!0);Y=!0,B(this,b,"f").showVersion("log"),this.exit(0)}}if(!Y&&B(this,K,"f").skipValidation.length>0)Y=Object.keys(O).some((g)=>B(this,K,"f").skipValidation.indexOf(g)>=0&&O[g]===!0);if(!Y){if(Z.error)throw new DD(Z.error.message);if(!GD){let g=this[fF](X,{},Z.error);if(!F)W=cD(O,this,B(this,UD,"f").getMiddleware(),!0);if(W=this[_0](g,W!==null&&W!==void 0?W:O),y(W)&&!F)W=W.then(()=>{return cD(O,this,B(this,UD,"f").getMiddleware(),!1)})}}}catch(n){if(n instanceof DD)B(this,b,"f").fail(n.message,n);else throw n}return this[sD](W!==null&&W!==void 0?W:O,U,!!F,!0)}[fF](D,u,F,E){let C={...this.getDemandedOptions()};return(f)=>{if(F)throw new DD(F.message);B(this,r,"f").nonOptionCount(f),B(this,r,"f").requiredArguments(f,C);let $=!1;if(B(this,gD,"f"))$=B(this,r,"f").unknownCommands(f);if(B(this,kD,"f")&&!$)B(this,r,"f").unknownArguments(f,D,u,!!E);else if(B(this,yD,"f"))B(this,r,"f").unknownArguments(f,D,{},!1,!1);B(this,r,"f").limitedChoices(f),B(this,r,"f").implications(f),B(this,r,"f").conflicting(f)}}[n0](){H(this,OD,!0,"f")}[rD](D){if(typeof D==="string")B(this,K,"f").key[D]=!0;else for(let u of D)B(this,K,"f").key[u]=!0}}function z0(D){return!!D&&typeof D.getInternalMethods==="function"}var J8=c0(ku),v0=J8;import{EOL as HD}from"os";import D2 from"path";import Q8 from"fs";function m0(D=process.env){if(!D.QITQODE_KEY&&D.QORTEX_KEY)D.QITQODE_KEY=D.QORTEX_KEY;if(!D.QLEX_API_KEY&&D.QITQODE_KEY)D.QLEX_API_KEY=D.QITQODE_KEY}m0();var i0=y0("main");l0("main");var RD=du(process.argv),u2=new Set(["--version","-v"]);if(RD.length===1&&u2.has(RD[0]))process.stdout.write(Lu+HD),process.exit();if(RD.length===2&&RD.some((D)=>u2.has(D))&&RD.includes("--verbose")){let D=process.argv[1],u=(()=>{if(!D||D.startsWith("-"))return;if(D.startsWith("/$bunfs/")||/^B:[\\/]~BUN[\\/]/.test(D))return;let E=D2.resolve(D);if(E===process.execPath)return;try{if(!Q8.statSync(E).isFile())return}catch{return}return E})(),F=[`version: ${Lu}`,`channel: ${o0}`,`commit: ${k0}`,`binary: ${process.execPath}`,...u?[`bundle: ${u}`]:[]];process.stdout.write(F.join(HD)+HD),process.exit()}var _u={acp:()=>import("./chunk-ccghr6pm.js").then((D)=>D.AcpCommand),mcp:()=>import("./chunk-hntsg7q4.js").then((D)=>D.McpCommand),attach:()=>import("./chunk-6hhv3n7c.js").then((D)=>D.AttachCommand),run:()=>import("./chunk-e5cds19n.js").then((D)=>D.RunCommand),generate:()=>import("./chunk-k4bj677f.js").then((D)=>D.GenerateCommand),debug:()=>import("./chunk-zqzh5hp3.js").then((D)=>D.DebugCommand),console:()=>import("./chunk-1h9sc0gy.js").then((D)=>D.ConsoleCommand),providers:()=>import("./chunk-m8phqgxp.js").then((D)=>D.ProvidersCommand),agent:()=>import("./chunk-vf75j9wd.js").then((D)=>D.AgentCommand),upgrade:()=>import("./chunk-486874bd.js").then((D)=>D.UpgradeCommand),uninstall:()=>import("./chunk-s3hbwksw.js").then((D)=>D.UninstallCommand),serve:()=>import("./chunk-46ewdxgh.js").then((D)=>D.ServeCommand),models:()=>import("./chunk-mq0733qh.js").then((D)=>D.ModelsCommand),stats:()=>import("./chunk-a2pd7nt5.js").then((D)=>D.StatsCommand),usage:()=>import("./chunk-tyk97q7c.js").then((D)=>D.UsageCommand),export:()=>import("./chunk-fqvrxy41.js").then((D)=>D.ExportCommand),import:()=>import("./chunk-n4fwztya.js").then((D)=>D.ImportCommand),github:()=>import("./chunk-wzfb19t6.js").then((D)=>D.GithubCommand),pr:()=>import("./chunk-pkm3w0ks.js").then((D)=>D.PrCommand),session:()=>import("./chunk-e7a50j2w.js").then((D)=>D.SessionCommand),plugin:()=>import("./chunk-9d2mtevw.js").then((D)=>D.PluginCommand),plug:()=>import("./chunk-9d2mtevw.js").then((D)=>D.PluginCommand),auth:()=>import("./chunk-v1098rqc.js").then((D)=>D.AuthCommand),qredits:()=>import("./chunk-22wa8zty.js").then((D)=>D.QreditsCommand),batch:()=>import("./chunk-n9969djm.js").then((D)=>D.BatchCommand),db:()=>import("./chunk-rkmg0gbq.js").then((D)=>D.DbCommand),default:()=>import("./chunk-e9vh8d52.js").then((D)=>D.TuiThreadCommand)};function l(D,u,F){return{command:D,describe:u,aliases:F,handler:async()=>{}}}function $F(){return[l("acp","start ACP (Agent Client Protocol) server"),l("mcp","manage MCP (Model Context Protocol) servers"),{command:"$0 [project]",describe:"start qitqode tui",builder:(D)=>D.positional("project",{type:"string",describe:"path to start qitqode in"}).options(r0).options(a0).option("never-ask",{type:"boolean",describe:"start in never-ask mode, auto-decide without asking (permissions excluded)",default:!1}),handler:async()=>{}},l("attach <url>","attach to a running qitqode server"),l("run [message..]","run qitqode with a message"),l("generate","generate files"),l("debug","debugging and troubleshooting tools"),l("console","manage qitqode accounts"),l("providers","manage AI providers and credentials",["auth"]),l("agent","manage agents"),l("upgrade [target]","upgrade qitqode to the latest or a specific version"),l("uninstall","uninstall qitqode and remove all related files"),l("serve","starts a headless qitqode server"),l("models [provider]","list all available models"),l("stats","show token usage and cost statistics"),l("usage [sessionID]","show per-turn token usage and cost"),l("export [sessionID]","export a complete session transcript as JSON or Markdown"),l("import <file>","import session data from JSON file or URL"),l("github","manage GitHub agent"),l("pr <number>","fetch and checkout a GitHub PR branch, then run qitqode"),l("session","manage sessions"),l("plugin <module>","install plugin and update config",["plug"]),l("auth <command>","Sign in or out of Forgewise"),l("qredits <command>","Check Qredits balance and spend history"),l("batch <command>","Submit and poll async batch LLM jobs"),l("db","database tools")]}function zF(D){let u=new Set(["--log-level","--model","-m","--session","-s","--prompt","--agent","--port","--hostname","--mdns-domain","--cors"]);for(let F=0;F<D.length;F++){let E=D[F];if(E==="--")return;if(E.startsWith("-")){if(u.has(E))F++;continue}return E}}function O8(D){return D.length>0&&D.every((u)=>u==="--help"||u==="-h")}function T8(D){return D.includes("--help")||D.includes("-h")}async function Y8(D){let u=zF(D);if(D.includes("--get-yargs-completions")||u==="completion")return $F();if(O8(D))return $F();else if(u&&u in _u)return[await _u[u]()];else if(T8(D))return $F();else return[await _u.default()]}function F2(D){let u=D.trimStart();if(!u.startsWith("qitqode ")){process.stderr.write(Ku.logo()+HD+HD),process.stderr.write(u);return}process.stderr.write(D)}var Mu=s0(v0(RD)).middleware(async(D)=>{if(D.pure)process.env.QITQODE_PURE="1";let u=await import("./chunk-955zj1y6.js"),{Filesystem:F}=await import("./chunk-06j0gaen.js"),{Heap:E}=await import("./chunk-2dhjehxe.js"),{Global:C}=await import("./chunk-ek3b08ed.js");await u.init({print:process.argv.includes("--print-logs"),dev:hF,level:(()=>{if(D.logLevel)return D.logLevel;if(hF)return"DEBUG";return"INFO"})()}),E.start(),(await import("./chunk-8n1cmvr7.js")).startRefresh(),process.env.AGENT="1",process.env.QITQODE="1",process.env.QITQODE_PID=String(process.pid),u.Default.info("qitqode",{version:Lu,command:zF(RD)??"tui",process_role:i0.processRole,run_id:i0.runID});let $=D2.join(C.Path.data,"qitqode.db");if(!await F.exists($)){let{JsonMigration:G,Database:J}=await import("./chunk-ng2g9kkk.js"),{drizzle:Y}=await import("./chunk-a9bkr9x4.js"),U=process.stderr.isTTY;process.stderr.write("Performing one time database migration, may take a few minutes..."+HD);let Q=-1;if(U)process.stderr.write("\x1B[?25l");try{await G.run(Y({client:J.Client().$client}),{progress:(Z)=>{let O=Math.floor(Z.current/Z.total*100);if(O===Q&&Z.current!==Z.total)return;if(Q=O,U){if(process.stderr.write(e0(O,`${Z.label.padEnd(12)} ${Z.current}/${Z.total}`)),Z.current===Z.total)process.stderr.write(`
81
+ `)}else process.stderr.write(`sqlite-migration:${O}${HD}`)}})}finally{if(U)process.stderr.write("\x1B[?25h");else process.stderr.write(`sqlite-migration:done${HD}`)}process.stderr.write("Database migration complete."+HD)}if(!process.env.QITQODE_DISABLE_CLAUDE_IMPORT&&!process.env.QITQODE_CLAUDE_IMPORTED){process.env.QITQODE_CLAUDE_IMPORTED="1";let G=async()=>{try{let{ClaudeImport:U}=await import("./chunk-ngfhfyjs.js");await U.run()}catch(U){u.Default.warn("claude-import failed",{e:GF(U)})}},J=zF(RD);if(!J||!(J in _u))G();else await G()}}).usage("").completion("completion","generate shell completion script");for(let D of await Y8(RD))Mu.command(D);Mu.fail((D,u)=>{if(D?.startsWith("Unknown argument")||D?.startsWith("Not enough non-option arguments")||D?.startsWith("Invalid values:")){if(u)throw u;Mu.showHelp(F2)}if(u)throw u;process.exit(1)}).strict();try{if(RD.includes("-h")||RD.includes("--help"))await Mu.parse(RD,(D,u,F)=>{if(D)throw D;if(!F)return;F2(F)});else await Mu.parse()}catch(D){let u={};if(D instanceof d0){let C=D.toObject();Object.assign(u,{...C.data})}if(D instanceof Error)Object.assign(u,{name:D.name,message:D.message,cause:D.cause?.toString(),stack:D.stack});if(D instanceof ResolveMessage)Object.assign(u,{name:D.name,message:D.message,code:D.code,specifier:D.specifier,referrer:D.referrer,position:D.position,importKind:D.importKind});let F=await import("./chunk-955zj1y6.js");F.Default.error("fatal",u);let E=g0(D);if(E)Ku.error(E);if(E===void 0)Ku.error("Unexpected error, check log file at "+F.file()+" for more details"+HD),process.stderr.write(GF(D)+HD);process.exitCode=1}finally{process.exit()}
@@ -1,4 +1,4 @@
1
1
  // @bun
2
- import{mO as L,nO as I,qO as D}from"./chunk-s2tc3qs0.js";import{xO as F}from"./chunk-e0vrxetq.js";import{mkdir as W}from"fs/promises";import*as M from"path";import{mkdir as R,readFile as N,writeFile as k}from"fs/promises";import*as U from"path";import{isMainThread as y}from"worker_threads";import{basename as P,join as h}from"path";import{mkdir as p,writeFile as d}from"fs/promises";import{dirname as j,isAbsolute as c,resolve as l}from"path";import{fileURLToPath as H}from"url";class w{static hashUrl(J){let K=0;for(let Z=0;Z<J.length;Z++){let Y=J.charCodeAt(Z);K=(K<<5)-K+Y,K=K&K}return Math.abs(K).toString(16)}static async downloadOrLoad(J,K,Z,Y,X=!0,V){if(J.startsWith("http://")||J.startsWith("https://")){let $;if(X){let B=this.hashUrl(J);$=V?`${V}-${B}${Y}`:`${B}${Y}`}else $=U.basename(J);let Q=U.join(K,Z,$);await R(U.dirname(Q),{recursive:!0});try{let B=await N(Q);if(B.byteLength>0)return console.log(`Loaded from cache: ${Q} (${J})`),{content:B,filePath:Q}}catch(B){}try{console.log(`Downloading from URL: ${J}`);let B=await fetch(J);if(!B.ok)return{error:`Failed to fetch from ${J}: ${B.statusText}`};let G=Buffer.from(await B.arrayBuffer());try{await k(Q,Buffer.from(G)),console.log(`Cached: ${J}`)}catch(v){console.warn(`Failed to cache: ${v}`)}return{content:G,filePath:Q}}catch(B){return{error:`Error downloading from ${J}: ${B}`}}}else try{return console.log(`Loading from local path: ${J}`),{content:await N(J),filePath:J}}catch($){return{error:`Error loading from local path ${J}: ${$}`}}}static async downloadToPath(J,K){let Z=J.startsWith("http://")||J.startsWith("https://");if(await R(U.dirname(K),{recursive:!0}),Z)try{console.log(`Downloading from URL: ${J}`);let Y=await fetch(J);if(!Y.ok)return{error:`Failed to fetch from ${J}: ${Y.statusText}`};let X=Buffer.from(await Y.arrayBuffer());return await k(K,Buffer.from(X)),console.log(`Downloaded: ${J} -> ${K}`),{content:X,filePath:K}}catch(Y){return{error:`Error downloading from ${J}: ${Y}`}}else try{console.log(`Copying from local path: ${J}`);let Y=await N(J);return await k(K,Buffer.from(Y)),{content:Y,filePath:K}}catch(Y){return{error:`Error copying from local path ${J}: ${Y}`}}}static async fetchHighlightQueries(J,K,Z){let Y=J.map((z)=>this.fetchHighlightQuery(z,K,Z));return(await Promise.all(Y)).filter((z)=>z.trim().length>0).join(`
3
- `)}static async fetchHighlightQuery(J,K,Z){let Y=await this.downloadOrLoad(J,K,"queries",".scm",!0,Z);if(Y.error)return console.error(`Error fetching highlight query from ${J}:`,Y.error),"";if(Y.content)return new TextDecoder().decode(Y.content);return""}}function f(J){return J.includes("$bunfs")||/^B:[\\/]~BUN/i.test(J)}function u(){return process.platform==="win32"?"B:\\~BUN\\root":"/$bunfs/root"}function g(J){return h(u(),P(J))}function o({onlyFirst:J=!1}={}){return new RegExp("(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]",J?void 0:"g")}var s=o();function b(J){if(typeof J!=="string")throw TypeError(`Expected a \`string\`, got \`${typeof J}\``);return J.replace(s,"")}function n(J){return J===161||J===164||J===167||J===168||J===170||J===173||J===174||J>=176&&J<=180||J>=182&&J<=186||J>=188&&J<=191||J===198||J===208||J===215||J===216||J>=222&&J<=225||J===230||J>=232&&J<=234||J===236||J===237||J===240||J===242||J===243||J>=247&&J<=250||J===252||J===254||J===257||J===273||J===275||J===283||J===294||J===295||J===299||J>=305&&J<=307||J===312||J>=319&&J<=322||J===324||J>=328&&J<=331||J===333||J===338||J===339||J===358||J===359||J===363||J===462||J===464||J===466||J===468||J===470||J===472||J===474||J===476||J===593||J===609||J===708||J===711||J>=713&&J<=715||J===717||J===720||J>=728&&J<=731||J===733||J===735||J>=768&&J<=879||J>=913&&J<=929||J>=931&&J<=937||J>=945&&J<=961||J>=963&&J<=969||J===1025||J>=1040&&J<=1103||J===1105||J===8208||J>=8211&&J<=8214||J===8216||J===8217||J===8220||J===8221||J>=8224&&J<=8226||J>=8228&&J<=8231||J===8240||J===8242||J===8243||J===8245||J===8251||J===8254||J===8308||J===8319||J>=8321&&J<=8324||J===8364||J===8451||J===8453||J===8457||J===8467||J===8470||J===8481||J===8482||J===8486||J===8491||J===8531||J===8532||J>=8539&&J<=8542||J>=8544&&J<=8555||J>=8560&&J<=8569||J===8585||J>=8592&&J<=8601||J===8632||J===8633||J===8658||J===8660||J===8679||J===8704||J===8706||J===8707||J===8711||J===8712||J===8715||J===8719||J===8721||J===8725||J===8730||J>=8733&&J<=8736||J===8739||J===8741||J>=8743&&J<=8748||J===8750||J>=8756&&J<=8759||J===8764||J===8765||J===8776||J===8780||J===8786||J===8800||J===8801||J>=8804&&J<=8807||J===8810||J===8811||J===8814||J===8815||J===8834||J===8835||J===8838||J===8839||J===8853||J===8857||J===8869||J===8895||J===8978||J>=9312&&J<=9449||J>=9451&&J<=9547||J>=9552&&J<=9587||J>=9600&&J<=9615||J>=9618&&J<=9621||J===9632||J===9633||J>=9635&&J<=9641||J===9650||J===9651||J===9654||J===9655||J===9660||J===9661||J===9664||J===9665||J>=9670&&J<=9672||J===9675||J>=9678&&J<=9681||J>=9698&&J<=9701||J===9711||J===9733||J===9734||J===9737||J===9742||J===9743||J===9756||J===9758||J===9792||J===9794||J===9824||J===9825||J>=9827&&J<=9829||J>=9831&&J<=9834||J===9836||J===9837||J===9839||J===9886||J===9887||J===9919||J>=9926&&J<=9933||J>=9935&&J<=9939||J>=9941&&J<=9953||J===9955||J===9960||J===9961||J>=9963&&J<=9969||J===9972||J>=9974&&J<=9977||J===9979||J===9980||J===9982||J===9983||J===10045||J>=10102&&J<=10111||J>=11094&&J<=11097||J>=12872&&J<=12879||J>=57344&&J<=63743||J>=65024&&J<=65039||J===65533||J>=127232&&J<=127242||J>=127248&&J<=127277||J>=127280&&J<=127337||J>=127344&&J<=127373||J===127375||J===127376||J>=127387&&J<=127404||J>=917760&&J<=917999||J>=983040&&J<=1048573||J>=1048576&&J<=1114109}function i(J){return J===12288||J>=65281&&J<=65376||J>=65504&&J<=65510}function r(J){return J>=4352&&J<=4447||J===8986||J===8987||J===9001||J===9002||J>=9193&&J<=9196||J===9200||J===9203||J===9725||J===9726||J===9748||J===9749||J>=9776&&J<=9783||J>=9800&&J<=9811||J===9855||J>=9866&&J<=9871||J===9875||J===9889||J===9898||J===9899||J===9917||J===9918||J===9924||J===9925||J===9934||J===9940||J===9962||J===9970||J===9971||J===9973||J===9978||J===9981||J===9989||J===9994||J===9995||J===10024||J===10060||J===10062||J>=10067&&J<=10069||J===10071||J>=10133&&J<=10135||J===10160||J===10175||J===11035||J===11036||J===11088||J===11093||J>=11904&&J<=11929||J>=11931&&J<=12019||J>=12032&&J<=12245||J>=12272&&J<=12287||J>=12289&&J<=12350||J>=12353&&J<=12438||J>=12441&&J<=12543||J>=12549&&J<=12591||J>=12593&&J<=12686||J>=12688&&J<=12773||J>=12783&&J<=12830||J>=12832&&J<=12871||J>=12880&&J<=42124||J>=42128&&J<=42182||J>=43360&&J<=43388||J>=44032&&J<=55203||J>=63744&&J<=64255||J>=65040&&J<=65049||J>=65072&&J<=65106||J>=65108&&J<=65126||J>=65128&&J<=65131||J>=94176&&J<=94180||J>=94192&&J<=94198||J>=94208&&J<=101589||J>=101631&&J<=101662||J>=101760&&J<=101874||J>=110576&&J<=110579||J>=110581&&J<=110587||J===110589||J===110590||J>=110592&&J<=110882||J===110898||J>=110928&&J<=110930||J===110933||J>=110948&&J<=110951||J>=110960&&J<=111355||J>=119552&&J<=119638||J>=119648&&J<=119670||J===126980||J===127183||J===127374||J>=127377&&J<=127386||J>=127488&&J<=127490||J>=127504&&J<=127547||J>=127552&&J<=127560||J===127568||J===127569||J>=127584&&J<=127589||J>=127744&&J<=127776||J>=127789&&J<=127797||J>=127799&&J<=127868||J>=127870&&J<=127891||J>=127904&&J<=127946||J>=127951&&J<=127955||J>=127968&&J<=127984||J===127988||J>=127992&&J<=128062||J===128064||J>=128066&&J<=128252||J>=128255&&J<=128317||J>=128331&&J<=128334||J>=128336&&J<=128359||J===128378||J===128405||J===128406||J===128420||J>=128507&&J<=128591||J>=128640&&J<=128709||J===128716||J>=128720&&J<=128722||J>=128725&&J<=128728||J>=128732&&J<=128735||J===128747||J===128748||J>=128756&&J<=128764||J>=128992&&J<=129003||J===129008||J>=129292&&J<=129338||J>=129340&&J<=129349||J>=129351&&J<=129535||J>=129648&&J<=129660||J>=129664&&J<=129674||J>=129678&&J<=129734||J===129736||J>=129741&&J<=129756||J>=129759&&J<=129770||J>=129775&&J<=129784||J>=131072&&J<=196605||J>=196608&&J<=262141}function a(J){if(!Number.isSafeInteger(J))throw TypeError(`Expected a code point, got \`${typeof J}\`.`)}function t(J,{ambiguousAsWide:K=!1}={}){if(a(J),i(J)||r(J)||K&&n(J))return 2;return 1}var x=()=>{return/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g},e=new Intl.Segmenter,JJ=/^\p{Default_Ignorable_Code_Point}$/u;function KJ(J,K={}){if(typeof J!=="string"||J.length===0)return 0;let{ambiguousIsNarrow:Z=!0,countAnsiEscapeCodes:Y=!1}=K;if(!Y)J=b(J);if(J.length===0)return 0;let X=0,V={ambiguousAsWide:!Z};for(let{segment:z}of e.segment(J)){let $=z.codePointAt(0);if($<=31||$>=127&&$<=159)continue;if($>=8203&&$<=8207||$===65279)continue;if($>=768&&$<=879||$>=6832&&$<=6911||$>=7616&&$<=7679||$>=8400&&$<=8447||$>=65056&&$<=65071)continue;if($>=55296&&$<=57343)continue;if($>=65024&&$<=65039)continue;if(JJ.test(z))continue;if(x().test(z)){X+=2;continue}X+=t($,V)}return X}var YJ=new TextEncoder,C=globalThis.Bun,AJ=C?.sleep??$J,vJ=C?.stringWidth??KJ,OJ=C?.stripANSI??b,MJ=C?.write??XJ;async function ZJ(J,K,Z){if(!C){let X=typeof K==="function"?K():K;return H(X instanceof URL?X:new URL(X,Z))}let Y=(await J()).default;if(Y.startsWith("file:"))return H(Y);if(c(Y))return Y;return l(j(H(Z)),Y)}function $J(J){let K=J instanceof Date?J.getTime()-Date.now():J;return new Promise((Z)=>setTimeout(Z,K))}async function XJ(J,K,Z){let Y=J instanceof URL?H(J):J;if(Z?.createPath)await p(j(Y),{recursive:!0});let X=typeof K==="string"?YJ.encode(K):new Uint8Array(K.buffer,K.byteOffset,K.byteLength);return await d(Y,X,{mode:Z?.mode}),X.byteLength}var A=globalThis;class S{bufferParsers=new Map;filetypeParserOptions=new Map;filetypeAliases=new Map;filetypeParsers=new Map;filetypeParserPromises=new Map;reusableParsers=new Map;reusableParserPromises=new Map;initializePromise;performance;dataPath;tsDataPath;initialized=!1;constructor(){this.performance={averageParseTime:0,parseTimes:[],averageQueryTime:0,queryTimes:[]}}async fetchQueries(J,K){if(!this.tsDataPath)return"";return w.fetchHighlightQueries(J,this.tsDataPath,K)}async initialize({dataPath:J}){if(this.initializePromise)return this.initializePromise;return this.initializePromise=(async()=>{this.dataPath=J,this.tsDataPath=M.join(J,"tree-sitter"),await W(M.join(this.tsDataPath,"languages"),{recursive:!0}),await W(M.join(this.tsDataPath,"queries"),{recursive:!0});let K=await ZJ(()=>import("./chunk-f2yfyhh8.js",{with:{type:"wasm"}}),()=>import.meta.resolve("web-tree-sitter/tree-sitter.wasm"),import.meta.url);if(f(K))K=g(M.parse(K).base);await D.init({locateFile(){return K}}),this.initialized=!0})(),this.initializePromise}addFiletypeParser(J){let K=this.filetypeParserOptions.get(J.filetype)?.aliases??[];for(let Y of K)if(this.filetypeAliases.get(Y)===J.filetype)this.filetypeAliases.delete(Y);let Z=[...new Set((J.aliases??[]).filter((Y)=>Y!==J.filetype))];this.filetypeAliases.delete(J.filetype),this.filetypeParserOptions.set(J.filetype,{...J,aliases:Z});for(let Y of Z)this.filetypeAliases.set(Y,J.filetype);this.invalidateParserCaches(J.filetype)}resolveCanonicalFiletype(J){if(this.filetypeParserOptions.has(J))return J;return this.filetypeAliases.get(J)??J}invalidateParserCaches(J){this.filetypeParsers.delete(J),this.filetypeParserPromises.delete(J);let K=this.reusableParsers.get(J);if(K)K.parser.delete(),this.reusableParsers.delete(J);this.reusableParserPromises.delete(J)}async createQueries(J,K){try{let Z=await this.fetchQueries(J.queries.highlights,J.filetype);if(!Z){console.error("Failed to fetch highlight queries for:",J.filetype);return}let X={highlights:new L(K,Z)};if(J.queries.injections&&J.queries.injections.length>0){let V=await this.fetchQueries(J.queries.injections,J.filetype);if(V)X.injections=new L(K,V)}return X}catch(Z){console.error("Error creating queries for",J.filetype,J.queries),console.error(Z);return}}async loadLanguage(J){if(!this.initialized||!this.tsDataPath)return;let K=await w.downloadOrLoad(J,this.tsDataPath,"languages",".wasm",!1);if(K.error){console.error(`Error loading language ${J}:`,K.error);return}if(!K.filePath)return;let Z=K.filePath.replaceAll("\\","/");try{return await I.load(Z)}catch(Y){console.error(`Error loading language from ${Z}:`,Y);return}}async resolveFiletypeParser(J){let K=this.resolveCanonicalFiletype(J);if(this.filetypeParsers.has(K))return this.filetypeParsers.get(K);if(this.filetypeParserPromises.has(K))return this.filetypeParserPromises.get(K);let Z=this.loadFiletypeParser(K);this.filetypeParserPromises.set(K,Z);try{let Y=await Z;if(Y)this.filetypeParsers.set(K,Y);return Y}finally{this.filetypeParserPromises.delete(K)}}async loadFiletypeParser(J){let K=this.filetypeParserOptions.get(J);if(!K)return;let Z=await this.loadLanguage(K.wasm);if(!Z)return;let Y=await this.createQueries(K,Z);if(!Y){console.error("Failed to create queries for:",J);return}return{...K,queries:Y,language:Z}}async preloadParser(J){return this.resolveFiletypeParser(J)}async getReusableParser(J){let K=this.resolveCanonicalFiletype(J);if(this.reusableParsers.has(K))return this.reusableParsers.get(K);if(this.reusableParserPromises.has(K))return this.reusableParserPromises.get(K);let Z=this.createReusableParser(K);this.reusableParserPromises.set(K,Z);try{let Y=await Z;if(Y)this.reusableParsers.set(K,Y);return Y}finally{this.reusableParserPromises.delete(K)}}async createReusableParser(J){let K=await this.resolveFiletypeParser(J);if(!K)return;let Z=new D;return Z.setLanguage(K.language),{parser:Z,filetypeParser:K,queries:K.queries}}async handleInitializeParser(J,K,Z,Y,X){let V=await this.resolveFiletypeParser(Y);if(!V){A.postMessage({type:"PARSER_INIT_RESPONSE",bufferId:J,messageId:X,hasParser:!1,warning:`No parser available for filetype ${Y}`});return}let z=new D;z.setLanguage(V.language);let $=z.parse(Z);if(!$){A.postMessage({type:"PARSER_INIT_RESPONSE",bufferId:J,messageId:X,hasParser:!1,error:"Failed to parse buffer"});return}let Q={parser:z,tree:$,queries:V.queries,filetype:Y,content:Z,injectionMapping:V.injectionMapping};this.bufferParsers.set(J,Q),A.postMessage({type:"PARSER_INIT_RESPONSE",bufferId:J,messageId:X,hasParser:!0});let B=await this.initialQuery(Q);A.postMessage({type:"HIGHLIGHT_RESPONSE",bufferId:J,version:K,...B})}async initialQuery(J){let Z=J.queries.highlights.captures(J.tree.rootNode),Y=new Map;if(J.queries.injections){let X=await this.processInjections(J);Z.push(...X.captures),Y=X.injectionRanges}return this.getHighlights(J,Z,Y)}getNodeText(J,K){return K.substring(J.startIndex,J.endIndex)}async processInjections(J){let K=[],Z=new Map;if(!J.queries.injections)return{captures:K,injectionRanges:Z};let Y=J.content,X=J.queries.injections.captures(J.tree.rootNode),V=new Map,z=J.injectionMapping;for(let $ of X){let Q=$.name;if(Q==="injection.content"||Q.includes("injection")){let B=$.node.type,G;if(z?.nodeTypes&&z.nodeTypes[B])G=z.nodeTypes[B];else if(B==="code_fence_content"){let v=$.node.parent;if(v){let O=v.children.find((E)=>E.type==="info_string");if(O){let E=O.children.find((q)=>q.type==="language");if(E){let q=this.getNodeText(E,Y);if(z?.infoStringMap&&z.infoStringMap[q])G=z.infoStringMap[q];else G=q}}}}if(G){if(!V.has(G))V.set(G,[]);V.get(G).push({node:$.node,name:$.name})}}}for(let[$,Q]of V.entries()){let B=await this.getReusableParser($);if(!B){console.warn(`No parser found for injection language: ${$}`);continue}if(!Z.has($))Z.set($,[]);let G=B.parser;for(let{node:v}of Q)try{Z.get($).push({start:v.startIndex,end:v.endIndex});let O=this.getNodeText(v,Y),E=G.parse(O);if(E){let q=B.queries.highlights.captures(E.rootNode);for(let _ of q){let T={name:_.name,patternIndex:_.patternIndex,_injectedQuery:B.queries.highlights,node:{..._.node,startPosition:{row:_.node.startPosition.row+v.startPosition.row,column:_.node.startPosition.row===0?_.node.startPosition.column+v.startPosition.column:_.node.startPosition.column},endPosition:{row:_.node.endPosition.row+v.startPosition.row,column:_.node.endPosition.row===0?_.node.endPosition.column+v.startPosition.column:_.node.endPosition.column},startIndex:_.node.startIndex+v.startIndex,endIndex:_.node.endIndex+v.startIndex}};K.push(T)}E.delete()}}catch(O){console.error(`Error processing injection for language ${$}:`,O)}}return{captures:K,injectionRanges:Z}}editToRange(J){return{startPosition:{column:J.startPosition.column,row:J.startPosition.row},endPosition:{column:J.newEndPosition.column,row:J.newEndPosition.row},startIndex:J.startIndex,endIndex:J.newEndIndex}}async handleEdits(J,K,Z){let Y=this.bufferParsers.get(J);if(!Y)return{warning:"No parser state found for buffer"};Y.content=K;for(let q of Z)Y.tree.edit(q);let X=performance.now(),V=Y.parser.parse(K,Y.tree),$=performance.now()-X;if(this.performance.parseTimes.push($),this.performance.parseTimes.length>10)this.performance.parseTimes.shift();if(this.performance.averageParseTime=this.performance.parseTimes.reduce((q,_)=>q+_,0)/this.performance.parseTimes.length,!V)return{error:"Failed to parse buffer"};let Q=Y.tree.getChangedRanges(V);Y.tree=V;let B=performance.now(),G=[];if(Q.length===0)Z.forEach((q)=>{let _=this.editToRange(q);Q.push(_)});for(let q of Q){let _=Y.tree.rootNode.descendantForPosition(q.startPosition,q.endPosition);if(!_)continue;if(_.equals(Y.tree.rootNode)){let m=Y.queries.highlights.captures(_,{startIndex:q.startIndex-100,endIndex:q.endIndex+1000});G.push(...m);continue}while(_&&!this.nodeContainsRange(_,q))_=_.parent;if(!_)_=Y.tree.rootNode;let T=Y.queries.highlights.captures(_);G.push(...T)}let v=new Map;if(Y.queries.injections){let q=await this.processInjections(Y);G.push(...q.captures),v=q.injectionRanges}let E=performance.now()-B;if(this.performance.queryTimes.push(E),this.performance.queryTimes.length>10)this.performance.queryTimes.shift();return this.performance.averageQueryTime=this.performance.queryTimes.reduce((q,_)=>q+_,0)/this.performance.queryTimes.length,this.getHighlights(Y,G,v)}nodeContainsRange(J,K){return J.startPosition.row<=K.startPosition.row&&J.endPosition.row>=K.endPosition.row&&(J.startPosition.row<K.startPosition.row||J.startPosition.column<=K.startPosition.column)&&(J.endPosition.row>K.endPosition.row||J.endPosition.column>=K.endPosition.column)}getHighlights(J,K,Z){let Y=new Map,X=new Map;for(let V of K){let z=V.node,$=z.startPosition.row,Q=z.endPosition.row,B={startCol:z.startPosition.column,endCol:z.endPosition.column,group:V.name};if(!Y.has($))Y.set($,new Map),X.set($,new Map);if(Y.get($)?.has(z.id))X.get($)?.set(z.id,Y.get($)?.get(z.id));if(Y.get($)?.set(z.id,B),$!==Q)for(let G=$+1;G<=Q;G++){if(!Y.has(G))Y.set(G,new Map);let v={startCol:0,endCol:z.endPosition.column,group:V.name};Y.get(G)?.set(z.id,v)}}return{highlights:Array.from(Y.entries()).map(([V,z])=>({line:V,highlights:Array.from(z.values()),droppedHighlights:X.get(V)?Array.from(X.get(V).values()):[]}))}}getSimpleHighlights(J,K){let Z=[],Y=[];for(let[X,V]of K.entries())for(let z of V)Y.push({...z,lang:X});for(let X of J){let V=X.node,z=!1,$,Q=!1;for(let q of Y)if(V.startIndex>=q.start&&V.endIndex<=q.end){z=!0,$=q.lang;break}else if(V.startIndex<=q.start&&V.endIndex>=q.end){Q=!0;break}let G=X._injectedQuery?.setProperties?.[X.patternIndex],v=G?.conceal??X.setProperties?.conceal,O=G?.conceal_lines??X.setProperties?.conceal_lines,E={};if(z&&$)E.isInjection=!0,E.injectionLang=$;if(Q)E.containsInjection=!0;if(v!==void 0)E.conceal=v;if(O!==void 0)E.concealLines=O;if(Object.keys(E).length>0)Z.push([V.startIndex,V.endIndex,X.name,E]);else Z.push([V.startIndex,V.endIndex,X.name])}return Z.sort((X,V)=>X[0]-V[0]),Z}async handleResetBuffer(J,K,Z){let Y=this.bufferParsers.get(J);if(!Y)return{warning:"No parser state found for buffer"};Y.content=Z;let X=Y.parser.parse(Z);if(!X)return{error:"Failed to parse buffer during reset"};Y.tree=X;let V=Y.queries.highlights.captures(Y.tree.rootNode),z=new Map;if(Y.queries.injections){let $=await this.processInjections(Y);V.push(...$.captures),z=$.injectionRanges}return this.getHighlights(Y,V,z)}disposeBuffer(J){let K=this.bufferParsers.get(J);if(!K)return;K.tree.delete(),K.parser.delete(),this.bufferParsers.delete(J)}async handleOneShotHighlight(J,K,Z){let Y=await this.getReusableParser(K);if(!Y){A.postMessage({type:"ONESHOT_HIGHLIGHT_RESPONSE",messageId:Z,hasParser:!1,warning:`No parser available for filetype ${K}`});return}let X=K==="markdown"&&J.endsWith("```")?J+`
2
+ import{JQ as L,KQ as I,NQ as D}from"./chunk-0tya4pqb.js";import{UQ as F}from"./chunk-9svh74gt.js";import{mkdir as W}from"fs/promises";import*as M from"path";import{mkdir as R,readFile as N,writeFile as k}from"fs/promises";import*as U from"path";import{isMainThread as y}from"worker_threads";import{basename as P,join as h}from"path";import{mkdir as p,writeFile as d}from"fs/promises";import{dirname as j,isAbsolute as c,resolve as l}from"path";import{fileURLToPath as H}from"url";class w{static hashUrl(J){let K=0;for(let Z=0;Z<J.length;Z++){let Y=J.charCodeAt(Z);K=(K<<5)-K+Y,K=K&K}return Math.abs(K).toString(16)}static async downloadOrLoad(J,K,Z,Y,X=!0,V){if(J.startsWith("http://")||J.startsWith("https://")){let $;if(X){let B=this.hashUrl(J);$=V?`${V}-${B}${Y}`:`${B}${Y}`}else $=U.basename(J);let Q=U.join(K,Z,$);await R(U.dirname(Q),{recursive:!0});try{let B=await N(Q);if(B.byteLength>0)return console.log(`Loaded from cache: ${Q} (${J})`),{content:B,filePath:Q}}catch(B){}try{console.log(`Downloading from URL: ${J}`);let B=await fetch(J);if(!B.ok)return{error:`Failed to fetch from ${J}: ${B.statusText}`};let G=Buffer.from(await B.arrayBuffer());try{await k(Q,Buffer.from(G)),console.log(`Cached: ${J}`)}catch(v){console.warn(`Failed to cache: ${v}`)}return{content:G,filePath:Q}}catch(B){return{error:`Error downloading from ${J}: ${B}`}}}else try{return console.log(`Loading from local path: ${J}`),{content:await N(J),filePath:J}}catch($){return{error:`Error loading from local path ${J}: ${$}`}}}static async downloadToPath(J,K){let Z=J.startsWith("http://")||J.startsWith("https://");if(await R(U.dirname(K),{recursive:!0}),Z)try{console.log(`Downloading from URL: ${J}`);let Y=await fetch(J);if(!Y.ok)return{error:`Failed to fetch from ${J}: ${Y.statusText}`};let X=Buffer.from(await Y.arrayBuffer());return await k(K,Buffer.from(X)),console.log(`Downloaded: ${J} -> ${K}`),{content:X,filePath:K}}catch(Y){return{error:`Error downloading from ${J}: ${Y}`}}else try{console.log(`Copying from local path: ${J}`);let Y=await N(J);return await k(K,Buffer.from(Y)),{content:Y,filePath:K}}catch(Y){return{error:`Error copying from local path ${J}: ${Y}`}}}static async fetchHighlightQueries(J,K,Z){let Y=J.map((z)=>this.fetchHighlightQuery(z,K,Z));return(await Promise.all(Y)).filter((z)=>z.trim().length>0).join(`
3
+ `)}static async fetchHighlightQuery(J,K,Z){let Y=await this.downloadOrLoad(J,K,"queries",".scm",!0,Z);if(Y.error)return console.error(`Error fetching highlight query from ${J}:`,Y.error),"";if(Y.content)return new TextDecoder().decode(Y.content);return""}}function f(J){return J.includes("$bunfs")||/^B:[\\/]~BUN/i.test(J)}function u(){return process.platform==="win32"?"B:\\~BUN\\root":"/$bunfs/root"}function g(J){return h(u(),P(J))}function o({onlyFirst:J=!1}={}){return new RegExp("(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]",J?void 0:"g")}var s=o();function b(J){if(typeof J!=="string")throw TypeError(`Expected a \`string\`, got \`${typeof J}\``);return J.replace(s,"")}function n(J){return J===161||J===164||J===167||J===168||J===170||J===173||J===174||J>=176&&J<=180||J>=182&&J<=186||J>=188&&J<=191||J===198||J===208||J===215||J===216||J>=222&&J<=225||J===230||J>=232&&J<=234||J===236||J===237||J===240||J===242||J===243||J>=247&&J<=250||J===252||J===254||J===257||J===273||J===275||J===283||J===294||J===295||J===299||J>=305&&J<=307||J===312||J>=319&&J<=322||J===324||J>=328&&J<=331||J===333||J===338||J===339||J===358||J===359||J===363||J===462||J===464||J===466||J===468||J===470||J===472||J===474||J===476||J===593||J===609||J===708||J===711||J>=713&&J<=715||J===717||J===720||J>=728&&J<=731||J===733||J===735||J>=768&&J<=879||J>=913&&J<=929||J>=931&&J<=937||J>=945&&J<=961||J>=963&&J<=969||J===1025||J>=1040&&J<=1103||J===1105||J===8208||J>=8211&&J<=8214||J===8216||J===8217||J===8220||J===8221||J>=8224&&J<=8226||J>=8228&&J<=8231||J===8240||J===8242||J===8243||J===8245||J===8251||J===8254||J===8308||J===8319||J>=8321&&J<=8324||J===8364||J===8451||J===8453||J===8457||J===8467||J===8470||J===8481||J===8482||J===8486||J===8491||J===8531||J===8532||J>=8539&&J<=8542||J>=8544&&J<=8555||J>=8560&&J<=8569||J===8585||J>=8592&&J<=8601||J===8632||J===8633||J===8658||J===8660||J===8679||J===8704||J===8706||J===8707||J===8711||J===8712||J===8715||J===8719||J===8721||J===8725||J===8730||J>=8733&&J<=8736||J===8739||J===8741||J>=8743&&J<=8748||J===8750||J>=8756&&J<=8759||J===8764||J===8765||J===8776||J===8780||J===8786||J===8800||J===8801||J>=8804&&J<=8807||J===8810||J===8811||J===8814||J===8815||J===8834||J===8835||J===8838||J===8839||J===8853||J===8857||J===8869||J===8895||J===8978||J>=9312&&J<=9449||J>=9451&&J<=9547||J>=9552&&J<=9587||J>=9600&&J<=9615||J>=9618&&J<=9621||J===9632||J===9633||J>=9635&&J<=9641||J===9650||J===9651||J===9654||J===9655||J===9660||J===9661||J===9664||J===9665||J>=9670&&J<=9672||J===9675||J>=9678&&J<=9681||J>=9698&&J<=9701||J===9711||J===9733||J===9734||J===9737||J===9742||J===9743||J===9756||J===9758||J===9792||J===9794||J===9824||J===9825||J>=9827&&J<=9829||J>=9831&&J<=9834||J===9836||J===9837||J===9839||J===9886||J===9887||J===9919||J>=9926&&J<=9933||J>=9935&&J<=9939||J>=9941&&J<=9953||J===9955||J===9960||J===9961||J>=9963&&J<=9969||J===9972||J>=9974&&J<=9977||J===9979||J===9980||J===9982||J===9983||J===10045||J>=10102&&J<=10111||J>=11094&&J<=11097||J>=12872&&J<=12879||J>=57344&&J<=63743||J>=65024&&J<=65039||J===65533||J>=127232&&J<=127242||J>=127248&&J<=127277||J>=127280&&J<=127337||J>=127344&&J<=127373||J===127375||J===127376||J>=127387&&J<=127404||J>=917760&&J<=917999||J>=983040&&J<=1048573||J>=1048576&&J<=1114109}function i(J){return J===12288||J>=65281&&J<=65376||J>=65504&&J<=65510}function r(J){return J>=4352&&J<=4447||J===8986||J===8987||J===9001||J===9002||J>=9193&&J<=9196||J===9200||J===9203||J===9725||J===9726||J===9748||J===9749||J>=9776&&J<=9783||J>=9800&&J<=9811||J===9855||J>=9866&&J<=9871||J===9875||J===9889||J===9898||J===9899||J===9917||J===9918||J===9924||J===9925||J===9934||J===9940||J===9962||J===9970||J===9971||J===9973||J===9978||J===9981||J===9989||J===9994||J===9995||J===10024||J===10060||J===10062||J>=10067&&J<=10069||J===10071||J>=10133&&J<=10135||J===10160||J===10175||J===11035||J===11036||J===11088||J===11093||J>=11904&&J<=11929||J>=11931&&J<=12019||J>=12032&&J<=12245||J>=12272&&J<=12287||J>=12289&&J<=12350||J>=12353&&J<=12438||J>=12441&&J<=12543||J>=12549&&J<=12591||J>=12593&&J<=12686||J>=12688&&J<=12773||J>=12783&&J<=12830||J>=12832&&J<=12871||J>=12880&&J<=42124||J>=42128&&J<=42182||J>=43360&&J<=43388||J>=44032&&J<=55203||J>=63744&&J<=64255||J>=65040&&J<=65049||J>=65072&&J<=65106||J>=65108&&J<=65126||J>=65128&&J<=65131||J>=94176&&J<=94180||J>=94192&&J<=94198||J>=94208&&J<=101589||J>=101631&&J<=101662||J>=101760&&J<=101874||J>=110576&&J<=110579||J>=110581&&J<=110587||J===110589||J===110590||J>=110592&&J<=110882||J===110898||J>=110928&&J<=110930||J===110933||J>=110948&&J<=110951||J>=110960&&J<=111355||J>=119552&&J<=119638||J>=119648&&J<=119670||J===126980||J===127183||J===127374||J>=127377&&J<=127386||J>=127488&&J<=127490||J>=127504&&J<=127547||J>=127552&&J<=127560||J===127568||J===127569||J>=127584&&J<=127589||J>=127744&&J<=127776||J>=127789&&J<=127797||J>=127799&&J<=127868||J>=127870&&J<=127891||J>=127904&&J<=127946||J>=127951&&J<=127955||J>=127968&&J<=127984||J===127988||J>=127992&&J<=128062||J===128064||J>=128066&&J<=128252||J>=128255&&J<=128317||J>=128331&&J<=128334||J>=128336&&J<=128359||J===128378||J===128405||J===128406||J===128420||J>=128507&&J<=128591||J>=128640&&J<=128709||J===128716||J>=128720&&J<=128722||J>=128725&&J<=128728||J>=128732&&J<=128735||J===128747||J===128748||J>=128756&&J<=128764||J>=128992&&J<=129003||J===129008||J>=129292&&J<=129338||J>=129340&&J<=129349||J>=129351&&J<=129535||J>=129648&&J<=129660||J>=129664&&J<=129674||J>=129678&&J<=129734||J===129736||J>=129741&&J<=129756||J>=129759&&J<=129770||J>=129775&&J<=129784||J>=131072&&J<=196605||J>=196608&&J<=262141}function a(J){if(!Number.isSafeInteger(J))throw TypeError(`Expected a code point, got \`${typeof J}\`.`)}function t(J,{ambiguousAsWide:K=!1}={}){if(a(J),i(J)||r(J)||K&&n(J))return 2;return 1}var x=()=>{return/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g},e=new Intl.Segmenter,JJ=/^\p{Default_Ignorable_Code_Point}$/u;function KJ(J,K={}){if(typeof J!=="string"||J.length===0)return 0;let{ambiguousIsNarrow:Z=!0,countAnsiEscapeCodes:Y=!1}=K;if(!Y)J=b(J);if(J.length===0)return 0;let X=0,V={ambiguousAsWide:!Z};for(let{segment:z}of e.segment(J)){let $=z.codePointAt(0);if($<=31||$>=127&&$<=159)continue;if($>=8203&&$<=8207||$===65279)continue;if($>=768&&$<=879||$>=6832&&$<=6911||$>=7616&&$<=7679||$>=8400&&$<=8447||$>=65056&&$<=65071)continue;if($>=55296&&$<=57343)continue;if($>=65024&&$<=65039)continue;if(JJ.test(z))continue;if(x().test(z)){X+=2;continue}X+=t($,V)}return X}var YJ=new TextEncoder,C=globalThis.Bun,AJ=C?.sleep??$J,vJ=C?.stringWidth??KJ,OJ=C?.stripANSI??b,MJ=C?.write??XJ;async function ZJ(J,K,Z){if(!C){let X=typeof K==="function"?K():K;return H(X instanceof URL?X:new URL(X,Z))}let Y=(await J()).default;if(Y.startsWith("file:"))return H(Y);if(c(Y))return Y;return l(j(H(Z)),Y)}function $J(J){let K=J instanceof Date?J.getTime()-Date.now():J;return new Promise((Z)=>setTimeout(Z,K))}async function XJ(J,K,Z){let Y=J instanceof URL?H(J):J;if(Z?.createPath)await p(j(Y),{recursive:!0});let X=typeof K==="string"?YJ.encode(K):new Uint8Array(K.buffer,K.byteOffset,K.byteLength);return await d(Y,X,{mode:Z?.mode}),X.byteLength}var A=globalThis;class S{bufferParsers=new Map;filetypeParserOptions=new Map;filetypeAliases=new Map;filetypeParsers=new Map;filetypeParserPromises=new Map;reusableParsers=new Map;reusableParserPromises=new Map;initializePromise;performance;dataPath;tsDataPath;initialized=!1;constructor(){this.performance={averageParseTime:0,parseTimes:[],averageQueryTime:0,queryTimes:[]}}async fetchQueries(J,K){if(!this.tsDataPath)return"";return w.fetchHighlightQueries(J,this.tsDataPath,K)}async initialize({dataPath:J}){if(this.initializePromise)return this.initializePromise;return this.initializePromise=(async()=>{this.dataPath=J,this.tsDataPath=M.join(J,"tree-sitter"),await W(M.join(this.tsDataPath,"languages"),{recursive:!0}),await W(M.join(this.tsDataPath,"queries"),{recursive:!0});let K=await ZJ(()=>import("./chunk-mrcsatmn.js",{with:{type:"wasm"}}),()=>import.meta.resolve("web-tree-sitter/tree-sitter.wasm"),import.meta.url);if(f(K))K=g(M.parse(K).base);await D.init({locateFile(){return K}}),this.initialized=!0})(),this.initializePromise}addFiletypeParser(J){let K=this.filetypeParserOptions.get(J.filetype)?.aliases??[];for(let Y of K)if(this.filetypeAliases.get(Y)===J.filetype)this.filetypeAliases.delete(Y);let Z=[...new Set((J.aliases??[]).filter((Y)=>Y!==J.filetype))];this.filetypeAliases.delete(J.filetype),this.filetypeParserOptions.set(J.filetype,{...J,aliases:Z});for(let Y of Z)this.filetypeAliases.set(Y,J.filetype);this.invalidateParserCaches(J.filetype)}resolveCanonicalFiletype(J){if(this.filetypeParserOptions.has(J))return J;return this.filetypeAliases.get(J)??J}invalidateParserCaches(J){this.filetypeParsers.delete(J),this.filetypeParserPromises.delete(J);let K=this.reusableParsers.get(J);if(K)K.parser.delete(),this.reusableParsers.delete(J);this.reusableParserPromises.delete(J)}async createQueries(J,K){try{let Z=await this.fetchQueries(J.queries.highlights,J.filetype);if(!Z){console.error("Failed to fetch highlight queries for:",J.filetype);return}let X={highlights:new L(K,Z)};if(J.queries.injections&&J.queries.injections.length>0){let V=await this.fetchQueries(J.queries.injections,J.filetype);if(V)X.injections=new L(K,V)}return X}catch(Z){console.error("Error creating queries for",J.filetype,J.queries),console.error(Z);return}}async loadLanguage(J){if(!this.initialized||!this.tsDataPath)return;let K=await w.downloadOrLoad(J,this.tsDataPath,"languages",".wasm",!1);if(K.error){console.error(`Error loading language ${J}:`,K.error);return}if(!K.filePath)return;let Z=K.filePath.replaceAll("\\","/");try{return await I.load(Z)}catch(Y){console.error(`Error loading language from ${Z}:`,Y);return}}async resolveFiletypeParser(J){let K=this.resolveCanonicalFiletype(J);if(this.filetypeParsers.has(K))return this.filetypeParsers.get(K);if(this.filetypeParserPromises.has(K))return this.filetypeParserPromises.get(K);let Z=this.loadFiletypeParser(K);this.filetypeParserPromises.set(K,Z);try{let Y=await Z;if(Y)this.filetypeParsers.set(K,Y);return Y}finally{this.filetypeParserPromises.delete(K)}}async loadFiletypeParser(J){let K=this.filetypeParserOptions.get(J);if(!K)return;let Z=await this.loadLanguage(K.wasm);if(!Z)return;let Y=await this.createQueries(K,Z);if(!Y){console.error("Failed to create queries for:",J);return}return{...K,queries:Y,language:Z}}async preloadParser(J){return this.resolveFiletypeParser(J)}async getReusableParser(J){let K=this.resolveCanonicalFiletype(J);if(this.reusableParsers.has(K))return this.reusableParsers.get(K);if(this.reusableParserPromises.has(K))return this.reusableParserPromises.get(K);let Z=this.createReusableParser(K);this.reusableParserPromises.set(K,Z);try{let Y=await Z;if(Y)this.reusableParsers.set(K,Y);return Y}finally{this.reusableParserPromises.delete(K)}}async createReusableParser(J){let K=await this.resolveFiletypeParser(J);if(!K)return;let Z=new D;return Z.setLanguage(K.language),{parser:Z,filetypeParser:K,queries:K.queries}}async handleInitializeParser(J,K,Z,Y,X){let V=await this.resolveFiletypeParser(Y);if(!V){A.postMessage({type:"PARSER_INIT_RESPONSE",bufferId:J,messageId:X,hasParser:!1,warning:`No parser available for filetype ${Y}`});return}let z=new D;z.setLanguage(V.language);let $=z.parse(Z);if(!$){A.postMessage({type:"PARSER_INIT_RESPONSE",bufferId:J,messageId:X,hasParser:!1,error:"Failed to parse buffer"});return}let Q={parser:z,tree:$,queries:V.queries,filetype:Y,content:Z,injectionMapping:V.injectionMapping};this.bufferParsers.set(J,Q),A.postMessage({type:"PARSER_INIT_RESPONSE",bufferId:J,messageId:X,hasParser:!0});let B=await this.initialQuery(Q);A.postMessage({type:"HIGHLIGHT_RESPONSE",bufferId:J,version:K,...B})}async initialQuery(J){let Z=J.queries.highlights.captures(J.tree.rootNode),Y=new Map;if(J.queries.injections){let X=await this.processInjections(J);Z.push(...X.captures),Y=X.injectionRanges}return this.getHighlights(J,Z,Y)}getNodeText(J,K){return K.substring(J.startIndex,J.endIndex)}async processInjections(J){let K=[],Z=new Map;if(!J.queries.injections)return{captures:K,injectionRanges:Z};let Y=J.content,X=J.queries.injections.captures(J.tree.rootNode),V=new Map,z=J.injectionMapping;for(let $ of X){let Q=$.name;if(Q==="injection.content"||Q.includes("injection")){let B=$.node.type,G;if(z?.nodeTypes&&z.nodeTypes[B])G=z.nodeTypes[B];else if(B==="code_fence_content"){let v=$.node.parent;if(v){let O=v.children.find((E)=>E.type==="info_string");if(O){let E=O.children.find((q)=>q.type==="language");if(E){let q=this.getNodeText(E,Y);if(z?.infoStringMap&&z.infoStringMap[q])G=z.infoStringMap[q];else G=q}}}}if(G){if(!V.has(G))V.set(G,[]);V.get(G).push({node:$.node,name:$.name})}}}for(let[$,Q]of V.entries()){let B=await this.getReusableParser($);if(!B){console.warn(`No parser found for injection language: ${$}`);continue}if(!Z.has($))Z.set($,[]);let G=B.parser;for(let{node:v}of Q)try{Z.get($).push({start:v.startIndex,end:v.endIndex});let O=this.getNodeText(v,Y),E=G.parse(O);if(E){let q=B.queries.highlights.captures(E.rootNode);for(let _ of q){let T={name:_.name,patternIndex:_.patternIndex,_injectedQuery:B.queries.highlights,node:{..._.node,startPosition:{row:_.node.startPosition.row+v.startPosition.row,column:_.node.startPosition.row===0?_.node.startPosition.column+v.startPosition.column:_.node.startPosition.column},endPosition:{row:_.node.endPosition.row+v.startPosition.row,column:_.node.endPosition.row===0?_.node.endPosition.column+v.startPosition.column:_.node.endPosition.column},startIndex:_.node.startIndex+v.startIndex,endIndex:_.node.endIndex+v.startIndex}};K.push(T)}E.delete()}}catch(O){console.error(`Error processing injection for language ${$}:`,O)}}return{captures:K,injectionRanges:Z}}editToRange(J){return{startPosition:{column:J.startPosition.column,row:J.startPosition.row},endPosition:{column:J.newEndPosition.column,row:J.newEndPosition.row},startIndex:J.startIndex,endIndex:J.newEndIndex}}async handleEdits(J,K,Z){let Y=this.bufferParsers.get(J);if(!Y)return{warning:"No parser state found for buffer"};Y.content=K;for(let q of Z)Y.tree.edit(q);let X=performance.now(),V=Y.parser.parse(K,Y.tree),$=performance.now()-X;if(this.performance.parseTimes.push($),this.performance.parseTimes.length>10)this.performance.parseTimes.shift();if(this.performance.averageParseTime=this.performance.parseTimes.reduce((q,_)=>q+_,0)/this.performance.parseTimes.length,!V)return{error:"Failed to parse buffer"};let Q=Y.tree.getChangedRanges(V);Y.tree=V;let B=performance.now(),G=[];if(Q.length===0)Z.forEach((q)=>{let _=this.editToRange(q);Q.push(_)});for(let q of Q){let _=Y.tree.rootNode.descendantForPosition(q.startPosition,q.endPosition);if(!_)continue;if(_.equals(Y.tree.rootNode)){let m=Y.queries.highlights.captures(_,{startIndex:q.startIndex-100,endIndex:q.endIndex+1000});G.push(...m);continue}while(_&&!this.nodeContainsRange(_,q))_=_.parent;if(!_)_=Y.tree.rootNode;let T=Y.queries.highlights.captures(_);G.push(...T)}let v=new Map;if(Y.queries.injections){let q=await this.processInjections(Y);G.push(...q.captures),v=q.injectionRanges}let E=performance.now()-B;if(this.performance.queryTimes.push(E),this.performance.queryTimes.length>10)this.performance.queryTimes.shift();return this.performance.averageQueryTime=this.performance.queryTimes.reduce((q,_)=>q+_,0)/this.performance.queryTimes.length,this.getHighlights(Y,G,v)}nodeContainsRange(J,K){return J.startPosition.row<=K.startPosition.row&&J.endPosition.row>=K.endPosition.row&&(J.startPosition.row<K.startPosition.row||J.startPosition.column<=K.startPosition.column)&&(J.endPosition.row>K.endPosition.row||J.endPosition.column>=K.endPosition.column)}getHighlights(J,K,Z){let Y=new Map,X=new Map;for(let V of K){let z=V.node,$=z.startPosition.row,Q=z.endPosition.row,B={startCol:z.startPosition.column,endCol:z.endPosition.column,group:V.name};if(!Y.has($))Y.set($,new Map),X.set($,new Map);if(Y.get($)?.has(z.id))X.get($)?.set(z.id,Y.get($)?.get(z.id));if(Y.get($)?.set(z.id,B),$!==Q)for(let G=$+1;G<=Q;G++){if(!Y.has(G))Y.set(G,new Map);let v={startCol:0,endCol:z.endPosition.column,group:V.name};Y.get(G)?.set(z.id,v)}}return{highlights:Array.from(Y.entries()).map(([V,z])=>({line:V,highlights:Array.from(z.values()),droppedHighlights:X.get(V)?Array.from(X.get(V).values()):[]}))}}getSimpleHighlights(J,K){let Z=[],Y=[];for(let[X,V]of K.entries())for(let z of V)Y.push({...z,lang:X});for(let X of J){let V=X.node,z=!1,$,Q=!1;for(let q of Y)if(V.startIndex>=q.start&&V.endIndex<=q.end){z=!0,$=q.lang;break}else if(V.startIndex<=q.start&&V.endIndex>=q.end){Q=!0;break}let G=X._injectedQuery?.setProperties?.[X.patternIndex],v=G?.conceal??X.setProperties?.conceal,O=G?.conceal_lines??X.setProperties?.conceal_lines,E={};if(z&&$)E.isInjection=!0,E.injectionLang=$;if(Q)E.containsInjection=!0;if(v!==void 0)E.conceal=v;if(O!==void 0)E.concealLines=O;if(Object.keys(E).length>0)Z.push([V.startIndex,V.endIndex,X.name,E]);else Z.push([V.startIndex,V.endIndex,X.name])}return Z.sort((X,V)=>X[0]-V[0]),Z}async handleResetBuffer(J,K,Z){let Y=this.bufferParsers.get(J);if(!Y)return{warning:"No parser state found for buffer"};Y.content=Z;let X=Y.parser.parse(Z);if(!X)return{error:"Failed to parse buffer during reset"};Y.tree=X;let V=Y.queries.highlights.captures(Y.tree.rootNode),z=new Map;if(Y.queries.injections){let $=await this.processInjections(Y);V.push(...$.captures),z=$.injectionRanges}return this.getHighlights(Y,V,z)}disposeBuffer(J){let K=this.bufferParsers.get(J);if(!K)return;K.tree.delete(),K.parser.delete(),this.bufferParsers.delete(J)}async handleOneShotHighlight(J,K,Z){let Y=await this.getReusableParser(K);if(!Y){A.postMessage({type:"ONESHOT_HIGHLIGHT_RESPONSE",messageId:Z,hasParser:!1,warning:`No parser available for filetype ${K}`});return}let X=K==="markdown"&&J.endsWith("```")?J+`
4
4
  `:J,V=Y.parser.parse(X);if(!V){A.postMessage({type:"ONESHOT_HIGHLIGHT_RESPONSE",messageId:Z,hasParser:!1,error:"Failed to parse content"});return}try{let z=Y.filetypeParser.queries.highlights.captures(V.rootNode),$=new Map;if(Y.filetypeParser.queries.injections){let B={parser:Y.parser,tree:V,queries:Y.filetypeParser.queries,filetype:K,content:J,injectionMapping:Y.filetypeParser.injectionMapping},G=await this.processInjections(B);z.push(...G.captures),$=G.injectionRanges}let Q=this.getSimpleHighlights(z,$);A.postMessage({type:"ONESHOT_HIGHLIGHT_RESPONSE",messageId:Z,hasParser:!0,highlights:Q})}finally{V.delete()}}async updateDataPath(J){this.dataPath=J,this.tsDataPath=M.join(J,"tree-sitter");try{await W(M.join(this.tsDataPath,"languages"),{recursive:!0}),await W(M.join(this.tsDataPath,"queries"),{recursive:!0})}catch(K){throw Error(`Failed to update data path: ${K}`)}}async clearCache(){if(!this.dataPath||!this.tsDataPath)throw Error("No data path configured");let{rm:J}=await import("fs/promises");try{let K=M.join(this.dataPath,"tree-sitter");await J(K,{recursive:!0,force:!0}),await W(M.join(K,"languages"),{recursive:!0}),await W(M.join(K,"queries"),{recursive:!0}),this.filetypeParsers.clear(),this.filetypeParserPromises.clear(),this.reusableParsers.clear(),this.reusableParserPromises.clear()}catch(K){throw Error(`Failed to clear cache: ${K}`)}}}if(!y){let J=function(Z,...Y){A.postMessage({type:"WORKER_LOG",logType:Z,data:Y})},K=new S;console.log=(...Z)=>J("log",...Z),console.error=(...Z)=>J("error",...Z),console.warn=(...Z)=>J("warn",...Z),A.onmessage=async(Z)=>{let{type:Y,bufferId:X,version:V,content:z,filetype:$,edits:Q,filetypeParser:B,messageId:G,dataPath:v}=Z.data;try{switch(Y){case"INIT":try{await K.initialize({dataPath:v}),A.postMessage({type:"INIT_RESPONSE"})}catch(_){A.postMessage({type:"INIT_RESPONSE",error:_ instanceof Error?_.stack||_.message:String(_)})}break;case"ADD_FILETYPE_PARSER":K.addFiletypeParser(B);break;case"PRELOAD_PARSER":let O=await K.preloadParser($);A.postMessage({type:"PRELOAD_PARSER_RESPONSE",messageId:G,hasParser:!!O});break;case"INITIALIZE_PARSER":await K.handleInitializeParser(X,V,z,$,G);break;case"HANDLE_EDITS":let E=await K.handleEdits(X,z,Q);if(E.highlights&&E.highlights.length>0)A.postMessage({type:"HIGHLIGHT_RESPONSE",bufferId:X,version:V,...E});else if(E.warning)A.postMessage({type:"WARNING",bufferId:X,warning:E.warning});else if(E.error)A.postMessage({type:"ERROR",bufferId:X,error:E.error});break;case"GET_PERFORMANCE":A.postMessage({type:"PERFORMANCE_RESPONSE",performance:K.performance,messageId:G});break;case"RESET_BUFFER":let q=await K.handleResetBuffer(X,V,z);if(q.highlights&&q.highlights.length>0)A.postMessage({type:"HIGHLIGHT_RESPONSE",bufferId:X,version:V,...q});else if(q.warning)A.postMessage({type:"WARNING",bufferId:X,warning:q.warning});else if(q.error)A.postMessage({type:"ERROR",bufferId:X,error:q.error});break;case"DISPOSE_BUFFER":K.disposeBuffer(X),A.postMessage({type:"BUFFER_DISPOSED",bufferId:X});break;case"ONESHOT_HIGHLIGHT":await K.handleOneShotHighlight(z,$,G);break;case"UPDATE_DATA_PATH":try{await K.updateDataPath(v),A.postMessage({type:"UPDATE_DATA_PATH_RESPONSE",messageId:G})}catch(_){A.postMessage({type:"UPDATE_DATA_PATH_RESPONSE",messageId:G,error:_ instanceof Error?_.message:String(_)})}break;case"CLEAR_CACHE":try{await K.clearCache(),A.postMessage({type:"CLEAR_CACHE_RESPONSE",messageId:G})}catch(_){A.postMessage({type:"CLEAR_CACHE_RESPONSE",messageId:G,error:_ instanceof Error?_.message:String(_)})}break;default:A.postMessage({type:"ERROR",bufferId:X,error:`Unknown message type: ${Y}`})}}catch(O){A.postMessage({type:"ERROR",bufferId:X,error:O instanceof Error?O.stack||O.message:String(O)})}}}
package/bundle/worker.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{gg as V}from"./chunk-t6zz47zk.js";import{lg as x}from"./chunk-7r92d7v9.js";import"./chunk-0s4cp6q2.js";import"./chunk-mrq35ftw.js";import"./chunk-nsp1za8t.js";import"./chunk-brk6bge4.js";import"./chunk-nfg7nt13.js";import"./chunk-qgkb6n8k.js";import"./chunk-dcv6wj9x.js";import{Ch as O,bh as S}from"./chunk-1acn5me8.js";import"./chunk-vs3s49jw.js";import"./chunk-kre93a89.js";import"./chunk-060wbpz4.js";import"./chunk-zrhw1szj.js";import"./chunk-t8fjgkp8.js";import"./chunk-0egrckx0.js";import{el as Z,xj as Y}from"./chunk-k1qd8ecm.js";import{gl as N}from"./chunk-bhg69t69.js";import{Ol as q,rl as P}from"./chunk-fv5mrdyc.js";import"./chunk-rdreeyv0.js";import"./chunk-rmsqb6r4.js";import"./chunk-7pckez5z.js";import"./chunk-k6981ysw.js";import"./chunk-sa0rrreh.js";import"./chunk-ydgst3h8.js";import"./chunk-6tqbnxar.js";import"./chunk-0w19vmd7.js";import"./chunk-eewe7tx1.js";import"./chunk-4y9wbfd2.js";import"./chunk-wm9nh9nb.js";import"./chunk-scnbt714.js";import"./chunk-cqtkxwd8.js";import"./chunk-y3gy62q5.js";import"./chunk-az3nss5m.js";import"./chunk-p2fte9vz.js";import"./chunk-ggncq8w8.js";import"./chunk-t3w43rft.js";import"./chunk-eacpc64g.js";import"./chunk-27saej0r.js";import"./chunk-b5ym419d.js";import"./chunk-29q89bge.js";import"./chunk-wqk1v8t0.js";import{Ir as z}from"./chunk-rwwvy89t.js";import"./chunk-z0kbyr00.js";import"./chunk-sbjymf20.js";import"./chunk-dt3bsmfe.js";import"./chunk-vbfej8ds.js";import{as as C}from"./chunk-8jmb5bd4.js";import"./chunk-0tm6589k.js";import"./chunk-fveaq0pb.js";import{Ds as j,es as X,hs as G}from"./chunk-gswhjd1h.js";import"./chunk-wgkcyqn1.js";import{Os as T,Xs as W}from"./chunk-59csnjc3.js";import"./chunk-1bxfzd6r.js";import"./chunk-6p6m5956.js";import"./chunk-a48mx917.js";import"./chunk-3va85mbe.js";import"./chunk-w7a33cwa.js";import"./chunk-g7v6sp3c.js";import"./chunk-s2tc3qs0.js";import"./chunk-n6tqtk6h.js";import"./chunk-e0vrxetq.js";var $=W.create({service:"upgrade"});function k(D,E){if(D===!1)return"disabled";if(D===!0&&E==="patch")return"install";return"notify"}async function M(){if(G)return;let D=await O.runPromise(Z.Service.use((J)=>J.getGlobal())),E=await O.runPromise(N.Service.use((J)=>J.method())),K=await O.runPromise(N.Service.use((J)=>J.latest(E))).catch((J)=>{$.warn("failed to check for updates",{method:E,error:String(J)})});if(!K)return;if(!N.isNewerVersion(X,K)){$.warn("ignoring non-newer update version",{current:X,latest:K});return}if(T.QITQODE_ALWAYS_NOTIFY_UPDATE){await Y.publish(N.Event.UpdateAvailable,{version:K});return}if(T.QITQODE_DISABLE_AUTOUPDATE)return;let _=N.getReleaseType(X,K),Q=k(D.autoupdate,_);if(Q==="disabled")return;if(Q==="notify"){await Y.publish(N.Event.UpdateAvailable,{version:K});return}if(E==="unknown")return;await O.runPromise(N.Service.use((J)=>J.upgrade(E,K))).then(()=>Y.publish(N.Event.Updated,{version:K})).catch((J)=>{$.warn("auto-upgrade failed",{method:E,target:K,error:String(J)})})}import{writeHeapSnapshot as w}from"v8";j("worker");await W.init({print:process.argv.includes("--print-logs"),dev:N.isLocal(),level:(()=>{if(N.isLocal())return"DEBUG";return"INFO"})()});V.start();C("worker");P.on("event",(D)=>{z.emit("global.event",D)});var U,H={async ping(){return"pong"},async fetch(D){let E={...D.headers},K=L();if(K&&!E.authorization&&!E.Authorization)E.Authorization=K;let _=new Request(D.url,{method:D.method,headers:E,body:D.body}),Q=await x.Default().app.fetch(_),J=await Q.text();return{status:Q.status,headers:Object.fromEntries(Q.headers.entries()),body:J}},snapshot(){return w("server.heapsnapshot")},async server(D){if(U)await U.stop(!0);return U=await x.listen(D),{url:U.url.toString()}},async checkUpgrade(D){await q.provide({directory:D.directory,init:()=>O.runPromise(S),fn:async()=>{await M().catch(()=>{})}})},async reload(){await O.runPromise(Z.Service.use((D)=>D.invalidate(!0)))},async shutdown(){if(W.Default.info("worker shutting down"),await q.disposeAll(),U)await U.stop(!0)}};z.listen(H);function L(){let D=T.QITQODE_SERVER_PASSWORD;if(!D)return;let E=T.QITQODE_SERVER_USERNAME??"qitqode";return`Basic ${btoa(`${E}:${D}`)}`}export{H as rpc};
2
+ import{cg as V}from"./chunk-rpc0he6b.js";import{hg as x}from"./chunk-bqqxvagz.js";import"./chunk-1dnvdeat.js";import"./chunk-zj5snrsa.js";import"./chunk-3tf7xfw5.js";import"./chunk-egcvm4x2.js";import"./chunk-nfg7nt13.js";import"./chunk-r4qpsa4e.js";import"./chunk-seda5sfd.js";import{Zg as S,yh as O}from"./chunk-88hmeyf5.js";import"./chunk-aykvrqrp.js";import"./chunk-2h8b0csf.js";import"./chunk-4q14whpc.js";import"./chunk-s81ck6bw.js";import"./chunk-jt7g0r2j.js";import"./chunk-84qx54nf.js";import{al as Z,tj as Y}from"./chunk-ep92grvg.js";import{cl as N}from"./chunk-xf1y0sc6.js";import{Kl as q,nl as P}from"./chunk-n24yx79r.js";import"./chunk-5qydhr42.js";import"./chunk-v30ezr68.js";import"./chunk-ex47pb9n.js";import"./chunk-jh2za7y4.js";import"./chunk-s3zmxfz2.js";import"./chunk-krk24aqm.js";import"./chunk-j7d3v0x2.js";import"./chunk-3hawwbw6.js";import"./chunk-4c6d1wy1.js";import"./chunk-vyf77kq1.js";import"./chunk-bxc3z38f.js";import"./chunk-7wshaze9.js";import"./chunk-vbcekkw2.js";import"./chunk-4ngvj758.js";import"./chunk-cqtkxwd8.js";import"./chunk-wpkr3vzf.js";import"./chunk-49we3vy1.js";import"./chunk-y7cqyeve.js";import"./chunk-92xxg12q.js";import"./chunk-h8yf5e2e.js";import"./chunk-yvtbt12y.js";import"./chunk-g83d3a0t.js";import"./chunk-1p39y33b.js";import"./chunk-yg0rs4g1.js";import"./chunk-vhh80d5j.js";import{du as z}from"./chunk-wp0xd7at.js";import"./chunk-dzw0j790.js";import"./chunk-rvev3cy6.js";import"./chunk-c53ev0da.js";import"./chunk-78yvbv9b.js";import{xu as C}from"./chunk-wspbjh74.js";import"./chunk-c5n49vrd.js";import"./chunk-bwzbcwff.js";import{Bu as X,Eu as G,_u as j}from"./chunk-r6055kk0.js";import"./chunk-datctfgt.js";import{jv as T,sv as W}from"./chunk-x28chfpz.js";import"./chunk-mnxcykeq.js";import"./chunk-0bn86djg.js";import"./chunk-xphzr4wg.js";import"./chunk-hav9pgf3.js";import"./chunk-cshsqavb.js";import"./chunk-tz60e15h.js";import"./chunk-0tya4pqb.js";import"./chunk-63t0rhc9.js";import"./chunk-9svh74gt.js";var $=W.create({service:"upgrade"});function k(D,E){if(D===!1)return"disabled";if(D===!0&&E==="patch")return"install";return"notify"}async function M(){if(G)return;let D=await O.runPromise(Z.Service.use((J)=>J.getGlobal())),E=await O.runPromise(N.Service.use((J)=>J.method())),K=await O.runPromise(N.Service.use((J)=>J.latest(E))).catch((J)=>{$.warn("failed to check for updates",{method:E,error:String(J)})});if(!K)return;if(!N.isNewerVersion(X,K)){$.warn("ignoring non-newer update version",{current:X,latest:K});return}if(T.QITQODE_ALWAYS_NOTIFY_UPDATE){await Y.publish(N.Event.UpdateAvailable,{version:K});return}if(T.QITQODE_DISABLE_AUTOUPDATE)return;let _=N.getReleaseType(X,K),Q=k(D.autoupdate,_);if(Q==="disabled")return;if(Q==="notify"){await Y.publish(N.Event.UpdateAvailable,{version:K});return}if(E==="unknown")return;await O.runPromise(N.Service.use((J)=>J.upgrade(E,K))).then(()=>Y.publish(N.Event.Updated,{version:K})).catch((J)=>{$.warn("auto-upgrade failed",{method:E,target:K,error:String(J)})})}import{writeHeapSnapshot as w}from"v8";j("worker");await W.init({print:process.argv.includes("--print-logs"),dev:N.isLocal(),level:(()=>{if(N.isLocal())return"DEBUG";return"INFO"})()});V.start();C("worker");P.on("event",(D)=>{z.emit("global.event",D)});var U,H={async ping(){return"pong"},async fetch(D){let E={...D.headers},K=L();if(K&&!E.authorization&&!E.Authorization)E.Authorization=K;let _=new Request(D.url,{method:D.method,headers:E,body:D.body}),Q=await x.Default().app.fetch(_),J=await Q.text();return{status:Q.status,headers:Object.fromEntries(Q.headers.entries()),body:J}},snapshot(){return w("server.heapsnapshot")},async server(D){if(U)await U.stop(!0);return U=await x.listen(D),{url:U.url.toString()}},async checkUpgrade(D){await q.provide({directory:D.directory,init:()=>O.runPromise(S),fn:async()=>{await M().catch(()=>{})}})},async reload(){await O.runPromise(Z.Service.use((D)=>D.invalidate(!0)))},async shutdown(){if(W.Default.info("worker shutting down"),await q.disposeAll(),U)await U.stop(!0)}};z.listen(H);function L(){let D=T.QITQODE_SERVER_PASSWORD;if(!D)return;let E=T.QITQODE_SERVER_USERNAME??"qitqode";return`Basic ${btoa(`${E}:${D}`)}`}export{H as rpc};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qitqode/qitqode-android-arm64",
3
- "version": "0.2.9",
3
+ "version": "0.2.11",
4
4
  "description": "Android arm64 runtime for @qitqode/cli.",
5
5
  "license": "MIT",
6
6
  "author": "QitQode",
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Id as a}from"./chunk-0ffmwhw7.js";import"./chunk-rk0fnvp5.js";import"./chunk-e0vrxetq.js";export{a as dict};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Ae as d,Be as e,Ce as f,De as g,xe as a,ye as b,ze as c}from"./chunk-rye1yjnr.js";import"./chunk-ejhhrece.js";import"./chunk-0a4pmkc9.js";import"./chunk-35fj1sfm.js";import"./chunk-e0vrxetq.js";export{g as fromEnv,c as ENV_SESSION,b as ENV_SECRET,a as ENV_KEY,d as ENV_EXPIRATION,e as ENV_CREDENTIAL_SCOPE,f as ENV_ACCOUNT_ID};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{i as P,j as g,k as b,l as h,m as O}from"./chunk-0z1keh2w.js";import"./chunk-2kh0tg92.js";import"./chunk-52xvhxek.js";import{be as u}from"./chunk-f4mnp6xd.js";import{eg as s}from"./chunk-bwadggys.js";import{Ch as f}from"./chunk-1acn5me8.js";import{Dh as E}from"./chunk-vs3s49jw.js";import"./chunk-kre93a89.js";import"./chunk-060wbpz4.js";import"./chunk-zrhw1szj.js";import"./chunk-t8fjgkp8.js";import"./chunk-0egrckx0.js";import{Bj as S,Cj as p}from"./chunk-k1qd8ecm.js";import"./chunk-bhg69t69.js";import"./chunk-fv5mrdyc.js";import"./chunk-rdreeyv0.js";import"./chunk-rmsqb6r4.js";import"./chunk-7pckez5z.js";import"./chunk-k6981ysw.js";import"./chunk-sa0rrreh.js";import"./chunk-ydgst3h8.js";import"./chunk-6tqbnxar.js";import"./chunk-0w19vmd7.js";import"./chunk-eewe7tx1.js";import"./chunk-4y9wbfd2.js";import"./chunk-wm9nh9nb.js";import"./chunk-scnbt714.js";import"./chunk-cqtkxwd8.js";import"./chunk-y3gy62q5.js";import"./chunk-az3nss5m.js";import"./chunk-p2fte9vz.js";import"./chunk-ggncq8w8.js";import"./chunk-t3w43rft.js";import"./chunk-eacpc64g.js";import"./chunk-27saej0r.js";import"./chunk-b5ym419d.js";import"./chunk-29q89bge.js";import"./chunk-wqk1v8t0.js";import"./chunk-rwwvy89t.js";import"./chunk-z0kbyr00.js";import"./chunk-sbjymf20.js";import"./chunk-dt3bsmfe.js";import"./chunk-vbfej8ds.js";import"./chunk-0tm6589k.js";import"./chunk-fveaq0pb.js";import"./chunk-gswhjd1h.js";import"./chunk-wgkcyqn1.js";import"./chunk-59csnjc3.js";import"./chunk-1bxfzd6r.js";import"./chunk-6p6m5956.js";import"./chunk-a48mx917.js";import"./chunk-3va85mbe.js";import{Ry as I}from"./chunk-w7a33cwa.js";import{BC as D,fH as l,mB as d}from"./chunk-g7v6sp3c.js";import"./chunk-s2tc3qs0.js";import"./chunk-n6tqtk6h.js";import"./chunk-e0vrxetq.js";var A=(o)=>l.promise(()=>E(o)),m=(o)=>l.sync(()=>s.println(o)),v=(o)=>s.Style.TEXT_DIM+o+s.Style.TEXT_NORMAL,L=(o)=>o?v(" (active)"):"",w=(o,e)=>`${o.email} ${v(o.url)}${L(e)}`,x=(o,e,t)=>`${e.name} (${o.email})${L(t)}`,C=(o,e,t)=>{let n=t?s.Style.TEXT_SUCCESS+"\u25CF"+s.Style.TEXT_NORMAL:" ",c=t?s.Style.TEXT_HIGHLIGHT_BOLD+e.name+s.Style.TEXT_NORMAL:e.name;return` ${n} ${c} ${v(o.email)} ${v(o.url)} ${v(e.id)}`},T=(o,e)=>d.isSome(o)&&o.value.id===e.accountID&&o.value.active_org_id===e.orgID,_=l.fn("login")(function*(o){let e=yield*p.Service;yield*P("Log in");let t=yield*e.login(o);yield*b.info("Go to: "+t.url),yield*b.info("Enter code: "+t.user),yield*A(t.url);let n=O();yield*n.start("Waiting for authorization...");let c=(r)=>l.gen(function*(){yield*l.sleep(r);let i=yield*e.poll(t);if(i._tag==="PollPending")return yield*c(r);if(i._tag==="PollSlow")return yield*c(D.sum(r,D.seconds(5)));return i}),a=yield*c(t.interval).pipe(l.timeout(t.expiry),l.catchTag("TimeoutError",()=>l.succeed(new S)));yield*I.valueTags(a,{PollSuccess:(r)=>l.gen(function*(){yield*n.stop("Logged in as "+r.email),yield*g("Done")}),PollExpired:()=>n.stop("Device code expired",1),PollDenied:()=>n.stop("Authorization denied",1),PollError:(r)=>n.stop("Error: "+String(r.cause),1),PollPending:()=>n.stop("Unexpected state",1),PollSlow:()=>n.stop("Unexpected state",1)})}),N=l.fn("logout")(function*(o){let e=yield*p.Service,t=yield*e.list();if(t.length===0)return yield*m("Not logged in");if(o){let i=t.find((y)=>y.email===o);if(!i)return yield*m("Account not found: "+o);yield*e.remove(i.id),yield*g("Logged out from "+o);return}let n=yield*e.active(),c=d.map(n,(i)=>i.id);yield*P("Log out");let a=t.map((i)=>{let y=d.isSome(c)&&c.value===i.id;return{value:i,label:w(i,y)}}),r=yield*h({message:"Select account to log out",options:a});if(d.isNone(r))return;yield*e.remove(r.value.id),yield*g("Logged out from "+r.value.email)}),$=l.fn("switch")(function*(){let o=yield*p.Service,e=yield*o.orgsByAccount();if(e.length===0)return yield*m("Not logged in");let t=yield*o.active(),n=e.flatMap((r)=>r.orgs.map((i)=>{let y=T(t,{accountID:r.account.id,orgID:i.id});return{value:{orgID:i.id,accountID:r.account.id,label:i.name},label:x(r.account,i,y)}}));if(n.length===0)return yield*m("No orgs found");yield*P("Switch org");let c=yield*h({message:"Select org",options:n});if(d.isNone(c))return;let a=c.value;yield*o.use(a.accountID,d.some(a.orgID)),yield*g("Switched to "+a.label)}),R=l.fn("orgs")(function*(){let o=yield*p.Service,e=yield*o.orgsByAccount();if(e.length===0)return yield*m("No accounts found");if(!e.some((n)=>n.orgs.length>0))return yield*m("No orgs found");let t=yield*o.active();for(let n of e)for(let c of n.orgs){let a=T(t,{accountID:n.account.id,orgID:c.id});yield*m(C(n.account,c,a))}}),M=l.fn("open")(function*(){let e=yield*(yield*p.Service).active();if(d.isNone(e))return yield*m("No active account");let t=e.value.url;yield*A(t),yield*g("Opened "+t)}),X=u({command:"login <url>",describe:!1,builder:(o)=>o.positional("url",{describe:"server URL",type:"string",demandOption:!0}),async handler(o){s.empty(),await f.runPromise(_(o.url))}}),B=u({command:"logout [email]",describe:!1,builder:(o)=>o.positional("email",{describe:"account email to log out from",type:"string"}),async handler(o){s.empty(),await f.runPromise(N(o.email))}}),U=u({command:"switch",describe:!1,async handler(){s.empty(),await f.runPromise($())}}),G=u({command:"orgs",describe:!1,async handler(){s.empty(),await f.runPromise(R())}}),H=u({command:"open",describe:!1,async handler(){s.empty(),await f.runPromise(M())}}),Y=u({command:"console",describe:!1,builder:(o)=>o.command({...X,describe:"log in to console"}).command({...B,describe:"log out from console"}).command({...U,describe:"switch active org"}).command({...G,describe:"list orgs"}).command({...H,describe:"open active console account"}).demandCommand(),async handler(){}});export{C as formatOrgLine,w as formatAccountLabel,U as SwitchCommand,G as OrgsCommand,H as OpenCommand,B as LogoutCommand,X as LoginCommand,Y as ConsoleCommand};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Qd as b}from"./chunk-vkkz40je.js";import{be as f}from"./chunk-f4mnp6xd.js";import{Ch as S}from"./chunk-1acn5me8.js";import"./chunk-vs3s49jw.js";import"./chunk-kre93a89.js";import"./chunk-060wbpz4.js";import"./chunk-zrhw1szj.js";import"./chunk-t8fjgkp8.js";import"./chunk-0egrckx0.js";import{dl as v}from"./chunk-k1qd8ecm.js";import"./chunk-bhg69t69.js";import{El as R,Ol as k,wl as U}from"./chunk-fv5mrdyc.js";import"./chunk-rdreeyv0.js";import"./chunk-rmsqb6r4.js";import"./chunk-7pckez5z.js";import"./chunk-k6981ysw.js";import"./chunk-sa0rrreh.js";import"./chunk-ydgst3h8.js";import"./chunk-6tqbnxar.js";import"./chunk-0w19vmd7.js";import"./chunk-eewe7tx1.js";import"./chunk-4y9wbfd2.js";import"./chunk-wm9nh9nb.js";import"./chunk-scnbt714.js";import"./chunk-cqtkxwd8.js";import"./chunk-y3gy62q5.js";import"./chunk-az3nss5m.js";import"./chunk-p2fte9vz.js";import"./chunk-ggncq8w8.js";import"./chunk-t3w43rft.js";import"./chunk-eacpc64g.js";import"./chunk-27saej0r.js";import"./chunk-b5ym419d.js";import"./chunk-29q89bge.js";import"./chunk-wqk1v8t0.js";import{Fr as Z}from"./chunk-rwwvy89t.js";import"./chunk-z0kbyr00.js";import"./chunk-sbjymf20.js";import"./chunk-dt3bsmfe.js";import"./chunk-vbfej8ds.js";import"./chunk-0tm6589k.js";import"./chunk-fveaq0pb.js";import"./chunk-gswhjd1h.js";import"./chunk-wgkcyqn1.js";import"./chunk-59csnjc3.js";import"./chunk-1bxfzd6r.js";import"./chunk-6p6m5956.js";import"./chunk-a48mx917.js";import"./chunk-3va85mbe.js";import"./chunk-w7a33cwa.js";import"./chunk-g7v6sp3c.js";import"./chunk-s2tc3qs0.js";import"./chunk-n6tqtk6h.js";import"./chunk-e0vrxetq.js";var i=f({command:"stats",describe:"show token usage and cost statistics",builder:(z)=>{return z.option("days",{describe:"show stats for the last N days (default: all time)",type:"number"}).option("tools",{describe:"number of tools to show (default: all)",type:"number"}).option("models",{describe:"show model statistics (default: hidden). Pass a number to show top N, otherwise shows all"}).option("project",{describe:"filter by project (default: all projects, empty string: current project)",type:"string"})},handler:async(z)=>{await b(process.cwd(),async()=>{let E=await y(z.days,z.project),_;if(z.models===!0)_=1/0;else if(typeof z.models==="number")_=z.models;u(E,z.tools,_)})}});async function w(){return k.project}async function p(){return R.use((E)=>E.select().from(U).all()).map((E)=>v.fromRow(E))}async function y(z,E){let _=await p(),L=86400000,J=(()=>{if(z===void 0)return 0;if(z===0){let V=new Date;return V.setHours(0,0,0,0),V.getTime()}return Date.now()-z*86400000})(),K=(()=>{if(z===void 0)return;if(z===0)return 1;return z})(),Y=J>0?_.filter((V)=>V.time.updated>=J):_;if(E!==void 0)if(E===""){let V=await w();Y=Y.filter((F)=>F.projectID===V.id)}else Y=Y.filter((V)=>V.projectID===E);let G={totalSessions:Y.length,totalMessages:0,totalCost:0,totalTokens:{input:0,output:0,reasoning:0,cache:{read:0,write:0}},toolUsage:{},modelUsage:{},dateRange:{earliest:Date.now(),latest:Date.now()},days:0,costPerDay:0,tokensPerSession:0,medianTokensPerSession:0};if(Y.length>1000)console.log(`Large dataset detected (${Y.length} sessions). This may take a while...`);if(Y.length===0)return G.days=K??0,G;let C=Date.now(),x=0,X=[],h=20;for(let V=0;V<Y.length;V+=h){let D=Y.slice(V,V+h).map(async(Q)=>{let W=await S.runPromise(v.Service.use((O)=>O.messages({sessionID:Q.id,agentID:"*"}))),N=0,H={input:0,output:0,reasoning:0,cache:{read:0,write:0}},j={},A={};for(let O of W){if(O.info.role==="assistant"){N+=O.info.cost||0;let B=`${O.info.providerID}/${O.info.modelID}`;if(!A[B])A[B]={messages:0,tokens:{input:0,output:0,cache:{read:0,write:0}},cost:0};if(A[B].messages++,A[B].cost+=O.info.cost||0,O.info.tokens)H.input+=O.info.tokens.input||0,H.output+=O.info.tokens.output||0,H.reasoning+=O.info.tokens.reasoning||0,H.cache.read+=O.info.tokens.cache?.read||0,H.cache.write+=O.info.tokens.cache?.write||0,A[B].tokens.input+=O.info.tokens.input||0,A[B].tokens.output+=(O.info.tokens.output||0)+(O.info.tokens.reasoning||0),A[B].tokens.cache.read+=O.info.tokens.cache?.read||0,A[B].tokens.cache.write+=O.info.tokens.cache?.write||0}for(let B of O.parts)if(B.type==="tool"&&B.tool)j[B.tool]=(j[B.tool]||0)+1}return{messageCount:W.length,sessionCost:N,sessionTokens:H,sessionTotalTokens:H.input+H.output+H.reasoning+H.cache.read+H.cache.write,sessionToolUsage:j,sessionModelUsage:A,earliestTime:J>0?Q.time.updated:Q.time.created,latestTime:Q.time.updated}}),M=await Promise.all(D);for(let Q of M){C=Math.min(C,Q.earliestTime),x=Math.max(x,Q.latestTime),X.push(Q.sessionTotalTokens),G.totalMessages+=Q.messageCount,G.totalCost+=Q.sessionCost,G.totalTokens.input+=Q.sessionTokens.input,G.totalTokens.output+=Q.sessionTokens.output,G.totalTokens.reasoning+=Q.sessionTokens.reasoning,G.totalTokens.cache.read+=Q.sessionTokens.cache.read,G.totalTokens.cache.write+=Q.sessionTokens.cache.write;for(let[W,N]of Object.entries(Q.sessionToolUsage))G.toolUsage[W]=(G.toolUsage[W]||0)+N;for(let[W,N]of Object.entries(Q.sessionModelUsage)){if(!G.modelUsage[W])G.modelUsage[W]={messages:0,tokens:{input:0,output:0,cache:{read:0,write:0}},cost:0};G.modelUsage[W].messages+=N.messages,G.modelUsage[W].tokens.input+=N.tokens.input,G.modelUsage[W].tokens.output+=N.tokens.output,G.modelUsage[W].tokens.cache.read+=N.tokens.cache.read,G.modelUsage[W].tokens.cache.write+=N.tokens.cache.write,G.modelUsage[W].cost+=N.cost}}}let $=Math.max(1,Math.ceil((x-C)/86400000)),q=K??$;G.dateRange={earliest:C,latest:x},G.days=q,G.costPerDay=G.totalCost/q;let I=G.totalTokens.input+G.totalTokens.output+G.totalTokens.reasoning+G.totalTokens.cache.read+G.totalTokens.cache.write;G.tokensPerSession=Y.length>0?I/Y.length:0,X.sort((V,F)=>V-F);let P=Math.floor(X.length/2);return G.medianTokensPerSession=X.length===0?0:X.length%2===0?(X[P-1]+X[P])/2:X[P],G}function u(z,E,_){function J(x,X){let $=55-x.length-X.length,q=Math.max(0,$);return`\u2502${x}${" ".repeat(q)}${X} \u2502`}console.log("\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510"),console.log("\u2502 OVERVIEW \u2502"),console.log("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524"),console.log(J("Sessions",z.totalSessions.toLocaleString())),console.log(J("Messages",z.totalMessages.toLocaleString())),console.log(J("Days",z.days.toString())),console.log("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518"),console.log(),console.log("\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510"),console.log("\u2502 COST & TOKENS \u2502"),console.log("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524");let K=isNaN(z.totalCost)?0:z.totalCost,Y=isNaN(z.costPerDay)?0:z.costPerDay,G=isNaN(z.tokensPerSession)?0:z.tokensPerSession;console.log(J("Total Cost",`$${K.toFixed(2)}`)),console.log(J("Avg Cost/Day",`$${Y.toFixed(2)}`)),console.log(J("Avg Tokens/Session",Z.number(Math.round(G))));let C=isNaN(z.medianTokensPerSession)?0:z.medianTokensPerSession;if(console.log(J("Median Tokens/Session",Z.number(Math.round(C)))),console.log(J("Input",Z.number(z.totalTokens.input))),console.log(J("Output",Z.number(z.totalTokens.output))),console.log(J("Cache Read",Z.number(z.totalTokens.cache.read))),console.log(J("Cache Write",Z.number(z.totalTokens.cache.write))),console.log("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518"),console.log(),_!==void 0&&Object.keys(z.modelUsage).length>0){let x=Object.entries(z.modelUsage).sort(([,h],[,$])=>$.messages-h.messages),X=_===1/0?x:x.slice(0,_);console.log("\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510"),console.log("\u2502 MODEL USAGE \u2502"),console.log("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524");for(let[h,$]of X)console.log(`\u2502 ${h.padEnd(54)} \u2502`),console.log(J(" Messages",$.messages.toLocaleString())),console.log(J(" Input Tokens",Z.number($.tokens.input))),console.log(J(" Output Tokens",Z.number($.tokens.output))),console.log(J(" Cache Read",Z.number($.tokens.cache.read))),console.log(J(" Cache Write",Z.number($.tokens.cache.write))),console.log(J(" Cost",`$${$.cost.toFixed(4)}`)),console.log("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524");process.stdout.write("\x1B[1A"),console.log("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518")}if(console.log(),Object.keys(z.toolUsage).length>0){let x=Object.entries(z.toolUsage).sort(([,q],[,I])=>I-q),X=E?x.slice(0,E):x;console.log("\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510"),console.log("\u2502 TOOL USAGE \u2502"),console.log("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524");let h=Math.max(...X.map(([,q])=>q)),$=Object.values(z.toolUsage).reduce((q,I)=>q+I,0);for(let[q,I]of X){let P=Math.max(1,Math.floor(I/h*20)),V="\u2588".repeat(P),F=(I/$*100).toFixed(1),D=18,W=` ${(q.length>18?q.substring(0,16)+"..":q).padEnd(18)} ${V.padEnd(20)} ${I.toString().padStart(3)} (${F.padStart(4)}%)`,N=Math.max(0,56-W.length-1);console.log(`\u2502${W}${" ".repeat(N)} \u2502`)}console.log("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518")}console.log()}export{u as displayStats,y as aggregateSessionStats,i as StatsCommand};
@@ -1,7 +0,0 @@
1
- // @bun
2
- import{T as I}from"./chunk-gbkz04ke.js";import{U as i,W as r}from"./chunk-c987bemn.js";import{Id as c}from"./chunk-0ffmwhw7.js";import{Jd as g}from"./chunk-eyr5ymt8.js";import{Kd as y}from"./chunk-y0h3jfkj.js";import{Ld as k}from"./chunk-1rgt2vmt.js";import{Md as A}from"./chunk-rk0fnvp5.js";import{$d as P,Rd as w,Sd as u,Ud as W,Vd as L,Wd as T,Yd as p,Zd as o,_d as b}from"./chunk-2kh0tg92.js";import"./chunk-52xvhxek.js";import{be as z}from"./chunk-f4mnp6xd.js";import{eg as Y}from"./chunk-bwadggys.js";import{Ch as M}from"./chunk-1acn5me8.js";import"./chunk-vs3s49jw.js";import"./chunk-kre93a89.js";import"./chunk-060wbpz4.js";import"./chunk-zrhw1szj.js";import"./chunk-t8fjgkp8.js";import"./chunk-0egrckx0.js";import{Rk as a,el as s,yj as R}from"./chunk-k1qd8ecm.js";import{ql as V}from"./chunk-bhg69t69.js";import{Ol as n}from"./chunk-fv5mrdyc.js";import"./chunk-rdreeyv0.js";import"./chunk-rmsqb6r4.js";import"./chunk-7pckez5z.js";import"./chunk-k6981ysw.js";import"./chunk-sa0rrreh.js";import"./chunk-ydgst3h8.js";import"./chunk-6tqbnxar.js";import"./chunk-0w19vmd7.js";import"./chunk-eewe7tx1.js";import"./chunk-4y9wbfd2.js";import"./chunk-wm9nh9nb.js";import"./chunk-scnbt714.js";import"./chunk-cqtkxwd8.js";import"./chunk-y3gy62q5.js";import"./chunk-az3nss5m.js";import"./chunk-p2fte9vz.js";import"./chunk-ggncq8w8.js";import"./chunk-t3w43rft.js";import"./chunk-eacpc64g.js";import"./chunk-27saej0r.js";import"./chunk-b5ym419d.js";import"./chunk-29q89bge.js";import"./chunk-wqk1v8t0.js";import"./chunk-rwwvy89t.js";import{Or as l}from"./chunk-z0kbyr00.js";import"./chunk-sbjymf20.js";import"./chunk-dt3bsmfe.js";import"./chunk-vbfej8ds.js";import"./chunk-0tm6589k.js";import"./chunk-fveaq0pb.js";import{ls as d}from"./chunk-gswhjd1h.js";import"./chunk-wgkcyqn1.js";import"./chunk-59csnjc3.js";import{lt as v}from"./chunk-1bxfzd6r.js";import"./chunk-6p6m5956.js";import"./chunk-a48mx917.js";import"./chunk-3va85mbe.js";import"./chunk-w7a33cwa.js";import{fH as O}from"./chunk-g7v6sp3c.js";import"./chunk-s2tc3qs0.js";import"./chunk-n6tqtk6h.js";import{xO as H1}from"./chunk-e0vrxetq.js";import f from"path";import{pathToFileURL as J1}from"url";import Q1 from"os";import{access as S1,readdir as X1}from"fs/promises";var q1={en:A,zh:k,ja:c,fr:y,ru:g},B1=q1[I()]??A;function U($,B){let J=B1[$]??A[$]??$;if(!B)return J;return J.replace(/\{(\w+)\}/g,(X,H)=>(H in B)?String(B[H]):`{${H}}`)}import{text as Z1}from"stream/consumers";var D=($,B)=>M.runPromise(O.gen(function*(){yield*(yield*R.Service).set($,B)}));async function t(){let $=await p({message:"Enter your API key",validate:(B)=>B&&B.length>0?void 0:"Required"});if(w($))throw new Y.CancelledError;return $}async function h($,B){let J=$.provider??B;if("refresh"in $){let{type:X,provider:H,refresh:Z,access:j,expires:q,metadata:S,...G}=$;await D(J,{type:"oauth",refresh:Z,access:j,expires:q,...G})}if("key"in $)await D(J,{type:"api",key:$.key,...$.metadata?{metadata:$.metadata}:{}})}async function x($,B,J){let X=0;if(J){let j=$.auth.methods.findIndex((q)=>q.label.toLowerCase()===J.toLowerCase());if(j===-1)W.error(`Unknown method "${J}" for ${B}. Available: ${$.auth.methods.map((q)=>q.label).join(", ")}`),process.exit(1);X=j}else if($.auth.methods.length>1){let j=await b({message:"Login method",options:$.auth.methods.map((q,S)=>({label:q.label,value:S.toString()}))});if(w(j))throw new Y.CancelledError;X=parseInt(j)}let H=$.auth.methods[X];await new Promise((j)=>setTimeout(j,10));let Z={};if(H.prompts)for(let j of H.prompts){if(j.when){let q=Z[j.when.key];if(q===void 0)continue;if(!(j.when.op==="eq"?q===j.when.value:q!==j.when.value))continue}if(j.condition&&!j.condition(Z))continue;if(j.type==="select"){let q=await b({message:j.message,options:j.options});if(w(q))throw new Y.CancelledError;Z[j.key]=q}else{let q=await P({message:j.message,placeholder:j.placeholder,validate:j.validate?(S)=>j.validate(S??""):void 0});if(w(q))throw new Y.CancelledError;Z[j.key]=q}}if(H.type==="oauth"){let j=await H.authorize(Z);if(j.url)W.info("Go to: "+j.url);if(j.method==="auto"){if(j.instructions)W.info(j.instructions);let q=o();q.start("Waiting for authorization...");let S=await j.callback();if(S.type==="failed")q.stop("Failed to authorize",1);if(S.type==="success")await h(S,B),q.stop("Login successful")}if(j.method==="code"){let q=await P({message:"Paste the authorization code here: ",validate:(G)=>G&&G.length>0?void 0:"Required"});if(w(q))throw new Y.CancelledError;let S=await j.callback(q);if(S.type==="failed")W.error("Failed to authorize");if(S.type==="success")await h(S,B),W.success("Login successful")}return T("Done"),!0}if(H.type==="api"){if(H.authorize){let j=await t(),q=await H.authorize(Z);if(q.type==="failed")W.error("Failed to authorize");if(q.type==="success"){let S=q.provider??B;await D(S,{type:"api",key:q.key??j}),W.success("Login successful")}return T("Done"),!0}}return!1}function G1($){let B=new Set,J=[];for(let X of $.hooks){if(!X.auth)continue;let H=X.auth.provider;if(B.has(H))continue;if(B.add(H),Object.hasOwn($.existingProviders,H))continue;if($.disabled.has(H))continue;if($.enabled&&!$.enabled.has(H))continue;J.push({id:H,name:$.providerNames[H]??H})}return J}function m($){let B=$?.loginExtension;if(!B||typeof B!=="object")return;let J=B;if(typeof J.id!=="string"||typeof J.run!=="function")return;return J}async function W1(){try{let J=await import("./chunk-aenrd7dk.js");for(let X of Object.values(J.modules??{})){let H=m(X);if(H)return H}}catch{}let $=f.join(import.meta.dir,"..","..","ext");await S1($).catch(()=>{return});let B=await X1($).catch(()=>[]);for(let J of B.filter((X)=>X.endsWith(".ts")&&!X.endsWith(".d.ts")))try{let X=m(await import(J1(f.join($,J)).href));if(X)return X}catch{}return}var l1=z({command:"providers",aliases:["auth"],describe:"manage AI providers and credentials",builder:($)=>$.command(Y1).command(_1).command(F1).command(K1).demandCommand(),async handler(){}}),Y1=z({command:"list",aliases:["ls"],describe:"list providers and credentials",async handler($){Y.empty();let B=f.join(v.Path.data,"auth.json"),J=Q1.homedir(),X=B===J||B.startsWith(J+f.sep)?"~"+B.slice(J.length):B;L(`Credentials ${Y.Style.TEXT_DIM}${X}`);let H=await M.runPromise(O.gen(function*(){let q=yield*R.Service;return Object.entries(yield*q.all())})),Z=await V.get();for(let[q,S]of H){let G=Z[q]?.name||q;W.info(`${G} ${Y.Style.TEXT_DIM}${S.type}`)}T(`${H.length} credentials`);let j=[];for(let[q,S]of Object.entries(Z))for(let G of S.env)if(process.env[G])j.push({provider:S.name||q,envVar:G});if(j.length>0){Y.empty(),L("Environment");for(let{provider:q,envVar:S}of j)W.info(`${q} ${Y.Style.TEXT_DIM}${S}`);T(`${j.length} environment variable`+(j.length===1?"":"s"))}}}),_1=z({command:"login [url]",describe:"log in to a provider",builder:($)=>$.positional("url",{describe:"qitqode auth provider",type:"string"}).option("provider",{alias:["p"],describe:"provider id or name to log in to (skips provider selection)",type:"string"}).option("method",{alias:["m"],describe:"login method label (skips method selection)",type:"string"}),async handler($){await n.provide({directory:process.cwd(),async fn(){if(Y.empty(),L("Add credential"),$.url){let Q=$.url.replace(/\/+$/,""),_=await fetch(`${Q}/.well-known/opencode`).then((j1)=>j1.json());W.info(`Running \`${_.auth.command.join(" ")}\``);let F=l.spawn(_.auth.command,{stdout:"pipe"});if(!F.stdout){W.error("Failed"),T("Done");return}let[C,N]=await Promise.all([F.exited,Z1(F.stdout)]);if(C!==0){W.error("Failed"),T("Done");return}await D(Q,{type:"wellknown",key:_.auth.env,token:N.trim()}),W.success("Logged into "+Q),T("Done");return}await V.refresh(!0).catch(()=>{});let B=await M.runPromise(s.Service.use((Q)=>Q.get())),J=new Set(B.disabled_providers??[]),X=B.enabled_providers?new Set(B.enabled_providers):void 0,H=await V.get().then((Q)=>{let _={};for(let[F,C]of Object.entries(Q))if((X?X.has(F):!0)&&!J.has(F))_[F]=C;return _}),Z=await M.runPromise(O.gen(function*(){return yield*(yield*a.Service).list()})),j=i,q=G1({hooks:Z,existingProviders:H,disabled:J,enabled:X,providerNames:Object.fromEntries(Object.entries(B.provider??{}).map(([Q,_])=>[Q,_.name]))}),S=[...r(d(H),j,(Q)=>({openai:"ChatGPT Plus/Pro or API key"})[Q.id]),...q.map((Q)=>({label:Q.name,value:Q.id,hint:"plugin"}))],G=await W1(),e=G?[G.id,...G.aliases??[]]:[],K;if(G&&$.provider&&e.includes($.provider)){await G.run();return}else if($.provider){let Q=$.provider,_=S.find((N)=>N.value===Q),F=S.find((N)=>N.label.toLowerCase()===Q.toLowerCase()),C=_??F;if(!C)W.error(`Unknown provider "${Q}"`),process.exit(1);K=C.value}else{let Q=await b({message:U("cli.providers.select"),options:[...G?.menu?[{label:G.menu.label,value:G.id,hint:G.menu.hint}]:[],{label:U("cli.providers.other"),value:"__other__"}]});if(w(Q))throw new Y.CancelledError;if(G&&Q===G.id){await G.run();return}let _=await u({message:U("cli.providers.select"),maxItems:8,options:[...S,{value:"other",label:"Other"}]});if(w(_))throw new Y.CancelledError;K=_}let E=Z.findLast((Q)=>Q.auth?.provider===K);if(E&&E.auth){if(await x({auth:E.auth},K,$.method))return}if(K==="other"){let Q=await P({message:"Enter provider id",validate:(F)=>F&&F.match(/^[0-9a-z-]+$/)?void 0:"a-z, 0-9 and hyphens only"});if(w(Q))throw new Y.CancelledError;K=Q.replace(/^@ai-sdk\//,"");let _=Z.findLast((F)=>F.auth?.provider===K);if(_&&_.auth){if(await x({auth:_.auth},K,$.method))return}W.warn(`This only stores a credential for ${K} - you will need configure it in qitqode.json, check the docs for examples.`)}if(K==="amazon-bedrock")W.info(`Amazon Bedrock authentication priority:
3
- 1. Bearer token (AWS_BEARER_TOKEN_BEDROCK or /connect)
4
- 2. AWS credential chain (profile, access keys, IAM roles, EKS IRSA)
5
-
6
- Configure via qitqode.json options (profile, region, endpoint) or
7
- AWS environment variables (AWS_PROFILE, AWS_REGION, AWS_ACCESS_KEY_ID, AWS_WEB_IDENTITY_TOKEN_FILE).`);if(K==="opencode")W.info("Create an api key at https://opencode.ai/auth");if(K==="vercel")W.info("You can create an api key at https://vercel.link/ai-gateway-token");if(["cloudflare","cloudflare-ai-gateway"].includes(K))W.info("Cloudflare AI Gateway can be configured with CLOUDFLARE_GATEWAY_ID, CLOUDFLARE_ACCOUNT_ID, and CLOUDFLARE_API_TOKEN environment variables. Read more: https://opencode.ai/docs/providers/#cloudflare-ai-gateway");let $1=await t();await D(K,{type:"api",key:$1}),T("Done")}})}}),F1=z({command:"logout",describe:"log out from a configured provider",async handler($){Y.empty();let B=await M.runPromise(O.gen(function*(){let Z=yield*R.Service;return Object.entries(yield*Z.all())}));if(L("Remove credential"),B.length===0){W.error("No credentials found");return}let J=await V.get(),X=await b({message:"Select provider",options:B.map(([Z,j])=>({label:(J[Z]?.name||Z)+Y.Style.TEXT_DIM+" ("+j.type+")",value:Z}))});if(w(X))throw new Y.CancelledError;let H=X;await M.runPromise(O.gen(function*(){yield*(yield*R.Service).remove(H)})),T("Logout successful")}}),K1=z({command:"whoami",describe:"show current logged-in user info",async handler($){Y.empty(),L("Current auth"),W.info("Run `qitqode auth list` to see all authenticated providers."),T("")}});export{G1 as resolvePluginProviders,K1 as ProvidersWhoamiCommand,F1 as ProvidersLogoutCommand,_1 as ProvidersLoginCommand,Y1 as ProvidersListCommand,l1 as ProvidersCommand};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import"./chunk-e0vrxetq.js";var G="./tree-sitter-bash-hq5s6fxb.wasm";export{G as default};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Qd as y}from"./chunk-vkkz40je.js";import{be as L}from"./chunk-f4mnp6xd.js";import{$g as N,Ch as w}from"./chunk-1acn5me8.js";import"./chunk-vs3s49jw.js";import"./chunk-kre93a89.js";import"./chunk-060wbpz4.js";import"./chunk-zrhw1szj.js";import"./chunk-t8fjgkp8.js";import"./chunk-0egrckx0.js";import{Wk as q,dl as v}from"./chunk-k1qd8ecm.js";import"./chunk-bhg69t69.js";import{El as k,Ol as O,wl as V,xl as A,yl as E}from"./chunk-fv5mrdyc.js";import"./chunk-rdreeyv0.js";import"./chunk-rmsqb6r4.js";import"./chunk-7pckez5z.js";import"./chunk-k6981ysw.js";import"./chunk-sa0rrreh.js";import"./chunk-ydgst3h8.js";import"./chunk-6tqbnxar.js";import"./chunk-0w19vmd7.js";import"./chunk-eewe7tx1.js";import"./chunk-4y9wbfd2.js";import"./chunk-wm9nh9nb.js";import"./chunk-scnbt714.js";import"./chunk-cqtkxwd8.js";import"./chunk-y3gy62q5.js";import"./chunk-az3nss5m.js";import"./chunk-p2fte9vz.js";import"./chunk-ggncq8w8.js";import"./chunk-t3w43rft.js";import"./chunk-eacpc64g.js";import"./chunk-27saej0r.js";import"./chunk-b5ym419d.js";import"./chunk-29q89bge.js";import"./chunk-wqk1v8t0.js";import"./chunk-rwwvy89t.js";import"./chunk-z0kbyr00.js";import"./chunk-sbjymf20.js";import"./chunk-dt3bsmfe.js";import"./chunk-vbfej8ds.js";import"./chunk-0tm6589k.js";import"./chunk-fveaq0pb.js";import"./chunk-gswhjd1h.js";import"./chunk-wgkcyqn1.js";import"./chunk-59csnjc3.js";import{gt as P}from"./chunk-1bxfzd6r.js";import"./chunk-6p6m5956.js";import"./chunk-a48mx917.js";import"./chunk-3va85mbe.js";import"./chunk-w7a33cwa.js";import"./chunk-g7v6sp3c.js";import"./chunk-s2tc3qs0.js";import"./chunk-n6tqtk6h.js";import"./chunk-e0vrxetq.js";import{EOL as X}from"os";function U(C){let G=C.match(/^https?:\/\/[^/]+\/share\/([a-zA-Z0-9_-]+)$/);return G?G[1]:null}function M(C,G){try{return new URL(C).origin===new URL(G).origin}catch{return!1}}function S(C){let G=C.find((z)=>z.type==="session");if(!G)return null;let Z=new Map,Q=new Map;for(let z of C)if(z.type==="message")Z.set(z.data.id,z.data);else if(z.type==="part"){if(!Q.has(z.data.messageID))Q.set(z.data.messageID,[]);Q.get(z.data.messageID).push(z.data)}if(Z.size===0)return null;return{info:G.data,messages:Array.from(Z.values()).map((z)=>({info:z,parts:Q.get(z.id)??[]}))}}var m=L({command:"import <file>",describe:"import session data from JSON file or URL",builder:(C)=>{return C.positional("file",{describe:"path to JSON file or share URL",type:"string",demandOption:!0})},handler:async(C)=>{await y(process.cwd(),async()=>{let G;if(C.file.startsWith("http://")||C.file.startsWith("https://")){let J=U(C.file);if(!J){let Y=await w.runPromise(N.Service.use((R)=>R.url()));process.stdout.write(`Invalid URL format. Expected: ${Y}/share/<slug>`),process.stdout.write(X);return}let _=new URL(C.file).origin,$=await w.runPromise(N.Service.use((Y)=>Y.request())),j=M(C.file,$.baseUrl)?$.headers:{},W=$.api.data(J),K=await fetch(`${_}${W}`,{headers:j});if(!K.ok&&W!==`/api/share/${J}/data`)K=await fetch(`${_}/api/share/${J}/data`,{headers:j});if(!K.ok){process.stdout.write(`Failed to fetch share data: ${K.statusText}`),process.stdout.write(X);return}let H=await K.json(),B=S(H);if(!B){process.stdout.write(`Share not found or empty: ${J}`),process.stdout.write(X);return}G=B}else if(G=await P.readJson(C.file).catch(()=>{return}),!G){process.stdout.write(`File not found: ${C.file}`),process.stdout.write(X);return}if(!G){process.stdout.write("Failed to read session data"),process.stdout.write(X);return}let Q=v.Info.parse({...G.info,projectID:O.project.id}),z=v.toRow(Q);k.use((J)=>J.insert(V).values(z).onConflictDoUpdate({target:V.id,set:{project_id:z.project_id}}).run());for(let J of G.messages){let F=q.Info.parse(J.info),{id:_,sessionID:$,...j}=F;k.use((W)=>W.insert(A).values({id:_,session_id:z.id,time_created:F.time?.created??Date.now(),data:j}).onConflictDoNothing().run());for(let W of J.parts){let K=q.Part.parse(W),{id:H,sessionID:B,messageID:Y,...R}=K;k.use((T)=>T.insert(E).values({id:H,message_id:Y,session_id:z.id,data:R}).onConflictDoNothing().run())}}process.stdout.write(`Imported session: ${G.info.id}`),process.stdout.write(X)})}});export{S as transformShareData,M as shouldAttachShareAuthHeaders,U as parseShareUrl,m as ImportCommand};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Af as h}from"./chunk-zqdjk4rf.js";import"./chunk-wm9nh9nb.js";import"./chunk-scnbt714.js";import"./chunk-cqtkxwd8.js";import"./chunk-y3gy62q5.js";import"./chunk-a48mx917.js";import"./chunk-3va85mbe.js";import"./chunk-e0vrxetq.js";var v=(q)=>{return h({baseURL:"https://gateway.ai.cloudflare.com/v1/compat",name:"Unified",...q||{}})},x=v();export{x as unified,v as createUnified};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{N as b,O as y,P as k,Q as S,R as D,S as x}from"./chunk-53jstmdp.js";import{Qd as m}from"./chunk-vkkz40je.js";import{Rd as f,Sd as w,Vd as h}from"./chunk-2kh0tg92.js";import"./chunk-52xvhxek.js";import{be as u}from"./chunk-f4mnp6xd.js";import{eg as a}from"./chunk-bwadggys.js";import"./chunk-1acn5me8.js";import"./chunk-vs3s49jw.js";import"./chunk-kre93a89.js";import"./chunk-060wbpz4.js";import"./chunk-zrhw1szj.js";import"./chunk-t8fjgkp8.js";import"./chunk-0egrckx0.js";import{Nj as p,dl as l}from"./chunk-k1qd8ecm.js";import"./chunk-bhg69t69.js";import"./chunk-fv5mrdyc.js";import"./chunk-rdreeyv0.js";import"./chunk-rmsqb6r4.js";import"./chunk-7pckez5z.js";import"./chunk-k6981ysw.js";import"./chunk-sa0rrreh.js";import"./chunk-ydgst3h8.js";import"./chunk-6tqbnxar.js";import"./chunk-0w19vmd7.js";import"./chunk-eewe7tx1.js";import"./chunk-4y9wbfd2.js";import"./chunk-wm9nh9nb.js";import"./chunk-scnbt714.js";import"./chunk-cqtkxwd8.js";import"./chunk-y3gy62q5.js";import"./chunk-az3nss5m.js";import"./chunk-p2fte9vz.js";import"./chunk-ggncq8w8.js";import"./chunk-t3w43rft.js";import"./chunk-eacpc64g.js";import"./chunk-27saej0r.js";import"./chunk-b5ym419d.js";import"./chunk-29q89bge.js";import"./chunk-wqk1v8t0.js";import"./chunk-rwwvy89t.js";import"./chunk-z0kbyr00.js";import"./chunk-sbjymf20.js";import"./chunk-dt3bsmfe.js";import"./chunk-vbfej8ds.js";import"./chunk-0tm6589k.js";import"./chunk-fveaq0pb.js";import"./chunk-gswhjd1h.js";import"./chunk-wgkcyqn1.js";import"./chunk-59csnjc3.js";import"./chunk-1bxfzd6r.js";import"./chunk-6p6m5956.js";import"./chunk-a48mx917.js";import"./chunk-3va85mbe.js";import"./chunk-w7a33cwa.js";import"./chunk-g7v6sp3c.js";import"./chunk-s2tc3qs0.js";import"./chunk-n6tqtk6h.js";import"./chunk-e0vrxetq.js";import{EOL as c}from"os";async function I(){a.empty(),h("Export session",{output:process.stderr});let t=[...l.list()];if(t.length===0)return;let o=await w({message:"Select session to export",maxItems:10,options:t.map((e)=>({label:e.title,value:e.id,hint:`${new Date(e.time.updated).toLocaleString()} \u2022 ${e.id.slice(-8)}`})),output:process.stderr});if(f(o))throw new a.CancelledError;return p.make(o)}var z=u({command:"export [sessionID]",describe:"export a complete session transcript as JSON or Markdown",builder:(t)=>t.positional("sessionID",{describe:"session id to export",type:"string"}).option("latest",{describe:"export the most recently updated session without prompting",type:"boolean",default:!1}).option("format",{alias:"f",describe:"output format (JSON defaults to stdout; Markdown defaults to a file in the project root)",choices:["json","markdown"],default:"json"}).option("output",{alias:"o",describe:"destination path, resolved from the current project root",type:"string"}).option("thinking",{describe:"include persisted assistant reasoning in Markdown",type:"boolean",default:!1}).option("tool-details",{describe:"include diagnostic tool inputs, outputs, and errors in Markdown",type:"boolean",default:!0}).option("assistant-metadata",{describe:"include agent, model, and duration metadata in Markdown",type:"boolean",default:!0}).option("sanitize",{describe:"redact sensitive transcript and file data",type:"boolean",default:!1}),handler:async(t)=>{await m(process.cwd(),async()=>{if(t.sessionID&&t.latest)throw Error("Use either a session ID or --latest, not both");let o=t.sessionID?p.make(t.sessionID):void 0;if(!o&&(t.latest||!process.stderr.isTTY))o=y()?.id;if(!o)o=await I();if(!o)throw Error("No sessions found in the current project");let e;try{e=await b(o)}catch{throw Error(`Session not found: ${o}`)}let r=t.sanitize?D(e):e,n=t.format,d=n==="json"?JSON.stringify(r,null,2)+c:x(r.info,r.messages,{thinking:t.thinking,toolDetails:t.toolDetails,assistantMetadata:t.assistantMetadata}),i=t.output??(n==="markdown"?k(r.info.id,n):void 0);if(!i){process.stdout.write(d);return}try{let s=await S(process.cwd(),i,d);process.stderr.write(`Session transcript written to ${s}${c}`)}catch(s){let E=s instanceof Error?s.message:String(s);throw Error(`Unable to write session transcript to ${i}: ${E}`)}})}});export{z as ExportCommand};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Bh as a,Ch as b}from"./chunk-1acn5me8.js";import"./chunk-vs3s49jw.js";import"./chunk-kre93a89.js";import"./chunk-060wbpz4.js";import"./chunk-zrhw1szj.js";import"./chunk-t8fjgkp8.js";import"./chunk-0egrckx0.js";import"./chunk-k1qd8ecm.js";import"./chunk-bhg69t69.js";import"./chunk-fv5mrdyc.js";import"./chunk-rdreeyv0.js";import"./chunk-rmsqb6r4.js";import"./chunk-7pckez5z.js";import"./chunk-k6981ysw.js";import"./chunk-sa0rrreh.js";import"./chunk-ydgst3h8.js";import"./chunk-6tqbnxar.js";import"./chunk-0w19vmd7.js";import"./chunk-eewe7tx1.js";import"./chunk-4y9wbfd2.js";import"./chunk-wm9nh9nb.js";import"./chunk-scnbt714.js";import"./chunk-cqtkxwd8.js";import"./chunk-y3gy62q5.js";import"./chunk-az3nss5m.js";import"./chunk-p2fte9vz.js";import"./chunk-ggncq8w8.js";import"./chunk-t3w43rft.js";import"./chunk-eacpc64g.js";import"./chunk-27saej0r.js";import"./chunk-b5ym419d.js";import"./chunk-29q89bge.js";import"./chunk-wqk1v8t0.js";import"./chunk-rwwvy89t.js";import"./chunk-z0kbyr00.js";import"./chunk-sbjymf20.js";import"./chunk-dt3bsmfe.js";import"./chunk-vbfej8ds.js";import"./chunk-0tm6589k.js";import"./chunk-fveaq0pb.js";import"./chunk-gswhjd1h.js";import"./chunk-wgkcyqn1.js";import"./chunk-59csnjc3.js";import"./chunk-1bxfzd6r.js";import"./chunk-6p6m5956.js";import"./chunk-a48mx917.js";import"./chunk-3va85mbe.js";import"./chunk-w7a33cwa.js";import"./chunk-g7v6sp3c.js";import"./chunk-s2tc3qs0.js";import"./chunk-n6tqtk6h.js";import"./chunk-e0vrxetq.js";export{b as AppRuntime,a as AppLayer};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import"./chunk-e0vrxetq.js";var l="./tree-sitter-javascript-nd0q4pe9.wasm";export{l as default};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{iq as a,jq as b}from"./chunk-t3w43rft.js";import"./chunk-e0vrxetq.js";export{a as generateSecret,b as generateCodeChallengeFromVerifier};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{Eh as b}from"./chunk-kre93a89.js";import"./chunk-060wbpz4.js";import"./chunk-e0vrxetq.js";export{b as QuickJSAsyncWASMModule};