@qitqode/qitqode-android-arm64 0.2.11 → 0.2.13
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/bundle/{chunk-cshsqavb.js → chunk-00krzh3y.js} +2 -2
- package/bundle/{chunk-42gd2vx4.js → chunk-04x4b2yy.js} +1 -1
- package/bundle/{chunk-vyf77kq1.js → chunk-08mgb5tt.js} +2 -2
- package/bundle/{chunk-7jvx29js.js → chunk-094m66q5.js} +1 -1
- package/bundle/{chunk-9d8meavf.js → chunk-0cjp9088.js} +1 -1
- package/bundle/{chunk-hav9pgf3.js → chunk-0mdmqtfr.js} +2 -2
- package/bundle/chunk-0nves64y.js +2 -0
- package/bundle/chunk-0v7knkt5.js +2 -0
- package/bundle/{chunk-y565z8n2.js → chunk-0w77vhg4.js} +2 -2
- package/bundle/{chunk-ex47pb9n.js → chunk-0ware2sh.js} +2 -2
- package/bundle/{chunk-9svh74gt.js → chunk-0xf12tf3.js} +1 -1
- package/bundle/{chunk-1rsabv4p.js → chunk-139qfnsq.js} +1 -1
- package/bundle/chunk-1851skhm.js +10 -0
- package/bundle/{chunk-92xxg12q.js → chunk-1bbx1da7.js} +1 -1
- package/bundle/{chunk-89b6ttzs.js → chunk-1bhcg889.js} +1 -1
- package/bundle/{chunk-g83d3a0t.js → chunk-1exjy880.js} +2 -2
- package/bundle/{chunk-s3zmxfz2.js → chunk-1f9qcrn6.js} +2 -2
- package/bundle/{chunk-5mgmq6yz.js → chunk-1gt6ppza.js} +1 -1
- package/bundle/chunk-1h5jdsgx.js +2 -0
- package/bundle/{chunk-k4d8gwxe.js → chunk-1q5h95hc.js} +1 -1
- package/bundle/chunk-1r5e1jsb.js +2 -0
- package/bundle/{chunk-7wshaze9.js → chunk-1rafe6f5.js} +2 -2
- package/bundle/{chunk-22wa8zty.js → chunk-1rw4srd1.js} +1 -1
- package/bundle/{chunk-rvev3cy6.js → chunk-1sejtx9a.js} +2 -2
- package/bundle/{chunk-1yh1f9yj.js → chunk-1wy8wmah.js} +1 -1
- package/bundle/chunk-1wyy3c48.js +2 -0
- package/bundle/chunk-1z299xq6.js +2 -0
- package/bundle/{chunk-f78yth0b.js → chunk-21aqt31s.js} +1 -1
- package/bundle/chunk-22aq9ymg.js +2 -0
- package/bundle/chunk-26a17c9z.js +2 -0
- package/bundle/chunk-2a154mr0.js +2 -0
- package/bundle/{chunk-n2ytaxyn.js → chunk-2b80n6nx.js} +1 -1
- package/bundle/{chunk-fqvrxy41.js → chunk-2bfq0mtx.js} +1 -1
- package/bundle/{chunk-tqnf1p88.js → chunk-2d0vympj.js} +1 -1
- package/bundle/{chunk-wdy0fsp8.js → chunk-2md5fz4f.js} +1 -1
- package/bundle/chunk-2nbce486.js +2 -0
- package/bundle/chunk-2npxatq9.js +2 -0
- package/bundle/{chunk-xf1y0sc6.js → chunk-2p1qaqv3.js} +1 -1
- package/bundle/{chunk-3hawwbw6.js → chunk-2ts2s8b4.js} +2 -2
- package/bundle/{chunk-43x9n8rp.js → chunk-374js0y6.js} +1 -1
- package/bundle/{chunk-wp0xd7at.js → chunk-3be70hxy.js} +1 -1
- package/bundle/{chunk-kr975sx0.js → chunk-3fx3eghq.js} +1 -1
- package/bundle/{chunk-cs3cbfm8.js → chunk-3gryj9r9.js} +1 -1
- package/bundle/{chunk-9wzxnwv7.js → chunk-3jnanbjr.js} +1 -1
- package/bundle/chunk-3meh1cbc.js +2 -0
- package/bundle/{chunk-pfd8gzy4.js → chunk-3rcfy8te.js} +1 -1
- package/bundle/{chunk-cgxzmkkf.js → chunk-3t71xfr6.js} +1 -1
- package/bundle/chunk-4045jzv5.js +2 -0
- package/bundle/{chunk-wzfb19t6.js → chunk-404ew3d3.js} +1 -1
- package/bundle/{chunk-zskjqrmc.js → chunk-45dtsre6.js} +1 -1
- package/bundle/chunk-47pxz6cb.js +5 -0
- package/bundle/{chunk-4805mxf7.js → chunk-4ar8hey8.js} +1 -1
- package/bundle/chunk-4b2vv484.js +2 -0
- package/bundle/chunk-4ene1ymj.js +2 -0
- package/bundle/{chunk-y24yxs9g.js → chunk-4enhsmq1.js} +1 -1
- package/bundle/{chunk-zj5snrsa.js → chunk-4krmja97.js} +1 -1
- package/bundle/{chunk-46ewdxgh.js → chunk-4s9d2zte.js} +1 -1
- package/bundle/{chunk-51vn4f06.js → chunk-4wzv2v36.js} +2 -2
- package/bundle/{chunk-vhh80d5j.js → chunk-53n3tfwn.js} +2 -2
- package/bundle/{chunk-fqvsxg00.js → chunk-5828bcp8.js} +1 -1
- package/bundle/chunk-58r5etg8.js +2 -0
- package/bundle/{chunk-rx29zmw2.js → chunk-5a4zt1b7.js} +1 -1
- package/bundle/chunk-5c2zw4h0.js +2 -0
- package/bundle/{chunk-e9vh8d52.js → chunk-5e0vejcb.js} +2 -2
- package/bundle/{chunk-y7cqyeve.js → chunk-5es19n1m.js} +2 -2
- package/bundle/{chunk-r4qpsa4e.js → chunk-5fbzvy6q.js} +1 -1
- package/bundle/{chunk-pcmsxhrb.js → chunk-5gv6r7v8.js} +1 -1
- package/bundle/{chunk-hama2v6a.js → chunk-5psekq9f.js} +1 -1
- package/bundle/{chunk-vf75j9wd.js → chunk-5rtsnnjk.js} +1 -1
- package/bundle/{chunk-t3e19wdp.js → chunk-5wjwzbk8.js} +1 -1
- package/bundle/chunk-608f83n0.js +2 -0
- package/bundle/{chunk-zjfdptdj.js → chunk-610mqqqa.js} +1 -1
- package/bundle/chunk-671r50ry.js +2 -0
- package/bundle/chunk-6bfnhr3d.js +2 -0
- package/bundle/chunk-6cv6d8rw.js +2 -0
- package/bundle/{chunk-mazakqr7.js → chunk-6dmk2eyt.js} +1 -1
- package/bundle/{chunk-x28chfpz.js → chunk-6g3bzap8.js} +2 -2
- package/bundle/{chunk-qtdxy2q1.js → chunk-6jb4mnvq.js} +2 -2
- package/bundle/{chunk-8z65v9c9.js → chunk-6kpk6pr3.js} +1 -1
- package/bundle/chunk-6qm6f88j.js +2 -0
- package/bundle/{chunk-bxc3z38f.js → chunk-6wt8g6mc.js} +2 -2
- package/bundle/{chunk-nvvja3ch.js → chunk-71naz1qp.js} +1 -1
- package/bundle/{chunk-3amgvg81.js → chunk-72qx43fq.js} +1 -1
- package/bundle/chunk-78bfwwmc.js +2 -0
- package/bundle/{chunk-hts68y73.js → chunk-78rfz0ex.js} +1 -1
- package/bundle/{chunk-075gkea2.js → chunk-7bvh48s2.js} +1 -1
- package/bundle/{chunk-71h3pmnn.js → chunk-7h0regqs.js} +1 -1
- package/bundle/{chunk-4c6d1wy1.js → chunk-7k1q26yn.js} +2 -2
- package/bundle/{chunk-4ngvj758.js → chunk-7nh8vjx4.js} +1 -1
- package/bundle/{chunk-fsagyvkz.js → chunk-7p8f8xav.js} +1 -1
- package/bundle/chunk-7wwtgxxf.js +2 -0
- package/bundle/{chunk-k8zbhj2p.js → chunk-81mwbcy3.js} +1 -1
- package/bundle/{chunk-8gn7r4kb.js → chunk-821zkh5v.js} +1 -1
- package/bundle/{chunk-xmt17jd4.js → chunk-84712kbe.js} +1 -1
- package/bundle/{chunk-k56zj08h.js → chunk-8hrt4d0v.js} +1 -1
- package/bundle/{chunk-vrt8wd3r.js → chunk-8psfgg8y.js} +1 -1
- package/bundle/{chunk-09n24ztn.js → chunk-8xbd0ra5.js} +1 -1
- package/bundle/{chunk-50knjq36.js → chunk-95ga21eq.js} +1 -1
- package/bundle/{chunk-8qbhnwej.js → chunk-962hspr0.js} +1 -1
- package/bundle/chunk-98sb49dz.js +2 -0
- package/bundle/{chunk-dzw0j790.js → chunk-9a9qcvtz.js} +2 -2
- package/bundle/{chunk-p5p4jh9s.js → chunk-9c0f79mt.js} +1 -1
- package/bundle/{chunk-1h9sc0gy.js → chunk-9h2fms7x.js} +1 -1
- package/bundle/chunk-9kbtpq9m.js +2 -0
- package/bundle/{chunk-96nmxprr.js → chunk-9r6wk75s.js} +1 -1
- package/bundle/chunk-9szp9b4m.js +2 -0
- package/bundle/{chunk-1pd943m9.js → chunk-9xbc558j.js} +1 -1
- package/bundle/chunk-9xqszq0c.js +2 -0
- package/bundle/chunk-a32kjs9e.js +2 -0
- package/bundle/{chunk-fnmq42y5.js → chunk-a4242cn4.js} +1 -1
- package/bundle/{chunk-bwzbcwff.js → chunk-ajykvcas.js} +1 -1
- package/bundle/{chunk-sjtq9bbb.js → chunk-anm5g0m4.js} +1 -1
- package/bundle/chunk-apym02ct.js +2 -0
- package/bundle/{chunk-5qydhr42.js → chunk-aq75kv5f.js} +2 -2
- package/bundle/chunk-armv2rv5.js +2 -0
- package/bundle/chunk-as215v64.js +2 -0
- package/bundle/{chunk-y8tx9x5b.js → chunk-b46t2315.js} +1 -1
- package/bundle/{chunk-78e76m4h.js → chunk-ba2hn77m.js} +1 -1
- package/bundle/{chunk-tyk97q7c.js → chunk-bd4krah7.js} +1 -1
- package/bundle/chunk-bnmpgpyf.js +2 -0
- package/bundle/{chunk-rxh160jr.js → chunk-bpv378bm.js} +1 -1
- package/bundle/chunk-bq3zt1x1.js +2 -0
- package/bundle/{chunk-sz75fx13.js → chunk-bx8fgjam.js} +1 -1
- package/bundle/{chunk-9gs4en9v.js → chunk-bydaqb08.js} +1 -1
- package/bundle/{chunk-n4fwztya.js → chunk-c1srcpfk.js} +1 -1
- package/bundle/{chunk-tpw1ewqn.js → chunk-c99npyz9.js} +1 -1
- package/bundle/chunk-ckcnb59t.js +2 -0
- package/bundle/{chunk-bffm0wv9.js → chunk-csbndz33.js} +1 -1
- package/bundle/{chunk-88hmeyf5.js → chunk-cv3xdp8q.js} +6 -6
- package/bundle/{chunk-h6kmpgak.js → chunk-d2049chz.js} +1 -1
- package/bundle/{chunk-611wfdn3.js → chunk-d4ys15w3.js} +1 -1
- package/bundle/chunk-d79xaj6s.js +3 -0
- package/bundle/chunk-dah2d37s.js +2 -0
- package/bundle/chunk-dhgjv1n2.js +2 -0
- package/bundle/chunk-dk9k8ff5.js +2 -0
- package/bundle/{chunk-eya9c81t.js → chunk-dmgdwvn1.js} +1 -1
- package/bundle/{chunk-r6055kk0.js → chunk-dpm5x19e.js} +2 -2
- package/bundle/{chunk-pdcj2rfz.js → chunk-dwjv3m5s.js} +1 -1
- package/bundle/chunk-dymysn4h.js +2 -0
- package/bundle/{chunk-jt7g0r2j.js → chunk-dzy3ezht.js} +1 -1
- package/bundle/{chunk-43eqr0ds.js → chunk-e0w082wt.js} +6 -6
- package/bundle/{chunk-2vsqsxe1.js → chunk-e4658j15.js} +3 -3
- package/bundle/{chunk-t076hwsv.js → chunk-e6s8ep9m.js} +1 -1
- package/bundle/{chunk-gfer8ch3.js → chunk-ec1bwa7f.js} +1 -1
- package/bundle/{chunk-1dnvdeat.js → chunk-eefzbdbk.js} +1 -1
- package/bundle/{chunk-q8qx38kz.js → chunk-eh73j82b.js} +1 -1
- package/bundle/{chunk-xfsccqsm.js → chunk-es6vbsjg.js} +1 -1
- package/bundle/{chunk-s3hbwksw.js → chunk-etvwxwn3.js} +1 -1
- package/bundle/chunk-ev4gw5k6.js +2 -0
- package/bundle/chunk-ew2dxm43.js +2 -0
- package/bundle/{chunk-wspbjh74.js → chunk-ewde5bss.js} +2 -2
- package/bundle/{chunk-jh2za7y4.js → chunk-fbd971t7.js} +3 -3
- package/bundle/{chunk-fd6qxjtf.js → chunk-ff031crt.js} +1 -1
- package/bundle/chunk-ffp4wg27.js +2 -0
- package/bundle/{chunk-ph46s66y.js → chunk-fj87htwn.js} +1 -1
- package/bundle/{chunk-m8phqgxp.js → chunk-fmvmp278.js} +1 -1
- package/bundle/{chunk-zr89enb8.js → chunk-fqzfytjk.js} +1 -1
- package/bundle/{chunk-ghdegwnr.js → chunk-g0x6q2ks.js} +1 -1
- package/bundle/{chunk-84qx54nf.js → chunk-g3y5kvg6.js} +1 -1
- package/bundle/{chunk-sbj816s8.js → chunk-g6ffx794.js} +1 -1
- package/bundle/{chunk-y8bxvp3c.js → chunk-gcpwm7b5.js} +1 -1
- package/bundle/{chunk-ncvr75f6.js → chunk-gdawpkxs.js} +1 -1
- package/bundle/{chunk-yhr7s8qm.js → chunk-gjmxrz0v.js} +1 -1
- package/bundle/{chunk-95tec4gm.js → chunk-gtmtvjwc.js} +1 -1
- package/bundle/{chunk-yvtbt12y.js → chunk-gvc1mqrs.js} +2 -2
- package/bundle/{chunk-49brdmgp.js → chunk-gw2fz5ry.js} +1 -1
- package/bundle/{chunk-2ts74cgq.js → chunk-h1p3xcfp.js} +1 -1
- package/bundle/{chunk-hntsg7q4.js → chunk-h2vtypa5.js} +1 -1
- package/bundle/{chunk-ccghr6pm.js → chunk-h9tcpbr7.js} +1 -1
- package/bundle/{chunk-wqkvsj5y.js → chunk-hcd0k14e.js} +1 -1
- package/bundle/{chunk-pkm3w0ks.js → chunk-hd6sd912.js} +1 -1
- package/bundle/{chunk-32x2901e.js → chunk-hgcnzsd5.js} +1 -1
- package/bundle/chunk-hjy90gt2.js +2 -0
- package/bundle/{chunk-tz60e15h.js → chunk-hk8m8vax.js} +2 -2
- package/bundle/chunk-hmden934.js +2 -0
- package/bundle/{chunk-48y4n9ne.js → chunk-hnbtfpb7.js} +1 -1
- package/bundle/{chunk-49we3vy1.js → chunk-hp9q7vvq.js} +2 -2
- package/bundle/{chunk-j5dnzqjy.js → chunk-hrfdrz36.js} +1 -1
- package/bundle/chunk-hsm8fbb1.js +2 -0
- package/bundle/{chunk-vbcekkw2.js → chunk-hsmtjb4d.js} +2 -2
- package/bundle/chunk-hz1xfedb.js +2 -0
- package/bundle/{chunk-8y03p2md.js → chunk-hzzvmr41.js} +1 -1
- package/bundle/chunk-ja9y478k.js +2 -0
- package/bundle/chunk-jam7xyjf.js +2 -0
- package/bundle/{chunk-a2pd7nt5.js → chunk-jmrqp50k.js} +1 -1
- package/bundle/{chunk-c53ev0da.js → chunk-jrh028na.js} +2 -2
- package/bundle/{chunk-j7d3v0x2.js → chunk-jt94rhev.js} +1 -1
- package/bundle/{chunk-vnz9n9z0.js → chunk-k3x6z5q1.js} +1 -1
- package/bundle/chunk-k51qphrk.js +2 -0
- package/bundle/{chunk-z1xeqrgd.js → chunk-kee7xpe3.js} +1 -1
- package/bundle/{chunk-k5swnh8m.js → chunk-m18pxkdg.js} +3 -3
- package/bundle/{chunk-wpx2vmf5.js → chunk-map852em.js} +1 -1
- package/bundle/{chunk-c5n49vrd.js → chunk-mbma071k.js} +2 -2
- package/bundle/{chunk-s6vhscvd.js → chunk-mchf2bcc.js} +1 -1
- package/bundle/{chunk-wpkr3vzf.js → chunk-mfg4stzn.js} +1 -1
- package/bundle/{chunk-d39e4fa8.js → chunk-mgff8bcx.js} +1 -1
- package/bundle/{chunk-k232ny9m.js → chunk-mhn0a828.js} +1 -1
- package/bundle/{chunk-cm7yp259.js → chunk-mqtj38j9.js} +1 -1
- package/bundle/{chunk-mnxcykeq.js → chunk-mrh5q4s6.js} +2 -2
- package/bundle/{chunk-9d2mtevw.js → chunk-msbe5rb7.js} +1 -1
- package/bundle/{chunk-sxtfssjv.js → chunk-n73ckwr7.js} +1 -1
- package/bundle/{chunk-wkepvmgt.js → chunk-nn2hbew8.js} +1 -1
- package/bundle/{chunk-98z5pfvj.js → chunk-npryn3en.js} +1 -1
- package/bundle/chunk-p13eeqe4.js +2 -0
- package/bundle/{chunk-d1j8frtq.js → chunk-p3tcw42f.js} +1 -1
- package/bundle/chunk-p45f2nyb.js +2 -0
- package/bundle/{chunk-7x4g7h04.js → chunk-p863r97y.js} +1 -1
- package/bundle/{chunk-6xx66mr1.js → chunk-paqy0c2v.js} +1 -1
- package/bundle/{chunk-1tdy73ha.js → chunk-pfen4ekj.js} +1 -1
- package/bundle/{chunk-b79bb2g3.js → chunk-pzn7cade.js} +1 -1
- package/bundle/{chunk-jfe9f2wv.js → chunk-q7wc3frq.js} +1 -1
- package/bundle/{chunk-e5cds19n.js → chunk-qa38xchd.js} +1 -1
- package/bundle/{chunk-d6qs2pbx.js → chunk-qqftaqza.js} +1 -1
- package/bundle/{chunk-nwygsfhk.js → chunk-qvwx32p9.js} +1 -1
- package/bundle/chunk-qw9whsy2.js +2 -0
- package/bundle/{chunk-bd66q24j.js → chunk-r65zw08x.js} +3 -3
- package/bundle/chunk-r77kpzdv.js +2 -0
- package/bundle/{chunk-rkmg0gbq.js → chunk-r9hsd9pw.js} +1 -1
- package/bundle/chunk-rc95tp19.js +2 -0
- package/bundle/{chunk-n9969djm.js → chunk-rf9pjbg3.js} +1 -1
- package/bundle/chunk-rmh2fhqy.js +2 -0
- package/bundle/{chunk-k4ajben7.js → chunk-rqdfmbns.js} +1 -1
- package/bundle/{chunk-zr1cvkpb.js → chunk-rr94dpe9.js} +1 -1
- package/bundle/chunk-rrn86a8w.js +2 -0
- package/bundle/{chunk-44685nzw.js → chunk-rwt0rwvn.js} +1 -1
- package/bundle/{chunk-czfjmrrq.js → chunk-s7ypkpg2.js} +1 -1
- package/bundle/chunk-s8v0h63x.js +2 -0
- package/bundle/chunk-sh4mngre.js +2 -0
- package/bundle/chunk-shqqngm8.js +2 -0
- package/bundle/chunk-sjfcwykr.js +2 -0
- package/bundle/{chunk-akrcbxfa.js → chunk-sn15skh8.js} +1 -1
- package/bundle/chunk-sv01v0n0.js +2 -0
- package/bundle/{chunk-seda5sfd.js → chunk-sv27ep93.js} +1 -1
- package/bundle/{chunk-v5j3ypfv.js → chunk-t1e52h0k.js} +1 -1
- package/bundle/{chunk-k558fr15.js → chunk-t1hw67x4.js} +1 -1
- package/bundle/{chunk-63t0rhc9.js → chunk-t4kma6mq.js} +2 -2
- package/bundle/{chunk-cydpdkx7.js → chunk-t66gerft.js} +1 -1
- package/bundle/{chunk-n5dxwryh.js → chunk-t7gp6mjm.js} +1 -1
- package/bundle/{chunk-pnmadk2h.js → chunk-tks3qzsw.js} +1 -1
- package/bundle/{chunk-ztjrm8m0.js → chunk-tn0sfsks.js} +1 -1
- package/bundle/chunk-tn8hsd2c.js +2 -0
- package/bundle/chunk-tqsx7w8z.js +2 -0
- package/bundle/{chunk-vamwvx0x.js → chunk-trg0zg0q.js} +1 -1
- package/bundle/chunk-tyt1negg.js +2 -0
- package/bundle/{chunk-g7jwp73v.js → chunk-tzw56029.js} +1 -1
- package/bundle/{chunk-r9ng8xx5.js → chunk-v30fmrz0.js} +1 -1
- package/bundle/chunk-v580zwpf.js +3 -0
- package/bundle/{chunk-8rc7cvex.js → chunk-v6djkm35.js} +1 -1
- package/bundle/{chunk-bw0951fs.js → chunk-v9yxkbz7.js} +1 -1
- package/bundle/chunk-vdv6cyh0.js +2 -0
- package/bundle/{chunk-78yvbv9b.js → chunk-vqxyk6as.js} +2 -2
- package/bundle/{chunk-bh1zbz62.js → chunk-vr7525pa.js} +1 -1
- package/bundle/chunk-vsk8yfxp.js +2 -0
- package/bundle/{chunk-kxdw2vtq.js → chunk-vvcyvdnk.js} +1 -1
- package/bundle/chunk-vvgmkjym.js +2 -0
- package/bundle/{chunk-datctfgt.js → chunk-vvmvryh1.js} +2 -2
- package/bundle/{chunk-7b5vney6.js → chunk-vzf04vad.js} +1 -1
- package/bundle/{chunk-tzwm08yc.js → chunk-vzj91hg8.js} +1 -1
- package/bundle/chunk-w0zyex7f.js +2 -0
- package/bundle/{chunk-gz8k40ty.js → chunk-w264gs2c.js} +1 -1
- package/bundle/chunk-w623r5kb.js +3 -0
- package/bundle/{chunk-vm8htc6d.js → chunk-wac35a6p.js} +1 -1
- package/bundle/chunk-wkxt9v7s.js +2 -0
- package/bundle/{chunk-fzxqn4j0.js → chunk-wqm1vawg.js} +1 -1
- package/bundle/{chunk-w32xhz0x.js → chunk-wrkt670m.js} +1 -1
- package/bundle/{chunk-h8yf5e2e.js → chunk-wspm2k19.js} +1 -1
- package/bundle/chunk-wwf6zacw.js +2 -0
- package/bundle/{chunk-e6ckxkj8.js → chunk-wwtyrgga.js} +1 -1
- package/bundle/{chunk-aykvrqrp.js → chunk-x0wy15q9.js} +1 -1
- package/bundle/chunk-x9c8eddk.js +2 -0
- package/bundle/{chunk-bzz2expb.js → chunk-xaewye8w.js} +1 -1
- package/bundle/{chunk-1p39y33b.js → chunk-xgdst5n5.js} +2 -2
- package/bundle/{chunk-r1936yb5.js → chunk-xgphhnpk.js} +1 -1
- package/bundle/chunk-xjed8t2h.js +2 -0
- package/bundle/{chunk-n230jbn9.js → chunk-xn6mwsc9.js} +1 -1
- package/bundle/{chunk-e7a50j2w.js → chunk-xpz5mnwz.js} +1 -1
- package/bundle/{chunk-nwkp2f8e.js → chunk-xrb46v1e.js} +1 -1
- package/bundle/chunk-xxhta1tm.js +2 -0
- package/bundle/{chunk-ajgwyrcf.js → chunk-y5m9c5ek.js} +1 -1
- package/bundle/{chunk-rpc0he6b.js → chunk-y9kjt2jj.js} +1 -1
- package/bundle/{chunk-csmdhh7r.js → chunk-y9mxwwz7.js} +1 -1
- package/bundle/{chunk-zqzh5hp3.js → chunk-ycth54ja.js} +1 -1
- package/bundle/{chunk-a4cmpa56.js → chunk-ydz7387e.js} +1 -1
- package/bundle/{chunk-bqqxvagz.js → chunk-yg5azmxb.js} +1 -1
- package/bundle/{chunk-cg7zeppb.js → chunk-yhe5qz48.js} +1 -1
- package/bundle/chunk-yhj6858v.js +2 -0
- package/bundle/{chunk-hqtex91e.js → chunk-yq3byrpv.js} +1 -1
- package/bundle/{chunk-kt982884.js → chunk-yqvqzg7b.js} +1 -1
- package/bundle/{chunk-dfkcp43a.js → chunk-ys8ajwys.js} +1 -1
- package/bundle/chunk-yzt7p956.js +2 -0
- package/bundle/{chunk-yg0rs4g1.js → chunk-yzxcjr6y.js} +2 -2
- package/bundle/{chunk-3tf7xfw5.js → chunk-z1psybn1.js} +1 -1
- package/bundle/{chunk-qsgpbt4t.js → chunk-z2cnd2cp.js} +1 -1
- package/bundle/{chunk-ep92grvg.js → chunk-z4gczap3.js} +7 -7
- package/bundle/chunk-z56cb3fs.js +2 -0
- package/bundle/{chunk-krk24aqm.js → chunk-z66xdxkg.js} +2 -2
- package/bundle/{chunk-t7s475b2.js → chunk-z6f54x4k.js} +2 -2
- package/bundle/{chunk-ya6r72ng.js → chunk-z6qb4gt5.js} +1 -1
- package/bundle/{chunk-xphzr4wg.js → chunk-zgj7jx8k.js} +2 -2
- package/bundle/{chunk-0tya4pqb.js → chunk-zhddj91f.js} +2 -2
- package/bundle/chunk-zhypknyg.js +2 -0
- package/bundle/index.js +3 -3
- package/bundle/parser.worker.js +2 -2
- package/bundle/worker.js +1 -1
- package/package.json +3 -3
- package/bundle/chunk-06j0gaen.js +0 -2
- package/bundle/chunk-0bn86djg.js +0 -3
- package/bundle/chunk-0mm40z8g.js +0 -2
- package/bundle/chunk-1mqfhw0f.js +0 -2
- package/bundle/chunk-28kte9rt.js +0 -2
- package/bundle/chunk-2dhjehxe.js +0 -2
- package/bundle/chunk-2nnfxbd2.js +0 -2
- package/bundle/chunk-2w5zmgpb.js +0 -2
- package/bundle/chunk-34qt3fqj.js +0 -2
- package/bundle/chunk-3p0xvt47.js +0 -2
- package/bundle/chunk-3pzx5ret.js +0 -2
- package/bundle/chunk-3y4rmqmm.js +0 -2
- package/bundle/chunk-486874bd.js +0 -2
- package/bundle/chunk-4bcbvfsw.js +0 -2
- package/bundle/chunk-4t1ysdag.js +0 -2
- package/bundle/chunk-5q7a4h2w.js +0 -2
- package/bundle/chunk-63vamhf7.js +0 -2
- package/bundle/chunk-6hhv3n7c.js +0 -2
- package/bundle/chunk-7a9kfb2n.js +0 -2
- package/bundle/chunk-7x9m1smk.js +0 -2
- package/bundle/chunk-82mnr6sf.js +0 -2
- package/bundle/chunk-8bea2r6p.js +0 -2
- package/bundle/chunk-8h6mhzhg.js +0 -2
- package/bundle/chunk-8n1cmvr7.js +0 -2
- package/bundle/chunk-955zj1y6.js +0 -2
- package/bundle/chunk-95vp9bvk.js +0 -2
- package/bundle/chunk-9zve998d.js +0 -2
- package/bundle/chunk-a9bkr9x4.js +0 -2
- package/bundle/chunk-ac5vzpzt.js +0 -2
- package/bundle/chunk-c1exgasy.js +0 -2
- package/bundle/chunk-d29te4c1.js +0 -2
- package/bundle/chunk-d6q42p18.js +0 -2
- package/bundle/chunk-dfbexagg.js +0 -2
- package/bundle/chunk-dps1p1g1.js +0 -2
- package/bundle/chunk-e1fzgez5.js +0 -2
- package/bundle/chunk-egcvm4x2.js +0 -3
- package/bundle/chunk-ek3b08ed.js +0 -2
- package/bundle/chunk-gamnnfna.js +0 -2
- package/bundle/chunk-gjxhz1a6.js +0 -2
- package/bundle/chunk-gpm39v12.js +0 -2
- package/bundle/chunk-gr8emzzx.js +0 -2
- package/bundle/chunk-gt6h68pk.js +0 -2
- package/bundle/chunk-hj588j4f.js +0 -2
- package/bundle/chunk-jmgpr5th.js +0 -2
- package/bundle/chunk-jt79yt0t.js +0 -2
- package/bundle/chunk-jtz5re73.js +0 -2
- package/bundle/chunk-k4bj677f.js +0 -3
- package/bundle/chunk-kw5z5awx.js +0 -2
- package/bundle/chunk-mp42gb6q.js +0 -2
- package/bundle/chunk-mq0733qh.js +0 -2
- package/bundle/chunk-mrcsatmn.js +0 -2
- package/bundle/chunk-n24yx79r.js +0 -5
- package/bundle/chunk-ng2g9kkk.js +0 -2
- package/bundle/chunk-ngfhfyjs.js +0 -2
- package/bundle/chunk-p0dnmrqp.js +0 -2
- package/bundle/chunk-p6h2ydcp.js +0 -2
- package/bundle/chunk-qhakedgs.js +0 -2
- package/bundle/chunk-r18zetwf.js +0 -2
- package/bundle/chunk-r6rgrz25.js +0 -2
- package/bundle/chunk-rk4vp09j.js +0 -2
- package/bundle/chunk-s4jp4zce.js +0 -2
- package/bundle/chunk-sec9y622.js +0 -2
- package/bundle/chunk-sn7q178t.js +0 -2
- package/bundle/chunk-st0h54dm.js +0 -2
- package/bundle/chunk-tefh2cgk.js +0 -2
- package/bundle/chunk-tfez99qv.js +0 -2
- package/bundle/chunk-tjk1hymv.js +0 -2
- package/bundle/chunk-v1098rqc.js +0 -2
- package/bundle/chunk-v30ezr68.js +0 -11
- package/bundle/chunk-v5wn741w.js +0 -2
- package/bundle/chunk-vp6ttkct.js +0 -2
- package/bundle/chunk-vpcsmwsb.js +0 -2
- package/bundle/chunk-x23s1s8k.js +0 -2
- package/bundle/chunk-xr6js4ek.js +0 -2
- package/bundle/chunk-y078gb3n.js +0 -2
- package/bundle/chunk-yewjnqee.js +0 -2
- package/bundle/chunk-ykk9e9as.js +0 -2
- package/bundle/chunk-yqn88gjf.js +0 -2
- package/bundle/chunk-yrxg3dex.js +0 -2
- package/bundle/chunk-z5j46dem.js +0 -2
- package/bundle/chunk-zq0hpja9.js +0 -2
- package/bundle/chunk-zv89qwjc.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{ig as Ai,jg as t1,kg as b1,lg as k1,mg as p1,ng as e1,og as s1,pg as f1,qg as rA,rg as nA,sg as a1,vg as cA}from"./chunk-1dnvdeat.js";import{wg as Er,xg as L1}from"./chunk-zj5snrsa.js";import{Bg as W1}from"./chunk-3tf7xfw5.js";import{Gg as Sc}from"./chunk-egcvm4x2.js";import{Ig as Ey}from"./chunk-r4qpsa4e.js";import{Jg as r2}from"./chunk-seda5sfd.js";import{$g as nm,Kg as Ml,Lg as zl,Mg as dn,Ng as _i,Ug as Xr,Vg as Tl,Wg as Km,Yg as Hm,Zg as pn,_g as tn,bh as mm,dh as _r,eh as bc,hh as j1,ih as ql,kh as tc,lh as _l,mh as ol,nh as ji,oh as Ll,ph as Fl,qh as b0,rh as Rm,th as w1,uh as Dr,vh as Ii,wh as Wr,yh as e}from"./chunk-88hmeyf5.js";import{$k as Z,Aj as R1,Ej as fj,Ek as qr,Fj as tr,Fk as Fn,Gj as Rr,Gk as AA,Hj as D2,Ij as yr,Jj as br,Kj as vn,Lj as un,Lk as l1,Oj as Ym,Qk as ir,Rk as Cr,Sk as Ar,Uk as $2,Vk as I0,Wj as v1,Xj as s,Yj as er,al as cr,tj as wr,tk as Pi,uj as rm,uk as Qr,vj as J1,wj as O1,yj as f0,zj as qi}from"./chunk-ep92grvg.js";import{cl as al,ml as uI}from"./chunk-xf1y0sc6.js";import{Al as b,Cl as Wn,El as y0,Il as Gr,Kl as o,nl as Lr,rl as bj,sl as mr,tl as Kn,ul as Hn,zl as mA}from"./chunk-n24yx79r.js";import{Wl as jn}from"./chunk-5qydhr42.js";import{Bn as l0,_m as _n,an as tj,dn as d,fn as im,gn as o1,hn as M1,ln as T1,mn as fi}from"./chunk-v30ezr68.js";import{jp as g}from"./chunk-j7d3v0x2.js";import{Tq as C1,yq as P1}from"./chunk-bxc3z38f.js";import{Ts as bI,Us as eI,Vs as Di}from"./chunk-1p39y33b.js";import{ct as fI,dt as r1}from"./chunk-yg0rs4g1.js";import{At as WI,Bt as x0,Ct as XI,Dt as KI,Et as HI,Ft as RI,Gt as zr,Ht as Ql,It as k0,Jt as VI,Kt as YI,Lt as ZI,Mt as JI,Nt as p0,Ot as OI,Pt as sI,Qt as LI,Rt as qI,St as _I,Tt as _2,Ut as Im,jt as CI,mt as Wi,yt as B0,zt as Pr}from"./chunk-vhh80d5j.js";import{yu as r0}from"./chunk-c5n49vrd.js";import{Bu as lA,Nu as aI}from"./chunk-r6055kk0.js";import{cv as Tj,ev as c0}from"./chunk-datctfgt.js";import{jv as p,sv as _}from"./chunk-x28chfpz.js";import{Dv as Xn,Iv as Zn,yv as kl,zv as IA}from"./chunk-mnxcykeq.js";import{Jv as I}from"./chunk-0bn86djg.js";import{CB as cI,DB as lI,bB as In}from"./chunk-cshsqavb.js";import{$B as Xl,$G as M,$J as Sl,$N as ml,AD as k2,AE as q2,AI as $I,AN as Nl,BG as Sm,BI as Ul,BO as Ri,CE as H0,CJ as P,EI as o2,EN as rI,FH as t,FO as Ci,GD as p2,GJ as GI,HD as a2,HO as gr,IE as d2,IJ as NI,IK as UI,JD as Qm,JJ as Li,KD as $r,KJ as Cl,LD as Y0,MH as vm,MN as nI,ND as Br,NH as wm,NJ as EI,OD as Sn,OJ as QI,ON as iI,PD as L0,PH as SI,PN as mI,RD as Um,RG as z2,SD as Il,TD as vl,TH as hn,TN as X0,UD as or,UJ as DI,VD as Am,VG as Z0,VJ as v0,VN as K0,WD as u2,XD as Vn,XH as vI,XJ as t2,XN as Pm,YJ as S0,ZB as An,ZH as h0,ZJ as b2,ZN as El,_J as Al,aC as zn,aK as e2,bE as AI,bI as O0,bK as s2,cK as X2,dK as ec,dO as K2,eC as x2,eK as wl,fK as f2,gC as C2,hI as Bn,iQ as Fr,jM as PI,kQ as cl,lQ as R0,mI as wI,mO as Dm,oG as S1,oJ as Pl,pE as MI,pQ as F,rE as Tn,rO as sc,uI as Gl,uO as jm,xC as on,yD as Dl,zE as L2,zH as J0,zI as $m,zN as T0}from"./chunk-tz60e15h.js";import{QQ as Av,RQ as nr,SQ as Nr,UQ as sn}from"./chunk-9svh74gt.js";var pm=nr((hy)=>{Object.defineProperty(hy,"__esModule",{value:!0});hy.default=tA;var My=/[A-Z]/g;function Ty(r){return r.toLowerCase()}function tA(r,n){let i=r.replace(My,Ty),m=n.replace(My,Ty);return i===m}});var Rc=nr((By)=>{Object.defineProperty(By,"__esModule",{value:!0});By.DnsTxt=void 0;class Hc{constructor(r={}){this.binary=r?r.binary:!1}encode(r={}){return Object.entries(r).map(([n,i])=>{let m=`${n}=${i}`;return Buffer.from(m)})}decode(r){var n={};try{let m=r.toString().split(/=(.+)/),c=m[0],l=m[1];n[c]=l}catch(i){}return n}decodeAll(r){return r.filter((n)=>n.length>1).map((n)=>this.decode(n)).reduce((n,i)=>{var m=n;let[c]=Object.keys(i),[l]=Object.values(i);return m[c]=l,m},{})}}By.DnsTxt=Hc;By.default=Hc});var Vc=nr((py)=>{Object.defineProperty(py,"__esModule",{value:!0});py.toType=py.toString=void 0;var ky=(r)=>{return"_"+r},sA=(r)=>{return["name","protocol","subtype"].includes(r)},fA=(r)=>{let n={name:r.name,protocol:r.protocol,subtype:r.subtype};return Object.entries(n).filter(([m,c])=>sA(m)&&c!==void 0).reduce((m,[c,l])=>{switch(typeof l){case"object":l.map((y)=>m.push(ky(y)));break;default:m.push(ky(l));break}return m},[]).join(".")};py.toString=fA;var rS=(r)=>{let n=r.split("."),i;for(let m in n){if(n[m][0]!=="_")continue;n[m]=n[m].slice(1)}if(n.includes("sub"))i=n.shift(),n.shift();return{name:n.shift(),protocol:n.shift()||null,subtype:i}};py.toType=rS});var Zc=nr((en)=>{var dy=en&&en.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(en,"__esModule",{value:!0});en.Service=void 0;var uy=dy(sn("os")),iS=dy(Rc()),mS=sn("events"),cS=Vc(),am=".local";class Yc extends mS.EventEmitter{constructor(r){super();if(this.probe=!0,this.published=!1,this.activated=!1,this.destroyed=!1,this.txtService=new iS.default,!r.name)throw Error("ServiceConfig requires `name` property to be set");if(!r.type)throw Error("ServiceConfig requires `type` property to be set");if(!r.port)throw Error("ServiceConfig requires `port` property to be set");this.name=r.name.split(".").join("-"),this.protocol=r.protocol||"tcp",this.type=(0,cS.toString)({name:r.type,protocol:this.protocol}),this.port=r.port,this.host=r.host||uy.default.hostname(),this.fqdn=`${this.name}.${this.type}${am}`,this.txt=r.txt,this.subtypes=r.subtypes,this.disableIPv6=!!r.disableIPv6}records(){var r=[this.RecordPTR(this),this.RecordSRV(this),this.RecordTXT(this)];for(let i of this.subtypes||[])r.push(this.RecordSubtypePTR(this,i));let n=Object.values(uy.default.networkInterfaces());for(let i of n){let m=i;for(let c of m){if(c.internal||c.mac==="00:00:00:00:00:00")continue;switch(c.family){case"IPv4":r.push(this.RecordA(this,c.address));break;case"IPv6":if(this.disableIPv6)break;r.push(this.RecordAAAA(this,c.address));break}}}return r}RecordPTR(r){return{name:`${r.type}${am}`,type:"PTR",ttl:28800,data:r.fqdn}}RecordSubtypePTR(r,n){return{name:`_${n}._sub.${r.type}${am}`,type:"PTR",ttl:28800,data:`${r.name}.${r.type}${am}`}}RecordSRV(r){return{name:r.fqdn,type:"SRV",ttl:120,data:{port:r.port,target:r.host}}}RecordTXT(r){return{name:r.fqdn,type:"TXT",ttl:4500,data:this.txtService.encode(r.txt)}}RecordA(r,n){return{name:r.host,type:"A",ttl:120,data:n}}RecordAAAA(r,n){return{name:r.host,type:"AAAA",ttl:120,data:n}}}en.Service=Yc;en.default=Yc});var by=nr((fn)=>{var ty=fn&&fn.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(fn,"__esModule",{value:!0});fn.Registry=void 0;var lS=ty(pm()),Jc=ty(Zc()),yS=3600000,jS=3,IS=function(){};class Oc{constructor(r){this.services=[],this.server=r}publish(r){function n(c,l,y){if(c.activated)return;if(c.activated=!0,l.services.push(c),!(c instanceof Jc.default))return;if(y===null||y===void 0?void 0:y.probe)l.probe(l.server.mdns,c,(j)=>{if(j){if(c.stop!==void 0)c.stop();console.log(Error("Service name is already in use on the network"));return}l.announce(l.server,c)});else l.announce(l.server,c)}function i(c,l,y){if(!y)y=IS;if(!c.activated)return process.nextTick(y);if(!(c instanceof Jc.default))return process.nextTick(y);l.teardown(l.server,c,y);let j=l.services.indexOf(c);if(j!==-1)l.services.splice(j,1)}let m=new Jc.default(r);return m.start=n.bind(null,m,this),m.stop=i.bind(null,m,this),m.start({probe:r.probe!==!1}),m}unpublishAll(r){this.teardown(this.server,this.services,r),this.services=[]}destroy(){this.services.map((r)=>r.destroyed=!0)}probe(r,n,i){var m=!1,c=0,l;let y=()=>{if(!n.activated||n.destroyed)return;r.query(n.fqdn,"ANY",function(){m=!0,l=setTimeout(++c<3?y:S,250),l.unref()})},j=(v)=>{if(!m)return;if(v.answers.some(A)||v.additionals.some(A))S(!0)},A=(v)=>{return(0,lS.default)(v.name,n.fqdn)},S=(v)=>{r.removeListener("response",j),clearTimeout(l),i(!!v)};r.on("response",j),setTimeout(y,Math.random()*250)}announce(r,n){var i=1000,m=n.records();r.register(m);let c=()=>{if(!n.activated||n.destroyed)return;r.mdns.respond(m,function(){if(!n.published)n.activated=!0,n.published=!0,n.emit("up");if(i=i*jS,i<yS&&!n.destroyed)setTimeout(c,i).unref()})};c()}teardown(r,n,i){if(!Array.isArray(n))n=[n];n=n.filter((c)=>c.activated);var m=n.flatMap(function(c){c.activated=!1;var l=c.records();return l.forEach((y)=>{y.ttl=0}),l});if(m.length===0)return i&&process.nextTick(i);r.unregister(m),r.mdns.respond(m,function(){if(n.forEach(function(c){c.published=!1}),typeof i==="function")i.apply(null,arguments)})}}fn.Registry=Oc;fn.default=Oc});var ey=nr((AS)=>{AS.toString=function(r){switch(r){case 1:return"A";case 10:return"NULL";case 28:return"AAAA";case 18:return"AFSDB";case 42:return"APL";case 257:return"CAA";case 60:return"CDNSKEY";case 59:return"CDS";case 37:return"CERT";case 5:return"CNAME";case 49:return"DHCID";case 32769:return"DLV";case 39:return"DNAME";case 48:return"DNSKEY";case 43:return"DS";case 55:return"HIP";case 13:return"HINFO";case 45:return"IPSECKEY";case 25:return"KEY";case 36:return"KX";case 29:return"LOC";case 15:return"MX";case 35:return"NAPTR";case 2:return"NS";case 47:return"NSEC";case 50:return"NSEC3";case 51:return"NSEC3PARAM";case 12:return"PTR";case 46:return"RRSIG";case 17:return"RP";case 24:return"SIG";case 6:return"SOA";case 99:return"SPF";case 33:return"SRV";case 44:return"SSHFP";case 32768:return"TA";case 249:return"TKEY";case 52:return"TLSA";case 250:return"TSIG";case 16:return"TXT";case 252:return"AXFR";case 251:return"IXFR";case 41:return"OPT";case 255:return"ANY"}return"UNKNOWN_"+r};AS.toType=function(r){switch(r.toUpperCase()){case"A":return 1;case"NULL":return 10;case"AAAA":return 28;case"AFSDB":return 18;case"APL":return 42;case"CAA":return 257;case"CDNSKEY":return 60;case"CDS":return 59;case"CERT":return 37;case"CNAME":return 5;case"DHCID":return 49;case"DLV":return 32769;case"DNAME":return 39;case"DNSKEY":return 48;case"DS":return 43;case"HIP":return 55;case"HINFO":return 13;case"IPSECKEY":return 45;case"KEY":return 25;case"KX":return 36;case"LOC":return 29;case"MX":return 15;case"NAPTR":return 35;case"NS":return 2;case"NSEC":return 47;case"NSEC3":return 50;case"NSEC3PARAM":return 51;case"PTR":return 12;case"RRSIG":return 46;case"RP":return 17;case"SIG":return 24;case"SOA":return 6;case"SPF":return 99;case"SRV":return 33;case"SSHFP":return 44;case"TA":return 32768;case"TKEY":return 249;case"TLSA":return 52;case"TSIG":return 250;case"TXT":return 16;case"AXFR":return 252;case"IXFR":return 251;case"OPT":return 41;case"ANY":return 255;case"*":return 255}if(r.toUpperCase().startsWith("UNKNOWN_"))return parseInt(r.slice(8));return 0}});var sy=nr((wS)=>{wS.toString=function(r){switch(r){case 0:return"NOERROR";case 1:return"FORMERR";case 2:return"SERVFAIL";case 3:return"NXDOMAIN";case 4:return"NOTIMP";case 5:return"REFUSED";case 6:return"YXDOMAIN";case 7:return"YXRRSET";case 8:return"NXRRSET";case 9:return"NOTAUTH";case 10:return"NOTZONE";case 11:return"RCODE_11";case 12:return"RCODE_12";case 13:return"RCODE_13";case 14:return"RCODE_14";case 15:return"RCODE_15"}return"RCODE_"+r};wS.toRcode=function(r){switch(r.toUpperCase()){case"NOERROR":return 0;case"FORMERR":return 1;case"SERVFAIL":return 2;case"NXDOMAIN":return 3;case"NOTIMP":return 4;case"REFUSED":return 5;case"YXDOMAIN":return 6;case"YXRRSET":return 7;case"NXRRSET":return 8;case"NOTAUTH":return 9;case"NOTZONE":return 10;case"RCODE_11":return 11;case"RCODE_12":return 12;case"RCODE_13":return 13;case"RCODE_14":return 14;case"RCODE_15":return 15}return 0}});var fy=nr((NS)=>{NS.toString=function(r){switch(r){case 0:return"QUERY";case 1:return"IQUERY";case 2:return"STATUS";case 3:return"OPCODE_3";case 4:return"NOTIFY";case 5:return"UPDATE";case 6:return"OPCODE_6";case 7:return"OPCODE_7";case 8:return"OPCODE_8";case 9:return"OPCODE_9";case 10:return"OPCODE_10";case 11:return"OPCODE_11";case 12:return"OPCODE_12";case 13:return"OPCODE_13";case 14:return"OPCODE_14";case 15:return"OPCODE_15"}return"OPCODE_"+r};NS.toOpcode=function(r){switch(r.toUpperCase()){case"QUERY":return 0;case"IQUERY":return 1;case"STATUS":return 2;case"OPCODE_3":return 3;case"NOTIFY":return 4;case"UPDATE":return 5;case"OPCODE_6":return 6;case"OPCODE_7":return 7;case"OPCODE_8":return 8;case"OPCODE_9":return 9;case"OPCODE_10":return 10;case"OPCODE_11":return 11;case"OPCODE_12":return 12;case"OPCODE_13":return 13;case"OPCODE_14":return 14;case"OPCODE_15":return 15}return 0}});var rj=nr((DS)=>{DS.toString=function(r){switch(r){case 1:return"IN";case 2:return"CS";case 3:return"CH";case 4:return"HS";case 255:return"ANY"}return"UNKNOWN_"+r};DS.toClass=function(r){switch(r.toUpperCase()){case"IN":return 1;case"CS":return 2;case"CH":return 3;case"HS":return 4;case"ANY":return 255}return 0}});var nj=nr((CS)=>{CS.toString=function(r){switch(r){case 1:return"LLQ";case 2:return"UL";case 3:return"NSID";case 5:return"DAU";case 6:return"DHU";case 7:return"N3U";case 8:return"CLIENT_SUBNET";case 9:return"EXPIRE";case 10:return"COOKIE";case 11:return"TCP_KEEPALIVE";case 12:return"PADDING";case 13:return"CHAIN";case 14:return"KEY_TAG";case 26946:return"DEVICEID"}if(r<0)return null;return`OPTION_${r}`};CS.toCode=function(r){if(typeof r==="number")return r;if(!r)return-1;switch(r.toUpperCase()){case"OPTION_0":return 0;case"LLQ":return 1;case"UL":return 2;case"NSID":return 3;case"OPTION_4":return 4;case"DAU":return 5;case"DHU":return 6;case"N3U":return 7;case"CLIENT_SUBNET":return 8;case"EXPIRE":return 9;case"COOKIE":return 10;case"TCP_KEEPALIVE":return 11;case"PADDING":return 12;case"CHAIN":return 13;case"KEY_TAG":return 14;case"DEVICEID":return 26946;case"OPTION_65535":return 65535}let n=r.match(/_(\d+)$/);if(n)return parseInt(n[1],10);return-1}});var cj=nr((mj,Lc)=>{var ij=function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.decode=w,r.encode=v,r.familyOf=S,r.name=void 0,r.sizeOf=A,r.v6=r.v4=void 0;let n=/^(\d{1,3}\.){3,3}\d{1,3}$/,i=4,m=/^(::)?(((\d{1,3}\.){3}(\d{1,3}){1})?([0-9a-f]){0,4}:{0,2}){1,8}(::)?$/i,c=16,l={name:"v4",size:i,isFormat:(N)=>n.test(N),encode(N,E,Q){Q=~~Q,E=E||new Uint8Array(Q+i);let W=N.length,H=0;for(let X=0;X<W;){let K=N.charCodeAt(X++);if(K===46)E[Q++]=H,H=0;else H=H*10+(K-48)}return E[Q]=H,E},decode(N,E){return E=~~E,`${N[E++]}.${N[E++]}.${N[E++]}.${N[E]}`}};r.v4=l;let y={name:"v6",size:c,isFormat:(N)=>N.length>0&&m.test(N),encode(N,E,Q){Q=~~Q;let W=Q+c,H=-1,X=0,K=0,J=!0,q=!1;E=E||new Uint8Array(Q+c);for(let z=0;z<N.length;z++){let L=N.charCodeAt(z);if(L===58){if(J){if(H!==-1){if(Q<W)E[Q]=0;if(Q<W-1)E[Q+1]=0;Q+=2}else if(Q<W)H=Q}else{if(q===!0){if(Q<W)E[Q]=K;Q++}else{if(Q<W)E[Q]=X>>8;if(Q<W-1)E[Q+1]=X&255;Q+=2}X=0,K=0}J=!0,q=!1}else if(L===46){if(Q<W)E[Q]=K;Q++,K=0,X=0,J=!1,q=!0}else{if(J=!1,L>=97)L-=87;else if(L>=65)L-=55;else L-=48,K=K*10+L;X=(X<<4)+L}}if(J===!1)if(q===!0){if(Q<W)E[Q]=K;Q++}else{if(Q<W)E[Q]=X>>8;if(Q<W-1)E[Q+1]=X&255;Q+=2}else if(H===0){if(Q<W)E[Q]=0;if(Q<W-1)E[Q+1]=0;Q+=2}else if(H!==-1){Q+=2;for(let z=Math.min(Q-1,W-1);z>=H+2;z--)E[z]=E[z-2];E[H]=0,E[H+1]=0,H=Q}if(H!==Q&&H!==-1){if(Q>W-2)Q=W-2;while(W>H)E[--W]=Q<W&&Q>H?E[--Q]:0}else while(Q<W)E[Q++]=0;return E},decode(N,E){E=~~E;let Q="";for(let W=0;W<c;W+=2){if(W!==0)Q+=":";Q+=(N[E+W]<<8|N[E+W+1]).toString(16)}return Q.replace(/(^|:)0(:0)*:0(:|$)/,"$1::$3").replace(/:{3,4}/,"::")}};r.v6=y;let j="ip";r.name=j;function A(N){if(l.isFormat(N))return l.size;if(y.isFormat(N))return y.size;throw Error(`Invalid ip address: ${N}`)}function S(N){return A(N)===l.size?1:2}function v(N,E,Q){Q=~~Q;let W=A(N);if(typeof E==="function")E=E(Q+W);if(W===l.size)return l.encode(N,E,Q);return y.encode(N,E,Q)}function w(N,E,Q){if(E=~~E,Q=Q||N.length-E,Q===l.size)return l.decode(N,E,Q);if(Q===y.size)return y.decode(N,E,Q);throw Error(`Invalid buffer size needs to be ${l.size} for v4 or ${y.size} for v6.`)}return"default"in r?r.default:r}({});if(typeof define==="function"&&define.amd)define([],function(){return ij});else if(typeof Lc==="object"&&typeof mj==="object")Lc.exports=ij});var lj=nr((YS)=>{var Y=sn("buffer").Buffer,Cn=ey(),KS=sy(),HS=fy(),dm=rj(),gc=nj(),ri=cj(),R=YS.name={};R.encode=function(r,n,i,{mail:m=!1}={}){if(!n)n=Y.alloc(R.encodingLength(r));if(!i)i=0;let c=i,l=r.replace(/^\.|\.$/gm,"");if(l.length){let y=[];if(m){let j="";l.split(".").forEach((A)=>{if(A.endsWith("\\"))j+=(j.length?".":"")+A.slice(0,-1);else if(y.length===0&&j.length)y.push(j+"."+A);else y.push(A)})}else y=l.split(".");for(let j=0;j<y.length;j++){let A=n.write(y[j],i+1);n[i]=A,i+=A+1}}return n[i++]=0,R.encode.bytes=i-c,n};R.encode.bytes=0;R.decode=function(r,n,{mail:i=!1}={}){if(!n)n=0;let m=[],c=n,l=0,y=0,j=!1;while(!0){if(n>=r.length)throw Error("Cannot decode name (buffer overflow)");let A=r[n++];if(y+=j?0:1,A===0)break;else if((A&192)===0){if(n+A>r.length)throw Error("Cannot decode name (buffer overflow)");if(l+=A+1,l>254)throw Error("Cannot decode name (name too long)");let S=r.toString("utf-8",n,n+A);if(i)S=S.replace(/\./g,"\\.");m.push(S),n+=A,y+=j?0:A}else if((A&192)===192){if(n+1>r.length)throw Error("Cannot decode name (buffer overflow)");let S=r.readUInt16BE(n-1)-49152;if(S>=c)throw Error("Cannot decode name (bad pointer)");n=S,c=S,y+=j?0:1,j=!0}else throw Error("Cannot decode name (bad label)")}return R.decode.bytes=y,m.length===0?".":m.join(".")};R.decode.bytes=0;R.encodingLength=function(r){if(r==="."||r==="..")return 1;return Y.byteLength(r.replace(/^\.|\.$/gm,""))+2};var O={};O.encode=function(r,n,i){if(!n)n=Y.alloc(O.encodingLength(r));if(!i)i=0;let m=n.write(r,i+1);return n[i]=m,O.encode.bytes=m+1,n};O.encode.bytes=0;O.decode=function(r,n){if(!n)n=0;let i=r[n],m=r.toString("utf-8",n+1,n+1+i);return O.decode.bytes=i+1,m};O.decode.bytes=0;O.encodingLength=function(r){return Y.byteLength(r)+1};var ur={};ur.encode=function(r,n,i){if(!n)n=ur.encodingLength(r);if(!i)i=0;let m=(r.flags||0)&32767,c=r.type==="response"?32768:0;return n.writeUInt16BE(r.id||0,i),n.writeUInt16BE(m|c,i+2),n.writeUInt16BE(r.questions.length,i+4),n.writeUInt16BE(r.answers.length,i+6),n.writeUInt16BE(r.authorities.length,i+8),n.writeUInt16BE(r.additionals.length,i+10),n};ur.encode.bytes=12;ur.decode=function(r,n){if(!n)n=0;if(r.length<12)throw Error("Header must be 12 bytes");let i=r.readUInt16BE(n+2);return{id:r.readUInt16BE(n),type:i&32768?"response":"query",flags:i&32767,flag_qr:(i>>15&1)===1,opcode:HS.toString(i>>11&15),flag_aa:(i>>10&1)===1,flag_tc:(i>>9&1)===1,flag_rd:(i>>8&1)===1,flag_ra:(i>>7&1)===1,flag_z:(i>>6&1)===1,flag_ad:(i>>5&1)===1,flag_cd:(i>>4&1)===1,rcode:KS.toString(i&15),questions:Array(r.readUInt16BE(n+4)),answers:Array(r.readUInt16BE(n+6)),authorities:Array(r.readUInt16BE(n+8)),additionals:Array(r.readUInt16BE(n+10))}};ur.decode.bytes=12;ur.encodingLength=function(){return 12};var wn=YS.unknown={};wn.encode=function(r,n,i){if(!n)n=Y.alloc(wn.encodingLength(r));if(!i)i=0;return n.writeUInt16BE(r.length,i),r.copy(n,i+2),wn.encode.bytes=r.length+2,n};wn.encode.bytes=0;wn.decode=function(r,n){if(!n)n=0;let i=r.readUInt16BE(n),m=r.slice(n+2,n+2+i);return wn.decode.bytes=i+2,m};wn.decode.bytes=0;wn.encodingLength=function(r){return r.length+2};var $n=YS.ns={};$n.encode=function(r,n,i){if(!n)n=Y.alloc($n.encodingLength(r));if(!i)i=0;return R.encode(r,n,i+2),n.writeUInt16BE(R.encode.bytes,i),$n.encode.bytes=R.encode.bytes+2,n};$n.encode.bytes=0;$n.decode=function(r,n){if(!n)n=0;let i=r.readUInt16BE(n),m=R.decode(r,n+2);return $n.decode.bytes=i+2,m};$n.decode.bytes=0;$n.encodingLength=function(r){return R.encodingLength(r)+2};var Gn=YS.soa={};Gn.encode=function(r,n,i){if(!n)n=Y.alloc(Gn.encodingLength(r));if(!i)i=0;let m=i;return i+=2,R.encode(r.mname,n,i),i+=R.encode.bytes,R.encode(r.rname,n,i,{mail:!0}),i+=R.encode.bytes,n.writeUInt32BE(r.serial||0,i),i+=4,n.writeUInt32BE(r.refresh||0,i),i+=4,n.writeUInt32BE(r.retry||0,i),i+=4,n.writeUInt32BE(r.expire||0,i),i+=4,n.writeUInt32BE(r.minimum||0,i),i+=4,n.writeUInt16BE(i-m-2,m),Gn.encode.bytes=i-m,n};Gn.encode.bytes=0;Gn.decode=function(r,n){if(!n)n=0;let i=n,m={};return n+=2,m.mname=R.decode(r,n),n+=R.decode.bytes,m.rname=R.decode(r,n,{mail:!0}),n+=R.decode.bytes,m.serial=r.readUInt32BE(n),n+=4,m.refresh=r.readUInt32BE(n),n+=4,m.retry=r.readUInt32BE(n),n+=4,m.expire=r.readUInt32BE(n),n+=4,m.minimum=r.readUInt32BE(n),n+=4,Gn.decode.bytes=n-i,m};Gn.decode.bytes=0;Gn.encodingLength=function(r){return 22+R.encodingLength(r.mname)+R.encodingLength(r.rname)};var Nn=YS.txt={};Nn.encode=function(r,n,i){if(!Array.isArray(r))r=[r];for(let c=0;c<r.length;c++){if(typeof r[c]==="string")r[c]=Y.from(r[c]);if(!Y.isBuffer(r[c]))throw Error("Must be a Buffer")}if(!n)n=Y.alloc(Nn.encodingLength(r));if(!i)i=0;let m=i;return i+=2,r.forEach(function(c){n[i++]=c.length,c.copy(n,i,0,c.length),i+=c.length}),n.writeUInt16BE(i-m-2,m),Nn.encode.bytes=i-m,n};Nn.encode.bytes=0;Nn.decode=function(r,n){if(!n)n=0;let i=n,m=r.readUInt16BE(n);n+=2;let c=[];while(m>0){let l=r[n++];if(--m,m<l)throw Error("Buffer overflow");c.push(r.slice(n,n+l)),n+=l,m-=l}return Nn.decode.bytes=n-i,c};Nn.decode.bytes=0;Nn.encodingLength=function(r){if(!Array.isArray(r))r=[r];let n=2;return r.forEach(function(i){if(typeof i==="string")n+=Y.byteLength(i)+1;else n+=i.length+1}),n};var En=YS.null={};En.encode=function(r,n,i){if(!n)n=Y.alloc(En.encodingLength(r));if(!i)i=0;if(typeof r==="string")r=Y.from(r);if(!r)r=Y.alloc(0);let m=i;i+=2;let c=r.length;return r.copy(n,i,0,c),i+=c,n.writeUInt16BE(i-m-2,m),En.encode.bytes=i-m,n};En.encode.bytes=0;En.decode=function(r,n){if(!n)n=0;let i=n,m=r.readUInt16BE(n);n+=2;let c=r.slice(n,n+m);return n+=m,En.decode.bytes=n-i,c};En.decode.bytes=0;En.encodingLength=function(r){if(!r)return 2;return(Y.isBuffer(r)?r.length:Y.byteLength(r))+2};var Qn=YS.hinfo={};Qn.encode=function(r,n,i){if(!n)n=Y.alloc(Qn.encodingLength(r));if(!i)i=0;let m=i;return i+=2,O.encode(r.cpu,n,i),i+=O.encode.bytes,O.encode(r.os,n,i),i+=O.encode.bytes,n.writeUInt16BE(i-m-2,m),Qn.encode.bytes=i-m,n};Qn.encode.bytes=0;Qn.decode=function(r,n){if(!n)n=0;let i=n,m={};return n+=2,m.cpu=O.decode(r,n),n+=O.decode.bytes,m.os=O.decode(r,n),n+=O.decode.bytes,Qn.decode.bytes=n-i,m};Qn.decode.bytes=0;Qn.encodingLength=function(r){return O.encodingLength(r.cpu)+O.encodingLength(r.os)+2};var pr=YS.ptr={},RS=YS.cname=pr,VS=YS.dname=pr;pr.encode=function(r,n,i){if(!n)n=Y.alloc(pr.encodingLength(r));if(!i)i=0;return R.encode(r,n,i+2),n.writeUInt16BE(R.encode.bytes,i),pr.encode.bytes=R.encode.bytes+2,n};pr.encode.bytes=0;pr.decode=function(r,n){if(!n)n=0;let i=R.decode(r,n+2);return pr.decode.bytes=R.decode.bytes+2,i};pr.decode.bytes=0;pr.encodingLength=function(r){return R.encodingLength(r)+2};var Dn=YS.srv={};Dn.encode=function(r,n,i){if(!n)n=Y.alloc(Dn.encodingLength(r));if(!i)i=0;n.writeUInt16BE(r.priority||0,i+2),n.writeUInt16BE(r.weight||0,i+4),n.writeUInt16BE(r.port||0,i+6),R.encode(r.target,n,i+8);let m=R.encode.bytes+6;return n.writeUInt16BE(m,i),Dn.encode.bytes=m+2,n};Dn.encode.bytes=0;Dn.decode=function(r,n){if(!n)n=0;let i=r.readUInt16BE(n),m={};return m.priority=r.readUInt16BE(n+2),m.weight=r.readUInt16BE(n+4),m.port=r.readUInt16BE(n+6),m.target=R.decode(r,n+8),Dn.decode.bytes=i+2,m};Dn.decode.bytes=0;Dn.encodingLength=function(r){return 8+R.encodingLength(r.target)};var Zr=YS.caa={};Zr.ISSUER_CRITICAL=128;Zr.encode=function(r,n,i){let m=Zr.encodingLength(r);if(!n)n=Y.alloc(Zr.encodingLength(r));if(!i)i=0;if(r.issuerCritical)r.flags=Zr.ISSUER_CRITICAL;return n.writeUInt16BE(m-2,i),i+=2,n.writeUInt8(r.flags||0,i),i+=1,O.encode(r.tag,n,i),i+=O.encode.bytes,n.write(r.value,i),i+=Y.byteLength(r.value),Zr.encode.bytes=m,n};Zr.encode.bytes=0;Zr.decode=function(r,n){if(!n)n=0;let i=r.readUInt16BE(n);n+=2;let m=n,c={};return c.flags=r.readUInt8(n),n+=1,c.tag=O.decode(r,n),n+=O.decode.bytes,c.value=r.toString("utf-8",n,m+i),c.issuerCritical=!!(c.flags&Zr.ISSUER_CRITICAL),Zr.decode.bytes=i+2,c};Zr.decode.bytes=0;Zr.encodingLength=function(r){return O.encodingLength(r.tag)+O.encodingLength(r.value)+2};var Ln=YS.mx={};Ln.encode=function(r,n,i){if(!n)n=Y.alloc(Ln.encodingLength(r));if(!i)i=0;let m=i;return i+=2,n.writeUInt16BE(r.preference||0,i),i+=2,R.encode(r.exchange,n,i),i+=R.encode.bytes,n.writeUInt16BE(i-m-2,m),Ln.encode.bytes=i-m,n};Ln.encode.bytes=0;Ln.decode=function(r,n){if(!n)n=0;let i=n,m={};return n+=2,m.preference=r.readUInt16BE(n),n+=2,m.exchange=R.decode(r,n),n+=R.decode.bytes,Ln.decode.bytes=n-i,m};Ln.encodingLength=function(r){return 4+R.encodingLength(r.exchange)};var Un=YS.a={};Un.encode=function(r,n,i){if(!n)n=Y.alloc(Un.encodingLength(r));if(!i)i=0;return n.writeUInt16BE(4,i),i+=2,ri.v4.encode(r,n,i),Un.encode.bytes=6,n};Un.encode.bytes=0;Un.decode=function(r,n){if(!n)n=0;n+=2;let i=ri.v4.decode(r,n);return Un.decode.bytes=6,i};Un.decode.bytes=0;Un.encodingLength=function(){return 6};var Pn=YS.aaaa={};Pn.encode=function(r,n,i){if(!n)n=Y.alloc(Pn.encodingLength(r));if(!i)i=0;return n.writeUInt16BE(16,i),i+=2,ri.v6.encode(r,n,i),Pn.encode.bytes=18,n};Pn.encode.bytes=0;Pn.decode=function(r,n){if(!n)n=0;n+=2;let i=ri.v6.decode(r,n);return Pn.decode.bytes=18,i};Pn.decode.bytes=0;Pn.encodingLength=function(){return 18};var Kr=YS.option={};Kr.encode=function(r,n,i){if(!n)n=Y.alloc(Kr.encodingLength(r));if(!i)i=0;let m=i,c=gc.toCode(r.code);if(n.writeUInt16BE(c,i),i+=2,r.data)n.writeUInt16BE(r.data.length,i),i+=2,r.data.copy(n,i),i+=r.data.length;else switch(c){case 8:let l=r.sourcePrefixLength||0,y=r.family||ri.familyOf(r.ip),j=ri.encode(r.ip,Y.alloc),A=Math.ceil(l/8);n.writeUInt16BE(A+4,i),i+=2,n.writeUInt16BE(y,i),i+=2,n.writeUInt8(l,i++),n.writeUInt8(r.scopePrefixLength||0,i++),j.copy(n,i,0,A),i+=A;break;case 11:if(r.timeout)n.writeUInt16BE(2,i),i+=2,n.writeUInt16BE(r.timeout,i),i+=2;else n.writeUInt16BE(0,i),i+=2;break;case 12:let S=r.length||0;n.writeUInt16BE(S,i),i+=2,n.fill(0,i,i+S),i+=S;break;case 14:let v=r.tags.length*2;n.writeUInt16BE(v,i),i+=2;for(let w of r.tags)n.writeUInt16BE(w,i),i+=2;break;default:throw Error(`Unknown roption code: ${r.code}`)}return Kr.encode.bytes=i-m,n};Kr.encode.bytes=0;Kr.decode=function(r,n){if(!n)n=0;let i={};i.code=r.readUInt16BE(n),i.type=gc.toString(i.code),n+=2;let m=r.readUInt16BE(n);switch(n+=2,i.data=r.slice(n,n+m),i.code){case 8:i.family=r.readUInt16BE(n),n+=2,i.sourcePrefixLength=r.readUInt8(n++),i.scopePrefixLength=r.readUInt8(n++);let c=Y.alloc(i.family===1?4:16);r.copy(c,0,n,n+m-4),i.ip=ri.decode(c);break;case 11:if(m>0)i.timeout=r.readUInt16BE(n),n+=2;break;case 14:i.tags=[];for(let l=0;l<m;l+=2)i.tags.push(r.readUInt16BE(n)),n+=2}return Kr.decode.bytes=m+4,i};Kr.decode.bytes=0;Kr.encodingLength=function(r){if(r.data)return r.data.length+4;switch(gc.toCode(r.code)){case 8:let i=r.sourcePrefixLength||0;return Math.ceil(i/8)+8;case 11:return typeof r.timeout==="number"?6:4;case 12:return r.length+4;case 14:return 4+r.tags.length*2}throw Error(`Unknown roption code: ${r.code}`)};var Or=YS.opt={};Or.encode=function(r,n,i){if(!n)n=Y.alloc(Or.encodingLength(r));if(!i)i=0;let m=i,c=Gi(r,Kr);return n.writeUInt16BE(c,i),i=pi(r,Kr,n,i+2),Or.encode.bytes=i-m,n};Or.encode.bytes=0;Or.decode=function(r,n){if(!n)n=0;let i=n,m=[],c=r.readUInt16BE(n);n+=2;let l=0;while(c>0)m[l++]=Kr.decode(r,n),n+=Kr.decode.bytes,c-=Kr.decode.bytes;return Or.decode.bytes=n-i,m};Or.decode.bytes=0;Or.encodingLength=function(r){return 2+Gi(r||[],Kr)};var Ur=YS.dnskey={};Ur.PROTOCOL_DNSSEC=3;Ur.ZONE_KEY=128;Ur.SECURE_ENTRYPOINT=32768;Ur.encode=function(r,n,i){if(!n)n=Y.alloc(Ur.encodingLength(r));if(!i)i=0;let m=i,c=r.key;if(!Y.isBuffer(c))throw Error("Key must be a Buffer");return i+=2,n.writeUInt16BE(r.flags,i),i+=2,n.writeUInt8(Ur.PROTOCOL_DNSSEC,i),i+=1,n.writeUInt8(r.algorithm,i),i+=1,c.copy(n,i,0,c.length),i+=c.length,Ur.encode.bytes=i-m,n.writeUInt16BE(Ur.encode.bytes-2,m),n};Ur.encode.bytes=0;Ur.decode=function(r,n){if(!n)n=0;let i=n;var m={},c=r.readUInt16BE(n);if(n+=2,m.flags=r.readUInt16BE(n),n+=2,r.readUInt8(n)!==Ur.PROTOCOL_DNSSEC)throw Error("Protocol must be 3");return n+=1,m.algorithm=r.readUInt8(n),n+=1,m.key=r.slice(n,i+c+2),n+=m.key.length,Ur.decode.bytes=n-i,m};Ur.decode.bytes=0;Ur.encodingLength=function(r){return 6+Y.byteLength(r.key)};var sr=YS.rrsig={};sr.encode=function(r,n,i){if(!n)n=Y.alloc(sr.encodingLength(r));if(!i)i=0;let m=i,c=r.signature;if(!Y.isBuffer(c))throw Error("Signature must be a Buffer");return i+=2,n.writeUInt16BE(Cn.toType(r.typeCovered),i),i+=2,n.writeUInt8(r.algorithm,i),i+=1,n.writeUInt8(r.labels,i),i+=1,n.writeUInt32BE(r.originalTTL,i),i+=4,n.writeUInt32BE(r.expiration,i),i+=4,n.writeUInt32BE(r.inception,i),i+=4,n.writeUInt16BE(r.keyTag,i),i+=2,R.encode(r.signersName,n,i),i+=R.encode.bytes,c.copy(n,i,0,c.length),i+=c.length,sr.encode.bytes=i-m,n.writeUInt16BE(sr.encode.bytes-2,m),n};sr.encode.bytes=0;sr.decode=function(r,n){if(!n)n=0;let i=n;var m={},c=r.readUInt16BE(n);return n+=2,m.typeCovered=Cn.toString(r.readUInt16BE(n)),n+=2,m.algorithm=r.readUInt8(n),n+=1,m.labels=r.readUInt8(n),n+=1,m.originalTTL=r.readUInt32BE(n),n+=4,m.expiration=r.readUInt32BE(n),n+=4,m.inception=r.readUInt32BE(n),n+=4,m.keyTag=r.readUInt16BE(n),n+=2,m.signersName=R.decode(r,n),n+=R.decode.bytes,m.signature=r.slice(n,i+c+2),n+=m.signature.length,sr.decode.bytes=n-i,m};sr.decode.bytes=0;sr.encodingLength=function(r){return 20+R.encodingLength(r.signersName)+Y.byteLength(r.signature)};var fr=YS.rp={};fr.encode=function(r,n,i){if(!n)n=Y.alloc(fr.encodingLength(r));if(!i)i=0;let m=i;return i+=2,R.encode(r.mbox||".",n,i,{mail:!0}),i+=R.encode.bytes,R.encode(r.txt||".",n,i),i+=R.encode.bytes,fr.encode.bytes=i-m,n.writeUInt16BE(fr.encode.bytes-2,m),n};fr.encode.bytes=0;fr.decode=function(r,n){if(!n)n=0;let i=n,m={};return n+=2,m.mbox=R.decode(r,n,{mail:!0})||".",n+=R.decode.bytes,m.txt=R.decode(r,n)||".",n+=R.decode.bytes,fr.decode.bytes=n-i,m};fr.decode.bytes=0;fr.encodingLength=function(r){return 2+R.encodingLength(r.mbox||".")+R.encodingLength(r.txt||".")};var jr={};jr.encode=function(r,n,i){if(!n)n=Y.alloc(jr.encodingLength(r));if(!i)i=0;let m=i;var c=[];for(var l=0;l<r.length;l++){var y=Cn.toType(r[l]);if(c[y>>8]===void 0)c[y>>8]=[];c[y>>8][y>>3&31]|=1<<7-(y&7)}for(l=0;l<c.length;l++)if(c[l]!==void 0){var j=Y.from(c[l]);n.writeUInt8(l,i),i+=1,n.writeUInt8(j.length,i),i+=1,j.copy(n,i),i+=j.length}return jr.encode.bytes=i-m,n};jr.encode.bytes=0;jr.decode=function(r,n,i){if(!n)n=0;let m=n;var c=[];while(n-m<i){var l=r.readUInt8(n);n+=1;var y=r.readUInt8(n);n+=1;for(var j=0;j<y;j++){var A=r.readUInt8(n+j);for(var S=0;S<8;S++)if(A&1<<7-S){var v=Cn.toString(l<<8|j<<3|S);c.push(v)}}n+=y}return jr.decode.bytes=n-m,c};jr.decode.bytes=0;jr.encodingLength=function(r){var n=[];for(var i=0;i<r.length;i++){var m=Cn.toType(r[i]);n[m>>8]=Math.max(n[m>>8]||0,m&255)}var c=0;for(i=0;i<n.length;i++)if(n[i]!==void 0)c+=2+Math.ceil((n[i]+1)/8);return c};var rn=YS.nsec={};rn.encode=function(r,n,i){if(!n)n=Y.alloc(rn.encodingLength(r));if(!i)i=0;let m=i;return i+=2,R.encode(r.nextDomain,n,i),i+=R.encode.bytes,jr.encode(r.rrtypes,n,i),i+=jr.encode.bytes,rn.encode.bytes=i-m,n.writeUInt16BE(rn.encode.bytes-2,m),n};rn.encode.bytes=0;rn.decode=function(r,n){if(!n)n=0;let i=n;var m={},c=r.readUInt16BE(n);return n+=2,m.nextDomain=R.decode(r,n),n+=R.decode.bytes,m.rrtypes=jr.decode(r,n,c-(n-i)),n+=jr.decode.bytes,rn.decode.bytes=n-i,m};rn.decode.bytes=0;rn.encodingLength=function(r){return 2+R.encodingLength(r.nextDomain)+jr.encodingLength(r.rrtypes)};var nn=YS.nsec3={};nn.encode=function(r,n,i){if(!n)n=Y.alloc(nn.encodingLength(r));if(!i)i=0;let m=i,c=r.salt;if(!Y.isBuffer(c))throw Error("salt must be a Buffer");let l=r.nextDomain;if(!Y.isBuffer(l))throw Error("nextDomain must be a Buffer");return i+=2,n.writeUInt8(r.algorithm,i),i+=1,n.writeUInt8(r.flags,i),i+=1,n.writeUInt16BE(r.iterations,i),i+=2,n.writeUInt8(c.length,i),i+=1,c.copy(n,i,0,c.length),i+=c.length,n.writeUInt8(l.length,i),i+=1,l.copy(n,i,0,l.length),i+=l.length,jr.encode(r.rrtypes,n,i),i+=jr.encode.bytes,nn.encode.bytes=i-m,n.writeUInt16BE(nn.encode.bytes-2,m),n};nn.encode.bytes=0;nn.decode=function(r,n){if(!n)n=0;let i=n;var m={},c=r.readUInt16BE(n);n+=2,m.algorithm=r.readUInt8(n),n+=1,m.flags=r.readUInt8(n),n+=1,m.iterations=r.readUInt16BE(n),n+=2;let l=r.readUInt8(n);n+=1,m.salt=r.slice(n,n+l),n+=l;let y=r.readUInt8(n);return n+=1,m.nextDomain=r.slice(n,n+y),n+=y,m.rrtypes=jr.decode(r,n,c-(n-i)),n+=jr.decode.bytes,nn.decode.bytes=n-i,m};nn.decode.bytes=0;nn.encodingLength=function(r){return 8+r.salt.length+r.nextDomain.length+jr.encodingLength(r.rrtypes)};var mn=YS.ds={};mn.encode=function(r,n,i){if(!n)n=Y.alloc(mn.encodingLength(r));if(!i)i=0;let m=i,c=r.digest;if(!Y.isBuffer(c))throw Error("Digest must be a Buffer");return i+=2,n.writeUInt16BE(r.keyTag,i),i+=2,n.writeUInt8(r.algorithm,i),i+=1,n.writeUInt8(r.digestType,i),i+=1,c.copy(n,i,0,c.length),i+=c.length,mn.encode.bytes=i-m,n.writeUInt16BE(mn.encode.bytes-2,m),n};mn.encode.bytes=0;mn.decode=function(r,n){if(!n)n=0;let i=n;var m={},c=r.readUInt16BE(n);return n+=2,m.keyTag=r.readUInt16BE(n),n+=2,m.algorithm=r.readUInt8(n),n+=1,m.digestType=r.readUInt8(n),n+=1,m.digest=r.slice(n,i+c+2),n+=m.digest.length,mn.decode.bytes=n-i,m};mn.decode.bytes=0;mn.encodingLength=function(r){return 6+Y.byteLength(r.digest)};var Jr=YS.sshfp={};Jr.getFingerprintLengthForHashType=function(n){switch(n){case 1:return 20;case 2:return 32}};Jr.encode=function(n,i,m){if(!i)i=Y.alloc(Jr.encodingLength(n));if(!m)m=0;let c=m;m+=2,i[m]=n.algorithm,m+=1,i[m]=n.hash,m+=1;let l=Y.from(n.fingerprint.toUpperCase(),"hex");if(l.length!==Jr.getFingerprintLengthForHashType(n.hash))throw Error("Invalid fingerprint length");return l.copy(i,m),m+=l.byteLength,Jr.encode.bytes=m-c,i.writeUInt16BE(Jr.encode.bytes-2,c),i};Jr.encode.bytes=0;Jr.decode=function(n,i){if(!i)i=0;let m=i,c={};i+=2,c.algorithm=n[i],i+=1,c.hash=n[i],i+=1;let l=Jr.getFingerprintLengthForHashType(c.hash);return c.fingerprint=n.slice(i,i+l).toString("hex").toUpperCase(),i+=l,Jr.decode.bytes=i-m,c};Jr.decode.bytes=0;Jr.encodingLength=function(r){return 4+Y.from(r.fingerprint,"hex").byteLength};var cn=YS.naptr={};cn.encode=function(r,n,i){if(!n)n=Y.alloc(cn.encodingLength(r));if(!i)i=0;let m=i;return i+=2,n.writeUInt16BE(r.order||0,i),i+=2,n.writeUInt16BE(r.preference||0,i),i+=2,O.encode(r.flags,n,i),i+=O.encode.bytes,O.encode(r.services,n,i),i+=O.encode.bytes,O.encode(r.regexp,n,i),i+=O.encode.bytes,R.encode(r.replacement,n,i),i+=R.encode.bytes,cn.encode.bytes=i-m,n.writeUInt16BE(cn.encode.bytes-2,m),n};cn.encode.bytes=0;cn.decode=function(r,n){if(!n)n=0;let i=n,m={};return n+=2,m.order=r.readUInt16BE(n),n+=2,m.preference=r.readUInt16BE(n),n+=2,m.flags=O.decode(r,n),n+=O.decode.bytes,m.services=O.decode(r,n),n+=O.decode.bytes,m.regexp=O.decode(r,n),n+=O.decode.bytes,m.replacement=R.decode(r,n),n+=R.decode.bytes,cn.decode.bytes=n-i,m};cn.decode.bytes=0;cn.encodingLength=function(r){return O.encodingLength(r.flags)+O.encodingLength(r.services)+O.encodingLength(r.regexp)+R.encodingLength(r.replacement)+6};var ln=YS.tlsa={};ln.encode=function(r,n,i){if(!n)n=Y.alloc(ln.encodingLength(r));if(!i)i=0;let m=i,c=r.certificate;if(!Y.isBuffer(c))throw Error("Certificate must be a Buffer");return i+=2,n.writeUInt8(r.usage,i),i+=1,n.writeUInt8(r.selector,i),i+=1,n.writeUInt8(r.matchingType,i),i+=1,c.copy(n,i,0,c.length),i+=c.length,ln.encode.bytes=i-m,n.writeUInt16BE(ln.encode.bytes-2,m),n};ln.encode.bytes=0;ln.decode=function(r,n){if(!n)n=0;let i=n,m={},c=r.readUInt16BE(n);return n+=2,m.usage=r.readUInt8(n),n+=1,m.selector=r.readUInt8(n),n+=1,m.matchingType=r.readUInt8(n),n+=1,m.certificate=r.slice(n,i+c+2),n+=m.certificate.length,ln.decode.bytes=n-i,m};ln.decode.bytes=0;ln.encodingLength=function(r){return 5+Y.byteLength(r.certificate)};var Fc=YS.record=function(r){switch(r.toUpperCase()){case"A":return Un;case"PTR":return pr;case"CNAME":return RS;case"DNAME":return VS;case"TXT":return Nn;case"NULL":return En;case"AAAA":return Pn;case"SRV":return Dn;case"HINFO":return Qn;case"CAA":return Zr;case"NS":return $n;case"SOA":return Gn;case"MX":return Ln;case"OPT":return Or;case"DNSKEY":return Ur;case"RRSIG":return sr;case"RP":return fr;case"NSEC":return rn;case"NSEC3":return nn;case"SSHFP":return Jr;case"DS":return mn;case"NAPTR":return cn;case"TLSA":return ln}return wn},vr=YS.answer={};vr.encode=function(r,n,i){if(!n)n=Y.alloc(vr.encodingLength(r));if(!i)i=0;let m=i;if(R.encode(r.name,n,i),i+=R.encode.bytes,n.writeUInt16BE(Cn.toType(r.type),i),r.type.toUpperCase()==="OPT"){if(r.name!==".")throw Error("OPT name must be root.");n.writeUInt16BE(r.udpPayloadSize||4096,i+2),n.writeUInt8(r.extendedRcode||0,i+4),n.writeUInt8(r.ednsVersion||0,i+5),n.writeUInt16BE(r.flags||0,i+6),i+=8,Or.encode(r.options||[],n,i),i+=Or.encode.bytes}else{let c=dm.toClass(r.class===void 0?"IN":r.class);if(r.flush)c|=32768;n.writeUInt16BE(c,i+2),n.writeUInt32BE(r.ttl||0,i+4),i+=8;let l=Fc(r.type);l.encode(r.data,n,i),i+=l.encode.bytes}return vr.encode.bytes=i-m,n};vr.encode.bytes=0;vr.decode=function(r,n){if(!n)n=0;let i={},m=n;if(i.name=R.decode(r,n),n+=R.decode.bytes,i.type=Cn.toString(r.readUInt16BE(n)),i.type==="OPT")i.udpPayloadSize=r.readUInt16BE(n+2),i.extendedRcode=r.readUInt8(n+4),i.ednsVersion=r.readUInt8(n+5),i.flags=r.readUInt16BE(n+6),i.flag_do=(i.flags>>15&1)===1,i.options=Or.decode(r,n+8),n+=8+Or.decode.bytes;else{let c=r.readUInt16BE(n+2);i.ttl=r.readUInt32BE(n+4),i.class=dm.toString(c&-32769),i.flush=!!(c&32768);let l=Fc(i.type);i.data=l.decode(r,n+8),n+=8+l.decode.bytes}return vr.decode.bytes=n-m,i};vr.decode.bytes=0;vr.encodingLength=function(r){let n=r.data!==null&&r.data!==void 0?r.data:r.options;return R.encodingLength(r.name)+8+Fc(r.type).encodingLength(n)};var ar=YS.question={};ar.encode=function(r,n,i){if(!n)n=Y.alloc(ar.encodingLength(r));if(!i)i=0;let m=i;return R.encode(r.name,n,i),i+=R.encode.bytes,n.writeUInt16BE(Cn.toType(r.type),i),i+=2,n.writeUInt16BE(dm.toClass(r.class===void 0?"IN":r.class),i),i+=2,ar.encode.bytes=i-m,r};ar.encode.bytes=0;ar.decode=function(r,n){if(!n)n=0;let i=n,m={};if(m.name=R.decode(r,n),n+=R.decode.bytes,m.type=Cn.toString(r.readUInt16BE(n)),n+=2,m.class=dm.toString(r.readUInt16BE(n)),n+=2,!!(m.class&32768))m.class&=-32769;return ar.decode.bytes=n-i,m};ar.decode.bytes=0;ar.encodingLength=function(r){return R.encodingLength(r.name)+4};YS.AUTHORITATIVE_ANSWER=1024;YS.TRUNCATED_RESPONSE=512;YS.RECURSION_DESIRED=256;YS.RECURSION_AVAILABLE=128;YS.AUTHENTIC_DATA=32;YS.CHECKING_DISABLED=16;YS.DNSSEC_OK=32768;YS.encode=function(r,n,i){let m=!n;if(m)n=Y.alloc(YS.encodingLength(r));if(!i)i=0;let c=i;if(!r.questions)r.questions=[];if(!r.answers)r.answers=[];if(!r.authorities)r.authorities=[];if(!r.additionals)r.additionals=[];if(ur.encode(r,n,i),i+=ur.encode.bytes,i=pi(r.questions,ar,n,i),i=pi(r.answers,vr,n,i),i=pi(r.authorities,vr,n,i),i=pi(r.additionals,vr,n,i),YS.encode.bytes=i-c,m&&YS.encode.bytes!==n.length)return n.slice(0,YS.encode.bytes);return n};YS.encode.bytes=0;YS.decode=function(r,n){if(!n)n=0;let i=n,m=ur.decode(r,n);return n+=ur.decode.bytes,n=um(m.questions,ar,r,n),n=um(m.answers,vr,r,n),n=um(m.authorities,vr,r,n),n=um(m.additionals,vr,r,n),YS.decode.bytes=n-i,m};YS.decode.bytes=0;YS.encodingLength=function(r){return ur.encodingLength(r)+Gi(r.questions||[],ar)+Gi(r.answers||[],vr)+Gi(r.authorities||[],vr)+Gi(r.additionals||[],vr)};YS.streamEncode=function(r){let n=YS.encode(r),i=Y.alloc(2);i.writeUInt16BE(n.byteLength);let m=Y.concat([i,n]);return YS.streamEncode.bytes=m.byteLength,m};YS.streamEncode.bytes=0;YS.streamDecode=function(r){let n=r.readUInt16BE(0);if(r.byteLength<n+2)return null;let i=YS.decode(r.slice(2));return YS.streamDecode.bytes=YS.decode.bytes,i};YS.streamDecode.bytes=0;function Gi(r,n){let i=0;for(let m=0;m<r.length;m++)i+=n.encodingLength(r[m]);return i}function pi(r,n,i,m){for(let c=0;c<r.length;c++)n.encode(r[c],i,m),m+=n.encode.bytes;return m}function um(r,n,i,m){for(let c=0;c<r.length;c++)r[c]=n.decode(i,m),m+=n.decode.bytes;return m}});var Ij=nr((nD,jj)=>{var yj=BS;process.nextTick(hS,42);jj.exports=zS;function zS(r){var n=m;return i;function i(c){n(c||MS)}function m(c){var l=[c];n=y,r(j);function y(A){l.push(A)}function j(A){var S=arguments;n=oS(A)?m:v;while(l.length)v(l.shift());function v(w){yj(TS,w,S)}}}}function oS(r){return Object.prototype.toString.call(r)==="[object Error]"}function MS(){}function TS(r,n){r.apply(null,n)}function hS(r){if(r===42)yj=process.nextTick}function BS(r,n,i){process.nextTick(function(){r(n,i)})}});var vj=nr((iD,Sj)=>{var zc=lj(),xS=sn("dgram"),kS=Ij(),pS=sn("events"),Mc=sn("os"),oc=function(){};Sj.exports=function(r){if(!r)r={};var n=new pS.EventEmitter,i=typeof r.port==="number"?r.port:5353,m=r.type||"udp4",c=r.ip||r.host||(m==="udp4"?"224.0.0.251":null),l={address:c,port:i},y={},j=!1,A=null;if(m==="udp6"&&(!c||!r.interface))throw Error("For IPv6 multicast you must specify `ip` and `interface`");var S=r.socket||xS.createSocket({type:m,reuseAddr:r.reuseAddr!==!1,toString:function(){return m}});S.on("error",function(w){if(w.code==="EACCES"||w.code==="EADDRINUSE")n.emit("error",w);else n.emit("warning",w)}),S.on("message",function(w,N){try{w=zc.decode(w)}catch(E){n.emit("warning",E);return}if(n.emit("packet",w,N),w.type==="query")n.emit("query",w,N);if(w.type==="response")n.emit("response",w,N)}),S.on("listening",function(){if(!i)i=l.port=S.address().port;if(r.multicast!==!1)n.update(),A=setInterval(n.update,5000),S.setMulticastTTL(r.ttl||255),S.setMulticastLoopback(r.loopback!==!1)});var v=kS(function(w){if(!i||r.bind===!1)return w(null);S.once("error",w),S.bind(i,r.bind||r.interface,function(){S.removeListener("error",w),w(null)})});return v(function(w){if(w)return n.emit("error",w);n.emit("ready")}),n.send=function(w,N,E){if(typeof N==="function")return n.send(w,null,N);if(!E)E=oc;if(!N)N=l;else if(!N.host&&!N.address)N.address=l.address;v(Q);function Q(W){if(j)return E();if(W)return E(W);var H=zc.encode(w);S.send(H,0,H.length,N.port,N.address||N.host,E)}},n.response=n.respond=function(w,N,E){if(Array.isArray(w))w={answers:w};w.type="response",w.flags=(w.flags||0)|zc.AUTHORITATIVE_ANSWER,n.send(w,N,E)},n.query=function(w,N,E,Q){if(typeof N==="function")return n.query(w,null,null,N);if(typeof N==="object"&&N&&N.port)return n.query(w,null,N,E);if(typeof E==="function")return n.query(w,N,null,E);if(!Q)Q=oc;if(typeof w==="string")w=[{name:w,type:N||"ANY"}];if(Array.isArray(w))w={type:"query",questions:w};w.type="query",n.send(w,E,Q)},n.destroy=function(w){if(!w)w=oc;if(j)return process.nextTick(w);j=!0,clearInterval(A);for(var N in y)try{S.dropMembership(c,N)}catch(E){}y={},S.close(w)},n.update=function(){var w=r.interface?[].concat(r.interface):uS(),N=!1;for(var E=0;E<w.length;E++){var Q=w[E];if(y[Q])continue;try{S.addMembership(c,Q),y[Q]=!0,N=!0}catch(W){n.emit("warning",W)}}if(N){if(S.setMulticastInterface)try{S.setMulticastInterface(r.interface||aS())}catch(W){n.emit("warning",W)}n.emit("networkInterface")}},n};function aS(){var r=Mc.networkInterfaces(),n=Object.keys(r);for(var i=0;i<n.length;i++){var m=r[n[i]];for(var c=0;c<m.length;c++){var l=m[c];if(Aj(l.family)&&!l.internal){if(Mc.platform()==="darwin"&&n[i]==="en0")return l.address;return"0.0.0.0"}}}return"127.0.0.1"}function uS(){var r=Mc.networkInterfaces(),n=Object.keys(r),i=[];for(var m=0;m<n.length;m++){var c=r[n[m]];for(var l=0;l<c.length;l++){var y=c[l];if(Aj(y.family)){i.push(y.address);break}}}return i}function Aj(r){return r===4||r==="IPv4"}});var $j=nr((mD,wj)=>{wj.exports=function r(n,i){if(n===i)return!0;if(n&&i&&typeof n=="object"&&typeof i=="object"){if(n.constructor!==i.constructor)return!1;var m,c,l;if(Array.isArray(n)){if(m=n.length,m!=i.length)return!1;for(c=m;c--!==0;)if(!r(n[c],i[c]))return!1;return!0}if(n instanceof Map&&i instanceof Map){if(n.size!==i.size)return!1;for(c of n.entries())if(!i.has(c[0]))return!1;for(c of n.entries())if(!r(c[1],i.get(c[0])))return!1;return!0}if(n instanceof Set&&i instanceof Set){if(n.size!==i.size)return!1;for(c of n.entries())if(!i.has(c[0]))return!1;return!0}if(ArrayBuffer.isView(n)&&ArrayBuffer.isView(i)){if(m=n.length,m!=i.length)return!1;for(c=m;c--!==0;)if(n[c]!==i[c])return!1;return!0}if(n.constructor===RegExp)return n.source===i.source&&n.flags===i.flags;if(n.valueOf!==Object.prototype.valueOf)return n.valueOf()===i.valueOf();if(n.toString!==Object.prototype.toString)return n.toString()===i.toString();if(l=Object.keys(n),m=l.length,m!==Object.keys(i).length)return!1;for(c=m;c--!==0;)if(!Object.prototype.hasOwnProperty.call(i,l[c]))return!1;for(c=m;c--!==0;){var y=l[c];if(!r(n[y],i[y]))return!1}return!0}return n!==n&&i!==i}});var Gj=nr((ni)=>{var Tc=ni&&ni.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ni,"__esModule",{value:!0});ni.Server=void 0;var dS=Tc(vj()),tS=Tc($j()),bS=Tc(pm());class hc{constructor(r,n){this.registry={},this.mdns=(0,dS.default)(r),this.mdns.setMaxListeners(0),this.mdns.on("query",this.respondToQuery.bind(this)),this.errorCallback=n!==null&&n!==void 0?n:function(i){throw i}}register(r){let n=(i)=>{var m=this.registry[i.type];if(!m)m=this.registry[i.type]=[];else if(m.some(this.isDuplicateRecord(i)))return;m.push(i)};if(Array.isArray(r))r.forEach(n);else n(r)}unregister(r){let n=(i)=>{let m=i.type;if(!(m in this.registry))return;this.registry[m]=this.registry[m].filter((c)=>c.name!==i.name)};if(Array.isArray(r))r.forEach(n);else n(r)}respondToQuery(r){let n=this;r.questions.forEach((i)=>{var{type:m,name:c}=i,l=m==="ANY"?Object.keys(n.registry).map(n.recordsFor.bind(n,c)).flat(1):n.recordsFor(c,m);if(l.length===0)return;var y=[];if(m!=="ANY")l.forEach((j)=>{if(j.type!=="PTR")return;y=y.concat(n.recordsFor(j.data,"SRV")).concat(n.recordsFor(j.data,"TXT"))}),y.filter(function(j){return j.type==="SRV"}).map(function(j){return j.data.target}).filter(this.unique()).forEach(function(j){y=y.concat(n.recordsFor(j,"A")).concat(n.recordsFor(j,"AAAA"))});n.mdns.respond({answers:l,additionals:y},(j)=>{if(j)this.errorCallback(j)})})}recordsFor(r,n){if(!(n in this.registry))return[];return this.registry[n].filter((i)=>{var m=~r.indexOf(".")?i.name:i.name.split(".")[0];return(0,bS.default)(m,r)})}isDuplicateRecord(r){return(n)=>{return r.type===n.type&&r.name===n.name&&(0,tS.default)(r.data,n.data)}}unique(){var r=[];return(n)=>{if(~r.indexOf(n))return!1;return r.push(n),!0}}}ni.Server=hc;ni.default=hc});var Ej=nr((Nj)=>{Object.defineProperty(Nj,"__esModule",{value:!0});Nj.default=(r,n)=>{if(n===void 0)return!0;let i=r.txt,m=Object.entries(n).map(([c,l])=>{let y=i[c];if(y===void 0)return!1;if(l!=y)return!1;return!0});if(m.length==0)return!0;if(m.includes(!1))return!1;return!0}});var Dj=nr((Qj)=>{Object.defineProperty(Qj,"__esModule",{value:!0});Qj.default=(r)=>Object.keys(r).filter((n)=>!n.includes("binary")).reduce((n,i)=>{return Object.assign(n,{[i]:r[i]})},{})});var Pj=nr((Uj)=>{Object.defineProperty(Uj,"__esModule",{value:!0});Uj.default=fS;function fS(r,n){if(r===void 0||n===void 0)return!1;let i=Object.keys(r),m=Object.keys(n);if(i.length!=m.length)return!1;for(let c of i)if(r[c]!=n[c])return!1;return!0}});var Xj=nr((ii)=>{var ui=ii&&ii.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ii,"__esModule",{value:!0});ii.Browser=void 0;var nv=ui(Rc()),qn=ui(pm()),iv=sn("events"),Bc=Vc(),Cj=ui(Ej()),mv=ui(Dj()),cv=ui(Pj()),Wj=".local",lv="_services._dns-sd._udp"+Wj;class tm extends iv.EventEmitter{constructor(r,n,i){super();if(this.onresponse=void 0,this.serviceMap={},this.wildcard=!1,this._services=[],typeof n==="function")return new tm(r,null,n);if(this.mdns=r,this.txt=new nv.default(n!==null&&n.txt!=null?n.txt:void 0),n===null||n.type===void 0)this.name=lv,this.wildcard=!0;else{if(this.name=(0,Bc.toString)({name:n.type,protocol:n.protocol||"tcp"})+Wj,n.name)this.name=n.name+"."+this.name;this.wildcard=!1}if(n!=null&&n.txt!==void 0)this.txtQuery=(0,mv.default)(n.txt);if(i)this.on("up",i);this.start()}start(){if(this.onresponse||this.name===void 0)return;var r=this,n={};if(!this.wildcard)n[this.name]=!0;this.onresponse=(i,m)=>{if(r.wildcard)i.answers.forEach((c)=>{if(c.type!=="PTR"||c.name!==r.name||c.name in n)return;n[c.data]=!0,r.mdns.query(c.data,"PTR")});Object.keys(n).forEach(function(c){r.goodbyes(c,i).forEach(r.removeService.bind(r));var l=r.buildServicesFor(c,i,r.txt,m);if(l.length===0)return;l.forEach((y)=>{if(r.serviceMap[y.fqdn]){r.updateService(y);return}r.addService(y)})})},this.mdns.on("response",this.onresponse),this.update()}stop(){if(!this.onresponse)return;this.mdns.removeListener("response",this.onresponse),this.onresponse=void 0}update(){this.mdns.query(this.name,"PTR")}get services(){return this._services}addService(r){if((0,Cj.default)(r,this.txtQuery)===!1)return;this._services.push(r),this.serviceMap[r.fqdn]=!0,this.emit("up",r)}updateService(r){var n;if((0,cv.default)(r.txt,((n=this._services.find((i)=>(0,qn.default)(i.fqdn,r.fqdn)))===null||n===void 0?void 0:n.txt)||{}))return;if(!(0,Cj.default)(r,this.txtQuery)){this.removeService(r.fqdn);return}this._services=this._services.map(function(i){if(!(0,qn.default)(i.fqdn,r.fqdn))return i;return r}),this.emit("txt-update",r)}removeService(r){var n,i;if(this._services.some(function(m,c){if((0,qn.default)(m.fqdn,r))return n=m,i=c,!0}),!n||i===void 0)return;this._services.splice(i,1),delete this.serviceMap[r],this.emit("down",n)}goodbyes(r,n){return n.answers.concat(n.additionals).filter((i)=>i.type==="PTR"&&i.ttl===0&&(0,qn.default)(i.name,r)).map((i)=>i.data)}buildServicesFor(r,n,i,m){var c=n.answers.concat(n.additionals).filter((l)=>l.ttl>0);return c.filter((l)=>l.type==="PTR"&&(0,qn.default)(l.name,r)).map((l)=>{let y={addresses:[],subtypes:[]};if(c.filter((j)=>{return j.type==="PTR"&&(0,qn.default)(j.data,l.data)&&j.name.includes("._sub")}).forEach((j)=>{let A=(0,Bc.toType)(j.name);y.subtypes.push(A.subtype)}),c.filter((j)=>{return(j.type==="SRV"||j.type==="TXT")&&(0,qn.default)(j.name,l.data)}).forEach((j)=>{if(j.type==="SRV"){var A=j.name.split("."),S=A[0],v=(0,Bc.toType)(A.slice(1,-1).join("."));y.name=S,y.fqdn=j.name,y.host=j.data.target,y.referer=m,y.port=j.data.port,y.type=v.name,y.protocol=v.protocol}else if(j.type==="TXT")y.rawTxt=j.data,y.txt=this.txt.decodeAll(j.data)}),!y.name)return;return c.filter((j)=>(j.type==="A"||j.type==="AAAA")&&(0,qn.default)(j.name,y.host)).forEach((j)=>y.addresses.push(j.data)),y}).filter((l)=>!!l)}}ii.Browser=tm;ii.default=tm});var Kj=nr((dr)=>{var bm=dr&&dr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(dr,"__esModule",{value:!0});dr.Browser=dr.Service=dr.Bonjour=void 0;var yv=bm(by()),jv=bm(Gj()),xc=bm(Xj());dr.Browser=xc.default;var Iv=bm(Zc());dr.Service=Iv.default;class kc{constructor(r={},n){this.server=new jv.default(r,n),this.registry=new yv.default(this.server)}publish(r){return this.registry.publish(r)}unpublishAll(r){return this.registry.unpublishAll(r)}find(r=null,n){return new xc.default(this.server.mdns,r,n)}findOne(r=null,n=1e4,i){let m=new xc.default(this.server.mdns,r);var c;return m.once("up",(l)=>{if(c!==void 0)clearTimeout(c);if(m.stop(),i)i(l)}),c=setTimeout(()=>{if(m.stop(),i)i(null)},n),m}destroy(r){this.registry.destroy(),this.server.mdns.destroy(r)}}dr.Bonjour=kc;dr.default=kc});var bl={};Nr(bl,{url:()=>vA,openapi:()=>p$,listen:()=>a$,Server:()=>bl,Default:()=>x$});var cc=(r)=>{let n=r.split("/");if(n[0]==="")n.shift();return n},el=(r)=>{let{groups:n,path:i}=wA(r),m=cc(i);return $A(m,n)},wA=(r)=>{let n=[];return r=r.replace(/\{[^}]+\}/g,(i,m)=>{let c=`@${m}`;return n.push([c,i]),c}),{groups:n,path:r}},$A=(r,n)=>{for(let i=n.length-1;i>=0;i--){let[m]=n[i];for(let c=r.length-1;c>=0;c--)if(r[c].includes(m)){r[c]=r[c].replace(m,n[i][1]);break}}return r},gm={},sl=(r,n)=>{if(r==="*")return"*";let i=r.match(/^\:([^\{\}]+)(?:\{(.+)\})?$/);if(i){let m=`${r}#${n}`;if(!gm[m])if(i[2])gm[m]=n&&n[0]!==":"&&n[0]!=="*"?[m,i[1],new RegExp(`^${i[2]}(?=/${n})`)]:[r,i[1],new RegExp(`^${i[2]}$`)];else gm[m]=[r,i[1],!0];return gm[m]}return null},vi=(r,n)=>{try{return n(r)}catch{return r.replace(/(?:%[0-9A-Fa-f]{2})+/g,(i)=>{try{return n(i)}catch{return i}})}},fl=(r)=>vi(r,decodeURI),lc=(r)=>{let n=r.url,i=n.indexOf("/",n.indexOf(":")+4),m=i;for(;m<n.length;m++){let c=n.charCodeAt(m);if(c===37){let l=n.indexOf("?",m),y=n.indexOf("#",m),j=l===-1?y===-1?void 0:y:y===-1?l:Math.min(l,y),A=n.slice(i,j);return fl(A.includes("%25")?A.replace(/%25/g,"%2525"):A)}else if(c===63||c===35)break}return n.slice(i,m)};var ry=(r)=>{let n=lc(r);return n.length>1&&n.at(-1)==="/"?n.slice(0,-1):n},On=(r,n,...i)=>{if(i.length)n=On(n,...i);return`${r?.[0]==="/"?"":"/"}${r}${n==="/"?"":`${r?.at(-1)==="/"?"":"/"}${n?.[0]==="/"?n.slice(1):n}`}`},Fm=(r)=>{if(r.charCodeAt(r.length-1)!==63||!r.includes(":"))return null;let n=r.split("/"),i=[],m="";return n.forEach((c)=>{if(c!==""&&!/\:/.test(c))m+="/"+c;else if(/\:/.test(c))if(/\?/.test(c)){if(i.length===0&&m==="")i.push("/");else i.push(m);let l=c.replace("?","");m+="/"+l,i.push(m)}else m+="/"+c}),i.filter((c,l,y)=>y.indexOf(c)===l)},mc=(r)=>{if(!/[%+]/.test(r))return r;if(r.indexOf("+")!==-1)r=r.replace(/\+/g," ");return r.indexOf("%")!==-1?vi(r,oi):r},ny=(r,n,i)=>{let m;if(!i&&n&&!/[%+]/.test(n)){let y=r.indexOf("?",8);if(y===-1)return;if(!r.startsWith(n,y+1))y=r.indexOf(`&${n}`,y+1);while(y!==-1){let j=r.charCodeAt(y+n.length+1);if(j===61){let A=y+n.length+2,S=r.indexOf("&",A);return mc(r.slice(A,S===-1?void 0:S))}else if(j==38||isNaN(j))return"";y=r.indexOf(`&${n}`,y+1)}if(m=/[%+]/.test(r),!m)return}let c={};m??=/[%+]/.test(r);let l=r.indexOf("?",8);while(l!==-1){let y=r.indexOf("&",l+1),j=r.indexOf("=",l);if(j>y&&y!==-1)j=-1;let A=r.slice(l+1,j===-1?y===-1?void 0:y:j);if(m)A=mc(A);if(l=y,A==="")continue;let S;if(j===-1)S="";else if(S=r.slice(j+1,y===-1?void 0:y),m)S=mc(S);if(i){if(!(c[A]&&Array.isArray(c[A])))c[A]=[];c[A].push(S)}else c[A]??=S}return n?c[n]:c},iy=ny,my=(r,n)=>{return ny(r,n,!0)},oi=decodeURIComponent;var GA=/^[\w!#$%&'*.^`|~+-]+$/,NA=/^[ !#-:<-[\]-~]*$/,cy=(r)=>{let n=0,i=r.length;while(n<i){let m=r.charCodeAt(n);if(m!==32&&m!==9)break;n++}while(i>n){let m=r.charCodeAt(i-1);if(m!==32&&m!==9)break;i--}return n===0&&i===r.length?r:r.slice(n,i)},yc=(r,n)=>{if(n&&r.indexOf(n)===-1)return{};let i=r.split(";"),m=Object.create(null);for(let c of i){let l=c.indexOf("=");if(l===-1)continue;let y=cy(c.substring(0,l));if(n&&n!==y||!GA.test(y)||y in m)continue;let j=cy(c.substring(l+1));if(j.startsWith('"')&&j.endsWith('"'))j=j.slice(1,-1);if(NA.test(j)){if(m[y]=j.indexOf("%")!==-1?vi(j,oi):j,n)break}}return m};var ly=(r,n,i)=>{let m=r.req.raw.headers.get("Cookie");if(typeof n==="string"){if(!m)return;let l=n;if(i==="secure")l="__Secure-"+n;else if(i==="host")l="__Host-"+n;return yc(m,l)[l]}if(!m)return{};return yc(m)};var kr=class extends Error{res;status;constructor(r=500,n){super(n?.message,{cause:n?.cause});this.res=n?.res,this.status=r}getResponse(){if(this.res)return new Response(this.res.body,{status:this.status,headers:this.res.headers});return new Response(this.message,{status:this.status})}};var jc=async(r)=>{return await EA(r,{name:"SHA-256",alias:"sha256"})};var EA=async(r,n)=>{let i;if(ArrayBuffer.isView(r)||r instanceof ArrayBuffer)i=r;else{if(typeof r==="object")r=JSON.stringify(r);i=new TextEncoder().encode(String(r))}if(crypto&&crypto.subtle){let m=await crypto.subtle.digest({name:n.name},i);return Array.prototype.map.call(new Uint8Array(m),(l)=>("00"+l.toString(16)).slice(-2)).join("")}return null};var yy=(r,n)=>{let i=r.length,m=n.length,c=Math.max(i,m),l=i^m;for(let y=0;y<c;y++){let j=y<i?r.charCodeAt(y):0,A=y<m?n.charCodeAt(y):0;l|=j^A}return l===0},jy=async(r,n,i)=>{if(!i)i=jc;let[m,c]=await Promise.all([i(r),i(n)]);if(m==null||c==null||typeof m!=="string"||typeof c!=="string")return!1;let l=yy(m,c),y=yy(r,n);return l&&y},Ic=async(r,n,i)=>{if(typeof r==="string"&&typeof n==="string")return jy(r,n,i);if(!i)i=jc;let[m,c]=await Promise.all([i(r),i(n)]);if(!m||!c||typeof m!=="string"||typeof c!=="string")return!1;return jy(m,c)};var zm=(r,n)=>{return new Response(r,{headers:{"Content-Type":n.replace(/^[^;]+/,(m)=>m.toLowerCase())}}).formData()};var QA=/^application\/([a-z-\.]+\+)?json(;\s*[a-zA-Z0-9\-]+\=([^;]+))*$/i,DA=/^multipart\/form-data(;\s?boundary=[a-zA-Z0-9'"()+_,\-./:=?]+)?$/i,UA=/^application\/x-www-form-urlencoded(;\s*[a-zA-Z0-9\-]+\=([^;]+))*$/i,Ac=(r,n)=>{return async(i,m)=>{let c={},l=i.req.header("Content-Type");switch(r){case"json":if(!l||!QA.test(l))break;try{c=await i.req.json()}catch{throw new kr(400,{message:"Malformed JSON in request body"})}break;case"form":{if(!l||!(DA.test(l)||UA.test(l)))break;let j;if(i.req.bodyCache.formData)j=await i.req.bodyCache.formData;else try{let S=await i.req.arrayBuffer();j=await zm(S,l),i.req.bodyCache.formData=j}catch(S){let v="Malformed FormData request.";throw v+=S instanceof Error?` ${S.message}`:` ${String(S)}`,new kr(400,{message:v})}let A=Object.create(null);j.forEach((S,v)=>{if(v.endsWith("[]"))(A[v]??=[]).push(S);else if(Array.isArray(A[v]))A[v].push(S);else if(Object.hasOwn(A,v))A[v]=[A[v],S];else A[v]=S}),c=A;break}case"query":c=Object.fromEntries(Object.entries(i.req.queries()).map(([j,A])=>{return A.length===1?[j,A[0]]:[j,A]}));break;case"param":c=i.req.param();break;case"header":c=i.req.header();break;case"cookie":c=ly(i);break}let y=await n(c,i);if(y instanceof Response)return y;return i.req.addValidatedData(r,y),await m()}};var Iy={header:["cookie"]};function PA(r,n,i){if(!(i in Iy))return r;let m=Iy[i]||[];if(n==="arktype")return CA(r,m);if(n==="valibot")return WA(r,m);return r}function CA(r,n){return r.map((i)=>{if(i&&typeof i==="object"&&"data"in i&&typeof i.data==="object"&&i.data!==null&&!Array.isArray(i.data)){let m={...i.data};for(let l of n)delete m[l];let c=Object.create(Object.getPrototypeOf(i));return Object.assign(c,i,{data:m}),c}return i})}function WA(r,n){return r.map((i)=>{if(i&&typeof i==="object"&&"path"in i&&Array.isArray(i.path)){for(let m of i.path)if(typeof m==="object"&&"input"in m&&typeof m.input==="object"&&m.input!==null&&!Array.isArray(m.input))for(let c of n)delete m.input[c]}return i})}var Ay=(r,n,i)=>Ac(r,async(m,c)=>{let l=await n["~standard"].validate(m);if(i){let y=await i(l.issues?{data:m,error:l.issues,success:!1,target:r}:{data:m,success:!0,target:r},c);if(y){if(y instanceof Response)return y;if("response"in y)return y.response}}if(l.issues){let y=PA(l.issues,n["~standard"].vendor,r);return c.json({data:m,error:y,success:!1},400)}return l.value});var vc=Symbol("openapi"),KA=["GET","PUT","POST","DELETE","OPTIONS","HEAD","PATCH","TRACE"],HA=(r)=>r.split("/").map((n)=>{let i=n;if(i.startsWith(":")){let m=i.match(/^:([^{?]+)(?:{(.+)})?(\?)?$/);if(m)i=`{${m[1]}}`;else{if(i=i.slice(1,i.length),i.endsWith("?"))i=i.slice(0,-1);i=`{${i}}`}}return i}).join("/"),Sy=(r)=>r.charAt(0).toUpperCase()+r.slice(1),RA=(r)=>{let n=r.method.toLowerCase();if(r.path==="/")return`${n}Index`;for(let i of r.path.split("/"))if(i.charCodeAt(0)===123)n+=`By${Sy(i.slice(1,-1))}`;else n+=Sy(i);return n},VA=(r)=>("$ref"in r)?r.$ref:`${r.in} ${r.name}`;function vy(...r){let n=r.flatMap((i)=>i??[]).reduce((i,m)=>{return i.set(VA(m),m),i},new Map);return Array.from(n.values())}var wi=new Map;function YA(r){let n=[];for(let[i,m]of wi)if(m&&r.match(i))n.push(m);return n}function ZA(){wi.clear()}function wy(r,...n){return n.reduce((i,m)=>{if(!m||!i)return i;for(let[c,l]of Object.entries(m)){if(l==null)continue;if(c in i&&(typeof l==="object"||typeof l==="function"&&c==="operationId"))if(Array.isArray(l)){let y=[...i[c]??[],...l];if(c==="tags")i[c]=Array.from(new Set(y));else if(c==="parameters")i[c]=vy(y);else i[c]=y}else if(typeof l==="function")i[c]=l(r);else if(c==="parameters")i[c]=vy(i[c],l);else i[c]={...i[c],...l};else i[c]=l}return i},{operationId:RA(r)})}function $y({route:r,specs:n,paths:i}){let m=HA(r.path),c=r.method.toLowerCase();if(c==="all"){if(!n)return;if(wi.has(m)){let l=wi.get(m)??{};wi.set(m,wy(r,l,n))}else wi.set(m,n)}else{let l=YA(m);if(!(m in i))i[m]={};if(i[m])i[m][c]=wy(r,...l,i[m]?.[c],n)}}function JA(r,n){let{exclude:i,excludeStaticFile:m}=n.options,c={},l=Array.isArray(i)?i:[i];for(let[y,j]of Object.entries(r)){if(j==null)continue;if(l.some((v)=>{if(typeof v==="string")return y===v;return v.test(y)}))continue;if(y.includes("*")&&!y.includes("{"))continue;if(m){let v=y.includes("{"),N=(y.split("/").pop()||"").includes(".");if(!v&&N)continue}for(let v of Object.keys(j)){let w=j[v];if(w==null)continue;if(y.includes("{")){w.parameters=w.parameters?[...w.parameters]:[];let N=y.split("/").filter((E)=>E.startsWith("{")&&!w.parameters.find((Q)=>Q.in==="path"&&Q.name===E.slice(1,E.length-1)));for(let E of N){let Q=E.slice(1,E.length-1);if(w.parameters.findIndex((H)=>{if("$ref"in H){let X=H.$ref.split("/").pop();if(X){let K=n.components.parameters?.[X];if(K&&!("$ref"in K))return K.in==="path"&&K.name===Q}return!1}return H.in==="path"&&H.name===Q})===-1)w.parameters.push({schema:{type:"string"},in:"path",name:Q,required:!0})}}if(!w.responses)w.responses={200:{}}}c[y]=j}return c}var Gy={documentation:{},excludeStaticFile:!0,exclude:[],excludeMethods:["OPTIONS"],excludeTags:[]};function Qy(r,n){let i;return async(m)=>{if(i)return m.json(i);return i=await wc(r,n,m),m.json(i)}}async function wc(r,n=Gy,i){let m={components:{},options:{...Gy,...n}},c=m.options.documentation??{};ZA();let l=await OA(r,m);for(let j in l)for(let A in l[j])if(LA({valueOrFunc:l[j][A]?.hide,method:A,path:j,c:i}))l[j][A]=void 0;let y=$c(c.components,m.components);return{openapi:"3.1.0",...c,tags:c.tags?.filter((j)=>!m.options.excludeTags?.includes(j?.name)),info:{title:"Hono Documentation",description:"Development documentation",version:"0.0.0",...c.info},paths:{...JA(l,m),...c.paths},components:y}}async function OA(r,n){let i={};for(let m of r.routes){let c=m.handler[vc];if(!c){if(n.options.includeEmptyPaths)$y({route:m,paths:i});continue}let l=m.method;if(l!=="ALL"){if(n.options.excludeMethods?.includes(l))continue;if(!KA.includes(l))continue}let y=n.options.defaultOptions?.[l],{schema:j,components:A={}}=await qA(c,y);n.components=$c(n.components,A),$y({route:m,specs:j,paths:i})}return i}function LA(r){let{valueOrFunc:n,c:i,method:m,path:c}=r;if(n!=null){if(typeof n==="boolean")return n;if(typeof n==="function")return n({c:i,method:m,path:c})}return!1}async function qA(r,n){if("spec"in r){let c={},l={...n,...r.spec,responses:{...n?.responses,...r.spec.responses}};if(l.responses)for(let y of Object.keys(l.responses)){let j=l.responses[y];if(!j||!("content"in j))continue;for(let A of Object.keys(j.content??{})){let S=j.content?.[A];if(!S)continue;if(S.schema&&"toOpenAPISchema"in S.schema){let v=await S.schema.toOpenAPISchema();if(S.schema=v.schema,v.components)c=$c(c,v.components)}}}return{schema:l,components:c}}let i=await r.toOpenAPISchema(),m=n??{};if(r.target==="form"||r.target==="json"){let c=r.options?.media??r.target==="json"?"application/json":"multipart/form-data";if(!m.requestBody||!("content"in m.requestBody)||!m.requestBody.content)m.requestBody={content:{[c]:{schema:i.schema}}};else m.requestBody.content[c]={schema:i.schema}}else{let c=[];if("$ref"in i.schema){let y=i.schema.$ref.split("/").pop();if(y&&i.components?.schemas?.[y]){let j=i.components.schemas[y],A=Ny(r.target,j)[0];if(!i.components.parameters)i.components.parameters={};i.components.parameters[y]=A,delete i.components.schemas[y],c.push({$ref:`#/components/parameters/${y}`})}}else c=Ny(r.target,i.schema);m.parameters=c}return{schema:m,components:i.components}}function Ny(r,n){let i=[];for(let[m,c]of Object.entries(n.properties??{})){let l={in:r==="param"?"path":r,name:m,schema:c};if(n.required?.includes(m))l.required=!0;if(l.schema&&"description"in l.schema&&l.schema.description)l.description=l.schema.description,l.schema.description=void 0;i.push(l)}return i}function $c(...r){return r.reduce((n,i,m)=>{if(i==null||m===0)return n;if(n.schemas&&Object.keys(n.schemas).length>0||i.schemas&&Object.keys(i.schemas).length>0)n.schemas={...n.schemas,...i.schemas};if(n.parameters&&Object.keys(n.parameters).length>0||i.parameters&&Object.keys(i.parameters).length>0)n.parameters={...n.parameters,...i.parameters};return n},r[0]??{})}function $(r,n){return{vendor:r["~standard"].vendor,validate:r["~standard"].validate,toJSONSchema:(i)=>Ey(r,{...n,...i}),toOpenAPISchema:(i)=>Sc(r,{...n,...i})}}function D(r,n,i,m){let c=Ay(r,n,i);return Object.assign(c,{[vc]:{target:r,...$(n,m),options:m}})}function G(r){return Object.assign(async(i,m)=>{await m()},{[vc]:{spec:r}})}var Gc=(r,n,i)=>{return(m,c)=>{let l=-1;return y(0);async function y(j){if(j<=l)throw Error("next() called multiple times");l=j;let A,S=!1,v;if(r[j])v=r[j][0][0],m.req.routeIndex=j;else v=j===r.length&&c||void 0;if(v)try{A=await v(m,()=>y(j+1))}catch(w){if(w instanceof Error&&n)m.error=w,A=await n(w,m),S=!0;else throw w}else if(m.finalized===!1&&i)A=await i(m);if(A&&(m.finalized===!1||S))m.res=A;return m}}};var Dy=Symbol();var Nc=(r)=>("headers"in r),Uy=async(r,n=Object.create(null))=>{let{all:i=!1,dot:m=!1}=n,y=(Nc(r)?r.headers:r.raw.headers).get("Content-Type")?.split(";")[0].trim().toLowerCase();if(y==="multipart/form-data"||y==="application/x-www-form-urlencoded")return _A(r,{all:i,dot:m});return{}};async function _A(r,n){let i=Nc(r)?r.headers:r.raw.headers,m=await r.arrayBuffer(),c=zm(m,i.get("Content-Type")||"");if(!Nc(r))r.bodyCache.formData=c;let l=await c;if(l)return gA(l,n);return{}}function gA(r,n){let i=Object.create(null);if(r.forEach((m,c)=>{if(!(n.all||c.endsWith("[]")))i[c]=m;else FA(i,c,m)}),n.dot)Object.entries(i).forEach(([m,c])=>{if(m.includes("."))zA(i,m,c),delete i[m]});return i}var FA=(r,n,i)=>{if(r[n]!==void 0)if(Array.isArray(r[n]))r[n].push(i);else r[n]=[r[n],i];else if(!n.endsWith("[]"))r[n]=i;else r[n]=[i]},zA=(r,n,i)=>{if(/(?:^|\.)__proto__\./.test(n))return;let m=r,c=n.split(".");c.forEach((l,y)=>{if(y===c.length-1)m[l]=i;else{if(!m[l]||typeof m[l]!=="object"||Array.isArray(m[l])||m[l]instanceof File)m[l]=Object.create(null);m=m[l]}})};var Py=(r)=>vi(r,oi),Cy=class{raw;#r;#n;routeIndex=0;path;bodyCache={};constructor(r,n="/",i=[[]]){this.raw=r,this.path=n,this.#n=i,this.#r={}}param(r){return r?this.#i(r):this.#l()}#i(r){let n=this.#n[0][this.routeIndex][1][r],i=this.#c(n);return i&&/\%/.test(i)?Py(i):i}#l(){let r={},n=Object.keys(this.#n[0][this.routeIndex][1]);for(let i of n){let m=this.#c(this.#n[0][this.routeIndex][1][i]);if(m!==void 0)r[i]=/\%/.test(m)?Py(m):m}return r}#c(r){return this.#n[1]?this.#n[1][r]:r}query(r){return iy(this.url,r)}queries(r){return my(this.url,r)}header(r){if(r)return this.raw.headers.get(r)??void 0;let n={};return this.raw.headers.forEach((i,m)=>{n[m]=i}),n}async parseBody(r){return Uy(this,r)}#m=(r)=>{let{bodyCache:n,raw:i}=this,m=n[r];if(m)return m;let c=Object.keys(n)[0];if(c)return n[c].then((l)=>{if(c==="json")l=JSON.stringify(l);return new Response(l)[r]()});return n[r]=i[r]()};json(){return this.#m("text").then((r)=>JSON.parse(r))}text(){return this.#m("text")}arrayBuffer(){return this.#m("arrayBuffer")}bytes(){return this.#m("arrayBuffer").then((r)=>new Uint8Array(r))}blob(){return this.#m("blob")}formData(){return this.#m("formData")}addValidatedData(r,n){this.#r[r]=n}valid(r){return this.#r[r]}get url(){return this.raw.url}get method(){return this.raw.method}get[Dy](){return this.#n}get matchedRoutes(){return this.#n[0].map(([[,r]])=>r)}get routePath(){return this.#n[0].map(([[,r]])=>r)[this.routeIndex].path}};var om={Stringify:1,BeforeStream:2,Stream:3},Wy=(r,n)=>{let i=new String(r);return i.isEscaped=!0,i.callbacks=n,i};var Mi=async(r,n,i,m,c)=>{if(typeof r==="object"&&!(r instanceof String)){if(!(r instanceof Promise))r=r.toString();if(r instanceof Promise)r=await r}let l=r.callbacks;if(!l?.length)return Promise.resolve(r);if(c)c[0]+=r;else c=[r];let y=Promise.all(l.map((j)=>j({phase:n,buffer:c,context:m}))).then((j)=>Promise.all(j.filter(Boolean).map((A)=>Mi(A,n,!1,m,c))).then(()=>c[0]));if(i)return Wy(await y,l);else return y};var Xy="text/plain; charset=UTF-8",Ec=(r,n)=>{return{"Content-Type":r,...n}},Ti=(r,n)=>new Response(r,n),Qc=class{#r;#n;env={};#i;finalized=!1;error;#l;#c;#m;#S;#I;#A;#j;#v;#w;constructor(r,n){if(this.#r=r,n)this.#c=n.executionCtx,this.env=n.env,this.#A=n.notFoundHandler,this.#w=n.path,this.#v=n.matchResult}get req(){return this.#n??=new Cy(this.#r,this.#w,this.#v),this.#n}get event(){if(this.#c&&"respondWith"in this.#c)return this.#c;else throw Error("This context has no FetchEvent")}get executionCtx(){if(this.#c)return this.#c;else throw Error("This context has no ExecutionContext")}get res(){return this.#m||=Ti(null,{headers:this.#j??=new Headers})}set res(r){if(this.#m&&r){r=Ti(r.body,r);for(let[n,i]of this.#m.headers.entries()){if(n==="content-type")continue;if(n==="set-cookie"){let m=this.#m.headers.getSetCookie();r.headers.delete("set-cookie");for(let c of m)r.headers.append("set-cookie",c)}else r.headers.set(n,i)}}this.#m=r,this.finalized=!0}render=(...r)=>{return this.#I??=(n)=>this.html(n),this.#I(...r)};setLayout=(r)=>this.#S=r;getLayout=()=>this.#S;setRenderer=(r)=>{this.#I=r};header=(r,n,i)=>{if(this.finalized)this.#m=Ti(this.#m.body,this.#m);let m=this.#m?this.#m.headers:this.#j??=new Headers;if(n===void 0)m.delete(r);else if(i?.append)m.append(r,n);else m.set(r,n)};status=(r)=>{this.#l=r};set=(r,n)=>{this.#i??=new Map,this.#i.set(r,n)};get=(r)=>{return this.#i?this.#i.get(r):void 0};get var(){if(!this.#i)return{};return Object.fromEntries(this.#i)}#y(r,n,i){let m=this.#m?new Headers(this.#m.headers):this.#j??new Headers;if(typeof n==="object"&&"headers"in n){let l=n.headers instanceof Headers?n.headers:new Headers(n.headers);for(let[y,j]of l)if(y.toLowerCase()==="set-cookie")m.append(y,j);else m.set(y,j)}if(i)for(let[l,y]of Object.entries(i))if(typeof y==="string")m.set(l,y);else{m.delete(l);for(let j of y)m.append(l,j)}let c=typeof n==="number"?n:n?.status??this.#l;return Ti(r,{status:c,headers:m})}newResponse=(...r)=>this.#y(...r);body=(r,n,i)=>this.#y(r,n,i);text=(r,n,i)=>{return!this.#j&&!this.#l&&!n&&!i&&!this.finalized?new Response(r):this.#y(r,n,Ec(Xy,i))};json=(r,n,i)=>{return this.#y(JSON.stringify(r),n,Ec("application/json",i))};html=(r,n,i)=>{let m=(c)=>this.#y(c,n,Ec("text/html; charset=UTF-8",i));return typeof r==="object"?Mi(r,om.Stringify,!1,{}).then(m):m(r)};redirect=(r,n)=>{let i=String(r);return this.header("Location",!/[^\x00-\xFF]/.test(i)?i:encodeURI(i)),this.newResponse(null,n??302)};notFound=()=>{return this.#A??=()=>Ti(),this.#A(this)}};var B="ALL",Ky="all",Hy=["get","post","put","delete","options","patch"],Mm="Can not add a route since the matcher is already built.",Tm=class extends Error{};var Dc="__COMPOSED_HANDLER";var oA=(r)=>{return r.text("404 Not Found",404)},Ry=(r,n)=>{if("getResponse"in r){let i=r.getResponse();return n.newResponse(i.body,i)}return console.error(r),n.text("Internal Server Error",500)},Vy=class r{get;post;put;delete;options;patch;all;on;use;router;getPath;_basePath="/";#r="/";routes=[];constructor(n={}){[...Hy,Ky].forEach((l)=>{this[l]=(y,...j)=>{if(typeof y==="string")this.#r=y;else this.#l(l,this.#r,y);return j.forEach((A)=>{this.#l(l,this.#r,A)}),this}}),this.on=(l,y,...j)=>{for(let A of[y].flat()){this.#r=A;for(let S of[l].flat())j.map((v)=>{this.#l(S.toUpperCase(),this.#r,v)})}return this},this.use=(l,...y)=>{if(typeof l==="string")this.#r=l;else this.#r="*",y.unshift(l);return y.forEach((j)=>{this.#l(B,this.#r,j)}),this};let{strict:m,...c}=n;Object.assign(this,c),this.getPath=m??!0?n.getPath??lc:ry}#n(){let n=new r({router:this.router,getPath:this.getPath});return n.errorHandler=this.errorHandler,n.#i=this.#i,n.routes=this.routes,n}#i=oA;errorHandler=Ry;route(n,i){let m=this.basePath(n);return i.routes.map((c)=>{let l;if(i.errorHandler===Ry)l=c.handler;else l=async(y,j)=>(await Gc([],i.errorHandler)(y,()=>c.handler(y,j))).res,l[Dc]=c.handler;m.#l(c.method,c.path,l,c.basePath)}),this}basePath(n){let i=this.#n();return i._basePath=On(this._basePath,n),i}onError=(n)=>{return this.errorHandler=n,this};notFound=(n)=>{return this.#i=n,this};mount(n,i,m){let c,l;if(m)if(typeof m==="function")l=m;else if(l=m.optionHandler,m.replaceRequest===!1)c=(A)=>A;else c=m.replaceRequest;let y=l?(A)=>{let S=l(A);return Array.isArray(S)?S:[S]}:(A)=>{let S=void 0;try{S=A.executionCtx}catch{}return[A.env,S]};c||=(()=>{let A=On(this._basePath,n),S=A==="/"?0:A.length;return(v)=>{let w=new URL(v.url);return w.pathname=this.getPath(v).slice(S)||"/",new Request(w,v)}})();let j=async(A,S)=>{let v=await i(c(A.req.raw),...y(A));if(v)return v;await S()};return this.#l(B,On(n,"*"),j),this}#l(n,i,m,c){n=n.toUpperCase(),i=On(this._basePath,i);let l={basePath:c!==void 0?On(this._basePath,c):this._basePath,path:i,method:n,handler:m};this.router.add(n,i,[m,l]),this.routes.push(l)}#c(n,i){if(n instanceof Error)return this.errorHandler(n,i);throw n}#m(n,i,m,c){if(c==="HEAD")return(async()=>new Response(null,await this.#m(n,i,m,"GET")))();let l=this.getPath(n,{env:m}),y=this.router.match(c,l),j=new Qc(n,{path:l,matchResult:y,env:m,executionCtx:i,notFoundHandler:this.#i});if(y[0].length===1){let S;try{S=y[0][0][0][0](j,async()=>{j.res=await this.#i(j)})}catch(v){return this.#c(v,j)}return S instanceof Promise?S.then((v)=>v||(j.finalized?j.res:this.#i(j))).catch((v)=>this.#c(v,j)):S??this.#i(j)}let A=Gc(y[0],this.errorHandler,this.#i);return(async()=>{try{let S=await A(j);if(!S.finalized)throw Error("Context is not finalized. Did you forget to return a Response object or `await next()`?");return S.res}catch(S){return this.#c(S,j)}})()}fetch=(n,...i)=>{return this.#m(n,i[1],i[0],n.method)};request=(n,i,m,c)=>{if(n instanceof Request)return this.fetch(i?new Request(n,i):n,m,c);return n=n.toString(),this.fetch(new Request(/^https?:\/\//.test(n)?n:`http://localhost${On("/",n)}`,i),m,c)};fire=()=>{addEventListener("fetch",(n)=>{n.respondWith(this.#m(n.request,n,void 0,n.request.method))})}};var hi=[];function hm(r,n){let i=this.buildAllMatchers(),m=(c,l)=>{let y=i[c]||i[B],j=y[2][l];if(j)return j;let A=l.match(y[0]);if(!A)return[[],hi];let S=A.indexOf("",1);return[y[1][S],A]};return this.match=m,m(r,n)}var Bm="[^/]+",Bi=".*",xi="(?:|/.*)",bn=Symbol(),MA=new Set(".\\+*[^]$()");function TA(r,n){if(r.length===1)return n.length===1?r<n?-1:1:-1;if(n.length===1)return 1;if(r===Bi||r===xi)return 1;else if(n===Bi||n===xi)return-1;if(r===Bm)return 1;else if(n===Bm)return-1;return r.length===n.length?r<n?-1:1:n.length-r.length}var Yy=class r{#r;#n;#i=Object.create(null);insert(n,i,m,c,l){if(n.length===0){if(this.#r!==void 0)throw bn;if(l)return;this.#r=i;return}let[y,...j]=n,A=y==="*"?j.length===0?["","",Bi]:["","",Bm]:y==="/*"?["","",xi]:y.match(/^\:([^\{\}]+)(?:\{(.+)\})?$/),S;if(A){let v=A[1],w=A[2]||Bm;if(v&&A[2]){if(w===".*")throw bn;if(w=w.replace(/^\((?!\?:)(?=[^)]+\)$)/,"(?:"),/\((?!\?:)/.test(w))throw bn}if(S=this.#i[w],!S){if(Object.keys(this.#i).some((N)=>N!==Bi&&N!==xi))throw bn;if(l)return;if(S=this.#i[w]=new r,v!=="")S.#n=c.varIndex++}if(!l&&v!=="")m.push([v,S.#n])}else if(S=this.#i[y],!S){if(Object.keys(this.#i).some((v)=>v.length>1&&v!==Bi&&v!==xi))throw bn;if(l)return;S=this.#i[y]=new r}S.insert(j,i,m,c,l)}buildRegExpStr(){let i=Object.keys(this.#i).sort(TA).map((m)=>{let c=this.#i[m];return(typeof c.#n==="number"?`(${m})@${c.#n}`:MA.has(m)?`\\${m}`:m)+c.buildRegExpStr()});if(typeof this.#r==="number")i.unshift(`#${this.#r}`);if(i.length===0)return"";if(i.length===1)return i[0];return"(?:"+i.join("|")+")"}};var Zy=class{#r={varIndex:0};#n=new Yy;insert(r,n,i){let m=[],c=[];for(let y=0;;){let j=!1;if(r=r.replace(/\{[^}]+\}/g,(A)=>{let S=`@\\${y}`;return c[y]=[S,A],y++,j=!0,S}),!j)break}let l=r.match(/(?::[^\/]+)|(?:\/\*$)|./g)||[];for(let y=c.length-1;y>=0;y--){let[j]=c[y];for(let A=l.length-1;A>=0;A--)if(l[A].indexOf(j)!==-1){l[A]=l[A].replace(j,c[y][1]);break}}return this.#n.insert(l,n,m,this.#r,i),m}buildRegExp(){let r=this.#n.buildRegExpStr();if(r==="")return[/^$/,[],[]];let n=0,i=[],m=[];return r=r.replace(/#(\d+)|@(\d+)|\.\*\$/g,(c,l,y)=>{if(l!==void 0)return i[++n]=Number(l),"$()";if(y!==void 0)return m[Number(y)]=++n,"";return""}),[new RegExp(`^${r}`),i,m]}};var hA=[/^$/,[],Object.create(null)],Jy=Object.create(null);function Oy(r){return Jy[r]??=new RegExp(r==="*"?"":`^${r.replace(/\/\*$|([.\\+*[^\]$()])/g,(n,i)=>i?`\\${i}`:"(?:|/.*)")}$`)}function BA(){Jy=Object.create(null)}function xA(r){let n=new Zy,i=[];if(r.length===0)return hA;let m=r.map((S)=>[!/\*|\/:/.test(S[0]),...S]).sort(([S,v],[w,N])=>S?1:w?-1:v.length-N.length),c=Object.create(null);for(let S=0,v=-1,w=m.length;S<w;S++){let[N,E,Q]=m[S];if(N)c[E]=[Q.map(([H])=>[H,Object.create(null)]),hi];else v++;let W;try{W=n.insert(E,v,N)}catch(H){throw H===bn?new Tm(E):H}if(N)continue;i[v]=Q.map(([H,X])=>{let K=Object.create(null);X-=1;for(;X>=0;X--){let[J,q]=W[X];K[J]=q}return[H,K]})}let[l,y,j]=n.buildRegExp();for(let S=0,v=i.length;S<v;S++)for(let w=0,N=i[S].length;w<N;w++){let E=i[S][w]?.[1];if(!E)continue;let Q=Object.keys(E);for(let W=0,H=Q.length;W<H;W++)E[Q[W]]=j[E[Q[W]]]}let A=[];for(let S in y)A[S]=i[y[S]];return[l,A,c]}function $i(r,n){if(!r)return;for(let i of Object.keys(r).sort((m,c)=>c.length-m.length))if(Oy(i).test(n))return[...r[i]];return}var xm=class{name="RegExpRouter";#r;#n;constructor(){this.#r={[B]:Object.create(null)},this.#n={[B]:Object.create(null)}}add(r,n,i){let m=this.#r,c=this.#n;if(!m||!c)throw Error(Mm);if(!m[r])[m,c].forEach((j)=>{j[r]=Object.create(null),Object.keys(j[B]).forEach((A)=>{j[r][A]=[...j[B][A]]})});if(n==="/*")n="*";let l=(n.match(/\/:/g)||[]).length;if(/\*$/.test(n)){let j=Oy(n);if(r===B)Object.keys(m).forEach((A)=>{m[A][n]||=$i(m[A],n)||$i(m[B],n)||[]});else m[r][n]||=$i(m[r],n)||$i(m[B],n)||[];Object.keys(m).forEach((A)=>{if(r===B||r===A)Object.keys(m[A]).forEach((S)=>{j.test(S)&&m[A][S].push([i,l])})}),Object.keys(c).forEach((A)=>{if(r===B||r===A)Object.keys(c[A]).forEach((S)=>j.test(S)&&c[A][S].push([i,l]))});return}let y=Fm(n)||[n];for(let j=0,A=y.length;j<A;j++){let S=y[j];Object.keys(c).forEach((v)=>{if(r===B||r===v)c[v][S]||=[...$i(m[v],S)||$i(m[B],S)||[]],c[v][S].push([i,l-A+j+1])})}}match=hm;buildAllMatchers(){let r=Object.create(null);return Object.keys(this.#n).concat(Object.keys(this.#r)).forEach((n)=>{r[n]||=this.#i(n)}),this.#r=this.#n=void 0,BA(),r}#i(r){let n=[],i=r===B;if([this.#r,this.#n].forEach((m)=>{let c=m[r]?Object.keys(m[r]).map((l)=>[l,m[r][l]]):[];if(c.length!==0)i||=!0,n.push(...c);else if(r!==B)n.push(...Object.keys(m[B]).map((l)=>[l,m[B][l]]))}),!i)return null;else return xA(n)}};var kA=class{name="PreparedRegExpRouter";#r;#n;constructor(r,n){this.#r=r,this.#n=n}#i(r,n){let i=this.#r[r];i[1].forEach((m)=>m&&m.push(n)),Object.values(i[2]).forEach((m)=>m[0].push(n))}#l(r,n,i,m,c){let l=this.#r[r];if(!c)l[2][n][0].push([i,{}]);else m.forEach((y)=>{if(typeof y==="number")l[1][y].push([i,c]);else l[2][y||n][0].push([i,c])})}add(r,n,i){if(!this.#r[r]){let c=this.#r[B],l={};for(let y in c[2])l[y]=[c[2][y][0].slice(),hi];this.#r[r]=[c[0],c[1].map((y)=>Array.isArray(y)?y.slice():0),l]}if(n==="/*"||n==="*"){let c=[i,{}];if(r===B)for(let l in this.#r)this.#i(l,c);else this.#i(r,c);return}let m=this.#n[n];if(!m)throw Error(`Path ${n} is not registered`);for(let[c,l]of m)if(r===B)for(let y in this.#r)this.#l(y,n,i,c,l);else this.#l(r,n,i,c,l)}buildAllMatchers(){return this.#r}match=hm};var Uc=class{name="SmartRouter";#r=[];#n=[];constructor(r){this.#r=r.routers}add(r,n,i){if(!this.#n)throw Error(Mm);this.#n.push([r,n,i])}match(r,n){if(!this.#n)throw Error("Fatal error");let i=this.#r,m=this.#n,c=i.length,l=0,y;for(;l<c;l++){let j=i[l];try{for(let A=0,S=m.length;A<S;A++)j.add(...m[A]);y=j.match(r,n)}catch(A){if(A instanceof Tm)continue;throw A}this.match=j.match.bind(j),this.#r=[j],this.#n=void 0;break}if(l===c)throw Error("Fatal error");return this.name=`SmartRouter + ${this.activeRouter.name}`,y}get activeRouter(){if(this.#n||this.#r.length!==1)throw Error("No active router has been determined yet.");return this.#r[0]}};var ki=Object.create(null),pA=(r)=>{for(let n in r)return!0;return!1},Ly=class r{#r;#n;#i;#l=0;#c=ki;constructor(n,i,m){if(this.#n=m||Object.create(null),this.#r=[],n&&i){let c=Object.create(null);c[n]={handler:i,possibleKeys:[],score:0},this.#r=[c]}this.#i=[]}insert(n,i,m){this.#l=++this.#l;let c=this,l=el(i),y=[];for(let j=0,A=l.length;j<A;j++){let S=l[j],v=l[j+1],w=sl(S,v),N=Array.isArray(w)?w[0]:S;if(N in c.#n){if(c=c.#n[N],w)y.push(w[1]);continue}if(c.#n[N]=new r,w)c.#i.push(w),y.push(w[1]);c=c.#n[N]}return c.#r.push({[n]:{handler:m,possibleKeys:y.filter((j,A,S)=>S.indexOf(j)===A),score:this.#l}}),c}#m(n,i,m,c,l){for(let y=0,j=i.#r.length;y<j;y++){let A=i.#r[y],S=A[m]||A[B],v={};if(S!==void 0){if(S.params=Object.create(null),n.push(S),c!==ki||l&&l!==ki)for(let w=0,N=S.possibleKeys.length;w<N;w++){let E=S.possibleKeys[w],Q=v[S.score];S.params[E]=l?.[E]&&!Q?l[E]:c[E]??l?.[E],v[S.score]=!0}}}}search(n,i){let m=[];this.#c=ki;let l=[this],y=cc(i),j=[],A=y.length,S=null;for(let v=0;v<A;v++){let w=y[v],N=v===A-1,E=[];for(let W=0,H=l.length;W<H;W++){let X=l[W],K=X.#n[w];if(K)if(K.#c=X.#c,N){if(K.#n["*"])this.#m(m,K.#n["*"],n,X.#c);this.#m(m,K,n,X.#c)}else E.push(K);for(let J=0,q=X.#i.length;J<q;J++){let z=X.#i[J],L=X.#c===ki?{}:{...X.#c};if(z==="*"){let hr=X.#n["*"];if(hr)this.#m(m,hr,n,X.#c),hr.#c=L,E.push(hr);continue}let[rr,Tr,Yr]=z;if(!w&&!(Yr instanceof RegExp))continue;let k=X.#n[rr];if(Yr instanceof RegExp){if(S===null){S=Array(A);let Si=i[0]==="/"?1:0;for(let zi=0;zi<A;zi++)S[zi]=Si,Si+=y[zi].length+1}let hr=i.substring(S[v]),Jn=Yr.exec(hr);if(Jn){if(L[Tr]=Jn[0],this.#m(m,k,n,X.#c,L),Jn[0].length===hr.length&&k.#n["*"])this.#m(m,k.#n["*"],n,X.#c,L);if(pA(k.#n)){k.#c=L;let Si=Jn[0].match(/\//)?.length??0;(j[Si]||=[]).push(k)}continue}}if(Yr===!0||Yr.test(w))if(L[Tr]=w,N){if(this.#m(m,k,n,L,X.#c),k.#n["*"])this.#m(m,k.#n["*"],n,L,X.#c)}else k.#c=L,E.push(k)}}let Q=j.shift();l=Q?E.concat(Q):E}if(m.length>1)m.sort((v,w)=>{return v.score-w.score});return[m.map(({handler:v,params:w})=>[v,w])]}};var Pc=class{name="TrieRouter";#r;constructor(){this.#r=new Ly}add(r,n,i){let m=Fm(n);if(m){for(let c=0,l=m.length;c<l;c++)this.#r.insert(r,m[c],i);return}this.#r.insert(r,n,i)}match(r,n){return this.#r.search(r,n)}};var V=class extends Vy{constructor(r={}){super(r);this.router=r.router??new Uc({routers:[new xm,new Pc]})}};var Cc=/^\s*(?:text\/(?!event-stream(?:[;\s]|$))[^;\s]+|application\/(?:javascript|json|xml|xml-dtd|ecmascript|dart|msgpack|postscript|rtf|tar|toml|vnd\.dart|vnd\.ms-fontobject|vnd\.ms-opentype|vnd\.msgpack|wasm|x-httpd-php|x-javascript|x-msgpack|x-ns-proxy-autoconfig|x-sh|x-tar|x-virtualbox-hdd|x-virtualbox-ova|x-virtualbox-ovf|x-virtualbox-vbox|x-virtualbox-vdi|x-virtualbox-vhd|x-virtualbox-vmdk|x-www-form-urlencoded)|font\/(?:otf|ttf)|image\/(?:bmp|vnd\.adobe\.photoshop|vnd\.microsoft\.icon|vnd\.ms-dds|x-icon|x-ms-bmp)|message\/rfc822|model\/gltf-binary|x-shader\/x-fragment|x-shader\/x-vertex|[^;\s]+?\+(?:json|text|xml|yaml|msgpack))(?:[;\s]|$)/i;var aA={br:".br",zstd:".zst",gzip:".gz"},aN=Object.keys(aA);var Wc="x-hono-disable-ssg",vE=(()=>{try{return new Response("SSG is disabled",{status:404,headers:{[Wc]:"true"}})}catch{return null}})();var{write:uE}=Bun;var qy=class{#r;constructor(r){this.#r=r,this.raw=r.raw,this.url=r.url?new URL(r.url):null,this.protocol=r.protocol??null}send(r,n){this.#r.send(r,n??{})}raw;binaryType="arraybuffer";get readyState(){return this.#r.readyState}url;protocol;close(r,n){this.#r.close(r,n)}},_y=(r)=>{return new MessageEvent("message",{data:r})},gy=(r)=>{return(...n)=>{if(typeof n[0]==="function"){let[i,m]=n;return async function(l,y){let j=await i(l),A=await r(l,j,m);if(A)return A;await y()}}else{let[i,m,c]=n;return(async()=>{let l=await r(i,m,c);if(!l)throw Error("Failed to upgrade WebSocket");return l})()}}};var km=(r)=>("server"in r.env)?r.env.server:r.env;var Xc=(r)=>{return new qy({send:(n,i)=>{r.send(n,i?.compress)},raw:r,readyState:r.readyState,url:r.data.url,protocol:r.data.protocol,close(n,i){r.close(n,i)}})},Fy=gy((r,n)=>{let i=km(r);if(!i)throw TypeError("env has to include the 2nd argument of fetch.");if(i.upgrade(r.req.raw,{data:{events:n,url:new URL(r.req.url),protocol:r.req.header("sec-websocket-protocol")?.split(",")[0]?.trim()??""}}))return new Response(null);return}),zy={open(r){let n=r.data.events;if(n.onOpen)n.onOpen(new Event("open"),Xc(r))},close(r,n,i){let m=r.data.events;if(m.onClose)m.onClose(new CloseEvent("close",{code:n,reason:i}),Xc(r))},message(r,n){let i=r.data.events;if(i.onMessage){let m=typeof n==="string"?n:n.buffer;i.onMessage(_y(m),Xc(r))}}},Kc=()=>({upgradeWebSocket:Fy,websocket:zy});var oy={create(r){let n=Kc();return{upgradeWebSocket:n.upgradeWebSocket,async listen(i){let m={fetch:r.fetch,hostname:i.hostname,idleTimeout:0,websocket:n.websocket},c=(y)=>{try{return Bun.serve({...m,port:y})}catch{return}},l=i.port===0?c(4096)??c(0):c(i.port);if(!l)throw Error(`Failed to start server on port ${i.port}`);if(!l.port)throw Error(`Failed to resolve server address for port ${i.port}`);return{port:l.port,stop(y){return Promise.resolve(l.stop(y))}}}}}};var Ei={};Nr(Ei,{unpublish:()=>Rj,publish:()=>Sv,MDNS:()=>Ei});var Hj=Av(Kj(),1),di=_.create({service:"mdns"}),yn,em;function Sv(r,n){if(em===r)return;if(yn)Rj();try{let i=n??"qitqode.local",m=`qitqode-${r}`;yn=new Hj.Bonjour;let c=yn.publish({name:m,type:"http",host:i,port:r,txt:{path:"/"}});c.on("up",()=>{di.info("mDNS service published",{name:m,port:r})}),c.on("error",(l)=>{di.error("mDNS service error",{error:l})}),em=r}catch(i){if(di.error("mDNS publish failed",{error:i}),yn)try{yn.destroy()}catch{}yn=void 0,em=void 0}}function Rj(){if(yn){try{yn.unpublishAll(),yn.destroy()}catch(r){di.error("mDNS unpublish failed",{error:r})}yn=void 0,em=void 0,di.info("mDNS service unpublished")}}var Vj=(r)=>{let n=atob(r),i=new Uint8Array(new ArrayBuffer(n.length)),m=n.length/2;for(let c=0,l=n.length-1;c<=m;c++,l--)i[c]=n.charCodeAt(c),i[l]=n.charCodeAt(l);return i};var vv=/^ *(?:[Bb][Aa][Ss][Ii][Cc]) +([A-Za-z0-9._~+/-]+=*) *$/,wv=/^([^:]*):(.*)$/,$v=new TextDecoder,Yj=(r)=>{let n=vv.exec(r.headers.get("Authorization")||"");if(!n)return;let i=void 0;try{i=wv.exec($v.decode(Vj(n[1])))}catch{}if(!i)return;return{username:i[1],password:i[2]}};var Zj=(r,...n)=>{let i="username"in r&&"password"in r,m="verifyUser"in r;if(!(i||m))throw Error('basic auth middleware requires options for "username and password" or "verifyUser"');if(!r.realm)r.realm="Secure Area";if(!r.invalidUserMessage)r.invalidUserMessage="Unauthorized";if(i)n.unshift({username:r.username,password:r.password});return async function(l,y){let j=Yj(l.req.raw);if(j)if(m){if(await r.verifyUser(j.username,j.password,l)){if(r.onAuthSuccess)await r.onAuthSuccess(l,j.username);await y();return}}else for(let N of n){let[E,Q]=await Promise.all([Ic(N.username,j.username,r.hashFunction),Ic(N.password,j.password,r.hashFunction)]);if(E&&Q){if(r.onAuthSuccess)await r.onAuthSuccess(l,j.username);await y();return}}let A=401,S={"WWW-Authenticate":'Basic realm="'+r.realm?.replace(/"/g,"\\\"")+'"'},v=typeof r.invalidUserMessage==="function"?await r.invalidUserMessage(l):r.invalidUserMessage,w=typeof v==="string"?new Response(v,{status:A,headers:S}):new Response(JSON.stringify(v),{status:A,headers:{...S,"content-type":"application/json"}});throw new kr(A,{res:w})}};var Jj=(r)=>{let n={origin:"*",allowMethods:["GET","HEAD","PUT","POST","DELETE","PATCH"],allowHeaders:[],exposeHeaders:[],...r},i=((c)=>{if(typeof c==="string")if(c==="*")return()=>c;else return(l)=>c===l?l:null;else if(typeof c==="function")return c;else return(l)=>c.includes(l)?l:null})(n.origin),m=((c)=>{if(typeof c==="function")return c;else if(Array.isArray(c))return()=>c;else return()=>[]})(n.allowMethods);return async function(l,y){function j(S,v){l.res.headers.set(S,v)}let A=await i(l.req.header("origin")||"",l);if(A)j("Access-Control-Allow-Origin",A);if(n.credentials)j("Access-Control-Allow-Credentials","true");if(n.exposeHeaders?.length)j("Access-Control-Expose-Headers",n.exposeHeaders.join(","));if(l.req.method==="OPTIONS"){if(n.origin!=="*")j("Vary","Origin");if(n.maxAge!=null)j("Access-Control-Max-Age",n.maxAge.toString());let S=await m(l.req.header("origin")||"",l);if(S.length)j("Access-Control-Allow-Methods",S.join(","));let v=n.allowHeaders;if(!v?.length){let w=l.req.header("Access-Control-Request-Headers");if(w)v=w.split(/\s*,\s*/)}if(v?.length)j("Access-Control-Allow-Headers",v.join(",")),l.res.headers.append("Vary","Access-Control-Request-Headers");return l.res.headers.delete("Content-Length"),l.res.headers.delete("Content-Type"),new Response(null,{headers:l.res.headers,status:204,statusText:"No Content"})}if(await y(),n.origin!=="*")l.header("Vary","Origin",{append:!0})}};var Lj=(r)=>r===32||r===9||r===10||r===13,sm=(r,n)=>{while(n<r.length){if(!Lj(r.charCodeAt(n)))break;n++}return n},ti=(r,n)=>{while(n>0){if(!Lj(r.charCodeAt(n-1)))break;n--}return n},Oj=(r,n)=>{while(n<r.length){let i=r.charCodeAt(n);if(i===59)return[n+1,!0];if(i===44)return[n+1,!1];n++}return[n,!1]},Gv=(r,n)=>{let i=n,m=!1;while(i<r.length){let c=r.charCodeAt(i);if(m&&c===92)i++;else if(c===34)m=!m;else if(!m&&c===44)return i+1;i++}return i},Nv=(r,n)=>{n=sm(r,n);let i=n,m,c,l=!1;while(i<r.length){let A=r.charCodeAt(i);if(A===61){m=r.slice(n,ti(r,i)),i++;break}if(A===59)return[i+1,void 0,void 0,!0];if(A===44)return[i+1,void 0,void 0,!1];i++}if(m===void 0)return[i,void 0,void 0,!1];if(i=sm(r,i),r.charCodeAt(i)===61){let A=Oj(r,i+1);return[A[0],m,void 0,A[1]]}let y=!1,j=i;while(i<r.length){let A=r.charCodeAt(i);if(y&&A===92)i++;else if(A===34){if(y){let S=sm(r,i+1),v=r.charCodeAt(S);if(S<r.length&&!(v===59||v===44)){let w=Oj(r,S);return[w[0],m,void 0,w[1]]}if(c=r.slice(j+1,i),c.includes("\\"))c=c.replace(/\\(.)/g,"$1");if(v===44)return[S+1,m,c,!1];if(v===59)l=!0,S++;i=S;break}y=!0}else if(!y&&(A===59||A===44)){if(c=r.slice(j,ti(r,i)),A===59)l=!0;i++;break}i++}return[i,m,c??r.slice(j,ti(r,i)),l]},Ev=(r,n)=>{let i={type:"",params:{},q:1};n=sm(r,n);let m=n;while(m<r.length){let j=r.charCodeAt(m);if(j===59||j===44){if(i.type=r.slice(n,ti(r,m)),m++,j===44)return[m,i.type?i:void 0];if(!i.type)return[Gv(r,m),void 0];break}m++}if(!i.type)return i.type=r.slice(n,ti(r,r.length)),[r.length,i.type?i:void 0];let c,l,y;while(m<r.length){if([m,c,l,y]=Nv(r,m),c&&l)i.params[c]=l;if(!y)break}return[m,i]},qj=(r)=>{if(!r)return[];let n=[],i=0,m,c=!1,l;while(i<r.length)if([i,m]=Ev(r,i),m){if(m.q=Qv(m.params.q),n.push(m),l&&l.q<m.q)c=!0;l=m}if(c)n.sort((y,j)=>j.q-y.q);return n},Qv=(r)=>{if(r===void 0)return 1;if(r==="")return 1;if(r==="NaN")return 0;let n=Number(r);if(n===1/0)return 1;if(n===-1/0)return 0;if(Number.isNaN(n))return 1;if(n<0||n>1)return 1;return n};var Dv=["gzip","deflate"],Uv=/(?:^|,)\s*?no-transform\s*?(?:,|$)/i,Pv=(r,n)=>{if(r===void 0)return;let i=qj(r),m=i.find((l)=>l.type==="*")?.q,c;for(let l of n){let y=i.find((A)=>A.type.toLowerCase()===l),j=y?y.q:m??0;if(j===1)return l;else if(j>0&&(!c||j>c.q))c={encoding:l,q:j}}return c?.encoding},_j=(r)=>{let n=r?.threshold??1024,i=r?.encoding?[r.encoding]:Dv,m=r?.contentTypeFilter??Cc,c=typeof m==="function"?(l)=>{let y=l.headers.get("Content-Type");return y&&m(y)}:(l)=>{let y=l.headers.get("Content-Type");return y&&m.test(y)};return async function(y,j){await j();let A=y.res.headers.get("Content-Length");if(y.res.status===206||y.res.headers.has("Content-Encoding")||y.res.headers.has("Transfer-Encoding")||y.req.method==="HEAD"||A&&Number(A)<n||!c(y.res)||!Cv(y.res))return;let S=y.req.header("Accept-Encoding"),v=Pv(S,i);if(!v||!y.res.body)return;let w=new CompressionStream(v);y.res=new Response(y.res.body.pipeThrough(w),y.res),y.res.headers.delete("Content-Length"),y.res.headers.set("Content-Encoding",v);let N=y.res.headers.get("ETag");if(N&&!N.startsWith("W/"))y.res.headers.set("ETag",`W/${N}`)}},Cv=(r)=>{let n=r.headers.get("Cache-Control");return!n||!Uv.test(n)};import{randomUUID as Wv}from"crypto";var fm="ticket",gj="x-qitqode-ticket",Fj="1",Xv=/^\/pty\/[^/]+\/connect$/,Kv=60000,bi=new Map;function Hv(){let r=Date.now();for(let[n,i]of bi)if(i.expiresAt<=r)bi.delete(n)}function zj(r){return Xv.test(r)}function oj(r,n=Kv){Hv();let i=Wv();return bi.set(i,{ptyID:r,expiresAt:Date.now()+n}),{ticket:i,expires_in:Math.round(n/1000)}}function Mj(r,n){let i=bi.get(r);if(!i)return!1;if(bi.delete(r),i.expiresAt<=Date.now())return!1;return i.ptyID===n}var n0=_.create({service:"server"}),hj=(r,n)=>{let i=Tj(r),m=i.errorID;n0.error("failed",{error_id:m,error:r});let c=()=>n.json(new r0.Unknown({message:"Internal server error",diagnostic:i}).toObject(),{status:500,headers:{"x-qitqode-error-id":m}});if(r instanceof r0){let l;if(r instanceof Wn)l=404;else if(r instanceof ir.ModelNotFoundError)l=400;else if(r.name==="ProviderAuthValidationFailed")l=400;else if(r.name.startsWith("Worktree"))l=400;else l=500;if(l===500)return c();return n.json(r.toObject(),{status:l,headers:{"x-qitqode-error-id":m}})}if(r instanceof Z.BusyError)return n.json(new r0.Unknown({message:r.message,diagnostic:i}).toObject(),{status:409,headers:{"x-qitqode-error-id":m}});if(r instanceof kr)return r.getResponse();return c()},Bj=(r,n)=>{if(r.req.method==="OPTIONS")return n();let i=p.QITQODE_SERVER_PASSWORD;if(!i)return n();let m=new URL(r.req.url).pathname;if(zj(m)&&r.req.query(fm))return n();let c=p.QITQODE_SERVER_USERNAME??"qitqode";return Zj({username:c,password:i})(r,n)},xj=async(r,n)=>{let i=r.req.path==="/log";if(!i)n0.info("request",{method:r.req.method,path:r.req.path});let m=n0.time("request",{method:r.req.method,path:r.req.path});if(await n(),!i)m.stop()};function kj(r){return Jj({maxAge:86400,origin(n){if(!n)return;if(r?.cors?.includes(n))return n}})}function Rv(r){return r==="localhost"||r==="::1"||/^127(\.\d{1,3}){3}$/.test(r)||r==="127.0.0.1"}function Vv(r){if(r.startsWith("[")){let n=r.indexOf("]");return n===-1?r:r.slice(1,n)}return r.split(":")[0]}function pj(r){let n=r.hostname===void 0,i=r.hostname==="0.0.0.0"||r.hostname==="::";return(m,c)=>{if(n||i)return c();let l=m.req.header("host");if(!l)return c();let y=Vv(l);if(Rv(y))return c();if(r.hostname&&y===r.hostname)return c();if(r.mdnsDomain&&y===r.mdnsDomain)return c();if(r.allowedHosts?.includes(y))return c();throw n0.warn("rejected request with unexpected Host header",{host:y}),new kr(403,{message:`Forbidden: unexpected Host header "${y}"`})}}var Yv=_j(),aj=(r,n)=>{let i=r.req.path,m=r.req.method;if(i==="/event"||i==="/global/event")return n();if(m==="POST"&&/\/session\/[^/]+\/(message|prompt_async)$/.test(i))return n();return Yv(r,n)};var a={};Nr(a,{waitForSync:()=>hv,status:()=>Mv,startWorkspaceSyncing:()=>ac,sessionRestore:()=>gv,remove:()=>zv,list:()=>Fv,isSyncing:()=>Tv,get:()=>i2,create:()=>qv,Workspace:()=>a,Info:()=>i0,Event:()=>si,ConnectionStatus:()=>n2});var uj=["forgewise"];var Zv=new TextEncoder;function Jv(r){return Zv.encode(r).byteLength}function dj(r,n=16384){let i=[...uj.filter((l)=>(l in r)),...Object.keys(r).filter((l)=>!uj.includes(l))],m={},c=0;for(let l of i){let y={...m,[l]:r[l]},j=JSON.stringify(y);if(Jv(j)>n)continue;m[l]=r[l],c+=1}if(c===0)return;return JSON.stringify(m)}var Hr=tj("workspace",{id:_n().$type().primaryKey(),type:_n().notNull(),name:_n().notNull().default(""),branch:_n(),directory:_n(),extra:_n({mode:"json"}),project_id:_n().$type().notNull().references(()=>bj.id,{onDelete:"cascade"})});async function ej(r,n,i){let m=r.getReader(),c=new TextDecoder,l="",y="",j=1000,A=()=>{m.cancel().catch(()=>{return})};if(n.addEventListener("abort",A),n.aborted)A();try{while(!n.aborted){let S=await m.read().catch(()=>({done:!0,value:void 0}));if(S.done)break;l+=c.decode(S.value,{stream:!0}),l=l.replace(/\r\n/g,`
|
|
2
|
+
import{ig as Ai,jg as t1,kg as b1,lg as k1,mg as p1,ng as e1,og as s1,pg as f1,qg as rA,rg as nA,sg as a1,vg as cA}from"./chunk-eefzbdbk.js";import{wg as Er,xg as L1}from"./chunk-4krmja97.js";import{Bg as W1}from"./chunk-z1psybn1.js";import{Gg as Sc}from"./chunk-v580zwpf.js";import{Ig as Ey}from"./chunk-5fbzvy6q.js";import{Jg as r2}from"./chunk-sv27ep93.js";import{$g as nm,Kg as Ml,Lg as zl,Mg as dn,Ng as _i,Ug as Xr,Vg as Tl,Wg as Km,Yg as Hm,Zg as pn,_g as tn,bh as mm,dh as _r,eh as bc,hh as j1,ih as ql,kh as tc,lh as _l,mh as ol,nh as ji,oh as Ll,ph as Fl,qh as b0,rh as Rm,th as w1,uh as Dr,vh as Ii,wh as Wr,yh as e}from"./chunk-cv3xdp8q.js";import{$k as Z,Aj as R1,Ej as fj,Ek as qr,Fj as tr,Fk as Fn,Gj as Rr,Gk as AA,Hj as D2,Ij as yr,Jj as br,Kj as vn,Lj as un,Lk as l1,Oj as Ym,Qk as ir,Rk as Cr,Sk as Ar,Uk as $2,Vk as I0,Wj as v1,Xj as s,Yj as er,al as cr,tj as wr,tk as Pi,uj as rm,uk as Qr,vj as J1,wj as O1,yj as f0,zj as qi}from"./chunk-z4gczap3.js";import{cl as al,ml as uI}from"./chunk-2p1qaqv3.js";import{Al as b,Cl as Wn,El as y0,Il as Gr,Kl as o,nl as Lr,rl as bj,sl as mr,tl as Kn,ul as Hn,zl as mA}from"./chunk-47pxz6cb.js";import{Wl as jn}from"./chunk-aq75kv5f.js";import{Am as o1,Bm as M1,Fm as T1,Gm as fi,Vm as l0,sm as _n,um as tj,xm as d,zm as im}from"./chunk-1851skhm.js";import{Mn as g}from"./chunk-jt94rhev.js";import{$o as P1,up as C1}from"./chunk-6wt8g6mc.js";import{ur as bI,vr as eI,wr as Di}from"./chunk-xgdst5n5.js";import{Fr as fI,Gr as r1}from"./chunk-yzxcjr6y.js";import{$r as B0,Mr as CI,Pr as Wi,as as Pr,bs as WI,cs as x0,ds as XI,es as KI,fs as HI,gs as RI,hs as zr,is as Ql,js as k0,ks as VI,ls as YI,ms as ZI,ns as JI,os as p0,ps as OI,qs as sI,rs as LI,ss as qI,ts as _I,us as _2,vs as Im}from"./chunk-53n3tfwn.js";import{$s as r0}from"./chunk-mbma071k.js";import{ct as lA,ot as aI}from"./chunk-dpm5x19e.js";import{Ft as Tj,Ht as c0}from"./chunk-vvmvryh1.js";import{Mt as p,Vt as _}from"./chunk-6g3bzap8.js";import{$t as kl,au as IA,eu as Xn,ju as Zn}from"./chunk-mrh5q4s6.js";import{ku as I}from"./chunk-w623r5kb.js";import{Ez as In,dA as cI,eA as lI}from"./chunk-00krzh3y.js";import{$B as Dl,AA as An,AG as h0,AI as b2,AM as El,BI as Al,CA as Xl,CF as M,CI as Sl,CM as ml,DA as zn,DI as e2,EC as AI,EG as O0,EI as s2,FI as X2,GI as ec,GM as K2,HA as x2,HI as wl,II as f2,JA as C2,KG as Bn,LO as Fr,MK as PI,NO as cl,OO as R0,PG as wI,PM as Dm,RE as S1,RH as Pl,SC as MI,SO as F,UC as Tn,UM as sc,XG as Gl,XM as jm,_A as on,aD as L2,aG as J0,aH as $m,aM as T0,bC as k2,bD as q2,bH as $I,bM as Nl,cF as Sm,cH as Ul,cN as Ri,dD as H0,dI as P,fH as o2,fM as rI,gG as t,gN as Ci,hC as p2,hI as GI,iC as a2,iN as gr,jD as d2,jI as NI,jJ as UI,kC as Qm,kI as Li,lC as $r,lI as Cl,mC as Y0,nG as vm,nM as nI,oC as Br,oG as wm,oI as EI,pC as Sn,pI as QI,pM as iI,qC as L0,qG as SI,qM as mI,sC as Um,sF as z2,tC as Il,uC as vl,uG as hn,uM as X0,vC as or,vI as DI,wC as Am,wF as Z0,wI as v0,wM as K0,xC as u2,yC as Vn,yG as vI,yI as t2,yM as Pm,zI as S0}from"./chunk-hk8m8vax.js";import{rP as Av,sP as nr,tP as Nr,vP as sn}from"./chunk-0xf12tf3.js";var pm=nr((hy)=>{Object.defineProperty(hy,"__esModule",{value:!0});hy.default=tA;var My=/[A-Z]/g;function Ty(r){return r.toLowerCase()}function tA(r,n){let i=r.replace(My,Ty),m=n.replace(My,Ty);return i===m}});var Rc=nr((By)=>{Object.defineProperty(By,"__esModule",{value:!0});By.DnsTxt=void 0;class Hc{constructor(r={}){this.binary=r?r.binary:!1}encode(r={}){return Object.entries(r).map(([n,i])=>{let m=`${n}=${i}`;return Buffer.from(m)})}decode(r){var n={};try{let m=r.toString().split(/=(.+)/),c=m[0],l=m[1];n[c]=l}catch(i){}return n}decodeAll(r){return r.filter((n)=>n.length>1).map((n)=>this.decode(n)).reduce((n,i)=>{var m=n;let[c]=Object.keys(i),[l]=Object.values(i);return m[c]=l,m},{})}}By.DnsTxt=Hc;By.default=Hc});var Vc=nr((py)=>{Object.defineProperty(py,"__esModule",{value:!0});py.toType=py.toString=void 0;var ky=(r)=>{return"_"+r},sA=(r)=>{return["name","protocol","subtype"].includes(r)},fA=(r)=>{let n={name:r.name,protocol:r.protocol,subtype:r.subtype};return Object.entries(n).filter(([m,c])=>sA(m)&&c!==void 0).reduce((m,[c,l])=>{switch(typeof l){case"object":l.map((y)=>m.push(ky(y)));break;default:m.push(ky(l));break}return m},[]).join(".")};py.toString=fA;var rS=(r)=>{let n=r.split("."),i;for(let m in n){if(n[m][0]!=="_")continue;n[m]=n[m].slice(1)}if(n.includes("sub"))i=n.shift(),n.shift();return{name:n.shift(),protocol:n.shift()||null,subtype:i}};py.toType=rS});var Zc=nr((en)=>{var dy=en&&en.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(en,"__esModule",{value:!0});en.Service=void 0;var uy=dy(sn("os")),iS=dy(Rc()),mS=sn("events"),cS=Vc(),am=".local";class Yc extends mS.EventEmitter{constructor(r){super();if(this.probe=!0,this.published=!1,this.activated=!1,this.destroyed=!1,this.txtService=new iS.default,!r.name)throw Error("ServiceConfig requires `name` property to be set");if(!r.type)throw Error("ServiceConfig requires `type` property to be set");if(!r.port)throw Error("ServiceConfig requires `port` property to be set");this.name=r.name.split(".").join("-"),this.protocol=r.protocol||"tcp",this.type=(0,cS.toString)({name:r.type,protocol:this.protocol}),this.port=r.port,this.host=r.host||uy.default.hostname(),this.fqdn=`${this.name}.${this.type}${am}`,this.txt=r.txt,this.subtypes=r.subtypes,this.disableIPv6=!!r.disableIPv6}records(){var r=[this.RecordPTR(this),this.RecordSRV(this),this.RecordTXT(this)];for(let i of this.subtypes||[])r.push(this.RecordSubtypePTR(this,i));let n=Object.values(uy.default.networkInterfaces());for(let i of n){let m=i;for(let c of m){if(c.internal||c.mac==="00:00:00:00:00:00")continue;switch(c.family){case"IPv4":r.push(this.RecordA(this,c.address));break;case"IPv6":if(this.disableIPv6)break;r.push(this.RecordAAAA(this,c.address));break}}}return r}RecordPTR(r){return{name:`${r.type}${am}`,type:"PTR",ttl:28800,data:r.fqdn}}RecordSubtypePTR(r,n){return{name:`_${n}._sub.${r.type}${am}`,type:"PTR",ttl:28800,data:`${r.name}.${r.type}${am}`}}RecordSRV(r){return{name:r.fqdn,type:"SRV",ttl:120,data:{port:r.port,target:r.host}}}RecordTXT(r){return{name:r.fqdn,type:"TXT",ttl:4500,data:this.txtService.encode(r.txt)}}RecordA(r,n){return{name:r.host,type:"A",ttl:120,data:n}}RecordAAAA(r,n){return{name:r.host,type:"AAAA",ttl:120,data:n}}}en.Service=Yc;en.default=Yc});var by=nr((fn)=>{var ty=fn&&fn.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(fn,"__esModule",{value:!0});fn.Registry=void 0;var lS=ty(pm()),Jc=ty(Zc()),yS=3600000,jS=3,IS=function(){};class Oc{constructor(r){this.services=[],this.server=r}publish(r){function n(c,l,y){if(c.activated)return;if(c.activated=!0,l.services.push(c),!(c instanceof Jc.default))return;if(y===null||y===void 0?void 0:y.probe)l.probe(l.server.mdns,c,(j)=>{if(j){if(c.stop!==void 0)c.stop();console.log(Error("Service name is already in use on the network"));return}l.announce(l.server,c)});else l.announce(l.server,c)}function i(c,l,y){if(!y)y=IS;if(!c.activated)return process.nextTick(y);if(!(c instanceof Jc.default))return process.nextTick(y);l.teardown(l.server,c,y);let j=l.services.indexOf(c);if(j!==-1)l.services.splice(j,1)}let m=new Jc.default(r);return m.start=n.bind(null,m,this),m.stop=i.bind(null,m,this),m.start({probe:r.probe!==!1}),m}unpublishAll(r){this.teardown(this.server,this.services,r),this.services=[]}destroy(){this.services.map((r)=>r.destroyed=!0)}probe(r,n,i){var m=!1,c=0,l;let y=()=>{if(!n.activated||n.destroyed)return;r.query(n.fqdn,"ANY",function(){m=!0,l=setTimeout(++c<3?y:S,250),l.unref()})},j=(v)=>{if(!m)return;if(v.answers.some(A)||v.additionals.some(A))S(!0)},A=(v)=>{return(0,lS.default)(v.name,n.fqdn)},S=(v)=>{r.removeListener("response",j),clearTimeout(l),i(!!v)};r.on("response",j),setTimeout(y,Math.random()*250)}announce(r,n){var i=1000,m=n.records();r.register(m);let c=()=>{if(!n.activated||n.destroyed)return;r.mdns.respond(m,function(){if(!n.published)n.activated=!0,n.published=!0,n.emit("up");if(i=i*jS,i<yS&&!n.destroyed)setTimeout(c,i).unref()})};c()}teardown(r,n,i){if(!Array.isArray(n))n=[n];n=n.filter((c)=>c.activated);var m=n.flatMap(function(c){c.activated=!1;var l=c.records();return l.forEach((y)=>{y.ttl=0}),l});if(m.length===0)return i&&process.nextTick(i);r.unregister(m),r.mdns.respond(m,function(){if(n.forEach(function(c){c.published=!1}),typeof i==="function")i.apply(null,arguments)})}}fn.Registry=Oc;fn.default=Oc});var ey=nr((AS)=>{AS.toString=function(r){switch(r){case 1:return"A";case 10:return"NULL";case 28:return"AAAA";case 18:return"AFSDB";case 42:return"APL";case 257:return"CAA";case 60:return"CDNSKEY";case 59:return"CDS";case 37:return"CERT";case 5:return"CNAME";case 49:return"DHCID";case 32769:return"DLV";case 39:return"DNAME";case 48:return"DNSKEY";case 43:return"DS";case 55:return"HIP";case 13:return"HINFO";case 45:return"IPSECKEY";case 25:return"KEY";case 36:return"KX";case 29:return"LOC";case 15:return"MX";case 35:return"NAPTR";case 2:return"NS";case 47:return"NSEC";case 50:return"NSEC3";case 51:return"NSEC3PARAM";case 12:return"PTR";case 46:return"RRSIG";case 17:return"RP";case 24:return"SIG";case 6:return"SOA";case 99:return"SPF";case 33:return"SRV";case 44:return"SSHFP";case 32768:return"TA";case 249:return"TKEY";case 52:return"TLSA";case 250:return"TSIG";case 16:return"TXT";case 252:return"AXFR";case 251:return"IXFR";case 41:return"OPT";case 255:return"ANY"}return"UNKNOWN_"+r};AS.toType=function(r){switch(r.toUpperCase()){case"A":return 1;case"NULL":return 10;case"AAAA":return 28;case"AFSDB":return 18;case"APL":return 42;case"CAA":return 257;case"CDNSKEY":return 60;case"CDS":return 59;case"CERT":return 37;case"CNAME":return 5;case"DHCID":return 49;case"DLV":return 32769;case"DNAME":return 39;case"DNSKEY":return 48;case"DS":return 43;case"HIP":return 55;case"HINFO":return 13;case"IPSECKEY":return 45;case"KEY":return 25;case"KX":return 36;case"LOC":return 29;case"MX":return 15;case"NAPTR":return 35;case"NS":return 2;case"NSEC":return 47;case"NSEC3":return 50;case"NSEC3PARAM":return 51;case"PTR":return 12;case"RRSIG":return 46;case"RP":return 17;case"SIG":return 24;case"SOA":return 6;case"SPF":return 99;case"SRV":return 33;case"SSHFP":return 44;case"TA":return 32768;case"TKEY":return 249;case"TLSA":return 52;case"TSIG":return 250;case"TXT":return 16;case"AXFR":return 252;case"IXFR":return 251;case"OPT":return 41;case"ANY":return 255;case"*":return 255}if(r.toUpperCase().startsWith("UNKNOWN_"))return parseInt(r.slice(8));return 0}});var sy=nr((wS)=>{wS.toString=function(r){switch(r){case 0:return"NOERROR";case 1:return"FORMERR";case 2:return"SERVFAIL";case 3:return"NXDOMAIN";case 4:return"NOTIMP";case 5:return"REFUSED";case 6:return"YXDOMAIN";case 7:return"YXRRSET";case 8:return"NXRRSET";case 9:return"NOTAUTH";case 10:return"NOTZONE";case 11:return"RCODE_11";case 12:return"RCODE_12";case 13:return"RCODE_13";case 14:return"RCODE_14";case 15:return"RCODE_15"}return"RCODE_"+r};wS.toRcode=function(r){switch(r.toUpperCase()){case"NOERROR":return 0;case"FORMERR":return 1;case"SERVFAIL":return 2;case"NXDOMAIN":return 3;case"NOTIMP":return 4;case"REFUSED":return 5;case"YXDOMAIN":return 6;case"YXRRSET":return 7;case"NXRRSET":return 8;case"NOTAUTH":return 9;case"NOTZONE":return 10;case"RCODE_11":return 11;case"RCODE_12":return 12;case"RCODE_13":return 13;case"RCODE_14":return 14;case"RCODE_15":return 15}return 0}});var fy=nr((NS)=>{NS.toString=function(r){switch(r){case 0:return"QUERY";case 1:return"IQUERY";case 2:return"STATUS";case 3:return"OPCODE_3";case 4:return"NOTIFY";case 5:return"UPDATE";case 6:return"OPCODE_6";case 7:return"OPCODE_7";case 8:return"OPCODE_8";case 9:return"OPCODE_9";case 10:return"OPCODE_10";case 11:return"OPCODE_11";case 12:return"OPCODE_12";case 13:return"OPCODE_13";case 14:return"OPCODE_14";case 15:return"OPCODE_15"}return"OPCODE_"+r};NS.toOpcode=function(r){switch(r.toUpperCase()){case"QUERY":return 0;case"IQUERY":return 1;case"STATUS":return 2;case"OPCODE_3":return 3;case"NOTIFY":return 4;case"UPDATE":return 5;case"OPCODE_6":return 6;case"OPCODE_7":return 7;case"OPCODE_8":return 8;case"OPCODE_9":return 9;case"OPCODE_10":return 10;case"OPCODE_11":return 11;case"OPCODE_12":return 12;case"OPCODE_13":return 13;case"OPCODE_14":return 14;case"OPCODE_15":return 15}return 0}});var rj=nr((DS)=>{DS.toString=function(r){switch(r){case 1:return"IN";case 2:return"CS";case 3:return"CH";case 4:return"HS";case 255:return"ANY"}return"UNKNOWN_"+r};DS.toClass=function(r){switch(r.toUpperCase()){case"IN":return 1;case"CS":return 2;case"CH":return 3;case"HS":return 4;case"ANY":return 255}return 0}});var nj=nr((CS)=>{CS.toString=function(r){switch(r){case 1:return"LLQ";case 2:return"UL";case 3:return"NSID";case 5:return"DAU";case 6:return"DHU";case 7:return"N3U";case 8:return"CLIENT_SUBNET";case 9:return"EXPIRE";case 10:return"COOKIE";case 11:return"TCP_KEEPALIVE";case 12:return"PADDING";case 13:return"CHAIN";case 14:return"KEY_TAG";case 26946:return"DEVICEID"}if(r<0)return null;return`OPTION_${r}`};CS.toCode=function(r){if(typeof r==="number")return r;if(!r)return-1;switch(r.toUpperCase()){case"OPTION_0":return 0;case"LLQ":return 1;case"UL":return 2;case"NSID":return 3;case"OPTION_4":return 4;case"DAU":return 5;case"DHU":return 6;case"N3U":return 7;case"CLIENT_SUBNET":return 8;case"EXPIRE":return 9;case"COOKIE":return 10;case"TCP_KEEPALIVE":return 11;case"PADDING":return 12;case"CHAIN":return 13;case"KEY_TAG":return 14;case"DEVICEID":return 26946;case"OPTION_65535":return 65535}let n=r.match(/_(\d+)$/);if(n)return parseInt(n[1],10);return-1}});var cj=nr((mj,Lc)=>{var ij=function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.decode=w,r.encode=v,r.familyOf=S,r.name=void 0,r.sizeOf=A,r.v6=r.v4=void 0;let n=/^(\d{1,3}\.){3,3}\d{1,3}$/,i=4,m=/^(::)?(((\d{1,3}\.){3}(\d{1,3}){1})?([0-9a-f]){0,4}:{0,2}){1,8}(::)?$/i,c=16,l={name:"v4",size:i,isFormat:(N)=>n.test(N),encode(N,E,Q){Q=~~Q,E=E||new Uint8Array(Q+i);let W=N.length,H=0;for(let X=0;X<W;){let K=N.charCodeAt(X++);if(K===46)E[Q++]=H,H=0;else H=H*10+(K-48)}return E[Q]=H,E},decode(N,E){return E=~~E,`${N[E++]}.${N[E++]}.${N[E++]}.${N[E]}`}};r.v4=l;let y={name:"v6",size:c,isFormat:(N)=>N.length>0&&m.test(N),encode(N,E,Q){Q=~~Q;let W=Q+c,H=-1,X=0,K=0,J=!0,q=!1;E=E||new Uint8Array(Q+c);for(let z=0;z<N.length;z++){let L=N.charCodeAt(z);if(L===58){if(J){if(H!==-1){if(Q<W)E[Q]=0;if(Q<W-1)E[Q+1]=0;Q+=2}else if(Q<W)H=Q}else{if(q===!0){if(Q<W)E[Q]=K;Q++}else{if(Q<W)E[Q]=X>>8;if(Q<W-1)E[Q+1]=X&255;Q+=2}X=0,K=0}J=!0,q=!1}else if(L===46){if(Q<W)E[Q]=K;Q++,K=0,X=0,J=!1,q=!0}else{if(J=!1,L>=97)L-=87;else if(L>=65)L-=55;else L-=48,K=K*10+L;X=(X<<4)+L}}if(J===!1)if(q===!0){if(Q<W)E[Q]=K;Q++}else{if(Q<W)E[Q]=X>>8;if(Q<W-1)E[Q+1]=X&255;Q+=2}else if(H===0){if(Q<W)E[Q]=0;if(Q<W-1)E[Q+1]=0;Q+=2}else if(H!==-1){Q+=2;for(let z=Math.min(Q-1,W-1);z>=H+2;z--)E[z]=E[z-2];E[H]=0,E[H+1]=0,H=Q}if(H!==Q&&H!==-1){if(Q>W-2)Q=W-2;while(W>H)E[--W]=Q<W&&Q>H?E[--Q]:0}else while(Q<W)E[Q++]=0;return E},decode(N,E){E=~~E;let Q="";for(let W=0;W<c;W+=2){if(W!==0)Q+=":";Q+=(N[E+W]<<8|N[E+W+1]).toString(16)}return Q.replace(/(^|:)0(:0)*:0(:|$)/,"$1::$3").replace(/:{3,4}/,"::")}};r.v6=y;let j="ip";r.name=j;function A(N){if(l.isFormat(N))return l.size;if(y.isFormat(N))return y.size;throw Error(`Invalid ip address: ${N}`)}function S(N){return A(N)===l.size?1:2}function v(N,E,Q){Q=~~Q;let W=A(N);if(typeof E==="function")E=E(Q+W);if(W===l.size)return l.encode(N,E,Q);return y.encode(N,E,Q)}function w(N,E,Q){if(E=~~E,Q=Q||N.length-E,Q===l.size)return l.decode(N,E,Q);if(Q===y.size)return y.decode(N,E,Q);throw Error(`Invalid buffer size needs to be ${l.size} for v4 or ${y.size} for v6.`)}return"default"in r?r.default:r}({});if(typeof define==="function"&&define.amd)define([],function(){return ij});else if(typeof Lc==="object"&&typeof mj==="object")Lc.exports=ij});var lj=nr((YS)=>{var Y=sn("buffer").Buffer,Cn=ey(),KS=sy(),HS=fy(),dm=rj(),gc=nj(),ri=cj(),R=YS.name={};R.encode=function(r,n,i,{mail:m=!1}={}){if(!n)n=Y.alloc(R.encodingLength(r));if(!i)i=0;let c=i,l=r.replace(/^\.|\.$/gm,"");if(l.length){let y=[];if(m){let j="";l.split(".").forEach((A)=>{if(A.endsWith("\\"))j+=(j.length?".":"")+A.slice(0,-1);else if(y.length===0&&j.length)y.push(j+"."+A);else y.push(A)})}else y=l.split(".");for(let j=0;j<y.length;j++){let A=n.write(y[j],i+1);n[i]=A,i+=A+1}}return n[i++]=0,R.encode.bytes=i-c,n};R.encode.bytes=0;R.decode=function(r,n,{mail:i=!1}={}){if(!n)n=0;let m=[],c=n,l=0,y=0,j=!1;while(!0){if(n>=r.length)throw Error("Cannot decode name (buffer overflow)");let A=r[n++];if(y+=j?0:1,A===0)break;else if((A&192)===0){if(n+A>r.length)throw Error("Cannot decode name (buffer overflow)");if(l+=A+1,l>254)throw Error("Cannot decode name (name too long)");let S=r.toString("utf-8",n,n+A);if(i)S=S.replace(/\./g,"\\.");m.push(S),n+=A,y+=j?0:A}else if((A&192)===192){if(n+1>r.length)throw Error("Cannot decode name (buffer overflow)");let S=r.readUInt16BE(n-1)-49152;if(S>=c)throw Error("Cannot decode name (bad pointer)");n=S,c=S,y+=j?0:1,j=!0}else throw Error("Cannot decode name (bad label)")}return R.decode.bytes=y,m.length===0?".":m.join(".")};R.decode.bytes=0;R.encodingLength=function(r){if(r==="."||r==="..")return 1;return Y.byteLength(r.replace(/^\.|\.$/gm,""))+2};var O={};O.encode=function(r,n,i){if(!n)n=Y.alloc(O.encodingLength(r));if(!i)i=0;let m=n.write(r,i+1);return n[i]=m,O.encode.bytes=m+1,n};O.encode.bytes=0;O.decode=function(r,n){if(!n)n=0;let i=r[n],m=r.toString("utf-8",n+1,n+1+i);return O.decode.bytes=i+1,m};O.decode.bytes=0;O.encodingLength=function(r){return Y.byteLength(r)+1};var ur={};ur.encode=function(r,n,i){if(!n)n=ur.encodingLength(r);if(!i)i=0;let m=(r.flags||0)&32767,c=r.type==="response"?32768:0;return n.writeUInt16BE(r.id||0,i),n.writeUInt16BE(m|c,i+2),n.writeUInt16BE(r.questions.length,i+4),n.writeUInt16BE(r.answers.length,i+6),n.writeUInt16BE(r.authorities.length,i+8),n.writeUInt16BE(r.additionals.length,i+10),n};ur.encode.bytes=12;ur.decode=function(r,n){if(!n)n=0;if(r.length<12)throw Error("Header must be 12 bytes");let i=r.readUInt16BE(n+2);return{id:r.readUInt16BE(n),type:i&32768?"response":"query",flags:i&32767,flag_qr:(i>>15&1)===1,opcode:HS.toString(i>>11&15),flag_aa:(i>>10&1)===1,flag_tc:(i>>9&1)===1,flag_rd:(i>>8&1)===1,flag_ra:(i>>7&1)===1,flag_z:(i>>6&1)===1,flag_ad:(i>>5&1)===1,flag_cd:(i>>4&1)===1,rcode:KS.toString(i&15),questions:Array(r.readUInt16BE(n+4)),answers:Array(r.readUInt16BE(n+6)),authorities:Array(r.readUInt16BE(n+8)),additionals:Array(r.readUInt16BE(n+10))}};ur.decode.bytes=12;ur.encodingLength=function(){return 12};var wn=YS.unknown={};wn.encode=function(r,n,i){if(!n)n=Y.alloc(wn.encodingLength(r));if(!i)i=0;return n.writeUInt16BE(r.length,i),r.copy(n,i+2),wn.encode.bytes=r.length+2,n};wn.encode.bytes=0;wn.decode=function(r,n){if(!n)n=0;let i=r.readUInt16BE(n),m=r.slice(n+2,n+2+i);return wn.decode.bytes=i+2,m};wn.decode.bytes=0;wn.encodingLength=function(r){return r.length+2};var $n=YS.ns={};$n.encode=function(r,n,i){if(!n)n=Y.alloc($n.encodingLength(r));if(!i)i=0;return R.encode(r,n,i+2),n.writeUInt16BE(R.encode.bytes,i),$n.encode.bytes=R.encode.bytes+2,n};$n.encode.bytes=0;$n.decode=function(r,n){if(!n)n=0;let i=r.readUInt16BE(n),m=R.decode(r,n+2);return $n.decode.bytes=i+2,m};$n.decode.bytes=0;$n.encodingLength=function(r){return R.encodingLength(r)+2};var Gn=YS.soa={};Gn.encode=function(r,n,i){if(!n)n=Y.alloc(Gn.encodingLength(r));if(!i)i=0;let m=i;return i+=2,R.encode(r.mname,n,i),i+=R.encode.bytes,R.encode(r.rname,n,i,{mail:!0}),i+=R.encode.bytes,n.writeUInt32BE(r.serial||0,i),i+=4,n.writeUInt32BE(r.refresh||0,i),i+=4,n.writeUInt32BE(r.retry||0,i),i+=4,n.writeUInt32BE(r.expire||0,i),i+=4,n.writeUInt32BE(r.minimum||0,i),i+=4,n.writeUInt16BE(i-m-2,m),Gn.encode.bytes=i-m,n};Gn.encode.bytes=0;Gn.decode=function(r,n){if(!n)n=0;let i=n,m={};return n+=2,m.mname=R.decode(r,n),n+=R.decode.bytes,m.rname=R.decode(r,n,{mail:!0}),n+=R.decode.bytes,m.serial=r.readUInt32BE(n),n+=4,m.refresh=r.readUInt32BE(n),n+=4,m.retry=r.readUInt32BE(n),n+=4,m.expire=r.readUInt32BE(n),n+=4,m.minimum=r.readUInt32BE(n),n+=4,Gn.decode.bytes=n-i,m};Gn.decode.bytes=0;Gn.encodingLength=function(r){return 22+R.encodingLength(r.mname)+R.encodingLength(r.rname)};var Nn=YS.txt={};Nn.encode=function(r,n,i){if(!Array.isArray(r))r=[r];for(let c=0;c<r.length;c++){if(typeof r[c]==="string")r[c]=Y.from(r[c]);if(!Y.isBuffer(r[c]))throw Error("Must be a Buffer")}if(!n)n=Y.alloc(Nn.encodingLength(r));if(!i)i=0;let m=i;return i+=2,r.forEach(function(c){n[i++]=c.length,c.copy(n,i,0,c.length),i+=c.length}),n.writeUInt16BE(i-m-2,m),Nn.encode.bytes=i-m,n};Nn.encode.bytes=0;Nn.decode=function(r,n){if(!n)n=0;let i=n,m=r.readUInt16BE(n);n+=2;let c=[];while(m>0){let l=r[n++];if(--m,m<l)throw Error("Buffer overflow");c.push(r.slice(n,n+l)),n+=l,m-=l}return Nn.decode.bytes=n-i,c};Nn.decode.bytes=0;Nn.encodingLength=function(r){if(!Array.isArray(r))r=[r];let n=2;return r.forEach(function(i){if(typeof i==="string")n+=Y.byteLength(i)+1;else n+=i.length+1}),n};var En=YS.null={};En.encode=function(r,n,i){if(!n)n=Y.alloc(En.encodingLength(r));if(!i)i=0;if(typeof r==="string")r=Y.from(r);if(!r)r=Y.alloc(0);let m=i;i+=2;let c=r.length;return r.copy(n,i,0,c),i+=c,n.writeUInt16BE(i-m-2,m),En.encode.bytes=i-m,n};En.encode.bytes=0;En.decode=function(r,n){if(!n)n=0;let i=n,m=r.readUInt16BE(n);n+=2;let c=r.slice(n,n+m);return n+=m,En.decode.bytes=n-i,c};En.decode.bytes=0;En.encodingLength=function(r){if(!r)return 2;return(Y.isBuffer(r)?r.length:Y.byteLength(r))+2};var Qn=YS.hinfo={};Qn.encode=function(r,n,i){if(!n)n=Y.alloc(Qn.encodingLength(r));if(!i)i=0;let m=i;return i+=2,O.encode(r.cpu,n,i),i+=O.encode.bytes,O.encode(r.os,n,i),i+=O.encode.bytes,n.writeUInt16BE(i-m-2,m),Qn.encode.bytes=i-m,n};Qn.encode.bytes=0;Qn.decode=function(r,n){if(!n)n=0;let i=n,m={};return n+=2,m.cpu=O.decode(r,n),n+=O.decode.bytes,m.os=O.decode(r,n),n+=O.decode.bytes,Qn.decode.bytes=n-i,m};Qn.decode.bytes=0;Qn.encodingLength=function(r){return O.encodingLength(r.cpu)+O.encodingLength(r.os)+2};var pr=YS.ptr={},RS=YS.cname=pr,VS=YS.dname=pr;pr.encode=function(r,n,i){if(!n)n=Y.alloc(pr.encodingLength(r));if(!i)i=0;return R.encode(r,n,i+2),n.writeUInt16BE(R.encode.bytes,i),pr.encode.bytes=R.encode.bytes+2,n};pr.encode.bytes=0;pr.decode=function(r,n){if(!n)n=0;let i=R.decode(r,n+2);return pr.decode.bytes=R.decode.bytes+2,i};pr.decode.bytes=0;pr.encodingLength=function(r){return R.encodingLength(r)+2};var Dn=YS.srv={};Dn.encode=function(r,n,i){if(!n)n=Y.alloc(Dn.encodingLength(r));if(!i)i=0;n.writeUInt16BE(r.priority||0,i+2),n.writeUInt16BE(r.weight||0,i+4),n.writeUInt16BE(r.port||0,i+6),R.encode(r.target,n,i+8);let m=R.encode.bytes+6;return n.writeUInt16BE(m,i),Dn.encode.bytes=m+2,n};Dn.encode.bytes=0;Dn.decode=function(r,n){if(!n)n=0;let i=r.readUInt16BE(n),m={};return m.priority=r.readUInt16BE(n+2),m.weight=r.readUInt16BE(n+4),m.port=r.readUInt16BE(n+6),m.target=R.decode(r,n+8),Dn.decode.bytes=i+2,m};Dn.decode.bytes=0;Dn.encodingLength=function(r){return 8+R.encodingLength(r.target)};var Zr=YS.caa={};Zr.ISSUER_CRITICAL=128;Zr.encode=function(r,n,i){let m=Zr.encodingLength(r);if(!n)n=Y.alloc(Zr.encodingLength(r));if(!i)i=0;if(r.issuerCritical)r.flags=Zr.ISSUER_CRITICAL;return n.writeUInt16BE(m-2,i),i+=2,n.writeUInt8(r.flags||0,i),i+=1,O.encode(r.tag,n,i),i+=O.encode.bytes,n.write(r.value,i),i+=Y.byteLength(r.value),Zr.encode.bytes=m,n};Zr.encode.bytes=0;Zr.decode=function(r,n){if(!n)n=0;let i=r.readUInt16BE(n);n+=2;let m=n,c={};return c.flags=r.readUInt8(n),n+=1,c.tag=O.decode(r,n),n+=O.decode.bytes,c.value=r.toString("utf-8",n,m+i),c.issuerCritical=!!(c.flags&Zr.ISSUER_CRITICAL),Zr.decode.bytes=i+2,c};Zr.decode.bytes=0;Zr.encodingLength=function(r){return O.encodingLength(r.tag)+O.encodingLength(r.value)+2};var Ln=YS.mx={};Ln.encode=function(r,n,i){if(!n)n=Y.alloc(Ln.encodingLength(r));if(!i)i=0;let m=i;return i+=2,n.writeUInt16BE(r.preference||0,i),i+=2,R.encode(r.exchange,n,i),i+=R.encode.bytes,n.writeUInt16BE(i-m-2,m),Ln.encode.bytes=i-m,n};Ln.encode.bytes=0;Ln.decode=function(r,n){if(!n)n=0;let i=n,m={};return n+=2,m.preference=r.readUInt16BE(n),n+=2,m.exchange=R.decode(r,n),n+=R.decode.bytes,Ln.decode.bytes=n-i,m};Ln.encodingLength=function(r){return 4+R.encodingLength(r.exchange)};var Un=YS.a={};Un.encode=function(r,n,i){if(!n)n=Y.alloc(Un.encodingLength(r));if(!i)i=0;return n.writeUInt16BE(4,i),i+=2,ri.v4.encode(r,n,i),Un.encode.bytes=6,n};Un.encode.bytes=0;Un.decode=function(r,n){if(!n)n=0;n+=2;let i=ri.v4.decode(r,n);return Un.decode.bytes=6,i};Un.decode.bytes=0;Un.encodingLength=function(){return 6};var Pn=YS.aaaa={};Pn.encode=function(r,n,i){if(!n)n=Y.alloc(Pn.encodingLength(r));if(!i)i=0;return n.writeUInt16BE(16,i),i+=2,ri.v6.encode(r,n,i),Pn.encode.bytes=18,n};Pn.encode.bytes=0;Pn.decode=function(r,n){if(!n)n=0;n+=2;let i=ri.v6.decode(r,n);return Pn.decode.bytes=18,i};Pn.decode.bytes=0;Pn.encodingLength=function(){return 18};var Kr=YS.option={};Kr.encode=function(r,n,i){if(!n)n=Y.alloc(Kr.encodingLength(r));if(!i)i=0;let m=i,c=gc.toCode(r.code);if(n.writeUInt16BE(c,i),i+=2,r.data)n.writeUInt16BE(r.data.length,i),i+=2,r.data.copy(n,i),i+=r.data.length;else switch(c){case 8:let l=r.sourcePrefixLength||0,y=r.family||ri.familyOf(r.ip),j=ri.encode(r.ip,Y.alloc),A=Math.ceil(l/8);n.writeUInt16BE(A+4,i),i+=2,n.writeUInt16BE(y,i),i+=2,n.writeUInt8(l,i++),n.writeUInt8(r.scopePrefixLength||0,i++),j.copy(n,i,0,A),i+=A;break;case 11:if(r.timeout)n.writeUInt16BE(2,i),i+=2,n.writeUInt16BE(r.timeout,i),i+=2;else n.writeUInt16BE(0,i),i+=2;break;case 12:let S=r.length||0;n.writeUInt16BE(S,i),i+=2,n.fill(0,i,i+S),i+=S;break;case 14:let v=r.tags.length*2;n.writeUInt16BE(v,i),i+=2;for(let w of r.tags)n.writeUInt16BE(w,i),i+=2;break;default:throw Error(`Unknown roption code: ${r.code}`)}return Kr.encode.bytes=i-m,n};Kr.encode.bytes=0;Kr.decode=function(r,n){if(!n)n=0;let i={};i.code=r.readUInt16BE(n),i.type=gc.toString(i.code),n+=2;let m=r.readUInt16BE(n);switch(n+=2,i.data=r.slice(n,n+m),i.code){case 8:i.family=r.readUInt16BE(n),n+=2,i.sourcePrefixLength=r.readUInt8(n++),i.scopePrefixLength=r.readUInt8(n++);let c=Y.alloc(i.family===1?4:16);r.copy(c,0,n,n+m-4),i.ip=ri.decode(c);break;case 11:if(m>0)i.timeout=r.readUInt16BE(n),n+=2;break;case 14:i.tags=[];for(let l=0;l<m;l+=2)i.tags.push(r.readUInt16BE(n)),n+=2}return Kr.decode.bytes=m+4,i};Kr.decode.bytes=0;Kr.encodingLength=function(r){if(r.data)return r.data.length+4;switch(gc.toCode(r.code)){case 8:let i=r.sourcePrefixLength||0;return Math.ceil(i/8)+8;case 11:return typeof r.timeout==="number"?6:4;case 12:return r.length+4;case 14:return 4+r.tags.length*2}throw Error(`Unknown roption code: ${r.code}`)};var Or=YS.opt={};Or.encode=function(r,n,i){if(!n)n=Y.alloc(Or.encodingLength(r));if(!i)i=0;let m=i,c=Gi(r,Kr);return n.writeUInt16BE(c,i),i=pi(r,Kr,n,i+2),Or.encode.bytes=i-m,n};Or.encode.bytes=0;Or.decode=function(r,n){if(!n)n=0;let i=n,m=[],c=r.readUInt16BE(n);n+=2;let l=0;while(c>0)m[l++]=Kr.decode(r,n),n+=Kr.decode.bytes,c-=Kr.decode.bytes;return Or.decode.bytes=n-i,m};Or.decode.bytes=0;Or.encodingLength=function(r){return 2+Gi(r||[],Kr)};var Ur=YS.dnskey={};Ur.PROTOCOL_DNSSEC=3;Ur.ZONE_KEY=128;Ur.SECURE_ENTRYPOINT=32768;Ur.encode=function(r,n,i){if(!n)n=Y.alloc(Ur.encodingLength(r));if(!i)i=0;let m=i,c=r.key;if(!Y.isBuffer(c))throw Error("Key must be a Buffer");return i+=2,n.writeUInt16BE(r.flags,i),i+=2,n.writeUInt8(Ur.PROTOCOL_DNSSEC,i),i+=1,n.writeUInt8(r.algorithm,i),i+=1,c.copy(n,i,0,c.length),i+=c.length,Ur.encode.bytes=i-m,n.writeUInt16BE(Ur.encode.bytes-2,m),n};Ur.encode.bytes=0;Ur.decode=function(r,n){if(!n)n=0;let i=n;var m={},c=r.readUInt16BE(n);if(n+=2,m.flags=r.readUInt16BE(n),n+=2,r.readUInt8(n)!==Ur.PROTOCOL_DNSSEC)throw Error("Protocol must be 3");return n+=1,m.algorithm=r.readUInt8(n),n+=1,m.key=r.slice(n,i+c+2),n+=m.key.length,Ur.decode.bytes=n-i,m};Ur.decode.bytes=0;Ur.encodingLength=function(r){return 6+Y.byteLength(r.key)};var sr=YS.rrsig={};sr.encode=function(r,n,i){if(!n)n=Y.alloc(sr.encodingLength(r));if(!i)i=0;let m=i,c=r.signature;if(!Y.isBuffer(c))throw Error("Signature must be a Buffer");return i+=2,n.writeUInt16BE(Cn.toType(r.typeCovered),i),i+=2,n.writeUInt8(r.algorithm,i),i+=1,n.writeUInt8(r.labels,i),i+=1,n.writeUInt32BE(r.originalTTL,i),i+=4,n.writeUInt32BE(r.expiration,i),i+=4,n.writeUInt32BE(r.inception,i),i+=4,n.writeUInt16BE(r.keyTag,i),i+=2,R.encode(r.signersName,n,i),i+=R.encode.bytes,c.copy(n,i,0,c.length),i+=c.length,sr.encode.bytes=i-m,n.writeUInt16BE(sr.encode.bytes-2,m),n};sr.encode.bytes=0;sr.decode=function(r,n){if(!n)n=0;let i=n;var m={},c=r.readUInt16BE(n);return n+=2,m.typeCovered=Cn.toString(r.readUInt16BE(n)),n+=2,m.algorithm=r.readUInt8(n),n+=1,m.labels=r.readUInt8(n),n+=1,m.originalTTL=r.readUInt32BE(n),n+=4,m.expiration=r.readUInt32BE(n),n+=4,m.inception=r.readUInt32BE(n),n+=4,m.keyTag=r.readUInt16BE(n),n+=2,m.signersName=R.decode(r,n),n+=R.decode.bytes,m.signature=r.slice(n,i+c+2),n+=m.signature.length,sr.decode.bytes=n-i,m};sr.decode.bytes=0;sr.encodingLength=function(r){return 20+R.encodingLength(r.signersName)+Y.byteLength(r.signature)};var fr=YS.rp={};fr.encode=function(r,n,i){if(!n)n=Y.alloc(fr.encodingLength(r));if(!i)i=0;let m=i;return i+=2,R.encode(r.mbox||".",n,i,{mail:!0}),i+=R.encode.bytes,R.encode(r.txt||".",n,i),i+=R.encode.bytes,fr.encode.bytes=i-m,n.writeUInt16BE(fr.encode.bytes-2,m),n};fr.encode.bytes=0;fr.decode=function(r,n){if(!n)n=0;let i=n,m={};return n+=2,m.mbox=R.decode(r,n,{mail:!0})||".",n+=R.decode.bytes,m.txt=R.decode(r,n)||".",n+=R.decode.bytes,fr.decode.bytes=n-i,m};fr.decode.bytes=0;fr.encodingLength=function(r){return 2+R.encodingLength(r.mbox||".")+R.encodingLength(r.txt||".")};var jr={};jr.encode=function(r,n,i){if(!n)n=Y.alloc(jr.encodingLength(r));if(!i)i=0;let m=i;var c=[];for(var l=0;l<r.length;l++){var y=Cn.toType(r[l]);if(c[y>>8]===void 0)c[y>>8]=[];c[y>>8][y>>3&31]|=1<<7-(y&7)}for(l=0;l<c.length;l++)if(c[l]!==void 0){var j=Y.from(c[l]);n.writeUInt8(l,i),i+=1,n.writeUInt8(j.length,i),i+=1,j.copy(n,i),i+=j.length}return jr.encode.bytes=i-m,n};jr.encode.bytes=0;jr.decode=function(r,n,i){if(!n)n=0;let m=n;var c=[];while(n-m<i){var l=r.readUInt8(n);n+=1;var y=r.readUInt8(n);n+=1;for(var j=0;j<y;j++){var A=r.readUInt8(n+j);for(var S=0;S<8;S++)if(A&1<<7-S){var v=Cn.toString(l<<8|j<<3|S);c.push(v)}}n+=y}return jr.decode.bytes=n-m,c};jr.decode.bytes=0;jr.encodingLength=function(r){var n=[];for(var i=0;i<r.length;i++){var m=Cn.toType(r[i]);n[m>>8]=Math.max(n[m>>8]||0,m&255)}var c=0;for(i=0;i<n.length;i++)if(n[i]!==void 0)c+=2+Math.ceil((n[i]+1)/8);return c};var rn=YS.nsec={};rn.encode=function(r,n,i){if(!n)n=Y.alloc(rn.encodingLength(r));if(!i)i=0;let m=i;return i+=2,R.encode(r.nextDomain,n,i),i+=R.encode.bytes,jr.encode(r.rrtypes,n,i),i+=jr.encode.bytes,rn.encode.bytes=i-m,n.writeUInt16BE(rn.encode.bytes-2,m),n};rn.encode.bytes=0;rn.decode=function(r,n){if(!n)n=0;let i=n;var m={},c=r.readUInt16BE(n);return n+=2,m.nextDomain=R.decode(r,n),n+=R.decode.bytes,m.rrtypes=jr.decode(r,n,c-(n-i)),n+=jr.decode.bytes,rn.decode.bytes=n-i,m};rn.decode.bytes=0;rn.encodingLength=function(r){return 2+R.encodingLength(r.nextDomain)+jr.encodingLength(r.rrtypes)};var nn=YS.nsec3={};nn.encode=function(r,n,i){if(!n)n=Y.alloc(nn.encodingLength(r));if(!i)i=0;let m=i,c=r.salt;if(!Y.isBuffer(c))throw Error("salt must be a Buffer");let l=r.nextDomain;if(!Y.isBuffer(l))throw Error("nextDomain must be a Buffer");return i+=2,n.writeUInt8(r.algorithm,i),i+=1,n.writeUInt8(r.flags,i),i+=1,n.writeUInt16BE(r.iterations,i),i+=2,n.writeUInt8(c.length,i),i+=1,c.copy(n,i,0,c.length),i+=c.length,n.writeUInt8(l.length,i),i+=1,l.copy(n,i,0,l.length),i+=l.length,jr.encode(r.rrtypes,n,i),i+=jr.encode.bytes,nn.encode.bytes=i-m,n.writeUInt16BE(nn.encode.bytes-2,m),n};nn.encode.bytes=0;nn.decode=function(r,n){if(!n)n=0;let i=n;var m={},c=r.readUInt16BE(n);n+=2,m.algorithm=r.readUInt8(n),n+=1,m.flags=r.readUInt8(n),n+=1,m.iterations=r.readUInt16BE(n),n+=2;let l=r.readUInt8(n);n+=1,m.salt=r.slice(n,n+l),n+=l;let y=r.readUInt8(n);return n+=1,m.nextDomain=r.slice(n,n+y),n+=y,m.rrtypes=jr.decode(r,n,c-(n-i)),n+=jr.decode.bytes,nn.decode.bytes=n-i,m};nn.decode.bytes=0;nn.encodingLength=function(r){return 8+r.salt.length+r.nextDomain.length+jr.encodingLength(r.rrtypes)};var mn=YS.ds={};mn.encode=function(r,n,i){if(!n)n=Y.alloc(mn.encodingLength(r));if(!i)i=0;let m=i,c=r.digest;if(!Y.isBuffer(c))throw Error("Digest must be a Buffer");return i+=2,n.writeUInt16BE(r.keyTag,i),i+=2,n.writeUInt8(r.algorithm,i),i+=1,n.writeUInt8(r.digestType,i),i+=1,c.copy(n,i,0,c.length),i+=c.length,mn.encode.bytes=i-m,n.writeUInt16BE(mn.encode.bytes-2,m),n};mn.encode.bytes=0;mn.decode=function(r,n){if(!n)n=0;let i=n;var m={},c=r.readUInt16BE(n);return n+=2,m.keyTag=r.readUInt16BE(n),n+=2,m.algorithm=r.readUInt8(n),n+=1,m.digestType=r.readUInt8(n),n+=1,m.digest=r.slice(n,i+c+2),n+=m.digest.length,mn.decode.bytes=n-i,m};mn.decode.bytes=0;mn.encodingLength=function(r){return 6+Y.byteLength(r.digest)};var Jr=YS.sshfp={};Jr.getFingerprintLengthForHashType=function(n){switch(n){case 1:return 20;case 2:return 32}};Jr.encode=function(n,i,m){if(!i)i=Y.alloc(Jr.encodingLength(n));if(!m)m=0;let c=m;m+=2,i[m]=n.algorithm,m+=1,i[m]=n.hash,m+=1;let l=Y.from(n.fingerprint.toUpperCase(),"hex");if(l.length!==Jr.getFingerprintLengthForHashType(n.hash))throw Error("Invalid fingerprint length");return l.copy(i,m),m+=l.byteLength,Jr.encode.bytes=m-c,i.writeUInt16BE(Jr.encode.bytes-2,c),i};Jr.encode.bytes=0;Jr.decode=function(n,i){if(!i)i=0;let m=i,c={};i+=2,c.algorithm=n[i],i+=1,c.hash=n[i],i+=1;let l=Jr.getFingerprintLengthForHashType(c.hash);return c.fingerprint=n.slice(i,i+l).toString("hex").toUpperCase(),i+=l,Jr.decode.bytes=i-m,c};Jr.decode.bytes=0;Jr.encodingLength=function(r){return 4+Y.from(r.fingerprint,"hex").byteLength};var cn=YS.naptr={};cn.encode=function(r,n,i){if(!n)n=Y.alloc(cn.encodingLength(r));if(!i)i=0;let m=i;return i+=2,n.writeUInt16BE(r.order||0,i),i+=2,n.writeUInt16BE(r.preference||0,i),i+=2,O.encode(r.flags,n,i),i+=O.encode.bytes,O.encode(r.services,n,i),i+=O.encode.bytes,O.encode(r.regexp,n,i),i+=O.encode.bytes,R.encode(r.replacement,n,i),i+=R.encode.bytes,cn.encode.bytes=i-m,n.writeUInt16BE(cn.encode.bytes-2,m),n};cn.encode.bytes=0;cn.decode=function(r,n){if(!n)n=0;let i=n,m={};return n+=2,m.order=r.readUInt16BE(n),n+=2,m.preference=r.readUInt16BE(n),n+=2,m.flags=O.decode(r,n),n+=O.decode.bytes,m.services=O.decode(r,n),n+=O.decode.bytes,m.regexp=O.decode(r,n),n+=O.decode.bytes,m.replacement=R.decode(r,n),n+=R.decode.bytes,cn.decode.bytes=n-i,m};cn.decode.bytes=0;cn.encodingLength=function(r){return O.encodingLength(r.flags)+O.encodingLength(r.services)+O.encodingLength(r.regexp)+R.encodingLength(r.replacement)+6};var ln=YS.tlsa={};ln.encode=function(r,n,i){if(!n)n=Y.alloc(ln.encodingLength(r));if(!i)i=0;let m=i,c=r.certificate;if(!Y.isBuffer(c))throw Error("Certificate must be a Buffer");return i+=2,n.writeUInt8(r.usage,i),i+=1,n.writeUInt8(r.selector,i),i+=1,n.writeUInt8(r.matchingType,i),i+=1,c.copy(n,i,0,c.length),i+=c.length,ln.encode.bytes=i-m,n.writeUInt16BE(ln.encode.bytes-2,m),n};ln.encode.bytes=0;ln.decode=function(r,n){if(!n)n=0;let i=n,m={},c=r.readUInt16BE(n);return n+=2,m.usage=r.readUInt8(n),n+=1,m.selector=r.readUInt8(n),n+=1,m.matchingType=r.readUInt8(n),n+=1,m.certificate=r.slice(n,i+c+2),n+=m.certificate.length,ln.decode.bytes=n-i,m};ln.decode.bytes=0;ln.encodingLength=function(r){return 5+Y.byteLength(r.certificate)};var Fc=YS.record=function(r){switch(r.toUpperCase()){case"A":return Un;case"PTR":return pr;case"CNAME":return RS;case"DNAME":return VS;case"TXT":return Nn;case"NULL":return En;case"AAAA":return Pn;case"SRV":return Dn;case"HINFO":return Qn;case"CAA":return Zr;case"NS":return $n;case"SOA":return Gn;case"MX":return Ln;case"OPT":return Or;case"DNSKEY":return Ur;case"RRSIG":return sr;case"RP":return fr;case"NSEC":return rn;case"NSEC3":return nn;case"SSHFP":return Jr;case"DS":return mn;case"NAPTR":return cn;case"TLSA":return ln}return wn},vr=YS.answer={};vr.encode=function(r,n,i){if(!n)n=Y.alloc(vr.encodingLength(r));if(!i)i=0;let m=i;if(R.encode(r.name,n,i),i+=R.encode.bytes,n.writeUInt16BE(Cn.toType(r.type),i),r.type.toUpperCase()==="OPT"){if(r.name!==".")throw Error("OPT name must be root.");n.writeUInt16BE(r.udpPayloadSize||4096,i+2),n.writeUInt8(r.extendedRcode||0,i+4),n.writeUInt8(r.ednsVersion||0,i+5),n.writeUInt16BE(r.flags||0,i+6),i+=8,Or.encode(r.options||[],n,i),i+=Or.encode.bytes}else{let c=dm.toClass(r.class===void 0?"IN":r.class);if(r.flush)c|=32768;n.writeUInt16BE(c,i+2),n.writeUInt32BE(r.ttl||0,i+4),i+=8;let l=Fc(r.type);l.encode(r.data,n,i),i+=l.encode.bytes}return vr.encode.bytes=i-m,n};vr.encode.bytes=0;vr.decode=function(r,n){if(!n)n=0;let i={},m=n;if(i.name=R.decode(r,n),n+=R.decode.bytes,i.type=Cn.toString(r.readUInt16BE(n)),i.type==="OPT")i.udpPayloadSize=r.readUInt16BE(n+2),i.extendedRcode=r.readUInt8(n+4),i.ednsVersion=r.readUInt8(n+5),i.flags=r.readUInt16BE(n+6),i.flag_do=(i.flags>>15&1)===1,i.options=Or.decode(r,n+8),n+=8+Or.decode.bytes;else{let c=r.readUInt16BE(n+2);i.ttl=r.readUInt32BE(n+4),i.class=dm.toString(c&-32769),i.flush=!!(c&32768);let l=Fc(i.type);i.data=l.decode(r,n+8),n+=8+l.decode.bytes}return vr.decode.bytes=n-m,i};vr.decode.bytes=0;vr.encodingLength=function(r){let n=r.data!==null&&r.data!==void 0?r.data:r.options;return R.encodingLength(r.name)+8+Fc(r.type).encodingLength(n)};var ar=YS.question={};ar.encode=function(r,n,i){if(!n)n=Y.alloc(ar.encodingLength(r));if(!i)i=0;let m=i;return R.encode(r.name,n,i),i+=R.encode.bytes,n.writeUInt16BE(Cn.toType(r.type),i),i+=2,n.writeUInt16BE(dm.toClass(r.class===void 0?"IN":r.class),i),i+=2,ar.encode.bytes=i-m,r};ar.encode.bytes=0;ar.decode=function(r,n){if(!n)n=0;let i=n,m={};if(m.name=R.decode(r,n),n+=R.decode.bytes,m.type=Cn.toString(r.readUInt16BE(n)),n+=2,m.class=dm.toString(r.readUInt16BE(n)),n+=2,!!(m.class&32768))m.class&=-32769;return ar.decode.bytes=n-i,m};ar.decode.bytes=0;ar.encodingLength=function(r){return R.encodingLength(r.name)+4};YS.AUTHORITATIVE_ANSWER=1024;YS.TRUNCATED_RESPONSE=512;YS.RECURSION_DESIRED=256;YS.RECURSION_AVAILABLE=128;YS.AUTHENTIC_DATA=32;YS.CHECKING_DISABLED=16;YS.DNSSEC_OK=32768;YS.encode=function(r,n,i){let m=!n;if(m)n=Y.alloc(YS.encodingLength(r));if(!i)i=0;let c=i;if(!r.questions)r.questions=[];if(!r.answers)r.answers=[];if(!r.authorities)r.authorities=[];if(!r.additionals)r.additionals=[];if(ur.encode(r,n,i),i+=ur.encode.bytes,i=pi(r.questions,ar,n,i),i=pi(r.answers,vr,n,i),i=pi(r.authorities,vr,n,i),i=pi(r.additionals,vr,n,i),YS.encode.bytes=i-c,m&&YS.encode.bytes!==n.length)return n.slice(0,YS.encode.bytes);return n};YS.encode.bytes=0;YS.decode=function(r,n){if(!n)n=0;let i=n,m=ur.decode(r,n);return n+=ur.decode.bytes,n=um(m.questions,ar,r,n),n=um(m.answers,vr,r,n),n=um(m.authorities,vr,r,n),n=um(m.additionals,vr,r,n),YS.decode.bytes=n-i,m};YS.decode.bytes=0;YS.encodingLength=function(r){return ur.encodingLength(r)+Gi(r.questions||[],ar)+Gi(r.answers||[],vr)+Gi(r.authorities||[],vr)+Gi(r.additionals||[],vr)};YS.streamEncode=function(r){let n=YS.encode(r),i=Y.alloc(2);i.writeUInt16BE(n.byteLength);let m=Y.concat([i,n]);return YS.streamEncode.bytes=m.byteLength,m};YS.streamEncode.bytes=0;YS.streamDecode=function(r){let n=r.readUInt16BE(0);if(r.byteLength<n+2)return null;let i=YS.decode(r.slice(2));return YS.streamDecode.bytes=YS.decode.bytes,i};YS.streamDecode.bytes=0;function Gi(r,n){let i=0;for(let m=0;m<r.length;m++)i+=n.encodingLength(r[m]);return i}function pi(r,n,i,m){for(let c=0;c<r.length;c++)n.encode(r[c],i,m),m+=n.encode.bytes;return m}function um(r,n,i,m){for(let c=0;c<r.length;c++)r[c]=n.decode(i,m),m+=n.decode.bytes;return m}});var Ij=nr((nD,jj)=>{var yj=BS;process.nextTick(hS,42);jj.exports=zS;function zS(r){var n=m;return i;function i(c){n(c||MS)}function m(c){var l=[c];n=y,r(j);function y(A){l.push(A)}function j(A){var S=arguments;n=oS(A)?m:v;while(l.length)v(l.shift());function v(w){yj(TS,w,S)}}}}function oS(r){return Object.prototype.toString.call(r)==="[object Error]"}function MS(){}function TS(r,n){r.apply(null,n)}function hS(r){if(r===42)yj=process.nextTick}function BS(r,n,i){process.nextTick(function(){r(n,i)})}});var vj=nr((iD,Sj)=>{var zc=lj(),xS=sn("dgram"),kS=Ij(),pS=sn("events"),Mc=sn("os"),oc=function(){};Sj.exports=function(r){if(!r)r={};var n=new pS.EventEmitter,i=typeof r.port==="number"?r.port:5353,m=r.type||"udp4",c=r.ip||r.host||(m==="udp4"?"224.0.0.251":null),l={address:c,port:i},y={},j=!1,A=null;if(m==="udp6"&&(!c||!r.interface))throw Error("For IPv6 multicast you must specify `ip` and `interface`");var S=r.socket||xS.createSocket({type:m,reuseAddr:r.reuseAddr!==!1,toString:function(){return m}});S.on("error",function(w){if(w.code==="EACCES"||w.code==="EADDRINUSE")n.emit("error",w);else n.emit("warning",w)}),S.on("message",function(w,N){try{w=zc.decode(w)}catch(E){n.emit("warning",E);return}if(n.emit("packet",w,N),w.type==="query")n.emit("query",w,N);if(w.type==="response")n.emit("response",w,N)}),S.on("listening",function(){if(!i)i=l.port=S.address().port;if(r.multicast!==!1)n.update(),A=setInterval(n.update,5000),S.setMulticastTTL(r.ttl||255),S.setMulticastLoopback(r.loopback!==!1)});var v=kS(function(w){if(!i||r.bind===!1)return w(null);S.once("error",w),S.bind(i,r.bind||r.interface,function(){S.removeListener("error",w),w(null)})});return v(function(w){if(w)return n.emit("error",w);n.emit("ready")}),n.send=function(w,N,E){if(typeof N==="function")return n.send(w,null,N);if(!E)E=oc;if(!N)N=l;else if(!N.host&&!N.address)N.address=l.address;v(Q);function Q(W){if(j)return E();if(W)return E(W);var H=zc.encode(w);S.send(H,0,H.length,N.port,N.address||N.host,E)}},n.response=n.respond=function(w,N,E){if(Array.isArray(w))w={answers:w};w.type="response",w.flags=(w.flags||0)|zc.AUTHORITATIVE_ANSWER,n.send(w,N,E)},n.query=function(w,N,E,Q){if(typeof N==="function")return n.query(w,null,null,N);if(typeof N==="object"&&N&&N.port)return n.query(w,null,N,E);if(typeof E==="function")return n.query(w,N,null,E);if(!Q)Q=oc;if(typeof w==="string")w=[{name:w,type:N||"ANY"}];if(Array.isArray(w))w={type:"query",questions:w};w.type="query",n.send(w,E,Q)},n.destroy=function(w){if(!w)w=oc;if(j)return process.nextTick(w);j=!0,clearInterval(A);for(var N in y)try{S.dropMembership(c,N)}catch(E){}y={},S.close(w)},n.update=function(){var w=r.interface?[].concat(r.interface):uS(),N=!1;for(var E=0;E<w.length;E++){var Q=w[E];if(y[Q])continue;try{S.addMembership(c,Q),y[Q]=!0,N=!0}catch(W){n.emit("warning",W)}}if(N){if(S.setMulticastInterface)try{S.setMulticastInterface(r.interface||aS())}catch(W){n.emit("warning",W)}n.emit("networkInterface")}},n};function aS(){var r=Mc.networkInterfaces(),n=Object.keys(r);for(var i=0;i<n.length;i++){var m=r[n[i]];for(var c=0;c<m.length;c++){var l=m[c];if(Aj(l.family)&&!l.internal){if(Mc.platform()==="darwin"&&n[i]==="en0")return l.address;return"0.0.0.0"}}}return"127.0.0.1"}function uS(){var r=Mc.networkInterfaces(),n=Object.keys(r),i=[];for(var m=0;m<n.length;m++){var c=r[n[m]];for(var l=0;l<c.length;l++){var y=c[l];if(Aj(y.family)){i.push(y.address);break}}}return i}function Aj(r){return r===4||r==="IPv4"}});var $j=nr((mD,wj)=>{wj.exports=function r(n,i){if(n===i)return!0;if(n&&i&&typeof n=="object"&&typeof i=="object"){if(n.constructor!==i.constructor)return!1;var m,c,l;if(Array.isArray(n)){if(m=n.length,m!=i.length)return!1;for(c=m;c--!==0;)if(!r(n[c],i[c]))return!1;return!0}if(n instanceof Map&&i instanceof Map){if(n.size!==i.size)return!1;for(c of n.entries())if(!i.has(c[0]))return!1;for(c of n.entries())if(!r(c[1],i.get(c[0])))return!1;return!0}if(n instanceof Set&&i instanceof Set){if(n.size!==i.size)return!1;for(c of n.entries())if(!i.has(c[0]))return!1;return!0}if(ArrayBuffer.isView(n)&&ArrayBuffer.isView(i)){if(m=n.length,m!=i.length)return!1;for(c=m;c--!==0;)if(n[c]!==i[c])return!1;return!0}if(n.constructor===RegExp)return n.source===i.source&&n.flags===i.flags;if(n.valueOf!==Object.prototype.valueOf)return n.valueOf()===i.valueOf();if(n.toString!==Object.prototype.toString)return n.toString()===i.toString();if(l=Object.keys(n),m=l.length,m!==Object.keys(i).length)return!1;for(c=m;c--!==0;)if(!Object.prototype.hasOwnProperty.call(i,l[c]))return!1;for(c=m;c--!==0;){var y=l[c];if(!r(n[y],i[y]))return!1}return!0}return n!==n&&i!==i}});var Gj=nr((ni)=>{var Tc=ni&&ni.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ni,"__esModule",{value:!0});ni.Server=void 0;var dS=Tc(vj()),tS=Tc($j()),bS=Tc(pm());class hc{constructor(r,n){this.registry={},this.mdns=(0,dS.default)(r),this.mdns.setMaxListeners(0),this.mdns.on("query",this.respondToQuery.bind(this)),this.errorCallback=n!==null&&n!==void 0?n:function(i){throw i}}register(r){let n=(i)=>{var m=this.registry[i.type];if(!m)m=this.registry[i.type]=[];else if(m.some(this.isDuplicateRecord(i)))return;m.push(i)};if(Array.isArray(r))r.forEach(n);else n(r)}unregister(r){let n=(i)=>{let m=i.type;if(!(m in this.registry))return;this.registry[m]=this.registry[m].filter((c)=>c.name!==i.name)};if(Array.isArray(r))r.forEach(n);else n(r)}respondToQuery(r){let n=this;r.questions.forEach((i)=>{var{type:m,name:c}=i,l=m==="ANY"?Object.keys(n.registry).map(n.recordsFor.bind(n,c)).flat(1):n.recordsFor(c,m);if(l.length===0)return;var y=[];if(m!=="ANY")l.forEach((j)=>{if(j.type!=="PTR")return;y=y.concat(n.recordsFor(j.data,"SRV")).concat(n.recordsFor(j.data,"TXT"))}),y.filter(function(j){return j.type==="SRV"}).map(function(j){return j.data.target}).filter(this.unique()).forEach(function(j){y=y.concat(n.recordsFor(j,"A")).concat(n.recordsFor(j,"AAAA"))});n.mdns.respond({answers:l,additionals:y},(j)=>{if(j)this.errorCallback(j)})})}recordsFor(r,n){if(!(n in this.registry))return[];return this.registry[n].filter((i)=>{var m=~r.indexOf(".")?i.name:i.name.split(".")[0];return(0,bS.default)(m,r)})}isDuplicateRecord(r){return(n)=>{return r.type===n.type&&r.name===n.name&&(0,tS.default)(r.data,n.data)}}unique(){var r=[];return(n)=>{if(~r.indexOf(n))return!1;return r.push(n),!0}}}ni.Server=hc;ni.default=hc});var Ej=nr((Nj)=>{Object.defineProperty(Nj,"__esModule",{value:!0});Nj.default=(r,n)=>{if(n===void 0)return!0;let i=r.txt,m=Object.entries(n).map(([c,l])=>{let y=i[c];if(y===void 0)return!1;if(l!=y)return!1;return!0});if(m.length==0)return!0;if(m.includes(!1))return!1;return!0}});var Dj=nr((Qj)=>{Object.defineProperty(Qj,"__esModule",{value:!0});Qj.default=(r)=>Object.keys(r).filter((n)=>!n.includes("binary")).reduce((n,i)=>{return Object.assign(n,{[i]:r[i]})},{})});var Pj=nr((Uj)=>{Object.defineProperty(Uj,"__esModule",{value:!0});Uj.default=fS;function fS(r,n){if(r===void 0||n===void 0)return!1;let i=Object.keys(r),m=Object.keys(n);if(i.length!=m.length)return!1;for(let c of i)if(r[c]!=n[c])return!1;return!0}});var Xj=nr((ii)=>{var ui=ii&&ii.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ii,"__esModule",{value:!0});ii.Browser=void 0;var nv=ui(Rc()),qn=ui(pm()),iv=sn("events"),Bc=Vc(),Cj=ui(Ej()),mv=ui(Dj()),cv=ui(Pj()),Wj=".local",lv="_services._dns-sd._udp"+Wj;class tm extends iv.EventEmitter{constructor(r,n,i){super();if(this.onresponse=void 0,this.serviceMap={},this.wildcard=!1,this._services=[],typeof n==="function")return new tm(r,null,n);if(this.mdns=r,this.txt=new nv.default(n!==null&&n.txt!=null?n.txt:void 0),n===null||n.type===void 0)this.name=lv,this.wildcard=!0;else{if(this.name=(0,Bc.toString)({name:n.type,protocol:n.protocol||"tcp"})+Wj,n.name)this.name=n.name+"."+this.name;this.wildcard=!1}if(n!=null&&n.txt!==void 0)this.txtQuery=(0,mv.default)(n.txt);if(i)this.on("up",i);this.start()}start(){if(this.onresponse||this.name===void 0)return;var r=this,n={};if(!this.wildcard)n[this.name]=!0;this.onresponse=(i,m)=>{if(r.wildcard)i.answers.forEach((c)=>{if(c.type!=="PTR"||c.name!==r.name||c.name in n)return;n[c.data]=!0,r.mdns.query(c.data,"PTR")});Object.keys(n).forEach(function(c){r.goodbyes(c,i).forEach(r.removeService.bind(r));var l=r.buildServicesFor(c,i,r.txt,m);if(l.length===0)return;l.forEach((y)=>{if(r.serviceMap[y.fqdn]){r.updateService(y);return}r.addService(y)})})},this.mdns.on("response",this.onresponse),this.update()}stop(){if(!this.onresponse)return;this.mdns.removeListener("response",this.onresponse),this.onresponse=void 0}update(){this.mdns.query(this.name,"PTR")}get services(){return this._services}addService(r){if((0,Cj.default)(r,this.txtQuery)===!1)return;this._services.push(r),this.serviceMap[r.fqdn]=!0,this.emit("up",r)}updateService(r){var n;if((0,cv.default)(r.txt,((n=this._services.find((i)=>(0,qn.default)(i.fqdn,r.fqdn)))===null||n===void 0?void 0:n.txt)||{}))return;if(!(0,Cj.default)(r,this.txtQuery)){this.removeService(r.fqdn);return}this._services=this._services.map(function(i){if(!(0,qn.default)(i.fqdn,r.fqdn))return i;return r}),this.emit("txt-update",r)}removeService(r){var n,i;if(this._services.some(function(m,c){if((0,qn.default)(m.fqdn,r))return n=m,i=c,!0}),!n||i===void 0)return;this._services.splice(i,1),delete this.serviceMap[r],this.emit("down",n)}goodbyes(r,n){return n.answers.concat(n.additionals).filter((i)=>i.type==="PTR"&&i.ttl===0&&(0,qn.default)(i.name,r)).map((i)=>i.data)}buildServicesFor(r,n,i,m){var c=n.answers.concat(n.additionals).filter((l)=>l.ttl>0);return c.filter((l)=>l.type==="PTR"&&(0,qn.default)(l.name,r)).map((l)=>{let y={addresses:[],subtypes:[]};if(c.filter((j)=>{return j.type==="PTR"&&(0,qn.default)(j.data,l.data)&&j.name.includes("._sub")}).forEach((j)=>{let A=(0,Bc.toType)(j.name);y.subtypes.push(A.subtype)}),c.filter((j)=>{return(j.type==="SRV"||j.type==="TXT")&&(0,qn.default)(j.name,l.data)}).forEach((j)=>{if(j.type==="SRV"){var A=j.name.split("."),S=A[0],v=(0,Bc.toType)(A.slice(1,-1).join("."));y.name=S,y.fqdn=j.name,y.host=j.data.target,y.referer=m,y.port=j.data.port,y.type=v.name,y.protocol=v.protocol}else if(j.type==="TXT")y.rawTxt=j.data,y.txt=this.txt.decodeAll(j.data)}),!y.name)return;return c.filter((j)=>(j.type==="A"||j.type==="AAAA")&&(0,qn.default)(j.name,y.host)).forEach((j)=>y.addresses.push(j.data)),y}).filter((l)=>!!l)}}ii.Browser=tm;ii.default=tm});var Kj=nr((dr)=>{var bm=dr&&dr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(dr,"__esModule",{value:!0});dr.Browser=dr.Service=dr.Bonjour=void 0;var yv=bm(by()),jv=bm(Gj()),xc=bm(Xj());dr.Browser=xc.default;var Iv=bm(Zc());dr.Service=Iv.default;class kc{constructor(r={},n){this.server=new jv.default(r,n),this.registry=new yv.default(this.server)}publish(r){return this.registry.publish(r)}unpublishAll(r){return this.registry.unpublishAll(r)}find(r=null,n){return new xc.default(this.server.mdns,r,n)}findOne(r=null,n=1e4,i){let m=new xc.default(this.server.mdns,r);var c;return m.once("up",(l)=>{if(c!==void 0)clearTimeout(c);if(m.stop(),i)i(l)}),c=setTimeout(()=>{if(m.stop(),i)i(null)},n),m}destroy(r){this.registry.destroy(),this.server.mdns.destroy(r)}}dr.Bonjour=kc;dr.default=kc});var bl={};Nr(bl,{url:()=>vA,openapi:()=>p$,listen:()=>a$,Server:()=>bl,Default:()=>x$});var cc=(r)=>{let n=r.split("/");if(n[0]==="")n.shift();return n},el=(r)=>{let{groups:n,path:i}=wA(r),m=cc(i);return $A(m,n)},wA=(r)=>{let n=[];return r=r.replace(/\{[^}]+\}/g,(i,m)=>{let c=`@${m}`;return n.push([c,i]),c}),{groups:n,path:r}},$A=(r,n)=>{for(let i=n.length-1;i>=0;i--){let[m]=n[i];for(let c=r.length-1;c>=0;c--)if(r[c].includes(m)){r[c]=r[c].replace(m,n[i][1]);break}}return r},gm={},sl=(r,n)=>{if(r==="*")return"*";let i=r.match(/^\:([^\{\}]+)(?:\{(.+)\})?$/);if(i){let m=`${r}#${n}`;if(!gm[m])if(i[2])gm[m]=n&&n[0]!==":"&&n[0]!=="*"?[m,i[1],new RegExp(`^${i[2]}(?=/${n})`)]:[r,i[1],new RegExp(`^${i[2]}$`)];else gm[m]=[r,i[1],!0];return gm[m]}return null},vi=(r,n)=>{try{return n(r)}catch{return r.replace(/(?:%[0-9A-Fa-f]{2})+/g,(i)=>{try{return n(i)}catch{return i}})}},fl=(r)=>vi(r,decodeURI),lc=(r)=>{let n=r.url,i=n.indexOf("/",n.indexOf(":")+4),m=i;for(;m<n.length;m++){let c=n.charCodeAt(m);if(c===37){let l=n.indexOf("?",m),y=n.indexOf("#",m),j=l===-1?y===-1?void 0:y:y===-1?l:Math.min(l,y),A=n.slice(i,j);return fl(A.includes("%25")?A.replace(/%25/g,"%2525"):A)}else if(c===63||c===35)break}return n.slice(i,m)};var ry=(r)=>{let n=lc(r);return n.length>1&&n.at(-1)==="/"?n.slice(0,-1):n},On=(r,n,...i)=>{if(i.length)n=On(n,...i);return`${r?.[0]==="/"?"":"/"}${r}${n==="/"?"":`${r?.at(-1)==="/"?"":"/"}${n?.[0]==="/"?n.slice(1):n}`}`},Fm=(r)=>{if(r.charCodeAt(r.length-1)!==63||!r.includes(":"))return null;let n=r.split("/"),i=[],m="";return n.forEach((c)=>{if(c!==""&&!/\:/.test(c))m+="/"+c;else if(/\:/.test(c))if(/\?/.test(c)){if(i.length===0&&m==="")i.push("/");else i.push(m);let l=c.replace("?","");m+="/"+l,i.push(m)}else m+="/"+c}),i.filter((c,l,y)=>y.indexOf(c)===l)},mc=(r)=>{if(!/[%+]/.test(r))return r;if(r.indexOf("+")!==-1)r=r.replace(/\+/g," ");return r.indexOf("%")!==-1?vi(r,oi):r},ny=(r,n,i)=>{let m;if(!i&&n&&!/[%+]/.test(n)){let y=r.indexOf("?",8);if(y===-1)return;if(!r.startsWith(n,y+1))y=r.indexOf(`&${n}`,y+1);while(y!==-1){let j=r.charCodeAt(y+n.length+1);if(j===61){let A=y+n.length+2,S=r.indexOf("&",A);return mc(r.slice(A,S===-1?void 0:S))}else if(j==38||isNaN(j))return"";y=r.indexOf(`&${n}`,y+1)}if(m=/[%+]/.test(r),!m)return}let c={};m??=/[%+]/.test(r);let l=r.indexOf("?",8);while(l!==-1){let y=r.indexOf("&",l+1),j=r.indexOf("=",l);if(j>y&&y!==-1)j=-1;let A=r.slice(l+1,j===-1?y===-1?void 0:y:j);if(m)A=mc(A);if(l=y,A==="")continue;let S;if(j===-1)S="";else if(S=r.slice(j+1,y===-1?void 0:y),m)S=mc(S);if(i){if(!(c[A]&&Array.isArray(c[A])))c[A]=[];c[A].push(S)}else c[A]??=S}return n?c[n]:c},iy=ny,my=(r,n)=>{return ny(r,n,!0)},oi=decodeURIComponent;var GA=/^[\w!#$%&'*.^`|~+-]+$/,NA=/^[ !#-:<-[\]-~]*$/,cy=(r)=>{let n=0,i=r.length;while(n<i){let m=r.charCodeAt(n);if(m!==32&&m!==9)break;n++}while(i>n){let m=r.charCodeAt(i-1);if(m!==32&&m!==9)break;i--}return n===0&&i===r.length?r:r.slice(n,i)},yc=(r,n)=>{if(n&&r.indexOf(n)===-1)return{};let i=r.split(";"),m=Object.create(null);for(let c of i){let l=c.indexOf("=");if(l===-1)continue;let y=cy(c.substring(0,l));if(n&&n!==y||!GA.test(y)||y in m)continue;let j=cy(c.substring(l+1));if(j.startsWith('"')&&j.endsWith('"'))j=j.slice(1,-1);if(NA.test(j)){if(m[y]=j.indexOf("%")!==-1?vi(j,oi):j,n)break}}return m};var ly=(r,n,i)=>{let m=r.req.raw.headers.get("Cookie");if(typeof n==="string"){if(!m)return;let l=n;if(i==="secure")l="__Secure-"+n;else if(i==="host")l="__Host-"+n;return yc(m,l)[l]}if(!m)return{};return yc(m)};var kr=class extends Error{res;status;constructor(r=500,n){super(n?.message,{cause:n?.cause});this.res=n?.res,this.status=r}getResponse(){if(this.res)return new Response(this.res.body,{status:this.status,headers:this.res.headers});return new Response(this.message,{status:this.status})}};var jc=async(r)=>{return await EA(r,{name:"SHA-256",alias:"sha256"})};var EA=async(r,n)=>{let i;if(ArrayBuffer.isView(r)||r instanceof ArrayBuffer)i=r;else{if(typeof r==="object")r=JSON.stringify(r);i=new TextEncoder().encode(String(r))}if(crypto&&crypto.subtle){let m=await crypto.subtle.digest({name:n.name},i);return Array.prototype.map.call(new Uint8Array(m),(l)=>("00"+l.toString(16)).slice(-2)).join("")}return null};var yy=(r,n)=>{let i=r.length,m=n.length,c=Math.max(i,m),l=i^m;for(let y=0;y<c;y++){let j=y<i?r.charCodeAt(y):0,A=y<m?n.charCodeAt(y):0;l|=j^A}return l===0},jy=async(r,n,i)=>{if(!i)i=jc;let[m,c]=await Promise.all([i(r),i(n)]);if(m==null||c==null||typeof m!=="string"||typeof c!=="string")return!1;let l=yy(m,c),y=yy(r,n);return l&&y},Ic=async(r,n,i)=>{if(typeof r==="string"&&typeof n==="string")return jy(r,n,i);if(!i)i=jc;let[m,c]=await Promise.all([i(r),i(n)]);if(!m||!c||typeof m!=="string"||typeof c!=="string")return!1;return jy(m,c)};var zm=(r,n)=>{return new Response(r,{headers:{"Content-Type":n.replace(/^[^;]+/,(m)=>m.toLowerCase())}}).formData()};var QA=/^application\/([a-z-\.]+\+)?json(;\s*[a-zA-Z0-9\-]+\=([^;]+))*$/i,DA=/^multipart\/form-data(;\s?boundary=[a-zA-Z0-9'"()+_,\-./:=?]+)?$/i,UA=/^application\/x-www-form-urlencoded(;\s*[a-zA-Z0-9\-]+\=([^;]+))*$/i,Ac=(r,n)=>{return async(i,m)=>{let c={},l=i.req.header("Content-Type");switch(r){case"json":if(!l||!QA.test(l))break;try{c=await i.req.json()}catch{throw new kr(400,{message:"Malformed JSON in request body"})}break;case"form":{if(!l||!(DA.test(l)||UA.test(l)))break;let j;if(i.req.bodyCache.formData)j=await i.req.bodyCache.formData;else try{let S=await i.req.arrayBuffer();j=await zm(S,l),i.req.bodyCache.formData=j}catch(S){let v="Malformed FormData request.";throw v+=S instanceof Error?` ${S.message}`:` ${String(S)}`,new kr(400,{message:v})}let A=Object.create(null);j.forEach((S,v)=>{if(v.endsWith("[]"))(A[v]??=[]).push(S);else if(Array.isArray(A[v]))A[v].push(S);else if(Object.hasOwn(A,v))A[v]=[A[v],S];else A[v]=S}),c=A;break}case"query":c=Object.fromEntries(Object.entries(i.req.queries()).map(([j,A])=>{return A.length===1?[j,A[0]]:[j,A]}));break;case"param":c=i.req.param();break;case"header":c=i.req.header();break;case"cookie":c=ly(i);break}let y=await n(c,i);if(y instanceof Response)return y;return i.req.addValidatedData(r,y),await m()}};var Iy={header:["cookie"]};function PA(r,n,i){if(!(i in Iy))return r;let m=Iy[i]||[];if(n==="arktype")return CA(r,m);if(n==="valibot")return WA(r,m);return r}function CA(r,n){return r.map((i)=>{if(i&&typeof i==="object"&&"data"in i&&typeof i.data==="object"&&i.data!==null&&!Array.isArray(i.data)){let m={...i.data};for(let l of n)delete m[l];let c=Object.create(Object.getPrototypeOf(i));return Object.assign(c,i,{data:m}),c}return i})}function WA(r,n){return r.map((i)=>{if(i&&typeof i==="object"&&"path"in i&&Array.isArray(i.path)){for(let m of i.path)if(typeof m==="object"&&"input"in m&&typeof m.input==="object"&&m.input!==null&&!Array.isArray(m.input))for(let c of n)delete m.input[c]}return i})}var Ay=(r,n,i)=>Ac(r,async(m,c)=>{let l=await n["~standard"].validate(m);if(i){let y=await i(l.issues?{data:m,error:l.issues,success:!1,target:r}:{data:m,success:!0,target:r},c);if(y){if(y instanceof Response)return y;if("response"in y)return y.response}}if(l.issues){let y=PA(l.issues,n["~standard"].vendor,r);return c.json({data:m,error:y,success:!1},400)}return l.value});var vc=Symbol("openapi"),KA=["GET","PUT","POST","DELETE","OPTIONS","HEAD","PATCH","TRACE"],HA=(r)=>r.split("/").map((n)=>{let i=n;if(i.startsWith(":")){let m=i.match(/^:([^{?]+)(?:{(.+)})?(\?)?$/);if(m)i=`{${m[1]}}`;else{if(i=i.slice(1,i.length),i.endsWith("?"))i=i.slice(0,-1);i=`{${i}}`}}return i}).join("/"),Sy=(r)=>r.charAt(0).toUpperCase()+r.slice(1),RA=(r)=>{let n=r.method.toLowerCase();if(r.path==="/")return`${n}Index`;for(let i of r.path.split("/"))if(i.charCodeAt(0)===123)n+=`By${Sy(i.slice(1,-1))}`;else n+=Sy(i);return n},VA=(r)=>("$ref"in r)?r.$ref:`${r.in} ${r.name}`;function vy(...r){let n=r.flatMap((i)=>i??[]).reduce((i,m)=>{return i.set(VA(m),m),i},new Map);return Array.from(n.values())}var wi=new Map;function YA(r){let n=[];for(let[i,m]of wi)if(m&&r.match(i))n.push(m);return n}function ZA(){wi.clear()}function wy(r,...n){return n.reduce((i,m)=>{if(!m||!i)return i;for(let[c,l]of Object.entries(m)){if(l==null)continue;if(c in i&&(typeof l==="object"||typeof l==="function"&&c==="operationId"))if(Array.isArray(l)){let y=[...i[c]??[],...l];if(c==="tags")i[c]=Array.from(new Set(y));else if(c==="parameters")i[c]=vy(y);else i[c]=y}else if(typeof l==="function")i[c]=l(r);else if(c==="parameters")i[c]=vy(i[c],l);else i[c]={...i[c],...l};else i[c]=l}return i},{operationId:RA(r)})}function $y({route:r,specs:n,paths:i}){let m=HA(r.path),c=r.method.toLowerCase();if(c==="all"){if(!n)return;if(wi.has(m)){let l=wi.get(m)??{};wi.set(m,wy(r,l,n))}else wi.set(m,n)}else{let l=YA(m);if(!(m in i))i[m]={};if(i[m])i[m][c]=wy(r,...l,i[m]?.[c],n)}}function JA(r,n){let{exclude:i,excludeStaticFile:m}=n.options,c={},l=Array.isArray(i)?i:[i];for(let[y,j]of Object.entries(r)){if(j==null)continue;if(l.some((v)=>{if(typeof v==="string")return y===v;return v.test(y)}))continue;if(y.includes("*")&&!y.includes("{"))continue;if(m){let v=y.includes("{"),N=(y.split("/").pop()||"").includes(".");if(!v&&N)continue}for(let v of Object.keys(j)){let w=j[v];if(w==null)continue;if(y.includes("{")){w.parameters=w.parameters?[...w.parameters]:[];let N=y.split("/").filter((E)=>E.startsWith("{")&&!w.parameters.find((Q)=>Q.in==="path"&&Q.name===E.slice(1,E.length-1)));for(let E of N){let Q=E.slice(1,E.length-1);if(w.parameters.findIndex((H)=>{if("$ref"in H){let X=H.$ref.split("/").pop();if(X){let K=n.components.parameters?.[X];if(K&&!("$ref"in K))return K.in==="path"&&K.name===Q}return!1}return H.in==="path"&&H.name===Q})===-1)w.parameters.push({schema:{type:"string"},in:"path",name:Q,required:!0})}}if(!w.responses)w.responses={200:{}}}c[y]=j}return c}var Gy={documentation:{},excludeStaticFile:!0,exclude:[],excludeMethods:["OPTIONS"],excludeTags:[]};function Qy(r,n){let i;return async(m)=>{if(i)return m.json(i);return i=await wc(r,n,m),m.json(i)}}async function wc(r,n=Gy,i){let m={components:{},options:{...Gy,...n}},c=m.options.documentation??{};ZA();let l=await OA(r,m);for(let j in l)for(let A in l[j])if(LA({valueOrFunc:l[j][A]?.hide,method:A,path:j,c:i}))l[j][A]=void 0;let y=$c(c.components,m.components);return{openapi:"3.1.0",...c,tags:c.tags?.filter((j)=>!m.options.excludeTags?.includes(j?.name)),info:{title:"Hono Documentation",description:"Development documentation",version:"0.0.0",...c.info},paths:{...JA(l,m),...c.paths},components:y}}async function OA(r,n){let i={};for(let m of r.routes){let c=m.handler[vc];if(!c){if(n.options.includeEmptyPaths)$y({route:m,paths:i});continue}let l=m.method;if(l!=="ALL"){if(n.options.excludeMethods?.includes(l))continue;if(!KA.includes(l))continue}let y=n.options.defaultOptions?.[l],{schema:j,components:A={}}=await qA(c,y);n.components=$c(n.components,A),$y({route:m,specs:j,paths:i})}return i}function LA(r){let{valueOrFunc:n,c:i,method:m,path:c}=r;if(n!=null){if(typeof n==="boolean")return n;if(typeof n==="function")return n({c:i,method:m,path:c})}return!1}async function qA(r,n){if("spec"in r){let c={},l={...n,...r.spec,responses:{...n?.responses,...r.spec.responses}};if(l.responses)for(let y of Object.keys(l.responses)){let j=l.responses[y];if(!j||!("content"in j))continue;for(let A of Object.keys(j.content??{})){let S=j.content?.[A];if(!S)continue;if(S.schema&&"toOpenAPISchema"in S.schema){let v=await S.schema.toOpenAPISchema();if(S.schema=v.schema,v.components)c=$c(c,v.components)}}}return{schema:l,components:c}}let i=await r.toOpenAPISchema(),m=n??{};if(r.target==="form"||r.target==="json"){let c=r.options?.media??r.target==="json"?"application/json":"multipart/form-data";if(!m.requestBody||!("content"in m.requestBody)||!m.requestBody.content)m.requestBody={content:{[c]:{schema:i.schema}}};else m.requestBody.content[c]={schema:i.schema}}else{let c=[];if("$ref"in i.schema){let y=i.schema.$ref.split("/").pop();if(y&&i.components?.schemas?.[y]){let j=i.components.schemas[y],A=Ny(r.target,j)[0];if(!i.components.parameters)i.components.parameters={};i.components.parameters[y]=A,delete i.components.schemas[y],c.push({$ref:`#/components/parameters/${y}`})}}else c=Ny(r.target,i.schema);m.parameters=c}return{schema:m,components:i.components}}function Ny(r,n){let i=[];for(let[m,c]of Object.entries(n.properties??{})){let l={in:r==="param"?"path":r,name:m,schema:c};if(n.required?.includes(m))l.required=!0;if(l.schema&&"description"in l.schema&&l.schema.description)l.description=l.schema.description,l.schema.description=void 0;i.push(l)}return i}function $c(...r){return r.reduce((n,i,m)=>{if(i==null||m===0)return n;if(n.schemas&&Object.keys(n.schemas).length>0||i.schemas&&Object.keys(i.schemas).length>0)n.schemas={...n.schemas,...i.schemas};if(n.parameters&&Object.keys(n.parameters).length>0||i.parameters&&Object.keys(i.parameters).length>0)n.parameters={...n.parameters,...i.parameters};return n},r[0]??{})}function $(r,n){return{vendor:r["~standard"].vendor,validate:r["~standard"].validate,toJSONSchema:(i)=>Ey(r,{...n,...i}),toOpenAPISchema:(i)=>Sc(r,{...n,...i})}}function D(r,n,i,m){let c=Ay(r,n,i);return Object.assign(c,{[vc]:{target:r,...$(n,m),options:m}})}function G(r){return Object.assign(async(i,m)=>{await m()},{[vc]:{spec:r}})}var Gc=(r,n,i)=>{return(m,c)=>{let l=-1;return y(0);async function y(j){if(j<=l)throw Error("next() called multiple times");l=j;let A,S=!1,v;if(r[j])v=r[j][0][0],m.req.routeIndex=j;else v=j===r.length&&c||void 0;if(v)try{A=await v(m,()=>y(j+1))}catch(w){if(w instanceof Error&&n)m.error=w,A=await n(w,m),S=!0;else throw w}else if(m.finalized===!1&&i)A=await i(m);if(A&&(m.finalized===!1||S))m.res=A;return m}}};var Dy=Symbol();var Nc=(r)=>("headers"in r),Uy=async(r,n=Object.create(null))=>{let{all:i=!1,dot:m=!1}=n,y=(Nc(r)?r.headers:r.raw.headers).get("Content-Type")?.split(";")[0].trim().toLowerCase();if(y==="multipart/form-data"||y==="application/x-www-form-urlencoded")return _A(r,{all:i,dot:m});return{}};async function _A(r,n){let i=Nc(r)?r.headers:r.raw.headers,m=await r.arrayBuffer(),c=zm(m,i.get("Content-Type")||"");if(!Nc(r))r.bodyCache.formData=c;let l=await c;if(l)return gA(l,n);return{}}function gA(r,n){let i=Object.create(null);if(r.forEach((m,c)=>{if(!(n.all||c.endsWith("[]")))i[c]=m;else FA(i,c,m)}),n.dot)Object.entries(i).forEach(([m,c])=>{if(m.includes("."))zA(i,m,c),delete i[m]});return i}var FA=(r,n,i)=>{if(r[n]!==void 0)if(Array.isArray(r[n]))r[n].push(i);else r[n]=[r[n],i];else if(!n.endsWith("[]"))r[n]=i;else r[n]=[i]},zA=(r,n,i)=>{if(/(?:^|\.)__proto__\./.test(n))return;let m=r,c=n.split(".");c.forEach((l,y)=>{if(y===c.length-1)m[l]=i;else{if(!m[l]||typeof m[l]!=="object"||Array.isArray(m[l])||m[l]instanceof File)m[l]=Object.create(null);m=m[l]}})};var Py=(r)=>vi(r,oi),Cy=class{raw;#r;#n;routeIndex=0;path;bodyCache={};constructor(r,n="/",i=[[]]){this.raw=r,this.path=n,this.#n=i,this.#r={}}param(r){return r?this.#i(r):this.#l()}#i(r){let n=this.#n[0][this.routeIndex][1][r],i=this.#c(n);return i&&/\%/.test(i)?Py(i):i}#l(){let r={},n=Object.keys(this.#n[0][this.routeIndex][1]);for(let i of n){let m=this.#c(this.#n[0][this.routeIndex][1][i]);if(m!==void 0)r[i]=/\%/.test(m)?Py(m):m}return r}#c(r){return this.#n[1]?this.#n[1][r]:r}query(r){return iy(this.url,r)}queries(r){return my(this.url,r)}header(r){if(r)return this.raw.headers.get(r)??void 0;let n={};return this.raw.headers.forEach((i,m)=>{n[m]=i}),n}async parseBody(r){return Uy(this,r)}#m=(r)=>{let{bodyCache:n,raw:i}=this,m=n[r];if(m)return m;let c=Object.keys(n)[0];if(c)return n[c].then((l)=>{if(c==="json")l=JSON.stringify(l);return new Response(l)[r]()});return n[r]=i[r]()};json(){return this.#m("text").then((r)=>JSON.parse(r))}text(){return this.#m("text")}arrayBuffer(){return this.#m("arrayBuffer")}bytes(){return this.#m("arrayBuffer").then((r)=>new Uint8Array(r))}blob(){return this.#m("blob")}formData(){return this.#m("formData")}addValidatedData(r,n){this.#r[r]=n}valid(r){return this.#r[r]}get url(){return this.raw.url}get method(){return this.raw.method}get[Dy](){return this.#n}get matchedRoutes(){return this.#n[0].map(([[,r]])=>r)}get routePath(){return this.#n[0].map(([[,r]])=>r)[this.routeIndex].path}};var om={Stringify:1,BeforeStream:2,Stream:3},Wy=(r,n)=>{let i=new String(r);return i.isEscaped=!0,i.callbacks=n,i};var Mi=async(r,n,i,m,c)=>{if(typeof r==="object"&&!(r instanceof String)){if(!(r instanceof Promise))r=r.toString();if(r instanceof Promise)r=await r}let l=r.callbacks;if(!l?.length)return Promise.resolve(r);if(c)c[0]+=r;else c=[r];let y=Promise.all(l.map((j)=>j({phase:n,buffer:c,context:m}))).then((j)=>Promise.all(j.filter(Boolean).map((A)=>Mi(A,n,!1,m,c))).then(()=>c[0]));if(i)return Wy(await y,l);else return y};var Xy="text/plain; charset=UTF-8",Ec=(r,n)=>{return{"Content-Type":r,...n}},Ti=(r,n)=>new Response(r,n),Qc=class{#r;#n;env={};#i;finalized=!1;error;#l;#c;#m;#S;#I;#A;#j;#v;#w;constructor(r,n){if(this.#r=r,n)this.#c=n.executionCtx,this.env=n.env,this.#A=n.notFoundHandler,this.#w=n.path,this.#v=n.matchResult}get req(){return this.#n??=new Cy(this.#r,this.#w,this.#v),this.#n}get event(){if(this.#c&&"respondWith"in this.#c)return this.#c;else throw Error("This context has no FetchEvent")}get executionCtx(){if(this.#c)return this.#c;else throw Error("This context has no ExecutionContext")}get res(){return this.#m||=Ti(null,{headers:this.#j??=new Headers})}set res(r){if(this.#m&&r){r=Ti(r.body,r);for(let[n,i]of this.#m.headers.entries()){if(n==="content-type")continue;if(n==="set-cookie"){let m=this.#m.headers.getSetCookie();r.headers.delete("set-cookie");for(let c of m)r.headers.append("set-cookie",c)}else r.headers.set(n,i)}}this.#m=r,this.finalized=!0}render=(...r)=>{return this.#I??=(n)=>this.html(n),this.#I(...r)};setLayout=(r)=>this.#S=r;getLayout=()=>this.#S;setRenderer=(r)=>{this.#I=r};header=(r,n,i)=>{if(this.finalized)this.#m=Ti(this.#m.body,this.#m);let m=this.#m?this.#m.headers:this.#j??=new Headers;if(n===void 0)m.delete(r);else if(i?.append)m.append(r,n);else m.set(r,n)};status=(r)=>{this.#l=r};set=(r,n)=>{this.#i??=new Map,this.#i.set(r,n)};get=(r)=>{return this.#i?this.#i.get(r):void 0};get var(){if(!this.#i)return{};return Object.fromEntries(this.#i)}#y(r,n,i){let m=this.#m?new Headers(this.#m.headers):this.#j??new Headers;if(typeof n==="object"&&"headers"in n){let l=n.headers instanceof Headers?n.headers:new Headers(n.headers);for(let[y,j]of l)if(y.toLowerCase()==="set-cookie")m.append(y,j);else m.set(y,j)}if(i)for(let[l,y]of Object.entries(i))if(typeof y==="string")m.set(l,y);else{m.delete(l);for(let j of y)m.append(l,j)}let c=typeof n==="number"?n:n?.status??this.#l;return Ti(r,{status:c,headers:m})}newResponse=(...r)=>this.#y(...r);body=(r,n,i)=>this.#y(r,n,i);text=(r,n,i)=>{return!this.#j&&!this.#l&&!n&&!i&&!this.finalized?new Response(r):this.#y(r,n,Ec(Xy,i))};json=(r,n,i)=>{return this.#y(JSON.stringify(r),n,Ec("application/json",i))};html=(r,n,i)=>{let m=(c)=>this.#y(c,n,Ec("text/html; charset=UTF-8",i));return typeof r==="object"?Mi(r,om.Stringify,!1,{}).then(m):m(r)};redirect=(r,n)=>{let i=String(r);return this.header("Location",!/[^\x00-\xFF]/.test(i)?i:encodeURI(i)),this.newResponse(null,n??302)};notFound=()=>{return this.#A??=()=>Ti(),this.#A(this)}};var B="ALL",Ky="all",Hy=["get","post","put","delete","options","patch"],Mm="Can not add a route since the matcher is already built.",Tm=class extends Error{};var Dc="__COMPOSED_HANDLER";var oA=(r)=>{return r.text("404 Not Found",404)},Ry=(r,n)=>{if("getResponse"in r){let i=r.getResponse();return n.newResponse(i.body,i)}return console.error(r),n.text("Internal Server Error",500)},Vy=class r{get;post;put;delete;options;patch;all;on;use;router;getPath;_basePath="/";#r="/";routes=[];constructor(n={}){[...Hy,Ky].forEach((l)=>{this[l]=(y,...j)=>{if(typeof y==="string")this.#r=y;else this.#l(l,this.#r,y);return j.forEach((A)=>{this.#l(l,this.#r,A)}),this}}),this.on=(l,y,...j)=>{for(let A of[y].flat()){this.#r=A;for(let S of[l].flat())j.map((v)=>{this.#l(S.toUpperCase(),this.#r,v)})}return this},this.use=(l,...y)=>{if(typeof l==="string")this.#r=l;else this.#r="*",y.unshift(l);return y.forEach((j)=>{this.#l(B,this.#r,j)}),this};let{strict:m,...c}=n;Object.assign(this,c),this.getPath=m??!0?n.getPath??lc:ry}#n(){let n=new r({router:this.router,getPath:this.getPath});return n.errorHandler=this.errorHandler,n.#i=this.#i,n.routes=this.routes,n}#i=oA;errorHandler=Ry;route(n,i){let m=this.basePath(n);return i.routes.map((c)=>{let l;if(i.errorHandler===Ry)l=c.handler;else l=async(y,j)=>(await Gc([],i.errorHandler)(y,()=>c.handler(y,j))).res,l[Dc]=c.handler;m.#l(c.method,c.path,l,c.basePath)}),this}basePath(n){let i=this.#n();return i._basePath=On(this._basePath,n),i}onError=(n)=>{return this.errorHandler=n,this};notFound=(n)=>{return this.#i=n,this};mount(n,i,m){let c,l;if(m)if(typeof m==="function")l=m;else if(l=m.optionHandler,m.replaceRequest===!1)c=(A)=>A;else c=m.replaceRequest;let y=l?(A)=>{let S=l(A);return Array.isArray(S)?S:[S]}:(A)=>{let S=void 0;try{S=A.executionCtx}catch{}return[A.env,S]};c||=(()=>{let A=On(this._basePath,n),S=A==="/"?0:A.length;return(v)=>{let w=new URL(v.url);return w.pathname=this.getPath(v).slice(S)||"/",new Request(w,v)}})();let j=async(A,S)=>{let v=await i(c(A.req.raw),...y(A));if(v)return v;await S()};return this.#l(B,On(n,"*"),j),this}#l(n,i,m,c){n=n.toUpperCase(),i=On(this._basePath,i);let l={basePath:c!==void 0?On(this._basePath,c):this._basePath,path:i,method:n,handler:m};this.router.add(n,i,[m,l]),this.routes.push(l)}#c(n,i){if(n instanceof Error)return this.errorHandler(n,i);throw n}#m(n,i,m,c){if(c==="HEAD")return(async()=>new Response(null,await this.#m(n,i,m,"GET")))();let l=this.getPath(n,{env:m}),y=this.router.match(c,l),j=new Qc(n,{path:l,matchResult:y,env:m,executionCtx:i,notFoundHandler:this.#i});if(y[0].length===1){let S;try{S=y[0][0][0][0](j,async()=>{j.res=await this.#i(j)})}catch(v){return this.#c(v,j)}return S instanceof Promise?S.then((v)=>v||(j.finalized?j.res:this.#i(j))).catch((v)=>this.#c(v,j)):S??this.#i(j)}let A=Gc(y[0],this.errorHandler,this.#i);return(async()=>{try{let S=await A(j);if(!S.finalized)throw Error("Context is not finalized. Did you forget to return a Response object or `await next()`?");return S.res}catch(S){return this.#c(S,j)}})()}fetch=(n,...i)=>{return this.#m(n,i[1],i[0],n.method)};request=(n,i,m,c)=>{if(n instanceof Request)return this.fetch(i?new Request(n,i):n,m,c);return n=n.toString(),this.fetch(new Request(/^https?:\/\//.test(n)?n:`http://localhost${On("/",n)}`,i),m,c)};fire=()=>{addEventListener("fetch",(n)=>{n.respondWith(this.#m(n.request,n,void 0,n.request.method))})}};var hi=[];function hm(r,n){let i=this.buildAllMatchers(),m=(c,l)=>{let y=i[c]||i[B],j=y[2][l];if(j)return j;let A=l.match(y[0]);if(!A)return[[],hi];let S=A.indexOf("",1);return[y[1][S],A]};return this.match=m,m(r,n)}var Bm="[^/]+",Bi=".*",xi="(?:|/.*)",bn=Symbol(),MA=new Set(".\\+*[^]$()");function TA(r,n){if(r.length===1)return n.length===1?r<n?-1:1:-1;if(n.length===1)return 1;if(r===Bi||r===xi)return 1;else if(n===Bi||n===xi)return-1;if(r===Bm)return 1;else if(n===Bm)return-1;return r.length===n.length?r<n?-1:1:n.length-r.length}var Yy=class r{#r;#n;#i=Object.create(null);insert(n,i,m,c,l){if(n.length===0){if(this.#r!==void 0)throw bn;if(l)return;this.#r=i;return}let[y,...j]=n,A=y==="*"?j.length===0?["","",Bi]:["","",Bm]:y==="/*"?["","",xi]:y.match(/^\:([^\{\}]+)(?:\{(.+)\})?$/),S;if(A){let v=A[1],w=A[2]||Bm;if(v&&A[2]){if(w===".*")throw bn;if(w=w.replace(/^\((?!\?:)(?=[^)]+\)$)/,"(?:"),/\((?!\?:)/.test(w))throw bn}if(S=this.#i[w],!S){if(Object.keys(this.#i).some((N)=>N!==Bi&&N!==xi))throw bn;if(l)return;if(S=this.#i[w]=new r,v!=="")S.#n=c.varIndex++}if(!l&&v!=="")m.push([v,S.#n])}else if(S=this.#i[y],!S){if(Object.keys(this.#i).some((v)=>v.length>1&&v!==Bi&&v!==xi))throw bn;if(l)return;S=this.#i[y]=new r}S.insert(j,i,m,c,l)}buildRegExpStr(){let i=Object.keys(this.#i).sort(TA).map((m)=>{let c=this.#i[m];return(typeof c.#n==="number"?`(${m})@${c.#n}`:MA.has(m)?`\\${m}`:m)+c.buildRegExpStr()});if(typeof this.#r==="number")i.unshift(`#${this.#r}`);if(i.length===0)return"";if(i.length===1)return i[0];return"(?:"+i.join("|")+")"}};var Zy=class{#r={varIndex:0};#n=new Yy;insert(r,n,i){let m=[],c=[];for(let y=0;;){let j=!1;if(r=r.replace(/\{[^}]+\}/g,(A)=>{let S=`@\\${y}`;return c[y]=[S,A],y++,j=!0,S}),!j)break}let l=r.match(/(?::[^\/]+)|(?:\/\*$)|./g)||[];for(let y=c.length-1;y>=0;y--){let[j]=c[y];for(let A=l.length-1;A>=0;A--)if(l[A].indexOf(j)!==-1){l[A]=l[A].replace(j,c[y][1]);break}}return this.#n.insert(l,n,m,this.#r,i),m}buildRegExp(){let r=this.#n.buildRegExpStr();if(r==="")return[/^$/,[],[]];let n=0,i=[],m=[];return r=r.replace(/#(\d+)|@(\d+)|\.\*\$/g,(c,l,y)=>{if(l!==void 0)return i[++n]=Number(l),"$()";if(y!==void 0)return m[Number(y)]=++n,"";return""}),[new RegExp(`^${r}`),i,m]}};var hA=[/^$/,[],Object.create(null)],Jy=Object.create(null);function Oy(r){return Jy[r]??=new RegExp(r==="*"?"":`^${r.replace(/\/\*$|([.\\+*[^\]$()])/g,(n,i)=>i?`\\${i}`:"(?:|/.*)")}$`)}function BA(){Jy=Object.create(null)}function xA(r){let n=new Zy,i=[];if(r.length===0)return hA;let m=r.map((S)=>[!/\*|\/:/.test(S[0]),...S]).sort(([S,v],[w,N])=>S?1:w?-1:v.length-N.length),c=Object.create(null);for(let S=0,v=-1,w=m.length;S<w;S++){let[N,E,Q]=m[S];if(N)c[E]=[Q.map(([H])=>[H,Object.create(null)]),hi];else v++;let W;try{W=n.insert(E,v,N)}catch(H){throw H===bn?new Tm(E):H}if(N)continue;i[v]=Q.map(([H,X])=>{let K=Object.create(null);X-=1;for(;X>=0;X--){let[J,q]=W[X];K[J]=q}return[H,K]})}let[l,y,j]=n.buildRegExp();for(let S=0,v=i.length;S<v;S++)for(let w=0,N=i[S].length;w<N;w++){let E=i[S][w]?.[1];if(!E)continue;let Q=Object.keys(E);for(let W=0,H=Q.length;W<H;W++)E[Q[W]]=j[E[Q[W]]]}let A=[];for(let S in y)A[S]=i[y[S]];return[l,A,c]}function $i(r,n){if(!r)return;for(let i of Object.keys(r).sort((m,c)=>c.length-m.length))if(Oy(i).test(n))return[...r[i]];return}var xm=class{name="RegExpRouter";#r;#n;constructor(){this.#r={[B]:Object.create(null)},this.#n={[B]:Object.create(null)}}add(r,n,i){let m=this.#r,c=this.#n;if(!m||!c)throw Error(Mm);if(!m[r])[m,c].forEach((j)=>{j[r]=Object.create(null),Object.keys(j[B]).forEach((A)=>{j[r][A]=[...j[B][A]]})});if(n==="/*")n="*";let l=(n.match(/\/:/g)||[]).length;if(/\*$/.test(n)){let j=Oy(n);if(r===B)Object.keys(m).forEach((A)=>{m[A][n]||=$i(m[A],n)||$i(m[B],n)||[]});else m[r][n]||=$i(m[r],n)||$i(m[B],n)||[];Object.keys(m).forEach((A)=>{if(r===B||r===A)Object.keys(m[A]).forEach((S)=>{j.test(S)&&m[A][S].push([i,l])})}),Object.keys(c).forEach((A)=>{if(r===B||r===A)Object.keys(c[A]).forEach((S)=>j.test(S)&&c[A][S].push([i,l]))});return}let y=Fm(n)||[n];for(let j=0,A=y.length;j<A;j++){let S=y[j];Object.keys(c).forEach((v)=>{if(r===B||r===v)c[v][S]||=[...$i(m[v],S)||$i(m[B],S)||[]],c[v][S].push([i,l-A+j+1])})}}match=hm;buildAllMatchers(){let r=Object.create(null);return Object.keys(this.#n).concat(Object.keys(this.#r)).forEach((n)=>{r[n]||=this.#i(n)}),this.#r=this.#n=void 0,BA(),r}#i(r){let n=[],i=r===B;if([this.#r,this.#n].forEach((m)=>{let c=m[r]?Object.keys(m[r]).map((l)=>[l,m[r][l]]):[];if(c.length!==0)i||=!0,n.push(...c);else if(r!==B)n.push(...Object.keys(m[B]).map((l)=>[l,m[B][l]]))}),!i)return null;else return xA(n)}};var kA=class{name="PreparedRegExpRouter";#r;#n;constructor(r,n){this.#r=r,this.#n=n}#i(r,n){let i=this.#r[r];i[1].forEach((m)=>m&&m.push(n)),Object.values(i[2]).forEach((m)=>m[0].push(n))}#l(r,n,i,m,c){let l=this.#r[r];if(!c)l[2][n][0].push([i,{}]);else m.forEach((y)=>{if(typeof y==="number")l[1][y].push([i,c]);else l[2][y||n][0].push([i,c])})}add(r,n,i){if(!this.#r[r]){let c=this.#r[B],l={};for(let y in c[2])l[y]=[c[2][y][0].slice(),hi];this.#r[r]=[c[0],c[1].map((y)=>Array.isArray(y)?y.slice():0),l]}if(n==="/*"||n==="*"){let c=[i,{}];if(r===B)for(let l in this.#r)this.#i(l,c);else this.#i(r,c);return}let m=this.#n[n];if(!m)throw Error(`Path ${n} is not registered`);for(let[c,l]of m)if(r===B)for(let y in this.#r)this.#l(y,n,i,c,l);else this.#l(r,n,i,c,l)}buildAllMatchers(){return this.#r}match=hm};var Uc=class{name="SmartRouter";#r=[];#n=[];constructor(r){this.#r=r.routers}add(r,n,i){if(!this.#n)throw Error(Mm);this.#n.push([r,n,i])}match(r,n){if(!this.#n)throw Error("Fatal error");let i=this.#r,m=this.#n,c=i.length,l=0,y;for(;l<c;l++){let j=i[l];try{for(let A=0,S=m.length;A<S;A++)j.add(...m[A]);y=j.match(r,n)}catch(A){if(A instanceof Tm)continue;throw A}this.match=j.match.bind(j),this.#r=[j],this.#n=void 0;break}if(l===c)throw Error("Fatal error");return this.name=`SmartRouter + ${this.activeRouter.name}`,y}get activeRouter(){if(this.#n||this.#r.length!==1)throw Error("No active router has been determined yet.");return this.#r[0]}};var ki=Object.create(null),pA=(r)=>{for(let n in r)return!0;return!1},Ly=class r{#r;#n;#i;#l=0;#c=ki;constructor(n,i,m){if(this.#n=m||Object.create(null),this.#r=[],n&&i){let c=Object.create(null);c[n]={handler:i,possibleKeys:[],score:0},this.#r=[c]}this.#i=[]}insert(n,i,m){this.#l=++this.#l;let c=this,l=el(i),y=[];for(let j=0,A=l.length;j<A;j++){let S=l[j],v=l[j+1],w=sl(S,v),N=Array.isArray(w)?w[0]:S;if(N in c.#n){if(c=c.#n[N],w)y.push(w[1]);continue}if(c.#n[N]=new r,w)c.#i.push(w),y.push(w[1]);c=c.#n[N]}return c.#r.push({[n]:{handler:m,possibleKeys:y.filter((j,A,S)=>S.indexOf(j)===A),score:this.#l}}),c}#m(n,i,m,c,l){for(let y=0,j=i.#r.length;y<j;y++){let A=i.#r[y],S=A[m]||A[B],v={};if(S!==void 0){if(S.params=Object.create(null),n.push(S),c!==ki||l&&l!==ki)for(let w=0,N=S.possibleKeys.length;w<N;w++){let E=S.possibleKeys[w],Q=v[S.score];S.params[E]=l?.[E]&&!Q?l[E]:c[E]??l?.[E],v[S.score]=!0}}}}search(n,i){let m=[];this.#c=ki;let l=[this],y=cc(i),j=[],A=y.length,S=null;for(let v=0;v<A;v++){let w=y[v],N=v===A-1,E=[];for(let W=0,H=l.length;W<H;W++){let X=l[W],K=X.#n[w];if(K)if(K.#c=X.#c,N){if(K.#n["*"])this.#m(m,K.#n["*"],n,X.#c);this.#m(m,K,n,X.#c)}else E.push(K);for(let J=0,q=X.#i.length;J<q;J++){let z=X.#i[J],L=X.#c===ki?{}:{...X.#c};if(z==="*"){let hr=X.#n["*"];if(hr)this.#m(m,hr,n,X.#c),hr.#c=L,E.push(hr);continue}let[rr,Tr,Yr]=z;if(!w&&!(Yr instanceof RegExp))continue;let k=X.#n[rr];if(Yr instanceof RegExp){if(S===null){S=Array(A);let Si=i[0]==="/"?1:0;for(let zi=0;zi<A;zi++)S[zi]=Si,Si+=y[zi].length+1}let hr=i.substring(S[v]),Jn=Yr.exec(hr);if(Jn){if(L[Tr]=Jn[0],this.#m(m,k,n,X.#c,L),Jn[0].length===hr.length&&k.#n["*"])this.#m(m,k.#n["*"],n,X.#c,L);if(pA(k.#n)){k.#c=L;let Si=Jn[0].match(/\//)?.length??0;(j[Si]||=[]).push(k)}continue}}if(Yr===!0||Yr.test(w))if(L[Tr]=w,N){if(this.#m(m,k,n,L,X.#c),k.#n["*"])this.#m(m,k.#n["*"],n,L,X.#c)}else k.#c=L,E.push(k)}}let Q=j.shift();l=Q?E.concat(Q):E}if(m.length>1)m.sort((v,w)=>{return v.score-w.score});return[m.map(({handler:v,params:w})=>[v,w])]}};var Pc=class{name="TrieRouter";#r;constructor(){this.#r=new Ly}add(r,n,i){let m=Fm(n);if(m){for(let c=0,l=m.length;c<l;c++)this.#r.insert(r,m[c],i);return}this.#r.insert(r,n,i)}match(r,n){return this.#r.search(r,n)}};var V=class extends Vy{constructor(r={}){super(r);this.router=r.router??new Uc({routers:[new xm,new Pc]})}};var Cc=/^\s*(?:text\/(?!event-stream(?:[;\s]|$))[^;\s]+|application\/(?:javascript|json|xml|xml-dtd|ecmascript|dart|msgpack|postscript|rtf|tar|toml|vnd\.dart|vnd\.ms-fontobject|vnd\.ms-opentype|vnd\.msgpack|wasm|x-httpd-php|x-javascript|x-msgpack|x-ns-proxy-autoconfig|x-sh|x-tar|x-virtualbox-hdd|x-virtualbox-ova|x-virtualbox-ovf|x-virtualbox-vbox|x-virtualbox-vdi|x-virtualbox-vhd|x-virtualbox-vmdk|x-www-form-urlencoded)|font\/(?:otf|ttf)|image\/(?:bmp|vnd\.adobe\.photoshop|vnd\.microsoft\.icon|vnd\.ms-dds|x-icon|x-ms-bmp)|message\/rfc822|model\/gltf-binary|x-shader\/x-fragment|x-shader\/x-vertex|[^;\s]+?\+(?:json|text|xml|yaml|msgpack))(?:[;\s]|$)/i;var aA={br:".br",zstd:".zst",gzip:".gz"},aN=Object.keys(aA);var Wc="x-hono-disable-ssg",vE=(()=>{try{return new Response("SSG is disabled",{status:404,headers:{[Wc]:"true"}})}catch{return null}})();var{write:uE}=Bun;var qy=class{#r;constructor(r){this.#r=r,this.raw=r.raw,this.url=r.url?new URL(r.url):null,this.protocol=r.protocol??null}send(r,n){this.#r.send(r,n??{})}raw;binaryType="arraybuffer";get readyState(){return this.#r.readyState}url;protocol;close(r,n){this.#r.close(r,n)}},_y=(r)=>{return new MessageEvent("message",{data:r})},gy=(r)=>{return(...n)=>{if(typeof n[0]==="function"){let[i,m]=n;return async function(l,y){let j=await i(l),A=await r(l,j,m);if(A)return A;await y()}}else{let[i,m,c]=n;return(async()=>{let l=await r(i,m,c);if(!l)throw Error("Failed to upgrade WebSocket");return l})()}}};var km=(r)=>("server"in r.env)?r.env.server:r.env;var Xc=(r)=>{return new qy({send:(n,i)=>{r.send(n,i?.compress)},raw:r,readyState:r.readyState,url:r.data.url,protocol:r.data.protocol,close(n,i){r.close(n,i)}})},Fy=gy((r,n)=>{let i=km(r);if(!i)throw TypeError("env has to include the 2nd argument of fetch.");if(i.upgrade(r.req.raw,{data:{events:n,url:new URL(r.req.url),protocol:r.req.header("sec-websocket-protocol")?.split(",")[0]?.trim()??""}}))return new Response(null);return}),zy={open(r){let n=r.data.events;if(n.onOpen)n.onOpen(new Event("open"),Xc(r))},close(r,n,i){let m=r.data.events;if(m.onClose)m.onClose(new CloseEvent("close",{code:n,reason:i}),Xc(r))},message(r,n){let i=r.data.events;if(i.onMessage){let m=typeof n==="string"?n:n.buffer;i.onMessage(_y(m),Xc(r))}}},Kc=()=>({upgradeWebSocket:Fy,websocket:zy});var oy={create(r){let n=Kc();return{upgradeWebSocket:n.upgradeWebSocket,async listen(i){let m={fetch:r.fetch,hostname:i.hostname,idleTimeout:0,websocket:n.websocket},c=(y)=>{try{return Bun.serve({...m,port:y})}catch{return}},l=i.port===0?c(4096)??c(0):c(i.port);if(!l)throw Error(`Failed to start server on port ${i.port}`);if(!l.port)throw Error(`Failed to resolve server address for port ${i.port}`);return{port:l.port,stop(y){return Promise.resolve(l.stop(y))}}}}}};var Ei={};Nr(Ei,{unpublish:()=>Rj,publish:()=>Sv,MDNS:()=>Ei});var Hj=Av(Kj(),1),di=_.create({service:"mdns"}),yn,em;function Sv(r,n){if(em===r)return;if(yn)Rj();try{let i=n??"qitqode.local",m=`qitqode-${r}`;yn=new Hj.Bonjour;let c=yn.publish({name:m,type:"http",host:i,port:r,txt:{path:"/"}});c.on("up",()=>{di.info("mDNS service published",{name:m,port:r})}),c.on("error",(l)=>{di.error("mDNS service error",{error:l})}),em=r}catch(i){if(di.error("mDNS publish failed",{error:i}),yn)try{yn.destroy()}catch{}yn=void 0,em=void 0}}function Rj(){if(yn){try{yn.unpublishAll(),yn.destroy()}catch(r){di.error("mDNS unpublish failed",{error:r})}yn=void 0,em=void 0,di.info("mDNS service unpublished")}}var Vj=(r)=>{let n=atob(r),i=new Uint8Array(new ArrayBuffer(n.length)),m=n.length/2;for(let c=0,l=n.length-1;c<=m;c++,l--)i[c]=n.charCodeAt(c),i[l]=n.charCodeAt(l);return i};var vv=/^ *(?:[Bb][Aa][Ss][Ii][Cc]) +([A-Za-z0-9._~+/-]+=*) *$/,wv=/^([^:]*):(.*)$/,$v=new TextDecoder,Yj=(r)=>{let n=vv.exec(r.headers.get("Authorization")||"");if(!n)return;let i=void 0;try{i=wv.exec($v.decode(Vj(n[1])))}catch{}if(!i)return;return{username:i[1],password:i[2]}};var Zj=(r,...n)=>{let i="username"in r&&"password"in r,m="verifyUser"in r;if(!(i||m))throw Error('basic auth middleware requires options for "username and password" or "verifyUser"');if(!r.realm)r.realm="Secure Area";if(!r.invalidUserMessage)r.invalidUserMessage="Unauthorized";if(i)n.unshift({username:r.username,password:r.password});return async function(l,y){let j=Yj(l.req.raw);if(j)if(m){if(await r.verifyUser(j.username,j.password,l)){if(r.onAuthSuccess)await r.onAuthSuccess(l,j.username);await y();return}}else for(let N of n){let[E,Q]=await Promise.all([Ic(N.username,j.username,r.hashFunction),Ic(N.password,j.password,r.hashFunction)]);if(E&&Q){if(r.onAuthSuccess)await r.onAuthSuccess(l,j.username);await y();return}}let A=401,S={"WWW-Authenticate":'Basic realm="'+r.realm?.replace(/"/g,"\\\"")+'"'},v=typeof r.invalidUserMessage==="function"?await r.invalidUserMessage(l):r.invalidUserMessage,w=typeof v==="string"?new Response(v,{status:A,headers:S}):new Response(JSON.stringify(v),{status:A,headers:{...S,"content-type":"application/json"}});throw new kr(A,{res:w})}};var Jj=(r)=>{let n={origin:"*",allowMethods:["GET","HEAD","PUT","POST","DELETE","PATCH"],allowHeaders:[],exposeHeaders:[],...r},i=((c)=>{if(typeof c==="string")if(c==="*")return()=>c;else return(l)=>c===l?l:null;else if(typeof c==="function")return c;else return(l)=>c.includes(l)?l:null})(n.origin),m=((c)=>{if(typeof c==="function")return c;else if(Array.isArray(c))return()=>c;else return()=>[]})(n.allowMethods);return async function(l,y){function j(S,v){l.res.headers.set(S,v)}let A=await i(l.req.header("origin")||"",l);if(A)j("Access-Control-Allow-Origin",A);if(n.credentials)j("Access-Control-Allow-Credentials","true");if(n.exposeHeaders?.length)j("Access-Control-Expose-Headers",n.exposeHeaders.join(","));if(l.req.method==="OPTIONS"){if(n.origin!=="*")j("Vary","Origin");if(n.maxAge!=null)j("Access-Control-Max-Age",n.maxAge.toString());let S=await m(l.req.header("origin")||"",l);if(S.length)j("Access-Control-Allow-Methods",S.join(","));let v=n.allowHeaders;if(!v?.length){let w=l.req.header("Access-Control-Request-Headers");if(w)v=w.split(/\s*,\s*/)}if(v?.length)j("Access-Control-Allow-Headers",v.join(",")),l.res.headers.append("Vary","Access-Control-Request-Headers");return l.res.headers.delete("Content-Length"),l.res.headers.delete("Content-Type"),new Response(null,{headers:l.res.headers,status:204,statusText:"No Content"})}if(await y(),n.origin!=="*")l.header("Vary","Origin",{append:!0})}};var Lj=(r)=>r===32||r===9||r===10||r===13,sm=(r,n)=>{while(n<r.length){if(!Lj(r.charCodeAt(n)))break;n++}return n},ti=(r,n)=>{while(n>0){if(!Lj(r.charCodeAt(n-1)))break;n--}return n},Oj=(r,n)=>{while(n<r.length){let i=r.charCodeAt(n);if(i===59)return[n+1,!0];if(i===44)return[n+1,!1];n++}return[n,!1]},Gv=(r,n)=>{let i=n,m=!1;while(i<r.length){let c=r.charCodeAt(i);if(m&&c===92)i++;else if(c===34)m=!m;else if(!m&&c===44)return i+1;i++}return i},Nv=(r,n)=>{n=sm(r,n);let i=n,m,c,l=!1;while(i<r.length){let A=r.charCodeAt(i);if(A===61){m=r.slice(n,ti(r,i)),i++;break}if(A===59)return[i+1,void 0,void 0,!0];if(A===44)return[i+1,void 0,void 0,!1];i++}if(m===void 0)return[i,void 0,void 0,!1];if(i=sm(r,i),r.charCodeAt(i)===61){let A=Oj(r,i+1);return[A[0],m,void 0,A[1]]}let y=!1,j=i;while(i<r.length){let A=r.charCodeAt(i);if(y&&A===92)i++;else if(A===34){if(y){let S=sm(r,i+1),v=r.charCodeAt(S);if(S<r.length&&!(v===59||v===44)){let w=Oj(r,S);return[w[0],m,void 0,w[1]]}if(c=r.slice(j+1,i),c.includes("\\"))c=c.replace(/\\(.)/g,"$1");if(v===44)return[S+1,m,c,!1];if(v===59)l=!0,S++;i=S;break}y=!0}else if(!y&&(A===59||A===44)){if(c=r.slice(j,ti(r,i)),A===59)l=!0;i++;break}i++}return[i,m,c??r.slice(j,ti(r,i)),l]},Ev=(r,n)=>{let i={type:"",params:{},q:1};n=sm(r,n);let m=n;while(m<r.length){let j=r.charCodeAt(m);if(j===59||j===44){if(i.type=r.slice(n,ti(r,m)),m++,j===44)return[m,i.type?i:void 0];if(!i.type)return[Gv(r,m),void 0];break}m++}if(!i.type)return i.type=r.slice(n,ti(r,r.length)),[r.length,i.type?i:void 0];let c,l,y;while(m<r.length){if([m,c,l,y]=Nv(r,m),c&&l)i.params[c]=l;if(!y)break}return[m,i]},qj=(r)=>{if(!r)return[];let n=[],i=0,m,c=!1,l;while(i<r.length)if([i,m]=Ev(r,i),m){if(m.q=Qv(m.params.q),n.push(m),l&&l.q<m.q)c=!0;l=m}if(c)n.sort((y,j)=>j.q-y.q);return n},Qv=(r)=>{if(r===void 0)return 1;if(r==="")return 1;if(r==="NaN")return 0;let n=Number(r);if(n===1/0)return 1;if(n===-1/0)return 0;if(Number.isNaN(n))return 1;if(n<0||n>1)return 1;return n};var Dv=["gzip","deflate"],Uv=/(?:^|,)\s*?no-transform\s*?(?:,|$)/i,Pv=(r,n)=>{if(r===void 0)return;let i=qj(r),m=i.find((l)=>l.type==="*")?.q,c;for(let l of n){let y=i.find((A)=>A.type.toLowerCase()===l),j=y?y.q:m??0;if(j===1)return l;else if(j>0&&(!c||j>c.q))c={encoding:l,q:j}}return c?.encoding},_j=(r)=>{let n=r?.threshold??1024,i=r?.encoding?[r.encoding]:Dv,m=r?.contentTypeFilter??Cc,c=typeof m==="function"?(l)=>{let y=l.headers.get("Content-Type");return y&&m(y)}:(l)=>{let y=l.headers.get("Content-Type");return y&&m.test(y)};return async function(y,j){await j();let A=y.res.headers.get("Content-Length");if(y.res.status===206||y.res.headers.has("Content-Encoding")||y.res.headers.has("Transfer-Encoding")||y.req.method==="HEAD"||A&&Number(A)<n||!c(y.res)||!Cv(y.res))return;let S=y.req.header("Accept-Encoding"),v=Pv(S,i);if(!v||!y.res.body)return;let w=new CompressionStream(v);y.res=new Response(y.res.body.pipeThrough(w),y.res),y.res.headers.delete("Content-Length"),y.res.headers.set("Content-Encoding",v);let N=y.res.headers.get("ETag");if(N&&!N.startsWith("W/"))y.res.headers.set("ETag",`W/${N}`)}},Cv=(r)=>{let n=r.headers.get("Cache-Control");return!n||!Uv.test(n)};import{randomUUID as Wv}from"crypto";var fm="ticket",gj="x-qitqode-ticket",Fj="1",Xv=/^\/pty\/[^/]+\/connect$/,Kv=60000,bi=new Map;function Hv(){let r=Date.now();for(let[n,i]of bi)if(i.expiresAt<=r)bi.delete(n)}function zj(r){return Xv.test(r)}function oj(r,n=Kv){Hv();let i=Wv();return bi.set(i,{ptyID:r,expiresAt:Date.now()+n}),{ticket:i,expires_in:Math.round(n/1000)}}function Mj(r,n){let i=bi.get(r);if(!i)return!1;if(bi.delete(r),i.expiresAt<=Date.now())return!1;return i.ptyID===n}var n0=_.create({service:"server"}),hj=(r,n)=>{let i=Tj(r),m=i.errorID;n0.error("failed",{error_id:m,error:r});let c=()=>n.json(new r0.Unknown({message:"Internal server error",diagnostic:i}).toObject(),{status:500,headers:{"x-qitqode-error-id":m}});if(r instanceof r0){let l;if(r instanceof Wn)l=404;else if(r instanceof ir.ModelNotFoundError)l=400;else if(r.name==="ProviderAuthValidationFailed")l=400;else if(r.name.startsWith("Worktree"))l=400;else l=500;if(l===500)return c();return n.json(r.toObject(),{status:l,headers:{"x-qitqode-error-id":m}})}if(r instanceof Z.BusyError)return n.json(new r0.Unknown({message:r.message,diagnostic:i}).toObject(),{status:409,headers:{"x-qitqode-error-id":m}});if(r instanceof kr)return r.getResponse();return c()},Bj=(r,n)=>{if(r.req.method==="OPTIONS")return n();let i=p.QITQODE_SERVER_PASSWORD;if(!i)return n();let m=new URL(r.req.url).pathname;if(zj(m)&&r.req.query(fm))return n();let c=p.QITQODE_SERVER_USERNAME??"qitqode";return Zj({username:c,password:i})(r,n)},xj=async(r,n)=>{let i=r.req.path==="/log";if(!i)n0.info("request",{method:r.req.method,path:r.req.path});let m=n0.time("request",{method:r.req.method,path:r.req.path});if(await n(),!i)m.stop()};function kj(r){return Jj({maxAge:86400,origin(n){if(!n)return;if(r?.cors?.includes(n))return n}})}function Rv(r){return r==="localhost"||r==="::1"||/^127(\.\d{1,3}){3}$/.test(r)||r==="127.0.0.1"}function Vv(r){if(r.startsWith("[")){let n=r.indexOf("]");return n===-1?r:r.slice(1,n)}return r.split(":")[0]}function pj(r){let n=r.hostname===void 0,i=r.hostname==="0.0.0.0"||r.hostname==="::";return(m,c)=>{if(n||i)return c();let l=m.req.header("host");if(!l)return c();let y=Vv(l);if(Rv(y))return c();if(r.hostname&&y===r.hostname)return c();if(r.mdnsDomain&&y===r.mdnsDomain)return c();if(r.allowedHosts?.includes(y))return c();throw n0.warn("rejected request with unexpected Host header",{host:y}),new kr(403,{message:`Forbidden: unexpected Host header "${y}"`})}}var Yv=_j(),aj=(r,n)=>{let i=r.req.path,m=r.req.method;if(i==="/event"||i==="/global/event")return n();if(m==="POST"&&/\/session\/[^/]+\/(message|prompt_async)$/.test(i))return n();return Yv(r,n)};var a={};Nr(a,{waitForSync:()=>hv,status:()=>Mv,startWorkspaceSyncing:()=>ac,sessionRestore:()=>gv,remove:()=>zv,list:()=>Fv,isSyncing:()=>Tv,get:()=>i2,create:()=>qv,Workspace:()=>a,Info:()=>i0,Event:()=>si,ConnectionStatus:()=>n2});var uj=["forgewise"];var Zv=new TextEncoder;function Jv(r){return Zv.encode(r).byteLength}function dj(r,n=16384){let i=[...uj.filter((l)=>(l in r)),...Object.keys(r).filter((l)=>!uj.includes(l))],m={},c=0;for(let l of i){let y={...m,[l]:r[l]},j=JSON.stringify(y);if(Jv(j)>n)continue;m[l]=r[l],c+=1}if(c===0)return;return JSON.stringify(m)}var Hr=tj("workspace",{id:_n().$type().primaryKey(),type:_n().notNull(),name:_n().notNull().default(""),branch:_n(),directory:_n(),extra:_n({mode:"json"}),project_id:_n().$type().notNull().references(()=>bj.id,{onDelete:"cascade"})});async function ej(r,n,i){let m=r.getReader(),c=new TextDecoder,l="",y="",j=1000,A=()=>{m.cancel().catch(()=>{return})};if(n.addEventListener("abort",A),n.aborted)A();try{while(!n.aborted){let S=await m.read().catch(()=>({done:!0,value:void 0}));if(S.done)break;l+=c.decode(S.value,{stream:!0}),l=l.replace(/\r\n/g,`
|
|
3
3
|
`).replace(/\r/g,`
|
|
4
4
|
`);let v=l.split(`
|
|
5
5
|
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{sP as a}from"./chunk-0xf12tf3.js";var s=a((d,i)=>{var g=process||{},h=g.argv||[],t=g.env||{},o=!(!!t.NO_COLOR||h.includes("--no-color"))&&(!!t.FORCE_COLOR||h.includes("--color")||g.platform==="win32"||(g.stdout||{}).isTTY&&t.TERM!=="dumb"||!!t.CI),B=(m,b,l=m)=>(e)=>{let r=""+e,x=r.indexOf(b,m.length);return~x?m+u(r,b,l,x)+b:m+r+b},u=(m,b,l,e)=>{let r="",x=0;do r+=m.substring(x,e)+l,x=e+b.length,e=m.indexOf(b,x);while(~e);return r+m.substring(x)},n=(m=o)=>{let b=m?B:()=>String;return{isColorSupported:m,reset:b("\x1B[0m","\x1B[0m"),bold:b("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:b("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:b("\x1B[3m","\x1B[23m"),underline:b("\x1B[4m","\x1B[24m"),inverse:b("\x1B[7m","\x1B[27m"),hidden:b("\x1B[8m","\x1B[28m"),strikethrough:b("\x1B[9m","\x1B[29m"),black:b("\x1B[30m","\x1B[39m"),red:b("\x1B[31m","\x1B[39m"),green:b("\x1B[32m","\x1B[39m"),yellow:b("\x1B[33m","\x1B[39m"),blue:b("\x1B[34m","\x1B[39m"),magenta:b("\x1B[35m","\x1B[39m"),cyan:b("\x1B[36m","\x1B[39m"),white:b("\x1B[37m","\x1B[39m"),gray:b("\x1B[90m","\x1B[39m"),bgBlack:b("\x1B[40m","\x1B[49m"),bgRed:b("\x1B[41m","\x1B[49m"),bgGreen:b("\x1B[42m","\x1B[49m"),bgYellow:b("\x1B[43m","\x1B[49m"),bgBlue:b("\x1B[44m","\x1B[49m"),bgMagenta:b("\x1B[45m","\x1B[49m"),bgCyan:b("\x1B[46m","\x1B[49m"),bgWhite:b("\x1B[47m","\x1B[49m"),blackBright:b("\x1B[90m","\x1B[39m"),redBright:b("\x1B[91m","\x1B[39m"),greenBright:b("\x1B[92m","\x1B[39m"),yellowBright:b("\x1B[93m","\x1B[39m"),blueBright:b("\x1B[94m","\x1B[39m"),magentaBright:b("\x1B[95m","\x1B[39m"),cyanBright:b("\x1B[96m","\x1B[39m"),whiteBright:b("\x1B[97m","\x1B[39m"),bgBlackBright:b("\x1B[100m","\x1B[49m"),bgRedBright:b("\x1B[101m","\x1B[49m"),bgGreenBright:b("\x1B[102m","\x1B[49m"),bgYellowBright:b("\x1B[103m","\x1B[49m"),bgBlueBright:b("\x1B[104m","\x1B[49m"),bgMagentaBright:b("\x1B[105m","\x1B[49m"),bgCyanBright:b("\x1B[106m","\x1B[49m"),bgWhiteBright:b("\x1B[107m","\x1B[49m")}};i.exports=n();i.exports.createColors=n});
|
|
3
3
|
export{s as ce};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Kd as a}from"./chunk-8rbbt1s8.js";import"./chunk-8t17w67q.js";import"./chunk-
|
|
2
|
+
import{Kd as a}from"./chunk-8rbbt1s8.js";import"./chunk-8t17w67q.js";import"./chunk-0xf12tf3.js";export{a as dict};
|