@qitqode/qitqode-android-arm64 0.1.22 → 0.1.24
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-18xhxdsh.js → chunk-02txthqv.js} +2 -2
- package/bundle/{chunk-t4c0zy2s.js → chunk-0ae5q6ck.js} +2 -2
- package/bundle/chunk-0bvde0cx.js +2 -0
- package/bundle/chunk-0kbxnazj.js +2 -0
- package/bundle/{chunk-n68xjm4p.js → chunk-0pbt75ev.js} +1 -1
- package/bundle/{chunk-hmm1m733.js → chunk-0pvbk8ks.js} +2 -2
- package/bundle/{chunk-j6cpsxva.js → chunk-0rtshz2r.js} +1 -1
- package/bundle/{chunk-mbkw9s6e.js → chunk-0w0jfzb4.js} +1 -1
- package/bundle/{chunk-qq9pvscd.js → chunk-0w4v0fbs.js} +2 -2
- package/bundle/{chunk-jee9y4t0.js → chunk-0z3z0gk1.js} +2 -2
- package/bundle/{chunk-mr7ya5kc.js → chunk-17ggas8k.js} +1 -1
- package/bundle/chunk-19z5q33z.js +2 -0
- package/bundle/chunk-1a0wnwna.js +2 -0
- package/bundle/{chunk-y2tnzn1y.js → chunk-1d64dywx.js} +2 -2
- package/bundle/chunk-1ddm2wxv.js +2 -0
- package/bundle/chunk-1fk4vsmc.js +2 -0
- package/bundle/{chunk-x4c8drpe.js → chunk-1fnmkm0z.js} +2 -2
- package/bundle/chunk-1j2f9nd5.js +2 -0
- package/bundle/{chunk-b5x3zghc.js → chunk-1jh5p5qw.js} +2 -2
- package/bundle/{chunk-mbmc1mg0.js → chunk-1jsywey3.js} +1 -1
- package/bundle/{chunk-t2n6fmpy.js → chunk-1p34bx7c.js} +2 -2
- package/bundle/{chunk-7yw60h8j.js → chunk-1xyn0sp2.js} +2 -2
- package/bundle/{chunk-yy91rm3y.js → chunk-1y9t7nxn.js} +1 -1
- package/bundle/{chunk-h99n5rv7.js → chunk-21ejqv4v.js} +1 -1
- package/bundle/chunk-23geekk5.js +3 -0
- package/bundle/chunk-27s736an.js +2 -0
- package/bundle/{chunk-4qegdkss.js → chunk-2eardzxs.js} +1 -1
- package/bundle/{chunk-6emme4kp.js → chunk-2gxjjqfx.js} +1 -1
- package/bundle/chunk-2j17xrzj.js +2 -0
- package/bundle/{chunk-s4epqtge.js → chunk-2mmspnr3.js} +1 -1
- package/bundle/{chunk-30233h8f.js → chunk-2qcndbxv.js} +1 -1
- package/bundle/{chunk-8rcpj28e.js → chunk-2wp1w8cy.js} +1 -1
- package/bundle/{chunk-6r4gn18m.js → chunk-2y8qz8te.js} +1 -1
- package/bundle/{chunk-8r4xs1q9.js → chunk-2z6fzwyc.js} +2 -2
- package/bundle/chunk-2zca3nak.js +2 -0
- package/bundle/chunk-2zcvcfq4.js +2 -0
- package/bundle/chunk-38hwkfj5.js +2 -0
- package/bundle/chunk-3afqxvsn.js +2 -0
- package/bundle/chunk-3avc1ppg.js +7 -0
- package/bundle/{chunk-a2ty2e0g.js → chunk-3nhqd8wg.js} +3 -3
- package/bundle/{chunk-jfy6bfvv.js → chunk-3tdqsm5c.js} +1 -1
- package/bundle/{chunk-c88rh38d.js → chunk-3tkp27x7.js} +2 -2
- package/bundle/chunk-3v4vtah1.js +2 -0
- package/bundle/{chunk-x8w2xgx6.js → chunk-3vbtra1j.js} +1 -1
- package/bundle/{chunk-b54t7ycj.js → chunk-3wzqs241.js} +1 -1
- package/bundle/chunk-3ypk0j2f.js +2 -0
- package/bundle/{chunk-tq258v8s.js → chunk-3z1y040p.js} +2 -2
- package/bundle/{chunk-3w60y2x5.js → chunk-453wpzg6.js} +1 -1
- package/bundle/chunk-4aykrj51.js +9 -0
- package/bundle/{chunk-qryeqw9s.js → chunk-4d1a547n.js} +1 -1
- package/bundle/chunk-4dtbmqmq.js +2 -0
- package/bundle/{chunk-s1mx3bkw.js → chunk-4k149ews.js} +1 -1
- package/bundle/{chunk-hyr049cr.js → chunk-4kse3awh.js} +1 -1
- package/bundle/chunk-4q9w2yve.js +5 -0
- package/bundle/{chunk-cx0z3mm3.js → chunk-4tn69nqs.js} +1 -1
- package/bundle/chunk-4zjb6rps.js +2 -0
- package/bundle/{chunk-cpkega70.js → chunk-58enbars.js} +2 -2
- package/bundle/{chunk-p64fb4rm.js → chunk-5h2hcp46.js} +1 -1
- package/bundle/chunk-5hkcjgwh.js +2 -0
- package/bundle/{chunk-7b69jj5g.js → chunk-5kmfnkzv.js} +1 -1
- package/bundle/{chunk-k19zvbzh.js → chunk-5rkmhzq0.js} +2 -2
- package/bundle/chunk-5snrz263.js +2 -0
- package/bundle/{chunk-ht1hqsaa.js → chunk-5y8efy5b.js} +1 -1
- package/bundle/chunk-653c0mxr.js +11 -0
- package/bundle/chunk-6av7hrrk.js +7 -0
- package/bundle/chunk-6bswn7w5.js +2 -0
- package/bundle/{chunk-fgtyrvan.js → chunk-6dxaty1v.js} +1 -1
- package/bundle/chunk-6epghftw.js +2 -0
- package/bundle/{chunk-bbznk59q.js → chunk-6g3m7yxf.js} +2 -2
- package/bundle/{chunk-xjdxyeja.js → chunk-6j0365q3.js} +2 -2
- package/bundle/chunk-6jjhxh8p.js +2 -0
- package/bundle/{chunk-y0fxwgrv.js → chunk-6mscvf6y.js} +1 -1
- package/bundle/{chunk-30p5pm3w.js → chunk-6nhje520.js} +1 -1
- package/bundle/{chunk-bjw39da9.js → chunk-6sdh1q7g.js} +1 -1
- package/bundle/{chunk-1eqcgkyq.js → chunk-6szvs3k9.js} +1 -1
- package/bundle/chunk-6ws7xyc5.js +2 -0
- package/bundle/{chunk-1d6ret10.js → chunk-78bajmqm.js} +1 -1
- package/bundle/{chunk-xtjsfqam.js → chunk-7a6p7dfx.js} +1 -1
- package/bundle/{chunk-ng85b73s.js → chunk-7dckfame.js} +1 -1
- package/bundle/chunk-7g28zhar.js +2 -0
- package/bundle/{chunk-8t1whx0k.js → chunk-7gczzccz.js} +1 -1
- package/bundle/chunk-7mhffm9f.js +800 -0
- package/bundle/{chunk-68jsyydc.js → chunk-7tgm8wp5.js} +1 -1
- package/bundle/chunk-7v02b2ms.js +2 -0
- package/bundle/chunk-7vmp2034.js +2 -0
- package/bundle/chunk-7wxrypkr.js +2 -0
- package/bundle/{chunk-1zb95qfx.js → chunk-7y3y3j51.js} +2 -2
- package/bundle/{chunk-mgp034y0.js → chunk-7yf15a3a.js} +1 -1
- package/bundle/{chunk-bwyf1bvf.js → chunk-82gs5cmn.js} +1 -1
- package/bundle/{chunk-hkmx6w54.js → chunk-84gnbzky.js} +1 -1
- package/bundle/{chunk-fyd31m33.js → chunk-8651hq0k.js} +1 -1
- package/bundle/{chunk-ymv05pbt.js → chunk-8717htya.js} +1 -1
- package/bundle/{chunk-fjtq8164.js → chunk-8ace31r2.js} +1 -1
- package/bundle/{chunk-7276th89.js → chunk-8cr7ks31.js} +1 -1
- package/bundle/{chunk-9g05wsae.js → chunk-8h9r6c8g.js} +2 -2
- package/bundle/chunk-8kk9gvdy.js +2 -0
- package/bundle/{chunk-haw1jzwb.js → chunk-8pe047p0.js} +1 -1
- package/bundle/{chunk-j2k4wxsk.js → chunk-8r79zf3y.js} +2 -2
- package/bundle/chunk-8ygpp4y3.js +2 -0
- package/bundle/chunk-95q60g1p.js +2 -0
- package/bundle/{chunk-rvz05kxy.js → chunk-9798jffg.js} +1 -1
- package/bundle/{chunk-7hx0pza2.js → chunk-99n6czag.js} +2 -2
- package/bundle/{chunk-m79gd4yt.js → chunk-9easaxy7.js} +1 -1
- package/bundle/{chunk-jyh2g13j.js → chunk-9f7y0dj0.js} +1 -1
- package/bundle/{chunk-x1dfc7qd.js → chunk-9jf67xb0.js} +2 -2
- package/bundle/chunk-9mjbenja.js +2 -0
- package/bundle/{chunk-9fdv5d8a.js → chunk-9nx8hm57.js} +1 -1
- package/bundle/{chunk-0ddhkapd.js → chunk-9pe4agdz.js} +2 -2
- package/bundle/{chunk-f72j5yx8.js → chunk-9rqrm9y8.js} +1 -1
- package/bundle/{chunk-mqt5qh3t.js → chunk-9sy9ws1w.js} +1 -1
- package/bundle/{chunk-zfw873yt.js → chunk-9vcw33dv.js} +1 -1
- package/bundle/chunk-9vn1gy8h.js +2 -0
- package/bundle/{chunk-wmmck56g.js → chunk-9xvctnjr.js} +1 -1
- package/bundle/{chunk-2p6w3w8f.js → chunk-a5zjrwqy.js} +2 -2
- package/bundle/{chunk-jj7wrfty.js → chunk-a9y27zd2.js} +1 -1
- package/bundle/{chunk-pcctf3gs.js → chunk-ac202abt.js} +1 -1
- package/bundle/{chunk-tcp31yv0.js → chunk-agdfqncf.js} +2 -2
- package/bundle/chunk-ajp3f08k.js +2 -0
- package/bundle/{chunk-7w01dxp9.js → chunk-am73j1bt.js} +1 -1
- package/bundle/{chunk-ne8ftsv3.js → chunk-apq38bt4.js} +3 -3
- package/bundle/chunk-aptkpdkc.js +2 -0
- package/bundle/{chunk-vpp88hhd.js → chunk-b643cra9.js} +229 -229
- package/bundle/{chunk-6hkv9411.js → chunk-b6m4yyww.js} +1 -1
- package/bundle/{chunk-rry321tn.js → chunk-b8ag61vj.js} +1 -1
- package/bundle/{chunk-hzexvrnj.js → chunk-bas6x25m.js} +2 -2
- package/bundle/{chunk-q6x5bmc3.js → chunk-bd21p9zz.js} +2 -2
- package/bundle/{chunk-t7v8wzr9.js → chunk-bf146hz2.js} +2 -2
- package/bundle/{chunk-pkdk0ppc.js → chunk-bky5a42k.js} +2 -2
- package/bundle/chunk-bry94ar5.js +2 -0
- package/bundle/chunk-btzyvqkf.js +2 -0
- package/bundle/{chunk-xce77xex.js → chunk-c31k8yh0.js} +1 -1
- package/bundle/chunk-c94pjdfh.js +2 -0
- package/bundle/chunk-cct9ds5c.js +2 -0
- package/bundle/chunk-cesrhm09.js +4 -0
- package/bundle/{chunk-pqyds00j.js → chunk-cvchztkc.js} +1 -1
- package/bundle/{chunk-x6gzygc3.js → chunk-cy2586rv.js} +1 -1
- package/bundle/chunk-czn535v0.js +2 -0
- package/bundle/chunk-d56zc21w.js +3 -0
- package/bundle/chunk-d7wd5hz1.js +2 -0
- package/bundle/chunk-d86cmjrp.js +2 -0
- package/bundle/{chunk-1kje2a6g.js → chunk-dann9gfq.js} +1 -1
- package/bundle/{chunk-fssgbz70.js → chunk-dcx8hjbs.js} +1 -1
- package/bundle/{chunk-x4b0ywbs.js → chunk-dgzyn27r.js} +1 -1
- package/bundle/{chunk-meaa7wrs.js → chunk-dkm7x8rj.js} +2 -2
- package/bundle/chunk-dkv2mg97.js +3 -0
- package/bundle/chunk-dnq65xvn.js +2 -0
- package/bundle/chunk-dpqv8rtn.js +2 -0
- package/bundle/chunk-e346x00p.js +10 -0
- package/bundle/chunk-e9mh7s3z.js +2 -0
- package/bundle/{chunk-kywg73qz.js → chunk-ebjhggdw.js} +1 -1
- package/bundle/{chunk-prrrw8t8.js → chunk-ecwz9nhs.js} +2 -2
- package/bundle/{chunk-m9bc5csy.js → chunk-edvcz2gd.js} +1 -1
- package/bundle/chunk-ek2y5f6g.js +2 -0
- package/bundle/{chunk-dhvwrrqx.js → chunk-ep8zn49w.js} +2 -2
- package/bundle/chunk-epdsay73.js +2 -0
- package/bundle/{chunk-adgrn60n.js → chunk-evqxvhdb.js} +1 -1
- package/bundle/{chunk-n1wawwry.js → chunk-ewyk4py6.js} +1 -1
- package/bundle/{chunk-56cty7nr.js → chunk-f3kjp838.js} +2 -2
- package/bundle/{chunk-c9afcdba.js → chunk-f819a7ec.js} +1 -1
- package/bundle/chunk-f89gntcy.js +3 -0
- package/bundle/{chunk-qwf258sw.js → chunk-fdezde1z.js} +1 -1
- package/bundle/chunk-ffnsn7tv.js +2 -0
- package/bundle/{chunk-98nh88th.js → chunk-fhng5her.js} +2 -2
- package/bundle/chunk-fkezc7ew.js +2 -0
- package/bundle/{chunk-78wt9ad8.js → chunk-fkvccmgk.js} +2 -2
- package/bundle/{chunk-1123xk5a.js → chunk-fm4xa6yx.js} +2 -2
- package/bundle/{chunk-j1kqhxnq.js → chunk-frdc3ysq.js} +1 -1
- package/bundle/chunk-fsxddgj0.js +2 -0
- package/bundle/{chunk-ah9cm91p.js → chunk-ftk58wxe.js} +1 -1
- package/bundle/{chunk-zz192a31.js → chunk-g0v9g37f.js} +1 -1
- package/bundle/{chunk-50aznc8e.js → chunk-g7vkkmsk.js} +3 -3
- package/bundle/chunk-gbcsfg6v.js +2 -0
- package/bundle/{chunk-s6qdtfty.js → chunk-gc9q0x8z.js} +3 -3
- package/bundle/{chunk-ntmn6epc.js → chunk-gen6f3dn.js} +2 -2
- package/bundle/{chunk-fkdbba26.js → chunk-gf4ek7rv.js} +1 -1
- package/bundle/{chunk-ee5r4h0v.js → chunk-gff87y4n.js} +1 -1
- package/bundle/chunk-gfmz85hp.js +2 -0
- package/bundle/chunk-gk63k4t6.js +2 -0
- package/bundle/{chunk-b3x13ndd.js → chunk-gn7xgd4c.js} +1 -1
- package/bundle/{chunk-4gfryje2.js → chunk-gn9p1d50.js} +1 -1
- package/bundle/{chunk-b1t8d1s8.js → chunk-gvzfffr4.js} +1 -1
- package/bundle/{chunk-zeh3mjgp.js → chunk-ha1w0xzh.js} +1 -1
- package/bundle/{chunk-r8ddb02d.js → chunk-hbnr0j7h.js} +2 -2
- package/bundle/chunk-hg563h5r.js +3 -0
- package/bundle/{chunk-y3x5m3e8.js → chunk-hg9nk090.js} +1 -1
- package/bundle/{chunk-67wvdfs5.js → chunk-hh3w51wp.js} +2 -2
- package/bundle/{chunk-fa03gsff.js → chunk-hh4c02fh.js} +1 -1
- package/bundle/{chunk-5z8gpy3x.js → chunk-hh9a709t.js} +1 -1
- package/bundle/{chunk-dgsg31vm.js → chunk-hjbks7r9.js} +1 -1
- package/bundle/{chunk-qafcfb4x.js → chunk-hqg5qbxk.js} +1 -1
- package/bundle/{chunk-jtbf88gw.js → chunk-hv4nhx6q.js} +2 -2
- package/bundle/{chunk-n4spe0sv.js → chunk-hxgb0y1w.js} +1 -1
- package/bundle/chunk-j0vf8s12.js +2 -0
- package/bundle/chunk-j1a64ade.js +3 -0
- package/bundle/chunk-j1bxt69x.js +2 -0
- package/bundle/{chunk-351wfvhp.js → chunk-j1veq3zr.js} +2 -2
- package/bundle/{chunk-60dxyp37.js → chunk-jbd9k041.js} +2 -2
- package/bundle/chunk-jcem8s30.js +2 -0
- package/bundle/{chunk-v9sfzkg5.js → chunk-jegn6jc3.js} +2 -2
- package/bundle/chunk-jjwjb9w0.js +3 -0
- package/bundle/{chunk-3degq6rv.js → chunk-jmjg8d8a.js} +4 -4
- package/bundle/chunk-jpham2a3.js +2 -0
- package/bundle/{chunk-rpy4rgmm.js → chunk-jpygkh1c.js} +1 -1
- package/bundle/{chunk-n39gqxkz.js → chunk-jr8qcf99.js} +2 -2
- package/bundle/{chunk-9hrpcnt8.js → chunk-jr9xnvjq.js} +1 -1
- package/bundle/{chunk-07b36w5g.js → chunk-jz3aav8a.js} +2 -2
- package/bundle/chunk-jzkymnr5.js +2 -0
- package/bundle/chunk-k0qtwnhb.js +2 -0
- package/bundle/{chunk-6w15nfph.js → chunk-k16hzy2q.js} +1 -1
- package/bundle/chunk-k2rsky7z.js +2 -0
- package/bundle/{chunk-61ndvjmm.js → chunk-k9d927xe.js} +1 -1
- package/bundle/{chunk-jrwfx6d8.js → chunk-k9g77a02.js} +1 -1
- package/bundle/{chunk-t1f7jeat.js → chunk-kaeyhw2n.js} +2 -2
- package/bundle/{chunk-gvj8qg7x.js → chunk-kc3hpmr2.js} +2 -2
- package/bundle/chunk-kcetcysa.js +2 -0
- package/bundle/chunk-kjfc5v3s.js +2 -0
- package/bundle/chunk-kkvb2c2z.js +8 -0
- package/bundle/chunk-km2ayfyf.js +2 -0
- package/bundle/chunk-knrh89eb.js +2 -0
- package/bundle/{chunk-8wzc27e3.js → chunk-kr0fsqas.js} +1 -1
- package/bundle/chunk-ksqfjawv.js +2 -0
- package/bundle/{chunk-awdpkgxf.js → chunk-ktmazmas.js} +2 -2
- package/bundle/{chunk-c4x99ayd.js → chunk-m8djypsy.js} +1 -1
- package/bundle/{chunk-10qkxzhh.js → chunk-mj24ntn9.js} +1 -1
- package/bundle/chunk-mjhb1q0n.js +3 -0
- package/bundle/{chunk-4xpfmpjf.js → chunk-ms1fd6h4.js} +1 -1
- package/bundle/chunk-mxcger73.js +2 -0
- package/bundle/{chunk-fzhgxcej.js → chunk-n1chdwrs.js} +1 -1
- package/bundle/{chunk-jatba8z8.js → chunk-najzfhb2.js} +1 -1
- package/bundle/chunk-nazkrkeb.js +2 -0
- package/bundle/chunk-nk01s49e.js +2 -0
- package/bundle/{chunk-pp44xnd7.js → chunk-ns0pswww.js} +1 -1
- package/bundle/chunk-ns8b7rx1.js +2 -0
- package/bundle/chunk-ny6vpkx2.js +2 -0
- package/bundle/{chunk-0vw5a7m9.js → chunk-p4hpr8d7.js} +1 -1
- package/bundle/{chunk-n1m5qdf5.js → chunk-p54bzjtv.js} +1 -1
- package/bundle/{chunk-f8xnn26j.js → chunk-pb7rnkke.js} +1 -1
- package/bundle/{chunk-4se8cbmb.js → chunk-pfhp78cr.js} +1 -1
- package/bundle/{chunk-y2r3zker.js → chunk-ps543k72.js} +1 -1
- package/bundle/chunk-pv8jcpnf.js +2 -0
- package/bundle/{chunk-vqxyph4q.js → chunk-pyq01301.js} +1 -1
- package/bundle/chunk-q0dd3ak6.js +3 -0
- package/bundle/chunk-q2s057bm.js +2 -0
- package/bundle/{chunk-x1naayst.js → chunk-q3x4x2tq.js} +1 -1
- package/bundle/chunk-q5cqg2c0.js +28 -0
- package/bundle/{chunk-msqx5bb0.js → chunk-q6fbyvpq.js} +1 -1
- package/bundle/chunk-qk2wnp2x.js +2 -0
- package/bundle/{chunk-wm3b050v.js → chunk-qw2hgs5b.js} +2 -2
- package/bundle/{chunk-8x6x3g16.js → chunk-qywwj58s.js} +2 -2
- package/bundle/chunk-r012q335.js +3 -0
- package/bundle/{chunk-gzwcj7c9.js → chunk-r3yqe7x0.js} +1 -1
- package/bundle/{chunk-2epf5806.js → chunk-r48g0kaq.js} +2 -2
- package/bundle/{chunk-hrnx60em.js → chunk-r7xp0xcn.js} +2 -2
- package/bundle/chunk-rbdjbgkb.js +2 -0
- package/bundle/{chunk-a3a9bbk7.js → chunk-rvvfs9ps.js} +2 -2
- package/bundle/chunk-rxjprhgh.js +2 -0
- package/bundle/chunk-s3w9bmze.js +2 -0
- package/bundle/chunk-s3zste1a.js +2 -0
- package/bundle/{chunk-bdzgtazc.js → chunk-s9amvacw.js} +2 -2
- package/bundle/chunk-sbt7qmwm.js +3 -0
- package/bundle/chunk-sf6h44pb.js +2 -0
- package/bundle/{chunk-aznbvrbm.js → chunk-sgtgvzv6.js} +1 -1
- package/bundle/chunk-sgvzxs7m.js +2 -0
- package/bundle/{chunk-h7rxnbf0.js → chunk-sjrmhd3e.js} +1 -1
- package/bundle/chunk-sp9bndyh.js +2 -0
- package/bundle/{chunk-ck65rcxb.js → chunk-spm1yy6w.js} +1 -1
- package/bundle/{chunk-h6htvj2y.js → chunk-srf73nm4.js} +1 -1
- package/bundle/{chunk-c2w3bqsa.js → chunk-sswbfqcq.js} +1 -1
- package/bundle/{chunk-er5q8nhp.js → chunk-t488d66k.js} +1 -1
- package/bundle/{chunk-aftpj9fe.js → chunk-t6w96xq2.js} +1 -1
- package/bundle/{chunk-t8365msg.js → chunk-te1zfpzv.js} +1 -1
- package/bundle/{chunk-2bxy8zm1.js → chunk-tk3bve0x.js} +2 -2
- package/bundle/chunk-tsn1jkr7.js +2 -0
- package/bundle/{chunk-z9b0ydw1.js → chunk-tzc4jkzg.js} +1 -1
- package/bundle/{chunk-01gtn79f.js → chunk-v2kyarwz.js} +2 -2
- package/bundle/{chunk-0qmaxpkv.js → chunk-v7r9np94.js} +1 -1
- package/bundle/{chunk-0jv8r99k.js → chunk-va4davgy.js} +317 -297
- package/bundle/{chunk-2bbvvh0d.js → chunk-vavrczqm.js} +1 -1
- package/bundle/{chunk-43xq4p51.js → chunk-ve5gb789.js} +2 -2
- package/bundle/{chunk-n9gzj085.js → chunk-vf1r5ckp.js} +1 -1
- package/bundle/{chunk-hnzs3ywg.js → chunk-vftqwdpg.js} +1 -1
- package/bundle/chunk-vg4styg5.js +2 -0
- package/bundle/chunk-vh09hhcs.js +2 -0
- package/bundle/chunk-vhktpm0n.js +2 -0
- package/bundle/{chunk-5a80qybt.js → chunk-vvypb02q.js} +1 -1
- package/bundle/{chunk-h5wh2d49.js → chunk-vzjcmwry.js} +2 -2
- package/bundle/{chunk-6nhgkw5r.js → chunk-w1atxyz0.js} +1 -1
- package/bundle/{chunk-73d0dy03.js → chunk-w7p2x973.js} +2 -2
- package/bundle/{chunk-db7hykjs.js → chunk-wa2ce2sg.js} +2 -2
- package/bundle/{chunk-3nc9wy1m.js → chunk-wf09j72q.js} +2 -2
- package/bundle/{chunk-wfb9dwmc.js → chunk-wfnk2vsd.js} +1 -1
- package/bundle/{chunk-zt8kghd2.js → chunk-wj6aq50n.js} +1 -1
- package/bundle/{chunk-39h565hz.js → chunk-wmrq9qqf.js} +1 -1
- package/bundle/{chunk-ha5qct06.js → chunk-wmw2gne9.js} +2 -2
- package/bundle/chunk-wtp0yvqw.js +2 -0
- package/bundle/{chunk-btjcs9ee.js → chunk-x6z2b63w.js} +1 -1
- package/bundle/{chunk-3xbtg0hn.js → chunk-xccs5c50.js} +1 -1
- package/bundle/{chunk-abc7ccfd.js → chunk-xj73j10a.js} +1 -1
- package/bundle/chunk-xmzs7q66.js +2 -0
- package/bundle/chunk-xv80476w.js +2 -0
- package/bundle/{chunk-tepesp0b.js → chunk-xv8gnkh5.js} +1 -1
- package/bundle/{chunk-hf0gny5t.js → chunk-y1srca0c.js} +2 -2
- package/bundle/{chunk-zy0zn8yx.js → chunk-y2jmtfdh.js} +2 -2
- package/bundle/{chunk-w8xaw2dv.js → chunk-y3n31nnx.js} +2 -2
- package/bundle/{chunk-6v4mhtha.js → chunk-ygj1cy0n.js} +1 -1
- package/bundle/{chunk-496rb1e4.js → chunk-yh174jhg.js} +2 -2
- package/bundle/chunk-yjvr0et1.js +2 -0
- package/bundle/{chunk-h9ftcgs2.js → chunk-yz7rqzby.js} +3 -3
- package/bundle/{chunk-2qy62cv4.js → chunk-yzdty5t9.js} +2 -2
- package/bundle/{chunk-5mrjxapq.js → chunk-zavtsfxz.js} +1 -1
- package/bundle/{chunk-h725tttx.js → chunk-zeh481tm.js} +2 -2
- package/bundle/{chunk-cn7nnjsf.js → chunk-zfnbk5gy.js} +1 -1
- package/bundle/{chunk-p20ft5mj.js → chunk-zk8n8hnh.js} +2 -2
- package/bundle/{chunk-en7nxqvn.js → chunk-zp2ffbc2.js} +2 -2
- package/bundle/chunk-zx3kcfkj.js +2 -0
- package/bundle/index.js +4 -4
- package/bundle/parser.worker.js +2 -2
- package/bundle/worker.js +1 -1
- package/package.json +1 -1
- package/bundle/chunk-04ezvjjf.js +0 -2
- package/bundle/chunk-0msr85tj.js +0 -2
- package/bundle/chunk-0qrpg3n8.js +0 -2
- package/bundle/chunk-0w8ztgmg.js +0 -2
- package/bundle/chunk-0y2nwncb.js +0 -2
- package/bundle/chunk-0zh8tykf.js +0 -2
- package/bundle/chunk-21z1vfgm.js +0 -2
- package/bundle/chunk-2ec8msmq.js +0 -2
- package/bundle/chunk-2n5m61m9.js +0 -2
- package/bundle/chunk-362z696e.js +0 -2
- package/bundle/chunk-367rm03h.js +0 -2
- package/bundle/chunk-3f6t3wde.js +0 -799
- package/bundle/chunk-40vz0fhv.js +0 -3
- package/bundle/chunk-43k17qzb.js +0 -2
- package/bundle/chunk-4r574drd.js +0 -2
- package/bundle/chunk-6c2xn1ab.js +0 -2
- package/bundle/chunk-6pe3xzkk.js +0 -11
- package/bundle/chunk-6rak9ez9.js +0 -2
- package/bundle/chunk-71dbq1d0.js +0 -2
- package/bundle/chunk-73r1zvgw.js +0 -2
- package/bundle/chunk-7az1bpy8.js +0 -2
- package/bundle/chunk-7bm1t462.js +0 -2
- package/bundle/chunk-7nq8126b.js +0 -2
- package/bundle/chunk-80a0d0js.js +0 -2
- package/bundle/chunk-9ac4h2d9.js +0 -2
- package/bundle/chunk-9zp746aj.js +0 -2
- package/bundle/chunk-a0vpemkf.js +0 -2
- package/bundle/chunk-anqjy235.js +0 -7
- package/bundle/chunk-atjzxp7b.js +0 -2
- package/bundle/chunk-ax4f4fbm.js +0 -2
- package/bundle/chunk-aybmm0jf.js +0 -2
- package/bundle/chunk-b2scgkye.js +0 -2
- package/bundle/chunk-b5h8vd5n.js +0 -3
- package/bundle/chunk-bbpze4hq.js +0 -2
- package/bundle/chunk-bn6mg34g.js +0 -7
- package/bundle/chunk-c6wrjyep.js +0 -2
- package/bundle/chunk-cckshvkb.js +0 -9
- package/bundle/chunk-ce3c03mh.js +0 -2
- package/bundle/chunk-cm31dbwq.js +0 -2
- package/bundle/chunk-cqaw6hka.js +0 -2
- package/bundle/chunk-cxbkhs5y.js +0 -2
- package/bundle/chunk-d9vs6zd0.js +0 -2
- package/bundle/chunk-dcyzpkww.js +0 -2
- package/bundle/chunk-dj3rct8v.js +0 -2
- package/bundle/chunk-djcsvcby.js +0 -5
- package/bundle/chunk-ds162xgb.js +0 -3
- package/bundle/chunk-e1zv873k.js +0 -2
- package/bundle/chunk-eb0ksh4x.js +0 -2
- package/bundle/chunk-efxshjyz.js +0 -2
- package/bundle/chunk-enry018j.js +0 -2
- package/bundle/chunk-f03yje8k.js +0 -3
- package/bundle/chunk-fd1vbz1f.js +0 -3
- package/bundle/chunk-fydd2nmw.js +0 -2
- package/bundle/chunk-g2bw2qf5.js +0 -2
- package/bundle/chunk-h9a4zzr4.js +0 -2
- package/bundle/chunk-hkqcpdmt.js +0 -3
- package/bundle/chunk-jx3kvzka.js +0 -2
- package/bundle/chunk-k6eyc1wv.js +0 -8
- package/bundle/chunk-k9m536te.js +0 -2
- package/bundle/chunk-khkv9s5c.js +0 -2
- package/bundle/chunk-kv58j3yk.js +0 -2
- package/bundle/chunk-m3sr6xdg.js +0 -2
- package/bundle/chunk-mmyhzhzt.js +0 -2
- package/bundle/chunk-mt8zem33.js +0 -24
- package/bundle/chunk-mw60bmaf.js +0 -2
- package/bundle/chunk-nk42gy65.js +0 -2
- package/bundle/chunk-ps8xnz0h.js +0 -2
- package/bundle/chunk-pvn4dz8e.js +0 -2
- package/bundle/chunk-pw3tnt2j.js +0 -2
- package/bundle/chunk-pzajshbc.js +0 -2
- package/bundle/chunk-q2weasmk.js +0 -2
- package/bundle/chunk-qe8zp79w.js +0 -2
- package/bundle/chunk-qvcnvqvf.js +0 -2
- package/bundle/chunk-qxrjbw22.js +0 -2
- package/bundle/chunk-qy9s3nmy.js +0 -2
- package/bundle/chunk-r0zsgad8.js +0 -4
- package/bundle/chunk-r4hkkcj4.js +0 -2
- package/bundle/chunk-r50kjthp.js +0 -2
- package/bundle/chunk-rbrkvj3x.js +0 -2
- package/bundle/chunk-rhgfyvth.js +0 -2
- package/bundle/chunk-rjdpw6at.js +0 -2
- package/bundle/chunk-s6c5c940.js +0 -2
- package/bundle/chunk-s79zd152.js +0 -2
- package/bundle/chunk-skjx57kv.js +0 -2
- package/bundle/chunk-ssfgge5z.js +0 -2
- package/bundle/chunk-t813v629.js +0 -2
- package/bundle/chunk-tdqbsbyb.js +0 -2
- package/bundle/chunk-th189x63.js +0 -3
- package/bundle/chunk-thbjhgw0.js +0 -2
- package/bundle/chunk-tk6gjy9d.js +0 -3
- package/bundle/chunk-tsfpkwvr.js +0 -2
- package/bundle/chunk-tz8qhbk9.js +0 -3
- package/bundle/chunk-v07wtbmt.js +0 -2
- package/bundle/chunk-v6kenrks.js +0 -2
- package/bundle/chunk-v7dfqwxx.js +0 -2
- package/bundle/chunk-vf7hhxsa.js +0 -2
- package/bundle/chunk-vmhq6cyz.js +0 -2
- package/bundle/chunk-vvs87e61.js +0 -2
- package/bundle/chunk-w6z123g2.js +0 -2
- package/bundle/chunk-wg0849tq.js +0 -2
- package/bundle/chunk-xa0f5g9z.js +0 -2
- package/bundle/chunk-xj0ba60b.js +0 -2
- package/bundle/chunk-xtfcdgwe.js +0 -2
- package/bundle/chunk-xz7dccwp.js +0 -2
- package/bundle/chunk-ye6j8k26.js +0 -2
- package/bundle/chunk-zbvf09bm.js +0 -3
- package/bundle/chunk-zmqmccbc.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{$u as
|
|
2
|
+
import{$u as k,$v as ka,$w as kb,$x as jc,$y as jd,Av as L,Aw as La,Ax as Kb,Ay as Kc,Az as Kd,Bv as M,Bw as Ma,Bx as Lb,By as Lc,Bz as Ld,Cv as N,Cw as Na,Cx as Mb,Cy as Mc,Cz as Md,Dv as O,Dw as Oa,Dx as Nb,Dy as Nc,Dz as Nd,Ev as P,Ew as Pa,Ex as Ob,Ey as Oc,Ez as Od,Fv as Q,Fw as Qa,Fx as Pb,Fy as Pc,Gv as R,Gw as Ra,Gx as Qb,Gy as Qc,Hv as S,Hw as Sa,Hx as Rb,Hy as Rc,Iv as T,Iw as Ta,Ix as Sb,Iy as Sc,Jv as U,Jw as Ua,Jx as Tb,Jy as Tc,Kv as V,Kw as Va,Kx as Ub,Ky as Uc,Lv as W,Lw as Wa,Lx as Vb,Ly as Vc,Mv as X,Mw as Xa,Mx as Wb,My as Wc,Nv as Y,Nw as Ya,Nx as Xb,Ny as Xc,Ov as Z,Ow as Za,Ox as Yb,Oy as Yc,Pv as _,Pw as _a,Px as Zb,Py as Zc,Qu as a,Qv as $,Qw as $a,Qx as _b,Qy as _c,Ru as b,Rv as aa,Rw as ab,Rx as $b,Ry as $c,Su as c,Sv as ba,Sw as bb,Sx as ac,Sy as ad,Tu as d,Tv as ca,Tw as cb,Tx as bc,Ty as bd,Uu as e,Uv as da,Uw as db,Ux as cc,Uy as cd,Vu as f,Vv as ea,Vw as eb,Vx as dc,Vy as dd,Wu as g,Wv as fa,Ww as fb,Wx as ec,Wy as ed,Xv as ga,Xw as gb,Xx as fc,Xy as fd,Yu as h,Yv as ha,Yw as hb,Yx as gc,Yy as gd,Zu as i,Zv as ia,Zw as ib,Zx as hc,Zy as hd,_u as j,_v as ja,_w as jb,_x as ic,_y as id,av as l,aw as la,ax as lb,ay as kc,az as kd,bv as m,bw as ma,bx as mb,by as lc,bz as ld,cv as n,cw as na,cx as nb,cy as mc,cz as md,dv as o,dw as oa,dx as ob,dy as nc,dz as nd,ev as p,ew as pa,ex as pb,ey as oc,ez as od,fv as q,fw as qa,fx as qb,fy as pc,fz as pd,gv as r,gw as ra,gx as rb,gy as qc,gz as qd,hv as s,hw as sa,hx as sb,hy as rc,hz as rd,iv as t,iw as ta,ix as tb,iy as sc,iz as sd,jv as u,jw as ua,jx as ub,jy as tc,jz as td,kv as v,kw as va,kx as vb,ky as uc,kz as ud,lv as w,lw as wa,lx as wb,ly as vc,lz as vd,mv as x,mw as xa,mx as xb,my as wc,mz as wd,nv as y,nw as ya,nx as yb,ny as xc,nz as xd,ov as z,ow as za,ox as zb,oy as yc,oz as yd,pv as A,pw as Aa,px as Ab,py as zc,pz as zd,qv as B,qw as Ba,qx as Bb,qy as Ac,qz as Ad,rv as C,rw as Ca,rx as Cb,ry as Bc,rz as Bd,sv as D,sw as Da,sx as Db,sy as Cc,sz as Cd,tv as E,tw as Ea,ty as Dc,tz as Dd,uv as F,uw as Fa,ux as Eb,uy as Ec,uz as Ed,vv as G,vw as Ga,vx as Fb,vy as Fc,vz as Fd,wv as H,ww as Ha,wx as Gb,wy as Gc,wz as Gd,xv as I,xw as Ia,xx as Hb,xy as Hc,xz as Hd,yv as J,yw as Ja,yx as Ib,yy as Ic,yz as Id,zv as K,zw as Ka,zx as Jb,zy as Jc,zz as Jd}from"./chunk-6g3m7yxf.js";import"./chunk-hh4c02fh.js";export{ka as version,i as util,n as treeifyError,Nd as toJSONSchema,o as toDotPath,x as safeParseAsync,v as safeParse,L as safeEncodeAsync,H as safeEncode,N as safeDecodeAsync,J as safeDecode,Ib as registry,O as regexes,p as prettifyError,t as parseAsync,r as parse,Eb as locales,Ma as isValidJWT,Ja as isValidBase64URL,Ha as isValidBase64,Jb as globalRegistry,f as globalConfig,m as formatError,l as flattenError,D as encodeAsync,z as encode,F as decodeAsync,B as decode,g as config,h as clone,Yb as _xid,Ec as _void,Rb as _uuidv7,Qb as _uuidv6,Pb as _uuidv4,Ob as _uuid,Sb as _url,Zc as _uppercase,Cc as _unknown,jd as _union,zc as _undefined,Xb as _ulid,xc as _uint64,rc as _uint32,md as _tuple,fd as _trim,ud as _transform,hd as _toUpperCase,gd as _toLowerCase,Dd as _templateLiteral,yc as _symbol,Id as _superRefine,zd as _success,Kd as _stringbool,Ld as _stringFormat,Kb as _string,$c as _startsWith,Tc as _size,pd as _set,w as _safeParseAsync,u as _safeParse,K as _safeEncodeAsync,G as _safeEncode,M as _safeDecodeAsync,I as _safeDecode,Xc as _regex,Hd as _refine,nd as _record,Cd as _readonly,bd as _property,Fd as _promise,Mc as _positive,Bd as _pipe,s as _parseAsync,q as _parse,dd as _overwrite,vd as _optional,lc as _number,wd as _nullable,Ac as _null,ed as _normalize,Oc as _nonpositive,yd as _nonoptional,Pc as _nonnegative,Dc as _never,Nc as _negative,rd as _nativeEnum,Ub as _nanoid,Hc as _nan,Qc as _multipleOf,Sc as _minSize,Vc as _minLength,Lc as _min,cd as _mime,Rc as _maxSize,Uc as _maxLength,Jc as _max,od as _map,Jc as _lte,Ic as _lt,Yc as _lowercase,sd as _literal,Wc as _length,Ed as _lazy,Zb as _ksuid,fc as _jwt,jc as _isoTime,kc as _isoDuration,hc as _isoDateTime,ic as _isoDate,$b as _ipv6,_b as _ipv4,ld as _intersection,wc as _int64,qc as _int32,nc as _int,_c as _includes,Nb as _guid,Lc as _gte,Kc as _gt,pc as _float64,oc as _float32,td as _file,qd as _enum,ad as _endsWith,C as _encodeAsync,y as _encode,Tb as _emoji,Mb as _email,ec as _e164,kd as _discriminatedUnion,xd as _default,E as _decodeAsync,A as _decode,Fc as _date,Gd as _custom,Wb as _cuid2,Vb as _cuid,Lb as _coercedString,mc as _coercedNumber,Gc as _coercedDate,tc as _coercedBoolean,vc as _coercedBigint,bc as _cidrv6,ac as _cidrv4,Jd as _check,Ad as _catch,sc as _boolean,uc as _bigint,dc as _base64url,cc as _base64,id as _array,Bc as _any,gc as TimePrecision,a as NEVER,Md as JSONSchemaGenerator,Od as JSONSchema,ja as Doc,Fb as $output,Gb as $input,b as $constructor,c as $brand,xa as $ZodXID,_a as $ZodVoid,Ya as $ZodUnknown,db as $ZodUnion,Va as $ZodUndefined,pa as $ZodUUID,ra as $ZodURL,wa as $ZodULID,la as $ZodType,gb as $ZodTuple,nb as $ZodTransform,zb as $ZodTemplateLiteral,Ua as $ZodSymbol,tb as $ZodSuccess,na as $ZodStringFormat,ma as $ZodString,jb as $ZodSet,Hb as $ZodRegistry,hb as $ZodRecord,k as $ZodRealError,yb as $ZodReadonly,Bb as $ZodPromise,rb as $ZodPrefault,wb as $ZodPipe,ob as $ZodOptional,cb as $ZodObjectJIT,bb as $ZodObject,Qa as $ZodNumberFormat,Pa as $ZodNumber,pb as $ZodNullable,Wa as $ZodNull,sb as $ZodNonOptional,Za as $ZodNever,ta as $ZodNanoID,vb as $ZodNaN,ib as $ZodMap,lb as $ZodLiteral,Cb as $ZodLazy,ya as $ZodKSUID,Na as $ZodJWT,fb as $ZodIntersection,Ba as $ZodISOTime,Ca as $ZodISODuration,za as $ZodISODateTime,Aa as $ZodISODate,Ea as $ZodIPv6,Da as $ZodIPv4,oa as $ZodGUID,Ab as $ZodFunction,mb as $ZodFile,j as $ZodError,kb as $ZodEnum,e as $ZodEncodeError,sa as $ZodEmoji,qa as $ZodEmail,La as $ZodE164,eb as $ZodDiscriminatedUnion,qb as $ZodDefault,$a as $ZodDate,Oa as $ZodCustomStringFormat,Db as $ZodCustom,xb as $ZodCodec,ca as $ZodCheckUpperCase,$ as $ZodCheckStringFormat,ea as $ZodCheckStartsWith,X as $ZodCheckSizeEquals,aa as $ZodCheckRegex,ga as $ZodCheckProperty,ia as $ZodCheckOverwrite,T as $ZodCheckNumberFormat,S as $ZodCheckMultipleOf,W as $ZodCheckMinSize,Z as $ZodCheckMinLength,ha as $ZodCheckMimeType,V as $ZodCheckMaxSize,Y as $ZodCheckMaxLength,ba as $ZodCheckLowerCase,Q as $ZodCheckLessThan,_ as $ZodCheckLengthEquals,da as $ZodCheckIncludes,R as $ZodCheckGreaterThan,fa as $ZodCheckEndsWith,U as $ZodCheckBigIntFormat,P as $ZodCheck,ub as $ZodCatch,va as $ZodCUID2,ua as $ZodCUID,Ga as $ZodCIDRv6,Fa as $ZodCIDRv4,Ra as $ZodBoolean,Ta as $ZodBigIntFormat,Sa as $ZodBigInt,Ka as $ZodBase64URL,Ia as $ZodBase64,d as $ZodAsyncError,ab as $ZodArray,Xa as $ZodAny};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Ho as w,Io as A,Lo as U,Mo as O,Qo as R,So as s,To as F}from"./chunk-wmw2gne9.js";import{gp as G,kp as L}from"./chunk-3z1y040p.js";import{Ot as M,Tt as k}from"./chunk-1jh5p5qw.js";import{ON as y}from"./chunk-dkm7x8rj.js";import{AP as Y}from"./chunk-hh4c02fh.js";var _={};Y(_,{schema:()=>x,jsonc:()=>v,ConfigParse:()=>_});function v($,r){let E=[],J=w($,E,{allowTrailingComma:!0});if(E.length){let C=$.split(`
|
|
3
3
|
`),T=E.map((I)=>{let Z=$.substring(0,I.offset).split(`
|
|
4
4
|
`),H=Z.length,j=Z[Z.length-1].length+1,B=C[H-1],Q=`${A(I.error)} at line ${H}, column ${j}`;if(!B)return Q;return`${Q}
|
|
5
5
|
Line ${H}: ${B}
|
|
@@ -11,4 +11,4 @@ ${$}
|
|
|
11
11
|
${T}
|
|
12
12
|
--- End ---`})}return J}function x($,r,E){let J=$.safeParse(r);if(J.success)return J.data;throw new O({path:E,issues:J.error.issues})}var m={};Y(m,{substitute:()=>c,ConfigVariable:()=>m});import W from"path";import f from"os";function S($){return $.type==="path"?$.path:$.source}function d($){return $.type==="path"?W.dirname($.path):$.dir}async function c($){let r=$.missing??"error",E=$.text.replace(/\{env:([^}]+)\}/g,(H,j)=>{return process.env[j]||""}),J=Array.from(E.matchAll(/\{file:[^}]+\}/g));if(!J.length)return E;let C=d($),T=S($),I="",Z=0;for(let H of J){let j=H[0],B=H.index;I+=E.slice(Z,B);let Q=E.lastIndexOf(`
|
|
13
13
|
`,B-1)+1;if(E.slice(Q,B).trimStart().startsWith("//")){I+=j,Z=B+j.length;continue}let K=j.replace(/^\{file:/,"").replace(/\}$/,"");if(K.startsWith("~/"))K=W.join(f.homedir(),K.slice(2));let b=W.isAbsolute(K)?K:W.resolve(C,K),o=(await k.readText(b).catch((X)=>{if(r==="empty")return"";let q=`bad file reference: "${j}"`;if(X.code==="ENOENT")throw new O({path:T,message:q+` ${b} does not exist`},{cause:X});throw new O({path:T,message:q},{cause:X})})).trim();I+=JSON.stringify(o).slice(1,-1),Z=B+j.length}return I+=E.slice(Z),I}var V={};Y(V,{resolvePluginSpec:()=>h,pluginSpecifier:()=>N,pluginOptions:()=>g,load:()=>a,deduplicatePluginOrigins:()=>u,Spec:()=>n,Options:()=>P,ConfigPlugin:()=>V});import{pathToFileURL as D}from"url";import z from"path";var P=y.Record(y.String,y.Unknown).pipe(G(($)=>({zod:L($)}))),n=y.Union([y.String,y.mutable(y.Tuple([y.String,P]))]).pipe(G(($)=>({zod:L($)})));async function a($){let r=[];for(let E of await M.scan("{plugin,plugins}/*.{ts,js}",{cwd:$,absolute:!0,dot:!0,symlink:!0}))r.push(D(E).href);return r}function N($){return Array.isArray($)?$[0]:$}function g($){return Array.isArray($)?$[1]:void 0}async function h($,r){let E=N($);if(!s(E))return $;let J=z.dirname(r),C=(()=>{if(E.startsWith("file://"))return E;if(z.isAbsolute(E)||/^[A-Za-z]:[\\/]/.test(E))return D(E).href;return D(z.resolve(J,E)).href})(),T=await F(C).catch(()=>C);if(Array.isArray($))return[T,$[1]];return T}function u($){let r=new Set,E=[];for(let J of $.toReversed()){let C=N(J.spec),T=C.startsWith("file://")?C:R(C).pkg;if(r.has(T))continue;r.add(T),E.push(J)}return E.toReversed()}
|
|
14
|
-
export{_ as
|
|
14
|
+
export{_ as Do,m as Eo,V as Fo};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{we as M}from"./chunk-1xyn0sp2.js";import{ze as D}from"./chunk-3nhqd8wg.js";import{Ae as B}from"./chunk-fkvccmgk.js";import{uf as d,wf as w}from"./chunk-jbd9k041.js";import{yP as n}from"./chunk-hh4c02fh.js";var R=n(D(),1),i=n(d(),1),A=n(M(),1);import N from"fs/promises";var S=n(d(),1);var _="169.254.170.2",p="169.254.170.23",u="[fd00:ec2::23]",g=(e,c)=>{if(e.protocol==="https:")return;if(e.hostname===_||e.hostname===p||e.hostname===u)return;if(e.hostname.includes("[")){if(e.hostname==="[::1]"||e.hostname==="[0000:0000:0000:0000:0000:0000:0000:0001]")return}else{if(e.hostname==="localhost")return;let a=e.hostname.split("."),r=(t)=>{let s=parseInt(t,10);return 0<=s&&s<=255};if(a[0]==="127"&&r(a[1])&&r(a[2])&&r(a[3])&&a.length===4)return}throw new S.CredentialsProviderError(`URL not accepted. It must either be HTTPS or match one of the following:
|
|
3
3
|
- loopback CIDR 127.0.0.0/8 or [::1/128]
|
|
4
4
|
- ECS container host 169.254.170.2
|
|
5
5
|
- EKS container host 169.254.170.23 or [fd00:ec2::23]`,{logger:c})};var f=n(d(),1),I=n(B(),1),P=n(w(),1),K=n(w(),1);function x(e){return new I.HttpRequest({protocol:e.protocol,hostname:e.hostname,port:Number(e.port),path:e.pathname,query:Array.from(e.searchParams.entries()).reduce((c,[a,r])=>{return c[a]=r,c},{}),fragment:e.hash})}async function E(e,c){let r=await K.sdkStreamMixin(e.body).transformToString();if(e.statusCode===200){let t=JSON.parse(r);if(typeof t.AccessKeyId!=="string"||typeof t.SecretAccessKey!=="string"||typeof t.Token!=="string"||typeof t.Expiration!=="string")throw new f.CredentialsProviderError("HTTP credential provider response not of the required format, an object matching: { AccessKeyId: string, SecretAccessKey: string, Token: string, Expiration: string(rfc3339) }",{logger:c});return{accessKeyId:t.AccessKeyId,secretAccessKey:t.SecretAccessKey,sessionToken:t.Token,expiration:P.parseRfc3339DateTime(t.Expiration)}}if(e.statusCode>=400&&e.statusCode<500){let t={};try{t=JSON.parse(r)}catch(s){}throw Object.assign(new f.CredentialsProviderError(`Server responded with status: ${e.statusCode}`,{logger:c}),{Code:t.Code,Message:t.Message})}throw new f.CredentialsProviderError(`Server responded with status: ${e.statusCode}`,{logger:c})}var T=(e,c,a)=>{return async()=>{for(let r=0;r<c;++r)try{return await e()}catch(t){await new Promise((s)=>setTimeout(s,a))}return await e()}};var j="AWS_CONTAINER_CREDENTIALS_RELATIVE_URI",J="http://169.254.170.2",$="AWS_CONTAINER_CREDENTIALS_FULL_URI",G="AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE",H="AWS_CONTAINER_AUTHORIZATION_TOKEN",k=(e={})=>{e.logger?.debug("@aws-sdk/credential-provider-http - fromHttp");let c,a=e.awsContainerCredentialsRelativeUri??process.env[j],r=e.awsContainerCredentialsFullUri??process.env[$],t=e.awsContainerAuthorizationToken??process.env[H],s=e.awsContainerAuthorizationTokenFile??process.env[G],m=e.logger?.constructor?.name==="NoOpLogger"||!e.logger?.warn?console.warn:e.logger.warn.bind(e.logger);if(a&&r)m("@aws-sdk/credential-provider-http: you have set both awsContainerCredentialsRelativeUri and awsContainerCredentialsFullUri."),m("awsContainerCredentialsFullUri will take precedence.");if(t&&s)m("@aws-sdk/credential-provider-http: you have set both awsContainerAuthorizationToken and awsContainerAuthorizationTokenFile."),m("awsContainerAuthorizationToken will take precedence.");if(r)c=r;else if(a)c=`${J}${a}`;else throw new i.CredentialsProviderError(`No HTTP credential provider host provided.
|
|
6
|
-
Set AWS_CONTAINER_CREDENTIALS_FULL_URI or AWS_CONTAINER_CREDENTIALS_RELATIVE_URI.`,{logger:e.logger});let y=new URL(c);g(y,e.logger);let C=A.NodeHttpHandler.create({connectionTimeout:e.timeout??1000}),O=e.timeout??1000,b=T(async()=>{let o=x(y);if(t)o.headers.Authorization=t;else if(s)o.headers.Authorization=(await N.readFile(s)).toString();try{let h=await C.handle(o,{requestTimeout:O});return E(h.response).then((v)=>R.setCredentialFeature(v,"CREDENTIALS_HTTP","z"))}catch(h){throw new i.CredentialsProviderError(String(h),{logger:e.logger})}},e.maxRetries??3,e.timeout??1000);return async()=>{try{return await b()}finally{C.destroy?.()}}};export{k as
|
|
6
|
+
Set AWS_CONTAINER_CREDENTIALS_FULL_URI or AWS_CONTAINER_CREDENTIALS_RELATIVE_URI.`,{logger:e.logger});let y=new URL(c);g(y,e.logger);let C=A.NodeHttpHandler.create({connectionTimeout:e.timeout??1000}),O=e.timeout??1000,b=T(async()=>{let o=x(y);if(t)o.headers.Authorization=t;else if(s)o.headers.Authorization=(await N.readFile(s)).toString();try{let h=await C.handle(o,{requestTimeout:O});return E(h.response).then((v)=>R.setCredentialFeature(v,"CREDENTIALS_HTTP","z"))}catch(h){throw new i.CredentialsProviderError(String(h),{logger:e.logger})}},e.maxRetries??3,e.timeout??1000);return async()=>{try{return await b()}finally{C.destroy?.()}}};export{k as Zd};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Rz as a7,Sz as o7,yz as RZ}from"./chunk-01gtn79f.js";import{$B as l1,$C as GZ,$F as h8,$N as $5,AA as I7,AB as RY,AC as K7,AE as w8,AG as b7,BA as $1,BD as T1,BE as A$,BF as n0,BG as X1,BJ as l8,BO as O0,CA as v8,CE as U$,CF as P,CG as q7,CH as QJ,CJ as i8,CO as dY,DA as b8,DB as x0,DC as V7,DD as Y1,DE as S7,DG as K0,EA as Y6,EC as z6,ED as R7,EF as J1,EG as f8,EO as OJ,FE as S8,FG as JZ,FH as n5,FJ as p8,GL as T$,HA as _5,HC as y0,HG as x7,HJ as n8,HL as w6,IE as F$,JC as b1,JE as x5,JG as D5,JH as o,JL as H6,KC as W6,KE as O1,KO as P$,LK as D0,LL as y1,LO as DJ,MC as q5,MF as N$,MJ as D1,ML as E6,NC as A6,NF as m8,NH as _0,NJ as L$,NL as k0,OC as wJ,OG as y7,OK as m6,OL as I0,PC as HJ,PF as g7,PG as k7,QH as F0,QJ as C5,QN as H$,RF as C7,RG as m7,RJ as M$,RL as cY,SC as U6,SG as h7,TH as l5,TL as mY,TN as K1,UA as q,UB as H,UC as F6,UH as a$,UN as I5,VB as b,VG as $J,VL as k1,VN as p7,WA as P7,WB as y$,WG as jZ,WM as AZ,WN as tZ,XB as r,XE as p$,XG as f7,XN as k$,YA as S0,YB as BY,YC as S,YF as FY,YG as E5,ZB as L1,ZC as bY,ZG as ZY,ZH as V0,ZN as SY,_C as e$,_E as L0,_G as J6,_H as bZ,aD as gZ,aF as a5,bB as K6,bC as XZ,bF as x8,bG as d,bH as W5,cB as _6,cC as O6,cG as F,dD as zY,dG as _Z,dL as x1,eB as g0,eD as y,eF as y8,eG as WY,eL as F7,fC as PY,fG as e,fI as i0,fL as H8,gC as h,gD as j7,gF as z0,gI as g1,gN as I6,gO as X0,hF as YJ,hH as c7,hL as f,hN as w$,iC as a6,iD as j,iH as c8,iI as L6,iL as iY,jB as B6,jG as i,jH as w1,jI as M6,kB as hZ,kC as iZ,kD as aZ,kE as i$,kF as EJ,kG as g,kO as h5,lC as o6,lD as z7,lF as H1,lG as eZ,lH as OY,mC as X7,mD as v7,mF as Z6,mG as BJ,mJ as nY,nF as ZJ,nG as GY,nH as jJ,nL as E0,oF as M0,oH as d7,oO as XJ,pC as D6,pD as gY,pE as p5,pF as IJ,pG as u,pH as JJ,pO as n7,qB as V6,qD as IZ,qE as V1,qG as U,qH as K5,qI as T6,rB as fY,rF as pY,rH as d8,rI as q1,rO as E$,sD as _7,sF as $6,sG as $0,sH as u7,tB as k6,tD as Y0,tE as R8,tF as DZ,tG as Q1,tO as I$,uA as vY,uD as B5,uF as PJ,uN as tY,vF as _J,vG as n$,vH as l7,vN as r8,wA as O,wB as hY,wE as G5,wF as rY,wG as L,wN as LZ,xA as BZ,xF as sY,xH as i7,xO as P5,yH as g5,yJ as u8,yL as IY,yO as wZ,zA as DY,zB as _Y,zC as G7,zL as o8,zO as J8}from"./chunk-meaa7wrs.js";import{nP as kY}from"./chunk-fa03gsff.js";var mZ={};kY(mZ,{isHttpClientError:()=>P0,TransportError:()=>j0,StatusCodeError:()=>kZ,InvalidUrlError:()=>v0,HttpClientErrorSchema:()=>S1,HttpClientError:()=>x,EncodeError:()=>X6,EmptyBodyError:()=>R0,DecodeError:()=>TY});var H0="~effect/http/HttpClientError",P0=(Y)=>q(Y,H0);class x extends P("HttpClientError"){constructor(Y){if("cause"in Y.reason)super({...Y,cause:Y.reason.cause});else super(Y)}[H0]=H0;get request(){return this.reason.request}get response(){return"response"in this.reason?this.reason.response:void 0}get message(){return this.reason.message}}var UZ=(Y)=>Y.endsWith("Error")?Y.slice(0,-5):Y,FZ=(Y,Z,$)=>Z?`${Y}: ${Z} (${$})`:`${Y} error (${$})`;class j0 extends P("TransportError"){get methodAndUrl(){return`${this.request.method} ${this.request.url}`}get message(){return FZ(UZ(this._tag),this.description,this.methodAndUrl)}}class X6 extends P("EncodeError"){get methodAndUrl(){return`${this.request.method} ${this.request.url}`}get message(){return FZ(UZ(this._tag),this.description,this.methodAndUrl)}}class v0 extends P("InvalidUrlError"){get methodAndUrl(){return`${this.request.method} ${this.request.url}`}get message(){return FZ(UZ(this._tag),this.description,this.methodAndUrl)}}class kZ extends P("StatusCodeError"){get methodAndUrl(){return`${this.request.method} ${this.request.url}`}get message(){let Y=`${this.response.status} ${this.methodAndUrl}`;return FZ(UZ(this._tag),this.description,Y)}}class TY extends P("DecodeError"){get methodAndUrl(){return`${this.request.method} ${this.request.url}`}get message(){let Y=`${this.response.status} ${this.methodAndUrl}`;return FZ(UZ(this._tag),this.description,Y)}}class R0 extends P("EmptyBodyError"){get methodAndUrl(){return`${this.request.method} ${this.request.url}`}get message(){let Y=`${this.response.status} ${this.methodAndUrl}`;return FZ(UZ(this._tag),this.description,Y)}}class S1 extends tY(H0)({_tag:mY("HttpError"),kind:I0(["EncodeError","DecodeError","TransportError","InvalidUrlError","StatusCodeError","EmptyBodyError"]),cause:E0(AZ)}){static fromHttpClientError(Y){return new S1({_tag:"HttpError",kind:Y.reason._tag,cause:Y.reason})}}var pZ={};kY(pZ,{updateUrl:()=>zQ,trace:()=>XQ,toWebResult:()=>Z7,toWeb:()=>vQ,toUrl:()=>o1,setUrlParams:()=>e6,setUrlParam:()=>_Q,setUrl:()=>EZ,setMethod:()=>r6,setHeaders:()=>p0,setHeader:()=>HZ,setHash:()=>Y7,setBody:()=>$Y,schemaBodyJson:()=>NQ,removeHash:()=>DQ,put:()=>ZQ,prependUrl:()=>a1,post:()=>eJ,patch:()=>YQ,options:()=>QQ,modify:()=>p1,makeWith:()=>R,make:()=>KY,isHttpClientRequest:()=>KZ,head:()=>JQ,get:()=>tJ,fromWeb:()=>EQ,empty:()=>i1,delete:()=>$Q,bodyUrlParams:()=>LQ,bodyUint8Array:()=>WQ,bodyText:()=>AQ,bodyStream:()=>wQ,bodyJsonUnsafe:()=>FQ,bodyJson:()=>UQ,bodyFormDataRecord:()=>TQ,bodyFormData:()=>MQ,bodyFile:()=>HQ,bearerToken:()=>KQ,basicAuth:()=>GQ,appendUrlParams:()=>OQ,appendUrlParam:()=>BQ,appendUrl:()=>VQ,acceptJson:()=>s6,accept:()=>n1});var G6=Symbol.for("~effect/http/Headers");var NZ=Object.create(null);Object.defineProperties(NZ,{[G6]:{value:G6},[V6]:{value(Y){return YZ(this,y(Y,cZ))}},toJSON:{value(){return fY(this)}},[g0]:{value(Y){return fJ(this,Y)}},[S0]:{value(){return K6(this)}},toString:{value:_Y.toString},[hY]:{value:_Y[hY]}});var C0=(Y)=>Object.assign(Object.create(NZ),Y),fJ=z6(hZ());var n=Object.create(NZ),C=(Y)=>{if(Y===void 0)return n;else if(Symbol.iterator in Y){let $=Object.create(NZ);for(let[J,Q]of Y)$[J.toLowerCase()]=Q;return $}let Z=Object.create(NZ);for(let[$,J]of Object.entries(Y))if(Array.isArray(J))Z[$.toLowerCase()]=J.join(", ");else if(J!==void 0)Z[$.toLowerCase()]=J;return Z},wY=(Y)=>Object.setPrototypeOf(Y,NZ);var HY=O(3,(Y,Z,$)=>{let J=C0(Y);return J[Z.toLowerCase()]=$,J}),b0=O(2,(Y,Z)=>C0({...Y,...C(Z)})),fZ=O(2,(Y,Z)=>{let $=C0(Y);return Object.assign($,Z),$}),q0=O(2,(Y,Z)=>{let $=C0(Y);return delete $[Z.toLowerCase()],$});var YZ=O(2,(Y,Z)=>{let $={...Y},J=(Q)=>{if(typeof Q==="string"){let X=Q.toLowerCase();if(X in Y)$[X]=g1(Y[X])}else for(let X in Y)if(Q.test(X))$[X]=g1(Y[X])};if(Array.isArray(Z))for(let Q=0;Q<Z.length;Q++)J(Z[Q]);else J(Z);return $}),cZ=j("effect/Headers/CurrentRedactedNames",{defaultValue:()=>["authorization","cookie","set-cookie","x-api-key"]});var C1="~effect/http/UrlParams",cJ=(Y)=>q(Y,C1),dJ={...x0,[C1]:C1,[Symbol.iterator](){return this.params[Symbol.iterator]()},toJSON(){return{_id:"UrlParams",params:Object.fromEntries(this.params)}},[g0](Y){return j6(this,Y)},[S0](){return _6(this.params.flat())}},ZZ=(Y)=>{let Z=Object.create(dJ);return Z.params=Y,Z},a=(Y)=>{let Z=P6(Y),$=[];for(let J=0;J<Z.length;J++)if(Array.isArray(Z[J][0])){let[Q,X]=Z[J];$.push([`${Q[0]}[${Q.slice(1).join("][")}]`,X])}else $.push(Z[J]);return ZZ($)},P6=(Y)=>{let Z=typeof Y[Symbol.iterator]==="function"?y0(Y):Object.entries(Y),$=[];for(let[J,Q]of Z)if(Array.isArray(Q)){for(let X=0;X<Q.length;X++)if(Q[X]!==void 0)$.push([J,String(Q[X])])}else if(typeof Q==="object"){let X=P6(Q);for(let[G,K]of X)$.push([[J,...typeof G==="string"?[G]:G],K])}else if(Q!==void 0)$.push([J,String(Q)]);return $},j6=B6((Y,Z)=>uJ(Y.params,Z.params)),uJ=F6(D6([hZ(),hZ()])),v6=x1(cJ,{typeConstructor:{_tag:"effect/http/UrlParams"},generation:{runtime:"UrlParams.UrlParamsSchema",Type:"UrlParams.UrlParams",Encoded:'typeof UrlParams.UrlParamsSchema["Encoded"]',importDeclaration:'import * as UrlParams from "effect/unstable/http/UrlParams"'},expected:"UrlParams",toEquivalence:()=>j6,toCodec:()=>k1()(y1(H6([IY,IY])),q1({decode:ZZ,encode:(Y)=>Y.params}))}),m0=ZZ([]);var lJ=O(2,(Y,Z)=>A6(Y.params,([$])=>$===Z).pipe(O6(([,$])=>$)));var R6=O(3,(Y,Z,$)=>ZZ(b1(U6(Y.params,([J])=>J!==Z),[Z,String($)]))),iJ=O(2,(Y,Z)=>ZZ(Z(Y.params))),S6=O(2,(Y,Z)=>{let $=a(Z),J=$.params,Q=new Set;for(let X=0;X<J.length;X++)Q.add(J[X][0]);for(let X=0;X<Y.params.length;X++){if(Q.has(Y.params[X][0]))continue;J.push(Y.params[X])}return $}),g6=O(3,(Y,Z,$)=>ZZ(b1(Y.params,[Z,String($)]))),C6=O(2,(Y,Z)=>iJ(Y,W6(a(Z).params)));class h0 extends P("UrlParamsError"){}var uZ=(Y,Z,$)=>{try{let J=new URL(Y,pJ());for(let Q=0;Q<Z.params.length;Q++){let[X,G]=Z.params[Q];if(G!==void 0)J.searchParams.append(X,G)}if($!==void 0)J.hash=$;return PY(J)}catch(J){return h(new h0({cause:J}))}},f0=(Y)=>new URLSearchParams(Y.params).toString(),pJ=()=>{if("location"in globalThis&&globalThis.location!==void 0&&globalThis.location.origin!==void 0&&globalThis.location.pathname!==void 0)return location.origin+location.pathname;return},nJ=(Y)=>{let Z={};for(let[$,J]of Y.params){let Q=Z[$];if(Q===void 0)Z[$]=J;else if(typeof Q==="string")Z[$]=[Q,J];else Q.push(J)}return Z},aJ=nJ,b6=(Y)=>v6.pipe(cY(I6,T6({decode:(Z)=>BY(lJ(Z,Y),{onNone:()=>g(new L6([Y],new M6(void 0))),onSome:F}),encode:(Z)=>F(ZZ([[Y,Z]]))}))),q6=v6.pipe(cY(w6(IY,k0([IY,E6(IY)])),q1({decode:aJ,encode:a})));var m1="~effect/http/HttpBody";var x6="~effect/http/HttpBody/HttpBodyError";class f1 extends P("HttpBodyError"){[x6]=x6}class MZ{[m1];constructor(){this[m1]=m1}[hY](){return this.toJSON()}toString(){return k6(this,{ignoreToString:!0})}}class h6 extends MZ{_tag="Empty";toJSON(){return{_id:"effect/HttpBody",_tag:"Empty"}}}var QZ=new h6;class f6 extends MZ{_tag="Raw";body;contentType;contentLength;constructor(Y,Z,$){super();this.body=Y,this.contentType=Z,this.contentLength=$}toJSON(){return{_id:"effect/HttpBody",_tag:"Raw",body:this.body,contentType:this.contentType,contentLength:this.contentLength}}}var c1=(Y,Z)=>new f6(Y,Z?.contentType,Z?.contentLength);class c6 extends MZ{_tag="Uint8Array";body;contentType;contentLength;constructor(Y,Z,$){super();this.body=Y,this.contentType=Z,this.contentLength=$}toJSON(){return{_id:"effect/HttpBody",_tag:"Uint8Array",body:this.contentType.startsWith("text/")||this.contentType.endsWith("json")?new TextDecoder().decode(this.body):`Uint8Array(${this.body.length})`,contentType:this.contentType,contentLength:this.contentLength}}}var lZ=(Y,Z)=>new c6(Y,Z??"application/octet-stream",Y.length),oJ=new TextEncoder,uY=(Y,Z)=>lZ(oJ.encode(Y),Z??"text/plain"),c0=(Y,Z)=>uY(JSON.stringify(Y),Z??"application/json"),d0=(Y,Z)=>GY({try:()=>uY(JSON.stringify(Y),Z??"application/json"),catch:($)=>new f1({reason:{_tag:"JsonError"},cause:$})}),d1=(Y,Z)=>{let $=m6(LZ(Y));return(J,Q)=>$(J,Z).pipe(JZ((X)=>new f1({reason:{_tag:"SchemaError",issue:X},cause:X})),U((X)=>d0(X,Q)))},d6=(Y,Z)=>uY(f0(Y),Z??"application/x-www-form-urlencoded");class u6 extends MZ{_tag="FormData";contentType=void 0;contentLength=void 0;formData;constructor(Y){super();this.formData=Y}toJSON(){return{_id:"effect/HttpBody",_tag:"FormData",formData:this.formData}}}var u0=(Y)=>new u6(Y),y6=(Y,Z,$)=>{if($==null)return;if(typeof $==="object"){Y.append(Z,$);return}Y.append(Z,String($))},l6=(Y)=>{let Z=new globalThis.FormData;for(let[$,J]of Object.entries(Y))if(Array.isArray(J))for(let Q of J)y6(Z,$,Q);else y6(Z,$,J);return u0(Z)};class i6 extends MZ{_tag="Stream";stream;contentType;contentLength;constructor(Y,Z,$){super();this.stream=Y,this.contentType=Z,this.contentLength=$}toJSON(){return{_id:"effect/HttpBody",_tag:"Stream",contentType:this.contentType,contentLength:this.contentLength}}}var jY=(Y,Z,$)=>new i6(Y,Z??"application/octet-stream",$),p6=(Y,Z)=>U(dY.asEffect(),($)=>L($.stat(Y),(J)=>jY($.stream(Y,Z),Z?.contentType,Number(J.size))));var TZ=(Y)=>Y!=="GET"&&Y!=="HEAD"&&Y!=="OPTIONS"&&Y!=="TRACE";var n6=[["GET","get"],["POST","post"],["PUT","put"],["DELETE","del"],["PATCH","patch"],["HEAD","head"],["OPTIONS","options"],["TRACE","trace"]];var u1="~effect/http/HttpClientRequest",KZ=(Y)=>q(Y,u1),sJ={[u1]:u1,..._Y,toJSON(){return{_id:"HttpClientRequest",method:this.method,url:this.url,urlParams:this.urlParams,hash:this.hash,headers:fY(this.headers),body:this.body.toJSON()}},pipe(){return vY(this,arguments)}};function R(Y,Z,$,J,Q,X){let G=Object.create(sJ);return G.method=Y,G.url=Z,G.urlParams=$,G.hash=J,G.headers=Q,G.body=X,G}var i1=R("GET","",m0,H(),n,QZ),KY=(Y)=>(Z,$)=>p1(i1,{method:Y,url:Z,...$??void 0}),tJ=KY("GET"),eJ=KY("POST"),YQ=KY("PATCH"),ZQ=KY("PUT"),$Q=KY("DELETE");var JQ=KY("HEAD"),QQ=KY("OPTIONS"),XQ=KY("TRACE"),p1=O(2,(Y,Z)=>{let $=Y;if(Z.method)$=r6($,Z.method);if(Z.url)$=EZ($,Z.url);if(Z.headers)$=p0($,Z.headers);if(Z.urlParams)$=e6($,Z.urlParams);if(Z.hash)$=Y7($,Z.hash);if(Z.body)$=$Y($,Z.body);if(Z.accept)$=n1($,Z.accept);if(Z.acceptJson)$=s6($);return $}),r6=O(2,(Y,Z)=>R(Z,Y.url,Y.urlParams,Y.hash,Y.headers,Y.body)),HZ=O(3,(Y,Z,$)=>R(Y.method,Y.url,Y.urlParams,Y.hash,HY(Y.headers,Z,$),Y.body)),p0=O(2,(Y,Z)=>R(Y.method,Y.url,Y.urlParams,Y.hash,b0(Y.headers,Z),Y.body)),GQ=O(3,(Y,Z,$)=>HZ(Y,"Authorization",`Basic ${btoa(`${i0(Z)}:${i0($)}`)}`)),KQ=O(2,(Y,Z)=>HZ(Y,"Authorization",`Bearer ${i0(Z)}`)),n1=O(2,(Y,Z)=>HZ(Y,"Accept",Z)),s6=n1("application/json"),EZ=O(2,(Y,Z)=>{if(typeof Z==="string")return R(Y.method,Z,Y.urlParams,Y.hash,Y.headers,Y.body);let $=new URL(Z.toString()),J=a($.searchParams),Q=l1($.hash===""?void 0:$.hash.slice(1));return $.search="",$.hash="",R(Y.method,$.toString(),J,Q,Y.headers,Y.body)}),a1=O(2,(Y,Z)=>{if(Z==="")return Y;return R(Y.method,t6(Z,Y.url),Y.urlParams,Y.hash,Y.headers,Y.body)}),VQ=O(2,(Y,Z)=>{if(Z==="")return Y;return R(Y.method,t6(Y.url,Z),Y.urlParams,Y.hash,Y.headers,Y.body)}),t6=(Y,Z)=>{let $=Y.endsWith("/"),J=Z.startsWith("/");return $&&J?Y+Z.slice(1):!$&&!J?Y+"/"+Z:Y+Z},zQ=O(2,(Y,Z)=>R(Y.method,Z(Y.url),Y.urlParams,Y.hash,Y.headers,Y.body)),_Q=O(3,(Y,Z,$)=>R(Y.method,Y.url,R6(Y.urlParams,Z,$),Y.hash,Y.headers,Y.body)),e6=O(2,(Y,Z)=>R(Y.method,Y.url,S6(Y.urlParams,Z),Y.hash,Y.headers,Y.body)),BQ=O(3,(Y,Z,$)=>R(Y.method,Y.url,g6(Y.urlParams,Z,$),Y.hash,Y.headers,Y.body)),OQ=O(2,(Y,Z)=>R(Y.method,Y.url,C6(Y.urlParams,Z),Y.hash,Y.headers,Y.body)),Y7=O(2,(Y,Z)=>R(Y.method,Y.url,Y.urlParams,b(Z),Y.headers,Y.body)),DQ=(Y)=>R(Y.method,Y.url,Y.urlParams,H(),Y.headers,Y.body),$Y=O(2,(Y,Z)=>{let $=Y.headers;if(Z._tag==="Empty"||Z._tag==="FormData")$=q0(q0($,"Content-Type"),"Content-length");else{if(Z.contentType)$=HY($,"content-type",Z.contentType);if(Z.contentLength!==void 0)$=HY($,"content-length",Z.contentLength.toString())}return R(Y.method,Y.url,Y.urlParams,Y.hash,$,Z)}),WQ=O((Y)=>KZ(Y[0]),(Y,Z,$)=>$Y(Y,lZ(Z,$))),AQ=O((Y)=>KZ(Y[0]),(Y,Z,$)=>$Y(Y,uY(Z,$))),UQ=O(2,(Y,Z)=>L(d0(Z),($)=>$Y(Y,$))),FQ=O(2,(Y,Z)=>$Y(Y,c0(Z))),NQ=(Y,Z)=>{let $=d1(Y,Z);return O(2,(J,Q)=>L($(Q),(X)=>$Y(J,X)))},LQ=O(2,(Y,Z)=>$Y(Y,d6(a(Z)))),MQ=O(2,(Y,Z)=>$Y(Y,u0(Z))),TQ=O(2,(Y,Z)=>$Y(Y,l6(Z))),wQ=O((Y)=>KZ(Y[0]),(Y,Z,$)=>$Y(Y,jY(Z,$?.contentType,$?.contentLength))),HQ=O((Y)=>KZ(Y[0]),(Y,Z,$)=>L(p6(Z,$),(J)=>$Y(Y,J)));function o1(Y){let Z=uZ(Y.url,Y.urlParams,XZ(Y.hash));if(o6(Z))return b(Z.success);return H()}var EQ=(Y)=>{let Z=Y.method.toUpperCase();return p1(i1,{method:Z,url:new URL(Y.url),headers:Y.headers,body:IQ(Y,Z)})},IQ=(Y,Z)=>{if(!TZ(Z)||Y.body===null)return QZ;return c1(Y.body,{contentType:Y.headers.get("content-type")??void 0,contentLength:PQ(Y.headers.get("content-length"))})},PQ=(Y)=>{if(Y===null)return;let Z=Number.parseInt(Y,10);return Number.isNaN(Z)?void 0:Z},Z7=(Y,Z)=>{let $=uZ(Y.url,Y.urlParams,XZ(Y.hash));if(iZ($))return h($.failure);let J={method:Y.method,headers:Y.headers};if(Z?.signal)J.signal=Z.signal;if(TZ(Y.method))switch(Y.body._tag){case"Empty":break;case"Raw":{if(J.body=Y.body.body,jQ(Y.body.body))J.duplex="half";break}case"Uint8Array":{J.body=Y.body.body;break}case"FormData":{J.body=Y.body.formData;break}case"Stream":{J.body=wZ(Y.body.stream,Z?.context??GZ()),J.duplex="half";break}}return a6({try:()=>new Request($.success,J),catch:(Q)=>new h0({cause:Q})})},jQ=(Y)=>typeof ReadableStream<"u"&&Y instanceof ReadableStream,vQ=(Y,Z)=>ZY(($)=>Z7(Y,{context:$,signal:Z?.signal}).asEffect());var e0={};kY(e0,{stream:()=>kQ,schemaNoBody:()=>yQ,schemaJson:()=>xQ,schemaHeaders:()=>N7,schemaBodyUrlParams:()=>oZ,schemaBodyJson:()=>s0,matchStatus:()=>mQ,fromWeb:()=>J5,filterStatusOk:()=>X5,filterStatus:()=>Q5,TypeId:()=>zZ});var r1="~effect/http/Cookies",SQ=(Y)=>q(Y,r1);var $7="~effect/http/Cookies/Cookie";var J7="~effect/http/Cookies/CookieError";class B7 extends n0{}class VZ extends P("CookieError"){static fromReason(Y,Z){return new VZ({reason:new B7({_tag:Y,cause:Z})})}[J7]=J7;get message(){return this.reason._tag}}var gQ={[r1]:r1,..._Y,toJSON(){return{_id:"effect/Cookies",cookies:K7(this.cookies,(Y)=>Y.toJSON())}},pipe(){return vY(this,arguments)}},t1=(Y)=>{let Z=Object.create(gQ);return Z.cookies=Y,Z},O7=(Y)=>{let Z={};for(let $ of Y)Z[$.name]=$;return t1(Z)},e1=(Y)=>{let Z=typeof Y==="string"?[Y]:Y,$=[];for(let J of Z){let Q=CQ(J.trim());if(Q)$.push(Q)}return O7($)};function CQ(Y){let Z=Y.split(";").map((K)=>K.trim()).filter((K)=>K!=="");if(Z.length===0)return;let $=Z[0].indexOf("=");if($===-1)return;let J=Z[0].slice(0,$);if(!nZ.test(J))return;let Q=Z[0].slice($+1),X=U7(Q);if(Z.length===1)return Object.assign(Object.create(s1),{name:J,value:X,valueEncoded:Q});let G={};for(let K=1;K<Z.length;K++){let z=Z[K],_=z.indexOf("="),B=_===-1?z:z.slice(0,_).trim(),V=_===-1?void 0:z.slice(_+1).trim();switch(B.toLowerCase()){case"domain":{if(V===void 0)break;let D=V.trim().replace(/^\./,"");if(D)G.domain=D;break}case"expires":{if(V===void 0)break;let D=new Date(V);if(!isNaN(D.getTime()))G.expires=D;break}case"max-age":{if(V===void 0)break;let D=parseInt(V,10);if(!isNaN(D))G.maxAge=IZ(D);break}case"path":{if(V===void 0)break;if(V[0]==="/")G.path=V;break}case"priority":{if(V===void 0)break;switch(V.toLowerCase()){case"low":G.priority="low";break;case"medium":G.priority="medium";break;case"high":G.priority="high";break}break}case"httponly":{G.httpOnly=!0;break}case"secure":{G.secure=!0;break}case"partitioned":{G.partitioned=!0;break}case"samesite":{if(V===void 0)break;switch(V.toLowerCase()){case"lax":G.sameSite="lax";break;case"strict":G.sameSite="strict";break;case"none":G.sameSite="none";break}break}}}return Object.assign(Object.create(s1),{name:J,value:X,valueEncoded:Q,options:Object.keys(G).length>0?G:void 0})}var a0=O7([]),o0=(Y)=>G7(Y.cookies),nZ=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,s1={[$7]:$7,..._Y,toJSON(){return{_id:"effect/Cookies/Cookie",name:this.name,value:this.value,options:this.options}}};function bQ(Y,Z,$){if(!nZ.test(Y))return h(VZ.fromReason("InvalidCookieName"));let J=encodeURIComponent(Z);if(J&&!nZ.test(J))return h(VZ.fromReason("InvalidCookieValue"));if($!==void 0){if($.domain!==void 0&&!nZ.test($.domain))return h(VZ.fromReason("InvalidCookieDomain"));if($.path!==void 0&&!nZ.test($.path))return h(VZ.fromReason("InvalidCookiePath"));if($.maxAge!==void 0&&!z7(aZ($.maxAge)))return h(VZ.fromReason("CookieInfinityMaxAge"))}return PY(Object.assign(Object.create(s1),{name:Y,value:Z,valueEncoded:J,options:$}))}var Y5=O(2,(Y,Z)=>t1({...Y.cookies,...Z.cookies}));var D7=O((Y)=>SQ(Y[0]),(Y,Z,$,J)=>X7(bQ(Z,$,J),(Q)=>t1(V7(Y.cookies,Z,Q))));function qQ(Y){let Z=Y.name+"="+Y.valueEncoded;if(Y.options===void 0)return Z;let $=Y.options;if($.maxAge!==void 0){let J=_7(aZ($.maxAge));Z+="; Max-Age="+Math.trunc(J)}if($.domain!==void 0)Z+="; Domain="+$.domain;if($.path!==void 0)Z+="; Path="+$.path;if($.priority!==void 0)switch($.priority){case"low":Z+="; Priority=Low";break;case"medium":Z+="; Priority=Medium";break;case"high":Z+="; Priority=High";break}if($.expires!==void 0)Z+="; Expires="+$.expires.toUTCString();if($.httpOnly)Z+="; HttpOnly";if($.secure)Z+="; Secure";if($.partitioned)Z+="; Partitioned";if($.sameSite!==void 0)switch($.sameSite){case"lax":Z+="; SameSite=Lax";break;case"strict":Z+="; SameSite=Strict";break;case"none":Z+="; SameSite=None";break}return Z}var W7=(Y)=>Object.values(Y.cookies).map((Z)=>`${Z.name}=${Z.valueEncoded}`).join("; ");var A7=(Y)=>Object.values(Y.cookies).map(qQ);function Z5(Y){let Z={},$=Y.length,J=0,Q=0;while(!0){if(Q===$)break;if(Q=Y.indexOf(";",J),Q===-1)Q=$;let X=Y.indexOf("=",J);if(X===-1)break;if(X>Q){J=Q+1;continue}let G=Y.substring(J,X++).trim();if(Z[G]===void 0){let K=Y.charCodeAt(X)===34?Y.substring(X+1,Q-1).trim():Y.substring(X,Q).trim();Z[G]=K.indexOf("%")!==-1?U7(K):K}J=Q+1}return Z}var U7=(Y)=>{try{return decodeURIComponent(Y)}catch(Z){return Y}};var c="~effect/http/HttpIncomingMessage";var s0=(Y,Z)=>{let $=iY(LZ(Y).annotate({options:Z}));return(J)=>U(J.json,$)},oZ=(Y,Z)=>{let $=q6.pipe(cY(Y),F7({options:Z}),iY);return(J)=>U(J.urlParamsBody,$)},N7=(Y,Z)=>{let $=f(Y);return(J)=>$(J.headers,Z)},rZ=j("effect/http/HttpIncomingMessage/MaxBodySize",{defaultValue:()=>{return}}),sZ=(Y,Z)=>{let $=Y.headers["content-type"]??"",J;if($.includes("application/json"))try{J=o(Y.json)}catch(X){}else if($.includes("text/")||$.includes("urlencoded"))try{J=o(Y.text)}catch(X){}let Q={...Z,headers:fY(Y.headers),remoteAddress:Y.remoteAddress};if(J!==void 0)Q.body=J;return Q};var zZ="~effect/http/HttpClientResponse",J5=(Y,Z)=>new L7(Y,Z),xQ=(Y,Z)=>{let $=iY(LZ(Y).annotate({options:Z}));return(J)=>U(J.json,(Q)=>$({status:J.status,headers:J.headers,body:Q}))},yQ=(Y,Z)=>{let $=iY(Y.annotate({options:Z}));return(J)=>$({status:J.status,headers:J.headers})},kQ=(Y)=>$5(L(Y,(Z)=>Z.stream)),mQ=O(2,(Y,Z)=>{let $=Y.status;if(Z[$])return Z[$](Y);else if($>=200&&$<300&&Z["2xx"])return Z["2xx"](Y);else if($>=300&&$<400&&Z["3xx"])return Z["3xx"](Y);else if($>=400&&$<500&&Z["4xx"])return Z["4xx"](Y);else if($>=500&&$<600&&Z["5xx"])return Z["5xx"](Y);return Z.orElse(Y)}),Q5=O(2,(Y,Z)=>_Z(()=>Z(Y.status)?F(Y):g(new x({reason:new kZ({response:Y,request:Y.request,description:"invalid status code"})})))),X5=(Y)=>Y.status>=200&&Y.status<300?F(Y):g(new x({reason:new kZ({response:Y,request:Y.request,description:"non 2xx status code"})}));class L7 extends RY{[c];[zZ];request;source;constructor(Y,Z){super();this.request=Y,this.source=Z,this[c]=c,this[zZ]=zZ}toJSON(){return sZ(this,{_id:"HttpClientResponse",request:this.request.toJSON(),status:this.status})}get status(){return this.source.status}get headers(){return C(this.source.headers)}cachedCookies;get cookies(){if(this.cachedCookies)return this.cachedCookies;return this.cachedCookies=e1(this.source.headers.getSetCookie())}get remoteAddress(){return H()}get stream(){return this.source.body?SY({evaluate:()=>this.source.body,onError:(Y)=>new x({reason:new TY({request:this.request,response:this,cause:Y})})}):tZ(new x({reason:new R0({request:this.request,response:this,description:"can not create stream from empty body"})}))}get json(){return U(this.text,(Y)=>GY({try:()=>Y===""?null:JSON.parse(Y),catch:(Z)=>new x({reason:new TY({request:this.request,response:this,cause:Z})})}))}textBody;get text(){return this.textBody??=d({try:()=>this.source.text(),catch:(Y)=>new x({reason:new TY({request:this.request,response:this,cause:Y})})}).pipe(OY,o)}get urlParamsBody(){return U(this.text,(Y)=>GY({try:()=>a(new URLSearchParams(Y)),catch:(Z)=>new x({reason:new TY({request:this.request,response:this,cause:Z})})}))}formDataBody;get formData(){return this.formDataBody??=d({try:()=>this.source.formData(),catch:(Y)=>new x({reason:new TY({request:this.request,response:this,cause:Y})})}).pipe(OY,o)}arrayBufferBody;get arrayBuffer(){return this.arrayBufferBody??=d({try:()=>this.source.arrayBuffer(),catch:(Y)=>new x({reason:new TY({request:this.request,response:this,cause:Y})})}).pipe(OY,o)}pipe(){return vY(this,arguments)}}var G1={};kY(G1,{withScope:()=>HX,withRateLimiter:()=>OX,withCookiesRef:()=>wX,transformResponse:()=>s,transform:()=>A5,tapRequest:()=>TX,tapError:()=>MX,tap:()=>LX,retryTransient:()=>BX,retry:()=>_X,put:()=>rQ,post:()=>aQ,patch:()=>oQ,options:()=>tQ,mapRequestInputEffect:()=>zX,mapRequestInput:()=>VX,mapRequestEffect:()=>KX,mapRequest:()=>F5,makeWith:()=>VY,make:()=>U5,layerMergedContext:()=>N5,isHttpClient:()=>r7,head:()=>nQ,get:()=>pQ,followRedirects:()=>EX,filterStatusOk:()=>XX,filterStatus:()=>QX,filterOrFail:()=>JX,filterOrElse:()=>$X,execute:()=>iQ,del:()=>sQ,catchTags:()=>ZX,catchTag:()=>YX,catch:()=>eQ,TracerPropagationEnabled:()=>e7,TracerDisabledWhen:()=>t7,SpanNameGenerator:()=>Y8,HttpClient:()=>vZ});var T7=(Y)=>wY({b3:`${Y.traceId}-${Y.spanId}-${Y.sampled?"1":"0"}${BY(Y.parent,{onNone:()=>"",onSome:(Z)=>`-${Z.spanId}`})}`,traceparent:`00-${Y.traceId}-${Y.spanId}-${Y.sampled?"01":"00"}`}),w7=(Y)=>{let Z=uQ(Y);if(r(Z))return Z;if(Z=hQ(Y),r(Z))return Z;return fQ(Y)},hQ=(Y)=>{if(!("b3"in Y))return H();let Z=Y.b3.split("-");if(Z.length<2)return H();return b(Y1({traceId:Z[0],spanId:Z[1],sampled:Z[2]?Z[2]==="1":!0}))},fQ=(Y)=>{if(!Y["x-b3-traceid"]||!Y["x-b3-spanid"])return H();return b(Y1({traceId:Y["x-b3-traceid"],spanId:Y["x-b3-spanid"],sampled:Y["x-b3-sampled"]?Y["x-b3-sampled"]==="1":!0}))},cQ=/^[0-9a-f]{32}$/i,dQ=/^[0-9a-f]{16}$/i,uQ=(Y)=>{if(!Y.traceparent)return H();let Z=Y.traceparent.split("-");if(Z.length!==4)return H();let[$,J,Q,X]=Z;switch($){case"00":{if(cQ.test(J)===!1||dQ.test(Q)===!1)return H();return b(Y1({traceId:J,spanId:Q,sampled:(parseInt(X,16)&1)===1}))}default:return H()}};var V5="~effect/http/HttpClient",r7=(Y)=>q(Y,V5),vZ=S("effect/HttpClient"),aY=(Y)=>(...Z)=>U(vZ.asEffect(),($)=>$[Y](...Z)),iQ=aY("execute"),pQ=aY("get"),nQ=aY("head"),aQ=aY("post"),oQ=aY("patch"),rQ=aY("put"),sQ=aY("del"),tQ=aY("options"),A5=O(2,(Y,Z)=>VY(U(($)=>Z(Y.postprocess(F($)),$)),Y.preprocess)),s=O(2,(Y,Z)=>VY(($)=>Z(Y.postprocess($)),Y.preprocess)),eQ=O(2,(Y,Z)=>s(Y,b7(Z)));var YX=O(3,(Y,Z,$)=>s(Y,X1(Z,$))),ZX=O(2,(Y,Z)=>s(Y,q7(Z))),$X=O(3,(Y,Z,$)=>s(Y,m7(Z,$))),JX=O(3,(Y,Z,$)=>s(Y,h7(Z,$))),QX=O(2,(Y,Z)=>s(Y,U(Q5(Z)))),XX=s(U(X5)),VY=(Y,Z)=>{let $=Object.create(GX);return $.preprocess=Z,$.postprocess=Y,$.execute=function(J){return Y(Z(J))},$},GX={[V5]:V5,pipe(){return vY(this,arguments)},..._Y,toJSON(){return{_id:"effect/HttpClient"}},...Object.fromEntries(n6.map(([Y,Z])=>[Z,function($,J){return this.execute(KY(Y)($,J))}]))},U5=(Y)=>VY((Z)=>U(Z,($)=>u((J)=>{let Q=Z8.get($),X=Q??new AbortController,G=uZ($.url,$.urlParams,XZ($.hash));if(iZ(G))return g(new x({reason:new v0({request:$,cause:G.failure})}));let K=G.success;if(J.getRef(R7)||J.getRef(t7)($)){let _=Y($,K,X.signal,J);if(Q)return _;return K5((B)=>jZ(B(_),{onSuccess(V){return Z1.register(V,X),F(new z5(V,X))},onFailure(V){if(G5(V))X.abort();return eZ(V)}}))}return l7(J.getRef(Y8)($),{kind:"client"},(_)=>{if(_.attribute("http.request.method",$.method),_.attribute("server.address",K.origin),K.port!=="")_.attribute("server.port",+K.port);_.attribute("url.full",K.toString()),_.attribute("url.path",K.pathname),_.attribute("url.scheme",K.protocol.slice(0,-1));let B=K.search.slice(1);if(B!=="")_.attribute("url.query",B);let V=J.getRef(cZ),D=YZ($.headers,V);for(let A in D)_.attribute(`http.request.header.${A}`,String(D[A]));return $=J.getRef(e7)?p0($,T7(_)):$,K5((A)=>A(Y($,K,X.signal,J)).pipe(i7(_,{captureStackTrace:!1}),jZ({onSuccess:(W)=>{_.attribute("http.response.status_code",W.status);let N=YZ(W.headers,V);for(let T in N)_.attribute(`http.response.header.${T}`,String(N[T]));if(Q)return F(W);return Z1.register(W,X),F(new z5(W,X))},onFailure(W){if(!Q&&G5(W))X.abort();return eZ(W)}})))})})),F),F5=O(2,(Y,Z)=>VY(Y.postprocess,($)=>L(Y.preprocess($),Z))),KX=O(2,(Y,Z)=>VY(Y.postprocess,($)=>U(Y.preprocess($),Z))),VX=O(2,(Y,Z)=>VY(Y.postprocess,($)=>Y.preprocess(Z($)))),zX=O(2,(Y,Z)=>VY(Y.postprocess,($)=>U(Z($),Y.preprocess))),_X=O(2,(Y,Z)=>s(Y,D5(Z))),BX=O(2,(Y,Z)=>{let $=g7(Z),J=$?"errors-and-responses":Z.retryOn??"errors-and-responses",Q=$?Z:Z.schedule,X=Q&&C7(Q),G=$?void 0:Z.times;return s(Y,_5(J==="errors-only"?BZ:u7({schedule:X,times:G,while:$8}),J==="response-only"?BZ:D5({while:$||Z.while===void 0?E7:P7(E7,Z.while),schedule:Q,times:G})))}),OX=O(2,(Y,Z)=>{let $={initial:!0,limit:Z.limit,window:Y0(aZ(Z.window),gY(1))},J=new Map,Q=Z.key,X=typeof Q==="function"?Q:DY(Q),G=Z.tokens,K=typeof G==="function"?G:DY(G??1),z=(B)=>{let V=J.get(B);if(V!==void 0)return V;return J.set(B,$),$},_=Z.disableResponseInspection?void 0:(B,V,D,A)=>{let W=z(V),N=DX(W,B,D,A);if(N.limit!==W.limit||!B5(N.window,W.window))J.set(V,N)};return A5(Y,function B(V,D){let W=nY().getRef(J1),N=X(D),T=Math.max(K(D),1),E=z(N);function YY(I){if(Z.disableResponseInspection)return B(V,D);let p=s7(W,PZ(I.headers,"retry-after"));return p?U(k7(p),()=>B(V,D)):B(V,D)}return U(Z.limiter.consume({algorithm:Z.algorithm,onExceeded:"delay",key:N,limit:E.limit,window:E.window,tokens:T}),({delay:I})=>{let p=f7(V,{onSuccess(w){if(_?.(W,N,w.headers,T),w.status!==429)return F(w);return YY(w)},onFailure(w){if(PX(w))return _?.(W,N,w.reason.response.headers,T),YY(w.reason.response);return g(w)}});return v7(I)?p:y7(p,I)})})}),DX=(Y,Z,$,J)=>{let Q=WX(Y,$,J)??Y.limit,X=UX(Z,$)??Y.window;if(Q===Y.limit&&B5(X,Y.window))return Y;return{limit:Q,window:X,initial:!1}},WX=(Y,Z,$)=>{let J=PZ(Z,"ratelimit-limit","x-ratelimit-limit"),Q=J0(J);if(Q!==void 0&&Q>0)return Q;let X=AX(Z);if(X===void 0)return;return Y.initial?X+$:Math.max(X+$,Y.limit)},AX=(Y)=>{let Z=PZ(Y,"ratelimit-remaining","x-ratelimit-remaining"),$=J0(Z);return $!==void 0&&$>=0?$:void 0},UX=(Y,Z)=>{let $=s7(Y,PZ(Z,"retry-after"));if($!==void 0)return $;let J=FX(PZ(Z,"ratelimit-reset-after","x-ratelimit-reset-after"));if(J!==void 0)return J;return NX(Y,PZ(Z,"ratelimit-reset","x-ratelimit-reset"))},s7=(Y,Z)=>{if(Z===void 0)return;let $=J0(Z);if($!==void 0)return Y0(IZ($),gY(1));let J=Date.parse(Z);if(Number.isNaN(J))return;let Q=J-Y.currentTimeMillisUnsafe();if(Q<=0)return gY(1);return gY(Q)},FX=(Y)=>{let Z=J0(Y);if(Z===void 0||Z<=0)return;return Y0(IZ(Z),gY(1))},NX=(Y,Z)=>{let $=J0(Z);if($===void 0||$<=0)return;let J=Y.currentTimeMillisUnsafe();if($>1000000000000)return gY(Math.max($-J,1));if($>1e9)return gY(Math.max($*1000-J,1));return Y0(IZ($),gY(1))},J0=(Y)=>{if(Y===void 0)return;let Z=/-?\d+(?:\.\d+)?/.exec(Y);if(Z===null)return;let $=Number(Z[0]);return Number.isFinite($)?$:void 0},PZ=(Y,...Z)=>{for(let $=0;$<Z.length;$++){let J=Y[Z[$]];if(J!==void 0)return J}return},LX=O(2,(Y,Z)=>s(Y,Q1(Z))),MX=O(2,(Y,Z)=>s(Y,x7(Z))),TX=O(2,(Y,Z)=>VY(Y.postprocess,($)=>Q1(Y.preprocess($),Z))),wX=O(2,(Y,Z)=>VY(($)=>Q1(Y.postprocess($),(J)=>o7(Z,(Q)=>Y5(Q,J.cookies))),($)=>U(Y.preprocess($),(J)=>L(a7(Z),(Q)=>o0(Q)?J:HZ(J,"cookie",W7(Q)))))),HX=(Y)=>A5(Y,(Z,$)=>{let J=new AbortController;return Z8.set($,J),$0(c7(()=>WY(()=>J.abort())),Z)}),EX=O((Y)=>r7(Y[0]),(Y,Z)=>VY(($)=>{let J=(Q,X)=>U(Y.postprocess(F(Q)),(G)=>G.status>=300&&G.status<400&&G.headers.location&&X<(Z??10)?J(EZ(Q,new URL(G.headers.location,G.request.url)),X+1):F(G));return U($,(Q)=>J(Q,0))},Y.preprocess)),t7=j("effect/http/HttpClient/TracerDisabledWhen",{defaultValue:()=>$1}),e7=j("effect/HttpClient/TracerPropagationEnabled",{defaultValue:I7}),Y8=j("effect/http/HttpClient/SpanNameGenerator",{defaultValue:()=>(Y)=>`http.client ${Y.method}`}),N5=(Y)=>pY(vZ)(ZY((Z)=>L(Y,($)=>s($,W5((J)=>j7(Z,J)))))),Z1=(()=>{if("FinalizationRegistry"in globalThis&&globalThis.FinalizationRegistry){let Z=new FinalizationRegistry(($)=>{$.abort()});return{register($,J){Z.register($,J,$)},unregister($){Z.unregister($)}}}let Y=new Map;return{register(Z,$){Y.set(Z,setTimeout(()=>$.abort(),5000))},unregister(Z){let $=Y.get(Z);if($===void 0)return;clearTimeout($),Y.delete(Z)}}})(),Z8=new WeakMap;class z5{original;controller;constructor(Y,Z){this.original=Y,this.controller=Z}[zZ]=zZ;[c]=c;applyInterrupt(Y){return _Z(()=>{return Z1.unregister(this.original),d7(Y,()=>WY(()=>{this.controller.abort()}))})}get request(){return this.original.request}get status(){return this.original.status}get headers(){return this.original.headers}get cookies(){return this.original.cookies}get remoteAddress(){return this.original.remoteAddress}get formData(){return this.applyInterrupt(this.original.formData)}get text(){return this.applyInterrupt(this.original.text)}get json(){return this.applyInterrupt(this.original.json)}get urlParamsBody(){return this.applyInterrupt(this.original.urlParamsBody)}get arrayBuffer(){return this.applyInterrupt(this.original.arrayBuffer)}get stream(){return p7(()=>{return Z1.unregister(this.original),n7(this.original.stream,WY(()=>{this.controller.abort()}))})}toJSON(){return this.original.toJSON()}[hY](){return this.original[hY]()}pipe(){return vY(this,arguments)}}var E7=(Y)=>S7(Y)||IX(Y),IX=(Y)=>P0(Y)&&(Y.reason._tag==="TransportError"||Y.reason._tag==="StatusCodeError"&&$8(Y.reason.response)),PX=(Y)=>P0(Y)&&Y.reason._tag==="StatusCodeError"&&Y.reason.response.status===429,$8=(Y)=>Y.status===408||Y.status===429||Y.status===500||Y.status===502||Y.status===503||Y.status===504;var X8={};kY(X8,{layer:()=>vX,RequestInit:()=>L5,Fetch:()=>Q8});var Q8=j("effect/http/FetchHttpClient/Fetch",{defaultValue:()=>globalThis.fetch});class L5 extends S()("effect/http/FetchHttpClient/RequestInit"){}var jX=U5((Y,Z,$,J)=>{let Q=J.getRef(Q8),X=J.context.mapUnsafe.get(L5.key)??{},G=X.headers?fZ(C(X.headers),Y.headers):Y.headers,K=(z)=>L(d({try:()=>Q(Z,{...X,method:Y.method,headers:G,body:z,duplex:Y.body._tag==="Stream"?"half":void 0,signal:$}),catch:(_)=>new x({reason:new j0({request:Y,cause:_})})}),(_)=>J5(Y,_));switch(Y.body._tag){case"Raw":case"Uint8Array":return K(Y.body.body);case"FormData":return K(Y.body.formData);case"Stream":return U(J8(Y.body.stream),K)}return K(void 0)}),vX=N5(F(jX));var qJ={};kY(qJ,{use:()=>SJ,toWebHandler:()=>H2,toHttpEffect:()=>A2,serve:()=>w2,schemaPathParams:()=>O2,schemaParams:()=>B2,schemaNoBody:()=>_2,schemaJson:()=>z2,route:()=>gJ,provideRequest:()=>T2,prefixRoute:()=>CJ,prefixPath:()=>T0,params:()=>RJ,middleware:()=>R1,make:()=>vJ,layer:()=>xZ,disableLogger:()=>M2,cors:()=>L2,addAll:()=>W2,add:()=>D2,RouterConfig:()=>v1,RouteContext:()=>WZ,HttpRouter:()=>LY});var G8=/\+/g,K8=function(){};K8.prototype=Object.create(null);function V8(Y){let Z=new K8;if(typeof Y!=="string")return Z;let $=Y.length,J="",Q="",X=-1,G=-1,K=!1,z=!1,_=!1,B=!1,V=!1,D=0;for(let A=0;A<$+1;A++)if(D=A!==$?Y.charCodeAt(A):38,D===38){if(V=G>X,!V)G=A;if(J=Y.slice(X+1,G),V||J.length>0){if(_)J=J.replace(G8," ");if(K)try{J=decodeURIComponent(J)||J}catch{}if(V){if(Q=Y.slice(G+1,A),B)Q=Q.replace(G8," ");if(z)try{Q=decodeURIComponent(Q)||Q}catch{}}let W=Z[J];if(W===void 0)Z[J]=Q;else if(W.pop)W.push(Q);else Z[J]=[W,Q]}Q="",X=A,G=A,K=!1,z=!1,_=!1,B=!1}else if(D===61)if(G<=X)G=A;else z=!0;else if(D===43)if(G>X)B=!0;else _=!0;else if(D===37)if(G>X)z=!0;else K=!0;return Z}var SX=/^https?:\/\/.*?\//,M5=/(\/:[^/()]*?)\?(\/?)/,O8=(Y={})=>new D8(Y);class D8{constructor(Y={}){this.options={ignoreTrailingSlash:!0,ignoreDuplicateSlashes:!0,caseSensitive:!1,maxParamLength:100,...Y}}options;routes=[];trees={};on(Y,Z,$){let J=Z.match(M5);if(J&&J.index!==void 0){gX(Z.length===J.index+J[0].length,"Optional Parameter needs to be the last parameter of the path");let X=Z.replace(M5,"$1$2"),G=Z.replace(M5,"$2");this.on(Y,X,$),this.on(Y,G,$);return}if(this.options.ignoreDuplicateSlashes)Z=z8(Z);if(this.options.ignoreTrailingSlash)Z=_8(Z);let Q=typeof Y==="string"?[Y]:Y;for(let X of Q)this._on(X,Z,$)}all(Y,Z){this.on(kX,Y,Z)}_on(Y,Z,$){if(this.trees[Y]===void 0)this.trees[Y]=new Q0("/");let J=Z;if(J==="*"&&this.trees[Y].prefix.length!==0){let z=this.trees[Y];this.trees[Y]=new Q0(""),this.trees[Y].staticChildren["/"]=z}let Q=this.trees[Y].prefix.length,X=this.trees[Y],G=[];for(let z=0;z<=J.length;z++){if(J.charCodeAt(z)===58&&J.charCodeAt(z+1)===58){z++;continue}let _=J.charCodeAt(z)===58&&J.charCodeAt(z+1)!==58,B=J.charCodeAt(z)===42;if(_||B||z===J.length&&z!==Q){let V=J.slice(Q,z);if(!this.options.caseSensitive)V=V.toLowerCase();V=V.split("::").join(":"),V=V.split("%").join("%25"),X=X.createStaticChild(V)}if(_){let V=!1,D=[],A=z+1;for(let W=A;;W++){let N=J.charCodeAt(W),T=N===40,E=N===45||N===46,YY=N===47||W===J.length;if(T||E||YY){let I=J.slice(A,W);if(G.push(I),V=V||T||E,T){let yY=bX(J,W),w0=J.slice(W,yY+1);D.push(qX(w0)),W=yY+1}else D.push("(.*?)");let p=W;for(;W<J.length;W++){let yY=J.charCodeAt(W);if(yY===47)break;if(yY===58)if(J.charCodeAt(W+1)===58)W++;else break}let w=J.slice(p,W);if(w)w=w.split("::").join(":"),w=w.split("%").join("%25"),D.push(xX(w));if(A=W+1,YY||J.charCodeAt(W)===47||W===J.length){let yY=V?"()"+w:w,w0=J.slice(z,W);J=J.slice(0,z+1)+yY+J.slice(W),z+=yY.length;let xJ=V?new RegExp("^"+D.join("")+"$"):void 0;X=X.createParametricChild(xJ,w,w0),Q=z+1;break}}}}else if(B){if(G.push("*"),X=X.createWildcardChild(),Q=z+1,z!==J.length-1)throw Error("Wildcard must be the last character in the route")}}if(!this.options.caseSensitive)J=J.toLowerCase();if(J==="*")J="/*";for(let z of this.routes)if(z.method===Y&&z.pattern===J)throw Error(`Method '${Y}' already declared for route '${J}'`);let K={method:Y,path:Z,pattern:J,params:G,handler:$};this.routes.push(K),X.addRoute(K)}has(Y,Z){let $=this.trees[Y];if($===void 0)return!1;let J=$.getStaticChild(Z);if(J===void 0)return!1;return J.isLeafNode}find(Y,Z){let $=this.trees[Y];if($===void 0)return;if(Z.charCodeAt(0)!==47)Z=Z.replace(SX,"/");if(this.options.ignoreDuplicateSlashes)Z=z8(Z);let J,Q,X;try{J=yX(Z),Z=J.path,Q=J.querystring,X=J.shouldDecodeParam}catch(D){return}if(this.options.ignoreTrailingSlash)Z=_8(Z);let G=Z;if(this.options.caseSensitive===!1)Z=Z.toLowerCase();let K=this.options.maxParamLength,z=$.prefix.length,_=[],B=Z.length,V=[];while(!0){if(z===B&&$.isLeafNode){let A=$.handlerStorage?.find();if(A!==void 0)return{handler:A.handler,params:A.createParams(_),searchParams:V8(Q)}}let D=$.getNextNode(Z,z,V,_.length);if(D===void 0){if(V.length===0)return;let A=V.pop();z=A.brotherPathIndex,_.splice(A.paramsCount),D=A.brotherNode}if($=D,$._tag==="StaticNode"){z+=$.prefix.length;continue}if($._tag==="WildcardNode"){let A=G.slice(z);if(X)A=B8(A);_.push(A),z=B;continue}if($._tag==="ParametricNode"){let A=G.indexOf("/",z);if(A===-1)A=B;let W=G.slice(z,A);if(X)W=B8(W);if($.regex!==void 0){let N=$.regex.exec(W);if(N===null)continue;for(let T=1;T<N.length;T++){let E=N[T];if(E.length>K)return;_.push(E)}}else{if(W.length>K)return;_.push(W)}z=A}}}}class W8{handlers=[];unconstrainedHandler;find(){return this.unconstrainedHandler}add(Y){let Z={params:Y.params,handler:Y.handler,createParams:CX(Y.params)};this.handlers.push(Z),this.unconstrainedHandler=this.handlers[0]}}class T5{isLeafNode=!1;routes;handlerStorage;addRoute(Y){if(this.routes===void 0)this.routes=[Y];else this.routes.push(Y);if(this.handlerStorage===void 0)this.handlerStorage=new W8;this.isLeafNode=!0,this.handlerStorage.add(Y)}}class w5 extends T5{staticChildren={};findStaticMatchingChild(Y,Z){let $=this.staticChildren[Y.charAt(Z)];if($===void 0||!$.matchPrefix(Y,Z))return;return $}getStaticChild(Y,Z=0){if(Y.length===Z)return this;let $=this.findStaticMatchingChild(Y,Z);if($===void 0)return;return $.getStaticChild(Y,Z+$.prefix.length)}createStaticChild(Y){if(Y.length===0)return this;let Z=this.staticChildren[Y.charAt(0)];if(Z){let J=1;for(;J<Z.prefix.length;J++)if(Y.charCodeAt(J)!==Z.prefix.charCodeAt(J)){Z=Z.split(this,J);break}return Z.createStaticChild(Y.slice(J))}let $=Y.charAt(0);return this.staticChildren[$]=new Q0(Y),this.staticChildren[$]}}class Q0 extends w5{_tag="StaticNode";constructor(Y){super();this.setPrefix(Y)}prefix;matchPrefix;parametricChildren=[];wildcardChild;setPrefix(Y){if(this.prefix=Y,Y.length===1)this.matchPrefix=(Z,$)=>!0;else{let Z=Y.length;this.matchPrefix=function($,J){for(let Q=1;Q<Z;Q++)if($.charCodeAt(J+Q)!==this.prefix.charCodeAt(Q))return!1;return!0}}}getParametricChild(Y){if(Y===void 0)return this.parametricChildren.find(($)=>$.isRegex===!1);let Z=Y.source;return this.parametricChildren.find(($)=>{if($.regex===void 0)return!1;return $.regex.source===Z})}createParametricChild(Y,Z,$){let J=this.getParametricChild(Y);if(J!==void 0)return J.nodePaths.add($),J;return J=new A8(Y,Z,$),this.parametricChildren.push(J),this.parametricChildren.sort((Q,X)=>{if(!Q.isRegex)return 1;if(!X.isRegex)return-1;if(Q.staticSuffix===void 0)return 1;if(X.staticSuffix===void 0)return-1;if(X.staticSuffix.endsWith(Q.staticSuffix))return 1;if(Q.staticSuffix.endsWith(X.staticSuffix))return-1;return 0}),J}createWildcardChild(){if(this.wildcardChild===void 0)this.wildcardChild=new U8;return this.wildcardChild}split(Y,Z){let $=this.prefix.slice(0,Z),J=this.prefix.slice(Z);this.setPrefix(J);let Q=new Q0($);return Q.staticChildren[J.charAt(0)]=this,Y.staticChildren[$.charAt(0)]=Q,Q}getNextNode(Y,Z,$,J){let Q=this.findStaticMatchingChild(Y,Z),X=0;if(Q===void 0){if(this.parametricChildren.length===0)return this.wildcardChild;Q=this.parametricChildren[0],X=1}if(this.wildcardChild!==void 0)$.push({paramsCount:J,brotherPathIndex:Z,brotherNode:this.wildcardChild});for(let G=this.parametricChildren.length-1;G>=X;G--)$.push({paramsCount:J,brotherPathIndex:Z,brotherNode:this.parametricChildren[G]});return Q}}class A8 extends w5{regex;staticSuffix;_tag="ParametricNode";constructor(Y,Z,$){super();this.regex=Y,this.staticSuffix=Z,this.isRegex=!!Y,this.nodePaths=new Set([$])}isRegex;nodePaths;getNextNode(Y,Z){return this.findStaticMatchingChild(Y,Z)}}class U8 extends T5{_tag="WildcardNode";getNextNode(Y,Z,$,J){return}}var gX=(Y,Z)=>{if(!Y)throw Error(Z)};function z8(Y){return Y.replace(/\/\/+/g,"/")}function _8(Y){if(Y.length>1&&Y.charCodeAt(Y.length-1)===47)return Y.slice(0,-1);return Y}function CX(Y){let Z=Y.length;return function($){let J={};for(let Q=0;Q<Z;Q++)J[Y[Q]]=$[Q];return J}}function bX(Y,Z){let $=1;while(Z<Y.length){if(Z++,Y[Z]==="\\"){Z++;continue}if(Y[Z]===")")$--;else if(Y[Z]==="(")$++;if(!$)return Z}throw TypeError('Invalid regexp expression in "'+Y+'"')}function qX(Y){if(Y.charCodeAt(1)===94)Y=Y.slice(0,1)+Y.slice(2);if(Y.charCodeAt(Y.length-2)===36)Y=Y.slice(0,Y.length-2)+Y.slice(Y.length-1);return Y}function xX(Y){return Y.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function F8(Y,Z){if(Y===50){if(Z===53)return"%";if(Z===51)return"#";if(Z===52)return"$";if(Z===54)return"&";if(Z===66)return"+";if(Z===98)return"+";if(Z===67)return",";if(Z===99)return",";if(Z===70)return"/";if(Z===102)return"/";return}if(Y===51){if(Z===65)return":";if(Z===97)return":";if(Z===66)return";";if(Z===98)return";";if(Z===68)return"=";if(Z===100)return"=";if(Z===70)return"?";if(Z===102)return"?";return}if(Y===52&&Z===48)return"@";return}function yX(Y){let Z=!1,$=!1,J="";for(let X=1;X<Y.length;X++){let G=Y.charCodeAt(X);if(G===37){let K=Y.charCodeAt(X+1),z=Y.charCodeAt(X+2);if(F8(K,z)===void 0)Z=!0;else{if($=!0,K===50&&z===53)Z=!0,Y=Y.slice(0,X+1)+"25"+Y.slice(X+1),X+=2;X+=2}}else if(G===63||G===59||G===35){J=Y.slice(X+1),Y=Y.slice(0,X);break}}return{path:Z?decodeURI(Y):Y,querystring:J,shouldDecodeParam:$}}function B8(Y){let Z=Y.indexOf("%");if(Z===-1)return Y;let $="",J=Z;for(let Q=Z;Q<Y.length;Q++)if(Y.charCodeAt(Q)===37){let X=Y.charCodeAt(Q+1),G=Y.charCodeAt(Q+2),K=F8(X,G);$+=Y.slice(J,Q)+K,J=Q+3}return Y.slice(0,Z)+$+Y.slice(J)}var kX=["ACL","BIND","CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LINK","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCALENDAR","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REBIND","REPORT","SEARCH","SOURCE","SUBSCRIBE","TRACE","UNBIND","UNLINK","UNLOCK","UNSUBSCRIBE"];var N8=O8;var H5="~effect/http/HttpServerResponse",AY=(Y)=>q(Y,H5),t=(Y)=>UY({status:Y?.status??204,statusText:Y?.statusText,headers:Y?.headers?C(Y.headers):void 0,cookies:Y?.cookies});var N3=(Y,Z)=>{let $=Z?.headers?C(Z.headers):n;return UY({status:Z?.status??200,statusText:Z?.statusText,headers:$,cookies:Z?.cookies??a0,body:lZ(Y,G0(Z,$))})},G0=(Y,Z)=>{if(Y?.contentType)return Y.contentType;else if(Y?.headers)return Z["content-type"]},L3=(Y,Z)=>{let $=Z?.headers?C(Z.headers):n;return UY({status:Z?.status??200,statusText:Z?.statusText,headers:$,cookies:Z?.cookies??a0,body:uY(Y,G0(Z,$))})};var M3=(Y,Z)=>{let $=Z?.headers?C(Z.headers):n;return UY({status:Z?.status??200,statusText:Z?.statusText,headers:$,cookies:Z?.cookies,body:c0(Y,G0(Z,$))})},T3=(Y,Z)=>{let $=Z?.headers?C(Z.headers):n;return UY({status:Z?.status??200,statusText:Z?.statusText,headers:$,cookies:Z?.cookies,body:uY(f0(a(Y)),G0(Z,$)??"application/x-www-form-urlencoded")})};var j5=(Y,Z)=>{let $=Z?.headers?C(Z.headers):n;return UY({status:Z?.status??200,statusText:Z?.statusText,headers:$,cookies:Z?.cookies,body:jY(Y,G0(Z,$),Z?.contentLength)})};var w3=O(3,(Y,Z,$)=>UY({...Y,headers:HY(Y.headers,Z,$)})),L8=O(2,(Y,Z)=>UY({...Y,headers:b0(Y.headers,Z)}));var H3=O((Y)=>AY(Y[0]),(Y,Z,$,J)=>L(D7(Y.cookies,Z,$,J).asEffect(),(Q)=>UY({...Y,cookies:Q})));var M8=O(2,(Y,Z)=>UY({...Y,body:Z}));var T8=(Y,Z)=>{let $=new globalThis.Headers(Y.headers);if(!o0(Y.cookies)){let Q=A7(Y.cookies);for(let X of Q)$.append("set-cookie",X)}if(Z?.withoutBody)return new Response(void 0,{status:Y.status,statusText:Y.statusText,headers:$});let J=Y.body;switch(J._tag){case"Empty":return new Response(void 0,{status:Y.status,statusText:Y.statusText,headers:$});case"Uint8Array":case"Raw":{if(J.body instanceof Response){for(let[Q,X]of $)J.body.headers.set(Q,X);return J.body}return new Response(J.body,{status:Y.status,statusText:Y.statusText,headers:$})}case"FormData":return new Response(J.formData,{status:Y.status,statusText:Y.statusText,headers:$});case"Stream":return new Response(wZ(J.stream,Z?.context??GZ()),{status:Y.status,statusText:Y.statusText,headers:$})}};var fX={...x0,[H5]:H5,[RZ]:!0,toJSON(){return{_id:"HttpServerResponse",status:this.status,statusText:this.statusText,headers:fY(this.headers),cookies:this.cookies.toJSON(),body:this.body.toJSON()}}},UY=(Y)=>{let Z=Object.create(fX);if(Z.status=Y.status,Z.statusText=Y.statusText,Z.cookies=Y.cookies??a0,Z.body=Y.body??QZ,Z.body._tag!=="Empty"&&(Z.body.contentType||Z.body.contentLength)){let $=wY({...Y.headers});if(Z.body.contentType)$["content-type"]=Z.body.contentType;if(Z.body.contentLength)$["content-length"]=Z.body.contentLength.toString();Z.headers=$}else Z.headers=Y.headers??n;return Z};var oY="~effect/http/HttpServerRespondable",E8=(Y)=>q(Y,oY),cX=t({status:400}),dX=t({status:404});var I8=(Y,Z)=>{if(AY(Y))return F(Y);else if(E8(Y))return K0(Y[oY](),()=>F(Z));else if(H8(Y))return F(cX);else if(w8(Y))return F(dX);return F(Z)},P8=(Y,Z)=>{if(AY(Y))return F(Y);else if(E8(Y))return K0(Y[oY](),()=>F(Z));return F(Z)};var j8="~effect/http/HttpServerError";class l extends P("HttpServerError"){constructor(Y){if("cause"in Y.reason)super({...Y,cause:Y.reason.cause});else super(Y)}[j8]=j8;stack=`${this.name}: ${this.message}`;get request(){return this.reason.request}get response(){return"response"in this.reason?this.reason.response:void 0}[oY](){return this.reason[oY]()}get[RZ](){return this.reason[RZ]??!1}get message(){return this.reason.message}}class JY extends P("RequestParseError"){[oY](){return F(t({status:400}))}get methodAndUrl(){return`${this.request.method} ${this.request.url}`}get message(){return g8(this._tag,this.description,this.methodAndUrl)}}class v5 extends P("RouteNotFound"){[oY](){return F(t({status:404}))}[RZ]=!0;get methodAndUrl(){return`${this.request.method} ${this.request.url}`}get message(){return g8(this._tag,this.description,this.methodAndUrl)}}class _1 extends S()("effect/http/HttpServerError/ClientAbort"){static annotation=this.context(!0).pipe(gZ(S8,{name:"ClientAbort",stack:v8,parent:void 0}))}var g8=(Y,Z,$)=>{let J=`${Y} (${$})`;return Z?`${J}: ${Z}`:J},R5=(Y)=>{let Z,$=lX,J=[],Q=[],X=!1;for(let G=0;G<Y.reasons.length;G++){let K=Y.reasons[G];switch(K._tag){case"Fail":{$=I8(K.error,z1),J.push(K);break}case"Die":{if(AY(K.defect))Z=K.defect;else $=P8(K.defect,z1),J.push(K);break}case"Interrupt":{if(X=K.annotations.has(_1.key),J.length>0)break;Q.push(K);break}}}if(Z)return F([Z,V1(J)]);else if(Q.length>0&&J.length===0)J.push(...Q),$=X?iX:pX;return V0($,(G)=>{return J.push(R8(G)),[G,V1(J)]})},S5=(Y)=>{let Z,$=Y.reasons.filter((J)=>{if(J._tag==="Die"&&AY(J.defect))return Z=J.defect,!1;return!0});return[Z??z1,$.length>0?b(V1($)):H()]},z1=t({status:500}),lX=F(z1),iX=F(t({status:499})),pX=F(t({status:503})),C8=(Y)=>{if(Y._tag==="Success")return Y.value;return S5(Y.cause)[0]};var A0={};kY(A0,{upgradeChannel:()=>E4,toWebResult:()=>u5,toWeb:()=>u4,toURL:()=>W0,toClientRequest:()=>q4,searchParamsFromURL:()=>m$,schemaSearchParams:()=>j4,schemaHeaders:()=>P4,schemaCookies:()=>I4,schemaBodyUrlParams:()=>S4,schemaBodyMultipart:()=>g4,schemaBodyJson:()=>v4,schemaBodyFormJson:()=>C4,schemaBodyForm:()=>R4,fromWeb:()=>f5,fromClientRequest:()=>b4,TypeId:()=>OZ,ParsedSearchParams:()=>xY,MaxBodySize:()=>rZ,HttpServerRequest:()=>M});var B1="~effect/socket/Socket/SocketError",rX=(Y)=>q(Y,B1);class s8 extends tY("effect/socket/Socket/SocketReadError")({_tag:mY("SocketReadError"),cause:AZ}){message="An error occurred during Read"}class t8 extends tY("effect/socket/Socket/SocketWriteError")({_tag:mY("SocketWriteError"),cause:AZ}){message="An error occurred during Write"}class e8 extends tY("effect/socket/Socket/SocketOpenError")({_tag:mY("SocketOpenError"),kind:I0(["Unknown","Timeout"]),cause:AZ}){get message(){return this.kind==="Timeout"?'timeout waiting for "open"':"An error occurred during Open"}}class Y$ extends tY("effect/socket/Socket/SocketCloseError")({_tag:mY("SocketCloseError"),code:o8,closeReason:E0(IY)}){static filterClean(Y){return function(Z){return Z$.is(Z)&&Z.reason._tag==="SocketCloseError"&&Y(Z.reason.code)?PY(Z.reason):h(Z)}}get message(){if(this.closeReason)return`${this.code}: ${this.closeReason}`;return`${this.code}`}}var sX=k0([s8,t8,e8,Y$]);class Z$ extends r8(B1)("SocketError",{_tag:mY("SocketError"),reason:sX}){constructor(Y){if("cause"in Y.reason)super({...Y,cause:Y.reason.cause});else super(Y)}[B1]=B1;static is(Y){return rX(Y)}message=this.reason.message}var tX=(Y,Z)=>D1(_0(function*($,J){let Q=yield*u8(),X=yield*y8(J),G=yield*x8(Y.writer,X),K,z=0,_=h8({while:()=>z<K.length,body:()=>G(K[z++]),step:b8});return yield*$.pipe(U((B)=>{if(B.length===1)return G(B[0]);return K=B,z=0,_}),d8({disableYield:!0}),f8(m8,(B)=>i8(Q,B)),c8(z0(X,O1)),g5(J)),yield*Y.runRaw((B)=>{l8(Q,Z(B))}).pipe(n8(Q),g5(J)),p8(Q)})),eX=(Y)=>{let Z=new TextEncoder;return tX(Y,($)=>typeof $==="string"?Z.encode($):$)};var $$=()=>(Y)=>eX(Y);var J$=/; *([!#$%&'*+.^\w`|~-]+)=("(?:[\v\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\v\u0020-\u00ff])*"|[!#$%&'*+.^\w`|~-]+) */gu,Q$=/\\([\v\u0020-\u00ff])/gu,Z4=/^[!#$%&'*+.^\w|~-]+\/[!#$%&'*+.^\w|~-]+$/u,$4=/^[!#$%&'*+.^\w|~-]+$/u,W1={value:"",parameters:Object.create(null)};function A1(Y,Z=!1){if(typeof Y!=="string")return W1;let $=Y.indexOf(";"),J=$!==-1?Y.slice(0,$).trim():Y.trim();if((Z?$4:Z4).test(J)===!1)return W1;let X={value:J.toLowerCase(),parameters:Object.create(null)};if($===-1)return X;let G,K,z;J$.lastIndex=$;while(K=J$.exec(Y)){if(K.index!==$)return W1;if($+=K[0].length,G=K[1].toLowerCase(),z=K[2],z[0]==='"')z=z.slice(1,z.length-1),!Z&&Q$.test(z)&&(z=z.replace(Q$,"$1"));X.parameters[G]=z}if($!==Y.length)return W1;return X}var QY;(function(Y){Y[Y.key=0]="key",Y[Y.whitespace=1]="whitespace",Y[Y.value=2]="value"})(QY||(QY={}));var B0={_tag:"Continue"},Q4=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1],X4=[0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];function X$(){let Y=new TextDecoder,Z={state:QY.key,headers:Object.create(null),key:"",value:void 0,crlf:0,previousChunk:void 0,pairs:0,size:0};function $(X){return Z.state=QY.key,Z.headers=Object.create(null),Z.key="",Z.value=void 0,Z.crlf=0,Z.previousChunk=void 0,Z.pairs=0,Z.size=0,X}function J(X,G){let K=new Uint8Array(X.length+G.length);return K.set(X),K.set(G,X.length),K}function Q(X){return $({_tag:"Failure",reason:X,headers:Z.headers})}return function(G,K){let z=0,_;if(Z.previousChunk!==void 0){z=Z.previousChunk.length,_=z;let V=new Uint8Array(G.length+z);V.set(Z.previousChunk),V.set(G,z),Z.previousChunk=void 0,G=V}let B=G.length;Y:while(K<B){if(Z.state===QY.key){let V=K;for(;V<B;V++){if(Z.size++>16384)return Q("HeaderTooLarge");if(G[V]===58){if(Z.key+=Y.decode(G.subarray(K,V)).toLowerCase(),Z.key.length===0)return Q("InvalidHeaderName");if(G[V+1]===32&&G[V+2]!==32&&G[V+2]!==9)K=V+2,Z.state=QY.value,Z.size++;else if(G[V+1]!==32&&G[V+1]!==9)K=V+1,Z.state=QY.value;else K=V+1,Z.state=QY.whitespace;break}else if(Q4[G[V]]!==1)return Q("InvalidHeaderName")}if(V===B)return Z.key+=Y.decode(G.subarray(K,B)).toLowerCase(),B0}if(Z.state===QY.whitespace){for(;K<B;K++){if(Z.size++>16384)return Q("HeaderTooLarge");if(G[K]!==32&&G[K]!==9){Z.state=QY.value;break}}if(K===B)return B0}if(Z.state===QY.value){let V=K;if(_!==void 0)V=_,_=void 0;for(;V<B;V++){if(Z.size++>16384)return Q("HeaderTooLarge");if(G[V]===13||Z.crlf>0){let D=G[V];if(D===13&&Z.crlf===0)Z.crlf=1,V++,Z.size++,D=G[V];if(D===10&&Z.crlf===1)Z.crlf=2,V++,Z.size++,D=G[V];if(D===13&&Z.crlf===2)Z.crlf=3,V++,Z.size++,D=G[V];if(D===10&&Z.crlf===3)Z.crlf=4,V++,Z.size++;if(Z.crlf<4&&V>=B)return Z.previousChunk=G.subarray(K),B0;else if(Z.crlf>=2){Z.value=Z.value===void 0?G.subarray(K,V-Z.crlf):J(Z.value,G.subarray(K,V-Z.crlf));let A=Y.decode(Z.value);if(Z.headers[Z.key]===void 0)Z.headers[Z.key]=A;else if(typeof Z.headers[Z.key]==="string")Z.headers[Z.key]=[Z.headers[Z.key],A];else Z.headers[Z.key].push(A);if(K=V,Z.size--,Z.crlf!==4&&Z.pairs===100)return Q("TooManyHeaders");else if(Z.crlf===3)return Q("InvalidHeaderValue");else if(Z.crlf===4)return $({_tag:"Headers",headers:Z.headers,endPosition:K-z});Z.pairs++,Z.key="",Z.value=void 0,Z.crlf=0,Z.state=QY.key;continue Y}}else if(X4[G[V]]!==1)return Q("InvalidHeaderValue")}if(V===B)return Z.value=Z.value===void 0?G.subarray(K,B):J(Z.value,G.subarray(K,B)),B0}}if(K>B)Z.size+=B-K;return B0}}function K4(Y){let Z=new TextEncoder().encode(Y),$=Z.length,J={};for(let Q=0;Q<$;Q++){let X=Z[Q];if(J[X]===void 0)J[X]=[];J[X].push(Q)}return{needle:Z,needleLength:$,indexes:J,firstByte:Z[0],previousChunk:void 0,previousChunkLength:0,matchIndex:0}}function G$(Y,Z,$){let J=K4(Y);if($!==void 0)J.previousChunk=$,J.previousChunkLength=$.length;function Q(){if("Buffer"in globalThis&&!(("Bun"in globalThis)||("Deno"in globalThis)))return function(_,B,V){return Buffer.prototype.indexOf.call(_,B,V)};let z=new Uint8Array(256).fill(J.needle.length);for(let _=0,B=J.needle.length-1;_<B;++_)z[J.needle[_]]=B-_;return function(_,B,V){let D=_.length,A=V+J.needleLength-1;while(A<D){for(let W=J.needleLength-1,N=A;W>=0&&_[N]===B[W];W--,N--)if(W===0)return N;A+=z[_[A]]}return-1}}let X=Q();function G(z){let _=z.length;if(J.previousChunk!==void 0){let V=new Uint8Array(J.previousChunkLength+_);V.set(J.previousChunk),V.set(z,J.previousChunkLength),z=V,_=J.previousChunkLength+_,J.previousChunk=void 0}if(_<J.needleLength){J.previousChunk=z,J.previousChunkLength=_;return}let B=0;while(B<_){let V=X(z,J.needle,B);if(V>-1){if(V>B)Z(J.matchIndex,z.subarray(B,V));J.matchIndex+=1,B=V+J.needleLength;continue}else if(z[_-1]in J.indexes){let D=J.indexes[z[_-1]],A=-1;for(let W=0,N=D.length;W<N;W++){let T=D[W];if(z[_-1-T]===J.firstByte&&W>A)A=T}if(A===-1)if(B===0)Z(J.matchIndex,z);else Z(J.matchIndex,z.subarray(B));else{if(_-1-A>B)Z(J.matchIndex,z.subarray(B,_-1-A));J.previousChunk=z.subarray(_-1-A),J.previousChunkLength=A+1}}else if(B===0)Z(J.matchIndex,z);else Z(J.matchIndex,z.subarray(B));break}}function K(){if(J.previousChunk!==void 0&&J.previousChunk!==$)Z(J.matchIndex,J.previousChunk);J.previousChunk=$,J.previousChunkLength=$?.length??0,J.matchIndex=0}return{write:G,end:K}}var CY;(function(Y){Y[Y.headers=0]="headers",Y[Y.body=1]="body"})(CY||(CY={}));var z4={_tag:"InvalidDisposition"},_4={_tag:"EndNotReached"},B4={_tag:"ReachedLimit",limit:"MaxParts"},O4={_tag:"ReachedLimit",limit:"MaxTotalSize"},D4={_tag:"ReachedLimit",limit:"MaxPartSize"},K$={_tag:"ReachedLimit",limit:"MaxFieldSize"},W4=new TextEncoder().encode(`\r
|
|
2
|
+
import{Lz as RZ,cA as a7,dA as o7}from"./chunk-v2kyarwz.js";import{$C as wJ,$G as y7,$K as m6,$L as I0,AF as ZJ,AG as GY,AH as jJ,AL as E0,BF as M0,BH as d7,BO as XJ,CC as D6,CD as gY,CE as p5,CF as IJ,CG as u,CH as JJ,CO as n7,DB as V6,DD as IZ,DE as V1,DG as U,DH as K5,DI as T6,EB as fY,EF as pY,EH as d8,EI as q1,EO as E$,FD as _7,FF as $6,FG as $0,FH as u7,GB as k6,GD as Y0,GE as R8,GF as DZ,GG as Q1,GO as I$,HA as vY,HD as B5,HF as PJ,HN as tY,IF as _J,IG as n$,IH as l7,IN as r8,JA as O,JB as hY,JE as G5,JF as rY,JG as L,JN as LZ,KA as BZ,KF as sY,KH as i7,KO as P5,LH as g5,LJ as u8,LL as IY,LO as wZ,MA as DY,MB as _Y,MC as G7,ML as o8,MO as J8,NA as I7,NB as RY,NC as K7,NE as w8,NG as b7,OA as $1,OD as T1,OE as A$,OF as n0,OG as X1,OJ as l8,OO as O0,PA as v8,PE as U$,PF as P,PG as q7,PH as QJ,PJ as i8,PO as dY,QA as b8,QB as x0,QC as V7,QD as Y1,QE as S7,QG as K0,RA as Y6,RC as z6,RD as R7,RF as J1,RG as f8,RO as OJ,SE as S8,SG as JZ,SH as n5,SJ as p8,TL as T$,UA as _5,UC as y0,UG as x7,UJ as n8,UL as w6,VE as F$,WC as b1,WE as x5,WG as D5,WH as o,WL as H6,XC as W6,XE as O1,XO as P$,YK as D0,YL as y1,YO as DJ,ZC as q5,ZF as N$,ZJ as D1,ZL as E6,_C as A6,_F as m8,_H as _0,_J as L$,_L as k0,aD as HJ,aG as g7,aH as k7,bI as F0,bK as C5,bO as H$,cG as C7,cH as m7,cK as M$,cM as cY,dD as U6,dH as h7,eI as l5,eM as mY,eO as K1,fB as q,fC as H,fD as F6,fI as a$,fO as I5,gC as b,gH as $J,gM as k1,gO as p7,hB as P7,hC as y$,hH as jZ,hN as AZ,hO as tZ,iC as r,iF as p$,iH as f7,iO as k$,jB as S0,jC as BY,jD as S,jG as FY,jH as E5,kC as L1,kD as bY,kH as ZY,kI as V0,kO as SY,lD as e$,lF as L0,lH as J6,lI as bZ,mC as l1,mD as GZ,mG as h8,mO as $5,nD as gZ,nF as a5,oB as K6,oC as XZ,oF as x8,oG as d,oH as W5,pB as _6,pC as O6,pG as F,qD as zY,qG as _Z,qL as x1,rB as g0,rD as y,rF as y8,rG as WY,rL as F7,sC as PY,sG as e,sI as i0,sL as H8,tC as h,tD as j7,tF as z0,tI as g1,tN as I6,tO as X0,uF as YJ,uH as c7,uL as f,uN as w$,vC as a6,vD as j,vH as c8,vI as L6,vL as iY,wB as B6,wG as i,wH as w1,wI as M6,xB as hZ,xC as iZ,xD as aZ,xE as i$,xF as EJ,xG as g,xO as h5,yC as o6,yD as z7,yF as H1,yG as eZ,yH as OY,zC as X7,zD as v7,zF as Z6,zG as BJ,zJ as nY}from"./chunk-dkm7x8rj.js";import{AP as kY}from"./chunk-hh4c02fh.js";var mZ={};kY(mZ,{isHttpClientError:()=>P0,TransportError:()=>j0,StatusCodeError:()=>kZ,InvalidUrlError:()=>v0,HttpClientErrorSchema:()=>S1,HttpClientError:()=>x,EncodeError:()=>X6,EmptyBodyError:()=>R0,DecodeError:()=>TY});var H0="~effect/http/HttpClientError",P0=(Y)=>q(Y,H0);class x extends P("HttpClientError"){constructor(Y){if("cause"in Y.reason)super({...Y,cause:Y.reason.cause});else super(Y)}[H0]=H0;get request(){return this.reason.request}get response(){return"response"in this.reason?this.reason.response:void 0}get message(){return this.reason.message}}var UZ=(Y)=>Y.endsWith("Error")?Y.slice(0,-5):Y,FZ=(Y,Z,$)=>Z?`${Y}: ${Z} (${$})`:`${Y} error (${$})`;class j0 extends P("TransportError"){get methodAndUrl(){return`${this.request.method} ${this.request.url}`}get message(){return FZ(UZ(this._tag),this.description,this.methodAndUrl)}}class X6 extends P("EncodeError"){get methodAndUrl(){return`${this.request.method} ${this.request.url}`}get message(){return FZ(UZ(this._tag),this.description,this.methodAndUrl)}}class v0 extends P("InvalidUrlError"){get methodAndUrl(){return`${this.request.method} ${this.request.url}`}get message(){return FZ(UZ(this._tag),this.description,this.methodAndUrl)}}class kZ extends P("StatusCodeError"){get methodAndUrl(){return`${this.request.method} ${this.request.url}`}get message(){let Y=`${this.response.status} ${this.methodAndUrl}`;return FZ(UZ(this._tag),this.description,Y)}}class TY extends P("DecodeError"){get methodAndUrl(){return`${this.request.method} ${this.request.url}`}get message(){let Y=`${this.response.status} ${this.methodAndUrl}`;return FZ(UZ(this._tag),this.description,Y)}}class R0 extends P("EmptyBodyError"){get methodAndUrl(){return`${this.request.method} ${this.request.url}`}get message(){let Y=`${this.response.status} ${this.methodAndUrl}`;return FZ(UZ(this._tag),this.description,Y)}}class S1 extends tY(H0)({_tag:mY("HttpError"),kind:I0(["EncodeError","DecodeError","TransportError","InvalidUrlError","StatusCodeError","EmptyBodyError"]),cause:E0(AZ)}){static fromHttpClientError(Y){return new S1({_tag:"HttpError",kind:Y.reason._tag,cause:Y.reason})}}var pZ={};kY(pZ,{updateUrl:()=>zQ,trace:()=>XQ,toWebResult:()=>Z7,toWeb:()=>vQ,toUrl:()=>o1,setUrlParams:()=>e6,setUrlParam:()=>_Q,setUrl:()=>EZ,setMethod:()=>r6,setHeaders:()=>p0,setHeader:()=>HZ,setHash:()=>Y7,setBody:()=>$Y,schemaBodyJson:()=>NQ,removeHash:()=>DQ,put:()=>ZQ,prependUrl:()=>a1,post:()=>eJ,patch:()=>YQ,options:()=>QQ,modify:()=>p1,makeWith:()=>R,make:()=>KY,isHttpClientRequest:()=>KZ,head:()=>JQ,get:()=>tJ,fromWeb:()=>EQ,empty:()=>i1,delete:()=>$Q,bodyUrlParams:()=>LQ,bodyUint8Array:()=>WQ,bodyText:()=>AQ,bodyStream:()=>wQ,bodyJsonUnsafe:()=>FQ,bodyJson:()=>UQ,bodyFormDataRecord:()=>TQ,bodyFormData:()=>MQ,bodyFile:()=>HQ,bearerToken:()=>KQ,basicAuth:()=>GQ,appendUrlParams:()=>OQ,appendUrlParam:()=>BQ,appendUrl:()=>VQ,acceptJson:()=>s6,accept:()=>n1});var G6=Symbol.for("~effect/http/Headers");var NZ=Object.create(null);Object.defineProperties(NZ,{[G6]:{value:G6},[V6]:{value(Y){return YZ(this,y(Y,cZ))}},toJSON:{value(){return fY(this)}},[g0]:{value(Y){return fJ(this,Y)}},[S0]:{value(){return K6(this)}},toString:{value:_Y.toString},[hY]:{value:_Y[hY]}});var C0=(Y)=>Object.assign(Object.create(NZ),Y),fJ=z6(hZ());var n=Object.create(NZ),C=(Y)=>{if(Y===void 0)return n;else if(Symbol.iterator in Y){let $=Object.create(NZ);for(let[J,Q]of Y)$[J.toLowerCase()]=Q;return $}let Z=Object.create(NZ);for(let[$,J]of Object.entries(Y))if(Array.isArray(J))Z[$.toLowerCase()]=J.join(", ");else if(J!==void 0)Z[$.toLowerCase()]=J;return Z},wY=(Y)=>Object.setPrototypeOf(Y,NZ);var HY=O(3,(Y,Z,$)=>{let J=C0(Y);return J[Z.toLowerCase()]=$,J}),b0=O(2,(Y,Z)=>C0({...Y,...C(Z)})),fZ=O(2,(Y,Z)=>{let $=C0(Y);return Object.assign($,Z),$}),q0=O(2,(Y,Z)=>{let $=C0(Y);return delete $[Z.toLowerCase()],$});var YZ=O(2,(Y,Z)=>{let $={...Y},J=(Q)=>{if(typeof Q==="string"){let X=Q.toLowerCase();if(X in Y)$[X]=g1(Y[X])}else for(let X in Y)if(Q.test(X))$[X]=g1(Y[X])};if(Array.isArray(Z))for(let Q=0;Q<Z.length;Q++)J(Z[Q]);else J(Z);return $}),cZ=j("effect/Headers/CurrentRedactedNames",{defaultValue:()=>["authorization","cookie","set-cookie","x-api-key"]});var C1="~effect/http/UrlParams",cJ=(Y)=>q(Y,C1),dJ={...x0,[C1]:C1,[Symbol.iterator](){return this.params[Symbol.iterator]()},toJSON(){return{_id:"UrlParams",params:Object.fromEntries(this.params)}},[g0](Y){return j6(this,Y)},[S0](){return _6(this.params.flat())}},ZZ=(Y)=>{let Z=Object.create(dJ);return Z.params=Y,Z},a=(Y)=>{let Z=P6(Y),$=[];for(let J=0;J<Z.length;J++)if(Array.isArray(Z[J][0])){let[Q,X]=Z[J];$.push([`${Q[0]}[${Q.slice(1).join("][")}]`,X])}else $.push(Z[J]);return ZZ($)},P6=(Y)=>{let Z=typeof Y[Symbol.iterator]==="function"?y0(Y):Object.entries(Y),$=[];for(let[J,Q]of Z)if(Array.isArray(Q)){for(let X=0;X<Q.length;X++)if(Q[X]!==void 0)$.push([J,String(Q[X])])}else if(typeof Q==="object"){let X=P6(Q);for(let[G,K]of X)$.push([[J,...typeof G==="string"?[G]:G],K])}else if(Q!==void 0)$.push([J,String(Q)]);return $},j6=B6((Y,Z)=>uJ(Y.params,Z.params)),uJ=F6(D6([hZ(),hZ()])),v6=x1(cJ,{typeConstructor:{_tag:"effect/http/UrlParams"},generation:{runtime:"UrlParams.UrlParamsSchema",Type:"UrlParams.UrlParams",Encoded:'typeof UrlParams.UrlParamsSchema["Encoded"]',importDeclaration:'import * as UrlParams from "effect/unstable/http/UrlParams"'},expected:"UrlParams",toEquivalence:()=>j6,toCodec:()=>k1()(y1(H6([IY,IY])),q1({decode:ZZ,encode:(Y)=>Y.params}))}),m0=ZZ([]);var lJ=O(2,(Y,Z)=>A6(Y.params,([$])=>$===Z).pipe(O6(([,$])=>$)));var R6=O(3,(Y,Z,$)=>ZZ(b1(U6(Y.params,([J])=>J!==Z),[Z,String($)]))),iJ=O(2,(Y,Z)=>ZZ(Z(Y.params))),S6=O(2,(Y,Z)=>{let $=a(Z),J=$.params,Q=new Set;for(let X=0;X<J.length;X++)Q.add(J[X][0]);for(let X=0;X<Y.params.length;X++){if(Q.has(Y.params[X][0]))continue;J.push(Y.params[X])}return $}),g6=O(3,(Y,Z,$)=>ZZ(b1(Y.params,[Z,String($)]))),C6=O(2,(Y,Z)=>iJ(Y,W6(a(Z).params)));class h0 extends P("UrlParamsError"){}var uZ=(Y,Z,$)=>{try{let J=new URL(Y,pJ());for(let Q=0;Q<Z.params.length;Q++){let[X,G]=Z.params[Q];if(G!==void 0)J.searchParams.append(X,G)}if($!==void 0)J.hash=$;return PY(J)}catch(J){return h(new h0({cause:J}))}},f0=(Y)=>new URLSearchParams(Y.params).toString(),pJ=()=>{if("location"in globalThis&&globalThis.location!==void 0&&globalThis.location.origin!==void 0&&globalThis.location.pathname!==void 0)return location.origin+location.pathname;return},nJ=(Y)=>{let Z={};for(let[$,J]of Y.params){let Q=Z[$];if(Q===void 0)Z[$]=J;else if(typeof Q==="string")Z[$]=[Q,J];else Q.push(J)}return Z},aJ=nJ,b6=(Y)=>v6.pipe(cY(I6,T6({decode:(Z)=>BY(lJ(Z,Y),{onNone:()=>g(new L6([Y],new M6(void 0))),onSome:F}),encode:(Z)=>F(ZZ([[Y,Z]]))}))),q6=v6.pipe(cY(w6(IY,k0([IY,E6(IY)])),q1({decode:aJ,encode:a})));var m1="~effect/http/HttpBody";var x6="~effect/http/HttpBody/HttpBodyError";class f1 extends P("HttpBodyError"){[x6]=x6}class MZ{[m1];constructor(){this[m1]=m1}[hY](){return this.toJSON()}toString(){return k6(this,{ignoreToString:!0})}}class h6 extends MZ{_tag="Empty";toJSON(){return{_id:"effect/HttpBody",_tag:"Empty"}}}var QZ=new h6;class f6 extends MZ{_tag="Raw";body;contentType;contentLength;constructor(Y,Z,$){super();this.body=Y,this.contentType=Z,this.contentLength=$}toJSON(){return{_id:"effect/HttpBody",_tag:"Raw",body:this.body,contentType:this.contentType,contentLength:this.contentLength}}}var c1=(Y,Z)=>new f6(Y,Z?.contentType,Z?.contentLength);class c6 extends MZ{_tag="Uint8Array";body;contentType;contentLength;constructor(Y,Z,$){super();this.body=Y,this.contentType=Z,this.contentLength=$}toJSON(){return{_id:"effect/HttpBody",_tag:"Uint8Array",body:this.contentType.startsWith("text/")||this.contentType.endsWith("json")?new TextDecoder().decode(this.body):`Uint8Array(${this.body.length})`,contentType:this.contentType,contentLength:this.contentLength}}}var lZ=(Y,Z)=>new c6(Y,Z??"application/octet-stream",Y.length),oJ=new TextEncoder,uY=(Y,Z)=>lZ(oJ.encode(Y),Z??"text/plain"),c0=(Y,Z)=>uY(JSON.stringify(Y),Z??"application/json"),d0=(Y,Z)=>GY({try:()=>uY(JSON.stringify(Y),Z??"application/json"),catch:($)=>new f1({reason:{_tag:"JsonError"},cause:$})}),d1=(Y,Z)=>{let $=m6(LZ(Y));return(J,Q)=>$(J,Z).pipe(JZ((X)=>new f1({reason:{_tag:"SchemaError",issue:X},cause:X})),U((X)=>d0(X,Q)))},d6=(Y,Z)=>uY(f0(Y),Z??"application/x-www-form-urlencoded");class u6 extends MZ{_tag="FormData";contentType=void 0;contentLength=void 0;formData;constructor(Y){super();this.formData=Y}toJSON(){return{_id:"effect/HttpBody",_tag:"FormData",formData:this.formData}}}var u0=(Y)=>new u6(Y),y6=(Y,Z,$)=>{if($==null)return;if(typeof $==="object"){Y.append(Z,$);return}Y.append(Z,String($))},l6=(Y)=>{let Z=new globalThis.FormData;for(let[$,J]of Object.entries(Y))if(Array.isArray(J))for(let Q of J)y6(Z,$,Q);else y6(Z,$,J);return u0(Z)};class i6 extends MZ{_tag="Stream";stream;contentType;contentLength;constructor(Y,Z,$){super();this.stream=Y,this.contentType=Z,this.contentLength=$}toJSON(){return{_id:"effect/HttpBody",_tag:"Stream",contentType:this.contentType,contentLength:this.contentLength}}}var jY=(Y,Z,$)=>new i6(Y,Z??"application/octet-stream",$),p6=(Y,Z)=>U(dY.asEffect(),($)=>L($.stat(Y),(J)=>jY($.stream(Y,Z),Z?.contentType,Number(J.size))));var TZ=(Y)=>Y!=="GET"&&Y!=="HEAD"&&Y!=="OPTIONS"&&Y!=="TRACE";var n6=[["GET","get"],["POST","post"],["PUT","put"],["DELETE","del"],["PATCH","patch"],["HEAD","head"],["OPTIONS","options"],["TRACE","trace"]];var u1="~effect/http/HttpClientRequest",KZ=(Y)=>q(Y,u1),sJ={[u1]:u1,..._Y,toJSON(){return{_id:"HttpClientRequest",method:this.method,url:this.url,urlParams:this.urlParams,hash:this.hash,headers:fY(this.headers),body:this.body.toJSON()}},pipe(){return vY(this,arguments)}};function R(Y,Z,$,J,Q,X){let G=Object.create(sJ);return G.method=Y,G.url=Z,G.urlParams=$,G.hash=J,G.headers=Q,G.body=X,G}var i1=R("GET","",m0,H(),n,QZ),KY=(Y)=>(Z,$)=>p1(i1,{method:Y,url:Z,...$??void 0}),tJ=KY("GET"),eJ=KY("POST"),YQ=KY("PATCH"),ZQ=KY("PUT"),$Q=KY("DELETE");var JQ=KY("HEAD"),QQ=KY("OPTIONS"),XQ=KY("TRACE"),p1=O(2,(Y,Z)=>{let $=Y;if(Z.method)$=r6($,Z.method);if(Z.url)$=EZ($,Z.url);if(Z.headers)$=p0($,Z.headers);if(Z.urlParams)$=e6($,Z.urlParams);if(Z.hash)$=Y7($,Z.hash);if(Z.body)$=$Y($,Z.body);if(Z.accept)$=n1($,Z.accept);if(Z.acceptJson)$=s6($);return $}),r6=O(2,(Y,Z)=>R(Z,Y.url,Y.urlParams,Y.hash,Y.headers,Y.body)),HZ=O(3,(Y,Z,$)=>R(Y.method,Y.url,Y.urlParams,Y.hash,HY(Y.headers,Z,$),Y.body)),p0=O(2,(Y,Z)=>R(Y.method,Y.url,Y.urlParams,Y.hash,b0(Y.headers,Z),Y.body)),GQ=O(3,(Y,Z,$)=>HZ(Y,"Authorization",`Basic ${btoa(`${i0(Z)}:${i0($)}`)}`)),KQ=O(2,(Y,Z)=>HZ(Y,"Authorization",`Bearer ${i0(Z)}`)),n1=O(2,(Y,Z)=>HZ(Y,"Accept",Z)),s6=n1("application/json"),EZ=O(2,(Y,Z)=>{if(typeof Z==="string")return R(Y.method,Z,Y.urlParams,Y.hash,Y.headers,Y.body);let $=new URL(Z.toString()),J=a($.searchParams),Q=l1($.hash===""?void 0:$.hash.slice(1));return $.search="",$.hash="",R(Y.method,$.toString(),J,Q,Y.headers,Y.body)}),a1=O(2,(Y,Z)=>{if(Z==="")return Y;return R(Y.method,t6(Z,Y.url),Y.urlParams,Y.hash,Y.headers,Y.body)}),VQ=O(2,(Y,Z)=>{if(Z==="")return Y;return R(Y.method,t6(Y.url,Z),Y.urlParams,Y.hash,Y.headers,Y.body)}),t6=(Y,Z)=>{let $=Y.endsWith("/"),J=Z.startsWith("/");return $&&J?Y+Z.slice(1):!$&&!J?Y+"/"+Z:Y+Z},zQ=O(2,(Y,Z)=>R(Y.method,Z(Y.url),Y.urlParams,Y.hash,Y.headers,Y.body)),_Q=O(3,(Y,Z,$)=>R(Y.method,Y.url,R6(Y.urlParams,Z,$),Y.hash,Y.headers,Y.body)),e6=O(2,(Y,Z)=>R(Y.method,Y.url,S6(Y.urlParams,Z),Y.hash,Y.headers,Y.body)),BQ=O(3,(Y,Z,$)=>R(Y.method,Y.url,g6(Y.urlParams,Z,$),Y.hash,Y.headers,Y.body)),OQ=O(2,(Y,Z)=>R(Y.method,Y.url,C6(Y.urlParams,Z),Y.hash,Y.headers,Y.body)),Y7=O(2,(Y,Z)=>R(Y.method,Y.url,Y.urlParams,b(Z),Y.headers,Y.body)),DQ=(Y)=>R(Y.method,Y.url,Y.urlParams,H(),Y.headers,Y.body),$Y=O(2,(Y,Z)=>{let $=Y.headers;if(Z._tag==="Empty"||Z._tag==="FormData")$=q0(q0($,"Content-Type"),"Content-length");else{if(Z.contentType)$=HY($,"content-type",Z.contentType);if(Z.contentLength!==void 0)$=HY($,"content-length",Z.contentLength.toString())}return R(Y.method,Y.url,Y.urlParams,Y.hash,$,Z)}),WQ=O((Y)=>KZ(Y[0]),(Y,Z,$)=>$Y(Y,lZ(Z,$))),AQ=O((Y)=>KZ(Y[0]),(Y,Z,$)=>$Y(Y,uY(Z,$))),UQ=O(2,(Y,Z)=>L(d0(Z),($)=>$Y(Y,$))),FQ=O(2,(Y,Z)=>$Y(Y,c0(Z))),NQ=(Y,Z)=>{let $=d1(Y,Z);return O(2,(J,Q)=>L($(Q),(X)=>$Y(J,X)))},LQ=O(2,(Y,Z)=>$Y(Y,d6(a(Z)))),MQ=O(2,(Y,Z)=>$Y(Y,u0(Z))),TQ=O(2,(Y,Z)=>$Y(Y,l6(Z))),wQ=O((Y)=>KZ(Y[0]),(Y,Z,$)=>$Y(Y,jY(Z,$?.contentType,$?.contentLength))),HQ=O((Y)=>KZ(Y[0]),(Y,Z,$)=>L(p6(Z,$),(J)=>$Y(Y,J)));function o1(Y){let Z=uZ(Y.url,Y.urlParams,XZ(Y.hash));if(o6(Z))return b(Z.success);return H()}var EQ=(Y)=>{let Z=Y.method.toUpperCase();return p1(i1,{method:Z,url:new URL(Y.url),headers:Y.headers,body:IQ(Y,Z)})},IQ=(Y,Z)=>{if(!TZ(Z)||Y.body===null)return QZ;return c1(Y.body,{contentType:Y.headers.get("content-type")??void 0,contentLength:PQ(Y.headers.get("content-length"))})},PQ=(Y)=>{if(Y===null)return;let Z=Number.parseInt(Y,10);return Number.isNaN(Z)?void 0:Z},Z7=(Y,Z)=>{let $=uZ(Y.url,Y.urlParams,XZ(Y.hash));if(iZ($))return h($.failure);let J={method:Y.method,headers:Y.headers};if(Z?.signal)J.signal=Z.signal;if(TZ(Y.method))switch(Y.body._tag){case"Empty":break;case"Raw":{if(J.body=Y.body.body,jQ(Y.body.body))J.duplex="half";break}case"Uint8Array":{J.body=Y.body.body;break}case"FormData":{J.body=Y.body.formData;break}case"Stream":{J.body=wZ(Y.body.stream,Z?.context??GZ()),J.duplex="half";break}}return a6({try:()=>new Request($.success,J),catch:(Q)=>new h0({cause:Q})})},jQ=(Y)=>typeof ReadableStream<"u"&&Y instanceof ReadableStream,vQ=(Y,Z)=>ZY(($)=>Z7(Y,{context:$,signal:Z?.signal}).asEffect());var e0={};kY(e0,{stream:()=>kQ,schemaNoBody:()=>yQ,schemaJson:()=>xQ,schemaHeaders:()=>N7,schemaBodyUrlParams:()=>oZ,schemaBodyJson:()=>s0,matchStatus:()=>mQ,fromWeb:()=>J5,filterStatusOk:()=>X5,filterStatus:()=>Q5,TypeId:()=>zZ});var r1="~effect/http/Cookies",SQ=(Y)=>q(Y,r1);var $7="~effect/http/Cookies/Cookie";var J7="~effect/http/Cookies/CookieError";class B7 extends n0{}class VZ extends P("CookieError"){static fromReason(Y,Z){return new VZ({reason:new B7({_tag:Y,cause:Z})})}[J7]=J7;get message(){return this.reason._tag}}var gQ={[r1]:r1,..._Y,toJSON(){return{_id:"effect/Cookies",cookies:K7(this.cookies,(Y)=>Y.toJSON())}},pipe(){return vY(this,arguments)}},t1=(Y)=>{let Z=Object.create(gQ);return Z.cookies=Y,Z},O7=(Y)=>{let Z={};for(let $ of Y)Z[$.name]=$;return t1(Z)},e1=(Y)=>{let Z=typeof Y==="string"?[Y]:Y,$=[];for(let J of Z){let Q=CQ(J.trim());if(Q)$.push(Q)}return O7($)};function CQ(Y){let Z=Y.split(";").map((K)=>K.trim()).filter((K)=>K!=="");if(Z.length===0)return;let $=Z[0].indexOf("=");if($===-1)return;let J=Z[0].slice(0,$);if(!nZ.test(J))return;let Q=Z[0].slice($+1),X=U7(Q);if(Z.length===1)return Object.assign(Object.create(s1),{name:J,value:X,valueEncoded:Q});let G={};for(let K=1;K<Z.length;K++){let z=Z[K],_=z.indexOf("="),B=_===-1?z:z.slice(0,_).trim(),V=_===-1?void 0:z.slice(_+1).trim();switch(B.toLowerCase()){case"domain":{if(V===void 0)break;let D=V.trim().replace(/^\./,"");if(D)G.domain=D;break}case"expires":{if(V===void 0)break;let D=new Date(V);if(!isNaN(D.getTime()))G.expires=D;break}case"max-age":{if(V===void 0)break;let D=parseInt(V,10);if(!isNaN(D))G.maxAge=IZ(D);break}case"path":{if(V===void 0)break;if(V[0]==="/")G.path=V;break}case"priority":{if(V===void 0)break;switch(V.toLowerCase()){case"low":G.priority="low";break;case"medium":G.priority="medium";break;case"high":G.priority="high";break}break}case"httponly":{G.httpOnly=!0;break}case"secure":{G.secure=!0;break}case"partitioned":{G.partitioned=!0;break}case"samesite":{if(V===void 0)break;switch(V.toLowerCase()){case"lax":G.sameSite="lax";break;case"strict":G.sameSite="strict";break;case"none":G.sameSite="none";break}break}}}return Object.assign(Object.create(s1),{name:J,value:X,valueEncoded:Q,options:Object.keys(G).length>0?G:void 0})}var a0=O7([]),o0=(Y)=>G7(Y.cookies),nZ=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,s1={[$7]:$7,..._Y,toJSON(){return{_id:"effect/Cookies/Cookie",name:this.name,value:this.value,options:this.options}}};function bQ(Y,Z,$){if(!nZ.test(Y))return h(VZ.fromReason("InvalidCookieName"));let J=encodeURIComponent(Z);if(J&&!nZ.test(J))return h(VZ.fromReason("InvalidCookieValue"));if($!==void 0){if($.domain!==void 0&&!nZ.test($.domain))return h(VZ.fromReason("InvalidCookieDomain"));if($.path!==void 0&&!nZ.test($.path))return h(VZ.fromReason("InvalidCookiePath"));if($.maxAge!==void 0&&!z7(aZ($.maxAge)))return h(VZ.fromReason("CookieInfinityMaxAge"))}return PY(Object.assign(Object.create(s1),{name:Y,value:Z,valueEncoded:J,options:$}))}var Y5=O(2,(Y,Z)=>t1({...Y.cookies,...Z.cookies}));var D7=O((Y)=>SQ(Y[0]),(Y,Z,$,J)=>X7(bQ(Z,$,J),(Q)=>t1(V7(Y.cookies,Z,Q))));function qQ(Y){let Z=Y.name+"="+Y.valueEncoded;if(Y.options===void 0)return Z;let $=Y.options;if($.maxAge!==void 0){let J=_7(aZ($.maxAge));Z+="; Max-Age="+Math.trunc(J)}if($.domain!==void 0)Z+="; Domain="+$.domain;if($.path!==void 0)Z+="; Path="+$.path;if($.priority!==void 0)switch($.priority){case"low":Z+="; Priority=Low";break;case"medium":Z+="; Priority=Medium";break;case"high":Z+="; Priority=High";break}if($.expires!==void 0)Z+="; Expires="+$.expires.toUTCString();if($.httpOnly)Z+="; HttpOnly";if($.secure)Z+="; Secure";if($.partitioned)Z+="; Partitioned";if($.sameSite!==void 0)switch($.sameSite){case"lax":Z+="; SameSite=Lax";break;case"strict":Z+="; SameSite=Strict";break;case"none":Z+="; SameSite=None";break}return Z}var W7=(Y)=>Object.values(Y.cookies).map((Z)=>`${Z.name}=${Z.valueEncoded}`).join("; ");var A7=(Y)=>Object.values(Y.cookies).map(qQ);function Z5(Y){let Z={},$=Y.length,J=0,Q=0;while(!0){if(Q===$)break;if(Q=Y.indexOf(";",J),Q===-1)Q=$;let X=Y.indexOf("=",J);if(X===-1)break;if(X>Q){J=Q+1;continue}let G=Y.substring(J,X++).trim();if(Z[G]===void 0){let K=Y.charCodeAt(X)===34?Y.substring(X+1,Q-1).trim():Y.substring(X,Q).trim();Z[G]=K.indexOf("%")!==-1?U7(K):K}J=Q+1}return Z}var U7=(Y)=>{try{return decodeURIComponent(Y)}catch(Z){return Y}};var c="~effect/http/HttpIncomingMessage";var s0=(Y,Z)=>{let $=iY(LZ(Y).annotate({options:Z}));return(J)=>U(J.json,$)},oZ=(Y,Z)=>{let $=q6.pipe(cY(Y),F7({options:Z}),iY);return(J)=>U(J.urlParamsBody,$)},N7=(Y,Z)=>{let $=f(Y);return(J)=>$(J.headers,Z)},rZ=j("effect/http/HttpIncomingMessage/MaxBodySize",{defaultValue:()=>{return}}),sZ=(Y,Z)=>{let $=Y.headers["content-type"]??"",J;if($.includes("application/json"))try{J=o(Y.json)}catch(X){}else if($.includes("text/")||$.includes("urlencoded"))try{J=o(Y.text)}catch(X){}let Q={...Z,headers:fY(Y.headers),remoteAddress:Y.remoteAddress};if(J!==void 0)Q.body=J;return Q};var zZ="~effect/http/HttpClientResponse",J5=(Y,Z)=>new L7(Y,Z),xQ=(Y,Z)=>{let $=iY(LZ(Y).annotate({options:Z}));return(J)=>U(J.json,(Q)=>$({status:J.status,headers:J.headers,body:Q}))},yQ=(Y,Z)=>{let $=iY(Y.annotate({options:Z}));return(J)=>$({status:J.status,headers:J.headers})},kQ=(Y)=>$5(L(Y,(Z)=>Z.stream)),mQ=O(2,(Y,Z)=>{let $=Y.status;if(Z[$])return Z[$](Y);else if($>=200&&$<300&&Z["2xx"])return Z["2xx"](Y);else if($>=300&&$<400&&Z["3xx"])return Z["3xx"](Y);else if($>=400&&$<500&&Z["4xx"])return Z["4xx"](Y);else if($>=500&&$<600&&Z["5xx"])return Z["5xx"](Y);return Z.orElse(Y)}),Q5=O(2,(Y,Z)=>_Z(()=>Z(Y.status)?F(Y):g(new x({reason:new kZ({response:Y,request:Y.request,description:"invalid status code"})})))),X5=(Y)=>Y.status>=200&&Y.status<300?F(Y):g(new x({reason:new kZ({response:Y,request:Y.request,description:"non 2xx status code"})}));class L7 extends RY{[c];[zZ];request;source;constructor(Y,Z){super();this.request=Y,this.source=Z,this[c]=c,this[zZ]=zZ}toJSON(){return sZ(this,{_id:"HttpClientResponse",request:this.request.toJSON(),status:this.status})}get status(){return this.source.status}get headers(){return C(this.source.headers)}cachedCookies;get cookies(){if(this.cachedCookies)return this.cachedCookies;return this.cachedCookies=e1(this.source.headers.getSetCookie())}get remoteAddress(){return H()}get stream(){return this.source.body?SY({evaluate:()=>this.source.body,onError:(Y)=>new x({reason:new TY({request:this.request,response:this,cause:Y})})}):tZ(new x({reason:new R0({request:this.request,response:this,description:"can not create stream from empty body"})}))}get json(){return U(this.text,(Y)=>GY({try:()=>Y===""?null:JSON.parse(Y),catch:(Z)=>new x({reason:new TY({request:this.request,response:this,cause:Z})})}))}textBody;get text(){return this.textBody??=d({try:()=>this.source.text(),catch:(Y)=>new x({reason:new TY({request:this.request,response:this,cause:Y})})}).pipe(OY,o)}get urlParamsBody(){return U(this.text,(Y)=>GY({try:()=>a(new URLSearchParams(Y)),catch:(Z)=>new x({reason:new TY({request:this.request,response:this,cause:Z})})}))}formDataBody;get formData(){return this.formDataBody??=d({try:()=>this.source.formData(),catch:(Y)=>new x({reason:new TY({request:this.request,response:this,cause:Y})})}).pipe(OY,o)}arrayBufferBody;get arrayBuffer(){return this.arrayBufferBody??=d({try:()=>this.source.arrayBuffer(),catch:(Y)=>new x({reason:new TY({request:this.request,response:this,cause:Y})})}).pipe(OY,o)}pipe(){return vY(this,arguments)}}var G1={};kY(G1,{withScope:()=>HX,withRateLimiter:()=>OX,withCookiesRef:()=>wX,transformResponse:()=>s,transform:()=>A5,tapRequest:()=>TX,tapError:()=>MX,tap:()=>LX,retryTransient:()=>BX,retry:()=>_X,put:()=>rQ,post:()=>aQ,patch:()=>oQ,options:()=>tQ,mapRequestInputEffect:()=>zX,mapRequestInput:()=>VX,mapRequestEffect:()=>KX,mapRequest:()=>F5,makeWith:()=>VY,make:()=>U5,layerMergedContext:()=>N5,isHttpClient:()=>r7,head:()=>nQ,get:()=>pQ,followRedirects:()=>EX,filterStatusOk:()=>XX,filterStatus:()=>QX,filterOrFail:()=>JX,filterOrElse:()=>$X,execute:()=>iQ,del:()=>sQ,catchTags:()=>ZX,catchTag:()=>YX,catch:()=>eQ,TracerPropagationEnabled:()=>e7,TracerDisabledWhen:()=>t7,SpanNameGenerator:()=>Y8,HttpClient:()=>vZ});var T7=(Y)=>wY({b3:`${Y.traceId}-${Y.spanId}-${Y.sampled?"1":"0"}${BY(Y.parent,{onNone:()=>"",onSome:(Z)=>`-${Z.spanId}`})}`,traceparent:`00-${Y.traceId}-${Y.spanId}-${Y.sampled?"01":"00"}`}),w7=(Y)=>{let Z=uQ(Y);if(r(Z))return Z;if(Z=hQ(Y),r(Z))return Z;return fQ(Y)},hQ=(Y)=>{if(!("b3"in Y))return H();let Z=Y.b3.split("-");if(Z.length<2)return H();return b(Y1({traceId:Z[0],spanId:Z[1],sampled:Z[2]?Z[2]==="1":!0}))},fQ=(Y)=>{if(!Y["x-b3-traceid"]||!Y["x-b3-spanid"])return H();return b(Y1({traceId:Y["x-b3-traceid"],spanId:Y["x-b3-spanid"],sampled:Y["x-b3-sampled"]?Y["x-b3-sampled"]==="1":!0}))},cQ=/^[0-9a-f]{32}$/i,dQ=/^[0-9a-f]{16}$/i,uQ=(Y)=>{if(!Y.traceparent)return H();let Z=Y.traceparent.split("-");if(Z.length!==4)return H();let[$,J,Q,X]=Z;switch($){case"00":{if(cQ.test(J)===!1||dQ.test(Q)===!1)return H();return b(Y1({traceId:J,spanId:Q,sampled:(parseInt(X,16)&1)===1}))}default:return H()}};var V5="~effect/http/HttpClient",r7=(Y)=>q(Y,V5),vZ=S("effect/HttpClient"),aY=(Y)=>(...Z)=>U(vZ.asEffect(),($)=>$[Y](...Z)),iQ=aY("execute"),pQ=aY("get"),nQ=aY("head"),aQ=aY("post"),oQ=aY("patch"),rQ=aY("put"),sQ=aY("del"),tQ=aY("options"),A5=O(2,(Y,Z)=>VY(U(($)=>Z(Y.postprocess(F($)),$)),Y.preprocess)),s=O(2,(Y,Z)=>VY(($)=>Z(Y.postprocess($)),Y.preprocess)),eQ=O(2,(Y,Z)=>s(Y,b7(Z)));var YX=O(3,(Y,Z,$)=>s(Y,X1(Z,$))),ZX=O(2,(Y,Z)=>s(Y,q7(Z))),$X=O(3,(Y,Z,$)=>s(Y,m7(Z,$))),JX=O(3,(Y,Z,$)=>s(Y,h7(Z,$))),QX=O(2,(Y,Z)=>s(Y,U(Q5(Z)))),XX=s(U(X5)),VY=(Y,Z)=>{let $=Object.create(GX);return $.preprocess=Z,$.postprocess=Y,$.execute=function(J){return Y(Z(J))},$},GX={[V5]:V5,pipe(){return vY(this,arguments)},..._Y,toJSON(){return{_id:"effect/HttpClient"}},...Object.fromEntries(n6.map(([Y,Z])=>[Z,function($,J){return this.execute(KY(Y)($,J))}]))},U5=(Y)=>VY((Z)=>U(Z,($)=>u((J)=>{let Q=Z8.get($),X=Q??new AbortController,G=uZ($.url,$.urlParams,XZ($.hash));if(iZ(G))return g(new x({reason:new v0({request:$,cause:G.failure})}));let K=G.success;if(J.getRef(R7)||J.getRef(t7)($)){let _=Y($,K,X.signal,J);if(Q)return _;return K5((B)=>jZ(B(_),{onSuccess(V){return Z1.register(V,X),F(new z5(V,X))},onFailure(V){if(G5(V))X.abort();return eZ(V)}}))}return l7(J.getRef(Y8)($),{kind:"client"},(_)=>{if(_.attribute("http.request.method",$.method),_.attribute("server.address",K.origin),K.port!=="")_.attribute("server.port",+K.port);_.attribute("url.full",K.toString()),_.attribute("url.path",K.pathname),_.attribute("url.scheme",K.protocol.slice(0,-1));let B=K.search.slice(1);if(B!=="")_.attribute("url.query",B);let V=J.getRef(cZ),D=YZ($.headers,V);for(let A in D)_.attribute(`http.request.header.${A}`,String(D[A]));return $=J.getRef(e7)?p0($,T7(_)):$,K5((A)=>A(Y($,K,X.signal,J)).pipe(i7(_,{captureStackTrace:!1}),jZ({onSuccess:(W)=>{_.attribute("http.response.status_code",W.status);let N=YZ(W.headers,V);for(let T in N)_.attribute(`http.response.header.${T}`,String(N[T]));if(Q)return F(W);return Z1.register(W,X),F(new z5(W,X))},onFailure(W){if(!Q&&G5(W))X.abort();return eZ(W)}})))})})),F),F5=O(2,(Y,Z)=>VY(Y.postprocess,($)=>L(Y.preprocess($),Z))),KX=O(2,(Y,Z)=>VY(Y.postprocess,($)=>U(Y.preprocess($),Z))),VX=O(2,(Y,Z)=>VY(Y.postprocess,($)=>Y.preprocess(Z($)))),zX=O(2,(Y,Z)=>VY(Y.postprocess,($)=>U(Z($),Y.preprocess))),_X=O(2,(Y,Z)=>s(Y,D5(Z))),BX=O(2,(Y,Z)=>{let $=g7(Z),J=$?"errors-and-responses":Z.retryOn??"errors-and-responses",Q=$?Z:Z.schedule,X=Q&&C7(Q),G=$?void 0:Z.times;return s(Y,_5(J==="errors-only"?BZ:u7({schedule:X,times:G,while:$8}),J==="response-only"?BZ:D5({while:$||Z.while===void 0?E7:P7(E7,Z.while),schedule:Q,times:G})))}),OX=O(2,(Y,Z)=>{let $={initial:!0,limit:Z.limit,window:Y0(aZ(Z.window),gY(1))},J=new Map,Q=Z.key,X=typeof Q==="function"?Q:DY(Q),G=Z.tokens,K=typeof G==="function"?G:DY(G??1),z=(B)=>{let V=J.get(B);if(V!==void 0)return V;return J.set(B,$),$},_=Z.disableResponseInspection?void 0:(B,V,D,A)=>{let W=z(V),N=DX(W,B,D,A);if(N.limit!==W.limit||!B5(N.window,W.window))J.set(V,N)};return A5(Y,function B(V,D){let W=nY().getRef(J1),N=X(D),T=Math.max(K(D),1),E=z(N);function YY(I){if(Z.disableResponseInspection)return B(V,D);let p=s7(W,PZ(I.headers,"retry-after"));return p?U(k7(p),()=>B(V,D)):B(V,D)}return U(Z.limiter.consume({algorithm:Z.algorithm,onExceeded:"delay",key:N,limit:E.limit,window:E.window,tokens:T}),({delay:I})=>{let p=f7(V,{onSuccess(w){if(_?.(W,N,w.headers,T),w.status!==429)return F(w);return YY(w)},onFailure(w){if(PX(w))return _?.(W,N,w.reason.response.headers,T),YY(w.reason.response);return g(w)}});return v7(I)?p:y7(p,I)})})}),DX=(Y,Z,$,J)=>{let Q=WX(Y,$,J)??Y.limit,X=UX(Z,$)??Y.window;if(Q===Y.limit&&B5(X,Y.window))return Y;return{limit:Q,window:X,initial:!1}},WX=(Y,Z,$)=>{let J=PZ(Z,"ratelimit-limit","x-ratelimit-limit"),Q=J0(J);if(Q!==void 0&&Q>0)return Q;let X=AX(Z);if(X===void 0)return;return Y.initial?X+$:Math.max(X+$,Y.limit)},AX=(Y)=>{let Z=PZ(Y,"ratelimit-remaining","x-ratelimit-remaining"),$=J0(Z);return $!==void 0&&$>=0?$:void 0},UX=(Y,Z)=>{let $=s7(Y,PZ(Z,"retry-after"));if($!==void 0)return $;let J=FX(PZ(Z,"ratelimit-reset-after","x-ratelimit-reset-after"));if(J!==void 0)return J;return NX(Y,PZ(Z,"ratelimit-reset","x-ratelimit-reset"))},s7=(Y,Z)=>{if(Z===void 0)return;let $=J0(Z);if($!==void 0)return Y0(IZ($),gY(1));let J=Date.parse(Z);if(Number.isNaN(J))return;let Q=J-Y.currentTimeMillisUnsafe();if(Q<=0)return gY(1);return gY(Q)},FX=(Y)=>{let Z=J0(Y);if(Z===void 0||Z<=0)return;return Y0(IZ(Z),gY(1))},NX=(Y,Z)=>{let $=J0(Z);if($===void 0||$<=0)return;let J=Y.currentTimeMillisUnsafe();if($>1000000000000)return gY(Math.max($-J,1));if($>1e9)return gY(Math.max($*1000-J,1));return Y0(IZ($),gY(1))},J0=(Y)=>{if(Y===void 0)return;let Z=/-?\d+(?:\.\d+)?/.exec(Y);if(Z===null)return;let $=Number(Z[0]);return Number.isFinite($)?$:void 0},PZ=(Y,...Z)=>{for(let $=0;$<Z.length;$++){let J=Y[Z[$]];if(J!==void 0)return J}return},LX=O(2,(Y,Z)=>s(Y,Q1(Z))),MX=O(2,(Y,Z)=>s(Y,x7(Z))),TX=O(2,(Y,Z)=>VY(Y.postprocess,($)=>Q1(Y.preprocess($),Z))),wX=O(2,(Y,Z)=>VY(($)=>Q1(Y.postprocess($),(J)=>o7(Z,(Q)=>Y5(Q,J.cookies))),($)=>U(Y.preprocess($),(J)=>L(a7(Z),(Q)=>o0(Q)?J:HZ(J,"cookie",W7(Q)))))),HX=(Y)=>A5(Y,(Z,$)=>{let J=new AbortController;return Z8.set($,J),$0(c7(()=>WY(()=>J.abort())),Z)}),EX=O((Y)=>r7(Y[0]),(Y,Z)=>VY(($)=>{let J=(Q,X)=>U(Y.postprocess(F(Q)),(G)=>G.status>=300&&G.status<400&&G.headers.location&&X<(Z??10)?J(EZ(Q,new URL(G.headers.location,G.request.url)),X+1):F(G));return U($,(Q)=>J(Q,0))},Y.preprocess)),t7=j("effect/http/HttpClient/TracerDisabledWhen",{defaultValue:()=>$1}),e7=j("effect/HttpClient/TracerPropagationEnabled",{defaultValue:I7}),Y8=j("effect/http/HttpClient/SpanNameGenerator",{defaultValue:()=>(Y)=>`http.client ${Y.method}`}),N5=(Y)=>pY(vZ)(ZY((Z)=>L(Y,($)=>s($,W5((J)=>j7(Z,J)))))),Z1=(()=>{if("FinalizationRegistry"in globalThis&&globalThis.FinalizationRegistry){let Z=new FinalizationRegistry(($)=>{$.abort()});return{register($,J){Z.register($,J,$)},unregister($){Z.unregister($)}}}let Y=new Map;return{register(Z,$){Y.set(Z,setTimeout(()=>$.abort(),5000))},unregister(Z){let $=Y.get(Z);if($===void 0)return;clearTimeout($),Y.delete(Z)}}})(),Z8=new WeakMap;class z5{original;controller;constructor(Y,Z){this.original=Y,this.controller=Z}[zZ]=zZ;[c]=c;applyInterrupt(Y){return _Z(()=>{return Z1.unregister(this.original),d7(Y,()=>WY(()=>{this.controller.abort()}))})}get request(){return this.original.request}get status(){return this.original.status}get headers(){return this.original.headers}get cookies(){return this.original.cookies}get remoteAddress(){return this.original.remoteAddress}get formData(){return this.applyInterrupt(this.original.formData)}get text(){return this.applyInterrupt(this.original.text)}get json(){return this.applyInterrupt(this.original.json)}get urlParamsBody(){return this.applyInterrupt(this.original.urlParamsBody)}get arrayBuffer(){return this.applyInterrupt(this.original.arrayBuffer)}get stream(){return p7(()=>{return Z1.unregister(this.original),n7(this.original.stream,WY(()=>{this.controller.abort()}))})}toJSON(){return this.original.toJSON()}[hY](){return this.original[hY]()}pipe(){return vY(this,arguments)}}var E7=(Y)=>S7(Y)||IX(Y),IX=(Y)=>P0(Y)&&(Y.reason._tag==="TransportError"||Y.reason._tag==="StatusCodeError"&&$8(Y.reason.response)),PX=(Y)=>P0(Y)&&Y.reason._tag==="StatusCodeError"&&Y.reason.response.status===429,$8=(Y)=>Y.status===408||Y.status===429||Y.status===500||Y.status===502||Y.status===503||Y.status===504;var X8={};kY(X8,{layer:()=>vX,RequestInit:()=>L5,Fetch:()=>Q8});var Q8=j("effect/http/FetchHttpClient/Fetch",{defaultValue:()=>globalThis.fetch});class L5 extends S()("effect/http/FetchHttpClient/RequestInit"){}var jX=U5((Y,Z,$,J)=>{let Q=J.getRef(Q8),X=J.context.mapUnsafe.get(L5.key)??{},G=X.headers?fZ(C(X.headers),Y.headers):Y.headers,K=(z)=>L(d({try:()=>Q(Z,{...X,method:Y.method,headers:G,body:z,duplex:Y.body._tag==="Stream"?"half":void 0,signal:$}),catch:(_)=>new x({reason:new j0({request:Y,cause:_})})}),(_)=>J5(Y,_));switch(Y.body._tag){case"Raw":case"Uint8Array":return K(Y.body.body);case"FormData":return K(Y.body.formData);case"Stream":return U(J8(Y.body.stream),K)}return K(void 0)}),vX=N5(F(jX));var qJ={};kY(qJ,{use:()=>SJ,toWebHandler:()=>H2,toHttpEffect:()=>A2,serve:()=>w2,schemaPathParams:()=>O2,schemaParams:()=>B2,schemaNoBody:()=>_2,schemaJson:()=>z2,route:()=>gJ,provideRequest:()=>T2,prefixRoute:()=>CJ,prefixPath:()=>T0,params:()=>RJ,middleware:()=>R1,make:()=>vJ,layer:()=>xZ,disableLogger:()=>M2,cors:()=>L2,addAll:()=>W2,add:()=>D2,RouterConfig:()=>v1,RouteContext:()=>WZ,HttpRouter:()=>LY});var G8=/\+/g,K8=function(){};K8.prototype=Object.create(null);function V8(Y){let Z=new K8;if(typeof Y!=="string")return Z;let $=Y.length,J="",Q="",X=-1,G=-1,K=!1,z=!1,_=!1,B=!1,V=!1,D=0;for(let A=0;A<$+1;A++)if(D=A!==$?Y.charCodeAt(A):38,D===38){if(V=G>X,!V)G=A;if(J=Y.slice(X+1,G),V||J.length>0){if(_)J=J.replace(G8," ");if(K)try{J=decodeURIComponent(J)||J}catch{}if(V){if(Q=Y.slice(G+1,A),B)Q=Q.replace(G8," ");if(z)try{Q=decodeURIComponent(Q)||Q}catch{}}let W=Z[J];if(W===void 0)Z[J]=Q;else if(W.pop)W.push(Q);else Z[J]=[W,Q]}Q="",X=A,G=A,K=!1,z=!1,_=!1,B=!1}else if(D===61)if(G<=X)G=A;else z=!0;else if(D===43)if(G>X)B=!0;else _=!0;else if(D===37)if(G>X)z=!0;else K=!0;return Z}var SX=/^https?:\/\/.*?\//,M5=/(\/:[^/()]*?)\?(\/?)/,O8=(Y={})=>new D8(Y);class D8{constructor(Y={}){this.options={ignoreTrailingSlash:!0,ignoreDuplicateSlashes:!0,caseSensitive:!1,maxParamLength:100,...Y}}options;routes=[];trees={};on(Y,Z,$){let J=Z.match(M5);if(J&&J.index!==void 0){gX(Z.length===J.index+J[0].length,"Optional Parameter needs to be the last parameter of the path");let X=Z.replace(M5,"$1$2"),G=Z.replace(M5,"$2");this.on(Y,X,$),this.on(Y,G,$);return}if(this.options.ignoreDuplicateSlashes)Z=z8(Z);if(this.options.ignoreTrailingSlash)Z=_8(Z);let Q=typeof Y==="string"?[Y]:Y;for(let X of Q)this._on(X,Z,$)}all(Y,Z){this.on(kX,Y,Z)}_on(Y,Z,$){if(this.trees[Y]===void 0)this.trees[Y]=new Q0("/");let J=Z;if(J==="*"&&this.trees[Y].prefix.length!==0){let z=this.trees[Y];this.trees[Y]=new Q0(""),this.trees[Y].staticChildren["/"]=z}let Q=this.trees[Y].prefix.length,X=this.trees[Y],G=[];for(let z=0;z<=J.length;z++){if(J.charCodeAt(z)===58&&J.charCodeAt(z+1)===58){z++;continue}let _=J.charCodeAt(z)===58&&J.charCodeAt(z+1)!==58,B=J.charCodeAt(z)===42;if(_||B||z===J.length&&z!==Q){let V=J.slice(Q,z);if(!this.options.caseSensitive)V=V.toLowerCase();V=V.split("::").join(":"),V=V.split("%").join("%25"),X=X.createStaticChild(V)}if(_){let V=!1,D=[],A=z+1;for(let W=A;;W++){let N=J.charCodeAt(W),T=N===40,E=N===45||N===46,YY=N===47||W===J.length;if(T||E||YY){let I=J.slice(A,W);if(G.push(I),V=V||T||E,T){let yY=bX(J,W),w0=J.slice(W,yY+1);D.push(qX(w0)),W=yY+1}else D.push("(.*?)");let p=W;for(;W<J.length;W++){let yY=J.charCodeAt(W);if(yY===47)break;if(yY===58)if(J.charCodeAt(W+1)===58)W++;else break}let w=J.slice(p,W);if(w)w=w.split("::").join(":"),w=w.split("%").join("%25"),D.push(xX(w));if(A=W+1,YY||J.charCodeAt(W)===47||W===J.length){let yY=V?"()"+w:w,w0=J.slice(z,W);J=J.slice(0,z+1)+yY+J.slice(W),z+=yY.length;let xJ=V?new RegExp("^"+D.join("")+"$"):void 0;X=X.createParametricChild(xJ,w,w0),Q=z+1;break}}}}else if(B){if(G.push("*"),X=X.createWildcardChild(),Q=z+1,z!==J.length-1)throw Error("Wildcard must be the last character in the route")}}if(!this.options.caseSensitive)J=J.toLowerCase();if(J==="*")J="/*";for(let z of this.routes)if(z.method===Y&&z.pattern===J)throw Error(`Method '${Y}' already declared for route '${J}'`);let K={method:Y,path:Z,pattern:J,params:G,handler:$};this.routes.push(K),X.addRoute(K)}has(Y,Z){let $=this.trees[Y];if($===void 0)return!1;let J=$.getStaticChild(Z);if(J===void 0)return!1;return J.isLeafNode}find(Y,Z){let $=this.trees[Y];if($===void 0)return;if(Z.charCodeAt(0)!==47)Z=Z.replace(SX,"/");if(this.options.ignoreDuplicateSlashes)Z=z8(Z);let J,Q,X;try{J=yX(Z),Z=J.path,Q=J.querystring,X=J.shouldDecodeParam}catch(D){return}if(this.options.ignoreTrailingSlash)Z=_8(Z);let G=Z;if(this.options.caseSensitive===!1)Z=Z.toLowerCase();let K=this.options.maxParamLength,z=$.prefix.length,_=[],B=Z.length,V=[];while(!0){if(z===B&&$.isLeafNode){let A=$.handlerStorage?.find();if(A!==void 0)return{handler:A.handler,params:A.createParams(_),searchParams:V8(Q)}}let D=$.getNextNode(Z,z,V,_.length);if(D===void 0){if(V.length===0)return;let A=V.pop();z=A.brotherPathIndex,_.splice(A.paramsCount),D=A.brotherNode}if($=D,$._tag==="StaticNode"){z+=$.prefix.length;continue}if($._tag==="WildcardNode"){let A=G.slice(z);if(X)A=B8(A);_.push(A),z=B;continue}if($._tag==="ParametricNode"){let A=G.indexOf("/",z);if(A===-1)A=B;let W=G.slice(z,A);if(X)W=B8(W);if($.regex!==void 0){let N=$.regex.exec(W);if(N===null)continue;for(let T=1;T<N.length;T++){let E=N[T];if(E.length>K)return;_.push(E)}}else{if(W.length>K)return;_.push(W)}z=A}}}}class W8{handlers=[];unconstrainedHandler;find(){return this.unconstrainedHandler}add(Y){let Z={params:Y.params,handler:Y.handler,createParams:CX(Y.params)};this.handlers.push(Z),this.unconstrainedHandler=this.handlers[0]}}class T5{isLeafNode=!1;routes;handlerStorage;addRoute(Y){if(this.routes===void 0)this.routes=[Y];else this.routes.push(Y);if(this.handlerStorage===void 0)this.handlerStorage=new W8;this.isLeafNode=!0,this.handlerStorage.add(Y)}}class w5 extends T5{staticChildren={};findStaticMatchingChild(Y,Z){let $=this.staticChildren[Y.charAt(Z)];if($===void 0||!$.matchPrefix(Y,Z))return;return $}getStaticChild(Y,Z=0){if(Y.length===Z)return this;let $=this.findStaticMatchingChild(Y,Z);if($===void 0)return;return $.getStaticChild(Y,Z+$.prefix.length)}createStaticChild(Y){if(Y.length===0)return this;let Z=this.staticChildren[Y.charAt(0)];if(Z){let J=1;for(;J<Z.prefix.length;J++)if(Y.charCodeAt(J)!==Z.prefix.charCodeAt(J)){Z=Z.split(this,J);break}return Z.createStaticChild(Y.slice(J))}let $=Y.charAt(0);return this.staticChildren[$]=new Q0(Y),this.staticChildren[$]}}class Q0 extends w5{_tag="StaticNode";constructor(Y){super();this.setPrefix(Y)}prefix;matchPrefix;parametricChildren=[];wildcardChild;setPrefix(Y){if(this.prefix=Y,Y.length===1)this.matchPrefix=(Z,$)=>!0;else{let Z=Y.length;this.matchPrefix=function($,J){for(let Q=1;Q<Z;Q++)if($.charCodeAt(J+Q)!==this.prefix.charCodeAt(Q))return!1;return!0}}}getParametricChild(Y){if(Y===void 0)return this.parametricChildren.find(($)=>$.isRegex===!1);let Z=Y.source;return this.parametricChildren.find(($)=>{if($.regex===void 0)return!1;return $.regex.source===Z})}createParametricChild(Y,Z,$){let J=this.getParametricChild(Y);if(J!==void 0)return J.nodePaths.add($),J;return J=new A8(Y,Z,$),this.parametricChildren.push(J),this.parametricChildren.sort((Q,X)=>{if(!Q.isRegex)return 1;if(!X.isRegex)return-1;if(Q.staticSuffix===void 0)return 1;if(X.staticSuffix===void 0)return-1;if(X.staticSuffix.endsWith(Q.staticSuffix))return 1;if(Q.staticSuffix.endsWith(X.staticSuffix))return-1;return 0}),J}createWildcardChild(){if(this.wildcardChild===void 0)this.wildcardChild=new U8;return this.wildcardChild}split(Y,Z){let $=this.prefix.slice(0,Z),J=this.prefix.slice(Z);this.setPrefix(J);let Q=new Q0($);return Q.staticChildren[J.charAt(0)]=this,Y.staticChildren[$.charAt(0)]=Q,Q}getNextNode(Y,Z,$,J){let Q=this.findStaticMatchingChild(Y,Z),X=0;if(Q===void 0){if(this.parametricChildren.length===0)return this.wildcardChild;Q=this.parametricChildren[0],X=1}if(this.wildcardChild!==void 0)$.push({paramsCount:J,brotherPathIndex:Z,brotherNode:this.wildcardChild});for(let G=this.parametricChildren.length-1;G>=X;G--)$.push({paramsCount:J,brotherPathIndex:Z,brotherNode:this.parametricChildren[G]});return Q}}class A8 extends w5{regex;staticSuffix;_tag="ParametricNode";constructor(Y,Z,$){super();this.regex=Y,this.staticSuffix=Z,this.isRegex=!!Y,this.nodePaths=new Set([$])}isRegex;nodePaths;getNextNode(Y,Z){return this.findStaticMatchingChild(Y,Z)}}class U8 extends T5{_tag="WildcardNode";getNextNode(Y,Z,$,J){return}}var gX=(Y,Z)=>{if(!Y)throw Error(Z)};function z8(Y){return Y.replace(/\/\/+/g,"/")}function _8(Y){if(Y.length>1&&Y.charCodeAt(Y.length-1)===47)return Y.slice(0,-1);return Y}function CX(Y){let Z=Y.length;return function($){let J={};for(let Q=0;Q<Z;Q++)J[Y[Q]]=$[Q];return J}}function bX(Y,Z){let $=1;while(Z<Y.length){if(Z++,Y[Z]==="\\"){Z++;continue}if(Y[Z]===")")$--;else if(Y[Z]==="(")$++;if(!$)return Z}throw TypeError('Invalid regexp expression in "'+Y+'"')}function qX(Y){if(Y.charCodeAt(1)===94)Y=Y.slice(0,1)+Y.slice(2);if(Y.charCodeAt(Y.length-2)===36)Y=Y.slice(0,Y.length-2)+Y.slice(Y.length-1);return Y}function xX(Y){return Y.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function F8(Y,Z){if(Y===50){if(Z===53)return"%";if(Z===51)return"#";if(Z===52)return"$";if(Z===54)return"&";if(Z===66)return"+";if(Z===98)return"+";if(Z===67)return",";if(Z===99)return",";if(Z===70)return"/";if(Z===102)return"/";return}if(Y===51){if(Z===65)return":";if(Z===97)return":";if(Z===66)return";";if(Z===98)return";";if(Z===68)return"=";if(Z===100)return"=";if(Z===70)return"?";if(Z===102)return"?";return}if(Y===52&&Z===48)return"@";return}function yX(Y){let Z=!1,$=!1,J="";for(let X=1;X<Y.length;X++){let G=Y.charCodeAt(X);if(G===37){let K=Y.charCodeAt(X+1),z=Y.charCodeAt(X+2);if(F8(K,z)===void 0)Z=!0;else{if($=!0,K===50&&z===53)Z=!0,Y=Y.slice(0,X+1)+"25"+Y.slice(X+1),X+=2;X+=2}}else if(G===63||G===59||G===35){J=Y.slice(X+1),Y=Y.slice(0,X);break}}return{path:Z?decodeURI(Y):Y,querystring:J,shouldDecodeParam:$}}function B8(Y){let Z=Y.indexOf("%");if(Z===-1)return Y;let $="",J=Z;for(let Q=Z;Q<Y.length;Q++)if(Y.charCodeAt(Q)===37){let X=Y.charCodeAt(Q+1),G=Y.charCodeAt(Q+2),K=F8(X,G);$+=Y.slice(J,Q)+K,J=Q+3}return Y.slice(0,Z)+$+Y.slice(J)}var kX=["ACL","BIND","CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LINK","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCALENDAR","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REBIND","REPORT","SEARCH","SOURCE","SUBSCRIBE","TRACE","UNBIND","UNLINK","UNLOCK","UNSUBSCRIBE"];var N8=O8;var H5="~effect/http/HttpServerResponse",AY=(Y)=>q(Y,H5),t=(Y)=>UY({status:Y?.status??204,statusText:Y?.statusText,headers:Y?.headers?C(Y.headers):void 0,cookies:Y?.cookies});var N3=(Y,Z)=>{let $=Z?.headers?C(Z.headers):n;return UY({status:Z?.status??200,statusText:Z?.statusText,headers:$,cookies:Z?.cookies??a0,body:lZ(Y,G0(Z,$))})},G0=(Y,Z)=>{if(Y?.contentType)return Y.contentType;else if(Y?.headers)return Z["content-type"]},L3=(Y,Z)=>{let $=Z?.headers?C(Z.headers):n;return UY({status:Z?.status??200,statusText:Z?.statusText,headers:$,cookies:Z?.cookies??a0,body:uY(Y,G0(Z,$))})};var M3=(Y,Z)=>{let $=Z?.headers?C(Z.headers):n;return UY({status:Z?.status??200,statusText:Z?.statusText,headers:$,cookies:Z?.cookies,body:c0(Y,G0(Z,$))})},T3=(Y,Z)=>{let $=Z?.headers?C(Z.headers):n;return UY({status:Z?.status??200,statusText:Z?.statusText,headers:$,cookies:Z?.cookies,body:uY(f0(a(Y)),G0(Z,$)??"application/x-www-form-urlencoded")})};var j5=(Y,Z)=>{let $=Z?.headers?C(Z.headers):n;return UY({status:Z?.status??200,statusText:Z?.statusText,headers:$,cookies:Z?.cookies,body:jY(Y,G0(Z,$),Z?.contentLength)})};var w3=O(3,(Y,Z,$)=>UY({...Y,headers:HY(Y.headers,Z,$)})),L8=O(2,(Y,Z)=>UY({...Y,headers:b0(Y.headers,Z)}));var H3=O((Y)=>AY(Y[0]),(Y,Z,$,J)=>L(D7(Y.cookies,Z,$,J).asEffect(),(Q)=>UY({...Y,cookies:Q})));var M8=O(2,(Y,Z)=>UY({...Y,body:Z}));var T8=(Y,Z)=>{let $=new globalThis.Headers(Y.headers);if(!o0(Y.cookies)){let Q=A7(Y.cookies);for(let X of Q)$.append("set-cookie",X)}if(Z?.withoutBody)return new Response(void 0,{status:Y.status,statusText:Y.statusText,headers:$});let J=Y.body;switch(J._tag){case"Empty":return new Response(void 0,{status:Y.status,statusText:Y.statusText,headers:$});case"Uint8Array":case"Raw":{if(J.body instanceof Response){for(let[Q,X]of $)J.body.headers.set(Q,X);return J.body}return new Response(J.body,{status:Y.status,statusText:Y.statusText,headers:$})}case"FormData":return new Response(J.formData,{status:Y.status,statusText:Y.statusText,headers:$});case"Stream":return new Response(wZ(J.stream,Z?.context??GZ()),{status:Y.status,statusText:Y.statusText,headers:$})}};var fX={...x0,[H5]:H5,[RZ]:!0,toJSON(){return{_id:"HttpServerResponse",status:this.status,statusText:this.statusText,headers:fY(this.headers),cookies:this.cookies.toJSON(),body:this.body.toJSON()}}},UY=(Y)=>{let Z=Object.create(fX);if(Z.status=Y.status,Z.statusText=Y.statusText,Z.cookies=Y.cookies??a0,Z.body=Y.body??QZ,Z.body._tag!=="Empty"&&(Z.body.contentType||Z.body.contentLength)){let $=wY({...Y.headers});if(Z.body.contentType)$["content-type"]=Z.body.contentType;if(Z.body.contentLength)$["content-length"]=Z.body.contentLength.toString();Z.headers=$}else Z.headers=Y.headers??n;return Z};var oY="~effect/http/HttpServerRespondable",E8=(Y)=>q(Y,oY),cX=t({status:400}),dX=t({status:404});var I8=(Y,Z)=>{if(AY(Y))return F(Y);else if(E8(Y))return K0(Y[oY](),()=>F(Z));else if(H8(Y))return F(cX);else if(w8(Y))return F(dX);return F(Z)},P8=(Y,Z)=>{if(AY(Y))return F(Y);else if(E8(Y))return K0(Y[oY](),()=>F(Z));return F(Z)};var j8="~effect/http/HttpServerError";class l extends P("HttpServerError"){constructor(Y){if("cause"in Y.reason)super({...Y,cause:Y.reason.cause});else super(Y)}[j8]=j8;stack=`${this.name}: ${this.message}`;get request(){return this.reason.request}get response(){return"response"in this.reason?this.reason.response:void 0}[oY](){return this.reason[oY]()}get[RZ](){return this.reason[RZ]??!1}get message(){return this.reason.message}}class JY extends P("RequestParseError"){[oY](){return F(t({status:400}))}get methodAndUrl(){return`${this.request.method} ${this.request.url}`}get message(){return g8(this._tag,this.description,this.methodAndUrl)}}class v5 extends P("RouteNotFound"){[oY](){return F(t({status:404}))}[RZ]=!0;get methodAndUrl(){return`${this.request.method} ${this.request.url}`}get message(){return g8(this._tag,this.description,this.methodAndUrl)}}class _1 extends S()("effect/http/HttpServerError/ClientAbort"){static annotation=this.context(!0).pipe(gZ(S8,{name:"ClientAbort",stack:v8,parent:void 0}))}var g8=(Y,Z,$)=>{let J=`${Y} (${$})`;return Z?`${J}: ${Z}`:J},R5=(Y)=>{let Z,$=lX,J=[],Q=[],X=!1;for(let G=0;G<Y.reasons.length;G++){let K=Y.reasons[G];switch(K._tag){case"Fail":{$=I8(K.error,z1),J.push(K);break}case"Die":{if(AY(K.defect))Z=K.defect;else $=P8(K.defect,z1),J.push(K);break}case"Interrupt":{if(X=K.annotations.has(_1.key),J.length>0)break;Q.push(K);break}}}if(Z)return F([Z,V1(J)]);else if(Q.length>0&&J.length===0)J.push(...Q),$=X?iX:pX;return V0($,(G)=>{return J.push(R8(G)),[G,V1(J)]})},S5=(Y)=>{let Z,$=Y.reasons.filter((J)=>{if(J._tag==="Die"&&AY(J.defect))return Z=J.defect,!1;return!0});return[Z??z1,$.length>0?b(V1($)):H()]},z1=t({status:500}),lX=F(z1),iX=F(t({status:499})),pX=F(t({status:503})),C8=(Y)=>{if(Y._tag==="Success")return Y.value;return S5(Y.cause)[0]};var A0={};kY(A0,{upgradeChannel:()=>E4,toWebResult:()=>u5,toWeb:()=>u4,toURL:()=>W0,toClientRequest:()=>q4,searchParamsFromURL:()=>m$,schemaSearchParams:()=>j4,schemaHeaders:()=>P4,schemaCookies:()=>I4,schemaBodyUrlParams:()=>S4,schemaBodyMultipart:()=>g4,schemaBodyJson:()=>v4,schemaBodyFormJson:()=>C4,schemaBodyForm:()=>R4,fromWeb:()=>f5,fromClientRequest:()=>b4,TypeId:()=>OZ,ParsedSearchParams:()=>xY,MaxBodySize:()=>rZ,HttpServerRequest:()=>M});var B1="~effect/socket/Socket/SocketError",rX=(Y)=>q(Y,B1);class s8 extends tY("effect/socket/Socket/SocketReadError")({_tag:mY("SocketReadError"),cause:AZ}){message="An error occurred during Read"}class t8 extends tY("effect/socket/Socket/SocketWriteError")({_tag:mY("SocketWriteError"),cause:AZ}){message="An error occurred during Write"}class e8 extends tY("effect/socket/Socket/SocketOpenError")({_tag:mY("SocketOpenError"),kind:I0(["Unknown","Timeout"]),cause:AZ}){get message(){return this.kind==="Timeout"?'timeout waiting for "open"':"An error occurred during Open"}}class Y$ extends tY("effect/socket/Socket/SocketCloseError")({_tag:mY("SocketCloseError"),code:o8,closeReason:E0(IY)}){static filterClean(Y){return function(Z){return Z$.is(Z)&&Z.reason._tag==="SocketCloseError"&&Y(Z.reason.code)?PY(Z.reason):h(Z)}}get message(){if(this.closeReason)return`${this.code}: ${this.closeReason}`;return`${this.code}`}}var sX=k0([s8,t8,e8,Y$]);class Z$ extends r8(B1)("SocketError",{_tag:mY("SocketError"),reason:sX}){constructor(Y){if("cause"in Y.reason)super({...Y,cause:Y.reason.cause});else super(Y)}[B1]=B1;static is(Y){return rX(Y)}message=this.reason.message}var tX=(Y,Z)=>D1(_0(function*($,J){let Q=yield*u8(),X=yield*y8(J),G=yield*x8(Y.writer,X),K,z=0,_=h8({while:()=>z<K.length,body:()=>G(K[z++]),step:b8});return yield*$.pipe(U((B)=>{if(B.length===1)return G(B[0]);return K=B,z=0,_}),d8({disableYield:!0}),f8(m8,(B)=>i8(Q,B)),c8(z0(X,O1)),g5(J)),yield*Y.runRaw((B)=>{l8(Q,Z(B))}).pipe(n8(Q),g5(J)),p8(Q)})),eX=(Y)=>{let Z=new TextEncoder;return tX(Y,($)=>typeof $==="string"?Z.encode($):$)};var $$=()=>(Y)=>eX(Y);var J$=/; *([!#$%&'*+.^\w`|~-]+)=("(?:[\v\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\v\u0020-\u00ff])*"|[!#$%&'*+.^\w`|~-]+) */gu,Q$=/\\([\v\u0020-\u00ff])/gu,Z4=/^[!#$%&'*+.^\w|~-]+\/[!#$%&'*+.^\w|~-]+$/u,$4=/^[!#$%&'*+.^\w|~-]+$/u,W1={value:"",parameters:Object.create(null)};function A1(Y,Z=!1){if(typeof Y!=="string")return W1;let $=Y.indexOf(";"),J=$!==-1?Y.slice(0,$).trim():Y.trim();if((Z?$4:Z4).test(J)===!1)return W1;let X={value:J.toLowerCase(),parameters:Object.create(null)};if($===-1)return X;let G,K,z;J$.lastIndex=$;while(K=J$.exec(Y)){if(K.index!==$)return W1;if($+=K[0].length,G=K[1].toLowerCase(),z=K[2],z[0]==='"')z=z.slice(1,z.length-1),!Z&&Q$.test(z)&&(z=z.replace(Q$,"$1"));X.parameters[G]=z}if($!==Y.length)return W1;return X}var QY;(function(Y){Y[Y.key=0]="key",Y[Y.whitespace=1]="whitespace",Y[Y.value=2]="value"})(QY||(QY={}));var B0={_tag:"Continue"},Q4=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1],X4=[0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];function X$(){let Y=new TextDecoder,Z={state:QY.key,headers:Object.create(null),key:"",value:void 0,crlf:0,previousChunk:void 0,pairs:0,size:0};function $(X){return Z.state=QY.key,Z.headers=Object.create(null),Z.key="",Z.value=void 0,Z.crlf=0,Z.previousChunk=void 0,Z.pairs=0,Z.size=0,X}function J(X,G){let K=new Uint8Array(X.length+G.length);return K.set(X),K.set(G,X.length),K}function Q(X){return $({_tag:"Failure",reason:X,headers:Z.headers})}return function(G,K){let z=0,_;if(Z.previousChunk!==void 0){z=Z.previousChunk.length,_=z;let V=new Uint8Array(G.length+z);V.set(Z.previousChunk),V.set(G,z),Z.previousChunk=void 0,G=V}let B=G.length;Y:while(K<B){if(Z.state===QY.key){let V=K;for(;V<B;V++){if(Z.size++>16384)return Q("HeaderTooLarge");if(G[V]===58){if(Z.key+=Y.decode(G.subarray(K,V)).toLowerCase(),Z.key.length===0)return Q("InvalidHeaderName");if(G[V+1]===32&&G[V+2]!==32&&G[V+2]!==9)K=V+2,Z.state=QY.value,Z.size++;else if(G[V+1]!==32&&G[V+1]!==9)K=V+1,Z.state=QY.value;else K=V+1,Z.state=QY.whitespace;break}else if(Q4[G[V]]!==1)return Q("InvalidHeaderName")}if(V===B)return Z.key+=Y.decode(G.subarray(K,B)).toLowerCase(),B0}if(Z.state===QY.whitespace){for(;K<B;K++){if(Z.size++>16384)return Q("HeaderTooLarge");if(G[K]!==32&&G[K]!==9){Z.state=QY.value;break}}if(K===B)return B0}if(Z.state===QY.value){let V=K;if(_!==void 0)V=_,_=void 0;for(;V<B;V++){if(Z.size++>16384)return Q("HeaderTooLarge");if(G[V]===13||Z.crlf>0){let D=G[V];if(D===13&&Z.crlf===0)Z.crlf=1,V++,Z.size++,D=G[V];if(D===10&&Z.crlf===1)Z.crlf=2,V++,Z.size++,D=G[V];if(D===13&&Z.crlf===2)Z.crlf=3,V++,Z.size++,D=G[V];if(D===10&&Z.crlf===3)Z.crlf=4,V++,Z.size++;if(Z.crlf<4&&V>=B)return Z.previousChunk=G.subarray(K),B0;else if(Z.crlf>=2){Z.value=Z.value===void 0?G.subarray(K,V-Z.crlf):J(Z.value,G.subarray(K,V-Z.crlf));let A=Y.decode(Z.value);if(Z.headers[Z.key]===void 0)Z.headers[Z.key]=A;else if(typeof Z.headers[Z.key]==="string")Z.headers[Z.key]=[Z.headers[Z.key],A];else Z.headers[Z.key].push(A);if(K=V,Z.size--,Z.crlf!==4&&Z.pairs===100)return Q("TooManyHeaders");else if(Z.crlf===3)return Q("InvalidHeaderValue");else if(Z.crlf===4)return $({_tag:"Headers",headers:Z.headers,endPosition:K-z});Z.pairs++,Z.key="",Z.value=void 0,Z.crlf=0,Z.state=QY.key;continue Y}}else if(X4[G[V]]!==1)return Q("InvalidHeaderValue")}if(V===B)return Z.value=Z.value===void 0?G.subarray(K,B):J(Z.value,G.subarray(K,B)),B0}}if(K>B)Z.size+=B-K;return B0}}function K4(Y){let Z=new TextEncoder().encode(Y),$=Z.length,J={};for(let Q=0;Q<$;Q++){let X=Z[Q];if(J[X]===void 0)J[X]=[];J[X].push(Q)}return{needle:Z,needleLength:$,indexes:J,firstByte:Z[0],previousChunk:void 0,previousChunkLength:0,matchIndex:0}}function G$(Y,Z,$){let J=K4(Y);if($!==void 0)J.previousChunk=$,J.previousChunkLength=$.length;function Q(){if("Buffer"in globalThis&&!(("Bun"in globalThis)||("Deno"in globalThis)))return function(_,B,V){return Buffer.prototype.indexOf.call(_,B,V)};let z=new Uint8Array(256).fill(J.needle.length);for(let _=0,B=J.needle.length-1;_<B;++_)z[J.needle[_]]=B-_;return function(_,B,V){let D=_.length,A=V+J.needleLength-1;while(A<D){for(let W=J.needleLength-1,N=A;W>=0&&_[N]===B[W];W--,N--)if(W===0)return N;A+=z[_[A]]}return-1}}let X=Q();function G(z){let _=z.length;if(J.previousChunk!==void 0){let V=new Uint8Array(J.previousChunkLength+_);V.set(J.previousChunk),V.set(z,J.previousChunkLength),z=V,_=J.previousChunkLength+_,J.previousChunk=void 0}if(_<J.needleLength){J.previousChunk=z,J.previousChunkLength=_;return}let B=0;while(B<_){let V=X(z,J.needle,B);if(V>-1){if(V>B)Z(J.matchIndex,z.subarray(B,V));J.matchIndex+=1,B=V+J.needleLength;continue}else if(z[_-1]in J.indexes){let D=J.indexes[z[_-1]],A=-1;for(let W=0,N=D.length;W<N;W++){let T=D[W];if(z[_-1-T]===J.firstByte&&W>A)A=T}if(A===-1)if(B===0)Z(J.matchIndex,z);else Z(J.matchIndex,z.subarray(B));else{if(_-1-A>B)Z(J.matchIndex,z.subarray(B,_-1-A));J.previousChunk=z.subarray(_-1-A),J.previousChunkLength=A+1}}else if(B===0)Z(J.matchIndex,z);else Z(J.matchIndex,z.subarray(B));break}}function K(){if(J.previousChunk!==void 0&&J.previousChunk!==$)Z(J.matchIndex,J.previousChunk);J.previousChunk=$,J.previousChunkLength=$?.length??0,J.matchIndex=0}return{write:G,end:K}}var CY;(function(Y){Y[Y.headers=0]="headers",Y[Y.body=1]="body"})(CY||(CY={}));var z4={_tag:"InvalidDisposition"},_4={_tag:"EndNotReached"},B4={_tag:"ReachedLimit",limit:"MaxParts"},O4={_tag:"ReachedLimit",limit:"MaxTotalSize"},D4={_tag:"ReachedLimit",limit:"MaxPartSize"},K$={_tag:"ReachedLimit",limit:"MaxFieldSize"},W4=new TextEncoder().encode(`\r
|
|
3
3
|
`);function b5(Y){return Y.filename!==void 0||Y.contentType==="application/octet-stream"}function A4(Y){return A1(Y["content-type"]).parameters.boundary}function U1(Y){}function z$({headers:Y,onFile:Z,onField:$,onError:J,onDone:Q,isFile:X=b5,maxParts:G=1/0,maxTotalSize:K=1/0,maxPartSize:z=1/0,maxFieldSize:_=1048576}){let B=A4(Y);if(B===void 0)return J({_tag:"InvalidBoundary"}),{write:U1,end(){}};let V={state:CY.headers,index:0,parts:0,onChunk:U1,info:void 0,headerSkip:0,partSize:0,totalSize:0,isFile:!1,fieldChunks:[],fieldSize:0};function D(){V.state=CY.body,V.isFile=!0,V.onChunk=U1}let A=X$(),W=G$(`\r
|
|
4
|
-
--${B}`,function(N,T){if(N===0){D();return}else if(N!==V.index){if(V.index>0)if(V.isFile)V.onChunk(null),V.partSize=0;else{if(V.fieldChunks.length===1)$(V.info,V.fieldChunks[0]);else{let E=new Uint8Array(V.fieldSize),YY=0;for(let I=0;I<V.fieldChunks.length;I++){let p=V.fieldChunks[I];E.set(p,YY),YY+=p.length}$(V.info,E)}V.fieldSize=0,V.fieldChunks=[]}if(V.state=CY.headers,V.index=N,V.headerSkip=2,T[0]===45&&T[1]===45)return Q();if(V.parts++,V.parts>G)J(B4)}if((V.partSize+=T.length)>z)J(D4);if(V.state===CY.headers){let E=A(T,V.headerSkip);if(V.headerSkip=0,E._tag==="Continue")return;else if(E._tag==="Failure")return D(),J({_tag:"BadHeaders",error:E});let YY=A1(E.headers["content-type"]),I=A1(E.headers["content-disposition"],!0);if(I.value==="form-data"&&!("name"in I.parameters))return D(),J(z4);let p;if("filename*"in I.parameters){let w=I.parameters["filename*"].split("''");if(w.length===2)p=decodeURIComponent(w[1])}if(V.info={name:I.parameters.name??"",filename:p??I.parameters.filename,contentType:YY.value===""?I.parameters.filename!==void 0?"application/octet-stream":"text/plain":YY.value,contentTypeParameters:YY.parameters,contentDisposition:I.value,contentDispositionParameters:I.parameters,headers:E.headers},V.state=CY.body,V.isFile=X(V.info),V.isFile)V.onChunk=Z(V.info);if(E.endPosition<T.length)if(V.isFile)V.onChunk(T.subarray(E.endPosition));else{let w=T.subarray(E.endPosition);if((V.fieldSize+=w.length)>_)J(K$);V.fieldChunks.push(w)}}else if(V.isFile)V.onChunk(T);else{if((V.fieldSize+=T.length)>_)J(K$);V.fieldChunks.push(T)}},W4);return{write(N){if((V.totalSize+=N.length)>K)return J(O4);return W.write(N)},end(){if(W.end(),V.state===CY.body)J(_4);V.state=CY.headers,V.index=0,V.parts=0,V.onChunk=U1,V.info=void 0,V.totalSize=0,V.partSize=0,V.fieldChunks=[],V.fieldSize=0}}}var V$=new TextDecoder("utf-8");function U4(Y){if(Y==="utf-8"||Y==="utf8"||Y==="")return V$;try{return new TextDecoder(Y)}catch(Z){return V$}}function _$(Y,Z){return U4(Y.contentTypeParameters.charset??"utf-8").decode(Z)}var B$=z$,O$=b5,D$=_$;var NY="~effect/http/Multipart";var W$="~effect/http/Multipart/MultipartError";class j$ extends n0{}class k extends P("MultipartError"){static fromReason(Y,Z){return new k({reason:new j$({_tag:Y,cause:Z})})}[W$]=W$;get message(){return this.reason._tag}}var y5=(Y)=>f(Y),v$=(Y,Z)=>{let $=w$(Y);return O(2,(J,Q)=>L(f(T$({[Q]:$}))(J,Z),(X)=>X[Q]))},L4=(Y)=>u((Z)=>{let $=y(Z.context,x$);return F({headers:Y,maxParts:Z.getRef(C$),maxFieldSize:Number(Z.getRef(b$)),maxPartSize:D0(Z.getRef(q$),Number),maxTotalSize:D0(Z.getRef(rZ),Number),isFile:$.length===0?void 0:(J)=>!$.some((Q)=>J.contentType.includes(Q))&&O$(J)})}),k5=(Y)=>D1((Z)=>L(L4(Y),($)=>{let J=[],Q=H(),X=B$({...$,onField(K,z){J.push(new R$(K.name,K.contentType,D$(K,z)))},onFile(K){let z=[],_=!1,B=L$(F(_Z(function V(){if(!q5(z))return _?U$():U(G,V);let D=z;return z=[],F(D)})));return J.push(new S$(K,B)),function(V){if(V===null)_=!0;else z.push(V)}},onError(K){Q=b(x5(M4(K)))},onDone(){Q=b(x5(A$()))}}),G=Z.pipe(U((K)=>{for(let z=0;z<K.length;z++)X.write(K[z]);return e}),K0((K)=>{if(N$(K))X.end();else Q=b(F$(K));return e}));return G.pipe(U(function K(){if(!q5(J)){if(r(Q))return Q.value;return U(G,K)}let z=J;return J=[],F(z)}))}));function M4(Y){switch(Y._tag){case"ReachedLimit":switch(Y.limit){case"MaxParts":return k.fromReason("TooManyParts",Y);case"MaxFieldSize":return k.fromReason("FieldTooLarge",Y);case"MaxPartSize":return k.fromReason("FileTooLarge",Y);case"MaxTotalSize":return k.fromReason("BodyTooLarge",Y)}default:return k.fromReason("Parse",Y)}}class F1 extends RY{[NY];constructor(){super();this[NY]=NY}}class R$ extends F1{_tag="Field";key;contentType;value;constructor(Y,Z,$){super();this.key=Y,this.contentType=Z,this.value=$}toJSON(){return{_id:"@effect/platform/Multipart/Part",_tag:"Field",key:this.key,contentType:this.contentType,value:this.value}}}class S$ extends F1{_tag="File";key;name;contentType;content;contentEffect;constructor(Y,Z){super();this.key=Y.name,this.name=Y.filename??Y.name,this.contentType=Y.contentType,this.content=H$(Z),this.contentEffect=Z.pipe(w4,JZ(($)=>k.fromReason("InternalError",$)))}toJSON(){return{_id:"@effect/platform/Multipart/Part",_tag:"File",key:this.key,name:this.name,contentType:this.contentType}}}var T4=(Y,Z)=>U(dY.asEffect(),($)=>JZ(E$(Z.content,$.sink(Y)),(J)=>k.fromReason("InternalError",J))),w4=(Y)=>M$(Y,DY(new Uint8Array(0)),(Z,$)=>{let J=$.reduce((G,K)=>G+K.length,Z.length),Q=new Uint8Array(J);Q.set(Z,0);let X=Z.length;for(let G of $)Q.set(G,X),X+=G.length;return Q}),m5=(Y,Z=T4)=>i(function*(){let $=yield*dY,J=yield*P$,Q=yield*$.makeTempDirectoryScoped(),X=Object.create(null);return yield*I$(Y,(G)=>{if(G._tag==="Field"){if(!(G.key in X))X[G.key]=G.value;else if(typeof X[G.key]==="string")X[G.key]=[X[G.key],G.value];else X[G.key].push(G.value);return e}else if(G.name==="")return e;let K=G,z=J.join(Q,J.basename(K.name).slice(-128)),_=new g$(K.key,K.name,K.contentType,z);if(Array.isArray(X[G.key]))X[G.key].push(_);else X[G.key]=[_];return Z(z,K)}),X}).pipe(X1("PlatformError",($)=>g(k.fromReason("InternalError",$))));class g$ extends F1{_tag="PersistedFile";key;name;contentType;path;constructor(Y,Z,$,J){super();this.key=Y,this.name=Z,this.contentType=$,this.path=J}toJSON(){return{_id:"@effect/platform/Multipart/Part",_tag:"PersistedFile",key:this.key,name:this.name,contentType:this.contentType,path:this.path}}}var c3=(Y)=>{let Z=new Map;if(Y.maxParts!==void 0)Z.set(C$.key,Y.maxParts);if(Y.maxFieldSize!==void 0)Z.set(b$.key,O0(Y.maxFieldSize));if(Y.maxFileSize!==void 0)Z.set(q$.key,D0(Y.maxFileSize,O0));if(Y.maxTotalSize!==void 0)Z.set(rZ.key,D0(Y.maxTotalSize,O0));if(Y.fieldMimeTypes!==void 0)Z.set(x$.key,Y.fieldMimeTypes);return bY(Z)},C$=j("effect/http/Multipart/MaxParts",{defaultValue:()=>{return}}),b$=j("effect/http/Multipart/MaxFieldSize",{defaultValue:DY(O0(10485760))}),q$=j("effect/http/Multipart/MaxFileSize",{defaultValue:()=>{return}}),x$=j("effect/http/Multipart/FieldMimeTypes",{defaultValue:DY(["application/json"])});var OZ="~effect/http/HttpServerRequest",M=S("effect/http/HttpServerRequest");class xY extends S()("effect/http/ParsedSearchParams"){}var m$=(Y)=>{let Z={};for(let[$,J]of Y.searchParams.entries()){let Q=Z[$];if(Q!==void 0)if(Array.isArray(Q))Q.push(J);else Z[$]=[Q,J];else Z[$]=J}return Z},E4=()=>M.asEffect().pipe(U((Y)=>Y.upgrade),L($$()),C5),I4=(Y,Z)=>{let $=f(Y);return U(M.asEffect(),(J)=>$(J.cookies,Z))},P4=(Y,Z)=>{let $=f(Y);return U(M.asEffect(),(J)=>$(J.headers,Z))},j4=(Y,Z)=>{let $=f(Y);return U(xY.asEffect(),(J)=>$(J,Z))},v4=(Y,Z)=>{let $=s0(Y,Z);return U(M.asEffect(),$)},h$=(Y)=>Y.headers["content-type"]?.toLowerCase().includes("multipart/form-data")===!0||k4(Y)!==void 0,R4=(Y,Z)=>{let $=y5(Y),J=oZ(Y,Z);return U(M.asEffect(),(Q)=>{if(h$(Q))return U(Q.multipart,(X)=>$(X,Z));return J(Q)})},S4=(Y,Z)=>{let $=oZ(Y,Z);return U(M.asEffect(),$)},g4=(Y,Z)=>{let $=y5(Y);return M.asEffect().pipe(U((J)=>J.multipart),U((J)=>$(J,Z)))},C4=(Y,Z)=>{let $=v$(Y,Z);return(J)=>{let Q=b6(J).pipe(cY(Y),iY);return U(M.asEffect(),(X)=>{if(h$(X))return U(JZ(X.multipart,(G)=>new l({reason:new JY({request:X,cause:G})})),$(J));return U(X.urlParamsBody,(G)=>Q(G,Z))})}},b4=(Y)=>{let Z=BY(o1(Y),{onNone:()=>Y.url,onSome:($)=>$.toString()});return new d5(Y,Z)},f5=(Y)=>new c5(Y,f$(Y.url)),q4=(Y)=>EZ(R(Y.method,"",m0,H(),Y.headers,x4(Y)),L1(W0(Y),()=>Y.url)),x4=(Y)=>TZ(Y.method)?jY(Y.stream,Y.headers["content-type"],y4(Y.headers["content-length"])):QZ,y4=(Y)=>{if(Y===void 0)return;let Z=Number.parseInt(Y,10);return Number.isNaN(Z)?void 0:Z},f$=(Y)=>{if(Y[0]==="/")return Y;let Z=Y.indexOf("/",Y.indexOf("//")+2);return Z===-1?"/":Y.slice(Z)};class c5 extends RY{[OZ];[c];source;url;headersOverride;remoteAddressOverride;constructor(Y,Z,$,J){super();this[OZ]=OZ,this[c]=c,this.source=Y,this.url=Z,this.headersOverride=$,this.remoteAddressOverride=J}toJSON(){return sZ(this,{_id:"HttpServerRequest",method:this.method,url:this.originalUrl})}modify(Y){return new c5(this.source,Y.url??this.url,Y.headers??this.headersOverride,"remoteAddress"in Y?Y.remoteAddress:this.remoteAddressOverride)}get method(){return this.source.method.toUpperCase()}get originalUrl(){return this.source.url}get remoteAddress(){return this.remoteAddressOverride??H()}get headers(){return this.headersOverride??=C(this.source.headers),this.headersOverride}cachedCookies;get cookies(){if(this.cachedCookies)return this.cachedCookies;return this.cachedCookies=Z5(this.headers.cookie??"")}get stream(){return this.source.body?SY({evaluate:()=>this.source.body,onError:(Y)=>new l({reason:new JY({request:this,cause:Y})})}):tZ(new l({reason:new JY({request:this,description:"can not create stream from empty body"})}))}textEffect;get text(){if(this.textEffect)return this.textEffect;return this.textEffect=o(OY(d({try:()=>this.source.text(),catch:(Y)=>new l({reason:new JY({request:this,cause:Y})})}))),this.textEffect}get json(){return U(this.text,(Y)=>GY({try:()=>JSON.parse(Y),catch:(Z)=>new l({reason:new JY({request:this,cause:Z})})}))}get urlParamsBody(){return U(this.text,(Y)=>GY({try:()=>a(new URLSearchParams(Y)),catch:(Z)=>new l({reason:new JY({request:this,cause:Z})})}))}multipartEffect;get multipart(){if(this.multipartEffect)return this.multipartEffect;return this.multipartEffect=o(OY(m5(this.multipartStream))),this.multipartEffect}get multipartStream(){return h5(X0(this.stream,(Y)=>k.fromReason("InternalError",Y)),k5(this.headers))}arrayBufferEffect;get arrayBuffer(){if(this.arrayBufferEffect)return this.arrayBufferEffect;return this.arrayBufferEffect=o(OY(d({try:()=>this.source.arrayBuffer(),catch:(Y)=>new l({reason:new JY({request:this,cause:Y})})}))),this.arrayBufferEffect}get upgrade(){return g(new l({reason:new JY({request:this,description:"Not an upgradeable ServerRequest"})}))}}class d5 extends RY{[OZ];[c];source;originalUrl;headersOverride;remoteAddressOverride;urlOverride;constructor(Y,Z,$,J,Q){super();this[OZ]=OZ,this[c]=c,this.source=Y,this.originalUrl=Z,this.urlOverride=$,this.headersOverride=J,this.remoteAddressOverride=Q}toJSON(){return sZ(this,{_id:"HttpServerRequest",method:this.method,url:this.originalUrl})}modify(Y){return new d5(this.source,this.originalUrl,Y.url??this.url,Y.headers??this.headersOverride,"remoteAddress"in Y?Y.remoteAddress:this.remoteAddressOverride)}get method(){return this.source.method}get url(){return this.urlOverride??f$(this.originalUrl)}get remoteAddress(){return this.remoteAddressOverride??H()}get headers(){return this.headersOverride??=this.source.headers}cachedCookies;get cookies(){if(this.cachedCookies)return this.cachedCookies;return this.cachedCookies=Z5(this.headers.cookie??"")}get stream(){let Y=this.source.body;switch(Y._tag){case"Empty":return K1;case"Uint8Array":return I5(Y.body);case"Stream":return X0(Y.stream,(Z)=>qY(this,void 0,Z));case"FormData":return N1(this,new Response(Y.formData).body);case"Raw":return m4(this,Y.body)}}bytesEffect;get bytes(){if(this.bytesEffect)return this.bytesEffect;let Y=this.source.body,Z;switch(Y._tag){case"Empty":{Z=F(new Uint8Array(0));break}case"Uint8Array":{Z=F(Y.body);break}case"FormData":{Z=c$(this,Y.formData);break}case"Stream":{Z=P5(this.stream);break}case"Raw":{Z=h4(this,Y.body);break}}return this.bytesEffect=o(OY(Z)),this.bytesEffect}get text(){return L(this.bytes,(Y)=>d4.decode(Y))}get json(){return U(this.text,(Y)=>GY({try:()=>Y===""?null:JSON.parse(Y),catch:(Z)=>qY(this,void 0,Z)}))}get urlParamsBody(){return U(this.text,(Y)=>GY({try:()=>a(new URLSearchParams(Y)),catch:(Z)=>qY(this,void 0,Z)}))}multipartEffect;get multipart(){if(this.multipartEffect)return this.multipartEffect;return this.multipartEffect=o(OY(m5(this.multipartStream))),this.multipartEffect}get multipartStream(){let Y=this.source.body._tag==="FormData"&&this.source.body.formData;if(Y)return k$(f4(Y));return h5(X0(this.stream,(Z)=>k.fromReason("InternalError",Z)),k5(this.headers))}get arrayBuffer(){return L(this.bytes,(Y)=>Y.slice().buffer)}get upgrade(){return g(qY(this,"Not an upgradeable ServerRequest"))}}var k4=(Y)=>{if(!KZ(Y.source))return;let Z=Y.source.body;if(Z._tag==="FormData")return Z.formData;if(Z._tag==="Raw"&&l$(Z.body))return Z.body;return},m4=(Y,Z)=>{if(Z instanceof Request)return N1(Y,Z.body);if(l$(Z))return N1(Y,new Response(Z).body);if(c4(Z))return N1(Y,Z);return tZ(qY(Y,"Unsupported body type"))},h4=(Y,Z)=>{if(Z instanceof Blob)return c$(Y,Z);if(Z instanceof Request)return d({try:()=>Z.arrayBuffer().then(($)=>new Uint8Array($)),catch:($)=>qY(Y,void 0,$)});return g(qY(Y,"Unsupported body type"))},c$=(Y,Z)=>d({try:()=>new Response(Z).arrayBuffer().then(($)=>new Uint8Array($)),catch:($)=>qY(Y,void 0,$)}),N1=(Y,Z)=>Z?SY({evaluate:()=>Z,onError:($)=>qY(Y,void 0,$)}):K1,qY=(Y,Z,$)=>new l({reason:new JY({request:Y,...Z===void 0?void 0:{description:Z},...$===void 0?void 0:{cause:$}})}),f4=(Y)=>{let Z=[];for(let[$,J]of Y.entries())Z.push(typeof J==="string"?new d$($,J):new u$($,J));return Z};class d$ extends RY{[NY];_tag="Field";contentType="text/plain";key;value;constructor(Y,Z){super();this[NY]=NY,this.key=Y,this.value=Z}toJSON(){return{_id:"@effect/platform/Multipart/Part",_tag:"Field",key:this.key,contentType:this.contentType,value:this.value}}}class u$ extends RY{[NY];_tag="File";key;name;contentType;content;contentEffect;constructor(Y,Z){super();this[NY]=NY,this.key=Y,this.name=Z.name,this.contentType=Z.type,this.content=SY({evaluate:()=>Z.stream(),onError:($)=>k.fromReason("InternalError",$)}),this.contentEffect=d({try:()=>Z.arrayBuffer().then(($)=>new Uint8Array($)),catch:($)=>k.fromReason("InternalError",$)})}toJSON(){return{_id:"@effect/platform/Multipart/Part",_tag:"File",key:this.key,name:this.name,contentType:this.contentType}}}var c4=(Y)=>typeof ReadableStream<"u"&&Y instanceof ReadableStream,l$=(Y)=>typeof FormData<"u"&&Y instanceof FormData,d4=new TextDecoder,W0=(Y)=>{let Z=Y.headers.host??"localhost",$=Y.headers["x-forwarded-proto"]==="https"?"https":"http";try{return b(new URL(Y.url,`${$}://${Z}`))}catch{return H()}},u5=(Y,Z)=>{if(Y.source instanceof Request)return PY(Y.source);let $=W0(Y);if(y$($))return h(new JY({request:Y,description:"Invalid URL"}));let J={method:Y.method,headers:Y.headers};if(Z?.signal)J.signal=Z.signal;if(TZ(Y.method))J.body=wZ(Y.stream,Z?.context??GZ()),J.duplex="half";return PY(new Request($.value,J))},u4=(Y,Z)=>ZY(($)=>u5(Y,{context:$,signal:Z?.signal}).asEffect());var U0=new WeakMap,M1=(Y,Z)=>{let $=U0.get(Y.source),J=$?(Q,X)=>U($(Q,X),(G)=>Z(Q,G)):Z;U0.set(Y.source,J)};var o$=(Y)=>Y,r$=new WeakSet,l4=(Y)=>{let Z=Y.indexOf("?"),$=Y.indexOf("#");if(Z===-1)return $===-1?Y:Y.slice(0,$);if($===-1)return Y.slice(0,Z);return Y.slice(0,Math.min(Z,$))},s$=(Y)=>u((Z)=>{let $=zY(Z.context,M);return r$.add($.source),Y}),i4=j("effect/http/HttpMiddleware/TracerDisabledWhen",{defaultValue:()=>$1});var p4=j("@effect/platform/HttpMiddleware/SpanNameGenerator",{defaultValue:()=>(Y)=>`http.server ${Y.method}`}),N0=o$((Y)=>{let Z=0;return u(($)=>{let J=zY($.context,M),Q=l4(J.url);return a$(U(n$(Y),(X)=>{if(r$.has(J.source))return X;else if(X._tag==="Failure"){let[G,K]=S5(X.cause);return $0(l5(F0(L1(K,()=>"Sent HTTP Response")),{"http.method":J.method,"http.url":Q,"http.status":G.status}),X)}return $0(l5(F0("Sent HTTP response"),{"http.method":J.method,"http.url":Q,"http.status":X.value.status}),X)}),`http.span.${++Z}`)})}),i5=o$((Y)=>u((Z)=>{let $=zY(Z.context,M);if(!Z.getRef(p$)||Z.getRef(i4)($))return Y;let Q=Z.getRef(p4),X=i$(Z,Q($),{parent:XZ(w7($.headers)),kind:"server"}),G=Z.context;return Z.setContext(gZ(Z.context,T1,X)),w1(Y,(K)=>{Z.setContext(G);let z=Z.getRef(J1).currentTimeNanosUnsafe();Z.currentDispatcher.scheduleTask(()=>{let _=W0($);if(r(_)&&(_.value.username!==""||_.value.password!==""))_.value.username="REDACTED",_.value.password="REDACTED";let B=Z.getRef(cZ),V=YZ($.headers,B);if(X.attribute("http.request.method",$.method),r(_)){if(X.attribute("url.full",_.value.toString()),X.attribute("url.path",_.value.pathname),_.value.search.slice(1)!=="")X.attribute("url.query",_.value.search.slice(1));X.attribute("url.scheme",_.value.protocol.slice(0,-1))}if($.headers["user-agent"]!==void 0)X.attribute("user_agent.original",$.headers["user-agent"]);for(let W in V)X.attribute(`http.request.header.${W}`,String(V[W]));if(r($.remoteAddress))X.attribute("client.address",$.remoteAddress.value);let D=C8(K);X.attribute("http.response.status_code",D.status);let A=YZ(D.headers,B);for(let W in A)X.attribute(`http.response.header.${W}`,String(A[W]));X.end(z,K)},0);return},!0)}));var t$=(Y)=>{let Z={allowedOrigins:Y?.allowedOrigins??[],allowedMethods:Y?.allowedMethods??["GET","HEAD","PUT","PATCH","POST","DELETE"],allowedHeaders:Y?.allowedHeaders??[],exposedHeaders:Y?.exposedHeaders??[],credentials:Y?.credentials??!1,maxAge:Y?.maxAge},$=typeof Z.allowedOrigins==="function"?Z.allowedOrigins:(D)=>Z.allowedOrigins.includes(D),J=typeof Z.allowedOrigins==="function"||Z.allowedOrigins.length>1?(D)=>{if(!$(D))return;return{"access-control-allow-origin":D,vary:"Origin"}}:Z.allowedOrigins.length===0?DY({"access-control-allow-origin":"*"}):DY({"access-control-allow-origin":Z.allowedOrigins[0],vary:"Origin"}),Q=Z.allowedMethods.length>0?{"access-control-allow-methods":Z.allowedMethods.join(", ")}:void 0,X=Z.credentials?{"access-control-allow-credentials":"true"}:void 0,G=(D)=>{if(Z.allowedHeaders.length===0&&D)return{vary:"Access-Control-Request-Headers","access-control-allow-headers":D};if(Z.allowedHeaders)return{"access-control-allow-headers":Z.allowedHeaders.join(",")};return},K=Z.exposedHeaders.length>0?{"access-control-expose-headers":Z.exposedHeaders.join(",")}:void 0,z=Z.maxAge?{"access-control-max-age":Z.maxAge.toString()}:void 0,_=(D)=>{let A=D.headers.origin;return wY({...J(A),...X,...K})},B=(D)=>{let A=D.headers.origin,W=D.headers["access-control-request-headers"];return wY({...J(A),...X,...K,...Q,...G(W),...z})},V=(D,A)=>F(L8(A,_(D)));return(D)=>u((A)=>{let W=zY(A.context,M);if(W.method==="OPTIONS")return F(t({status:204,headers:B(W)}));return M1(W,V),D})};var a4=(Y,Z,$)=>{let Q=jZ(Y,{onSuccess:(G)=>{let K=nY(),z=zY(K.context,M),_=U0.get(z.source);if(_===void 0)return z[CZ]=!0,V0(Z(z,G),()=>G);return bZ(_(z,G),(B)=>{return z[CZ]=!0,V0(Z(z,B),()=>G)})},onFailure:(G)=>bZ(R5(G),([K,z])=>{let _=nY();p5(_,z);let B=zY(_.context,M),V=U0.get(B.source),D=z.reasons.length===0?F(K):eZ(z);if(V===void 0)return B[CZ]=!0,bZ(Z(B,K),()=>D);return bZ(bZ(V(B,K),(A)=>{return B[CZ]=!0,Z(B,A)}),()=>D)})}),X=$===void 0?i5(Q):jZ(i5($(Q)),{onFailure(G){let K=nY();p5(K,G);let z=zY(K.context,M);if(CZ in z)return e;return $J(R5(G),{onFailure(_){return Z(z,t({status:500}))},onSuccess([_]){return Z(z,_)}})},onSuccess(G){let K=nY(),z=zY(K.context,M);return CZ in z?e:Z(z,G)}});return JJ(s4(X))},CZ=Symbol.for("effect/http/HttpEffect/handled"),o4=(Y)=>{Y[GJ]=!0},r4=(Y)=>{if(Y.body._tag!=="Stream")return Y;let Z=nY(),$=zY(Z.context,L0);return o4($),M8(Y,jY(XJ(Y.body.stream,(J)=>z0($,J)),Y.body.contentType,Y.body.contentLength))},GJ=Symbol.for("effect/http/HttpEffect/scopeEjected"),s4=(Y)=>u((Z)=>{let $=a5(),J=Z.context;return Z.setContext(gZ(Z.context,L0,$)),w1(Y,(Q)=>{if(Z.setContext(J),GJ in $)return;return YJ($,Q)},!0)}),z9=(Y)=>M.use((Z)=>{return M1(Z,Y),e});var t4=(Y)=>(Z,$)=>{let J=Symbol.for("@effect/platform/HttpApp/resolve"),Q=a4(Z,(X,G)=>{return G=r4(G),X[J](T8(G,{withoutBody:X.method==="HEAD",context:Y})),e},$);return(X,G)=>new Promise((K)=>{let z=new Map(Y.mapUnsafe);if(e$(G))for(let[V,D]of G.mapUnsafe)z.set(V,D);let _=f5(X);z.set(M.key,_),_[J]=K;let B=QJ(bY(z))(Q);X.signal?.addEventListener("abort",()=>{B.interruptUnsafe(void 0,_1.annotation)},{once:!0})})};var KJ=(Y,Z)=>{let $=a5(),J=()=>n5(z0($,O1)),Q,X;function G(K,z){if(Q)return Q(K,z);return X??=n5(i(function*(){let _=yield*Z.memoMap?H1(Y,Z.memoMap,$):ZJ(Y,$);return Q=t4(_)(yield*Z.toHandler(_),Z.middleware)})),X.then((_)=>_(K,z))}return{dispose:J,handler:G}};var t5={};kY(t5,{withLogAddress:()=>s5,serveEffect:()=>X2,serve:()=>P1,makeTestClient:()=>FJ,make:()=>Q2,logAddress:()=>UJ,layerTestClient:()=>G2,layerServices:()=>K2,formatAddress:()=>WJ,addressFormattedWith:()=>AJ,HttpServer:()=>qZ});var o5=(Y)=>{switch(Y._tag){case"Weak":return`W/"${Y.value}"`;case"Strong":return`"${Y.value}"`}};class E1 extends S()("effect/http/Etag/Generator"){}var Y2=(Y)=>{let Z=BY(Y.mtime,{onNone:()=>"0",onSome:($)=>$.getTime().toString(16)});return`${Y.size.toString(16)}-${Z}`},Z2=(Y)=>{return`${Y.size.toString(16)}-${Y.lastModified.toString(16)}`};var I1=M0(E1)({fromFileInfo(Y){return WY(()=>({_tag:"Weak",value:Y2(Y)}))},fromFileWeb(Y){return WY(()=>({_tag:"Weak",value:Z2(Y)}))}});class r5 extends S()("effect/http/HttpPlatform"){}var $2=_0(function*(Y){let Z=yield*dY,$=yield*E1;return r5.of({fileResponse:_0(function*(J,Q){let X=yield*Z.stat(J),G=yield*$.fromFileInfo(X),K=Number(Q?.offset??0),z=Q?.bytesToRead!==void 0?K+Number(Q.bytesToRead):void 0,_=HY(Q?.headers?C(Q.headers):n,"etag",o5(G));if(r(X.mtime))_["last-modified"]=X.mtime.value.toUTCString();let B=z!==void 0?z-K:Number(X.size)-K;return Y.fileResponse(J,Q?.status??200,Q?.statusText,_,K,z,B)}),fileWebResponse(J,Q){return L($.fromFileWeb(J),(X)=>{let G=fZ(Q?.headers?C(Q.headers):n,wY({etag:o5(X),"last-modified":new Date(J.lastModified).toUTCString()}));return Y.fileWebResponse(J,Q?.status??200,Q?.statusText,G,Q)})}})}),zJ=pY(r5)(U(dY.asEffect(),(Y)=>$2({fileResponse(Z,$,J,Q,X,G,K){return j5(Y.stream(Z,{offset:X,bytesToRead:G!==void 0?G-X:void 0}),{contentLength:K,headers:Q,status:$,statusText:J})},fileWebResponse(Z,$,J,Q,X){return j5(SY({evaluate:()=>Z.stream(),onError:BZ}),{headers:Q,status:$,statusText:J})}}))).pipe(rY(I1));class qZ extends S()("effect/http/HttpServer"){}var Q2=(Y)=>Y,P1=O((Y)=>FY(Y[0]),(Y,Z)=>DZ(qZ.use(($)=>$.serve(Y,Z)))),X2=O((Y)=>FY(Y[0]),(Y,Z)=>qZ.use(($)=>$.serve(Y,Z))),WJ=(Y)=>{switch(Y._tag){case"UnixAddress":return`unix://${Y.path}`;case"TcpAddress":return`http://${Y.hostname}:${Y.port}`}},AJ=(Y)=>U(qZ.asEffect(),(Z)=>Y(WJ(Z.address))),UJ=AJ((Y)=>F0(`Listening on ${Y}`)),s5=(Y)=>DZ(UJ).pipe(sY(Y)),FJ=i(function*(){let Y=yield*qZ,Z=yield*vZ,$=Y.address;if($._tag==="UnixAddress")return yield*BJ(Error("HttpServer.layerTestClient: UnixAddress not supported"));let Q=`http://${$.hostname==="0.0.0.0"?"127.0.0.1":$.hostname}:${$.port}`;return F5(Z,a1(Q))}),G2=pY(vZ)(FJ),K2=_J(zJ,DJ,I1).pipe(sY(OJ({})));var NJ="~effect/http/HttpRouter",LY=S("effect/http/HttpRouter"),vJ=i(function*(){let Y=N8(yield*v1),Z=new Set,$=(J)=>ZY((Q)=>{let X=bJ(Q),G=(K)=>{for(let z=0;z<X.length;z++)K=X[z](K);return K};for(let K=0;K<J.length;K++){let z=X.length===0?J[K]:j1({...J[K],handler:G(J[K].handler)});if(z.method==="*")if(z.path.endsWith("/*"))Y.all(z.path,z),Y.all(z.path.slice(0,-2),z);else Y.all(z.path,z);else if(z.path.endsWith("/*"))Y.on(z.method,z.path,z),Y.on(z.method,z.path.slice(0,-2),z);else Y.on(z.method,z.path,z)}return e});return LY.of({[NJ]:NJ,prefixed(J){return LY.of({...this,prefixed:(Q)=>this.prefixed(T0(J,Q)),addAll:(Q)=>$(Q.map(CJ(J))),add:(Q,X,G,K)=>$([j1({method:Q,path:T0(X,J),handler:AY(G)?F(G):FY(G)?G:U(M.asEffect(),G),uninterruptible:K?.uninterruptible??!1,prefix:J})])})},addAll:$,add:(J,Q,X,G)=>$([gJ(J,Q,X,G)]),addGlobalMiddleware:(J)=>WY(()=>{Z.add(J)}),asHttpEffect(){let J=u((Q)=>{let X=new Map(Q.context.mapUnsafe),G=X.get(M.key),K=Y.find(G.method,G.url);if(K===void 0&&G.method==="HEAD")K=Y.find("GET",G.url);if(K===void 0)return g(new l({reason:new v5({request:G})}));let z=K.handler;if(r(z.prefix))X.set(M.key,V2(G,z.prefix.value));X.set(xY.key,K.searchParams),X.set(WZ.key,{route:z,params:K.params});let _=X.get(T1.key);if(_&&_._tag==="Span")_.attribute("http.route",z.path);return J6(z.uninterruptible?z.handler:jJ(z.handler),bY(X))});if(Z.size===0)return J;for(let Q of wJ(Z))J=Q(J);return J}})});function V2(Y,Z){let $=Z.length;return Y.modify({url:Y.url.length<=$?"/":Y.url.slice($)})}var v1=j("effect/http/HttpRouter/RouterConfig",{defaultValue:()=>({})});class WZ extends S()("effect/http/HttpRouter/RouteContext"){}var RJ=L(WZ.asEffect(),(Y)=>Y.params),z2=(Y,Z)=>{let $=f(Y);return ZY((J)=>{let Q=y(J,M),X=y(J,xY),G=y(J,WZ);return U(Q.json,(K)=>$({method:Q.method,url:Q.url,headers:Q.headers,cookies:Q.cookies,pathParams:G.params,searchParams:X,body:K},Z))})},_2=(Y,Z)=>{let $=f(Y);return ZY((J)=>{let Q=y(J,M),X=y(J,xY),G=y(J,WZ);return $({method:Q.method,url:Q.url,headers:Q.headers,cookies:Q.cookies,pathParams:G.params,searchParams:X},Z)})},B2=(Y,Z)=>{let $=f(Y);return ZY((J)=>{let Q=y(J,xY),X=y(J,WZ);return $({...Q,...X.params},Z)})},O2=(Y,Z)=>{let $=f(Y);return U(RJ,(J)=>$(J,Z))},SJ=(Y)=>DZ(U(LY.asEffect(),Y)),D2=(Y,Z,$,J)=>SJ((Q)=>Q.add(Y,Z,$,J)),W2=(Y,Z)=>DZ(i(function*(){let $=FY(Y)?yield*Y:Y,J=yield*LY;if(Z?.prefix)J=J.prefixed(Z.prefix);yield*J.addAll($)})),xZ=pY(LY)(vJ),A2=(Y)=>i(function*(){let Z=yield*Z6(sY(Y,xZ));return y(Z,LY).asHttpEffect()}),LJ="~effect/http/HttpRouter/Route",j1=(Y)=>({...Y,uninterruptible:Y.uninterruptible??!1,prefix:typeof Y.prefix==="string"?b(Y.prefix):Y.prefix??H(),[LJ]:LJ}),gJ=(Y,Z,$,J)=>j1({...J,method:Y,path:Z,handler:AY($)?F($):FY($)?$:U(M.asEffect(),$),uninterruptible:J?.uninterruptible??!1}),U2=(Y)=>Y.endsWith("/")?Y.slice(0,-1):Y,T0=O(2,(Y,Z)=>{if(Z=U2(Z),Y==="*")return`${Z}/*`;else if(Y==="/")return Z;return Z+Y}),CJ=O(2,(Y,Z)=>j1({...Y,path:T0(Y.path,Z),prefix:BY(Y.prefix,{onNone:()=>Z,onSome:($)=>T0($,Z)})})),F2="~effect/http/HttpRouter/Middleware",R1=function(){if(arguments.length===0)return MJ;return MJ(arguments[0],arguments[1])},MJ=(Y,Z)=>Z?.global?DZ(i(function*(){let $=yield*LY,J=FY(Y)?yield*Y:Y;yield*$.addGlobalMiddleware(J)})):new Q6(FY(Y)?$6(L(Y,($)=>bY(new Map([[e5,$]])))):IJ(bY(new Map([[e5,Y]])))),N2=0,e5="effect/http/HttpRouter/MiddlewareFn";class Q6{[F2]={};layerFn;dependencies;constructor(Y,Z){this.layerFn=Y,this.dependencies=Z;let $=`effect/http/HttpRouter/Middleware-${++N2}`;this.layer=$6(i({self:this},function*(){let J=yield*E5(),Q=[J.mapUnsafe.get(e5)];if(this.dependencies){let X=yield*EJ,G=y(J,L0),K=yield*H1(this.dependencies,X,G);Q.push(...bJ(K))}return bY(new Map([[$,Q]]))})).pipe(rY(this.layerFn))}layer;combine(Y){return new Q6(this.layerFn,this.dependencies?sY(this.dependencies,Y.layer):Y.layer)}}var TJ=new WeakMap,bJ=(Y)=>{let Z=TJ.get(Y);if(Z)return Z;let $=HJ(),J=0;for(let[Q,X]of Y.mapUnsafe)if(Q.startsWith("effect/http/HttpRouter/Middleware-")){if($.push(X),X.length>J)J=X.length}if($.length===0)Z=[];else{let Q=new Set;for(let X=J-1;X>=0;X--)for(let G of $)if(X<G.length)Q.add(G[X]);Z=y0(Q).reverse()}return TJ.set(Y,Z),Z},L2=(Y)=>R1(t$(Y),{global:!0}),M2=R1(s$).layer,T2=(Y)=>(Z)=>rY(Z,R1()(i(function*(){let $=yield*Z6(Y);return(J)=>J6(J,$)})).layer),w2=(Y,Z)=>{let $=Z?.middleware;if(Z?.disableLogger!==!0)$=$?Y6($,N0):N0;let J=Z?.routerConfig?rY(xZ,M0(v1)(Z.routerConfig)):xZ;return i(function*(){let X=(yield*LY).asHttpEffect();return $?P1(X,$):P1(X)}).pipe(PJ,sY(Y),rY(J),Z?.disableListenLog?BZ:s5)},H2=(Y,Z)=>{let $=Z?.middleware;if(Z?.disableLogger!==!0)$=$?Y6($,N0):N0;let J=Z?.routerConfig?rY(xZ,M0(v1)(Z.routerConfig)):xZ;return KJ(sY(Y,J),{toHandler:(Q)=>F(y(Q,LY).asHttpEffect()),middleware:$,memoMap:Z?.memoMap})};export{C as Dr,wY as Er,fZ as Fr,P0 as Gr,mZ as Hr,nJ as Ir,lZ as Jr,c0 as Kr,TZ as Lr,eJ as Mr,$Y as Nr,pZ as Or,e0 as Pr,vZ as Qr,s as Rr,XX as Sr,BX as Tr,e7 as Ur,G1 as Vr,X8 as Wr,AY as Xr,t as Yr,N3 as Zr,L3 as _r,M3 as $r,T3 as as,w3 as bs,H3 as cs,oY as ds,c3 as es,M as fs,xY as gs,I4 as hs,P4 as is,j4 as js,A0 as ks,z9 as ls,t5 as ms,WZ as ns,SJ as os,gJ as ps,T0 as qs,qJ as rs};
|
|
4
|
+
--${B}`,function(N,T){if(N===0){D();return}else if(N!==V.index){if(V.index>0)if(V.isFile)V.onChunk(null),V.partSize=0;else{if(V.fieldChunks.length===1)$(V.info,V.fieldChunks[0]);else{let E=new Uint8Array(V.fieldSize),YY=0;for(let I=0;I<V.fieldChunks.length;I++){let p=V.fieldChunks[I];E.set(p,YY),YY+=p.length}$(V.info,E)}V.fieldSize=0,V.fieldChunks=[]}if(V.state=CY.headers,V.index=N,V.headerSkip=2,T[0]===45&&T[1]===45)return Q();if(V.parts++,V.parts>G)J(B4)}if((V.partSize+=T.length)>z)J(D4);if(V.state===CY.headers){let E=A(T,V.headerSkip);if(V.headerSkip=0,E._tag==="Continue")return;else if(E._tag==="Failure")return D(),J({_tag:"BadHeaders",error:E});let YY=A1(E.headers["content-type"]),I=A1(E.headers["content-disposition"],!0);if(I.value==="form-data"&&!("name"in I.parameters))return D(),J(z4);let p;if("filename*"in I.parameters){let w=I.parameters["filename*"].split("''");if(w.length===2)p=decodeURIComponent(w[1])}if(V.info={name:I.parameters.name??"",filename:p??I.parameters.filename,contentType:YY.value===""?I.parameters.filename!==void 0?"application/octet-stream":"text/plain":YY.value,contentTypeParameters:YY.parameters,contentDisposition:I.value,contentDispositionParameters:I.parameters,headers:E.headers},V.state=CY.body,V.isFile=X(V.info),V.isFile)V.onChunk=Z(V.info);if(E.endPosition<T.length)if(V.isFile)V.onChunk(T.subarray(E.endPosition));else{let w=T.subarray(E.endPosition);if((V.fieldSize+=w.length)>_)J(K$);V.fieldChunks.push(w)}}else if(V.isFile)V.onChunk(T);else{if((V.fieldSize+=T.length)>_)J(K$);V.fieldChunks.push(T)}},W4);return{write(N){if((V.totalSize+=N.length)>K)return J(O4);return W.write(N)},end(){if(W.end(),V.state===CY.body)J(_4);V.state=CY.headers,V.index=0,V.parts=0,V.onChunk=U1,V.info=void 0,V.totalSize=0,V.partSize=0,V.fieldChunks=[],V.fieldSize=0}}}var V$=new TextDecoder("utf-8");function U4(Y){if(Y==="utf-8"||Y==="utf8"||Y==="")return V$;try{return new TextDecoder(Y)}catch(Z){return V$}}function _$(Y,Z){return U4(Y.contentTypeParameters.charset??"utf-8").decode(Z)}var B$=z$,O$=b5,D$=_$;var NY="~effect/http/Multipart";var W$="~effect/http/Multipart/MultipartError";class j$ extends n0{}class k extends P("MultipartError"){static fromReason(Y,Z){return new k({reason:new j$({_tag:Y,cause:Z})})}[W$]=W$;get message(){return this.reason._tag}}var y5=(Y)=>f(Y),v$=(Y,Z)=>{let $=w$(Y);return O(2,(J,Q)=>L(f(T$({[Q]:$}))(J,Z),(X)=>X[Q]))},L4=(Y)=>u((Z)=>{let $=y(Z.context,x$);return F({headers:Y,maxParts:Z.getRef(C$),maxFieldSize:Number(Z.getRef(b$)),maxPartSize:D0(Z.getRef(q$),Number),maxTotalSize:D0(Z.getRef(rZ),Number),isFile:$.length===0?void 0:(J)=>!$.some((Q)=>J.contentType.includes(Q))&&O$(J)})}),k5=(Y)=>D1((Z)=>L(L4(Y),($)=>{let J=[],Q=H(),X=B$({...$,onField(K,z){J.push(new R$(K.name,K.contentType,D$(K,z)))},onFile(K){let z=[],_=!1,B=L$(F(_Z(function V(){if(!q5(z))return _?U$():U(G,V);let D=z;return z=[],F(D)})));return J.push(new S$(K,B)),function(V){if(V===null)_=!0;else z.push(V)}},onError(K){Q=b(x5(M4(K)))},onDone(){Q=b(x5(A$()))}}),G=Z.pipe(U((K)=>{for(let z=0;z<K.length;z++)X.write(K[z]);return e}),K0((K)=>{if(N$(K))X.end();else Q=b(F$(K));return e}));return G.pipe(U(function K(){if(!q5(J)){if(r(Q))return Q.value;return U(G,K)}let z=J;return J=[],F(z)}))}));function M4(Y){switch(Y._tag){case"ReachedLimit":switch(Y.limit){case"MaxParts":return k.fromReason("TooManyParts",Y);case"MaxFieldSize":return k.fromReason("FieldTooLarge",Y);case"MaxPartSize":return k.fromReason("FileTooLarge",Y);case"MaxTotalSize":return k.fromReason("BodyTooLarge",Y)}default:return k.fromReason("Parse",Y)}}class F1 extends RY{[NY];constructor(){super();this[NY]=NY}}class R$ extends F1{_tag="Field";key;contentType;value;constructor(Y,Z,$){super();this.key=Y,this.contentType=Z,this.value=$}toJSON(){return{_id:"@effect/platform/Multipart/Part",_tag:"Field",key:this.key,contentType:this.contentType,value:this.value}}}class S$ extends F1{_tag="File";key;name;contentType;content;contentEffect;constructor(Y,Z){super();this.key=Y.name,this.name=Y.filename??Y.name,this.contentType=Y.contentType,this.content=H$(Z),this.contentEffect=Z.pipe(w4,JZ(($)=>k.fromReason("InternalError",$)))}toJSON(){return{_id:"@effect/platform/Multipart/Part",_tag:"File",key:this.key,name:this.name,contentType:this.contentType}}}var T4=(Y,Z)=>U(dY.asEffect(),($)=>JZ(E$(Z.content,$.sink(Y)),(J)=>k.fromReason("InternalError",J))),w4=(Y)=>M$(Y,DY(new Uint8Array(0)),(Z,$)=>{let J=$.reduce((G,K)=>G+K.length,Z.length),Q=new Uint8Array(J);Q.set(Z,0);let X=Z.length;for(let G of $)Q.set(G,X),X+=G.length;return Q}),m5=(Y,Z=T4)=>i(function*(){let $=yield*dY,J=yield*P$,Q=yield*$.makeTempDirectoryScoped(),X=Object.create(null);return yield*I$(Y,(G)=>{if(G._tag==="Field"){if(!(G.key in X))X[G.key]=G.value;else if(typeof X[G.key]==="string")X[G.key]=[X[G.key],G.value];else X[G.key].push(G.value);return e}else if(G.name==="")return e;let K=G,z=J.join(Q,J.basename(K.name).slice(-128)),_=new g$(K.key,K.name,K.contentType,z);if(Array.isArray(X[G.key]))X[G.key].push(_);else X[G.key]=[_];return Z(z,K)}),X}).pipe(X1("PlatformError",($)=>g(k.fromReason("InternalError",$))));class g$ extends F1{_tag="PersistedFile";key;name;contentType;path;constructor(Y,Z,$,J){super();this.key=Y,this.name=Z,this.contentType=$,this.path=J}toJSON(){return{_id:"@effect/platform/Multipart/Part",_tag:"PersistedFile",key:this.key,name:this.name,contentType:this.contentType,path:this.path}}}var c3=(Y)=>{let Z=new Map;if(Y.maxParts!==void 0)Z.set(C$.key,Y.maxParts);if(Y.maxFieldSize!==void 0)Z.set(b$.key,O0(Y.maxFieldSize));if(Y.maxFileSize!==void 0)Z.set(q$.key,D0(Y.maxFileSize,O0));if(Y.maxTotalSize!==void 0)Z.set(rZ.key,D0(Y.maxTotalSize,O0));if(Y.fieldMimeTypes!==void 0)Z.set(x$.key,Y.fieldMimeTypes);return bY(Z)},C$=j("effect/http/Multipart/MaxParts",{defaultValue:()=>{return}}),b$=j("effect/http/Multipart/MaxFieldSize",{defaultValue:DY(O0(10485760))}),q$=j("effect/http/Multipart/MaxFileSize",{defaultValue:()=>{return}}),x$=j("effect/http/Multipart/FieldMimeTypes",{defaultValue:DY(["application/json"])});var OZ="~effect/http/HttpServerRequest",M=S("effect/http/HttpServerRequest");class xY extends S()("effect/http/ParsedSearchParams"){}var m$=(Y)=>{let Z={};for(let[$,J]of Y.searchParams.entries()){let Q=Z[$];if(Q!==void 0)if(Array.isArray(Q))Q.push(J);else Z[$]=[Q,J];else Z[$]=J}return Z},E4=()=>M.asEffect().pipe(U((Y)=>Y.upgrade),L($$()),C5),I4=(Y,Z)=>{let $=f(Y);return U(M.asEffect(),(J)=>$(J.cookies,Z))},P4=(Y,Z)=>{let $=f(Y);return U(M.asEffect(),(J)=>$(J.headers,Z))},j4=(Y,Z)=>{let $=f(Y);return U(xY.asEffect(),(J)=>$(J,Z))},v4=(Y,Z)=>{let $=s0(Y,Z);return U(M.asEffect(),$)},h$=(Y)=>Y.headers["content-type"]?.toLowerCase().includes("multipart/form-data")===!0||k4(Y)!==void 0,R4=(Y,Z)=>{let $=y5(Y),J=oZ(Y,Z);return U(M.asEffect(),(Q)=>{if(h$(Q))return U(Q.multipart,(X)=>$(X,Z));return J(Q)})},S4=(Y,Z)=>{let $=oZ(Y,Z);return U(M.asEffect(),$)},g4=(Y,Z)=>{let $=y5(Y);return M.asEffect().pipe(U((J)=>J.multipart),U((J)=>$(J,Z)))},C4=(Y,Z)=>{let $=v$(Y,Z);return(J)=>{let Q=b6(J).pipe(cY(Y),iY);return U(M.asEffect(),(X)=>{if(h$(X))return U(JZ(X.multipart,(G)=>new l({reason:new JY({request:X,cause:G})})),$(J));return U(X.urlParamsBody,(G)=>Q(G,Z))})}},b4=(Y)=>{let Z=BY(o1(Y),{onNone:()=>Y.url,onSome:($)=>$.toString()});return new d5(Y,Z)},f5=(Y)=>new c5(Y,f$(Y.url)),q4=(Y)=>EZ(R(Y.method,"",m0,H(),Y.headers,x4(Y)),L1(W0(Y),()=>Y.url)),x4=(Y)=>TZ(Y.method)?jY(Y.stream,Y.headers["content-type"],y4(Y.headers["content-length"])):QZ,y4=(Y)=>{if(Y===void 0)return;let Z=Number.parseInt(Y,10);return Number.isNaN(Z)?void 0:Z},f$=(Y)=>{if(Y[0]==="/")return Y;let Z=Y.indexOf("/",Y.indexOf("//")+2);return Z===-1?"/":Y.slice(Z)};class c5 extends RY{[OZ];[c];source;url;headersOverride;remoteAddressOverride;constructor(Y,Z,$,J){super();this[OZ]=OZ,this[c]=c,this.source=Y,this.url=Z,this.headersOverride=$,this.remoteAddressOverride=J}toJSON(){return sZ(this,{_id:"HttpServerRequest",method:this.method,url:this.originalUrl})}modify(Y){return new c5(this.source,Y.url??this.url,Y.headers??this.headersOverride,"remoteAddress"in Y?Y.remoteAddress:this.remoteAddressOverride)}get method(){return this.source.method.toUpperCase()}get originalUrl(){return this.source.url}get remoteAddress(){return this.remoteAddressOverride??H()}get headers(){return this.headersOverride??=C(this.source.headers),this.headersOverride}cachedCookies;get cookies(){if(this.cachedCookies)return this.cachedCookies;return this.cachedCookies=Z5(this.headers.cookie??"")}get stream(){return this.source.body?SY({evaluate:()=>this.source.body,onError:(Y)=>new l({reason:new JY({request:this,cause:Y})})}):tZ(new l({reason:new JY({request:this,description:"can not create stream from empty body"})}))}textEffect;get text(){if(this.textEffect)return this.textEffect;return this.textEffect=o(OY(d({try:()=>this.source.text(),catch:(Y)=>new l({reason:new JY({request:this,cause:Y})})}))),this.textEffect}get json(){return U(this.text,(Y)=>GY({try:()=>JSON.parse(Y),catch:(Z)=>new l({reason:new JY({request:this,cause:Z})})}))}get urlParamsBody(){return U(this.text,(Y)=>GY({try:()=>a(new URLSearchParams(Y)),catch:(Z)=>new l({reason:new JY({request:this,cause:Z})})}))}multipartEffect;get multipart(){if(this.multipartEffect)return this.multipartEffect;return this.multipartEffect=o(OY(m5(this.multipartStream))),this.multipartEffect}get multipartStream(){return h5(X0(this.stream,(Y)=>k.fromReason("InternalError",Y)),k5(this.headers))}arrayBufferEffect;get arrayBuffer(){if(this.arrayBufferEffect)return this.arrayBufferEffect;return this.arrayBufferEffect=o(OY(d({try:()=>this.source.arrayBuffer(),catch:(Y)=>new l({reason:new JY({request:this,cause:Y})})}))),this.arrayBufferEffect}get upgrade(){return g(new l({reason:new JY({request:this,description:"Not an upgradeable ServerRequest"})}))}}class d5 extends RY{[OZ];[c];source;originalUrl;headersOverride;remoteAddressOverride;urlOverride;constructor(Y,Z,$,J,Q){super();this[OZ]=OZ,this[c]=c,this.source=Y,this.originalUrl=Z,this.urlOverride=$,this.headersOverride=J,this.remoteAddressOverride=Q}toJSON(){return sZ(this,{_id:"HttpServerRequest",method:this.method,url:this.originalUrl})}modify(Y){return new d5(this.source,this.originalUrl,Y.url??this.url,Y.headers??this.headersOverride,"remoteAddress"in Y?Y.remoteAddress:this.remoteAddressOverride)}get method(){return this.source.method}get url(){return this.urlOverride??f$(this.originalUrl)}get remoteAddress(){return this.remoteAddressOverride??H()}get headers(){return this.headersOverride??=this.source.headers}cachedCookies;get cookies(){if(this.cachedCookies)return this.cachedCookies;return this.cachedCookies=Z5(this.headers.cookie??"")}get stream(){let Y=this.source.body;switch(Y._tag){case"Empty":return K1;case"Uint8Array":return I5(Y.body);case"Stream":return X0(Y.stream,(Z)=>qY(this,void 0,Z));case"FormData":return N1(this,new Response(Y.formData).body);case"Raw":return m4(this,Y.body)}}bytesEffect;get bytes(){if(this.bytesEffect)return this.bytesEffect;let Y=this.source.body,Z;switch(Y._tag){case"Empty":{Z=F(new Uint8Array(0));break}case"Uint8Array":{Z=F(Y.body);break}case"FormData":{Z=c$(this,Y.formData);break}case"Stream":{Z=P5(this.stream);break}case"Raw":{Z=h4(this,Y.body);break}}return this.bytesEffect=o(OY(Z)),this.bytesEffect}get text(){return L(this.bytes,(Y)=>d4.decode(Y))}get json(){return U(this.text,(Y)=>GY({try:()=>Y===""?null:JSON.parse(Y),catch:(Z)=>qY(this,void 0,Z)}))}get urlParamsBody(){return U(this.text,(Y)=>GY({try:()=>a(new URLSearchParams(Y)),catch:(Z)=>qY(this,void 0,Z)}))}multipartEffect;get multipart(){if(this.multipartEffect)return this.multipartEffect;return this.multipartEffect=o(OY(m5(this.multipartStream))),this.multipartEffect}get multipartStream(){let Y=this.source.body._tag==="FormData"&&this.source.body.formData;if(Y)return k$(f4(Y));return h5(X0(this.stream,(Z)=>k.fromReason("InternalError",Z)),k5(this.headers))}get arrayBuffer(){return L(this.bytes,(Y)=>Y.slice().buffer)}get upgrade(){return g(qY(this,"Not an upgradeable ServerRequest"))}}var k4=(Y)=>{if(!KZ(Y.source))return;let Z=Y.source.body;if(Z._tag==="FormData")return Z.formData;if(Z._tag==="Raw"&&l$(Z.body))return Z.body;return},m4=(Y,Z)=>{if(Z instanceof Request)return N1(Y,Z.body);if(l$(Z))return N1(Y,new Response(Z).body);if(c4(Z))return N1(Y,Z);return tZ(qY(Y,"Unsupported body type"))},h4=(Y,Z)=>{if(Z instanceof Blob)return c$(Y,Z);if(Z instanceof Request)return d({try:()=>Z.arrayBuffer().then(($)=>new Uint8Array($)),catch:($)=>qY(Y,void 0,$)});return g(qY(Y,"Unsupported body type"))},c$=(Y,Z)=>d({try:()=>new Response(Z).arrayBuffer().then(($)=>new Uint8Array($)),catch:($)=>qY(Y,void 0,$)}),N1=(Y,Z)=>Z?SY({evaluate:()=>Z,onError:($)=>qY(Y,void 0,$)}):K1,qY=(Y,Z,$)=>new l({reason:new JY({request:Y,...Z===void 0?void 0:{description:Z},...$===void 0?void 0:{cause:$}})}),f4=(Y)=>{let Z=[];for(let[$,J]of Y.entries())Z.push(typeof J==="string"?new d$($,J):new u$($,J));return Z};class d$ extends RY{[NY];_tag="Field";contentType="text/plain";key;value;constructor(Y,Z){super();this[NY]=NY,this.key=Y,this.value=Z}toJSON(){return{_id:"@effect/platform/Multipart/Part",_tag:"Field",key:this.key,contentType:this.contentType,value:this.value}}}class u$ extends RY{[NY];_tag="File";key;name;contentType;content;contentEffect;constructor(Y,Z){super();this[NY]=NY,this.key=Y,this.name=Z.name,this.contentType=Z.type,this.content=SY({evaluate:()=>Z.stream(),onError:($)=>k.fromReason("InternalError",$)}),this.contentEffect=d({try:()=>Z.arrayBuffer().then(($)=>new Uint8Array($)),catch:($)=>k.fromReason("InternalError",$)})}toJSON(){return{_id:"@effect/platform/Multipart/Part",_tag:"File",key:this.key,name:this.name,contentType:this.contentType}}}var c4=(Y)=>typeof ReadableStream<"u"&&Y instanceof ReadableStream,l$=(Y)=>typeof FormData<"u"&&Y instanceof FormData,d4=new TextDecoder,W0=(Y)=>{let Z=Y.headers.host??"localhost",$=Y.headers["x-forwarded-proto"]==="https"?"https":"http";try{return b(new URL(Y.url,`${$}://${Z}`))}catch{return H()}},u5=(Y,Z)=>{if(Y.source instanceof Request)return PY(Y.source);let $=W0(Y);if(y$($))return h(new JY({request:Y,description:"Invalid URL"}));let J={method:Y.method,headers:Y.headers};if(Z?.signal)J.signal=Z.signal;if(TZ(Y.method))J.body=wZ(Y.stream,Z?.context??GZ()),J.duplex="half";return PY(new Request($.value,J))},u4=(Y,Z)=>ZY(($)=>u5(Y,{context:$,signal:Z?.signal}).asEffect());var U0=new WeakMap,M1=(Y,Z)=>{let $=U0.get(Y.source),J=$?(Q,X)=>U($(Q,X),(G)=>Z(Q,G)):Z;U0.set(Y.source,J)};var o$=(Y)=>Y,r$=new WeakSet,l4=(Y)=>{let Z=Y.indexOf("?"),$=Y.indexOf("#");if(Z===-1)return $===-1?Y:Y.slice(0,$);if($===-1)return Y.slice(0,Z);return Y.slice(0,Math.min(Z,$))},s$=(Y)=>u((Z)=>{let $=zY(Z.context,M);return r$.add($.source),Y}),i4=j("effect/http/HttpMiddleware/TracerDisabledWhen",{defaultValue:()=>$1});var p4=j("@effect/platform/HttpMiddleware/SpanNameGenerator",{defaultValue:()=>(Y)=>`http.server ${Y.method}`}),N0=o$((Y)=>{let Z=0;return u(($)=>{let J=zY($.context,M),Q=l4(J.url);return a$(U(n$(Y),(X)=>{if(r$.has(J.source))return X;else if(X._tag==="Failure"){let[G,K]=S5(X.cause);return $0(l5(F0(L1(K,()=>"Sent HTTP Response")),{"http.method":J.method,"http.url":Q,"http.status":G.status}),X)}return $0(l5(F0("Sent HTTP response"),{"http.method":J.method,"http.url":Q,"http.status":X.value.status}),X)}),`http.span.${++Z}`)})}),i5=o$((Y)=>u((Z)=>{let $=zY(Z.context,M);if(!Z.getRef(p$)||Z.getRef(i4)($))return Y;let Q=Z.getRef(p4),X=i$(Z,Q($),{parent:XZ(w7($.headers)),kind:"server"}),G=Z.context;return Z.setContext(gZ(Z.context,T1,X)),w1(Y,(K)=>{Z.setContext(G);let z=Z.getRef(J1).currentTimeNanosUnsafe();Z.currentDispatcher.scheduleTask(()=>{let _=W0($);if(r(_)&&(_.value.username!==""||_.value.password!==""))_.value.username="REDACTED",_.value.password="REDACTED";let B=Z.getRef(cZ),V=YZ($.headers,B);if(X.attribute("http.request.method",$.method),r(_)){if(X.attribute("url.full",_.value.toString()),X.attribute("url.path",_.value.pathname),_.value.search.slice(1)!=="")X.attribute("url.query",_.value.search.slice(1));X.attribute("url.scheme",_.value.protocol.slice(0,-1))}if($.headers["user-agent"]!==void 0)X.attribute("user_agent.original",$.headers["user-agent"]);for(let W in V)X.attribute(`http.request.header.${W}`,String(V[W]));if(r($.remoteAddress))X.attribute("client.address",$.remoteAddress.value);let D=C8(K);X.attribute("http.response.status_code",D.status);let A=YZ(D.headers,B);for(let W in A)X.attribute(`http.response.header.${W}`,String(A[W]));X.end(z,K)},0);return},!0)}));var t$=(Y)=>{let Z={allowedOrigins:Y?.allowedOrigins??[],allowedMethods:Y?.allowedMethods??["GET","HEAD","PUT","PATCH","POST","DELETE"],allowedHeaders:Y?.allowedHeaders??[],exposedHeaders:Y?.exposedHeaders??[],credentials:Y?.credentials??!1,maxAge:Y?.maxAge},$=typeof Z.allowedOrigins==="function"?Z.allowedOrigins:(D)=>Z.allowedOrigins.includes(D),J=typeof Z.allowedOrigins==="function"||Z.allowedOrigins.length>1?(D)=>{if(!$(D))return;return{"access-control-allow-origin":D,vary:"Origin"}}:Z.allowedOrigins.length===0?DY({"access-control-allow-origin":"*"}):DY({"access-control-allow-origin":Z.allowedOrigins[0],vary:"Origin"}),Q=Z.allowedMethods.length>0?{"access-control-allow-methods":Z.allowedMethods.join(", ")}:void 0,X=Z.credentials?{"access-control-allow-credentials":"true"}:void 0,G=(D)=>{if(Z.allowedHeaders.length===0&&D)return{vary:"Access-Control-Request-Headers","access-control-allow-headers":D};if(Z.allowedHeaders)return{"access-control-allow-headers":Z.allowedHeaders.join(",")};return},K=Z.exposedHeaders.length>0?{"access-control-expose-headers":Z.exposedHeaders.join(",")}:void 0,z=Z.maxAge?{"access-control-max-age":Z.maxAge.toString()}:void 0,_=(D)=>{let A=D.headers.origin;return wY({...J(A),...X,...K})},B=(D)=>{let A=D.headers.origin,W=D.headers["access-control-request-headers"];return wY({...J(A),...X,...K,...Q,...G(W),...z})},V=(D,A)=>F(L8(A,_(D)));return(D)=>u((A)=>{let W=zY(A.context,M);if(W.method==="OPTIONS")return F(t({status:204,headers:B(W)}));return M1(W,V),D})};var a4=(Y,Z,$)=>{let Q=jZ(Y,{onSuccess:(G)=>{let K=nY(),z=zY(K.context,M),_=U0.get(z.source);if(_===void 0)return z[CZ]=!0,V0(Z(z,G),()=>G);return bZ(_(z,G),(B)=>{return z[CZ]=!0,V0(Z(z,B),()=>G)})},onFailure:(G)=>bZ(R5(G),([K,z])=>{let _=nY();p5(_,z);let B=zY(_.context,M),V=U0.get(B.source),D=z.reasons.length===0?F(K):eZ(z);if(V===void 0)return B[CZ]=!0,bZ(Z(B,K),()=>D);return bZ(bZ(V(B,K),(A)=>{return B[CZ]=!0,Z(B,A)}),()=>D)})}),X=$===void 0?i5(Q):jZ(i5($(Q)),{onFailure(G){let K=nY();p5(K,G);let z=zY(K.context,M);if(CZ in z)return e;return $J(R5(G),{onFailure(_){return Z(z,t({status:500}))},onSuccess([_]){return Z(z,_)}})},onSuccess(G){let K=nY(),z=zY(K.context,M);return CZ in z?e:Z(z,G)}});return JJ(s4(X))},CZ=Symbol.for("effect/http/HttpEffect/handled"),o4=(Y)=>{Y[GJ]=!0},r4=(Y)=>{if(Y.body._tag!=="Stream")return Y;let Z=nY(),$=zY(Z.context,L0);return o4($),M8(Y,jY(XJ(Y.body.stream,(J)=>z0($,J)),Y.body.contentType,Y.body.contentLength))},GJ=Symbol.for("effect/http/HttpEffect/scopeEjected"),s4=(Y)=>u((Z)=>{let $=a5(),J=Z.context;return Z.setContext(gZ(Z.context,L0,$)),w1(Y,(Q)=>{if(Z.setContext(J),GJ in $)return;return YJ($,Q)},!0)}),z9=(Y)=>M.use((Z)=>{return M1(Z,Y),e});var t4=(Y)=>(Z,$)=>{let J=Symbol.for("@effect/platform/HttpApp/resolve"),Q=a4(Z,(X,G)=>{return G=r4(G),X[J](T8(G,{withoutBody:X.method==="HEAD",context:Y})),e},$);return(X,G)=>new Promise((K)=>{let z=new Map(Y.mapUnsafe);if(e$(G))for(let[V,D]of G.mapUnsafe)z.set(V,D);let _=f5(X);z.set(M.key,_),_[J]=K;let B=QJ(bY(z))(Q);X.signal?.addEventListener("abort",()=>{B.interruptUnsafe(void 0,_1.annotation)},{once:!0})})};var KJ=(Y,Z)=>{let $=a5(),J=()=>n5(z0($,O1)),Q,X;function G(K,z){if(Q)return Q(K,z);return X??=n5(i(function*(){let _=yield*Z.memoMap?H1(Y,Z.memoMap,$):ZJ(Y,$);return Q=t4(_)(yield*Z.toHandler(_),Z.middleware)})),X.then((_)=>_(K,z))}return{dispose:J,handler:G}};var t5={};kY(t5,{withLogAddress:()=>s5,serveEffect:()=>X2,serve:()=>P1,makeTestClient:()=>FJ,make:()=>Q2,logAddress:()=>UJ,layerTestClient:()=>G2,layerServices:()=>K2,formatAddress:()=>WJ,addressFormattedWith:()=>AJ,HttpServer:()=>qZ});var o5=(Y)=>{switch(Y._tag){case"Weak":return`W/"${Y.value}"`;case"Strong":return`"${Y.value}"`}};class E1 extends S()("effect/http/Etag/Generator"){}var Y2=(Y)=>{let Z=BY(Y.mtime,{onNone:()=>"0",onSome:($)=>$.getTime().toString(16)});return`${Y.size.toString(16)}-${Z}`},Z2=(Y)=>{return`${Y.size.toString(16)}-${Y.lastModified.toString(16)}`};var I1=M0(E1)({fromFileInfo(Y){return WY(()=>({_tag:"Weak",value:Y2(Y)}))},fromFileWeb(Y){return WY(()=>({_tag:"Weak",value:Z2(Y)}))}});class r5 extends S()("effect/http/HttpPlatform"){}var $2=_0(function*(Y){let Z=yield*dY,$=yield*E1;return r5.of({fileResponse:_0(function*(J,Q){let X=yield*Z.stat(J),G=yield*$.fromFileInfo(X),K=Number(Q?.offset??0),z=Q?.bytesToRead!==void 0?K+Number(Q.bytesToRead):void 0,_=HY(Q?.headers?C(Q.headers):n,"etag",o5(G));if(r(X.mtime))_["last-modified"]=X.mtime.value.toUTCString();let B=z!==void 0?z-K:Number(X.size)-K;return Y.fileResponse(J,Q?.status??200,Q?.statusText,_,K,z,B)}),fileWebResponse(J,Q){return L($.fromFileWeb(J),(X)=>{let G=fZ(Q?.headers?C(Q.headers):n,wY({etag:o5(X),"last-modified":new Date(J.lastModified).toUTCString()}));return Y.fileWebResponse(J,Q?.status??200,Q?.statusText,G,Q)})}})}),zJ=pY(r5)(U(dY.asEffect(),(Y)=>$2({fileResponse(Z,$,J,Q,X,G,K){return j5(Y.stream(Z,{offset:X,bytesToRead:G!==void 0?G-X:void 0}),{contentLength:K,headers:Q,status:$,statusText:J})},fileWebResponse(Z,$,J,Q,X){return j5(SY({evaluate:()=>Z.stream(),onError:BZ}),{headers:Q,status:$,statusText:J})}}))).pipe(rY(I1));class qZ extends S()("effect/http/HttpServer"){}var Q2=(Y)=>Y,P1=O((Y)=>FY(Y[0]),(Y,Z)=>DZ(qZ.use(($)=>$.serve(Y,Z)))),X2=O((Y)=>FY(Y[0]),(Y,Z)=>qZ.use(($)=>$.serve(Y,Z))),WJ=(Y)=>{switch(Y._tag){case"UnixAddress":return`unix://${Y.path}`;case"TcpAddress":return`http://${Y.hostname}:${Y.port}`}},AJ=(Y)=>U(qZ.asEffect(),(Z)=>Y(WJ(Z.address))),UJ=AJ((Y)=>F0(`Listening on ${Y}`)),s5=(Y)=>DZ(UJ).pipe(sY(Y)),FJ=i(function*(){let Y=yield*qZ,Z=yield*vZ,$=Y.address;if($._tag==="UnixAddress")return yield*BJ(Error("HttpServer.layerTestClient: UnixAddress not supported"));let Q=`http://${$.hostname==="0.0.0.0"?"127.0.0.1":$.hostname}:${$.port}`;return F5(Z,a1(Q))}),G2=pY(vZ)(FJ),K2=_J(zJ,DJ,I1).pipe(sY(OJ({})));var NJ="~effect/http/HttpRouter",LY=S("effect/http/HttpRouter"),vJ=i(function*(){let Y=N8(yield*v1),Z=new Set,$=(J)=>ZY((Q)=>{let X=bJ(Q),G=(K)=>{for(let z=0;z<X.length;z++)K=X[z](K);return K};for(let K=0;K<J.length;K++){let z=X.length===0?J[K]:j1({...J[K],handler:G(J[K].handler)});if(z.method==="*")if(z.path.endsWith("/*"))Y.all(z.path,z),Y.all(z.path.slice(0,-2),z);else Y.all(z.path,z);else if(z.path.endsWith("/*"))Y.on(z.method,z.path,z),Y.on(z.method,z.path.slice(0,-2),z);else Y.on(z.method,z.path,z)}return e});return LY.of({[NJ]:NJ,prefixed(J){return LY.of({...this,prefixed:(Q)=>this.prefixed(T0(J,Q)),addAll:(Q)=>$(Q.map(CJ(J))),add:(Q,X,G,K)=>$([j1({method:Q,path:T0(X,J),handler:AY(G)?F(G):FY(G)?G:U(M.asEffect(),G),uninterruptible:K?.uninterruptible??!1,prefix:J})])})},addAll:$,add:(J,Q,X,G)=>$([gJ(J,Q,X,G)]),addGlobalMiddleware:(J)=>WY(()=>{Z.add(J)}),asHttpEffect(){let J=u((Q)=>{let X=new Map(Q.context.mapUnsafe),G=X.get(M.key),K=Y.find(G.method,G.url);if(K===void 0&&G.method==="HEAD")K=Y.find("GET",G.url);if(K===void 0)return g(new l({reason:new v5({request:G})}));let z=K.handler;if(r(z.prefix))X.set(M.key,V2(G,z.prefix.value));X.set(xY.key,K.searchParams),X.set(WZ.key,{route:z,params:K.params});let _=X.get(T1.key);if(_&&_._tag==="Span")_.attribute("http.route",z.path);return J6(z.uninterruptible?z.handler:jJ(z.handler),bY(X))});if(Z.size===0)return J;for(let Q of wJ(Z))J=Q(J);return J}})});function V2(Y,Z){let $=Z.length;return Y.modify({url:Y.url.length<=$?"/":Y.url.slice($)})}var v1=j("effect/http/HttpRouter/RouterConfig",{defaultValue:()=>({})});class WZ extends S()("effect/http/HttpRouter/RouteContext"){}var RJ=L(WZ.asEffect(),(Y)=>Y.params),z2=(Y,Z)=>{let $=f(Y);return ZY((J)=>{let Q=y(J,M),X=y(J,xY),G=y(J,WZ);return U(Q.json,(K)=>$({method:Q.method,url:Q.url,headers:Q.headers,cookies:Q.cookies,pathParams:G.params,searchParams:X,body:K},Z))})},_2=(Y,Z)=>{let $=f(Y);return ZY((J)=>{let Q=y(J,M),X=y(J,xY),G=y(J,WZ);return $({method:Q.method,url:Q.url,headers:Q.headers,cookies:Q.cookies,pathParams:G.params,searchParams:X},Z)})},B2=(Y,Z)=>{let $=f(Y);return ZY((J)=>{let Q=y(J,xY),X=y(J,WZ);return $({...Q,...X.params},Z)})},O2=(Y,Z)=>{let $=f(Y);return U(RJ,(J)=>$(J,Z))},SJ=(Y)=>DZ(U(LY.asEffect(),Y)),D2=(Y,Z,$,J)=>SJ((Q)=>Q.add(Y,Z,$,J)),W2=(Y,Z)=>DZ(i(function*(){let $=FY(Y)?yield*Y:Y,J=yield*LY;if(Z?.prefix)J=J.prefixed(Z.prefix);yield*J.addAll($)})),xZ=pY(LY)(vJ),A2=(Y)=>i(function*(){let Z=yield*Z6(sY(Y,xZ));return y(Z,LY).asHttpEffect()}),LJ="~effect/http/HttpRouter/Route",j1=(Y)=>({...Y,uninterruptible:Y.uninterruptible??!1,prefix:typeof Y.prefix==="string"?b(Y.prefix):Y.prefix??H(),[LJ]:LJ}),gJ=(Y,Z,$,J)=>j1({...J,method:Y,path:Z,handler:AY($)?F($):FY($)?$:U(M.asEffect(),$),uninterruptible:J?.uninterruptible??!1}),U2=(Y)=>Y.endsWith("/")?Y.slice(0,-1):Y,T0=O(2,(Y,Z)=>{if(Z=U2(Z),Y==="*")return`${Z}/*`;else if(Y==="/")return Z;return Z+Y}),CJ=O(2,(Y,Z)=>j1({...Y,path:T0(Y.path,Z),prefix:BY(Y.prefix,{onNone:()=>Z,onSome:($)=>T0($,Z)})})),F2="~effect/http/HttpRouter/Middleware",R1=function(){if(arguments.length===0)return MJ;return MJ(arguments[0],arguments[1])},MJ=(Y,Z)=>Z?.global?DZ(i(function*(){let $=yield*LY,J=FY(Y)?yield*Y:Y;yield*$.addGlobalMiddleware(J)})):new Q6(FY(Y)?$6(L(Y,($)=>bY(new Map([[e5,$]])))):IJ(bY(new Map([[e5,Y]])))),N2=0,e5="effect/http/HttpRouter/MiddlewareFn";class Q6{[F2]={};layerFn;dependencies;constructor(Y,Z){this.layerFn=Y,this.dependencies=Z;let $=`effect/http/HttpRouter/Middleware-${++N2}`;this.layer=$6(i({self:this},function*(){let J=yield*E5(),Q=[J.mapUnsafe.get(e5)];if(this.dependencies){let X=yield*EJ,G=y(J,L0),K=yield*H1(this.dependencies,X,G);Q.push(...bJ(K))}return bY(new Map([[$,Q]]))})).pipe(rY(this.layerFn))}layer;combine(Y){return new Q6(this.layerFn,this.dependencies?sY(this.dependencies,Y.layer):Y.layer)}}var TJ=new WeakMap,bJ=(Y)=>{let Z=TJ.get(Y);if(Z)return Z;let $=HJ(),J=0;for(let[Q,X]of Y.mapUnsafe)if(Q.startsWith("effect/http/HttpRouter/Middleware-")){if($.push(X),X.length>J)J=X.length}if($.length===0)Z=[];else{let Q=new Set;for(let X=J-1;X>=0;X--)for(let G of $)if(X<G.length)Q.add(G[X]);Z=y0(Q).reverse()}return TJ.set(Y,Z),Z},L2=(Y)=>R1(t$(Y),{global:!0}),M2=R1(s$).layer,T2=(Y)=>(Z)=>rY(Z,R1()(i(function*(){let $=yield*Z6(Y);return(J)=>J6(J,$)})).layer),w2=(Y,Z)=>{let $=Z?.middleware;if(Z?.disableLogger!==!0)$=$?Y6($,N0):N0;let J=Z?.routerConfig?rY(xZ,M0(v1)(Z.routerConfig)):xZ;return i(function*(){let X=(yield*LY).asHttpEffect();return $?P1(X,$):P1(X)}).pipe(PJ,sY(Y),rY(J),Z?.disableListenLog?BZ:s5)},H2=(Y,Z)=>{let $=Z?.middleware;if(Z?.disableLogger!==!0)$=$?Y6($,N0):N0;let J=Z?.routerConfig?rY(xZ,M0(v1)(Z.routerConfig)):xZ;return KJ(sY(Y,J),{toHandler:(Q)=>F(y(Q,LY).asHttpEffect()),middleware:$,memoMap:Z?.memoMap})};export{C as Qr,wY as Rr,fZ as Sr,P0 as Tr,mZ as Ur,nJ as Vr,lZ as Wr,c0 as Xr,TZ as Yr,eJ as Zr,$Y as _r,pZ as $r,e0 as as,vZ as bs,s as cs,XX as ds,BX as es,e7 as fs,G1 as gs,X8 as hs,AY as is,t as js,N3 as ks,L3 as ls,M3 as ms,T3 as ns,w3 as os,H3 as ps,oY as qs,c3 as rs,M as ss,xY as ts,I4 as us,P4 as vs,j4 as ws,A0 as xs,z9 as ys,t5 as zs,WZ as As,SJ as Bs,gJ as Cs,T0 as Ds,qJ as Es};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Aq as l,Bq as p,Fq as h,Gq as yQ,Hq as c,Iq as PQ,Jq as MQ,Kq as i,Oq as kQ,Pp as g,Rp as jQ,Vp as RQ,Wp as ZQ,dq as o,iq as xQ,jq as NQ,mq as bQ,qq as f,tq as C}from"./chunk-bf146hz2.js";import{$q as wQ,Qq as e,br as YQ}from"./chunk-t488d66k.js";import"./chunk-cqtkxwd8.js";import"./chunk-srf73nm4.js";import{Pu as Q}from"./chunk-r7xp0xcn.js";import"./chunk-6g3m7yxf.js";import"./chunk-hh4c02fh.js";var _Q="3.0.63",vQ=f(()=>C(Q.object({error:Q.object({code:Q.number().nullable(),message:Q.string(),status:Q.string()})}))),QQ=PQ({errorSchema:vQ,errorToMessage:(X)=>X.error.message}),hQ=Q.union([Q.object({text:Q.string()}),Q.object({inlineData:Q.object({mimeType:Q.string(),data:Q.string()})})]),mQ=f(()=>C(Q.object({outputDimensionality:Q.number().optional(),taskType:Q.enum(["SEMANTIC_SIMILARITY","CLASSIFICATION","CLUSTERING","RETRIEVAL_DOCUMENT","RETRIEVAL_QUERY","QUESTION_ANSWERING","FACT_VERIFICATION","CODE_RETRIEVAL_QUERY"]).optional(),content:Q.array(Q.array(hQ).min(1).nullable()).optional()}))),uQ=class{constructor(X,Y){this.specificationVersion="v3",this.maxEmbeddingsPerCall=2048,this.supportsParallelCalls=!0,this.modelId=X,this.config=Y}get provider(){return this.config.provider}async doEmbed({values:X,headers:Y,abortSignal:Z,providerOptions:$}){let J=await l({provider:"google",providerOptions:$,schema:mQ});if(X.length>this.maxEmbeddingsPerCall)throw new wQ({provider:this.provider,modelId:this.modelId,maxEmbeddingsPerCall:this.maxEmbeddingsPerCall,values:X});let L=g(await c(this.config.headers),Y),H=J==null?void 0:J.content;if(H!=null&&H.length!==X.length)throw Error(`The number of multimodal content entries (${H.length}) must match the number of values (${X.length}).`);if(X.length===1){let U=H==null?void 0:H[0],G=X[0]?[{text:X[0]}]:[],D=U!=null?[...G,...U]:[{text:X[0]}],{responseHeaders:N,value:E,rawValue:q}=await p({url:`${this.config.baseURL}/models/${this.modelId}:embedContent`,headers:L,body:{model:`models/${this.modelId}`,content:{parts:D},outputDimensionality:J==null?void 0:J.outputDimensionality,taskType:J==null?void 0:J.taskType},failedResponseHandler:QQ,successfulResponseHandler:i(dQ),abortSignal:Z,fetch:this.config.fetch});return{warnings:[],embeddings:[E.embedding.values],usage:void 0,response:{headers:N,body:q}}}let{responseHeaders:w,value:V,rawValue:x}=await p({url:`${this.config.baseURL}/models/${this.modelId}:batchEmbedContents`,headers:L,body:{requests:X.map((U,G)=>{let D=H==null?void 0:H[G],N=U?[{text:U}]:[];return{model:`models/${this.modelId}`,content:{role:"user",parts:D!=null?[...N,...D]:[{text:U}]},outputDimensionality:J==null?void 0:J.outputDimensionality,taskType:J==null?void 0:J.taskType}})},failedResponseHandler:QQ,successfulResponseHandler:i(cQ),abortSignal:Z,fetch:this.config.fetch});return{warnings:[],embeddings:V.embeddings.map((U)=>U.values),usage:void 0,response:{headers:w,body:x}}}},cQ=f(()=>C(Q.object({embeddings:Q.array(Q.object({values:Q.array(Q.number())}))}))),dQ=f(()=>C(Q.object({embedding:Q.object({values:Q.array(Q.number())})})));function AQ(X){var Y,Z,$,J;if(X==null)return{inputTokens:{total:void 0,noCache:void 0,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:void 0,text:void 0,reasoning:void 0},raw:void 0};let L=(Y=X.promptTokenCount)!=null?Y:0,H=(Z=X.candidatesTokenCount)!=null?Z:0,w=($=X.cachedContentTokenCount)!=null?$:0,V=(J=X.thoughtsTokenCount)!=null?J:0;return{inputTokens:{total:L,noCache:L-w,cacheRead:w,cacheWrite:void 0},outputTokens:{total:H+V,text:H,reasoning:V},raw:X}}function u(X,Y=!0){if(X==null)return;if(gQ(X)){if(Y)return;if(typeof X==="object"&&X.description)return{type:"object",description:X.description};return{type:"object"}}if(typeof X==="boolean")return{type:"boolean",properties:{}};let{type:Z,description:$,required:J,properties:L,items:H,allOf:w,anyOf:V,oneOf:x,format:U,const:G,minLength:D,enum:N}=X,E={};if($)E.description=$;if(J)E.required=J;if(U)E.format=U;if(G!==void 0)E.enum=[G];if(Z)if(Array.isArray(Z)){let q=Z.includes("null"),j=Z.filter((B)=>B!=="null");if(j.length===0)E.type="null";else if(E.anyOf=j.map((B)=>({type:B})),q)E.nullable=!0}else E.type=Z;if(N!==void 0)E.enum=N;if(L!=null)E.properties=Object.entries(L).reduce((q,[j,B])=>{return q[j]=u(B,!1),q},{});if(H)E.items=Array.isArray(H)?H.map((q)=>u(q,!1)):u(H,!1);if(w)E.allOf=w.map((q)=>u(q,!1));if(V)if(V.some((q)=>typeof q==="object"&&(q==null?void 0:q.type)==="null")){let q=V.filter((j)=>!(typeof j==="object"&&(j==null?void 0:j.type)==="null"));if(q.length===1){let j=u(q[0],!1);if(typeof j==="object")E.nullable=!0,Object.assign(E,j)}else E.anyOf=q.map((j)=>u(j,!1)),E.nullable=!0}else E.anyOf=V.map((q)=>u(q,!1));if(x)E.oneOf=x.map((q)=>u(q,!1));if(D!==void 0)E.minLength=D;return E}function gQ(X){return X!=null&&typeof X==="object"&&X.type==="object"&&(X.properties==null||Object.keys(X.properties).length===0)&&!X.additionalProperties}var pQ=/^data:([^;,]+);base64,(.+)$/s;function iQ(X){let Y=pQ.exec(X);if(Y==null)return;return{mediaType:Y[1],data:Y[2]}}function lQ(X){let Y=iQ(X);if(Y==null)return;return{inlineData:{mimeType:Y.mediaType,data:Y.data}}}function sQ(X,Y,Z){let $=[],J=[];for(let L of Z)switch(L.type){case"text":{J.push(L.text);break}case"image-data":case"file-data":{$.push({inlineData:{mimeType:L.mediaType,data:L.data}});break}case"image-url":case"file-url":{let H=lQ(L.url);if(H!=null)$.push(H);else J.push(JSON.stringify(L));break}default:{J.push(JSON.stringify(L));break}}X.push({functionResponse:{name:Y,response:{name:Y,content:J.length>0?J.join(`
|
|
3
3
|
`):"Tool executed successfully."},...$.length>0?{parts:$}:{}}})}function nQ(X,Y,Z){for(let $ of Z)switch($.type){case"text":X.push({functionResponse:{name:Y,response:{name:Y,content:$.text}}});break;case"image-data":X.push({inlineData:{mimeType:String($.mediaType),data:String($.data)}},{text:"Tool executed successfully and returned this image as a response"});break;default:X.push({text:JSON.stringify($)});break}}function aQ(X,Y){var Z,$,J,L,H,w,V,x;let U=[],G=[],D=!0,N=(Z=Y==null?void 0:Y.isGemmaModel)!=null?Z:!1,E=($=Y==null?void 0:Y.providerOptionsName)!=null?$:"google",q=(J=Y==null?void 0:Y.supportsFunctionResponseParts)!=null?J:!0;for(let{role:j,content:B}of X)switch(j){case"system":{if(!D)throw new YQ({functionality:"system messages are only supported at the beginning of the conversation"});U.push({text:B});break}case"user":{D=!1;let K=[];for(let F of B)switch(F.type){case"text":{K.push({text:F.text});break}case"file":{let b=F.mediaType==="image/*"?"image/jpeg":F.mediaType;K.push(F.data instanceof URL?{fileData:{mimeType:b,fileUri:F.data.toString()}}:{inlineData:{mimeType:b,data:ZQ(F.data)}});break}}G.push({role:"user",parts:K});break}case"assistant":{D=!1,G.push({role:"model",parts:B.map((K)=>{var F,b,S,k;let z=(k=(F=K.providerOptions)==null?void 0:F[E])!=null?k:E!=="google"?(b=K.providerOptions)==null?void 0:b.google:(S=K.providerOptions)==null?void 0:S.vertex,y=(z==null?void 0:z.thoughtSignature)!=null?String(z.thoughtSignature):void 0;switch(K.type){case"text":return K.text.length===0?void 0:{text:K.text,thoughtSignature:y};case"reasoning":return K.text.length===0?void 0:{text:K.text,thought:!0,thoughtSignature:y};case"file":{if(K.data instanceof URL)throw new YQ({functionality:"File data URLs in assistant messages are not supported"});return{inlineData:{mimeType:K.mediaType,data:ZQ(K.data)},...(z==null?void 0:z.thought)===!0?{thought:!0}:{},thoughtSignature:y}}case"tool-call":{let P=(z==null?void 0:z.serverToolCallId)!=null?String(z.serverToolCallId):void 0,O=(z==null?void 0:z.serverToolType)!=null?String(z.serverToolType):void 0;if(P&&O)return{toolCall:{toolType:O,args:typeof K.input==="string"?JSON.parse(K.input):K.input,id:P},thoughtSignature:y};return{functionCall:{name:K.toolName,args:K.input},thoughtSignature:y}}case"tool-result":{let P=(z==null?void 0:z.serverToolCallId)!=null?String(z.serverToolCallId):void 0,O=(z==null?void 0:z.serverToolType)!=null?String(z.serverToolType):void 0;if(P&&O)return{toolResponse:{toolType:O,response:K.output.type==="json"?K.output.value:{},id:P},thoughtSignature:y};return}}}).filter((K)=>K!==void 0)});break}case"tool":{D=!1;let K=[];for(let F of B){if(F.type==="tool-approval-response")continue;let b=(V=(L=F.providerOptions)==null?void 0:L[E])!=null?V:E!=="google"?(H=F.providerOptions)==null?void 0:H.google:(w=F.providerOptions)==null?void 0:w.vertex,S=(b==null?void 0:b.serverToolCallId)!=null?String(b.serverToolCallId):void 0,k=(b==null?void 0:b.serverToolType)!=null?String(b.serverToolType):void 0;if(S&&k){let y=(b==null?void 0:b.thoughtSignature)!=null?String(b.thoughtSignature):void 0;if(G.length>0){let P=G[G.length-1];if(P.role==="model"){P.parts.push({toolResponse:{toolType:k,response:F.output.type==="json"?F.output.value:{},id:S},thoughtSignature:y});continue}}}let z=F.output;if(z.type==="content")if(q)sQ(K,F.toolName,z.value);else nQ(K,F.toolName,z.value);else K.push({functionResponse:{name:F.toolName,response:{name:F.toolName,content:z.type==="execution-denied"?(x=z.reason)!=null?x:"Tool execution denied.":z.value}}})}G.push({role:"user",parts:K});break}}if(N&&U.length>0&&G.length>0&&G[0].role==="user"){let j=U.map((B)=>B.text).join(`
|
|
4
4
|
|
|
5
5
|
`);G[0].parts.unshift({text:j+`
|