ot-gateway 0.9.0 → 0.11.0
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/VERSION +1 -1
- package/apps/gateway/src/main.mjs +683 -211
- package/apps/web/out/404/index.html +1 -0
- package/apps/web/out/404.html +1 -1
- package/apps/web/out/__next.__PAGE__.txt +28 -26
- package/apps/web/out/__next._full.txt +23 -21
- package/apps/web/out/__next._tree.txt +2 -2
- package/apps/web/out/_next/static/chunks/03_syxbyimnor.js +1 -0
- package/apps/web/out/_next/static/chunks/1-_c1aqhwim5t.css +1 -0
- package/apps/web/out/_next/static/chunks/10i96w66fwhkr.js +31 -0
- package/apps/web/out/_next/static/chunks/1bh2-eknm9t8k.js +1 -0
- package/apps/web/out/_next/static/chunks/259s9pubapqip.js +1 -0
- package/apps/web/out/_next/static/chunks/25dqruymh00rk.js +1 -0
- package/apps/web/out/_next/static/chunks/2r_w-j--qdreu.js +22 -0
- package/apps/web/out/_next/static/chunks/3b0ql-jh_xg_k.js +12 -0
- package/apps/web/out/_next/static/chunks/3o5cr1y-sws-u.js +1 -0
- package/apps/web/out/_not-found/__next._full.txt +21 -19
- package/apps/web/out/_not-found/__next._not-found.__PAGE__.txt +27 -25
- package/apps/web/out/_not-found/__next._tree.txt +2 -2
- package/apps/web/out/_not-found/index.html +1 -0
- package/apps/web/out/_not-found/index.txt +22 -0
- package/apps/web/out/index.html +1 -1
- package/apps/web/out/index.txt +23 -21
- package/apps/web/out/messages/__next._full.txt +27 -0
- package/apps/web/out/messages/__next._tree.txt +4 -0
- package/apps/web/out/messages/__next.messages.__PAGE__.txt +33 -0
- package/apps/web/out/messages/index.html +1 -0
- package/apps/web/out/messages/index.txt +27 -0
- package/apps/web/out/points/__next._full.txt +27 -0
- package/apps/web/out/points/__next._tree.txt +4 -0
- package/apps/web/out/points/__next.points.__PAGE__.txt +33 -0
- package/apps/web/out/points/index.html +1 -0
- package/apps/web/out/points/index.txt +27 -0
- package/apps/web/out/settings/__next._full.txt +27 -0
- package/apps/web/out/settings/__next._tree.txt +4 -0
- package/apps/web/out/settings/__next.settings.__PAGE__.txt +33 -0
- package/apps/web/out/settings/index.html +1 -0
- package/apps/web/out/settings/index.txt +27 -0
- package/examples/gateway.json +37 -37
- package/package.json +1 -1
- package/packaging/compose.yaml +4 -2
- package/apps/web/out/_next/static/chunks/0csls39kpdzgy.js +0 -22
- package/apps/web/out/_next/static/chunks/162tvyao0-i49.js +0 -12
- package/apps/web/out/_next/static/chunks/29-6f2cs5ih9t.css +0 -1
- package/apps/web/out/_next/static/chunks/3oyy-mvhhfmq3.js +0 -31
- package/apps/web/out/_not-found.html +0 -1
- package/apps/web/out/_not-found.txt +0 -20
- /package/apps/web/out/_next/static/{POtpNv-gjWNowyFSmxfAr → r5hL3CDxDJkHMarR92YKm}/_buildManifest.js +0 -0
- /package/apps/web/out/_next/static/{POtpNv-gjWNowyFSmxfAr → r5hL3CDxDJkHMarR92YKm}/_clientMiddlewareManifest.js +0 -0
- /package/apps/web/out/_next/static/{POtpNv-gjWNowyFSmxfAr → r5hL3CDxDJkHMarR92YKm}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,81081,e=>{"use strict";e.i(66563);var t=e.i(71658);let r=(e,t)=>{let r=t.toLowerCase().split(/\s+/).filter(e=>""!==e),n=e.toLowerCase();return r.every(e=>n.includes(e))},n=4e3;e.s(["k",0,(e,r={maxKeys:t.b,maxChars:n})=>{let i=[],s=[],a=0;for(let t of e)s.length>0&&(s.length>=r.maxKeys||a+t.length+1>r.maxChars)&&(i.push(s),s=[],a=0),s.push(t),a+=t.length+1;return s.length>0&&i.push(s),i},"d",0,e=>new Map((e?.devices??[]).map(e=>[e.id,e])),"M",0,e=>{let t=new Map;for(let r of e.points)t.set(r.device,(t.get(r.device)??0)+1);return[...t].map(([e,t])=>({id:e,points:t}))},"l",0,e=>{let t=new URLSearchParams(e),r=t.get("point");return{filter:{query:t.get("q")??"",device:t.get("device")??""},...null===r?{}:{open:r}}},"r",0,(e,t)=>{let r=new URLSearchParams;""!==e.query&&r.set("q",e.query),""!==e.device&&r.set("device",e.device),void 0!==t&&r.set("point",t);let n=r.toString();return""===n?"":`?${n}`},"u",0,(e,t)=>(""===t.device||e.device===t.device)&&r([e.device,e.id,e.name,e.topic,e.source,e.unit??"",e.brick??"",...e.haystack??[]].join(" "),t.query),"w",0,r,"Z",0,e=>`${e.device}/${e.id}`,"x",0,(e,t)=>{let r=new Map(e);for(let e of t)r.set(`${e.device}/${e.point}`,e);return r}])},89486,e=>{"use strict";e.i(66563);var t=e.i(71658),r=e.i(24775),n=e.i(69598),i=e.i(12310),s=e.i(50492),a=e.i(87486),o=e.i(12379),l=e.i(83453),u=e.i(97490),c=e.i(40770),f=e.i(92387),d=e.i(20412),h=e.i(26547),p=e.i(27195),g=e.i(84279),m=e.i(81081);class b extends d.f.TaggedError()("StatusUnavailable",{message:h.f.String}){}let y=g.f.make(t.K,{baseUrl:window.location.origin}),v=e=>e.pipe(a.f.mapError(e=>new b({message:e.message})),o.f.timeoutOrElse({duration:"3 seconds",orElse:()=>s.f.fail(new b({message:"no answer within 3 s"}))})),x=y.pipe(l.f.flatMap(e=>e.status.status({query:{points:"none"}})),u.f.provide(p.f.layer),v),w=y.pipe(l.f.flatMap(e=>e.status.messages()),u.f.provide(p.f.layer),v),S=y.pipe(l.f.flatMap(e=>e.status.points()),u.f.provide(p.f.layer),v),k=y.pipe(l.f.flatMap(e=>e.status.config()),u.f.provide(p.f.layer),v),E={DEG_C:"°C",DEG_F:"°F",PERCENT:"%",KiloW:"kW",W:"W","KiloW-HR":"kWh",V:"V",A:"A",PA:"Pa",BAR:"bar","M3-PER-HR":"m³/h","L-PER-SEC":"l/s",PPM:"ppm"},_=(e,t)=>{if("failing"===e.status)return{_tag:"failing",reason:e.reason??"failing",lastSuccess:e.lastSuccess};if("starting"===e.status)return{_tag:"starting"};let r=Math.max(3*e.pollIntervalMs,15e3);return void 0!==e.lastSuccess&&t-e.lastSuccess<=r?{_tag:"live"}:{_tag:"late",lastSuccess:e.lastSuccess}},C={timeout:"no reply",connection:"cannot connect",protocol:"protocol error","invalid-response":"bad reply",configuration:"config error","not-implemented":"not supported","cycle-timeout":"read hangs"},A={failing:0,late:1,starting:2,live:3};e.s(["i",0,b,"f",0,(e,t)=>e.map((e,r)=>({device:e,index:r,rank:A[_(e,t)._tag]})).toSorted((e,t)=>e.rank-t.rank||e.index-t.index).map(({device:e})=>e),"w",0,(e,t)=>{let r=new Date(e),n=r.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"});return r.toDateString()===new Date(t).toDateString()?n:`${r.toLocaleDateString([],{month:"short",day:"numeric"})} ${n}`},"M",0,e=>{let t=e/1e3;return t<60?`every ${Number(t.toFixed(1))} s`:t<3600?`every ${Number((t/60).toFixed(1))} min`:`every ${Number((t/3600).toFixed(1))} h`},"F",0,e=>C[e]??e,"q",0,k,"x",0,w,"n",0,S,"Z",0,x,"P",0,e=>y.pipe(l.f.flatMap(t=>c.f.forEach((0,m.k)(e),e=>t.status.values({query:{points:e.join(",")}}),{concurrency:4})),f.f.map(e=>e.flatMap(e=>e.readings)),u.f.provide(p.f.layer),v),"r",0,(e,t)=>{let r=e/t*100;return r<1?`${Math.max(r,.1).toFixed(1)} %`:`${Math.round(r)} %`},"L",0,e=>{let t=["B","KB","MB","GB","TB"],r=e,n=0;for(;r>=1e3&&n<t.length-1;)r/=1e3,n++;return`${r>=100||0===n?Math.round(r):r.toFixed(1)} ${t[n]}`},"z",0,e=>void 0===e?"–":"boolean"==typeof e?e?"on":"off":Math.abs(e)>=1e3||Number.isInteger(e)?e.toLocaleString():e.toFixed(2),"g",0,_,"T",0,{"modbus-tcp":"Modbus TCP","bacnet-ip":"BACnet/IP",simulator:"Simulated"},"I",0,e=>r.f.runPromise(n.f.result(e.pipe(i.f.catchDefect(e=>s.f.fail(new b({message:e instanceof Error?e.message:"unexpected error"})))))),"K",0,(e,t)=>{if(void 0===e)return"never";let r=Math.max(0,(t-e)/1e3);return r<60?"under a minute":r<3600?`${Math.floor(r/60)} min`:r<86400?`${Math.floor(r/3600)} h`:`${Math.floor(r/86400)} d`},"D",0,e=>{let t=e.split("/");return"$gateway"===t[2]&&"health"===t[4]?"health":4===t.length?"value":5===t.length&&"$meta"===t[4]?"metadata":6===t.length&&"$set"===t[4]&&"result"===t[5]?"command result":"other"},"E",0,e=>{if(void 0===e)return"";let t=e.replace(/^unit:/,"");return E[t]??t}])},52088,7284,5843,20612,4523,56999,88534,39916,47773,11634,41793,4270,89555,5839,86501,40264,94249,73798,94831,26547,20412,57732,91642,81315,91889,34087,80479,85266,56523,68429,35905,18244,53725,74892,63002,44322,71658,66563,e=>{"use strict";let t,r,n,i,s,a,o,l,u,c,f,d,h,p,g,m,b,y,v,x,w,S,k,E,_,C,A,I,T,O,N,M,U,$,j;function B(){for(var e,t,r=0,n="",i=arguments.length;r<i;r++)(e=arguments[r])&&(t=function e(t){var r,n,i="";if("string"==typeof t||"number"==typeof t)i+=t;else if("object"==typeof t)if(Array.isArray(t)){var s=t.length;for(r=0;r<s;r++)t[r]&&(n=e(t[r]))&&(i&&(i+=" "),i+=n)}else for(n in t)t[n]&&(i&&(i+=" "),i+=n);return i}(e))&&(n&&(n+=" "),n+=t);return n}e.s(["f",0,B],7284);let P=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),R=[],L=(e,t,r)=>{if(0==e.length-t)return r.classGroupId;let n=e[t],i=r.nextPart.get(n);if(i){let r=L(e,t+1,i);if(r)return r}let s=r.validators;if(null===s)return;let a=0===t?e.join("-"):e.slice(t).join("-"),o=s.length;for(let e=0;e<o;e++){let t=s[e];if(t.validator(a))return t.classGroupId}},F=(e,t)=>{let r=P();for(let n in e)D(e[n],r,n,t);return r},D=(e,t,r,n)=>{let i=e.length;for(let s=0;s<i;s++)z(e[s],t,r,n)},z=(e,t,r,n)=>{"string"==typeof e?H(e,t,r):"function"==typeof e?J(e,t,r,n):W(e,t,r,n)},H=(e,t,r)=>{(""===e?t:q(t,e)).classGroupId=r},J=(e,t,r,n)=>{K(e)?D(e(n),t,r,n):(null===t.validators&&(t.validators=[]),t.validators.push({classGroupId:r,validator:e}))},W=(e,t,r,n)=>{let i=Object.entries(e),s=i.length;for(let e=0;e<s;e++){let[s,a]=i[e];D(a,q(t,s),r,n)}},q=(e,t)=>{let r=e,n=t.split("-"),i=n.length;for(let e=0;e<i;e++){let t=n[e],i=r.nextPart.get(t);i||(i=P(),r.nextPart.set(t,i)),r=i}return r},K=e=>"isThemeGetter"in e&&!0===e.isThemeGetter,V=[],G=(e,t,r,n,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:i}),Y=/\s+/,Z=e=>{let t;if("string"==typeof e)return e;let r="";for(let n=0;n<e.length;n++)e[n]&&(t=Z(e[n]))&&(r&&(r+=" "),r+=t);return r},X=[],Q=e=>{let t=t=>t[e]||X;return t.isThemeGetter=!0,t.themeKey=e,t},ee=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,et=/^\((?:(\w[\w-]*):)?(.+)\)$/i,er=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,en=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ei=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,es=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,ea=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,eo=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,el=e=>er.test(e),eu=e=>!!e&&!Number.isNaN(Number(e)),ec=e=>!!e&&Number.isInteger(Number(e)),ef=e=>e.endsWith("%")&&eu(e.slice(0,-1)),ed=e=>en.test(e),eh=()=>!0,ep=e=>ei.test(e)&&!es.test(e),eg=()=>!1,em=e=>ea.test(e),eb=e=>eo.test(e),ey=e=>!ew(e)&&!eT(e),ev=e=>e.startsWith("@container")&&("/"===e[10]&&void 0!==e[11]||"s"===e[11]&&void 0!==e[16]&&e.startsWith("-size/",10)||"n"===e[11]&&void 0!==e[18]&&e.startsWith("-normal/",10)),ex=e=>eP(e,eD,eg),ew=e=>ee.test(e),eS=e=>eP(e,ez,ep),ek=e=>eP(e,eH,eu),eE=e=>eP(e,eW,eh),e_=e=>eP(e,eJ,eg),eC=e=>eP(e,eL,eg),eA=e=>eP(e,eF,eb),eI=e=>eP(e,eq,em),eT=e=>et.test(e),eO=e=>eR(e,ez),eN=e=>eR(e,eJ),eM=e=>eR(e,eL),eU=e=>eR(e,eD),e$=e=>eR(e,eF),ej=e=>eR(e,eq,!0),eB=e=>eR(e,eW,!0),eP=(e,t,r)=>{let n=ee.exec(e);return!!n&&(n[1]?t(n[1]):r(n[2]))},eR=(e,t,r=!1)=>{let n=et.exec(e);return!!n&&(n[1]?t(n[1]):r)},eL=e=>"position"===e||"percentage"===e,eF=e=>"image"===e||"url"===e,eD=e=>"length"===e||"size"===e||"bg-size"===e,ez=e=>"length"===e,eH=e=>"number"===e,eJ=e=>"family-name"===e,eW=e=>"number"===e||"weight"===e,eq=e=>"shadow"===e,eK=(Ee=()=>{let e=Q("color"),t=Q("font"),r=Q("text"),n=Q("font-weight"),i=Q("tracking"),s=Q("leading"),a=Q("breakpoint"),o=Q("container"),l=Q("spacing"),u=Q("radius"),c=Q("shadow"),f=Q("inset-shadow"),d=Q("text-shadow"),h=Q("drop-shadow"),p=Q("blur"),g=Q("perspective"),m=Q("aspect"),b=Q("ease"),y=Q("animate"),v=()=>["auto","avoid","all","avoid-page","page","left","right","column"],x=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],w=()=>[...x(),eT,ew],S=()=>["auto","hidden","clip","visible","scroll"],k=()=>["auto","contain","none"],E=()=>[eT,ew,l],_=()=>[el,"full","auto",...E()],C=()=>[ec,"none","subgrid",eT,ew],A=()=>["auto",{span:["full",ec,eT,ew]},ec,eT,ew],I=()=>[ec,"auto",eT,ew],T=()=>["auto","min","max","fr",eT,ew],O=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],N=()=>["start","end","center","stretch","center-safe","end-safe"],M=()=>["auto",...E()],U=()=>[el,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...E()],$=()=>[o,el,"screen","full","dvw","lvw","svw","min","max","fit",...E()],j=()=>[el,"screen","full","lh","dvh","lvh","svh","min","max","fit",...E()],B=()=>[e,eT,ew],P=()=>[...x(),eM,eC,{position:[eT,ew]}],R=()=>["no-repeat",{repeat:["","x","y","space","round"]}],L=()=>["auto","cover","contain",eU,ex,{size:[eT,ew]}],F=()=>[ef,eO,eS],D=()=>["","none","full",u,eT,ew],z=()=>["",eu,eO,eS],H=()=>["solid","dashed","dotted","double"],J=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],W=()=>[eu,ef,eM,eC],q=()=>["","none",p,eT,ew],K=()=>["none",eu,eT,ew],V=()=>["none",eu,eT,ew],G=()=>[eu,eT,ew],Y=()=>[el,"full",...E()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ed],breakpoint:[ed],color:[eh],container:[ed],"drop-shadow":[ed],ease:["in","out","in-out"],font:[ey],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ed],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ed],shadow:[ed],spacing:["px",eu],text:[ed],"text-shadow":[ed],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",el,ew,eT,m]}],container:["container"],"container-type":[{"@container":["","normal","size",eT,ew]}],"container-named":[ev],columns:[{columns:[eu,"auto",ew,eT,o]}],"break-after":[{"break-after":v()}],"break-before":[{"break-before":v()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:w()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:_()}],"inset-x":[{"inset-x":_()}],"inset-y":[{"inset-y":_()}],start:[{"inset-s":_(),start:_()}],end:[{"inset-e":_(),end:_()}],"inset-bs":[{"inset-bs":_()}],"inset-be":[{"inset-be":_()}],top:[{top:_()}],right:[{right:_()}],bottom:[{bottom:_()}],left:[{left:_()}],visibility:["visible","invisible","collapse"],z:[{z:[ec,"auto",eT,ew]}],basis:[{basis:[el,"full","auto",o,...E()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[eu,el,"auto","initial","none",ew]}],grow:[{grow:["",eu,eT,ew]}],shrink:[{shrink:["",eu,eT,ew]}],order:[{order:[ec,"first","last","none",eT,ew]}],"grid-cols":[{"grid-cols":C()}],"col-start-end":[{col:A()}],"col-start":[{"col-start":I()}],"col-end":[{"col-end":I()}],"grid-rows":[{"grid-rows":C()}],"row-start-end":[{row:A()}],"row-start":[{"row-start":I()}],"row-end":[{"row-end":I()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":T()}],"auto-rows":[{"auto-rows":T()}],gap:[{gap:E()}],"gap-x":[{"gap-x":E()}],"gap-y":[{"gap-y":E()}],"justify-content":[{justify:[...O(),"normal"]}],"justify-items":[{"justify-items":[...N(),"normal"]}],"justify-self":[{"justify-self":["auto",...N()]}],"align-content":[{content:["normal",...O()]}],"align-items":[{items:[...N(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...N(),{baseline:["","last"]}]}],"place-content":[{"place-content":O()}],"place-items":[{"place-items":[...N(),"baseline"]}],"place-self":[{"place-self":["auto",...N()]}],p:[{p:E()}],px:[{px:E()}],py:[{py:E()}],ps:[{ps:E()}],pe:[{pe:E()}],pbs:[{pbs:E()}],pbe:[{pbe:E()}],pt:[{pt:E()}],pr:[{pr:E()}],pb:[{pb:E()}],pl:[{pl:E()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":E()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":E()}],"space-y-reverse":["space-y-reverse"],size:[{size:U()}],"inline-size":[{inline:["auto",...$()]}],"min-inline-size":[{"min-inline":["auto",...$()]}],"max-inline-size":[{"max-inline":["none",...$()]}],"block-size":[{block:["auto",...j()]}],"min-block-size":[{"min-block":["auto",...j()]}],"max-block-size":[{"max-block":["none",...j()]}],w:[{w:[o,"screen",...U()]}],"min-w":[{"min-w":[o,"screen","none",...U()]}],"max-w":[{"max-w":[o,"screen","none","prose",{screen:[a]},...U()]}],h:[{h:["screen","lh",...U()]}],"min-h":[{"min-h":["screen","lh","none",...U()]}],"max-h":[{"max-h":["screen","lh","none",...U()]}],"font-size":[{text:["base",r,eO,eS]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,eB,eE]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ef,ew]}],"font-family":[{font:[eN,e_,t]}],"font-features":[{"font-features":[ew]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,eT,ew]}],"line-clamp":[{"line-clamp":[eu,"none",eT,ek]}],leading:[{leading:["none",s,...E()]}],"list-image":[{"list-image":["none",eT,ew]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",eT,ew]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:B()}],"text-color":[{text:B()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...H(),"wavy"]}],"text-decoration-thickness":[{decoration:[eu,"from-font","auto",eT,eS]}],"text-decoration-color":[{decoration:B()}],"underline-offset":[{"underline-offset":[eu,"auto",eT,ew]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:E()}],"tab-size":[{tab:[ec,eT,ew]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",eT,ew]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",eT,ew]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:P()}],"bg-repeat":[{bg:R()}],"bg-size":[{bg:L()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ec,eT,ew],radial:["",eT,ew],conic:["",ec,eT,ew]},e$,eA]}],"bg-color":[{bg:B()}],"gradient-from-pos":[{from:F()}],"gradient-via-pos":[{via:F()}],"gradient-to-pos":[{to:F()}],"gradient-from":[{from:B()}],"gradient-via":[{via:B()}],"gradient-to":[{to:B()}],rounded:[{rounded:D()}],"rounded-s":[{"rounded-s":D()}],"rounded-e":[{"rounded-e":D()}],"rounded-t":[{"rounded-t":D()}],"rounded-r":[{"rounded-r":D()}],"rounded-b":[{"rounded-b":D()}],"rounded-l":[{"rounded-l":D()}],"rounded-ss":[{"rounded-ss":D()}],"rounded-se":[{"rounded-se":D()}],"rounded-ee":[{"rounded-ee":D()}],"rounded-es":[{"rounded-es":D()}],"rounded-tl":[{"rounded-tl":D()}],"rounded-tr":[{"rounded-tr":D()}],"rounded-br":[{"rounded-br":D()}],"rounded-bl":[{"rounded-bl":D()}],"border-w":[{border:z()}],"border-w-x":[{"border-x":z()}],"border-w-y":[{"border-y":z()}],"border-w-s":[{"border-s":z()}],"border-w-e":[{"border-e":z()}],"border-w-bs":[{"border-bs":z()}],"border-w-be":[{"border-be":z()}],"border-w-t":[{"border-t":z()}],"border-w-r":[{"border-r":z()}],"border-w-b":[{"border-b":z()}],"border-w-l":[{"border-l":z()}],"divide-x":[{"divide-x":z()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":z()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...H(),"hidden","none"]}],"divide-style":[{divide:[...H(),"hidden","none"]}],"border-color":[{border:B()}],"border-color-x":[{"border-x":B()}],"border-color-y":[{"border-y":B()}],"border-color-s":[{"border-s":B()}],"border-color-e":[{"border-e":B()}],"border-color-bs":[{"border-bs":B()}],"border-color-be":[{"border-be":B()}],"border-color-t":[{"border-t":B()}],"border-color-r":[{"border-r":B()}],"border-color-b":[{"border-b":B()}],"border-color-l":[{"border-l":B()}],"divide-color":[{divide:B()}],"outline-style":[{outline:[...H(),"none","hidden"]}],"outline-offset":[{"outline-offset":[eu,eT,ew]}],"outline-w":[{outline:["",eu,eO,eS]}],"outline-color":[{outline:B()}],shadow:[{shadow:["","inner","none",c,ej,eI]}],"shadow-color":[{shadow:B()}],"inset-shadow":[{"inset-shadow":["none",f,ej,eI]}],"inset-shadow-color":[{"inset-shadow":B()}],"ring-w":[{ring:z()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:B()}],"ring-offset-w":[{"ring-offset":[eu,eS]}],"ring-offset-color":[{"ring-offset":B()}],"inset-ring-w":[{"inset-ring":z()}],"inset-ring-color":[{"inset-ring":B()}],"text-shadow":[{"text-shadow":["none",d,ej,eI]}],"text-shadow-color":[{"text-shadow":B()}],opacity:[{opacity:[eu,eT,ew]}],"mix-blend":[{"mix-blend":[...J(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":J()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[eu]}],"mask-image-linear-from-pos":[{"mask-linear-from":W()}],"mask-image-linear-to-pos":[{"mask-linear-to":W()}],"mask-image-linear-from-color":[{"mask-linear-from":B()}],"mask-image-linear-to-color":[{"mask-linear-to":B()}],"mask-image-t-from-pos":[{"mask-t-from":W()}],"mask-image-t-to-pos":[{"mask-t-to":W()}],"mask-image-t-from-color":[{"mask-t-from":B()}],"mask-image-t-to-color":[{"mask-t-to":B()}],"mask-image-r-from-pos":[{"mask-r-from":W()}],"mask-image-r-to-pos":[{"mask-r-to":W()}],"mask-image-r-from-color":[{"mask-r-from":B()}],"mask-image-r-to-color":[{"mask-r-to":B()}],"mask-image-b-from-pos":[{"mask-b-from":W()}],"mask-image-b-to-pos":[{"mask-b-to":W()}],"mask-image-b-from-color":[{"mask-b-from":B()}],"mask-image-b-to-color":[{"mask-b-to":B()}],"mask-image-l-from-pos":[{"mask-l-from":W()}],"mask-image-l-to-pos":[{"mask-l-to":W()}],"mask-image-l-from-color":[{"mask-l-from":B()}],"mask-image-l-to-color":[{"mask-l-to":B()}],"mask-image-x-from-pos":[{"mask-x-from":W()}],"mask-image-x-to-pos":[{"mask-x-to":W()}],"mask-image-x-from-color":[{"mask-x-from":B()}],"mask-image-x-to-color":[{"mask-x-to":B()}],"mask-image-y-from-pos":[{"mask-y-from":W()}],"mask-image-y-to-pos":[{"mask-y-to":W()}],"mask-image-y-from-color":[{"mask-y-from":B()}],"mask-image-y-to-color":[{"mask-y-to":B()}],"mask-image-radial":[{"mask-radial":[eT,ew]}],"mask-image-radial-from-pos":[{"mask-radial-from":W()}],"mask-image-radial-to-pos":[{"mask-radial-to":W()}],"mask-image-radial-from-color":[{"mask-radial-from":B()}],"mask-image-radial-to-color":[{"mask-radial-to":B()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":x()}],"mask-image-conic-pos":[{"mask-conic":[eu]}],"mask-image-conic-from-pos":[{"mask-conic-from":W()}],"mask-image-conic-to-pos":[{"mask-conic-to":W()}],"mask-image-conic-from-color":[{"mask-conic-from":B()}],"mask-image-conic-to-color":[{"mask-conic-to":B()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:P()}],"mask-repeat":[{mask:R()}],"mask-size":[{mask:L()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",eT,ew]}],filter:[{filter:["","none",eT,ew]}],blur:[{blur:q()}],brightness:[{brightness:[eu,eT,ew]}],contrast:[{contrast:[eu,eT,ew]}],"drop-shadow":[{"drop-shadow":["","none",h,ej,eI]}],"drop-shadow-color":[{"drop-shadow":B()}],grayscale:[{grayscale:["",eu,eT,ew]}],"hue-rotate":[{"hue-rotate":[eu,eT,ew]}],invert:[{invert:["",eu,eT,ew]}],saturate:[{saturate:[eu,eT,ew]}],sepia:[{sepia:["",eu,eT,ew]}],"backdrop-filter":[{"backdrop-filter":["","none",eT,ew]}],"backdrop-blur":[{"backdrop-blur":q()}],"backdrop-brightness":[{"backdrop-brightness":[eu,eT,ew]}],"backdrop-contrast":[{"backdrop-contrast":[eu,eT,ew]}],"backdrop-grayscale":[{"backdrop-grayscale":["",eu,eT,ew]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[eu,eT,ew]}],"backdrop-invert":[{"backdrop-invert":["",eu,eT,ew]}],"backdrop-opacity":[{"backdrop-opacity":[eu,eT,ew]}],"backdrop-saturate":[{"backdrop-saturate":[eu,eT,ew]}],"backdrop-sepia":[{"backdrop-sepia":["",eu,eT,ew]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":E()}],"border-spacing-x":[{"border-spacing-x":E()}],"border-spacing-y":[{"border-spacing-y":E()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",eT,ew]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[eu,"initial",eT,ew]}],ease:[{ease:["linear","initial",b,eT,ew]}],delay:[{delay:[eu,eT,ew]}],animate:[{animate:["none",y,eT,ew]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[g,eT,ew]}],"perspective-origin":[{"perspective-origin":w()}],rotate:[{rotate:K()}],"rotate-x":[{"rotate-x":K()}],"rotate-y":[{"rotate-y":K()}],"rotate-z":[{"rotate-z":K()}],scale:[{scale:V()}],"scale-x":[{"scale-x":V()}],"scale-y":[{"scale-y":V()}],"scale-z":[{"scale-z":V()}],"scale-3d":["scale-3d"],skew:[{skew:G()}],"skew-x":[{"skew-x":G()}],"skew-y":[{"skew-y":G()}],transform:[{transform:[eT,ew,"","none","gpu","cpu"]}],"transform-origin":[{origin:w()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Y()}],"translate-x":[{"translate-x":Y()}],"translate-y":[{"translate-y":Y()}],"translate-z":[{"translate-z":Y()}],"translate-none":["translate-none"],zoom:[{zoom:[ec,eT,ew]}],accent:[{accent:B()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:B()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",eT,ew]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":B()}],"scrollbar-track-color":[{"scrollbar-track":B()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":E()}],"scroll-mx":[{"scroll-mx":E()}],"scroll-my":[{"scroll-my":E()}],"scroll-ms":[{"scroll-ms":E()}],"scroll-me":[{"scroll-me":E()}],"scroll-mbs":[{"scroll-mbs":E()}],"scroll-mbe":[{"scroll-mbe":E()}],"scroll-mt":[{"scroll-mt":E()}],"scroll-mr":[{"scroll-mr":E()}],"scroll-mb":[{"scroll-mb":E()}],"scroll-ml":[{"scroll-ml":E()}],"scroll-p":[{"scroll-p":E()}],"scroll-px":[{"scroll-px":E()}],"scroll-py":[{"scroll-py":E()}],"scroll-ps":[{"scroll-ps":E()}],"scroll-pe":[{"scroll-pe":E()}],"scroll-pbs":[{"scroll-pbs":E()}],"scroll-pbe":[{"scroll-pbe":E()}],"scroll-pt":[{"scroll-pt":E()}],"scroll-pr":[{"scroll-pr":E()}],"scroll-pb":[{"scroll-pb":E()}],"scroll-pl":[{"scroll-pl":E()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",eT,ew]}],fill:[{fill:["none",...B()]}],"stroke-w":[{stroke:[eu,eO,eS,ek]}],stroke:[{stroke:["none",...B()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["start","end","right","left"],"inset-y":["inset-bs","inset-be","top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["ps","pe","pr","pl"],py:["pbs","pbe","pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["ms","me","mr","ml"],my:["mbs","mbe","mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-s","border-w-e","border-w-r","border-w-l"],"border-w-y":["border-w-bs","border-w-be","border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-s","border-color-e","border-color-r","border-color-l"],"border-color-y":["border-color-bs","border-color-be","border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-ms","scroll-me","scroll-mr","scroll-ml"],"scroll-my":["scroll-mbs","scroll-mbe","scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-ps","scroll-pe","scroll-pr","scroll-pl"],"scroll-py":["scroll-pbs","scroll-pbe","scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},a=e=>{let t=n(e);if(t)return t;let s=((e,t)=>{let{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:i,sortModifiers:s,postfixLookupClassGroupIds:a}=t,o=[],l=e.trim().split(Y),u="";for(let e=l.length-1;e>=0;e-=1){let t,c=l[e],{isExternal:f,modifiers:d,hasImportantModifier:h,baseClassName:p,maybePostfixModifierPosition:g}=r(c);if(f){u=c+(u.length>0?" "+u:u);continue}let m=!!g;if(m){let e=(t=n(p.substring(0,g)))&&a[t]?n(p):void 0;e&&e!==t&&(t=e,m=!1)}else t=n(p);if(!t){if(!m||!(t=n(p))){u=c+(u.length>0?" "+u:u);continue}m=!1}let b=0===d.length?"":1===d.length?d[0]:s(d).join(":"),y=h?b+"!":b,v=y+t;if(o.indexOf(v)>-1)continue;o.push(v);let x=i(t,m);for(let e=0;e<x.length;++e){let t=x[e];o.push(y+t)}u=c+(u.length>0?" "+u:u)}return u})(e,r);return i(e,s),s},s=e=>{var t;let o;return n=(r={cache:(e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null),i=(i,s)=>{r[i]=s,++t>e&&(t=0,n=r,r=Object.create(null))};return{get(e){let t=r[e];return void 0!==t?t:void 0!==(t=n[e])?(i(e,t),t):void 0},set(e,t){e in r?r[e]=t:i(e,t)}}})((t=[].reduce((e,t)=>t(e),Ee())).cacheSize),parseClassName:(e=>{let{prefix:t,experimentalParseClassName:r}=e,n=e=>{let t,r=[],n=0,i=0,s=0,a=e.length;for(let o=0;o<a;o++){let a=e[o];if(0===n&&0===i){if(":"===a){r.push(e.slice(s,o)),s=o+1;continue}if("/"===a){t=o;continue}}"["===a?n++:"]"===a?n--:"("===a?i++:")"===a&&i--}let o=0===r.length?e:e.slice(s),l=o,u=!1;return o.endsWith("!")?(l=o.slice(0,-1),u=!0):o.startsWith("!")&&(l=o.slice(1),u=!0),G(r,u,l,t&&t>s?t-s:void 0)};if(t){let e=t+":",r=n;n=t=>t.startsWith(e)?r(t.slice(e.length)):G(V,!1,t,void 0,!0)}if(r){let e=n;n=t=>r({className:t,parseClassName:e})}return n})(t),sortModifiers:(o=new Map,t.orderSensitiveModifiers.forEach((e,t)=>{o.set(e,1e6+t)}),e=>{let t=[],r=[];for(let n=0;n<e.length;n++){let i=e[n],s="["===i[0],a=o.has(i);s||a?(r.length>0&&(r.sort(),t.push(...r),r=[]),t.push(i)):r.push(i)}return r.length>0&&(r.sort(),t.push(...r)),t}),postfixLookupClassGroupIds:(e=>{let t=Object.create(null),r=e.postfixLookupClassGroups;if(r)for(let e=0;e<r.length;e++)t[r[e]]=!0;return t})(t),...(e=>{let t=(e=>{let{theme:t,classGroups:r}=e;return F(r,t)})(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:e=>{if(e.startsWith("[")&&e.endsWith("]")){var r;let t,n,i;return -1===(r=e).slice(1,-1).indexOf(":")?void 0:(n=(t=r.slice(1,-1)).indexOf(":"),(i=t.slice(0,n))?"arbitrary.."+i:void 0)}let n=e.split("-"),i=+(""===n[0]&&n.length>1);return L(n,i,t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=n[e],i=r[e];if(t){if(i){let e=Array(i.length+t.length);for(let t=0;t<i.length;t++)e[t]=i[t];for(let r=0;r<t.length;r++)e[i.length+r]=t[r];return e}return t}return i||R}return r[e]||R}}})(t)}).cache.get,i=r.cache.set,s=a,a(e)},(...e)=>s(((...e)=>{let t,r,n=0,i="";for(;n<e.length;)(t=e[n++])&&(r=Z(t))&&(i&&(i+=" "),i+=r);return i})(...e)));e.s(["f",0,(...e)=>eK(B(e))],52088);let eV=(e,t)=>{switch(t.length){case 0:return e;case 1:return t[0](e);case 2:return t[1](t[0](e));case 3:return t[2](t[1](t[0](e)));case 4:return t[3](t[2](t[1](t[0](e))));case 5:return t[4](t[3](t[2](t[1](t[0](e)))));case 6:return t[5](t[4](t[3](t[2](t[1](t[0](e))))));case 7:return t[6](t[5](t[4](t[3](t[2](t[1](t[0](e)))))));case 8:return t[7](t[6](t[5](t[4](t[3](t[2](t[1](t[0](e))))))));case 9:return t[8](t[7](t[6](t[5](t[4](t[3](t[2](t[1](t[0](e)))))))));default:{let r=e;for(let e=0,n=t.length;e<n;e++)r=t[e](r);return r}}},eG={pipe(){return eV(this,arguments)}},eY=function(){function e(){}return e.prototype=eG,e}(),eZ=function(e,t){if("function"==typeof e)return function(){return e(arguments)?t.apply(this,arguments):e=>t(e,...arguments)};switch(e){case 0:case 1:throw RangeError(`Invalid arity ${e}`);case 2:return function(e,r){return arguments.length>=2?t(e,r):function(r){return t(r,e)}};case 3:return function(e,r,n){return arguments.length>=3?t(e,r,n):function(n){return t(n,e,r)}};default:return function(){if(arguments.length>=e)return t.apply(this,arguments);let r=arguments;return function(e){return t(e,...r)}}}},eX=e=>e,eQ=e=>()=>e,e0=eQ(!0),e1=eQ(!1),e2=eQ(null),e3=eQ(void 0),e5=eZ(2,(e,t)=>r=>t(e(r)));function e8(e,...t){return eV(e,t)}function e4(e,t,r,n,i,s,a,o,l){switch(arguments.length){case 1:return e;case 2:return function(){return t(e.apply(this,arguments))};case 3:return function(){return r(t(e.apply(this,arguments)))};case 4:return function(){return n(r(t(e.apply(this,arguments))))};case 5:return function(){return i(n(r(t(e.apply(this,arguments)))))};case 6:return function(){return s(i(n(r(t(e.apply(this,arguments))))))};case 7:return function(){return a(s(i(n(r(t(e.apply(this,arguments)))))))};case 8:return function(){return o(a(s(i(n(r(t(e.apply(this,arguments))))))))};case 9:return function(){return l(o(a(s(i(n(r(t(e.apply(this,arguments)))))))))}}}function e6(e){let t=new WeakMap;return r=>{let n=t.get(r);if(void 0!==n)return n;let i=e(r);return t.set(r,i),i}}function e9(e){let t=new WeakMap;return r=>{let n=t.get(r);if(void 0!==n)return n;let i=e(r);return t.set(r,i),i!==r&&t.set(i,i),i}}e.s(["f",0,e5,"W",0,e1,"g",0,e2,"T",0,e0,"x",0,e3,"z",0,e3,"v",0,eQ,"p",0,eZ,"u",0,e4,"K",0,eX,"Z",0,e6,"i",0,e9,"y",0,e8],5843);let e7=e=>{let t=new Set(Reflect.ownKeys(e));if(e.constructor===Object)return t;e instanceof Error&&t.delete("stack");let r=Object.getPrototypeOf(e),n=r;for(;null!==n&&n!==Object.prototype;){let e=Reflect.ownKeys(n);for(let r=0;r<e.length;r++)t.add(e[r]);n=Object.getPrototypeOf(n)}return t.has("constructor")&&"function"==typeof e.constructor&&r===e.constructor.prototype&&t.delete("constructor"),t},te=new WeakSet,tt=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),tr=e=>e instanceof ArrayBuffer||"u">typeof SharedArrayBuffer&&e instanceof SharedArrayBuffer,tn=e=>{try{return new Uint8Array(e)}catch{return}},ti=0,ts=eZ(2,(e,t)=>e.length===t);function ta(e){return"string"==typeof e}function to(e){return"number"==typeof e}function tl(e){return"boolean"==typeof e}function tu(e){return"bigint"==typeof e}function tc(e){return"symbol"==typeof e}function tf(e){return ta(e)||to(e)||tc(e)}function td(e){return"function"==typeof e}function th(e){return void 0===e}function tp(e){return void 0!==e}function tg(e){return null!=e}function tm(e){return!1}function tb(e){return!0}function ty(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function tv(e){return"object"==typeof e&&null!==e||td(e)}let tx=eZ(2,(e,t)=>tv(e)&&t in e),tw=eZ(2,(e,t)=>tx(e,"_tag")&&e._tag===t);function tS(e){return e instanceof Error}function tk(e){return tx(e,Symbol.iterator)||ta(e)}function tE(e){return e instanceof RegExp}let t_=eZ(2,(e,t)=>r=>e(r)||t(r));e.s(["X",0,tx,"G",0,tu,"F",0,tl,"S",0,function(e){return e instanceof Date},"b",0,tS,"U",0,td,"O",0,tk,"q",0,tm,"A",0,tg,"B",0,tp,"H",0,to,"C",0,ty,"c",0,tv,"m",0,tf,"D",0,tE,"Z",0,ta,"J",0,tc,"Y",0,tw,"y",0,ts,"l",0,th,"w",0,tb,"E",0,t_],20612);let tC="~effect/Hash",tA=e=>{switch(typeof e){case"number":return t$(e);case"bigint":return tj(e.toString(10));case"string":return tj(e);case"function":case"object":if(null===e);else if(e instanceof Date){if(Number.isNaN(e.getTime()))return tj("Invalid Date");return tj(e.toISOString())}else{let t;if(e instanceof RegExp)return tj(e.toString());if(te.has(e))return tI(e);let r=tJ.get(e);if(void 0!==r)return r;if(tW.has(e))return ti++,tj("[Circular]");tW.add(e);let n=ti;try{if(tM(e))t=e[tC]();else if("function"==typeof e)t=tI(e);else if(tr(e)){let r=tn(e);t=void 0===r?tI(e):tL(r)}else t=e instanceof DataView?tL(tt(e)):Array.isArray(e)||ArrayBuffer.isView(e)?tL(e):e instanceof Map?tF(e):e instanceof Set?tz(e):tP(e)}finally{tW.delete(e)}return n===ti&&tJ.set(e,t),t}}return tN(tT(tj(String(e))))},tI=e=>(tH.has(e)||tH.set(e,tN(0x100000000*Math.random()|0)),tH.get(e)),tT=e=>(e^=e>>>16,e=Math.imul(e,0x85ebca6b),e^=e>>>13,(e=Math.imul(e,0xc2b2ae35))^e>>>16),tO=eZ(2,(e,t)=>tT(Math.imul(e,0x9e3779b1)+Math.imul(t,0x85ebca6b))),tN=e=>0xbfffffff&e|e>>>1&0x40000000,tM=e=>tx(e,tC)&&"function"==typeof e[tC],tU=new DataView(new ArrayBuffer(8)),t$=e=>{let t=0|e;return t===e?tN(t):(tU.setFloat64(0,e!=e?0/0:e),tN(tO(tU.getInt32(0),tU.getInt32(4))))},tj=e=>{let t=5381,r=e.length;for(;r;)t=33*t^e.charCodeAt(--r);return tN(t)},tB=(e,t)=>{let r=12289;for(let n of t)r^=tO(tA(n),tA(e[n]));return tN(r)},tP=e=>tB(e,e7(e)),tR=(e,t)=>r=>{let n=e;for(let e of r)n^=t(e);return tN(n)},tL=e=>{let t=6151;for(let r of e)t=tO(t,tA(r));return tN(t)},tF=tR(tj("Map"),([e,t])=>tO(tA(e),tA(t))),tD=tj("Set"),tz=tR(tD,e=>tO(tD,tA(e))),tH=new WeakMap,tJ=new WeakMap,tW=new WeakSet,tq="~effect/Equal";function tK(){return 1==arguments.length?e=>tV(e,arguments[0]):tV(arguments[0],arguments[1])}function tV(e,t){if(e===t)return!0;if(null==e||null==t)return!1;let r=typeof e;return r===typeof t&&("number"===r&&e!=e&&t!=t||!("object"!==r&&"function"!==r||te.has(e)||te.has(t))&&function(e,t){let r=tY.length;for(let n=r;n-- >0;)if(tY[n]===e&&tZ[n]===t)return!0;if(r)return tG(e,t);let n=tX.get(e);n||tX.set(e,n=new WeakMap);let i=n.get(t);return void 0===i&&n.set(t,i=tG(e,t)),i}(e,t))}function tG(e,t){tY.push(e),tZ.push(t);try{return function(e,t){if(tA(e)!==tA(t))return!1;if(e instanceof Date){if(!(t instanceof Date))return!1;let r=e.getTime(),n=t.getTime();return r===n||Number.isNaN(r)&&Number.isNaN(n)}if(e instanceof RegExp)return t instanceof RegExp&&e.toString()===t.toString();let r=t3(e);if(r!==t3(t)||"function"==typeof e&&!r)return!1;if(r)return e[tq](t);if(Array.isArray(e))return!!Array.isArray(t)&&e.length===t.length&&function(e,t){for(let r=0;r<e.length;r++)if(!tV(e[r],t[r]))return!1;return!0}(e,t);if(tr(e)){if(!tr(t)||e instanceof ArrayBuffer!=t instanceof ArrayBuffer)return!1;let r=tn(e),n=tn(t);return void 0!==r&&void 0!==n&&tQ(r,n)}if(ArrayBuffer.isView(e)){let r=e instanceof DataView;return!!ArrayBuffer.isView(t)&&e.byteLength===t.byteLength&&r===t instanceof DataView&&(r?tQ(tt(e),tt(t)):tQ(e,t))}else if(e instanceof Map)return t instanceof Map&&e.size===t.size&&t0(e,t,t1,t2);else if(e instanceof Set)return t instanceof Set&&e.size===t.size&&t0(e,t,tA,tV);var n=e,i=t;let s=e7(n),a=e7(i);if(s.size!==a.size)return!1;for(let e of s)if(!a.has(e)||!tV(n[e],i[e]))return!1;return!0}(e,t)}finally{tY.pop(),tZ.pop()}}let tY=[],tZ=[],tX=new WeakMap;function tQ(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function t0(e,t,r,n){let i=new Map,s=0;for(let e of t){let t=r(e),n=i.get(t);n?n.push(e):i.set(t,[e]),s++}e:for(let t of e){let e=i.get(r(t));if(e){for(let r=0;r<e.length;r++)if(n(t,e[r])){e[r]=e[e.length-1],e.pop(),s--;continue e}}return!1}return 0===s}let t1=e=>tA(e[0]),t2=(e,t)=>tV(e[0],t[0])&&tV(e[1],t[1]),t3=e=>tx(e,tq)&&"function"==typeof e[tq],t5=e=>(te.add(e),e),t8=e=>(t,r)=>t===r||e(t,r),t4=(e,t)=>e===t;function t6(e){return t8((t,r)=>{if(t.length!==r.length)return!1;for(let n=0;n<t.length;n++)if(!e(t[n],r[n]))return!1;return!0})}let t9=Symbol.for("~effect/Redactable");function t7(e){return tx(e,t9)?re(e):e}function re(e){return e[t9](globalThis[rt]?.context??rn)}let rt="~effect/Fiber/currentFiber",rr=new Map,rn={"~effect/Context":{},base:rr,depth:0,mapUnsafe:rr,pipe(){return eV(this,arguments)}};function ri(e,t){let r=t?.space??0,n=new WeakSet,i=r?"number"==typeof r?" ".repeat(r):r:"",s=(e,t)=>{let r=e?.constructor;return r&&r!==Object.prototype.constructor&&r.name?`${r.name}(${t})`:t};return function e(r,a=0){try{return function(r,a=0){if("string"==typeof r)return JSON.stringify(r);if("number"==typeof r||null==r||"boolean"==typeof r||"symbol"==typeof r)return String(r);if("bigint"==typeof r)return String(r)+"n";if("object"==typeof r||"function"==typeof r){let o;if(n.has(r))return rs;if(n.add(r),t9 in r)o=e(re(r),a);else if(Array.isArray(r)){let t,n;o=!i||r.length<=1?`[${r.map(t=>e(t,a)).join(",")}]`:`[
|
|
2
|
+
${t=a+1,i.repeat(t)}${r.map(t=>e(t,a+1)).join(",\n"+(n=a+1,i.repeat(n)))}
|
|
3
|
+
${i.repeat(a)}]`}else if(r instanceof Date)o=ro(r);else if(!t?.ignoreToString&&tx(r,"toString")&&"function"==typeof r.toString&&r.toString!==Object.prototype.toString&&r.toString!==Array.prototype.toString){let t=function(e){try{let t=e.toString();return"string"==typeof t?t:String(t)}catch{return"[toString threw]"}}(r);o=r instanceof Error&&void 0!==r.cause?`${t} (cause: ${e(r.cause,a)})`:t}else if(Symbol.iterator in r)o=`${r.constructor.name}(${e(Array.from(r),a)})`;else{let t=(e=>{try{return Reflect.ownKeys(e)}catch{return["[ownKeys threw]"]}})(r);if(!i||t.length<=1){let n=`{${t.map(t=>`${ra(t)}:${e(rl(r,t),a)}`).join(",")}}`;o=s(r,n)}else{let n=`{
|
|
4
|
+
${t.map(t=>{let n;return`${n=a+1,i.repeat(n)}${ra(t)}: ${e(rl(r,t),a+1)}`}).join(",\n")}
|
|
5
|
+
${i.repeat(a)}}`;o=s(r,n)}}return n.delete(r),o}return String(r)}(r,a)}catch{return("object"==typeof r&&null!==r||"function"==typeof r)&&n.delete(r),"[inspection threw]"}}(e,0)}let rs="[Circular]";function ra(e){return"string"==typeof e?JSON.stringify(e):String(e)}function ro(e){try{return e.toISOString()}catch{return"Invalid Date"}}function rl(e,t){try{return e[t]}catch{return"[property access threw]"}}function ru(e,t){let r=[],n=new WeakMap;return JSON.stringify(e,function(e,t){let i=Object.getOwnPropertyDescriptor(n.get(this)??this,e)?.value,s=tx(i,t9)?t7(i):t7(t);if("bigint"==typeof s)return ri(s);if("object"!=typeof s||null===s)return s;let a=s instanceof Error&&!tx(s,"toJSON")?{...s,name:s.name,message:s.message}:s;for(;r.length>0&&r[r.length-1]!==this;)r.pop();if(r.includes(s))return;if(r.push(s),a!==s&&r.push(a),!function(e){for(let t of Object.getOwnPropertyNames(e))if(Object.getOwnPropertyDescriptor(e,t)?.get!==void 0)return!0;return!1}(a)||function(e){for(let t of[Number.prototype.valueOf,Boolean.prototype.valueOf,String.prototype.valueOf])try{return Reflect.apply(t,e,[]),!0}catch{}return!1}(a))return a;let o=function(e){let t=Array.isArray(e)?[]:{};for(let r of Array.isArray(e)?Array.from({length:e.length},(e,t)=>String(t)):Object.keys(e))Object.defineProperty(t,r,{enumerable:!0,get:()=>{let t=Reflect.get(e,r);return Object.getOwnPropertyDescriptor(e,r)?.get!==void 0?t7(t):t}});return t}(a);return n.set(o,a),r.push(o),o},t?.space)??"null"}let rc=Symbol.for("nodejs.util.inspect.custom"),rf=e=>{try{if(e=t7(e),tx(e,"toJSON")&&td(e.toJSON)&&0===e.toJSON.length)return e.toJSON();if(Array.isArray(e))return e.map(rf);return e}catch{return"[toJSON threw]"}},rd={toJSON(){return rf(this)},[rc](){return this.toJSON()},toString(){return ri(this.toJSON())}};class rh{[rc](){return this.toJSON()}toString(){return ri(this.toJSON())}}let rp=void 0===(o=Object.getOwnPropertyDescriptor(Error,"stackTraceLimit"))?Object.isExtensible(Error):Object.hasOwn(o,"writable")?!0===o.writable:void 0!==o.set,rg=e=>{rp&&(Error.stackTraceLimit=e)};class rm{constructor(e){this.value=e,this.done=!1}next(e){return this.done?(this.value=e,this):(this.done=!0,{value:this.value,done:!1})}}let rb=(()=>{let e="~effect/Utils/internal",t={[e]:e=>e()},r={[e]:e=>e()},n=Error.stackTraceLimit;if(0===n)return r[e];rg(2);let i=t[e](()=>Error());return rg(n),i.stack?.includes(e)===!0?t[e]:r[e]})();function ry(e,t,r){"__proto__"===t?Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0}):e[t]=r}function rv(e,t){if(!Object.hasOwn(t,"__proto__"))return void Object.assign(e,t);for(let r of Reflect.ownKeys(t))Object.prototype.propertyIsEnumerable.call(t,r)&&ry(e,r,t[r])}e.s(["T",0,rv,"h",0,ry],4523);let rx="~effect/Effect",rw="~effect/Exit",rS=`${rx}/identifier`,rk=`${rx}/args`,rE=`${rx}/evaluate`,r_=`${rx}/successCont`,rC=`${rx}/failureCont`,rA=`${rx}/ensureCont`,rI=Symbol.for("effect/Effect/Yield"),rT={pipe(){return eV(this,arguments)},toJSON(){return{...this}},toString(){return ri(this.toJSON(),{ignoreToString:!0,space:2})},[rc](){return this.toJSON()}},rO={[rx]:{_A:eX,_E:eX,_R:eX},...rT,[Symbol.iterator](){return new rm(this)},toJSON(){return{_id:"Effect",op:this[rS],...rk in this?{args:this[rk]}:void 0}}},rN=e=>tx(e,rx),rM="~effect/Cause",rU="~effect/Cause/Reason",r$=e=>tx(e,rM);class rj{constructor(e){this[rM]=rM,this.reasons=e}pipe(){return eV(this,arguments)}toJSON(){return{_id:"Cause",reasons:this.reasons.map(e=>e.toJSON())}}toString(){return`Cause(${ri(this.reasons)})`}[rc](){return this.toJSON()}[tq](e){return r$(e)&&this.reasons.length===e.reasons.length&&this.reasons.every((t,r)=>tK(t,e.reasons[r]))}[tC](){return tL(this.reasons)}}let rB=new WeakMap;class rP{[rU];annotations;_tag;constructor(e,t,r){if(this[rU]=rU,this._tag=e,t!==rR&&"object"==typeof r&&null!==r&&t.size>0){let e=rB.get(r);e&&(t=new Map([...e,...t])),rB.set(r,t)}this.annotations=t}annotate(e,t){if(0===e.mapUnsafe.size)return this;let r=new Map(this.annotations);if(e.mapUnsafe.forEach((e,n)=>{t?.overwrite!==!0&&r.has(n)||r.set(n,e)}),t?.overwrite!==!0&&r.size===this.annotations.size)return this;let n=Object.assign(Object.create(Object.getPrototypeOf(this)),this);return n.annotations=r,n}pipe(){return eV(this,arguments)}toString(){return ri(this)}[rc](){return this.toString()}}let rR=new Map;class rL extends rP{constructor(e,t=rR){super("Fail",t,e),this.error=e}toString(){return`Fail(${ri(this.error)})`}toJSON(){return{_tag:"Fail",error:this.error}}[tq](e){return rV(e)&&tK(this.error,e.error)&&tK(this.annotations,e.annotations)}[tC](){return tO(tj(this._tag))(tO(tA(this.error))(tA(this.annotations)))}}let rF=e=>new rj(e),rD=eZ(2,(e,t)=>{if(0===e.reasons.length)return t;if(0===t.reasons.length)return e;let r=new rj(((e,t)=>{let r=new Map,n=[];for(let i of e.concat(t)){let e=tA(i),t=r.get(e);if(void 0===t)r.set(e,[i]);else{if(t.some(e=>tK(e,i)))continue;t.push(i)}n.push(i)}return n})(e.reasons,t.reasons));return tK(e,r)?e:r}),rz=(e,t)=>{let r=e.reasons.slice();for(let e of t.reasons)rY(e)&&!r.some(t=>rY(t)&&t.fiberId===e.fiberId&&t.annotations===e.annotations)&&r.push(e);return r.length===e.reasons.length?e:new rj(r)},rH=new rj([]),rJ=e=>new rj([new rL(e)]);class rW extends rP{constructor(e,t=rR){super("Die",t,e),this.defect=e}toString(){return`Die(${ri(this.defect)})`}toJSON(){return{_tag:"Die",defect:this.defect}}[tq](e){return rG(e)&&tK(this.defect,e.defect)&&tK(this.annotations,e.annotations)}[tC](){return tO(tj(this._tag))(tO(tA(this.defect))(tA(this.annotations)))}}let rq=e=>new rj([new rW(e)]),rK=eZ(e=>r$(e[0]),(e,t,r)=>0===t.mapUnsafe.size?e:new rj(e.reasons.map(e=>e.annotate(t,r)))),rV=e=>"Fail"===e._tag,rG=e=>"Die"===e._tag,rY=e=>"Interrupt"===e._tag;function rZ(e){return r4("Effect.evaluate: Not implemented")}let rX=e=>({...rO,[rS]:e.op,[rE]:e[rE]??rZ,[r_]:e[r_],[rC]:e[rC],[rA]:e[rA]}),rQ=e=>{let t=rX(e),r=function(e){this[rk]=e};return r.prototype=t,function(e){return new r(e)}},r0=e=>{let t={[rw]:rw,_tag:e.op,get[e.prop](){return this[rk]},...rX(e),toString(){return`${e.op}(${ri(this[rk])})`},toJSON(){return{_id:"Exit",_tag:e.op,[e.prop]:this[rk]}},[tq](e){return tx(e,rw)&&e._tag===this._tag&&tK(this[rk],e[rk])},[tC](){return tO(tj(e.op),tA(this[rk]))}},r=function(e){this[rk]=e};return r.prototype=t,function(e){return new r(e)}},r1=r0({op:"Success",prop:"value",[rE](e){let t=e.getCont(r_);return t?t[r_](this[rk],e,this):e.yieldWith(this)}}),r2={key:"effect/Cause/StackTrace"},r3="effect/Cause/InterruptorStackTrace",r5=r0({op:"Failure",prop:"cause",[rE](e){let t=this[rk],r=!1;e.cache.stackFrame&&(t=rK(t,{mapUnsafe:new Map([[r2.key,e.cache.stackFrame]])}),r=!0);let n=e.getCont(rC),i=e._interruptedCause;if(i&&e.interruptible){let s=!1;for(;n&&e.interruptible;)s||=rS in n,n=e.getCont(rC);s&&(t=rF(t.reasons.filter(e=>"Fail"!==e._tag))),t=rz(t,i),r=!0}return n?n[rC](t,e,r?void 0:this):e.yieldWith(r?r5(t):this)}}),r8=e=>r5(rJ(e)),r4=e=>r5(rq(e)),r6=rQ({op:"WithFiber",[rE](e){return this[rk](e)}}),r9=rQ({op:"WithFiberSucceed",[rE](e){let t=this[rk](e),r=e.getCont(r_);return r?r[r_](t,e):e.yieldWith(r1(t))}}),r7=function(){class e extends globalThis.Error{}let t=rX({op:"YieldableError",[rE](){return r8(this)}});return delete t.toString,Object.assign(e.prototype,t),e}(),ne=(l=Symbol.for("effect/Data/Error/plainArgs"),class extends r7{constructor(e){super(e?.message,e?.cause?{cause:e.cause}:void 0),e&&(rv(this,e),Object.defineProperty(this,l,{value:e,enumerable:!1}))}toJSON(){return{...this[l],...this}}}),nt=e=>{class t extends ne{_tag=e}return t.prototype.name=e,t},nr="~effect/Cause/NoSuchElementError";class nn extends nt("NoSuchElementError"){[nr]=nr;constructor(e){super({message:e})}}let ni="~effect/Cause/Done",ns=e=>tx(e,ni),na={[ni]:ni,_tag:"Done",value:void 0},no=e=>void 0===e?na:{[ni]:ni,_tag:"Done",value:e},nl=r8(na),nu="~effect/Option",nc={[nu]:{_A:e=>e},...rT,[Symbol.iterator](){return new rm(this)}},nf=Object.defineProperty(Object.assign(Object.create(nc),{_tag:"Some",_op:"Some",[tq](e){return np(e)&&nm(e)&&tK(this.value,e.value)},[tC](){return tO(tA(this._tag))(tA(this.value))},toString(){return`some(${ri(this.value)})`},toJSON(){return{_id:"Option",_tag:this._tag,value:rf(this.value)}}}),"valueOrUndefined",{get(){return this.value}}),nd=tA("None"),nh=Object.assign(Object.create(nc),{_tag:"None",_op:"None",valueOrUndefined:void 0,[tq]:e=>np(e)&&ng(e),[tC]:()=>nd,toString:()=>"none()",toJSON(){return{_id:"Option",_tag:this._tag}}}),np=e=>tx(e,nu),ng=e=>"None"===e._tag,nm=e=>"Some"===e._tag,nb=Object.create(nh),ny=function(e){this.value=e};ny.prototype=nf;let nv=e=>new ny(e),nx="~effect/Result",nw={[nx]:{_A:e=>e,_E:e=>e},...rT,[Symbol.iterator](){return new rm(this)}},nS=Object.assign(Object.create(nw),{_tag:"Success",_op:"Success",[tq](e){return nE(e)&&nC(e)&&tK(this.success,e.success)},[tC](){return tO(tA(this._tag))(tA(this.success))},toString(){return`success(${ri(this.success)})`},toJSON(){return{_id:"Result",_tag:this._tag,value:rf(this.success)}}}),nk=Object.assign(Object.create(nw),{_tag:"Failure",_op:"Failure",[tq](e){return nE(e)&&n_(e)&&tK(this.failure,e.failure)},[tC](){return tO(tA(this._tag))(tA(this.failure))},toString(){return`failure(${ri(this.failure)})`},toJSON(){return{_id:"Result",_tag:this._tag,failure:rf(this.failure)}}}),nE=e=>tx(e,nx),n_=e=>"Failure"===e._tag,nC=e=>"Success"===e._tag,nA=function(e){this.failure=e};nA.prototype=nk;let nI=e=>new nA(e),nT=function(e){this.success=e};nT.prototype=nS;let nO=e=>new nT(e);function nN(e){return(t,r)=>t===r?0:e(t,r)}let nM=nN((e,t)=>e<t?-1:1),nU=nN((e,t)=>globalThis.Number.isNaN(e)&&globalThis.Number.isNaN(t)?0:globalThis.Number.isNaN(e)?-1:globalThis.Number.isNaN(t)?1:e<t?-1:1),n$=nN((e,t)=>e<t?-1:1),nj=eZ(2,(e,t)=>nN((r,n)=>e(t(r),t(n)))),nB=e=>eZ(2,(t,r)=>-1===e(t,r)),nP=e=>eZ(2,(t,r)=>1===e(t,r)),nR=e=>eZ(2,(t,r)=>1!==e(t,r)),nL=e=>eZ(2,(t,r)=>-1!==e(t,r)),nF=eZ(2,(e,{onNone:t,onSome:r})=>ng(e)?t():r(e.value)),nD=eZ(2,(e,t)=>ng(e)?t():e.value),nz=e=>null==e?nb:nv(e),nH=e=>void 0===e?nb:nv(e),nJ=e=>null===e?nb:nv(e),nW=nD(e2),nq=nD(e3),nK=e=>(...t)=>{try{return nv(e(...t))}catch{return nb}},nV=eZ(2,(e,t)=>{if(nm(e))return e.value;throw t()}),nG=(()=>Error("getOrThrow called on a None"),eZ(2,(e,t)=>ng(e)?nb:nv(t(e.value)))),nY=eZ(2,(e,t)=>ng(e)?nb:t(e.value)),nZ=nY(eX),nX=((e,t)=>nY(e,e=>nG(t(e),()=>e)),eZ(2,(e,t)=>ng(e)?nb:t(e.value)?nv(e.value):nb)),nQ=/^[+-]?\d+$/,n0="~effect/BigDecimal",n1={[n0]:n0,[tC](){let e=ie(this);return tO(tj(String(e.value)),t$(e.scale))},[tq](e){return n2(e)&&0===iu(this,e)},toString(){return`BigDecimal(${im(this)})`},toJSON(){return{_id:"BigDecimal",value:String(this.value),scale:this.scale}},[rc](){return this.toJSON()},pipe(){return eV(this,arguments)}},n2=e=>tx(e,n0),n3=(e,t)=>{if(!Number.isSafeInteger(t))throw RangeError(`Scale must be a safe integer, got ${t}`);let r=Object.create(n1);return r.value=e,r.scale=t,r},n5=(e,t)=>{let r=n3(e,t);return r.normalized=r,r},n8=BigInt(0),n4=BigInt(1),n6=BigInt(-1),n9=BigInt(10),n7=n5(n8,0),ie=e=>{if(void 0===e.normalized)if(e.value===n8)e.normalized=n7;else{let t=`${e.value}`,r=it(t);e.normalized=n5(BigInt(t.slice(0,t.length-r)),e.scale-r)}return e.normalized},it=e=>{let t=e.length;for(;"0"===e[t-1];)t--;return e.length-t},ir=e=>{if(e>2e4)throw RangeError(`Scale alignment must not exceed 20000 digits, got ${e}`);return n9**BigInt(e)},ii=eZ(2,(e,t)=>t>e.scale?n3(e.value*ir(t-e.scale),t):t<e.scale?n3(e.value/ir(e.scale-t),t):e),is=eZ(2,(e,t)=>t.value===n8?e:e.value===n8?t:e.scale>t.scale?n3(ii(t,e.scale).value+e.value,e.scale):e.scale<t.scale?n3(ii(e,t.scale).value+t.value,t.scale):n3(e.value+t.value,e.scale)),ia=[n4],io=(e,t)=>e===t?0:e<t?-1:1,il=(e,t)=>{let r=`${e.value<n8?-e.value:e.value}`,n=`${t.value<n8?-t.value:t.value}`,i=BigInt(r.length-n.length)-BigInt(e.scale)+BigInt(t.scale);if(i!==n8)return i<n8?-1:1;let s=Math.max(r.length,n.length);return nM(r.padEnd(s,"0"),n.padEnd(s,"0"))},iu=(e,t)=>{if(e.scale===t.scale)return io(e.value,t.value);let r=ip(e),n=ip(t);if(r!==n)return r<n?-1:1;if(0===r)return 0;let i=e.scale-t.scale,s=Math.abs(i);if(s>100)return -1===r?il(t,e):il(e,t);let a=ia[s]??=n9**BigInt(s);return i>0?io(e.value,t.value*a):io(e.value*a,t.value)},ic=nN(iu),id=nB(ic),ih=nP(ic),ip=e=>e.value===n8?0:e.value<n8?-1:1,ig=t8((e,t)=>0===iu(e,t)),im=((e,t)=>ig(e,t),e=>{let t=ie(e);if(Math.abs(t.scale)>=16)return ib(t);let r=t.value<n8,n=`${r?-t.value:t.value}`,i=t.scale>0?n.padStart(t.scale+1,"0"):n.padEnd(n.length-t.scale,"0"),s=i.length-t.scale,a=t.scale>0?`${i.slice(0,s)}.${i.slice(s)}`:i;return r?`-${a}`:a}),ib=e=>{if(iy(e))return"0e+0";let t=ie(e),r=`${t.value}`,n=t.value<n8?2:1,i=r.slice(0,n),s=r.slice(n),a=s.length-t.scale;return`${i}${""===s?"":`.${s}`}e${a>=0?"+":""}${a}`},iy=e=>e.value===n8,iv=e=>n2(e[0]),ix=eZ(iv,(e,t=0)=>e.scale<=t?e:n3(e.value/ir(e.scale-t),t));(e,t=0)=>{let r=ix(e,t);return e.value>n8&&id(r,e)?is(r,n3(n4,t)):r},(e,t=0)=>{let r=ix(e,t);return e.value<n8&&ih(r,e)?is(r,n3(n6,t)):r};let iw=globalThis.BigInt,iS=iw(0),ik=((e,t)=>{let r;for(;t!==iS;){let r=t;t=e%t,e=r}return(r=e)<iS?-r:r},BigInt(0)),iE=BigInt(1),i_=BigInt(1e3),iC=BigInt(1024),iA=[{symbol:"B",factor:iE,names:["B","byte","bytes"]},{symbol:"kB",factor:i_,names:["kB","kilobyte","kilobytes"]},{symbol:"MB",factor:i_**BigInt(2),names:["MB","megabyte","megabytes"]},{symbol:"GB",factor:i_**BigInt(3),names:["GB","gigabyte","gigabytes"]},{symbol:"TB",factor:i_**BigInt(4),names:["TB","terabyte","terabytes"]},{symbol:"PB",factor:i_**BigInt(5),names:["PB","petabyte","petabytes"]},{symbol:"EB",factor:i_**BigInt(6),names:["EB","exabyte","exabytes"]},{symbol:"ZB",factor:i_**BigInt(7),names:["ZB","zettabyte","zettabytes"]},{symbol:"YB",factor:i_**BigInt(8),names:["YB","yottabyte","yottabytes"]},{symbol:"RB",factor:i_**BigInt(9),names:["RB","ronnabyte","ronnabytes"]},{symbol:"QB",factor:i_**BigInt(10),names:["QB","quettabyte","quettabytes"]}],iI=[iA[0],{symbol:"KiB",factor:iC,names:["KiB","kibibyte","kibibytes"]},{symbol:"MiB",factor:iC**BigInt(2),names:["MiB","mebibyte","mebibytes"]},{symbol:"GiB",factor:iC**BigInt(3),names:["GiB","gibibyte","gibibytes"]},{symbol:"TiB",factor:iC**BigInt(4),names:["TiB","tebibyte","tebibytes"]},{symbol:"PiB",factor:iC**BigInt(5),names:["PiB","pebibyte","pebibytes"]},{symbol:"EiB",factor:iC**BigInt(6),names:["EiB","exbibyte","exbibytes"]},{symbol:"ZiB",factor:iC**BigInt(7),names:["ZiB","zebibyte","zebibytes"]},{symbol:"YiB",factor:iC**BigInt(8),names:["YiB","yobibyte","yobibytes"]}],iT=[...iA,...iI.slice(1)],iO=new Map(iT.flatMap(e=>e.names.map(t=>[t,e]))),iN=new Map(iT.map(e=>[e.symbol,e])),iM=e=>{throw Error(`Invalid ByteSize: ${e}`)},iU=e=>!Number.isSafeInteger(e)||e<0?iM(`expected a non-negative safe integer, received ${e}`):BigInt(e),i$=BigInt(Number.MAX_SAFE_INTEGER),ij=(e,t)=>{let r=/^(\d+)(?:\.(\d+))?(?:e([+-]\d+))?$/.exec(e);if(null===r)return;let n=r[2]??"",i=BigInt(r[1]+n)*t,s=Number(r[3]??0)-n.length;if(s>=0)return i*BigInt(10)**BigInt(s);let a=BigInt(10)**BigInt(-s);return i%a===ik?i/a:void 0},iB=e=>{let t=/^\s*(\d+(?:\.\d+)?)\s*([A-Za-z]+)\s*$/.exec(e);if(null===t)return iM(`unsupported syntax ${JSON.stringify(e)}`);let r=iO.get(t[2]);if(void 0===r)return iM(`unsupported unit ${JSON.stringify(t[2])}`);let n=ij(t[1],r.factor);return void 0===n?iM(`${JSON.stringify(e)} does not represent an integral number of bytes`):n},iP=nK(iB),iR=e=>{switch(typeof e){case"bigint":if(e<ik)return iM(`expected a non-negative bigint, received ${e}`);return e;case"number":return iU(e);case"string":return iB(e)}return iM(`unsupported input ${e}`)},iL=nK(iR),iF=e=>((e,t)=>{if("bigint"==typeof e)return e<ik?iM(`expected a non-negative quantity, received ${e}`):e*t.factor;if(iI.includes(t)){let r=e*Number(t.factor);if(Number.isSafeInteger(r)&&r>=0)return BigInt(r)}else{let r=ij(String(e),t.factor);if(void 0!==r&&r<=i$)return r}return iM(`expected an exact non-negative safe-integer byte result, received ${e} ${t.symbol}`)})(e,iN.get("MiB")),iD=e=>e,iz=e=>e>iw(Number.MAX_SAFE_INTEGER)||e<iw(Number.MIN_SAFE_INTEGER)?nb:nv(Number(e));e.s(["l",0,e=>"bigint"==typeof e?iR(e):iU(e),"N",0,iL,"s",0,iR,"A",0,iP,"b",0,e=>"bigint"==typeof e&&e>=ik,"P",0,iF,"k",0,iD,"L",0,iz,"h",0,e=>nV(iz(e),()=>Error(`ByteSize exceeds Number.MAX_SAFE_INTEGER: ${e}`)),"q",0,ik],56999);let iH="~effect/Context/Service",iJ=function(){let e=function(){};Object.setPrototypeOf(e,iW);let t=(t,r)=>(e.key=t,r?.defaultValue&&(e[iK]=iK,e.defaultValue=r.defaultValue),r?.make&&(e.make=r.make),r?.fiberCached&&iq.add(t),e);return arguments.length>0?t(arguments[0],arguments[1]):t},iW={[iH]:iH,...rX({op:(T={label:"Service",evaluate(e){return r1(si(e.context,this))}}).label,[rE]:T.evaluate}),toJSON(){return{_id:"Service",key:this.key}},of:e=>e,context(e){return i9(this,e)},use(e){return r6(t=>e(si(t.context,this)))},useSync(e){return r6(t=>r1(e(si(t.context,this))))}},iq=new Set,iK="~effect/Context/Reference",iV="~effect/Context",iG=(e,t,r,n,i)=>{let s=Object.create(i2);return s.cacheRoot=e??s,s.base=t,s.overlay=r,s.depth=n,s._flat=void 0,s.baseHits=0,s.maxDepth=i,s},iY=(e,t)=>{t&&(iY(e,t.parent),e.set(t.key,t.value))},iZ=e=>{if(e._flat)return e._flat;if(!e.overlay)return e._flat=e.base;let t=new Map(e.base);return iY(t,e.overlay),e._flat=t},iX=(e,t)=>{let r=new Map(e.mapUnsafe);return t(r),iG(void 0,r,void 0,0,e.maxDepth)},iQ=Symbol(),i0=(e,t)=>{for(let r=e.overlay;r;r=r.parent)if(r.key===t)return r.value;let r=e.base.get(t);return void 0!==r||e.base.has(t)?(e.overlay&&++e.baseHits>=e.base.size&&e.baseHits>=8&&(e.base=iZ(e),e.overlay=void 0,e.depth=0),r):iQ},i1=(e,t)=>{let r=t?.maxDepth;return iG(void 0,e,void 0,0,Number.isInteger(r)&&r>=0?r:8)},i2={get mapUnsafe(){return iZ(this)},...rT,[iV]:{_Services:e=>e},toJSON(){return{_id:"Context",services:Array.from(this.mapUnsafe).map(([e,t])=>({key:e,value:t}))}},[tq](e){if(!i5(e))return!1;let t=this.mapUnsafe,r=e.mapUnsafe;if(t.size!==r.size)return!1;for(let[e,n]of t)if(!r.has(e)||!tK(n,r.get(e)))return!1;return!0},[tC](){return t$(this.mapUnsafe.size)}},i3=(e,t)=>e.cacheRoot===t.cacheRoot,i5=e=>tx(e,iV),i8=e=>!!e[iK],i4=()=>i6,i6=i1(new Map),i9=(e,t)=>i1(new Map([[e.key,t]])),i7=eZ(3,(e,t,r)=>se(e,t.key,r)),se=(e,t,r)=>{let n=iq.has(t)?void 0:e.cacheRoot;if(e.depth>=e.maxDepth){let i=new Map(e._flat??e.base);return e._flat||iY(i,e.overlay),i.set(t,r),iG(n,i,void 0,0,e.maxDepth)}return iG(n,e.base,{key:t,value:r,parent:e.overlay},e.depth+1,e.maxDepth)},st=eZ(2,(e,t)=>sr(e,t.key)),sr=(e,t)=>{let r=i0(e,t);return r===iQ?void 0:r},sn=eZ(2,(e,t)=>{let r=i0(e,t.key);if(r===iQ){if(i8(t))return sa(t);throw so(t)}return r}),si=sn,ss="~effect/Context/defaultValue",sa=e=>ss in e?e[ss]:e[ss]=e.defaultValue(),so=e=>{let t=Error(`Service not found${e.key?`: ${String(e.key)}`:""}`);if(t.stack){let e=t.stack.split("\n");e.splice(1,3),t.stack=e.join("\n")}return t},sl=eZ(2,(e,t)=>{let r=i0(e,t.key);return r!==iQ?nv(r):i8(t)?nv(sa(t)):nb}),su=eZ(2,(e,t)=>0===e.mapUnsafe.size?t:0===t.mapUnsafe.size?e:iX(e,e=>t.mapUnsafe.forEach((t,r)=>e.set(r,t)))),sc=(...e)=>{let t=new Map;for(let r=0;r<e.length;r++)e[r].mapUnsafe.forEach((e,r)=>{t.set(r,e)});return i1(t)};e.s(["w",0,iJ,"n",0,iJ,"s",0,i7,"k",0,se,"R",0,i4,"g",0,si,"S",0,sl,"q",0,st,"T",0,sr,"F",0,sn,"r",0,i3,"b",0,i5,"h",0,i9,"a",0,i1,"D",0,su,"X",0,sc],88534);let sf=e=>e.length>0,sd=e=>e>0?Math.floor(e):0,sh=e=>Math.max(1,sd(e)),sp=e=>{if(td(e))try{return nO(e())}catch(e){return nI(e)}try{return nO(e.try())}catch(t){return nI(e.catch(t))}},sg=eZ(2,(e,t)=>n_(e)?nI(t(e.failure)):e),sm=eZ(2,(e,t)=>nC(e)?nO(t(e.success)):e),sb=eZ(2,(e,{onFailure:t,onSuccess:r})=>n_(e)?t(e.failure):r(e.success)),sy=(eZ(2,(e,t)=>{if(nC(e))return e.success;throw t(e.failure)}))(eX),sv=eZ(2,(e,t)=>n_(e)?nI(e.failure):t(e.success)),sx=((e,t)=>{var r,n;let i;return s_((r=()=>e,n={length:t},i=n?.length!==void 0?sh(n.length):1/0,{[Symbol.iterator](){let e=0;return{next:()=>e<i?{value:r(e++),done:!1}:{done:!0,value:void 0}}}}))},eZ(2,(e,t)=>({[Symbol.iterator](){let r,n=e[Symbol.iterator](),i=!1;return{next(){if(!i){let e=n.next();return e.done?(i=!0,(r=t[Symbol.iterator]()).next()):e}return r.next()}}}}))),sw=e=>{let t=e[Symbol.iterator]().next();if(t.done)throw Error("headUnsafe: empty iterable");return t.value},sS=eZ(2,(e,t)=>{let r=0;for(let n of e){let e=t(n,r);if(tl(e)){if(e)return nv(n)}else if(nm(e))return e;r++}return nb});(e,t,r)=>({[Symbol.iterator](){let n=e[Symbol.iterator](),i=t[Symbol.iterator]();return{next(){let e=n.next(),t=i.next();return e.done||t.done?{done:!0,value:void 0}:{done:!1,value:r(e.value,t.value)}}}}});let sk=eZ(2,(e,t)=>({[Symbol.iterator](){let r=e[Symbol.iterator](),n=0;return{next(){let e=r.next();return e.done?{done:!0,value:void 0}:{done:!1,value:t(e.value,n++)}}}}})),sE=eZ(2,(e,t)=>s_(sk(e,t))),s_=e=>({[Symbol.iterator](){let t,r=e[Symbol.iterator]();return{next:function(){for(;;){if(void 0===t){let e=r.next();if(e.done)return e;t=e.value[Symbol.iterator]()}let e=t.next();if(!e.done)return e;t=void 0}}}}});(e,t)=>({[Symbol.iterator](){let r=e[Symbol.iterator](),n=0;return{next(){let e=r.next();for(;!e.done;){let i=t(e.value,n++);if(nC(i))return{done:!1,value:i.success};e=r.next()}return{done:!0,value:void 0}}}}});(e,t,r)=>({[Symbol.iterator](){let n,i=[],s=!1,a={[Symbol.iterator](){let e=0;return{next(){if(e<i.length)return{done:!1,value:i[e++]};if(s)return{done:!0,value:void 0};let r=(n??=t[Symbol.iterator]()).next();return r.done?(s=!0,{done:!0,value:void 0}):(i.push(r.value),e++,r)}}}};return sE(e,e=>sk(a,t=>r(e,t)))[Symbol.iterator]()}});let sC=()=>({});(e,t)=>{let r=sC();for(let n of e){let[e,i]=t(n);ry(r,e,i)}return r};let sA=eZ(2,(e,t)=>Object.hasOwn(e,t)),sI=((e,t,r)=>sA(e,t)?nv({...e,[t]:r(e[t])}):nb,eZ(2,(e,t)=>{if(!sA(e,t))return{...e};let r={...e};return delete r[t],r})),sT=eZ(2,(e,t)=>{let r={...e};for(let n of sO(e))ry(r,n,t(e[n],n));return r}),sO=e=>Object.keys(e),sN=eZ(3,(e,t,r)=>({...e,[t]:r})),sM=globalThis.Array,sU=eZ(2,(e,t)=>{let r=sh(e),n=new sM(r);for(let e=0;e<r;e++)n[e]=t(e);return n}),s$=e=>sM.isArray(e)?e:sM.from(e),sj=e=>sM.isArray(e)?e:[e],sB=eZ(2,(e,{onEmpty:t,onNonEmpty:r})=>sD(e)?r(e):t()),sP=eZ(2,(e,t)=>[t,...e]),sR=eZ(2,(e,t)=>[...e,t]),sL=eZ(2,(e,t)=>s$(e).concat(s$(t))),sF=sM.isArray,sD=sf;function sz(e){let t=Number(e);return String(t)===e&&Number.isInteger(t)&&t>=0&&t<0xffffffff}function sH(e,t){return!Number.isFinite(e)||e<0||e>=t.length}let sJ=eZ(2,(e,t)=>{let r=Math.floor(t);if(sH(r,e))throw Error(`Index out of bounds: ${r}`);return e[r]}),sW=sJ(0),sq=e=>e[e.length-1],sK=((e,t)=>{let r,n,i=s$(e);return i.slice(0,(r=t,n=i.length,Math.min(sd(r),n)))},eZ(2,(e,t)=>{let r=0;for(let n of e){if(t(n,r))return nv(r);r++}return nb})),sV=eZ(2,(e,t)=>{let r=s$(e);for(let e=r.length-1;e>=0;e--)if(t(r[e],e))return nv(e);return nb}),sG=eZ(2,(e,t)=>{let r=s$(e);for(let e=r.length-1;e>=0;e--){let n=r[e],i=t(n,e);if("boolean"==typeof i){if(i)return nv(n)}else if(nm(i))return i}return nb}),sY=eZ(3,(e,t,r)=>{let n=sM.from(e),i=Math.floor(t);if(sH(i,n))return nb;let s=r(n[i]);return n[i]=s,nv(n)}),sZ=eZ(2,(e,t)=>{let r=sM.from(e),n=Math.floor(t);return sH(n,r)||r.splice(n,1),r}),sX=e=>sM.from(e).reverse(),sQ=eZ(2,(e,t)=>{let r=sM.from(e);return r.sort(t),r}),s0=eZ(3,(e,t,r)=>sM.from(e).map(e=>[e,t(e)]).sort(([,e],[,t])=>r(e,t)).map(([e])=>e)),s1=eZ(3,(e,t,r)=>{let n=s$(e),i=s$(t);if(sD(n)&&sD(i)){let e=[r(sW(n),sW(i))],t=Math.min(n.length,i.length);for(let s=1;s<t;s++)e[s]=r(n[s],i[s]);return e}return[]}),s2=((e,t)=>[t(sW(e)),...e.slice(1)],eZ(2,(e,t)=>{let r=s$(e);if(sD(r)){let e=r.length,n=Math.round(t)%e;if(sH(Math.abs(n),r)||0===n)return s9(r);if(!(n<0))return s2(r,n-e);{let[e,t]=s6(r,-n);return sL(t,e)}}return[]})),s3=e=>eZ(2,(t,r)=>{for(let n of t)if(e(r,n))return!0;return!1}),s5=s3(tK),s8=eZ(2,(e,t)=>{let r=s$(e);if(sD(r)){let[e,n]=t(r),i=[e],s=n;for(;sf(s);){let[e,r]=t(s);i.push(e),s=r}return i}return[]}),s4=eZ(2,(e,t)=>{let r=sM.from(e),n=sd(t);return sD(r)?n>=1?s6(r,n):[[],r]:[r,[]]}),s6=eZ(2,(e,t)=>{let r=sh(t);return r>=e.length?[s9(e),[]]:[sP(e.slice(1,r),sW(e)),e.slice(r)]}),s9=e=>e.slice();(e,t)=>{let r=s$(e);return sD(r)?s8(r,s6(t)):[]};let s7=eZ(2,(e,t)=>{let r={};for(let n of e){let e=t(n);Object.hasOwn(r,e)?r[e].push(n):ry(r,e,[n])}return r}),ae=(e,t)=>{let r=tA(t),n=e.get(r);if(void 0===n)return e.set(r,[t]),!0;for(let e of n)if(tK(e,t))return!1;return n.push(t),!0},at=e=>{let t=new Map;for(let r of e)ae(t,r);return t},ar=(e,t)=>{let r=e.get(tA(t));if(void 0===r)return!1;for(let e of r)if(tK(e,t))return!0;return!1},an=eZ(2,(e,t)=>{let r=s$(e),n=s$(t);return sD(r)?sD(n)?ab(sL(r,n)):r:n}),ai=eZ(2,(e,t)=>{let r=s$(t),n=s$(e);if(0===n.length||0===r.length)return[];let i=at(r);return n.filter(e=>ar(i,e))}),as=eZ(2,(e,t)=>{let r=s$(t),n=s$(e);if(0===n.length)return[];if(0===r.length)return n.filter(()=>!0);let i=at(r);return n.filter(e=>!ar(i,e))}),aa=()=>[],ao=e=>[e],al=eZ(2,(e,t)=>e.map(t)),au=eZ(2,(e,t)=>{if(0===e.length)return[];let r=[];for(let n=0;n<e.length;n++){let i=t(e[n],n);for(let e=0;e<i.length;e++)r.push(i[e])}return r}),ac=e=>{let t=[];for(let r of e)nm(r)&&t.push(r.value);return t},af=eZ(2,(e,t)=>{let r=s$(e),n=[];for(let e=0;e<r.length;e++){let i=t(r[e],e);nC(i)&&n.push(i.success)}return n}),ad=eZ(2,(e,t)=>{let r=s$(e),n=[];for(let e=0;e<r.length;e++)t(r[e],e)&&n.push(r[e]);return n}),ah=eZ(2,(e,t)=>{let r=[],n=[],i=0;for(let s of e){let e=t(s,i++);nC(e)?r.push(e.success):n.push(e.failure)}return[r,n]}),ap=ah(eX),ag=eZ(3,(e,t,r)=>s$(e).reduce((e,t,n)=>r(e,t,n),t)),am=eZ(3,(e,t,r)=>s$(e).reduceRight((e,t,n)=>r(e,t,n),t)),ab=e=>{let t=s$(e);if(t.length<2)return[...t];let r=new Map,n=[];for(let e of t)ae(r,e)&&n.push(e);return n},ay=(eZ(2,(e,t)=>{let r=[],n=nb;for(let i of e)(ng(n)||!t(i,n.value))&&(r.push(i),n=nv(i));return r}))(tK),av=eZ(3,(e,t,r)=>{let n=0,i=t,s=[];for(let t of e){let e=r(i,t,n);i=e[0],s.push(e[1]),n++}return[i,s]});(e,t,r)=>au(e,e=>al(t,t=>r(e,t))),e.s(["y",0,e=>new sM(sd(e)),"z",0,sR,"I",0,sL,"J",0,s5,"f",0,s3,"X",0,ab,"D",0,ay,"S",0,as,"_",0,e=>{let t=s3(e);return eZ(2,(e,r)=>{let n=s$(r);return s$(e).filter(e=>!t(n,e))})},"R",0,aa,"B",0,sj,"m",0,ad,"E",0,af,"x",0,sS,"A",0,sK,"$",0,sG,"C",0,sV,"T",0,au,"v",0,s$,"d",0,ac,"F",0,sJ,"i",0,s7,"s",0,ai,"o",0,sF,"G",0,sf,"U",0,sz,"Q",0,sD,"H",0,e=>sD(e)?nv(sq(e)):nb,"K",0,sq,"L",0,sU,"k",0,t6,"w",0,al,"M",0,av,"l",0,sB,"t",0,sY,"j",0,ao,"N",0,ah,"n",0,(e,t)=>e<=t?sU(t-e+1,t=>e+t):[e],"r",0,ag,"V",0,am,"O",0,sZ,"Y",0,sX,"W",0,ap,"g",0,sQ,"h",0,s0,"P",0,an,"u",0,e=>{let t=s$(e);if(sD(t)){let e=[t[0][0]],r=[t[0][1]];for(let n=1;n<t.length;n++)e[n]=t[n][0],r[n]=t[n][1];return[e,r]}return[[],[]]},"p",0,s1],39916);let ax="~effect/Duration",aw=BigInt(0),aS=BigInt(1),ak=BigInt(2),aE=BigInt(10),a_=BigInt(24),aC=BigInt(60),aA=BigInt(1e3),aI=BigInt(1e6),aT=BigInt(1e9),aO=BigInt(6e10),aN=BigInt(36e11),aM=BigInt(864e11),aU=BigInt(6048e11),a$=e=>BigInt(Math.sign(e)*Math.round(Math.abs(e))),aj=e=>Number.isInteger(e)?BigInt(e)*aI:a$(1e6*e),aB=e=>aY(Number.isFinite(e)?a$(e):e),aP=(e,t)=>{let r=Number(e);if(Number.isFinite(r))return r/t;let n=BigInt(t);return Number(e/n)+Number(e%n)/t},aR=(e,t)=>{let r=e.indexOf(".");if(-1===r)return BigInt(e)*t;let n="-"===e[0],i=e.slice(r+1),s=aE**BigInt(i.length),a=(BigInt(e.slice(+!!n,r))*s+BigInt(i))*t;return aL(n?-a:a,s)},aL=(e,t)=>{let r=e<aw?-e:e,n=r/t+(r%t*ak>=t?aS:aw);return e<aw?-n:n},aF=(e,t)=>{let r=Number(e)*t;if(!Number.isFinite(r))return aY(r);let n=aR(e,BigInt(t)*aI);return aY(Number.isInteger(r)&&BigInt(r)*aI===n?r:n)},aD=/^(-?\d+(?:\.\d+)?)\s+(nanos?|micros?|millis?|seconds?|minutes?|hours?|days?|weeks?)$/,az=e=>{switch(typeof e){case"number":return a5(e);case"bigint":return a3(e);case"string":{if("Infinity"===e)return a1;if("-Infinity"===e)return a2;let t=aD.exec(e);if(!t)break;let[r,n,i]=t;if("nano"===i||"nanos"===i)return a3(aR(n,aS));if("micro"===i||"micros"===i)return a3(aR(n,aA));switch(i){case"milli":case"millis":return aF(n,1);case"second":case"seconds":return aF(n,1e3);case"minute":case"minutes":return aF(n,6e4);case"hour":case"hours":return aF(n,36e5);case"day":case"days":return aF(n,864e5);case"week":case"weeks":return aF(n,6048e5)}break}case"object":{if(null===e)break;if(ax in e)return e;if(Array.isArray(e)){if(2!==e.length||!e.every(to))return aW(e);if(Number.isNaN(e[0])||Number.isNaN(e[1]))return a0;if(-1/0===e[0]||-1/0===e[1])return a2;if(1/0===e[0]||1/0===e[1])return a1;let t=1e9*e[0]+e[1];return Number.isFinite(t)&&Number.isInteger(e[0])&&Number.isInteger(e[1])?aY(BigInt(e[0])*aT+BigInt(e[1])):aB(t)}let t=0;if(e.weeks&&(t+=6048e5*e.weeks),e.days&&(t+=864e5*e.days),e.hours&&(t+=36e5*e.hours),e.minutes&&(t+=6e4*e.minutes),e.seconds&&(t+=1e3*e.seconds),e.milliseconds&&(t+=e.milliseconds),!e.microseconds&&!e.nanoseconds){if(!Number.isFinite(t))return aY(t);let r=aJ(e);return void 0===r||BigInt(t)*aI===r?aY(t):aY(r)}let r=1e6*t+(e.microseconds??0)*1e3+(e.nanoseconds??0),n=Number.isFinite(r)?aJ(e):void 0;return void 0===n?aB(r):aY(n)}}return aW(e)},aH=e=>!e||Number.isInteger(e),aJ=e=>{if(!aH(e.weeks)||!aH(e.days)||!aH(e.hours)||!aH(e.minutes)||!aH(e.seconds)||!aH(e.milliseconds)||!aH(e.microseconds)||!aH(e.nanoseconds))return;let t=aw;return e.weeks&&(t+=BigInt(e.weeks)*aU),e.days&&(t+=BigInt(e.days)*aM),e.hours&&(t+=BigInt(e.hours)*aN),e.minutes&&(t+=BigInt(e.minutes)*aO),e.seconds&&(t+=BigInt(e.seconds)*aT),e.milliseconds&&(t+=BigInt(e.milliseconds)*aI),e.microseconds&&(t+=BigInt(e.microseconds)*aA),e.nanoseconds&&(t+=BigInt(e.nanoseconds)),t},aW=e=>{throw Error(`Invalid Input: ${e}`)},aq={_tag:"Millis",millis:0},aK={_tag:"Infinity"},aV={_tag:"NegativeInfinity"},aG={[ax]:ax,[tC](){switch(this.value._tag){case"Millis":return tA(aj(this.value.millis));case"Nanos":return tA(this.value.nanos);default:return tP(this.value)}},[tq](e){return aZ(e)&&on(this,e)},toString(){switch(this.value._tag){case"Infinity":return"Infinity";case"NegativeInfinity":return"-Infinity";case"Nanos":return`${this.value.nanos} nanos`;case"Millis":return`${this.value.millis} millis`}},toJSON(){switch(this.value._tag){case"Millis":return{_id:"Duration",_tag:"Millis",millis:this.value.millis};case"Nanos":return{_id:"Duration",_tag:"Nanos",nanos:String(this.value.nanos)};case"Infinity":return{_id:"Duration",_tag:"Infinity"};case"NegativeInfinity":return{_id:"Duration",_tag:"NegativeInfinity"}}},[rc](){return this.toJSON()},pipe(){return eV(this,arguments)}},aY=e=>{let t=Object.create(aG);return"number"==typeof e?isNaN(e)||0===e||Object.is(e,-0)?t.value=aq:Number.isFinite(e)?Number.isInteger(e)?t.value={_tag:"Millis",millis:e}:t.value={_tag:"Nanos",nanos:aj(e)}:t.value=e>0?aK:aV:e===aw?t.value=aq:t.value={_tag:"Nanos",nanos:e},t},aZ=e=>tx(e,ax),aX=e=>"Infinity"!==e.value._tag&&"NegativeInfinity"!==e.value._tag,aQ=e=>{switch(e.value._tag){case"Millis":return 0===e.value.millis;case"Nanos":return e.value.nanos===aw;case"Infinity":case"NegativeInfinity":return!1}},a0=aY(0),a1=aY(1/0),a2=aY(-1/0),a3=e=>aY(e),a5=e=>aY(e),a8=e=>aY(1e3*e),a4=e=>a7(az(e),{onMillis:eX,onNanos:e=>aP(e,1e6),onInfinity:()=>1/0,onNegativeInfinity:()=>-1/0}),a6=e=>a7(az(e),{onMillis:e=>e/1e3,onNanos:e=>aP(e,1e9),onInfinity:()=>1/0,onNegativeInfinity:()=>-1/0}),a9=e=>{let t=az(e);switch(t.value._tag){case"Infinity":case"NegativeInfinity":throw Error("Cannot convert infinite duration to nanos");case"Nanos":return t.value.nanos;case"Millis":return aj(t.value.millis)}},a7=eZ(2,(e,t)=>{switch(e.value._tag){case"Millis":return t.onMillis(e.value.millis);case"Nanos":return t.onNanos(e.value.nanos);case"Infinity":return t.onInfinity();case"NegativeInfinity":return(t.onNegativeInfinity??t.onInfinity)()}}),oe=eZ(3,(e,t,r)=>"Infinity"===e.value._tag||"NegativeInfinity"===e.value._tag||"Infinity"===t.value._tag||"NegativeInfinity"===t.value._tag?r.onInfinity(e,t):"Millis"===e.value._tag?"Millis"===t.value._tag?r.onMillis(e.value.millis,t.value.millis):r.onNanos(a9(e),t.value.nanos):r.onNanos(e.value.nanos,a9(t))),ot=nN((e,t)=>oe(e,t,{onMillis:(e,t)=>e<t?-1:+(e>t),onNanos:(e,t)=>e<t?-1:+(e>t),onInfinity:(e,t)=>e.value._tag===t.value._tag?0:"Infinity"===e.value._tag?1:"NegativeInfinity"===e.value._tag||"Infinity"===t.value._tag?-1:1})),or=(O=ot,eZ(2,(e,t)=>e===t||O(e,t)>-1?e:t)),on=((e,t)=>oe(e,t,{onMillis:(e,t)=>aY(e-t),onNanos:(e,t)=>aY(e-t),onInfinity:(e,t)=>{let r=e.value._tag,n=t.value._tag;return"Infinity"===r?"Infinity"===n?a0:a1:"NegativeInfinity"===r?"NegativeInfinity"===n?a0:a2:"Infinity"===n?a2:a1}}),eZ(2,(e,t)=>oe(e,t,{onMillis:(e,t)=>e===t,onNanos:(e,t)=>e===t,onInfinity:(e,t)=>e.value._tag===t.value._tag})));(e,t,r)=>n=>{let i=e(n);if(n_(i))return i;let s=t(n);return n_(s)?s:nO(r(i.success,s.success))};let oi=iJ("effect/Scheduler",{fiberCached:!0,defaultValue:()=>new ou}),os=e=>{let t=!1;return Promise.resolve().then(()=>{t||e()}),()=>{t=!0}},oa="setImmediate"in globalThis?e=>{let t=globalThis.setImmediate(e);return()=>globalThis.clearImmediate(t)}:e=>{let t=setTimeout(e,0);return()=>clearTimeout(t)},oo=e=>{try{return oa(e)}catch{return os(e)}};class ol{buckets=[];scheduleTask(e,t){let r,n=this.buckets,i=n.length,s=0;for(;s<i&&!(n[s][0]>t);s++)r=n[s];r&&r[0]===t?r[1].push(e):s===i?n.push([t,[e]]):n.splice(s,0,[t,[e]])}drain(){let e=this.buckets;return this.buckets=[],e}}class ou{executionMode;setImmediate;constructor(e="async",t){this.executionMode=e,this.setImmediate=t??("sync"===e?os:oo)}shouldYield(e){return e.currentOpCount>=e.cache.maxOpsBeforeYield}makeDispatcher(){return new oc(this.setImmediate)}}class oc{tasks=new ol;running=void 0;setImmediate;constructor(e=oo){this.setImmediate=e}scheduleTask(e,t){this.tasks.scheduleTask(e,t),void 0===this.running&&(this.running=this.setImmediate(this.afterScheduled))}afterScheduled=()=>{this.running=void 0,this.runTasks()};runTasks(){let e=this.tasks.drain();for(let t=0;t<e.length;t++){let r=e[t][1];for(let e=0;e<r.length;e++)r[e]()}}flush(){for(;this.tasks.buckets.length>0;)void 0!==this.running&&(this.running(),this.running=void 0),this.runTasks()}}let of=iJ("effect/Scheduler/MaxOpsBeforeYield",{fiberCached:!0,defaultValue:()=>2048}),od=iJ("effect/Scheduler/PreventSchedulerYield",{fiberCached:!0,defaultValue:()=>!1}),oh=class extends eY{constructor(e){super(),e&&rv(this,e)}},op=e=>class extends oh{_tag=e},og=ne,om=nt;e.s(["g",0,oh,"h",0,og,"J",0,op,"B",0,om],47773);let ob="~effect/encoding/EncodingError";class oy extends om("EncodingError"){[ob]=ob}let ov=e=>"string"==typeof e?oO(oA.encode(e)):oO(e),ox=e=>{switch(e){case 16:return oE();case 32:return o_();default:{let t="";for(let r=e>>>3;r>0;r--)t+=ok();return t}}},ow=Uint8Array.from("0123456789abcdef",e=>e.charCodeAt(0)),oS=()=>0x100000000*Math.random()>>>0,ok=()=>{let e=oS();return String.fromCharCode(ow[e>>>28],ow[e>>>24&15],ow[e>>>20&15],ow[e>>>16&15],ow[e>>>12&15],ow[e>>>8&15],ow[e>>>4&15],ow[15&e])},oE=()=>{let e=oS(),t=oS();return String.fromCharCode(ow[e>>>28],ow[e>>>24&15],ow[e>>>20&15],ow[e>>>16&15],ow[e>>>12&15],ow[e>>>8&15],ow[e>>>4&15],ow[15&e],ow[t>>>28],ow[t>>>24&15],ow[t>>>20&15],ow[t>>>16&15],ow[t>>>12&15],ow[t>>>8&15],ow[t>>>4&15],ow[15&t])},o_=()=>{let e=oS(),t=oS(),r=oS(),n=oS();return String.fromCharCode(ow[e>>>28],ow[e>>>24&15],ow[e>>>20&15],ow[e>>>16&15],ow[e>>>12&15],ow[e>>>8&15],ow[e>>>4&15],ow[15&e],ow[t>>>28],ow[t>>>24&15],ow[t>>>20&15],ow[t>>>16&15],ow[t>>>12&15],ow[t>>>8&15],ow[t>>>4&15],ow[15&t],ow[r>>>28],ow[r>>>24&15],ow[r>>>20&15],ow[r>>>16&15],ow[r>>>12&15],ow[r>>>8&15],ow[r>>>4&15],ow[15&r],ow[n>>>28],ow[n>>>24&15],ow[n>>>20&15],ow[n>>>16&15],ow[n>>>12&15],ow[n>>>8&15],ow[n>>>4&15],ow[15&n])},oC=e=>{let t=new TextEncoder().encode(e);if(t.length%2!=0)return nI(new oy({module:"Hex",kind:"Decode",input:e,message:`Length must be a multiple of 2, but is ${t.length}`}));try{let e=t.length/2,r=new Uint8Array(e);for(let n=0;n<e;n++){let e=oN(t[2*n]),i=oN(t[2*n+1]);r[n]=e<<4|i}return nO(r)}catch(t){return nI(new oy({module:"Hex",kind:"Decode",input:e,message:t instanceof Error?t.message:"Invalid input"}))}},oA=new TextEncoder,oI=new TextDecoder,oT=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0")),oO=e=>{let t="";for(let r=0;r<e.length;r++)t+=oT[e[r]];return t},oN=e=>{if(48<=e&&e<=57)return e-48;if(97<=e&&e<=102)return e-97+10;if(65<=e&&e<=70)return e-65+10;throw TypeError("Invalid input")},oM="effect/Tracer/ParentSpan";class oU extends(iJ())(oM,{fiberCached:!0}){}let o$=iJ("effect/Tracer/DisablePropagation",{defaultValue:e1}),oj=iJ("effect/Tracer/CurrentTraceLevel",{defaultValue:()=>"Info"}),oB=iJ("effect/Tracer/MinimumTraceLevel",{defaultValue:()=>"All"}),oP="effect/Tracer",oR=iJ(oP,{fiberCached:!0,defaultValue:()=>oL}),oL={span:e=>new oF(e)};class oF{_tag="Span";sampled;name;parent;annotations;links;startTime;kind;status;_traceId=void 0;_spanId=void 0;_attributes=void 0;_events=void 0;constructor(e){this.name=e.name,this.parent=e.parent,this.annotations=e.annotations,this.links=e.links,this.startTime=e.startTime,this.kind=e.kind,this.sampled=e.sampled,this.status={_tag:"Started",startTime:e.startTime}}get traceId(){return this._traceId??=nq(this.parent)?.traceId??ox(32)}get spanId(){return this._spanId??=ox(16)}get attributes(){return this._attributes??=new Map}get events(){return this._events??=[]}end(e,t){"Ended"!==this.status._tag&&(this.status={_tag:"Ended",endTime:e,exit:t,startTime:this.status.startTime})}attribute(e,t){"Ended"!==this.status._tag&&this.attributes.set(e,t)}event(e,t,r){"Ended"!==this.status._tag&&this.events.push([e,t,r??{}])}addLinks(e){"Ended"!==this.status._tag&&this.links.push(...e)}}let oD=iJ("effect/ErrorReporter/CurrentErrorReporters",{defaultValue:()=>new Set}),oz=iJ("effect/References/CurrentStackFrame",{fiberCached:!0,defaultValue:e3}),oH=iJ("effect/References/TracerEnabled",{fiberCached:!0,defaultValue:e0}),oJ=iJ("effect/References/TracerTimingEnabled",{defaultValue:e0}),oW=iJ("effect/References/TracerSpanAnnotations",{defaultValue:()=>({})}),oq=iJ("effect/References/TracerSpanLinks",{defaultValue:()=>[]}),oK=iJ("effect/References/CurrentLogAnnotations",{defaultValue:()=>({})}),oV=iJ("effect/References/CurrentLogLevel",{fiberCached:!0,defaultValue:()=>"Info"}),oG=iJ("effect/References/MinimumLogLevel",{fiberCached:!0,defaultValue:()=>"Info"}),oY=iJ("effect/References/UnhandledLogLevel",{defaultValue:()=>"Error"}),oZ=iJ("effect/References/CurrentLogSpans",{defaultValue:()=>[]}),oX=e=>{if(e?.captureStackTrace===!1||e?.captureStackTrace!==void 0&&"boolean"!=typeof e.captureStackTrace)return e;let t=Error.stackTraceLimit;if(0===t&&e?.captureStackTrace!==!0)return{...e,captureStackTrace:!1};rg(3);let r=Error();return rg(t),{...e,captureStackTrace:oQ(()=>r.stack)}},oQ=e=>{let t;return()=>{if(void 0!==t)return t;let r=e();if(!r)return;let n=r.split("\n");if(void 0!==n[3])return t=n[3].trim()}};class o0 extends rP{constructor(e,t=rR){super("Interrupt",t,"Interrupted"),this.fiberId=e}toString(){return`Interrupt(${this.fiberId})`}toJSON(){return{_tag:"Interrupt",fiberId:this.fiberId}}[tq](e){return rY(e)&&this.fiberId===e.fiberId&&this.annotations===e.annotations}[tC](){return tj(`${this._tag}:${this.fiberId}`)}}let o1=e=>new rj([new o0(e)]),o2=e=>e.reasons.some(rV),o3=e=>{for(let t=0;t<e.reasons.length;t++){let r=e.reasons[t];if("Fail"===r._tag)return nO(r.error)}return nI(e)},o5=e=>e.reasons.some(rG)&&o2(e)?rF(e.reasons.map(e=>"Fail"!==e._tag||ns(e.error)?e:new rW(e.error,e.annotations))):e,o8=e=>e.reasons.some(rG)?nI(o5(e)):o3(e),o4=e=>{let t=e.reasons.find(rG);return t?nO(t.defect):nI(e)},o6=e=>e.reasons.some(rY),o9=e=>{let t;for(let r=0;r<e.reasons.length;r++){let n=e.reasons[r];"Interrupt"===n._tag&&(t??=new Set,void 0!==n.fiberId&&t.add(n.fiberId))}return t?nO(t):nI(e)},o7=eZ(2,(e,t)=>{let r=!1,n=e.reasons.map(e=>rV(e)?(r=!0,new rL(t(e.error),e.annotations)):e);return r?rF(n):e}),le=e=>{let t;for(let r of e.reasons){if("Fail"===r._tag)return r.error;"Die"===r._tag&&(t??=r)}return void 0!==t?t.defect:new globalThis.Error(e.reasons.length>0?"All fibers interrupted without error":"Empty cause")},lt=(e,t,r,n=new Set)=>{let i,s=typeof e;if(e&&"object"===s){n.add(e);let s=e.cause;if(i=new globalThis.Error(lr(e),{cause:void 0===s||n.has(s)?void 0:lt(s,void 0,void 0,n)}),"string"==typeof e.name&&(i.name=e.name),"string"==typeof e.stack)i.stack=li(e.stack,i,t);else{let e=`${i.name}: ${i.message}`;i.stack=t?ls(e,t):e}for(let t of(r?.includeCauseInStack&&(i.stack=ll(i)),Object.keys(e)))t in i||(i[t]=e[t])}else{i=new globalThis.Error(!e?`Unknown error: ${e}`:"string"===s?e:ru(e));let r=`${i.name}: ${i.message}`;i.stack=t?ls(r,t):r}return i},lr=e=>{if("string"==typeof e.message)return e.message;if("function"==typeof e.toString&&e.toString!==Object.prototype.toString&&e.toString!==Array.prototype.toString)try{return e.toString()}catch{}return ru(e)},ln=/\((.*)\)/g,li=(e,t,r)=>{let n=`${t.name}: ${t.message}`,i=(e.startsWith(n)?e.slice(n.length):e).split("\n"),s=[n];for(let e=1;e<i.length&&!/Generator\.next|~effect\/(?:Effect|Utils)/.test(i[e]);e++)s.push(i[e]);return r?ls(s.join("\n"),r):s.join("\n")},ls=(e,t)=>{let r=t?.get(r2.key);return r&&(e=`${e}
|
|
6
|
+
${la(r)}`),e},la=e=>{let t=[],r=e,n=0;for(;r&&n<10;){let e=r.stack();if(e){let n=e.matchAll(ln),i=!1;for(let[,e]of n)i=!0,t.push(` at ${r.name} (${e})`);i||t.push(` at ${r.name} (${e.replace(/^at /,"")})`)}else t.push(` at ${r.name}`);r=r.parent,n++}return t.join("\n")},lo=e=>(e=>{let t=[],r=[];if(0===e.reasons.length)return t;let n=Error.stackTraceLimit;0!==n&&rg(1);try{for(let n of e.reasons){if("Interrupt"===n._tag){r.push(n);continue}t.push(lt("Die"===n._tag?n.defect:n.error,n.annotations,void 0))}if(0===t.length){let e=Error("The fiber was interrupted by:");e.name="InterruptCause",e.stack=((e,t)=>{let r=[`${e.name}: ${e.message}`];for(let e of t){let t=void 0!==e.fiberId?`#${e.fiberId}`:"unknown",n=e.annotations.get(r3);r.push(` at fiber (${t})`),n&&r.push(la(n))}return r.join("\n")})(e,r);let n=new globalThis.Error("All fibers interrupted without error",{cause:e});n.name="InterruptError",n.stack=`${n.name}: ${n.message}`,t.push(lt(n,r[0].annotations,void 0))}}finally{0!==n&&rg(n)}return t})(e).map(ll).join("\n"),ll=e=>e.cause?`${e.stack} {
|
|
7
|
+
${lu(e.cause," ")}
|
|
8
|
+
}`:e.stack,lu=(e,t)=>{let r=e.stack.split("\n"),n=`${t}[cause]: ${r[0]}`;for(let e=1,i=r.length;e<i;e++)n+=`
|
|
9
|
+
${t}${r[e]}`;return e.cause&&(n+=` {
|
|
10
|
+
${lu(e.cause,`${t} `)}
|
|
11
|
+
${t}}`),n},lc="~effect/Fiber",lf={_A:eX,_E:eX},ld={id:0},lh=(()=>{try{return globalThis.process?.getBuiltinModule?.("node:async_hooks")?.AsyncResource}catch{return}})(),lp=()=>void 0===lh?void 0:new lh("effect/Fiber"),lg=()=>globalThis[rt];class lm{constructor(e,t=!0){this.setContext(e),this.id=++ld.id,this.currentOpCount=0,this.interruptible=t,this._stack=[],this._observers=void 0,this._exit=void 0,this._children=void 0,this._interruptedCause=void 0,this._yielded=void 0,this._running=!1,this._deferredInterrupt=!1,this._parent=void 0,this._asyncContext=void 0,this.cache.runtimeMetrics?.recordFiberStart(this.context)}get[lc](){return lf}get currentDispatcher(){return this._dispatcher??=this.cache.scheduler.makeDispatcher()}getRef(e){return si(this.context,e)}addObserver(e){return this._exit?(e(this._exit),e3):(void 0===this._observers?this._observers=[e]:this._observers.push(e),()=>this.removeObserver(e))}removeObserver(e){if(this._exit||void 0===this._observers)return;let t=this._observers.indexOf(e);t>=0&&this._observers.splice(t,1)}interruptUnsafe(e,t){if(this._exit)return;let r=o1(e);this.cache.stackFrame&&(r=rK(r,i9(r2,this.cache.stackFrame))),t&&(r=rK(r,t)),this._interruptedCause=this._interruptedCause?rz(this._interruptedCause,r):r,this.interruptible&&(this._running?this._deferredInterrupt=!0:this.evaluate(lT(this._interruptedCause)))}pollUnsafe(){return this._exit}evaluate(e){if(this._exit)return;if(void 0!==this._asyncContext){let t=this._asyncContext;this._asyncContext=void 0;try{return t.runInAsyncScope(this.evaluate,this,e)}finally{t.emitDestroy()}}if(void 0!==this._yielded){let e=this._yielded;this._yielded=void 0,e()}let t=this.runLoop(e);if(t===rI){this._asyncContext=lp();return}let r=lx.interruptChildren&&lx.interruptChildren(this);if(void 0!==r)return this.evaluate(ue(r,()=>t));if(this._exit=t,this.cache.runtimeMetrics?.recordFiberEnd(this.context,this._exit),this._parent&&(this._parent._children?.delete(this),this._parent=void 0),void 0!==this._observers){let e=this._observers;this._observers=void 0;for(let r=0;r<e.length;r++)e[r](t)}this._stack.length=0,this._children=void 0,this.context=i4();let n=this.cache;(void 0!==n.span||void 0!==n.stackFrame)&&(this.cache={...n,span:void 0,stackFrame:void 0})}runLoop(e){let t=globalThis[rt];globalThis[rt]=this;let r=this._running;this._running=!0;let n=!1,i=e;this.currentOpCount=0;try{for(;;)try{this._deferredInterrupt&&(this._deferredInterrupt=!1,i=lT(this._interruptedCause)),this.currentOpCount++;let e=this.cache;if(!n&&!e.preventYield&&e.scheduler.shouldYield(this)){n=!0;let e=i;i=ue(lU,()=>e)}if((i=e.tracerContext?e.tracerContext(i,this):i[rE](this))===rI){let e=this._yielded;if(rw in e)return this._deferredInterrupt=!1,this._yielded=void 0,e;if(this._deferredInterrupt){this._yielded=void 0,e();continue}return rI}}catch(e){if(!tx(i,rE))return r4(`Fiber.runLoop: Not a valid effect: ${String(i)}`);i=r4(e)}}finally{this._running=r,globalThis[rt]=t}}getCont(e){if(this._deferredInterrupt)return this._deferredInterrupt=!1,ly;for(;;){let t=this._stack.pop();if(!t)return;let r=t[rA];if(void 0!==r){let n=r.call(t,this);if(n)return n[e]=n,n}if(t[e])return t}}succeedWith(e){if((++this.currentOpCount&lv-1)==0)return r1(e);let t=this.getCont(r_);return t?t[r_](e,this):this.yieldWith(r1(e))}yieldWith(e){return this._yielded=e,rI}children(){return this._children??=new Set}pipe(){return eV(this,arguments)}setContext(e){let t=this.context;if(this.context=e,void 0!==t&&i3(t,e))return;let r=e.cacheRoot,n=r._fiberCache??=lb(e);this.cache?.scheduler!==n.scheduler&&(this._dispatcher=void 0),this.cache=n}get currentSpanLocal(){let e=this.cache.span;return e?._tag==="Span"?e:void 0}}let lb=e=>{let t=sr(e,oP);return{scheduler:si(e,oi),tracer:t,tracerContext:t?t.context:void 0,tracerEnabled:si(e,oH),span:sr(e,oM),logLevel:si(e,oV),minimumLogLevel:si(e,oG),stackFrame:si(e,oz),runtimeMetrics:sr(e,"effect/Metric/FiberRuntimeMetrics"),maxOpsBeforeYield:si(e,of),preventYield:si(e,od)}},ly={[r_]:(e,t)=>lT(t._interruptedCause),[rC]:(e,t)=>lT(t._interruptedCause)},lv=32,lx={interruptChildren:void 0},lw=e=>{if(!e.cache.stackFrame)return;let t=new Map;return t.set(r3,e.cache.stackFrame),i1(t)},lS=e=>{if(void 0!==e._children&&0!==e._children.size)return lA(e._children)},lk=e=>lD(t=>{let r,n=e[Symbol.iterator](),i=[];return!function e(){let s=n.next();for(;!s.done;){if(s.value._exit){i.push(s.value._exit),s=n.next();continue}r=s.value.addObserver(t=>{i.push(t),e()});return}t(lI(i))}(),lO(()=>r?.())}),lE=e=>e._exit?e._exit:lD(t=>e._exit?t(e._exit):lO(e.addObserver(t))),l_=e=>r6(t=>lC(e,t.id)),lC=eZ(e=>tx(e[0],lc),(e,t,r)=>r6(n=>{let i,s=lw(n);return s=s&&r?su(s,r):s??r,e.interruptUnsafe(t,s),l9((i=e)._exit?lI(i._exit):lD(e=>i._exit?e(lI(i._exit)):lO(i.addObserver(t=>e(lI(t))))))})),lA=e=>r6(t=>{let r=lw(t),n=aa();for(let i of e)i.interruptUnsafe(t.id,r),n.push(i);return l9(lk(n))}),lI=r1,lT=r5,lO=rQ({op:"Sync",[rE](e){let t=(0,this[rk])(),r=e.getCont(r_);return r?r[r_](t,e):e.yieldWith(r1(t))}}),lN=rQ({op:"Suspend",[rE](e){return(0,this[rk])()}}),lM=((e=>e.length>=2||np(e[0]),(e,t)=>ng(e)?t?lB(t):r8(new nn("Effect.fromOption: Option.none")):lI(e.value)),sb({onFailure:r8,onSuccess:lI})),lU=(rQ({op:"Yield",[rE](e){let t=!1;return e.currentDispatcher.scheduleTask(()=>{t||e.evaluate(ud)},this[rk]??0),e.yieldWith(()=>{t=!0})}}))(0),l$=lI(nb),lj=e=>r4(e),lB=e=>lN(()=>r8(e())),lP=lI(void 0),lR=e=>{let t="function"==typeof e?e:e.try,r="function"==typeof e?e=>new fI(e,"An error occurred in Effect.try"):e.catch;return lN(()=>{try{return lI(t())}catch(e){return r8(r(e))}})},lL=(u=rX({op:"Async",[rE](e){let t=!1,r=!1,n=this.withSignal?new AbortController:void 0,i=this.register.call(e.cache.scheduler,n=>{t||(t=!0,r?e.evaluate(n):r=n)},n?.signal);return!1!==r?r:(r=!0,e.yieldWith(()=>{t=!0}),void 0===n&&void 0===i||e._stack.push(lF(()=>(t=!0,n?.abort(),i??ud))),rI)}}),(c=function(e,t){this.register=e,this.withSignal=t}).prototype=u,function(e,t){return new c(e,t)}),lF=rQ({op:"AsyncFinalizer",[rA](e){e.interruptible&&(e.interruptible=!1,e._stack.push(cU))},[rC](e,t){return o6(e)?ue(cu(r5(e),this[rk]()),()=>lT(e)):lT(e)}}),lD=e=>lL(e,e.length>=2),lz=lD(e3),lH=(e,t)=>"function"==typeof e?e:t.shift().bind(e.self),lJ=(e,...t)=>{let r=lH(e,t),n=0===t.length?function(){return lN(()=>lK(r.apply(this,arguments)))}:function(){let e=lN(()=>lK(r.apply(this,arguments)));for(let r=0;r<t.length;r++)e=t[r](e,...arguments);return e};return lW(r.length,n)},lW=(e,t)=>Object.defineProperty(t,"length",{value:e,configurable:!0}),lq=e=>{try{let t,r=e();for(;;){let n=r.next(t);if(n.done)return lI(n.value);let i=n.value;if(i&&"Success"===i._tag){t=i.value;continue}{if(i&&"Failure"===i._tag)return n.value;let t=!0;return lN(()=>t?(t=!1,ue(n.value,e=>lK(r,e))):lN(()=>lK(e())))}}}catch(e){return lj(e)}},lK=(f=rX({op:"Iterator",[r_](e,t){let r=this.iterator;for(;;){let n=r.next(e);if(n.done)return lI(n.value);if(!ur(n.value))return t._stack.push(this),n.value;if("Failure"===n.value._tag)return n.value;e=n.value.value}},[rE](e){return this[r_](this.initial,e)}}),(d=function(e,t){this.iterator=e,this.initial=t}).prototype=f,function(e,t){return new d(e,t)}),lV=eZ(2,(e,t)=>new lZ(e,lX,lI(t))),lG=function(e){return e._stack.push(this),this[rk]},lY=rX({op:"OnSuccess",[rE]:lG}),lZ=function(e,t,r){this[rk]=e,this[r_]=t,this.payload=r};lZ.prototype=lY;let lX=function(){return this.payload},lQ=function(e,t){return t.succeedWith(this.payload)},l0=(()=>{let e=Error.stackTraceLimit;if(0===e)return!1;let t="~effect/Effect/stackProbe";rg(1);let r=({[t]:function(){return Error()}})[t]();return rg(e),r.stack?.includes("[as "+t+"]")===!0})(),l1=function(e,t){let r=this.payload;return t.succeedWith(l0?r(e):rb(()=>r(e)))},l2=function(e){return(0,this.payload)(e)},l3=function(e){return new lZ((0,this.payload)(e),lQ,e)},l5=function(e){return new lZ(this.payload,lQ,e)},l8=e=>ui(e,nv),l4=eZ(2,(e,t)=>new lZ(e,rN(t)?lX:l2,t)),l6=eZ(2,(e,t)=>new lZ(e,rN(t)?l5:l3,t)),l9=e=>new lZ(e,lX,ud),l7=eZ(e=>rN(e[1]),(e,t,r)=>{let n;return n=[e,t],r6(e=>{let t=new Set;return cw(e,()=>0===t.size?void 0:lA(t)),lD(i=>{let s=!1,a=0;for(let o of n){if(s)break;let n=a++,l=cZ(e,o,!0,!0,!1);t.add(l),l.addObserver(a=>{t.delete(l);let o=!s;s=!0,i(a),o&&r?.onWinner&&r.onWinner({fiber:l,index:n,parentFiber:e})})}})})}),ue=eZ(2,(e,t)=>new lZ(e,l2,t)),ut=eZ(2,(e,t)=>ur(e)?"Success"===e._tag?t.onSuccess(e.value):t.onFailure(e.cause):uX(e,t)),ur=e=>void 0!==e[rw],un=eZ(2,(e,t)=>ur(e)?"Success"===e._tag?t(e.value):e:ue(e,t)),ui=eZ(2,(e,t)=>new lZ(e,l1,t)),us=eZ(2,(e,t)=>ur(e)?uh(e,t):ui(e,t)),ua=eZ(2,(e,t)=>ur(e)?up(e,t):uq(e,t)),uo=eZ(2,(e,t)=>ur(e)?ug(e,t):uK(e,t)),ul=eZ(2,(e,t)=>{if(ur(e)){if("Success"===e._tag)return e;let r=o8(e.cause);return n_(r)?r5(r.failure):t(r.success)}return uP(e,t)}),uu=e=>r5(o1(e)),uc=e=>"Failure"===e._tag?nO(e.cause):nI(e),uf=e=>"Failure"===e._tag&&o6(e.cause),ud=r1(void 0),uh=eZ(2,(e,t)=>"Success"===e._tag?r1(t(e.value)):e),up=eZ(2,(e,t)=>"Success"===e._tag?e:r5(o7(e.cause,t))),ug=eZ(2,(e,t)=>"Success"===e._tag?r1(t.onSuccess(e.value)):r5(o7(e.cause,t.onFailure))),um=eZ(2,(e,t)=>"Success"===e._tag?t:e),ub=eZ(2,(e,t)=>"Success"===e._tag?t.onSuccess(e.value):t.onFailure(e.cause)),uy=e=>{let t=[];for(let r of e)"Failure"===r._tag&&t.push(...r.cause.reasons);return 0===t.length?ud:r5(rF(t))},uv=eZ(2,(e,t)=>r6(r=>{let n=r.context,i=t(n);return n===i||(r.setContext(i),cw(r,()=>{r.setContext(n)})),e})),ux=eZ(3,(e,t,r)=>uv(e,e=>{let n=sn(e,t),i=r(n);return n===i?e:i7(e,t,i)})),uw=()=>uS,uS=r6(e=>lI(e.context)),uk=e=>r6(t=>e(t.context)),uE=eZ(2,(e,t)=>ur(e)?e:uv(e,su(t))),u_=function(){return 1==arguments.length?eZ(2,(e,t)=>uC(e,arguments[0],t)):eZ(3,(e,t,r)=>uC(e,t,r)).apply(this,arguments)},uC=(e,t,r)=>uv(e,i7(t,r)),uA=eZ(3,(e,t,r)=>ue(r,r=>u_(e,t,r))),uI=eZ(e=>rN(e[1]),(e,t,r)=>uT(e,t,(e,t)=>[e,t],r)),uT=eZ(e=>rN(e[1]),(e,t,r,n)=>n?.concurrent?ui(cR([e,t],{concurrency:2}),([e,t])=>r(e,t)):ue(e,e=>ui(t,t=>r(e,t)))),uO=eZ(e=>rN(e[0]),(e,t,r)=>cK(e,t,r?e=>r8(r(e)):()=>r8(new nn))),uN=eZ(2,(e,t)=>ue(t,t=>t?l8(e):l$)),uM=((e,t)=>Array.from({length:t},()=>e),eZ(e=>rN(e[0]),(e,t)=>cL({while:e0,body:eQ(t?.disableYield?e:ue(e,e=>lU)),step:e3}))),uU=eZ(2,(e,t)=>new uj(e,1!==t.length?e=>t(e):t)),u$=rX({op:"OnFailure",[rE]:lG}),uj=function(e,t){this[rk]=e,this[rC]=t};uj.prototype=u$,(e,t,r)=>uU(e,e=>t(e)?r(e):lT(e));let uB=eZ(3,(e,t,r)=>uU(e,e=>{let n=t(e);return n_(n)?lT(n.failure):r(n.success,e)})),uP=eZ(2,(e,t)=>uB(e,o8,e=>t(e))),uR=eZ(2,(e,t)=>uB(e,o4,t)),uL=eZ(3,(e,t,r)=>uU(e,e=>{let n=t(e);return n_(n)?lT(e):l4(r(n.success,e),lT(e))})),uF=eZ(2,(e,t)=>uL(e,o3,e=>t(e))),uD=((e,t)=>uL(e,o4,e=>t(e)),eZ(e=>rN(e[0]),(e,t,r,n)=>uU(e,e=>{let i=o8(e);return n_(i)?lT(i.failure):t(i.success)?r(i.success):n?n(i.success):lT(e)}))),uz=eZ(e=>rN(e[0]),(e,t,r,n)=>uU(e,e=>{let i=o8(e);if(n_(i))return lT(i.failure);let s=t(i.success);return n_(s)?n?n(s.failure):lT(e):r(s.success)})),uH=eZ(e=>rN(e[0]),(e,t,r,n)=>uD(e,Array.isArray(t)?e=>tx(e,"_tag")&&t.includes(e._tag):tw(t),r,n)),uJ=eZ(e=>rN(e[0]),(e,t,r)=>{let n;return uz(e,e=>(n??=Object.keys(t),tx(e,"_tag")&&ta(e._tag)&&n.includes(e._tag)?nO(e):nI(e)),e=>t[e._tag](e),r)}),uW=eZ(e=>rN(e[0]),(e,t,r,n,i)=>uD(e,e=>tw(e,t)&&tx(e,"reason")&&(void 0!==i||tw(e.reason,r)),e=>{let t=e.reason;return tw(t,r)?n(t,e):i?i(t,e):r8(e)})),uq=eZ(2,(e,t)=>uU(e,e=>lT(o7(e,t)))),uK=eZ(2,(e,t)=>uX(e,{onFailure:e=>lT(o7(e,t.onFailure)),onSuccess:e=>lO(()=>t.onSuccess(e))})),uV=e=>"Unhandled"===e?(...e)=>r6(t=>{let r=t.getRef(oY);return void 0===r?lP:fB(r)(...e)}):fB(!0===e?void 0:e),uG=eZ(e=>rN(e[0]),(e,t)=>{if(!t?.log)return u8(e,{onFailure:e=>lP,onSuccess:e=>lP});let r=uV(t.log);return uX(e,{onFailure(e){let n=o8(e);return n_(n)?lT(n.failure):void 0===t.message?r(e):r(t.message,e)},onSuccess:e=>lP})}),uY=eZ(e=>rN(e[0]),(e,t)=>{if(!t?.log)return uX(e,{onFailure:e=>lP,onSuccess:e=>lP});let r=uV(t.log);return uX(e,{onFailure:e=>void 0===t.message?r(e):r(t.message,e),onSuccess:e=>lP})}),uZ=e=>u6(e,{onFailure:nI,onSuccess:nO}),uX=eZ(2,(e,t)=>new u0(e,1!==t.onSuccess.length?e=>t.onSuccess(e):t.onSuccess,1!==t.onFailure.length?e=>t.onFailure(e):t.onFailure)),uQ=rX({op:"OnSuccessAndFailure",[rE]:lG}),u0=function(e,t,r){this[rk]=e,this[r_]=t,this[rC]=r};u0.prototype=uQ;let u1=function(e,t){let r=this.payload;return t.succeedWith(l0?r.onSuccess(e):rb(()=>r.onSuccess(e)))},u2=(e,t)=>{let r=rX({op:e,[rE]:lG,[r_]:u1,[rC]:t}),n=function(e,t){this[rk]=e,this.payload=t};return n.prototype=r,n},u3=u2("Match",function(e,t){let r=o8(e);if(n_(r))return lT(r.failure);let n=this.payload;return t.succeedWith(l0?n.onFailure(r.success):rb(()=>n.onFailure(r.success)))}),u5=u2("MatchCause",function(e,t){let r=this.payload;return t.succeedWith(l0?r.onFailure(e):rb(()=>r.onFailure(e)))}),u8=((e,t)=>new u5(e,t),eZ(2,(e,t)=>uX(e,{onFailure:e=>{let r=o8(e);return n_(r)?lT(r.failure):t.onFailure(r.success)},onSuccess:t.onSuccess}))),u4=eZ(2,(e,t)=>new u3(e,t)),u6=eZ(2,(e,t)=>{if(ur(e)){if("Success"===e._tag)return r1(t.onSuccess(e.value));let r=o8(e.cause);return n_(r)?r5(r.failure):r1(t.onFailure(r.success))}return u4(e,t)}),u9=e=>ur(e)?r1(e):u7(e),u7=rQ({op:"Exit",[rE](e){return e._stack.push(this),this[rk]},[r_]:(e,t,r)=>t.succeedWith(r??r1(e)),[rC]:(e,t,r)=>t.succeedWith(r??r5(e))}),ce=eZ(2,(e,t)=>l4(fb(t),e)),ct=eZ(2,(e,t)=>ue(cr(e,t.duration),e=>ng(e)?t.orElse():lI(e.value))),cr=eZ(2,(e,t)=>l7(l8(e),lV(fb(t),nb))),cn="~effect/Scope",ci="~effect/Scope/Closeable",cs=iJ("effect/Scope"),ca=(e,t)=>r6(r=>(cj(r),co(e,t)??lP)),co=(e,t)=>{let r=e.state;if("Closed"===r._tag||(e.state={_tag:"Closed",exit:t},void 0!==e.parent&&cp(e.parent,e),"Empty"===r._tag))return;if(void 0!==r.finalizer)return cl(r.finalizer,t);let n=r.finalizers;return 1===n.size?cl(n.values().next().value,t):cc(e,n,t)},cl=(e,t)=>{try{return e(t)}catch(e){return r4(e)}},cu=(e,t)=>"Success"===e._tag?t:uU(t,t=>lT(o5(rD(e.cause,t)))),cc=lJ(function*(e,t,r){let n=[],i=[],s=Array.from(t),a=lg();for(let t=s.length-1;t>=0;t--){let[o,l]=s[t];"sequential"===e.strategy?n.push((yield*u9(cl(l,r)))):o!==a&&i.push(cZ(a,cl(l,r),!0,!0,"inherit"))}return i.length>0&&(n=yield*lk(i)),yield*uy(n)}),cf=(e,t)=>{let r=cg(t,e);return"Closed"===e.state._tag?r.state=e.state:ch(e,r,e=>ca(r,e)),r},cd=(e,t)=>lN(()=>"Closed"===e.state._tag?t(e.state.exit):(ch(e,{},t),lP)),ch=(e,t,r)=>{if("Empty"===e.state._tag)e.state={_tag:"Open",finalizerKey:t,finalizer:r,finalizers:void 0};else if("Open"===e.state._tag){let n=e.state;void 0!==n.finalizer&&(n.finalizers=new Map([[n.finalizerKey,n.finalizer]]),n.finalizerKey=void 0,n.finalizer=void 0),n.finalizers.set(t,r)}},cp=(e,t)=>{if("Open"!==e.state._tag)return;let r=e.state;r.finalizerKey===t?e.state=cm:void 0!==r.finalizers&&(r.finalizers.delete(t),0===r.finalizers.size&&(e.state=cm))},cg=(e="sequential",t)=>({[ci]:ci,[cn]:cn,strategy:e,parent:t,state:cm}),cm={_tag:"Empty"},cb=u_(cs),cy=e=>lN(()=>{let t=cg(void 0,void 0);return cS(e(t),e=>lN(()=>co(t,e)??lP))}),cv=(h=rX({op:"OnExit",[rE](e){return e._stack.push(this),this.effect},[rA](e){e.interruptible&&!0!==this.interruptible&&(e._stack.push(cU),e.interruptible=!1)},[r_](e,t,r){let n;r??=r1(e);try{n=this.onExit(r)}catch(e){n=r4(e)}return n?ue(n,e=>r):r},[rC](e,t,r){let n;r??=r5(e);try{n=this.onExit(r)}catch(e){n=r4(e)}return n?ue(cu(r,n),e=>r):r}}),(p=function(e,t,r){this.effect=e,this.onExit=t,this.interruptible=r}).prototype=h,p),cx=(e,t,r)=>new cv(e,t,r),cw=(e,t)=>{e._stack.push(new cv(void 0,t,void 0))},cS=eZ(2,cx),ck=eZ(2,(e,t)=>cS(e,e=>t)),cE=((e,t,r)=>cS(e,e=>t(e)?r(e):lP),eZ(3,(e,t,r)=>cS(e,e=>{let n=t(e);return n_(n)?lP:r(n.success,e)}))),c_=eZ(2,(e,t)=>cE(e,uc,t)),cC=eZ(3,(e,t,r)=>cS(e,e=>{if("Failure"!==e._tag)return lP;let n=t(e.cause);return n_(n)?lP:r(n.success,e.cause)})),cA=eZ(2,(e,t)=>cC(o9,t)(e)),cI=((e,t)=>lO(()=>cT(e,"function"==typeof t?e=>a4(az(t(e))):eQ(a4(az(t))))),eQ(1/0)),cT=(e,t)=>{let r,n,i=0,s=(e,t)=>(t.awaiters++,cw(e,()=>{if(!(--t.awaiters>0)&&!t.done)return n===t&&(n=void 0),l_(t.fiber)}),lE(t.fiber));return[r6(a=>{if(void 0!==n)return a===n.fiber?lE(n.fiber):s(a,n);if(void 0!==r&&(1/0===i||a.getRef(ff).currentTimeMillisUnsafe()<i))return r;r=void 0;let o=a.getRef(ff),l={fiber:new lm(a.context),awaiters:0,done:!1};n=l;let u=s(a,l);return l.fiber.evaluate(cx(e,e=>{if(l.done=!0,n!==l||(n=void 0,uf(e)))return;let s=t(e);i=1/0===s?1/0:o.currentTimeMillisUnsafe()+s,r=e})),l.fiber._exit??u}),lO(()=>{n=void 0,r=void 0})]},cO=r6(e=>lT(o1(e.id))),cN=e=>r6(t=>(t.interruptible&&(t.interruptible=!1,t._stack.push(cU)),e)),cM=rQ({op:"SetInterruptible",[rA](e){if(e.interruptible=this[rk],e._interruptedCause&&e.interruptible)return()=>lT(e._interruptedCause)}}),cU=cM(!0),c$=cM(!1),cj=e=>{e.interruptible&&(e.interruptible=!1,e._stack.push(cU))},cB=e=>r6(t=>t.interruptible?e:(e=>{if(e.interruptible=!0,e._stack.push(c$),e._interruptedCause)return lT(e._interruptedCause)})(t)??e),cP=e=>r6(t=>t.interruptible?(t.interruptible=!1,t._stack.push(cU),e(cB)):e(eX)),cR=(e,t)=>tk(e)?t?.mode==="result"?cF(e,uZ,t):cF(e,eX,t):t?.discard?"result"===t.mode?cF(Object.values(e),uZ,t):cF(Object.values(e),eX,t):lN(()=>ui(cF(Object.entries(e),([e,r])=>ui(t?.mode==="result"?uZ(r):r,t=>[e,t]),{concurrency:t?.concurrency}),Object.fromEntries)),cL=((e=>tk(e[0])&&!rN(e[0]),(e,t,r)=>ui(cF(e,(e,r)=>uZ(t(e,r)),r),e=>ah(e,eX))),rQ({op:"While",[r_](e,t){return(this[rk].step(e),this[rk].while())?(t._stack.push(this),this[rk].body()):ud},[rE](e){return this[rk].while()?(e._stack.push(this),this[rk].body()):ud}})),cF=eZ(e=>"function"==typeof e[1],(e,t,r)=>lN(()=>{let n=cz(r?.concurrency);if(1===n)return cD(e,t,r);let i=s$(e),s=i.length;if(0===s)return r?.discard?lP:lI([]);let a=r?.discard?void 0:Array(s),o=cq({f:t,out:a},i,{concurrency:n});return o?lV(o,a):lI(a)})),cD=(e,t,r)=>lN(()=>{let n=r?.discard?void 0:[],i=e[Symbol.iterator](),s=i.next(),a=0;return lV(cL({while:()=>!s.done,body:()=>t(s.value,a++),step:e=>{n&&n.push(e),s=i.next()}}),n)}),cz=e=>"unbounded"===e?1/0:Math.max(1,e??1),cH=()=>e=>{let t=e.onItem,r=e.step,n=(e,t,n,s,a)=>ue(u9(a),a=>r(e,t[n],a,n)??i(e,t,n+1,s)??lP),i=(e,i,s=0,a=i.length)=>{for(;s<a;s++){let o=i[s],l=t(e,o,s);if(!ur(l))return n(e,i,s,a,l);let u=r(e,o,l,s);if(u)return"Failure"===u._tag?u:void 0}};return i},cJ=e=>{let t=e.onItem,r=e.step;return(e,n,i)=>{let s,a,o,l,u,c=0,f=i.end??n.length,d=i.concurrency,h=!1,p=e=>{let t=r4(e);return l=t,h=!0,a&&a.size>0?ue(cN(lA(Array.from(a))),()=>l??t):t},g=()=>{let i=!1;for(;!l&&c<f;c++){let f=n[c],m=u??t(e,f,c);if(ur(m)){if(l=r(e,f,m,c))break}else{if(!s)return lD(e=>{let t;s=lg(),a=new Set,u=m,o=e;try{t=g()}catch(t){return e(p(t))}return t?e(t):lN(()=>(l??=ud,ue(a?lA(a):lP,()=>l?._tag==="Failure"?l:lP)))});u=void 0;let t=cZ(s,m,!0,!0,"inherit");if(t._exit){if(l=r(e,f,t._exit,c))break;continue}a.add(t);let n=c;if(t.addObserver(s=>{a.delete(t);try{if(l){if("Failure"===s._tag){let e=s.cause.reasons.filter(e=>"Interrupt"!==e._tag);if(e.length>0){let t=rF(e);l=r5("Failure"===l._tag?o5(rD(l.cause,t)):t)}}}else{let t=r(e,f,s,n);t&&(l=t,g())}if(i){let e=g();e&&o(e)}else h&&0===a.size&&o(l??lP)}catch(e){o(p(e))}}),a.size<d)continue;i=!0,c++;return}}if(h=!0,l){if(a&&a.size>0){let e=lw(s);a.forEach(t=>t.interruptUnsafe(s.id,e));return}if(o||"Failure"===l._tag)return l}else if(o)if(!a)return ud;else 0===a.size&&o(lP)};return g()}},cW=()=>e=>cJ(e),cq=cJ({onItem:(e,t,r)=>e.f(t,r),step(e,t,r,n){if("Failure"===r._tag)return r;e.out&&(e.out[n]=r.value)}}),cK=eZ(3,(e,t,r)=>ue(e,e=>t(e)?lI(e):r(e))),cV=((e,t,r)=>ue(e,e=>{let n=t(e);return n_(n)?r(n.failure):lI(n.success)}),eZ(e=>tk(e[0])&&!rN(e[0]),(e,t,r)=>ui(cF(e,(e,r)=>{let n=t(e,r);return"boolean"==typeof n?lI(n?nv(e):nb):ui(n,t=>t?nv(e):nb)},r),ac))),cG=eZ(e=>tk(e[0])&&!rN(e[0]),(e,t,r)=>lN(()=>{let n=[];return lV(cF(e,e=>ui(t(e),e=>{nC(e)&&n.push(e.success)}),{discard:!0,concurrency:r?.concurrency}),n)})),cY=eZ(e=>rN(e[0]),(e,t)=>r6(r=>(lx.interruptChildren??=lS,lI(cZ(r,e,t?.startImmediately,!1,t?.uninterruptible??!1))))),cZ=(e,t,r=!1,n=!1,i=!1)=>{let s="inherit"===i?e.interruptible:!i,a=new lm(e.context,s);return n||(e.children().add(a),a._parent=e),r?a.evaluate(t):(a._asyncContext=lp(),e.currentDispatcher.scheduleTask(()=>a.evaluate(t),0)),a},cX=e=>()=>r6(t=>t===e?lP:l_(e)),cQ=eZ(e=>rN(e[0]),(e,t,r)=>r6(n=>{let i="Closed"===t.state._tag?new lm(n.context):cZ(n,e,r?.startImmediately,!0,r?.uninterruptible);return i._exit||("Closed"!==t.state._tag?(ch(t,i,cX(i)),i.addObserver(()=>cp(t,i))):i.interruptUnsafe(n.id,lw(n))),lI(i)})),c0=eZ(e=>rN(e[0]),(e,t)=>ue(cs,r=>cQ(e,r,t))),c1=e=>(t,r)=>{let n=new lm(r?.scheduler?i7(e,oi,r.scheduler):e,r?.uninterruptible!==!0);if(n.evaluate(t),n._exit)return n;if(r?.signal)if(r.signal.aborted)n.interruptUnsafe();else{let e=()=>n.interruptUnsafe();r.signal.addEventListener("abort",e,{once:!0}),n.addObserver(()=>r.signal.removeEventListener("abort",e))}return r?.onFiberStart&&r.onFiberStart(n),n},c2=eZ(2,(e,t)=>(e._exit||("Closed"===t.state._tag?e.interruptUnsafe(e.id):(cp(t,e),ch(t,e,cX(e)),e.addObserver(()=>cp(t,e)))),e)),c3=c1(i4()),c5=e=>{let t=c1(e);return(e,r)=>{let n=t(e,r);return new Promise(e=>{n.addObserver(t=>e(t))})}},c8=c5(i4()),c4=e=>{let t=c5(e);return(e,r)=>t(e,r).then(e=>{if("Failure"===e._tag)throw le(e.cause);return e.value})},c6=c4(i4()),c9=e=>{let t=c1(e);return e=>{if(ur(e))return e;let r=t(e,{scheduler:new ou("sync")});return r._dispatcher?.flush(),r._exit??r4(new fC(r))}},c7=c9(i4()),fe=(g=c9(i4()),e=>{let t=g(e);if("Failure"===t._tag)throw le(t.cause);return t.value}),ft=lI(!0),fr=lI(!1);class fn{waiters=[];scheduled=void 0;_isOpen;constructor(e){this._isOpen=e}scheduleUnsafe(e){if(0===this.waiters.length)return ft;if(void 0===this.scheduled)this.scheduled=this.waiters,e.currentDispatcher.scheduleTask(this.flushScheduled,0);else for(let e=0;e<this.waiters.length;e++)this.scheduled.push(this.waiters[e]);return this.waiters=[],ft}flushScheduled=()=>{if(void 0===this.scheduled)return;let e=this.scheduled;this.scheduled=void 0;for(let t=0;t<e.length;t++)e[t](ud)};flushWaiters(){let e=this.waiters;this.waiters=[],this.flushScheduled();for(let t=0;t<e.length;t++)e[t](ud)}open=r6(e=>this._isOpen?fr:(this._isOpen=!0,this.scheduleUnsafe(e)));release=r6(e=>this._isOpen?fr:this.scheduleUnsafe(e));openUnsafe(){return!this._isOpen&&(this._isOpen=!0,this.flushWaiters(),!0)}await=lD(e=>this._isOpen?e(lP):(this.waiters.push(e),lO(()=>{let t=this.waiters.indexOf(e);-1!==t?this.waiters.splice(t,1):void 0!==this.scheduled&&-1!==(t=this.scheduled.indexOf(e))&&this.scheduled.splice(t,1)})));closeUnsafe(){return!!this._isOpen&&(this._isOpen=!1,!0)}close=lO(()=>this.closeUnsafe());whenOpen=e=>ue(this.await,()=>e);isOpen(){return this._isOpen}}let fi=e=>new fn(e??!1),fs=BigInt(0),fa={_tag:"Span",spanId:"noop",traceId:"noop",sampled:!1,status:{_tag:"Ended",startTime:fs,endTime:fs,exit:ud},attributes:new Map,links:[],kind:"internal",attribute(){},event(){},end(){},addLinks(){}},fo=e=>e?si(e.annotations,o$)?"Span"===e._tag?fo(nq(e.parent)):nb:nv(e):nb,fl=(e,t,r)=>{let n,i=!e.cache.tracerEnabled||r?.annotations&&si(r.annotations,o$),s=r?.parent!==void 0?nv(r.parent):r?.root?nb:fo(e.cache.span);if(i){let e;e={name:t,parent:s,annotations:i7(r?.annotations??i4(),o$,!0)},n=Object.assign(Object.create(fa),e)}else{let i=e.cache.tracer??oL,a=e.getRef(ff),o=e.getRef(oJ),l=e.getRef(oW),u=e.getRef(oq),c=r?.level??e.getRef(oj),f=r?.links!==void 0?[...u,...r.links]:0===u.length?[]:u.slice();for(let u in n=i.span({name:t,parent:s,annotations:r?.annotations??i4(),links:f,startTime:o?a.currentTimeNanosUnsafe():fs,kind:r?.kind??"internal",root:r?.root??!1,sampled:r?.sampled??((!nm(s)||!1!==s.value.sampled)&&!fO(e.getRef(oB),c))}),l)n.attribute(u,l[u]);if(r?.attributes!==void 0)for(let e in r.attributes)n.attribute(e,r.attributes[e])}return n},fu=(e,t,r,n)=>lO(()=>{"Ended"!==e.status._tag&&e.end(n?r.currentTimeNanosUnsafe():fs,t)}),fc=u_(oU),ff=iJ("effect/Clock",{defaultValue:()=>new fd});class fd{currentTimeMillisUnsafe(){return Date.now()}currentTimeMillis=lO(()=>this.currentTimeMillisUnsafe());currentTimeNanosUnsafe(){return fg()}currentTimeNanos=lO(()=>this.currentTimeNanosUnsafe());monotonicTimeNanosUnsafe(){return fp()}monotonicTimeNanos=lO(()=>this.monotonicTimeNanosUnsafe());sleep(e){return this.sleepMillis(a4(e))}sleepMillis(e){return e<=0?lU:Number.isFinite(e)?lD(t=>{let r=e>0x7fffffff?this.sleepMillis(e-0x7fffffff):lP,n=setTimeout(()=>t(r),Math.min(e,0x7fffffff));return lO(()=>clearTimeout(n))}):lz}}let fh=BigInt(1e6),fp=function(){let e=globalThis.process?.hrtime;if("function"==typeof e?.bigint)return()=>e.bigint();if("u">typeof performance&&"function"==typeof performance.now)return()=>BigInt(Math.round(1e6*performance.now()));let t=BigInt(0);return()=>{let e=BigInt(Date.now())*fh;return e>t&&(t=e),t}}(),fg=(b=BigInt(1e9),()=>{let e=fp(),t=BigInt(Date.now())*fh;if(void 0===m)m=t-e;else{let r=m+e;(t>r?t-r:r-t)>b&&(m=t-e)}return m+e}),fm=e=>r6(t=>e(t.getRef(ff))),fb=e=>fm(t=>t.sleep(az(e))),fy=fm(e=>e.currentTimeMillis),fv=(e=>e.monotonicTimeNanos,"~effect/Cause/TimeoutError");class fx extends nt("TimeoutError"){[fv]=fv;constructor(e){super({message:e})}}let fw="~effect/Cause/IllegalArgumentError";class fS extends nt("IllegalArgumentError"){[fw]=fw;constructor(e){super({message:e})}}let fk="~effect/Cause/ExceededCapacityError";class fE extends nt("ExceededCapacityError"){[fk]=fk;constructor(e){super({message:e})}}let f_="~effect/Cause/AsyncFiberError";class fC extends nt("AsyncFiberError"){[f_]=f_;constructor(e){super({message:"An asynchronous Effect was executed with Effect.runSync",fiber:e})}}let fA="~effect/Cause/UnknownError";class fI extends nt("UnknownError"){[fA]=fA;constructor(e,t){super({message:t,cause:e})}}let fT=iJ("effect/Console",{defaultValue:()=>globalThis.console}),fO=nP(nj(nU,e=>{switch(e){case"All":return Number.MIN_SAFE_INTEGER;case"Fatal":return 5e4;case"Error":return 4e4;case"Warn":return 3e4;case"Info":return 2e4;case"Debug":return 1e4;case"Trace":return 0;case"None":return Number.MAX_SAFE_INTEGER}})),fN=iJ("effect/Logger/CurrentLoggers",{defaultValue:()=>new Set([fP,fR])}),fM=iJ("effect/Logger/LogToStderr",{defaultValue:e1}),fU={"~effect/Logger":{_Message:eX,_Output:eX},pipe(){return eV(this,arguments)}},f$=e=>{let t=Object.create(fU);return t.log=e,t},fj=(e,t)=>{let r=e[0].replace(/[\s="]/g,"_");return`${r}=${t-e[1]}ms`},fB=e=>(...t)=>{let r;for(let e=0,n=t.length;e<n;e++){let n=t[e];r$(n)&&(r?t.splice(e,1):t=t.slice(0,e).concat(t.slice(e+1)),r=r?rF(r.reasons.concat(n.reasons)):n,e--)}return void 0===r&&(r=rH),r6(n=>{let i=e??n.cache.logLevel;if(fO(n.cache.minimumLogLevel,i))return lP;let s=n.getRef(ff),a=n.getRef(fN);if(a.size>0){let e=new Date(s.currentTimeMillisUnsafe());for(let s of a)s.log({cause:r,fiber:n,date:e,logLevel:i,message:t})}return lP})},fP=f$(({cause:e,date:t,fiber:r,logLevel:n,message:i})=>{let s=Array.isArray(i)?i.slice():[i];e.reasons.length>0&&s.push(lo(e));let a=t.getTime(),o=r.getRef(oZ),l="";for(let e of o)l+=` ${fj(e,a)}`;let u=r.getRef(oK);Object.keys(u).length>0&&s.push(u);let c=r.getRef(fT);(r.getRef(fM)?c.error:c.log)(`[${t.getHours().toString().padStart(2,"0")}:${t.getMinutes().toString().padStart(2,"0")}:${t.getSeconds().toString().padStart(2,"0")}.${t.getMilliseconds().toString().padStart(3,"0")}] ${n.toUpperCase()} (#${r.id})${l}:`,...s)}),fR=f$(({cause:e,fiber:t,logLevel:r,message:n})=>{let i=t.getRef(ff),s=t.getRef(oK),a=t.cache.span;if(void 0===a||"ExternalSpan"===a._tag||"Ended"===a.status._tag)return;let o={};for(let[e,t]of Object.entries(s))ry(o,e,t);o["effect.fiberId"]=t.id,o["effect.logLevel"]=r.toUpperCase(),e.reasons.length>0&&(o["effect.cause"]=lo(e)),a.event(((e,t=2)=>{if("string"==typeof e)return e;try{return"object"==typeof e?ru(e,{space:t}):ri(e,{space:t})}catch{return String(e)}})(Array.isArray(n)&&1===n.length?n[0]:n),i.currentTimeNanosUnsafe(),o)}),fL=lI(void 0),fF=e=>tx(e,rU),fD=e=>new rL(e),fz=e=>new rW(e),fH=e=>new o0(e),fJ=e=>tx(e,nr),fW=e=>void 0===e?nl:r8(no(e)),fq=e=>tx(e,fv);class fK extends(iJ())("effect/Cause/StackTrace"){}e.s(["Z",0,no,"f",0,fE,"g",0,fS,"F",0,fK,"t",0,fx,"i",0,rD,"v",0,rq,"a",0,fW,"O",0,rJ,"b",0,o4,"h",0,rF,"q",0,o2,"T",0,o6,"K",0,e=>e.reasons.length>0&&e.reasons.every(rY),"r",0,r$,"c",0,ns,"w",0,rV,"u",0,fJ,"D",0,fF,"d",0,fq,"l",0,fz,"x",0,fD,"H",0,fH,"y",0,o7,"s",0,le],11634);let fV=e=>"Failure"===e._tag,fG=function(){this.resumes=void 0,this.effect=void 0};fG.prototype={"~effect/Deferred":{_A:eX,_E:eX},pipe(){return eV(this,arguments)}};let fY=()=>new fG,fZ=e=>lD(t=>e.effect?t(e.effect):(e.resumes??=[],e.resumes.push(t),lO(()=>{let r=e.resumes;if(void 0===r)return;let n=r.indexOf(t);n>=0&&r.splice(n,1)}))),fX=eZ(2,(e,t)=>lO(()=>f1(e,t))),fQ=((e,t)=>fX(e,r8(t)),eZ(2,(e,t)=>fX(e,r5(t)))),f0=((e,t)=>fX(e,r4(t)),eZ(2,(e,t)=>fQ(e,o1(t)))),f1=((e,t)=>fX(e,r1(t)),(e,t)=>{if(e.effect)return!1;if(e.effect=t,e.resumes){let r=e.resumes;e.resumes=void 0;for(let e=0;e<r.length;e++)r[e](t)}return!0}),f2=((e,t)=>cP(r=>ue(u9(r(e)),e=>fX(t,e))),"~effect/Layer"),f3="~effect/Layer/MemoMap",f5=(e,t)=>"Closed"!==t.state._tag&&(e.observers++,ch(t,{},e.finalizer),!0),f8={[f2]:{_ROut:eX,_E:eX,_RIn:eX},pipe(){return eV(this,arguments)}},f4=e=>{let t=Object.create(f8);return t.build=e,t},f6=e=>{let t,r=(t=(t,n)=>t.getOrElseMemoize(r,n,e),f4((e,r)=>{let n=cf(r);return cS(t(e,n),e=>"Failure"===e._tag?ca(n,e):lP)}));return r};class f9{get[f3](){return f3}parent;constructor(e){this.parent=e}map=new Map;get(e,t){let r=this.map.get(e);return r?(f5(r,t),r.deferred.effect??fZ(r.deferred)):this.parent?.get(e,t)}getOrElseMemoize(e,t,r){return lN(()=>{let n;return cx(lN(()=>{var i;let s,a=this.get(e,t);if(a)return a;let o=(i=this,s={observers:0,deferred:fY(),scope:cg(void 0,void 0),finalizer:t=>lN(()=>--s.observers>0?lP:(i.map.delete(e),ca(s.scope,t)))});return f5(o,t)?(n=o.deferred,this.map.set(e,o),r(this,o.scope)):r(this,t)}),e=>{n&&f1(n,e)})})}}let f7=()=>new f9;class de extends(iJ())("effect/Layer/CurrentMemoMap"){static forkOrCreate(e){let t=st(e,de);return t?new f9(t):f7()}}let dt=eZ(3,(e,t,r)=>u_(ui(lN(()=>e.build(t,r)),i7(de,t)),de,t)),dr=eZ(2,(e,t)=>r6(r=>dt(e,de.forkOrCreate(r.context),t))),dn=e=>f4(eQ(lI(e))),di=function(){return 1==arguments.length?e=>ds(arguments[0],e):ds(arguments[0],arguments[1])},ds=(e,t)=>da(ui(t,t=>i9(e,t))),da=e=>f6((t,r)=>cb(e,r)),dl=(e,t,r)=>{let n=cf(r,"parallel");return cF(e,e=>e.build(t,cf(n,"sequential")),{concurrency:e.length}).pipe(ui(e=>sc(...e)))},du=(e,t,r)=>f6((n,i)=>ue(Array.isArray(t)?dl(t,n,i):t.build(n,i),t=>e.build(n,i).pipe(uE(t),ui(e=>r(e,t))))),dc=eZ(2,(e,t)=>du(e,t,eX)),df=eZ(2,(e,t)=>du(e,t,(e,t)=>su(t,e))),dd="~effect/DateTime",dh="~effect/DateTime/TimeZone",dp={[dd]:dd,pipe(){return eV(this,arguments)},[rc](){return this.toString()},toJSON(){return dH(this).toJSON()}},dg={...dp,_tag:"Utc",[tC](){return t$(this.epochMilliseconds)},[tq](e){return d_(e)&&"Utc"===e._tag&&this.epochMilliseconds===e.epochMilliseconds},toString(){return`DateTime.Utc(${dH(this).toJSON()})`}},dm={...dp,_tag:"Zoned",[tC](){return tO(t$(this.epochMilliseconds))(tA(this.zone))},[tq](e){return d_(e)&&"Zoned"===e._tag&&this.epochMilliseconds===e.epochMilliseconds&&tK(this.zone,e.zone)},toString(){return`DateTime.Zoned(${d5(this)})`}},db={[dh]:dh,[rc](){return this.toString()}},dy={...db,_tag:"Named",[tC](){return tj(`Named:${this.id}`)},[tq](e){return dA(e)&&"Named"===e._tag&&this.id===e.id},toString(){return`TimeZone.Named(${this.id})`},toJSON(){return{_id:"TimeZone",_tag:"Named",id:this.id}}},dv={...db,_tag:"Offset",[tC](){return tj(`Offset:${this.offset}`)},[tq](e){return dA(e)&&"Offset"===e._tag&&this.offset===e.offset},toString(){return`TimeZone.Offset(${dq(this.offset)})`},toJSON(){return{_id:"TimeZone",_tag:"Offset",offset:this.offset}}},dx={value:void 0,enumerable:!1,writable:!0},dw=new WeakMap,dS=(e,t)=>({get(){return Object.isExtensible(this)?void 0:dw.get(this)?.[e]},set(r){if(Object.isExtensible(this)){for(let e of t)Object.defineProperty(this,e,dx);this[e]=r}else{let t=dw.get(this);void 0===t&&(t={},dw.set(this,t)),t[e]=r}}}),dk=["partsUtc","adjustedEpochMilliseconds","partsAdjusted"];Object.defineProperty(dg,"partsUtc",dS("partsUtc",["partsUtc"])),Object.defineProperties(dm,{partsUtc:dS("partsUtc",dk),adjustedEpochMilliseconds:dS("adjustedEpochMilliseconds",dk),partsAdjusted:dS("partsAdjusted",dk)});let dE=(e,t,r)=>{let n=Object.create(dm);return n.epochMilliseconds=e,n.zone=t,void 0!==r&&(n.partsUtc=r),n},d_=e=>tx(e,dd),dC=e=>d_(e[0]),dA=e=>tx(e,dh);(e,t)=>e.epochMilliseconds===t.epochMilliseconds;let dI=e=>{let t=Object.create(dg);return t.epochMilliseconds=e,t},dT=e=>{let t=e.getTime();if(Number.isNaN(t))throw new fS("Invalid date");return dI(t)},dO=e=>{if(d_(e))return e;if(e instanceof Date)return dT(e);if("object"==typeof e){if("epochMilliseconds"in e)return dT(new Date(e.epochMilliseconds));let t=new Date(0);return dV(t,e),dT(t)}return"string"!=typeof e||dN(e)?dT(new Date(e)):dT(new Date(e+"Z"))},dN=e=>/Z|GMT|[+-]\d{2}$|[+-]\d{2}:?\d{2}$|\]$/.test(e)||/z$|gmt$/i.test(e),dM=-864e13+432e5,dU=864e13-504e5,d$=nK((e,t)=>{let r,n=t?.timeZone;if(void 0===n&&d_(e)&&"Zoned"===e._tag)return e;let i=dO(e);if(i.epochMilliseconds<dM||i.epochMilliseconds>dU)throw RangeError(`Epoch millis out of range: ${i.epochMilliseconds}`);if(void 0===n&&"object"==typeof e&&"timeZoneId"in e&&(n=e.timeZoneId),void 0===n)r=dL(-60*new Date(i.epochMilliseconds).getTimezoneOffset()*1e3);else if(dA(n))r=n;else if("number"==typeof n)r=dL(n);else{let e=dz(n);if(ng(e))throw new fS(`Invalid time zone: ${n}`);r=e.value}return t?.adjustForTimeZone!==!0?dE(i.epochMilliseconds,r,i.partsUtc):dG(i.epochMilliseconds,r,t?.disambiguation??"compatible")}),dj=nK(dO),dB=/^(.{17,35})\[(.+)\]$/,dP=((e,t,r)=>r?.adjustForTimeZone===!0?dG(e.epochMilliseconds,t,r?.disambiguation??"compatible"):dE(e.epochMilliseconds,t,e.partsUtc),new Map),dR={day:"numeric",month:"numeric",year:"numeric",era:"short",hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"longOffset",fractionalSecondDigits:3,hourCycle:"h23"},dL=e=>{let t=Object.create(dv);return t.offset=e,t},dF=nK(e=>{let t=dP.get(e);if(void 0!==t)return t;try{let t=(e=>{let t=e.resolvedOptions().timeZone,r=dP.get(t);if(void 0!==r)return r;let n=Object.create(dy);return n.id=t,n.format=e,dP.set(t,n),n})(new Intl.DateTimeFormat("en-US",{...dR,timeZone:e}));return dP.set(e,t),t}catch{throw new fS(`Invalid time zone: ${e}`)}}),dD=/^(?:GMT)?[+-]/,dz=e=>{if(dD.test(e)){let t=dZ(e);return null===t?nb:nv(dL(t))}return dF(e)},dH=e=>new Date(e.epochMilliseconds),dJ=e=>{if("Utc"===e._tag)return new Date(e.epochMilliseconds);if("Offset"===e.zone._tag)return new Date(e.epochMilliseconds+e.zone.offset);if(void 0!==e.adjustedEpochMilliseconds)return new Date(e.adjustedEpochMilliseconds);let t=!1,r=e.zone.format.formatToParts(e.epochMilliseconds).filter(e=>"era"===e.type?(t="BC"===e.value,!1):"literal"!==e.type),n=Number(r[2].value),i=new Date(0);return i.setUTCFullYear(t?1-n:n,Number(r[0].value)-1,Number(r[1].value)),i.setUTCHours(Number(r[3].value),Number(r[4].value),Number(r[5].value),r[6]?.type==="fractionalSecond"?Number(r[6].value):(e.epochMilliseconds%1e3+1e3)%1e3),e.adjustedEpochMilliseconds=i.getTime(),i},dW=e=>dJ(e).getTime()-dK(e),dq=e=>{let t=Math.abs(e),r=Math.floor(t/36e5),n=Math.round(t%36e5/6e4);return 60===n&&(r+=1,n=0),`${e<0?"-":"+"}${String(r).padStart(2,"0")}:${String(n).padStart(2,"0")}`},dK=e=>e.epochMilliseconds,dV=(e,t)=>{if((void 0!==t.year||void 0!==t.month||void 0!==t.day)&&e.setUTCFullYear(t.year??e.getUTCFullYear(),void 0!==t.month?t.month-1:e.getUTCMonth(),t.day??e.getUTCDate()),void 0!==t.weekDay){let r=t.weekDay-e.getUTCDay();e.setUTCDate(e.getUTCDate()+r)}void 0!==t.hour&&e.setUTCHours(t.hour),void 0!==t.minute&&e.setUTCMinutes(t.minute),void 0!==t.second&&e.setUTCSeconds(t.second),void 0!==t.millisecond&&e.setUTCMilliseconds(t.millisecond)},dG=(e,t,r)=>{if("Offset"===t._tag)return dE(e-t.offset,t);let n=dX(e-864e5,e,t),i=dX(e+864e5,e,t);if(n===i)return dE(e-n,t);let s=n-i;if(n<i){if(dX(e-i,e,t)===i)return dE(e-i,t);let s=dE(e-n,t);if(e!==dJ(s).getTime())switch(r){case"reject":{let r=new Date(e).toISOString();throw RangeError(`Gap time: ${r} does not exist in time zone ${t.id}`)}case"earlier":return dE(e-i,t)}return s}if(dX(e-n,e,t)===n){if("earlier"===r||"compatible"===r||dX(e-n+s,e+s,t)===n)return dE(e-n,t);if("reject"===r){let r=new Date(e).toISOString();throw RangeError(`Ambiguous time: ${r} occurs twice in time zone ${t.id}`)}}return dE(e-i,t)},dY=/([+-])(\d{2}):?(\d{2})$/,dZ=e=>{let t=dY.exec(e);if(null===t)return null;let[,r,n,i]=t;return("+"===r?1:-1)*(60*Number(n)+Number(i))*6e4},dX=(e,t,r)=>{let n=r.format.formatToParts(e).find(e=>"timeZoneName"===e.type)?.value??"";if("GMT"===n)return 0;let i=dZ(n);return null===i?dW(dE(t,r)):i},dQ=eZ(dC,(e,t,r)=>{if("Utc"===e._tag){let r=dH(e);return t(r),dI(r.getTime())}let n=new Date(dJ(e).getTime());return t(n),dG(n.getTime(),e.zone,r?.disambiguation??"compatible")}),d0=eZ(2,(e,t)=>d1(e,e=>{let r=new Date(e);return t(r),r.getTime()})),d1=eZ(2,(e,t)=>{let r=t(dK(e));return"Utc"===e._tag?dI(r):dE(r,e.zone)}),d2=((e,t)=>t(dJ(e)),eZ(2,(e,t)=>t(dH(e)))),d3=((e,t)=>{let r=d0(e,e=>{t.milliseconds&&e.setTime(e.getTime()+t.milliseconds),t.seconds&&e.setTime(e.getTime()+1e3*t.seconds),t.minutes&&e.setTime(e.getTime()+60*t.minutes*1e3),t.hours&&e.setTime(e.getTime()+60*t.hours*6e4)});return t.days||t.weeks||t.months||t.years?dQ(r,e=>{if(t.days&&e.setUTCDate(e.getUTCDate()+t.days),t.weeks&&e.setUTCDate(e.getUTCDate()+7*t.weeks),t.months){let r=e.getUTCDate();e.setUTCMonth(e.getUTCMonth()+t.months+1,0),r<e.getUTCDate()&&e.setUTCDate(r)}if(t.years){let r=e.getUTCDate(),n=e.getUTCMonth();e.setUTCFullYear(e.getUTCFullYear()+t.years,n+1,0),r<e.getUTCDate()&&e.setUTCDate(r)}}):r},e=>{let t=dJ(e);return"Utc"===e._tag?t.toISOString():`${t.toISOString().slice(0,-1)}${dq(dW(e))}`}),d5=e=>"Offset"===e.zone._tag?d3(e):`${d3(e)}[${e.zone.id}]`;(e,t)=>0===t?nb:nv(e/t);let d8=e=>e.trim();class d4{index;length;s;stripped;constructor(e,t=!1){this.s=e,this.stripped=t,this.index=0,this.length=e.length}next(){if(this.done)return{done:!0,value:void 0};let e=this.index;for(;!this.done&&!d6(this.s[this.index]);)this.index=this.index+1;let t=this.index;if(!this.done){let e=this.s[this.index];this.index=this.index+1,!this.done&&d9(e,this.s[this.index])&&(this.index=this.index+1),this.stripped||(t=this.index)}return{done:!1,value:this.s.substring(e,t)}}[Symbol.iterator](){return new d4(this.s,this.stripped)}get done(){return this.index>=this.length}}let d6=e=>{let t=e.charCodeAt(0);return 13===t||10===t},d9=(e,t)=>13===e.charCodeAt(0)&&10===t.charCodeAt(0),d7=((e,t)=>tK(e.tz,t.tz)&&e.and===t.and&&e.onDstOverlap===t.onDstOverlap&&he(e.seconds,t.seconds)&&he(e.minutes,t.minutes)&&he(e.hours,t.hours)&&he(e.days,t.days)&&he(e.months,t.months)&&he(e.weekdays,t.weekdays),t6(t4)),he=(e,t)=>d7(s$(e),s$(t)),ht=eZ(2,(e,t)=>uB(e,ha,e=>t(e))),hr=e=>e.reasons.some(hn),hn=e=>"Fail"===e._tag&&ns(e.error),hi=e=>{let t,r=!1;for(let n of e.reasons)hn(n)?t??=n.error:"Interrupt"!==n._tag&&(r=!0);return void 0===t?nI(e):r?nI(rF(e.reasons.filter(e=>!hn(e)))):nO(t)},hs=(y=e=>e.reasons.every(e=>!hn(e)),e=>y(e)?nO(e):nI(e)),ha=e=>{let t=hi(e);return n_(t)?t:nO(t.success.value)},ho=e=>{let t=hi(e);return n_(t)?r5(t.failure):r1(t.success.value)},hl=eZ(2,(e,t)=>uX(e,{onSuccess:t.onSuccess,onFailure:e=>{let r=hi(e);return n_(r)?t.onFailure(r.failure):t.onDone(r.success.value)}}));e.s(["Y",0,ht,"F",0,ho,"x",0,hi,"C",0,hs,"y",0,hr,"r",0,hl],41793);let hu="~effect/Schedule",hc=iJ("effect/Schedule/CurrentMetadata",{defaultValue:eQ({input:void 0,output:void 0,duration:a0,attempt:0,start:0,now:0,elapsed:0,elapsedSincePrevious:0})}),hf={[hu]:{_Out:eX,_In:eX,_Env:eX},pipe(){return eV(this,arguments)}},hd=e=>{let t=Object.create(hf);return t.step=e,t},hh=()=>{let e,t,r=0;return(n,i)=>{void 0===t&&(t=n);let s=n-t,a=void 0===e?0:n-e;return e=n,{input:i,attempt:++r,start:t,now:n,elapsed:s,elapsedSincePrevious:a}}},hp=e=>uU(e.step,e=>lI(()=>lT(e))),hg=e=>fm(t=>ui(hp(e),e=>{let r=hh();return n=>lN(()=>{let i=t.currentTimeMillisUnsafe();return ue(e(i,n),([e,t])=>{let s=r(i,n);return s.output=e,s.duration=t,lV(fb(t),s)})})})),hm=((e,t)=>hd(lO(()=>{let r,n=0,i=hm(e,({output:e})=>nI(e)),s=hm(t,({output:e})=>nO(e));return function e(t,a){return r?r(t,a):hp(0===n?i:s).pipe(ue(i=>1==++n?(r=(t,n)=>ht(i(t,n),i=>(r=void 0,e(t,n))))(t,a):(r=i)(t,a)))}})),eZ(2,(e,t)=>hd(ui(hp(e),e=>{let r=hh();return(n,i)=>hl(e(n,i),{onSuccess:([e,s])=>{let a=t({...r(n,i),output:e,duration:s});return rN(a)?ui(a,e=>[e,s]):lI([a,s])},onFailure:lT,onDone:e=>{let s=t({...r(n,i),output:e,duration:a0});return rN(s)?ue(s,fW):fW(s)}})})))),hb=((e,t)=>hd(ui(hp(e),e=>{let r=hh();return(n,i)=>ue(e(n,i),([e,s])=>ui(t({...r(n,i),output:e,duration:s}),t=>[e,az(t)]))})),e=>hd(ui(hp(e),e=>(t,r)=>hl(e(t,r),{onSuccess:e=>lI([r,e[1]]),onFailure:lT,onDone:()=>fW(r)})))),hy=eZ(2,(e,t)=>hd(ui(hp(e),e=>{let r=hh();return(n,i)=>ue(e(n,i),e=>{let[s,a]=e,o=t({...r(n,i),output:s,duration:a});return ue(rN(o)?o:lI(o),t=>t?lI(e):fW(s))})}))),hv=(N=az(a0),hd(ui(lI(e=>lI([e.attempt-1,N])),e=>{let t=hh();return(r,n)=>e(t(r,n))}))),hx="~effect/ExecutionPlan",hw={[hx]:hx,get captureRequirements(){let e=this;return uk(t=>lI(hS(e.steps.map(e=>({...e,while:e.while?r=>uE(e.while(r),t):void 0,schedule:e.schedule?hd(uE(ui(hp(e.schedule),e=>(r,n)=>uE(e(r,n),t)),t)):void 0,provide:tx(e.provide,f2)?dc(e.provide,dn(t)):e.provide})))))},pipe(){return eV(this,arguments)}},hS=e=>{let t=Object.create(hw);return t.steps=e,t},hk=eZ(e=>rN(e[0]),(e,t,r)=>{let n;return i5(t)?uE(e,t):(n=Array.isArray(t)?((...e)=>f6((t,r)=>dl(e,t,r)))(...t):t,cy(t=>ue(r?.local?dt(n,f7(),t):dr(n,t),t=>uE(e,t))))}),hE=eZ(3,(e,t,r)=>ue(hg(t),t=>{let n=hc.defaultValue(),i=r=>hl(t(r),{onSuccess:t=>ue(u_(e,hc,n=t),i),onFailure:lT,onDone:lI});return uB(ue(u_(e,hc,n),i),o8,e=>r(e,0===n.attempt?nb:nv(n)))})),h_=eZ(3,(e,t,r)=>ue(hg(t),t=>{let n,i=hc.defaultValue(),s=uB(lN(()=>u_(e,hc,i)),o8,e=>(n=e,ue(t(e),e=>(i=e,s))));return ht(s,e=>rb(()=>r(n,e)))})),hC=eZ(2,(e,t)=>hE(e,"function"==typeof t?t(eX):tx(t,hu)?t:hO(t),r8)),hA=eZ(2,(e,t)=>h_(e,"function"==typeof t?t(eX):tx(t,hu)?t:hO(t),r8)),hI=eZ(3,(e,t,r)=>ue(hg(r),r=>{let n=t=>hl(r(t),{onSuccess:t=>ue(u_(e,hc,t),n),onFailure:lT,onDone:lI});return n(t)})),hT=hb(hv),hO=e=>{let t=e.schedule?hb(e.schedule):hT;return e.while&&(t=hy(t,({input:t})=>{let r=e.while(t);return rN(r)?r:lI(r)})),e.until&&(t=hy(t,({input:t})=>{let r=e.until(t);return rN(r)?ui(r,e=>!e):lI(!r)})),void 0!==e.times&&(t=hy(t,({attempt:t})=>lI(t<=e.times))),t},hN=hy(hv,({attempt:e})=>lI(e<=1)),hM="~effect/MutableHashMap",hU={[hM]:hM,[Symbol.iterator](){return this.backing[Symbol.iterator]()},toString(){return`MutableHashMap(${ri(Array.from(this))})`},toJSON(){return{_id:"MutableHashMap",values:rf(Array.from(this))}},[rc](){return this.toJSON()},pipe(){return eV(this,arguments)}},h$=eZ(2,(e,t)=>{if(e.backing.has(t))return nv(e.backing.get(t));if(hj(t))return nb;let r=tA(t),n=e.buckets.get(r);return void 0===n?nb:hB(e,n,t)}),hj=e=>"object"!=typeof e&&"function"!=typeof e,hB=(e,t,r)=>{for(let n=0,i=t.length;n<i;n++)if(tK(r,t[n])){let r=t[n];return nv(e.backing.get(r))}return nb},hP=eZ(2,(e,t)=>nm(h$(e,t))),hR=eZ(3,(e,t,r)=>{if(e.backing.has(t)||hj(t))return e.backing.set(t,r),e;let n=tA(t),i=e.buckets.get(n);if(void 0===i)return e.buckets.set(n,[t]),e.backing.set(t,r),e;let s=hL(i,t);return void 0===s&&(i.push(t),s=t),e.backing.set(s,r),e}),hL=(e,t)=>{for(let r=0,n=e.length;r<n;r++)if(tK(t,e[r]))return e[r]},hF=eZ(2,(e,t)=>{if(hj(t))return e.backing.delete(t),e;let r=tA(t),n=e.buckets.get(r);if(void 0===n)return e;for(let r=0,i=n.length;r<i;r++){let i=n[r];if(i===t||tK(t,i)){e.backing.delete(i),n.splice(r,1);break}}return 0===n.length&&e.buckets.delete(r),e}),hD=((e,t)=>lO(()=>e.completeUnsafe(t)),new WeakSet),hz=new WeakMap,hH=iJ("effect/Metric/CurrentMetricAttributes",{defaultValue:()=>({})}),hJ=iJ("effect/Metric/MetricRegistry",{defaultValue:()=>new Map}),hW="~effect/Metric";class hq{[hW]=hW;#e;#t;#r="";id;description;attributes;constructor(e,t,r){this.id=e,this.description=t,this.attributes=r}valueUnsafe(e){return this.hook(e).get(e)}modifyUnsafe(e,t){return this.hook(t).modify(e,t)}updateUnsafe(e,t){return this.hook(t).update(e,t)}hook(e){let t=this.key(e),r=si(e,hJ),n=r.get(t);return th(n)&&(n=this.metadata(this.createHooks()),r.set(t,n)),n.hooks}removeUnsafe(e){si(e,hJ).delete(this.key(e))}registerUnsafe(e,t){let r=this.key(e),n=si(e,hJ),i=this.metadata({get:t.get,update:e3,modify:e3});return n.set(r,i),{remove(){n.get(r)===i&&n.delete(r)}}}key(e){let t=si(e,hH);if(t!==this.#e){var r;let e;this.#e=t;let n=function(e,t){return{...h1(e),...h1(t)}}(this.attributes,t);this.#t=Object.keys(t).length>0?n:this.attributes,this.#r=(r=this,e=Object.entries(n).sort((e,t)=>e[0]<t[0]?-1:+(e[0]>t[0])),JSON.stringify([r.type,r.id,r.description,e]))}return this.#r}metadata(e){return{id:this.id,type:this.type,description:this.description,attributes:this.#t,hooks:e}}pipe(){return eV(this,arguments)}}let hK=BigInt(0);class hV extends hq{type="Counter";#n;#i;constructor(e,t){super(e,t?.description,h1(t?.attributes)),this.#n=t?.bigint??!1,this.#i=t?.incremental??!1}createHooks(){let e=this.#n?hK:0,t=this.#i?this.#n?e=>e>=hK:e=>e>=0:e=>!0;return h0(()=>({count:e,incremental:this.#i}),r=>{t(r)&&(e+=r)})}}class hG extends hq{type;metric;mapInput;mapContext;constructor(e,t,r){super(e.id,e.description,e.attributes),this.metric=e,this.mapInput=t,this.mapContext=r,this.type=e.type}createHooks(){return this.metric.createHooks()}valueUnsafe(e){return this.metric.valueUnsafe(this.mapContext(e))}updateUnsafe(e,t){let r=this.mapContext(t);this.metric.updateUnsafe(this.mapInput(e,r),r)}modifyUnsafe(e,t){let r=this.mapContext(t);this.metric.modifyUnsafe(this.mapInput(e,r),r)}removeUnsafe(e){hZ(this.metric,this.mapContext(e))}registerUnsafe(e,t){return hX(this.metric,this.mapContext(e),{get:t.get,update:e3,modify:e3})}}let hY=(e,t)=>new hV(e,t),hZ=((e,t)=>uk(r=>lO(()=>e.updateUnsafe(t,r))),(e,t)=>e.removeUnsafe(t)),hX=(e,t,r)=>e.registerUnsafe(t,r),hQ=((e,t)=>new hG(e,t,eX),e=>Array.from(e).map(([e,t])=>`(${e} -> ${t})`).join(", "));function h0(e,t,r){return{get:e,update:t,modify:r??t}}new class e extends hq{type="Gauge";#n;constructor(e,t){super(e,t?.description,h1(t?.attributes)),this.#n=t?.bigint??!1}createHooks(){let e=this.#n?BigInt(0):0;return h0(()=>({value:e}),t=>{e=t},t=>{e+=t})}}("child_fibers_active",{description:"The current count of active child fibers"});function h1(e){return tp(e)&&Array.isArray(e)?e.reduce((e,[t,r])=>(ry(e,t,r),e),{}):e}let h2=e=>lL(function(t,r){e(r).then(e=>t(lI(e)),e=>t(lj(e)))},0!==e.length),h3=e=>{let t="function"==typeof e?e:e.try,r="function"==typeof e?e=>new fI(e,"An error occurred in Effect.tryPromise"):e.catch;return lL(function(e,n){let i=e=>lN(()=>{try{return r8(rb(()=>r(e)))}catch(e){return lj(e)}});try{t(n).then(t=>e(lI(t)),t=>e(i(t)))}catch(t){e(i(t))}},0!==t.length)},h5=e=>lI(nv(e)),h8=(...e)=>{if(1===e.length){let t=e[0];return lN(()=>lK(t()))}let[t,r]=e;return lN(()=>lK(r.call(t.self)))},h4=e=>lN(()=>lT(e())),h6=e=>ue(e,eX),h9=(e,t,r)=>uk(n=>cP(i=>ue(cs,s=>l6(r?.interruptible?i(e):e,e=>cd(s,r=>uE(t(e,r),n)))))),h7=(e,t,r)=>cP(n=>ue(e,e=>cx(lN(()=>n(t(e))),t=>r(e,t),!0))),pe=e=>lO(()=>cT(e,cI)[0]),pt=(e,t)=>r6(r=>lI(fl(r,e,t))),pr=(e,...t)=>{let r=1===t.length?void 0:t[0],n=t[t.length-1];return r6(t=>{let i=fl(t,e,r),s=t.getRef(ff),a=t.getRef(oJ);return cw(t,e=>fu(i,e,s,a)),n(i)})},pn=function(){let e=rN(arguments[0]),t=e?arguments[1]:arguments[0],r=e?arguments[2]:arguments[1],n=eX;if("Span"===t._tag){var i,s;r=oX(r),i=t.name,s="function"==typeof(s=r?.captureStackTrace)?s:e3,n=ux(oz,e=>({name:i,stack:s,parent:e}))}return e?fc(n(arguments[0]),t):e=>fc(n(e),t)},pi=fB(),ps=fB("Error"),pa=eZ(e=>rN(e[0]),(e,...t)=>ux(e,oK,e=>{let r=1===t.length?{...e,...t[0]}:{...e};return 1===t.length||ry(r,t[0],t[1]),r})),po=eZ(2,(e,t)=>ue(fy,r=>ux(e,oZ,e=>[[t,r],...e]))),pl=(e,...t)=>{let r=lH(e,t);return lW(r.length,0===t.length?function(){return lq(()=>r.apply(this,arguments))}:function(){let e=lq(()=>r.apply(this,arguments));for(let r of t)e=r(e,...arguments);return e})};e.s(["acquireRelease",0,h9,"acquireUseRelease",0,h7,"addFinalizer",0,e=>ue(cs,t=>uk(r=>cd(t,t=>uE(e(t),r)))),"all",0,cR,"andThen",0,l4,"annotateLogs",0,pa,"as",0,lV,"asSome",0,l8,"asVoid",0,l9,"cached",0,pe,"callback",0,lD,"catch",0,uP,"catchCause",0,uU,"catchCauseFilter",0,uB,"catchDefect",0,uR,"catchEager",0,ul,"catchFilter",0,uz,"catchIf",0,uD,"catchReason",0,uW,"catchTag",0,uH,"catchTags",0,uJ,"clockWith",0,fm,"context",0,uw,"contextWith",0,uk,"delay",0,ce,"die",0,lj,"ensuring",0,ck,"exit",0,u9,"fail",0,r8,"failCause",0,lT,"failCauseSync",0,h4,"failSync",0,lB,"filter",0,cV,"filterMapEffect",0,cG,"filterOrElse",0,cK,"filterOrFail",0,uO,"flatMap",0,ue,"flatMapEager",0,un,"flatten",0,h6,"fnUntraced",0,lJ,"fnUntracedEager",0,pl,"forEach",0,cF,"forever",0,uM,"forkChild",0,cY,"forkIn",0,cQ,"forkScoped",0,c0,"fromResult",0,lM,"gen",0,h8,"ignore",0,uG,"ignoreCause",0,uY,"interrupt",0,cO,"isEffect",0,rN,"log",0,pi,"logError",0,ps,"makeSpan",0,pt,"map",0,ui,"mapBothEager",0,uo,"mapEager",0,us,"mapError",0,uq,"mapErrorEager",0,ua,"matchCauseEffect",0,uX,"matchCauseEffectEager",0,ut,"matchEffect",0,u8,"never",0,lz,"onError",0,c_,"onExit",0,cS,"onExitPrimitive",0,cx,"onInterrupt",0,cA,"orDie",0,e=>uP(e,lj),"promise",0,h2,"provide",0,hk,"provideContext",0,uE,"provideService",0,u_,"provideServiceEffect",0,uA,"raceAll",0,(e,t)=>r6(r=>{let n=new Set;return cw(r,()=>0===n.size?void 0:lA(n)),lD(i=>{let s=s$(e),a=s.length,o=0,l=!1,u=[],c=(e,n,s)=>{if(o++,"Failure"===e._tag){u.push(...e.cause.reasons),o>=a&&i(lT(o5(rF(u))));return}let c=!l;l=!0,i(e),c&&t?.onWinner&&t.onWinner({fiber:n,index:s,parentFiber:r})};for(let e=0;e<a;e++){let t=cZ(r,s[e],!0,!0,!1);if(n.add(t),t.addObserver(r=>{n.delete(t),c(r,t,e)}),l)break}})}),"raceFirst",0,l7,"repeat",0,hC,"result",0,uZ,"retry",0,hA,"runFork",0,c3,"runForkWith",0,c1,"runPromise",0,c6,"runPromiseExit",0,c8,"runPromiseWith",0,c4,"runSync",0,fe,"runSyncExit",0,c7,"scope",0,cs,"scoped",0,e=>r6(t=>{let r=t.context,n=cg(void 0,void 0);return t.setContext(i7(t.context,cs,n)),cw(t,e=>(t.setContext(r),co(n,e))),e}),"scopedWith",0,cy,"service",0,e=>e,"serviceOption",0,e=>r6(t=>lI(sl(t.context,e))),"sleep",0,fb,"succeed",0,lI,"succeedNone",0,l$,"succeedSome",0,h5,"suspend",0,lN,"sync",0,lO,"tap",0,l6,"tapError",0,uF,"timeoutOrElse",0,ct,"try",0,lR,"tryPromise",0,h3,"undefined",0,fL,"uninterruptible",0,cN,"uninterruptibleMask",0,cP,"updateContext",0,uv,"updateService",0,ux,"useSpan",0,pr,"void",0,lP,"when",0,uN,"whileLoop",0,cL,"withFiber",0,r6,"withFiberSucceed",0,r9,"withLogSpan",0,po,"withParentSpan",0,pn,"yieldNow",0,lU,"zip",0,uI,"zipWith",0,uT],4270);let pu="~effect/crypto/CryptoError",pc="~effect/crypto/CryptoError/Reason";class pf extends om("InvalidArgument"){[pc]=pc;get message(){return this.description}}class pd extends om("InvalidKey"){[pc]=pc;get message(){return this.description}}class ph extends om("DecryptionFailed"){[pc]=pc;get message(){return"Could not decrypt the data"}}class pp extends om("Unsupported"){[pc]=pc;get message(){return this.description}}class pg extends om("NotExtractable"){[pc]=pc;get message(){return this.description}}class pm extends om("CryptoError"){[pu]=pu;cause="cause"in this.reason?this.reason.cause:void 0;get message(){return`${this.module}.${this.method}: ${this.reason.message}`}}function pb(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name&&"BYTES_PER_ELEMENT"in e&&1===e.BYTES_PER_ELEMENT}let py=e=>e?`"${e}" `:"";function pv(e,t=""){if("boolean"!=typeof e)throw TypeError(py(t)+"expected boolean, got type="+typeof e);return e}function px(e,t=""){if("number"!=typeof e)throw TypeError(py(t)+"expected number, got "+typeof e);if(!Number.isSafeInteger(e)||e<0)throw RangeError(py(t)+"expected integer >= 0, got "+e);return e}function pw(e,t,r=""){if(pb(e)&&(void 0===t||e.length===t))return e;void 0!==t&&px(t,"length");let n=pb(e),i=void 0!==t?` of length ${t}`:"",s=n?`length=${e.length}`:`type=${typeof e}`,a=py(r)+"expected Uint8Array"+i+", got "+s;if(!n)throw TypeError(a);throw RangeError(a)}let pS=(e,t)=>{if(null===e||"object"!=typeof e||Array.isArray(e))throw TypeError("object"===t?"expected valid options object":`"${t}" expected object, got type=${typeof e}`)};function pk(e,t=!0){if(e.destroyed)throw Error("hash was destroyed");if(t&&e.finished)throw Error("digest() was already called")}function pE(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function p_(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}let pC=68===new Uint8Array(new Uint32Array([0x11223344]).buffer)[0],pA=pC?e=>e:function(e){for(let r=0;r<e.length;r++){var t;e[r]=(t=e[r])<<24&0xff000000|t<<8&0xff0000|t>>>8&65280|t>>>24&255}return e};function pI(e,t,r=!0){if(void 0===t)return new Uint8Array(e);if(pw(t,e,"output"),r&&!pT(t))throw Error("invalid output, must be aligned");return t}function pT(e){return e.byteOffset%4==0}function pO(e){return Uint8Array.from(pw(e))}let pN=e=>Uint8Array.from(e.split(""),e=>e.charCodeAt(0)),pM=pA(pE(pN("expand 16-byte k"))),pU=pA(pE(pN("expand 32-byte k")));function p$(e,t){return e<<t|e>>>32-t}let pj=Uint32Array.of();function pB(e,t){var r;let{allowShortKeys:n,extendNonceFn:i,counterLength:s,counterRight:a,rounds:o}=(pS(r={allowShortKeys:!1,counterLength:8,counterRight:!1,rounds:20},"defaults"),pS(t,"opts"),Object.assign(r,t));if("function"!=typeof e)throw Error("core must be a function");return px(s),px(o),pv(a),pv(n),(t,r,l,u,c=0)=>{let f,d;pw(t,void 0,"key"),pw(r,void 0,"nonce"),pw(l,void 0,"data");let h=l.length,p=void 0!==u;if(u=pI(h,u,!1),p&&function(e,t){if(e.byteLength&&t.byteLength&&e.buffer===t.buffer&&e.byteOffset<t.byteOffset+t.byteLength&&t.byteOffset<e.byteOffset+e.byteLength&&e.byteOffset<t.byteOffset)throw Error("complex overlap of input and output is not supported")}(l,u),px(c),c<0||c>=0xffffffff)throw Error("arx: counter overflow");let g=[],m=t.length;if(32===m)g.push(f=pO(t)),d=pU;else if(16===m&&n)(f=new Uint8Array(32)).set(t),f.set(t,16),d=pM,g.push(f);else throw pw(t,32,"arx key"),Error("invalid key size");pC&&pT(r)||g.push(r=pO(r));let b=pE(f);if(i){if(24!==r.length)throw Error("arx: extended nonce must be 24 bytes");let e=r.subarray(0,16);if(pC)i(d,b,pE(e),b);else{let t=pA(Uint32Array.from(d));i(t,b,pE(e),b),p_(t),pA(b)}r=r.subarray(16)}else pC||pA(b);let y=16-s;if(y!==r.length)throw Error(`arx: nonce must be ${y} or 16 bytes`);if(12!==y){let e=new Uint8Array(12);e.set(r,a?0:12-r.length),r=e,g.push(r)}let v=pA(pE(r));try{return!function(e,t,r,n,i,s,a,o){let l=i.length,u=new Uint8Array(64),c=pE(u),f=pC&&pT(i)&&pT(s),d=f?pE(i):pj,h=f?pE(s):pj;if(!pC){for(let f=0;f<l;a++){if(e(t,r,n,c,a,o),pA(c),a>=0xffffffff)throw Error("arx: counter overflow");let d=Math.min(64,l-f);for(let e=0,t;e<d;e++)s[t=f+e]=i[t]^u[e];f+=d}return}for(let p=0;p<l;a++){if(e(t,r,n,c,a,o),a>=0xffffffff)throw Error("arx: counter overflow");let g=Math.min(64,l-p);if(f&&64===g){let e=p/4;if(p%4!=0)throw Error("arx: invalid block position");for(let t=0,r;t<16;t++)h[r=e+t]=d[r]^c[t];p+=64;continue}for(let e=0,t;e<g;e++)s[t=p+e]=i[t]^u[e];p+=g}}(e,d,b,v,l,u,c,o),u}finally{p_(...g)}}}function pP(e,t){return 255&e[t++]|(255&e[t++])<<8}class pR{blockLen=16;outputLen=16;buffer=new Uint8Array(16);r=new Uint16Array(10);h=new Uint16Array(10);pad=new Uint16Array(8);pos=0;finished=!1;destroyed=!1;constructor(e){let t=pP(e=pO(pw(e,32,"key")),0),r=pP(e,2),n=pP(e,4),i=pP(e,6),s=pP(e,8),a=pP(e,10),o=pP(e,12),l=pP(e,14);this.r[0]=8191&t,this.r[1]=(t>>>13|r<<3)&8191,this.r[2]=(r>>>10|n<<6)&7939,this.r[3]=(n>>>7|i<<9)&8191,this.r[4]=(i>>>4|s<<12)&255,this.r[5]=s>>>1&8190,this.r[6]=(s>>>14|a<<2)&8191,this.r[7]=(a>>>11|o<<5)&8065,this.r[8]=(o>>>8|l<<8)&8191,this.r[9]=l>>>5&127;for(let t=0;t<8;t++)this.pad[t]=pP(e,16+2*t)}process(e,t,r=!1){let{h:n,r:i}=this,s=i[0],a=i[1],o=i[2],l=i[3],u=i[4],c=i[5],f=i[6],d=i[7],h=i[8],p=i[9],g=pP(e,t+0),m=pP(e,t+2),b=pP(e,t+4),y=pP(e,t+6),v=pP(e,t+8),x=pP(e,t+10),w=pP(e,t+12),S=pP(e,t+14),k=n[0]+(8191&g),E=n[1]+((g>>>13|m<<3)&8191),_=n[2]+((m>>>10|b<<6)&8191),C=n[3]+((b>>>7|y<<9)&8191),A=n[4]+((y>>>4|v<<12)&8191),I=n[5]+(v>>>1&8191),T=n[6]+((v>>>14|x<<2)&8191),O=n[7]+((x>>>11|w<<5)&8191),N=n[8]+((w>>>8|S<<8)&8191),M=n[9]+(S>>>5|2048*!r),U=0,$=0+k*s+5*p*E+5*h*_+5*d*C+5*f*A;U=$>>>13,$&=8191,$+=5*c*I+5*u*T+5*l*O+5*o*N+5*a*M,U+=$>>>13,$&=8191;let j=U+k*a+E*s+5*p*_+5*h*C+5*d*A;U=j>>>13,j&=8191,j+=5*f*I+5*c*T+5*u*O+5*l*N+5*o*M,U+=j>>>13,j&=8191;let B=U+k*o+E*a+_*s+5*p*C+5*h*A;U=B>>>13,B&=8191,B+=5*d*I+5*f*T+5*c*O+5*u*N+5*l*M,U+=B>>>13,B&=8191;let P=U+k*l+E*o+_*a+C*s+5*p*A;U=P>>>13,P&=8191,P+=5*h*I+5*d*T+5*f*O+5*c*N+5*u*M,U+=P>>>13,P&=8191;let R=U+k*u+E*l+_*o+C*a+A*s;U=R>>>13,R&=8191,R+=5*p*I+5*h*T+5*d*O+5*f*N+5*c*M,U+=R>>>13,R&=8191;let L=U+k*c+E*u+_*l+C*o+A*a;U=L>>>13,L&=8191,L+=I*s+5*p*T+5*h*O+5*d*N+5*f*M,U+=L>>>13,L&=8191;let F=U+k*f+E*c+_*u+C*l+A*o;U=F>>>13,F&=8191,F+=I*a+T*s+5*p*O+5*h*N+5*d*M,U+=F>>>13,F&=8191;let D=U+k*d+E*f+_*c+C*u+A*l;U=D>>>13,D&=8191,D+=I*o+T*a+O*s+5*p*N+5*h*M,U+=D>>>13,D&=8191;let z=U+k*h+E*d+_*f+C*c+A*u;U=z>>>13,z&=8191,z+=I*l+T*o+O*a+N*s+5*p*M,U+=z>>>13,z&=8191;let H=U+k*p+E*h+_*d+C*f+A*c;U=H>>>13,H&=8191,H+=I*u+T*l+O*o+N*a+M*s,U+=H>>>13,H&=8191,$=8191&(U=(U=(U<<2)+U|0)+$|0),U>>>=13,j+=U,n[0]=$,n[1]=j,n[2]=B,n[3]=P,n[4]=R,n[5]=L,n[6]=F,n[7]=D,n[8]=z,n[9]=H}finalize(){let{h:e,pad:t}=this,r=new Uint16Array(10),n=e[1]>>>13;e[1]&=8191;for(let t=2;t<10;t++)e[t]+=n,n=e[t]>>>13,e[t]&=8191;e[0]+=5*n,n=e[0]>>>13,e[0]&=8191,e[1]+=n,n=e[1]>>>13,e[1]&=8191,e[2]+=n,r[0]=e[0]+5,n=r[0]>>>13,r[0]&=8191;for(let t=1;t<10;t++)r[t]=e[t]+n,n=r[t]>>>13,r[t]&=8191;r[9]-=8192;let i=(1^n)-1;for(let e=0;e<10;e++)r[e]&=i;i=~i;for(let t=0;t<10;t++)e[t]=e[t]&i|r[t];e[0]=(e[0]|e[1]<<13)&65535,e[1]=(e[1]>>>3|e[2]<<10)&65535,e[2]=(e[2]>>>6|e[3]<<7)&65535,e[3]=(e[3]>>>9|e[4]<<4)&65535,e[4]=(e[4]>>>12|e[5]<<1|e[6]<<14)&65535,e[5]=(e[6]>>>2|e[7]<<11)&65535,e[6]=(e[7]>>>5|e[8]<<8)&65535,e[7]=(e[8]>>>8|e[9]<<5)&65535;let s=e[0]+t[0];e[0]=65535&s;for(let r=1;r<8;r++)s=(e[r]+t[r]|0)+(s>>>16)|0,e[r]=65535&s;p_(r)}update(e){pk(this),pw(e);let{buffer:t,blockLen:r}=this,n=(e=pO(e)).length;for(let i=0;i<n;){let s=Math.min(r-this.pos,n-i);if(s===r){for(;r<=n-i;i+=r)this.process(e,i);continue}t.set(e.subarray(i,i+s),this.pos),this.pos+=s,i+=s,this.pos===r&&(this.process(t,0,!1),this.pos=0)}return this}destroy(){this.destroyed=!0,p_(this.h,this.r,this.buffer,this.pad)}digestInto(e){pk(this);pw(e,void 0,"output");let t=this.outputLen;if(!(e.length>=t))throw RangeError('"output" expected length >= '+t);this.finished=!0;let{buffer:r,h:n}=this,{pos:i}=this;if(i){for(r[i++]=1;i<16;i++)r[i]=0;this.process(r,0,!0)}this.finalize();let s=0;for(let t=0;t<8;t++)e[s++]=n[t]>>>0,e[s++]=n[t]>>>8}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let r=e.slice(0,t);return this.destroy(),r}}function pL(e,t,r,n,i,s=20){let a=e[0],o=e[1],l=e[2],u=e[3],c=t[0],f=t[1],d=t[2],h=t[3],p=t[4],g=t[5],m=t[6],b=t[7],y=r[0],v=r[1],x=r[2],w=a,S=o,k=l,E=u,_=c,C=f,A=d,I=h,T=p,O=g,N=m,M=b,U=i,$=y,j=v,B=x;for(let e=0;e<s;e+=2)T=T+(U=p$(U^(w=w+_|0),16))|0,w=w+(_=p$(_^T,12))|0,T=T+(U=p$(U^w,8))|0,_=p$(_^T,7),O=O+($=p$($^(S=S+C|0),16))|0,S=S+(C=p$(C^O,12))|0,O=O+($=p$($^S,8))|0,C=p$(C^O,7),N=N+(j=p$(j^(k=k+A|0),16))|0,k=k+(A=p$(A^N,12))|0,N=N+(j=p$(j^k,8))|0,A=p$(A^N,7),M=M+(B=p$(B^(E=E+I|0),16))|0,E=E+(I=p$(I^M,12))|0,M=M+(B=p$(B^E,8))|0,I=p$(I^M,7),N=N+(B=p$(B^(w=w+C|0),16))|0,w=w+(C=p$(C^N,12))|0,N=N+(B=p$(B^w,8))|0,C=p$(C^N,7),M=M+(U=p$(U^(S=S+A|0),16))|0,S=S+(A=p$(A^M,12))|0,M=M+(U=p$(U^S,8))|0,A=p$(A^M,7),T=T+($=p$($^(k=k+I|0),16))|0,k=k+(I=p$(I^T,12))|0,T=T+($=p$($^k,8))|0,I=p$(I^T,7),O=O+(j=p$(j^(E=E+_|0),16))|0,E=E+(_=p$(_^O,12))|0,O=O+(j=p$(j^E,8))|0,_=p$(_^O,7);let P=0;n[P++]=a+w|0,n[P++]=o+S|0,n[P++]=l+k|0,n[P++]=u+E|0,n[P++]=c+_|0,n[P++]=f+C|0,n[P++]=d+A|0,n[P++]=h+I|0,n[P++]=p+T|0,n[P++]=g+O|0,n[P++]=m+N|0,n[P++]=b+M|0,n[P++]=i+U|0,n[P++]=y+$|0,n[P++]=v+j|0,n[P++]=x+B|0}let pF=pB(pL,{counterRight:!1,counterLength:4,allowShortKeys:!1}),pD=pB(pL,{counterRight:!1,counterLength:8,extendNonceFn:function(e,t,r,n){let i=pC?e:pA(e.slice(0,4)),s=pC?t:pA(t.slice(0,8)),a=pC?r:pA(r.slice(0,4)),o=new Uint32Array(16);pL(i,s,a.subarray(1),o,a[0]);let l=0;n[l++]=o[0]-i[0]|0,n[l++]=o[1]-i[1]|0,n[l++]=o[2]-i[2]|0,n[l++]=o[3]-i[3]|0,n[l++]=o[12]-a[0]|0,n[l++]=o[13]-a[1]|0,n[l++]=o[14]-a[2]|0,n[l++]=o[15]-a[3]|0,pA(n),pC||p_(i,s,a),p_(o)},allowShortKeys:!1}),pz=new Uint8Array(16),pH=(e,t)=>{e.update(t);let r=t.length%16;r&&e.update(pz.subarray(r))},pJ=new Uint8Array(32);function pW(e,t,r,n,i){var s,a;let o,l;void 0!==i&&pw(i,void 0,"AAD");let u=e(t,r,pJ),c=(s=n.length,a=i?i.length:0,px(s),px(a),pv(!0),(l=new DataView((o=new Uint8Array(16)).buffer,o.byteOffset,o.byteLength)).setBigUint64(0,BigInt(a),!0),l.setBigUint64(8,BigInt(s),!0),o),f=new pR(u);i&&pH(f,i),pH(f,n),f.update(c);let d=f.digest();return p_(u,c),d}let pq=e=>(t,r,n)=>({encrypt(i,s){let a=i.length;(s=pI(a+16,s,!1)).set(i);let o=s.subarray(0,-16);e(t,r,o,o,1);let l=pW(e,t,r,o,n);return s.set(l,a),p_(l),s},decrypt(i,s){s=pI(i.length-16,s,!1);let a=i.subarray(0,-16),o=i.subarray(-16),l=pW(e,t,r,a,n);return!function(e,t){if(e=pw(e),t=pw(t),e.length!==t.length)return!1;let r=0;for(let n=0;n<e.length;n++)r|=e[n]^t[n];return 0===r}(o,l)?void p_(l):(s.set(i.subarray(0,-16)),e(t,r,s,s,1),p_(l),s)}}),pK=pq(pF),pV=pq(pD),pG=iJ("effect/crypto/WebCrypto",{defaultValue:()=>globalThis.crypto}),pY=(e,t,r)=>r8(new pm({module:e,method:t,reason:r})),pZ=(e,t,r)=>pY(e,t,new pd({description:r}));class pX{reason;constructor(e){this.reason=e}}let pQ=(e,t,r,n,i)=>p0(e,t,`${e}.layerWebCrypto`,r,n,i),p0=(e,t,r,n,i,s)=>{let a=p1(t,r,n,i,s);if(void 0===a)throw i;return new pm({module:e,method:t,reason:a})},p1=(e,t,r,n,i)=>{if(n instanceof pX)return n.reason;switch(tx(n,"name")?n.name:void 0){case"DataError":return new pd({description:"Invalid key data",cause:n});case"InvalidAccessError":return new pd({description:`The key cannot be used for ${e}`,cause:n});case"NotSupportedError":return new pp({description:`${t} does not provide ${r}`,cause:n});case"OperationError":return i?.();default:return}},p2=(e,t,r,n,i,s=n=>pQ(e,t,r,n))=>lN(()=>{let e=n?.subtle;return void 0===e?lj(Error("crypto.subtle is unavailable; browsers expose it only in secure contexts")):h3({try:()=>i(e),catch:s})}),p3=Symbol("~effect/crypto/Key/material"),p5=e=>new Uint8Array(e),p8=e=>e[p3],p4=(e,t)=>({[e]:e,toJSON(){return{_id:t,algorithm:this.algorithm.name}},toString(){return ri(this.toJSON())},[rc](){return this.toJSON()}}),p6=(e,t,r)=>t5(Object.create(e,{algorithm:{value:t,enumerable:!0},[p3]:{value:r}})),p9=(e,t,r)=>p6(e,t,{_tag:"Bytes",bytes:r}),p7=e=>t=>t.length===e.keyLength?void 0:`Expected a ${e.keyLength}-byte key for ${e.name}, not ${t.length} bytes`,ge=(e,t,r,n,i,s)=>lN(()=>{if(!(i instanceof Uint8Array))return pZ(e,t,"Expected the key as a Uint8Array");let a=s(i);return void 0===a?lI(p9(r,n,p5(i))):pZ(e,t,a)}),gt=(e,t)=>r=>{let n=r.length;return n===8*t?void 0:`Expected a ${8*t}-bit ${e} key, not ${n} bits`},gr=(e,t,r,n,i,s)=>lN(()=>{let a,o=((e,t)=>{if(!tx(e,"type")||!tx(e,"algorithm")||!tx(e,"usages")||!Array.isArray(e.usages))return"Expected a CryptoKey";if(e.algorithm.name!==t.name)return`Expected a ${t.name} key, not ${e.algorithm.name}`;if(e.type!==t.type)return`Expected a ${t.type} key, not ${e.type}`;let r=t.check?.(e.algorithm);if(void 0!==r)return r;let n=e.usages;if("all"===t.usagePolicy){if(!t.usages.every(e=>n.includes(e)))return`Expected a key with the usages ${t.usages.join(" and ")}, not ${n.join(", ")||"none"}`}else if(!t.usages.some(e=>n.includes(e)))return`Expected a key with one of the usages ${t.usages.join(", ")}`})(i,s);return void 0===o?lI(p6(r,(a=i.algorithm.modulusLength,tx(n,"modulusLength")&&void 0!==a&&n.modulusLength!==a?{...n,modulusLength:a}:n),{_tag:"CryptoKey",cryptoKey:i})):pZ(e,t,o)}),gn=async(e,t)=>new Uint8Array(await e.exportKey("raw",t)),gi=(e,t,r)=>lN(()=>{let n,i,s,a=p8(t);if("Bytes"===a._tag)return lI(p5(a.bytes));if(!a.cryptoKey.extractable)return pY(e,"toBytes",new pg({description:"The CryptoKey is not extractable"}));return n="toBytes",i=t.algorithm.name,s=e=>r(e,a.cryptoKey),pG.use(t=>p2(e,n,i,t,s,t=>p0(e,n,"crypto.subtle",i,t)))}),gs=e=>{let t=new WeakMap;return async(r,n)=>{let i=p8(n);if("CryptoKey"===i._tag)return i.cryptoKey;let s=t.get(n);return void 0===s&&(s=await e(r,i.bytes,n.algorithm),t.set(n,s)),s}},ga=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));class go extends(iJ())("effect/crypto/SecureRandom"){}let gl="~effect/crypto/Aead/Key",gu=e=>({encrypt:(t,r,n,i)=>e(t,r,i).encrypt(n),decrypt:(t,r,n,i)=>e(t,r,i).decrypt(n)}),gc={name:"chacha20Poly1305",keyLength:32,nonceLength:12,implementation:gu(pK)},gf={name:"xchacha20Poly1305",keyLength:32,nonceLength:24,implementation:gu(pV)},gd=p4(gl,"Aead.Key");class gh extends(iJ())("effect/crypto/Aead"){}let gp=()=>pY("Aead","decrypt",new ph),gg=e=>di(gh,h8(function*(){let t=yield*go,r=yield*pG,n=gs((e,t)=>e.importKey("raw",t,"AES-GCM",!1,["encrypt","decrypt"])),i=e.implementations,s=e=>(t,s,a)=>lN(()=>{let o,l,u=((e,t,r,n)=>{let i=t.algorithm;if(n.nonce.length!==i.nonceLength)return pY("Aead",e,new pf({description:`${i.name} nonces must contain exactly ${i.nonceLength} bytes`}));if("encrypt"===e){if(void 0===i.implementation&&r.length>0xfffffffe0)return pY("Aead",e,new pf({description:"AES-GCM plaintext cannot exceed 2^36 - 32 bytes"}))}else if(r.length<16)return gp()})(e,t,s,a);if(void 0!==u)return u;let c=void 0!==(o=i?.[t.algorithm.name])&&"Bytes"===p8(t)._tag?o:t.algorithm.implementation;return void 0===c?(l={name:"AES-GCM",iv:a.nonce,tagLength:128,...void 0===a.aad?{}:{additionalData:a.aad}},p2("Aead",e,t.algorithm.name,r,async r=>new Uint8Array(await r[e](l,await n(r,t),s)),r=>pQ("Aead",e,t.algorithm.name,r,"decrypt"===e?()=>new ph:void 0))):((e,t,r,n,i)=>{let s=p8(r);if("Bytes"!==s._tag)return pY("Aead",e,new pd({description:`${r.algorithm.name} keys must hold bytes`}));let a=i.aad??new Uint8Array(0);return"encrypt"===e?lO(()=>t.encrypt(s.bytes,i.nonce,n,a)):lN(()=>{let e=t.decrypt(s.bytes,i.nonce,n,a);return void 0===e?gp():lI(e)})})(e,c,t,s,a)});return gh.of({generateKey:e=>ui(t.randomBytes(e.keyLength),t=>p9(gd,e,t)),encrypt:s("encrypt"),decrypt:s("decrypt")})})),gm=gg({});e.s(["Aead",0,gh,"aes128Gcm",0,{name:"aes128Gcm",keyLength:16,nonceLength:12,implementation:void 0},"aes256Gcm",0,{name:"aes256Gcm",keyLength:32,nonceLength:12,implementation:void 0},"chacha20Poly1305",0,gc,"fromCryptoKey",0,(e,t)=>void 0!==e.implementation?pZ("Aead","fromCryptoKey",`${e.name} keys cannot be CryptoKeys`):gr("Aead","fromCryptoKey",gd,e,t,{type:"secret",name:"AES-GCM",usages:["encrypt","decrypt"],usagePolicy:"all",check:gt("AES-GCM",e.keyLength)}),"isKey",0,e=>tx(e,gl),"key",0,(e,t)=>ge("Aead","key",gd,e,t,p7(e)),"layerWebCrypto",0,gm,"layerWebCryptoWith",0,gg,"toBytes",0,e=>gi("Aead",e,gn),"xchacha20Poly1305",0,gf],42913);let gb="~effect/crypto/Cipher/Key",gy=p4(gb,"Cipher.Key");class gv extends(iJ())("effect/crypto/Cipher"){}let gx=di(gv,h8(function*(){let e=yield*go,t=yield*pG,r=gs((e,t,r)=>e.importKey("raw",t,r.mode,!1,["encrypt","decrypt"])),n=e=>(n,i,s)=>lN(()=>{if(16!==s.iv.length)return pY("Cipher",e,new pf({description:"IVs must contain exactly 16 bytes"}));let a="AES-CBC"===n.algorithm.mode;return"decrypt"===e&&a&&(0===i.length||i.length%16!=0)?pY("Cipher",e,new ph):p2("Cipher",e,n.algorithm.name,t,async t=>{let a,o;return new Uint8Array(await t[e]((a=n.algorithm,o=s.iv,"AES-CTR"===a.mode?{name:"AES-CTR",counter:o,length:128}:{name:"AES-CBC",iv:o}),await r(t,n),i))},t=>pQ("Cipher",e,n.algorithm.name,t,"decrypt"===e&&a?()=>new ph:void 0))});return gv.of({generateKey:t=>ui(e.randomBytes(t.keyLength),e=>p9(gy,t,e)),encrypt:n("encrypt"),decrypt:n("decrypt")})}));e.s(["Cipher",0,gv,"aes128Cbc",0,{name:"aes128Cbc",mode:"AES-CBC",keyLength:16},"aes128Ctr",0,{name:"aes128Ctr",mode:"AES-CTR",keyLength:16},"aes256Cbc",0,{name:"aes256Cbc",mode:"AES-CBC",keyLength:32},"aes256Ctr",0,{name:"aes256Ctr",mode:"AES-CTR",keyLength:32},"fromCryptoKey",0,(e,t)=>gr("Cipher","fromCryptoKey",gy,e,t,{type:"secret",name:e.mode,usages:["encrypt","decrypt"],usagePolicy:"all",check:gt(e.mode,e.keyLength)}),"isKey",0,e=>tx(e,gb),"key",0,(e,t)=>ge("Cipher","key",gy,e,t,p7(e)),"layerWebCrypto",0,gx,"toBytes",0,e=>gi("Cipher",e,gn)],99175);let gw=e=>Uint8Array.of(48,46,2,1,0,48,5,6,3,43,101,e,4,34,4,32),gS=gw(112),gk=e=>t=>{let r=t.hash?.name;return r===e?void 0:`Expected a key for ${e}, not ${r}`},gE=e=>gC("string"==typeof e?gT.encode(e):e),g_=e=>{let t=gN(e),r=t.length;if(r%4!=0)return nI(new oy({kind:"Decode",module:"Base64",input:t,message:`Length must be a multiple of 4, but is ${r}`}));let n=t.indexOf("=");if(-1!==n&&(n<r-2||n===r-2&&"="!==t[r-1]))return nI(new oy({kind:"Decode",module:"Base64",input:t,message:"Found a '=' character, but it is not at the end"}));try{let e=t.endsWith("==")?2:+!!t.endsWith("="),n=new Uint8Array(r/4*3-e);for(let e=0,i=0;e<r;e+=4,i+=3){let r=gB(t.charCodeAt(e))<<18|gB(t.charCodeAt(e+1))<<12|gB(t.charCodeAt(e+2))<<6|gB(t.charCodeAt(e+3));n[i]=r>>16,n[i+1]=r>>8&255,n[i+2]=255&r}return nO(n)}catch(e){return nI(new oy({kind:"Decode",module:"Base64",input:t,message:e instanceof Error?e.message:"Invalid input"}))}},gC=e=>{let t=e.length,r=Uint8Array.prototype.toBase64;return t>=32&&"function"==typeof r?r.call(e):t<128?gA(e):gI(e)},gA=e=>{let t,r=e.length,n="";for(t=2;t<r;t+=3)n+=gM[e[t-2]>>2],n+=gM[(3&e[t-2])<<4|e[t-1]>>4],n+=gM[(15&e[t-1])<<2|e[t]>>6],n+=gM[63&e[t]];return t===r+1&&(n+=gM[e[t-2]>>2],n+=gM[(3&e[t-2])<<4],n+="=="),t===r&&(n+=gM[e[t-2]>>2],n+=gM[(3&e[t-2])<<4|e[t-1]>>4],n+=gM[(15&e[t-1])<<2],n+="="),n},gI=e=>{let t,r=e.length,n=new Uint8Array(4*Math.ceil(r/3)),i=0;for(t=2;t<r;t+=3,i+=4)n[i]=gU[e[t-2]>>2],n[i+1]=gU[(3&e[t-2])<<4|e[t-1]>>4],n[i+2]=gU[(15&e[t-1])<<2|e[t]>>6],n[i+3]=gU[63&e[t]];return t===r+1&&(n[i]=gU[e[t-2]>>2],n[i+1]=gU[(3&e[t-2])<<4],n[i+2]=g$,n[i+3]=g$),t===r&&(n[i]=gU[e[t-2]>>2],n[i+1]=gU[(3&e[t-2])<<4|e[t-1]>>4],n[i+2]=gU[(15&e[t-1])<<2],n[i+3]=g$),gO.decode(n)},gT=new TextEncoder,gO=new TextDecoder,gN=e=>e.replace(/[\n\r]/g,""),gM="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",gU=gT.encode(gM),g$=61,gj=(new Uint8Array(123)).fill(255);for(let e=0;e<gM.length;e++)gj[gM.charCodeAt(e)]=e;gj[61]=0;let gB=e=>{if(e>=gj.length||255===gj[e])throw TypeError(`Invalid character ${String.fromCharCode(e)}`);return gj[e]},gP="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",gR=new Uint8Array(128);for(let e=0;e<gP.length;e++)gR[gP.charCodeAt(e)]=e;let gL=new TextDecoder;e.i(42913),e.i(99175),v=[[7,12,17,22],[5,9,14,20],[4,11,16,23],[6,10,15,21]],Uint8Array.from({length:64},(e,t)=>v[Math.floor(t/16)][t%4]);let gF="~effect/crypto/Mac/Key",gD=p4(gF,"Mac.Key"),gz={MD5:64,"SHA-1":64,"SHA-256":64,"SHA-384":128,"SHA-512":128};class gH extends(iJ())("effect/crypto/Mac"){}let gJ=e=>di(gH,h8(function*(){let t=yield*go,r=yield*pG,n=gs((e,t,r)=>e.importKey("raw",t,{name:"HMAC",hash:r.hash.name},!1,["sign","verify"])),i=e.hmac,s=e=>{if(void 0===i)return;let t=p8(e);return"Bytes"===t._tag?r=>i(e.algorithm.hash.name,t.bytes,r):void 0};return gH.of({generateKey:e=>ui(t.randomBytes(gz[e.hash.name]),t=>p9(gD,e,t)),sign:(e,t)=>{let i=s(e);return void 0!==i?lO(()=>i(t)):p2("Mac","sign",e.algorithm.name,r,async r=>new Uint8Array(await r.sign("HMAC",await n(r,e),t)))},verify:(e,t,i)=>{let a=s(e);return void 0!==a?lO(()=>gq(a(i),t)):p2("Mac","verify",e.algorithm.name,r,async r=>r.verify("HMAC",await n(r,e),t,i))}})})),gW=gJ({}),gq=(e,t)=>{if(e.length!==t.length)return!1;let r=0;for(let n=0;n<e.length;n++)r|=e[n]^t[n];return 0===r};e.s(["Mac",0,gH,"fromCryptoKey",0,(e,t)=>gr("Mac","fromCryptoKey",gD,e,t,{type:"secret",name:"HMAC",usages:["sign","verify"],usagePolicy:"all",check:t=>{let r=t.hash?.name;return r===e.hash.name?void 0:`Expected an HMAC key for ${e.hash.name}, not ${r}`}}),"hmacSha1",0,{name:"hmacSha1",hash:{name:"SHA-1",outputLength:20,implementation:void 0}},"hmacSha256",0,{name:"hmacSha256",hash:{name:"SHA-256",outputLength:32,implementation:void 0}},"hmacSha384",0,{name:"hmacSha384",hash:{name:"SHA-384",outputLength:48,implementation:void 0}},"hmacSha512",0,{name:"hmacSha512",hash:{name:"SHA-512",outputLength:64,implementation:void 0}},"isKey",0,e=>tx(e,gF),"key",0,(e,t)=>ge("Mac","key",gD,e,t,e=>0===e.length?"An HMAC key cannot be empty":void 0),"layerWebCrypto",0,gW,"layerWebCryptoWith",0,gJ,"timingSafeEqual",0,gq,"toBytes",0,e=>gi("Mac",e,gn)],46893),e.i(46893);let gK="~effect/crypto/KeyWrap/Key",gV="~effect/crypto/KeyWrap/PrivateKey",gG=p4(gK,"KeyWrap.Key"),gY={module:"KeyWrap",specOf:e=>({name:"RSA-OAEP",importParams:{name:"RSA-OAEP",hash:e.hash.name},privateUsages:["decrypt"],publicUsages:["encrypt"],seedPrefix:void 0,publicFormat:"spki",check:gk(e.hash.name)}),privateKeyProto:p4(gV,"KeyWrap.PrivateKey"),publicKeyProto:p4("~effect/crypto/KeyWrap/PublicKey","KeyWrap.PublicKey"),isPrivateKey:e=>tx(e,gV)},gZ="~effect/http/Cookies",gX="~effect/http/Cookies/Cookie",gQ="~effect/http/Cookies/CookieError";class g0 extends og{}class g1 extends om("CookiesError"){static fromReason(e,t){return new g1({reason:new g0({_tag:e,cause:t})})}[gQ]=gQ;get message(){return this.reason._tag}}let g2={[gZ]:gZ,...rd,toJSON(){return{_id:"effect/Cookies",cookies:sT(this.cookies,e=>e.toJSON())}},pipe(){return eV(this,arguments)}},g3=e=>{let t=Object.create(g2);return t.cookies=e,t},g5=e=>{let t={};for(let r of e)ry(t,r.name,r);return g3(t)},g8=g5([]),g4=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,g6=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,g9=/^[\t ]+|[\t ]+$/g,g7=/^-?[0-9]+$/,me=/^[\u0009\u0020-\u003a\u003c-\u007e\u0080-\u00ff]+$/,mt=/^[\u0020-\u003a\u003c-\u007e]+$/,mr={[gX]:gX,...rd,toJSON(){return{_id:"effect/Cookies/Cookie",name:this.name,value:this.value,options:this.options}}};function mn(e,t,r){let n=encodeURIComponent(t),i=mi(e,n,r);return void 0!==i?nI(i):nO(Object.assign(Object.create(mr),{name:e,value:t,valueEncoded:n,options:r}))}function mi(e,t,r){return g6.test(e)?t&&!g4.test(t)?g1.fromReason("InvalidCookieValue"):r?.domain===void 0||me.test(r.domain)?r?.path===void 0||mt.test(r.path)?r?.maxAge===void 0||aX(az(r.maxAge))?void 0:g1.fromReason("CookieInfinityMaxAge"):g1.fromReason("InvalidCookiePath"):g1.fromReason("InvalidCookieDomain"):g1.fromReason("InvalidCookieName")}(e,t)=>g3({...e.cookies,...t.cookies}),(e,t)=>nH(Object.hasOwn(e.cookies,t)?e.cookies[t]:void 0);let ms=eZ(e=>tx(e[0],gZ),(e,t,r,n)=>sm(mn(t,r,n),r=>g3(sN(e.cookies,t,r)))),ma=eZ(e=>tx(e[0],gZ),(e,t,r,n)=>g3(sN(e.cookies,t,sy(mn(t,r,n))))),mo=((e=>tx(e[0],gZ),(e,t,r)=>ms(e,t,"",{...r,maxAge:0,expires:new Date(0)})),eZ(2,(e,t)=>{let r={...e.cookies};for(let[e,n,i]of t){let t=mn(e,n,i);if(n_(t))return t;ry(r,e,t.success)}return nO(g3(r))}));(e,t)=>sy(mo(e,t)),(e,t,r)=>{let n=ml(t);if(void 0===n)return;let i=n.hostname,s="https:"===n.protocol,a=e.filter(e=>{let t=mu(e);return void 0!==t&&(e.options?.hostOnly?i===t:md(i,t))&&mh(n.pathname,mc(e))&&(e.options?.expires===void 0||e.options.expires.getTime()>r)&&(s||!e.options?.secure)});return 0===a.length?void 0:a.sort((e,t)=>mc(t).length-mc(e).length).map(e=>`${e.name}=${e.valueEncoded}`).join("; ")};let ml=e=>{try{return new URL(e)}catch{return}},mu=e=>e.options?.domain?.replace(/^\./,"").toLowerCase()||void 0,mc=e=>e.options?.path?.startsWith("/")?e.options.path:"/",mf=e=>e.startsWith("[")||/^\d+\.\d+\.\d+\.\d+$/.test(e),md=(e,t)=>e===t||e.endsWith("."+t)&&!mf(e),mh=(e,t)=>e===t||e.startsWith(t)&&(t.endsWith("/")||"/"===e[t.length]),mp=(e,t,r)=>{var n;let i,s=e.hostname,a=s,o=!0,l=mu(t);if(void 0!==l){if(mf(s)||!md(s,l))return;if(l.includes("."))a=l,o=!1;else if(l!==s)return}let{maxAge:u,...c}=t.options??{};return Object.assign(Object.create(mr),{name:t.name,value:t.value,valueEncoded:t.valueEncoded,options:{...c,domain:a,hostOnly:o||void 0,path:c.path?.startsWith("/")?c.path:(i=(n=e.pathname).lastIndexOf("/"))<=0?"/":n.slice(0,i),expires:void 0!==u?new Date(r+a4(u)):c.expires}})},mg=e=>{try{return decodeURIComponent(e)}catch(t){return e}},mm=new WeakMap,mb=e=>{if(mm.has(e))return mm.get(e);throw Error("Unable to get redacted value"+(e.label?` with label: "${e.label}"`:""))},my="~effect/Redacted",mv=e=>tx(e,my),mx=(e,t)=>{let r=Object.create(mw);return t?.label&&(r.label=t.label),mm.set(r,e),r},mw={[my]:{_A:e=>e},label:void 0,...rT,toJSON(){return this.toString()},toString(){return`<redacted${ta(this.label)?":"+this.label:""}>`},[tC](){return tA(mm.get(this))},[tq](e){return mv(e)&&tK(mm.get(this),mm.get(e))}},mS=Symbol.for("~effect/http/Headers"),mk=Object.defineProperties(Object.create(null),{[mS]:{value:mS},[t9]:{value(e){return mj(this,si(e,mP))}},toJSON:{value(){return t7(this)}},[tq]:{value(e){return m_(this,e)}},[tC]:{value(){return tP(this)}},toString:{value:rd.toString},[rc]:{value:rd[rc]}}),mE=e=>Object.assign(Object.create(mk),e),m_=(x=eZ(2,(e,t)=>{for(let r of sO(e))if(!sA(t,r)||!t4(e[r],t[r]))return!1;return!0}),(e,t)=>x(e,t)&&x(t,e)),mC=Object.create(mk),mA=e=>{if(void 0===e)return mC;if(Symbol.iterator in e){let t=Object.create(mk);for(let[r,n]of e)t[r.toLowerCase()]=n;return t}let t=Object.create(mk);for(let[r,n]of Object.entries(e))Array.isArray(n)?t[r.toLowerCase()]=n.join(", "):void 0!==n&&(t[r.toLowerCase()]=n);return t},mI=e=>Object.setPrototypeOf(e,mk),mT=eZ(2,(e,t)=>nH(e[t.toLowerCase()])),mO=eZ(3,(e,t,r)=>{let n=mE(e);return n[t.toLowerCase()]=r,n}),mN=eZ(2,(e,t)=>mE({...e,...mA(t)})),mM=eZ(2,(e,t)=>{let r=mE(e);return Object.assign(r,t),r}),mU=eZ(2,(e,t)=>{let r=mE(e);return delete r[t.toLowerCase()],r}),m$=eZ(2,(e,t)=>{let r=mE(e);for(let e of t)delete r[e.toLowerCase()];return r}),mj=eZ(2,(e,t)=>{let r={...e},n=t=>{if("string"==typeof t){let n=t.toLowerCase();n in e&&(r[n]=mx(e[n]))}else for(let n in e)-1!==n.search(t)&&(r[n]=mx(e[n]))};if(Array.isArray(t))for(let e=0;e<t.length;e++)n(t[e]);else n(t);return r}),mB=(e,t)=>{let r=e.toLowerCase();for(let n=0;n<t.length;n++){let i=t[n];if("string"==typeof i){if(i.toLowerCase()===r)return!0}else if(-1!==e.search(i))return!0}return!1},mP=iJ("effect/Headers/CurrentRedactedNames",{defaultValue:()=>["authorization","cookie","set-cookie","x-api-key"]}),mR="~effect/http/Headers/HeaderParseError";class mL extends og{}class mF extends om("HeaderParseError"){static fromReason(e,t){return new mF({reason:new mL({_tag:e,input:t})})}[mR]=mR;get message(){return`${this.reason._tag}: ${JSON.stringify(this.reason.input)}`}}let mD=["jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"],mz=[/^(?:mon|tue|wed|thu|fri|sat|sun), (?<day>\d{2}) (?<month>[a-z]{3}) (?<year>\d{4}) (?<hour>\d{2}):(?<minute>\d{2}):(?<second>\d{2}) gmt$/i,/^(?:monday|tuesday|wednesday|thursday|friday|saturday|sunday), (?<day>\d{2})-(?<month>[a-z]{3})-(?<year>\d{2}) (?<hour>\d{2}):(?<minute>\d{2}):(?<second>\d{2}) gmt$/i,/^(?:mon|tue|wed|thu|fri|sat|sun) (?<month>[a-z]{3}) (?<day> \d|\d{2}) (?<hour>\d{2}):(?<minute>\d{2}):(?<second>\d{2}) (?<year>\d{4})$/i],mH=e=>{for(let t of mz){let r=t.exec(e)?.groups;if(void 0===r)continue;let n=mD.indexOf(r.month.toLowerCase()),i=Number(r.hour),s=Number(r.minute),a=Number(r.second);if(-1===n||i>23||s>59||a>60)break;let o=Number(r.year);2===r.year.length&&(o+=o<70?2e3:1900);let l=Number(r.day),u=new Date(0);if(u.setUTCFullYear(o,n,l),u.getUTCFullYear()!==o||u.getUTCMonth()!==n||u.getUTCDate()!==l)break;return u.getTime()+((60*i+s)*60+a)*1e3}},mJ=e=>dH(e).toUTCString(),mW=/^\d+$/,mq=BigInt(1e9),mK=e=>{let t=e.trim();if(mW.test(t)){let e=Number(t);return nO({_tag:"Duration",duration:Number.isSafeInteger(1e3*e)?a8(e):a3(BigInt(t)*mq)})}let r=mH(t);return void 0===r?nI(mF.fromReason("InvalidRetryAfter",e)):nO({_tag:"DateTime",dateTime:dO(r)})},mV=(e,t)=>"Duration"===e._tag?e.duration:a5(Math.max(0,dK(e.dateTime)-t));e.s(["N",0,mP,"v",0,m_,"R",0,mC,"Q",0,mJ,"s",0,e=>"Duration"===e._tag?String((a9(e.duration)+mq-BigInt(1))/mq):mJ(e.dateTime),"O",0,mA,"i",0,mI,"g",0,mT,"j",0,e=>tx(e,mS),"l",0,mB,"D",0,mM,"E",0,e=>{let t=mH(e.trim());return void 0===t?nI(mF.fromReason("InvalidHttpDate",e)):nO(dO(t))},"F",0,mK,"G",0,mU,"w",0,m$,"k",0,mV,"u",0,mO,"J",0,mN],89555);let mG=e=>"string"==typeof e?e:mb(e),mY=e=>{let t=e.indexOf("?"),r=e.indexOf("#");return -1===t?-1===r?e:e.slice(0,r):-1===r?e.slice(0,t):e.slice(0,Math.min(t,r))},mZ=new TextDecoder("utf-8",{ignoreBOM:!0}),mX=e=>new URLSearchParams(mZ.decode(e).replace(/^\?/,"%3F")),mQ=/^\/(?![/\\])/,m0=e=>{if("*"===e||mQ.test(e))return mY(e);try{return new URL(e,"http://localhost").pathname}catch{return"<invalid URL>"}};e.s(["t",0,mX,"j",0,mY,"r",0,m0,"u",0,mG],5839);let m1="~effect/http/UrlParams",m2=e=>tx(e,m1),m3={...rT,[m1]:m1,[Symbol.iterator](){return this.params[Symbol.iterator]()},[t9](e){return{_id:"UrlParams",params:Object.fromEntries(bu(this,si(e,bv)))}},toJSON(){return t7(this)},[tq](e){return m9(this,e)},[tC](){return tL(this.params.flat())}},m5=e=>{let t=Object.create(m3);return t.params=e,t},m8=e=>{if(m2(e))return e;let t=m4(e),r=[];for(let e=0;e<t.length;e++)if(Array.isArray(t[e][0])){let[n,i]=t[e];r.push([`${n[0]}[${n.slice(1).join("][")}]`,i])}else r.push(t[e]);return m5(r)},m4=e=>{let t="function"==typeof e[Symbol.iterator]?s$(e):Object.entries(e),r=[];for(let[e,n]of t)if(Array.isArray(n))for(let t=0;t<n.length;t++)void 0!==n[t]&&r.push([e,m6(n[t])]);else if(null===n||"object"!=typeof n||mv(n))void 0!==n&&r.push([e,m6(n)]);else for(let[t,i]of m4(n))r.push([[e,..."string"==typeof t?[t]:t],i]);return r},m6=e=>mv(e)?e:String(e),m9=t8((e,t)=>m7(e.params,t.params)),m7=t6((Et=[t4,tK],t8((e,t)=>{if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!Et[r](e[r],t[r]))return!1;return!0}))),be=m5([]),bt=eZ(2,(e,t)=>sS(e.params,([e])=>e===t).pipe(nG(([,e])=>mG(e)))),br=eZ(3,(e,t,r)=>m5(sR(ad(e.params,([e])=>e!==t),[t,m6(r)]))),bn=eZ(2,(e,t)=>m5(t(e.params))),bi=eZ(2,(e,t)=>{let r=m8(t).params.slice(),n=new Set;for(let e=0;e<r.length;e++)n.add(r[e][0]);for(let t=0;t<e.params.length;t++)n.has(e.params[t][0])||r.push(e.params[t]);return m5(r)}),bs=eZ(3,(e,t,r)=>m5(sR(e.params,[t,m6(r)]))),ba=eZ(2,(e,t)=>bn(e,sL(m8(t).params))),bo=e=>new URLSearchParams(m8(e).params.map(([e,t])=>[e,mG(t)])).toString(),bl=e=>{let t={};for(let[r,n]of e.params){let e=mG(n);if(Object.hasOwn(t,r)){let n=t[r];"string"==typeof n?ry(t,r,[n,e]):n.push(e)}else ry(t,r,e)}return t},bu=eZ(2,(e,t)=>{let r=Array.isArray(t)?t:[t];return e.params.map(([e,t])=>[e,"string"==typeof t&&bc(e,r)?mx(t):t])}),bc=mB,bf=(e,t=by())=>{e.includes("@")&&(e=bg(e));let r=e.indexOf("?");if(-1===r||0===t.length)return e;let n=e.indexOf("#");if(-1!==n&&n<r)return e;let i=-1===n?e.length:n;return e.slice(0,r+1)+bm(e.slice(r+1,i),t)+e.slice(i)},bd=/^(?:(https?|ftp|wss?):[/\\]*|[a-z][a-z\d+.-]*:\/\/|[/\\]{2,})/i,bh=/[/\\?#]/,bp=/[/?#]/,bg=e=>{let t="",r=[];for(let n=0;n<e.length;n++){let i=e.charCodeAt(n);9===i||10===i||13===i||""===t&&i<=32||(t+=e[n],r.push(n))}let n=bd.exec(t);if(null===n)return e;let i=n[0].length,s=void 0!==n[1]||!n[0].includes(":"),a=t.slice(i),o=a.search(s?bh:bp),l=(-1===o?a:a.slice(0,o)).lastIndexOf("@");return -1===l?e:e.slice(0,r[i])+"REDACTED:REDACTED"+e.slice(r[i+l])},bm=(e,t)=>e.split("&").map(e=>{let r=e.indexOf("=");return -1!==r&&bc(bb(e.slice(0,r)),t)?e.slice(0,r+1)+"REDACTED":e}).join("&"),bb=e=>{if(!e.includes("%")&&!e.includes("+"))return e;try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return e}},by=()=>si(globalThis[rt]?.context??i4(),bv),bv=iJ("effect/http/UrlParams/CurrentRedactedNames",{defaultValue:()=>["X-Amz-Signature","X-Amz-Credential","X-Amz-Security-Token","AWSAccessKeyId","Signature","sig","X-Goog-Signature"]});function bx(e){return e.checks?e.checks[e.checks.length-1].annotations:e.annotations}e.s(["N",0,bv,"v",0,m9,"z",0,bs,"I",0,ba,"R",0,be,"O",0,m8,"J",0,bt,"C",0,m2,"h",0,m5,"H",0,bf,"u",0,br,"K",0,bi,"l",0,bl,"e",0,bo],86501);let bw="~structural",bS="~sentinels",bk="~constructor",bE=e6(e=>{let t=bx(e)?.identifier;return"string"==typeof t?t:e.getExpected(bE)}),b_=Symbol(),bC=r1(b_),bA=r1(b_),bI=e=>e===b_?nb:nv(e),bT=e=>"None"===e._tag?bC:r1(e.value),bO="~effect/SchemaIssue/Issue";function bN(e){return tx(e,bO)&&e[bO]===bO}class bM{[bO]=bO;constructor(e,t){t?.reportInput===!0&&e!==b_&&(this.input=e)}}let bU=class extends bM{_tag="Filter";filter;issue;constructor(e,t,r,n){super(r,n),this.filter=e,this.issue=t}},b$=class extends bM{_tag="Encoding";ast;issue;constructor(e,t,r,n){super(r,n),this.ast=e,this.issue=t}},bj=class extends bM{_tag="Pointer";path;issue;constructor(e,t){super(),this.path=e,this.issue=t}},bB=class extends bM{_tag="MissingKey";annotations;constructor(e){super(),this.annotations=e}},bP=class extends bM{_tag="UnexpectedKey";ast;constructor(e,t,r){super(t,r),this.ast=e}},bR=class extends bM{_tag="Composite";ast;issues;constructor(e,t,r,n){super(r,n),this.ast=e,this.issues=t}},bL=class extends bM{_tag="InvalidType";ast;constructor(e,t,r){super(t,r),this.ast=e}},bF=class extends bM{_tag="InvalidValue";annotations;constructor(e,t,r){super(t,r),this.annotations=e}};function bD(e,t,r,n,i){return new bR(e,[new bj([t],r)],n,i)}let bz=class extends bM{_tag="Forbidden";annotations;constructor(e,t,r){super(t,r),this.annotations=e}},bH=class extends bM{_tag="AnyOf";ast;issues;constructor(e,t,r,n){super(r,n),this.ast=e,this.issues=t}},bJ=class extends bM{_tag="OneOf";ast;successes;constructor(e,t,r,n){super(r,n),this.ast=e,this.successes=t}};function bW(e,t,r){if(bN(e))return e;if("string"==typeof e)return new bF({message:e},t,r);let n="string"==typeof e.issue?new bF({message:e.issue},t,r):e.issue;return new bj(e.path,n)}function bq(e,t,r){if(void 0!==e)return"boolean"==typeof e?e?void 0:new bF(void 0,t,r):bW(e,t,r)}function bK(e,t,r,n){if(Array.isArray(t)){if(!sD(t))return;return 1===t.length?bW(t[0],r,n):new bR(e,al(t,e=>bW(e,r,n)),r,n)}return bq(t,r,n)}let bV=e=>bQ(e)??bQ(e.issue);function bG(e){return Object.hasOwn(e,"input")?ri(e.input):void 0}function bY(e){let t=e.annotations?.expected;return"string"==typeof t?t:void 0}function bZ(e,t){let r=bG(t);return void 0===r?`Expected ${e}`:`Expected ${e}, got ${r}`}let bX=e=>(function e(t,r,n){let i;switch(t._tag){case"Filter":return e(t.issue,r,n??function(e,t){let r=t(e);if(void 0!==r||"InvalidValue"!==e.issue._tag)return r;let n=bY(e.issue);return void 0===n?bZ(function e(t){let r=t.annotations?.expected;if("string"==typeof r)return r;switch(t._tag){case"Filter":return"<filter>";case"FilterGroup":return t.checks.map(t=>e(t)).join(" & ")}}(e.filter),e):bZ(n,e.issue)}(t,bV));case"Encoding":return e(t.issue,r,n);case"Pointer":return e(t.issue,r+t.path.map(e=>`[${ra(e)}]`).join(""),n);case"Composite":case"AnyOf":if("Composite"===t._tag||t.issues.length>0)return t.issues.map(t=>e(t,r,n)).join("\n");i=n??bQ(t)??bZ(bE(t.ast),t);break;default:i=n??(e=>{let t=bQ(e);if(void 0!==t)return t;switch(e._tag){case"InvalidType":return bZ(bE(e.ast),e);case"InvalidValue":{let t=bY(e);if(void 0!==t)return bZ(t,e);let r=bG(e);return void 0===r?"Expected a valid value":`Invalid data ${r}`}case"MissingKey":return"Missing key";case"UnexpectedKey":{let t=bG(e);return void 0===t?"Expected no excess property":`Unexpected key with value ${t}`}case"Forbidden":return"Forbidden operation";case"OneOf":{let t=bG(e);return void 0===t?"Expected exactly one member to match":`Expected exactly one member to match the input ${t}`}}})(t)}return r?`${i}
|
|
12
|
+
at ${r}`:i})(e,"");function bQ(e){if("Pointer"===e._tag||"Composite"===e._tag)return;if("Encoding"===e._tag)return bQ(e.issue);let t="Filter"===e._tag?e.filter.annotations:"annotations"in e?e.annotations:e.ast.annotations,r=t?.["MissingKey"===e._tag?"messageMissingKey":"UnexpectedKey"===e._tag?"messageUnexpectedKey":"message"];if("string"==typeof r)return r}function b0(e){let t;for(let r of e.reasons){if(!rV(r)||!bN(r.error))return;t??=r.error}return t}function b1(e,t){let r=b0(e);if(void 0===r)throw Error(t,{cause:e});return r}e.s(["t",0,bH,"F",0,bR,"E",0,b$,"V",0,bU,"v",0,bz,"h",0,bL,"X",0,bF,"x",0,bB,"f",0,bJ,"d",0,bj,"y",0,bP,"K",0,bX,"k",0,bN,"W",0,bD,"z",0,bq,"M",0,bK],40264);let b2=(e,t,r)=>{switch(e._tag){case"Passthrough":return lI(t);case"Transform":return lI(nG(t,e.transform));case"TransformOptional":return lI(e.transform(t));case"TransformEffect":return ng(t)?l$:us(e.transform(t.value,r),nv);case"TransformOptionalEffect":return e.transform(t,r)}},b3=e=>Object.assign(Object.create(eG),e),b5=(e,t)=>yt((r,n)=>un(b2(e,r,n),e=>b2(t,e,n)));function b8(e){var t;return t=(t,r)=>{let n={message:e(t)};return nm(t)?new bz(n,t.value,r):new bz(n)},yt((e,r)=>r8(t(e,r)))}(e,t)=>{if("Passthrough"===e._tag)return t;if("Passthrough"===t._tag)return e;switch(e._tag){case"Transform":switch(t._tag){case"Transform":return b9(r=>t.transform(e.transform(r)));case"TransformOptional":return ye(r=>t.transform(nG(r,e.transform)));case"TransformEffect":return b7((r,n)=>t.transform(e.transform(r),n));case"TransformOptionalEffect":return b5(e,t)}case"TransformOptional":switch(t._tag){case"Transform":return ye(r=>nG(e.transform(r),t.transform));case"TransformOptional":return ye(r=>t.transform(e.transform(r)));case"TransformEffect":case"TransformOptionalEffect":return b5(e,t)}case"TransformEffect":switch(t._tag){case"Transform":return b7((r,n)=>us(e.transform(r,n),t.transform));case"TransformOptional":case"TransformOptionalEffect":return b5(e,t);case"TransformEffect":return b7((r,n)=>un(e.transform(r,n),e=>t.transform(e,n)))}case"TransformOptionalEffect":return b5(e,t)}};let b4=b8(()=>"Encoding is not supported"),b6=b3({_tag:"Passthrough"});function b9(e){return b3({_tag:"Transform",transform:e})}function b7(e){return b3({_tag:"TransformEffect",transform:e})}function ye(e){return b3({_tag:"TransformOptional",transform:e})}function yt(e){return b3({_tag:"TransformOptionalEffect",transform:e})}function yr(){return b9(globalThis.String)}function yn(){return b9(globalThis.Number)}function yi(){return b9(e=>new globalThis.Date(e))}let ys=yl(e=>"string"==typeof e||"u">typeof Blob&&e instanceof Blob),ya=yl(ta);function yo(e){let t={},r=new WeakSet,n=new WeakSet,i=new Map;for(let[s,{key:a,length:o,parent:l}]of(e.forEach(([e,s])=>{let a=function(e){if(""===e)return[""];let t=e.replace(/\[([^\]\r\n\u2028\u2029]*)(\])?/g,(e,t,r)=>r?`.${t}`:e),r=t.split("."),n=+!!t.startsWith(".");return r.slice(n).map(e=>sz(e)?globalThis.Number(e):e)}(e),o=t;for(let e=0;e<a.length;e++){let t=i.get(o),l=""===a[e]&&void 0!==t?t.length:a[e];void 0!==t&&"number"==typeof l&&(t.length=Math.max(t.length,l+1));let u=Object.hasOwn(o,l),c=u?o[l]:void 0;if(e===a.length-1){let e=i.get(c);if(void 0!==e)ry(c,e.length++,s);else if(n.has(c))c.push(s);else if(u){let e=[c,s];n.add(e),ry(o,l,e)}else ry(o,l,s)}else{let t=a[e+1],n="number"==typeof t||""===t;if(r.has(c)&&i.has(c)===n)o=c;else{let e={};r.add(e),n&&i.set(e,{parent:o,key:l,length:0}),ry(o,l,e),o=e}}}}),Array.from(i).reverse()))l[a]===s&&o-Object.keys(s).length<=20&&ry(l,a,Object.assign(Array(o),s));return t}function yl(e){return t=>{let r=[];for(let[n,i]of Object.entries(t))!function t(n,i){if(e(i))r.push([n,i]);else if(Array.isArray(i))i.every(e)?i.forEach(e=>{r.push([n,e])}):i.forEach((e,r)=>{t(`${n}[${r}]`,e)});else if("object"==typeof i&&null!==i)for(let[e,r]of Object.entries(i))t(`${n}[${e}]`,r)}(n,i);return r}}let yu=Symbol.for("~effect/Schema/content"),yc=class extends eY{_tag="Middleware";decode;encode;constructor(e,t){super(),this.decode=e,this.encode=t}flip(){return new yc(this.encode,this.decode)}},yf="~effect/SchemaTransformation/Transformation",yd=class extends eY{[yf]=yf;_tag="Transformation";decode;encode;constructor(e,t){super(),this.decode=e,this.encode=t}flip(){return new yd(this.encode,this.decode)}},yh=e=>tx(e,yf)&&e[yf]===yf?e:new yd(e.decode,e.encode);function yp(e){return new yd(b7(e.decode),b7(e.encode))}function yg(e){return new yd(b9(e.decode),b9(e.encode))}function ym(e){return new yd(ye(e.decode),ye(e.encode))}let yb=new yd(b6,b6);function yy(){return yb}let yv=new yd(yn(),yr()),yx=new yd(b7((e,t)=>{try{return lI(globalThis.BigInt(e))}catch{return r8(new bF({expected:"a value that can be converted to a bigint"},e,t))}}),yr()),yw=new yd(yi(),b9(ro)),yS=new yd(yi(),b9(e=>e.getTime())),yk=yp({decode:(e,t)=>nF(iP(e),{onNone:()=>r8(new bF({expected:"a valid ByteSize string"},e,t)),onSome:lI}),encode:e=>lI(`${e} ${e===BigInt(1)?"byte":"bytes"}`)}),yE=yp({decode:(e,t)=>nF(iL(e),{onNone:()=>r8(new bF({expected:"a non-negative bigint byte count"},e,t)),onSome:lI}),encode:e=>lI(iD(e))}),y_=yp({decode:(e,t)=>nF(iL(e),{onNone:()=>r8(new bF({expected:"a non-negative safe-integer byte count"},e,t)),onSome:lI}),encode:(e,t)=>nF(iz(e),{onNone:()=>r8(new bF({expected:"a ByteSize representable as a safe integer"},e,t)),onSome:lI})}),yC=e=>{let t=Object.hasOwn(e,"cause")?Error(e.message,{cause:yI(e.cause)}):Error(e.message);return"string"==typeof e.name&&"Error"!==e.name&&(t.name=e.name),"string"==typeof e.stack&&(t.stack=e.stack),t},yA=e=>{let t=new WeakSet,r=n=>{if(tS(n)){let i;if(t.has(n))return"[Circular]";t.add(n);let s=(i={name:n.name,message:"string"==typeof n.message?n.message:""},e?.includeStack&&"string"==typeof n.stack&&(i.stack=n.stack),e?.excludeCause||void 0===n.cause||(i.cause=r(n.cause)),i);return t.delete(n),s}try{let e=ru(n);return void 0===e?ri(n):JSON.parse(e)}catch{return ri(n)}};return r},yI=e=>ty(e)&&"string"==typeof e.message?yC(e):e,yT=e=>yg({decode:yI,encode:yA(e)}),yO=yp({decode:(e,t)=>URL.canParse(e)?lI(new URL(e)):r8(new bF({expected:"a valid URL string"},e,t)),encode:e=>lI(e.href)}),yN=new yd(b7((e,t)=>ua(lM(g_(e)),()=>new bF({expected:"a valid Base64 string"},e,t))),b9(gE)),yM=new yd(b7((e,t)=>sb(sm(g_(e),e=>gO.decode(e)),{onFailure:()=>r8(new bF({expected:"a valid Base64 string"},e,t)),onSuccess:lI})),b9(gE)),yU=new yd(b7((e,t)=>sb(sm((e=>{let t=e.replace(/[\n\r]/g,""),r=t.length,n=t.endsWith("=");if(n?r%4!=0:r%4==1)return nI(new oy({module:"Base64Url",kind:"Decode",input:t,message:n?`Padded length should be a multiple of 4, but is ${r}`:`Unpadded length should not be 1 more than a multiple of 4, but is ${r}`}));if(!/^[-_A-Z0-9]*?={0,2}$/i.test(t))return nI(new oy({module:"Base64Url",kind:"Decode",input:t,message:"Invalid input"}));let i=n?61===t.charCodeAt(r-2)?r-2:r-1:r,s=-4&i,a=new Uint8Array(Math.floor(3*i/4)),o=0;for(let e=0;e<s;e+=4){let r=gR[t.charCodeAt(e)],n=gR[t.charCodeAt(e+1)],i=gR[t.charCodeAt(e+2)],s=gR[t.charCodeAt(e+3)];a[o++]=r<<2|n>>4,a[o++]=n<<4|i>>2,a[o++]=i<<6|s}if(i>s){let e=gR[t.charCodeAt(s)],r=gR[t.charCodeAt(s+1)];a[o++]=e<<2|r>>4,i-s==3&&(a[o]=r<<4|gR[t.charCodeAt(s+2)]>>2)}return nO(a)})(e),e=>gL.decode(e)),{onFailure:()=>r8(new bF({expected:"a valid Base64Url string"},e,t)),onSuccess:lI})),b9(e=>gE(e).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"))),y$=new yd(b7((e,t)=>sb(sm(oC(e),e=>oI.decode(e)),{onFailure:()=>r8(new bF({expected:"a valid hexadecimal string"},e,t)),onSuccess:lI})),b9(ov)),yj=new yd(b7((e,t)=>{try{return lI(globalThis.decodeURIComponent(e))}catch{return r8(new bF({expected:"a valid URI component"},e,t))}}),b9(encodeURIComponent));function yB(e){var t,r;return new yd((t=e??{},b7((e,r)=>lR({try:()=>JSON.parse(e,t?.reviver),catch:()=>new bF({expected:"a valid JSON string"},e,r)}))),(Object.defineProperty(r=b7((t,r)=>lR({try:()=>{let r=JSON.stringify(t,e?.replacer,e?.space);if(void 0===r)throw TypeError("Value cannot be represented as JSON");return r},catch:()=>new bF({expected:"a JSON-serializable value"},t,r)})),yu,{value:{mediaType:"application/json",preserveSchema:e?.reviver===void 0&&e?.replacer===void 0}}),r))}let yP=new yd(b9(e=>yo(Array.from(e.entries()))),b9(e=>{let t=new FormData;return"object"==typeof e&&null!==e&&ys(e).forEach(([e,r])=>{t.append(e,r)}),t})),yR=new yd(b9(e=>yo(Array.from(e.entries()))),b9(e=>"object"==typeof e&&null!==e?new URLSearchParams(ya(e)):new URLSearchParams));function yL(e){return t=>t._tag===e}e.s(["$",0,yc,"W",0,yd,"R",0,yx,"A",0,yE,"c",0,y_,"G",0,yk,"z",0,yS,"_",0,yw,"x",0,yT,"g",0,e=>yg({decode:yC,encode:t=>yA(e)(t)}),"H",0,yP,"b",0,yB,"C",0,yR,"k",0,yh,"P",0,yv,"h",0,function(){return yg({decode:nJ,encode:nW})},"Z",0,function(e){return yg({decode:nz,encode:e?.onNoneEncoding===null?nW:nq})},"u",0,function(){return ym({decode:e=>e.pipe(nX(tp),nv),encode:nZ})},"i",0,function(){return ym({decode:nv,encode:nZ})},"L",0,function(){return yg({decode:nH,encode:nq})},"f",0,yy,"p",0,yM,"U",0,yU,"X",0,y$,"j",0,yj,"O",0,yg,"l",0,yp,"y",0,ym,"N",0,function(){return new yd(b9(d8),b6)},"q",0,yN,"F",0,yO],94249);let yF=yL("Declaration"),yD=yL("Null"),yz=yL("Void"),yH=yL("Never"),yJ=yL("Literal"),yW=yL("UniqueSymbol"),yq=yL("Arrays"),yK=yL("Objects"),yV=yL("Union"),yG=yL("Suspend"),yY=class{to;transformation;constructor(e,t){this.to=e,this.transformation=t}},yZ={},yX=class{isOptional;isMutable;constructorDefault;annotations;constructor(e,t,r,n){this.isOptional=e,this.isMutable=t,this.constructorDefault=r,this.annotations=n}},yQ="~effect/Schema";class y0{[yQ]=yQ;annotations;checks;encoding;context;constructor(e,t,r,n){this.annotations=e,this.checks=t,this.encoding=r,this.context=n}toString(){return`<${this._tag}>`}}let y1=class extends y0{_tag="Declaration";typeParameters;run;encodingChecks;encodingRun;constructor(e,t,r,n,i,s,a,o){super(r,n,i,s),this.typeParameters=e,this.run=t,this.encodingChecks=a,this.encodingRun=o}getParser(){let e;return(t,r)=>{if(t===b_)return bC;e??=this.run(this.typeParameters);try{return e(t,this,r)}catch(e){return lj(e)}}}_rebuild(e,t,r,n,i){let s=xa(this.typeParameters,e);return s===this.typeParameters&&t===this.checks&&r===this.encodingChecks&&n===this.run&&i===this.encodingRun?this:new y1(s,n,this.annotations,t,void 0,this.context,r,i)}recur(e){return this._rebuild(e,this.checks,this.encodingChecks,this.run,this.encodingRun)}flip(e){return this._rebuild(e,this.encodingChecks,this.checks,this.encodingRun??this.run,this.run)}getExpected(){let e=this.annotations?.expected;return"string"==typeof e?e:"<Declaration>"}},y2=new class extends y0{_tag="Null";getParser(){return xx(this,null)}getExpected(){return"null"}},y3=class extends y0{_tag="Undefined";getParser(){return xx(this,void 0)}toCodecJson(){return v3(this,[y5])}getExpected(){return"undefined"}},y5=new yY(y2,new yd(b9(()=>void 0),b9(()=>null))),y8=new y3,y4=new class extends y0{_tag="Void";getParser(){let e=r1(void 0);return t=>t===b_?bC:e}toCodecJson(){return v3(this,[y5])}getExpected(){return"void"}},y6=class extends y0{_tag="Never";getParser(){return xw(this,tm)}getExpected(){return"never"}},y9=new y6,y7=new class extends y0{_tag="Any";getParser(){return xw(this,tb)}getExpected(){return"any"}},ve=new class extends y0{_tag="Unknown";getParser(){return xw(this,tb)}getExpected(){return"unknown"}},vt=new class extends y0{_tag="ObjectKeyword";getParser(){return xw(this,tv)}getExpected(){return"object | array | function"}},vr=class extends y0{_tag="Enum";enums;constructor(e,t,r,n,i){for(let[,s]of(super(t,r,n,i),e))if("number"==typeof s&&!globalThis.Number.isFinite(s))throw Error(`A numeric enum value must be finite, got ${ri(s)}`);this.enums=e}getParser(){let e=new Set(this.enums.map(([,e])=>e));return xw(this,t=>e.has(t))}toCodecStringTree(){if(this.enums.some(([e,t])=>"number"==typeof t)){let e=Object.fromEntries(this.enums.map(([e,t])=>[globalThis.String(t),t]));return v3(this,[new yY(new vF(Object.keys(e).map(e=>new vo(e))),new yd(b9(t=>e[t]),yr()))])}return this}getExpected(){return this.enums.map(([e,t])=>JSON.stringify(t)).join(" | ")}};function vn(e){return"number"==typeof e?`parts[${e}]`:e}let vi=class extends y0{_tag="TemplateLiteral";parts;encodedParts;literals;suffixLengths;constructor(e,t,r,n,i){super(t,r,n,i);let s=[],a=[],o=new Set;for(let t=0;t<e.length;t++){let r=e[t];if(!function e(t,r,n){let i;if(n.has(t))return!0;if(t.encoding)throw Error(`TemplateLiteral parts cannot have an encoding at ${vn(r)}`);switch(t._tag){case"String":case"Number":case"BigInt":i=!0;break;case"Literal":i=!t.checks;break;case"TemplateLiteral":{let s=vn(r);i=!t.checks&&t.parts.every((t,r)=>e(t,`${s}.parts[${r}]`,n));break}case"Union":{let s=vn(r);i=!t.checks&&t.types.every((t,r)=>e(t,`${s}.types[${r}]`,n));break}default:return!1}return i&&n.add(t),i}(r,t,o))throw Error(`Invalid TemplateLiteral part ${r._tag}`);s.push(r),a.push("Literal"===r._tag?globalThis.String(r.literal):void 0)}let l=Array(s.length+1);l[s.length]=0;for(let e=s.length-1;e>=0;e--)l[e]=l[e+1]+(a[e]?.length??0);this.parts=e,this.encodedParts=s,this.literals=a,this.suffixLengths=l}getParser(e){let t=e(xp(vu,new vg(!1,this.parts.map(x_),[]),vs(this)));return(e,r)=>{if(e===b_)return bC;let n=t(e,r);return"Success"===n._tag?bA:uo(n,{onSuccess:()=>e,onFailure:t=>new bR(this,[t],e,r)})}}getExpected(){return"string"}matchPart(e,t){return void 0===xS(this,e,t)?void 0:e}};function vs(e){return new yd(b7((t,r)=>{let n=xS(e,t,r);return n?lI(n):r8(new bF({expected:"a string matching template literal parts"},t,r))}),b9(e=>e.join("")))}let va=class extends y0{_tag="UniqueSymbol";symbol;constructor(e,t,r,n,i){super(t,r,n,i),this.symbol=e}getParser(){return xx(this,this.symbol)}toCodecStringTree(){return v3(this,[new yY(void 0===globalThis.Symbol.keyFor(this.symbol)?y9:new vo(globalThis.String(this.symbol)),xP.transformation)])}getExpected(){return globalThis.String(this.symbol)}},vo=class extends y0{_tag="Literal";literal;constructor(e,t,r,n,i){if(super(t,r,n,i),"number"==typeof e&&!globalThis.Number.isFinite(e))throw Error(`A numeric literal must be finite, got ${ri(e)}`);this.literal=e}getParser(){return xx(this,this.literal)}matchPart(e,t){return e===globalThis.String(this.literal)?this.literal:void 0}toCodecJson(){return"bigint"==typeof this.literal?vl(this):this}toCodecStringTree(){return"string"==typeof this.literal?this:vl(this)}getExpected(){return"string"==typeof this.literal?JSON.stringify(this.literal):globalThis.String(this.literal)}};function vl(e){let t=globalThis.String(e.literal);return v3(e,[new yY(new vo(t),new yd(b9(()=>e.literal),b9(()=>t)))])}let vu=new class extends y0{_tag="String";getParser(){return xw(this,ta)}matchPart(e,t){let r=this.checks;return r&&!t.disableChecks&&xL(r,e,void 0,this,t)?void 0:e}getExpected(){return"string"}};function vc(e,t){return e.some(e=>e.annotations?.representation?.id===t||"FilterGroup"===e._tag&&vc(e.checks,t))}let vf=new class extends y0{_tag="Number";getParser(){return xw(this,to)}matchKey(e,t){return this._match(xA,e,t)}matchPart(e,t){return this._match(xC,e,t)}_match(e,t,r){if(!e.test(t))return;let n=globalThis.Number(t);return r.disableChecks||!this.checks?n:xL(this.checks,n,void 0,this,r)?void 0:n}toCodecJson(){return this.checks&&(vc(this.checks,"effect/schema/isFinite")||vc(this.checks,"effect/schema/isInt"))?this:v3(this,[vX])}toCodecStringTree(){return this.toCodecJson()===this?v3(this,[xO]):v3(this,[xN])}getExpected(){return"number"}},vd=new class extends y0{_tag="Boolean";getParser(){return xw(this,tl)}getExpected(){return"boolean"}},vh=new class extends y0{_tag="Symbol";getParser(){return xw(this,tc)}matchKey(e,t){return t.disableChecks||!this.checks?e:xL(this.checks,e,void 0,this,t)?void 0:e}toCodecStringTree(){return v3(this,[xP])}getExpected(){return"symbol"}},vp=new class extends y0{_tag="BigInt";getParser(){return xw(this,tu)}matchPart(e,t){if(!xM.test(e))return;let r=globalThis.BigInt(e);return t.disableChecks||!this.checks?r:xL(this.checks,r,void 0,this,t)?void 0:r}toCodecStringTree(){return v3(this,[xj])}getExpected(){return"bigint"}},vg=class extends y0{_tag="Arrays";isMutable;elements;rest;encodingChecks;constructor(e,t,r,n,i,s,a,o){super(n,i,s,a),this.isMutable=e,this.elements=t,this.rest=r,this.encodingChecks=o;let l=!1;for(let e=0;e<t.length;e++)if(xm(t[e]))l=!0;else if(l)throw Error("A required element cannot follow an optional element. ts(1257)");if(l&&r.length>1)throw Error("A required element cannot follow an optional element. ts(1257)");for(let e=1;e<r.length;e++)if(xm(r[e]))throw Error("An optional element cannot follow a rest element. ts(1266)")}getParser(e,t=e){let r,n,i=this,s=i.elements.length,a=Math.max(0,i.rest.length-1);function o(e,t){return t<s?r[t]:t>=e?n[t-e+1]:n[0]}let l=e=>{let{input:t,len:r,options:n}=e;if(0===i.rest.length&&r>s)for(let a=s;a<r;a++){let r=new bP(i,t[a],n),s=new bj([a],r);if("all"!==n.errors)return r8(new bR(i,[s],t,n));e.issues?e.issues.push(s):e.issues=[s]}return e.issues?r8(new bR(i,e.issues,t,n)):r1(e.output)},u=(e,t)=>{let r=e.length,n={ast:i,getParser:o,input:e,len:r,tailThreshold:Math.max(s,r-a),output:[],issues:void 0,options:t},c=0===i.rest.length?s:Math.max(r,s+a),f=void 0===t.concurrency?1:cz(t.concurrency),d=1===f?vb(n,e,0,c):vy(n,e,{concurrency:f,end:c});if(!d)return l(n);if(ur(d))return un(d,()=>l(n));let h=!0;return lN(()=>h?(h=!1,ue(d,()=>l(n))):u(e,t))};return(e,s)=>{if(e===b_)return bC;try{if(!Array.isArray(e))return r8(new bL(i,e,s));return r||(r=i.elements.map(e=>({ast:e,parser:t(e)})),n=i.rest.map(e=>({ast:e,parser:t(e)}))),u(e,s)}catch(e){return lj(e)}}}_rebuild(e,t,r){let n=xa(this.elements,e),i=xa(this.rest,e);return n===this.elements&&i===this.rest&&t===this.checks&&r===this.encodingChecks?this:new vg(this.isMutable,n,i,this.annotations,t,void 0,this.context,r)}recur(e){return this._rebuild(e,this.checks,this.encodingChecks)}flip(e){return this._rebuild(e,this.encodingChecks,this.checks)}getExpected(){return"array"}},vm={onItem(e,t,r){let n=r<e.len?t:b_;return e.getParser(e.tailThreshold,r).parser(n,e.options)},step:function(e,t,r,n){if("Failure"===r._tag)return vv(e,e.ast,n,r);let i=r===bA?t:r[rk];if(i!==b_)e.output[n]=i;else{let t=e.getParser(e.tailThreshold,n);if(xm(t.ast))return;let r=new bj([n],new bB(t.ast.context?.annotations));if("all"!==e.options.errors)return r8(new bR(e.ast,[r],e.input,e.options));e.issues?e.issues.push(r):e.issues=[r]}}},vb=(cH())(vm),vy=(cW())(vm),vv=(e,t,r,n)=>{if(0===n.cause.reasons.length)return n;let i=b0(n.cause);if(void 0===i)return r5(o7(n.cause,n=>new bR(t,[new bj([r],n)],e.input,e.options)));let s=new bj([r],i);if("all"!==e.options.errors)return r8(new bR(t,[s],e.input,e.options));e.issues?e.issues.push(s):e.issues=[s]},vx="[+-]?(?:\\d+(?:\\.\\d+)?|\\.\\d+)(?:[Ee][+-]?\\d+)?";function vw(e,t,r=yZ){let n,i;return function t(s){switch(s._tag){case"String":case"TemplateLiteral":return(n??=Object.keys(e)).filter(e=>void 0!==s.matchPart(e,r));case"Number":return(n??=Object.keys(e)).filter(e=>void 0!==s.matchKey(e,r));case"Symbol":return(i??=Object.getOwnPropertySymbols(e)).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t)&&void 0!==s.matchKey(t,r));case"Union":return[...new Set(s.types.flatMap(t))];default:return[]}}(xk(xy(t)))}let vS=class{name;type;constructor(e,t){this.name=e,this.type=t}},vk=class{parameter;type;constructor(e,t){if(!(function e(t){switch(t._tag){case"String":case"Number":case"Symbol":case"TemplateLiteral":return!0;case"Union":return t.types.every(e);default:return!1}}(e)&&function e(t){let r=v8(t);switch(r._tag){case"String":case"Number":case"Symbol":case"TemplateLiteral":return!0;case"Union":return r.types.every(e);default:return!1}}(e)))throw Error(`Invalid index signature parameter ${e._tag}`);if(this.parameter=e,this.type=t,xm(t)||void 0!==t.encoding&&xm(xy(t)))throw Error("Cannot use `Schema.optionalKey` or `Schema.optional` with index signatures. Index signatures already allow keys to be absent; use `Schema.UndefinedOr` to allow `undefined` values.")}},vE=class extends y0{_tag="Objects";propertySignatures;indexSignatures;encodingChecks;constructor(e,t,r,n,i,s,a){super(r,n,i,s),this.propertySignatures=e,this.indexSignatures=t,this.encodingChecks=a}getParser(e,t=e){let r,n,i,s=this,a=s.propertySignatures.length,o=s.indexSignatures.length;if(!a&&!o)return xw(s,tg);let l=()=>(r||(r=s.propertySignatures.map(e=>({parser:t(e.type),name:e.name,type:e.type})),n=o?s.indexSignatures.map(r=>({is:r,parserKey:e(xk(r.parameter)),parserValue:t(r.type)})):void 0),r),u=()=>{let e=new Set(s.propertySignatures.map(e=>"number"==typeof e.name?globalThis.String(e.name):e.name)),t=(t,r,n,i,o)=>{if("Failure"===o._tag)return vv(t,s,r,o)??ud;let l=o===bA?i:o[rk];if(n!==b_&&l!==b_){if(a&&(e.has(r)||e.has("number"==typeof n?globalThis.String(n):n)))return ud;ry(t.out,n,l)}return ud},i=(e,r,n,a)=>{if(!a){let t=n.parserKey(r,e.options);if(!ur(t))return ue(u9(t),t=>i(e,r,n,t));a=t}if("Failure"===a._tag)return vv(e,s,r,a)??ud;let o=a===bA?r:a[rk],l=e.input[r],u=n.parserValue(l,e.options);return ur(u)?t(e,r,o,l,u):ue(u9(u),n=>t(e,r,o,l,n))},u=(e,r,n)=>{let i=e.input[r],s=n.parserValue(i,e.options);return ur(s)?t(e,r,r,i,s):ue(u9(s),n=>t(e,r,r,i,n))},c=o?cW()({onItem:(e,[t,r])=>r.is.parameter===vu?u(e,t,r):i(e,t,r),step:(e,t,r)=>"Failure"===r._tag?r:void 0}):void 0;return pl(function*(t,f){if(t===b_)return b_;if(!("object"==typeof t&&null!==t&&!Array.isArray(t)))return yield*r8(new bL(s,t,f));l();let d={},h={ast:s,input:t,out:d,issues:void 0,options:f},p="all"===f.errors,g="error"===f.onExcessProperty,m=void 0===f.concurrency?1:cz(f.concurrency),b=o&&g?s.indexSignatures.map(e=>vw(t,e.parameter,f)):void 0;if(g){let r=b?new Set(e):e;if(b)for(let e of b)for(let t of e)r.add(t);let n=Reflect.ownKeys(t);for(let e=0;e<n.length;e++){let i=n[e];if(!r.has(i)&&Object.prototype.propertyIsEnumerable.call(t,i)){let e=new bP(s,t[i],f),r=new bj([i],e);if(!p)return yield*r8(new bR(s,[r],t,f));h.issues?h.issues.push(r):h.issues=[r];continue}}}if(a){let e=1===m?vA(h,r):vI(h,r,{concurrency:m});e&&(yield*e)}if(o&&1===m)for(let e=0;e<o;e++){let r=n[e],s=r.is.parameter===vu?u:i,a=b?.[e]??(r.is.parameter===vu?Object.keys(t):vw(t,r.is.parameter,f));for(let e=0;e<a.length;e++){let t=s(h,a[e],r);if(ur(t)){if("Failure"===t._tag)return yield*t}else yield*t}}else if(c){let e=aa();for(let r=0;r<o;r++){let i=n[r],s=b?.[r]??(i.is.parameter===vu?Object.keys(t):vw(t,i.is.parameter,f));for(let t=0;t<s.length;t++)e.push([s[t],i])}let r=c(h,e,{concurrency:m});r&&(yield*r)}return h.issues?yield*r8(new bR(s,h.issues,t,f)):d})};if(o)return u();let c=(e,t,n)=>{let i=r[t];return ue(u9(n),n=>{let s={...e,out:{...e.out}},a=v_(s,i,n);if(a)return a;let o=()=>r1(s.out),l=vA(s,r.slice(t+1));return l?un(l,o):o()})};return(e,t)=>{if(e===b_)return bC;if("all"===t.errors||void 0!==t.onExcessProperty||void 0!==t.concurrency&&1!==cz(t.concurrency))return(i??=u())(e,t);if(!("object"==typeof e&&null!==e&&!Array.isArray(e)))return r8(new bL(s,e,t));let r=l(),n={},a={ast:s,input:e,out:n,issues:void 0,options:t};try{for(let i=0;i<r.length;i++){let s=r[i],o=s.name,l=vL(e,o),u=l?e[o]:b_,f=s.parser(u,t);if(!ur(f))return c(a,i,f);if(f===bA){l&&ry(n,o,u);continue}let d=v_(a,s,f);if(d)return d}}catch(e){return lj(e)}return r1(n)}}_rebuild(e,t,r,n){let i=xa(this.propertySignatures,t=>{let r=e(t.type);return r===t.type?t:new vS(t.name,r)}),s=xa(this.indexSignatures,r=>{let n=t(r.parameter),i=e(r.type);return n===r.parameter&&i===r.type?r:new vk(n,i)});return i===this.propertySignatures&&s===this.indexSignatures&&r===this.checks&&n===this.encodingChecks?this:new vE(i,s,this.annotations,r,void 0,this.context,n)}flip(e){return this._rebuild(e,e,this.encodingChecks,this.checks)}recur(e,t=e){return this._rebuild(e,t,this.checks,this.encodingChecks)}getExpected(){return 0===this.propertySignatures.length&&0===this.indexSignatures.length?"object | array":"object"}};function v_(e,t,r){if("Failure"===r._tag)return vv(e,e.ast,t.name,r);if(r===bA)return;let n=r[rk];if(n!==b_)return void ry(e.out,t.name,n);if(delete e.out[t.name],!xm(t.type)){let r=new bj([t.name],new bB(t.type.context?.annotations));return"all"!==e.options.errors?r8(new bR(e.ast,[r],e.input,e.options)):void(e.issues?e.issues.push(r):e.issues=[r])}}let vC={onItem(e,t){if(!vL(e.input,t.name))return t.parser(b_,e.options);let r=e.input[t.name];return ry(e.out,t.name,r),t.parser(r,e.options)},step:v_},vA=(cH())(vC),vI=(cW())(vC);function vT(e,t){return e?t?[...e,...t]:e:t}function vO(e,t,r){return new vE(Reflect.ownKeys(e).map(t=>new vS(t,e[t].ast)),[],r,t)}function vN(e){return e.ast}function vM(e,t){return new vg(!1,e.map(e=>e.ast),[],void 0,t)}function vU(e,t,r){return new vF(e.map(vN),t,void 0,r)}let v$=e9(e=>{for(;;){if(yG(e))return ve;let t=e.encoding;if(!t)return e.recur?.(v$,eX)??e;if(t.some(e=>"Middleware"===e.transformation._tag&&e.transformation.decode!==eX))return ve;e=t[t.length-1].to}});function vj(e){switch(e._tag){default:return[];case"Declaration":{let t=e.annotations?.[bS];return Array.isArray(t)?t:[]}case"Objects":return e.propertySignatures.flatMap(e=>{let t=e.type;if(!xm(t)){if(yJ(t))return[{key:e.name,literal:t.literal}];if(yW(t))return[{key:e.name,literal:t.symbol}]}return[]});case"Arrays":return e.elements.flatMap((e,t)=>{if(!xm(e)){if(yJ(e))return[{key:t,literal:e.literal}];if(yW(e))return[{key:t,literal:e.symbol}]}return[]});case"Union":{if(0===e.types.length)return[];let t=e.types.map(e=>vj(v$(e)));return t[0].filter(e=>t.every(t=>t.some(t=>t.key===e.key&&t.literal===e.literal)))}case"Suspend":return vj(e.thunk())}}let vB=new WeakMap,vP=Object.freeze([]),vR=e=>null===e?"null":Array.isArray(e)?"array":typeof e,vL=(e,t)=>"__proto__"===t?Object.hasOwn(e,t):t in e,vF=class extends y0{_tag="Union";types;options;encodingChecks;constructor(e,t,r,n,i,s,a){super(r,n,i,s),this.types=e,this.options=t,this.encodingChecks=a}getParser(e,t){let r,n=this,i=void 0!==t,s=[],a=t=>s[t]??=e(n.types[t]);return(e,t)=>{if(e===b_)return bC;let s=(r??=function(e){let t,r,n,i=vB.get(e);if(i)return i;let s=0,a=!0,o=[];for(let i=0;i<e.length;i++){let l=v$(e[i]);if(yH(l))continue;if(yJ(l)||yW(l)){n??=new Map;let e=yJ(l)?l.literal:l.symbol;o[i]=e;let t=n.get(e);t||n.set(e,t=[]),t.push(i)}else a=!1;let u=vj(l);if(u.length)for(let{key:e,literal:r}of(t??=new Map,s++,u)){let n=t.get(e);n||t.set(e,n=[new Map,new Set]),n[1].add(i);let s=n[0].get(r);s||n[0].set(r,s=new Set),s.add(i)}else for(let e of(r??={},function e(t){switch(t._tag){case"Null":return["null"];case"Undefined":return["undefined"];case"String":case"TemplateLiteral":return["string"];case"Number":return["number"];case"Boolean":return["boolean"];case"Symbol":case"UniqueSymbol":return["symbol"];case"BigInt":return["bigint"];case"Arrays":return["array"];case"ObjectKeyword":return["object","array","function"];case"Objects":return t.propertySignatures.length||t.indexSignatures.length?["object"]:["string","number","boolean","symbol","bigint","object","array","function"];case"Enum":return Array.from(new Set(t.enums.map(([,e])=>typeof e)));case"Literal":return[typeof t.literal];case"Union":return Array.from(new Set(t.types.flatMap(e)));default:return["null","undefined","string","number","boolean","symbol","bigint","object","array","function"]}}(l)))(r[e]??=[]).push(i)}let l={},u=e=>l[e]??=Object.freeze(r?.[e]??vP);if(a&&n)n.forEach(Object.freeze),i=e=>n.get(e)??vP;else if(t?.size!==1||r)if(t){let e;for(let r of t)(!e||r[1][0].size>e[1][0].size)&&r[1][1].size===s&&(e=r);i=(n,i)=>{let s,a=vR(n);if(!tv(n))return u(a);let o=new Set(r?.[a]);if(e){let[t,[r]]=e,l=vL(n,t),c=l?n[t]:void 0;if(l&&(!i||void 0!==c)){let e=r.get(c);if(!e)return u(a);for(let t of e)o.add(t);s=t}}if(void 0===s)for(let[e,[r,s]]of t){let t=vL(n,e),a=t?n[e]:void 0;if(t&&(!i||void 0!==a)){let e=r.get(a);if(e)for(let t of e)o.add(t)}else if(i)for(let e of s)o.add(e)}for(let[e,[r,a]]of t){if(e===s)continue;let t=vL(n,e),l=t?n[e]:void 0;if(t&&(!i||void 0!==l)){let e=r.get(l);for(let t of o)a.has(t)&&!e?.has(t)&&o.delete(t)}}return Array.from(o).sort((e,t)=>e-t)}}else i=e=>{let t=u(vR(e));return n?t.filter(t=>void 0===o[t]||o[t]===e):t};else{let[r,[n]]=t.entries().next().value,s=new Map;for(let[e,t]of n)s.set(e,Object.freeze(Array.from(t)));let a=Object.freeze(e.map((e,t)=>t));i=(e,t)=>{if(tv(e)){let n=vL(e,r)?e[r]:void 0;if(void 0!==n)return s.get(n)??vP;if(t)return a}return vP}}return vB.set(e,i),i}(n.types))(e,i);if(0===s.length)return r8(new bH(n,[],e,t));if(1===s.length){var o,l,u,c;let r=a(s[0])(e,t);return"Success"===r._tag?r:ur(r)?vD(n,r.cause,e,t):(o=n,l=r,u=e,c=t,uU(l,e=>vD(o,e,u,c)))}return function e(t,r,n,i,s){let a={ast:t,parser:r,input:i,out:void 0,successes:t.options?.mode==="oneOf"?[]:void 0,issues:void 0,options:s},o=vH(a,n);if(!o)return a.out?a.out:r8(new bH(t,a.issues??[],i,s));if(ur(o))return vz(o,a);let l=!0;return lN(()=>l?(l=!1,vz(o,a)):e(t,r,n,i,s))}(n,a,s,e,t)}}_rebuild(e,t,r){let n=xa(this.types,e);return n===this.types&&t===this.checks&&r===this.encodingChecks?this:new vF(n,this.options,this.annotations,t,void 0,this.context,r)}recur(e){return this._rebuild(e,this.checks,this.encodingChecks)}flip(e){return this._rebuild(e,this.encodingChecks,this.checks)}matchPart(e,t){for(let r of this.types){let n=r.matchPart(e,t);if(void 0!==n)return n}}getExpected(e){let t=this.annotations?.expected;return"string"==typeof t?t:0===this.types.length?"never":Array.from(new Set(this.types.map(t=>{let r=xy(t);switch(r._tag){case"Arrays":{let t=r.elements.filter(yJ);if(t.length>0)return`${vW(r.isMutable)}[ ${t.map(t=>e(t)+(t.context?.isOptional?"?":"")).join(", ")}, ... ]`;break}case"Objects":{let t=r.propertySignatures.filter(e=>yJ(e.type));if(t.length>0)return`{ ${t.map(t=>`${vW(t.type.context?.isMutable)}${ra(t.name)}${t.type.context?.isOptional?"?":""}: ${e(t.type)}`).join(", ")}, ... }`}}return e(r)}))).join(" | ")}};function vD(e,t,r,n){let i=b0(t);return i?r8(new bH(e,[i],r,n)):r5(t)}function vz(e,t){return un(e,e=>t.out===bA?lI(t.input):t.out?t.out:r8(new bH(t.ast,t.issues??[],t.input,t.options)))}let vH=(cH())({onItem:(e,t)=>e.parser(t)(e.input,e.options),step(e,t,r){if("Failure"===r._tag){let t=b0(r.cause);if(void 0===t)return r;e.issues?e.issues.push(t):e.issues=[t]}else{if(e.out&&e.successes)return e.successes.push(e.ast.types[t]),r8(new bJ(e.ast,e.successes,e.input,e.options));if(e.out=r,!e.successes)return ud;e.successes.push(e.ast.types[t])}}}),vJ=new vF([new vo("Infinity"),new vo("-Infinity"),new vo("NaN")]);function vW(e){return e?"":"readonly "}let vq=class extends y0{_tag="Suspend";thunk;constructor(e,t,r,n,i){let s;if(r)throw Error("Cannot add checks to Suspend");super(t,void 0,n,i),this.thunk=()=>s??=e()}getParser(e){let t;return(r,n)=>(t??=e(this.thunk()))(r,n)}recur(e){return new vq(()=>e(this.thunk()),this.annotations,void 0,void 0,this.context)}getExpected(e){return e(this.thunk())}},vK=class extends eY{_tag="Filter";run;annotations;aborted;constructor(e,t,r=!1){super(),this.run=e,this.annotations=t,this.aborted=r}annotate(e){return new vK(this.run,{...this.annotations,...e},this.aborted)}abort(){return new vK(this.run,this.annotations,!0)}and(e,t){return new vV([this,e],t)}},vV=class extends eY{_tag="FilterGroup";checks;annotations;constructor(e,t){super(),this.checks=e,this.annotations=t}annotate(e){return new vV(this.checks,{...this.annotations,...e})}and(e,t){return new vV([this,e],t)}};function vG(e,t,r=!1){return new vK((t,r,n)=>bK(r,e(t,r,n),t,n),t,r)}function vY(e){return vG(e=>globalThis.Number.isFinite(e),{expected:"a finite number",representation:{id:"effect/schema/isFinite",payload:null},toJsonSchema:()=>({type:"number"}),toCode:()=>({runtime:"Schema.isFinite()"}),arbitraryConstraint:{number:"finite"},...e})}let vZ=v9(vf,[vY()]),vX=new yY(new vF([vZ,vJ]),new yd(yn(),b9(e=>globalThis.Number.isFinite(e)?e:globalThis.String(e))));function vQ(e,t){let r=new globalThis.RegExp(e),n={source:r.source,flags:r.flags};return vG(e=>(r.lastIndex=0,r.test(e)),{expected:`a string matching the RegExp ${n.source}`,representation:{id:"effect/schema/isPattern",payload:n},toJsonSchema:()=>[{},!0],arbitraryConstraint:{patterns:[n]},...t})}let v0=new WeakMap;function v1(e,t){let r=Object.assign(Object.create(Object.getPrototypeOf(e)),e,t);return Reflect.ownKeys(t).every(e=>"context"===e||"encoding"===e)&&v0.set(r,v2(e)),r}function v2(e){let t=v0.get(e);if(void 0!==t)return t;if(void 0===e.encoding)return e;let r=Object.assign(Object.create(Object.getPrototypeOf(e)),e,{encoding:void 0});return v0.set(e,r),r}function v3(e,t){return e.encoding===t?e:v1(e,{encoding:t})}function v5(e,t){if(e.context===t)return e;let r=v2(e);return r.context===t&&r.encoding===e.encoding?r:v1(e,{context:t})}function v8(e){return e.encoding?v8(e.encoding[e.encoding.length-1].to):e}function v4(e,t){if(e.checks){let r=e.checks[e.checks.length-1];return v6(e,sR(e.checks.slice(0,-1),r.annotate(t)))}return v1(e,{annotations:{...e.annotations,...t}})}function v6(e,t){if("Suspend"===e._tag&&t)throw Error("Cannot add checks to Suspend");return e.checks===t?e:v1(e,{checks:t})}function v9(e,t){return v6(e,vT(e.checks,t))}function v7(e,t){let r=t(e.to);return r===e.to?e:new yY(r,e.transformation)}function xe(e,t){let r=e[e.length-1],n=v7(r,t);return n===r?e:sR(e.slice(0,e.length-1),n)}function xt(e){return t=>t.encoding?v3(t,xe(t.encoding,e)):t}function xr(e,t){return xt(e=>v5(e,t))(e)}function xn(e){return e6(function t(r){return r.encoding?v3(r,xe(r.encoding,t)):e(r)})}function xi(e,t){return e9(function r(n){if(n.encoding){let e=n.encoding[n.encoding.length-1];return t?.stopAt?.(e)?n:v3(n,xe(n.encoding,r))}return e(n)})}function xs(e,t,r){let n=new yY(e,t);return v3(r,r.encoding?[...r.encoding,n]:[n])}function xa(e,t){let r;for(let n=0;n<e.length;n++){let i=e[n],s=t(i);if(r)r[n]=s;else if(s!==i){r=Array(e.length);for(let t=0;t<n;t++)r[t]=e[t];r[n]=s}}return r??e}function xo(e,t){let r=e.context?new yX(e.context.isOptional,e.context.isMutable,e.context.constructorDefault,{...e.context.annotations,...t}):new yX(!1,!1,void 0,t);return v5(e,r)}let xl=e9(e=>{let t=e.context?!1===e.context.isOptional?new yX(!0,e.context.isMutable,e.context.constructorDefault,e.context.annotations):e.context:new yX(!0,!1);return xu(v5(e,t))}),xu=xt(xl),xc=e6(e=>xl(new vF([e,y8]))),xf=e9(e=>{let t=e.context?!1===e.context.isMutable?new yX(e.context.isOptional,!0,e.context.constructorDefault,e.context.annotations):e.context:new yX(!1,!0);return xd(v5(e,t))}),xd=xt(xf);function xh(e,t){let r=e.context?new yX(e.context.isOptional,e.context.isMutable,t,e.context.annotations):new yX(!1,!1,t);return v5(e,r)}function xp(e,t,r){return xs(e,r,t)}function xg(e,t){let{literals:r,parameters:n}=function(e){let t=[],r=[];function n(e){t.includes(e)||t.push(e)}return!function e(t){switch(t._tag){case"Literal":tf(t.literal)&&n(t.literal);return;case"UniqueSymbol":n(t.symbol);return;case"Enum":for(let[,e]of t.enums)n(e);return;case"Never":return;case"Union":for(let r=0;r<t.types.length;r++)e(t.types[r]);return;default:r.push(t)}}(e),{literals:t,parameters:r}}(e);return new vE(r.map(e=>new vS(e,t)),n.map(e=>new vk(e,t)))}function xm(e){return e.context?.isOptional??!1}let xb=e9(e=>{let t=v2(e);if(t!==e){let r=xb(t);return r===t&&void 0===e.encoding?e:v5(r,e.context)}let r="recur"in e?e.recur(xb):e;if("encodingChecks"in r&&r.encodingChecks){let t,n,i=(t=!0,"recur"in e&&e.recur(function e(r){return(t=t&&!r.encoding&&!yG(r))&&"recur"in r&&r.recur(e),r}),t)?r.encodingChecks:(yq(r)||yK(r)||yF(r)&&r.typeParameters.length>0)&&sf(n=r.encodingChecks.flatMap(function e(t){return!function e(t){return t.annotations?.[bw]===!0||"FilterGroup"===t._tag&&t.checks.every(e)}(t)?"FilterGroup"===t._tag?t.checks.flatMap(e):[]:[t]}))?n:void 0;return v1(r,{encodingChecks:void 0,checks:vT(r.checks,i)})}return r}),xy=e9(e=>xb(xv(e))),xv=e6(e=>{if(e.encoding)return function(e,t){let r=t.length,n=t[r-1],i=[new yY(xv(v3(e,void 0)),t[0].transformation.flip())];for(let e=1;e<r;e++)i.unshift(new yY(xv(t[e-1].to),t[e].transformation.flip()));let s=xv(n.to);return s.encoding?v3(s,[...s.encoding,...i]):v3(s,i)}(e,e.encoding);let t=v2(e);if(t!==e){let r=xv(t);return r===t?e:v5(r,e.context)}return"flip"in e?e.flip(xv):"recur"in e?e.recur(xv):e});function xx(e,t){let r=0===t?bA:r1(t);return(n,i)=>n===b_?bC:n===t?r:r8(new bL(e,n,i))}function xw(e,t){return(r,n)=>r===b_?bC:t(r)?bA:r8(new bL(e,r,n))}function xS(e,t,r){let n,i=e.encodedParts,s=e.literals,a=t.length;for(let e=0;e<s.length;e++){let r=s[e];if(r&&!t.includes(r))return}if(e.suffixLengths[0]>a)return;let o=Array(i.length);return!function l(u,c){if(u===i.length)return c===a;if(n?.has(u*(a+1)+c))return!1;let f=i[u];if(u===i.length-1){let e=t.slice(c);if(void 0!==f.matchPart(e,r))return o[u]=e,!0}else if("Literal"===f._tag){let e=s[u];if(t.startsWith(e,c)&&l(u+1,c+e.length))return o[u]=e,!0}else{let n=a-e.suffixLengths[u+1],i=s[u+1],d=void 0===i?n:t.lastIndexOf(i,n);for(;d>=c;){let e=t.slice(c,d);if(void 0!==f.matchPart(e,r)&&l(u+1,d))return o[u]=e,!0;if(0===d)break;d=void 0===i?d-1:t.lastIndexOf(i,d-1)}}return(n??=new Set).add(u*(a+1)+c),!1}(0,0)?void 0:o}let xk=xi(e=>{switch(e._tag){default:return e;case"Number":return e.toCodecStringTree();case"Union":return e.recur(xk)}}),xE=xi(e=>{switch(e._tag){default:return e;case"Symbol":case"UniqueSymbol":return e.toCodecStringTree();case"Union":return e.recur(xE)}}),x_=xi(e=>{switch(e._tag){default:return e;case"Number":case"Literal":case"BigInt":return e.toCodecStringTree();case"Union":return e.recur(x_)}}),xC=new globalThis.RegExp(`^${vx}$`),xA=new globalThis.RegExp(`^(?:${vx}|Infinity|-Infinity|NaN)$`);function xI(e){return vQ(xC,{expected:"a string representing a finite number",representation:{id:"effect/schema/isStringFinite",payload:null},toJsonSchema:()=>({pattern:xC.source}),...e})}let xT=v9(vu,[xI()]),xO=new yY(xT,yv),xN=new yY(new vF([xT,vJ]),yv),xM=new globalThis.RegExp("^-?\\d+$");function xU(e){return vQ(xM,{expected:"a string representing a bigint",representation:{id:"effect/schema/isStringBigInt",payload:null},toJsonSchema:()=>({pattern:xM.source}),...e})}let x$=v9(vu,[xU({expected:"a string representing a bigint"})]),xj=new yY(x$,yx),xB=new globalThis.RegExp("^Symbol\\(([\\s\\S]*)\\)$"),xP=new yY(v9(vu,[xR()]),new yd(b9(e=>globalThis.Symbol.for(xB.exec(e)[1])),b7((e,t)=>void 0!==globalThis.Symbol.keyFor(e)?lI(globalThis.String(e)):r8(new bz({message:"cannot serialize to string, Symbol is not registered"},e,t)))));function xR(e){return vQ(xB,{expected:"a string representing a symbol",representation:{id:"effect/schema/isStringSymbol",payload:null},toJsonSchema:()=>({pattern:xB.source}),...e})}function xL(e,t,r,n,i){for(let s=0;s<e.length;s++){let a=e[s];if("FilterGroup"===a._tag){if((r=xL(a.checks,t,r,n,i))&&("all"!==i.errors||r[r.length-1].filter.aborted))break}else{let e=a.run(t,n,i);if(e){let n=new bU(a,e,t,i);if(r?r.push(n):r=[n],"all"!==i.errors||a.aborted)break}}}return r}function xF(e){if(!yF(e))return;let t=e.annotations?.[bk];return td(t)?t(e.typeParameters):void 0}let xD=function(e){return t=>bx(t)?.[e]};function xz(e){return null===e||"string"==typeof e||"boolean"==typeof e||"number"==typeof e&&globalThis.Number.isFinite(e)}function xH(e){return void 0===e||"string"==typeof e}function xJ(e,t){let r=new WeakMap,n=[];e:for(;;){if("object"!=typeof e||null===e){if(!t(e))return!1}else{let t=e,i=r.get(t);if(!1===i)return!1;if(void 0===i){let e=Array.isArray(t);if(!e){let e=Object.getPrototypeOf(t);if(null!==e&&e!==Object.prototype&&null!==Object.getPrototypeOf(e))return!1}r.set(t,!1),n.push({value:t,keys:e?t.length:Object.keys(t),index:0})}}for(;n.length>0;){let t=n[n.length-1],i=t.keys;if("number"==typeof i){if(t.index<i){e=t.value[t.index++];continue e}}else if(t.index<i.length){e=t.value[i[t.index++]];continue e}r.set(t.value,!0),n.pop()}return!0}}let xW=new y1([],()=>(e,t,r)=>xJ(e,xz)?bA:r8(new bL(t,e,r)),{representation:{id:"effect/schema/Json",payload:null},expected:"JSON value",toCodecJson:()=>void 0,toCodecStringTree:()=>xG}),xq=v4(xW,{representation:{id:"effect/schema/MutableJson",payload:null}}),xK=new yY(xW,yy()),xV=new yY(new vF([new vg(!1,[],[xW]),new vE([],[new vk(vu,xW)])]),yy()),xG=new yY(new y1([],()=>(e,t,r)=>xJ(e,xH)?bA:r8(new bL(t,e,r)),{expected:"StringTree",toCodecStringTree:()=>void 0}),yy());e.s(["V8",0,vg,"Z_",0,yX,"lH",0,y1,"WA",0,vr,"w9",0,vV,"GZ",0,xW,"at",0,yY,"Y8",0,vo,"N9",0,xq,"vD",0,y6,"MP",0,vE,"nS",0,vS,"Cl",0,vq,"MM",0,vi,"rF",0,vF,"j3",0,va,"sE",0,v4,"HE",0,xo,"ij",0,y7,"ib",0,v9,"lJ",0,xn,"kT",0,xi,"Gn",0,vp,"fK",0,x$,"io",0,vd,"CI",0,xL,"Ng",0,vj,"EW",0,xp,"Ci",0,yZ,"V1",0,vZ,"rV",0,xv,"Ht",0,vN,"ND",0,xF,"C9",0,v2,"xK",0,v8,"i9",0,yq,"vx",0,vY,"br",0,yJ,"YM",0,yD,"Go",0,yK,"Hv",0,xm,"vn",0,vQ,"QE",0,xU,"_t",0,xI,"LU",0,xR,"SQ",0,yG,"gb",0,yV,"gr",0,yz,"Qi",0,vG,"eA",0,function(e,t){return new vK((t,r,n)=>e(t)?void 0:new bF(void 0,t,n),t,!0)},"c5",0,v7,"n$",0,xa,"em",0,function(e,t){return xs(e,t,xb(e))},"TK",0,function(e,t){return xs(xy(e),t,e)},"Is",0,function(e){if(e.encoding)throw Error("mutable does not support encodings");return new vg(!0,e.elements,e.rest,e.annotations,e.checks,void 0,e.context,e.encodingChecks)},"Ky",0,xf,"Ub",0,y9,"Ql",0,y2,"gj",0,vf,"r",0,vt,"Nw",0,xV,"zY",0,xc,"Mn",0,xl,"JK",0,xE,"jO",0,xg,"jt",0,v6,"a$",0,v5,"o2",0,xr,"mh",0,v3,"nf",0,xD,"oz",0,vu,"dg",0,vO,"ZE",0,function(e,t){if(e.encoding||t.some(e=>e.encoding))throw Error("StructWithRest does not support encodings");let r=e.propertySignatures,n=e.indexSignatures,i=e.checks;for(let e of t){for(let t of e.propertySignatures)if(r.some(e=>e.name===t.name))throw Error(`Duplicate identifier: ${JSON.stringify(t.name)}. ts(2300)`);r=r.concat(e.propertySignatures),n=n.concat(e.indexSignatures),i=vT(i,e.checks)}return new vE(r,n,void 0,i)},"uW",0,vh,"AN",0,function(e){let t=e6(e=>{if("Union"!==e._tag)return e;let r=xa(e.types,t);return(e.options?.mode??"anyOf")==="anyOf"&&r===e.types?e:new vF(r,void 0===e.options?void 0:{...e.options,mode:"anyOf"},e.annotations,e.checks,void 0,e.context)}),r=new vi(e.map(e=>t(xy(e))));return xp(r,new vg(!1,e.map(x_),[]),vs(r))},"sl",0,xy,"$8",0,xb,"TP",0,vM,"zv",0,function(e,t){if(e.encoding)throw Error("TupleWithRest does not support encodings");return new vg(e.isMutable,e.elements,t,void 0,e.checks)},"pd",0,y8,"nI",0,vU,"H5",0,ve,"zq",0,xK,"kZ",0,xG,"Zv",0,y4,"jy",0,xh],73798);let xY=(e,t,r)=>e===bA?r(t):un(e,r);function xZ(e){let t=function(e){if("Middleware"===e._tag)return(t,r,n)=>xX(t===bA?e.decode(r1(bI(r)),n):e.decode(us(t,bI),n));let t=e.decode;switch(t._tag){case"Passthrough":return(e,t)=>e===bA?r1(t):e;case"Transform":{let e=e=>e===b_?bC:r1(t.transform(e));return(t,r)=>xY(t,r,e)}case"TransformOptional":{let e=e=>bT(t.transform(bI(e)));return(t,r)=>xY(t,r,e)}case"TransformEffect":return(e,r,n)=>xY(e,r,e=>e===b_?bC:t.transform(e,n));case"TransformOptionalEffect":return(e,r,n)=>xY(e,r,e=>xX(t.transform(bI(e),n)))}}(e);return(e,r,n)=>{try{return t(e,r,n)}catch(e){return lj(e)}}}let xX=e=>un(e,bT),xQ=(e,t,r,n)=>uU(n,n=>h4(()=>o7(n,n=>new b$(e,n,t,r))));function x0(e,t){let r,n=t(e);return e.context?.constructorDefault===void 0?n:(r=e.context.constructorDefault,(t,i)=>{if(t!==b_&&void 0!==t)return n(t,i);if(ur(r)&&"Success"===r._tag){let e=n(r[rk],i);return e===bA?r:e}return un(xQ(e,t,i,r),e=>{let t=n(e,i);return t===bA?r1(e):t})})}function x1(e,t,r,n,i){let s,a,o;if("Declaration"===e._tag)for(let r of e.typeParameters)t(r);let l=r?xF(e):void 0,u=l?(o=xZ(l.link.transformation),(e,r)=>e===b_?bC:l.isConstructed(e)?bA:o((a??=t(l.link.to))(e,r),e,r)):n??e.getParser(t,r),c=e.checks,f=e.encoding,d=f?.map(e=>xZ(e.transformation)),h=e.encodingChecks;if(!f&&!c&&!h)return u;let p=(t,r)=>{let n=u(t,r);try{if(h&&!r.disableChecks)if(ur(n)){if("Success"===n._tag){let i=n===bA?t:n[rk];if(t!==b_&&i!==b_){let i=xL(h,t,void 0,e,r);i&&(n=r8(new bR(e,i,t,r)))}}}else n=ue(n,n=>{if(t!==b_&&n!==b_){let n=xL(h,t,void 0,e,r);if(n)return r8(new bR(e,n,t,r))}return lI(n)});if(c&&!r.disableChecks)if(ur(n)){if("Success"===n._tag){let i=n===bA?t:n[rk];if(i===b_)return n;let s=xL(c,i,void 0,e,r);s&&(n=r8(new bR(e,s,i,r)))}}else n=ue(n,t=>{if(t!==b_){let n=xL(c,t,void 0,e,r);if(n)return r8(new bR(e,n,t,r))}return lI(t)});return n}catch(e){return lj(e)}},g=void 0===i?p:i(p);return f?(r,n)=>{let i=s??=f.map(e=>t(e.to)),a=r,o=i[i.length-1](r,n);for(let e=f.length-1;e>=0;e--)if(o=d[e](o,a,n),0!==e){let t=i[e-1];o="Success"===o._tag?t(a=o[rk],n):un(o,e=>{let r=t(e,n);return r===bA?r1(e):r})}if("Success"===o._tag){let e=g(o[rk],n);return e===bA?o:e}return un(o=xQ(e,r,n,o),e=>{let t=g(e,n);return t===bA?r1(e):t})}:g}let x2=Symbol(),x3=new WeakMap,x5=e=>we(e).parser,x8=e=>we(e).makeEffect,x4=e=>x0(e,x8);class x6{ast;constructor(e){this.ast=e}get decodeEffect(){return this.cachedDecodeEffect??=x1(this.ast,x5)}get parser(){return this.decodeEffect}get makeEffect(){return this.cachedMakeEffect??=x1(this.ast,x8,x4)}}class x9 extends x6{compiled;resolve;constructor(e,t,r){super(e),this.compiled=t,this.resolve=r}save(e,t){return Object.defineProperty(this,e,{value:t}),t}operation(e){let t=this.compiled;return"function"==typeof t?t(this.ast,this.resolve,e):t?.[e]}get is(){return this.save("is",this.operation("is"))}get decode(){return this.save("decode",this.operation("decode"))}get make(){return this.save("make",this.operation("make"))}get compiledMakeEffect(){return this.save("compiledMakeEffect",this.operation("makeEffect"))}get decodeEffect(){return this.save("decodeEffect",this.operation("decodeEffect")??x1(this.ast,e=>x7(this.resolve,e,"parser")))}get parser(){var e,t;let r,n=this.decode;return void 0===n?this.decodeEffect:this.save("parser",(e=n,t=()=>this.decodeEffect,(n,i)=>{if(n!==b_)try{let t=e(n,i);if(t!==x2)return t===n?bA:r1(t)}catch(e){return lj(e)}return(r??=t())(n,i)}))}get makeEffect(){let e=this.compiledMakeEffect;if(void 0!==e)return this.save("makeEffect",e);let t=e=>x7(this.resolve,e,"makeEffect");return this.save("makeEffect",x1(this.ast,t,e=>x0(e,t)))}}function x7(e,t,r){let n,i=e(t);return void 0===i.compiled||Object.hasOwn(i,r)?i[r]:(e,t)=>(n??=i[r])(e,t)}function we(e){let r=x3.get(e);if(void 0!==r)return r;let n=void 0===t?new x6(e):new x9(e,t(e,we),we);return x3.set(e,n),n}function wt(e){let t,r=e.ast;return(e,n)=>(t??=wo(wd,xb(r)))(e,n?.disableChecks?n?.parseOptions?{...n.parseOptions,disableChecks:!0}:{disableChecks:!0}:n?.parseOptions)}function wr(e){let t=wt(e);return(e,r)=>{let n=c7(t(e,r));return"Success"===n._tag?nv(n.value):(b1(n.cause,"Option adapter can only return none for schema issues"),nb)}}function wn(e,t){let r=wo(wf,e.ast);return void 0===t?r:(e,n)=>r(e,ws(t,n))}function wi(e,t){let r=wo(wf,xv(e.ast));return void 0===t?r:(e,n)=>r(e,ws(t,n))}let ws=(e,t)=>t?{...e,...t}:e,wa=e=>e===b_?r8(new bF):lI(e);function wo(e,t){let r;return(n,i)=>{let s=(r??=e(t))(n,i??yZ);return s===bA?lI(n):ur(s)?s[rk]===b_?wa(b_):s:un(s,wa)}}let wl="Constructor adapter can only throw schema issues";function wu(e){throw Error(wl,{cause:rq(e)})}function wc(e,t,r){var n,i;let s=r?.disableChecks?r.parseOptions?{...r.parseOptions,disableChecks:!0}:{disableChecks:!0}:r?.parseOptions??yZ,a=e.make;if(void 0!==a&&t!==b_){let e;try{e=a(t,s)}catch(e){wu(e)}if(e!==x2&&e!==b_)return e}let o=c7((n=e.makeEffect(t,s),i=t,n===bA?lI(i):ur(n)?n[rk]===b_?wa(b_):n:un(n,wa)));if("Success"===o._tag)return o.value;throw Error("Schema validation failed",{cause:b1(o.cause,wl)})}let wf=e=>we(e).parser,wd=e=>we(e).makeEffect,wh="~effect/Schema/Schema",wp=Symbol(),wg={[wh]:wh,get make(){var e;let t,r=(e=xb(this.ast),(r,n)=>wc(t??=we(e),r,n));return Object.defineProperty(this,"make",{value:r,enumerable:!0}),r},get makeEffect(){let e=wt(this);return Object.defineProperty(this,"makeEffect",{value:e,enumerable:!0}),e},get makeOption(){let e=wr(this);return Object.defineProperty(this,"makeOption",{value:e,enumerable:!0}),e},pipe(){return eV(this,arguments)},annotate(e){return this.rebuild(v4(this.ast,e))},annotateKey(e){return this.rebuild(xo(this.ast,e))},check(...e){return this.rebuild(v9(this.ast,e))},rebuild(e){return wm(e,this[wp])}};function wm(e,t){let r=Object.setPrototypeOf(function(){},wg);return t&&(Object.hasOwn(t,"name")||Object.hasOwn(t,"length")||Object.hasOwn(t,"__proto__"))?Object.defineProperties(r,Object.getOwnPropertyDescriptors({...t})):Object.assign(r,t),r[wp]=t,r.ast=e,r}let wb=wy(function(e,t){switch(e._tag){case"Declaration":{let r=e.annotations?.toCodecJson??e.annotations?.toCodec;if(!td(r))return v3(e,[xK]);let n=r(e.typeParameters.map(e=>wm(xy(e))));return void 0===n?e:v3(e,[v7(n,t)])}case"Unknown":return v3(e,[xK]);case"ObjectKeyword":return v3(e,[xV]);case"Undefined":case"Void":case"Literal":case"Number":return e.toCodecJson();case"UniqueSymbol":case"Symbol":case"BigInt":return e.toCodecStringTree();case"Objects":return wx(e),e.recur(t,xE);case"Union":{let r=wS(e.types);if(r!==e.types)return new vF(r,e.options,e.annotations,e.checks,e.encoding,e.context,e.encodingChecks).recur(t);return e.recur(t)}case"Arrays":case"Suspend":return e.recur(t)}return e});function wy(e,t){let r=e6(t=>{let r=v5(t,void 0),i=e(r,n);return i===r?null:i}),n=xi(e=>{let t=r(v2(e));if(null===t)return e;let n=v5(t,e.context);return void 0===e.context?n:xr(n,wv(e.context))},t);return n}function wv(e){return void 0===e.constructorDefault?e:new yX(e.isOptional,e.isMutable,void 0,e.annotations)}function wx(e){if(e.propertySignatures.some(e=>"string"!=typeof e.name))throw new globalThis.Error("Objects property names must be strings",{cause:e})}function ww(e){return t=>{let r=[...t].sort((t,r)=>e(xy(t))-e(xy(r)));return r.some((e,r)=>e!==t[r])?r:t}}let wS=ww(e=>{switch(e._tag){case"BigInt":case"Symbol":case"UniqueSymbol":return 0;default:return 1}}),wk=e6(e=>{let t=function(e,t){switch(e._tag){case"Declaration":{let r=e.annotations?.toCodecIso??e.annotations?.toCodec;if(td(r)){let n=r(e.typeParameters.map(e=>wm(e)));return v3(e,[v7(n,t)])}break}case"Arrays":case"Objects":case"Union":case"Suspend":return e.recur(t)}return e}(e,wk);return t!==e&&void 0!==e.context?xr(t,wv(e.context)):t}),wE=ww(e=>{switch(e._tag){case"Null":case"Boolean":case"Number":case"BigInt":case"Symbol":case"UniqueSymbol":return 0;default:return 1}}),w_=new yY(new vo("null"),new yd(b9(()=>null),b9(()=>"null"))),wC=new yY(new vF([new vo("true"),new vo("false")]),new yd(b9(e=>"true"===e),yr())),wA=new yd(b9(e=>"string"==typeof e?[e]:e),b6),wI=e=>e.transformation===wA,wT=wy((e,t)=>(function(e,t,r){switch(e._tag){case"Declaration":{let n=e.typeParameters.map(e=>wm(t(xy(e)))),i=e.annotations?.toCodecStringTree;if(td(i)){let r=i(n);if(void 0===r)return e;return v3(e,[v7(r,t)])}let s=e.annotations?.toCodecJson,a=td(s)?s(n):void 0,o=void 0===a?e.annotations?.toCodec:void 0,l=a??(td(o)?o(n):void 0);return void 0===l?r(e):v3(e,[v7(l,t)])}case"Null":return v3(e,[w_]);case"Boolean":return v3(e,[wC]);case"Unknown":case"ObjectKeyword":return v3(e,[xG]);case"Enum":case"Number":case"Literal":case"UniqueSymbol":case"Symbol":case"BigInt":return e.toCodecStringTree();case"Objects":return wx(e),e.recur(t,xE);case"Union":{let r=wE(e.types);if(r!==e.types)return new vF(r,e.options,e.annotations,e.checks,e.encoding,e.context,e.encodingChecks).recur(t);return e.recur(t)}case"Arrays":case"Suspend":return e.recur(t)}return e})(e,t,e=>{throw new globalThis.Error("Missing structural codec for StringTree",{cause:e})}),{stopAt:wI}),wO=e=>xm(e)?xl(ve):ve,wN=xi(e=>{var t;let r="Declaration"===(t=e)._tag||"Arrays"===t._tag||"Objects"===t._tag||"Union"===t._tag||"Suspend"===t._tag?t.recur(wN):t;if(yq(r)){let t=xp(new vF([new vg(r.isMutable,r.elements.map(wO),r.rest.map(wO)),vu],{mode:"anyOf"}),r,wA);return xm(e)?xl(t):t}return r},{stopAt:wI}),wM=xi(e=>{switch(e._tag){case"Objects":return e.recur(e=>wU(wM(e)),eX);case"Arrays":return e.recur(e=>wj(wM(e)));case"Declaration":case"Union":case"Suspend":return e.recur(wM)}return e}),wU=xn(e=>xm(e)?w$(e):wj(e)),w$=xn(e=>yG(e)?e.recur(w$):function(e){if(!yV(e))return!1;let t=e.types[e.types.length-1].encoding?.[0].transformation;return t===wR||t===wL||t===wF}(e)||function e(t){let r=v8(t);switch(r._tag){case"Union":return void 0===r.checks&&r.types.some(e);case"Null":case"Unknown":case"Any":case"Declaration":let n,i;return(n=xb(wm(v5(r,void 0)).ast),i=e=>{var t;let r;return(r=(t=wo(wf,n),(e,r)=>c7(t(e,r))),i=e=>{let t=r(e,yZ);return"Success"===t._tag||(b1(t.cause,"Type guard adapter can only return false for schema issues"),!1)})(e)},e=>i(e))(null)}return!1}(e)?e:wB(e,xp(y2,y9,wR))),wj=xn(e=>{var t,r;return yG(e)?e.recur(wj):yq(e)&&0===e.elements.length&&1===e.rest.length?wB(e,(t=v6(wD,e.checks),xp(y2,t,wL))):yK(e)&&0===e.propertySignatures.length&&e.indexSignatures.length>0?wB(e,(r=v6(wz,e.checks),xp(y2,r,wF))):e});function wB(e,t){return v5(new vF([v5(e,void 0),t]),e.context)}let wP=e=>new yd(e,b8(()=>"Go nil values are never encoded")),wR=wP(ye(()=>nb)),wL=wP(b9(()=>[])),wF=wP(b9(()=>({}))),wD=new vg(!1,[],[]),wz=xg(vu,y9),wH="~effect/Schema/SchemaError";function wJ(e){return tx(e,wH)&&e[wH]===wH}let wW=t8((e,t)=>{if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}),wq="~effect/net/NetAddress";class wK extends om("NetAddressError"){}let wV=e=>tx(e,wq)&&"Ipv4Address"===e._tag,wG=e=>tx(e,wq)&&"Ipv6Address"===e._tag,wY={...rd,_tag:"Ipv4Address",[wq]:wq,[tq](e){return wV(e)&&this.value===e.value},[tC](){return tN(tO(wQ,0|this.value))},toString(){return w4(this)},toJSON(){return this.toString()}},wZ={...rd,_tag:"Ipv6Address",[wq]:wq,[tq](e){return!!wG(e)&&this.w0===e.w0&&this.w1===e.w1&&this.w2===e.w2&&this.w3===e.w3},[tC](){let e=tO(w0,0|this.w0);return e=tO(e,0|this.w1),e=tO(e,0|this.w2),tN(tO(e,0|this.w3))},toString(){return w4(this)},toJSON(){return this.toString()}},wX={...rd,_tag:"MacAddress",[wq]:wq,[tq](e){let t;return tx(t=e,wq)&&"MacAddress"===t._tag&&wW(this.bytes,e.bytes)},[tC](){return tO(w1,tL(this.bytes))},toString(){return w8(this)},toJSON(){return this.toString()}},wQ=tj("Ipv4Address"),w0=tj("Ipv6Address"),w1=tj("MacAddress"),w2=e=>{let t=Object.create(wY);return t.value=e>>>0,Object.freeze(t)},w3=e=>[e>>>24,e>>>16&255,e>>>8&255,255&e],w5=(e,t)=>nI(new wK({input:e,message:t})),w8=e=>Array.from(e.bytes,e=>e.toString(16).padStart(2,"0")).join(":"),w4=e=>{if(wV(e))return w3(e.value).join(".");let t=(e=>{let{w0:t,w1:r,w2:n,w3:i}=e;return[t>>>16,65535&t,r>>>16,65535&r,n>>>16,65535&n,i>>>16,65535&i]})(e);if(w6(e))return`::ffff:${t[6]>>8}.${255&t[6]}.${t[7]>>8}.${255&t[7]}`;let r=-1,n=0,i=-1;for(let e=0;e<=8;e++)e<8&&0===t[e]?-1===i&&(i=e):-1!==i&&(e-i>n&&(r=i,n=e-i),i=-1);if(n<2)return t.map(e=>e.toString(16)).join(":");let s=t.slice(0,r).map(e=>e.toString(16)).join(":"),a=t.slice(r+n).map(e=>e.toString(16)).join(":");return`${s}::${a}`},w6=e=>{let{w0:t,w1:r,w2:n}=e;return 0===t&&0===r&&65535===n},w9=/^[a-z0-9_](?:[a-z0-9_-]{0,61}[a-z0-9_])?$/,w7=/^(?:\d+|0x[0-9a-f]*)$/,Se=e=>{if("."===e)return;let t=e.endsWith(".")?e.slice(0,-1):e;if(0===t.length)return"domain name must not be empty";if(t.length>253)return"domain name must be at most 253 characters";let r=t.split(".");for(let e of r){if(0===e.length)return"domain name labels must not be empty";if(e.length>63)return"domain name labels must be at most 63 characters";if(!w9.test(e))return"domain name labels must contain only letters, digits, hyphens, or underscores and must not start or end with a hyphen"}if(w7.test(r[r.length-1]))return"the last domain name label must not be numeric"},St=e=>"string"==typeof e&&/^[a-z0-9_.-]+$/.test(e)&&void 0===Se(e),Sr="~effect/net/Dns/DnsRecord",Sn=e=>Number.isInteger(e)&&e>=0&&e<=255,Si=e=>Number.isInteger(e)&&e>=0&&e<=65535,Ss=e=>Number.isInteger(e)&&e>=0&&e<=0xffffffff,Sa=e=>"string"==typeof e,So=e=>aZ(e)&&aX(e)&&Ss(a6(e)),Sl={A:{address:wV},AAAA:{address:wG},CAA:{critical:e=>"boolean"==typeof e,tag:e=>Sa(e)&&/^[a-z0-9]+$/i.test(e),value:Sa},CNAME:{target:St},MX:{exchange:St,priority:Si},NAPTR:{order:Si,preference:Si,flags:Sa,service:Sa,regexp:Sa,replacement:St},NS:{host:St},PTR:{host:e=>Sa(e)&&e.length>0},SOA:{primary:St,admin:e=>Sa(e)&&e.length>0,serial:Ss,refresh:So,retry:So,expire:So,minimum:So},SRV:{target:St,port:Si,priority:Si,weight:Si},TLSA:{certUsage:Sn,selector:Sn,matchingType:Sn,data:e=>e instanceof Uint8Array&&e.length>0},TXT:{chunks:e=>Array.isArray(e)&&e.length>0&&e.every(Sa)}},Su=Object.keys(Sl),Sc={...rd,[Sr]:Sr,[tq](e){return tx(e,Sr)&&e._tag===this._tag&&Object.keys(this).every(t=>tK(this[t],e[t]))},[tC](){return tB(this,Object.keys(this))},toString(){return Sm(this)},toJSON(){return{...this}}},Sf=new TextEncoder,Sd=e=>`\\${e.toString().padStart(3,"0")}`,Sh=e=>{let t='"';for(let r of Sf.encode(e))t+=34===r||92===r?`\\${String.fromCharCode(r)}`:r<32||r>126?Sd(r):String.fromCharCode(r);return t+'"'},Sp=[34,36,40,41,59,64],Sg=e=>{let t=Sf.encode(e),r="";for(let e=0;e<t.length;e++){let n=t[e];if(92===n){let n=t[e+1];46===n||92===n?(r+=`\\${String.fromCharCode(n)}`,e++):r+="\\\\"}else n<=32||n>126?r+=Sd(n):r+=Sp.includes(n)?`\\${String.fromCharCode(n)}`:String.fromCharCode(n)}return r},Sm=e=>{switch(e._tag){case"A":case"AAAA":return`${e._tag} ${w4(e.address)}`;case"CAA":return`CAA ${128*!!e.critical} ${e.tag} ${Sh(e.value)}`;case"CNAME":return`CNAME ${e.target}`;case"MX":return`MX ${e.priority} ${e.exchange}`;case"NAPTR":return`NAPTR ${e.order} ${e.preference} ${Sh(e.flags)} ${Sh(e.service)} ${Sh(e.regexp)} ${e.replacement}`;case"NS":return`NS ${e.host}`;case"PTR":return`PTR ${Sg(e.host)}`;case"SOA":return`SOA ${e.primary} ${Sg(e.admin)} ${e.serial} ${a6(e.refresh)} ${a6(e.retry)} ${a6(e.expire)} ${a6(e.minimum)}`;case"SRV":return`SRV ${e.priority} ${e.weight} ${e.port} ${e.target}`;case"TLSA":return`TLSA ${e.certUsage} ${e.selector} ${e.matchingType} ${ov(e.data).toUpperCase()}`;case"TXT":return`TXT ${e.chunks.map(Sh).join(" ")}`}},Sb="~effect/net/IpInterface",Sy={...rd,_tag:"IpInterface",[Sb]:Sb,[tq](e){return tx(e,Sb)&&this.prefixLength===e.prefixLength&&tK(this.address,e.address)},[tC](){return tO(tA(this.address),t$(this.prefixLength))},toString(){return Sv(this)},toJSON(){return this.toString()}},Sv=e=>`${w4(e.address)}/${e.prefixLength}`,Sx="~effect/net/IpNetwork",Sw={...rd,_tag:"IpNetwork",[Sx]:Sx,[tq](e){return tx(e,Sx)&&this.prefixLength===e.prefixLength&&tK(this.address,e.address)},[tC](){return tO(tA(this.address),t$(this.prefixLength))},toString(){return SS(this)},toJSON(){return this.toString()}},SS=e=>`${w4(e.address)}/${e.prefixLength}`,Sk="~effect/SemVer",SE="~effect/SemVer/SemVerError";class S_ extends om("SemVerError"){[SE]=SE}let SC=e=>{throw new S_({message:e})},SA=e=>sp({try:e,catch:e=>{if(!tx(e,SE))throw e;return e}}),SI=(e,t,r)=>sg(SA(()=>r(t)),r=>new S_({message:`Invalid ${e} ${JSON.stringify(t)}: ${r.message}`,input:t})),ST=/^(?:0|[1-9]\d*)$/,SO=/^\d+$/,SN=/^[0-9A-Za-z-]+$/,SM=(e,t)=>!Number.isSafeInteger(e)||e<0?SC(`${t} must be a non-negative safe integer, received ${e}`):e,SU=(e,t)=>ST.test(e)?SM(Number(e),t):SC(`${t} must be a non-negative integer without leading zeros, received ${JSON.stringify(e)}`),S$=e=>"number"==typeof e?SM(e,"numeric pre-release identifier"):SN.test(e)?SO.test(e)?SU(e,"numeric pre-release identifier"):e:SC(`pre-release identifier must be non-empty [0-9A-Za-z-], received ${JSON.stringify(e)}`),Sj=e=>SN.test(e)?e:SC(`build identifier must be non-empty [0-9A-Za-z-], received ${JSON.stringify(e)}`),SB=(e,t)=>nU(e.major,t.major)||nU(e.minor,t.minor)||nU(e.patch,t.patch)||((e,t)=>{if(0===e.length)return+(0!==t.length);if(0===t.length)return -1;let r=Math.min(e.length,t.length);for(let n=0;n<r;n++){let r=e[n],i=t[n];if(r!==i){if("number"==typeof r)return"number"==typeof i?nU(r,i):-1;if("number"==typeof i)return 1;return nM(r,i)}}return nU(e.length,t.length)})(e.prerelease,t.prerelease),SP={[Sk]:Sk,[tq](e){return SF(e)&&SW(this,e)},[tC](){return tj(SH(this))},toString(){return`SemVer(${SH(this)})`},toJSON(){return{_id:"SemVer",value:SH(this)}},[rc](){return this.toJSON()},pipe(){return eV(this,arguments)}},SR=(e,t,r,n,i)=>{let s=Object.create(SP);return s.major=e,s.minor=t,s.patch=r,s.prerelease=n,s.build=i,s},SL=(e,t)=>e>=Number.MAX_SAFE_INTEGER?SC(`${t} cannot be incremented past Number.MAX_SAFE_INTEGER`):e+1,SF=e=>tx(e,Sk),SD=e=>{let t=e,r=[],n=t.indexOf("+");-1!==n&&(r=t.slice(n+1).split(".").map(Sj),t=t.slice(0,n));let i=[],s=t.indexOf("-");-1!==s&&(i=t.slice(s+1).split(".").map(S$),t=t.slice(0,s));let a=t.split(".");return 3!==a.length?SC("expected MAJOR.MINOR.PATCH"):SR(SU(a[0],"major"),SU(a[1],"minor"),SU(a[2],"patch"),i,r)},Sz=e=>SI("SemVer",e,SD),SH=e=>{let t=`${e.major}.${e.minor}.${e.patch}`;return e.prerelease.length>0&&(t+=`-${e.prerelease.join(".")}`),e.build.length>0&&(t+=`+${e.build.join(".")}`),t},SJ=t6(t4),SW=t8((e,t)=>e.major===t.major&&e.minor===t.minor&&e.patch===t.patch&&SJ(e.prerelease,t.prerelease)&&SJ(e.build,t.build)),Sq=e=>void 0===e?[0]:[S$(e),0],SK=e=>SF(e[0]),SV=((e,t)=>SR(SL(e.major,"major"),0,0,Sq(t),[]),"~effect/SemVerRange"),SG={[SV]:SV,[tq](e){return SY(e)&&S6(this)===S6(e)},[tC](){return tj(S6(this))},toString(){return`SemVerRange(${S6(this)})`},toJSON(){return{_id:"SemVerRange",value:S6(this)}},[rc](){return this.toJSON()},pipe(){return eV(this,arguments)}},SY=e=>tx(e,SV),SZ=/^(<=|>=|<|>|=|~|\^)?(.*)$/,SX=e=>"x"===e||"X"===e||"*"===e,SQ=["major","minor","patch"],S0=e=>{if(0===e.length)return SC("expected a version after the operator");if(e.includes("+"))return SC(`build metadata is not allowed in ranges, received ${JSON.stringify(e)}`);let t=e.indexOf("-"),r=(-1===t?e:e.slice(0,t)).split(".");if(r.length>3)return SC(`expected at most MAJOR.MINOR.PATCH, received ${JSON.stringify(e)}`);let n=[];for(let t=0;t<r.length;t++)if(!SX(r[t])){if(n.length<t)return SC(`a version component cannot follow a wildcard, received ${JSON.stringify(e)}`);n.push(SU(r[t],SQ[t]))}return -1===t?{components:n,prerelease:[]}:n.length<3?SC(`a pre-release requires MAJOR.MINOR.PATCH, received ${JSON.stringify(e)}`):{components:n,prerelease:e.slice(t+1).split(".").map(S$)}},S1=e=>{let t=e.split(/\s+/).filter(e=>e.length>0);if(0===t.length)return SC("expected a comparator");if(3===t.length&&"-"===t[1])return[{_tag:"Hyphen",from:S0(t[0]),to:S0(t[2])}];let r=[];for(let e=0;e<t.length;e++){let[,n,i]=SZ.exec(t[e]),s=0===i.length&&void 0!==n&&e+1<t.length?t[++e]:i;r.push({_tag:"Comparator",operator:n??"=",version:S0(s)})}return r},S2=e=>{let t=Object.create(SG);return t.sets=e,t},S3=e=>0===e.trim().length?S5:S2(e.split("||").map(S1)),S5=S2([[{_tag:"Comparator",operator:"=",version:{components:[],prerelease:[]}}]]),S8=e=>{if(0===e.components.length)return"*";let t=e.components.join(".");return 0===e.prerelease.length?t:`${t}-${e.prerelease.join(".")}`},S4=e=>"Hyphen"===e._tag?`${S8(e.from)} - ${S8(e.to)}`:`${"="===e.operator?"":e.operator}${S8(e.version)}`,S6=e=>e.sets.map(e=>e.map(S4).join(" ")).join(" || ");function S9(){return(e,t,r)=>ki(new y1(e.map(vN),e=>t(e.map(e=>ki(e))),r))}function S7(e,t){return S9()([],()=>(t,r,n)=>e(t)?lI(t):r8(new bL(r,t,n)),t)}class ke extends om("SchemaError"){[wH]=wH;constructor(e){let t=Error.stackTraceLimit;rg(0);try{super({issue:e})}finally{rg(t)}}get message(){return bX(this.issue)}toJSON(){return{_tag:this._tag,message:this.message}}[rc](){return this.toJSON()}toString(){return`SchemaError(${this.message})`}}function kt(e){var t;return ur(e)?"Success"===(t=e)._tag?t:r5(o7(t.cause,e=>new ke(e))):uU(e,e=>h4(()=>o7(e,e=>new ke(e))))}function kr(e,t){let r=wn(e,t);return(e,t)=>kt(r(e,t))}function kn(e,t){let r=wi(e,t);return(e,t)=>kt(r(e,t))}let ki=wm;function ks(e){return tx(e,wh)&&e[wh]===wh}let ka=e=>{let t=kk(e);return ki(xc(e.ast),{schema:t})};function ko(e){let t=ki(new vo(e),{literal:e,transform:r=>t.pipe(k_(ko(r),{decode:b9(()=>r),encode:b9(()=>e)}))});return t}let kl=ki(y9),ku=ki(ve),kc=ki(y8),kf=ki(vu),kd=ki(vf),kh=ki(vd),kp=ki(vp),kg=ki(y4);function km(e,t){return ki(e,{fields:t,mapFields(e,t){let r=e(this.fields);return km(vO(r,t?.unsafePreserveChecks?this.ast.checks:void 0),r)}})}function kb(e){return km(vO(e,void 0),e)}function ky(e,t){return ki(xg(e.ast,t.ast),{key:e,value:t})}let kv=e=>ki(new vg(!1,[],[e.ast]),{value:e}),kx=e=>ki(new vg(!1,[e.ast],[e.ast]),{value:e});function kw(e,t){return function e(t,r){return ki(t,{members:r,mapMembers(t,r){let n=t(this.members);return e(vU(n,this.ast.options,r?.unsafePreserveChecks?this.ast.checks:void 0),n)}})}(vU(e,t,void 0),e)}function kS(e){let t=e.map(ko);return ki(vU(t,void 0,void 0),{literals:e,members:t,mapMembers(e){return kw(e(this.members))},pick:e=>kS(e),transform:e=>kw(t.map((t,r)=>t.transform(e[r])))})}let kk=e=>kw([e,kc]);function kE(e){return t=>ki(t.ast,{schema:t,identifier:e})}function k_(e,t){return r=>ki(xp(r.ast,e.ast,t?yh(t):yy()),{from:r,to:e})}function kC(e){var t;return ko(e).pipe((t=lI(e),e=>ki(xh(e.ast,t),{schema:e})))}function kA(e,t){return kb({_tag:kC(e),...t})}function kI(e,t){return S7(t=>t instanceof e,t)}function kT(){return(e,t)=>new yY(e.ast,yh(t))}let kO="^\\S[\\s\\S]*\\S$|^\\S$|^$",kN=ki(vZ);function kM(e){let t=nL(e.order),r=e.formatter??ri;return(n,i)=>vG(e=>t(e,n),{expected:`a value greater than or equal to ${r(n)}`,arbitraryConstraint:{order:e.order,minimum:n},...e.annotate?.(n),...i})}function kU(e){if(!globalThis.Number.isFinite(e))throw new globalThis.RangeError(`Expected a finite number, got ${ri(e)}`);return e}let k$=kM({order:nU,annotate:e=>({representation:{id:"effect/schema/isGreaterThanOrEqualTo",payload:{minimum:kU(e)}},toJsonSchema:()=>({minimum:e}),toCode:()=>({runtime:`Schema.isGreaterThanOrEqualTo(${ri(e)})`})})}),kj=(w=nL((Er={order:nU,annotate:e=>{let t=!!e.exclusiveMinimum||void 0,r=!!e.exclusiveMaximum||void 0;return{representation:{id:"effect/schema/isBetween",payload:{minimum:kU(e.minimum),maximum:kU(e.maximum),...t&&{exclusiveMinimum:t},...r&&{exclusiveMaximum:r}}},toJsonSchema:()=>({[t?"exclusiveMinimum":"minimum"]:e.minimum,[r?"exclusiveMaximum":"maximum"]:e.maximum}),toCode:()=>({runtime:`Schema.isBetween({ minimum: ${ri(e.minimum)}, maximum: ${ri(e.maximum)}, exclusiveMinimum: ${ri(t)}, exclusiveMaximum: ${ri(r)} })`})}}}).order),S=nP(Er.order),k=nR(Er.order),E=nB(Er.order),_=Er.formatter??ri,(e,t)=>{let r=e.exclusiveMinimum?S:w,n=e.exclusiveMaximum?E:k;return vG(t=>r(t,e.minimum)&&n(t,e.maximum),{expected:`a value between ${_(e.minimum)}${e.exclusiveMinimum?" (excluded)":""} and ${_(e.maximum)}${e.exclusiveMaximum?" (excluded)":""}`,arbitraryConstraint:{order:Er.order,minimum:e.minimum,maximum:e.maximum,...e.exclusiveMinimum&&{exclusiveMinimum:!0},...e.exclusiveMaximum&&{exclusiveMaximum:!0}},...Er.annotate?.(e),...t})}),kB=kd.check(vG(e=>globalThis.Number.isSafeInteger(e),{expected:"an integer",representation:{id:"effect/schema/isInt",payload:null},toJsonSchema:()=>({type:"integer",minimum:globalThis.Number.MIN_SAFE_INTEGER,maximum:globalThis.Number.MAX_SAFE_INTEGER}),toCode:()=>({runtime:"Schema.isInt()"}),arbitraryConstraint:{number:"integer"}})),kP=kB.check(k$(0));function kR(e){if(!globalThis.Number.isFinite(e))throw new globalThis.RangeError(`Expected a finite number, got ${e}`);return Math.max(0,Math.floor(e))}vG(e=>e.length>=1,{expected:"a value with a length of at least 1",representation:{id:"effect/schema/isMinLength",payload:{minLength:1}},toJsonSchema:({type:e})=>"string"===e?{minLength:1}:"array"===e?{minItems:1}:void 0===e?[{minLength:1,minItems:1},!0]:[{},!0],toCode:()=>({runtime:"Schema.isMinLength(1)"}),[bw]:!0,arbitraryConstraint:{minLength:1},...void 0});let kL=[];function kF(e){let t=e?.includeStack===!0|2*(e?.excludeCause===!0),r=kL[t];if(void 0!==r)return r;let n=k7.pipe(k_(ku,yT((e=>{switch(e){case 0:return;case 1:return{includeStack:!0};case 2:return{excludeCause:!0};case 3:return{includeStack:!0,excludeCause:!0}}})(t))));return kL[t]=n,n}let kD=kf.annotate({expected:"a string that will be decoded as JSON"});function kz(e,t){return kD.pipe(k_(e,yB(t)))}let kH=kz(ku),kJ=(kf.annotate({expected:"a string that will be decoded as a finite number"})).pipe(k_(kN,yv));C=new globalThis.RegExp(kO),vG(e=>e.trim()===e,{expected:"a string with no leading or trailing whitespace",representation:{id:"effect/schema/isTrimmed",payload:null},toJsonSchema:()=>({pattern:C.source}),toCode:()=>({runtime:"Schema.isTrimmed()"}),arbitraryConstraint:{patterns:[{source:kO,flags:""}]}});let kW=kf.annotate({expected:"a base64 encoded string that will be decoded as Uint8Array",format:"byte",contentEncoding:"base64"}),kq=kI(globalThis.Uint8Array,{representation:{id:"effect/schema/Uint8Array",payload:null},toCode:()=>({runtime:"Schema.Uint8Array",Type:"globalThis.Uint8Array"}),expected:"Uint8Array",toCodecJson:()=>kT()(kW,yN)});function kK(e,t){return ki(S9()([e,t],([e,t])=>(r,n,i)=>{if(!fF(r))return r8(new bL(n,r,i));switch(r._tag){case"Fail":return uo(wn(e)(r.error,i),{onSuccess:fD,onFailure:e=>bD(n,"error",e,r,i)});case"Die":return uo(wn(t)(r.defect,i),{onSuccess:fz,onFailure:e=>bD(n,"defect",e,r,i)});case"Interrupt":return lI(r)}},{representation:{id:"effect/schema/CauseReason",payload:null},toCode:({typeParameters:e})=>({runtime:`Schema.CauseReason(${e[0].runtime}, ${e[1].runtime})`,Type:`Cause.Failure<${e[0].Type}, ${e[1].Type}>`,importDeclarations:['import * as Cause from "effect/Cause"']}),expected:"Cause.Failure",toCodec:([e,t])=>kT()(kw([kb({_tag:ko("Fail"),error:e}),kb({_tag:ko("Die"),defect:t}),kb({_tag:ko("Interrupt"),fiberId:kk(kN)})]),yg({decode:e=>{switch(e._tag){case"Fail":return fD(e.error);case"Die":return fz(e.defect);case"Interrupt":return fH(e.fiberId)}},encode:e=>{switch(e._tag){case"Fail":return{_tag:"Fail",error:e.error};case"Die":return{_tag:"Die",defect:e.defect};case"Interrupt":return{_tag:"Interrupt",fiberId:e.fiberId}}}}))}).ast,{error:e,defect:t})}b7((e,t)=>sb(oC(e),{onFailure:()=>r8(new bF({expected:"a valid hexadecimal string"},e,t)),onSuccess:lI})),b9(ov);let kV=yp({decode:(e,t)=>nF(dj(e),{onNone:()=>r8(new bF({expected:"a valid UTC DateTime string"},e,t)),onSome:e=>lI(dI(e.epochMilliseconds))}),encode:e=>lI(dH(e).toISOString())}),kG=["UTC","Europe/London","America/New_York","Asia/Tokyo","Australia/Sydney"];function kY(e,t){return kB.check(kj({minimum:e,maximum:t}))}e=>d_(e)&&"Utc"===e._tag;let kZ=S7(aZ,{representation:{id:"effect/schema/Duration",payload:null},toCode:()=>({runtime:"Schema.Duration",Type:"Duration.Duration",importDeclarations:['import * as Duration from "effect/Duration"']}),expected:"Duration",toCodecJson:()=>kT()(kw([kb({_tag:ko("Infinity")}),kb({_tag:ko("NegativeInfinity")}),kb({_tag:ko("Nanos"),value:kp}),kb({_tag:ko("Millis"),value:kB})]),yg({decode:e=>{switch(e._tag){case"Infinity":return a1;case"NegativeInfinity":return a2;case"Nanos":return a3(e.value);case"Millis":return a5(e.value)}},encode:e=>{switch(e.value._tag){case"Infinity":return{_tag:"Infinity"};case"NegativeInfinity":return{_tag:"NegativeInfinity"};case"Nanos":return{_tag:"Nanos",value:e.value.nanos};case"Millis":return{_tag:"Millis",value:e.value.millis}}}}))});e=>tx(e,gX);let kX=S7(m2,{representation:{id:"effect/http/UrlParams",payload:null},toCode:()=>({runtime:"Schema.UrlParams",Type:"UrlParams.UrlParams",importDeclarations:['import * as UrlParams from "effect/http/UrlParams"']}),expected:"UrlParams",toEquivalence:()=>m9,toCodec:()=>{var e;return kT()(kv(function e(t,r){return ki(t,{elements:r,mapElements(t,r){let n=t(this.elements);return e(vM(n,r?.unsafePreserveChecks?this.ast.checks:void 0),n)}})}(vM(e=[kf,kf]),e)),yg({decode:m5,encode:e=>e.params.map(([e,t])=>[e,mG(t)])}))}}),kQ=kX.pipe(k_(ky(kf,kw([kf,kx(kf)])),yg({decode:bl,encode:m8}))),k0=(e,t)=>yp({decode:(t,r)=>ua(lM(e(t)),e=>new bF({message:e.message},t,r)),encode:e=>lI(t(e))}),k1=((M=(En=/^[0-9]*[A-Za-z-][0-9A-Za-z-]*$/).source,U=En.flags,$=/^[dg]*uy?$/.test(U),j=""===U?`new globalThis.RegExp(${ri(M)})`:`new globalThis.RegExp(${ri(M)}, ${ri(U)})`,vQ(En,{toJsonSchema:()=>$?{pattern:U.endsWith("y")?`^(?:${M})`:M}:[{},!0],toCode:()=>({runtime:`Schema.isPattern(${j})`})})),globalThis.Symbol.for("immer-draftable")),k2={};function k3(e,t){return new e(t,{"~payload":{token:k2,value:t}})}function k5(e){return`~effect/Schema/Class/${e}`}let k8=e=>(t,r)=>(function e(t,r,n,i,s){var a,o,l;let u,c=(a=n,o=r,l=i,e=>{if(void 0!==u)return u;let t=k5(o),r=r=>r instanceof e||tx(r,t),n=new yd(b9(t=>k3(e,t)),b6);return u=k_(ki(new y1([a.ast],()=>(e,t,n)=>r(e)?lI(e):r8(new bL(t,e,n)),{identifier:o,[bk]:([e])=>({isConstructed:r,link:new yY(e,n)}),toCodec:([e])=>new yY(e.ast,n),toEquivalence:([e])=>e,toFormatter:([t])=>r=>`${e.identifier}(${t(r)})`,[bS]:vj(a.ast),...l})),n)(a)}),f=k5(r),d=class extends t{constructor(...[e,t]){let r=t?.["~payload"],i=r?.token===k2?r.value:n.make(e??{},t);super(i,{...t,disableChecks:!0,"~payload":{token:k2,value:i}})}static [wh]=wh;get[f](){return f}static [k1]=!0;static identifier=r;static fields=n.fields;static get ast(){return c(this).ast}static pipe(){return eV(this,arguments)}static rebuild(e){return c(this).rebuild(e)}static make(e,t){return function(e,t,r,n){let i=we(e),s=xF(e);if(void 0===s||void 0!==i.make||void 0!==i.compiledMakeEffect)return wc(i,t,r);if(s.isConstructed(t))return t;let a=wc((i.resolve??we)(s.link.to),t,r);try{return n(a)}catch(e){wu(e)}}(xb(c(this).ast),e??{},t,e=>k3(this,e))}static makeOption(e,t){return wr(c(this))(e??{},t)}static makeEffect(e,t){return c(this).makeEffect(e??{},t)}static annotate(e){return this.rebuild(v4(this.ast,e))}static annotateKey(e){return this.rebuild(xo(this.ast,e))}static check(...e){return this.rebuild(v9(this.ast,e))}static extend(t){return(r,i)=>{let a=ks(r)?r:kb(r),o={...n.fields,...a.fields},l=vO(o,n.ast.checks,{identifier:t});return e(this,t,km(v9(l,a.ast.checks),o),i,s)}}static mapFields(e,t){return n.mapFields(e,t)}};return void 0!==s&&Object.assign(d.prototype,s(r)),d})(ne,e,ks(t)?t:kb(t),r,e=>({name:e})),k4=e=>(t,r,n)=>{let i=ks(r)?r.mapFields(e=>({_tag:kC(t),...e}),{unsafePreserveChecks:!0}):kA(t,r);return k8(e??t)(i,n)},k6=function(e){return wm(wb(e.ast),{schema:e})},k9=function(e){return wm(wT(e.ast),{schema:e})},k7=ki(v4(xW,{toCode:()=>({runtime:"Schema.Json",Type:"Schema.Json"})}));e.s(["Array",0,kv,"Boolean",0,kh,"Cause",0,function(e,t){return ki(S9()([e,t],([e,t])=>{let r=kv(kK(e,t));return(e,t,n)=>r$(e)?uo(wn(r)(e.reasons,n),{onSuccess:rF,onFailure:r=>bD(t,"reasons",r,e,n)}):r8(new bL(t,e,n))},{representation:{id:"effect/schema/Cause",payload:null},toCode:({typeParameters:e})=>({runtime:`Schema.Cause(${e[0].runtime}, ${e[1].runtime})`,Type:`Cause.Cause<${e[0].Type}, ${e[1].Type}>`,importDeclarations:['import * as Cause from "effect/Cause"']}),expected:"Cause",toCodec:([e,t])=>kT()(kv(kK(e,t)),yg({decode:rF,encode:({reasons:e})=>e}))}).ast,{error:e,defect:t})},"Defect",0,kF,"Error",0,k8,"FiniteFromString",0,kJ,"Int",0,kB,"Json",0,k7,"JsonFromUrlParamsField",0,(e,t)=>kX.pipe(k_(kz(ku,t),yp({decode:t=>nF(bt(t,e),{onNone:()=>r8(new bj([e],new bB(void 0))),onSome:lI}),encode:t=>lI(m5([[e,t]]))}))),"Literal",0,ko,"Literals",0,kS,"Never",0,kl,"NonEmptyArray",0,kx,"Number",0,kd,"Record",0,ky,"RecordFromUrlParams",0,kQ,"SchemaError",0,ke,"String",0,kf,"Struct",0,kb,"TaggedError",0,k4,"Uint8Array",0,kq,"Undefined",0,kc,"UndefinedOr",0,kk,"Union",0,kw,"Unknown",0,ku,"UnknownFromJsonString",0,kH,"Void",0,kg,"brand",0,kE,"declare",0,S7,"decodeEffect",0,kr,"decodeTo",0,k_,"decodeUnknownEffect",0,kr,"encodeEffect",0,kn,"encodeSync",0,function(e,t){let r=kn(e,t);return(e,t)=>(function(e){let t=c7(e);if("Success"===t._tag)return t.value;throw function(e,t){let r;for(let n of e.reasons){if(!rV(n)||!wJ(n.error))throw new globalThis.Error(t,{cause:e});r??=n.error}if(void 0===r)throw new globalThis.Error(t,{cause:e});return r}(t.cause,"Sync adapter can only throw schema errors")})(r(e,t))},"encodeUnknownEffect",0,kn,"fromJsonString",0,kz,"instanceOf",0,kI,"isBetweenLength",0,function(e,t,r){return e=kR(e),t=kR(t),vG(r=>r.length>=e&&r.length<=t,{expected:e===t?`a value with a length of ${e}`:`a value with a length between ${e} and ${t}`,representation:{id:"effect/schema/isBetweenLength",payload:{minimum:e,maximum:t}},toJsonSchema:({type:r})=>"string"===r?0===t||Math.ceil(e/2)>t?{minLength:Math.ceil(e/2),maxLength:t}:[{minLength:Math.ceil(e/2),maxLength:t},!0]:"array"===r?{minItems:e,maxItems:t}:void 0===r?[{minLength:Math.ceil(e/2),maxLength:t,minItems:e,maxItems:t},!0]:[{},!0],toCode:()=>({runtime:`Schema.isBetweenLength(${e}, ${t})`}),[bw]:!0,arbitraryConstraint:{minLength:e,maxLength:t},...r})},"isSchema",0,ks,"link",0,kT,"make",0,ki,"optional",0,ka,"optionalKey",0,e=>ki(xl(e.ast),{schema:e}),"tag",0,kC,"toCodecJson",0,k6,"toCodecStringTree",0,k9,"toType",0,e=>ki(xb(e.ast),{schema:e})],94831);var Ee,Et,Er,En,Ei=e.i(94831),Ei=Ei,Es=Ei;e.s(["f",0,Es],26547);var Es=Ei,Ea=Ei,Eo=Ei,El=Ei,Eu=Ei,Ec=Ei,Ef=Ei,Ed=Ei,Eh=Ei;e.s(["f",0,Eh],20412);var Eh=Ei,Ep=Ei,Eg=Ei,Em=Ei;function Eb(e){return"GET"!==e&&"HEAD"!==e&&"OPTIONS"!==e&&"TRACE"!==e}let Ey=[["GET","get"],["POST","post"],["PUT","put"],["DELETE","del"],["PATCH","patch"],["HEAD","head"],["OPTIONS","options"],["TRACE","trace"],["QUERY","query"]];e.s(["B",0,Ey,"T",0,Eb],57732);let Ev=/\+/g,Ex=function(){};function Ew(e){let t=new Ex;if("string"!=typeof e)return t;let r=e.length,n="",i="",s=-1,a=-1,o=!1,l=!1,u=!1,c=!1,f=!1,d=0;for(let h=0;h<r+1;h++)if(38===(d=h!==r?e.charCodeAt(h):38)){if((f=a>s)||(a=h),n=e.slice(s+1,a),f||n.length>0){if(u&&(n=n.replace(Ev," ")),o)try{n=decodeURIComponent(n)||n}catch{}if(f&&(i=e.slice(a+1,h),c&&(i=i.replace(Ev," ")),l))try{i=decodeURIComponent(i)||i}catch{}let r=t[n];void 0===r?t[n]=i:r.pop?r.push(i):t[n]=[r,i]}i="",s=h,a=h,o=!1,l=!1,u=!1,c=!1}else 61===d?a<=s?a=h:l=!0:43===d?a>s?c=!0:u=!0:37===d&&(a>s?l=!0:o=!0);return t}Ex.prototype=Object.create(null);let ES=/^https?:\/\/.*?\//,Ek=/(\/:[^/()]*?)\?(\/?)/,EE=[],E_=/^[^:*(]*\/:[^/:*(.-]+$/;class EC{constructor(e={}){this.options={ignoreTrailingSlash:!0,ignoreDuplicateSlashes:!0,caseSensitive:!1,maxParamLength:100,...e}}options;maxParamLengthExceeded=!1;routes=[];trees=Object.create(null);staticRoutes=Object.create(null);singleParamRoutes=Object.create(null);singleParamDisabled=Object.create(null);brothersNodesStack=[];singleParamArray=[""];on(e,t,r){let n=t.match(Ek);if(n&&void 0!==n.index){EU(t.length===n.index+n[0].length,"Optional Parameter needs to be the last parameter of the path");let i=t.replace(Ek,"$1$2"),s=t.replace(Ek,"$2")||"/";this.on(e,i,r),this.on(e,s,r);return}for(let n of(this.options.ignoreDuplicateSlashes&&(t=E$(t)),this.options.ignoreTrailingSlash&&(t=Ej(t)),"string"==typeof e?[e]:e))this._on(n,t,r)}all(e,t){this.on(EL,e,t)}_on(e,t,r){void 0===this.trees[e]&&(this.trees[e]=new EO("/"));let n=t;if("*"===n&&0!==this.trees[e].prefix.length){let t=this.trees[e];this.trees[e]=new EO(""),this.trees[e].staticChildren["/"]=t}let i=this.trees[e].prefix.length,s=this.trees[e],a=[];for(let e=0;e<=n.length;e++){if(58===n.charCodeAt(e)&&58===n.charCodeAt(e+1)){e++;continue}let t=58===n.charCodeAt(e)&&58!==n.charCodeAt(e+1),r=42===n.charCodeAt(e);if(t||r||e===n.length&&e!==i){let t=n.slice(i,e);this.options.caseSensitive||(t=t.toLowerCase()),t=(t=t.split("::").join(":")).split("%").join("%25"),s=s.createStaticChild(t)}if(t){let t=!1,r=!0,l="",u=[],c="",f=e+1;for(let d=f;;d++){let h=n.charCodeAt(d),p=40===h,g=45===h||46===h,m=47===h||d===n.length;if(p||g||m){let h=n.slice(f,d);if(a.push(h),t=t||p||g,p){var o;let e=EB(n,d),t=n.slice(d,e+1);u.push((94===(o=t).charCodeAt(1)&&(o=o.slice(0,1)+o.slice(2)),36===o.charCodeAt(o.length-2)&&(o=o.slice(0,o.length-2)+o.slice(o.length-1)),o)),d=e+1,r=!0}else u.push(r?"(.*?)":`(${l}|(?:(?!${l}).)*)`),r=!1;let b=d;for(;d<n.length;d++){let e=n.charCodeAt(d);if(47===e)break;if(58===e)if(58===n.charCodeAt(d+1))d++;else break}let y=n.slice(b,d);if(y&&(y=(y=y.split("::").join(":")).split("%").join("%25"),u.push(l=y.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"))),f=d+1,c+="()"+y,m||47===n.charCodeAt(d)||d===n.length){let r=t?c:y,a=n.slice(e,d);n=n.slice(0,e+1)+r+n.slice(d),e+=r.length;let o=t?RegExp("^"+u.join("")+"$"):void 0;s=s.createParametricChild(o,y,a),i=e+1;break}}}}else if(r&&(a.push("*"),s=s.createWildcardChild(),i=e+1,e!==n.length-1))throw Error("Wildcard must be the last character in the route")}for(let t of(this.options.caseSensitive||(n=n.toLowerCase()),"*"===n&&(n="/*"),this.routes))if(t.method===e&&t.pattern===n)throw Error(`Method '${e}' already declared for route '${n}'`);let l={method:e,path:t,pattern:n,params:a,handler:r};if(this.routes.push(l),s.addRoute(l),0===a.length){let t=n.split("::").join(":").split("%").join("%25"),r=this.staticRoutes[e]??=new Map;r.has(t)||r.set(t,s.handlerStorage.unconstrainedHandler)}else if(E_.test(t)){if(!0!==this.singleParamDisabled[e]){let r=t.slice(0,t.indexOf(":"));this.options.caseSensitive||(r=r.toLowerCase()),r=r.split("%").join("%25");let n=this.singleParamRoutes[e]??=new Map;n.has(r)||n.set(r,s.handlerStorage.unconstrainedHandler)}}else/[(*]|[^/]:|:[^/]*[-.]/.test(t)&&(this.singleParamDisabled[e]=!0,delete this.singleParamRoutes[e])}has(e,t){let r=this.trees[e];if(void 0===r)return!1;let n=r.getStaticChild(t);return void 0!==n&&n.isLeafNode}find(e,t){this.maxParamLengthExceeded=!1;let r=this.trees[e];if(void 0===r)return;let n="",i=!1,s=47===t.charCodeAt(0)&&(1===t.length||47!==t.charCodeAt(t.length-1));if(s)for(let e=1;e<t.length;e++){let r=t.charCodeAt(e);if(37===r||63===r||59===r||35===r||r>=65&&r<=90||47===r&&47===t.charCodeAt(e-1)){s=!1;break}}if(!s){let e;47!==t.charCodeAt(0)&&(t=t.replace(ES,"/"));try{t=(e=function(e){let t=!1,r=!1,n="";for(let i=1;i<e.length;i++){let s=e.charCodeAt(i);if(37===s){let n=e.charCodeAt(i+1),s=e.charCodeAt(i+2);void 0===EP(n,s)?t=!0:(r=!0,50===n&&53===s&&(t=!0,e=e.slice(0,i+1)+"25"+e.slice(i+1),i+=2),i+=2)}else if(63===s||59===s||35===s){n=e.slice(i+1),e=e.slice(0,i);break}}return{path:t?decodeURI(e):e,querystring:n,shouldDecodeParam:r}}(t)).path,n=e.querystring,i=e.shouldDecodeParam}catch(e){return}this.options.ignoreDuplicateSlashes&&(t=E$(t)),this.options.ignoreTrailingSlash&&(t=Ej(t))}let a=t;s||!1!==this.options.caseSensitive||(t=t.toLowerCase());let o=this.options.maxParamLength,l=this.staticRoutes[e];if(void 0!==l){let e=l.get(t);if(void 0!==e)return{handler:e.handler,params:e.createParams(EE),searchParams:Ew(n)}}let u=this.singleParamRoutes[e];if(void 0!==u){let e=t.lastIndexOf("/")+1,r=u.get(t.slice(0,e));if(void 0!==r&&t.length>e){let t=a.slice(e);if(i&&(t=ER(t)),t.length<=o)return this.singleParamArray[0]=t,{handler:r.handler,params:r.createParams(this.singleParamArray),searchParams:Ew(n)};this.maxParamLengthExceeded=!0}}let c=r.prefix.length,f=[],d=t.length,h=this.brothersNodesStack;for(h.length=0;;){if(c===d&&r.isLeafNode){let e=r.handlerStorage?.find();if(void 0!==e)return{handler:e.handler,params:e.createParams(f),searchParams:Ew(n)}}let e=r.getNextNode(t,c,h,f.length);if(void 0===e){if(0===h.length)return;let t=h.pop();c=t.brotherPathIndex,f.splice(t.paramsCount),e=t.brotherNode}for(r=e;;){if("StaticNode"===r._tag){c+=r.prefix.length;break}if("WildcardNode"===r._tag){let e=a.slice(c);i&&(e=ER(e)),f.push(e),c=d;break}let e=a.indexOf("/",c);-1===e&&(e=d);let t=a.slice(c,e);if(i&&(t=ER(t)),void 0!==r.regex){let e=r.regex.exec(t);if(null===e){if(0===h.length)return;let e=h.pop();c=e.brotherPathIndex,f.splice(e.paramsCount),r=e.brotherNode;continue}let n=!1;for(let t=1;t<e.length;t++)if((e[t]??"").length>o){n=!0,this.maxParamLengthExceeded=!0;break}if(n){if(0===h.length)return;let e=h.pop();c=e.brotherPathIndex,f.splice(e.paramsCount),r=e.brotherNode;continue}for(let t=1;t<e.length;t++)f.push(e[t]??"")}else{if(t.length>o){if(this.maxParamLengthExceeded=!0,0===h.length)return;let e=h.pop();c=e.brotherPathIndex,f.splice(e.paramsCount),r=e.brotherNode;continue}f.push(t)}c=e;break}}}}class EA{handlers=[];unconstrainedHandler;find(){return this.unconstrainedHandler}add(e){var t;let r,n={params:e.params,handler:e.handler,createParams:0===(r=(t=e.params).length)?()=>Object.create(null):function(e){let n=Object.create(null);for(let i=0;i<r;i++)n[t[i]]=e[i];return n}};this.handlers.push(n),this.unconstrainedHandler=this.handlers[0]}}class EI{isLeafNode=!1;routes;handlerStorage;addRoute(e){void 0===this.routes?this.routes=[e]:this.routes.push(e),void 0===this.handlerStorage&&(this.handlerStorage=new EA),this.isLeafNode=!0,this.handlerStorage.add(e)}}class ET extends EI{staticChildren=Object.create(null);findStaticMatchingChild(e,t){let r=this.staticChildren[e.charAt(t)];if(void 0!==r&&r.matchPrefix(e,t))return r}getStaticChild(e,t=0){if(e.length===t)return this;let r=this.findStaticMatchingChild(e,t);if(void 0!==r)return r.getStaticChild(e,t+r.prefix.length)}createStaticChild(e){if(0===e.length)return this;let t=this.staticChildren[e.charAt(0)];if(t){let r=1;for(;r<t.prefix.length;r++)if(e.charCodeAt(r)!==t.prefix.charCodeAt(r)){t=t.split(this,r);break}return t.createStaticChild(e.slice(r))}let r=e.charAt(0);return this.staticChildren[r]=new EO(e),this.staticChildren[r]}}class EO extends ET{_tag="StaticNode";constructor(e){super(),this.setPrefix(e)}prefix;matchPrefix;parametricChildren=[];wildcardChild;setPrefix(e){if(this.prefix=e,1===e.length)this.matchPrefix=(e,t)=>!0;else{let t=e.slice(1);this.matchPrefix=(e,r)=>e.startsWith(t,r+1)}}getParametricChild(e){if(void 0===e)return this.parametricChildren.find(e=>!1===e.isRegex);let t=e.source;return this.parametricChildren.find(e=>void 0!==e.regex&&e.regex.source===t)}createParametricChild(e,t,r){let n=this.getParametricChild(e);return void 0!==n?n.nodePaths.add(r):(n=new EN(e,t,r),this.parametricChildren.push(n),this.parametricChildren.sort((e,t)=>e.isRegex?t.isRegex?void 0===e.staticSuffix?1:void 0===t.staticSuffix?-1:t.staticSuffix.endsWith(e.staticSuffix)?1:e.staticSuffix.endsWith(t.staticSuffix)?-1:0:-1:1)),n}createWildcardChild(){return void 0===this.wildcardChild&&(this.wildcardChild=new EM),this.wildcardChild}split(e,t){let r=this.prefix.slice(0,t),n=this.prefix.slice(t);this.setPrefix(n);let i=new EO(r);return i.staticChildren[n.charAt(0)]=this,e.staticChildren[r.charAt(0)]=i,i}getNextNode(e,t,r,n){let i=this.findStaticMatchingChild(e,t),s=0;if(void 0===i){if(0===this.parametricChildren.length)return this.wildcardChild;i=this.parametricChildren[0],s=1}void 0!==this.wildcardChild&&r.push({paramsCount:n,brotherPathIndex:t,brotherNode:this.wildcardChild});for(let e=this.parametricChildren.length-1;e>=s;e--)r.push({paramsCount:n,brotherPathIndex:t,brotherNode:this.parametricChildren[e]});return i}}class EN extends ET{_tag="ParametricNode";regex;staticSuffix;constructor(e,t,r){super(),this.regex=e,this.staticSuffix=t,this.isRegex=!!e,this.nodePaths=new Set([r])}isRegex;nodePaths;getNextNode(e,t){return this.findStaticMatchingChild(e,t)}}class EM extends EI{_tag="WildcardNode";getNextNode(e,t,r,n){}}let EU=(e,t)=>{if(!e)throw Error(t)};function E$(e){return -1===e.indexOf("//")?e:e.replace(/\/\/+/g,"/")}function Ej(e){return e.length>1&&47===e.charCodeAt(e.length-1)?e.slice(0,-1):e}function EB(e,t){let r=1;for(;t<e.length;){if("\\"===e[++t]){t++;continue}if(")"===e[t]?r--:"("===e[t]&&r++,!r)return t}throw TypeError('Invalid regexp expression in "'+e+'"')}function EP(e,t){return 50===e?53===t?"%":51===t?"#":52===t?"$":54===t?"&":66===t||98===t?"+":67===t||99===t?",":70===t||102===t?"/":void 0:51===e?65===t||97===t?":":66===t||98===t?";":68===t||100===t?"=":70===t||102===t?"?":void 0:52===e&&48===t?"@":void 0}function ER(e){let t=e.indexOf("%");if(-1===t)return e;let r="",n=t;for(let i=t;i<e.length;i++)if(37===e.charCodeAt(i)){if(i+2>=e.length)break;let t=EP(e.charCodeAt(i+1),e.charCodeAt(i+2));r+=e.slice(n,i)+t,n=i+3}return e.slice(0,t)+r+e.slice(n)}let EL=["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","QUERY","REBIND","REPORT","SEARCH","SOURCE","SUBSCRIBE","TRACE","UNBIND","UNLINK","UNLOCK","UNSUBSCRIBE"];e.s(["g",0,EB,"_",0,e=>e.maxParamLengthExceeded?e.options.maxParamLength:void 0,"h",0,(e={})=>new EC(e)],91642);let EF="~effect/Chunk";function ED(e,t,r,n,i){for(let s=t;s<Math.min(e.length,t+i);s++)r[n+s-t]=e[s];return r}let Ez=[],EH=t8((e,t)=>{if(e.length!==t.length)return!1;let r=EG(e),n=EG(t);for(let e=0;e<r.length;e++)if(!tK(r[e],n[e]))return!1;return!0}),EJ={[EF]:{_A:e=>e},toString(){return`Chunk(${ri(EG(this))})`},toJSON(){return{_id:"Chunk",values:rf(EG(this))}},[rc](){return this.toJSON()},[tq](e){return Eq(e)&&EH(this,e)},[tC](){return tL(EG(this))},[Symbol.iterator](){switch(this.backing._tag){case"IArray":return this.backing.array[Symbol.iterator]();case"IEmpty":return Ez[Symbol.iterator]();default:return EG(this)[Symbol.iterator]()}},pipe(){return eV(this,arguments)}},EW=e=>{let t=Object.create(EJ);switch(t.backing=e,e._tag){case"IEmpty":t.length=0,t.depth=0,t.left=t,t.right=t;break;case"IConcat":t.length=e.left.length+e.right.length,t.depth=1+Math.max(e.left.depth,e.right.depth),t.left=e.left,t.right=e.right;break;case"IArray":t.length=e.array.length,t.depth=0,t.left=EK,t.right=EK;break;case"ISingleton":t.length=1,t.depth=0,t.left=EK,t.right=EK;break;case"ISlice":t.length=e.length,t.depth=0,t.left=EK,t.right=EK}return t},Eq=e=>tx(e,EF),EK=EW({_tag:"IEmpty"}),EV=(e,t,r)=>{switch(e.backing._tag){case"IArray":ED(e.backing.array,0,t,r,e.length);break;case"IConcat":EV(e.left,t,r),EV(e.right,t,r+e.left.length);break;case"ISingleton":t[r]=e.backing.a;break;case"ISlice":ED(EG(e.backing.chunk),e.backing.offset,t,r,e.length)}},EG=e=>{switch(e.backing._tag){case"IEmpty":return Ez;case"IArray":return e.backing.array;default:{let t=Array(e.length);return EV(e,t,0),e.backing={_tag:"IArray",array:t},e.left=EK,e.right=EK,e.depth=0,t}}},EY=e=>0===e.length?EK:1===e.length?EW({_tag:"ISingleton",a:e[0]}):EW({_tag:"IArray",array:e}),EZ=(e,t)=>{switch(e.backing._tag){case"IEmpty":throw Error(`Index out of bounds: ${t}`);case"ISingleton":return e.backing.a;case"IArray":return e.backing.array[t];case"IConcat":return t<e.left.length?EZ(e.left,t):EZ(e.right,t-e.left.length);case"ISlice":return EZ(e.backing.chunk,t+e.backing.offset)}},EX=eZ(2,(e,t)=>{let r=sd(t);if(r<=0)return EK;if(r>=e.length)return e;switch(e.backing._tag){case"ISlice":return EW({_tag:"ISlice",chunk:e.backing.chunk,length:r,offset:e.backing.offset});case"IConcat":if(r>e.left.length)return EW({_tag:"IConcat",left:e.left,right:EX(e.right,r-e.left.length)});return EX(e.left,r);default:return EW({_tag:"ISlice",chunk:e,offset:0,length:r})}}),EQ=eZ(2,(e,t)=>{let r=sd(t);if(r<=0)return e;if(r>=e.length)return EK;switch(e.backing._tag){case"ISlice":return EW({_tag:"ISlice",chunk:e.backing.chunk,offset:e.backing.offset+r,length:e.backing.length-r});case"IConcat":if(r>e.left.length)return EQ(e.right,r-e.left.length);return EW({_tag:"IConcat",left:EQ(e.left,r),right:e.right});default:return EW({_tag:"ISlice",chunk:e,offset:r,length:e.length-r})}}),E0=eZ(2,(e,t)=>{if("IEmpty"===e.backing._tag)return t;if("IEmpty"===t.backing._tag)return e;let r=t.depth-e.depth;if(1>=Math.abs(r))return EW({_tag:"IConcat",left:e,right:t});if(r<-1)if(e.left.depth>=e.right.depth){let r=E0(e.right,t);return EW({_tag:"IConcat",left:e.left,right:r})}else{let r=E0(e.right.right,t);if(r.depth===e.depth-3){let t=EW({_tag:"IConcat",left:e.right.left,right:r});return EW({_tag:"IConcat",left:e.left,right:t})}{let t=EW({_tag:"IConcat",left:e.left,right:e.right.left});return EW({_tag:"IConcat",left:t,right:r})}}if(t.right.depth>=t.left.depth)return EW({_tag:"IConcat",left:E0(e,t.left),right:t.right});{let r=E0(e,t.left.left);if(r.depth===t.depth-3){let e=EW({_tag:"IConcat",left:r,right:t.left.right});return EW({_tag:"IConcat",left:e,right:t.right})}{let e=EW({_tag:"IConcat",left:t.left.right,right:t.right});return EW({_tag:"IConcat",left:r,right:e})}}});(e,t)=>{let r=sh(t),n=[],i=[];return EG(e).forEach(e=>{i.push(e),i.length>=r&&(n.push(EY(i)),i=[])}),i.length>0&&n.push(EY(i)),EY(n)},(e,t,r)=>e8(sY(EG(e),t,r),nG(EY));let E1="~effect/MutableRef",E2={[E1]:E1,...rT,toJSON(){return{_id:"MutableRef",current:rf(this.current)}}},E3=e=>{let t=Object.create(E2);return t.current=e,t},E5=((e,t)=>{let r=e.current;return e.current=t,r},eZ(2,(e,t)=>(e.current=t,e))),E8=((e,t)=>(e.current=t,e.current),Symbol.for("effect/MutableList/Empty")),E4=()=>({head:void 0,tail:void 0,length:0}),E6=e=>{let t=e.head;t.offset>=1024&&t===e.tail&&t.mutable&&(t.array.length-t.offset)*8<=t.offset&&(e.head=e.tail={array:t.array.slice(t.offset),mutable:!0,offset:0,next:void 0})},E9=()=>({array:[],mutable:!0,offset:0,next:void 0}),E7=(e,t)=>{e.tail?e.tail.mutable||(e.tail.next=E9(),e.tail=e.tail.next):e.head=e.tail=E9(),e.tail.array.push(t),e.length++},_e=(e,t)=>{e.head={array:[t],mutable:!0,offset:0,next:e.head},e.tail||(e.tail=e.head),e.length++},_t=(e,t,r=!1)=>{if(0===t.length)return 0;let n={array:t,mutable:r,offset:0,next:void 0};return e.head?e.tail=e.tail.next=n:e.head=e.tail=n,e.length+=t.length,t.length},_r=e=>{e.head=e.tail=void 0,e.length=0},_n=(e,t)=>{if((t=sd(t))<=0||!e.head)return[];if((t=Math.min(t,e.length))===e.length&&e.head?.offset===0&&!e.head.next){let t=e.head.array;return _r(e),t}let r=Array(t),n=0,i=e.head;for(;i;){for(;i.offset<i.array.length;)if(r[n++]=i.array[i.offset],i.mutable&&(i.array[i.offset]=void 0),i.offset++,n===t)return e.head=i.offset===i.array.length&&i.next?i.next:i,e.length-=t,0===e.length?_r(e):E6(e),r;i=i.next}return _r(e),r},_i=(e,t)=>{if((t=sd(t))<=0||!e.head)return;if((t=Math.min(t,e.length))===e.length&&e.head?.offset===0&&!e.head.next)return void _r(e);let r=0,n=e.head;for(;n;){let i=n.array.length-n.offset;if(r+i>t){n.offset+=t-r,e.head=n,e.length-=t,E6(e);return}r+=i,n=n.next}_r(e)},_s=e=>{if(!e.head)return E8;let t=e.head.array[e.head.offset];return e.head.mutable&&(e.head.array[e.head.offset]=void 0),e.head.offset++,e.length--,e.head.offset===e.head.array.length?e.head.next?e.head=e.head.next:_r(e):E6(e),t},_a=(e,t)=>{if((t=sd(t))<=0)return[];let r=Math.min(t,e.length),n=Array(r),i=0,s=e.head;for(;s;){for(let e=s.offset;e<s.array.length;e++)if(n[i++]=s.array[e],i===r)return n;s=s.next}return n},_o=(e,t)=>{let r=[],n=e.head,i=0;for(;n;){for(let e=n.offset;e<n.array.length;e++)t(n.array[e],i++)&&r.push(n.array[e]);n=n.next}0===r.length?_r(e):(e.head=e.tail={array:r,mutable:!0,offset:0,next:void 0},e.length=r.length)},_l=e=>lO(()=>_j(e.atomicPubSub(),new Map,cg(void 0,void 0),fi(!1),E3(!1),e.strategy(),E3(nb))),_u=e=>{var t;let r,n="number"==typeof e?{capacity:e}:e;if(_B(n.capacity),1/0===n.capacity)return _c(n);let i=n.replay&&n.replay>0?new _z(Math.ceil(n.replay)):void 0;if(1===n.capacity)return new _T(i);return Math.max((r=Math.pow(2,Math.ceil(Math.log2(t=n.capacity))))<t?2*r:r,2)===n.capacity?new _A(n.capacity,i):new __(n.capacity,i)},_c=e=>{let t=e?.replay;return new _N(t&&t>0?new _z(Math.ceil(t)):void 0)},_f=e=>cN(r6(t=>(E5(e.shutdownFlag,!0),ca(e.scope,uu(t.id)).pipe(l4(e.strategy.shutdown),uN(e.shutdownHook.open),l9)))),_d=eZ(2,(e,t)=>lO(()=>_h(e,t))),_h=eZ(2,(e,t)=>{if(e.shutdownFlag.current||nm(e.ended.current))return!1;if(E5(e.ended,nv(t)),e.strategy instanceof _P){let t;for(let[r,n,i]of _n(t=e.strategy.publishers,t.length))i&&f1(n,r1(!1))}let r=r1(t);for(let t of e.subscribers.values())for(let e of t){let t;for(;(t=_s(e))!==E8;)f1(t,r)}return e.subscribers.clear(),!0}),_p=eZ(2,(e,t)=>lN(()=>e.shutdownFlag.current||nm(e.ended.current)?lI(!1):e.pubsub.publish(t)?(e.strategy.completeSubscribersUnsafe(e.pubsub,e.subscribers),lI(!0)):e.strategy.handleSurplus(e.pubsub,e.subscribers,[t],e.shutdownFlag,e.ended))),_g=eZ(2,(e,t)=>lN(()=>{if(e.shutdownFlag.current||nm(e.ended.current))return lI(!1);let r=e.pubsub.publishAll(t);return(e.strategy.completeSubscribersUnsafe(e.pubsub,e.subscribers),0===r.length)?lI(!0):e.strategy.handleSurplus(e.pubsub,e.subscribers,r,e.shutdownFlag,e.ended)})),_m=e=>cN(uk(t=>{let r=si(t,cs),n=cf(e.scope),i=_E(e.pubsub,e.subscribers,e.strategy,e.ended);return cd(n,eQ(_b(i))).pipe(l4(cd(r,e=>ca(n,e))),lV(i))})),_b=e=>cN(r6(t=>{let r;return E5(e.shutdownFlag,!0),cF(_n(r=e.pollers,r.length),e=>f0(e,t.id),{discard:!0,concurrency:"unbounded"}).pipe(l6(()=>lO(()=>{e.subscribers.delete(e.subscription),e.subscription.unsubscribe(),e.replayWindow.close(),e.strategy.onPubSubEmptySpaceUnsafe(e.pubsub,e.subscribers)})),uN(e.shutdownHook.open),l9)})),_y=e=>lN(()=>{if(e.shutdownFlag.current)return cO;if(e.replayWindow.remaining>0)return lI(e.replayWindow.take());let t=0===e.pollers.length?e.subscription.poll():E8;return t===E8?_v(e):(e.strategy.onPubSubEmptySpaceUnsafe(e.pubsub,e.subscribers),lI(t))}),_v=e=>lD(t=>{if(e.shutdownFlag.current)return t(cO);if(nm(e.ended.current)){let r=0===e.pollers.length?e.subscription.poll():E8;return r!==E8?(e.strategy.onPubSubEmptySpaceUnsafe(e.pubsub,e.subscribers),t(lI(r))):t(lI(e.ended.current.value))}let r=fY(),n=e.subscribers.get(e.subscription);return(n||(n=new Set,e.subscribers.set(e.subscription,n)),n.add(e.pollers),E7(e.pollers,r),e.strategy.completePollersUnsafe(e.pubsub,e.subscribers,e.subscription,e.pollers),r.effect)?t(r.effect):(r.resumes=[t],lO(()=>{let t;return t=e.pollers,_o(t,e=>e!==r)}))}),_x=eZ(2,(e,t)=>lN(()=>{let r;if(e.shutdownFlag.current)return cO;let n=sd(t);if(e.replayWindow.remaining>=n)return lI(e.replayWindow.takeN(n));e.replayWindow.remaining>0&&(n-=(r=e.replayWindow.takeAll()).length);let i=0===e.pollers.length?e.subscription.pollUpTo(n):[];return e.strategy.onPubSubEmptySpaceUnsafe(e.pubsub,e.subscribers),r?lI(r.concat(i)):lI(i)})),_w=Symbol.for("effect/PubSub/AbsentValue"),_S=(e,t,r)=>{e.has(t)||e.set(t,new Set),e.get(t).add(r)},_k=(e,t,r)=>{if(!e.has(t))return;let n=e.get(t);n.delete(r),0===n.size&&e.delete(t)},_E=(e,t,r,n)=>new _U(e,t,e.subscribe(),E4(),fi(!1),E3(!1),r,e.replayWindow(),n);class __{array;replayIndices;publisherIndex=0;subscribers;subscriberCount=0;subscribersIndex=0;capacity;replayBuffer;constructor(e,t){this.capacity=e,this.replayBuffer=t,this.array=Array.from({length:e}),this.replayIndices=t?Array.from({length:e}):[],this.subscribers=Array.from({length:e})}replayWindow(){return this.replayBuffer?new _H(this.replayBuffer):_J}isEmpty(){return this.publisherIndex===this.subscribersIndex}isFull(){return this.publisherIndex===this.subscribersIndex+this.capacity}size(){return this.publisherIndex-this.subscribersIndex}publish(e){if(this.isFull())return!1;let t=this.replayBuffer?.offer(e);if(0!==this.subscriberCount){let r=this.publisherIndex%this.capacity;this.array[r]=e,void 0!==t&&(this.replayIndices[r]=t),this.subscribers[r]=this.subscriberCount,this.publisherIndex+=1}return!0}publishAll(e){if(0===this.subscriberCount)return this.replayBuffer&&this.replayBuffer.offerAll(e),[];let t=s$(e),r=t.length,n=this.publisherIndex-this.subscribersIndex,i=Math.min(r,this.capacity-n);if(0===i)return t;let s=0,a=this.publisherIndex+i;for(;this.publisherIndex!==a;){let e=t[s++],r=this.publisherIndex%this.capacity;this.array[r]=e;let n=this.replayBuffer?.offer(e);void 0!==n&&(this.replayIndices[r]=n),this.subscribers[r]=this.subscriberCount,this.publisherIndex+=1}return t.slice(s)}slide(){if(this.subscribersIndex!==this.publisherIndex){let e=this.subscribersIndex%this.capacity,t=this.array[e];this.array[e]=_w,this.subscribers[e]=0,this.subscribersIndex+=1,this.replayBuffer?.slide(t,this.replayIndices[e])}}subscribe(){return this.subscriberCount+=1,new _C(this,this.publisherIndex,!1)}}class _C{self;subscriberIndex;unsubscribed;constructor(e,t,r){this.self=e,this.subscriberIndex=t,this.unsubscribed=r}isEmpty(){return this.unsubscribed||this.self.publisherIndex===this.subscriberIndex||this.self.publisherIndex===this.self.subscribersIndex}size(){return this.unsubscribed?0:this.self.publisherIndex-Math.max(this.subscriberIndex,this.self.subscribersIndex)}poll(){if(this.unsubscribed)return E8;if(this.subscriberIndex=Math.max(this.subscriberIndex,this.self.subscribersIndex),this.subscriberIndex!==this.self.publisherIndex){let e=this.subscriberIndex%this.self.capacity,t=this.self.array[e];return this.self.subscribers[e]-=1,0===this.self.subscribers[e]&&(this.self.array[e]=_w,this.self.subscribersIndex+=1),this.subscriberIndex+=1,t}return E8}pollUpTo(e){if(e=sd(e),this.unsubscribed)return[];this.subscriberIndex=Math.max(this.subscriberIndex,this.self.subscribersIndex);let t=this.self.publisherIndex-this.subscriberIndex,r=Math.min(e,t);if(r<=0)return[];let n=[],i=this.subscriberIndex+r;for(;this.subscriberIndex!==i;){let e=this.subscriberIndex%this.self.capacity,t=this.self.array[e];this.self.subscribers[e]-=1,0===this.self.subscribers[e]&&(this.self.array[e]=_w,this.self.subscribersIndex+=1),n.push(t),this.subscriberIndex+=1}return n}unsubscribe(){if(!this.unsubscribed)for(this.unsubscribed=!0,this.self.subscriberCount-=1,this.subscriberIndex=Math.max(this.subscriberIndex,this.self.subscribersIndex);this.subscriberIndex!==this.self.publisherIndex;){let e=this.subscriberIndex%this.self.capacity;this.self.subscribers[e]-=1,0===this.self.subscribers[e]&&(this.self.array[e]=_w,this.self.subscribersIndex+=1),this.subscriberIndex+=1}}}class _A{array;replayIndices;mask;publisherIndex=0;subscribers;subscriberCount=0;subscribersIndex=0;capacity;replayBuffer;constructor(e,t){this.capacity=e,this.replayBuffer=t,this.array=Array.from({length:e}),this.replayIndices=t?Array.from({length:e}):[],this.mask=e-1,this.subscribers=Array.from({length:e})}replayWindow(){return this.replayBuffer?new _H(this.replayBuffer):_J}isEmpty(){return this.publisherIndex===this.subscribersIndex}isFull(){return this.publisherIndex===this.subscribersIndex+this.capacity}size(){return this.publisherIndex-this.subscribersIndex}publish(e){if(this.isFull())return!1;let t=this.replayBuffer?.offer(e);if(0!==this.subscriberCount){let r=this.publisherIndex&this.mask;this.array[r]=e,void 0!==t&&(this.replayIndices[r]=t),this.subscribers[r]=this.subscriberCount,this.publisherIndex+=1}return!0}publishAll(e){if(0===this.subscriberCount)return this.replayBuffer&&this.replayBuffer.offerAll(e),[];let t=s$(e),r=t.length,n=this.publisherIndex-this.subscribersIndex,i=Math.min(r,this.capacity-n);if(0===i)return t;let s=0,a=this.publisherIndex+i;for(;this.publisherIndex!==a;){let e=t[s++],r=this.publisherIndex&this.mask;this.array[r]=e;let n=this.replayBuffer?.offer(e);void 0!==n&&(this.replayIndices[r]=n),this.subscribers[r]=this.subscriberCount,this.publisherIndex+=1}return t.slice(s)}slide(){if(this.subscribersIndex!==this.publisherIndex){let e=this.subscribersIndex&this.mask,t=this.array[e];this.array[e]=_w,this.subscribers[e]=0,this.subscribersIndex+=1,this.replayBuffer?.slide(t,this.replayIndices[e])}}subscribe(){return this.subscriberCount+=1,new _I(this,this.publisherIndex,!1)}}class _I{self;subscriberIndex;unsubscribed;constructor(e,t,r){this.self=e,this.subscriberIndex=t,this.unsubscribed=r}isEmpty(){return this.unsubscribed||this.self.publisherIndex===this.subscriberIndex||this.self.publisherIndex===this.self.subscribersIndex}size(){return this.unsubscribed?0:this.self.publisherIndex-Math.max(this.subscriberIndex,this.self.subscribersIndex)}poll(){if(this.unsubscribed)return E8;if(this.subscriberIndex=Math.max(this.subscriberIndex,this.self.subscribersIndex),this.subscriberIndex!==this.self.publisherIndex){let e=this.subscriberIndex&this.self.mask,t=this.self.array[e];return this.self.subscribers[e]-=1,0===this.self.subscribers[e]&&(this.self.array[e]=_w,this.self.subscribersIndex+=1),this.subscriberIndex+=1,t}return E8}pollUpTo(e){if(e=sd(e),this.unsubscribed)return[];this.subscriberIndex=Math.max(this.subscriberIndex,this.self.subscribersIndex);let t=this.self.publisherIndex-this.subscriberIndex,r=Math.min(e,t);if(r<=0)return[];let n=[],i=this.subscriberIndex+r;for(;this.subscriberIndex!==i;){let e=this.subscriberIndex&this.self.mask,t=this.self.array[e];this.self.subscribers[e]-=1,0===this.self.subscribers[e]&&(this.self.array[e]=_w,this.self.subscribersIndex+=1),n.push(t),this.subscriberIndex+=1}return n}unsubscribe(){if(!this.unsubscribed)for(this.unsubscribed=!0,this.self.subscriberCount-=1,this.subscriberIndex=Math.max(this.subscriberIndex,this.self.subscribersIndex);this.subscriberIndex!==this.self.publisherIndex;){let e=this.subscriberIndex&this.self.mask;this.self.subscribers[e]-=1,0===this.self.subscribers[e]&&(this.self.array[e]=_w,this.self.subscribersIndex+=1),this.subscriberIndex+=1}}}class _T{publisherIndex=0;subscriberCount=0;subscribers=0;value=_w;replayIndex=0;capacity=1;replayBuffer;constructor(e){this.replayBuffer=e}replayWindow(){return this.replayBuffer?new _H(this.replayBuffer):_J}pipe(){return eV(this,arguments)}isEmpty(){return 0===this.subscribers}isFull(){return!this.isEmpty()}size(){return+!this.isEmpty()}publish(e){if(this.isFull())return!1;let t=this.replayBuffer?.offer(e);return 0!==this.subscriberCount&&(this.value=e,void 0!==t&&(this.replayIndex=t),this.subscribers=this.subscriberCount,this.publisherIndex+=1),!0}publishAll(e){if(0===this.subscriberCount)return this.replayBuffer&&this.replayBuffer.offerAll(e),[];let t=s$(e);return 0===t.length?t:this.publish(t[0])?t.slice(1):t}slide(){if(this.isFull()){let e=this.value;this.subscribers=0,this.value=_w,this.replayBuffer?.slide(e,this.replayIndex)}}subscribe(){return this.subscriberCount+=1,new _O(this,this.publisherIndex,!1)}}class _O{self;subscriberIndex;unsubscribed;constructor(e,t,r){this.self=e,this.subscriberIndex=t,this.unsubscribed=r}isEmpty(){return this.unsubscribed||0===this.self.subscribers||this.subscriberIndex===this.self.publisherIndex}size(){return+!this.isEmpty()}poll(){if(this.isEmpty())return E8;let e=this.self.value;return this.self.subscribers-=1,0===this.self.subscribers&&(this.self.value=_w),this.subscriberIndex=this.self.publisherIndex,e}pollUpTo(e){return 1>sd(e)||this.isEmpty()?[]:[this.poll()]}unsubscribe(){this.unsubscribed||(this.unsubscribed=!0,this.self.subscriberCount-=1,0!==this.self.subscribers&&this.subscriberIndex!==this.self.publisherIndex&&(this.self.subscribers-=1,0===this.self.subscribers&&(this.self.value=_w)))}}class _N{publisherHead={value:_w,replayIndex:void 0,subscribers:0,next:null};publisherTail=this.publisherHead;publisherIndex=0;subscribersIndex=0;capacity=Number.MAX_SAFE_INTEGER;replayBuffer;constructor(e){this.replayBuffer=e}replayWindow(){return this.replayBuffer?new _H(this.replayBuffer):_J}isEmpty(){return this.publisherHead===this.publisherTail}isFull(){return!1}size(){return this.publisherIndex-this.subscribersIndex}publish(e){let t=this.replayBuffer?.offer(e),r=this.publisherTail.subscribers;return 0!==r&&(this.publisherTail.next={value:e,replayIndex:t,subscribers:r,next:null},this.publisherTail=this.publisherTail.next,this.publisherIndex+=1),!0}publishAll(e){if(0!==this.publisherTail.subscribers)for(let t of e)this.publish(t);else this.replayBuffer&&this.replayBuffer.offerAll(e);return[]}slide(){if(this.publisherHead!==this.publisherTail){let e=this.publisherHead.next,t=e.value;this.publisherHead=this.publisherHead.next,this.publisherHead.value=_w,this.subscribersIndex+=1,this.replayBuffer?.slide(t,e.replayIndex)}}subscribe(){return this.publisherTail.subscribers+=1,new _M(this,this.publisherTail,this.publisherIndex,!1)}}class _M{self;subscriberHead;subscriberIndex;unsubscribed;constructor(e,t,r,n){this.self=e,this.subscriberHead=t,this.subscriberIndex=r,this.unsubscribed=n}isEmpty(){if(this.unsubscribed)return!0;let e=!0,t=!0;for(;t;)this.subscriberHead===this.self.publisherTail?t=!1:this.subscriberHead.next.value!==_w?(e=!1,t=!1):(this.subscriberHead=this.subscriberHead.next,this.subscriberIndex+=1);return e}size(){return this.unsubscribed?0:this.self.publisherIndex-Math.max(this.subscriberIndex,this.self.subscribersIndex)}poll(){if(this.unsubscribed)return E8;let e=!0,t=E8;for(;e;)if(this.subscriberHead===this.self.publisherTail)e=!1;else{let r=this.subscriberHead.next.value;r!==_w&&(t=r,this.subscriberHead.subscribers-=1,0===this.subscriberHead.subscribers&&(this.self.publisherHead=this.self.publisherHead.next,this.self.publisherHead.value=_w,this.self.subscribersIndex+=1),e=!1),this.subscriberHead=this.subscriberHead.next,this.subscriberIndex+=1}return t}pollUpTo(e){e=sd(e);let t=[],r=0;for(;r!==e;){let n=this.poll();n===E8?r=e:(t.push(n),r+=1)}return t}unsubscribe(){if(!this.unsubscribed)for(this.unsubscribed=!0,this.self.publisherTail.subscribers-=1;this.subscriberHead!==this.self.publisherTail;)this.subscriberHead.next.value!==_w&&(this.subscriberHead.subscribers-=1,0===this.subscriberHead.subscribers&&(this.self.publisherHead=this.self.publisherHead.next,this.self.publisherHead.value=_w,this.self.subscribersIndex+=1)),this.subscriberHead=this.subscriberHead.next}}class _U{"~effect/PubSub/Subscription"={_A:eX};pubsub;subscribers;subscription;pollers;shutdownHook;shutdownFlag;strategy;replayWindow;ended;constructor(e,t,r,n,i,s,a,o,l){this.pubsub=e,this.subscribers=t,this.subscription=r,this.pollers=n,this.shutdownHook=i,this.shutdownFlag=s,this.strategy=a,this.replayWindow=o,this.ended=l}pipe(){return eV(this,arguments)}}class _${"~effect/PubSub"={_A:eX};pubsub;subscribers;scope;shutdownHook;shutdownFlag;strategy;ended;constructor(e,t,r,n,i,s,a){this.pubsub=e,this.subscribers=t,this.scope=r,this.shutdownHook=n,this.shutdownFlag=i,this.strategy=s,this.ended=a}pipe(){return eV(this,arguments)}}let _j=(e,t,r,n,i,s,a)=>new _$(e,t,r,n,i,s,a),_B=e=>{if(e<=0||1/0!==e&&!Number.isInteger(e))throw Error(`Cannot construct PubSub with capacity of ${e}`)};class _P{publishers=E4();get shutdown(){return r6(e=>{let t;return cF(_n(t=this.publishers,t.length),([t,r,n])=>n?f0(r,e.id):lP,{concurrency:"unbounded",discard:!0})})}handleSurplus(e,t,r,n,i){return lD(s=>{if(nm(i.current))return s(lI(!1));let a=fY();return this.offerUnsafe(r,a),this.onPubSubEmptySpaceUnsafe(e,t),this.completeSubscribersUnsafe(e,t),n.current?(this.removeUnsafe(a),s(cO)):a.effect?s(a.effect):(a.resumes=[s],lO(()=>this.removeUnsafe(a)))})}onPubSubEmptySpaceUnsafe(e,t){let r=!0;for(;r&&!e.isFull();){let n=_s(this.publishers);if(n===E8)r=!1;else{let[r,i,s]=n,a=e.publish(r);a||_e(this.publishers,n),this.completeSubscribersUnsafe(e,t),a&&s&&f1(i,r1(!0))}}}completePollersUnsafe(e,t,r,n){return _F(this,e,t,r,n)}completeSubscribersUnsafe(e,t){return _D(this,e,t)}offerUnsafe(e,t){let r=e[Symbol.iterator](),n=r.next();if(!n.done)for(;;){let e=n.value;if((n=r.next()).done){E7(this.publishers,[e,t,!0]);break}E7(this.publishers,[e,t,!1])}}removeUnsafe(e){_o(this.publishers,([t,r])=>r!==e)}}class _R{get shutdown(){return lP}handleSurplus(e,t,r,n){return lI(!1)}onPubSubEmptySpaceUnsafe(e,t){}completePollersUnsafe(e,t,r,n){return _F(this,e,t,r,n)}completeSubscribersUnsafe(e,t){return _D(this,e,t)}}class _L{get shutdown(){return lP}handleSurplus(e,t,r,n,i){return lO(()=>!nm(i.current)&&(this.slidingPublishUnsafe(e,r),this.completeSubscribersUnsafe(e,t),!0))}onPubSubEmptySpaceUnsafe(e,t){}completePollersUnsafe(e,t,r,n){return _F(this,e,t,r,n)}completeSubscribersUnsafe(e,t){return _D(this,e,t)}slidingPublishUnsafe(e,t){let r=t[Symbol.iterator](),n=r.next();if(!n.done&&e.capacity>0){let t=n.value,i=!0;for(;i;){e.slide();let s=e.publish(t);s&&(n=r.next())&&!n.done?t=n.value:s&&(i=!1)}}}}let _F=(e,t,r,n,i)=>{let s=!0;for(;s&&!n.isEmpty();){let a=_s(i);if(a===E8)_k(r,n,i),0===i.length?s=!1:_S(r,n,i);else{let s=n.poll();s===E8?_e(i,a):(f1(a,r1(s)),e.onPubSubEmptySpaceUnsafe(t,r))}}},_D=(e,t,r)=>{for(let[n,i]of r)for(let s of i)e.completePollersUnsafe(t,r,n,s)};class _z{capacity;head={value:_w,index:0,next:null};tail=this.head;slideValues=[];size=0;index=0;publisherIndex=0;constructor(e){this.capacity=e}slide(e,t){this.slideValues[this.index%this.capacity]={value:e,index:t},this.index++}offer(e){let t=this.publisherIndex++;if(this.tail.value=e,this.tail.index=t,this.tail.next={value:_w,index:0,next:null},this.tail=this.tail.next,this.size===this.capacity){let e=this.head;this.head=e.next,e.next=null,e.value=_w}else this.size+=1;return t}offerAll(e){for(let t of e)this.offer(t)}}class _H{buffer;values;index=0;remaining;slideIndex;newestIndex=-1;constructor(e){this.buffer=e,this.remaining=e.size,this.slideIndex=e.index,this.values=Array(this.remaining);let t=e.head;for(let e=0;e<this.remaining;e++)this.values[e]=t.value,this.newestIndex=t.index,t=t.next}close(){this.values.length=0,this.remaining=0}sync(){let e=this.buffer.index-this.slideIndex;if(0===e||0===this.remaining)return;let t=Math.min(e,this.buffer.capacity),r=this.buffer.index-t;for(let e=0;e<t;e++){let t=this.buffer.slideValues[(r+e)%this.buffer.capacity];t.index>this.newestIndex&&(this.index=(this.index+1)%this.values.length,this.values[(this.index+this.remaining-1)%this.values.length]=t.value,this.newestIndex=t.index)}this.slideIndex=this.buffer.index}take(){if(0===this.remaining)return;this.sync();let e=this.values[this.index];return this.values[this.index]=_w,this.index=(this.index+1)%this.values.length,this.remaining--,0===this.remaining&&this.close(),e}takeN(e){let t=Math.min(e=sd(e),this.remaining),r=Array(t);for(let e=0;e<t;e++)r[e]=this.take();return r}takeAll(){return this.takeN(this.remaining)}}let _J={remaining:0,take:()=>void 0,takeN:()=>[],takeAll:()=>[],close:()=>void 0},_W={_A:eX,_E:eX},_q={"~effect/Queue":_W,"~effect/Queue/Enqueue":_W,"~effect/Queue/Dequeue":_W,...rT,toJSON(){return{_id:"effect/Queue",state:this.state._tag,size:_7(this)}}},_K=e=>r6(t=>{let r=Object.create(_q);return r.dispatcher=t.currentDispatcher,r.capacity=e?.capacity??1/0,r.strategy=e?.strategy??"suspend",r.messages=E4(),r.scheduleRunning=!1,r.state={_tag:"Open",takers:new Set,offers:new Set,awaiters:new Set},lI(r)}),_V=e=>_K({capacity:e}),_G=eZ(2,(e,t)=>lN(()=>_Y(e,t)?Ct:"Open"===e.state._tag&&"suspend"===e.strategy?Cc(e,t):Ce)),_Y=(e,t)=>"Open"===e.state._tag&&(e.messages.length>=e.capacity?"sliding"===e.strategy?(_s(e.messages),E7(e.messages,t),!0):e.capacity<=0&&e.state.takers.size>0&&(E7(e.messages,t),Ci(e),!0):(E7(e.messages,t),Cs(e),!0)),_Z=eZ(2,(e,t)=>lD(r=>{let n=_X(e,t);return 0===n.length||"dropping"===e.strategy?r(r1(n)):Cf(e,{_tag:"Array",remaining:n,offset:0,resume:r})})),_X=(e,t)=>{if("Open"!==e.state._tag)return s$(t);if(1/0===e.capacity||"sliding"===e.strategy)return _t(e.messages,Array.from(t),!0),"sliding"===e.strategy&&_n(e.messages,e.messages.length-e.capacity),Cs(e),[];let r=e.capacity<=0?e.state.takers.size:e.capacity-e.messages.length;if(0===r)return s$(t);let n=[],i=0;for(let s of t)i<r?E7(e.messages,s):n.push(s),i++;return Cs(e),n},_Q=eZ(2,(e,t)=>lO(()=>_0(e,t))),_0=(e,t)=>{if("Open"!==e.state._tag)return!1;let r=um(r5(t),Cr);return 0===e.state.offers.size&&0===e.messages.length?Cg(e,r):(e.state={...e.state,_tag:"Closing",exit:r},Cs(e)),!0},_1=e=>_Q(e,rJ(no())),_2=e=>_0(e,rJ(no())),_3=e=>lO(()=>_5(e)),_5=e=>{if("Done"===e.state._tag)return!1;_r(e.messages);let t=e.state.offers;for(let r of(Cg(e,"Open"===e.state._tag?Cn:e.state.exit),t))Cd(r);return!0},_8=e=>_4(e,1,1/0),_4=eZ(3,(e,t,r)=>(t=sd(t),r=sd(r),Co(()=>Ca(e,t,r)??l4(Cu(e,()=>Cl(e,t)),_4(e,t,r))))),_6=e=>Co(()=>_9(e)??l4(Cu(e,()=>Cl(e,1)),_6(e))),_9=e=>{if("Done"===e.state._tag)return e.state.exit;if(e.messages.length>0){let t=_s(e.messages);return Cp(e),r1(t)}if(e.capacity<=0&&e.state.offers.size>0){let t=Ch(e.state.offers);return Cp(e),r1(t)}},_7=e=>"Done"===e.state._tag?0:e.messages.length,Ce=r1(!1),Ct=r1(!0),Cr=r8(no()),Cn=uu(),Ci=e=>{if("Done"!==e.state._tag&&0!==e.state.takers.size){for(let t of e.state.takers)if(t.ready()&&(e.state.takers.delete(t),t.resume(ud),0===e.messages.length))break}},Cs=e=>{e.scheduleRunning||"Done"===e.state._tag||0===e.state.takers.size||(e.scheduleRunning=!0,e.dispatcher.scheduleTask(()=>{e.scheduleRunning=!1,Ci(e)},0))},Ca=(e,t,r)=>{if("Done"===e.state._tag)return e.state.exit;if(r<=0||t<=0)return r1([]);if(!Cl(e,t))return;let n=e.messages.length>0?_n(e.messages,r):[Ch(e.state.offers)];return Cp(e),r1(n)},Co=rQ({op:"QueueTake",[rE](e){let t=this[rk]();return tx(t,rw)?t[rE](e):t}}),Cl=(e,t)=>e.messages.length>=("Closing"===e.state._tag?1:Math.min(t,e.capacity||1))||e.capacity<=0&&"Done"!==e.state._tag&&e.state.offers.size>0,Cu=(e,t)=>lD(r=>{if("Done"===e.state._tag)return r(e.state.exit);if(t())return r(ud);let n={ready:t,resume:r};return e.state.takers.add(n),lO(()=>{"Done"!==e.state._tag&&e.state.takers.delete(n)})}),Cc=(e,t)=>lD(r=>_Y(e,t)?r(Ct):Cf(e,{_tag:"Single",message:t,resume:r})),Cf=(e,t)=>{if("Open"!==e.state._tag)return Cd(t);let r=e.state.offers;return r.add(t),lO(()=>{"Done"!==e.state._tag&&(r.delete(t),"Closing"===e.state._tag&&0===r.size&&0===e.messages.length&&Cg(e,e.state.exit))})},Cd=e=>"Single"===e._tag?e.resume(Ce):e.resume(r1(e.remaining.slice(e.offset))),Ch=e=>{let t=e.values().next().value;if("Single"===t._tag)return e.delete(t),t.resume(Ct),t.message;let r=t.remaining[t.offset++];return t.offset===t.remaining.length&&(e.delete(t),t.resume(r1([]))),r},Cp=e=>{if("Done"===e.state._tag)return hr(e.state.exit.cause);if(0===e.state.offers.size)return"Closing"===e.state._tag&&0===e.messages.length&&(Cg(e,e.state.exit),hr(e.state.exit.cause));for(let t of e.state.offers){let r=e.capacity-e.messages.length;if(r<=0)break;if("Single"===t._tag)E7(e.messages,t.message),e.state.offers.delete(t),t.resume(Ct);else{for(;t.offset<t.remaining.length;t.offset++){if(0===r)return!1;E7(e.messages,t.remaining[t.offset]),r--}e.state.offers.delete(t),t.resume(r1([]))}let n=e.state;if("Done"===n._tag)return hr(n.exit.cause)}return!1},Cg=(e,t)=>{if("Done"===e.state._tag)return;let r=e.state;for(let n of(e.state={_tag:"Done",exit:t},r.takers))n.resume(t);for(let e of(r.takers.clear(),r.awaiters))e(t);r.awaiters.clear()},Cm=e=>new Cv(e),Cb=e=>{for(let t of e.waiters)if(t.permits<=e.free)return t},Cy=(e,t,r,n=eX)=>r6(i=>{if(e.free>=t&&void 0===Cb(e))return e.taken+=t,r();let s={permits:t,resume:void 0},a=()=>{e.waiters.delete(s)&&e.releaseUnsafe(i,0)};e.waiters.add(s),cw(i,a);let o=ue(n(lD(t=>{Cb(e)===s?t(lP):s.resume=t})),()=>Cb(e)!==s?o:(e.taken+=t,a(),r()));return o});class Cv{waiters=new Set;taken=0;permits;constructor(e){this.permits=e}get free(){return this.permits-this.taken}take(e){return Cy(this,e,()=>lI(e))}takeScoped(e){return cP(t=>ue(cs,r=>Cy(this,e,()=>cd(r,eQ(this.release(e))),t)))}takeIfAvailable(e){return lN(()=>this.free<e?lI(!1):(this.taken+=e,lI(!0)))}releaseUnsafe(e,t){return this.taken-=t,this.waiters.size>0&&e.currentDispatcher.scheduleTask(()=>{let e=this.free;for(let t of Array.from(this.waiters)){if(!this.waiters.has(t)||t.permits>e)continue;e-=t.permits;let r=t.resume;t.resume=void 0,r?.(lP)}},0),this.free}resize(e){return r6(t=>(this.permits=e,this.free<0||this.releaseUnsafe(t,0),lP))}release(e){return r6(t=>lI(this.releaseUnsafe(t,e)))}get releaseAll(){return r6(e=>lI(this.releaseUnsafe(e,this.taken)))}withPermits(e){return t=>cP(r=>Cy(this,e,()=>cx(r(t),()=>{this.releaseUnsafe(lg(),e)},!0),r))}withPermit=this.withPermits(1);withPermitsIfAvailable(e){return t=>cP(r=>this.free<e?l$:(this.taken+=e,cx(r(l8(t)),()=>{this.releaseUnsafe(lg(),e)},!0)))}}let Cx=e=>tx(e,rw)?"Success"===e._tag?fW(e.value):e:lI(e),Cw="~effect/Channel",CS=e=>tx(e,Cw),Ck={[Cw]:{_Env:eX,_InErr:eX,_InElem:eX,_OutErr:eX,_OutElem:eX},pipe(){return eV(this,arguments)}},CE=e=>{let t=Object.create(Ck);return t.transform=(t,r)=>uU(e(t,r),e=>lI(lT(e))),t},C_=(e,t)=>CE((r,n)=>ue(CI(e)(r,n),e=>t(e,n))),CC=e=>CE((t,r)=>e),CA=e=>CE(lJ(function*(t,r){let n=cf(r),i=e=>ca(n,ho(e)),s=yield*c_(e(t,r,n),i);return c_(s,i)})),CI=e=>e.transform,CT=4096,CO=e=>CE((t,r)=>lN(()=>CI(e())(t,r))),CN=e=>CC(lO(()=>{let t=e();return lN(()=>{let e=t.next();return e.done?fW(e.value):lI(e.value)})})),CM=e=>CC(lO(()=>{let t=0;return lN(()=>t>=e.length?fW():lI(e[t++]))})),CU=(e,t=CT)=>{let r=sh(t);return CC(lO(()=>{let t=e(),n=nb;return lN(()=>{if("Some"===n._tag)return fW(n.value);let e=[];for(;e.length<r;){let r=t.next();if(r.done){if(0===e.length)return fW(r.value);n=nv(r.value);break}e.push(r.value)}return lI(e)})}))},C$=(e,t=CT)=>CU(()=>e[Symbol.iterator](),t),Cj=e=>CD(lI(e)),CB=CC(lI(fW())),CP=CC(lI(lz)),CR=e=>CC(lI(r8(e))),CL=e=>CC(lT(e)),CF=e=>CL(rq(e)),CD=e=>CC(lO(()=>{let t=!1;return lN(()=>t?fW():(t=!0,e))})),Cz=e=>CC(ue(e,()=>fW())),CH=e=>CC(lI(ue(e,Cx))),CJ=e=>CC(lI(cA(lN(function t(r){if(e.shutdownFlag.current)return cO;let n=0===e.pollers.length?e.subscription.pollUpTo(1/0):[];return(r&&(n=r.concat(n)),e.strategy.onPubSubEmptySpaceUnsafe(e.pubsub,e.subscribers),e.replayWindow.remaining>0)?lI(e.replayWindow.takeAll().concat(n)):sf(n)?lI(n):ue(_v(e),e=>t([e]))}),()=>fW()))),CW=e=>AP(ui(_m(e),e=>CH(_y(e)))),Cq=e=>CE((t,r)=>CK({scope:r,readable:e.evaluate(),onError:e.onError,releaseLockOnEnd:e.releaseLockOnEnd})),CK=e=>{let t,r=e.readable.getReader(),n=e.exit??E3(void 0),i=lN(()=>n.current?n.current:uX(h3({try:()=>r.read(),catch:e.onError}),{onFailure:e=>n.current??lT(e),onSuccess:({done:e,value:t})=>n.current?n.current:e?fW():lI(ao(t))}));return lV((t=e.scope,cd(t,eQ(e.releaseLockOnEnd?lO(()=>r.releaseLock()):h2(()=>r.cancel().catch(e=>r.closed.then(()=>Promise.reject(e),e3))).pipe(ck(lO(()=>r.releaseLock())))))),i)},CV=eZ(2,(e,t)=>C_(e,e=>lO(()=>{let r=0;return ui(e,e=>t(e,r++))}))),CG=eZ(2,(e,t)=>CY(e,e=>lI(t(e)))),CY=eZ(2,(e,t)=>C_(e,e=>lI(ht(e,e=>ue(t(e),fW))))),CZ=e=>void 0===e||"unbounded"!==e&&e<=1,CX=eZ(e=>CS(e[0]),(e,t,r)=>CZ(r?.concurrency)?CQ(e,t):C0(e,t,r)),CQ=(e,t)=>CE((r,n)=>{let i=0;return ui(CI(e)(r,n),ue(e=>t(e,i++)))}),C0=(e,t,r)=>CA(lJ(function*(n,i,s){let a=0,o=yield*CI(e)(n,i),l="unbounded"===r.concurrency?Number.MAX_SAFE_INTEGER:Math.min(r.concurrency,Number.MAX_SAFE_INTEGER),u=yield*_V(0);yield*cd(s,eQ(_3(u)));let c=c1((yield*uw())),f=c2(s);if(r.unordered){let e=Cm(l),r=eQ(e.release(1)),n=uX({onFailure:e=>ue(_Q(u,e),r),onSuccess:e=>ue(_G(u,e),r)});yield*e.take(1).pipe(ue(()=>o),ue(e=>{let r=a++;return f(c(n(lN(()=>t(e,r))))),lP}),uM({disableYield:!0}),uU(t=>e.withPermits(l-1)(_Q(u,t))),cQ(s))}else{let e,r=yield*_V(l-2);yield*cd(s,eQ(_3(r))),yield*_6(r).pipe(h6,ue(e=>_G(u,e)),uM({disableYield:!0}),uU(e=>_Q(u,e)),cQ(s));let n=t=>{"Success"!==t._tag&&(e=t.cause,_0(u,t.cause))};yield*o.pipe(ue(i=>{if(e)return lT(e);let s=a++,o=c(lN(()=>t(i,s)));return f(o),o.addObserver(n),_G(r,lE(o))}),uM({disableYield:!0}),uU(e=>_G(r,r5(e)).pipe(l4(_Q(r,e)))),cQ(s))}return _6(u)})),C1=eZ(e=>CS(e[0]),(e,t,r)=>CZ(r?.concurrency)?C2(e,t):C3(e,t,r)),C2=(e,t)=>CE((r,n)=>ui(CI(e)(r,n),e=>{let i,s,a=ue(e,e=>(s??=cf(n),un(CI(t(e))(r,s),e=>i=o(e)))),o=ht(e=>{if(i=void 0,"Empty"===s.state._tag)return a;let t=ca(s,ud);return s=void 0,ue(t,()=>a)});return lN(()=>i??a)})),C3=(e,t,r)=>e.pipe(CV(t),AC(r)),C5=eZ(2,(e,t)=>CE((r,n)=>lO(()=>{let i,s=cf(n),a=ue(CI(e)(r,s),e=>i=ht(e,e=>ca(s,ud).pipe(ue(()=>CI(t(e))(r,n)),ue(e=>(i=e,e)))));return lN(()=>i??a)}))),C8=eZ(4,(e,t,r,n)=>CE(lJ(function*(i,s){let a=yield*CI(e)(i,s),o=yield*CI(t)(i,s),l=r();return lN(()=>ui(n(l,a,o),([e,t])=>(l=t,e)))}))),C4=eZ(2,(e,t)=>CE((r,n)=>lO(()=>{let i,s=cf(n),a=ue(CI(e)(r,s),e=>{let a=e.pipe(l6(()=>(i=e,lP)),ht(e=>ca(s,r1(e)).pipe(l4(CI(t(e))(r,n)),ue(e=>(i=e,e)))));return i=a,a});return lN(()=>i??a)}))),C6=e=>C1(e,eX),C9=e=>C_(e,e=>{let t,r=0,n=lN(function n(){if(void 0===t)return ue(e,e=>{switch(e.length){case 0:return n();case 1:return lI(e[0]);default:return t=e,lI(e[r++])}});let i=t[r++];return r>=t.length&&(t=void 0,r=0),lI(i)});return lI(n)}),C7=eZ(2,(e,t)=>hg("function"==typeof t?t(eX):t).pipe(ui(t=>{let r=hc.defaultValue();return Ae(AZ(e,hc,lO(()=>r)),e=>fV(e)?lT(e.cause):t(e.value).pipe(ui(e=>{r=e}),ht(()=>fW(e.value))))}),AP)),Ae=(e,t)=>CE((r,n)=>lO(()=>{let i,s=()=>{let a=cf(n);return ue(CI(e)(r,a),e=>i=uU(e,e=>{let r=ho(e);return ca(a,r).pipe(ue(()=>t(r,n)),ue(s))}))};return lN(()=>i??s())})),At=eZ(2,(e,t)=>C_(e,(e,r)=>ui(ui(hg(t),e=>t=>ui(e(t),e=>e.output)),t=>l6(e,t)))),Ar=eZ(2,(e,t)=>CE((r,n)=>ui(CI(e)(r,n),e=>ue(e,function r(n){return t(n)?lI(n):ue(e,r)})))),An=eZ(2,(e,t)=>C_(e,e=>lI(ue(e,function r(n){let i=[];for(let e=0;e<n.length;e++)t(n[e])&&i.push(n[e]);return sD(i)?lI(i):ue(e,r)})))),Ai=eZ(2,(e,t)=>C_(e,e=>lI(ue(e,function r(n){let i=[];for(let e=0;e<n.length;e++){let r=t(n[e]);nC(r)&&i.push(r.success)}return sD(i)?lI(i):ue(e,r)})))),As=eZ(2,(e,t)=>C_(e,e=>{let r=ue(e,e=>cV(e,t));return lI(ue(r,function e(t){return sD(t)?lI(t):ue(r,e)}))})),Aa=eZ(2,(e,t)=>C_(e,e=>lI(ue(e,function r(n){return ue(cG(n,t),t=>sD(t)?lI(t):ue(e,r))})))),Ao=eZ(e=>CS(e[0]),(e,t,r,n)=>CE((i,s)=>ui(CI(e)(i,s),e=>{let i,s,a=t(),o=0,l=uX(e,{onFailure(e){s=e;let t=n?.onHalt&&n.onHalt(a);return t&&t.length>0?lI([a,t]):lT(e)},onSuccess(e){let t=r(a,e);return sF(t)?lI(t):t}});return lN(function e(){if(void 0===i)return s?lT(s):ue(l,([t,r])=>(a=t,0===r.length)?e():1===r.length?lI(r[0]):(i=r,e()));let t=i[o++];return o>=i.length&&(i=void 0,o=0),lI(t)})}))),Al=eZ(3,(e,t,r)=>CE((n,i)=>ui(CI(e)(n,i),e=>{let n=t,i=!0;return lN(()=>i?(i=!1,lI(n)):ui(ue(e,e=>r(n,e)),e=>n=e))}))),Au=eZ(2,(e,t)=>CE((r,n)=>{let i=cf(n);return ui(CI(e)(r,i),e=>{let s=e.pipe(uU(e=>{if(hr(e))return lT(e);let a=i;return i=cf(n),ca(a,r5(e)).pipe(l4(CI(t(e))(r,i)),ue(e=>(s=e,e)))}));return lN(()=>s)})})),Ac=eZ(2,(e,t)=>Ah(e,o4,t)),Af=eZ(2,(e,t)=>Au(e,e=>Cz(ue(t(e),t=>lT(e))))),Ad=eZ(3,(e,t,r)=>Au(e,e=>t(e)?r(e):CL(e))),Ah=eZ(3,(e,t,r)=>Au(e,e=>{let n=t(e);return n_(n)?CL(n.failure):r(n.success,e)})),Ap=eZ(2,(e,t)=>Ah(e,o8,e=>t(e))),Ag=eZ(2,(e,t)=>C_(e,e=>lI(uF(e,e=>ns(e)?lP:l9(t(e)))))),Am=eZ(e=>CS(e[0]),(e,t,r,n)=>Ap(e,e=>t(e)?r(e):n?n(e):CR(e))),Ab=eZ(e=>CS(e[0]),(e,t,r,n)=>Ap(e,e=>{let i=t(e);return n_(i)?n?n(i.failure):CR(i.failure):r(i.success)})),Ay=eZ(e=>CS(e[0]),(e,t,r,n,i)=>Ap(e,e=>{if(tw(e,t)&&tx(e,"reason")){let t=e.reason;return tw(t,r)?n(t,e):i?i(t,e):CR(e)}return CR(e)})),Av=eZ(e=>CS(e[0]),(e,t,r,n)=>{let i;return Ap(e,e=>{if(tw(e,t)&&tx(e,"reason")&&tx(e.reason,"_tag")&&ta(e.reason._tag)){let t=e.reason;return(i??=new Set(Object.keys(r))).has(t._tag)?r[t._tag](t,e):n?n(t,e):CR(e)}return CR(e)})}),Ax=eZ(2,(e,t)=>C_(e,e=>lI(uq(e,e=>ns(e)?e:t(e))))),Aw=eZ(e=>CS(e[0]),(e,t)=>{if(!t?.log)return Ap(e,()=>CB);let r=uV(t.log);return Ap(Af(e,e=>o2(e)?r(e):lP),()=>CB)}),AS=e=>Au(e,()=>CB),Ak=eZ(e=>CS(e[0]),(e,t)=>{if(!t?.log)return AS(e);let r=uV(t.log);return AS(Af(e,e=>r(e)))}),AE=eZ(2,(e,t)=>CO(()=>{let r,n=hc.defaultValue(),i=AW(AZ(e,hc,lO(()=>n)),()=>(r=void 0,lP)),s="function"==typeof t?t(eX):t;return Ae(i,(e,t)=>{if("Success"===e._tag)return fW(e.value);let i=o8(e.cause);return n_(i)?lT(i.failure):h8(function*(){r||(r=yield*hg(s)),n=yield*r(i.success)}).pipe(ht(()=>r8(i.success)),cb(t))})})),A_=eZ(e=>CS(e[0]),(e,t,r)=>e.pipe(CV(t),AC({...r,concurrency:r?.concurrency??1,switch:!0}))),AC=eZ(2,(e,{bufferSize:t=16,concurrency:r,switch:n=!1})=>CA(lJ(function*(i,s,a){let o="unbounded"===r?Number.MAX_SAFE_INTEGER:Math.max(1,r),l=n?void 0:Cm(o),u=yield*lO(()=>fi(!0)),c=new Map,f=yield*_V(t);yield*cd(a,eQ(_3(f)));let d=yield*CI(e)(i,s);return yield*h8(function*(){for(;;){let e;l&&(c.size<o?yield*l.take(1):(e=yield*cY(d),yield*l7(l.take(1),l4(lE(e),lz))));let t=void 0===e?yield*d:yield*lE(e),r=cf(a),n=yield*CI(t)(i,r);for(;c.size>=o;){let[e,t]=sw(c);c.delete(e),0===c.size&&(yield*u.open),yield*l_(e),yield*uY(ca(t,uu()))}let s=yield*n.pipe(l6(()=>lU),ue(e=>_G(f,e)),uM({disableYield:!0}),c_(lJ(function*(e){let t=ho(e),n=yield*u9(ca(r,t));if(!c.has(s))return;let i=uy([t,n]);fV(i)&&(yield*_Q(f,i.cause)),c.delete(s),l&&(yield*l.release(1)),0===c.size&&(yield*u.open)})),cY);u.closeUnsafe(),c.set(s,r)}}).pipe(uU(e=>nC(hi(e))?u.whenOpen(_Q(f,e)):_Q(f,e)),cQ(a)),_6(f)}))),AA=eZ(e=>CS(e[0])&&CS(e[1]),(e,t,r)=>CA(lJ(function*(n,i,s){let a=r?.haltStrategy??"both",o=yield*_V(0);yield*cd(s,eQ(_3(o)));let l=0;function u(e,t){if(l++,!hr(t))return _Q(o,t);switch(a){case"both":return 2===l?_Q(o,t):lP;case"left":case"right":return e===a?_Q(o,t):lP;case"either":return _Q(o,t)}}let c=(e,t,r)=>CI(t)(n,r).pipe(ue(e=>e.pipe(ue(e=>_G(o,e)),uM)),c_(t=>cx(ho(t),e=>ca(r,e)).pipe(uX({onFailure:t=>u(e,t),onSuccess:()=>u(e,t)}))),cQ(s));return yield*c("left",e,cf(s)),yield*c("right",t,cf(s)),_6(o)}))),AI=eZ(2,(e,t)=>AA(e,Cz(t),{haltStrategy:"left"})),AT=(e,t)=>CE((r,n)=>lO(()=>{let n=new TextDecoder(e,t),i={stream:!0},s=r.pipe(ui(al(e=>n.decode(e,i))),ht(e=>{s=fW(e);let t=n.decode();return t.length>0?lI(ao(t)):s}));return lN(()=>s)})),AO=eZ(2,(e,t)=>CE((r,n)=>ue(CI(e)(r,n),e=>CI(t)(e,n)))),AN=eZ(2,(e,t)=>CE((r,n)=>ue(CI(e)(r,n),e=>ui(CI(t)(A$(e),n),AB)))),AM=e=>"Die"===e._tag&&ns(e.defect)&&r$(e.defect.value),AU=e=>e.reasons.some(AM),A$=e=>uU(e,e=>hr(e)?lT(e):lj(no(e))),Aj=e=>AU(e)?rF(e.reasons.flatMap(e=>AM(e)?e.defect.value.reasons:[e])):e,AB=e=>uU(e,e=>lT(Aj(e))),AP=e=>CE((t,r)=>{let n;return lI(lN(()=>n||e.pipe(cb(r),ue(e=>CI(e)(t,r)),ue(e=>n=e))))}),AR=eZ(2,(e,t)=>CE(lJ(function*(r,n){let i=yield*CI(e)(r,n),s=yield*_K({capacity:"unbounded"===t.capacity?void 0:t.capacity,strategy:"unbounded"===t.capacity?void 0:t.strategy});return yield*cd(n,eQ(_3(s))),yield*i.pipe(ue(e=>_G(s,e)),uM({disableYield:!0}),c_(e=>_Q(s,e)),cQ(n)),_6(s)}))),AL=eZ(2,(e,t)=>CE(lJ(function*(r,n){let i=yield*CI(e)(r,n),s=yield*_K({capacity:"unbounded"===t.capacity?void 0:t.capacity,strategy:"unbounded"===t.capacity?void 0:t.strategy});return yield*cd(n,eQ(_3(s))),yield*i.pipe(ue(e=>_Z(s,e)),uM({disableYield:!0}),c_(e=>_Q(s,e)),cQ(n)),_8(s)}))),AF=eZ(2,(e,t)=>AA(e,CC(lI(ue(t,fW))),{haltStrategy:"either"})),AD=eZ(2,(e,t)=>CA(lJ(function*(r,n,i){let s=yield*CI(e)(r,n),a=yield*cQ(t,i,{startImmediately:!0});return lN(()=>{let e=a.pollUnsafe();return void 0===e?s:ub(e,{onFailure:lT,onSuccess:fW})})}))),Az=eZ(2,(e,t)=>AH(e,e=>fV(e)?t(e.cause):lP)),AH=eZ(2,(e,t)=>CA((r,n,i)=>cd(i,t).pipe(l4(CI(e)(r,n))))),AJ=eZ(2,(e,t)=>AP(lV(t,e))),AW=eZ(2,(e,t)=>C_(e,e=>lO(()=>{let r=!0,n=l6(e,e=>(r=!1,t(e)));return lN(()=>r?n:e)}))),Aq=eZ(2,(e,t)=>C_(e,e=>lI(ht(e,e=>ue(t,()=>fW(e)))))),AK=eZ(2,(e,t)=>AH(e,e=>t)),AV=(e,t,r)=>lN(()=>{let n=cg(void 0,void 0);return ht(ue(CI(e)(fW(),n),t),r||lI).pipe(cS(e=>ca(n,e)))}),AG=eZ(2,(e,t)=>CE((r,n)=>ui(uE(CI(e)(r,n),t),uE(t)))),AY=eZ(3,(e,t,r)=>CE((n,i)=>ui(u_(CI(e)(n,i),t,r),u_(t,r)))),AZ=eZ(3,(e,t,r)=>CE((n,i)=>ue(r,r=>CI(AY(e,t,r))(n,i)))),AX=eZ(e=>CS(e[0]),(e,t,r)=>i5(t)?AG(e,t):CE((n,i)=>ue(r?.local?dt(t,f7(),i):dr(t,i),t=>ui(uE(CI(e)(n,i),t),uE(t))))),AQ=eZ(2,(e,t)=>CE((r,n)=>uk(i=>CI(AG(e,t(i)))(r,n)))),A0=(e,t,r)=>{let n,i,s;return n=pt(t,r),i=t=>AY(e,oU,t),s=(e,t)=>r6(r=>fu(e,t,r.getRef(ff),r.getRef(oJ))),CA(lJ(function*(e,t,r){let a=nb;yield*cd(r,e=>nm(a)?s(a.value,e):lP);let o=yield*cN(ui(n,e=>(a=nv(e),e)));return yield*CI(i(o))(e,t)}))},A1=e=>AV(e,e=>uM(e,{disableYield:!0})),A2=eZ(2,(e,t)=>AV(e,e=>uM(ue(e,t),{disableYield:!0}))),A3=eZ(2,(e,t)=>AV(e,e=>e.pipe(ue(t),ue(e=>e?lP:fW()),uM({disableYield:!0})))),A5=e=>ui(A8(e,()=>({bytes:0,arrays:[]}),(e,t)=>{for(let r=0;r<t.length;r++)e.bytes+=t[r].length,e.arrays.push(t[r]);return e}),({arrays:e,bytes:t})=>{let r=new Uint8Array(t),n=0;for(let t=0;t<e.length;t++){let i=e[t];r.set(i,n),n+=i.length}return r}),A8=eZ(3,(e,t,r)=>lN(()=>{let n=t();return AV(e,e=>cL({while:e0,body:()=>e,step:e=>{n=r(n,e)}}),()=>lI(n))})),A4=eZ(3,(e,t,r)=>lN(()=>{let n=t();return AV(e,e=>cL({while:e0,body:eQ(e.pipe(ue(e=>r(n,e)),ui(e=>{n=e}))),step:e3}),()=>lI(n))})),A6=lJ(function*(e){let t=Cm(1),r=yield*uw(),n=si(r,cs);return(yield*CI(e)(fW(),n)).pipe(uE(r),t.withPermits(1))},uU(e=>lI(lT(e)))),A9=(e,t)=>CI(e)(fW(),t),A7=eZ(e=>CS(e[0]),(e,t)=>cP(r=>A2(e,e=>_Z(t,e)).pipe(r,u9,ue(e=>("Success"===e._tag?_2(t):_0(t,e.cause),lP))))),Ie=eZ(e=>CS(e[0]),lJ(function*(e,t){let r=yield*cs,n=yield*_K({capacity:"number"==typeof t.capacity?t.capacity:void 0,strategy:"number"==typeof t.capacity?t.strategy:void 0});return yield*cd(r,eQ(_3(n))),yield*cQ(A7(e,n),r),n})),It=e=>{let t,r,n,i;return h9("unbounded"===e.capacity?(t=e,_l({atomicPubSub:()=>_c(t),strategy:()=>new _R})):"dropping"===e.strategy?(r=e,_l({atomicPubSub:()=>_u(r),strategy:()=>new _R})):"sliding"===e.strategy?(n=e,_l({atomicPubSub:()=>_u(n),strategy:()=>new _L})):(i=e,_l({atomicPubSub:()=>_u(i),strategy:()=>new _P})),_f)},Ir=eZ(2,lJ(function*(e,t){let r=yield*It(t);return yield*c0(In(e,r,{shutdownOnEnd:!1!==t.shutdownOnEnd})),r})),In=eZ(e=>CS(e[0]),(e,t,r)=>A2(e,e=>_g(t,e)).pipe(r?.shutdownOnEnd===!0?ck(_f(t)):eX)),Ii=eZ(2,lJ(function*(e,t){let r=yield*It(t);return yield*A2(e,e=>_p(r,e)).pipe(cS(e=>_d(r,e)),c0),r}));e.s(["k1",0,CT,"i9",0,AR,"GZ",0,AL,"$L",0,(e,t)=>CE((r,n)=>ui(_K({capacity:t?.bufferSize,strategy:t?.strategy}).pipe(l6(e=>cd(n,eQ(_3(e)))),l6(t=>cb(e(t),n).pipe(uU(e=>_Q(t,e)),cQ(n,{startImmediately:!0})))),_8)),"hA",0,Ap,"g",0,Au,"mE",0,Ah,"rQ",0,Ad,"b",0,Ac,"d_",0,Ab,"E",0,Am,"Eo",0,Ay,"D4",0,Av,"xA",0,C8,"C5",0,C5,"tY",0,AT,"RJ",0,CF,"JI",0,e=>C_(e,e=>lI(uM(e,{disableYield:!0}))),"yb",0,CB,"Y1",0,AK,"q6",0,CR,"yY",0,CL,"uj",0,e=>CC(h4(e)),"H1",0,e=>CC(lB(e)),"aS",0,Ar,"rA",0,An,"S$",0,As,"Yy",0,Ai,"tM",0,Aa,"b$",0,C1,"uZ",0,C6,"Rv",0,C9,"Y5",0,e=>CQ(e,Cx),"lE",0,e=>Ae(e,e=>fV(e)?lT(e.cause):lP),"lX",0,CM,"Au",0,(e,t)=>CV(CE(lJ(function*(r,n){let i=e[Symbol.asyncIterator](),s=!1;return i.return&&(yield*cd(n,eQ(lN(()=>s?lO(()=>void i.return().catch(e3)):h2(()=>i.return()))))),ue(h3({try:()=>{let e=i.next();return s=!0,e.finally(()=>{s=!1})},catch:t}),e=>e.done?fW(e.value):lI(e.value))})),ao),"_R",0,CD,"a9",0,CH,"Ln",0,C$,"is",0,CN,"T4",0,CU,"qH",0,e=>AP(ui(_m(e),CJ)),"dp",0,CW,"Uf",0,CC,"ZO",0,e=>CC(lI(_8(e))),"fy",0,Cq,"dv",0,CJ,"HD",0,CE,"WI",0,CA,"Bw",0,e=>CE(t=>{let r,n=e.evaluate();return lI((r={...e,writable:n,pull:t},h7(lO(()=>r.writable.getWriter()),e=>{let t=r.pull.pipe(ue(t=>cF(t,t=>h3({try:()=>e.ready.then(()=>e.write(t)),catch:r.onError}),{discard:!0})),uM({disableYield:!0}));return c_(!1!==r.closeOnDone?ht(t,t=>l4(h3({try:()=>e.close(),catch:r.onError}),fW(t))):t,t=>{if(hr(t))return lP;let n=Aj(t);return r.onAbort?.(n),h2(()=>e.abort(n).catch(e3))})},e=>lO(()=>e.releaseLock()))))}),"Wd",0,AD,"ST",0,AU,"Pb",0,Aw,"gf",0,Ak,"d9",0,AF,"s$",0,CS,"Cz",0,CV,"YC",0,Ao,"X5",0,CG,"iH",0,CY,"JJ",0,CX,"eX",0,Ax,"Dz",0,AA,"EH",0,AC,"Ra",0,AI,"YY",0,A5,"Ub",0,CP,"a0",0,Aq,"xX",0,Az,"dN",0,AH,"b7",0,AW,"ES",0,AJ,"Do",0,e=>Ap(e,CF),"ry",0,C4,"cu",0,AO,"qp",0,AN,"w_",0,AX,"x_",0,AG,"VZ",0,AY,"t5",0,AZ,"DR",0,C7,"gW",0,AB,"La",0,AE,"eW",0,A1,"f_",0,A8,"XG",0,A4,"yk",0,A2,"Qi",0,A3,"wr",0,e=>lN(()=>{let t=nb;return AV(e,e=>e.pipe(l8,ue(e=>(t=e,fW()))),()=>lI(t))}),"WU",0,In,"Kr",0,A7,"Nf",0,e=>lN(()=>{let t=Symbol(),r=t;return AV(e,e=>uM(ue(e,e=>(r=e,lP)),{disableYield:!0}),()=>r===t?l$:h5(r))}),"w8",0,Al,"Vz",0,At,"e8",0,e=>CA((t,r,n)=>ui(cb(CI(e)(t,r),n),cb(n))),"vf",0,()=>CE((e,t)=>lO(()=>{let t="",r=!1,n=nb,i=lN(()=>"Some"===n._tag?fW(n.value):hl(e,{onSuccess:s,onFailure:lT,onDone:e=>{if(n=nv(e),t.length>0){let e=t;return t="",r=!1,lI([e])}return fW(e)}}));function s(e){let n=function(e){let n=[];function i(e){0===t.length?n.push(e):(n.push(t+e),t="")}for(let n=0;n<e.length;n++){let s=e[n];if(0!==s.length){let e=0,n=s.indexOf("\r"),a=s.indexOf("\n");for(r&&(0===a&&(e=1,a=s.indexOf("\n",e)),r=!1);-1!==n||-1!==a;)-1===n||-1!==a&&a<n?(i(s.substring(e,a)),e=a+1,a=s.indexOf("\n",e)):(i(s.substring(e,n)),s.length===n+1?(r=!0,e=s.length,n=-1):(e=n+(a===n+1?2:1),n=s.indexOf("\r",e),a=s.indexOf("\n",e)));t+=s.substring(e)}}return sD(n)?n:null}(e);return null!==n?lI(n):i}return i})),"ge",0,Cj,"wX",0,CO,"Qe",0,A_,"wk",0,e=>CD(lO(e)),"l7",0,Af,"e",0,Ag,"GN",0,Ir,"Wj",0,Ii,"ZX",0,A6,"bK",0,A9,"ig",0,Ie,"$",0,CI,"pL",0,C_,"Ee",0,AP,"eY",0,AQ,"k6",0,A$,"Tu",0,function(){let e=CS(arguments[0]),t=e?arguments[1]:arguments[0],r=oX(e?arguments[2]:arguments[1]);if(e){let e=arguments[0];return A0(e,t,r)}return e=>A0(e,t,r)}],81315);let Is=function(e){this.channel=e};Is.prototype={"~effect/Stream":{_R:eX,_E:eX,_A:eX},pipe(){return eV(this,arguments)}};let Ia=((e,t)=>cP(r=>{let n;if("Closed"===e.state._tag)return cO;let i=e.state,s=lg(),a=h$(i.map,t);if("Some"===a._tag)n=a.value,n.refCount++;else{if(Number.isFinite(e.capacity)&&e.state.map.backing.size>=e.capacity)return r8(new fE(`RcMap attempted to exceed capacity of ${e.capacity}`));(n={deferred:fY(),scope:cg(void 0,void 0),idleTimeToLive:e.idleTimeToLive(t),finalizer:void 0,fiber:void 0,expiresAt:0,refCount:1}).finalizer=Il(e,t,n),hR(i.map,t,n);let r=new Map(e.context.mapUnsafe);s.context.mapUnsafe.forEach((e,t)=>{r.set(t,e)}),r.set(cs.key,n.scope);let a=i1(r);lN(()=>e.lookup(t)).pipe(c1(a),c2(n.scope)).addObserver(r=>{uf(r)&&Ia(e,t,n,a),f1(n.deferred,r)})}return cd(sn(s.context,cs),eQ(n.finalizer)).pipe(l4(r(fZ(n.deferred))))}),(e,t,r,n)=>{if("Closed"===e.state._tag)return;let i=h$(e.state.map,t);"None"===i._tag||i.value!==r||(hF(e.state.map,t),r.refCount>0||Io(r).pipe(uY({log:"Unhandled",message:"Unhandled error in RcMap finalizer"}),c1(n),c2(e.scope)))}),Io=e=>e.fiber?l_(e.fiber).pipe(l4(ca(e.scope,ud))):ca(e.scope,ud),Il=(e,t,r)=>r6(n=>{if(r.refCount--,r.refCount>0)return lP;if("Closed"===e.state._tag)return Io(r);let i=h$(e.state.map,t);if("None"===i._tag||i.value!==r)return Io(r);if(aQ(r.idleTimeToLive))return hF(e.state.map,t),Io(r);if(!aX(r.idleTimeToLive))return lP;let s=n.getRef(ff);return r.expiresAt=s.currentTimeMillisUnsafe()+a4(r.idleTimeToLive),r.fiber||(r.fiber=cP(function n(i){let a=s.currentTimeMillisUnsafe(),o=r.expiresAt-a;if(o<=0){if("Closed"===e.state._tag||r.refCount>0)return lP;let n=h$(e.state.map,t);return"None"===n._tag||n.value!==r?lP:(hF(e.state.map,t),uY(ca(r.scope,ud),{log:"Unhandled",message:"Unhandled error in RcMap finalizer"}))}return ue(i(s.sleep(a5(o))),()=>n(i))}).pipe(ck(lO(()=>{r.fiber=void 0})),c1(n.context),c2(e.scope))),lP}),Iu=((e,t)=>fm(r=>{if("Closed"===e.state._tag)return lP;let n=h$(e.state.map,t);if("None"===n._tag||aQ(n.value.idleTimeToLive))return lP;let i=n.value;return i.expiresAt=r.currentTimeMillisUnsafe()+a4(i.idleTimeToLive),lP}),{_tag:"Empty"}),Ic=lI([void 0]),If={"~effect/Sink":{_A:eX,_In:eX,_L:eX,_E:eX,_R:eX},pipe(){return eV(this,arguments)}},Id=e=>{let t=Object.create(If);return t.transform=e,t};(e,t)=>Ih(e,([e,r])=>[t(e),r]),(e,t)=>Id((r,n)=>e.transform(ue(r,t),n));let Ih=eZ(2,(e,t)=>Id((r,n)=>ui(e.transform(r,n),t))),Ip=(e,t)=>Id((r,n)=>t(e.transform(r,n))),Ig=((e,t)=>Ip(e,ue(t)),e=>tx(e,"~effect/Stream")),Im=e=>new Is(e),Ib=e=>Im(CC(e)),Iy=(e,t)=>Im(CE((r,n)=>ue(A9(e.channel,n),e=>t(e,n)))),Iv=e=>e.channel,Ix=Im(CB),Iw=e=>{let t=Im(CO(()=>e().channel));return IS.set(t,e),t},IS=new WeakMap,Ik=e=>Im(CR(e)),IE=e=>Im(CF(e)),I_=e=>sD(e)?Im(Cj(e)):Ix,IC=e=>Im(CW(e)),IA=e=>Im(Cq(e)),II=e=>Im(AP(ui(e,Iv))),IT=eZ(2,(e,t)=>Iw(()=>{let r=0;return Im(CV(e.channel,al(e=>t(e,r++))))})),IO=eZ(2,(e,t)=>Im(CV(e.channel,t))),IN=eZ(e=>Ig(e[0]),(e,t,r)=>e.channel.pipe(C9,CX(t,r),CV(ao),Im)),IM=eZ(2,(e,t)=>Im(CX(e.channel,t))),IU=((e=>Ig(e[0]),(e,t,r)=>IN(e,e=>lV(t(e),e),r)),eZ(e=>Ig(e[0]),(e,t,r)=>e.channel.pipe(C9,C1(e=>t(e).channel,r),Im))),I$=((e=>Ig(e[0]),(e,t)=>IU(e,eX,t)),new WeakMap),Ij=eZ(e=>Ig(e[0])&&Ig(e[1]),(e,t,r)=>Im(AA(Iv(e),Iv(t),r))),IB=((e,t)=>e.channel.pipe(AI(t),Im),eZ(3,(e,t,r)=>Im(CA(lJ(function*(n,i){let s,a,o=yield*A9(e.channel,i),l=yield*A9(t.channel,i),u=h8(function*(){let e,t=yield*cQ(o,i),r=yield*cQ(l,i);return yield*(e=[t,r],lD(t=>{let r=Array.from(e);if(0===r.length)return t(lI(aa()));let n=Array(r.length),i=aa(),s=()=>{for(let e=0;e<i.length;e++)r[e].removeObserver(i[e])},a=0,o=!1;for(let e=0;e<r.length&&!o;e++){let l=i=>{if(a++,"Failure"===i._tag)return o=!0,s(),t(i);n[e]=i.value,a===r.length&&t(lI(n))};i.push(l),r[e].addObserver(l)}return lO(()=>{o=!0,s()})}))});return h8(function*(){let[e,t]=s?[s,a??(yield*l)]:a?[(yield*o),a]:yield*u,[n,i,c]=r(e,t);return s=sD(i)?i:void 0,a=sD(c)?c:void 0,n})}))))),IP=(e=>Ig(e[0]),eZ(2,(e,t)=>e.channel.pipe(Au(e=>t(e).channel),Im))),IR=((e,t)=>e.channel.pipe(Af(t),Im),eZ(2,(e,t)=>Im(Ap(e.channel,e=>t(e).channel)))),IL=((e,t)=>e.channel.pipe(Ag(t),Im),eZ(e=>Ig(e[0]),(e,t,r,n)=>Im(Am(Iv(e),t,e=>r(e).channel,n&&(e=>n(e).channel))))),IF=((e=>Ig(e[0]),(e,t,r,n)=>Im(Ab(Iv(e),t,e=>r(e).channel,n&&(e=>n(e).channel)))),eZ(2,(e,t)=>Im(Ax(e.channel,t)))),ID=eZ(e=>Ig(e[0]),(e,t,r)=>Iy(e,(e,n)=>lO(()=>{let n=0,i=!1;return ue(lN(()=>i?fW():e),e=>{let s=e.findIndex(e=>t(e,n++));if(s>=0){i=!0;let t=e.slice(0,r?.excludeLast?s:s+1);return sD(t)?lI(t):fW()}return lI(e)})}))),Iz=((e=>Ig(e[0]),(e,t,r)=>Iy(e,(e,n)=>lO(()=>{let n=0,i=!1;return h8(function*(){if(i)return yield*fW();let s=yield*e;for(let e=0;e<s.length;e++)if(yield*t(s[e],n++)){i=!0;let t=s.slice(0,r?.excludeLast?e:e+1);return sD(t)?t:yield*fW()}return s})}))),eZ(e=>Ig(e[0]),(e,t,r,n)=>Im(Ao(e.channel,t,(e,t)=>{let n=aa();for(let i=0;i<t.length;i++){let[s,a]=r(e,t[i]);e=s;for(let e=0;e<a.length;e++)n.push(a[e])}return[e,sf(n)?ao(n):IH]},n?.onHalt?{onHalt(e){let t=n.onHalt(e);return sD(t)?ao(t):IH}}:void 0)))),IH=((e=>Ig(e[0]),(e,t,r,n)=>Im(Ao(e.channel,t,(e,t)=>{let[n,i]=r(e,t);return[e=n,sD(i)?ao(i):IH]},n?.onHalt?{onHalt(e){let t=n.onHalt(e);return sD(t)?ao(t):IH}}:void 0))),aa()),IJ=((e,t)=>{let r=t.burst??0;return"enforce"===t.strategy?IJ(e,t.cost,t.units,t.duration,r):IW(e,t.cost,t.units,t.duration,r)},(e,t,r,n,i)=>Iy(e,e=>fm(s=>{let a=a4(az(n)),o=r+i<0?1/0:r+i,l=r,u=s.currentTimeMillisUnsafe();return lI(ue(e,function n(i){return ue(t(i),t=>{let c=s.currentTimeMillisUnsafe(),f=l+(c-u)/a*r,d=f<0?o:Math.min(f,o);return t<=d?(l=d-t,u=c,lI(i)):ue(e,n)})}))}))),IW=(e,t,r,n,i)=>Iy(e,e=>fm(s=>{let a=a4(az(n)),o=r+i<0?1/0:r+i,l=r,u=s.monotonicTimeNanosUnsafe();return lI(ue(e,e=>ue(t(e),t=>{let n=s.monotonicTimeNanosUnsafe(),i=Number(n-u)/1e6,c=Math.min(l+i/a*r,o)-t;if(c>=0)return l=c,u=n,lI(e);let f=Math.max(0,-c/r*a);return f>0?ue(fb(f),()=>(l=c,u=n,lI(e))):(l=c,u=n,lI(e))})))})),Iq=((e,t,r)=>Im(CA(lJ(function*(n,i,s){let a,o=yield*A9(e.channel,i),l=fi(!1),u=Symbol(),c=yield*_K({capacity:0});yield*o.pipe(l.whenOpen,ue(e=>(l.closeUnsafe(),_G(c,e))),uM,uU(e=>_Q(c,e)),cQ(s));let f=yield*ff,d=yield*hp(r),h=fi(!1),p=f.currentTimeMillisUnsafe(),g=0,m=nb,b=e=>(h.openUnsafe()&&(g=f.currentTimeMillisUnsafe()),lI(e)),y=h.await.pipe(ue(()=>d(p,m)),ue(([,e])=>fb(e)),ue(()=>_G(c,u)),ht(()=>_1(c)),ue(()=>lz)),v=lN(()=>{if(void 0!==a){let e=a;return a=void 0,b(e)}return"Open"===c.state._tag&&l.openUnsafe(),ue(_6(c),e=>e===u?fW():b(e))}),x=ue(([e,t])=>{if(h.isOpen())p+=f.currentTimeMillisUnsafe()-g;else if("Done"===c.state._tag)return fW();return m=nv(e),a=t,lI(ao(e))});return lN(()=>{if("Done"===c.state._tag&&void 0===a)return c.state.exit;h.closeUnsafe();let e=x(lN(()=>I0(t,v,s)));return"Open"===c.state._tag?l7(e,y):e})}))),eZ(2,(e,t)=>Im(AO(e.channel,t)))),IK=eZ(e=>Ig(e[0]),(e,t)=>e.channel.pipe(AO(AT(t?.encoding)),Im)),IV=((e,t)=>IO(e,(e,r)=>{let n=0===r?[]:[t],i=e.length-1;for(let r=0;r<e.length;r++)r===i?n.push(e[r]):n.push(e[r],t);return n}),eZ(2,(e,t)=>Im(AF(e.channel,t)))),IG=eZ(2,(e,t)=>Im(AH(e.channel,t))),IY=((e,t)=>Im(AJ(e.channel,t)),eZ(2,(e,t)=>Im(AK(e.channel,t)))),IZ=((e=>Ig(e[0]),(e,t,r)=>Im(AX(e.channel,t,r))),eZ(2,(e,t)=>Im(AG(e.channel,t)))),IX=eZ(3,(e,t,r)=>Im(AZ(e.channel,t,r))),IQ=((e,t)=>Im(AQ(e.channel,t)),eZ(2,(e,t)=>cy(r=>A9(e.channel,r).pipe(ue(e=>I0(t,e,r)),ui(([e])=>e))))),I0=(e,t,r)=>AB(e.transform(A$(t),r)),I1=eZ(2,(e,t)=>A2(e.channel,e=>{let r=0;return cL({while:()=>r<e.length,body:()=>t(e[r++]),step:e3})})),I2=eZ(e=>Ig(e[0]),(e,t,r)=>{let n,i,s=!1,a=fi(!1),o=r?.signal,l=()=>i.interruptUnsafe();return new ReadableStream({start(r){(i=c3(uE(A2(C_(e.channel,e=>lI(a.whenOpen(e))),e=>lO(()=>{a.closeUnsafe();for(let t=0;t<e.length;t++)r.enqueue(e[t]);n(),n=void 0})),t))).addObserver(e=>{o?.removeEventListener("abort",l),s||("Failure"===e._tag&&o?.aborted!==!0?r.error(le(e.cause)):r.close())}),void 0!==o&&void 0===i.pollUnsafe()&&(o.aborted?l():o.addEventListener("abort",l,{once:!0}))},pull:()=>new Promise(e=>{n=e,a.openUnsafe()}),cancel(){if(i)return s=!0,c6(l9(l_(i)))}},r?.strategy)}),I3=eZ(e=>Ig(e[0]),(e,t)=>I2(e,i4(),t)),I5=eZ(e=>Ig(e[0]),(e,t)=>ui(uw(),r=>I2(e,r,t))),I8=eZ(2,(e,t)=>Ii(e.channel,t));e.s(["E",0,IL,"S",0,IK,"v",0,IE,"R",0,Ix,"$",0,e=>Iw(()=>{let t=new TextEncoder;return IT(e,e=>t.encode(e))}),"t",0,IY,"O",0,Ik,"T",0,IU,"A",0,Im,"w",0,(e,t)=>Array.isArray(e)&&t?.chunkSize===void 0?I_(e):Im(C$(e,t?.chunkSize)),"u",0,Ib,"M",0,IA,"x",0,IV,"i",0,Ig,"y",0,IT,"C",0,Iz,"g",0,IM,"U",0,IN,"d",0,IF,"j",0,e=>ui(A5(e.channel),e=>e.buffer),"Y",0,e=>A5(e.channel),"J",0,IG,"B",0,Iq,"W",0,IZ,"h",0,IQ,"a",0,I1,"D",0,e=>Im(Cj(ao(e))),"z",0,Iw,"V",0,ID,"s",0,I3,"P",0,I5,"_",0,I2,"X",0,Iy,"F",0,II],91889);let I4=(e,t)=>[e.codePointAt(0),t.codePointAt(0)],I6={alnum:[...I4("0","9"),...I4("A","Z"),...I4("a","z")],alpha:[...I4("A","Z"),...I4("a","z")],blank:[9,9,32,32],cntrl:[0,31,127,127],digit:I4("0","9"),graph:[33,126],lower:I4("a","z"),print:[32,126],punct:[33,47,58,64,91,96,123,126],space:[9,13,32,32],upper:I4("A","Z"),word:[...I4("0","9"),...I4("A","Z"),95,95,...I4("a","z")],xdigit:[...I4("0","9"),...I4("A","F"),...I4("a","f")]},I9=(e,t,r,n,i)=>{if(i>64)return;let s=[],a="";for(let o=t;o<r;o++){let t=n.get(o);if(void 0===t){"\\"===e[o]&&o+1<r&&(a+=e[o++]),a+=e[o];continue}let l=[],u=o+1;for(let r of[...t.commas,t.close]){let t=I9(e,u,r,n,i+1);if(void 0===t)return;l.push(t),u=r+1}""!==a&&(s.push(a),a=""),s.push(l),o=t.close}return""!==a&&s.push(a),s},I7=e=>{let t=1;for(let r of e)if("string"!=typeof r){let e=0;for(let t of r)e+=I7(t);if((t*=e)>1e4)return 1/0}return t},Te=e=>{let t=[""];for(let r of e)if("string"==typeof r)t=t.map(e=>e+r);else{let e=r.flatMap(Te);t=t.flatMap(t=>e.map(e=>t+e))}return t},Tt="~effect/PlatformError";class Tr extends om("BadArgument"){get message(){return`${this.module}.${this.method}${this.description?`: ${this.description}`:""}`}}class Tn extends om("PlatformError"){constructor(e){"cause"in e?super({reason:e,cause:e.cause}):super({reason:e})}[Tt]=Tt;get message(){return this.reason.message}}let Ti=e=>new Tn(new Tr(e)),Ts=iJ("effect/FileSystem"),Ta="~effect/http/HttpBody",To="~effect/http/HttpBody/HttpBodyError";class Tl extends om("HttpBodyError"){[To]=To}class Tu{[Ta];constructor(){this[Ta]=Ta}[rc](){return this.toJSON()}toString(){return ri(this,{ignoreToString:!0})}}let Tc=new class extends Tu{_tag="Empty";toJSON(){return{_id:"effect/HttpBody",_tag:"Empty"}}};class Tf extends Tu{_tag="Raw";body;contentType;contentLength;constructor(e,t,r){super(),this.body=e,this.contentType=t,this.contentLength=r}toJSON(){return{_id:"effect/HttpBody",_tag:"Raw",body:this.body,contentType:this.contentType,contentLength:this.contentLength}}}let Td=(e,t)=>new Tf(e,t?.contentType,t?.contentLength);class Th extends Tu{_tag="Uint8Array";contentType;contentLength;text;_body;constructor(e,t,r,n){super(),this._body=e,this.text=n,this.contentType=t,this.contentLength=r}get body(){return this._body??=Tm(this.text)}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}}}let Tp=new TextEncoder,Tg=globalThis.Buffer,Tm=void 0!==Tg?e=>Tg.from(e,"utf8"):e=>Tp.encode(e),Tb=(e,t)=>{if("string"!=typeof e&&(e=void 0===e?"":String(e)),void 0!==Tg)return new Th(void 0,t??"text/plain",Tg.byteLength(e,"utf8"),e);let r=Tp.encode(e);return new Th(r,t??"text/plain",r.length,e)},Ty=(e,t)=>lR({try:()=>Tb(JSON.stringify(e),t??"application/json"),catch:e=>new Tl({reason:{_tag:"JsonError"},cause:e})});class Tv extends Tu{_tag="FormData";contentType=void 0;contentLength=void 0;formData;constructor(e){super(),this.formData=e}toJSON(){return{_id:"effect/HttpBody",_tag:"FormData",formData:this.formData}}}let Tx=e=>new Tv(e),Tw=(e,t,r)=>{if(null!=r){if("object"==typeof r)return void e.append(t,r);e.append(t,String(r))}};class TS extends Tu{_tag="Stream";stream;contentType;contentLength;constructor(e,t,r){super(),this.stream=e,this.contentType=t,this.contentLength=r}toJSON(){return{_id:"effect/HttpBody",_tag:"Stream",contentType:this.contentType,contentLength:this.contentLength}}}let Tk=(e,t,r)=>new TS(e,t??"application/octet-stream",r),TE=(e,t,r)=>{let n=iL(e);return nm(n)?lI(n.value):r8(Ti({module:"HttpBody",method:r,description:`Invalid ${t}: ${e}`}))},T_=lJ(function*(e,t,r){let n=r?.offset===void 0?ik:yield*TE(r.offset,"offset",t),i=r?.bytesToRead===void 0?void 0:yield*TE(r.bytesToRead,"bytesToRead",t),s=n>=e?BigInt("0"):e-n,a=void 0===i||i>s?s:i;return a>BigInt(Number.MAX_SAFE_INTEGER)?yield*r8(Ti({module:"HttpBody",method:t,description:`Content length exceeds Number.MAX_SAFE_INTEGER: ${a}`})):Number(a)});e.s(["R",0,Tc,"Y",0,(e,t)=>ue(Ts,r=>ue(r.stat(e),n=>ui(T_(n.size,"file",t),n=>Tk(r.stream(e,t),t?.contentType,n)))),"D",0,Tx,"e",0,e=>{let t=new globalThis.FormData;for(let[r,n]of Object.entries(e))if(Array.isArray(n))for(let e of n)Tw(t,r,e);else Tw(t,r,n);return Tx(t)},"$",0,e=>tx(e,Ta),"y",0,Ty,"n",0,(e,t)=>{let r=wi(k6(e));return(e,n)=>r(e,t).pipe(uq(e=>new Tl({reason:{_tag:"SchemaError",issue:e},cause:e})),ue(e=>Ty(e,n)))},"h",0,(e,t)=>Tb(JSON.stringify(e),t??"application/json"),"V",0,Td,"b",0,Tk,"o",0,Tb,"Z",0,(e,t)=>new Th(e,t??"application/octet-stream",e.length),"s",0,(e,t)=>Tb(bo(m8(e)),t??"application/x-www-form-urlencoded")],34087);let TC=e=>{switch(e._tag){case"Weak":return`W/"${e.value}"`;case"Strong":return`"${e.value}"`}};class TA extends(iJ())("effect/http/Etag/Generator"){}let TI="~effect/ErrorReporter/ignore",TT="~effect/http/HttpClientError",TO=e=>tx(e,TT);class TN extends om("HttpClientError"){constructor(e){"cause"in e.reason?super({...e,cause:e.reason.cause}):super(e)}[TT]=TT;get request(){return this.reason.request}get response(){return"response"in this.reason?this.reason.response:void 0}get message(){return this.reason.message}}let TM=e=>e.endsWith("Error")?e.slice(0,-5):e,TU=(e,t,r)=>t?`${e}: ${t} (${r})`:`${e} error (${r})`,T$=e=>`${e.method} ${bf(e.url)}`,Tj=(e,t)=>({...t,request:{_id:"HttpClientRequest",method:e.request.method,url:bf(e.request.url)},..."response"in e?{response:{_id:"HttpClientResponse",status:e.response.status}}:void 0});class TB extends om("TransportError"){get methodAndUrl(){return T$(this.request)}get message(){return TU(TM(this._tag),this.description,this.methodAndUrl)}toJSON(){return Tj(this,super.toJSON())}}class TP extends om("EncodeError"){get methodAndUrl(){return T$(this.request)}get message(){return TU(TM(this._tag),this.description,this.methodAndUrl)}toJSON(){return Tj(this,super.toJSON())}}class TR extends om("InvalidUrlError"){get methodAndUrl(){return T$(this.request)}get message(){return TU(TM(this._tag),this.description,this.methodAndUrl)}toJSON(){return Tj(this,super.toJSON())}}class TL extends om("StatusCodeError"){get methodAndUrl(){return T$(this.request)}get message(){let e=`${this.response.status} ${this.methodAndUrl}`;return TU(TM(this._tag),this.description,e)}toJSON(){return Tj(this,super.toJSON())}}class TF extends om("DecodeError"){get methodAndUrl(){return T$(this.request)}get message(){let e=`${this.response.status} ${this.methodAndUrl}`;return TU(TM(this._tag),this.description,e)}toJSON(){return Tj(this,super.toJSON())}}class TD extends om("EmptyBodyError"){get methodAndUrl(){return T$(this.request)}get message(){let e=`${this.response.status} ${this.methodAndUrl}`;return TU(TM(this._tag),this.description,e)}toJSON(){return Tj(this,super.toJSON())}}e.s(["p",0,TF,"Z",0,TD,"E",0,TP,"J",0,TN,"_",0,TR,"x",0,TL,"k",0,TB,"$",0,TO],80479);let Tz=(e,t)=>"Empty"===t._tag||"FormData"===t._tag?mU(mU(e,"content-type"),"content-length"):TH(e=void 0===t.contentType?mU(e,"content-type"):mO(e,"content-type",t.contentType),t),TH=(e,t)=>{let r="Empty"===t._tag||"FormData"===t._tag?void 0:t.contentLength;return void 0===r?mU(e,"content-length"):mO(e,"content-length",r.toString())};class TJ extends om("UrlError"){}let TW=(e,t,r)=>sp({try:()=>{let n=new URL(e,Tq());for(let e=0;e<t.params.length;e++){let[r,i]=t.params[e];void 0!==i&&n.searchParams.append(r,mG(i))}return void 0!==r&&(n.hash=r),n},catch:e=>new TJ({cause:e})}),Tq=()=>{if("location"in globalThis&&void 0!==globalThis.location&&void 0!==globalThis.location.origin&&void 0!==globalThis.location.pathname){let e=location.origin+location.pathname;try{return new URL(e).href}catch{}}},TK=((e,t)=>{let r=new URL(e);return t(r),r},"~effect/http/HttpClientRequest"),TV={[TK]:TK,...rd,toJSON(){return{_id:"HttpClientRequest",method:this.method,url:bf(this.url),urlParams:this.urlParams,hash:this.hash,headers:t7(this.headers),body:this.body.toJSON()}},pipe(){return eV(this,arguments)}};function TG(e,t,r,n,i,s){let a=Object.create(TV);return a.method=e,a.url=t,a.urlParams=r,a.hash=n,a.headers=i,a.body=s,a}let TY=TG("GET","",be,nb,mC,Tc),TZ=e=>(t,r)=>TQ(TY,{method:e,url:t,...r??void 0}),TX=TZ("GET"),TQ=eZ(2,(e,t)=>{let r=e;return t.method&&(r=T0(r,t.method)),t.url&&(r=T9(r,t.url)),t.headers&&(r=T2(r,t.headers)),t.urlParams&&(r=Ot(r,t.urlParams)),t.hash&&(r=On(r,t.hash)),t.body&&(r=Oi(r,t.body)),t.accept&&(r=T8(r,t.accept)),t.acceptJson&&(r=T4(r)),r}),T0=eZ(2,(e,t)=>TG(t,e.url,e.urlParams,e.hash,e.headers,e.body)),T1=eZ(3,(e,t,r)=>TG(e.method,e.url,e.urlParams,e.hash,mO(e.headers,t,r),e.body)),T2=eZ(2,(e,t)=>TG(e.method,e.url,e.urlParams,e.hash,mN(e.headers,t),e.body)),T3=eZ(2,(e,t)=>TG(e.method,e.url,e.urlParams,e.hash,t(e.headers),e.body)),T5=eZ(2,(e,t)=>T3(e,mU(t))),T8=eZ(2,(e,t)=>T1(e,"Accept",t)),T4=T8("application/json"),T6=eZ(2,(e,t)=>TG(e.method,e.url,e.urlParams,e.hash,mO(mO(e.headers,"connection","Upgrade"),"upgrade",t),e.body)),T9=eZ(2,(e,t)=>{if("string"==typeof t)return TG(e.method,t,e.urlParams,e.hash,e.headers,e.body);let r=new URL(t.toString()),n=m8(r.searchParams),i=nz(""===r.hash?void 0:r.hash.slice(1));return r.search="",r.hash="",TG(e.method,r.toString(),n,i,e.headers,e.body)}),T7=eZ(2,(e,t)=>""===t?e:TG(e.method,Oe(t,e.url),e.urlParams,e.hash,e.headers,e.body)),Oe=(e,t)=>{let r=e.endsWith("/"),n=t.startsWith("/");return r&&n?e+t.slice(1):r||n?e+t:e+"/"+t},Ot=eZ(2,(e,t)=>TG(e.method,e.url,bi(e.urlParams,t),e.hash,e.headers,e.body)),Or=eZ(2,(e,t)=>TG(e.method,e.url,ba(e.urlParams,t),e.hash,e.headers,e.body)),On=eZ(2,(e,t)=>TG(e.method,e.url,e.urlParams,nv(t),e.headers,e.body)),Oi=eZ(2,(e,t)=>TG(e.method,e.url,e.urlParams,e.hash,Tz(e.headers,t),t)),Os=eZ(2,(e,t)=>Oi(e,Tx(t)));function Oa(e){let t=TW(e.url,e.urlParams,nq(e.hash));return nC(t)?nv(t.success):nb}e.s(["v",0,Or,"c",0,Os,"R",0,TY,"g",0,TX,"D",0,e=>tx(e,TK),"h",0,TZ,"H",0,TG,"e",0,T7,"W",0,T5,"z",0,Oi,"S",0,T1,"Y",0,T2,"V",0,T0,"Z",0,T9,"T",0,Oa,"F",0,T6],85266);let Oo="~effect/http/HttpIncomingMessage",Ol=iJ("effect/http/HttpIncomingMessage/MaxBodySize",{defaultValue:()=>void 0}),Ou=(e,t)=>({...t,headers:t7(e.headers),remoteAddress:e.remoteAddress}),Oc="~effect/http/HttpClientResponse/WebSource",Of="~effect/http/HttpClientResponse",Od=eZ(2,(e,t)=>lN(()=>t(e.status)?lI(e):r8(new TN({reason:new TL({response:e,request:e.request,description:"invalid status code"})}))));class Oh extends rh{[Oo];[Of];request;source;constructor(e,t){super(),this.request=e,this.source=t,this[Oo]=Oo,this[Of]=Of}toJSON(){return Ou(this,{_id:"HttpClientResponse",request:this.request.toJSON(),status:this.status})}get status(){return this.source.status}get url(){if(this.source.url)return this.source.url.split("#")[0];let e=Oa(this.request);return ng(e)?"":(e.value.hash="",e.value.href)}get headers(){return mA(this.source.headers)}cachedCookies;get cookies(){return this.cachedCookies?this.cachedCookies:this.cachedCookies=(e=>{let t=[];for(let r of"string"==typeof e?[e]:e){let e=function(e){let t=e.split(";").map(e=>e.trim()).filter(e=>""!==e);if(0===t.length)return;let r=t[0].indexOf("=");if(-1===r)return;let n=t[0].slice(0,r).replace(g9,"");if(!g6.test(n))return;let i=t[0].slice(r+1).replace(g9,""),s=mg(i);if(1===t.length)return Object.assign(Object.create(mr),{name:n,value:s,valueEncoded:i});let a={};for(let e=1;e<t.length;e++){let r=t[e],n=r.indexOf("="),i=-1===n?r:r.slice(0,n).trim(),s=-1===n?void 0:r.slice(n+1).trim();switch(i.toLowerCase()){case"domain":{if(void 0===s)break;let e=s.trim().replace(/^\./,"");e&&(a.domain=e);break}case"expires":{if(void 0===s)break;let e=new Date(s);isNaN(e.getTime())||(a.expires=e);break}case"max-age":if(void 0===s||!g7.test(s))break;a.maxAge=a8(parseInt(s,10));break;case"path":if(void 0===s)break;"/"===s[0]&&(a.path=s);break;case"priority":if(void 0===s)break;switch(s.toLowerCase()){case"low":a.priority="low";break;case"medium":a.priority="medium";break;case"high":a.priority="high"}break;case"httponly":a.httpOnly=!0;break;case"secure":a.secure=!0;break;case"partitioned":a.partitioned=!0;break;case"samesite":if(void 0===s)break;switch(s.toLowerCase()){case"lax":a.sameSite="lax";break;case"strict":a.sameSite="strict";break;case"none":a.sameSite="none"}}}return Object.assign(Object.create(mr),{name:n,value:s,valueEncoded:i,options:Object.keys(a).length>0?a:void 0})}(r.trim());e&&t.push(e)}return g5(t)})(this.source.headers.getSetCookie?.()??[])}get remoteAddress(){return nb}[Oc](){return this.source}get stream(){return this.source.body?IA({evaluate:()=>this.source.body,onError:e=>new TN({reason:new TF({request:this.request,response:this,cause:e})})}):Ik(new TN({reason:new TD({request:this.request,response:this,description:"can not create stream from empty body"})}))}get json(){return ue(this.text,e=>lR({try:()=>""===e?null:JSON.parse(e),catch:e=>new TN({reason:new TF({request:this.request,response:this,cause:e})})}))}textBody;get text(){return this.textBody??=ui(this.arrayBuffer,e=>new TextDecoder().decode(e))}get urlParamsBody(){return ue(this.arrayBuffer,e=>lR({try:()=>m8(mX(e)),catch:e=>new TN({reason:new TF({request:this.request,response:this,cause:e})})}))}formDataBody;get formData(){return this.formDataBody??=h3({try:()=>this.source.formData(),catch:e=>new TN({reason:new TF({request:this.request,response:this,cause:e})})}).pipe(pe,fe)}arrayBufferBody;get arrayBuffer(){return this.arrayBufferBody||(this.arrayBufferBody=h3({try:()=>this.source.arrayBuffer(),catch:e=>new TN({reason:new TF({request:this.request,response:this,cause:e})})}).pipe(pe,fe)),this.arrayBufferBody}get upgrade(){return r8(new TN({reason:new TL({request:this.request,response:this,description:"fetch cannot hand over the connection of an HTTP upgrade"})}))}pipe(){return eV(this,arguments)}}e.s(["T",0,Of,"v",0,Od,"L",0,e=>e.status>=200&&e.status<300?lI(e):r8(new TN({reason:new TL({response:e,request:e.request,description:"non 2xx status code"})})),"n",0,(e,t)=>new Oh(e,t)],56523);let Op=Object.getPrototypeOf(mC),Og="~effect/http/HttpServerResponse",Om=e=>Ow({status:e?.status??204,statusText:e?.statusText,headers:e?.headers?mA(e.headers):void 0,cookies:e?.cookies}),Ob=eZ(2,(e,t)=>Ow({...e,headers:mU(e.headers,t)})),Oy=eZ(2,(e,t)=>Ow(e,mN(e.headers,t))),Ov=eZ(2,(e,t)=>Ow({...e,body:t},Tz(e.headers,t))),Ox={...rT,[Og]:Og,[TI]:!0,toJSON(){return{_id:"HttpServerResponse",status:this.status,statusText:this.statusText,headers:t7(this.headers),cookies:this.cookies.toJSON(),body:this.body.toJSON()}}},Ow=(e,t)=>{let r=Object.create(Ox);if(r.status=e.status,r.statusText=e.statusText,r.cookies=e.cookies??g8,r.body=e.body??Tc,"Empty"!==r.body._tag&&(r.body.contentType||void 0!==r.body.contentLength)){let n=void 0!==t,i=n?t:void 0===e.headers||e.headers===mC?Object.create(Op):mI({...e.headers});r.body.contentType&&(!n||void 0===i["content-type"])&&(i["content-type"]=r.body.contentType),void 0===r.body.contentLength||n&&void 0!==i["content-length"]||(i["content-length"]=r.body.contentLength.toString()),r.headers=i}else r.headers=t??e.headers??mC;return r},OS=(new Set((A={algorithms:["gzip","deflate"],transform:e=>{let t;return t=e,e=>e.pipeThrough(new CompressionStream(t))}}).algorithms),{"application/andrew-inset":["ez"],"application/appinstaller":["appinstaller"],"application/applixware":["aw"],"application/appx":["appx"],"application/appxbundle":["appxbundle"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomdeleted+xml":["atomdeleted"],"application/atomsvc+xml":["atomsvc"],"application/atsc-dwd+xml":["dwd"],"application/atsc-held+xml":["held"],"application/atsc-rsat+xml":["rsat"],"application/automationml-aml+xml":["aml"],"application/automationml-amlx+zip":["amlx"],"application/bdoc":["bdoc"],"application/calendar+xml":["xcs"],"application/ccxml+xml":["ccxml"],"application/cdfx+xml":["cdfx"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cpl+xml":["cpl"],"application/cu-seeme":["cu"],"application/cwl":["cwl"],"application/dash+xml":["mpd"],"application/dash-patch+xml":["mpp"],"application/davmount+xml":["davmount"],"application/dicom":["dcm"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["ecma"],"application/emma+xml":["emma"],"application/emotionml+xml":["emotionml"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/express":["exp"],"application/fdf":["fdf"],"application/fdt+xml":["fdt"],"application/font-tdpfr":["pfr"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hjson":["hjson"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/its+xml":["its"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["*js"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lgr+xml":["lgr"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/media-policy-dataset+xml":["mpf"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mmt-aei+xml":["maei"],"application/mmt-usd+xml":["musd"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["*mp4","*mpg4","mp4s","m4p"],"application/msix":["msix"],"application/msixbundle":["msixbundle"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/n-quads":["nq"],"application/n-triples":["nt"],"application/node":["cjs"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg","one","onea"],"application/oxps":["oxps"],"application/p2p-overlay+xml":["relo"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-keys":["asc"],"application/pgp-signature":["sig","*asc"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/provenance+xml":["provx"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf","owl"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/route-apd+xml":["rapd"],"application/route-s-tsid+xml":["sls"],"application/route-usd+xml":["rusd"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/senml+xml":["senmlx"],"application/sensml+xml":["sensmlx"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/sieve":["siv","sieve"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/sql":["sql"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/swid+xml":["swidtag"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/toml":["toml"],"application/trig":["trig"],"application/ttml+xml":["ttml"],"application/ubjson":["ubj"],"application/urc-ressheet+xml":["rsheet"],"application/urc-targetdesc+xml":["td"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/watcherinfo+xml":["wif"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/xaml+xml":["xaml"],"application/xcap-att+xml":["xav"],"application/xcap-caps+xml":["xca"],"application/xcap-diff+xml":["xdf"],"application/xcap-el+xml":["xel"],"application/xcap-ns+xml":["xns"],"application/xenc+xml":["xenc"],"application/xfdf":["xfdf"],"application/xhtml+xml":["xhtml","xht"],"application/xliff+xml":["xlf"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["*xsl","xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"application/zip+dotlottie":["lottie"],"audio/3gpp":["*3gpp"],"audio/aac":["adts","aac"],"audio/adpcm":["adp"],"audio/amr":["amr"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mobile-xmf":["mxmf"],"audio/mp3":["*mp3"],"audio/mp4":["m4a","mp4a","m4b"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx","opus"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/wav":["wav"],"audio/wave":["*wav"],"audio/webm":["weba"],"audio/xm":["xm"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/aces":["exr"],"image/apng":["apng"],"image/avci":["avci"],"image/avcs":["avcs"],"image/avif":["avif"],"image/bmp":["bmp","dib"],"image/cgm":["cgm"],"image/dicom-rle":["drle"],"image/dpx":["dpx"],"image/emf":["emf"],"image/fits":["fits"],"image/g3fax":["g3"],"image/gif":["gif"],"image/heic":["heic"],"image/heic-sequence":["heics"],"image/heif":["heif"],"image/heif-sequence":["heifs"],"image/hej2k":["hej2"],"image/ief":["ief"],"image/jaii":["jaii"],"image/jais":["jais"],"image/jls":["jls"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpg","jpeg","jpe"],"image/jph":["jph"],"image/jphc":["jhc"],"image/jpm":["jpm","jpgm"],"image/jpx":["jpx","jpf"],"image/jxl":["jxl"],"image/jxr":["jxr"],"image/jxra":["jxra"],"image/jxrs":["jxrs"],"image/jxs":["jxs"],"image/jxsc":["jxsc"],"image/jxsi":["jxsi"],"image/jxss":["jxss"],"image/ktx":["ktx"],"image/ktx2":["ktx2"],"image/pjpeg":["jfif"],"image/png":["png"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/t38":["t38"],"image/tiff":["tif","tiff"],"image/tiff-fx":["tfx"],"image/webp":["webp"],"image/wmf":["wmf"],"message/disposition-notification":["disposition-notification"],"message/global":["u8msg"],"message/global-delivery-status":["u8dsn"],"message/global-disposition-notification":["u8mdn"],"message/global-headers":["u8hdr"],"message/rfc822":["eml","mime","mht","mhtml"],"model/3mf":["3mf"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/jt":["jt"],"model/mesh":["msh","mesh","silo"],"model/mtl":["mtl"],"model/obj":["obj"],"model/prc":["prc"],"model/step":["step","stp","stpnc","p21","210"],"model/step+xml":["stpx"],"model/step+zip":["stpz"],"model/step-xml+zip":["stpxz"],"model/stl":["stl"],"model/u3d":["u3d"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["*x3db","x3dbz"],"model/x3d+fastinfoset":["x3db"],"model/x3d+vrml":["*x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"model/x3d-vrml":["x3dv"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/javascript":["js","mjs"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["md","markdown"],"text/mathml":["mml"],"text/mdx":["mdx"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/richtext":["rtx"],"text/rtf":["*rtf"],"text/sgml":["sgml","sgm"],"text/shex":["shex"],"text/slim":["slim","slm"],"text/spdx":["spdx"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vtt":["vtt"],"text/wgsl":["wgsl"],"text/x-python":["py"],"text/x-shellscript":["sh"],"text/xml":["*xml"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/iso.segment":["m4s"],"video/jpeg":["jpgv"],"video/jpm":["*jpm","*jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts","m2t","m2ts","mts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/webm":["webm"]});Object.freeze(OS);class Ok extends(iJ())("effect/http/HttpPlatform"){}let OE=e=>{let t=e?.headers?mA(e.headers):mC;return e?.contentType?mO(t,"content-type",e.contentType):t},O_=(e,t)=>{let r=iL(e);return nm(r)?lI(r.value):r8(Ti({module:"HttpPlatform",method:"fileResponse",description:`Invalid ${t}: ${e}`}))},OC=(e,t)=>{let r=Number(e);return Number.isSafeInteger(r)?lI(r):r8(Ti({module:"HttpPlatform",method:"fileResponse",description:`${t} exceeds the safe integer range: ${e}`}))},OA="~effect/http/HttpServerRespondable",OI=Om({status:400}),OT=Om({status:404}),OO="~effect/http/HttpServerError";class ON extends om("HttpServerError"){constructor(e){"cause"in e.reason?super({...e,cause:e.reason.cause}):super(e)}[OO]=OO;stack=`${this.name}: ${this.message}`;get request(){return this.reason.request}get response(){return"response"in this.reason?this.reason.response:void 0}[OA](){return this.reason[OA]()}get[TI](){return this.reason[TI]??!1}get message(){return this.reason.message}}class OM extends om("RequestParseError"){[OA](){return lI(Om({status:"BodyTooLarge"===this.reason?413:400}))}get methodAndUrl(){return Oj(this.request)}get message(){return OB(this._tag,this.description,this.methodAndUrl)}}class OU extends om("ResponseError"){[OA](){return lI(Om({status:500}))}get methodAndUrl(){return Oj(this.request)}get message(){let e=`${this._tag} (${this.response.status} ${this.methodAndUrl})`;return this.description?`${e}: ${this.description}`:e}}class O$ extends(iJ())("effect/http/HttpServerError/ClientAbort"){static annotation=(this.context(!0)).pipe(i7(fK,{name:"ClientAbort",stack:e3,parent:void 0}))}let Oj=e=>`${e.method} ${m0(e.url)}`,OB=(e,t,r)=>{let n=`${e} (${r})`;return t?`${n}: ${t}`:n},OP=Om({status:500}),OR=lI(OP),OL=lI(Om({status:499})),OF=lI(Om({status:503})),OD="~effect/socket/Socket",Oz=iJ("effect/socket/Socket"),OH=new TextEncoder,OJ="~effect/socket/Socket/SocketError";class OW extends(k8("effect/socket/Socket/SocketReadError"))({_tag:kC("SocketReadError"),cause:kF()}){message="An error occurred during Read"}class Oq extends(k8("effect/socket/Socket/SocketWriteError"))({_tag:kC("SocketWriteError"),cause:kF()}){message="An error occurred during Write"}class OK extends(k8("effect/socket/Socket/SocketOpenError"))({_tag:kC("SocketOpenError"),kind:kS(["Unknown","Timeout"]),cause:kF()}){get message(){return"Timeout"===this.kind?'timeout waiting for "open"':"An error occurred during Open"}}class OV extends(k8("effect/socket/Socket/SocketUpgradeError"))({_tag:kC("SocketUpgradeError"),cause:ka(kF())}){static unsupported=()=>r8(new OZ({reason:new OV({})}));get message(){return void 0===this.cause?"Socket does not support TLS upgrade":"An error occurred during TLS upgrade"}}class OG extends(k8("effect/socket/Socket/SocketCloseError"))({_tag:kC("SocketCloseError"),code:kB,closeReason:ka(kf)}){get message(){return this.closeReason?`${this.code}: ${this.closeReason}`:`${this.code}`}}let OY=kw([OW,Oq,OK,OV,OG]);class OZ extends(k4(OJ))("SocketError",{_tag:kC("SocketError"),reason:OY}){constructor(e){"cause"in e.reason?super({...e,cause:e.reason.cause}):super(e)}[OJ]=OJ;static is(e){return tx(e,OJ)}message=this.reason.message}let OX="~effect/Path",OQ=iJ("effect/Path");function O0(e,t){let r,n="",i=0,s=-1,a=0;for(let o=0;o<=e.length;++o){if(o<e.length)r=e.charCodeAt(o);else if(47===r)break;else r=47;if(47===r){if(s===o-1||1===a);else if(s!==o-1&&2===a){if(n.length<2||2!==i||46!==n.charCodeAt(n.length-1)||46!==n.charCodeAt(n.length-2)){if(n.length>2){let e=n.lastIndexOf("/");if(e!==n.length-1){-1===e?(n="",i=0):i=(n=n.slice(0,e)).length-1-n.lastIndexOf("/"),s=o,a=0;continue}}else if(2===n.length||1===n.length){n="",i=0,s=o,a=0;continue}}t&&(n.length>0?n+="/..":n="..",i=2)}else n.length>0?n+="/"+e.slice(s+1,o):n=e.slice(s+1,o),i=o-s-1;s=o,a=0}else 46===r&&-1!==a?++a:a=-1}return n}let O1=function(){let e,t="",r=!1;for(let n=arguments.length-1;n>=-1&&!r;n--){let i;if(n>=0)i=arguments[n];else{let t=globalThis.process;void 0===e&&"process"in globalThis&&"object"==typeof t&&null!==t&&"function"==typeof t.cwd&&(e=t.cwd()),i=e}0!==i.length&&(t=i+"/"+t,r=47===i.charCodeAt(0))}if(t=O0(t,!r),r)if(t.length>0)return"/"+t;else return"/";return t.length>0?t:"."},O2=/%/g,O3=/\\/g,O5=/\n/g,O8=/\r/g,O4=/\t/g,O6=(I={resolve:O1,normalize(e){if(0===e.length)return".";let t=47===e.charCodeAt(0),r=47===e.charCodeAt(e.length-1);return(0!==(e=O0(e,!t)).length||t||(e="."),e.length>0&&r&&(e+="/"),t)?"/"+e:e},isAbsolute:e=>e.length>0&&47===e.charCodeAt(0),join(){let e;if(0==arguments.length)return".";for(let t=0;t<arguments.length;++t){let r=arguments[t];r.length>0&&(void 0===e?e=r:e+="/"+r)}return void 0===e?".":O6.normalize(e)},relative(e,t){if(e===t||(e=O6.resolve(e),t=O6.resolve(t),e===t))return"";let r=1;for(;r<e.length&&47===e.charCodeAt(r);++r);let n=e.length,i=n-r,s=1;for(;s<t.length&&47===t.charCodeAt(s);++s);let a=t.length-s,o=i<a?i:a,l=-1,u=0;for(;u<=o;++u){if(u===o){if(a>o){if(47===t.charCodeAt(s+u))return t.slice(s+u+1);else if(0===u)return t.slice(s+u)}else i>o&&(47===e.charCodeAt(r+u)?l=u:0===u&&(l=0));break}let n=e.charCodeAt(r+u);if(n!==t.charCodeAt(s+u))break;47===n&&(l=u)}let c="";for(u=r+l+1;u<=n;++u)(u===n||47===e.charCodeAt(u))&&(0===c.length?c+="..":c+="/..");return c.length>0?c+t.slice(s+l):(s+=l,47===t.charCodeAt(s)&&++s,t.slice(s))},dirname(e){if(0===e.length)return".";let t=e.charCodeAt(0),r=47===t,n=-1,i=!0;for(let r=e.length-1;r>=1;--r)if(47===(t=e.charCodeAt(r))){if(!i){n=r;break}}else i=!1;return -1===n?r?"/":".":r&&1===n?"//":e.slice(0,n)},basename(e,t){let r,n=0,i=-1,s=!0;if(void 0!==t&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return"";let a=t.length-1,o=-1;for(r=e.length-1;r>=0;--r){let l=e.charCodeAt(r);if(47===l){if(!s){n=r+1;break}}else -1===o&&(s=!1,o=r+1),a>=0&&(l===t.charCodeAt(a)?-1==--a&&(i=r):(a=-1,i=o))}return n===i?i=o:-1===i&&(i=e.length),e.slice(n,i)}for(r=e.length-1;r>=0;--r)if(47===e.charCodeAt(r)){if(!s){n=r+1;break}}else -1===i&&(s=!1,i=r+1);return -1===i?"":e.slice(n,i)},extname(e){let t=-1,r=0,n=-1,i=!0,s=0;for(let a=e.length-1;a>=0;--a){let o=e.charCodeAt(a);if(47===o){if(!i){r=a+1;break}continue}-1===n&&(i=!1,n=a+1),46===o?-1===t?t=a:1!==s&&(s=1):-1!==t&&(s=-1)}return -1===t||-1===n||0===s||1===s&&t===n-1&&t===r+1?"":e.slice(t,n)},format:function(e){var t;let r,n;if(null===e||"object"!=typeof e)throw TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return r=e.dir||e.root,n=e.base||(e.name||"")+((t=e.ext)?t.startsWith(".")?t:`.${t}`:""),r?r===e.root?r+n:r+"/"+n:n},parse(e){let t,r={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return r;let n=e.charCodeAt(0),i=47===n;i?(r.root="/",t=1):t=0;let s=-1,a=0,o=-1,l=!0,u=e.length-1,c=0;for(;u>=t;--u){if(47===(n=e.charCodeAt(u))){if(!l){a=u+1;break}continue}-1===o&&(l=!1,o=u+1),46===n?-1===s?s=u:1!==c&&(c=1):-1!==s&&(c=-1)}return -1===s||-1===o||0===c||1===c&&s===o-1&&s===a+1?-1!==o&&(0===a&&i?r.base=r.name=e.slice(1,o):r.base=r.name=e.slice(a,o)):(0===a&&i?(r.name=e.slice(1,s),r.base=e.slice(1,o)):(r.name=e.slice(a,s),r.base=e.slice(a,o)),r.ext=e.slice(s,o)),a>0?r.dir=e.slice(0,a-1):i&&(r.dir="/"),r},sep:"/",fromFileUrl:function(e){if("file:"!==e.protocol)return r8(new Tr({module:"Path",method:"fromFileUrl",description:"URL must be of scheme file"}));if(""!==e.hostname)return r8(new Tr({module:"Path",method:"fromFileUrl",description:"Invalid file URL host"}));let t=e.pathname;for(let e=0;e<t.length;e++)if("%"===t[e]){let r=32|t.codePointAt(e+2);if("2"===t[e+1]&&102===r)return r8(new Tr({module:"Path",method:"fromFileUrl",description:"must not include encoded / characters"}))}return lR({try:()=>decodeURIComponent(t),catch:e=>new Tr({module:"Path",method:"fromFileUrl",cause:e})})},toFileUrl:function(e){var t;let r=new URL("file://"),n=O1(e);return 47===e.charCodeAt(e.length-1)&&"/"!==n[n.length-1]&&(n+="/"),(t=n).includes("%")&&(t=t.replace(O2,"%25")),t.includes("\\")&&(t=t.replace(O3,"%5C")),t.includes("\n")&&(t=t.replace(O5,"%0A")),t.includes("\r")&&(t=t.replace(O8,"%0D")),t.includes(" ")&&(t=t.replace(O4,"%09")),r.pathname=t,lI(r)},toNamespacedPath:eX},OQ.of({...I,[OX]:OX,resolveWithin(e,t){if(""!==I.parse(t).root)return nb;let r=I.resolve(e),n=I.resolve(r,t),i=I.relative(r,n);return".."===i||i.startsWith(`..${I.sep}`)||I.isAbsolute(i)?nb:nv(n)}})),O9={value:"",parameters:Object.create(null)},O7={...O9,filename:void 0},Ne=new Uint8Array(256);for(let e of"!#$%&'*+-.^_`|~0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")Ne[e.charCodeAt(0)]=1;let Nt=new Uint8Array(256);Nt[9]=1;for(let e=32;e<=126;e++)Nt[e]=1;for(let e=128;e<=255;e++)Nt[e]=1;let Nr=new TextDecoder("utf-8"),Nn="~effect/http/Multipart",Ni="~effect/http/Multipart/MultipartError";class Ns extends og{}let Na={FileTooLarge:413,FieldTooLarge:413,BodyTooLarge:413,TooManyParts:413,InternalError:500,Parse:400};class No extends om("MultipartError"){static fromReason(e,t){return new No({reason:new Ns({_tag:e,cause:t})})}[Ni]=Ni;[TI]=!0;[OA](){return lI(Om({status:Na[this.reason._tag]}))}get message(){return this.reason._tag}}class Nl extends rh{[Nn];constructor(){super(),this[Nn]=Nn}}class Nu extends rh{[Nn];_tag="Field";contentType="text/plain";key;value;constructor(e,t){super(),this[Nn]=Nn,this.key=e,this.value=t}toJSON(){return{_id:"@effect/platform/Multipart/Part",_tag:"Field",key:this.key,contentType:this.contentType,value:this.value}}}class Nc extends rh{[Nn];_tag="File";key;name;contentType;content;contentEffect;constructor(e,t){super(),this[Nn]=Nn,this.key=e,this.name=t.name,this.contentType=t.type,this.content=IA({evaluate:()=>t.stream(),onError:e=>No.fromReason("InternalError",e)}),this.contentEffect=h3({try:()=>t.arrayBuffer().then(e=>new Uint8Array(e)),catch:e=>No.fromReason("InternalError",e)})}toJSON(){return{_id:"@effect/platform/Multipart/Part",_tag:"File",key:this.key,name:this.name,contentType:this.contentType}}}e=>"u">typeof ReadableStream&&e instanceof ReadableStream;let Nf=iJ("effect/http/HttpEffect/CurrentRequestState"),Nd={"http:":80,"https:":443,"ws:":80,"wss:":443},Nh=(e,t,r)=>{let n=bf(t.search,r).slice(1);if(e.attribute("url.full",bf(t.href,r)),e.attribute("url.path",t.pathname),""!==n&&e.attribute("url.query",n),e.attribute("url.scheme",t.protocol.slice(0,-1)),""!==t.hostname){e.attribute("server.address",t.hostname.startsWith("[")?t.hostname.slice(1,-1):t.hostname);let r=""===t.port?Nd[t.protocol]:Number(t.port);void 0!==r&&e.attribute("server.port",r)}},Np=(e,t,r,n,i)=>{for(let s in r)n(s,t)&&e.attribute(`http.${t}.header.${s}`,mB(s,i)?"<redacted>":r[s])},Ng=iJ("effect/http/HttpMiddleware/TracerDisabledWhen",{defaultValue:()=>e1}),Nm=iJ("@effect/platform/HttpMiddleware/SpanNameGenerator",{defaultValue:()=>e=>e.method}),Nb=iJ("effect/http/HttpMiddleware/TracerHeaderFilter",{defaultValue:()=>e1});({...rT,toJSON(){return{_id:"Ref",ref:this.ref}}}),(e,t)=>lO(()=>{e.ref.current=t(e.ref.current)});let Ny="~effect/http/HttpClient",Nv=iJ("effect/HttpClient"),Nx=((e,t)=>Nw(ue(r=>t(e.postprocess(lI(r)),r)),e.preprocess),eZ(2,(e,t)=>Nw(r=>t(e.postprocess(r)),e.preprocess))),Nw=(e,t)=>{let r=Object.create(NS);return r.preprocess=t,r.postprocess=e,r.execute=function(r){return e(t(r))},r},NS={[Ny]:Ny,pipe(){return eV(this,arguments)},...rd,toJSON:()=>({_id:"effect/HttpClient"}),...Object.fromEntries(Ey.map(([e,t])=>[t,function(t,r){return this.execute(TZ(e)(t,r))}]))},Nk=eZ(2,(e,t)=>Nw(e.postprocess,r=>ui(e.preprocess(r),t))),NE=iJ("effect/http/HttpClient/TracerDisabledWhen",{defaultValue:()=>e1}),N_=iJ("effect/http/HttpClient/TracerHeaderFilter",{defaultValue:()=>e1}),NC=iJ("effect/http/HttpClient/TracerPropagationEnabled",{defaultValue:e0}),NA=iJ("effect/http/HttpClient/SpanNameGenerator",{defaultValue:()=>e=>e.method}),NI=(()=>{if("FinalizationRegistry"in globalThis&&globalThis.FinalizationRegistry){let e=new FinalizationRegistry(e=>{try{e.abort()}catch{}});return{register(t,r){e.register(t,r,t)},unregister(t){e.unregister(t)}}}let e=new WeakMap;return{register(t,r){e.set(t,setTimeout(()=>r.abort(),5e3))},unregister(t){let r=e.get(t);void 0!==r&&(clearTimeout(r),e.delete(t))}}})(),NT=new WeakMap,NO=new WeakMap,NN=(e,t,r)=>(r||(NI.register(e,t),e=new NM(e,t)),NO.set(e,t),e);class NM{original;controller;constructor(e,t){this.original=e,this.controller=t}[Of]=Of;[Oo]=Oo;applyInterrupt(e){return lN(()=>(NI.unregister(this.original),cA(e,()=>lO(()=>{this.controller.abort()}))))}get request(){return this.original.request}get url(){return this.original.url}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 upgrade(){return this.applyInterrupt(this.original.upgrade)}[Oc](){let e,t=(e=this.original,e[Oc]?.());return void 0!==t&&NI.unregister(this.original),t}get stream(){return Iw(()=>(NI.unregister(this.original),IY(this.original.stream,lO(()=>{this.controller.abort()}))))}toJSON(){return this.original.toJSON()}[rc](){return this.original[rc]()}pipe(){return eV(this,arguments)}}e.s(["S",0,Nv,"s",0,e=>di(Nv)(uk(t=>ui(e,e=>Nx(e,uv(e=>su(t,e)))))),"h",0,e=>Nw(t=>ue(t,t=>r6(r=>{let n=NT.get(t),i=n??new AbortController,s=TW(t.url,t.urlParams,nq(t.hash));if(n_(s))return r8(new TN({reason:new TR({request:t,cause:s.failure})}));let a=s.success;if(r.getRef(o$)||r.getRef(NE)(t)){let s=e(t,a,i.signal,r);return n?ui(s,e=>NN(e,i,!0)):cP(e=>uX(e(s),{onSuccess:e=>lI(NN(e,i,!1)),onFailure:e=>(o6(e)&&i.abort(),lT(e))}))}return pr(r.getRef(NA)(t),{kind:"client"},s=>{var o,l;let u;s.attribute("http.request.method",t.method);let c=r.getRef(mP);Nh(s,a,(o=t.urlParams,l=r.getRef(bv),0===(u=o.params.filter(([,e])=>"string"!=typeof e).map(([e])=>e)).length?l:[...l,...new URLSearchParams(u.map(e=>[e,""])).keys()]));let f=r.getRef(N_);return Np(s,"request",t.headers,f,c),t=r.getRef(NC)?T2(t,mI({b3:`${s.traceId}-${s.spanId}-${s.sampled?"1":"0"}${nF(s.parent,{onNone:()=>"",onSome:e=>`-${e.spanId}`})}`,traceparent:`00-${s.traceId.padStart(32,"0")}-${s.spanId}-${s.sampled?"01":"00"}`})):t,cP(o=>o(e(t,a,i.signal,r)).pipe(pn(s,{captureStackTrace:!1}),uX({onSuccess:e=>(s.attribute("http.response.status_code",e.status),Np(s,"response",e.headers,f,c),e.status>=400&&e.status<600&&(s.attribute("error.type",String(e.status)),((e,t,r,n)=>{let i,s=Error.stackTraceLimit;rg(0);try{i=r8(new TN({reason:new TL({request:r,response:n})}))}finally{rg(s)}t.end(e.getRef(oJ)?e.getRef(ff).currentTimeNanosUnsafe():BigInt(0),i)})(r,s,t,e)),lI(NN(e,i,void 0!==n))),onFailure:e=>(!n&&o6(e)&&i.abort(),lT(e))})))})})),lI),"W",0,Nk],68429);let NU=iJ("effect/http/HttpRouter"),N$="~effect/http/HttpRouter/Route",Nj=e=>({...e,uninterruptible:e.uninterruptible??!1,prefix:"string"==typeof e.prefix?nv(e.prefix):e.prefix??nb,[N$]:N$}),NB=e=>e.endsWith("/")?e.slice(0,-1):e,NP=eZ(2,(e,t)=>(t=NB(t),"*"===e)?`${t}/*`:"/"===e?t:t+e),NR=((e,t)=>Nj({...e,path:NP(e.path,t),prefix:nF(e.prefix,{onNone:()=>NB(t),onSome:e=>NP(e,t)})}),(e,t)=>t?.global?da(lV(h8(function*(){let t=yield*NU,r=rN(e)?yield*e:e;yield*t.addGlobalMiddleware(r)}),i4())):new ND(rN(e)?da(ui(e,e=>i1(new Map([[NF,e]])))):dn(i1(new Map([[NF,e]]))))),NL=0,NF="effect/http/HttpRouter/MiddlewareFn";class ND{"~effect/http/HttpRouter/Middleware"={};layerFn;dependencies;constructor(e,t){this.layerFn=e,this.dependencies=t;let r=`effect/http/HttpRouter/Middleware-${++NL}`;this.layer=da(h8({self:this},function*(){let e=yield*uw(),t=[sr(e,NF)];if(this.dependencies){let r=yield*de,n=si(e,cs),i=yield*dt(this.dependencies,r,n);t.push(...NH(i))}return i1(new Map([[r,t]]))})).pipe(dc(this.layerFn))}layer;combine(e){return new ND(this.layerFn,this.dependencies?df(this.dependencies,e.layer):e.layer)}}let Nz=new WeakMap,NH=e=>{let t=Nz.get(e);if(t)return t;let r=aa(),n=0;for(let[t,i]of e.mapUnsafe)t.startsWith("effect/http/HttpRouter/Middleware-")&&(r.push(i),i.length>n&&(n=i.length));if(0===r.length)t=[];else{let e=new Set;for(let t=n-1;t>=0;t--)for(let n of r)t<n.length&&e.add(n[t]);t=s$(e).reverse()}return Nz.set(e,t),t};((function(){return 0==arguments.length?NR:NR(arguments[0],arguments[1])})(e=>r6(t=>{let r=st(t.context,Nf);return void 0!==r&&(r.loggerDisabled=!0),e}))).layer;let NJ=e=>()=>{let t=kn(kx(e));return CE((e,r)=>lI(ue(e,e=>t(e))))},NW=(e,t)=>()=>{let r=kr(kx(e),t);return CE((e,t)=>lI(ue(e,e=>r(e))))},Nq=eZ(2,(e,t)=>NJ(t.inputSchema)().pipe(AO(e),AO(NW(t.outputSchema)())));e.s(["G",0,NW,"a",0,NW,"L",0,Nq,"q",0,NJ],35905);let NK="~effect/encoding/Sse/SseError";class NV extends om("EventTooLarge"){get message(){return`Pending SSE event exceeded the maximum size of ${this.maxEventSize}`}}class NG extends om("SseError"){[NK]=NK;get message(){return this.reason.message}}let NY=kb({id:ka(kf),event:kf,data:kf}),NZ=kb({_tag:kC("Event"),id:kk(kf),event:kf,data:kf}),NX=yg({decode:e=>void 0===e.id?{event:e.event,data:e.data}:{id:e.id,event:e.event,data:e.data},encode:e=>({_tag:"Event",id:e.id,event:e.event??"message",data:e.data})}),NQ="~effect/encoding/Sse/Retry";class N0 extends op("Retry"){[NQ]=NQ;static is(e){return tx(e,NQ)}static filter(e){return N0.is(e)?nO(e):nI(e)}}e.s(["l",0,NY,"P",0,(e,t,r)=>AO(CE((e,r)=>lO(()=>{let r,n=[],i=function(e,t){let r,n,i,s,a,o,l,u=t?.maxEventSize??0xa00000,c=t?.dispatchEmptyNamedEvents===!0,f=0;return d(),{feed:function(t){if(0===t.length)return;r&&t.startsWith("\uFEFF")&&(t=t.slice(1)),r=!1;let h=t.length,p=f,g=0;for(;g<h;){if(s&&(s=!1,10===t.charCodeAt(g))){++g;continue}let r=g;for(;r<h;){let e=t.charCodeAt(r);if(13===e||10===e)break;++r}if(r===h){n.push(t.slice(g)),i+=h-g;break}s=13===t.charCodeAt(r);let u=t.slice(g,r);if(n.length>0&&(n.push(u),u=n.join(""),n=[],i=0),function(t){if(0===t.length){let t=void 0!==o&&""!==o,r=o||"message",n=l;o=void 0,l="",(n.length>0||c&&t)&&e({_tag:"Event",id:a,event:r,data:n.slice(0,-1)});return}let r=t.indexOf(":"),n=t,i="";r>=0&&(n=t.slice(0,r),i=t.slice(32===t.charCodeAt(r+1)?r+2:r+1)),"data"===n?l+=i+"\n":"event"===n?o=i:"id"!==n||i.includes("\0")?"retry"===n&&/^\d+$/.test(i)&&e(new N0({duration:a5(parseInt(i,10)),lastEventId:a})):a=i}(u),f!==p)return;g=r+1}if(i+l.length>u){let e=new NG({reason:new NV({maxEventSize:u})});return d(),e}},reset:d};function d(){f++,r=!0,n=[],i=0,s=!1,a=void 0,o=void 0,l=""}}(e=>{"Retry"===e._tag?r=e:n.push(e)},t),s=ue(e,e=>{for(let t=0;t<e.length;t++){let r=i.feed(e[t]);if(void 0!==r)return r8(r)}return lP});return lN(function e(){if(sf(n)){let e=n;return n=[],lI(e)}return r?r8(r):ue(s,e)})})),NW(NZ.pipe(k_(e,NX)),r)())],18244);let N1={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,OK:200,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};function N2(e){let t=e.toLowerCase().trim(),r=t.indexOf(";");return -1===r?t:t.slice(0,r).trim()}function N3(e){let t="string"==typeof e?N1[e]:e;return e=>void 0===Mu(e.ast)?e.annotateKey({httpApiStatus:t}):e.annotate({httpApiStatus:t})}e.s(["f",0,N2],53725);let N5=kg.pipe(N3(204)),N8=e=>ks(e)&&tx(e,"~effect/http-api/HttpApiSchema/Stream"),N4=e=>N8(e)&&"StreamSse"===e._tag,N6="~effect/http-api/HttpApiSchema/Upgrade",N9=(S7(e=>tx(e,OD))).pipe(N3(101)),N7=(e,t)=>ki(N9.ast,{[N6]:N6,protocol:e,headers:t}),Me=e=>ks(e)&&tx(e,N6),Mt="~effect/http-api/HttpApiSchema/WithHeaders",Mr="~effect/http-api/HttpApiSchema/WithHeadersValue",Mn=e=>ks(e)&&tx(e,Mt);function Mi(e,t,r){return ki(e.ast,{[Mt]:Mt,schema:t,headers:r})}function Ms(e){return t=>{var r;return r={_tag:"FormUrlEncoded",...e},t.annotate({"~httpApiEncoding":{_tag:r._tag,contentType:r.contentType??function(e){switch(e){case"Multipart":return"multipart/form-data";case"Json":return"application/json";case"FormUrlEncoded":return"application/x-www-form-urlencoded";case"Uint8Array":return"application/octet-stream";case"Text":return"text/plain"}}(r._tag)}})}}let Ma=e=>{if(yz(e)||yz(xy(e)))return!0;let t=e.encoding?.[0].to;return void 0!==t&&yz(t)},Mo=xD("~httpApiEncoding"),Ml=xD("~httpApiWithHeaders");function Mu(e){if(e.checks)for(let t=e.checks.length-1;t>=0;t--){let r=e.checks[t];if(r.annotations&&"httpApiStatus"in r.annotations)return r.annotations;if("FilterGroup"===r._tag){let e=Mu(r);if(void 0!==e)return e}}let t=e.annotations;return t&&"httpApiStatus"in t?t:void 0}function Mc(e){let t=Mu(e);return void 0!==t?t.httpApiStatus:e.context?.annotations?.httpApiStatus}let Mf={_tag:"Json",contentType:"application/json"},Md={_tag:"FormUrlEncoded",contentType:"application/x-www-form-urlencoded"};function Mh(e,t){let r=Mo(e);return r||(Eb(t)?Mf:Md)}function Mp(e){let t=Mo(e)??Mf;if("Multipart"===t._tag)throw Error("Multipart is not supported in response");return t}function Mg(e){return Mn(e)?Mc(e.ast)??Mc(e.schema.ast)??200:Mc(e.ast)??200}function Mm(e){return Mn(e)&&void 0===Mo(e.ast)?Mp(e.schema.ast):Mp(e.ast)}function Mb(e){return Mn(e)?Mc(e.ast)??Mc(e.schema.ast)??500:Mc(e.ast)??500}function My(e){let t=k9(e);return t.rebuild(Mw(t.ast))}e.s(["Y",0,N5,"c",0,Ms,"Z",0,Mh,"S",0,Mp,"C",0,Mm,"A",0,Mb,"p",0,Mg,"m",0,Ml,"I",0,Ma,"f",0,e=>N8(e)&&"StreamNdjson"===e._tag,"T",0,N8,"P",0,N4,"d",0,e=>N8(e)&&"StreamUint8Array"===e._tag,"z",0,Me,"q",0,Mn,"U",0,N7,"$",0,Mi,"F",0,e=>({[Mr]:Mr,body:e.body,headers:e.headers})],74892);let Mv=new yd(b6,ye(nX(tp))),Mx=e6(e=>{if("Undefined"===e._tag)return new y6(e.annotations,void 0,void 0,e.context);if("Suspend"===e._tag)return e.recur(Mx);if("Union"!==e._tag)return e;let t=xa(e.types,Mx);if(t===e.types)return e;let r=t.filter(e=>"Never"!==e._tag);return 1===r.length&&void 0===e.checks&&void 0===e.annotations?v5(r[0],e.context):new vF(r,e.options,e.annotations,e.checks,void 0,e.context)}),Mw=xi(e=>{if("Union"===e._tag||"Suspend"===e._tag)return e.recur(Mw);if("Objects"!==e._tag)return e;let t=xa(e.propertySignatures,e=>{let t=xy(e.type);if(!xm(t))return e;let r=Mx(t);return r===t?e:new vS(e.name,xp(r,e.type,Mv))});return t===e.propertySignatures?e:new vE(t,e.indexSignatures,e.annotations,e.checks,void 0,e.context,e.encodingChecks)}),MS="~effect/http-api/HttpApiEndpoint";function Mk(e){let t=Array.from(e.success);return sf(t)?t:[N5]}function ME(e){let t=new Set(e.error),r=e.disableCodecs?eX:MO;for(let n of e.middlewares)for(let e of n.error)t.add(r(e));return Array.from(t)}let M_={[MS]:MS,pipe(){return eV(this,arguments)},prefix(e){return MA({...MC(this),path:NP(this.path,e)})},middleware(e){return MA({...MC(this),middlewares:new Set([...this.middlewares,e])})},annotate(e,t){return MA({...MC(this),annotations:i7(this.annotations,e,t)})},annotateMerge(e){return MA({...MC(this),annotations:su(this.annotations,e)})}},MC=e=>({identifier:e.identifier,path:e.path,method:e.method,params:e.params,query:e.query,headers:e.headers,payload:e.payload,success:e.success,error:e.error,annotations:e.annotations,middlewares:e.middlewares,disableCodecs:e.disableCodecs});function MA(e){function t(){}return Object.setPrototypeOf(t,M_),Object.assign(t,e)}function MI(e,t){if(void 0!==e)return t(ks(e)?e:kb(e))}let MT="effect/http-api/stream/failure",MO=e6(e=>{var t;let r,n;if(N8(e))return e;if(Me(e))return void 0===e.headers?e:N7(e.protocol,My(e.headers));if(Mn(e)){let t=N8(e.schema)?e.schema:MU(e.schema,Mm(e));return Mi(e,t,My(e.headers))}return r=Mp((t=e).ast),void 0===(n=Ml(t.ast))?MU(t,r):t.annotate({"~httpApiWithHeaders":{...n,bodyCodec:MU(n.body,r),headersCodec:My(n.headers)}})});function MN(e,t){let r=e.get(t);return void 0===r&&(r={bufferedContentTypes:new Set,noContent:!1},e.set(t,r)),r}function MM(e,t){let r=new Map;for(let n of e){let e=t(n),i=Ml(n.ast),s=Mn(n)?n.schema:i?.body??n,a=Ma(s.ast)?"":N2(N8(s)?s.contentType:Mm(n).contentType),o=r.get(e);void 0===o&&(o={headerContentType:void 0,plainContentTypes:new Set},r.set(e,o));let l=()=>Error(`Cannot combine a response with headers with another response for status ${e} and content-type: ${a||"<no content>"}`);if(Mn(n)||void 0!==i){if(void 0!==o.headerContentType)throw Error(`Cannot declare multiple responses with headers for status ${e}`);if(o.plainContentTypes.has(a))throw l();o.headerContentType=a}else{if(o.headerContentType===a)throw l();o.plainContentTypes.add(a)}}}function MU(e,t){switch(t._tag){case"Json":return k6(e);case"FormUrlEncoded":return k9(e);case"Text":case"Uint8Array":return e}}function M$(e,t){if(!Eb(t))return My(e);switch(Mh(e.ast,t)._tag){case"Json":return k6(e);case"FormUrlEncoded":return k9(e);case"Text":case"Uint8Array":case"Multipart":return e}}e.s(["get",0,(e,t,r)=>{let n=r?.disableCodecs??!1,i=n?eX:My,s=function(e,t){let r=new Map;if(void 0===e)return r;let n=Array.isArray(e)?e:ks(e)?[e]:[kb(e).pipe(Ms())],i=t?eX:M$,s=!1;for(let e of n){if(N8(e)){if(N4(e))throw Error("StreamSse is response-only and cannot be used as a payload");if(!Eb("GET"))throw Error("GET endpoints cannot declare a streaming payload");if(s)throw Error("Multiple streaming payloads are not supported");for(let t of(s=!0,e.contentTypes)){let n=N2(t);if(r.has(n))throw Error(`Cannot combine buffered and streaming payloads for content-type: ${t}`);r.set(n,{encoding:{_tag:"Stream",contentType:t},schemas:[e]})}continue}let t=Mh(e.ast,"GET"),n=N2(t.contentType),a=r.get(n);if(a){if("Stream"===a.encoding._tag)throw Error(`Cannot combine buffered and streaming payloads for content-type: ${t.contentType}`);if(a.encoding._tag!==t._tag)throw Error(`Multiple payload encodings for content-type: ${t.contentType}`);if("Multipart"===a.encoding._tag)throw Error(`Multiple multipart payloads for content-type: ${t.contentType}`);a.schemas.push(i(e,"GET"))}else r.set(n,{encoding:t,schemas:[i(e,"GET")]})}return r}(r?.payload,n);return MA({identifier:e,path:t,method:"GET",params:MI(r?.params,i),query:MI(r?.query,i),headers:MI(r?.headers,i),payload:s,success:function(e,t,r){if(void 0===e)return new Set;let n=sj(e);return function(e,t){let r=e.filter(Me);if(r.length>1)throw Error("Cannot declare more than one upgrade");let n=1===r.length;if(n){!1;for(let{encoding:e}of t.values())if("Stream"===e._tag||"Multipart"===e._tag&&"stream"===e.mode)throw Error("Upgrade endpoints cannot declare a streaming payload")}let i=!1,s=new Map;for(let t of e){if(Me(t))continue;let e=Mn(t)?t.schema:t,r=Mg(t);if(n&&101===r)throw Error("Cannot combine an upgrade with another success response for status: 101");if(N8(e)){if(n)throw Error("Cannot combine an upgrade with a streaming success response");if(function(e,t){if("HEAD"===t)throw Error("HEAD endpoints cannot declare streaming success responses");if(N4(e)&&function e(t,r){if(r.has(t))return!1;if(r.add(t),yV(t))return t.types.some(t=>e(t,r));if(yG(t))return e(t.thunk(),r);if(!yK(t))return!1;let n=t.propertySignatures.find(e=>"event"===e.name);return void 0!==n&&function e(t,r){if(r.has(t))return!1;r.add(t);let n=xy(t);return n!==t?e(n,r):yJ(t)?t.literal===MT:yV(t)?t.types.some(t=>e(t,r)):!!yG(t)&&e(t.thunk(),r)}(n.type,r)}(xy(e.events.ast),new Set))throw Error(`SSE event name is reserved: ${MT}`)}(e,"GET"),i)throw Error("Multiple streaming success responses are not supported");i=!0;let t=MN(s,r);if(t.noContent)throw Error(`Cannot combine no-content and streaming success responses for status: ${r}`);for(let n of e.contentTypes)if(t.bufferedContentTypes.has(N2(n)))throw Error(`Cannot combine buffered and streaming success responses for status ${r} and content-type: ${n}`);s.set(r,{...t,stream:e})}else{let n=MN(s,r),i=Ma(e.ast);if(void 0!==n.stream){if(i)throw Error(`Cannot combine no-content and streaming success responses for status: ${r}`);let e=Mm(t),s=N2(e.contentType);if(n.stream.contentTypes.some(e=>N2(e)===s))throw Error(`Cannot combine buffered and streaming success responses for status ${r} and content-type: ${e.contentType}`)}i||n.bufferedContentTypes.add(N2(Mm(t).contentType)),n.noContent=n.noContent||i}}MM(e,Mg)}(n,t),new Set(r?n:n.map(MO))}(r?.success,s,n),error:function(e,t){if(void 0===e)return new Set;let r=sj(e);for(let e of r){let t=Mn(e)?e.schema:e;if(N8(t))throw Error("Streaming schemas are not supported in error responses");if(Me(t))throw Error("Upgrade schemas are not supported in error responses")}return MM(r,Mb),new Set(t?r:r.map(MO))}(r?.error,n),annotations:i4(),middlewares:new Set,disableCodecs:n})},"getErrorSchemas",0,ME,"getPayloadSchemas",0,function(e){let t=[];for(let{schemas:r}of e.payload.values())t.push(...r);return t},"getSuccessSchemas",0,Mk],63002);let Mj="~effect/http-api/HttpApi",MB={[Mj]:Mj,pipe(){return eV(this,arguments)},add(...e){let t={...this.groups};for(let r of e)ry(t,r.identifier,r);return MR({...MP(this),groups:t})},addHttpApi(e){let t={...this.groups};for(let r of Object.keys(e.groups)){let n=e.groups[r];ry(t,r,n.annotateMerge(su(e.annotations,n.annotations)))}return MR({...MP(this),groups:t})},prefix(e){return MR({...MP(this),groups:sT(this.groups,t=>t.prefix(e))})},middleware(e){return MR({...MP(this),groups:sT(this.groups,t=>t.middleware(e))})},annotate(e,t){return MR({...MP(this),annotations:i7(this.annotations,e,t)})},annotateMerge(e){return MR({...MP(this),annotations:su(this.annotations,e)})}},MP=e=>({identifier:e.identifier,groups:e.groups,annotations:e.annotations}),MR=e=>{function t(){}return Object.setPrototypeOf(t,MB),Object.assign(t,e)},ML=(e,t)=>{let r=new Map;return e.forEach(function(e){let n=Mn(e)?e.schema:e;if(N8(n)||Me(n))return;let i=t(e),s=r.get(i);void 0===s?r.set(i,[e]):s.push(e)}),r};class MF extends(iJ())("effect/http-api/HttpApi/ParseOptions"){}class MD extends(iJ())("effect/http-api/HttpApi/ParamsParseOptions"){}class Mz extends(iJ())("effect/http-api/HttpApi/QueryParseOptions"){}class MH extends(iJ())("effect/http-api/HttpApi/HeadersParseOptions"){}class MJ extends(iJ())("effect/http-api/HttpApi/PayloadParseOptions"){}class MW extends(iJ())("effect/http-api/HttpApi/SuccessParseOptions"){}class Mq extends(iJ())("effect/http-api/HttpApi/ErrorParseOptions"){}e.s(["getSlotParseOptions",0,e=>{let t=st(e,MF);return{params:st(e,MD)??t,query:st(e,Mz)??t,headers:st(e,MH)??t,payload:st(e,MJ)??t,success:st(e,MW)??t,error:st(e,Mq)??t}},"make",0,e=>MR({identifier:e,groups:{},annotations:i4()}),"reflect",0,(e,t)=>{for(let r of Object.values(e.groups)){let n=su(e.annotations,r.annotations);for(let e of(t.onGroup({group:r,mergedAnnotations:n}),Object.values(r.endpoints)))(!t.predicate||t.predicate({endpoint:e,group:r}))&&t.onEndpoint({group:r,endpoint:e,middleware:e.middlewares,mergedAnnotations:su(n,e.annotations),successes:ML(Mk(e),Mg),errors:ML(ME(e),Mb)})}}],44322);var MK=e.i(44322),MK=MK,MV=e.i(63002),MV=MV;let MG="~effect/http-api/HttpApiGroup",MY={[MG]:MG,add(...e){let t={...this.endpoints};for(let r of e)ry(t,r.identifier,r);return MX({...MZ(this),endpoints:t})},prefix(e){return MX({...MZ(this),endpoints:sT(this.endpoints,t=>t.prefix(e))})},middleware(e){return MX({...MZ(this),endpoints:sT(this.endpoints,t=>t.middleware(e))})},annotateMerge(e){return MX({...MZ(this),annotations:su(this.annotations,e)})},annotate(e,t){return MX({...MZ(this),annotations:i7(this.annotations,e,t)})},annotateEndpointsMerge(e){return MX({...MZ(this),endpoints:sT(this.endpoints,t=>t.annotateMerge(e))})},annotateEndpoints(e,t){return MX({...MZ(this),endpoints:sT(this.endpoints,r=>r.annotate(e,t))})},pipe(){return eV(this,arguments)}},MZ=e=>({identifier:e.identifier,topLevel:e.topLevel,endpoints:e.endpoints,annotations:e.annotations}),MX=e=>{function t(){}return Object.setPrototypeOf(t,MY),t.key=`effect/http-api/HttpApiGroup/${e.identifier}`,Object.assign(t,e)};e.s(["make",0,(e,t)=>MX({identifier:e,topLevel:t?.topLevel??!1,endpoints:{},annotations:i4()})],10147);var MQ=e.i(10147),MQ=MQ;let M0=Ei.Struct({id:Es.String,name:Es.String,unit:Ea.optionalKey(Es.String),writable:Eo.Boolean,value:Ea.optionalKey(El.Union([Eu.Number,Eo.Boolean])),ts:Ea.optionalKey(Eu.Number)}),M1=Ei.Struct({id:Es.String,protocol:Ec.Literals(["modbus-tcp","bacnet-ip","simulator"]),status:Ec.Literals(["starting","ok","failing"]),pollIntervalMs:Eu.Number,reason:Ea.optionalKey(Es.String),lastSuccess:Ea.optionalKey(Eu.Number),pointCount:Eu.Number,points:Ef.Array(M0)}),M2=Ei.Struct({at:Eu.Number,device:Es.String,point:Es.String,status:Ec.Literals(["written","rejected","failed"]),reason:Ea.optionalKey(Es.String)}),M3=Ei.Struct({version:Es.String,node:Es.String,memoryBytes:Eu.Number,heapBytes:Eu.Number,cpuPercent:Eu.Number,eventLoopLagMs:Ei.Struct({p99:Eu.Number,max:Eu.Number}),clockSteps:Eu.Number,openFds:Ea.optionalKey(Eu.Number),temperatureC:Ea.optionalKey(Eu.Number),throttled:Ea.optionalKey(Ei.Struct({now:Ef.Array(Es.String),watched:Ef.Array(Es.String)})),diskFreeBytes:Ea.optionalKey(Eu.Number)}),M5=Ei.Struct({topic:Es.String,payload:Es.String,truncated:Eo.Boolean,retained:Eo.Boolean,at:Eu.Number,count:Eu.Number}),M8=Ei.Struct({protocolVersion:Ec.Literals(["5","3.1.1"]),maximumQoS:Ec.Literals([0,1]),retainAvailable:Eo.Boolean,keepAliveSeconds:Eu.Number,receiveMaximum:Eu.Number,maximumPacketSize:Ea.optionalKey(Eu.Number)}),M4=Ei.Struct({url:Es.String,connected:Eo.Boolean,connectedAt:Ea.optionalKey(Eu.Number),connection:Ea.optionalKey(M8),connects:Eu.Number,failedConnects:Eu.Number,published:Eu.Number,publishFailures:Eu.Number}),M6=Ei.Struct({path:Es.String,rows:Eu.Number,maxRows:Eu.Number,dropped:Eu.Number,written:Eu.Number,delivered:Eu.Number,droppedBy:Ed.Record(Es.String,Eu.Number),failures:Eu.Number,disabled:Eo.Boolean}),M9=Ei.Struct({site:Es.String,building:Es.String,id:Es.String,since:Eu.Number,now:Eu.Number,broker:M4,buffer:Ea.optionalKey(M6),host:Ea.optionalKey(M3),devices:Ef.Array(M1),commands:Ef.Array(M2)}),M7=Ei.Struct({device:Es.String,point:Es.String,value:Ea.optionalKey(El.Union([Eu.Number,Eo.Boolean])),ts:Ea.optionalKey(Eu.Number)}),Ue=Ei.Struct({readings:Ef.Array(M7)});class Ut extends Eh.TaggedError()("ValuesQueryInvalid",{message:Es.String},{httpApiStatus:400}){}let Ur=Ei.Struct({messages:Ef.Array(M5),droppedTopics:Eu.Number}),Un=Ei.Struct({device:Es.String,id:Es.String,name:Es.String,unit:Ea.optionalKey(Es.String),writable:Eo.Boolean,topic:Es.String,source:Es.String,publish:Es.String,limits:Ea.optionalKey(Ei.Struct({min:Eu.Number,max:Eu.Number})),scaling:Ea.optionalKey(Ei.Struct({factor:Eu.Number,offset:Eu.Number})),brick:Ea.optionalKey(Es.String),haystack:Ea.optionalKey(Ef.Array(Es.String))}),Ui=Ei.Struct({points:Ef.Array(Un)}),Us=Ei.Struct({t:Eu.Number,min:Eu.Number,max:Eu.Number,avg:Eu.Number,count:Eu.Number}),Ua=Ei.Struct({device:Es.String,point:Es.String,from:Eu.Number,to:Eu.Number,stepMs:Eu.Number,resolution:Ec.Literals(["read","minute"]),buckets:Ef.Array(Us)});class Uo extends Eh.TaggedError()("HistoryUnavailable",{message:Es.String},{httpApiStatus:404}){}class Ul extends Eh.TaggedError()("HistoryQueryInvalid",{message:Es.String},{httpApiStatus:400}){}let Uu=Ei.Struct({key:Es.String,value:Ep.Json}),Uc=Ei.Struct({sections:Ef.Array(Ei.Struct({key:Es.String,entries:Ef.Array(Uu)})),devices:Ef.Array(Ei.Struct({id:Es.String,protocol:Es.String,pointCount:Eu.Number,entries:Ef.Array(Uu)}))});class Uf extends MQ.make("status").add(MV.get("status","/api/status",{query:{points:Eg.optional(Ec.Literals(["all","none"]))},success:M9})).add(MV.get("values","/api/values",{query:{points:Es.String},success:Ue,error:Ut})).add(MV.get("messages","/api/messages",{success:Ur})).add(MV.get("points","/api/points",{success:Ui})).add(MV.get("config","/api/config",{success:Uc})).add(MV.get("history","/api/history",{query:{device:Es.String,point:Es.String,from:Eg.optional(Em.FiniteFromString),to:Eg.optional(Em.FiniteFromString),buckets:Eg.optional(Em.FiniteFromString)},success:Ua,error:[Uo,Ul]})){}class Ud extends MK.make("ot-gateway").add(Uf){}e.s(["b",0,500,"K",0,Ud],71658),e.s([],66563)},24775,69598,12310,50492,87486,12379,83453,97490,40770,92387,27195,84279,e=>{"use strict";let t;var r=e.i(4270);e.s(["f",0,r],24775),e.s(["f",0,r],69598),e.s(["f",0,r],12310),e.s(["f",0,r],50492),e.s(["f",0,r],87486),e.s(["f",0,r],12379),e.s(["f",0,r],83453),e.s(["f",0,r],97490),e.s(["f",0,r],40770),e.s(["f",0,r],92387);var n=e.i(88534),i=e.i(91889),s=e.i(89555),a=e.i(68429),o=e.i(80479),l=e.i(56523);let u=n.w("effect/http/FetchHttpClient/Fetch",{defaultValue:()=>globalThis.fetch}),c=n.w("effect/http/FetchHttpClient/StreamBodyFallback",{defaultValue:()=>"error"});class f extends(n.n())("effect/http/FetchHttpClient/RequestInit"){}let d=a.h((e,a,d,h)=>{let p;if(void 0!==e.headers.upgrade)return r.fail(new o.J({reason:new o.k({request:e,description:"fetch cannot send an HTTP upgrade request"})}));let g=h.getRef(u),m=n.q(h.context,f)??{},b=m.headers?s.D(s.O(m.headers),e.headers):e.headers;b["content-length"]&&(b=s.G(b,"content-length"));let y=r.sync(()=>p?.abort()),v=t=>r.map(r.tryPromise({try:()=>g(a,{...m,method:e.method,headers:b,body:t,duplex:"u">typeof ReadableStream&&t instanceof ReadableStream?"half":void 0,signal:p?AbortSignal.any([d,p.signal]):d}),catch:t=>new o.J({reason:new o.k({request:e,cause:t})})}),t=>{let n=l.n(e,t);return p?(null===t.body&&p.abort(),Object.create(n,{...Object.fromEntries(["arrayBuffer","text","json","formData","urlParamsBody"].map(e=>[e,{get:()=>r.ensuring(n[e],y)}])),stream:{get:()=>i.t(n.stream,y)}})):n}).pipe(r.onError(()=>y));switch(e.body._tag){case"Raw":case"Uint8Array":return v(e.body.body);case"FormData":return v(e.body.formData);case"Stream":if(t??=(()=>{try{let e=!1,t=new ReadableStream,r=new Request("https://example.com",{method:"POST",body:t,get duplex(){return e=!0,"half"}});return(e||r.body===t)&&!r.headers.has("Content-Type")}catch{return!1}})()){p=new AbortController;let t=AbortSignal.any([d,p.signal]),n=r.callback(e=>{let n=()=>e(r.interrupt);return t.aborted?void n():(t.addEventListener("abort",n,{once:!0}),r.sync(()=>t.removeEventListener("abort",n)))});return r.flatMap(i.P(i.x(e.body.stream,n)),v)}if("error"===h.getRef(c))return r.fail(new o.J({reason:new o.E({request:e,description:"Streaming request bodies are not supported in this runtime"})}));return i.j(e.body.stream).pipe(r.mapError(t=>new o.J({reason:new o.E({request:e,cause:t})})),r.flatMap(v))}return v(void 0)}),h=a.s(r.succeed(d));e.s(["layer",0,h],53660);var p=e.i(53660);e.s(["f",0,p],27195);var g=e.i(39916),m=e.i(56999),b=e.i(11634),y=e.i(81315),v=(e.i(35905),e.i(47773)),x=e.i(5843),w=e.i(20612),S=e.i(41793);let k="~effect/encoding/Ndjson/NdjsonError",E=new TextEncoder,_=new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});class C extends v.B("NdjsonError"){[k]=k;get message(){return this.kind}}let A=()=>y.HD((e,t)=>r.succeed(r.flatMap(e,e=>{try{return r.succeed(g.j(e.map(e=>{let t=JSON.stringify(e);if(void 0===t)throw TypeError("Value cannot be represented as JSON");return t}).join("\n")+"\n"))}catch(e){return r.fail(new C({kind:"Pack",cause:e}))}}))),I=()=>y.Cz(A(),g.w(e=>E.encode(e))),T=(e,t,n)=>{let i,s,a=(e,t)=>(i=t,g.G(e))?r.succeed(e):void 0!==t?r.fail(t):void 0,o=r.suspend(()=>void 0!==i?r.fail(i):void 0!==s?b.a(s.leftover):S.r(e,{onSuccess:e=>{let r=[];return a(r,t(e,r))??o},onFailure:r.failCause,onDone:e=>{s={leftover:e};let t=[];return a(t,n(t))??b.a(e)}}));return o},O=(e,t,r,n)=>{if(!(r&&/^[ \t]*$/.test(e)))try{t.push(JSON.parse(e))}catch(e){return new C({kind:"Unpack",reason:"InvalidJson",unterminated:n,cause:e})}},N=()=>void 0,M=new Uint8Array(0),U=e=>y.HD((t,n)=>r.sync(()=>{let r=e?.ignoreEmptyLines===!0,n=e?.maxLineBytes??1/0,i=new TextDecoder("utf-8",{fatal:!0}),s=[],a=0,o=!1,l=(e,t,r)=>{if(0===a)return e.subarray(t,r);let n=new Uint8Array(a+r-t),i=0;for(let e of s)n.set(e,i),i+=e.length;return n.set(e.subarray(t,r),i),s=[],a=0,n},u=(e,t,n)=>{let s;try{s=i.decode(e)}catch(e){return new C({kind:"Unpack",reason:"InvalidUtf8",unterminated:n,cause:e})}let a=i!==_;if(i=_,!a||!n||0!==s.length)return O(s,t,r,n)};return T(t,(e,t)=>{for(let r of e){let e=0;for(let i=0;i<r.length;i++){let s=r[i];if(10===s||13===s){if(10===s&&o)e=i+1;else{let n=u(l(r,e,i),t,!1);if(void 0!==n)return n;e=i+1}o=13===s}else if(o=!1,a+i+1-e>n)return new C({kind:"Unpack",reason:"LineTooLarge",unterminated:!1,cause:RangeError(`NDJSON line exceeds maxLineBytes of ${n}`)})}e<r.length&&(s.push(r.slice(e)),a+=r.length-e)}},e=>0===a?void 0:u(l(M,0,0),e,!0))}));e=>y.s$(e[0]),(e,t)=>y.cu(y.cu(A(),e),y.HD((e,n)=>{let i=t?.ignoreEmptyLines===!0,s=!1,a=S.r(e,{onSuccess:r.succeed,onFailure:r.failCause,onDone:e=>(s=!0,b.a(e))});return r.map(y.$(y.vf())(a,n),e=>T(e,(e,t)=>{for(let r of e){let e=O(r,t,i,s);if(void 0!==e)return e}},N))}));var $=e.i(18244),j=e.i(34087),B=e.i(85266),P=e.i(57732);e.i(5839);var R=e.i(86501),L=e.i(4523),F=e.i(94831),D=e.i(73798),z=e.i(40264),H=e.i(94249);let J=(0,x.p)(2,(e,t)=>void 0===e?void 0:t(e));var W=e.i(44322),q=e.i(63002),K=e.i(74892),V=e.i(53725),G=e.i(91642);let Y=new Set,Z="~effect/http-api/HttpApiClient/Upgraded",X=(e,t)=>{if(void 0===t||!e.includes(":"))return t=>e;let r=function(e){if(void 0===e)return Y;let t=D.xK(e.ast);return D.Go(t)&&0===t.indexSignatures.length?new Set(t.propertySignatures.map(e=>String(e.name))):void 0}(t);return t=>(function(e,t,r){let n=/::|:(\w+)/g,i="",s=0;for(let a=n.exec(e);null!==a;a=n.exec(e)){let o=a[1];if(void 0===o||void 0!==t&&!t.has(o))continue;let l=n.lastIndex;"("===e[l]&&(l=(0,G.g)(e,l)+1);let u="?"===e[l];u&&l++;let c=r(o,u),f=a.index;void 0===c&&"/"===e[f-1]&&f--,i+=e.slice(s,f)+(c??""),n.lastIndex=l,s=l}return i+e.slice(s)})(e,r,(e,r)=>{let n=t[e];if("."===n||".."===n)throw Error(`Invalid path parameter: ${e}`);if(void 0!==n)return encodeURIComponent(n);if(!r)throw Error(`Missing path parameter: ${e}`)})};function Q(e,t,n){var i;let s=e.some(e=>K.q(e)||void 0!==K.m(e.ast)),a=s?F.Union(e.map(e=>{var i,s,a;let o,l,u,c;return i=e,s=t,a=n,l=void 0!==(o=K.m(i.ast))?{body:o.bodyCodec,headers:o.headersCodec,toValue:o.transformation.decode}:K.q(i)?{body:i.schema,headers:i.headers,toValue:K.F}:{body:i,headers:F.Unknown,toValue:e=>e.body},u=F.decodeUnknownEffect(ep(l.body).pipe(F.decodeTo(l.body)),s),c=F.decodeUnknownEffect(l.headers,a),ee.pipe(F.decodeTo(K.q(i)?i:F.toType(i),H.l({decode:e=>r.all({body:u(e.body),headers:c(e.headers)}).pipe(r.map(l.toValue),r.mapError(e=>e.issue)),encode:(e,t)=>r.fail(new z.v({message:"Decode only schema"},e,t))})))})):(i=e,F.Union(i.map(function(e){return ep(e).pipe(F.decodeTo(e))}))),o=F.decodeUnknownEffect(a,t);return e=>r.flatMap(e.arrayBuffer,s?t=>o({body:t,headers:e.headers}):o)}let ee=F.Struct({body:F.Unknown,headers:F.Unknown}),et=e=>{let{endpoint:t,errors:n,successes:s,mergedAnnotations:a}=e,l=W.getSlotParseOptions(a),u={orElse:eg},c=new Map;for(let[e,t]of n.entries())for(let[r,n]of ei(t).entries())er(c,e,r,Q(n,l.error,l.headers));for(let[e,t]of c.entries()){let n=en(t);u[e]=e=>r.flatMap(r.catchCause(n(e),t=>r.failCause(b.i(b.O(new o.J({reason:new o.x({request:e.request,response:e})})),t))),r.fail)}let f=new Map;for(let[e,t]of s.entries())for(let[r,n]of ei(t).entries())er(f,e,r,Q(n,l.success,l.headers));for(let e of function(e){let t=[];for(let r of e.success){let e=K.q(r)?r.schema:r;K.T(e)&&t.push(r)}return t}(t)){let t=ea(e)?e.schema:e,n=K.p(e),s=function(e,t,n){let s=ea(e),a=function(e,t){if(K.d(e))return e=>e.stream;if(K.f(e)){let r=F.decodeUnknownEffect(F.toCodecJson(e.schema),t),n=m.h(e.maxElementBytes);return e=>e.stream.pipe(i.B(U({ignoreEmptyLines:!0,maxLineBytes:n})),i.d(t=>w.X(t,k)?"LineTooLarge"!==t.reason?eu(t):new o.J({reason:new o.p({request:e.request,response:e,description:`NDJSON line exceeds maxElementBytes of ${n} bytes`})}):t),i.U(e=>r(e)))}let n=function(e,t){let r=F.Union([F.Struct({id:F.optional(F.String),event:F.Literal(es),data:F.fromJsonString(F.toCodecJson(F.Cause(e.error,F.Defect())))}),e.events]),n=$.P(r,void 0,t);return e=>void 0===e?n:$.P(r,e,t)}(e,t);return(t,s)=>(function(e,t,n){let s=i.X(e.pipe(i.S,i.B(n)),e=>r.sync(()=>{let t;return r.suspend(()=>void 0!==t?r.failCause(t):r.flatMap(e,e=>{for(let n=0;n<e.length;n++){let i=e[n];if(i.event===es&&b.r(i.data)){if(0===n)return r.failCause(i.data);t=i.data,e=e.slice(0,n);break}}return r.succeed(e)}))}));return"data"===t.sseMode?i.y(s,e=>e.data):s})(t.stream,e,n(s))}(s?e.schema:e,t),l=(e,t)=>r.map(r.context(),r=>i.W(a(e,t),r));if(!s)return l;let u=F.decodeUnknownEffect(e.headers,n);return(e,t)=>r.flatMap(u(e.headers),n=>r.map(l(e,t),e=>K.F({body:e,headers:n})))}(e,l.success,l.headers);for(let e of t.contentTypes)er(f,n,e,s)}for(let[e,t]of f.entries())u[e]=en(t);let d=eo(t);if(void 0!==d){let e=void 0===d.headers?r.succeed:F.decodeUnknownEffect(d.headers,l.headers);u[101]=t=>r.uninterruptibleMask(n=>r.flatMap(t.upgrade,i=>n(e(t.headers)).pipe(r.map(e=>({[Z]:Z,headers:e,socket:i})),r.onError(()=>r.ignore(r.scoped(i.reader))))))}return(e,t)=>(u[e.status]??u.orElse)(e,t)};function er(e,t,r,n){let i=V.f(r),s=e.get(t);void 0===s?e.set(t,[{contentType:i,decode:n}]):s.push({contentType:i,decode:n})}function en(e){let t=e[0];return void 0!==t&&e.every(e=>e.decode===t.decode)?t.decode:(t,n)=>{var i,s;let a,l=V.f(t.headers["content-type"]??""),u=e.find(e=>e.contentType===l);return void 0===u?(i=t,s=l,a=Array.from(new Set(e.map(e=>e.contentType))).join(", "),r.fail(new o.J({reason:new o.p({request:i.request,response:i,description:`Unsupported response content-type for status ${i.status}: ${s||"<missing>"}. Expected one of: ${a}`})}))):u.decode(t,n)}}function ei(e){let t=new Map;for(let r of e){let e=K.q(r)?r.schema:r,n=K.I(e.ast)?"":V.f(K.C(r).contentType),i=t.get(n);void 0===i?t.set(n,[r]):i.push(r)}return t}let es="effect/http-api/stream/failure",ea=e=>K.q(e);function eo(e){for(let t of e.success)if(K.z(t))return t}let el=e=>w.X(e,k)&&"Pack"===e.kind,eu=e=>new F.SchemaError(new z.X({message:"InvalidUtf8"===e.reason?"Expected valid UTF-8":e.unterminated?"Expected a valid JSON line, got an unterminated final line":"Expected a valid JSON line"})),ec=F.instanceOf(globalThis.ArrayBuffer,{expected:"ArrayBuffer"}),ef=ec.pipe(F.decodeTo(F.Uint8Array,H.O({decode:e=>new Uint8Array(e),encode:e=>e.byteLength===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}))),ed=ec.pipe(F.decodeTo(F.String,H.O({decode:e=>new TextDecoder().decode(e),encode(e){let t=new TextEncoder().encode(e);return t.byteLength===t.buffer.byteLength?t.buffer:t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength)}}))),eh=ed.pipe(F.decodeTo(F.Union([(F.Literal("")).pipe(F.decodeTo(F.Undefined,H.O({decode:()=>void 0,encode:()=>""}))),F.UnknownFromJsonString])));function ep(e){switch(K.S(e.ast)._tag){case"Json":return D.YM(D.sl(e.ast))?eh.pipe(F.decodeTo(F.Unknown,H.O({decode:e=>void 0===e?null:e,encode:e=>null===e?void 0:e}))):eh;case"FormUrlEncoded":return ed.pipe(F.decodeTo(F.RecordFromUrlParams,H.O({decode:e=>R.O(new URLSearchParams(e)),encode:R.e})));case"Uint8Array":return ef;case"Text":return ed}}let eg=e=>r.fail(new o.J({reason:new o.p({request:e.request,response:e,description:"undeclared status code"})})),em=F.declare(j.$),eb=new WeakMap;e.s(["make",0,(e,t)=>r.flatMap(a.S,n=>{var s,o;let l,u;return s=e,o={...t,httpClient:t?.transformClient?t.transformClient(n):n},u={},(l={...o,onGroup({group:e}){e.topLevel||L.h(u,e.identifier,{})},onEndpoint({endpoint:e,endpointFn:t,group:r}){L.h(r.topLevel?u:u[r.identifier],e.identifier,t)}},r.gen(function*(){let e=yield*r.context(),t=l.httpClient.pipe(l?.baseUrl===void 0?x.K:a.W(B.e(l.baseUrl.toString())));W.reflect(s,{predicate:l?.predicate,onGroup(e){l.onGroup?.(e)},onEndpoint(n){var s,a;let o,{group:u,endpoint:c,mergedAnnotations:f}=n,d=W.getSlotParseOptions(f),h=X(c.path,c.params),p=eo(c),m=et(n),b=J(c.params,e=>F.encodeUnknownEffect(e,d.params)),y=[];for(let e of q.getPayloadSchemas(c))K.d(e)||K.f(e)?o=e:y.push(e);let v=J(o,e=>({contentType:e.contentType,encode:function(e,t){if(K.d(e))return e=>e;let r=F.encodeUnknownEffect(F.NonEmptyArray(F.toCodecJson(e.schema)),t);return e=>e.pipe(i.g(e=>r(e)),i.B(I()),i.E(el,i.v))}(e,d.payload)})),x=g.G(y)?F.encodeUnknownEffect(P.T(c.method)?(s=y,a=c.method,F.Union(s.map(e=>(function(e,t){let n=e.ast,i=eb.get(n);if(void 0!==i)return i;let s=K.Z(n,t),a=em.pipe(F.decodeTo(e,H.l({decode:(e,t)=>r.fail(new z.v({message:"Encode only schema"},e,t)),encode(e,t){switch(s._tag){case"Multipart":return r.fail(new z.v({message:"Payload must be a FormData"},e,t));case"Json":try{let t=JSON.stringify(e);return r.succeed(j.o(t,s.contentType))}catch{return r.fail(new z.X({expected:"a JSON-serializable request body"},e,t))}case"Text":if("string"!=typeof e)return r.fail(new z.X({message:"Expected a string"},e,t));return r.succeed(j.o(e,s.contentType));case"FormUrlEncoded":if(!w.C(e))return r.fail(new z.X({message:"Expected a record"},e,t));return r.succeed(j.s(R.O(e),s.contentType));case"Uint8Array":if(!(e instanceof Uint8Array))return r.fail(new z.X({message:"Expected a Uint8Array"},e,t));return r.succeed(j.Z(e,s.contentType))}}})));return eb.set(n,a),a})(e,a)))):F.Union(y),d.payload):void 0,S=J(c.headers,e=>F.encodeUnknownEffect(e,d.headers)),k=J(c.query,e=>F.encodeUnknownEffect(e,d.query)),E=Array.from(n.middleware,e=>`${e.key}/Client`),_=r.fnUntraced(function*(n){let s=B.h(c.method)(c.path);if(void 0!==n){if(void 0!==b){let e=yield*b(n.params);s=B.Z(s,h(e))}if(void 0!==v&&i.i(n.payload)){let e=yield*r.context();s=B.z(s,j.b(i.W(v.encode(n.payload),e),v.contentType))}else if(void 0!==x)if(P.T(c.method))if(n.payload instanceof FormData)s=B.c(s,n.payload);else{let e=yield*x(n.payload);s=B.z(s,e)}else{let e=yield*x(n.payload);s=B.v(s,e)}else if(void 0!==v)return yield*new F.SchemaError(new z.X({message:"Expected a Stream payload"},n.payload));if(void 0!==S){let e=yield*S(n.headers);s=B.Y(s,e)}if(void 0!==k){let e=yield*k(n.query);s=B.v(s,e)}}void 0!==p&&(s=B.F(s,p.protocol));let a=yield*function r(n,i,s,a,o){if(-1===o)return t.execute(s);let l=e.mapUnsafe.get(a[o]);return void 0===l?r(n,i,s,a,o-1):l({endpoint:i,group:n,request:s,next:e=>r(n,i,e,a,o-1)})}(u,c,s,E,E.length-1);if(n?.responseMode==="response-only")return a;let o=m(a,n?.sseOptions),f=yield*void 0===l.transformResponse?o:l.transformResponse(o);return n?.responseMode==="decoded-and-response"?[f,a]:f});l.onEndpoint({...n,endpointFn:_})}})})).pipe(r.as(u))})],62780);var ey=e.i(62780);e.s(["f",0,ey],84279)},22484,(e,t,r)=>{var n={872:function(e,t){"use strict";t.byteLength=function(e){var t=l(e),r=t[0],n=t[1];return(r+n)*3/4-n},t.toByteArray=function(e){var t,r,s=l(e),a=s[0],o=s[1],u=new i((a+o)*3/4-o),c=0,f=o>0?a-4:a;for(r=0;r<f;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],u[c++]=t>>16&255,u[c++]=t>>8&255,u[c++]=255&t;return 2===o&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,u[c++]=255&t),1===o&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,u[c++]=t>>8&255,u[c++]=255&t),u},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,s=[],a=0,o=n-i;a<o;a+=16383)s.push(function(e,t,n){for(var i,s=[],a=t;a<n;a+=3)i=(e[a]<<16&0xff0000)+(e[a+1]<<8&65280)+(255&e[a+2]),s.push(r[i>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return s.join("")}(e,a,a+16383>o?o:a+16383));return 1===i?s.push(r[(t=e[n-1])>>2]+r[t<<4&63]+"=="):2===i&&s.push(r[(t=(e[n-2]<<8)+e[n-1])>>10]+r[t>>4&63]+r[t<<2&63]+"="),s.join("")};for(var r=[],n=[],i="u">typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,o=s.length;a<o;++a)r[a]=s[a],n[s.charCodeAt(a)]=a;function l(e){var t=e.length;if(t%4>0)throw Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");-1===r&&(r=t);var n=r===t?0:4-r%4;return[r,n]}n[45]=62,n[95]=63},230:function(e,t,r){"use strict";var n=r(872),i=r(321),s="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function a(e){if(e>0x7fffffff)throw RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,o.prototype),t}function o(e,t,r){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return c(e)}return l(e,t,r)}function l(e,t,r){if("string"==typeof e){var n=e,i=t;if(("string"!=typeof i||""===i)&&(i="utf8"),!o.isEncoding(i))throw TypeError("Unknown encoding: "+i);var s=0|h(n,i),l=a(s),u=l.write(n,i);return u!==s&&(l=l.slice(0,u)),l}if(ArrayBuffer.isView(e))return f(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(T(e,ArrayBuffer)||e&&T(e.buffer,ArrayBuffer)||"u">typeof SharedArrayBuffer&&(T(e,SharedArrayBuffer)||e&&T(e.buffer,SharedArrayBuffer)))return function(e,t,r){var n;if(t<0||e.byteLength<t)throw RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),o.prototype),n}(e,t,r);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');var c=e.valueOf&&e.valueOf();if(null!=c&&c!==e)return o.from(c,t,r);var p=function(e){if(o.isBuffer(e)){var t=0|d(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||function(e){return e!=e}(e.length)?a(0):f(e):"Buffer"===e.type&&Array.isArray(e.data)?f(e.data):void 0}(e);if(p)return p;if("u">typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return o.from(e[Symbol.toPrimitive]("string"),t,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function u(e){if("number"!=typeof e)throw TypeError('"size" argument must be of type number');if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function c(e){return u(e),a(e<0?0:0|d(e))}function f(e){for(var t=e.length<0?0:0|d(e.length),r=a(t),n=0;n<t;n+=1)r[n]=255&e[n];return r}t.Buffer=o,t.SlowBuffer=function(e){return+e!=e&&(e=0),o.alloc(+e)},t.INSPECT_MAX_BYTES=50,t.kMaxLength=0x7fffffff,o.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),!o.TYPED_ARRAY_SUPPORT&&"u">typeof console&&"function"==typeof console.error&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}}),o.poolSize=8192,o.from=function(e,t,r){return l(e,t,r)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array),o.alloc=function(e,t,r){return(u(e),e<=0)?a(e):void 0!==t?"string"==typeof r?a(e).fill(t,r):a(e).fill(t):a(e)},o.allocUnsafe=function(e){return c(e)},o.allocUnsafeSlow=function(e){return c(e)};function d(e){if(e>=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function h(e,t){if(o.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||T(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return _(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return A(e).length;default:if(i)return n?-1:_(e).length;t=(""+t).toLowerCase(),i=!0}}function p(e,t,r){var i,s,a,o=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(t>>>=0)))return"";for(e||(e="utf8");;)switch(e){case"hex":return function(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",s=t;s<r;++s)i+=O[e[s]];return i}(this,t,r);case"utf8":case"utf-8":return y(this,t,r);case"ascii":return function(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}(this,t,r);case"latin1":case"binary":return function(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}(this,t,r);case"base64":return i=this,s=t,a=r,0===s&&a===i.length?n.fromByteArray(i):n.fromByteArray(i.slice(s,a));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(e,t,r){for(var n=e.slice(t,r),i="",s=0;s<n.length;s+=2)i+=String.fromCharCode(n[s]+256*n[s+1]);return i}(this,t,r);default:if(o)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),o=!0}}function g(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function m(e,t,r,n,i){var s;if(0===e.length)return -1;if("string"==typeof r?(n=r,r=0):r>0x7fffffff?r=0x7fffffff:r<-0x80000000&&(r=-0x80000000),(s=r*=1)!=s&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length)if(i)return -1;else r=e.length-1;else if(r<0)if(!i)return -1;else r=0;if("string"==typeof t&&(t=o.from(t,n)),o.isBuffer(t))return 0===t.length?-1:b(e,t,r,n,i);if("number"==typeof t){if(t&=255,"function"==typeof Uint8Array.prototype.indexOf)if(i)return Uint8Array.prototype.indexOf.call(e,t,r);else return Uint8Array.prototype.lastIndexOf.call(e,t,r);return b(e,[t],r,n,i)}throw TypeError("val must be string, number or Buffer")}function b(e,t,r,n,i){var s,a=1,o=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return -1;a=2,o/=2,l/=2,r/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var c=-1;for(s=r;s<o;s++)if(u(e,s)===u(t,-1===c?0:s-c)){if(-1===c&&(c=s),s-c+1===l)return c*a}else -1!==c&&(s-=s-c),c=-1}else for(r+l>o&&(r=o-l),s=r;s>=0;s--){for(var f=!0,d=0;d<l;d++)if(u(e,s+d)!==u(t,d)){f=!1;break}if(f)return s}return -1}o.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==o.prototype},o.compare=function(e,t){if(T(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),T(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),!o.isBuffer(e)||!o.isBuffer(t))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,n=t.length,i=0,s=Math.min(r,n);i<s;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:+(n<r)},o.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(e,t){if(!Array.isArray(e))throw TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return o.alloc(0);if(void 0===t)for(r=0,t=0;r<e.length;++r)t+=e[r].length;var r,n=o.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var s=e[r];if(T(s,Uint8Array)&&(s=o.from(s)),!o.isBuffer(s))throw TypeError('"list" argument must be an Array of Buffers');s.copy(n,i),i+=s.length}return n},o.byteLength=h,o.prototype._isBuffer=!0,o.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)g(this,t,t+1);return this},o.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)g(this,t,t+3),g(this,t+1,t+2);return this},o.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)g(this,t,t+7),g(this,t+1,t+6),g(this,t+2,t+5),g(this,t+3,t+4);return this},o.prototype.toString=function(){var e=this.length;return 0===e?"":0==arguments.length?y(this,0,e):p.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(e){if(!o.isBuffer(e))throw TypeError("Argument must be a Buffer");return this===e||0===o.compare(this,e)},o.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},s&&(o.prototype[s]=o.prototype.inspect),o.prototype.compare=function(e,t,r,n,i){if(T(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),!o.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return -1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,i>>>=0,this===e)return 0;for(var s=i-n,a=r-t,l=Math.min(s,a),u=this.slice(n,i),c=e.slice(t,r),f=0;f<l;++f)if(u[f]!==c[f]){s=u[f],a=c[f];break}return s<a?-1:+(a<s)},o.prototype.includes=function(e,t,r){return -1!==this.indexOf(e,t,r)},o.prototype.indexOf=function(e,t,r){return m(this,e,t,r,!0)},o.prototype.lastIndexOf=function(e,t,r){return m(this,e,t,r,!1)};function y(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var s,a,o,l,u=e[i],c=null,f=u>239?4:u>223?3:u>191?2:1;if(i+f<=r)switch(f){case 1:u<128&&(c=u);break;case 2:(192&(s=e[i+1]))==128&&(l=(31&u)<<6|63&s)>127&&(c=l);break;case 3:s=e[i+1],a=e[i+2],(192&s)==128&&(192&a)==128&&(l=(15&u)<<12|(63&s)<<6|63&a)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:s=e[i+1],a=e[i+2],o=e[i+3],(192&s)==128&&(192&a)==128&&(192&o)==128&&(l=(15&u)<<18|(63&s)<<12|(63&a)<<6|63&o)>65535&&l<1114112&&(c=l)}null===c?(c=65533,f=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=f}var d=n,h=d.length;if(h<=4096)return String.fromCharCode.apply(String,d);for(var p="",g=0;g<h;)p+=String.fromCharCode.apply(String,d.slice(g,g+=4096));return p}function v(e,t,r){if(e%1!=0||e<0)throw RangeError("offset is not uint");if(e+t>r)throw RangeError("Trying to access beyond buffer length")}function x(e,t,r,n,i,s){if(!o.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<s)throw RangeError('"value" argument is out of bounds');if(r+n>e.length)throw RangeError("Index out of range")}function w(e,t,r,n,i,s){if(r+n>e.length||r<0)throw RangeError("Index out of range")}function S(e,t,r,n,s){return t*=1,r>>>=0,s||w(e,t,r,4,34028234663852886e22,-34028234663852886e22),i.write(e,t,r,n,23,4),r+4}function k(e,t,r,n,s){return t*=1,r>>>=0,s||w(e,t,r,8,17976931348623157e292,-17976931348623157e292),i.write(e,t,r,n,52,8),r+8}o.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i,s,a,o,l,u,c,f,d=this.length-t;if((void 0===r||r>d)&&(r=d),e.length>0&&(r<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var h=!1;;)switch(n){case"hex":return function(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var s=t.length;n>s/2&&(n=s/2);for(var a=0;a<n;++a){var o,l=parseInt(t.substr(2*a,2),16);if((o=l)!=o)break;e[r+a]=l}return a}(this,e,t,r);case"utf8":case"utf-8":return i=t,s=r,I(_(e,this.length-i),this,i,s);case"ascii":return a=t,o=r,I(C(e),this,a,o);case"latin1":case"binary":return function(e,t,r,n){return I(C(t),e,r,n)}(this,e,t,r);case"base64":return l=t,u=r,I(A(e),this,l,u);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return c=t,f=r,I(function(e,t){for(var r,n,i=[],s=0;s<e.length&&!((t-=2)<0);++s)n=(r=e.charCodeAt(s))>>8,i.push(r%256),i.push(n);return i}(e,this.length-c),this,c,f);default:if(h)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),h=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},o.prototype.slice=function(e,t){var r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var n=this.subarray(e,t);return Object.setPrototypeOf(n,o.prototype),n},o.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||v(e,t,this.length);for(var n=this[e],i=1,s=0;++s<t&&(i*=256);)n+=this[e+s]*i;return n},o.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||v(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},o.prototype.readUInt8=function(e,t){return e>>>=0,t||v(e,1,this.length),this[e]},o.prototype.readUInt16LE=function(e,t){return e>>>=0,t||v(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUInt16BE=function(e,t){return e>>>=0,t||v(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUInt32LE=function(e,t){return e>>>=0,t||v(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+0x1000000*this[e+3]},o.prototype.readUInt32BE=function(e,t){return e>>>=0,t||v(e,4,this.length),0x1000000*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},o.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||v(e,t,this.length);for(var n=this[e],i=1,s=0;++s<t&&(i*=256);)n+=this[e+s]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},o.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||v(e,t,this.length);for(var n=t,i=1,s=this[e+--n];n>0&&(i*=256);)s+=this[e+--n]*i;return s>=(i*=128)&&(s-=Math.pow(2,8*t)),s},o.prototype.readInt8=function(e,t){return(e>>>=0,t||v(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},o.prototype.readInt16LE=function(e,t){e>>>=0,t||v(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?0xffff0000|r:r},o.prototype.readInt16BE=function(e,t){e>>>=0,t||v(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?0xffff0000|r:r},o.prototype.readInt32LE=function(e,t){return e>>>=0,t||v(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},o.prototype.readInt32BE=function(e,t){return e>>>=0,t||v(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},o.prototype.readFloatLE=function(e,t){return e>>>=0,t||v(e,4,this.length),i.read(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,t){return e>>>=0,t||v(e,4,this.length),i.read(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,t){return e>>>=0,t||v(e,8,this.length),i.read(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,t){return e>>>=0,t||v(e,8,this.length),i.read(this,e,!1,52,8)},o.prototype.writeUIntLE=function(e,t,r,n){if(e*=1,t>>>=0,r>>>=0,!n){var i=Math.pow(2,8*r)-1;x(this,e,t,r,i,0)}var s=1,a=0;for(this[t]=255&e;++a<r&&(s*=256);)this[t+a]=e/s&255;return t+r},o.prototype.writeUIntBE=function(e,t,r,n){if(e*=1,t>>>=0,r>>>=0,!n){var i=Math.pow(2,8*r)-1;x(this,e,t,r,i,0)}var s=r-1,a=1;for(this[t+s]=255&e;--s>=0&&(a*=256);)this[t+s]=e/a&255;return t+r},o.prototype.writeUInt8=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,1,255,0),this[t]=255&e,t+1},o.prototype.writeUInt16LE=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeUInt16BE=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeUInt32LE=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,4,0xffffffff,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},o.prototype.writeUInt32BE=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,4,0xffffffff,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeIntLE=function(e,t,r,n){if(e*=1,t>>>=0,!n){var i=Math.pow(2,8*r-1);x(this,e,t,r,i-1,-i)}var s=0,a=1,o=0;for(this[t]=255&e;++s<r&&(a*=256);)e<0&&0===o&&0!==this[t+s-1]&&(o=1),this[t+s]=(e/a|0)-o&255;return t+r},o.prototype.writeIntBE=function(e,t,r,n){if(e*=1,t>>>=0,!n){var i=Math.pow(2,8*r-1);x(this,e,t,r,i-1,-i)}var s=r-1,a=1,o=0;for(this[t+s]=255&e;--s>=0&&(a*=256);)e<0&&0===o&&0!==this[t+s+1]&&(o=1),this[t+s]=(e/a|0)-o&255;return t+r},o.prototype.writeInt8=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},o.prototype.writeInt16LE=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeInt16BE=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeInt32LE=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,4,0x7fffffff,-0x80000000),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},o.prototype.writeInt32BE=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,4,0x7fffffff,-0x80000000),e<0&&(e=0xffffffff+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeFloatLE=function(e,t,r){return S(this,e,t,!0,r)},o.prototype.writeFloatBE=function(e,t,r){return S(this,e,t,!1,r)},o.prototype.writeDoubleLE=function(e,t,r){return k(this,e,t,!0,r)},o.prototype.writeDoubleBE=function(e,t,r){return k(this,e,t,!1,r)},o.prototype.copy=function(e,t,r,n){if(!o.isBuffer(e))throw TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r||0===e.length||0===this.length)return 0;if(t<0)throw RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i=n-r;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(t,r,n);else if(this===e&&r<t&&t<n)for(var s=i-1;s>=0;--s)e[s+t]=this[s+r];else Uint8Array.prototype.set.call(e,this.subarray(r,n),t);return i},o.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw TypeError("encoding must be a string");if("string"==typeof n&&!o.isEncoding(n))throw TypeError("Unknown encoding: "+n);if(1===e.length){var i,s=e.charCodeAt(0);("utf8"===n&&s<128||"latin1"===n)&&(e=s)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw RangeError("Out of range index");if(r<=t)return this;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{var a=o.isBuffer(e)?e:o.from(e,n),l=a.length;if(0===l)throw TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=a[i%l]}return this};var E=/[^+/0-9A-Za-z-_]/g;function _(e,t){t=t||1/0;for(var r,n=e.length,i=null,s=[],a=0;a<n;++a){if((r=e.charCodeAt(a))>55295&&r<57344){if(!i){if(r>56319||a+1===n){(t-=3)>-1&&s.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&s.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&s.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;s.push(r)}else if(r<2048){if((t-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((t-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return s}function C(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}function A(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(E,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function I(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length)&&!(i>=e.length);++i)t[i+r]=e[i];return i}function T(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}var O=function(){for(var e="0123456789abcdef",t=Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)t[n+i]=e[r]+e[i];return t}()},321:function(e,t){t.read=function(e,t,r,n,i){var s,a,o=8*i-n-1,l=(1<<o)-1,u=l>>1,c=-7,f=r?i-1:0,d=r?-1:1,h=e[t+f];for(f+=d,s=h&(1<<-c)-1,h>>=-c,c+=o;c>0;s=256*s+e[t+f],f+=d,c-=8);for(a=s&(1<<-c)-1,s>>=-c,c+=n;c>0;a=256*a+e[t+f],f+=d,c-=8);if(0===s)s=1-u;else{if(s===l)return a?0/0:(h?-1:1)*2e308;a+=Math.pow(2,n),s-=u}return(h?-1:1)*a*Math.pow(2,s-n)},t.write=function(e,t,r,n,i,s){var a,o,l,u=8*s-i-1,c=(1<<u)-1,f=c>>1,d=5960464477539062e-23*(23===i),h=n?0:s-1,p=n?1:-1,g=+(t<0||0===t&&1/t<0);for(isNaN(t=Math.abs(t))||1/0===t?(o=+!!isNaN(t),a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+f>=1?t+=d/l:t+=d*Math.pow(2,1-f),t*l>=2&&(a++,l/=2),a+f>=c?(o=0,a=c):a+f>=1?(o=(t*l-1)*Math.pow(2,i),a+=f):(o=t*Math.pow(2,f-1)*Math.pow(2,i),a=0));i>=8;e[r+h]=255&o,h+=p,o/=256,i-=8);for(a=a<<i|o,u+=i;u>0;e[r+h]=255&a,h+=p,a/=256,u-=8);e[r+h-p]|=128*g}}},i={};function s(e){var t=i[e];if(void 0!==t)return t.exports;var r=i[e]={exports:{}},a=!0;try{n[e](r,r.exports,s),a=!1}finally{a&&delete i[e]}return r.exports}s.ab="/ROOT/node_modules/.pnpm/next@16.4.4_@types+node@22.20.5_react-dom@19.3.1_react@19.3.1__react@19.3.1/node_modules/next/dist/compiled/buffer/",t.exports=s(230)}]);
|