@deslop/auth 0.1.1223 → 0.1.1228
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/(home)-C784sHct.js +20 -0
- package/dist/client/assets/client-CO7kXizx.js +19 -0
- package/dist/client/assets/components-NGfy-XAf.js +1 -0
- package/dist/client/assets/{index-JMt3-1H2.js → index-CTT40tVk.js} +3 -3
- package/dist/client/assets/people-C_MyCrCm.js +1 -0
- package/dist/client/assets/route-B5rrlLMr.js +1 -0
- package/dist/client/index.html +2 -2
- package/dist/server.js +124 -13
- package/package.json +2 -2
- package/dist/client/assets/(home)-NHb_Ahgp.js +0 -20
- package/dist/client/assets/client-c9qebYWa.js +0 -19
- package/dist/client/assets/components-CRByL0Z7.js +0 -1
- package/dist/client/assets/people-CgLToDcz.js +0 -1
- package/dist/client/assets/route-B8jHT5cF.js +0 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import{n as e,t}from"./rolldown-runtime-WkwZ5CU-.js";var n=t((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function ee(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var x=ee.prototype=new b;x.constructor=ee,_(x,y.prototype),x.isPureReactComponent=!0;var te=Array.isArray;function S(){}var C={H:null,A:null,T:null,S:null},ne=Object.prototype.hasOwnProperty;function re(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function ie(e,t){return re(e.type,t,e.props)}function ae(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function oe(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var se=/\/+/g;function ce(e,t){return typeof e==`object`&&e&&e.key!=null?oe(``+e.key):t.toString(36)}function le(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(S,S):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function ue(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,ue(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ce(e,0):a,te(o)?(i=``,c!=null&&(i=c.replace(se,`$&/`)+`/`),ue(o,r,i,``,function(e){return e})):o!=null&&(ae(o)&&(o=ie(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(se,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(te(e))for(var u=0;u<e.length;u++)a=e[u],s=l+ce(a,u),c+=ue(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+ce(a,u++),c+=ue(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return ue(le(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function de(e,t,n){if(e==null)return e;var r=[],i=0;return ue(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function w(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var fe=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)};function pe(e){var t=C.T,n={};n.types=t===null?null:t.types,C.T=n;try{var r=e(),i=C.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(S,fe)}catch(e){fe(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),C.T=t}}function me(e){var t=C.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else pe(me.bind(null,e))}var he={map:de,forEach:function(e,t,n){de(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return de(e,function(){t++}),t},toArray:function(e){return de(e,function(e){return e})||[]},only:function(e){if(!ae(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=he,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=ee,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=C,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return C.H.useMemoCache(e)}},e.addTransitionType=me,e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!ne.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return re(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)ne.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return re(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=ae,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:w}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=pe,e.unstable_useCacheRefresh=function(){return C.H.useCacheRefresh()},e.use=function(e){return C.H.use(e)},e.useActionState=function(e,t,n){return C.H.useActionState(e,t,n)},e.useCallback=function(e,t){return C.H.useCallback(e,t)},e.useContext=function(e){return C.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return C.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return C.H.useEffect(e,t)},e.useEffectEvent=function(e){return C.H.useEffectEvent(e)},e.useId=function(){return C.H.useId()},e.useImperativeHandle=function(e,t,n){return C.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return C.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return C.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return C.H.useMemo(e,t)},e.useOptimistic=function(e,t){return C.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return C.H.useReducer(e,t,n)},e.useRef=function(e){return C.H.useRef(e)},e.useState=function(e){return C.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return C.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return C.H.useTransition()},e.version=`19.3.1`})),r=t(((e,t)=>{t.exports=n()}));function i(e){return e[e.length-1]}function a(e,t){return typeof e==`function`?e(t):e}var o=Object.prototype.hasOwnProperty;function s(e){for(let t in e)if(o.call(e,t))return!0;return!1}var c=()=>Object.create(null),l=(e,t)=>u(e,t,!0);function u(e,t,n,r=0){if(e===t)return e;if(r++>500)return t;let a=Array.isArray(e)&&Array.isArray(t);if(!a&&!(d(e)&&d(t)))return t;let s=Object.keys(e),l=s.length,f=Object.keys(t),p=f.length;if(a?l!==e.length||p!==t.length||l&&i(s)!==`${l-1}`||p&&i(f)!==`${p-1}`:l!==Object.getOwnPropertyNames(e).length||p!==Object.getOwnPropertyNames(t).length||Object.getOwnPropertySymbols(t).length)return t;let m=0,h,g,_;if(a){for(;m<p&&(_=m,g=e[_],h=t[_],h=g===h?g:typeof g==`object`?u(g,h,n,r):h,h===g);m++);if(m===p&&l===p)return e}else{let i=l===p,a=!0;for(;m<p;m++){_=f[m],g=e[_];let c=t[_];h=g===c?g:typeof g==`object`?u(g,c,n,r):c,i&&=h===g&&(s[m]===_||o.call(e,_)),a&&=Object.is(h,c),s[m]=h}if(i)return Object.getOwnPropertySymbols(e).length?t:e;if(a)return t}let v=a?f.fill(0):n?c():{};for(let i=0;i<p;i++)_=a?i:f[i],a?(g=e[_],i>m&&(h=t[_],h=g===h?g:typeof g==`object`?u(g,h,n,r):h),v[_]=i<m?g:h):v[_]=s[i];return v}function d(e){return!e||typeof e!=`object`?!1:(Object.getPrototypeOf(e)?.constructor??Object)===Object}function f(e,t,n,r){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let i=0,a=e.length;i<a;i++){let a=e[i],o=t[i];if(a!==o&&!f(a,o,n,r))return!1}return!0}if(d(e)&&d(t)){if(n){for(let i in t)if((r||t[i]!==void 0)&&!f(e[i],t[i],n,r))return!1;return!0}let i=0;if(r)i=Object.keys(e).length;else for(let t in e)e[t]!==void 0&&i++;for(let a in t)if((r||t[a]!==void 0)&&(i--===0||!f(e[a],t[a],n,r)))return!1;return i===0}return!1}function p(e){return typeof e?.message==`string`?e.message.startsWith(`Failed to fetch dynamically imported module`)||e.message.startsWith(`error loading dynamically imported module`)||e.message.startsWith(`Importing a module script failed`):!1}var m=/[\x00-\x1f\x7f"<>`{}]/g;function h(e){return e.replace(m,e=>`%`+e.charCodeAt(0).toString(16).toUpperCase().padStart(2,`0`))}function g(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return h(t)}var _=[`http:`,`https:`,`mailto:`,`tel:`];function v(e){if(e[0]!==`/`&&e.includes(`:`))return/^[\x00-\x20]*([a-z][a-z\d+.\t\n\r-]*:)/i.exec(e)?.[1]?.replace(/[\t\n\r]/g,``).toLowerCase()}var y=/^[\x00-\x20]*[\\/][\t\n\r]*[\\/]/;function b(e,t){if(!e)return!1;if(y.test(e))return!0;let n=v(e);return n?!t.has(n):!1}var ee={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},x=/[&><\u2028\u2029]/g;function te(e){return e.replace(x,e=>ee[e])}function S(e){if(!e)return e;let t=e;if(/[%\\\x00-\x1f\x7f]/.test(e)){let n=/%25|%5C/gi,r=0,i;for(t=``;(i=n.exec(e))!==null;)t+=g(e.slice(r,i.index))+i[0],r=n.lastIndex;t+=g(r?e.slice(r):e)}return t}function C(e){return/[\s\u0080-\uFFFF]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function ne(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function re(){throw Error(`Invariant failed`)}function ie(e){return e.replace(/\/{2,}/g,`/`)}function ae(e){return e===`/`?e:e.replace(/^\/+/,``)}function oe(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/+$/,``):e}function se(e){return oe(ae(e))}function ce(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function le(e,t,n=`never`,r){if(t.includes(`//`)&&(t=ie(t)),t.startsWith(`/`))return t.length===1||n===`preserve`?t:n===`always`?t.endsWith(`/`)?t:`${t}/`:t.endsWith(`/`)?t.slice(0,-1):t;let a=t===`.`,o;if(r){o=a?e:e+`\0`+t;let n=r.get(o);if(n)return n}let s;if(a)s=e.split(`/`);else{for(e.includes(`//`)&&(e=ie(e)),s=e.split(`/`);s.length>1&&i(s)===``;)s.pop();let n=t.split(`/`);for(let e=0,t=n.length;e<t;e++){let r=n[e];r===``?e?e===t-1&&s.push(r):s=[r]:r===`..`?s.length>1?s.pop():s=[``]:r===`.`||s.push(r)}}s.length>1&&(i(s)===``?n===`never`&&s.pop():n===`always`&&s.push(``));let c=s.join(`/`),l=(a?ie(c):c)||`/`;return o&&r&&r.set(o,l),l}function ue(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=new RegExp([...t.keys()].join(`|`).replace(/[.*()]/g,`\\$&`),`g`);return e=>e.replace(n,e=>t.get(e)??e)}function de(e){return e==null||e===``}function w(e,t,n){if(typeof t!=`string`)return``+(t??void 0);let r=e===`_splat`;if(r&&(!t||/^[a-zA-Z0-9\-._~!/]*$/.test(t)))return t;let i=encodeURIComponent(t);return r&&(i=i.replaceAll(`%2F`,`/`)),n?n(i):i}function fe(e,t,n,r,i){let a=e.endsWith(`/`)?`/`:``,o=``;for(let e of t){if(typeof e==`string`){o+=e;continue}let[t,s,c,l]=e,u=t===2,d=u&&l!==void 0?l+a:l,f=n[s];if(t!==3||f!=null){if(i&&(i[s]=f,u&&(i[`*`]=f)),u&&de(f)){if(c===`/`&&!d)continue;f=``}o+=c+w(s,f,r)+(d||``)}}return o+a||`/`}function pe(e){return e?.isNotFound===!0}var me=`__root__`;function he(e){e.statusCode=e.statusCode||e.code||307;let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function ge(e){return e instanceof Response&&!!e.options}function _e(e){let t=new Map,n,r;return{get(e){let n=t.get(e);if(n)return n.visited=!0,n.value},set(i,a){let o=t.get(i);if(o){o.value=a;return}if(t.size>=e){let e=n?.next().value;for(;!e||e.visited;)e?e.visited=!1:n=t.values(),e=n.next().value;e===r&&(n=void 0),t.delete(e.key)}let s={key:i,value:a,visited:!1};r=s,t.set(i,s)},clear(){t.clear(),n=void 0,r=void 0}}}var ve=4,ye=5;function be(e){let t=e.names;if(t)return t;let n=[];for(let t of e)typeof t!=`string`&&n.push(t[1]);return e.names=n}function xe(e,t,n){let r=e.slice(t,n);if(r.charCodeAt(0)===36)return r.length===1?[2,`_splat`,``,void 0]:[1,r.slice(1),``,``];let i=r.indexOf(`{`);if(i>=0){let a=r.indexOf(`}`,i),o=r.charCodeAt(i+1)===45,s=i+(o?3:2);if(a>=0&&r.charCodeAt(s-1)===36&&(!o||s<a)){let c=r.slice(s,a);return[o?3:c?1:2,c||`_splat`,r.slice(0,i),e.slice(t+a+1,c?n:e.length)]}}return r}function Se(e,t,n,r,a,o){let s=n,c=t.fullPath??t.from,l=t.options,u=c.length,d=c.endsWith(`/`)?u-1:u,f=l?.caseSensitive??e,p=l?.params?.parse??l?.parseParams,m,h=o?n-1:0;if(!r||c.includes(`$`)){m=o?.slice()??[];let e=i(m);e&&typeof e!=`string`&&e[0]===2&&(m[m.length-1]=[e[0],e[1],e[2],e[3]===void 0?void 0:e[3]+c.substring(n-(c[n-2]===`/`?2:1),d)],h=u)}for(;s<u;){let e=s,t=c.indexOf(`/`,e),n=t===-1?u:t,i=xe(c,e,n);s=n+1;let o;if(typeof i==`string`){if(!r)continue;let e=i,t;f?t=r.static??=new Map:(e=i.toLowerCase(),t=r.staticInsensitive??=new Map);let n=t.get(e);if(n)o=n;else{let n=we(r);o=n,t.set(e,n)}}else{let t=i[0],l=i[2],g=i[3]??``;if(t===2&&(n=u,s=n+1),m&&h<n&&(h<e-1&&m.push(c.slice(h,e-1)),i[2]=`/`+l,t===2&&i[3]!==void 0&&d<u&&(i[3]=g.slice(0,-1)),m.push(i),h=n),!r)continue;let _=f&&!!(l||g);f||(l=l.toLowerCase(),g=g.toLowerCase());let v=t===1?r.dynamic??=[]:t===3?r.optional??=[]:r.wildcard??=[],y=t!==2&&!p&&v.find(e=>!e.parse&&e.caseSensitive===_&&e.prefix===l&&e.suffix===g);if(y)o=y;else{let e=we(r,t,_,l,g);o=e,v.push(e),v.length===2&&a?.push(v)}}r=o}m&&h<d&&m.push(c.slice(h,d));let g=m?.slice();if(!r)return g;if(p&&t.children&&!t.isRoot&&t.id&&t.id.charCodeAt(t.id.lastIndexOf(`/`)+1)===95){let e=we(r,ye);(r.pathless??=[]).push(e),r=e}let _=(t.path||!t.children)&&!t.isRoot;if(_&&d<u){let e=we(r,ve);r.index=e,r=e}return r.parse=p??null,r.priority=l?.params?.priority??0,r.route||(r.data=g,_&&(r.route=t)),[r,s,g]}function Ce(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;if(e.parse&&t.parse&&(e.priority||t.priority))return t.priority-e.priority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function we(e,t=0,n,r,i){return{kind:t,depth:e?e.depth+1:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,data:void 0,parent:e,parse:null,priority:0,caseSensitive:n,prefix:r,suffix:i}}function Te(e,t){let n=we(),r=[];function i(e,t,n,a){let[o,s,c]=Se(!1,e,t,n,r,a);if(e.children)for(let t of e.children)i(t,s,o,c)}for(let t of e)i(t,1,n);for(let e of r)e.sort(Ce);t.masksTree=n,t.flatCache=_e(1e3)}function Ee(e,t){e||=`/`;let n=t.flatCache.get(e);if(n!==void 0)return n;let r=Ae(e,t.masksTree);return t.flatCache.set(e,r),r}function De(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=we(),Se(t,{from:e},1,o),i.singleCache.set(a,o)),Ae(r,o,n)}function Oe(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||=`/`;let a;try{a=Ae(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=Me(a.route)),t.matchCache.set(r,a),a}function ke(e,t=!1){let n=we(),r=[],i={},a={},o=0;function s(e,n,c,l){if(e.init(o),e.id in i&&re(),i[e.id]=e,o!==0&&e.path){let t=oe(e.fullPath);(!a[t]||e.fullPath.endsWith(`/`))&&(a[t]=e)}o++;let[u,d,f]=Se(t,e,n,c,r,l);if(e._interpolation=f,e.children)for(let t of e.children)s(t,d,u,f)}s(e,1,n);for(let e of r)e.sort(Ce);return{processedTree:{segmentTree:n,singleCache:_e(1e3),matchCache:_e(1e3),flatCache:null,masksTree:null},routesById:i,routesByPath:a}}function Ae(e,t,n=!1){let r=e.split(`/`),i=Pe(e,r,t,n);if(!i)return null;let[a]=je(e,r,i);return{route:i.node.route,rawParams:a}}function je(e,t,n){let r=Ne(n.node),i=n.node.data&&be(n.node.data),a=Object.create(null),o=n.extract?.part??0,s=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.param??0;for(;s<r.length;o++,s++,c++){let u=r[s];if(u.kind===ve)break;if(u.kind===ye){o--,c--;continue}let d=t[o],f=c;if(d&&(c+=d.length),u.kind===1||u.kind===3){let e=i[l++];if(u.kind===3&&n.skipped&1<<s){o--,c=f-1;continue}let t=u.suffix||u.prefix?d.substring(u.prefix.length,d.length-u.suffix.length):d;(t||u.kind===1)&&(a[e]=decodeURIComponent(t))}else if(u.kind===2){let t=u,n=e.substring(f+t.prefix.length,e.length-t.suffix.length),r=decodeURIComponent(n);a[`*`]=r,a._splat=r;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:s,path:c,param:l}]}function Me(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function Ne(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function Pe(e,t,n,r){if(e===`/`&&n.index)return{node:n.index,skipped:0};let a=!i(t),o=a&&e!==`/`,s=t.length-+!!a,c=[{node:n,index:1,skipped:0,statics:0,dynamics:0,optionals:0}],l=null,u=null;for(;c.length;){let n=c.pop(),{node:i,index:a,skipped:d,statics:f,dynamics:p,optionals:m}=n,{extract:h,rawParams:g}=n;if(i.kind===2&&i.route&&!Re(u,n))continue;if(i.parse){if(!Le(e,t,n))continue;g=n.rawParams,h=n.extract}r&&i.route&&i.kind!==ve&&Re(l,n)&&(l=n);let _=a===s;if(_&&(i.route&&(!o||i.kind===ve||i.kind===2)&&Re(u,n)&&(u=n),!i.optional&&!i.wildcard&&!i.index&&!i.pathless))continue;let v=_?void 0:t[a],y;if(_&&i.index){let n={node:i.index,index:a,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g},r=!0;if(i.index.parse&&(Le(e,t,n)||(r=!1)),r){if(!p&&!m&&!d&&Ie(f,s))return n;Re(u,n)&&(u=n)}}if(i.wildcard)for(let e=i.wildcard.length-1;e>=0;e--){let n=i.wildcard[e],{prefix:r,suffix:o}=n;if(!r||!_&&(n.caseSensitive?v:y??=v.toLowerCase()).startsWith(r)){if(o){if(_)continue;let e=t.slice(a).join(`/`),i=e.slice(-o.length);if((n.caseSensitive?i:i.toLowerCase())!==o||e.length-o.length<r.length)continue}c.push({node:n,index:s,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}}if(i.optional){let e=d|1<<i.depth+1;for(let t=i.optional.length-1;t>=0;t--){let n=i.optional[t];c.push({node:n,index:a,skipped:e,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}if(!_)for(let e=i.optional.length-1;e>=0;e--){let t=i.optional[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?v:y??=v.toLowerCase();if(n&&!e.startsWith(n)||r&&e.indexOf(r,e.length-r.length)<n.length)continue}c.push({node:t,index:a+1,skipped:d,statics:f,dynamics:p,optionals:m+Fe(s,a),extract:h,rawParams:g})}}if(!_&&i.dynamic&&v)for(let e=i.dynamic.length-1;e>=0;e--){let t=i.dynamic[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?v:y??=v.toLowerCase();if(n&&!e.startsWith(n)||r&&e.indexOf(r,e.length-r.length)<n.length)continue}c.push({node:t,index:a+1,skipped:d,statics:f,dynamics:p+Fe(s,a),optionals:m,extract:h,rawParams:g})}if(!_&&i.staticInsensitive){let e=i.staticInsensitive.get(y??=v.toLowerCase());e&&c.push({node:e,index:a+1,skipped:d,statics:f+Fe(s,a),dynamics:p,optionals:m,extract:h,rawParams:g})}if(!_&&i.static){let e=i.static.get(v);e&&c.push({node:e,index:a+1,skipped:d,statics:f+Fe(s,a),dynamics:p,optionals:m,extract:h,rawParams:g})}if(i.pathless)for(let e=i.pathless.length-1;e>=0;e--){let t=i.pathless[e];c.push({node:t,index:a,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}}if(u)return u;if(r&&l){let n=l.index;for(let e=0;e<l.index;e++)n+=t[e].length;let r=n===e.length?`/`:e.slice(n);return l.rawParams??=Object.create(null),l.rawParams[`**`]=decodeURIComponent(r),l}return null}function Fe(e,t){return 2**(e-t-1)}function Ie(e,t){return e===2**(t-1)-1}function Le(e,t,n){let r,i;try{[r,i]=je(e,t,n)}catch{return null}if(n.rawParams=r,n.extract=i,!n.node.parse)return!0;try{if(n.node.parse(r)===!1)return null}catch{}return!0}function Re(e,t){return!e||t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===ve)>(e.node.kind===ve)||t.node.kind===ve==(e.node.kind===ve)&&t.node.depth>e.node.depth)))}function ze(){try{return sessionStorage}catch{return}}var Be=`tsr-scroll-restoration-v1_3`,Ve=ze();function He(){try{return JSON.parse(Ve?.getItem(`tsr-scroll-restoration-v1_3`)||`{}`)}catch{return{}}}var Ue=He(),We=`data-scroll-restoration-id`,Ge=e=>e.state.__TSR_key||e.href;function Ke(e){let t=e.getAttribute(We);if(t)return`[${We}="${t}"]`;let n=``,r=e,i;for(;i=r.parentNode;){let e=1,t=r;for(;t=t.previousElementSibling;)e++;let a=`${r.localName}:nth-child(${e})`;n=n?`${a} > ${n}`:a,r=i}return n}var qe=!1,Je=`window`;function Ye(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function Xe(e){let t=new Set;for(let n of e){if(n===Je)continue;let e=Ye(n);e&&t.add(e)}return t}function Ze(e,t){let n=t??e.options.scrollRestoration,r=e._scroll;n&&(r.e=!0);let i=e.options.getScrollRestorationKey||Ge,a=new Set,o=e=>{let t=Ue[e]||={};for(let e of a)e===document?t[Je]={scrollX,scrollY}:e.isConnected&&(t[Ke(e)]={scrollX:e.scrollLeft,scrollY:e.scrollTop})};n&&!r.s&&(r.s=!0,qe=!1,history.scrollRestoration=`manual`,document.addEventListener(`scroll`,e=>{qe||a.add(e.target)},!0),e.subscribe(`onBeforeLoad`,e=>{e.fromLocation&&o(i(e.fromLocation)),a.clear()}),addEventListener(`pagehide`,()=>{history.scrollRestoration=`auto`,o(i(e.stores.resolvedLocation.get()??e.stores.location.get()));try{Ve?.setItem(Be,JSON.stringify(Ue))}catch{}}),addEventListener(`pageshow`,e=>{e.persisted&&(history.scrollRestoration=`manual`)})),!r.r&&(r.r=!0,e.subscribe(`onRendered`,t=>{let n=e.options.scrollRestorationBehavior,o=e.options.scrollToTopSelectors,s=r.n,c=r.h,l;if(a.clear(),r.n=!0,r.h=!1,typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))return;let u=i(t.toLocation),d=t.fromLocation&&i(t.fromLocation);if(r.e&&d&&d!==u){let e=Ue[d];if(e){let t=Ue[u];for(let n in e){if(n===Je){if(s)continue}else{let e=Ye(n);if(!e||s&&o&&(l??=Xe(o),l.has(e)))continue}t||=Ue[u]={},t[n]??=e[n]}}}qe=!0;try{let e=t.toLocation.hash,i=t.toLocation.state.__hashScrollIntoViewOptions??!0,a=!1;if(s){!e&&o&&(l??=Xe(o));let t=e&&i&&c,s=r.e?Ue[u]:void 0;if(s)for(let e in s){let{scrollX:r,scrollY:i}=s[e];if(e===Je){if(t)continue;scrollTo({top:i,left:r,behavior:n}),a=!0}else{let t=Ye(e);t&&(t.scrollLeft=r,t.scrollTop=i,l?.delete(t))}}if(!e){let e={top:0,left:0,behavior:n};if(a||scrollTo(e),l)for(let t of l)t.scrollTo(e)}}!a&&e&&i&&document.getElementById(e)?.scrollIntoView(i)}finally{qe=!1}}))}function Qe(e,t=String){let n;for(let r in e){let i=e[r];i!==void 0&&(n||=new URLSearchParams).set(r,t(i))}return n?n.toString():``}function $e(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function et(e){let t=new URLSearchParams(e),n=Object.create(null);for(let[e,r]of t.entries()){let t=n[e];t==null?n[e]=$e(r):Array.isArray(t)?t.push($e(r)):n[e]=[t,$e(r)]}return n}var tt=/^(?:\s|["[{\d-]|fa|nu|tr)/,nt=it(JSON.parse),rt=at(JSON.stringify,JSON.parse);function it(e){let t=e===JSON.parse;return n=>{n[0]===`?`&&(n=n.slice(1));let r=et(n);for(let n in r){let i=r[n];if(typeof i==`string`){if(t&&!tt.test(i))continue;try{r[n]=e(i)}catch{}}}return r}}function at(e,t){let n=t===JSON.parse;function r(r){if(r&&typeof r==`object`)try{return e(r)}catch{}else if(t&&typeof r==`string`){if(n&&!tt.test(r))return r;try{return t(r),e(r)}catch{}}return r}return e=>{let t=Qe(e,r);return t?`?${t}`:``}}function ot(e,t,n){let r=se(e),i=`/${r}`,a=t?i:i.toLowerCase(),o=`${a}/`,s={input:({url:e})=>{let n=t?e.pathname:e.pathname.toLowerCase();return n===a?e.pathname=`/`:n.startsWith(o)&&(e.pathname=e.pathname.slice(i.length)),e},output:({url:e})=>(e.pathname=ie(`/${r}${e.pathname}`),e)};return n?{input:({url:e})=>st(n,s.input({url:e})),output:({url:e})=>s.output({url:ct(n,e)})}:s}function st(e,t){let n=e?.input?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function ct(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function lt(e,t){let{createMutableStore:n,createReadonlyStore:r,batch:i}=t,a=new Map,o=n(`idle`),s=n(e),c=n(void 0),l=n([]),u=r(()=>l.get().map(e=>a.get(e).get())),d=r(()=>({status:o.get(),isLoading:o.get()===`pending`,matches:u.get(),location:s.get(),resolvedLocation:c.get()}));function f(e){let t=a.get(e);return t||(t=n(void 0),a.set(e,t)),t}let p={status:o,location:s,resolvedLocation:c,ids:l,matches:u,byRoute:a,__store:d,getMatchStore:f,setMatches:m};function m(e){let t=l.get(),n=e.map(e=>e.routeId);i(()=>{ne(t,n)||l.set(n);for(let e of t)n.includes(e)||a.get(e).set(()=>void 0);for(let t of e){let e=f(t.routeId);e.get()!==t&&e.set(t)}})}return p}var ut=`__TSR_index`,dt=`popstate`,ft=`beforeunload`,pt=/^[\x00-\x20]*(?:[\\/][\t\n\r]*){2,}/;function mt(e){let t=pt.exec(e);return t?`/`+e.slice(t[0].length):e}function ht(e){return/[\x00-\x1f\x7f]/.test(e)&&(e=e.replace(/[\x00-\x1f\x7f]/g,e=>`
|
|
2
|
+
\r`.includes(e)?``:encodeURIComponent(e))),mt(e)}function gt(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async n=>{let r=n.navigateOpts?.ignoreBlocker?void 0:e.getBlockers?.();if(typeof document<`u`&&r?.length&&(n.type===`PUSH`||n.type===`REPLACE`))for(let i of r){let r=yt(n.path,n.state);if(await i.blockerFn({currentLocation:t,nextLocation:r,action:n.type})){e.onBlocked?.();return}}n.task()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[ut];i=_t(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[ut];i=_t(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t,n?.ignoreBlocker??!1),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[ut]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r,_getBlockers:()=>e.getBlockers?.()??[]}}function _t(e,t){let n=bt();return{...t,key:n,__TSR_key:n,[ut]:e}}function vt(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=t=>ht(e?.createHref?e.createHref(t):t),c=e?.parseLocation??(()=>yt(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=bt();t.history.replaceState({[ut]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_=()=>{g&&(x._ignoreSubscribers=!0,(g[2]?t.history.pushState:t.history.replaceState)(g[1],``,g[0]),x._ignoreSubscribers=!1,g=void 0,u=void 0)},v=(t,n,r)=>{let i=e?.createHref?s(n):void 0,a=!!g;a||(u=l),l=yt(n,r),g=[i??l.href,r,g?.[2]||t],a||queueMicrotask(()=>_())},y=e=>{l=c(),x.notify({type:e})},b=async()=>{if(m=!1,f){f=!1;return}let e=c(),n=e.state[ut]-l.state[ut],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let r=a();if(typeof document<`u`&&r.length){for(let i of r)if(await i.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(-n),x.notify(u);return}}}l=c(),x.notify(u)},ee=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0||typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},x=gt({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>v(!0,e,t),replaceState:(e,t)=>v(!1,e,t),back:e=>(e&&(p=!0,m=!0),t.history.back()),forward:e=>{e&&(p=!0,m=!0),t.history.forward()},go:(e,n)=>{d=!0,n&&(p=!0,m=!0),t.history.go(e)},createHref:s,flush:_,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(ft,ee,{capture:!0}),t.removeEventListener(dt,b)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return x._ignoreNextBeforeUnload=e=>{m=!1;try{e=new URL(e,t.document.baseURI).href,m=/^https?:/.test(e)&&(!e.includes(`#`)||e.split(`#`)[0]!==t.location.href.split(`#`)[0])}catch{}},t.addEventListener(ft,ee,{capture:!0}),t.addEventListener(dt,b),t.history.pushState=function(...e){let r=n.apply(t.history,e);return x._ignoreSubscribers||y(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return x._ignoreSubscribers||y(`REPLACE`),n},x}function yt(e,t){let n=ht(e),r=n.indexOf(`#`),i=n.indexOf(`?`);if(!t){let e=bt();t={[ut]:0,key:e,__TSR_key:e}}return{href:n,pathname:n.slice(0,r>-1?i>-1?Math.min(r,i):r:i>-1?i:n.length),hash:r>-1?n.slice(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t}}function bt(){return(Math.random()+1).toString(36).slice(7)}function xt(e,t){return e.protocol!==`http:`&&e.protocol!==`https:`||e.origin!==t||!!e.username||!!e.password}function St(e){return e.pathname+e.search+e.hash}function Ct(e){return e.options.loader||e.options.beforeLoad||e.lazyFn||e.options.component?.preload||e.options.pendingComponent?.preload}function wt(e,t){return{fromLocation:t,toLocation:e,pathChanged:t?.pathname!==e.pathname,hrefChanged:t?.href!==e.href,hashChanged:t?.hash!==e.hash}}function Tt({key:e,__TSR_key:t,__TSR_index:n,__hashScrollIntoViewOptions:r,...i}){return i}function Et(e){return e.findIndex(e=>e.status===`error`||e.status===`notFound`||e._notFound)+1}function Dt(e,t,n,r,i,a){r&&(t=t.slice(0,r)),i&&(n=n.slice(0,i));for(let r of t){if(a&&e._tx!==a)return;n.some(e=>e.routeId===r.routeId)||e.routesById[r.routeId].options.onLeave?.(r)}for(let r of n){if(a&&e._tx!==a)return;e.routesById[r.routeId].options[t.some(e=>e.routeId===r.routeId)?`onStay`:`onEnter`]?.(r)}}var Ot=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={n:!0},this.subscribers=new Set,this._cache=new Map,this._committed=[],this.startTransition=async e=>(e(),!1),this.update=e=>{let t=this.options;this.options={...t,...e},this.isServer=this.options.isServer??!1??typeof document>`u`,this.staticLocations=new WeakMap,this.protocolAllowlist=new Set(this.options.protocolAllowlist),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.history=this.options.history?this.options.history:vt()),this.origin=this.options.origin,this.origin||=window?.origin&&window.origin!==`null`?window.origin:`http://localhost`;let n=this.options.basepath??`/`,r=this.options.rewrite,i=this.basepath!==n||t?.rewrite!==r||t?.caseSensitive!==this.options.caseSensitive;if(i&&(this.basepath=n,this.rewrite=n!==`/`&&se(n)?ot(n,this.options.caseSensitive,r):r),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;e=this.buildRouteTree(),this.setRoutes(e)}if(this.stores)i&&this.stores.location.set(this.latestLocation);else if(this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=lt(this.latestLocation,e),Ze(this)}},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=ke(this.routeTree,this.options.caseSensitive);return this.options.routeMasks&&Te(this.options.routeMasks,e.processedTree),{...e,resolvePathCache:_e(1e3)}},this.subscribe=(e,t)=>{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{for(let t of this.subscribers)if(t.eventType===e.type)try{t.fn(e)}catch(e){console.error(e)}},this.parseLocation=(e,t)=>{let n=({pathname:e,search:n,hash:r,href:i},a)=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let i=this.options.parseSearch(n),o=this.options.stringifySearch(i);return{href:e+o+r,publicHref:e+o+r,pathname:S(e),external:!1,searchStr:o,search:l(t?.search,i),hash:S(r.slice(1)),state:u(t?.state,a)}}let o=st(this.rewrite,new URL(i,this.origin)),s=this.options.parseSearch(o.search),c=this.options.stringifySearch(s);return o.search=c,{href:o.href.replace(o.origin,``),publicHref:i,pathname:S(mt(o.pathname)),external:!!this.rewrite&&xt(o,this.origin),searchStr:c,search:l(t?.search,s),hash:S(o.hash.slice(1)),state:u(t?.state,a)}},r=n(e,e.state),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i,{...i.state,__tempLocation:void 0,key:r.state.key,__TSR_key:r.state.__TSR_key});return e.maskedLocation=r,e}return r},this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>{let t=Object.create(null),n=Oe(oe(e),this.processedTree,!0);return n&&Object.assign(t,n.rawParams),[n?.branch||[this.routesById.__root__],t,n?.route]},this.buildLocation=e=>{{let t=this.staticLocations.get(e);if(t)return t}let t=!1,n=(n={})=>{if(n.href){let e=yt(n.href,{});n={...n,to:st(this.rewrite,new URL(e.pathname,this.origin)).pathname,search:this.options.parseSearch(e.search),hash:e.hash.slice(1)}}let r=e._fromLocation||this._pendingLocation||this.latestLocation,i,a=()=>(t=!0,r),o=()=>i??=this.matchRoutesLightweight(a()),l=n.to?`${n.to}`:`.`,u=le(l[0]===`/`?``:n.unsafeRelative===`path`?a().pathname:n.from??o()[1],l,this.options.trailingSlash,this.resolvePathCache),d=this.routesByPath[oe(u)],f=u.includes(`$`),p;if(d)p=d._branch??=Me(d);else if(f)p=[];else{let[e,t,n]=this.getMatchedRoutes(u);p=e,this.options.notFoundRoute&&(!n||n.path!==`/`&&t[`**`])&&(p=[...p,this.options.notFoundRoute])}let m=f?d?._interpolation??Se(!1,{fullPath:u},0):void 0,h;for(let e of p){let t=e.options.params?.stringify??e.options.stringifyParams;if(t){let e=o()[3];if(h??=Nt(n.params,e),!s(h))break;h===e&&(h=Object.assign(c(),h));try{Object.assign(h,t(h))}catch{}}}h??=Nt(n.params,Pt(n.params,m)?o()[3]:Ft);let g=e.leaveParams?u:mt(S(m?fe(u,m,h,this.pathParamsDecoder):u)),_=It(p,e._includeValidateSearch),v=()=>{let t=o()[2];if(e._includeValidateSearch&&this.options.search?.strict){let e={};p.forEach(n=>{if(n.options.validateSearch)try{Object.assign(e,Mt(n.options.validateSearch,{...e,...t}))}catch{}}),t=e}return t},y=_.length?Lt(_,v(),n):n.search===!0?v():typeof n.search==`function`?n.search(v()):n.search||Ft,b=this.options.stringifySearch(y),ee=n.hash===!0?a().hash:typeof n.hash==`function`?n.hash(a().hash):n.hash||void 0,x=ee?`#${ee}`:``,te=n.state?n.state===!0?a().state:typeof n.state==`function`?n.state(a().state):n.state:Ft,ne=`${g}${b}${x}`,re,ie,ae=!1;if(this.rewrite){let e=new URL(ne,this.origin),t=e.origin,n=ct(this.rewrite,e);re=St(e),xt(n,t)?(ie=n.href,ae=!0):ie=mt(St(n))}else re=C(ne),ie=re;return{publicHref:ie,href:re,pathname:g,search:y,searchStr:b,state:te,hash:ee??``,external:ae,unmaskOnReload:n.unmaskOnReload}},r=n(e);if(e.mask)r.maskedLocation=n({from:e.from,...e.mask});else if(this.options.routeMasks){let t=Ee(r.pathname,this.processedTree);if(t){let i=Object.assign(c(),t.rawParams),{from:a,params:o,...s}=t.route,l=Nt(o,i);r.maskedLocation=n({from:e.from,...s,params:l})}}return!t&&e._fromLocation&&this.staticLocations.set(e,r),r},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r=n.maskedLocation??n;if(r.external)return kt(this,r.publicHref,{replace:n.replace,ignoreBlocker:t});let i,a=oe(this.latestLocation.href)===oe(n.href)&&f(Tt(n.state),Tt(this.latestLocation.state)),o=this._commitPromise,s,c=new Promise(e=>{s=e});if(c.resolve=()=>{s(),o?.resolve()},this._commitPromise=c,a)this.load();else{let{maskedLocation:r,hashScrollIntoView:a,...o}=n;r&&(o={...r,state:{...r.state,__tempKey:void 0,__tempLocation:{...o,search:o.searchStr,state:{...o.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(o.unmaskOnReload??this.options.unmaskOnReload??!1)&&(o.state.__tempKey=this.tempLocationKey)),o.state={...o.state,__hashScrollIntoViewOptions:a??this.options.defaultHashScrollIntoView??!0},this.shouldViewTransition=e,i=n.replace?`REPLACE`:`PUSH`,this.history[i===`REPLACE`?`replace`:`push`](o.publicHref,o.state,{ignoreBlocker:t}),this.history.subscribers.size||this.load({action:{type:i}})}return this._scroll.n=n.resetScroll??!0,this._commitPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,...a}={})=>{let o=this.buildLocation({...a,_includeValidateSearch:!0});this._pendingLocation=o;let s=this.commitLocation({...o,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return queueMicrotask(()=>{this._pendingLocation===o&&(this._pendingLocation=void 0)}),s},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=n?v(n):void 0;if(a||t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i}),a=t.maskedLocation??t;n??=a.publicHref,r??=a.publicHref}let t=!a&&r?r:n;return kt(this,t,i)}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.load=async e=>{this.updateLatestLocation(),e?.action&&(this._scroll.h=e.action.type===`PUSH`||e.action.type===`REPLACE`),await Mn(this,e)},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&window.CSS?.supports?.(`selector(:active-view-transition-type(a))`)){let r=this.latestLocation,i=this.stores.resolvedLocation.get(),a=typeof t.types==`function`?t.types(wt(r,i)):t.types;if(a===!1)return e();n={update:e,types:a}}else n=e;return document.startViewTransition(n).updateCallbackDone}return e()},this.invalidate=e=>{let t=this._committed,n=e?.filter,r=this._preloads,i=new Set,a=e=>{(!n||n(e))&&i.add(e.id)};t.forEach(a),this._cache.forEach(a),r?.forEach(e=>e.forEach(a)),this._tx?.[3].forEach(a);let o=[];for(let[e,t]of r??[])t.some(e=>i.has(e.id))&&(r.delete(e),o.push(e));let s=t=>{if(i.has(t.id)){let n=this.routesById[t.routeId],r={...t,invalid:!0,...(e?.forcePending||t.status===`error`||t.status===`notFound`)&&Ct(n)?{status:`pending`,error:void 0}:void 0};return t._flight=void 0,r}return t};this._committed=t.map(s);for(let[t,n]of this._cache)i.has(t)&&(n.invalid=!0,e?.forcePending&&(n.status=`pending`));for(let e of i){let t=this._flights?.get(e);this._flights?.delete(e),t&&!t[2]&&o.push(t[1])}for(let e of o)e.abort();return this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.resolveRedirect=e=>{let t=e.options,n=e.headers.get(`Location`)||t.href;if(!n){let e=this.buildLocation(t);n=(e.maskedLocation??e).publicHref||`/`}let r;if(y.test(n)||(r=v(n))&&!this.protocolAllowlist.has(r))throw Error(`Redirect blocked: unsafe protocol`);if(r===`http:`||r===`https:`){let e=new URL(n);e.pathname.startsWith(`//`)?n=e.href:xt(e,this.origin)||(n=St(e),r=void 0)}return r&&(t.reloadDocument=!0),t.href=n,e.headers.set(`Location`,n),e},this.clearCache=e=>{let t=this._cache,n=this._preloads,r=e?.filter,i=[],a=[];for(let[e,n]of t)(!r||r(n))&&(a.push(e),i.push(n));let o=[];for(let[e,t]of n??[])(!r||t.some(r))&&(o.push(e),i.push(...t));for(let e of a)t.delete(e);for(let e of o)n.delete(e);for(let e of i){let t=e._flight;e._flight=void 0,t&&!--t[2]&&(this._flights?.get(e.id)===t&&this._flights.delete(e.id),o.push(t[1]))}for(let e of o)e.abort()},this.loadRouteChunk=Ht,this.preloadRoute=e=>Nn(this,e),this.matchRoute=(e,t)=>{let n={...e,to:e.to?le(e.from||``,e.to,this.options.trailingSlash,this.resolvePathCache):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n),i=this.stores.status.get()===`pending`;if(t?.pending&&!i)return!1;let a=t?.pending??!i?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),o=De(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,a.pathname,this.processedTree);return!o||e.params&&!f(o.rawParams,e.params,!0)?!1:t?.includeSearch??!0?f(a.search,r.search,!0)?o.rawParams:!1:o.rawParams},this.getStoreConfig=t,e.pathParamsAllowedCharacters?.length&&(this.pathParamsDecoder=ue(e.pathParamsAllowedCharacters)),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??rt,parseSearch:e.parseSearch??nt,protocolAllowlist:e.protocolAllowlist??_}),self.__TSR_ROUTER__=this}isShell(){return!!this.options.isShell}get state(){return this.stores.__store.get()}setRoutes(e){Object.assign(this,e),this.lightweightCache=new WeakMap,this.staticLocations=new WeakMap;let t=this.options.notFoundRoute;t&&(t.init(99999999999),this.routesById[t.id]!==t&&(t._interpolation=Se(!1,t,0)),this.routesById[t.id]=t)}matchRoutesInternal(e,t){let[n,r,i]=this.getMatchedRoutes(e.pathname),a=n,o=!1;(i?i.path!==`/`&&r[`**`]:oe(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:o=!0);let s=o?Rt(this.options.notFoundMode,a):void 0,d=Array(a.length),f=this._committed,p=(e,t)=>{let n=f[t];return n?.routeId===e.id?n:e===this.options.notFoundRoute?f.find(t=>t.routeId===e.id):void 0},m;for(let n=0;n<a.length;n++){let i=a[n],o=d[n-1],f,h,g;{let n=o?.search??e.search,r=o?._strictSearch??void 0;try{let e=Mt(i.options.validateSearch,{...n})??void 0;f={...n,...e},h={...r,...e}}catch(e){let r=e;if(e instanceof At||(r=new At(e.message,{cause:e})),t?.throwOnError)throw r;f=n,h={},g=r}}let _=``,v=``;try{_=i.options.loaderDeps?.({search:f})??``,v=_&&JSON.stringify(_)||``}catch(e){if(t?.throwOnError)throw e;g??=e}let y=c(),b=i._interpolation?fe(i.fullPath,i._interpolation,r,this.pathParamsDecoder,y):i.fullPath,ee=i.id+b+v,x=p(i,n),te=this._cache.get(ee)??(x?.id===ee?x:void 0);m=te?._strictParams??Object.assign(y,m);let S;if(!te)try{zt(i,m)}catch(e){if(S=pe(e)||ge(e)?e:new jt(e.message,{cause:e}),t?.throwOnError)throw S}let C=x?`stay`:`enter`,ne;if(te)ne={...te,cause:C,search:l(x?x.search:te.search,f),_strictSearch:h,searchError:g};else{let e=Ct(i)?`pending`:`success`;ne={id:ee,ssr:i.options.ssr,index:n,routeId:i.id,params:x?.params??m,_strictParams:m,pathname:b,updatedAt:Date.now(),search:x?l(x.search,f):f,_strictSearch:h,searchError:g,status:e,isFetching:!1,error:void 0,paramsError:S,context:{},abortController:t?._controller??new AbortController,cause:C,loaderDeps:x?u(x.loaderDeps,_):_,invalid:!1,preload:!1,staticData:i.options.staticData||{},fullPath:i.fullPath}}let re=s===i.id;ne._notFound&&!re&&(ne.error=void 0),ne._notFound=re,d[n]=ne}for(let e=0;e<d.length;e++){let n=d[e];n.params=n.cause===`stay`?l(n.params,m):m,t?._controller&&(n.context={})}return d}matchRoutesLightweight(e){let t=i(this.stores.ids.get()),n=t?this.stores.byRoute.get(t).get():void 0,r=n?.id,a=this.lightweightCache.get(e);if(a&&a[0]===r)return a[1];let[o,s]=this.getMatchedRoutes(e.pathname),c=i(o),l={...e.search};for(let e of o)try{Object.assign(l,Mt(e.options.validateSearch,l))}catch{}let u=n&&n.routeId===c.id&&n.pathname===e.pathname,d;if(u)d=n.params;else{let e=s;for(let t of o)try{zt(t,e)}catch{}d=e}let f=[o,c.fullPath,l,d];return this.lightweightCache.set(e,[r,f]),f}};async function kt(e,t,{replace:n,ignoreBlocker:r}){if(!b(t,e.protocolAllowlist)){if(!r){let t=e.history._getBlockers();for(let r of t)if(r?.blockerFn&&await r.blockerFn({currentLocation:e.history.location,nextLocation:e.history.location,action:n?`REPLACE`:`PUSH`}))return}e.history._ignoreNextBeforeUnload?.(t),n?window.location.replace(t):window.location.href=t}}var At=class extends Error{},jt=class extends Error{};function Mt(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new At(`Async validation not supported`);if(n.issues)throw new At(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return`parse`in e?e.parse(t):typeof e==`function`?e(t):{}}function Nt(e,t){if(e===void 0||e===!0)return t;let n=Object.create(null);return e===!1||e===null?n:typeof e==`function`?(Object.assign(n,t),Object.assign(n,e(n))):Object.assign(n,t,e)}function Pt(e,t){return typeof e==`function`?!0:!t||e===!1||e===null?!1:e===void 0||e===!0||t.some(t=>typeof t!=`string`&&!o.call(e,t[1]))}var Ft=Object.freeze({});function It(e,t){let n=[];for(let r=0;r<e.length;r++){let i=e[r].options;`search`in i?i.search?.middlewares&&n.push(...i.search.middlewares):(i.preSearchFilters||i.postSearchFilters)&&n.push(({search:e,next:t})=>{let n=t(i.preSearchFilters?i.preSearchFilters.reduce((e,t)=>t(e),e):e);return i.postSearchFilters?i.postSearchFilters.reduce((e,t)=>t(e),n):n});let a=i.validateSearch;t&&a&&n.push(({search:e,next:t,meta:n})=>{let r=t(e);try{let e=Mt(a,r);if(n&&e)for(let t in e)t in r||(n.defaulted||=new Map).set(t,e[t]);return{...r,...e}}catch{}return r})}return n}function Lt(e,t,n){let r=(t,i,o)=>{if(t>=e.length){if(!n.search)return{};if(n.search===!0)return i;let e=a(n.search,i);return o&&(o.explicit=e),e}return e[t]({search:i,next:(e,n)=>{if(n){let n=o||{};return{search:r(t+1,e,n),meta:n}}return r(t+1,e,o)},meta:o})};return r(0,t)}function Rt(e,t){if(e!==`root`){let e;for(let n=t.length-1;n>=0;n--){let r=t[n];if(r.options.notFoundComponent)return r.id;e||=r.children&&r.id}if(e)return e}return me}function zt(e,t){let n=e.options.params?.parse??e.options.parseParams;n&&Object.assign(t,n(t))}function Bt(e,t){return e.options[t]?.preload?.()}function Vt(e,t){let n=Bt(e,`component`),r=Bt(e,`pendingComponent`);return t&&(r?r=r.then(t):t()),n&&r?Promise.all([n,r]).then(()=>{}):n??r}function Ht(e,t,n){let r=()=>t===!1?void 0:t?Bt(e,t):Vt(e,n),i=e._lazy;if(i)return i===!0?r():i.then(r);if(!e.lazyFn)return r();let a=e.lazyFn().then(t=>{{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazy=!0}},t=>{throw e._lazy=void 0,t});return e._lazy=a,a.then(r)}function Ut(e){let t=e.findIndex(e=>e.status!==`success`||e._notFound)+1;return t&&t<e.length?e.slice(0,t):e}function Wt(e,t,n){let r=e._tx;return t&&r?.[2]===n&&!r[3].some(e=>e.routeId===t)}function Gt(e){let t=e.length;for(let n=0;n<t;n++){let r=e[n];if(r._assetEnd!==void 0)t=Math.min(t,Math.max(n+1,r._assetEnd));else if(r.status!==`success`||r._notFound){t=n+1;break}}return t<e.length?e.slice(0,t):e}var Kt=0,qt=1,Jt=2,Yt=3,Xt=[4];function Zt(e){return typeof e[0]==`number`}function Qt(e,t){return t.aborted?Promise.race([Promise.reject(t),e]):new Promise((n,r)=>{let i=()=>r(t);t.addEventListener(`abort`,i,{once:!0}),Promise.resolve(e).then(n,r).then(()=>t.removeEventListener(`abort`,i))})}function $t(e,t){return e.routesById[t.routeId]}function en(e,t,n){return ge(e)?[Yt,e]:pe(e)?(e.routeId||=n,[Jt,e]):t?(typeof e?.then==`function`&&(e=Error(`A Promise was thrown`,{cause:e})),[qt,e]):[Kt,e]}function tn(e,t){let n=en(t,!0,e.id);if(n[0]!==qt)return n;try{e.options.onError?.(n[1])}catch(t){n=en(t,!0,e.id)}return n}function nn(e,t,n,r,i){return i[0].signal.aborted?Xt:yn(e,t,n,tn(n,r),i)}async function rn(e,t,n,r,i,a){let[o,s]=t,c=n[0].signal,l=!!n[3];for(let i=n[6]??0;i<r;i++){let r=s[i],u=$t(e,r);r.abortController=n[0];let d=s[i-1]?.context??e.options.context??{},f={params:r.params,location:o,navigate:t=>e.navigate({...t,_fromLocation:o}),buildLocation:e.buildLocation,cause:l?`preload`:r.cause,abortController:n[0],preload:l,matches:s,routeId:u.id};try{let e=r._ctx||=u.options.context?u.options.context({...f,deps:r.loaderDeps,context:d})||{}:void 0;r.context={...d,...e}}catch(a){return on(e,r),[i,nn(e,t,u,a,n)]}if(c.aborted)return[i,Xt];let p=r.paramsError??r.searchError;if(p!==void 0)return on(e,r),[i,nn(e,t,u,p,n)];let m=u.options.beforeLoad;if(!m)continue;let h=r.status;i>=a&&(r.status=`pending`,n[7]?.());try{ln(e,r,`beforeLoad`,n[0]);let a=m({...f,search:r.search,context:r.context,...e.options.additionalContext}),o=await(typeof a?.then==`function`?Qt(a,c):a);if(c.aborted)return[i,Xt];let s=yn(e,t,u,en(o,!1,u.id),n);if(s[0]!==Kt)return on(e,r),[i,s];r.context={...r.context,...o}}catch(a){return on(e,r),[i,nn(e,t,u,a,n)]}finally{r.status=h,ln(e,r,!1,n[0])}}i()}function an(e,t,n){if(!(!n||--n[2])){if(e._flights?.get(t.id)===n){let n=e._tx;if(n&&!n[0].signal.aborted&&!n[3].includes(t)&&n[3].some(e=>e.id===t.id)&&n[3].some(e=>e.isFetching===`beforeLoad`))return;e._flights.delete(t.id)}return n[1]}}function on(e,t){let n=t._flight;t._flight=void 0,an(e,t,n)?.abort()}function sn(e,t,n,r){let i=[];for(let a of t)if(!n?.includes(a)){let t=a._flight;if(a._flight=void 0,r&&t?.[2]===1&&e._flights?.get(a.id)===t&&n?.some(e=>e.id===a.id))t[2]=0;else{let n=an(e,a,t);n&&i.push(n)}}for(let e of i)e.abort()}function cn(e){for(let t of e){let e=t._flight;e&&e[2]++}}function ln(e,t,n,r){if(t.isFetching=n,r&&e._tx?.[0]!==r)return;let i=e.stores.byRoute.get(t.routeId),a=i?.get();a?.id===t.id&&i.set({...a,isFetching:n})}function un(e,t,n,r,i,a,o){let s=t[0];return{params:n.params,location:s,navigate:t=>e.navigate({...t,_fromLocation:s}),cause:o?`preload`:n.cause,abortController:i,preload:o,deps:n.loaderDeps,parentMatchPromise:a,context:n.context,route:r,...e.options.additionalContext}}async function dn(e,t,n,r,i,a,o){let s=o[0],c=s.signal;if(c.aborted)return Xt;if(!i)return[Kt,void 0];let l=n._flight;ln(e,n,`loader`,s);try{if(!l){let s=new AbortController;l=[Promise.resolve().then(()=>i(un(e,t,n,r,s,a,!!o[3]))).then(e=>en(e,!1,r.id),e=>en(e,!0,r.id)).then(t=>(t[0]!==Kt&&e._flights?.get(n.id)===l&&(e._flights.delete(n.id),l[2]||s.abort()),t[0]===qt&&l[2]?tn(r,t[1]):t)),s,1],(e._flights??=new Map).set(n.id,l)}return n._flight=l,n.abortController=l[1],yn(e,t,r,await Qt(l[0],c),o)}catch(t){if(t!==c||!c.aborted)throw t;return on(e,n),Xt}finally{ln(e,n,!1,s)}}function fn(e,t,n){t[0]!==Yt&&(e.status=`success`,e.error=void 0,t[0]===Kt?(e.loaderData=t[1],e.invalid=!1,e.updatedAt=Date.now(),e.preload=n):e.invalid=!0)}function pn(e,t,n){let r=e._cache.get(t.id);if(r!==n||e._committed.some(e=>e.id===t.id&&e._flight===t._flight))return;let i={...t,_notFound:void 0,context:{}};i._flight&&i._flight[2]++,e._cache.set(t.id,i),r&&on(e,r)}function mn(e,t){return t[0]===qt||t[0]===Jt?{...e,status:t[0]===qt?`error`:`notFound`,error:t[1],_flight:void 0}:e}function hn(e,t,n,r,i,a,o){let s=t[1][n],c=$t(e,s),l=!!a[3],u=e._cache.get(s.id),d,f=!1,p;try{if(s.status===`success`&&(d=c.options.shouldReload,typeof d==`function`&&(d=d(un(e,t,s,c,a[0],i,l))),a[0].signal.aborted&&(p=Xt)),!p){if(s.status!==`success`)f=!0;else{let t=l||s.preload?c.options.preloadStaleTime??e.options.defaultPreloadStaleTime??3e4:c.options.staleTime??e.options.defaultStaleTime??0;f=!!(s.invalid||d||d===void 0&&Date.now()-s.updatedAt>=t&&(a[5]||s.cause===`enter`||a[2].some(e=>e.routeId===s.routeId&&e.id!==s.id)))}}}catch(n){s.invalid=!0,on(e,s),p=nn(e,t,c,n,a)}let m=c.options.loader,h=typeof m==`function`,g=h?m:m?.handler,_=!l||c.options.preload!==!1,v=_&&m?e._flights?.get(s.id):void 0;v===s._flight||p?v=void 0:v&&!f&&!l&&d===void 0?f=!0:f||(v=void 0);let y=!(!m||!f||s.status!==`success`||l||a[4]||((h?void 0:m.staleReloadMode)??e.options.defaultStaleReloadMode)===`blocking`),b=f&&_,ee=b&&!y&&(s.status!==`success`||!!m),x=n>=o?a[7]:void 0,te=c.lazyFn&&c._lazy!==!0?x:void 0;if(b&&!m&&(s.invalid=!1,s.updatedAt=Date.now()),v&&v[2]++,ee){let t=s._flight;s._flight=v,an(e,s,t)?.abort(),n>=o&&(s.status=`pending`),x?.()}b||(s.isFetching=!1);let S=!p&&ee?dn(e,t,s,c,g,i,a).then(t=>(fn(s,t,l),t[0]===Kt&&(m&&!a[0].signal.aborted&&pn(e,s,u),n>=o&&(s.status=`pending`)),t)):Promise.resolve(p??[Kt,s.loaderData]),C=(async()=>{try{let e=Ht(c,void 0,te);e&&await Qt(e,a[0].signal)}catch(r){if(!t[1].some((e,t)=>t<=n&&(e.status===`error`||e.status===`notFound`||e._notFound)))return[n,nn(e,t,c,r,a)]}let r=await S;ee&&r[0]===Kt&&s.status===`pending`&&!a[0].signal.aborted&&(s.status=`success`,x?.())})();if(r.push([n,S,C]),!y)return S.then(e=>mn(s,e));let ne={...s,status:`pending`,preload:!1,_flight:v};s.invalid=!1,s.isFetching=`loader`;let re=dn(e,t,ne,c,g,i,a).then(e=>(s.isFetching=!1,fn(ne,e,!1),e));return(t[2]??=[]).push([n,re,C,ne]),re.then(e=>mn(ne,e))}async function gn(e,t,n,r,i=0){let a=n?.[1][1],o=a?.routeId?t.findIndex(e=>e.routeId===a.routeId):n?.[0]??t.length-1;o<0&&(o=0);for(let n=o;n>=0;n--){let i=$t(e,t[n]);try{let e=Ht(i,!1);e&&await Qt(e,r)}catch(e){if(e===r&&r.aborted)throw e}if(i.options.notFoundComponent)return n}return a?.routeId?o:i}function _n(e,t){t[2]&&=(sn(e,t[2].map(e=>e[3])),void 0)}async function vn(e,t,n,r){let i;try{await Promise.all(e.map(e=>e[1].then(async t=>{let a=e[0];if(!(r&&a>=await r)){if(t[0]>=Yt)throw[a,t];!i&&t[0]!==Kt&&(i=[a,t],await Promise.all((n??[]).map(e=>{if(!(e[0]<=a))return e[1].then(t=>{if(t[0]===Yt)throw[e[0],t]})})))}})))}catch(e){return e}return t??i}function yn(e,t,n,r,i,a){for(;r[0]===Yt;){let o=r[1],s=o.options;try{if((s.href||o.headers.has(`Location`))&&(e.resolveRedirect(o),s.reloadDocument)||(s.reloadDocument?i[3]:i[1]>=20))return r;let n=e.buildLocation({...s,_fromLocation:t[0],_includeValidateSearch:!0}),a=n.maskedLocation??n;if(a.external){let t=o.clone();return t.options={...s},t.headers.set(`Location`,a.publicHref),e.resolveRedirect(t),i[3]?[Yt,t]:[Yt,t,a]}return[Yt,o,n]}catch(e){r=a?[qt,e]:tn(n,e),a=!0}}return r}async function bn(e,t,n,r,i,a){let o=t[1],s=await i,c=!1,l=o.findIndex(e=>e._notFound),u=t=>t[1][0]===Jt?gn(e,o,t,r.signal):t[0],d=l<0?o.length:l;if((s?.[1][0]??0)>=Yt)d=0;else if(s){d=s[2]??=await u(s);for(let e of n){if(e[0]>=d)break;let t=await e[1];if(t[0]!==Kt&&t[0]<Yt&&!(`loaderData`in o[e[0]])){s=[e[0],t],d=s[2]=await u(s);break}}}for(let e of n){if(e[0]>=d)break;let t=await e[2];if(t){s=t;break}}if((s?.[1][0]??0)>=Yt){let n=s[1];if(n[0]!==Yt||n[1].options.reloadDocument||n[2])return _n(e,t),n;c=!0,s=[0,[qt,Error(`Too many redirects`)]]}let f=s?s[2]??await u(s):l;if(f>=0){let i=s?.[1],l=i?.[0],u=o[f],d=i?.[1],p=()=>{i&&(u._notFound=void 0,l===qt?u.status=`error`:(d.routeId=u.routeId,u.routeId===e.routeTree.id?(u.status=`success`,u._notFound=!0):u.status=`notFound`),u.error=d,u.isFetching=!1)};p(),i||a?.();let m=$t(e,u);try{await Qt(i?Promise.resolve().then(()=>Ht(m,l===qt?`errorComponent`:`notFoundComponent`)):Promise.all([Ht(m),Ht(m,`notFoundComponent`)]),r.signal)}catch(n){if(n===r.signal&&r.signal.aborted)return _n(e,t),Xt}i?c&&(r.abort(),await Promise.all([...n.map(e=>e[1]),...n.map(e=>e[2]),...(t[2]??[]).map(e=>e[1])]),_n(e,t),sn(e,o),p()):u.status=`success`}return t}async function xn(e,t,n,r=0,i=t[1].length){let a=t[1];for(let t=r;t<i;t++){let r=a[t],i=$t(e,r).options;if(i.head||i.scripts)try{let t={ssr:e.options.ssr,matches:a,match:r,params:r.params,loaderData:r.loaderData},[o,s]=await Qt(Promise.all([i.head?.(t),i.scripts?.(t)]),n);r.meta=o?.meta,r.links=o?.links,r.headScripts=o?.scripts,r.styles=o?.styles,r.scripts=s}catch(e){if(e===n&&n.aborted)break;console.error(e)}if(r.status!==`success`||r._notFound)break}return t}async function Sn(e,t,n,r){let i=[t,n],a=r[0].signal,o;try{let t=e.stores.matches.get(),s=n.findIndex(e=>e._notFound);if(e.options.notFoundMode!==`root`&&s>=0){let t=await gn(e,n,void 0,a,s);n[s]._notFound=void 0,n[t]._notFound=!0,s=t}let c=s<0?n.length:s+1,l=0;for(;l<c&&l!==s;){let e=n[l],i=r[2][l],a=t[l];if(i?.id!==e.id||i.status!==`success`||e.preload||a?.id!==e.id||a.status!==`success`||(l++,i._notFound||a._notFound))break}let u=[],d=r[6]??0,f=d?Promise.resolve(n[d-1]):void 0,p=()=>{for(let t=d;t<c&&!a.aborted;t++)f=hn(e,i,t,u,f,r,l)},m=await rn(e,i,r,c,p,l);if(m){if(r[4]=!0,c=m[0],m[1][0]===Jt){let t=await gn(e,n,m,a);m[2]=t,c=Math.min(c,t+1)}else m[1][0]>=Yt&&(c=0);p()}if(!a.aborted&&!r[3]){let t=[];for(let[n,r]of e._flights??[])r[2]||(e._flights.delete(n),t.push(r[1]));for(let e of t)e.abort()}let h=bn(e,i,u,r[0],vn(u,m,i[2]),r[7]);i[2]?.length&&(i[3]=vn(i[2],void 0,void 0,h.then(e=>Zt(e)?0:Ut(n).length,()=>0))),o=await h}catch(t){if(_n(e,i),t===a&&a.aborted)return Xt;throw t}return Zt(o)?o:xn(e,o,a,r[6]===n.length?r[6]:0)}function Cn(e,t){if(e._tx!==t)return;let n=t[3],r=e.stores.matches.get(),i=e._pending;for(let a=0;a<n.length;a++){let o=n[a],s=o.status===`success`&&!o._notFound,c=r[a]?.id===o.id&&r[a]?.status===`pending`;if(s&&!c)continue;let l=$t(e,o),u=s||o.invalid?0:l.options.pendingMs??e.options.defaultPendingMs,d=l.options.pendingComponent??e.options.defaultPendingComponent;if(!d||typeof u!=`number`||u===1/0){i&&(i[0]=t,i[2]=0,i[4]=!0);return}let f=l.options.pendingMinMs??e.options.defaultPendingMinMs??0,p=!1;if(i?.[1]===o.id?(p=i[0]!==t,i[0]=t):(clearTimeout(i?.[3]),e._pending=i=void 0),i||(e._pending=i=[t,o.id,c?Date.now()+f:t[4]+u,void 0,c||void 0,d]),i[4]&&!p&&i[5]===d)return;if(i[5]=d,!i[4]){clearTimeout(i[3]);let n=i[2]-Date.now();if(n>0){i[3]=setTimeout(()=>Cn(e,t),n);return}i[2]=0}let m=n.map(e=>({...e,_flight:void 0}));m[a].status=`pending`;let h=i[4]=e.startTransition(()=>e.stores.setMatches(m),m).then(t=>(t&&e._pending===i&&i[4]===h&&!i[2]&&(i[2]=Date.now()+f),t));return}}function wn(e,t){let n=e._pending;e._tx!==t&&e._tx?.[3].some(e=>e.id===n?.[1])||(clearTimeout(n?.[3]),e._pending=void 0)}async function Tn(e,t){let n=e._pending;if(!n)return;clearTimeout(n[3]);let r=n[2]-Date.now();if(!n[4]||r<=0||!Ut(t[3]).some(e=>e.id===n[1]))return;let i;try{await Qt(new Promise(e=>{i=setTimeout(e,r)}),t[0].signal)}catch{}clearTimeout(i)}function En(e,t){e._committed=t,e.stores.setMatches(t)}function Dn(e,t,n,r){let i=e._committed,a=e._lifecycleEnd,o=e._cache;for(let e of n)e.preload=!1,r&&(e._assetEnd=void 0);let s=Ut(n).length,c=new Map;{let t=Date.now(),r=new Set;for(let e=0;e<n.length;e++){let t=n[e];(e<s||t.status===`success`)&&r.add(t.id)}for(let n of[...i,...o.values()]){if(n.status!==`success`||r.has(n.id))continue;let i=$t(e,n);!i.options.loader||t-n.updatedAt>=(n.preload?i.options.preloadGcTime??e.options.defaultPreloadGcTime??3e5:i.options.gcTime??e.options.defaultGcTime??3e5)||c.set(n.id,o.get(n.id)===n?n:{...n,_flight:void 0,isFetching:!1,context:{}})}}t[3]=[],e._cache=c;let l=e._lifecycleEnd=Et(n);En(e,n),sn(e,[...o.values(),...i].filter(e=>e._flight&&c.get(e.id)!==e),n),Dt(e,i,n,a,l,t)}async function On(e,t){let n=e._tx;for(;n&&n!==t;)t=n,await n[5],n=e._tx}function kn(e,t,n){let r=n[1].options,i=n[2];if(!i)return e.navigate({...r,replace:!0,ignoreBlocker:!0});if(r.reloadDocument)return e.navigate({href:(i.maskedLocation??i).publicHref,reloadDocument:!0,replace:!0,ignoreBlocker:!0});i._redirects=t[1]+1,e._pendingLocation=i;let a=e.commitLocation({...i,viewTransition:r.viewTransition,replace:!0,resetScroll:r.resetScroll,hashScrollIntoView:r.hashScrollIntoView,ignoreBlocker:!0});return queueMicrotask(()=>{e._pendingLocation===i&&(e._pendingLocation=void 0)}),a}async function An(e,t,n,r,i){let a=n.map(e=>({...e}));cn(a);for(let t of r)on(e,a[t[0]]),a[t[0]]=t[3];let o=[t[2],a],s;try{s=await bn(e,o,r,t[0],i)}catch(t){throw sn(e,a),t}if(Zt(s))sn(e,a),s[0]===Yt&&e._tx===t&&e._committed===n&&await kn(e,t,s);else if(await xn(e,s,t[0].signal),e._tx!==t||e._committed!==n)sn(e,a);else{for(let t of a){let n=e._cache.get(t.id);n?._flight&&n._flight===t._flight&&(e._cache.delete(t.id),on(e,n))}En(e,a),sn(e,n,a)}}async function jn(e,t,n,r,i,a){let o=await Sn(e,t[2],t[3],[t[0],t[1],e._committed,void 0,i,n,a,r]);if(Zt(o)){let n=o[0]===Yt&&e._tx===t;if((!n||o[1].options.reloadDocument)&&wn(e,t),sn(e,t[3]),t[3]=[],!n)return;if(e._tx!==t){wn(e,t);return}await kn(e,t,o);return}let s=o[1];if(e._tx===t&&await Tn(e,t),e._tx!==t){wn(e,t),sn(e,s),_n(e,o);return}let c=t[2],l=wt(c,e.stores.resolvedLocation.get()),u=o[2];await e.startViewTransition(async()=>{if(e._tx===t&&await Tn(e,t),e._tx!==t){wn(e,t),sn(e,s),_n(e,o);return}let n=await e.startTransition(()=>{wn(e,t),Dn(e,t,s,a),e._tx===t&&(e.emit({type:`onLoad`,...l}),e._tx===t&&e.emit({type:`onBeforeRouteMount`,...l}))},s);e._tx===t?(u?.length&&An(e,t,s,u,o[3]).catch(console.error),e.batch(()=>{e.stores.resolvedLocation.set(c),e.stores.status.set(`idle`),e._tx===t&&e.emit({type:`onResolved`,...l}),n&&e._tx===t&&e.emit({type:`onRendered`,...l})}),e._tx===t&&(e._commitPromise?.resolve(),e._commitPromise=void 0)):_n(e,o)})}async function Mn(e,t){let n=e._tx,r=e.stores.resolvedLocation.get(),i=r??e.stores.location.get(),a=e.latestLocation,o=e._pendingLocation,s=o?.href===a.href?o._redirects??0:0,c=e._handoff,l=c?.[0](),u=new AbortController,d=e._preflight;if(e._preflight=u,l||c?.[1](),d?.abort(),!u.signal.aborted){let t=wt(a,r);e.emit({type:`onBeforeNavigate`,...t}),u.signal.aborted||e.emit({type:`onBeforeLoad`,...t})}if(u.signal.aborted){await On(e,n);return}let f=i.href===a.href,p=u,m=e.matchRoutes(a,{_controller:u});cn(m);let h=l?c[1](m):void 0;if(h?p=l:l?.abort(),u.signal.aborted){sn(e,m),await On(e,n);return}e._preflight=void 0;let g,_=()=>jn(e,y,f,()=>Cn(e,y),t?.sync,h),v=t?.sync?new Promise(e=>g=e):Promise.resolve().then(_),y=[p,s,a,m,Date.now(),v.then(()=>On(e,y))];if(e._tx=y,n){for(let t of e.stores.matches.get()){if(e._tx!==y)break;t.isFetching&&ln(e,t,!1)}n[0].abort(),sn(e,n[3],y[3],!0)}e._tx===y?(e.batch(()=>{e.stores.status.set(`pending`),e.stores.location.set(a)}),(h||!e._committed.length&&m[0]?.status!==`success`&&!m.some(e=>e._notFound))&&Cn(e,y),g?.(_()),await y[5]):(sn(e,y[3]),y[3]=[],g?.(),await On(e,y))}async function Nn(e,t){let n=e.buildLocation(t);for(let t=0;;t++){let r=e._committed,i=new AbortController,a,o,s;try{try{a=e.matchRoutes(n,{_controller:i}),cn(a),o=(e._preloads??=new Map).set(i,a),s=await Sn(e,n,a,[i,t,r,!0])}finally{o&&(o=o.delete(i),sn(e,a)),i.abort()}if(!Zt(s))return s[1];if(!o||s.length<3)return;n=s[2]}catch(e){pe(e)||console.error(e);return}}}var Pn=t((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),Fn=t(((e,t)=>{t.exports=Pn()})),In=t((e=>{var t=r();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:n,a=t.useState,o=t.useEffect,s=t.useLayoutEffect,c=t.useDebugValue;function l(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return s(function(){i.value=n,i.getSnapshot=t,u(i)&&l({inst:i})},[e,n,t]),o(function(){return u(i)&&l({inst:i}),e(function(){u(i)&&l({inst:i})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),Ln=t(((e,t)=>{t.exports=In()})),Rn=t((e=>{var t=r(),n=Ln();function i(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var a=typeof Object.is==`function`?Object.is:i,o=n.useSyncExternalStore,s=t.useRef,c=t.useEffect,l=t.useMemo,u=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var d=s(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=l(function(){function e(e){if(!o){if(o=!0,s=e,e=r(e),i!==void 0&&f.hasValue){var t=f.value;if(i(t,e))return c=t}return c=e}if(t=c,a(s,e))return t;var n=r(e);return i!==void 0&&i(t,n)?(s=e,t):(s=e,c=n)}var o=!1,s,c,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,i]);var p=o(e,d[0],d[1]);return c(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}})),zn=t(((e,t)=>{t.exports=Rn()}));function Bn({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0)n=e.nextSub;else{for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}}while(1)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(1)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}function Vn(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var Hn=[],Un=0,{link:Wn,unlink:Gn,propagate:Kn,checkDirty:qn,shallowPropagate:Jn}=Bn({update(e){return e._update()},notify(e){Hn[Xn++]=e,e.flags&=-3},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,er(e))}}),Yn=0,Xn=0,Zn,Qn=0;function $n(e){try{++Qn,e()}finally{--Qn||tr()}}function er(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=Gn(n,e)}function tr(){if(!(Qn>0)){for(;Yn<Xn;){let e=Hn[Yn];Hn[Yn++]=void 0,e.notify()}Yn=0,Xn=0}}function nr(e,t){let n=typeof e==`function`,r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:+!n,get(){return Zn!==void 0&&Wn(i,Zn,Un),i._snapshot},subscribe(e){let t=Vn(e),n={current:!1},r=rr(()=>{i.get(),n.current?(Zn=void 0,t.next?.(i._snapshot)):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=Zn,o=t?.compare??Object.is;if(n)Zn=i,++Un,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=5);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{Zn=a,n&&(i.flags&=-5),er(i)}}};return n?(i.flags=17,i.get=function(){let e=i.flags;if(e&16||e&32&&qn(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&Jn(e)}}else e&32&&(i.flags=e&-33);return Zn!==void 0&&Wn(i,Zn,Un),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(Kn(e),Jn(e),tr())}},i}function rr(e){let t=()=>{let t=Zn;Zn=n,++Un,n.depsTail=void 0,n.flags=6;try{return e()}finally{Zn=t,n.flags&=-5,er(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:6,notify(){let e=this.flags;e&16||e&32&&qn(this.deps,this)?t():this.flags=2},stop(){this.flags=0,this.depsTail=void 0,er(this)}};return t(),n}var ir=e=>({createMutableStore:nr,createReadonlyStore:nr,batch:$n}),ar=e=>new or(e),or=class extends Ot{constructor(e){super(e,ir)}},sr=t((e=>{var t=r();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function i(){}var a={d:{f:i,r:function(){throw Error(n(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for(`react.portal`),s=Symbol.for(`react.recoverable`),c=Symbol.for(`react.optimistic_key`);function l(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:r===c?c:``+r,children:e,containerInfo:t,implementation:n}}var u=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,e.browser=function(e){return{$$typeof:s,_reason:e}},e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return l(e,t,null,r)},e.flushSync=function(e){var t=u.T,n=a.p;try{if(u.T=null,a.p=2,e)return e()}finally{u.T=t,a.p=n,a.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,a.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin),i=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=d(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??a.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin);a.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=d(t.as,t.crossOrigin);a.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else a.d.m(e)}},e.requestFormReset=function(e){a.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return u.H.useFormState(e,t,n)},e.useFormStatus=function(){return u.H.useHostTransitionStatus()},e.version=`19.3.1`})),cr=t(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=sr()})),T=(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 n=e;for(let e=0,r=t.length;e<r;e++)n=t[e](n);return n}}},lr={pipe(){return T(this,arguments)}},ur=function(){function e(){}return e.prototype=lr,e}(),E=function(e,t){if(typeof e==`function`)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,n){return arguments.length>=2?t(e,n):function(n){return t(n,e)}};case 3:return function(e,n,r){return arguments.length>=3?t(e,n,r):function(r){return t(r,e,n)}};default:return function(){if(arguments.length>=e)return t.apply(this,arguments);let n=arguments;return function(e){return t(e,...n)}}}},D=e=>e,dr=e=>()=>e,fr=dr(!0),pr=dr(!1),mr=dr(void 0),hr=mr;function gr(e,...t){return T(e,t)}function _r(e,t,n,r,i,a,o,s,c){switch(arguments.length){case 1:return e;case 2:return function(){return t(e.apply(this,arguments))};case 3:return function(){return n(t(e.apply(this,arguments)))};case 4:return function(){return r(n(t(e.apply(this,arguments))))};case 5:return function(){return i(r(n(t(e.apply(this,arguments)))))};case 6:return function(){return a(i(r(n(t(e.apply(this,arguments))))))};case 7:return function(){return o(a(i(r(n(t(e.apply(this,arguments)))))))};case 8:return function(){return s(o(a(i(r(n(t(e.apply(this,arguments))))))))};case 9:return function(){return c(s(o(a(i(r(n(t(e.apply(this,arguments)))))))))}}}function vr(e){let t=new WeakMap;return n=>{let r=t.get(n);if(r!==void 0)return r;let i=e(n);return t.set(n,i),i}}function yr(e){let t=new WeakMap;return n=>{let r=t.get(n);if(r!==void 0)return r;let i=e(n);return t.set(n,i),i!==n&&t.set(i,i),i}}var br=e=>{let t=new Set(Reflect.ownKeys(e));if(e.constructor===Object)return t;e instanceof Error&&t.delete(`stack`);let n=Object.getPrototypeOf(e),r=n;for(;r!==null&&r!==Object.prototype;){let e=Reflect.ownKeys(r);for(let n=0;n<e.length;n++)t.add(e[n]);r=Object.getPrototypeOf(r)}return t.has(`constructor`)&&typeof e.constructor==`function`&&n===e.constructor.prototype&&t.delete(`constructor`),t},xr=new WeakSet,Sr=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),Cr=e=>e instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&e instanceof SharedArrayBuffer,wr=e=>{try{return new Uint8Array(e)}catch{return}},Tr=0,Er=()=>{Tr++};function Dr(e){return typeof e==`string`}function Or(e){return typeof e==`number`}function kr(e){return typeof e==`boolean`}function Ar(e){return typeof e==`symbol`}function jr(e){return Dr(e)||Or(e)||Ar(e)}function Mr(e){return typeof e==`function`}function Nr(e){return e===null}function Pr(e){return e==null}function Fr(e){return e!=null}function Ir(e){return!1}function Lr(e){return!0}function Rr(e){return typeof e==`object`&&!!e}function zr(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Br(e){return typeof e==`object`&&!!e||Mr(e)}var O=E(2,(e,t)=>Br(e)&&t in e),Vr=E(2,(e,t)=>O(e,`_tag`)&&e._tag===t);function Hr(e){return e instanceof Error}function Ur(e){return O(e,Symbol.iterator)||Dr(e)}var Wr=E(2,(e,t)=>n=>e(n)||t(n)),Gr=`~effect/Hash`,k=e=>{switch(typeof e){case`number`:return Qr(e);case`bigint`:return $r(e.toString(10));case`string`:return $r(e);case`function`:case`object`:if(e===null)break;if(e instanceof Date)return Number.isNaN(e.getTime())?$r(`Invalid Date`):$r(e.toISOString());if(e instanceof RegExp)return $r(e.toString());{if(xr.has(e))return Kr(e);let t=ci.get(e);if(t!==void 0)return t;if(li.has(e))return Er(),$r(`[Circular]`);li.add(e);let n=Tr,r;try{if(Xr(e))r=e[Gr]();else if(typeof e==`function`)r=Kr(e);else if(Cr(e)){let t=wr(e);r=t===void 0?Kr(e):ri(t)}else r=e instanceof DataView?ri(Sr(e)):Array.isArray(e)||ArrayBuffer.isView(e)?ri(e):e instanceof Map?ii(e):e instanceof Set?oi(e):ti(e)}finally{li.delete(e)}return n===Tr&&ci.set(e,r),r}}return Yr(qr($r(String(e))))},Kr=e=>(si.has(e)||si.set(e,Yr(Math.random()*4294967296|0)),si.get(e)),qr=e=>(e^=e>>>16,e=Math.imul(e,2246822507),e^=e>>>13,e=Math.imul(e,3266489909),e^e>>>16),Jr=E(2,(e,t)=>qr(Math.imul(e,2654435761)+Math.imul(t,2246822507))),Yr=e=>e&3221225471|e>>>1&1073741824,Xr=e=>O(e,`~effect/Hash`)&&typeof e[`~effect/Hash`]==`function`,Zr=new DataView(new ArrayBuffer(8)),Qr=e=>{let t=e|0;return t===e?Yr(t):(Zr.setFloat64(0,e===e?e:NaN),Yr(Jr(Zr.getInt32(0),Zr.getInt32(4))))},$r=e=>{let t=5381,n=e.length;for(;n;)t=t*33^e.charCodeAt(--n);return Yr(t)},ei=(e,t)=>{let n=12289;for(let r of t)n^=Jr(k(r),k(e[r]));return Yr(n)},ti=e=>ei(e,br(e)),ni=(e,t)=>n=>{let r=e;for(let e of n)r^=t(e);return Yr(r)},ri=e=>{let t=6151;for(let n of e)t=Jr(t,k(n));return Yr(t)},ii=ni($r(`Map`),([e,t])=>Jr(k(e),k(t))),ai=$r(`Set`),oi=ni(ai,e=>Jr(ai,k(e))),si=new WeakMap,ci=new WeakMap,li=new WeakSet,ui=`~effect/Equal`;function di(){return arguments.length===1?e=>fi(e,arguments[0]):fi(arguments[0],arguments[1])}function fi(e,t){if(e===t)return!0;if(e==null||t==null)return!1;let n=typeof e;return n===typeof t?n===`number`&&e!==e&&t!==t?!0:n!==`object`&&n!==`function`||xr.has(e)||xr.has(t)?!1:pi(e,t):!1}function pi(e,t){let n=hi.length;for(let r=n;r-->0;)if(hi[r]===e&&gi[r]===t)return!0;if(n)return mi(e,t);let r=_i.get(e);r||_i.set(e,r=new WeakMap);let i=r.get(t);return i===void 0&&r.set(t,i=mi(e,t)),i}function mi(e,t){hi.push(e),gi.push(t);try{return vi(e,t)}finally{hi.pop(),gi.pop()}}var hi=[],gi=[],_i=new WeakMap;function vi(e,t){if(k(e)!==k(t))return!1;if(e instanceof Date){if(!(t instanceof Date))return!1;let n=e.getTime(),r=t.getTime();return n===r||Number.isNaN(n)&&Number.isNaN(r)}if(e instanceof RegExp)return t instanceof RegExp&&e.toString()===t.toString();let n=Ti(e);if(n!==Ti(t)||typeof e==`function`&&!n)return!1;if(n)return e[ui](t);if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:yi(e,t);if(Cr(e)){if(!Cr(t)||e instanceof ArrayBuffer!=t instanceof ArrayBuffer)return!1;let n=wr(e),r=wr(t);return n!==void 0&&r!==void 0&&bi(n,r)}if(ArrayBuffer.isView(e)){let n=e instanceof DataView;return!ArrayBuffer.isView(t)||e.byteLength!==t.byteLength||n!==t instanceof DataView?!1:n?bi(Sr(e),Sr(t)):bi(e,t)}return e instanceof Map?!(t instanceof Map)||e.size!==t.size?!1:Si(e,t,Ci,wi):e instanceof Set?!(t instanceof Set)||e.size!==t.size?!1:Si(e,t,k,fi):xi(e,t)}function yi(e,t){for(let n=0;n<e.length;n++)if(!fi(e[n],t[n]))return!1;return!0}function bi(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function xi(e,t){let n=br(e),r=br(t);if(n.size!==r.size)return!1;for(let i of n)if(!r.has(i)||!fi(e[i],t[i]))return!1;return!0}function Si(e,t,n,r){let i=new Map,a=0;for(let e of t){let t=n(e),r=i.get(t);r?r.push(e):i.set(t,[e]),a++}outer:for(let t of e){let e=i.get(n(t));if(e){for(let n=0;n<e.length;n++)if(r(t,e[n])){e[n]=e[e.length-1],e.pop(),a--;continue outer}}return!1}return a===0}var Ci=e=>k(e[0]),wi=(e,t)=>fi(e[0],t[0])&&fi(e[1],t[1]),Ti=e=>O(e,`~effect/Equal`)&&typeof e[`~effect/Equal`]==`function`,Ei=()=>di,Di=e=>(t,n)=>t===n||e(t,n),Oi=(e,t)=>e===t,ki=()=>Oi;function Ai(e){return Di((t,n)=>{if(t.length!==n.length)return!1;for(let r=0;r<t.length;r++)if(!e[r](t[r],n[r]))return!1;return!0})}function ji(e){return Di((t,n)=>{if(t.length!==n.length)return!1;for(let r=0;r<t.length;r++)if(!e(t[r],n[r]))return!1;return!0})}var Mi=e=>e.length>0,Ni=e=>e>0?Math.floor(e):0,Pi=e=>Math.max(1,Ni(e));function Fi(e,t,n){t===`__proto__`?Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0}):e[t]=n}function Ii(e,t){if(!Object.hasOwn(t,`__proto__`))Object.assign(e,t);else for(let n of Reflect.ownKeys(t))Object.prototype.propertyIsEnumerable.call(t,n)&&Fi(e,n,t[n])}var Li=Symbol.for(`~effect/Redactable`),Ri=e=>O(e,Li);function zi(e){return Ri(e)?Bi(e):e}function Bi(e){return e[Li](globalThis[`~effect/Fiber/currentFiber`]?.context??Ui)}var Vi=`~effect/Fiber/currentFiber`,Hi=new Map,Ui={"~effect/Context":{},base:Hi,depth:0,mapUnsafe:Hi,pipe(){return T(this,arguments)}};function Wi(e,t){let n=t?.space??0,r=new WeakSet,i=n?typeof n==`number`?` `.repeat(n):n:``,a=e=>i.repeat(e),o=(e,t)=>{let n=e?.constructor;return n&&n!==Object.prototype.constructor&&n.name?`${n.name}(${t})`:t},s=e=>{try{return Reflect.ownKeys(e)}catch{return[`[ownKeys threw]`]}};function c(e,t=0){try{return l(e,t)}catch{return(typeof e==`object`&&e||typeof e==`function`)&&r.delete(e),`[inspection threw]`}}function l(e,n=0){if(typeof e==`string`)return JSON.stringify(e);if(typeof e==`number`||e==null||typeof e==`boolean`||typeof e==`symbol`)return String(e);if(typeof e==`bigint`)return String(e)+`n`;if(typeof e==`object`||typeof e==`function`){if(r.has(e))return Gi;r.add(e);let l;if(Li in e)l=c(Bi(e),n);else if(Array.isArray(e))l=!i||e.length<=1?`[${e.map(e=>c(e,n)).join(`,`)}]`:`[\n${a(n+1)}${e.map(e=>c(e,n+1)).join(`,
|
|
3
|
+
`+a(n+1))}\n${a(n)}]`;else if(e instanceof Date)l=Ji(e);else if(!t?.ignoreToString&&O(e,`toString`)&&typeof e.toString==`function`&&e.toString!==Object.prototype.toString&&e.toString!==Array.prototype.toString){let t=Yi(e);l=e instanceof Error&&e.cause!==void 0?`${t} (cause: ${c(e.cause,n)})`:t}else if(Symbol.iterator in e)l=`${e.constructor.name}(${c(Array.from(e),n)})`;else{let t=s(e);if(!i||t.length<=1){let r=`{${t.map(t=>`${Ki(t)}:${c(Xi(e,t),n)}`).join(`,`)}}`;l=o(e,r)}else{let r=`{\n${t.map(t=>`${a(n+1)}${Ki(t)}: ${c(Xi(e,t),n+1)}`).join(`,
|
|
4
|
+
`)}\n${a(n)}}`;l=o(e,r)}}return r.delete(e),l}return String(e)}return c(e,0)}var Gi=`[Circular]`;function Ki(e){return typeof e==`string`?JSON.stringify(e):String(e)}function qi(e){return e.map(e=>`[${Ki(e)}]`).join(``)}function Ji(e){try{return e.toISOString()}catch{return`Invalid Date`}}function Yi(e){try{let t=e.toString();return typeof t==`string`?t:String(t)}catch{return`[toString threw]`}}function Xi(e,t){try{return e[t]}catch{return`[property access threw]`}}function Zi(e,t){let n=[],r=new WeakMap;return JSON.stringify(e,function(e,t){let i=Object.getOwnPropertyDescriptor(r.get(this)??this,e)?.value,a=O(i,Li)?zi(i):zi(t);if(typeof a==`bigint`)return Wi(a);if(typeof a!=`object`||!a)return a;let o=a instanceof Error&&!O(a,`toJSON`)?{...a,name:a.name,message:a.message}:a;for(;n.length>0&&n[n.length-1]!==this;)n.pop();if(n.includes(a))return;if(n.push(a),o!==a&&n.push(o),!Qi(o)||ea(o))return o;let s=$i(o);return r.set(s,o),n.push(s),s},t?.space)??`null`}function Qi(e){for(let t of Object.getOwnPropertyNames(e))if(Object.getOwnPropertyDescriptor(e,t)?.get!==void 0)return!0;return!1}function $i(e){let t=Array.isArray(e)?[]:{},n=Array.isArray(e)?Array.from({length:e.length},(e,t)=>String(t)):Object.keys(e);for(let r of n)Object.defineProperty(t,r,{enumerable:!0,get:()=>{let t=Reflect.get(e,r);return Object.getOwnPropertyDescriptor(e,r)?.get===void 0?t:zi(t)}});return t}function ea(e){for(let t of[Number.prototype.valueOf,Boolean.prototype.valueOf,String.prototype.valueOf])try{return Reflect.apply(t,e,[]),!0}catch{}return!1}var ta=Symbol.for(`nodejs.util.inspect.custom`),na=e=>{try{return e=zi(e),O(e,`toJSON`)&&Mr(e.toJSON)&&e.toJSON.length===0?e.toJSON():Array.isArray(e)?e.map(na):e}catch{return`[toJSON threw]`}},ra=(e,t=2)=>{if(typeof e==`string`)return e;try{return typeof e==`object`?Zi(e,{space:t}):Wi(e,{space:t})}catch{return String(e)}},ia={toJSON(){return na(this)},[ta](){return this.toJSON()},toString(){return Wi(this.toJSON())}},aa=class{[ta](){return this.toJSON()}toString(){return Wi(this.toJSON())}},oa=(()=>{let e=Object.getOwnPropertyDescriptor(Error,`stackTraceLimit`);return e===void 0?Object.isExtensible(Error):Object.hasOwn(e,`writable`)?e.writable===!0:e.set!==void 0})(),sa=()=>Error.stackTraceLimit,ca=e=>{oa&&(Error.stackTraceLimit=e)},la=class{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})}},ua=(()=>{let e=`~effect/Utils/internal`,t={[e]:e=>e()},n={[e]:e=>{try{return e()}finally{}}},r=sa();if(r===0)return n[e];ca(2);let i=t[e](()=>Error());return ca(r),i.stack?.includes(e)===!0?t[e]:n[e]})(),da=`~effect/Effect`,fa=`~effect/Exit`,pa={_A:D,_E:D,_R:D},ma=`${da}/identifier`,A=`${da}/args`,ha=`${da}/evaluate`,ga=`${da}/successCont`,_a=`${da}/failureCont`,va=`${da}/ensureCont`,ya=Symbol.for(`effect/Effect/Yield`),ba={pipe(){return T(this,arguments)},toJSON(){return{...this}},toString(){return Wi(this.toJSON(),{ignoreToString:!0,space:2})},[ta](){return this.toJSON()}},xa={[da]:pa,...ba,[Symbol.iterator](){return new la(this)},toJSON(){return{_id:`Effect`,op:this[ma],...`~effect/Effect/args`in this?{args:this[A]}:void 0}}},Sa=e=>O(e,da),Ca=e=>O(e,fa),wa=`~effect/Cause`,Ta=`~effect/Cause/Reason`,Ea=e=>O(e,wa),Da=e=>O(e,Ta),Oa=class{constructor(e){this[wa]=wa,this.reasons=e}pipe(){return T(this,arguments)}toJSON(){return{_id:`Cause`,reasons:this.reasons.map(e=>e.toJSON())}}toString(){return`Cause(${Wi(this.reasons)})`}[ta](){return this.toJSON()}[ui](e){return Ea(e)&&this.reasons.length===e.reasons.length&&this.reasons.every((t,n)=>di(t,e.reasons[n]))}[Gr](){return ri(this.reasons)}},ka=new WeakMap,Aa=class{[Ta];annotations;_tag;constructor(e,t,n){if(this[Ta]=Ta,this._tag=e,t!==ja&&typeof n==`object`&&n&&t.size>0){let e=ka.get(n);e&&(t=new Map([...e,...t])),ka.set(n,t)}this.annotations=t}annotate(e,t){if(e.mapUnsafe.size===0)return this;let n=new Map(this.annotations);if(e.mapUnsafe.forEach((e,r)=>{t?.overwrite!==!0&&n.has(r)||n.set(r,e)}),t?.overwrite!==!0&&n.size===this.annotations.size)return this;let r=Object.assign(Object.create(Object.getPrototypeOf(this)),this);return r.annotations=n,r}pipe(){return T(this,arguments)}toString(){return Wi(this)}[ta](){return this.toString()}},ja=new Map,Ma=class extends Aa{constructor(e,t=ja){super(`Fail`,t,e),this.error=e}toString(){return`Fail(${Wi(this.error)})`}toJSON(){return{_tag:`Fail`,error:this.error}}[ui](e){return Ha(e)&&di(this.error,e.error)&&di(this.annotations,e.annotations)}[Gr](){return Jr($r(this._tag))(Jr(k(this.error))(k(this.annotations)))}},Na=e=>new Oa(e),Pa=(e,t)=>{let n=new Map,r=[];for(let i of e.concat(t)){let e=k(i),t=n.get(e);if(t===void 0)n.set(e,[i]);else if(t.some(e=>di(e,i)))continue;else t.push(i);r.push(i)}return r},Fa=E(2,(e,t)=>{if(e.reasons.length===0)return t;if(t.reasons.length===0)return e;let n=new Oa(Pa(e.reasons,t.reasons));return di(e,n)?e:n}),Ia=(e,t)=>{let n=e.reasons.slice();for(let e of t.reasons)Wa(e)&&!n.some(t=>Wa(t)&&t.fiberId===e.fiberId&&t.annotations===e.annotations)&&n.push(e);return n.length===e.reasons.length?e:new Oa(n)},La=new Oa([]),Ra=e=>new Oa([new Ma(e)]),za=class extends Aa{constructor(e,t=ja){super(`Die`,t,e),this.defect=e}toString(){return`Die(${Wi(this.defect)})`}toJSON(){return{_tag:`Die`,defect:this.defect}}[ui](e){return Ua(e)&&di(this.defect,e.defect)&&di(this.annotations,e.annotations)}[Gr](){return Jr($r(this._tag))(Jr(k(this.defect))(k(this.annotations)))}},Ba=e=>new Oa([new za(e)]),Va=E(e=>Ea(e[0]),(e,t,n)=>t.mapUnsafe.size===0?e:new Oa(e.reasons.map(e=>e.annotate(t,n)))),Ha=e=>e._tag===`Fail`,Ua=e=>e._tag===`Die`,Wa=e=>e._tag===`Interrupt`;function Ga(e){return eo(`Effect.evaluate: Not implemented`)}var Ka=e=>({...xa,[ma]:e.op,[ha]:e[`~effect/Effect/evaluate`]??Ga,[ga]:e[ga],[_a]:e[_a],[va]:e[va]}),qa=e=>{let t=Ka(e),n=function(e){this[A]=e};return n.prototype=t,function(e){return new n(e)}},Ja=e=>{let t={[fa]:fa,_tag:e.op,get[e.prop](){return this[A]},...Ka(e),toString(){return`${e.op}(${Wi(this[A])})`},toJSON(){return{_id:`Exit`,_tag:e.op,[e.prop]:this[A]}},[ui](e){return Ca(e)&&e._tag===this._tag&&di(this[`~effect/Effect/args`],e[`~effect/Effect/args`])},[Gr](){return Jr($r(e.op),k(this[A]))}},n=function(e){this[A]=e};return n.prototype=t,function(e){return new n(e)}},Ya=Ja({op:`Success`,prop:`value`,[ha](e){let t=e.getCont(ga);return t?t[ga](this[A],e,this):e.yieldWith(this)}}),Xa={key:`effect/Cause/StackTrace`},Za={key:`effect/Cause/InterruptorStackTrace`},Qa=Ja({op:`Failure`,prop:`cause`,[ha](e){let t=this[A],n=!1;e.cache.stackFrame&&(t=Va(t,{mapUnsafe:new Map([[Xa.key,e.cache.stackFrame]])}),n=!0);let r=e.getCont(_a),i=e._interruptedCause;if(i&&e.interruptible){let a=!1;for(;r&&e.interruptible;)a||=ma in r,r=e.getCont(_a);a&&(t=Na(t.reasons.filter(e=>e._tag!==`Fail`))),t=Ia(t,i),n=!0}return r?r[_a](t,e,n?void 0:this):e.yieldWith(n?Qa(t):this)}}),$a=e=>Qa(Ra(e)),eo=e=>Qa(Ba(e)),j=qa({op:`WithFiber`,[ha](e){return this[A](e)}}),to=function(){class e extends globalThis.Error{}let t=Ka({op:`YieldableError`,[ha](){return $a(this)}});return delete t.toString,Object.assign(e.prototype,t),e}(),no=function(){let e=Symbol.for(`effect/Data/Error/plainArgs`);return class extends to{constructor(t){super(t?.message,t?.cause?{cause:t.cause}:void 0),t&&(Ii(this,t),Object.defineProperty(this,e,{value:t,enumerable:!1}))}toJSON(){return{...this[e],...this}}}}(),ro=e=>{class t extends no{_tag=e}return t.prototype.name=e,t},io=`~effect/Cause/NoSuchElementError`,ao=class extends ro(`NoSuchElementError`){[io]=io;constructor(e){super({message:e})}},oo=`~effect/Cause/Done`,so=e=>O(e,oo),co={[oo]:oo,_tag:`Done`,value:void 0},lo=e=>e===void 0?co:{[oo]:oo,_tag:`Done`,value:e},uo=$a(co),fo=e=>e===void 0?uo:$a(lo(e)),po=`~effect/Option`,mo={[po]:{_A:e=>e},...ba,[Symbol.iterator](){return new la(this)}},ho=Object.defineProperty(Object.assign(Object.create(mo),{_tag:`Some`,_op:`Some`,[ui](e){return vo(e)&&bo(e)&&di(this.value,e.value)},[Gr](){return Jr(k(this._tag))(k(this.value))},toString(){return`some(${Wi(this.value)})`},toJSON(){return{_id:`Option`,_tag:this._tag,value:na(this.value)}}}),"valueOrUndefined",{get(){return this.value}}),go=k(`None`),_o=Object.assign(Object.create(mo),{_tag:`None`,_op:`None`,valueOrUndefined:void 0,[ui](e){return vo(e)&&yo(e)},[Gr](){return go},toString(){return`none()`},toJSON(){return{_id:`Option`,_tag:this._tag}}}),vo=e=>O(e,po),yo=e=>e._tag===`None`,bo=e=>e._tag===`Some`,xo=Object.create(_o),So=function(e){this.value=e};So.prototype=ho;var Co=e=>new So(e),wo=`~effect/Result`,To={[wo]:{_A:e=>e,_E:e=>e},...ba,[Symbol.iterator](){return new la(this)}},Eo=Object.assign(Object.create(To),{_tag:`Success`,_op:`Success`,[ui](e){return Oo(e)&&Ao(e)&&di(this.success,e.success)},[Gr](){return Jr(k(this._tag))(k(this.success))},toString(){return`success(${Wi(this.success)})`},toJSON(){return{_id:`Result`,_tag:this._tag,value:na(this.success)}}}),Do=Object.assign(Object.create(To),{_tag:`Failure`,_op:`Failure`,[ui](e){return Oo(e)&&ko(e)&&di(this.failure,e.failure)},[Gr](){return Jr(k(this._tag))(k(this.failure))},toString(){return`failure(${Wi(this.failure)})`},toJSON(){return{_id:`Result`,_tag:this._tag,failure:na(this.failure)}}}),Oo=e=>O(e,wo),ko=e=>e._tag===`Failure`,Ao=e=>e._tag===`Success`,jo=function(e){this.failure=e};jo.prototype=Do;var Mo=e=>new jo(e),No=function(e){this.success=e};No.prototype=Eo;var Po=e=>new No(e);function Fo(e){return(t,n)=>t===n?0:e(t,n)}var Io=Fo((e,t)=>e<t?-1:1),Lo=Fo((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);function Ro(e){return Fo((t,n)=>e(n,t))}var zo=E(2,(e,t)=>Fo((n,r)=>e(t(n),t(r)))),Bo=e=>E(2,(t,n)=>e(t,n)===1),Vo=e=>E(2,(t,n)=>t===n||e(t,n)<1?t:n),Ho=e=>E(2,(t,n)=>t===n||e(t,n)>-1?t:n),M=()=>xo,N=Co,Uo=vo,Wo=yo,Go=bo,Ko=E(2,(e,{onNone:t,onSome:n})=>Wo(e)?t():n(e.value)),qo=E(2,(e,t)=>Wo(e)?t():e.value),Jo=E(2,(e,t)=>Wo(e)?t():e),Yo=e=>e==null?M():N(e),Xo=e=>e===void 0?M():N(e),Zo=e=>e===null?M():N(e),Qo=qo(mr),$o=e=>(...t)=>{try{return N(e(...t))}catch{return M()}},es=E(2,(e,t)=>{if(Go(e))return e.value;throw t()}),ts=E(2,(e,t)=>Wo(e)?M():N(t(e.value))),ns=E(2,(e,t)=>Wo(e)?M():t(e.value)),rs=E(2,(e,t)=>Wo(e)?M():Yo(t(e.value))),is=E(2,(e,t)=>Wo(e)?M():t(e.value)?N(e.value):M()),as=E(2,(e,t)=>!Wo(e)&&t(e.value)),os=Po,ss=Mo,cs=e=>{if(Mr(e))try{return os(e())}catch(e){return ss(e)}try{return os(e.try())}catch(t){return ss(e.catch(t))}},ls=Oo,us=ko,ds=Ao,fs=E(2,(e,t)=>us(e)?ss(t(e.failure)):e),ps=E(2,(e,t)=>ds(e)?os(t(e.success)):e),ms=E(2,(e,{onFailure:t,onSuccess:n})=>us(e)?t(e.failure):n(e.success)),hs=Ai,gs=e=>{let t=e[Symbol.iterator]().next();if(t.done)throw Error(`headUnsafe: empty iterable`);return t.value},_s={[Symbol.iterator](){return vs}},vs={next(){return{done:!0,value:void 0}}},ys=()=>_s,bs=E(2,(e,t)=>{let n=[];for(let r of ws(e))n.push(t(r,e[r]));return n}),xs=E(2,(e,t)=>Object.hasOwn(e,t)),Ss=E(2,(e,t)=>Object.hasOwn(e,t)?N(e[t]):M()),Cs=E(2,(e,t)=>{let n={...e};for(let r of ws(e))Fi(n,r,t(e[r],r));return n}),ws=e=>Object.keys(e),Ts=e=>bs(e,(e,t)=>t),Es=e=>E(2,(t,n)=>{for(let r of ws(t))if(!xs(n,r)||!e(t[r],n[r]))return!1;return!0}),Ds=e=>{let t=Es(e);return(e,n)=>t(e,n)&&t(n,e)},Os=globalThis.Array,ks=E(2,(e,t)=>{let n=Pi(e),r=new Os(n);for(let e=0;e<n;e++)r[e]=t(e);return r}),As=(e,t)=>e<=t?ks(t-e+1,t=>e+t):[e],js=e=>Os.isArray(e)?e:Os.from(e),Ms=e=>Os.isArray(e)?e:[e],Ns=E(2,(e,t)=>[...e,t]),Ps=E(2,(e,t)=>js(e).concat(js(t)));Os.isArray;var Fs=e=>e.length===0,Is=Mi,Ls=Mi;function Rs(e){let t=Number(e);return String(t)===e&&Number.isInteger(t)&&t>=0&&t<2**32-1}function zs(e,t){return!Number.isFinite(e)||e<0||e>=t.length}var Bs=E(2,(e,t)=>{let n=Math.floor(t);return zs(n,e)?M():N(e[n])})(0),Vs=e=>e[e.length-1],Hs=(e,t)=>Math.min(Ni(e),t),Us=E(2,(e,t)=>{let n=js(e);return n.slice(Hs(t,n.length),n.length)}),Ws=E(2,(e,t)=>{let n=Os.from(e);return n.sort(t),n}),Gs=(e=>E(2,(t,n)=>{for(let r of t)if(e(n,r))return!0;return!1}))(Ei()),Ks=E(2,(e,t)=>{let n={};for(let r of e){let e=t(r);Object.hasOwn(n,e)?n[e].push(r):Fi(n,e,[r])}return n}),qs=(e,t)=>{let n=k(t),r=e.get(n);if(r===void 0)return e.set(n,[t]),!0;for(let e of r)if(di(e,t))return!1;return r.push(t),!0},Js=()=>[],Ys=e=>[e],Xs=E(2,(e,t)=>e.map(t)),Zs=E(2,(e,t)=>{if(Fs(e))return[];let n=[];for(let r=0;r<e.length;r++){let i=t(e[r],r);for(let e=0;e<i.length;e++)n.push(i[e])}return n}),Qs=E(2,(e,t)=>{let n=js(e),r=[];for(let e=0;e<n.length;e++)t(n[e],e)&&r.push(n[e]);return r}),$s=E(3,(e,t,n)=>js(e).reduce((e,t,r)=>n(e,t,r),t)),ec=E(2,(e,t)=>e.every(t)),tc=E(2,(e,t)=>e.some(t)),nc=ji,rc=e=>{let t=js(e);if(t.length<2)return[...t];let n=new Map,r=[];for(let e of t)qs(n,e)&&r.push(e);return r},ic=E(2,(e,t)=>js(e).join(t)),ac=E(2,(e,t)=>{let n=0,r=js(e);for(let e=0;e<r.length;e++){let i=r[e];t(i,e)&&n++}return n});globalThis.Boolean;var oc=E(2,(e,t)=>e?t.onTrue():t.onFalse()),sc=e=>Ka({op:e.label,[ha]:e.evaluate}),cc=`~effect/Context/Service`,lc=function(){function e(){}let t=e;Object.setPrototypeOf(t,uc);let n=(e,n)=>(t.key=e,n?.defaultValue&&(t[fc]=fc,t.defaultValue=n.defaultValue),n?.make&&(t.make=n.make),n?.fiberCached&&dc.add(e),t);return arguments.length>0?n(arguments[0],arguments[1]):n},uc={[cc]:cc,...sc({label:`Service`,evaluate(e){return Ya(Pc(e.context,this))}}),toJSON(){return{_id:`Service`,key:this.key}},of(e){return e},context(e){return Oc(this,e)},use(e){return j(t=>e(Pc(t.context,this)))},useSync(e){return j(t=>Ya(e(Pc(t.context,this))))}},dc=new Set,fc=`~effect/Context/Reference`,pc=`~effect/Context`,mc=8,hc=(e,t,n,r,i)=>{let a=Object.create(Sc);return a.cacheRoot=e??a,a.base=t,a.overlay=n,a.depth=r,a._flat=void 0,a.baseHits=0,a.maxDepth=i,a},gc=(e,t)=>{t&&(gc(e,t.parent),e.set(t.key,t.value))},_c=e=>{if(e._flat)return e._flat;if(!e.overlay)return e._flat=e.base;let t=new Map(e.base);return gc(t,e.overlay),e._flat=t},vc=(e,t)=>{let n=new Map(e.mapUnsafe);return t(n),hc(void 0,n,void 0,0,e.maxDepth)},yc=Symbol(),bc=(e,t)=>{let n=e;for(let e=n.overlay;e;e=e.parent)if(e.key===t)return e.value;let r=n.base.get(t);return r===void 0&&!n.base.has(t)?yc:(n.overlay&&++n.baseHits>=n.base.size&&n.baseHits>=mc&&(n.base=_c(n),n.overlay=void 0,n.depth=0),r)},xc=(e,t)=>{let n=t?.maxDepth;return hc(void 0,e,void 0,0,Number.isInteger(n)&&n>=0?n:8)},Sc={get mapUnsafe(){return _c(this)},...ba,[pc]:{_Services:e=>e},toJSON(){return{_id:`Context`,services:Array.from(this.mapUnsafe).map(([e,t])=>({key:e,value:t}))}},[ui](e){if(!wc(e))return!1;let t=this.mapUnsafe,n=e.mapUnsafe;if(t.size!==n.size)return!1;for(let[e,r]of t)if(!n.has(e)||!di(r,n.get(e)))return!1;return!0},[Gr](){return Qr(this.mapUnsafe.size)}},Cc=(e,t)=>e.cacheRoot===t.cacheRoot,wc=e=>O(e,pc),Tc=e=>!!e[fc],Ec=()=>Dc,Dc=xc(new Map),Oc=(e,t)=>xc(new Map([[e.key,t]])),kc=E(3,(e,t,n)=>Ac(e,t.key,n)),Ac=(e,t,n)=>{let r=e,i=dc.has(t)?void 0:r.cacheRoot;if(r.depth>=r.maxDepth){let e=new Map(r._flat??r.base);return r._flat||gc(e,r.overlay),e.set(t,n),hc(i,e,void 0,0,r.maxDepth)}return hc(i,r.base,{key:t,value:n,parent:r.overlay},r.depth+1,r.maxDepth)},jc=E(2,(e,t)=>Mc(e,t.key)),Mc=(e,t)=>{let n=bc(e,t);return n===yc?void 0:n},Nc=E(2,(e,t)=>{let n=bc(e,t.key);if(n===yc){if(Tc(t))return Ic(t);throw Lc(t)}return n}),Pc=Nc,Fc=`~effect/Context/defaultValue`,Ic=e=>Fc in e?e[Fc]:e[Fc]=e.defaultValue(),Lc=e=>{let t=Error(`Service not found${e.key?`: ${String(e.key)}`:``}`);if(t.stack){let e=t.stack.split(`
|
|
5
|
+
`);e.splice(1,3),t.stack=e.join(`
|
|
6
|
+
`)}return t},Rc=E(2,(e,t)=>{let n=bc(e,t.key);return n===yc?Tc(t)?N(Ic(t)):M():N(n)}),zc=E(2,(e,t)=>e.mapUnsafe.size===0?t:t.mapUnsafe.size===0?e:vc(e,e=>t.mapUnsafe.forEach((t,n)=>e.set(n,t)))),Bc=(...e)=>{let t=new Map;for(let n=0;n<e.length;n++)e[n].mapUnsafe.forEach((e,n)=>{t.set(n,e)});return xc(t)},Vc=(...e)=>t=>vc(t,t=>{for(let n=0;n<e.length;n++)t.delete(e[n].key)}),P=lc,Hc=`~effect/Duration`,Uc=BigInt(0),Wc=BigInt(1),Gc=BigInt(2),Kc=BigInt(10),qc=BigInt(24),Jc=BigInt(60),Yc=BigInt(1e3),Xc=BigInt(1e6),Zc=BigInt(1e9),Qc=BigInt(6e10),$c=BigInt(36e11),el=BigInt(864e11),tl=BigInt(6048e11),nl=e=>BigInt(Math.sign(e)*Math.round(Math.abs(e))),rl=e=>Number.isInteger(e)?BigInt(e)*Xc:nl(e*1e6),il=e=>vl(Number.isFinite(e)?nl(e):e),al=(e,t)=>{let n=Number(e);if(Number.isFinite(n))return n/t;let r=BigInt(t);return Number(e/r)+Number(e%r)/t},ol=(e,t)=>{let n=e.indexOf(`.`);if(n===-1)return BigInt(e)*t;let r=e[0]===`-`,i=e.slice(n+1),a=Kc**BigInt(i.length),o=(BigInt(e.slice(+!!r,n))*a+BigInt(i))*t;return sl(r?-o:o,a)},sl=(e,t)=>{let n=e<Uc?-e:e,r=n/t+(n%t*Gc>=t?Wc:Uc);return e<Uc?-r:r},cl=(e,t)=>{let n=Number(e)*t;if(!Number.isFinite(n))return vl(n);let r=ol(e,BigInt(t)*Xc);return vl(Number.isInteger(n)&&BigInt(n)*Xc===r?n:r)},ll=/^(-?\d+(?:\.\d+)?)\s+(nanos?|micros?|millis?|seconds?|minutes?|hours?|days?|weeks?)$/,ul=e=>{switch(typeof e){case`number`:return Ol(e);case`bigint`:return Dl(e);case`string`:{if(e===`Infinity`)return Tl;if(e===`-Infinity`)return El;let t=ll.exec(e);if(!t)break;let[n,r,i]=t;if(i===`nano`||i===`nanos`)return Dl(ol(r,Wc));if(i===`micro`||i===`micros`)return Dl(ol(r,Yc));switch(i){case`milli`:case`millis`:return cl(r,1);case`second`:case`seconds`:return cl(r,1e3);case`minute`:case`minutes`:return cl(r,6e4);case`hour`:case`hours`:return cl(r,36e5);case`day`:case`days`:return cl(r,864e5);case`week`:case`weeks`:return cl(r,6048e5)}break}case`object`:{if(e===null)break;if(Hc in e)return e;if(Array.isArray(e)){if(e.length!==2||!e.every(Or))return pl(e);if(Number.isNaN(e[0])||Number.isNaN(e[1]))return wl;if(e[0]===-1/0||e[1]===-1/0)return El;if(e[0]===1/0||e[1]===1/0)return Tl;let t=e[0]*1e9+e[1];return Number.isFinite(t)&&Number.isInteger(e[0])&&Number.isInteger(e[1])?vl(BigInt(e[0])*Zc+BigInt(e[1])):il(t)}let t=e,n=0;if(t.weeks&&(n+=t.weeks*6048e5),t.days&&(n+=t.days*864e5),t.hours&&(n+=t.hours*36e5),t.minutes&&(n+=t.minutes*6e4),t.seconds&&(n+=t.seconds*1e3),t.milliseconds&&(n+=t.milliseconds),!t.microseconds&&!t.nanoseconds){if(!Number.isFinite(n))return vl(n);let e=fl(t);return e===void 0||BigInt(n)*Xc===e?vl(n):vl(e)}let r=n*1e6+(t.microseconds??0)*1e3+(t.nanoseconds??0),i=Number.isFinite(r)?fl(t):void 0;return i===void 0?il(r):vl(i)}}return pl(e)},dl=e=>!e||Number.isInteger(e),fl=e=>{if(!dl(e.weeks)||!dl(e.days)||!dl(e.hours)||!dl(e.minutes)||!dl(e.seconds)||!dl(e.milliseconds)||!dl(e.microseconds)||!dl(e.nanoseconds))return;let t=Uc;return e.weeks&&(t+=BigInt(e.weeks)*tl),e.days&&(t+=BigInt(e.days)*el),e.hours&&(t+=BigInt(e.hours)*$c),e.minutes&&(t+=BigInt(e.minutes)*Qc),e.seconds&&(t+=BigInt(e.seconds)*Zc),e.milliseconds&&(t+=BigInt(e.milliseconds)*Xc),e.microseconds&&(t+=BigInt(e.microseconds)*Yc),e.nanoseconds&&(t+=BigInt(e.nanoseconds)),t},pl=e=>{throw Error(`Invalid Input: ${e}`)},ml={_tag:`Millis`,millis:0},hl={_tag:`Infinity`},gl={_tag:`NegativeInfinity`},_l={[Hc]:Hc,[Gr](){switch(this.value._tag){case`Millis`:return k(rl(this.value.millis));case`Nanos`:return k(this.value.nanos);default:return ti(this.value)}},[ui](e){return yl(e)&&Bl(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`}}},[ta](){return this.toJSON()},pipe(){return T(this,arguments)}},vl=e=>{let t=Object.create(_l);return t.value=typeof e==`number`?isNaN(e)||e===0||Object.is(e,-0)?ml:Number.isFinite(e)?Number.isInteger(e)?{_tag:`Millis`,millis:e}:{_tag:`Nanos`,nanos:rl(e)}:e>0?hl:gl:e===Uc?ml:{_tag:`Nanos`,nanos:e},t},yl=e=>O(e,Hc),bl=e=>e.value._tag!==`Infinity`&&e.value._tag!==`NegativeInfinity`,xl=e=>{switch(e.value._tag){case`Millis`:return e.value.millis===0;case`Nanos`:return e.value.nanos===Uc;case`Infinity`:case`NegativeInfinity`:return!1}},Sl=e=>{switch(e.value._tag){case`Millis`:return e.value.millis<0;case`Nanos`:return e.value.nanos<Uc;case`NegativeInfinity`:return!0;case`Infinity`:return!1}},Cl=e=>{switch(e.value._tag){case`Infinity`:case`NegativeInfinity`:return Tl;case`Millis`:return e.value.millis<0?vl(-e.value.millis):e;case`Nanos`:return e.value.nanos<Uc?vl(-e.value.nanos):e}},wl=vl(0),Tl=vl(1/0),El=vl(-1/0),Dl=e=>vl(e),Ol=e=>vl(e),kl=e=>vl(e*1e3),Al=e=>Nl(ul(e),{onMillis:D,onNanos:e=>al(e,1e6),onInfinity:()=>1/0,onNegativeInfinity:()=>-1/0}),jl=e=>Nl(ul(e),{onMillis:e=>e/6e4,onNanos:e=>al(e,6e10),onInfinity:()=>1/0,onNegativeInfinity:()=>-1/0}),Ml=e=>{let t=ul(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 rl(t.value.millis)}},Nl=E(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)()}}),Pl=E(3,(e,t,n)=>e.value._tag===`Infinity`||e.value._tag===`NegativeInfinity`||t.value._tag===`Infinity`||t.value._tag===`NegativeInfinity`?n.onInfinity(e,t):e.value._tag===`Millis`?t.value._tag===`Millis`?n.onMillis(e.value.millis,t.value.millis):n.onNanos(Ml(e),t.value.nanos):n.onNanos(e.value.nanos,Ml(t))),Fl=Fo((e,t)=>Pl(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:e.value._tag===`Infinity`?1:e.value._tag===`NegativeInfinity`||t.value._tag===`Infinity`?-1:1})),Il=(e,t)=>Pl(e,t,{onMillis:(e,t)=>e===t,onNanos:(e,t)=>e===t,onInfinity:(e,t)=>e.value._tag===t.value._tag}),Ll=Vo(Fl),Rl=Ho(Fl),zl=E(2,(e,t)=>Pl(e,t,{onMillis:(e,t)=>vl(e+t),onNanos:(e,t)=>vl(e+t),onInfinity:(e,t)=>{let n=e.value._tag,r=t.value._tag;return n===`Infinity`&&r===`NegativeInfinity`||n===`NegativeInfinity`&&r===`Infinity`?wl:n===`Infinity`||r===`Infinity`?Tl:n===`NegativeInfinity`||r===`NegativeInfinity`?El:wl}})),Bl=E(2,(e,t)=>Il(e,t)),Vl=e=>{if(e.value._tag===`Infinity`)return{days:1/0,hours:1/0,minutes:1/0,seconds:1/0,millis:1/0,nanos:1/0};if(e.value._tag===`NegativeInfinity`)return{days:-1/0,hours:-1/0,minutes:-1/0,seconds:-1/0,millis:-1/0,nanos:-1/0};let t=Ml(e),n=t<Uc,r=n?-t:t,i=r/Xc,a=i/Yc,o=a/Jc,s=o/Jc,c=s/qc,l=n?-1:1;return{days:l*Number(c),hours:l*Number(s%qc),minutes:l*Number(o%Jc),seconds:l*Number(a%Jc),millis:l*Number(i%Yc),nanos:l*Number(r%Xc)}},Hl=e=>{if(e.value._tag===`Infinity`)return`Infinity`;if(e.value._tag===`NegativeInfinity`)return`-Infinity`;if(xl(e))return`0`;if(Sl(e))return`-`+Hl(Cl(e));let t=Vl(e),n=[];return t.days!==0&&n.push(`${t.days}d`),t.hours!==0&&n.push(`${t.hours}h`),t.minutes!==0&&n.push(`${t.minutes}m`),t.seconds!==0&&n.push(`${t.seconds}s`),t.millis!==0&&n.push(`${t.millis}ms`),t.nanos!==0&&n.push(`${t.nanos}ns`),n.join(` `)},Ul=e=>t=>!us(e(t)),Wl=e=>t=>t.has(e)?os(t):ss(t),Gl=E(2,(e,t)=>n=>{let r=e(n);return us(r)?r:t(r.success)}),Kl=e=>t=>{let n=e(t);return us(n)?M():N(n.success)},ql=P(`effect/Scheduler`,{fiberCached:!0,defaultValue:()=>new Ql}),Jl=e=>{let t=!1;return Promise.resolve().then(()=>{t||e()}),()=>{t=!0}},Yl=`setImmediate`in globalThis?e=>{let t=globalThis.setImmediate(e);return()=>globalThis.clearImmediate(t)}:e=>{let t=setTimeout(e,0);return()=>clearTimeout(t)},Xl=e=>{try{return Yl(e)}catch{return Jl(e)}},Zl=class{buckets=[];scheduleTask(e,t){let n=this.buckets,r=n.length,i,a=0;for(;a<r&&!(n[a][0]>t);a++)i=n[a];i&&i[0]===t?i[1].push(e):a===r?n.push([t,[e]]):n.splice(a,0,[t,[e]])}drain(){let e=this.buckets;return this.buckets=[],e}},Ql=class{executionMode;setImmediate;constructor(e=`async`,t){this.executionMode=e,this.setImmediate=t??(e===`sync`?Jl:Xl)}shouldYield(e){return e.currentOpCount>=e.cache.maxOpsBeforeYield}makeDispatcher(){return new $l(this.setImmediate)}},$l=class{tasks=new Zl;running=void 0;setImmediate;constructor(e=Xl){this.setImmediate=e}scheduleTask(e,t){this.tasks.scheduleTask(e,t),this.running===void 0&&(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 n=e[t][1];for(let e=0;e<n.length;e++)n[e]()}}flush(){for(;this.tasks.buckets.length>0;)this.running!==void 0&&(this.running(),this.running=void 0),this.runTasks()}},eu=P(`effect/Scheduler/MaxOpsBeforeYield`,{fiberCached:!0,defaultValue:()=>2048}),tu=P(`effect/Scheduler/PreventSchedulerYield`,{fiberCached:!0,defaultValue:()=>!1}),nu=class extends ur{constructor(e){super(),e&&Ii(this,e)}},ru=no,iu=ro,au=`~effect/encoding/EncodingError`,ou=class extends iu(`EncodingError`){[au]=au},su=e=>{switch(e){case 16:return uu();case 32:return du();default:{let t=``;for(let n=e>>>3;n>0;n--)t+=lu();return t}}},F=Uint8Array.from(`0123456789abcdef`,e=>e.charCodeAt(0)),cu=()=>Math.random()*4294967296>>>0,lu=()=>{let e=cu();return String.fromCharCode(F[e>>>28],F[e>>>24&15],F[e>>>20&15],F[e>>>16&15],F[e>>>12&15],F[e>>>8&15],F[e>>>4&15],F[e&15])},uu=()=>{let e=cu(),t=cu();return String.fromCharCode(F[e>>>28],F[e>>>24&15],F[e>>>20&15],F[e>>>16&15],F[e>>>12&15],F[e>>>8&15],F[e>>>4&15],F[e&15],F[t>>>28],F[t>>>24&15],F[t>>>20&15],F[t>>>16&15],F[t>>>12&15],F[t>>>8&15],F[t>>>4&15],F[t&15])},du=()=>{let e=cu(),t=cu(),n=cu(),r=cu();return String.fromCharCode(F[e>>>28],F[e>>>24&15],F[e>>>20&15],F[e>>>16&15],F[e>>>12&15],F[e>>>8&15],F[e>>>4&15],F[e&15],F[t>>>28],F[t>>>24&15],F[t>>>20&15],F[t>>>16&15],F[t>>>12&15],F[t>>>8&15],F[t>>>4&15],F[t&15],F[n>>>28],F[n>>>24&15],F[n>>>20&15],F[n>>>16&15],F[n>>>12&15],F[n>>>8&15],F[n>>>4&15],F[n&15],F[r>>>28],F[r>>>24&15],F[r>>>20&15],F[r>>>16&15],F[r>>>12&15],F[r>>>8&15],F[r>>>4&15],F[r&15])},fu=`effect/Tracer/ParentSpan`,pu=class extends lc()(fu,{fiberCached:!0}){},mu=e=>e,hu=P(`effect/Tracer/DisablePropagation`,{defaultValue:pr}),gu=P(`effect/Tracer/CurrentTraceLevel`,{defaultValue:()=>`Info`}),_u=P(`effect/Tracer/MinimumTraceLevel`,{defaultValue:()=>`All`}),vu=`effect/Tracer`,yu=P(vu,{fiberCached:!0,defaultValue:()=>bu}),bu=mu({span:e=>new xu(e)}),xu=class{_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??=Qo(this.parent)?.traceId??su(32)}get spanId(){return this._spanId??=su(16)}get attributes(){return this._attributes??=new Map}get events(){return this._events??=[]}end(e,t){this.status._tag!==`Ended`&&(this.status={_tag:`Ended`,endTime:e,exit:t,startTime:this.status.startTime})}attribute(e,t){this.status._tag!==`Ended`&&this.attributes.set(e,t)}event(e,t,n){this.status._tag!==`Ended`&&this.events.push([e,t,n??{}])}addLinks(e){this.status._tag!==`Ended`&&this.links.push(...e)}},Su=`effect/Metric/FiberRuntimeMetrics`,Cu=P(`effect/References/CurrentStackFrame`,{fiberCached:!0,defaultValue:mr}),wu=P(`effect/References/TracerEnabled`,{fiberCached:!0,defaultValue:fr}),Tu=P(`effect/References/TracerTimingEnabled`,{defaultValue:fr}),Eu=P(`effect/References/TracerSpanAnnotations`,{defaultValue:()=>({})}),Du=P(`effect/References/TracerSpanLinks`,{defaultValue:()=>[]}),Ou=P(`effect/References/CurrentLogAnnotations`,{defaultValue:()=>({})}),ku=P(`effect/References/CurrentLogLevel`,{fiberCached:!0,defaultValue:()=>`Info`}),Au=P(`effect/References/MinimumLogLevel`,{fiberCached:!0,defaultValue:()=>`Info`}),ju=P(`effect/References/UnhandledLogLevel`,{defaultValue:()=>`Error`}),Mu=P(`effect/References/CurrentLogSpans`,{defaultValue:()=>[]}),Nu=e=>{if(e?.captureStackTrace===!1||e?.captureStackTrace!==void 0&&typeof e.captureStackTrace!=`boolean`)return e;let t=sa();if(t===0&&e?.captureStackTrace!==!0)return{...e,captureStackTrace:!1};ca(3);let n=Error();return ca(t),{...e,captureStackTrace:Pu(()=>n.stack)}},Pu=(e=>t=>{let n;return()=>{if(n!==void 0)return n;let r=t();if(!r)return;let i=r.split(`
|
|
7
|
+
`);if(i[e]!==void 0)return n=i[e].trim(),n}})(3),Fu=class extends Aa{constructor(e,t=ja){super(`Interrupt`,t,`Interrupted`),this.fiberId=e}toString(){return`Interrupt(${this.fiberId})`}toJSON(){return{_tag:`Interrupt`,fiberId:this.fiberId}}[ui](e){return Wa(e)&&this.fiberId===e.fiberId&&this.annotations===e.annotations}[Gr](){return $r(`${this._tag}:${this.fiberId}`)}},Iu=e=>new Fu(e),Lu=e=>new Oa([new Fu(e)]),Ru=e=>e.reasons.some(Ha),zu=e=>{for(let t=0;t<e.reasons.length;t++){let n=e.reasons[t];if(n._tag===`Fail`)return os(n.error)}return ss(e)},Bu=Kl(zu),Vu=e=>e.reasons.some(Ua),Hu=e=>Vu(e)&&Ru(e)?Na(e.reasons.map(e=>e._tag===`Fail`&&!so(e.error)?new za(e.error,e.annotations):e)):e,Uu=e=>Vu(e)?ss(Hu(e)):zu(e),Wu=e=>e.reasons.some(Wa),Gu=e=>{let t;for(let n=0;n<e.reasons.length;n++){let r=e.reasons[n];r._tag===`Interrupt`&&(t??=new Set,r.fiberId!==void 0&&t.add(r.fiberId))}return t?os(t):ss(e)},Ku=e=>{let t=Gu(e);return us(t)?qu:t.success},qu=new Set,Ju=e=>e.reasons.length>0&&e.reasons.every(Wa),Yu=e=>xc(e.annotations),Xu=E(2,(e,t)=>{let n=!1,r=e.reasons.map(e=>Ha(e)?(n=!0,new Ma(t(e.error),e.annotations)):e);return n?Na(r):e}),Zu=e=>{let t;for(let n of e.reasons){if(n._tag===`Fail`)return n.error;n._tag===`Die`&&(t??=n)}return t===void 0?e.reasons.length>0?new globalThis.Error(`All fibers interrupted without error`):new globalThis.Error(`Empty cause`):t.defect},Qu=(e,t)=>{let n=[],r=[];if(e.reasons.length===0)return n;let i=sa();i!==0&&ca(1);try{for(let i of e.reasons)i._tag===`Interrupt`?r.push(i):n.push($u(i._tag===`Die`?i.defect:i.error,i.annotations,t));if(n.length===0){let e=Error(`The fiber was interrupted by:`);e.name=`InterruptCause`,e.stack=id(e,r);let i=new globalThis.Error(`All fibers interrupted without error`,{cause:e});i.name=`InterruptError`,i.stack=`${i.name}: ${i.message}`,n.push($u(i,r[0].annotations,t))}}finally{i!==0&&ca(i)}return n},$u=(e,t,n,r=new Set)=>{let i=typeof e,a;if(e&&i===`object`){r.add(e);let i=e.cause;if(a=new globalThis.Error(ed(e),{cause:i!==void 0&&!r.has(i)?$u(i,void 0,void 0,r):void 0}),typeof e.name==`string`&&(a.name=e.name),typeof e.stack==`string`)a.stack=nd(e.stack,a,t);else{let e=`${a.name}: ${a.message}`;a.stack=t?rd(e,t):e}n?.includeCauseInStack&&(a.stack=sd(a));for(let t of Object.keys(e))t in a||(a[t]=e[t])}else{a=new globalThis.Error(e?i===`string`?e:Zi(e):`Unknown error: ${e}`);let n=`${a.name}: ${a.message}`;a.stack=t?rd(n,t):n}return a},ed=e=>{if(typeof e.message==`string`)return e.message;if(typeof e.toString==`function`&&e.toString!==Object.prototype.toString&&e.toString!==Array.prototype.toString)try{return e.toString()}catch{}return Zi(e)},td=/\((.*)\)/g,nd=(e,t,n)=>{let r=`${t.name}: ${t.message}`,i=(e.startsWith(r)?e.slice(r.length):e).split(`
|
|
8
|
+
`),a=[r];for(let e=1;e<i.length&&!/Generator\.next|~effect\/(?:Effect|Utils)/.test(i[e]);e++)a.push(i[e]);return n?rd(a.join(`
|
|
9
|
+
`),n):a.join(`
|
|
10
|
+
`)},rd=(e,t)=>{let n=t?.get(Xa.key);return n&&(e=`${e}\n${ad(n)}`),e},id=(e,t)=>{let n=[`${e.name}: ${e.message}`];for(let e of t){let t=e.fiberId===void 0?`unknown`:`#${e.fiberId}`,r=e.annotations.get(Za.key);n.push(` at fiber (${t})`),r&&n.push(ad(r))}return n.join(`
|
|
11
|
+
`)},ad=e=>{let t=[],n=e,r=0;for(;n&&r<10;){let e=n.stack();if(e){let r=e.matchAll(td),i=!1;for(let[,e]of r)i=!0,t.push(` at ${n.name} (${e})`);i||t.push(` at ${n.name} (${e.replace(/^at /,``)})`)}else t.push(` at ${n.name}`);n=n.parent,r++}return t.join(`
|
|
12
|
+
`)},od=e=>Qu(e).map(sd).join(`
|
|
13
|
+
`),sd=e=>e.cause?`${e.stack} {\n${cd(e.cause,` `)}\n}`:e.stack,cd=(e,t)=>{let n=e.stack.split(`
|
|
14
|
+
`),r=`${t}[cause]: ${n[0]}`;for(let e=1,i=n.length;e<i;e++)r+=`\n${t}${n[e]}`;return e.cause&&(r+=` {\n${cd(e.cause,`${t} `)}\n${t}}`),r},ld=`~effect/Fiber`,ud={_A:D,_E:D},dd={id:0},fd=(()=>{try{return globalThis.process?.getBuiltinModule?.(`node:async_hooks`)?.AsyncResource}catch{return}})(),pd=()=>fd===void 0?void 0:new fd(`effect/Fiber`),md=()=>globalThis[Vi],hd=class{constructor(e,t=!0){this.setContext(e),this.id=++dd.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[ld](){return ud}get currentDispatcher(){return this._dispatcher??=this.cache.scheduler.makeDispatcher()}getRef(e){return Pc(this.context,e)}addObserver(e){return this._exit?(e(this._exit),hr):(this._observers===void 0?this._observers=[e]:this._observers.push(e),()=>this.removeObserver(e))}removeObserver(e){if(this._exit||this._observers===void 0)return;let t=this._observers.indexOf(e);t>=0&&this._observers.splice(t,1)}interruptUnsafe(e,t){if(this._exit)return;let n=Lu(e);this.cache.stackFrame&&(n=Va(n,Oc(Xa,this.cache.stackFrame))),t&&(n=Va(n,t)),this._interruptedCause=this._interruptedCause?Ia(this._interruptedCause,n):n,this.interruptible&&(this._running?this._deferredInterrupt=!0:this.evaluate(kd(this._interruptedCause)))}pollUnsafe(){return this._exit}evaluate(e){if(this._exit)return;if(this._asyncContext!==void 0){let t=this._asyncContext;this._asyncContext=void 0;try{return t.runInAsyncScope(this.evaluate,this,e)}finally{t.emitDestroy()}}else if(this._yielded!==void 0){let e=this._yielded;this._yielded=void 0,e()}let t=this.runLoop(e);if(t===ya){this._asyncContext=pd();return}let n=yd.interruptChildren&&yd.interruptChildren(this);if(n!==void 0)return this.evaluate(L(n,()=>t));if(this._exit=t,this.cache.runtimeMetrics?.recordFiberEnd(this.context,this._exit),this._parent&&=(this._parent._children?.delete(this),void 0),this._observers!==void 0){let e=this._observers;this._observers=void 0;for(let n=0;n<e.length;n++)e[n](t)}this._stack.length=0,this._children=void 0,this.context=Ec();let r=this.cache;(r.span!==void 0||r.stackFrame!==void 0)&&(this.cache={...r,span:void 0,stackFrame:void 0})}runLoop(e){let t=globalThis[Vi];globalThis[Vi]=this;let n=this._running;this._running=!0;let r=!1,i=e;this.currentOpCount=0;try{for(;;)try{this._deferredInterrupt&&(this._deferredInterrupt=!1,i=kd(this._interruptedCause)),this.currentOpCount++;let e=this.cache;if(!r&&!e.preventYield&&e.scheduler.shouldYield(this)){r=!0;let e=i;i=L(Pd,()=>e)}if(i=e.tracerContext?e.tracerContext(i,this):i[ha](this),i===ya){let e=this._yielded;if(`~effect/Exit`in e)return this._deferredInterrupt=!1,this._yielded=void 0,e;if(this._deferredInterrupt){this._yielded=void 0,e();continue}return ya}}catch(e){if(!O(i,`~effect/Effect/evaluate`))return eo(`Fiber.runLoop: Not a valid effect: ${String(i)}`);i=eo(e)}}finally{this._running=n,globalThis[Vi]=t}}getCont(e){if(this._deferredInterrupt)return this._deferredInterrupt=!1,_d;for(;;){let t=this._stack.pop();if(!t)return;let n=t[va];if(n!==void 0){let r=n.call(t,this);if(r)return r[e]=r,r}if(t[e])return t}}succeedWith(e){if(!(++this.currentOpCount&vd-1))return Ya(e);let t=this.getCont(ga);return t?t[ga](e,this):this.yieldWith(Ya(e))}yieldWith(e){return this._yielded=e,ya}children(){return this._children??=new Set}pipe(){return T(this,arguments)}setContext(e){let t=this.context;if(this.context=e,t!==void 0&&Cc(t,e))return;let n=e.cacheRoot,r=n._fiberCache??=gd(e);this.cache?.scheduler!==r.scheduler&&(this._dispatcher=void 0),this.cache=r}get currentSpanLocal(){let e=this.cache.span;return e?._tag===`Span`?e:void 0}},gd=e=>{let t=Mc(e,vu);return{scheduler:Pc(e,ql),tracer:t,tracerContext:t?t.context:void 0,tracerEnabled:Pc(e,wu),span:Mc(e,fu),logLevel:Pc(e,ku),minimumLogLevel:Pc(e,Au),stackFrame:Pc(e,Cu),runtimeMetrics:Mc(e,Su),maxOpsBeforeYield:Pc(e,eu),preventYield:Pc(e,tu)}},_d={[ga](e,t){return kd(t._interruptedCause)},[_a](e,t){return kd(t._interruptedCause)}},vd=32,yd={interruptChildren:void 0},bd=e=>{if(!e.cache.stackFrame)return;let t=new Map;return t.set(Za.key,e.cache.stackFrame),xc(t)},xd=e=>{if(e._children!==void 0&&e._children.size!==0)return Od(e._children)},Sd=e=>{let t=e;return t._exit?I(t._exit):Wd(n=>t._exit?n(I(t._exit)):jd(e.addObserver(e=>n(I(e)))))},Cd=e=>Wd(t=>{let n=e[Symbol.iterator](),r=[],i;function a(){let e=n.next();for(;!e.done;)if(e.value._exit)r.push(e.value._exit),e=n.next();else{i=e.value.addObserver(e=>{r.push(e),a()});return}t(I(r))}return a(),jd(()=>i?.())}),wd=e=>{let t=e;return t._exit?t._exit:Wd(n=>t._exit?n(t._exit):jd(e.addObserver(n)))},Td=e=>Wd(t=>{let n=Array.from(e);if(n.length===0)return t(I(Js()));let r=Array(n.length),i=Js(),a=()=>{for(let e=0;e<i.length;e++)n[e].removeObserver(i[e])},o=0,s=!1;for(let e=0;e<n.length&&!s;e++){let c=i=>{if(o++,i._tag===`Failure`)return s=!0,a(),t(i);r[e]=i.value,o===n.length&&t(I(r))};i.push(c),n[e].addObserver(c)}return jd(()=>{s=!0,a()})}),Ed=e=>j(t=>Dd(e,t.id)),Dd=E(e=>O(e[0],ld),(e,t,n)=>j(r=>{let i=bd(r);return i=i&&n?zc(i,n):i??n,e.interruptUnsafe(t,i),mf(Sd(e))})),Od=e=>j(t=>{let n=bd(t),r=Js();for(let i of e)i.interruptUnsafe(t.id,n),r.push(i);return mf(Cd(r))}),I=Ya,kd=Qa,Ad=$a,jd=qa({op:`Sync`,[ha](e){let t=this[A],n=t(),r=e.getCont(ga);return r?r[ga](n,e):e.yieldWith(Ya(n))}}),Md=qa({op:`Suspend`,[ha](e){let t=this[A];return t()}}),Nd=ms({onFailure:Ad,onSuccess:I}),Pd=qa({op:`Yield`,[ha](e){let t=!1;return e.currentDispatcher.scheduleTask(()=>{t||e.evaluate(Mf)},this[`~effect/Effect/args`]??0),e.yieldWith(()=>{t=!0})}})(0),Fd=I(M()),Id=e=>Md(()=>kd(e())),Ld=e=>eo(e),Rd=I(void 0),zd=e=>{let t=typeof e==`function`?e:e.try,n=typeof e==`function`?e=>new Eh(e,`An error occurred in Effect.try`):e.catch;return Md(()=>{try{return I(t())}catch(e){return Ad(n(e))}})},Bd=e=>Hd(function(t,n){e(n).then(e=>t(I(e)),e=>t(Ld(e)))},e.length!==0),Vd=e=>{let t=typeof e==`function`?e:e.try,n=typeof e==`function`?e=>new Eh(e,`An error occurred in Effect.tryPromise`):e.catch;return Hd(function(e,r){let i=e=>Md(()=>{try{return Ad(ua(()=>n(e)))}catch(e){return Ld(e)}});try{t(r).then(t=>e(I(t)),t=>e(i(t)))}catch(t){e(i(t))}},t.length!==0)},Hd=function(){let e=Ka({op:`Async`,[ha](e){let t=!1,n=!1,r=this.withSignal?new AbortController:void 0,i=this.register.call(e.cache.scheduler,r=>{t||(t=!0,n?e.evaluate(r):n=r)},r?.signal);return n===!1?(n=!0,e.yieldWith(()=>{t=!0}),r===void 0&&i===void 0||e._stack.push(Ud(()=>(t=!0,r?.abort(),i??Mf))),ya):n}}),t=function(e,t){this.register=e,this.withSignal=t};return t.prototype=e,function(e,n){return new t(e,n)}}(),Ud=qa({op:`AsyncFinalizer`,[va](e){e.interruptible&&(e.interruptible=!1,e._stack.push(dm))},[_a](e,t){return Wu(e)?L(Pp(Qa(e),this[A]()),()=>kd(e)):kd(e)}}),Wd=e=>Hd(e,e.length>=2),Gd=Wd(hr),Kd=(...e)=>{if(e.length===1){let t=e[0];return Md(()=>Qd(t()))}let[t,n]=e;return Md(()=>Qd(n.call(t.self)))},qd=(e,t)=>typeof e==`function`?e:t.shift().bind(e.self),Jd=(e,...t)=>{let n=qd(e,t),r=t.length===0?function(){return Md(()=>Qd(n.apply(this,arguments)))}:function(){let e=Md(()=>Qd(n.apply(this,arguments)));for(let n=0;n<t.length;n++)e=t[n](e,...arguments);return e};return Yd(n.length,r)},Yd=(e,t)=>Object.defineProperty(t,"length",{value:e,configurable:!0}),Xd=(e,...t)=>{let n=qd(e,t);return Yd(n.length,t.length===0?function(){return Zd(()=>n.apply(this,arguments))}:function(){let e=Zd(()=>n.apply(this,arguments));for(let n of t)e=n(e,...arguments);return e})},Zd=e=>{try{let t=e(),n;for(;;){let r=t.next(n);if(r.done)return I(r.value);let i=r.value;if(i&&i._tag===`Success`)n=i.value;else{if(i&&i._tag===`Failure`)return r.value;{let n=!0;return Md(()=>n?(n=!1,L(r.value,e=>Qd(t,e))):Md(()=>Qd(e())))}}}}catch(e){return Ld(e)}},Qd=function(){let e=Ka({op:`Iterator`,[ga](e,t){let n=this.iterator;for(;;){let r=n.next(e);if(r.done)return I(r.value);if(!yf(r.value))return t._stack.push(this),r.value;if(r.value._tag===`Failure`)return r.value;e=r.value.value}},[ha](e){return this[ga](this.initial,e)}}),t=function(e,t){this.iterator=e,this.initial=t};return t.prototype=e,function(e,n){return new t(e,n)}}(),$d=E(2,(e,t)=>new nf(e,rf,I(t))),ef=function(e){return e._stack.push(this),this[A]},tf=Ka({op:`OnSuccess`,[ha]:ef}),nf=function(e,t,n){this[A]=e,this[ga]=t,this.payload=n};nf.prototype=tf;var rf=function(){return this.payload},af=function(e,t){return t.succeedWith(this.payload)},of=(()=>{let e=sa();if(e===0)return!1;let t=`~effect/Effect/stackProbe`,n={[t]:function(){return Error()}};ca(1);let r=n[t]();return ca(e),r.stack?.includes(`[as `+t+`]`)===!0})(),sf=function(e,t){let n=this.payload;return t.succeedWith(of?n(e):ua(()=>n(e)))},cf=function(e){let t=this.payload;return t(e)},lf=function(e){let t=this.payload;return new nf(t(e),af,e)},uf=function(e){return new nf(this.payload,af,e)},df=e=>Sf(e,N),ff=E(2,(e,t)=>new nf(e,Sa(t)?rf:cf,t)),pf=E(2,(e,t)=>new nf(e,Sa(t)?uf:lf,t)),mf=e=>new nf(e,rf,Mf),hf=(e,t)=>j(n=>{let r=new Set;return Qp(n,()=>r.size===0?void 0:Od(r)),Wd(i=>{let a=js(e),o=a.length,s=0,c=!1,l=[],u=(e,r,a)=>{if(s++,e._tag===`Failure`){l.push(...e.cause.reasons),s>=o&&i(kd(Hu(Na(l))));return}let u=!c;c=!0,i(e),u&&t?.onWinner&&t.onWinner({fiber:r,index:a,parentFiber:n})};for(let e=0;e<o;e++){let t=Dm(n,a[e],!0,!0,!1);if(r.add(t),t.addObserver(n=>{r.delete(t),u(n,t,e)}),c)break}})}),gf=(e,t)=>j(n=>{let r=new Set;return Qp(n,()=>r.size===0?void 0:Od(r)),Wd(i=>{let a=!1,o=0;for(let s of e){if(a)break;let e=o++,c=Dm(n,s,!0,!0,!1);r.add(c),c.addObserver(o=>{r.delete(c);let s=!a;a=!0,i(o),s&&t?.onWinner&&t.onWinner({fiber:c,index:e,parentFiber:n})})}})}),_f=E(e=>Sa(e[1]),(e,t,n)=>hf([e,t],n)),vf=E(e=>Sa(e[1]),(e,t,n)=>gf([e,t],n)),L=E(2,(e,t)=>new nf(e,cf,t)),yf=e=>e[fa]!==void 0,bf=E(2,(e,t)=>yf(e)?e._tag===`Success`?t(e.value):e:L(e,t)),xf=e=>L(e,D),Sf=E(2,(e,t)=>new nf(e,sf,t)),Cf=E(2,(e,t)=>yf(e)?Nf(e,t):Sf(e,t)),wf=E(2,(e,t)=>yf(e)?Pf(e,t):op(e,t)),Tf=E(2,(e,t)=>yf(e)?Ff(e,t):sp(e,t)),Ef=E(2,(e,t)=>{if(yf(e)){if(e._tag===`Success`)return e;let n=Uu(e.cause);return us(n)?Qa(n.failure):t(n.success)}return ep(e,t)}),Df=e=>Qa(Lu(e)),Of=e=>e._tag===`Success`,kf=e=>e._tag===`Failure`,Af=e=>e._tag===`Failure`?os(e.cause):ss(e),jf=e=>e._tag===`Failure`&&Wu(e.cause),Mf=Ya(void 0),Nf=E(2,(e,t)=>e._tag===`Success`?Ya(t(e.value)):e),Pf=E(2,(e,t)=>e._tag===`Success`?e:Qa(Xu(e.cause,t))),Ff=E(2,(e,t)=>e._tag===`Success`?Ya(t.onSuccess(e.value)):Qa(Xu(e.cause,t.onFailure))),If=E(2,(e,t)=>Of(e)?t:e),Lf=e=>{let t=[];for(let n of e)n._tag===`Failure`&&t.push(...n.cause.reasons);return t.length===0?Mf:Qa(Na(t))},Rf=e=>j(t=>I(Rc(t.context,e))),zf=E(2,(e,t)=>j(n=>{let r=n.context,i=t(r);return r===i||(n.setContext(i),Qp(n,()=>{n.setContext(r)})),e})),Bf=E(3,(e,t,n)=>zf(e,e=>{let r=Nc(e,t),i=n(r);return r===i?e:kc(e,t,i)})),Vf=()=>Hf,Hf=j(e=>I(e.context)),Uf=e=>j(t=>e(t.context)),Wf=E(2,(e,t)=>yf(e)?e:zf(e,zc(t))),Gf=function(){return arguments.length===1?E(2,(e,t)=>Kf(e,arguments[0],t)):E(3,(e,t,n)=>Kf(e,t,n)).apply(this,arguments)},Kf=(e,t,n)=>zf(e,kc(t,n)),qf=E(2,(e,t)=>L(t,t=>t?df(e):Fd)),Jf=E(e=>Sa(e[0]),(e,t)=>vm({while:fr,body:dr(t?.disableYield?e:L(e,e=>Pd)),step:hr})),Yf=E(2,(e,t)=>new Zf(e,t.length===1?t:e=>t(e))),Xf=Ka({op:`OnFailure`,[ha]:ef}),Zf=function(e,t){this[A]=e,this[_a]=t};Zf.prototype=Xf;var Qf=E(3,(e,t,n)=>Yf(e,e=>t(e)?n(e):kd(e))),$f=E(3,(e,t,n)=>Yf(e,e=>{let r=t(e);return us(r)?kd(r.failure):n(r.success,e)})),ep=E(2,(e,t)=>$f(e,Uu,e=>t(e))),tp=E(2,(e,t)=>Yf(e,e=>ff(t(e),kd(e)))),np=E(3,(e,t,n)=>Yf(e,e=>{let r=t(e);return us(r)?kd(e):ff(n(r.success,e),kd(e))})),rp=E(2,(e,t)=>np(e,zu,e=>t(e))),ip=E(e=>Sa(e[0]),(e,t,n,r)=>Yf(e,e=>{let i=Uu(e);return us(i)?kd(i.failure):t(i.success)?n(i.success):r?r(i.success):kd(e)})),ap=E(e=>Sa(e[0]),(e,t,n,r)=>ip(e,Array.isArray(t)?e=>O(e,`_tag`)&&t.includes(e._tag):Vr(t),n,r)),op=E(2,(e,t)=>Yf(e,e=>kd(Xu(e,t)))),sp=E(2,(e,t)=>pp(e,{onFailure:e=>kd(Xu(e,t.onFailure)),onSuccess:e=>jd(()=>t.onSuccess(e))})),cp=e=>ep(e,Ld),lp=e=>e===`Unhandled`?(...e)=>j(t=>{let n=t.getRef(ju);return n===void 0?Rd:Fh(n)(...e)}):Fh(e===!0?void 0:e),up=E(e=>Sa(e[0]),(e,t)=>{if(!t?.log)return vp(e,{onFailure:e=>Rd,onSuccess:e=>Rd});let n=lp(t.log);return pp(e,{onFailure(e){let r=Uu(e);return us(r)?kd(r.failure):t.message===void 0?n(e):n(t.message,e)},onSuccess:e=>Rd})}),dp=E(e=>Sa(e[0]),(e,t)=>{if(!t?.log)return pp(e,{onFailure:e=>Rd,onSuccess:e=>Rd});let n=lp(t.log);return pp(e,{onFailure:e=>t.message===void 0?n(e):n(t.message,e),onSuccess:e=>Rd})}),fp=e=>bp(e,{onFailure:ss,onSuccess:os}),pp=E(2,(e,t)=>new hp(e,t.onSuccess.length===1?t.onSuccess:e=>t.onSuccess(e),t.onFailure.length===1?t.onFailure:e=>t.onFailure(e))),mp=Ka({op:`OnSuccessAndFailure`,[ha]:ef}),hp=function(e,t,n){this[A]=e,this[ga]=t,this[_a]=n};hp.prototype=mp;var gp=function(e,t){let n=this.payload;return t.succeedWith(of?n.onSuccess(e):ua(()=>n.onSuccess(e)))},_p=((e,t)=>{let n=Ka({op:e,[ha]:ef,[ga]:gp,[_a]:t}),r=function(e,t){this[A]=e,this.payload=t};return r.prototype=n,r})(`Match`,function(e,t){let n=Uu(e);if(us(n))return kd(n.failure);let r=this.payload;return t.succeedWith(of?r.onFailure(n.success):ua(()=>r.onFailure(n.success)))}),vp=E(2,(e,t)=>pp(e,{onFailure:e=>{let n=Uu(e);return us(n)?kd(n.failure):t.onFailure(n.success)},onSuccess:t.onSuccess})),yp=E(2,(e,t)=>new _p(e,t)),bp=E(2,(e,t)=>{if(yf(e)){if(e._tag===`Success`)return Ya(t.onSuccess(e.value));let n=Uu(e.cause);return us(n)?Qa(n.failure):Ya(t.onFailure(n.success))}return yp(e,t)}),xp=e=>yf(e)?Ya(e):Sp(e),Sp=qa({op:`Exit`,[ha](e){return e._stack.push(this),this[A]},[ga](e,t,n){return t.succeedWith(n??Ya(e))},[_a](e,t,n){return t.succeedWith(n??Qa(e))}}),Cp=E(2,(e,t)=>ff(hh(t),e)),wp=E(2,(e,t)=>L(Dp(e,t.duration),e=>Wo(e)?t.orElse():I(e.value))),Tp=e=>new bh(`Operation timed out after '${Hl(e)}'`),Ep=E(2,(e,t)=>{let n=ul(t);return wp(e,{duration:n,orElse:()=>Ad(Tp(n))})}),Dp=E(2,(e,t)=>vf(df(e),$d(hh(t),M()))),Op=`~effect/Scope`,kp=`~effect/Scope/Closeable`,Ap=lc(`effect/Scope`),jp=(e,t)=>j(n=>(mm(n),Mp(e,t)??Rd)),Mp=(e,t)=>{let n=e.state;if(n._tag===`Closed`||(e.state={_tag:`Closed`,exit:t},e.parent!==void 0&&Bp(e.parent,e),n._tag===`Empty`))return;if(n.finalizer!==void 0)return Np(n.finalizer,t);let r=n.finalizers;return r.size===1?Np(r.values().next().value,t):Fp(e,r,t)},Np=(e,t)=>{try{return e(t)}catch(e){return eo(e)}},Pp=(e,t)=>Of(e)?t:Yf(t,t=>kd(Hu(Fa(e.cause,t)))),Fp=Jd(function*(e,t,n){let r=[],i=[],a=Array.from(t),o=md();for(let t=a.length-1;t>=0;t--){let[s,c]=a[t];e.strategy===`sequential`?r.push(yield*xp(Np(c,n))):s!==o&&i.push(Dm(o,Np(c,n),!0,!0,`inherit`))}return i.length>0&&(r=yield*Cd(i)),yield*Lf(r)}),Ip=(e,t)=>{let n=Hp(t,e);return e.state._tag===`Closed`?(n.state=e.state,n):(zp(e,n,e=>jp(n,e)),n)},Lp=(e,t)=>Md(()=>e.state._tag===`Closed`?t(e.state.exit):(zp(e,{},t),Rd)),Rp=(e,t)=>Lp(e,dr(t)),zp=(e,t,n)=>{if(e.state._tag===`Empty`)e.state={_tag:`Open`,finalizerKey:t,finalizer:n,finalizers:void 0};else if(e.state._tag===`Open`){let r=e.state;r.finalizer===void 0||(r.finalizers=new Map([[r.finalizerKey,r.finalizer]]),r.finalizerKey=void 0,r.finalizer=void 0),r.finalizers.set(t,n)}},Bp=(e,t)=>{if(e.state._tag!==`Open`)return;let n=e.state;n.finalizerKey===t?e.state=Up:n.finalizers!==void 0&&(n.finalizers.delete(t),n.finalizers.size===0&&(e.state=Up))},Vp=e=>Hp(e,void 0),Hp=(e=`sequential`,t)=>({[kp]:kp,[Op]:Op,strategy:e,parent:t,state:Up}),Up={_tag:`Empty`},Wp=Ap,Gp=Gf(Ap),Kp=e=>j(t=>{let n=t.context,r=Vp();return t.setContext(kc(t.context,Ap,r)),Qp(t,e=>(t.setContext(n),Mp(r,e))),e}),qp=e=>Md(()=>{let t=Vp();return $p(e(t),e=>Md(()=>Mp(t,e)??Rd))}),Jp=(e,t,n)=>Uf(r=>gm(i=>L(Wp,a=>pf(n?.interruptible?i(e):e,e=>Lp(a,n=>Wf(t(e,n),r)))))),Yp=e=>L(Wp,t=>Uf(n=>Lp(t,t=>Wf(e(t),n)))),Xp=function(){let e=Ka({op:`OnExit`,[ha](e){return e._stack.push(this),this.effect},[va](e){e.interruptible&&this.interruptible!==!0&&(e._stack.push(dm),e.interruptible=!1)},[ga](e,t,n){n??=Ya(e);let r;try{r=this.onExit(n)}catch(e){r=eo(e)}return r?L(r,e=>n):n},[_a](e,t,n){n??=Qa(e);let r;try{r=this.onExit(n)}catch(e){r=eo(e)}return r?L(Pp(n,r),e=>n):n}}),t=function(e,t,n){this.effect=e,this.onExit=t,this.interruptible=n};return t.prototype=e,t}(),Zp=(e,t,n)=>new Xp(e,t,n),Qp=(e,t)=>{e._stack.push(new Xp(void 0,t,void 0))},$p=E(2,Zp),em=E(2,(e,t)=>$p(e,e=>t)),tm=E(3,(e,t,n)=>$p(e,e=>{let r=t(e);return us(r)?Rd:n(r.success,e)})),nm=E(2,(e,t)=>tm(e,Af,t)),rm=E(3,(e,t,n)=>$p(e,e=>{if(e._tag!==`Failure`)return Rd;let r=t(e.cause);return us(r)?Rd:n(r.success,e.cause)})),im=E(2,(e,t)=>rm(Gu,t)(e)),am=dr(1/0),om=(e,t)=>{let n=0,r,i,a=(e,t)=>(t.awaiters++,Qp(e,()=>{if(!(--t.awaiters>0||t.done))return i===t&&(i=void 0),Ed(t.fiber)}),wd(t.fiber));return[j(o=>{if(i!==void 0)return o===i.fiber?wd(i.fiber):a(o,i);if(r!==void 0&&(n===1/0||o.getRef(ch).currentTimeMillisUnsafe()<n))return r;r=void 0;let s=o.getRef(ch),c={fiber:new hd(o.context),awaiters:0,done:!1};i=c;let l=a(o,c);return c.fiber.evaluate(Zp(e,e=>{if(c.done=!0,i!==c||(i=void 0,jf(e)))return;let a=t(e);n=a===1/0?1/0:s.currentTimeMillisUnsafe()+a,r=e})),c.fiber._exit??l}),jd(()=>{i=void 0,r=void 0})]},sm=e=>jd(()=>om(e,am)[0]),cm=j(e=>kd(Lu(e.id))),lm=e=>j(t=>(t.interruptible&&(t.interruptible=!1,t._stack.push(dm)),e)),um=qa({op:`SetInterruptible`,[va](e){if(e.interruptible=this[A],e._interruptedCause&&e.interruptible)return()=>kd(e._interruptedCause)}}),dm=um(!0),fm=um(!1),pm=e=>{if(e.interruptible=!0,e._stack.push(fm),e._interruptedCause)return kd(e._interruptedCause)},mm=e=>{let t=e;t.interruptible&&(t.interruptible=!1,t._stack.push(dm))},hm=e=>j(t=>t.interruptible?e:pm(t)??e),gm=e=>j(t=>t.interruptible?(t.interruptible=!1,t._stack.push(dm),e(hm)):e(D)),_m=(e,t)=>Ur(e)?t?.mode===`result`?ym(e,fp,t):ym(e,D,t):t?.discard?t.mode===`result`?ym(Object.values(e),fp,t):ym(Object.values(e),D,t):Md(()=>Sf(ym(Object.entries(e),([e,n])=>Sf(t?.mode===`result`?fp(n):n,t=>[e,t]),{concurrency:t?.concurrency}),Object.fromEntries)),vm=qa({op:`While`,[ga](e,t){return this[A].step(e),this[`~effect/Effect/args`].while()?(t._stack.push(this),this[A].body()):Mf},[ha](e){return this[`~effect/Effect/args`].while()?(e._stack.push(this),this[A].body()):Mf}}),ym=E(e=>typeof e[1]==`function`,(e,t,n)=>Md(()=>{let r=xm(n?.concurrency);if(r===1)return bm(e,t,n);let i=js(e),a=i.length;if(a===0)return n?.discard?Rd:I([]);let o=n?.discard?void 0:Array(a),s=Tm({f:t,out:o},i,{concurrency:r});return s?$d(s,o):I(o)})),bm=(e,t,n)=>Md(()=>{let r=n?.discard?void 0:[],i=e[Symbol.iterator](),a=i.next(),o=0;return $d(vm({while:()=>!a.done,body:()=>t(a.value,o++),step:e=>{r&&r.push(e),a=i.next()}}),r)}),xm=e=>e===`unbounded`?1/0:Math.max(1,e??1),Sm=()=>e=>{let t=e.onItem,n=e.step,r=(e,t,r,a,o)=>L(xp(o),o=>n(e,t[r],o,r)??i(e,t,r+1,a)??Rd),i=(e,i,a=0,o=i.length)=>{for(;a<o;a++){let s=i[a],c=t(e,s,a);if(!yf(c))return r(e,i,a,o,c);let l=n(e,s,c,a);if(l)return l._tag===`Failure`?l:void 0}};return i},Cm=e=>{let t=e.onItem,n=e.step;return(e,r,i)=>{let a=0,o=i.end??r.length,s=i.concurrency,c=!1,l,u,d,f,p,m=e=>{let t=eo(e);return f=t,c=!0,u&&u.size>0?L(lm(Od(Array.from(u))),()=>f??t):t},h=()=>{let i=!1;for(;!f&&a<o;a++){let o=r[a],g=p??t(e,o,a);if(yf(g)){if(f=n(e,o,g,a),f)break}else if(l){p=void 0;let t=Dm(l,g,!0,!0,`inherit`);if(t._exit){if(f=n(e,o,t._exit,a),f)break;continue}u.add(t);let r=a;if(t.addObserver(a=>{u.delete(t);try{if(f){if(a._tag===`Failure`){let e=a.cause.reasons.filter(e=>e._tag!==`Interrupt`);if(e.length>0){let t=Na(e);f=Qa(f._tag===`Failure`?Hu(Fa(f.cause,t)):t)}}}else{let t=n(e,o,a,r);t&&(f=t,h())}if(i){let e=h();e&&d(e)}else c&&u.size===0&&d(f??Rd)}catch(e){d(m(e))}}),u.size<s)continue;i=!0,a++;return}else return Wd(e=>{l=md(),u=new Set,p=g,d=e;let t;try{t=h()}catch(t){return e(m(t))}return t?e(t):Md(()=>(f??=Mf,L(u?Od(u):Rd,()=>f?._tag===`Failure`?f:Rd)))})}if(c=!0,f){if(u&&u.size>0){let e=bd(l);u.forEach(t=>t.interruptUnsafe(l.id,e));return}if(d||f._tag===`Failure`)return f}else if(d){if(u)u.size===0&&d(Rd);else return Mf}};return h()}},wm=()=>e=>Cm(e),Tm=Cm({onItem(e,t,n){return e.f(t,n)},step(e,t,n,r){if(n._tag===`Failure`)return n;e.out&&(e.out[r]=n.value)}}),Em=E(e=>Sa(e[0]),(e,t)=>j(n=>(Bh(),I(Dm(n,e,t?.startImmediately,!1,t?.uninterruptible??!1))))),Dm=(e,t,n=!1,r=!1,i=!1)=>{let a=e,o=i===`inherit`?a.interruptible:!i,s=new hd(a.context,o);return r||(a.children().add(s),s._parent=a),n?s.evaluate(t):(s._asyncContext=pd(),a.currentDispatcher.scheduleTask(()=>s.evaluate(t),0)),s},Om=E(e=>Sa(e[0]),(e,t)=>j(n=>I(Dm(n,e,t?.startImmediately,!0,t?.uninterruptible)))),km=e=>()=>j(t=>t===e?Rd:Ed(e)),Am=E(e=>Sa(e[0]),(e,t,n)=>j(r=>{let i=t.state._tag===`Closed`?new hd(r.context):Dm(r,e,n?.startImmediately,!0,n?.uninterruptible);return i._exit||(t.state._tag===`Closed`?i.interruptUnsafe(r.id,bd(r)):(zp(t,i,km(i)),i.addObserver(()=>Bp(t,i)))),I(i)})),jm=E(e=>Sa(e[0]),(e,t)=>L(Wp,n=>Am(e,n,t))),Mm=e=>(t,n)=>{let r=new hd(n?.scheduler?kc(e,ql,n.scheduler):e,n?.uninterruptible!==!0);if(r.evaluate(t),r._exit)return r;if(n?.signal){if(n.signal.aborted)r.interruptUnsafe();else{let e=()=>r.interruptUnsafe();n.signal.addEventListener(`abort`,e,{once:!0}),r.addObserver(()=>n.signal.removeEventListener(`abort`,e))}}return n?.onFiberStart&&n.onFiberStart(r),r},Nm=E(2,(e,t)=>e._exit?e:t.state._tag===`Closed`?(e.interruptUnsafe(e.id),e):(Bp(t,e),zp(t,e,km(e)),e.addObserver(()=>Bp(t,e)),e)),Pm=Mm(Ec()),Fm=e=>{let t=Mm(e);return(e,n)=>{let r=t(e,n);return n?.onExit&&r.addObserver(n.onExit),e=>r.interruptUnsafe(e)}},Im=Fm(Ec()),Lm=e=>{let t=Mm(e);return(e,n)=>{let r=t(e,n);return new Promise(e=>{r.addObserver(t=>e(t))})}},Rm=Lm(Ec()),zm=(e=>{let t=Lm(e);return(e,n)=>t(e,n).then(e=>{if(e._tag===`Failure`)throw Zu(e.cause);return e.value})})(Ec()),Bm=e=>{let t=Mm(e);return e=>{if(yf(e))return e;let n=new Ql(`sync`),r=t(e,{scheduler:n});return r._dispatcher?.flush(),r._exit??eo(new wh(r))}},Vm=Bm(Ec()),Hm=e=>{let t=Bm(e);return e=>{let n=t(e);if(n._tag===`Failure`)throw Zu(n.cause);return n.value}},Um=Hm(Ec()),Wm=I(!0),Gm=I(!1),Km=class{waiters=[];scheduled=void 0;_isOpen;constructor(e){this._isOpen=e}scheduleUnsafe(e){if(this.waiters.length===0)return Wm;if(this.scheduled===void 0)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=[],Wm}flushScheduled=()=>{if(this.scheduled===void 0)return;let e=this.scheduled;this.scheduled=void 0;for(let t=0;t<e.length;t++)e[t](Mf)};flushWaiters(){let e=this.waiters;this.waiters=[],this.flushScheduled();for(let t=0;t<e.length;t++)e[t](Mf)}open=j(e=>this._isOpen?Gm:(this._isOpen=!0,this.scheduleUnsafe(e)));release=j(e=>this._isOpen?Gm:this.scheduleUnsafe(e));openUnsafe(){return!this._isOpen&&(this._isOpen=!0,this.flushWaiters(),!0)}await=Wd(e=>this._isOpen?e(Rd):(this.waiters.push(e),jd(()=>{let t=this.waiters.indexOf(e);t===-1?this.scheduled!==void 0&&(t=this.scheduled.indexOf(e),t!==-1&&this.scheduled.splice(t,1)):this.waiters.splice(t,1)})));closeUnsafe(){return this._isOpen?(this._isOpen=!1,!0):!1}close=jd(()=>this.closeUnsafe());whenOpen=e=>L(this.await,()=>e);isOpen(){return this._isOpen}},qm=e=>new Km(e??!1),Jm=e=>jd(()=>qm(e)),Ym=Gf(wu),Xm=BigInt(0),Zm={_tag:`Span`,spanId:`noop`,traceId:`noop`,sampled:!1,status:{_tag:`Ended`,startTime:Xm,endTime:Xm,exit:Mf},attributes:new Map,links:[],kind:`internal`,attribute(){},event(){},end(){},addLinks(){}},Qm=e=>Object.assign(Object.create(Zm),e),$m=e=>e?Pc(e.annotations,hu)?e._tag===`Span`?$m(Qo(e.parent)):M():N(e):M(),eh=(e,t,n)=>{let r=!e.cache.tracerEnabled||n?.annotations&&Pc(n.annotations,hu),i=n?.parent===void 0?n?.root?M():$m(e.cache.span):N(n.parent),a;if(r)a=Qm({name:t,parent:i,annotations:kc(n?.annotations??Ec(),hu,!0)});else{let r=e.cache.tracer??bu,o=e.getRef(ch),s=e.getRef(Tu),c=e.getRef(Eu),l=e.getRef(Du),u=n?.level??e.getRef(gu),d=n?.links===void 0?l.length===0?[]:l.slice():[...l,...n.links];a=r.span({name:t,parent:i,annotations:n?.annotations??Ec(),links:d,startTime:s?o.currentTimeNanosUnsafe():Xm,kind:n?.kind??`internal`,root:n?.root??!1,sampled:n?.sampled??(Go(i)&&i.value.sampled===!1?!1:!Oh(e.getRef(_u),u))});for(let e in c)a.attribute(e,c[e]);if(n?.attributes!==void 0)for(let e in n.attributes)a.attribute(e,n.attributes[e])}return a},th=(e,t)=>lm(j(n=>{let r=Nc(n.context,Ap),i=eh(n,e,t??{}),a=n.getRef(ch),o=n.getRef(Tu);return $d(Lp(r,e=>rh(i,e,a,o)),i)})),nh=(e,t)=>(t=typeof t==`function`?t:mr,Bf(Cu,n=>({name:e,stack:t,parent:n}))),rh=(e,t,n,r)=>jd(()=>{e.status._tag!==`Ended`&&e.end(r?n.currentTimeNanosUnsafe():Xm,t)}),ih=(e,...t)=>{let n=t.length===1?void 0:t[0],r=t[t.length-1];return j(t=>{let i=eh(t,e,n),a=t.getRef(ch),o=t.getRef(Tu);return Qp(t,e=>rh(i,e,a,o)),r(i)})},ah=Gf(pu),oh=function(){let e=Sa(arguments[0]),t=e?arguments[1]:arguments[0],n=e?arguments[2]:arguments[1],r=D;return t._tag===`Span`&&(n=Nu(n),r=nh(t.name,n?.captureStackTrace)),e?ah(r(arguments[0]),t):e=>ah(r(e),t)},sh=function(){let e=typeof arguments[0]!=`string`,t=e?arguments[1]:arguments[0],n=Nu(arguments[2]);if(e){let e=arguments[0];return ih(t,arguments[2],t=>oh(e,t,n))}let r=typeof arguments[1]==`function`?arguments[1]:void 0,i=r?void 0:arguments[1];return(e,...a)=>ih(t,r?r(...a):i,t=>oh(e,t,n))},ch=P(`effect/Clock`,{defaultValue:()=>new uh}),lh=2**31-1,uh=class{currentTimeMillisUnsafe(){return Date.now()}currentTimeMillis=jd(()=>this.currentTimeMillisUnsafe());currentTimeNanosUnsafe(){return ph()}currentTimeNanos=jd(()=>this.currentTimeNanosUnsafe());monotonicTimeNanosUnsafe(){return fh()}monotonicTimeNanos=jd(()=>this.monotonicTimeNanosUnsafe());sleep(e){return this.sleepMillis(Al(e))}sleepMillis(e){return e<=0?Pd:Number.isFinite(e)?Wd(t=>{let n=e>lh?this.sleepMillis(e-lh):Rd,r=setTimeout(()=>t(n),Math.min(e,lh));return jd(()=>clearTimeout(r))}):Gd}},dh=BigInt(1e6),fh=function(){let e=globalThis.process?.hrtime;if(typeof e?.bigint==`function`)return()=>e.bigint();if(typeof performance<`u`&&typeof performance.now==`function`)return()=>BigInt(Math.round(performance.now()*1e6));let t=BigInt(0);return()=>{let e=BigInt(Date.now())*dh;return e>t&&(t=e),t}}(),ph=function(){let e=BigInt(1e9),t;return()=>{let n=fh(),r=BigInt(Date.now())*dh;if(t===void 0)t=r-n;else{let i=t+n;(r>i?r-i:i-r)>e&&(t=r-n)}return t+n}}(),mh=e=>j(t=>e(t.getRef(ch))),hh=e=>mh(t=>t.sleep(ul(e))),gh=mh(e=>e.currentTimeMillis),_h=mh(e=>e.currentTimeNanos),vh=`~effect/Cause/TimeoutError`,yh=e=>O(e,vh),bh=class extends ro(`TimeoutError`){[vh]=vh;constructor(e){super({message:e})}},xh=`~effect/Cause/IllegalArgumentError`,Sh=class extends ro(`IllegalArgumentError`){[xh]=xh;constructor(e){super({message:e})}},Ch=`~effect/Cause/AsyncFiberError`,wh=class extends ro(`AsyncFiberError`){[Ch]=Ch;constructor(e){super({message:`An asynchronous Effect was executed with Effect.runSync`,fiber:e})}},Th=`~effect/Cause/UnknownError`,Eh=class extends ro(`UnknownError`){[Th]=Th;constructor(e,t){super({message:t,cause:e})}},Dh=P(`effect/Console`,{defaultValue:()=>globalThis.console}),Oh=Bo(zo(Lo,e=>{switch(e){case`All`:return-(2**53-1);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 2**53-1}})),kh=P(`effect/Logger/CurrentLoggers`,{defaultValue:()=>new Set([Rh,zh])}),Ah=P(`effect/Logger/LogToStderr`,{defaultValue:pr}),jh={"~effect/Logger":{_Message:D,_Output:D},pipe(){return T(this,arguments)}},Mh=e=>{let t=Object.create(jh);return t.log=e,t},Nh=e=>e.replace(/[\s="]/g,`_`),Ph=(e,t)=>`${Nh(e[0])}=${t-e[1]}ms`,Fh=e=>(...t)=>{let n;for(let e=0,r=t.length;e<r;e++){let r=t[e];Ea(r)&&(n?t.splice(e,1):t=t.slice(0,e).concat(t.slice(e+1)),n=n?Na(n.reasons.concat(r.reasons)):r,e--)}return n===void 0&&(n=La),j(r=>{let i=e??r.cache.logLevel;if(Oh(r.cache.minimumLogLevel,i))return Rd;let a=r.getRef(ch),o=r.getRef(kh);if(o.size>0){let e=new Date(a.currentTimeMillisUnsafe());for(let a of o)a.log({cause:n,fiber:r,date:e,logLevel:i,message:t})}return Rd})},Ih={bold:`1`,red:`31`,green:`32`,yellow:`33`,blue:`34`,cyan:`36`,white:`37`,gray:`90`,black:`30`,bgBrightRed:`101`};Ih.gray,Ih.blue,Ih.green,Ih.yellow,Ih.red,Ih.bgBrightRed,Ih.black;var Lh=e=>`${e.getHours().toString().padStart(2,`0`)}:${e.getMinutes().toString().padStart(2,`0`)}:${e.getSeconds().toString().padStart(2,`0`)}.${e.getMilliseconds().toString().padStart(3,`0`)}`,Rh=Mh(({cause:e,date:t,fiber:n,logLevel:r,message:i})=>{let a=Array.isArray(i)?i.slice():[i];e.reasons.length>0&&a.push(od(e));let o=t.getTime(),s=n.getRef(Mu),c=``;for(let e of s)c+=` ${Ph(e,o)}`;let l=n.getRef(Ou);Object.keys(l).length>0&&a.push(l);let u=n.getRef(Dh);(n.getRef(Ah)?u.error:u.log)(`[${Lh(t)}] ${r.toUpperCase()} (#${n.id})${c}:`,...a)}),zh=Mh(({cause:e,fiber:t,logLevel:n,message:r})=>{let i=t.getRef(ch),a=t.getRef(Ou),o=t.cache.span;if(o===void 0||o._tag===`ExternalSpan`||o.status._tag===`Ended`)return;let s={};for(let[e,t]of Object.entries(a))Fi(s,e,t);s[`effect.fiberId`]=t.id,s[`effect.logLevel`]=n.toUpperCase(),e.reasons.length>0&&(s[`effect.cause`]=od(e)),o.event(ra(Array.isArray(r)&&r.length===1?r[0]:r),i.currentTimeNanosUnsafe(),s)});function Bh(){yd.interruptChildren??=xd}var Vh=I(void 0),Hh=Ea,Uh=Da,Wh=Ha,Gh=Ua,Kh=Wa,qh=Na,Jh=Ra,Yh=Ba,Xh=Lu,Zh=e=>new Ma(e),Qh=e=>new za(e),$h=Iu,eg=Ju,tg=Xu,ng=Zu,rg=zu,ig=Bu,ag=Wu,og=Ku,sg=Gu,cg=Qu,lg=ao,ug=so,dg=fo,fg=yh,pg=Sh,mg=Yu,hg=ch,gg=gh,_g=_h,vg=Ca,yg=Ya,bg=Qa,xg=$a,Sg=eo,Cg=Df,wg=Mf,Tg=Of,Eg=kf,Dg=Lf,Og={"~effect/Deferred":{_A:D,_E:D},pipe(){return T(this,arguments)}},kg=function(){this.resumes=void 0,this.effect=void 0};kg.prototype=Og;var Ag=()=>new kg,jg=()=>jd(()=>Ag()),Mg=e=>Wd(t=>e.effect?t(e.effect):(e.resumes??=[],e.resumes.push(t),jd(()=>{let n=e.resumes;if(n===void 0)return;let r=n.indexOf(t);r>=0&&n.splice(r,1)}))),Ng=E(2,(e,t)=>jd(()=>Bg(e,t))),Pg=E(2,(e,t)=>Ng(e,$a(t))),Fg=E(2,(e,t)=>Ng(e,Qa(t))),Ig=E(2,(e,t)=>Fg(e,Lu(t))),Lg=e=>e.effect!==void 0;function Rg(e){return jd(()=>Xo(e.effect))}var zg=E(2,(e,t)=>Ng(e,Ya(t))),Bg=(e,t)=>{if(e.effect)return!1;if(e.effect=t,e.resumes){let n=e.resumes;e.resumes=void 0;for(let e=0;e<n.length;e++)n[e](t)}return!0},Vg=E(2,(e,t)=>gm(n=>L(xp(n(e)),e=>Ng(t,e)))),Hg=Ou,Ug=Mu,Wg=Tu,Gg=Ap,Kg=Vp,qg=Gp,Jg=Lp,Yg=Rp,Xg=Ip,Zg=jp,Qg=Mp,$g=`~effect/Layer`,e_=`~effect/Layer/MemoMap`,t_=(e,t)=>{let n={observers:0,deferred:Ag(),scope:Kg(),finalizer:r=>Md(()=>--n.observers>0?Rd:(e.map.delete(t),Zg(n.scope,r)))};return n},n_=(e,t)=>t.state._tag!==`Closed`&&(e.observers++,zp(t,{},e.finalizer),!0),r_={[$g]:{_ROut:D,_E:D,_RIn:D},pipe(){return T(this,arguments)}},i_=e=>{let t=Object.create(r_);return t.build=e,t},a_=e=>i_((t,n)=>{let r=Xg(n);return $p(e(t,r),e=>e._tag===`Failure`?Zg(r,e):Rd)}),o_=e=>{let t=a_((n,r)=>n.getOrElseMemoize(t,r,e));return t},s_=class{get[e_](){return e_}parent;constructor(e){this.parent=e}map=new Map;get(e,t){let n=this.map.get(e);return n?(n_(n,t),n.deferred.effect??Mg(n.deferred)):this.parent?.get(e,t)}getOrElseMemoize(e,t,n){return Md(()=>{let r;return Zp(Md(()=>{let i=this.get(e,t);if(i)return i;let a=t_(this,e);return n_(a,t)?(r=a.deferred,this.map.set(e,a),n(this,a.scope)):n(this,t)}),e=>{r&&Bg(r,e)})})}},c_=()=>new s_,l_=e=>new s_(e),u_=class e extends lc()(`effect/Layer/CurrentMemoMap`){static forkOrCreate(t){let n=jc(t,e);return n?l_(n):c_()}},d_=E(3,(e,t,n)=>Gf(Sf(Md(()=>e.build(t,n)),kc(u_,t)),u_,t)),f_=E(2,(e,t)=>j(n=>d_(e,u_.forkOrCreate(n.context),t))),p_=function(){return arguments.length===1?e=>m_(Oc(arguments[0],e)):m_(Oc(arguments[0],arguments[1]))},m_=e=>i_(dr(I(e))),h_=m_(Ec()),g_=function(){return arguments.length===1?e=>__(()=>Oc(arguments[0],e())):__(()=>Oc(arguments[0],arguments[1]()))},__=e=>o_(dr(jd(e))),v_=function(){return arguments.length===1?e=>y_(arguments[0],e):y_(arguments[0],arguments[1])},y_=(e,t)=>b_(Sf(t,t=>Oc(e,t))),b_=e=>o_((t,n)=>qg(e,n)),x_=lc(`effect/Layer/unwrap`),S_=e=>O_(v_(x_)(e),Pc(x_)),C_=(e,t,n)=>{let r=Xg(n,`parallel`);return ym(e,e=>e.build(t,Xg(r,`sequential`)),{concurrency:e.length}).pipe(Sf(e=>Bc(...e)))},w_=(...e)=>o_((t,n)=>C_(e,t,n)),T_=(e,t,n)=>o_((r,i)=>L(Array.isArray(t)?C_(t,r,i):t.build(r,i),t=>e.build(r,i).pipe(Wf(t),Sf(e=>n(e,t))))),E_=E(2,(e,t)=>T_(e,t,D)),D_=E(2,(e,t)=>T_(e,t,(e,t)=>zc(t,e))),O_=E(2,(e,t)=>a_((n,r)=>L(e.build(n,r),e=>t(e).build(n,r)))),k_=e=>i_((t,n)=>cp(e.build(t,n))),A_=`~effect/DateTime`,j_=`~effect/DateTime/TimeZone`,M_={[A_]:A_,pipe(){return T(this,arguments)},[ta](){return this.toString()},toJSON(){return lv(this).toJSON()}},N_={...M_,_tag:`Utc`,[Gr](){return Qr(this.epochMilliseconds)},[ui](e){return U_(e)&&e._tag===`Utc`&&this.epochMilliseconds===e.epochMilliseconds},toString(){return`DateTime.Utc(${lv(this).toJSON()})`}},P_={...M_,_tag:`Zoned`,[Gr](){return Jr(Qr(this.epochMilliseconds))(k(this.zone))},[ui](e){return U_(e)&&e._tag===`Zoned`&&this.epochMilliseconds===e.epochMilliseconds&&di(this.zone,e.zone)},toString(){return`DateTime.Zoned(${Cv(this)})`}},F_={[j_]:j_,[ta](){return this.toString()}},I_={...F_,_tag:`Named`,[Gr](){return $r(`Named:${this.id}`)},[ui](e){return G_(e)&&e._tag===`Named`&&this.id===e.id},toString(){return`TimeZone.Named(${this.id})`},toJSON(){return{_id:`TimeZone`,_tag:`Named`,id:this.id}}},L_={...F_,_tag:`Offset`,[Gr](){return $r(`Offset:${this.offset}`)},[ui](e){return G_(e)&&e._tag===`Offset`&&this.offset===e.offset},toString(){return`TimeZone.Offset(${fv(this.offset)})`},toJSON(){return{_id:`TimeZone`,_tag:`Offset`,offset:this.offset}}},R_={value:void 0,enumerable:!1,writable:!0},z_=new WeakMap,B_=(e,t)=>({get(){return Object.isExtensible(this)?void 0:z_.get(this)?.[e]},set(n){if(Object.isExtensible(this)){for(let e of t)Object.defineProperty(this,e,R_);this[e]=n}else{let t=z_.get(this);t===void 0&&(t={},z_.set(this,t)),t[e]=n}}}),V_=[`partsUtc`,`adjustedEpochMilliseconds`,`partsAdjusted`];Object.defineProperty(N_,"partsUtc",B_(`partsUtc`,[`partsUtc`])),Object.defineProperties(P_,{partsUtc:B_(`partsUtc`,V_),adjustedEpochMilliseconds:B_(`adjustedEpochMilliseconds`,V_),partsAdjusted:B_(`partsAdjusted`,V_)});var H_=(e,t,n)=>{let r=Object.create(P_);return r.epochMilliseconds=e,r.zone=t,n!==void 0&&(r.partsUtc=n),r},U_=e=>O(e,A_),W_=e=>U_(e[0]),G_=e=>O(e,j_),K_=e=>e._tag===`Zoned`,q_=e=>{let t=Object.create(N_);return t.epochMilliseconds=e,t},J_=e=>{let t=e.getTime();if(Number.isNaN(t))throw new pg(`Invalid date`);return q_(t)},Y_=e=>{if(U_(e))return e;if(e instanceof Date)return J_(e);if(typeof e==`object`){if(`epochMilliseconds`in e)return J_(new Date(e.epochMilliseconds));let t=new Date(0);return hv(t,e),J_(t)}return typeof e==`string`&&!X_(e)?J_(new Date(e+`Z`)):J_(new Date(e))},X_=e=>/Z|GMT|[+-]\d{2}$|[+-]\d{2}:?\d{2}$|\]$/.test(e)||/z$|gmt$/i.test(e),Z_=-864e13+432e5,Q_=864e13-504e5,$_=(e,t)=>{let n=t?.timeZone;if(n===void 0&&U_(e)&&K_(e))return e;let r=Y_(e);if(r.epochMilliseconds<Z_||r.epochMilliseconds>Q_)throw RangeError(`Epoch millis out of range: ${r.epochMilliseconds}`);n===void 0&&typeof e==`object`&&`timeZoneId`in e&&(n=e.timeZoneId);let i;if(n===void 0)i=iv(new Date(r.epochMilliseconds).getTimezoneOffset()*-60*1e3);else if(G_(n))i=n;else if(typeof n==`number`)i=iv(n);else{let e=sv(n);if(Wo(e))throw new pg(`Invalid time zone: ${n}`);i=e.value}return t?.adjustForTimeZone===!0?_v(r.epochMilliseconds,i,t?.disambiguation??`compatible`):H_(r.epochMilliseconds,i,r.partsUtc)},ev=new Map,tv={day:`numeric`,month:`numeric`,year:`numeric`,era:`short`,hour:`numeric`,minute:`numeric`,second:`numeric`,timeZoneName:`longOffset`,fractionalSecondDigits:3,hourCycle:`h23`},nv=e=>{let t=e.resolvedOptions().timeZone,n=ev.get(t);if(n!==void 0)return n;let r=Object.create(I_);return r.id=t,r.format=e,ev.set(t,r),r},rv=e=>{let t=ev.get(e);if(t!==void 0)return t;try{let t=nv(new Intl.DateTimeFormat(`en-US`,{...tv,timeZone:e}));return ev.set(e,t),t}catch{throw new pg(`Invalid time zone: ${e}`)}},iv=e=>{let t=Object.create(L_);return t.offset=e,t},av=$o(rv),ov=/^(?:GMT)?[+-]/,sv=e=>{if(ov.test(e)){let t=yv(e);return t===null?M():N(iv(t))}return av(e)},cv=E(2,(e,t)=>Ol(mv(t)-mv(e))),lv=e=>new Date(e.epochMilliseconds),uv=e=>{if(e._tag===`Utc`)return new Date(e.epochMilliseconds);if(e.zone._tag===`Offset`)return new Date(e.epochMilliseconds+e.zone.offset);if(e.adjustedEpochMilliseconds!==void 0)return new Date(e.adjustedEpochMilliseconds);let t=!1,n=e.zone.format.formatToParts(e.epochMilliseconds).filter(e=>e.type===`era`?(t=e.value===`BC`,!1):e.type!==`literal`),r=Number(n[2].value),i=new Date(0);return i.setUTCFullYear(t?1-r:r,Number(n[0].value)-1,Number(n[1].value)),i.setUTCHours(Number(n[3].value),Number(n[4].value),Number(n[5].value),n[6]?.type===`fractionalSecond`?Number(n[6].value):(e.epochMilliseconds%1e3+1e3)%1e3),e.adjustedEpochMilliseconds=i.getTime(),i},dv=e=>uv(e).getTime()-mv(e),fv=e=>{let t=Math.abs(e),n=Math.floor(t/36e5),r=Math.round(t%36e5/6e4);return r===60&&(n+=1,r=0),`${e<0?`-`:`+`}${String(n).padStart(2,`0`)}:${String(r).padStart(2,`0`)}`},pv=e=>fv(dv(e)),mv=e=>e.epochMilliseconds,hv=(e,t)=>{if((t.year!==void 0||t.month!==void 0||t.day!==void 0)&&e.setUTCFullYear(t.year??e.getUTCFullYear(),t.month===void 0?e.getUTCMonth():t.month-1,t.day??e.getUTCDate()),t.weekDay!==void 0){let n=t.weekDay-e.getUTCDay();e.setUTCDate(e.getUTCDate()+n)}t.hour!==void 0&&e.setUTCHours(t.hour),t.minute!==void 0&&e.setUTCMinutes(t.minute),t.second!==void 0&&e.setUTCSeconds(t.second),t.millisecond!==void 0&&e.setUTCMilliseconds(t.millisecond)},gv=864e5,_v=(e,t,n)=>{if(t._tag===`Offset`)return H_(e-t.offset,t);let r=bv(e-gv,e,t),i=bv(e+gv,e,t);if(r===i)return H_(e-r,t);let a=r<i,o=r-i;if(a){if(bv(e-i,e,t)===i)return H_(e-i,t);let a=H_(e-r,t);if(e!==uv(a).getTime())switch(n){case`reject`:{let n=new Date(e).toISOString();throw RangeError(`Gap time: ${n} does not exist in time zone ${t.id}`)}case`earlier`:return H_(e-i,t);case`compatible`:case`later`:return a}return a}if(bv(e-r,e,t)===r){if(n===`earlier`||n===`compatible`||bv(e-r+o,e+o,t)===r)return H_(e-r,t);if(n===`reject`){let n=new Date(e).toISOString();throw RangeError(`Ambiguous time: ${n} occurs twice in time zone ${t.id}`)}}return H_(e-i,t)},vv=/([+-])(\d{2}):?(\d{2})$/,yv=e=>{let t=vv.exec(e);if(t===null)return null;let[,n,r,i]=t;return(n===`+`?1:-1)*(Number(r)*60+Number(i))*60*1e3},bv=(e,t,n)=>{let r=n.format.formatToParts(e).find(e=>e.type===`timeZoneName`)?.value??``;if(r===`GMT`)return 0;let i=yv(r);return i===null?dv(H_(t,n)):i},xv=E(W_,(e,t)=>new Intl.DateTimeFormat(t?.locale,t).format(e.epochMilliseconds)),Sv=e=>{let t=uv(e);return e._tag===`Utc`?t.toISOString():`${t.toISOString().slice(0,-1)}${pv(e)}`},Cv=e=>e.zone._tag===`Offset`?Sv(e):`${Sv(e)}[${e.zone.id}]`,wv=globalThis.Number,Tv=Ho(Lo),Ev=e=>{if(e===`NaN`)return N(NaN);if(e===`Infinity`)return N(1/0);if(e===`-Infinity`)return N(-1/0);if(e.trim()===``)return M();let t=wv(e);return wv.isNaN(t)?M():N(t)},Dv=globalThis.String,Ov=Io,kv=e=>e.toUpperCase(),Av=e=>e.toLowerCase(),jv=(e,t)=>n=>n.replace(e,t),Mv=(e,t)=>n=>n.slice(e,t),Nv=e=>e.length===0,Pv=e=>e.length>0,Fv=e=>e.length,Iv=E(2,(e,t)=>{let n=e.split(t);return Mi(n)?n:[e]}),Lv=(e,t)=>n=>n.startsWith(e,t),Rv=(e,t)=>n=>n.endsWith(e,t),zv=e=>t=>Zo(t.match(e)),Bv=(e,t)=>n=>n.replaceAll(e,t),Vv=E(2,(e,t)=>$f(e,Gv,e=>t(e))),Hv=e=>e.reasons.some(Uv),Uv=e=>e._tag===`Fail`&&ug(e.error),Wv=e=>{let t,n=!1;for(let r of e.reasons)Uv(r)?t??=r.error:r._tag!==`Interrupt`&&(n=!0);return t===void 0?ss(e):n?ss(qh(e.reasons.filter(e=>!Uv(e)))):os(t)},Gv=e=>{let t=Wv(e);return us(t)?t:os(t.success.value)},Kv=e=>{let t=Wv(e);return us(t)?bg(t.failure):yg(t.success.value)},qv=E(2,(e,t)=>pp(e,{onSuccess:t.onSuccess,onFailure:e=>{let n=Wv(e);return us(n)?t.onFailure(n.failure):t.onDone(n.success.value)}})),Jv=`~effect/Schedule`,Yv=P(`effect/Schedule/CurrentMetadata`,{defaultValue:dr({input:void 0,output:void 0,duration:wl,attempt:0,start:0,now:0,elapsed:0,elapsedSincePrevious:0})}),Xv={[Jv]:{_Out:D,_In:D,_Env:D},pipe(){return T(this,arguments)}},Zv=e=>O(e,Jv),Qv=e=>{let t=Object.create(Xv);return t.step=e,t},$v=()=>{let e=0,t,n;return(r,i)=>{n===void 0&&(n=r);let a=r-n,o=t===void 0?0:r-t;return t=r,{input:i,attempt:++e,start:n,now:r,elapsed:a,elapsedSincePrevious:o}}},ey=e=>Qv(Sf(e,e=>{let t=$v();return(n,r)=>e(t(n,r))})),ty=e=>Yf(e.step,e=>I(()=>kd(e))),ny=e=>mh(t=>Sf(ty(e),e=>{let n=$v();return r=>Md(()=>{let i=t.currentTimeMillisUnsafe();return L(e(i,r),([e,t])=>{let a=n(i,r);return a.output=e,a.duration=t,$d(hh(t),a)})})})),ry=E(2,(e,t)=>sy(e,e=>Sf(t(e),t=>zl(ul(t),e.duration)))),iy=e=>Qv(Sf(_m(e.map(ty)),e=>(t,n)=>L(ym(e,e=>qv(e(t,n),{onSuccess:e=>I(e[1]),onDone:()=>Vh,onFailure:kd})),e=>{let t=ay(e);return t===void 0?dg(wl):I([t,t])}))),ay=e=>{let t;for(let n=0;n<e.length;n++){let r=e[n];r!==void 0&&(t=t===void 0?r:Ll(t,r))}return t},oy=(e,t=2)=>{let n=Al(ul(e));return ey(I(e=>{let r=Ol(n*t**(e.attempt-1));return I([r,r])}))},sy=E(2,(e,t)=>Qv(Sf(ty(e),e=>{let n=$v();return(r,i)=>L(e(r,i),([e,a])=>Sf(t({...n(r,i),output:e,duration:a}),t=>[e,ul(t)]))}))),cy=e=>Qv(Sf(ty(e),e=>(t,n)=>qv(e(t,n),{onSuccess:e=>I([n,e[1]]),onFailure:kd,onDone:()=>dg(n)}))),ly=e=>{let t=ul(e);return ey(I(e=>I([e.attempt-1,t])))},uy=E(2,(e,t)=>Qv(Sf(ty(e),e=>{let n=$v();return(r,i)=>L(e(r,i),e=>{let[a,o]=e,s=t({...n(r,i),output:a,duration:o});return L(Sa(s)?s:I(s),t=>t?I(e):dg(a))})}))),dy=ly(wl),fy=(e,t,n)=>qp(r=>L(n?.local?d_(t,c_(),r):f_(t,r),t=>Wf(e,t))),py=E(e=>Sa(e[0]),(e,t,n)=>wc(t)?Wf(e,t):fy(e,Array.isArray(t)?w_(...t):t,n)),my=E(3,(e,t,n)=>L(ny(t),t=>{let r=Yv.defaultValue(),i=n=>qv(t(n),{onSuccess(t){return r=t,L(Gf(e,Yv,r),i)},onFailure:kd,onDone:I});return $f(L(Gf(e,Yv,r),i),Uu,e=>n(e,r.attempt===0?M():N(r)))})),hy=E(3,(e,t,n)=>L(ny(t),t=>{let r=Yv.defaultValue(),i,a=$f(Md(()=>Gf(e,Yv,r)),Uu,e=>(i=e,L(t(e),e=>(r=e,a))));return Vv(a,e=>ua(()=>n(i,e)))})),gy=E(2,(e,t)=>my(e,typeof t==`function`?t(D):Zv(t)?t:yy(t),Ad)),_y=E(2,(e,t)=>hy(e,typeof t==`function`?t(D):Zv(t)?t:yy(t),Ad)),vy=cy(dy),yy=e=>{let t=e.schedule?cy(e.schedule):vy;return e.while&&(t=uy(t,({input:t})=>{let n=e.while(t);return Sa(n)?n:I(n)})),e.until&&(t=uy(t,({input:t})=>{let n=e.until(t);return Sa(n)?Sf(n,e=>!e):I(!n)})),e.times!==void 0&&(t=uy(t,({attempt:t})=>I(t<=e.times))),t},by=`~effect/MutableHashMap`,xy={[by]:by,[Symbol.iterator](){return this.backing[Symbol.iterator]()},toString(){return`MutableHashMap(${Wi(Array.from(this))})`},toJSON(){return{_id:`MutableHashMap`,values:na(Array.from(this))}},[ta](){return this.toJSON()},pipe(){return T(this,arguments)}},Sy=()=>{let e=Object.create(xy);return e.backing=new Map,e.buckets=new Map,e},Cy=E(2,(e,t)=>{if(e.backing.has(t))return N(e.backing.get(t));if(wy(t))return M();let n=k(t),r=e.buckets.get(n);return r===void 0?M():Ty(e,r,t)}),wy=e=>typeof e!=`object`&&typeof e!=`function`,Ty=(e,t,n)=>{for(let r=0,i=t.length;r<i;r++)if(di(n,t[r])){let n=t[r];return N(e.backing.get(n))}return M()},Ey=E(3,(e,t,n)=>{if(e.backing.has(t)||wy(t))return e.backing.set(t,n),e;let r=k(t),i=e.buckets.get(r);if(i===void 0)return e.buckets.set(r,[t]),e.backing.set(t,n),e;let a=Dy(i,t);return a===void 0&&(i.push(t),a=t),e.backing.set(a,n),e}),Dy=(e,t)=>{for(let n=0,r=e.length;n<r;n++)if(di(t,e[n]))return e[n]},Oy=E(2,(e,t)=>{if(wy(t))return e.backing.delete(t),e;let n=k(t),r=e.buckets.get(n);if(r===void 0)return e;for(let n=0,i=r.length;n<i;n++){let i=r[n];if(i===t||di(t,i)){e.backing.delete(i),r.splice(n,1);break}}return r.length===0&&e.buckets.delete(n),e}),ky=Sa,Ay=_m,jy=ym,My=vm,Ny=Bd,Py=Vd,R=I,Fy=Fd,z=Md,B=jd,V=Rd,Iy=Wd,Ly=Gd,Ry=Kd,H=Ad,zy=kd,By=Id,Vy=Ld,Hy=zd,Uy=Pd,Wy=j,Gy=Nd,U=L,Ky=xf,qy=ff,Jy=pf,Yy=xp,W=Sf,Xy=$d,Zy=mf,Qy=ap,$y=Yf,eb=Qf,tb=op,nb=cp,rb=rp,ib=tp,ab=_y,ob=hy,sb=up,cb=dp,lb=Ep,ub=Dp,db=wp,fb=Cp,pb=hh,mb=_f,hb=vf,gb=qf,_b=pp,vb=Vf,yb=Uf,bb=py,xb=Wf,Sb=Rf,Cb=zf,wb=Gf,Tb=Wp,Eb=Kp,Db=qp,Ob=Jp,kb=Yp,Ab=em,jb=nm,Mb=Zp,Nb=$p,Pb=sm,Fb=cm,Ib=hm,Lb=im,Rb=lm,zb=gm,Bb=Jf,Vb=gy,Hb=Ym,Ub=th,Wb=ih,Gb=sh,Kb=oh,qb=Em,Jb=Am,Yb=jm,Xb=Om,Zb=Pm,Qb=Mm,$b=Fm,ex=Im,tx=zm,nx=Rm,rx=Um,ix=Hm,ax=Vm,ox=Jd,sx=Fh(`Error`),cx=Fh(`Debug`),lx=E(e=>ky(e[0]),(e,...t)=>Bf(e,Hg,e=>{let n=t.length===1?{...e,...t[0]}:{...e};return t.length===1||Fi(n,t[0],t[1]),n})),ux=Cf,dx=wf,fx=Tf,px=bf,mx=Ef,hx=Xd,gx=Sd,_x=wd,vx=Td,yx=Ed,bx=Od,xx=md,Sx=Nm,Cx=`~effect/Chunk`;function wx(e,t,n,r,i){for(let a=t;a<Math.min(e.length,t+i);a++)n[r+a-t]=e[a];return n}var Tx=[],Ex=(e=>Di((t,n)=>{if(t.length!==n.length)return!1;let r=Mx(t),i=Mx(n);for(let t=0;t<r.length;t++)if(!e(r[t],i[t]))return!1;return!0}))(di),Dx={[Cx]:{_A:e=>e},toString(){return`Chunk(${Wi(Mx(this))})`},toJSON(){return{_id:`Chunk`,values:na(Mx(this))}},[ta](){return this.toJSON()},[ui](e){return kx(e)&&Ex(this,e)},[Gr](){return ri(Mx(this))},[Symbol.iterator](){switch(this.backing._tag){case`IArray`:return this.backing.array[Symbol.iterator]();case`IEmpty`:return Tx[Symbol.iterator]();default:return Mx(this)[Symbol.iterator]()}},pipe(){return T(this,arguments)}},Ox=e=>{let t=Object.create(Dx);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=Ax,t.right=Ax;break;case`ISingleton`:t.length=1,t.depth=0,t.left=Ax,t.right=Ax;break;case`ISlice`:t.length=e.length,t.depth=0,t.left=Ax,t.right=Ax}return t},kx=e=>O(e,Cx),Ax=Ox({_tag:`IEmpty`}),jx=(e,t,n)=>{switch(e.backing._tag){case`IArray`:wx(e.backing.array,0,t,n,e.length);break;case`IConcat`:jx(e.left,t,n),jx(e.right,t,n+e.left.length);break;case`ISingleton`:t[n]=e.backing.a;break;case`ISlice`:wx(Mx(e.backing.chunk),e.backing.offset,t,n,e.length)}},Mx=e=>{switch(e.backing._tag){case`IEmpty`:return Tx;case`IArray`:return e.backing.array;default:{let t=Array(e.length);return jx(e,t,0),e.backing={_tag:`IArray`,array:t},e.left=Ax,e.right=Ax,e.depth=0,t}}},Nx=qm,Px=Jm,Fx=`~effect/MutableRef`,Ix={[Fx]:Fx,...ba,toJSON(){return{_id:`MutableRef`,current:na(this.current)}}},Lx=e=>{let t=Object.create(Ix);return t.current=e,t},Rx=E(2,(e,t)=>(e.current=t,e)),zx=Symbol.for(`effect/MutableList/Empty`),Bx=()=>({head:void 0,tail:void 0,length:0}),Vx=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})},Hx=()=>({array:[],mutable:!0,offset:0,next:void 0}),Ux=(e,t)=>{e.tail?e.tail.mutable||(e.tail.next=Hx(),e.tail=e.tail.next):e.head=e.tail=Hx(),e.tail.array.push(t),e.length++},Wx=(e,t)=>{e.head={array:[t],mutable:!0,offset:0,next:e.head},e.tail||=e.head,e.length++},Gx=(e,t)=>Kx(e,Array.from(t),!0),Kx=(e,t,n=!1)=>{if(t.length===0)return 0;let r={array:t,mutable:n,offset:0,next:void 0};return e.head?e.tail=e.tail.next=r:e.head=e.tail=r,e.length+=t.length,t.length},qx=e=>{e.head=e.tail=void 0,e.length=0},Jx=(e,t)=>{if(t=Ni(t),t<=0||!e.head)return[];if(t=Math.min(t,e.length),t===e.length&&e.head?.offset===0&&!e.head.next){let t=e.head.array;return qx(e),t}let n=Array(t),r=0,i=e.head;for(;i;){for(;i.offset<i.array.length;)if(n[r++]=i.array[i.offset],i.mutable&&(i.array[i.offset]=void 0),i.offset++,r===t)return e.head=i.offset===i.array.length&&i.next?i.next:i,e.length-=t,e.length===0?qx(e):Vx(e),n;i=i.next}return qx(e),n},Yx=e=>Jx(e,e.length),Xx=e=>{if(!e.head)return zx;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:qx(e):Vx(e),t},Zx=(e,t)=>{let n=[],r=e.head,i=0;for(;r;){for(let e=r.offset;e<r.array.length;e++)t(r.array[e],i++)&&n.push(r.array[e]);r=r.next}n.length===0?qx(e):(e.head=e.tail={array:n,mutable:!0,offset:0,next:void 0},e.length=n.length)},Qx=(e,t)=>Zx(e,e=>e!==t),$x=`~effect/PubSub`,eS=`~effect/PubSub/Subscription`,tS=e=>B(()=>bS(e.atomicPubSub(),new Map,Kg(),Nx(!1),Lx(!1),e.strategy(),Lx(M()))),nS=e=>tS({atomicPubSub:()=>rS(e),strategy:()=>new xS}),rS=e=>{let t=e?.replay;return new gS(t&&t>0?new wS(Math.ceil(t)):void 0)},iS=e=>Rb(Wy(t=>(Rx(e.shutdownFlag,!0),Zg(e.scope,Cg(t.id)).pipe(qy(e.strategy.shutdown),gb(e.shutdownHook.open),Zy)))),aS=E(2,(e,t)=>z(()=>e.shutdownFlag.current||Go(e.ended.current)?R(!1):e.pubsub.publish(t)?(e.strategy.completeSubscribersUnsafe(e.pubsub,e.subscribers),R(!0)):e.strategy.handleSurplus(e.pubsub,e.subscribers,[t],e.shutdownFlag,e.ended))),oS=E(2,(e,t)=>e.shutdownFlag.current||Go(e.ended.current)?!1:e.pubsub.publish(t)?(e.strategy.completeSubscribersUnsafe(e.pubsub,e.subscribers),!0):!1),sS=e=>Rb(yb(t=>{let n=Pc(t,Gg),r=Xg(e.scope),i=hS(e.pubsub,e.subscribers,e.strategy,e.ended);return Yg(r,cS(i)).pipe(qy(Jg(n,e=>Zg(r,e))),Xy(i))})),cS=e=>Rb(Wy(t=>(Rx(e.shutdownFlag,!0),jy(Yx(e.pollers),e=>Ig(e,t.id),{discard:!0,concurrency:`unbounded`}).pipe(Jy(()=>B(()=>{e.subscribers.delete(e.subscription),e.subscription.unsubscribe(),e.replayWindow.close(),e.strategy.onPubSubEmptySpaceUnsafe(e.pubsub,e.subscribers)})),gb(e.shutdownHook.open),Zy)))),lS=e=>z(()=>{if(e.shutdownFlag.current)return Fb;if(e.replayWindow.remaining>0)return R(e.replayWindow.take());let t=e.pollers.length===0?e.subscription.poll():zx;return t===zx?dS(e):(e.strategy.onPubSubEmptySpaceUnsafe(e.pubsub,e.subscribers),R(t))}),uS=e=>z(function t(n){if(e.shutdownFlag.current)return Fb;let r=e.pollers.length===0?e.subscription.pollUpTo(1/0):[];return n&&(r=n.concat(r)),e.strategy.onPubSubEmptySpaceUnsafe(e.pubsub,e.subscribers),e.replayWindow.remaining>0?R(e.replayWindow.takeAll().concat(r)):Is(r)?R(r):U(dS(e),e=>t([e]))}),dS=e=>Iy(t=>{if(e.shutdownFlag.current)return t(Fb);if(Go(e.ended.current)){let n=e.pollers.length===0?e.subscription.poll():zx;return n===zx?t(R(e.ended.current.value)):(e.strategy.onPubSubEmptySpaceUnsafe(e.pubsub,e.subscribers),t(R(n)))}let n=Ag(),r=e.subscribers.get(e.subscription);return r||(r=new Set,e.subscribers.set(e.subscription,r)),r.add(e.pollers),Ux(e.pollers,n),e.strategy.completePollersUnsafe(e.pubsub,e.subscribers,e.subscription,e.pollers),n.effect?t(n.effect):(n.resumes=[t],B(()=>Qx(e.pollers,n)))}),fS=Symbol.for(`effect/PubSub/AbsentValue`),pS=(e,t,n)=>{e.has(t)||e.set(t,new Set),e.get(t).add(n)},mS=(e,t,n)=>{if(!e.has(t))return;let r=e.get(t);r.delete(n),r.size===0&&e.delete(t)},hS=(e,t,n,r)=>new vS(e,t,e.subscribe(),Bx(),Nx(!1),Lx(!1),n,e.replayWindow(),r),gS=class{publisherHead={value:fS,replayIndex:void 0,subscribers:0,next:null};publisherTail=this.publisherHead;publisherIndex=0;subscribersIndex=0;capacity=2**53-1;replayBuffer;constructor(e){this.replayBuffer=e}replayWindow(){return this.replayBuffer?new TS(this.replayBuffer):ES}isEmpty(){return this.publisherHead===this.publisherTail}isFull(){return!1}size(){return this.publisherIndex-this.subscribersIndex}publish(e){let t=this.replayBuffer?.offer(e),n=this.publisherTail.subscribers;if(n!==0){let r={value:e,replayIndex:t,subscribers:n,next:null};this.publisherTail.next=r,this.publisherTail=this.publisherTail.next,this.publisherIndex+=1}return!0}publishAll(e){if(this.publisherTail.subscribers!==0)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=fS,this.subscribersIndex+=1,this.replayBuffer?.slide(t,e.replayIndex)}}subscribe(){return this.publisherTail.subscribers+=1,new _S(this,this.publisherTail,this.publisherIndex,!1)}},_S=class{self;subscriberHead;subscriberIndex;unsubscribed;constructor(e,t,n,r){this.self=e,this.subscriberHead=t,this.subscriberIndex=n,this.unsubscribed=r}isEmpty(){if(this.unsubscribed)return!0;let e=!0,t=!0;for(;t;)this.subscriberHead===this.self.publisherTail?t=!1:this.subscriberHead.next.value===fS?(this.subscriberHead=this.subscriberHead.next,this.subscriberIndex+=1):(e=!1,t=!1);return e}size(){return this.unsubscribed?0:this.self.publisherIndex-Math.max(this.subscriberIndex,this.self.subscribersIndex)}poll(){if(this.unsubscribed)return zx;let e=!0,t=zx;for(;e;)if(this.subscriberHead===this.self.publisherTail)e=!1;else{let n=this.subscriberHead.next.value;n!==fS&&(t=n,--this.subscriberHead.subscribers,this.subscriberHead.subscribers===0&&(this.self.publisherHead=this.self.publisherHead.next,this.self.publisherHead.value=fS,this.self.subscribersIndex+=1),e=!1),this.subscriberHead=this.subscriberHead.next,this.subscriberIndex+=1}return t}pollUpTo(e){e=Ni(e);let t=[],n=0;for(;n!==e;){let r=this.poll();r===zx?n=e:(t.push(r),n+=1)}return t}unsubscribe(){if(!this.unsubscribed)for(this.unsubscribed=!0,--this.self.publisherTail.subscribers;this.subscriberHead!==this.self.publisherTail;)this.subscriberHead.next.value!==fS&&(--this.subscriberHead.subscribers,this.subscriberHead.subscribers===0&&(this.self.publisherHead=this.self.publisherHead.next,this.self.publisherHead.value=fS,this.self.subscribersIndex+=1)),this.subscriberHead=this.subscriberHead.next}},vS=class{[eS]={_A:D};pubsub;subscribers;subscription;pollers;shutdownHook;shutdownFlag;strategy;replayWindow;ended;constructor(e,t,n,r,i,a,o,s,c){this.pubsub=e,this.subscribers=t,this.subscription=n,this.pollers=r,this.shutdownHook=i,this.shutdownFlag=a,this.strategy=o,this.replayWindow=s,this.ended=c}pipe(){return T(this,arguments)}},yS=class{[$x]={_A:D};pubsub;subscribers;scope;shutdownHook;shutdownFlag;strategy;ended;constructor(e,t,n,r,i,a,o){this.pubsub=e,this.subscribers=t,this.scope=n,this.shutdownHook=r,this.shutdownFlag=i,this.strategy=a,this.ended=o}pipe(){return T(this,arguments)}},bS=(e,t,n,r,i,a,o)=>new yS(e,t,n,r,i,a,o),xS=class{get shutdown(){return V}handleSurplus(e,t,n,r){return R(!1)}onPubSubEmptySpaceUnsafe(e,t){}completePollersUnsafe(e,t,n,r){return SS(this,e,t,n,r)}completeSubscribersUnsafe(e,t){return CS(this,e,t)}},SS=(e,t,n,r,i)=>{let a=!0;for(;a&&!r.isEmpty();){let o=Xx(i);if(o===zx)mS(n,r,i),i.length===0?a=!1:pS(n,r,i);else{let a=r.poll();a===zx?Wx(i,o):(Bg(o,yg(a)),e.onPubSubEmptySpaceUnsafe(t,n))}}},CS=(e,t,n)=>{for(let[r,i]of n)for(let a of i)e.completePollersUnsafe(t,n,r,a)},wS=class{capacity;head={value:fS,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:fS,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=fS}else this.size+=1;return t}offerAll(e){for(let t of e)this.offer(t)}},TS=class{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(e===0||this.remaining===0)return;let t=Math.min(e,this.buffer.capacity),n=this.buffer.index-t;for(let e=0;e<t;e++){let t=this.buffer.slideValues[(n+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(this.remaining===0)return;this.sync();let e=this.values[this.index];return this.values[this.index]=fS,this.index=(this.index+1)%this.values.length,this.remaining--,this.remaining===0&&this.close(),e}takeN(e){e=Ni(e);let t=Math.min(e,this.remaining),n=Array(t);for(let e=0;e<t;e++)n[e]=this.take();return n}takeAll(){return this.takeN(this.remaining)}},ES={remaining:0,take:()=>void 0,takeN:()=>[],takeAll:()=>[],close:()=>void 0},DS=`~effect/Queue`,OS=`~effect/Queue/Enqueue`,kS=`~effect/Queue/Dequeue`,AS={_A:D,_E:D},jS={[DS]:AS,[OS]:AS,[kS]:AS,...ba,toJSON(){return{_id:`effect/Queue`,state:this.state._tag,size:qS(this)}}},MS=e=>j(t=>{let n=Object.create(jS);return n.dispatcher=t.currentDispatcher,n.capacity=e?.capacity??1/0,n.strategy=e?.strategy??`suspend`,n.messages=Bx(),n.scheduleRunning=!1,n.state={_tag:`Open`,takers:new Set,offers:new Set,awaiters:new Set},I(n)}),NS=e=>MS({capacity:e}),PS=E(2,(e,t)=>Md(()=>FS(e,t)?YS:e.state._tag===`Open`&&e.strategy===`suspend`?iC(e,t):JS)),FS=(e,t)=>e.state._tag===`Open`?e.messages.length>=e.capacity?e.strategy===`sliding`?(Xx(e.messages),Ux(e.messages,t),!0):e.capacity<=0&&e.state.takers.size>0&&(Ux(e.messages,t),QS(e),!0):(Ux(e.messages,t),$S(e),!0):!1,IS=E(2,(e,t)=>Wd(n=>{let r=LS(e,t);return r.length===0||e.strategy===`dropping`?n(Ya(r)):aC(e,{_tag:`Array`,remaining:r,offset:0,resume:n})})),LS=(e,t)=>{if(e.state._tag!==`Open`)return js(t);if(e.capacity===1/0||e.strategy===`sliding`)return Gx(e.messages,t),e.strategy===`sliding`&&Jx(e.messages,e.messages.length-e.capacity),$S(e),[];let n=e.capacity<=0?e.state.takers.size:e.capacity-e.messages.length;if(n===0)return js(t);let r=[],i=0;for(let a of t)i<n?Ux(e.messages,a):r.push(a),i++;return $S(e),r},RS=E(2,(e,t)=>jd(()=>zS(e,t))),zS=(e,t)=>{if(e.state._tag!==`Open`)return!1;let n=If(Qa(t),XS);return e.state.offers.size===0&&e.messages.length===0?(lC(e,n),!0):(e.state={...e.state,_tag:`Closing`,exit:n},$S(e),!0)},BS=e=>RS(e,Ra(lo())),VS=e=>jd(()=>HS(e)),HS=e=>{if(e.state._tag===`Done`)return!1;qx(e.messages);let t=e.state.offers;lC(e,e.state._tag===`Open`?ZS:e.state.exit);for(let e of t)oC(e);return!0},US=e=>WS(e,1,1/0),WS=E(3,(e,t,n)=>(t=Ni(t),n=Ni(n),tC(()=>eC(e,t,n)??ff(rC(e,()=>nC(e,t)),WS(e,t,n))))),GS=e=>tC(()=>KS(e)??ff(rC(e,()=>nC(e,1)),GS(e))),KS=e=>{if(e.state._tag===`Done`)return e.state.exit;if(e.messages.length>0){let t=Xx(e.messages);return cC(e),Ya(t)}if(e.capacity<=0&&e.state.offers.size>0){let t=sC(e.state.offers);return cC(e),Ya(t)}},qS=e=>e.state._tag===`Done`?0:e.messages.length,JS=Ya(!1),YS=Ya(!0),XS=$a(lo()),ZS=Df(),QS=e=>{if(e.state._tag!==`Done`&&e.state.takers.size!==0){for(let t of e.state.takers)if(t.ready()&&(e.state.takers.delete(t),t.resume(Mf),e.messages.length===0))break}},$S=e=>{e.scheduleRunning||e.state._tag===`Done`||e.state.takers.size===0||(e.scheduleRunning=!0,e.dispatcher.scheduleTask(()=>{e.scheduleRunning=!1,QS(e)},0))},eC=(e,t,n)=>{if(e.state._tag===`Done`)return e.state.exit;if(n<=0||t<=0)return Ya([]);if(!nC(e,t))return;let r=e.messages.length>0?Jx(e.messages,n):[sC(e.state.offers)];return cC(e),Ya(r)},tC=qa({op:`QueueTake`,[ha](e){let t=this[A]();return Ca(t)?t[ha](e):t}}),nC=(e,t)=>e.messages.length>=(e.state._tag===`Closing`?1:Math.min(t,e.capacity||1))||e.capacity<=0&&e.state._tag!==`Done`&&e.state.offers.size>0,rC=(e,t)=>Wd(n=>{if(e.state._tag===`Done`)return n(e.state.exit);if(t())return n(Mf);let r={ready:t,resume:n};return e.state.takers.add(r),jd(()=>{e.state._tag!==`Done`&&e.state.takers.delete(r)})}),iC=(e,t)=>Wd(n=>FS(e,t)?n(YS):aC(e,{_tag:`Single`,message:t,resume:n})),aC=(e,t)=>{if(e.state._tag!==`Open`)return oC(t);let n=e.state.offers;return n.add(t),jd(()=>{e.state._tag!==`Done`&&(n.delete(t),e.state._tag===`Closing`&&n.size===0&&e.messages.length===0&&lC(e,e.state.exit))})},oC=e=>e._tag===`Single`?e.resume(JS):e.resume(Ya(e.remaining.slice(e.offset))),sC=e=>{let t=e.values().next().value;if(t._tag===`Single`)return e.delete(t),t.resume(YS),t.message;let n=t.remaining[t.offset++];return t.offset===t.remaining.length&&(e.delete(t),t.resume(Ya([]))),n},cC=e=>{if(e.state._tag===`Done`)return Hv(e.state.exit.cause);if(e.state.offers.size===0)return e.state._tag===`Closing`&&e.messages.length===0&&(lC(e,e.state.exit),Hv(e.state.exit.cause));for(let t of e.state.offers){let n=e.capacity-e.messages.length;if(n<=0)break;if(t._tag===`Single`)Ux(e.messages,t.message),e.state.offers.delete(t),t.resume(YS);else{for(;t.offset<t.remaining.length;t.offset++){if(n===0)return!1;Ux(e.messages,t.remaining[t.offset]),n--}e.state.offers.delete(t),t.resume(Ya([]))}let r=e.state;if(r._tag===`Done`)return Hv(r.exit.cause)}return!1},lC=(e,t)=>{if(e.state._tag===`Done`)return;let n=e.state;e.state={_tag:`Done`,exit:t};for(let e of n.takers)e.resume(t);n.takers.clear();for(let e of n.awaiters)e(t);n.awaiters.clear()},uC=e=>new pC(e),dC=e=>{for(let t of e.waiters)if(t.permits<=e.free)return t},fC=(e,t,n,r=D)=>j(i=>{if(e.free>=t&&dC(e)===void 0)return e.taken+=t,n();let a={permits:t,resume:void 0},o=()=>{e.waiters.delete(a)&&e.releaseUnsafe(i,0)};e.waiters.add(a),Qp(i,o);let s=L(r(Wd(t=>{dC(e)===a?t(Rd):a.resume=t})),()=>dC(e)===a?(e.taken+=t,o(),n()):s);return s}),pC=class{waiters=new Set;taken=0;permits;constructor(e){this.permits=e}get free(){return this.permits-this.taken}take(e){return fC(this,e,()=>I(e))}takeScoped(e){return gm(t=>L(Wp,n=>fC(this,e,()=>Rp(n,this.release(e)),t)))}takeIfAvailable(e){return Md(()=>this.free<e?I(!1):(this.taken+=e,I(!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 n=t.resume;t.resume=void 0,n?.(Rd)}},0),this.free}resize(e){return j(t=>(this.permits=e,this.free<0||this.releaseUnsafe(t,0),Rd))}release(e){return j(t=>I(this.releaseUnsafe(t,e)))}get releaseAll(){return j(e=>I(this.releaseUnsafe(e,this.taken)))}withPermits(e){return t=>gm(n=>fC(this,e,()=>Zp(n(t),()=>{this.releaseUnsafe(md(),e)},!0),n))}withPermit=this.withPermits(1);withPermitsIfAvailable(e){return t=>gm(n=>this.free<e?Fd:(this.taken+=e,Zp(n(df(t)),()=>{this.releaseUnsafe(md(),e)},!0)))}},mC=e=>vg(e)?Tg(e)?dg(e.value):e:R(e),hC=`~effect/Channel`,gC=e=>O(e,hC),_C={[hC]:{_Env:D,_InErr:D,_InElem:D,_OutErr:D,_OutElem:D},pipe(){return T(this,arguments)}},vC=e=>{let t=Object.create(_C);return t.transform=(t,n)=>$y(e(t,n),e=>R(zy(e))),t},yC=(e,t)=>vC((n,r)=>U(SC(e)(n,r),e=>t(e,r))),bC=e=>vC((t,n)=>e),xC=e=>vC(ox(function*(t,n){let r=Xg(n),i=e=>Zg(r,Kv(e));return jb(yield*jb(e(t,n,r),i),i)})),SC=e=>e.transform,CC=(e,t,n)=>MS({capacity:n?.bufferSize,strategy:n?.strategy}).pipe(Jy(t=>Yg(e,VS(t))),Jy(n=>qg(t(n),e).pipe($y(e=>RS(n,e)),Jb(e,{startImmediately:!0})))),wC=(e,t)=>vC((n,r)=>W(CC(r,e,t),US)),TC=e=>vC((t,n)=>z(()=>SC(e())(t,n))),EC=e=>bC(B(()=>{let t=e();return z(()=>{let e=t.next();return e.done?dg(e.value):R(e.value)})})),DC=e=>NC(R(e)),OC=bC(R(dg())),kC=bC(R(Ly)),AC=e=>bC(R(H(e))),jC=e=>bC(zy(e)),MC=e=>jC(Yh(e)),NC=e=>bC(B(()=>{let t=!1;return z(()=>t?dg():(t=!0,e))})),PC=e=>bC(R(U(e,mC))),FC=e=>bC(R(US(e))),IC=e=>bC(R(Lb(uS(e),()=>dg()))),LC=e=>aw(W(sS(e),IC)),RC=e=>vC((t,n)=>zC({scope:n,readable:e.evaluate(),onError:e.onError,releaseLockOnEnd:e.releaseLockOnEnd})),zC=e=>{let t=e.readable.getReader(),n=e.exit??Lx(void 0),r=z(()=>n.current?n.current:_b(Py({try:()=>t.read(),catch:e.onError}),{onFailure:e=>n.current??zy(e),onSuccess:({done:e,value:t})=>n.current?n.current:e?dg():R(Ys(t))}));return Xy(Yg(e.scope,e.releaseLockOnEnd?B(()=>t.releaseLock()):Ny(()=>t.cancel().catch(e=>t.closed.then(()=>Promise.reject(e),hr))).pipe(Ab(B(()=>t.releaseLock())))),r)},BC=E(2,(e,t)=>yC(e,e=>B(()=>{let n=0;return W(e,e=>t(e,n++))}))),VC=e=>e===void 0||e!==`unbounded`&&e<=1,HC=E(e=>gC(e[0]),(e,t,n)=>VC(n?.concurrency)?UC(e,t):WC(e,t,n)),UC=(e,t)=>vC((n,r)=>{let i=0;return W(SC(e)(n,r),U(e=>t(e,i++)))}),WC=(e,t,n)=>xC(ox(function*(r,i,a){let o=0,s=yield*SC(e)(r,i),c=n.concurrency===`unbounded`?2**53-1:Math.min(n.concurrency,2**53-1),l=yield*NS(0);yield*Yg(a,VS(l));let u=Qb(yield*vb()),d=Sx(a);if(n.unordered){let e=uC(c),n=dr(e.release(1)),r=_b({onFailure:e=>U(RS(l,e),n),onSuccess:e=>U(PS(l,e),n)});yield*e.take(1).pipe(U(()=>s),U(e=>{let n=o++;return d(u(r(z(()=>t(e,n))))),V}),Bb({disableYield:!0}),$y(t=>e.withPermits(c-1)(RS(l,t))),Jb(a))}else{let e=yield*NS(c-2);yield*Yg(a,VS(e)),yield*GS(e).pipe(Ky,U(e=>PS(l,e)),Bb({disableYield:!0}),$y(e=>RS(l,e)),Jb(a));let n,r=e=>{e._tag!==`Success`&&(n=e.cause,zS(l,e.cause))};yield*s.pipe(U(i=>{if(n)return zy(n);let a=o++,s=u(z(()=>t(i,a)));return d(s),s.addObserver(r),PS(e,_x(s))}),Bb({disableYield:!0}),$y(t=>PS(e,bg(t)).pipe(qy(RS(e,t)))),Jb(a))}return GS(l)})),GC=E(e=>gC(e[0]),(e,t,n)=>VC(n?.concurrency)?KC(e,t):qC(e,t,n)),KC=(e,t)=>vC((n,r)=>W(SC(e)(n,r),e=>{let i,a,o=U(e,e=>(a??=Xg(r),px(SC(t(e))(n,a),e=>(i=s(e),i)))),s=Vv(e=>{if(i=void 0,a.state._tag===`Empty`)return o;let t=Zg(a,wg);return a=void 0,U(t,()=>o)});return z(()=>i??o)})),qC=(e,t,n)=>e.pipe(BC(t),rw(n)),JC=e=>GC(e,D),YC=e=>yC(e,e=>{let t,n=0;return R(z(function r(){if(t===void 0)return U(e,e=>{switch(e.length){case 0:return r();case 1:return R(e[0]);default:return t=e,R(e[n++])}});let i=t[n++];return n>=t.length&&(t=void 0,n=0),R(i)}))}),XC=(e,t)=>vC((n,r)=>B(()=>{let i,a=()=>{let o=Xg(r);return U(SC(e)(n,o),e=>(i=$y(e,e=>{let n=Kv(e);return Zg(o,n).pipe(U(()=>t(n,r)),U(a))}),i))};return z(()=>i??a())})),ZC=E(2,(e,t)=>yC(e,e=>R(U(e,function n(r){let i=[];for(let e=0;e<r.length;e++)t(r[e])&&i.push(r[e]);return Ls(i)?R(i):U(e,n)})))),QC=E(2,(e,t)=>vC((n,r)=>{let i=Xg(r);return W(SC(e)(n,i),e=>{let a=e.pipe($y(e=>{if(Hv(e))return zy(e);let o=i;return i=Xg(r),Zg(o,bg(e)).pipe(qy(SC(t(e))(n,i)),U(e=>(a=e,e)))}));return z(()=>a)})})),$C=E(3,(e,t,n)=>QC(e,e=>{let r=t(e);return us(r)?jC(r.failure):n(r.success,e)})),ew=E(2,(e,t)=>$C(e,Uu,e=>t(e))),tw=E(e=>gC(e[0]),(e,t,n,r)=>ew(e,e=>t(e)?n(e):r?r(e):AC(e))),nw=E(2,(e,t)=>TC(()=>{let n,r=Yv.defaultValue(),i=lw(hw(e,Yv,B(()=>r)),()=>(n=void 0,V)),a=typeof t==`function`?t(D):t;return XC(i,(e,t)=>{if(Tg(e))return dg(e.value);let i=Uu(e.cause);return us(i)?zy(i.failure):Ry(function*(){n||=yield*ny(a),r=yield*n(i.success)}).pipe(Vv(()=>H(i.success)),qg(t))})})),rw=E(2,(e,{bufferSize:t=16,concurrency:n,switch:r=!1})=>xC(ox(function*(i,a,o){let s=n===`unbounded`?2**53-1:Math.max(1,n),c=r?void 0:uC(s),l=yield*Px(!0),u=new Map,d=yield*NS(t);yield*Yg(o,VS(d));let f=yield*SC(e)(i,a);return yield*Ry(function*(){for(;;){let e;c&&(u.size<s?yield*c.take(1):(e=yield*qb(f),yield*hb(c.take(1),qy(_x(e),Ly))));let t=e===void 0?yield*f:yield*_x(e),n=Xg(o),r=yield*SC(t)(i,n);for(;u.size>=s;){let[e,t]=gs(u);u.delete(e),u.size===0&&(yield*l.open),yield*yx(e),yield*cb(Zg(t,Cg()))}let a=yield*r.pipe(Jy(()=>Uy),U(e=>PS(d,e)),Bb({disableYield:!0}),jb(ox(function*(e){let t=Kv(e),r=yield*Yy(Zg(n,t));if(!u.has(a))return;let i=Dg([t,r]);Eg(i)&&(yield*RS(d,i.cause)),u.delete(a),c&&(yield*c.release(1)),u.size===0&&(yield*l.open)})),qb);l.closeUnsafe(),u.set(a,n)}}).pipe($y(e=>ds(Wv(e))?l.whenOpen(RS(d,e)):RS(d,e)),Jb(o)),GS(d)}))),iw=E(e=>gC(e[0])&&gC(e[1]),(e,t,n)=>xC(ox(function*(r,i,a){let o=n?.haltStrategy??`both`,s=yield*NS(0);yield*Yg(a,VS(s));let c=0;function l(e,t){if(c++,!Hv(t))return RS(s,t);switch(o){case`both`:return c===2?RS(s,t):V;case`left`:case`right`:return e===o?RS(s,t):V;case`either`:return RS(s,t)}}let u=(e,t,n)=>SC(t)(r,n).pipe(U(e=>e.pipe(U(e=>PS(s,e)),Bb)),jb(t=>Mb(Kv(t),e=>Zg(n,e)).pipe(_b({onFailure:t=>l(e,t),onSuccess:()=>l(e,t)}))),Jb(a));return yield*u(`left`,e,Xg(a)),yield*u(`right`,t,Xg(a)),GS(s)}))),aw=e=>vC((t,n)=>{let r;return R(z(()=>r||e.pipe(qg(n),U(e=>SC(e)(t,n)),U(e=>r=e))))}),ow=E(2,(e,t)=>iw(e,bC(R(U(t,dg))),{haltStrategy:`either`})),sw=E(2,(e,t)=>xC((n,r,i)=>Jg(i,t).pipe(qy(SC(e)(n,r))))),cw=E(2,(e,t)=>aw(Xy(t,e))),lw=E(2,(e,t)=>yC(e,e=>B(()=>{let n=!0,r=Jy(e,e=>(n=!1,t(e)));return z(()=>n?r:e)}))),uw=E(2,(e,t)=>yC(e,e=>R(Vv(e,e=>U(t,()=>dg(e)))))),dw=E(2,(e,t)=>sw(e,e=>t)),fw=(e,t,n)=>z(()=>{let r=Kg();return Vv(U(SC(e)(dg(),r),t),n||R).pipe(Nb(e=>Zg(r,e)))}),pw=E(2,(e,t)=>vC((n,r)=>W(xb(SC(e)(n,r),t),xb(t)))),mw=E(3,(e,t,n)=>vC((r,i)=>W(wb(SC(e)(r,i),t,n),wb(t,n)))),hw=E(3,(e,t,n)=>vC((r,i)=>U(n,n=>SC(mw(e,t,n))(r,i)))),gw=E(2,(e,t)=>fw(e,e=>Bb(U(e,t),{disableYield:!0}))),_w=e=>W(vw(e,()=>({bytes:0,arrays:[]}),(e,t)=>{for(let n=0;n<t.length;n++)e.bytes+=t[n].length,e.arrays.push(t[n]);return e}),({arrays:e,bytes:t})=>{let n=new Uint8Array(t),r=0;for(let t=0;t<e.length;t++){let i=e[t];n.set(i,r),r+=i.length}return n}),vw=E(3,(e,t,n)=>z(()=>{let r=t();return fw(e,e=>My({while:fr,body:()=>e,step:e=>{r=n(r,e)}}),()=>R(r))})),yw=ox(function*(e){let t=uC(1),n=yield*vb(),r=Pc(n,Gg);return(yield*SC(e)(dg(),r)).pipe(xb(n),t.withPermits(1))},$y(e=>R(zy(e)))),bw=(e,t)=>SC(e)(dg(),t),xw=`~effect/Stream`,Sw={_R:D,_E:D,_A:D},Cw=function(e){this.channel=e};Cw.prototype={[xw]:Sw,pipe(){return T(this,arguments)}};var ww=e=>new Cw(e),Tw=`~effect/Stream`,Ew=e=>O(e,Tw),Dw=ww,Ow=e=>kw(B(()=>{let t=!0,n=R(Ys(void 0)),r=fb(n,e);return z(()=>t?(t=!1,n):r)})),kw=e=>Dw(bC(e)),Aw=e=>e.channel,jw=(e,t)=>Dw(wC(e,t)),Mw=Dw(OC),Nw=e=>Dw(DC(Ys(e))),Pw=(...e)=>zw(e),Fw=e=>{let t=Dw(TC(()=>e().channel));return Iw.set(t,e),t},Iw=new WeakMap,Lw=e=>Dw(AC(e)),Rw=e=>Dw(MC(e)),zw=e=>Ls(e)?Dw(DC(e)):Mw,Bw=e=>Dw(FC(e)),Vw=e=>Dw(LC(e)),Hw=e=>Dw(RC(e)),Uw=Dw(kC),Ww=e=>Dw(aw(W(e,Aw))),Gw=E(2,(e,t)=>Fw(()=>{let n=0;return Dw(BC(e.channel,Xs(e=>t(e,n++))))})),Kw=E(e=>Ew(e[0]),(e,t,n)=>e.channel.pipe(YC,HC(t,n),BC(Ys),Dw)),qw=E(e=>Ew(e[0]),(e,t,n)=>Kw(e,e=>Xy(t(e),e),n)),Jw=E(2,(e,t)=>{let n=Dw(JC(EC(()=>Xw(e,t))));return Yw.set(n,[e,t]),n}),Yw=new WeakMap;function*Xw(e,t){let n=[t,e];for(;n.length>0;){let e=n.pop(),t=Yw.get(e);if(t!==void 0){n.push(t[1],t[0]);continue}let r=Iw.get(e);if(r===void 0)yield e.channel;else{try{n.push(r())}catch(e){n.push(Rw(e))}yield OC}}}var Zw=E(2,(e,t)=>Dw(ZC(Aw(e),t))),Qw=E(e=>Ew(e[0]),(e,t,n,r)=>Dw(tw(Aw(e),t,e=>n(e).channel,r&&(e=>r(e).channel)))),$w=E(e=>Ew(e[0]),(e,t,n,r)=>Qw(e,Array.isArray(t)?e=>O(e,`_tag`)&&t.includes(e._tag):Vr(t),n,r)),eT=E(2,(e,t)=>Dw(nw(e.channel,t))),tT=E(2,(e,t)=>Dw(ow(e.channel,t))),nT=E(2,(e,t)=>Dw(cw(e.channel,t))),rT=E(2,(e,t)=>Dw(uw(e.channel,t))),iT=E(2,(e,t)=>Dw(dw(e.channel,t))),aT=E(2,(e,t)=>Dw(pw(e.channel,t))),oT=E(2,(e,t)=>gw(e.channel,e=>{let n=0;return My({while:()=>n<e.length,body:()=>t(e[n++]),step:hr})})),sT=E(2,(e,t)=>gw(e.channel,t)),cT=e=>yw(e.channel),lT=e=>W(_w(e.channel),e=>e.buffer),uT=E(e=>Ew(e[0]),(e,t,n)=>{let r,i,a=!1,o=Nx(!1),s=n?.signal,c=()=>i.interruptUnsafe();return new ReadableStream({start(n){i=Zb(xb(gw(yC(e.channel,e=>R(o.whenOpen(e))),e=>B(()=>{o.closeUnsafe();for(let t=0;t<e.length;t++)n.enqueue(e[t]);r(),r=void 0})),t)),i.addObserver(e=>{s?.removeEventListener(`abort`,c),!a&&(e._tag===`Failure`&&s?.aborted!==!0?n.error(ng(e.cause)):n.close())}),s!==void 0&&i.pollUnsafe()===void 0&&(s.aborted?c():s.addEventListener(`abort`,c,{once:!0}))},pull(){return new Promise(e=>{r=e,o.openUnsafe()})},cancel(){if(i)return a=!0,tx(Zy(yx(i)))}},n?.strategy)}),dT=E(e=>Ew(e[0]),(e,t)=>uT(e,Ec(),t)),fT=E(e=>Ew(e[0]),(e,t)=>W(vb(),n=>uT(e,n,t))),pT=e(r(),1);function mT(e){return{_tag:`Value`,value:e}}function hT(e,t){return{_tag:`Record`,keys:e,value:t}}function gT(e,t){return{_tag:`Array`,length:e,value:t}}var _T=P(`effect/ConfigProvider`,{defaultValue:()=>TT()}),vT={...ba,toJSON(){return{_id:`ConfigProvider`}}},yT=e=>e;function bT(e,t){let n=Object.create(vT);return n.load=e,n.mapInput=t,n}function xT(e,t){return bT(n=>e(t(n)),n=>xT(e,e=>n(t(e))))}function ST(e){return xT(e,yT)}function CT(e,t){return e===``&&!t?void 0:e}function wT(e,t){let n=t?.preserveEmptyStrings===!0,r=ET(e);return ST(t=>R(DT(r,e,t,n)))}function TT(e){return wT(e?.env??{BASE_URL:`/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,TSS_INLINE_CSS_ENABLED:`false`},{preserveEmptyStrings:e?.preserveEmptyStrings})}function ET(e){let t={};for(let[n,r]of Object.entries(e)){if(r===void 0)continue;let e=n.split(`_`),i=t;for(let t of e){let e=i.children??=Object.create(null);i=e[t]??={}}}return t}function DT(e,t,n,r){let i=n.map(String).join(`_`),a=CT(Object.hasOwn(t,i)?t[i]:void 0,r),o=OT(e,n),s=o?.children?Object.keys(o.children):[];return s.length===0?a===void 0?void 0:mT(a):s.every(Rs)?gT(Math.max(...s.map(e=>parseInt(e,10)))+1,a):hT(new Set(s),a)}function OT(e,t){if(t.length===0)return e;let n=e;for(let e of t)if(n=n?.children?.[String(e)],!n)return;return n}var kT=`~effect/BigDecimal`,AT={[kT]:kT,[Gr](){let e=RT(this);return Jr($r(String(e.value)),Qr(e.scale))},[ui](e){return jT(e)&&WT(this,e)===0},toString(){return`BigDecimal(${KT(this)})`},toJSON(){return{_id:`BigDecimal`,value:String(this.value),scale:this.scale}},[ta](){return this.toJSON()},pipe(){return T(this,arguments)}},jT=e=>O(e,kT),MT=(e,t)=>{if(!Number.isSafeInteger(t))throw RangeError(`Scale must be a safe integer, got ${t}`);let n=Object.create(AT);return n.value=e,n.scale=t,n},NT=(e,t)=>{let n=MT(e,t);return n.normalized=n,n},PT=BigInt(0),FT=BigInt(1),IT=BigInt(10),LT=NT(PT,0),RT=e=>{if(e.normalized===void 0){if(e.value===PT)e.normalized=LT;else{let t=`${e.value}`,n=zT(t);e.normalized=NT(BigInt(t.slice(0,t.length-n)),e.scale-n)}}return e.normalized},zT=e=>{let t=e.length;for(;e[t-1]===`0`;)t--;return e.length-t},BT=100,VT=[FT],HT=(e,t)=>e===t?0:e<t?-1:1,UT=(e,t)=>{let n=`${e.value<PT?-e.value:e.value}`,r=`${t.value<PT?-t.value:t.value}`,i=BigInt(n.length-r.length)-BigInt(e.scale)+BigInt(t.scale);if(i!==PT)return i<PT?-1:1;let a=Math.max(n.length,r.length);return Io(n.padEnd(a,`0`),r.padEnd(a,`0`))},WT=(e,t)=>{if(e.scale===t.scale)return HT(e.value,t.value);let n=GT(e),r=GT(t);if(n!==r)return n<r?-1:1;if(n===0)return 0;let i=e.scale-t.scale,a=Math.abs(i);if(a>BT)return n===-1?UT(t,e):UT(e,t);let o=VT[a]??=IT**BigInt(a);return i>0?HT(e.value,t.value*o):HT(e.value*o,t.value)},GT=e=>e.value===PT?0:e.value<PT?-1:1,KT=e=>{let t=RT(e);if(Math.abs(t.scale)>=16)return qT(t);let n=t.value<PT,r=`${n?-t.value:t.value}`,i=t.scale>0?r.padStart(t.scale+1,`0`):r.padEnd(r.length-t.scale,`0`),a=i.length-t.scale,o=t.scale>0?`${i.slice(0,a)}.${i.slice(a)}`:i;return n?`-${o}`:o},qT=e=>{if(JT(e))return`0e+0`;let t=RT(e),n=`${t.value}`,r=t.value<PT?2:1,i=n.slice(0,r),a=n.slice(r),o=a.length-t.scale;return`${i}${a===``?``:`.${a}`}e${o>=0?`+`:``}${o}`},JT=e=>e.value===PT,YT=e=>ZT(typeof e==`string`?eE.encode(e):e),XT=e=>{let t=nE(e),n=t.length;if(n%4!=0)return ss(new ou({kind:`Decode`,module:`Base64`,input:t,message:`Length must be a multiple of 4, but is ${n}`}));let r=t.indexOf(`=`);if(r!==-1&&(r<n-2||r===n-2&&t[n-1]!==`=`))return ss(new ou({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(`=`),r=new Uint8Array(n/4*3-e);for(let e=0,i=0;e<n;e+=4,i+=3){let n=sE(t.charCodeAt(e))<<18|sE(t.charCodeAt(e+1))<<12|sE(t.charCodeAt(e+2))<<6|sE(t.charCodeAt(e+3));r[i]=n>>16,r[i+1]=n>>8&255,r[i+2]=n&255}return os(r)}catch(e){return ss(new ou({kind:`Decode`,module:`Base64`,input:t,message:e instanceof Error?e.message:`Invalid input`}))}},ZT=e=>{let t=e.length,n=Uint8Array.prototype.toBase64;return t>=32&&typeof n==`function`?n.call(e):t<128?QT(e):$T(e)},QT=e=>{let t=e.length,n=``,r=2;for(;r<t;r+=3)n+=rE[e[r-2]>>2],n+=rE[(e[r-2]&3)<<4|e[r-1]>>4],n+=rE[(e[r-1]&15)<<2|e[r]>>6],n+=rE[e[r]&63];return r===t+1&&(n+=rE[e[r-2]>>2],n+=rE[(e[r-2]&3)<<4],n+=`==`),r===t&&(n+=rE[e[r-2]>>2],n+=rE[(e[r-2]&3)<<4|e[r-1]>>4],n+=rE[(e[r-1]&15)<<2],n+=`=`),n},$T=e=>{let t=e.length,n=new Uint8Array(Math.ceil(t/3)*4),r,i=0;for(r=2;r<t;r+=3,i+=4)n[i]=iE[e[r-2]>>2],n[i+1]=iE[(e[r-2]&3)<<4|e[r-1]>>4],n[i+2]=iE[(e[r-1]&15)<<2|e[r]>>6],n[i+3]=iE[e[r]&63];return r===t+1&&(n[i]=iE[e[r-2]>>2],n[i+1]=iE[(e[r-2]&3)<<4],n[i+2]=aE,n[i+3]=aE),r===t&&(n[i]=iE[e[r-2]>>2],n[i+1]=iE[(e[r-2]&3)<<4|e[r-1]>>4],n[i+2]=iE[(e[r-1]&15)<<2],n[i+3]=aE),tE.decode(n)},eE=new TextEncoder,tE=new TextDecoder,nE=e=>e.replace(/[\n\r]/g,``),rE=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,iE=eE.encode(rE),aE=61,oE=new Uint8Array(123).fill(255);for(let e=0;e<64;e++)oE[rE.charCodeAt(e)]=e;oE[61]=0;var sE=e=>{if(e>=oE.length||oE[e]===255)throw TypeError(`Invalid character ${String.fromCharCode(e)}`);return oE[e]},cE=U_,lE=Y_,uE=$_,dE=cv,fE=mv,pE=xv,mE=`~effect/HashMap`,hE=e=>O(e,mE),gE=`~effect/HashSet`,_E=e=>O(e,gE),vE=`~effect/http/Cookies`,yE=`~effect/http/Cookies/Cookie`,bE={[vE]:vE,...ia,toJSON(){return{_id:`effect/Cookies`,cookies:Cs(this.cookies,e=>e.toJSON())}},pipe(){return T(this,arguments)}},xE=e=>{let t=Object.create(bE);return t.cookies=e,t},SE=e=>{let t={};for(let n of e)Fi(t,n.name,n);return xE(t)},CE=e=>{let t=typeof e==`string`?[e]:e,n=[];for(let e of t){let t=wE(e.trim());t&&n.push(t)}return SE(n)};function wE(e){let t=e.split(`;`).map(e=>e.trim()).filter(e=>e!==``);if(t.length===0)return;let n=t[0].indexOf(`=`);if(n===-1)return;let r=t[0].slice(0,n).replace(EE,``);if(!TE.test(r))return;let i=t[0].slice(n+1).replace(EE,``),a=kE(i);if(t.length===1)return Object.assign(Object.create(OE),{name:r,value:a,valueEncoded:i});let o={};for(let e=1;e<t.length;e++){let n=t[e],r=n.indexOf(`=`),i=r===-1?n:n.slice(0,r).trim(),a=r===-1?void 0:n.slice(r+1).trim();switch(i.toLowerCase()){case`domain`:{if(a===void 0)break;let e=a.trim().replace(/^\./,``);e&&(o.domain=e);break}case`expires`:{if(a===void 0)break;let e=new Date(a);isNaN(e.getTime())||(o.expires=e);break}case`max-age`:if(a===void 0||!DE.test(a))break;o.maxAge=kl(parseInt(a,10));break;case`path`:if(a===void 0)break;a[0]===`/`&&(o.path=a);break;case`priority`:if(a===void 0)break;switch(a.toLowerCase()){case`low`:o.priority=`low`;break;case`medium`:o.priority=`medium`;break;case`high`:o.priority=`high`}break;case`httponly`:o.httpOnly=!0;break;case`secure`:o.secure=!0;break;case`partitioned`:o.partitioned=!0;break;case`samesite`:if(a===void 0)break;switch(a.toLowerCase()){case`lax`:o.sameSite=`lax`;break;case`strict`:o.sameSite=`strict`;break;case`none`:o.sameSite=`none`}}}return Object.assign(Object.create(OE),{name:r,value:a,valueEncoded:i,options:Object.keys(o).length>0?o:void 0})}var TE=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,EE=/^[\t ]+|[\t ]+$/g,DE=/^-?[0-9]+$/,OE={[yE]:yE,...ia,toJSON(){return{_id:`effect/Cookies/Cookie`,name:this.name,value:this.value,options:this.options}}},kE=e=>{try{return decodeURIComponent(e)}catch{return e}},AE=new WeakMap,jE=e=>{if(AE.has(e))return AE.get(e);throw Error(`Unable to get redacted value`+(e.label?` with label: "${e.label}"`:``))},ME=`~effect/Redacted`,NE=e=>O(e,ME),PE=(e,t)=>{let n=Object.create(FE);return t?.label&&(n.label=t.label),AE.set(n,e),n},FE={[ME]:{_A:e=>e},label:void 0,...ba,toJSON(){return this.toString()},toString(){return`<redacted${Dr(this.label)?`:`+this.label:``}>`},[Gr](){return k(AE.get(this))},[ui](e){return NE(e)&&di(AE.get(this),AE.get(e))}},IE=jE,LE=Symbol.for(`~effect/http/Headers`),RE=Object.defineProperties(Object.create(null),{[LE]:{value:LE},[Li]:{value(e){return JE(this,Pc(e,XE))}},toJSON:{value(){return zi(this)}},[ui]:{value(e){return BE(this,e)}},[Gr]:{value(){return ti(this)}},toString:{value:ia.toString},[ta]:{value:ia[ta]}}),zE=e=>Object.assign(Object.create(RE),e),BE=Ds(ki()),VE=Object.create(RE),HE=e=>{if(e===void 0)return VE;if(Symbol.iterator in e){let t=Object.create(RE);for(let[n,r]of e)t[n.toLowerCase()]=r;return t}let t=Object.create(RE);for(let[n,r]of Object.entries(e))Array.isArray(r)?t[n.toLowerCase()]=r.join(`, `):r!==void 0&&(t[n.toLowerCase()]=r);return t},UE=e=>Object.setPrototypeOf(e,RE),WE=E(3,(e,t,n)=>{let r=zE(e);return r[t.toLowerCase()]=n,r}),GE=E(2,(e,t)=>zE({...e,...HE(t)})),KE=E(2,(e,t)=>{let n=zE(e);return Object.assign(n,t),n}),qE=E(2,(e,t)=>{let n=zE(e);return delete n[t.toLowerCase()],n}),JE=E(2,(e,t)=>{let n={...e},r=t=>{if(typeof t==`string`){let r=t.toLowerCase();r in e&&(n[r]=PE(e[r]))}else for(let r in e)r.search(t)!==-1&&(n[r]=PE(e[r]))};if(Array.isArray(t))for(let e=0;e<t.length;e++)r(t[e]);else r(t);return n}),YE=(e,t)=>{let n=e.toLowerCase();for(let r=0;r<t.length;r++){let i=t[r];if(typeof i==`string`){if(i.toLowerCase()===n)return!0}else if(e.search(i)!==-1)return!0}return!1},XE=P(`effect/Headers/CurrentRedactedNames`,{defaultValue:()=>[`authorization`,`cookie`,`set-cookie`,`x-api-key`]}),ZE=`~effect/http/Headers/HeaderParseError`,QE=class extends ru{},$E=class e extends iu(`HeaderParseError`){static fromReason(t,n){return new e({reason:new QE({_tag:t,input:n})})}[ZE]=ZE;get message(){return`${this.reason._tag}: ${JSON.stringify(this.reason.input)}`}},eD=[`jan`,`feb`,`mar`,`apr`,`may`,`jun`,`jul`,`aug`,`sep`,`oct`,`nov`,`dec`],tD=[/^(?: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],nD=e=>{for(let t of tD){let n=t.exec(e)?.groups;if(n===void 0)continue;let r=eD.indexOf(n.month.toLowerCase()),i=Number(n.hour),a=Number(n.minute),o=Number(n.second);if(r===-1||i>23||a>59||o>60)return;let s=Number(n.year);n.year.length===2&&(s+=s<70?2e3:1900);let c=Number(n.day),l=new Date(0);return l.setUTCFullYear(s,r,c),l.getUTCFullYear()!==s||l.getUTCMonth()!==r||l.getUTCDate()!==c?void 0:l.getTime()+((i*60+a)*60+o)*1e3}},rD=e=>({_tag:`DateTime`,dateTime:e}),iD=/^\d+$/,aD=BigInt(1e9),oD=e=>{let t=e.trim();if(iD.test(t)){let e=Number(t);return os({_tag:`Duration`,duration:Number.isSafeInteger(e*1e3)?kl(e):Dl(BigInt(t)*aD)})}let n=nD(t);return n===void 0?ss($E.fromReason(`InvalidRetryAfter`,e)):os(rD(lE(n)))},sD=(e,t)=>e._tag===`Duration`?e.duration:Ol(Math.max(0,fE(e.dateTime)-t)),cD=e=>typeof e==`string`?e:IE(e),lD=new TextDecoder(`utf-8`,{ignoreBOM:!0}),uD=e=>new URLSearchParams(lD.decode(e).replace(/^\?/,`%3F`)),dD=`~effect/http/UrlParams`,fD=e=>O(e,dD),pD={...ba,[dD]:dD,[Symbol.iterator](){return this.params[Symbol.iterator]()},[Li](e){return{_id:`UrlParams`,params:Object.fromEntries(SD(this,Pc(e,MD)))}},toJSON(){return zi(this)},[ui](e){return vD(this,e)},[Gr](){return ri(this.params.flat())}},mD=e=>{let t=Object.create(pD);return t.params=e,t},hD=e=>{if(fD(e))return e;let t=gD(e),n=[];for(let e=0;e<t.length;e++)if(Array.isArray(t[e][0])){let[r,i]=t[e];n.push([`${r[0]}[${r.slice(1).join(`][`)}]`,i])}else n.push(t[e]);return mD(n)},gD=e=>{let t=typeof e[Symbol.iterator]==`function`?js(e):Object.entries(e),n=[];for(let[e,r]of t)if(Array.isArray(r))for(let t=0;t<r.length;t++)r[t]!==void 0&&n.push([e,_D(r[t])]);else if(typeof r==`object`&&r&&!NE(r)){let t=gD(r);for(let[r,i]of t)n.push([[e,...typeof r==`string`?[r]:r],i])}else r!==void 0&&n.push([e,_D(r)]);return n},_D=e=>NE(e)?e:String(e),vD=Di((e,t)=>yD(e.params,t.params)),yD=nc(hs([ki(),Ei()])),bD=mD([]),xD=E(2,(e,t)=>{let n=hD(t).params.slice(),r=new Set;for(let e=0;e<n.length;e++)r.add(n[e][0]);for(let t=0;t<e.params.length;t++)r.has(e.params[t][0])||n.push(e.params[t]);return mD(n)}),SD=E(2,(e,t)=>{let n=Array.isArray(t)?t:[t];return e.params.map(([e,t])=>[e,typeof t==`string`&&CD(e,n)?PE(t):t])}),CD=YE,wD=(e,t=jD())=>{e.includes(`@`)&&(e=OD(e));let n=e.indexOf(`?`);if(n===-1||t.length===0)return e;let r=e.indexOf(`#`);if(r!==-1&&r<n)return e;let i=r===-1?e.length:r;return e.slice(0,n+1)+kD(e.slice(n+1,i),t)+e.slice(i)},TD=/^(?:(https?|ftp|wss?):[/\\]*|[a-z][a-z\d+.-]*:\/\/|[/\\]{2,})/i,ED=/[/\\?#]/,DD=/[/?#]/,OD=e=>{let t=``,n=[];for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);i===9||i===10||i===13||t===``&&i<=32||(t+=e[r],n.push(r))}let r=TD.exec(t);if(r===null)return e;let i=r[0].length,a=r[1]!==void 0||!r[0].includes(`:`),o=t.slice(i),s=o.search(a?ED:DD),c=(s===-1?o:o.slice(0,s)).lastIndexOf(`@`);return c===-1?e:e.slice(0,n[i])+`REDACTED:REDACTED`+e.slice(n[i+c])},kD=(e,t)=>e.split(`&`).map(e=>{let n=e.indexOf(`=`);return n!==-1&&CD(AD(e.slice(0,n)),t)?e.slice(0,n+1)+`REDACTED`:e}).join(`&`),AD=e=>{if(!e.includes(`%`)&&!e.includes(`+`))return e;try{return decodeURIComponent(e.replace(/\+/g,` `))}catch{return e}},jD=()=>Pc(globalThis[`~effect/Fiber/currentFiber`]?.context??Ec(),MD),MD=P(`effect/http/UrlParams/CurrentRedactedNames`,{defaultValue:()=>[`X-Amz-Signature`,`X-Amz-Credential`,`X-Amz-Security-Token`,`AWSAccessKeyId`,`Signature`,`sig`,`X-Goog-Signature`]});function ND(e){return e.checks?e.checks[e.checks.length-1].annotations:e.annotations}var PD=`~structural`,FD=`~sentinels`,ID=`~constructor`,LD=vr(e=>{let t=ND(e)?.identifier;return typeof t==`string`?t:e.getExpected(LD)}),G=Symbol(),RD=yg,zD=RD(G),BD=RD(G),VD=e=>e===G?M():N(e),HD=e=>e._tag===`None`?zD:RD(e.value),UD=`~effect/SchemaIssue/Issue`;function WD(e){return O(e,UD)&&e[UD]===UD}function GD(e){return Object.hasOwn(e,`input`)}var KD=class{[UD]=UD;constructor(e,t){t?.reportInput===!0&&e!==G&&(this.input=e)}},qD=class extends KD{_tag=`Filter`;filter;issue;constructor(e,t,n,r){super(n,r),this.filter=e,this.issue=t}},JD=class extends KD{_tag=`Encoding`;ast;issue;constructor(e,t,n,r){super(n,r),this.ast=e,this.issue=t}},YD=class extends KD{_tag=`Pointer`;path;issue;constructor(e,t){super(),this.path=e,this.issue=t}},XD=class extends KD{_tag=`MissingKey`;annotations;constructor(e){super(),this.annotations=e}},ZD=class extends KD{_tag=`UnexpectedKey`;ast;constructor(e,t,n){super(t,n),this.ast=e}},QD=class extends KD{_tag=`Composite`;ast;issues;constructor(e,t,n,r){super(n,r),this.ast=e,this.issues=t}},$D=class extends KD{_tag=`InvalidType`;ast;constructor(e,t,n){super(t,n),this.ast=e}},eO=class extends KD{_tag=`InvalidValue`;annotations;constructor(e,t,n){super(t,n),this.annotations=e}};function tO(e,t,n,r,i){return new QD(e,[new YD([t],n)],r,i)}var nO=class extends KD{_tag=`AnyOf`;ast;issues;constructor(e,t,n,r){super(n,r),this.ast=e,this.issues=t}},rO=class extends KD{_tag=`OneOf`;ast;successes;constructor(e,t,n,r){super(n,r),this.ast=e,this.successes=t}};function iO(e,t,n){if(WD(e))return e;if(typeof e==`string`)return new eO({message:e},t,n);let r=typeof e.issue==`string`?new eO({message:e.issue},t,n):e.issue;return new YD(e.path,r)}function aO(e,t,n){if(e!==void 0)return typeof e==`boolean`?e?void 0:new eO(void 0,t,n):iO(e,t,n)}function oO(e,t,n,r){return Array.isArray(t)?Ls(t)?t.length===1?iO(t[0],n,r):new QD(e,Xs(t,e=>iO(e,n,r)),n,r):void 0:aO(t,n,r)}var sO=e=>{let t=_O(e);if(t!==void 0)return t;switch(e._tag){case`InvalidType`:return dO(LD(e.ast),e);case`InvalidValue`:{let t=uO(e);if(t!==void 0)return dO(t,e);let n=lO(e);return n===void 0?`Expected a valid value`:`Invalid data ${n}`}case`MissingKey`:return`Missing key`;case`UnexpectedKey`:{let t=lO(e);return t===void 0?`Expected no excess property`:`Unexpected key with value ${t}`}case`Forbidden`:return`Forbidden operation`;case`OneOf`:{let t=lO(e);return t===void 0?`Expected exactly one member to match`:`Expected exactly one member to match the input ${t}`}}},cO=e=>_O(e)??_O(e.issue);function lO(e){return GD(e)?Wi(e.input):void 0}function uO(e){let t=e.annotations?.expected;return typeof t==`string`?t:void 0}function dO(e,t){let n=lO(t);return n===void 0?`Expected ${e}`:`Expected ${e}, got ${n}`}function fO(e,t){let n=t(e);if(n!==void 0||e.issue._tag!==`InvalidValue`)return n;let r=uO(e.issue);return r===void 0?dO(pO(e.filter),e):dO(r,e.issue)}function pO(e){let t=e.annotations?.expected;if(typeof t==`string`)return t;switch(e._tag){case`Filter`:return`<filter>`;case`FilterGroup`:return e.checks.map(e=>pO(e)).join(` & `)}}function mO(){return e=>gO(e,``)}var hO=mO();function gO(e,t,n){let r;switch(e._tag){case`Filter`:return gO(e.issue,t,n??fO(e,cO));case`Encoding`:return gO(e.issue,t,n);case`Pointer`:return gO(e.issue,t+qi(e.path),n);case`Composite`:case`AnyOf`:if(e._tag===`Composite`||e.issues.length>0)return e.issues.map(e=>gO(e,t,n)).join(`
|
|
15
|
+
`);r=n??_O(e)??dO(LD(e.ast),e);break;default:r=n??sO(e)}return t?`${r}\n at ${t}`:r}function _O(e){if(e._tag===`Pointer`||e._tag===`Composite`)return;if(e._tag===`Encoding`)return _O(e.issue);let t=(e._tag===`Filter`?e.filter.annotations:`annotations`in e?e.annotations:e.ast.annotations)?.[e._tag===`MissingKey`?`messageMissingKey`:e._tag===`UnexpectedKey`?`messageUnexpectedKey`:`message`];if(typeof t==`string`)return t}function vO(e){let t;for(let n of e.reasons){if(!Wh(n)||!WD(n.error))return;t??=n.error}return t}function yO(e,t){let n=vO(e);if(n===void 0)throw Error(t,{cause:e});return n}var bO=(e,t,n)=>{switch(e._tag){case`Passthrough`:return R(t);case`Transform`:return R(ts(t,e.transform));case`TransformOptional`:return R(e.transform(t));case`TransformEffect`:return Wo(t)?Fy:ux(e.transform(t.value,n),N);case`TransformOptionalEffect`:return e.transform(t,n)}},xO=e=>Object.assign(Object.create(lr),e),SO=(e,t)=>kO((n,r)=>px(bO(e,n,r),e=>bO(t,e,r))),CO=E(2,(e,t)=>{if(e._tag===`Passthrough`)return t;if(t._tag===`Passthrough`)return e;switch(e._tag){case`Transform`:switch(t._tag){case`Transform`:return EO(n=>t.transform(e.transform(n)));case`TransformOptional`:return OO(n=>t.transform(ts(n,e.transform)));case`TransformEffect`:return DO((n,r)=>t.transform(e.transform(n),r));case`TransformOptionalEffect`:return SO(e,t)}case`TransformOptional`:switch(t._tag){case`Transform`:return OO(n=>ts(e.transform(n),t.transform));case`TransformOptional`:return OO(n=>t.transform(e.transform(n)));case`TransformEffect`:case`TransformOptionalEffect`:return SO(e,t)}case`TransformEffect`:switch(t._tag){case`Transform`:return DO((n,r)=>ux(e.transform(n,r),t.transform));case`TransformOptional`:case`TransformOptionalEffect`:return SO(e,t);case`TransformEffect`:return DO((n,r)=>px(e.transform(n,r),e=>t.transform(e,r)))}case`TransformOptionalEffect`:return SO(e,t)}}),wO=xO({_tag:`Passthrough`});function TO(){return wO}function EO(e){return xO({_tag:`Transform`,transform:e})}function DO(e){return xO({_tag:`TransformEffect`,transform:e})}function OO(e){return xO({_tag:`TransformOptional`,transform:e})}function kO(e){return xO({_tag:`TransformOptionalEffect`,transform:e})}function AO(){return EO(globalThis.String)}function jO(){return EO(globalThis.Number)}function MO(e){return DO((t,n)=>Hy({try:()=>JSON.parse(t,e?.reviver),catch:()=>new eO({expected:`a valid JSON string`},t,n)}))}function NO(e){return DO((t,n)=>Hy({try:()=>{let n=JSON.stringify(t,e?.replacer,e?.space);if(n===void 0)throw TypeError(`Value cannot be represented as JSON`);return n},catch:()=>new eO({expected:`a JSON-serializable value`},t,n)}))}function PO(e){let t=e?.separator??`,`,n=e?.keyValueSeparator??`=`,r=e?.trim??!1,i=e?.keepEmptyValues??!1;return EO(e=>e.split(t).reduce((e,t)=>{let a,o;if(n===``)a=t.slice(0,1),o=t.slice(1,2);else{let r=t.indexOf(n);if(r===-1)return e;a=t.slice(0,r),o=t.slice(r+n.length)}return r&&(a=a.trim(),o=o.trim()),a===``||o===``&&!i||Fi(e,a,o),e},{}))}function FO(e){let t=e?.separator??`,`,n=e?.keyValueSeparator??`=`;return EO(e=>Object.entries(e).map(([e,t])=>`${e}${n}${t}`).join(t))}function IO(){return EO(YT)}function LO(){return DO((e,t)=>dx(Gy(XT(e)),()=>new eO({expected:`a valid Base64 string`},e,t)))}function RO(){return EO(encodeURIComponent)}function zO(){return DO((e,t)=>{try{return R(globalThis.decodeURIComponent(e))}catch{return H(new eO({expected:`a valid URI component`},e,t))}})}var BO=Symbol.for(`~effect/Schema/content`);function VO(e,t){return Object.defineProperty(e,BO,{value:t}),e}var HO=class extends ur{_tag=`Middleware`;decode;encode;constructor(e,t){super(),this.decode=e,this.encode=t}flip(){return new HO(this.encode,this.decode)}},UO=`~effect/SchemaTransformation/Transformation`,WO=class extends ur{[UO]=UO;_tag=`Transformation`;decode;encode;constructor(e,t){super(),this.decode=e,this.encode=t}flip(){return new WO(this.encode,this.decode)}};function GO(e){return O(e,UO)&&e[UO]===UO}var KO=e=>GO(e)?e:new WO(e.decode,e.encode);function qO(e){return new WO(DO(e.decode),DO(e.encode))}function JO(e){return new WO(EO(e.decode),EO(e.encode))}function YO(e){return new WO(PO(e),FO(e))}var XO=new WO(TO(),TO());function ZO(){return XO}var QO=new WO(jO(),AO()),$O=e=>zr(e)&&typeof e.message==`string`,ek=e=>{let t=Object.hasOwn(e,`cause`)?Error(e.message,{cause:ik(e.cause)}):Error(e.message);return typeof e.name==`string`&&e.name!==`Error`&&(t.name=e.name),typeof e.stack==`string`&&(t.stack=e.stack),t},tk=e=>{try{let t=Zi(e);return t===void 0?Wi(e):JSON.parse(t)}catch{return Wi(e)}},nk=(e,t,n)=>{let r={name:e.name,message:typeof e.message==`string`?e.message:``};return t?.includeStack&&typeof e.stack==`string`&&(r.stack=e.stack),!t?.excludeCause&&e.cause!==void 0&&(r.cause=n(e.cause)),r},rk=e=>{let t=new WeakSet,n=r=>{if(Hr(r)){if(t.has(r))return`[Circular]`;t.add(r);let i=nk(r,e,n);return t.delete(r),i}return tk(r)};return n},ik=e=>$O(e)?ek(e):e,ak=e=>JO({decode:ik,encode:rk(e)}),ok=new WO(LO(),IO()),sk=new WO(zO(),RO());function ck(e){return new WO(MO(e??{}),VO(NO(e),{mediaType:`application/json`,preserveSchema:e?.reviver===void 0&&e?.replacer===void 0}))}function lk(e){return t=>t._tag===e}var uk=lk(`Declaration`),dk=lk(`Never`),fk=lk(`String`),pk=lk(`Number`),mk=lk(`Symbol`),hk=lk(`Literal`),gk=lk(`UniqueSymbol`),_k=lk(`Enum`),vk=lk(`TemplateLiteral`),yk=lk(`Arrays`),bk=lk(`Objects`),xk=lk(`Union`),Sk=lk(`Suspend`),Ck=class{to;transformation;constructor(e,t){this.to=e,this.transformation=t}},wk={},Tk=class{isOptional;isMutable;constructorDefault;annotations;constructor(e,t,n=void 0,r=void 0){this.isOptional=e,this.isMutable=t,this.constructorDefault=n,this.annotations=r}},Ek=`~effect/Schema`,Dk=class{[Ek]=Ek;annotations;checks;encoding;context;constructor(e=void 0,t=void 0,n=void 0,r=void 0){this.annotations=e,this.checks=t,this.encoding=n,this.context=r}toString(){return`<${this._tag}>`}},Ok=class extends Dk{_tag=`Declaration`;typeParameters;run;encodingChecks;encodingRun;constructor(e,t,n,r,i,a,o,s){super(n,r,i,a),this.typeParameters=e,this.run=t,this.encodingChecks=o,this.encodingRun=s}getParser(){let e;return(t,n)=>{if(t===G)return zD;e??=this.run(this.typeParameters);try{return e(t,this,n)}catch(e){return Vy(e)}}}_rebuild(e,t,n,r,i){let a=QA(this.typeParameters,e);return a===this.typeParameters&&t===this.checks&&n===this.encodingChecks&&r===this.run&&i===this.encodingRun?this:new Ok(a,r,this.annotations,t,void 0,this.context,n,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 typeof e==`string`?e:`<Declaration>`}},kk=new class extends Dk{_tag=`Null`;getParser(){return hj(this,null)}getExpected(){return`null`}},Ak=class extends Dk{_tag=`Undefined`;getParser(){return hj(this,void 0)}toCodecJson(){return zA(this,[jk])}getExpected(){return`undefined`}},jk=new Ck(kk,new WO(EO(()=>void 0),EO(()=>null))),Mk=new Ak,Nk=new class extends Dk{_tag=`Void`;getParser(){let e=RD(void 0);return t=>t===G?zD:e}toCodecJson(){return zA(this,[jk])}getExpected(){return`void`}},Pk=new class extends Dk{_tag=`Never`;getParser(){return gj(this,Ir)}getExpected(){return`never`}},Fk=new class extends Dk{_tag=`Unknown`;getParser(){return gj(this,Lr)}getExpected(){return`unknown`}},Ik=class extends Dk{_tag=`Literal`;literal;constructor(e,t,n,r,i){if(super(t,n,r,i),typeof e==`number`&&!globalThis.Number.isFinite(e))throw Error(`A numeric literal must be finite, got ${Wi(e)}`);this.literal=e}getParser(){return hj(this,this.literal)}matchPart(e,t){return e===globalThis.String(this.literal)?this.literal:void 0}toCodecJson(){return typeof this.literal==`bigint`?Lk(this):this}toCodecStringTree(){return typeof this.literal==`string`?this:Lk(this)}getExpected(){return typeof this.literal==`string`?JSON.stringify(this.literal):globalThis.String(this.literal)}};function Lk(e){let t=globalThis.String(e.literal);return zA(e,[new Ck(new Ik(t),new WO(EO(()=>e.literal),EO(()=>t)))])}var Rk=new class extends Dk{_tag=`String`;getParser(){return gj(this,Dr)}matchPart(e,t){let n=this.checks;return n&&!t.disableChecks&&Tj(n,e,void 0,this,t)?void 0:e}getExpected(){return`string`}},zk=class extends Dk{_tag=`Number`;getParser(){return gj(this,Or)}matchKey(e,t){return this._match(bj,e,t)}matchPart(e,t){return this._match(yj,e,t)}_match(e,t,n){if(!e.test(t))return;let r=globalThis.Number(t);return n.disableChecks||!this.checks?r:Tj(this.checks,r,void 0,this,n)?void 0:r}toCodecJson(){return this.checks&&(Bk(this.checks,`effect/schema/isFinite`)||Bk(this.checks,`effect/schema/isInt`))?this:zA(this,[PA])}toCodecStringTree(){return this.toCodecJson()===this?zA(this,[Cj]):zA(this,[wj])}getExpected(){return`number`}};function Bk(e,t){return e.some(e=>e.annotations?.representation?.id===t||e._tag===`FilterGroup`&&Bk(e.checks,t))}var Vk=new zk,Hk=new class extends Dk{_tag=`Boolean`;getParser(){return gj(this,kr)}getExpected(){return`boolean`}},Uk=class extends Dk{_tag=`Arrays`;isMutable;elements;rest;encodingChecks;constructor(e,t,n,r,i,a,o,s){super(r,i,a,o),this.isMutable=e,this.elements=t,this.rest=n,this.encodingChecks=s;let c=!1;for(let e=0;e<t.length;e++)if(sj(t[e]))c=!0;else if(c)throw Error(`A required element cannot follow an optional element. ts(1257)`);if(c&&n.length>1)throw Error(`A required element cannot follow an optional element. ts(1257)`);for(let e=1;e<n.length;e++)if(sj(n[e]))throw Error(`An optional element cannot follow a rest element. ts(1266)`)}getParser(e,t=e){let n=this,r,i,a=n.elements.length,o=Math.max(0,n.rest.length-1);function s(e,t){return t<a?r[t]:t>=e?i[t-e+1]:i[0]}let c=e=>{let{input:t,len:r,options:i}=e;if(n.rest.length===0&&r>a)for(let o=a;o<r;o++){let r=new ZD(n,t[o],i),a=new YD([o],r);if(i.errors===`all`)e.issues?e.issues.push(a):e.issues=[a];else return H(new QD(n,[a],t,i))}return e.issues?H(new QD(n,e.issues,t,i)):RD(e.output)},l=(e,t)=>{let r=e.length,i={ast:n,getParser:s,input:e,len:r,tailThreshold:Math.max(a,r-o),output:[],issues:void 0,options:t},u=n.rest.length===0?a:Math.max(r,a+o),d=t.concurrency===void 0?1:xm(t.concurrency),f=d===1?Kk(i,e,0,u):qk(i,e,{concurrency:d,end:u});if(!f)return c(i);if(yf(f))return px(f,()=>c(i));let p=!0;return z(()=>p?(p=!1,U(f,()=>c(i))):l(e,t))};return(e,a)=>{if(e===G)return zD;try{return Array.isArray(e)?(r||(r=n.elements.map(e=>({ast:e,parser:t(e)})),i=n.rest.map(e=>({ast:e,parser:t(e)}))),l(e,a)):H(new $D(n,e,a))}catch(e){return Vy(e)}}}_rebuild(e,t,n){let r=QA(this.elements,e),i=QA(this.rest,e);return r===this.elements&&i===this.rest&&t===this.checks&&n===this.encodingChecks?this:new Uk(this.isMutable,r,i,this.annotations,t,void 0,this.context,n)}recur(e){return this._rebuild(e,this.checks,this.encodingChecks)}flip(e){return this._rebuild(e,this.encodingChecks,this.checks)}getExpected(){return`array`}};function Wk(e,t,n,r){if(n._tag===`Failure`)return Jk(e,e.ast,r,n);let i=n===BD?t:n[A];if(i!==G)e.output[r]=i;else{let t=e.getParser(e.tailThreshold,r);if(sj(t.ast))return;let n=new YD([r],new XD(t.ast.context?.annotations));if(e.options.errors===`all`)e.issues?e.issues.push(n):e.issues=[n];else return xg(new QD(e.ast,[n],e.input,e.options))}}var Gk={onItem(e,t,n){let r=n<e.len?t:G;return e.getParser(e.tailThreshold,n).parser(r,e.options)},step:Wk},Kk=Sm()(Gk),qk=wm()(Gk),Jk=(e,t,n,r)=>{if(r.cause.reasons.length===0)return r;let i=vO(r.cause);if(i===void 0)return bg(tg(r.cause,r=>new QD(t,[new YD([n],r)],e.input,e.options)));let a=new YD([n],i);if(e.options.errors===`all`)e.issues?e.issues.push(a):e.issues=[a];else return xg(new QD(t,[a],e.input,e.options))},Yk=`[+-]?(?:\\d+(?:\\.\\d+)?|\\.\\d+)(?:[Ee][+-]?\\d+)?`;function Xk(e,t,n=wk){let r,i;function a(t){switch(t._tag){case`String`:case`TemplateLiteral`:return(r??=Object.keys(e)).filter(e=>t.matchPart(e,n)!==void 0);case`Number`:return(r??=Object.keys(e)).filter(e=>t.matchKey(e,n)!==void 0);case`Symbol`:return(i??=Object.getOwnPropertySymbols(e)).filter(r=>Object.prototype.propertyIsEnumerable.call(e,r)&&t.matchKey(r,n)!==void 0);case`Union`:return[...new Set(t.types.flatMap(a))];default:return[]}}return a(_j(fj(t)))}var Zk=class{name;type;constructor(e,t){this.name=e,this.type=t}};function Qk(e){switch(e._tag){case`String`:case`Number`:case`Symbol`:case`TemplateLiteral`:return!0;case`Union`:return e.types.every(Qk);default:return!1}}function $k(e){let t=VA(e);switch(t._tag){case`String`:case`Number`:case`Symbol`:case`TemplateLiteral`:return!0;case`Union`:return t.types.every($k);default:return!1}}function eA(e){return Qk(e)&&$k(e)}var tA=class{parameter;type;constructor(e,t){if(!eA(e))throw Error(`Invalid index signature parameter ${e._tag}`);if(this.parameter=e,this.type=t,sj(t)||t.encoding!==void 0&&sj(fj(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.")}},nA=class extends Dk{_tag=`Objects`;propertySignatures;indexSignatures;encodingChecks;constructor(e,t,n,r,i,a,o){super(n,r,i,a),this.propertySignatures=e,this.indexSignatures=t,this.encodingChecks=o}getParser(e,t=e){let n=this,r=n.propertySignatures.length,i=n.indexSignatures.length;if(!r&&!i)return gj(n,Fr);let a,o,s=()=>(a||(a=n.propertySignatures.map(e=>({parser:t(e.type),name:e.name,type:e.type})),o=i?n.indexSignatures.map(n=>({is:n,parserKey:e(_j(n.parameter)),parserValue:t(n.type)})):void 0),a),c=()=>{let e=new Set(n.propertySignatures.map(e=>typeof e.name==`number`?globalThis.String(e.name):e.name)),t=(t,i,a,o,s)=>{if(s._tag===`Failure`)return Jk(t,n,i,s)??wg;let c=s===BD?o:s[A];if(a!==G&&c!==G){if(r&&(e.has(i)||e.has(typeof a==`number`?globalThis.String(a):a)))return wg;Fi(t.out,a,c)}return wg},c=(e,r,i,a)=>{if(!a){let t=i.parserKey(r,e.options);if(!yf(t))return U(Yy(t),t=>c(e,r,i,t));a=t}if(a._tag===`Failure`)return Jk(e,n,r,a)??wg;let o=a===BD?r:a[A],s=e.input[r],l=i.parserValue(s,e.options);return yf(l)?t(e,r,o,s,l):U(Yy(l),n=>t(e,r,o,s,n))},l=(e,n,r)=>{let i=e.input[n],a=r.parserValue(i,e.options);return yf(a)?t(e,n,n,i,a):U(Yy(a),r=>t(e,n,n,i,r))},u=i?wm()({onItem:(e,[t,n])=>n.is.parameter===Rk?l(e,t,n):c(e,t,n),step:(e,t,n)=>n._tag===`Failure`?n:void 0}):void 0;return hx(function*(t,d){if(t===G)return G;if(typeof t!=`object`||!t||Array.isArray(t))return yield*H(new $D(n,t,d));s();let f=t,p={},m={ast:n,input:f,out:p,issues:void 0,options:d},h=d.errors===`all`,g=d.onExcessProperty===`error`,_=d.concurrency===void 0?1:xm(d.concurrency),v=i&&g?n.indexSignatures.map(e=>Xk(f,e.parameter,d)):void 0;if(g){let r=v?new Set(e):e;if(v)for(let e of v)for(let t of e)r.add(t);let i=Reflect.ownKeys(f);for(let e=0;e<i.length;e++){let a=i[e];if(!r.has(a)&&Object.prototype.propertyIsEnumerable.call(f,a)){let e=new ZD(n,f[a],d),r=new YD([a],e);if(h){m.issues?m.issues.push(r):m.issues=[r];continue}return yield*H(new QD(n,[r],t,d))}}}if(r){let e=_===1?aA(m,a):oA(m,a,{concurrency:_});e&&(yield*e)}if(i&&_===1)for(let e=0;e<i;e++){let t=o[e],n=t.is.parameter===Rk?l:c,r=v?.[e]??(t.is.parameter===Rk?Object.keys(f):Xk(f,t.is.parameter,d));for(let e=0;e<r.length;e++){let i=n(m,r[e],t);if(!yf(i))yield*i;else if(i._tag===`Failure`)return yield*i}}else if(u){let e=Js();for(let t=0;t<i;t++){let n=o[t],r=v?.[t]??(n.is.parameter===Rk?Object.keys(f):Xk(f,n.is.parameter,d));for(let t=0;t<r.length;t++)e.push([r[t],n])}let t=u(m,e,{concurrency:_});t&&(yield*t)}return m.issues?yield*H(new QD(n,m.issues,t,d)):p})};if(i)return c();let l,u=(e,t,n)=>{let r=a[t];return U(Yy(n),n=>{let i={...e,out:{...e.out}},o=rA(i,r,n);if(o)return o;let s=()=>RD(i.out),c=aA(i,a.slice(t+1));return c?px(c,s):s()})};return(e,t)=>{if(e===G)return zD;if(t.errors===`all`||t.onExcessProperty!==void 0||t.concurrency!==void 0&&xm(t.concurrency)!==1)return(l??=c())(e,t);if(typeof e!=`object`||!e||Array.isArray(e))return H(new $D(n,e,t));let r=s(),i=e,a={},o={ast:n,input:i,out:a,issues:void 0,options:t};try{for(let e=0;e<r.length;e++){let n=r[e],s=n.name,c=vA(i,s),l=c?i[s]:G,d=n.parser(l,t);if(!yf(d))return u(o,e,d);if(d===BD){c&&Fi(a,s,l);continue}let f=rA(o,n,d);if(f)return f}}catch(e){return Vy(e)}return RD(a)}}_rebuild(e,t,n,r){let i=QA(this.propertySignatures,t=>{let n=e(t.type);return n===t.type?t:new Zk(t.name,n)}),a=QA(this.indexSignatures,n=>{let r=t(n.parameter),i=e(n.type);return r===n.parameter&&i===n.type?n:new tA(r,i)});return i===this.propertySignatures&&a===this.indexSignatures&&n===this.checks&&r===this.encodingChecks?this:new nA(i,a,this.annotations,n,void 0,this.context,r)}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 this.propertySignatures.length===0&&this.indexSignatures.length===0?`object | array`:`object`}};function rA(e,t,n){if(n._tag===`Failure`)return Jk(e,e.ast,t.name,n);if(n===BD)return;let r=n[A];if(r!==G)Fi(e.out,t.name,r);else if(delete e.out[t.name],!sj(t.type)){let n=new YD([t.name],new XD(t.type.context?.annotations));if(e.options.errors===`all`){e.issues?e.issues.push(n):e.issues=[n];return}return xg(new QD(e.ast,[n],e.input,e.options))}}var iA={onItem(e,t){if(!vA(e.input,t.name))return t.parser(G,e.options);let n=e.input[t.name];return Fi(e.out,t.name,n),t.parser(n,e.options)},step:rA},aA=Sm()(iA),oA=wm()(iA);function sA(e,t){return e?t?[...e,...t]:e:t}function cA(e,t,n){return new nA(Reflect.ownKeys(e).map(t=>new Zk(t,e[t].ast)),[],n,t)}function lA(e){return e.ast}function uA(e,t=void 0){return new Uk(!1,e.map(e=>e.ast),[],void 0,t)}function dA(e,t,n){return new bA(e.map(lA),t,void 0,n)}var fA=yr(e=>{for(;;){if(Sk(e))return Fk;let t=e.encoding;if(!t)return e.recur?.(fA,D)??e;if(t.some(e=>e.transformation._tag===`Middleware`&&e.transformation.decode!==D))return Fk;e=t[t.length-1].to}});function pA(e){switch(e._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 e.propertySignatures.length||e.indexSignatures.length?[`object`]:[`string`,`number`,`boolean`,`symbol`,`bigint`,`object`,`array`,`function`];case`Enum`:return Array.from(new Set(e.enums.map(([,e])=>typeof e)));case`Literal`:return[typeof e.literal];case`Union`:return Array.from(new Set(e.types.flatMap(pA)));default:return[`null`,`undefined`,`string`,`number`,`boolean`,`symbol`,`bigint`,`object`,`array`,`function`]}}function mA(e){switch(e._tag){default:return[];case`Declaration`:{let t=e.annotations?.[FD];return Array.isArray(t)?t:[]}case`Objects`:return e.propertySignatures.flatMap(e=>{let t=e.type;if(!sj(t)){if(hk(t))return[{key:e.name,literal:t.literal}];if(gk(t))return[{key:e.name,literal:t.symbol}]}return[]});case`Arrays`:return e.elements.flatMap((e,t)=>{if(!sj(e)){if(hk(e))return[{key:t,literal:e.literal}];if(gk(e))return[{key:t,literal:e.symbol}]}return[]});case`Union`:{if(e.types.length===0)return[];let t=e.types.map(e=>mA(fA(e)));return t[0].filter(e=>t.every(t=>t.some(t=>t.key===e.key&&t.literal===e.literal)))}case`Suspend`:return mA(e.thunk())}}var hA=new WeakMap,gA=Object.freeze([]),_A=e=>e===null?`null`:Array.isArray(e)?`array`:typeof e,vA=(e,t)=>t===`__proto__`?Object.hasOwn(e,t):t in e;function yA(e){let t=hA.get(e);if(t)return t;let n,r=0,i,a,o=!0,s=[];for(let t=0;t<e.length;t++){let c=e[t],l=fA(c);if(dk(l))continue;if(hk(l)||gk(l)){a??=new Map;let e=hk(l)?l.literal:l.symbol;s[t]=e;let n=a.get(e);n||a.set(e,n=[]),n.push(t)}else o=!1;let u=mA(l);if(u.length){n??=new Map,r++;for(let{key:e,literal:r}of u){let i=n.get(e);i||n.set(e,i=[new Map,new Set]),i[1].add(t);let a=i[0].get(r);a||i[0].set(r,a=new Set),a.add(t)}}else{i??={};let e=pA(l);for(let n of e)(i[n]??=[]).push(t)}}let c={},l=e=>c[e]??=Object.freeze(i?.[e]??gA);if(o&&a)a.forEach(Object.freeze),t=e=>a.get(e)??gA;else if(n?.size===1&&!i){let[r,[i]]=n.entries().next().value,a=new Map;for(let[e,t]of i)a.set(e,Object.freeze(Array.from(t)));let o=Object.freeze(e.map((e,t)=>t));t=(e,t)=>{if(Br(e)){let n=vA(e,r)?e[r]:void 0;if(n!==void 0)return a.get(n)??gA;if(t)return o}return gA}}else if(n){let e;for(let t of n)(!e||t[1][0].size>e[1][0].size)&&t[1][1].size===r&&(e=t);t=(t,r)=>{let a=_A(t);if(!Br(t))return l(a);let o=new Set(i?.[a]),s;if(e){let[n,[i]]=e,c=vA(t,n),u=c?t[n]:void 0;if(c&&(!r||u!==void 0)){let e=i.get(u);if(!e)return l(a);for(let t of e)o.add(t);s=n}}if(s===void 0)for(let[e,[i,a]]of n){let n=vA(t,e),s=n?t[e]:void 0;if(n&&(!r||s!==void 0)){let e=i.get(s);if(e)for(let t of e)o.add(t)}else if(r)for(let e of a)o.add(e)}for(let[e,[i,a]]of n){if(e===s)continue;let n=vA(t,e),c=n?t[e]:void 0;if(n&&(!r||c!==void 0)){let e=i.get(c);for(let t of o)a.has(t)&&!e?.has(t)&&o.delete(t)}}return Array.from(o).sort((e,t)=>e-t)}}else t=e=>{let t=l(_A(e));return a?t.filter(t=>s[t]===void 0||s[t]===e):t};return hA.set(e,t),t}var bA=class extends Dk{_tag=`Union`;types;options;encodingChecks;constructor(e,t,n,r,i,a,o){super(n,r,i,a),this.types=e,this.options=t,this.encodingChecks=o}getParser(e,t){let n=this,r=t!==void 0,i=[],a=t=>i[t]??=e(n.types[t]),o;return(e,t)=>{if(e===G)return zD;let i=(o??=yA(n.types))(e,r);if(i.length===0)return H(new nO(n,[],e,t));if(i.length===1){let r=a(i[0])(e,t);return r._tag===`Success`?r:yf(r)?xA(n,r.cause,e,t):SA(n,r,e,t)}return CA(n,a,i,e,t)}}_rebuild(e,t,n){let r=QA(this.types,e);return r===this.types&&t===this.checks&&n===this.encodingChecks?this:new bA(r,this.options,this.annotations,t,void 0,this.context,n)}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 n of this.types){let r=n.matchPart(e,t);if(r!==void 0)return r}}getExpected(e){let t=this.annotations?.expected;if(typeof t==`string`)return t;if(this.types.length===0)return`never`;let n=this.types.map(t=>{let n=fj(t);switch(n._tag){case`Arrays`:{let t=n.elements.filter(hk);if(t.length>0)return`${DA(n.isMutable)}[ ${t.map(t=>e(t)+OA(t.context?.isOptional)).join(`, `)}, ... ]`;break}case`Objects`:{let t=n.propertySignatures.filter(e=>hk(e.type));if(t.length>0)return`{ ${t.map(t=>`${DA(t.type.context?.isMutable)}${Ki(t.name)}${OA(t.type.context?.isOptional)}: ${e(t.type)}`).join(`, `)}, ... }`;break}}return e(n)});return Array.from(new Set(n)).join(` | `)}};function xA(e,t,n,r){let i=vO(t);return i?xg(new nO(e,[i],n,r)):bg(t)}function SA(e,t,n,r){return $y(t,t=>xA(e,t,n,r))}function CA(e,t,n,r,i){let a={ast:e,parser:t,input:r,out:void 0,successes:e.options?.mode===`oneOf`?[]:void 0,issues:void 0,options:i},o=TA(a,n);if(!o)return a.out?a.out:H(new nO(e,a.issues??[],r,i));if(yf(o))return wA(o,a);let s=!0;return z(()=>s?(s=!1,wA(o,a)):CA(e,t,n,r,i))}function wA(e,t){return px(e,e=>t.out===BD?R(t.input):t.out?t.out:H(new nO(t.ast,t.issues??[],t.input,t.options)))}var TA=Sm()({onItem(e,t){return e.parser(t)(e.input,e.options)},step(e,t,n){if(n._tag===`Failure`){let t=vO(n.cause);if(t===void 0)return n;e.issues?e.issues.push(t):e.issues=[t]}else{if(e.out&&e.successes)return e.successes.push(e.ast.types[t]),xg(new rO(e.ast,e.successes,e.input,e.options));if(e.out=n,e.successes)e.successes.push(e.ast.types[t]);else return wg}}}),EA=new bA([new Ik(`Infinity`),new Ik(`-Infinity`),new Ik(`NaN`)]);function DA(e){return e?``:`readonly `}function OA(e){return e?`?`:``}var kA=class extends ur{_tag=`Filter`;run;annotations;aborted;constructor(e,t=void 0,n=!1){super(),this.run=e,this.annotations=t,this.aborted=n}annotate(e){return new kA(this.run,{...this.annotations,...e},this.aborted)}abort(){return new kA(this.run,this.annotations,!0)}and(e,t){return new AA([this,e],t)}},AA=class extends ur{_tag=`FilterGroup`;checks;annotations;constructor(e,t=void 0){super(),this.checks=e,this.annotations=t}annotate(e){return new AA(this.checks,{...this.annotations,...e})}and(e,t){return new AA([this,e],t)}};function jA(e,t,n=!1){return new kA((t,n,r)=>oO(n,e(t,n,r),t,r),t,n)}function MA(e){return jA(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})}var NA=WA(Vk,[MA()]),PA=new Ck(new bA([NA,EA]),new WO(jO(),EO(e=>globalThis.Number.isFinite(e)?e:globalThis.String(e))));function FA(e,t){let n=new globalThis.RegExp(e),r={source:n.source,flags:n.flags};return jA(e=>(n.lastIndex=0,n.test(e)),{expected:`a string matching the RegExp ${r.source}`,representation:{id:`effect/schema/isPattern`,payload:r},toJsonSchema:()=>[{},!0],arbitraryConstraint:{patterns:[r]},...t})}var IA=new WeakMap;function LA(e,t){let n=Object.assign(Object.create(Object.getPrototypeOf(e)),e,t);return Reflect.ownKeys(t).every(e=>e===`context`||e===`encoding`)&&IA.set(n,RA(e)),n}function RA(e){let t=IA.get(e);if(t!==void 0)return t;if(e.encoding===void 0)return e;let n=Object.assign(Object.create(Object.getPrototypeOf(e)),e,{encoding:void 0});return IA.set(e,n),n}function zA(e,t){return e.encoding===t?e:LA(e,{encoding:t})}function BA(e,t){if(e.context===t)return e;let n=RA(e);return n.context===t&&n.encoding===e.encoding?n:LA(e,{context:t})}function VA(e){return e.encoding?VA(e.encoding[e.encoding.length-1].to):e}function HA(e,t){if(e.checks){let n=e.checks[e.checks.length-1];return UA(e,Ns(e.checks.slice(0,-1),n.annotate(t)))}return LA(e,{annotations:{...e.annotations,...t}})}function UA(e,t){if(e._tag===`Suspend`&&t)throw Error(`Cannot add checks to Suspend`);return e.checks===t?e:LA(e,{checks:t})}function WA(e,t){return UA(e,sA(e.checks,t))}function GA(e,t){let n=t(e.to);return n===e.to?e:new Ck(n,e.transformation)}function KA(e,t){let n=e,r=n[n.length-1],i=GA(r,t);return i===r?e:Ns(e.slice(0,e.length-1),i)}function qA(e){return t=>t.encoding?zA(t,KA(t.encoding,e)):t}function JA(e,t){return qA(e=>BA(e,t))(e)}function YA(e){function t(n){return n.encoding?zA(n,KA(n.encoding,t)):e(n)}return vr(t)}function XA(e,t){function n(r){if(r.encoding){let e=r.encoding[r.encoding.length-1];return t?.stopAt?.(e)?r:zA(r,KA(r.encoding,n))}return e(r)}return yr(n)}function ZA(e,t,n){let r=new Ck(e,t);return zA(n,n.encoding?[...n.encoding,r]:[r])}function QA(e,t){let n;for(let r=0;r<e.length;r++){let i=e[r],a=t(i);if(n)n[r]=a;else if(a!==i){n=Array(e.length);for(let t=0;t<r;t++)n[t]=e[t];n[r]=a}}return n??e}function $A(e,t){return BA(e,e.context?new Tk(e.context.isOptional,e.context.isMutable,e.context.constructorDefault,{...e.context.annotations,...t}):new Tk(!1,!1,void 0,t))}var ej=yr(e=>tj(BA(e,e.context?e.context.isOptional===!1?new Tk(!0,e.context.isMutable,e.context.constructorDefault,e.context.annotations):e.context:new Tk(!0,!1)))),tj=qA(ej),nj=vr(e=>ej(new bA([e,Mk])));function rj(e,t){return BA(e,e.context?new Tk(e.context.isOptional,e.context.isMutable,t,e.context.annotations):new Tk(!1,!1,t))}function ij(e,t,n){return ZA(e,n,t)}function aj(e){let t=[],n=[];function r(e){t.includes(e)||t.push(e)}function i(e){switch(e._tag){case`Literal`:jr(e.literal)&&r(e.literal);return;case`UniqueSymbol`:r(e.symbol);return;case`Enum`:for(let[,t]of e.enums)r(t);return;case`Never`:return;case`Union`:for(let t=0;t<e.types.length;t++)i(e.types[t]);return;default:n.push(e)}}return i(e),{literals:t,parameters:n}}function oj(e,t){let{literals:n,parameters:r}=aj(e);return new nA(n.map(e=>new Zk(e,t)),r.map(e=>new tA(e,t)))}function sj(e){return e.context?.isOptional??!1}function cj(e){return e.annotations?.[`~structural`]===!0||e._tag===`FilterGroup`&&e.checks.every(cj)}function lj(e){function t(e){return cj(e)?[e]:e._tag===`FilterGroup`?e.checks.flatMap(t):[]}let n=e.flatMap(t);return Is(n)?n:void 0}function uj(e){let t=!0;function n(e){return t=t&&!e.encoding&&!Sk(e),t&&`recur`in e&&e.recur(n),e}return`recur`in e&&e.recur(n),t}var dj=yr(e=>{let t=RA(e);if(t!==e){let n=dj(t);return n===t&&e.encoding===void 0?e:BA(n,e.context)}let n=`recur`in e?e.recur(dj):e;if(`encodingChecks`in n&&n.encodingChecks){let t=uj(e)?n.encodingChecks:yk(n)||bk(n)||uk(n)&&n.typeParameters.length>0?lj(n.encodingChecks):void 0;return LA(n,{encodingChecks:void 0,checks:sA(n.checks,t)})}return n}),fj=yr(e=>dj(mj(e)));function pj(e,t){let n=t,r=n.length,i=n[r-1],a=[new Ck(mj(zA(e,void 0)),n[0].transformation.flip())];for(let e=1;e<r;e++)a.unshift(new Ck(mj(n[e-1].to),n[e].transformation.flip()));let o=mj(i.to);return o.encoding?zA(o,[...o.encoding,...a]):zA(o,a)}var mj=vr(e=>{if(e.encoding)return pj(e,e.encoding);let t=RA(e);if(t!==e){let n=mj(t);return n===t?e:BA(n,e.context)}return`flip`in e?e.flip(mj):`recur`in e?e.recur(mj):e});function hj(e,t){let n=t===0?BD:RD(t);return(r,i)=>r===G?zD:r===t?n:H(new $D(e,r,i))}function gj(e,t){return(n,r)=>n===G?zD:t(n)?BD:H(new $D(e,n,r))}var _j=XA(e=>{switch(e._tag){default:return e;case`Number`:return e.toCodecStringTree();case`Union`:return e.recur(_j)}}),vj=XA(e=>{switch(e._tag){default:return e;case`Symbol`:case`UniqueSymbol`:return e.toCodecStringTree();case`Union`:return e.recur(vj)}}),yj=new globalThis.RegExp(`^${Yk}$`),bj=new globalThis.RegExp(`^(?:${Yk}|Infinity|-Infinity|NaN)$`);function xj(e){return FA(yj,{expected:`a string representing a finite number`,representation:{id:`effect/schema/isStringFinite`,payload:null},toJsonSchema:()=>({pattern:yj.source}),...e})}var Sj=WA(Rk,[xj()]),Cj=new Ck(Sj,QO),wj=new Ck(new bA([Sj,EA]),QO);function Tj(e,t,n,r,i){for(let a=0;a<e.length;a++){let o=e[a];if(o._tag===`FilterGroup`){if(n=Tj(o.checks,t,n,r,i),n&&(i.errors!==`all`||n[n.length-1].filter.aborted))return n}else{let e=o.run(t,r,i);if(e){let r=new qD(o,e,t,i);if(n?n.push(r):n=[r],i.errors!==`all`||o.aborted)return n}}}return n}function Ej(e){if(!uk(e))return;let t=e.annotations?.[ID];return Mr(t)?t(e.typeParameters):void 0}function Dj(e){return e===null||typeof e==`string`||typeof e==`boolean`||typeof e==`number`&&globalThis.Number.isFinite(e)}function Oj(e){return e===void 0||typeof e==`string`}function kj(e,t){let n=new WeakMap,r=[];outer:for(;;){if(typeof e!=`object`||!e){if(!t(e))return!1}else{let t=e,i=n.get(t);if(i===!1)return!1;if(i===void 0){let e=Array.isArray(t);if(!e){let e=Object.getPrototypeOf(t);if(e!==null&&e!==Object.prototype&&Object.getPrototypeOf(e)!==null)return!1}n.set(t,!1),r.push({value:t,keys:e?t.length:Object.keys(t),index:0})}}for(;r.length>0;){let t=r[r.length-1],i=t.keys;if(typeof i==`number`){if(t.index<i){e=t.value[t.index++];continue outer}}else if(t.index<i.length){e=t.value[i[t.index++]];continue outer}n.set(t.value,!0),r.pop()}return!0}}function Aj(e){return kj(e,Dj)}var jj=new Ok([],()=>(e,t,n)=>Aj(e)?BD:H(new $D(t,e,n)),{representation:{id:`effect/schema/Json`,payload:null},expected:`JSON value`,toCodecJson:()=>void 0,toCodecStringTree:()=>Fj}),Mj=new Ck(jj,ZO()),Nj=new Ck(new bA([new Uk(!1,[],[jj]),new nA([],[new tA(Rk,jj)])]),ZO());function Pj(e){return kj(e,Oj)}var Fj=new Ck(new Ok([],()=>(e,t,n)=>Pj(e)?BD:H(new $D(t,e,n)),{expected:`StringTree`,toCodecStringTree:()=>void 0}),ZO()),Ij=(e,t,n)=>e===BD?n(t):px(e,n);function Lj(e){let t=Rj(e);return(e,n,r)=>{try{return t(e,n,r)}catch(e){return Vy(e)}}}function Rj(e){if(e._tag===`Middleware`)return(t,n,r)=>zj(t===BD?e.decode(RD(VD(n)),r):e.decode(ux(t,VD),r));let t=e.decode;switch(t._tag){case`Passthrough`:return(e,t)=>e===BD?RD(t):e;case`Transform`:{let e=e=>e===G?zD:RD(t.transform(e));return(t,n)=>Ij(t,n,e)}case`TransformOptional`:{let e=e=>HD(t.transform(VD(e)));return(t,n)=>Ij(t,n,e)}case`TransformEffect`:return(e,n,r)=>Ij(e,n,e=>e===G?zD:t.transform(e,r));case`TransformOptionalEffect`:return(e,n,r)=>Ij(e,n,e=>zj(t.transform(VD(e),r)))}}var zj=e=>px(e,HD),Bj=(e,t,n,r)=>$y(r,r=>By(()=>tg(r,r=>new JD(e,r,t,n))));function Vj(e,t){let n=Lj(e.link.transformation),r;return(i,a)=>{if(i===G)return zD;if(e.isConstructed(i))return BD;let o=(r??=t(e.link.to))(i,a);return n(o,i,a)}}function Hj(e,t){let n=e.context.constructorDefault;return(r,i)=>{if(r!==G&&r!==void 0)return t(r,i);let a=n;if(yf(a)&&a._tag===`Success`){let e=t(a[A],i);return e===BD?a:e}return px(Bj(e,r,i,a),e=>{let n=t(e,i);return n===BD?RD(e):n})}}function Uj(e,t){let n=t(e);return e.context?.constructorDefault===void 0?n:Hj(e,n)}function Wj(e,t,n,r,i){if(e._tag===`Declaration`)for(let n of e.typeParameters)t(n);let a=n?Ej(e):void 0,o=a?Vj(a,t):r??e.getParser(t,n),s=e.checks,c=e.encoding,l=c?.map(e=>Lj(e.transformation)),u=e.encodingChecks;if(!c&&!s&&!u)return o;let d,f=(t,n)=>{let r=o(t,n);try{if(u&&!n.disableChecks){if(yf(r)){if(r._tag===`Success`){let i=r===BD?t:r[A];if(t!==G&&i!==G){let i=Tj(u,t,void 0,e,n);i&&(r=H(new QD(e,i,t,n)))}}}else r=U(r,r=>{if(t!==G&&r!==G){let r=Tj(u,t,void 0,e,n);if(r)return H(new QD(e,r,t,n))}return R(r)})}if(s&&!n.disableChecks){if(yf(r)){if(r._tag===`Success`){let i=r===BD?t:r[A];if(i===G)return r;let a=Tj(s,i,void 0,e,n);a&&(r=H(new QD(e,a,i,n)))}}else r=U(r,t=>{if(t!==G){let r=Tj(s,t,void 0,e,n);if(r)return H(new QD(e,r,t,n))}return R(t)})}return r}catch(e){return Vy(e)}},p=i===void 0?f:i(f);return c?(n,r)=>{let i=d??=c.map(e=>t(e.to)),a=n,o=i[i.length-1](n,r);for(let e=c.length-1;e>=0;e--)if(o=l[e](o,a,r),e!==0){let t=i[e-1];o._tag===`Success`?(a=o[A],o=t(a,r)):o=px(o,e=>{let n=t(e,r);return n===BD?RD(e):n})}if(o._tag===`Success`){let e=o[A],t=p(e,r);return t===BD?o:t}return o=Bj(e,n,r,o),px(o,e=>{let t=p(e,r);return t===BD?RD(e):t})}:p}var Gj=Symbol(),Kj=new WeakMap,qj=e=>Zj(e).parser,Jj=e=>Zj(e).makeEffect,Yj=e=>Uj(e,Jj),Xj=class{ast;constructor(e){this.ast=e}get decodeEffect(){return this.cachedDecodeEffect??=Wj(this.ast,qj)}get parser(){return this.decodeEffect}get makeEffect(){return this.cachedMakeEffect??=Wj(this.ast,Jj,Yj)}};function Zj(e){let t=Kj.get(e);if(t!==void 0)return t;let n=new Xj(e);return Kj.set(e,n),n}function Qj(e){let t=e.ast,n;return(e,r)=>(n??=dM(xM,dj(t)))(e,r?.disableChecks?r?.parseOptions?{...r.parseOptions,disableChecks:!0}:{disableChecks:!0}:r?.parseOptions)}function $j(e){let t=Qj(e);return(e,n)=>{let r=ax(t(e,n));return Tg(r)?N(r.value):(yO(r.cause,`Option adapter can only return none for schema issues`),M())}}function eM(e){return _M(dj(e.ast))}function tM(e){return rM(e.ast)}function nM(e){{let t=fM(lM(e));return e=>{let n=t(e,wk);return Tg(n)?!0:(yO(n.cause,`Type guard adapter can only return false for schema issues`),!1)}}}function rM(e){let t=dj(e),n=e=>(n=nM(t),n(e));return e=>n(e)}function iM(e,t){let n=lM(e.ast);return t===void 0?n:(e,r)=>n(e,sM(t,r))}function aM(e,t){return pM(iM(e,t))}function oM(e,t){let n=lM(mj(e.ast));return t===void 0?n:(e,r)=>n(e,sM(t,r))}var sM=(e,t)=>t?{...e,...t}:e,cM=e=>e===G?H(new eO):R(e);function lM(e){return dM(bM,e)}function uM(e,t){return e===BD?R(t):yf(e)?e[`~effect/Effect/args`]===G?cM(G):e:px(e,cM)}function dM(e,t){let n;return(r,i)=>{let a=(n??=e(t))(r,i??wk);return a===BD?R(r):yf(a)?a[`~effect/Effect/args`]===G?cM(G):a:px(a,cM)}}function fM(e){return(t,n)=>ax(e(t,n))}function pM(e){let t=fM(e);return(e,n)=>{let r=t(e,n);return Tg(r)?os(r.value):ss(yO(r.cause,`Result adapter can only return schema issues`))}}function mM(e,t){let n=ax(e);if(Tg(n))return n.value;let r=yO(n.cause,t);throw Error(`Schema validation failed`,{cause:r})}var hM=`Constructor adapter can only throw schema issues`;function gM(e){throw Error(hM,{cause:Yh(e)})}function _M(e){let t;return(n,r)=>vM(t??=Zj(e),n,r)}function vM(e,t,n){let r=n?.disableChecks?n.parseOptions?{...n.parseOptions,disableChecks:!0}:{disableChecks:!0}:n?.parseOptions??wk,i=e.make;if(i!==void 0&&t!==G){let e;try{e=i(t,r)}catch(e){gM(e)}if(e!==Gj&&e!==G)return e}return mM(uM(e.makeEffect(t,r),t),hM)}function yM(e,t,n,r){let i=Zj(e),a=Ej(e);if(a===void 0||i.make!==void 0||i.compiledMakeEffect!==void 0)return vM(i,t,n);if(a.isConstructed(t))return t;let o=vM((i.resolve??Zj)(a.link.to),t,n);try{return r(o)}catch(e){gM(e)}}var bM=e=>Zj(e).parser,xM=e=>Zj(e).makeEffect,SM=`~effect/Schema/Schema`,CM=Symbol(),wM={[SM]:SM,get make(){let e=eM(this);return Object.defineProperty(this,"make",{value:e,enumerable:!0}),e},get makeEffect(){let e=Qj(this);return Object.defineProperty(this,"makeEffect",{value:e,enumerable:!0}),e},get makeOption(){let e=$j(this);return Object.defineProperty(this,"makeOption",{value:e,enumerable:!0}),e},pipe(){return T(this,arguments)},annotate(e){return this.rebuild(HA(this.ast,e))},annotateKey(e){return this.rebuild($A(this.ast,e))},check(...e){return this.rebuild(WA(this.ast,e))},rebuild(e){return TM(e,this[CM])}};function TM(e,t){function n(){}let r=Object.setPrototypeOf(n,wM);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[CM]=t,r.ast=e,r}function EM(e){return TM(DM(e.ast),{schema:e})}var DM=OM(NM);function OM(e,t){let n=vr(t=>{let n=BA(t,void 0),i=e(n,r);return i===n?null:i}),r=XA(e=>{let t=n(RA(e));if(t===null)return e;let r=BA(t,e.context);return e.context===void 0?r:JA(r,kM(e.context))},t);return r}function kM(e){return e.constructorDefault===void 0?e:new Tk(e.isOptional,e.isMutable,void 0,e.annotations)}function AM(e){if(e.propertySignatures.some(e=>typeof e.name!=`string`))throw new globalThis.Error(`Objects property names must be strings`,{cause:e})}function jM(e){return t=>{let n=[...t].sort((t,n)=>e(fj(t))-e(fj(n)));return n.some((e,n)=>e!==t[n])?n:t}}var MM=jM(e=>{switch(e._tag){case`BigInt`:case`Symbol`:case`UniqueSymbol`:return 0;default:return 1}});function NM(e,t){switch(e._tag){case`Declaration`:{let n=e.annotations?.toCodecJson??e.annotations?.toCodec;if(!Mr(n))return zA(e,[Mj]);let r=n(e.typeParameters.map(e=>TM(fj(e))));return r===void 0?e:zA(e,[GA(r,t)])}case`Unknown`:return zA(e,[Mj]);case`ObjectKeyword`:return zA(e,[Nj]);case`Undefined`:case`Void`:case`Literal`:case`Number`:return e.toCodecJson();case`UniqueSymbol`:case`Symbol`:case`BigInt`:return e.toCodecStringTree();case`Objects`:return AM(e),e.recur(t,vj);case`Union`:{let n=MM(e.types);return n===e.types?e.recur(t):new bA(n,e.options,e.annotations,e.checks,e.encoding,e.context,e.encodingChecks).recur(t)}case`Arrays`:case`Suspend`:return e.recur(t)}return e}function PM(e){return TM(BM(e.ast),{schema:e})}var FM=jM(e=>{switch(e._tag){case`Null`:case`Boolean`:case`Number`:case`BigInt`:case`Symbol`:case`UniqueSymbol`:return 0;default:return 1}});function IM(e,t,n){switch(e._tag){case`Declaration`:{let r=e.typeParameters.map(e=>TM(t(fj(e)))),i=e.annotations?.toCodecStringTree;if(Mr(i)){let n=i(r);return n===void 0?e:zA(e,[GA(n,t)])}let a=e.annotations?.toCodecJson,o=Mr(a)?a(r):void 0,s=o===void 0?e.annotations?.toCodec:void 0,c=o??(Mr(s)?s(r):void 0);return c===void 0?n(e):zA(e,[GA(c,t)])}case`Null`:return zA(e,[LM]);case`Boolean`:return zA(e,[RM]);case`Unknown`:case`ObjectKeyword`:return zA(e,[Fj]);case`Enum`:case`Number`:case`Literal`:case`UniqueSymbol`:case`Symbol`:case`BigInt`:return e.toCodecStringTree();case`Objects`:return AM(e),e.recur(t,vj);case`Union`:{let n=FM(e.types);return n===e.types?e.recur(t):new bA(n,e.options,e.annotations,e.checks,e.encoding,e.context,e.encodingChecks).recur(t)}case`Arrays`:case`Suspend`:return e.recur(t)}return e}var LM=new Ck(new Ik(`null`),new WO(EO(()=>null),EO(()=>`null`))),RM=new Ck(new bA([new Ik(`true`),new Ik(`false`)]),new WO(EO(e=>e===`true`),AO())),zM=new WO(EO(e=>typeof e==`string`?[e]:e),TO()),BM=OM((e,t)=>IM(e,t,e=>{throw new globalThis.Error(`Missing structural codec for StringTree`,{cause:e})}),{stopAt:e=>e.transformation===zM}),VM=e=>e,HM=`~effect/Schema/SchemaError`;function UM(e){return O(e,`~effect/Schema/SchemaError`)&&e[`~effect/Schema/SchemaError`]===`~effect/Schema/SchemaError`}var WM=e=>{let t=0;for(let n=0;n<e.length;n++)t+=e[n].length;let n=new Uint8Array(t),r=0;for(let t=0;t<e.length;t++)n.set(e[t],r),r+=e[t].length;return n},GM=Fo((e,t)=>{let n=Math.min(e.length,t.length);for(let r=0;r<n;r++)if(e[r]!==t[r])return e[r]<t[r]?-1:1;return e.length<t.length?-1:+(e.length>t.length)});({...ia}),{...ia},{...ia},{...ia},{...ia},{...ia},{...ia},{...ia};var KM=SM;function qM(){return(e,t,n)=>K(new Ok(e.map(lA),e=>t(e.map(e=>K(e))),n))}function JM(e,t){return qM()([],()=>(t,n,r)=>e(t)?R(t):H(new $D(n,t,r)),t)}var YM=class extends iu(`SchemaError`){[HM]=HM;constructor(e){let t=sa();ca(0);try{super({issue:e})}finally{ca(t)}}get message(){return hO(this.issue)}toJSON(){return{_tag:this._tag,message:this.message}}[ta](){return this.toJSON()}toString(){return`SchemaError(${this.message})`}};function XM(e){return UM(e)}function ZM(e){return yf(e)?QM(e):$y(e,e=>By(()=>tg(e,e=>new YM(e))))}function QM(e){return Tg(e)?e:bg(tg(e.cause,e=>new YM(e)))}function $M(e,t){let n;for(let r of e.reasons){if(!Wh(r)||!XM(r.error))throw new globalThis.Error(t,{cause:e});n??=r.error}if(n===void 0)throw new globalThis.Error(t,{cause:e});return n}function eN(e){let t=ax(e);if(Tg(t))return t.value;throw $M(t.cause,`Sync adapter can only throw schema errors`)}function tN(e,t){let n=iM(e,t);return(e,t)=>ZM(n(e,t))}var nN=tN;function rN(e,t){let n=aM(e,t);return(e,t)=>fs(n(e,t),e=>new YM(e))}function iN(e,t){let n=tN(e,t);return(e,t)=>eN(n(e,t))}var aN=iN;function oN(e,t){let n=oM(e,t);return(e,t)=>ZM(n(e,t))}var sN=oN;function cN(e,t){let n=oN(e,t);return(e,t)=>eN(n(e,t))}var lN=cN,K=TM;function uN(e){return O(e,KM)&&e[KM]===KM}var dN=VM(e=>K(ej(e.ast),{schema:e})),fN=VM(e=>{let t=FN(e);return K(nj(e.ast),{schema:t})}),pN=VM(e=>K(dj(e.ast),{schema:e}));function mN(e){let t=K(new Ik(e),{literal:e,transform(n){return t.pipe(IN(mN(n),{decode:EO(()=>n),encode:EO(()=>e)}))}});return t}var hN=K(Pk),gN=K(Fk),_N=K(kk),vN=K(Mk),yN=K(Rk),bN=K(Vk),xN=K(Hk),SN=K(Nk);function CN(e,t){return K(e,{fields:t,mapFields(e,t){let n=e(this.fields);return CN(cA(n,t?.unsafePreserveChecks?this.ast.checks:void 0),n)}})}function wN(e){return CN(cA(e,void 0),e)}function TN(e,t){return K(oj(e.ast,t.ast),{key:e,value:t})}function EN(e,t){return K(e,{elements:t,mapElements(e,t){let n=e(this.elements);return EN(uA(n,t?.unsafePreserveChecks?this.ast.checks:void 0),n)}})}function DN(e){return EN(uA(e),e)}var ON=VM(e=>K(new Uk(!1,[],[e.ast]),{value:e})),kN=VM(e=>K(new Uk(!1,[e.ast],[e.ast]),{value:e}));function AN(e){let t=ON(e),n=ON(pN(e));return K(MN([IN(DN([gN]),JO({decode:e=>[e],encode:([e])=>e}))(e),t]).pipe(IN(n)).ast,{from:MN([e,t]),to:n})}function jN(e,t){return K(e,{members:t,mapMembers(e,t){let n=e(this.members);return jN(dA(n,this.ast.options,t?.unsafePreserveChecks?this.ast.checks:void 0),n)}})}function MN(e,t){return jN(dA(e,t,void 0),e)}function NN(e){let t=e.map(mN);return K(dA(t,void 0,void 0),{literals:e,members:t,mapMembers(e){return MN(e(this.members))},pick(e){return NN(e)},transform(e){return MN(t.map((t,n)=>t.transform(e[n])))}})}var PN=VM(e=>MN([e,_N])),FN=VM(e=>MN([e,vN]));function IN(e,t){return n=>K(ij(n.ast,e.ast,t?KO(t):ZO()),{from:n,to:e})}function LN(e){return t=>K(rj(t.ast,e),{schema:t})}function RN(e){return mN(e).pipe(LN(R(e)))}function zN(e,t){return wN({_tag:RN(e),...t})}function BN(e){return t=>{let n={},r=[],i=new Set,a={};return o(t),Object.assign(t,{tag:e,cases:n,discriminants:r,isAnyOf:t=>n=>t.includes(n[e]),guards:a,match:s,matchOrElse:c});function o(t){let s=t.ast;if(xk(s)&&`members`in t&&globalThis.Array.isArray(t.members)&&t.members.every(uN))return t.members.forEach(o);let c=mA(s);if(c.length>0){let o=c.find(t=>t.key===e)?.literal;if(jr(o)){let e=typeof o==`number`?globalThis.String(o):o;if(i.has(e))throw new globalThis.Error(`Duplicate discriminant: ${globalThis.String(o)}`);i.add(e),r.push(o),Fi(n,o,t),Fi(a,o,tM(pN(t)));return}}throw new globalThis.Error(`No literal or unique symbol found`)}function s(){if(arguments.length===1){let t=arguments[0];return function(n){let r=n[e];return(Object.hasOwn(t,r)?t[r]:void 0)(n)}}let t=arguments[0],n=arguments[1],r=t[e];return(Object.hasOwn(n,r)?n[r]:void 0)(t)}function c(){if(arguments.length===2){let t=arguments[0],n=arguments[1];return function(r){let i=r[e];return(Object.hasOwn(t,i)?t[i]??n:n)(r)}}let t=arguments[0],n=arguments[1],r=arguments[2],i=t[e];return(Object.hasOwn(n,i)?n[i]??r:r)(t)}}}function VN(e){let t={},n=[];for(let r of Object.keys(e)){let i=zN(r,e[r]);Fi(t,r,i),n.push(i)}let r=MN(n),{tag:i,guards:a,isAnyOf:o,match:s,matchOrElse:c}=BN(`_tag`)(r);return K(r.ast,{tag:i,cases:t,isAnyOf:o,guards:a,match:s,matchOrElse:c})}function HN(e,t){return JM(t=>t instanceof e,t)}function UN(){return(e,t)=>new Ck(e.ast,KO(t))}var WN=jA;function GN(e,t){let n=e.source,r=e.flags,i=/^[dg]*uy?$/.test(r),a=r===``?`new globalThis.RegExp(${Wi(n)})`:`new globalThis.RegExp(${Wi(n)}, ${Wi(r)})`;return FA(e,{toJsonSchema:()=>i?{pattern:r.endsWith(`y`)?`^(?:${n})`:n}:[{},!0],toCode:()=>({runtime:`Schema.isPattern(${a})`}),...t})}var KN=K(NA);function qN(e){return WN(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`},...e})}var JN=bN.check(qN());function YN(e,t){return e=$N(e),XN(e,Math.ceil(e/2),t)}function XN(e,t,n){return WN(t=>t.length>=e,{expected:`a value with a length of at least ${e}`,representation:{id:`effect/schema/isMinLength`,payload:{minLength:e}},toJsonSchema:({type:n})=>n===`string`?e<=1?{minLength:t}:[{minLength:t},!0]:n===`array`?{minItems:e}:n===void 0?[{minLength:t,minItems:e},!0]:[{},!0],toCode:()=>({runtime:`Schema.isMinLength(${e})`}),[PD]:!0,arbitraryConstraint:{minLength:e},...n})}function ZN(e){return XN(1,1,e)}function QN(e,t){return e=$N(e),WN(t=>t.length<=e,{expected:`a value with a length of at most ${e}`,representation:{id:`effect/schema/isMaxLength`,payload:{maxLength:e}},toJsonSchema:({type:t})=>t===`string`?e===0?{maxLength:e}:[{maxLength:e},!0]:t===`array`?{maxItems:e}:t===void 0?[{maxLength:e,maxItems:e},!0]:[{},!0],toCode:()=>({runtime:`Schema.isMaxLength(${e})`}),[PD]:!0,arbitraryConstraint:{maxLength:e},...t})}function $N(e){if(!globalThis.Number.isFinite(e))throw new globalThis.RangeError(`Expected a finite number, got ${e}`);return Math.max(0,Math.floor(e))}var eP=yN.check(ZN()),tP=e=>+(e?.includeStack===!0)|(e?.excludeCause===!0?2:0),nP=e=>{switch(e){case 0:return;case 1:return{includeStack:!0};case 2:return{excludeCause:!0};case 3:return{includeStack:!0,excludeCause:!0}}},rP=[];function iP(e){let t=tP(e),n=rP[t];if(n!==void 0)return n;let r=DP.pipe(IN(gN,ak(nP(t))));return rP[t]=r,r}globalThis.RegExp,globalThis.URL;var aP=yN.annotate({expected:`a string that will be decoded as JSON`});function oP(e,t){return aP.pipe(IN(e,ck(t)))}globalThis.File,globalThis.URLSearchParams;var sP=yN.annotate({expected:`a URI component encoded string that will be decoded as a UTF-8 string`}).pipe(IN(yN,sk)),cP=yN.annotate({expected:`a base64 encoded string that will be decoded as Uint8Array`,format:`byte`,contentEncoding:`base64`}),lP=HN(globalThis.Uint8Array,{representation:{id:`effect/schema/Uint8Array`,payload:null},toCode:()=>({runtime:`Schema.Uint8Array`,Type:`globalThis.Uint8Array`}),expected:`Uint8Array`,toCodecJson:()=>UN()(cP,ok)});function uP(e,t){return K(qM()([e,t],([e,t])=>(n,r,i)=>{if(!Uh(n))return H(new $D(r,n,i));switch(n._tag){case`Fail`:return fx(iM(e)(n.error,i),{onSuccess:Zh,onFailure:e=>tO(r,`error`,e,n,i)});case`Die`:return fx(iM(t)(n.defect,i),{onSuccess:Qh,onFailure:e=>tO(r,`defect`,e,n,i)});case`Interrupt`:return R(n)}},{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])=>UN()(MN([wN({_tag:mN(`Fail`),error:e}),wN({_tag:mN(`Die`),defect:t}),wN({_tag:mN(`Interrupt`),fiberId:FN(KN)})]),JO({decode:e=>{switch(e._tag){case`Fail`:return Zh(e.error);case`Die`:return Qh(e.defect);case`Interrupt`:return $h(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})}function dP(e,t){return K(qM()([e,t],([e,t])=>{let n=ON(uP(e,t));return(e,t,r)=>Hh(e)?fx(iM(n)(e.reasons,r),{onSuccess:qh,onFailure:n=>tO(t,`reasons`,n,e,r)}):H(new $D(t,e,r))},{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])=>UN()(ON(uP(e,t)),JO({decode:qh,encode:({reasons:e})=>e}))}).ast,{error:e,defect:t})}function fP(e,t,n){return K(qM()([e,t,n],([e,t,n])=>{let r=dP(t,n);return(t,n,i)=>{if(!vg(t))return H(new $D(n,t,i));switch(t._tag){case`Success`:return fx(iM(e)(t.value,i),{onSuccess:yg,onFailure:e=>tO(n,`value`,e,t,i)});case`Failure`:return fx(iM(r)(t.cause,i),{onSuccess:bg,onFailure:e=>tO(n,`cause`,e,t,i)})}}},{representation:{id:`effect/schema/Exit`,payload:null},toCode:({typeParameters:e})=>({runtime:`Schema.Exit(${e[0].runtime}, ${e[1].runtime}, ${e[2].runtime})`,Type:`Exit.Exit<${e[0].Type}, ${e[1].Type}, ${e[2].Type}>`,importDeclarations:[`import * as Exit from "effect/Exit"`]}),expected:`Exit`,toCodec:([e,t,n])=>UN()(MN([wN({_tag:mN(`Success`),value:e}),wN({_tag:mN(`Failure`),cause:dP(t,n)})]),JO({decode:e=>e._tag===`Success`?yg(e.value):bg(e.cause),encode:e=>Tg(e)?{_tag:`Success`,value:e.value}:{_tag:`Failure`,cause:e.cause}}))}).ast,{value:e,error:t,defect:n})}function pP(e){return K(qM()([e],([e])=>(t,n,r)=>Uo(t)?Wo(t)?Fy:fx(iM(e)(t.value,r),{onSuccess:N,onFailure:e=>tO(n,`value`,e,t,r)}):H(new $D(n,t,r)),{representation:{id:`effect/schema/Option`,payload:null},toCode:({typeParameters:e})=>({runtime:`Schema.Option(${e[0].runtime})`,Type:`Option.Option<${e[0].Type}>`,importDeclarations:[`import * as Option from "effect/Option"`]}),expected:`Option`,toCodec:([e])=>UN()(MN([wN({_tag:mN(`Some`),value:e}),wN({_tag:mN(`None`)})]),JO({decode:e=>e._tag===`None`?M():N(e.value),encode:e=>Go(e)?{_tag:`Some`,value:e.value}:{_tag:`None`}}))}).ast,{value:e})}var mP=globalThis.Symbol.for(`immer-draftable`),hP={};function gP(e,t,n,r,i){let a=bP(n,t,r),o=yP(t),s=class extends e{constructor(...[e,t]){let r=t?.[`~payload`],i=r?.token===hP?r.value:n.make(e??{},t);super(i,{...t,disableChecks:!0,"~payload":{token:hP,value:i}})}static[KM]=KM;get[o](){return o}static[mP]=!0;static identifier=t;static fields=n.fields;static get ast(){return a(this).ast}static pipe(){return T(this,arguments)}static rebuild(e){return a(this).rebuild(e)}static make(e,t){return yM(dj(a(this).ast),e??{},t,e=>_P(this,e))}static makeOption(e,t){return $j(a(this))(e??{},t)}static makeEffect(e,t){return a(this).makeEffect(e??{},t)}static annotate(e){return this.rebuild(HA(this.ast,e))}static annotateKey(e){return this.rebuild($A(this.ast,e))}static check(...e){return this.rebuild(WA(this.ast,e))}static extend(e){return(t,r)=>{let a=xP(t)?t:wN(t),o={...n.fields,...a.fields},s=cA(o,n.ast.checks,{identifier:e});return gP(this,e,CN(WA(s,a.ast.checks),o),r,i)}}static mapFields(e,t){return n.mapFields(e,t)}};return i!==void 0&&Object.assign(s.prototype,i(t)),s}function _P(e,t){return new e(t,{"~payload":{token:hP,value:t}})}function vP(e){return new WO(EO(t=>_P(e,t)),TO())}function yP(e){return`~effect/Schema/Class/${e}`}function bP(e,t,n){let r;return i=>{if(r!==void 0)return r;let a=yP(t),o=e=>e instanceof i||O(e,a),s=vP(i);return r=IN(K(new Ok([e.ast],()=>(e,t,n)=>o(e)?R(e):H(new $D(t,e,n)),{identifier:t,[ID]:([e])=>({isConstructed:o,link:new Ck(e,s)}),toCodec:([e])=>new Ck(e.ast,s),toEquivalence:([e])=>e,toFormatter:([e])=>t=>`${i.identifier}(${e(t)})`,[FD]:mA(e.ast),...n})),s)(e)}}function xP(e){return uN(e)}var SP=e=>(t,n)=>gP(nu,e,xP(t)?t:wN(t),n,e=>({toString(){return`${e}(${Wi({...this})})`}})),CP=e=>(t,n)=>gP(no,e,xP(t)?t:wN(t),n,e=>({name:e})),wP=e=>(t,n,r)=>{let i=xP(n)?n.mapFields(e=>({_tag:RN(t),...e}),{unsafePreserveChecks:!0}):zN(t,n);return CP(e??t)(i,r)},TP=EM,EP=PM,DP=K(HA(jj,{toCode:()=>({runtime:`Schema.Json`,Type:`Schema.Json`})}));function OP(e){return ND(e.ast)}var kP=`~effect/Config`,AP=class{_tag=`ConfigError`;name=`ConfigError`;cause;constructor(e){this.cause=e}get message(){return this.cause.toString()}toString(){return`ConfigError(${this.message})`}},jP={...sc({label:`Config`,evaluate(e){return this.parse(e.getRef(_T))}}),[kP]:kP,toJSON(){return{_id:`Config`}}};function MP(e){let t=Object.create(jP);return t.evaluator=e,t.parse=t=>px(e(t,[]),Gy),t}var NP=(e,t,n)=>e.evaluator(t,n),PP=E(2,(e,t)=>MP((n,r)=>W(NP(e,n,r),ps(t)))),FP=E(2,(e,t)=>MP((n,r)=>ux(NP(e,n,r),e=>us(e)?os(t):e))),IP=e=>e.pipe(PP(N),FP(M())),LP=e=>Vr(e,`SourceError`),RP=()=>`<configuration>`,zP=e=>t=>$y(t,t=>zy(qh(t.reasons.map(e)))),BP=(e,t)=>e.load(t).pipe(zP(e=>Wh(e)?Qh(e.error).annotate(mg(e)):e),ux(n=>({provider:e,path:t,node:n,toString:RP}))),VP=(e,t)=>BP(e.provider,[...e.path,t]),HP=(e,t)=>ij(Fk,e,new WO(DO(e=>t(e)),TO())),UP=e=>{switch(e._tag){case`Union`:return e.types.every(UP);case`Objects`:case`Arrays`:case`Suspend`:return!1;default:return!0}},WP=(e,t)=>{switch(e._tag){case`Objects`:return t?._tag===`Record`;case`Arrays`:return t?._tag===`Array`;case`Union`:return e.types.some(e=>WP(e,t));case`Suspend`:return WP(e.thunk(),t);default:return t?.value!==void 0}},GP=vr(e=>{let t=new WeakSet,n=YA(e=>{switch(t.add(e),e._tag){case`Objects`:{let t=ox(function*(t){if(t.node?._tag!==`Record`)return;let n=t.node,r=new Set;for(let t of e.propertySignatures)typeof t.name==`string`&&r.add(t.name);if(e.indexSignatures.length>0){let t={};for(let e of n.keys)Fi(t,e,void 0);for(let n of e.indexSignatures)for(let e of Xk(t,n.parameter))typeof e==`string`&&r.add(e)}let i={};for(let e of r){let n=yield*VP(t,e);n.node!==void 0&&Fi(i,e,n)}return i});return HP(e.recur(n,e=>e),t)}case`Arrays`:{let t=ox(function*(e){if(e.node?._tag!==`Array`)return;let t=[];for(let n=0;n<e.node.length;n++)t.push(yield*VP(e,n));return t});return HP(e.recur(n),t)}case`Union`:for(let t of e.types)n(t);if(!UP(e))return e.recur(n);break;case`Suspend`:{let r=e.thunk();return t.has(r)||n(r),e.recur(n)}case`Declaration`:case`Any`:throw new globalThis.Error(`Config.schema does not support opaque StringTree encodings`,{cause:e})}return HP(e,e=>R(e.node?.value))});return n(e)});function KP(e,t){let n=EP(e),r=fj(n.ast),i=iM(K(GP(n.ast))),a=typeof t==`string`?[t]:t??[];return MP((e,t)=>{let n=[...t,...a];return BP(e,n).pipe(px(e=>i(e).pipe(ux(os),mx(t=>{let i=new AP(new YM(n.length>0?new YD(n,t):t));return WP(r,e.node)?H(i):R(ss(i))}))),zP(e=>Gh(e)&&LP(e.defect)?Zh(new AP(e.defect)).annotate(mg(e)):e))})}var qP=e=>Dr(e)||globalThis.Array.isArray(e);function JP(e){return KP(yN,e)}function YP(e,t,n,r){let i=qP(n),a=TN(e,t),o=YO(i?r:n);return KP(MN([a,yN.pipe(IN(EP(a),{decode:o.decode,encode:CO(TO({strict:!1}),o.encode)}))]),i?n:void 0)}var XP=`~effect/Match/Matcher`,ZP={[XP]:{_input:D,_filters:D,_remaining:D,_result:D,_return:D,_args:D},_tag:`TypeMatcher`,add(e){return QP(this.select,[...this.cases,e])},pipe(){return T(this,arguments)}};function QP(e,t){let n=Object.create(ZP);return n.select=e,n.cases=t,n}var $P={[XP]:{_input:D,_filters:D,_result:D,_return:D,_flavor:D},_tag:`ValueMatcher`,add(e){return ds(this.value)?this:e._tag===`When`&&e.guard(this.provided)===!0||e._tag===`Not`&&e.guard(this.provided)===!1?eF(this.provided,os(e.evaluate(this.provided))):this},pipe(){return T(this,arguments)}};function eF(e,t){let n=Object.create($P);return n.provided=e,n.value=t,n}var tF=(e,t)=>({_tag:`When`,guard:e,evaluate:t}),nF=e=>{if(typeof e==`function`)return e;if(Array.isArray(e)){let t=e.map(nF),n=t.length;return e=>{if(!Array.isArray(e)||e.length<n)return!1;for(let r=0;r<n;r++)if(t[r](e[r])===!1)return!1;return!0}}if(typeof e==`object`&&e){let t=Reflect.ownKeys(e).map(t=>[t,nF(e[t])]),n=t.length;return e=>{if(typeof e!=`object`||!e)return!1;for(let r=0;r<n;r++){let[n,i]=t[r];if(!(n in e)||i(e[n])===!1)return!1}return!0}}return t=>t===e},rF=()=>QP(D,[]),iF=e=>eF(e,ss(e)),aF=(e,t)=>n=>n.add(tF(nF(e),t)),oF=e=>(...t)=>{let n=t[t.length-1],r=t.slice(0,-1),i=r.length===1?t=>t!=null&&t[e]===r[0]:t=>t!=null&&r.includes(t[e]);return e=>e.add(tF(i,n))},sF=e=>t=>{let n=tF(n=>n!=null&&Object.hasOwn(t,n[e]),n=>t[n[e]](n));return e=>e.add(n)},cF=e=>t=>{let n=sF(e)(t);return e=>mF(n(e))},lF=oF(`_tag`),uF=cF(`_tag`),dF=e=>t=>{let n=fF(t);return ls(n)?n._tag===`Success`?n.success:e(n.failure):(...t)=>{let r=n(...t);return ds(r)?r.success:e(r.failure,...t)}},fF=e=>{if(e._tag===`ValueMatcher`)return e.value;let t=e.cases.length;if(t===1){let t=e.cases[0];return(...n)=>{let r=e.select(...n);return t._tag===`When`&&t.guard(r)===!0||t._tag===`Not`&&t.guard(r)===!1?os(t.evaluate(r,...n)):ss(r)}}return(...n)=>{let r=e.select(...n);for(let i=0;i<t;i++){let t=e.cases[i];if(t._tag===`When`&&t.guard(r)===!0||t._tag===`Not`&&t.guard(r)===!1)return os(t.evaluate(r,...n))}return ss(r)}},pF=`effect/match/Match/exhaustive: absurd`,mF=e=>{let t=fF(e);if(ls(t)){if(ds(t))return t.success;throw Error(pF)}return(...e)=>{let n=t(...e);if(ds(n))return n.success;throw Error(pF)}},hF=rF,gF=iF,_F=aF,vF=lF,yF=uF,bF=dF,xF=`~effect/http/HttpBody`,SF=class{[xF];constructor(){this[xF]=xF}[ta](){return this.toJSON()}toString(){return Wi(this,{ignoreToString:!0})}},CF=new class extends SF{_tag=`Empty`;toJSON(){return{_id:`effect/HttpBody`,_tag:`Empty`}}},wF=class extends SF{_tag=`Uint8Array`;contentType;contentLength;text;_body;constructor(e,t,n,r){super(),this._body=e,this.text=r,this.contentType=t,this.contentLength=n}get body(){return this._body??=OF(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}}},TF=(e,t)=>new wF(e,t??`application/octet-stream`,e.length),EF=new TextEncoder,DF=globalThis.Buffer,OF=DF===void 0?e=>EF.encode(e):e=>DF.from(e,`utf8`),kF=(e,t)=>{if(typeof e!=`string`&&(e=e===void 0?``:String(e)),DF!==void 0)return new wF(void 0,t??`text/plain`,DF.byteLength(e,`utf8`),e);let n=EF.encode(e);return new wF(n,t??`text/plain`,n.length,e)},AF=class extends SF{_tag=`Stream`;stream;contentType;contentLength;constructor(e,t,n){super(),this.stream=e,this.contentType=t,this.contentLength=n}toJSON(){return{_id:`effect/HttpBody`,_tag:`Stream`,contentType:this.contentType,contentLength:this.contentLength}}},jF=(e,t,n)=>new AF(e,t??`application/octet-stream`,n),MF=`~effect/http/HttpClientError`,NF=e=>O(e,MF),PF=class extends iu(`HttpClientError`){constructor(e){`cause`in e.reason?super({...e,cause:e.reason.cause}):super(e)}[MF]=MF;get request(){return this.reason.request}get response(){return`response`in this.reason?this.reason.response:void 0}get message(){return this.reason.message}},FF=e=>e.endsWith(`Error`)?e.slice(0,-5):e,IF=(e,t,n)=>t?`${e}: ${t} (${n})`:`${e} error (${n})`,LF=e=>`${e.method} ${wD(e.url)}`,RF=(e,t)=>({...t,request:{_id:`HttpClientRequest`,method:e.request.method,url:wD(e.request.url)},...`response`in e?{response:{_id:`HttpClientResponse`,status:e.response.status}}:void 0}),zF=class extends iu(`TransportError`){get methodAndUrl(){return LF(this.request)}get message(){return IF(FF(this._tag),this.description,this.methodAndUrl)}toJSON(){return RF(this,super.toJSON())}},BF=class extends iu(`EncodeError`){get methodAndUrl(){return LF(this.request)}get message(){return IF(FF(this._tag),this.description,this.methodAndUrl)}toJSON(){return RF(this,super.toJSON())}},VF=class extends iu(`InvalidUrlError`){get methodAndUrl(){return LF(this.request)}get message(){return IF(FF(this._tag),this.description,this.methodAndUrl)}toJSON(){return RF(this,super.toJSON())}},HF=class extends iu(`StatusCodeError`){get methodAndUrl(){return LF(this.request)}get message(){let e=`${this.response.status} ${this.methodAndUrl}`;return IF(FF(this._tag),this.description,e)}toJSON(){return RF(this,super.toJSON())}},UF=class extends iu(`DecodeError`){get methodAndUrl(){return LF(this.request)}get message(){let e=`${this.response.status} ${this.methodAndUrl}`;return IF(FF(this._tag),this.description,e)}toJSON(){return RF(this,super.toJSON())}},WF=class extends iu(`EmptyBodyError`){get methodAndUrl(){return LF(this.request)}get message(){let e=`${this.response.status} ${this.methodAndUrl}`;return IF(FF(this._tag),this.description,e)}toJSON(){return RF(this,super.toJSON())}},GF=class e extends CP(MF)({_tag:RN(`HttpError`),kind:NN([`EncodeError`,`DecodeError`,`TransportError`,`InvalidUrlError`,`StatusCodeError`,`EmptyBodyError`]),cause:fN(iP())}){static fromHttpClientError(t){return new e({_tag:`HttpError`,kind:t.reason._tag,cause:t.reason})}},KF=[[`GET`,`get`],[`POST`,`post`],[`PUT`,`put`],[`DELETE`,`del`],[`PATCH`,`patch`],[`HEAD`,`head`],[`OPTIONS`,`options`],[`TRACE`,`trace`],[`QUERY`,`query`]],qF=e=>t=>t.pipeThrough(new CompressionStream(e)),JF=e=>new ReadableStream({start(t){t.enqueue(e),t.close()}}),YF=(e,t,n)=>e._tag!==`Uint8Array`&&e._tag!==`Stream`||e.contentLength!==void 0&&e.contentLength<(n?.minSize??1024)?R(e):e._tag===`Uint8Array`?W(Ny(()=>new globalThis.Response(qF(t)(JF(e.body))).arrayBuffer()),t=>TF(new Uint8Array(t),e.contentType)):R(jF(Hw({evaluate:()=>qF(t)(dT(e.stream)),onError:D}),e.contentType)),XF=(e,t)=>t._tag===`Empty`||t._tag===`FormData`?qE(qE(e,`content-type`),`content-length`):(e=t.contentType===void 0?qE(e,`content-type`):WE(e,`content-type`,t.contentType),ZF(e,t)),ZF=(e,t)=>{let n=t._tag===`Empty`||t._tag===`FormData`?void 0:t.contentLength;return n===void 0?qE(e,`content-length`):WE(e,`content-length`,n.toString())},QF=class extends iu(`UrlError`){},$F=(e,t,n)=>cs({try:()=>{let r=new URL(e,eI());for(let e=0;e<t.params.length;e++){let[n,i]=t.params[e];i!==void 0&&r.searchParams.append(n,cD(i))}return n!==void 0&&(r.hash=n),r},catch:e=>new QF({cause:e})}),eI=()=>{if(`location`in globalThis&&globalThis.location!==void 0&&globalThis.location.origin!==void 0&&globalThis.location.pathname!==void 0){let e=location.origin+location.pathname;try{return new URL(e).href}catch{return}}},tI=(e,t)=>cs({try:()=>new URL(e,t),catch:()=>new pg(`Invalid URL: "${e}"${t===void 0?``:` with base "${t}"`}`)}),nI=`~effect/http/HttpClientRequest`,rI=e=>O(e,nI),iI={[nI]:nI,...ia,toJSON(){return{_id:`HttpClientRequest`,method:this.method,url:wD(this.url),urlParams:this.urlParams,hash:this.hash,headers:zi(this.headers),body:this.body.toJSON()}},pipe(){return T(this,arguments)}};function aI(e,t,n,r,i,a){let o=Object.create(iI);return o.method=e,o.url=t,o.urlParams=n,o.hash=r,o.headers=i,o.body=a,o}var oI=aI(`GET`,``,bD,M(),VE,CF),sI=e=>(t,n)=>lI(oI,{method:e,url:t,...n??void 0}),cI=sI(`POST`),lI=E(2,(e,t)=>{let n=e;return t.method&&(n=uI(n,t.method)),t.url&&(n=hI(n,t.url)),t.headers&&(n=fI(n,t.headers)),t.urlParams&&(n=gI(n,t.urlParams)),t.hash&&(n=_I(n,t.hash)),t.body&&(n=vI(n,t.body)),t.accept&&(n=pI(n,t.accept)),t.acceptJson&&(n=mI(n)),n}),uI=E(2,(e,t)=>aI(t,e.url,e.urlParams,e.hash,e.headers,e.body)),dI=E(3,(e,t,n)=>aI(e.method,e.url,e.urlParams,e.hash,WE(e.headers,t,n),e.body)),fI=E(2,(e,t)=>aI(e.method,e.url,e.urlParams,e.hash,GE(e.headers,t),e.body)),pI=E(2,(e,t)=>dI(e,`Accept`,t)),mI=pI(`application/json`),hI=E(2,(e,t)=>{if(typeof t==`string`)return aI(e.method,t,e.urlParams,e.hash,e.headers,e.body);let n=new URL(t.toString()),r=hD(n.searchParams),i=Yo(n.hash===``?void 0:n.hash.slice(1));return n.search=``,n.hash=``,aI(e.method,n.toString(),r,i,e.headers,e.body)}),gI=E(2,(e,t)=>aI(e.method,e.url,xD(e.urlParams,t),e.hash,e.headers,e.body)),_I=E(2,(e,t)=>aI(e.method,e.url,e.urlParams,N(t),e.headers,e.body)),vI=E(2,(e,t)=>aI(e.method,e.url,e.urlParams,e.hash,XF(e.headers,t),t)),yI=E(e=>rI(e[0]),(e,t,n)=>e.headers[`content-encoding`]===void 0?W(YF(e.body,t,n),n=>n===e.body?e:aI(e.method,e.url,e.urlParams,e.hash,WE(ZF(e.headers,n),`content-encoding`,t),n)):R(e));function bI(e){let t=$F(e.url,e.urlParams,Qo(e.hash));return ds(t)?N(t.success):M()}var xI=`~effect/http/HttpIncomingMessage`,SI=(e,t)=>{let n=nN(TP(e)),r=t?.reviver===void 0?void 0:nN(oP(TP(e),t));return e=>r===void 0?U(e.json,e=>n(e,t)):U(e.text,i=>i===``?U(e.json,e=>n(e,t)):r(i,t))},CI=(e,t)=>({...t,headers:zi(e.headers),remoteAddress:e.remoteAddress}),wI=`~effect/http/HttpClientResponse/WebSource`,TI=e=>e[wI]?.(),EI=`~effect/http/HttpClientResponse`,DI=(e,t)=>new kI(e,t),OI=e=>e.status>=200&&e.status<300?R(e):H(new PF({reason:new HF({response:e,request:e.request,description:`non 2xx status code`})})),kI=class extends aa{[xI];[EI];request;source;constructor(e,t){super(),this.request=e,this.source=t,this[xI]=xI,this[EI]=EI}toJSON(){return CI(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=bI(this.request);return Wo(e)?``:(e.value.hash=``,e.value.href)}get headers(){return HE(this.source.headers)}cachedCookies;get cookies(){return this.cachedCookies?this.cachedCookies:this.cachedCookies=CE(this.source.headers.getSetCookie?.()??[])}get remoteAddress(){return M()}[wI](){return this.source}get stream(){return this.source.body?Hw({evaluate:()=>this.source.body,onError:e=>new PF({reason:new UF({request:this.request,response:this,cause:e})})}):Lw(new PF({reason:new WF({request:this.request,response:this,description:`can not create stream from empty body`})}))}get json(){return U(this.text,e=>Hy({try:()=>e===``?null:JSON.parse(e),catch:e=>new PF({reason:new UF({request:this.request,response:this,cause:e})})}))}textBody;get text(){return this.textBody??=W(this.arrayBuffer,e=>new TextDecoder().decode(e))}get urlParamsBody(){return U(this.arrayBuffer,e=>Hy({try:()=>hD(uD(e)),catch:e=>new PF({reason:new UF({request:this.request,response:this,cause:e})})}))}formDataBody;get formData(){return this.formDataBody??=Py({try:()=>this.source.formData(),catch:e=>new PF({reason:new UF({request:this.request,response:this,cause:e})})}).pipe(Pb,rx)}arrayBufferBody;get arrayBuffer(){return this.arrayBufferBody||=Py({try:()=>this.source.arrayBuffer(),catch:e=>new PF({reason:new UF({request:this.request,response:this,cause:e})})}).pipe(Pb,rx),this.arrayBufferBody}get upgrade(){return H(new PF({reason:new HF({request:this.request,response:this,description:`fetch cannot hand over the connection of an HTTP upgrade`})}))}pipe(){return T(this,arguments)}},AI=e=>UE({b3:`${e.traceId}-${e.spanId}-${e.sampled?`1`:`0`}${Ko(e.parent,{onNone:()=>``,onSome:e=>`-${e.spanId}`})}`,traceparent:`00-${e.traceId.padStart(32,`0`)}-${e.spanId}-${e.sampled?`01`:`00`}`}),jI={"http:":80,"https:":443,"ws:":80,"wss:":443},MI=(e,t,n)=>{let r=wD(t.search,n).slice(1);if(e.attribute(`url.full`,wD(t.href,n)),e.attribute(`url.path`,t.pathname),r!==``&&e.attribute(`url.query`,r),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 n=t.port===``?jI[t.protocol]:Number(t.port);n!==void 0&&e.attribute(`server.port`,n)}},NI=(e,t)=>{let n=e.params.filter(([,e])=>typeof e!=`string`).map(([e])=>e);return n.length===0?t:[...t,...new URLSearchParams(n.map(e=>[e,``])).keys()]},PI=(e,t,n,r,i)=>{for(let a in n)r(a,t)&&e.attribute(`http.${t}.header.${a}`,YE(a,i)?`<redacted>`:n[a])},FI=`~effect/http/HttpClient`,II=lc(`effect/HttpClient`),LI=(e=>(...t)=>U(II,n=>n[e](...t)))(`get`),RI=E(2,(e,t)=>BI(n=>t(e.postprocess(n)),e.preprocess)),zI=RI(U(OI)),BI=(e,t)=>{let n=Object.create(VI);return n.preprocess=t,n.postprocess=e,n.execute=function(n){return e(t(n))},n},VI={[FI]:FI,pipe(){return T(this,arguments)},...ia,toJSON(){return{_id:`effect/HttpClient`}},...Object.fromEntries(KF.map(([e,t])=>[t,function(t,n){return this.execute(sI(e)(t,n))}]))},HI=e=>BI(t=>U(t,t=>Wy(n=>{let r=eL.get(t),i=r??new AbortController,a=$F(t.url,t.urlParams,Qo(t.hash));if(us(a))return H(new PF({reason:new VF({request:t,cause:a.failure})}));let o=a.success;if(n.getRef(hu)||n.getRef(JI)(t)){let a=e(t,o,i.signal,n);return r?W(a,e=>nL(e,i,!0)):zb(e=>_b(e(a),{onSuccess(e){return R(nL(e,i,!1))},onFailure(e){return ag(e)&&i.abort(),zy(e)}}))}return Wb(n.getRef(ZI)(t),{kind:`client`},a=>{a.attribute(`http.request.method`,t.method);let s=n.getRef(XE);MI(a,o,NI(t.urlParams,n.getRef(MD)));let c=n.getRef(YI);return PI(a,`request`,t.headers,c,s),t=n.getRef(XI)?fI(t,AI(a)):t,zb(l=>l(e(t,o,i.signal,n)).pipe(Kb(a,{captureStackTrace:!1}),_b({onSuccess:e=>(a.attribute(`http.response.status_code`,e.status),PI(a,`response`,e.headers,c,s),e.status>=400&&e.status<600&&(a.attribute(`error.type`,String(e.status)),UI(n,a,t,e)),R(nL(e,i,r!==void 0))),onFailure(e){return!r&&ag(e)&&i.abort(),zy(e)}})))})})),R),UI=(e,t,n,r)=>{let i=sa();ca(0);let a;try{a=xg(new PF({reason:new HF({request:n,response:r})}))}finally{ca(i)}t.end(e.getRef(Wg)?e.getRef(hg).currentTimeNanosUnsafe():BigInt(0),a)},WI=E(2,(e,t)=>{let n=Zv(t),r=n?`errors-and-responses`:t.retryOn??`errors-and-responses`,i=sL(n?t:t.schedule??dy),a=n?void 0:t.times;return RI(e,_r(r===`errors-only`?D:Vb({schedule:i,times:a,while:cL}),r===`response-only`?D:ab({while:n||t.while===void 0?iL:Wr(iL,t.while),schedule:i,times:a})))}),GI=(e,t)=>{if(t===void 0)return;let n=oD(t);return ds(n)?Rl(sD(n.success,e),Ol(1)):void 0},KI=E(2,(e,t)=>RI(e,Jy(t))),qI=E(2,(e,t)=>RI(e,rb(t))),JI=P(`effect/http/HttpClient/TracerDisabledWhen`,{defaultValue:()=>pr}),YI=P(`effect/http/HttpClient/TracerHeaderFilter`,{defaultValue:()=>pr}),XI=P(`effect/http/HttpClient/TracerPropagationEnabled`,{defaultValue:fr}),ZI=P(`effect/http/HttpClient/SpanNameGenerator`,{defaultValue:()=>e=>e.method}),QI=e=>v_(II)(yb(t=>W(e,e=>RI(e,Cb(e=>zc(t,e)))))),$I=(()=>{if(`FinalizationRegistry`in globalThis&&globalThis.FinalizationRegistry){let e=new FinalizationRegistry(e=>{try{e.abort()}catch{}});return{register(t,n){e.register(t,n,t)},unregister(t){e.unregister(t)}}}let e=new WeakMap;return{register(t,n){e.set(t,setTimeout(()=>n.abort(),5e3))},unregister(t){let n=e.get(t);n!==void 0&&(clearTimeout(n),e.delete(t))}}})(),eL=new WeakMap,tL=new WeakMap,nL=(e,t,n)=>(n||($I.register(e,t),e=new rL(e,t)),tL.set(e,t),e),rL=class{original;controller;constructor(e,t){this.original=e,this.controller=t}[EI]=EI;[xI]=xI;applyInterrupt(e){return z(()=>($I.unregister(this.original),Lb(e,()=>B(()=>{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)}[wI](){let e=TI(this.original);return e!==void 0&&$I.unregister(this.original),e}get stream(){return Fw(()=>($I.unregister(this.original),iT(this.original.stream,B(()=>{this.controller.abort()}))))}toJSON(){return this.original.toJSON()}[ta](){return this.original[ta]()}pipe(){return T(this,arguments)}},iL=e=>fg(e)||aL(e),aL=e=>NF(e)&&(e.reason._tag===`TransportError`||e.reason._tag===`StatusCodeError`&&cL(e.reason.response)),oL=(e,t)=>GI(t,(NF(e)?e.response:O(e,`~effect/http/HttpClientResponse`)?e:void 0)?.headers[`retry-after`]),sL=e=>Qv(W(ty(e),e=>(t,n)=>{let r=oL(n,t);return r===void 0?e(t,n):W(e(t,n),([e,t])=>[e,Rl(t,r)])})),cL=e=>e.status===408||e.status===429||e.status===500||e.status===502||e.status===503||e.status===504,lL=P(`effect/http/FetchHttpClient/Fetch`,{defaultValue:()=>globalThis.fetch}),uL=P(`effect/http/FetchHttpClient/StreamBodyFallback`,{defaultValue:()=>`error`}),dL=class extends lc()(`effect/http/FetchHttpClient/RequestInit`){},fL,pL=()=>{try{let e=!1,t=new ReadableStream,n=new Request(`https://example.com`,{method:`POST`,body:t,get duplex(){return e=!0,`half`}});return(e||n.body===t)&&!n.headers.has(`Content-Type`)}catch{return!1}},mL=QI(R(HI((e,t,n,r)=>{if(e.headers.upgrade!==void 0)return H(new PF({reason:new zF({request:e,description:`fetch cannot send an HTTP upgrade request`})}));let i=r.getRef(lL),a=jc(r.context,dL)??{},o=a.headers?KE(HE(a.headers),e.headers):e.headers;o[`content-length`]&&(o=qE(o,`content-length`));let s,c=B(()=>s?.abort()),l=r=>W(Py({try:()=>i(t,{...a,method:e.method,headers:o,body:r,duplex:typeof ReadableStream<`u`&&r instanceof ReadableStream?`half`:void 0,signal:s?AbortSignal.any([n,s.signal]):n}),catch:t=>new PF({reason:new zF({request:e,cause:t})})}),t=>{let n=DI(e,t);return s?(t.body===null&&s.abort(),Object.create(n,{...Object.fromEntries([`arrayBuffer`,`text`,`json`,`formData`,`urlParamsBody`].map(e=>[e,{get:()=>Ab(n[e],c)}])),stream:{get:()=>iT(n.stream,c)}})):n}).pipe(jb(()=>c));switch(e.body._tag){case`Raw`:case`Uint8Array`:return l(e.body.body);case`FormData`:return l(e.body.formData);case`Stream`:if(fL??=pL(),fL){s=new AbortController;let t=AbortSignal.any([n,s.signal]),r=Iy(e=>{let n=()=>e(Fb);if(t.aborted)n();else return t.addEventListener(`abort`,n,{once:!0}),B(()=>t.removeEventListener(`abort`,n))});return U(fT(tT(e.body.stream,r)),l)}return r.getRef(uL)===`error`?H(new PF({reason:new BF({request:e,description:`Streaming request bodies are not supported in this runtime`})})):lT(e.body.stream).pipe(tb(t=>new PF({reason:new BF({request:e,cause:t})})),U(l))}return l(void 0)}))),hL=`~effect/reactivity/AsyncResult`,gL=e=>O(e,hL),_L={[hL]:{E:D,A:D},pipe(){return T(this,arguments)},[ui](e){if(!gL(e)||this._tag!==e._tag||this.waiting!==e.waiting)return!1;switch(this._tag){case`Initial`:return!0;case`Success`:return di(this.value,e.value);case`Failure`:return di(this.cause,e.cause)}},[Gr](){let e=$r(`${this._tag}:${this.waiting}`);return this._tag===`Initial`?e:Jr(e)(this._tag===`Success`?k(this.value):k(this.cause))}},vL=e=>e.waiting,yL=e=>e._tag===`Success`?EL(e.value):OL(e.cause),bL=(e,t)=>e._tag===`Success`?EL(e.value):kL(e.cause,{previous:t}),xL=e=>e._tag===`None`?wL(!0):jL(e.value),SL=e=>e._tag===`Initial`,CL=e=>e._tag!==`Initial`,wL=(e=!1)=>{let t=Object.create(_L);return t._tag=`Initial`,t.waiting=e,t},TL=e=>e._tag===`Success`,EL=(e,t)=>{let n=Object.create(_L);return n._tag=`Success`,n.value=e,n.waiting=t?.waiting??!1,n.timestamp=t?.timestamp??Date.now(),n},DL=e=>e._tag===`Failure`,OL=(e,t)=>{let n=Object.create(_L);return n._tag=`Failure`,n.cause=e,n.previousSuccess=t?.previousSuccess??M(),n.waiting=t?.waiting??!1,n},kL=(e,t)=>OL(e,{previousSuccess:ns(t.previous,e=>TL(e)?N(e):DL(e)?e.previousSuccess:M()),waiting:t.waiting}),AL=(e,t)=>kL(Jh(e),t),jL=E(e=>gL(e[0]),(e,t)=>{if(e.waiting)return t?.touch?ML(e):e;let n=Object.assign(Object.create(_L),e);return n.waiting=!0,t?.touch&&TL(n)&&(n.timestamp=Date.now()),n}),ML=e=>TL(e)?EL(e.value,{waiting:e.waiting}):e,NL=E(2,(e,t)=>e._tag===`Failure`?kL(e.cause,{previous:t,waiting:e.waiting}):e),PL=e=>e._tag===`Success`?N(e.value):e._tag===`Failure`?ts(e.previousSuccess,e=>e.value):M(),FL=e=>es(PL(e),()=>new lg(`AsyncResult.getOrThrow: no value found`)),IL=e=>e._tag===`Failure`?ig(e.cause):M(),LL=e=>{switch(e._tag){case`Success`:return yg(e.value);case`Failure`:return bg(e.cause);default:return xg(new lg)}},RL=E(2,(e,t)=>{switch(e._tag){case`Initial`:return e;case`Failure`:return OL(e.cause,{previousSuccess:ts(e.previousSuccess,e=>EL(t(e.value),e)),waiting:e.waiting});case`Success`:return EL(t(e.value),e)}}),zL=e=>{let t=e.success??hN,n=e.error??hN,r=qM()([t,dP(n,iP())],([e,t])=>(n,r,i)=>{if(!gL(n))return H(new $D(r,n,i));switch(n._tag){case`Initial`:return R(n);case`Success`:return fx(iM(e)(n.value,i),{onSuccess:e=>EL(e,n),onFailure:e=>tO(r,`value`,e,n,i)});case`Failure`:{let a=n.previousSuccess.pipe(ts(t=>fx(iM(e)(t.value,i),{onSuccess:e=>N(EL(e,t)),onFailure:e=>new QD(r,[new YD([`previousSuccess`,`value`],e)],n,i)})),qo(()=>Fy)),o=dx(iM(t)(n.cause,i),e=>tO(r,`cause`,e,n,i));return px(a,e=>ux(o,t=>OL(t,{previousSuccess:e,waiting:n.waiting})))}}},{expected:`AsyncResult`,toCodec([e,t]){let n=zN(`Success`,{value:e,waiting:xN,timestamp:JN});return UN()(MN([zN(`Initial`,{waiting:xN}),n,zN(`Failure`,{cause:t,previousSuccess:pP(n),waiting:xN})]),JO({decode:e=>{switch(e._tag){case`Initial`:return wL(e.waiting);case`Success`:return EL(e.value,{waiting:e.waiting,timestamp:e.timestamp});case`Failure`:return OL(e.cause,{previousSuccess:ts(e.previousSuccess,e=>EL(e.value,e)),waiting:e.waiting})}},encode(e){switch(e._tag){case`Initial`:return{_tag:`Initial`,waiting:e.waiting};case`Success`:return{_tag:`Success`,value:e.value,waiting:e.waiting,timestamp:e.timestamp};case`Failure`:return{_tag:`Failure`,cause:e.cause,previousSuccess:e.previousSuccess,waiting:e.waiting}}}}))},toEquivalence:Ei,toFormatter:([e,t])=>n=>{switch(n._tag){case`Success`:return`AsyncResult.Success(${e(n.value)}, ${n.waiting}, ${n.timestamp})`;case`Failure`:return`AsyncResult.Failure(${t(n.cause)}, ${n.waiting})`;case`Initial`:return`AsyncResult.Initial(${n.waiting}, ${n.waiting})`}}});return Object.assign(r,{success:t,error:n})},BL=`~effect/reactivity/Reactivity`,VL=lc(`effect/reactivity/Reactivity`),HL=B(()=>{let e=new Map,t=t=>{let n=new Set;for(let r of t)e.get(r)?.forEach(e=>{n.has(e)||(n.add(e),e())})},n=e=>{let n=new Set;JL(e,e=>n.add(e)),t(n)},r=e=>yb(t=>{let r=jc(t,UL);return r?JL(e,e=>{r.add(e)}):n(e),V}),i=(e,t)=>Jy(t,r(e)),a=(t,n)=>{let r=[];return JL(t,t=>{r.push(t);let i=e.get(t);i===void 0&&(i=new Set,e.set(t,i)),i.add(n)}),()=>{for(let t=0;t<r.length;t++){let i=e.get(r[t]);i!==void 0&&(i.delete(n),i.size===0&&e.delete(r[t]))}}},o=(e,t)=>Ry(function*(){let n=yield*vb(),r=Pc(n,Gg),i=yield*MS(),o=_r(Qb(n),Sx(r)),s=!1,c=!1,l=!1,u=e=>{e._tag===`Failure`?(l=!0,c=!1,s=!1,f(),zS(i,e.cause)):(FS(i,e.value),c?(c=!1,o(t).addObserver(u)):s=!1)};function d(){l||(s?c=!0:(s=!0,o(t).addObserver(u)))}let f=a(e,d);return yield*Yg(r,B(f)),d(),i}),s=(e,t)=>o(e,t).pipe(W(Bw),Ww),c=e=>z(()=>{let n=new Set;return e.pipe(wb(UL,n),Nb(e=>B(()=>t(n))))});return VL.of({[BL]:BL,mutation:i,query:o,stream:s,invalidateUnsafe:n,invalidate:r,registerUnsafe:a,withBatch:c})}),UL=class extends lc()(`effect/reactivity/Reactivity/PendingInvalidation`){},WL=E(2,(e,t)=>VL.use(n=>n.mutation(t,e))),GL=e=>VL.use(t=>t.invalidate(e)),KL=v_(VL)(HL);function qL(e){switch(typeof e){case`string`:case`number`:case`bigint`:case`boolean`:return String(e);default:return k(e)}}var JL=(e,t)=>{if(Array.isArray(e))for(let n=0;n<e.length;n++)t(qL(e[n]));else for(let n in e){t(n);let r=e[n];for(let e=0;e<r.length;e++)t(`${n}:${qL(r[e])}`)}},YL=`~effect/SubscriptionRef`,XL=e=>O(e,YL);({...ba});var ZL=e=>Vw(e.pubsub),QL=e=>B(()=>e.value),$L=(e,t)=>{e.value=t,oS(e.pubsub,t)},eR=E(2,(e,t)=>e.semaphore.withPermit(B(()=>$L(e,t)))),tR=(e,t)=>!gL(e)||!gL(t)?!0:SL(t)?SL(e):TL(e)&&TL(t)?t.timestamp>=e.timestamp:!0,nR=`~effect/reactivity/AtomRegistry`,rR=e=>O(e,nR),iR=e=>new pR(e?.initialValues,e?.scheduleTask,e?.timeoutResolution,e?.defaultIdleTTL),aR=lc(nR),oR=E(e=>rR(e[0]),(e,t,n)=>{let r=n?.suspendOnWaiting??!1;return Iy(n=>{let i=e.get(t);if(i._tag!==`Initial`&&!(r&&i.waiting))return n(LL(i));let a=e.subscribe(t,e=>{e._tag!==`Initial`&&!(r&&e.waiting)&&(n(LL(e)),a())});return B(a)})}),sR={immediate:!0},cR=e=>{e()},lR={};function uR(e,t){let n=lR;for(let r of e)try{t(r)}catch(e){n===lR&&(n=e)}if(n!==lR)throw n}var dR=`~effect-atom/atom/Atom/Serializable`,fR=e=>dR in e?e[dR].key:e,pR=class{[nR];timeoutResolution;defaultIdleTTL;scheduler;schedulerAsync;dispatcher;onNodeAdded;onNodeRemoved;constructor(e,t,n,r){if(this[nR]=nR,this.scheduler=new Ql(`sync`,t),this.schedulerAsync=new Ql(`async`,t),this.dispatcher=this.schedulerAsync.makeDispatcher(),this.defaultIdleTTL=r,this.timeoutResolution=n===void 0&&r!==void 0?Math.round(r/2):n??1e3,e!==void 0)for(let[t,n,r]of e){let e=t;for(;e.initialValueTarget;)e=e.initialValueTarget;this.ensureNode(e).setInitialValue(n,r?.skipInitialRun)}}nodes=new Map;preloadedSerializable=new Map;timeoutBuckets=new Map;nodeTimeoutBucket=new Map;disposed=!1;getNodes(){return this.nodes}get(e){return this.ensureNode(e).value()}set(e,t){e.write(this.ensureNode(e).writeContext,t)}setSerializable(e,t){this.preloadedSerializable.set(e,t)}modify(e,t){let n=this.ensureNode(e),r=t(n.value());return e.write(n.writeContext,r[1]),r[0]}update(e,t){let n=this.ensureNode(e);e.write(n.writeContext,t(n.value()))}refresh=e=>{e.refresh===void 0?this.invalidateAtom(e):e.refresh(this.refresh)};subscribe(e,t,n){let r=this.ensureNode(e);if(n?.immediate)t(r.value());else try{r.value()}catch(e){if((r.state&mR.waitingForValue)===0)throw e}let i=r.subscribe(function(){t(r._value)});return()=>{i(),r.canBeRemoved&&this.scheduleNodeRemoval(r)}}mount(e){return this.subscribe(e,hr,sR)}atomHasTtl(e){return!e.keepAlive&&e.idleTTL!==0&&(e.idleTTL!==void 0||this.defaultIdleTTL!==void 0)}ensureNode(e){let t=fR(e),n=this.nodes.get(t);if(n===void 0?(n=this.createNode(e),this.nodes.set(t,n),this.onNodeAdded?.(n)):this.atomHasTtl(e)&&this.removeNodeTimeout(n),typeof t==`string`&&this.preloadedSerializable.has(t)){let r=this.preloadedSerializable.get(t);this.preloadedSerializable.delete(t);let i=e[dR],a;try{a=i.decode(r)}catch(e){if(XM(e))return n;throw e}let o=e;for(;o.initialValueTarget;)o=o.initialValueTarget;let s=o===e?n:this.ensureNode(o);tR(s._value,a)&&s.setInitialValue(a,i.skipInitialRun)}return n}createNode(e){if(this.disposed)throw Error(`Cannot access Atom ${e}: registry is disposed`);return e.keepAlive||this.scheduleAtomRemoval(e),new gR(this,e)}invalidateAtom=e=>{let t=this.ensureNode(e);t.skipInitialRun=!1,t.invalidate()};scheduleAtomRemoval(e){this.dispatcher.scheduleTask(()=>{let t=this.nodes.get(fR(e));t!==void 0&&t.canBeRemoved&&this.removeNode(t)},0)}scheduleNodeRemoval(e){this.dispatcher.scheduleTask(()=>{e.canBeRemoved&&this.removeNode(e)},0)}removeNode(e){this.atomHasTtl(e.atom)?this.setNodeTimeout(e):(this.nodes.delete(fR(e.atom)),e.remove(),this.onNodeRemoved?.(e))}setNodeTimeout(e){if(this.nodeTimeoutBucket.has(e))return;let t=e.atom.idleTTL??this.defaultIdleTTL;if(this.#e!==null&&(t-=this.#e,t<=0)){this.nodes.delete(fR(e.atom)),e.remove(),this.onNodeRemoved?.(e);return}let n=Math.ceil(t/this.timeoutResolution)*this.timeoutResolution,r=Date.now()+n,i=r-r%this.timeoutResolution+this.timeoutResolution,a=this.timeoutBuckets.get(i);a===void 0&&(a=[new Set,setTimeout(()=>this.sweepBucket(i),i-Date.now())],this.timeoutBuckets.set(i,a)),a[0].add(e),this.nodeTimeoutBucket.set(e,i)}removeNodeTimeout(e){let t=this.nodeTimeoutBucket.get(e);if(t===void 0)return;this.nodeTimeoutBucket.delete(e),this.scheduleNodeRemoval(e);let[n,r]=this.timeoutBuckets.get(t);n.delete(e),n.size===0&&(clearTimeout(r),this.timeoutBuckets.delete(t))}#e=null;sweepBucket(e){let t=this.timeoutBuckets.get(e)[0];this.timeoutBuckets.delete(e),uR(t,this.removeIdleNode)}removeIdleNode=e=>{if(this.nodeTimeoutBucket.delete(e),e.canBeRemoved){this.nodes.delete(fR(e.atom)),this.onNodeRemoved?.(e),this.#e=e.atom.idleTTL??this.defaultIdleTTL;try{e.remove()}finally{this.#e=null}}};reset(){this.timeoutBuckets.forEach(([,e])=>clearTimeout(e)),this.timeoutBuckets.clear(),this.nodeTimeoutBucket.clear();let e=Array.from(this.nodes.values());this.nodes.clear();for(let t of e)t.state=hR.removed;uR(e,this.destroyNode)}destroyNode=e=>{e.remove(),this.onNodeRemoved?.(e)};dispose(){this.disposed=!0,this.reset()}},mR={alive:1,initialized:2,waitingForValue:4},hR={uninitialized:mR.alive|mR.waitingForValue,stale:mR.alive|mR.initialized|mR.waitingForValue,valid:mR.alive|mR.initialized,removed:0},gR=class{constructor(e,t){this.registry=e,this.atom=t,this.writeContext=new bR(e,this)}registry;atom;state=hR.uninitialized;lifetime;writeContext;preserveInitialValueOnBuild=!1;skipInitialRun=!1;keptParents;invalidatedDuringBuild=!1;failed=!1;parents=new Set;children=new Set;listeners=new Set;observedChildren=0;currentState(){switch(this.state){case hR.uninitialized:return`uninitialized`;case hR.stale:return`stale`;case hR.valid:return`valid`;default:return`removed`}}get canBeRemoved(){return!this.atom.keepAlive&&this.listeners.size===0&&this.children.size===0&&this.state!==0}get building(){return this.lifetime!==void 0&&this.lifetime.reads!==void 0}get isObserved(){return!this.atom.lazy||this.listeners.size>0||this.observedChildren>0}childObserved(e){let t=this.isObserved;this.observedChildren+=e,t!==this.isObserved&&this.observedChanged(e)}observedChanged(e){for(let t of this.parents)t.childObserved(e)}_value=void 0;value(){for(;(this.state&mR.waitingForValue)!==0;)this.build();return this._value}build(){let e=yR(this);try{this.disposeLifetime()}catch(t){e.failure=t}this.invalidatedDuringBuild=!1,this.lifetime=e;let t,n=!1;try{t=this.atom.read(e),n=!0}finally{let t=e.reads;e.reads=void 0,this.lifetime===e&&(this.dropUnread(t),n||this.fail())}if(this.lifetime===e&&(this.state&mR.waitingForValue)!==0&&(this.preserveInitialValueOnBuild?(this.preserveInitialValueOnBuild=!1,this.skipInitialRun&&(this.keptParents=Array.from(this.parents,e=>[e,e.lifetime])),this.failed=!1,this.state=hR.valid):this.setValue(t)),e.failure!==lR)throw e.failure}fail(){this.failed=!0;try{this.invalidateChildren()}catch{}}readTracked(e,t){let n=this.registry.ensureNode(e);this.parents.has(n)||(this.parents.add(n),n.children.add(this),this.isObserved&&n.childObserved(1));try{return n.value()}catch(e){if(t.reads===void 0||n.state!==hR.valid)throw e;return t.failure===lR&&(t.failure=e),n._value}finally{t.reads!==void 0&&!t.disposed&&t.reads.add(n)}}dropUnread(e){if(e.size===this.parents.size)return;let t=this.isObserved;for(let n of this.parents)e.has(n)||(this.parents.delete(n),n.children.delete(this),t&&n.childObserved(-1),n.canBeRemoved&&this.registry.scheduleNodeRemoval(n))}valueOption(){return(this.state&mR.initialized)===0?M():N(this._value)}setInitialValue(e,t=!1){(this.state&mR.initialized)===0?(this.preserveInitialValueOnBuild=!0,this.skipInitialRun=t,this.state=hR.stale,this._value=e,this.listeners.size>0&&this.announce()):this.setValue(e)}setValue(e){let t=this.failed;this.failed=!1;let n=(this.state&mR.initialized)!==0;if(this.state=hR.valid,n&&this.atom.equals(this._value,e)){t&&this.invalidateChildren();return}this._value=e;let r=lR;try{(n||t)&&this.invalidateChildren()}catch(e){r=e}if(this.listeners.size>0)try{this.announce()}catch(e){r===lR&&(r=e)}if(r!==lR)throw r}announce(){SR.phase===xR.collect?SR.notify.add(this):this.notify()}invalidate(){if(this.state===hR.valid){this.state=hR.stale;try{this.disposeLifetime()}finally{this.propagate()}}else this.building&&SR.phase!==xR.collect?this.build():this.propagate()}propagate(){SR.phase===xR.collect?(this.building&&(this.invalidatedDuringBuild=!0),SR.stale.push(this)):this.isObserved?this.value():this.invalidateChildren()}invalidateChildren(){if(this.children.size===0)return;let e=lR;for(let t of Array.from(this.children))if(t.affectedBy(this))try{t.invalidate()}catch(t){e===lR&&(e=t)}if(e!==lR)throw e}affectedBy(e){if(this.state===hR.valid)return!0;let t=this.lifetime?.reads;return t===void 0?this.isObserved&&e.state===hR.valid:t.has(e)}notify(){SR.phase===xR.commit&&SR.notify.delete(this),uR(this.listeners,cR)}disposeLifetime(){let e=this.lifetime;e!==void 0&&(this.lifetime=void 0,e.dispose())}remove(){let e=this.isObserved;this.state=hR.removed,this.listeners.clear();try{this.disposeLifetime()}finally{let t=Array.from(this.parents);this.parents.clear(),uR(t,t=>{t.children.delete(this),e&&t.childObserved(-1),t.canBeRemoved&&this.registry.removeNode(t)})}}subscribe(e){let t=this.isObserved;return this.listeners.add(e),t||this.observedChanged(1),()=>{this.listeners.delete(e)&&!this.isObserved&&this.observedChanged(-1)}}},_R=e=>{let t=e,n=t.node;if(!n.skipInitialRun)return!1;let r=n.keptParents;return n.skipInitialRun=!1,n.keptParents=void 0,!t.isFn&&!SL(n._value)&&(r===void 0||r.every(([e,t])=>e.lifetime===t))},vR={get registry(){return this.node.registry},addFinalizer(e){if(this.disposed)return e();this.finalizers??=[],this.finalizers.push(e)},get(e){return this.disposed?this.node.registry.get(e):this.node.readTracked(e,this)},result(e,t){if(this.disposed||this.isFn)return this.resultOnce(e,t);let n=this.get(e);if(t?.suspendOnWaiting&&n.waiting)return Ly;switch(n._tag){case`Initial`:return Ly;case`Failure`:return bg(n.cause);case`Success`:return R(n.value)}},resultOnce(e,t){return Iy(n=>{let r=this.once(e);if(r._tag!==`Initial`&&!(t?.suspendOnWaiting&&r.waiting))return n(LL(r));let i=this.node.registry.subscribe(e,e=>{e._tag===`Initial`||t?.suspendOnWaiting&&e.waiting||(i(),n(LL(e)))},{immediate:!1});return B(i)})},setResult(e,t){return this.disposed?Ly:(this.node.registry.set(e,t),this.resultOnce(e,{suspendOnWaiting:!0}))},some(e){if(this.disposed||this.isFn)return this.someOnce(e);let t=this.get(e);return t._tag===`None`?Ly:R(t.value)},someOnce(e){return Iy(t=>{let n=this.once(e);if(Go(n))return t(R(n.value));let r=this.node.registry.subscribe(e,e=>{Wo(e)||(r(),t(R(e.value)))},{immediate:!1});return B(r)})},once(e){return this.node.registry.get(e)},self(){return this.disposed?M():this.node.valueOption()},refresh(e){this.disposed||this.node.registry.refresh(e)},refreshSelf(){this.disposed||this.node.invalidate()},mount(e){this.disposed||this.addFinalizer(this.node.registry.mount(e))},subscribe(e,t,n){this.disposed||this.addFinalizer(this.node.registry.subscribe(e,t,n))},setSelf(e){this.disposed||this.node.setValue(e)},set(e,t){this.disposed||this.node.registry.set(e,t)},stream(e,t){return this.disposed?Mw:jw(n=>B(()=>{this.subscribe(e,e=>FS(n,e),{immediate:!t?.withoutInitialValue})}))},streamResult(e,t){return this.stream(e,t).pipe(Zw(CL),Kw(e=>e._tag===`Success`?R(e.value):zy(e.cause)))},dispose(){if(this.disposed=!0,this.finalizers===void 0)return;let e=this.finalizers;this.finalizers=void 0,uR(e.reverse(),cR)}},yR=e=>{function t(n){return t.disposed||t.isFn?e.registry.get(n):e.readTracked(n,t)}return Object.setPrototypeOf(t,vR),t.isFn=!1,t.disposed=!1,t.finalizers=void 0,t.node=e,t.reads=new Set,t.failure=lR,t},bR=class{constructor(e,t){this.registry=e,this.node=t}registry;node;get(e){return this.registry.get(e)}set(e,t){return this.registry.set(e,t)}setSelf(e){return this.node.setValue(e)}refreshSelf(){return this.node.invalidate()}},xR={disabled:0,collect:1,commit:2},SR={phase:xR.disabled,depth:0,stale:[],notify:new Set};function CR(e){let t=SR.phase;SR.phase=xR.collect,SR.depth++;let n=lR;try{e()}catch(e){n=e}if(SR.depth===1){let{notify:e,stale:t}=SR,r=0;do{for(SR.phase=xR.collect;r<t.length;r++)try{wR(t[r])}catch(e){n===lR&&(n=e)}SR.phase=xR.commit;for(let t of e)try{t.notify()}catch(e){n===lR&&(n=e)}}while(r<t.length);SR.stale=[],e.clear()}if(SR.depth--,SR.phase=t,n!==lR)throw n}function wR(e){if(e.state===hR.valid){if(!e.invalidatedDuringBuild)return;e.invalidatedDuringBuild=!1,e.state=hR.stale,e.disposeLifetime()}e.value()}var TR=`~effect/reactivity/Atom`,ER=e=>O(e,TR),DR=`~effect/reactivity/Atom/Writable`,OR=E(2,(e,t)=>{let n=ul(t),r=bl(n);return Object.assign(Object.create(Object.getPrototypeOf(e)),{...e,keepAlive:!r,idleTTL:r?Al(n):void 0})}),kR=OR(0),AR={[TR]:TR,equals:Object.is,...ba,toJSON(){return{_id:`Atom`,keepAlive:this.keepAlive,lazy:this.lazy,label:this.label}}},jR={...AR,atom(e,t){let n=zR(e,t);return FR(e=>{let t=e.self(),r=e(this);return r._tag===`Success`?n(e,r.value):NL(r,t)})},fn(e,t){return arguments.length===0?(e,t)=>MR(this,e,t):MR(this,e,t)},pull(e,t){let n=kR(HR(0));return az(n,FR(r=>{let i=r.self(),a=r(this);return a._tag===`Success`?WR(r,iz(r,n,e,t),wL(!0),a.value):NL(a,i)}))},subscriptionRef(e){return QR(kR(FR(t=>{let n=t.self(),r=t(this);if(r._tag!==`Success`)return NL(r,n);let i=typeof e==`function`?e(t):e;return XL(i)?i:WR(t,i,wL(!0),r.value)})),(e,t)=>ZR(e,t,FL(e(this))))}},MR=(e,t,n)=>{let[r,i,a]=rz(n?.reactivityKeys?(e,r)=>{let i=t(e,r);return ky(i)?WL(i,n.reactivityKeys):rT(i,GL(n.reactivityKeys))}:t,n);return IR(t=>{t.get(a);let n=t.self(),i=t.get(e);return i._tag===`Success`?r(t,i.value):NL(i,n)},i)},NR={...AR,[DR]:DR},PR=e=>DR in e,FR=(e,t)=>{let n=Object.create(AR);return n.keepAlive=!1,n.lazy=!0,n.read=e,n.refresh=t,n},IR=(e,t,n)=>{let r=Object.create(NR);return r.keepAlive=!1,r.lazy=!0,r.read=e,r.write=t,r.refresh=n,r};function LR(e,t){e.setSelf(t)}var RR=(e,t)=>{let n=zR(e,t);return`~effect/reactivity/Atom`in n?n:FR(n)},zR=(e,t)=>{if(typeof e==`function`&&!ky(e)&&!Ew(e)){let n=e;return function(e,r){let i=n(e);switch(typeof i){case`function`:case`object`:return i===null?i:BR in i?UR(e,i,t,r):VR in i?YR(e,i,t,r):i;default:return i}}}return ky(e)?function(n,r){return UR(n,e,t,r)}:Ew(e)?function(n,r){return YR(n,e,t,r)}:HR(e)},BR=`~effect/Effect`,VR=`~effect/Stream`,HR=e=>IR(function(t){return e},LR),UR=(e,t,n,r)=>WR(e,t,n?.initialValue===void 0?wL():EL(n.initialValue),r,n?.uninterruptible);function WR(e,t,n,r=Ec(),i=!1){let a=e.self();if(a._tag===`Some`&&_R(e))return a.value;let o=typeof r==`function`?r:dr(r),s=Kg();e.addFinalizer(()=>{Qb(o())(GR(s))});let c,l=!1,u=KR(o().pipe(kc(Gg,s),kc(aR,e.registry),kc(ql,e.registry.scheduler)),t,function(t){l?e.setSelf(bL(t,e.self())):c=bL(t,a)},i);return l=!0,u!==void 0&&e.addFinalizer(u),c===void 0?a._tag===`Some`?xL(a):jL(n):c}var GR=e=>$y(Zg(e,wg),e=>eg(e)?V:cb(zy(e),{log:`Unhandled`,message:`Unhandled error in atom finalizer`}));function KR(e,t,n,r=!1){if(vg(t)){n(t);return}let i=Qb(e)(t);i.currentDispatcher?.flush();let a=i.pollUnsafe();if(a){n(a);return}let o=i.addObserver(n);function s(){o(),r||i.interruptUnsafe()}return s}function qR(e){let t=e?.memoMap??kR(RR(()=>c_())),n=e=>ER(t)?e(t):t,r=KL;function i(e){let t=Object.create(jR);t.keepAlive=!1,t.lazy=!0,t.refresh=void 0,t.factory=i;let a=sz(FR(typeof e==`function`?e:()=>e));return t.layer=a,t.read=function(e){let t=D_(e(a),r),i=Ec();return WR(e,U(Tb,r=>W(d_(t,n(e),r),e=>(i=e,e))),wL(),()=>i,!0)},t}i.memoMap=t,i.addGlobalLayer=e=>{r=D_(r,E_(e,KL))};let a=kR(RR(e=>yb(t=>d_(KL,n(e),Pc(t,Gg))).pipe(W(Pc(VL)))));return i.withReactivity=e=>t=>uz(t,n=>{let r=FL(n(a));return n.addFinalizer(r.registerUnsafe(e,()=>{n.refresh(t)})),n.subscribe(t,e=>n.setSelf(e)),n.once(t)},{initialValueTarget:t}),i}var JR=qR();JR.withReactivity;var YR=(e,t,n,r)=>XR(e,t,n?.initialValue===void 0?wL():EL(n.initialValue),r);function XR(e,t,n,r=Ec()){let i=e.self();if(i._tag===`Some`&&_R(e))return i.value;r=kc(r,aR,e.registry);let a=Db(n=>U(bw(t.channel,n),t=>My({while:fr,body:()=>t,step(t){e.setSelf(EL(Vs(t),{waiting:!0}))}}))).pipe($y(t=>(Hv(t)?gr(e.self(),ns(PL),Ko({onNone:()=>e.setSelf(AL(new lg,{previous:e.self()})),onSome:t=>e.setSelf(EL(t))})):e.setSelf(kL(t,{previous:e.self()})),V))),o=KR(r.pipe(kc(aR,e.registry),kc(ql,e.registry.scheduler)),a,hr,!1);return o!==void 0&&e.addFinalizer(o),i._tag===`Some`?xL(i):jL(n)}var ZR=(e,t,n=Ec())=>XL(t)?(e.addFinalizer(ZL(t).pipe(sT(t=>{for(let n=0;n<t.length;n++)e.setSelf(t[n]);return V}),$b(n))),ix(n)(QL(t))):t._tag===`Success`?XR(e,ZL(t.value),wL(!0),n):t,QR=(e,t)=>{function n(t,n){let r=t.get(e);XL(r)?rx(eR(r,n)):TL(r)&&rx(eR(r.value,n))}return IR(n=>{let r=n(e);return XL(r)||TL(r)?t(n,r):r},n)},$R=Symbol.for(`effect/reactivity/atom/Atom/Reset`),ez=Symbol.for(`effect/reactivity/atom/Atom/Interrupt`),tz=function(...e){return e.length===0?nz:nz(...e)},nz=(e,t)=>{let[n,r]=rz(e,t);return IR(n,r)};function rz(e,t){let n=kR(HR([0,void 0])),r=t?.initialValue===void 0?wL():EL(t.initialValue),i=t?.concurrent?kR(FR(e=>{let t=new Set;return e.addFinalizer(()=>t.forEach(e=>e.interruptUnsafe())),t})):void 0;function a(t,a){let o=i?t(i):void 0;t.isFn=!0;let[s,c]=t.get(n);if(s===0)return r;if(c===ez)return kL(Xh(),{previous:t.self()});let l=e(c,t);return BR in l?(o&&(l=U(Xb(l,{startImmediately:!0}),e=>{o.add(e);let t=Array.from(o);return e.addObserver(()=>o.delete(e)),W(vx(t),e=>e[0])})),WR(t,l,r,a,!1)):XR(t,l,r,a)}function o(e,t){mz(()=>{t===$R?e.set(n,[0,void 0]):t===ez?e.set(n,[e.get(n)[0]+1,ez]):e.set(n,[e.get(n)[0]+1,t]),e.refreshSelf()})}return[a,o,n]}var iz=(e,t,n,r)=>U(cT(typeof n==`function`?n(e):n),n=>{let i=xx().context,a=Js(),o=_b(n,{onFailure(e){return Hv(e)?Ls(a)?R({done:!0,items:a}):H(new lg(`Atom.pull: no items`)):zy(e)},onSuccess(e){let t;return r?.disableAccumulation?t=e:(t=Ps(a,e),a=t),R({done:!1,items:t})}}),s=new Set;return e.addFinalizer(()=>{for(let e of s)e()}),e.once(t),e.subscribe(t,()=>{e.setSelf(xL(e.self()));let t;t=KR(i,o,n=>{t&&s.delete(t);let r=bL(n,e.self()),i=s.size>0;e.setSelf(i?jL(r):r)}),t&&s.add(t)}),o}),az=(e,t)=>IR(t.read,function(t,n){t.set(e,t.get(e)+1)}),oz=typeof WeakRef>`u`||typeof FinalizationRegistry>`u`?e=>{let t=Sy();return function(n){let r=Cy(t,n);if(r._tag===`Some`)return r.value;let i=e(n);return Ey(t,n,i),i}}:e=>{let t=Sy(),n=new FinalizationRegistry(e=>{let n=Cy(t,e);n._tag===`Some`&&n.value.deref()===void 0&&Oy(t,e)});return function(r){let i=Cy(t,r).pipe(rs(e=>e.deref()));if(i._tag===`Some`)return i.value;let a=e(r);return Ey(t,r,new WeakRef(a)),n.register(a,r),a}},sz=e=>Object.assign(Object.create(Object.getPrototypeOf(e)),{...e,keepAlive:!0}),cz=E(2,(e,t)=>Object.assign(Object.create(Object.getPrototypeOf(e)),{...e,equals:t})),lz=E(2,(e,t)=>Object.assign(Object.create(Object.getPrototypeOf(e)),{...e,label:[t,sa()===0?``:Error().stack?.split(`
|
|
16
|
+
`)[5]??``]})),uz=E(e=>ER(e[0]),(e,t,n)=>{let r=kR(PR(e)?IR(n=>t(n,e),function(t,n){t.set(e,n)},e.refresh??function(t){t(e)}):FR(n=>t(n,e),e.refresh??function(t){t(e)}));return n?.initialValueTarget&&(r.initialValueTarget=dz(n.initialValueTarget)),r}),dz=e=>{let t=e;for(;t.initialValueTarget;)t=t.initialValueTarget;return t},fz=E(2,(e,t)=>uz(e,n=>t(n(e)))),pz=E(2,(e,t)=>fz(e,RL(t))),mz=CR,hz=`~effect-atom/atom/Atom/Serializable`,gz=E(2,(e,t)=>{let n=TP(t.schema);return Object.assign(Object.create(Object.getPrototypeOf(e)),{...e,label:e.label??[t.key,sa()===0?``:Error().stack?.split(`
|
|
17
|
+
`)[5]??``],[hz]:{key:t.key,encode:lN(n),decode:aN(n),skipInitialRun:t.skipInitialRun}})}),_z=`~effect-atom/atom/Atom/ServerValue`,vz=E(2,(e,t)=>Object.assign(Object.create(Object.getPrototypeOf(e)),{...e,[_z]:t})),yz=e=>vz(e,dr(wL(!0))),bz=E(2,(e,t)=>`~effect-atom/atom/Atom/ServerValue`in e?e[_z](e=>t.get(e)):t.get(e)),xz=`~effect/socket/Socket`,Sz=lc(`effect/socket/Socket`),Cz=e=>Sz.of({[xz]:xz,reader:e.reader,writer:e.writer}),wz=new TextEncoder,Tz=`~effect/socket/Socket/CloseEvent`,Ez=e=>O(e,Tz),Dz=`~effect/socket/Socket/SocketError`,Oz=e=>O(e,Dz),kz=class extends CP(`effect/socket/Socket/SocketReadError`)({_tag:RN(`SocketReadError`),cause:iP()}){message=`An error occurred during Read`},Az=class extends CP(`effect/socket/Socket/SocketWriteError`)({_tag:RN(`SocketWriteError`),cause:iP()}){message=`An error occurred during Write`},jz=class extends CP(`effect/socket/Socket/SocketOpenError`)({_tag:RN(`SocketOpenError`),kind:NN([`Unknown`,`Timeout`]),cause:iP()}){get message(){return this.kind===`Timeout`?`timeout waiting for "open"`:`An error occurred during Open`}},Mz=class e extends CP(`effect/socket/Socket/SocketUpgradeError`)({_tag:RN(`SocketUpgradeError`),cause:fN(iP())}){static unsupported=()=>H(new Fz({reason:new e({})}));get message(){return this.cause===void 0?`Socket does not support TLS upgrade`:`An error occurred during TLS upgrade`}},Nz=class extends CP(`effect/socket/Socket/SocketCloseError`)({_tag:RN(`SocketCloseError`),code:JN,closeReason:fN(yN)}){get message(){return this.closeReason?`${this.code}: ${this.closeReason}`:`${this.code}`}},Pz=MN([kz,Az,jz,Mz,Nz]),Fz=class extends wP(Dz)(`SocketError`,{_tag:RN(`SocketError`),reason:Pz}){constructor(e){`cause`in e.reason?super({...e,cause:e.reason.cause}):super(e)}[Dz]=Dz;static is(e){return Oz(e)}message=this.reason.message},Iz=(e,t)=>new Fz({reason:new Nz({code:e,closeReason:t})}),Lz=class extends lc()(`@effect/platform/Socket/WebSocketConstructor`){},Rz=p_(Lz)((e,t)=>{if(t!==void 0&&typeof t!=`string`&&!Array.isArray(t))throw TypeError(`WebSocket client options are not supported by the global WebSocket constructor`);return new globalThis.WebSocket(e,t)}),zz=(e,t)=>Lz.use(n=>Vz(Ob((typeof e==`string`?R(e):e).pipe(W(e=>n(e,t?.headers===void 0?t?.protocols:{protocols:t.protocols,headers:t.headers}))),e=>B(()=>e.close(1e3))),t)),Bz=e=>`pause`in e&&typeof e.pause==`function`,Vz=(e,t)=>Wy(n=>{let r,i=Nx(!1),a=n.context,o=Ry(function*(){let n=yield*Tb,a=yield*qg(e,n);`binaryType`in a&&(a.binaryType=`arraybuffer`);let o=Bz(a),s=t?.highWaterMark??(o?Hz:void 0),c=a.readyState===1,l=o&&`isPaused`in a&&a.isPaused===!0,u=[],d=0,f,p,m;function h(){o&&!l&&(a.pause(),l=!0)}function g(){o&&l&&(a.resume(),l=!1)}function _(){let e=u;return u=[],d=0,f===void 0&&g(),e}function v(){if(p===void 0||u.length===0)return;let e=p;p=void 0,e(R(_()))}function y(e){u.push(e),s!==void 0&&(d+=typeof e==`string`?wz.encode(e).byteLength:e.byteLength),p!==void 0&&v(),o&&d>=s?h():!o&&!p&&s!==void 0&&d>s&&b(new Fz({reason:new kz({cause:Error(`Socket highWaterMark of ${s} bytes exceeded`)})}))}function b(e){if(f===void 0&&(f=e),m!==void 0){let{cleanup:e,resume:t}=m;m=void 0,e(),t(H(f))}if(p!==void 0){let e=p;p=void 0,e(u.length>0?R(_()):H(f))}}function ee(e){let t=e.data;typeof Blob<`u`&&t instanceof Blob?t.arrayBuffer().then(e=>y(new Uint8Array(e)),e=>{b(new Fz({reason:new kz({cause:e})}))}):y(t instanceof ArrayBuffer?new Uint8Array(t):t)}function x(e){b(new Fz({reason:c?new kz({cause:e}):new jz({kind:`Unknown`,cause:e})}))}function te(e){b(Iz(typeof e.code==`number`?e.code:1006,e.reason))}return a.addEventListener(`message`,ee),a.addEventListener(`error`,x,{once:!0}),a.addEventListener(`close`,te,{once:!0}),yield*Yg(n,B(()=>{if(b(Iz(1006)),a.removeEventListener(`message`,ee),a.addEventListener(`error`,hr),a.removeEventListener(`error`,x),a.removeEventListener(`close`,te),o)try{g()}catch{}i.closeUnsafe(),r=void 0})),a.readyState>=2?yield*H(f??Iz(1006)):(c||=(yield*Iy(e=>{let t=()=>{m?.resume===e&&(m=void 0,a.removeEventListener(`open`,t),e(V))},n=()=>a.removeEventListener(`open`,t);return m={resume:e,cleanup:n},a.addEventListener(`open`,t,{once:!0}),B(()=>{m?.resume===e&&(m=void 0),n()})}).pipe(db({duration:t?.openTimeout??1e4,orElse:()=>H(new Fz({reason:new jz({kind:`Timeout`,cause:Error(`timeout waiting for "open"`)})}))})),!0),f===void 0&&d<s&&g(),r=a,i.openUnsafe(),{pull:Iy(e=>u.length>0?e(R(_())):f===void 0?(p=e,B(()=>{p===e&&(p=void 0)})):e(H(f))),upgrade:Mz.unsupported})}).pipe(Cb(e=>zc(a,e))),s=e=>z(()=>{let t=r;if(t===void 0)return i.whenOpen(s(e));try{return Ez(e)?t.close(e.code,e.reason):t.send(e),V}catch(e){return H(new Fz({reason:new Az({cause:e})}))}}),c=e=>z(()=>{let t=r;if(t===void 0)return i.whenOpen(c(e));try{for(let n=0;n<e.length;n++)t.send(e[n]);return V}catch(e){return H(new Fz({reason:new Az({cause:e})}))}});return R(Cz({reader:o,writer:R({write:s,writeAll:c})}))}),Hz=65536,Uz=_r(zz,v_(Sz)),Wz=class extends lc()(`effect/workers/Transferable/Collector`){},Gz=()=>{let e=[],t=t=>{e.push(...t)},n=()=>e,r=()=>{let t=e;return e=[],t};return Wz.of({addAllUnsafe:t,addAll:e=>B(()=>t(e)),readUnsafe:n,read:B(n),clearUnsafe:r,clear:B(r)})},Kz=`~effect/FiberSet`,qz=e=>O(e,Kz),Jz={[Kz]:Kz,[Symbol.iterator](){return this.state._tag===`Closed`?ys():this.state.backing[Symbol.iterator]()},...ba,toJSON(){return{_id:`FiberSet`,state:this.state}}},Yz=(e,t)=>{let n=Object.create(Jz);return n.state={_tag:`Open`,backing:e},n.deferred=t,n},Xz=()=>Ob(B(()=>Yz(new Set,Ag())),e=>z(()=>{let t=e.state;if(t._tag===`Closed`)return V;e.state={_tag:`Closed`};let n=t.backing;return bx(n).pipe(Vg(e.deferred))})),Zz=-1,Qz=Ul(Gl(sg,Wl(Zz))),$z=E(e=>qz(e[0]),(e,t,n)=>{e.state._tag===`Closed`?t.interruptUnsafe(Zz):e.state.backing.has(t)||(e.state.backing.add(t),t.addObserver(r=>{e.state._tag!==`Closed`&&(e.state.backing.delete(t),Eg(r)&&(n?.propagateInterruption===!0?!Qz(r.cause):!eg(r.cause))&&Bg(e.deferred,r))}))}),eB=function(){let e;return()=>(e===void 0&&(e=Zb(Fb)),e)}(),tB=function(){let e=arguments[0];if(!ky(arguments[1])){let t=arguments[1];return n=>nB(e,n,t)}return nB(e,arguments[1],arguments[2])},nB=(e,t,n)=>Wy(r=>{if(e.state._tag===`Closed`)return B(eB);let i=Dm(r,t,n?.startImmediately??!0,!0);return $z(e,i,n),R(i)}),rB=e=>()=>W(vb(),t=>{let n=Qb(t);return(t,r)=>{if(e.state._tag===`Closed`)return eB();let i=n(t,r);return $z(e,i,r),i}}),iB=e=>My({while:()=>e.state._tag===`Open`&&e.state.backing.size>0,body:()=>gx(gs(e)),step:hr}),aB=MN([class extends CP(`effect/workers/WorkerError/WorkerSpawnError`)({_tag:RN(`WorkerSpawnError`),message:yN,cause:fN(iP())}){},class extends CP(`effect/workers/WorkerError/WorkerSendError`)({_tag:RN(`WorkerSendError`),message:yN,cause:fN(iP())}){},class extends CP(`effect/workers/WorkerError/WorkerReceiveError`)({_tag:RN(`WorkerReceiveError`),message:yN,cause:fN(iP())}){},class extends CP(`effect/workers/WorkerError/WorkerUnknownError`)({_tag:RN(`WorkerUnknownError`),message:yN,cause:fN(iP())}){}]),oB=(e,t)=>e===void 0?t:`${e}.${t}`,sB=(e,t)=>({"rpc.system.name":`effect_rpc`,"rpc.method":e,...t}),cB=`~effect/PrimaryKey`,lB=`~effect/rpc/RpcSchema/StreamSchema`;function uB(e){return O(e,lB)}function dB(e){return uB(e)?N({success:e.success,error:e.error}):M()}var fB=JM(Ew);function pB(e,t){return K(fB.ast,{[lB]:lB,success:e,error:t})}var mB=`~effect/rpc/Rpc`,hB={[mB]:mB,pipe(){return T(this,arguments)},setSuccess(e){return gB({_tag:this._tag,payloadSchema:this.payloadSchema,successSchema:e,errorSchema:this.errorSchema,defectSchema:this.defectSchema,annotations:this.annotations,middlewares:this.middlewares})},setError(e){return gB({_tag:this._tag,payloadSchema:this.payloadSchema,successSchema:this.successSchema,errorSchema:e,defectSchema:this.defectSchema,annotations:this.annotations,middlewares:this.middlewares})},setPayload(e){return gB({_tag:this._tag,payloadSchema:uN(e)?e:wN(e),successSchema:this.successSchema,errorSchema:this.errorSchema,defectSchema:this.defectSchema,annotations:this.annotations,middlewares:this.middlewares})},middleware(e){return gB({_tag:this._tag,payloadSchema:this.payloadSchema,successSchema:this.successSchema,errorSchema:this.errorSchema,defectSchema:this.defectSchema,annotations:this.annotations,middlewares:new Set([...this.middlewares,e])})},prefix(e){return gB({_tag:`${e}${this._tag}`,payloadSchema:this.payloadSchema,successSchema:this.successSchema,errorSchema:this.errorSchema,defectSchema:this.defectSchema,annotations:this.annotations,middlewares:this.middlewares})},annotate(e,t){return gB({_tag:this._tag,payloadSchema:this.payloadSchema,successSchema:this.successSchema,errorSchema:this.errorSchema,defectSchema:this.defectSchema,middlewares:this.middlewares,annotations:kc(this.annotations,e,t)})},annotateMerge(e){return gB({_tag:this._tag,payloadSchema:this.payloadSchema,successSchema:this.successSchema,errorSchema:this.errorSchema,defectSchema:this.defectSchema,middlewares:this.middlewares,annotations:zc(this.annotations,e)})}},gB=e=>{function t(){}return Object.setPrototypeOf(t,hB),Object.assign(t,e),t.key=`effect/rpc/Rpc/${e._tag}`,t},_B=(e,t)=>{let n=t?.success??SN,r=t?.error??hN,i=t?.defect??iP(),a;return a=t?.primaryKey?class extends SP(`effect/rpc/Rpc/${e}`)(t.payload){[cB](){return t.primaryKey(this)}}:uN(t?.payload)?t?.payload:t?.payload?wN(t?.payload):SN,gB({_tag:e,payloadSchema:a,successSchema:t?.stream?pB(n,r):n,errorSchema:t?.stream?hN:r,defectSchema:i,annotations:Ec(),middlewares:new Set})},vB=new WeakMap,yB=e=>{if(vB.has(e))return vB.get(e);let t=e,n=new Set([t.errorSchema]),r=dB(t.successSchema);Go(r)&&n.add(r.value.error);for(let e of t.middlewares)n.add(e.error);let i=fP(Go(r)?SN:t.successSchema,MN([...n]),t.defectSchema);return vB.set(e,i),i},bB=P(`effect/rpc/Rpc/ParseOptions`,{defaultValue:()=>wk}),xB=`~effect/rpc/Rpc/Wrapper`,SB=e=>xB in e,CB=`~effect/rpc/RpcClientError`,wB=class extends CP(`effect/rpc/RpcClientError/RpcClientDefect`)({_tag:RN(`RpcClientDefect`),message:yN,cause:iP()}){},TB=class extends CP(CB)({_tag:RN(`RpcClientError`),reason:MN([aB,Pz,GF,wB])}){[CB]=CB;get message(){return`${this.reason._tag}: ${this.reason.message}`}},EB=e=>e,DB={_tag:`Ping`},OB=MN([yN,bN]),kB=MN([wN({_tag:RN(`Request`),id:OB,tag:yN,payload:lP,headers:ON(DN([yN,yN])),isNotification:fN(mN(!0)),discard:fN(mN(!0)),traceId:fN(yN),spanId:fN(yN),sampled:fN(xN)}),wN({_tag:RN(`Ack`),requestId:OB}),wN({_tag:RN(`Interrupt`),requestId:OB}),wN({_tag:RN(`Ping`)}),wN({_tag:RN(`Eof`)}),wN({_tag:RN(`Chunk`),requestId:OB,values:lP}),wN({_tag:RN(`Exit`),requestId:OB,exit:lP}),wN({_tag:RN(`Defect`),defect:lP}),wN({_tag:RN(`Pong`)})]),AB=new WeakMap,jB=new WeakMap,MB=new WeakMap,NB=new WeakMap;function PB(e,t){let n=t?.fingerprint===!0?jB:AB,r=n.get(e);if(r!==void 0)return r;let{exact:i,layout:a,recursive:o,target:s}=RW(e),c=IW(a,t?.fingerprint),l=i?{value:void 0}:void 0,u=IB(l===void 0?s:HW(s,l,!o),a,c,l);return n.set(e,u),u}function FB(e,t){let n=t?.fingerprint===!0?NB:MB,r=n.get(e);if(r!==void 0)return r;let{exact:i,exitSuccess:a,layout:o,target:s}=RW(e);if(!i){if(!a)return PB(e,t);let r={value:void 0},i=IB(WW(s,r),o,IW(o,t?.fingerprint),r,!0);return n.set(e,i),i}let c=IB(GW(s),o,IW(o,t?.fingerprint),void 0);return n.set(e,c),c}function IB(e,t,n,r,i=!1){return lP.pipe(IN(e,PW(t,n,r,i)))}function LB(e,t){let{exact:n,exitSuccess:r,layout:i}=RW(e),a=IW(i,t?.fingerprint),o=t??wk;if(!n||o.onExcessProperty===`error`){let n=cN(PB(e,t),t);return!r||o.onExcessProperty===`error`?n:e=>{if(!QU(e))return n(e);try{return ZU(i,e,o,a)}catch(e){throw e instanceof WV?new YM(e.issue):e}}}return e=>{try{return ZU(i,e,o,a)}catch(e){throw e instanceof WV?new YM(e.issue):e}}}function RB(e,t){let{exact:n,layout:r}=RW(e),i=t??wk;if(!n||i.onExcessProperty===`error`){let n=LB(e,t);return e=>zB(e.map(n))}let a=IW(r,t?.fingerprint);return e=>{try{return XU(r,e,i,a)}catch(e){throw e instanceof WV?new YM(e.issue):e}}}function zB(e){return e.length===1?e[0]:WM(e)}function BB(e,t){let{exact:n,exitSuccess:r,layout:i,target:a}=RW(e),o=t??wk,s=n?void 0:iN(a,o),c=s!==void 0&&r?e=>QU(e)?e:s(e):s;return UB(i,IW(i,t?.fingerprint),o,t?.maxFrameSize,c,VB(n,t))}function VB(e,t){if(t?.dictionary!==!0)return!1;if(!e)throw Error(`Binary layout: dictionary needs a schema the binary layer validates on its own`);return!0}function HB(e,t){let{exact:n,layout:r,target:i}=RW(e),a=VB(n,t),o=LB(e,t),s=RB(e,t);if(!a)return{encode:o,encodeMany:s};let c=IW(r,t?.fingerprint),l=t??wk,u=l.onExcessProperty===`error`?cN(i,t):void 0,d=TU(),f=e=>{try{return e()}catch(e){throw e instanceof WV?new YM(e.issue):e}};return{encode:e=>f(()=>ZU(r,u===void 0?e:u(e),l,c,d)),encodeMany:e=>f(()=>XU(r,u===void 0?e:e.map(u),l,c,d))}}function UB(e,t,n,r,i,a){let o=a?[]:void 0,s=new Uint8Array,c=0,l=0,u,d=!1,f=new uH,p=new oH(n,QV),m=()=>{f.release(),p.clear(),s=cH,c=l=0},h=(e,t)=>{throw new YM(new eO({expected:e},t,n))},g=()=>{let e=u;throw u=void 0,e},_=(e,t)=>{let n=e.length-t;n>s.length&&(s=new Uint8Array(Math.max(256,n))),s.set(t===0?e:e.subarray(t),0),c=0,l=n},v={feedSync(a){if(u!==void 0)return g();if(d)return h(`parser is spent`);let v=l===c,y,b,ee;if(v)y=a,b=0,ee=a.length;else{if(a.length>0){let e=l-c,t=e+a.length;if(t>s.length){let n=new Uint8Array(Math.max(256,s.length*2,t));n.set(s.subarray(c,l)),s=n,c=0,l=e}else c>0&&(s.copyWithin(0,c,l),c=0,l=e);s.set(a,l),l+=a.length}y=s,b=c,ee=l}let x=[],te=()=>(v?b<ee&&_(a,b):(c=b,c===l&&(c=l=0)),x),S=(e,t)=>{d=!0;let r=new YM(new eO({expected:e},t,n));if(m(),x.length===0)throw r;return u=r,x};for(;;){let a=0,s=-1,c=ee-b,l=1;for(let e=0;e<Math.min(6,c);e++){let t=y[b+e];if(a+=(t&127)*l,!(t&128)){s=e+1;break}l*=128}if(s===-1){if(c<6)return te();let e=BigInt(a);for(let t=6;t<Math.min(10,c);t++){let n=y[b+t];if(e|=BigInt(n&127)<<BigInt(t*7),!(n&128)){if(s=t+1,e>QB)return S(`safe integer length`,e);a=Number(e);break}}if(s===-1)return c>=10?S(`uvarint`,y.subarray(b,b+10)):te()}if(a===0)return S(`nonzero frame length`,a);if(r!==void 0&&a>r)return S(`frame within maxFrameSize`,a);if(s+a>c)return te();let h=Y;try{Y=0;let r=b+s;p.beginFrame(),f.reset(y,r,r+a,n,p,t,o);let c=jW(e,f,t);x.push(i===void 0?c:i(c))}catch(e){d=!0,m();let t=e instanceof WV?new YM(e.issue):XM(e)?e:(()=>{throw e})();if(x.length===0)throw t;return u=t,x}finally{Y=h}b+=s+a}},endSync(){if(u!==void 0)return g();if(d)return h(`parser is spent`);d=!0;let e=c<l?s.subarray(c,l):void 0;if(m(),e!==void 0)return h(`complete value`,e)},feed:e=>z(()=>{try{return R(v.feedSync(e))}catch(e){if(XM(e))return H(e);throw e}}),end:z(()=>{try{return v.endSync(),V}catch(e){if(XM(e))return H(e);throw e}})};return v}var WB=`~effect/encoding/SchemaBinary/fieldId`,GB=`~effect/encoding/SchemaBinary/fixedWidth`,KB=BigInt(`-9223372036854775808`),qB=BigInt(`9223372036854775807`),JB=BigInt(`18446744073709551615`);function YB(e){let t=e.checks;if(t!==void 0)for(let e of t){let t=e.annotations?.[GB];if(t!==void 0)return t}}var XB=32,ZB=33,QB=BigInt(2**53-1),$B=BigInt(0),eV=BigInt(1),tV=BigInt(2),nV=BigInt(7),rV=BigInt(127),iV=BigInt(1e6),aV=BigInt(255),oV=BigInt(4294967295),sV=BigInt(32),cV=new TextEncoder,lV=new TextDecoder(`utf-8`,{fatal:!0,ignoreBOM:!0}),uV=7,dV=0xffffffffffff,fV=0xfffffffffffff,pV=0,mV=1,hV=2,gV=512,_V=1048576,vV=4194304,yV=0,bV=1,xV=2,SV=3,CV=4,wV=5,TV=6,EV=7,DV=8;function OV(e){return typeof e==`number`&&Number.isInteger(e)&&e>=-0xffffffffffff&&e<=dV}var kV=8,AV=2199023255551,jV=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8];function MV(e){for(let t=1;t<=kV;t++){let n=Math.round(e*jV[t]);if(!(n>=-2199023255551&&n<=AV))return 0;if(n/jV[t]===e)return t}return 0}function NV(e){let t=Math.floor(e/2);return e%2==1?-t:t}var PV={bool:1,null:2,undefined:3,number:4,string:5,bytes:6,bigint:7,int64:8,struct:9,variant:10,array:11,option:12,result:13,duration:14,bigDecimal:15,dateTimeZoned:16,json:17,exit:18,cause:19,causeReason:20};function FV(e){let t=2166136261;for(let n=0;n<e.length;n++)t=Math.imul(t^e[n],16777619);return t>>>0}var IV=BigInt(`14695981039346656037`),LV=BigInt(`1099511628211`),RV=BigInt(`18446744073709551615`);function zV(e){let t=IV;for(let n=0;n<e.length;n++)t=(t^BigInt(e[n]))*LV&RV;return t}function BV(e,t){for(let n=0;n<t.length;n++)e.push(t[n])}function VV(e,t){for(;t>127;)e.push(t&127|128),t=Math.floor(t/128);e.push(t)}function HV(e,t){e.push(t&255,t>>>8&255,t>>>16&255,t>>>24&255)}function UV(e,t){for(let n=0;n<8;n++)e.push(Number(t>>BigInt(n*8)&aV))}var WV=class extends Error{issue;constructor(e){super(`SchemaBinary failure`),this.issue=e}};function q(e,t,n){throw GV(new eO({expected:e},t,n))}var J=[],Y=0;function GV(e){return new WV(Y===0?e:new YD(J.slice(0,Y),e))}function KV(e){let t=new Uint8Array(qV(e)),n=0;for(;e>127;)t[n++]=e&127|128,e=Math.floor(e/128);return t[n]=e,t}function qV(e){let t=1;for(;e>127;)e=Math.floor(e/128),t++;return t}var JV=32;function YV(e,t,n,r){let i=n-t;if(i===0)return``;if(i<=JV){let r=XV(e,t,n);if(r!==void 0)return r}try{return lV.decode(e.subarray(t,n))}catch{q(`utf-8`,void 0,r)}}function XV(e,t,n){let r=``,i=t;for(;i+16<=n;i+=16){let t=e[i],n=e[i+1],a=e[i+2],o=e[i+3],s=e[i+4],c=e[i+5],l=e[i+6],u=e[i+7],d=e[i+8],f=e[i+9],p=e[i+10],m=e[i+11],h=e[i+12],g=e[i+13],_=e[i+14],v=e[i+15];if((t|n|a|o|s|c|l|u|d|f|p|m|h|g|_|v)>127)return;r+=String.fromCharCode(t,n,a,o,s,c,l,u,d,f,p,m,h,g,_,v)}if(i+8<=n){let t=e[i],n=e[i+1],a=e[i+2],o=e[i+3],s=e[i+4],c=e[i+5],l=e[i+6],u=e[i+7];if((t|n|a|o|s|c|l|u)>127)return;r+=String.fromCharCode(t,n,a,o,s,c,l,u),i+=8}switch(n-i){case 0:return r;case 1:{let t=e[i];return t>127?void 0:r+String.fromCharCode(t)}case 2:{let t=e[i],n=e[i+1];return(t|n)>127?void 0:r+String.fromCharCode(t,n)}case 3:{let t=e[i],n=e[i+1],a=e[i+2];return(t|n|a)>127?void 0:r+String.fromCharCode(t,n,a)}case 4:{let t=e[i],n=e[i+1],a=e[i+2],o=e[i+3];return(t|n|a|o)>127?void 0:r+String.fromCharCode(t,n,a,o)}case 5:{let t=e[i],n=e[i+1],a=e[i+2],o=e[i+3],s=e[i+4];return(t|n|a|o|s)>127?void 0:r+String.fromCharCode(t,n,a,o,s)}case 6:{let t=e[i],n=e[i+1],a=e[i+2],o=e[i+3],s=e[i+4],c=e[i+5];return(t|n|a|o|s|c)>127?void 0:r+String.fromCharCode(t,n,a,o,s,c)}default:{let t=e[i],n=e[i+1],a=e[i+2],o=e[i+3],s=e[i+4],c=e[i+5],l=e[i+6];return(t|n|a|o|s|c|l)>127?void 0:r+String.fromCharCode(t,n,a,o,s,c,l)}}}var ZV=65536,QV=256,$V=512,eH=16384;function tH(e){let t=new Uint8Array(e);return{buf:t,view:new DataView(t.buffer),offset:0,writing:!1}}var nH=tH(ZV),rH=class{buf=new Uint8Array;view=new DataView(this.buf.buffer);arena;start=0;limit=0;len=0;reset(){let e=nH;(e.writing||e.offset>=e.buf.length)&&(e=nH=tH(ZV)),e.writing=!0,this.arena=e,this.buf=e.buf,this.view=e.view,this.start=e.offset,this.limit=e.buf.length-e.offset,this.len=0}ensure(e){if(this.len+e>this.limit){let t=this.arena,n=this.len+e,r=ZV;for(;r<n;)r*=2;let i=tH(r);i.writing=!0,i.buf.set(this.buf.subarray(this.start,this.start+this.len)),t.writing=!1,this.arena=nH=i,this.buf=i.buf,this.view=i.view,this.start=0,this.limit=i.buf.length}}byte(e){this.ensure(1),this.buf[this.start+this.len++]=e}bytes(e){this.ensure(e.length),this.buf.set(e,this.start+this.len),this.len+=e.length}uvarint(e){this.ensure(10);let t=this.buf,n=this.start+this.len;if(e<128)t[n++]=e;else if(t[n++]=e&127|128,e<16384)t[n++]=e>>>7;else{for(t[n++]=e>>>7&127|128,e=Math.floor(e/16384);e>127;)t[n++]=e&127|128,e=Math.floor(e/128);t[n++]=e}this.len=n-this.start}uvarintBig(e){for(;e>rV;)this.byte(Number(e&rV)|128),e>>=nV;this.byte(Number(e))}zigzag(e){this.uvarintBig(e>=$B?e<<eV:(-e<<eV)-eV)}numberVarint(e){let t=e<0||e===0&&1/e<0,n=t?-e:e;n<=fV?this.uvarint(n*2+ +!!t):this.uvarintBig(BigInt(n)*tV+(t?eV:$B))}f64(e){this.ensure(8),this.view.setFloat64(this.start+this.len,e,!0),this.len+=8}i64(e){this.ensure(8),this.view.setBigInt64(this.start+this.len,e,!0),this.len+=8}u64(e){this.ensure(8),this.view.setBigUint64(this.start+this.len,e,!0),this.len+=8}u32le(e){this.ensure(4),this.view.setUint32(this.start+this.len,e>>>0,!0),this.len+=4}i32le(e){this.ensure(4),this.view.setInt32(this.start+this.len,e|0,!0),this.len+=4}idAndMark(e){let t=e.length;this.ensure(t+1);let n=this.buf,r=this.start+this.len;for(let i=0;i<t;i++)n[r++]=e[i];let i=r-this.start;return this.len=i+1,i}beginSized(){return this.ensure(1),this.len++}endSized(e){let t=this.len-e-1;t<128?this.buf[this.start+e]=t:this.growSized(e,t)}endSizedRun(e){let t=(this.len-e-1)*2;t<128?this.buf[this.start+e]=t:this.growSized(e,t)}growSized(e,t){let n=qV(t),r=n-1;this.ensure(r);let i=this.start+e;this.buf.copyWithin(i+n,i+1,this.start+this.len),this.len+=r;let a=t,o=i;for(;a>127;)this.buf[o++]=a&127|128,a=Math.floor(a/128);this.buf[o]=a}string(e){let t=e.length;if(t===0)return;this.ensure(t*3);let n=this.buf,r=this.start+this.len,i=0;for(;i+4<=t;i+=4){let t=e.charCodeAt(i),a=e.charCodeAt(i+1),o=e.charCodeAt(i+2),s=e.charCodeAt(i+3);if((t|a|o|s)>127){this.len+=cV.encodeInto(e,n.subarray(this.start+this.len)).written;return}n[r++]=t,n[r++]=a,n[r++]=o,n[r++]=s}for(;i<t;i++){let t=e.charCodeAt(i);if(t>127){this.len+=cV.encodeInto(e,n.subarray(this.start+this.len)).written;return}n[r++]=t}this.len=r-this.start}out(){let e=this.arena,t=new Uint8Array(e.buf.buffer,this.start,this.len);return e===nH&&(e.offset=this.start+this.len),e.writing=!1,this.arena=void 0,t}abort(){let e=this.arena;e!==void 0&&(e===nH&&(e.offset=this.start),e.writing=!1,this.arena=void 0)}};function iH(e){let t=fj(e);return t._tag===`String`&&t.checks===void 0}function aH(e,t,n){return e.extra.find(e=>Xk({[t]:null},e.parameter,n).length>0)}var oH=class{entries=new WeakMap;orderLayouts;orderKeys;options;size=0;next=0;replace=!1;constructor(e,t){this.options=e,this.orderLayouts=t===void 0?void 0:Array(t),this.orderKeys=t===void 0?void 0:Array(t)}beginFrame(){this.replace=!0}find(e,t){let n=this.entries.get(e);if(n===void 0&&(n=new Map,this.entries.set(e,n)),n.has(t))return n.get(t);let r=aH(e,t,this.options),i=this.orderLayouts;if(i===void 0)return n.set(t,r),r;let a=this.orderKeys;if(this.size<i.length)i[this.size]=e,a[this.size]=t,this.size++,n.set(t,r);else if(this.replace){this.replace=!1;let o=i[this.next];(o===e?n:this.entries.get(o))?.delete(a[this.next]),i[this.next]=e,a[this.next]=t,this.next=(this.next+1)%i.length,n.set(t,r)}return r}clear(){this.entries=new WeakMap,this.orderLayouts?.fill(void 0),this.orderKeys?.fill(void 0),this.size=this.next=0,this.replace=!1}},sH=new ArrayBuffer(0),cH=new Uint8Array(sH),lH=new DataView(sH),uH=class{pos=0;nesting=0;buf=cH;view;viewCache=lH;viewBuffer=sH;viewOffset=0;viewLength=0;end=0;options=wk;indexSignatures;positional=!1;rejectUnknownFields=!1;intern;dict;reset(e,t,n,r,i,a,o){this.nesting=0,this.view=void 0,this.buf=e,this.pos=t,this.end=n,this.options=r,this.indexSignatures=i,this.positional=a.positional,this.rejectUnknownFields=a.rejectUnknownFields,this.intern=void 0,this.dict=o}release(){this.pos=this.end=this.nesting=0,this.buf=cH,this.view=void 0,this.viewCache=lH,this.viewBuffer=sH,this.viewOffset=this.viewLength=0,this.options=wk,this.indexSignatures=void 0,this.positional=!1,this.rejectUnknownFields=!1,this.intern=void 0,this.dict=void 0}get remaining(){return this.end-this.pos}dataView(){let e=this.buf;return(e.buffer!==this.viewBuffer||e.byteOffset!==this.viewOffset||e.byteLength!==this.viewLength)&&(this.viewBuffer=e.buffer,this.viewOffset=e.byteOffset,this.viewLength=e.byteLength,this.viewCache=new DataView(e.buffer,e.byteOffset,e.byteLength)),this.view=this.viewCache}byte(){return this.pos>=this.end&&q(`complete value`,void 0,this.options),this.buf[this.pos++]}take(e){this.pos+e>this.end&&q(`complete value`,void 0,this.options);let t=this.buf.subarray(this.pos,this.pos+e);return this.pos+=e,t}takeCopy(e){this.pos+e>this.end&&q(`complete value`,void 0,this.options);let t=this.buf.slice(this.pos,this.pos+e);return this.pos+=e,t}enter(e){this.pos+e>this.end&&q(`complete value`,void 0,this.options);let t=this.end;return this.end=this.pos+e,t}exit(e){this.pos=this.end,this.end=e}readUtf8(e){this.pos+e>this.end&&q(`complete value`,void 0,this.options);let t=this.pos;return this.pos+=e,YV(this.buf,t,t+e,this.options)}uvarint(){let e=this.buf,t=this.end,n=this.pos;n>=t&&q(`complete value`,void 0,this.options);let r=e[n++];if(r<128)return this.pos=n,r;let i=r&127;if(n>=t&&q(`complete value`,void 0,this.options),r=e[n++],i|=(r&127)<<7,r<128||(n>=t&&q(`complete value`,void 0,this.options),r=e[n++],i|=(r&127)<<14,r<128)||(n>=t&&q(`complete value`,void 0,this.options),r=e[n++],i|=(r&127)<<21,r<128))return this.pos=n,i;let a=268435456;for(let o=4;o<10;o++){n>=t&&(this.pos=n,q(`complete value`,void 0,this.options)),r=e[n++];let o=(r&127)*a;if(o>2**53-1-i&&(this.pos=n,q(`safe integer length`,void 0,this.options)),i+=o,r<128)return this.pos=n,i;a*=128}this.pos=n,q(`uvarint`,void 0,this.options)}fieldTag(){let e=this.buf,t=this.end,n=this.pos;n>=t&&q(`complete value`,void 0,this.options);let r=e[n++];if(r<128)return this.pos=n,r;let i=r&127;return n>=t&&q(`complete value`,void 0,this.options),r=e[n++],i|=(r&127)<<7,r<128||(n>=t&&q(`complete value`,void 0,this.options),r=e[n++],i|=(r&127)<<14,r<128)||(n>=t&&q(`complete value`,void 0,this.options),r=e[n++],i|=(r&127)<<21,r<128)?(this.pos=n,i):(n>=t&&q(`complete value`,void 0,this.options),r=e[n++],this.pos=n,r>=128&&q(`uvarint`,void 0,this.options),i+r*268435456)}uvarintBig(){let e=$B,t=$B;for(;;){let n=this.byte();if(e|=BigInt(n&127)<<t,!(n&128))return e;t+=nV}}numberVarint(){let e=this.buf,t=this.end,n=this.pos,r=0,i=1;for(let a=0;a<uV;a++){n>=t&&(this.pos=n,q(`complete value`,void 0,this.options));let a=e[n++];if(r+=(a&127)*i,a<128)return this.pos=n,NV(r);i*=128}let a=this.uvarintBig(),o=Number(a>>eV);return Number.isFinite(o)||q(`safe integer length`,void 0,this.options),(a&eV)===eV?-o:o}zigzag(){let e=this.uvarintBig();return(e&eV)===eV?-(e+eV>>eV):e>>eV}f64(){this.pos+8>this.end&&q(`complete value`,void 0,this.options);let e=(this.view??this.dataView()).getFloat64(this.pos,!0);return this.pos+=8,e}i64(){this.pos+8>this.end&&q(`complete value`,void 0,this.options);let e=(this.view??this.dataView()).getBigInt64(this.pos,!0);return this.pos+=8,e}u64(){this.pos+8>this.end&&q(`complete value`,void 0,this.options);let e=(this.view??this.dataView()).getBigUint64(this.pos,!0);return this.pos+=8,e}u32le(){this.pos+4>this.end&&q(`complete value`,void 0,this.options);let e=(this.view??this.dataView()).getUint32(this.pos,!0);return this.pos+=4,e}i32le(){this.pos+4>this.end&&q(`complete value`,void 0,this.options);let e=(this.view??this.dataView()).getInt32(this.pos,!0);return this.pos+=4,e}};function dH(e,t){return{_:`literal`,leaf:e,values:t,valueSet:t.length>4?new Set(t):void 0}}function fH(e,t){let n=e.values;return e.valueSet===void 0?n.length===1?t===n[0]:n.includes(t):e.valueSet.has(t)}function pH(e){return e.values.map(e=>typeof e==`string`?JSON.stringify(e):String(e)).join(` | `)}var mH=0,hH=1,gH=2,_H=3,vH=30,yH=1<<vH;function bH(e){return e._===`literal`?bH(e.leaf):e._===`int`}function xH(e){switch(e._){case`literal`:return xH(e.leaf);case`bool`:return 1;case`i32`:case`u32`:return 4;case`int64`:case`i64`:case`u64`:return 8;default:return}}function SH(e){return xH(e)!==void 0||bH(e)||e._===`null`||e._===`undefined`}function CH(e){return e._===`literal`?CH(e.leaf):e._===`null`||e._===`undefined`}var wH={"effect/schema/Date":{kind:PV.int64,exact:!0},"effect/schema/DateTimeUtc":{kind:PV.int64,exact:!0},"effect/schema/DateTimeZoned":{kind:PV.dateTimeZoned,exact:!0},"effect/schema/Duration":{kind:PV.duration,exact:!0},"effect/schema/BigDecimal":{kind:PV.bigDecimal,exact:!0},"effect/schema/Uint8Array":{kind:PV.bytes,exact:!0},"effect/schema/Option":{kind:PV.option,exact:`parameters`},"effect/schema/Result":{kind:PV.result,exact:`parameters`},"effect/schema/Exit":{kind:PV.exit,exact:`parameters`},"effect/schema/Cause":{kind:PV.cause,exact:`parameters`},"effect/schema/CauseReason":{kind:PV.causeReason,exact:`parameters`}};function TH(e){let t=e.annotations?.representation;return zr(t)&&typeof t.id==`string`?t.id:void 0}var EH=XA(e=>{let t=DH(e),n=e.context;return t===e||n===void 0?t:JA(t,new Tk(n.isOptional,n.isMutable,void 0,n.annotations))});function DH(e){switch(e._tag){case`Declaration`:{let t=TH(e);if(t!==void 0&&(t in wH||t===`effect/schema/Json`||t===`effect/schema/MutableJson`))return e.recur(EH);let n=e.annotations?.toCodecJson,r=e.annotations?.toCodec;if(!Mr(n)&&!Mr(r))return e;let i=e.typeParameters.map(e=>K(fj(e))),a=(Mr(n)?n(i):void 0)??(Mr(r)?r(i):void 0);return a===void 0?e:zA(e,[GA(a,EH)])}case`Arrays`:case`Objects`:case`Union`:case`Suspend`:return e.recur(EH);default:return e}}function OH(e){let t=[...e].sort((e,t)=>{let n=typeof e.key==`number`;return n===(typeof t.key==`number`)?n?e.key-t.key:GM(cV.encode(e.key),cV.encode(t.key)):n?-1:1}),n=[];for(let e of t){let t=cV.encode(String(e.key));n.push(typeof e.key==`number`?0:1),HV(n,t.length),BV(n,t);let r=e.literal,i=cV.encode(AH(r));n.push(kH(r)),HV(n,i.length),BV(n,i)}return FV(n)}function kH(e){switch(typeof e){case`string`:return 1;case`number`:return 2;case`boolean`:return 3;case`bigint`:return 4;default:return 5}}function AH(e){if(typeof e==`symbol`){let t=globalThis.Symbol.keyFor(e);if(t===void 0)throw Error(`Binary layout: unregistered unique symbol (Symbol.keyFor)`);return t}return String(e)}function jH(e){switch(e._tag){case`Symbol`:return!0;case`Union`:return e.types.some(jH);default:return!1}}function MH(e){let t=TH(e);return t===`effect/schema/Json`||t===`effect/schema/MutableJson`||Mr(e.annotations?.toCodecJson)}function NH(e){let t=e.checks;if(t===void 0)return!1;let n=e=>e.annotations?.representation?.id===`effect/schema/isInt`||e._tag===`FilterGroup`&&e.checks.some(n);return t.some(n)}function PH(e){for(;e._tag===`Suspend`;)e=e.thunk();return e}function FH(e){return new bA(e.enums.map(e=>new Ik(e[1],{title:e[0]})))}function IH(e){let t=[],n=new Set,r=e=>{let i=PH(e);if(!n.has(i))switch(n.add(i),i._tag){case`Never`:return;case`Union`:i.types.forEach(r);return;case`Enum`:FH(i).types.forEach(r);return;default:t.push(i)}};return e.types.forEach(r),t}function LH(e){switch(typeof e){case`string`:return`string`;case`number`:return`number`;case`boolean`:return`bool`;default:return`bigint`}}function RH(e){switch(e._tag){case`String`:case`TemplateLiteral`:case`Symbol`:return PV.string;case`UniqueSymbol`:if(globalThis.Symbol.keyFor(e.symbol)===void 0)throw Error(`Binary layout: unregistered unique symbol (Symbol.keyFor)`);return PV.string;case`Boolean`:return PV.bool;case`Null`:return PV.null;case`Undefined`:case`Void`:return PV.undefined;case`Number`:return PV.number;case`BigInt`:return PV.bigint;case`Literal`:switch(typeof e.literal){case`string`:return PV.string;case`number`:return PV.number;case`boolean`:return PV.bool;default:return PV.bigint}case`Unknown`:case`Any`:case`ObjectKeyword`:return PV.json;case`Objects`:return PV.struct;case`Arrays`:return PV.array;case`Declaration`:{let t=TH(e);if(t!==void 0&&t in wH)return wH[t].kind;if(MH(e))return PV.json;throw Error(`Binary layout: declaration ${t??`<anonymous>`} has no toCodecJson or toCodec`)}case`Suspend`:return RH(PH(e));default:throw Error(`Binary layout: union members are not uniquely identifiable`)}}function zH(e){for(let t of e.fields)t.optional||(t.index<32?e.requiredMask|=1<<t.index:e.requiredWide=!0)}function BH(e){let t=VH(e),n=!t&&UH(e);e=fj(e);let r=new Map,i=!1,a=0,o=e=>({_:e,slot:e===`string`?a++:0});function s(e){let t=r.get(e);if(t!==void 0)return t;let n=c(e);return r.set(e,n),n}function c(e){switch(e._tag){case`String`:case`TemplateLiteral`:return o(`string`);case`Symbol`:case`UniqueSymbol`:return o(`symbol`);case`Boolean`:return o(`bool`);case`Null`:return o(`null`);case`Undefined`:case`Void`:return o(`undefined`);case`Number`:{let t=YB(e);return o(t===`i32`||t===`u32`?t:NH(e)?`int`:`number`)}case`BigInt`:{let t=YB(e);return o(t===`i64`||t===`u64`?t:`bigint`)}case`Literal`:return dH(o(LH(e.literal)),[e.literal]);case`Unknown`:case`Any`:case`ObjectKeyword`:return o(`json`);case`Never`:return{_:`never`,ast:e};case`Enum`:return f(e,IH(FH(e)));case`Suspend`:{i=!0;let t=s(e.thunk());return r.set(e,t),t}case`Objects`:return l(e);case`Arrays`:return u(e);case`Union`:return f(e,IH(e));case`Declaration`:return d(e)}}function l(e){let t=[],n=[],i=new Map;for(let r of e.propertySignatures){if(typeof r.name==`symbol`)throw Error(`Binary layout: symbol property names are illegal`);let e=String(r.name),a=r.type.context?.annotations,o=a?.[WB],s=typeof o==`number`?o:FV(cV.encode(e));if(!Number.isInteger(s)||s<0||s>4294967295)throw Error(`Binary layout: illegal field id for ${e}`);let c=i.get(s);c===void 0?i.set(s,[e]):c.push(e),t.push({name:e,id:s,tagBytes:KV(s*DV+yV),index:0,optional:r.type.context?.isOptional===!0,annotations:a,layout:void 0,wireMask:0,inline:!1}),n.push(r.type)}for(let[e,t]of i)if(e===0||t.length>1)throw Error(`Binary layout field id collision: ${e} (${t.join(`, `)})`);let a=[];for(let t of e.indexSignatures){if(jH(t.parameter))throw Error(`Binary layout: symbol property names are illegal`);a.push({parameter:t.parameter,layout:void 0,wireMask:0})}let o={_:`struct`,ast:e,fields:t,byId:new Map,extra:a,extraAll:a.length===1&&iH(a[0].parameter)?a[0]:void 0,names:new Set(t.map(e=>e.name)),extraShape:void 0,optionalCount:0,requiredMask:0,requiredWide:!1};r.set(e,o);for(let e=0;e<t.length;e++){let r=t[e];r.layout=s(n[e]),r.wireMask=dW(r.layout),r.inline=SH(r.layout),r.optional&&o.optionalCount++,o.byId.set(r.id,r)}t.sort((e,t)=>e.id-t.id);for(let e=0;e<t.length;e++)t[e].index=e;zH(o);for(let t=0;t<a.length;t++)a[t].layout=s(e.indexSignatures[t].type),a[t].wireMask=dW(a[t].layout);return o}function u(e){let t={_:`array`,ast:e,elements:[],rest:[],hasCount:e.rest.length>0||e.elements.some(e=>e.context?.isOptional===!0),minCount:e.elements.filter(e=>e.context?.isOptional!==!0).length+Math.max(0,e.rest.length-1),uniform:void 0,uniformInline:!1,uniformPacked:void 0,uniformNumbers:!1,run:void 0};r.set(e,t);for(let n of e.elements)t.elements.push({optional:n.context?.isOptional===!0,layout:s(n)});for(let n of e.rest)t.rest.push(s(n));if(t.elements.length===0&&t.rest.length===1){let e=t.rest[0];t.uniform=e,t.uniformPacked=xH(e),t.uniformNumbers=e._===`number`,t.uniformInline=SH(e)}return t}function d(e){let t=TH(e);switch(t){case`effect/schema/Date`:return{_:`int64`,flavor:`date`};case`effect/schema/DateTimeUtc`:return{_:`int64`,flavor:`utc`};case`effect/schema/DateTimeZoned`:return o(`dateTimeZoned`);case`effect/schema/Duration`:return o(`duration`);case`effect/schema/BigDecimal`:return o(`bigDecimal`);case`effect/schema/Uint8Array`:return o(`bytes`)}let n=e.typeParameters;switch(t){case`effect/schema/Option`:{let t={_:`option`,value:void 0};return r.set(e,t),t.value=s(n[0]),t}case`effect/schema/Result`:{let t={_:`result`,success:void 0,failure:void 0};return r.set(e,t),t.success=s(n[0]),t.failure=s(n[1]),t}case`effect/schema/Exit`:{let t={_:`cause`,error:void 0,defect:void 0},i={_:`exit`,value:void 0,cause:t};return r.set(e,i),i.value=s(n[0]),t.error=s(n[1]),t.defect=s(n[2]),i}case`effect/schema/Cause`:case`effect/schema/CauseReason`:{let i={_:t===`effect/schema/Cause`?`cause`:`causeReason`,error:void 0,defect:void 0};return r.set(e,i),i.error=s(n[0]),i.defect=s(n[1]),i}}if(t!==void 0&&t in wH)throw Error(`Binary layout: native declaration ${t} has no layout constructor`);if(MH(e))return o(`json`);throw Error(`Binary layout: declaration ${t??`<anonymous>`} has no toCodecJson or toCodec`)}function f(e,t){if(t.length===0)return{_:`never`,ast:e};let n=[],i=[],a=new Map,c=new Map,l=(e,t)=>{let n=a.get(e);if(n!==void 0&&n._!==t._)throw Error(`Binary layout: union members are not uniquely identifiable`);a.set(e,t)};for(let e of t)if(e._tag===`Literal`){let t=RH(e),n=c.get(t);n===void 0?c.set(t,[e.literal]):n.includes(e.literal)||n.push(e.literal)}else if(e._tag===`UniqueSymbol`)RH(e),l(PV.string,o(`symbol`));else{if(e._tag===`Objects`||e._tag===`Arrays`){let t=mA(e);if(t!==void 0&&t.length>0){for(let e of t)if(typeof e.key==`symbol`)throw Error(`Binary layout: symbol property names are illegal`);n.push({member:e,sentinels:t});continue}}i.push({member:e,kind:RH(e)})}for(let[e,t]of c)l(e,dH(o(LH(t[0])),t));if(n.length===0&&i.length===0&&a.size===1)return a.values().next().value;let u=new Set(a.keys());for(let{kind:e}of i){if(u.has(e))throw Error(`Binary layout: union members are not uniquely identifiable`);u.add(e)}if(n.length===0&&a.size===0&&i.length===1){let t=s(i[0].member);return r.set(e,t),t}let d=new Map,f=[];for(let{sentinels:e}of n){let t=OH(e);if(d.has(t))throw Error(`Binary layout sentinel collision: ${t}`);d.set(t,e),f.push(t)}let p={_:`union`,ast:e,variants:[],byTag:new Map,discriminator:void 0,others:[],byKind:new Map,byPos:[]};r.set(e,p);for(let e=0;e<n.length;e++){let{member:t,sentinels:r}=n[e],i=f[e],a=s(t),o,c;if(t._tag===`Objects`){let e=a,t=new Set(r.map(e=>String(e.key))),n=e.fields.filter(e=>!t.has(e.name)),i={_:`struct`,ast:e.ast,fields:n,byId:new Map(n.map(e=>[e.id,e])),extra:e.extra,extraAll:e.extraAll,names:e.names,extraShape:void 0,optionalCount:n.reduce((e,t)=>t.optional?e+1:e,0),requiredMask:0,requiredWide:!1};zH(i),o=i,c=!1}else o=a,c=!0;let l={tag:i,sentinels:r,tuple:c,payload:o,position:0};p.variants.push(l),p.byTag.set(i,l)}for(let[e,t]of a)p.others.push({kind:e,layout:t,position:0}),p.byKind.set(e,t);for(let{kind:e,member:t}of i){let n=s(t);p.others.push({kind:e,layout:n,position:0}),p.byKind.set(e,n)}for(let e of[...p.variants].sort((e,t)=>e.tag-t.tag))e.position=p.byPos.length,p.byPos.push({variant:e,layout:e.payload});for(let e of[...p.others].sort((e,t)=>e.kind-t.kind))e.position=p.byPos.length,p.byPos.push({variant:void 0,layout:e.layout});return p.others.sort((e,t)=>YH(e.layout)-YH(t.layout)),p.discriminator=VU(p.variants),p}return{layout:s(e),recursive:i,exact:t,exitSuccess:n}}function VH(e){let t=new Map,n=e=>{if(e.encoding!==void 0||e.checks!==void 0&&!HH(e)||e.encodingChecks!==void 0)return!1;switch(e._tag){case`String`:case`Symbol`:case`Boolean`:case`Null`:case`Undefined`:case`Void`:case`Number`:case`BigInt`:case`Literal`:return!0;case`Never`:return!0;case`Unknown`:case`Any`:return!0;case`Arrays`:return e.elements.every(n)&&e.rest.every(n);case`Objects`:return e.propertySignatures.every(e=>n(e.type))&&e.indexSignatures.every(e=>e.parameter._tag===`String`&&n(e.parameter)&&n(e.type));case`Union`:return(e.options?.mode??`anyOf`)===`anyOf`&&e.types.every(n);case`Suspend`:{let r=t.get(e);if(r!==void 0)return r;t.set(e,!0);let i=n(e.thunk());return t.set(e,i),i}case`Declaration`:{let t=TH(e),r=t===void 0?void 0:wH[t];return r===void 0?!1:r.exact===!0||e.typeParameters.every(n)}default:return!1}};return n(e)}function HH(e){return(e._tag===`Number`||e._tag===`BigInt`)&&e.checks?.length===1&&YB(e)!==void 0}function UH(e){return e._tag===`Declaration`&&e.encoding===void 0&&e.checks===void 0&&e.encodingChecks===void 0&&TH(e)===`effect/schema/Exit`&&VH(e.typeParameters[0])}var WH={backEdge:0,bool:1,null:2,undefined:3,number:4,int:5,string:6,symbol:7,bytes:8,bigint:9,json:10,duration:11,bigDecimal:12,dateTimeZoned:13,date:14,dateTimeUtc:15,never:16,struct:17,array:18,union:19,option:20,result:21,exit:22,cause:23,causeReason:24,literal:25,i32:26,u32:27,i64:28,u64:29};function GH(e){let t=new Map,n=[],r=2**53-1;function i(e){let i=n.lastIndexOf(e);if(i>=0){i<r&&(r=i);let e=[WH.backEdge];return VV(e,n.length-i),zV(e)}let o=t.get(e);if(o!==void 0)return o;let s=n.length,c=r;r=2**53-1,n.push(e);let l=zV(a(e));n.pop();let u=r>=s;return u&&t.set(e,l),r=u?c:Math.min(c,r),l}function a(e){let t=[];switch(e._){case`bool`:case`null`:case`undefined`:case`number`:case`int`:case`string`:case`symbol`:case`bytes`:case`bigint`:case`i32`:case`u32`:case`i64`:case`u64`:case`json`:case`duration`:case`bigDecimal`:case`dateTimeZoned`:return t.push(WH[e._]),t;case`literal`:{t.push(WH.literal),BV(t,a(e.leaf)),VV(t,e.values.length);let n=e.values.map(e=>[kH(e),AH(e)]).sort((e,t)=>e[1]<t[1]?-1:e[1]>t[1]?1:e[0]-t[0]);for(let[e,r]of n){t.push(e);let n=cV.encode(r);VV(t,n.length),BV(t,n)}return t}case`int64`:return t.push(e.flavor===`date`?WH.date:WH.dateTimeUtc),t;case`never`:return t.push(WH.never),t;case`struct`:t.push(WH.struct),VV(t,e.fields.length);for(let n of e.fields)HV(t,n.id),t.push(+!!n.optional),UV(t,i(n.layout));VV(t,e.extra.length);for(let n of e.extra)UV(t,i(n.layout));return t;case`array`:t.push(WH.array),VV(t,e.elements.length);for(let n of e.elements)t.push(+!!n.optional),UV(t,i(n.layout));VV(t,e.rest.length);for(let n of e.rest)UV(t,i(n));return t;case`union`:t.push(WH.union),VV(t,e.byPos.length);for(let n of e.byPos){let e=n.variant;e===void 0?t.push(0):(t.push(1,+!!e.tuple),HV(t,e.tag)),UV(t,i(n.layout))}return t;case`option`:return t.push(WH.option),UV(t,i(e.value)),t;case`result`:return t.push(WH.result),UV(t,i(e.success)),UV(t,i(e.failure)),t;case`exit`:return t.push(WH.exit),UV(t,i(e.value)),UV(t,i(e.cause.error)),UV(t,i(e.cause.defect)),t;case`cause`:case`causeReason`:return t.push(e._===`cause`?WH.cause:WH.causeReason),UV(t,i(e.error)),UV(t,i(e.defect)),t}}return i(e)}function KH(e,t){let n=new Uint8Array(8);for(let r=0;r<4;r++)n[r]=e>>>r*8&255,n[r+4]=t>>>r*8&255;return n}var qH={positional:!1,rejectUnknownFields:!1,envelope:XB,expectedEnvelope:`version 2 envelope, flags 0`,fingerprint:new Uint8Array(8)};({...qH});function JH(e){let t=GH(e);return{positional:!0,rejectUnknownFields:!1,envelope:ZB,expectedEnvelope:`version 2 envelope, flags 1`,fingerprint:KH(Number(t&oV),Number(t>>sV&oV))}}function YH(e){switch(e._){case`json`:return 2;case`struct`:return 1;default:return 0}}function XH(e,t){switch(e._){case`literal`:return fH(e,t);case`bool`:return typeof t==`boolean`;case`null`:return t===null;case`undefined`:return t===void 0;case`number`:case`int`:case`i32`:case`u32`:return typeof t==`number`;case`string`:return typeof t==`string`;case`symbol`:return typeof t==`symbol`;case`bigint`:case`i64`:case`u64`:return typeof t==`bigint`;case`bytes`:return t instanceof Uint8Array;case`int64`:return e.flavor===`date`?t instanceof Date:cE(t)&&t._tag===`Utc`;case`dateTimeZoned`:return cE(t)&&t._tag===`Zoned`;case`duration`:return yl(t);case`bigDecimal`:return jT(t);case`option`:return Uo(t);case`result`:return ls(t);case`exit`:return vg(t);case`cause`:return Hh(t);case`causeReason`:return Uh(t);case`array`:return Array.isArray(t);case`struct`:return zr(t)&&!Array.isArray(t);case`json`:return!0;case`union`:case`never`:return!1}}function X(e,t,n){throw GV(new eO({expected:e},t,n))}function ZH(e,t=new Set){if(!Rr(e))return!1;let n=Array.isArray(e),r=Object.getPrototypeOf(e);if(n||r===Object.prototype||r===null){if(t.has(e))return!0;t.add(e);try{if(n){for(let n=0;n<e.length;n++)if(ZH(e[n],t))return!0}else for(let n of Object.keys(e))if(ZH(e[n],t))return!0}finally{t.delete(e)}return!1}if(e instanceof Date||e instanceof Uint8Array||cE(e)||yl(e)||jT(e))return!1;if(t.has(e))return!0;t.add(e);try{if(Uo(e))return Go(e)&&ZH(e.value,t);if(ls(e))return ZH(ds(e)?e.success:e.failure,t);if(vg(e))return ZH(Tg(e)?e.value:e.cause,t);if(Hh(e))return e.reasons.some(e=>ZH(e,t));if(Uh(e))switch(e._tag){case`Fail`:return ZH(e.error,t);case`Die`:return ZH(e.defect,t);case`Interrupt`:return!1}if(kx(e)){for(let n of e)if(ZH(n,t))return!0;return!1}if(hE(e)){for(let[n,r]of e)if(ZH(n,t)||ZH(r,t))return!0;return!1}if(_E(e)){for(let n of e)if(ZH(n,t))return!0;return!1}if(NE(e))return ZH(IE(e),t);for(let n of Object.keys(e))if(ZH(e[n],t))return!0}finally{t.delete(e)}return!1}function QH(e,t,n,r){let i=r.beginSized();KU(e,t,n,r),r.endSized(i)}function $H(e,t,n){let r=globalThis.Symbol.keyFor(t);r===void 0&&X(`registered symbol`,t,e.options),n.string(r)}function eU(e,t,n,r){let i=n;switch(i._tag){case`Fail`:r.byte(0),KU(e,t.error,i.error,r);return;case`Die`:r.byte(1),KU(e,t.defect,i.defect,r);return;case`Interrupt`:i.fiberId===void 0?r.byte(2):(r.byte(3),r.f64(i.fiberId))}}function tU(e){for(let t=0;t<e.length;t++)if(e.charCodeAt(t)>127)return!1;return!0}function nU(e,t,n){if(e.layout!==t||e.keys.length!==n.length)return!1;for(let t=0;t<n.length;t++)if(e.keys[t]!==n[t])return!1;return!0}function rU(e,t){if(e.extraAll===void 0||t.length>$V)return!1;let n=0;for(let e=0;e<t.length;e++)if(n+=t[e].length,n>eH)return!1;return!0}function iU(e,t,n){let r=Object.keys(n),i=t.extraShape;if(i!==void 0&&nU(i,t,r))return i.pairs;let a=rU(t,r),o=a?void 0:e.extraShape;if(o!==void 0&&nU(o,t,r))return o.pairs;let s=t.names,c=t.extraAll,l=[],u=!0;for(let n of r){if(s.has(n))continue;let r=c??(e.indexSignatures??=new oH(e.options)).find(t,n);r!==void 0&&(u&&!tU(n)&&(u=!1),l.push([n,r,void 0]))}if(u)l.sort((e,t)=>e[0]<t[0]?-1:+(e[0]>t[0]));else{for(let e of l)e[2]=cV.encode(e[0]);l.sort((e,t)=>GM(e[2],t[2]))}if(a)for(let e of l)e[2]??=cV.encode(e[0]);let d={layout:t,keys:r,pairs:l};return a?t.extraShape=d:e.extraShape=d,l}function aU(e,t,n,r,i){for(let[a,o,s]of t){let t=s===void 0?a.length:s.length,c=n[a],l=oU(o.layout,c,e.options),u=l%DV;if(i===void 0)r.uvarint(t*DV+u);else{if(!i.disabled){let t=vU(i,a);if(t!==void 0){r.uvarint(t*16+u*2+1),J[Y++]=a,sU(e,o.layout,c,l,r),Y--;continue}yU(i,a)}r.uvarint(t*16+u*2)}s===void 0?r.string(a):r.bytes(s),J[Y++]=a,sU(e,o.layout,c,l,r),Y--}}function oU(e,t,n){if(e._===`literal`)return fH(e,t)||X(pH(e),t,n),oU(e.leaf,t,n);switch(e._){case`bool`:return typeof t!=`boolean`&&X(`a boolean`,t,n),t?CV:SV;case`number`:if(typeof t!=`number`&&X(`a number`,t,n),OV(t))return bV;{let e=MV(t);return e===0?xV:e*DV+wV}case`int`:return Number.isSafeInteger(t)||X(`an integer`,t,n),bV;case`i32`:case`u32`:return TV;default:return yV}}function sU(e,t,n,r,i){switch(r%DV){case SV:case CV:return;case bV:i.numberVarint(n);return;case xV:i.f64(n);return;case TV:KU(e,t,n,i);return;case wV:{let e=Math.floor(r/DV);i.numberVarint(Math.round(n*jV[e])),i.uvarint(e);return}default:QH(e,t,n,i)}}function cU(e,t,n,r){let i=oU(t.layout,n,e.options),a=i%DV;if(a===yV){let i=r.idAndMark(t.tagBytes);KU(e,t.layout,n,r),r.endSized(i)}else r.uvarint(t.id*DV+a),sU(e,t.layout,n,i,r)}function lU(e,t){let n=e.byName;if(n===void 0)return;let r=Object.getOwnPropertyNames(t),i=0;for(let e=0;e<r.length;e++){let t=n.get(r[e]);t!==void 0&&(i|=1<<t)}let a=e.struct;if((i&a.requiredMask)!==a.requiredMask){let e=a.fields;for(let t=0;t<e.length;t++){let n=e[t];if(!n.optional&&!(i&1<<t))throw J[Y++]=n.name,GV(new XD(n.annotations))}}return i}function uU(e,t,n,r){let i=n;if(t.extra.length>0){let n=e.intern;e.intern=void 0;let a=iU(e,t,i);if(a.length>0){r.uvarint(0);let t=r.beginSized();aU(e,a,i,r,n),r.endSized(t)}}let a=t.fields;for(let t=0;t<a.length;t++){let n=a[t],o=n.name;if(!Object.hasOwn(i,o)){if(n.optional)continue;throw J[Y++]=o,GV(new XD(n.annotations))}J[Y++]=o,cU(e,n,i[o],r),Y--}}function dU(e,t,n,r){let i=n,a=e.intern;e.intern=void 0;let o=t.optionalCount+7>>3,s=0;if(o>0){s=r.len;for(let e=0;e<o;e++)r.byte(0)}let c=t.fields,l=0;for(let t=0;t<c.length;t++){let n=c[t],a=n.name,o=Object.hasOwn(i,a);if(n.optional){if(o&&(r.buf[r.start+s+(l>>3)]|=1<<(l&7)),l++,!o)continue}else if(!o)throw J[Y++]=a,GV(new XD(n.annotations));J[Y++]=a,n.inline?KU(e,n.layout,i[a],r):QH(e,n.layout,i[a],r),Y--}if(t.extra.length>0){let n=iU(e,t,i);r.uvarint(n.length),aU(e,n,i,r,a)}}function fU(e){switch(e._){case`string`:return hH;case`array`:return e.uniform?._===`string`?gH:mH;case`struct`:return e.extra.length>0?_H:mH;default:return mH}}function pU(e){let t=e.uniform;if(t===void 0){if(e.rest.length!==1)return;t=e.rest[0];for(let n of e.elements)if(n.optional||n.layout!==t)return}return t._===`struct`?t:void 0}function mU(e){let t=e.run;if(t!==void 0)return t;let n=pU(e);if(n===void 0)return e.run=t=null,t;let r=n.fields.map(e=>fU(e.layout)),i=n.fields.length<=vH;return t={struct:n,intern:r,shapes:i,byName:i&&n.extra.length===0?new Map(n.fields.map((e,t)=>[e.name,t])):void 0},e.run=t,t}var hU=16,gU=64;function _U(e,t){return e[t]??={values:[],refs:void 0,hits:0,disabled:!1}}function vU(e,t){let n=e.refs;if(n!==void 0){let r=n.get(t);return r!==void 0&&e.hits++,r}let r=e.values;for(let n=0;n<r.length;n++)if(r[n]===t)return e.hits++,n}function yU(e,t){let n=e.values;if(e.refs!==void 0){if(e.hits===0&&n.length>=gU){e.disabled=!0,e.refs=void 0;return}e.refs.set(t,n.length)}else if(n.length>=hU){let r=e.refs=new Map;for(let e=0;e<n.length;e++)r.set(n[e],e);r.set(t,n.length)}n.push(t)}var bU=0,xU=1,SU=2,CU=64,wU=512;function TU(){return{slots:[],marks:[],frame:0}}function EU(e,t){return e[t]??={values:[],refs:new Map,state:bU,stamp:-1}}function DU(e,t){e.refs.has(t)?e.state=xU:(e.refs.set(t,e.values.length),e.values.push(t),e.values.length>=CU&&(e.state=SU))}function OU(e,t){let n=e.values;n.length>=wU||(e.refs.set(t,n.length),n.push(t))}function kU(e,t){t.stamp!==e.frame&&(t.stamp=e.frame,e.marks.push({slot:t,length:t.values.length,state:t.state}))}function AU(e){e.marks.length=0,e.frame++}function jU(e){let t=e.marks;for(let e=t.length-1;e>=0;e--){let{length:n,slot:r,state:i}=t[e],a=r.values;for(let e=n;e<a.length;e++)r.refs.delete(a[e]);a.length=n,r.state=i}t.length=0,e.frame++}function MU(e,t,n,r){let i=EU(e.slots,t.slot),a=i.state;if(a===SU){r.string(n);return}if(kU(e,i),a===bU){r.string(n),DU(i,n);return}let o=i.refs.get(n);o===void 0?(r.byte(0),OU(i,n),r.string(n)):r.uvarint(o*2+1)}function NU(e,t,n){let r=EU(e,t.slot),i=r.state;if(i===SU)return n.readUtf8(n.end-n.pos);if(i===bU){let e=n.readUtf8(n.end-n.pos);return DU(r,e),e}let a=n.uvarint();if((a&1)==1){let e=(a-1)/2,t=r.values;return e>=t.length&&q(`a dictionary reference`,a,n.options),t[e]}a!==0&&q(`a dictionary marker`,a,n.options);let o=n.readUtf8(n.end-n.pos);return OU(r,o),o}function PU(e,t,n,r,i){if(!e.disabled){let t=vU(e,r);if(t!==void 0){i.uvarint(t*2+1);return}yU(e,r)}let a=i.beginSized();KU(t,n,r,i),i.endSizedRun(a)}function FU(e,t,n,r,i){let a=[],o=[];for(let s=0;s<r;s++){J[Y++]=s;let r=i.beginSized();IU(e,t,a,o,n[s],i),i.endSized(r),Y--}}function IU(e,t,n,r,i,a){let o=t.struct,s=i,c=o.fields,l;if(o.extra.length>0){let t=iU(e,o,s);t.length>0&&(l=t)}let u=!t.shapes,d=l===void 0?0:yH,f=lU(t,s);if(f!==void 0)d=f;else for(let e=0;e<c.length;e++){let t=c[e];if(Object.hasOwn(s,t.name))u||(d|=1<<e);else if(!t.optional)throw J[Y++]=t.name,GV(new XD(t.annotations))}let p=-1;for(let e=0;e<n.length;e++)if(n[e]===d){p=e;break}p>=0?a.uvarint(p+1):(a.uvarint(0),u||n.push(d));let m=p<0,h=e.positional&&!u;if(m&&h&&a.uvarint(d),l!==void 0){m&&!h&&a.uvarint(0);let t=a.beginSized();aU(e,l,s,a),a.endSizedRun(t)}for(let n=0;n<c.length;n++){let i=c[n];if(u?!Object.hasOwn(s,i.name):!(d&1<<n))continue;m&&!h&&a.uvarint(i.id),J[Y++]=i.name;let o=t.intern[n];if(o===hH)PU(_U(r,n),e,i.layout,s[i.name],a);else{o!==mH&&(e.intern=_U(r,n));let t=a.beginSized();KU(e,i.layout,s[i.name],a),a.endSizedRun(t),e.intern=void 0}Y--}}function LU(e,t,n){let r=e.elements.length;if(t<r)return e.elements[t].layout;let i=Math.max(0,e.rest.length-1),a=Math.max(r,n-i);return t>=a?e.rest[t-a+1]:e.rest[0]}function RU(e,t,n,r){let i=n.length;if(t.rest.length===0&&i>t.elements.length)throw J[Y++]=t.elements.length,GV(new ZD(t.ast,n[t.elements.length],e.options));if(i<t.minCount)throw J[Y++]=i,GV(new XD(void 0));if(t.hasCount&&r.uvarint(i),i>0){let a=mU(t);if(a!==null){FU(e,a,n,i,r);return}}let a=t.uniform;if(a!==void 0){if(t.uniformNumbers){BU(e,n,i,r);return}let o=e.intern;if(e.intern=void 0,o!==void 0){for(let t=0;t<i;t++)J[Y++]=t,PU(o,e,a,n[t],r),Y--;return}let s=t.uniformInline;for(let t=0;t<i;t++)J[Y++]=t,s?KU(e,a,n[t],r):QH(e,a,n[t],r),Y--}else for(let a=0;a<i;a++){let o=LU(t,a,i);J[Y++]=a,SH(o)?KU(e,o,n[a],r):QH(e,o,n[a],r),Y--}}var zU=[];function BU(e,t,n,r){let i=!0,a=!0;for(let r=0;r<n;r++){let n=t[r];if(typeof n!=`number`&&(J[Y++]=r,X(`a number`,n,e.options)),OV(n))(n<0?-n:n)>AV&&(a=!1);else{i=!1;let e=MV(n);e===0?a=!1:zU[r]=e}if(!i&&!a)break}if(i){r.byte(mV);for(let e=0;e<n;e++)r.numberVarint(t[e])}else if(a){r.byte(hV);for(let e=0;e<n;e++){let n=t[e],i=Number.isInteger(n)?0:zU[e],a=i===0?n:Math.round(n*jV[i]),o=a<0||a===0&&1/a<0,s=o?-a:a;r.uvarint((s*2+ +!!o)*16+i)}}else{r.byte(pV);for(let e=0;e<n;e++)r.f64(t[e])}}function VU(e){if(!(e.length<2||e.some(e=>e.tuple)))for(let t of e[0].sentinels){let n=new Map;for(let r of e){let e=r.sentinels.find(e=>e.key===t.key);if(e===void 0||n.has(e.literal)||Number.isNaN(e.literal))break;n.set(e.literal,r)}if(n.size===e.length)return{key:t.key,rows:n}}}function HU(e,t){let n=e.sentinels;for(let e=0;e<n.length;e++){let{key:r,literal:i}=n[e];if(t[r]!==i||!Object.hasOwn(t,r))return!1}return!0}function UU(e,t){return e.tuple?Array.isArray(t)&&HU(e,t):zr(t)&&!Array.isArray(t)&&HU(e,t)}function WU(e,t,n,r){e.positional?r.uvarint(t.position):(r.byte(PV.variant),r.u32le(t.tag)),KU(e,t.payload,n,r)}function GU(e,t,n,r){let i=t.discriminator;if(i!==void 0){if(zr(n)&&!Array.isArray(n)){let t=n,a=i.rows.get(t[i.key]);if(a!==void 0&&HU(a,t)){WU(e,a,n,r);return}}}else for(let i of t.variants)if(UU(i,n)){WU(e,i,n,r);return}for(let i of t.others)if(XH(i.layout,n)){e.positional?r.uvarint(i.position):r.byte(i.kind),KU(e,i.layout,n,r);return}throw GV(new $D(t.ast,n,e.options))}function KU(e,t,n,r){switch(t._){case`literal`:fH(t,n)||X(pH(t),n,e.options),KU(e,t.leaf,n,r);return;case`bool`:typeof n!=`boolean`&&X(`a boolean`,n,e.options),r.byte(+(n===!0));return;case`null`:n!==null&&X(`null`,n,e.options);return;case`undefined`:n!==void 0&&X(`undefined`,n,e.options);return;case`number`:{if(typeof n!=`number`&&X(`a number`,n,e.options),OV(n)){r.numberVarint(n);return}let t=MV(n);t>0?(r.numberVarint(Math.round(n*jV[t])),r.byte(t)):r.f64(n);return}case`int`:Number.isSafeInteger(n)||X(`an integer`,n,e.options),r.numberVarint(n);return;case`string`:{typeof n!=`string`&&X(`a string`,n,e.options);let i=e.dict;i===void 0?r.string(n):MU(i,t,n,r);return}case`symbol`:typeof n!=`symbol`&&X(`a symbol`,n,e.options),$H(e,n,r);return;case`bytes`:n instanceof Uint8Array||X(`a Uint8Array`,n,e.options),r.bytes(n);return;case`bigint`:typeof n!=`bigint`&&X(`a bigint`,n,e.options),r.zigzag(n);return;case`i32`:(typeof n!=`number`||(n|0)!==n)&&X(`a 32-bit integer`,n,e.options),r.i32le(n);return;case`u32`:(typeof n!=`number`||n>>>0!==n)&&X(`a 32-bit unsigned integer`,n,e.options),r.u32le(n);return;case`i64`:(typeof n!=`bigint`||n<KB||n>qB)&&X(`a 64-bit integer`,n,e.options),r.i64(n);return;case`u64`:(typeof n!=`bigint`||n<$B||n>JB)&&X(`a 64-bit unsigned integer`,n,e.options),r.u64(n);return;case`int64`:{XH(t,n)||X(t.flavor===`date`?`a Date`:`a DateTime.Utc`,n,e.options);let i=t.flavor===`date`?n.getTime():n.epochMilliseconds;Number.isNaN(i)&&X(`a valid Date`,n,e.options),r.i64(BigInt(i));return}case`dateTimeZoned`:{XH(t,n)||X(`a DateTime.Zoned`,n,e.options);let i=n;r.i64(BigInt(i.epochMilliseconds)),i.zone._tag===`Offset`?(r.byte(0),r.i32le(i.zone.offset)):(r.byte(1),r.string(i.zone.id));return}case`duration`:{yl(n)||X(`a Duration`,n,e.options);let t=n.value;switch(t._tag){case`Infinity`:r.byte(1);return;case`NegativeInfinity`:r.byte(2);return;case`Nanos`:r.byte(0),r.zigzag(t.nanos);return;case`Millis`:r.byte(0),r.zigzag(BigInt(t.millis)*iV);return}}case`bigDecimal`:{jT(n)||X(`a BigDecimal`,n,e.options);let t=RT(n);r.zigzag(t.value),r.zigzag(BigInt(t.scale));return}case`json`:{let t;try{t=JSON.stringify(n)}catch{t=void 0}t===void 0&&(ZH(n)&&X(`acyclic value`,n,e.options),X(`a JSON-serializable value`,n,e.options)),r.string(t);return}case`option`:{Uo(n)||X(`an Option`,n,e.options);let i=n;i._tag===`None`?r.byte(0):(r.byte(1),KU(e,t.value,i.value,r));return}case`result`:{ls(n)||X(`a Result`,n,e.options);let i=n;i._tag===`Success`?(r.byte(0),KU(e,t.success,i.success,r)):(r.byte(1),KU(e,t.failure,i.failure,r));return}case`exit`:{vg(n)||X(`an Exit`,n,e.options);let i=n;i._tag===`Success`?(r.byte(0),KU(e,t.value,i.value,r)):(r.byte(1),KU(e,t.cause,i.cause,r));return}case`cause`:{Hh(n)||X(`a Cause`,n,e.options);let i=n.reasons;r.uvarint(i.length);for(let n of i){let i=r.beginSized();eU(e,t,n,r),r.endSized(i)}return}case`causeReason`:Uh(n)||X(`a Cause.Reason`,n,e.options),eU(e,t,n,r);return;case`struct`:(!zr(n)||Array.isArray(n))&&X(`an object`,n,e.options),e.positional?dU(e,t,n,r):uU(e,t,n,r);return;case`array`:Array.isArray(n)||X(`an array`,n,e.options),RU(e,t,n,r);return;case`union`:GU(e,t,n,r);return;case`never`:throw GV(new $D(t.ast,n,e.options))}}var qU=new rH;function JU(e,t,n,r,i){let a=i.beginSized();i.byte(r.envelope),r.positional&&i.bytes(r.fingerprint),KU(e,t,n,i),i.endSized(a)}function YU(e,t,n,r,i,a){let o={options:r,positional:i.positional,indexSignatures:void 0,extraShape:void 0,intern:void 0,dict:a},s=qU??new rH,c=s===qU;c&&(qU=void 0),s.reset();let l=Y,u=!1;try{if(n===void 0)Y=0,JU(o,e,t,i,s);else for(let t=0;t<n.length;t++)Y=0,JU(o,e,n[t],i,s);let r=s.out();return u=!0,r}finally{a!==void 0&&(u?AU(a):jU(a)),s.abort(),Y=l,c&&(qU=s)}}function XU(e,t,n,r,i){return YU(e,void 0,t,n,r,i)}function ZU(e,t,n,r,i){return YU(e,t,void 0,n,r,i)}function QU(e){return vg(e)&&Tg(e)}var $U=globalThis.Symbol.for(`~effect/encoding/SchemaBinary/absent`);function eW(e,t){let n=kW(e,t);return n!==$U&&t.pos!==t.end&&q(`no leftover bytes`,void 0,t.options),n}function tW(e,t){let n=t.enter(t.uvarint()),r=eW(e,t);return t.exit(n),r}function nW(e,t){if(bH(e))return kW(e,t);let n=xH(e),r=t.enter(n===void 0?e._===`null`||e._===`undefined`?0:t.uvarint():n),i=eW(e,t);return t.exit(r),i}var rW=8;function iW(e,t){let n=e.set;if(n!==void 0)return n.has(t)?!0:(n.add(t),!1);let r=e.list;if(r.includes(t))return!0;if(r.length>=rW){let n=e.set=new Set;for(let e=0;e<r.length;e++)n.add(r[e]);n.add(t)}else r.push(t);return!1}function aW(e,t,n,r,i){let a=t.uvarint(),o=Math.floor(i===void 0?a/DV:a/16),s=i===void 0?a-o*DV:Math.floor((a-o*16)/2),c=i===void 0?t.readUtf8(o):oW(i,a,o,t);e.names.has(c)&&q(`an extra key distinct from declared fields`,c,t.options),iW(r,c)&&q(`unique extra keys`,void 0,t.options);let l=e.extraAll??(t.indexSignatures??=new oH(t.options)).find(e,c);if(l===void 0){t.rejectUnknownFields&&q(`a key matching an index signature`,c,t.options),uW(s,t);return}J[Y++]=c;let u=pW(l.layout,l.wireMask,s,t);Y--,u!==$U&&Fi(n,c,u)}function oW(e,t,n,r){if((t&1)==1)return n>=e.length&&q(`a known back-reference`,void 0,r.options),e[n];let i=r.readUtf8(n);return e.push(i),i}function sW(e){return new YD([e.name],new XD(e.annotations))}function cW(e,t){throw GV(new QD(e.ast,t))}function lW(e){for(;e.byte()&128;);}function uW(e,t){switch(e){case yV:t.take(t.uvarint());return;case bV:lW(t);return;case xV:t.take(8);return;case SV:case CV:case EV:return;case wV:lW(t),lW(t);return;case TV:t.take(4);return}}function dW(e){if(e._===`literal`)return dW(e.leaf);switch(e._){case`bool`:return 24;case`number`:return 38;case`int`:return 2;case`i32`:case`u32`:return 64;default:return 1}}function fW(e,t){switch(e){case SV:return!1;case CV:return!0;case bV:return t.numberVarint();case xV:return t.f64();case wV:{let e=t.numberVarint(),n=t.uvarint();return(n===0||n>kV)&&q(`a decimal scale in [1, 8]`,n,t.options),e/jV[n]}}return q(`matching field wire kind`,void 0,t.options)}function pW(e,t,n,r){if(!(t&1<<n))return r.rejectUnknownFields&&q(`matching field wire kind`,n,r.options),uW(n,r),$U;if(n===TV)return e._===`u32`?r.u32le():r.i32le();if(n!==yV){let t=fW(n,r);return e._===`literal`&&!fH(e,t)&&q(pH(e),t,r.options),t}let i=r.enter(r.uvarint()),a=eW(e,r);return r.exit(i),a}function mW(e,t){let n;e.extra.length>0&&(n=t.intern,t.intern=void 0);let r={},i=0,a=0,o,s,c,l=!1,u=e.fields,d=0;for(;t.pos<t.end;){let f=t.fieldTag(),p=Math.floor(f/DV),m=f-p*DV;if(p===0){l&&q(`unique field ids`,void 0,t.options),l=!0,m!==yV&&q(`extra field map`,void 0,t.options);let i=t.enter(t.uvarint());_W(e,t,r,n),t.exit(i);continue}let h;if(d<u.length&&u[d].id===p?(h=u[d],d++):(h=e.byId.get(p),h!==void 0&&(d=h.index+1)),h===void 0){t.rejectUnknownFields&&q(`a known field id`,p,t.options),c===void 0?c=new Set:c.has(p)&&q(`unique field ids`,void 0,t.options),c.add(p),uW(m,t);continue}let g=h.index;if(g<32){let e=1<<g;(i&e)!==0&&q(`unique field ids`,void 0,t.options),i|=e}else o===void 0?o=new Set([g]):(o.has(g)&&q(`unique field ids`,void 0,t.options),o.add(g));J[Y++]=h.name;let _=pW(h.layout,h.wireMask,m,t);Y--,_!==$U&&(Fi(r,h.name,_),g<32?a|=1<<g:(s??=new Set).add(g))}return hW(e,a,s,t),r}function hW(e,t,n,r){if((t&e.requiredMask)===e.requiredMask&&!e.requiredWide)return;let i=e.fields,a;for(let e=0;e<i.length;e++){let o=i[e],s=o.index,c=s<32?!!(t&1<<s):n?.has(s)===!0;if(!o.optional&&!c&&((a??=[]).push(sW(o)),r.options.errors!==`all`))break}a!==void 0&&cW(e,a)}function gW(e,t){let n;e.extra.length>0&&(n=t.intern,t.intern=void 0);let r={},i=e.optionalCount+7>>3,a=0;i>0&&(t.pos+i>t.end&&q(`complete value`,void 0,t.options),a=t.pos,t.pos+=i);let o=t.buf,s=e.fields,c=0,l;for(let e=0;e<s.length;e++){let n=s[e];if(n.optional){let e=!!(o[a+(c>>3)]&1<<(c&7));if(c++,!e)continue}J[Y++]=n.name;let i=n.inline?nW(n.layout,t):tW(n.layout,t);if(Y--,i!==$U)Fi(r,n.name,i);else if(!n.optional&&((l??=[]).push(sW(n)),t.options.errors!==`all`))break}if(l!==void 0&&cW(e,l),e.extra.length>0){let i=t.uvarint();if(i>t.remaining&&q(`complete value`,void 0,t.options),i>0){let a={list:[],set:void 0};for(let o=0;o<i;o++)aW(e,t,r,a,n)}}return r}function _W(e,t,n,r){let i={list:[],set:void 0};for(;t.pos<t.end;)aW(e,t,n,i,r)}function vW(e,t,n){let r=n.uvarint();if((r&1)==1){let t=(r-1)/2;return t>=e.length&&q(`a known back-reference`,void 0,n.options),e[t]}if(t._===`string`){if(n.dict!==void 0){let i=n.enter(r/2),a=eW(t,n);return n.exit(i),e.push(a),a}let i=n.readUtf8(r/2);return e.push(i),i}let i=n.enter(r/2),a=eW(t,n);return n.exit(i),e.push(a),a}function yW(e,t,n){let r=Array(t),i=[],a=[];for(let o=0;o<t;o++){J[Y++]=o;let t=n.enter(n.uvarint());r[o]=xW(e,i,a,n),n.exit(t),Y--}return r}function bW(e,t){let n=t.uvarint(),r=e.fields,i=n&-1073741825;(n>yH*2-1||i>>>r.length)&&q(`a known row shape`,void 0,t.options);let a=[];(n&yH)!==0&&a.push(null);for(let e=0;e<r.length;e++)i&1<<e&&a.push(r[e]);return a}function xW(e,t,n,r){let i=e.struct,a={},o=0,s,c=r.uvarint(),l;if(c===0?r.positional&&e.shapes&&(l=bW(i,r),t.push(l)):(l=t[c-1],l===void 0&&q(`a known row shape`,void 0,r.options)),l!==void 0){for(let t=0;t<l.length;t++){let i=SW(e,n,l[t],a,r);i>=0&&(i<32?o|=1<<i:(s??=new Set).add(i))}r.pos!==r.end&&q(`no leftover bytes`,void 0,r.options)}else{let c=e.shapes?[]:void 0,l=0,u,d,f=!1;for(;r.pos<r.end;){let t=r.uvarint(),p;t===0?(f&&q(`unique field ids`,void 0,r.options),f=!0,p=null):(p=i.byId.get(t),p===void 0?(r.rejectUnknownFields&&q(`a known field id`,t,r.options),d===void 0?d=new Set([t]):d.has(t)?q(`unique field ids`,void 0,r.options):d.add(t)):p.index<32?(l&1<<p.index&&q(`unique field ids`,void 0,r.options),l|=1<<p.index):u===void 0?u=new Set([p.index]):(u.has(p.index)&&q(`unique field ids`,void 0,r.options),u.add(p.index))),c?.push(p);let m=SW(e,n,p,a,r);m>=0&&(m<32?o|=1<<m:(s??=new Set).add(m))}c!==void 0&&t.push(c)}return hW(i,o,s,r),a}function SW(e,t,n,r,i){let a=i.uvarint();if((a&1)==1){if(n==null)return-1;let e=t[n.index],o=(a-1)/2;(e===void 0||o>=e.length)&&q(`a known back-reference`,void 0,i.options);let s=e[o];return s===$U?-1:(Fi(r,n.name,s),n.index)}let o=i.enter(a/2);if(n===null)return _W(e.struct,i,r),i.exit(o),-1;if(n===void 0)return i.exit(o),-1;let s=e.intern[n.index];(s===gH||s===_H)&&(i.intern=t[n.index]??=[]),J[Y++]=n.name;let c=eW(n.layout,i);return Y--,i.intern=void 0,i.exit(o),s===hH&&(t[n.index]??=[]).push(c),c===$U?-1:(Fi(r,n.name,c),n.index)}function CW(e,t){let n=e.elements.length,r=e.hasCount?t.uvarint():n;if(e.rest.length===0&&r>n)throw J[Y++]=n,GV(new ZD(e.ast,void 0,t.options));if(r<e.minCount)throw J[Y++]=r,GV(new XD(void 0));if(e.hasCount&&r>(e.rest.length>0&&CH(e.rest[0])?vV:t.remaining+_V)&&q(`array count within allocation limit`,r,t.options),r>0){let n=mU(e);if(n!==null)return yW(n,r,t)}let i=Array(r),a=e.uniform;if(a!==void 0){if(e.uniformNumbers)return wW(i,r,t);let n=t.intern;if(t.intern=void 0,n!==void 0){for(let e=0;e<r;e++){J[Y++]=e;let r=vW(n,a,t);if(r===$U)throw GV(new XD(void 0));Y--,i[e]=r}return i}if(bH(a)){for(let e=0;e<r;e++)J[Y++]=e,i[e]=kW(a,t),Y--;return i}if(a._===`string`){for(let e=0;e<r;e++)J[Y++]=e,i[e]=t.dict===void 0?t.readUtf8(t.uvarint()):tW(a,t),Y--;return i}let o=e.uniformPacked,s=e.uniformInline;for(let e=0;e<r;e++){J[Y++]=e;let n=t.enter(s?o??0:t.uvarint()),r=eW(a,t);if(t.exit(n),r===$U)throw GV(new XD(void 0));Y--,i[e]=r}return i}for(let a=0;a<r;a++){let o=LU(e,a,r),s=a<n&&e.elements[a].optional;if(!e.hasCount&&t.remaining===0&&!s&&o._!==`null`&&o._!==`undefined`)throw J[Y++]=a,GV(new XD(void 0));J[Y++]=a;let c=nW(o,t);if(c===$U)throw s&&q(`known union member`,void 0,t.options),GV(new XD(void 0));Y--,i[a]=c}if(!e.hasCount&&t.pos<t.end)throw J[Y++]=n,GV(new ZD(e.ast,void 0,t.options));return i}function wW(e,t,n){let r=n.byte();if(r===pV){n.remaining!==t*8&&q(`f64`,void 0,n.options);for(let r=0;r<t;r++)e[r]=n.f64();return e}if(r===hV){for(let r=0;r<t;r++){J[Y++]=r;let t=n.uvarint(),i=t%16;i>kV&&q(`decimal`,void 0,n.options);let a=NV((t-i)/16);e[r]=i===0?a:a/jV[i],Y--}return e}r!==mV&&q(`f64`,void 0,n.options);for(let r=0;r<t;r++)J[Y++]=r,e[r]=n.numberVarint(),Y--;return e}function TW(e,t){let n=t.byte();if(n===PV.variant){let n=t.u32le(),r=e.byTag.get(n);if(r===void 0)return t.rejectUnknownFields&&q(`known union member`,n,t.options),t.take(t.remaining),$U;let i=eW(r.payload,t);if(i===$U)return $U;if(!r.tuple)for(let e of r.sentinels)Fi(i,e.key,e.literal);return i}let r=e.byKind.get(n);return r===void 0?(t.rejectUnknownFields&&q(`known union member`,n,t.options),t.take(t.remaining),$U):eW(r,t)}function EW(e,t){let n=e.byPos[t.uvarint()];n===void 0&&q(`known union member`,void 0,t.options);let r=eW(n.layout,t),i=n.variant;if(i!==void 0&&!i.tuple&&r!==$U)for(let e of i.sentinels)Fi(r,e.key,e.literal);return r}function DW(e,t){switch(t.byte()){case 0:return Zh(OW(eW(e.error,t)));case 1:return Qh(OW(eW(e.defect,t)));case 2:return t.remaining!==0&&q(`empty`,void 0,t.options),$h();case 3:return t.remaining!==8&&q(`f64`,void 0,t.options),$h(t.f64());default:return t.take(t.remaining),$U}}function OW(e){if(e===$U)throw GV(new XD(void 0));return e}function kW(e,t){t.nesting>=gV&&q(`nesting depth at most ${gV}`,t.nesting+1,t.options),t.nesting++;try{return AW(e,t)}finally{t.nesting--}}function AW(e,t){switch(e._){case`literal`:{let n=kW(e.leaf,t);return fH(e,n)||q(pH(e),n,t.options),n}case`bool`:{t.remaining!==1&&q(`bool`,void 0,t.options);let e=t.byte();return e>1&&q(`bool`,void 0,t.options),e===1}case`null`:return t.remaining!==0&&q(`empty`,void 0,t.options),null;case`undefined`:t.remaining!==0&&q(`empty`,void 0,t.options);return;case`number`:{let e=t.remaining;if(e===8)return t.f64();(e===0||e>uV)&&q(`f64`,void 0,t.options);let n=t.numberVarint();if(t.remaining===0)return n;let r=t.byte();return(t.remaining!==0||r===0||r>kV)&&q(`decimal`,void 0,t.options),n/jV[r]}case`int`:return t.numberVarint();case`string`:{let n=t.dict;return n===void 0?t.readUtf8(t.end-t.pos):NU(n,e,t)}case`symbol`:return globalThis.Symbol.for(t.readUtf8(t.end-t.pos));case`bytes`:return t.takeCopy(t.end-t.pos);case`bigint`:return t.zigzag();case`i32`:return t.remaining!==4&&q(`a 32-bit integer`,void 0,t.options),t.i32le();case`u32`:return t.remaining!==4&&q(`a 32-bit unsigned integer`,void 0,t.options),t.u32le();case`i64`:return t.remaining!==8&&q(`a 64-bit integer`,void 0,t.options),t.i64();case`u64`:return t.remaining!==8&&q(`a 64-bit unsigned integer`,void 0,t.options),t.u64();case`int64`:{t.remaining!==8&&q(`int64`,void 0,t.options);let n=Number(t.i64()),r=new Date(n);return Number.isNaN(r.getTime())&&q(e.flavor===`date`?`a valid Date`:`a valid DateTime`,n,t.options),e.flavor===`date`?r:lE(n)}case`dateTimeZoned`:{let e=Number(t.i64()),n=t.byte(),r;if(n===0)t.remaining!==4&&q(`time zone`,void 0,t.options),r=t.i32le();else if(n===1)r=t.readUtf8(t.end-t.pos);else return q(`time zone`,void 0,t.options);try{return uE(e,{timeZone:r})}catch{return q(`time zone`,void 0,t.options)}}case`duration`:switch(t.byte()){case 0:return Dl(t.zigzag());case 1:return Tl;case 2:return El;default:return q(`duration`,void 0,t.options)}case`bigDecimal`:{let e=t.zigzag(),n=t.zigzag();return(n>QB||-n>QB)&&q(`safe integer length`,void 0,t.options),MT(e,Number(n))}case`json`:{let e=t.readUtf8(t.end-t.pos);try{return JSON.parse(e)}catch{return q(`json`,void 0,t.options)}}case`option`:{let n=t.byte();return n===0?(t.remaining!==0&&q(`empty`,void 0,t.options),M()):(n!==1&&q(`bool`,void 0,t.options),N(OW(eW(e.value,t))))}case`result`:{let n=t.byte();return n===0?os(OW(eW(e.success,t))):(n!==1&&q(`bool`,void 0,t.options),ss(OW(eW(e.failure,t))))}case`exit`:{let n=t.byte();return n===0?yg(OW(eW(e.value,t))):(n!==1&&q(`bool`,void 0,t.options),bg(kW(e.cause,t)))}case`cause`:{let n=t.uvarint(),r=[];for(let i=0;i<n;i++){J[Y++]=i;let n=t.enter(t.uvarint()),a=DW(e,t);t.exit(n),Y--,a!==$U&&r.push(a)}return t.pos!==t.end&&q(`no leftover bytes`,void 0,t.options),qh(r)}case`causeReason`:return DW(e,t);case`struct`:return t.positional?gW(e,t):mW(e,t);case`array`:return CW(e,t);case`union`:return t.positional?EW(e,t):TW(e,t);case`never`:throw GV(new $D(e.ast,void 0,t.options))}}function jW(e,t,n){let r=t.byte();if(r!==n.envelope&&q(n.expectedEnvelope,r,t.options),n.positional){t.remaining<8&&q(`complete value`,void 0,t.options);let e=t.buf,r=n.fingerprint,i=t.pos;for(let n=0;n<8;n++)e[i+n]!==r[n]&&q(`matching layout fingerprint`,void 0,t.options);t.pos=i+8}let i=eW(e,t);if(i===$U)throw GV(new XD(void 0));return i}var MW=new uH;function NW(e,t,n,r){let i=MW??new uH,a=i===MW;a&&(MW=void 0),i.reset(t,0,t.length,n,void 0,r,void 0);let o=Y;Y=0;try{let a=i.uvarint();a===0&&q(`nonzero frame length`,void 0,n);let o=i.enter(a),s=jW(e,i,r);return i.exit(o),i.pos!==t.length&&q(`no leftover bytes`,void 0,n),s}finally{Y=o,i.release(),a&&(MW=i)}}function PW(e,t,n,r=!1){return qO({decode:(i,a)=>{try{let o=NW(e,i,a,t);return n!==void 0&&Rr(o)&&(!r||QU(o))&&(n.value=o),R(o)}catch(e){return e instanceof WV?H(e.issue):Vy(e)}},encode:(n,r)=>{try{return R(ZU(e,n,r,t))}catch(e){return e instanceof WV?H(e.issue):Vy(e)}}})}var FW=vr(JH);function IW(e,t){return t===!0?FW(e):qH}var LW=vr(e=>{let t=K(EH(e)),{exact:n,exitSuccess:r,layout:i,recursive:a}=BH(t.ast);return{target:a?KW(t):t,layout:i,exact:n,exitSuccess:r,recursive:a}});function RW(e){return LW(e.ast)}function zW(e,t){return e.value===void 0||t!==e.value?!1:(e.value=void 0,!0)}function BW(e,t,n){let r=K(dj(e.ast)),i=iM(r),a=e=>()=>(t,n,r)=>e(t,r)?BD:i(t,r);return K(new Ok([r.ast],a(t),{identifier:`binary value`},void 0,void 0,void 0,void 0,a(n)))}function VW(e,t){return t.onExcessProperty!==`error`}function HW(e,t,n){return BW(e,e=>zW(t,e),n?VW:UW)}function UW(){return!1}function WW(e,t){return qM()([e],([e])=>{let n=iM(e);return(e,r,i)=>zW(t,e)||QU(e)&&i.onExcessProperty!==`error`?R(e):n(e,i)},{identifier:`binary exit value`})}function GW(e){return BW(e,VW,VW)}function KW(e){let t=K(dj(e.ast)),n=new WeakSet;return IN(qM()([t],([e])=>(t,r,i)=>Rr(t)&&n.delete(t)?R(t):ZH(t)?H(new $D(r,t,i)):iM(e)(t,i),{identifier:`acyclic value`}),JO({decode:e=>(Rr(e)&&n.add(e),e),encode:e=>e}))(e)}var qW=class extends lc()(`effect/rpc/RpcSerialization`){},JW=16777216,YW=new TextEncoder,XW=e=>{let t=e?.maxFrameSize===`unbounded`?void 0:e?.maxFrameSize??JW,n=e?.fingerprintPayloads===!0?e=>FB(e,{fingerprint:!0}):FB,r={fingerprint:!0};return qW.of({contentType:`application/vnd.effect.rpc+schema-binary`,includesFraming:!0,codecFor:n,makeUnsafe:()=>{let e=BB(kB,{...r,maxFrameSize:t}),n=HB(kB,r);return{decode:t=>e.feedSync(typeof t==`string`?YW.encode(t):t),encode:e=>{if(!Array.isArray(e))return n.encode(e);if(e.length!==0)return n.encodeMany(e)}}}})},ZW=e=>g_(qW)(()=>XW(e)),QW=e=>z(()=>{let t=new Set,n=new Map,r=new Map,i=(e,t)=>yb(r=>{let i=n.get(e);return i||(i=[],n.set(e,i)),i.push([t,r]),V});return W(e((e,t)=>{let n=r.get(e);return n?n(t):i(e,t)},t),e=>({...e,run(e,i){return Ry(function*(){t.add(e),r.set(e,i);let a=n.get(e);if(a){n.delete(e);for(let[e,t]of a)yield*xb(z(()=>i(e)),t)}return yield*Nb(Ly,()=>(t.delete(e),r.delete(e),V))})}}))}),$W=0,eG=ox(function*(e,t){let n=t.spanPrefix,r=t?.supportsAck??!0,i=t?.disableTracing??!1,a=t?.generateRequestId??(()=>$W++),o=yield*vb(),s=Pc(o,Gg),c=new Map,l=!1;yield*Yg(s,Wy(e=>(l=!0,u(Cg(e.id)))));let u=ox(function*(e){let t=Array.from(c.values());c.clear();for(let n of t)n._tag===`Queue`?yield*e._tag===`Success`?BS(n.queue):RS(n.queue,e.cause):n.resume(e)},Rb),d=e=>{let r=uB(e.successSchema),a=m(e);return(o,s)=>{let c=s?.headers?HE(s.headers):VE,l=s?.context??Ec();if(!r){let r=t=>f(e,a,t,e.payloadSchema.make(o),c,l,s?.discard??!1);return i?r(void 0):Wb(oB(n,e._tag),{kind:`client`,attributes:sB(e._tag,t.spanAttributes)},r)}let u=p(e,a,e.payloadSchema.make(o),c,s?.streamBufferSize??16,l);return s?.asQueue?u:Ww(W(u,Bw))}},f=(e,n,r,i,o,s,u)=>Wy(d=>{if(l)return Fb;let f=a(),p=n(e=>t.onFromClient({message:e,context:s}),{_tag:`Request`,id:f,tag:e._tag,payload:i,...r?{traceId:r.traceId,spanId:r.spanId,sampled:r.sampled}:{},headers:KE(d.getRef(iG),o),...u?{discard:!0}:{}}),m;return Lb(Iy(t=>{let n=!1,i={_tag:`Effect`,rpc:e,context:s,resume(e){u&&e._tag===`Success`?(n=!0,m?.pollUnsafe()&&t(wg)):(t(e),m&&!m.pollUnsafe()&&d.currentDispatcher.scheduleTask(()=>{m.interruptUnsafe(d.id)},0))}};c.set(f,i),m=p.pipe(r?Kb(r,{captureStackTrace:!1}):D,Qb(d.context)),m.addObserver(e=>{if(e._tag===`Failure`)return c.delete(f),t(e);if(n)return t(wg)})}),e=>(c.delete(f),qy(yx(m),h(f,Array.from(e),s))))}),p=ox(function*(e,r,o,s,u,d){if(l)return yield*Fb;let f=i?void 0:yield*Ub(oB(n,e._tag),{kind:`client`,attributes:sB(e._tag,t.spanAttributes)}),p=xx(),m=a(),g=Nc(p.context,Gg),_=yield*NS(u);return yield*Jg(g,e=>(HS(_),c.has(m)?(c.delete(m),h(m,Eg(e)?Array.from(og(e.cause)):[],d)):V)),c.set(m,{_tag:`Queue`,rpc:e,queue:_,scope:g,context:d}),yield*r(e=>t.onFromClient({message:e,context:d}),{_tag:`Request`,id:m,tag:e._tag,payload:o,...f?{traceId:f.traceId,spanId:f.spanId,sampled:f.sampled}:{},headers:KE(p.getRef(iG),s)}).pipe(f?Kb(f,{captureStackTrace:!1}):D,jb(e=>(eg(e)||c.delete(m),RS(_,e))),Ib,Jb(g,{startImmediately:!0})),_}),m=e=>{let t=[];for(let n of e.middlewares.values()){let e=Mc(o,`${n.key}/Client`);e&&t.push(e)}return t.length===0?(e,t)=>e(t):function n(r,i,a=t.length-1){return a===-1?r(i):t[a]({rpc:e,request:i,next(e){return n(r,e,a-1)}})}},h=(e,n,r)=>Iy(i=>{let a=xx();t.onFromClient({message:{_tag:`Interrupt`,requestId:e,interruptors:n},context:r}).pipe(lb(1e3),Qb(a.context)).addObserver(()=>{i(V)})}),g=e=>{switch(e._tag){case`Chunk`:{let n=e.requestId,i=c.get(n);return!i||i._tag!==`Queue`?V:IS(i.queue,e.values).pipe(r?U(n=>n.length>0?V:t.onFromClient({message:{_tag:`Ack`,requestId:e.requestId},context:i.context})):D,$y(e=>RS(i.queue,e)))}case`Exit`:{let t=e.requestId,n=c.get(t);return n?(c.delete(t),n._tag===`Effect`?(n.resume(e.exit),V):e.exit._tag===`Success`?BS(n.queue):RS(n.queue,e.exit.cause)):V}case`Defect`:return u(Sg(e.defect));case`ClientEnd`:return V}},_;if(t.flatten){let t=new Map;_=function(n,r,i){let a=t.get(n);return a||(a=d(e.requests.get(n)),t.set(n,a)),a(r,i)}}else _={},e.requests.forEach(e=>{Fi(_,e._tag,d(e))});return{client:_,write:g}}),tG=0,nG=ox(function*(e,t){let n=tG++,{codecFor:r,run:i,send:a,supportsAck:o,supportsTransferables:s}=yield*aG,c=rG(r),l=aN(r(iP())),u=new Map,d=Ag(),f=e=>u.has(e)?(u.delete(e),a(n,{_tag:`Interrupt`,requestId:e})):V,{client:p,write:m}=yield*eG(e,{...t,supportsAck:o,onFromClient({message:t}){switch(t._tag){case`Request`:{let r=e.requests.get(t.tag),i=s?Gz():void 0,o=xx(),l={rpc:r,context:i?kc(o.context,Wz,i):o.context,schemas:c(r),discard:t.discard===!0};return u.set(t.id,l),l.schemas.encodePayload(t.payload).pipe(xb(l.context),nb,U(e=>Lg(d)?(u.delete(t.id),Fb):a(n,{...t,id:t.id,payload:e,headers:Object.entries(t.headers)},i&&i.readUnsafe())),jb(e=>eg(e)?V:B(()=>u.delete(t.id))))}case`Ack`:return u.get(t.requestId)?a(n,{_tag:`Ack`,requestId:t.requestId}):V;case`Interrupt`:return f(t.requestId);case`Eof`:return V}}});return yield*i(n,e=>{switch(e._tag){case`Chunk`:{let t=EB(e.requestId),n=u.get(t);if(!n||Wo(n.schemas.decodeChunk))return V;let r=n.schemas.decodeChunk.value;return zb(i=>i(r(e.values).pipe(xb(n.context),nb,U(e=>m({_tag:`Chunk`,clientId:0,requestId:t,values:e})))).pipe(jb(e=>m({_tag:`Exit`,clientId:0,requestId:t,exit:bg(e)}).pipe(qy(ag(e)?V:hb(sb(f(t)),Mg(d))))),eb(e=>!ag(e),()=>V)))}case`Exit`:{let t=EB(e.requestId),n=u.get(t);return n?(u.delete(t),n.discard&&e.exit._tag===`Success`?m({_tag:`Exit`,clientId:0,requestId:t,exit:wg}):(n.discard?n.schemas.decodeDiscardExit:n.schemas.decodeExit)(e.exit).pipe(xb(n.context),nb,_b({onSuccess:e=>m({_tag:`Exit`,clientId:0,requestId:t,exit:e}),onFailure:e=>m({_tag:`Exit`,clientId:0,requestId:t,exit:bg(e)})}))):V}case`Defect`:return u.clear(),m({_tag:`Defect`,clientId:0,defect:l(e.defect)});case`ClientProtocolError`:{let t=xg(e.error),n=e.requestIds===void 0?Array.from(u.keys()):e.requestIds.map(EB).filter(e=>u.has(e));for(let e of n)u.delete(e);return jy(n,e=>m({_tag:`Exit`,clientId:0,requestId:e,exit:t})).pipe(Rb)}default:return V}}).pipe($y(sx),Ib,Yb),yield*kb(()=>zg(d,void 0)),p}),rG=e=>{let t=new WeakMap;return n=>{let r=t.get(n);if(r!==void 0)return r;let i=dB(n.successSchema),a=Pc(n.annotations,bB),o=yB(n),s;return r={decodeChunk:ts(i,t=>tN(e(kN(t.success)),a)),encodePayload:sN(e(n.payloadSchema),a),decodeExit:tN(e(o),a),decodeDiscardExit:t=>(s??=tN(e(fP(SN,o.error,o.defect)),a))(t)},t.set(n,r),r}},iG=P(`effect/rpc/RpcClient/CurrentHeaders`,{defaultValue:()=>VE}),aG=class extends lc()(`effect/rpc/RpcClient/Protocol`){static make=QW},oG=e=>aG.make(ox(function*(t,n){let r=yield*Sz,i=yield*qW,a=yield*Sb(uG),o=new Map,s=yield*r.writer,c=i.makeUnsafe(),l=yield*cG(z(()=>s.write(c.encode(DB))),e),u=cb(e?.onPingTimeout??V,{log:!0,message:`RpcClient onPingTimeout hook failed`}),d,f=e=>{let r=jy(Array.from(n),n=>t(n,e));return e._tag!==`Defect`&&e._tag!==`ClientProtocolError`?r:(o.clear(),Rb(r))},p=e=>(d=e,f({_tag:`ClientProtocolError`,error:e})),m=e=>{try{let n=c.decode(e);if(n.length===0)return V;l.onFrame();let r=0;return My({while:()=>r<n.length,body:()=>{let e=n[r++];if(e._tag===`Pong`)return V;if(Object.hasOwn(e,`requestId`)){let n=e.requestId,r=o.get(n);if(r!==void 0)return e._tag===`Exit`&&o.delete(n),t(r,e)}return f(e)},step:hr})}catch(e){return f({_tag:`ClientProtocolError`,error:new TB({reason:new wB({message:`Error decoding message`,cause:e})})})}};yield*z(()=>{c=i.makeUnsafe(),l.reset();let e=!1;return Ry(function*(){let{pull:t}=yield*r.reader;for(d=void 0,e=!0,Go(a)&&(yield*a.value.onConnect);;){let e=yield*t;for(let t=0;t<e.length;t++)yield*m(e[t])}}).pipe(Eb,hb(l.timeout),qy(()=>e?u:V),qy(()=>H(new Fz({reason:new kz({cause:Error(`ping timeout`)})}))))}).pipe(Go(a)?Ab(a.value.onDisconnect):D,ib(t=>{let n=rg(t),r=ds(n),i=new TB({reason:r?n.success.reason:new wB({message:`Unknown socket error`,cause:ng(t)})});return e?.retryTransientErrors&&r&&n.success.reason._tag===`SocketOpenError`?(e.onTransientError?.(i)??V).pipe(cb({log:!0,message:`RpcClient onTransientError hook failed`})):p(i)}),ob(e?.retryPolicy??sG,e=>p(new TB({reason:e.reason}))),lx({module:`RpcClient`,method:`makeProtocolSocket`}),Yb);let h=e=>z(()=>{let t=c.encode(e);return t===void 0?V:nb(s.write(t))});return{send(e,t){return d?H(d):(t._tag===`Interrupt`&&o.delete(t.requestId),t._tag===`Request`?(o.set(t.id,e),jb(h(t),()=>B(()=>o.delete(t.id)))):h(t))},supportsAck:!0,supportsTransferables:!1,codecFor:i.codecFor}})),sG=iy([oy(500,1.5),ly(5e3)]),cG=ox(function*(e,t){let n=yield*hg,r=t?.pingInterval??`5 seconds`,i=Al(t?.pingTimeout??r),a=n.currentTimeMillisUnsafe(),o=!1,s=Nx(),c=()=>{a=n.currentTimeMillisUnsafe(),o=!1};return yield*z(()=>o&&n.currentTimeMillisUnsafe()-a>i?s.open:(o=!0,e)).pipe(fb(r),sb,Bb,Ib,Yb),{timeout:s.await,reset:()=>{c(),s.closeUnsafe()},onFrame:c}}),lG=e=>v_(aG)(oG(e)),uG=class extends lc()(`effect/rpc/RpcClient/ConnectionHooks`){},dG=t((e=>{var t=r().__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;e.c=function(e){return t.H.useMemoCache(e)}})),fG=t(((e,t)=>{t.exports=dG()})),pG=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function mG(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:pG(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var hG=e=>{let t=``,n=!1;for(let r of e)r===`-`||r===`_`||r<=` `?n=t.length>0:(t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1);return t},gG=e=>{let t=hG(e);return t.charAt(0).toUpperCase()+t.slice(1)},_G=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),vG={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function yG(e){return e!=null}function bG(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??vG.width,a=e.size??e.height??vG.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?_G(...c):_G(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??vG[`stroke-width`])*Number(e.size??e.width??vG.width)/Number(t.size??t.width??vG.width):t.strokeWidth??vG[`stroke-width`];return[`svg`,{...Object.entries(vG).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&yG(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&yG(t.width)&&{[r(`width`)]:t.width},...`height`in t&&yG(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function xG(e,t={}){return bG(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var SG=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},CG=(0,pT.createContext)({}),wG=()=>(0,pT.useContext)(CG),TG=(0,pT.forwardRef)(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:u={node:l,aliases:[],size:24},...d},f)=>{let{size:p=24,strokeWidth:m=2,absoluteStrokeWidth:h=!1,nonScalingStroke:g=!1,color:_=`currentColor`,className:v=``}=wG()??{},y=!!c||SG(d),[b,ee,x=[]]=xG(u,{color:e??_,width:n??t??p,height:r??t??p,strokeWidth:i??m,absoluteStrokeWidth:a??h,nonScalingStroke:o??g,className:_G(v,s),hasA11yProp:y,attributes:d});return(0,pT.createElement)(b,{ref:f,...ee},[...x.map(([e,t])=>(0,pT.createElement)(e,t)),...Array.isArray(c)?c:[c]])});function EG(e,t=[],n=[]){let r=typeof e==`string`?mG(e,t,n):e,i=(0,pT.forwardRef)(({className:e,...t},n)=>(0,pT.createElement)(TG,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=gG(r.name)),i}var DG={name:`octagon-alert`,size:24,node:[[`path`,{d:`M12 16h.01`,key:`1drbdi`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z`,key:`1fd625`}]],aliases:[`alert-octagon`]};DG.node;var OG=EG(DG),kG=fG();function AG(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=AG(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function jG(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=AG(e))&&(r&&(r+=` `),r+=t);return r}var MG=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,NG=jG,PG=(e,t)=>n=>{if(t?.variants==null)return NG(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=MG(t)||MG(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return NG(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},FG=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},IG=(e,t)=>({classGroupId:e,validator:t}),LG=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),RG=`-`,zG=[],BG=`arbitrary..`,VG=e=>{let t=WG(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return UG(e);let n=e.split(RG);return HG(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?FG(i,t):t:i||zG}return n[e]||zG}}},HG=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=HG(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(RG):e.slice(t).join(RG),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},UG=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?BG+r:void 0})(),WG=e=>{let{theme:t,classGroups:n}=e;return GG(n,t)},GG=(e,t)=>{let n=LG();for(let r in e){let i=e[r];KG(i,n,r,t)}return n},KG=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];qG(i,t,n,r)}},qG=(e,t,n,r)=>{typeof e==`string`?JG(e,t,n):typeof e==`function`?YG(e,t,n,r):XG(e,t,n,r)},JG=(e,t,n)=>{let r=e===``?t:ZG(t,e);r.classGroupId=n},YG=(e,t,n,r)=>{QG(e)?KG(e(r),t,n,r):(t.validators===null&&(t.validators=[]),t.validators.push(IG(n,e)))},XG=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];KG(o,ZG(t,a),n,r)}},ZG=(e,t)=>{let n=e,r=t.split(RG),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=LG(),n.nextPart.set(t,i)),n=i}return n},QG=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,$G=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},eK=`!`,tK=`:`,nK=[],rK=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),iK=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===tK){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(eK)?(c=s.slice(0,-1),l=!0):s.startsWith(eK)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return rK(t,l,c,u)};if(t){let e=t+tK,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):rK(nK,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},aK=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},oK=e=>({cache:$G(e.cacheSize),parseClassName:iK(e),sortModifiers:aK(e),postfixLookupClassGroupIds:sK(e),...VG(e)}),sK=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},cK=/\s+/,lK=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(cK),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h||(g=r(p),!g)){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+eK:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},uK=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=dK(n))&&(i&&(i+=` `),i+=r);return i},dK=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=dK(e[r]))&&(n&&(n+=` `),n+=t);return n},fK=(e,...t)=>{let n,r,i,a,o=o=>(n=oK(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=lK(e,n);return i(e,a),a};return a=o,(...e)=>a(uK(...e))},pK=[],mK=e=>{let t=t=>t[e]||pK;return t.isThemeGetter=!0,t.themeKey=e,t},hK=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,gK=/^\((?:(\w[\w-]*):)?(.+)\)$/i,_K=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,vK=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,yK=/\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$/,bK=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,xK=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,SK=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,CK=e=>_K.test(e),Z=e=>!!e&&!Number.isNaN(Number(e)),wK=e=>!!e&&Number.isInteger(Number(e)),TK=e=>e.endsWith(`%`)&&Z(e.slice(0,-1)),EK=e=>vK.test(e),DK=()=>!0,OK=e=>yK.test(e)&&!bK.test(e),kK=()=>!1,AK=e=>xK.test(e),jK=e=>SK.test(e),MK=e=>!Q(e)&&!$(e),NK=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),PK=e=>YK(e,$K,kK),Q=e=>hK.test(e),FK=e=>YK(e,eq,OK),IK=e=>YK(e,tq,Z),LK=e=>YK(e,rq,DK),RK=e=>YK(e,nq,kK),zK=e=>YK(e,ZK,kK),BK=e=>YK(e,QK,jK),VK=e=>YK(e,iq,AK),$=e=>gK.test(e),HK=e=>XK(e,eq),UK=e=>XK(e,nq),WK=e=>XK(e,ZK),GK=e=>XK(e,$K),KK=e=>XK(e,QK),qK=e=>XK(e,iq,!0),JK=e=>XK(e,rq,!0),YK=(e,t,n)=>{let r=hK.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},XK=(e,t,n=!1)=>{let r=gK.exec(e);return r?r[1]?t(r[1]):n:!1},ZK=e=>e===`position`||e===`percentage`,QK=e=>e===`image`||e===`url`,$K=e=>e===`length`||e===`size`||e===`bg-size`,eq=e=>e===`length`,tq=e=>e===`number`,nq=e=>e===`family-name`,rq=e=>e===`number`||e===`weight`,iq=e=>e===`shadow`,aq=fK(()=>{let e=mK(`color`),t=mK(`font`),n=mK(`text`),r=mK(`font-weight`),i=mK(`tracking`),a=mK(`leading`),o=mK(`breakpoint`),s=mK(`container`),c=mK(`spacing`),l=mK(`radius`),u=mK(`shadow`),d=mK(`inset-shadow`),f=mK(`text-shadow`),p=mK(`drop-shadow`),m=mK(`blur`),h=mK(`perspective`),g=mK(`aspect`),_=mK(`ease`),v=mK(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],ee=()=>[...b(),$,Q],x=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],te=()=>[`auto`,`contain`,`none`],S=()=>[$,Q,c],C=()=>[CK,`full`,`auto`,...S()],ne=()=>[wK,`none`,`subgrid`,$,Q],re=()=>[`auto`,{span:[`full`,wK,$,Q]},wK,$,Q],ie=()=>[wK,`auto`,$,Q],ae=()=>[`auto`,`min`,`max`,`fr`,$,Q],oe=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],se=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],ce=()=>[`auto`,...S()],le=()=>[CK,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...S()],ue=()=>[s,CK,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...S()],de=()=>[CK,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...S()],w=()=>[e,$,Q],fe=()=>[...b(),WK,zK,{position:[$,Q]}],pe=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],me=()=>[`auto`,`cover`,`contain`,GK,PK,{size:[$,Q]}],he=()=>[TK,HK,FK],ge=()=>[``,`none`,`full`,l,$,Q],_e=()=>[``,Z,HK,FK],ve=()=>[`solid`,`dashed`,`dotted`,`double`],ye=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],be=()=>[Z,TK,WK,zK],xe=()=>[``,`none`,m,$,Q],Se=()=>[`none`,Z,$,Q],Ce=()=>[`none`,Z,$,Q],we=()=>[Z,$,Q],Te=()=>[CK,`full`,...S()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[EK],breakpoint:[EK],color:[DK],container:[EK],"drop-shadow":[EK],ease:[`in`,`out`,`in-out`],font:[MK],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[EK],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[EK],shadow:[EK],spacing:[`px`,Z],text:[EK],"text-shadow":[EK],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,CK,Q,$,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,$,Q]}],"container-named":[NK],columns:[{columns:[Z,`auto`,Q,$,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"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:ee()}],overflow:[{overflow:x()}],"overflow-x":[{"overflow-x":x()}],"overflow-y":[{"overflow-y":x()}],overscroll:[{overscroll:te()}],"overscroll-x":[{"overscroll-x":te()}],"overscroll-y":[{"overscroll-y":te()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:C()}],"inset-x":[{"inset-x":C()}],"inset-y":[{"inset-y":C()}],start:[{"inset-s":C(),start:C()}],end:[{"inset-e":C(),end:C()}],"inset-bs":[{"inset-bs":C()}],"inset-be":[{"inset-be":C()}],top:[{top:C()}],right:[{right:C()}],bottom:[{bottom:C()}],left:[{left:C()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[wK,`auto`,$,Q]}],basis:[{basis:[CK,`full`,`auto`,s,...S()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[Z,CK,`auto`,`initial`,`none`,Q]}],grow:[{grow:[``,Z,$,Q]}],shrink:[{shrink:[``,Z,$,Q]}],order:[{order:[wK,`first`,`last`,`none`,$,Q]}],"grid-cols":[{"grid-cols":ne()}],"col-start-end":[{col:re()}],"col-start":[{"col-start":ie()}],"col-end":[{"col-end":ie()}],"grid-rows":[{"grid-rows":ne()}],"row-start-end":[{row:re()}],"row-start":[{"row-start":ie()}],"row-end":[{"row-end":ie()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":ae()}],"auto-rows":[{"auto-rows":ae()}],gap:[{gap:S()}],"gap-x":[{"gap-x":S()}],"gap-y":[{"gap-y":S()}],"justify-content":[{justify:[...oe(),`normal`]}],"justify-items":[{"justify-items":[...se(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...se()]}],"align-content":[{content:[`normal`,...oe()]}],"align-items":[{items:[...se(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...se(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":oe()}],"place-items":[{"place-items":[...se(),`baseline`]}],"place-self":[{"place-self":[`auto`,...se()]}],p:[{p:S()}],px:[{px:S()}],py:[{py:S()}],ps:[{ps:S()}],pe:[{pe:S()}],pbs:[{pbs:S()}],pbe:[{pbe:S()}],pt:[{pt:S()}],pr:[{pr:S()}],pb:[{pb:S()}],pl:[{pl:S()}],m:[{m:ce()}],mx:[{mx:ce()}],my:[{my:ce()}],ms:[{ms:ce()}],me:[{me:ce()}],mbs:[{mbs:ce()}],mbe:[{mbe:ce()}],mt:[{mt:ce()}],mr:[{mr:ce()}],mb:[{mb:ce()}],ml:[{ml:ce()}],"space-x":[{"space-x":S()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":S()}],"space-y-reverse":[`space-y-reverse`],size:[{size:le()}],"inline-size":[{inline:[`auto`,...ue()]}],"min-inline-size":[{"min-inline":[`auto`,...ue()]}],"max-inline-size":[{"max-inline":[`none`,...ue()]}],"block-size":[{block:[`auto`,...de()]}],"min-block-size":[{"min-block":[`auto`,...de()]}],"max-block-size":[{"max-block":[`none`,...de()]}],w:[{w:[s,`screen`,...le()]}],"min-w":[{"min-w":[s,`screen`,`none`,...le()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...le()]}],h:[{h:[`screen`,`lh`,...le()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...le()]}],"max-h":[{"max-h":[`screen`,`lh`,`none`,...le()]}],"font-size":[{text:[`base`,n,HK,FK]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,JK,LK]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,TK,Q]}],"font-family":[{font:[UK,RK,t]}],"font-features":[{"font-features":[Q]}],"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,$,Q]}],"line-clamp":[{"line-clamp":[Z,`none`,$,IK]}],leading:[{leading:[`none`,a,...S()]}],"list-image":[{"list-image":[`none`,$,Q]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,$,Q]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:w()}],"text-color":[{text:w()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...ve(),`wavy`]}],"text-decoration-thickness":[{decoration:[Z,`from-font`,`auto`,$,FK]}],"text-decoration-color":[{decoration:w()}],"underline-offset":[{"underline-offset":[Z,`auto`,$,Q]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:S()}],"tab-size":[{tab:[wK,$,Q]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,$,Q]}],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`,$,Q]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:fe()}],"bg-repeat":[{bg:pe()}],"bg-size":[{bg:me()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},wK,$,Q],radial:[``,$,Q],conic:[``,wK,$,Q]},KK,BK]}],"bg-color":[{bg:w()}],"gradient-from-pos":[{from:he()}],"gradient-via-pos":[{via:he()}],"gradient-to-pos":[{to:he()}],"gradient-from":[{from:w()}],"gradient-via":[{via:w()}],"gradient-to":[{to:w()}],rounded:[{rounded:ge()}],"rounded-s":[{"rounded-s":ge()}],"rounded-e":[{"rounded-e":ge()}],"rounded-t":[{"rounded-t":ge()}],"rounded-r":[{"rounded-r":ge()}],"rounded-b":[{"rounded-b":ge()}],"rounded-l":[{"rounded-l":ge()}],"rounded-ss":[{"rounded-ss":ge()}],"rounded-se":[{"rounded-se":ge()}],"rounded-ee":[{"rounded-ee":ge()}],"rounded-es":[{"rounded-es":ge()}],"rounded-tl":[{"rounded-tl":ge()}],"rounded-tr":[{"rounded-tr":ge()}],"rounded-br":[{"rounded-br":ge()}],"rounded-bl":[{"rounded-bl":ge()}],"border-w":[{border:_e()}],"border-w-x":[{"border-x":_e()}],"border-w-y":[{"border-y":_e()}],"border-w-s":[{"border-s":_e()}],"border-w-e":[{"border-e":_e()}],"border-w-bs":[{"border-bs":_e()}],"border-w-be":[{"border-be":_e()}],"border-w-t":[{"border-t":_e()}],"border-w-r":[{"border-r":_e()}],"border-w-b":[{"border-b":_e()}],"border-w-l":[{"border-l":_e()}],"divide-x":[{"divide-x":_e()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":_e()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...ve(),`hidden`,`none`]}],"divide-style":[{divide:[...ve(),`hidden`,`none`]}],"border-color":[{border:w()}],"border-color-x":[{"border-x":w()}],"border-color-y":[{"border-y":w()}],"border-color-s":[{"border-s":w()}],"border-color-e":[{"border-e":w()}],"border-color-bs":[{"border-bs":w()}],"border-color-be":[{"border-be":w()}],"border-color-t":[{"border-t":w()}],"border-color-r":[{"border-r":w()}],"border-color-b":[{"border-b":w()}],"border-color-l":[{"border-l":w()}],"divide-color":[{divide:w()}],"outline-style":[{outline:[...ve(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[Z,$,Q]}],"outline-w":[{outline:[``,Z,HK,FK]}],"outline-color":[{outline:w()}],shadow:[{shadow:[``,`inner`,`none`,u,qK,VK]}],"shadow-color":[{shadow:w()}],"inset-shadow":[{"inset-shadow":[`none`,d,qK,VK]}],"inset-shadow-color":[{"inset-shadow":w()}],"ring-w":[{ring:_e()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:w()}],"ring-offset-w":[{"ring-offset":[Z,FK]}],"ring-offset-color":[{"ring-offset":w()}],"inset-ring-w":[{"inset-ring":_e()}],"inset-ring-color":[{"inset-ring":w()}],"text-shadow":[{"text-shadow":[`none`,f,qK,VK]}],"text-shadow-color":[{"text-shadow":w()}],opacity:[{opacity:[Z,$,Q]}],"mix-blend":[{"mix-blend":[...ye(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":ye()}],"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":[Z]}],"mask-image-linear-from-pos":[{"mask-linear-from":be()}],"mask-image-linear-to-pos":[{"mask-linear-to":be()}],"mask-image-linear-from-color":[{"mask-linear-from":w()}],"mask-image-linear-to-color":[{"mask-linear-to":w()}],"mask-image-t-from-pos":[{"mask-t-from":be()}],"mask-image-t-to-pos":[{"mask-t-to":be()}],"mask-image-t-from-color":[{"mask-t-from":w()}],"mask-image-t-to-color":[{"mask-t-to":w()}],"mask-image-r-from-pos":[{"mask-r-from":be()}],"mask-image-r-to-pos":[{"mask-r-to":be()}],"mask-image-r-from-color":[{"mask-r-from":w()}],"mask-image-r-to-color":[{"mask-r-to":w()}],"mask-image-b-from-pos":[{"mask-b-from":be()}],"mask-image-b-to-pos":[{"mask-b-to":be()}],"mask-image-b-from-color":[{"mask-b-from":w()}],"mask-image-b-to-color":[{"mask-b-to":w()}],"mask-image-l-from-pos":[{"mask-l-from":be()}],"mask-image-l-to-pos":[{"mask-l-to":be()}],"mask-image-l-from-color":[{"mask-l-from":w()}],"mask-image-l-to-color":[{"mask-l-to":w()}],"mask-image-x-from-pos":[{"mask-x-from":be()}],"mask-image-x-to-pos":[{"mask-x-to":be()}],"mask-image-x-from-color":[{"mask-x-from":w()}],"mask-image-x-to-color":[{"mask-x-to":w()}],"mask-image-y-from-pos":[{"mask-y-from":be()}],"mask-image-y-to-pos":[{"mask-y-to":be()}],"mask-image-y-from-color":[{"mask-y-from":w()}],"mask-image-y-to-color":[{"mask-y-to":w()}],"mask-image-radial":[{"mask-radial":[$,Q]}],"mask-image-radial-from-pos":[{"mask-radial-from":be()}],"mask-image-radial-to-pos":[{"mask-radial-to":be()}],"mask-image-radial-from-color":[{"mask-radial-from":w()}],"mask-image-radial-to-color":[{"mask-radial-to":w()}],"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":b()}],"mask-image-conic-pos":[{"mask-conic":[Z]}],"mask-image-conic-from-pos":[{"mask-conic-from":be()}],"mask-image-conic-to-pos":[{"mask-conic-to":be()}],"mask-image-conic-from-color":[{"mask-conic-from":w()}],"mask-image-conic-to-color":[{"mask-conic-to":w()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:fe()}],"mask-repeat":[{mask:pe()}],"mask-size":[{mask:me()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,$,Q]}],filter:[{filter:[``,`none`,$,Q]}],blur:[{blur:xe()}],brightness:[{brightness:[Z,$,Q]}],contrast:[{contrast:[Z,$,Q]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,qK,VK]}],"drop-shadow-color":[{"drop-shadow":w()}],grayscale:[{grayscale:[``,Z,$,Q]}],"hue-rotate":[{"hue-rotate":[Z,$,Q]}],invert:[{invert:[``,Z,$,Q]}],saturate:[{saturate:[Z,$,Q]}],sepia:[{sepia:[``,Z,$,Q]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,$,Q]}],"backdrop-blur":[{"backdrop-blur":xe()}],"backdrop-brightness":[{"backdrop-brightness":[Z,$,Q]}],"backdrop-contrast":[{"backdrop-contrast":[Z,$,Q]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,Z,$,Q]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Z,$,Q]}],"backdrop-invert":[{"backdrop-invert":[``,Z,$,Q]}],"backdrop-opacity":[{"backdrop-opacity":[Z,$,Q]}],"backdrop-saturate":[{"backdrop-saturate":[Z,$,Q]}],"backdrop-sepia":[{"backdrop-sepia":[``,Z,$,Q]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":S()}],"border-spacing-x":[{"border-spacing-x":S()}],"border-spacing-y":[{"border-spacing-y":S()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,$,Q]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[Z,`initial`,$,Q]}],ease:[{ease:[`linear`,`initial`,_,$,Q]}],delay:[{delay:[Z,$,Q]}],animate:[{animate:[`none`,v,$,Q]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,$,Q]}],"perspective-origin":[{"perspective-origin":ee()}],rotate:[{rotate:Se()}],"rotate-x":[{"rotate-x":Se()}],"rotate-y":[{"rotate-y":Se()}],"rotate-z":[{"rotate-z":Se()}],scale:[{scale:Ce()}],"scale-x":[{"scale-x":Ce()}],"scale-y":[{"scale-y":Ce()}],"scale-z":[{"scale-z":Ce()}],"scale-3d":[`scale-3d`],skew:[{skew:we()}],"skew-x":[{"skew-x":we()}],"skew-y":[{"skew-y":we()}],transform:[{transform:[$,Q,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:ee()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:Te()}],"translate-x":[{"translate-x":Te()}],"translate-y":[{"translate-y":Te()}],"translate-z":[{"translate-z":Te()}],"translate-none":[`translate-none`],zoom:[{zoom:[wK,$,Q]}],accent:[{accent:w()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:w()}],"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`,$,Q]}],"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":w()}],"scrollbar-track-color":[{"scrollbar-track":w()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":S()}],"scroll-mx":[{"scroll-mx":S()}],"scroll-my":[{"scroll-my":S()}],"scroll-ms":[{"scroll-ms":S()}],"scroll-me":[{"scroll-me":S()}],"scroll-mbs":[{"scroll-mbs":S()}],"scroll-mbe":[{"scroll-mbe":S()}],"scroll-mt":[{"scroll-mt":S()}],"scroll-mr":[{"scroll-mr":S()}],"scroll-mb":[{"scroll-mb":S()}],"scroll-ml":[{"scroll-ml":S()}],"scroll-p":[{"scroll-p":S()}],"scroll-px":[{"scroll-px":S()}],"scroll-py":[{"scroll-py":S()}],"scroll-ps":[{"scroll-ps":S()}],"scroll-pe":[{"scroll-pe":S()}],"scroll-pbs":[{"scroll-pbs":S()}],"scroll-pbe":[{"scroll-pbe":S()}],"scroll-pt":[{"scroll-pt":S()}],"scroll-pr":[{"scroll-pr":S()}],"scroll-pb":[{"scroll-pb":S()}],"scroll-pl":[{"scroll-pl":S()}],"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`,$,Q]}],fill:[{fill:[`none`,...w()]}],"stroke-w":[{stroke:[Z,HK,FK,IK]}],stroke:[{stroke:[`none`,...w()]}],"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`]}});function oq(...e){return aq(jG(e))}var sq=gr(hF(),_F(Hr,e=>Nv(e.message)||e.message===`Error`?e.name:e.message),_F(Hh,e=>gr(e,cg,Xs(e=>oc(Pv(e.message),{onFalse:()=>e.name,onTrue:()=>e.message})),ic(`
|
|
18
|
+
`))),_F(O(`message`),e=>Dv(e.message)),_F(Dr,e=>Dv(e)),_F(Pr,()=>`Error`),_F(Rr,e=>cN(oP(gN))(e)),bF(()=>`Unknown Error`)),cq=Fn(),lq=PG(`group/alert relative grid w-full gap-0.5 rounded-lg border px-2 py-1.5 text-left text-xs/relaxed has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-1.5 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-3.5`,{variants:{variant:{default:`bg-card text-card-foreground`,destructive:`bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current`}},defaultVariants:{variant:`default`}});function uq(e){let t=(0,kG.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,variant:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]!==n||t[5]!==i?(a=oq(lq({variant:i}),n),t[4]=n,t[5]=i,t[6]=a):a=t[6];let o;return t[7]!==r||t[8]!==a?(o=(0,cq.jsx)(`div`,{"data-slot":`alert`,role:`alert`,className:a,...r}),t[7]=r,t[8]=a,t[9]=o):o=t[9],o}function dq(e){let t=(0,kG.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=oq(`font-medium group-has-[>svg]/alert:col-start-2 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,cq.jsx)(`div`,{"data-slot":`alert-title`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function fq(e){let t=(0,kG.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=oq(`text-xs/relaxed text-balance text-muted-foreground md:text-pretty [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,cq.jsx)(`div`,{"data-slot":`alert-description`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function pq(){return typeof window<`u`}function mq(e){return _q(e)?(e.nodeName||``).toLowerCase():`#document`}function hq(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function gq(e){return((_q(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function _q(e){return pq()?e instanceof Node||e instanceof hq(e).Node:!1}function vq(e){return pq()?e instanceof Element||e instanceof hq(e).Element:!1}function yq(e){return pq()?e instanceof HTMLElement||e instanceof hq(e).HTMLElement:!1}function bq(e){return!pq()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof hq(e).ShadowRoot}function xq(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Mq(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Sq(e){return/^(table|td|th)$/.test(mq(e))}function Cq(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var wq=/transform|translate|scale|rotate|perspective|filter/,Tq=/paint|layout|strict|content/,Eq=e=>!!e&&e!==`none`,Dq;function Oq(e){let t=vq(e)?Mq(e):e;return Eq(t.transform)||Eq(t.translate)||Eq(t.scale)||Eq(t.rotate)||Eq(t.perspective)||!Aq()&&(Eq(t.backdropFilter)||Eq(t.filter))||wq.test(t.willChange||``)||Tq.test(t.contain||``)}function kq(e){let t=Pq(e);for(;yq(t)&&!jq(t);){if(Oq(t))return t;if(Cq(t))return null;t=Pq(t)}return null}function Aq(){return Dq??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Dq}function jq(e){return/^(html|body|#document)$/.test(mq(e))}function Mq(e){return hq(e).getComputedStyle(e)}function Nq(e){return vq(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Pq(e){if(mq(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||bq(e)&&e.host||gq(e);return bq(t)?t.host:t}function Fq(e){let t=Pq(e);return jq(t)?(e.ownerDocument||e).body:yq(t)&&xq(t)?t:Fq(t)}function Iq(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Fq(e),i=r===e.ownerDocument?.body,a=hq(r);if(i){let e=Lq(a);return t.concat(a,a.visualViewport||[],xq(r)?r:[],e&&n?Iq(e):[])}return t.concat(r,Iq(r,[],n))}function Lq(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var Rq={...pT},zq={};function Bq(e,t){let n=pT.useRef(zq);return n.current===zq&&(n.current=e(t)),n}var Vq=Rq.useInsertionEffect,Hq=Vq&&Vq!==Rq.useLayoutEffect?Vq:e=>e();function Uq(e){let t=Bq(Wq).current;return t.next=e,Hq(t.effect),t.trampoline}function Wq(){let e={next:void 0,callback:Gq,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function Gq(){}var Kq=typeof document<`u`?pT.useLayoutEffect:()=>{};function qq(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}var Jq={};function Yq(e,t,n,r,i){if(!n&&!r&&!i&&!e)return Zq(t);let a=Zq(e);return t&&(a=Qq(a,t)),n&&(a=Qq(a,n)),r&&(a=Qq(a,r)),i&&(a=Qq(a,i)),a}function Xq(e){if(e.length===0)return Jq;if(e.length===1)return Zq(e[0]);let t=Zq(e[0]);for(let n=1;n<e.length;n+=1)t=Qq(t,e[n]);return t}function Zq(e){return nJ(e)?{...e(Jq)}:$q(e)}function Qq(e,t){return nJ(t)?t(e):eJ(e,t)}function $q(e){let t={...e};for(let e in t){let n=t[e];tJ(e,n)&&(t[e]=iJ(n))}return t}function eJ(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=qq(e.style,r);break;case`className`:e[n]=oJ(e.className,r);break;default:e[n]=tJ(n,r)?rJ(e[n],r):r}}return e}function tJ(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function nJ(e){return typeof e==`function`}function rJ(e,t){return t?e?(...n)=>{let r=n[0];if(sJ(r)){let i=r;aJ(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:iJ(t):e}function iJ(e){return e&&((...t)=>{let n=t[0];return sJ(n)&&aJ(n),e(...t)})}function aJ(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function oJ(e,t){return t?e?t+` `+e:t:e}function sJ(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function cJ(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var lJ=cJ(`https://base-ui.com/production-error`,`Base UI`),uJ=pT.createContext(void 0);function dJ(e=!1){let t=pT.useContext(uJ);if(t===void 0&&!e)throw Error(lJ(16));return t}function fJ(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:pT.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function pJ(e,t,{detail:n=0,pointerType:r=``}={}){e.dispatchEvent(new(hq(e)).PointerEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:n,pointerType:r,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function mJ(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=pT.useRef(null),s=dJ(!0),c=a??s!==void 0,{props:l}=fJ({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i}),u=pT.useCallback(()=>{let e=o.current;hJ(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return Kq(u,[u]),{getButtonProps:pT.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...u}=e;return Yq({onClick(e){t?e.preventDefault():n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(aJ(e),o?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,r=e.currentTarget,a=hJ(r),s=!i&&gJ(r),l=n&&(i?a:!s),u=e.key===`Enter`,d=e.key===` `,f=r.getAttribute(`role`),p=f?.startsWith(`menuitem`)||f===`option`||f===`gridcell`;if(n&&c&&d){if(e.defaultPrevented&&p)return;e.preventDefault(),(!i||a)&&(e.preventBaseUIHandler(),pJ(r,e))}else!l||i||!d&&!u?n&&s&&d&&e.preventDefault():e.defaultPrevented||(e.preventDefault(),u&&(e.preventBaseUIHandler(),pJ(r,e)))},onKeyUp(e){t||(aJ(e),a?.(e),e.target===e.currentTarget&&i&&c&&hJ(e.currentTarget)&&e.key===` `?e.preventDefault():e.baseUIHandlerPrevented||e.target!==e.currentTarget||i||c||e.defaultPrevented||e.key!==` `||(e.preventBaseUIHandler(),pJ(e.currentTarget,e)))},onPointerDown(e){t?e.preventDefault():s?.(e)}},i?{type:`button`}:{role:`button`},l,u)},[t,l,c,i]),buttonRef:Uq(e=>{o.current=e,u()})}}function hJ(e){return yq(e)&&e.tagName===`BUTTON`}function gJ(e){return yq(e)&&e.tagName===`A`&&!!e.href}function _J(e,t,n,r){let i=Bq(yJ).current;return bJ(i,e,t,n,r)&&SJ(i,[e,t,n,r]),i.callback}function vJ(e){let t=Bq(yJ).current;return xJ(t,e)&&SJ(t,e),t.callback}function yJ(){return{callback:null,cleanup:null,refs:[]}}function bJ(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function xJ(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function SJ(e,t){e.refs=t,e.callback=t.every(e=>e==null)?null:n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null}}}}}}var CJ=19;function wJ(e){return CJ>=e}function TJ(e){if(!pT.isValidElement(e))return null;let t=e,n=t.props;return(wJ(19)?n?.ref:t.ref)??null}function EJ(){}var DJ=Object.freeze([]),OJ=Object.freeze({});function kJ(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e)}else i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function AJ(e,t){return typeof e==`function`?e(t):e}function jJ(e,t){return typeof e==`function`?e(t):e}function MJ(e,t,n={}){let r=t.render;n.enabled!==!1&&(r=IJ(r));let i=NJ(t,n,r);if(n.enabled===!1)return null;let a=n.state??OJ;return LJ(e,r,i,a)}function NJ(e,t,n){let{className:r,style:i}=e,{state:a=OJ,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?AJ(r,a):void 0,d=l?jJ(i,a):void 0,f=l?kJ(a,c):OJ,p=l&&s?PJ(s):void 0,m=l?qq(f,p)??{}:OJ;return typeof document<`u`&&(l?m.ref=Array.isArray(o)?vJ([m.ref,TJ(n),...o]):_J(m.ref,TJ(n),o):_J(null,null)),l?(u!==void 0&&(m.className=oJ(m.className,u)),d!==void 0&&(m.style=qq(m.style,d)),m):OJ}function PJ(e){return Array.isArray(e)?Xq(e):Yq(void 0,e)}var FJ=Symbol.for(`react.lazy`);function IJ(e){if(e?.$$typeof!==FJ)return e;let t=pT.Children.toArray(e)[0];return pT.isValidElement(t)?t:e}function LJ(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=Yq(n,t.props);return e.ref=n.ref,pT.cloneElement(t,e)}return RJ(e,n)}function RJ(e,t){return e===`button`?(0,pT.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,pT.createElement)(`img`,{alt:``,...t,key:t.key}):pT.createElement(e,t)}var zJ=pT.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,focusableWhenDisabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{getButtonProps:l,buttonRef:u}=mJ({disabled:i,focusableWhenDisabled:a,native:o});return MJ(`button`,e,{state:{disabled:i},ref:[t,u],props:[c,l]})}),BJ=PG(`group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-xs/relaxed font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/80`,outline:`border-border hover:bg-input/50 hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:bg-input/30`,secondary:`bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-7 gap-1 px-2 text-xs/relaxed has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,xs:`h-5 gap-1 rounded-sm px-2 text-[0.625rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-2.5`,sm:`h-6 gap-1 px-2 text-xs/relaxed has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,lg:`h-8 gap-1 px-2.5 text-xs/relaxed has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 [&_svg:not([class*='size-'])]:size-4`,icon:`size-7 [&_svg:not([class*='size-'])]:size-3.5`,"icon-xs":`size-5 rounded-sm [&_svg:not([class*='size-'])]:size-2.5`,"icon-sm":`size-6 [&_svg:not([class*='size-'])]:size-3`,"icon-lg":`size-8 [&_svg:not([class*='size-'])]:size-4`}},defaultVariants:{variant:`default`,size:`default`}});function VJ(e){let t=(0,kG.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,variant:i,size:a,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=i===void 0?`default`:i,s=a===void 0?`default`:a,c;t[5]!==n||t[6]!==s||t[7]!==o?(c=oq(BJ({variant:o,size:s,className:n})),t[5]=n,t[6]=s,t[7]=o,t[8]=c):c=t[8];let l;return t[9]!==r||t[10]!==c?(l=(0,cq.jsx)(zJ,{"data-slot":`button`,className:c,...r}),t[9]=r,t[10]=c,t[11]=l):l=t[11],l}function HJ(e){let t=(0,kG.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=oq(`flex w-full min-w-0 flex-1 flex-col items-center justify-center gap-4 rounded-xl border-dashed p-6 text-center text-balance`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,cq.jsx)(`div`,{"data-slot":`empty`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function UJ(e){let t=(0,kG.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=oq(`flex max-w-sm flex-col items-center gap-1`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,cq.jsx)(`div`,{"data-slot":`empty-header`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function WJ(e){let t=(0,kG.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=oq(`text-sm font-medium tracking-tight`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,cq.jsx)(`div`,{"data-slot":`empty-title`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function GJ(e){let t=(0,kG.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=oq(`flex w-full max-w-sm min-w-0 flex-col items-center gap-2 text-xs/relaxed text-balance`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,cq.jsx)(`div`,{"data-slot":`empty-content`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function KJ(){let e=(0,kG.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,cq.jsx)(UJ,{children:(0,cq.jsx)(WJ,{children:`Page not found`})}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,cq.jsxs)(HJ,{children:[t,(0,cq.jsx)(GJ,{children:(0,cq.jsx)(`a`,{className:BJ({variant:`outline`}),href:`/`,children:`Go home`})})]}),e[1]=n):n=e[1],n}function qJ(e){let t=(0,kG.c)(16),n;t[0]===e.error?n=t[1]:(n=sq(e.error),t[0]=e.error,t[1]=n);let r=n,i,a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,cq.jsx)(OG,{}),a=(0,cq.jsx)(dq,{children:`Something went wrong`}),t[2]=i,t[3]=a):(i=t[2],a=t[3]);let o;t[4]===r?o=t[5]:(o=(0,cq.jsxs)(uq,{variant:`destructive`,className:`w-full max-w-lg select-text`,children:[i,a,(0,cq.jsx)(fq,{className:`wrap-break-word whitespace-pre-wrap`,children:r})]}),t[4]=r,t[5]=o);let s;t[6]===r?s=t[7]:(s=(0,cq.jsx)(VJ,{variant:`ghost`,onClick:async()=>{await navigator.clipboard.writeText(r)},children:`Copy error`}),t[6]=r,t[7]=s);let c;t[8]===e.reset?c=t[9]:(c=(0,cq.jsx)(VJ,{onClick:e.reset,children:`Try again`}),t[8]=e.reset,t[9]=c);let l;t[10]!==s||t[11]!==c?(l=(0,cq.jsxs)(`div`,{className:`flex gap-2`,children:[s,c]}),t[10]=s,t[11]=c,t[12]=l):l=t[12];let u;return t[13]!==o||t[14]!==l?(u=(0,cq.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-4 p-4`,children:[o,l]}),t[13]=o,t[14]=l,t[15]=u):u=t[15],u}var JJ=class extends wP()(`AuthError`,{cause:fN(iP()),error:dN(NN([`invalid_request`,`invalid_client`,`invalid_client_metadata`,`invalid_redirect_uri`,`invalid_grant`,`invalid_target`,`invalid_scope`,`unsupported_grant_type`,`unsupported_response_type`,`access_denied`,`temporarily_unavailable`])),message:yN}){},YJ=wN({id:eP,name:eP}),XJ=yN.check(GN(/^https:\/\/[a-z\d-]+\.mp281x\.xyz(?:\/mcp)?$/u));wN({accessToken:eP,clientId:eP,expiresAt:KN,refreshToken:eP}),wN({client_id:eP}),wN({access_token:eP,expires_in:KN,refresh_token:eP});var ZJ=yN.check(WN(e=>{if(!URL.canParse(e))return!1;let t=new URL(e);return Gs([`http:`,`https:`],t.protocol)&&t.username===``&&t.password===``&&t.hash===``},{expected:`an HTTP(S) URL without credentials or a fragment`})).check(WN(e=>{if(!URL.canParse(e))return!1;let t=new URL(e);return t.pathname===`/`&&t.search===``},{expected:`an HTTP(S) origin without a path or query`})).check(WN(e=>{if(!URL.canParse(e))return!1;let t=new URL(e);return t.protocol===`https:`||Gs([`localhost`,`127.0.0.1`,`[::1]`],t.hostname)},{expected:`HTTPS outside loopback`}));yN.check(GN(/^\d{1,5}$/u),WN(e=>as(Ev(e),e=>e>=1&&e<=65535),{expected:`a port between 1 and 65535`}));var QJ=yN.check(GN(/^0\.1\.\d+$/u)),$J=wN({auth:dN(yN),name:yN,traces:yN,version:QJ});wN({...YJ.fields,signOut:xN}),wN({config:wN({port:JN}),name:yN,version:QJ});var eY=kh,tY=Mh,nY=(e,t)=>v_(eY,j(Jd(function*(n){let r=new Set(t?.mergeWithExisting===!0?n.getRef(kh):[]);for(let t of e)r.add(Sa(t)?yield*t:t);return r}))),rY=`4.1.2`,iY=()=>rY,aY=e=>{let t=e===void 0?void 0:oD(e);return t===void 0||us(t)?R(kl(5)):W(hg,e=>sD(t.success,e.currentTimeMillisUnsafe()))},oY=dy.pipe(cy,ry(({output:e})=>NF(e)&&e.reason._tag===`StatusCodeError`&&e.reason.response.status===429?aY(e.reason.response.headers[`retry-after`]):R(kl(1)))),sY=class extends lc()(`effect/observability/OtlpExporter/Flusher`){},cY=g_(sY,()=>{let e=new Set;return{flush:z(()=>e.size===0?V:jy(e,D,{concurrency:`unbounded`,discard:!0})),register:t=>U(Gg,n=>(e.add(t),Yg(n,B(()=>e.delete(t)))))}}),lY=ox(function*(e){let t=yield*vb(),n=Pc(t,hg),r=Pc(t,Gg),i=Rl(ul(e.exportInterval),wl),a=Pc(t,II).pipe(KI(e=>sb(e.arrayBuffer)),qI(e=>e.response?sb(e.response.arrayBuffer):V),zI,RI(wb(XI,!1)),WI({schedule:oY,times:3})),o=`OTel-OTLP-Exporter-JavaScript-Effect-${e.label}/${iY()}`,s=HE(e.headers),c=s[`user-agent`],l=WE(s,`user-agent`,c?`${c} ${o}`:o),u=cI(e.url,{headers:l}),d=e.maxBatchSize===`disabled`&&e.exportEmpty===!0,f=[],p,m=()=>p===void 0?!1:n.currentTimeMillisUnsafe()<p||(p=void 0,!1),h=z(()=>{if(m()||f.length===0&&!d)return V;let t=f;f=[];let[n,r]=e.body(t),i=vI(u,n);return(e.compression===`gzip`?yI(i,`gzip`).pipe(U(a.execute)):a.execute(i)).pipe(qy(r),Zy,Hb(!1))}).pipe($y(e=>p===void 0?(p=n.currentTimeMillisUnsafe()+6e4,f=[],cx(`Disabling exporter for 60 seconds`,e)):V),lx({package:`@effect/opentelemetry`,module:e.label})),g=yield*Xz(),_=yield*rB(g)();yield*Yg(r,z(()=>p===void 0?(_(h),iB(g)):V).pipe(sb,Ib,ub(e.shutdownTimeout)));let v=yield*Px(d),y=yield*Px(),b=B(()=>{d||f.length>0||!v.closeUnsafe()||y.openUnsafe()});yield*Ry(function*(){for(;;)y.closeUnsafe(),yield*v.await,yield*mb(pb(i),y.await),yield*gx(yield*tB(g,h)),yield*b}).pipe(Jb(r));let ee=qy(h,b);return yield*(yield*sY).register(ee),{push(t){m()||(f.push(t),e.maxBatchSize!==`disabled`&&f.length>=e.maxBatchSize?_(ee):v.openUnsafe())}}}),uY=`window`in globalThis||`importScripts`in globalThis,dY=e=>({attributes:pY(Object.entries({"telemetry.sdk.name":`effect`,"telemetry.sdk.language":uY?`webjs`:`nodejs`,"telemetry.sdk.version":iY(),...e.attributes,...e.serviceName?{"service.name":e.serviceName}:void 0,...e.serviceVersion?{"service.version":e.serviceVersion}:void 0})),droppedAttributesCount:0}),fY=ox(function*(e){let t=yield*YP(sP,sP,`OTEL_RESOURCE_ATTRIBUTES`,{trim:!0,keepEmptyValues:!0}).pipe(FP(void 0)),n=e?.serviceName??e?.attributes?.[`service.name`]??(yield*KP(FN(yN),`OTEL_SERVICE_NAME`))??t?.[`service.name`]??(yield*JP(`OTEL_SERVICE_NAME`)),r=e?.serviceVersion??e?.attributes?.[`service.version`]??(yield*KP(FN(yN),`OTEL_SERVICE_VERSION`))??t?.[`service.version`],i={...t,...e?.attributes};return delete i[`service.name`],delete i[`service.version`],dY({serviceName:n,serviceVersion:r,attributes:i})},nb),pY=e=>{let t=[];for(let[n,r]of e)t.push({key:n,value:hY(r)});return t},mY=2**63,hY=e=>{if(Array.isArray(e))return{arrayValue:{values:e.map(hY)}};switch(typeof e){case`string`:return{stringValue:e};case`bigint`:return BigInt.asIntN(64,e)===e?{intValue:String(e)}:{stringValue:String(e)};case`number`:return Number.isInteger(e)&&e>=-mY&&e<mY?{intValue:Number.isSafeInteger(e)?e:String(BigInt(e))}:{doubleValue:e};case`boolean`:return{boolValue:e};default:return{stringValue:Wi(e)}}},gY=class extends lc()(`effect/observability/OtlpSerialization`){};function _Y(e,t){return typeof t==`number`&&!Number.isFinite(t)?String(t):e===`bytesValue`&&this[e]instanceof Uint8Array?YT(this[e]):t}var vY=e=>{let t=JSON.stringify(e);return kF(t.includes(`null`)||t.includes(`"bytesValue":`)?JSON.stringify(e,_Y):t,`application/json`)},yY=p_(gY,{traces:e=>vY(e),metrics:e=>vY(e),logs:e=>vY(e)}),bY=ox(function*(e){let t=yield*gY,n=yield*fY(e.resource),r={name:`effect`,version:iY()},i=yield*lY({label:`OtlpLogger`,url:e.url,headers:e.headers,compression:e.compression,maxBatchSize:e.maxBatchSize??1e3,exportInterval:e.exportInterval??kl(1),body:e=>[t.logs({resourceLogs:[{resource:n,scopeLogs:[{scope:r,logRecords:e}]}]}),V],shutdownTimeout:e.shutdownTimeout??kl(3)}),a={excludeLogSpans:e.excludeLogSpans??!1,clock:yield*hg};return tY(e=>{i.push(CY(e,a))})}),xY=e=>nY([bY(e)],{mergeWithExisting:e.mergeWithExisting??!0}).pipe(D_(cY)),SY=BigInt(1e6),CY=(e,t)=>{let n=t.clock.currentTimeNanosUnsafe().toString(),r=e.date.getTime(),i=(BigInt(r)*SY).toString(),a={...e.fiber.getRef(Hg)};if(a[`effect.fiberId`]=e.fiber.id,!t.excludeLogSpans)for(let[t,n]of e.fiber.getRef(Ug))a[`effect.log_span.${t}`]=r-n;let o=cg(e.cause,{includeCauseInStack:!0});o.length>0&&(a[`exception.type`]=o[0].name,a[`exception.message`]=o[0].message,a[`exception.stacktrace`]=o.map(e=>e.stack).join(`
|
|
19
|
+
`));let s=Ms(e.message),c={severityNumber:wY(e.logLevel),severityText:e.logLevel,timeUnixNano:i,observedTimeUnixNano:n,attributes:pY(Object.entries(a)),body:hY(s.length===1?s[0]:s),droppedAttributesCount:0};return e.fiber.cache.span&&(c.traceId=e.fiber.cache.span.traceId.padStart(32,`0`),c.spanId=e.fiber.cache.span.spanId),c},wY=e=>{switch(e){case`Trace`:return TY.SEVERITY_NUMBER_TRACE;case`Debug`:return TY.SEVERITY_NUMBER_DEBUG;case`Info`:return TY.SEVERITY_NUMBER_INFO;case`Warn`:return TY.SEVERITY_NUMBER_WARN;case`Error`:return TY.SEVERITY_NUMBER_ERROR;case`Fatal`:return TY.SEVERITY_NUMBER_FATAL;default:return TY.SEVERITY_NUMBER_UNSPECIFIED}},TY={SEVERITY_NUMBER_UNSPECIFIED:0,SEVERITY_NUMBER_TRACE:1,SEVERITY_NUMBER_TRACE2:2,SEVERITY_NUMBER_TRACE3:3,SEVERITY_NUMBER_TRACE4:4,SEVERITY_NUMBER_DEBUG:5,SEVERITY_NUMBER_DEBUG2:6,SEVERITY_NUMBER_DEBUG3:7,SEVERITY_NUMBER_DEBUG4:8,SEVERITY_NUMBER_INFO:9,SEVERITY_NUMBER_INFO2:10,SEVERITY_NUMBER_INFO3:11,SEVERITY_NUMBER_INFO4:12,SEVERITY_NUMBER_WARN:13,SEVERITY_NUMBER_WARN2:14,SEVERITY_NUMBER_WARN3:15,SEVERITY_NUMBER_WARN4:16,SEVERITY_NUMBER_ERROR:17,SEVERITY_NUMBER_ERROR2:18,SEVERITY_NUMBER_ERROR3:19,SEVERITY_NUMBER_ERROR4:20,SEVERITY_NUMBER_FATAL:21,SEVERITY_NUMBER_FATAL2:22,SEVERITY_NUMBER_FATAL3:23,SEVERITY_NUMBER_FATAL4:24},EY=_r(ox(function*(e){let t=yield*fY(e.resource),n=yield*gY,r={name:`effect`,version:iY()},i=yield*lY({label:`OtlpTracer`,url:e.url,headers:e.headers,compression:e.compression,exportInterval:e.exportInterval??kl(5),maxBatchSize:e.maxBatchSize??1e3,body(e){let i={resourceSpans:[{resource:t,scopeSpans:[{scope:r,spans:e}]}]};return[n.traces(i),V]},shutdownTimeout:e.shutdownTimeout??kl(3)});function a(e){e.sampled&&i.push(OY(e))}return mu({span(e){return new DY(e,a)},context:e.context?function(t,n){return n.cache.span===void 0?t[`~effect/Effect/evaluate`](n):e.context(t,n.cache.span)}:void 0})}),v_(yu),D_(cY)),DY=class{_tag=`Span`;name;parent;annotations;links;kind;sampled;export;status;_traceId=void 0;_spanId=void 0;_attributes=void 0;_events=void 0;constructor(e,t){this.name=e.name,this.parent=e.parent,this.annotations=e.annotations,this.links=e.links,this.kind=e.kind,this.sampled=e.sampled,this.export=t,this.status={_tag:`Started`,startTime:e.startTime}}get traceId(){return this._traceId??=Go(this.parent)?this.parent.value.traceId:su(32)}get spanId(){return this._spanId??=su(16)}get attributes(){return this._attributes??=new Map}get events(){return this._events??=[]}end(e,t){this.status._tag!==`Ended`&&(this.status={_tag:`Ended`,startTime:this.status.startTime,endTime:e,exit:t},this.export(this))}attribute(e,t){this.status._tag!==`Ended`&&this.attributes.set(e,t)}event(e,t,n){this.status._tag!==`Ended`&&this.events.push([e,t,n])}addLinks(e){this.status._tag!==`Ended`&&this.links.push(...e)}},OY=e=>{let t=e.status,n=e._attributes===void 0?[]:pY(e._attributes),r=[];if(e._events!==void 0)for(let t=0;t<e._events.length;t++){let[n,i,a]=e._events[t];r.push({name:n,timeUnixNano:String(i),attributes:a?pY(Object.entries(a)):[],droppedAttributesCount:0})}let i;if(t.exit._tag===`Success`)i={code:kY.Ok};else if(eg(t.exit.cause))i={code:kY.Unset},n.push({key:`effect.fiber.interrupted`,value:{boolValue:!0}});else{let e=cg(t.exit.cause,{includeCauseInStack:!0});i=e.length>0?{code:kY.Error,message:e[0].message}:{code:kY.Ok};for(let n of e)r.push({name:`exception`,timeUnixNano:String(t.endTime),droppedAttributesCount:0,attributes:[{key:`exception.type`,value:{stringValue:n.name}},{key:`exception.message`,value:{stringValue:n.message}},{key:`exception.stacktrace`,value:{stringValue:n.stack??`No stack trace available`}}]})}let a=[];for(let t=0;t<e.links.length;t++){let n=e.links[t];a.push({traceId:n.span.traceId.padStart(32,`0`),spanId:n.span.spanId,attributes:pY(Object.entries(n.attributes)),droppedAttributesCount:0})}return{traceId:e.traceId.padStart(32,`0`),spanId:e.spanId,parentSpanId:Go(e.parent)?e.parent.value.spanId:void 0,name:e.name,kind:AY[e.kind],startTimeUnixNano:String(t.startTime),endTimeUnixNano:String(t.endTime),attributes:n,droppedAttributesCount:0,events:r,droppedEventsCount:0,status:i,links:a,droppedLinksCount:0}},kY={Unset:0,Ok:1,Error:2},AY={unspecified:0,internal:1,server:2,client:3,producer:4,consumer:5};function jY(e,t,n){return S_(Ry(function*(){let r=`${yield*_g}`,i={attributes:{"scope.run.started_unix_nano":r,"scope.runtime":n,"service.instance.id":r},serviceName:e};return gr(w_(EY({exportInterval:`250 millis`,resource:i,url:new URL(`/v1/traces`,t).href}),xY({exportInterval:`250 millis`,resource:i,url:new URL(`/v1/logs`,t).href})),E_([yY,mL]))}))}function MY(e,t){let n=document.querySelector(`#root`);if(Nr(n))throw TypeError(`Missing application mount element with id "root"`);return{root:n,router:ar({context:{},defaultErrorComponent:qJ,defaultNotFoundComponent:KJ,defaultPreload:`intent`,getScrollRestorationKey:t,routeTree:e,scrollRestoration:!0})}}var NY=gr(lG({pingTimeout:`15 seconds`,retryTransientErrors:!0}),E_(gr(Uz(B(()=>`${location.origin}/api/rpc`)),E_(Rz))),D_(ZW()));function PY(e){return JR.addGlobalLayer(gr(S_(Ry(function*(){let t=yield*(yield*II).get(`/api/runtime`),n=yield*SI($J)(t);return n.traces===``?h_:jY(`${e}-client`,n.traces,`web`)})),E_(mL))),NY}export{_z as $,Yo as $a,Cg as $i,aT as $n,Tb as $r,NN as $t,Nq as A,Us as Aa,Lv as Ai,mk as An,he as Ao,Yy as Ar,jL as At,bq as B,ic as Ba,Qg as Bi,$w as Bn,a as Bo,ky as Br,yF as Bt,Bq as C,xc as Ca,Pv as Ci,_k as Cn,cr as Co,Iy as Cr,wL as Ct,gq as D,Gs as Da,Bv as Di,sj as Dn,Gt as Do,yb as Dr,vL as Dt,kq as E,oc as Ea,jv as Ei,bk as En,Fn as Eo,vb as Er,TL as Et,vq as F,Ks as Fa,b_ as Fi,HE as Fn,ae as Fo,jy as Fr,OI as Ft,PG as G,Ws as Ga,Bg as Gi,Dw as Gn,u as Go,bb as Gr,IP as Gt,Cq as H,As as Ha,qg as Hi,Mw as Hn,s as Ho,tb as Hr,_F as Ht,yq as I,Bs as Ia,k_ as Ii,WE as In,oe as Io,qb as Ir,SI as It,nG as J,us as Ja,jg as Ji,Pw as Jn,ex as Jr,xN as Jt,EG as K,Ss as Ka,Pg as Ki,Vw as Kn,r as Ko,xb as Kr,AN as Kt,jq as L,Is as La,E_ as Li,dE as Ln,re as Lo,Xb as Lr,tI as Lt,Pq as M,Qs as Ma,kv as Mi,xk as Mn,pe as Mo,zy as Mr,II as Mt,hq as N,Zs as Na,Tv as Ni,gk as Nn,ie as No,U as Nr,zI as Nt,Lq as O,ac as Oa,Mv as Oi,fk as On,Wt as Oo,Vy as Or,RL as Ot,Oq as P,js as Pa,v_ as Pi,dj as Pn,ce as Po,ox as Pr,LI as Pt,uB as Q,ns as Qa,bg as Qi,nT as Qn,ax as Qr,mN as Qt,_q as R,Fs as Ra,Gg as Ri,pE as Rn,f as Ro,Ry as Rr,bF as Rt,Uq as S,Oc as Sa,Nv as Si,uk as Sn,lr as So,Pb as Sr,yL as St,Mq as T,Vc as Ta,zv as Ti,pk as Tn,Ln as To,Qy as Tr,SL as Tt,Aq as U,$s as Ua,Mg as Ui,iT as Un,b as Uo,Ly as Ur,JP as Ut,Sq as V,Xs as Va,Kg as Vi,Jw as Vn,v as Vo,W as Vr,gF as Vt,oq as W,tc as Wa,Ng as Wi,Zw as Wn,p as Wo,Nb as Wr,PP as Wt,SB as X,as as Xa,Rg as Xi,Kw as Xn,nx as Xr,JN as Xt,TB as Y,ms as Ya,Ag as Yi,Gw as Yn,Zb as Yr,KN as Yt,_B as Z,is as Za,zg as Zi,Uw as Zn,rx as Zr,DP as Zt,pJ as _,jl as _a,Ey as _i,XM as _n,di as _o,Ob as _r,iR as _t,XJ as a,Yh as aa,Jy as ai,TN as an,ts as ao,Ww as ar,pz as at,Yq as b,Ec as ba,Ov as bi,BN as bn,D as bo,Xy as br,IL as bt,BJ as c,ag as ca,zb as ci,wN as cn,Jo as co,uC as cr,gz as ct,DJ as d,Kh as da,Wy as di,MN as dn,Ro as do,iS as dr,cz as dt,Eg as ea,Eb as ei,hN as en,Xo as eo,eT as er,oz as et,OJ as f,tg as fa,Gb as fi,tN as fn,zo as fo,sS as fr,lz as ft,mJ as g,bl as ga,Oy as gi,uN as gn,ia as go,yx as gr,oR as gt,_J as h,ul as ha,Cy as hi,YN as hn,ca as ho,Lx as hr,IR as ht,JJ as i,gg as ia,B as ii,pP as in,Go as io,Ow as ir,RR as it,Iq as j,ec as ja,Av as ji,vk as jn,me as jo,H as jr,mL as jt,mq as k,rc as ka,Iv as ki,Sk as kn,wt as ko,Ab as kr,EL as kt,IJ as l,Gh as la,Cb as li,zN as ln,N as lo,aS as lr,OR as lt,wJ as m,iu as ma,Sy as mi,QN as mn,sa as mo,nS as mr,yz as mt,MY as n,yg as na,R as ni,eP as nn,Qo as no,Nw as nr,bz as nt,YJ as o,Jh as oa,Hy as oi,YM as on,Ko as oo,PC as or,FR as ot,EJ as p,ng as pa,Uy as pi,rN as pn,ba as po,lS as pr,vz as pt,fG as q,Ts as qa,Fg as qi,Ew as qn,wb as qr,ON as qt,ZJ as r,wg as ra,z as ri,PN as rn,Wo as ro,qw as rr,sz as rt,VJ as s,ig as sa,Rb as si,yN as sn,M as so,vC as sr,JR as st,PY as t,Tg as ta,pb as ti,kN as tn,qo as to,oT as tr,tz as tt,MJ as u,Wh as ua,V as ui,VN as un,Lo as uo,oS as ur,uz as ut,dJ as v,lc as va,ly as vi,dN as vn,O as vo,Ay as vr,WL as vt,Rq as w,zc as wa,Fv as wi,hk as wn,zn as wo,$y as wr,DL as wt,Kq as x,Mc as xa,Rv as xi,pN as xn,gr as xo,Zy as xr,kL as xt,lJ as y,kc as ya,uy as yi,OP as yn,E as yo,qy as yr,zL as yt,xq as z,Ls as za,Yg as zi,lE as zn,te as zo,Fb as zr,vF as zt};
|