zen-code 4.8.2 → 4.8.4
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.
- package/dist/app.js +93 -93
- package/dist/{chunk-8kk9kv6s.js → chunk-03bb6pab.js} +1 -1
- package/dist/{chunk-jva13pdt.js → chunk-03d08304.js} +1 -1
- package/dist/{chunk-e3narvkn.js → chunk-04kzaj7h.js} +2 -2
- package/dist/{chunk-10stn7rc.js → chunk-09f94dtz.js} +1 -1
- package/dist/chunk-0bpvpy2e.js +1 -0
- package/dist/{chunk-r53nsqbh.js → chunk-0ch9bkct.js} +1 -1
- package/dist/{chunk-645r8yk7.js → chunk-0cz1ygrn.js} +1 -1
- package/dist/{chunk-3xfw5w0d.js → chunk-0dstjr38.js} +1 -1
- package/dist/chunk-0gb5n1jp.js +1 -0
- package/dist/{chunk-j07r3an3.js → chunk-0gpa9n28.js} +1 -1
- package/dist/{chunk-exj3mryv.js → chunk-0mryaqgb.js} +1 -1
- package/dist/{chunk-4cg3jh38.js → chunk-0myk23dw.js} +1 -1
- package/dist/{chunk-zxqs1xns.js → chunk-0qrqmmqt.js} +1 -1
- package/dist/{chunk-yzgwn422.js → chunk-1163kxya.js} +1 -1
- package/dist/chunk-13f0qh77.js +1 -0
- package/dist/chunk-17zj2hd5.js +1 -0
- package/dist/{chunk-ntc51kg0.js → chunk-1a5zv67s.js} +1 -1
- package/dist/{chunk-tfqwrnhz.js → chunk-1dwn0qqb.js} +1 -1
- package/dist/{chunk-kz78gsrq.js → chunk-1efcgvx0.js} +1 -1
- package/dist/{chunk-6qce4a2z.js → chunk-1ggv4msc.js} +1 -1
- package/dist/{chunk-7kb8ygdr.js → chunk-1jj1bxmb.js} +1 -1
- package/dist/{chunk-9dhex1sf.js → chunk-1mdbzd7e.js} +1 -1
- package/dist/{chunk-665a7fke.js → chunk-1pm5qfkm.js} +1 -1
- package/dist/{chunk-1a34fyjt.js → chunk-1q8wzky6.js} +1 -1
- package/dist/{chunk-ft4z3z88.js → chunk-1w5m9c5y.js} +1 -1
- package/dist/{chunk-axn0n4dh.js → chunk-21w7a0t2.js} +1 -1
- package/dist/{chunk-8w10sa5e.js → chunk-25es8s2e.js} +1 -1
- package/dist/{chunk-yynk0bam.js → chunk-28p35k17.js} +1 -1
- package/dist/{chunk-p8pfkf84.js → chunk-2gr7rdv0.js} +1 -1
- package/dist/{chunk-dee62n5c.js → chunk-2hjzw0cx.js} +1 -1
- package/dist/{chunk-8fzw4gqz.js → chunk-2kka9ex2.js} +1 -1
- package/dist/chunk-2m3g6fah.js +1 -0
- package/dist/{chunk-fsqndb8n.js → chunk-2qx9kzj1.js} +1 -1
- package/dist/{chunk-9n2ge60j.js → chunk-2vtz4ypn.js} +1 -1
- package/dist/{chunk-vfwh7m86.js → chunk-2w2pzwmm.js} +1 -1
- package/dist/{chunk-4w4ezegn.js → chunk-323aj0k7.js} +1 -1
- package/dist/{chunk-j4c847h3.js → chunk-3b8bw2gg.js} +1 -1
- package/dist/{chunk-1ja6becj.js → chunk-3c791dd5.js} +1 -1
- package/dist/{chunk-j7dazkh4.js → chunk-3dqan531.js} +1 -1
- package/dist/{chunk-bmb36b05.js → chunk-3ek4pcr6.js} +1 -1
- package/dist/{chunk-xxwnet5y.js → chunk-3mzwewcx.js} +1 -1
- package/dist/{chunk-g1z6k96z.js → chunk-3ns6c29z.js} +1 -1
- package/dist/{chunk-tv25zrtk.js → chunk-3p4khpea.js} +1 -1
- package/dist/{chunk-1yq51mb3.js → chunk-3pd9zqn2.js} +1 -1
- package/dist/{chunk-bnma63xz.js → chunk-3pqm74e3.js} +1 -1
- package/dist/{chunk-qhs3hh67.js → chunk-3s6j6d1z.js} +1 -1
- package/dist/{chunk-srtwf73c.js → chunk-3tq80kwe.js} +1 -1
- package/dist/{chunk-9frwhzz8.js → chunk-3z87tvcn.js} +1 -1
- package/dist/chunk-40fxbk0k.js +1 -0
- package/dist/{chunk-mwqg224k.js → chunk-41hzdwnx.js} +1 -1
- package/dist/{chunk-54j5njdj.js → chunk-45dyg3fv.js} +1 -1
- package/dist/{chunk-hqhqqe9q.js → chunk-4ecfe9a1.js} +1 -1
- package/dist/{chunk-bwvxp5dp.js → chunk-4g796wg5.js} +1 -1
- package/dist/{chunk-j3c65h0m.js → chunk-4j4w856j.js} +1 -1
- package/dist/{chunk-kbaz8s34.js → chunk-4mw5szy1.js} +1 -1
- package/dist/{chunk-dchaphvw.js → chunk-4n978rje.js} +2 -2
- package/dist/chunk-4pa2a33z.js +1 -0
- package/dist/{chunk-35bvsa6m.js → chunk-4qs8qf3g.js} +1 -1
- package/dist/{chunk-30hxw04w.js → chunk-4s6z4724.js} +1 -1
- package/dist/{chunk-httqsv3p.js → chunk-4tgv8687.js} +1 -1
- package/dist/{chunk-sdr9ywjt.js → chunk-4vr7sc1e.js} +1 -1
- package/dist/{chunk-5kns073z.js → chunk-4wmmjwq3.js} +1 -1
- package/dist/{chunk-f4cn2y4x.js → chunk-4z0wk36t.js} +1 -1
- package/dist/{chunk-9skn642s.js → chunk-4zemyepb.js} +1 -1
- package/dist/{chunk-x0xaw21f.js → chunk-501c35tf.js} +1 -1
- package/dist/{chunk-xg586hyh.js → chunk-50hw7e2n.js} +1 -1
- package/dist/{chunk-a07p1cfs.js → chunk-51cf1nrg.js} +1 -1
- package/dist/{chunk-ffyj4q4f.js → chunk-51h1tm3c.js} +1 -1
- package/dist/{chunk-zj03ksjd.js → chunk-5743qc09.js} +1 -1
- package/dist/{chunk-54ya969p.js → chunk-5g0asgdm.js} +1 -1
- package/dist/{chunk-84nqfeqh.js → chunk-5gaygdyf.js} +1 -1
- package/dist/{chunk-my5y2p5a.js → chunk-5n3h6mhr.js} +1 -1
- package/dist/{chunk-46ac6010.js → chunk-5vzt6z7d.js} +1 -1
- package/dist/{chunk-yd3vzgxs.js → chunk-62zhdx11.js} +1 -1
- package/dist/{chunk-khd8ds90.js → chunk-63ghca0g.js} +1 -1
- package/dist/{chunk-9xcz69sj.js → chunk-6a35z43a.js} +1 -1
- package/dist/{chunk-kkk1k414.js → chunk-6e734rff.js} +1 -1
- package/dist/chunk-6ezeq351.js +1 -0
- package/dist/{chunk-tr01bt0h.js → chunk-6gxwe3hq.js} +1 -1
- package/dist/chunk-6hbnk94n.js +1 -0
- package/dist/{chunk-00jvgph3.js → chunk-6meyz753.js} +1 -1
- package/dist/{chunk-en2d49a7.js → chunk-6nhdwm44.js} +1 -1
- package/dist/{chunk-dtha8g8n.js → chunk-6r7b9pg1.js} +1 -1
- package/dist/{chunk-2cj25dc6.js → chunk-6rzyzk0g.js} +1 -1
- package/dist/{chunk-hd39y2wf.js → chunk-6v5eepr1.js} +1 -1
- package/dist/{chunk-fyay9ztg.js → chunk-70gnwjt8.js} +1 -1
- package/dist/{chunk-jeavnd8g.js → chunk-72h39xc8.js} +1 -1
- package/dist/{chunk-8p1ebpny.js → chunk-76gx2wc0.js} +1 -1
- package/dist/{chunk-zqg7xzex.js → chunk-77gv3r7z.js} +1 -1
- package/dist/{chunk-4g2gfvyd.js → chunk-7893pky5.js} +1 -1
- package/dist/{chunk-v6faz3vj.js → chunk-7dmms791.js} +1 -1
- package/dist/{chunk-v667b8k4.js → chunk-7h9sjfmy.js} +1 -1
- package/dist/{chunk-n4s96jdz.js → chunk-7hvw60gp.js} +1 -1
- package/dist/{chunk-sw4h382q.js → chunk-7pntzqpm.js} +1 -1
- package/dist/{chunk-4k9xgsq4.js → chunk-7zprjevz.js} +1 -1
- package/dist/chunk-80jab8dy.js +1 -0
- package/dist/{chunk-e43hpgc8.js → chunk-85j75g9q.js} +1 -1
- package/dist/{chunk-ajxzbnbp.js → chunk-86em0evs.js} +1 -1
- package/dist/{chunk-sbcw8d8z.js → chunk-86exrje1.js} +1 -1
- package/dist/{chunk-wgwaq8q1.js → chunk-88191bqb.js} +1 -1
- package/dist/{chunk-daahmb61.js → chunk-8chx87e7.js} +1 -1
- package/dist/{chunk-d20g16c2.js → chunk-8evmvqza.js} +1 -1
- package/dist/{chunk-sexnhyqf.js → chunk-8hp4t30w.js} +1 -1
- package/dist/{chunk-k45jk0ge.js → chunk-8kv8e5sn.js} +1 -1
- package/dist/{chunk-a5k1t6aj.js → chunk-8m5dqftt.js} +1 -1
- package/dist/{chunk-8ynj83n2.js → chunk-8m6adpjf.js} +1 -1
- package/dist/{chunk-sy7vf5c5.js → chunk-8mmvxxyj.js} +1 -1
- package/dist/{chunk-en6q3h2k.js → chunk-8nkp692y.js} +1 -1
- package/dist/{chunk-2p664mgv.js → chunk-8tg10bhe.js} +1 -1
- package/dist/{chunk-qddn1sea.js → chunk-91rrbsk7.js} +1 -1
- package/dist/{chunk-x0gm6db7.js → chunk-952k4ak8.js} +1 -1
- package/dist/{chunk-3f6xf4mm.js → chunk-97bsgfnr.js} +1 -1
- package/dist/chunk-9c0wnb5t.js +1 -0
- package/dist/{chunk-kwhma00c.js → chunk-9dh8d15f.js} +1 -1
- package/dist/chunk-9dn65rqp.js +1 -0
- package/dist/{chunk-mnxav3bw.js → chunk-9gnhztzd.js} +1 -1
- package/dist/{chunk-2mesyv20.js → chunk-9hkn5b8e.js} +1 -1
- package/dist/{chunk-xtrkc4bn.js → chunk-9kydh60d.js} +1 -1
- package/dist/{chunk-fm4a6pgp.js → chunk-9ynmrc70.js} +1 -1
- package/dist/{chunk-bkan2fr3.js → chunk-acceg8yk.js} +1 -1
- package/dist/{chunk-xqhnnbfr.js → chunk-afdat9a4.js} +1 -1
- package/dist/{chunk-zgnjqvkp.js → chunk-ajtch74a.js} +1 -1
- package/dist/{chunk-9a6kwz9e.js → chunk-ak0aqr2c.js} +1 -1
- package/dist/{chunk-ewgpt1pm.js → chunk-ak2n1ckf.js} +1 -1
- package/dist/{chunk-7wqcxfc4.js → chunk-ak43xwf1.js} +1 -1
- package/dist/{chunk-vxggg3ea.js → chunk-anbr96y3.js} +1 -1
- package/dist/{chunk-q37swcyw.js → chunk-aqyqcpz2.js} +1 -1
- package/dist/{chunk-2kw6zxt8.js → chunk-arppjtcv.js} +1 -1
- package/dist/{chunk-s4ksgmax.js → chunk-azxn0zvz.js} +1 -1
- package/dist/chunk-b2pfdcdb.js +1 -0
- package/dist/{chunk-7wnxdt11.js → chunk-b4fn3tre.js} +1 -1
- package/dist/{chunk-vxzy50p0.js → chunk-b68ekt52.js} +1 -1
- package/dist/{chunk-pht0yvya.js → chunk-b6xencpw.js} +1 -1
- package/dist/{chunk-wxm0c8ec.js → chunk-b9fn4n7z.js} +1 -1
- package/dist/{chunk-r038t2rw.js → chunk-ba18by4y.js} +1 -1
- package/dist/{chunk-2yrz4qdk.js → chunk-bb9mvt9d.js} +1 -1
- package/dist/{chunk-dne3hqde.js → chunk-bd35cx5s.js} +1 -1
- package/dist/{chunk-ky2zgpqq.js → chunk-bf0pjbfa.js} +1 -1
- package/dist/chunk-bfm294j1.js +1 -0
- package/dist/{chunk-vbwkgvhq.js → chunk-bh33p34p.js} +1 -1
- package/dist/{chunk-0y6jq0a0.js → chunk-bngqptzm.js} +1 -1
- package/dist/{chunk-pr8jrhq9.js → chunk-bwjh7xrm.js} +1 -1
- package/dist/{chunk-04mq56m4.js → chunk-bwnx1zht.js} +1 -1
- package/dist/{chunk-9dse3mh2.js → chunk-c1345z85.js} +1 -1
- package/dist/{chunk-ny0zjscg.js → chunk-c1gpr8nz.js} +1 -1
- package/dist/{chunk-czkt4sv0.js → chunk-c1r7zjt3.js} +1 -1
- package/dist/{chunk-satxmrvx.js → chunk-c3b7gwkd.js} +1 -1
- package/dist/{chunk-vdd1xyrt.js → chunk-c5d87fzk.js} +1 -1
- package/dist/{chunk-zv0nefnm.js → chunk-cd37w7qk.js} +1 -1
- package/dist/chunk-cegx2zze.js +1 -0
- package/dist/{chunk-by1h1fy3.js → chunk-cm6vfvym.js} +1 -1
- package/dist/{chunk-15zc0x9q.js → chunk-cp9xkgbn.js} +3 -3
- package/dist/chunk-crjf70s3.js +1 -0
- package/dist/{chunk-b79d73fy.js → chunk-crvp4wnc.js} +1 -1
- package/dist/{chunk-yj3fncjn.js → chunk-cwvb8zr5.js} +1 -1
- package/dist/{chunk-6fzgq7sb.js → chunk-cyd358a8.js} +1 -1
- package/dist/chunk-d08qq3wd.js +1 -0
- package/dist/chunk-d9xgby9w.js +1 -0
- package/dist/{chunk-ggwb349q.js → chunk-dhgjjhh7.js} +1 -1
- package/dist/{chunk-07fnyy77.js → chunk-djmxgj5c.js} +1 -1
- package/dist/{chunk-55pfd4pp.js → chunk-dvmzq40v.js} +1 -1
- package/dist/{chunk-jpkm78je.js → chunk-dw3081wb.js} +1 -1
- package/dist/{chunk-jmp4rprf.js → chunk-e112438q.js} +1 -1
- package/dist/{chunk-667brfhx.js → chunk-e2qmvzgm.js} +1 -1
- package/dist/{chunk-t1pybn6p.js → chunk-e2vdc3vs.js} +1 -1
- package/dist/{chunk-0dvy62vd.js → chunk-eh3cemzk.js} +1 -1
- package/dist/{chunk-w4kh5s54.js → chunk-ehpz2t7m.js} +1 -1
- package/dist/{chunk-p1e4d1an.js → chunk-ek58k066.js} +1 -1
- package/dist/{chunk-1w5vehgm.js → chunk-emdn1c33.js} +1 -1
- package/dist/{chunk-dxyv2b1c.js → chunk-eyty7ng4.js} +1 -1
- package/dist/{chunk-fg2zmrdg.js → chunk-f3jbz60e.js} +1 -1
- package/dist/{chunk-fj71pv2k.js → chunk-f40x0w1g.js} +1 -1
- package/dist/{chunk-vpbyhd1b.js → chunk-f6cbjh6q.js} +1 -1
- package/dist/{chunk-f7rxszbz.js → chunk-fbf3gztk.js} +1 -1
- package/dist/{chunk-z578v7vz.js → chunk-fcexqvhh.js} +1 -1
- package/dist/{chunk-583jqck6.js → chunk-fcxgd3qb.js} +1 -1
- package/dist/{chunk-kn8f91na.js → chunk-feptb1bb.js} +1 -1
- package/dist/{chunk-cmfrm6a7.js → chunk-fmmsa2ry.js} +1 -1
- package/dist/{chunk-yyr27vj3.js → chunk-frzyyytq.js} +1 -1
- package/dist/{chunk-v02wftj8.js → chunk-fs2mzcgs.js} +1 -1
- package/dist/chunk-g1yt0qc9.js +1 -0
- package/dist/{chunk-33xp86w3.js → chunk-g30bcqjk.js} +1 -1
- package/dist/{chunk-51rhc5g1.js → chunk-g8k4dhcx.js} +1 -1
- package/dist/{chunk-5pt6e5bh.js → chunk-g9q5nbz0.js} +1 -1
- package/dist/{chunk-wkvnhk36.js → chunk-geyhpd32.js} +1 -1
- package/dist/{chunk-k06v7jh2.js → chunk-gh5vbn9x.js} +1 -1
- package/dist/{chunk-46bmfch2.js → chunk-gp1ensbx.js} +1 -1
- package/dist/chunk-gphyz2x3.js +1 -0
- package/dist/{chunk-qcyfn6sh.js → chunk-gpmj4w3z.js} +1 -1
- package/dist/{chunk-33j3j89j.js → chunk-gqdapzfq.js} +1 -1
- package/dist/{chunk-d7b0m60j.js → chunk-gtms11w9.js} +1 -1
- package/dist/{chunk-5eg3bn3m.js → chunk-gy4p2qnz.js} +1 -1
- package/dist/{chunk-9as23fmk.js → chunk-h5k1z56v.js} +1 -1
- package/dist/{chunk-c2gqabg2.js → chunk-h8ay3dqc.js} +1 -1
- package/dist/{chunk-nzfjhsr7.js → chunk-h8de6gyf.js} +1 -1
- package/dist/{chunk-x6je1qsq.js → chunk-hgpmrbsr.js} +1 -1
- package/dist/{chunk-ftc3mh9t.js → chunk-htgt048s.js} +1 -1
- package/dist/{chunk-a1s72wx6.js → chunk-hvekwfwd.js} +1 -1
- package/dist/{chunk-ksx0ymk7.js → chunk-hxw717c2.js} +1 -1
- package/dist/{chunk-n3e766aj.js → chunk-hzejh175.js} +1 -1
- package/dist/{chunk-mttnv195.js → chunk-j5e4dmw7.js} +1 -1
- package/dist/{chunk-b3s0bcp6.js → chunk-j8b7x5pr.js} +1 -1
- package/dist/{chunk-g1r86637.js → chunk-jafhgffb.js} +1 -1
- package/dist/{chunk-3k4101h5.js → chunk-jam7nh0r.js} +1 -1
- package/dist/chunk-jh6wwc9v.js +1 -0
- package/dist/chunk-jhjbxj1k.js +1 -0
- package/dist/chunk-jhwm3phf.js +1 -0
- package/dist/{chunk-b6xdt5xb.js → chunk-jmzy9per.js} +1 -1
- package/dist/{chunk-fwmc6hwy.js → chunk-jppcve2j.js} +1 -1
- package/dist/{chunk-m0k36mwn.js → chunk-jy5kmp4s.js} +1 -1
- package/dist/{chunk-kny33kyv.js → chunk-k1kzp019.js} +1 -1
- package/dist/{chunk-c04rr3mc.js → chunk-k7e2abhq.js} +1 -1
- package/dist/chunk-k97swe5s.js +1 -0
- package/dist/{chunk-fesyrdnx.js → chunk-ke9tpkk2.js} +1 -1
- package/dist/{chunk-6tf8wacp.js → chunk-kncs6js6.js} +1 -1
- package/dist/{chunk-q9wkyq6a.js → chunk-ksr76npa.js} +1 -1
- package/dist/chunk-ksy4d0za.js +1 -0
- package/dist/{chunk-962ms02t.js → chunk-kwgygr4z.js} +1 -1
- package/dist/{chunk-p3yymm16.js → chunk-m3zge9wv.js} +1 -1
- package/dist/{chunk-2xrccbwa.js → chunk-m7bwshtn.js} +1 -1
- package/dist/{chunk-gt6xd3pb.js → chunk-m8mdqeye.js} +1 -1
- package/dist/{chunk-jw043xpz.js → chunk-mcrmg4m8.js} +1 -1
- package/dist/{chunk-pdfvchxr.js → chunk-mfexzmw2.js} +1 -1
- package/dist/{chunk-dn2fe6a4.js → chunk-mjwypsrz.js} +1 -1
- package/dist/{chunk-2xr9jk3t.js → chunk-mp6yhf6a.js} +1 -1
- package/dist/chunk-mr7em8w4.js +1 -0
- package/dist/{chunk-66s9chr5.js → chunk-msha9pw1.js} +1 -1
- package/dist/{chunk-bcwnznke.js → chunk-mvv3ktys.js} +1 -1
- package/dist/{chunk-a4ah9wgn.js → chunk-mymqnpgf.js} +1 -1
- package/dist/{chunk-74j5prfv.js → chunk-n220pha2.js} +1 -1
- package/dist/{chunk-mx8stxha.js → chunk-n65ycayf.js} +1 -1
- package/dist/{chunk-pz1y3zyg.js → chunk-n72x5y7a.js} +1 -1
- package/dist/{chunk-5c13nrde.js → chunk-n9x46wsq.js} +1 -1
- package/dist/{chunk-8kt765dh.js → chunk-n9zmzbyq.js} +1 -1
- package/dist/{chunk-sd9rvjt6.js → chunk-nbcah8mh.js} +1 -1
- package/dist/chunk-ncs4rnsn.js +1 -0
- package/dist/{chunk-sjkk13dd.js → chunk-nt5n8jcr.js} +1 -1
- package/dist/{chunk-131cad67.js → chunk-nv58ta3s.js} +1 -1
- package/dist/{chunk-eceb8jjd.js → chunk-nw76mbwc.js} +1 -1
- package/dist/{chunk-cypczp4s.js → chunk-p2z2bacg.js} +1 -1
- package/dist/{chunk-zq5ncapf.js → chunk-p3mpqeqw.js} +1 -1
- package/dist/{chunk-t3q0fpe0.js → chunk-p3p6a3ht.js} +1 -1
- package/dist/{chunk-h1j74efh.js → chunk-p46at2ts.js} +1 -1
- package/dist/{chunk-5em7s1at.js → chunk-p6dgtz38.js} +1 -1
- package/dist/{chunk-nay5m04y.js → chunk-p70r0dds.js} +1 -1
- package/dist/{chunk-ntcxtgqe.js → chunk-p89xw4y2.js} +1 -1
- package/dist/{chunk-rnpfchb9.js → chunk-pd4wysbn.js} +1 -1
- package/dist/{chunk-5yv6fsvn.js → chunk-pe45n68n.js} +1 -1
- package/dist/{chunk-01tsa9cq.js → chunk-pf09ha3g.js} +1 -1
- package/dist/{chunk-v6nssgv7.js → chunk-pn04v4sv.js} +1 -1
- package/dist/{chunk-fdvezfdb.js → chunk-pr7vzg5y.js} +1 -1
- package/dist/{chunk-kz9rfhe3.js → chunk-psdrzwp5.js} +1 -1
- package/dist/{chunk-t6bb31dn.js → chunk-px75djc6.js} +1 -1
- package/dist/{chunk-m0czpwvf.js → chunk-q3x300wy.js} +1 -1
- package/dist/{chunk-mxwqk6ht.js → chunk-q56ns9ta.js} +1 -1
- package/dist/{chunk-zed64rf0.js → chunk-q86xqx6c.js} +1 -1
- package/dist/{chunk-gc0daqhj.js → chunk-q9711zm8.js} +1 -1
- package/dist/{chunk-5gp7nsdp.js → chunk-qejfdzc7.js} +1 -1
- package/dist/{chunk-m5rj1w7e.js → chunk-qpkn7wvc.js} +1 -1
- package/dist/{chunk-5q1qtbx4.js → chunk-r1enj0f0.js} +1 -1
- package/dist/{chunk-0qys39ww.js → chunk-r9r1v9kw.js} +1 -1
- package/dist/{chunk-p0ys44e5.js → chunk-rc027n67.js} +1 -1
- package/dist/{chunk-zcg0fy8h.js → chunk-rmrp92n9.js} +1 -1
- package/dist/{chunk-1r67ngsh.js → chunk-rv0x9fbs.js} +1 -1
- package/dist/chunk-rvxb17kx.js +1 -0
- package/dist/{chunk-5gjt4v98.js → chunk-rxs4gexg.js} +1 -1
- package/dist/{chunk-jk42e7d2.js → chunk-s6t5vxm9.js} +1 -1
- package/dist/chunk-s6xjfvvd.js +1 -0
- package/dist/{chunk-t7qx43hg.js → chunk-s719ttj9.js} +1 -1
- package/dist/{chunk-2mb0trr0.js → chunk-sd6qvm4t.js} +1 -1
- package/dist/chunk-shc3fcge.js +1 -0
- package/dist/chunk-ss233wsa.js +1 -0
- package/dist/{chunk-0b5e8zpy.js → chunk-stp38gza.js} +1 -1
- package/dist/{chunk-1mrzmr8f.js → chunk-sws9653v.js} +1 -1
- package/dist/{chunk-yk20e377.js → chunk-syme57ea.js} +1 -1
- package/dist/{chunk-07em03a3.js → chunk-t0tznkac.js} +1 -1
- package/dist/{chunk-zf96st2f.js → chunk-t32zj7ah.js} +1 -1
- package/dist/{chunk-vrjcy7h1.js → chunk-t5z5e89a.js} +1 -1
- package/dist/{chunk-87w588zd.js → chunk-t8w9hqaa.js} +1 -1
- package/dist/chunk-t97kks4j.js +1 -0
- package/dist/{chunk-f6rsbhs6.js → chunk-tamfhbc6.js} +1 -1
- package/dist/{chunk-s6qt552a.js → chunk-tchg9ygq.js} +1 -1
- package/dist/{chunk-6dat5vvb.js → chunk-te7k3eqj.js} +1 -1
- package/dist/{chunk-6r8jhnde.js → chunk-tpgf3t6p.js} +1 -1
- package/dist/{chunk-j2vek58t.js → chunk-tpyp8wqr.js} +1 -1
- package/dist/{chunk-vg1dem7m.js → chunk-trx18gxg.js} +1 -1
- package/dist/chunk-ts98e90r.js +1 -0
- package/dist/{chunk-brcvpmwp.js → chunk-tv1kqdv9.js} +1 -1
- package/dist/{chunk-zv3jegxm.js → chunk-tvbj84md.js} +1 -1
- package/dist/{chunk-16jx4h98.js → chunk-tx71e422.js} +1 -1
- package/dist/{chunk-3pzth5e2.js → chunk-ty5eswjv.js} +1 -1
- package/dist/{chunk-zwhbdwnt.js → chunk-v1e0cwqh.js} +1 -1
- package/dist/{chunk-3tfjvh53.js → chunk-v28dexnx.js} +1 -1
- package/dist/{chunk-cfsnygh0.js → chunk-v3bw2mnd.js} +1 -1
- package/dist/{chunk-10qr9jk1.js → chunk-v3ta4qyy.js} +1 -1
- package/dist/{chunk-8vsqygpz.js → chunk-v85y10pz.js} +1 -1
- package/dist/{chunk-9qtsjepd.js → chunk-v8ag7wgx.js} +1 -1
- package/dist/{chunk-x866vcqf.js → chunk-v9b5r8aq.js} +1 -1
- package/dist/{chunk-3mjwhvpy.js → chunk-vjvr9n6y.js} +1 -1
- package/dist/{chunk-vxdkfxtq.js → chunk-vkfhjhhh.js} +1 -1
- package/dist/{chunk-xkfzt78k.js → chunk-vxzscaap.js} +1 -1
- package/dist/{chunk-jrmcscsp.js → chunk-vyfvrrc8.js} +1 -1
- package/dist/{chunk-5hcvm27y.js → chunk-w0me5x6g.js} +1 -1
- package/dist/{chunk-vpah11mp.js → chunk-w69pf8zx.js} +1 -1
- package/dist/{chunk-e07gx0kg.js → chunk-w895krdx.js} +1 -1
- package/dist/{chunk-zgyww0w8.js → chunk-w8vzpn90.js} +1 -1
- package/dist/{chunk-18k4wz02.js → chunk-wb0ms9q0.js} +1 -1
- package/dist/{chunk-9rks3bc7.js → chunk-wk8sx9ev.js} +1 -1
- package/dist/{chunk-myx87v1y.js → chunk-wtwgpw9g.js} +1 -1
- package/dist/{chunk-vs72fgve.js → chunk-x0mnchxz.js} +1 -1
- package/dist/{chunk-9b45fe34.js → chunk-x0qb9311.js} +1 -1
- package/dist/chunk-x7g4cwft.js +1 -0
- package/dist/{chunk-t7zrr341.js → chunk-xb46b3bf.js} +1 -1
- package/dist/{chunk-b9s35wb6.js → chunk-xk0abc6t.js} +1 -1
- package/dist/{chunk-95963acy.js → chunk-xmp5jp4r.js} +1 -1
- package/dist/{chunk-wbcfbyft.js → chunk-xzpqbfjh.js} +1 -1
- package/dist/{chunk-s7qqrnzh.js → chunk-y1f3hfaq.js} +1 -1
- package/dist/{chunk-b7h6wk4v.js → chunk-y3d9nwzf.js} +1 -1
- package/dist/{chunk-mkzpj7ht.js → chunk-y3gfd4y3.js} +1 -1
- package/dist/{chunk-xc8efvab.js → chunk-y5pf2d0x.js} +1 -1
- package/dist/{chunk-6yk2jj1m.js → chunk-y6vatv51.js} +1 -1
- package/dist/{chunk-6wbgc1xz.js → chunk-y971vkwy.js} +1 -1
- package/dist/{chunk-w3y3sdmt.js → chunk-yb2kp04v.js} +1 -1
- package/dist/chunk-yctck6wf.js +1 -0
- package/dist/{chunk-vsedmhna.js → chunk-ye6d9r5f.js} +1 -1
- package/dist/{chunk-nvynvczn.js → chunk-yfasv01s.js} +1 -1
- package/dist/{chunk-bj4851d8.js → chunk-yj27rmw2.js} +1 -1
- package/dist/{chunk-y62ja3na.js → chunk-ypj2k2de.js} +1 -1
- package/dist/{chunk-n9yfs19q.js → chunk-yr04s6b7.js} +1 -1
- package/dist/{chunk-xkvnfywa.js → chunk-yr48as8z.js} +1 -1
- package/dist/{chunk-35ncgr15.js → chunk-ywas7wb8.js} +1 -1
- package/dist/{chunk-jv8shhgk.js → chunk-ywp666sg.js} +1 -1
- package/dist/{chunk-1ek0xjkr.js → chunk-yx4mdqvf.js} +1 -1
- package/dist/{chunk-9xtq15gy.js → chunk-yxwramd1.js} +1 -1
- package/dist/{chunk-2kqs0amy.js → chunk-yz8sseev.js} +1 -1
- package/dist/{chunk-6jdfap4a.js → chunk-z0abvgpr.js} +1 -1
- package/dist/{chunk-wp436n3r.js → chunk-z46zzhqf.js} +1 -1
- package/dist/{chunk-dj82prdc.js → chunk-z6rwg7bs.js} +1 -1
- package/dist/{chunk-yd6e0k1x.js → chunk-zb9wth64.js} +1 -1
- package/dist/chunk-zf08x9b0.js +434 -0
- package/dist/{chunk-p57dfnmm.js → chunk-zkfa00mf.js} +1 -1
- package/dist/{chunk-7jy1478y.js → chunk-znpdxhep.js} +1 -1
- package/dist/{chunk-4mj1r6nd.js → chunk-zpes0b8m.js} +1 -1
- package/dist/{chunk-5xhjmcrr.js → chunk-ztpff54v.js} +1 -1
- package/dist/cli.js +1 -1
- package/dist/nonInteractive.js +3 -3
- package/dist/zen-keyboard.js +1 -1
- package/package.json +2 -1
- package/dist/chunk-0c25y7k9.js +0 -1
- package/dist/chunk-29tmghhd.js +0 -1
- package/dist/chunk-3b63e6mc.js +0 -1
- package/dist/chunk-3st09pbw.js +0 -1
- package/dist/chunk-3zf20ctr.js +0 -1
- package/dist/chunk-4h4fdqy9.js +0 -1
- package/dist/chunk-87s313qe.js +0 -1
- package/dist/chunk-8n9e3wbs.js +0 -1
- package/dist/chunk-9xp471ze.js +0 -1
- package/dist/chunk-a0jc9gfw.js +0 -1
- package/dist/chunk-a22ebaj5.js +0 -1
- package/dist/chunk-bc95nfbs.js +0 -1
- package/dist/chunk-cd3rdhh1.js +0 -424
- package/dist/chunk-cdp5c1vf.js +0 -1
- package/dist/chunk-fsh8c4gw.js +0 -1
- package/dist/chunk-g0c5mmdz.js +0 -1
- package/dist/chunk-gz0bg0j5.js +0 -1
- package/dist/chunk-h77takma.js +0 -1
- package/dist/chunk-j9bkjc22.js +0 -1
- package/dist/chunk-jn4wgzaz.js +0 -1
- package/dist/chunk-jwtpf45z.js +0 -1
- package/dist/chunk-kephawnc.js +0 -1
- package/dist/chunk-kzafnaxn.js +0 -1
- package/dist/chunk-mgkmr3xy.js +0 -1
- package/dist/chunk-nq1k5tw4.js +0 -1
- package/dist/chunk-q2qcexv0.js +0 -1
- package/dist/chunk-s237yqg5.js +0 -1
- package/dist/chunk-sch9d3fe.js +0 -1
- package/dist/chunk-skh4rx0s.js +0 -1
- package/dist/chunk-svcy27ht.js +0 -1
- package/dist/chunk-t49vbac9.js +0 -1
- package/dist/chunk-txdyy4ya.js +0 -1
- package/dist/chunk-vcbgawge.js +0 -1
- package/dist/chunk-y7qk76sv.js +0 -1
- package/dist/chunk-yhpg01ds.js +0 -1
- package/dist/chunk-ynjy01zm.js +0 -1
package/dist/app.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import{Y as z5,Z as H5}from"./chunk-ft4z3z88.js";import{$ as t,_ as o0,aa as ZZ,ba as FZ,ca as N1,da as KZ,ea as wJ}from"./chunk-vpah11mp.js";import{fa as dX,ga as rX,ha as L1,ia as bZ,ja as a4,ka as BJ,la as YJ,ma as h0,na as gZ,oa as d4}from"./chunk-ny0zjscg.js";import{pa as fX,qa as e8,ra as uX,ta as ZJ,ua as a1,va as oZ}from"./chunk-wxm0c8ec.js";import{wa as WZ,xa as LJ}from"./chunk-kny33kyv.js";import{Ba as KX,Ca as y0,Ea as k0,ya as $X,za as r9}from"./chunk-jrmcscsp.js";import{Ga as m4,Ha as p0,Ia as cZ,Ka as dZ,La as d0,Ma as NY}from"./chunk-cmfrm6a7.js";import"./chunk-r038t2rw.js";import"./chunk-axn0n4dh.js";import{Wa as _Y,Xa as WY}from"./chunk-xh3gtpfd.js";import{$a as JX,Ya as x,Za as N,_a as O,ab as j0,cb as kX,db as KY,eb as uZ,fb as v,gb as rZ,ib as mY,kb as AJ,lb as F1}from"./chunk-e3narvkn.js";import{sb as NX}from"./chunk-7kb8ygdr.js";import{tb as J8,ub as Z5,vb as MX,wb as tX,xb as oX,yb as aX}from"./chunk-cd3rdhh1.js";import"./chunk-15zc0x9q.js";import"./chunk-xc8efvab.js";import"./chunk-3tfjvh53.js";import"./chunk-dchaphvw.js";import"./chunk-myx87v1y.js";import"./chunk-vxdkfxtq.js";import"./chunk-j07r3an3.js";import{hc as L,jc as cK,kc as uQ,lc as q}from"./chunk-kn8f91na.js";class TX{renderers=new Map;register(Z,Y){this.renderers.set(Z,Y)}get(Z){return this.renderers.get(Z)}has(Z){return this.renderers.has(Z)}list(){return Array.from(this.renderers.keys())}unregister(Z){this.renderers.delete(Z)}clear(){this.renderers.clear()}}var bY;var r4=uQ(()=>{bY=new TX});var UX=L(v(),1),PJ=new $X({defaultOptions:{queries:{retry:(Z,Y)=>{if(Y instanceof TypeError&&Y.message.includes("fetch"))return Z<2;return!1},refetchOnWindowFocus:!1,refetchOnMount:!0,refetchOnReconnect:!1,staleTime:300000,gcTime:600000,networkMode:"online"},mutations:{retry:1,networkMode:"online"}}});function WX({children:Z}){return UX.jsxDEV(KX,{client:PJ,children:Z},void 0,!1,void 0,this)}var zX={async search(Z){let Y=Object.entries(m4).map(([$,K])=>({assistant_id:$,graph_id:$,config:{},metadata:{},version:1,name:$,description:"",created_at:new Date().toISOString(),updated_at:new Date().toISOString()}));if(Z?.graphId)Y=Y.filter(($)=>$.graph_id===Z.graphId);if(Z?.metadata&&Object.keys(Z.metadata).length>0)Y=Y.filter(($)=>{return Object.entries(Z.metadata).every(([K,U])=>{return $.metadata&&$.metadata[K]===U})});if(Z?.sortBy)Y.sort(($,K)=>{let U=$[Z.sortBy],W=K[Z.sortBy],z=U<W?-1:U>W?1:0;return Z.sortOrder==="desc"?-z:z});let X=Z?.offset??0,J=Z?.limit;return J?Y.slice(X,X+J):Y.slice(X)},async count(Z){return(await this.search(Z)).length},async get(Z){if(!Object.entries(m4).find(([X,J])=>X===Z))throw Error(`Assistant not found: ${Z}`);return{assistant_id:Z,graph_id:Z,config:{},created_at:new Date().toISOString(),updated_at:new Date().toISOString(),metadata:{},version:1,name:Z,description:""}},async delete(Z){throw Error("Deleting assistants is not supported. Assistants are generated from registered graphs.")},async update(Z,Y){throw Error("Updating assistants is not supported. Assistants are generated from registered graphs.")},async getGraph(Z,Y){let X={};return(await(await cZ(Z,X)).getGraphAsync({...X,xray:Y?.xray??void 0})).toJSON()},async getSchemas(Z){let X=(await cZ(Z,{})).builder;return console.log(X),{graph_id:Z,state_schema:X._inputDefinition,input_schema:X._inputDefinition,output_schema:X._outputDefinition,config_schema:X._configSchema,context_schema:X._configSchema}},async getVersions(Z,Y){let X=await this.get(Z),J=Y?.offset??0,Q=Y?.limit;return Q?[X].slice(J,J+Q):[X].slice(J)},async setLatest(Z,Y){let X=await this.get(Z);return X.version=Y,X},async create(Z){if(console.warn("⚠️ Creating assistants is not supported. Assistants are generated from registered graphs. Returning mock data."),!Object.keys(m4).includes(Z.graphId)){if(Z.ifExists==="raise")throw Error(`Graph not found: ${Z.graphId}`)}return{assistant_id:Z.assistantId||Z.graphId,graph_id:Z.graphId,name:Z.name||Z.graphId,description:Z.description||"",metadata:Z.metadata||{},config:Z.config||{},version:1,created_at:new Date().toISOString(),updated_at:new Date().toISOString()}}},m0=()=>{let Z=()=>{return dZ.globalThreadsManager};return{assistants:zX,get threads(){return dZ.globalThreadsManager},runs:{list(Y,X){return Z().listRuns(Y,X)},async cancel(Y,X,J,Q){return await dZ.globalMessageQueue.cancelQueue(X)},async*stream(Y,X,J){J.config={...J.config??{},configurable:{...J.config?.configurable??{},graph_id:X,thread_id:Y}};let Q=Z();for await(let $ of NY(Q,Q.createRun(Y,X,J),J,{attempt:0,getGraph:cZ}))yield $},async*joinStream(Y,X,J){let Q=J&&typeof J==="object"&&"signal"in J?J:{},$=(J instanceof AbortSignal?J:Q.signal)||new AbortController().signal,K=null,U=null;try{K=await dZ.globalMessageQueue.getQueue(X);let W=await K.getAll();for(let z of W){if($.aborted)return;if(yield{id:z.id,event:z.event,data:z.data},z.event==="__stream_end__"||z.event==="__stream_error__"||z.event==="__stream_cancel__")return}U=K.onDataReceive();for await(let z of U){if($.aborted)break;let{event:H,data:G}=z;if(yield{id:z.id,event:H,data:G},z.event==="__stream_end__"||z.event==="__stream_error__"||z.event==="__stream_cancel__")break}}catch(W){if(!(W instanceof Error)||!W.message.includes("does not exist"))console.warn("Join stream failed:",W)}finally{if(U)try{await U.return(void 0)}catch(W){}}}}}};import{entrypoint as H2,getPreviousState as G2,getConfig as O2,Command as q2}from"@langchain/langgraph";import{schemaMetaRegistry as M2}from"@langchain/langgraph/zod";import{z as JZ}from"zod";var gY=(Z,Y)=>Z.constructor.name===Y.name,LZ=new Map;LZ.set(JZ.ZodBoolean.name,()=>!1),LZ.set(JZ.ZodNumber.name,()=>0),LZ.set(JZ.ZodString.name,()=>""),LZ.set(JZ.ZodArray.name,()=>[]),LZ.set(JZ.ZodRecord.name,()=>({})),LZ.set(JZ.ZodDefault.name,(Z)=>Z.def.defaultValue),LZ.set(JZ.ZodPipe.name,(Z)=>A4(Z.def.in)),LZ.set(JZ.ZodOptional.name,(Z)=>gY(Z.def.innerType,JZ.ZodDefault)?Z.def.innerType.def.defaultValue:void 0),LZ.set(JZ.ZodTuple.name,(Z)=>{let Y=[];for(let X of Z.def.items)Y.push(A4(X));return Y}),LZ.set(JZ.ZodPipe.name,(Z)=>A4(Z.def.in)),LZ.set(JZ.ZodUnion.name,(Z)=>A4(Z.def.options[0])),LZ.set(JZ.ZodObject.name,(Z)=>uY(Z)),LZ.set(JZ.ZodRecord.name,(Z)=>uY(Z)),LZ.set(JZ.ZodIntersection.name,(Z)=>uY(Z));function A4(Z){let Y=Z.constructor.name;if(!LZ.has(Y)){console.warn("getSchemaDefaultForField: Unhandled type",Z.constructor.name);return}return LZ.get(Y)(Z)}function uY(Z){if(gY(Z,JZ.ZodRecord))return{};if(gY(Z,JZ.ZodPipe))return uY(Z.def.in);if(gY(Z,JZ.ZodIntersection))return{...uY(Z.def.left),...uY(Z.def.right)};if(gY(Z,JZ.ZodUnion)){for(let Y of Z.def.options)if(gY(Y,JZ.ZodObject))return uY(Y);return console.warn("getSchemaDefaultObject: No object found in union, returning empty object"),{}}return gY(Z,JZ.ZodObject)?Object.fromEntries(Object.entries(Z.shape).map(([Y,X])=>[Y,A4(X)]).filter((Y)=>Y[1]!==void 0)):(console.warn(`getSchemaDefaultObject: Expected object schema, got ${Z.constructor.name}`),{})}import{tool as _2,HumanMessage as w2}from"langchain";import{z as AY}from"zod";var L2=AY.object({task_store:AY.record(AY.string(),AY.any()).default({})}),P2=AY.object({task_id:AY.string().optional().describe("The task id to ask the subagent, if not provided, will use the tool call id"),subagent_id:AY.string(),task_description:AY.string().describe("Describe the user state and what you want the subagent to do."),data_transfer:AY.any().optional().describe("Data to transfer to the subagent.")});import _ from"zod";var h=m0(),CJ=_.object({thread_id:_.string().optional(),thread_ts:_.string().optional()}).catchall(_.unknown()),J4=_.object({tags:_.array(_.string()).optional(),recursion_limit:_.number().int().optional(),configurable:CJ.optional()}).catchall(_.unknown()).describe("The configuration of an assistant.");_.object({assistant_id:_.string(),graph_id:_.string(),config:J4,created_at:_.string(),updated_at:_.string(),metadata:_.object({}).catchall(_.any())});var $Y=_.object({source:_.union([_.literal("input"),_.literal("loop"),_.literal("update"),_.string()]).optional(),step:_.number().optional(),writes:_.any().nullable().optional(),parents:_.any().optional()}).catchall(_.unknown()),HX=_.object({node:_.string(),input:_.unknown().optional()}),c0=_.object({update:_.union([_.any(),_.array(_.tuple([_.string(),_.any()]))]).nullable().optional(),resume:_.unknown().optional(),goto:_.union([HX,_.array(HX),_.string(),_.array(_.string())]).optional()});_.object({limit:_.number().int().optional(),offset:_.number().int().optional()});var VZ=_.object({thread_id:_.string()}),_4=_.object({thread_id:_.string(),run_id:_.string()}),RJ=_.object({graph_id:_.string().optional(),metadata:$Y.optional(),limit:_.number().int().optional(),offset:_.number().int().optional(),sort_by:_.enum(["assistant_id","graph_id","name","created_at","updated_at"]).optional(),sort_order:_.enum(["asc","desc"]).optional()}),vJ=_.object({graph_id:_.string().optional(),metadata:$Y.optional()}),IJ=_.object({xray:_.union([_.string(),_.boolean(),_.number()]).optional()}),GX=_.object({name:_.string().optional(),description:_.string().optional(),metadata:$Y.optional(),config:J4.optional()}).optional(),DJ=_.object({assistant_id:_.string().optional(),graph_id:_.string().describe("The ID of graph to create an assistant from."),name:_.string().optional(),description:_.string().optional(),metadata:$Y.optional(),config:J4.optional(),if_exists:_.enum(["raise","do_nothing"]).optional()}),VJ=_.object({assistant_id:_.union([_.string(),_.string()]),checkpoint_id:_.string().optional(),input:_.any().optional(),command:c0.optional(),metadata:$Y.optional(),config:J4.optional(),webhook:_.string().optional(),interrupt_before:_.union([_.literal("*"),_.array(_.string())]).optional(),interrupt_after:_.union([_.literal("*"),_.array(_.string())]).optional(),on_disconnect:_.enum(["cancel","continue"]).optional().default("continue"),multitask_strategy:_.enum(["reject","rollback","interrupt","enqueue"]).optional(),stream_mode:_.array(_.enum(["values","messages","messages-tuple","updates","events","debug","custom"])).optional(),stream_subgraphs:_.boolean().optional(),stream_resumable:_.boolean().optional(),after_seconds:_.number().optional(),if_not_exists:_.enum(["create","reject"]).optional(),on_completion:_.enum(["complete","continue"]).optional(),feedback_keys:_.array(_.string()).optional(),langsmith_tracer:_.unknown().optional()}).describe("Payload for creating a stateful run."),EJ=_.object({limit:_.coerce.number().int().optional().default(10),offset:_.coerce.number().int().optional().default(0),status:_.enum(["pending","running","error","success","timeout","interrupted"]).optional()}),bJ=_.object({wait:_.coerce.boolean().optional().default(!1),action:_.enum(["interrupt","rollback"]).optional().default("interrupt")}),TJ=_.object({cancel_on_disconnect:_.coerce.boolean().optional().default(!1),last_event_id:_.string().optional(),stream_mode:_.enum(["values","messages","messages-tuple","updates","events","debug","custom"]).optional()}),fJ=_.object({thread_id:_.string().describe("The ID of thread. If not provided, an ID is generated.").optional(),metadata:$Y.optional(),if_exists:_.union([_.literal("raise"),_.literal("do_nothing")]).optional()}).describe("Payload for creating a thread."),OX=_.object({ids:_.array(_.string()).describe("List of thread IDs to include. Others are excluded.").optional(),metadata:$Y.describe("Metadata to search for.").optional(),status:_.enum(["idle","busy","interrupted","error"]).describe("Filter by thread status.").optional(),values:_.any().describe("Filter by thread values.").optional(),limit:_.number().int().gte(1).lte(1000).describe("Maximum number to return.").optional(),offset:_.number().int().gte(0).describe("Offset to start from.").optional(),sort_by:_.enum(["thread_id","status","created_at","updated_at"]).describe("Sort by field.").optional(),sort_order:_.enum(["asc","desc"]).describe("Sort order.").optional(),select:_.array(_.enum(["thread_id","created_at","updated_at","metadata","config","context","status","values","interrupts"])).describe("Specify which fields to return. If not provided, all fields are returned.").optional(),without_details:_.boolean().describe("Whether to return values.").optional()}).describe("Payload for listing threads.");_.object({values:_.union([_.record(_.string(),_.unknown()),_.array(_.record(_.string(),_.unknown()))]).nullish()}).describe("Payload for adding state to a thread.");var jJ=_.object({metadata:$Y.optional(),status:_.enum(["idle","busy","interrupted","error"]).optional(),values:_.any().optional()}).describe("Payload for patching a thread."),qX=_.object({assistant_id:_.string(),input:_.any().optional(),command:c0.optional(),metadata:$Y.optional(),config:J4.optional(),webhook:_.string().optional(),interrupt_before:_.union([_.literal("*"),_.array(_.string())]).optional(),interrupt_after:_.union([_.literal("*"),_.array(_.string())]).optional(),on_disconnect:_.enum(["cancel","continue"]).optional().default("continue"),multitask_strategy:_.enum(["reject","rollback","interrupt","enqueue"]).optional(),stream_mode:_.array(_.enum(["values","messages","messages-tuple","updates","events","debug","custom"])).optional(),stream_subgraphs:_.boolean().optional(),stream_resumable:_.boolean().optional(),after_seconds:_.number().optional(),if_not_exists:_.enum(["create","reject"]).optional(),on_completion:_.enum(["complete","continue"]).optional(),feedback_keys:_.array(_.string()).optional(),langsmith_tracer:_.unknown().optional()}).describe("Payload for creating a run (background/wait)."),SJ=_.object({cancel_on_disconnect:_.coerce.boolean().optional().default(!1)}),yJ=_.object({cancel_on_disconnect:_.coerce.boolean().optional().default(!1)}),p4=_.object({assistant_id:_.string().describe("The assistant ID or graph name to run."),input:_.any().optional().describe("The input to the graph."),command:c0.optional(),metadata:$Y.optional().describe("Metadata to assign to the run."),config:J4.optional(),context:_.object({}).catchall(_.any()).optional().describe("Static context added to the assistant."),webhook:_.string().optional(),interrupt_before:_.union([_.literal("*"),_.array(_.string())]).optional(),interrupt_after:_.union([_.literal("*"),_.array(_.string())]).optional(),stream_mode:_.union([_.enum(["values","messages","messages-tuple","tasks","checkpoints","updates","events","debug","custom"]),_.array(_.enum(["values","messages","messages-tuple","tasks","checkpoints","updates","events","debug","custom"]))]).optional().default(["values"]),feedback_keys:_.array(_.string()).optional(),stream_subgraphs:_.boolean().optional().default(!1),stream_resumable:_.boolean().optional().default(!1)}).describe("Payload for creating a stateless run."),kJ=_.array(p4).min(1).describe("Payload for creating a batch of stateless runs."),hJ=_.object({action:_.enum(["interrupt","rollback"]).optional().default("interrupt").describe("Action to take when cancelling the run."),wait:_.coerce.boolean().optional().default(!1)}),xJ=_.union([_.object({status:_.enum(["pending","running","all"]).describe("Filter runs by status to cancel.")}),_.object({thread_id:_.string().describe("The ID of the thread containing runs to cancel.")}),_.object({run_ids:_.array(_.string()).min(1).describe("List of run IDs to cancel.")})]);function $Z(Z,Y){let X=Y.split("/").filter(($)=>$),J=new URL(Z).pathname.split("/").filter(($)=>$),Q={};return X.forEach(($,K)=>{if($.startsWith(":")){let U=$.slice(1);Q[U]=J[K]}}),Q}function lZ(Z){let Y=new URL(Z).searchParams,X={};return Y.forEach((J,Q)=>{if(!isNaN(Number(J))&&J!=="")X[Q]=Number(J);else if(J==="true"||J==="false")X[Q]=J==="true";else X[Q]=J}),X}function S(Z,Y){let X=Z.safeParse(Y);if(!X.success)throw new l0(X.error.issues);return X.data}class l0 extends Error{errors;constructor(Z){super("Validation failed");this.name="ValidationError",this.errors=Z}}function m(Z,Y=200,X){return new Response(JSON.stringify(Z),{status:Y,headers:{"Content-Type":"application/json",...X}})}function k(Z,Y=500){if(Z instanceof l0)return m({error:"Validation Error",details:Z.errors},400);return m({error:Z instanceof Error?Z.message:"Unknown error"},Y)}function i0(Z){let Y,X=!1,J=new AbortController,Q=new ReadableStream({async start($){Y=$;let K=new TextEncoder,U={signal:J.signal,writeSSE:async({data:W,event:z,id:H})=>{if(X||J.signal.aborted)return;try{let G="";if(H)G+=`id: ${H}
|
|
1
|
+
import{Y as _5,Z as w5}from"./chunk-1w5m9c5y.js";import{$ as t,_ as tY,aa as ZZ,ba as FZ,ca as CJ,da as WZ,ea as b1}from"./chunk-w69pf8zx.js";import{fa as a8,ga as Z5,ha as bJ,ia as bZ,ja as s0,ka as T1,la as G1,ma as gY,na as uZ,oa as d0}from"./chunk-c1gpr8nz.js";import{pa as g8,qa as X8,ra as r8,ta as H1,ua as K1,va as jZ}from"./chunk-b9fn4n7z.js";import{wa as UZ,xa as f1}from"./chunk-k1kzp019.js";import{Ba as z8,Ca as hY,Ea as xY,ya as U8,za as RW}from"./chunk-vyfvrrc8.js";import{Ga as p0,Ha as dY,Ia as lZ,Ka as dZ,La as lY,Ma as N4}from"./chunk-fmmsa2ry.js";import"./chunk-ba18by4y.js";import"./chunk-21w7a0t2.js";import{Wa as w4,Xa as W4}from"./chunk-xh3gtpfd.js";import{$a as K8,Ya as x,Za as N,_a as O,ab as SY,cb as c8,db as K4,eb as mZ,fb as v,gb as oZ,ib as u4,kb as V1,lb as PJ}from"./chunk-04kzaj7h.js";import{sb as R8}from"./chunk-1jj1bxmb.js";import{tb as J5,ub as G5,vb as W5,wb as $5,xb as Y5}from"./chunk-zf08x9b0.js";import"./chunk-cp9xkgbn.js";import"./chunk-y5pf2d0x.js";import"./chunk-v28dexnx.js";import"./chunk-4n978rje.js";import"./chunk-wtwgpw9g.js";import"./chunk-vkfhjhhh.js";import"./chunk-0gpa9n28.js";import{gc as L,ic as B7,jc as q$,kc as q}from"./chunk-feptb1bb.js";class x8{renderers=new Map;register(Z,Y){this.renderers.set(Z,Y)}get(Z){return this.renderers.get(Z)}has(Z){return this.renderers.has(Z)}list(){return Array.from(this.renderers.keys())}unregister(Z){this.renderers.delete(Z)}clear(){this.renderers.clear()}}var E4;var o0=q$(()=>{E4=new x8});var G8=L(v(),1),j1=new U8({defaultOptions:{queries:{retry:(Z,Y)=>{if(Y instanceof TypeError&&Y.message.includes("fetch"))return Z<2;return!1},refetchOnWindowFocus:!1,refetchOnMount:!0,refetchOnReconnect:!1,staleTime:300000,gcTime:600000,networkMode:"online"},mutations:{retry:1,networkMode:"online"}}});function H8({children:Z}){return G8.jsxDEV(z8,{client:j1,children:Z},void 0,!1,void 0,this)}var O8={async search(Z){let Y=Object.entries(p0).map(([$,K])=>({assistant_id:$,graph_id:$,config:{},metadata:{},version:1,name:$,description:"",created_at:new Date().toISOString(),updated_at:new Date().toISOString()}));if(Z?.graphId)Y=Y.filter(($)=>$.graph_id===Z.graphId);if(Z?.metadata&&Object.keys(Z.metadata).length>0)Y=Y.filter(($)=>{return Object.entries(Z.metadata).every(([K,W])=>{return $.metadata&&$.metadata[K]===W})});if(Z?.sortBy)Y.sort(($,K)=>{let W=$[Z.sortBy],U=K[Z.sortBy],z=W<U?-1:W>U?1:0;return Z.sortOrder==="desc"?-z:z});let X=Z?.offset??0,J=Z?.limit;return J?Y.slice(X,X+J):Y.slice(X)},async count(Z){return(await this.search(Z)).length},async get(Z){if(!Object.entries(p0).find(([X,J])=>X===Z))throw Error(`Assistant not found: ${Z}`);return{assistant_id:Z,graph_id:Z,config:{},created_at:new Date().toISOString(),updated_at:new Date().toISOString(),metadata:{},version:1,name:Z,description:""}},async delete(Z){throw Error("Deleting assistants is not supported. Assistants are generated from registered graphs.")},async update(Z,Y){throw Error("Updating assistants is not supported. Assistants are generated from registered graphs.")},async getGraph(Z,Y){let X={};return(await(await lZ(Z,X)).getGraphAsync({...X,xray:Y?.xray??void 0})).toJSON()},async getSchemas(Z){let X=(await lZ(Z,{})).builder;return console.log(X),{graph_id:Z,state_schema:X._inputDefinition,input_schema:X._inputDefinition,output_schema:X._outputDefinition,config_schema:X._configSchema,context_schema:X._configSchema}},async getVersions(Z,Y){let X=await this.get(Z),J=Y?.offset??0,Q=Y?.limit;return Q?[X].slice(J,J+Q):[X].slice(J)},async setLatest(Z,Y){let X=await this.get(Z);return X.version=Y,X},async create(Z){if(console.warn("⚠️ Creating assistants is not supported. Assistants are generated from registered graphs. Returning mock data."),!Object.keys(p0).includes(Z.graphId)){if(Z.ifExists==="raise")throw Error(`Graph not found: ${Z.graphId}`)}return{assistant_id:Z.assistantId||Z.graphId,graph_id:Z.graphId,name:Z.name||Z.graphId,description:Z.description||"",metadata:Z.metadata||{},config:Z.config||{},version:1,created_at:new Date().toISOString(),updated_at:new Date().toISOString()}}},cY=()=>{let Z=()=>{return dZ.globalThreadsManager};return{assistants:O8,get threads(){return dZ.globalThreadsManager},runs:{list(Y,X){return Z().listRuns(Y,X)},async cancel(Y,X,J,Q){return await dZ.globalMessageQueue.cancelQueue(X)},async*stream(Y,X,J){J.config={...J.config??{},configurable:{...J.config?.configurable??{},graph_id:X,thread_id:Y}};let Q=Z();for await(let $ of N4(Q,Q.createRun(Y,X,J),J,{attempt:0,getGraph:lZ}))yield $},async*joinStream(Y,X,J){let Q=J&&typeof J==="object"&&"signal"in J?J:{},$=(J instanceof AbortSignal?J:Q.signal)||new AbortController().signal,K=null,W=null;try{K=await dZ.globalMessageQueue.getQueue(X);let U=await K.getAll();for(let z of U){if($.aborted)return;if(yield{id:z.id,event:z.event,data:z.data},z.event==="__stream_end__"||z.event==="__stream_error__"||z.event==="__stream_cancel__")return}W=K.onDataReceive();for await(let z of W){if($.aborted)break;let{event:H,data:G}=z;if(yield{id:z.id,event:H,data:G},z.event==="__stream_end__"||z.event==="__stream_error__"||z.event==="__stream_cancel__")break}}catch(U){if(!(U instanceof Error)||!U.message.includes("does not exist"))console.warn("Join stream failed:",U)}finally{if(W)try{await W.return(void 0)}catch(U){}}}}}};import{entrypoint as m2,getPreviousState as p2,getConfig as c2,Command as d2}from"@langchain/langgraph";import{schemaMetaRegistry as i2}from"@langchain/langgraph/zod";import{z as QZ}from"zod";var x4=(Z,Y)=>Z.constructor.name===Y.name,LZ=new Map;LZ.set(QZ.ZodBoolean.name,()=>!1),LZ.set(QZ.ZodNumber.name,()=>0),LZ.set(QZ.ZodString.name,()=>""),LZ.set(QZ.ZodArray.name,()=>[]),LZ.set(QZ.ZodRecord.name,()=>({})),LZ.set(QZ.ZodDefault.name,(Z)=>Z.def.defaultValue),LZ.set(QZ.ZodPipe.name,(Z)=>_0(Z.def.in)),LZ.set(QZ.ZodOptional.name,(Z)=>x4(Z.def.innerType,QZ.ZodDefault)?Z.def.innerType.def.defaultValue:void 0),LZ.set(QZ.ZodTuple.name,(Z)=>{let Y=[];for(let X of Z.def.items)Y.push(_0(X));return Y}),LZ.set(QZ.ZodPipe.name,(Z)=>_0(Z.def.in)),LZ.set(QZ.ZodUnion.name,(Z)=>_0(Z.def.options[0])),LZ.set(QZ.ZodObject.name,(Z)=>g4(Z)),LZ.set(QZ.ZodRecord.name,(Z)=>g4(Z)),LZ.set(QZ.ZodIntersection.name,(Z)=>g4(Z));function _0(Z){let Y=Z.constructor.name;if(!LZ.has(Y)){console.warn("getSchemaDefaultForField: Unhandled type",Z.constructor.name);return}return LZ.get(Y)(Z)}function g4(Z){if(x4(Z,QZ.ZodRecord))return{};if(x4(Z,QZ.ZodPipe))return g4(Z.def.in);if(x4(Z,QZ.ZodIntersection))return{...g4(Z.def.left),...g4(Z.def.right)};if(x4(Z,QZ.ZodUnion)){for(let Y of Z.def.options)if(x4(Y,QZ.ZodObject))return g4(Y);return console.warn("getSchemaDefaultObject: No object found in union, returning empty object"),{}}return x4(Z,QZ.ZodObject)?Object.fromEntries(Object.entries(Z.shape).map(([Y,X])=>[Y,_0(X)]).filter((Y)=>Y[1]!==void 0)):(console.warn(`getSchemaDefaultObject: Expected object schema, got ${Z.constructor.name}`),{})}import{tool as n2,HumanMessage as a2}from"langchain";import{z as _4}from"zod";var t2=_4.object({task_store:_4.record(_4.string(),_4.any()).default({})}),e2=_4.object({task_id:_4.string().optional().describe("The task id to ask the subagent, if not provided, will use the tool call id"),subagent_id:_4.string(),task_description:_4.string().describe("Describe the user state and what you want the subagent to do."),data_transfer:_4.any().optional().describe("Data to transfer to the subagent.")});import w from"zod";var h=cY(),S1=w.object({thread_id:w.string().optional(),thread_ts:w.string().optional()}).catchall(w.unknown()),X0=w.object({tags:w.array(w.string()).optional(),recursion_limit:w.number().int().optional(),configurable:S1.optional()}).catchall(w.unknown()).describe("The configuration of an assistant.");w.object({assistant_id:w.string(),graph_id:w.string(),config:X0,created_at:w.string(),updated_at:w.string(),metadata:w.object({}).catchall(w.any())});var $4=w.object({source:w.union([w.literal("input"),w.literal("loop"),w.literal("update"),w.string()]).optional(),step:w.number().optional(),writes:w.any().nullable().optional(),parents:w.any().optional()}).catchall(w.unknown()),q8=w.object({node:w.string(),input:w.unknown().optional()}),iY=w.object({update:w.union([w.any(),w.array(w.tuple([w.string(),w.any()]))]).nullable().optional(),resume:w.unknown().optional(),goto:w.union([q8,w.array(q8),w.string(),w.array(w.string())]).optional()});w.object({limit:w.number().int().optional(),offset:w.number().int().optional()});var VZ=w.object({thread_id:w.string()}),w0=w.object({thread_id:w.string(),run_id:w.string()}),y1=w.object({graph_id:w.string().optional(),metadata:$4.optional(),limit:w.number().int().optional(),offset:w.number().int().optional(),sort_by:w.enum(["assistant_id","graph_id","name","created_at","updated_at"]).optional(),sort_order:w.enum(["asc","desc"]).optional()}),k1=w.object({graph_id:w.string().optional(),metadata:$4.optional()}),h1=w.object({xray:w.union([w.string(),w.boolean(),w.number()]).optional()}),F8=w.object({name:w.string().optional(),description:w.string().optional(),metadata:$4.optional(),config:X0.optional()}).optional(),x1=w.object({assistant_id:w.string().optional(),graph_id:w.string().describe("The ID of graph to create an assistant from."),name:w.string().optional(),description:w.string().optional(),metadata:$4.optional(),config:X0.optional(),if_exists:w.enum(["raise","do_nothing"]).optional()}),g1=w.object({assistant_id:w.union([w.string(),w.string()]),checkpoint_id:w.string().optional(),input:w.any().optional(),command:iY.optional(),metadata:$4.optional(),config:X0.optional(),webhook:w.string().optional(),interrupt_before:w.union([w.literal("*"),w.array(w.string())]).optional(),interrupt_after:w.union([w.literal("*"),w.array(w.string())]).optional(),on_disconnect:w.enum(["cancel","continue"]).optional().default("continue"),multitask_strategy:w.enum(["reject","rollback","interrupt","enqueue"]).optional(),stream_mode:w.array(w.enum(["values","messages","messages-tuple","updates","events","debug","custom"])).optional(),stream_subgraphs:w.boolean().optional(),stream_resumable:w.boolean().optional(),after_seconds:w.number().optional(),if_not_exists:w.enum(["create","reject"]).optional(),on_completion:w.enum(["complete","continue"]).optional(),feedback_keys:w.array(w.string()).optional(),langsmith_tracer:w.unknown().optional()}).describe("Payload for creating a stateful run."),u1=w.object({limit:w.coerce.number().int().optional().default(10),offset:w.coerce.number().int().optional().default(0),status:w.enum(["pending","running","error","success","timeout","interrupted"]).optional()}),m1=w.object({wait:w.coerce.boolean().optional().default(!1),action:w.enum(["interrupt","rollback"]).optional().default("interrupt")}),p1=w.object({cancel_on_disconnect:w.coerce.boolean().optional().default(!1),last_event_id:w.string().optional(),stream_mode:w.enum(["values","messages","messages-tuple","updates","events","debug","custom"]).optional()}),c1=w.object({thread_id:w.string().describe("The ID of thread. If not provided, an ID is generated.").optional(),metadata:$4.optional(),if_exists:w.union([w.literal("raise"),w.literal("do_nothing")]).optional()}).describe("Payload for creating a thread."),M8=w.object({ids:w.array(w.string()).describe("List of thread IDs to include. Others are excluded.").optional(),metadata:$4.describe("Metadata to search for.").optional(),status:w.enum(["idle","busy","interrupted","error"]).describe("Filter by thread status.").optional(),values:w.any().describe("Filter by thread values.").optional(),limit:w.number().int().gte(1).lte(1000).describe("Maximum number to return.").optional(),offset:w.number().int().gte(0).describe("Offset to start from.").optional(),sort_by:w.enum(["thread_id","status","created_at","updated_at"]).describe("Sort by field.").optional(),sort_order:w.enum(["asc","desc"]).describe("Sort order.").optional(),select:w.array(w.enum(["thread_id","created_at","updated_at","metadata","config","context","status","values","interrupts"])).describe("Specify which fields to return. If not provided, all fields are returned.").optional(),without_details:w.boolean().describe("Whether to return values.").optional()}).describe("Payload for listing threads.");w.object({values:w.union([w.record(w.string(),w.unknown()),w.array(w.record(w.string(),w.unknown()))]).nullish()}).describe("Payload for adding state to a thread.");var d1=w.object({metadata:$4.optional(),status:w.enum(["idle","busy","interrupted","error"]).optional(),values:w.any().optional()}).describe("Payload for patching a thread."),N8=w.object({assistant_id:w.string(),input:w.any().optional(),command:iY.optional(),metadata:$4.optional(),config:X0.optional(),webhook:w.string().optional(),interrupt_before:w.union([w.literal("*"),w.array(w.string())]).optional(),interrupt_after:w.union([w.literal("*"),w.array(w.string())]).optional(),on_disconnect:w.enum(["cancel","continue"]).optional().default("continue"),multitask_strategy:w.enum(["reject","rollback","interrupt","enqueue"]).optional(),stream_mode:w.array(w.enum(["values","messages","messages-tuple","updates","events","debug","custom"])).optional(),stream_subgraphs:w.boolean().optional(),stream_resumable:w.boolean().optional(),after_seconds:w.number().optional(),if_not_exists:w.enum(["create","reject"]).optional(),on_completion:w.enum(["complete","continue"]).optional(),feedback_keys:w.array(w.string()).optional(),langsmith_tracer:w.unknown().optional()}).describe("Payload for creating a run (background/wait)."),l1=w.object({cancel_on_disconnect:w.coerce.boolean().optional().default(!1)}),i1=w.object({cancel_on_disconnect:w.coerce.boolean().optional().default(!1)}),c0=w.object({assistant_id:w.string().describe("The assistant ID or graph name to run."),input:w.any().optional().describe("The input to the graph."),command:iY.optional(),metadata:$4.optional().describe("Metadata to assign to the run."),config:X0.optional(),context:w.object({}).catchall(w.any()).optional().describe("Static context added to the assistant."),webhook:w.string().optional(),interrupt_before:w.union([w.literal("*"),w.array(w.string())]).optional(),interrupt_after:w.union([w.literal("*"),w.array(w.string())]).optional(),stream_mode:w.union([w.enum(["values","messages","messages-tuple","tasks","checkpoints","updates","events","debug","custom"]),w.array(w.enum(["values","messages","messages-tuple","tasks","checkpoints","updates","events","debug","custom"]))]).optional().default(["values"]),feedback_keys:w.array(w.string()).optional(),stream_subgraphs:w.boolean().optional().default(!1),stream_resumable:w.boolean().optional().default(!1)}).describe("Payload for creating a stateless run."),r1=w.array(c0).min(1).describe("Payload for creating a batch of stateless runs."),o1=w.object({action:w.enum(["interrupt","rollback"]).optional().default("interrupt").describe("Action to take when cancelling the run."),wait:w.coerce.boolean().optional().default(!1)}),n1=w.union([w.object({status:w.enum(["pending","running","all"]).describe("Filter runs by status to cancel.")}),w.object({thread_id:w.string().describe("The ID of the thread containing runs to cancel.")}),w.object({run_ids:w.array(w.string()).min(1).describe("List of run IDs to cancel.")})]);function KZ(Z,Y){let X=Y.split("/").filter(($)=>$),J=new URL(Z).pathname.split("/").filter(($)=>$),Q={};return X.forEach(($,K)=>{if($.startsWith(":")){let W=$.slice(1);Q[W]=J[K]}}),Q}function iZ(Z){let Y=new URL(Z).searchParams,X={};return Y.forEach((J,Q)=>{if(!isNaN(Number(J))&&J!=="")X[Q]=Number(J);else if(J==="true"||J==="false")X[Q]=J==="true";else X[Q]=J}),X}function S(Z,Y){let X=Z.safeParse(Y);if(!X.success)throw new rY(X.error.issues);return X.data}class rY extends Error{errors;constructor(Z){super("Validation failed");this.name="ValidationError",this.errors=Z}}function m(Z,Y=200,X){return new Response(JSON.stringify(Z),{status:Y,headers:{"Content-Type":"application/json",...X}})}function k(Z,Y=500){if(Z instanceof rY)return m({error:"Validation Error",details:Z.errors},400);return m({error:Z instanceof Error?Z.message:"Unknown error"},Y)}function oY(Z){let Y,X=!1,J=new AbortController,Q=new ReadableStream({async start($){Y=$;let K=new TextEncoder,W={signal:J.signal,writeSSE:async({data:U,event:z,id:H})=>{if(X||J.signal.aborted)return;try{let G="";if(H)G+=`id: ${H}
|
|
2
2
|
`;if(z)G+=`event: ${z}
|
|
3
|
-
`;G+=`data: ${
|
|
3
|
+
`;G+=`data: ${U}
|
|
4
4
|
|
|
5
|
-
`,Y.enqueue(K.encode(G))}catch(G){if(!X&&!J.signal.aborted)throw G}},close:()=>{if(!X){X=!0;try{Y.close()}catch(
|
|
5
|
+
`,Y.enqueue(K.encode(G))}catch(G){if(!X&&!J.signal.aborted)throw G}},close:()=>{if(!X){X=!0;try{Y.close()}catch(U){}}}};try{await Z(W)}catch(U){if(!J.signal.aborted)console.error("SSE stream error:",U)}finally{if(!X){X=!0;try{Y.close()}catch(U){}}}},cancel(){if(X=!0,!J.signal.aborted)J.abort("Client disconnected")}});return new Response(Q,{headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"}})}function nY(Z,Y=process.env.HEARTBEAT_INTERVAL?parseInt(process.env.HEARTBEAT_INTERVAL):1500){return async(X)=>{let J=null,Q=!1,$=()=>{if(J)clearInterval(J),J=null},K=()=>{$(),J=setInterval(async()=>{if(X.signal.aborted||Q){$();return}try{await X.writeSSE({event:"ping",data:"{}"})}catch(z){$()}},Y)},W=()=>{$()};X.signal.addEventListener("abort",W);let U={signal:X.signal,writeSSE:async(z)=>{if(X.signal.aborted)return;if($(),await X.writeSSE(z),!X.signal.aborted)K()},close:()=>{$(),X.close()}};K();try{await Z(U)}finally{Q=!0,$(),X.signal.removeEventListener("abort",W)}}}async function a1(Z,Y){try{let X=await Z.json(),J=S(y1,X),Q=await h.assistants.search(FZ(J));return m(Q,200,{"X-Pagination-Total":"0"})}catch(X){return k(X)}}async function s1(Z,Y){try{let X=await Z.json(),J=S(k1,X),Q=await h.assistants.count(FZ(J));return m(Q)}catch(X){return k(X)}}async function t1(Z,Y){try{let Q=new URL(Z.url).pathname.split("/").filter((K)=>K)[1],$=await h.assistants.get(Q);return m($)}catch(X){return k(X)}}async function e1(Z,Y){try{let Q=new URL(Z.url).pathname.split("/").filter(($)=>$)[1];return await h.assistants.delete(Q),m({})}catch(X){return k(X)}}async function ZQ(Z,Y){try{let Q=new URL(Z.url).pathname.split("/").filter((U)=>U)[1],$=await Z.json(),K=S(F8,$),W=await h.assistants.update(Q,FZ(K));return m(W)}catch(X){return k(X)}}async function YQ(Z,Y){try{let Q=new URL(Z.url).pathname.split("/").filter((U)=>U)[1],$=iZ(Z.url),{xray:K}=S(h1,$),W=await h.assistants.getGraph(Q,{xray:K!==void 0?K==="true":void 0});return m(W)}catch(X){return k(X)}}async function XQ(Z,Y){return k({},501)}async function JQ(Z,Y){return k({},501)}async function QQ(Z,Y){try{let Q=new URL(Z.url).pathname.split("/").filter((K)=>K)[1],$=await h.assistants.getSchemas(Q);return m($)}catch(X){return k(X)}}async function $Q(Z,Y){try{let Q=new URL(Z.url).pathname.split("/").filter((U)=>U)[1],$=await Z.json(),K=S(F8,$),W=await h.assistants.getVersions(Q,FZ(K));return m(W)}catch(X){return k(X)}}async function KQ(Z,Y){try{let Q=new URL(Z.url).pathname.split("/").filter((U)=>U)[1],$=iZ(Z.url),K=$.version?parseInt($.version):1,W=await h.assistants.setLatest(Q,K);return m(W)}catch(X){return k(X)}}async function WQ(Z,Y){try{let X=await Z.json(),J=S(x1,X),Q=await h.assistants.create(FZ(J));return m(Q)}catch(X){return k(X)}}async function UQ(Z,Y){try{let X=await Z.json(),J=S(c1,X),Q=await h.threads.create(FZ(J));return m(Q)}catch(X){return k(X)}}async function zQ(Z,Y){try{let X=await Z.json(),J=S(M8,X),Q=await h.threads.search(FZ(J));return m(Q,200,{"X-Pagination-Total":Q.length.toString()})}catch(X){return k(X)}}async function HQ(Z,Y){try{let X=await Z.json(),J=S(M8.partial(),X),Q=await h.threads.count(FZ(J));return m(Q)}catch(X){return k(X)}}async function GQ(Z,Y){try{let X=KZ(Z.url,"/threads/:thread_id"),{thread_id:J}=S(VZ,X),Q=await h.threads.get(J);return m(Q)}catch(X){return k(X)}}async function OQ(Z,Y){try{let X=KZ(Z.url,"/threads/:thread_id"),{thread_id:J}=S(VZ,X),Q=await Z.json(),$=S(d1,Q),K=await h.threads.patch(J,FZ($));return m(K)}catch(X){return k(X)}}async function qQ(Z,Y){try{let X=KZ(Z.url,"/threads/:thread_id"),{thread_id:J}=S(VZ,X);return await h.threads.delete(J),new Response(null,{status:204})}catch(X){return k(X)}}async function FQ(Z,Y){try{let X=KZ(Z.url,"/threads/:thread_id/state"),{thread_id:J}=S(VZ,X),Q=iZ(Z.url),$={subgraphs:Q.subgraphs==="true"||Q.subgraphs===!0},K=await h.threads.getState(J,$);return m(K)}catch(X){return k(X)}}async function MQ(Z,Y){try{let X=KZ(Z.url,"/threads/:thread_id/state"),{thread_id:J}=S(VZ,X),Q=await Z.json(),$=await h.threads.updateState(J,FZ(Q));return m($)}catch(X){return k(X)}}async function NQ(Z,Y){try{let X=KZ(Z.url,"/threads/:thread_id/state/checkpoint"),{thread_id:J}=S(VZ,X),Q=await Z.json(),$=iZ(Z.url),K={subgraphs:$.subgraphs==="true"||$.subgraphs===!0,...Q},W=await h.threads.getState(J,K);return m(W)}catch(X){return k(X)}}async function _Q(Z,Y){try{let X=KZ(Z.url,"/threads/:thread_id/history"),{thread_id:J}=S(VZ,X),Q=iZ(Z.url),$={limit:Q.limit?parseInt(Q.limit,10):void 0,before:Q.before},K=await h.threads.getStateHistory(J,$);return m(K)}catch(X){return k(X)}}async function wQ(Z,Y){try{let X=KZ(Z.url,"/threads/:thread_id/history"),{thread_id:J}=S(VZ,X),Q=await Z.json(),$={limit:Q.limit,before:Q.before},K=await h.threads.getStateHistory(J,$);return m(K)}catch(X){return k(X)}}async function AQ(Z,Y){try{let X=KZ(Z.url,"/threads/:thread_id/copy"),{thread_id:J}=S(VZ,X),Q=await h.threads.copy(J);return m(Q)}catch(X){return k(X)}}async function BQ(Z,Y){try{let X=KZ(Z.url,"/threads/:thread_id/stream"),{thread_id:J}=S(VZ,X),Q=iZ(Z.url),$={lastEventId:Z.headers.get("Last-Event-ID")||Q.last_event_id,streamModes:Q.stream_modes?Array.isArray(Q.stream_modes)?Q.stream_modes:[Q.stream_modes]:void 0};return new Response(`data: {"status": "stream_ready"}
|
|
6
6
|
|
|
7
|
-
`,{headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"}})}catch(X){return k(X)}}async function HQ(Z,Y){try{let X=$Z(Z.url,"/threads/:thread_id/runs/stream"),{thread_id:J}=S(VZ,X),Q=await Z.json(),$=S(VJ,Q);return i0(r0(async(K)=>{$.config=$.config||{},$.config.configurable=$.config.configurable||{};let U=Y?.langgraph_context;if(U)Object.assign($.config.configurable,U);let W=null,z=!1,H=()=>{z=!0};K.signal.addEventListener("abort",H);try{W=h.runs.stream(J,$.assistant_id,FZ($));for await(let{event:G,data:F}of W){if(z||K.signal.aborted)break;await K.writeSSE({data:d0(F)??"",event:G})}}catch(G){if(!K.signal.aborted&&!z)throw G}finally{if(K.signal.removeEventListener("abort",H),W){try{await W.return(void 0)}catch(G){}W=null}}}))}catch(X){return k(X)}}async function GQ(Z,Y){try{let X=$Z(Z.url,"/threads/:thread_id/runs/:run_id/stream"),{thread_id:J,run_id:Q}=S(_4,X),$=lZ(Z.url),{cancel_on_disconnect:K,last_event_id:U,stream_mode:W}=S(TJ,$);return i0(r0(async(z)=>{let H=new AbortController,G=null,F=!1,M=[],A=()=>{H.abort("Client disconnected")};if(Z.signal)Z.signal.addEventListener("abort",A),M.push({signal:Z.signal,handler:A});let w=()=>{F=!0,H.abort("SSE stream closed")};z.signal.addEventListener("abort",w),M.push({signal:z.signal,handler:w});try{G=h.runs.joinStream(J,Q,{signal:H.signal,cancelOnDisconnect:K,lastEventId:U,streamMode:W?[W]:void 0});for await(let{event:P,data:B,id:R}of G){if(F||z.signal.aborted||H.signal.aborted)break;await z.writeSSE({data:d0(B)??"",event:P,id:R})}}catch(P){if(!(H.signal.aborted||z.signal.aborted)&&!(P instanceof Error&&P.message.includes("user cancel")))console.error("Join stream error:",P),await z.writeSSE({event:"error",data:JSON.stringify({error:P instanceof Error?P.message:"Unknown error"})})}finally{for(let{signal:P,handler:B}of M)try{P.removeEventListener("abort",B)}catch(R){}if(G){try{await G.return(void 0)}catch(P){}G=null}}}))}catch(X){return k(X)}}async function OQ(Z,Y){try{let X=$Z(Z.url,"/threads/:thread_id/runs"),{thread_id:J}=S(VZ,X),Q=lZ(Z.url),{limit:$,offset:K,status:U}=S(EJ,Q),W=await h.runs.list(J,{limit:$,offset:K,status:U});return m(W)}catch(X){return k(X)}}async function qQ(Z,Y){try{let X=$Z(Z.url,"/threads/:thread_id/runs/:run_id/cancel"),{thread_id:J,run_id:Q}=S(_4,X),$=lZ(Z.url),{wait:K,action:U}=S(bJ,$),W=h.runs.cancel(J,Q,K,U);if(K)await W;return new Response(null,{status:K?204:202})}catch(X){return k(X)}}async function FQ(Z,Y){try{let X=$Z(Z.url,"/threads/:thread_id/runs"),{thread_id:J}=S(VZ,X),Q=await Z.json(),$=S(qX,Q),K=FZ($);K.config=K.config||{},K.config.configurable=K.config.configurable||{};let U=Y?.langgraph_context;if(U)Object.assign(K.config.configurable,U);K.config.configurable.graph_id=$.assistant_id,K.config.configurable.thread_id=J;let W=h.threads,z=await W.createRun(J,$.assistant_id,K);return(async()=>{let H=!1;try{for await(let G of NY(W,z,K,{attempt:0,getGraph:cZ}));}catch(G){console.error("Background run error:",G)}finally{if(!H){H=!0;try{await dZ.globalMessageQueue.removeQueue(z.run_id)}catch(G){}}}})(),m(z,200,{"Content-Location":`/threads/${J}/runs/${z.run_id}`})}catch(X){return k(X)}}async function MQ(Z,Y){try{let X=$Z(Z.url,"/threads/:thread_id/runs/wait"),{thread_id:J}=S(VZ,X),Q=await Z.json(),$=S(qX,Q),K=lZ(Z.url),{cancel_on_disconnect:U}=S(SJ,K),W=FZ($);W.config=W.config||{},W.config.configurable=W.config.configurable||{};let z=Y?.langgraph_context;if(z)Object.assign(W.config.configurable,z);W.config.configurable.graph_id=$.assistant_id,W.config.configurable.thread_id=J;let H=h.threads,G=await H.createRun(J,$.assistant_id,W),F={};for await(let{event:M,data:A}of NY(H,G,W,{attempt:0,getGraph:cZ}))if(M==="end"||M==="writes/value"){if(A&&typeof A==="object")Object.assign(F,A)}return m(F,200,{"Content-Location":`/threads/${J}/runs/${G.run_id}`})}catch(X){return k(X)}}async function NQ(Z,Y){try{let X=$Z(Z.url,"/threads/:thread_id/runs/:run_id"),{thread_id:J,run_id:Q}=S(_4,X),K=(await h.runs.list(J,{limit:1000})).find((U)=>U.run_id===Q);if(!K)return k(Error("Run not found"),404);return m(K)}catch(X){return k(X)}}async function AQ(Z,Y){try{let X=$Z(Z.url,"/threads/:thread_id/runs/:run_id"),{thread_id:J,run_id:Q}=S(_4,X);return await h.threads.updateRun(Q,{status:"deleted"}),new Response(null,{status:204})}catch(X){return k(X)}}async function _Q(Z,Y){try{let X=$Z(Z.url,"/threads/:thread_id/runs/:run_id/join"),{thread_id:J,run_id:Q}=S(_4,X),$=lZ(Z.url),{cancel_on_disconnect:K}=S(yJ,$),W=(await h.runs.list(J,{limit:1000})).find((G)=>G.run_id===Q);if(!W)return k(Error("Run not found"),404);if(W.status==="success"||W.status==="error")return m({});let z=new AbortController;if(K){let G=()=>{z.abort("Client disconnected")};Z.signal?.addEventListener("abort",G)}let H={};for await(let{event:G,data:F}of h.runs.joinStream(J,Q,{signal:z.signal,cancelOnDisconnect:K}))if(G.event==="end"||G.event==="writes/value"){if(F&&typeof F==="object")Object.assign(H,F)}return m(H)}catch(X){return k(X)}}async function wQ(Z,Y){try{let X=await Z.json(),J=S(p4,X),Q=FZ(J);Q.config=Q.config||{},Q.config.configurable=Q.config.configurable||{};let $=Y?.langgraph_context;if($)Object.assign(Q.config.configurable,$);let K=h.threads,U=await K.create({metadata:{...Q.metadata,temporary:!0}});Q.config.configurable.graph_id=J.assistant_id,Q.config.configurable.thread_id=U.thread_id,Q.temporary=!0;let W=await K.createRun(U.thread_id,J.assistant_id,Q);return(async()=>{let z=!1;try{for await(let H of NY(K,W,Q,{attempt:0,getGraph:cZ}));}catch(H){console.error("Stateless run error:",H)}finally{try{await K.delete(U.thread_id)}catch(H){console.error("Error cleaning up temporary thread:",H)}if(!z){z=!0;try{await dZ.globalMessageQueue.removeQueue(W.run_id)}catch(H){}}}})(),m(W,200,{"Content-Location":`/threads/${U.thread_id}/runs/${W.run_id}`})}catch(X){return k(X)}}async function BQ(Z,Y){try{let X=await Z.json(),J=S(p4,X),Q=FZ(J);Q.config=Q.config||{},Q.config.configurable=Q.config.configurable||{};let $=Y?.langgraph_context;if($)Object.assign(Q.config.configurable,$);let K=h.threads,U=await K.create({metadata:{...Q.metadata,temporary:!0}});Q.config.configurable.graph_id=J.assistant_id,Q.config.configurable.thread_id=U.thread_id,Q.temporary=!0;let W=await K.createRun(U.thread_id,J.assistant_id,Q);return i0(r0(async(z)=>{try{for await(let H of NY(K,W,Q,{attempt:0,getGraph:cZ}))await z.writeSSE({data:JSON.stringify(H),event:"data"})}catch(H){if(H instanceof Error&&H.name!=="AbortError")throw console.error("Stream error:",H),H}finally{try{await K.delete(U.thread_id)}catch(H){console.error("Error cleaning up temporary thread:",H)}}}))}catch(X){return k(X)}}async function LQ(Z,Y){try{let X=await Z.json(),J=S(p4,X),Q=FZ(J);Q.config=Q.config||{},Q.config.configurable=Q.config.configurable||{};let $=Y?.langgraph_context;if($)Object.assign(Q.config.configurable,$);let K=h.threads,U=await K.create({metadata:{...Q.metadata,temporary:!0}});Q.config.configurable.graph_id=J.assistant_id,Q.config.configurable.thread_id=U.thread_id,Q.temporary=!0;let W=await K.createRun(U.thread_id,J.assistant_id,Q),z={};try{for await(let{event:H,data:G}of NY(K,W,Q,{attempt:0,getGraph:cZ}))if(H==="end"||H==="writes/value"){if(G&&typeof G==="object")Object.assign(z,G)}}finally{try{await K.delete(U.thread_id)}catch(H){console.error("Error cleaning up temporary thread:",H)}}return m(z,200,{"Content-Location":`/threads/${U.thread_id}/runs/${W.run_id}`})}catch(X){return k(X)}}async function PQ(Z,Y){try{let X=await Z.json(),J=S(kJ,X),Q=h.threads,$=[],K=J.map(async(W)=>{try{let z=FZ(W);z.config=z.config||{},z.config.configurable=z.config.configurable||{};let H=Y?.langgraph_context;if(H)Object.assign(z.config.configurable,H);let G=await Q.create({metadata:{...z.metadata,temporary:!0}});z.config.configurable.graph_id=W.assistant_id,z.config.configurable.thread_id=G.thread_id,z.temporary=!0;let F=await Q.createRun(G.thread_id,W.assistant_id,z);return(async()=>{let M=!1;try{for await(let A of NY(Q,F,z,{attempt:0,getGraph:cZ}));}catch(A){console.error("Batch run error:",A)}finally{try{await Q.delete(G.thread_id)}catch(A){console.error("Error cleaning up temporary thread:",A)}if(!M){M=!0;try{await dZ.globalMessageQueue.removeQueue(F.run_id)}catch(A){}}}})(),{thread_id:G.thread_id,run_id:F.run_id}}catch(z){return console.error("Batch run creation error:",z),{error:(z instanceof Error?z.message:"Unknown error")||"Unknown error"}}}),U=await Promise.all(K);return $.push(...U),m($,200)}catch(X){return k(X)}}async function CQ(Z,Y){try{let X=await Z.json(),J=S(xJ,X),Q=new URL(Z.url),$=S(hJ,{action:Q.searchParams.get("action")||"interrupt"}),K=h.threads,U=[];if("run_ids"in J&&J.run_ids)for(let W of J.run_ids)try{console.warn(`Cancel by run_id ${W} not fully implemented yet`)}catch(z){console.error(`Error cancelling run ${W}:`,z)}else if("thread_id"in J&&J.thread_id){let W=J.thread_id;try{let z=await K.listRuns(W,{limit:1000,offset:0});for(let H of z)try{h.runs.cancel(W,H.run_id,$.wait,$.action),U.push(H.run_id)}catch(G){console.error(`Error cancelling run ${H.run_id}:`,G)}}catch(z){console.error(`Error listing runs for thread ${W}:`,z)}}else if("status"in J&&J.status)console.warn(`Cancel by status ${J.status} not fully implemented yet`);return new Response(null,{status:204})}catch(X){return k(X)}}var RQ=[{method:"POST",pattern:/^\/assistants\/search$/,handler:gJ},{method:"POST",pattern:/^\/assistants\/count$/,handler:uJ},{method:"GET",pattern:/^\/assistants\/[^/]+$/,handler:mJ},{method:"DELETE",pattern:/^\/assistants\/[^/]+$/,handler:pJ},{method:"PATCH",pattern:/^\/assistants\/[^/]+$/,handler:dJ},{method:"GET",pattern:/^\/assistants\/[^/]+\/graph$/,handler:cJ},{method:"GET",pattern:/^\/assistants\/[^/]+\/subgraphs$/,handler:lJ},{method:"GET",pattern:/^\/assistants\/[^/]+\/subgraphs\/[^/]+$/,handler:iJ},{method:"GET",pattern:/^\/assistants\/[^/]+\/schemas$/,handler:rJ},{method:"POST",pattern:/^\/assistants\/[^/]+\/versions$/,handler:oJ},{method:"POST",pattern:/^\/assistants\/[^/]+\/latest$/,handler:nJ},{method:"POST",pattern:/^\/assistants$/,handler:aJ},{method:"POST",pattern:/^\/threads$/,handler:sJ},{method:"POST",pattern:/^\/threads\/search$/,handler:tJ},{method:"POST",pattern:/^\/threads\/count$/,handler:eJ},{method:"GET",pattern:/^\/threads\/[^/]+$/,handler:ZQ},{method:"PATCH",pattern:/^\/threads\/[^/]+$/,handler:YQ},{method:"DELETE",pattern:/^\/threads\/[^/]+$/,handler:XQ},{method:"GET",pattern:/^\/threads\/[^/]+\/state$/,handler:JQ},{method:"POST",pattern:/^\/threads\/[^/]+\/state$/,handler:QQ},{method:"POST",pattern:/^\/threads\/[^/]+\/state\/checkpoint$/,handler:$Q},{method:"GET",pattern:/^\/threads\/[^/]+\/history$/,handler:KQ},{method:"POST",pattern:/^\/threads\/[^/]+\/history$/,handler:WQ},{method:"POST",pattern:/^\/threads\/[^/]+\/copy$/,handler:UQ},{method:"GET",pattern:/^\/threads\/[^/]+\/stream$/,handler:zQ},{method:"POST",pattern:/^\/threads\/[^/]+\/runs$/,handler:FQ},{method:"POST",pattern:/^\/threads\/[^/]+\/runs\/stream$/,handler:HQ},{method:"POST",pattern:/^\/threads\/[^/]+\/runs\/wait$/,handler:MQ},{method:"POST",pattern:/^\/threads\/[^/]+\/runs\/[^/]+\/cancel$/,handler:qQ},{method:"GET",pattern:/^\/threads\/[^/]+\/runs$/,handler:OQ},{method:"GET",pattern:/^\/threads\/[^/]+\/runs\/[^/]+$/,handler:NQ},{method:"DELETE",pattern:/^\/threads\/[^/]+\/runs\/[^/]+$/,handler:AQ},{method:"GET",pattern:/^\/threads\/[^/]+\/runs\/[^/]+\/join$/,handler:_Q},{method:"GET",pattern:/^\/threads\/[^/]+\/runs\/[^/]+\/stream$/,handler:GQ},{method:"POST",pattern:/^\/runs$/,handler:wQ},{method:"POST",pattern:/^\/runs\/stream$/,handler:BQ},{method:"POST",pattern:/^\/runs\/wait$/,handler:LQ},{method:"POST",pattern:/^\/runs\/batch$/,handler:PQ},{method:"POST",pattern:/^\/runs\/cancel$/,handler:CQ}],vQ=(Z)=>{let Y=new URL(Z.url).pathname.toString(),X="";if(Y.includes("/threads"))X=Y.split("/threads")[0];else if(Y.includes("/assistants"))X=Y.split("/assistants")[0];return new Request(Z.url.replace(X,""),{method:Z.method,headers:Z.headers,body:Z.body,duplex:Z.duplex})};async function FX(Z,Y={}){Z=vQ(Z);try{await dZ.initGlobal();let J=new URL(Z.url).pathname,Q=Z.method;for(let $ of RQ)if($.method===Q&&$.pattern.test(J))return await $.handler(Z,Y);return new Response("Not Found",{status:404})}catch(X){return console.error("Request error:",X),k(X)}}await MX();p0("code",NX);var AX=(Z,Y={})=>{return FX(new Request(Z,Y),{})};import IQ from"openai";import DQ from"@anthropic-ai/sdk";import{GoogleGenerativeAI as VQ}from"@google/generative-ai";var EQ=async()=>{if(!process.env.ANTHROPIC_API_KEY)return[];let Z=[];try{for await(let Y of new DQ().beta.models.list())Z.push({id:Y.id,name:Y.display_name,provider:"anthropic"})}catch(Y){console.error("Failed to fetch Anthropic models:",Y)}return Z},bQ=async()=>{if(!process.env.OPENAI_API_KEY)return[];try{return await new IQ().models.list().then((Z)=>Z.data.map((Y)=>{return{id:Y.id,name:Y.id,provider:"openai"}}).sort((Y,X)=>Y.id.localeCompare(X.id)))}catch(Z){return console.error("Failed to fetch OpenAI models:",Z),[]}},TQ=async()=>{let Z=process.env.GEMINI_API_KEY;if(!Z)return[];let Y=[{id:"gemini-2.5-flash-preview-06-17",name:"Gemini 2.5 Flash Preview (06-17)",provider:"gemini"},{id:"gemini-2.5-pro-preview-06-05",name:"Gemini 2.5 Pro Preview (06-05)",provider:"gemini"},{id:"gemini-2.0-flash",name:"Gemini 2.0 Flash",provider:"gemini"},{id:"gemini-2.0-flash-lite",name:"Gemini 2.0 Flash Lite",provider:"gemini"},{id:"gemini-1.5-flash",name:"Gemini 1.5 Flash",provider:"gemini"},{id:"gemini-1.5-flash-8b",name:"Gemini 1.5 Flash 8B",provider:"gemini"},{id:"gemini-1.5-pro",name:"Gemini 1.5 Pro",provider:"gemini"},{id:"gemini-1.0-pro",name:"Gemini 1.0 Pro",provider:"gemini"},{id:"gemini-2.0-flash-exp",name:"Gemini 2.0 Flash Experimental",provider:"gemini"},{id:"gemini-exp-1206",name:"Gemini Experimental 1206",provider:"gemini"},{id:"gemini-2.5-pro-exp-03-25",name:"Gemini 2.5 Pro Experimental (03-25)",provider:"gemini"},{id:"gemini-2.5-flash-preview-05-20",name:"Gemini 2.5 Flash Preview (05-20)",provider:"gemini"}];try{return await new VQ(Z).getGenerativeModel({model:"gemini-1.5-flash"}),Y}catch(X){return console.error("Failed to verify Gemini API key:",X),[]}},_X=async()=>{return(await Promise.all([EQ().catch(()=>[]),bQ().catch(()=>[]),TQ().catch(()=>[])])).flat()};var c4=L(x(),1);function wX({tools:Z,setTools:Y}){let X=c4.useRef(!1);c4.useEffect(()=>{if(!X.current)Y(Z),X.current=!0},[Z,Y])}var LX=L(x(),1);function BX(Z){if(!Z)return{isValid:!1,needsSetup:!0,reason:"未找到配置文件"};if(!Z.providers||Z.providers.length===0)return{isValid:!1,needsSetup:!0,reason:"未配置任何 Provider"};let Y=Z.providers.find((X)=>X.id===Z.provider_id);if(!Y)return{isValid:!1,needsSetup:!0,reason:`Provider "${Z.provider_id}" 不存在`,invalidProviderRef:!0};if(!Y.apiKey||Y.apiKey.trim()==="")return{isValid:!1,needsSetup:!0,reason:`Provider "${Z.provider_id}" 未配置 API Key`,missingApiKey:!0};return{isValid:!0,needsSetup:!1}}function PX({config:Z}){return LX.useMemo(()=>{if(!Z)return{validation:null,needsSetup:!0,isValid:!1};let Y=BX(Z);return{validation:Y,needsSetup:Y.needsSetup,isValid:!Y.needsSetup}},[Z])}var CX=L(x(),1);function RX({shouldFocus:Z}){let Y=KY();CX.useEffect(()=>{if(Z)Y.focus("global-input")},[Z,Y])}var iZ=L(x(),1);function vX(){let[Z,Y]=iZ.useState("chat"),X=KY(),J=iZ.useCallback(()=>{Y("history")},[]),Q=iZ.useCallback(()=>{Y("knowledge")},[]),$=iZ.useCallback(()=>{Y("settings")},[]),K=iZ.useCallback(()=>{Y("model-provider")},[]),U=iZ.useCallback(()=>{Y("agent")},[]),W=iZ.useCallback(()=>{Y("task")},[]),z=iZ.useCallback(()=>{Y("mcp")},[]),H=iZ.useCallback(()=>{console.clear(),Y("chat"),X.focus("global-input")},[X]);return{activeView:Z,isChatView:Z==="chat",switchToHistory:J,switchToKnowledge:Q,switchToSettings:$,switchToModelProvider:K,switchToAgent:U,switchToTask:W,switchToMcp:z,closePanel:H}}var l4=L(x(),1);function fQ(Z){let Y=`# 任务:${Z.title}
|
|
7
|
+
`,{headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache",Connection:"keep-alive"}})}catch(X){return k(X)}}async function LQ(Z,Y){try{let X=KZ(Z.url,"/threads/:thread_id/runs/stream"),{thread_id:J}=S(VZ,X),Q=await Z.json(),$=S(g1,Q);return oY(nY(async(K)=>{$.config=$.config||{},$.config.configurable=$.config.configurable||{};let W=Y?.langgraph_context;if(W)Object.assign($.config.configurable,W);let U=null,z=!1,H=()=>{z=!0};K.signal.addEventListener("abort",H);try{U=h.runs.stream(J,$.assistant_id,FZ($));for await(let{event:G,data:F}of U){if(z||K.signal.aborted)break;await K.writeSSE({data:lY(F)??"",event:G})}}catch(G){if(!K.signal.aborted&&!z)throw G}finally{if(K.signal.removeEventListener("abort",H),U){try{await U.return(void 0)}catch(G){}U=null}}}))}catch(X){return k(X)}}async function PQ(Z,Y){try{let X=KZ(Z.url,"/threads/:thread_id/runs/:run_id/stream"),{thread_id:J,run_id:Q}=S(w0,X),$=iZ(Z.url),{cancel_on_disconnect:K,last_event_id:W,stream_mode:U}=S(p1,$);return oY(nY(async(z)=>{let H=new AbortController,G=null,F=!1,M=[],_=()=>{H.abort("Client disconnected")};if(Z.signal)Z.signal.addEventListener("abort",_),M.push({signal:Z.signal,handler:_});let A=()=>{F=!0,H.abort("SSE stream closed")};z.signal.addEventListener("abort",A),M.push({signal:z.signal,handler:A});try{G=h.runs.joinStream(J,Q,{signal:H.signal,cancelOnDisconnect:K,lastEventId:W,streamMode:U?[U]:void 0});for await(let{event:P,data:B,id:C}of G){if(F||z.signal.aborted||H.signal.aborted)break;await z.writeSSE({data:lY(B)??"",event:P,id:C})}}catch(P){if(!(H.signal.aborted||z.signal.aborted)&&!(P instanceof Error&&P.message.includes("user cancel")))console.error("Join stream error:",P),await z.writeSSE({event:"error",data:JSON.stringify({error:P instanceof Error?P.message:"Unknown error"})})}finally{for(let{signal:P,handler:B}of M)try{P.removeEventListener("abort",B)}catch(C){}if(G){try{await G.return(void 0)}catch(P){}G=null}}}))}catch(X){return k(X)}}async function RQ(Z,Y){try{let X=KZ(Z.url,"/threads/:thread_id/runs"),{thread_id:J}=S(VZ,X),Q=iZ(Z.url),{limit:$,offset:K,status:W}=S(u1,Q),U=await h.runs.list(J,{limit:$,offset:K,status:W});return m(U)}catch(X){return k(X)}}async function CQ(Z,Y){try{let X=KZ(Z.url,"/threads/:thread_id/runs/:run_id/cancel"),{thread_id:J,run_id:Q}=S(w0,X),$=iZ(Z.url),{wait:K,action:W}=S(m1,$),U=h.runs.cancel(J,Q,K,W);if(K)await U;return new Response(null,{status:K?204:202})}catch(X){return k(X)}}async function vQ(Z,Y){try{let X=KZ(Z.url,"/threads/:thread_id/runs"),{thread_id:J}=S(VZ,X),Q=await Z.json(),$=S(N8,Q),K=FZ($);K.config=K.config||{},K.config.configurable=K.config.configurable||{};let W=Y?.langgraph_context;if(W)Object.assign(K.config.configurable,W);K.config.configurable.graph_id=$.assistant_id,K.config.configurable.thread_id=J;let U=h.threads,z=await U.createRun(J,$.assistant_id,K);return(async()=>{let H=!1;try{for await(let G of N4(U,z,K,{attempt:0,getGraph:lZ}));}catch(G){console.error("Background run error:",G)}finally{if(!H){H=!0;try{await dZ.globalMessageQueue.removeQueue(z.run_id)}catch(G){}}}})(),m(z,200,{"Content-Location":`/threads/${J}/runs/${z.run_id}`})}catch(X){return k(X)}}async function IQ(Z,Y){try{let X=KZ(Z.url,"/threads/:thread_id/runs/wait"),{thread_id:J}=S(VZ,X),Q=await Z.json(),$=S(N8,Q),K=iZ(Z.url),{cancel_on_disconnect:W}=S(l1,K),U=FZ($);U.config=U.config||{},U.config.configurable=U.config.configurable||{};let z=Y?.langgraph_context;if(z)Object.assign(U.config.configurable,z);U.config.configurable.graph_id=$.assistant_id,U.config.configurable.thread_id=J;let H=h.threads,G=await H.createRun(J,$.assistant_id,U),F={};for await(let{event:M,data:_}of N4(H,G,U,{attempt:0,getGraph:lZ}))if(M==="end"||M==="writes/value"){if(_&&typeof _==="object")Object.assign(F,_)}return m(F,200,{"Content-Location":`/threads/${J}/runs/${G.run_id}`})}catch(X){return k(X)}}async function DQ(Z,Y){try{let X=KZ(Z.url,"/threads/:thread_id/runs/:run_id"),{thread_id:J,run_id:Q}=S(w0,X),K=(await h.runs.list(J,{limit:1000})).find((W)=>W.run_id===Q);if(!K)return k(Error("Run not found"),404);return m(K)}catch(X){return k(X)}}async function VQ(Z,Y){try{let X=KZ(Z.url,"/threads/:thread_id/runs/:run_id"),{thread_id:J,run_id:Q}=S(w0,X);return await h.threads.updateRun(Q,{status:"deleted"}),new Response(null,{status:204})}catch(X){return k(X)}}async function EQ(Z,Y){try{let X=KZ(Z.url,"/threads/:thread_id/runs/:run_id/join"),{thread_id:J,run_id:Q}=S(w0,X),$=iZ(Z.url),{cancel_on_disconnect:K}=S(i1,$),U=(await h.runs.list(J,{limit:1000})).find((G)=>G.run_id===Q);if(!U)return k(Error("Run not found"),404);if(U.status==="success"||U.status==="error")return m({});let z=new AbortController;if(K){let G=()=>{z.abort("Client disconnected")};Z.signal?.addEventListener("abort",G)}let H={};for await(let{event:G,data:F}of h.runs.joinStream(J,Q,{signal:z.signal,cancelOnDisconnect:K}))if(G.event==="end"||G.event==="writes/value"){if(F&&typeof F==="object")Object.assign(H,F)}return m(H)}catch(X){return k(X)}}async function bQ(Z,Y){try{let X=await Z.json(),J=S(c0,X),Q=FZ(J);Q.config=Q.config||{},Q.config.configurable=Q.config.configurable||{};let $=Y?.langgraph_context;if($)Object.assign(Q.config.configurable,$);let K=h.threads,W=await K.create({metadata:{...Q.metadata,temporary:!0}});Q.config.configurable.graph_id=J.assistant_id,Q.config.configurable.thread_id=W.thread_id,Q.temporary=!0;let U=await K.createRun(W.thread_id,J.assistant_id,Q);return(async()=>{let z=!1;try{for await(let H of N4(K,U,Q,{attempt:0,getGraph:lZ}));}catch(H){console.error("Stateless run error:",H)}finally{try{await K.delete(W.thread_id)}catch(H){console.error("Error cleaning up temporary thread:",H)}if(!z){z=!0;try{await dZ.globalMessageQueue.removeQueue(U.run_id)}catch(H){}}}})(),m(U,200,{"Content-Location":`/threads/${W.thread_id}/runs/${U.run_id}`})}catch(X){return k(X)}}async function TQ(Z,Y){try{let X=await Z.json(),J=S(c0,X),Q=FZ(J);Q.config=Q.config||{},Q.config.configurable=Q.config.configurable||{};let $=Y?.langgraph_context;if($)Object.assign(Q.config.configurable,$);let K=h.threads,W=await K.create({metadata:{...Q.metadata,temporary:!0}});Q.config.configurable.graph_id=J.assistant_id,Q.config.configurable.thread_id=W.thread_id,Q.temporary=!0;let U=await K.createRun(W.thread_id,J.assistant_id,Q);return oY(nY(async(z)=>{try{for await(let H of N4(K,U,Q,{attempt:0,getGraph:lZ}))await z.writeSSE({data:JSON.stringify(H),event:"data"})}catch(H){if(H instanceof Error&&H.name!=="AbortError")throw console.error("Stream error:",H),H}finally{try{await K.delete(W.thread_id)}catch(H){console.error("Error cleaning up temporary thread:",H)}}}))}catch(X){return k(X)}}async function fQ(Z,Y){try{let X=await Z.json(),J=S(c0,X),Q=FZ(J);Q.config=Q.config||{},Q.config.configurable=Q.config.configurable||{};let $=Y?.langgraph_context;if($)Object.assign(Q.config.configurable,$);let K=h.threads,W=await K.create({metadata:{...Q.metadata,temporary:!0}});Q.config.configurable.graph_id=J.assistant_id,Q.config.configurable.thread_id=W.thread_id,Q.temporary=!0;let U=await K.createRun(W.thread_id,J.assistant_id,Q),z={};try{for await(let{event:H,data:G}of N4(K,U,Q,{attempt:0,getGraph:lZ}))if(H==="end"||H==="writes/value"){if(G&&typeof G==="object")Object.assign(z,G)}}finally{try{await K.delete(W.thread_id)}catch(H){console.error("Error cleaning up temporary thread:",H)}}return m(z,200,{"Content-Location":`/threads/${W.thread_id}/runs/${U.run_id}`})}catch(X){return k(X)}}async function jQ(Z,Y){try{let X=await Z.json(),J=S(r1,X),Q=h.threads,$=[],K=J.map(async(U)=>{try{let z=FZ(U);z.config=z.config||{},z.config.configurable=z.config.configurable||{};let H=Y?.langgraph_context;if(H)Object.assign(z.config.configurable,H);let G=await Q.create({metadata:{...z.metadata,temporary:!0}});z.config.configurable.graph_id=U.assistant_id,z.config.configurable.thread_id=G.thread_id,z.temporary=!0;let F=await Q.createRun(G.thread_id,U.assistant_id,z);return(async()=>{let M=!1;try{for await(let _ of N4(Q,F,z,{attempt:0,getGraph:lZ}));}catch(_){console.error("Batch run error:",_)}finally{try{await Q.delete(G.thread_id)}catch(_){console.error("Error cleaning up temporary thread:",_)}if(!M){M=!0;try{await dZ.globalMessageQueue.removeQueue(F.run_id)}catch(_){}}}})(),{thread_id:G.thread_id,run_id:F.run_id}}catch(z){return console.error("Batch run creation error:",z),{error:(z instanceof Error?z.message:"Unknown error")||"Unknown error"}}}),W=await Promise.all(K);return $.push(...W),m($,200)}catch(X){return k(X)}}async function SQ(Z,Y){try{let X=await Z.json(),J=S(n1,X),Q=new URL(Z.url),$=S(o1,{action:Q.searchParams.get("action")||"interrupt"}),K=h.threads,W=[];if("run_ids"in J&&J.run_ids)for(let U of J.run_ids)try{console.warn(`Cancel by run_id ${U} not fully implemented yet`)}catch(z){console.error(`Error cancelling run ${U}:`,z)}else if("thread_id"in J&&J.thread_id){let U=J.thread_id;try{let z=await K.listRuns(U,{limit:1000,offset:0});for(let H of z)try{h.runs.cancel(U,H.run_id,$.wait,$.action),W.push(H.run_id)}catch(G){console.error(`Error cancelling run ${H.run_id}:`,G)}}catch(z){console.error(`Error listing runs for thread ${U}:`,z)}}else if("status"in J&&J.status)console.warn(`Cancel by status ${J.status} not fully implemented yet`);return new Response(null,{status:204})}catch(X){return k(X)}}var yQ=[{method:"POST",pattern:/^\/assistants\/search$/,handler:a1},{method:"POST",pattern:/^\/assistants\/count$/,handler:s1},{method:"GET",pattern:/^\/assistants\/[^/]+$/,handler:t1},{method:"DELETE",pattern:/^\/assistants\/[^/]+$/,handler:e1},{method:"PATCH",pattern:/^\/assistants\/[^/]+$/,handler:ZQ},{method:"GET",pattern:/^\/assistants\/[^/]+\/graph$/,handler:YQ},{method:"GET",pattern:/^\/assistants\/[^/]+\/subgraphs$/,handler:XQ},{method:"GET",pattern:/^\/assistants\/[^/]+\/subgraphs\/[^/]+$/,handler:JQ},{method:"GET",pattern:/^\/assistants\/[^/]+\/schemas$/,handler:QQ},{method:"POST",pattern:/^\/assistants\/[^/]+\/versions$/,handler:$Q},{method:"POST",pattern:/^\/assistants\/[^/]+\/latest$/,handler:KQ},{method:"POST",pattern:/^\/assistants$/,handler:WQ},{method:"POST",pattern:/^\/threads$/,handler:UQ},{method:"POST",pattern:/^\/threads\/search$/,handler:zQ},{method:"POST",pattern:/^\/threads\/count$/,handler:HQ},{method:"GET",pattern:/^\/threads\/[^/]+$/,handler:GQ},{method:"PATCH",pattern:/^\/threads\/[^/]+$/,handler:OQ},{method:"DELETE",pattern:/^\/threads\/[^/]+$/,handler:qQ},{method:"GET",pattern:/^\/threads\/[^/]+\/state$/,handler:FQ},{method:"POST",pattern:/^\/threads\/[^/]+\/state$/,handler:MQ},{method:"POST",pattern:/^\/threads\/[^/]+\/state\/checkpoint$/,handler:NQ},{method:"GET",pattern:/^\/threads\/[^/]+\/history$/,handler:_Q},{method:"POST",pattern:/^\/threads\/[^/]+\/history$/,handler:wQ},{method:"POST",pattern:/^\/threads\/[^/]+\/copy$/,handler:AQ},{method:"GET",pattern:/^\/threads\/[^/]+\/stream$/,handler:BQ},{method:"POST",pattern:/^\/threads\/[^/]+\/runs$/,handler:vQ},{method:"POST",pattern:/^\/threads\/[^/]+\/runs\/stream$/,handler:LQ},{method:"POST",pattern:/^\/threads\/[^/]+\/runs\/wait$/,handler:IQ},{method:"POST",pattern:/^\/threads\/[^/]+\/runs\/[^/]+\/cancel$/,handler:CQ},{method:"GET",pattern:/^\/threads\/[^/]+\/runs$/,handler:RQ},{method:"GET",pattern:/^\/threads\/[^/]+\/runs\/[^/]+$/,handler:DQ},{method:"DELETE",pattern:/^\/threads\/[^/]+\/runs\/[^/]+$/,handler:VQ},{method:"GET",pattern:/^\/threads\/[^/]+\/runs\/[^/]+\/join$/,handler:EQ},{method:"GET",pattern:/^\/threads\/[^/]+\/runs\/[^/]+\/stream$/,handler:PQ},{method:"POST",pattern:/^\/runs$/,handler:bQ},{method:"POST",pattern:/^\/runs\/stream$/,handler:TQ},{method:"POST",pattern:/^\/runs\/wait$/,handler:fQ},{method:"POST",pattern:/^\/runs\/batch$/,handler:jQ},{method:"POST",pattern:/^\/runs\/cancel$/,handler:SQ}],kQ=(Z)=>{let Y=new URL(Z.url).pathname.toString(),X="";if(Y.includes("/threads"))X=Y.split("/threads")[0];else if(Y.includes("/assistants"))X=Y.split("/assistants")[0];return new Request(Z.url.replace(X,""),{method:Z.method,headers:Z.headers,body:Z.body,duplex:Z.duplex})};async function _8(Z,Y={}){Z=kQ(Z);try{await dZ.initGlobal();let J=new URL(Z.url).pathname,Q=Z.method;for(let $ of yQ)if($.method===Q&&$.pattern.test(J))return await $.handler(Z,Y);return new Response("Not Found",{status:404})}catch(X){return console.error("Request error:",X),k(X)}}import{execa as A8}from"execa";import hQ from"extract-zip";import xQ from"fs-extra";import*as A0 from"node:os";import{dirname as B8,join as gQ}from"node:path";import{pipeline as uQ}from"node:stream/promises";import{fileURLToPath as mQ}from"node:url";import{pathExists as w8}from"path-exists";import{temporaryFile as pQ}from"tempy";import{xdgCache as cQ}from"xdg-basedir";var{mkdir:sY,createWriteStream:dQ,move:lQ}=xQ,L8=B8(mQ(import.meta.url)),iQ="microsoft/ripgrep-prebuilt",aY=process.env.RIPGREP_VERSION||"v15.0.0",rQ=()=>{let Z=process.env.npm_config_arch||A0.arch(),Y=process.env.platform||A0.platform();switch(Y){case"darwin":switch(Z){case"arm64":return"aarch64-apple-darwin.tar.gz";default:return"x86_64-apple-darwin.tar.gz"}case"win32":switch(Z){case"x64":return"x86_64-pc-windows-msvc.zip";case"arm":return"aarch64-pc-windows-msvc.zip";default:return"i686-pc-windows-msvc.zip"}case"linux":switch(Z){case"x64":return"x86_64-unknown-linux-musl.tar.gz";case"arm":case"armv7l":return"arm-unknown-linux-gnueabihf.tar.gz";case"arm64":return"aarch64-unknown-linux-gnu.tar.gz";case"ppc64":return"powerpc64le-unknown-linux-gnu.tar.gz";case"s390x":return"s390x-unknown-linux-gnu.tar.gz";default:return"i686-unknown-linux-musl.tar.gz"}default:throw Error("Unknown platform: "+Y)}},oQ=async(Z,Y)=>{try{let X=pQ(),J=await fetch(Z);if(!J.ok)throw Error(`HTTP ${J.status}: ${J.statusText}`);await uQ(J.body,dQ(X)),await sY(B8(Y),{recursive:!0}),await lQ(X,Y)}catch(X){throw console.error(`Failed to download "${Z}"`),X}},nQ=async(Z,Y)=>{try{await sY(Y,{recursive:!0}),await hQ(Z,{dir:Y})}catch(X){throw console.error(`Failed to unzip "${Z}"`),X}},aQ=async(Z,Y)=>{try{await sY(Y,{recursive:!0}),await A8("tar",["xvf",Z,"-C",Y])}catch(X){throw console.error(`Failed to extract "${Z}"`),X}},sQ=async(Z)=>{if(Z==="android")try{return await A8("pkg",["install","ripgrep","-y"]),!0}catch(Y){return console.info("Could not install ripgrep via pkg. Falling back to download."),!1}return!1},tQ=gQ(L8,`rg${process.platform==="win32"?".exe":""}`),P8=async(Z)=>{if(await w8(tQ)){console.log("rg cached");return}let Y=process.env.platform||A0.platform();if(Y==="android"){if(await sQ(Y))return}let X=rQ(),Q=`${process.env.RIPGREP_PREBUILT_BINARIES_MIRROR||`https://v6.gh-proxy.org/https://github.com/${iQ}/releases/download`}/${aY}/ripgrep-${aY}-${X}`,$=`${cQ}/vscode-ripgrep/ripgrep-${aY}-${X}`,K=Z??L8;if(!await w8($))await oQ(Q,$);else console.info(`File ${$} has been cached`);if($.endsWith(".tar.gz"))await aQ($,K);else if($.endsWith(".zip"))await nQ($,K);else throw Error(`Invalid downloadPath ${$}`)};await P8();dY("code",R8);var C8=(Z,Y={})=>{return _8(new Request(Z,Y),{})};import eQ from"openai";import Z$ from"@anthropic-ai/sdk";import{GoogleGenerativeAI as Y$}from"@google/generative-ai";var X$=async()=>{if(!process.env.ANTHROPIC_API_KEY)return[];let Z=[];try{for await(let Y of new Z$().beta.models.list())Z.push({id:Y.id,name:Y.display_name,provider:"anthropic"})}catch(Y){console.error("Failed to fetch Anthropic models:",Y)}return Z},J$=async()=>{if(!process.env.OPENAI_API_KEY)return[];try{return await new eQ().models.list().then((Z)=>Z.data.map((Y)=>{return{id:Y.id,name:Y.id,provider:"openai"}}).sort((Y,X)=>Y.id.localeCompare(X.id)))}catch(Z){return console.error("Failed to fetch OpenAI models:",Z),[]}},Q$=async()=>{let Z=process.env.GEMINI_API_KEY;if(!Z)return[];let Y=[{id:"gemini-2.5-flash-preview-06-17",name:"Gemini 2.5 Flash Preview (06-17)",provider:"gemini"},{id:"gemini-2.5-pro-preview-06-05",name:"Gemini 2.5 Pro Preview (06-05)",provider:"gemini"},{id:"gemini-2.0-flash",name:"Gemini 2.0 Flash",provider:"gemini"},{id:"gemini-2.0-flash-lite",name:"Gemini 2.0 Flash Lite",provider:"gemini"},{id:"gemini-1.5-flash",name:"Gemini 1.5 Flash",provider:"gemini"},{id:"gemini-1.5-flash-8b",name:"Gemini 1.5 Flash 8B",provider:"gemini"},{id:"gemini-1.5-pro",name:"Gemini 1.5 Pro",provider:"gemini"},{id:"gemini-1.0-pro",name:"Gemini 1.0 Pro",provider:"gemini"},{id:"gemini-2.0-flash-exp",name:"Gemini 2.0 Flash Experimental",provider:"gemini"},{id:"gemini-exp-1206",name:"Gemini Experimental 1206",provider:"gemini"},{id:"gemini-2.5-pro-exp-03-25",name:"Gemini 2.5 Pro Experimental (03-25)",provider:"gemini"},{id:"gemini-2.5-flash-preview-05-20",name:"Gemini 2.5 Flash Preview (05-20)",provider:"gemini"}];try{return await new Y$(Z).getGenerativeModel({model:"gemini-1.5-flash"}),Y}catch(X){return console.error("Failed to verify Gemini API key:",X),[]}},v8=async()=>{return(await Promise.all([X$().catch(()=>[]),J$().catch(()=>[]),Q$().catch(()=>[])])).flat()};var l0=L(x(),1);function I8({tools:Z,setTools:Y}){let X=l0.useRef(!1);l0.useEffect(()=>{if(!X.current)Y(Z),X.current=!0},[Z,Y])}var V8=L(x(),1);function D8(Z){if(!Z)return{isValid:!1,needsSetup:!0,reason:"未找到配置文件"};if(!Z.providers||Z.providers.length===0)return{isValid:!1,needsSetup:!0,reason:"未配置任何 Provider"};let Y=Z.providers.find((X)=>X.id===Z.provider_id);if(!Y)return{isValid:!1,needsSetup:!0,reason:`Provider "${Z.provider_id}" 不存在`,invalidProviderRef:!0};if(!Y.apiKey||Y.apiKey.trim()==="")return{isValid:!1,needsSetup:!0,reason:`Provider "${Z.provider_id}" 未配置 API Key`,missingApiKey:!0};return{isValid:!0,needsSetup:!1}}function E8({config:Z}){return V8.useMemo(()=>{if(!Z)return{validation:null,needsSetup:!0,isValid:!1};let Y=D8(Z);return{validation:Y,needsSetup:Y.needsSetup,isValid:!Y.needsSetup}},[Z])}var b8=L(x(),1);function T8({shouldFocus:Z}){let Y=K4();b8.useEffect(()=>{if(Z)Y.focus("global-input")},[Z,Y])}var rZ=L(x(),1);function f8(){let[Z,Y]=rZ.useState("chat"),X=K4(),J=rZ.useCallback(()=>{Y("history")},[]),Q=rZ.useCallback(()=>{Y("knowledge")},[]),$=rZ.useCallback(()=>{Y("settings")},[]),K=rZ.useCallback(()=>{Y("model-provider")},[]),W=rZ.useCallback(()=>{Y("agent")},[]),U=rZ.useCallback(()=>{Y("task")},[]),z=rZ.useCallback(()=>{Y("mcp")},[]),H=rZ.useCallback(()=>{Y("chat"),X.focus("global-input")},[X]);return{activeView:Z,isChatView:Z==="chat",switchToHistory:J,switchToKnowledge:Q,switchToSettings:$,switchToModelProvider:K,switchToAgent:W,switchToTask:U,switchToMcp:z,closePanel:H}}var i0=L(x(),1);function $$(Z){let Y=`# 任务:${Z.title}
|
|
8
8
|
|
|
9
9
|
`;if(Y+=`**描述:**
|
|
10
10
|
${Z.description}
|
|
@@ -31,22 +31,22 @@ ${Z.acceptanceCriteria.map((X,J)=>`${J+1}. ${X}`).join(`
|
|
|
31
31
|
${X.acceptanceCriteria.map((Q)=>`- ${Q}`).join(`
|
|
32
32
|
`)}
|
|
33
33
|
`}),Y+=`
|
|
34
|
-
`;return Y.trim()}function
|
|
34
|
+
`;return Y.trim()}function j8(Z){let{sendMessage:Y,createNewChat:X}=WZ(),{extraParams:J}=UZ(),{closePanel:Q}=Z,$=i0.useMemo(()=>{return{...J,is_in_task:!0}},[J]);return{handleExecuteTask:i0.useCallback((W)=>{let z=[{type:"human",content:`${$$(W)}
|
|
35
35
|
|
|
36
|
-
请你先写一个 TODO LIST 然后开始这个任务,最后完成任务的时候,使用 commit_task`}];X(WY).then(()=>{return Y(z,{extraParams:$,metadata:WY})}).then(()=>{_Y("任务已发送给 Agent"),Q()}).catch((H)=>{console.error("Task execution failed:",H),_Y("任务执行失败")})},[Y,X,$,Q])}}var i4=L(x(),1),EX=L(v(),1),DX=i4.createContext(void 0),Q4=()=>{let Z=i4.useContext(DX);if(Z===void 0)throw Error("useChatPanel must be used within ChatPanelProvider. Make sure your component is a child of ChatController.");return Z},VX=({children:Z,value:Y})=>{return EX.jsxDEV(DX.Provider,{value:Y,children:Z},void 0,!1,void 0,this)};var dY=L(x(),1);var bX=(Z)=>{return Z.additional_kwargs?.reasoning_content||Array.isArray(Z.content)&&Z.content.find((Y)=>Y.type==="thinking")?.thinking},$4=(Z)=>{return typeof Z.content==="string"?Z.content:Z.content?.filter((Y)=>{return Y.type==="text"}).map((Y)=>Y.text).join("")};r4();var n0=L(x(),1),s=L(v(),1),mQ={approve:"green",reject:"red",edit:"yellow",modify:"cyan"},pQ=(Z)=>{return mQ[Z.toLowerCase()]||"white"},jX=({request:Z,allowedDecisions:Y=["approve","edit","reject"],onApprove:X,onEdit:J,onReject:Q,autoFocus:$=!0})=>{let[K,U]=n0.useState("approve"),{value:W,setTrue:z,setFalse:H}=fX(!1),[G,F]=n0.useState(""),M=KY(),A=Z.messageIndex,w=Z.description;uZ((E,d)=>{if(W&&d.escape)B()},{isActive:W});let P=()=>{if(!G.trim())return;if(K==="edit")try{let E=JSON.parse(G);J(E)}catch(E){console.error("Invalid JSON:",E);return}else{let E=`User rejected to run this tool, reason: ${G}`;Q(E)}H(),F("")},B=()=>{H(),F("")},R=([E])=>{if(E==="approve"){X(),M.focus("global-input");return}if(U(E),z(),E==="edit")F(JSON.stringify(Z.toolCall.args,null,2));else F("")},C=Y.map((E)=>({label:E,value:E}));return W?(()=>{let E=pQ(K),d=K==="edit";return s.jsxDEV(N,{flexDirection:"column",paddingX:1,marginTop:0,children:[s.jsxDEV(N,{flexDirection:"column",marginBottom:1,children:[s.jsxDEV(O,{color:E,bold:!0,children:[K.toUpperCase()," MODE - ",Z.toolCall.name]},void 0,!0,void 0,this),A!==void 0&&s.jsxDEV(O,{color:"gray",dimColor:!0,children:["Message Index: ",A]},void 0,!0,void 0,this),w&&s.jsxDEV(O,{color:"gray",dimColor:!0,children:["Description: ",w]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),d?s.jsxDEV(N,{flexDirection:"column",marginTop:0,children:[s.jsxDEV(O,{color:"yellow",dimColor:!0,children:"Editing action arguments (JSON format):"},void 0,!1,void 0,this),s.jsxDEV(N,{paddingX:1,children:s.jsxDEV(rZ,{value:G,onChange:F,onSubmit:P,placeholder:"Enter JSON...",autoFocus:!0},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this):s.jsxDEV(N,{flexDirection:"column",marginTop:0,children:[s.jsxDEV(O,{color:"cyan",dimColor:!0,children:"Enter additional message for this action:"},void 0,!1,void 0,this),s.jsxDEV(N,{padding:1,children:s.jsxDEV(rZ,{value:G,onChange:F,onSubmit:P,placeholder:"Enter message...",autoFocus:!0},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),s.jsxDEV(N,{marginTop:0,children:s.jsxDEV(O,{color:"gray",children:[s.jsxDEV(O,{color:E,bold:!0,children:"↵"},void 0,!1,void 0,this)," ","Submit |",s.jsxDEV(O,{color:"red",bold:!0,children:[" ","Esc"]},void 0,!0,void 0,this)," ","Cancel"]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)})():(()=>s.jsxDEV(N,{flexDirection:"column",paddingX:1,children:[s.jsxDEV(N,{flexDirection:"column",marginBottom:1,children:[s.jsxDEV(O,{color:"cyan",bold:!0,children:Z.toolCall.name},void 0,!1,void 0,this),A!==void 0&&s.jsxDEV(O,{color:"gray",dimColor:!0,children:["Message Index: ",A]},void 0,!0,void 0,this),w&&s.jsxDEV(O,{color:"gray",dimColor:!0,children:["Description: ",w]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),s.jsxDEV(N,{children:s.jsxDEV(mY,{singleSelect:!0,options:C,onSubmit:R,autoFocus:$},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this))()};var o4=L(x(),1),SX=L(v(),1),a0={type:"approval",render(Z,Y){let{content:X,metadata:J}=Z,Q=KY(),$=o4.useCallback(()=>{Y({state:"submitted",result:{status:"approved"}}),Q.focus("global-input")},[Y,Q]),K=o4.useCallback((z)=>{Y({state:"edited",result:{status:"edited",editedArgs:z}}),Q.focus("global-input")},[Y,Q]),U=o4.useCallback((z)=>{Y({state:"cancelled",result:{status:"rejected",message:z}}),Q.focus("global-input")},[Y,Q]),W={id:Z.id,toolCall:X.toolCall,status:Z.state==="submitted"?"approved":Z.state==="edited"?"edited":Z.state==="cancelled"?"rejected":"pending",createdAt:Z.createdAt,messageIndex:J.messageIndex,description:J.description};return SX.jsxDEV(jX,{request:W,allowedDecisions:["approve","edit","reject"],onApprove:$,onEdit:K,onReject:U,autoFocus:!0},Z.id,!1,void 0,this)},defaultConfig:{layout:{border:!1,padding:0},interaction:{autoSubmit:!1,allowSkip:!1}}};var s0=L(x(),1);var dQ={title:{maxWidth:60,ellipsis:"…"},description:{maxWidth:80,ellipsis:"…"},optionLabel:{maxWidth:50,ellipsis:"…"},tabLabel:{maxWidth:30,ellipsis:"…"},fullTitle:{maxWidth:80,ellipsis:"…"}},cQ=(Z,Y=20,X="…")=>{if(!Z)return"";if(Z.length<=Y)return Z;return Z.substring(0,Y-X.length)+X},K4=(Z,Y)=>{let X=dQ[Y];return cQ(Z,X.maxWidth,X.ellipsis)};var wY=L(v(),1),lQ=(Z)=>{return K4(Z,"optionLabel")},t0={type:"selection",render(Z,Y){let{content:X,metadata:J,result:Q}=Z,[$,K]=s0.useState(Q?.selected||[]),[U,W]=s0.useState(Q?.customInput||""),z=X.options.map((P)=>({label:lQ(P.label),value:P.value})),H=(P,B)=>{Y({result:{selected:P??$,customInput:B??U}})},G=(P)=>{K(P),H(P,void 0)},F=(P)=>{W(P),H(void 0,P)},M=()=>{Y({state:"submitted",result:{selected:$,customInput:U}})},A=J?.title?K4(J.title,"title"):null,w=J?.description?K4(J.description,"description"):null;return wY.jsxDEV(N,{flexDirection:"column",paddingX:1,children:[A&&wY.jsxDEV(N,{marginBottom:1,children:wY.jsxDEV(O,{color:"cyan",bold:!0,children:A},void 0,!1,void 0,this)},void 0,!1,void 0,this),w&&wY.jsxDEV(N,{marginBottom:1,children:wY.jsxDEV(O,{dimColor:!0,children:w},void 0,!1,void 0,this)},void 0,!1,void 0,this),wY.jsxDEV(mY,{options:z,singleSelect:X.singleSelect,values:$,onChange:G,onSubmit:M,autoFocus:!0},void 0,!1,void 0,this),X.allowCustomInput&&wY.jsxDEV(N,{marginTop:1,flexDirection:"column",children:wY.jsxDEV(rZ,{value:U,onChange:F,onSubmit:M,placeholder:X.placeholder||"Type custom option...",autoFocus:!1},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},validate(Z){if(Z.options.length===0)return"At least one option is required";if(Z.singleSelect&&Z.maxSelections&&Z.maxSelections>1)return"Single select cannot have maxSelections > 1";return},defaultConfig:{layout:{border:!0,padding:1},interaction:{autoSubmit:!1}}};var yX=L(x(),1);var UY=L(v(),1),e0={type:"input",render(Z,Y){let{content:X,metadata:J}=Z,[Q,$]=yX.useState(X.defaultValue||""),K=()=>{Y({state:"submitted",result:{value:Q}})};return UY.jsxDEV(N,{flexDirection:"column",paddingX:1,children:[J?.title&&UY.jsxDEV(N,{marginBottom:1,children:UY.jsxDEV(O,{color:"cyan",bold:!0,children:J.title},void 0,!1,void 0,this)},void 0,!1,void 0,this),J?.description&&UY.jsxDEV(N,{marginBottom:1,children:UY.jsxDEV(O,{dimColor:!0,children:J.description},void 0,!1,void 0,this)},void 0,!1,void 0,this),UY.jsxDEV(N,{children:[UY.jsxDEV(rZ,{value:Q,onChange:$,onSubmit:K,placeholder:X.placeholder,autoFocus:!0},void 0,!1,void 0,this),")"]},void 0,!0,void 0,this),X.maxLength&&UY.jsxDEV(N,{marginTop:1,children:UY.jsxDEV(O,{dimColor:!0,children:["Max length: ",X.maxLength]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},validate(Z){if(Z.validation?.pattern&&Z.defaultValue){if(!Z.validation.pattern.test(Z.defaultValue))return"Input does not match required pattern"}if(Z.validation?.minLength&&Z.defaultValue&&Z.defaultValue.length<Z.validation.minLength)return`Input must be at least ${Z.validation.minLength} characters`;return},defaultConfig:{layout:{border:!0,padding:1},interaction:{autoSubmit:!1}}};var pY=L(v(),1),Z8={type:"confirm",render(Z,Y){let{content:X,metadata:J}=Z,Q=()=>{Y({state:"submitted",result:{confirmed:!0}})},$=()=>{Y({state:"cancelled",result:{confirmed:!1}})},K=[{label:X.confirmLabel||"Confirm",value:"confirm"},{label:X.cancelLabel||"Cancel",value:"cancel"}],U=([W])=>{if(W==="confirm")Q();else $()};return pY.jsxDEV(N,{flexDirection:"column",paddingX:1,children:[J?.title&&pY.jsxDEV(N,{marginBottom:1,children:pY.jsxDEV(O,{color:X.danger?"red":"cyan",bold:!0,children:J.title},void 0,!1,void 0,this)},void 0,!1,void 0,this),pY.jsxDEV(N,{marginBottom:1,children:pY.jsxDEV(O,{children:X.message},void 0,!1,void 0,this)},void 0,!1,void 0,this),pY.jsxDEV(mY,{options:K,singleSelect:!0,onSubmit:U,autoFocus:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},defaultConfig:{layout:{border:!0,padding:1},interaction:{autoSubmit:!1}}};var iQ=L(x(),1);var rQ=L(v(),1);var zY=L(x(),1);var W4=L(x(),1);var UZ=L(v(),1),hX=({items:Z,defaultIndex:Y=0,onChange:X,disabled:J=!1,autoFocus:Q=!0,variant:$="line"})=>{let{isFocused:K}=kX({autoFocus:Q}),[U,W]=W4.useState(Y),z=W4.default.useMemo(()=>`tabs-${Math.random().toString(36).substring(2,9)}`,[]),H=W4.useCallback((M)=>{if(M<0||M>=Z.length||Z[M].disabled)return;W(M),X?.(M,Z[M])},[Z,X]);uZ((M,A)=>{if(J)return;if(A.leftArrow)H(U-1);else if(A.rightArrow)H(U+1)},{isActive:!J});let G=()=>{return Z.map((M,A)=>{let w=A===U,P=K&&!J,B;if($==="line")B=UZ.jsxDEV(N,{marginRight:1,children:[UZ.jsxDEV(O,{color:M.disabled?"gray":w?P?"green":"cyan":"gray",bold:w&&P,children:M.label},void 0,!1,void 0,this),w&&UZ.jsxDEV(O,{color:P?"green":"cyan",children:"_"},void 0,!1,void 0,this)]},`${z}-${M.id}`,!0,void 0,this);else if($==="enclosed"){let R=A===0||w?"┌":"─",C=A===Z.length-1||w?"┐":"─",D=A===0||w?"│":" ",j=A===Z.length-1||w?"│":" ",E=w?"─":" ",d=w?" ":"",i=M.disabled?"gray":w?P?"green":"cyan":"gray";B=UZ.jsxDEV(N,{children:UZ.jsxDEV(N,{flexDirection:"column",children:[UZ.jsxDEV(N,{children:[UZ.jsxDEV(O,{color:i,children:R},void 0,!1,void 0,this),UZ.jsxDEV(O,{color:i,bold:w&&P,children:[d,M.label,d]},void 0,!0,void 0,this),UZ.jsxDEV(O,{color:i,children:C},void 0,!1,void 0,this)]},void 0,!0,void 0,this),w&&UZ.jsxDEV(N,{children:[UZ.jsxDEV(O,{color:i,children:D},void 0,!1,void 0,this),UZ.jsxDEV(O,{color:i,children:E.repeat(M.label.length+2)},void 0,!1,void 0,this),UZ.jsxDEV(O,{color:i,children:j},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},`${z}-${M.id}`,!1,void 0,this)}else{let R=w?"●":"○";B=UZ.jsxDEV(N,{marginRight:2,children:UZ.jsxDEV(O,{color:M.disabled?"gray":w?P?"green":"cyan":"gray",bold:w&&P,children:[R," ",M.label]},void 0,!0,void 0,this)},`${z}-${M.id}`,!1,void 0,this)}return B})},F=()=>{let M=Z[U];if(!M?.content)return null;return UZ.jsxDEV(N,{marginTop:1,paddingX:2,paddingY:1,flexDirection:"column",children:M.content},void 0,!1,void 0,this)};return UZ.jsxDEV(N,{flexDirection:"column",flexGrow:1,children:[UZ.jsxDEV(N,{children:G()},void 0,!1,void 0,this),Z.some((M)=>M.content)&&F()]},void 0,!0,void 0,this)};var xX=L(x(),1);var gX=L(v(),1),Y8=({interaction:Z,renderer:Y,onChange:X})=>{let J=xX.useMemo(()=>{return{layout:{border:!1,padding:0,...Y.defaultConfig?.layout,...Z.config.layout},interaction:{autoSubmit:!1,allowSkip:!1,showPreview:!0,...Y.defaultConfig?.interaction,...Z.config.interaction},style:{...Y.defaultConfig?.style,...Z.config.style}}},[Z.config,Y.defaultConfig]),Q=J.style.backgroundColor;return gX.jsxDEV(N,{backgroundColor:Q,paddingX:J.layout.padding,marginBottom:1,flexDirection:"column",children:Y.render({...Z,config:J},X)},void 0,!1,void 0,this)};r4();var BY=L(v(),1),oQ=(Z)=>{return K4(Z,"fullTitle")},X8=()=>{let Z=gZ(),[Y,X]=zY.useState(null),{focusNext:J,focus:Q}=KY(),$=zY.useMemo(()=>{return Z.getInteractions()},[Z.getInteractions()]);zY.useEffect(()=>{if($.length>0&&!Y)X($[0].id)},[$,Y]);let K=zY.useMemo(()=>{return $.map((G)=>{let F={idle:"\uD83D\uDD04",active:"\uD83D\uDD04",submitted:"✅",edited:"⛔",cancelled:"\uD83D\uDEAB"}[G.state]||"",M=oQ(G.metadata.title||G.content.type);return{id:G.id,label:`${F} ${M}`,content:null}})},[$]),U=zY.useCallback((G,F)=>{X(F.id)},[]),W=zY.useCallback((G)=>{if($.every((w)=>w.state==="submitted"||w.state==="edited"||w.state==="cancelled")){Q("global-input");return}let A=($.findIndex((w)=>w.id===G)+1)%$.length;X($[A].id)},[$,Q]),z=uX(()=>{J()});oZ(z,Y?100:null);let H=()=>{if(!Y)return null;let G=$.find((M)=>M.id===Y);if(!G)return null;let F=bY.get(G.content.type);if(!F)return BY.jsxDEV(N,{paddingX:1,children:BY.jsxDEV(O,{color:"red",children:["Unknown renderer: ",G.content.type]},void 0,!0,void 0,this)},void 0,!1,void 0,this);return BY.jsxDEV(Y8,{interaction:G,renderer:F,onChange:(M)=>{if(Z.updateInteraction(G.id,M),M.state==="submitted"||M.state==="edited"||M.state==="cancelled")W(G.id)}},G.id,!1,void 0,this)};if($.length===0)return null;return BY.jsxDEV(N,{flexDirection:"column",borderColor:"cyan",borderStyle:"single",width:"100%",children:[BY.jsxDEV(N,{justifyContent:"space-between",paddingX:1,marginBottom:1,children:BY.jsxDEV(O,{color:"cyan",bold:!0,children:["Interactions (",$.length,")"]},void 0,!0,void 0,this)},void 0,!1,void 0,this),BY.jsxDEV(N,{paddingX:1,marginBottom:1,children:BY.jsxDEV(hX,{items:K,defaultIndex:K.findIndex((G)=>G.id===Y),onChange:U,autoFocus:!0,variant:"line"},Y,!1,void 0,this)},void 0,!1,void 0,this),H()]},void 0,!0,void 0,this)};r4();function mX(){bY.register("approval",a0),bY.register("selection",t0),bY.register("input",e0),bY.register("confirm",Z8)}mX();var U4=L(v(),1);import{z as TY}from"zod";var nQ=TY.object({label:TY.string().min(1).max(50).describe("选项显示文本,简洁明了(1-50 字符)")}),aQ=TY.object({description:TY.string().min(1).describe("向用户提出的问题,清晰具体,包含必要的上下文"),type:TY.enum(["single_select","multi_select"]).describe("选择类型:single_select(单选)或 multi_select(多选)"),options:TY.array(nQ).min(2).max(6).describe("选项列表,至少 2 个,最多 6 个"),allow_custom_input:TY.boolean().default(!0).describe("是否允许用户输入自定义文本,默认 true"),placeholder:TY.string().optional().describe("自定义输入框的占位符文本")}),sQ=({tool:Z})=>{let{addInteraction:Y,getInteractions:X,updateInteraction:J}=gZ(),[Q,$]=dY.useState(null),K=dY.useRef(!1),U=Z.getInputRepaired();if(dY.useEffect(()=>{if(Z.state==="interrupted"&&!Q&&!K.current){let z={type:"selection",options:U.options?.map((G,F)=>({label:G.label,value:G.label}))||[],singleSelect:U.type==="single_select",allowCustomInput:U.allow_custom_input??!0,placeholder:U.placeholder},H=Y(z,{tool:Z,metadata:{title:U.description||"请选择一个选项",groupKey:"user-input"}});$(H.id)}},[Z,Q,Y,U]),dY.useEffect(()=>{if(!Q||K.current)return;let W=()=>{let G=X().find((F)=>F.id===Q);if(G&&(G.state==="submitted"||G.state==="edited"||G.state==="cancelled")&&!G.resultSent){K.current=!0;let F=G.result,M="";if(F){if(F.selected&&F.selected.length>0)M+=`User selected:
|
|
36
|
+
请你先写一个 TODO LIST 然后开始这个任务,最后完成任务的时候,使用 commit_task`}];X(W4).then(()=>{return Y(z,{extraParams:$,metadata:W4})}).then(()=>{w4("任务已发送给 Agent"),Q()}).catch((H)=>{console.error("Task execution failed:",H),w4("任务执行失败")})},[Y,X,$,Q])}}var r0=L(x(),1),k8=L(v(),1),S8=r0.createContext(void 0),J0=()=>{let Z=r0.useContext(S8);if(Z===void 0)throw Error("useChatPanel must be used within ChatPanelProvider. Make sure your component is a child of ChatController.");return Z},y8=({children:Z,value:Y})=>{return k8.jsxDEV(S8.Provider,{value:Y,children:Z},void 0,!1,void 0,this)};var p4=L(x(),1);var h8=(Z)=>{return Z.additional_kwargs?.reasoning_content||Array.isArray(Z.content)&&Z.content.find((Y)=>Y.type==="thinking")?.thinking},Q0=(Z)=>{return typeof Z.content==="string"?Z.content:Z.content?.filter((Y)=>{return Y.type==="text"}).map((Y)=>Y.text).join("")};o0();var eY=L(x(),1),s=L(v(),1),F$={approve:"green",reject:"red",edit:"yellow",modify:"cyan"},M$=(Z)=>{return F$[Z.toLowerCase()]||"white"},u8=({request:Z,allowedDecisions:Y=["approve","edit","reject"],onApprove:X,onEdit:J,onReject:Q,autoFocus:$=!0})=>{let[K,W]=eY.useState("approve"),{value:U,setTrue:z,setFalse:H}=g8(!1),[G,F]=eY.useState(""),M=K4(),_=Z.messageIndex,A=Z.description;mZ((E,c)=>{if(U&&c.escape)B()},{isActive:U});let P=()=>{if(!G.trim())return;if(K==="edit")try{let E=JSON.parse(G);J(E)}catch(E){console.error("Invalid JSON:",E);return}else{let E=`User rejected to run this tool, reason: ${G}`;Q(E)}H(),F("")},B=()=>{H(),F("")},C=([E])=>{if(E==="approve"){X(),M.focus("global-input");return}if(W(E),z(),E==="edit")F(JSON.stringify(Z.toolCall.args,null,2));else F("")},R=Y.map((E)=>({label:E,value:E}));return U?(()=>{let E=M$(K),c=K==="edit";return s.jsxDEV(N,{flexDirection:"column",paddingX:1,marginTop:0,children:[s.jsxDEV(N,{flexDirection:"column",marginBottom:1,children:[s.jsxDEV(O,{color:E,bold:!0,children:[K.toUpperCase()," MODE - ",Z.toolCall.name]},void 0,!0,void 0,this),_!==void 0&&s.jsxDEV(O,{color:"gray",dimColor:!0,children:["Message Index: ",_]},void 0,!0,void 0,this),A&&s.jsxDEV(O,{color:"gray",dimColor:!0,children:["Description: ",A]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),c?s.jsxDEV(N,{flexDirection:"column",marginTop:0,children:[s.jsxDEV(O,{color:"yellow",dimColor:!0,children:"Editing action arguments (JSON format):"},void 0,!1,void 0,this),s.jsxDEV(N,{paddingX:1,children:s.jsxDEV(oZ,{value:G,onChange:F,onSubmit:P,placeholder:"Enter JSON...",autoFocus:!0},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this):s.jsxDEV(N,{flexDirection:"column",marginTop:0,children:[s.jsxDEV(O,{color:"cyan",dimColor:!0,children:"Enter additional message for this action:"},void 0,!1,void 0,this),s.jsxDEV(N,{padding:1,children:s.jsxDEV(oZ,{value:G,onChange:F,onSubmit:P,placeholder:"Enter message...",autoFocus:!0},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),s.jsxDEV(N,{marginTop:0,children:s.jsxDEV(O,{color:"gray",children:[s.jsxDEV(O,{color:E,bold:!0,children:"↵"},void 0,!1,void 0,this)," ","Submit |",s.jsxDEV(O,{color:"red",bold:!0,children:[" ","Esc"]},void 0,!0,void 0,this)," ","Cancel"]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)})():(()=>s.jsxDEV(N,{flexDirection:"column",paddingX:1,children:[s.jsxDEV(N,{flexDirection:"column",marginBottom:1,children:[s.jsxDEV(O,{color:"cyan",bold:!0,children:Z.toolCall.name},void 0,!1,void 0,this),_!==void 0&&s.jsxDEV(O,{color:"gray",dimColor:!0,children:["Message Index: ",_]},void 0,!0,void 0,this),A&&s.jsxDEV(O,{color:"gray",dimColor:!0,children:["Description: ",A]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),s.jsxDEV(N,{children:s.jsxDEV(u4,{singleSelect:!0,options:R,onSubmit:C,autoFocus:$},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this))()};var n0=L(x(),1),m8=L(v(),1),ZX={type:"approval",render(Z,Y){let{content:X,metadata:J}=Z,Q=K4(),$=n0.useCallback(()=>{Y({state:"submitted",result:{status:"approved"}}),Q.focus("global-input")},[Y,Q]),K=n0.useCallback((z)=>{Y({state:"edited",result:{status:"edited",editedArgs:z}}),Q.focus("global-input")},[Y,Q]),W=n0.useCallback((z)=>{Y({state:"cancelled",result:{status:"rejected",message:z}}),Q.focus("global-input")},[Y,Q]),U={id:Z.id,toolCall:X.toolCall,status:Z.state==="submitted"?"approved":Z.state==="edited"?"edited":Z.state==="cancelled"?"rejected":"pending",createdAt:Z.createdAt,messageIndex:J.messageIndex,description:J.description};return m8.jsxDEV(u8,{request:U,allowedDecisions:["approve","edit","reject"],onApprove:$,onEdit:K,onReject:W,autoFocus:!0},Z.id,!1,void 0,this)},defaultConfig:{layout:{border:!1,padding:0},interaction:{autoSubmit:!1,allowSkip:!1}}};var YX=L(x(),1);var N$={title:{maxWidth:60,ellipsis:"…"},description:{maxWidth:80,ellipsis:"…"},optionLabel:{maxWidth:50,ellipsis:"…"},tabLabel:{maxWidth:30,ellipsis:"…"},fullTitle:{maxWidth:80,ellipsis:"…"}},_$=(Z,Y=20,X="…")=>{if(!Z)return"";if(Z.length<=Y)return Z;return Z.substring(0,Y-X.length)+X},$0=(Z,Y)=>{let X=N$[Y];return _$(Z,X.maxWidth,X.ellipsis)};var A4=L(v(),1),w$=(Z)=>{return $0(Z,"optionLabel")},XX={type:"selection",render(Z,Y){let{content:X,metadata:J,result:Q}=Z,[$,K]=YX.useState(Q?.selected||[]),[W,U]=YX.useState(Q?.customInput||""),z=X.options.map((P)=>({label:w$(P.label),value:P.value})),H=(P,B)=>{Y({result:{selected:P??$,customInput:B??W}})},G=(P)=>{K(P),H(P,void 0)},F=(P)=>{U(P),H(void 0,P)},M=()=>{Y({state:"submitted",result:{selected:$,customInput:W}})},_=J?.title?$0(J.title,"title"):null,A=J?.description?$0(J.description,"description"):null;return A4.jsxDEV(N,{flexDirection:"column",paddingX:1,children:[_&&A4.jsxDEV(N,{marginBottom:1,children:A4.jsxDEV(O,{color:"cyan",bold:!0,children:_},void 0,!1,void 0,this)},void 0,!1,void 0,this),A&&A4.jsxDEV(N,{marginBottom:1,children:A4.jsxDEV(O,{dimColor:!0,children:A},void 0,!1,void 0,this)},void 0,!1,void 0,this),A4.jsxDEV(u4,{options:z,singleSelect:X.singleSelect,values:$,onChange:G,onSubmit:M,autoFocus:!0},void 0,!1,void 0,this),X.allowCustomInput&&A4.jsxDEV(N,{marginTop:1,flexDirection:"column",children:A4.jsxDEV(oZ,{value:W,onChange:F,onSubmit:M,placeholder:X.placeholder||"Type custom option...",autoFocus:!1},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},validate(Z){if(Z.options.length===0)return"At least one option is required";if(Z.singleSelect&&Z.maxSelections&&Z.maxSelections>1)return"Single select cannot have maxSelections > 1";return},defaultConfig:{layout:{border:!0,padding:1},interaction:{autoSubmit:!1}}};var p8=L(x(),1);var U4=L(v(),1),JX={type:"input",render(Z,Y){let{content:X,metadata:J}=Z,[Q,$]=p8.useState(X.defaultValue||""),K=()=>{Y({state:"submitted",result:{value:Q}})};return U4.jsxDEV(N,{flexDirection:"column",paddingX:1,children:[J?.title&&U4.jsxDEV(N,{marginBottom:1,children:U4.jsxDEV(O,{color:"cyan",bold:!0,children:J.title},void 0,!1,void 0,this)},void 0,!1,void 0,this),J?.description&&U4.jsxDEV(N,{marginBottom:1,children:U4.jsxDEV(O,{dimColor:!0,children:J.description},void 0,!1,void 0,this)},void 0,!1,void 0,this),U4.jsxDEV(N,{children:[U4.jsxDEV(oZ,{value:Q,onChange:$,onSubmit:K,placeholder:X.placeholder,autoFocus:!0},void 0,!1,void 0,this),")"]},void 0,!0,void 0,this),X.maxLength&&U4.jsxDEV(N,{marginTop:1,children:U4.jsxDEV(O,{dimColor:!0,children:["Max length: ",X.maxLength]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},validate(Z){if(Z.validation?.pattern&&Z.defaultValue){if(!Z.validation.pattern.test(Z.defaultValue))return"Input does not match required pattern"}if(Z.validation?.minLength&&Z.defaultValue&&Z.defaultValue.length<Z.validation.minLength)return`Input must be at least ${Z.validation.minLength} characters`;return},defaultConfig:{layout:{border:!0,padding:1},interaction:{autoSubmit:!1}}};var m4=L(v(),1),QX={type:"confirm",render(Z,Y){let{content:X,metadata:J}=Z,Q=()=>{Y({state:"submitted",result:{confirmed:!0}})},$=()=>{Y({state:"cancelled",result:{confirmed:!1}})},K=[{label:X.confirmLabel||"Confirm",value:"confirm"},{label:X.cancelLabel||"Cancel",value:"cancel"}],W=([U])=>{if(U==="confirm")Q();else $()};return m4.jsxDEV(N,{flexDirection:"column",paddingX:1,children:[J?.title&&m4.jsxDEV(N,{marginBottom:1,children:m4.jsxDEV(O,{color:X.danger?"red":"cyan",bold:!0,children:J.title},void 0,!1,void 0,this)},void 0,!1,void 0,this),m4.jsxDEV(N,{marginBottom:1,children:m4.jsxDEV(O,{children:X.message},void 0,!1,void 0,this)},void 0,!1,void 0,this),m4.jsxDEV(u4,{options:K,singleSelect:!0,onSubmit:W,autoFocus:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},defaultConfig:{layout:{border:!0,padding:1},interaction:{autoSubmit:!1}}};var A$=L(x(),1);var B$=L(v(),1);var z4=L(x(),1);var K0=L(x(),1);var zZ=L(v(),1),d8=({items:Z,defaultIndex:Y=0,onChange:X,disabled:J=!1,autoFocus:Q=!0,variant:$="line"})=>{let{isFocused:K}=c8({autoFocus:Q}),[W,U]=K0.useState(Y),z=K0.default.useMemo(()=>`tabs-${Math.random().toString(36).substring(2,9)}`,[]),H=K0.useCallback((M)=>{if(M<0||M>=Z.length||Z[M].disabled)return;U(M),X?.(M,Z[M])},[Z,X]);mZ((M,_)=>{if(J)return;if(_.leftArrow)H(W-1);else if(_.rightArrow)H(W+1)},{isActive:!J});let G=()=>{return Z.map((M,_)=>{let A=_===W,P=K&&!J,B;if($==="line")B=zZ.jsxDEV(N,{marginRight:1,children:[zZ.jsxDEV(O,{color:M.disabled?"gray":A?P?"green":"cyan":"gray",bold:A&&P,children:M.label},void 0,!1,void 0,this),A&&zZ.jsxDEV(O,{color:P?"green":"cyan",children:"_"},void 0,!1,void 0,this)]},`${z}-${M.id}`,!0,void 0,this);else if($==="enclosed"){let C=_===0||A?"┌":"─",R=_===Z.length-1||A?"┐":"─",D=_===0||A?"│":" ",j=_===Z.length-1||A?"│":" ",E=A?"─":" ",c=A?" ":"",i=M.disabled?"gray":A?P?"green":"cyan":"gray";B=zZ.jsxDEV(N,{children:zZ.jsxDEV(N,{flexDirection:"column",children:[zZ.jsxDEV(N,{children:[zZ.jsxDEV(O,{color:i,children:C},void 0,!1,void 0,this),zZ.jsxDEV(O,{color:i,bold:A&&P,children:[c,M.label,c]},void 0,!0,void 0,this),zZ.jsxDEV(O,{color:i,children:R},void 0,!1,void 0,this)]},void 0,!0,void 0,this),A&&zZ.jsxDEV(N,{children:[zZ.jsxDEV(O,{color:i,children:D},void 0,!1,void 0,this),zZ.jsxDEV(O,{color:i,children:E.repeat(M.label.length+2)},void 0,!1,void 0,this),zZ.jsxDEV(O,{color:i,children:j},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},`${z}-${M.id}`,!1,void 0,this)}else{let C=A?"●":"○";B=zZ.jsxDEV(N,{marginRight:2,children:zZ.jsxDEV(O,{color:M.disabled?"gray":A?P?"green":"cyan":"gray",bold:A&&P,children:[C," ",M.label]},void 0,!0,void 0,this)},`${z}-${M.id}`,!1,void 0,this)}return B})},F=()=>{let M=Z[W];if(!M?.content)return null;return zZ.jsxDEV(N,{marginTop:1,paddingX:2,paddingY:1,flexDirection:"column",children:M.content},void 0,!1,void 0,this)};return zZ.jsxDEV(N,{flexDirection:"column",flexGrow:1,children:[zZ.jsxDEV(N,{children:G()},void 0,!1,void 0,this),Z.some((M)=>M.content)&&F()]},void 0,!0,void 0,this)};var l8=L(x(),1);var i8=L(v(),1),$X=({interaction:Z,renderer:Y,onChange:X})=>{let J=l8.useMemo(()=>{return{layout:{border:!1,padding:0,...Y.defaultConfig?.layout,...Z.config.layout},interaction:{autoSubmit:!1,allowSkip:!1,showPreview:!0,...Y.defaultConfig?.interaction,...Z.config.interaction},style:{...Y.defaultConfig?.style,...Z.config.style}}},[Z.config,Y.defaultConfig]),Q=J.style.backgroundColor;return i8.jsxDEV(N,{backgroundColor:Q,paddingX:J.layout.padding,marginBottom:1,flexDirection:"column",children:Y.render({...Z,config:J},X)},void 0,!1,void 0,this)};o0();var B4=L(v(),1),L$=(Z)=>{return $0(Z,"fullTitle")},KX=()=>{let Z=uZ(),[Y,X]=z4.useState(null),{focusNext:J,focus:Q}=K4(),$=z4.useMemo(()=>{return Z.getInteractions()},[Z.getInteractions()]);z4.useEffect(()=>{if($.length>0&&!Y)X($[0].id)},[$,Y]);let K=z4.useMemo(()=>{return $.map((G)=>{let F={idle:"\uD83D\uDD04",active:"\uD83D\uDD04",submitted:"✅",edited:"⛔",cancelled:"\uD83D\uDEAB"}[G.state]||"",M=L$(G.metadata.title||G.content.type);return{id:G.id,label:`${F} ${M}`,content:null}})},[$]),W=z4.useCallback((G,F)=>{X(F.id)},[]),U=z4.useCallback((G)=>{if($.every((A)=>A.state==="submitted"||A.state==="edited"||A.state==="cancelled")){Q("global-input");return}let _=($.findIndex((A)=>A.id===G)+1)%$.length;X($[_].id)},[$,Q]),z=r8(()=>{J()});jZ(z,Y?100:null);let H=()=>{if(!Y)return null;let G=$.find((M)=>M.id===Y);if(!G)return null;let F=E4.get(G.content.type);if(!F)return B4.jsxDEV(N,{paddingX:1,children:B4.jsxDEV(O,{color:"red",children:["Unknown renderer: ",G.content.type]},void 0,!0,void 0,this)},void 0,!1,void 0,this);return B4.jsxDEV($X,{interaction:G,renderer:F,onChange:(M)=>{if(Z.updateInteraction(G.id,M),M.state==="submitted"||M.state==="edited"||M.state==="cancelled")U(G.id)}},G.id,!1,void 0,this)};if($.length===0)return null;return B4.jsxDEV(N,{flexDirection:"column",borderColor:"cyan",borderStyle:"single",width:"100%",children:[B4.jsxDEV(N,{justifyContent:"space-between",paddingX:1,marginBottom:1,children:B4.jsxDEV(O,{color:"cyan",bold:!0,children:["Interactions (",$.length,")"]},void 0,!0,void 0,this)},void 0,!1,void 0,this),B4.jsxDEV(N,{paddingX:1,marginBottom:1,children:B4.jsxDEV(d8,{items:K,defaultIndex:K.findIndex((G)=>G.id===Y),onChange:W,autoFocus:!0,variant:"line"},Y,!1,void 0,this)},void 0,!1,void 0,this),H()]},void 0,!0,void 0,this)};o0();function o8(){E4.register("approval",ZX),E4.register("selection",XX),E4.register("input",JX),E4.register("confirm",QX)}o8();var W0=L(v(),1);import{z as b4}from"zod";var P$=b4.object({label:b4.string().min(1).max(50).describe("选项显示文本,简洁明了(1-50 字符)")}),R$=b4.object({description:b4.string().min(1).describe("向用户提出的问题,清晰具体,包含必要的上下文"),type:b4.enum(["single_select","multi_select"]).describe("选择类型:single_select(单选)或 multi_select(多选)"),options:b4.array(P$).min(2).max(6).describe("选项列表,至少 2 个,最多 6 个"),allow_custom_input:b4.boolean().default(!0).describe("是否允许用户输入自定义文本,默认 true"),placeholder:b4.string().optional().describe("自定义输入框的占位符文本")}),C$=({tool:Z})=>{let{addInteraction:Y,getInteractions:X,updateInteraction:J}=uZ(),[Q,$]=p4.useState(null),K=p4.useRef(!1),W=Z.getInputRepaired();if(p4.useEffect(()=>{if(Z.state==="interrupted"&&!Q&&!K.current){let z={type:"selection",options:W.options?.map((G,F)=>({label:G.label,value:G.label}))||[],singleSelect:W.type==="single_select",allowCustomInput:W.allow_custom_input??!0,placeholder:W.placeholder},H=Y(z,{tool:Z,metadata:{title:W.description||"请选择一个选项",groupKey:"user-input"}});$(H.id)}},[Z,Q,Y,W]),p4.useEffect(()=>{if(!Q||K.current)return;let U=()=>{let G=X().find((F)=>F.id===Q);if(G&&(G.state==="submitted"||G.state==="edited"||G.state==="cancelled")&&!G.resultSent){K.current=!0;let F=G.result,M="";if(F){if(F.selected&&F.selected.length>0)M+=`User selected:
|
|
37
37
|
${F.selected.join(`
|
|
38
38
|
- `)}`;if(F.customInput&&F.customInput.trim())M+=(M?`
|
|
39
|
-
`:"")+`User Custom Input: ${F.customInput}`}Z.sendResumeData({type:"respond",message:M||"User made a selection"}),J(Q,{resultSent:!0})}};
|
|
40
|
-
`).map((G)=>G.slice(0,
|
|
41
|
-
`);return
|
|
42
|
-
`),
|
|
43
|
-
`);for(let D=0;D<
|
|
44
|
-
`).length>50}function
|
|
45
|
-
`).length;return aZ.jsxDEV(N,{flexDirection:"column",paddingX:1,children:aZ.jsxDEV(N,{children:[aZ.jsxDEV(O,{color:"blue",children:"Read "},void 0,!1,void 0,this),aZ.jsxDEV(O,{dimColor:!0,children:"("},void 0,!1,void 0,this),aZ.jsxDEV(
|
|
46
|
-
`).filter(Boolean).length;return sZ.jsxDEV(N,{flexDirection:"column",paddingX:1,children:sZ.jsxDEV(O,{children:[sZ.jsxDEV(O,{color:"cyan",children:"Glob "},void 0,!1,void 0,this),sZ.jsxDEV(O,{dimColor:!0,children:"("},void 0,!1,void 0,this),sZ.jsxDEV(
|
|
47
|
-
`).filter(Boolean).length,$=Y.pattern,K=Y.path;if(!$){let
|
|
48
|
-
`)?.length;return
|
|
49
|
-
`).map((U
|
|
39
|
+
`:"")+`User Custom Input: ${F.customInput}`}Z.sendResumeData({type:"respond",message:M||"User made a selection"}),J(Q,{resultSent:!0})}};U();let z=setInterval(U,100);return()=>clearInterval(z)},[Q,X,J,Z]),Z.state==="interrupted"&&!Z.output)return W0.jsxDEV(N,{flexDirection:"column",children:W0.jsxDEV(N,{paddingX:1,children:W0.jsxDEV(O,{color:"yellow",children:"⏳ 等待用户选择..."},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this);if(Z.output)return W0.jsxDEV(O,{color:"yellow",children:Z.output},void 0,!1,void 0,this);return null},n8=t({name:"ask_user_questions",description:"Ask the user a question with selectable options",parameters:R$,handler:ZZ.waitForUIDone,render(Z){return W0.jsxDEV(C$,{tool:Z},void 0,!1,void 0,this)}});var c4=L(x(),1);var B0=L(v(),1),U0=({content:Z,maxLines:Y=10,borderColor:X="cyan",borderStyle:J="single",marginTop:Q=0,paddingX:$=0,showOmittedInfo:K=!0})=>{if(!Z)return null;let{width:W}=a8(),U=Z.split(`
|
|
40
|
+
`).map((G)=>G.slice(0,W-10)),z=Math.max(0,U.length-Y),H=U.slice(-Y).join(`
|
|
41
|
+
`);return B0.jsxDEV(N,{flexDirection:"column",width:W-5,children:B0.jsxDEV(N,{borderStyle:J,borderColor:X,borderLeft:!1,borderRight:!1,flexDirection:"column",paddingX:$,marginTop:Q,children:[K&&z>0&&B0.jsxDEV(O,{color:"gray",dimColor:!0,children:["... ",z," lines omitted ..."]},void 0,!0,void 0,this),B0.jsxDEV(O,{dimColor:!0,children:H},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)};var EZ=L(v(),1),v$=({tool:Z})=>{let{addInteraction:Y,getInteractions:X,updateInteraction:J}=uZ(),[Q,$]=c4.useState(null),K=c4.useRef(!1),W=Z.getHumanInTheLoopData();if(c4.useEffect(()=>{if(W?.reviewConfig&&Z.state==="interrupted"&&!Q&&!K.current){let z=Z.getInputRepaired()?.description,H={type:"approval",toolCall:{name:Z.message.name,args:Z.getInputRepaired()},editableFields:["args"]},G=Y(H,{tool:Z,metadata:{title:`Approve ${Z.message.name}`,description:z,groupKey:"approvals"}});$(G.id)}},[W,Z,Q,Y]),c4.useEffect(()=>{if(!Q||K.current)return;let z=()=>{let F=X().find((M)=>M.id===Q);if(F&&(F.state==="submitted"||F.state==="edited"||F.state==="cancelled")&&!F.resultSent){K.current=!0;let M=F.result;if(M){if(M.status==="approved")Z.sendResumeData({type:"approve"});else if(M.status==="edited"){let _={name:Z.message.name,args:M.editedArgs};Z.sendResumeData({type:"edit",edited_action:_})}else if(M.status==="rejected"){let _=M.message||"User rejected to run this tool";Z.sendResumeData({type:"reject",message:_})}}J(Q,{resultSent:!0})}};z();let H=setInterval(z,100);return()=>clearInterval(H)},[Q,X,J,Z]),W?.reviewConfig&&Q&&!Z.output)return EZ.jsxDEV(N,{flexDirection:"column",children:EZ.jsxDEV(N,{paddingX:1,paddingY:1,children:EZ.jsxDEV(O,{color:"yellow",children:"⏳ Wait for Approval"},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this);return EZ.jsxDEV(N,{flexDirection:"column",children:(()=>{if(!Z.output)return null;return EZ.jsxDEV(U0,{content:Z.output,maxLines:5,borderColor:"cyan"},void 0,!1,void 0,this)})()},void 0,!1,void 0,this)},I$=({tool:Z})=>{let X=Z.getInputRepaired()?.command||"",J=X.length>50?X.substring(0,50)+"...":X;return EZ.jsxDEV(N,{paddingX:1,children:[EZ.jsxDEV(O,{color:"magenta",children:"Run "},void 0,!1,void 0,this),EZ.jsxDEV(O,{dimColor:!0,children:"("},void 0,!1,void 0,this),EZ.jsxDEV(O,{color:"magenta",children:J},void 0,!1,void 0,this),EZ.jsxDEV(O,{dimColor:!0,children:")"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},s8=t({name:"terminal",description:"",parameters:{},handler:ZZ.waitForUIDone,render(Z){return EZ.jsxDEV(N,{flexDirection:"column",children:[EZ.jsxDEV(I$,{tool:Z},void 0,!1,void 0,this),EZ.jsxDEV(v$,{tool:Z},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}});import{diff_match_patch as D$}from"diff-match-patch";function V$(Z,Y,X){if(Z===Y)return[{type:"unchanged",content:Z,lineNumbers:{old:1,new:1}}];let J=new D$,Q=J.diff_main(Z,Y);J.diff_cleanupSemantic(Q);let $=[],K=1,W=1,U=[];for(let[P,B]of Q){if(B==="")continue;let C=B.split(`
|
|
42
|
+
`),R=B.endsWith(`
|
|
43
|
+
`);for(let D=0;D<C.length;D++){let j=C[D];if(j===""&&(D<C.length-1||!R))continue;let E={type:P===0?"unchanged":P===-1?"added":"removed",content:j};if(P===0)E.lineNumbers={old:K,new:W},K++,W++;else if(P===-1)E.lineNumbers={new:W},W++;else if(P===1)E.lineNumbers={old:K},K++;U.push(E)}}if(!X?.maxLines)return U;let z=X.maxLines,H=X.contextLines||3,G=U.map((P,B)=>P.type!=="unchanged"?B:-1).filter((P)=>P!==-1);if(G.length===0||U.length<=z)return U;let F=[],M=0,_=[],A=[];for(let P=0;P<G.length;P++)if(A.length===0)A.push(G[P]);else{let B=A[A.length-1];if(G[P]-B<=1)A.push(G[P]);else _.push([...A]),A=[G[P]]}if(A.length>0)_.push(A);for(let P of _){if(M>=z)break;let B=P[0],C=P[P.length-1],R=Math.max(0,B-H),D=Math.min(U.length-1,C+H),j=D-R+1;if(M+j>z&&M>0){F.push({type:"unchanged",content:"..."});break}for(let E=R;E<=D;E++){if(M>=z){if(E<D)F.push({type:"unchanged",content:"..."});break}F.push(U[E]),M++}if(P===_[_.length-1]&&M<U.length){let E=U.length-D-1;if(E>0)F.push({type:"unchanged",content:`... (${E} more lines)`})}}return F}function t8(Z,Y=1000){return Z=Z||"",Z.length>Y||Z.split(`
|
|
44
|
+
`).length>50}function e8(Z,Y,X){let J=t8(Z)||t8(Y),$=X!==void 0&&"maxLines"in X?X.maxLines:J?10:20,K=X?.contextLines??(J?1:3);return V$(Z,Y,{maxLines:$,contextLines:K})}var z0=L(v(),1),E$=["sky","primary"];function b$(Z){let Y=Z%2;return bZ(E$[Y])}function T$(Z){let Y=[];if(Z.startsWith("/"))Y.push({type:"separator",value:"/"}),Z=Z.slice(1);let X=Z.split("/");return X.forEach((J,Q)=>{if(J)Y.push({type:"segment",value:J});if(Q<X.length-1)Y.push({type:"separator",value:"/"})}),Y}var f$=({path:Z,color:Y="cyan",line:X,rainbow:J=!1})=>{let Q=Z5(Z)??"",$=X!==void 0?`:${X}`:"";if(!J)return z0.jsxDEV(O,{color:bZ(Y),children:[Q,$]},void 0,!0,void 0,this);let K=T$(Q),W=-1;for(let z=K.length-1;z>=0;z--)if(K[z].type==="segment"){W=z;break}let U=0;return z0.jsxDEV(O,{children:[K.map((z,H)=>{if(z.type==="separator")return z0.jsxDEV(O,{dimColor:!0,color:"gray",children:z.value},`sep-${H}`,!1,void 0,this);let G=H===W,F=b$(U);return U++,z0.jsxDEV(O,{color:F,dimColor:!G,children:z.value},`seg-${H}`,!1,void 0,this)}),$&&z0.jsxDEV(O,{color:"gray",children:$},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},SZ=f$;var HZ=L(v(),1),j$=Y5.schema,X5=t({name:"edit_file",description:"Performs exact string replacements in files with diff visualization",parameters:j$.shape,handler:ZZ.waitForUIDone,render(Z){let Y=Z.getInputRepaired(),X=Z.output,J=Y.old_string&&Y.new_string&&Y.old_string!==Y.new_string,Q=0,$=0;if(J){let K=e8(Y.old_string,Y.new_string,{maxLines:void 0});for(let W of K){if(W.type==="removed")Q++;if(W.type==="added")$++}}return HZ.jsxDEV(N,{flexDirection:"column",paddingX:1,children:[HZ.jsxDEV(N,{children:[HZ.jsxDEV(O,{color:"yellow",children:"Edit "},void 0,!1,void 0,this),HZ.jsxDEV(O,{dimColor:!0,children:"("},void 0,!1,void 0,this),HZ.jsxDEV(SZ,{path:Y.file_path,rainbow:!0},void 0,!1,void 0,this),HZ.jsxDEV(O,{dimColor:!0,children:")"},void 0,!1,void 0,this),J&&HZ.jsxDEV(HZ.Fragment,{children:[HZ.jsxDEV(O,{color:"gray",children:" ("},void 0,!1,void 0,this),HZ.jsxDEV(O,{color:"red",children:["-",Q]},void 0,!0,void 0,this),HZ.jsxDEV(O,{color:"gray",children:"/"},void 0,!1,void 0,this),HZ.jsxDEV(O,{color:"green",children:["+",$]},void 0,!0,void 0,this),HZ.jsxDEV(O,{color:"gray",children:")"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),X&&X.startsWith("Error:")&&HZ.jsxDEV(N,{marginTop:0,marginLeft:1,marginBottom:1,children:HZ.jsxDEV(O,{color:"red",children:X},void 0,!1,void 0,this)},void 0,!1,void 0,this),!X&&HZ.jsxDEV(N,{marginTop:0,children:HZ.jsxDEV(O,{color:"gray",children:"Press Enter to confirm, Ctrl+C to cancel"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}});var nZ=L(v(),1),S$={pending:"gray",in_progress:"yellow",completed:"green"},y$={pending:"○",in_progress:"◐",completed:"✓"},Q5=t({name:"todo_write",description:"Use this tool to create and manage a structured task list",parameters:J5.shape,handler:ZZ.waitForUIDone,render(Z){let Y=Z.getInputRepaired();if(!Y||!Y.todos||!Array.isArray(Y.todos))return nZ.jsxDEV(N,{flexDirection:"column",borderStyle:"round",borderColor:"red",children:nZ.jsxDEV(O,{color:"red",children:"Error: Invalid todo data structure"},void 0,!1,void 0,this)},void 0,!1,void 0,this);let X=Y.todos;return nZ.jsxDEV(N,{flexDirection:"column",paddingY:1,children:nZ.jsxDEV(N,{flexDirection:"column",marginTop:0,children:(()=>{if(X.length===0)return nZ.jsxDEV(N,{paddingX:1,children:nZ.jsxDEV(O,{color:"gray",children:"No tasks in todo list"},void 0,!1,void 0,this)},void 0,!1,void 0,this);return nZ.jsxDEV(N,{flexDirection:"column",marginTop:0,children:X.map((Q,$)=>nZ.jsxDEV(N,{paddingX:1,paddingY:0,children:[nZ.jsxDEV(O,{color:S$[Q.status],bold:!0,children:[y$[Q.status]," "]},void 0,!0,void 0,this),nZ.jsxDEV(O,{color:Q.status==="in_progress"?"white":"gray",children:[$+1,". ",Q.content]},void 0,!0,void 0,this)]},Q.id,!0,void 0,this))},void 0,!1,void 0,this)})()},void 0,!1,void 0,this)},void 0,!1,void 0,this)}});var aZ=L(v(),1),k$=$5.schema,K5=t({name:"read_file",description:"Reads a file from the local filesystem",parameters:k$.shape,handler:ZZ.waitForUIDone,render(Z){let Y=Z.getInputRepaired(),X=Z.output;if(!X)return aZ.jsxDEV(aZ.Fragment,{},void 0,!1,void 0,this);let Q=X.split(`
|
|
45
|
+
`).length;return aZ.jsxDEV(N,{flexDirection:"column",paddingX:1,children:aZ.jsxDEV(N,{children:[aZ.jsxDEV(O,{color:"blue",children:"Read "},void 0,!1,void 0,this),aZ.jsxDEV(O,{dimColor:!0,children:"("},void 0,!1,void 0,this),aZ.jsxDEV(SZ,{path:Y.file_path,rainbow:!0},void 0,!1,void 0,this),aZ.jsxDEV(O,{dimColor:!0,children:")"},void 0,!1,void 0,this),aZ.jsxDEV(O,{color:"gray",dimColor:!0,children:[" ","(",Q," lines)"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}});var sZ=L(v(),1),h$=W5.schema,U5=t({name:"glob_files",description:"Find files by name patterns",parameters:h$.shape,handler:ZZ.waitForUIDone,render(Z){let Y=Z.getInputRepaired(),X=Z.output;if(!X)return sZ.jsxDEV(sZ.Fragment,{},void 0,!1,void 0,this);let Q=X.split(`
|
|
46
|
+
`).filter(Boolean).length;return sZ.jsxDEV(N,{flexDirection:"column",paddingX:1,children:sZ.jsxDEV(O,{children:[sZ.jsxDEV(O,{color:"cyan",children:"Glob "},void 0,!1,void 0,this),sZ.jsxDEV(O,{dimColor:!0,children:"("},void 0,!1,void 0,this),sZ.jsxDEV(SZ,{path:Y.pattern,rainbow:!0},void 0,!1,void 0,this),sZ.jsxDEV(O,{dimColor:!0,children:")"},void 0,!1,void 0,this),sZ.jsxDEV(O,{color:"gray",dimColor:!0,children:[" ","(",Q," files)"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}});var wZ=L(v(),1),z5=t({name:"search_files_rg",description:"Ripgrep - fast text search tool",parameters:{},handler:ZZ.waitForUIDone,render(Z){let Y=Z.getInputRepaired(),X=Z.output;if(!X)return wZ.jsxDEV(wZ.Fragment,{},void 0,!1,void 0,this);let Q=X.split(`
|
|
47
|
+
`).filter(Boolean).length,$=Y.pattern,K=Y.path;if(!$){let U=(Y.args||[]).filter((z)=>!z.startsWith("-"));if(U.length>0){if(K=U[U.length-1],U.length>1)$=U[U.length-2]}}return wZ.jsxDEV(N,{flexDirection:"column",paddingX:1,children:wZ.jsxDEV(O,{children:[wZ.jsxDEV(O,{color:"magenta",children:"Ripgrep "},void 0,!1,void 0,this),$&&wZ.jsxDEV(wZ.Fragment,{children:[wZ.jsxDEV(O,{dimColor:!0,children:"("},void 0,!1,void 0,this),wZ.jsxDEV(SZ,{path:$,color:"magenta"},void 0,!1,void 0,this),wZ.jsxDEV(O,{dimColor:!0,children:")"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),K&&K!=="./"&&wZ.jsxDEV(wZ.Fragment,{children:[wZ.jsxDEV(O,{dimColor:!0,children:" in "},void 0,!1,void 0,this),wZ.jsxDEV(SZ,{path:K,rainbow:!0},void 0,!1,void 0,this)]},void 0,!0,void 0,this),wZ.jsxDEV(O,{color:"gray",dimColor:!0,children:[" ","(",Q," matches)"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}});import{z as a0}from"zod";var H4=L(v(),1),x$=a0.object({description:a0.string().optional(),file_path:a0.string(),content:a0.string()}),H5=t({name:"write_file",description:"Writes a file to the local filesystem",parameters:x$.shape,handler:ZZ.waitForUIDone,render(Z){let Y=Z.getInputRepaired(),X=Z.output,J=Y.content?.split(`
|
|
48
|
+
`)?.length;return H4.jsxDEV(N,{flexDirection:"column",paddingX:1,children:[H4.jsxDEV(N,{children:[H4.jsxDEV(O,{color:"green",children:"Write "},void 0,!1,void 0,this),H4.jsxDEV(O,{dimColor:!0,children:"("},void 0,!1,void 0,this),H4.jsxDEV(SZ,{path:Y.file_path,rainbow:!0},void 0,!1,void 0,this),H4.jsxDEV(O,{dimColor:!0,children:")"},void 0,!1,void 0,this),H4.jsxDEV(O,{dimColor:!0,children:[" (",J," lines)"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),X&&X.startsWith("Error:")&&H4.jsxDEV(N,{marginTop:0,marginLeft:1,marginBottom:1,children:H4.jsxDEV(O,{color:"red",children:X},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}});var RZ=L(v(),1),g$=G5.schema,O5=t({name:"folder_operations",description:"Unified folder operations tool supporting create, list, delete, and existence check",parameters:g$.shape,render(Z){let Y=Z.getInputRepaired(),X=Z.output;if(!X)return RZ.jsxDEV(RZ.Fragment,{},void 0,!1,void 0,this);let Q={create:"green",list:"blue",exists:"yellow",delete:"red"}[Y?.operation]||"cyan",K=X.split(`
|
|
49
|
+
`).map((W,U)=>{if(W.match(/\d+ \w+|[\d-]+ [\d:]+/))return RZ.jsxDEV(O,{dimColor:!0,children:W},U,!1,void 0,this);if(W.includes("✓")||W.includes("successfully")||W.includes("created")||W.includes("deleted"))return RZ.jsxDEV(O,{color:"green",children:W},U,!1,void 0,this);if(W.includes("✗")||W.includes("Error")||W.includes("not found")||W.includes("failed"))return RZ.jsxDEV(O,{color:"red",children:W},U,!1,void 0,this);if(W.startsWith("/")||W.includes("/:"))return RZ.jsxDEV(O,{color:"cyan",children:W},U,!1,void 0,this);return RZ.jsxDEV(O,{children:W},U,!1,void 0,this)});return RZ.jsxDEV(N,{flexDirection:"column",paddingX:1,children:RZ.jsxDEV(N,{children:[RZ.jsxDEV(O,{bold:!0,color:Q,children:[Y.operation,"Folder"]},void 0,!0,void 0,this),RZ.jsxDEV(O,{dimColor:!0,children:" ("},void 0,!1,void 0,this),RZ.jsxDEV(SZ,{path:Y.folder_path,rainbow:!0},void 0,!1,void 0,this),RZ.jsxDEV(O,{dimColor:!0,children:")"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}});import{z as u$}from"zod";var MZ=L(v(),1),m$=u$.object({}),q5=t({name:"load_mcp_tools",description:`加载并查询所有可用的 MCP 工具列表。
|
|
50
50
|
|
|
51
51
|
返回:
|
|
52
52
|
- tools: MCP 工具列表,每个工具包含 name, description, schema
|
|
@@ -57,7 +57,7 @@ ${F.selected.join(`
|
|
|
57
57
|
- 获取工具的参数格式
|
|
58
58
|
- 检查 MCP 连接状态
|
|
59
59
|
|
|
60
|
-
重要:工具列表是动态的,建议在需要时调用此命令获取最新信息。`,parameters:
|
|
60
|
+
重要:工具列表是动态的,建议在需要时调用此命令获取最新信息。`,parameters:m$.shape,handler:ZZ.waitForUIDone,render(Z){let Y=Z.output,X=null;try{X=JSON.parse(Y)}catch(J){}return MZ.jsxDEV(N,{flexDirection:"column",children:[MZ.jsxDEV(N,{children:MZ.jsxDEV(O,{color:"blue",bold:!0,children:"load_mcp_tools"},void 0,!1,void 0,this)},void 0,!1,void 0,this),X?.status&&MZ.jsxDEV(N,{flexDirection:"column",marginTop:1,children:[MZ.jsxDEV(O,{color:"green",children:"✓ MCP 已连接"},void 0,!1,void 0,this),X.status.servers&&X.status.servers.length>0&&MZ.jsxDEV(N,{marginLeft:2,children:MZ.jsxDEV(O,{color:"gray",children:["服务器: ",X.status.servers.join(", ")]},void 0,!0,void 0,this)},void 0,!1,void 0,this),X.status.toolCount!==void 0&&MZ.jsxDEV(N,{marginLeft:2,children:MZ.jsxDEV(O,{color:"gray",children:["工具数量: ",X.status.toolCount]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),X?.tools&&X.tools.length>0&&MZ.jsxDEV(N,{flexDirection:"column",marginTop:1,children:[MZ.jsxDEV(O,{color:"gray",dimColor:!0,children:["可用工具 (",X.tools.length,"):"]},void 0,!0,void 0,this),X.tools.slice(0,5).map((J,Q)=>MZ.jsxDEV(N,{marginLeft:2,children:[MZ.jsxDEV(O,{color:"cyan",children:J.name},void 0,!1,void 0,this),J.description&&MZ.jsxDEV(O,{color:"gray",dimColor:!0,children:[" ","- ",J.description.slice(0,50),J.description.length>50?"...":""]},void 0,!0,void 0,this)]},Q,!0,void 0,this)),X.tools.length>5&&MZ.jsxDEV(N,{marginLeft:2,children:MZ.jsxDEV(O,{color:"gray",dimColor:!0,children:["... 还有 ",X.tools.length-5," 个工具"]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Y&&MZ.jsxDEV(U0,{content:Y,maxLines:10,borderColor:"gray"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}});import{z as d4}from"zod";var TZ=L(v(),1),p$=d4.object({commands:d4.array(d4.object({name:d4.string().describe("MCP 工具名称"),args:d4.record(d4.string(),d4.any()).describe("工具参数,JSON 对象格式")})).describe("要执行的 MCP 工具列表")}),F5=t({name:"execute_mcp_tool",description:`执行一个或多个 MCP 工具。
|
|
61
61
|
|
|
62
62
|
使用格式:
|
|
63
63
|
- commands: MCP 工具数组,每个工具包含 name 和 args
|
|
@@ -69,61 +69,61 @@ ${F.selected.join(`
|
|
|
69
69
|
重要:
|
|
70
70
|
- 所有工具独立执行,失败不影响其他工具
|
|
71
71
|
- 返回结果按命令顺序排列
|
|
72
|
-
- 适合批量执行 MCP 相关操作`,parameters:
|
|
72
|
+
- 适合批量执行 MCP 相关操作`,parameters:p$.shape,handler:ZZ.waitForUIDone,render(Z){let Y=Z.getInputRepaired(),X=Z.output,J=null;try{J=JSON.parse(X)}catch(Q){}return TZ.jsxDEV(N,{flexDirection:"column",children:[TZ.jsxDEV(N,{children:TZ.jsxDEV(O,{color:"blue",bold:!0,children:"execute_mcp_tool"},void 0,!1,void 0,this)},void 0,!1,void 0,this),Y?.commands&&Y.commands.length>0&&TZ.jsxDEV(N,{flexDirection:"column",marginTop:1,children:[TZ.jsxDEV(O,{color:"gray",dimColor:!0,children:["执行 ",Y.commands.length," 个 MCP 工具:"]},void 0,!0,void 0,this),Y.commands.map((Q,$)=>TZ.jsxDEV(N,{marginLeft:2,children:[TZ.jsxDEV(O,{color:"yellow",children:[$+1,"."]},void 0,!0,void 0,this),TZ.jsxDEV(O,{color:"cyan",children:Q.name},void 0,!1,void 0,this)]},$,!0,void 0,this))]},void 0,!0,void 0,this),J?.results&&TZ.jsxDEV(N,{flexDirection:"column",marginTop:1,children:J.results.map((Q,$)=>TZ.jsxDEV(N,{marginLeft:2,children:Q.error?TZ.jsxDEV(O,{color:"red",children:["✗ ",Q.tool]},void 0,!0,void 0,this):TZ.jsxDEV(O,{color:"green",children:["✓ ",Q.tool]},void 0,!0,void 0,this)},$,!1,void 0,this))},void 0,!1,void 0,this),X&&TZ.jsxDEV(U0,{content:X,maxLines:10,borderColor:"gray"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}});var G4=L(v(),1);import{z as H0}from"zod";var c$=H0.object({task_id:H0.string().optional().describe("The task id to ask the subagent"),subagent_id:H0.string().describe("The id of subagent to use"),subagent_type:H0.string().describe("The type of subagent to use (general-purpose, statusline-setup, output-style-setup)"),task_description:H0.string().describe("Describe what you want the subagent to do"),data_transfer:H0.any().optional().describe("Data to transfer to the subagent")}),d$=({tool:Z})=>{let Y=Z.getInputRepaired();return G4.jsxDEV(N,{paddingX:1,flexDirection:"column",children:G4.jsxDEV(N,{children:[G4.jsxDEV(O,{color:"yellow",children:"Task "},void 0,!1,void 0,this),G4.jsxDEV(O,{dimColor:!0,children:"("},void 0,!1,void 0,this),G4.jsxDEV(O,{color:"cyan",children:Y.subagent_id},void 0,!1,void 0,this),G4.jsxDEV(O,{dimColor:!0,children:")"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)},l$=({tool:Z})=>{let Y=Z.getInputRepaired(),X=Z.output;return G4.jsxDEV(N,{flexDirection:"column",children:G4.jsxDEV(d$,{tool:Z},void 0,!1,void 0,this)},void 0,!1,void 0,this)},M5=t({name:"task",description:"Launch a subagent to handle complex tasks autonomously",parameters:c$.shape,handler:ZZ.waitForUIDone,render(Z){return G4.jsxDEV(l$,{tool:Z},void 0,!1,void 0,this)}});var N5=[s8,n8,X5,Q5,K5,U5,z5,H5,O5,q5,F5,M5];var e=L(x(),1);var b=L(v(),1),i$=({validation:Z,onComplete:Y})=>{let{config:X,updateConfig:J}=UZ(),[Q,$]=e.useState("welcome"),[K,W]=e.useState(!1),[U,z]=e.useState(null),[H,G]=e.useState(0),[F,M]=e.useState(null),_=e.useRef(!0),A=e.useRef([]),P=e.useRef(H),B=X?.providers||[];e.useEffect(()=>{A.current=B},[B]),e.useEffect(()=>{P.current=H},[H]);let C=B[H],R=e.useCallback(()=>M(null),[]);jZ(R,F?3000:null);let D=e.useCallback(()=>{_.current=!0,z(null),W(!0),M(null)},[]),j=e.useCallback(()=>{let g=A.current,r=P.current,n=g[r];if(!n)return;_.current=!1,z(n),W(!0),M(null)},[]),E=e.useCallback(()=>{W(!1),z(null),M(null)},[]),c=e.useCallback(async(g)=>{let r=A.current,n=_.current,F4=n?[...r,g]:r.map((M4)=>M4.id===g.id?g:M4);if(await J({providers:F4}),M(n?`已添加 Provider: ${g.id}`:`已更新 Provider: ${g.id}`),n){let M4=F4.findIndex((gZ)=>gZ.id===g.id);G(M4>=0?M4:0)}E()},[J,E]),i=e.useCallback(()=>{if(!C||!C.apiKey){M("请先配置 Provider 的 API Key");return}J({provider_id:C.id,provider_type:C.type}).then(()=>{$("model")})},[C,J]);if(mZ((g,r)=>{if(r.return||g===" ")$("provider")},{isActive:Q==="welcome"}),mZ((g,r)=>{if(K)return;if(r.upArrow)G((n)=>n>0?n-1:B.length-1);else if(r.downArrow)G((n)=>n<B.length-1?n+1:0);else if(g==="n"||g==="N")D();else if((g==="e"||g==="E"||r.return)&&C)j();else if(g==="s"||g==="S")i()},{isActive:Q==="provider"}),Q==="welcome")return b.jsxDEV(N,{flexDirection:"column",paddingX:2,paddingY:1,width:"100%",children:[b.jsxDEV(N,{marginBottom:1,children:b.jsxDEV(O,{bold:!0,color:"cyan",children:"欢迎使用 Zen Code"},void 0,!1,void 0,this)},void 0,!1,void 0,this),b.jsxDEV(N,{marginBottom:1,children:b.jsxDEV(O,{color:"yellow",children:Z.reason||"需要进行初始配置"},void 0,!1,void 0,this)},void 0,!1,void 0,this),b.jsxDEV(N,{flexDirection:"column",marginBottom:1,children:[b.jsxDEV(O,{dimColor:!0,children:"接下来将引导你完成:"},void 0,!1,void 0,this),b.jsxDEV(O,{dimColor:!0,children:" 1. 配置 Provider(API 服务提供商)"},void 0,!1,void 0,this),b.jsxDEV(O,{dimColor:!0,children:" 2. 选择 Model(AI 模型)"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),b.jsxDEV(N,{children:b.jsxDEV(O,{color:"green",bold:!0,children:"按 Enter 开始配置"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this);if(Q==="provider")return b.jsxDEV(N,{flexDirection:"column",width:"100%",children:[b.jsxDEV(N,{paddingX:2,paddingY:1,children:b.jsxDEV(O,{bold:!0,color:"cyan",children:"步骤 1/2: Provider 配置"},void 0,!1,void 0,this)},void 0,!1,void 0,this),K?b.jsxDEV(w5,{provider:U||void 0,onCancel:E,onSave:c},void 0,!1,void 0,this):b.jsxDEV(b.Fragment,{children:b.jsxDEV(N,{flexDirection:"column",paddingX:2,gap:1,children:[B.length===0?b.jsxDEV(N,{paddingY:1,children:b.jsxDEV(O,{color:"yellow",children:"未配置任何 Provider,请按 'n' 新增"},void 0,!1,void 0,this)},void 0,!1,void 0,this):B.map((g,r)=>{let n=!!g.apiKey,F4=n?"green":"yellow";return b.jsxDEV(N,{marginBottom:0,gap:1,children:[b.jsxDEV(O,{color:r===H?"cyan":"gray",bold:r===H,children:r===H?">":" "},void 0,!1,void 0,this),b.jsxDEV(O,{bold:r===H,color:r===H?"cyan":void 0,children:g.id},void 0,!1,void 0,this),b.jsxDEV(O,{color:"gray",dimColor:r!==H,children:[" ",g.type]},void 0,!0,void 0,this),b.jsxDEV(O,{color:F4,dimColor:r!==H,children:[" ","[",n?"已配置":"未配置","]"]},void 0,!0,void 0,this)]},g.id,!0,void 0,this)}),b.jsxDEV(N,{marginTop:1,children:[b.jsxDEV(O,{color:"gray",dimColor:!0,children:[b.jsxDEV(O,{color:"cyan",children:"↑↓"},void 0,!1,void 0,this)," 导航 ",b.jsxDEV(O,{color:"cyan",children:"n"},void 0,!1,void 0,this)," 新增"," ",b.jsxDEV(O,{color:"cyan",children:"e/Enter"},void 0,!1,void 0,this)," 编辑"," "]},void 0,!0,void 0,this),B.some((g)=>g.apiKey)&&b.jsxDEV(O,{children:[b.jsxDEV(O,{color:"green",children:"s"},void 0,!1,void 0,this)," 下一步"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),F&&b.jsxDEV(N,{paddingX:2,paddingY:0,children:b.jsxDEV(O,{color:"green",children:F},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this);if(Q==="model")return b.jsxDEV(r$,{onComplete:Y,onBack:()=>$("provider")},void 0,!1,void 0,this);return null},r$=({onComplete:Z,onBack:Y})=>{let{config:X,updateConfig:J}=UZ(),[Q,$]=e.useState(0),K=e.useMemo(()=>{return X?.providers.find((G)=>G.id===X.provider_id)||null},[X?.providers,X?.provider_id]),{data:W=[],isLoading:U,error:z}=_5({provider:K,enabled:!!K?.apiKey}),H=W[Q];if(mZ((G,F)=>{if(F.upArrow)$((M)=>M>0?M-1:W.length-1);else if(F.downArrow)$((M)=>M<W.length-1?M+1:0);else if(F.escape||G==="b"||G==="B")Y();else if((F.return||G===" ")&&H)J({model_id:H.id}).then(()=>{Z()})},{isActive:!U&&!z&&X!==null}),U)return b.jsxDEV(N,{flexDirection:"column",paddingX:2,paddingY:1,children:[b.jsxDEV(O,{bold:!0,color:"cyan",children:"步骤 2/2: Model 选择"},void 0,!1,void 0,this),b.jsxDEV(N,{marginTop:1,children:b.jsxDEV(O,{color:"gray",children:"加载模型列表中..."},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this);if(z)return b.jsxDEV(N,{flexDirection:"column",paddingX:2,paddingY:1,children:[b.jsxDEV(O,{bold:!0,color:"cyan",children:"步骤 2/2: Model 选择"},void 0,!1,void 0,this),b.jsxDEV(N,{marginTop:1,children:b.jsxDEV(O,{color:"red",children:["加载失败: ",z.message]},void 0,!0,void 0,this)},void 0,!1,void 0,this),b.jsxDEV(N,{marginTop:1,children:b.jsxDEV(O,{color:"gray",dimColor:!0,children:["按 ",b.jsxDEV(O,{color:"cyan",children:"Esc"},void 0,!1,void 0,this)," 返回上一步"]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this);return b.jsxDEV(N,{flexDirection:"column",width:"100%",children:[b.jsxDEV(N,{paddingX:2,paddingY:1,children:[b.jsxDEV(O,{bold:!0,color:"cyan",children:"步骤 2/2: Model 选择"},void 0,!1,void 0,this),K&&b.jsxDEV(O,{dimColor:!0,children:[" ","- ",K.id," (",K.type,")"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),b.jsxDEV(N,{flexDirection:"column",paddingX:2,gap:0,children:W.map((G,F)=>b.jsxDEV(N,{marginBottom:0,gap:1,children:[b.jsxDEV(O,{color:F===Q?"cyan":"gray",bold:F===Q,children:F===Q?">":" "},void 0,!1,void 0,this),b.jsxDEV(O,{bold:F===Q,color:F===Q?"cyan":void 0,children:G.id},void 0,!1,void 0,this),G.name!==G.id&&b.jsxDEV(O,{dimColor:F!==Q,children:["(",G.name,")"]},void 0,!0,void 0,this)]},G.id,!0,void 0,this))},void 0,!1,void 0,this),b.jsxDEV(N,{marginTop:1,paddingX:2,children:b.jsxDEV(O,{color:"gray",dimColor:!0,children:[b.jsxDEV(O,{color:"cyan",children:"↑↓"},void 0,!1,void 0,this)," 导航 ",b.jsxDEV(O,{color:"cyan",children:"Enter/Space"},void 0,!1,void 0,this)," 确认"," ",b.jsxDEV(O,{color:"cyan",children:"Esc/B"},void 0,!1,void 0,this)," 返回"]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},A5=i$;var B5=L(x(),1);var GZ=L(v(),1);class L5 extends B5.Component{state={hasError:!1,error:null,errorInfo:null};static getDerivedStateFromError(Z){return{hasError:!0,error:Z}}componentDidCatch(Z,Y){let{name:X="ErrorBoundary"}=this.props;console.error(`
|
|
73
73
|
========================================`),console.error(`[${X}] React Error Caught`),console.error("========================================"),console.error("Error:",Z.message),console.error("Stack:",Z.stack),console.error("Component Stack:",Y.componentStack),console.error(`========================================
|
|
74
|
-
`),this.setState({errorInfo:Y})}render(){let{hasError:Z,error:Y,errorInfo:X}=this.state,{name:J="ErrorBoundary",fallback:Q,children:$}=this.props;if(Z){if(Q)return
|
|
74
|
+
`),this.setState({errorInfo:Y})}render(){let{hasError:Z,error:Y,errorInfo:X}=this.state,{name:J="ErrorBoundary",fallback:Q,children:$}=this.props;if(Z){if(Q)return GZ.jsxDEV(GZ.Fragment,{children:Q},void 0,!1,void 0,this);return GZ.jsxDEV(N,{flexDirection:"column",padding:1,borderStyle:"double",borderColor:"red",children:[GZ.jsxDEV(N,{marginBottom:1,children:GZ.jsxDEV(O,{color:"red",bold:!0,children:["✗ [",J,"] Render Error"]},void 0,!0,void 0,this)},void 0,!1,void 0,this),GZ.jsxDEV(N,{marginBottom:1,children:GZ.jsxDEV(O,{color:"red",children:["Message: ",Y?.message||"Unknown error"]},void 0,!0,void 0,this)},void 0,!1,void 0,this),Y?.stack&&GZ.jsxDEV(N,{flexDirection:"column",marginBottom:1,children:[GZ.jsxDEV(O,{color:"yellow",bold:!0,children:"Stack Trace:"},void 0,!1,void 0,this),GZ.jsxDEV(O,{color:"gray",children:Y.stack.split(`
|
|
75
75
|
`).slice(0,5).join(`
|
|
76
|
-
`)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),X?.componentStack&&
|
|
76
|
+
`)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),X?.componentStack&&GZ.jsxDEV(N,{flexDirection:"column",children:[GZ.jsxDEV(O,{color:"yellow",bold:!0,children:"Component Stack:"},void 0,!1,void 0,this),GZ.jsxDEV(O,{color:"gray",dimColor:!0,children:X.componentStack.split(`
|
|
77
77
|
`).slice(0,5).join(`
|
|
78
|
-
`)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),
|
|
79
|
-
]`).replace("lheading",
|
|
80
|
-
`).map(($)=>{let K=$.match(X.other.beginningSpace);if(K===null)return $;let[
|
|
81
|
-
`)}var
|
|
82
|
-
`)}}}fences(Z){let Y=this.rules.block.fences.exec(Z);if(Y){let X=Y[0],J=
|
|
83
|
-
`)}}blockquote(Z){let Y=this.rules.block.blockquote.exec(Z);if(Y){let X=
|
|
78
|
+
`)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),GZ.jsxDEV(N,{marginTop:1,children:GZ.jsxDEV(O,{color:"blue",dimColor:!0,children:"Press Ctrl+C to exit"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}return GZ.jsxDEV(GZ.Fragment,{children:$},void 0,!1,void 0,this)}}var o=L5;var G0=L(v(),1),o$=({children:Z})=>{let{extraParams:Y,toggleCompactMode:X,config:J}=UZ(),{setTools:Q,loading:$}=WZ(),{hasPendingInteractions:K}=uZ();I8({tools:N5,setTools:Q});let{needsSetup:W,validation:U}=E8({config:J});T8({shouldFocus:!$});let z=f8(),{isChatView:H}=z,{handleExecuteTask:G}=j8({closePanel:z.closePanel});if(mZ((M,_)=>{if(_.ctrl&&M==="o"&&H&&!$)X();else if(_.ctrl&&M==="z"&&globalThis.Bun)import("v8").then((A)=>{A.writeHeapSnapshot("my-application.heapsnapshot")})},{isActive:H}),W&&U)return G0.jsxDEV(o,{name:"SetupWizard",fallback:null,children:G0.jsxDEV(A5,{validation:U,onComplete:z.closePanel},void 0,!1,void 0,this)},void 0,!1,void 0,this);let F={activeView:z.activeView,isChatView:z.isChatView,switchToHistory:z.switchToHistory,switchToKnowledge:z.switchToKnowledge,switchToSettings:z.switchToSettings,switchToModelProvider:z.switchToModelProvider,switchToAgent:z.switchToAgent,switchToTask:z.switchToTask,switchToMcp:z.switchToMcp,closePanel:z.closePanel,handleExecuteTask:G,hasPendingInteractions:K};return G0.jsxDEV(o,{name:"ChatPanelContext",fallback:null,children:G0.jsxDEV(y8,{value:F,children:Z},void 0,!1,void 0,this)},void 0,!1,void 0,this)},P5=({children:Z})=>{return G0.jsxDEV(o$,{children:Z},void 0,!1,void 0,this)};var O1=L(x(),1);var yY=L(x(),1);var L4=L(v(),1),n$=({content:Z,messageNumber:Y})=>{let X=s0(),J=()=>{if(typeof Z==="string")return L4.jsxDEV(O,{color:"white",children:Z},void 0,!1,void 0,this);if(Array.isArray(Z))return Z.filter((Q)=>Q.type==="text").map((Q,$)=>L4.jsxDEV(O,{color:"white",children:Q.text},void 0,!1,void 0,this));return L4.jsxDEV(O,{color:"white",children:JSON.stringify(Z)},void 0,!1,void 0,this)};return L4.jsxDEV(N,{flexDirection:"column",children:[L4.jsxDEV(N,{children:L4.jsxDEV(O,{color:bZ("amber"),children:[Y," ",X]},void 0,!0,void 0,this)},void 0,!1,void 0,this),L4.jsxDEV(N,{children:L4.jsxDEV(O,{color:"gray",children:["└─ ",J()]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},t0=n$;var V=L(RW(),1);function UX(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var i4=UX();function E5(Z){i4=Z}var C0={exec:()=>null};function p(Z,Y=""){let X=typeof Z=="string"?Z:Z.source,J={replace:(Q,$)=>{let K=typeof $=="string"?$:$.source;return K=K.replace(CZ.caret,"$1"),X=X.replace(Q,K),J},getRegex:()=>new RegExp(X,Y)};return J}var a$=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),CZ={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:(Z)=>new RegExp(`^( {0,3}${Z})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:(Z)=>new RegExp(`^ {0,${Math.min(3,Z-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:(Z)=>new RegExp(`^ {0,${Math.min(3,Z-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:(Z)=>new RegExp(`^ {0,${Math.min(3,Z-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:(Z)=>new RegExp(`^ {0,${Math.min(3,Z-1)}}#`),htmlBeginRegex:(Z)=>new RegExp(`^ {0,${Math.min(3,Z-1)}}<(?:[a-z].*>|!--)`,"i")},s$=/^(?:[ \t]*(?:\n|$))+/,t$=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,e$=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,v0=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ZK=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,zX=/(?:[*+-]|\d{1,9}[.)])/,b5=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,T5=p(b5).replace(/bull/g,zX).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),YK=p(b5).replace(/bull/g,zX).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),HX=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,XK=/^[^\n]+/,GX=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,JK=p(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",GX).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),QK=p(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,zX).getRegex(),JY="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",OX=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,$K=p("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$))","i").replace("comment",OX).replace("tag",JY).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),f5=p(HX).replace("hr",v0).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",JY).getRegex(),KK=p(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",f5).getRegex(),qX={blockquote:KK,code:t$,def:JK,fences:e$,heading:ZK,hr:v0,html:$K,lheading:T5,list:QK,newline:s$,paragraph:f5,table:C0,text:XK},R5=p("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",v0).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3}\t)[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",JY).getRegex(),WK={...qX,lheading:YK,table:R5,paragraph:p(HX).replace("hr",v0).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",R5).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",JY).getRegex()},UK={...qX,html:p(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",OX).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:C0,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:p(HX).replace("hr",v0).replace("heading",` *#{1,6} *[^
|
|
79
|
+
]`).replace("lheading",T5).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},zK=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,HK=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,j5=/^( {2,}|\\)\n(?!\s*$)/,GK=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,QY=/[\p{P}\p{S}]/u,FX=/[\s\p{P}\p{S}]/u,S5=/[^\s\p{P}\p{S}]/u,OK=p(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,FX).getRegex(),y5=/(?!~)[\p{P}\p{S}]/u,qK=/(?!~)[\s\p{P}\p{S}]/u,FK=/(?:[^\s\p{P}\p{S}]|~)/u,MK=p(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",a$?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),k5=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,NK=p(k5,"u").replace(/punct/g,QY).getRegex(),_K=p(k5,"u").replace(/punct/g,y5).getRegex(),h5="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",wK=p(h5,"gu").replace(/notPunctSpace/g,S5).replace(/punctSpace/g,FX).replace(/punct/g,QY).getRegex(),AK=p(h5,"gu").replace(/notPunctSpace/g,FK).replace(/punctSpace/g,qK).replace(/punct/g,y5).getRegex(),BK=p("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,S5).replace(/punctSpace/g,FX).replace(/punct/g,QY).getRegex(),LK=p(/\\(punct)/,"gu").replace(/punct/g,QY).getRegex(),PK=p(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),RK=p(OX).replace("(?:-->|$)","-->").getRegex(),CK=p("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",RK).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ZY=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,vK=p(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",ZY).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),x5=p(/^!?\[(label)\]\[(ref)\]/).replace("label",ZY).replace("ref",GX).getRegex(),g5=p(/^!?\[(ref)\](?:\[\])?/).replace("ref",GX).getRegex(),IK=p("reflink|nolink(?!\\()","g").replace("reflink",x5).replace("nolink",g5).getRegex(),C5=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,MX={_backpedal:C0,anyPunctuation:LK,autolink:PK,blockSkip:MK,br:j5,code:HK,del:C0,emStrongLDelim:NK,emStrongRDelimAst:wK,emStrongRDelimUnd:BK,escape:zK,link:vK,nolink:g5,punctuation:OK,reflink:x5,reflinkSearch:IK,tag:CK,text:GK,url:C0},DK={...MX,link:p(/^!?\[(label)\]\((.*?)\)/).replace("label",ZY).getRegex(),reflink:p(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ZY).getRegex()},WX={...MX,emStrongRDelimAst:AK,emStrongLDelim:_K,url:p(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",C5).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:p(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",C5).getRegex()},VK={...WX,br:p(j5).replace("{2,}","*").getRegex(),text:p(WX.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},e0={normal:qX,gfm:WK,pedantic:UK},L0={normal:MX,gfm:WX,breaks:VK,pedantic:DK},EK={"&":"&","<":"<",">":">",'"':""","'":"'"},v5=(Z)=>EK[Z];function O4(Z,Y){if(Y){if(CZ.escapeTest.test(Z))return Z.replace(CZ.escapeReplace,v5)}else if(CZ.escapeTestNoEncode.test(Z))return Z.replace(CZ.escapeReplaceNoEncode,v5);return Z}function I5(Z){try{Z=encodeURI(Z).replace(CZ.percentDecode,"%")}catch{return null}return Z}function D5(Z,Y){let X=Z.replace(CZ.findPipe,($,K,W)=>{let U=!1,z=K;for(;--z>=0&&W[z]==="\\";)U=!U;return U?"|":" |"}),J=X.split(CZ.splitPipe),Q=0;if(J[0].trim()||J.shift(),J.length>0&&!J.at(-1)?.trim()&&J.pop(),Y)if(J.length>Y)J.splice(Y);else for(;J.length<Y;)J.push("");for(;Q<J.length;Q++)J[Q]=J[Q].trim().replace(CZ.slashPipe,"|");return J}function P0(Z,Y,X){let J=Z.length;if(J===0)return"";let Q=0;for(;Q<J;){let $=Z.charAt(J-Q-1);if($===Y&&!X)Q++;else if($!==Y&&X)Q++;else break}return Z.slice(0,J-Q)}function bK(Z,Y){if(Z.indexOf(Y[1])===-1)return-1;let X=0;for(let J=0;J<Z.length;J++)if(Z[J]==="\\")J++;else if(Z[J]===Y[0])X++;else if(Z[J]===Y[1]&&(X--,X<0))return J;return X>0?-2:-1}function V5(Z,Y,X,J,Q){let $=Y.href,K=Y.title||null,W=Z[1].replace(Q.other.outputLinkReplace,"$1");J.state.inLink=!0;let U={type:Z[0].charAt(0)==="!"?"image":"link",raw:X,href:$,title:K,text:W,tokens:J.inlineTokens(W)};return J.state.inLink=!1,U}function TK(Z,Y,X){let J=Z.match(X.other.indentCodeCompensation);if(J===null)return Y;let Q=J[1];return Y.split(`
|
|
80
|
+
`).map(($)=>{let K=$.match(X.other.beginningSpace);if(K===null)return $;let[W]=K;return W.length>=Q.length?$.slice(Q.length):$}).join(`
|
|
81
|
+
`)}var YY=class{options;rules;lexer;constructor(Z){this.options=Z||i4}space(Z){let Y=this.rules.block.newline.exec(Z);if(Y&&Y[0].length>0)return{type:"space",raw:Y[0]}}code(Z){let Y=this.rules.block.code.exec(Z);if(Y){let X=Y[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:Y[0],codeBlockStyle:"indented",text:this.options.pedantic?X:P0(X,`
|
|
82
|
+
`)}}}fences(Z){let Y=this.rules.block.fences.exec(Z);if(Y){let X=Y[0],J=TK(X,Y[3]||"",this.rules);return{type:"code",raw:X,lang:Y[2]?Y[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):Y[2],text:J}}}heading(Z){let Y=this.rules.block.heading.exec(Z);if(Y){let X=Y[2].trim();if(this.rules.other.endingHash.test(X)){let J=P0(X,"#");(this.options.pedantic||!J||this.rules.other.endingSpaceChar.test(J))&&(X=J.trim())}return{type:"heading",raw:Y[0],depth:Y[1].length,text:X,tokens:this.lexer.inline(X)}}}hr(Z){let Y=this.rules.block.hr.exec(Z);if(Y)return{type:"hr",raw:P0(Y[0],`
|
|
83
|
+
`)}}blockquote(Z){let Y=this.rules.block.blockquote.exec(Z);if(Y){let X=P0(Y[0],`
|
|
84
84
|
`).split(`
|
|
85
|
-
`),J="",Q="",$=[];for(;X.length>0;){let K=!1,
|
|
85
|
+
`),J="",Q="",$=[];for(;X.length>0;){let K=!1,W=[],U;for(U=0;U<X.length;U++)if(this.rules.other.blockquoteStart.test(X[U]))W.push(X[U]),K=!0;else if(!K)W.push(X[U]);else break;X=X.slice(U);let z=W.join(`
|
|
86
86
|
`),H=z.replace(this.rules.other.blockquoteSetextReplace,`
|
|
87
87
|
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");J=J?`${J}
|
|
88
88
|
${z}`:z,Q=Q?`${Q}
|
|
89
|
-
${H}`:H;let G=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(H,$,!0),this.lexer.state.top=G,X.length===0)break;let F=$.at(-1);if(F?.type==="code")break;if(F?.type==="blockquote"){let M=F,
|
|
89
|
+
${H}`:H;let G=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(H,$,!0),this.lexer.state.top=G,X.length===0)break;let F=$.at(-1);if(F?.type==="code")break;if(F?.type==="blockquote"){let M=F,_=M.raw+`
|
|
90
90
|
`+X.join(`
|
|
91
|
-
`),
|
|
91
|
+
`),A=this.blockquote(_);$[$.length-1]=A,J=J.substring(0,J.length-M.raw.length)+A.raw,Q=Q.substring(0,Q.length-M.text.length)+A.text;break}else if(F?.type==="list"){let M=F,_=M.raw+`
|
|
92
92
|
`+X.join(`
|
|
93
|
-
`),
|
|
94
|
-
`);continue}}return{type:"blockquote",raw:J,tokens:$,text:Q}}}list(Z){let Y=this.rules.block.list.exec(Z);if(Y){let X=Y[1].trim(),J=X.length>1,Q={type:"list",raw:"",ordered:J,start:J?+X.slice(0,-1):"",loose:!1,items:[]};X=J?`\\d{1,9}\\${X.slice(-1)}`:`\\${X}`,this.options.pedantic&&(X=J?X:"[*+-]");let $=this.rules.other.listItemRegex(X),K=!1;for(;Z;){let
|
|
93
|
+
`),A=this.list(_);$[$.length-1]=A,J=J.substring(0,J.length-F.raw.length)+A.raw,Q=Q.substring(0,Q.length-M.raw.length)+A.raw,X=_.substring($.at(-1).raw.length).split(`
|
|
94
|
+
`);continue}}return{type:"blockquote",raw:J,tokens:$,text:Q}}}list(Z){let Y=this.rules.block.list.exec(Z);if(Y){let X=Y[1].trim(),J=X.length>1,Q={type:"list",raw:"",ordered:J,start:J?+X.slice(0,-1):"",loose:!1,items:[]};X=J?`\\d{1,9}\\${X.slice(-1)}`:`\\${X}`,this.options.pedantic&&(X=J?X:"[*+-]");let $=this.rules.other.listItemRegex(X),K=!1;for(;Z;){let U=!1,z="",H="";if(!(Y=$.exec(Z))||this.rules.block.hr.test(Z))break;z=Y[0],Z=Z.substring(z.length);let G=Y[2].split(`
|
|
95
95
|
`,1)[0].replace(this.rules.other.listReplaceTabs,(B)=>" ".repeat(3*B.length)),F=Z.split(`
|
|
96
|
-
`,1)[0],M=!G.trim(),
|
|
97
|
-
`,Z=Z.substring(F.length+1),
|
|
98
|
-
`,1)[0],
|
|
99
|
-
`+
|
|
96
|
+
`,1)[0],M=!G.trim(),_=0;if(this.options.pedantic?(_=2,H=G.trimStart()):M?_=Y[1].length+1:(_=Y[2].search(this.rules.other.nonSpaceChar),_=_>4?1:_,H=G.slice(_),_+=Y[1].length),M&&this.rules.other.blankLine.test(F)&&(z+=F+`
|
|
97
|
+
`,Z=Z.substring(F.length+1),U=!0),!U){let B=this.rules.other.nextBulletRegex(_),C=this.rules.other.hrRegex(_),R=this.rules.other.fencesBeginRegex(_),D=this.rules.other.headingBeginRegex(_),j=this.rules.other.htmlBeginRegex(_);for(;Z;){let E=Z.split(`
|
|
98
|
+
`,1)[0],c;if(F=E,this.options.pedantic?(F=F.replace(this.rules.other.listReplaceNesting," "),c=F):c=F.replace(this.rules.other.tabCharGlobal," "),R.test(F)||D.test(F)||j.test(F)||B.test(F)||C.test(F))break;if(c.search(this.rules.other.nonSpaceChar)>=_||!F.trim())H+=`
|
|
99
|
+
`+c.slice(_);else{if(M||G.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||R.test(G)||D.test(G)||C.test(G))break;H+=`
|
|
100
100
|
`+F}!M&&!F.trim()&&(M=!0),z+=E+`
|
|
101
|
-
`,Z=Z.substring(E.length+1),G=
|
|
102
|
-
`):[],$={type:"table",raw:Y[0],header:[],align:[],rows:[]};if(X.length===J.length){for(let K of J)this.rules.other.tableAlignRight.test(K)?$.align.push("right"):this.rules.other.tableAlignCenter.test(K)?$.align.push("center"):this.rules.other.tableAlignLeft.test(K)?$.align.push("left"):$.align.push(null);for(let K=0;K<X.length;K++)$.header.push({text:X[K],tokens:this.lexer.inline(X[K]),header:!0,align:$.align[K]});for(let K of Q)$.rows.push(
|
|
103
|
-
`?Y[1].slice(0,-1):Y[1];return{type:"paragraph",raw:Y[0],text:X,tokens:this.lexer.inline(X)}}}text(Z){let Y=this.rules.block.text.exec(Z);if(Y)return{type:"text",raw:Y[0],text:Y[0],tokens:this.lexer.inline(Y[0])}}escape(Z){let Y=this.rules.inline.escape.exec(Z);if(Y)return{type:"escape",raw:Y[0],text:Y[1]}}tag(Z){let Y=this.rules.inline.tag.exec(Z);if(Y)return!this.lexer.state.inLink&&this.rules.other.startATag.test(Y[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(Y[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(Y[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(Y[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:Y[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:Y[0]}}link(Z){let Y=this.rules.inline.link.exec(Z);if(Y){let X=Y[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(X)){if(!this.rules.other.endAngleBracket.test(X))return;let $=
|
|
104
|
-
`),this.blockTokens(Y,this.tokens);for(let X=0;X<this.inlineQueue.length;X++){let J=this.inlineQueue[X];this.inlineTokens(J.src,J.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(Y,X=[],J=!1){for(this.options.pedantic&&(Y=Y.replace(
|
|
101
|
+
`,Z=Z.substring(E.length+1),G=c.slice(_)}}Q.loose||(K?Q.loose=!0:this.rules.other.doubleBlankLine.test(z)&&(K=!0));let A=null,P;this.options.gfm&&(A=this.rules.other.listIsTask.exec(H),A&&(P=A[0]!=="[ ] ",H=H.replace(this.rules.other.listReplaceTask,""))),Q.items.push({type:"list_item",raw:z,task:!!A,checked:P,loose:!1,text:H,tokens:[]}),Q.raw+=z}let W=Q.items.at(-1);if(W)W.raw=W.raw.trimEnd(),W.text=W.text.trimEnd();else return;Q.raw=Q.raw.trimEnd();for(let U=0;U<Q.items.length;U++)if(this.lexer.state.top=!1,Q.items[U].tokens=this.lexer.blockTokens(Q.items[U].text,[]),!Q.loose){let z=Q.items[U].tokens.filter((G)=>G.type==="space"),H=z.length>0&&z.some((G)=>this.rules.other.anyLine.test(G.raw));Q.loose=H}if(Q.loose)for(let U=0;U<Q.items.length;U++)Q.items[U].loose=!0;return Q}}html(Z){let Y=this.rules.block.html.exec(Z);if(Y)return{type:"html",block:!0,raw:Y[0],pre:Y[1]==="pre"||Y[1]==="script"||Y[1]==="style",text:Y[0]}}def(Z){let Y=this.rules.block.def.exec(Z);if(Y){let X=Y[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),J=Y[2]?Y[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",Q=Y[3]?Y[3].substring(1,Y[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):Y[3];return{type:"def",tag:X,raw:Y[0],href:J,title:Q}}}table(Z){let Y=this.rules.block.table.exec(Z);if(!Y||!this.rules.other.tableDelimiter.test(Y[2]))return;let X=D5(Y[1]),J=Y[2].replace(this.rules.other.tableAlignChars,"").split("|"),Q=Y[3]?.trim()?Y[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
102
|
+
`):[],$={type:"table",raw:Y[0],header:[],align:[],rows:[]};if(X.length===J.length){for(let K of J)this.rules.other.tableAlignRight.test(K)?$.align.push("right"):this.rules.other.tableAlignCenter.test(K)?$.align.push("center"):this.rules.other.tableAlignLeft.test(K)?$.align.push("left"):$.align.push(null);for(let K=0;K<X.length;K++)$.header.push({text:X[K],tokens:this.lexer.inline(X[K]),header:!0,align:$.align[K]});for(let K of Q)$.rows.push(D5(K,$.header.length).map((W,U)=>({text:W,tokens:this.lexer.inline(W),header:!1,align:$.align[U]})));return $}}lheading(Z){let Y=this.rules.block.lheading.exec(Z);if(Y)return{type:"heading",raw:Y[0],depth:Y[2].charAt(0)==="="?1:2,text:Y[1],tokens:this.lexer.inline(Y[1])}}paragraph(Z){let Y=this.rules.block.paragraph.exec(Z);if(Y){let X=Y[1].charAt(Y[1].length-1)===`
|
|
103
|
+
`?Y[1].slice(0,-1):Y[1];return{type:"paragraph",raw:Y[0],text:X,tokens:this.lexer.inline(X)}}}text(Z){let Y=this.rules.block.text.exec(Z);if(Y)return{type:"text",raw:Y[0],text:Y[0],tokens:this.lexer.inline(Y[0])}}escape(Z){let Y=this.rules.inline.escape.exec(Z);if(Y)return{type:"escape",raw:Y[0],text:Y[1]}}tag(Z){let Y=this.rules.inline.tag.exec(Z);if(Y)return!this.lexer.state.inLink&&this.rules.other.startATag.test(Y[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(Y[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(Y[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(Y[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:Y[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:Y[0]}}link(Z){let Y=this.rules.inline.link.exec(Z);if(Y){let X=Y[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(X)){if(!this.rules.other.endAngleBracket.test(X))return;let $=P0(X.slice(0,-1),"\\");if((X.length-$.length)%2===0)return}else{let $=bK(Y[2],"()");if($===-2)return;if($>-1){let K=(Y[0].indexOf("!")===0?5:4)+Y[1].length+$;Y[2]=Y[2].substring(0,$),Y[0]=Y[0].substring(0,K).trim(),Y[3]=""}}let J=Y[2],Q="";if(this.options.pedantic){let $=this.rules.other.pedanticHrefTitle.exec(J);$&&(J=$[1],Q=$[3])}else Q=Y[3]?Y[3].slice(1,-1):"";return J=J.trim(),this.rules.other.startAngleBracket.test(J)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(X)?J=J.slice(1):J=J.slice(1,-1)),V5(Y,{href:J&&J.replace(this.rules.inline.anyPunctuation,"$1"),title:Q&&Q.replace(this.rules.inline.anyPunctuation,"$1")},Y[0],this.lexer,this.rules)}}reflink(Z,Y){let X;if((X=this.rules.inline.reflink.exec(Z))||(X=this.rules.inline.nolink.exec(Z))){let J=(X[2]||X[1]).replace(this.rules.other.multipleSpaceGlobal," "),Q=Y[J.toLowerCase()];if(!Q){let $=X[0].charAt(0);return{type:"text",raw:$,text:$}}return V5(X,Q,X[0],this.lexer,this.rules)}}emStrong(Z,Y,X=""){let J=this.rules.inline.emStrongLDelim.exec(Z);if(!J||J[3]&&X.match(this.rules.other.unicodeAlphaNumeric))return;if(!(J[1]||J[2])||!X||this.rules.inline.punctuation.exec(X)){let Q=[...J[0]].length-1,$,K,W=Q,U=0,z=J[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(z.lastIndex=0,Y=Y.slice(-1*Z.length+Q);(J=z.exec(Y))!=null;){if($=J[1]||J[2]||J[3]||J[4]||J[5]||J[6],!$)continue;if(K=[...$].length,J[3]||J[4]){W+=K;continue}else if((J[5]||J[6])&&Q%3&&!((Q+K)%3)){U+=K;continue}if(W-=K,W>0)continue;K=Math.min(K,K+W+U);let H=[...J[0]][0].length,G=Z.slice(0,Q+J.index+H+K);if(Math.min(Q,K)%2){let M=G.slice(1,-1);return{type:"em",raw:G,text:M,tokens:this.lexer.inlineTokens(M)}}let F=G.slice(2,-2);return{type:"strong",raw:G,text:F,tokens:this.lexer.inlineTokens(F)}}}}codespan(Z){let Y=this.rules.inline.code.exec(Z);if(Y){let X=Y[2].replace(this.rules.other.newLineCharGlobal," "),J=this.rules.other.nonSpaceChar.test(X),Q=this.rules.other.startingSpaceChar.test(X)&&this.rules.other.endingSpaceChar.test(X);return J&&Q&&(X=X.substring(1,X.length-1)),{type:"codespan",raw:Y[0],text:X}}}br(Z){let Y=this.rules.inline.br.exec(Z);if(Y)return{type:"br",raw:Y[0]}}del(Z){let Y=this.rules.inline.del.exec(Z);if(Y)return{type:"del",raw:Y[0],text:Y[2],tokens:this.lexer.inlineTokens(Y[2])}}autolink(Z){let Y=this.rules.inline.autolink.exec(Z);if(Y){let X,J;return Y[2]==="@"?(X=Y[1],J="mailto:"+X):(X=Y[1],J=X),{type:"link",raw:Y[0],text:X,href:J,tokens:[{type:"text",raw:X,text:X}]}}}url(Z){let Y;if(Y=this.rules.inline.url.exec(Z)){let X,J;if(Y[2]==="@")X=Y[0],J="mailto:"+X;else{let Q;do Q=Y[0],Y[0]=this.rules.inline._backpedal.exec(Y[0])?.[0]??"";while(Q!==Y[0]);X=Y[0],Y[1]==="www."?J="http://"+Y[0]:J=Y[0]}return{type:"link",raw:Y[0],text:X,href:J,tokens:[{type:"text",raw:X,text:X}]}}}inlineText(Z){let Y=this.rules.inline.text.exec(Z);if(Y){let X=this.lexer.state.inRawBlock;return{type:"text",raw:Y[0],text:Y[0],escaped:X}}}},tZ=class Z{tokens;options;state;tokenizer;inlineQueue;constructor(Y){this.tokens=[],this.tokens.links=Object.create(null),this.options=Y||i4,this.options.tokenizer=this.options.tokenizer||new YY,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let X={other:CZ,block:e0.normal,inline:L0.normal};this.options.pedantic?(X.block=e0.pedantic,X.inline=L0.pedantic):this.options.gfm&&(X.block=e0.gfm,this.options.breaks?X.inline=L0.breaks:X.inline=L0.gfm),this.tokenizer.rules=X}static get rules(){return{block:e0,inline:L0}}static lex(Y,X){return new Z(X).lex(Y)}static lexInline(Y,X){return new Z(X).inlineTokens(Y)}lex(Y){Y=Y.replace(CZ.carriageReturn,`
|
|
104
|
+
`),this.blockTokens(Y,this.tokens);for(let X=0;X<this.inlineQueue.length;X++){let J=this.inlineQueue[X];this.inlineTokens(J.src,J.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(Y,X=[],J=!1){for(this.options.pedantic&&(Y=Y.replace(CZ.tabCharGlobal," ").replace(CZ.spaceLine,""));Y;){let Q;if(this.options.extensions?.block?.some((K)=>(Q=K.call({lexer:this},Y,X))?(Y=Y.substring(Q.raw.length),X.push(Q),!0):!1))continue;if(Q=this.tokenizer.space(Y)){Y=Y.substring(Q.raw.length);let K=X.at(-1);Q.raw.length===1&&K!==void 0?K.raw+=`
|
|
105
105
|
`:X.push(Q);continue}if(Q=this.tokenizer.code(Y)){Y=Y.substring(Q.raw.length);let K=X.at(-1);K?.type==="paragraph"||K?.type==="text"?(K.raw+=(K.raw.endsWith(`
|
|
106
106
|
`)?"":`
|
|
107
107
|
`)+Q.raw,K.text+=`
|
|
108
108
|
`+Q.text,this.inlineQueue.at(-1).src=K.text):X.push(Q);continue}if(Q=this.tokenizer.fences(Y)){Y=Y.substring(Q.raw.length),X.push(Q);continue}if(Q=this.tokenizer.heading(Y)){Y=Y.substring(Q.raw.length),X.push(Q);continue}if(Q=this.tokenizer.hr(Y)){Y=Y.substring(Q.raw.length),X.push(Q);continue}if(Q=this.tokenizer.blockquote(Y)){Y=Y.substring(Q.raw.length),X.push(Q);continue}if(Q=this.tokenizer.list(Y)){Y=Y.substring(Q.raw.length),X.push(Q);continue}if(Q=this.tokenizer.html(Y)){Y=Y.substring(Q.raw.length),X.push(Q);continue}if(Q=this.tokenizer.def(Y)){Y=Y.substring(Q.raw.length);let K=X.at(-1);K?.type==="paragraph"||K?.type==="text"?(K.raw+=(K.raw.endsWith(`
|
|
109
109
|
`)?"":`
|
|
110
110
|
`)+Q.raw,K.text+=`
|
|
111
|
-
`+Q.raw,this.inlineQueue.at(-1).src=K.text):this.tokens.links[Q.tag]||(this.tokens.links[Q.tag]={href:Q.href,title:Q.title},X.push(Q));continue}if(Q=this.tokenizer.table(Y)){Y=Y.substring(Q.raw.length),X.push(Q);continue}if(Q=this.tokenizer.lheading(Y)){Y=Y.substring(Q.raw.length),X.push(Q);continue}let $=Y;if(this.options.extensions?.startBlock){let K=1/0,
|
|
111
|
+
`+Q.raw,this.inlineQueue.at(-1).src=K.text):this.tokens.links[Q.tag]||(this.tokens.links[Q.tag]={href:Q.href,title:Q.title},X.push(Q));continue}if(Q=this.tokenizer.table(Y)){Y=Y.substring(Q.raw.length),X.push(Q);continue}if(Q=this.tokenizer.lheading(Y)){Y=Y.substring(Q.raw.length),X.push(Q);continue}let $=Y;if(this.options.extensions?.startBlock){let K=1/0,W=Y.slice(1),U;this.options.extensions.startBlock.forEach((z)=>{U=z.call({lexer:this},W),typeof U=="number"&&U>=0&&(K=Math.min(K,U))}),K<1/0&&K>=0&&($=Y.substring(0,K+1))}if(this.state.top&&(Q=this.tokenizer.paragraph($))){let K=X.at(-1);J&&K?.type==="paragraph"?(K.raw+=(K.raw.endsWith(`
|
|
112
112
|
`)?"":`
|
|
113
113
|
`)+Q.raw,K.text+=`
|
|
114
114
|
`+Q.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=K.text):X.push(Q),J=$.length!==Y.length,Y=Y.substring(Q.raw.length);continue}if(Q=this.tokenizer.text(Y)){Y=Y.substring(Q.raw.length);let K=X.at(-1);K?.type==="text"?(K.raw+=(K.raw.endsWith(`
|
|
115
115
|
`)?"":`
|
|
116
116
|
`)+Q.raw,K.text+=`
|
|
117
|
-
`+Q.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=K.text):X.push(Q);continue}if(Y){let K="Infinite loop on byte: "+Y.charCodeAt(0);if(this.options.silent){console.error(K);break}else throw Error(K)}}return this.state.top=!0,X}inline(Y,X=[]){return this.inlineQueue.push({src:Y,tokens:X}),X}inlineTokens(Y,X=[]){let J=Y,Q=null;if(this.tokens.links){let
|
|
118
|
-
`;return J?'<pre><code class="language-'+
|
|
119
|
-
`:"<pre><code>"+(X?Q:
|
|
117
|
+
`+Q.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=K.text):X.push(Q);continue}if(Y){let K="Infinite loop on byte: "+Y.charCodeAt(0);if(this.options.silent){console.error(K);break}else throw Error(K)}}return this.state.top=!0,X}inline(Y,X=[]){return this.inlineQueue.push({src:Y,tokens:X}),X}inlineTokens(Y,X=[]){let J=Y,Q=null;if(this.tokens.links){let U=Object.keys(this.tokens.links);if(U.length>0)for(;(Q=this.tokenizer.rules.inline.reflinkSearch.exec(J))!=null;)U.includes(Q[0].slice(Q[0].lastIndexOf("[")+1,-1))&&(J=J.slice(0,Q.index)+"["+"a".repeat(Q[0].length-2)+"]"+J.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Q=this.tokenizer.rules.inline.anyPunctuation.exec(J))!=null;)J=J.slice(0,Q.index)+"++"+J.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let $;for(;(Q=this.tokenizer.rules.inline.blockSkip.exec(J))!=null;)$=Q[2]?Q[2].length:0,J=J.slice(0,Q.index+$)+"["+"a".repeat(Q[0].length-$-2)+"]"+J.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);J=this.options.hooks?.emStrongMask?.call({lexer:this},J)??J;let K=!1,W="";for(;Y;){K||(W=""),K=!1;let U;if(this.options.extensions?.inline?.some((H)=>(U=H.call({lexer:this},Y,X))?(Y=Y.substring(U.raw.length),X.push(U),!0):!1))continue;if(U=this.tokenizer.escape(Y)){Y=Y.substring(U.raw.length),X.push(U);continue}if(U=this.tokenizer.tag(Y)){Y=Y.substring(U.raw.length),X.push(U);continue}if(U=this.tokenizer.link(Y)){Y=Y.substring(U.raw.length),X.push(U);continue}if(U=this.tokenizer.reflink(Y,this.tokens.links)){Y=Y.substring(U.raw.length);let H=X.at(-1);U.type==="text"&&H?.type==="text"?(H.raw+=U.raw,H.text+=U.text):X.push(U);continue}if(U=this.tokenizer.emStrong(Y,J,W)){Y=Y.substring(U.raw.length),X.push(U);continue}if(U=this.tokenizer.codespan(Y)){Y=Y.substring(U.raw.length),X.push(U);continue}if(U=this.tokenizer.br(Y)){Y=Y.substring(U.raw.length),X.push(U);continue}if(U=this.tokenizer.del(Y)){Y=Y.substring(U.raw.length),X.push(U);continue}if(U=this.tokenizer.autolink(Y)){Y=Y.substring(U.raw.length),X.push(U);continue}if(!this.state.inLink&&(U=this.tokenizer.url(Y))){Y=Y.substring(U.raw.length),X.push(U);continue}let z=Y;if(this.options.extensions?.startInline){let H=1/0,G=Y.slice(1),F;this.options.extensions.startInline.forEach((M)=>{F=M.call({lexer:this},G),typeof F=="number"&&F>=0&&(H=Math.min(H,F))}),H<1/0&&H>=0&&(z=Y.substring(0,H+1))}if(U=this.tokenizer.inlineText(z)){Y=Y.substring(U.raw.length),U.raw.slice(-1)!=="_"&&(W=U.raw.slice(-1)),K=!0;let H=X.at(-1);H?.type==="text"?(H.raw+=U.raw,H.text+=U.text):X.push(U);continue}if(Y){let H="Infinite loop on byte: "+Y.charCodeAt(0);if(this.options.silent){console.error(H);break}else throw Error(H)}}return X}},XY=class{options;parser;constructor(Z){this.options=Z||i4}space(Z){return""}code({text:Z,lang:Y,escaped:X}){let J=(Y||"").match(CZ.notSpaceStart)?.[0],Q=Z.replace(CZ.endingNewline,"")+`
|
|
118
|
+
`;return J?'<pre><code class="language-'+O4(J)+'">'+(X?Q:O4(Q,!0))+`</code></pre>
|
|
119
|
+
`:"<pre><code>"+(X?Q:O4(Q,!0))+`</code></pre>
|
|
120
120
|
`}blockquote({tokens:Z}){return`<blockquote>
|
|
121
121
|
${this.parser.parse(Z)}</blockquote>
|
|
122
122
|
`}html({text:Z}){return Z}def(Z){return""}heading({tokens:Z,depth:Y}){return`<h${Y}>${this.parser.parseInline(Z)}</h${Y}>
|
|
123
123
|
`}hr(Z){return`<hr>
|
|
124
|
-
`}list(Z){let{ordered:Y,start:X}=Z,J="";for(let K=0;K<Z.items.length;K++){let
|
|
124
|
+
`}list(Z){let{ordered:Y,start:X}=Z,J="";for(let K=0;K<Z.items.length;K++){let W=Z.items[K];J+=this.listitem(W)}let Q=Y?"ol":"ul",$=Y&&X!==1?' start="'+X+'"':"";return"<"+Q+$+`>
|
|
125
125
|
`+J+"</"+Q+`>
|
|
126
|
-
`}listitem(Z){let Y="";if(Z.task){let X=this.checkbox({checked:!!Z.checked});Z.loose?Z.tokens[0]?.type==="paragraph"?(Z.tokens[0].text=X+" "+Z.tokens[0].text,Z.tokens[0].tokens&&Z.tokens[0].tokens.length>0&&Z.tokens[0].tokens[0].type==="text"&&(Z.tokens[0].tokens[0].text=X+" "+
|
|
126
|
+
`}listitem(Z){let Y="";if(Z.task){let X=this.checkbox({checked:!!Z.checked});Z.loose?Z.tokens[0]?.type==="paragraph"?(Z.tokens[0].text=X+" "+Z.tokens[0].text,Z.tokens[0].tokens&&Z.tokens[0].tokens.length>0&&Z.tokens[0].tokens[0].type==="text"&&(Z.tokens[0].tokens[0].text=X+" "+O4(Z.tokens[0].tokens[0].text),Z.tokens[0].tokens[0].escaped=!0)):Z.tokens.unshift({type:"text",raw:X+" ",text:X+" ",escaped:!0}):Y+=X+" "}return Y+=this.parser.parse(Z.tokens,!!Z.loose),`<li>${Y}</li>
|
|
127
127
|
`}checkbox({checked:Z}){return"<input "+(Z?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:Z}){return`<p>${this.parser.parseInline(Z)}</p>
|
|
128
128
|
`}table(Z){let Y="",X="";for(let Q=0;Q<Z.header.length;Q++)X+=this.tablecell(Z.header[Q]);Y+=this.tablerow({text:X});let J="";for(let Q=0;Q<Z.rows.length;Q++){let $=Z.rows[Q];X="";for(let K=0;K<$.length;K++)X+=this.tablecell($[K]);J+=this.tablerow({text:X})}return J&&(J=`<tbody>${J}</tbody>`),`<table>
|
|
129
129
|
<thead>
|
|
@@ -132,11 +132,11 @@ ${this.parser.parse(Z)}</blockquote>
|
|
|
132
132
|
`}tablerow({text:Z}){return`<tr>
|
|
133
133
|
${Z}</tr>
|
|
134
134
|
`}tablecell(Z){let Y=this.parser.parseInline(Z.tokens),X=Z.header?"th":"td";return(Z.align?`<${X} align="${Z.align}">`:`<${X}>`)+Y+`</${X}>
|
|
135
|
-
`}strong({tokens:Z}){return`<strong>${this.parser.parseInline(Z)}</strong>`}em({tokens:Z}){return`<em>${this.parser.parseInline(Z)}</em>`}codespan({text:Z}){return`<code>${
|
|
136
|
-
`+this.renderer.text(
|
|
137
|
-
Please report this to https://github.com/markedjs/marked.`,Z){let J="<p>An error occurred:</p><pre>"+OY(X.message+"",!0)+"</pre>";return Y?Promise.resolve(J):J}if(Y)return Promise.reject(X);throw X}}},iY=new XK;function c(Z,Y){return iY.parse(Z,Y)}c.options=c.setOptions=function(Z){return iY.setOptions(Z),c.defaults=iY.defaults,L5(c.defaults),c};c.getDefaults=$8;c.defaults=rY;c.use=function(...Z){return iY.use(...Z),c.defaults=iY.defaults,L5(c.defaults),c};c.walkTokens=function(Z,Y){return iY.walkTokens(Z,Y)};c.parseInline=iY.parseInline;c.Parser=eZ;c.parser=eZ.parse;c.Renderer=Y0;c.TextRenderer=q8;c.Lexer=tZ;c.lexer=tZ.lex;c.Tokenizer=Z0;c.Hooks=P4;c.parse=c;var{options:WG,setOptions:UG,use:zG,walkTokens:HG,parseInline:GG}=c;var OG=eZ.parse,qG=tZ.lex;var pZ=L(x(),1);class YZ extends Error{constructor(Z){super(Z);this.name="ShikiError"}}function JK(Z){return L8(Z)}function L8(Z){if(Array.isArray(Z))return QK(Z);if(Z instanceof RegExp)return Z;if(typeof Z==="object")return $K(Z);return Z}function QK(Z){let Y=[];for(let X=0,J=Z.length;X<J;X++)Y[X]=L8(Z[X]);return Y}function $K(Z){let Y={};for(let X in Z)Y[X]=L8(Z[X]);return Y}function u5(Z,...Y){return Y.forEach((X)=>{for(let J in X)Z[J]=X[J]}),Z}function m5(Z){let Y=~Z.lastIndexOf("/")||~Z.lastIndexOf("\\");if(Y===0)return Z;else if(~Y===Z.length-1)return m5(Z.substring(0,Z.length-1));else return Z.substr(~Y+1)}var F8=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Q0=class{static hasCaptures(Z){if(Z===null)return!1;return F8.lastIndex=0,F8.test(Z)}static replaceCaptures(Z,Y,X){return Z.replace(F8,(J,Q,$,K)=>{let U=X[parseInt(Q||$,10)];if(U){let W=Y.substring(U.start,U.end);while(W[0]===".")W=W.substring(1);switch(K){case"downcase":return W.toLowerCase();case"upcase":return W.toUpperCase();default:return W}}else return J})}};function p5(Z,Y){if(Z<Y)return-1;if(Z>Y)return 1;return 0}function d5(Z,Y){if(Z===null&&Y===null)return 0;if(!Z)return-1;if(!Y)return 1;let X=Z.length,J=Y.length;if(X===J){for(let Q=0;Q<X;Q++){let $=p5(Z[Q],Y[Q]);if($!==0)return $}return 0}return X-J}function f5(Z){if(/^#[0-9a-f]{6}$/i.test(Z))return!0;if(/^#[0-9a-f]{8}$/i.test(Z))return!0;if(/^#[0-9a-f]{3}$/i.test(Z))return!0;if(/^#[0-9a-f]{4}$/i.test(Z))return!0;return!1}function c5(Z){return Z.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var l5=class{constructor(Z){this.fn=Z}cache=new Map;get(Z){if(this.cache.has(Z))return this.cache.get(Z);let Y=this.fn(Z);return this.cache.set(Z,Y),Y}},D4=class{constructor(Z,Y,X){this._colorMap=Z,this._defaults=Y,this._root=X}static createFromRawTheme(Z,Y){return this.createFromParsedTheme(UK(Z),Y)}static createFromParsedTheme(Z,Y){return HK(Z,Y)}_cachedMatchRoot=new l5((Z)=>this._root.match(Z));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(Z){if(Z===null)return this._defaults;let Y=Z.scopeName,J=this._cachedMatchRoot.get(Y).find((Q)=>KK(Z.parent,Q.parentScopes));if(!J)return null;return new i5(J.fontStyle,J.foreground,J.background)}},M8=class Z{constructor(Y,X){this.parent=Y,this.scopeName=X}static push(Y,X){for(let J of X)Y=new Z(Y,J);return Y}static from(...Y){let X=null;for(let J=0;J<Y.length;J++)X=new Z(X,Y[J]);return X}push(Y){return new Z(this,Y)}getSegments(){let Y=this,X=[];while(Y)X.push(Y.scopeName),Y=Y.parent;return X.reverse(),X}toString(){return this.getSegments().join(" ")}extends(Y){if(this===Y)return!0;if(this.parent===null)return!1;return this.parent.extends(Y)}getExtensionIfDefined(Y){let X=[],J=this;while(J&&J!==Y)X.push(J.scopeName),J=J.parent;return J===Y?X.reverse():void 0}};function KK(Z,Y){if(Y.length===0)return!0;for(let X=0;X<Y.length;X++){let J=Y[X],Q=!1;if(J===">"){if(X===Y.length-1)return!1;J=Y[++X],Q=!0}while(Z){if(WK(Z.scopeName,J))break;if(Q)return!1;Z=Z.parent}if(!Z)return!1;Z=Z.parent}return!0}function WK(Z,Y){return Y===Z||Z.startsWith(Y)&&Z[Y.length]==="."}var i5=class{constructor(Z,Y,X){this.fontStyle=Z,this.foregroundId=Y,this.backgroundId=X}};function UK(Z){if(!Z)return[];if(!Z.settings||!Array.isArray(Z.settings))return[];let Y=Z.settings,X=[],J=0;for(let Q=0,$=Y.length;Q<$;Q++){let K=Y[Q];if(!K.settings)continue;let U;if(typeof K.scope==="string"){let G=K.scope;G=G.replace(/^[,]+/,""),G=G.replace(/[,]+$/,""),U=G.split(",")}else if(Array.isArray(K.scope))U=K.scope;else U=[""];let W=-1;if(typeof K.settings.fontStyle==="string"){W=0;let G=K.settings.fontStyle.split(" ");for(let F=0,M=G.length;F<M;F++)switch(G[F]){case"italic":W=W|1;break;case"bold":W=W|2;break;case"underline":W=W|4;break;case"strikethrough":W=W|8;break}}let z=null;if(typeof K.settings.foreground==="string"&&f5(K.settings.foreground))z=K.settings.foreground;let H=null;if(typeof K.settings.background==="string"&&f5(K.settings.background))H=K.settings.background;for(let G=0,F=U.length;G<F;G++){let A=U[G].trim().split(" "),w=A[A.length-1],P=null;if(A.length>1)P=A.slice(0,A.length-1),P.reverse();X[J++]=new zK(w,P,Q,W,z,H)}}return X}var zK=class{constructor(Z,Y,X,J,Q,$){this.scope=Z,this.parentScopes=Y,this.index=X,this.fontStyle=J,this.foreground=Q,this.background=$}},GZ=((Z)=>{return Z[Z.NotSet=-1]="NotSet",Z[Z.None=0]="None",Z[Z.Italic=1]="Italic",Z[Z.Bold=2]="Bold",Z[Z.Underline=4]="Underline",Z[Z.Strikethrough=8]="Strikethrough",Z})(GZ||{});function HK(Z,Y){Z.sort((W,z)=>{let H=p5(W.scope,z.scope);if(H!==0)return H;if(H=d5(W.parentScopes,z.parentScopes),H!==0)return H;return W.index-z.index});let X=0,J="#000000",Q="#ffffff";while(Z.length>=1&&Z[0].scope===""){let W=Z.shift();if(W.fontStyle!==-1)X=W.fontStyle;if(W.foreground!==null)J=W.foreground;if(W.background!==null)Q=W.background}let $=new GK(Y),K=new i5(X,$.getId(J),$.getId(Q)),U=new qK(new A8(0,null,-1,0,0),[]);for(let W=0,z=Z.length;W<z;W++){let H=Z[W];U.insert(0,H.scope,H.parentScopes,H.fontStyle,$.getId(H.foreground),$.getId(H.background))}return new D4($,K,U)}var GK=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(Z){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(Z)){this._isFrozen=!0;for(let Y=0,X=Z.length;Y<X;Y++)this._color2id[Z[Y]]=Y,this._id2color[Y]=Z[Y]}else this._isFrozen=!1}getId(Z){if(Z===null)return 0;Z=Z.toUpperCase();let Y=this._color2id[Z];if(Y)return Y;if(this._isFrozen)throw Error(`Missing color in color map - ${Z}`);return Y=++this._lastColorId,this._color2id[Z]=Y,this._id2color[Y]=Z,Y}getColorMap(){return this._id2color.slice(0)}},OK=Object.freeze([]),A8=class Z{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(Y,X,J,Q,$){this.scopeDepth=Y,this.parentScopes=X||OK,this.fontStyle=J,this.foreground=Q,this.background=$}clone(){return new Z(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(Y){let X=[];for(let J=0,Q=Y.length;J<Q;J++)X[J]=Y[J].clone();return X}acceptOverwrite(Y,X,J,Q){if(this.scopeDepth>Y)console.log("how did this happen?");else this.scopeDepth=Y;if(X!==-1)this.fontStyle=X;if(J!==0)this.foreground=J;if(Q!==0)this.background=Q}},qK=class Z{constructor(Y,X=[],J={}){this._mainRule=Y,this._children=J,this._rulesWithParentScopes=X}_rulesWithParentScopes;static _cmpBySpecificity(Y,X){if(Y.scopeDepth!==X.scopeDepth)return X.scopeDepth-Y.scopeDepth;let J=0,Q=0;while(!0){if(Y.parentScopes[J]===">")J++;if(X.parentScopes[Q]===">")Q++;if(J>=Y.parentScopes.length||Q>=X.parentScopes.length)break;let $=X.parentScopes[Q].length-Y.parentScopes[J].length;if($!==0)return $;J++,Q++}return X.parentScopes.length-Y.parentScopes.length}match(Y){if(Y!==""){let J=Y.indexOf("."),Q,$;if(J===-1)Q=Y,$="";else Q=Y.substring(0,J),$=Y.substring(J+1);if(this._children.hasOwnProperty(Q))return this._children[Q].match($)}let X=this._rulesWithParentScopes.concat(this._mainRule);return X.sort(Z._cmpBySpecificity),X}insert(Y,X,J,Q,$,K){if(X===""){this._doInsertHere(Y,J,Q,$,K);return}let U=X.indexOf("."),W,z;if(U===-1)W=X,z="";else W=X.substring(0,U),z=X.substring(U+1);let H;if(this._children.hasOwnProperty(W))H=this._children[W];else H=new Z(this._mainRule.clone(),A8.cloneArr(this._rulesWithParentScopes)),this._children[W]=H;H.insert(Y+1,z,J,Q,$,K)}_doInsertHere(Y,X,J,Q,$){if(X===null){this._mainRule.acceptOverwrite(Y,J,Q,$);return}for(let K=0,U=this._rulesWithParentScopes.length;K<U;K++){let W=this._rulesWithParentScopes[K];if(d5(W.parentScopes,X)===0){W.acceptOverwrite(Y,J,Q,$);return}}if(J===-1)J=this._mainRule.fontStyle;if(Q===0)Q=this._mainRule.foreground;if($===0)$=this._mainRule.background;this._rulesWithParentScopes.push(new A8(Y,X,J,Q,$))}},oY=class Z{static toBinaryStr(Y){return Y.toString(2).padStart(32,"0")}static print(Y){let X=Z.getLanguageId(Y),J=Z.getTokenType(Y),Q=Z.getFontStyle(Y),$=Z.getForeground(Y),K=Z.getBackground(Y);console.log({languageId:X,tokenType:J,fontStyle:Q,foreground:$,background:K})}static getLanguageId(Y){return(Y&255)>>>0}static getTokenType(Y){return(Y&768)>>>8}static containsBalancedBrackets(Y){return(Y&1024)!==0}static getFontStyle(Y){return(Y&30720)>>>11}static getForeground(Y){return(Y&16744448)>>>15}static getBackground(Y){return(Y&4278190080)>>>24}static set(Y,X,J,Q,$,K,U){let W=Z.getLanguageId(Y),z=Z.getTokenType(Y),H=Z.containsBalancedBrackets(Y)?1:0,G=Z.getFontStyle(Y),F=Z.getForeground(Y),M=Z.getBackground(Y);if(X!==0)W=X;if(J!==8)z=MK(J);if(Q!==null)H=Q?1:0;if($!==-1)G=$;if(K!==0)F=K;if(U!==0)M=U;return(W<<0|z<<8|H<<10|G<<11|F<<15|M<<24)>>>0}};function FK(Z){return Z}function MK(Z){return Z}function K0(Z,Y){let X=[],J=NK(Z),Q=J.next();while(Q!==null){let W=0;if(Q.length===2&&Q.charAt(1)===":"){switch(Q.charAt(0)){case"R":W=1;break;case"L":W=-1;break;default:console.log(`Unknown priority ${Q} in scope selector`)}Q=J.next()}let z=K();if(X.push({matcher:z,priority:W}),Q!==",")break;Q=J.next()}return X;function $(){if(Q==="-"){Q=J.next();let W=$();return(z)=>!!W&&!W(z)}if(Q==="("){Q=J.next();let W=U();if(Q===")")Q=J.next();return W}if(j5(Q)){let W=[];do W.push(Q),Q=J.next();while(j5(Q));return(z)=>Y(W,z)}return null}function K(){let W=[],z=$();while(z)W.push(z),z=$();return(H)=>W.every((G)=>G(H))}function U(){let W=[],z=K();while(z){if(W.push(z),Q==="|"||Q===",")do Q=J.next();while(Q==="|"||Q===",");else break;z=K()}return(H)=>W.some((G)=>G(H))}}function j5(Z){return!!Z&&!!Z.match(/[\w\.:]+/)}function NK(Z){let Y=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,X=Y.exec(Z);return{next:()=>{if(!X)return null;let J=X[0];return X=Y.exec(Z),J}}}function r5(Z){if(typeof Z.dispose==="function")Z.dispose()}var V4=class{constructor(Z){this.scopeName=Z}toKey(){return this.scopeName}},AK=class{constructor(Z,Y){this.scopeName=Z,this.ruleName=Y}toKey(){return`${this.scopeName}#${this.ruleName}`}},_K=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(Z){let Y=Z.toKey();if(this._seenReferenceKeys.has(Y))return;this._seenReferenceKeys.add(Y),this._references.push(Z)}},wK=class{constructor(Z,Y){this.repo=Z,this.initialScopeName=Y,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new V4(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let Z=this.Q;this.Q=[];let Y=new _K;for(let X of Z)BK(X,this.initialScopeName,this.repo,Y);for(let X of Y.references)if(X instanceof V4){if(this.seenFullScopeRequests.has(X.scopeName))continue;this.seenFullScopeRequests.add(X.scopeName),this.Q.push(X)}else{if(this.seenFullScopeRequests.has(X.scopeName))continue;if(this.seenPartialScopeRequests.has(X.toKey()))continue;this.seenPartialScopeRequests.add(X.toKey()),this.Q.push(X)}}};function BK(Z,Y,X,J){let Q=X.lookup(Z.scopeName);if(!Q){if(Z.scopeName===Y)throw Error(`No grammar provided for <${Y}>`);return}let $=X.lookup(Y);if(Z instanceof V4)$0({baseGrammar:$,selfGrammar:Q},J);else _8(Z.ruleName,{baseGrammar:$,selfGrammar:Q,repository:Q.repository},J);let K=X.injections(Z.scopeName);if(K)for(let U of K)J.add(new V4(U))}function _8(Z,Y,X){if(Y.repository&&Y.repository[Z]){let J=Y.repository[Z];W0([J],Y,X)}}function $0(Z,Y){if(Z.selfGrammar.patterns&&Array.isArray(Z.selfGrammar.patterns))W0(Z.selfGrammar.patterns,{...Z,repository:Z.selfGrammar.repository},Y);if(Z.selfGrammar.injections)W0(Object.values(Z.selfGrammar.injections),{...Z,repository:Z.selfGrammar.repository},Y)}function W0(Z,Y,X){for(let J of Z){if(X.visitedRule.has(J))continue;X.visitedRule.add(J);let Q=J.repository?u5({},Y.repository,J.repository):Y.repository;if(Array.isArray(J.patterns))W0(J.patterns,{...Y,repository:Q},X);let $=J.include;if(!$)continue;let K=o5($);switch(K.kind){case 0:$0({...Y,selfGrammar:Y.baseGrammar},X);break;case 1:$0(Y,X);break;case 2:_8(K.ruleName,{...Y,repository:Q},X);break;case 3:case 4:let U=K.scopeName===Y.selfGrammar.scopeName?Y.selfGrammar:K.scopeName===Y.baseGrammar.scopeName?Y.baseGrammar:void 0;if(U){let W={baseGrammar:Y.baseGrammar,selfGrammar:U,repository:Q};if(K.kind===4)_8(K.ruleName,W,X);else $0(W,X)}else if(K.kind===4)X.add(new AK(K.scopeName,K.ruleName));else X.add(new V4(K.scopeName));break}}}var LK=class{kind=0},PK=class{kind=1},CK=class{constructor(Z){this.ruleName=Z}kind=2},RK=class{constructor(Z){this.scopeName=Z}kind=3},vK=class{constructor(Z,Y){this.scopeName=Z,this.ruleName=Y}kind=4};function o5(Z){if(Z==="$base")return new LK;else if(Z==="$self")return new PK;let Y=Z.indexOf("#");if(Y===-1)return new RK(Z);else if(Y===0)return new CK(Z.substring(1));else{let X=Z.substring(0,Y),J=Z.substring(Y+1);return new vK(X,J)}}var IK=/\\(\d+)/,S5=/\\(\d+)/g,LG=Symbol("RuleId"),DK=-1,n5=-2;function a5(Z){return Z}function s5(Z){return Z}var T4=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(Z,Y,X,J){this.$location=Z,this.id=Y,this._name=X||null,this._nameIsCapturing=Q0.hasCaptures(this._name),this._contentName=J||null,this._contentNameIsCapturing=Q0.hasCaptures(this._contentName)}get debugName(){let Z=this.$location?`${m5(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${Z}`}getName(Z,Y){if(!this._nameIsCapturing||this._name===null||Z===null||Y===null)return this._name;return Q0.replaceCaptures(this._name,Z,Y)}getContentName(Z,Y){if(!this._contentNameIsCapturing||this._contentName===null)return this._contentName;return Q0.replaceCaptures(this._contentName,Z,Y)}},VK=class extends T4{retokenizeCapturedWithRuleId;constructor(Z,Y,X,J,Q){super(Z,Y,X,J);this.retokenizeCapturedWithRuleId=Q}dispose(){}collectPatterns(Z,Y){throw Error("Not supported!")}compile(Z,Y){throw Error("Not supported!")}compileAG(Z,Y,X,J){throw Error("Not supported!")}},EK=class extends T4{_match;captures;_cachedCompiledPatterns;constructor(Z,Y,X,J,Q){super(Z,Y,X,null);this._match=new E4(J,this.id),this.captures=Q,this._cachedCompiledPatterns=null}dispose(){if(this._cachedCompiledPatterns)this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(Z,Y){Y.push(this._match)}compile(Z,Y){return this._getCachedCompiledPatterns(Z).compile(Z)}compileAG(Z,Y,X,J){return this._getCachedCompiledPatterns(Z).compileAG(Z,X,J)}_getCachedCompiledPatterns(Z){if(!this._cachedCompiledPatterns)this._cachedCompiledPatterns=new b4,this.collectPatterns(Z,this._cachedCompiledPatterns);return this._cachedCompiledPatterns}},y5=class extends T4{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(Z,Y,X,J,Q){super(Z,Y,X,J);this.patterns=Q.patterns,this.hasMissingPatterns=Q.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){if(this._cachedCompiledPatterns)this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null}collectPatterns(Z,Y){for(let X of this.patterns)Z.getRule(X).collectPatterns(Z,Y)}compile(Z,Y){return this._getCachedCompiledPatterns(Z).compile(Z)}compileAG(Z,Y,X,J){return this._getCachedCompiledPatterns(Z).compileAG(Z,X,J)}_getCachedCompiledPatterns(Z){if(!this._cachedCompiledPatterns)this._cachedCompiledPatterns=new b4,this.collectPatterns(Z,this._cachedCompiledPatterns);return this._cachedCompiledPatterns}},w8=class extends T4{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(Z,Y,X,J,Q,$,K,U,W,z){super(Z,Y,X,J);this._begin=new E4(Q,this.id),this.beginCaptures=$,this._end=new E4(K?K:"",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=U,this.applyEndPatternLast=W||!1,this.patterns=z.patterns,this.hasMissingPatterns=z.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){if(this._cachedCompiledPatterns)this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(Z,Y){return this._end.resolveBackReferences(Z,Y)}collectPatterns(Z,Y){Y.push(this._begin)}compile(Z,Y){return this._getCachedCompiledPatterns(Z,Y).compile(Z)}compileAG(Z,Y,X,J){return this._getCachedCompiledPatterns(Z,Y).compileAG(Z,X,J)}_getCachedCompiledPatterns(Z,Y){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new b4;for(let X of this.patterns)Z.getRule(X).collectPatterns(Z,this._cachedCompiledPatterns);if(this.applyEndPatternLast)this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end);else this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}if(this._end.hasBackReferences)if(this.applyEndPatternLast)this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,Y);else this._cachedCompiledPatterns.setSource(0,Y);return this._cachedCompiledPatterns}},U0=class extends T4{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(Z,Y,X,J,Q,$,K,U,W){super(Z,Y,X,J);this._begin=new E4(Q,this.id),this.beginCaptures=$,this.whileCaptures=U,this._while=new E4(K,n5),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=W.patterns,this.hasMissingPatterns=W.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){if(this._cachedCompiledPatterns)this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null;if(this._cachedCompiledWhilePatterns)this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(Z,Y){return this._while.resolveBackReferences(Z,Y)}collectPatterns(Z,Y){Y.push(this._begin)}compile(Z,Y){return this._getCachedCompiledPatterns(Z).compile(Z)}compileAG(Z,Y,X,J){return this._getCachedCompiledPatterns(Z).compileAG(Z,X,J)}_getCachedCompiledPatterns(Z){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new b4;for(let Y of this.patterns)Z.getRule(Y).collectPatterns(Z,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(Z,Y){return this._getCachedCompiledWhilePatterns(Z,Y).compile(Z)}compileWhileAG(Z,Y,X,J){return this._getCachedCompiledWhilePatterns(Z,Y).compileAG(Z,X,J)}_getCachedCompiledWhilePatterns(Z,Y){if(!this._cachedCompiledWhilePatterns)this._cachedCompiledWhilePatterns=new b4,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while);if(this._while.hasBackReferences)this._cachedCompiledWhilePatterns.setSource(0,Y?Y:"");return this._cachedCompiledWhilePatterns}},t5=class Z{static createCaptureRule(Y,X,J,Q,$){return Y.registerRule((K)=>{return new VK(X,K,J,Q,$)})}static getCompiledRuleId(Y,X,J){if(!Y.id)X.registerRule((Q)=>{if(Y.id=Q,Y.match)return new EK(Y.$vscodeTextmateLocation,Y.id,Y.name,Y.match,Z._compileCaptures(Y.captures,X,J));if(typeof Y.begin>"u"){if(Y.repository)J=u5({},J,Y.repository);let $=Y.patterns;if(typeof $>"u"&&Y.include)$=[{include:Y.include}];return new y5(Y.$vscodeTextmateLocation,Y.id,Y.name,Y.contentName,Z._compilePatterns($,X,J))}if(Y.while)return new U0(Y.$vscodeTextmateLocation,Y.id,Y.name,Y.contentName,Y.begin,Z._compileCaptures(Y.beginCaptures||Y.captures,X,J),Y.while,Z._compileCaptures(Y.whileCaptures||Y.captures,X,J),Z._compilePatterns(Y.patterns,X,J));return new w8(Y.$vscodeTextmateLocation,Y.id,Y.name,Y.contentName,Y.begin,Z._compileCaptures(Y.beginCaptures||Y.captures,X,J),Y.end,Z._compileCaptures(Y.endCaptures||Y.captures,X,J),Y.applyEndPatternLast,Z._compilePatterns(Y.patterns,X,J))});return Y.id}static _compileCaptures(Y,X,J){let Q=[];if(Y){let $=0;for(let K in Y){if(K==="$vscodeTextmateLocation")continue;let U=parseInt(K,10);if(U>$)$=U}for(let K=0;K<=$;K++)Q[K]=null;for(let K in Y){if(K==="$vscodeTextmateLocation")continue;let U=parseInt(K,10),W=0;if(Y[K].patterns)W=Z.getCompiledRuleId(Y[K],X,J);Q[U]=Z.createCaptureRule(X,Y[K].$vscodeTextmateLocation,Y[K].name,Y[K].contentName,W)}}return Q}static _compilePatterns(Y,X,J){let Q=[];if(Y)for(let $=0,K=Y.length;$<K;$++){let U=Y[$],W=-1;if(U.include){let z=o5(U.include);switch(z.kind){case 0:case 1:W=Z.getCompiledRuleId(J[U.include],X,J);break;case 2:let H=J[z.ruleName];if(H)W=Z.getCompiledRuleId(H,X,J);break;case 3:case 4:let G=z.scopeName,F=z.kind===4?z.ruleName:null,M=X.getExternalGrammar(G,J);if(M)if(F){let A=M.repository[F];if(A)W=Z.getCompiledRuleId(A,X,M.repository)}else W=Z.getCompiledRuleId(M.repository.$self,X,M.repository);break}}else W=Z.getCompiledRuleId(U,X,J);if(W!==-1){let z=X.getRule(W),H=!1;if(z instanceof y5||z instanceof w8||z instanceof U0){if(z.hasMissingPatterns&&z.patterns.length===0)H=!0}if(H)continue;Q.push(W)}}return{patterns:Q,hasMissingPatterns:(Y?Y.length:0)!==Q.length}}},E4=class Z{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(Y,X){if(Y&&typeof Y==="string"){let J=Y.length,Q=0,$=[],K=!1;for(let U=0;U<J;U++)if(Y.charAt(U)==="\\"){if(U+1<J){let z=Y.charAt(U+1);if(z==="z")$.push(Y.substring(Q,U)),$.push("$(?!\\n)(?<!\\n)"),Q=U+2;else if(z==="A"||z==="G")K=!0;U++}}if(this.hasAnchor=K,Q===0)this.source=Y;else $.push(Y.substring(Q,J)),this.source=$.join("")}else this.hasAnchor=!1,this.source=Y;if(this.hasAnchor)this._anchorCache=this._buildAnchorCache();else this._anchorCache=null;if(this.ruleId=X,typeof this.source==="string")this.hasBackReferences=IK.test(this.source);else this.hasBackReferences=!1}clone(){return new Z(this.source,this.ruleId)}setSource(Y){if(this.source===Y)return;if(this.source=Y,this.hasAnchor)this._anchorCache=this._buildAnchorCache()}resolveBackReferences(Y,X){if(typeof this.source!=="string")throw Error("This method should only be called if the source is a string");let J=X.map((Q)=>{return Y.substring(Q.start,Q.end)});return S5.lastIndex=0,this.source.replace(S5,(Q,$)=>{return c5(J[parseInt($,10)]||"")})}_buildAnchorCache(){if(typeof this.source!=="string")throw Error("This method should only be called if the source is a string");let Y=[],X=[],J=[],Q=[],$,K,U,W;for($=0,K=this.source.length;$<K;$++)if(U=this.source.charAt($),Y[$]=U,X[$]=U,J[$]=U,Q[$]=U,U==="\\"){if($+1<K){if(W=this.source.charAt($+1),W==="A")Y[$+1]="",X[$+1]="",J[$+1]="A",Q[$+1]="A";else if(W==="G")Y[$+1]="",X[$+1]="G",J[$+1]="",Q[$+1]="G";else Y[$+1]=W,X[$+1]=W,J[$+1]=W,Q[$+1]=W;$++}}return{A0_G0:Y.join(""),A0_G1:X.join(""),A1_G0:J.join(""),A1_G1:Q.join("")}}resolveAnchors(Y,X){if(!this.hasAnchor||!this._anchorCache||typeof this.source!=="string")return this.source;if(Y)if(X)return this._anchorCache.A1_G1;else return this._anchorCache.A1_G0;else if(X)return this._anchorCache.A0_G1;else return this._anchorCache.A0_G0}},b4=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){if(this._cached)this._cached.dispose(),this._cached=null;if(this._anchorCache.A0_G0)this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null;if(this._anchorCache.A0_G1)this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null;if(this._anchorCache.A1_G0)this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null;if(this._anchorCache.A1_G1)this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null}push(Z){this._items.push(Z),this._hasAnchors=this._hasAnchors||Z.hasAnchor}unshift(Z){this._items.unshift(Z),this._hasAnchors=this._hasAnchors||Z.hasAnchor}length(){return this._items.length}setSource(Z,Y){if(this._items[Z].source!==Y)this._disposeCaches(),this._items[Z].setSource(Y)}compile(Z){if(!this._cached){let Y=this._items.map((X)=>X.source);this._cached=new k5(Z,Y,this._items.map((X)=>X.ruleId))}return this._cached}compileAG(Z,Y,X){if(!this._hasAnchors)return this.compile(Z);else if(Y)if(X){if(!this._anchorCache.A1_G1)this._anchorCache.A1_G1=this._resolveAnchors(Z,Y,X);return this._anchorCache.A1_G1}else{if(!this._anchorCache.A1_G0)this._anchorCache.A1_G0=this._resolveAnchors(Z,Y,X);return this._anchorCache.A1_G0}else if(X){if(!this._anchorCache.A0_G1)this._anchorCache.A0_G1=this._resolveAnchors(Z,Y,X);return this._anchorCache.A0_G1}else{if(!this._anchorCache.A0_G0)this._anchorCache.A0_G0=this._resolveAnchors(Z,Y,X);return this._anchorCache.A0_G0}}_resolveAnchors(Z,Y,X){let J=this._items.map((Q)=>Q.resolveAnchors(Y,X));return new k5(Z,J,this._items.map((Q)=>Q.ruleId))}},k5=class{constructor(Z,Y,X){this.regExps=Y,this.rules=X,this.scanner=Z.createOnigScanner(Y)}scanner;dispose(){if(typeof this.scanner.dispose==="function")this.scanner.dispose()}toString(){let Z=[];for(let Y=0,X=this.rules.length;Y<X;Y++)Z.push(" - "+this.rules[Y]+": "+this.regExps[Y]);return Z.join(`
|
|
138
|
-
`)}findNextMatchSync(Z,Y,X){let J=this.scanner.findNextMatchSync(Z,Y,X);if(!J)return null;return{ruleId:this.rules[J.index],captureIndices:J.captureIndices}}},
|
|
139
|
-
`;let $=this.createOnigString(Z),K=$.content.length,U=new pK(X,Z,this._tokenTypeMatchers,this.balancedBracketSelectors),W=Z6(this,$,Q,0,Y,U,!0,J);return r5($),{lineLength:K,lineTokens:U,ruleStack:W.stack,stoppedEarly:W.stoppedEarly}}};function g5(Z,Y){return Z=JK(Z),Z.repository=Z.repository||{},Z.repository.$self={$vscodeTextmateLocation:Z.$vscodeTextmateLocation,patterns:Z.patterns,name:Z.scopeName},Z.repository.$base=Y||Z.repository.$self,Z}var I4=class Z{constructor(Y,X,J){this.parent=Y,this.scopePath=X,this.tokenAttributes=J}static fromExtension(Y,X){let J=Y,Q=Y?.scopePath??null;for(let $ of X)Q=M8.push(Q,$.scopeNames),J=new Z(J,Q,$.encodedTokenAttributes);return J}static createRoot(Y,X){return new Z(null,new M8(null,Y),X)}static createRootAndLookUpScopeName(Y,X,J){let Q=J.getMetadataForScope(Y),$=new M8(null,Y),K=J.themeProvider.themeMatch($),U=Z.mergeAttributes(X,Q,K);return new Z(null,$,U)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(Y){return Z.equals(this,Y)}static equals(Y,X){do{if(Y===X)return!0;if(!Y&&!X)return!0;if(!Y||!X)return!1;if(Y.scopeName!==X.scopeName||Y.tokenAttributes!==X.tokenAttributes)return!1;Y=Y.parent,X=X.parent}while(!0)}static mergeAttributes(Y,X,J){let Q=-1,$=0,K=0;if(J!==null)Q=J.fontStyle,$=J.foregroundId,K=J.backgroundId;return oY.set(Y,X.languageId,X.tokenType,null,Q,$,K)}pushAttributed(Y,X){if(Y===null)return this;if(Y.indexOf(" ")===-1)return Z._pushAttributed(this,Y,X);let J=Y.split(/ /g),Q=this;for(let $ of J)Q=Z._pushAttributed(Q,$,X);return Q}static _pushAttributed(Y,X,J){let Q=J.getMetadataForScope(X),$=Y.scopePath.push(X),K=J.themeProvider.themeMatch($),U=Z.mergeAttributes(Y.tokenAttributes,Q,K);return new Z(Y,$,U)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(Y){let X=[],J=this;while(J&&J!==Y)X.push({encodedTokenAttributes:J.tokenAttributes,scopeNames:J.scopePath.getExtensionIfDefined(J.parent?.scopePath??null)}),J=J.parent;return J===Y?X.reverse():void 0}},B8=class Z{constructor(Y,X,J,Q,$,K,U,W){this.parent=Y,this.ruleId=X,this.beginRuleCapturedEOL=$,this.endRule=K,this.nameScopesList=U,this.contentNameScopesList=W,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=J,this._anchorPos=Q}_stackElementBrand=void 0;static NULL=new Z(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(Y){if(Y===null)return!1;return Z._equals(this,Y)}static _equals(Y,X){if(Y===X)return!0;if(!this._structuralEquals(Y,X))return!1;return I4.equals(Y.contentNameScopesList,X.contentNameScopesList)}static _structuralEquals(Y,X){do{if(Y===X)return!0;if(!Y&&!X)return!0;if(!Y||!X)return!1;if(Y.depth!==X.depth||Y.ruleId!==X.ruleId||Y.endRule!==X.endRule)return!1;Y=Y.parent,X=X.parent}while(!0)}clone(){return this}static _reset(Y){while(Y)Y._enterPos=-1,Y._anchorPos=-1,Y=Y.parent}reset(){Z._reset(this)}pop(){return this.parent}safePop(){if(this.parent)return this.parent;return this}push(Y,X,J,Q,$,K,U){return new Z(this,Y,X,J,Q,$,K,U)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(Y){return Y.getRule(this.ruleId)}toString(){let Y=[];return this._writeString(Y,0),"["+Y.join(",")+"]"}_writeString(Y,X){if(this.parent)X=this.parent._writeString(Y,X);return Y[X++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,X}withContentNameScopesList(Y){if(this.contentNameScopesList===Y)return this;return this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,Y)}withEndRule(Y){if(this.endRule===Y)return this;return new Z(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,Y,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(Y){let X=this;while(X&&X._enterPos===Y._enterPos){if(X.ruleId===Y.ruleId)return!0;X=X.parent}return!1}toStateStackFrame(){return{ruleId:s5(this.ruleId),beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(Y,X){let J=I4.fromExtension(Y?.nameScopesList??null,X.nameScopesList);return new Z(Y,a5(X.ruleId),X.enterPos??-1,X.anchorPos??-1,X.beginRuleCapturedEOL,X.endRule,J,I4.fromExtension(J,X.contentNameScopesList))}},mK=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(Z,Y){this.balancedBracketScopes=Z.flatMap((X)=>{if(X==="*")return this.allowAny=!0,[];return K0(X,z0).map((J)=>J.matcher)}),this.unbalancedBracketScopes=Y.flatMap((X)=>K0(X,z0).map((J)=>J.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(Z){for(let Y of this.unbalancedBracketScopes)if(Y(Z))return!1;for(let Y of this.balancedBracketScopes)if(Y(Z))return!0;return this.allowAny}},pK=class{constructor(Z,Y,X,J){this.balancedBracketSelectors=J,this._emitBinaryTokens=Z,this._tokenTypeOverrides=X,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(Z,Y){this.produceFromScopes(Z.contentNameScopesList,Y)}produceFromScopes(Z,Y){if(this._lastTokenEndIndex>=Y)return;if(this._emitBinaryTokens){let J=Z?.tokenAttributes??0,Q=!1;if(this.balancedBracketSelectors?.matchesAlways)Q=!0;if(this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){let $=Z?.getScopeNames()??[];for(let K of this._tokenTypeOverrides)if(K.matcher($))J=oY.set(J,0,FK(K.type),null,-1,0,0);if(this.balancedBracketSelectors)Q=this.balancedBracketSelectors.match($)}if(Q)J=oY.set(J,0,8,Q,-1,0,0);if(this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===J){this._lastTokenEndIndex=Y;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(J),this._lastTokenEndIndex=Y;return}let X=Z?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:Y,scopes:X}),this._lastTokenEndIndex=Y}getResult(Z,Y){if(this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===Y-1)this._tokens.pop();if(this._tokens.length===0)this._lastTokenEndIndex=-1,this.produce(Z,Y),this._tokens[this._tokens.length-1].startIndex=0;return this._tokens}getBinaryResult(Z,Y){if(this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===Y-1)this._binaryTokens.pop(),this._binaryTokens.pop();if(this._binaryTokens.length===0)this._lastTokenEndIndex=-1,this.produce(Z,Y),this._binaryTokens[this._binaryTokens.length-2]=0;let X=new Uint32Array(this._binaryTokens.length);for(let J=0,Q=this._binaryTokens.length;J<Q;J++)X[J]=this._binaryTokens[J];return X}},dK=class{constructor(Z,Y){this._onigLib=Y,this._theme=Z}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(let Z of this._grammars.values())Z.dispose()}setTheme(Z){this._theme=Z}getColorMap(){return this._theme.getColorMap()}addGrammar(Z,Y){if(this._rawGrammars.set(Z.scopeName,Z),Y)this._injectionGrammars.set(Z.scopeName,Y)}lookup(Z){return this._rawGrammars.get(Z)}injections(Z){return this._injectionGrammars.get(Z)}getDefaults(){return this._theme.getDefaults()}themeMatch(Z){return this._theme.match(Z)}grammarForScopeName(Z,Y,X,J,Q){if(!this._grammars.has(Z)){let $=this._rawGrammars.get(Z);if(!$)return null;this._grammars.set(Z,xK(Z,$,Y,X,J,Q,this,this._onigLib))}return this._grammars.get(Z)}},J6=class{_options;_syncRegistry;_ensureGrammarCache;constructor(Z){this._options=Z,this._syncRegistry=new dK(D4.createFromRawTheme(Z.theme,Z.colorMap),Z.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(Z,Y){this._syncRegistry.setTheme(D4.createFromRawTheme(Z,Y))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(Z,Y,X){return this.loadGrammarWithConfiguration(Z,Y,{embeddedLanguages:X})}loadGrammarWithConfiguration(Z,Y,X){return this._loadGrammar(Z,Y,X.embeddedLanguages,X.tokenTypes,new mK(X.balancedBracketSelectors||[],X.unbalancedBracketSelectors||[]))}loadGrammar(Z){return this._loadGrammar(Z,0,null,null,null)}_loadGrammar(Z,Y,X,J,Q){let $=new wK(this._syncRegistry,Z);while($.Q.length>0)$.Q.map((K)=>this._loadSingleGrammar(K.scopeName)),$.processQueue();return this._grammarForScopeName(Z,Y,X,J,Q)}_loadSingleGrammar(Z){if(!this._ensureGrammarCache.has(Z))this._doLoadSingleGrammar(Z),this._ensureGrammarCache.set(Z,!0)}_doLoadSingleGrammar(Z){let Y=this._options.loadGrammar(Z);if(Y){let X=typeof this._options.getInjections==="function"?this._options.getInjections(Z):void 0;this._syncRegistry.addGrammar(Y,X)}}addGrammar(Z,Y=[],X=0,J=null){return this._syncRegistry.addGrammar(Z,Y),this._grammarForScopeName(Z.scopeName,X,J)}_grammarForScopeName(Z,Y=0,X=null,J=null,Q=null){return this._syncRegistry.grammarForScopeName(Z,Y,X,J,Q)}},H0=B8.NULL;var Q6=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class fY{constructor(Z,Y,X){if(this.normal=Y,this.property=Z,X)this.space=X}}fY.prototype.normal={};fY.prototype.property={};fY.prototype.space=void 0;function P8(Z,Y){let X={},J={};for(let Q of Z)Object.assign(X,Q.property),Object.assign(J,Q.normal);return new fY(X,J,Y)}function f4(Z){return Z.toLowerCase()}class wZ{constructor(Z,Y){this.attribute=Y,this.property=Z}}wZ.prototype.attribute="";wZ.prototype.booleanish=!1;wZ.prototype.boolean=!1;wZ.prototype.commaOrSpaceSeparated=!1;wZ.prototype.commaSeparated=!1;wZ.prototype.defined=!1;wZ.prototype.mustUseProperty=!1;wZ.prototype.number=!1;wZ.prototype.overloadedBoolean=!1;wZ.prototype.property="";wZ.prototype.spaceSeparated=!1;wZ.prototype.space=void 0;var j4={};cK(j4,{spaceSeparated:()=>l,overloadedBoolean:()=>G0,number:()=>I,commaSeparated:()=>jY,commaOrSpaceSeparated:()=>fZ,booleanish:()=>XZ,boolean:()=>y});var lK=0,y=nY(),XZ=nY(),G0=nY(),I=nY(),l=nY(),jY=nY(),fZ=nY();function nY(){return 2**++lK}var C8=Object.keys(j4);class q4 extends wZ{constructor(Z,Y,X,J){let Q=-1;super(Z,Y);if($6(this,"space",J),typeof X==="number")while(++Q<C8.length){let $=C8[Q];$6(this,C8[Q],(X&j4[$])===j4[$])}}}q4.prototype.defined=!0;function $6(Z,Y,X){if(X)Z[Y]=X}function mZ(Z){let Y={},X={};for(let[J,Q]of Object.entries(Z.properties)){let $=new q4(J,Z.transform(Z.attributes||{},J),Q,Z.space);if(Z.mustUseProperty&&Z.mustUseProperty.includes(J))$.mustUseProperty=!0;Y[J]=$,X[f4(J)]=J,X[f4($.attribute)]=J}return new fY(Y,X,Z.space)}var R8=mZ({properties:{ariaActiveDescendant:null,ariaAtomic:XZ,ariaAutoComplete:null,ariaBusy:XZ,ariaChecked:XZ,ariaColCount:I,ariaColIndex:I,ariaColSpan:I,ariaControls:l,ariaCurrent:null,ariaDescribedBy:l,ariaDetails:null,ariaDisabled:XZ,ariaDropEffect:l,ariaErrorMessage:null,ariaExpanded:XZ,ariaFlowTo:l,ariaGrabbed:XZ,ariaHasPopup:null,ariaHidden:XZ,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:l,ariaLevel:I,ariaLive:null,ariaModal:XZ,ariaMultiLine:XZ,ariaMultiSelectable:XZ,ariaOrientation:null,ariaOwns:l,ariaPlaceholder:null,ariaPosInSet:I,ariaPressed:XZ,ariaReadOnly:XZ,ariaRelevant:null,ariaRequired:XZ,ariaRoleDescription:l,ariaRowCount:I,ariaRowIndex:I,ariaRowSpan:I,ariaSelected:XZ,ariaSetSize:I,ariaSort:null,ariaValueMax:I,ariaValueMin:I,ariaValueNow:I,ariaValueText:null,role:null},transform(Z,Y){return Y==="role"?Y:"aria-"+Y.slice(4).toLowerCase()}});function O0(Z,Y){return Y in Z?Z[Y]:Y}function q0(Z,Y){return O0(Z,Y.toLowerCase())}var K6=mZ({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:jY,acceptCharset:l,accessKey:l,action:null,allow:null,allowFullScreen:y,allowPaymentRequest:y,allowUserMedia:y,alt:null,as:null,async:y,autoCapitalize:null,autoComplete:l,autoFocus:y,autoPlay:y,blocking:l,capture:null,charSet:null,checked:y,cite:null,className:l,cols:I,colSpan:null,content:null,contentEditable:XZ,controls:y,controlsList:l,coords:I|jY,crossOrigin:null,data:null,dateTime:null,decoding:null,default:y,defer:y,dir:null,dirName:null,disabled:y,download:G0,draggable:XZ,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:y,formTarget:null,headers:l,height:I,hidden:G0,high:I,href:null,hrefLang:null,htmlFor:l,httpEquiv:l,id:null,imageSizes:null,imageSrcSet:null,inert:y,inputMode:null,integrity:null,is:null,isMap:y,itemId:null,itemProp:l,itemRef:l,itemScope:y,itemType:l,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:y,low:I,manifest:null,max:null,maxLength:I,media:null,method:null,min:null,minLength:I,multiple:y,muted:y,name:null,nonce:null,noModule:y,noValidate:y,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:y,optimum:I,pattern:null,ping:l,placeholder:null,playsInline:y,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:y,referrerPolicy:null,rel:l,required:y,reversed:y,rows:I,rowSpan:I,sandbox:l,scope:null,scoped:y,seamless:y,selected:y,shadowRootClonable:y,shadowRootDelegatesFocus:y,shadowRootMode:null,shape:null,size:I,sizes:null,slot:null,span:I,spellCheck:XZ,src:null,srcDoc:null,srcLang:null,srcSet:null,start:I,step:null,style:null,tabIndex:I,target:null,title:null,translate:null,type:null,typeMustMatch:y,useMap:null,value:XZ,width:I,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:l,axis:null,background:null,bgColor:null,border:I,borderColor:null,bottomMargin:I,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:y,declare:y,event:null,face:null,frame:null,frameBorder:null,hSpace:I,leftMargin:I,link:null,longDesc:null,lowSrc:null,marginHeight:I,marginWidth:I,noResize:y,noHref:y,noShade:y,noWrap:y,object:null,profile:null,prompt:null,rev:null,rightMargin:I,rules:null,scheme:null,scrolling:XZ,standby:null,summary:null,text:null,topMargin:I,valueType:null,version:null,vAlign:null,vLink:null,vSpace:I,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:y,disableRemotePlayback:y,prefix:null,property:null,results:I,security:null,unselectable:null},space:"html",transform:q0});var W6=mZ({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:fZ,accentHeight:I,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:I,amplitude:I,arabicForm:null,ascent:I,attributeName:null,attributeType:null,azimuth:I,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:I,by:null,calcMode:null,capHeight:I,className:l,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:I,diffuseConstant:I,direction:null,display:null,dur:null,divisor:I,dominantBaseline:null,download:y,dx:null,dy:null,edgeMode:null,editable:null,elevation:I,enableBackground:null,end:null,event:null,exponent:I,externalResourcesRequired:null,fill:null,fillOpacity:I,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:jY,g2:jY,glyphName:jY,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:I,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:I,horizOriginX:I,horizOriginY:I,id:null,ideographic:I,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:I,k:I,k1:I,k2:I,k3:I,k4:I,kernelMatrix:fZ,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:I,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:I,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:I,overlineThickness:I,paintOrder:null,panose1:null,path:null,pathLength:I,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:l,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:I,pointsAtY:I,pointsAtZ:I,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:fZ,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:fZ,rev:fZ,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:fZ,requiredFeatures:fZ,requiredFonts:fZ,requiredFormats:fZ,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:I,specularExponent:I,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:I,strikethroughThickness:I,string:null,stroke:null,strokeDashArray:fZ,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:I,strokeOpacity:I,strokeWidth:null,style:null,surfaceScale:I,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:fZ,tabIndex:I,tableValues:null,target:null,targetX:I,targetY:I,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:fZ,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:I,underlineThickness:I,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:I,values:null,vAlphabetic:I,vMathematical:I,vectorEffect:null,vHanging:I,vIdeographic:I,version:null,vertAdvY:I,vertOriginX:I,vertOriginY:I,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:I,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:O0});var v8=mZ({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(Z,Y){return"xlink:"+Y.slice(5).toLowerCase()}});var I8=mZ({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:q0});var D8=mZ({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(Z,Y){return"xml:"+Y.slice(3).toLowerCase()}});var iK=/[A-Z]/g,U6=/-[a-z]/g,rK=/^data[-\w.:]+$/i;function V8(Z,Y){let X=f4(Y),J=Y,Q=wZ;if(X in Z.normal)return Z.property[Z.normal[X]];if(X.length>4&&X.slice(0,4)==="data"&&rK.test(Y)){if(Y.charAt(4)==="-"){let $=Y.slice(5).replace(U6,nK);J="data"+$.charAt(0).toUpperCase()+$.slice(1)}else{let $=Y.slice(4);if(!U6.test($)){let K=$.replace(iK,oK);if(K.charAt(0)!=="-")K="-"+K;Y="data"+K}}Q=q4}return new Q(J,Y)}function oK(Z){return"-"+Z.toLowerCase()}function nK(Z){return Z.charAt(1).toUpperCase()}var z6=P8([R8,K6,v8,I8,D8],"html"),F0=P8([R8,W6,v8,I8,D8],"svg");var H6={}.hasOwnProperty;function G6(Z,Y){let X=Y||{};function J(Q,...$){let{invalid:K,handlers:U}=J;if(Q&&H6.call(Q,Z)){let W=String(Q[Z]);K=H6.call(U,W)?U[W]:J.unknown}if(K)return K.call(this,Q,...$)}return J.handlers=X.handlers||{},J.invalid=X.invalid,J.unknown=X.unknown,J}var aK=/["&'<>`]/g,sK=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,tK=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,eK=/[|\\{}()[\]^$+*?.]/g,O6=new WeakMap;function q6(Z,Y){if(Z=Z.replace(Y.subset?Z7(Y.subset):aK,J),Y.subset||Y.escapeOnly)return Z;return Z.replace(sK,X).replace(tK,J);function X(Q,$,K){return Y.format((Q.charCodeAt(0)-55296)*1024+Q.charCodeAt(1)-56320+65536,K.charCodeAt($+2),Y)}function J(Q,$,K){return Y.format(Q.charCodeAt(0),K.charCodeAt($+1),Y)}}function Z7(Z){let Y=O6.get(Z);if(!Y)Y=Y7(Z),O6.set(Z,Y);return Y}function Y7(Z){let Y=[],X=-1;while(++X<Z.length)Y.push(Z[X].replace(eK,"\\$&"));return new RegExp("(?:"+Y.join("|")+")","g")}var X7=/[\dA-Fa-f]/;function F6(Z,Y,X){let J="&#x"+Z.toString(16).toUpperCase();return X&&Y&&!X7.test(String.fromCharCode(Y))?J:J+";"}var J7=/\d/;function M6(Z,Y,X){let J="&#"+String(Z);return X&&Y&&!J7.test(String.fromCharCode(Y))?J:J+";"}var N6=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"];var M0={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"};var A6=["cent","copy","divide","gt","lt","not","para","times"];var _6={}.hasOwnProperty,E8={},N0;for(N0 in M0)if(_6.call(M0,N0))E8[M0[N0]]=N0;var Q7=/[^\dA-Za-z]/;function w6(Z,Y,X,J){let Q=String.fromCharCode(Z);if(_6.call(E8,Q)){let $=E8[Q],K="&"+$;if(X&&N6.includes($)&&!A6.includes($)&&(!J||Y&&Y!==61&&Q7.test(String.fromCharCode(Y))))return K;return K+";"}return""}function B6(Z,Y,X){let J=F6(Z,Y,X.omitOptionalSemicolons),Q;if(X.useNamedReferences||X.useShortestReferences)Q=w6(Z,Y,X.omitOptionalSemicolons,X.attribute);if((X.useShortestReferences||!Q)&&X.useShortestReferences){let $=M6(Z,Y,X.omitOptionalSemicolons);if($.length<J.length)J=$}return Q&&(!X.useShortestReferences||Q.length<J.length)?Q:J}function PY(Z,Y){return q6(Z,Object.assign({format:B6},Y))}var $7=/^>|^->|<!--|-->|--!>|<!-$/g,K7=[">"],W7=["<",">"];function L6(Z,Y,X,J){return J.settings.bogusComments?"<?"+PY(Z.value,Object.assign({},J.settings.characterReferences,{subset:K7}))+">":"<!--"+Z.value.replace($7,Q)+"-->";function Q($){return PY($,Object.assign({},J.settings.characterReferences,{subset:W7}))}}function P6(Z,Y,X,J){return"<!"+(J.settings.upperDoctype?"DOCTYPE":"doctype")+(J.settings.tightDoctype?"":" ")+"html>"}function b8(Z,Y){let X=String(Z);if(typeof Y!=="string")throw TypeError("Expected character");let J=0,Q=X.indexOf(Y);while(Q!==-1)J++,Q=X.indexOf(Y,Q+Y.length);return J}function C6(Z,Y){let X=Y||{};return(Z[Z.length-1]===""?[...Z,""]:Z).join((X.padRight?" ":"")+","+(X.padLeft===!1?"":" ")).trim()}function R6(Z){return Z.join(" ").trim()}var U7=/[ \t\n\f\r]/g;function aY(Z){return typeof Z==="object"?Z.type==="text"?v6(Z.value):!1:v6(Z)}function v6(Z){return Z.replace(U7,"")===""}var QZ=I6(1),T8=I6(-1),z7=[];function I6(Z){return Y;function Y(X,J,Q){let $=X?X.children:z7,K=(J||0)+Z,U=$[K];if(!Q)while(U&&aY(U))K+=Z,U=$[K];return U}}var H7={}.hasOwnProperty;function A0(Z){return Y;function Y(X,J,Q){return H7.call(Z,X.tagName)&&Z[X.tagName](X,J,Q)}}var S4=A0({body:O7,caption:f8,colgroup:f8,dd:N7,dt:M7,head:f8,html:G7,li:F7,optgroup:A7,option:_7,p:q7,rp:D6,rt:D6,tbody:B7,td:V6,tfoot:L7,th:V6,thead:w7,tr:P7});function f8(Z,Y,X){let J=QZ(X,Y,!0);return!J||J.type!=="comment"&&!(J.type==="text"&&aY(J.value.charAt(0)))}function G7(Z,Y,X){let J=QZ(X,Y);return!J||J.type!=="comment"}function O7(Z,Y,X){let J=QZ(X,Y);return!J||J.type!=="comment"}function q7(Z,Y,X){let J=QZ(X,Y);return J?J.type==="element"&&(J.tagName==="address"||J.tagName==="article"||J.tagName==="aside"||J.tagName==="blockquote"||J.tagName==="details"||J.tagName==="div"||J.tagName==="dl"||J.tagName==="fieldset"||J.tagName==="figcaption"||J.tagName==="figure"||J.tagName==="footer"||J.tagName==="form"||J.tagName==="h1"||J.tagName==="h2"||J.tagName==="h3"||J.tagName==="h4"||J.tagName==="h5"||J.tagName==="h6"||J.tagName==="header"||J.tagName==="hgroup"||J.tagName==="hr"||J.tagName==="main"||J.tagName==="menu"||J.tagName==="nav"||J.tagName==="ol"||J.tagName==="p"||J.tagName==="pre"||J.tagName==="section"||J.tagName==="table"||J.tagName==="ul"):!X||!(X.type==="element"&&(X.tagName==="a"||X.tagName==="audio"||X.tagName==="del"||X.tagName==="ins"||X.tagName==="map"||X.tagName==="noscript"||X.tagName==="video"))}function F7(Z,Y,X){let J=QZ(X,Y);return!J||J.type==="element"&&J.tagName==="li"}function M7(Z,Y,X){let J=QZ(X,Y);return Boolean(J&&J.type==="element"&&(J.tagName==="dt"||J.tagName==="dd"))}function N7(Z,Y,X){let J=QZ(X,Y);return!J||J.type==="element"&&(J.tagName==="dt"||J.tagName==="dd")}function D6(Z,Y,X){let J=QZ(X,Y);return!J||J.type==="element"&&(J.tagName==="rp"||J.tagName==="rt")}function A7(Z,Y,X){let J=QZ(X,Y);return!J||J.type==="element"&&J.tagName==="optgroup"}function _7(Z,Y,X){let J=QZ(X,Y);return!J||J.type==="element"&&(J.tagName==="option"||J.tagName==="optgroup")}function w7(Z,Y,X){let J=QZ(X,Y);return Boolean(J&&J.type==="element"&&(J.tagName==="tbody"||J.tagName==="tfoot"))}function B7(Z,Y,X){let J=QZ(X,Y);return!J||J.type==="element"&&(J.tagName==="tbody"||J.tagName==="tfoot")}function L7(Z,Y,X){return!QZ(X,Y)}function P7(Z,Y,X){let J=QZ(X,Y);return!J||J.type==="element"&&J.tagName==="tr"}function V6(Z,Y,X){let J=QZ(X,Y);return!J||J.type==="element"&&(J.tagName==="td"||J.tagName==="th")}var E6=A0({body:v7,colgroup:I7,head:R7,html:C7,tbody:D7});function C7(Z){let Y=QZ(Z,-1);return!Y||Y.type!=="comment"}function R7(Z){let Y=new Set;for(let J of Z.children)if(J.type==="element"&&(J.tagName==="base"||J.tagName==="title")){if(Y.has(J.tagName))return!1;Y.add(J.tagName)}let X=Z.children[0];return!X||X.type==="element"}function v7(Z){let Y=QZ(Z,-1,!0);return!Y||Y.type!=="comment"&&!(Y.type==="text"&&aY(Y.value.charAt(0)))&&!(Y.type==="element"&&(Y.tagName==="meta"||Y.tagName==="link"||Y.tagName==="script"||Y.tagName==="style"||Y.tagName==="template"))}function I7(Z,Y,X){let J=T8(X,Y),Q=QZ(Z,-1,!0);if(X&&J&&J.type==="element"&&J.tagName==="colgroup"&&S4(J,X.children.indexOf(J),X))return!1;return Boolean(Q&&Q.type==="element"&&Q.tagName==="col")}function D7(Z,Y,X){let J=T8(X,Y),Q=QZ(Z,-1);if(X&&J&&J.type==="element"&&(J.tagName==="thead"||J.tagName==="tbody")&&S4(J,X.children.indexOf(J),X))return!1;return Boolean(Q&&Q.type==="element"&&Q.tagName==="tr")}var _0={name:[[`
|
|
135
|
+
`}strong({tokens:Z}){return`<strong>${this.parser.parseInline(Z)}</strong>`}em({tokens:Z}){return`<em>${this.parser.parseInline(Z)}</em>`}codespan({text:Z}){return`<code>${O4(Z,!0)}</code>`}br(Z){return"<br>"}del({tokens:Z}){return`<del>${this.parser.parseInline(Z)}</del>`}link({href:Z,title:Y,tokens:X}){let J=this.parser.parseInline(X),Q=I5(Z);if(Q===null)return J;Z=Q;let $='<a href="'+Z+'"';return Y&&($+=' title="'+O4(Y)+'"'),$+=">"+J+"</a>",$}image({href:Z,title:Y,text:X,tokens:J}){J&&(X=this.parser.parseInline(J,this.parser.textRenderer));let Q=I5(Z);if(Q===null)return O4(X);Z=Q;let $=`<img src="${Z}" alt="${X}"`;return Y&&($+=` title="${O4(Y)}"`),$+=">",$}text(Z){return"tokens"in Z&&Z.tokens?this.parser.parseInline(Z.tokens):("escaped"in Z)&&Z.escaped?Z.text:O4(Z.text)}},NX=class{strong({text:Z}){return Z}em({text:Z}){return Z}codespan({text:Z}){return Z}del({text:Z}){return Z}html({text:Z}){return Z}text({text:Z}){return Z}link({text:Z}){return""+Z}image({text:Z}){return""+Z}br(){return""}},eZ=class Z{options;renderer;textRenderer;constructor(Y){this.options=Y||i4,this.options.renderer=this.options.renderer||new XY,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new NX}static parse(Y,X){return new Z(X).parse(Y)}static parseInline(Y,X){return new Z(X).parseInline(Y)}parse(Y,X=!0){let J="";for(let Q=0;Q<Y.length;Q++){let $=Y[Q];if(this.options.extensions?.renderers?.[$.type]){let W=$,U=this.options.extensions.renderers[W.type].call({parser:this},W);if(U!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(W.type)){J+=U||"";continue}}let K=$;switch(K.type){case"space":{J+=this.renderer.space(K);continue}case"hr":{J+=this.renderer.hr(K);continue}case"heading":{J+=this.renderer.heading(K);continue}case"code":{J+=this.renderer.code(K);continue}case"table":{J+=this.renderer.table(K);continue}case"blockquote":{J+=this.renderer.blockquote(K);continue}case"list":{J+=this.renderer.list(K);continue}case"html":{J+=this.renderer.html(K);continue}case"def":{J+=this.renderer.def(K);continue}case"paragraph":{J+=this.renderer.paragraph(K);continue}case"text":{let W=K,U=this.renderer.text(W);for(;Q+1<Y.length&&Y[Q+1].type==="text";)W=Y[++Q],U+=`
|
|
136
|
+
`+this.renderer.text(W);X?J+=this.renderer.paragraph({type:"paragraph",raw:U,text:U,tokens:[{type:"text",raw:U,text:U,escaped:!0}]}):J+=U;continue}default:{let W='Token with "'+K.type+'" type was not found.';if(this.options.silent)return console.error(W),"";throw Error(W)}}}return J}parseInline(Y,X=this.renderer){let J="";for(let Q=0;Q<Y.length;Q++){let $=Y[Q];if(this.options.extensions?.renderers?.[$.type]){let W=this.options.extensions.renderers[$.type].call({parser:this},$);if(W!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes($.type)){J+=W||"";continue}}let K=$;switch(K.type){case"escape":{J+=X.text(K);break}case"html":{J+=X.html(K);break}case"link":{J+=X.link(K);break}case"image":{J+=X.image(K);break}case"strong":{J+=X.strong(K);break}case"em":{J+=X.em(K);break}case"codespan":{J+=X.codespan(K);break}case"br":{J+=X.br(K);break}case"del":{J+=X.del(K);break}case"text":{J+=X.text(K);break}default:{let W='Token with "'+K.type+'" type was not found.';if(this.options.silent)return console.error(W),"";throw Error(W)}}}return J}},R0=class{options;block;constructor(Z){this.options=Z||i4}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(Z){return Z}postprocess(Z){return Z}processAllTokens(Z){return Z}emStrongMask(Z){return Z}provideLexer(){return this.block?tZ.lex:tZ.lexInline}provideParser(){return this.block?eZ.parse:eZ.parseInline}},fK=class{defaults=UX();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=eZ;Renderer=XY;TextRenderer=NX;Lexer=tZ;Tokenizer=YY;Hooks=R0;constructor(...Z){this.use(...Z)}walkTokens(Z,Y){let X=[];for(let J of Z)switch(X=X.concat(Y.call(this,J)),J.type){case"table":{let Q=J;for(let $ of Q.header)X=X.concat(this.walkTokens($.tokens,Y));for(let $ of Q.rows)for(let K of $)X=X.concat(this.walkTokens(K.tokens,Y));break}case"list":{let Q=J;X=X.concat(this.walkTokens(Q.items,Y));break}default:{let Q=J;this.defaults.extensions?.childTokens?.[Q.type]?this.defaults.extensions.childTokens[Q.type].forEach(($)=>{let K=Q[$].flat(1/0);X=X.concat(this.walkTokens(K,Y))}):Q.tokens&&(X=X.concat(this.walkTokens(Q.tokens,Y)))}}return X}use(...Z){let Y=this.defaults.extensions||{renderers:{},childTokens:{}};return Z.forEach((X)=>{let J={...X};if(J.async=this.defaults.async||J.async||!1,X.extensions&&(X.extensions.forEach((Q)=>{if(!Q.name)throw Error("extension name required");if("renderer"in Q){let $=Y.renderers[Q.name];$?Y.renderers[Q.name]=function(...K){let W=Q.renderer.apply(this,K);return W===!1&&(W=$.apply(this,K)),W}:Y.renderers[Q.name]=Q.renderer}if("tokenizer"in Q){if(!Q.level||Q.level!=="block"&&Q.level!=="inline")throw Error("extension level must be 'block' or 'inline'");let $=Y[Q.level];$?$.unshift(Q.tokenizer):Y[Q.level]=[Q.tokenizer],Q.start&&(Q.level==="block"?Y.startBlock?Y.startBlock.push(Q.start):Y.startBlock=[Q.start]:Q.level==="inline"&&(Y.startInline?Y.startInline.push(Q.start):Y.startInline=[Q.start]))}"childTokens"in Q&&Q.childTokens&&(Y.childTokens[Q.name]=Q.childTokens)}),J.extensions=Y),X.renderer){let Q=this.defaults.renderer||new XY(this.defaults);for(let $ in X.renderer){if(!($ in Q))throw Error(`renderer '${$}' does not exist`);if(["options","parser"].includes($))continue;let K=$,W=X.renderer[K],U=Q[K];Q[K]=(...z)=>{let H=W.apply(Q,z);return H===!1&&(H=U.apply(Q,z)),H||""}}J.renderer=Q}if(X.tokenizer){let Q=this.defaults.tokenizer||new YY(this.defaults);for(let $ in X.tokenizer){if(!($ in Q))throw Error(`tokenizer '${$}' does not exist`);if(["options","rules","lexer"].includes($))continue;let K=$,W=X.tokenizer[K],U=Q[K];Q[K]=(...z)=>{let H=W.apply(Q,z);return H===!1&&(H=U.apply(Q,z)),H}}J.tokenizer=Q}if(X.hooks){let Q=this.defaults.hooks||new R0;for(let $ in X.hooks){if(!($ in Q))throw Error(`hook '${$}' does not exist`);if(["options","block"].includes($))continue;let K=$,W=X.hooks[K],U=Q[K];R0.passThroughHooks.has($)?Q[K]=(z)=>{if(this.defaults.async&&R0.passThroughHooksRespectAsync.has($))return(async()=>{let G=await W.call(Q,z);return U.call(Q,G)})();let H=W.call(Q,z);return U.call(Q,H)}:Q[K]=(...z)=>{if(this.defaults.async)return(async()=>{let G=await W.apply(Q,z);return G===!1&&(G=await U.apply(Q,z)),G})();let H=W.apply(Q,z);return H===!1&&(H=U.apply(Q,z)),H}}J.hooks=Q}if(X.walkTokens){let Q=this.defaults.walkTokens,$=X.walkTokens;J.walkTokens=function(K){let W=[];return W.push($.call(this,K)),Q&&(W=W.concat(Q.call(this,K))),W}}this.defaults={...this.defaults,...J}}),this}setOptions(Z){return this.defaults={...this.defaults,...Z},this}lexer(Z,Y){return tZ.lex(Z,Y??this.defaults)}parser(Z,Y){return eZ.parse(Z,Y??this.defaults)}parseMarkdown(Z){return(Y,X)=>{let J={...X},Q={...this.defaults,...J},$=this.onError(!!Q.silent,!!Q.async);if(this.defaults.async===!0&&J.async===!1)return $(Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof Y>"u"||Y===null)return $(Error("marked(): input parameter is undefined or null"));if(typeof Y!="string")return $(Error("marked(): input parameter is of type "+Object.prototype.toString.call(Y)+", string expected"));if(Q.hooks&&(Q.hooks.options=Q,Q.hooks.block=Z),Q.async)return(async()=>{let K=Q.hooks?await Q.hooks.preprocess(Y):Y,W=await(Q.hooks?await Q.hooks.provideLexer():Z?tZ.lex:tZ.lexInline)(K,Q),U=Q.hooks?await Q.hooks.processAllTokens(W):W;Q.walkTokens&&await Promise.all(this.walkTokens(U,Q.walkTokens));let z=await(Q.hooks?await Q.hooks.provideParser():Z?eZ.parse:eZ.parseInline)(U,Q);return Q.hooks?await Q.hooks.postprocess(z):z})().catch($);try{Q.hooks&&(Y=Q.hooks.preprocess(Y));let K=(Q.hooks?Q.hooks.provideLexer():Z?tZ.lex:tZ.lexInline)(Y,Q);Q.hooks&&(K=Q.hooks.processAllTokens(K)),Q.walkTokens&&this.walkTokens(K,Q.walkTokens);let W=(Q.hooks?Q.hooks.provideParser():Z?eZ.parse:eZ.parseInline)(K,Q);return Q.hooks&&(W=Q.hooks.postprocess(W)),W}catch(K){return $(K)}}}onError(Z,Y){return(X)=>{if(X.message+=`
|
|
137
|
+
Please report this to https://github.com/markedjs/marked.`,Z){let J="<p>An error occurred:</p><pre>"+O4(X.message+"",!0)+"</pre>";return Y?Promise.resolve(J):J}if(Y)return Promise.reject(X);throw X}}},l4=new fK;function d(Z,Y){return l4.parse(Z,Y)}d.options=d.setOptions=function(Z){return l4.setOptions(Z),d.defaults=l4.defaults,E5(d.defaults),d};d.getDefaults=UX;d.defaults=i4;d.use=function(...Z){return l4.use(...Z),d.defaults=l4.defaults,E5(d.defaults),d};d.walkTokens=function(Z,Y){return l4.walkTokens(Z,Y)};d.parseInline=l4.parseInline;d.Parser=eZ;d.parser=eZ.parse;d.Renderer=XY;d.TextRenderer=NX;d.Lexer=tZ;d.lexer=tZ.lex;d.Tokenizer=YY;d.Hooks=R0;d.parse=d;var{options:oG,setOptions:nG,use:aG,walkTokens:sG,parseInline:tG}=d;var eG=eZ.parse,ZO=tZ.lex;var cZ=L(x(),1);class YZ extends Error{constructor(Z){super(Z);this.name="ShikiError"}}function jK(Z){return CX(Z)}function CX(Z){if(Array.isArray(Z))return SK(Z);if(Z instanceof RegExp)return Z;if(typeof Z==="object")return yK(Z);return Z}function SK(Z){let Y=[];for(let X=0,J=Z.length;X<J;X++)Y[X]=CX(Z[X]);return Y}function yK(Z){let Y={};for(let X in Z)Y[X]=CX(Z[X]);return Y}function o5(Z,...Y){return Y.forEach((X)=>{for(let J in X)Z[J]=X[J]}),Z}function n5(Z){let Y=~Z.lastIndexOf("/")||~Z.lastIndexOf("\\");if(Y===0)return Z;else if(~Y===Z.length-1)return n5(Z.substring(0,Z.length-1));else return Z.substr(~Y+1)}var _X=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,$Y=class{static hasCaptures(Z){if(Z===null)return!1;return _X.lastIndex=0,_X.test(Z)}static replaceCaptures(Z,Y,X){return Z.replace(_X,(J,Q,$,K)=>{let W=X[parseInt(Q||$,10)];if(W){let U=Y.substring(W.start,W.end);while(U[0]===".")U=U.substring(1);switch(K){case"downcase":return U.toLowerCase();case"upcase":return U.toUpperCase();default:return U}}else return J})}};function a5(Z,Y){if(Z<Y)return-1;if(Z>Y)return 1;return 0}function s5(Z,Y){if(Z===null&&Y===null)return 0;if(!Z)return-1;if(!Y)return 1;let X=Z.length,J=Y.length;if(X===J){for(let Q=0;Q<X;Q++){let $=a5(Z[Q],Y[Q]);if($!==0)return $}return 0}return X-J}function u5(Z){if(/^#[0-9a-f]{6}$/i.test(Z))return!0;if(/^#[0-9a-f]{8}$/i.test(Z))return!0;if(/^#[0-9a-f]{3}$/i.test(Z))return!0;if(/^#[0-9a-f]{4}$/i.test(Z))return!0;return!1}function t5(Z){return Z.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var e5=class{constructor(Z){this.fn=Z}cache=new Map;get(Z){if(this.cache.has(Z))return this.cache.get(Z);let Y=this.fn(Z);return this.cache.set(Z,Y),Y}},V0=class{constructor(Z,Y,X){this._colorMap=Z,this._defaults=Y,this._root=X}static createFromRawTheme(Z,Y){return this.createFromParsedTheme(xK(Z),Y)}static createFromParsedTheme(Z,Y){return uK(Z,Y)}_cachedMatchRoot=new e5((Z)=>this._root.match(Z));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(Z){if(Z===null)return this._defaults;let Y=Z.scopeName,J=this._cachedMatchRoot.get(Y).find((Q)=>kK(Z.parent,Q.parentScopes));if(!J)return null;return new Z6(J.fontStyle,J.foreground,J.background)}},wX=class Z{constructor(Y,X){this.parent=Y,this.scopeName=X}static push(Y,X){for(let J of X)Y=new Z(Y,J);return Y}static from(...Y){let X=null;for(let J=0;J<Y.length;J++)X=new Z(X,Y[J]);return X}push(Y){return new Z(this,Y)}getSegments(){let Y=this,X=[];while(Y)X.push(Y.scopeName),Y=Y.parent;return X.reverse(),X}toString(){return this.getSegments().join(" ")}extends(Y){if(this===Y)return!0;if(this.parent===null)return!1;return this.parent.extends(Y)}getExtensionIfDefined(Y){let X=[],J=this;while(J&&J!==Y)X.push(J.scopeName),J=J.parent;return J===Y?X.reverse():void 0}};function kK(Z,Y){if(Y.length===0)return!0;for(let X=0;X<Y.length;X++){let J=Y[X],Q=!1;if(J===">"){if(X===Y.length-1)return!1;J=Y[++X],Q=!0}while(Z){if(hK(Z.scopeName,J))break;if(Q)return!1;Z=Z.parent}if(!Z)return!1;Z=Z.parent}return!0}function hK(Z,Y){return Y===Z||Z.startsWith(Y)&&Z[Y.length]==="."}var Z6=class{constructor(Z,Y,X){this.fontStyle=Z,this.foregroundId=Y,this.backgroundId=X}};function xK(Z){if(!Z)return[];if(!Z.settings||!Array.isArray(Z.settings))return[];let Y=Z.settings,X=[],J=0;for(let Q=0,$=Y.length;Q<$;Q++){let K=Y[Q];if(!K.settings)continue;let W;if(typeof K.scope==="string"){let G=K.scope;G=G.replace(/^[,]+/,""),G=G.replace(/[,]+$/,""),W=G.split(",")}else if(Array.isArray(K.scope))W=K.scope;else W=[""];let U=-1;if(typeof K.settings.fontStyle==="string"){U=0;let G=K.settings.fontStyle.split(" ");for(let F=0,M=G.length;F<M;F++)switch(G[F]){case"italic":U=U|1;break;case"bold":U=U|2;break;case"underline":U=U|4;break;case"strikethrough":U=U|8;break}}let z=null;if(typeof K.settings.foreground==="string"&&u5(K.settings.foreground))z=K.settings.foreground;let H=null;if(typeof K.settings.background==="string"&&u5(K.settings.background))H=K.settings.background;for(let G=0,F=W.length;G<F;G++){let _=W[G].trim().split(" "),A=_[_.length-1],P=null;if(_.length>1)P=_.slice(0,_.length-1),P.reverse();X[J++]=new gK(A,P,Q,U,z,H)}}return X}var gK=class{constructor(Z,Y,X,J,Q,$){this.scope=Z,this.parentScopes=Y,this.index=X,this.fontStyle=J,this.foreground=Q,this.background=$}},OZ=((Z)=>{return Z[Z.NotSet=-1]="NotSet",Z[Z.None=0]="None",Z[Z.Italic=1]="Italic",Z[Z.Bold=2]="Bold",Z[Z.Underline=4]="Underline",Z[Z.Strikethrough=8]="Strikethrough",Z})(OZ||{});function uK(Z,Y){Z.sort((U,z)=>{let H=a5(U.scope,z.scope);if(H!==0)return H;if(H=s5(U.parentScopes,z.parentScopes),H!==0)return H;return U.index-z.index});let X=0,J="#000000",Q="#ffffff";while(Z.length>=1&&Z[0].scope===""){let U=Z.shift();if(U.fontStyle!==-1)X=U.fontStyle;if(U.foreground!==null)J=U.foreground;if(U.background!==null)Q=U.background}let $=new mK(Y),K=new Z6(X,$.getId(J),$.getId(Q)),W=new cK(new BX(0,null,-1,0,0),[]);for(let U=0,z=Z.length;U<z;U++){let H=Z[U];W.insert(0,H.scope,H.parentScopes,H.fontStyle,$.getId(H.foreground),$.getId(H.background))}return new V0($,K,W)}var mK=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(Z){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(Z)){this._isFrozen=!0;for(let Y=0,X=Z.length;Y<X;Y++)this._color2id[Z[Y]]=Y,this._id2color[Y]=Z[Y]}else this._isFrozen=!1}getId(Z){if(Z===null)return 0;Z=Z.toUpperCase();let Y=this._color2id[Z];if(Y)return Y;if(this._isFrozen)throw Error(`Missing color in color map - ${Z}`);return Y=++this._lastColorId,this._color2id[Z]=Y,this._id2color[Y]=Z,Y}getColorMap(){return this._id2color.slice(0)}},pK=Object.freeze([]),BX=class Z{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(Y,X,J,Q,$){this.scopeDepth=Y,this.parentScopes=X||pK,this.fontStyle=J,this.foreground=Q,this.background=$}clone(){return new Z(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(Y){let X=[];for(let J=0,Q=Y.length;J<Q;J++)X[J]=Y[J].clone();return X}acceptOverwrite(Y,X,J,Q){if(this.scopeDepth>Y)console.log("how did this happen?");else this.scopeDepth=Y;if(X!==-1)this.fontStyle=X;if(J!==0)this.foreground=J;if(Q!==0)this.background=Q}},cK=class Z{constructor(Y,X=[],J={}){this._mainRule=Y,this._children=J,this._rulesWithParentScopes=X}_rulesWithParentScopes;static _cmpBySpecificity(Y,X){if(Y.scopeDepth!==X.scopeDepth)return X.scopeDepth-Y.scopeDepth;let J=0,Q=0;while(!0){if(Y.parentScopes[J]===">")J++;if(X.parentScopes[Q]===">")Q++;if(J>=Y.parentScopes.length||Q>=X.parentScopes.length)break;let $=X.parentScopes[Q].length-Y.parentScopes[J].length;if($!==0)return $;J++,Q++}return X.parentScopes.length-Y.parentScopes.length}match(Y){if(Y!==""){let J=Y.indexOf("."),Q,$;if(J===-1)Q=Y,$="";else Q=Y.substring(0,J),$=Y.substring(J+1);if(this._children.hasOwnProperty(Q))return this._children[Q].match($)}let X=this._rulesWithParentScopes.concat(this._mainRule);return X.sort(Z._cmpBySpecificity),X}insert(Y,X,J,Q,$,K){if(X===""){this._doInsertHere(Y,J,Q,$,K);return}let W=X.indexOf("."),U,z;if(W===-1)U=X,z="";else U=X.substring(0,W),z=X.substring(W+1);let H;if(this._children.hasOwnProperty(U))H=this._children[U];else H=new Z(this._mainRule.clone(),BX.cloneArr(this._rulesWithParentScopes)),this._children[U]=H;H.insert(Y+1,z,J,Q,$,K)}_doInsertHere(Y,X,J,Q,$){if(X===null){this._mainRule.acceptOverwrite(Y,J,Q,$);return}for(let K=0,W=this._rulesWithParentScopes.length;K<W;K++){let U=this._rulesWithParentScopes[K];if(s5(U.parentScopes,X)===0){U.acceptOverwrite(Y,J,Q,$);return}}if(J===-1)J=this._mainRule.fontStyle;if(Q===0)Q=this._mainRule.foreground;if($===0)$=this._mainRule.background;this._rulesWithParentScopes.push(new BX(Y,X,J,Q,$))}},r4=class Z{static toBinaryStr(Y){return Y.toString(2).padStart(32,"0")}static print(Y){let X=Z.getLanguageId(Y),J=Z.getTokenType(Y),Q=Z.getFontStyle(Y),$=Z.getForeground(Y),K=Z.getBackground(Y);console.log({languageId:X,tokenType:J,fontStyle:Q,foreground:$,background:K})}static getLanguageId(Y){return(Y&255)>>>0}static getTokenType(Y){return(Y&768)>>>8}static containsBalancedBrackets(Y){return(Y&1024)!==0}static getFontStyle(Y){return(Y&30720)>>>11}static getForeground(Y){return(Y&16744448)>>>15}static getBackground(Y){return(Y&4278190080)>>>24}static set(Y,X,J,Q,$,K,W){let U=Z.getLanguageId(Y),z=Z.getTokenType(Y),H=Z.containsBalancedBrackets(Y)?1:0,G=Z.getFontStyle(Y),F=Z.getForeground(Y),M=Z.getBackground(Y);if(X!==0)U=X;if(J!==8)z=lK(J);if(Q!==null)H=Q?1:0;if($!==-1)G=$;if(K!==0)F=K;if(W!==0)M=W;return(U<<0|z<<8|H<<10|G<<11|F<<15|M<<24)>>>0}};function dK(Z){return Z}function lK(Z){return Z}function WY(Z,Y){let X=[],J=iK(Z),Q=J.next();while(Q!==null){let U=0;if(Q.length===2&&Q.charAt(1)===":"){switch(Q.charAt(0)){case"R":U=1;break;case"L":U=-1;break;default:console.log(`Unknown priority ${Q} in scope selector`)}Q=J.next()}let z=K();if(X.push({matcher:z,priority:U}),Q!==",")break;Q=J.next()}return X;function $(){if(Q==="-"){Q=J.next();let U=$();return(z)=>!!U&&!U(z)}if(Q==="("){Q=J.next();let U=W();if(Q===")")Q=J.next();return U}if(m5(Q)){let U=[];do U.push(Q),Q=J.next();while(m5(Q));return(z)=>Y(U,z)}return null}function K(){let U=[],z=$();while(z)U.push(z),z=$();return(H)=>U.every((G)=>G(H))}function W(){let U=[],z=K();while(z){if(U.push(z),Q==="|"||Q===",")do Q=J.next();while(Q==="|"||Q===",");else break;z=K()}return(H)=>U.some((G)=>G(H))}}function m5(Z){return!!Z&&!!Z.match(/[\w\.:]+/)}function iK(Z){let Y=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,X=Y.exec(Z);return{next:()=>{if(!X)return null;let J=X[0];return X=Y.exec(Z),J}}}function Y6(Z){if(typeof Z.dispose==="function")Z.dispose()}var E0=class{constructor(Z){this.scopeName=Z}toKey(){return this.scopeName}},rK=class{constructor(Z,Y){this.scopeName=Z,this.ruleName=Y}toKey(){return`${this.scopeName}#${this.ruleName}`}},oK=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(Z){let Y=Z.toKey();if(this._seenReferenceKeys.has(Y))return;this._seenReferenceKeys.add(Y),this._references.push(Z)}},nK=class{constructor(Z,Y){this.repo=Z,this.initialScopeName=Y,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new E0(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let Z=this.Q;this.Q=[];let Y=new oK;for(let X of Z)aK(X,this.initialScopeName,this.repo,Y);for(let X of Y.references)if(X instanceof E0){if(this.seenFullScopeRequests.has(X.scopeName))continue;this.seenFullScopeRequests.add(X.scopeName),this.Q.push(X)}else{if(this.seenFullScopeRequests.has(X.scopeName))continue;if(this.seenPartialScopeRequests.has(X.toKey()))continue;this.seenPartialScopeRequests.add(X.toKey()),this.Q.push(X)}}};function aK(Z,Y,X,J){let Q=X.lookup(Z.scopeName);if(!Q){if(Z.scopeName===Y)throw Error(`No grammar provided for <${Y}>`);return}let $=X.lookup(Y);if(Z instanceof E0)KY({baseGrammar:$,selfGrammar:Q},J);else LX(Z.ruleName,{baseGrammar:$,selfGrammar:Q,repository:Q.repository},J);let K=X.injections(Z.scopeName);if(K)for(let W of K)J.add(new E0(W))}function LX(Z,Y,X){if(Y.repository&&Y.repository[Z]){let J=Y.repository[Z];UY([J],Y,X)}}function KY(Z,Y){if(Z.selfGrammar.patterns&&Array.isArray(Z.selfGrammar.patterns))UY(Z.selfGrammar.patterns,{...Z,repository:Z.selfGrammar.repository},Y);if(Z.selfGrammar.injections)UY(Object.values(Z.selfGrammar.injections),{...Z,repository:Z.selfGrammar.repository},Y)}function UY(Z,Y,X){for(let J of Z){if(X.visitedRule.has(J))continue;X.visitedRule.add(J);let Q=J.repository?o5({},Y.repository,J.repository):Y.repository;if(Array.isArray(J.patterns))UY(J.patterns,{...Y,repository:Q},X);let $=J.include;if(!$)continue;let K=X6($);switch(K.kind){case 0:KY({...Y,selfGrammar:Y.baseGrammar},X);break;case 1:KY(Y,X);break;case 2:LX(K.ruleName,{...Y,repository:Q},X);break;case 3:case 4:let W=K.scopeName===Y.selfGrammar.scopeName?Y.selfGrammar:K.scopeName===Y.baseGrammar.scopeName?Y.baseGrammar:void 0;if(W){let U={baseGrammar:Y.baseGrammar,selfGrammar:W,repository:Q};if(K.kind===4)LX(K.ruleName,U,X);else KY(U,X)}else if(K.kind===4)X.add(new rK(K.scopeName,K.ruleName));else X.add(new E0(K.scopeName));break}}}var sK=class{kind=0},tK=class{kind=1},eK=class{constructor(Z){this.ruleName=Z}kind=2},Z7=class{constructor(Z){this.scopeName=Z}kind=3},Y7=class{constructor(Z,Y){this.scopeName=Z,this.ruleName=Y}kind=4};function X6(Z){if(Z==="$base")return new sK;else if(Z==="$self")return new tK;let Y=Z.indexOf("#");if(Y===-1)return new Z7(Z);else if(Y===0)return new eK(Z.substring(1));else{let X=Z.substring(0,Y),J=Z.substring(Y+1);return new Y7(X,J)}}var X7=/\\(\d+)/,p5=/\\(\d+)/g,UO=Symbol("RuleId"),J7=-1,J6=-2;function Q6(Z){return Z}function $6(Z){return Z}var f0=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(Z,Y,X,J){this.$location=Z,this.id=Y,this._name=X||null,this._nameIsCapturing=$Y.hasCaptures(this._name),this._contentName=J||null,this._contentNameIsCapturing=$Y.hasCaptures(this._contentName)}get debugName(){let Z=this.$location?`${n5(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${Z}`}getName(Z,Y){if(!this._nameIsCapturing||this._name===null||Z===null||Y===null)return this._name;return $Y.replaceCaptures(this._name,Z,Y)}getContentName(Z,Y){if(!this._contentNameIsCapturing||this._contentName===null)return this._contentName;return $Y.replaceCaptures(this._contentName,Z,Y)}},Q7=class extends f0{retokenizeCapturedWithRuleId;constructor(Z,Y,X,J,Q){super(Z,Y,X,J);this.retokenizeCapturedWithRuleId=Q}dispose(){}collectPatterns(Z,Y){throw Error("Not supported!")}compile(Z,Y){throw Error("Not supported!")}compileAG(Z,Y,X,J){throw Error("Not supported!")}},$7=class extends f0{_match;captures;_cachedCompiledPatterns;constructor(Z,Y,X,J,Q){super(Z,Y,X,null);this._match=new b0(J,this.id),this.captures=Q,this._cachedCompiledPatterns=null}dispose(){if(this._cachedCompiledPatterns)this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(Z,Y){Y.push(this._match)}compile(Z,Y){return this._getCachedCompiledPatterns(Z).compile(Z)}compileAG(Z,Y,X,J){return this._getCachedCompiledPatterns(Z).compileAG(Z,X,J)}_getCachedCompiledPatterns(Z){if(!this._cachedCompiledPatterns)this._cachedCompiledPatterns=new T0,this.collectPatterns(Z,this._cachedCompiledPatterns);return this._cachedCompiledPatterns}},c5=class extends f0{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(Z,Y,X,J,Q){super(Z,Y,X,J);this.patterns=Q.patterns,this.hasMissingPatterns=Q.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){if(this._cachedCompiledPatterns)this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null}collectPatterns(Z,Y){for(let X of this.patterns)Z.getRule(X).collectPatterns(Z,Y)}compile(Z,Y){return this._getCachedCompiledPatterns(Z).compile(Z)}compileAG(Z,Y,X,J){return this._getCachedCompiledPatterns(Z).compileAG(Z,X,J)}_getCachedCompiledPatterns(Z){if(!this._cachedCompiledPatterns)this._cachedCompiledPatterns=new T0,this.collectPatterns(Z,this._cachedCompiledPatterns);return this._cachedCompiledPatterns}},PX=class extends f0{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(Z,Y,X,J,Q,$,K,W,U,z){super(Z,Y,X,J);this._begin=new b0(Q,this.id),this.beginCaptures=$,this._end=new b0(K?K:"",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=W,this.applyEndPatternLast=U||!1,this.patterns=z.patterns,this.hasMissingPatterns=z.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){if(this._cachedCompiledPatterns)this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(Z,Y){return this._end.resolveBackReferences(Z,Y)}collectPatterns(Z,Y){Y.push(this._begin)}compile(Z,Y){return this._getCachedCompiledPatterns(Z,Y).compile(Z)}compileAG(Z,Y,X,J){return this._getCachedCompiledPatterns(Z,Y).compileAG(Z,X,J)}_getCachedCompiledPatterns(Z,Y){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new T0;for(let X of this.patterns)Z.getRule(X).collectPatterns(Z,this._cachedCompiledPatterns);if(this.applyEndPatternLast)this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end);else this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}if(this._end.hasBackReferences)if(this.applyEndPatternLast)this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,Y);else this._cachedCompiledPatterns.setSource(0,Y);return this._cachedCompiledPatterns}},zY=class extends f0{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(Z,Y,X,J,Q,$,K,W,U){super(Z,Y,X,J);this._begin=new b0(Q,this.id),this.beginCaptures=$,this.whileCaptures=W,this._while=new b0(K,J6),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=U.patterns,this.hasMissingPatterns=U.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){if(this._cachedCompiledPatterns)this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null;if(this._cachedCompiledWhilePatterns)this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(Z,Y){return this._while.resolveBackReferences(Z,Y)}collectPatterns(Z,Y){Y.push(this._begin)}compile(Z,Y){return this._getCachedCompiledPatterns(Z).compile(Z)}compileAG(Z,Y,X,J){return this._getCachedCompiledPatterns(Z).compileAG(Z,X,J)}_getCachedCompiledPatterns(Z){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new T0;for(let Y of this.patterns)Z.getRule(Y).collectPatterns(Z,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(Z,Y){return this._getCachedCompiledWhilePatterns(Z,Y).compile(Z)}compileWhileAG(Z,Y,X,J){return this._getCachedCompiledWhilePatterns(Z,Y).compileAG(Z,X,J)}_getCachedCompiledWhilePatterns(Z,Y){if(!this._cachedCompiledWhilePatterns)this._cachedCompiledWhilePatterns=new T0,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while);if(this._while.hasBackReferences)this._cachedCompiledWhilePatterns.setSource(0,Y?Y:"");return this._cachedCompiledWhilePatterns}},K6=class Z{static createCaptureRule(Y,X,J,Q,$){return Y.registerRule((K)=>{return new Q7(X,K,J,Q,$)})}static getCompiledRuleId(Y,X,J){if(!Y.id)X.registerRule((Q)=>{if(Y.id=Q,Y.match)return new $7(Y.$vscodeTextmateLocation,Y.id,Y.name,Y.match,Z._compileCaptures(Y.captures,X,J));if(typeof Y.begin>"u"){if(Y.repository)J=o5({},J,Y.repository);let $=Y.patterns;if(typeof $>"u"&&Y.include)$=[{include:Y.include}];return new c5(Y.$vscodeTextmateLocation,Y.id,Y.name,Y.contentName,Z._compilePatterns($,X,J))}if(Y.while)return new zY(Y.$vscodeTextmateLocation,Y.id,Y.name,Y.contentName,Y.begin,Z._compileCaptures(Y.beginCaptures||Y.captures,X,J),Y.while,Z._compileCaptures(Y.whileCaptures||Y.captures,X,J),Z._compilePatterns(Y.patterns,X,J));return new PX(Y.$vscodeTextmateLocation,Y.id,Y.name,Y.contentName,Y.begin,Z._compileCaptures(Y.beginCaptures||Y.captures,X,J),Y.end,Z._compileCaptures(Y.endCaptures||Y.captures,X,J),Y.applyEndPatternLast,Z._compilePatterns(Y.patterns,X,J))});return Y.id}static _compileCaptures(Y,X,J){let Q=[];if(Y){let $=0;for(let K in Y){if(K==="$vscodeTextmateLocation")continue;let W=parseInt(K,10);if(W>$)$=W}for(let K=0;K<=$;K++)Q[K]=null;for(let K in Y){if(K==="$vscodeTextmateLocation")continue;let W=parseInt(K,10),U=0;if(Y[K].patterns)U=Z.getCompiledRuleId(Y[K],X,J);Q[W]=Z.createCaptureRule(X,Y[K].$vscodeTextmateLocation,Y[K].name,Y[K].contentName,U)}}return Q}static _compilePatterns(Y,X,J){let Q=[];if(Y)for(let $=0,K=Y.length;$<K;$++){let W=Y[$],U=-1;if(W.include){let z=X6(W.include);switch(z.kind){case 0:case 1:U=Z.getCompiledRuleId(J[W.include],X,J);break;case 2:let H=J[z.ruleName];if(H)U=Z.getCompiledRuleId(H,X,J);break;case 3:case 4:let G=z.scopeName,F=z.kind===4?z.ruleName:null,M=X.getExternalGrammar(G,J);if(M)if(F){let _=M.repository[F];if(_)U=Z.getCompiledRuleId(_,X,M.repository)}else U=Z.getCompiledRuleId(M.repository.$self,X,M.repository);break}}else U=Z.getCompiledRuleId(W,X,J);if(U!==-1){let z=X.getRule(U),H=!1;if(z instanceof c5||z instanceof PX||z instanceof zY){if(z.hasMissingPatterns&&z.patterns.length===0)H=!0}if(H)continue;Q.push(U)}}return{patterns:Q,hasMissingPatterns:(Y?Y.length:0)!==Q.length}}},b0=class Z{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(Y,X){if(Y&&typeof Y==="string"){let J=Y.length,Q=0,$=[],K=!1;for(let W=0;W<J;W++)if(Y.charAt(W)==="\\"){if(W+1<J){let z=Y.charAt(W+1);if(z==="z")$.push(Y.substring(Q,W)),$.push("$(?!\\n)(?<!\\n)"),Q=W+2;else if(z==="A"||z==="G")K=!0;W++}}if(this.hasAnchor=K,Q===0)this.source=Y;else $.push(Y.substring(Q,J)),this.source=$.join("")}else this.hasAnchor=!1,this.source=Y;if(this.hasAnchor)this._anchorCache=this._buildAnchorCache();else this._anchorCache=null;if(this.ruleId=X,typeof this.source==="string")this.hasBackReferences=X7.test(this.source);else this.hasBackReferences=!1}clone(){return new Z(this.source,this.ruleId)}setSource(Y){if(this.source===Y)return;if(this.source=Y,this.hasAnchor)this._anchorCache=this._buildAnchorCache()}resolveBackReferences(Y,X){if(typeof this.source!=="string")throw Error("This method should only be called if the source is a string");let J=X.map((Q)=>{return Y.substring(Q.start,Q.end)});return p5.lastIndex=0,this.source.replace(p5,(Q,$)=>{return t5(J[parseInt($,10)]||"")})}_buildAnchorCache(){if(typeof this.source!=="string")throw Error("This method should only be called if the source is a string");let Y=[],X=[],J=[],Q=[],$,K,W,U;for($=0,K=this.source.length;$<K;$++)if(W=this.source.charAt($),Y[$]=W,X[$]=W,J[$]=W,Q[$]=W,W==="\\"){if($+1<K){if(U=this.source.charAt($+1),U==="A")Y[$+1]="",X[$+1]="",J[$+1]="A",Q[$+1]="A";else if(U==="G")Y[$+1]="",X[$+1]="G",J[$+1]="",Q[$+1]="G";else Y[$+1]=U,X[$+1]=U,J[$+1]=U,Q[$+1]=U;$++}}return{A0_G0:Y.join(""),A0_G1:X.join(""),A1_G0:J.join(""),A1_G1:Q.join("")}}resolveAnchors(Y,X){if(!this.hasAnchor||!this._anchorCache||typeof this.source!=="string")return this.source;if(Y)if(X)return this._anchorCache.A1_G1;else return this._anchorCache.A1_G0;else if(X)return this._anchorCache.A0_G1;else return this._anchorCache.A0_G0}},T0=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){if(this._cached)this._cached.dispose(),this._cached=null;if(this._anchorCache.A0_G0)this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null;if(this._anchorCache.A0_G1)this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null;if(this._anchorCache.A1_G0)this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null;if(this._anchorCache.A1_G1)this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null}push(Z){this._items.push(Z),this._hasAnchors=this._hasAnchors||Z.hasAnchor}unshift(Z){this._items.unshift(Z),this._hasAnchors=this._hasAnchors||Z.hasAnchor}length(){return this._items.length}setSource(Z,Y){if(this._items[Z].source!==Y)this._disposeCaches(),this._items[Z].setSource(Y)}compile(Z){if(!this._cached){let Y=this._items.map((X)=>X.source);this._cached=new d5(Z,Y,this._items.map((X)=>X.ruleId))}return this._cached}compileAG(Z,Y,X){if(!this._hasAnchors)return this.compile(Z);else if(Y)if(X){if(!this._anchorCache.A1_G1)this._anchorCache.A1_G1=this._resolveAnchors(Z,Y,X);return this._anchorCache.A1_G1}else{if(!this._anchorCache.A1_G0)this._anchorCache.A1_G0=this._resolveAnchors(Z,Y,X);return this._anchorCache.A1_G0}else if(X){if(!this._anchorCache.A0_G1)this._anchorCache.A0_G1=this._resolveAnchors(Z,Y,X);return this._anchorCache.A0_G1}else{if(!this._anchorCache.A0_G0)this._anchorCache.A0_G0=this._resolveAnchors(Z,Y,X);return this._anchorCache.A0_G0}}_resolveAnchors(Z,Y,X){let J=this._items.map((Q)=>Q.resolveAnchors(Y,X));return new d5(Z,J,this._items.map((Q)=>Q.ruleId))}},d5=class{constructor(Z,Y,X){this.regExps=Y,this.rules=X,this.scanner=Z.createOnigScanner(Y)}scanner;dispose(){if(typeof this.scanner.dispose==="function")this.scanner.dispose()}toString(){let Z=[];for(let Y=0,X=this.rules.length;Y<X;Y++)Z.push(" - "+this.rules[Y]+": "+this.regExps[Y]);return Z.join(`
|
|
138
|
+
`)}findNextMatchSync(Z,Y,X){let J=this.scanner.findNextMatchSync(Z,Y,X);if(!J)return null;return{ruleId:this.rules[J.index],captureIndices:J.captureIndices}}},AX=class{constructor(Z,Y){this.languageId=Z,this.tokenType=Y}},K7=class Z{_defaultAttributes;_embeddedLanguagesMatcher;constructor(Y,X){this._defaultAttributes=new AX(Y,8),this._embeddedLanguagesMatcher=new W7(Object.entries(X||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(Y){if(Y===null)return Z._NULL_SCOPE_METADATA;return this._getBasicScopeAttributes.get(Y)}static _NULL_SCOPE_METADATA=new AX(0,0);_getBasicScopeAttributes=new e5((Y)=>{let X=this._scopeToLanguage(Y),J=this._toStandardTokenType(Y);return new AX(X,J)});_scopeToLanguage(Y){return this._embeddedLanguagesMatcher.match(Y)||0}_toStandardTokenType(Y){let X=Y.match(Z.STANDARD_TOKEN_TYPE_REGEXP);if(!X)return 8;switch(X[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw Error("Unexpected match for standard token type!")}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},W7=class{values;scopesRegExp;constructor(Z){if(Z.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(Z);let Y=Z.map(([X,J])=>t5(X));Y.sort(),Y.reverse(),this.scopesRegExp=new RegExp(`^((${Y.join(")|(")}))($|\\.)`,"")}}match(Z){if(!this.scopesRegExp)return;let Y=Z.match(this.scopesRegExp);if(!Y)return;return this.values.get(Y[1])}},zO={InDebugMode:typeof process<"u"&&!!process.env.VSCODE_TEXTMATE_DEBUG},W6=!1,l5=class{constructor(Z,Y){this.stack=Z,this.stoppedEarly=Y}};function U6(Z,Y,X,J,Q,$,K,W){let U=Y.content.length,z=!1,H=-1;if(K){let M=U7(Z,Y,X,J,Q,$);Q=M.stack,J=M.linePos,X=M.isFirstLine,H=M.anchorPosition}let G=Date.now();while(!z){if(W!==0){if(Date.now()-G>W)return new l5(Q,!0)}F()}return new l5(Q,!1);function F(){let M=z7(Z,Y,X,J,Q,H);if(!M){$.produce(Q,U),z=!0;return}let{captureIndices:_,matchedRuleId:A}=M,P=_&&_.length>0?_[0].end>J:!1;if(A===J7){let B=Q.getRule(Z);$.produce(Q,_[0].start),Q=Q.withContentNameScopesList(Q.nameScopesList),I0(Z,Y,X,Q,$,B.endCaptures,_),$.produce(Q,_[0].end);let C=Q;if(Q=Q.parent,H=C.getAnchorPos(),!P&&C.getEnterPos()===J){Q=C,$.produce(Q,U),z=!0;return}}else{let B=Z.getRule(A);$.produce(Q,_[0].start);let C=Q,R=B.getName(Y.content,_),D=Q.contentNameScopesList.pushAttributed(R,Z);if(Q=Q.push(A,J,H,_[0].end===U,null,D,D),B instanceof PX){let j=B;I0(Z,Y,X,Q,$,j.beginCaptures,_),$.produce(Q,_[0].end),H=_[0].end;let E=j.getContentName(Y.content,_),c=D.pushAttributed(E,Z);if(Q=Q.withContentNameScopesList(c),j.endHasBackReferences)Q=Q.withEndRule(j.getEndWithResolvedBackReferences(Y.content,_));if(!P&&C.hasSameRuleAs(Q)){Q=Q.pop(),$.produce(Q,U),z=!0;return}}else if(B instanceof zY){let j=B;I0(Z,Y,X,Q,$,j.beginCaptures,_),$.produce(Q,_[0].end),H=_[0].end;let E=j.getContentName(Y.content,_),c=D.pushAttributed(E,Z);if(Q=Q.withContentNameScopesList(c),j.whileHasBackReferences)Q=Q.withEndRule(j.getWhileWithResolvedBackReferences(Y.content,_));if(!P&&C.hasSameRuleAs(Q)){Q=Q.pop(),$.produce(Q,U),z=!0;return}}else if(I0(Z,Y,X,Q,$,B.captures,_),$.produce(Q,_[0].end),Q=Q.pop(),!P){Q=Q.safePop(),$.produce(Q,U),z=!0;return}}if(_[0].end>J)J=_[0].end,X=!1}}function U7(Z,Y,X,J,Q,$){let K=Q.beginRuleCapturedEOL?0:-1,W=[];for(let U=Q;U;U=U.pop()){let z=U.getRule(Z);if(z instanceof zY)W.push({rule:z,stack:U})}for(let U=W.pop();U;U=W.pop()){let{ruleScanner:z,findOptions:H}=O7(U.rule,Z,U.stack.endRule,X,J===K),G=z.findNextMatchSync(Y,J,H);if(G){if(G.ruleId!==J6){Q=U.stack.pop();break}if(G.captureIndices&&G.captureIndices.length){if($.produce(U.stack,G.captureIndices[0].start),I0(Z,Y,X,U.stack,$,U.rule.whileCaptures,G.captureIndices),$.produce(U.stack,G.captureIndices[0].end),K=G.captureIndices[0].end,G.captureIndices[0].end>J)J=G.captureIndices[0].end,X=!1}}else{Q=U.stack.pop();break}}return{stack:Q,linePos:J,anchorPosition:K,isFirstLine:X}}function z7(Z,Y,X,J,Q,$){let K=H7(Z,Y,X,J,Q,$),W=Z.getInjections();if(W.length===0)return K;let U=G7(W,Z,Y,X,J,Q,$);if(!U)return K;if(!K)return U;let z=K.captureIndices[0].start,H=U.captureIndices[0].start;if(H<z||U.priorityMatch&&H===z)return U;return K}function H7(Z,Y,X,J,Q,$){let K=Q.getRule(Z),{ruleScanner:W,findOptions:U}=z6(K,Z,Q.endRule,X,J===$),z=W.findNextMatchSync(Y,J,U);if(z)return{captureIndices:z.captureIndices,matchedRuleId:z.ruleId};return null}function G7(Z,Y,X,J,Q,$,K){let W=Number.MAX_VALUE,U=null,z,H=0,G=$.contentNameScopesList.getScopeNames();for(let F=0,M=Z.length;F<M;F++){let _=Z[F];if(!_.matcher(G))continue;let A=Y.getRule(_.ruleId),{ruleScanner:P,findOptions:B}=z6(A,Y,null,J,Q===K),C=P.findNextMatchSync(X,Q,B);if(!C)continue;let R=C.captureIndices[0].start;if(R>=W)continue;if(W=R,U=C.captureIndices,z=C.ruleId,H=_.priority,W===Q)break}if(U)return{priorityMatch:H===-1,captureIndices:U,matchedRuleId:z};return null}function z6(Z,Y,X,J,Q){if(W6){let K=Z.compile(Y,X),W=H6(J,Q);return{ruleScanner:K,findOptions:W}}return{ruleScanner:Z.compileAG(Y,X,J,Q),findOptions:0}}function O7(Z,Y,X,J,Q){if(W6){let K=Z.compileWhile(Y,X),W=H6(J,Q);return{ruleScanner:K,findOptions:W}}return{ruleScanner:Z.compileWhileAG(Y,X,J,Q),findOptions:0}}function H6(Z,Y){let X=0;if(!Z)X|=1;if(!Y)X|=4;return X}function I0(Z,Y,X,J,Q,$,K){if($.length===0)return;let W=Y.content,U=Math.min($.length,K.length),z=[],H=K[0].end;for(let G=0;G<U;G++){let F=$[G];if(F===null)continue;let M=K[G];if(M.length===0)continue;if(M.start>H)break;while(z.length>0&&z[z.length-1].endPos<=M.start)Q.produceFromScopes(z[z.length-1].scopes,z[z.length-1].endPos),z.pop();if(z.length>0)Q.produceFromScopes(z[z.length-1].scopes,M.start);else Q.produce(J,M.start);if(F.retokenizeCapturedWithRuleId){let A=F.getName(W,K),P=J.contentNameScopesList.pushAttributed(A,Z),B=F.getContentName(W,K),C=P.pushAttributed(B,Z),R=J.push(F.retokenizeCapturedWithRuleId,M.start,-1,!1,null,P,C),D=Z.createOnigString(W.substring(0,M.end));U6(Z,D,X&&M.start===0,M.start,R,Q,!1,0),Y6(D);continue}let _=F.getName(W,K);if(_!==null){let P=(z.length>0?z[z.length-1].scopes:J.contentNameScopesList).pushAttributed(_,Z);z.push(new q7(P,M.end))}}while(z.length>0)Q.produceFromScopes(z[z.length-1].scopes,z[z.length-1].endPos),z.pop()}var q7=class{scopes;endPos;constructor(Z,Y){this.scopes=Z,this.endPos=Y}};function F7(Z,Y,X,J,Q,$,K,W){return new N7(Z,Y,X,J,Q,$,K,W)}function i5(Z,Y,X,J,Q){let $=WY(Y,HY),K=K6.getCompiledRuleId(X,J,Q.repository);for(let W of $)Z.push({debugSelector:Y,matcher:W.matcher,ruleId:K,grammar:Q,priority:W.priority})}function HY(Z,Y){if(Y.length<Z.length)return!1;let X=0;return Z.every((J)=>{for(let Q=X;Q<Y.length;Q++)if(M7(Y[Q],J))return X=Q+1,!0;return!1})}function M7(Z,Y){if(!Z)return!1;if(Z===Y)return!0;let X=Y.length;return Z.length>X&&Z.substr(0,X)===Y&&Z[X]==="."}var N7=class{constructor(Z,Y,X,J,Q,$,K,W){if(this._rootScopeName=Z,this.balancedBracketSelectors=$,this._onigLib=W,this._basicScopeAttributesProvider=new K7(X,J),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=K,this._grammar=r5(Y,null),this._injections=null,this._tokenTypeMatchers=[],Q)for(let U of Object.keys(Q)){let z=WY(U,HY);for(let H of z)this._tokenTypeMatchers.push({matcher:H.matcher,type:Q[U]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(let Z of this._ruleId2desc)if(Z)Z.dispose()}createOnigScanner(Z){return this._onigLib.createOnigScanner(Z)}createOnigString(Z){return this._onigLib.createOnigString(Z)}getMetadataForScope(Z){return this._basicScopeAttributesProvider.getBasicScopeAttributes(Z)}_collectInjections(){let Z={lookup:(Q)=>{if(Q===this._rootScopeName)return this._grammar;return this.getExternalGrammar(Q)},injections:(Q)=>{return this._grammarRepository.injections(Q)}},Y=[],X=this._rootScopeName,J=Z.lookup(X);if(J){let Q=J.injections;if(Q)for(let K in Q)i5(Y,K,Q[K],this,J);let $=this._grammarRepository.injections(X);if($)$.forEach((K)=>{let W=this.getExternalGrammar(K);if(W){let U=W.injectionSelector;if(U)i5(Y,U,W,this,W)}})}return Y.sort((Q,$)=>Q.priority-$.priority),Y}getInjections(){if(this._injections===null)this._injections=this._collectInjections();return this._injections}registerRule(Z){let Y=++this._lastRuleId,X=Z(Q6(Y));return this._ruleId2desc[Y]=X,X}getRule(Z){return this._ruleId2desc[$6(Z)]}getExternalGrammar(Z,Y){if(this._includedGrammars[Z])return this._includedGrammars[Z];else if(this._grammarRepository){let X=this._grammarRepository.lookup(Z);if(X)return this._includedGrammars[Z]=r5(X,Y&&Y.$base),this._includedGrammars[Z]}return}tokenizeLine(Z,Y,X=0){let J=this._tokenize(Z,Y,!1,X);return{tokens:J.lineTokens.getResult(J.ruleStack,J.lineLength),ruleStack:J.ruleStack,stoppedEarly:J.stoppedEarly}}tokenizeLine2(Z,Y,X=0){let J=this._tokenize(Z,Y,!0,X);return{tokens:J.lineTokens.getBinaryResult(J.ruleStack,J.lineLength),ruleStack:J.ruleStack,stoppedEarly:J.stoppedEarly}}_tokenize(Z,Y,X,J){if(this._rootId===-1)this._rootId=K6.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections();let Q;if(!Y||Y===RX.NULL){Q=!0;let z=this._basicScopeAttributesProvider.getDefaultAttributes(),H=this.themeProvider.getDefaults(),G=r4.set(0,z.languageId,z.tokenType,null,H.fontStyle,H.foregroundId,H.backgroundId),F=this.getRule(this._rootId).getName(null,null),M;if(F)M=D0.createRootAndLookUpScopeName(F,G,this);else M=D0.createRoot("unknown",G);Y=new RX(null,this._rootId,-1,-1,!1,null,M,M)}else Q=!1,Y.reset();Z=Z+`
|
|
139
|
+
`;let $=this.createOnigString(Z),K=$.content.length,W=new w7(X,Z,this._tokenTypeMatchers,this.balancedBracketSelectors),U=U6(this,$,Q,0,Y,W,!0,J);return Y6($),{lineLength:K,lineTokens:W,ruleStack:U.stack,stoppedEarly:U.stoppedEarly}}};function r5(Z,Y){return Z=jK(Z),Z.repository=Z.repository||{},Z.repository.$self={$vscodeTextmateLocation:Z.$vscodeTextmateLocation,patterns:Z.patterns,name:Z.scopeName},Z.repository.$base=Y||Z.repository.$self,Z}var D0=class Z{constructor(Y,X,J){this.parent=Y,this.scopePath=X,this.tokenAttributes=J}static fromExtension(Y,X){let J=Y,Q=Y?.scopePath??null;for(let $ of X)Q=wX.push(Q,$.scopeNames),J=new Z(J,Q,$.encodedTokenAttributes);return J}static createRoot(Y,X){return new Z(null,new wX(null,Y),X)}static createRootAndLookUpScopeName(Y,X,J){let Q=J.getMetadataForScope(Y),$=new wX(null,Y),K=J.themeProvider.themeMatch($),W=Z.mergeAttributes(X,Q,K);return new Z(null,$,W)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(Y){return Z.equals(this,Y)}static equals(Y,X){do{if(Y===X)return!0;if(!Y&&!X)return!0;if(!Y||!X)return!1;if(Y.scopeName!==X.scopeName||Y.tokenAttributes!==X.tokenAttributes)return!1;Y=Y.parent,X=X.parent}while(!0)}static mergeAttributes(Y,X,J){let Q=-1,$=0,K=0;if(J!==null)Q=J.fontStyle,$=J.foregroundId,K=J.backgroundId;return r4.set(Y,X.languageId,X.tokenType,null,Q,$,K)}pushAttributed(Y,X){if(Y===null)return this;if(Y.indexOf(" ")===-1)return Z._pushAttributed(this,Y,X);let J=Y.split(/ /g),Q=this;for(let $ of J)Q=Z._pushAttributed(Q,$,X);return Q}static _pushAttributed(Y,X,J){let Q=J.getMetadataForScope(X),$=Y.scopePath.push(X),K=J.themeProvider.themeMatch($),W=Z.mergeAttributes(Y.tokenAttributes,Q,K);return new Z(Y,$,W)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(Y){let X=[],J=this;while(J&&J!==Y)X.push({encodedTokenAttributes:J.tokenAttributes,scopeNames:J.scopePath.getExtensionIfDefined(J.parent?.scopePath??null)}),J=J.parent;return J===Y?X.reverse():void 0}},RX=class Z{constructor(Y,X,J,Q,$,K,W,U){this.parent=Y,this.ruleId=X,this.beginRuleCapturedEOL=$,this.endRule=K,this.nameScopesList=W,this.contentNameScopesList=U,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=J,this._anchorPos=Q}_stackElementBrand=void 0;static NULL=new Z(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(Y){if(Y===null)return!1;return Z._equals(this,Y)}static _equals(Y,X){if(Y===X)return!0;if(!this._structuralEquals(Y,X))return!1;return D0.equals(Y.contentNameScopesList,X.contentNameScopesList)}static _structuralEquals(Y,X){do{if(Y===X)return!0;if(!Y&&!X)return!0;if(!Y||!X)return!1;if(Y.depth!==X.depth||Y.ruleId!==X.ruleId||Y.endRule!==X.endRule)return!1;Y=Y.parent,X=X.parent}while(!0)}clone(){return this}static _reset(Y){while(Y)Y._enterPos=-1,Y._anchorPos=-1,Y=Y.parent}reset(){Z._reset(this)}pop(){return this.parent}safePop(){if(this.parent)return this.parent;return this}push(Y,X,J,Q,$,K,W){return new Z(this,Y,X,J,Q,$,K,W)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(Y){return Y.getRule(this.ruleId)}toString(){let Y=[];return this._writeString(Y,0),"["+Y.join(",")+"]"}_writeString(Y,X){if(this.parent)X=this.parent._writeString(Y,X);return Y[X++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,X}withContentNameScopesList(Y){if(this.contentNameScopesList===Y)return this;return this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,Y)}withEndRule(Y){if(this.endRule===Y)return this;return new Z(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,Y,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(Y){let X=this;while(X&&X._enterPos===Y._enterPos){if(X.ruleId===Y.ruleId)return!0;X=X.parent}return!1}toStateStackFrame(){return{ruleId:$6(this.ruleId),beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(Y,X){let J=D0.fromExtension(Y?.nameScopesList??null,X.nameScopesList);return new Z(Y,Q6(X.ruleId),X.enterPos??-1,X.anchorPos??-1,X.beginRuleCapturedEOL,X.endRule,J,D0.fromExtension(J,X.contentNameScopesList))}},_7=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(Z,Y){this.balancedBracketScopes=Z.flatMap((X)=>{if(X==="*")return this.allowAny=!0,[];return WY(X,HY).map((J)=>J.matcher)}),this.unbalancedBracketScopes=Y.flatMap((X)=>WY(X,HY).map((J)=>J.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(Z){for(let Y of this.unbalancedBracketScopes)if(Y(Z))return!1;for(let Y of this.balancedBracketScopes)if(Y(Z))return!0;return this.allowAny}},w7=class{constructor(Z,Y,X,J){this.balancedBracketSelectors=J,this._emitBinaryTokens=Z,this._tokenTypeOverrides=X,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(Z,Y){this.produceFromScopes(Z.contentNameScopesList,Y)}produceFromScopes(Z,Y){if(this._lastTokenEndIndex>=Y)return;if(this._emitBinaryTokens){let J=Z?.tokenAttributes??0,Q=!1;if(this.balancedBracketSelectors?.matchesAlways)Q=!0;if(this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){let $=Z?.getScopeNames()??[];for(let K of this._tokenTypeOverrides)if(K.matcher($))J=r4.set(J,0,dK(K.type),null,-1,0,0);if(this.balancedBracketSelectors)Q=this.balancedBracketSelectors.match($)}if(Q)J=r4.set(J,0,8,Q,-1,0,0);if(this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===J){this._lastTokenEndIndex=Y;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(J),this._lastTokenEndIndex=Y;return}let X=Z?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:Y,scopes:X}),this._lastTokenEndIndex=Y}getResult(Z,Y){if(this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===Y-1)this._tokens.pop();if(this._tokens.length===0)this._lastTokenEndIndex=-1,this.produce(Z,Y),this._tokens[this._tokens.length-1].startIndex=0;return this._tokens}getBinaryResult(Z,Y){if(this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===Y-1)this._binaryTokens.pop(),this._binaryTokens.pop();if(this._binaryTokens.length===0)this._lastTokenEndIndex=-1,this.produce(Z,Y),this._binaryTokens[this._binaryTokens.length-2]=0;let X=new Uint32Array(this._binaryTokens.length);for(let J=0,Q=this._binaryTokens.length;J<Q;J++)X[J]=this._binaryTokens[J];return X}},A7=class{constructor(Z,Y){this._onigLib=Y,this._theme=Z}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(let Z of this._grammars.values())Z.dispose()}setTheme(Z){this._theme=Z}getColorMap(){return this._theme.getColorMap()}addGrammar(Z,Y){if(this._rawGrammars.set(Z.scopeName,Z),Y)this._injectionGrammars.set(Z.scopeName,Y)}lookup(Z){return this._rawGrammars.get(Z)}injections(Z){return this._injectionGrammars.get(Z)}getDefaults(){return this._theme.getDefaults()}themeMatch(Z){return this._theme.match(Z)}grammarForScopeName(Z,Y,X,J,Q){if(!this._grammars.has(Z)){let $=this._rawGrammars.get(Z);if(!$)return null;this._grammars.set(Z,F7(Z,$,Y,X,J,Q,this,this._onigLib))}return this._grammars.get(Z)}},G6=class{_options;_syncRegistry;_ensureGrammarCache;constructor(Z){this._options=Z,this._syncRegistry=new A7(V0.createFromRawTheme(Z.theme,Z.colorMap),Z.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(Z,Y){this._syncRegistry.setTheme(V0.createFromRawTheme(Z,Y))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(Z,Y,X){return this.loadGrammarWithConfiguration(Z,Y,{embeddedLanguages:X})}loadGrammarWithConfiguration(Z,Y,X){return this._loadGrammar(Z,Y,X.embeddedLanguages,X.tokenTypes,new _7(X.balancedBracketSelectors||[],X.unbalancedBracketSelectors||[]))}loadGrammar(Z){return this._loadGrammar(Z,0,null,null,null)}_loadGrammar(Z,Y,X,J,Q){let $=new nK(this._syncRegistry,Z);while($.Q.length>0)$.Q.map((K)=>this._loadSingleGrammar(K.scopeName)),$.processQueue();return this._grammarForScopeName(Z,Y,X,J,Q)}_loadSingleGrammar(Z){if(!this._ensureGrammarCache.has(Z))this._doLoadSingleGrammar(Z),this._ensureGrammarCache.set(Z,!0)}_doLoadSingleGrammar(Z){let Y=this._options.loadGrammar(Z);if(Y){let X=typeof this._options.getInjections==="function"?this._options.getInjections(Z):void 0;this._syncRegistry.addGrammar(Y,X)}}addGrammar(Z,Y=[],X=0,J=null){return this._syncRegistry.addGrammar(Z,Y),this._grammarForScopeName(Z.scopeName,X,J)}_grammarForScopeName(Z,Y=0,X=null,J=null,Q=null){return this._syncRegistry.grammarForScopeName(Z,Y,X,J,Q)}},GY=RX.NULL;var O6=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class T4{constructor(Z,Y,X){if(this.normal=Y,this.property=Z,X)this.space=X}}T4.prototype.normal={};T4.prototype.property={};T4.prototype.space=void 0;function vX(Z,Y){let X={},J={};for(let Q of Z)Object.assign(X,Q.property),Object.assign(J,Q.normal);return new T4(X,J,Y)}function j0(Z){return Z.toLowerCase()}class AZ{constructor(Z,Y){this.attribute=Y,this.property=Z}}AZ.prototype.attribute="";AZ.prototype.booleanish=!1;AZ.prototype.boolean=!1;AZ.prototype.commaOrSpaceSeparated=!1;AZ.prototype.commaSeparated=!1;AZ.prototype.defined=!1;AZ.prototype.mustUseProperty=!1;AZ.prototype.number=!1;AZ.prototype.overloadedBoolean=!1;AZ.prototype.property="";AZ.prototype.spaceSeparated=!1;AZ.prototype.space=void 0;var S0={};B7(S0,{spaceSeparated:()=>l,overloadedBoolean:()=>OY,number:()=>I,commaSeparated:()=>f4,commaOrSpaceSeparated:()=>fZ,booleanish:()=>XZ,boolean:()=>y});var L7=0,y=o4(),XZ=o4(),OY=o4(),I=o4(),l=o4(),f4=o4(),fZ=o4();function o4(){return 2**++L7}var IX=Object.keys(S0);class O0 extends AZ{constructor(Z,Y,X,J){let Q=-1;super(Z,Y);if(q6(this,"space",J),typeof X==="number")while(++Q<IX.length){let $=IX[Q];q6(this,IX[Q],(X&S0[$])===S0[$])}}}O0.prototype.defined=!0;function q6(Z,Y,X){if(X)Z[Y]=X}function pZ(Z){let Y={},X={};for(let[J,Q]of Object.entries(Z.properties)){let $=new O0(J,Z.transform(Z.attributes||{},J),Q,Z.space);if(Z.mustUseProperty&&Z.mustUseProperty.includes(J))$.mustUseProperty=!0;Y[J]=$,X[j0(J)]=J,X[j0($.attribute)]=J}return new T4(Y,X,Z.space)}var DX=pZ({properties:{ariaActiveDescendant:null,ariaAtomic:XZ,ariaAutoComplete:null,ariaBusy:XZ,ariaChecked:XZ,ariaColCount:I,ariaColIndex:I,ariaColSpan:I,ariaControls:l,ariaCurrent:null,ariaDescribedBy:l,ariaDetails:null,ariaDisabled:XZ,ariaDropEffect:l,ariaErrorMessage:null,ariaExpanded:XZ,ariaFlowTo:l,ariaGrabbed:XZ,ariaHasPopup:null,ariaHidden:XZ,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:l,ariaLevel:I,ariaLive:null,ariaModal:XZ,ariaMultiLine:XZ,ariaMultiSelectable:XZ,ariaOrientation:null,ariaOwns:l,ariaPlaceholder:null,ariaPosInSet:I,ariaPressed:XZ,ariaReadOnly:XZ,ariaRelevant:null,ariaRequired:XZ,ariaRoleDescription:l,ariaRowCount:I,ariaRowIndex:I,ariaRowSpan:I,ariaSelected:XZ,ariaSetSize:I,ariaSort:null,ariaValueMax:I,ariaValueMin:I,ariaValueNow:I,ariaValueText:null,role:null},transform(Z,Y){return Y==="role"?Y:"aria-"+Y.slice(4).toLowerCase()}});function qY(Z,Y){return Y in Z?Z[Y]:Y}function FY(Z,Y){return qY(Z,Y.toLowerCase())}var F6=pZ({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:f4,acceptCharset:l,accessKey:l,action:null,allow:null,allowFullScreen:y,allowPaymentRequest:y,allowUserMedia:y,alt:null,as:null,async:y,autoCapitalize:null,autoComplete:l,autoFocus:y,autoPlay:y,blocking:l,capture:null,charSet:null,checked:y,cite:null,className:l,cols:I,colSpan:null,content:null,contentEditable:XZ,controls:y,controlsList:l,coords:I|f4,crossOrigin:null,data:null,dateTime:null,decoding:null,default:y,defer:y,dir:null,dirName:null,disabled:y,download:OY,draggable:XZ,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:y,formTarget:null,headers:l,height:I,hidden:OY,high:I,href:null,hrefLang:null,htmlFor:l,httpEquiv:l,id:null,imageSizes:null,imageSrcSet:null,inert:y,inputMode:null,integrity:null,is:null,isMap:y,itemId:null,itemProp:l,itemRef:l,itemScope:y,itemType:l,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:y,low:I,manifest:null,max:null,maxLength:I,media:null,method:null,min:null,minLength:I,multiple:y,muted:y,name:null,nonce:null,noModule:y,noValidate:y,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:y,optimum:I,pattern:null,ping:l,placeholder:null,playsInline:y,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:y,referrerPolicy:null,rel:l,required:y,reversed:y,rows:I,rowSpan:I,sandbox:l,scope:null,scoped:y,seamless:y,selected:y,shadowRootClonable:y,shadowRootDelegatesFocus:y,shadowRootMode:null,shape:null,size:I,sizes:null,slot:null,span:I,spellCheck:XZ,src:null,srcDoc:null,srcLang:null,srcSet:null,start:I,step:null,style:null,tabIndex:I,target:null,title:null,translate:null,type:null,typeMustMatch:y,useMap:null,value:XZ,width:I,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:l,axis:null,background:null,bgColor:null,border:I,borderColor:null,bottomMargin:I,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:y,declare:y,event:null,face:null,frame:null,frameBorder:null,hSpace:I,leftMargin:I,link:null,longDesc:null,lowSrc:null,marginHeight:I,marginWidth:I,noResize:y,noHref:y,noShade:y,noWrap:y,object:null,profile:null,prompt:null,rev:null,rightMargin:I,rules:null,scheme:null,scrolling:XZ,standby:null,summary:null,text:null,topMargin:I,valueType:null,version:null,vAlign:null,vLink:null,vSpace:I,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:y,disableRemotePlayback:y,prefix:null,property:null,results:I,security:null,unselectable:null},space:"html",transform:FY});var M6=pZ({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:fZ,accentHeight:I,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:I,amplitude:I,arabicForm:null,ascent:I,attributeName:null,attributeType:null,azimuth:I,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:I,by:null,calcMode:null,capHeight:I,className:l,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:I,diffuseConstant:I,direction:null,display:null,dur:null,divisor:I,dominantBaseline:null,download:y,dx:null,dy:null,edgeMode:null,editable:null,elevation:I,enableBackground:null,end:null,event:null,exponent:I,externalResourcesRequired:null,fill:null,fillOpacity:I,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:f4,g2:f4,glyphName:f4,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:I,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:I,horizOriginX:I,horizOriginY:I,id:null,ideographic:I,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:I,k:I,k1:I,k2:I,k3:I,k4:I,kernelMatrix:fZ,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:I,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:I,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:I,overlineThickness:I,paintOrder:null,panose1:null,path:null,pathLength:I,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:l,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:I,pointsAtY:I,pointsAtZ:I,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:fZ,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:fZ,rev:fZ,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:fZ,requiredFeatures:fZ,requiredFonts:fZ,requiredFormats:fZ,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:I,specularExponent:I,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:I,strikethroughThickness:I,string:null,stroke:null,strokeDashArray:fZ,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:I,strokeOpacity:I,strokeWidth:null,style:null,surfaceScale:I,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:fZ,tabIndex:I,tableValues:null,target:null,targetX:I,targetY:I,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:fZ,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:I,underlineThickness:I,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:I,values:null,vAlphabetic:I,vMathematical:I,vectorEffect:null,vHanging:I,vIdeographic:I,version:null,vertAdvY:I,vertOriginX:I,vertOriginY:I,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:I,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:qY});var VX=pZ({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(Z,Y){return"xlink:"+Y.slice(5).toLowerCase()}});var EX=pZ({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:FY});var bX=pZ({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(Z,Y){return"xml:"+Y.slice(3).toLowerCase()}});var P7=/[A-Z]/g,N6=/-[a-z]/g,R7=/^data[-\w.:]+$/i;function TX(Z,Y){let X=j0(Y),J=Y,Q=AZ;if(X in Z.normal)return Z.property[Z.normal[X]];if(X.length>4&&X.slice(0,4)==="data"&&R7.test(Y)){if(Y.charAt(4)==="-"){let $=Y.slice(5).replace(N6,v7);J="data"+$.charAt(0).toUpperCase()+$.slice(1)}else{let $=Y.slice(4);if(!N6.test($)){let K=$.replace(P7,C7);if(K.charAt(0)!=="-")K="-"+K;Y="data"+K}}Q=O0}return new Q(J,Y)}function C7(Z){return"-"+Z.toLowerCase()}function v7(Z){return Z.charAt(1).toUpperCase()}var _6=vX([DX,F6,VX,EX,bX],"html"),MY=vX([DX,M6,VX,EX,bX],"svg");var w6={}.hasOwnProperty;function A6(Z,Y){let X=Y||{};function J(Q,...$){let{invalid:K,handlers:W}=J;if(Q&&w6.call(Q,Z)){let U=String(Q[Z]);K=w6.call(W,U)?W[U]:J.unknown}if(K)return K.call(this,Q,...$)}return J.handlers=X.handlers||{},J.invalid=X.invalid,J.unknown=X.unknown,J}var I7=/["&'<>`]/g,D7=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,V7=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,E7=/[|\\{}()[\]^$+*?.]/g,B6=new WeakMap;function L6(Z,Y){if(Z=Z.replace(Y.subset?b7(Y.subset):I7,J),Y.subset||Y.escapeOnly)return Z;return Z.replace(D7,X).replace(V7,J);function X(Q,$,K){return Y.format((Q.charCodeAt(0)-55296)*1024+Q.charCodeAt(1)-56320+65536,K.charCodeAt($+2),Y)}function J(Q,$,K){return Y.format(Q.charCodeAt(0),K.charCodeAt($+1),Y)}}function b7(Z){let Y=B6.get(Z);if(!Y)Y=T7(Z),B6.set(Z,Y);return Y}function T7(Z){let Y=[],X=-1;while(++X<Z.length)Y.push(Z[X].replace(E7,"\\$&"));return new RegExp("(?:"+Y.join("|")+")","g")}var f7=/[\dA-Fa-f]/;function P6(Z,Y,X){let J="&#x"+Z.toString(16).toUpperCase();return X&&Y&&!f7.test(String.fromCharCode(Y))?J:J+";"}var j7=/\d/;function R6(Z,Y,X){let J="&#"+String(Z);return X&&Y&&!j7.test(String.fromCharCode(Y))?J:J+";"}var C6=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"];var NY={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"};var v6=["cent","copy","divide","gt","lt","not","para","times"];var I6={}.hasOwnProperty,fX={},_Y;for(_Y in NY)if(I6.call(NY,_Y))fX[NY[_Y]]=_Y;var S7=/[^\dA-Za-z]/;function D6(Z,Y,X,J){let Q=String.fromCharCode(Z);if(I6.call(fX,Q)){let $=fX[Q],K="&"+$;if(X&&C6.includes($)&&!v6.includes($)&&(!J||Y&&Y!==61&&S7.test(String.fromCharCode(Y))))return K;return K+";"}return""}function V6(Z,Y,X){let J=P6(Z,Y,X.omitOptionalSemicolons),Q;if(X.useNamedReferences||X.useShortestReferences)Q=D6(Z,Y,X.omitOptionalSemicolons,X.attribute);if((X.useShortestReferences||!Q)&&X.useShortestReferences){let $=R6(Z,Y,X.omitOptionalSemicolons);if($.length<J.length)J=$}return Q&&(!X.useShortestReferences||Q.length<J.length)?Q:J}function P4(Z,Y){return L6(Z,Object.assign({format:V6},Y))}var y7=/^>|^->|<!--|-->|--!>|<!-$/g,k7=[">"],h7=["<",">"];function E6(Z,Y,X,J){return J.settings.bogusComments?"<?"+P4(Z.value,Object.assign({},J.settings.characterReferences,{subset:k7}))+">":"<!--"+Z.value.replace(y7,Q)+"-->";function Q($){return P4($,Object.assign({},J.settings.characterReferences,{subset:h7}))}}function b6(Z,Y,X,J){return"<!"+(J.settings.upperDoctype?"DOCTYPE":"doctype")+(J.settings.tightDoctype?"":" ")+"html>"}function jX(Z,Y){let X=String(Z);if(typeof Y!=="string")throw TypeError("Expected character");let J=0,Q=X.indexOf(Y);while(Q!==-1)J++,Q=X.indexOf(Y,Q+Y.length);return J}function T6(Z,Y){let X=Y||{};return(Z[Z.length-1]===""?[...Z,""]:Z).join((X.padRight?" ":"")+","+(X.padLeft===!1?"":" ")).trim()}function f6(Z){return Z.join(" ").trim()}var x7=/[ \t\n\f\r]/g;function n4(Z){return typeof Z==="object"?Z.type==="text"?j6(Z.value):!1:j6(Z)}function j6(Z){return Z.replace(x7,"")===""}var $Z=S6(1),SX=S6(-1),g7=[];function S6(Z){return Y;function Y(X,J,Q){let $=X?X.children:g7,K=(J||0)+Z,W=$[K];if(!Q)while(W&&n4(W))K+=Z,W=$[K];return W}}var u7={}.hasOwnProperty;function wY(Z){return Y;function Y(X,J,Q){return u7.call(Z,X.tagName)&&Z[X.tagName](X,J,Q)}}var y0=wY({body:p7,caption:yX,colgroup:yX,dd:i7,dt:l7,head:yX,html:m7,li:d7,optgroup:r7,option:o7,p:c7,rp:y6,rt:y6,tbody:a7,td:k6,tfoot:s7,th:k6,thead:n7,tr:t7});function yX(Z,Y,X){let J=$Z(X,Y,!0);return!J||J.type!=="comment"&&!(J.type==="text"&&n4(J.value.charAt(0)))}function m7(Z,Y,X){let J=$Z(X,Y);return!J||J.type!=="comment"}function p7(Z,Y,X){let J=$Z(X,Y);return!J||J.type!=="comment"}function c7(Z,Y,X){let J=$Z(X,Y);return J?J.type==="element"&&(J.tagName==="address"||J.tagName==="article"||J.tagName==="aside"||J.tagName==="blockquote"||J.tagName==="details"||J.tagName==="div"||J.tagName==="dl"||J.tagName==="fieldset"||J.tagName==="figcaption"||J.tagName==="figure"||J.tagName==="footer"||J.tagName==="form"||J.tagName==="h1"||J.tagName==="h2"||J.tagName==="h3"||J.tagName==="h4"||J.tagName==="h5"||J.tagName==="h6"||J.tagName==="header"||J.tagName==="hgroup"||J.tagName==="hr"||J.tagName==="main"||J.tagName==="menu"||J.tagName==="nav"||J.tagName==="ol"||J.tagName==="p"||J.tagName==="pre"||J.tagName==="section"||J.tagName==="table"||J.tagName==="ul"):!X||!(X.type==="element"&&(X.tagName==="a"||X.tagName==="audio"||X.tagName==="del"||X.tagName==="ins"||X.tagName==="map"||X.tagName==="noscript"||X.tagName==="video"))}function d7(Z,Y,X){let J=$Z(X,Y);return!J||J.type==="element"&&J.tagName==="li"}function l7(Z,Y,X){let J=$Z(X,Y);return Boolean(J&&J.type==="element"&&(J.tagName==="dt"||J.tagName==="dd"))}function i7(Z,Y,X){let J=$Z(X,Y);return!J||J.type==="element"&&(J.tagName==="dt"||J.tagName==="dd")}function y6(Z,Y,X){let J=$Z(X,Y);return!J||J.type==="element"&&(J.tagName==="rp"||J.tagName==="rt")}function r7(Z,Y,X){let J=$Z(X,Y);return!J||J.type==="element"&&J.tagName==="optgroup"}function o7(Z,Y,X){let J=$Z(X,Y);return!J||J.type==="element"&&(J.tagName==="option"||J.tagName==="optgroup")}function n7(Z,Y,X){let J=$Z(X,Y);return Boolean(J&&J.type==="element"&&(J.tagName==="tbody"||J.tagName==="tfoot"))}function a7(Z,Y,X){let J=$Z(X,Y);return!J||J.type==="element"&&(J.tagName==="tbody"||J.tagName==="tfoot")}function s7(Z,Y,X){return!$Z(X,Y)}function t7(Z,Y,X){let J=$Z(X,Y);return!J||J.type==="element"&&J.tagName==="tr"}function k6(Z,Y,X){let J=$Z(X,Y);return!J||J.type==="element"&&(J.tagName==="td"||J.tagName==="th")}var h6=wY({body:Y9,colgroup:X9,head:Z9,html:e7,tbody:J9});function e7(Z){let Y=$Z(Z,-1);return!Y||Y.type!=="comment"}function Z9(Z){let Y=new Set;for(let J of Z.children)if(J.type==="element"&&(J.tagName==="base"||J.tagName==="title")){if(Y.has(J.tagName))return!1;Y.add(J.tagName)}let X=Z.children[0];return!X||X.type==="element"}function Y9(Z){let Y=$Z(Z,-1,!0);return!Y||Y.type!=="comment"&&!(Y.type==="text"&&n4(Y.value.charAt(0)))&&!(Y.type==="element"&&(Y.tagName==="meta"||Y.tagName==="link"||Y.tagName==="script"||Y.tagName==="style"||Y.tagName==="template"))}function X9(Z,Y,X){let J=SX(X,Y),Q=$Z(Z,-1,!0);if(X&&J&&J.type==="element"&&J.tagName==="colgroup"&&y0(J,X.children.indexOf(J),X))return!1;return Boolean(Q&&Q.type==="element"&&Q.tagName==="col")}function J9(Z,Y,X){let J=SX(X,Y),Q=$Z(Z,-1);if(X&&J&&J.type==="element"&&(J.tagName==="thead"||J.tagName==="tbody")&&y0(J,X.children.indexOf(J),X))return!1;return Boolean(Q&&Q.type==="element"&&Q.tagName==="tr")}var AY={name:[[`
|
|
140
140
|
\f\r &/=>`.split(""),`
|
|
141
141
|
\f\r "&'/=>\``.split("")],[`\x00
|
|
142
142
|
\f\r "&'/<=>`.split(""),`\x00
|
|
@@ -144,55 +144,55 @@ Please report this to https://github.com/markedjs/marked.`,Z){let J="<p>An error
|
|
|
144
144
|
\f\r &>`.split(""),`\x00
|
|
145
145
|
\f\r "&'<=>\``.split("")],[`\x00
|
|
146
146
|
\f\r "&'<=>\``.split(""),`\x00
|
|
147
|
-
\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\x00&'".split(""),"\x00\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\x00"&'.split(""),"\x00\"&'`".split("")]]};function b6(Z,Y,X,J){let Q=J.schema,$=Q.space==="svg"?!1:J.settings.omitOptionalTags,K=Q.space==="svg"?J.settings.closeEmptyElements:J.settings.voids.includes(Z.tagName.toLowerCase()),U=[],W;if(Q.space==="html"&&Z.tagName==="svg")J.schema=F0;let z=V7(J,Z.properties),H=J.all(Q.space==="html"&&Z.tagName==="template"?Z.content:Z);if(J.schema=Q,H)K=!1;if(z||!$||!E6(Z,Y,X)){if(U.push("<",Z.tagName,z?" "+z:""),K&&(Q.space==="svg"||J.settings.closeSelfClosing)){if(W=z.charAt(z.length-1),!J.settings.tightSelfClosing||W==="/"||W&&W!=='"'&&W!=="'")U.push(" ");U.push("/")}U.push(">")}if(U.push(H),!K&&(!$||!S4(Z,Y,X)))U.push("</"+Z.tagName+">");return U.join("")}function V7(Z,Y){let X=[],J=-1,Q;if(Y){for(Q in Y)if(Y[Q]!==null&&Y[Q]!==void 0){let $=E7(Z,Q,Y[Q]);if($)X.push($)}}while(++J<X.length){let $=Z.settings.tightAttributes?X[J].charAt(X[J].length-1):void 0;if(J!==X.length-1&&$!=='"'&&$!=="'")X[J]+=" "}return X.join("")}function E7(Z,Y,X){let J=V8(Z.schema,Y),Q=Z.settings.allowParseErrors&&Z.schema.space==="html"?0:1,$=Z.settings.allowDangerousCharacters?0:1,K=Z.quote,U;if(J.overloadedBoolean&&(X===J.attribute||X===""))X=!0;else if((J.boolean||J.overloadedBoolean)&&(typeof X!=="string"||X===J.attribute||X===""))X=Boolean(X);if(X===null||X===void 0||X===!1||typeof X==="number"&&Number.isNaN(X))return"";let W=PY(J.attribute,Object.assign({},Z.settings.characterReferences,{subset:_0.name[Q][$]}));if(X===!0)return W;if(X=Array.isArray(X)?(J.commaSeparated?C6:R6)(X,{padLeft:!Z.settings.tightCommaSeparatedLists}):String(X),Z.settings.collapseEmptyAttributes&&!X)return W;if(Z.settings.preferUnquoted)U=PY(X,Object.assign({},Z.settings.characterReferences,{attribute:!0,subset:_0.unquoted[Q][$]}));if(U!==X){if(Z.settings.quoteSmart&&b8(X,K)>b8(X,Z.alternative))K=Z.alternative;U=K+PY(X,Object.assign({},Z.settings.characterReferences,{subset:(K==="'"?_0.single:_0.double)[Q][$],attribute:!0}))+K}return W+(U?"="+U:U)}var b7=["<","&"];function w0(Z,Y,X,J){return X&&X.type==="element"&&(X.tagName==="script"||X.tagName==="style")?Z.value:PY(Z.value,Object.assign({},J.settings.characterReferences,{subset:b7}))}function T6(Z,Y,X,J){return J.settings.allowDangerousHtml?Z.value:w0(Z,Y,X,J)}function f6(Z,Y,X,J){return J.all(Z)}var j6=G6("type",{invalid:T7,unknown:f7,handlers:{comment:L6,doctype:P6,element:b6,raw:T6,root:f6,text:w0}});function T7(Z){throw Error("Expected node, not `"+Z+"`")}function f7(Z){throw Error("Cannot compile unknown node `"+Z.type+"`")}var j7={},S7={},y7=[];function j8(Z,Y){let X=Y||j7,J=X.quote||'"',Q=J==='"'?"'":'"';if(J!=='"'&&J!=="'")throw Error("Invalid quote `"+J+"`, expected `'` or `\"`");return{one:k7,all:h7,settings:{omitOptionalTags:X.omitOptionalTags||!1,allowParseErrors:X.allowParseErrors||!1,allowDangerousCharacters:X.allowDangerousCharacters||!1,quoteSmart:X.quoteSmart||!1,preferUnquoted:X.preferUnquoted||!1,tightAttributes:X.tightAttributes||!1,upperDoctype:X.upperDoctype||!1,tightDoctype:X.tightDoctype||!1,bogusComments:X.bogusComments||!1,tightCommaSeparatedLists:X.tightCommaSeparatedLists||!1,tightSelfClosing:X.tightSelfClosing||!1,collapseEmptyAttributes:X.collapseEmptyAttributes||!1,allowDangerousHtml:X.allowDangerousHtml||!1,voids:X.voids||Q6,characterReferences:X.characterReferences||S7,closeSelfClosing:X.closeSelfClosing||!1,closeEmptyElements:X.closeEmptyElements||!1},schema:X.space==="svg"?F0:z6,quote:J,alternative:Q}.one(Array.isArray(Z)?{type:"root",children:Z}:Z,void 0,void 0)}function k7(Z,Y,X){return j6(Z,Y,X,this)}function h7(Z){let Y=[],X=Z&&Z.children||y7,J=-1;while(++J<X.length)Y[J]=this.one(X[J],J,Z);return Y.join("")}function B0(Z,Y){let X=typeof Z==="string"?{}:{...Z.colorReplacements},J=typeof Z==="string"?Z:Z.name;for(let[Q,$]of Object.entries(Y?.colorReplacements||{}))if(typeof $==="string")X[Q]=$;else if(Q===J)Object.assign(X,$);return X}function SY(Z,Y){if(!Z)return Z;return Y?.[Z?.toLowerCase()]||Z}function x7(Z){return Array.isArray(Z)?Z:[Z]}async function u6(Z){return Promise.resolve(typeof Z==="function"?Z():Z).then((Y)=>Y.default||Y)}function h8(Z){return!Z||["plaintext","txt","text","plain"].includes(Z)}function m6(Z){return Z==="ansi"||h8(Z)}function x8(Z){return Z==="none"}function p6(Z){return x8(Z)}function d6(Z,Y){if(!Y)return Z;if(Z.properties||={},Z.properties.class||=[],typeof Z.properties.class==="string")Z.properties.class=Z.properties.class.split(/\s+/g);if(!Array.isArray(Z.properties.class))Z.properties.class=[];let X=Array.isArray(Y)?Y:Y.split(/\s+/g);for(let J of X)if(J&&!Z.properties.class.includes(J))Z.properties.class.push(J);return Z}function v0(Z,Y=!1){if(Z.length===0)return[["",0]];let X=Z.split(/(\r?\n)/g),J=0,Q=[];for(let $=0;$<X.length;$+=2){let K=Y?X[$]+(X[$+1]||""):X[$];Q.push([K,J]),J+=X[$].length,J+=X[$+1]?.length||0}return Q}function g7(Z){let Y=v0(Z,!0).map(([Q])=>Q);function X(Q){if(Q===Z.length)return{line:Y.length-1,character:Y[Y.length-1].length};let $=Q,K=0;for(let U of Y){if($<U.length)break;$-=U.length,K++}return{line:K,character:$}}function J(Q,$){let K=0;for(let U=0;U<Q;U++)K+=Y[U].length;return K+=$,K}return{lines:Y,indexToPos:X,posToIndex:J}}function c6(Z,Y,X){let J=new Set;for(let $ of Z.matchAll(/:?lang=["']([^"']+)["']/g)){let K=$[1].toLowerCase().trim();if(K)J.add(K)}for(let $ of Z.matchAll(/(?:```|~~~)([\w-]+)/g)){let K=$[1].toLowerCase().trim();if(K)J.add(K)}for(let $ of Z.matchAll(/\\begin\{([\w-]+)\}/g)){let K=$[1].toLowerCase().trim();if(K)J.add(K)}for(let $ of Z.matchAll(/<script\s+(?:type|lang)=["']([^"']+)["']/gi)){let K=$[1].toLowerCase().trim(),U=K.includes("/")?K.split("/").pop():K;if(U)J.add(U)}if(!X)return Array.from(J);let Q=X.getBundledLanguages();return Array.from(J).filter(($)=>$&&Q[$])}var g8="light-dark()",u7=["color","background-color"];function m7(Z,Y){let X=0,J=[];for(let Q of Y){if(Q>X)J.push({...Z,content:Z.content.slice(X,Q),offset:Z.offset+X});X=Q}if(X<Z.content.length)J.push({...Z,content:Z.content.slice(X),offset:Z.offset+X});return J}function p7(Z,Y){let X=Array.from(Y instanceof Set?Y:new Set(Y)).sort((J,Q)=>J-Q);if(!X.length)return Z;return Z.map((J)=>{return J.flatMap((Q)=>{let $=X.filter((K)=>Q.offset<K&&K<Q.offset+Q.content.length).map((K)=>K-Q.offset).sort((K,U)=>K-U);if(!$.length)return Q;return m7(Q,$)})})}function d7(Z,Y,X,J,Q="css-vars"){let $={content:Z.content,explanation:Z.explanation,offset:Z.offset},K=Y.map((H)=>L0(Z.variants[H])),U=new Set(K.flatMap((H)=>Object.keys(H))),W={},z=(H,G)=>{let F=G==="color"?"":G==="background-color"?"-bg":`-${G}`;return X+Y[H]+(G==="color"?"":F)};return K.forEach((H,G)=>{for(let F of U){let M=H[F]||"inherit";if(G===0&&J&&u7.includes(F))if(J===g8&&K.length>1){let A=Y.findIndex((R)=>R==="light"),w=Y.findIndex((R)=>R==="dark");if(A===-1||w===-1)throw new YZ('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');let P=K[A][F]||"inherit",B=K[w][F]||"inherit";if(W[F]=`light-dark(${P}, ${B})`,Q==="css-vars")W[z(G,F)]=M}else W[F]=M;else if(Q==="css-vars")W[z(G,F)]=M}}),$.htmlStyle=W,$}function L0(Z){let Y={};if(Z.color)Y.color=Z.color;if(Z.bgColor)Y["background-color"]=Z.bgColor;if(Z.fontStyle){if(Z.fontStyle&GZ.Italic)Y["font-style"]="italic";if(Z.fontStyle&GZ.Bold)Y["font-weight"]="bold";let X=[];if(Z.fontStyle&GZ.Underline)X.push("underline");if(Z.fontStyle&GZ.Strikethrough)X.push("line-through");if(X.length)Y["text-decoration"]=X.join(" ")}return Y}function k8(Z){if(typeof Z==="string")return Z;return Object.entries(Z).map(([Y,X])=>`${Y}:${X}`).join(";")}var l6=new WeakMap;function I0(Z,Y){l6.set(Z,Y)}function k4(Z){return l6.get(Z)}class F4{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(Z,Y){return new F4(Object.fromEntries(x7(Y).map((X)=>[X,H0])),Z)}constructor(...Z){if(Z.length===2){let[Y,X]=Z;this.lang=X,this._stacks=Y}else{let[Y,X,J]=Z;this.lang=X,this._stacks={[J]:Y}}}getInternalStack(Z=this.theme){return this._stacks[Z]}getScopes(Z=this.theme){return c7(this._stacks[Z])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}}function c7(Z){let Y=[],X=new Set;function J(Q){if(X.has(Q))return;X.add(Q);let $=Q?.nameScopesList?.scopeName;if($)Y.push($);if(Q.parent)J(Q.parent)}return J(Z),Y}function l7(Z,Y){if(!(Z instanceof F4))throw new YZ("Invalid grammar state");return Z.getInternalStack(Y)}function i7(){let Z=new WeakMap;function Y(X){if(!Z.has(X.meta)){let J=function(K){if(typeof K==="number"){if(K<0||K>X.source.length)throw new YZ(`Invalid decoration offset: ${K}. Code length: ${X.source.length}`);return{...Q.indexToPos(K),offset:K}}else{let U=Q.lines[K.line];if(U===void 0)throw new YZ(`Invalid decoration position ${JSON.stringify(K)}. Lines length: ${Q.lines.length}`);let W=K.character;if(W<0)W=U.length+W;if(W<0||W>U.length)throw new YZ(`Invalid decoration position ${JSON.stringify(K)}. Line ${K.line} length: ${U.length}`);return{...K,character:W,offset:Q.posToIndex(K.line,W)}}},Q=g7(X.source),$=(X.options.decorations||[]).map((K)=>({...K,start:J(K.start),end:J(K.end)}));r7($),Z.set(X.meta,{decorations:$,converter:Q,source:X.source})}return Z.get(X.meta)}return{name:"shiki:decorations",tokens(X){if(!this.options.decorations?.length)return;let Q=Y(this).decorations.flatMap((K)=>[K.start.offset,K.end.offset]);return p7(X,Q)},code(X){if(!this.options.decorations?.length)return;let J=Y(this),Q=Array.from(X.children).filter((H)=>H.type==="element"&&H.tagName==="span");if(Q.length!==J.converter.lines.length)throw new YZ(`Number of lines in code element (${Q.length}) does not match the number of lines in the source (${J.converter.lines.length}). Failed to apply decorations.`);function $(H,G,F,M){let A=Q[H],w="",P=-1,B=-1;if(G===0)P=0;if(F===0)B=0;if(F===Number.POSITIVE_INFINITY)B=A.children.length;if(P===-1||B===-1)for(let C=0;C<A.children.length;C++){if(w+=i6(A.children[C]),P===-1&&w.length===G)P=C+1;if(B===-1&&w.length===F)B=C+1}if(P===-1)throw new YZ(`Failed to find start index for decoration ${JSON.stringify(M.start)}`);if(B===-1)throw new YZ(`Failed to find end index for decoration ${JSON.stringify(M.end)}`);let R=A.children.slice(P,B);if(!M.alwaysWrap&&R.length===A.children.length)U(A,M,"line");else if(!M.alwaysWrap&&R.length===1&&R[0].type==="element")U(R[0],M,"token");else{let C={type:"element",tagName:"span",properties:{},children:R};U(C,M,"wrapper"),A.children.splice(P,R.length,C)}}function K(H,G){Q[H]=U(Q[H],G,"line")}function U(H,G,F){let M=G.properties||{},A=G.transform||((w)=>w);if(H.tagName=G.tagName||"span",H.properties={...H.properties,...M,class:H.properties.class},G.properties?.class)d6(H,G.properties.class);return H=A(H,F)||H,H}let W=[],z=J.decorations.sort((H,G)=>G.start.offset-H.start.offset||H.end.offset-G.end.offset);for(let H of z){let{start:G,end:F}=H;if(G.line===F.line)$(G.line,G.character,F.character,H);else if(G.line<F.line){$(G.line,G.character,Number.POSITIVE_INFINITY,H);for(let M=G.line+1;M<F.line;M++)W.unshift(()=>K(M,H));$(F.line,0,F.character,H)}}W.forEach((H)=>H())}}}function r7(Z){for(let Y=0;Y<Z.length;Y++){let X=Z[Y];if(X.start.offset>X.end.offset)throw new YZ(`Invalid decoration range: ${JSON.stringify(X.start)} - ${JSON.stringify(X.end)}`);for(let J=Y+1;J<Z.length;J++){let Q=Z[J],$=X.start.offset<=Q.start.offset&&Q.start.offset<X.end.offset,K=X.start.offset<Q.end.offset&&Q.end.offset<=X.end.offset,U=Q.start.offset<=X.start.offset&&X.start.offset<Q.end.offset,W=Q.start.offset<X.end.offset&&X.end.offset<=Q.end.offset;if($||K||U||W){if($&&K)continue;if(U&&W)continue;if(U&&X.start.offset===X.end.offset)continue;if(K&&Q.start.offset===Q.end.offset)continue;throw new YZ(`Decorations ${JSON.stringify(X.start)} and ${JSON.stringify(Q.start)} intersect.`)}}}}function i6(Z){if(Z.type==="text")return Z.value;if(Z.type==="element")return Z.children.map(i6).join("");return""}var o7=[i7()];function P0(Z){let Y=n7(Z.transformers||[]);return[...Y.pre,...Y.normal,...Y.post,...o7]}function n7(Z){let Y=[],X=[],J=[];for(let Q of Z)switch(Q.enforce){case"pre":Y.push(Q);break;case"post":X.push(Q);break;default:J.push(Q)}return{pre:Y,post:X,normal:J}}var sY=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],S8={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function a7(Z,Y){let X=Z.indexOf("\x1B",Y);if(X!==-1){if(Z[X+1]==="["){let J=Z.indexOf("m",X);if(J!==-1)return{sequence:Z.substring(X+2,J).split(";"),startPosition:X,position:J+1}}}return{position:Z.length}}function S6(Z){let Y=Z.shift();if(Y==="2"){let X=Z.splice(0,3).map((J)=>Number.parseInt(J));if(X.length!==3||X.some((J)=>Number.isNaN(J)))return;return{type:"rgb",rgb:X}}else if(Y==="5"){let X=Z.shift();if(X)return{type:"table",index:Number(X)}}}function s7(Z){let Y=[];while(Z.length>0){let X=Z.shift();if(!X)continue;let J=Number.parseInt(X);if(Number.isNaN(J))continue;if(J===0)Y.push({type:"resetAll"});else if(J<=9){if(S8[J])Y.push({type:"setDecoration",value:S8[J]})}else if(J<=29){let Q=S8[J-20];if(Q){if(Y.push({type:"resetDecoration",value:Q}),Q==="dim")Y.push({type:"resetDecoration",value:"bold"})}}else if(J<=37)Y.push({type:"setForegroundColor",value:{type:"named",name:sY[J-30]}});else if(J===38){let Q=S6(Z);if(Q)Y.push({type:"setForegroundColor",value:Q})}else if(J===39)Y.push({type:"resetForegroundColor"});else if(J<=47)Y.push({type:"setBackgroundColor",value:{type:"named",name:sY[J-40]}});else if(J===48){let Q=S6(Z);if(Q)Y.push({type:"setBackgroundColor",value:Q})}else if(J===49)Y.push({type:"resetBackgroundColor"});else if(J===53)Y.push({type:"setDecoration",value:"overline"});else if(J===55)Y.push({type:"resetDecoration",value:"overline"});else if(J>=90&&J<=97)Y.push({type:"setForegroundColor",value:{type:"named",name:sY[J-90+8]}});else if(J>=100&&J<=107)Y.push({type:"setBackgroundColor",value:{type:"named",name:sY[J-100+8]}})}return Y}function t7(){let Z=null,Y=null,X=new Set;return{parse(J){let Q=[],$=0;do{let K=a7(J,$),U=K.sequence?J.substring($,K.startPosition):J.substring($);if(U.length>0)Q.push({value:U,foreground:Z,background:Y,decorations:new Set(X)});if(K.sequence){let W=s7(K.sequence);for(let z of W)if(z.type==="resetAll")Z=null,Y=null,X.clear();else if(z.type==="resetForegroundColor")Z=null;else if(z.type==="resetBackgroundColor")Y=null;else if(z.type==="resetDecoration")X.delete(z.value);for(let z of W)if(z.type==="setForegroundColor")Z=z.value;else if(z.type==="setBackgroundColor")Y=z.value;else if(z.type==="setDecoration")X.add(z.value)}$=K.position}while($<J.length);return Q}}}var e7={black:"#000000",red:"#bb0000",green:"#00bb00",yellow:"#bbbb00",blue:"#0000bb",magenta:"#ff00ff",cyan:"#00bbbb",white:"#eeeeee",brightBlack:"#555555",brightRed:"#ff5555",brightGreen:"#00ff00",brightYellow:"#ffff55",brightBlue:"#5555ff",brightMagenta:"#ff55ff",brightCyan:"#55ffff",brightWhite:"#ffffff"};function Z9(Z=e7){function Y(U){return Z[U]}function X(U){return`#${U.map((W)=>Math.max(0,Math.min(W,255)).toString(16).padStart(2,"0")).join("")}`}let J;function Q(){if(J)return J;J=[];for(let z=0;z<sY.length;z++)J.push(Y(sY[z]));let U=[0,95,135,175,215,255];for(let z=0;z<6;z++)for(let H=0;H<6;H++)for(let G=0;G<6;G++)J.push(X([U[z],U[H],U[G]]));let W=8;for(let z=0;z<24;z++,W+=10)J.push(X([W,W,W]));return J}function $(U){return Q()[U]}function K(U){switch(U.type){case"named":return Y(U.name);case"rgb":return X(U.rgb);case"table":return $(U.index)}}return{value:K}}var Y9={black:"#000000",red:"#cd3131",green:"#0DBC79",yellow:"#E5E510",blue:"#2472C8",magenta:"#BC3FBC",cyan:"#11A8CD",white:"#E5E5E5",brightBlack:"#666666",brightRed:"#F14C4C",brightGreen:"#23D18B",brightYellow:"#F5F543",brightBlue:"#3B8EEA",brightMagenta:"#D670D6",brightCyan:"#29B8DB",brightWhite:"#FFFFFF"};function X9(Z,Y,X){let J=B0(Z,X),Q=v0(Y),$=Object.fromEntries(sY.map((W)=>{let z=`terminal.ansi${W[0].toUpperCase()}${W.substring(1)}`,H=Z.colors?.[z];return[W,H||Y9[W]]})),K=Z9($),U=t7();return Q.map((W)=>U.parse(W[0]).map((z)=>{let H,G;if(z.decorations.has("reverse"))H=z.background?K.value(z.background):Z.bg,G=z.foreground?K.value(z.foreground):Z.fg;else H=z.foreground?K.value(z.foreground):Z.fg,G=z.background?K.value(z.background):void 0;if(H=SY(H,J),G=SY(G,J),z.decorations.has("dim"))H=J9(H);let F=GZ.None;if(z.decorations.has("bold"))F|=GZ.Bold;if(z.decorations.has("italic"))F|=GZ.Italic;if(z.decorations.has("underline"))F|=GZ.Underline;if(z.decorations.has("strikethrough"))F|=GZ.Strikethrough;return{content:z.value,offset:W[1],color:H,bgColor:G,fontStyle:F}}))}function J9(Z){let Y=Z.match(/#([0-9a-f]{3,8})/i);if(Y){let J=Y[1];if(J.length===8){let Q=Math.round(Number.parseInt(J.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${J.slice(0,6)}${Q}`}else if(J.length===6)return`#${J}80`;else if(J.length===4){let Q=J[0],$=J[1],K=J[2],U=J[3],W=Math.round(Number.parseInt(`${U}${U}`,16)/2).toString(16).padStart(2,"0");return`#${Q}${Q}${$}${$}${K}${K}${W}`}else if(J.length===3){let Q=J[0],$=J[1],K=J[2];return`#${Q}${Q}${$}${$}${K}${K}80`}}let X=Z.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);if(X)return`var(${X[1]}-dim)`;return Z}function u8(Z,Y,X={}){let{theme:J=Z.getLoadedThemes()[0]}=X,Q=Z.resolveLangAlias(X.lang||"text");if(h8(Q)||x8(J))return v0(Y).map((W)=>[{content:W[0],offset:W[1]}]);let{theme:$,colorMap:K}=Z.setTheme(J);if(Q==="ansi")return X9($,Y,X);let U=Z.getLanguage(X.lang||"text");if(X.grammarState){if(X.grammarState.lang!==U.name)throw new YZ(`Grammar state language "${X.grammarState.lang}" does not match highlight language "${U.name}"`);if(!X.grammarState.themes.includes($.name))throw new YZ(`Grammar state themes "${X.grammarState.themes}" do not contain highlight theme "${$.name}"`)}return $9(Y,U,$,K,X)}function Q9(...Z){if(Z.length===2)return k4(Z[1]);let[Y,X,J={}]=Z,{lang:Q="text",theme:$=Y.getLoadedThemes()[0]}=J;if(h8(Q)||x8($))throw new YZ("Plain language does not have grammar state");if(Q==="ansi")throw new YZ("ANSI language does not have grammar state");let{theme:K,colorMap:U}=Y.setTheme($),W=Y.getLanguage(Q);return new F4(m8(X,W,K,U,J).stateStack,W.name,K.name)}function $9(Z,Y,X,J,Q){let $=m8(Z,Y,X,J,Q),K=new F4($.stateStack,Y.name,X.name);return I0($.tokens,K),$.tokens}function m8(Z,Y,X,J,Q){let $=B0(X,Q),{tokenizeMaxLineLength:K=0,tokenizeTimeLimit:U=500}=Q,W=v0(Z),z=Q.grammarState?l7(Q.grammarState,X.name)??H0:Q.grammarContextCode!=null?m8(Q.grammarContextCode,Y,X,J,{...Q,grammarState:void 0,grammarContextCode:void 0}).stateStack:H0,H=[],G=[];for(let F=0,M=W.length;F<M;F++){let[A,w]=W[F];if(A===""){H=[],G.push([]);continue}if(K>0&&A.length>=K){H=[],G.push([{content:A,offset:w,color:"",fontStyle:0}]);continue}let P,B,R;if(Q.includeExplanation)P=Y.tokenizeLine(A,z,U),B=P.tokens,R=0;let C=Y.tokenizeLine2(A,z,U),D=C.tokens.length/2;for(let j=0;j<D;j++){let E=C.tokens[2*j],d=j+1<D?C.tokens[2*j+2]:A.length;if(E===d)continue;let i=C.tokens[2*j+1],g=SY(J[oY.getForeground(i)],$),r=oY.getFontStyle(i),o={content:A.substring(E,d),offset:w+E,color:g,fontStyle:r};if(Q.includeExplanation){let FY=[];if(Q.includeExplanation!=="scopeName")for(let xZ of X.settings){let xY;switch(typeof xZ.scope){case"string":xY=xZ.scope.split(/,/).map((VY)=>VY.trim());break;case"object":xY=xZ.scope;break;default:continue}FY.push({settings:xZ,selectors:xY.map((VY)=>VY.split(/ /))})}o.explanation=[];let MY=0;while(E+MY<d){let xZ=B[R],xY=A.substring(xZ.startIndex,xZ.endIndex);MY+=xY.length,o.explanation.push({content:xY,scopes:Q.includeExplanation==="scopeName"?K9(xZ.scopes):W9(FY,xZ.scopes)}),R+=1}}H.push(o)}G.push(H),H=[],z=C.ruleStack}return{tokens:G,stateStack:z}}function K9(Z){return Z.map((Y)=>({scopeName:Y}))}function W9(Z,Y){let X=[];for(let J=0,Q=Y.length;J<Q;J++){let $=Y[J];X[J]={scopeName:$,themeMatches:z9(Z,$,Y.slice(0,J))}}return X}function y6(Z,Y){return Z===Y||Y.substring(0,Z.length)===Z&&Y[Z.length]==="."}function U9(Z,Y,X){if(!y6(Z[Z.length-1],Y))return!1;let J=Z.length-2,Q=X.length-1;while(J>=0&&Q>=0){if(y6(Z[J],X[Q]))J-=1;Q-=1}if(J===-1)return!0;return!1}function z9(Z,Y,X){let J=[];for(let{selectors:Q,settings:$}of Z)for(let K of Q)if(U9(K,Y,X)){J.push($);break}return J}function r6(Z,Y,X){let J=Object.entries(X.themes).filter((W)=>W[1]).map((W)=>({color:W[0],theme:W[1]})),Q=J.map((W)=>{let z=u8(Z,Y,{...X,theme:W.theme}),H=k4(z),G=typeof W.theme==="string"?W.theme:W.theme.name;return{tokens:z,state:H,theme:G}}),$=H9(...Q.map((W)=>W.tokens)),K=$[0].map((W,z)=>W.map((H,G)=>{let F={content:H.content,variants:{},offset:H.offset};if("includeExplanation"in X&&X.includeExplanation)F.explanation=H.explanation;return $.forEach((M,A)=>{let{content:w,explanation:P,offset:B,...R}=M[z][G];F.variants[J[A].color]=R}),F})),U=Q[0].state?new F4(Object.fromEntries(Q.map((W)=>[W.theme,W.state?.getInternalStack(W.theme)])),Q[0].state.lang):void 0;if(U)I0(K,U);return K}function H9(...Z){let Y=Z.map(()=>[]),X=Z.length;for(let J=0;J<Z[0].length;J++){let Q=Z.map((W)=>W[J]),$=Y.map(()=>[]);Y.forEach((W,z)=>W.push($[z]));let K=Q.map(()=>0),U=Q.map((W)=>W[0]);while(U.every((W)=>W)){let W=Math.min(...U.map((z)=>z.content.length));for(let z=0;z<X;z++){let H=U[z];if(H.content.length===W)$[z].push(H),K[z]+=1,U[z]=Q[z][K[z]];else $[z].push({...H,content:H.content.slice(0,W)}),U[z]={...H,content:H.content.slice(W),offset:H.offset+W}}}}return Y}function C0(Z,Y,X){let J,Q,$,K,U,W;if("themes"in X){let{defaultColor:z="light",cssVariablePrefix:H="--shiki-",colorsRendering:G="css-vars"}=X,F=Object.entries(X.themes).filter((B)=>B[1]).map((B)=>({color:B[0],theme:B[1]})).sort((B,R)=>B.color===z?-1:R.color===z?1:0);if(F.length===0)throw new YZ("`themes` option must not be empty");let M=r6(Z,Y,X);if(W=k4(M),z&&g8!==z&&!F.find((B)=>B.color===z))throw new YZ(`\`themes\` option must contain the defaultColor key \`${z}\``);let A=F.map((B)=>Z.getTheme(B.theme)),w=F.map((B)=>B.color);if($=M.map((B)=>B.map((R)=>d7(R,w,H,z,G))),W)I0($,W);let P=F.map((B)=>B0(B.theme,X));Q=k6(F,A,P,H,z,"fg",G),J=k6(F,A,P,H,z,"bg",G),K=`shiki-themes ${A.map((B)=>B.name).join(" ")}`,U=z?void 0:[Q,J].join(";")}else if("theme"in X){let z=B0(X.theme,X);$=u8(Z,Y,X);let H=Z.getTheme(X.theme);J=SY(H.bg,z),Q=SY(H.fg,z),K=H.name,W=k4($)}else throw new YZ("Invalid options, either `theme` or `themes` must be provided");return{tokens:$,fg:Q,bg:J,themeName:K,rootStyle:U,grammarState:W}}function k6(Z,Y,X,J,Q,$,K){return Z.map((U,W)=>{let z=SY(Y[W][$],X[W])||"inherit",H=`${J+U.color}${$==="bg"?"-bg":""}:${z}`;if(W===0&&Q){if(Q===g8&&Z.length>1){let G=Z.findIndex((w)=>w.color==="light"),F=Z.findIndex((w)=>w.color==="dark");if(G===-1||F===-1)throw new YZ('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');let M=SY(Y[G][$],X[G])||"inherit",A=SY(Y[F][$],X[F])||"inherit";return`light-dark(${M}, ${A});${H}`}return z}if(K==="css-vars")return H;return null}).filter((U)=>!!U).join(";")}function R0(Z,Y,X,J={meta:{},options:X,codeToHast:(Q,$)=>R0(Z,Q,$),codeToTokens:(Q,$)=>C0(Z,Q,$)}){let Q=Y;for(let A of P0(X))Q=A.preprocess?.call(J,Q,X)||Q;let{tokens:$,fg:K,bg:U,themeName:W,rootStyle:z,grammarState:H}=C0(Z,Q,X),{mergeWhitespaces:G=!0,mergeSameStyleTokens:F=!1}=X;if(G===!0)$=O9($);else if(G==="never")$=q9($);if(F)$=F9($);let M={...J,get source(){return Q}};for(let A of P0(X))$=A.tokens?.call(M,$)||$;return G9($,{...X,fg:K,bg:U,themeName:W,rootStyle:X.rootStyle===!1?!1:X.rootStyle??z},M,H)}function G9(Z,Y,X,J=k4(Z)){let Q=P0(Y),$=[],K={type:"root",children:[]},{structure:U="classic",tabindex:W="0"}=Y,z={class:`shiki ${Y.themeName||""}`};if(Y.rootStyle!==!1)if(Y.rootStyle!=null)z.style=Y.rootStyle;else z.style=`background-color:${Y.bg};color:${Y.fg}`;if(W!==!1&&W!=null)z.tabindex=W.toString();for(let[w,P]of Object.entries(Y.meta||{}))if(!w.startsWith("_"))z[w]=P;let H={type:"element",tagName:"pre",properties:z,children:[],data:Y.data},G={type:"element",tagName:"code",properties:{},children:$},F=[],M={...X,structure:U,addClassToHast:d6,get source(){return X.source},get tokens(){return Z},get options(){return Y},get root(){return K},get pre(){return H},get code(){return G},get lines(){return F}};if(Z.forEach((w,P)=>{if(P){if(U==="inline")K.children.push({type:"element",tagName:"br",properties:{},children:[]});else if(U==="classic")$.push({type:"text",value:`
|
|
148
|
-
`})}let B={type:"element",tagName:"span",properties:{class:"line"},children:[]},R=0;for(let C of w){let D={type:"element",tagName:"span",properties:{...C.htmlAttrs},children:[{type:"text",value:C.content}]},j=k8(C.htmlStyle||L0(C));if(j)D.properties.style=j;for(let E of Q)D=E?.span?.call(M,D,P+1,R,B,C)||D;if(U==="inline")K.children.push(D);else if(U==="classic")B.children.push(D);R+=C.content.length}if(U==="classic"){for(let C of Q)B=C?.line?.call(M,B,P+1)||B;F.push(B),$.push(B)}else if(U==="inline")F.push(B)}),U==="classic"){for(let w of Q)G=w?.code?.call(M,G)||G;H.children.push(G);for(let w of Q)H=w?.pre?.call(M,H)||H;K.children.push(H)}else if(U==="inline"){let w=[],P={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(let C of K.children)if(C.type==="element"&&C.tagName==="br")w.push(P),P={type:"element",tagName:"span",properties:{class:"line"},children:[]};else if(C.type==="element"||C.type==="text")P.children.push(C);w.push(P);let R={type:"element",tagName:"code",properties:{},children:w};for(let C of Q)R=C?.code?.call(M,R)||R;K.children=[];for(let C=0;C<R.children.length;C++){if(C>0)K.children.push({type:"element",tagName:"br",properties:{},children:[]});let D=R.children[C];if(D.type==="element")K.children.push(...D.children)}}let A=K;for(let w of Q)A=w?.root?.call(M,A)||A;if(J)I0(A,J);return A}function O9(Z){return Z.map((Y)=>{let X=[],J="",Q;return Y.forEach(($,K)=>{let W=!($.fontStyle&&($.fontStyle&GZ.Underline||$.fontStyle&GZ.Strikethrough));if(W&&$.content.match(/^\s+$/)&&Y[K+1]){if(Q===void 0)Q=$.offset;J+=$.content}else if(J){if(W)X.push({...$,offset:Q,content:J+$.content});else X.push({content:J,offset:Q},$);Q=void 0,J=""}else X.push($)}),X})}function q9(Z){return Z.map((Y)=>{return Y.flatMap((X)=>{if(X.content.match(/^\s+$/))return X;let J=X.content.match(/^(\s*)(.*?)(\s*)$/);if(!J)return X;let[,Q,$,K]=J;if(!Q&&!K)return X;let U=[{...X,offset:X.offset+Q.length,content:$}];if(Q)U.unshift({content:Q,offset:X.offset});if(K)U.push({content:K,offset:X.offset+Q.length+$.length});return U})})}function F9(Z){return Z.map((Y)=>{let X=[];for(let J of Y){if(X.length===0){X.push({...J});continue}let Q=X[X.length-1],$=k8(Q.htmlStyle||L0(Q)),K=k8(J.htmlStyle||L0(J)),U=Q.fontStyle&&(Q.fontStyle&GZ.Underline||Q.fontStyle&GZ.Strikethrough),W=J.fontStyle&&(J.fontStyle&GZ.Underline||J.fontStyle&GZ.Strikethrough);if(!U&&!W&&$===K)Q.content+=J.content;else X.push({...J})}return X})}var M9=j8;function N9(Z,Y,X){let J={meta:{},options:X,codeToHast:($,K)=>R0(Z,$,K),codeToTokens:($,K)=>C0(Z,$,K)},Q=M9(R0(Z,Y,X,J));for(let $ of P0(X))Q=$.postprocess?.call(J,Q,X)||Q;return Q}var h6={light:"#333333",dark:"#bbbbbb"},x6={light:"#fffffe",dark:"#1e1e1e"},g6="__shiki_resolved";function p8(Z){if(Z?.[g6])return Z;let Y={...Z};if(Y.tokenColors&&!Y.settings)Y.settings=Y.tokenColors,delete Y.tokenColors;Y.type||="dark",Y.colorReplacements={...Y.colorReplacements},Y.settings||=[];let{bg:X,fg:J}=Y;if(!X||!J){let U=Y.settings?Y.settings.find((W)=>!W.name&&!W.scope):void 0;if(U?.settings?.foreground)J=U.settings.foreground;if(U?.settings?.background)X=U.settings.background;if(!J&&Y?.colors?.["editor.foreground"])J=Y.colors["editor.foreground"];if(!X&&Y?.colors?.["editor.background"])X=Y.colors["editor.background"];if(!J)J=Y.type==="light"?h6.light:h6.dark;if(!X)X=Y.type==="light"?x6.light:x6.dark;Y.fg=J,Y.bg=X}if(!(Y.settings[0]&&Y.settings[0].settings&&!Y.settings[0].scope))Y.settings.unshift({settings:{foreground:Y.fg,background:Y.bg}});let Q=0,$=new Map;function K(U){if($.has(U))return $.get(U);Q+=1;let W=`#${Q.toString(16).padStart(8,"0").toLowerCase()}`;if(Y.colorReplacements?.[`#${W}`])return K(U);return $.set(U,W),W}Y.settings=Y.settings.map((U)=>{let W=U.settings?.foreground&&!U.settings.foreground.startsWith("#"),z=U.settings?.background&&!U.settings.background.startsWith("#");if(!W&&!z)return U;let H={...U,settings:{...U.settings}};if(W){let G=K(U.settings.foreground);Y.colorReplacements[G]=U.settings.foreground,H.settings.foreground=G}if(z){let G=K(U.settings.background);Y.colorReplacements[G]=U.settings.background,H.settings.background=G}return H});for(let U of Object.keys(Y.colors||{}))if(U==="editor.foreground"||U==="editor.background"||U.startsWith("terminal.ansi")){if(!Y.colors[U]?.startsWith("#")){let W=K(Y.colors[U]);Y.colorReplacements[W]=Y.colors[U],Y.colors[U]=W}}return Object.defineProperty(Y,g6,{enumerable:!1,writable:!1,value:!0}),Y}async function o6(Z){return Array.from(new Set((await Promise.all(Z.filter((Y)=>!m6(Y)).map(async(Y)=>await u6(Y).then((X)=>Array.isArray(X)?X:[X])))).flat()))}async function n6(Z){return(await Promise.all(Z.map(async(X)=>p6(X)?null:p8(await u6(X))))).filter((X)=>!!X)}var y8=3,A9=!1;function _9(Z,Y=3){if(!y8)return;if(typeof y8==="number"&&Y>y8)return;if(A9)throw Error(`[SHIKI DEPRECATE]: ${Z}`);else console.trace(`[SHIKI DEPRECATE]: ${Z}`)}class tY extends Error{constructor(Z){super(Z);this.name="ShikiError"}}function a6(Z,Y){if(!Y)return Z;if(Y[Z]){let X=new Set([Z]);while(Y[Z]){if(Z=Y[Z],X.has(Z))throw new tY(`Circular alias \`${Array.from(X).join(" -> ")} -> ${Z}\``);X.add(Z)}}return Z}class s6 extends J6{constructor(Z,Y,X,J={}){super(Z);this._resolver=Z,this._themes=Y,this._langs=X,this._alias=J,this._themes.map((Q)=>this.loadTheme(Q)),this.loadLanguages(this._langs)}_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;getTheme(Z){if(typeof Z==="string")return this._resolvedThemes.get(Z);else return this.loadTheme(Z)}loadTheme(Z){let Y=p8(Z);if(Y.name)this._resolvedThemes.set(Y.name,Y),this._loadedThemesCache=null;return Y}getLoadedThemes(){if(!this._loadedThemesCache)this._loadedThemesCache=[...this._resolvedThemes.keys()];return this._loadedThemesCache}setTheme(Z){let Y=this._textmateThemeCache.get(Z);if(!Y)Y=D4.createFromRawTheme(Z),this._textmateThemeCache.set(Z,Y);this._syncRegistry.setTheme(Y)}getGrammar(Z){return Z=a6(Z,this._alias),this._resolvedGrammars.get(Z)}loadLanguage(Z){if(this.getGrammar(Z.name))return;let Y=new Set([...this._langMap.values()].filter((Q)=>Q.embeddedLangsLazy?.includes(Z.name)));this._resolver.addLanguage(Z);let X={balancedBracketSelectors:Z.balancedBracketSelectors||["*"],unbalancedBracketSelectors:Z.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(Z.scopeName,Z);let J=this.loadGrammarWithConfiguration(Z.scopeName,1,X);if(J.name=Z.name,this._resolvedGrammars.set(Z.name,J),Z.aliases)Z.aliases.forEach((Q)=>{this._alias[Q]=Z.name});if(this._loadedLanguagesCache=null,Y.size)for(let Q of Y)this._resolvedGrammars.delete(Q.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(Q.scopeName),this._syncRegistry?._grammars?.delete(Q.scopeName),this.loadLanguage(this._langMap.get(Q.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(Z){for(let J of Z)this.resolveEmbeddedLanguages(J);let Y=Array.from(this._langGraph.entries()),X=Y.filter(([J,Q])=>!Q);if(X.length){let J=Y.filter(([Q,$])=>{if(!$)return!1;return($.embeddedLanguages||$.embeddedLangs)?.some((U)=>X.map(([W])=>W).includes(U))}).filter((Q)=>!X.includes(Q));throw new tY(`Missing languages ${X.map(([Q])=>`\`${Q}\``).join(", ")}, required by ${J.map(([Q])=>`\`${Q}\``).join(", ")}`)}for(let[J,Q]of Y)this._resolver.addLanguage(Q);for(let[J,Q]of Y)this.loadLanguage(Q)}getLoadedLanguages(){if(!this._loadedLanguagesCache)this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])];return this._loadedLanguagesCache}resolveEmbeddedLanguages(Z){this._langMap.set(Z.name,Z),this._langGraph.set(Z.name,Z);let Y=Z.embeddedLanguages??Z.embeddedLangs;if(Y)for(let X of Y)this._langGraph.set(X,this._langMap.get(X))}}class t6{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(Z,Y){this._onigLib={createOnigScanner:(X)=>Z.createScanner(X),createOnigString:(X)=>Z.createString(X)},Y.forEach((X)=>this.addLanguage(X))}get onigLib(){return this._onigLib}getLangRegistration(Z){return this._langs.get(Z)}loadGrammar(Z){return this._scopeToLang.get(Z)}addLanguage(Z){if(this._langs.set(Z.name,Z),Z.aliases)Z.aliases.forEach((Y)=>{this._langs.set(Y,Z)});if(this._scopeToLang.set(Z.scopeName,Z),Z.injectTo)Z.injectTo.forEach((Y)=>{if(!this._injections.get(Y))this._injections.set(Y,[]);this._injections.get(Y).push(Z.scopeName)})}getInjections(Z){let Y=Z.split("."),X=[];for(let J=1;J<=Y.length;J++){let Q=Y.slice(0,J).join(".");X=[...X,...this._injections.get(Q)||[]]}return X}}var y4=0;function w9(Z){if(y4+=1,Z.warnings!==!1&&y4>=10&&y4%10===0)console.warn(`[Shiki] ${y4} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let Y=!1;if(!Z.engine)throw new tY("`engine` option is required for synchronous mode");let X=(Z.langs||[]).flat(1),J=(Z.themes||[]).flat(1).map(p8),Q=new t6(Z.engine,X),$=new s6(Q,J,X,Z.langAlias),K;function U(C){return a6(C,Z.langAlias)}function W(C){B();let D=$.getGrammar(typeof C==="string"?C:C.name);if(!D)throw new tY(`Language \`${C}\` not found, you may need to load it first`);return D}function z(C){if(C==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};B();let D=$.getTheme(C);if(!D)throw new tY(`Theme \`${C}\` not found, you may need to load it first`);return D}function H(C){B();let D=z(C);if(K!==C)$.setTheme(D),K=C;let j=$.getColorMap();return{theme:D,colorMap:j}}function G(){return B(),$.getLoadedThemes()}function F(){return B(),$.getLoadedLanguages()}function M(...C){B(),$.loadLanguages(C.flat(1))}async function A(...C){return M(await o6(C))}function w(...C){B();for(let D of C.flat(1))$.loadTheme(D)}async function P(...C){return B(),w(await n6(C))}function B(){if(Y)throw new tY("Shiki instance has been disposed")}function R(){if(Y)return;Y=!0,$.dispose(),y4-=1}return{setTheme:H,getTheme:z,getLanguage:W,getLoadedThemes:G,getLoadedLanguages:F,resolveLangAlias:U,loadLanguage:A,loadLanguageSync:M,loadTheme:P,loadThemeSync:w,dispose:R,[Symbol.dispose]:R}}async function B9(Z){if(!Z.engine)_9("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[Y,X,J]=await Promise.all([n6(Z.themes||[]),o6(Z.langs||[]),Z.engine]);return w9({...Z,themes:Y,langs:X,engine:J})}async function L9(Z){let Y=await B9(Z);return{getLastGrammarState:(...X)=>Q9(Y,...X),codeToTokensBase:(X,J)=>u8(Y,X,J),codeToTokensWithThemes:(X,J)=>r6(Y,X,J),codeToTokens:(X,J)=>C0(Y,X,J),codeToHast:(X,J)=>R0(Y,X,J),codeToHtml:(X,J)=>N9(Y,X,J),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...Y,getInternalContext:()=>Y}}function e6(Z){let{langs:Y,themes:X,engine:J}=Z;async function Q($){function K(G){if(typeof G==="string"){if(G=$.langAlias?.[G]||G,m6(G))return[];let F=Y[G];if(!F)throw new YZ(`Language \`${G}\` is not included in this bundle. You may want to load it from external source.`);return F}return G}function U(G){if(p6(G))return"none";if(typeof G==="string"){let F=X[G];if(!F)throw new YZ(`Theme \`${G}\` is not included in this bundle. You may want to load it from external source.`);return F}return G}let W=($.themes??[]).map((G)=>U(G)),z=($.langs??[]).map((G)=>K(G)),H=await L9({engine:$.engine??J(),...$,themes:W,langs:z});return{...H,loadLanguage(...G){return H.loadLanguage(...G.map(K))},loadTheme(...G){return H.loadTheme(...G.map(U))},getBundledLanguages(){return Y},getBundledThemes(){return X}}}return Q}function P9(Z){let Y;async function X(J={}){if(!Y){Y=Z({...J,themes:[],langs:[]});let Q=await Y;return await Promise.all([Q.loadTheme(...J.themes||[]),Q.loadLanguage(...J.langs||[])]),Q}else{let Q=await Y;return await Promise.all([Q.loadTheme(...J.themes||[]),Q.loadLanguage(...J.langs||[])]),Q}}return X}function Z1(Z,Y){let X=P9(Z);async function J(Q,$){let K=await X({langs:[$.lang],themes:"theme"in $?[$.theme]:Object.values($.themes)}),U=await Y?.guessEmbeddedLanguages?.(Q,$.lang,K);if(U)await K.loadLanguage(...U);return K}return{getSingletonHighlighter(Q){return X(Q)},async codeToHtml(Q,$){return(await J(Q,$)).codeToHtml(Q,$)},async codeToHast(Q,$){return(await J(Q,$)).codeToHast(Q,$)},async codeToTokens(Q,$){return(await J(Q,$)).codeToTokens(Q,$)},async codeToTokensBase(Q,$){return(await J(Q,$)).codeToTokensBase(Q,$)},async codeToTokensWithThemes(Q,$){return(await J(Q,$)).codeToTokensWithThemes(Q,$)},async getLastGrammarState(Q,$){return(await X({langs:[$.lang],themes:[$.theme]})).getLastGrammarState(Q,$)}}}var Y1=[{id:"abap",name:"ABAP",import:()=>import("./chunk-8fzw4gqz.js")},{id:"actionscript-3",name:"ActionScript",import:()=>import("./chunk-0y6jq0a0.js")},{id:"ada",name:"Ada",import:()=>import("./chunk-p8pfkf84.js")},{id:"angular-html",name:"Angular HTML",import:()=>import("./chunk-bwvxp5dp.js")},{id:"angular-ts",name:"Angular TypeScript",import:()=>import("./chunk-yyr27vj3.js")},{id:"apache",name:"Apache Conf",import:()=>import("./chunk-a1s72wx6.js")},{id:"apex",name:"Apex",import:()=>import("./chunk-3f6xf4mm.js")},{id:"apl",name:"APL",import:()=>import("./chunk-yzgwn422.js")},{id:"applescript",name:"AppleScript",import:()=>import("./chunk-6fzgq7sb.js")},{id:"ara",name:"Ara",import:()=>import("./chunk-qddn1sea.js")},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:()=>import("./chunk-6dat5vvb.js")},{id:"asm",name:"Assembly",import:()=>import("./chunk-m0k36mwn.js")},{id:"astro",name:"Astro",import:()=>import("./chunk-3pzth5e2.js")},{id:"awk",name:"AWK",import:()=>import("./chunk-7wnxdt11.js")},{id:"ballerina",name:"Ballerina",import:()=>import("./chunk-54j5njdj.js")},{id:"bat",name:"Batch File",aliases:["batch"],import:()=>import("./chunk-zgyww0w8.js")},{id:"beancount",name:"Beancount",import:()=>import("./chunk-33xp86w3.js")},{id:"berry",name:"Berry",aliases:["be"],import:()=>import("./chunk-vg1dem7m.js")},{id:"bibtex",name:"BibTeX",import:()=>import("./chunk-35ncgr15.js")},{id:"bicep",name:"Bicep",import:()=>import("./chunk-s4ksgmax.js")},{id:"blade",name:"Blade",import:()=>import("./chunk-zwhbdwnt.js")},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:()=>import("./chunk-dxyv2b1c.js")},{id:"c",name:"C",import:()=>import("./chunk-s237yqg5.js")},{id:"c3",name:"C3",import:()=>import("./chunk-4g2gfvyd.js")},{id:"cadence",name:"Cadence",aliases:["cdc"],import:()=>import("./chunk-daahmb61.js")},{id:"cairo",name:"Cairo",import:()=>import("./chunk-5q1qtbx4.js")},{id:"clarity",name:"Clarity",import:()=>import("./chunk-8kt765dh.js")},{id:"clojure",name:"Clojure",aliases:["clj"],import:()=>import("./chunk-fsqndb8n.js")},{id:"cmake",name:"CMake",import:()=>import("./chunk-nq1k5tw4.js")},{id:"cobol",name:"COBOL",import:()=>import("./chunk-s6qt552a.js")},{id:"codeowners",name:"CODEOWNERS",import:()=>import("./chunk-j3c65h0m.js")},{id:"codeql",name:"CodeQL",aliases:["ql"],import:()=>import("./chunk-10stn7rc.js")},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:()=>import("./chunk-8kk9kv6s.js")},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:()=>import("./chunk-131cad67.js")},{id:"coq",name:"Coq",import:()=>import("./chunk-j2vek58t.js")},{id:"cpp",name:"C++",aliases:["c++"],import:()=>import("./chunk-0dvy62vd.js")},{id:"crystal",name:"Crystal",import:()=>import("./chunk-vpbyhd1b.js")},{id:"csharp",name:"C#",aliases:["c#","cs"],import:()=>import("./chunk-87s313qe.js")},{id:"css",name:"CSS",import:()=>import("./chunk-kephawnc.js")},{id:"csv",name:"CSV",import:()=>import("./chunk-gz0bg0j5.js")},{id:"cue",name:"CUE",import:()=>import("./chunk-vxzy50p0.js")},{id:"cypher",name:"Cypher",aliases:["cql"],import:()=>import("./chunk-pdfvchxr.js")},{id:"d",name:"D",import:()=>import("./chunk-5kns073z.js")},{id:"dart",name:"Dart",import:()=>import("./chunk-18k4wz02.js")},{id:"dax",name:"DAX",import:()=>import("./chunk-vrjcy7h1.js")},{id:"desktop",name:"Desktop",import:()=>import("./chunk-tfqwrnhz.js")},{id:"diff",name:"Diff",import:()=>import("./chunk-g0c5mmdz.js")},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:()=>import("./chunk-ajxzbnbp.js")},{id:"dotenv",name:"dotEnv",import:()=>import("./chunk-1w5vehgm.js")},{id:"dream-maker",name:"Dream Maker",import:()=>import("./chunk-9dse3mh2.js")},{id:"edge",name:"Edge",import:()=>import("./chunk-2mb0trr0.js")},{id:"elixir",name:"Elixir",import:()=>import("./chunk-bkan2fr3.js")},{id:"elm",name:"Elm",import:()=>import("./chunk-bj4851d8.js")},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:()=>import("./chunk-yynk0bam.js")},{id:"erb",name:"ERB",import:()=>import("./chunk-ftc3mh9t.js")},{id:"erlang",name:"Erlang",aliases:["erl"],import:()=>import("./chunk-by1h1fy3.js")},{id:"fennel",name:"Fennel",import:()=>import("./chunk-jmp4rprf.js")},{id:"fish",name:"Fish",import:()=>import("./chunk-b9s35wb6.js")},{id:"fluent",name:"Fluent",aliases:["ftl"],import:()=>import("./chunk-zv3jegxm.js")},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:()=>import("./chunk-0b5e8zpy.js")},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:()=>import("./chunk-txdyy4ya.js")},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:()=>import("./chunk-nay5m04y.js")},{id:"gdresource",name:"GDResource",aliases:["tscn","tres"],import:()=>import("./chunk-a5k1t6aj.js")},{id:"gdscript",name:"GDScript",aliases:["gd"],import:()=>import("./chunk-t49vbac9.js")},{id:"gdshader",name:"GDShader",import:()=>import("./chunk-3b63e6mc.js")},{id:"genie",name:"Genie",import:()=>import("./chunk-mkzpj7ht.js")},{id:"gherkin",name:"Gherkin",import:()=>import("./chunk-2xr9jk3t.js")},{id:"git-commit",name:"Git Commit Message",import:()=>import("./chunk-mnxav3bw.js")},{id:"git-rebase",name:"Git Rebase Message",import:()=>import("./chunk-9skn642s.js")},{id:"gleam",name:"Gleam",import:()=>import("./chunk-6r8jhnde.js")},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:()=>import("./chunk-645r8yk7.js")},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:()=>import("./chunk-kbaz8s34.js")},{id:"glsl",name:"GLSL",import:()=>import("./chunk-2xrccbwa.js")},{id:"gn",name:"GN",import:()=>import("./chunk-4cg3jh38.js")},{id:"gnuplot",name:"Gnuplot",import:()=>import("./chunk-ky2zgpqq.js")},{id:"go",name:"Go",import:()=>import("./chunk-skh4rx0s.js")},{id:"graphql",name:"GraphQL",aliases:["gql"],import:()=>import("./chunk-5gjt4v98.js")},{id:"groovy",name:"Groovy",import:()=>import("./chunk-hqhqqe9q.js")},{id:"hack",name:"Hack",import:()=>import("./chunk-3mjwhvpy.js")},{id:"haml",name:"Ruby Haml",import:()=>import("./chunk-2yrz4qdk.js")},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:()=>import("./chunk-kwhma00c.js")},{id:"haskell",name:"Haskell",aliases:["hs"],import:()=>import("./chunk-2kqs0amy.js")},{id:"haxe",name:"Haxe",import:()=>import("./chunk-bc95nfbs.js")},{id:"hcl",name:"HashiCorp HCL",import:()=>import("./chunk-z578v7vz.js")},{id:"hjson",name:"Hjson",import:()=>import("./chunk-t6bb31dn.js")},{id:"hlsl",name:"HLSL",import:()=>import("./chunk-8n9e3wbs.js")},{id:"html",name:"HTML",import:()=>import("./chunk-4mj1r6nd.js")},{id:"html-derivative",name:"HTML (Derivative)",import:()=>import("./chunk-xqhnnbfr.js")},{id:"http",name:"HTTP",import:()=>import("./chunk-tv25zrtk.js")},{id:"hurl",name:"Hurl",import:()=>import("./chunk-r53nsqbh.js")},{id:"hxml",name:"HXML",import:()=>import("./chunk-sbcw8d8z.js")},{id:"hy",name:"Hy",import:()=>import("./chunk-sy7vf5c5.js")},{id:"imba",name:"Imba",import:()=>import("./chunk-9xtq15gy.js")},{id:"ini",name:"INI",aliases:["properties"],import:()=>import("./chunk-1ek0xjkr.js")},{id:"java",name:"Java",import:()=>import("./chunk-y7qk76sv.js")},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:()=>import("./chunk-vcbgawge.js")},{id:"jinja",name:"Jinja",import:()=>import("./chunk-x6je1qsq.js")},{id:"jison",name:"Jison",import:()=>import("./chunk-9qtsjepd.js")},{id:"json",name:"JSON",import:()=>import("./chunk-h77takma.js")},{id:"json5",name:"JSON5",import:()=>import("./chunk-yd3vzgxs.js")},{id:"jsonc",name:"JSON with Comments",import:()=>import("./chunk-jeavnd8g.js")},{id:"jsonl",name:"JSON Lines",import:()=>import("./chunk-6jdfap4a.js")},{id:"jsonnet",name:"Jsonnet",import:()=>import("./chunk-rnpfchb9.js")},{id:"jssm",name:"JSSM",aliases:["fsl"],import:()=>import("./chunk-9n2ge60j.js")},{id:"jsx",name:"JSX",import:()=>import("./chunk-kzafnaxn.js")},{id:"julia",name:"Julia",aliases:["jl"],import:()=>import("./chunk-en2d49a7.js")},{id:"kdl",name:"KDL",import:()=>import("./chunk-srtwf73c.js")},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:()=>import("./chunk-satxmrvx.js")},{id:"kusto",name:"Kusto",aliases:["kql"],import:()=>import("./chunk-87w588zd.js")},{id:"latex",name:"LaTeX",import:()=>import("./chunk-b79d73fy.js")},{id:"lean",name:"Lean 4",aliases:["lean4"],import:()=>import("./chunk-xkvnfywa.js")},{id:"less",name:"Less",import:()=>import("./chunk-jwtpf45z.js")},{id:"liquid",name:"Liquid",import:()=>import("./chunk-n4s96jdz.js")},{id:"llvm",name:"LLVM IR",import:()=>import("./chunk-zv0nefnm.js")},{id:"log",name:"Log file",import:()=>import("./chunk-kkk1k414.js")},{id:"logo",name:"Logo",import:()=>import("./chunk-v667b8k4.js")},{id:"lua",name:"Lua",import:()=>import("./chunk-5hcvm27y.js")},{id:"luau",name:"Luau",import:()=>import("./chunk-gt6xd3pb.js")},{id:"make",name:"Makefile",aliases:["makefile"],import:()=>import("./chunk-f4cn2y4x.js")},{id:"markdown",name:"Markdown",aliases:["md"],import:()=>import("./chunk-3zf20ctr.js")},{id:"marko",name:"Marko",import:()=>import("./chunk-04mq56m4.js")},{id:"matlab",name:"MATLAB",import:()=>import("./chunk-vs72fgve.js")},{id:"mdc",name:"MDC",import:()=>import("./chunk-fyay9ztg.js")},{id:"mdx",name:"MDX",import:()=>import("./chunk-d20g16c2.js")},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:()=>import("./chunk-mttnv195.js")},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:()=>import("./chunk-5xhjmcrr.js")},{id:"mojo",name:"Mojo",import:()=>import("./chunk-kz78gsrq.js")},{id:"moonbit",name:"MoonBit",aliases:["mbt","mbti"],import:()=>import("./chunk-54ya969p.js")},{id:"move",name:"Move",import:()=>import("./chunk-9xcz69sj.js")},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:()=>import("./chunk-sjkk13dd.js")},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:()=>import("./chunk-55pfd4pp.js")},{id:"nginx",name:"Nginx",import:()=>import("./chunk-a07p1cfs.js")},{id:"nim",name:"Nim",import:()=>import("./chunk-zq5ncapf.js")},{id:"nix",name:"Nix",import:()=>import("./chunk-zf96st2f.js")},{id:"nushell",name:"nushell",aliases:["nu"],import:()=>import("./chunk-4w4ezegn.js")},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:()=>import("./chunk-6wbgc1xz.js")},{id:"objective-cpp",name:"Objective-C++",import:()=>import("./chunk-m5rj1w7e.js")},{id:"ocaml",name:"OCaml",import:()=>import("./chunk-hd39y2wf.js")},{id:"odin",name:"Odin",import:()=>import("./chunk-35bvsa6m.js")},{id:"openscad",name:"OpenSCAD",aliases:["scad"],import:()=>import("./chunk-5pt6e5bh.js")},{id:"pascal",name:"Pascal",import:()=>import("./chunk-w4kh5s54.js")},{id:"perl",name:"Perl",import:()=>import("./chunk-dtha8g8n.js")},{id:"php",name:"PHP",import:()=>import("./chunk-khd8ds90.js")},{id:"pkl",name:"Pkl",import:()=>import("./chunk-jk42e7d2.js")},{id:"plsql",name:"PL/SQL",import:()=>import("./chunk-sexnhyqf.js")},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:()=>import("./chunk-xtrkc4bn.js")},{id:"polar",name:"Polar",import:()=>import("./chunk-xg586hyh.js")},{id:"postcss",name:"PostCSS",import:()=>import("./chunk-a22ebaj5.js")},{id:"powerquery",name:"PowerQuery",import:()=>import("./chunk-mwqg224k.js")},{id:"powershell",name:"PowerShell",aliases:["ps","ps1"],import:()=>import("./chunk-q9wkyq6a.js")},{id:"prisma",name:"Prisma",import:()=>import("./chunk-7wqcxfc4.js")},{id:"prolog",name:"Prolog",import:()=>import("./chunk-f7rxszbz.js")},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:()=>import("./chunk-jv8shhgk.js")},{id:"pug",name:"Pug",aliases:["jade"],import:()=>import("./chunk-5c13nrde.js")},{id:"puppet",name:"Puppet",import:()=>import("./chunk-xxwnet5y.js")},{id:"purescript",name:"PureScript",import:()=>import("./chunk-wkvnhk36.js")},{id:"python",name:"Python",aliases:["py"],import:()=>import("./chunk-mgkmr3xy.js")},{id:"qml",name:"QML",import:()=>import("./chunk-b3s0bcp6.js")},{id:"qmldir",name:"QML Directory",import:()=>import("./chunk-d7b0m60j.js")},{id:"qss",name:"Qt Style Sheets",import:()=>import("./chunk-p57dfnmm.js")},{id:"r",name:"R",import:()=>import("./chunk-ynjy01zm.js")},{id:"racket",name:"Racket",import:()=>import("./chunk-v6nssgv7.js")},{id:"raku",name:"Raku",aliases:["perl6"],import:()=>import("./chunk-1ja6becj.js")},{id:"razor",name:"ASP.NET Razor",import:()=>import("./chunk-7jy1478y.js")},{id:"reg",name:"Windows Registry Script",import:()=>import("./chunk-wp436n3r.js")},{id:"regexp",name:"RegExp",aliases:["regex"],import:()=>import("./chunk-jn4wgzaz.js")},{id:"rel",name:"Rel",import:()=>import("./chunk-9b45fe34.js")},{id:"riscv",name:"RISC-V",import:()=>import("./chunk-yj3fncjn.js")},{id:"ron",name:"RON",import:()=>import("./chunk-8vsqygpz.js")},{id:"rosmsg",name:"ROS Interface",import:()=>import("./chunk-16jx4h98.js")},{id:"rst",name:"reStructuredText",import:()=>import("./chunk-5eg3bn3m.js")},{id:"ruby",name:"Ruby",aliases:["rb"],import:()=>import("./chunk-vdd1xyrt.js")},{id:"rust",name:"Rust",aliases:["rs"],import:()=>import("./chunk-dee62n5c.js")},{id:"sas",name:"SAS",import:()=>import("./chunk-9a6kwz9e.js")},{id:"sass",name:"Sass",import:()=>import("./chunk-sdr9ywjt.js")},{id:"scala",name:"Scala",import:()=>import("./chunk-v6faz3vj.js")},{id:"scheme",name:"Scheme",import:()=>import("./chunk-9rks3bc7.js")},{id:"scss",name:"SCSS",import:()=>import("./chunk-kz9rfhe3.js")},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:()=>import("./chunk-9xp471ze.js")},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:()=>import("./chunk-583jqck6.js")},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:()=>import("./chunk-a0jc9gfw.js")},{id:"shellsession",name:"Shell Session",aliases:["console"],import:()=>import("./chunk-exj3mryv.js")},{id:"smalltalk",name:"Smalltalk",import:()=>import("./chunk-h1j74efh.js")},{id:"solidity",name:"Solidity",import:()=>import("./chunk-brcvpmwp.js")},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:()=>import("./chunk-3xfw5w0d.js")},{id:"sparql",name:"SPARQL",import:()=>import("./chunk-51rhc5g1.js")},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:()=>import("./chunk-9as23fmk.js")},{id:"sql",name:"SQL",import:()=>import("./chunk-j9bkjc22.js")},{id:"ssh-config",name:"SSH Config",import:()=>import("./chunk-n3e766aj.js")},{id:"stata",name:"Stata",import:()=>import("./chunk-95963acy.js")},{id:"stylus",name:"Stylus",aliases:["styl"],import:()=>import("./chunk-q2qcexv0.js")},{id:"surrealql",name:"SurrealQL",aliases:["surql"],import:()=>import("./chunk-10qr9jk1.js")},{id:"svelte",name:"Svelte",import:()=>import("./chunk-dn2fe6a4.js")},{id:"swift",name:"Swift",import:()=>import("./chunk-07em03a3.js")},{id:"system-verilog",name:"SystemVerilog",import:()=>import("./chunk-b6xdt5xb.js")},{id:"systemd",name:"Systemd Units",import:()=>import("./chunk-n9yfs19q.js")},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:()=>import("./chunk-x866vcqf.js")},{id:"tasl",name:"Tasl",import:()=>import("./chunk-g1r86637.js")},{id:"tcl",name:"Tcl",import:()=>import("./chunk-j4c847h3.js")},{id:"templ",name:"Templ",import:()=>import("./chunk-j7dazkh4.js")},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:()=>import("./chunk-ntc51kg0.js")},{id:"tex",name:"TeX",import:()=>import("./chunk-pht0yvya.js")},{id:"toml",name:"TOML",import:()=>import("./chunk-x0xaw21f.js")},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:()=>import("./chunk-3k4101h5.js")},{id:"tsv",name:"TSV",import:()=>import("./chunk-en6q3h2k.js")},{id:"tsx",name:"TSX",import:()=>import("./chunk-svcy27ht.js")},{id:"turtle",name:"Turtle",import:()=>import("./chunk-29tmghhd.js")},{id:"twig",name:"Twig",import:()=>import("./chunk-g1z6k96z.js")},{id:"typescript",name:"TypeScript",aliases:["ts","cts","mts"],import:()=>import("./chunk-fsh8c4gw.js")},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:()=>import("./chunk-xkfzt78k.js")},{id:"typst",name:"Typst",aliases:["typ"],import:()=>import("./chunk-t7qx43hg.js")},{id:"v",name:"V",import:()=>import("./chunk-1yq51mb3.js")},{id:"vala",name:"Vala",import:()=>import("./chunk-cypczp4s.js")},{id:"vb",name:"Visual Basic",aliases:["cmd"],import:()=>import("./chunk-my5y2p5a.js")},{id:"verilog",name:"Verilog",import:()=>import("./chunk-01tsa9cq.js")},{id:"vhdl",name:"VHDL",import:()=>import("./chunk-c04rr3mc.js")},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:()=>import("./chunk-74j5prfv.js")},{id:"vue",name:"Vue",import:()=>import("./chunk-zgnjqvkp.js")},{id:"vue-html",name:"Vue HTML",import:()=>import("./chunk-6tf8wacp.js")},{id:"vue-vine",name:"Vue Vine",import:()=>import("./chunk-46ac6010.js")},{id:"vyper",name:"Vyper",aliases:["vy"],import:()=>import("./chunk-ggwb349q.js")},{id:"wasm",name:"WebAssembly",import:()=>import("./chunk-jva13pdt.js")},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:()=>import("./chunk-2p664mgv.js")},{id:"wgsl",name:"WGSL",import:()=>import("./chunk-dne3hqde.js")},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:()=>import("./chunk-4k9xgsq4.js")},{id:"wit",name:"WebAssembly Interface Types",import:()=>import("./chunk-sd9rvjt6.js")},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:()=>import("./chunk-46bmfch2.js")},{id:"xml",name:"XML",import:()=>import("./chunk-vfwh7m86.js")},{id:"xsl",name:"XSL",import:()=>import("./chunk-fg2zmrdg.js")},{id:"yaml",name:"YAML",aliases:["yml"],import:()=>import("./chunk-4h4fdqy9.js")},{id:"zenscript",name:"ZenScript",import:()=>import("./chunk-t3q0fpe0.js")},{id:"zig",name:"Zig",import:()=>import("./chunk-2cj25dc6.js")}],C9=Object.fromEntries(Y1.map((Z)=>[Z.id,Z.import])),R9=Object.fromEntries(Y1.flatMap((Z)=>Z.aliases?.map((Y)=>[Y,Z.import])||[])),X1={...C9,...R9};var v9=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:()=>import("./chunk-e43hpgc8.js")},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:()=>import("./chunk-fwmc6hwy.js")},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:()=>import("./chunk-zcg0fy8h.js")},{id:"ayu-light",displayName:"Ayu Light",type:"light",import:()=>import("./chunk-e07gx0kg.js")},{id:"ayu-mirage",displayName:"Ayu Mirage",type:"dark",import:()=>import("./chunk-tr01bt0h.js")},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:()=>import("./chunk-c2gqabg2.js")},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:()=>import("./chunk-cfsnygh0.js")},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:()=>import("./chunk-665a7fke.js")},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:()=>import("./chunk-dj82prdc.js")},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:()=>import("./chunk-nzfjhsr7.js")},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:()=>import("./chunk-0qys39ww.js")},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:()=>import("./chunk-5yv6fsvn.js")},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:()=>import("./chunk-8ynj83n2.js")},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:()=>import("./chunk-ffyj4q4f.js")},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:()=>import("./chunk-qcyfn6sh.js")},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:()=>import("./chunk-nvynvczn.js")},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:()=>import("./chunk-1r67ngsh.js")},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:()=>import("./chunk-b7h6wk4v.js")},{id:"github-light",displayName:"GitHub Light",type:"light",import:()=>import("./chunk-6yk2jj1m.js")},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:()=>import("./chunk-5em7s1at.js")},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:()=>import("./chunk-w3y3sdmt.js")},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:()=>import("./chunk-bcwnznke.js")},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:()=>import("./chunk-f6rsbhs6.js")},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:()=>import("./chunk-jpkm78je.js")},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:()=>import("./chunk-jw043xpz.js")},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:()=>import("./chunk-x0gm6db7.js")},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:()=>import("./chunk-a4ah9wgn.js")},{id:"horizon",displayName:"Horizon",type:"dark",import:()=>import("./chunk-s7qqrnzh.js")},{id:"houston",displayName:"Houston",type:"dark",import:()=>import("./chunk-fesyrdnx.js")},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:()=>import("./chunk-9dhex1sf.js")},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:()=>import("./chunk-8w10sa5e.js")},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:()=>import("./chunk-p0ys44e5.js")},{id:"laserwave",displayName:"LaserWave",type:"dark",import:()=>import("./chunk-zqg7xzex.js")},{id:"light-plus",displayName:"Light Plus",type:"light",import:()=>import("./chunk-00jvgph3.js")},{id:"material-theme",displayName:"Material Theme",type:"dark",import:()=>import("./chunk-p3yymm16.js")},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:()=>import("./chunk-v02wftj8.js")},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:()=>import("./chunk-bnma63xz.js")},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:()=>import("./chunk-07fnyy77.js")},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:()=>import("./chunk-k45jk0ge.js")},{id:"min-dark",displayName:"Min Dark",type:"dark",import:()=>import("./chunk-6qce4a2z.js")},{id:"min-light",displayName:"Min Light",type:"light",import:()=>import("./chunk-zj03ksjd.js")},{id:"monokai",displayName:"Monokai",type:"dark",import:()=>import("./chunk-66s9chr5.js")},{id:"night-owl",displayName:"Night Owl",type:"dark",import:()=>import("./chunk-mxwqk6ht.js")},{id:"night-owl-light",displayName:"Night Owl Light",type:"light",import:()=>import("./chunk-qhs3hh67.js")},{id:"nord",displayName:"Nord",type:"dark",import:()=>import("./chunk-yd6e0k1x.js")},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:()=>import("./chunk-httqsv3p.js")},{id:"one-light",displayName:"One Light",type:"light",import:()=>import("./chunk-gc0daqhj.js")},{id:"plastic",displayName:"Plastic",type:"dark",import:()=>import("./chunk-fdvezfdb.js")},{id:"poimandres",displayName:"Poimandres",type:"dark",import:()=>import("./chunk-1a34fyjt.js")},{id:"red",displayName:"Red",type:"dark",import:()=>import("./chunk-mx8stxha.js")},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:()=>import("./chunk-m0czpwvf.js")},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:()=>import("./chunk-wgwaq8q1.js")},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:()=>import("./chunk-ewgpt1pm.js")},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:()=>import("./chunk-y62ja3na.js")},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:()=>import("./chunk-667brfhx.js")},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:()=>import("./chunk-eceb8jjd.js")},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:()=>import("./chunk-fm4a6pgp.js")},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:()=>import("./chunk-sw4h382q.js")},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:()=>import("./chunk-8p1ebpny.js")},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:()=>import("./chunk-p1e4d1an.js")},{id:"vesper",displayName:"Vesper",type:"dark",import:()=>import("./chunk-pr8jrhq9.js")},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:()=>import("./chunk-vbwkgvhq.js")},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:()=>import("./chunk-962ms02t.js")},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:()=>import("./chunk-k06v7jh2.js")}],J1=Object.fromEntries(v9.map((Z)=>[Z.id,Z.import]));class V0 extends Error{constructor(Z){super(Z);this.name="ShikiError"}}function I9(){return 2147483648}function D9(){return typeof performance<"u"?performance.now():Date.now()}var V9=(Z,Y)=>Z+(Y-Z%Y)%Y;async function E9(Z){let Y,X,J={};function Q(M){X=M,J.HEAPU8=new Uint8Array(M),J.HEAPU32=new Uint32Array(M)}function $(M,A,w){J.HEAPU8.copyWithin(M,A,A+w)}function K(M){try{return Y.grow(M-X.byteLength+65535>>>16),Q(Y.buffer),1}catch{}}function U(M){let A=J.HEAPU8.length;M=M>>>0;let w=I9();if(M>w)return!1;for(let P=1;P<=4;P*=2){let B=A*(1+0.2/P);B=Math.min(B,M+100663296);let R=Math.min(w,V9(Math.max(M,B),65536));if(K(R))return!0}return!1}let W=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function z(M,A,w=1024){let P=A+w,B=A;while(M[B]&&!(B>=P))++B;if(B-A>16&&M.buffer&&W)return W.decode(M.subarray(A,B));let R="";while(A<B){let C=M[A++];if(!(C&128)){R+=String.fromCharCode(C);continue}let D=M[A++]&63;if((C&224)===192){R+=String.fromCharCode((C&31)<<6|D);continue}let j=M[A++]&63;if((C&240)===224)C=(C&15)<<12|D<<6|j;else C=(C&7)<<18|D<<12|j<<6|M[A++]&63;if(C<65536)R+=String.fromCharCode(C);else{let E=C-65536;R+=String.fromCharCode(55296|E>>10,56320|E&1023)}}return R}function H(M,A){return M?z(J.HEAPU8,M,A):""}let G={emscripten_get_now:D9,emscripten_memcpy_big:$,emscripten_resize_heap:U,fd_write:()=>0};async function F(){let A=await Z({env:G,wasi_snapshot_preview1:G});Y=A.memory,Q(Y.buffer),Object.assign(J,A),J.UTF8ToString=H}return await F(),J}var b9=Object.defineProperty,T9=(Z,Y,X)=>(Y in Z)?b9(Z,Y,{enumerable:!0,configurable:!0,writable:!0,value:X}):Z[Y]=X,OZ=(Z,Y,X)=>T9(Z,typeof Y!=="symbol"?Y+"":Y,X),NZ=null;function f9(Z){throw new V0(Z.UTF8ToString(Z.getLastOnigError()))}class E0{constructor(Z){OZ(this,"utf16Length"),OZ(this,"utf8Length"),OZ(this,"utf16Value"),OZ(this,"utf8Value"),OZ(this,"utf16OffsetToUtf8"),OZ(this,"utf8OffsetToUtf16");let Y=Z.length,X=E0._utf8ByteLength(Z),J=X!==Y,Q=J?new Uint32Array(Y+1):null;if(J)Q[Y]=X;let $=J?new Uint32Array(X+1):null;if(J)$[X]=Y;let K=new Uint8Array(X),U=0;for(let W=0;W<Y;W++){let z=Z.charCodeAt(W),H=z,G=!1;if(z>=55296&&z<=56319){if(W+1<Y){let F=Z.charCodeAt(W+1);if(F>=56320&&F<=57343)H=(z-55296<<10)+65536|F-56320,G=!0}}if(J){if(Q[W]=U,G)Q[W+1]=U;if(H<=127)$[U+0]=W;else if(H<=2047)$[U+0]=W,$[U+1]=W;else if(H<=65535)$[U+0]=W,$[U+1]=W,$[U+2]=W;else $[U+0]=W,$[U+1]=W,$[U+2]=W,$[U+3]=W}if(H<=127)K[U++]=H;else if(H<=2047)K[U++]=192|(H&1984)>>>6,K[U++]=128|(H&63)>>>0;else if(H<=65535)K[U++]=224|(H&61440)>>>12,K[U++]=128|(H&4032)>>>6,K[U++]=128|(H&63)>>>0;else K[U++]=240|(H&1835008)>>>18,K[U++]=128|(H&258048)>>>12,K[U++]=128|(H&4032)>>>6,K[U++]=128|(H&63)>>>0;if(G)W++}this.utf16Length=Y,this.utf8Length=X,this.utf16Value=Z,this.utf8Value=K,this.utf16OffsetToUtf8=Q,this.utf8OffsetToUtf16=$}static _utf8ByteLength(Z){let Y=0;for(let X=0,J=Z.length;X<J;X++){let Q=Z.charCodeAt(X),$=Q,K=!1;if(Q>=55296&&Q<=56319){if(X+1<J){let U=Z.charCodeAt(X+1);if(U>=56320&&U<=57343)$=(Q-55296<<10)+65536|U-56320,K=!0}}if($<=127)Y+=1;else if($<=2047)Y+=2;else if($<=65535)Y+=3;else Y+=4;if(K)X++}return Y}createString(Z){let Y=Z.omalloc(this.utf8Length);return Z.HEAPU8.set(this.utf8Value,Y),Y}}var b0=class Z{constructor(Y){if(OZ(this,"id",++Z.LAST_ID),OZ(this,"_onigBinding"),OZ(this,"content"),OZ(this,"utf16Length"),OZ(this,"utf8Length"),OZ(this,"utf16OffsetToUtf8"),OZ(this,"utf8OffsetToUtf16"),OZ(this,"ptr"),!NZ)throw new V0("Must invoke loadWasm first.");this._onigBinding=NZ,this.content=Y;let X=new E0(Y);if(this.utf16Length=X.utf16Length,this.utf8Length=X.utf8Length,this.utf16OffsetToUtf8=X.utf16OffsetToUtf8,this.utf8OffsetToUtf16=X.utf8OffsetToUtf16,this.utf8Length<1e4&&!Z._sharedPtrInUse){if(!Z._sharedPtr)Z._sharedPtr=NZ.omalloc(1e4);Z._sharedPtrInUse=!0,NZ.HEAPU8.set(X.utf8Value,Z._sharedPtr),this.ptr=Z._sharedPtr}else this.ptr=X.createString(NZ)}convertUtf8OffsetToUtf16(Y){if(this.utf8OffsetToUtf16){if(Y<0)return 0;if(Y>this.utf8Length)return this.utf16Length;return this.utf8OffsetToUtf16[Y]}return Y}convertUtf16OffsetToUtf8(Y){if(this.utf16OffsetToUtf8){if(Y<0)return 0;if(Y>this.utf16Length)return this.utf8Length;return this.utf16OffsetToUtf8[Y]}return Y}dispose(){if(this.ptr===Z._sharedPtr)Z._sharedPtrInUse=!1;else this._onigBinding.ofree(this.ptr)}};OZ(b0,"LAST_ID",0);OZ(b0,"_sharedPtr",0);OZ(b0,"_sharedPtrInUse",!1);var Q1=b0;class $1{constructor(Z){if(OZ(this,"_onigBinding"),OZ(this,"_ptr"),!NZ)throw new V0("Must invoke loadWasm first.");let Y=[],X=[];for(let K=0,U=Z.length;K<U;K++){let W=new E0(Z[K]);Y[K]=W.createString(NZ),X[K]=W.utf8Length}let J=NZ.omalloc(4*Z.length);NZ.HEAPU32.set(Y,J/4);let Q=NZ.omalloc(4*Z.length);NZ.HEAPU32.set(X,Q/4);let $=NZ.createOnigScanner(J,Q,Z.length);for(let K=0,U=Z.length;K<U;K++)NZ.ofree(Y[K]);if(NZ.ofree(Q),NZ.ofree(J),$===0)f9(NZ);this._onigBinding=NZ,this._ptr=$}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(Z,Y,X){let J=0;if(typeof X==="number")J=X;if(typeof Z==="string"){Z=new Q1(Z);let Q=this._findNextMatchSync(Z,Y,!1,J);return Z.dispose(),Q}return this._findNextMatchSync(Z,Y,!1,J)}_findNextMatchSync(Z,Y,X,J){let Q=this._onigBinding,$=Q.findNextOnigScannerMatch(this._ptr,Z.id,Z.ptr,Z.utf8Length,Z.convertUtf16OffsetToUtf8(Y),J);if($===0)return null;let K=Q.HEAPU32,U=$/4,W=K[U++],z=K[U++],H=[];for(let G=0;G<z;G++){let F=Z.convertUtf8OffsetToUtf16(K[U++]),M=Z.convertUtf8OffsetToUtf16(K[U++]);H[G]={start:F,end:M,length:M-F}}return{index:W,captureIndices:H}}}function j9(Z){return typeof Z.instantiator==="function"}function S9(Z){return typeof Z.default==="function"}function y9(Z){return typeof Z.data<"u"}function k9(Z){return typeof Response<"u"&&Z instanceof Response}function h9(Z){return typeof ArrayBuffer<"u"&&(Z instanceof ArrayBuffer||ArrayBuffer.isView(Z))||typeof Buffer<"u"&&Buffer.isBuffer?.(Z)||typeof SharedArrayBuffer<"u"&&Z instanceof SharedArrayBuffer||typeof Uint32Array<"u"&&Z instanceof Uint32Array}var D0;function x9(Z){if(D0)return D0;async function Y(){NZ=await E9(async(X)=>{let J=Z;if(J=await J,typeof J==="function")J=await J(X);if(typeof J==="function")J=await J(X);if(j9(J))J=await J.instantiator(X);else if(S9(J))J=await J.default(X);else{if(y9(J))J=J.data;if(k9(J))if(typeof WebAssembly.instantiateStreaming==="function")J=await g9(J)(X);else J=await u9(J)(X);else if(h9(J))J=await d8(J)(X);else if(J instanceof WebAssembly.Module)J=await d8(J)(X);else if("default"in J&&J.default instanceof WebAssembly.Module)J=await d8(J.default)(X)}if("instance"in J)J=J.instance;if("exports"in J)J=J.exports;return J})}return D0=Y(),D0}function d8(Z){return(Y)=>WebAssembly.instantiate(Z,Y)}function g9(Z){return(Y)=>WebAssembly.instantiateStreaming(Z,Y)}function u9(Z){return async(Y)=>{let X=await Z.arrayBuffer();return WebAssembly.instantiate(X,Y)}}async function K1(Z){if(Z)await x9(Z);return{createScanner(Y){return new $1(Y.map((X)=>typeof X==="string"?X:X.source))},createString(Y){return new Q1(Y)}}}var W1=e6({langs:X1,themes:J1,engine:()=>K1(import("./chunk-zed64rf0.js"))}),{codeToHtml:m9,codeToHast:p9,codeToTokens:c8,codeToTokensBase:d9,codeToTokensWithThemes:c9,getSingletonHighlighter:l9,getLastGrammarState:i9}=Z1(W1,{guessEmbeddedLanguages:c6});var vZ={h1:{bold:!0,marginBottom:1,color:"#f74cc7ff"},h2:{bold:!0,marginBottom:1,color:"#326cfcff"},h3:{bold:!0,color:"#24ffedff"},h4:{bold:!0,color:"#e29418ff"},h5:{bold:!0,color:"#9fc214ff"},h6:{bold:!0,dimColor:!0,color:"#88eb2bff"},paragraph:{},blockquote:{paddingLeft:1,dimColor:!0,borderTop:!1,borderBottom:!1,borderRight:!1,borderStyle:"single",borderDimColor:!0},code:{marginTop:1},codespan:{dimColor:!0},list:{},listItem:{bullet:"●",paddingLeft:2},hr:{char:"─",width:40,dimColor:!0},link:{color:"#343afcff",underline:!0},strong:{bold:!0},em:{italic:!0},del:{strikethrough:!0,dimColor:!0},image:{color:"blue"},table:{},tableCell:{paddingRight:2}},o9=["color","backgroundColor","dimColor","bold","italic","underline","strikethrough","inverse","wrap"],n9=["paddingLeft","paddingRight","paddingTop","paddingBottom","padding","paddingX","paddingY","marginLeft","marginRight","marginTop","marginBottom","margin","marginX","marginY","borderStyle","borderColor","borderTop","borderBottom","borderLeft","borderRight","borderDimColor","borderTopColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopDimColor","borderBottomDimColor","borderLeftDimColor","borderRightDimColor"];async function a9(Z,Y,X="github-dark"){try{let J=await c8(Z,{lang:Y||"text",theme:X}),Q=[],$=0;for(let K=0;K<J.tokens.length;K++){let U=J.tokens[K];if(U){for(let W of U){let z=W.color||void 0;Q.push(V.jsx(O,{color:z,children:W.content},`token-${$}`)),$++}if(K<J.tokens.length-1)Q.push(V.jsx(O,{children:`
|
|
149
|
-
`},`nl-${K}`))}}return Q}catch{return null}}function PZ(Z){if(!Z)return{};let Y={};for(let X of
|
|
150
|
-
`},$);default:if("text"in J)return V.jsx(O,{children:J.text},$);return null}})}function
|
|
151
|
-
`});case"html":return V.jsx(O,{dimColor:!0,children:Z.text});default:if("text"in Z)return V.jsx(O,{children:Z.text});return null}}var
|
|
147
|
+
\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\x00&'".split(""),"\x00\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\x00"&'.split(""),"\x00\"&'`".split("")]]};function x6(Z,Y,X,J){let Q=J.schema,$=Q.space==="svg"?!1:J.settings.omitOptionalTags,K=Q.space==="svg"?J.settings.closeEmptyElements:J.settings.voids.includes(Z.tagName.toLowerCase()),W=[],U;if(Q.space==="html"&&Z.tagName==="svg")J.schema=MY;let z=Q9(J,Z.properties),H=J.all(Q.space==="html"&&Z.tagName==="template"?Z.content:Z);if(J.schema=Q,H)K=!1;if(z||!$||!h6(Z,Y,X)){if(W.push("<",Z.tagName,z?" "+z:""),K&&(Q.space==="svg"||J.settings.closeSelfClosing)){if(U=z.charAt(z.length-1),!J.settings.tightSelfClosing||U==="/"||U&&U!=='"'&&U!=="'")W.push(" ");W.push("/")}W.push(">")}if(W.push(H),!K&&(!$||!y0(Z,Y,X)))W.push("</"+Z.tagName+">");return W.join("")}function Q9(Z,Y){let X=[],J=-1,Q;if(Y){for(Q in Y)if(Y[Q]!==null&&Y[Q]!==void 0){let $=$9(Z,Q,Y[Q]);if($)X.push($)}}while(++J<X.length){let $=Z.settings.tightAttributes?X[J].charAt(X[J].length-1):void 0;if(J!==X.length-1&&$!=='"'&&$!=="'")X[J]+=" "}return X.join("")}function $9(Z,Y,X){let J=TX(Z.schema,Y),Q=Z.settings.allowParseErrors&&Z.schema.space==="html"?0:1,$=Z.settings.allowDangerousCharacters?0:1,K=Z.quote,W;if(J.overloadedBoolean&&(X===J.attribute||X===""))X=!0;else if((J.boolean||J.overloadedBoolean)&&(typeof X!=="string"||X===J.attribute||X===""))X=Boolean(X);if(X===null||X===void 0||X===!1||typeof X==="number"&&Number.isNaN(X))return"";let U=P4(J.attribute,Object.assign({},Z.settings.characterReferences,{subset:AY.name[Q][$]}));if(X===!0)return U;if(X=Array.isArray(X)?(J.commaSeparated?T6:f6)(X,{padLeft:!Z.settings.tightCommaSeparatedLists}):String(X),Z.settings.collapseEmptyAttributes&&!X)return U;if(Z.settings.preferUnquoted)W=P4(X,Object.assign({},Z.settings.characterReferences,{attribute:!0,subset:AY.unquoted[Q][$]}));if(W!==X){if(Z.settings.quoteSmart&&jX(X,K)>jX(X,Z.alternative))K=Z.alternative;W=K+P4(X,Object.assign({},Z.settings.characterReferences,{subset:(K==="'"?AY.single:AY.double)[Q][$],attribute:!0}))+K}return U+(W?"="+W:W)}var K9=["<","&"];function BY(Z,Y,X,J){return X&&X.type==="element"&&(X.tagName==="script"||X.tagName==="style")?Z.value:P4(Z.value,Object.assign({},J.settings.characterReferences,{subset:K9}))}function g6(Z,Y,X,J){return J.settings.allowDangerousHtml?Z.value:BY(Z,Y,X,J)}function u6(Z,Y,X,J){return J.all(Z)}var m6=A6("type",{invalid:W9,unknown:U9,handlers:{comment:E6,doctype:b6,element:x6,raw:g6,root:u6,text:BY}});function W9(Z){throw Error("Expected node, not `"+Z+"`")}function U9(Z){throw Error("Cannot compile unknown node `"+Z.type+"`")}var z9={},H9={},G9=[];function kX(Z,Y){let X=Y||z9,J=X.quote||'"',Q=J==='"'?"'":'"';if(J!=='"'&&J!=="'")throw Error("Invalid quote `"+J+"`, expected `'` or `\"`");return{one:O9,all:q9,settings:{omitOptionalTags:X.omitOptionalTags||!1,allowParseErrors:X.allowParseErrors||!1,allowDangerousCharacters:X.allowDangerousCharacters||!1,quoteSmart:X.quoteSmart||!1,preferUnquoted:X.preferUnquoted||!1,tightAttributes:X.tightAttributes||!1,upperDoctype:X.upperDoctype||!1,tightDoctype:X.tightDoctype||!1,bogusComments:X.bogusComments||!1,tightCommaSeparatedLists:X.tightCommaSeparatedLists||!1,tightSelfClosing:X.tightSelfClosing||!1,collapseEmptyAttributes:X.collapseEmptyAttributes||!1,allowDangerousHtml:X.allowDangerousHtml||!1,voids:X.voids||O6,characterReferences:X.characterReferences||H9,closeSelfClosing:X.closeSelfClosing||!1,closeEmptyElements:X.closeEmptyElements||!1},schema:X.space==="svg"?MY:_6,quote:J,alternative:Q}.one(Array.isArray(Z)?{type:"root",children:Z}:Z,void 0,void 0)}function O9(Z,Y,X){return m6(Z,Y,X,this)}function q9(Z){let Y=[],X=Z&&Z.children||G9,J=-1;while(++J<X.length)Y[J]=this.one(X[J],J,Z);return Y.join("")}function LY(Z,Y){let X=typeof Z==="string"?{}:{...Z.colorReplacements},J=typeof Z==="string"?Z:Z.name;for(let[Q,$]of Object.entries(Y?.colorReplacements||{}))if(typeof $==="string")X[Q]=$;else if(Q===J)Object.assign(X,$);return X}function j4(Z,Y){if(!Z)return Z;return Y?.[Z?.toLowerCase()]||Z}function F9(Z){return Array.isArray(Z)?Z:[Z]}async function o6(Z){return Promise.resolve(typeof Z==="function"?Z():Z).then((Y)=>Y.default||Y)}function uX(Z){return!Z||["plaintext","txt","text","plain"].includes(Z)}function n6(Z){return Z==="ansi"||uX(Z)}function mX(Z){return Z==="none"}function a6(Z){return mX(Z)}function s6(Z,Y){if(!Y)return Z;if(Z.properties||={},Z.properties.class||=[],typeof Z.properties.class==="string")Z.properties.class=Z.properties.class.split(/\s+/g);if(!Array.isArray(Z.properties.class))Z.properties.class=[];let X=Array.isArray(Y)?Y:Y.split(/\s+/g);for(let J of X)if(J&&!Z.properties.class.includes(J))Z.properties.class.push(J);return Z}function IY(Z,Y=!1){if(Z.length===0)return[["",0]];let X=Z.split(/(\r?\n)/g),J=0,Q=[];for(let $=0;$<X.length;$+=2){let K=Y?X[$]+(X[$+1]||""):X[$];Q.push([K,J]),J+=X[$].length,J+=X[$+1]?.length||0}return Q}function M9(Z){let Y=IY(Z,!0).map(([Q])=>Q);function X(Q){if(Q===Z.length)return{line:Y.length-1,character:Y[Y.length-1].length};let $=Q,K=0;for(let W of Y){if($<W.length)break;$-=W.length,K++}return{line:K,character:$}}function J(Q,$){let K=0;for(let W=0;W<Q;W++)K+=Y[W].length;return K+=$,K}return{lines:Y,indexToPos:X,posToIndex:J}}function t6(Z,Y,X){let J=new Set;for(let $ of Z.matchAll(/:?lang=["']([^"']+)["']/g)){let K=$[1].toLowerCase().trim();if(K)J.add(K)}for(let $ of Z.matchAll(/(?:```|~~~)([\w-]+)/g)){let K=$[1].toLowerCase().trim();if(K)J.add(K)}for(let $ of Z.matchAll(/\\begin\{([\w-]+)\}/g)){let K=$[1].toLowerCase().trim();if(K)J.add(K)}for(let $ of Z.matchAll(/<script\s+(?:type|lang)=["']([^"']+)["']/gi)){let K=$[1].toLowerCase().trim(),W=K.includes("/")?K.split("/").pop():K;if(W)J.add(W)}if(!X)return Array.from(J);let Q=X.getBundledLanguages();return Array.from(J).filter(($)=>$&&Q[$])}var pX="light-dark()",N9=["color","background-color"];function _9(Z,Y){let X=0,J=[];for(let Q of Y){if(Q>X)J.push({...Z,content:Z.content.slice(X,Q),offset:Z.offset+X});X=Q}if(X<Z.content.length)J.push({...Z,content:Z.content.slice(X),offset:Z.offset+X});return J}function w9(Z,Y){let X=Array.from(Y instanceof Set?Y:new Set(Y)).sort((J,Q)=>J-Q);if(!X.length)return Z;return Z.map((J)=>{return J.flatMap((Q)=>{let $=X.filter((K)=>Q.offset<K&&K<Q.offset+Q.content.length).map((K)=>K-Q.offset).sort((K,W)=>K-W);if(!$.length)return Q;return _9(Q,$)})})}function A9(Z,Y,X,J,Q="css-vars"){let $={content:Z.content,explanation:Z.explanation,offset:Z.offset},K=Y.map((H)=>PY(Z.variants[H])),W=new Set(K.flatMap((H)=>Object.keys(H))),U={},z=(H,G)=>{let F=G==="color"?"":G==="background-color"?"-bg":`-${G}`;return X+Y[H]+(G==="color"?"":F)};return K.forEach((H,G)=>{for(let F of W){let M=H[F]||"inherit";if(G===0&&J&&N9.includes(F))if(J===pX&&K.length>1){let _=Y.findIndex((C)=>C==="light"),A=Y.findIndex((C)=>C==="dark");if(_===-1||A===-1)throw new YZ('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');let P=K[_][F]||"inherit",B=K[A][F]||"inherit";if(U[F]=`light-dark(${P}, ${B})`,Q==="css-vars")U[z(G,F)]=M}else U[F]=M;else if(Q==="css-vars")U[z(G,F)]=M}}),$.htmlStyle=U,$}function PY(Z){let Y={};if(Z.color)Y.color=Z.color;if(Z.bgColor)Y["background-color"]=Z.bgColor;if(Z.fontStyle){if(Z.fontStyle&OZ.Italic)Y["font-style"]="italic";if(Z.fontStyle&OZ.Bold)Y["font-weight"]="bold";let X=[];if(Z.fontStyle&OZ.Underline)X.push("underline");if(Z.fontStyle&OZ.Strikethrough)X.push("line-through");if(X.length)Y["text-decoration"]=X.join(" ")}return Y}function gX(Z){if(typeof Z==="string")return Z;return Object.entries(Z).map(([Y,X])=>`${Y}:${X}`).join(";")}var e6=new WeakMap;function DY(Z,Y){e6.set(Z,Y)}function h0(Z){return e6.get(Z)}class q0{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(Z,Y){return new q0(Object.fromEntries(F9(Y).map((X)=>[X,GY])),Z)}constructor(...Z){if(Z.length===2){let[Y,X]=Z;this.lang=X,this._stacks=Y}else{let[Y,X,J]=Z;this.lang=X,this._stacks={[J]:Y}}}getInternalStack(Z=this.theme){return this._stacks[Z]}getScopes(Z=this.theme){return B9(this._stacks[Z])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}}function B9(Z){let Y=[],X=new Set;function J(Q){if(X.has(Q))return;X.add(Q);let $=Q?.nameScopesList?.scopeName;if($)Y.push($);if(Q.parent)J(Q.parent)}return J(Z),Y}function L9(Z,Y){if(!(Z instanceof q0))throw new YZ("Invalid grammar state");return Z.getInternalStack(Y)}function P9(){let Z=new WeakMap;function Y(X){if(!Z.has(X.meta)){let J=function(K){if(typeof K==="number"){if(K<0||K>X.source.length)throw new YZ(`Invalid decoration offset: ${K}. Code length: ${X.source.length}`);return{...Q.indexToPos(K),offset:K}}else{let W=Q.lines[K.line];if(W===void 0)throw new YZ(`Invalid decoration position ${JSON.stringify(K)}. Lines length: ${Q.lines.length}`);let U=K.character;if(U<0)U=W.length+U;if(U<0||U>W.length)throw new YZ(`Invalid decoration position ${JSON.stringify(K)}. Line ${K.line} length: ${W.length}`);return{...K,character:U,offset:Q.posToIndex(K.line,U)}}},Q=M9(X.source),$=(X.options.decorations||[]).map((K)=>({...K,start:J(K.start),end:J(K.end)}));R9($),Z.set(X.meta,{decorations:$,converter:Q,source:X.source})}return Z.get(X.meta)}return{name:"shiki:decorations",tokens(X){if(!this.options.decorations?.length)return;let Q=Y(this).decorations.flatMap((K)=>[K.start.offset,K.end.offset]);return w9(X,Q)},code(X){if(!this.options.decorations?.length)return;let J=Y(this),Q=Array.from(X.children).filter((H)=>H.type==="element"&&H.tagName==="span");if(Q.length!==J.converter.lines.length)throw new YZ(`Number of lines in code element (${Q.length}) does not match the number of lines in the source (${J.converter.lines.length}). Failed to apply decorations.`);function $(H,G,F,M){let _=Q[H],A="",P=-1,B=-1;if(G===0)P=0;if(F===0)B=0;if(F===Number.POSITIVE_INFINITY)B=_.children.length;if(P===-1||B===-1)for(let R=0;R<_.children.length;R++){if(A+=ZJ(_.children[R]),P===-1&&A.length===G)P=R+1;if(B===-1&&A.length===F)B=R+1}if(P===-1)throw new YZ(`Failed to find start index for decoration ${JSON.stringify(M.start)}`);if(B===-1)throw new YZ(`Failed to find end index for decoration ${JSON.stringify(M.end)}`);let C=_.children.slice(P,B);if(!M.alwaysWrap&&C.length===_.children.length)W(_,M,"line");else if(!M.alwaysWrap&&C.length===1&&C[0].type==="element")W(C[0],M,"token");else{let R={type:"element",tagName:"span",properties:{},children:C};W(R,M,"wrapper"),_.children.splice(P,C.length,R)}}function K(H,G){Q[H]=W(Q[H],G,"line")}function W(H,G,F){let M=G.properties||{},_=G.transform||((A)=>A);if(H.tagName=G.tagName||"span",H.properties={...H.properties,...M,class:H.properties.class},G.properties?.class)s6(H,G.properties.class);return H=_(H,F)||H,H}let U=[],z=J.decorations.sort((H,G)=>G.start.offset-H.start.offset||H.end.offset-G.end.offset);for(let H of z){let{start:G,end:F}=H;if(G.line===F.line)$(G.line,G.character,F.character,H);else if(G.line<F.line){$(G.line,G.character,Number.POSITIVE_INFINITY,H);for(let M=G.line+1;M<F.line;M++)U.unshift(()=>K(M,H));$(F.line,0,F.character,H)}}U.forEach((H)=>H())}}}function R9(Z){for(let Y=0;Y<Z.length;Y++){let X=Z[Y];if(X.start.offset>X.end.offset)throw new YZ(`Invalid decoration range: ${JSON.stringify(X.start)} - ${JSON.stringify(X.end)}`);for(let J=Y+1;J<Z.length;J++){let Q=Z[J],$=X.start.offset<=Q.start.offset&&Q.start.offset<X.end.offset,K=X.start.offset<Q.end.offset&&Q.end.offset<=X.end.offset,W=Q.start.offset<=X.start.offset&&X.start.offset<Q.end.offset,U=Q.start.offset<X.end.offset&&X.end.offset<=Q.end.offset;if($||K||W||U){if($&&K)continue;if(W&&U)continue;if(W&&X.start.offset===X.end.offset)continue;if(K&&Q.start.offset===Q.end.offset)continue;throw new YZ(`Decorations ${JSON.stringify(X.start)} and ${JSON.stringify(Q.start)} intersect.`)}}}}function ZJ(Z){if(Z.type==="text")return Z.value;if(Z.type==="element")return Z.children.map(ZJ).join("");return""}var C9=[P9()];function RY(Z){let Y=v9(Z.transformers||[]);return[...Y.pre,...Y.normal,...Y.post,...C9]}function v9(Z){let Y=[],X=[],J=[];for(let Q of Z)switch(Q.enforce){case"pre":Y.push(Q);break;case"post":X.push(Q);break;default:J.push(Q)}return{pre:Y,post:X,normal:J}}var a4=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],hX={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function I9(Z,Y){let X=Z.indexOf("\x1B",Y);if(X!==-1){if(Z[X+1]==="["){let J=Z.indexOf("m",X);if(J!==-1)return{sequence:Z.substring(X+2,J).split(";"),startPosition:X,position:J+1}}}return{position:Z.length}}function p6(Z){let Y=Z.shift();if(Y==="2"){let X=Z.splice(0,3).map((J)=>Number.parseInt(J));if(X.length!==3||X.some((J)=>Number.isNaN(J)))return;return{type:"rgb",rgb:X}}else if(Y==="5"){let X=Z.shift();if(X)return{type:"table",index:Number(X)}}}function D9(Z){let Y=[];while(Z.length>0){let X=Z.shift();if(!X)continue;let J=Number.parseInt(X);if(Number.isNaN(J))continue;if(J===0)Y.push({type:"resetAll"});else if(J<=9){if(hX[J])Y.push({type:"setDecoration",value:hX[J]})}else if(J<=29){let Q=hX[J-20];if(Q){if(Y.push({type:"resetDecoration",value:Q}),Q==="dim")Y.push({type:"resetDecoration",value:"bold"})}}else if(J<=37)Y.push({type:"setForegroundColor",value:{type:"named",name:a4[J-30]}});else if(J===38){let Q=p6(Z);if(Q)Y.push({type:"setForegroundColor",value:Q})}else if(J===39)Y.push({type:"resetForegroundColor"});else if(J<=47)Y.push({type:"setBackgroundColor",value:{type:"named",name:a4[J-40]}});else if(J===48){let Q=p6(Z);if(Q)Y.push({type:"setBackgroundColor",value:Q})}else if(J===49)Y.push({type:"resetBackgroundColor"});else if(J===53)Y.push({type:"setDecoration",value:"overline"});else if(J===55)Y.push({type:"resetDecoration",value:"overline"});else if(J>=90&&J<=97)Y.push({type:"setForegroundColor",value:{type:"named",name:a4[J-90+8]}});else if(J>=100&&J<=107)Y.push({type:"setBackgroundColor",value:{type:"named",name:a4[J-100+8]}})}return Y}function V9(){let Z=null,Y=null,X=new Set;return{parse(J){let Q=[],$=0;do{let K=I9(J,$),W=K.sequence?J.substring($,K.startPosition):J.substring($);if(W.length>0)Q.push({value:W,foreground:Z,background:Y,decorations:new Set(X)});if(K.sequence){let U=D9(K.sequence);for(let z of U)if(z.type==="resetAll")Z=null,Y=null,X.clear();else if(z.type==="resetForegroundColor")Z=null;else if(z.type==="resetBackgroundColor")Y=null;else if(z.type==="resetDecoration")X.delete(z.value);for(let z of U)if(z.type==="setForegroundColor")Z=z.value;else if(z.type==="setBackgroundColor")Y=z.value;else if(z.type==="setDecoration")X.add(z.value)}$=K.position}while($<J.length);return Q}}}var E9={black:"#000000",red:"#bb0000",green:"#00bb00",yellow:"#bbbb00",blue:"#0000bb",magenta:"#ff00ff",cyan:"#00bbbb",white:"#eeeeee",brightBlack:"#555555",brightRed:"#ff5555",brightGreen:"#00ff00",brightYellow:"#ffff55",brightBlue:"#5555ff",brightMagenta:"#ff55ff",brightCyan:"#55ffff",brightWhite:"#ffffff"};function b9(Z=E9){function Y(W){return Z[W]}function X(W){return`#${W.map((U)=>Math.max(0,Math.min(U,255)).toString(16).padStart(2,"0")).join("")}`}let J;function Q(){if(J)return J;J=[];for(let z=0;z<a4.length;z++)J.push(Y(a4[z]));let W=[0,95,135,175,215,255];for(let z=0;z<6;z++)for(let H=0;H<6;H++)for(let G=0;G<6;G++)J.push(X([W[z],W[H],W[G]]));let U=8;for(let z=0;z<24;z++,U+=10)J.push(X([U,U,U]));return J}function $(W){return Q()[W]}function K(W){switch(W.type){case"named":return Y(W.name);case"rgb":return X(W.rgb);case"table":return $(W.index)}}return{value:K}}var T9={black:"#000000",red:"#cd3131",green:"#0DBC79",yellow:"#E5E510",blue:"#2472C8",magenta:"#BC3FBC",cyan:"#11A8CD",white:"#E5E5E5",brightBlack:"#666666",brightRed:"#F14C4C",brightGreen:"#23D18B",brightYellow:"#F5F543",brightBlue:"#3B8EEA",brightMagenta:"#D670D6",brightCyan:"#29B8DB",brightWhite:"#FFFFFF"};function f9(Z,Y,X){let J=LY(Z,X),Q=IY(Y),$=Object.fromEntries(a4.map((U)=>{let z=`terminal.ansi${U[0].toUpperCase()}${U.substring(1)}`,H=Z.colors?.[z];return[U,H||T9[U]]})),K=b9($),W=V9();return Q.map((U)=>W.parse(U[0]).map((z)=>{let H,G;if(z.decorations.has("reverse"))H=z.background?K.value(z.background):Z.bg,G=z.foreground?K.value(z.foreground):Z.fg;else H=z.foreground?K.value(z.foreground):Z.fg,G=z.background?K.value(z.background):void 0;if(H=j4(H,J),G=j4(G,J),z.decorations.has("dim"))H=j9(H);let F=OZ.None;if(z.decorations.has("bold"))F|=OZ.Bold;if(z.decorations.has("italic"))F|=OZ.Italic;if(z.decorations.has("underline"))F|=OZ.Underline;if(z.decorations.has("strikethrough"))F|=OZ.Strikethrough;return{content:z.value,offset:U[1],color:H,bgColor:G,fontStyle:F}}))}function j9(Z){let Y=Z.match(/#([0-9a-f]{3,8})/i);if(Y){let J=Y[1];if(J.length===8){let Q=Math.round(Number.parseInt(J.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${J.slice(0,6)}${Q}`}else if(J.length===6)return`#${J}80`;else if(J.length===4){let Q=J[0],$=J[1],K=J[2],W=J[3],U=Math.round(Number.parseInt(`${W}${W}`,16)/2).toString(16).padStart(2,"0");return`#${Q}${Q}${$}${$}${K}${K}${U}`}else if(J.length===3){let Q=J[0],$=J[1],K=J[2];return`#${Q}${Q}${$}${$}${K}${K}80`}}let X=Z.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);if(X)return`var(${X[1]}-dim)`;return Z}function cX(Z,Y,X={}){let{theme:J=Z.getLoadedThemes()[0]}=X,Q=Z.resolveLangAlias(X.lang||"text");if(uX(Q)||mX(J))return IY(Y).map((U)=>[{content:U[0],offset:U[1]}]);let{theme:$,colorMap:K}=Z.setTheme(J);if(Q==="ansi")return f9($,Y,X);let W=Z.getLanguage(X.lang||"text");if(X.grammarState){if(X.grammarState.lang!==W.name)throw new YZ(`Grammar state language "${X.grammarState.lang}" does not match highlight language "${W.name}"`);if(!X.grammarState.themes.includes($.name))throw new YZ(`Grammar state themes "${X.grammarState.themes}" do not contain highlight theme "${$.name}"`)}return y9(Y,W,$,K,X)}function S9(...Z){if(Z.length===2)return h0(Z[1]);let[Y,X,J={}]=Z,{lang:Q="text",theme:$=Y.getLoadedThemes()[0]}=J;if(uX(Q)||mX($))throw new YZ("Plain language does not have grammar state");if(Q==="ansi")throw new YZ("ANSI language does not have grammar state");let{theme:K,colorMap:W}=Y.setTheme($),U=Y.getLanguage(Q);return new q0(dX(X,U,K,W,J).stateStack,U.name,K.name)}function y9(Z,Y,X,J,Q){let $=dX(Z,Y,X,J,Q),K=new q0($.stateStack,Y.name,X.name);return DY($.tokens,K),$.tokens}function dX(Z,Y,X,J,Q){let $=LY(X,Q),{tokenizeMaxLineLength:K=0,tokenizeTimeLimit:W=500}=Q,U=IY(Z),z=Q.grammarState?L9(Q.grammarState,X.name)??GY:Q.grammarContextCode!=null?dX(Q.grammarContextCode,Y,X,J,{...Q,grammarState:void 0,grammarContextCode:void 0}).stateStack:GY,H=[],G=[];for(let F=0,M=U.length;F<M;F++){let[_,A]=U[F];if(_===""){H=[],G.push([]);continue}if(K>0&&_.length>=K){H=[],G.push([{content:_,offset:A,color:"",fontStyle:0}]);continue}let P,B,C;if(Q.includeExplanation)P=Y.tokenizeLine(_,z,W),B=P.tokens,C=0;let R=Y.tokenizeLine2(_,z,W),D=R.tokens.length/2;for(let j=0;j<D;j++){let E=R.tokens[2*j],c=j+1<D?R.tokens[2*j+2]:_.length;if(E===c)continue;let i=R.tokens[2*j+1],g=j4(J[r4.getForeground(i)],$),r=r4.getFontStyle(i),n={content:_.substring(E,c),offset:A+E,color:g,fontStyle:r};if(Q.includeExplanation){let F4=[];if(Q.includeExplanation!=="scopeName")for(let gZ of X.settings){let h4;switch(typeof gZ.scope){case"string":h4=gZ.scope.split(/,/).map((D4)=>D4.trim());break;case"object":h4=gZ.scope;break;default:continue}F4.push({settings:gZ,selectors:h4.map((D4)=>D4.split(/ /))})}n.explanation=[];let M4=0;while(E+M4<c){let gZ=B[C],h4=_.substring(gZ.startIndex,gZ.endIndex);M4+=h4.length,n.explanation.push({content:h4,scopes:Q.includeExplanation==="scopeName"?k9(gZ.scopes):h9(F4,gZ.scopes)}),C+=1}}H.push(n)}G.push(H),H=[],z=R.ruleStack}return{tokens:G,stateStack:z}}function k9(Z){return Z.map((Y)=>({scopeName:Y}))}function h9(Z,Y){let X=[];for(let J=0,Q=Y.length;J<Q;J++){let $=Y[J];X[J]={scopeName:$,themeMatches:g9(Z,$,Y.slice(0,J))}}return X}function c6(Z,Y){return Z===Y||Y.substring(0,Z.length)===Z&&Y[Z.length]==="."}function x9(Z,Y,X){if(!c6(Z[Z.length-1],Y))return!1;let J=Z.length-2,Q=X.length-1;while(J>=0&&Q>=0){if(c6(Z[J],X[Q]))J-=1;Q-=1}if(J===-1)return!0;return!1}function g9(Z,Y,X){let J=[];for(let{selectors:Q,settings:$}of Z)for(let K of Q)if(x9(K,Y,X)){J.push($);break}return J}function YJ(Z,Y,X){let J=Object.entries(X.themes).filter((U)=>U[1]).map((U)=>({color:U[0],theme:U[1]})),Q=J.map((U)=>{let z=cX(Z,Y,{...X,theme:U.theme}),H=h0(z),G=typeof U.theme==="string"?U.theme:U.theme.name;return{tokens:z,state:H,theme:G}}),$=u9(...Q.map((U)=>U.tokens)),K=$[0].map((U,z)=>U.map((H,G)=>{let F={content:H.content,variants:{},offset:H.offset};if("includeExplanation"in X&&X.includeExplanation)F.explanation=H.explanation;return $.forEach((M,_)=>{let{content:A,explanation:P,offset:B,...C}=M[z][G];F.variants[J[_].color]=C}),F})),W=Q[0].state?new q0(Object.fromEntries(Q.map((U)=>[U.theme,U.state?.getInternalStack(U.theme)])),Q[0].state.lang):void 0;if(W)DY(K,W);return K}function u9(...Z){let Y=Z.map(()=>[]),X=Z.length;for(let J=0;J<Z[0].length;J++){let Q=Z.map((U)=>U[J]),$=Y.map(()=>[]);Y.forEach((U,z)=>U.push($[z]));let K=Q.map(()=>0),W=Q.map((U)=>U[0]);while(W.every((U)=>U)){let U=Math.min(...W.map((z)=>z.content.length));for(let z=0;z<X;z++){let H=W[z];if(H.content.length===U)$[z].push(H),K[z]+=1,W[z]=Q[z][K[z]];else $[z].push({...H,content:H.content.slice(0,U)}),W[z]={...H,content:H.content.slice(U),offset:H.offset+U}}}}return Y}function CY(Z,Y,X){let J,Q,$,K,W,U;if("themes"in X){let{defaultColor:z="light",cssVariablePrefix:H="--shiki-",colorsRendering:G="css-vars"}=X,F=Object.entries(X.themes).filter((B)=>B[1]).map((B)=>({color:B[0],theme:B[1]})).sort((B,C)=>B.color===z?-1:C.color===z?1:0);if(F.length===0)throw new YZ("`themes` option must not be empty");let M=YJ(Z,Y,X);if(U=h0(M),z&&pX!==z&&!F.find((B)=>B.color===z))throw new YZ(`\`themes\` option must contain the defaultColor key \`${z}\``);let _=F.map((B)=>Z.getTheme(B.theme)),A=F.map((B)=>B.color);if($=M.map((B)=>B.map((C)=>A9(C,A,H,z,G))),U)DY($,U);let P=F.map((B)=>LY(B.theme,X));Q=d6(F,_,P,H,z,"fg",G),J=d6(F,_,P,H,z,"bg",G),K=`shiki-themes ${_.map((B)=>B.name).join(" ")}`,W=z?void 0:[Q,J].join(";")}else if("theme"in X){let z=LY(X.theme,X);$=cX(Z,Y,X);let H=Z.getTheme(X.theme);J=j4(H.bg,z),Q=j4(H.fg,z),K=H.name,U=h0($)}else throw new YZ("Invalid options, either `theme` or `themes` must be provided");return{tokens:$,fg:Q,bg:J,themeName:K,rootStyle:W,grammarState:U}}function d6(Z,Y,X,J,Q,$,K){return Z.map((W,U)=>{let z=j4(Y[U][$],X[U])||"inherit",H=`${J+W.color}${$==="bg"?"-bg":""}:${z}`;if(U===0&&Q){if(Q===pX&&Z.length>1){let G=Z.findIndex((A)=>A.color==="light"),F=Z.findIndex((A)=>A.color==="dark");if(G===-1||F===-1)throw new YZ('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');let M=j4(Y[G][$],X[G])||"inherit",_=j4(Y[F][$],X[F])||"inherit";return`light-dark(${M}, ${_});${H}`}return z}if(K==="css-vars")return H;return null}).filter((W)=>!!W).join(";")}function vY(Z,Y,X,J={meta:{},options:X,codeToHast:(Q,$)=>vY(Z,Q,$),codeToTokens:(Q,$)=>CY(Z,Q,$)}){let Q=Y;for(let _ of RY(X))Q=_.preprocess?.call(J,Q,X)||Q;let{tokens:$,fg:K,bg:W,themeName:U,rootStyle:z,grammarState:H}=CY(Z,Q,X),{mergeWhitespaces:G=!0,mergeSameStyleTokens:F=!1}=X;if(G===!0)$=p9($);else if(G==="never")$=c9($);if(F)$=d9($);let M={...J,get source(){return Q}};for(let _ of RY(X))$=_.tokens?.call(M,$)||$;return m9($,{...X,fg:K,bg:W,themeName:U,rootStyle:X.rootStyle===!1?!1:X.rootStyle??z},M,H)}function m9(Z,Y,X,J=h0(Z)){let Q=RY(Y),$=[],K={type:"root",children:[]},{structure:W="classic",tabindex:U="0"}=Y,z={class:`shiki ${Y.themeName||""}`};if(Y.rootStyle!==!1)if(Y.rootStyle!=null)z.style=Y.rootStyle;else z.style=`background-color:${Y.bg};color:${Y.fg}`;if(U!==!1&&U!=null)z.tabindex=U.toString();for(let[A,P]of Object.entries(Y.meta||{}))if(!A.startsWith("_"))z[A]=P;let H={type:"element",tagName:"pre",properties:z,children:[],data:Y.data},G={type:"element",tagName:"code",properties:{},children:$},F=[],M={...X,structure:W,addClassToHast:s6,get source(){return X.source},get tokens(){return Z},get options(){return Y},get root(){return K},get pre(){return H},get code(){return G},get lines(){return F}};if(Z.forEach((A,P)=>{if(P){if(W==="inline")K.children.push({type:"element",tagName:"br",properties:{},children:[]});else if(W==="classic")$.push({type:"text",value:`
|
|
148
|
+
`})}let B={type:"element",tagName:"span",properties:{class:"line"},children:[]},C=0;for(let R of A){let D={type:"element",tagName:"span",properties:{...R.htmlAttrs},children:[{type:"text",value:R.content}]},j=gX(R.htmlStyle||PY(R));if(j)D.properties.style=j;for(let E of Q)D=E?.span?.call(M,D,P+1,C,B,R)||D;if(W==="inline")K.children.push(D);else if(W==="classic")B.children.push(D);C+=R.content.length}if(W==="classic"){for(let R of Q)B=R?.line?.call(M,B,P+1)||B;F.push(B),$.push(B)}else if(W==="inline")F.push(B)}),W==="classic"){for(let A of Q)G=A?.code?.call(M,G)||G;H.children.push(G);for(let A of Q)H=A?.pre?.call(M,H)||H;K.children.push(H)}else if(W==="inline"){let A=[],P={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(let R of K.children)if(R.type==="element"&&R.tagName==="br")A.push(P),P={type:"element",tagName:"span",properties:{class:"line"},children:[]};else if(R.type==="element"||R.type==="text")P.children.push(R);A.push(P);let C={type:"element",tagName:"code",properties:{},children:A};for(let R of Q)C=R?.code?.call(M,C)||C;K.children=[];for(let R=0;R<C.children.length;R++){if(R>0)K.children.push({type:"element",tagName:"br",properties:{},children:[]});let D=C.children[R];if(D.type==="element")K.children.push(...D.children)}}let _=K;for(let A of Q)_=A?.root?.call(M,_)||_;if(J)DY(_,J);return _}function p9(Z){return Z.map((Y)=>{let X=[],J="",Q;return Y.forEach(($,K)=>{let U=!($.fontStyle&&($.fontStyle&OZ.Underline||$.fontStyle&OZ.Strikethrough));if(U&&$.content.match(/^\s+$/)&&Y[K+1]){if(Q===void 0)Q=$.offset;J+=$.content}else if(J){if(U)X.push({...$,offset:Q,content:J+$.content});else X.push({content:J,offset:Q},$);Q=void 0,J=""}else X.push($)}),X})}function c9(Z){return Z.map((Y)=>{return Y.flatMap((X)=>{if(X.content.match(/^\s+$/))return X;let J=X.content.match(/^(\s*)(.*?)(\s*)$/);if(!J)return X;let[,Q,$,K]=J;if(!Q&&!K)return X;let W=[{...X,offset:X.offset+Q.length,content:$}];if(Q)W.unshift({content:Q,offset:X.offset});if(K)W.push({content:K,offset:X.offset+Q.length+$.length});return W})})}function d9(Z){return Z.map((Y)=>{let X=[];for(let J of Y){if(X.length===0){X.push({...J});continue}let Q=X[X.length-1],$=gX(Q.htmlStyle||PY(Q)),K=gX(J.htmlStyle||PY(J)),W=Q.fontStyle&&(Q.fontStyle&OZ.Underline||Q.fontStyle&OZ.Strikethrough),U=J.fontStyle&&(J.fontStyle&OZ.Underline||J.fontStyle&OZ.Strikethrough);if(!W&&!U&&$===K)Q.content+=J.content;else X.push({...J})}return X})}var l9=kX;function i9(Z,Y,X){let J={meta:{},options:X,codeToHast:($,K)=>vY(Z,$,K),codeToTokens:($,K)=>CY(Z,$,K)},Q=l9(vY(Z,Y,X,J));for(let $ of RY(X))Q=$.postprocess?.call(J,Q,X)||Q;return Q}var l6={light:"#333333",dark:"#bbbbbb"},i6={light:"#fffffe",dark:"#1e1e1e"},r6="__shiki_resolved";function lX(Z){if(Z?.[r6])return Z;let Y={...Z};if(Y.tokenColors&&!Y.settings)Y.settings=Y.tokenColors,delete Y.tokenColors;Y.type||="dark",Y.colorReplacements={...Y.colorReplacements},Y.settings||=[];let{bg:X,fg:J}=Y;if(!X||!J){let W=Y.settings?Y.settings.find((U)=>!U.name&&!U.scope):void 0;if(W?.settings?.foreground)J=W.settings.foreground;if(W?.settings?.background)X=W.settings.background;if(!J&&Y?.colors?.["editor.foreground"])J=Y.colors["editor.foreground"];if(!X&&Y?.colors?.["editor.background"])X=Y.colors["editor.background"];if(!J)J=Y.type==="light"?l6.light:l6.dark;if(!X)X=Y.type==="light"?i6.light:i6.dark;Y.fg=J,Y.bg=X}if(!(Y.settings[0]&&Y.settings[0].settings&&!Y.settings[0].scope))Y.settings.unshift({settings:{foreground:Y.fg,background:Y.bg}});let Q=0,$=new Map;function K(W){if($.has(W))return $.get(W);Q+=1;let U=`#${Q.toString(16).padStart(8,"0").toLowerCase()}`;if(Y.colorReplacements?.[`#${U}`])return K(W);return $.set(W,U),U}Y.settings=Y.settings.map((W)=>{let U=W.settings?.foreground&&!W.settings.foreground.startsWith("#"),z=W.settings?.background&&!W.settings.background.startsWith("#");if(!U&&!z)return W;let H={...W,settings:{...W.settings}};if(U){let G=K(W.settings.foreground);Y.colorReplacements[G]=W.settings.foreground,H.settings.foreground=G}if(z){let G=K(W.settings.background);Y.colorReplacements[G]=W.settings.background,H.settings.background=G}return H});for(let W of Object.keys(Y.colors||{}))if(W==="editor.foreground"||W==="editor.background"||W.startsWith("terminal.ansi")){if(!Y.colors[W]?.startsWith("#")){let U=K(Y.colors[W]);Y.colorReplacements[U]=Y.colors[W],Y.colors[W]=U}}return Object.defineProperty(Y,r6,{enumerable:!1,writable:!1,value:!0}),Y}async function XJ(Z){return Array.from(new Set((await Promise.all(Z.filter((Y)=>!n6(Y)).map(async(Y)=>await o6(Y).then((X)=>Array.isArray(X)?X:[X])))).flat()))}async function JJ(Z){return(await Promise.all(Z.map(async(X)=>a6(X)?null:lX(await o6(X))))).filter((X)=>!!X)}var xX=3,r9=!1;function o9(Z,Y=3){if(!xX)return;if(typeof xX==="number"&&Y>xX)return;if(r9)throw Error(`[SHIKI DEPRECATE]: ${Z}`);else console.trace(`[SHIKI DEPRECATE]: ${Z}`)}class s4 extends Error{constructor(Z){super(Z);this.name="ShikiError"}}function QJ(Z,Y){if(!Y)return Z;if(Y[Z]){let X=new Set([Z]);while(Y[Z]){if(Z=Y[Z],X.has(Z))throw new s4(`Circular alias \`${Array.from(X).join(" -> ")} -> ${Z}\``);X.add(Z)}}return Z}class $J extends G6{constructor(Z,Y,X,J={}){super(Z);this._resolver=Z,this._themes=Y,this._langs=X,this._alias=J,this._themes.map((Q)=>this.loadTheme(Q)),this.loadLanguages(this._langs)}_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;getTheme(Z){if(typeof Z==="string")return this._resolvedThemes.get(Z);else return this.loadTheme(Z)}loadTheme(Z){let Y=lX(Z);if(Y.name)this._resolvedThemes.set(Y.name,Y),this._loadedThemesCache=null;return Y}getLoadedThemes(){if(!this._loadedThemesCache)this._loadedThemesCache=[...this._resolvedThemes.keys()];return this._loadedThemesCache}setTheme(Z){let Y=this._textmateThemeCache.get(Z);if(!Y)Y=V0.createFromRawTheme(Z),this._textmateThemeCache.set(Z,Y);this._syncRegistry.setTheme(Y)}getGrammar(Z){return Z=QJ(Z,this._alias),this._resolvedGrammars.get(Z)}loadLanguage(Z){if(this.getGrammar(Z.name))return;let Y=new Set([...this._langMap.values()].filter((Q)=>Q.embeddedLangsLazy?.includes(Z.name)));this._resolver.addLanguage(Z);let X={balancedBracketSelectors:Z.balancedBracketSelectors||["*"],unbalancedBracketSelectors:Z.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(Z.scopeName,Z);let J=this.loadGrammarWithConfiguration(Z.scopeName,1,X);if(J.name=Z.name,this._resolvedGrammars.set(Z.name,J),Z.aliases)Z.aliases.forEach((Q)=>{this._alias[Q]=Z.name});if(this._loadedLanguagesCache=null,Y.size)for(let Q of Y)this._resolvedGrammars.delete(Q.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(Q.scopeName),this._syncRegistry?._grammars?.delete(Q.scopeName),this.loadLanguage(this._langMap.get(Q.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(Z){for(let J of Z)this.resolveEmbeddedLanguages(J);let Y=Array.from(this._langGraph.entries()),X=Y.filter(([J,Q])=>!Q);if(X.length){let J=Y.filter(([Q,$])=>{if(!$)return!1;return($.embeddedLanguages||$.embeddedLangs)?.some((W)=>X.map(([U])=>U).includes(W))}).filter((Q)=>!X.includes(Q));throw new s4(`Missing languages ${X.map(([Q])=>`\`${Q}\``).join(", ")}, required by ${J.map(([Q])=>`\`${Q}\``).join(", ")}`)}for(let[J,Q]of Y)this._resolver.addLanguage(Q);for(let[J,Q]of Y)this.loadLanguage(Q)}getLoadedLanguages(){if(!this._loadedLanguagesCache)this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])];return this._loadedLanguagesCache}resolveEmbeddedLanguages(Z){this._langMap.set(Z.name,Z),this._langGraph.set(Z.name,Z);let Y=Z.embeddedLanguages??Z.embeddedLangs;if(Y)for(let X of Y)this._langGraph.set(X,this._langMap.get(X))}}class KJ{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(Z,Y){this._onigLib={createOnigScanner:(X)=>Z.createScanner(X),createOnigString:(X)=>Z.createString(X)},Y.forEach((X)=>this.addLanguage(X))}get onigLib(){return this._onigLib}getLangRegistration(Z){return this._langs.get(Z)}loadGrammar(Z){return this._scopeToLang.get(Z)}addLanguage(Z){if(this._langs.set(Z.name,Z),Z.aliases)Z.aliases.forEach((Y)=>{this._langs.set(Y,Z)});if(this._scopeToLang.set(Z.scopeName,Z),Z.injectTo)Z.injectTo.forEach((Y)=>{if(!this._injections.get(Y))this._injections.set(Y,[]);this._injections.get(Y).push(Z.scopeName)})}getInjections(Z){let Y=Z.split("."),X=[];for(let J=1;J<=Y.length;J++){let Q=Y.slice(0,J).join(".");X=[...X,...this._injections.get(Q)||[]]}return X}}var k0=0;function n9(Z){if(k0+=1,Z.warnings!==!1&&k0>=10&&k0%10===0)console.warn(`[Shiki] ${k0} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let Y=!1;if(!Z.engine)throw new s4("`engine` option is required for synchronous mode");let X=(Z.langs||[]).flat(1),J=(Z.themes||[]).flat(1).map(lX),Q=new KJ(Z.engine,X),$=new $J(Q,J,X,Z.langAlias),K;function W(R){return QJ(R,Z.langAlias)}function U(R){B();let D=$.getGrammar(typeof R==="string"?R:R.name);if(!D)throw new s4(`Language \`${R}\` not found, you may need to load it first`);return D}function z(R){if(R==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};B();let D=$.getTheme(R);if(!D)throw new s4(`Theme \`${R}\` not found, you may need to load it first`);return D}function H(R){B();let D=z(R);if(K!==R)$.setTheme(D),K=R;let j=$.getColorMap();return{theme:D,colorMap:j}}function G(){return B(),$.getLoadedThemes()}function F(){return B(),$.getLoadedLanguages()}function M(...R){B(),$.loadLanguages(R.flat(1))}async function _(...R){return M(await XJ(R))}function A(...R){B();for(let D of R.flat(1))$.loadTheme(D)}async function P(...R){return B(),A(await JJ(R))}function B(){if(Y)throw new s4("Shiki instance has been disposed")}function C(){if(Y)return;Y=!0,$.dispose(),k0-=1}return{setTheme:H,getTheme:z,getLanguage:U,getLoadedThemes:G,getLoadedLanguages:F,resolveLangAlias:W,loadLanguage:_,loadLanguageSync:M,loadTheme:P,loadThemeSync:A,dispose:C,[Symbol.dispose]:C}}async function a9(Z){if(!Z.engine)o9("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[Y,X,J]=await Promise.all([JJ(Z.themes||[]),XJ(Z.langs||[]),Z.engine]);return n9({...Z,themes:Y,langs:X,engine:J})}async function s9(Z){let Y=await a9(Z);return{getLastGrammarState:(...X)=>S9(Y,...X),codeToTokensBase:(X,J)=>cX(Y,X,J),codeToTokensWithThemes:(X,J)=>YJ(Y,X,J),codeToTokens:(X,J)=>CY(Y,X,J),codeToHast:(X,J)=>vY(Y,X,J),codeToHtml:(X,J)=>i9(Y,X,J),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...Y,getInternalContext:()=>Y}}function WJ(Z){let{langs:Y,themes:X,engine:J}=Z;async function Q($){function K(G){if(typeof G==="string"){if(G=$.langAlias?.[G]||G,n6(G))return[];let F=Y[G];if(!F)throw new YZ(`Language \`${G}\` is not included in this bundle. You may want to load it from external source.`);return F}return G}function W(G){if(a6(G))return"none";if(typeof G==="string"){let F=X[G];if(!F)throw new YZ(`Theme \`${G}\` is not included in this bundle. You may want to load it from external source.`);return F}return G}let U=($.themes??[]).map((G)=>W(G)),z=($.langs??[]).map((G)=>K(G)),H=await s9({engine:$.engine??J(),...$,themes:U,langs:z});return{...H,loadLanguage(...G){return H.loadLanguage(...G.map(K))},loadTheme(...G){return H.loadTheme(...G.map(W))},getBundledLanguages(){return Y},getBundledThemes(){return X}}}return Q}function t9(Z){let Y;async function X(J={}){if(!Y){Y=Z({...J,themes:[],langs:[]});let Q=await Y;return await Promise.all([Q.loadTheme(...J.themes||[]),Q.loadLanguage(...J.langs||[])]),Q}else{let Q=await Y;return await Promise.all([Q.loadTheme(...J.themes||[]),Q.loadLanguage(...J.langs||[])]),Q}}return X}function UJ(Z,Y){let X=t9(Z);async function J(Q,$){let K=await X({langs:[$.lang],themes:"theme"in $?[$.theme]:Object.values($.themes)}),W=await Y?.guessEmbeddedLanguages?.(Q,$.lang,K);if(W)await K.loadLanguage(...W);return K}return{getSingletonHighlighter(Q){return X(Q)},async codeToHtml(Q,$){return(await J(Q,$)).codeToHtml(Q,$)},async codeToHast(Q,$){return(await J(Q,$)).codeToHast(Q,$)},async codeToTokens(Q,$){return(await J(Q,$)).codeToTokens(Q,$)},async codeToTokensBase(Q,$){return(await J(Q,$)).codeToTokensBase(Q,$)},async codeToTokensWithThemes(Q,$){return(await J(Q,$)).codeToTokensWithThemes(Q,$)},async getLastGrammarState(Q,$){return(await X({langs:[$.lang],themes:[$.theme]})).getLastGrammarState(Q,$)}}}var zJ=[{id:"abap",name:"ABAP",import:()=>import("./chunk-2kka9ex2.js")},{id:"actionscript-3",name:"ActionScript",import:()=>import("./chunk-bngqptzm.js")},{id:"ada",name:"Ada",import:()=>import("./chunk-2gr7rdv0.js")},{id:"angular-html",name:"Angular HTML",import:()=>import("./chunk-4g796wg5.js")},{id:"angular-ts",name:"Angular TypeScript",import:()=>import("./chunk-frzyyytq.js")},{id:"apache",name:"Apache Conf",import:()=>import("./chunk-hvekwfwd.js")},{id:"apex",name:"Apex",import:()=>import("./chunk-97bsgfnr.js")},{id:"apl",name:"APL",import:()=>import("./chunk-1163kxya.js")},{id:"applescript",name:"AppleScript",import:()=>import("./chunk-cyd358a8.js")},{id:"ara",name:"Ara",import:()=>import("./chunk-91rrbsk7.js")},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:()=>import("./chunk-te7k3eqj.js")},{id:"asm",name:"Assembly",import:()=>import("./chunk-jy5kmp4s.js")},{id:"astro",name:"Astro",import:()=>import("./chunk-ty5eswjv.js")},{id:"awk",name:"AWK",import:()=>import("./chunk-b4fn3tre.js")},{id:"ballerina",name:"Ballerina",import:()=>import("./chunk-45dyg3fv.js")},{id:"bat",name:"Batch File",aliases:["batch"],import:()=>import("./chunk-w8vzpn90.js")},{id:"beancount",name:"Beancount",import:()=>import("./chunk-g30bcqjk.js")},{id:"berry",name:"Berry",aliases:["be"],import:()=>import("./chunk-trx18gxg.js")},{id:"bibtex",name:"BibTeX",import:()=>import("./chunk-ywas7wb8.js")},{id:"bicep",name:"Bicep",import:()=>import("./chunk-azxn0zvz.js")},{id:"blade",name:"Blade",import:()=>import("./chunk-v1e0cwqh.js")},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:()=>import("./chunk-eyty7ng4.js")},{id:"c",name:"C",import:()=>import("./chunk-6hbnk94n.js")},{id:"c3",name:"C3",import:()=>import("./chunk-7893pky5.js")},{id:"cadence",name:"Cadence",aliases:["cdc"],import:()=>import("./chunk-8chx87e7.js")},{id:"cairo",name:"Cairo",import:()=>import("./chunk-r1enj0f0.js")},{id:"clarity",name:"Clarity",import:()=>import("./chunk-n9zmzbyq.js")},{id:"clojure",name:"Clojure",aliases:["clj"],import:()=>import("./chunk-2qx9kzj1.js")},{id:"cmake",name:"CMake",import:()=>import("./chunk-gphyz2x3.js")},{id:"cobol",name:"COBOL",import:()=>import("./chunk-tchg9ygq.js")},{id:"codeowners",name:"CODEOWNERS",import:()=>import("./chunk-4j4w856j.js")},{id:"codeql",name:"CodeQL",aliases:["ql"],import:()=>import("./chunk-09f94dtz.js")},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:()=>import("./chunk-03bb6pab.js")},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:()=>import("./chunk-nv58ta3s.js")},{id:"coq",name:"Coq",import:()=>import("./chunk-tpyp8wqr.js")},{id:"cpp",name:"C++",aliases:["c++"],import:()=>import("./chunk-eh3cemzk.js")},{id:"crystal",name:"Crystal",import:()=>import("./chunk-f6cbjh6q.js")},{id:"csharp",name:"C#",aliases:["c#","cs"],import:()=>import("./chunk-crjf70s3.js")},{id:"css",name:"CSS",import:()=>import("./chunk-ksy4d0za.js")},{id:"csv",name:"CSV",import:()=>import("./chunk-0bpvpy2e.js")},{id:"cue",name:"CUE",import:()=>import("./chunk-b68ekt52.js")},{id:"cypher",name:"Cypher",aliases:["cql"],import:()=>import("./chunk-mfexzmw2.js")},{id:"d",name:"D",import:()=>import("./chunk-4wmmjwq3.js")},{id:"dart",name:"Dart",import:()=>import("./chunk-wb0ms9q0.js")},{id:"dax",name:"DAX",import:()=>import("./chunk-t5z5e89a.js")},{id:"desktop",name:"Desktop",import:()=>import("./chunk-1dwn0qqb.js")},{id:"diff",name:"Diff",import:()=>import("./chunk-cegx2zze.js")},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:()=>import("./chunk-86em0evs.js")},{id:"dotenv",name:"dotEnv",import:()=>import("./chunk-emdn1c33.js")},{id:"dream-maker",name:"Dream Maker",import:()=>import("./chunk-c1345z85.js")},{id:"edge",name:"Edge",import:()=>import("./chunk-sd6qvm4t.js")},{id:"elixir",name:"Elixir",import:()=>import("./chunk-acceg8yk.js")},{id:"elm",name:"Elm",import:()=>import("./chunk-yj27rmw2.js")},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:()=>import("./chunk-28p35k17.js")},{id:"erb",name:"ERB",import:()=>import("./chunk-htgt048s.js")},{id:"erlang",name:"Erlang",aliases:["erl"],import:()=>import("./chunk-cm6vfvym.js")},{id:"fennel",name:"Fennel",import:()=>import("./chunk-e112438q.js")},{id:"fish",name:"Fish",import:()=>import("./chunk-xk0abc6t.js")},{id:"fluent",name:"Fluent",aliases:["ftl"],import:()=>import("./chunk-tvbj84md.js")},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:()=>import("./chunk-stp38gza.js")},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:()=>import("./chunk-jhwm3phf.js")},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:()=>import("./chunk-p70r0dds.js")},{id:"gdresource",name:"GDResource",aliases:["tscn","tres"],import:()=>import("./chunk-8m5dqftt.js")},{id:"gdscript",name:"GDScript",aliases:["gd"],import:()=>import("./chunk-2m3g6fah.js")},{id:"gdshader",name:"GDShader",import:()=>import("./chunk-17zj2hd5.js")},{id:"genie",name:"Genie",import:()=>import("./chunk-y3gfd4y3.js")},{id:"gherkin",name:"Gherkin",import:()=>import("./chunk-mp6yhf6a.js")},{id:"git-commit",name:"Git Commit Message",import:()=>import("./chunk-9gnhztzd.js")},{id:"git-rebase",name:"Git Rebase Message",import:()=>import("./chunk-4zemyepb.js")},{id:"gleam",name:"Gleam",import:()=>import("./chunk-tpgf3t6p.js")},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:()=>import("./chunk-0cz1ygrn.js")},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:()=>import("./chunk-4mw5szy1.js")},{id:"glsl",name:"GLSL",import:()=>import("./chunk-m7bwshtn.js")},{id:"gn",name:"GN",import:()=>import("./chunk-0myk23dw.js")},{id:"gnuplot",name:"Gnuplot",import:()=>import("./chunk-bf0pjbfa.js")},{id:"go",name:"Go",import:()=>import("./chunk-ts98e90r.js")},{id:"graphql",name:"GraphQL",aliases:["gql"],import:()=>import("./chunk-rxs4gexg.js")},{id:"groovy",name:"Groovy",import:()=>import("./chunk-4ecfe9a1.js")},{id:"hack",name:"Hack",import:()=>import("./chunk-vjvr9n6y.js")},{id:"haml",name:"Ruby Haml",import:()=>import("./chunk-bb9mvt9d.js")},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:()=>import("./chunk-9dh8d15f.js")},{id:"haskell",name:"Haskell",aliases:["hs"],import:()=>import("./chunk-yz8sseev.js")},{id:"haxe",name:"Haxe",import:()=>import("./chunk-ss233wsa.js")},{id:"hcl",name:"HashiCorp HCL",import:()=>import("./chunk-fcexqvhh.js")},{id:"hjson",name:"Hjson",import:()=>import("./chunk-px75djc6.js")},{id:"hlsl",name:"HLSL",import:()=>import("./chunk-yctck6wf.js")},{id:"html",name:"HTML",import:()=>import("./chunk-zpes0b8m.js")},{id:"html-derivative",name:"HTML (Derivative)",import:()=>import("./chunk-afdat9a4.js")},{id:"http",name:"HTTP",import:()=>import("./chunk-3p4khpea.js")},{id:"hurl",name:"Hurl",import:()=>import("./chunk-0ch9bkct.js")},{id:"hxml",name:"HXML",import:()=>import("./chunk-86exrje1.js")},{id:"hy",name:"Hy",import:()=>import("./chunk-8mmvxxyj.js")},{id:"imba",name:"Imba",import:()=>import("./chunk-yxwramd1.js")},{id:"ini",name:"INI",aliases:["properties"],import:()=>import("./chunk-yx4mdqvf.js")},{id:"java",name:"Java",import:()=>import("./chunk-40fxbk0k.js")},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:()=>import("./chunk-ncs4rnsn.js")},{id:"jinja",name:"Jinja",import:()=>import("./chunk-hgpmrbsr.js")},{id:"jison",name:"Jison",import:()=>import("./chunk-v8ag7wgx.js")},{id:"json",name:"JSON",import:()=>import("./chunk-g1yt0qc9.js")},{id:"json5",name:"JSON5",import:()=>import("./chunk-62zhdx11.js")},{id:"jsonc",name:"JSON with Comments",import:()=>import("./chunk-72h39xc8.js")},{id:"jsonl",name:"JSON Lines",import:()=>import("./chunk-z0abvgpr.js")},{id:"jsonnet",name:"Jsonnet",import:()=>import("./chunk-pd4wysbn.js")},{id:"jssm",name:"JSSM",aliases:["fsl"],import:()=>import("./chunk-2vtz4ypn.js")},{id:"jsx",name:"JSX",import:()=>import("./chunk-4pa2a33z.js")},{id:"julia",name:"Julia",aliases:["jl"],import:()=>import("./chunk-6nhdwm44.js")},{id:"kdl",name:"KDL",import:()=>import("./chunk-3tq80kwe.js")},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:()=>import("./chunk-c3b7gwkd.js")},{id:"kusto",name:"Kusto",aliases:["kql"],import:()=>import("./chunk-t8w9hqaa.js")},{id:"latex",name:"LaTeX",import:()=>import("./chunk-crvp4wnc.js")},{id:"lean",name:"Lean 4",aliases:["lean4"],import:()=>import("./chunk-yr48as8z.js")},{id:"less",name:"Less",import:()=>import("./chunk-9dn65rqp.js")},{id:"liquid",name:"Liquid",import:()=>import("./chunk-7hvw60gp.js")},{id:"llvm",name:"LLVM IR",import:()=>import("./chunk-cd37w7qk.js")},{id:"log",name:"Log file",import:()=>import("./chunk-6e734rff.js")},{id:"logo",name:"Logo",import:()=>import("./chunk-7h9sjfmy.js")},{id:"lua",name:"Lua",import:()=>import("./chunk-w0me5x6g.js")},{id:"luau",name:"Luau",import:()=>import("./chunk-m8mdqeye.js")},{id:"make",name:"Makefile",aliases:["makefile"],import:()=>import("./chunk-4z0wk36t.js")},{id:"markdown",name:"Markdown",aliases:["md"],import:()=>import("./chunk-0gb5n1jp.js")},{id:"marko",name:"Marko",import:()=>import("./chunk-bwnx1zht.js")},{id:"matlab",name:"MATLAB",import:()=>import("./chunk-x0mnchxz.js")},{id:"mdc",name:"MDC",import:()=>import("./chunk-70gnwjt8.js")},{id:"mdx",name:"MDX",import:()=>import("./chunk-8evmvqza.js")},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:()=>import("./chunk-j5e4dmw7.js")},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:()=>import("./chunk-ztpff54v.js")},{id:"mojo",name:"Mojo",import:()=>import("./chunk-1efcgvx0.js")},{id:"moonbit",name:"MoonBit",aliases:["mbt","mbti"],import:()=>import("./chunk-5g0asgdm.js")},{id:"move",name:"Move",import:()=>import("./chunk-6a35z43a.js")},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:()=>import("./chunk-nt5n8jcr.js")},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:()=>import("./chunk-dvmzq40v.js")},{id:"nginx",name:"Nginx",import:()=>import("./chunk-51cf1nrg.js")},{id:"nim",name:"Nim",import:()=>import("./chunk-p3mpqeqw.js")},{id:"nix",name:"Nix",import:()=>import("./chunk-t32zj7ah.js")},{id:"nushell",name:"nushell",aliases:["nu"],import:()=>import("./chunk-323aj0k7.js")},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:()=>import("./chunk-y971vkwy.js")},{id:"objective-cpp",name:"Objective-C++",import:()=>import("./chunk-qpkn7wvc.js")},{id:"ocaml",name:"OCaml",import:()=>import("./chunk-6v5eepr1.js")},{id:"odin",name:"Odin",import:()=>import("./chunk-4qs8qf3g.js")},{id:"openscad",name:"OpenSCAD",aliases:["scad"],import:()=>import("./chunk-g9q5nbz0.js")},{id:"pascal",name:"Pascal",import:()=>import("./chunk-ehpz2t7m.js")},{id:"perl",name:"Perl",import:()=>import("./chunk-6r7b9pg1.js")},{id:"php",name:"PHP",import:()=>import("./chunk-63ghca0g.js")},{id:"pkl",name:"Pkl",import:()=>import("./chunk-s6t5vxm9.js")},{id:"plsql",name:"PL/SQL",import:()=>import("./chunk-8hp4t30w.js")},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:()=>import("./chunk-9kydh60d.js")},{id:"polar",name:"Polar",import:()=>import("./chunk-50hw7e2n.js")},{id:"postcss",name:"PostCSS",import:()=>import("./chunk-x7g4cwft.js")},{id:"powerquery",name:"PowerQuery",import:()=>import("./chunk-41hzdwnx.js")},{id:"powershell",name:"PowerShell",aliases:["ps","ps1"],import:()=>import("./chunk-ksr76npa.js")},{id:"prisma",name:"Prisma",import:()=>import("./chunk-ak43xwf1.js")},{id:"prolog",name:"Prolog",import:()=>import("./chunk-fbf3gztk.js")},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:()=>import("./chunk-ywp666sg.js")},{id:"pug",name:"Pug",aliases:["jade"],import:()=>import("./chunk-n9x46wsq.js")},{id:"puppet",name:"Puppet",import:()=>import("./chunk-3mzwewcx.js")},{id:"purescript",name:"PureScript",import:()=>import("./chunk-geyhpd32.js")},{id:"python",name:"Python",aliases:["py"],import:()=>import("./chunk-rvxb17kx.js")},{id:"qml",name:"QML",import:()=>import("./chunk-j8b7x5pr.js")},{id:"qmldir",name:"QML Directory",import:()=>import("./chunk-gtms11w9.js")},{id:"qss",name:"Qt Style Sheets",import:()=>import("./chunk-zkfa00mf.js")},{id:"r",name:"R",import:()=>import("./chunk-s6xjfvvd.js")},{id:"racket",name:"Racket",import:()=>import("./chunk-pn04v4sv.js")},{id:"raku",name:"Raku",aliases:["perl6"],import:()=>import("./chunk-3c791dd5.js")},{id:"razor",name:"ASP.NET Razor",import:()=>import("./chunk-znpdxhep.js")},{id:"reg",name:"Windows Registry Script",import:()=>import("./chunk-z46zzhqf.js")},{id:"regexp",name:"RegExp",aliases:["regex"],import:()=>import("./chunk-9c0wnb5t.js")},{id:"rel",name:"Rel",import:()=>import("./chunk-x0qb9311.js")},{id:"riscv",name:"RISC-V",import:()=>import("./chunk-cwvb8zr5.js")},{id:"ron",name:"RON",import:()=>import("./chunk-v85y10pz.js")},{id:"rosmsg",name:"ROS Interface",import:()=>import("./chunk-tx71e422.js")},{id:"rst",name:"reStructuredText",import:()=>import("./chunk-gy4p2qnz.js")},{id:"ruby",name:"Ruby",aliases:["rb"],import:()=>import("./chunk-c5d87fzk.js")},{id:"rust",name:"Rust",aliases:["rs"],import:()=>import("./chunk-2hjzw0cx.js")},{id:"sas",name:"SAS",import:()=>import("./chunk-ak0aqr2c.js")},{id:"sass",name:"Sass",import:()=>import("./chunk-4vr7sc1e.js")},{id:"scala",name:"Scala",import:()=>import("./chunk-7dmms791.js")},{id:"scheme",name:"Scheme",import:()=>import("./chunk-wk8sx9ev.js")},{id:"scss",name:"SCSS",import:()=>import("./chunk-psdrzwp5.js")},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:()=>import("./chunk-d9xgby9w.js")},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:()=>import("./chunk-fcxgd3qb.js")},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:()=>import("./chunk-d08qq3wd.js")},{id:"shellsession",name:"Shell Session",aliases:["console"],import:()=>import("./chunk-0mryaqgb.js")},{id:"smalltalk",name:"Smalltalk",import:()=>import("./chunk-p46at2ts.js")},{id:"solidity",name:"Solidity",import:()=>import("./chunk-tv1kqdv9.js")},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:()=>import("./chunk-0dstjr38.js")},{id:"sparql",name:"SPARQL",import:()=>import("./chunk-g8k4dhcx.js")},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:()=>import("./chunk-h5k1z56v.js")},{id:"sql",name:"SQL",import:()=>import("./chunk-mr7em8w4.js")},{id:"ssh-config",name:"SSH Config",import:()=>import("./chunk-hzejh175.js")},{id:"stata",name:"Stata",import:()=>import("./chunk-xmp5jp4r.js")},{id:"stylus",name:"Stylus",aliases:["styl"],import:()=>import("./chunk-shc3fcge.js")},{id:"surrealql",name:"SurrealQL",aliases:["surql"],import:()=>import("./chunk-v3ta4qyy.js")},{id:"svelte",name:"Svelte",import:()=>import("./chunk-mjwypsrz.js")},{id:"swift",name:"Swift",import:()=>import("./chunk-t0tznkac.js")},{id:"system-verilog",name:"SystemVerilog",import:()=>import("./chunk-jmzy9per.js")},{id:"systemd",name:"Systemd Units",import:()=>import("./chunk-yr04s6b7.js")},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:()=>import("./chunk-v9b5r8aq.js")},{id:"tasl",name:"Tasl",import:()=>import("./chunk-jafhgffb.js")},{id:"tcl",name:"Tcl",import:()=>import("./chunk-3b8bw2gg.js")},{id:"templ",name:"Templ",import:()=>import("./chunk-3dqan531.js")},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:()=>import("./chunk-1a5zv67s.js")},{id:"tex",name:"TeX",import:()=>import("./chunk-b6xencpw.js")},{id:"toml",name:"TOML",import:()=>import("./chunk-501c35tf.js")},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:()=>import("./chunk-jam7nh0r.js")},{id:"tsv",name:"TSV",import:()=>import("./chunk-8nkp692y.js")},{id:"tsx",name:"TSX",import:()=>import("./chunk-t97kks4j.js")},{id:"turtle",name:"Turtle",import:()=>import("./chunk-bfm294j1.js")},{id:"twig",name:"Twig",import:()=>import("./chunk-3ns6c29z.js")},{id:"typescript",name:"TypeScript",aliases:["ts","cts","mts"],import:()=>import("./chunk-jh6wwc9v.js")},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:()=>import("./chunk-vxzscaap.js")},{id:"typst",name:"Typst",aliases:["typ"],import:()=>import("./chunk-s719ttj9.js")},{id:"v",name:"V",import:()=>import("./chunk-3pd9zqn2.js")},{id:"vala",name:"Vala",import:()=>import("./chunk-p2z2bacg.js")},{id:"vb",name:"Visual Basic",aliases:["cmd"],import:()=>import("./chunk-5n3h6mhr.js")},{id:"verilog",name:"Verilog",import:()=>import("./chunk-pf09ha3g.js")},{id:"vhdl",name:"VHDL",import:()=>import("./chunk-k7e2abhq.js")},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:()=>import("./chunk-n220pha2.js")},{id:"vue",name:"Vue",import:()=>import("./chunk-ajtch74a.js")},{id:"vue-html",name:"Vue HTML",import:()=>import("./chunk-kncs6js6.js")},{id:"vue-vine",name:"Vue Vine",import:()=>import("./chunk-5vzt6z7d.js")},{id:"vyper",name:"Vyper",aliases:["vy"],import:()=>import("./chunk-dhgjjhh7.js")},{id:"wasm",name:"WebAssembly",import:()=>import("./chunk-03d08304.js")},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:()=>import("./chunk-8tg10bhe.js")},{id:"wgsl",name:"WGSL",import:()=>import("./chunk-bd35cx5s.js")},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:()=>import("./chunk-7zprjevz.js")},{id:"wit",name:"WebAssembly Interface Types",import:()=>import("./chunk-nbcah8mh.js")},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:()=>import("./chunk-gp1ensbx.js")},{id:"xml",name:"XML",import:()=>import("./chunk-2w2pzwmm.js")},{id:"xsl",name:"XSL",import:()=>import("./chunk-f3jbz60e.js")},{id:"yaml",name:"YAML",aliases:["yml"],import:()=>import("./chunk-k97swe5s.js")},{id:"zenscript",name:"ZenScript",import:()=>import("./chunk-p3p6a3ht.js")},{id:"zig",name:"Zig",import:()=>import("./chunk-6rzyzk0g.js")}],e9=Object.fromEntries(zJ.map((Z)=>[Z.id,Z.import])),ZW=Object.fromEntries(zJ.flatMap((Z)=>Z.aliases?.map((Y)=>[Y,Z.import])||[])),HJ={...e9,...ZW};var YW=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:()=>import("./chunk-85j75g9q.js")},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:()=>import("./chunk-jppcve2j.js")},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:()=>import("./chunk-rmrp92n9.js")},{id:"ayu-light",displayName:"Ayu Light",type:"light",import:()=>import("./chunk-w895krdx.js")},{id:"ayu-mirage",displayName:"Ayu Mirage",type:"dark",import:()=>import("./chunk-6gxwe3hq.js")},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:()=>import("./chunk-h8ay3dqc.js")},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:()=>import("./chunk-v3bw2mnd.js")},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:()=>import("./chunk-1pm5qfkm.js")},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:()=>import("./chunk-z6rwg7bs.js")},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:()=>import("./chunk-h8de6gyf.js")},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:()=>import("./chunk-r9r1v9kw.js")},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:()=>import("./chunk-pe45n68n.js")},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:()=>import("./chunk-8m6adpjf.js")},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:()=>import("./chunk-51h1tm3c.js")},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:()=>import("./chunk-gpmj4w3z.js")},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:()=>import("./chunk-yfasv01s.js")},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:()=>import("./chunk-rv0x9fbs.js")},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:()=>import("./chunk-y3d9nwzf.js")},{id:"github-light",displayName:"GitHub Light",type:"light",import:()=>import("./chunk-y6vatv51.js")},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:()=>import("./chunk-p6dgtz38.js")},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:()=>import("./chunk-yb2kp04v.js")},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:()=>import("./chunk-mvv3ktys.js")},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:()=>import("./chunk-tamfhbc6.js")},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:()=>import("./chunk-dw3081wb.js")},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:()=>import("./chunk-mcrmg4m8.js")},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:()=>import("./chunk-952k4ak8.js")},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:()=>import("./chunk-mymqnpgf.js")},{id:"horizon",displayName:"Horizon",type:"dark",import:()=>import("./chunk-y1f3hfaq.js")},{id:"houston",displayName:"Houston",type:"dark",import:()=>import("./chunk-ke9tpkk2.js")},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:()=>import("./chunk-1mdbzd7e.js")},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:()=>import("./chunk-25es8s2e.js")},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:()=>import("./chunk-rc027n67.js")},{id:"laserwave",displayName:"LaserWave",type:"dark",import:()=>import("./chunk-77gv3r7z.js")},{id:"light-plus",displayName:"Light Plus",type:"light",import:()=>import("./chunk-6meyz753.js")},{id:"material-theme",displayName:"Material Theme",type:"dark",import:()=>import("./chunk-m3zge9wv.js")},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:()=>import("./chunk-fs2mzcgs.js")},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:()=>import("./chunk-3pqm74e3.js")},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:()=>import("./chunk-djmxgj5c.js")},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:()=>import("./chunk-8kv8e5sn.js")},{id:"min-dark",displayName:"Min Dark",type:"dark",import:()=>import("./chunk-1ggv4msc.js")},{id:"min-light",displayName:"Min Light",type:"light",import:()=>import("./chunk-5743qc09.js")},{id:"monokai",displayName:"Monokai",type:"dark",import:()=>import("./chunk-msha9pw1.js")},{id:"night-owl",displayName:"Night Owl",type:"dark",import:()=>import("./chunk-q56ns9ta.js")},{id:"night-owl-light",displayName:"Night Owl Light",type:"light",import:()=>import("./chunk-3s6j6d1z.js")},{id:"nord",displayName:"Nord",type:"dark",import:()=>import("./chunk-zb9wth64.js")},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:()=>import("./chunk-4tgv8687.js")},{id:"one-light",displayName:"One Light",type:"light",import:()=>import("./chunk-q9711zm8.js")},{id:"plastic",displayName:"Plastic",type:"dark",import:()=>import("./chunk-pr7vzg5y.js")},{id:"poimandres",displayName:"Poimandres",type:"dark",import:()=>import("./chunk-1q8wzky6.js")},{id:"red",displayName:"Red",type:"dark",import:()=>import("./chunk-n65ycayf.js")},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:()=>import("./chunk-q3x300wy.js")},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:()=>import("./chunk-88191bqb.js")},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:()=>import("./chunk-ak2n1ckf.js")},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:()=>import("./chunk-ypj2k2de.js")},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:()=>import("./chunk-e2qmvzgm.js")},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:()=>import("./chunk-nw76mbwc.js")},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:()=>import("./chunk-9ynmrc70.js")},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:()=>import("./chunk-7pntzqpm.js")},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:()=>import("./chunk-76gx2wc0.js")},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:()=>import("./chunk-ek58k066.js")},{id:"vesper",displayName:"Vesper",type:"dark",import:()=>import("./chunk-bwjh7xrm.js")},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:()=>import("./chunk-bh33p34p.js")},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:()=>import("./chunk-kwgygr4z.js")},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:()=>import("./chunk-gh5vbn9x.js")}],GJ=Object.fromEntries(YW.map((Z)=>[Z.id,Z.import]));class EY extends Error{constructor(Z){super(Z);this.name="ShikiError"}}function XW(){return 2147483648}function JW(){return typeof performance<"u"?performance.now():Date.now()}var QW=(Z,Y)=>Z+(Y-Z%Y)%Y;async function $W(Z){let Y,X,J={};function Q(M){X=M,J.HEAPU8=new Uint8Array(M),J.HEAPU32=new Uint32Array(M)}function $(M,_,A){J.HEAPU8.copyWithin(M,_,_+A)}function K(M){try{return Y.grow(M-X.byteLength+65535>>>16),Q(Y.buffer),1}catch{}}function W(M){let _=J.HEAPU8.length;M=M>>>0;let A=XW();if(M>A)return!1;for(let P=1;P<=4;P*=2){let B=_*(1+0.2/P);B=Math.min(B,M+100663296);let C=Math.min(A,QW(Math.max(M,B),65536));if(K(C))return!0}return!1}let U=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function z(M,_,A=1024){let P=_+A,B=_;while(M[B]&&!(B>=P))++B;if(B-_>16&&M.buffer&&U)return U.decode(M.subarray(_,B));let C="";while(_<B){let R=M[_++];if(!(R&128)){C+=String.fromCharCode(R);continue}let D=M[_++]&63;if((R&224)===192){C+=String.fromCharCode((R&31)<<6|D);continue}let j=M[_++]&63;if((R&240)===224)R=(R&15)<<12|D<<6|j;else R=(R&7)<<18|D<<12|j<<6|M[_++]&63;if(R<65536)C+=String.fromCharCode(R);else{let E=R-65536;C+=String.fromCharCode(55296|E>>10,56320|E&1023)}}return C}function H(M,_){return M?z(J.HEAPU8,M,_):""}let G={emscripten_get_now:JW,emscripten_memcpy_big:$,emscripten_resize_heap:W,fd_write:()=>0};async function F(){let _=await Z({env:G,wasi_snapshot_preview1:G});Y=_.memory,Q(Y.buffer),Object.assign(J,_),J.UTF8ToString=H}return await F(),J}var KW=Object.defineProperty,WW=(Z,Y,X)=>(Y in Z)?KW(Z,Y,{enumerable:!0,configurable:!0,writable:!0,value:X}):Z[Y]=X,qZ=(Z,Y,X)=>WW(Z,typeof Y!=="symbol"?Y+"":Y,X),NZ=null;function UW(Z){throw new EY(Z.UTF8ToString(Z.getLastOnigError()))}class bY{constructor(Z){qZ(this,"utf16Length"),qZ(this,"utf8Length"),qZ(this,"utf16Value"),qZ(this,"utf8Value"),qZ(this,"utf16OffsetToUtf8"),qZ(this,"utf8OffsetToUtf16");let Y=Z.length,X=bY._utf8ByteLength(Z),J=X!==Y,Q=J?new Uint32Array(Y+1):null;if(J)Q[Y]=X;let $=J?new Uint32Array(X+1):null;if(J)$[X]=Y;let K=new Uint8Array(X),W=0;for(let U=0;U<Y;U++){let z=Z.charCodeAt(U),H=z,G=!1;if(z>=55296&&z<=56319){if(U+1<Y){let F=Z.charCodeAt(U+1);if(F>=56320&&F<=57343)H=(z-55296<<10)+65536|F-56320,G=!0}}if(J){if(Q[U]=W,G)Q[U+1]=W;if(H<=127)$[W+0]=U;else if(H<=2047)$[W+0]=U,$[W+1]=U;else if(H<=65535)$[W+0]=U,$[W+1]=U,$[W+2]=U;else $[W+0]=U,$[W+1]=U,$[W+2]=U,$[W+3]=U}if(H<=127)K[W++]=H;else if(H<=2047)K[W++]=192|(H&1984)>>>6,K[W++]=128|(H&63)>>>0;else if(H<=65535)K[W++]=224|(H&61440)>>>12,K[W++]=128|(H&4032)>>>6,K[W++]=128|(H&63)>>>0;else K[W++]=240|(H&1835008)>>>18,K[W++]=128|(H&258048)>>>12,K[W++]=128|(H&4032)>>>6,K[W++]=128|(H&63)>>>0;if(G)U++}this.utf16Length=Y,this.utf8Length=X,this.utf16Value=Z,this.utf8Value=K,this.utf16OffsetToUtf8=Q,this.utf8OffsetToUtf16=$}static _utf8ByteLength(Z){let Y=0;for(let X=0,J=Z.length;X<J;X++){let Q=Z.charCodeAt(X),$=Q,K=!1;if(Q>=55296&&Q<=56319){if(X+1<J){let W=Z.charCodeAt(X+1);if(W>=56320&&W<=57343)$=(Q-55296<<10)+65536|W-56320,K=!0}}if($<=127)Y+=1;else if($<=2047)Y+=2;else if($<=65535)Y+=3;else Y+=4;if(K)X++}return Y}createString(Z){let Y=Z.omalloc(this.utf8Length);return Z.HEAPU8.set(this.utf8Value,Y),Y}}var TY=class Z{constructor(Y){if(qZ(this,"id",++Z.LAST_ID),qZ(this,"_onigBinding"),qZ(this,"content"),qZ(this,"utf16Length"),qZ(this,"utf8Length"),qZ(this,"utf16OffsetToUtf8"),qZ(this,"utf8OffsetToUtf16"),qZ(this,"ptr"),!NZ)throw new EY("Must invoke loadWasm first.");this._onigBinding=NZ,this.content=Y;let X=new bY(Y);if(this.utf16Length=X.utf16Length,this.utf8Length=X.utf8Length,this.utf16OffsetToUtf8=X.utf16OffsetToUtf8,this.utf8OffsetToUtf16=X.utf8OffsetToUtf16,this.utf8Length<1e4&&!Z._sharedPtrInUse){if(!Z._sharedPtr)Z._sharedPtr=NZ.omalloc(1e4);Z._sharedPtrInUse=!0,NZ.HEAPU8.set(X.utf8Value,Z._sharedPtr),this.ptr=Z._sharedPtr}else this.ptr=X.createString(NZ)}convertUtf8OffsetToUtf16(Y){if(this.utf8OffsetToUtf16){if(Y<0)return 0;if(Y>this.utf8Length)return this.utf16Length;return this.utf8OffsetToUtf16[Y]}return Y}convertUtf16OffsetToUtf8(Y){if(this.utf16OffsetToUtf8){if(Y<0)return 0;if(Y>this.utf16Length)return this.utf8Length;return this.utf16OffsetToUtf8[Y]}return Y}dispose(){if(this.ptr===Z._sharedPtr)Z._sharedPtrInUse=!1;else this._onigBinding.ofree(this.ptr)}};qZ(TY,"LAST_ID",0);qZ(TY,"_sharedPtr",0);qZ(TY,"_sharedPtrInUse",!1);var OJ=TY;class qJ{constructor(Z){if(qZ(this,"_onigBinding"),qZ(this,"_ptr"),!NZ)throw new EY("Must invoke loadWasm first.");let Y=[],X=[];for(let K=0,W=Z.length;K<W;K++){let U=new bY(Z[K]);Y[K]=U.createString(NZ),X[K]=U.utf8Length}let J=NZ.omalloc(4*Z.length);NZ.HEAPU32.set(Y,J/4);let Q=NZ.omalloc(4*Z.length);NZ.HEAPU32.set(X,Q/4);let $=NZ.createOnigScanner(J,Q,Z.length);for(let K=0,W=Z.length;K<W;K++)NZ.ofree(Y[K]);if(NZ.ofree(Q),NZ.ofree(J),$===0)UW(NZ);this._onigBinding=NZ,this._ptr=$}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(Z,Y,X){let J=0;if(typeof X==="number")J=X;if(typeof Z==="string"){Z=new OJ(Z);let Q=this._findNextMatchSync(Z,Y,!1,J);return Z.dispose(),Q}return this._findNextMatchSync(Z,Y,!1,J)}_findNextMatchSync(Z,Y,X,J){let Q=this._onigBinding,$=Q.findNextOnigScannerMatch(this._ptr,Z.id,Z.ptr,Z.utf8Length,Z.convertUtf16OffsetToUtf8(Y),J);if($===0)return null;let K=Q.HEAPU32,W=$/4,U=K[W++],z=K[W++],H=[];for(let G=0;G<z;G++){let F=Z.convertUtf8OffsetToUtf16(K[W++]),M=Z.convertUtf8OffsetToUtf16(K[W++]);H[G]={start:F,end:M,length:M-F}}return{index:U,captureIndices:H}}}function zW(Z){return typeof Z.instantiator==="function"}function HW(Z){return typeof Z.default==="function"}function GW(Z){return typeof Z.data<"u"}function OW(Z){return typeof Response<"u"&&Z instanceof Response}function qW(Z){return typeof ArrayBuffer<"u"&&(Z instanceof ArrayBuffer||ArrayBuffer.isView(Z))||typeof Buffer<"u"&&Buffer.isBuffer?.(Z)||typeof SharedArrayBuffer<"u"&&Z instanceof SharedArrayBuffer||typeof Uint32Array<"u"&&Z instanceof Uint32Array}var VY;function FW(Z){if(VY)return VY;async function Y(){NZ=await $W(async(X)=>{let J=Z;if(J=await J,typeof J==="function")J=await J(X);if(typeof J==="function")J=await J(X);if(zW(J))J=await J.instantiator(X);else if(HW(J))J=await J.default(X);else{if(GW(J))J=J.data;if(OW(J))if(typeof WebAssembly.instantiateStreaming==="function")J=await MW(J)(X);else J=await NW(J)(X);else if(qW(J))J=await iX(J)(X);else if(J instanceof WebAssembly.Module)J=await iX(J)(X);else if("default"in J&&J.default instanceof WebAssembly.Module)J=await iX(J.default)(X)}if("instance"in J)J=J.instance;if("exports"in J)J=J.exports;return J})}return VY=Y(),VY}function iX(Z){return(Y)=>WebAssembly.instantiate(Z,Y)}function MW(Z){return(Y)=>WebAssembly.instantiateStreaming(Z,Y)}function NW(Z){return async(Y)=>{let X=await Z.arrayBuffer();return WebAssembly.instantiate(X,Y)}}async function FJ(Z){if(Z)await FW(Z);return{createScanner(Y){return new qJ(Y.map((X)=>typeof X==="string"?X:X.source))},createString(Y){return new OJ(Y)}}}var MJ=WJ({langs:HJ,themes:GJ,engine:()=>FJ(import("./chunk-q86xqx6c.js"))}),{codeToHtml:_W,codeToHast:wW,codeToTokens:rX,codeToTokensBase:AW,codeToTokensWithThemes:BW,getSingletonHighlighter:LW,getLastGrammarState:PW}=UJ(MJ,{guessEmbeddedLanguages:t6});var vZ={h1:{bold:!0,marginBottom:1,color:"#f74cc7ff"},h2:{bold:!0,marginBottom:1,color:"#326cfcff"},h3:{bold:!0,color:"#24ffedff"},h4:{bold:!0,color:"#e29418ff"},h5:{bold:!0,color:"#9fc214ff"},h6:{bold:!0,dimColor:!0,color:"#88eb2bff"},paragraph:{},blockquote:{paddingLeft:1,dimColor:!0,borderTop:!1,borderBottom:!1,borderRight:!1,borderStyle:"single",borderDimColor:!0},code:{marginTop:1},codespan:{dimColor:!0},list:{},listItem:{bullet:"●",paddingLeft:2},hr:{char:"─",width:40,dimColor:!0},link:{color:"#343afcff",underline:!0},strong:{bold:!0},em:{italic:!0},del:{strikethrough:!0,dimColor:!0},image:{color:"blue"},table:{},tableCell:{paddingRight:2}},CW=["color","backgroundColor","dimColor","bold","italic","underline","strikethrough","inverse","wrap"],vW=["paddingLeft","paddingRight","paddingTop","paddingBottom","padding","paddingX","paddingY","marginLeft","marginRight","marginTop","marginBottom","margin","marginX","marginY","borderStyle","borderColor","borderTop","borderBottom","borderLeft","borderRight","borderDimColor","borderTopColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopDimColor","borderBottomDimColor","borderLeftDimColor","borderRightDimColor"];async function IW(Z,Y,X="github-dark"){try{let J=await rX(Z,{lang:Y||"text",theme:X}),Q=[],$=0;for(let K=0;K<J.tokens.length;K++){let W=J.tokens[K];if(W){for(let U of W){let z=U.color||void 0;Q.push(V.jsx(O,{color:z,children:U.content},`token-${$}`)),$++}if(K<J.tokens.length-1)Q.push(V.jsx(O,{children:`
|
|
149
|
+
`},`nl-${K}`))}}return Q}catch{return null}}function PZ(Z){if(!Z)return{};let Y={};for(let X of CW)if(X in Z)Y[X]=Z[X];return Y}function Z4(Z){if(!Z)return{};let Y={};for(let X of vW)if(X in Z)Y[X]=Z[X];return Y}function IZ(Z,Y){if(!Z&&!Y)return{};if(!Z)return Y;if(!Y)return Z;return{...Z,...Y}}function DW({code:Z,language:Y,style:X,theme:J}){let[Q,$]=cZ.useState(null),[K,W]=cZ.useState(!0);if(cZ.useEffect(()=>{let U=!1;async function z(){try{let H=await IW(Z,Y,J);if(!U)$(H),W(!1)}catch{if(!U)$(null),W(!1)}}return z(),()=>{U=!0}},[Z,Y,J]),K||!Q)return V.jsx(N,{...Z4(X),children:V.jsx(O,{...PZ(X),children:Z})});return V.jsx(N,{paddingX:2,paddingY:1,...Z4(X),children:V.jsx(O,{...PZ(X),children:Q})})}function yZ(Z,Y,X){if(!Z||Z.length===0)return null;return Z.map((J,Q)=>{let $=`inline-${Q}`;switch(J.type){case"text":case"escape":{let K=J;if("tokens"in K&&K.tokens)return V.jsx(O,{children:yZ(K.tokens,Y,X)},$);return V.jsx(O,{children:K.text},$)}case"strong":{let K=J,W=IZ(vZ.strong,Y.strong);if(X.strong)return V.jsx(O,{children:X.strong(yZ(K.tokens,Y,X),K)},$);return V.jsx(O,{...PZ(W),children:yZ(K.tokens,Y,X)},$)}case"em":{let K=J,W=IZ(vZ.em,Y.em);if(X.em)return V.jsx(O,{children:X.em(yZ(K.tokens,Y,X),K)},$);return V.jsx(O,{...PZ(W),children:yZ(K.tokens,Y,X)},$)}case"del":{let K=J,W=IZ(vZ.del,Y.del);if(X.del)return V.jsx(O,{children:X.del(yZ(K.tokens,Y,X),K)},$);return V.jsx(O,{...PZ(W),children:yZ(K.tokens,Y,X)},$)}case"codespan":{let K=J,W=IZ(vZ.codespan,Y.codespan);if(X.codespan)return V.jsx(O,{children:X.codespan(K.text,K)},$);return V.jsx(O,{...PZ(W),children:K.text},$)}case"link":{let K=J,W=IZ(vZ.link,Y.link);if(X.link)return V.jsx(O,{children:X.link(K.text,K.href,K.title,K)},$);return V.jsxs(O,{...PZ(W),children:[K.text,K.href&&` (${K.href})`]},$)}case"image":{let K=J,W=IZ(vZ.image,Y.image);if(X.image)return V.jsx(O,{children:X.image(K.text,K.href,K.title,K)},$);return V.jsxs(O,{...PZ(W),children:["[Image: ",K.text||K.href,"]"]},$)}case"br":return V.jsx(O,{children:`
|
|
150
|
+
`},$);default:if("text"in J)return V.jsx(O,{children:J.text},$);return null}})}function oX(Z,Y,X,J,Q,$="github-dark"){switch(Z.type){case"heading":{let K=Z,W=`h${K.depth}`,U=`h${K.depth}`,z=X[W];if(z)return z(K.text,K);let H=IZ(vZ[U],Y[U]),G=typeof H.showSharp=="boolean"?H.showSharp:Boolean(J);return V.jsx(N,{...Z4(H),children:V.jsxs(O,{...PZ(H),children:[G&&`${"#".repeat(K.depth)} `,yZ(K.tokens,Y,X)]})})}case"paragraph":{let K=Z,W=IZ(vZ.paragraph,Y.paragraph),U=yZ(K.tokens,Y,X);if(X.paragraph)return X.paragraph(U,K);return V.jsx(N,{...Z4(W),children:V.jsx(O,{...PZ(W),children:U})})}case"code":{let K=Z,W=IZ(vZ.code,Y.code);if(X.code)return X.code(K.text,K.lang,K);if(Q)return V.jsx(DW,{code:K.text,language:K.lang,style:W,theme:$});return V.jsx(N,{...Z4(W),children:V.jsx(O,{...PZ(W),children:K.text})})}case"blockquote":{let K=Z,W=IZ(vZ.blockquote,Y.blockquote),U=K.tokens.map((z,H)=>V.jsx(N,{children:oX(z,Y,X,J,Q,$)},`bq-${H}`));if(X.blockquote)return X.blockquote(U,K);return V.jsx(N,{...Z4(W),children:V.jsx(N,{flexDirection:"column",children:K.tokens.map((z,H)=>{if(oX(z,Y,X,J,Q,$))return V.jsx(O,{...PZ(W),children:z.type==="paragraph"?yZ(z.tokens,Y,X):z.text||""},`bq-text-${H}`);return null})})})}case"list":{let K=Z,W=IZ(vZ.list,Y.list),U=IZ(vZ.listItem,Y.listItem),z=U.bullet||"●",H=K.items.map((G,F)=>{let M=typeof K.start=="number"?K.start:1,_=K.ordered?`${M+F}. `:`${z} `,A=yZ(G.tokens,Y,X);if(X.listItem)return V.jsx(N,{...Z4(U),children:X.listItem(A,G)},`li-${F}`);return V.jsx(N,{...Z4(U),children:V.jsxs(O,{...PZ(U),children:[_,A]})},`li-${F}`)});if(X.list)return X.list(H,K.ordered,K);return V.jsx(N,{flexDirection:"column",...Z4(W),children:H})}case"hr":{let K=Z,W=IZ(vZ.hr,Y.hr),U=W.char||"─",z=W.width||40;if(X.hr)return X.hr(K);return V.jsx(N,{...Z4(W),children:V.jsx(O,{...PZ(W),children:U.repeat(z)})})}case"table":{let K=Z,W=IZ(vZ.table,Y.table),U=IZ(vZ.tableCell,Y.tableCell),z=(B)=>B.map((C)=>{if("text"in C)return C.text;return""}).join(""),H=K.header.map((B,C)=>{let R=z(B.tokens).length,D=Math.max(...K.rows.map((j)=>{let E=j[C]?.tokens;return E?z(E).length:0}),0);return Math.max(R,D,3)}),G=V.jsxs(O,{dimColor:!0,children:["┌─",H.map((B)=>"─".repeat(B)).join("─┬─"),"─┐"]}),F=V.jsxs(O,{children:[V.jsx(O,{dimColor:!0,children:"│ "}),K.header.map((B,C)=>{let R=yZ(B.tokens,Y,X),D=z(B.tokens);return V.jsxs(O,{children:[V.jsxs(O,{bold:!0,...PZ(U),children:[R," ".repeat(Math.max(0,(H[C]||3)-D.length))]}),V.jsxs(O,{dimColor:!0,children:[" │",C<K.header.length-1?" ":""]})]},`th-${C}`)})]}),M=V.jsxs(O,{dimColor:!0,children:["├─",H.map((B)=>"─".repeat(B)).join("─┼─"),"─┤"]}),_=K.rows.map((B,C)=>V.jsxs(O,{children:[V.jsx(O,{dimColor:!0,children:"│ "}),B.map((R,D)=>{let j=yZ(R.tokens,Y,X),E=z(R.tokens),c=H[D]||3;return V.jsxs(O,{children:[V.jsxs(O,{...PZ(U),children:[j," ".repeat(Math.max(0,c-E.length))]}),V.jsxs(O,{dimColor:!0,children:[" │",D<B.length-1?" ":""]})]},`td-${C}-${D}`)})]},`tr-${C}`)),A=V.jsxs(O,{dimColor:!0,children:["└─",H.map((B)=>"─".repeat(B)).join("─┴─"),"─┘"]}),P=V.jsxs(V.Fragment,{children:[G,F,M,_,A]});if(X.table)return X.table(F,_,K);return V.jsx(N,{flexDirection:"column",...Z4(W),children:P})}case"space":return V.jsx(O,{children:`
|
|
151
|
+
`});case"html":return V.jsx(O,{dimColor:!0,children:Z.text});default:if("text"in Z)return V.jsx(O,{children:Z.text});return null}}var NJ=cZ.memo(function({token:Z,styles:Y,renderers:X,showSharp:J,highlight:Q,theme:$}){return V.jsx(V.Fragment,{children:oX(Z,Y,X,J,Q,$)})},(Z,Y)=>Z.token===Y.token);NJ.displayName="MemoizedBlock";function VW({children:Z,id:Y,styles:X={},renderers:J={},showSharp:Q=!1,highlight:$=!0,theme:K="github-dark"}){let W=cZ.useId(),U=Y||W,z=cZ.useMemo(()=>d.lexer(Z,{silent:!0,gfm:!0}),[Z]);return V.jsx(N,{flexDirection:"column",children:z.map((H,G)=>V.jsx(NJ,{token:H,styles:X,renderers:J,showSharp:Q,highlight:$,theme:K},`${U}-block-${G}`))})}var _J=cZ.memo(VW);_J.displayName="Markdown";var EW=_J,wJ=EW;var AJ=L(x(),1);var x0=L(v(),1),BJ=({children:Z,color:Y,dim:X,bold:J,italic:Q})=>{let $=AJ.useMemo(()=>{return Z.split(`
|
|
152
152
|
`).map((K)=>K===""?`
|
|
153
|
-
`:K)},[Z]);return
|
|
153
|
+
`:K)},[Z]);return x0.jsxDEV(x0.Fragment,{children:$.map((K,W)=>x0.jsxDEV(O,{color:Y,dimColor:X,bold:J,italic:Q,children:K},W,!1,void 0,this))},void 0,!1,void 0,this)};var fY=L(x(),1),nX=L(v(),1),bW=(Z,Y,X=5)=>{if(!Y||!Z||Z.trim()==="")return Z;let J=Z.split(`
|
|
154
154
|
`);if(J.length<=X)return Z;let Q=J.length-X,$=J.slice(-X);return`\x1B[33m${Q} rows hidden...\x1B[0m
|
|
155
155
|
${$.join(`
|
|
156
|
-
`)}`},
|
|
157
|
-
`);return
|
|
158
|
-
`),Q=(
|
|
156
|
+
`)}`},TW=({children:Z,simple:Y,loading:X,maxRows:J=5})=>{let Q=fY.useMemo(()=>{return bW(Z,X,J)},[Z,X,J]);if(Y)return nX.jsxDEV(BJ,{children:Q},void 0,!1,void 0,this);return nX.jsxDEV(wJ,{children:Q},void 0,!1,void 0,this)},LJ=fY.memo(TW);var kZ=L(v(),1),fW=({message:Z,messageNumber:Y,loading:X})=>{let Q=h8(Z),$=Q0(Z);if(!$)return kZ.jsxDEV(kZ.Fragment,{},void 0,!1,void 0,this);return kZ.jsxDEV(N,{flexDirection:"column",children:[kZ.jsxDEV(N,{paddingBottom:0,marginBottom:1,children:kZ.jsxDEV(O,{color:bZ("teal"),children:[Y," ","Zen Code"]},void 0,!0,void 0,this)},void 0,!1,void 0,this),Q&&kZ.jsxDEV(jW,{thinking:Q,visible:$.trim().length===0},void 0,!1,void 0,this),kZ.jsxDEV(LJ,{simple:!1,loading:X,children:$},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},jW=({thinking:Z,visible:Y})=>{let X=Z.split(`
|
|
157
|
+
`);return kZ.jsxDEV(N,{flexDirection:"column",marginBottom:1,children:[kZ.jsxDEV(N,{paddingBottom:0,children:kZ.jsxDEV(O,{color:"gray",bold:!0,children:["Think ",X.length," rows"]},void 0,!0,void 0,this)},void 0,!1,void 0,this),Y&&kZ.jsxDEV(PJ,{content:Z,maxLines:3},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},jY=fW;var f=L(v(),1),RJ=["yellow","magenta","blue"],SW=(Z)=>{let Y=0;for(let J=0;J<Z.length;J++)Y=Z.charCodeAt(J)+((Y<<5)-Y);let X=Math.abs(Y%RJ.length);return RJ[X]},yW=(Z)=>{return{success:"✓",completed:"✓",ok:"✓",error:"✗",failed:"✗",pending:"⏳",in_progress:"⏳",running:"⏳",cancelled:"⏹"}[Z]||"⏳"},kW=(Z,Y=4,X=100)=>{let J=Z.split(`
|
|
158
|
+
`),Q=(W)=>{if(W.length<=X)return W;return W.substring(0,X)+`... (${W.length-X} more chars)`};if(J.length<=Y)return J.map(Q).join(`
|
|
159
159
|
`);let $=J.slice(0,2).map(Q),K=J.slice(J.length-3).map(Q);return[...$,`... and more ${J.length-5} lines`,...K].join(`
|
|
160
|
-
`)},
|
|
160
|
+
`)},hW=({content:Z})=>{let Y=(X,J=0,Q=0)=>{let K=" ".repeat(J);if(Q>=3)return f.jsxDEV(O,{dimColor:!0,children:"{...} (truncated)"},void 0,!1,void 0,this);if(X===null)return f.jsxDEV(O,{color:"gray",children:"null"},void 0,!1,void 0,this);if(typeof X!=="object"){let z=JSON.stringify(X);if(typeof X==="string"&&z.length>102){let H=z.substring(1,101);return f.jsxDEV(O,{children:[f.jsxDEV(O,{color:"cyan",children:['"',H,'..."']},void 0,!0,void 0,this)," ",f.jsxDEV(O,{dimColor:!0,children:["(truncated, ",z.length-2," chars)"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}if(typeof X==="string")return f.jsxDEV(O,{color:"cyan",children:z},void 0,!1,void 0,this);else if(typeof X==="number")return f.jsxDEV(O,{color:"yellow",children:X},void 0,!1,void 0,this);else if(typeof X==="boolean")return f.jsxDEV(O,{color:"magenta",children:X.toString()},void 0,!1,void 0,this);else return f.jsxDEV(O,{children:z},void 0,!1,void 0,this)}if(Array.isArray(X)){if(X.length===0)return f.jsxDEV(O,{color:"gray",children:"[]"},void 0,!1,void 0,this);let z=5;return f.jsxDEV(f.Fragment,{children:[`
|
|
161
161
|
`,X.slice(0,z).map((H,G)=>f.jsxDEV(O,{children:[f.jsxDEV(O,{children:K},void 0,!1,void 0,this),f.jsxDEV(O,{color:"green",children:"- "},void 0,!1,void 0,this)," ",Y(H,J+1,Q+1),G<Math.min(X.length,z)-1?`
|
|
162
162
|
`:""]},void 0,!0,void 0,this)),X.length>z&&f.jsxDEV(O,{children:[`
|
|
163
|
-
`,f.jsxDEV(O,{children:K},void 0,!1,void 0,this),f.jsxDEV(O,{dimColor:!0,children:["... (",X.length-z," more)"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}let
|
|
164
|
-
`:""]},void 0,!0,void 0,this)),
|
|
165
|
-
`,f.jsxDEV(O,{children:K},void 0,!1,void 0,this),f.jsxDEV(O,{dimColor:!0,children:["... (",
|
|
163
|
+
`,f.jsxDEV(O,{children:K},void 0,!1,void 0,this),f.jsxDEV(O,{dimColor:!0,children:["... (",X.length-z," more)"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}let W=Object.keys(X);if(W.length===0)return f.jsxDEV(O,{color:"gray"},void 0,!1,void 0,this);let U=5;return f.jsxDEV(f.Fragment,{children:[W.slice(0,U).map((z,H)=>f.jsxDEV(O,{children:[f.jsxDEV(O,{children:K},void 0,!1,void 0,this),f.jsxDEV(O,{color:"blue",children:z},void 0,!1,void 0,this)," ",f.jsxDEV(O,{color:"gray",children:": "},void 0,!1,void 0,this)," ",Y(X[z],J+1,Q+1),H<Math.min(W.length,U)-1?`
|
|
164
|
+
`:""]},void 0,!0,void 0,this)),W.length>U&&f.jsxDEV(O,{children:[`
|
|
165
|
+
`,f.jsxDEV(O,{children:K},void 0,!1,void 0,this),f.jsxDEV(O,{dimColor:!0,children:["... (",W.length-U," more)"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)};return f.jsxDEV(O,{children:Y(Z)},void 0,!1,void 0,this)},xW=({message:Z,messageNumber:Y})=>{let{getToolUIRender:X,client:J}=WZ(),Q=new tY(Z,J),$=Q.getInputRepaired(),K=$?.title?`: ${$.title}`:$?.description?`: ${$.description}`:"",W=Z.name?X(Z.name):null,U=SW(Z.name||"");return U=Z.status==="error"?"red":"yellow",f.jsxDEV(o,{children:f.jsxDEV(N,{flexDirection:"column",children:[f.jsxDEV(N,{children:[f.jsxDEV(O,{color:U,children:[Y," ",Z.name,f.jsxDEV(O,{color:"gray",children:K},void 0,!1,void 0,this)]},void 0,!0,void 0,this),f.jsxDEV(O,{children:[" ",yW(Z?.status)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),W?f.jsxDEV(N,{children:[f.jsxDEV(O,{color:"gray",children:"└─ "},void 0,!1,void 0,this),f.jsxDEV(N,{flexDirection:"column",children:W(Z)},void 0,!1,void 0,this)]},void 0,!0,void 0,this):f.jsxDEV(N,{flexDirection:"column",paddingTop:0,children:[f.jsxDEV(N,{children:[f.jsxDEV(O,{color:"gray",children:"└─ "},void 0,!1,void 0,this),f.jsxDEV(hW,{content:Q.getInputRepaired()},void 0,!1,void 0,this)]},void 0,!0,void 0,this),f.jsxDEV(N,{paddingTop:0,paddingBottom:0,children:[f.jsxDEV(O,{color:"gray",children:"└─ "},void 0,!1,void 0,this),f.jsxDEV(O,{dimColor:!0,italic:!0,children:kW(CJ(Z.content))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),Z.sub_messages?.length?f.jsxDEV(N,{children:[f.jsxDEV(O,{color:"gray",children:"└─ "},void 0,!1,void 0,this),f.jsxDEV(O,{color:U,dimColor:!0,children:["(hidden ",Z.sub_messages.length," subagent messages)"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this):null]},void 0,!0,void 0,this)},void 0,!1,void 0,this)},vJ=xW;var S4=L(v(),1),IJ=yY.memo(function({renderMessages:Y,startIndex:X,staticKey:J,loading:Q}){let[$,K]=yY.useState(!1);jZ(()=>K(!0),$?null:0);let W=(G,F,M,_)=>S4.jsxDEV(N,{flexDirection:"column",borderStyle:M?"double":"single",borderLeft:!0,paddingLeft:1,paddingBottom:1,borderBottom:!1,borderTop:!1,borderRight:!1,borderLeftColor:G.type==="ai"?bZ("teal"):G.type==="human"?bZ("amber"):"yellow",children:G.type==="human"?S4.jsxDEV(t0,{content:G.content,messageNumber:F+1+X},void 0,!1,void 0,this):G.type==="tool"?S4.jsxDEV(vJ,{message:G,messageNumber:F+1+X},void 0,!1,void 0,this):S4.jsxDEV(jY,{message:G,messageNumber:F+1+X,loading:Q},void 0,!1,void 0,this)},G.id?`${_}-${G.id}`:`${_}-msg-${F}`,!1,void 0,this),U=Y.findIndex((G)=>{if(G.type==="tool"&&!G.done&&!["success","error"].includes(G.status))return!0;return!1});if(U===-1)U=Y.length-1;let z=Y.slice(0,U),H=Y.slice(U);if(!$)return S4.jsxDEV(N,{flexDirection:"column",children:Y.map((G,F)=>W(G,F,F===U,"init"))},void 0,!1,void 0,this);return S4.jsxDEV(N,{flexDirection:"column",children:[S4.jsxDEV(SY,{items:z,children:(G,F)=>W(G,F,!1,"hist")},J,!1,void 0,this),H.map((G,F)=>W(G,z.length+F,!0,"curr"))]},void 0,!0,void 0,this)});var y4=L(x(),1);var F0=L(x(),1);var kY=L(v(),1),gW=({staticKey:Z,children:Y,delay:X=1})=>{let[J,Q]=F0.useState(!0),$=F0.useRef(!0);return F0.useEffect(()=>{Q(!1),$.current=!0},[Z]),jZ(()=>{if($.current)console.clear(),Q(!0),$.current=!1},J?null:X),kY.jsxDEV(kY.Fragment,{children:J?Y():null},void 0,!1,void 0,this)},DJ=gW;var JZ=L(v(),1),uW=y4.memo(function({toolGroup:Y,groupId:X,getToolUIRender:J,depth:Q=0,loading:$}){if(Q>1)return null;return JZ.jsxDEV(N,{flexDirection:"column",children:Y.map((K,W)=>{let U=K.name?J(K.name):null;if(!U)return null;let z=K.sub_messages?.length||0,H=K.sub_messages?.slice(-4)||[],G=z-H.length;return JZ.jsxDEV(y4.Fragment,{children:[JZ.jsxDEV(()=>{return JZ.jsxDEV(o,{fallback:K.name+" is error",children:U(K)},void 0,!1,void 0,this)},{},void 0,!1,void 0,this),H.length?JZ.jsxDEV(JZ.Fragment,{children:[G>0&&JZ.jsxDEV(N,{paddingLeft:2,children:JZ.jsxDEV(O,{dimColor:!0,children:["... ",G," more submessage",G>1?"s":""]},void 0,!0,void 0,this)},void 0,!1,void 0,this),JZ.jsxDEV(aX,{renderMessages:H,startIndex:1,depth:Q+1,staticKey:`sub-d${Q}-i${W}`,getToolUIRender:J,loading:$},void 0,!1,void 0,this)]},void 0,!0,void 0,this):null]},`${X}-${W}-${K.status}`,!0,void 0,this)})},void 0,!1,void 0,this)}),VJ=y4.memo(function({message:Y,displayIndex:X,isCurrent:J,startIndex:Q=0,getToolUIRender:$,depth:K=0,loading:W}){return JZ.jsxDEV(N,{flexDirection:"column",borderStyle:J?"double":"single",paddingBottom:1,borderLeft:!1,borderBottom:!1,borderTop:Y.type==="group"?!1:!0,borderRight:!1,borderTopColor:Y.type==="ai"?bZ("teal"):Y.type==="human"?bZ("amber"):bZ("rose"),children:[Y.type==="human"?JZ.jsxDEV(t0,{content:Y.content,messageNumber:X+1+Q},void 0,!1,void 0,this):null,Y.type==="ai"?JZ.jsxDEV(jY,{message:Y,messageNumber:X+1+Q,loading:W},void 0,!1,void 0,this):null,Y.type==="group"&&JZ.jsxDEV(JZ.Fragment,{children:JZ.jsxDEV(uW,{toolGroup:Y.toolGroup,groupId:Y.id,getToolUIRender:$,depth:K,loading:W},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}),EJ=(Z)=>{if(Z.type!=="ai")return!0;try{let Y=Q0(Z);return!!(Y&&Y.trim().length>0)}catch{return!1}},aX=y4.memo(function({renderMessages:Y,startIndex:X,staticKey:J,depth:Q=0,getToolUIRender:$,loading:K}){let W=y4.useMemo(()=>{let G=0;return Y.filter((F)=>{if(F.type==="ai")return EJ(F);return!0}).reduce((F,M)=>{if(M.type==="tool"){let _=F[F.length-1];if(_&&_.type==="group"&&_.toolGroup.length<5)_.toolGroup.push(M);else F.push({id:`tool-group-${G++}`,type:"group",toolGroup:[M]})}else F.push(M);return F},[])},[Y,EJ]),U=W.length-1;if(U===-1)U=W.length-1;if(!K)U=W.length;let z=W.slice(0,U),H=W.slice(U);return JZ.jsxDEV(N,{flexDirection:"column",children:[JZ.jsxDEV(DJ,{staticKey:`${J} ${z.length}`,children:()=>JZ.jsxDEV(SY,{items:z,children:(G,F)=>JZ.jsxDEV(VJ,{message:G,displayIndex:F,isCurrent:!1,startIndex:X,getToolUIRender:$,depth:Q,loading:K},G.id?`hist-${G.id}`:`hist-msg-${Q}-${F}`,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),H.map((G,F)=>JZ.jsxDEV(VJ,{message:G,displayIndex:z.length+F,isCurrent:!0,startIndex:X,getToolUIRender:$,depth:Q,loading:K},G.id?`curr-${G.id}`:`curr-msg-${Q}-${z.length}-${F}`,!1,void 0,this))]},void 0,!0,void 0,this)});var T=L(v(),1),mW=()=>{let Z=s0(),Y=new Date().toLocaleDateString(),{extraParams:X,AVAILABLE_MODELS:J,config:Q}=UZ(),$=X.mcp_config||{},K=Object.keys($).length,W=bJ(),U=process.platform,z=U==="darwin"?"macOS":U==="win32"?"Windows":"Linux",H=process.cwd(),G=Q?.provider_id||process.env.MODEL_PROVIDER||"openai",M=!!Q?.providers?.find((P)=>P.id===G)?.apiKey,_=J.length>0,A=M&&_;return T.jsxDEV(N,{flexDirection:"column",borderStyle:"round",borderColor:"cyan",paddingX:1,marginBottom:1,children:[T.jsxDEV(N,{flexDirection:"row",justifyContent:"space-between",borderBottom:!1,children:[T.jsxDEV(O,{color:"cyan",bold:!0,children:"ZEN CODE"},void 0,!1,void 0,this),T.jsxDEV(O,{color:"gray",children:Y},void 0,!1,void 0,this)]},void 0,!0,void 0,this),T.jsxDEV(N,{flexDirection:"row",marginTop:1,gap:2,children:[T.jsxDEV(N,{flexDirection:"column",children:T.jsxDEV(O,{color:"cyan",children:`███████╗███████╗███╗ ██╗
|
|
166
166
|
╚══███╔╝██╔════╝████╗ ██║
|
|
167
167
|
███╔╝ █████╗ ██╔██╗ ██║
|
|
168
168
|
███╔╝ ██╔══╝ ██║╚██╗██║
|
|
169
169
|
███████╗███████╗██║ ╚████║
|
|
170
|
-
╚══════╝╚══════╝╚═╝ ╚═══╝`},void 0,!1,void 0,this)},void 0,!1,void 0,this),T.jsxDEV(N,{flexDirection:"column",justifyContent:"center",flexGrow:1,children:[T.jsxDEV(N,{marginBottom:1,children:
|
|
170
|
+
╚══════╝╚══════╝╚═╝ ╚═══╝`},void 0,!1,void 0,this)},void 0,!1,void 0,this),T.jsxDEV(N,{flexDirection:"column",justifyContent:"center",flexGrow:1,children:[T.jsxDEV(N,{marginBottom:1,children:A?T.jsxDEV(O,{color:"green",bold:!0,children:[" ","[ SYSTEM ONLINE ]"]},void 0,!0,void 0,this):T.jsxDEV(O,{color:"red",bold:!0,children:[" ","[ CONFIG REQUIRED ]"]},void 0,!0,void 0,this)},void 0,!1,void 0,this),T.jsxDEV(N,{flexDirection:"column",gap:0,children:[T.jsxDEV(N,{children:[T.jsxDEV(O,{color:"blue",children:"USER::"},void 0,!1,void 0,this),T.jsxDEV(O,{color:"white",children:Z},void 0,!1,void 0,this)]},void 0,!0,void 0,this),T.jsxDEV(N,{children:[T.jsxDEV(O,{color:"blue",children:"ARCH::"},void 0,!1,void 0,this),T.jsxDEV(O,{color:"white",children:process.arch},void 0,!1,void 0,this)]},void 0,!0,void 0,this),T.jsxDEV(N,{children:[T.jsxDEV(O,{color:"blue",children:"PLATFORM::"},void 0,!1,void 0,this),T.jsxDEV(O,{color:"white",children:z},void 0,!1,void 0,this)]},void 0,!0,void 0,this),T.jsxDEV(N,{children:[T.jsxDEV(O,{color:"blue",children:"NODE::"},void 0,!1,void 0,this),T.jsxDEV(O,{color:"white",children:process.version},void 0,!1,void 0,this)]},void 0,!0,void 0,this),T.jsxDEV(N,{children:[T.jsxDEV(O,{color:"blue",children:"TERM::"},void 0,!1,void 0,this),T.jsxDEV(O,{color:"white",children:W},void 0,!1,void 0,this)]},void 0,!0,void 0,this),T.jsxDEV(N,{children:[T.jsxDEV(O,{color:"blue",children:[G?.toUpperCase(),"::"]},void 0,!0,void 0,this),T.jsxDEV(O,{color:_?"white":"red",children:_?X.model_id:"无可用模型"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),T.jsxDEV(N,{marginTop:1,paddingX:1,flexDirection:"column",gap:0,children:[T.jsxDEV(N,{children:T.jsxDEV(O,{color:"blue",children:"WORKING_DIR ::"},void 0,!1,void 0,this)},void 0,!1,void 0,this),T.jsxDEV(N,{children:T.jsxDEV(O,{color:"gray",children:H},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),!A&&T.jsxDEV(N,{marginTop:1,paddingX:1,flexDirection:"column",gap:0,children:[T.jsxDEV(O,{color:"red",bold:!0,children:["⚠️ 需要配置 ",G==="anthropic"?"Anthropic":"OpenAI"," API:"]},void 0,!0,void 0,this),!M&&T.jsxDEV(O,{color:"yellow",children:" • 请使用 /m 进入模型配置面板"},void 0,!1,void 0,this),!_&&T.jsxDEV(O,{color:"yellow",children:" • 请确保网络连接正常以获取模型列表"},void 0,!1,void 0,this),T.jsxDEV(O,{color:"gray",children:" • 配置后使用 /m 查看可用模型"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),T.jsxDEV(N,{marginTop:1,paddingTop:1,borderTop:!1,flexDirection:"row",justifyContent:"space-between",children:[T.jsxDEV(N,{gap:3,children:[T.jsxDEV(N,{children:[T.jsxDEV(O,{color:"green",children:"●"},void 0,!1,void 0,this),T.jsxDEV(O,{color:"white",dimColor:!0,children:[" ","AGENTS"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),T.jsxDEV(N,{children:[T.jsxDEV(O,{color:K>0?"green":"gray",children:"●"},void 0,!1,void 0,this),T.jsxDEV(O,{color:"white",dimColor:!0,children:[" ","MCP (",K,")"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),T.jsxDEV(N,{children:[A?T.jsxDEV(O,{color:"yellow",bold:!0,children:">>> WAITING_FOR_INPUT"},void 0,!1,void 0,this):T.jsxDEV(O,{color:"red",bold:!0,children:">>> CONFIGURATION_NEEDED"},void 0,!1,void 0,this),T.jsxDEV(O,{color:"yellow",dimColor:!0,children:[" ","▌"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},TJ=mW;var uY=L(x(),1);var u0=L(x(),1);class fJ{commands=new Map;aliases=new Map;register(Z){if(this.commands.set(Z.name,Z),Z.aliases)Z.aliases.forEach((Y)=>{this.aliases.set(Y,Z.name)})}getCommand(Z){let Y=this.aliases.get(Z)||Z;return this.commands.get(Y)}getAllCommands(){return Array.from(this.commands.values())}isCommand(Z){return Z.trim().startsWith("/")}parseCommand(Z){if(!this.isCommand(Z))return null;let X=Z.trim().slice(1).split(/\s+/),J=X[0],Q=X.slice(1);return{command:J,args:Q}}async executeCommand(Z,Y){let X=this.parseCommand(Z);if(!X)return{success:!1,message:"无效的命令格式"};let{command:J,args:Q}=X,$=this.getCommand(J);if(!$)return{success:!1,message:`未知命令: /${J}`};if($.requiresArgs&&Q.length===0)return{success:!1,message:`命令 /${J} 需要参数。用法: ${$.usage||`/${J} <args>`}`};if($.validateArgs&&!$.validateArgs(Q))return{success:!1,message:`命令 /${J} 参数无效。用法: ${$.usage||`/${J} <args>`}`};try{return await $.execute(Q,Y)}catch(K){return{success:!1,message:`命令执行失败: ${K instanceof Error?K.message:String(K)}`}}}getSuggestions(Z){if(!Z.startsWith("/"))return[];let Y=Z.slice(1).toLowerCase(),X=[];if(Y===""){let W=["new","history","task","agent","model","settings","mcp","knowledge","summarize","template","plan","interview","help"];for(let U of W){let z=this.commands.get(U);if(z)X.push({command:U,displayText:`/${U}`,description:z.description})}return X.slice(0,10)}let J=new Set(["history","knowledge","help","init","model","config"]),Q=[],$=[];for(let[W,U]of this.commands){let z=W.toLowerCase();if(z.startsWith(Y))Q.push({command:W,displayText:`/${W}`,description:U.description});else if(z.includes(Y))$.push({command:W,displayText:`/${W}`,description:U.description});if(U.aliases)for(let H of U.aliases){let G=H.toLowerCase();if(G.startsWith(Y))Q.push({command:W,displayText:`/${H}`,description:`${U.description} (别名)`});else if(G.includes(Y))$.push({command:W,displayText:`/${H}`,description:`${U.description} (别名)`})}}let K=(W,U)=>{let z=J.has(W.command)?1:0,H=J.has(U.command)?1:0;if(z!==H)return H-z;return W.displayText.length-U.displayText.length};return Q.sort(K),$.sort(K),X.push(...Q,...$),X.slice(0,10)}getHelp(Z){if(Z){let X=this.getCommand(Z);if(!X)return`未找到命令: /${Z}`;let J=`命令: /${X.name}
|
|
171
171
|
`;if(J+=`描述: ${X.description}
|
|
172
172
|
`,X.usage)J+=`用法: ${X.usage}
|
|
173
173
|
`;if(X.aliases&&X.aliases.length>0)J+=`别名: ${X.aliases.map((Q)=>`/${Q}`).join(", ")}
|
|
174
174
|
`;return J}let Y=`可用命令:
|
|
175
175
|
`;for(let X of this.getAllCommands())Y+=` /${X.name} - ${X.description}
|
|
176
176
|
`;return Y+=`
|
|
177
|
-
使用 /help <命令名> 获取具体命令的帮助信息`,Y}}var
|
|
178
|
-
`);if(Y[0]!=="---")return{metadata:{},content:Z};let X=Y.indexOf("---",1);if(X===-1)return{metadata:{},content:Z};let J=Y.slice(1,X),Q={};for(let K of J){let
|
|
179
|
-
`).trim();return{metadata:Q,content:$}}function
|
|
180
|
-
`),shouldClearInput:!0}}},
|
|
177
|
+
使用 /help <命令名> 获取具体命令的帮助信息`,Y}}var R4=new fJ;var jJ={name:"settings",description:"打开 Settings 面板(Model 和 Provider 配置)",aliases:["s","model","settings","m"],usage:"/settings",execute:async(Z,Y)=>{return Y.switchToSettings?.(),{success:!0,message:"打开 Settings 面板",shouldClearInput:!0}}};var pW={name:"new",description:"初始化新的对话会话",aliases:["new","n"],usage:"/new [主题]",execute:async(Z,Y)=>{let X=Z.join(" ");if(await Y.createNewChat(),X){let J=`我想开始一个关于 "${X}" 的新对话。`;return Y.sendMessage([{type:"human",content:J}]),{success:!0,message:`已创建新对话,主题: ${X}`,shouldClearInput:!0}}return{success:!0,message:"已创建新对话",shouldClearInput:!0}}},cW={name:"help",description:"显示命令帮助信息",aliases:["h","?"],usage:"/help [命令名]",execute:async(Z,Y)=>{let X=Z[0];return{success:!0,message:R4.getHelp(X),shouldClearInput:!0}}},dW={name:"task",description:"打开任务看板面板",aliases:["tasks","kanban"],usage:"/task",execute:async(Z,Y)=>{return Y.switchToTask?.(),{success:!0,message:"打开任务看板",shouldClearInput:!0}}},SJ=[pW,cW,dW,jJ];import{readFileSync as lW,readdirSync as iW}from"fs";import{join as yJ}from"path";var g0=null;function rW(Z){let Y=Z.split(`
|
|
178
|
+
`);if(Y[0]!=="---")return{metadata:{},content:Z};let X=Y.indexOf("---",1);if(X===-1)return{metadata:{},content:Z};let J=Y.slice(1,X),Q={};for(let K of J){let W=K.match(/^(\w+):\s*(.+)$/);if(W){let[,U,z]=W;if(U==="name")Q.name=z.trim();if(U==="description")Q.description=z.trim()}}let $=Y.slice(X+1).join(`
|
|
179
|
+
`).trim();return{metadata:Q,content:$}}function kJ(Z,Y){let X=new Map;try{let J=iW(Z,{withFileTypes:!0});for(let Q of J){let $=yJ(Z,Q.name);if(Q.isDirectory())kJ($,Y).forEach((W)=>X.set(W.name,W));else if(Q.name.endsWith(".md"))try{let K=lW($,"utf-8"),{metadata:W,content:U}=rW(K),z=W.name||Q.name.replace(/\.md$/,"");if(!W.name)console.warn(`Template missing "name" in frontmatter: ${$}`);X.set(z,{name:z,description:W.description||"No description",content:U,path:$})}catch(K){console.warn(`Failed to read template file: ${$}`,K)}}}catch(J){if(J.code!=="ENOENT")console.warn(`Error scanning templates directory: ${Z}`,J)}return X}function hJ(){g0=null}function xJ(Z="./.claude/templates"){if(g0)return Array.from(g0.values());let Y=Z.startsWith("/")?Z:yJ(process.cwd(),Z);return g0=kJ(Y,Y),Array.from(g0.values())}var oW={name:"status",description:"显示当前聊天状态信息",aliases:["stat","info"],execute:async(Z,Y)=>{return{success:!0,message:[`当前代理: ${Y.client?.availableAssistants.find((Q)=>Q.graph_id===Y.currentAgent)?.name||"未选择"} (${Y.currentAgent||"N/A"})`,`聊天ID: ${Y.client?.currentChatId?.slice(-8)||"N/A"}`,`可用代理数: ${Y.client?.availableAssistants?.length||0}`,`模型: ${Y.extraParams?.model_id||"N/A"}`].join(`
|
|
180
|
+
`),shouldClearInput:!0}}},nW={name:"template",description:"插入预定义的消息模板",aliases:["tpl","t"],usage:"/template <模板名>",execute:async(Z,Y)=>{let X=Z[0];if(Z.includes("--refresh"))return hJ(),{success:!0,message:"模板缓存已清除",shouldClearInput:!0};let J=xJ();if(!X){if(J.length===0)return{success:!0,message:"当前没有可用的模板。可以在 ./.claude/templates/ 目录下创建 .md 模板文件。",shouldClearInput:!0};return{success:!0,message:`可用模板:
|
|
181
181
|
${J.map((K)=>` - ${K.name}: ${K.description}`).join(`
|
|
182
182
|
`)}
|
|
183
183
|
|
|
184
184
|
使用 /template <name> 插入模板`,shouldClearInput:!0}}let Q=J.find(($)=>$.name===X);if(!Q){let $=J.map((K)=>K.name).join(", ");return{success:!1,message:`未找到模板 "${X}"。可用模板: ${$||"(无)"}`}}return Y.setUserInput(Q.content),{success:!0,message:`已插入模板: ${Q.name}
|
|
185
|
-
${Q.description}`,shouldClearInput:!1}}},
|
|
185
|
+
${Q.description}`,shouldClearInput:!1}}},aW={name:"config",description:"查看或设置配置项",aliases:["cfg"],usage:"/config [key] [value]",execute:async(Z,Y)=>{if(Z.length===0)return{success:!0,message:["当前配置:",` model_id: ${Y.extraParams?.model_id||"N/A"}`,` provider_id: ${Y.extraParams?.provider_id||"N/A"}`,` enable_thinking: ${Y.extraParams?.enable_thinking??!0}`,` compact_mode: ${Y.compactMode??!1}`,` stream_refresh_interval: ${Y.extraParams?.stream_refresh_interval}`,"","使用方法:"," /config <key> <value> - 设置配置项"," /config <key> - 查看配置项","","可用配置项:"," model_id - 当前使用的模型 ID"," provider_id - 当前使用的 Provider ID"," enable_thinking - 启用思考模式 (true, false)"," compact_mode - 紧凑模式 (true, false)"," stream_refresh_interval - 流刷新间隔"].join(`
|
|
186
186
|
`),shouldClearInput:!0};let X=Z[0],J=["enable_thinking","stream_refresh_interval","provider_id","model_id","compact_mode"];if(!J.includes(X))return{success:!1,message:`无效的配置项: ${X}
|
|
187
187
|
可用配置项: ${J.join(", ")}`,shouldClearInput:!0};if(Z.length===1){let $;switch(X){case"model_id":$=Y.extraParams?.model_id;break;case"provider_id":$=Y.extraParams?.provider_id;break;case"enable_thinking":$=Y.extraParams?.enable_thinking??!0;break;case"compact_mode":$=Y.compactMode??!1;break;case"stream_refresh_interval":$=Y.extraParams?.stream_refresh_interval;break}return{success:!0,message:`${X}: ${$??"未设置"}`,shouldClearInput:!0}}let Q=Z.slice(1).join(" ");if(X==="enable_thinking"||X==="compact_mode"){if(Q==="true"||Q==="1"||Q==="yes")Q=!0;else if(Q==="false"||Q==="0"||Q==="no")Q=!1}if(X==="stream_refresh_interval"){let $=parseInt(Q,10);if(!isNaN($))Q=$}try{if(!Y.updateConfig)return{success:!1,message:"无法访问配置更新功能",shouldClearInput:!0};await Y.updateConfig({[X]:Q});let $=`配置已更新: ${X} = ${Q} 重启程序生效`;if(X==="model_id"||X==="provider_id")$+=`
|
|
188
188
|
|
|
189
|
-
提示: 更换模型或提供商后,请重启程序以确保完整生效`;return{success:!0,message:$,shouldClearInput:!0}}catch($){return{success:!1,message:`配置更新失败: ${$ instanceof Error?$.message:String($)}`,shouldClearInput:!0}}}},
|
|
189
|
+
提示: 更换模型或提供商后,请重启程序以确保完整生效`;return{success:!0,message:$,shouldClearInput:!0}}catch($){return{success:!1,message:`配置更新失败: ${$ instanceof Error?$.message:String($)}`,shouldClearInput:!0}}}},sW={name:"mcp",description:"管理 MCP 服务器配置",aliases:[],usage:"/mcp [list|add|remove|get] [args]",execute:async(Z,Y)=>{if(Z.length===0)return{success:!0,message:["MCP 配置管理命令:","","用法:"," /mcp list - 列出所有 MCP 服务器"," /mcp add <name> <json_string> - 添加 MCP 服务器 (传统格式)"," /mcp remove <name> - 移除 MCP 服务器"," /mcp get <name> - 查看 MCP 服务器详情","","示例 (JSON 格式):",' /mcp add context7 {"name":"context7","url":"https://mcp.context7.com/mcp"}',""].join(`
|
|
190
190
|
`),shouldClearInput:!0};let X=Z[0];try{let Q=(Y.extraParams||{}).mcp_config||{};switch(X){case"list":{let $=Object.keys(Q);if($.length===0)return{success:!0,message:"当前未配置任何 MCP 服务器",shouldClearInput:!0};return{success:!0,message:`已配置的 MCP 服务器:
|
|
191
|
-
${$.map((
|
|
192
|
-
`)}`,shouldClearInput:!0}}case"add":{if(Z.length<2)return{success:!1,message:"用法: /mcp add <name> <json_string>",shouldClearInput:!0};let[$,K,...
|
|
191
|
+
${$.map((W)=>{return` - ${W}`}).join(`
|
|
192
|
+
`)}`,shouldClearInput:!0}}case"add":{if(Z.length<2)return{success:!1,message:"用法: /mcp add <name> <json_string>",shouldClearInput:!0};let[$,K,...W]=Z,U=W.join(""),z={...Q,[K]:JSON.parse(U)};if(!Y.updateConfig)return{success:!1,message:"无法访问配置更新功能",shouldClearInput:!0};return await Y.updateConfig({mcp_config:z}),{success:!0,message:`MCP 服务器 "${K}" 已添加`,shouldClearInput:!0}}case"remove":{if(Z.length<2)return{success:!1,message:"用法: /mcp remove <name>",shouldClearInput:!0};let $=Z[1];if(!Q[$])return{success:!1,message:`MCP 服务器 "${$}" 不存在`,shouldClearInput:!0};let K={...Q};if(delete K[$],!Y.updateConfig)return{success:!1,message:"无法访问配置更新功能",shouldClearInput:!0};return await Y.updateConfig({mcp_config:K}),{success:!0,message:`MCP 服务器 "${$}" 已移除
|
|
193
193
|
重启程序生效`,shouldClearInput:!0}}case"get":{if(Z.length<2)return{success:!1,message:"用法: /mcp get <name>",shouldClearInput:!0};let $=Z[1],K=Q[$];if(!K)return{success:!1,message:`MCP 服务器 "${$}" 不存在`,shouldClearInput:!0};return{success:!0,message:[`MCP 服务器: ${$}`,` URL: ${K.url}`,` Headers: ${JSON.stringify(K.headers||{},null,2)}`].join(`
|
|
194
194
|
`),shouldClearInput:!0}}default:return{success:!1,message:`未知操作: ${X}
|
|
195
|
-
可用操作: list, add, remove, get`,shouldClearInput:!0}}}catch(J){return{success:!1,message:`MCP 操作失败: ${J instanceof Error?J.message:String(J)}`,shouldClearInput:!0}}}},
|
|
195
|
+
可用操作: list, add, remove, get`,shouldClearInput:!0}}}catch(J){return{success:!1,message:`MCP 操作失败: ${J instanceof Error?J.message:String(J)}`,shouldClearInput:!0}}}},tW={name:"summarize",description:"智能总结对话并提取有价值信息保存为记忆",aliases:["sum","summary","compact"],usage:"/sum",execute:async(Z,Y)=>{if(!Y.renderMessages||Y.renderMessages.length===0)return{success:!1,message:"当前会话没有消息可以总结",shouldClearInput:!0};let X=Y.renderMessages.length;try{let J={...Y.extraParams,switch_command:"smart_memory"};return await Y.sendMessage([],{extraParams:J}),{success:!0,message:`正在智能分析 ${X} 条消息并提取记忆...`,shouldClearInput:!0}}catch(J){return{success:!1,message:`总结失败: ${J instanceof Error?J.message:String(J)}`,shouldClearInput:!0}}}},eW={name:"history",description:"打开历史面板",aliases:["h"],execute:async(Z,Y)=>{if(Y.switchToHistory)return Y.switchToHistory(),{success:!0,message:"已打开历史面板",shouldClearInput:!0};return{success:!1,message:"面板切换功能不可用",shouldClearInput:!0}}},Z2={name:"knowledge",description:"打开知识库面板",aliases:["k"],execute:async(Z,Y)=>{if(Y.switchToKnowledge)return Y.switchToKnowledge(),{success:!0,message:"已打开知识库面板",shouldClearInput:!0};return{success:!1,message:"面板切换功能不可用",shouldClearInput:!0}}},Y2={name:"close",description:"关闭当前面板返回聊天",aliases:["c","q"],execute:async(Z,Y)=>{if(Y.closePanel)return Y.closePanel(),{success:!0,message:"已关闭面板",shouldClearInput:!0};return{success:!1,message:"面板关闭功能不可用",shouldClearInput:!0}}},X2={name:"model",description:"打开模型/Provider配置面板",aliases:["mp","m"],execute:async(Z,Y)=>{if(Y.switchToModelProvider)return Y.switchToModelProvider(),{success:!0,message:"已打开模型/Provider配置面板",shouldClearInput:!0};return{success:!1,message:"模型面板切换功能不可用",shouldClearInput:!0}}},J2={name:"ralph",description:"进入循环模式,持续发送响应直到返回 <COMPLETE></COMPLETE>",aliases:[],usage:"/ralph <text>",requiresArgs:!0,execute:async(Z,Y)=>{let X=Z.join(" ");if(!X.trim())return{success:!1,message:"请提供要循环的文本内容",shouldClearInput:!0};if(Y.startRalphLoop)return Y.startRalphLoop(X),{success:!0,message:`进入 Ralph 循环模式: "${X}"`,shouldClearInput:!0};return{success:!1,message:"Ralph 循环功能不可用",shouldClearInput:!0}}},gJ=[oW,nW,aW,sW,tW,eW,Z2,Y2,X2,J2];var Q2={name:"agent",description:"打开 Agent 选择面板",aliases:["a"],usage:"/agent",execute:async(Z,Y)=>{if(Y.switchToAgent)Y.switchToAgent();return{success:!0,message:"打开 Agent 面板",shouldClearInput:!0}}},uJ=[Q2];var $2=`
|
|
196
196
|
[Interview Mode Activated]
|
|
197
197
|
|
|
198
198
|
I want to clarify requirements through guided questions.
|
|
@@ -211,8 +211,8 @@ After getting answers:
|
|
|
211
211
|
---
|
|
212
212
|
|
|
213
213
|
User's original message:
|
|
214
|
-
`,
|
|
215
|
-
用法: /interview [your request]`};let J
|
|
214
|
+
`,K2={name:"interview",description:"Start Interview mode to clarify requirements through questions",aliases:["i"],usage:"/interview [your request]",requiresArgs:!0,execute:async(Z,Y)=>{let X=Z.join(" ").trim();if(!X)return{success:!1,message:`❌ Interview 模式需要提供任务描述
|
|
215
|
+
用法: /interview [your request]`};let J=$2+X;return Y.sendMessage([{type:"human",content:J}],{extraParams:Y.extraParams}),{success:!0,message:"\uD83D\uDCCB Interview mode activated",shouldClearInput:!0}}},mJ=[K2];var W2=`
|
|
216
216
|
[Plan Mode Activated]
|
|
217
217
|
|
|
218
218
|
I want to create a comprehensive implementation plan for this task.
|
|
@@ -235,8 +235,8 @@ After the plan is created, ask if I want to execute it immediately or save for l
|
|
|
235
235
|
---
|
|
236
236
|
|
|
237
237
|
User's original request:
|
|
238
|
-
`,
|
|
239
|
-
用法: /plan [your task description]`};let J=
|
|
238
|
+
`,U2={name:"plan",description:"Enter Plan mode to create detailed implementation plans",aliases:["p"],usage:"/plan [your task description]",requiresArgs:!0,execute:async(Z,Y)=>{let X=Z.join(" ").trim();if(!X)return{success:!1,message:`❌ Plan 模式需要提供任务描述
|
|
239
|
+
用法: /plan [your task description]`};let J=W2+X;return Y.sendMessage([{type:"human",content:J}],{extraParams:Y.extraParams}),{success:!0,message:"\uD83D\uDCCB Plan mode activated",shouldClearInput:!0}}},pJ=[U2];var cJ=`
|
|
240
240
|
[Create AGENTS.md Mode Activated]
|
|
241
241
|
|
|
242
242
|
I want to create or update the AGENTS.md file for this project.
|
|
@@ -268,7 +268,7 @@ After the AGENTS.md is created or updated, provide a summary of the changes made
|
|
|
268
268
|
---
|
|
269
269
|
|
|
270
270
|
User's request:
|
|
271
|
-
`,
|
|
271
|
+
`,z2={name:"create-agent-md",description:"Create or update AGENTS.md file with project guidelines",aliases:["agentmd","am"],usage:"/create-agent-md [description or goal for AGENTS.md]",requiresArgs:!0,execute:async(Z,Y)=>{let X=Z.join(" ").trim();if(!X)return{success:!1,message:"❌ 需要提供描述或目标。例如: /create-agent-md 初始化项目指南文档",shouldClearInput:!1};let J=cJ+X;return Y.sendMessage([{type:"human",content:J}],{extraParams:Y.extraParams}),{success:!0,message:"\uD83D\uDCDD AGENTS.md creation mode activated",shouldClearInput:!0}}},H2={name:"init-agents-md",description:"快速初始化 AGENTS.md 项目指南文档",aliases:["iam","init-agents"],usage:"/init-agents-md",requiresArgs:!1,execute:async(Z,Y)=>{let J=cJ+"初始化项目 AGENTS.md 指南文档";return Y.sendMessage([{type:"human",content:J}],{extraParams:Y.extraParams}),{success:!0,message:"\uD83D\uDCDD 开始初始化 AGENTS.md...",shouldClearInput:!0}}},dJ=[z2,H2];var lJ={name:"compact-message",description:"切换紧凑消息显示模式 (紧凑模式显示简化的消息预览)",aliases:["cm"],usage:"/compact-message",requiresArgs:!1,execute:async(Z,Y)=>{try{let{updateConfig:X,compactMode:J}=Y;if(!X)return{success:!1,message:"配置更新功能不可用"};let Q=J??!1;return await X({compact_mode:!Q}),{success:!0,message:!Q?"紧凑模式已启用":"紧凑模式已关闭",shouldClearInput:!0}}catch(X){return{success:!1,message:`切换紧凑模式失败: ${X instanceof Error?X.message:String(X)}`}}}};var iJ={name:"mcp",description:"打开 MCP 服务器配置面板",aliases:[],usage:"/mcp",execute:async(Z,Y)=>{return Y.switchToMcp?.(),{success:!0,message:"打开 MCP 配置面板",shouldClearInput:!0}}};var rJ={name:"settings",description:"打开通用设置面板",aliases:["set"],usage:"/settings",execute:async(Z,Y)=>{if(Y.switchToSettings)return Y.switchToSettings(),{success:!0,message:"打开通用设置面板",shouldClearInput:!0};return{success:!1,message:"Settings 面板不可用",shouldClearInput:!0}}};var G2=`
|
|
272
272
|
[Memory Organization Mode Activated]
|
|
273
273
|
|
|
274
274
|
I want to organize and manage the .claude/memories folder.
|
|
@@ -322,26 +322,26 @@ Provide a detailed report of:
|
|
|
322
322
|
|
|
323
323
|
---
|
|
324
324
|
|
|
325
|
-
`,
|
|
325
|
+
`,O2={name:"memory-clear",description:"整理 .claude/memories 文件夹,清理、合并和优化项目记忆",aliases:["mem-clean","clean-memory"],usage:"/memory-clear",execute:async(Z,Y)=>{let X=Z.join(" ").trim(),J=G2+(X?`Additional context: ${X}
|
|
326
326
|
|
|
327
|
-
---`:"开始整理记忆文件夹。");return Y.sendMessage([{type:"human",content:J}],{extraParams:Y.extraParams}),{success:!0,message:"\uD83E\uDDE0 记忆整理模式已激活 - 正在分析 .claude/memories 文件夹...",shouldClearInput:!0}}},
|
|
328
|
-
`+"当前内存使用: "+
|
|
329
|
-
`)}var
|
|
327
|
+
---`:"开始整理记忆文件夹。");return Y.sendMessage([{type:"human",content:J}],{extraParams:Y.extraParams}),{success:!0,message:"\uD83E\uDDE0 记忆整理模式已激活 - 正在分析 .claude/memories 文件夹...",shouldClearInput:!0}}},oJ=[O2];function Y4(Z){if(Z===0)return"0 B";let Y=1024,X=["B","KB","MB","GB"],J=Math.floor(Math.log(Z)/Math.log(Y));return parseFloat((Z/Math.pow(Y,J)).toFixed(2))+" "+X[J]}function sX(){let Z=process.memoryUsage();return{heapTotal:Z.heapTotal,heapUsed:Z.heapUsed,external:Z.external,rss:Z.rss,heapUsedMB:(Z.heapUsed/1024/1024).toFixed(2),heapTotalMB:(Z.heapTotal/1024/1024).toFixed(2)}}function nJ(){return typeof Bun<"u"}function q2(){let Z=sX();if(nJ()&&typeof Bun.gc==="function"){Bun.gc(!0);let Y=sX(),X=Z.heapUsed-Y.heapUsed;return{success:!0,before:Z,after:Y,freed:X,message:`GC 执行成功,释放了 ${Y4(Math.max(0,X))} 内存`}}if(globalThis.global&&typeof globalThis.global.gc==="function"){globalThis.global.gc();let Y=sX(),X=Z.heapUsed-Y.heapUsed;return{success:!0,before:Z,after:Y,freed:X,message:`GC 执行成功,释放了 ${Y4(Math.max(0,X))} 内存`}}return{success:!1,before:Z,message:`/gc 命令仅在 Bun 或者 node --expose-gc 可用
|
|
328
|
+
`+"当前内存使用: "+Y4(Z.heapUsed)+" / "+Y4(Z.heapTotal)}}function F2(){let Z=[];if(!nJ())Z.push("/gc 命令仅支持 Bun 运行时,请使用 bun 启动应用");else Z.push("当前运行在 Bun 环境,/gc 命令已就绪");return Z.join(`
|
|
329
|
+
`)}var aJ={name:"gc",description:"手动触发垃圾回收,减少内存占用",aliases:["garbage-collect","mem-opt","memory"],usage:"/gc",execute:async(Z,Y)=>{let X=Z.includes("-v")||Z.includes("--verbose"),J=q2(),Q=`\uD83D\uDDD1️ ${J.message}
|
|
330
330
|
`;if(J.before&&J.after){if(Q+=`
|
|
331
331
|
\uD83D\uDCCA 内存统计:
|
|
332
|
-
`,Q+=` Before: ${
|
|
333
|
-
`,Q+=` After: ${
|
|
334
|
-
`,J.freed!==void 0&&J.freed>0)Q+=` Freed: ${
|
|
332
|
+
`,Q+=` Before: ${Y4(J.before.heapUsed)} / ${Y4(J.before.heapTotal)}
|
|
333
|
+
`,Q+=` After: ${Y4(J.after.heapUsed)} / ${Y4(J.after.heapTotal)}
|
|
334
|
+
`,J.freed!==void 0&&J.freed>0)Q+=` Freed: ${Y4(J.freed)}
|
|
335
335
|
`}else if(J.before)Q+=`
|
|
336
|
-
\uD83D\uDCCA 当前内存使用: ${
|
|
336
|
+
\uD83D\uDCCA 当前内存使用: ${Y4(J.before.heapUsed)} / ${Y4(J.before.heapTotal)}
|
|
337
337
|
`;if(!J.success||X)Q+=`
|
|
338
338
|
\uD83D\uDCA1 提示:
|
|
339
|
-
`,Q+=` ${
|
|
339
|
+
`,Q+=` ${F2().replace(/\n/g,`
|
|
340
340
|
`)}
|
|
341
|
-
`;return{success:J.success,message:Q,shouldClearInput:!0}}};[...
|
|
341
|
+
`;return{success:J.success,message:Q,shouldClearInput:!0}}};[...SJ,...gJ,...uJ,...mJ,...pJ,...dJ,...oJ,lJ,iJ,rJ,aJ].forEach((Z)=>{R4.register(Z)});var C4=L(v(),1),sJ=(Z)=>{let{onCommandExecuted:Y,switchToHistory:X,switchToKnowledge:J,switchToSettings:Q,switchToAgent:$,closePanel:K,switchToTask:W,switchToModelProvider:U,switchToMcp:z}=Z,{userInput:H,setUserInput:G,sendMessage:F,currentAgent:M,client:_,createNewChat:A,renderMessages:P}=WZ(),{extraParams:B,updateConfig:C,AVAILABLE_MODELS:R,compactMode:D}=UZ(),[j,E]=u0.useState(null),[c,i]=u0.useState(null);jZ(()=>{E(null)},j?3000:null),jZ(()=>{i(null)},c?5000:null);let g=H.startsWith("/"),r=g?R4.getSuggestions(H):[],n=g,F4=u0.useCallback(async(D4)=>{let M0=D4||H;if(!R4.isCommand(M0))return!1;try{let N0={userInput:M0,setUserInput:G,sendMessage(pY,W8={}){return F(pY,{extraParams:{...B,...W8.extraParams},...W8,metadata:W4})},currentAgent:M,client:_,extraParams:B,createNewChat(){return A(W4)},updateConfig:C,AVAILABLE_MODELS:R,renderMessages:P,compactMode:D,switchToHistory:X,switchToKnowledge:J,switchToSettings:Q,switchToModelProvider:U,switchToAgent:$,switchToTask:W,switchToMcp:z,closePanel:K,startRalphLoop:Z.startRalphLoop},V4=await R4.executeCommand(M0,N0);if(!V4.success)E(V4.message||"命令执行失败");else if(V4.message)i(V4.message);if(V4.shouldClearInput)G("");if(V4.shouldSendMessage&&V4.messageContent){let pY=[{type:"human",content:V4.messageContent}];F(pY,{extraParams:B})}return Y?.(),!0}catch(N0){return E(`命令执行错误: ${N0 instanceof Error?N0.message:String(N0)}`),!0}},[H,G,F,M,_,B,A,Y,R,D,X,J,Q,U,$,W,z,K,Z.startRalphLoop]);return{isCommandInput:g,commandSuggestions:r,showCommandHint:n,commandError:j,executeCommand:F4,CommandHintUI:()=>{if(!n||r.length===0)return null;return C4.jsxDEV(N,{marginBottom:1,flexDirection:"column",children:[C4.jsxDEV(O,{color:"yellow",bold:!0,children:"命令建议:"},void 0,!1,void 0,this),r.slice(0,5).map((D4,M0)=>C4.jsxDEV(O,{color:"cyan",children:[D4.displayText," - ",D4.description]},M0,!0,void 0,this)),r.length>5&&C4.jsxDEV(O,{color:"gray",children:["...还有 ",r.length-5," 个命令"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},CommandErrorUI:()=>{if(!j)return null;return C4.jsxDEV(N,{marginBottom:1,children:C4.jsxDEV(O,{color:"red",children:["❌ ",j]},void 0,!0,void 0,this)},void 0,!1,void 0,this)},CommandSuccessUI:()=>{if(!c)return null;return C4.jsxDEV(N,{marginBottom:1,children:C4.jsxDEV(O,{color:"green",children:["✅ ",c]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}}};function tJ({manager:Z,enabled:Y=!0}){return hY({queryKey:xY.skills.list(),queryFn:async()=>{if(!Z)throw Error("ConfigManager not initialized");return await Z.listSkills()},enabled:Y&&!!Z,staleTime:120000})}var M2=[{id:"agents/default",name:"Jarvis",description:"代码实现助手"},{id:"agents/manager",name:"Manager",description:"任务管理员"}];function eJ({enabled:Z=!0}={}){return hY({queryKey:xY.agents.list(),queryFn:async()=>{return M2},enabled:Z,staleTime:300000})}var X4=L(x(),1);function Z1({loading:Z,renderMessages:Y,sendMessage:X,setUserInput:J,extraParams:Q}){let[$,K]=X4.useState(null),[W,U]=X4.useState(!1),z=X4.useRef(!1),H=X4.useRef(0),G=X4.useCallback(async(M)=>{if(!M)return;let _=z.current?`
|
|
342
342
|
|
|
343
|
-
[System Context: You are currently in Ralph loop mode. Continue executing the task based on previous context. Respond with <COMPLETE></COMPLETE> tag when the task is complete.]`:"",
|
|
344
|
-
`||X==="\t"}function
|
|
345
|
-
`||X==="\t"}function dW(Z,Y){let X=Y+1;while(X<Z.length&&!/[\s\n\t]/.test(Z[X]))X++;return Z.slice(Y+1,X)}function cW(Z,Y,X){let J=Y.toLowerCase(),Q=Z.filter(($)=>{let K=$.name.toLowerCase(),U=$.id.toLowerCase();return K.startsWith(J)||U.includes(J)});return Q.sort(($,K)=>$.name.localeCompare(K.name)),Q.slice(0,X)}function i1({agents:Z,maxSuggestions:Y=5}){let[X,J]=Z4.useState({visible:!1,query:"",filteredAgents:[],triggerPosition:-1}),Q=Z4.useCallback((z,H)=>{let G=z.lastIndexOf("@");if(G===-1){J((A)=>({...A,visible:!1,query:"",filteredAgents:[],triggerPosition:-1}));return}if(!pW(z,G)){J((A)=>({...A,visible:!1,query:"",filteredAgents:[],triggerPosition:-1}));return}let F=dW(z,G),M=cW(Z,F,Y);if(M.length===1&&M[0].name.toLowerCase()===F.toLowerCase()){J((A)=>({...A,visible:!1,query:"",filteredAgents:[],triggerPosition:-1}));return}J((A)=>({...A,visible:!0,query:F,filteredAgents:M,triggerPosition:G}))},[Z.length,Y]),$=Z4.useCallback(()=>{if(!X.visible||X.filteredAgents.length===0)return null;return X.filteredAgents[0]??null},[X.visible,X.filteredAgents]),K=Z4.useCallback((z)=>{let H=$();if(!H)return z;let G=z.slice(0,X.triggerPosition),F=z.slice(X.triggerPosition+1+X.query.length);return`${G}@${H.name} ${F}`},[$,X.triggerPosition,X.query]),U=Z4.useCallback(()=>{J((z)=>({...z,visible:!1,query:"",filteredAgents:[],triggerPosition:-1}))},[]),W=X.visible&&X.filteredAgents.length>0;return{state:X,checkTrigger:Q,getFirstAgent:$,complete:K,hide:U,isActive:W}}var r1=L(x(),1);var kZ=L(v(),1);function lW({name:Z,result:Y}){if(!Y)return kZ.jsxDEV(O,{color:"cyan",children:Z},void 0,!1,void 0,this);let X=Y.highlight((J)=>kZ.jsxDEV(O,{color:"green",bold:!0,children:J},void 0,!1,void 0,this));if(Array.isArray(X))return kZ.jsxDEV(O,{color:"cyan",children:X.map((J,Q)=>{if(typeof J==="string")return kZ.jsxDEV(O,{children:J},`p-${Q}`,!1,void 0,this);return kZ.jsxDEV(r1.default.Fragment,{children:J},`m-${Q}`,!1,void 0,this)})},void 0,!1,void 0,this);return kZ.jsxDEV(O,{color:"cyan",children:Z},void 0,!1,void 0,this)}var o1=({visible:Z,skills:Y,query:X,maxVisible:J=5})=>{if(!Z||Y.length===0)return null;let Q=Y.slice(0,J);return kZ.jsxDEV(N,{marginBottom:1,flexDirection:"column",children:[kZ.jsxDEV(O,{color:"yellow",bold:!0,children:"技能建议 (按 → 补全):"},void 0,!1,void 0,this),Q.map(({skill:$,result:K})=>kZ.jsxDEV(N,{children:[kZ.jsxDEV(O,{children:" #"},void 0,!1,void 0,this),kZ.jsxDEV(lW,{name:$.name,result:K},void 0,!1,void 0,this)]},$.name,!0,void 0,this)),Y.length>J&&kZ.jsxDEV(O,{color:"gray",children:["...还有 ",Y.length-J," 个技能"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)};var DZ=L(v(),1);function iW({name:Z,query:Y}){if(!Y)return DZ.jsxDEV(O,{color:"magenta",children:Z},void 0,!1,void 0,this);let X=Z.toLowerCase(),J=Y.toLowerCase();if(X.startsWith(J))return DZ.jsxDEV(DZ.Fragment,{children:[DZ.jsxDEV(O,{color:"green",bold:!0,children:Z.slice(0,Y.length)},void 0,!1,void 0,this),DZ.jsxDEV(O,{color:"magenta",children:Z.slice(Y.length)},void 0,!1,void 0,this)]},void 0,!0,void 0,this);return DZ.jsxDEV(O,{color:"magenta",children:Z},void 0,!1,void 0,this)}var n1=({visible:Z,agents:Y,query:X,maxVisible:J=5})=>{if(!Z||Y.length===0)return null;let Q=Y.slice(0,J);return DZ.jsxDEV(N,{marginBottom:1,flexDirection:"column",children:[DZ.jsxDEV(O,{color:"yellow",bold:!0,children:"Agent 建议 (按 → 补全):"},void 0,!1,void 0,this),Q.map(($)=>DZ.jsxDEV(N,{children:[DZ.jsxDEV(O,{children:" @"},void 0,!1,void 0,this),DZ.jsxDEV(iW,{name:$.name,query:X},void 0,!1,void 0,this),DZ.jsxDEV(O,{dimColor:!0,children:[" - ",$.description]},void 0,!0,void 0,this)]},$.id,!0,void 0,this)),Y.length>J&&DZ.jsxDEV(O,{color:"gray",children:["...还有 ",Y.length-J," 个 Agent"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)};var s1=L(x(),1);function t1(){let{extraParams:Z}=WZ(),{sendMessage:Y,loading:X}=KZ(),{bufferedMessage:J,clearBuffer:Q}=h0(),$=a1();s1.useEffect(()=>{if(!X&&J.trim()){let K=[{type:"human",content:J}];Q(),Y(K,{extraParams:Z}).then(()=>{_Y("Zen Code 完成任务")}).catch((U)=>{console.error("Failed to send buffered message:",U)})}},[X,J,Y,Z,Q,$])}var vY=L(v(),1),e1=({value:Z,onChange:Y,onSubmit:X,loading:J,placeholder:Q="输入消息...",commandHandler:$,skills:K=[],agents:U=[]})=>{t1();let{bufferedMessage:W,setBufferedMessage:z,clearBuffer:H}=h0(),[G,F]=BZ.useState(Z),M=BZ.useRef(!1),A=l1({skills:K,maxSuggestions:5}),w=i1({agents:U,maxSuggestions:5});BZ.useEffect(()=>{if(Z!==G)M.current=!0,F(Z)},[Z]);let P=BZ.useMemo(()=>G.startsWith("/"),[G]);BZ.useEffect(()=>{if(!P)A.checkTrigger(G),w.checkTrigger(G)},[G,P]);let B=BZ.useCallback((i)=>{if(M.current){M.current=!1;return}F(i),Y(i)},[Y]),R=BZ.useCallback((i)=>{if(!i.trim())return;if(A.hide(),w.hide(),P){X(i),F("");return}if(J)z(i),F("");else X(i),F("")},[P,J,X,z,A,w]),C=BZ.useCallback(()=>{if(w.isActive){w.hide();return}if(A.isActive){A.hide();return}if(W)H();else F("")},[W,H,A.isActive,w.isActive]),D=BZ.useCallback(()=>{if(!P||!$.commandSuggestions||$.commandSuggestions.length===0)return!1;let g=$.commandSuggestions[0],o=(g.displayText||g.command||"")+" ";return B(o),!0},[P,$.commandSuggestions,B]),j=BZ.useCallback(()=>{if(!A.isActive)return!1;let i=A.complete(G);return B(i),A.hide(),!0},[A.isActive,G,B]),E=BZ.useCallback(()=>{if(!w.isActive)return!1;let i=w.complete(G);return B(i),w.hide(),!0},[w.isActive,G,B]),d=BZ.useMemo(()=>{if(J)return W?"按 Esc 清空缓冲区":"AI 响应中,Enter 将消息加入缓冲区";if(P)return"输入命令... (试试 /help,按 → 补全第一个建议)";if(w.isActive)return"按 → 补全 Agent";if(A.isActive)return"按 → 补全技能";return Q},[J,W,P,w.isActive,A.isActive,Q]);return vY.jsxDEV(N,{flexDirection:"column",children:[W&&vY.jsxDEV(N,{padding:1,children:vY.jsxDEV(O,{color:"yellow",children:["\uD83D\uDCDD 缓冲区: ",W.slice(0,50),W.length>50?"...":""]},void 0,!0,void 0,this)},void 0,!1,void 0,this),vY.jsxDEV($.CommandHintUI,{},void 0,!1,void 0,this),vY.jsxDEV(n1,{visible:w.state.visible,agents:w.state.filteredAgents,query:w.state.query},void 0,!1,void 0,this),vY.jsxDEV(o1,{visible:A.state.visible,skills:A.state.filteredSkills,query:A.state.query},void 0,!1,void 0,this),vY.jsxDEV(N,{paddingY:1,children:vY.jsxDEV(rZ,{id:"global-input",value:G,onChange:B,onSubmit:R,onHotKey:(i,g)=>{if(g.escape)return C(),!1;if(g.rightArrow){if(w.isActive){if(E())return!1}if(A.isActive){if(j())return!1}if(D())return!1}return!0},placeholder:d},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)};var u4=L(v(),1),a8=x0.memo(()=>{let{userInput:Z,setUserInput:Y,loading:X,renderMessages:J,sendMessage:Q}=KZ(),{extraParams:$,manager:K}=WZ(),{switchToHistory:U,switchToKnowledge:W,switchToSettings:z,switchToModelProvider:H,switchToAgent:G,switchToTask:F,switchToMcp:M,closePanel:A}=Q4(),{data:w=[]}=p1({manager:K}),{data:P=[]}=d1(),{startRalphLoop:B}=c1({loading:X,renderMessages:J,sendMessage:Q,setUserInput:Y,extraParams:$}),R=m1({extraParams:$,switchToHistory:U,switchToKnowledge:W,switchToSettings:z,switchToModelProvider:H,switchToAgent:G,switchToTask:F,switchToMcp:M,closePanel:A,startRalphLoop:B}),C=x0.useCallback(async(D)=>{if(!D)return;if(D.startsWith("/")){if(await R.executeCommand(D)){Y("");return}}await Q([{type:"human",content:D}],{extraParams:$,metadata:WY}),_Y("Zen Code 完成任务")},[R,Y]);return u4.jsxDEV(N,{flexDirection:"column",paddingX:0,paddingY:0,borderColor:"grey",borderTop:!0,borderStyle:"single",borderLeft:!1,borderBottom:!1,borderRight:!1,children:[u4.jsxDEV(R.CommandErrorUI,{},void 0,!1,void 0,this),u4.jsxDEV(R.CommandSuccessUI,{},void 0,!1,void 0,this),u4.jsxDEV(e1,{value:Z,onChange:Y,onSubmit:C,loading:X,commandHandler:{isCommandInput:R.isCommandInput,CommandHintUI:R.CommandHintUI,commandSuggestions:R.commandSuggestions},skills:w,agents:P},void 0,!1,void 0,this)]},void 0,!0,void 0,this)});a8.displayName="ChatInput";var hZ=L(v(),1),rW=()=>{let{renderMessages:Z,currentChatId:Y,getToolUIRender:X,loading:J}=KZ(),{compactMode:Q}=WZ(),[$]=ZJ(Z,50),[K,U]=IY.useState(!0),[W,z]=IY.useState(J);IY.useEffect(()=>{if(W&&!J){U(!1);let F=setTimeout(()=>{U(!0)},200);return()=>clearTimeout(F)}z(J)},[J,W]);let H=IY.useMemo(()=>{return`${Y}-${$.length}`},[Y,$.length]),G=IY.useCallback((F)=>X(F),[X]);return hZ.jsxDEV(N,{flexDirection:"column",flexGrow:1,paddingX:0,paddingY:0,children:[$.length===0&&hZ.jsxDEV(P1,{},void 0,!1,void 0,this),K&&$.length?Q?hZ.jsxDEV(r8,{renderMessages:$,startIndex:0,staticKey:H,getToolUIRender:G,loading:J},H,!1,void 0,this):hZ.jsxDEV(_1,{loading:J,renderMessages:$,startIndex:0,staticKey:H},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)},s8=()=>{let{hasPendingInteractions:Z}=gZ();return hZ.jsxDEV(N,{flexDirection:"column",flexGrow:1,children:[hZ.jsxDEV(n,{name:"ChatMessages",fallback:null,children:hZ.jsxDEV(rW,{},void 0,!1,void 0,this)},void 0,!1,void 0,this),hZ.jsxDEV(YJ,{children:hZ.jsxDEV(n,{name:"InteractionArea",fallback:null,children:Z?hZ.jsxDEV(N,{paddingX:0,paddingY:0,children:hZ.jsxDEV(X8,{},void 0,!1,void 0,this)},void 0,!1,void 0,this):hZ.jsxDEV(a8,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)};s8.displayName="ChatMain";var qY=L(x(),1);var hY=L(x(),1),XJ=hY.lazy(()=>import("./chunk-84nqfeqh.js").then((Z)=>({default:Z.default}))),JJ=hY.lazy(()=>import("./chunk-bmb36b05.js").then((Z)=>({default:Z.default}))),QJ=hY.lazy(()=>import("./chunk-yk20e377.js").then((Z)=>({default:Z.default}))),$J=hY.lazy(()=>import("./chunk-9frwhzz8.js").then((Z)=>({default:Z.default}))),KJ=hY.lazy(()=>import("./chunk-vsedmhna.js").then((Z)=>({default:Z.default}))),WJ=hY.lazy(()=>import("./chunk-fj71pv2k.js").then((Z)=>({default:Z.default}))),UJ=hY.lazy(()=>import("./chunk-t7zrr341.js").then((Z)=>({default:Z.default})));var u=L(v(),1),Y4=()=>u.jsxDEV(N,{paddingX:1,paddingY:1,children:u.jsxDEV(O,{color:"grey",children:"Loading..."},void 0,!1,void 0,this)},void 0,!1,void 0,this),X4=(Z)=>u.jsxDEV(N,{paddingX:1,paddingY:1,children:[u.jsxDEV(O,{color:"red",children:["✗ ",Z," panel error"]},void 0,!0,void 0,this),u.jsxDEV(N,{marginTop:1,children:u.jsxDEV(O,{color:"gray",children:"Try reopening or press ESC to return"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),t8=qY.memo(()=>{let{activeView:Z,closePanel:Y,handleExecuteTask:X}=Q4();return u.jsxDEV(N,{flexGrow:1,flexDirection:"row",children:[Z==="history"&&u.jsxDEV(qY.Suspense,{fallback:u.jsxDEV(Y4,{},void 0,!1,void 0,this),children:u.jsxDEV(n,{name:"HistoryPanel",fallback:X4("History"),children:u.jsxDEV(XJ,{onClose:Y},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),Z==="knowledge"&&u.jsxDEV(qY.Suspense,{fallback:u.jsxDEV(Y4,{},void 0,!1,void 0,this),children:u.jsxDEV(n,{name:"KnowledgePanel",fallback:X4("Knowledge"),children:u.jsxDEV(JJ,{onClose:Y},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),Z==="settings"&&u.jsxDEV(qY.Suspense,{fallback:u.jsxDEV(Y4,{},void 0,!1,void 0,this),children:u.jsxDEV(n,{name:"SettingsPanel",fallback:X4("Settings"),children:u.jsxDEV(QJ,{onClose:Y},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),Z==="model-provider"&&u.jsxDEV(qY.Suspense,{fallback:u.jsxDEV(Y4,{},void 0,!1,void 0,this),children:u.jsxDEV(n,{name:"ModelProviderPanel",fallback:X4("Model Provider"),children:u.jsxDEV($J,{onClose:Y},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),Z==="agent"&&u.jsxDEV(qY.Suspense,{fallback:u.jsxDEV(Y4,{},void 0,!1,void 0,this),children:u.jsxDEV(n,{name:"AgentPanel",fallback:X4("Agent"),children:u.jsxDEV(KJ,{onClose:Y},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),Z==="task"&&u.jsxDEV(qY.Suspense,{fallback:u.jsxDEV(Y4,{},void 0,!1,void 0,this),children:u.jsxDEV(n,{name:"TaskPanel",fallback:X4("Task"),children:u.jsxDEV(WJ,{onClose:Y,onExecuteTask:X},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),Z==="mcp"&&u.jsxDEV(qY.Suspense,{fallback:u.jsxDEV(Y4,{},void 0,!1,void 0,this),children:u.jsxDEV(n,{name:"McpPanel",fallback:X4("MCP"),children:u.jsxDEV(UJ,{onClose:Y},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)});t8.displayName="LazyChatViewManager";var YX=L(x(),1);var zJ=L(x(),1);var g0=L(v(),1),HJ=()=>{let{renderMessages:Z}=KZ(),Y=zJ.default.useMemo(()=>{if(!Z)return null;for(let X=Z.length-1;X>=0;X--){let J=Z[X];if(J.role==="assistant"&&J.content)try{let $=(Array.isArray(J.content)?J.content:[{type:"text",text:J.content}]).find((K)=>K.type==="text")?.text||"";if($.includes("load_mcp_tools"))try{let K=JSON.parse($);if(K.status&&K.status.toolCount!==void 0)return K.status}catch(K){}}catch(Q){}}return null},[Z]);if(!Y||Y.toolCount===0)return null;return g0.jsxDEV(N,{paddingX:1,children:[g0.jsxDEV(O,{color:"green",bold:!0,children:"MCP"},void 0,!1,void 0,this),g0.jsxDEV(O,{color:"cyan",children:[" ",Y.toolCount]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)};var JY=L(x(),1);function ZX(Z){if(Z===0)return"0";if(Z<1024)return`${Z}`;if(Z<1048576)return`${(Z/1024).toFixed(0)}K`;if(Z<1073741824)return`${(Z/1048576).toFixed(0)}M`;return`${(Z/1073741824).toFixed(1)}G`}function GJ(Z){let Y=Math.floor(Z/1000),X=Math.floor(Y/3600),J=Math.floor(Y%3600/60),Q=Y%60;if(X>0)return`${X}:${String(J).padStart(2,"0")}:${String(Q).padStart(2,"0")}`;return`${String(J).padStart(2,"0")}:${String(Q).padStart(2,"0")}`}function OJ(Z){let[Y,X]=JY.useState(0),J=JY.useRef(null);return JY.useEffect(()=>{if(Z)J.current=Date.now(),X(0);else J.current=null,X(0)},[Z]),e8(()=>{if(J.current)X(Date.now()-J.current)},Z?1000:null),Y}function qJ(){let[Z,Y]=JY.useState({cpuPercent:0,memoryRSS:0,memoryHeapUsed:0,memoryHeapTotal:0}),X=JY.useRef(process.cpuUsage()),J=JY.useRef(Date.now()),Q=()=>{let $=Date.now(),K=process.cpuUsage(),U=process.memoryUsage(),W=$-J.current,z=K.user-X.current.user,H=K.system-X.current.system,F=(z+H)/1000/W*100;Y({cpuPercent:Math.min(100,Math.max(0,F)),memoryRSS:U.rss,memoryHeapUsed:U.heapUsed,memoryHeapTotal:U.heapTotal}),X.current=K,J.current=$};return JY.useEffect(()=>{Q()},[]),e8(Q,2000),Z}function FJ(Z){if(Z<50)return"green";if(Z<80)return"yellow";return"red"}function MJ(Z,Y){if(Y===0)return"gray";let X=Z/Y*100;if(X<50)return"green";if(X<80)return"yellow";return"red"}var DY=L(v(),1),oW=()=>{let Z=qJ(),Y=FJ(Z.cpuPercent),X=MJ(Z.memoryHeapUsed,Z.memoryHeapTotal);return DY.jsxDEV(N,{paddingX:1,width:"100%",children:DY.jsxDEV(N,{gap:2,children:[DY.jsxDEV(N,{children:[DY.jsxDEV(O,{dimColor:!0,children:"CPU:"},void 0,!1,void 0,this),DY.jsxDEV(O,{color:Y,children:[" ",Z.cpuPercent.toFixed(0),"%"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),DY.jsxDEV(N,{children:[DY.jsxDEV(O,{dimColor:!0,children:"MEM:"},void 0,!1,void 0,this),DY.jsxDEV(O,{color:X,children:[ZX(Z.memoryHeapUsed),"/",ZX(Z.memoryRSS)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)},NJ=oW;var AZ=L(v(),1);import nW from"path";var aW=()=>{let{extraParams:Z,compactMode:Y,showDetailedInfo:X}=WZ(),{currentChatId:J,renderMessages:Q}=KZ(),{loading:$,stopGeneration:K}=KZ(),U=process.env.YOLO_MODE==="true",W=YX.default.useCallback((M,A)=>{if(A.ctrl&&M==="c")if($)K();else process.exit()},[$,K]);uZ(W);let z=OJ($),H=YX.default.useMemo(()=>{return nW.basename(process.cwd())},[]),F=(Q?.length||0)>100;return AZ.jsxDEV(N,{flexDirection:"column",width:"100%",children:[AZ.jsxDEV(N,{paddingX:1,paddingY:0,justifyContent:"space-between",width:"100%",marginBottom:1,children:[AZ.jsxDEV(N,{gap:1,children:[$&&AZ.jsxDEV(O,{color:"yellow",bold:!0,children:AZ.jsxDEV(AJ,{text:"LOADING"},void 0,!1,void 0,this)},void 0,!1,void 0,this),!$&&AZ.jsxDEV(O,{color:"magenta",bold:!0,children:"Zen Code"},void 0,!1,void 0,this),AZ.jsxDEV(O,{color:"cyan",bold:!0,children:[" ",Z.model_id]},void 0,!0,void 0,this),AZ.jsxDEV(O,{color:"yellow",bold:!0,children:[" ","@",Z.switch_command||"default"]},void 0,!0,void 0,this),!Y&&AZ.jsxDEV(O,{color:"blue",bold:!0,children:[" ","[FULL]"]},void 0,!0,void 0,this),U&&AZ.jsxDEV(O,{color:"red",bold:!0,children:[" ","YOLO"]},void 0,!0,void 0,this),AZ.jsxDEV(HJ,{},void 0,!1,void 0,this),F&&AZ.jsxDEV(O,{color:"red",bold:!0,children:[" ","/summary"]},void 0,!0,void 0,this),AZ.jsxDEV(O,{color:"green",bold:!0,children:Q.length},void 0,!1,void 0,this),AZ.jsxDEV(O,{color:"blue",children:H},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$&&AZ.jsxDEV(N,{children:AZ.jsxDEV(O,{color:"yellow",children:GJ(z)},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),X&&AZ.jsxDEV(NJ,{},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},_J=aW;var a=L(v(),1),sW=()=>{let{activeView:Z}=Q4();return a.jsxDEV(N,{flexDirection:"column",width:"100%",children:[a.jsxDEV(N,{flexGrow:1,flexDirection:"row",children:[a.jsxDEV(n,{name:"ChatMain",fallback:a.jsxDEV(O,{color:"yellow",children:"Chat view unavailable"},void 0,!1,void 0,this),children:Z==="chat"?a.jsxDEV(s8,{},void 0,!1,void 0,this):null},void 0,!1,void 0,this),a.jsxDEV(n,{name:"PanelView",fallback:a.jsxDEV(O,{color:"yellow",children:"Panel unavailable"},void 0,!1,void 0,this),children:Z!=="chat"?a.jsxDEV(t8,{},void 0,!1,void 0,this):null},void 0,!1,void 0,this)]},void 0,!0,void 0,this),a.jsxDEV(n,{name:"StatusBar",fallback:null,children:a.jsxDEV(_J,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},tW=()=>{return a.jsxDEV(n,{name:"Chat",children:a.jsxDEV(F5,{children:a.jsxDEV(sW,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)},eW=()=>{return a.jsxDEV(n,{name:"AppRoot",children:a.jsxDEV(wJ,{apiUrl:"http://127.0.0.1:8123",defaultAgent:"code",defaultHeaders:{},withCredentials:!1,showHistory:!1,showGraph:!1,onInitError:(Z,Y)=>{console.error(Z,Y)},fetch:AX,autoRestoreLastSession:!0,historyFilter:{metadata:{path:process.cwd()}},children:a.jsxDEV(n,{name:"TanStackQueryProvider",children:a.jsxDEV(WX,{children:a.jsxDEV(n,{name:"SettingsProvider",children:a.jsxDEV(LJ,{get_allowed_models:_X,children:a.jsxDEV(n,{name:"ApprovalProvider",children:a.jsxDEV(BJ,{children:a.jsxDEV(n,{name:"InteractionProvider",children:a.jsxDEV(d4,{children:a.jsxDEV(tW,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)},Z2=()=>a.jsxDEV(eW,{},void 0,!1,void 0,this),XX=Z2;var QY=L(v(),1),Y2=({error:Z})=>QY.jsxDEV(N,{flexDirection:"column",padding:2,borderStyle:"double",borderColor:"red",children:[QY.jsxDEV(O,{color:"red",bold:!0,children:"✗ Application Crashed"},void 0,!1,void 0,this),QY.jsxDEV(N,{marginTop:1,children:QY.jsxDEV(O,{color:"red",children:Z.message},void 0,!1,void 0,this)},void 0,!1,void 0,this),QY.jsxDEV(N,{marginTop:1,children:QY.jsxDEV(O,{color:"gray",children:["Stack: ",Z.stack?.split(`
|
|
343
|
+
[System Context: You are currently in Ralph loop mode. Continue executing the task based on previous context. Respond with <COMPLETE></COMPLETE> tag when the task is complete.]`:"",A=[{type:"human",content:M+_}];await X(A,{extraParams:Q,metadata:W4})},[X,Q]);jZ(()=>{if($)G($);U(!1)},W?100:null);let F=X4.useCallback((M)=>{K(M),z.current=!0,H.current=0,U(!0)},[]);return X4.useEffect(()=>{if(z.current&&$&&!Z){let M=Y.length;if(M>H.current){H.current=M;let _=Y[M-1],A=Q0(_);if(typeof A==="string"&&A.includes("<COMPLETE></COMPLETE>"))z.current=!1,K(null),w4("Ralph 循环完成");else G($)}}},[Z,Y,$,G]),{ralphLoopText:$,startRalphLoop:F,sendTextMessage:G}}var BZ=L(x(),1);var t4=L(x(),1);import tX from"fuzzysort";function N2(Z,Y){if(Y===0)return!0;let X=Z[Y-1];return X===" "||X===`
|
|
344
|
+
`||X==="\t"}function _2(Z,Y){let X=Y+1;while(X<Z.length&&!/[\s\n\t]/.test(Z[X]))X++;return Z.slice(Y+1,X)}function w2(Z,Y,X){if(!Y)return Z.slice(0,X).map((K)=>({skill:K,result:null}));let J=Z.map((K)=>({skill:K,name:tX.prepare(K.name.toLowerCase()),description:tX.prepare((K.description||"").toLowerCase())}));return tX.go(Y.toLowerCase(),J,{key:"name",limit:X,threshold:-1e4}).map((K)=>({skill:K.obj.skill,result:K}))}function Y1({skills:Z,maxSuggestions:Y=5}){let[X,J]=t4.useState({visible:!1,query:"",filteredSkills:[],triggerPosition:-1}),Q=t4.useCallback((z,H)=>{let G=z.lastIndexOf("#");if(G===-1){J((_)=>({..._,visible:!1,query:"",filteredSkills:[],triggerPosition:-1}));return}if(!N2(z,G)){J((_)=>({..._,visible:!1,query:"",filteredSkills:[],triggerPosition:-1}));return}let F=_2(z,G),M=w2(Z,F,Y);if(M.length===1&&M[0].skill.name.toLowerCase()===F.toLowerCase()){J((_)=>({..._,visible:!1,query:"",filteredSkills:[],triggerPosition:-1}));return}J((_)=>({..._,visible:!0,query:F,filteredSkills:M,triggerPosition:G}))},[Z.length,Y]),$=t4.useCallback(()=>{if(!X.visible||X.filteredSkills.length===0)return null;return X.filteredSkills[0]?.skill??null},[X.visible,X.filteredSkills]),K=t4.useCallback((z)=>{let H=$();if(!H)return z;let G=z.slice(0,X.triggerPosition),F=z.slice(X.triggerPosition+1+X.query.length);return`${G}#${H.name} ${F}`},[$,X.triggerPosition,X.query]),W=t4.useCallback(()=>{J((z)=>({...z,visible:!1,query:"",filteredSkills:[],triggerPosition:-1}))},[]),U=X.visible&&X.filteredSkills.length>0;return{state:X,checkTrigger:Q,getFirstSkill:$,complete:K,hide:W,isActive:U}}var e4=L(x(),1);function A2(Z,Y){if(Y===0)return!0;let X=Z[Y-1];return X===" "||X===`
|
|
345
|
+
`||X==="\t"}function B2(Z,Y){let X=Y+1;while(X<Z.length&&!/[\s\n\t]/.test(Z[X]))X++;return Z.slice(Y+1,X)}function L2(Z,Y,X){let J=Y.toLowerCase(),Q=Z.filter(($)=>{let K=$.name.toLowerCase(),W=$.id.toLowerCase();return K.startsWith(J)||W.includes(J)});return Q.sort(($,K)=>$.name.localeCompare(K.name)),Q.slice(0,X)}function X1({agents:Z,maxSuggestions:Y=5}){let[X,J]=e4.useState({visible:!1,query:"",filteredAgents:[],triggerPosition:-1}),Q=e4.useCallback((z,H)=>{let G=z.lastIndexOf("@");if(G===-1){J((_)=>({..._,visible:!1,query:"",filteredAgents:[],triggerPosition:-1}));return}if(!A2(z,G)){J((_)=>({..._,visible:!1,query:"",filteredAgents:[],triggerPosition:-1}));return}let F=B2(z,G),M=L2(Z,F,Y);if(M.length===1&&M[0].name.toLowerCase()===F.toLowerCase()){J((_)=>({..._,visible:!1,query:"",filteredAgents:[],triggerPosition:-1}));return}J((_)=>({..._,visible:!0,query:F,filteredAgents:M,triggerPosition:G}))},[Z.length,Y]),$=e4.useCallback(()=>{if(!X.visible||X.filteredAgents.length===0)return null;return X.filteredAgents[0]??null},[X.visible,X.filteredAgents]),K=e4.useCallback((z)=>{let H=$();if(!H)return z;let G=z.slice(0,X.triggerPosition),F=z.slice(X.triggerPosition+1+X.query.length);return`${G}@${H.name} ${F}`},[$,X.triggerPosition,X.query]),W=e4.useCallback(()=>{J((z)=>({...z,visible:!1,query:"",filteredAgents:[],triggerPosition:-1}))},[]),U=X.visible&&X.filteredAgents.length>0;return{state:X,checkTrigger:Q,getFirstAgent:$,complete:K,hide:W,isActive:U}}var J1=L(x(),1);var hZ=L(v(),1);function P2({name:Z,result:Y}){if(!Y)return hZ.jsxDEV(O,{color:"cyan",children:Z},void 0,!1,void 0,this);let X=Y.highlight((J)=>hZ.jsxDEV(O,{color:"green",bold:!0,children:J},void 0,!1,void 0,this));if(Array.isArray(X))return hZ.jsxDEV(O,{color:"cyan",children:X.map((J,Q)=>{if(typeof J==="string")return hZ.jsxDEV(O,{children:J},`p-${Q}`,!1,void 0,this);return hZ.jsxDEV(J1.default.Fragment,{children:J},`m-${Q}`,!1,void 0,this)})},void 0,!1,void 0,this);return hZ.jsxDEV(O,{color:"cyan",children:Z},void 0,!1,void 0,this)}var Q1=({visible:Z,skills:Y,query:X,maxVisible:J=5})=>{if(!Z||Y.length===0)return null;let Q=Y.slice(0,J);return hZ.jsxDEV(N,{marginBottom:1,flexDirection:"column",children:[hZ.jsxDEV(O,{color:"yellow",bold:!0,children:"技能建议 (按 → 补全):"},void 0,!1,void 0,this),Q.map(({skill:$,result:K})=>hZ.jsxDEV(N,{children:[hZ.jsxDEV(O,{children:" #"},void 0,!1,void 0,this),hZ.jsxDEV(P2,{name:$.name,result:K},void 0,!1,void 0,this)]},$.name,!0,void 0,this)),Y.length>J&&hZ.jsxDEV(O,{color:"gray",children:["...还有 ",Y.length-J," 个技能"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)};var DZ=L(v(),1);function R2({name:Z,query:Y}){if(!Y)return DZ.jsxDEV(O,{color:"magenta",children:Z},void 0,!1,void 0,this);let X=Z.toLowerCase(),J=Y.toLowerCase();if(X.startsWith(J))return DZ.jsxDEV(DZ.Fragment,{children:[DZ.jsxDEV(O,{color:"green",bold:!0,children:Z.slice(0,Y.length)},void 0,!1,void 0,this),DZ.jsxDEV(O,{color:"magenta",children:Z.slice(Y.length)},void 0,!1,void 0,this)]},void 0,!0,void 0,this);return DZ.jsxDEV(O,{color:"magenta",children:Z},void 0,!1,void 0,this)}var $1=({visible:Z,agents:Y,query:X,maxVisible:J=5})=>{if(!Z||Y.length===0)return null;let Q=Y.slice(0,J);return DZ.jsxDEV(N,{marginBottom:1,flexDirection:"column",children:[DZ.jsxDEV(O,{color:"yellow",bold:!0,children:"Agent 建议 (按 → 补全):"},void 0,!1,void 0,this),Q.map(($)=>DZ.jsxDEV(N,{children:[DZ.jsxDEV(O,{children:" @"},void 0,!1,void 0,this),DZ.jsxDEV(R2,{name:$.name,query:X},void 0,!1,void 0,this),DZ.jsxDEV(O,{dimColor:!0,children:[" - ",$.description]},void 0,!0,void 0,this)]},$.id,!0,void 0,this)),Y.length>J&&DZ.jsxDEV(O,{color:"gray",children:["...还有 ",Y.length-J," 个 Agent"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)};var W1=L(x(),1);function U1(){let{extraParams:Z}=UZ(),{sendMessage:Y,loading:X}=WZ(),{bufferedMessage:J,clearBuffer:Q}=gY(),$=K1();W1.useEffect(()=>{if(!X&&J.trim()){let K=[{type:"human",content:J}];Q(),Y(K,{extraParams:Z}).then(()=>{w4("Zen Code 完成任务")}).catch((W)=>{console.error("Failed to send buffered message:",W)})}},[X,J,Y,Z,Q,$])}var v4=L(v(),1),z1=({value:Z,onChange:Y,onSubmit:X,loading:J,placeholder:Q="输入消息...",commandHandler:$,skills:K=[],agents:W=[]})=>{U1();let{bufferedMessage:U,setBufferedMessage:z,clearBuffer:H}=gY(),[G,F]=BZ.useState(Z),M=BZ.useRef(!1),_=Y1({skills:K,maxSuggestions:5}),A=X1({agents:W,maxSuggestions:5});BZ.useEffect(()=>{if(Z!==G)M.current=!0,F(Z)},[Z]);let P=BZ.useMemo(()=>G.startsWith("/"),[G]);BZ.useEffect(()=>{if(!P)_.checkTrigger(G),A.checkTrigger(G)},[G,P]);let B=BZ.useCallback((i)=>{if(M.current){M.current=!1;return}F(i),Y(i)},[Y]),C=BZ.useCallback((i)=>{if(!i.trim())return;if(_.hide(),A.hide(),P){X(i),F("");return}if(J)z(i),F("");else X(i),F("")},[P,J,X,z,_,A]),R=BZ.useCallback(()=>{if(A.isActive){A.hide();return}if(_.isActive){_.hide();return}if(U)H();else F("")},[U,H,_.isActive,A.isActive]),D=BZ.useCallback(()=>{if(!P||!$.commandSuggestions||$.commandSuggestions.length===0)return!1;let g=$.commandSuggestions[0],n=(g.displayText||g.command||"")+" ";return B(n),!0},[P,$.commandSuggestions,B]),j=BZ.useCallback(()=>{if(!_.isActive)return!1;let i=_.complete(G);return B(i),_.hide(),!0},[_.isActive,G,B]),E=BZ.useCallback(()=>{if(!A.isActive)return!1;let i=A.complete(G);return B(i),A.hide(),!0},[A.isActive,G,B]),c=BZ.useMemo(()=>{if(J)return U?"按 Esc 清空缓冲区":"AI 响应中,Enter 将消息加入缓冲区";if(P)return"输入命令... (试试 /help,按 → 补全第一个建议)";if(A.isActive)return"按 → 补全 Agent";if(_.isActive)return"按 → 补全技能";return Q},[J,U,P,A.isActive,_.isActive,Q]);return v4.jsxDEV(N,{flexDirection:"column",children:[U&&v4.jsxDEV(N,{padding:1,children:v4.jsxDEV(O,{color:"yellow",children:["\uD83D\uDCDD 缓冲区: ",U.slice(0,50),U.length>50?"...":""]},void 0,!0,void 0,this)},void 0,!1,void 0,this),v4.jsxDEV($.CommandHintUI,{},void 0,!1,void 0,this),v4.jsxDEV($1,{visible:A.state.visible,agents:A.state.filteredAgents,query:A.state.query},void 0,!1,void 0,this),v4.jsxDEV(Q1,{visible:_.state.visible,skills:_.state.filteredSkills,query:_.state.query},void 0,!1,void 0,this),v4.jsxDEV(N,{paddingY:1,children:v4.jsxDEV(oZ,{id:"global-input",value:G,onChange:B,onSubmit:C,onHotKey:(i,g)=>{if(g.escape)return R(),!1;if(g.rightArrow){if(A.isActive){if(E())return!1}if(_.isActive){if(j())return!1}if(D())return!1}return!0},placeholder:c},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)};var m0=L(v(),1),eX=uY.memo(()=>{let{userInput:Z,setUserInput:Y,loading:X,renderMessages:J,sendMessage:Q}=WZ(),{extraParams:$,manager:K}=UZ(),{switchToHistory:W,switchToKnowledge:U,switchToSettings:z,switchToModelProvider:H,switchToAgent:G,switchToTask:F,switchToMcp:M,closePanel:_}=J0(),{data:A=[]}=tJ({manager:K}),{data:P=[]}=eJ(),{startRalphLoop:B}=Z1({loading:X,renderMessages:J,sendMessage:Q,setUserInput:Y,extraParams:$}),C=sJ({extraParams:$,switchToHistory:W,switchToKnowledge:U,switchToSettings:z,switchToModelProvider:H,switchToAgent:G,switchToTask:F,switchToMcp:M,closePanel:_,startRalphLoop:B}),R=uY.useCallback(async(D)=>{if(!D)return;if(D.startsWith("/")){if(await C.executeCommand(D)){Y("");return}}await Q([{type:"human",content:D}],{extraParams:$,metadata:W4}),w4("Zen Code 完成任务")},[C,Y]);return m0.jsxDEV(N,{flexDirection:"column",paddingX:0,paddingY:0,borderColor:"grey",borderTop:!0,borderStyle:"single",borderLeft:!1,borderBottom:!1,borderRight:!1,children:[m0.jsxDEV(C.CommandErrorUI,{},void 0,!1,void 0,this),m0.jsxDEV(C.CommandSuccessUI,{},void 0,!1,void 0,this),m0.jsxDEV(z1,{value:Z,onChange:Y,onSubmit:R,loading:X,commandHandler:{isCommandInput:C.isCommandInput,CommandHintUI:C.CommandHintUI,commandSuggestions:C.commandSuggestions},skills:A,agents:P},void 0,!1,void 0,this)]},void 0,!0,void 0,this)});eX.displayName="ChatInput";var xZ=L(v(),1),C2=()=>{let{renderMessages:Z,currentChatId:Y,getToolUIRender:X,loading:J}=WZ(),{compactMode:Q}=UZ(),[$]=H1(Z,50),K=O1.useCallback((W)=>X(W),[X]);return xZ.jsxDEV(N,{flexDirection:"column",flexGrow:1,paddingX:0,paddingY:0,children:[$.length===0&&xZ.jsxDEV(TJ,{},void 0,!1,void 0,this),$.length?Q?xZ.jsxDEV(aX,{renderMessages:$,startIndex:0,staticKey:Y,getToolUIRender:K,loading:J},Y,!1,void 0,this):xZ.jsxDEV(IJ,{loading:J,renderMessages:$,startIndex:0,staticKey:Y},void 0,!1,void 0,this):null]},void 0,!0,void 0,this)},Z8=()=>{let{hasPendingInteractions:Z}=uZ();return xZ.jsxDEV(N,{flexDirection:"column",flexGrow:1,children:[xZ.jsxDEV(o,{name:"ChatMessages",fallback:null,children:xZ.jsxDEV(C2,{},void 0,!1,void 0,this)},void 0,!1,void 0,this),xZ.jsxDEV(G1,{children:xZ.jsxDEV(o,{name:"InteractionArea",fallback:null,children:Z?xZ.jsxDEV(N,{paddingX:0,paddingY:0,children:xZ.jsxDEV(KX,{},void 0,!1,void 0,this)},void 0,!1,void 0,this):xZ.jsxDEV(eX,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)};Z8.displayName="ChatMain";var q4=L(x(),1);var k4=L(x(),1),q1=k4.lazy(()=>import("./chunk-5gaygdyf.js").then((Z)=>({default:Z.default}))),F1=k4.lazy(()=>import("./chunk-3ek4pcr6.js").then((Z)=>({default:Z.default}))),M1=k4.lazy(()=>import("./chunk-syme57ea.js").then((Z)=>({default:Z.default}))),N1=k4.lazy(()=>import("./chunk-3z87tvcn.js").then((Z)=>({default:Z.default}))),_1=k4.lazy(()=>import("./chunk-ye6d9r5f.js").then((Z)=>({default:Z.default}))),w1=k4.lazy(()=>import("./chunk-f40x0w1g.js").then((Z)=>({default:Z.default}))),A1=k4.lazy(()=>import("./chunk-xb46b3bf.js").then((Z)=>({default:Z.default})));var u=L(v(),1),Z0=()=>u.jsxDEV(N,{paddingX:1,paddingY:1,children:u.jsxDEV(O,{color:"grey",children:"Loading..."},void 0,!1,void 0,this)},void 0,!1,void 0,this),Y0=(Z)=>u.jsxDEV(N,{paddingX:1,paddingY:1,children:[u.jsxDEV(O,{color:"red",children:["✗ ",Z," panel error"]},void 0,!0,void 0,this),u.jsxDEV(N,{marginTop:1,children:u.jsxDEV(O,{color:"gray",children:"Try reopening or press ESC to return"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Y8=q4.memo(()=>{let{activeView:Z,closePanel:Y,handleExecuteTask:X}=J0();return u.jsxDEV(N,{flexGrow:1,flexDirection:"row",children:[Z==="history"&&u.jsxDEV(q4.Suspense,{fallback:u.jsxDEV(Z0,{},void 0,!1,void 0,this),children:u.jsxDEV(o,{name:"HistoryPanel",fallback:Y0("History"),children:u.jsxDEV(q1,{onClose:Y},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),Z==="knowledge"&&u.jsxDEV(q4.Suspense,{fallback:u.jsxDEV(Z0,{},void 0,!1,void 0,this),children:u.jsxDEV(o,{name:"KnowledgePanel",fallback:Y0("Knowledge"),children:u.jsxDEV(F1,{onClose:Y},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),Z==="settings"&&u.jsxDEV(q4.Suspense,{fallback:u.jsxDEV(Z0,{},void 0,!1,void 0,this),children:u.jsxDEV(o,{name:"SettingsPanel",fallback:Y0("Settings"),children:u.jsxDEV(M1,{onClose:Y},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),Z==="model-provider"&&u.jsxDEV(q4.Suspense,{fallback:u.jsxDEV(Z0,{},void 0,!1,void 0,this),children:u.jsxDEV(o,{name:"ModelProviderPanel",fallback:Y0("Model Provider"),children:u.jsxDEV(N1,{onClose:Y},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),Z==="agent"&&u.jsxDEV(q4.Suspense,{fallback:u.jsxDEV(Z0,{},void 0,!1,void 0,this),children:u.jsxDEV(o,{name:"AgentPanel",fallback:Y0("Agent"),children:u.jsxDEV(_1,{onClose:Y},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),Z==="task"&&u.jsxDEV(q4.Suspense,{fallback:u.jsxDEV(Z0,{},void 0,!1,void 0,this),children:u.jsxDEV(o,{name:"TaskPanel",fallback:Y0("Task"),children:u.jsxDEV(w1,{onClose:Y,onExecuteTask:X},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),Z==="mcp"&&u.jsxDEV(q4.Suspense,{fallback:u.jsxDEV(Z0,{},void 0,!1,void 0,this),children:u.jsxDEV(o,{name:"McpPanel",fallback:Y0("MCP"),children:u.jsxDEV(A1,{onClose:Y},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)});Y8.displayName="LazyChatViewManager";var Q8=L(x(),1);var B1=L(x(),1);var mY=L(v(),1),L1=()=>{let{renderMessages:Z}=WZ(),Y=B1.default.useMemo(()=>{if(!Z)return null;for(let X=Z.length-1;X>=0;X--){let J=Z[X];if(J.role==="assistant"&&J.content)try{let $=(Array.isArray(J.content)?J.content:[{type:"text",text:J.content}]).find((K)=>K.type==="text")?.text||"";if($.includes("load_mcp_tools"))try{let K=JSON.parse($);if(K.status&&K.status.toolCount!==void 0)return K.status}catch(K){}}catch(Q){}}return null},[Z]);if(!Y||Y.toolCount===0)return null;return mY.jsxDEV(N,{paddingX:1,children:[mY.jsxDEV(O,{color:"green",bold:!0,children:"MCP"},void 0,!1,void 0,this),mY.jsxDEV(O,{color:"cyan",children:[" ",Y.toolCount]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)};var J4=L(x(),1);function J8(Z){if(Z===0)return"0";if(Z<1024)return`${Z}`;if(Z<1048576)return`${(Z/1024).toFixed(0)}K`;if(Z<1073741824)return`${(Z/1048576).toFixed(0)}M`;return`${(Z/1073741824).toFixed(1)}G`}function P1(Z){let Y=Math.floor(Z/1000),X=Math.floor(Y/3600),J=Math.floor(Y%3600/60),Q=Y%60;if(X>0)return`${X}:${String(J).padStart(2,"0")}:${String(Q).padStart(2,"0")}`;return`${String(J).padStart(2,"0")}:${String(Q).padStart(2,"0")}`}function R1(Z){let[Y,X]=J4.useState(0),J=J4.useRef(null);return J4.useEffect(()=>{if(Z)J.current=Date.now(),X(0);else J.current=null,X(0)},[Z]),X8(()=>{if(J.current)X(Date.now()-J.current)},Z?1000:null),Y}function C1(){let[Z,Y]=J4.useState({cpuPercent:0,memoryRSS:0,memoryHeapUsed:0,memoryHeapTotal:0}),X=J4.useRef(process.cpuUsage()),J=J4.useRef(Date.now()),Q=()=>{let $=Date.now(),K=process.cpuUsage(),W=process.memoryUsage(),U=$-J.current,z=K.user-X.current.user,H=K.system-X.current.system,F=(z+H)/1000/U*100;Y({cpuPercent:Math.min(100,Math.max(0,F)),memoryRSS:W.rss,memoryHeapUsed:W.heapUsed,memoryHeapTotal:W.heapTotal}),X.current=K,J.current=$};return J4.useEffect(()=>{Q()},[]),X8(Q,2000),Z}function v1(Z){if(Z<50)return"green";if(Z<80)return"yellow";return"red"}function I1(Z,Y){if(Y===0)return"gray";let X=Z/Y*100;if(X<50)return"green";if(X<80)return"yellow";return"red"}var I4=L(v(),1),v2=()=>{let Z=C1(),Y=v1(Z.cpuPercent),X=I1(Z.memoryHeapUsed,Z.memoryHeapTotal);return I4.jsxDEV(N,{paddingX:1,width:"100%",children:I4.jsxDEV(N,{gap:2,children:[I4.jsxDEV(N,{children:[I4.jsxDEV(O,{dimColor:!0,children:"CPU:"},void 0,!1,void 0,this),I4.jsxDEV(O,{color:Y,children:[" ",Z.cpuPercent.toFixed(0),"%"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),I4.jsxDEV(N,{children:[I4.jsxDEV(O,{dimColor:!0,children:"MEM:"},void 0,!1,void 0,this),I4.jsxDEV(O,{color:X,children:[J8(Z.memoryHeapUsed),"/",J8(Z.memoryRSS)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)},D1=v2;var _Z=L(v(),1);import I2 from"path";var D2=()=>{let{extraParams:Z,compactMode:Y,showDetailedInfo:X}=UZ(),{currentChatId:J,renderMessages:Q}=WZ(),{loading:$,stopGeneration:K}=WZ(),W=process.env.YOLO_MODE==="true",U=Q8.default.useCallback((M,_)=>{if(_.ctrl&&M==="c")process.exit()},[$,K]);mZ(U);let z=R1($),H=Q8.default.useMemo(()=>{return I2.basename(process.cwd())},[]),F=(Q?.length||0)>100;return _Z.jsxDEV(N,{flexDirection:"column",width:"100%",children:[_Z.jsxDEV(N,{paddingX:1,paddingY:0,justifyContent:"space-between",width:"100%",marginBottom:1,children:[_Z.jsxDEV(N,{gap:1,children:[$&&_Z.jsxDEV(O,{color:"yellow",bold:!0,children:_Z.jsxDEV(V1,{text:"LOADING"},void 0,!1,void 0,this)},void 0,!1,void 0,this),!$&&_Z.jsxDEV(O,{color:"magenta",bold:!0,children:"Zen Code"},void 0,!1,void 0,this),_Z.jsxDEV(O,{color:"cyan",bold:!0,children:[" ",Z.model_id]},void 0,!0,void 0,this),_Z.jsxDEV(O,{color:"yellow",bold:!0,children:[" ","@",Z.switch_command||"default"]},void 0,!0,void 0,this),!Y&&_Z.jsxDEV(O,{color:"blue",bold:!0,children:[" ","[FULL]"]},void 0,!0,void 0,this),W&&_Z.jsxDEV(O,{color:"red",bold:!0,children:[" ","YOLO"]},void 0,!0,void 0,this),_Z.jsxDEV(L1,{},void 0,!1,void 0,this),F&&_Z.jsxDEV(O,{color:"red",bold:!0,children:[" ","/summary"]},void 0,!0,void 0,this),_Z.jsxDEV(O,{color:"green",bold:!0,children:Q.length},void 0,!1,void 0,this),_Z.jsxDEV(O,{color:"blue",children:H},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$&&_Z.jsxDEV(N,{children:_Z.jsxDEV(O,{color:"yellow",children:P1(z)},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),X&&_Z.jsxDEV(D1,{},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},E1=D2;var a=L(v(),1),V2=()=>{let{activeView:Z}=J0();return a.jsxDEV(N,{flexDirection:"column",width:"100%",children:[a.jsxDEV(N,{flexGrow:1,flexDirection:"row",children:[a.jsxDEV(o,{name:"ChatMain",fallback:a.jsxDEV(O,{color:"yellow",children:"Chat view unavailable"},void 0,!1,void 0,this),children:Z==="chat"?a.jsxDEV(Z8,{},void 0,!1,void 0,this):null},void 0,!1,void 0,this),a.jsxDEV(o,{name:"PanelView",fallback:a.jsxDEV(O,{color:"yellow",children:"Panel unavailable"},void 0,!1,void 0,this),children:Z!=="chat"?a.jsxDEV(Y8,{},void 0,!1,void 0,this):null},void 0,!1,void 0,this)]},void 0,!0,void 0,this),a.jsxDEV(o,{name:"StatusBar",fallback:null,children:a.jsxDEV(E1,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},E2=()=>{return a.jsxDEV(o,{name:"Chat",children:a.jsxDEV(P5,{children:a.jsxDEV(V2,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)},b2=()=>{return a.jsxDEV(o,{name:"AppRoot",children:a.jsxDEV(b1,{apiUrl:"http://127.0.0.1:8123",defaultAgent:"code",defaultHeaders:{},withCredentials:!1,showHistory:!1,showGraph:!1,onInitError:(Z,Y)=>{console.error(Z,Y)},fetch:C8,autoRestoreLastSession:!0,historyFilter:{metadata:{path:process.cwd()}},children:a.jsxDEV(o,{name:"TanStackQueryProvider",children:a.jsxDEV(H8,{children:a.jsxDEV(o,{name:"SettingsProvider",children:a.jsxDEV(f1,{get_allowed_models:v8,children:a.jsxDEV(o,{name:"ApprovalProvider",children:a.jsxDEV(T1,{children:a.jsxDEV(o,{name:"InteractionProvider",children:a.jsxDEV(d0,{children:a.jsxDEV(E2,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)},T2=()=>a.jsxDEV(b2,{},void 0,!1,void 0,this),$8=T2;var Q4=L(v(),1),f2=({error:Z})=>Q4.jsxDEV(N,{flexDirection:"column",padding:2,borderStyle:"double",borderColor:"red",children:[Q4.jsxDEV(O,{color:"red",bold:!0,children:"✗ Application Crashed"},void 0,!1,void 0,this),Q4.jsxDEV(N,{marginTop:1,children:Q4.jsxDEV(O,{color:"red",children:Z.message},void 0,!1,void 0,this)},void 0,!1,void 0,this),Q4.jsxDEV(N,{marginTop:1,children:Q4.jsxDEV(O,{color:"gray",children:["Stack: ",Z.stack?.split(`
|
|
346
346
|
`).slice(0,3).join(`
|
|
347
|
-
`)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),
|
|
347
|
+
`)]},void 0,!0,void 0,this)},void 0,!1,void 0,this),Q4.jsxDEV(N,{marginTop:1,children:Q4.jsxDEV(O,{color:"blue",children:"Press Ctrl+C to exit"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this);try{K8(Q4.jsxDEV($8,{},void 0,!1,void 0,this),{exitOnCtrlC:!1})}catch(Z){console.error("Critical rendering error:",Z),K8(Q4.jsxDEV(f2,{error:Z},void 0,!1,void 0,this))}process.on("unhandledRejection",(Z,Y)=>{console.error("Unhandled Rejection at:",Y,"reason:",Z)});process.on("uncaughtException",(Z)=>{console.error("Uncaught Exception:",Z)});
|