@fungi.computer/prints 0.12.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -61,16 +61,16 @@ import{r as e,t}from"./rolldown-runtime-hePW80VL.js";import{r as n}from"./module
61
61
 
62
62
  `)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=re,s=!l.jitless,c=s&&ie.value,u=t.catchall,d;e._zod.parse=(l,f)=>{d??=r.value;let p=l.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),l=a(l,f),u?Tn([],p,l,f,d,e):l):n(l,f):(l.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),l)}});function On(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!he(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>ye(e,r,u())))}),t)}var kn=o(`$ZodUnion`,(e,t)=>{E.init(e,t),v(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),v(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),v(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),v(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>h(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>On(t,r,e,i)):On(o,r,e,i)}}),An=o(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,kn.init(e,t);let n=e._zod.parse;v(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(let r of n)e[t].add(r)}}return e});let r=p(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!re(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback||a.direction===`backward`?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,options:Array.from(r.value.keys()),input:o,path:[t.discriminator],inst:e}),i)}}),jn=o(`$ZodIntersection`,(e,t)=>{E.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>Nn(e,t,n)):Nn(e,i,a)}});function Mn(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(x(e)&&x(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=Mn(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Mn(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Nn(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),he(e))return e;let o=Mn(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var Pn=o(`$ZodTuple`,(e,t)=>{E.init(e,t);let n=t.items;e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({input:a,inst:e,expected:`tuple`,code:`invalid_type`}),r;r.value=[];let o=[],s=Fn(n,`optin`),c=Fn(n,`optout`);if(!t.rest){if(a.length<s)return r.issues.push({code:`too_small`,minimum:s,inclusive:!0,input:a,inst:e,origin:`array`}),r;a.length>n.length&&r.issues.push({code:`too_big`,maximum:n.length,inclusive:!0,input:a,inst:e,origin:`array`})}let l=Array(n.length);for(let e=0;e<n.length;e++){let t=n[e]._zod.run({value:a[e],issues:[]},i);t instanceof Promise?o.push(t.then(t=>{l[e]=t})):l[e]=t}if(t.rest){let e=n.length-1,s=a.slice(n.length);for(let n of s){e++;let a=t.rest._zod.run({value:n,issues:[]},i);a instanceof Promise?o.push(a.then(t=>In(t,r,e))):In(a,r,e)}}return o.length?Promise.all(o).then(()=>Ln(l,r,n,a,c)):Ln(l,r,n,a,c)}});function Fn(e,t){for(let n=e.length-1;n>=0;n--)if(e[n]._zod[t]!==`optional`)return n+1;return 0}function In(e,t,n){e.issues.length&&t.issues.push(..._e(n,e.issues)),t.value[n]=e.value}function Ln(e,t,n,r,i){for(let a=0;a<n.length;a++){let n=e[a],o=a<r.length;if(n.issues.length){if(!o&&a>=i){t.value.length=a;break}t.issues.push(..._e(a,n.issues))}t.value[a]=n.value}for(let e=t.value.length-1;e>=r.length&&n[e]._zod.optout===`optional`&&t.value[e]===void 0;e--)t.value.length=e;return t}var Rn=o(`$ZodRecord`,(e,t)=>{E.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!x(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[],o=t.keyType._zod.values;if(o){n.value={};let s=new Set;for(let c of o)if(typeof c==`string`||typeof c==`number`||typeof c==`symbol`){s.add(typeof c==`number`?c.toString():c);let o=t.keyType._zod.run({value:c,issues:[]},r);if(o instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(o.issues.length){n.issues.push({code:`invalid_key`,origin:`record`,issues:o.issues.map(e=>ye(e,r,u())),input:c,path:[c],inst:e});continue}let l=o.value,d=t.valueType._zod.run({value:i[c],issues:[]},r);d instanceof Promise?a.push(d.then(e=>{e.issues.length&&n.issues.push(..._e(c,e.issues)),n.value[l]=e.value})):(d.issues.length&&n.issues.push(..._e(c,d.issues)),n.value[l]=d.value)}let c;for(let e in i)s.has(e)||(c??=[],c.push(e));c&&c.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:c})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`||!Object.prototype.propertyIsEnumerable.call(i,o))continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof o==`string`&&gt.test(o)&&s.issues.length){let e=t.keyType._zod.run({value:Number(o),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(s=e)}if(s.issues.length){t.mode===`loose`?n.value[o]=i[o]:n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>ye(e,r,u())),input:o,path:[o],inst:e});continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(..._e(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(..._e(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),zn=o(`$ZodEnum`,(e,t)=>{E.init(e,t);let n=d(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>ae.has(typeof e)).map(e=>typeof e==`string`?oe(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),Bn=o(`$ZodLiteral`,(e,t)=>{if(E.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?oe(e):e?oe(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),Vn=o(`$ZodTransform`,(e,t)=>{E.init(e,t),e._zod.optin=`optional`,e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new c(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n.fallback=!0,n));if(i instanceof Promise)throw new s;return n.value=i,n.fallback=!0,n}});function Hn(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var Un=o(`$ZodOptional`,(e,t)=>{E.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,v(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),v(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${h(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=e.value,i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(e=>Hn(e,r)):Hn(i,r)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),Wn=o(`$ZodExactOptional`,(e,t)=>{Un.init(e,t),v(e._zod,`values`,()=>t.innerType._zod.values),v(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Gn=o(`$ZodNullable`,(e,t)=>{E.init(e,t),v(e._zod,`optin`,()=>t.innerType._zod.optin),v(e._zod,`optout`,()=>t.innerType._zod.optout),v(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${h(e.source)}|null)$`):void 0}),v(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Kn=o(`$ZodDefault`,(e,t)=>{E.init(e,t),e._zod.optin=`optional`,v(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>qn(e,t)):qn(r,t)}});function qn(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Jn=o(`$ZodPrefault`,(e,t)=>{E.init(e,t),e._zod.optin=`optional`,v(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Yn=o(`$ZodNonOptional`,(e,t)=>{E.init(e,t),v(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>Xn(t,e)):Xn(i,e)}});function Xn(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var Zn=o(`$ZodCatch`,(e,t)=>{E.init(e,t),e._zod.optin=`optional`,v(e._zod,`optout`,()=>t.innerType._zod.optout),v(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>ye(e,n,u()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>ye(e,n,u()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),Qn=o(`$ZodPipe`,(e,t)=>{E.init(e,t),v(e._zod,`values`,()=>t.in._zod.values),v(e._zod,`optin`,()=>t.in._zod.optin),v(e._zod,`optout`,()=>t.out._zod.optout),v(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>$n(e,t.in,n)):$n(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>$n(e,t.out,n)):$n(r,t.out,n)}});function $n(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}var er=o(`$ZodReadonly`,(e,t)=>{E.init(e,t),v(e._zod,`propValues`,()=>t.innerType._zod.propValues),v(e._zod,`values`,()=>t.innerType._zod.values),v(e._zod,`optin`,()=>t.innerType?._zod?.optin),v(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(tr):tr(r)}});function tr(e){return e.value=Object.freeze(e.value),e}var nr=o(`$ZodFunction`,(e,t)=>(E.init(e,t),e._def=t,e._zod.def=t,e.implement=t=>{if(typeof t!=`function`)throw Error(`implement() must be called with a function`);return function(...n){let r=e._def.input?Oe(e._def.input,n):n,i=Reflect.apply(t,this,r);return e._def.output?Oe(e._def.output,i):i}},e.implementAsync=t=>{if(typeof t!=`function`)throw Error(`implementAsync() must be called with a function`);return async function(...n){let r=e._def.input?await Ae(e._def.input,n):n,i=await Reflect.apply(t,this,r);return e._def.output?await Ae(e._def.output,i):i}},e._zod.parse=(t,n)=>typeof t.value==`function`?(t.value=e._def.output&&e._def.output._zod.def.type===`promise`?e.implementAsync(t.value):e.implement(t.value),t):(t.issues.push({code:`invalid_type`,expected:`function`,input:t.value,inst:e}),t),e.input=(...t)=>{let n=e.constructor;return Array.isArray(t[0])?new n({type:`function`,input:new Pn({type:`tuple`,items:t[0],rest:t[1]}),output:e._def.output}):new n({type:`function`,input:t[0],output:e._def.output})},e.output=t=>{let n=e.constructor;return new n({type:`function`,input:e._def.input,output:t})},e)),rr=o(`$ZodPromise`,(e,t)=>{E.init(e,t),e._zod.parse=(e,n)=>Promise.resolve(e.value).then(e=>t.innerType._zod.run({value:e,issues:[]},n))}),ir=o(`$ZodLazy`,(e,t)=>{E.init(e,t),v(e._zod,`innerType`,()=>{let e=t;return e._cachedInner||=t.getter(),e._cachedInner}),v(e._zod,`pattern`,()=>e._zod.innerType?._zod?.pattern),v(e._zod,`propValues`,()=>e._zod.innerType?._zod?.propValues),v(e._zod,`optin`,()=>e._zod.innerType?._zod?.optin??void 0),v(e._zod,`optout`,()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),ar=o(`$ZodCustom`,(e,t)=>{xt.init(e,t),E.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>or(t,n,r,e));or(i,n,r,e)}});function or(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(xe(e))}}var sr,cr=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function lr(){return new cr}(sr=globalThis).__zod_globalRegistry??(sr.__zod_globalRegistry=lr());var ur=globalThis.__zod_globalRegistry;function dr(e,t){return new e({type:`string`,...w(t)})}function fr(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...w(t)})}function pr(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...w(t)})}function mr(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...w(t)})}function hr(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...w(t)})}function gr(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...w(t)})}function _r(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...w(t)})}function vr(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...w(t)})}function yr(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...w(t)})}function br(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...w(t)})}function xr(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...w(t)})}function Sr(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...w(t)})}function Cr(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...w(t)})}function wr(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...w(t)})}function Tr(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...w(t)})}function Er(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...w(t)})}function Dr(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...w(t)})}function Or(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...w(t)})}function kr(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...w(t)})}function Ar(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...w(t)})}function jr(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...w(t)})}function Mr(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...w(t)})}function Nr(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...w(t)})}function Pr(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...w(t)})}function Fr(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...w(t)})}function Ir(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...w(t)})}function Lr(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...w(t)})}function Rr(e,t){return new e({type:`number`,checks:[],...w(t)})}function zr(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...w(t)})}function Br(e,t){return new e({type:`boolean`,...w(t)})}function Vr(e,t){return new e({type:`null`,...w(t)})}function Hr(e){return new e({type:`unknown`})}function Ur(e,t){return new e({type:`never`,...w(t)})}function Wr(e,t){return new e({type:`void`,...w(t)})}function Gr(e,t){return new Ct({check:`less_than`,...w(t),value:e,inclusive:!1})}function Kr(e,t){return new Ct({check:`less_than`,...w(t),value:e,inclusive:!0})}function qr(e,t){return new wt({check:`greater_than`,...w(t),value:e,inclusive:!1})}function Jr(e,t){return new wt({check:`greater_than`,...w(t),value:e,inclusive:!0})}function Yr(e,t){return new Tt({check:`multiple_of`,...w(t),value:e})}function Xr(e,t){return new Dt({check:`max_length`,...w(t),maximum:e})}function Zr(e,t){return new Ot({check:`min_length`,...w(t),minimum:e})}function Qr(e,t){return new kt({check:`length_equals`,...w(t),length:e})}function $r(e,t){return new jt({check:`string_format`,format:`regex`,...w(t),pattern:e})}function ei(e){return new Mt({check:`string_format`,format:`lowercase`,...w(e)})}function ti(e){return new Nt({check:`string_format`,format:`uppercase`,...w(e)})}function ni(e,t){return new Pt({check:`string_format`,format:`includes`,...w(t),includes:e})}function ri(e,t){return new Ft({check:`string_format`,format:`starts_with`,...w(t),prefix:e})}function ii(e,t){return new It({check:`string_format`,format:`ends_with`,...w(t),suffix:e})}function ai(e){return new Lt({check:`overwrite`,tx:e})}function oi(e){return ai(t=>t.normalize(e))}function si(){return ai(e=>e.trim())}function ci(){return ai(e=>e.toLowerCase())}function li(){return ai(e=>e.toUpperCase())}function ui(){return ai(e=>te(e))}function di(e,t,n){return new e({type:`array`,element:t,...w(n)})}function fi(e,t,n){let r=w(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}function pi(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...w(n)})}function mi(e,t){let n=hi(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(xe(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=t.value,r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(xe(r))}},e(t.value,t)),t);return n}function hi(e,t){let n=new xt({check:`custom`,...w(t)});return n._zod.check=e,n}function gi(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??ur,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function O(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,O(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&yi(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function _i(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
63
63
 
64
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function vi(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:xi(t,`input`,e.processors),output:xi(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function yi(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return yi(r.element,n);if(r.type===`set`)return yi(r.valueType,n);if(r.type===`lazy`)return yi(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`)return yi(r.innerType,n);if(r.type===`intersection`)return yi(r.left,n)||yi(r.right,n);if(r.type===`record`||r.type===`map`)return yi(r.keyType,n)||yi(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:yi(r.in,n)||yi(r.out,n);if(r.type===`object`){for(let e in r.shape)if(yi(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(yi(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(yi(e,n))return!0;return!!(r.rest&&yi(r.rest,n))}return!1}var bi=(e,t={})=>n=>{let r=gi({...n,processors:t});return O(e,r),_i(r,e),vi(r,e)},xi=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=gi({...i??{},target:a,io:t,processors:n});return O(e,o),_i(o,e),vi(o,e)},Si={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Ci=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Si[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},wi=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;i.type=typeof s==`string`&&s.includes(`int`)?`integer`:`number`;let d=typeof u==`number`&&u>=(a??-1/0),f=typeof l==`number`&&l<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;d?p?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof o==`number`&&(i.maximum=o),typeof c==`number`&&(i.multipleOf=c)},Ti=(e,t,n,r)=>{n.type=`boolean`},Ei=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},Di=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Void cannot be represented in JSON Schema`)},Oi=(e,t,n,r)=>{n.not={}},ki=(e,t,n,r)=>{let i=e._zod.def,a=d(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},Ai=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},ji=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},Mi=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Function types cannot be represented in JSON Schema`)},Ni=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},Pi=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=O(a.element,t,{...r,path:[...r.path,`items`]})},Fi=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=O(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=O(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Ii=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>O(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Li=(e,t,n,r)=>{let i=e._zod.def,a=O(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=O(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},Ri=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`array`;let o=t.target===`draft-2020-12`?`prefixItems`:`items`,s=t.target===`draft-2020-12`||t.target===`openapi-3.0`?`items`:`additionalItems`,c=a.items.map((e,n)=>O(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?O(a.rest,t,{...r,path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]}):null;t.target===`draft-2020-12`?(i.prefixItems=c,l&&(i.items=l)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),i.minItems=c.length,l||(i.maxItems=c.length)):(i.items=c,l&&(i.additionalItems=l));let{minimum:u,maximum:d}=e._zod.bag;typeof u==`number`&&(i.minItems=u),typeof d==`number`&&(i.maxItems=d)},zi=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=O(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else(t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=O(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=O(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},Bi=(e,t,n,r)=>{let i=e._zod.def,a=O(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},Vi=(e,t,n,r)=>{let i=e._zod.def;O(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Hi=(e,t,n,r)=>{let i=e._zod.def;O(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},Ui=(e,t,n,r)=>{let i=e._zod.def;O(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},Wi=(e,t,n,r)=>{let i=e._zod.def;O(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},Gi=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;O(o,t,r);let s=t.seen.get(e);s.ref=o},Ki=(e,t,n,r)=>{let i=e._zod.def;O(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},qi=(e,t,n,r)=>{let i=e._zod.def;O(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Ji=(e,t,n,r)=>{let i=e._zod.def;O(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Yi=(e,t,n,r)=>{let i=e._zod.innerType;O(i,t,r);let a=t.seen.get(e);a.ref=i},Xi=o(`ZodISODateTime`,(e,t)=>{Qt.init(e,t),j.init(e,t)});function Zi(e){return Pr(Xi,e)}var Qi=o(`ZodISODate`,(e,t)=>{$t.init(e,t),j.init(e,t)});function $i(e){return Fr(Qi,e)}var ea=o(`ZodISOTime`,(e,t)=>{en.init(e,t),j.init(e,t)});function ta(e){return Ir(ea,e)}var na=o(`ZodISODuration`,(e,t)=>{tn.init(e,t),j.init(e,t)});function ra(e){return Lr(na,e)}var ia=o(`ZodError`,(e,t)=>{Ce.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>Ee(e,t)},flatten:{value:t=>Te(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,f,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,f,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),aa=De(ia),oa=ke(ia),sa=je(ia),ca=Ne(ia),la=Fe(ia),ua=Ie(ia),da=Le(ia),fa=Re(ia),pa=ze(ia),ma=Be(ia),ha=Ve(ia),ga=He(ia),_a=new WeakMap;function va(e,t,n){let r=Object.getPrototypeOf(e),i=_a.get(r);if(i||(i=new Set,_a.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}var k=o(`ZodType`,(e,t)=>(E.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:xi(e,`input`),output:xi(e,`output`)}}),e.toJSONSchema=bi(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>aa(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>sa(e,t,n),e.parseAsync=async(t,n)=>oa(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>ca(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>la(e,t,n),e.decode=(t,n)=>ua(e,t,n),e.encodeAsync=async(t,n)=>da(e,t,n),e.decodeAsync=async(t,n)=>fa(e,t,n),e.safeEncode=(t,n)=>pa(e,t,n),e.safeDecode=(t,n)=>ma(e,t,n),e.safeEncodeAsync=async(t,n)=>ha(e,t,n),e.safeDecodeAsync=async(t,n)=>ga(e,t,n),va(e,`ZodType`,{check(...e){let t=this.def;return this.clone(b(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return C(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Yo(e,t))},superRefine(e,t){return this.check(Xo(e,t))},overwrite(e){return this.check(ai(e))},optional(){return wo(this)},exactOptional(){return Eo(this)},nullable(){return Oo(this)},nullish(){return wo(Oo(this))},nonoptional(e){return Po(this,e)},array(){return ro(this)},or(e){return co([this,e])},and(e){return po(this,e)},transform(e){return Ro(this,So(e))},default(e){return Ao(this,e)},prefault(e){return Mo(this,e)},catch(e){return Io(this,e)},pipe(e){return Ro(this,e)},readonly(){return Bo(this)},describe(e){let t=this.clone();return ur.add(t,{description:e}),t},meta(...e){if(e.length===0)return ur.get(this);let t=this.clone();return ur.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get(){return ur.get(e)?.description},configurable:!0}),e)),ya=o(`_ZodString`,(e,t)=>{Bt.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ci(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,va(e,`_ZodString`,{regex(...e){return this.check($r(...e))},includes(...e){return this.check(ni(...e))},startsWith(...e){return this.check(ri(...e))},endsWith(...e){return this.check(ii(...e))},min(...e){return this.check(Zr(...e))},max(...e){return this.check(Xr(...e))},length(...e){return this.check(Qr(...e))},nonempty(...e){return this.check(Zr(1,...e))},lowercase(e){return this.check(ei(e))},uppercase(e){return this.check(ti(e))},trim(){return this.check(si())},normalize(...e){return this.check(oi(...e))},toLowerCase(){return this.check(ci())},toUpperCase(){return this.check(li())},slugify(){return this.check(ui())}})}),ba=o(`ZodString`,(e,t)=>{Bt.init(e,t),ya.init(e,t),e.email=t=>e.check(fr(xa,t)),e.url=t=>e.check(vr(Ta,t)),e.jwt=t=>e.check(Nr(Va,t)),e.emoji=t=>e.check(yr(Da,t)),e.guid=t=>e.check(pr(Sa,t)),e.uuid=t=>e.check(mr(Ca,t)),e.uuidv4=t=>e.check(hr(Ca,t)),e.uuidv6=t=>e.check(gr(Ca,t)),e.uuidv7=t=>e.check(_r(Ca,t)),e.nanoid=t=>e.check(br(Oa,t)),e.guid=t=>e.check(pr(Sa,t)),e.cuid=t=>e.check(xr(ka,t)),e.cuid2=t=>e.check(Sr(Aa,t)),e.ulid=t=>e.check(Cr(ja,t)),e.base64=t=>e.check(Ar(Ra,t)),e.base64url=t=>e.check(jr(za,t)),e.xid=t=>e.check(wr(Ma,t)),e.ksuid=t=>e.check(Tr(Na,t)),e.ipv4=t=>e.check(Er(Pa,t)),e.ipv6=t=>e.check(Dr(Fa,t)),e.cidrv4=t=>e.check(Or(Ia,t)),e.cidrv6=t=>e.check(kr(La,t)),e.e164=t=>e.check(Mr(Ba,t)),e.datetime=t=>e.check(Zi(t)),e.date=t=>e.check($i(t)),e.time=t=>e.check(ta(t)),e.duration=t=>e.check(ra(t))});function A(e){return dr(ba,e)}var j=o(`ZodStringFormat`,(e,t)=>{D.init(e,t),ya.init(e,t)}),xa=o(`ZodEmail`,(e,t)=>{Ut.init(e,t),j.init(e,t)}),Sa=o(`ZodGUID`,(e,t)=>{Vt.init(e,t),j.init(e,t)}),Ca=o(`ZodUUID`,(e,t)=>{Ht.init(e,t),j.init(e,t)});function wa(e){return mr(Ca,e)}var Ta=o(`ZodURL`,(e,t)=>{Wt.init(e,t),j.init(e,t)});function Ea(e){return vr(Ta,e)}var Da=o(`ZodEmoji`,(e,t)=>{Gt.init(e,t),j.init(e,t)}),Oa=o(`ZodNanoID`,(e,t)=>{Kt.init(e,t),j.init(e,t)}),ka=o(`ZodCUID`,(e,t)=>{qt.init(e,t),j.init(e,t)}),Aa=o(`ZodCUID2`,(e,t)=>{Jt.init(e,t),j.init(e,t)}),ja=o(`ZodULID`,(e,t)=>{Yt.init(e,t),j.init(e,t)}),Ma=o(`ZodXID`,(e,t)=>{Xt.init(e,t),j.init(e,t)}),Na=o(`ZodKSUID`,(e,t)=>{Zt.init(e,t),j.init(e,t)}),Pa=o(`ZodIPv4`,(e,t)=>{nn.init(e,t),j.init(e,t)}),Fa=o(`ZodIPv6`,(e,t)=>{rn.init(e,t),j.init(e,t)}),Ia=o(`ZodCIDRv4`,(e,t)=>{an.init(e,t),j.init(e,t)}),La=o(`ZodCIDRv6`,(e,t)=>{on.init(e,t),j.init(e,t)}),Ra=o(`ZodBase64`,(e,t)=>{cn.init(e,t),j.init(e,t)}),za=o(`ZodBase64URL`,(e,t)=>{un.init(e,t),j.init(e,t)}),Ba=o(`ZodE164`,(e,t)=>{dn.init(e,t),j.init(e,t)}),Va=o(`ZodJWT`,(e,t)=>{pn.init(e,t),j.init(e,t)}),Ha=o(`ZodNumber`,(e,t)=>{mn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wi(e,t,n,r),va(e,`ZodNumber`,{gt(e,t){return this.check(qr(e,t))},gte(e,t){return this.check(Jr(e,t))},min(e,t){return this.check(Jr(e,t))},lt(e,t){return this.check(Gr(e,t))},lte(e,t){return this.check(Kr(e,t))},max(e,t){return this.check(Kr(e,t))},int(e){return this.check(Ga(e))},safe(e){return this.check(Ga(e))},positive(e){return this.check(qr(0,e))},nonnegative(e){return this.check(Jr(0,e))},negative(e){return this.check(Gr(0,e))},nonpositive(e){return this.check(Kr(0,e))},multipleOf(e,t){return this.check(Yr(e,t))},step(e,t){return this.check(Yr(e,t))},finite(){return this}});let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function Ua(e){return Rr(Ha,e)}var Wa=o(`ZodNumberFormat`,(e,t)=>{hn.init(e,t),Ha.init(e,t)});function Ga(e){return zr(Wa,e)}var Ka=o(`ZodBoolean`,(e,t)=>{gn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ti(e,t,n,r)});function qa(e){return Br(Ka,e)}var Ja=o(`ZodNull`,(e,t)=>{_n.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ei(e,t,n,r)});function Ya(e){return Vr(Ja,e)}var Xa=o(`ZodUnknown`,(e,t)=>{vn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Za(){return Hr(Xa)}var Qa=o(`ZodNever`,(e,t)=>{yn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Oi(e,t,n,r)});function $a(e){return Ur(Qa,e)}var eo=o(`ZodVoid`,(e,t)=>{bn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Di(e,t,n,r)});function to(e){return Wr(eo,e)}var no=o(`ZodArray`,(e,t)=>{Sn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Pi(e,t,n,r),e.element=t.element,va(e,`ZodArray`,{min(e,t){return this.check(Zr(e,t))},nonempty(e){return this.check(Zr(1,e))},max(e,t){return this.check(Xr(e,t))},length(e,t){return this.check(Qr(e,t))},unwrap(){return this.element}})});function ro(e,t){return di(no,e,t)}var io=o(`ZodObject`,(e,t)=>{Dn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fi(e,t,n,r),v(e,`shape`,()=>t.shape),va(e,`ZodObject`,{keyof(){return yo(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:Za()})},loose(){return this.clone({...this._zod.def,catchall:Za()})},strict(){return this.clone({...this._zod.def,catchall:$a()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return ue(this,e)},safeExtend(e){return de(this,e)},merge(e){return fe(this,e)},pick(e){return T(this,e)},omit(e){return le(this,e)},partial(...e){return pe(Co,this,e[0])},required(...e){return me(No,this,e[0])}})});function M(e,t){return new io({type:`object`,shape:e??{},...w(t)})}function ao(e,t){return new io({type:`object`,shape:e,catchall:$a(),...w(t)})}function oo(e,t){return new io({type:`object`,shape:e,catchall:Za(),...w(t)})}var so=o(`ZodUnion`,(e,t)=>{kn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ii(e,t,n,r),e.options=t.options});function co(e,t){return new so({type:`union`,options:e,...w(t)})}var lo=o(`ZodDiscriminatedUnion`,(e,t)=>{so.init(e,t),An.init(e,t)});function uo(e,t,n){return new lo({type:`union`,options:t,discriminator:e,...w(n)})}var fo=o(`ZodIntersection`,(e,t)=>{jn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Li(e,t,n,r)});function po(e,t){return new fo({type:`intersection`,left:e,right:t})}var mo=o(`ZodTuple`,(e,t)=>{Pn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ri(e,t,n,r),e.rest=t=>e.clone({...e._zod.def,rest:t})});function ho(e,t,n){let r=t instanceof E;return new mo({type:`tuple`,items:e,rest:r?t:null,...w(r?n:t)})}var go=o(`ZodRecord`,(e,t)=>{Rn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zi(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function _o(e,t,n){return!t||!t._zod?new go({type:`record`,keyType:A(),valueType:e,...w(t)}):new go({type:`record`,keyType:e,valueType:t,...w(n)})}var vo=o(`ZodEnum`,(e,t)=>{zn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ki(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new vo({...t,checks:[],...w(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new vo({...t,checks:[],...w(r),entries:i})}});function yo(e,t){return new vo({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...w(t)})}var bo=o(`ZodLiteral`,(e,t)=>{Bn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ai(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function N(e,t){return new bo({type:`literal`,values:Array.isArray(e)?e:[e],...w(t)})}var xo=o(`ZodTransform`,(e,t)=>{Vn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ni(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new c(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(xe(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(xe(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}});function So(e){return new xo({type:`transform`,transform:e})}var Co=o(`ZodOptional`,(e,t)=>{Un.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ji(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function wo(e){return new Co({type:`optional`,innerType:e})}var To=o(`ZodExactOptional`,(e,t)=>{Wn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ji(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Eo(e){return new To({type:`optional`,innerType:e})}var Do=o(`ZodNullable`,(e,t)=>{Gn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Oo(e){return new Do({type:`nullable`,innerType:e})}var ko=o(`ZodDefault`,(e,t)=>{Kn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Hi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Ao(e,t){return new ko({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():S(t)}})}var jo=o(`ZodPrefault`,(e,t)=>{Jn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ui(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Mo(e,t){return new jo({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():S(t)}})}var No=o(`ZodNonOptional`,(e,t)=>{Yn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Po(e,t){return new No({type:`nonoptional`,innerType:e,...w(t)})}var Fo=o(`ZodCatch`,(e,t)=>{Zn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Io(e,t){return new Fo({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var Lo=o(`ZodPipe`,(e,t)=>{Qn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Gi(e,t,n,r),e.in=t.in,e.out=t.out});function Ro(e,t){return new Lo({type:`pipe`,in:e,out:t})}var zo=o(`ZodReadonly`,(e,t)=>{er.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ki(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Bo(e){return new zo({type:`readonly`,innerType:e})}var Vo=o(`ZodLazy`,(e,t)=>{ir.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Yi(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function Ho(e){return new Vo({type:`lazy`,getter:e})}var Uo=o(`ZodPromise`,(e,t)=>{rr.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Wo(e){return new Uo({type:`promise`,innerType:e})}var Go=o(`ZodFunction`,(e,t)=>{nr.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mi(e,t,n,r)});function Ko(e){return new Go({type:`function`,input:Array.isArray(e?.input)?ho(e?.input):e?.input??ro(Za()),output:e?.output??Za()})}var qo=o(`ZodCustom`,(e,t)=>{ar.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ji(e,t,n,r)});function Jo(e,t){return fi(qo,e??(()=>!0),t)}function Yo(e,t={}){return pi(qo,e,t)}function Xo(e,t){return mi(e,t)}function Zo(e,t={}){let n=new qo({type:`custom`,check:`custom`,fn:t=>t instanceof e,abort:!0,...w(t)});return n._zod.bag.Class=e,n._zod.check=t=>{t.value instanceof e||t.issues.push({code:`invalid_type`,expected:e.name,input:t.value,inst:n,path:[...n._zod.def.path??[]]})},n}function Qo(e){let t=Ho(()=>co([A(e),Ua(),qa(),Ya(),ro(t),_o(A(),t)]));return t}var P=e(i(),1),$o=Qo(),es=Ho(()=>uo(`status`,[M({status:N(`available`)}).strict(),M({status:N(`unavailable`),reason:A()}).strict()])),ts=$o,ns=Ho(()=>_o(A(),ts)),rs=e=>ts.parse(e),is=Ho(()=>M({code:A().min(1).max(160),message:A().min(1).max(512),details:ts.optional()}).strict()),as=e=>is.parse(e),os=ns,ss=Ho(()=>A().refine(e=>e.trim().length>0)),cs=es,ls=Ho(()=>co([M({type:N(`action`)}).strict(),M({type:N(`custom`),data:ns}).strict(),M({type:N(`choice`),options:ro(M({value:ts,label:ss,description:ss.optional()}))}).strict(),M({type:N(`form`),submitLabel:ss.optional()}).strict(),M({type:N(`confirmation`),message:ss,confirmLabel:ss.optional(),cancelLabel:ss.optional()}).strict()])),us=Ho(()=>M({inputSchema:os.optional(),outputSchema:os.optional(),presentation:ls.optional()}).strict()),ds=Ho(()=>Ua().int().refine(e=>Number.isSafeInteger(e))),fs=Ho(()=>M({hint:ss.pipe(A().max(120)),words:ro(M({word:A().regex(/^\S{1,64}$/u),description:ss.pipe(A().max(512)).optional(),arguments:ns}).strict()).max(32).optional(),text:M({field:ss.pipe(A().max(120)),arguments:ns,requestIdField:ss.pipe(A().max(120)).optional()}).strict().optional()}).strict().refine(e=>e.words!==void 0||e.text!==void 0,`slash arguments need words or text`)),ps=Ho(()=>M({order:ds.optional()}).strict()),ms=Ho(()=>M({bindings:M({order:ds.optional(),values:ro(ss).max(16)}).strict().optional(),agent:M({keybind:ss.optional(),order:ds.optional()}).strict().optional(),help:ps.optional(),menu:ps.optional(),palette:ps.optional(),slash:M({aliases:ro(ss).max(16),consumesDraft:qa().optional(),order:ds.optional(),arguments:fs.optional()}).strict().optional()}).strict()),hs=Ho(()=>M({id:ss.refine(e=>!e.includes(`:`)),title:ss,category:ss,description:ss.optional(),projections:ms.optional(),action:us.optional(),availability:cs.optional()}).strict()),gs=e=>hs.parse(e),_s=Ho(()=>M({inputSchema:os.optional(),outputSchema:os.optional()}).strict()),vs=A().min(1).brand();Ho(()=>M({commandId:vs,command:M({namespace:A(),id:A()}).strict(),sourceId:A(),scope:A().optional(),title:A(),category:A(),description:A().optional(),order:Ua(),availability:es,action:_s.optional(),keybind:A().optional()}).strict());var ys=8192,F=ss.pipe(A().max(ys)),bs=ss.pipe(A().max(60)),xs=Ea({protocol:/^https?$/u}),Ss=M({label:F,value:F}).strict(),Cs={summary:F.optional(),facts:ro(Ss).max(4).optional(),body:F.optional(),bodyLabel:F.optional(),details:ro(Ss).max(24).optional()};uo(`type`,[M({type:N(`choice`),message:bs,...Cs,current:F.optional(),collapsedGroup:F.optional(),options:ro(M({value:F,label:F,description:F.optional(),group:F.optional(),destructive:N(!0).optional()}).strict()).min(1).max(256)}).strict(),M({type:N(`text`),message:bs,...Cs,placeholder:F.optional(),secret:qa().optional()}).strict(),M({type:N(`confirmation`),message:bs,...Cs,confirmLabel:F.optional(),cancelLabel:F.optional(),destructive:N(!0).optional()}).strict(),M({type:N(`decision`),message:bs,...Cs,options:ro(M({value:F,label:F,description:F.optional(),destructive:N(!0).optional()}).strict()).min(1).max(8).refine(e=>new Set(e.map(e=>e.value)).size===e.length,`Decision option values must be unique`),multiple:qa().optional(),other:M({label:F,placeholder:F.optional(),maxLength:Ua().int().min(1).max(ys),blank:F.optional()}).strict().optional(),escape:F.optional()}).strict().refine(e=>[e.escape,e.other?.blank].every(t=>t===void 0||e.options.some(e=>e.value===t)),`A decision's escape and blank answers must be offered options`)]),Ho(()=>uo(`type`,[M({type:N(`info`),message:F,links:ro(M({url:xs,label:F.optional()}).strict()).max(16).optional()}).strict(),M({type:N(`progress`),message:F}).strict(),M({type:N(`handoff`),url:xs,code:F.optional(),message:F.optional()}).strict(),M({type:N(`success`),message:F}).strict()]));var ws=(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}}},Ts={pipe(){return ws(this,arguments)}},Es=function(){function e(){}return e.prototype=Ts,e}(),I=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)}}}},Ds=e=>e,Os=e=>()=>e,ks=Os(!0),As=Os(null),js=Os(void 0),Ms=js;function Ns(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 Ps(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 Fs(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 Is=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},Ls=new WeakSet,Rs=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),zs=0,Bs=()=>{zs++};function Vs(e){return typeof e==`string`}function Hs(e){return typeof e==`number`}function Us(e){return typeof e==`boolean`}function Ws(e){return typeof e==`symbol`}function Gs(e){return Vs(e)||Hs(e)||Ws(e)}function Ks(e){return typeof e==`function`}function qs(e){return e===void 0}function Js(e){return e!=null}function Ys(e){return!0}function Xs(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Zs(e){return typeof e==`object`&&!!e||Ks(e)}var Qs=I(2,(e,t)=>Zs(e)&&t in e),$s=`~effect/Hash`,L=e=>{switch(typeof e){case`number`:return ac(e);case`bigint`:return oc(e.toString(10));case`string`:return oc(e);case`function`:case`object`:if(e===null)break;if(e instanceof Date)return Number.isNaN(e.getTime())?oc(`Invalid Date`):oc(e.toISOString());if(e instanceof RegExp)return oc(e.toString());{if(Ls.has(e))return ec(e);let t=hc.get(e);if(t!==void 0)return t;if(gc.has(e))return Bs(),oc(`[Circular]`);gc.add(e);let n=zs,r;try{r=`~effect/Hash`in e?e[$s]():typeof e==`function`?ec(e):e instanceof DataView?uc(Rs(e)):Array.isArray(e)||ArrayBuffer.isView(e)?uc(e):e instanceof Map?dc(e):e instanceof Set?pc(e):cc(e)}finally{gc.delete(e)}return n===zs&&hc.set(e,r),r}}return rc(tc(oc(String(e))))},ec=e=>(mc.has(e)||mc.set(e,rc(Math.random()*4294967296|0)),mc.get(e)),tc=e=>(e^=e>>>16,e=Math.imul(e,2246822507),e^=e>>>13,e=Math.imul(e,3266489909),e^e>>>16),nc=I(2,(e,t)=>tc(Math.imul(e,2654435761)+Math.imul(t,2246822507))),rc=e=>e&3221225471|e>>>1&1073741824,ic=new DataView(new ArrayBuffer(8)),ac=e=>{let t=e|0;return t===e?rc(t):(ic.setFloat64(0,e===e?e:NaN),rc(nc(ic.getInt32(0),ic.getInt32(4))))},oc=e=>{let t=5381,n=e.length;for(;n;)t=t*33^e.charCodeAt(--n);return rc(t)},sc=(e,t)=>{let n=12289;for(let r of t)n^=nc(L(r),L(e[r]));return rc(n)},cc=e=>sc(e,Is(e)),lc=(e,t)=>n=>{let r=e;for(let e of n)r^=t(e);return rc(r)},uc=e=>{let t=6151;for(let n of e)t=nc(t,L(n));return rc(t)},dc=lc(oc(`Map`),([e,t])=>nc(L(e),L(t))),fc=oc(`Set`),pc=lc(fc,e=>nc(fc,L(e))),mc=new WeakMap,hc=new WeakMap,gc=new WeakSet,_c=`~effect/Equal`;function vc(){return arguments.length===1?e=>yc(e,arguments[0]):yc(arguments[0],arguments[1])}function yc(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`||Ls.has(e)||Ls.has(t)?!1:bc(e,t):!1}function bc(e,t){let n=Sc.length;for(let r=n;r-->0;)if(Sc[r]===e&&Cc[r]===t)return!0;if(n)return xc(e,t);let r=wc.get(e);r||wc.set(e,r=new WeakMap);let i=r.get(t);return i===void 0&&r.set(t,i=xc(e,t)),i}function xc(e,t){Sc.push(e),Cc.push(t);try{return Tc(e,t)}finally{Sc.pop(),Cc.pop()}}var Sc=[],Cc=[],wc=new WeakMap;function Tc(e,t){if(L(e)!==L(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=Mc(e);if(n!==Mc(t)||typeof e==`function`&&!n)return!1;if(n)return e[_c](t);if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:Ec(e,t);if(ArrayBuffer.isView(e)){let n=e instanceof DataView;return!ArrayBuffer.isView(t)||e.byteLength!==t.byteLength||n!==t instanceof DataView?!1:n?Dc(Rs(e),Rs(t)):Dc(e,t)}return e instanceof Map?!(t instanceof Map)||e.size!==t.size?!1:kc(e,t,Ac,jc):e instanceof Set?!(t instanceof Set)||e.size!==t.size?!1:kc(e,t,L,yc):Oc(e,t)}function Ec(e,t){for(let n=0;n<e.length;n++)if(!yc(e[n],t[n]))return!1;return!0}function Dc(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 Oc(e,t){let n=Is(e),r=Is(t);if(n.size!==r.size)return!1;for(let i of n)if(!r.has(i)||!yc(e[i],t[i]))return!1;return!0}function kc(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 Ac=e=>L(e[0]),jc=(e,t)=>yc(e[0],t[0])&&yc(e[1],t[1]),Mc=e=>Qs(e,_c),Nc=e=>e.length>0;function Pc(e,t,n){t===`__proto__`?Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0}):e[t]=n}function Fc(e,t){for(let n of Reflect.ownKeys(t))Object.prototype.propertyIsEnumerable.call(t,n)&&Pc(e,n,t[n])}var Ic=Symbol.for(`~effect/Redactable`),Lc=e=>Qs(e,Ic);function Rc(e){return Lc(e)?zc(e):e}function zc(e){return e[Ic](globalThis[`~effect/Fiber/currentFiber`]?.context??Hc)}var Bc=`~effect/Fiber/currentFiber`,Vc=new Map,Hc={"~effect/Context":{},base:Vc,depth:0,mapUnsafe:Vc,pipe(){return ws(this,arguments)}};function R(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 Uc;r.add(e);let l;if(Ic in e)l=c(zc(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(`,
65
- `+a(n+1))}\n${a(n)}]`;else if(e instanceof Date)l=Kc(e);else if(!t?.ignoreToString&&Qs(e,`toString`)&&typeof e.toString==`function`&&e.toString!==Object.prototype.toString&&e.toString!==Array.prototype.toString){let t=qc(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=>`${Wc(t)}:${c(Jc(e,t),n)}`).join(`,`)}}`;l=o(e,r)}else{let r=`{\n${t.map(t=>`${a(n+1)}${Wc(t)}: ${c(Jc(e,t),n+1)}`).join(`,
66
- `)}\n${a(n)}}`;l=o(e,r)}}return r.delete(e),l}return String(e)}return c(e,0)}var Uc=`[Circular]`;function Wc(e){return typeof e==`string`?JSON.stringify(e):String(e)}function Gc(e){return e.map(e=>`[${Wc(e)}]`).join(``)}function Kc(e){try{return e.toISOString()}catch{return`Invalid Date`}}function qc(e){try{let t=e.toString();return typeof t==`string`?t:String(t)}catch{return`[toString threw]`}}function Jc(e,t){try{return e[t]}catch{return`[property access threw]`}}function Yc(e,t){let n=[];return JSON.stringify(e,function(e,t){let r=Object.getOwnPropertyDescriptor(this,e)?.value,i=Qs(r,Ic)?Rc(r):Rc(t);if(typeof i==`bigint`)return R(i);if(typeof i!=`object`||!i)return i;let a=i instanceof Error&&!Qs(i,`toJSON`)?{...i,name:i.name,message:i.message}:i;for(;n.length>0&&n[n.length-1]!==this;)n.pop();if(n.includes(i))return;if(n.push(i),a!==i&&n.push(a),!Xc(a)||Zc(a))return a;let o=new Proxy(a,{get(e,t){let n=Reflect.get(e,t,e);return Object.getOwnPropertyDescriptor(e,t)?.get===void 0?n:Rc(n)}});return n.push(o),o},t?.space)??`null`}function Xc(e){for(let t of Object.getOwnPropertyNames(e))if(Object.getOwnPropertyDescriptor(e,t)?.get!==void 0)return!0;return!1}function Zc(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 Qc=Symbol.for(`nodejs.util.inspect.custom`),$c=e=>{try{return e=Rc(e),Qs(e,`toJSON`)&&Ks(e.toJSON)&&e.toJSON.length===0?e.toJSON():Array.isArray(e)?e.map($c):e}catch{return`[toJSON threw]`}},el={toJSON(){return $c(this)},[Qc](){return this.toJSON()},toString(){return R(this.toJSON())}},tl=(()=>{let e=Object.getOwnPropertyDescriptor(Error,`stackTraceLimit`);return e===void 0?Object.isExtensible(Error):Object.hasOwn(e,`writable`)?e.writable===!0:e.set!==void 0})(),nl=()=>Error.stackTraceLimit,rl=e=>{tl&&(Error.stackTraceLimit=e)},il=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})}},al=(()=>{let e=`~effect/Utils/internal`,t={[e]:e=>e()},n={[e]:e=>{try{return e()}finally{}}};return nl()!==0&&t[e](()=>Error().stack)?.includes(e)===!0?t[e]:n[e]})(),ol=`~effect/Effect`,sl=`~effect/Exit`,cl={_A:Ds,_E:Ds,_R:Ds},ll=`${ol}/identifier`,z=`${ol}/args`,ul=`${ol}/evaluate`,dl=`${ol}/successCont`,fl=`${ol}/failureCont`,pl=`${ol}/ensureCont`,ml=Symbol.for(`effect/Effect/Yield`),hl={pipe(){return ws(this,arguments)},toJSON(){return{...this}},toString(){return R(this.toJSON(),{ignoreToString:!0,space:2})},[Qc](){return this.toJSON()}},gl={[ol]:cl,...hl,[Symbol.iterator](){return new il(this)},toJSON(){return{_id:`Effect`,op:this[ll],...z in this?{args:this[z]}:void 0}}},_l=e=>Qs(e,sl),vl=`~effect/Cause`,yl=`~effect/Cause/Reason`,bl=e=>Qs(e,vl),xl=class{constructor(e){this[vl]=vl,this.reasons=e}pipe(){return ws(this,arguments)}toJSON(){return{_id:`Cause`,failures:this.reasons.map(e=>e.toJSON())}}toString(){return`Cause(${R(this.reasons)})`}[Qc](){return this.toJSON()}[_c](e){return bl(e)&&this.reasons.length===e.reasons.length&&this.reasons.every((t,n)=>vc(t,e.reasons[n]))}[$s](){return uc(this.reasons)}},Sl=new WeakMap,Cl=class{[yl];annotations;_tag;constructor(e,t,n){if(this[yl]=yl,this._tag=e,t!==wl&&typeof n==`object`&&n&&t.size>0){let e=Sl.get(n);e&&(t=new Map([...e,...t])),Sl.set(n,t)}this.annotations=t}annotate(e,t){if(e.mapUnsafe.size===0)return this;let n=new Map(this.annotations);e.mapUnsafe.forEach((e,r)=>{t?.overwrite!==!0&&n.has(r)||n.set(r,e)});let r=Object.assign(Object.create(Object.getPrototypeOf(this)),this);return r.annotations=n,r}pipe(){return ws(this,arguments)}toString(){return R(this)}[Qc](){return this.toString()}},wl=new Map,Tl=class extends Cl{constructor(e,t=wl){super(`Fail`,t,e),this.error=e}toString(){return`Fail(${R(this.error)})`}toJSON(){return{_tag:`Fail`,error:this.error}}[_c](e){return Nl(e)&&vc(this.error,e.error)&&vc(this.annotations,e.annotations)}[$s](){return nc(oc(this._tag))(nc(L(this.error))(L(this.annotations)))}},El=e=>new xl(e),Dl=(e,t)=>{let n=new Map,r=[];for(let i of e.concat(t)){let e=L(i),t=n.get(e);if(t===void 0)n.set(e,[i]);else if(t.some(e=>vc(e,i)))continue;else t.push(i);r.push(i)}return r},Ol=I(2,(e,t)=>{if(e.reasons.length===0)return t;if(t.reasons.length===0)return e;let n=new xl(Dl(e.reasons,t.reasons));return vc(e,n)?e:n}),kl=e=>new xl([new Tl(e)]),Al=class extends Cl{constructor(e,t=wl){super(`Die`,t,e),this.defect=e}toString(){return`Die(${R(this.defect)})`}toJSON(){return{_tag:`Die`,defect:this.defect}}[_c](e){return Pl(e)&&vc(this.defect,e.defect)&&vc(this.annotations,e.annotations)}[$s](){return nc(oc(this._tag))(nc(L(this.defect))(L(this.annotations)))}},jl=e=>new xl([new Al(e)]),Ml=I(e=>bl(e[0]),(e,t,n)=>t.mapUnsafe.size===0?e:new xl(e.reasons.map(e=>e.annotate(t,n)))),Nl=e=>e._tag===`Fail`,Pl=e=>e._tag===`Die`,Fl=e=>e._tag===`Interrupt`;function Il(e){return Gl(`Effect.evaluate: Not implemented`)}var Ll=e=>({...gl,[ll]:e.op,[ul]:e[ul]??Il,[dl]:e[dl],[fl]:e[fl],[pl]:e[pl]}),Rl=e=>{let t=Ll(e),n=function(e){this[z]=e};return n.prototype=t,function(e){return new n(e)}},zl=e=>{let t={[sl]:sl,_tag:e.op,get[e.prop](){return this[z]},...Ll(e),toString(){return`${e.op}(${R(this[z])})`},toJSON(){return{_id:`Exit`,_tag:e.op,[e.prop]:this[z]}},[_c](e){return _l(e)&&e._tag===this._tag&&vc(this[z],e[z])},[$s](){return nc(oc(e.op),L(this[z]))}},n=function(e){this[z]=e};return n.prototype=t,function(e){return new n(e)}},Bl=zl({op:`Success`,prop:`value`,[ul](e){let t=e.getCont(dl);return t?t[dl](this[z],e,this):e.yieldWith(this)}}),Vl={key:`effect/Cause/StackTrace`},Hl={key:`effect/Cause/InterruptorStackTrace`},Ul=zl({op:`Failure`,prop:`cause`,[ul](e){let t=this[z],n=!1;e.cache.stackFrame&&(t=Ml(t,{mapUnsafe:new Map([[Vl.key,e.cache.stackFrame]])}),n=!0);let r=e.getCont(fl),i=e._interruptedCause;if(i&&e.interruptible){let a=!1;for(;r&&e.interruptible;)a||=ll in r,r=e.getCont(fl);a&&(t=El(t.reasons.filter(e=>e._tag!==`Fail`))),t=Ol(t,i),n=!0}return r?r[fl](t,e,n?void 0:this):e.yieldWith(n?Ul(t):this)}}),Wl=e=>Ul(kl(e)),Gl=e=>Ul(jl(e)),Kl=Rl({op:`WithFiber`,[ul](e){return this[z](e)}}),ql=function(){class e extends globalThis.Error{}let t=Ll({op:`YieldableError`,[ul](){return Wl(this)}});return delete t.toString,Object.assign(e.prototype,t),e}(),Jl=function(){let e=Symbol.for(`effect/Data/Error/plainArgs`);return class extends ql{constructor(t){super(t?.message,t?.cause?{cause:t.cause}:void 0),t&&(Fc(this,t),Object.defineProperty(this,e,{value:t,enumerable:!1}))}toJSON(){return{...this[e],...this}}}}(),Yl=e=>{class t extends Jl{_tag=e}return t.prototype.name=e,t};Yl(`NoSuchElementError`);var Xl=`~effect/Option`,Zl={[Xl]:{_A:e=>e},...hl,[Symbol.iterator](){return new il(this)}},Ql=Object.defineProperty(Object.assign(Object.create(Zl),{_tag:`Some`,_op:`Some`,[_c](e){return tu(e)&&ru(e)&&vc(this.value,e.value)},[$s](){return nc(L(this._tag))(L(this.value))},toString(){return`some(${R(this.value)})`},toJSON(){return{_id:`Option`,_tag:this._tag,value:$c(this.value)}}}),"valueOrUndefined",{get(){return this.value}}),$l=L(`None`),eu=Object.assign(Object.create(Zl),{_tag:`None`,_op:`None`,valueOrUndefined:void 0,[_c](e){return tu(e)&&nu(e)},[$s](){return $l},toString(){return`none()`},toJSON(){return{_id:`Option`,_tag:this._tag}}}),tu=e=>Qs(e,Xl),nu=e=>e._tag===`None`,ru=e=>e._tag===`Some`,iu=Object.create(eu),au=function(e){this.value=e};au.prototype=Ql;var ou=e=>new au(e),su=`~effect/Result`,cu={[su]:{_A:e=>e,_E:e=>e},...hl,[Symbol.iterator](){return new il(this)}},lu=Object.assign(Object.create(cu),{_tag:`Success`,_op:`Success`,[_c](e){return du(e)&&pu(e)&&vc(this.success,e.success)},[$s](){return nc(L(this._tag))(L(this.success))},toString(){return`success(${R(this.success)})`},toJSON(){return{_id:`Result`,_tag:this._tag,value:$c(this.success)}}}),uu=Object.assign(Object.create(cu),{_tag:`Failure`,_op:`Failure`,[_c](e){return du(e)&&fu(e)&&vc(this.failure,e.failure)},[$s](){return nc(L(this._tag))(L(this.failure))},toString(){return`failure(${R(this.failure)})`},toJSON(){return{_id:`Result`,_tag:this._tag,failure:$c(this.failure)}}}),du=e=>Qs(e,su),fu=e=>e._tag===`Failure`,pu=e=>e._tag===`Success`,mu=function(e){this.failure=e};mu.prototype=uu;var hu=e=>new mu(e),gu=function(e){this.success=e};gu.prototype=lu;var _u=e=>new gu(e);function vu(e){return(t,n)=>t===n?0:e(t,n)}var yu=vu((e,t)=>e<t?-1:1),bu=vu((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),xu=e=>I(2,(t,n)=>e(t,n)===-1),Su=e=>I(2,(t,n)=>e(t,n)===1),Cu=e=>I(2,(t,n)=>e(t,n)!==1),wu=e=>I(2,(t,n)=>e(t,n)!==-1),Tu=()=>iu,Eu=ou,Du=nu,Ou=ru,ku=I(2,(e,{onNone:t,onSome:n})=>Du(e)?t():n(e.value)),Au=I(2,(e,t)=>Du(e)?t():e.value),ju=I(2,(e,t)=>Du(e)?t():e),Mu=Au(As),Nu=Au(js),Pu=I(2,(e,t)=>Du(e)?Tu():Eu(t(e.value))),Fu=_u,Iu=hu,Lu=fu,Ru=pu,zu=I(2,(e,t)=>Lu(e)?Iu(t(e.failure)):e),Bu=I(2,(e,{onFailure:t,onSuccess:n})=>Lu(e)?t(e.failure):n(e.success)),Vu=globalThis.Array,Hu=I(2,(e,t)=>[...e,t]);Vu.isArray;var Uu=Nc,Wu=Nc,Gu=()=>[],Ku=I(2,(e,t)=>e.map(t)),qu=`~effect/BigDecimal`,Ju={[qu]:qu,[$s](){let e=nd(this);return nc(oc(String(e.value)),ac(e.scale))},[_c](e){return Yu(e)&&sd(this,e)===0},toString(){return`BigDecimal(${ld(this)})`},toJSON(){return{_id:`BigDecimal`,value:String(this.value),scale:this.scale}},[Qc](){return this.toJSON()},pipe(){return ws(this,arguments)}},Yu=e=>Qs(e,qu),Xu=(e,t)=>{if(!Number.isSafeInteger(t))throw RangeError(`Scale must be a safe integer, got ${t}`);let n=Object.create(Ju);return n.value=e,n.scale=t,n},Zu=(e,t)=>{let n=Xu(e,t);return n.normalized=n,n},Qu=BigInt(0),$u=BigInt(1),ed=BigInt(10),td=Zu(Qu,0),nd=e=>{if(e.normalized===void 0){if(e.value===Qu)e.normalized=td;else{let t=`${e.value}`,n=t.length;for(;t[n-1]===`0`;)n--;e.normalized=Zu(BigInt(t.slice(0,n)),e.scale-(t.length-n))}}return e.normalized},rd=100,id=[$u],ad=(e,t)=>e===t?0:e<t?-1:1,od=(e,t)=>{let n=`${e.value<Qu?-e.value:e.value}`,r=`${t.value<Qu?-t.value:t.value}`,i=BigInt(n.length-r.length)-BigInt(e.scale)+BigInt(t.scale);if(i!==Qu)return i<Qu?-1:1;let a=Math.max(n.length,r.length);return yu(n.padEnd(a,`0`),r.padEnd(a,`0`))},sd=(e,t)=>{if(e.scale===t.scale)return ad(e.value,t.value);let n=cd(e),r=cd(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>rd)return n===-1?od(t,e):od(e,t);let o=id[a]??=ed**BigInt(a);return i>0?ad(e.value,t.value*o):ad(e.value*o,t.value)},cd=e=>e.value===Qu?0:e.value<Qu?-1:1,ld=e=>{let t=nd(e);if(Math.abs(t.scale)>=16)return ud(t);let n=t.value<Qu,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},ud=e=>{if(dd(e))return`0e+0`;let t=nd(e),n=`${t.value}`,r=t.value<Qu?2:1,i=n.slice(0,r),a=n.slice(r),o=a.length-t.scale;return`${i}${a===``?``:`.${a}`}e${o>=0?`+`:``}${o}`},dd=e=>e.value===Qu,fd=e=>Ll({op:e.label,[ul]:e.evaluate}),pd=`~effect/Context/Service`,md=function(){function e(){}let t=e;Object.setPrototypeOf(t,hd);let n=(e,n)=>(t.key=e,n?.defaultValue&&(t[_d]=_d,t.defaultValue=n.defaultValue),n?.make&&(t.make=n.make),n?.fiberCached&&gd.add(e),t);return arguments.length>0?n(arguments[0],arguments[1]):n},hd={[pd]:pd,...fd({label:`Service`,evaluate(e){return Bl(Ld(e.context,this))}}),toJSON(){return{_id:`Service`,key:this.key}},of(e){return e},context(e){return Nd(this,e)},use(e){return Kl(t=>e(Ld(t.context,this)))},useSync(e){return Kl(t=>Bl(e(Ld(t.context,this))))}},gd=new Set,_d=`~effect/Context/Reference`,vd=`~effect/Context`,yd=8,bd=8,xd=(e,t,n,r)=>{let i=Object.create(Dd);return i.cacheRoot=e??i,i.base=t,i.overlay=n,i.depth=r,i._flat=void 0,i.baseHits=0,i},Sd=(e,t)=>{t&&(Sd(e,t.parent),e.set(t.key,t.value))},Cd=e=>{if(e._flat)return e._flat;if(!e.overlay)return e._flat=e.base;let t=new Map(e.base);return Sd(t,e.overlay),e._flat=t},wd=Symbol(),Td=(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)?wd:(n.overlay&&++n.baseHits>=n.base.size&&n.baseHits>=bd&&(n.base=Cd(n),n.overlay=void 0,n.depth=0),r)},Ed=e=>xd(void 0,e,void 0,0),Dd={get mapUnsafe(){return Cd(this)},...hl,[vd]:{_Services:e=>e},toJSON(){return{_id:`Context`,services:Array.from(this.mapUnsafe).map(([e,t])=>({key:e,value:t}))}},[_c](e){if(!kd(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)||!vc(r,n.get(e)))return!1;return!0},[$s](){return ac(this.mapUnsafe.size)}},Od=(e,t)=>e.cacheRoot===t.cacheRoot,kd=e=>Qs(e,vd),Ad=e=>!!e[_d],jd=()=>Md,Md=Ed(new Map),Nd=(e,t)=>Ed(new Map([[e.key,t]])),Pd=I(3,(e,t,n)=>Fd(e,t.key,n)),Fd=(e,t,n)=>{let r=e,i=gd.has(t)?void 0:r.cacheRoot;if(r.depth>=yd){let e=new Map(r.mapUnsafe);return e.set(t,n),xd(i,e,void 0,0)}return xd(i,r.base,{key:t,value:n,parent:r.overlay},r.depth+1)},Id=(e,t)=>{let n=Td(e,t);return n===wd?void 0:n},Ld=I(2,(e,t)=>{let n=Td(e,t.key);if(n===wd){if(Ad(t))return zd(t);throw Bd(t)}return n}),Rd=`~effect/Context/defaultValue`,zd=e=>Rd in e?e[Rd]:e[Rd]=e.defaultValue(),Bd=e=>{let t=Error(`Service not found${e.key?`: ${String(e.key)}`:``}`);if(t.stack){let e=t.stack.split(`
64
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function vi(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:xi(t,`input`,e.processors),output:xi(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function yi(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return yi(r.element,n);if(r.type===`set`)return yi(r.valueType,n);if(r.type===`lazy`)return yi(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`)return yi(r.innerType,n);if(r.type===`intersection`)return yi(r.left,n)||yi(r.right,n);if(r.type===`record`||r.type===`map`)return yi(r.keyType,n)||yi(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:yi(r.in,n)||yi(r.out,n);if(r.type===`object`){for(let e in r.shape)if(yi(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(yi(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(yi(e,n))return!0;return!!(r.rest&&yi(r.rest,n))}return!1}var bi=(e,t={})=>n=>{let r=gi({...n,processors:t});return O(e,r),_i(r,e),vi(r,e)},xi=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=gi({...i??{},target:a,io:t,processors:n});return O(e,o),_i(o,e),vi(o,e)},Si={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Ci=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Si[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},wi=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;i.type=typeof s==`string`&&s.includes(`int`)?`integer`:`number`;let d=typeof u==`number`&&u>=(a??-1/0),f=typeof l==`number`&&l<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;d?p?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof o==`number`&&(i.maximum=o),typeof c==`number`&&(i.multipleOf=c)},Ti=(e,t,n,r)=>{n.type=`boolean`},Ei=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},Di=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Void cannot be represented in JSON Schema`)},Oi=(e,t,n,r)=>{n.not={}},ki=(e,t,n,r)=>{let i=e._zod.def,a=d(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},Ai=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},ji=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},Mi=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Function types cannot be represented in JSON Schema`)},Ni=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},Pi=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=O(a.element,t,{...r,path:[...r.path,`items`]})},Fi=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=O(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=O(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Ii=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>O(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Li=(e,t,n,r)=>{let i=e._zod.def,a=O(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=O(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},Ri=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`array`;let o=t.target===`draft-2020-12`?`prefixItems`:`items`,s=t.target===`draft-2020-12`||t.target===`openapi-3.0`?`items`:`additionalItems`,c=a.items.map((e,n)=>O(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?O(a.rest,t,{...r,path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]}):null;t.target===`draft-2020-12`?(i.prefixItems=c,l&&(i.items=l)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),i.minItems=c.length,l||(i.maxItems=c.length)):(i.items=c,l&&(i.additionalItems=l));let{minimum:u,maximum:d}=e._zod.bag;typeof u==`number`&&(i.minItems=u),typeof d==`number`&&(i.maxItems=d)},zi=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=O(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else(t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=O(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=O(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},Bi=(e,t,n,r)=>{let i=e._zod.def,a=O(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},Vi=(e,t,n,r)=>{let i=e._zod.def;O(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Hi=(e,t,n,r)=>{let i=e._zod.def;O(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},Ui=(e,t,n,r)=>{let i=e._zod.def;O(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},Wi=(e,t,n,r)=>{let i=e._zod.def;O(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},Gi=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;O(o,t,r);let s=t.seen.get(e);s.ref=o},Ki=(e,t,n,r)=>{let i=e._zod.def;O(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},qi=(e,t,n,r)=>{let i=e._zod.def;O(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Ji=(e,t,n,r)=>{let i=e._zod.def;O(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Yi=(e,t,n,r)=>{let i=e._zod.innerType;O(i,t,r);let a=t.seen.get(e);a.ref=i},Xi=o(`ZodISODateTime`,(e,t)=>{Qt.init(e,t),xa.init(e,t)});function Zi(e){return Pr(Xi,e)}var Qi=o(`ZodISODate`,(e,t)=>{$t.init(e,t),xa.init(e,t)});function $i(e){return Fr(Qi,e)}var ea=o(`ZodISOTime`,(e,t)=>{en.init(e,t),xa.init(e,t)});function ta(e){return Ir(ea,e)}var na=o(`ZodISODuration`,(e,t)=>{tn.init(e,t),xa.init(e,t)});function ra(e){return Lr(na,e)}var ia=o(`ZodError`,(e,t)=>{Ce.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>Ee(e,t)},flatten:{value:t=>Te(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,f,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,f,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),aa=De(ia),oa=ke(ia),sa=je(ia),ca=Ne(ia),la=Fe(ia),ua=Ie(ia),da=Le(ia),fa=Re(ia),pa=ze(ia),ma=Be(ia),ha=Ve(ia),ga=He(ia),_a=new WeakMap;function va(e,t,n){let r=Object.getPrototypeOf(e),i=_a.get(r);if(i||(i=new Set,_a.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}var k=o(`ZodType`,(e,t)=>(E.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:xi(e,`input`),output:xi(e,`output`)}}),e.toJSONSchema=bi(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>aa(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>sa(e,t,n),e.parseAsync=async(t,n)=>oa(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>ca(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>la(e,t,n),e.decode=(t,n)=>ua(e,t,n),e.encodeAsync=async(t,n)=>da(e,t,n),e.decodeAsync=async(t,n)=>fa(e,t,n),e.safeEncode=(t,n)=>pa(e,t,n),e.safeDecode=(t,n)=>ma(e,t,n),e.safeEncodeAsync=async(t,n)=>ha(e,t,n),e.safeDecodeAsync=async(t,n)=>ga(e,t,n),va(e,`ZodType`,{check(...e){let t=this.def;return this.clone(b(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return C(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Xo(e,t))},superRefine(e,t){return this.check(Zo(e,t))},overwrite(e){return this.check(ai(e))},optional(){return To(this)},exactOptional(){return Do(this)},nullable(){return ko(this)},nullish(){return To(ko(this))},nonoptional(e){return Fo(this,e)},array(){return io(this)},or(e){return lo([this,e])},and(e){return mo(this,e)},transform(e){return zo(this,Co(e))},default(e){return jo(this,e)},prefault(e){return No(this,e)},catch(e){return Lo(this,e)},pipe(e){return zo(this,e)},readonly(){return Vo(this)},describe(e){let t=this.clone();return ur.add(t,{description:e}),t},meta(...e){if(e.length===0)return ur.get(this);let t=this.clone();return ur.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get(){return ur.get(e)?.description},configurable:!0}),e)),ya=o(`_ZodString`,(e,t)=>{Bt.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ci(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,va(e,`_ZodString`,{regex(...e){return this.check($r(...e))},includes(...e){return this.check(ni(...e))},startsWith(...e){return this.check(ri(...e))},endsWith(...e){return this.check(ii(...e))},min(...e){return this.check(Zr(...e))},max(...e){return this.check(Xr(...e))},length(...e){return this.check(Qr(...e))},nonempty(...e){return this.check(Zr(1,...e))},lowercase(e){return this.check(ei(e))},uppercase(e){return this.check(ti(e))},trim(){return this.check(si())},normalize(...e){return this.check(oi(...e))},toLowerCase(){return this.check(ci())},toUpperCase(){return this.check(li())},slugify(){return this.check(ui())}})}),ba=o(`ZodString`,(e,t)=>{Bt.init(e,t),ya.init(e,t),e.email=t=>e.check(fr(Sa,t)),e.url=t=>e.check(vr(Ea,t)),e.jwt=t=>e.check(Nr(Ha,t)),e.emoji=t=>e.check(yr(Oa,t)),e.guid=t=>e.check(pr(Ca,t)),e.uuid=t=>e.check(mr(wa,t)),e.uuidv4=t=>e.check(hr(wa,t)),e.uuidv6=t=>e.check(gr(wa,t)),e.uuidv7=t=>e.check(_r(wa,t)),e.nanoid=t=>e.check(br(ka,t)),e.guid=t=>e.check(pr(Ca,t)),e.cuid=t=>e.check(xr(Aa,t)),e.cuid2=t=>e.check(Sr(ja,t)),e.ulid=t=>e.check(Cr(Ma,t)),e.base64=t=>e.check(Ar(za,t)),e.base64url=t=>e.check(jr(Ba,t)),e.xid=t=>e.check(wr(Na,t)),e.ksuid=t=>e.check(Tr(Pa,t)),e.ipv4=t=>e.check(Er(Fa,t)),e.ipv6=t=>e.check(Dr(Ia,t)),e.cidrv4=t=>e.check(Or(La,t)),e.cidrv6=t=>e.check(kr(Ra,t)),e.e164=t=>e.check(Mr(Va,t)),e.datetime=t=>e.check(Zi(t)),e.date=t=>e.check($i(t)),e.time=t=>e.check(ta(t)),e.duration=t=>e.check(ra(t))});function A(e){return dr(ba,e)}var xa=o(`ZodStringFormat`,(e,t)=>{D.init(e,t),ya.init(e,t)}),Sa=o(`ZodEmail`,(e,t)=>{Ut.init(e,t),xa.init(e,t)}),Ca=o(`ZodGUID`,(e,t)=>{Vt.init(e,t),xa.init(e,t)}),wa=o(`ZodUUID`,(e,t)=>{Ht.init(e,t),xa.init(e,t)});function Ta(e){return mr(wa,e)}var Ea=o(`ZodURL`,(e,t)=>{Wt.init(e,t),xa.init(e,t)});function Da(e){return vr(Ea,e)}var Oa=o(`ZodEmoji`,(e,t)=>{Gt.init(e,t),xa.init(e,t)}),ka=o(`ZodNanoID`,(e,t)=>{Kt.init(e,t),xa.init(e,t)}),Aa=o(`ZodCUID`,(e,t)=>{qt.init(e,t),xa.init(e,t)}),ja=o(`ZodCUID2`,(e,t)=>{Jt.init(e,t),xa.init(e,t)}),Ma=o(`ZodULID`,(e,t)=>{Yt.init(e,t),xa.init(e,t)}),Na=o(`ZodXID`,(e,t)=>{Xt.init(e,t),xa.init(e,t)}),Pa=o(`ZodKSUID`,(e,t)=>{Zt.init(e,t),xa.init(e,t)}),Fa=o(`ZodIPv4`,(e,t)=>{nn.init(e,t),xa.init(e,t)}),Ia=o(`ZodIPv6`,(e,t)=>{rn.init(e,t),xa.init(e,t)}),La=o(`ZodCIDRv4`,(e,t)=>{an.init(e,t),xa.init(e,t)}),Ra=o(`ZodCIDRv6`,(e,t)=>{on.init(e,t),xa.init(e,t)}),za=o(`ZodBase64`,(e,t)=>{cn.init(e,t),xa.init(e,t)}),Ba=o(`ZodBase64URL`,(e,t)=>{un.init(e,t),xa.init(e,t)}),Va=o(`ZodE164`,(e,t)=>{dn.init(e,t),xa.init(e,t)}),Ha=o(`ZodJWT`,(e,t)=>{pn.init(e,t),xa.init(e,t)}),Ua=o(`ZodNumber`,(e,t)=>{mn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wi(e,t,n,r),va(e,`ZodNumber`,{gt(e,t){return this.check(qr(e,t))},gte(e,t){return this.check(Jr(e,t))},min(e,t){return this.check(Jr(e,t))},lt(e,t){return this.check(Gr(e,t))},lte(e,t){return this.check(Kr(e,t))},max(e,t){return this.check(Kr(e,t))},int(e){return this.check(Ka(e))},safe(e){return this.check(Ka(e))},positive(e){return this.check(qr(0,e))},nonnegative(e){return this.check(Jr(0,e))},negative(e){return this.check(Gr(0,e))},nonpositive(e){return this.check(Kr(0,e))},multipleOf(e,t){return this.check(Yr(e,t))},step(e,t){return this.check(Yr(e,t))},finite(){return this}});let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function Wa(e){return Rr(Ua,e)}var Ga=o(`ZodNumberFormat`,(e,t)=>{hn.init(e,t),Ua.init(e,t)});function Ka(e){return zr(Ga,e)}var qa=o(`ZodBoolean`,(e,t)=>{gn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ti(e,t,n,r)});function Ja(e){return Br(qa,e)}var Ya=o(`ZodNull`,(e,t)=>{_n.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ei(e,t,n,r)});function Xa(e){return Vr(Ya,e)}var Za=o(`ZodUnknown`,(e,t)=>{vn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Qa(){return Hr(Za)}var $a=o(`ZodNever`,(e,t)=>{yn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Oi(e,t,n,r)});function eo(e){return Ur($a,e)}var to=o(`ZodVoid`,(e,t)=>{bn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Di(e,t,n,r)});function no(e){return Wr(to,e)}var ro=o(`ZodArray`,(e,t)=>{Sn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Pi(e,t,n,r),e.element=t.element,va(e,`ZodArray`,{min(e,t){return this.check(Zr(e,t))},nonempty(e){return this.check(Zr(1,e))},max(e,t){return this.check(Xr(e,t))},length(e,t){return this.check(Qr(e,t))},unwrap(){return this.element}})});function io(e,t){return di(ro,e,t)}var ao=o(`ZodObject`,(e,t)=>{Dn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fi(e,t,n,r),v(e,`shape`,()=>t.shape),va(e,`ZodObject`,{keyof(){return bo(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:Qa()})},loose(){return this.clone({...this._zod.def,catchall:Qa()})},strict(){return this.clone({...this._zod.def,catchall:eo()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return ue(this,e)},safeExtend(e){return de(this,e)},merge(e){return fe(this,e)},pick(e){return T(this,e)},omit(e){return le(this,e)},partial(...e){return pe(wo,this,e[0])},required(...e){return me(Po,this,e[0])}})});function j(e,t){return new ao({type:`object`,shape:e??{},...w(t)})}function oo(e,t){return new ao({type:`object`,shape:e,catchall:eo(),...w(t)})}function so(e,t){return new ao({type:`object`,shape:e,catchall:Qa(),...w(t)})}var co=o(`ZodUnion`,(e,t)=>{kn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ii(e,t,n,r),e.options=t.options});function lo(e,t){return new co({type:`union`,options:e,...w(t)})}var uo=o(`ZodDiscriminatedUnion`,(e,t)=>{co.init(e,t),An.init(e,t)});function fo(e,t,n){return new uo({type:`union`,options:t,discriminator:e,...w(n)})}var po=o(`ZodIntersection`,(e,t)=>{jn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Li(e,t,n,r)});function mo(e,t){return new po({type:`intersection`,left:e,right:t})}var ho=o(`ZodTuple`,(e,t)=>{Pn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ri(e,t,n,r),e.rest=t=>e.clone({...e._zod.def,rest:t})});function go(e,t,n){let r=t instanceof E;return new ho({type:`tuple`,items:e,rest:r?t:null,...w(r?n:t)})}var _o=o(`ZodRecord`,(e,t)=>{Rn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zi(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function vo(e,t,n){return!t||!t._zod?new _o({type:`record`,keyType:A(),valueType:e,...w(t)}):new _o({type:`record`,keyType:e,valueType:t,...w(n)})}var yo=o(`ZodEnum`,(e,t)=>{zn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ki(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new yo({...t,checks:[],...w(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new yo({...t,checks:[],...w(r),entries:i})}});function bo(e,t){return new yo({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...w(t)})}var xo=o(`ZodLiteral`,(e,t)=>{Bn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ai(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function M(e,t){return new xo({type:`literal`,values:Array.isArray(e)?e:[e],...w(t)})}var So=o(`ZodTransform`,(e,t)=>{Vn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ni(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new c(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(xe(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(xe(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}});function Co(e){return new So({type:`transform`,transform:e})}var wo=o(`ZodOptional`,(e,t)=>{Un.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ji(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function To(e){return new wo({type:`optional`,innerType:e})}var Eo=o(`ZodExactOptional`,(e,t)=>{Wn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ji(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Do(e){return new Eo({type:`optional`,innerType:e})}var Oo=o(`ZodNullable`,(e,t)=>{Gn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ko(e){return new Oo({type:`nullable`,innerType:e})}var Ao=o(`ZodDefault`,(e,t)=>{Kn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Hi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function jo(e,t){return new Ao({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():S(t)}})}var Mo=o(`ZodPrefault`,(e,t)=>{Jn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ui(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function No(e,t){return new Mo({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():S(t)}})}var Po=o(`ZodNonOptional`,(e,t)=>{Yn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Fo(e,t){return new Po({type:`nonoptional`,innerType:e,...w(t)})}var Io=o(`ZodCatch`,(e,t)=>{Zn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Lo(e,t){return new Io({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var Ro=o(`ZodPipe`,(e,t)=>{Qn.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Gi(e,t,n,r),e.in=t.in,e.out=t.out});function zo(e,t){return new Ro({type:`pipe`,in:e,out:t})}var Bo=o(`ZodReadonly`,(e,t)=>{er.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ki(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Vo(e){return new Bo({type:`readonly`,innerType:e})}var Ho=o(`ZodLazy`,(e,t)=>{ir.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Yi(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function Uo(e){return new Ho({type:`lazy`,getter:e})}var Wo=o(`ZodPromise`,(e,t)=>{rr.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Go(e){return new Wo({type:`promise`,innerType:e})}var Ko=o(`ZodFunction`,(e,t)=>{nr.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mi(e,t,n,r)});function qo(e){return new Ko({type:`function`,input:Array.isArray(e?.input)?go(e?.input):e?.input??io(Qa()),output:e?.output??Qa()})}var Jo=o(`ZodCustom`,(e,t)=>{ar.init(e,t),k.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ji(e,t,n,r)});function Yo(e,t){return fi(Jo,e??(()=>!0),t)}function Xo(e,t={}){return pi(Jo,e,t)}function Zo(e,t){return mi(e,t)}function Qo(e,t={}){let n=new Jo({type:`custom`,check:`custom`,fn:t=>t instanceof e,abort:!0,...w(t)});return n._zod.bag.Class=e,n._zod.check=t=>{t.value instanceof e||t.issues.push({code:`invalid_type`,expected:e.name,input:t.value,inst:n,path:[...n._zod.def.path??[]]})},n}function $o(e){let t=Uo(()=>lo([A(e),Wa(),Ja(),Xa(),io(t),vo(A(),t)]));return t}var N=e(i(),1),es=$o(),ts=Uo(()=>fo(`status`,[j({status:M(`available`)}).strict(),j({status:M(`unavailable`),reason:A()}).strict()])),ns=es,rs=Uo(()=>vo(A(),ns)),is=e=>ns.parse(e),as=Uo(()=>j({code:A().min(1).max(160),message:A().min(1).max(512),details:ns.optional()}).strict()),os=e=>as.parse(e),ss=rs,cs=Uo(()=>A().refine(e=>e.trim().length>0)),ls=ts,us=Uo(()=>lo([j({type:M(`action`)}).strict(),j({type:M(`custom`),data:rs}).strict(),j({type:M(`choice`),options:io(j({value:ns,label:cs,description:cs.optional()}))}).strict(),j({type:M(`form`),submitLabel:cs.optional()}).strict(),j({type:M(`confirmation`),message:cs,confirmLabel:cs.optional(),cancelLabel:cs.optional()}).strict()])),ds=Uo(()=>j({inputSchema:ss.optional(),outputSchema:ss.optional(),presentation:us.optional()}).strict()),fs=Uo(()=>Wa().int().refine(e=>Number.isSafeInteger(e))),ps=Uo(()=>j({hint:cs.pipe(A().max(120)),words:io(j({word:A().regex(/^\S{1,64}$/u),description:cs.pipe(A().max(512)).optional(),arguments:rs}).strict()).max(32).optional(),text:j({field:cs.pipe(A().max(120)),arguments:rs,requestIdField:cs.pipe(A().max(120)).optional()}).strict().optional()}).strict().refine(e=>e.words!==void 0||e.text!==void 0,`slash arguments need words or text`)),ms=Uo(()=>j({order:fs.optional()}).strict()),hs=Uo(()=>j({bindings:j({order:fs.optional(),values:io(cs).max(16)}).strict().optional(),agent:j({keybind:cs.optional(),order:fs.optional()}).strict().optional(),help:ms.optional(),menu:ms.optional(),palette:ms.optional(),slash:j({aliases:io(cs).max(16),consumesDraft:Ja().optional(),order:fs.optional(),arguments:ps.optional()}).strict().optional()}).strict()),gs=Uo(()=>j({id:cs.refine(e=>!e.includes(`:`)),title:cs,category:cs,description:cs.optional(),projections:hs.optional(),action:ds.optional(),availability:ls.optional()}).strict()),_s=e=>gs.parse(e),vs=Uo(()=>j({inputSchema:ss.optional(),outputSchema:ss.optional()}).strict()),ys=A().min(1).brand();Uo(()=>j({commandId:ys,command:j({namespace:A(),id:A()}).strict(),sourceId:A(),scope:A().optional(),title:A(),category:A(),description:A().optional(),order:Wa(),availability:ts,action:vs.optional(),keybind:A().optional()}).strict());var bs=8192,P=cs.pipe(A().max(bs)),xs=cs.pipe(A().max(60)),Ss=Da({protocol:/^https?$/u}),Cs=j({label:P,value:P}).strict(),ws={summary:P.optional(),facts:io(Cs).max(4).optional(),body:P.optional(),bodyLabel:P.optional(),details:io(Cs).max(24).optional()};fo(`type`,[j({type:M(`choice`),message:xs,...ws,current:P.optional(),collapsedGroup:P.optional(),options:io(j({value:P,label:P,description:P.optional(),group:P.optional(),destructive:M(!0).optional()}).strict()).min(1).max(256)}).strict(),j({type:M(`text`),message:xs,...ws,placeholder:P.optional(),secret:Ja().optional()}).strict(),j({type:M(`confirmation`),message:xs,...ws,confirmLabel:P.optional(),cancelLabel:P.optional(),destructive:M(!0).optional()}).strict(),j({type:M(`decision`),message:xs,...ws,options:io(j({value:P,label:P,description:P.optional(),destructive:M(!0).optional()}).strict()).min(1).max(8).refine(e=>new Set(e.map(e=>e.value)).size===e.length,`Decision option values must be unique`),multiple:Ja().optional(),other:j({label:P,placeholder:P.optional(),maxLength:Wa().int().min(1).max(bs),blank:P.optional()}).strict().optional(),escape:P.optional()}).strict().refine(e=>[e.escape,e.other?.blank].every(t=>t===void 0||e.options.some(e=>e.value===t)),`A decision's escape and blank answers must be offered options`)]),Uo(()=>fo(`type`,[j({type:M(`info`),message:P,links:io(j({url:Ss,label:P.optional()}).strict()).max(16).optional()}).strict(),j({type:M(`progress`),message:P}).strict(),j({type:M(`handoff`),url:Ss,code:P.optional(),message:P.optional()}).strict(),j({type:M(`success`),message:P}).strict()]));var Ts=(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}}},Es={pipe(){return Ts(this,arguments)}},Ds=function(){function e(){}return e.prototype=Es,e}(),F=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)}}}},Os=e=>e,ks=e=>()=>e,As=ks(!0),js=ks(null),Ms=ks(void 0),Ns=Ms;function Ps(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 Fs(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 Is(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 Ls=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},Rs=new WeakSet,zs=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),Bs=0,Vs=()=>{Bs++};function Hs(e){return typeof e==`string`}function Us(e){return typeof e==`number`}function Ws(e){return typeof e==`boolean`}function Gs(e){return typeof e==`symbol`}function Ks(e){return Hs(e)||Us(e)||Gs(e)}function qs(e){return typeof e==`function`}function Js(e){return e===void 0}function Ys(e){return e!=null}function Xs(e){return!0}function Zs(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Qs(e){return typeof e==`object`&&!!e||qs(e)}var $s=F(2,(e,t)=>Qs(e)&&t in e),ec=`~effect/Hash`,I=e=>{switch(typeof e){case`number`:return oc(e);case`bigint`:return sc(e.toString(10));case`string`:return sc(e);case`function`:case`object`:if(e===null)break;if(e instanceof Date)return Number.isNaN(e.getTime())?sc(`Invalid Date`):sc(e.toISOString());if(e instanceof RegExp)return sc(e.toString());{if(Rs.has(e))return tc(e);let t=gc.get(e);if(t!==void 0)return t;if(_c.has(e))return Vs(),sc(`[Circular]`);_c.add(e);let n=Bs,r;try{r=`~effect/Hash`in e?e[ec]():typeof e==`function`?tc(e):e instanceof DataView?dc(zs(e)):Array.isArray(e)||ArrayBuffer.isView(e)?dc(e):e instanceof Map?fc(e):e instanceof Set?mc(e):lc(e)}finally{_c.delete(e)}return n===Bs&&gc.set(e,r),r}}return ic(nc(sc(String(e))))},tc=e=>(hc.has(e)||hc.set(e,ic(Math.random()*4294967296|0)),hc.get(e)),nc=e=>(e^=e>>>16,e=Math.imul(e,2246822507),e^=e>>>13,e=Math.imul(e,3266489909),e^e>>>16),rc=F(2,(e,t)=>nc(Math.imul(e,2654435761)+Math.imul(t,2246822507))),ic=e=>e&3221225471|e>>>1&1073741824,ac=new DataView(new ArrayBuffer(8)),oc=e=>{let t=e|0;return t===e?ic(t):(ac.setFloat64(0,e===e?e:NaN),ic(rc(ac.getInt32(0),ac.getInt32(4))))},sc=e=>{let t=5381,n=e.length;for(;n;)t=t*33^e.charCodeAt(--n);return ic(t)},cc=(e,t)=>{let n=12289;for(let r of t)n^=rc(I(r),I(e[r]));return ic(n)},lc=e=>cc(e,Ls(e)),uc=(e,t)=>n=>{let r=e;for(let e of n)r^=t(e);return ic(r)},dc=e=>{let t=6151;for(let n of e)t=rc(t,I(n));return ic(t)},fc=uc(sc(`Map`),([e,t])=>rc(I(e),I(t))),pc=sc(`Set`),mc=uc(pc,e=>rc(pc,I(e))),hc=new WeakMap,gc=new WeakMap,_c=new WeakSet,vc=`~effect/Equal`;function yc(){return arguments.length===1?e=>bc(e,arguments[0]):bc(arguments[0],arguments[1])}function bc(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`||Rs.has(e)||Rs.has(t)?!1:xc(e,t):!1}function xc(e,t){let n=Cc.length;for(let r=n;r-->0;)if(Cc[r]===e&&wc[r]===t)return!0;if(n)return Sc(e,t);let r=Tc.get(e);r||Tc.set(e,r=new WeakMap);let i=r.get(t);return i===void 0&&r.set(t,i=Sc(e,t)),i}function Sc(e,t){Cc.push(e),wc.push(t);try{return Ec(e,t)}finally{Cc.pop(),wc.pop()}}var Cc=[],wc=[],Tc=new WeakMap;function Ec(e,t){if(I(e)!==I(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=Nc(e);if(n!==Nc(t)||typeof e==`function`&&!n)return!1;if(n)return e[vc](t);if(Array.isArray(e))return!Array.isArray(t)||e.length!==t.length?!1:Dc(e,t);if(ArrayBuffer.isView(e)){let n=e instanceof DataView;return!ArrayBuffer.isView(t)||e.byteLength!==t.byteLength||n!==t instanceof DataView?!1:n?Oc(zs(e),zs(t)):Oc(e,t)}return e instanceof Map?!(t instanceof Map)||e.size!==t.size?!1:Ac(e,t,jc,Mc):e instanceof Set?!(t instanceof Set)||e.size!==t.size?!1:Ac(e,t,I,bc):kc(e,t)}function Dc(e,t){for(let n=0;n<e.length;n++)if(!bc(e[n],t[n]))return!1;return!0}function Oc(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 kc(e,t){let n=Ls(e),r=Ls(t);if(n.size!==r.size)return!1;for(let i of n)if(!r.has(i)||!bc(e[i],t[i]))return!1;return!0}function Ac(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 jc=e=>I(e[0]),Mc=(e,t)=>bc(e[0],t[0])&&bc(e[1],t[1]),Nc=e=>$s(e,vc),Pc=e=>e.length>0;function Fc(e,t,n){t===`__proto__`?Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0}):e[t]=n}function Ic(e,t){for(let n of Reflect.ownKeys(t))Object.prototype.propertyIsEnumerable.call(t,n)&&Fc(e,n,t[n])}var Lc=Symbol.for(`~effect/Redactable`),Rc=e=>$s(e,Lc);function zc(e){return Rc(e)?Bc(e):e}function Bc(e){return e[Lc](globalThis[`~effect/Fiber/currentFiber`]?.context??Uc)}var Vc=`~effect/Fiber/currentFiber`,Hc=new Map,Uc={"~effect/Context":{},base:Hc,depth:0,mapUnsafe:Hc,pipe(){return Ts(this,arguments)}};function L(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 Wc;r.add(e);let l;if(Lc in e)l=c(Bc(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(`,
65
+ `+a(n+1))}\n${a(n)}]`;else if(e instanceof Date)l=qc(e);else if(!t?.ignoreToString&&$s(e,`toString`)&&typeof e.toString==`function`&&e.toString!==Object.prototype.toString&&e.toString!==Array.prototype.toString){let t=Jc(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=>`${Gc(t)}:${c(Yc(e,t),n)}`).join(`,`)}}`;l=o(e,r)}else{let r=`{\n${t.map(t=>`${a(n+1)}${Gc(t)}: ${c(Yc(e,t),n+1)}`).join(`,
66
+ `)}\n${a(n)}}`;l=o(e,r)}}return r.delete(e),l}return String(e)}return c(e,0)}var Wc=`[Circular]`;function Gc(e){return typeof e==`string`?JSON.stringify(e):String(e)}function Kc(e){return e.map(e=>`[${Gc(e)}]`).join(``)}function qc(e){try{return e.toISOString()}catch{return`Invalid Date`}}function Jc(e){try{let t=e.toString();return typeof t==`string`?t:String(t)}catch{return`[toString threw]`}}function Yc(e,t){try{return e[t]}catch{return`[property access threw]`}}function Xc(e,t){let n=[];return JSON.stringify(e,function(e,t){let r=Object.getOwnPropertyDescriptor(this,e)?.value,i=$s(r,Lc)?zc(r):zc(t);if(typeof i==`bigint`)return L(i);if(typeof i!=`object`||!i)return i;let a=i instanceof Error&&!$s(i,`toJSON`)?{...i,name:i.name,message:i.message}:i;for(;n.length>0&&n[n.length-1]!==this;)n.pop();if(n.includes(i))return;if(n.push(i),a!==i&&n.push(a),!Zc(a)||Qc(a))return a;let o=new Proxy(a,{get(e,t){let n=Reflect.get(e,t,e);return Object.getOwnPropertyDescriptor(e,t)?.get===void 0?n:zc(n)}});return n.push(o),o},t?.space)??`null`}function Zc(e){for(let t of Object.getOwnPropertyNames(e))if(Object.getOwnPropertyDescriptor(e,t)?.get!==void 0)return!0;return!1}function Qc(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 $c=Symbol.for(`nodejs.util.inspect.custom`),el=e=>{try{return e=zc(e),$s(e,`toJSON`)&&qs(e.toJSON)&&e.toJSON.length===0?e.toJSON():Array.isArray(e)?e.map(el):e}catch{return`[toJSON threw]`}},tl={toJSON(){return el(this)},[$c](){return this.toJSON()},toString(){return L(this.toJSON())}},nl=(()=>{let e=Object.getOwnPropertyDescriptor(Error,`stackTraceLimit`);return e===void 0?Object.isExtensible(Error):Object.hasOwn(e,`writable`)?e.writable===!0:e.set!==void 0})(),rl=()=>Error.stackTraceLimit,il=e=>{nl&&(Error.stackTraceLimit=e)},al=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})}},ol=(()=>{let e=`~effect/Utils/internal`,t={[e]:e=>e()},n={[e]:e=>{try{return e()}finally{}}};return rl()!==0&&t[e](()=>Error().stack)?.includes(e)===!0?t[e]:n[e]})(),sl=`~effect/Effect`,cl=`~effect/Exit`,ll={_A:Os,_E:Os,_R:Os},ul=`${sl}/identifier`,R=`${sl}/args`,dl=`${sl}/evaluate`,fl=`${sl}/successCont`,pl=`${sl}/failureCont`,ml=`${sl}/ensureCont`,hl=Symbol.for(`effect/Effect/Yield`),gl={pipe(){return Ts(this,arguments)},toJSON(){return{...this}},toString(){return L(this.toJSON(),{ignoreToString:!0,space:2})},[$c](){return this.toJSON()}},_l={[sl]:ll,...gl,[Symbol.iterator](){return new al(this)},toJSON(){return{_id:`Effect`,op:this[ul],...R in this?{args:this[R]}:void 0}}},vl=e=>$s(e,cl),yl=`~effect/Cause`,bl=`~effect/Cause/Reason`,xl=e=>$s(e,yl),Sl=class{constructor(e){this[yl]=yl,this.reasons=e}pipe(){return Ts(this,arguments)}toJSON(){return{_id:`Cause`,failures:this.reasons.map(e=>e.toJSON())}}toString(){return`Cause(${L(this.reasons)})`}[$c](){return this.toJSON()}[vc](e){return xl(e)&&this.reasons.length===e.reasons.length&&this.reasons.every((t,n)=>yc(t,e.reasons[n]))}[ec](){return dc(this.reasons)}},Cl=new WeakMap,wl=class{[bl];annotations;_tag;constructor(e,t,n){if(this[bl]=bl,this._tag=e,t!==Tl&&typeof n==`object`&&n&&t.size>0){let e=Cl.get(n);e&&(t=new Map([...e,...t])),Cl.set(n,t)}this.annotations=t}annotate(e,t){if(e.mapUnsafe.size===0)return this;let n=new Map(this.annotations);e.mapUnsafe.forEach((e,r)=>{t?.overwrite!==!0&&n.has(r)||n.set(r,e)});let r=Object.assign(Object.create(Object.getPrototypeOf(this)),this);return r.annotations=n,r}pipe(){return Ts(this,arguments)}toString(){return L(this)}[$c](){return this.toString()}},Tl=new Map,El=class extends wl{constructor(e,t=Tl){super(`Fail`,t,e),this.error=e}toString(){return`Fail(${L(this.error)})`}toJSON(){return{_tag:`Fail`,error:this.error}}[vc](e){return Pl(e)&&yc(this.error,e.error)&&yc(this.annotations,e.annotations)}[ec](){return rc(sc(this._tag))(rc(I(this.error))(I(this.annotations)))}},Dl=e=>new Sl(e),Ol=(e,t)=>{let n=new Map,r=[];for(let i of e.concat(t)){let e=I(i),t=n.get(e);if(t===void 0)n.set(e,[i]);else if(t.some(e=>yc(e,i)))continue;else t.push(i);r.push(i)}return r},kl=F(2,(e,t)=>{if(e.reasons.length===0)return t;if(t.reasons.length===0)return e;let n=new Sl(Ol(e.reasons,t.reasons));return yc(e,n)?e:n}),Al=e=>new Sl([new El(e)]),jl=class extends wl{constructor(e,t=Tl){super(`Die`,t,e),this.defect=e}toString(){return`Die(${L(this.defect)})`}toJSON(){return{_tag:`Die`,defect:this.defect}}[vc](e){return Fl(e)&&yc(this.defect,e.defect)&&yc(this.annotations,e.annotations)}[ec](){return rc(sc(this._tag))(rc(I(this.defect))(I(this.annotations)))}},Ml=e=>new Sl([new jl(e)]),Nl=F(e=>xl(e[0]),(e,t,n)=>t.mapUnsafe.size===0?e:new Sl(e.reasons.map(e=>e.annotate(t,n)))),Pl=e=>e._tag===`Fail`,Fl=e=>e._tag===`Die`,Il=e=>e._tag===`Interrupt`;function Ll(e){return Kl(`Effect.evaluate: Not implemented`)}var Rl=e=>({..._l,[ul]:e.op,[dl]:e[dl]??Ll,[fl]:e[fl],[pl]:e[pl],[ml]:e[ml]}),zl=e=>{let t=Rl(e),n=function(e){this[R]=e};return n.prototype=t,function(e){return new n(e)}},Bl=e=>{let t={[cl]:cl,_tag:e.op,get[e.prop](){return this[R]},...Rl(e),toString(){return`${e.op}(${L(this[R])})`},toJSON(){return{_id:`Exit`,_tag:e.op,[e.prop]:this[R]}},[vc](e){return vl(e)&&e._tag===this._tag&&yc(this[R],e[R])},[ec](){return rc(sc(e.op),I(this[R]))}},n=function(e){this[R]=e};return n.prototype=t,function(e){return new n(e)}},Vl=Bl({op:`Success`,prop:`value`,[dl](e){let t=e.getCont(fl);return t?t[fl](this[R],e,this):e.yieldWith(this)}}),Hl={key:`effect/Cause/StackTrace`},Ul={key:`effect/Cause/InterruptorStackTrace`},Wl=Bl({op:`Failure`,prop:`cause`,[dl](e){let t=this[R],n=!1;e.cache.stackFrame&&(t=Nl(t,{mapUnsafe:new Map([[Hl.key,e.cache.stackFrame]])}),n=!0);let r=e.getCont(pl),i=e._interruptedCause;if(i&&e.interruptible){let a=!1;for(;r&&e.interruptible;)a||=ul in r,r=e.getCont(pl);a&&(t=Dl(t.reasons.filter(e=>e._tag!==`Fail`))),t=kl(t,i),n=!0}return r?r[pl](t,e,n?void 0:this):e.yieldWith(n?Wl(t):this)}}),Gl=e=>Wl(Al(e)),Kl=e=>Wl(Ml(e)),ql=zl({op:`WithFiber`,[dl](e){return this[R](e)}}),Jl=function(){class e extends globalThis.Error{}let t=Rl({op:`YieldableError`,[dl](){return Gl(this)}});return delete t.toString,Object.assign(e.prototype,t),e}(),Yl=function(){let e=Symbol.for(`effect/Data/Error/plainArgs`);return class extends Jl{constructor(t){super(t?.message,t?.cause?{cause:t.cause}:void 0),t&&(Ic(this,t),Object.defineProperty(this,e,{value:t,enumerable:!1}))}toJSON(){return{...this[e],...this}}}}(),Xl=e=>{class t extends Yl{_tag=e}return t.prototype.name=e,t};Xl(`NoSuchElementError`);var Zl=`~effect/Option`,Ql={[Zl]:{_A:e=>e},...gl,[Symbol.iterator](){return new al(this)}},$l=Object.defineProperty(Object.assign(Object.create(Ql),{_tag:`Some`,_op:`Some`,[vc](e){return nu(e)&&iu(e)&&yc(this.value,e.value)},[ec](){return rc(I(this._tag))(I(this.value))},toString(){return`some(${L(this.value)})`},toJSON(){return{_id:`Option`,_tag:this._tag,value:el(this.value)}}}),"valueOrUndefined",{get(){return this.value}}),eu=I(`None`),tu=Object.assign(Object.create(Ql),{_tag:`None`,_op:`None`,valueOrUndefined:void 0,[vc](e){return nu(e)&&ru(e)},[ec](){return eu},toString(){return`none()`},toJSON(){return{_id:`Option`,_tag:this._tag}}}),nu=e=>$s(e,Zl),ru=e=>e._tag===`None`,iu=e=>e._tag===`Some`,au=Object.create(tu),ou=function(e){this.value=e};ou.prototype=$l;var su=e=>new ou(e),cu=`~effect/Result`,lu={[cu]:{_A:e=>e,_E:e=>e},...gl,[Symbol.iterator](){return new al(this)}},uu=Object.assign(Object.create(lu),{_tag:`Success`,_op:`Success`,[vc](e){return fu(e)&&mu(e)&&yc(this.success,e.success)},[ec](){return rc(I(this._tag))(I(this.success))},toString(){return`success(${L(this.success)})`},toJSON(){return{_id:`Result`,_tag:this._tag,value:el(this.success)}}}),du=Object.assign(Object.create(lu),{_tag:`Failure`,_op:`Failure`,[vc](e){return fu(e)&&pu(e)&&yc(this.failure,e.failure)},[ec](){return rc(I(this._tag))(I(this.failure))},toString(){return`failure(${L(this.failure)})`},toJSON(){return{_id:`Result`,_tag:this._tag,failure:el(this.failure)}}}),fu=e=>$s(e,cu),pu=e=>e._tag===`Failure`,mu=e=>e._tag===`Success`,hu=function(e){this.failure=e};hu.prototype=du;var gu=e=>new hu(e),_u=function(e){this.success=e};_u.prototype=uu;var vu=e=>new _u(e);function yu(e){return(t,n)=>t===n?0:e(t,n)}var bu=yu((e,t)=>e<t?-1:1),xu=yu((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),Su=e=>F(2,(t,n)=>e(t,n)===-1),Cu=e=>F(2,(t,n)=>e(t,n)===1),wu=e=>F(2,(t,n)=>e(t,n)!==1),Tu=e=>F(2,(t,n)=>e(t,n)!==-1),Eu=()=>au,Du=su,Ou=ru,ku=iu,Au=F(2,(e,{onNone:t,onSome:n})=>Ou(e)?t():n(e.value)),ju=F(2,(e,t)=>Ou(e)?t():e.value),Mu=F(2,(e,t)=>Ou(e)?t():e),Nu=ju(js),Pu=ju(Ms),Fu=F(2,(e,t)=>Ou(e)?Eu():Du(t(e.value))),Iu=vu,Lu=gu,Ru=pu,zu=mu,Bu=F(2,(e,t)=>Ru(e)?Lu(t(e.failure)):e),Vu=F(2,(e,{onFailure:t,onSuccess:n})=>Ru(e)?t(e.failure):n(e.success)),Hu=globalThis.Array,Uu=F(2,(e,t)=>[...e,t]);Hu.isArray;var Wu=Pc,Gu=Pc,Ku=()=>[],qu=F(2,(e,t)=>e.map(t)),Ju=`~effect/BigDecimal`,Yu={[Ju]:Ju,[ec](){let e=rd(this);return rc(sc(String(e.value)),oc(e.scale))},[vc](e){return Xu(e)&&cd(this,e)===0},toString(){return`BigDecimal(${ud(this)})`},toJSON(){return{_id:`BigDecimal`,value:String(this.value),scale:this.scale}},[$c](){return this.toJSON()},pipe(){return Ts(this,arguments)}},Xu=e=>$s(e,Ju),Zu=(e,t)=>{if(!Number.isSafeInteger(t))throw RangeError(`Scale must be a safe integer, got ${t}`);let n=Object.create(Yu);return n.value=e,n.scale=t,n},Qu=(e,t)=>{let n=Zu(e,t);return n.normalized=n,n},$u=BigInt(0),ed=BigInt(1),td=BigInt(10),nd=Qu($u,0),rd=e=>{if(e.normalized===void 0){if(e.value===$u)e.normalized=nd;else{let t=`${e.value}`,n=t.length;for(;t[n-1]===`0`;)n--;e.normalized=Qu(BigInt(t.slice(0,n)),e.scale-(t.length-n))}}return e.normalized},id=100,ad=[ed],od=(e,t)=>e===t?0:e<t?-1:1,sd=(e,t)=>{let n=`${e.value<$u?-e.value:e.value}`,r=`${t.value<$u?-t.value:t.value}`,i=BigInt(n.length-r.length)-BigInt(e.scale)+BigInt(t.scale);if(i!==$u)return i<$u?-1:1;let a=Math.max(n.length,r.length);return bu(n.padEnd(a,`0`),r.padEnd(a,`0`))},cd=(e,t)=>{if(e.scale===t.scale)return od(e.value,t.value);let n=ld(e),r=ld(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>id)return n===-1?sd(t,e):sd(e,t);let o=ad[a]??=td**BigInt(a);return i>0?od(e.value,t.value*o):od(e.value*o,t.value)},ld=e=>e.value===$u?0:e.value<$u?-1:1,ud=e=>{let t=rd(e);if(Math.abs(t.scale)>=16)return dd(t);let n=t.value<$u,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},dd=e=>{if(fd(e))return`0e+0`;let t=rd(e),n=`${t.value}`,r=t.value<$u?2:1,i=n.slice(0,r),a=n.slice(r),o=a.length-t.scale;return`${i}${a===``?``:`.${a}`}e${o>=0?`+`:``}${o}`},fd=e=>e.value===$u,pd=e=>Rl({op:e.label,[dl]:e.evaluate}),md=`~effect/Context/Service`,hd=function(){function e(){}let t=e;Object.setPrototypeOf(t,gd);let n=(e,n)=>(t.key=e,n?.defaultValue&&(t[vd]=vd,t.defaultValue=n.defaultValue),n?.make&&(t.make=n.make),n?.fiberCached&&_d.add(e),t);return arguments.length>0?n(arguments[0],arguments[1]):n},gd={[md]:md,...pd({label:`Service`,evaluate(e){return Vl(Rd(e.context,this))}}),toJSON(){return{_id:`Service`,key:this.key}},of(e){return e},context(e){return Pd(this,e)},use(e){return ql(t=>e(Rd(t.context,this)))},useSync(e){return ql(t=>Vl(e(Rd(t.context,this))))}},_d=new Set,vd=`~effect/Context/Reference`,yd=`~effect/Context`,bd=8,xd=8,Sd=(e,t,n,r)=>{let i=Object.create(Od);return i.cacheRoot=e??i,i.base=t,i.overlay=n,i.depth=r,i._flat=void 0,i.baseHits=0,i},Cd=(e,t)=>{t&&(Cd(e,t.parent),e.set(t.key,t.value))},wd=e=>{if(e._flat)return e._flat;if(!e.overlay)return e._flat=e.base;let t=new Map(e.base);return Cd(t,e.overlay),e._flat=t},Td=Symbol(),Ed=(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)?Td:(n.overlay&&++n.baseHits>=n.base.size&&n.baseHits>=xd&&(n.base=wd(n),n.overlay=void 0,n.depth=0),r)},Dd=e=>Sd(void 0,e,void 0,0),Od={get mapUnsafe(){return wd(this)},...gl,[yd]:{_Services:e=>e},toJSON(){return{_id:`Context`,services:Array.from(this.mapUnsafe).map(([e,t])=>({key:e,value:t}))}},[vc](e){if(!Ad(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)||!yc(r,n.get(e)))return!1;return!0},[ec](){return oc(this.mapUnsafe.size)}},kd=(e,t)=>e.cacheRoot===t.cacheRoot,Ad=e=>$s(e,yd),jd=e=>!!e[vd],Md=()=>Nd,Nd=Dd(new Map),Pd=(e,t)=>Dd(new Map([[e.key,t]])),Fd=F(3,(e,t,n)=>Id(e,t.key,n)),Id=(e,t,n)=>{let r=e,i=_d.has(t)?void 0:r.cacheRoot;if(r.depth>=bd){let e=new Map(r.mapUnsafe);return e.set(t,n),Sd(i,e,void 0,0)}return Sd(i,r.base,{key:t,value:n,parent:r.overlay},r.depth+1)},Ld=(e,t)=>{let n=Ed(e,t);return n===Td?void 0:n},Rd=F(2,(e,t)=>{let n=Ed(e,t.key);if(n===Td){if(jd(t))return Bd(t);throw Vd(t)}return n}),zd=`~effect/Context/defaultValue`,Bd=e=>zd in e?e[zd]:e[zd]=e.defaultValue(),Vd=e=>{let t=Error(`Service not found${e.key?`: ${String(e.key)}`:``}`);if(t.stack){let e=t.stack.split(`
67
67
  `);e.splice(1,3),t.stack=e.join(`
68
- `)}return t},Vd=md,Hd=`~effect/Duration`,Ud=BigInt(0),Wd=BigInt(1),Gd=BigInt(2),Kd=BigInt(10),qd=BigInt(1e3),Jd=e=>BigInt(e<0?Math.ceil(e-.5):Math.floor(e+.5)),Yd=e=>Jd(e*1e6),Xd=(e,t)=>{let n=e.indexOf(`.`);if(n===-1)return BigInt(e)*t;let r=e[0]===`-`,i=e.slice(n+1),a=Kd**BigInt(i.length),o=(BigInt(e.slice(+!!r,n))*a+BigInt(i))*t,s=o/a+(o%a*Gd>=a?Wd:Ud);return r?-s:s},Zd=/^(-?\d+(?:\.\d+)?)\s+(nanos?|micros?|millis?|seconds?|minutes?|hours?|days?|weeks?)$/,Qd=e=>{switch(typeof e){case`number`:return df(e);case`bigint`:return uf(e);case`string`:{if(e===`Infinity`)return cf;if(e===`-Infinity`)return lf;let t=Zd.exec(e);if(!t)break;let[n,r,i]=t;if(i===`nano`||i===`nanos`)return uf(Xd(r,Wd));if(i===`micro`||i===`micros`)return uf(Xd(r,qd));let a=Number(r);switch(i){case`milli`:case`millis`:return df(a);case`second`:case`seconds`:return ff(a);case`minute`:case`minutes`:return pf(a);case`hour`:case`hours`:return mf(a);case`day`:case`days`:return hf(a);case`week`:case`weeks`:return gf(a)}break}case`object`:{if(e===null)break;if(Hd in e)return e;if(Array.isArray(e))return e.length!==2||!e.every(Hs)?$d(e):Number.isNaN(e[0])||Number.isNaN(e[1])?sf:e[0]===-1/0||e[1]===-1/0?lf:e[0]===1/0||e[1]===1/0?cf:af(Jd(e[0]*1e9+e[1]));let t=e,n=0;return 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?af(n):af(Jd(n*1e6+(t.microseconds??0)*1e3+(t.nanoseconds??0)))}}return $d(e)},$d=e=>{throw Error(`Invalid Input: ${e}`)},ef={_tag:`Millis`,millis:0},tf={_tag:`Infinity`},nf={_tag:`NegativeInfinity`},rf={[Hd]:Hd,[$s](){switch(this.value._tag){case`Millis`:{let e=this.value.millis*1e6;return Number.isFinite(e)?L(Jd(e)):ac(this.value.millis)}case`Nanos`:return L(this.value.nanos);default:return cc(this.value)}},[_c](e){return of(e)&&bf(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`}}},[Qc](){return this.toJSON()},pipe(){return ws(this,arguments)}},af=e=>{let t=Object.create(rf);return t.value=typeof e==`number`?isNaN(e)||e===0||Object.is(e,-0)?ef:Number.isFinite(e)?Number.isInteger(e)?{_tag:`Millis`,millis:e}:{_tag:`Nanos`,nanos:Yd(e)}:e>0?tf:nf:e===Ud?ef:{_tag:`Nanos`,nanos:e},t},of=e=>Qs(e,Hd),sf=af(0),cf=af(1/0),lf=af(-1/0),uf=e=>af(e),df=e=>af(e),ff=e=>af(e*1e3),pf=e=>af(e*6e4),mf=e=>af(e*36e5),hf=e=>af(e*864e5),gf=e=>af(e*6048e5),_f=e=>{let t=Qd(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 Yd(t.value.millis)}},vf=I(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(_f(e),t.value.nanos):n.onNanos(e.value.nanos,_f(t))),yf=(e,t)=>vf(e,t,{onMillis:(e,t)=>e===t,onNanos:(e,t)=>e===t,onInfinity:(e,t)=>e.value._tag===t.value._tag}),bf=I(2,(e,t)=>yf(e,t)),xf=Vd(`effect/Scheduler`,{fiberCached:!0,defaultValue:()=>new Ef}),Sf=e=>{let t=!1;return Promise.resolve().then(()=>{t||e()}),()=>{t=!0}},Cf=`setImmediate`in globalThis?e=>{let t=globalThis.setImmediate(e);return()=>globalThis.clearImmediate(t)}:e=>{let t=setTimeout(e,0);return()=>clearTimeout(t)},wf=e=>{try{return Cf(e)}catch{return Sf(e)}},Tf=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}},Ef=class{executionMode;setImmediate;constructor(e=`async`,t){this.executionMode=e,this.setImmediate=t??(e===`sync`?Sf:wf)}shouldYield(e){return e.currentOpCount>=e.cache.maxOpsBeforeYield}makeDispatcher(){return new Df(this.setImmediate)}},Df=class{tasks=new Tf;running=void 0;setImmediate;constructor(e=wf){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()}},Of=Vd(`effect/Scheduler/MaxOpsBeforeYield`,{fiberCached:!0,defaultValue:()=>2048}),kf=Vd(`effect/Scheduler/PreventSchedulerYield`,{fiberCached:!0,defaultValue:()=>!1}),Af=Yl,jf=`~effect/encoding/EncodingError`,Mf=class extends Af(`EncodingError`){[jf]=jf},Nf=`effect/Tracer/ParentSpan`;md()(Nf,{fiberCached:!0});var Pf=`effect/Tracer`,Ff=`effect/Metric/FiberRuntimeMetrics`,If=Vd(`effect/References/CurrentStackFrame`,{fiberCached:!0,defaultValue:js}),Lf=Vd(`effect/References/TracerEnabled`,{fiberCached:!0,defaultValue:ks}),Rf=Vd(`effect/References/CurrentLogLevel`,{fiberCached:!0,defaultValue:()=>`Info`}),zf=Vd(`effect/References/MinimumLogLevel`,{fiberCached:!0,defaultValue:()=>`Info`}),Bf=class extends Cl{constructor(e,t=wl){super(`Interrupt`,t,`Interrupted`),this.fiberId=e}toString(){return`Interrupt(${this.fiberId})`}toJSON(){return{_tag:`Interrupt`,fiberId:this.fiberId}}[_c](e){return Fl(e)&&this.fiberId===e.fiberId&&this.annotations===e.annotations}[$s](){return nc(oc(`${this._tag}:${this.fiberId}`))(ec(this.annotations))}},Vf=e=>new xl([new Bf(e)]),Hf=e=>{for(let t=0;t<e.reasons.length;t++){let n=e.reasons[t];if(n._tag===`Fail`)return Fu(n.error)}return Iu(e)},Uf=e=>e.reasons.some(Fl),Wf=I(2,(e,t)=>{let n=!1,r=e.reasons.map(e=>Nl(e)?(n=!0,new Tl(t(e.error),e.annotations)):e);return n?El(r):e}),Gf=(e,t)=>{let n=[],r=[];if(e.reasons.length===0)return n;let i=nl();i!==0&&rl(1);try{for(let i of e.reasons){if(i._tag===`Interrupt`){r.push(i);continue}n.push(Kf(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=Zf(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(Kf(i,r[0].annotations,t))}}finally{i!==0&&rl(i)}return n},Kf=(e,t,n)=>{let r=typeof e,i;if(e&&r===`object`){if(i=new globalThis.Error(qf(e),{cause:e.cause?Kf(e.cause):void 0}),typeof e.name==`string`&&(i.name=e.name),typeof e.stack==`string`)i.stack=Yf(e.stack,i,t);else{let e=`${i.name}: ${i.message}`;i.stack=t?Xf(e,t):e}n?.includeCauseInStack&&(i.stack=ep(i));for(let t of Object.keys(e))t in i||(i[t]=e[t])}else{i=new globalThis.Error(e?r===`string`?e:Yc(e):`Unknown error: ${e}`);let n=`${i.name}: ${i.message}`;i.stack=t?Xf(n,t):n}return i},qf=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 Yc(e)},Jf=/\((.*)\)/g,Yf=(e,t,n)=>{let r=`${t.name}: ${t.message}`,i=(e.startsWith(r)?e.slice(r.length):e).split(`
69
- `),a=[r];for(let e=1;e<i.length&&!/Generator\.next|~effect\/(?:Effect|Utils)/.test(i[e]);e++)a.push(i[e]);return n?Xf(a.join(`
68
+ `)}return t},Hd=hd,Ud=`~effect/Duration`,Wd=BigInt(0),Gd=BigInt(1),Kd=BigInt(2),qd=BigInt(10),Jd=BigInt(1e3),Yd=e=>BigInt(e<0?Math.ceil(e-.5):Math.floor(e+.5)),Xd=e=>Yd(e*1e6),Zd=(e,t)=>{let n=e.indexOf(`.`);if(n===-1)return BigInt(e)*t;let r=e[0]===`-`,i=e.slice(n+1),a=qd**BigInt(i.length),o=(BigInt(e.slice(+!!r,n))*a+BigInt(i))*t,s=o/a+(o%a*Kd>=a?Gd:Wd);return r?-s:s},Qd=/^(-?\d+(?:\.\d+)?)\s+(nanos?|micros?|millis?|seconds?|minutes?|hours?|days?|weeks?)$/,$d=e=>{switch(typeof e){case`number`:return ff(e);case`bigint`:return df(e);case`string`:{if(e===`Infinity`)return lf;if(e===`-Infinity`)return uf;let t=Qd.exec(e);if(!t)break;let[n,r,i]=t;if(i===`nano`||i===`nanos`)return df(Zd(r,Gd));if(i===`micro`||i===`micros`)return df(Zd(r,Jd));let a=Number(r);switch(i){case`milli`:case`millis`:return ff(a);case`second`:case`seconds`:return pf(a);case`minute`:case`minutes`:return mf(a);case`hour`:case`hours`:return hf(a);case`day`:case`days`:return gf(a);case`week`:case`weeks`:return _f(a)}break}case`object`:{if(e===null)break;if(Ud in e)return e;if(Array.isArray(e))return e.length!==2||!e.every(Us)?ef(e):Number.isNaN(e[0])||Number.isNaN(e[1])?cf:e[0]===-1/0||e[1]===-1/0?uf:e[0]===1/0||e[1]===1/0?lf:of(Yd(e[0]*1e9+e[1]));let t=e,n=0;return 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?of(n):of(Yd(n*1e6+(t.microseconds??0)*1e3+(t.nanoseconds??0)))}}return ef(e)},ef=e=>{throw Error(`Invalid Input: ${e}`)},tf={_tag:`Millis`,millis:0},nf={_tag:`Infinity`},rf={_tag:`NegativeInfinity`},af={[Ud]:Ud,[ec](){switch(this.value._tag){case`Millis`:{let e=this.value.millis*1e6;return Number.isFinite(e)?I(Yd(e)):oc(this.value.millis)}case`Nanos`:return I(this.value.nanos);default:return lc(this.value)}},[vc](e){return sf(e)&&xf(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`}}},[$c](){return this.toJSON()},pipe(){return Ts(this,arguments)}},of=e=>{let t=Object.create(af);return t.value=typeof e==`number`?isNaN(e)||e===0||Object.is(e,-0)?tf:Number.isFinite(e)?Number.isInteger(e)?{_tag:`Millis`,millis:e}:{_tag:`Nanos`,nanos:Xd(e)}:e>0?nf:rf:e===Wd?tf:{_tag:`Nanos`,nanos:e},t},sf=e=>$s(e,Ud),cf=of(0),lf=of(1/0),uf=of(-1/0),df=e=>of(e),ff=e=>of(e),pf=e=>of(e*1e3),mf=e=>of(e*6e4),hf=e=>of(e*36e5),gf=e=>of(e*864e5),_f=e=>of(e*6048e5),vf=e=>{let t=$d(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 Xd(t.value.millis)}},yf=F(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(vf(e),t.value.nanos):n.onNanos(e.value.nanos,vf(t))),bf=(e,t)=>yf(e,t,{onMillis:(e,t)=>e===t,onNanos:(e,t)=>e===t,onInfinity:(e,t)=>e.value._tag===t.value._tag}),xf=F(2,(e,t)=>bf(e,t)),Sf=Hd(`effect/Scheduler`,{fiberCached:!0,defaultValue:()=>new Df}),Cf=e=>{let t=!1;return Promise.resolve().then(()=>{t||e()}),()=>{t=!0}},wf=`setImmediate`in globalThis?e=>{let t=globalThis.setImmediate(e);return()=>globalThis.clearImmediate(t)}:e=>{let t=setTimeout(e,0);return()=>clearTimeout(t)},Tf=e=>{try{return wf(e)}catch{return Cf(e)}},Ef=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}},Df=class{executionMode;setImmediate;constructor(e=`async`,t){this.executionMode=e,this.setImmediate=t??(e===`sync`?Cf:Tf)}shouldYield(e){return e.currentOpCount>=e.cache.maxOpsBeforeYield}makeDispatcher(){return new Of(this.setImmediate)}},Of=class{tasks=new Ef;running=void 0;setImmediate;constructor(e=Tf){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()}},kf=Hd(`effect/Scheduler/MaxOpsBeforeYield`,{fiberCached:!0,defaultValue:()=>2048}),Af=Hd(`effect/Scheduler/PreventSchedulerYield`,{fiberCached:!0,defaultValue:()=>!1}),jf=Xl,Mf=`~effect/encoding/EncodingError`,Nf=class extends jf(`EncodingError`){[Mf]=Mf},Pf=`effect/Tracer/ParentSpan`;hd()(Pf,{fiberCached:!0});var Ff=`effect/Tracer`,If=`effect/Metric/FiberRuntimeMetrics`,Lf=Hd(`effect/References/CurrentStackFrame`,{fiberCached:!0,defaultValue:Ms}),Rf=Hd(`effect/References/TracerEnabled`,{fiberCached:!0,defaultValue:As}),zf=Hd(`effect/References/CurrentLogLevel`,{fiberCached:!0,defaultValue:()=>`Info`}),Bf=Hd(`effect/References/MinimumLogLevel`,{fiberCached:!0,defaultValue:()=>`Info`}),Vf=class extends wl{constructor(e,t=Tl){super(`Interrupt`,t,`Interrupted`),this.fiberId=e}toString(){return`Interrupt(${this.fiberId})`}toJSON(){return{_tag:`Interrupt`,fiberId:this.fiberId}}[vc](e){return Il(e)&&this.fiberId===e.fiberId&&this.annotations===e.annotations}[ec](){return rc(sc(`${this._tag}:${this.fiberId}`))(tc(this.annotations))}},Hf=e=>new Sl([new Vf(e)]),Uf=e=>{for(let t=0;t<e.reasons.length;t++){let n=e.reasons[t];if(n._tag===`Fail`)return Iu(n.error)}return Lu(e)},Wf=e=>e.reasons.some(Il),Gf=F(2,(e,t)=>{let n=!1,r=e.reasons.map(e=>Pl(e)?(n=!0,new El(t(e.error),e.annotations)):e);return n?Dl(r):e}),Kf=(e,t)=>{let n=[],r=[];if(e.reasons.length===0)return n;let i=rl();i!==0&&il(1);try{for(let i of e.reasons){if(i._tag===`Interrupt`){r.push(i);continue}n.push(qf(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=Qf(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(qf(i,r[0].annotations,t))}}finally{i!==0&&il(i)}return n},qf=(e,t,n)=>{let r=typeof e,i;if(e&&r===`object`){if(i=new globalThis.Error(Jf(e),{cause:e.cause?qf(e.cause):void 0}),typeof e.name==`string`&&(i.name=e.name),typeof e.stack==`string`)i.stack=Xf(e.stack,i,t);else{let e=`${i.name}: ${i.message}`;i.stack=t?Zf(e,t):e}n?.includeCauseInStack&&(i.stack=tp(i));for(let t of Object.keys(e))t in i||(i[t]=e[t])}else{i=new globalThis.Error(e?r===`string`?e:Xc(e):`Unknown error: ${e}`);let n=`${i.name}: ${i.message}`;i.stack=t?Zf(n,t):n}return i},Jf=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 Xc(e)},Yf=/\((.*)\)/g,Xf=(e,t,n)=>{let r=`${t.name}: ${t.message}`,i=(e.startsWith(r)?e.slice(r.length):e).split(`
69
+ `),a=[r];for(let e=1;e<i.length&&!/Generator\.next|~effect\/(?:Effect|Utils)/.test(i[e]);e++)a.push(i[e]);return n?Zf(a.join(`
70
70
  `),n):a.join(`
71
- `)},Xf=(e,t)=>{let n=t?.get(Vl.key);return n&&(e=`${e}\n${Qf(n)}`),e},Zf=(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(Hl.key);n.push(` at fiber (${t})`),r&&n.push(Qf(r))}return n.join(`
72
- `)},Qf=e=>{let t=[],n=e,r=0;for(;n&&r<10;){let e=n.stack();if(e){let r=e.matchAll(Jf),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(`
73
- `)},$f=e=>Gf(e).map(ep).join(`
74
- `),ep=e=>e.cause?`${e.stack} {\n${tp(e.cause,` `)}\n}`:e.stack,tp=(e,t)=>{let n=e.stack.split(`
75
- `),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${tp(e.cause,`${t} `)}\n${t}}`),r},np=`~effect/Fiber`,rp={_A:Ds,_E:Ds},ip={id:0},ap=(()=>{try{return globalThis.process?.getBuiltinModule?.(`node:async_hooks`)?.AsyncResource}catch{return}})(),op=()=>ap===void 0?void 0:new ap(`effect/Fiber`),sp=()=>globalThis[Bc],cp=class{constructor(e,t=!0){this.setContext(e),this.id=++ip.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[np](){return rp}get currentDispatcher(){return this._dispatcher??=this.cache.scheduler.makeDispatcher()}getRef(e){return Ld(this.context,e)}addObserver(e){return this._exit?(e(this._exit),Ms):(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=Vf(e);this.cache.stackFrame&&(n=Ml(n,Nd(Vl,this.cache.stackFrame))),t&&(n=Ml(n,t)),this._interruptedCause=this._interruptedCause?Ol(this._interruptedCause,n):n,this.interruptible&&(this._running?this._deferredInterrupt=!0:this.evaluate(_p(this._interruptedCause)))}pollUnsafe(){return this._exit}evaluate(e){if(this._exit)return;if(this._asyncContext!==void 0){let t=this._asyncContext;return this._asyncContext=void 0,t.runInAsyncScope(this.evaluate,this,e)}if(this._yielded!==void 0){let e=this._yielded;this._yielded=void 0,e()}let t=this.runLoop(e);if(t===ml){this._asyncContext=op();return}let n=fp.interruptChildren&&fp.interruptChildren(this);if(n!==void 0)return this.evaluate(Up(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=jd()}runLoop(e){let t=globalThis[Bc];globalThis[Bc]=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=_p(this._interruptedCause)),this.currentOpCount++;let e=this.cache;if(!r&&!e.preventYield&&e.scheduler.shouldYield(this)){r=!0;let e=i;i=Up(Sp,()=>e)}if(i=e.tracerContext?e.tracerContext(i,this):i[ul](this),i===ml){let e=this._yielded;if(sl in e)return this._deferredInterrupt=!1,this._yielded=void 0,e;if(this._deferredInterrupt){this._yielded=void 0,e();continue}return ml}}catch(e){if(!Qs(i,ul))return Gl(`Fiber.runLoop: Not a valid effect: ${String(i)}`);i=Gl(e)}}finally{this._running=n,globalThis[Bc]=t}}getCont(e){if(this._deferredInterrupt)return this._deferredInterrupt=!1,up;for(;;){let t=this._stack.pop();if(!t)return;let n=t[pl];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&dp-1))return Bl(e);let t=this.getCont(dl);return t?t[dl](e,this):this.yieldWith(Bl(e))}yieldWith(e){return this._yielded=e,ml}children(){return this._children??=new Set}pipe(){return ws(this,arguments)}setContext(e){let t=this.context;if(this.context=e,t!==void 0&&Od(t,e))return;let n=e.cacheRoot,r=n._fiberCache??=lp(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}},lp=e=>{let t=Id(e,Pf);return{scheduler:Ld(e,xf),tracer:t,tracerContext:t?t.context:void 0,tracerEnabled:Ld(e,Lf),span:Id(e,Nf),logLevel:Ld(e,Rf),minimumLogLevel:Ld(e,zf),stackFrame:Ld(e,If),runtimeMetrics:Id(e,Ff),maxOpsBeforeYield:Ld(e,Of),preventYield:Ld(e,kf)}},up={[dl](e,t){return _p(t._interruptedCause)},[fl](e,t){return _p(t._interruptedCause)}},dp=32,fp={interruptChildren:void 0},pp=e=>{if(!e.cache.stackFrame)return;let t=new Map;return t.set(Hl.key,e.cache.stackFrame),Ed(t)},mp=e=>Ap(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();continue}i=e.value.addObserver(e=>{r.push(e),a()});return}t(gp(r))}return a(),yp(()=>i?.())}),hp=e=>Kl(t=>{let n=pp(t),r=Gu();for(let i of e)i.interruptUnsafe(t.id,n),r.push(i);return Hp(mp(r))}),gp=Bl,_p=Ul,vp=Wl,yp=Rl({op:`Sync`,[ul](e){let t=this[z](),n=e.getCont(dl);return n?n[dl](t,e):e.yieldWith(Bl(t))}}),bp=Rl({op:`Suspend`,[ul](e){return this[z]()}}),xp=Bu({onFailure:vp,onSuccess:gp}),Sp=Rl({op:`Yield`,[ul](e){let t=!1;return e.currentDispatcher.scheduleTask(()=>{t||e.evaluate(Xp)},this[z]??0),e.yieldWith(()=>{t=!0})}})(0),Cp=e=>bp(()=>_p(e())),wp=e=>Gl(e),Tp=e=>bp(()=>vp(e())),Ep=gp(void 0),Dp=e=>{let t=typeof e==`function`?e:e.try,n=typeof e==`function`?e=>new wm(e,`An error occurred in Effect.try`):e.catch;return bp(()=>{try{return gp(t())}catch(e){return vp(n(e))}})},Op=function(){let e=Ll({op:`Async`,[ul](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._yielded=()=>{t=!0},r===void 0&&i===void 0||e._stack.push(kp(()=>(t=!0,r?.abort(),i??Xp))),ml):n}}),t=function(e,t){this.register=e,this.withSignal=t};return t.prototype=e,function(e,n){return new t(e,n)}}(),kp=Rl({op:`AsyncFinalizer`,[pl](e){e.interruptible&&(e.interruptible=!1,e._stack.push(fm))},[fl](e,t){return Uf(e)?Up(um(Ul(e),this[z]()),()=>_p(e)):_p(e)}}),Ap=e=>Op(e,e.length>=2),jp=(e,t)=>Object.defineProperty(t,"length",{value:e,configurable:!0}),Mp=(e,...t)=>jp(e.length,t.length===0?function(){return Np(()=>e.apply(this,arguments))}:function(){let n=Np(()=>e.apply(this,arguments));for(let e of t)n=e(n,...arguments);return n}),Np=e=>{try{let t=e(),n;for(;;){let r=t.next(n);if(r.done)return gp(r.value);let i=r.value;if(i&&i._tag===`Success`){n=i.value;continue}if(i&&i._tag===`Failure`)return r.value;{let n=!0;return bp(()=>n?(n=!1,Up(r.value,e=>Pp(t,e))):bp(()=>Pp(e())))}}}catch(e){return wp(e)}},Pp=function(){let e=Ll({op:`Iterator`,[dl](e,t){let n=this.iterator;for(;;){let r=n.next(e);if(r.done)return gp(r.value);if(!Wp(r.value))return t._stack.push(this),r.value;if(r.value._tag===`Failure`)return r.value;e=r.value.value}},[ul](e){return this[dl](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)}}(),Fp=function(e){return e._stack.push(this),this[z]},Ip=Ll({op:`OnSuccess`,[ul]:Fp}),Lp=function(e,t,n){this[z]=e,this[dl]=t,this.payload=n};Lp.prototype=Ip;var Rp=function(){return this.payload},zp=(()=>{let e=`~effect/Effect/stackProbe`;return{[e]:function(){return Error().stack}}[e]()?.includes(`[as `+e+`]`)===!0})(),Bp=function(e,t){let n=this.payload;return t.succeedWith(zp?n(e):al(()=>n(e)))},Vp=function(e){let t=this.payload;return t(e)},Hp=e=>new Lp(e,Rp,Xp),Up=I(2,(e,t)=>new Lp(e,Vp,t)),Wp=e=>e[sl]!==void 0,Gp=I(2,(e,t)=>Wp(e)?e._tag===`Success`?t(e.value):e:Up(e,t)),Kp=I(2,(e,t)=>new Lp(e,Bp,t)),qp=I(2,(e,t)=>Wp(e)?Zp(e,t):Kp(e,t)),Jp=I(2,(e,t)=>Wp(e)?Qp(e,t):im(e,t)),Yp=e=>e._tag===`Success`,Xp=Bl(void 0),Zp=I(2,(e,t)=>e._tag===`Success`?Bl(t(e.value)):e),Qp=I(2,(e,t)=>{if(e._tag===`Success`)return e;let n=Hf(e.cause);return Lu(n)?e:Wl(t(n.success))}),$p=I(2,(e,t)=>new tm(e,t.length===1?t:e=>t(e))),em=Ll({op:`OnFailure`,[ul]:Fp}),tm=function(e,t){this[z]=e,this[fl]=t};tm.prototype=em;var nm=I(3,(e,t,n)=>$p(e,e=>{let r=t(e);return Lu(r)?_p(r.failure):n(r.success,e)})),rm=I(2,(e,t)=>nm(e,Hf,e=>t(e))),im=I(2,(e,t)=>rm(e,e=>Tp(()=>t(e)))),am=function(e,t){let n=this.payload;return t.succeedWith(zp?n.onSuccess(e):al(()=>n.onSuccess(e)))},om=((e,t)=>{let n=Ll({op:e,[ul]:Fp,[dl]:am,[fl]:t}),r=function(e,t){this[z]=e,this.payload=t};return r.prototype=n,r})(`Match`,function(e,t){let n=e.reasons.find(Nl);if(n===void 0)return _p(e);let r=this.payload;return t.succeedWith(zp?r.onFailure(n.error):al(()=>r.onFailure(n.error)))}),sm=I(2,(e,t)=>new om(e,t)),cm=e=>Wp(e)?Bl(e):lm(e),lm=Rl({op:`Exit`,[ul](e){return e._stack.push(this),this[z]},[dl](e,t,n){return t.succeedWith(n??Bl(e))},[fl](e,t,n){return t.succeedWith(n??Ul(e))}}),um=(e,t)=>Yp(e)?t:$p(t,t=>_p(Ol(e.cause,t))),dm=e=>Kl(t=>t.interruptible?(t.interruptible=!1,t._stack.push(fm),e):e),fm=Rl({op:`SetInterruptible`,[pl](e){if(e.interruptible=this[z],e._interruptedCause&&e.interruptible)return()=>_p(e._interruptedCause)}})(!0),pm=e=>e===`unbounded`?1/0:Math.max(1,e??1),mm=()=>e=>{let t=e.onItem,n=e.step,r=(e,t,r,a,o)=>Up(cm(o),o=>n(e,t[r],o,r)??i(e,t,r+1,a)??Ep),i=(e,i,a=0,o=i.length)=>{for(;a<o;a++){let s=i[a],c=t(e,s,a);if(!Wp(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},hm=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=Gl(e);return f=t,c=!0,u&&u.size>0?Up(dm(hp(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(Wp(g)){if(f=n(e,o,g,a),f)break}else if(l){p=void 0;let t=_m(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=El(e);f=Ul(f._tag===`Failure`?Ol(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??Ep)}catch(e){d(m(e))}}),u.size<s)continue;i=!0,a++;return}else return Ap(e=>{l=sp(),u=new Set,p=g,d=e;let t;try{t=h()}catch(t){return e(m(t))}return t?e(t):bp(()=>(f??=Xp,Up(u?hp(u):Ep,()=>f?._tag===`Failure`?f:Ep)))})}if(c=!0,f){if(u&&u.size>0){let e=pp(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(Ep);else return Xp}};return h()}},gm=()=>e=>hm(e),_m=(e,t,n=!1,r=!1,i=!1)=>{let a=e,o=i===`inherit`?a.interruptible:!i,s=new cp(a.context,o);return r||(a.children().add(s),s._parent=a),n?s.evaluate(t):(s._asyncContext=op(),a.currentDispatcher.scheduleTask(()=>s.evaluate(t),0)),s},vm=e=>(t,n)=>{let r=new cp(n?.scheduler?Pd(e,xf,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},ym=vm(jd()),bm=(e=>{let t=vm(e);return e=>{if(Wp(e))return e;let n=new Ef(`sync`),r=t(e,{scheduler:n});return r._dispatcher?.flush(),r._exit??Gl(new Sm(r))}})(jd());Yl(`TimeoutError`),Yl(`IllegalArgumentError`),Yl(`ExceededCapacityError`);var xm=`~effect/Cause/AsyncFiberError`,Sm=class extends Yl(`AsyncFiberError`){[xm]=xm;constructor(e){super({message:`An asynchronous Effect was executed with Effect.runSync`,fiber:e})}},Cm=`~effect/Cause/UnknownError`,wm=class extends Yl(`UnknownError`){[Cm]=Cm;constructor(e,t){super({message:t,cause:e})}},Tm={bold:`1`,red:`31`,green:`32`,yellow:`33`,blue:`34`,cyan:`36`,white:`37`,gray:`90`,black:`30`,bgBrightRed:`101`};Tm.gray,Tm.blue,Tm.green,Tm.yellow,Tm.red,Tm.bgBrightRed,Tm.black;var Em=Nl,Dm=jl,Om=Wf,km=$f;md()(`effect/Cause/StackTrace`),md()(`effect/Cause/InterruptorStackTrace`);var Am=Bl,jm=Ul,Mm=Wl,Nm=Xp,Pm=Yp,Fm=`~effect/DateTime`,Im=`~effect/DateTime/TimeZone`,Lm={[Fm]:Fm,pipe(){return ws(this,arguments)},[Qc](){return this.toString()},toJSON(){return zm(this).toJSON()}};({...Lm}),{...Lm};var Rm={[Im]:Im,[Qc](){return this.toString()}};({...Rm}),{...Rm};var zm=e=>new Date(e.epochMilliseconds);globalThis.String;var Bm=e=>e.trim(),Vm=gp,Hm=bp,Um=vp,Wm=Cp,Gm=wp,Km=Dp,qm=xp,Jm=Up,Ym=cm,Xm=$p,Zm=sm,Qm=ym,$m=bm;md()(`effect/Effect/Transaction`);var eh=qp,th=Jp,nh=Gp,rh=Mp;md()(`effect/DateTime/CurrentTimeZone`);var ih=e=>oh(typeof e==`string`?sh.encode(e):e),ah=e=>{let t=ch(e),n=t.length;if(n%4!=0)return Iu(new Mf({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 Iu(new Mf({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=dh(t.charCodeAt(e))<<18|dh(t.charCodeAt(e+1))<<12|dh(t.charCodeAt(e+2))<<6|dh(t.charCodeAt(e+3));r[i]=n>>16,r[i+1]=n>>8&255,r[i+2]=n&255}return Fu(r)}catch(e){return Iu(new Mf({kind:`Decode`,module:`Base64`,input:t,message:e instanceof Error?e.message:`Invalid input`}))}},oh=e=>{let t=e.length,n=``,r;for(r=2;r<t;r+=3)n+=lh[e[r-2]>>2],n+=lh[(e[r-2]&3)<<4|e[r-1]>>4],n+=lh[(e[r-1]&15)<<2|e[r]>>6],n+=lh[e[r]&63];return r===t+1&&(n+=lh[e[r-2]>>2],n+=lh[(e[r-2]&3)<<4],n+=`==`),r===t&&(n+=lh[e[r-2]>>2],n+=lh[(e[r-2]&3)<<4|e[r-1]>>4],n+=lh[(e[r-1]&15)<<2],n+=`=`),n},sh=new TextEncoder,ch=e=>e.replace(/[\n\r]/g,``),lh=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,uh=new Uint8Array(123).fill(255);for(let e=0;e<64;e++)uh[lh.charCodeAt(e)]=e;uh[61]=0;var dh=e=>{if(e>=uh.length||uh[e]===255)throw TypeError(`Invalid character ${String.fromCharCode(e)}`);return uh[e]};Af(`CookiesError`),{...el},{...el};var fh=new WeakMap,ph=`~effect/Redacted`,mh=e=>Qs(e,ph),hh=(e,t)=>{let n=Object.create(gh);return t?.label&&(n.label=t.label),fh.set(n,e),n},gh={[ph]:{_A:e=>e},label:void 0,...hl,toJSON(){return this.toString()},toString(){return`<redacted${Vs(this.label)?`:`+this.label:``}>`},[$s](){return L(fh.get(this))},[_c](e){return mh(e)&&vc(fh.get(this),fh.get(e))}};({...hl});function _h(e){return e.checks?e.checks[e.checks.length-1].annotations:e.annotations}function vh(e){return t=>_h(t)?.[e]}var yh=`~structural`,bh=`~identifier`,xh=`~sentinels`,Sh=`~constructor`,Ch=[`title`,`description`,`default`,`examples`,`readOnly`,`writeOnly`,`format`,`contentEncoding`,`contentMediaType`,`contentSchema`],wh=vh(`identifier`),Th=vh(bh),Eh=vh(`title`),Dh=vh(`description`),Oh=Ps(e=>{let t=_h(e)?.identifier;return typeof t==`string`?t:e.getExpected(Oh)}),kh=new Set([xh,yh,`representation`,`arbitraryConstraint`,`toJsonSchema`,`toCode`,`toEquivalence`,`toFormatter`,`toCodec`,`toCodecJson`,`toCodecStringTree`,`toCodecIso`,`toCodecArbitrary`]),B=Symbol(),Ah=Am,jh=Ah(B),Mh=Ah(B),Nh=e=>e===B?Tu():Eu(e),Ph=e=>e._tag===`None`?jh:Ah(e.value),Fh=`~effect/SchemaIssue/Issue`;function Ih(e){return Qs(e,Fh)&&e[Fh]===Fh}function Lh(e){return Object.hasOwn(e,`input`)}var Rh=class{[Fh]=Fh;constructor(e,t){t?.reportInput===!0&&e!==B&&(this.input=e)}},zh=class extends Rh{_tag=`Filter`;filter;issue;constructor(e,t,n,r){super(n,r),this.filter=e,this.issue=t}},Bh=class extends Rh{_tag=`Encoding`;ast;issue;constructor(e,t,n,r){super(n,r),this.ast=e,this.issue=t}},Vh=class extends Rh{_tag=`Pointer`;path;issue;constructor(e,t){super(),this.path=e,this.issue=t}},Hh=class extends Rh{_tag=`MissingKey`;annotations;constructor(e){super(),this.annotations=e}},Uh=class extends Rh{_tag=`UnexpectedKey`;ast;constructor(e,t,n){super(t,n),this.ast=e}},Wh=class extends Rh{_tag=`Composite`;ast;issues;constructor(e,t,n,r){super(n,r),this.ast=e,this.issues=t}},Gh=class extends Rh{_tag=`InvalidType`;ast;constructor(e,t,n){super(t,n),this.ast=e}},Kh=class extends Rh{_tag=`InvalidValue`;annotations;constructor(e,t,n){super(t,n),this.annotations=e}},qh=class extends Rh{_tag=`AnyOf`;ast;issues;constructor(e,t,n,r){super(n,r),this.ast=e,this.issues=t}},Jh=class extends Rh{_tag=`OneOf`;ast;successes;constructor(e,t,n,r){super(n,r),this.ast=e,this.successes=t}};function Yh(e,t,n){if(Ih(e))return e;if(typeof e==`string`)return new Kh({message:e},t,n);let r=typeof e.issue==`string`?new Kh({message:e.issue},t,n):e.issue;return new Vh(e.path,r)}function Xh(e,t,n){if(e!==void 0)return typeof e==`boolean`?e?void 0:new Kh(void 0,t,n):Yh(e,t,n)}function Zh(e,t,n,r){return Array.isArray(t)?Wu(t)?t.length===1?Yh(t[0],n,r):new Wh(e,Ku(t,e=>Yh(e,n,r)),n,r):void 0:Xh(t,n,r)}var Qh=e=>{let t=lg(e);if(t!==void 0)return t;switch(e._tag){case`InvalidType`:return rg(Oh(e.ast),e);case`InvalidValue`:{let t=ng(e);if(t!==void 0)return rg(t,e);let n=tg(e);return n===void 0?`Expected a valid value`:`Invalid data ${n}`}case`MissingKey`:return`Missing key`;case`UnexpectedKey`:{let t=tg(e);return t===void 0?`Expected no excess property`:`Unexpected key with value ${t}`}case`Forbidden`:return`Forbidden operation`;case`OneOf`:{let t=tg(e);return t===void 0?`Expected exactly one member to match`:`Expected exactly one member to match the input ${t}`}}},$h=e=>lg(e.issue)??lg(e);function eg(e){return t=>({issues:ig(t,[],e?.leafHook??Qh,e?.checkHook??$h)})}function tg(e){return Lh(e)?R(e.input):void 0}function ng(e){let t=e.annotations?.expected;return typeof t==`string`?t:void 0}function rg(e,t){let n=tg(t);return n===void 0?`Expected ${e}`:`Expected ${e}, got ${n}`}function ig(e,t,n,r){switch(e._tag){case`Filter`:{let i=r(e);if(i!==void 0)return[{path:t,message:i}];if(e.issue._tag!==`InvalidValue`)return ig(e.issue,t,n,r);let a=ng(e.issue);return[{path:t,message:a===void 0?rg(ag(e.filter),e):rg(a,e.issue)}]}case`Encoding`:return ig(e.issue,t,n,r);case`Pointer`:return ig(e.issue,[...t,...e.path],n,r);case`Composite`:return e.issues.flatMap(e=>ig(e,t,n,r));case`AnyOf`:return e.issues.length===0?[{path:t,message:lg(e)??rg(Oh(e.ast),e)}]:e.issues.flatMap(e=>ig(e,t,n,r));default:return[{path:t,message:n(e)}]}}function ag(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=>ag(e)).join(` & `)}}function og(){return e=>cg(e,``)}var sg=og();function cg(e,t){let n;switch(e._tag){case`Filter`:{let r=$h(e);if(r!==void 0)n=r;else{if(e.issue._tag!==`InvalidValue`)return cg(e.issue,t);let r=ng(e.issue);n=r===void 0?rg(ag(e.filter),e):rg(r,e.issue)}break}case`Encoding`:return cg(e.issue,t);case`Pointer`:return cg(e.issue,t+Gc(e.path));case`Composite`:case`AnyOf`:if(e._tag===`Composite`||e.issues.length>0)return e.issues.map(e=>cg(e,t)).join(`
76
- `);n=lg(e)??rg(Oh(e.ast),e);break;default:n=Qh(e)}return t?`${n}\n at ${t}`:n}function lg(e){if(e._tag===`Pointer`)return;if(e._tag===`Encoding`)return lg(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 ug(e){let t;for(let n of e.reasons){if(!Em(n)||!Ih(n.error))return;t??=n.error}return t}function dg(e,t){let n=ug(e);if(n===void 0)throw Error(t,{cause:e});return n}var fg=e=>Object.assign(Object.create(Ts),e),pg=fg({_tag:`Passthrough`});function mg(){return pg}function hg(e){return fg({_tag:`Transform`,transform:e})}function gg(e){return fg({_tag:`TransformEffect`,transform:e})}function _g(){return hg(globalThis.String)}function vg(){return hg(globalThis.Number)}function yg(){return hg(Bm)}function bg(e){return gg((t,n)=>Km({try:()=>JSON.parse(t,e?.reviver),catch:()=>new Kh({expected:`a valid JSON string`},t,n)}))}function xg(e){return gg((t,n)=>Km({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 Kh({expected:`a JSON-serializable value`},t,n)}))}function Sg(){return hg(ih)}function Cg(){return gg((e,t)=>th(qm(ah(e)),()=>new Kh({expected:`a valid Base64 string`},e,t)))}var wg=class extends Es{_tag=`Middleware`;decode;encode;constructor(e,t){super(),this.decode=e,this.encode=t}flip(){return new wg(this.encode,this.decode)}},Tg=`~effect/SchemaTransformation/Transformation`,Eg=class extends Es{[Tg]=Tg;_tag=`Transformation`;decode;encode;constructor(e,t){super(),this.decode=e,this.encode=t}flip(){return new Eg(this.encode,this.decode)}};function Dg(e){return Qs(e,Tg)&&e[Tg]===Tg}var Og=e=>Dg(e)?e:new Eg(e.decode,e.encode);function kg(){return new Eg(yg(),mg())}var Ag=new Eg(mg(),mg());function jg(){return Ag}var Mg=new Eg(vg(),_g()),Ng=new Eg(Cg(),Sg());function Pg(e){return new Eg(bg(e??{}),xg(e))}function Fg(e){return t=>t._tag===e}var Ig=Fg(`Declaration`),Lg=Fg(`Null`),Rg=Fg(`Undefined`),zg=Fg(`Never`),Bg=Fg(`String`),Vg=Fg(`Number`),Hg=Fg(`Boolean`),Ug=Fg(`Literal`),Wg=Fg(`UniqueSymbol`),Gg=Fg(`Arrays`),Kg=Fg(`Objects`),qg=Fg(`Union`),Jg=Fg(`Suspend`),Yg=class{to;transformation;constructor(e,t){this.to=e,this.transformation=t}},Xg={},Zg=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}},Qg=`~effect/Schema`,$g=class{[Qg]=Qg;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}>`}},e_=class extends $g{_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)=>t===B?jh:(e??=this.run(this.typeParameters))(t,this,n)}_rebuild(e,t,n,r,i){let a=bv(this.typeParameters,e);return a===this.typeParameters&&t===this.checks&&n===this.encodingChecks&&r===this.run&&i===this.encodingRun?this:new e_(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>`}},t_=new class extends $g{_tag=`Null`;getParser(){return Rv(this,null)}getExpected(){return`null`}},n_=class extends $g{_tag=`Undefined`;getParser(){return Rv(this,void 0)}toCodecJson(){return cv(this,[r_])}getExpected(){return`undefined`}},r_=new Yg(t_,new Eg(hg(()=>void 0),hg(()=>null))),i_=new n_,a_=new class extends $g{_tag=`Unknown`;getParser(){return zv(this,Ys)}getExpected(){return`unknown`}},o_=class extends $g{_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 ${R(e)}`);this.literal=e}getParser(){return Rv(this,this.literal)}matchPart(e,t){return e===globalThis.String(this.literal)?this.literal:void 0}toCodecJson(){return typeof this.literal==`bigint`?s_(this):this}toCodecStringTree(){return typeof this.literal==`string`?this:s_(this)}getExpected(){return typeof this.literal==`string`?JSON.stringify(this.literal):globalThis.String(this.literal)}};function s_(e){let t=globalThis.String(e.literal);return cv(e,[new Yg(new o_(t),new Eg(hg(()=>e.literal),hg(()=>t)))])}var c_=new class extends $g{_tag=`String`;getParser(){return zv(this,Vs)}matchPart(e,t){let n=this.checks;return n&&!t.disableChecks&&Yv(n,e,void 0,this,t)?void 0:e}getExpected(){return`string`}},l_=class extends $g{_tag=`Number`;getParser(){return zv(this,Hs)}matchKey(e,t){return this._match(Wv,e,t)}matchPart(e,t){return this._match(Uv,e,t)}_match(e,t,n){if(!e.test(t))return;let r=globalThis.Number(t);return n.disableChecks||!this.checks?r:Yv(this.checks,r,void 0,this,n)?void 0:r}toCodecJson(){return this.checks&&(u_(this.checks,`effect/schema/isFinite`)||u_(this.checks,`effect/schema/isInt`))?this:cv(this,[rv])}toCodecStringTree(){return this.toCodecJson()===this?cv(this,[qv]):cv(this,[Jv])}getExpected(){return`number`}};function u_(e,t){return e.some(e=>e.annotations?.representation?.id===t||e._tag===`FilterGroup`&&u_(e.checks,t))}var d_=new l_,f_=new class extends $g{_tag=`Boolean`;getParser(){return zv(this,Us)}getExpected(){return`boolean`}},p_=class extends $g{_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(Ov(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(Ov(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 Uh(n,t[o],i),a=new Vh([o],r);if(i.errors===`all`)e.issues?e.issues.push(a):e.issues=[a];else return Um(new Wh(n,[a],t,i))}return e.issues?Um(new Wh(n,e.issues,t,i)):Ah(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:new globalThis.Array(r),issues:void 0,options:t},u=n.rest.length===0?a:Math.max(r,a+o),d=t.concurrency===void 0?1:pm(t.concurrency),f=d===1?g_(i,e,0,u):__(i,e,{concurrency:d,end:u});if(!f)return c(i);if(Wp(f))return nh(f,()=>c(i));let p=!0;return Hm(()=>p?(p=!1,Jm(f,()=>c(i))):l(e,t))};return(e,a)=>{if(e===B)return jh;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)):Um(new Gh(n,e,a))}catch(e){return Gm(e)}}}_rebuild(e,t,n){let r=bv(this.elements,e),i=bv(this.rest,e);return r===this.elements&&i===this.rest&&t===this.checks&&n===this.encodingChecks?this:new p_(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 m_(e,t,n,r){if(n._tag===`Failure`)return v_(e,e.ast,r,n);let i=n===Mh?t:n[z];if(i!==B)e.output[r]=i;else{let t=e.getParser(e.tailThreshold,r);if(Ov(t.ast))return;let n=new Vh([r],new Hh(t.ast.context?.annotations));if(e.options.errors===`all`)e.issues?e.issues.push(n):e.issues=[n];else return Mm(new Wh(e.ast,[n],e.input,e.options))}}var h_={onItem(e,t,n){let r=n<e.len?t:B;return e.getParser(e.tailThreshold,n).parser(r,e.options)},step:m_},g_=mm()(h_),__=gm()(h_),v_=(e,t,n,r)=>{if(r.cause.reasons.length===0)return r;let i=ug(r.cause);if(i===void 0)return jm(Om(r.cause,r=>new Wh(t,[new Vh([n],r)],e.input,e.options)));let a=new Vh([n],i);if(e.options.errors===`all`)e.issues?e.issues.push(a):e.issues=[a];else return Mm(new Wh(t,[a],e.input,e.options))},y_=`[+-]?\\d*\\.?\\d+(?:[Ee][+-]?\\d+)?`;function b_(e,t,n=Xg){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(Bv(Pv(t)))}var x_=class{name;type;constructor(e,t){this.name=e,this.type=t}};function S_(e){switch(e._tag){case`String`:case`Number`:case`Symbol`:case`TemplateLiteral`:return!0;case`Union`:return e.types.every(S_);default:return!1}}function C_(e){let t=uv(e);switch(t._tag){case`String`:case`Number`:case`Symbol`:case`TemplateLiteral`:return!0;case`Union`:return t.types.every(C_);default:return!1}}function w_(e){return S_(e)&&C_(e)}var T_=class{parameter;type;constructor(e,t){if(!w_(e))throw Error(`Invalid index signature parameter ${e._tag}`);if(this.parameter=e,this.type=t,Ov(t)&&!Lv(t))throw Error("Cannot use `Schema.optionalKey` with index signatures, use `Schema.optional` instead.")}},E_=class extends $g{_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 zv(n,Js);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(Bv(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 v_(t,n,i,s)??Nm;let c=s===Mh?o:s[z];if(a!==B&&c!==B){if(r&&(e.has(i)||e.has(typeof a==`number`?globalThis.String(a):a)))return Nm;Pc(t.out,a,c)}return Nm},c=(e,r,i,a)=>{if(!a){let t=i.parserKey(r,e.options);if(!Wp(t))return Jm(Ym(t),t=>c(e,r,i,t));a=t}if(a._tag===`Failure`)return v_(e,n,r,a)??Nm;let o=a===Mh?r:a[z],s=e.input[r],l=i.parserValue(s,e.options);return Wp(l)?t(e,r,o,s,l):Jm(Ym(l),n=>t(e,r,o,s,n))},l=(e,n,r)=>{let i=e.input[n],a=r.parserValue(i,e.options);return Wp(a)?t(e,n,n,i,a):Jm(Ym(a),r=>t(e,n,n,i,r))},u=i?gm()({onItem:(e,[t,n])=>n.is.parameter===c_?l(e,t,n):c(e,t,n),step:(e,t,n)=>n._tag===`Failure`?n:void 0}):void 0;return rh(function*(t,d){if(t===B)return B;if(!(typeof t==`object`&&t&&!Array.isArray(t)))return yield*Um(new Gh(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:pm(d.concurrency),v=i&&g?n.indexSignatures.map(e=>b_(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 Uh(n,f[a],d),r=new Vh([a],e);if(h){m.issues?m.issues.push(r):m.issues=[r];continue}return yield*Um(new Wh(n,[r],t,d))}}}if(r){let e=_===1?k_(m,a):A_(m,a,{concurrency:_});e&&(yield*e)}if(i&&_===1)for(let e=0;e<i;e++){let t=o[e],n=t.is.parameter===c_?l:c,r=v?.[e]??(t.is.parameter===c_?Object.keys(f):b_(f,t.is.parameter,d));for(let e=0;e<r.length;e++){let i=n(m,r[e],t);if(!Wp(i))yield*i;else if(i._tag===`Failure`)return yield*i}}else if(u){let e=Gu();for(let t=0;t<i;t++){let n=o[t],r=v?.[t]??(n.is.parameter===c_?Object.keys(f):b_(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*Um(new Wh(n,m.issues,t,d)):p})};if(i)return c();let l,u=(e,t,n)=>{let r=a[t];return Jm(Ym(n),n=>{let i=D_(e,r,n);if(i)return i;let o=()=>Ah(e.out),s=k_(e,a.slice(t+1));return s?nh(s,o):o()})};return(e,t)=>{if(e===B)return jh;if(t.errors===`all`||t.onExcessProperty!==void 0||t.concurrency!==void 0&&pm(t.concurrency)!==1)return(l??=c())(e,t);if(!(typeof e==`object`&&e&&!Array.isArray(e)))return Um(new Gh(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=V_(i,s),l=c?i[s]:B,d=n.parser(l,t);if(!Wp(d))return u(o,e,d);if(d===Mh){c&&Pc(a,s,l);continue}let f=D_(o,n,d);if(f)return f}}catch(e){return Gm(e)}return Ah(a)}}_rebuild(e,t,n,r){let i=bv(this.propertySignatures,t=>{let n=e(t.type);return n===t.type?t:new x_(t.name,n)}),a=bv(this.indexSignatures,n=>{let r=t(n.parameter),i=e(n.type);return r===n.parameter&&i===n.type?n:new T_(r,i)});return i===this.propertySignatures&&a===this.indexSignatures&&n===this.checks&&r===this.encodingChecks?this:new E_(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 D_(e,t,n){if(n._tag===`Failure`)return v_(e,e.ast,t.name,n);if(n===Mh)return;let r=n[z];if(r!==B){Pc(e.out,t.name,r);return}if(delete e.out[t.name],!Ov(t.type)){let n=new Vh([t.name],new Hh(t.type.context?.annotations));if(e.options.errors===`all`){e.issues?e.issues.push(n):e.issues=[n];return}return Mm(new Wh(e.ast,[n],e.input,e.options))}}var O_={onItem(e,t){if(!V_(e.input,t.name))return t.parser(B,e.options);let n=e.input[t.name];return Pc(e.out,t.name,n),t.parser(n,e.options)},step:D_},k_=mm()(O_),A_=gm()(O_);function j_(e,t){return e?t?[...e,...t]:e:t}function M_(e,t,n){return new E_(Reflect.ownKeys(e).map(t=>new x_(t,e[t].ast)),[],n,t)}function N_(e){return e.ast}function P_(e,t,n){return new U_(e.map(N_),t,void 0,n)}var F_=Fs(e=>{for(;;){if(Jg(e))return a_;let t=e.encoding;if(!t)return e.recur?.(F_,Ds)??e;if(t.some(e=>e.transformation._tag===`Middleware`&&e.transformation.decode!==Ds))return a_;e=t[t.length-1].to}});function I_(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(I_)));default:return[`null`,`undefined`,`string`,`number`,`boolean`,`symbol`,`bigint`,`object`,`array`,`function`]}}function L_(e){switch(e._tag){default:return[];case`Declaration`:{let t=e.annotations?.[xh];return Array.isArray(t)?t:[]}case`Objects`:return e.propertySignatures.flatMap(e=>{let t=e.type;if(!Ov(t)){if(Ug(t))return[{key:e.name,literal:t.literal}];if(Wg(t))return[{key:e.name,literal:t.symbol}]}return[]});case`Arrays`:return e.elements.flatMap((e,t)=>{if(!Ov(e)){if(Ug(e))return[{key:t,literal:e.literal}];if(Wg(e))return[{key:t,literal:e.symbol}]}return[]});case`Union`:{if(e.types.length===0)return[];let t=e.types.map(e=>L_(F_(e)));return t[0].filter(e=>t.every(t=>t.some(t=>t.key===e.key&&t.literal===e.literal)))}case`Suspend`:return L_(e.thunk())}}var R_=new WeakMap,z_=Object.freeze([]),B_=e=>e===null?`null`:Array.isArray(e)?`array`:typeof e,V_=(e,t)=>t===`__proto__`?Object.hasOwn(e,t):t in e;function H_(e){let t=R_.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=F_(c);if(zg(l))continue;if(Ug(l)||Wg(l)){a??=new Map;let e=Ug(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=L_(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=I_(l);for(let n of e)(i[n]??=[]).push(t)}}let c={},l=e=>c[e]??=Object.freeze(i?.[e]??z_);if(o&&a)a.forEach(Object.freeze),t=e=>a.get(e)??z_;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(Zs(e)){let n=V_(e,r)?e[r]:void 0;if(n!==void 0)return a.get(n)??z_;if(t)return o}return z_}}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=B_(t);if(!Zs(t))return l(a);let o=new Set(i?.[a]),s;if(e){let[n,[i]]=e,c=V_(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=V_(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=V_(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(B_(e));return a?t.filter(t=>s[t]===void 0||s[t]===e):t};return R_.set(e,t),t}var U_=class extends $g{_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===B)return jh;let i=(o??=H_(n.types))(e,r);if(i.length===0)return Um(new qh(n,[],e,t));if(i.length===1){let r=a(i[0])(e,t);return r._tag===`Success`?r:Wp(r)?W_(n,r.cause,e,t):G_(n,r,e,t)}return K_(n,a,i,e,t)}}_rebuild(e,t,n){let r=bv(this.types,e);return r===this.types&&t===this.checks&&n===this.encodingChecks?this:new U_(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=Pv(t);switch(n._tag){case`Arrays`:{let t=n.elements.filter(Ug);if(t.length>0)return`${X_(n.isMutable)}[ ${t.map(t=>e(t)+Z_(t.context?.isOptional)).join(`, `)}, ... ]`;break}case`Objects`:{let t=n.propertySignatures.filter(e=>Ug(e.type));if(t.length>0)return`{ ${t.map(t=>`${X_(t.type.context?.isMutable)}${Wc(t.name)}${Z_(t.type.context?.isOptional)}: ${e(t.type)}`).join(`, `)}, ... }`;break}}return e(n)});return Array.from(new Set(n)).join(` | `)}};function W_(e,t,n,r){let i=ug(t);return i?Mm(new qh(e,[i],n,r)):jm(t)}function G_(e,t,n,r){return Xm(t,t=>W_(e,t,n,r))}function K_(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=J_(a,n);if(!o)return a.out?a.out:Um(new qh(e,a.issues??[],r,i));if(Wp(o))return q_(o,a);let s=!0;return Hm(()=>s?(s=!1,q_(o,a)):K_(e,t,n,r,i))}function q_(e,t){return nh(e,e=>t.out===Mh?Vm(t.input):t.out?t.out:Um(new qh(t.ast,t.issues??[],t.input,t.options)))}var J_=mm()({onItem(e,t){return e.parser(t)(e.input,e.options)},step(e,t,n){if(n._tag===`Failure`){let t=ug(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]),Mm(new Jh(e.ast,e.successes,e.input,e.options));if(e.out=n,e.successes)e.successes.push(e.ast.types[t]);else return Nm}}}),Y_=new U_([new o_(`Infinity`),new o_(`-Infinity`),new o_(`NaN`)]);function X_(e){return e?``:`readonly `}function Z_(e){return e?`?`:``}var Q_=class extends Es{_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 Q_(this.run,{...this.annotations,...e},this.aborted)}abort(){return new Q_(this.run,this.annotations,!0)}and(e,t){return new $_([this,e],t)}},$_=class extends Es{_tag=`FilterGroup`;checks;annotations;constructor(e,t=void 0){super(),this.checks=e,this.annotations=t}annotate(e){return new $_(this.checks,{...this.annotations,...e})}and(e,t){return new $_([this,e],t)}};function ev(e,t,n=!1){return new Q_((t,n,r)=>Zh(n,e(t,n,r),t,r),t,n)}function tv(e){return ev(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 nv=pv(d_,[tv()]),rv=new Yg(new U_([nv,Y_]),new Eg(vg(),hg(e=>globalThis.Number.isFinite(e)?e:globalThis.String(e))));function iv(e,t){let n=new globalThis.RegExp(e),r={source:n.source,flags:n.flags};return ev(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 av=new WeakMap;function ov(e,t){let n=Object.assign(Object.create(Object.getPrototypeOf(e)),e,t);return Reflect.ownKeys(t).every(e=>e===`context`||e===`encoding`)&&av.set(n,sv(e)),n}function sv(e){let t=av.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 av.set(e,n),n}function cv(e,t){return e.encoding===t?e:ov(e,{encoding:t})}function lv(e,t){if(e.context===t)return e;let n=sv(e);return n.context===t&&n.encoding===e.encoding?n:ov(e,{context:t})}function uv(e){return e.encoding?uv(e.encoding[e.encoding.length-1].to):e}function dv(e,t){if(e.checks){let n=e.checks[e.checks.length-1];return fv(e,Hu(e.checks.slice(0,-1),n.annotate(t)))}return ov(e,{annotations:{...e.annotations,...t}})}function fv(e,t){if(e._tag===`Suspend`&&t)throw Error(`Cannot add checks to Suspend`);return e.checks===t?e:ov(e,{checks:t})}function pv(e,t){return fv(e,j_(e.checks,t))}function mv(e,t){let n=t(e.to);return n===e.to?e:new Yg(n,e.transformation)}function hv(e,t){let n=e,r=n[n.length-1],i=mv(r,t);return i===r?e:Hu(e.slice(0,e.length-1),i)}function gv(e){return t=>t.encoding?cv(t,hv(t.encoding,e)):t}function _v(e,t){return gv(e=>lv(e,t))(e)}function vv(e,t){function n(r){if(r.encoding){let e=r.encoding[r.encoding.length-1];return t?.stopAt?.(e)?r:cv(r,hv(r.encoding,n))}return e(r)}return Fs(n)}function yv(e,t,n){let r=new Yg(e,t);return cv(n,n.encoding?[...n.encoding,r]:[r])}function bv(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 xv(e,t){return lv(e,e.context?new Zg(e.context.isOptional,e.context.isMutable,e.context.constructorDefault,{...e.context.annotations,...t}):new Zg(!1,!1,void 0,t))}var Sv=Fs(e=>Cv(lv(e,e.context?e.context.isOptional===!1?new Zg(!0,e.context.isMutable,e.context.constructorDefault,e.context.annotations):e.context:new Zg(!0,!1)))),Cv=gv(Sv),wv=Ps(e=>Sv(new U_([e,i_])));function Tv(e,t,n){return yv(e,n,t)}function Ev(e){let t=[],n=[];function r(e){switch(e._tag){case`Literal`:Gs(e.literal)&&!t.includes(e.literal)&&t.push(e.literal);return;case`UniqueSymbol`:t.includes(e.symbol)||t.push(e.symbol);return;case`Never`:return;case`Union`:for(let t=0;t<e.types.length;t++)r(e.types[t]);return;default:n.push(e)}}return r(e),{literals:t,parameters:n}}function Dv(e,t){let{literals:n,parameters:r}=Ev(e);return new E_(n.map(e=>new x_(e,t)),r.map(e=>new T_(e,t)))}function Ov(e){return e.context?.isOptional??!1}function kv(e){return e.context?.isMutable??!1}function Av(e){return e.annotations?.[`~structural`]===!0||e._tag===`FilterGroup`&&e.checks.every(Av)}function jv(e){function t(e){return Av(e)?[e]:e._tag===`FilterGroup`?e.checks.flatMap(t):[]}let n=e.flatMap(t);return Uu(n)?n:void 0}function Mv(e){let t=!0;function n(e){return t=t&&!e.encoding&&!Jg(e),t&&`recur`in e&&e.recur(n),e}return`recur`in e&&e.recur(n),t}var Nv=Fs(e=>{let t=sv(e);if(t!==e){let n=Nv(t);return n===t&&e.encoding===void 0?e:lv(n,e.context)}let n=`recur`in e?e.recur(Nv):e;if(`encodingChecks`in n&&n.encodingChecks){let t=Mv(e)?n.encodingChecks:Gg(n)||Kg(n)||Ig(n)&&n.typeParameters.length>0?jv(n.encodingChecks):void 0;return ov(n,{encodingChecks:void 0,checks:j_(n.checks,t)})}return n}),Pv=Fs(e=>Nv(Iv(e)));function Fv(e,t){let n=t,r=n.length,i=n[r-1],a=[new Yg(Iv(cv(e,void 0)),n[0].transformation.flip())];for(let e=1;e<r;e++)a.unshift(new Yg(Iv(n[e-1].to),n[e].transformation.flip()));let o=Iv(i.to);return o.encoding?cv(o,[...o.encoding,...a]):cv(o,a)}var Iv=Ps(e=>{if(e.encoding)return Fv(e,e.encoding);let t=sv(e);if(t!==e){let n=Iv(t);return n===t?e:lv(n,e.context)}return`flip`in e?e.flip(Iv):`recur`in e?e.recur(Iv):e});function Lv(e){switch(e._tag){case`Undefined`:return!0;case`Union`:return e.types.some(Lv);default:return!1}}function Rv(e,t){let n=t===0?Mh:Ah(t);return(r,i)=>r===B?jh:r===t?n:Um(new Gh(e,r,i))}function zv(e,t){return(n,r)=>n===B?jh:t(n)?Mh:Um(new Gh(e,n,r))}var Bv=vv(e=>{switch(e._tag){default:return e;case`Number`:return e.toCodecStringTree();case`Union`:return e.recur(Bv)}}),Vv=vv(e=>{switch(e._tag){default:return e;case`Symbol`:case`UniqueSymbol`:return e.toCodecStringTree();case`Union`:return e.recur(Vv)}}),Hv=`[\\s\\S]*?`,Uv=new globalThis.RegExp(`^${y_}$`),Wv=new globalThis.RegExp(`^(?:${y_}|Infinity|-Infinity|NaN)$`);function Gv(e){return iv(Uv,{expected:`a string representing a finite number`,representation:{id:`effect/schema/isStringFinite`,payload:null},toJsonSchema:()=>({pattern:Uv.source}),...e})}var Kv=pv(c_,[Gv()]),qv=new Yg(Kv,Mg),Jv=new Yg(new U_([Kv,Y_]),Mg);function Yv(e,t,n,r,i){for(let a=0;a<e.length;a++){let o=e[a];if(o._tag===`FilterGroup`){if(n=Yv(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 zh(o,e,t,i);if(n?n.push(r):n=[r],i.errors!==`all`||o.aborted)return n}}}return n}function Xv(e){if(!Ig(e))return;let t=e.annotations?.[Sh];return Ks(t)?t(e.typeParameters):void 0}var Zv=_h,Qv=Eh,$v=Dh;function ey(e){return e===null||typeof e==`string`||typeof e==`boolean`||typeof e==`number`&&globalThis.Number.isFinite(e)}function ty(e){return e===void 0||typeof e==`string`}function ny(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 ry(e){return ny(e,ey)}var iy=new e_([],()=>(e,t,n)=>ry(e)?Mh:Um(new Gh(t,e,n)),{representation:{id:`effect/schema/Json`,payload:null},expected:`JSON value`,toCodecJson:()=>void 0,toCodecStringTree:()=>cy}),ay=new Yg(iy,jg()),oy=new Yg(new U_([new p_(!1,[],[iy]),new E_([],[new T_(c_,iy)])]),jg());function sy(e){return ny(e,ty)}var cy=new Yg(new e_([],()=>(e,t,n)=>sy(e)?Mh:Um(new Gh(t,e,n)),{expected:`StringTree`,toCodecStringTree:()=>void 0}),jg()),ly=(e,t,n)=>e===Mh?n(t):nh(e,n);function uy(e){if(e._tag===`Middleware`)return(t,n,r)=>dy(t===Mh?e.decode(Ah(Nh(n)),r):e.decode(eh(t,Nh),r));let t=e.decode;switch(t._tag){case`Passthrough`:return(e,t)=>e===Mh?Ah(t):e;case`Transform`:{let e=e=>e===B?jh:Ah(t.transform(e));return(t,n)=>ly(t,n,e)}case`TransformOptional`:{let e=e=>Ph(t.transform(Nh(e)));return(t,n)=>ly(t,n,e)}case`TransformEffect`:return(e,n,r)=>ly(e,n,e=>e===B?jh:t.transform(e,r));case`TransformOptionalEffect`:return(e,n,r)=>ly(e,n,e=>dy(t.transform(Nh(e),r)))}}var dy=e=>nh(e,Ph),fy=(e,t,n,r)=>Xm(r,r=>Wm(()=>Om(r,r=>new Bh(e,r,t,n))));function py(e,t){let n=uy(e.link.transformation),r;return(i,a)=>{if(i===B)return jh;if(e.isConstructed(i))return Mh;let o=(r??=t(e.link.to))(i,a);return n(o,i,a)}}function my(e,t){let n=e.context.constructorDefault;return(r,i)=>{if(r!==B&&r!==void 0)return t(r,i);let a=n;if(Wp(a)&&a._tag===`Success`){let e=t(a[z],i);return e===Mh?a:e}return nh(fy(e,r,i,a),e=>{let n=t(e,i);return n===Mh?Ah(e):n})}}function hy(e,t){let n=t(e);return e.context?.constructorDefault===void 0?n:my(e,n)}function gy(e,t,n,r,i){if(e._tag===`Declaration`)for(let n of e.typeParameters)t(n);let a=n?Xv(e):void 0,o=a?py(a,t):r??e.getParser(t,n),s=e.checks,c=e.encoding,l=c?.map(e=>uy(e.transformation)),u=e.encodingChecks;if(!c&&!s&&!u)return o;let d,f=(t,n)=>{let r=o(t,n);if(u&&!n.disableChecks){if(Wp(r)){if(r._tag===`Success`){let i=r===Mh?t:r[z];if(t!==B&&i!==B){let i=Yv(u,t,void 0,e,n);i&&(r=Um(new Wh(e,i,t,n)))}}}else r=Jm(r,r=>{if(t!==B&&r!==B){let r=Yv(u,t,void 0,e,n);if(r)return Um(new Wh(e,r,t,n))}return Vm(r)})}if(s&&!n.disableChecks){if(Wp(r)){if(r._tag===`Success`){let i=r===Mh?t:r[z];if(i===B)return r;let a=Yv(s,i,void 0,e,n);a&&(r=Um(new Wh(e,a,i,n)))}}else r=Jm(r,t=>{if(t!==B){let r=Yv(s,t,void 0,e,n);if(r)return Um(new Wh(e,r,t,n))}return Vm(t)})}return r},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[z],o=t(a,r)):o=nh(o,e=>{let n=t(e,r);return n===Mh?Ah(e):n})}if(o._tag===`Success`){let e=o[z],t=p(e,r);return t===Mh?o:t}return o=fy(e,n,r,o),nh(o,e=>{let t=p(e,r);return t===Mh?Ah(e):t})}:p}var _y=Symbol(),vy=new WeakMap,yy=e=>Cy(e).parser,by=e=>Cy(e).makeEffect,xy=e=>hy(e,by),Sy=class{ast;constructor(e){this.ast=e}get decodeEffect(){return this.cachedDecodeEffect??=gy(this.ast,yy)}get parser(){return this.decodeEffect}get makeEffect(){return this.cachedMakeEffect??=gy(this.ast,by,xy)}};function Cy(e){let t=vy.get(e);if(t!==void 0)return t;let n=new Sy(e);return vy.set(e,n),n}function wy(e){let t=e.ast,n;return(e,r)=>(n??=Ly(Wy,Nv(t)))(e,r?.disableChecks?r?.parseOptions?{...r.parseOptions,disableChecks:!0}:{disableChecks:!0}:r?.parseOptions)}function Ty(e){let t=wy(e);return(e,n)=>{let r=$m(t(e,n));return Pm(r)?Eu(r.value):(dg(r.cause,`Option adapter can only return none for schema issues`),Tu())}}function Ey(e){return Hy(Nv(e.ast))}function Dy(e){return ky(e.ast)}function Oy(e){{let t=Ry(Fy(e));return e=>{let n=t(e,Xg);return Pm(n)?!0:(dg(n.cause,`Type guard adapter can only return false for schema issues`),!1)}}}function ky(e){let t=Nv(e),n=e=>(n=Oy(t),n(e));return e=>n(e)}function Ay(e,t){let n=Fy(e.ast);return t===void 0?n:(e,r)=>n(e,Ny(t,r))}function jy(e,t){return zy(Ay(e,t))}function My(e,t){return By(Ay(e,t))}var Ny=(e,t)=>t?{...e,...t}:e,Py=e=>e===B?Um(new Kh):Vm(e);function Fy(e){return Ly(Uy,e)}function Iy(e,t){return e===Mh?Vm(t):Wp(e)?e[z]===B?Py(B):e:nh(e,Py)}function Ly(e,t){let n;return(r,i)=>{let a=(n??=e(t))(r,i??Xg);return a===Mh?Vm(r):Wp(a)?a[z]===B?Py(B):a:nh(a,Py)}}function Ry(e){return(t,n)=>$m(e(t,n))}function zy(e){let t=Ry(e);return(e,n)=>{let r=t(e,n);return Pm(r)?Eu(r.value):(dg(r.cause,`Option adapter can only return none for schema issues`),Tu())}}function By(e){let t=Ry(e);return(e,n)=>{let r=t(e,n);return Pm(r)?Fu(r.value):Iu(dg(r.cause,`Result adapter can only return schema issues`))}}function Vy(e,t){let n=$m(e);if(Pm(n))return n.value;let r=dg(n.cause,t);throw Error(`Schema validation failed`,{cause:r})}function Hy(e){let t,n;return(r,i)=>{t??=Cy(e);let a=i?.disableChecks?i.parseOptions?{...i.parseOptions,disableChecks:!0}:{disableChecks:!0}:i?.parseOptions??Xg,o=t.make;if(o!==void 0&&r!==B){let e;try{e=o(r,a)}catch(e){throw dg(Dm(e),`Constructor adapter can only throw schema issues`),e}if(e!==_y&&e!==B)return e}return Vy(Iy((n??=t.makeEffect)(r,a),r),`Constructor adapter can only throw schema issues`)}}var Uy=e=>Cy(e).parser,Wy=e=>Cy(e).makeEffect,Gy=`~effect/Schema/Schema`,Ky=Symbol(),qy={[Gy]:Gy,get make(){let e=Ey(this);return Object.defineProperty(this,"make",{value:e,enumerable:!0}),e},get makeEffect(){let e=wy(this);return Object.defineProperty(this,"makeEffect",{value:e,enumerable:!0}),e},get makeOption(){let e=Ty(this);return Object.defineProperty(this,"makeOption",{value:e,enumerable:!0}),e},pipe(){return ws(this,arguments)},annotate(e){return this.rebuild(dv(this.ast,e))},annotateKey(e){return this.rebuild(xv(this.ast,e))},check(...e){return this.rebuild(pv(this.ast,e))},rebuild(e){return Jy(e,this[Ky])}};function Jy(e,t){function n(){}let r=Object.setPrototypeOf(n,qy);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[Ky]=t,r.ast=e,r}function Yy(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function Xy(e){return e.replace(/~1/g,`/`).replace(/~0/g,`~`)}function Zy(e){return encodeURI(Yy(e)).replace(/#/g,`%23`)}function Qy(e){if(e.length===0||e===`#`)return``;if(!e.startsWith(`#`))return;let t=e.slice(1);try{if(encodeURI(t).replace(/%25/g,`%`).replace(/#/g,`%23`)!==t)return;let e=decodeURIComponent(t);return e.startsWith(`/`)&&!/~(?:[^01]|$)/.test(e)?e:void 0}catch{return}}function $y(e,t){return n(e,!1,!0);function n(e,r,i=!1){if(!Xs(e))return e;let a=r||!i&&rb(e.$id),o={};for(let t of Object.keys(e)){let r=e[t],i=r;switch(t){case`$defs`:case`properties`:case`patternProperties`:case`dependentSchemas`:i=nb(r,e=>n(e,a))??r;break;case`allOf`:case`anyOf`:case`oneOf`:case`prefixItems`:i=Array.isArray(r)?r.map(e=>n(e,a)):r;break;case`not`:case`additionalProperties`:case`propertyNames`:case`unevaluatedProperties`:case`items`:case`contains`:case`unevaluatedItems`:case`if`:case`then`:case`else`:case`contentSchema`:i=n(r,a)}Pc(o,t,i)}return t(o,a),o}}function eb(e,t){return $y(e,e=>{tb(e,t)})}function tb(e,t){typeof e.$ref==`string`&&Pc(e,`$ref`,t(e.$ref,`$ref`)),typeof e.$dynamicRef==`string`&&Pc(e,`$dynamicRef`,t(e.$dynamicRef,`$dynamicRef`))}function nb(e,t){if(!Xs(e))return;let n={};for(let r of Object.keys(e))Pc(n,r,t(e[r],r));return n}function rb(e){return typeof e==`string`&&e.length>0&&e[0]!==`#`}var ib=[`$anchor`,`$defs`,`$dynamicAnchor`,`$dynamicRef`,`$vocabulary`,`contentSchema`,`dependentRequired`,`dependentSchemas`,`maxContains`,`minContains`,`prefixItems`,`unevaluatedItems`,`unevaluatedProperties`];[...ib],[...ib];var ab=vv(e=>{let t=ub(e,ab),n=e.context;return t===e||n===void 0?t:_v(t,ob(n))});function ob(e){return e.constructorDefault===void 0?e:new Zg(e.isOptional,e.isMutable,void 0,e.annotations)}function sb(e){if(e.propertySignatures.some(e=>typeof e.name!=`string`))throw new globalThis.Error(`Objects property names must be strings`,{cause:e})}function cb(e){return t=>{let n=[...t].sort((t,n)=>e(Pv(t))-e(Pv(n)));return n.some((e,n)=>e!==t[n])?n:t}}var lb=cb(e=>{switch(e._tag){case`BigInt`:case`Symbol`:case`UniqueSymbol`:return 0;default:return 1}});function ub(e,t){switch(e._tag){case`Declaration`:{let n=e.annotations?.toCodecJson??e.annotations?.toCodec;if(!Ks(n))return cv(e,[ay]);let r=n(e.typeParameters.map(e=>Jy(Pv(e))));return r===void 0?e:cv(e,[mv(r,t)])}case`Unknown`:return cv(e,[ay]);case`ObjectKeyword`:return cv(e,[oy]);case`Undefined`:case`Void`:case`Literal`:case`Number`:return e.toCodecJson();case`UniqueSymbol`:case`Symbol`:case`BigInt`:return e.toCodecStringTree();case`Objects`:return sb(e),e.recur(t,Vv);case`Union`:{let n=lb(e.types);return n===e.types?e.recur(t):new U_(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}globalThis.RegExp;var db=e=>e.replace(/[/\\^$*+?.()|[\]{}]/g,`\\$&`);function fb(e,t){return t.length>0&&(e+=`\n at ${Gc(t)}`),Error(e)}function pb(e){return`#/$defs/${Zy(e)}`}var mb=new Set([...kh,bh,...Ch]);function hb(e,t){if(e===void 0)return;let n={},r=e.title;typeof r==`string`&&(n.title=r);let i=e.description,a=e.expected;typeof i==`string`?n.description=i:t?.generateDescriptions===!0&&typeof a==`string`&&(n.description=a);let o=e.default;ry(o)&&(n.default=o);let s=e.examples;Array.isArray(s)&&ry(s)&&(n.examples=s);let c=e.readOnly;typeof c==`boolean`&&(n.readOnly=c);let l=e.writeOnly;typeof l==`boolean`&&(n.writeOnly=l);let u=e.format;typeof u==`string`&&(n.format=u);let d=e.contentEncoding;typeof d==`string`&&(n.contentEncoding=d);let f=e.contentMediaType;typeof f==`string`&&(n.contentMediaType=f);let p=e.contentSchema;if(ry(p)&&(n.contentSchema=p),t?.includeAnnotationKey!==void 0)for(let[r,i]of Object.entries(e))mb.has(r)||!t.includeAnnotationKey(r)||ry(i)&&Pc(n,r,i);return Object.keys(n).length===0?void 0:n}function gb(e){let t=e.type===`number`||e.type===`integer`?e.type:void 0,n=e;if(t!==void 0&&(n={...e},delete n.type),Array.isArray(n.allOf)){let e=[],r=!1;for(let i of n.allOf){let n=gb(i);n.type!==void 0&&(r=!0,(t===void 0||n.type===`integer`)&&(t=n.type)),Object.keys(n.schema).length>0&&e.push(n.schema)}if(r){let{allOf:t,...r}=n;n=e.length===0?r:{...r,allOf:e}}}return{type:t,schema:n}}function _b(e){if(!Array.isArray(e.anyOf)||e.anyOf.length!==2||e.anyOf[0]?.type!==`number`)return!1;let t=e.anyOf[1];return t?.type===`string`&&Array.isArray(t.enum)&&t.enum.length===3&&t.enum.includes(`NaN`)&&t.enum.includes(`Infinity`)&&t.enum.includes(`-Infinity`)}var vb=`|type|format|pattern|multipleOf|minimum|maximum|exclusiveMinimum|exclusiveMaximum|minLength|maxLength|minItems|maxItems|uniqueItems|minProperties|maxProperties|propertyNames|`;function yb(e,t){return Object.keys(e).every(e=>t.includes(`|${e}|`))}function bb(e,t){return typeof e.$ref!=`string`&&t.every(t=>!Object.hasOwn(e,t))}var xb=`|title|description|default|examples|readOnly|writeOnly|`,Sb=vb+xb;function Cb(e,t,n){if(Object.keys(e).length===0)return t;let r=Object.keys(t);if(r.length===0)return e;let i=e.type===`number`||e.type===`integer`?e.type:void 0,a=_b(e);if(i!==void 0||a){let r=gb(t);if(r.type!==void 0){let t=i===`integer`||r.type===`integer`?`integer`:`number`,o={...e,type:t};a&&delete o.anyOf;let s=Object.keys(r.schema);return s.length===0?o:yb(r.schema,xb)&&bb(o,s)?{...o,...r.schema}:Cb(o,r.schema,n)}}if(n&&bb(e,r))return{...e,...t};let o=Array.isArray(t.allOf)&&r.length===1?t.allOf:[t];return Array.isArray(e.allOf)?{...e,allOf:[...e.allOf,...o]}:typeof e.$ref==`string`?{allOf:[e,...o]}:{...e,allOf:o}}function wb(e,t=new Set){return typeof e==`boolean`?e:t.has(e)?!0:(t.add(e),e.every(e=>wb(e,t)))}function Tb(e){return Array.isArray(e)}function Eb(e,t,n,r){let i=new Map,a=new Map,o=new WeakMap,s=new Map,c=new Map,l=Object.keys(n);for(let e of l)m(e,[`references`,e]);let u=Ku(e,(e,n)=>v(e,t[n],[]));for(let[e,t]of s.values())if(!wb(e))for(let e of t)Array.isArray(e.oneOf)&&(e.anyOf=e.oneOf,delete e.oneOf);for(let e of l){let t=n[e],r=g(t);if(r===void 0)continue;let o=i.get(e)[0],s=c.get(r),l=s?.find(e=>vc(i.get(e)[0],o));l===void 0?s===void 0?c.set(r,[e]):s.push(e):a.set(e,l)}let d=Ku(u,h),f={};for(let e of l)a.has(e)||Pc(f,e,h(i.get(e)[0]));return{dialect:`draft-2020-12`,schemas:d,definitions:f};function p(e){return Array.isArray(e.oneOf)&&s.get(e.oneOf)?.[1].push(e),e}function m(e,t){if(!Object.hasOwn(n,e))throw fb(`Invalid reference ${e}`,[...t,`$ref`]);let r=i.get(e);if(r!==void 0)return r;let a=[{},[]];return i.set(e,a),a[0]=v(n[e],[`references`,e],a[1]),a}function h(e){return eb(e,e=>{let t=Qy(e);if(t===void 0){if(/^#(?:\/|%2f)/i.test(e))throw Error(`Invalid JSON Pointer URI fragment ${JSON.stringify(e)}`);return e}if(!t.startsWith(`/$defs/`))return e;let n=t.indexOf(`/`,7),r=a.get(Xy(t.slice(7,n<0?void 0:n)));return r===void 0?e:e.replace(/^#(?:\/|%2f).*?(?:\/|%2f).*?(?=\/|%2f|$)/i,pb(r))})}function g(e){if(e._tag===`Reference`)return;let t=e.checks.length===0?e.annotations:e.checks[e.checks.length-1].annotations;return typeof t?.identifier!=`string`&&typeof t?.[`~identifier`]==`string`?t[bh]:void 0}function _(e,t,n,i){let a=e.annotations,o=a?.toJsonSchema;if(o!==void 0){let s=o({type:t,schemas:e.representation?.schemas?.map((e,t)=>v(e,[...n,`representation`,`schemas`,t],i))??[]}),c=Tb(s);c&&i.push(!1);let l=c?s[0]:s,u=hb(a,r),d=u===void 0?l:{...l,...u},f=u===void 0?vb:Sb;return[d,e._tag===`Filter`&&yb(d,f)&&(u===void 0||yb(u,xb))?!0:void 0]}if(e._tag===`Filter`){i.push(!1);return}let s=e.checks.flatMap((e,r)=>{let a=_(e,t,[...n,`checks`,r],i);return a===void 0?[]:[a[0]]});if(s.length===0)return;let c=hb(a,r),l={allOf:s};return[c===void 0?l:{...l,...c}]}function v(e,t,n){if(e._tag===`Reference`)return n.push(m(e.$ref,t)[1]),{$ref:pb(e.$ref)};let i=o.get(e);if(i!==void 0)return n.push(i[1]),i[0];let a=[];n.push(a);let s=y(e,t,a),c=hb(e.annotations,r);c!==void 0&&(s={...s,...c});for(let n=0;n<e.checks.length;n++){let r=typeof s.type==`string`&&Db(s.type)?s.type:void 0,i=_(e.checks[n],r,[...t,`checks`,n],a);i!==void 0&&(s=Cb(s,...i))}return o.set(e,[s,a]),p(s)}function y(e,t,n){switch(e._tag){case`Any`:case`Unknown`:return{};case`ObjectKeyword`:return{anyOf:[{type:`object`},{type:`array`}]};case`Void`:case`Undefined`:case`Null`:return{type:`null`};case`BigInt`:return{type:`string`,allOf:[{pattern:`^-?\\d+$`}]};case`Symbol`:return{type:`string`,allOf:[{pattern:`^Symbol\\(([\\s\\S]*)\\)$`}]};case`UniqueSymbol`:return globalThis.Symbol.keyFor(e.symbol)===void 0?{not:{}}:{type:`string`,enum:[globalThis.String(e.symbol)]};case`Declaration`:return n.push(!1),{};case`Suspend`:return v(e.thunk,[...t,`thunk`],n);case`Never`:return{not:{}};case`String`:return{type:`string`};case`Number`:return{anyOf:[{type:`number`},{type:`string`,enum:[`NaN`,`Infinity`,`-Infinity`]}]};case`Boolean`:return{type:`boolean`};case`Literal`:{let t=e.literal;return typeof t==`bigint`?{type:`string`,enum:[globalThis.String(t)]}:{type:typeof t,enum:[t]}}case`Enum`:{let n=e.enums.map(([e,n],r)=>{if(typeof n==`number`&&!globalThis.Number.isFinite(n))throw fb(`Invalid numeric enum value ${globalThis.String(n)}`,[...t,`enums`,r,1]);return{type:typeof n,enum:[n],title:e}});return n.length===0?{not:{}}:{anyOf:n}}case`TemplateLiteral`:return{type:`string`,pattern:`^${e.parts.map(kb).join(``)}$`};case`Arrays`:{if(e.rest.length>1)throw fb(`Invalid schema representation document`,[...t,`rest`]);let i={type:`array`},a=e.elements.length,o=e.elements.map((e,i)=>{e.isOptional&&a--;let o=v(e.type,[...t,`elements`,i,`type`],n),s=hb(e.annotations,r);return s===void 0?o:p(Cb(o,s))});if(o.length>0?(i.prefixItems=o,i.maxItems=e.elements.length,a>0&&(i.minItems=a)):i.items=!1,e.rest.length===1){delete i.maxItems;let r=v(e.rest[0],[...t,`rest`,0],n);Object.keys(r).length>0?i.items=r:delete i.items}return i}case`Objects`:{if(e.propertySignatures.length===0&&e.indexSignatures.length===0)return{not:{type:`null`}};let i={type:`object`},a={},o=[];for(let i=0;i<e.propertySignatures.length;i++){let s=e.propertySignatures[i];if(typeof s.name!=`string`)throw fb(`Invalid schema representation document`,[...t,`propertySignatures`,i,`name`]);let c=s.name,l=v(s.type,[...t,`propertySignatures`,i,`type`],n),u=hb(s.annotations,r);Pc(a,c,u===void 0?l:p(Cb(l,u))),s.isOptional||o.push(c)}e.propertySignatures.length>0&&(i.properties=a),o.length>0&&(i.required=o);let s={},c=[],l=[],u=!1;for(let r=0;r<e.indexSignatures.length;r++){let i=e.indexSignatures[r],a=v(i.type,[...t,`indexSignatures`,r,`type`],n);vc(a,{not:{}})&&(a=!1),l.push(a);let o=b(i.parameter,[...t,`indexSignatures`,r,`parameter`],new Set);if(o===void 0){u=!0,n.push(!1);continue}if(o.length===0)c.push(a);else for(let e of o){let t=s[e];Pc(s,e,t===void 0?a:t===!1||a===!1?!1:p(Cb(t,a)))}}let d=Object.keys(s).length>0;if(d&&(i.patternProperties=s),u&&r?.onExcessProperty===`error`){let r=[];e.propertySignatures.length>0&&r.push({enum:Object.keys(a)});for(let i=0;i<e.indexSignatures.length;i++)r.push(v(e.indexSignatures[i].parameter,[...t,`indexSignatures`,i,`parameter`],n));i.propertyNames=r.length===1?r[0]:{anyOf:r},i.additionalProperties=l.length===1?l[0]:{anyOf:l},c.length>0&&(i.allOf=c.map(e=>({type:`object`,additionalProperties:e})))}else c.length===0?i.additionalProperties=u||r?.onExcessProperty!==`error`:c.length===1&&e.propertySignatures.length===0&&!d?i.additionalProperties=c[0]:c.length>0&&(i.allOf=c.map(e=>({type:`object`,additionalProperties:e})));return typeof i.additionalProperties==`object`&&i.additionalProperties!==null&&Object.keys(i.additionalProperties).length===0&&delete i.additionalProperties,i}case`Union`:{let r=[],i=e.types.map((e,n)=>v(e,[...t,`types`,n],r));if(n.push(r),i.length===0)return{not:{}};let a=e.options?.mode??`anyOf`;if(a===`anyOf`&&i.length>1){let e=Ob(i);if(e!==void 0)return e}return a===`oneOf`&&s.set(i,[r,[]]),{[a]:i}}}}function b(e,t,r){switch(e._tag){case`Reference`:{if(!Object.hasOwn(n,e.$ref))throw fb(`Invalid reference ${e.$ref}`,[...t,`$ref`]);if(m(e.$ref,t),r.has(e.$ref))return;let i=new Set(r).add(e.$ref);return b(n[e.$ref],[`references`,e.$ref],i)}case`String`:{if(e.checks.length===0)return[];if(e.checks.length!==1||e.checks[0]._tag!==`Filter`||e.checks[0].annotations?.toJsonSchema===void 0)return;let n=[],r=v(e,t,n);return wb(n)&&r.type===`string`&&typeof r.pattern==`string`&&yb(r,`|type|pattern|title|description|default|examples|readOnly|writeOnly|`)?[r.pattern]:void 0}case`TemplateLiteral`:return e.checks.length===0?[`^${e.parts.map(kb).join(``)}$`]:void 0;case`Union`:{if(e.types.length===0||e.checks.length>0||e.options?.mode===`oneOf`)return;let n=[];for(let i=0;i<e.types.length;i++){let a=b(e.types[i],[...t,`types`,i],r);if(a===void 0)return;if(a.length===0)return[];n.push(...a)}return n}default:throw fb(`Invalid schema representation document`,t)}}}function Db(e){return e===`string`||e===`number`||e===`boolean`||e===`array`||e===`object`||e===`null`||e===`integer`}function Ob(e){let t,n=[];for(let r of e){if(Object.keys(r).length!==2||r.type===void 0||!Array.isArray(r.enum)||r.enum.length===0)return;if(t===void 0)t=r.type;else if(r.type!==t)return;for(let e of r.enum){if(n.includes(e))return;n.push(e)}}return{type:t,enum:n}}function kb(e){switch(e._tag){case`Literal`:return db(globalThis.String(e.literal));case`String`:return Hv;case`Number`:return y_;case`TemplateLiteral`:return e.parts.map(kb).join(``);case`Union`:return`(?:${e.types.map(kb).join(`|`)})`;default:throw fb(`Invalid schema representation document`,[])}}function Ab(e,t){let n=Eb([e.representation],[[`representation`]],e.references,t);return{dialect:n.dialect,schema:n.schemas[0],definitions:n.definitions}}var jb=({identifier:e})=>e;function Mb(e){return e===void 0?void 0:{annotations:e}}function Nb(e,t){let{references:n,representations:r}=Pb([e],t);return{representation:r[0],references:n}}function Pb(e,t){let n={},r=new Map,i=new Set,a=new Map,o=new Set;for(let t of e)f(t);let s=t?.referencePolicy??jb;for(let e of a.values())for(let t of e.values()){let e=s({ast:t.ast,occurrences:t.occurrences,identifier:t.identifier});e===void 0?t.isRecursive&&(t.reference=c(`${t.ast._tag}_`,t,``)):t.reference=c(e,t,e===t.identifier||!e.endsWith(`_`)?`_`:``)}return{representations:Ku(e,e=>m(e)),references:n};function c(e,t,n=`_`){let i=e,a=0;for(;r.has(i);){if(r.get(i)===t)return i;i=`${e}${n}${++a}`}return r.set(i,t),i}function l(e,t,n){let r=t.fallback;return r===void 0?n===t.identifier?e:dv(e,{identifier:n}):Th(e)===r?e:dv(e,{[bh]:r})}function u(e,t){if(!Object.hasOwn(n,e)&&!i.has(e)){i.add(e);let r=h(t);i.delete(e),Pc(n,e,r)}return{_tag:`Reference`,$ref:e}}function d(e){let t=uv(e),n=sv(t),r=wh(t),i=r===void 0?(t===e?void 0:wh(e))??Th(t):void 0;i!==void 0&&(r=`${i}Encoded`);let o=a.get(n);o===void 0&&(o=new Map,a.set(n,o));let s=o.get(r);return s===void 0&&(s={ast:n,identifier:r,fallback:i,occurrences:0,isRecursive:!1,reference:void 0},o.set(r,s)),s}function f(e){let t=d(e),n=t.ast;if(t.occurrences++,o.has(t)){t.isRecursive=!0;return}if(!(t.occurrences>1)){switch(o.add(t),p(n.checks),n._tag){case`Declaration`:case`Arrays`:case`Objects`:case`Union`:n.recur(e=>(f(e),e));break;case`TemplateLiteral`:n.parts.forEach(f);break;case`Suspend`:f(n.thunk())}o.delete(t)}}function p(e){e?.forEach(e=>{e.annotations?.representation?.schemas?.forEach(e=>f(Nv(e))),e._tag===`FilterGroup`&&p(e.checks)})}function m(e){let t=d(e),n=t.ast,r=t.reference;return r===void 0?h(n):u(r,t.identifier===void 0?n:l(n,t,r))}function h(e){let t=g(e.checks);switch(e._tag){case`Declaration`:return{_tag:`Declaration`,typeParameters:e.typeParameters.map(e=>m(e)),checks:t,...v(e.annotations)};case`Null`:case`Undefined`:case`Void`:case`Never`:case`Unknown`:case`Any`:case`String`:case`Boolean`:case`Number`:case`BigInt`:case`Symbol`:case`ObjectKeyword`:return{_tag:e._tag,checks:t,...Mb(e.annotations)};case`Literal`:return{_tag:`Literal`,literal:e.literal,checks:t,...Mb(e.annotations)};case`UniqueSymbol`:return{_tag:`UniqueSymbol`,symbol:e.symbol,checks:t,...Mb(e.annotations)};case`Enum`:return{_tag:`Enum`,enums:e.enums,checks:t,...Mb(e.annotations)};case`TemplateLiteral`:return{_tag:`TemplateLiteral`,parts:e.parts.map(e=>m(e)),checks:t,...Mb(e.annotations)};case`Arrays`:return{_tag:`Arrays`,elements:e.elements.map(e=>{let t=uv(e),n=t.context?.annotations;return{isOptional:Ov(t),type:m(e),...Mb(n)}}),rest:e.rest.map(e=>m(e)),checks:t,...Mb(e.annotations)};case`Objects`:return{_tag:`Objects`,propertySignatures:e.propertySignatures.map(e=>{let t=uv(e.type),n=t.context?.annotations;return{name:e.name,type:m(e.type),isOptional:Ov(t),isMutable:kv(t),...Mb(n)}}),indexSignatures:e.indexSignatures.map(e=>({parameter:m(e.parameter),type:m(e.type)})),checks:t,...Mb(e.annotations)};case`Union`:return{_tag:`Union`,types:e.types.map(e=>m(e)),...e.options===void 0?{}:{options:e.options},checks:t,...Mb(e.annotations)};case`Suspend`:return{_tag:`Suspend`,checks:[],thunk:m(e.thunk()),...Mb(e.annotations)}}}function g(e){return e?.map(_)??[]}function _(e){switch(e._tag){case`Filter`:return{_tag:`Filter`,aborted:e.aborted,...y(e.annotations)};case`FilterGroup`:return{_tag:`FilterGroup`,checks:Ku(e.checks,_),...y(e.annotations)}}}function v(e){if(e===void 0)return;let{representation:t,...n}=e;return{...t===void 0?void 0:{representation:t},...Object.keys(n).length===0?void 0:{annotations:n}}}function y(e){if(e===void 0)return;let{representation:t,...n}=e,r=t===void 0?void 0:t.schemas===void 0?t:{...t,schemas:t.schemas.map(e=>m(Nv(e)))};return{...r===void 0?void 0:{representation:r},...Object.keys(n).length===0?void 0:{annotations:n}}}}function Fb(e){return Pm(e)?e.value:{issues:[{message:km(e.cause)}]}}function Ib(e,t){let n=Ay(e),r={errors:`all`,...t?.parseOptions},i=eg(t),a=e=>{let t=new Ef(`sync`),a=Qm(Zm(n(e,r),{onFailure:i,onSuccess:e=>({value:e})}),{scheduler:t});a.currentDispatcher?.flush();let o=a.pollUnsafe();return o?Fb(o):new Promise(e=>{a.addObserver(t=>{e(Fb(t))})})};if(Object.hasOwn(e,`~standard`)){let t=e;return`validate`in t[`~standard`]||Object.assign(t[`~standard`],{validate:a}),t}return Object.assign(e,{"~standard":{version:1,vendor:`effect`,validate:a}})}var Lb=e=>e,Rb=`~effect/Schema/SchemaError`;function zb(e){return Qs(e,`~effect/Schema/SchemaError`)&&e[`~effect/Schema/SchemaError`]===`~effect/Schema/SchemaError`}function Bb(){return(e,t,n)=>ex(new e_(e.map(N_),e=>t(e.map(e=>ex(e))),n))}function Vb(e,t){return Bb()([],()=>(t,n,r)=>e(t)?Vm(t):Um(new Gh(n,t,r)),t)}var Hb=class extends Af(`SchemaError`){[Rb]=Rb;constructor(e){let t=nl();rl(0);try{super({issue:e})}finally{rl(t)}}get message(){return sg(this.issue)}toString(){return`SchemaError(${this.message})`}};function Ub(e){return zb(e)}function Wb(e){return Wp(e)?Gb(e):Xm(e,e=>Wm(()=>Om(e,e=>new Hb(e))))}function Gb(e){return Pm(e)?e:jm(Om(e.cause,e=>new Hb(e)))}function Kb(e,t){let n;for(let r of e.reasons){if(!Em(r)||!Ub(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 qb(e){let t=$m(e);if(Pm(t))return t.value;throw Kb(t.cause,`Sync adapter can only throw schema errors`)}function Jb(e,t){return Ib(e,t)}var Yb=Dy;function Xb(e,t){let n=Ay(e,t);return(e,t)=>Wb(n(e,t))}var Zb=jy;function Qb(e,t){let n=My(e,t);return(e,t)=>zu(n(e,t),e=>new Hb(e))}function $b(e,t){let n=Xb(e,t);return(e,t)=>qb(n(e,t))}var ex=Jy,tx=Lb(e=>ex(Sv(e.ast),{schema:e})),V=Lb(e=>{let t=dx(e);return ex(wv(e.ast),{schema:t})});function H(e){let t=ex(new o_(e),{literal:e,transform(n){return t.pipe(px(H(n),{decode:hg(()=>n),encode:hg(()=>e)}))}});return t}var U=ex(a_),nx=ex(t_),rx=ex(i_),ix=ex(c_),ax=ex(d_),W=ex(f_);function ox(e,t){return ex(e,{fields:t,mapFields(e,t){let n=e(this.fields);return ox(M_(n,t?.unsafePreserveChecks?this.ast.checks:void 0),n)}})}function G(e){return ox(M_(e,void 0),e)}function sx(e,t){return ex(Dv(e.ast,t.ast),{key:e,value:t})}var K=Lb(e=>ex(new p_(!1,[],[e.ast]),{value:e}));function cx(e,t){return ex(e,{members:t,mapMembers(e,t){let n=e(this.members);return cx(P_(n,this.ast.options,t?.unsafePreserveChecks?this.ast.checks:void 0),n)}})}function lx(e,t){return cx(P_(e,t,void 0),e)}function q(e){let t=e.map(H);return ex(P_(t,void 0,void 0),{literals:e,members:t,mapMembers(e){return lx(e(this.members))},pick(e){return q(e)},transform(e){return lx(t.map((t,n)=>t.transform(e[n])))}})}var ux=Lb(e=>lx([e,nx])),dx=Lb(e=>lx([e,rx]));function J(...e){return t=>t.check(...e)}function fx(e){return t=>ex(t.ast,{schema:t,identifier:e})}function px(e,t){return n=>ex(Tv(n.ast,e.ast,t?Og(t):jg()),{from:n,to:e})}function mx(e,t){return Vb(t=>t instanceof e,t)}function hx(){return(e,t)=>new Yg(e.ast,Og(t))}var gx=ev,_x=`^\\S[\\s\\S]*\\S$|^\\S$|^$`;function vx(e){let t=new globalThis.RegExp(_x);return gx(e=>e.trim()===e,{expected:`a string with no leading or trailing whitespace`,representation:{id:`effect/schema/isTrimmed`,payload:null},toJsonSchema:()=>({pattern:t.source}),toCode:()=>({runtime:`Schema.isTrimmed()`}),arbitraryConstraint:{patterns:[{source:_x,flags:``}]},...e})}function yx(e,t){let n=e.source,r=e.flags,i=/^[dg]*uy?$/.test(r),a=r===``?`new RegExp(${R(n)})`:`new RegExp(${R(n)}, ${R(r)})`;return iv(e,{toJsonSchema:()=>i?{pattern:r.endsWith(`y`)?`^(?:${n})`:n}:[{},!0],toCode:()=>({runtime:`Schema.isPattern(${a})`}),...t})}var bx=ex(nv);function xx(e){let t=Su(e.order),n=e.formatter??R;return(r,i)=>gx(e=>t(e,r),{expected:`a value greater than ${n(r)}`,arbitraryConstraint:{order:e.order,minimum:r,exclusiveMinimum:!0},...e.annotate?.(r),...i})}function Sx(e){let t=wu(e.order),n=e.formatter??R;return(r,i)=>gx(e=>t(e,r),{expected:`a value greater than or equal to ${n(r)}`,arbitraryConstraint:{order:e.order,minimum:r},...e.annotate?.(r),...i})}function Cx(e){let t=Cu(e.order),n=e.formatter??R;return(r,i)=>gx(e=>t(e,r),{expected:`a value less than or equal to ${n(r)}`,arbitraryConstraint:{order:e.order,maximum:r},...e.annotate?.(r),...i})}function wx(e){let t=wu(e.order),n=Su(e.order),r=Cu(e.order),i=xu(e.order),a=e.formatter??R;return(o,s)=>{let c=o.exclusiveMinimum?n:t,l=o.exclusiveMaximum?i:r;return gx(e=>c(e,o.minimum)&&l(e,o.maximum),{expected:`a value between ${a(o.minimum)}${o.exclusiveMinimum?` (excluded)`:``} and ${a(o.maximum)}${o.exclusiveMaximum?` (excluded)`:``}`,arbitraryConstraint:{order:e.order,minimum:o.minimum,maximum:o.maximum,...o.exclusiveMinimum&&{exclusiveMinimum:!0},...o.exclusiveMaximum&&{exclusiveMaximum:!0}},...e.annotate?.(o),...s})}}function Tx(e){if(!globalThis.Number.isFinite(e))throw new globalThis.RangeError(`Expected a finite number, got ${R(e)}`);return e}var Ex=xx({order:bu,annotate:e=>({representation:{id:`effect/schema/isGreaterThan`,payload:{exclusiveMinimum:Tx(e)}},toJsonSchema:()=>({exclusiveMinimum:e}),toCode:()=>({runtime:`Schema.isGreaterThan(${R(e)})`})})}),Dx=Sx({order:bu,annotate:e=>({representation:{id:`effect/schema/isGreaterThanOrEqualTo`,payload:{minimum:Tx(e)}},toJsonSchema:()=>({minimum:e}),toCode:()=>({runtime:`Schema.isGreaterThanOrEqualTo(${R(e)})`})})}),Ox=Cx({order:bu,annotate:e=>({representation:{id:`effect/schema/isLessThanOrEqualTo`,payload:{maximum:Tx(e)}},toJsonSchema:()=>({maximum:e}),toCode:()=>({runtime:`Schema.isLessThanOrEqualTo(${R(e)})`})})}),kx=wx({order:bu,annotate:e=>{let t=e.exclusiveMinimum?!0:void 0,n=e.exclusiveMaximum?!0:void 0;return{representation:{id:`effect/schema/isBetween`,payload:{minimum:Tx(e.minimum),maximum:Tx(e.maximum),...t&&{exclusiveMinimum:t},...n&&{exclusiveMaximum:n}}},toJsonSchema:()=>({[t?`exclusiveMinimum`:`minimum`]:e.minimum,[n?`exclusiveMaximum`:`maximum`]:e.maximum}),toCode:()=>({runtime:`Schema.isBetween({ minimum: ${R(e.minimum)}, maximum: ${R(e.maximum)}, exclusiveMinimum: ${R(t)}, exclusiveMaximum: ${R(n)} })`})}}});function Ax(e){return gx(e=>globalThis.Number.isSafeInteger(e),{expected:`an integer`,representation:{id:`effect/schema/isInt`,payload:null},toJsonSchema:()=>[{type:`integer`},!0],toCode:()=>({runtime:`Schema.isInt()`}),arbitraryConstraint:{number:`integer`},...e})}var jx=ax.check(Ax());function Mx(e,t){return e=Ix(e),Nx(e,Math.ceil(e/2),t)}function Nx(e,t,n){return gx(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})`}),[yh]:!0,arbitraryConstraint:{minLength:e},...n})}function Px(e){return Nx(1,1,e)}function Fx(e,t){return e=Ix(e),gx(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})`}),[yh]:!0,arbitraryConstraint:{maxLength:e},...t})}function Ix(e){if(!globalThis.Number.isFinite(e))throw new globalThis.RangeError(`Expected a finite number, got ${e}`);return Math.max(0,Math.floor(e))}var Lx=ix.check(Px());globalThis.RegExp,globalThis.URL;var Rx=ix.annotate({expected:`a string that will be decoded as JSON`,contentMediaType:`application/json`});function zx(e,t){return Rx.pipe(px(e,Pg(t)))}globalThis.File,globalThis.FormData,globalThis.URLSearchParams;var Bx=ix.check(vx()),Vx=ix.annotate({expected:`a string that will be decoded as a trimmed string`}).pipe(px(Bx,kg())),Hx=ix.annotate({expected:`a base64 encoded string that will be decoded as Uint8Array`,format:`byte`,contentEncoding:`base64`}),Ux=mx(globalThis.Uint8Array,{representation:{id:`effect/schema/Uint8Array`,payload:null},toCode:()=>({runtime:`Schema.Uint8Array`,Type:`globalThis.Uint8Array`}),expected:`Uint8Array`,toCodecJson:()=>hx()(Hx,Ng)});function Wx(e,t){return Ab(Nb(ab(e.ast),t),t)}var Gx=ix.pipe(J(Mx(1)),J(Fx(80))),Kx=[`InferenceUpstreamError`,`AiInternalError`,`TypeError`,`AbortError`,`TimeoutError`,`Error`],qx={minimum:0,maximum:99999},Jx={minimum:0,maximum:599},Yx=lx([G({category:q(Kx),code:ux(jx.check(kx(qx))),reason:tx(H(`credits_exhausted`))}),G({category:H(`result_download`),status:jx.check(kx(Jx))})]);co([ao({category:yo(Kx),code:Ua().int().min(qx.minimum).max(qx.maximum).nullable(),reason:N(`credits_exhausted`).optional()}),ao({category:N(`result_download`),status:Ua().int().min(Jx.minimum).max(Jx.maximum)})]);var Xx=[`CANCELLED`,`CAPABILITY_DENIED`,`CAPABILITY_REVOKED`,`COMMAND_NOT_DECLARED`,`CONFLICT`,`DAILY_LIMIT_REACHED`,`DELIVERY_PENDING`,`DISCONNECTED`,`FILE_TOO_LARGE`,`HOST_FAILURE`,`IDENTITY`,`INSUFFICIENT_CREDIT`,`INVALID_ARGUMENT`,`MEDIA_PROVIDER_FAILURE`,`MEDIA_PROVIDER_FAILURE_UNCHARGED`,`PROTOCOL`,`SAFETY_FILTER_REFUSED`,`SELECTION_CHANGED`,`SETUP_REQUIRED`,`TIMEOUT`],Zx=G({name:H(`AppError`),code:q(Xx),retryable:W,need:V(ix)}),Y=class extends Error{code;retryable;need;constructor(e,t){super(e,{cause:t.cause}),this.name=`AppError`,this.code=t.code,this.retryable=t.retryable,this.need=t.need}};function Qx(e){return Nu(Zb(Gx)(e))}function $x(e){return`This needs ${e??`setup`} first.`}var eS={CANCELLED:{title:`Request cancelled`,message:`It stopped before it finished. Start it again if you still want it.`},CAPABILITY_DENIED:{title:`Access needed`,message:`This App needs permission to do that.`,action:`grant`},CAPABILITY_REVOKED:{title:`Access changed`,message:`This App no longer has permission to do that.`,action:`grant`},COMMAND_NOT_DECLARED:{title:`Action unavailable`,message:`This App doesn't include that action. It may need an update.`},CONFLICT:{title:`File changed`,message:`This file changed elsewhere. Review it before saving again.`},DAILY_LIMIT_REACHED:{title:`Daily limit reached`,message:`Today's spending limit for this Oyster is used up. It resets at 00:00 UTC.`},DELIVERY_PENDING:{title:`App delivery pending`,message:`The App hasn't finished getting ready. Try opening it again.`},DISCONNECTED:{title:`Connection lost`,message:`Reopen the App to connect again.`,action:`reconnect`},HOST_FAILURE:{title:`Couldn't complete the request`,message:`The host stopped answering. Reopen the App or reload the workspace.`},FILE_TOO_LARGE:{title:`File too large`,message:`Choose a file within the supported size limit.`},IDENTITY:{title:`Couldn't connect`,message:`Reopen the App to connect again.`,action:`reconnect`},INSUFFICIENT_CREDIT:{title:`Something went wrong`,message:`The App couldn't complete this request.`,action:`billing`},INVALID_ARGUMENT:{title:`Request not accepted`,message:`Some of the details weren't usable. Check them and try again.`},MEDIA_PROVIDER_FAILURE:{title:`Generation failed`,message:`The model couldn't complete this generation. Change the prompt or model and send again.`},MEDIA_PROVIDER_FAILURE_UNCHARGED:{title:`Generation failed`,message:`The model couldn't complete this generation. You weren't charged. Change the prompt or model and send again.`},PROTOCOL:{title:`Couldn't read the response`,message:`The host sent something this App doesn't understand. Reload the workspace; if it keeps happening, the App may need an update.`},SAFETY_FILTER_REFUSED:{title:`Generation refused`,message:`The model refused this generation. Change the prompt or reference image and send again.`},SELECTION_CHANGED:{title:`Selection changed`,message:`The selection changed during this request. Reopen the App to continue.`,action:`reconnect`},SETUP_REQUIRED:{title:`Setup needed`,message:$x(void 0),action:`setup`},TIMEOUT:{title:`Still waiting`,message:`The request didn't respond in time. Its outcome isn't known yet.`},UNKNOWN:{title:`Something went wrong`,message:`The App couldn't complete this request.`}};function tS(e,t){let n=Zb(Zx)(e);if(Du(n))return{...eS.UNKNOWN,retryable:!1};let r=n.value,i=eS[r.code],a=t?.[r.code]??(r.code===`SETUP_REQUIRED`?{title:i.title,message:$x(Qx(r.need))}:i),o=i.action??(r.retryable?`retry`:void 0),s={title:a.title,message:a.message,retryable:r.retryable};return o?{...s,action:o}:s}var nS=t((e=>{var t=i(),n=Symbol.for(`react.element`),r=Symbol.for(`react.fragment`),a=Object.prototype.hasOwnProperty,o=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,r){var i,c={},l=null,u=null;for(i in r!==void 0&&(l=``+r),t.key!==void 0&&(l=``+t.key),t.ref!==void 0&&(u=t.ref),t)a.call(t,i)&&!s.hasOwnProperty(i)&&(c[i]=t[i]);if(e&&e.defaultProps)for(i in t=e.defaultProps,t)c[i]===void 0&&(c[i]=t[i]);return{$$typeof:n,type:e,key:l,ref:u,props:c,_owner:o.current}}e.Fragment=r,e.jsx=c,e.jsxs=c})),rS=t(((e,t)=>{t.exports=nS()})),X=rS(),iS=P.createContext(void 0),aS=e=>{let t=P.useContext(iS);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},oS=({client:e,children:t})=>(P.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,X.jsx)(iS.Provider,{value:e,children:t})),sS={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},cS=new class{#e=sS;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function lS(e){setTimeout(e,0)}var uS=typeof window>`u`||`Deno`in globalThis;function dS(){}function fS(e,t){return typeof e==`function`?e(t):e}function pS(e){return typeof e==`number`&&e>=0&&e!==1/0}function mS(e,t){return Math.max(e+(t||0)-Date.now(),0)}function hS(e,t){return typeof e==`function`?e(t):e}function gS(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==vS(o,t.options))return!1}else if(!bS(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function _S(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(yS(t.options.mutationKey)!==yS(a))return!1}else if(!bS(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function vS(e,t){return(t?.queryKeyHashFn||yS)(e)}function yS(e){return JSON.stringify(e,(e,t)=>TS(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function bS(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){for(let n=0;n<t.length;n++)if(!bS(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!bS(e[r],t[r]))return!1;return!0}return!1}var xS=Object.prototype.hasOwnProperty;function SS(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=wS(e)&&wS(t);if(!r&&!(TS(e)&&TS(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:xS.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=SS(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function CS(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function wS(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function TS(e){if(!ES(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!ES(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function ES(e){return Object.prototype.toString.call(e)===`[object Object]`}function DS(e){return new Promise(t=>{cS.setTimeout(t,e)})}function OS(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:SS(e,t)}function kS(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function AS(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var jS=Symbol();function MS(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===jS?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function NS(e,t){return typeof e==`function`?e(...t):!!e}function PS(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var FS=()=>uS,IS=()=>FS(),LS=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},RS=new class extends LS{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},zS=lS;function BS(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=zS,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var VS=BS(),HS=new class extends LS{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function US(e){return Math.min(1e3*2**e,3e4)}function WS(e){return(e??`online`)!==`online`||HS.isOnline()}var GS=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function KS(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(dS);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new GS(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>RS.isFocused()&&(e.networkMode===`always`||HS.isOnline())&&e.canRun(),p=()=>WS(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=()=>new Promise(t=>{r=e=>{(c()||f())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),_=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(IS()?0:3),a=e.retryDelay??US,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!s){h(r);return}n++,e.onFail?.(n,r),DS(o).then(()=>f()?void 0:g()).then(()=>{t?h(r):_()})})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g().then(_),s)}}var qS=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),pS(this.gcTime)&&(this.#e=cS.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(IS()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(cS.clearTimeout(this.#e),this.#e=void 0)}},JS=class extends qS{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||YS(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=KS({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),VS.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function YS(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var XS=class extends LS{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),CS(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&yS(t.mutationKey)!==yS(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??YS();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){VS.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}};function ZS(e,t){let n=aS(t),[r]=P.useState(()=>new XS(n,e));P.useEffect(()=>{r.setOptions(e)},[r,e]);let i=P.useSyncExternalStore(P.useCallback(e=>r.subscribe(VS.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=P.useCallback((...e)=>{r.mutate(e[0],e[1]).catch(dS)},[r]);if(i.error&&NS(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var QS=Symbol(`workers-module`);Symbol.dispose||(Symbol.dispose=Symbol.for(`dispose`)),Symbol.asyncDispose||(Symbol.asyncDispose=Symbol.for(`asyncDispose`)),Promise.withResolvers||(Promise.withResolvers=function(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}});var $S=globalThis[QS],eC=$S?$S.RpcTarget:class{},tC=async function(){}.constructor,nC=typeof Buffer<`u`?Buffer.prototype:void 0;function rC(e){switch(typeof e){case`boolean`:case`number`:case`string`:return`primitive`;case`undefined`:return`undefined`;case`object`:case`function`:break;case`bigint`:return`bigint`;default:return`unsupported`}if(e===null)return`primitive`;let t=Object.getPrototypeOf(e);switch(t){case Object.prototype:return`object`;case Function.prototype:case tC.prototype:return`function`;case Array.prototype:return`array`;case Date.prototype:return`date`;case Uint8Array.prototype:case nC:case ArrayBuffer.prototype:case DataView.prototype:case Int8Array.prototype:case Uint8ClampedArray.prototype:case Int16Array.prototype:case Uint16Array.prototype:case Int32Array.prototype:case Uint32Array.prototype:case BigInt64Array.prototype:case BigUint64Array.prototype:case Float32Array.prototype:case Float64Array.prototype:return`bytes`;case WritableStream.prototype:return`writable`;case ReadableStream.prototype:return`readable`;case URL.prototype:return`url`;case Headers.prototype:return`headers`;case Request.prototype:return`request`;case Response.prototype:return`response`;case Blob.prototype:return`blob`;case hC.prototype:return`stub`;case gC.prototype:return`rpc-promise`;default:if($S){if(t==$S.RpcStub.prototype||e instanceof $S.ServiceStub)return`rpc-target`;if(t==$S.RpcPromise.prototype||t==$S.RpcProperty.prototype)return`rpc-thenable`}return e instanceof eC?`rpc-target`:e instanceof Error?`error`:`unsupported`}}function iC(){throw Error(`RPC map() implementation was not loaded.`)}var aC={applyMap:iC,sendMap:iC};function oC(){throw Error(`Stream implementation was not loaded.`)}var sC={createWritableStreamHook:oC,createWritableStreamFromHook:oC,createReadableStreamHook:oC},cC=class{stream(e,t){let n=this.call(e,t),r;try{r=n.pull()}catch(e){throw n.dispose(),e}let i;return r instanceof Promise?i=r.then(e=>{e.dispose()}):(r.dispose(),i=Promise.resolve()),{promise:i}}},lC=class extends cC{error;constructor(e){super(),this.error=e}call(e,t){return t.dispose(),this}map(e,t,n){for(let e of t)e.dispose();return this}get(e){return this}dup(){return this}pull(){return Promise.reject(this.error)}ignoreUnhandledRejections(){}dispose(){}onBroken(e){try{e(this.error)}catch(e){Promise.resolve(e)}}},uC=new lC(Error(`Attempted to use RPC stub after it has been disposed.`)),dC=(e,t,n)=>e.call(t,n);function fC(e,t){let n=dC;dC=e;try{return t()}finally{dC=n}}var pC=Symbol(`realStub`),mC={apply(e,t,n){let r=e.raw;return new gC(dC(r.hook,r.pathIfPromise||[],CC.fromAppParams(n)),[])},get(e,t,n){let r=e.raw;if(t===pC)return r;if(t in gC.prototype)return r[t];if(typeof t==`string`)return new gC(r.hook,r.pathIfPromise?[...r.pathIfPromise,t]:[t]);if(t===Symbol.dispose&&(!r.pathIfPromise||r.pathIfPromise.length==0))return()=>{r.hook.dispose(),r.hook=uC}},has(e,t){let n=e.raw;return t===pC?!0:t in gC.prototype?t in n:typeof t==`string`||t===Symbol.dispose&&(!n.pathIfPromise||n.pathIfPromise.length==0)},construct(e,t){throw Error(`An RPC stub cannot be used as a constructor.`)},defineProperty(e,t,n){throw Error(`Can't define properties on RPC stubs.`)},deleteProperty(e,t){throw Error(`Can't delete properties on RPC stubs.`)},getOwnPropertyDescriptor(e,t){},getPrototypeOf(e){return Object.getPrototypeOf(e.raw)},isExtensible(e){return!1},ownKeys(e){return[]},preventExtensions(e){return!0},set(e,t,n,r){throw Error(`Can't assign properties on RPC stubs.`)},setPrototypeOf(e,t){throw Error(`Can't override prototype of RPC stubs.`)}},hC=class e extends eC{constructor(e,t){if(super(),!(e instanceof cC)){let n=e;if(e=n instanceof eC||n instanceof Function?OC.create(n,void 0):new EC(CC.fromAppReturn(n)),t)throw TypeError(`RpcStub constructor expected one argument, received two.`)}this.hook=e,this.pathIfPromise=t;let n=()=>{};return n.raw=this,new Proxy(n,mC)}hook;pathIfPromise;dup(){let t=this[pC];return t.pathIfPromise?new e(t.hook.get(t.pathIfPromise)):new e(t.hook.dup())}onRpcBroken(e){this[pC].hook.onBroken(e)}map(e){let{hook:t,pathIfPromise:n}=this[pC];return aC.sendMap(t,n||[],e)}toString(){return`[object RpcStub]`}},gC=class extends hC{constructor(e,t){if(e instanceof cC)super(e,t??[]);else{if(t!==void 0)throw TypeError(`RpcPromise constructor expected one argument, received two.`);let n=rC(e);if(n===`rpc-promise`){let t=xC(e);if(t.pathIfPromise.length>0)super(t.hook,t.pathIfPromise);else{let e=t.hook;t.hook=uC,super(e,[])}}else if(n===`rpc-thenable`)super(OC.create(e,void 0),[]);else{let t=new kC(Promise.resolve(e).then(e=>new EC(CC.fromAppReturn(e))));t.ignoreUnhandledRejections(),super(t,[])}}}then(e,t){return SC(this).then(...arguments)}catch(e){return SC(this).catch(...arguments)}finally(e){return SC(this).finally(...arguments)}toString(){return`[object RpcPromise]`}};function _C(e){let{hook:t,pathIfPromise:n}=e[pC];return n&&n.length>0?t.get(n):t}function vC(e){let{hook:t,pathIfPromise:n}=e[pC];return n?t.get(n):t.dup()}function yC(e){let{hook:t,pathIfPromise:n}=e[pC];if(!(n&&n.length>0))return t}function bC(e){return e[pC].hook}function xC(e){return e[pC]}async function SC(e){let{hook:t,pathIfPromise:n}=e[pC];return n.length>0&&(t=t.get(n)),(await t.pull()).deliverResolve()}var CC=class e{value;source;hooks;promises;static fromAppParams(t){return new e(t,`params`)}static fromAppReturn(t){return new e(t,`return`)}static fromArray(t){let n=[],r=[],i=[];for(let e of t){e.ensureDeepCopied();for(let t of e.hooks)n.push(t);for(let t of e.promises)t.parent===e&&(t={parent:i,property:i.length,promise:t.promise}),r.push(t);i.push(e.value)}return new e(i,`owned`,n,r)}static forEvaluate(t,n){return new e(null,`owned`,t,n)}static deepCopyFrom(t,n,r){let i=new e(null,`owned`,[],[]);return i.value=i.deepCopy(t,n,`value`,i,!0,r),i}constructor(e,t,n,r){this.value=e,this.source=t,this.hooks=n,this.promises=r}rpcTargets;getHookForRpcTarget(e,t,n=!0){if(this.source===`params`){if(n){let t=e;typeof t.dup==`function`&&(e=t.dup())}return OC.create(e,t)}if(this.source===`return`){let r=this.rpcTargets?.get(e);return r?n?r.dup():(this.rpcTargets?.delete(e),r):(r=OC.create(e,t),n?(this.rpcTargets||=new Map,this.rpcTargets.set(e,r),r.dup()):r)}throw Error(`owned payload shouldn't contain raw RpcTargets`)}getHookForWritableStream(e,t,n=!0){if(this.source===`params`)return sC.createWritableStreamHook(e);if(this.source===`return`){let t=this.rpcTargets?.get(e);return t?n?t.dup():(this.rpcTargets?.delete(e),t):(t=sC.createWritableStreamHook(e),n?(this.rpcTargets||=new Map,this.rpcTargets.set(e,t),t.dup()):t)}throw Error(`owned payload shouldn't contain raw WritableStreams`)}getHookForReadableStream(e,t,n=!0){if(this.source===`params`)return sC.createReadableStreamHook(e);if(this.source===`return`){let t=this.rpcTargets?.get(e);return t?n?t.dup():(this.rpcTargets?.delete(e),t):(t=sC.createReadableStreamHook(e),n?(this.rpcTargets||=new Map,this.rpcTargets.set(e,t),t.dup()):t)}throw Error(`owned payload shouldn't contain raw ReadableStreams`)}deepCopy(e,t,n,r,i,a){switch(rC(e)){case`unsupported`:return e;case`primitive`:case`bigint`:case`date`:case`bytes`:case`blob`:case`url`:case`error`:case`undefined`:return e;case`array`:{let t=e,n=t.length,r=Array(n);for(let e=0;e<n;e++)r[e]=this.deepCopy(t[e],t,e,r,i,a);return r}case`object`:{let t={},n=e;for(let e in n)t[e]=this.deepCopy(n[e],n,e,t,i,a);return t}case`stub`:case`rpc-promise`:{let t=e,a;if(a=i?vC(t):_C(t),t instanceof gC){let e=new gC(a,[]);return this.promises.push({parent:r,property:n,promise:e}),e}return this.hooks.push(a),new hC(a)}case`function`:case`rpc-target`:{let n=e,r;return r=a?a.getHookForRpcTarget(n,t,i):OC.create(n,t),this.hooks.push(r),new hC(r)}case`rpc-thenable`:{let o=e,s;return s=a?new gC(a.getHookForRpcTarget(o,t,i),[]):new gC(OC.create(o,t),[]),this.promises.push({parent:r,property:n,promise:s}),s}case`writable`:{let n=e,r;return r=a?a.getHookForWritableStream(n,t,i):sC.createWritableStreamHook(n),this.hooks.push(r),n}case`readable`:{let n=e,r;return r=a?a.getHookForReadableStream(n,t,i):sC.createReadableStreamHook(n),this.hooks.push(r),n}case`headers`:return new Headers(e);case`request`:{let t=e;return t.body&&this.deepCopy(t.body,t,`body`,t,i,a),new Request(t)}case`response`:{let t=e;return t.body&&this.deepCopy(t.body,t,`body`,t,i,a),new Response(t.body,t)}default:throw Error(`unreachable`)}}ensureDeepCopied(){if(this.source!==`owned`){let e=this.source===`params`;this.hooks=[],this.promises=[];try{this.value=this.deepCopy(this.value,void 0,`value`,this,e,this)}catch(e){throw this.hooks=void 0,this.promises=void 0,e}if(this.source=`owned`,this.rpcTargets&&this.rpcTargets.size>0)throw Error(`Not all rpcTargets were accounted for in deep-copy?`);this.rpcTargets=void 0}}deliverTo(t,n,r){if(this.ensureDeepCopied(),this.value instanceof gC)e.deliverRpcPromiseTo(this.value,t,n,r);else{t[n]=this.value;for(let t of this.promises)e.deliverRpcPromiseTo(t.promise,t.parent,t.property,r)}}static deliverRpcPromiseTo(t,n,r,i){let a=yC(t);if(!a)throw Error(`property promises should have been resolved earlier`);let o=a.pull();o instanceof e?o.deliverTo(n,r,i):i.push(o.then(e=>{let t=[];if(e.deliverTo(n,r,t),t.length>0)return Promise.all(t)}))}async deliverCall(t,n){try{let r=[];this.deliverTo(this,`value`,r),r.length>0&&await Promise.all(r);let i=Function.prototype.apply.call(t,n,this.value);return i instanceof gC?e.fromAppReturn(i):e.fromAppReturn(await i)}finally{this.dispose()}}async deliverStreamWrite(t){try{let n=[];this.deliverTo(this,`value`,n),n.length>0&&await Promise.all(n);let r=this.value[0];return(this.hooks.length>0||this.promises.length>0)&&r instanceof Object?(Symbol.dispose in r||Object.defineProperty(r,Symbol.dispose,{value:()=>this.dispose(),writable:!0,enumerable:!1,configurable:!0}),await t.write(r),e.fromAppReturn(void 0)):(await t.write(r),this.dispose(),e.fromAppReturn(void 0))}catch(e){throw this.dispose(),e}}async deliverResolve(){try{let e=[];this.deliverTo(this,`value`,e),e.length>0&&await Promise.all(e);let t=this.value;return t instanceof Object&&(Symbol.dispose in t||Object.defineProperty(t,Symbol.dispose,{value:()=>this.dispose(),writable:!0,enumerable:!1,configurable:!0})),t}catch(e){throw this.dispose(),e}}dispose(){if(this.source===`owned`)this.hooks.forEach(e=>e.dispose()),this.promises.forEach(e=>e.promise[Symbol.dispose]());else if(this.source===`return`&&(this.disposeImpl(this.value,void 0),this.rpcTargets&&this.rpcTargets.size>0))throw Error(`Not all rpcTargets were accounted for in disposeImpl()?`);this.source=`owned`,this.hooks=[],this.promises=[]}disposeImpl(e,t){switch(rC(e)){case`unsupported`:case`primitive`:case`bigint`:case`bytes`:case`blob`:case`date`:case`url`:case`error`:case`undefined`:return;case`array`:{let t=e,n=t.length;for(let e=0;e<n;e++)this.disposeImpl(t[e],t);return}case`object`:{let t=e;for(let e in t)this.disposeImpl(t[e],t);return}case`stub`:case`rpc-promise`:{let t=yC(e);t&&t.dispose();return}case`function`:case`rpc-target`:{let t=e,n=this.rpcTargets?.get(t);n?(n.dispose(),this.rpcTargets.delete(t)):DC(t);return}case`rpc-thenable`:return;case`headers`:return;case`request`:{let t=e;t.body&&this.disposeImpl(t.body,t);return}case`response`:{let t=e;t.body&&this.disposeImpl(t.body,t);return}case`writable`:{let t=e,n=this.rpcTargets?.get(t);n?this.rpcTargets.delete(t):n=sC.createWritableStreamHook(t),n.dispose();return}case`readable`:{let t=e,n=this.rpcTargets?.get(t);n?this.rpcTargets.delete(t):n=sC.createReadableStreamHook(t),n.dispose();return}default:return}}ignoreUnhandledRejections(){this.hooks?(this.hooks.forEach(e=>{e.ignoreUnhandledRejections()}),this.promises.forEach(e=>bC(e.promise).ignoreUnhandledRejections())):this.ignoreUnhandledRejectionsImpl(this.value)}ignoreUnhandledRejectionsImpl(e){switch(rC(e)){case`unsupported`:case`primitive`:case`bigint`:case`bytes`:case`blob`:case`date`:case`error`:case`undefined`:case`function`:case`rpc-target`:case`writable`:case`readable`:case`url`:case`headers`:case`request`:case`response`:return;case`array`:{let t=e,n=t.length;for(let e=0;e<n;e++)this.ignoreUnhandledRejectionsImpl(t[e]);return}case`object`:{let t=e;for(let e in t)this.ignoreUnhandledRejectionsImpl(t[e]);return}case`stub`:case`rpc-promise`:bC(e).ignoreUnhandledRejections();return;case`rpc-thenable`:e.then(e=>{},e=>{});return;default:return}}};function wC(e,t,n,r){for(let i=0;i<n.length;i++){t=e;let a=n[i];if(a in Object.prototype){e=void 0;continue}switch(rC(e)){case`object`:case`function`:e=Object.hasOwn(e,a)?e[a]:void 0;break;case`array`:e=Number.isInteger(a)&&a>=0?e[a]:void 0;break;case`rpc-target`:case`rpc-thenable`:if(Object.hasOwn(e,a))throw TypeError(`Attempted to access property '${a}', which is an instance property of the RpcTarget. To avoid leaking private internals, instance properties cannot be accessed over RPC. If you want to make this property available over RPC, define it as a method or getter on the class, instead of an instance property.`);e=e[a],r=null;break;case`stub`:case`rpc-promise`:{let{hook:t,pathIfPromise:r}=xC(e);return{hook:t,remainingPath:r?r.concat(n.slice(i)):n.slice(i)}}case`writable`:e=void 0;break;case`readable`:e=void 0;break;case`primitive`:case`bigint`:case`bytes`:case`blob`:case`date`:case`error`:case`url`:case`headers`:case`request`:case`response`:e=void 0;break;case`undefined`:e=e[a];break;case`unsupported`:if(i===0)throw TypeError(`RPC stub points at a non-serializable type.`);{let e=n.slice(0,i).join(`.`),t=n.slice(0,i).join(`.`);throw TypeError(`'${e}' is not a serializable type, so property ${t} cannot be accessed.`)}default:throw TypeError(`unreachable`)}}if(e instanceof gC){let{hook:t,pathIfPromise:n}=xC(e);return{hook:t,remainingPath:n||[]}}return{value:e,parent:t,owner:r}}var TC=class extends cC{call(e,t){let n;try{let{value:t,owner:r}=this.getValue();n=wC(t,void 0,e,r)}catch(e){return t.dispose(),new lC(e)}return n.hook?n.hook.call(n.remainingPath,t):typeof n.value==`function`?new kC(t.deliverCall(n.value,n.parent).then(e=>new EC(e))):(t.dispose(),new lC(TypeError(`'${e.join(`.`)}' is not a function.`)))}map(e,t,n){try{let r;try{let{value:t,owner:n}=this.getValue();r=wC(t,void 0,e,n)}catch(e){for(let e of t)e.dispose();throw e}return r.hook?r.hook.map(r.remainingPath,t,n):aC.applyMap(r.value,r.parent,r.owner,t,n)}catch(e){return new lC(e)}}get(e){try{let{value:t,owner:n}=this.getValue();if(e.length===0&&n===null){if(t instanceof Object&&`then`in t)return this.dup();throw Error(`Can't dup an RpcTarget stub as a promise.`)}let r=wC(t,void 0,e,n);return r.hook?r.hook.get(r.remainingPath):new EC(CC.deepCopyFrom(r.value,r.parent,r.owner))}catch(e){return new lC(e)}}},EC=class e extends TC{constructor(e){super(),this.payload=e}payload;getPayload(){if(this.payload)return this.payload;throw Error(`Attempted to use an RPC StubHook after it was disposed.`)}getValue(){let e=this.getPayload();return{value:e.value,owner:e}}dup(){let t=this.getPayload();return new e(CC.deepCopyFrom(t.value,void 0,t))}pull(){return this.getPayload()}ignoreUnhandledRejections(){this.payload&&this.payload.ignoreUnhandledRejections()}dispose(){this.payload&&=(this.payload.dispose(),void 0)}onBroken(e){this.payload&&this.payload.value instanceof hC&&this.payload.value.onRpcBroken(e)}};function DC(e){if(Symbol.dispose in e)try{e[Symbol.dispose]()}catch(e){Promise.reject(e)}}var OC=class e extends TC{static create(t,n){return typeof t!=`function`&&(n=void 0),new e(t,n)}constructor(e,t,n){super(),this.target=e,this.parent=t,n?n.refcount&&(this.refcount=n.refcount,++this.refcount.count):Symbol.dispose in e&&(this.refcount={count:1})}target;parent;refcount;getTarget(){if(this.target)return this.target;throw Error(`Attempted to use an RPC StubHook after it was disposed.`)}getValue(){return{value:this.getTarget(),owner:null}}dup(){return new e(this.getTarget(),this.parent,this)}pull(){let e=this.getTarget();return`then`in e?Promise.resolve(e).then(e=>CC.fromAppReturn(e)):Promise.reject(Error(`Tried to resolve a non-promise stub.`))}ignoreUnhandledRejections(){}dispose(){this.target&&=(this.refcount&&--this.refcount.count==0&&DC(this.target),void 0)}onBroken(e){let t=this.target;t&&`then`in t&&Promise.resolve(t).then(()=>{},e)}},kC=class e extends cC{promise;resolution;constructor(e){super(),this.promise=e.then(e=>(this.resolution=e,e))}call(t,n){return n.ensureDeepCopied(),new e(this.promise.then(e=>e.call(t,n),e=>{throw n.dispose(),e}))}stream(e,t){return t.ensureDeepCopied(),{promise:this.promise.then(n=>n.stream(e,t).promise,e=>{throw t.dispose(),e})}}map(t,n,r){return new e(this.promise.then(e=>e.map(t,n,r),e=>{for(let e of n)e.dispose();throw e}))}get(t){return new e(this.promise.then(e=>e.get(t)))}dup(){return this.resolution?this.resolution.dup():new e(this.promise.then(e=>e.dup()))}pull(){return this.resolution?this.resolution.pull():this.promise.then(e=>e.pull())}ignoreUnhandledRejections(){this.resolution?this.resolution.ignoreUnhandledRejections():this.promise.then(e=>{e.ignoreUnhandledRejections()},e=>{})}dispose(){this.promise.then(e=>e.dispose(),()=>{})}onBroken(e){this.resolution?this.resolution.onBroken(e):this.promise.then(t=>{t.onBroken(e)},e)}},AC={maxBigIntDigits:16384,maxDepth:256,maxMessageSize:33554432},jC=new Uint8Array(new Uint16Array([1]).buffer)[0]===1,MC=[`ArrayBuffer`,`DataView`,`Int8Array`,`Uint8Array`,`Uint8ClampedArray`,`Int16Array`,`Uint16Array`,`Int32Array`,`Uint32Array`,`BigInt64Array`,`BigUint64Array`,`Float32Array`,`Float64Array`];function NC(e){return MC.includes(e)}var PC={ArrayBuffer:void 0,DataView:void 0,Int8Array:void 0,Uint8Array:void 0,Uint8ClampedArray:void 0,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,BigInt64Array:8,BigUint64Array:8,Float32Array:4,Float64Array:8},FC={ArrayBuffer:ArrayBuffer.prototype,DataView:DataView.prototype,Int8Array:Int8Array.prototype,Uint8ClampedArray:Uint8ClampedArray.prototype,Int16Array:Int16Array.prototype,Uint16Array:Uint16Array.prototype,Int32Array:Int32Array.prototype,Uint32Array:Uint32Array.prototype,BigInt64Array:BigInt64Array.prototype,BigUint64Array:BigUint64Array.prototype,Float32Array:Float32Array.prototype,Float64Array:Float64Array.prototype},IC=new Map;for(let e of Object.keys(FC))IC.set(FC[e],e);function LC(e,t){if(t!==2&&t!==4&&t!==8)throw RangeError(`Unsupported element size: ${t}`);let n=new DataView(e.buffer,e.byteOffset,e.byteLength);for(let r=0;r<e.byteLength;r+=t)switch(t){case 2:n.setUint16(r,n.getUint16(r,!1),!0);break;case 4:n.setUint32(r,n.getUint32(r,!1),!0);break;case 8:n.setBigUint64(r,n.getBigUint64(r,!1),!0)}}var RC=new class{exportStub(e){throw Error(`Cannot serialize RPC stubs without an RPC session.`)}exportPromise(e){throw Error(`Cannot serialize RPC stubs without an RPC session.`)}getImport(e){}unexport(e){}createPipe(e){throw Error(`Cannot create pipes without an RPC session.`)}onSendError(e){}};async function zC(e,t){let n=await new Response(e).blob();return n.type===t?n:n.slice(0,n.size,t)}var BC={__proto__:null,Error,EvalError,RangeError,ReferenceError,SyntaxError,TypeError,URIError,AggregateError},VC=class e{exporter;source;encodingLevel;constructor(e,t,n){this.exporter=e,this.source=t,this.encodingLevel=n}static devaluate(t,n,r=RC,i,a=`string`){let o=new e(r,i,a);try{return o.devaluateImpl(t,n,0)}catch(e){if(o.exports)try{r.unexport(o.exports)}catch{}throw e}}exports;devaluateImpl(e,t,n){if(n>=256)throw Error(`Serialization exceeded maximum allowed depth. (Does the message contain cycles?)`);switch(rC(e)){case`unsupported`:{let t;try{t=`Cannot serialize value: ${e}`}catch{t=`Cannot serialize value: (couldn't stringify value)`}throw TypeError(t)}case`primitive`:return typeof e==`number`&&!isFinite(e)?this.encodingLevel===`structuredClonable`?e:e===1/0?[`inf`]:e===-1/0?[`-inf`]:[`nan`]:e;case`object`:{let t=e,r={};for(let e in t)r[e]=this.devaluateImpl(t[e],t,n+1);return r}case`array`:{let t=e,r=t.length,i=Array(r);for(let e=0;e<r;e++)i[e]=this.devaluateImpl(t[e],t,n+1);return[i]}case`bigint`:return this.encodingLevel===`structuredClonable`?e:[`bigint`,e.toString()];case`date`:{if(this.encodingLevel===`structuredClonable`)return e;let t=e.getTime();return[`date`,Number.isNaN(t)?null:t]}case`bytes`:{let t=IC.get(Object.getPrototypeOf(e)),n;if(t===`ArrayBuffer`)n=new Uint8Array(e);else if(t===void 0)n=e;else{let r=e;n=new Uint8Array(r.buffer,r.byteOffset,r.byteLength);let i=PC[t];!jC&&i&&(n=n.slice(),LC(n,i))}if(this.encodingLevel===`structuredClonable`||this.encodingLevel===`jsonCompatibleWithBytes`)return t===void 0?[`bytes`,n]:[`bytes`,n,t];let r;if(n.toBase64)r=n.toBase64({omitPadding:!0});else if(typeof Buffer<`u`)r=(n instanceof Buffer?n:Buffer.from(n.buffer,n.byteOffset,n.byteLength)).toString(`base64`);else{let e=``;for(let t=0;t<n.length;t++)e+=String.fromCharCode(n[t]);r=btoa(e)}return r=r.replace(/=+$/,``),t===void 0?[`bytes`,r]:[`bytes`,r,t]}case`url`:return[`url`,e.href];case`headers`:return[`headers`,[...e]];case`request`:{let t=e,r={};t.method!==`GET`&&(r.method=t.method);let i=[...t.headers];if(i.length>0&&(r.headers=i),t.body)r.body=this.devaluateImpl(t.body,t,n+1),r.duplex=t.duplex||`half`;else if(t.body===void 0&&![`GET`,`HEAD`,`OPTIONS`,`TRACE`,`DELETE`].includes(t.method)){let e=t.arrayBuffer(),n=new ReadableStream({async start(t){try{t.enqueue(new Uint8Array(await e)),t.close()}catch(e){t.error(e)}}}),i=sC.createReadableStreamHook(n);r.body=[`readable`,this.exporter.createPipe(n,i)],r.duplex=t.duplex||`half`}t.cache&&t.cache!=="default"&&(r.cache=t.cache),t.redirect!==`follow`&&(r.redirect=t.redirect),t.integrity&&(r.integrity=t.integrity),t.mode&&t.mode!==`cors`&&(r.mode=t.mode),t.credentials&&t.credentials!==`same-origin`&&(r.credentials=t.credentials),t.referrer&&t.referrer!==`about:client`&&(r.referrer=t.referrer),t.referrerPolicy&&(r.referrerPolicy=t.referrerPolicy),t.keepalive&&(r.keepalive=t.keepalive);let a=t;return a.cf&&(r.cf=a.cf),a.encodeResponseBody&&a.encodeResponseBody!==`automatic`&&(r.encodeResponseBody=a.encodeResponseBody),[`request`,t.url,r]}case`response`:{let t=e,r=this.devaluateImpl(t.body,t,n+1),i={};t.status!==200&&(i.status=t.status),t.statusText&&(i.statusText=t.statusText);let a=[...t.headers];a.length>0&&(i.headers=a);let o=t;if(o.cf&&(i.cf=o.cf),o.encodeBody&&o.encodeBody!==`automatic`&&(i.encodeBody=o.encodeBody),o.webSocket)throw TypeError(`Can't serialize a Response containing a webSocket.`);return[`response`,r,i]}case`blob`:{let t=e,n=t.stream(),r=sC.createReadableStreamHook(n),i=this.exporter.createPipe(n,r);return[`blob`,t.type,[`readable`,i]]}case`error`:{let t=e,r=this.exporter.onSendError(t);r&&(t=r);let i=t,a,o=(e,r)=>{let i=this.exports?.length??0;try{let i=this.devaluateImpl(r,t,n+1);a||={},a[e]=i}catch{if(this.exports&&this.exports.length>i){let e=this.exports.splice(i);try{this.exporter.unexport(e)}catch{}}}};for(let e of Object.keys(t))e!==`name`&&e!==`message`&&e!==`stack`&&o(e,i[e]);`cause`in t&&o(`cause`,i.cause),t instanceof AggregateError&&o(`errors`,t.errors);let s=[`error`,t.name,t.message];return a?(s.push(r&&r.stack?r.stack:null),s.push(a)):r&&r.stack&&s.push(r.stack),s}case`undefined`:return this.encodingLevel===`structuredClonable`?void 0:[`undefined`];case`stub`:case`rpc-promise`:{if(!this.source)throw Error(`Can't serialize RPC stubs in this context.`);let{hook:t,pathIfPromise:n}=xC(e),r=this.exporter.getImport(t);return r===void 0?(t=n?t.get(n):t.dup(),this.devaluateHook(n?`promise`:`export`,t)):n?n.length>0?[`pipeline`,r,n]:[`pipeline`,r]:[`import`,r]}case`function`:case`rpc-target`:{if(!this.source)throw Error(`Can't serialize RPC stubs in this context.`);let n=this.source.getHookForRpcTarget(e,t);return this.devaluateHook(`export`,n)}case`rpc-thenable`:{if(!this.source)throw Error(`Can't serialize RPC stubs in this context.`);let n=this.source.getHookForRpcTarget(e,t);return this.devaluateHook(`promise`,n)}case`writable`:{if(!this.source)throw Error(`Can't serialize WritableStream in this context.`);let n=this.source.getHookForWritableStream(e,t);return this.devaluateHook(`writable`,n)}case`readable`:{if(!this.source)throw Error(`Can't serialize ReadableStream in this context.`);let n=e,r=this.source.getHookForReadableStream(n,t);return[`readable`,this.exporter.createPipe(n,r)]}default:throw Error(`unreachable`)}}devaluateHook(e,t){this.exports||=[];let n=e===`promise`?this.exporter.exportPromise(t):this.exporter.exportStub(t);return this.exports.push(n),[e,n]}};new class{importStub(e){throw Error(`Cannot deserialize RPC stubs without an RPC session.`)}importPromise(e){throw Error(`Cannot deserialize RPC stubs without an RPC session.`)}getExport(e){}getPipeReadable(e){throw Error(`Cannot retrieve pipe readable without an RPC session.`)}getLimits(){return AC}};function HC(e,t){return new gC(new kC(new Response(t).arrayBuffer().then(t=>{let n=new Uint8Array(t),r=new Request(e,{body:n});return new EC(CC.fromAppReturn(r))})),[])}function UC(e,t){return new gC(new kC(zC(e,t).then(e=>new EC(CC.fromAppReturn(e)))),[])}var WC=class e{importer;encodingLevel;limits;constructor(e,t=`string`){this.importer=e,this.encodingLevel=t,this.limits=e.getLimits()}hooks=[];promises=[];evaluate(e){return this.evaluateWithDepth(e,0)}evaluateWithDepth(e,t){let n=CC.forEvaluate(this.hooks,this.promises);try{return n.value=this.evaluateImpl(e,n,`value`,t),n}catch(e){throw n.dispose(),e}}evaluateCopy(e){return this.evaluate(structuredClone(e))}evaluateImpl(t,n,r,i){let a=this.limits.maxDepth;if(i>=a)throw TypeError(`Deserialization exceeded maximum allowed message depth of ${a}.`);if(this.encodingLevel===`structuredClonable`&&(t instanceof Date||typeof t==`bigint`))return t;if(t instanceof Array){if(t.length==1&&t[0]instanceof Array){let e=t[0];for(let t=0;t<e.length;t++)e[t]=this.evaluateImpl(e[t],e,t,i+1);return e}switch(t[0]){case`bigint`:if(typeof t[1]==`string`){let e=t[1],n=this.limits.maxBigIntDigits;if(e.length>n)throw TypeError(`Deserialized bigint exceeds maximum length of ${n} digits.`);return BigInt(e)}break;case`date`:if(t[1]===null)return new Date(NaN);if(typeof t[1]==`number`)return new Date(t[1]);break;case`bytes`:{let e;if(t[1]instanceof Uint8Array)e=t[1];else if(typeof t[1]==`string`){if(typeof Buffer<`u`)e=Buffer.from(t[1],`base64`);else if(Uint8Array.fromBase64)e=Uint8Array.fromBase64(t[1]);else{let n=atob(t[1]),r=n.length;e=new Uint8Array(r);for(let t=0;t<r;t++)e[t]=n.charCodeAt(t)}}else break;if(t.length===2)return e;if(typeof t[2]!=`string`)throw TypeError(`Unknown bytes type marker type: ${typeof t[2]}`);if(!NC(t[2])){let e=t[2].slice(0,64);throw TypeError(`Unknown bytes type marker: ${e}`)}let n=t[2],r=PC[n];if(r!==void 0&&e.byteLength%r!==0)throw TypeError(`Invalid byte length ${e.byteLength} for ${n}; expected a multiple of ${r}`);let i=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);switch(!jC&&r!==void 0&&LC(new Uint8Array(i),r),n){case`ArrayBuffer`:return i;case`DataView`:return new DataView(i);case`Int8Array`:return new Int8Array(i);case`Uint8Array`:return new Uint8Array(i);case`Uint8ClampedArray`:return new Uint8ClampedArray(i);case`Int16Array`:return new Int16Array(i);case`Uint16Array`:return new Uint16Array(i);case`Int32Array`:return new Int32Array(i);case`Uint32Array`:return new Uint32Array(i);case`BigInt64Array`:return new BigInt64Array(i);case`BigUint64Array`:return new BigUint64Array(i);case`Float32Array`:return new Float32Array(i);case`Float64Array`:return new Float64Array(i)}}case`error`:if(t.length>=3&&typeof t[1]==`string`&&typeof t[2]==`string`){let e=BC[t[1]]||Error,n=e===AggregateError?new e([],t[2]):new e(t[2]);if(typeof t[3]==`string`&&(n.stack=t[3]),t.length>=5){let e=t[4];if(!e||typeof e!=`object`||Array.isArray(e))break;let r=n,a=e;for(let e of Object.keys(a))if(e!==`name`&&e!==`message`&&e!==`stack`){if(e in Object.prototype||e===`toJSON`){this.evaluateImpl(a[e],n,e,i+1);continue}r[e]=this.evaluateImpl(a[e],n,e,i+1)}}return n}break;case`undefined`:if(t.length===1)return;break;case`inf`:return 1/0;case`-inf`:return-1/0;case`nan`:return NaN;case`url`:if(t.length===2&&typeof t[1]==`string`)return new URL(t[1]);break;case`headers`:if(t.length===2&&t[1]instanceof Array)return new Headers(t[1]);break;case`request`:{if(t.length!==3||typeof t[1]!=`string`)break;let e=t[1],a=t[2];if(typeof a!=`object`||!a)break;if(a.body&&(a.body=this.evaluateImpl(a.body,a,`body`,i+1),!(a.body===null||typeof a.body==`string`||a.body instanceof Uint8Array||a.body instanceof ReadableStream)))throw TypeError(`Request body must be of type ReadableStream.`);if(a.signal&&(a.signal=this.evaluateImpl(a.signal,a,`signal`,i+1),!(a.signal instanceof AbortSignal)))throw TypeError(`Request siganl must be of type AbortSignal.`);if(a.headers&&!(a.headers instanceof Array))throw TypeError(`Request headers must be serialized as an array of pairs.`);let o=new Request(e,a);if(a.body instanceof ReadableStream&&o.body===void 0){let e=HC(o,a.body);return this.promises.push({promise:e,parent:n,property:r}),e}return o}case`response`:{if(t.length!==3)break;let e=this.evaluateImpl(t[1],n,r,i+1);if(!(e===null||typeof e==`string`||e instanceof Uint8Array||e instanceof ReadableStream))throw TypeError(`Response body must be of type ReadableStream.`);let a=t[2];if(typeof a!=`object`||!a)break;if(a.webSocket)throw TypeError(`Can't deserialize a Response containing a webSocket.`);if(a.headers&&!(a.headers instanceof Array))throw TypeError(`Request headers must be serialized as an array of pairs.`);return new Response(e,a)}case`blob`:{if(t.length!==3||typeof t[1]!=`string`)break;let e=t[1],a=this.evaluateImpl(t[2],n,r,i+1);if(!(a instanceof ReadableStream))throw TypeError(`Blob content must be serialized as a ReadableStream.`);let o=UC(a,e);return this.promises.push({promise:o,parent:n,property:r}),o}case`import`:case`pipeline`:{if(t.length<2||t.length>4||typeof t[1]!=`number`)break;let a=this.importer.getExport(t[1]);if(!a)throw Error(`no such entry on exports table: ${t[1]}`);let o=t[0]==`pipeline`,s=e=>{if(o){let t=new gC(e,[]);return this.promises.push({promise:t,parent:n,property:r}),t}return this.hooks.push(e),new gC(e,[])};if(t.length==2)return s(o?a.get([]):a.dup());let c=t[2];if(!(c instanceof Array)||!c.every(e=>typeof e==`string`||typeof e==`number`))break;if(t.length==3)return s(a.get(c));let l=t[3];if(!(l instanceof Array))break;return l=new e(this.importer).evaluateWithDepth([l],i),s(a.call(c,l))}case`remap`:{if(t.length!==5||typeof t[1]!=`number`||!(t[2]instanceof Array)||!(t[3]instanceof Array)||!(t[4]instanceof Array))break;let e=this.importer.getExport(t[1]);if(!e)throw Error(`no such entry on exports table: ${t[1]}`);let i=t[2];if(!i.every(e=>typeof e==`string`||typeof e==`number`))break;let a=t[3].map(e=>{if(!(e instanceof Array)||e.length!==2||e[0]!==`import`&&e[0]!==`export`||typeof e[1]!=`number`)throw TypeError(`unknown map capture: ${JSON.stringify(e)}`);if(e[0]===`export`)return this.importer.importStub(e[1]);{let t=this.importer.getExport(e[1]);if(!t)throw Error(`no such entry on exports table: ${e[1]}`);return t.dup()}}),o=t[4],s=new gC(e.map(i,a,o),[]);return this.promises.push({promise:s,parent:n,property:r}),s}case`export`:case`promise`:if(typeof t[1]==`number`){if(t[0]==`promise`){let e=new gC(this.importer.importPromise(t[1]),[]);return this.promises.push({parent:n,property:r,promise:e}),e}{let e=this.importer.importStub(t[1]);return this.hooks.push(e),new hC(e)}}break;case`writable`:if(typeof t[1]==`number`){let e=this.importer.importStub(t[1]),n=sC.createWritableStreamFromHook(e);return this.hooks.push(e),n}break;case`readable`:if(typeof t[1]==`number`){let e=this.importer.getPipeReadable(t[1]),n=sC.createReadableStreamHook(e);return this.hooks.push(n),e}}throw TypeError(`unknown special value: ${JSON.stringify(t)}`)}if(t instanceof Object){let e=t;for(let t in e)t in Object.prototype||t===`toJSON`?(this.evaluateImpl(e[t],e,t,i+1),delete e[t]):e[t]=this.evaluateImpl(e[t],e,t,i+1);return e}return t}},GC=16,KC=8,qC=16,JC=64;function YC(e){return 2+e.length*3}function XC(e,t,n=0){if(n>=JC)return KC;switch(typeof e){case`string`:return YC(e);case`number`:return 16;case`bigint`:return 16;case`boolean`:return 8;case`undefined`:return 16;case`object`:{if(e===null)return 8;if(ArrayBuffer.isView(e)||e instanceof ArrayBuffer)return qC+e.byteLength;if(typeof Blob<`u`&&e instanceof Blob)return qC+e.size;if(e instanceof Date)return 16;if(t??=new WeakSet,t.has(e))return KC;if(t.add(e),e instanceof Array){let r=GC;for(let i of e)r+=KC+XC(i,t,n+1);return r}if(e instanceof Error){let r=GC+YC(e.name)+YC(e.message)+YC(e.stack??``);for(let i of Object.keys(e))r+=KC+YC(i)+XC(e[i],t,n+1);return r}let r=GC;for(let i of Object.keys(e))r+=KC+YC(i)+XC(e[i],t,n+1);return r}default:return 16}}var ZC=class{session;importId;constructor(e,t,n){this.session=e,this.importId=t,n&&(this.activePull=Promise.withResolvers())}localRefcount=0;remoteRefcount=1;activePull;resolution;onBrokenRegistrations;resolve(e){if(this.localRefcount==0){e.dispose();return}if(this.resolution=e,this.sendRelease(),this.onBrokenRegistrations){for(let t of this.onBrokenRegistrations){let n=this.session.onBrokenCallbacks[t],r=this.session.onBrokenCallbacks.length;e.onBroken(n),this.session.onBrokenCallbacks[r]===n?delete this.session.onBrokenCallbacks[r]:delete this.session.onBrokenCallbacks[t]}this.onBrokenRegistrations=void 0}this.activePull&&=(this.activePull.resolve(),void 0)}async awaitResolution(){return this.activePull||=(this.session.sendPull(this.importId),Promise.withResolvers()),await this.activePull.promise,this.resolution.pull()}dispose(){this.resolution?this.resolution.dispose():(this.abort(Error(`RPC was canceled because the RpcPromise was disposed.`)),this.sendRelease())}abort(e){if(!this.resolution){if(this.resolution=new lC(e),this.activePull&&=(this.activePull.reject(e),void 0),this.onBrokenRegistrations)for(let e of this.onBrokenRegistrations)delete this.session.onBrokenCallbacks[e];this.onBrokenRegistrations=void 0}}onBroken(e){if(this.resolution)this.resolution.onBroken(e);else{let t=this.session.onBrokenCallbacks.length;this.session.onBrokenCallbacks.push(e),this.onBrokenRegistrations||=[],this.onBrokenRegistrations.push(t)}}sendRelease(){this.remoteRefcount>0&&(this.session.sendRelease(this.importId,this.remoteRefcount),this.remoteRefcount=0)}},QC=class e extends cC{isPromise;entry;constructor(e,t){super(),this.isPromise=e,++t.localRefcount,this.entry=t}collectPath(e){return this}getEntry(){if(this.entry)return this.entry;throw Error(`This RpcImportHook was already disposed.`)}getEntryTakingOwnership(e){try{return this.getEntry()}catch(t){throw e(),t}}call(e,t){let n=this.getEntryTakingOwnership(()=>t.dispose());return n.resolution?n.resolution.call(e,t):n.session.sendCall(n.importId,e,t)}stream(e,t){let n=this.getEntryTakingOwnership(()=>t.dispose());return n.resolution?n.resolution.stream(e,t):n.session.sendStream(n.importId,e,t)}map(e,t,n){let r=this.getEntryTakingOwnership(()=>{for(let e of t)e.dispose()});return r.resolution?r.resolution.map(e,t,n):r.session.sendMap(r.importId,e,t,n)}get(e){let t=this.getEntry();return t.resolution?t.resolution.get(e):t.session.sendCall(t.importId,e)}dup(){return new e(!1,this.getEntry())}pull(){let e=this.getEntry();if(!this.isPromise)throw Error(`Can't pull this hook because it's not a promise hook.`);return e.resolution?e.resolution.pull():e.awaitResolution()}ignoreUnhandledRejections(){}dispose(){let e=this.entry;this.entry=void 0,e&&--e.localRefcount===0&&e.dispose()}onBroken(e){this.entry&&this.entry.onBroken(e)}},$C=class extends QC{session;constructor(e){super(!1,e),this.session=e.session}dispose(){if(this.session){let e=this.session;this.session=void 0,e.shutdown()}}},ew=class{transport;options;exports=[];reverseExports=new Map;imports=[];abortReason;cancelReadLoop;nextExportId=-1;onBatchDone;pullCount=0;onBrokenCallbacks=[];encodingLevel;limits;constructor(e,t,n){this.transport=e,this.options=n;let r=`string`;if(`encodingLevel`in e){let t=e.encodingLevel;if(t!==void 0){if(t!==`string`&&t!==`jsonCompatible`&&t!==`jsonCompatibleWithBytes`&&t!==`structuredClonable`)throw TypeError(`Unknown transport encodingLevel: ${String(t)}`);r=t}}this.encodingLevel=r,this.limits={...AC,...n.limits},this.exports.push({hook:t,refcount:1}),this.imports.push(new ZC(this,0,!1)),this.readLoop().catch(e=>this.abort(e))}getMainImport(){return new $C(this.imports[0])}shutdown(){this.abort(Error(`RPC session was shut down by disposing the main stub`),!1)}exportStub(e){if(this.abortReason)throw this.abortReason;let t=this.reverseExports.get(e);if(t!==void 0)return++this.exports[t].refcount,t;{let t=this.nextExportId--;return this.exports[t]={hook:e,refcount:1},this.reverseExports.set(e,t),this.watchExport(t,e),t}}exportPromise(e){if(this.abortReason)throw this.abortReason;let t=this.nextExportId--;return this.exports[t]={hook:e,refcount:1},this.reverseExports.set(e,t),this.ensureResolvingExport(t),t}unexport(e){for(let t of e)this.releaseExport(t,1)}watchExport(e,t){t.onBroken(n=>{queueMicrotask(()=>{if(this.abortReason===void 0&&this.exports[e]?.hook===t)try{this.send([`reject`,e,VC.devaluate(n,void 0,this,void 0,this.encodingLevel)])}catch(e){this.abort(e)}})})}releaseExport(e,t){let n=this.exports[e];if(!n)throw Error(`no such export ID: ${e}`);if(n.refcount<t)throw Error(`refcount would go negative: ${n.refcount} < ${t}`);n.refcount-=t,n.refcount===0&&(delete this.exports[e],this.reverseExports.delete(n.hook),n.hook.dispose())}onSendError(e){if(this.options.onSendError)return this.options.onSendError(e)}ensureResolvingExport(e){let t=this.exports[e];if(!t)throw Error(`no such export ID: ${e}`);if(!t.pull){let n=async()=>{let e=t.hook;for(;;){let t=await e.pull();if(t.value instanceof hC){let{hook:n,pathIfPromise:r}=xC(t.value);if(r&&r.length==0&&this.getImport(e)===void 0){e=n;continue}}return t}},r=t.autoRelease;++this.pullCount,t.pull=n().then(t=>{let n=VC.devaluate(t.value,void 0,this,t,this.encodingLevel);this.send([`resolve`,e,n]),r&&this.releaseExport(e,1)},t=>{this.send([`reject`,e,VC.devaluate(t,void 0,this,void 0,this.encodingLevel)]),r&&this.releaseExport(e,1)}).catch(t=>{try{this.send([`reject`,e,VC.devaluate(t,void 0,this,void 0,this.encodingLevel)]),r&&this.releaseExport(e,1)}catch(e){this.abort(e)}}).finally(()=>{--this.pullCount===0&&this.onBatchDone&&this.onBatchDone.resolve()})}}getImport(e){if(e instanceof QC&&e.entry&&e.entry.session===this)return e.entry.importId}importStub(e){if(this.abortReason)throw this.abortReason;let t=this.imports[e];return t||(t=new ZC(this,e,!1),this.imports[e]=t),new QC(!1,t)}importPromise(e){if(this.abortReason)throw this.abortReason;if(this.imports[e])return new lC(Error(`Bug in RPC system: The peer sent a promise reusing an existing export ID.`));let t=new ZC(this,e,!0);return this.imports[e]=t,new QC(!0,t)}getExport(e){return this.exports[e]?.hook}getPipeReadable(e){let t=this.exports[e];if(!t||!t.pipeReadable)throw Error(`Export ${e} is not a pipe or its readable end was already consumed.`);let n=t.pipeReadable;return t.pipeReadable=void 0,n}getLimits(){return this.limits}createPipe(e,t){if(this.abortReason)throw this.abortReason;this.send([`pipe`]);let n=this.imports.length,r=new ZC(this,n,!1);this.imports.push(r);let i=new QC(!1,r),a=sC.createWritableStreamFromHook(i);return e.pipeTo(a).catch(()=>{}).finally(()=>t.dispose()),n}send(e){if(this.abortReason!==void 0)return 0;if(this.encodingLevel===`string`){let t;try{t=JSON.stringify(e)}catch(e){try{this.abort(e)}catch{}throw e}try{let e=this.transport.send(t);e!==void 0&&typeof e.catch==`function`&&e.catch(e=>this.abort(e,!1))}catch(e){queueMicrotask(()=>this.abort(e,!1))}return t.length}try{let t=this.transport.send(e);if(typeof t==`number`)return t;let n=t;n&&typeof n.then==`function`&&Promise.resolve(n).catch(e=>this.abort(e,!1));return}catch(e){queueMicrotask(()=>this.abort(e,!1));return}}sendCall(e,t,n){if(this.abortReason)throw n?.dispose(),this.abortReason;let r=[`pipeline`,e,t];if(n){let e;try{e=VC.devaluate(n.value,void 0,this,n,this.encodingLevel)}catch(e){throw n.dispose(),e}r.push(e[0])}this.send([`push`,r]);let i=new ZC(this,this.imports.length,!1);return this.imports.push(i),new QC(!0,i)}sendStream(e,t,n){if(this.abortReason)throw n.dispose(),this.abortReason;let r=[`pipeline`,e,t],i;try{i=VC.devaluate(n.value,void 0,this,n,this.encodingLevel)}catch(e){throw n.dispose(),e}r.push(i[0]);let a=[`stream`,r],o=this.send(a);o===void 0&&(o=XC(a));let s=this.imports.length,c=new ZC(this,s,!0);return c.remoteRefcount=0,c.localRefcount=1,this.imports.push(c),{promise:c.awaitResolution().then(e=>{e.dispose(),delete this.imports[s]},e=>{throw delete this.imports[s],e}),size:o}}sendMap(e,t,n,r){if(this.abortReason){for(let e of n)e.dispose();throw this.abortReason}let i=[`remap`,e,t,n.map(e=>{let t=this.getImport(e);return t===void 0?[`export`,this.exportStub(e)]:[`import`,t]}),r];this.send([`push`,i]);let a=new ZC(this,this.imports.length,!1);return this.imports.push(a),new QC(!0,a)}sendPull(e){if(this.abortReason)throw this.abortReason;this.send([`pull`,e])}sendRelease(e,t){this.abortReason||(this.send([`release`,e,t]),delete this.imports[e])}abort(e,t=!0){if(this.abortReason===void 0){if(this.cancelReadLoop?.(e),this.cancelReadLoop=void 0,t)try{let t=[`abort`,VC.devaluate(e,void 0,this,void 0,this.encodingLevel)];if(this.encodingLevel===`string`){let e=this.transport.send(JSON.stringify(t));e!==void 0&&typeof e.catch==`function`&&e.catch(e=>{})}else{let e=this.transport.send(t);e&&typeof e.then==`function`&&Promise.resolve(e).catch(e=>{})}}catch{}if(e===void 0&&(e=`undefined`),this.abortReason=e,this.onBatchDone&&this.onBatchDone.reject(e),this.transport.abort)try{this.transport.abort(e)}catch(e){Promise.resolve(e)}for(let t of Object.values(this.onBrokenCallbacks))try{t(e)}catch(e){Promise.resolve(e)}for(let t in this.imports)this.imports[t].abort(e);for(let e in this.exports)this.exports[e].hook.dispose()}}async readLoop(){for(;!this.abortReason;){let e=Promise.withResolvers();this.cancelReadLoop=e.reject;let t;try{t=await Promise.race([this.transport.receive(),e.promise])}finally{this.cancelReadLoop===e.reject&&(this.cancelReadLoop=void 0)}if(this.encodingLevel===`string`&&t.length>this.limits.maxMessageSize)throw TypeError(`Incoming message exceeds maximum size of ${this.limits.maxMessageSize} UTF-16 code units.`);if(this.abortReason)break;let n=this.encodingLevel===`string`?JSON.parse(t):t;if(n instanceof Array)switch(n[0]){case`push`:if(n.length>1){let e=new EC(new WC(this,this.encodingLevel).evaluate(n[1]));e.ignoreUnhandledRejections(),this.exports.push({hook:e,refcount:1});continue}break;case`stream`:if(n.length>1){let e=new EC(new WC(this,this.encodingLevel).evaluate(n[1]));e.ignoreUnhandledRejections();let t=this.exports.length;this.exports.push({hook:e,refcount:1,autoRelease:!0}),this.ensureResolvingExport(t);continue}break;case`pipe`:{let{readable:e,writable:t}=new TransformStream,n=sC.createWritableStreamHook(t),r=this.exports.length;this.exports.push({hook:n,refcount:1,pipeReadable:e}),this.watchExport(r,n);continue}case`pull`:{let e=n[1];if(typeof e==`number`){this.ensureResolvingExport(e);continue}break}case`resolve`:case`reject`:{let e=n[1];if(typeof e==`number`&&n.length>2){let t=this.imports[e];if(t){if(n[0]==`resolve`)t.resolve(new EC(new WC(this,this.encodingLevel).evaluate(n[2])));else{let e=new WC(this,this.encodingLevel).evaluate(n[2]);e.dispose(),t.resolve(new lC(e.value))}}else n[0]==`resolve`&&new WC(this,this.encodingLevel).evaluate(n[2]).dispose();continue}break}case`release`:{let e=n[1],t=n[2];if(typeof e==`number`&&typeof t==`number`){this.releaseExport(e,t);continue}break}case`abort`:{let e=new WC(this,this.encodingLevel).evaluate(n[1]);e.dispose(),this.abort(e.value,!1);break}}throw Error(`bad RPC message: ${JSON.stringify(n)}`)}}async drain(){if(this.abortReason)throw this.abortReason;if(this.pullCount>0){let{promise:e,resolve:t,reject:n}=Promise.withResolvers();this.onBatchDone={resolve:t,reject:n},await e}}getStats(){let e={imports:0,exports:0};for(let t in this.imports)++e.imports;for(let t in this.exports)++e.exports;return e}},tw=class{#e;#t;constructor(e,t,n={}){let r;r=t?new EC(CC.fromAppReturn(t)):new lC(Error(`This connection has no main object.`)),this.#e=new ew(e,r,n),this.#t=new hC(this.#e.getMainImport())}getRemoteMain(){return this.#t}getStats(){return this.#e.getStats()}drain(){return this.#e.drain()}};function nw(e,t,n){return new tw(new rw(e),t,n).getRemoteMain()}var rw=class{encodingLevel=`structuredClonable`;constructor(e){this.#e=e,e.start(),e.addEventListener(`message`,e=>{this.#i||(e.data===null?this.#a(Error(`Peer closed MessagePort connection.`)):this.#t?(this.#t(e.data),this.#t=void 0,this.#n=void 0):this.#r.push(e.data))}),e.addEventListener(`messageerror`,e=>{this.#a(Error(`MessagePort message error.`))})}#e;#t;#n;#r=[];#i;send(e){if(this.#i)throw this.#i;this.#e.postMessage(e)}async receive(){if(this.#r.length>0)return this.#r.shift();if(this.#i)throw this.#i;return new Promise((e,t)=>{this.#t=e,this.#n=t})}abort(e){try{this.#e.postMessage(null)}catch{}this.#e.close(),this.#i||=e}#a(e){this.#i||(this.#i=e,this.#n&&=(this.#n(e),this.#t=void 0,void 0))}},iw,aw=class{context;captureMap=new Map;instructions=[];constructor(e,t){this.context=iw?{parent:iw,captures:[],subject:iw.capture(e),path:t}:{parent:void 0,captures:[],subject:e,path:t},iw=this}unregister(){iw=this.context.parent}makeInput(){return new sw(this,0)}makeOutput(e){let t;try{t=VC.devaluate(e.value,void 0,this,e)}finally{e.dispose()}return this.instructions.push(t),this.context.parent?(this.context.parent.instructions.push([`remap`,this.context.subject,this.context.path,this.context.captures.map(e=>[`import`,e]),this.instructions]),new sw(this.context.parent,this.context.parent.instructions.length)):this.context.subject.map(this.context.path,this.context.captures,this.instructions)}pushCall(e,t,n){let r=VC.devaluate(n.value,void 0,this,n);r=r[0];let i=this.capture(e.dup());return this.instructions.push([`pipeline`,i,t,r]),new sw(this,this.instructions.length)}pushGet(e,t){let n=this.capture(e.dup());return this.instructions.push([`pipeline`,n,t]),new sw(this,this.instructions.length)}capture(e){if(e instanceof sw&&e.mapper===this)return e.idx;let t=this.captureMap.get(e);if(t===void 0){if(this.context.parent){let t=this.context.parent.capture(e);this.context.captures.push(t)}else this.context.captures.push(e);t=-this.context.captures.length,this.captureMap.set(e,t)}return t}exportStub(e){throw Error(`Can't construct an RpcTarget or RPC callback inside a mapper function. Try creating a new RpcStub outside the callback first, then using it inside the callback.`)}exportPromise(e){return this.exportStub(e)}getImport(e){return this.capture(e)}unexport(e){}createPipe(e){throw Error(`Cannot send ReadableStream inside a mapper function.`)}onSendError(e){}};aC.sendMap=(e,t,n)=>{let r=new aw(e,t),i;try{i=CC.fromAppReturn(fC(r.pushCall.bind(r),()=>n(new gC(r.makeInput(),[]))))}finally{r.unregister()}if(i instanceof Promise)throw i.catch(e=>{}),Error(`RPC map() callbacks cannot be async.`);return new gC(r.makeOutput(i),[])};function ow(){throw Error(`Attempted to use an abstract placeholder from a mapper function. Please make sure your map function has no side effects.`)}var sw=class extends cC{mapper;idx;constructor(e,t){super(),this.mapper=e,this.idx=t}dup(){return this}dispose(){}get(e){if(e.length==0)return this;if(iw)return iw.pushGet(this,e);ow()}call(e,t){t.dispose(),ow()}map(e,t,n){for(let e of t)e.dispose();ow()}pull(){ow()}ignoreUnhandledRejections(){}onBroken(e){ow()}},cw=class{captures;variables;constructor(e,t){this.captures=e,this.variables=[t]}dispose(){for(let e of this.variables)e.dispose()}apply(e){try{if(e.length<1)throw Error(`Invalid empty mapper function.`);for(let t of e.slice(0,-1)){let e=new WC(this).evaluateCopy(t);if(e.value instanceof hC){let t=yC(e.value);if(t){this.variables.push(t);continue}}this.variables.push(new EC(e))}return new WC(this).evaluateCopy(e[e.length-1])}finally{for(let e of this.variables)e.dispose()}}importStub(e){throw Error(`A mapper function cannot refer to exports.`)}importPromise(e){return this.importStub(e)}getExport(e){return e<0?this.captures[-e-1]:this.variables[e]}getPipeReadable(e){throw Error(`A mapper function cannot use pipe readables.`)}getLimits(){return AC}};function lw(e,t,n,r,i){let a=new cw(r,new EC(CC.deepCopyFrom(e,t,n)));try{return a.apply(i)}finally{a.dispose()}}aC.applyMap=(e,t,n,r,i)=>{try{let a;if(e instanceof gC)throw Error(`applyMap() can't be called on RpcPromise`);if(e instanceof Array){let t=[];try{for(let a of e)t.push(lw(a,e,n,r,i))}catch(e){for(let e of t)e.dispose();throw e}a=CC.fromArray(t)}else a=e==null?CC.fromAppReturn(e):lw(e,t,n,r,i);return new EC(a)}finally{for(let e of r)e.dispose()}};var uw=class e extends cC{state;static create(t){let n=t.getWriter();return new e({refcount:1,writer:n,closed:!1})}constructor(e,t){super(),this.state=e,t&&++e.refcount}getState(){if(this.state)return this.state;throw Error(`Attempted to use a WritableStreamStubHook after it was disposed.`)}call(e,t){try{let n=this.getState();if(e.length!==1||typeof e[0]!=`string`)throw Error(`WritableStream stub only supports direct method calls`);let r=e[0];if(r!==`write`&&r!==`close`&&r!==`abort`)throw Error(`Unknown WritableStream method: ${r}`);return(r===`close`||r===`abort`)&&(n.closed=!0),new kC((r===`write`?t.deliverStreamWrite(n.writer):t.deliverCall(n.writer[r],n.writer)).then(e=>new EC(e)))}catch(e){return t.dispose(),new lC(e)}}map(e,t,n){for(let e of t)e.dispose();return new lC(Error(`Cannot use map() on a WritableStream`))}get(e){return new lC(Error(`Cannot access properties on a WritableStream stub`))}dup(){let t=this.getState();return new e(t,this)}pull(){return Promise.reject(Error(`Cannot pull a WritableStream stub`))}ignoreUnhandledRejections(){}dispose(){let e=this.state;this.state=void 0,e&&--e.refcount===0&&(e.closed||e.writer.abort(Error(`WritableStream RPC stub was disposed without calling close()`)).catch(()=>{}),e.writer.releaseLock())}onBroken(e){this.getState().writer.closed.then(void 0,e)}},dw=262144,fw=1073741824,pw=65536,mw=2,hw=1.25,gw=.9,_w=3,vw=class{now;window=dw;bytesInFlight=0;inStartupPhase=!0;delivered=0;deliveredTime=0;firstAckTime=0;firstAckDelivered=0;minRtt=1/0;roundsWithoutIncrease=0;lastRoundWindow=0;roundStartTime=0;constructor(e){this.now=e}onSend(e){this.bytesInFlight+=e;let t={sentTime:this.now(),size:e,deliveredAtSend:this.delivered,deliveredTimeAtSend:this.deliveredTime,windowAtSend:this.window,windowFullAtSend:this.bytesInFlight>=this.window};return{token:t,shouldBlock:t.windowFullAtSend}}onError(e){this.bytesInFlight-=e.size}onAck(e){let t=this.now();this.delivered+=e.size,this.deliveredTime=t,this.bytesInFlight-=e.size;let n=t-e.sentTime;if(this.minRtt=Math.min(this.minRtt,n),this.firstAckTime===0)this.firstAckTime=t,this.firstAckDelivered=this.delivered;else{let n,r;e.deliveredTimeAtSend===0?(n=this.firstAckTime,r=this.firstAckDelivered):(n=e.deliveredTimeAtSend,r=e.deliveredAtSend);let i=t-n,a=(this.delivered-r)/i,o=this.inStartupPhase?mw:hw,s=a*this.minRtt*o;s=Math.min(s,e.windowAtSend*o),s=e.windowFullAtSend?Math.max(s,e.windowAtSend*gw):Math.max(s,this.window),this.window=Math.max(Math.min(s,fw),pw),this.inStartupPhase&&e.sentTime>=this.roundStartTime&&(this.window>this.lastRoundWindow*hw?this.roundsWithoutIncrease=0:++this.roundsWithoutIncrease>=_w&&(this.inStartupPhase=!1),this.roundStartTime=t,this.lastRoundWindow=this.window)}return this.bytesInFlight<this.window}};function yw(e){let t,n=!1,r=new vw(()=>performance.now()),i,a,o=()=>{n||(n=!0,e.dispose())};return new WritableStream({start(n){e.onBroken(e=>{t===void 0&&(t=e,n.error(e),o()),a&&=(a(e),i=void 0,void 0)})},write(n,s){if(t!==void 0)throw t;let c=CC.fromAppParams([n]),{promise:l,size:u}=e.stream([`write`],c);if(u===void 0)return l.catch(e=>{throw t===void 0&&(t=e),e});{let{token:e,shouldBlock:n}=r.onSend(u);if(l.then(()=>{r.onAck(e)&&i&&(i(),i=void 0,a=void 0)},n=>{r.onError(e),t===void 0&&(t=n,s.error(n),o()),a&&=(a(n),i=void 0,void 0)}),n)return new Promise((e,t)=>{i=e,a=t})}},async close(){if(t!==void 0)throw o(),t;let{promise:n}=e.stream([`close`],CC.fromAppParams([]));try{await n}catch(e){throw t??e}finally{o()}},abort(n){if(t!==void 0)return;t=n??Error(`WritableStream was aborted`),a&&=(a(t),i=void 0,void 0);let{promise:r}=e.stream([`abort`],CC.fromAppParams([n]));r.then(()=>o(),()=>o())}})}var bw=class e extends cC{state;static create(t){return new e({refcount:1,stream:t,canceled:!1})}constructor(e,t){super(),this.state=e,t&&++e.refcount}call(e,t){return t.dispose(),new lC(Error(`Cannot call methods on a ReadableStream stub`))}map(e,t,n){for(let e of t)e.dispose();return new lC(Error(`Cannot use map() on a ReadableStream`))}get(e){return new lC(Error(`Cannot access properties on a ReadableStream stub`))}dup(){let t=this.state;if(!t)throw Error(`Attempted to dup a ReadableStreamStubHook after it was disposed.`);return new e(t,this)}pull(){return Promise.reject(Error(`Cannot pull a ReadableStream stub`))}ignoreUnhandledRejections(){}dispose(){let e=this.state;this.state=void 0,e&&--e.refcount===0&&(e.canceled||(e.canceled=!0,e.stream.locked||e.stream.cancel(Error(`ReadableStream RPC stub was disposed without being consumed`)).catch(()=>{})))}onBroken(e){}};sC.createWritableStreamHook=uw.create,sC.createWritableStreamFromHook=yw,sC.createReadableStreamHook=bw.create;var xw=hC,Sw=eC,Cw=nw;function ww(e){return e<32||e>=127&&e<=159||e===1564||e>=8203&&e<=8207||e===8232||e===8233||e>=8234&&e<=8238||e>=8294&&e<=8297||e===65279}function Tw(e,t=80){let n=``;for(let t=0;t<e.length;t+=1){let r=e.charCodeAt(t);n+=ww(r)?` `:e.charAt(t)}return n=n.replace(/\s+/gu,` `).trim(),n.length<=t?n:`${n.slice(0,Math.max(0,t-1)).trimEnd()}…`}function Ew(e,t){let n=e.find(e=>e.id===t.itemId);if(n===void 0||n.kind===`text`)return!1;if(n.kind===`menu`){let e=n.options.find(e=>e.id===t.optionId);return e!==void 0&&e.disabled!==!0}return t.optionId===void 0?n.kind!==`button`||n.disabled!==!0:!1}Object.freeze({publish:()=>Promise.resolve(),onBack:()=>()=>void 0,onForward:()=>()=>void 0,onActivate:()=>()=>void 0});function Dw(e,t){if(t.kind===`action`){let n=[...e.primary??[],...e.menu??[]].find(e=>e.id===t.actionId);return n!==void 0&&n.disabled!==!0}let n=e.crumbs?.find(e=>e.id===t.crumbId);return n===void 0?!1:t.siblingId===void 0||n.siblings?.some(e=>e.id===t.siblingId)===!0}var Ow=`fungi.app.ready`,kw=`fungi.app.connect`,Z=e=>ix.pipe(J(Mx(1)),J(Fx(e))),Aw=e=>V(Z(e)),jw=ax.pipe(J(Ax()),J(gx(Number.isSafeInteger,{message:`Expected a safe integer`}))),Mw=jw.pipe(J(Dx(0))),Nw=jw.pipe(J(Ex(0))),Pw=G({appId:Z(160),releaseId:Z(160),surfaceId:Z(160)}),Fw=G({editing:W,surface:lx([Z(160),nx])}),Iw=lx([G({kind:H(`compose`),requestId:Z(160),text:Z(2e3)}),G({kind:H(`navigate`),requestId:Z(160),params:K(G({key:Z(64),value:Z(4096)})).pipe(J(Fx(16)))})]),Lw=tx(q([`granted`,`missing`])),Rw=G({"agent.list":Lw,"agent.manage":Lw,"agent.read":Lw,"agent.send":Lw,"computer.list":Lw,"computer.readFile":Lw,"computer.writeFile":Lw,"computer.execute":Lw,"git.repository":Lw,"workflow.publish":Lw,"workflow.arm":Lw,"workflow.run":Lw,"app.events.emit":Lw,"llm.generation":Lw,"media.generation":Lw,"media.share":Lw}),zw=q([`ready`,`missing`,`unknown`]),Bw=G({models:zw,media:zw,git:zw,terminal:q([`ready`,`exec-only`,`missing`,`unknown`]),terminalReason:V(ix)}),Vw=q([`model`,`media`,`git`,`computer`]),Hw=q([`opened`,`unavailable`]),Uw=G({computerId:lx([Z(256),nx]),teamHasComputers:V(ux(W)),computerAccessGranted:V(W),setup:V(Bw),permissions:V(Rw),focus:Fw,openRequest:lx([nx,Iw]),visibility:q([`visible`,`hidden`])}),Ww=q([`connecting`,`connected`,`suspended`,`disconnected`,`disposing`,`disposed`]),Gw=G({altKey:W,ctrlKey:W,id:Z(160),key:Z(64),metaKey:W,shiftKey:W}),Kw=G({action:V(U),availability:V(U),category:Z(160),description:Aw(512),id:Z(160),projections:V(U),title:Z(160)}),qw=G({arguments:V(U),commandId:Z(321),origin:q([`agent`,`browser`,`keyboard`,`menu`,`palette`,`programmatic`,`slash`,`terminal`]),requestId:Z(160)}),Jw=lx([G({result:V(U),status:H(`handled`)}),G({error:U,status:H(`failed`)})]),Yw=e=>Z(e).pipe(J(gx(e=>{for(let t=0;t<e.length;t+=1)if(ww(e.charCodeAt(t)))return!1;return!0},{message:`Expected one line of plain text`}))),Xw={id:Z(64),text:Yw(80),end:tx(W),priority:tx(H(`low`))},Zw=tx(ax.pipe(J(Ax()),J(kx({minimum:0,maximum:9999})))),Qw=K(lx([G({...Xw,kind:H(`text`),tone:tx(q([`neutral`,`success`,`warning`,`error`]))}),G({...Xw,kind:H(`button`),icon:tx(q([`folder`,`ports`,`processes`,`access`])),count:Zw,tone:tx(q([`neutral`,`success`,`warning`,`error`])),busy:tx(W),title:tx(Yw(1024)),disabled:tx(W),opens:tx(H(`dialog`)),expanded:tx(W)}),G({...Xw,kind:H(`toggle`),pressed:W}),G({...Xw,kind:H(`menu`),count:Zw,title:tx(Yw(1024)),options:K(G({id:Z(64),text:Yw(80),checked:tx(W),disabled:tx(W)})).pipe(J(Fx(16)),J(gx(e=>new Set(e.map(e=>e.id)).size===e.length,{message:`Expected unique status option ids`})))})])).pipe(J(Fx(6)),J(gx(e=>new Set(e.map(e=>e.id)).size===e.length,{message:`Expected unique status item ids`}))),$w=G({computerId:Z(256),path:Z(1024)}),eT=Z(80).pipe(J(gx(e=>e.trim()===e,{message:`Expected a trimmed title`}))),tT=Z(64),nT=Z(80),rT=e=>new Set(e.map(e=>e.id)).size===e.length,iT=G({id:tT,label:nT,siblings:V(K(G({id:tT,label:nT})).pipe(J(Fx(16)),J(gx(rT,{message:`Expected unique crumb sibling ids`}))))}),aT=G({id:tT,label:nT,icon:V(H(`play`)),variant:V(q([`primary`,`outline`,`ghost`])),tone:V(H(`destructive`)),disabled:V(W)}),oT=e=>K(aT).pipe(J(Fx(e)),J(gx(rT,{message:`Expected unique header command ids`}))),sT={status:V(K(G({id:tT,label:nT,presentation:V(H(`bead`)),tone:V(q([`neutral`,`info`,`warning`,`success`,`error`]))})).pipe(J(Fx(4)),J(gx(rT,{message:`Expected unique header status ids`})))),crumbs:V(K(iT).pipe(J(Fx(8)),J(gx(rT,{message:`Expected unique crumb ids`})))),primary:V(oT(3)),menu:V(oT(12))},cT=G({contractVersion:H(2),canGoBack:W,canGoForward:W,title:V(eT),...sT}),lT=G({canGoBack:W,canGoForward:W,title:V(ix),...sT}),uT=lx([G({kind:H(`crumb`),crumbId:tT,siblingId:V(tT)}),G({kind:H(`action`),actionId:tT})]),dT=ux(G({agentId:Z(256),sessionId:Z(256)})),fT=e=>V(K(q(e)).pipe(J(Fx(e.length)))),pT=G({agents:V(K(q([`agent.list`,`agent.manage`,`agent.read`,`agent.send`])).pipe(J(Fx(4)))),computers:V(K(q([`computer.list`,`computer.readFile`,`computer.writeFile`,`computer.execute`])).pipe(J(Fx(4)))),git:fT([`git.repository`]),workflows:fT([`workflow.publish`,`workflow.arm`,`workflow.run`]),events:fT([`app.events.emit`]),generation:fT([`llm.generation`,`media.generation`,`media.share`])}),mT=q([`granted`,`declined`,`customize`]),hT=G({message:Z(512),tone:V(q([`info`,`success`,`warning`,`error`]))}),gT=q(Xx);G({code:gT.pick([`DELIVERY_PENDING`])});var _T=G({code:gT,message:Z(512),retryable:W,need:tx(Gx)}),vT=G({protocolVersion:H(2),type:H(Ow)}),yT=G({epoch:Z(160),protocolVersion:H(2),type:H(kw)}),bT=G({epoch:Z(160),protocolVersion:H(2)}),xT={[Symbol.dispose]:V(U)},ST=lx([G({...xT,ok:H(!0),value:U}),G({...xT,error:_T,ok:H(!1)})]);function Q(e,t,n=`PROTOCOL`){return Ns(Qb(e,{onExcessProperty:`error`}),Bu({onFailure:e=>{throw new Y(`The peer sent malformed protocol data`,{cause:e,code:n,retryable:!1})},onSuccess:t}))}function $(e){return Object.freeze(e)}function CT(e,t){let n=e.arguments===void 0?void 0:rs(e.arguments),r={origin:e.origin,signal:t};return n!==void 0&&Object.assign(r,{arguments:n}),$(r)}var wT=Q(Kw,e=>{let t={category:e.category,id:e.id,title:e.title};return e.action!==void 0&&Object.assign(t,{action:e.action}),e.availability!==void 0&&Object.assign(t,{availability:e.availability}),e.description!==void 0&&Object.assign(t,{description:e.description}),e.projections!==void 0&&Object.assign(t,{projections:e.projections}),$(hE(()=>gs(t)))},`INVALID_ARGUMENT`),TT=Q(Z(321),e=>e),ET=Q(qw,e=>{let t=e.arguments===void 0?void 0:rs(e.arguments),n={commandId:e.commandId,origin:e.origin,requestId:e.requestId};return t!==void 0&&Object.assign(n,{arguments:t}),$(n)}),DT=Q(lx([rx,U]),e=>e===void 0?void 0:rs(e)),OT=Q(yT,e=>$(e));Q(bT,e=>$(e));var kT=Q(Uw,e=>{let t={computerId:e.computerId,focus:$({...e.focus}),openRequest:e.openRequest===null?null:$({...e.openRequest}),visibility:e.visibility};return e.teamHasComputers!==void 0&&(t.teamHasComputers=e.teamHasComputers),e.computerAccessGranted!==void 0&&(t.computerAccessGranted=e.computerAccessGranted),e.setup!==void 0&&(t.setup=$({...e.setup})),e.permissions!==void 0&&(t.permissions=$({...e.permissions})),$(t)}),AT=Q(_T,e=>$({...e})),jT=Q(Fw,e=>$({...e}),`INVALID_ARGUMENT`),MT=Q(Pw,e=>$({...e})),NT=Q(Ww,e=>e),PT=Q(Qw,e=>$(e.map(e=>e.kind===`menu`?$({...e,options:$(e.options.map(e=>$(e)))}):$(e))),`INVALID_ARGUMENT`),FT=Q(G({itemId:Z(64),optionId:tx(Z(64)),anchor:tx(G({start:ax.pipe(J(kx({minimum:0,maximum:1e5}))),width:ax.pipe(J(kx({minimum:0,maximum:1e5})))}))}),e=>$(e.anchor===void 0?{...e}:{...e,anchor:$({...e.anchor})}),`INVALID_ARGUMENT`),IT=Q($w,e=>$({...e}),`INVALID_ARGUMENT`);function LT(e){let t={id:e.id,label:e.label};return e.presentation!==void 0&&(t={...t,presentation:e.presentation}),e.tone!==void 0&&(t={...t,tone:e.tone}),$(t)}function RT(e){let t={id:e.id,label:e.label};return e.siblings===void 0?$(t):$({...t,siblings:$(e.siblings.map(e=>$({...e})))})}function zT(e){let t={id:e.id,label:e.label};return e.icon!==void 0&&(t={...t,icon:e.icon}),e.variant!==void 0&&(t={...t,variant:e.variant}),e.tone!==void 0&&(t={...t,tone:e.tone}),e.disabled!==void 0&&(t={...t,disabled:e.disabled}),$(t)}function BT(e){let t={canGoBack:e.canGoBack,canGoForward:e.canGoForward};return e.title!==void 0&&(t={...t,title:e.title}),e.crumbs!==void 0&&(t={...t,crumbs:$(e.crumbs.map(RT))}),e.primary!==void 0&&(t={...t,primary:$(e.primary.map(zT))}),e.menu!==void 0&&(t={...t,menu:$(e.menu.map(zT))}),e.status!==void 0&&(t={...t,status:$(e.status.map(LT))}),$(t)}var VT=Q(cT,BT,`INVALID_ARGUMENT`),HT=Q(lT,e=>{let t=e.title?.trim();return UT({...BT({...e,title:t===void 0||t.length===0?void 0:t}),contractVersion:2})},`INVALID_ARGUMENT`),UT=Q(cT,e=>$({...BT(e),contractVersion:2}),`INVALID_ARGUMENT`),WT=Q(uT,e=>e.kind===`action`?$({...e}):$(e.siblingId===void 0?{kind:e.kind,crumbId:e.crumbId}:e),`INVALID_ARGUMENT`),GT=Q(dT,e=>e===null?null:$({...e}),`INVALID_ARGUMENT`),KT=Q(pT,e=>$({agents:$([...new Set(e.agents??[])]),computers:$([...new Set(e.computers??[])]),...e.git&&{git:$([...new Set(e.git)])},...e.workflows&&{workflows:$([...new Set(e.workflows)])},...e.events&&{events:$([...new Set(e.events)])},...e.generation&&{generation:$([...new Set(e.generation)])}}),`INVALID_ARGUMENT`),qT=Q(Vw,e=>e,`INVALID_ARGUMENT`);Q(vT,e=>$(e));var JT=Q(Z(512),e=>e),YT=Q(hT,e=>$({...e}),`INVALID_ARGUMENT`);Q(G({id:Z(160),repeat:W}),e=>$(e));var XT=Q(K(Gw).pipe(J(Fx(64))),e=>{if(new Set(e.map(e=>e.id)).size!==e.length)throw new Y(`Reserved chords are invalid`,{code:`PROTOCOL`,retryable:!1});return $(e.map(e=>$({...e})))});function ZT(e){return Q(G({value:U,version:Mw}),t=>$({value:e(t.value),version:t.version}))}var QT=ZT(kT),$T=Q(G({capabilities:K(U).pipe(J(Fx(128))),context:U}),e=>$({capabilities:$(e.capabilities.map(e=>aE(e))),context:QT(e.context)})),eE=ZT(NT),tE=ZT(XT),nE=ZT(JT),rE=Ns(eE,e=>{if(e.value!==`connected`&&e.value!==`suspended`)throw new Y(`The host lifecycle is invalid`,{code:`PROTOCOL`,retryable:!1});return $({value:e.value,version:e.version})});function iE(e){return Q(G({handle:U,id:Z(160),version:Nw}),t=>{if(!(t.handle instanceof xw)&&!(e&&t.handle instanceof Sw))throw new Y(`A capability handle is invalid`,{code:`PROTOCOL`,retryable:!1});return $({handle:t.handle,id:t.id,version:t.version})})}var aE=iE(!1),oE=iE(!0);function sE(e){let t=e?oE:aE;return Q(G({capabilities:K(U).pipe(J(Fx(128))),context:U,identity:U,lifecycle:U,reservedChords:U,theme:U}),e=>$({capabilities:$(e.capabilities.map(e=>t(e))),context:QT(e.context),identity:MT(e.identity),lifecycle:rE(e.lifecycle),reservedChords:tE(e.reservedChords),theme:nE(e.theme)}))}var cE=sE(!1);sE(!0);function lE(e){return Q(ST,t=>t.ok?$({ok:!0,value:e(t.value)}):$({ok:!1,error:AT(t.error)}))}var uE=lE(cE),dE=lE(Q(G({commandId:Z(321)}),e=>$(e)));lE(Q(Jw,e=>{if(e.status===`failed`)return $({status:`failed`,error:hE(()=>as(e.error))});let t=e.result===void 0?void 0:rs(e.result);return $(t===void 0?{status:`handled`}:{status:`handled`,result:t})}));var fE=lE(Q(rx,()=>void 0)),pE=lE(Q(mT,e=>e)),mE=lE(Q(Hw,e=>e));lE(Q(W,e=>e)),lE(Q(W,e=>e));function hE(e){try{return e()}catch(e){throw new Y(`The command metadata is invalid`,{cause:e,code:`INVALID_ARGUMENT`,retryable:!1})}}var gE=lx([G({kind:H(`saveFile`),name:Z(255).pipe(J(yx(/^[^\p{Cc}/\\]+$/u))),mime:Z(255),bytes:Ux}),G({kind:H(`copyText`),text:ix})]);function _E(e){let t=Qb(gE,{onExcessProperty:`error`})(e);if(Lu(t))return{kind:`refused`,reason:`invalid-request`};let n=t.success;return n.kind===`saveFile`?n.name===`.`||n.name===`..`?{kind:`refused`,reason:`invalid-request`}:n.bytes.byteLength>33554432?{kind:`refused`,reason:`too-large`}:{...n,bytes:new Uint8Array(n.bytes)}:n.text.length>1048576||new TextEncoder().encode(n.text).byteLength>1048576?{kind:`refused`,reason:`too-large`}:n}var vE=lE(Q(lx([G({kind:H(`saved`)}),G({kind:H(`copied`)}),G({kind:H(`refused`),reason:q([`no-user-gesture`,`too-large`,`invalid-request`,`unavailable`,`denied`,`busy`])})]),e=>$(e)));function yE(e){let t=e,n=new Set;return{get:()=>t,subscribe(e){n.add(e);let t=!0;return()=>{t&&(t=!1,n.delete(e))}},update(e){if(!Object.is(t,e)){t=e;for(let e of Array.from(n))try{e(t)}catch(e){console.warn(`App store subscriber failed`,e)}}}}}function bE(e){let t=new Map,n=yE(0),r=!1,i=e=>{let t=new Map;try{for(let n of e){let e=aE(n),r=TE(e.id,e.version);if(t.has(r))throw SE(e.handle),new Y(`Duplicate capability grant`,{code:`PROTOCOL`,retryable:!1});t.set(r,e.handle)}}catch(e){for(let e of t.values())SE(e);throw e}return t};for(let[n,r]of i(e))t.set(n,r);let a=e=>{for(let t of e)SE(t)},o=e=>{if(r)throw new Y(`The app connection is disposed`,{code:`DISCONNECTED`,retryable:!0});let n=TE(e.id,e.version);return t.get(n)};return{directory:Object.freeze({get version(){return n.get()},subscribe:e=>n.subscribe(e),has(e){return!!o(e)},require(e){let t=o(e);if(!t)throw new Y(`The capability is not granted`,{code:`CAPABILITY_DENIED`,retryable:!1});try{return e.schema.parse(t)}catch(e){throw new Y(`The capability interface is malformed`,{cause:e,code:`PROTOCOL`,retryable:!1})}}}),replace(e){if(r)throw new Y(`The app connection is disposed`,{code:`DISCONNECTED`,retryable:!0});let o=i(e),s=[...t.values()];t.clear();for(let[e,n]of o)t.set(e,n);a(s.filter(e=>![...o.values()].includes(e))),n.update(n.get()+1)},disconnect(){r||(r=!0,a(t.values()),t.clear(),n.update(n.get()+1))}}}var xE=Za().transform(e=>{let t=Zo(Object).safeParse(e);if(!t.success)return;let n=Object.create(t.data),r=$b(G({[Symbol.dispose]:V(mx(Function))}))(n);return{owner:t.data,dispose:r[Symbol.dispose]}});function SE(e){try{let t=xE.parse(e);if(t===void 0||wE.has(t.owner))return;wE.add(t.owner),t.dispose?.call(t.owner)}catch(e){console.warn(`RPC value disposal failed`,e)}}function CE(e){return{value:e,[Symbol.dispose](){SE(e)}}}var wE=new WeakSet;function TE(e,t){return`${e}@${String(t)}`}var EE=class{id;version;#e;constructor(e,t,n){this.id=e,this.version=t,this.#e=n,Object.freeze(this)}get schema(){return this.#e}};function DE(e,t,n){return new EE(e,t,n)}function OE(e){let t=M(e),n=Zo(Object),r=M(Object.fromEntries(Object.keys(e).map(e=>[e,Za().optional()])));return Za().transform(e=>{let i=n.parse(e),a=Object.create(i),o=r.parse(a),s=Object.fromEntries(Object.entries(o).flatMap(([e,t])=>t===void 0?[]:[[e,Ko().parse(t).bind(i)]]));return{...t.parse(s),[Symbol.dispose](){SE(e)}}})}function kE(e){return Za().transform(t=>{try{return e.parse(t)}catch(e){throw e instanceof Y?e:new Y(`The capability returned malformed data`,{cause:e,code:`PROTOCOL`,retryable:!1})}finally{SE(t)}})}function AE(e){return Ko({output:Wo(Za().transform(t=>{try{return e.parse(t)}catch(e){throw SE(t),e instanceof Y?e:new Y(`The capability returned a malformed result`,{cause:e,code:`PROTOCOL`,retryable:!1})}}))})}var jE=AE(kE(to()));OE({fetch:AE(Zo(Response)),close:jE});var ME=Object.freeze({alphaIntercept:-9,alphaSlope:19,blurStdDeviation:1.5}),NE=Object.freeze([`2xs`,`xs`,`sm`,`md`,`lg`,`xl`,`2xl`,`3xl`,`4xl`]);Object.freeze(`--stipe-font-synthesis.--stipe-surface-frame-width.--stipe-surface-frame-image.--stipe-surface-molding-contrast.--stipe-shadow-raised.--stipe-shadow-inset.--stipe-shadow-edge.--stipe-display-gasket-face.--stipe-display-texture-image.--stipe-display-text-shadow.--stipe-canvas.--stipe-surface.--stipe-surface-raised.--stipe-surface-selected.--stipe-fg-muted.--stipe-linework.--stipe-hairline.--stipe-hairline-quiet.--stipe-figure-ink.--stipe-density-compact.--stipe-density-comfortable.--stipe-motion-spring.--stipe-motion-squish.--stipe-motion-fast.--stipe-motion-normal.--stipe-motion-slow.--stipe-motion-ease.--stipe-motion-ease-exit.--stipe-motion-bounce.--stipe-motion-spring-duration.--stipe-motion-stretch.--stipe-motion-distance.--stipe-motion-stagger.--stipe-motion-blur.--stipe-motion-shake.--stipe-motion-steps.--stipe-motion-fuse.--stipe-press-depth.--stipe-press-scale.--stipe-layer-desktop.--stipe-layer-windows.--stipe-layer-chrome.--stipe-layer-popover.--stipe-layer-dialog.--stipe-layer-toast.--stipe-layer-tooltip.--stipe-overlay-shadow-outset.--stipe-icon-size-sm.--stipe-icon-size-md.--stipe-icon-size-lg.--stipe-icon-stroke.--stipe-card-rim.--stipe-card-rim-edge.--stipe-card-face.--stipe-card-panel.--stipe-card-ink.--stipe-card-ink-muted.--stipe-card-accent.--stipe-card-shadow.--stipe-card-foil-highlight.--stipe-card-foil-warm.--stipe-card-foil-cool.--stipe-avatar-shadow.--stipe-art-coral.--stipe-art-blue.--stipe-art-mint.--stipe-art-grape.--stipe-art-yellow.--stipe-art-cream.--stipe-art-ink.--stipe-art-inkcap.--stipe-art-graphite.--stipe-sketch-ink`.split(`.`));function PE(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=PE(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function FE(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=PE(e))&&(r&&(r+=` `),r+=t);return r}var IE=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,LE=FE,RE=(e,t)=>n=>{if(t?.variants==null)return LE(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=IE(t)||IE(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 LE(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)},zE=Object.defineProperty,BE=((e,t)=>{let n={};for(var r in e)zE(n,r,{get:e[r],enumerable:!0});return t||zE(n,Symbol.toStringTag,{value:`Module`}),n})({isAny:()=>eD,isAnyNonArbitrary:()=>aD,isArbitraryFamilyName:()=>SD,isArbitraryImage:()=>wD,isArbitraryLength:()=>yD,isArbitraryNumber:()=>bD,isArbitraryPosition:()=>CD,isArbitraryShadow:()=>TD,isArbitrarySize:()=>_D,isArbitraryValue:()=>vD,isArbitraryVariable:()=>ED,isArbitraryVariableFamilyName:()=>OD,isArbitraryVariableImage:()=>jD,isArbitraryVariableLength:()=>DD,isArbitraryVariablePosition:()=>kD,isArbitraryVariableShadow:()=>MD,isArbitraryVariableSize:()=>AD,isArbitraryVariableWeight:()=>ND,isArbitraryWeight:()=>xD,isFraction:()=>YE,isInteger:()=>ZE,isNamedContainerQuery:()=>oD,isNumber:()=>XE,isPercent:()=>QE,isTshirtSize:()=>$E}),VE=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,HE=/^\((?:(\w[\w-]*):)?(.+)\)$/i,UE=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,WE=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,GE=/\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$/,KE=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,qE=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,JE=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,YE=e=>UE.test(e),XE=e=>!!e&&!Number.isNaN(Number(e)),ZE=e=>!!e&&Number.isInteger(Number(e)),QE=e=>e.endsWith(`%`)&&XE(e.slice(0,-1)),$E=e=>WE.test(e),eD=()=>!0,tD=e=>GE.test(e)&&!KE.test(e),nD=()=>!1,rD=e=>qE.test(e),iD=e=>JE.test(e),aD=e=>!vD(e)&&!ED(e),oD=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)),sD=(e,t,n)=>{let r=VE.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},cD=(e,t,n=!1)=>{let r=HE.exec(e);return r?r[1]?t(r[1]):n:!1},lD=e=>e===`position`||e===`percentage`,uD=e=>e===`image`||e===`url`,dD=e=>e===`length`||e===`size`||e===`bg-size`,fD=e=>e===`length`,pD=e=>e===`number`,mD=e=>e===`family-name`,hD=e=>e===`number`||e===`weight`,gD=e=>e===`shadow`,_D=e=>sD(e,dD,nD),vD=e=>VE.test(e),yD=e=>sD(e,fD,tD),bD=e=>sD(e,pD,XE),xD=e=>sD(e,hD,eD),SD=e=>sD(e,mD,nD),CD=e=>sD(e,lD,nD),wD=e=>sD(e,uD,iD),TD=e=>sD(e,gD,rD),ED=e=>HE.test(e),DD=e=>cD(e,fD),OD=e=>cD(e,mD),kD=e=>cD(e,lD),AD=e=>cD(e,dD),jD=e=>cD(e,uD),MD=e=>cD(e,gD,!0),ND=e=>cD(e,hD,!0),PD=(e,t)=>{let n=Object.keys(e);return n.length===1&&n[0]===t&&typeof e[t]==`string`},FD=e=>typeof e==`function`&&e.isThemeGetter===!0,ID=e=>({...e,theme:{...e.theme},classGroups:{...e.classGroups},conflictingClassGroups:{...e.conflictingClassGroups},conflictingClassGroupModifiers:{...e.conflictingClassGroupModifiers},orderSensitiveModifiers:[...e.orderSensitiveModifiers],postfixLookupClassGroups:[...e.postfixLookupClassGroups??[]]}),LD=(e,t)=>{let n=ID(e);t.prefix!==void 0&&(n.prefix=t.prefix);let r=(e,t)=>{if(t)for(let n in t)t[n]!==void 0&&(e[n]=t[n])},i=t.override;i&&(i.orderSensitiveModifiers&&(n.orderSensitiveModifiers=[...i.orderSensitiveModifiers]),r(n.theme,i.theme),r(n.classGroups,i.classGroups),r(n.conflictingClassGroups,i.conflictingClassGroups),r(n.conflictingClassGroupModifiers,i.conflictingClassGroupModifiers));let a=(e,t)=>{if(t)for(let n in t){let r=t[n];r&&(e[n]=(e[n]??[]).concat(r))}},o=t.extend;return o&&(o.orderSensitiveModifiers&&(n.orderSensitiveModifiers=[...n.orderSensitiveModifiers,...o.orderSensitiveModifiers]),a(n.theme,o.theme),a(n.classGroups,o.classGroups),a(n.conflictingClassGroups,o.conflictingClassGroups),a(n.conflictingClassGroupModifiers,o.conflictingClassGroupModifiers)),n},RD={isAny:0,isAnyNonArbitrary:1,isArbitraryValue:2,isArbitraryVariable:3,isFraction:4,isNumber:5,isInteger:6,isPercent:7,isTshirtSize:8,isNamedContainerQuery:9,isArbitraryLength:10,isArbitraryNumber:11,isArbitraryWeight:12,isArbitraryFamilyName:13,isArbitraryPosition:14,isArbitrarySize:15,isArbitraryImage:16,isArbitraryShadow:17,isArbitraryVariableLength:18,isArbitraryVariableFamilyName:19,isArbitraryVariablePosition:20,isArbitraryVariableSize:21,isArbitraryVariableImage:22,isArbitraryVariableShadow:23,isArbitraryVariableWeight:24},zD=25,BD=()=>({names:[],idByName:new Map,impls:{},fnName:new Map,classifierFns:new Map}),VD=(e,t,n)=>{let r=e.idByName.get(t);return r===void 0&&(r=e.names.length,e.names.push(t),e.idByName.set(t,r),e.classifierFns.set(t,n)),r},HD=(e,t)=>{if(typeof t==`function`){let n=e.fnName.get(t);return n===void 0&&(n=`$c`+e.fnName.size,e.fnName.set(t,n),e.impls[n]=t),VD(e,n,t)}let n=t.$v,r=BE[n];if(RD[n]===void 0||!r)throw Error(`cn: unknown validator "${n}"`);return VD(e,n,r)},UD=()=>({nextPart:new Map,validators:null,classGroupId:-1,lit:[]}),WD=(e,t)=>e.theme[t]??[],GD=(e,t,n)=>{let r=UD(),i=(e,t)=>{for(let n of t.split(`-`)){let t=e.nextPart.get(n);t||(t=UD(),e.nextPart.set(n,t)),e=t}return e},a=(n,r,o)=>{if(typeof n==`string`){let e=n===``?r:i(r,n);e.classGroupId=o;return}if(typeof n==`function`){if(FD(n)){for(let t of n(e.theme))a(t,r,o);return}(r.validators??=[]).push({validatorId:HD(t,n),groupId:o});return}if(PD(n,`$t`)){for(let t of WD(e,n.$t))a(t,r,o);return}if(PD(n,`$v`)){(r.validators??=[]).push({validatorId:HD(t,n),groupId:o});return}for(let[e,t]of Object.entries(n)){let n=i(r,e);for(let e of t)a(e,n,o)}};for(let[t,i]of Object.entries(e.classGroups)){let e=n(t);for(let t of i)a(t,r,e)}return r},KD=e=>{let t=BD(),n=[],r=new Map,i=e=>{let t=r.get(e);return t===void 0&&(t=n.length,n.push(e),r.set(e,t)),t},a=GD(e,t,i),o=e=>{if(e.validators)return!1;for(let t of e.nextPart.values())if(!o(t))return!1;return!0},s=(e,t,n)=>{e.classGroupId>=0&&n.push({tail:t,gid:e.classGroupId});for(let[r,i]of e.nextPart)s(i,t+`-`+r,n)},c=e=>{for(let[t,n]of[...e.nextPart])o(n)?(s(n,t,e.lit),e.nextPart.delete(t)):c(n)};c(a);let l=[{edges:new Map,groupId:-1,vlist:-1}],u=()=>(l.push({edges:new Map,groupId:-1,vlist:-1}),l.length-1),d=[],f=new Map,p=e=>{let t=e.map(e=>e.validatorId+`:`+e.groupId).join(`,`),n=f.get(t);return n===void 0&&(n=d.length,d.push(e.map(e=>[e.validatorId,e.groupId])),f.set(t,n)),n},m=(e,t)=>{let n=e;for(let e=0;e<t.length;e++){let r=t.charCodeAt(e),i=l[n].edges.get(r);i===void 0&&(i=u(),l[n].edges.set(r,i)),n=i}return n},h=[],g=(e,t,n)=>{e.classGroupId>=0&&(l[t].groupId=e.classGroupId),e.validators&&(l[t].vlist=p(e.validators));for(let{tail:n,gid:r}of e.lit)h.push({anchor:t,tail:n,gid:r});for(let[r,i]of e.nextPart){let e=t;if(!n){let n=l[t].edges.get(45);n===void 0&&(n=u(),l[t].edges.set(45,n)),e=n}let a=m(e,r);g(i,a,!1)}};g(a,0,!0);let _=new Set(h.map(e=>e.anchor)),v=e=>l[e].groupId>=0||l[e].vlist>=0||_.has(e),y=new Map,b=[],ee=e=>{let t=b.length;y.set(e,t);let n={edges:[],groupId:l[e].groupId,vlist:l[e].vlist};b.push(n);let r=[...l[e].edges.entries()].sort((e,t)=>e[0]-t[0]);for(let[e,t]of r){let r=String.fromCharCode(e),i=t;for(;l[i].edges.size===1&&!v(i);){let[[e,t]]=l[i].edges.entries();r+=String.fromCharCode(e),i=t}n.edges.push({label:r,oldTarget:i})}for(let e of n.edges)ee(e.oldTarget);return t};ee(0);let te=b.length,ne=0;for(let e of b)ne+=e.edges.length;let re=new Int32Array(te),ie=new Int32Array(ne),x=``,S=new Int32Array(te),ae=new Int32Array(te),oe=[];{let e=0;for(let t=0;t<te;t++){let n=b[t];re[t]=n.edges.length;for(let t of n.edges)ie[e]=t.label.length,x+=t.label,oe.push(y.get(t.oldTarget)),e++;S[t]=n.groupId,ae[t]=n.vlist}}{let e=new Int32Array(te);for(let t=te-1;t>=0;t--){let n=1,r=t+1;for(let i=0;i<re[t];i++)n+=e[r],r+=e[r];e[t]=n}let t=0;for(let n=0;n<te;n++){let r=n+1;for(let i=0;i<re[n];i++){if(r!==oe[t])throw Error(`cn compiler: edge target mismatch at ${t}`);r+=e[r],t++}}}for(let e of h)e.anchor=y.get(e.anchor);{let e=new Int32Array(d.length).fill(-1),t=[];for(let n=0;n<te;n++){let r=ae[n];r>=0&&(e[r]===-1&&(e[r]=t.length,t.push(d[r])),ae[n]=e[r])}d.length=0,d.push(...t)}let C=0;for(let e of d)C+=e.length;let w=new Int32Array(C),se=new Int32Array(C);{let e=0;for(let t of d)for(let[n,r]of t)w[e]=n,se[e]=r,e++}h.sort((e,t)=>e.anchor-t.anchor||e.gid-t.gid||(e.tail<t.tail?-1:1));let ce=[];for(let e of h){let t=ce[ce.length-1];t&&t.anchor===e.anchor&&t.gid===e.gid?t.tails.push(e.tail):ce.push({anchor:e.anchor,gid:e.gid,tails:[e.tail],set:-1})}let T=new Map,le=[];for(let e of ce){let t=e.tails.join(` `),n=T.get(t);n===void 0&&(n=le.length,T.set(t,n),le.push(e.tails)),e.set=n}for(let e of le.flat())if(e.includes(`|`)||e.includes(` `))throw Error(`cn compiler: tail contains delimiter: `+e);let ue=new Set(le.flat()).size;ce.sort((e,t)=>e.anchor-t.anchor||e.set-t.set);for(let t of Object.values(e.conflictingClassGroups))for(let e of t)i(e);for(let t of Object.values(e.conflictingClassGroupModifiers))for(let e of t)i(e);for(let t of e.postfixLookupClassGroups??[])i(t);let de=n.length,fe=new Int32Array(de).fill(-1),pe=0,me=e=>(fe[e]===-1&&(fe[e]=pe++),fe[e]);for(let e=0;e<se.length;e++)se[e]=me(se[e]);for(let e of ce)e.gid=me(e.gid);for(let e=0;e<S.length;e++)S[e]>=0&&(S[e]=me(S[e]));for(let e=0;e<de;e++)fe[e]===-1&&(fe[e]=pe++);let he=Array(de);for(let e=0;e<de;e++)he[fe[e]]=n[e];let ge=[],_e=[],ve=[],ye=[],be=[];for(let t=0;t<de;t++){let n=he[t],i=(e.conflictingClassGroups[n]??[]).map(e=>fe[r.get(e)]),a=(e.conflictingClassGroupModifiers[n]??[]).map(e=>fe[r.get(e)]);i.length&&(ge.push(t),_e.push(i.length),ve.push(...i));for(let e of a)ye.push(t),be.push(e)}let xe=(e.postfixLookupClassGroups??[]).map(e=>fe[r.get(e)]),Se=[],Ce=new Int32Array(w.length);for(let e=0;e<w.length;e++){let n=t.names[w[e]],r=RD[n];if(r!==void 0)Ce[e]=r;else{let t=Se.indexOf(n);t===-1&&(t=Se.length,Se.push(n)),Ce[e]=zD+t}}let we=new Map,Te=[],Ee=[],De=[];{let e=0;for(let t of d){let n=[];for(let r=0;r<t.length;r++)n.push(Ce[e++]);let r=n.join(`,`),i=we.get(r);i===void 0&&(i=Te.length,we.set(r,i),Te.push(n.length),Ee.push(...n)),De.push(i)}}let Oe={};for(let e of Se)Oe[e]=t.classifierFns.get(e);return{G:de,customNames:Se,impls:Oe,edgeCounts:re,edgeLabelLen:ie,labelText:x,edgeTargetActual:oe,nodeGroup:S,nodeVlist:ae,nodeCount:te,totalEdges:ne,patCounts:Te,patOps:Ee,listPat:De,vlistGroup:se,litEntries:h,sets:le,attachments:ce,uniqueTailCount:ue,adjGid:ge,adjCnt:_e,adjTgt:ve,patGid:ye,patTgt:be,postfixLookup:xe,orderSensitiveModifiers:e.orderSensitiveModifiers.join(` `),prefix:e.prefix}},qD=e=>{let t=new Int32Array(e.length+1);for(let n=0;n<e.length;n++)t[n+1]=t[n]+e[n];return t},JD=e=>{let t=KD(e),n=t.litEntries.length,r=new Int32Array(n),i=new Int32Array(n),a=new Int32Array(n),o=``,s=new Int32Array(t.uniqueTailCount*2);{let e=new Map,n=0,c=0;for(let l of t.attachments)for(let u of t.sets[l.set]){let t=e.get(u);t===void 0&&(t=n++,e.set(u,t),s[t*2]=o.length,s[t*2+1]=u.length,o+=u),r[c]=l.anchor,i[c]=l.gid,a[c]=t,c++}}return{tables:{GROUP_COUNT:t.G,edgeStart:qD(t.edgeCounts),labelStart:qD(t.edgeLabelLen),labelText:t.labelText,edgeTarget:Int32Array.from(t.edgeTargetActual),nodeGroup:t.nodeGroup,nodeVlist:t.nodeVlist,vlistPat:qD(t.patCounts),vlistOps:Int32Array.from(t.patOps),vlistRef:Int32Array.from(t.listPat),vlistGroup:t.vlistGroup,litAnchor:r,litGroup:i,litPool:a,poolOffsets:s,poolText:o,adjGid:Int32Array.from(t.adjGid),adjStart:qD(t.adjCnt),adjTgt:Int32Array.from(t.adjTgt),patGid:Int32Array.from(t.patGid),patTgt:Int32Array.from(t.patTgt),postfixLookupGroups:Int32Array.from(t.postfixLookup),customValidatorNames:t.customNames,orderSensitiveModifiers:t.orderSensitiveModifiers},validatorImpls:t.impls,prefix:t.prefix}},YD=`line`in Error(),XD=-1,ZD=-1,QD=(e,t,n)=>{let r=2166136261;for(let i=t;i<n;i++)r=Math.imul(r^e.charCodeAt(i),16777619);return r},$D=(e,t,n)=>{let r=n-t,i=Math.imul(r,2654435761)^e.charCodeAt(t);if(r>3){let a=r>>2,o=r>>1;i=Math.imul(i^e.charCodeAt(t+1)<<8^e.charCodeAt(t+2)<<16^e.charCodeAt(t+a),2246822507),i=Math.imul(i^e.charCodeAt(t+o)<<8^e.charCodeAt(t+o+a)<<16^e.charCodeAt(n-3),3266489909),i^=e.charCodeAt(n-2)<<8^e.charCodeAt(n-1)<<16;for(let r=t+3,a=n-4;r<t+8&&r<a;r++,a--)i=Math.imul(i^e.charCodeAt(r)^e.charCodeAt(a)<<8,16777619)}return i^i>>>15|0},eO=(e,t,n={})=>{let{GROUP_COUNT:r,edgeStart:i,labelStart:a,labelText:o,edgeTarget:s,nodeGroup:c,nodeVlist:l,vlistPat:u,vlistOps:d,vlistRef:f,vlistGroup:p,litAnchor:m,litGroup:h,litPool:g,poolOffsets:_,poolText:v,adjGid:y,adjStart:b,adjTgt:ee,patGid:te,patTgt:ne,postfixLookupGroups:re,customValidatorNames:ie,orderSensitiveModifiers:x}=e,S=new Int32Array(r).fill(-1);for(let e=0;e<y.length;e++)S[y[e]]=e;let ae=0;for(let e=0;e+1<b.length;e++){let t=b[e+1]-b[e];t>ae&&(ae=t)}let oe=32;for(;oe<2*(1+ae+te.length);)oe<<=1;let C=new Int32Array(f.length+1);for(let e=0;e<f.length;e++)C[e+1]=C[e]+u[f[e]+1]-u[f[e]];let w=new Uint8Array(r);for(let e=0;e<re.length;e++)w[re[e]]=1;let se=i.length-1,ce=new Uint8Array(se),T=0,le=!0;for(let e=0;e<m.length;e++){ce[m[e]]=1;let t=_[g[e]*2+1];t>T&&(T=t);let n=v.charCodeAt(_[g[e]*2]);(n===91||n===40)&&(le=!1)}let ue=1;for(;ue<m.length*2;)ue<<=1;let de=new Int32Array(ue).fill(-1);for(let e=0;e<m.length;e++){let t=_[g[e]*2],n=(QD(v,t,t+_[g[e]*2+1])^Math.imul(m[e],2654435761)|0)&ue-1;for(;de[n]!==-1;)n=n+1&ue-1;de[n]=e}let fe=(e,t,n,r)=>{let i=(QD(t,n,r)^Math.imul(e,2654435761)|0)&ue-1,a=r-n;for(;;){let r=de[i];if(r===-1)return-1;if(m[r]===e&&_[g[r]*2+1]===a){let e=_[g[r]*2],i=!0;for(let r=0;r<a;r++)if(v.charCodeAt(e+r)!==t.charCodeAt(n+r)){i=!1;break}if(i)return h[r]}i=i+1&ue-1}},pe=n.cacheSize??8192,me=n.prefix??e.prefix??``,he=me===``?``:me+`:`,ge=he.length,_e=(ie??[]).map(e=>{let n=t&&t[e];if(!n)throw Error(`cn: missing validator `+e);return n}),ve=/\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$/,ye=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,be=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,xe=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Se=0,Ce=-1,we=-1,Te=-1,Ee=-1,De=e=>e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57||e===95,Oe=e=>/\s/.test(String.fromCharCode(e)),ke=(e,t,n)=>{if(Se=0,Ce=-1,n-t<3)return;let r=e.charCodeAt(t),i=e.charCodeAt(n-1);if(r===91&&i===93)Se=1;else if(r===40&&i===41)Se=2;else return;Te=t+1,Ee=n-1;let a=t+1;if(De(e.charCodeAt(a))){for(a++;a<n-1;){let t=e.charCodeAt(a);if(!De(t)&&t!==45)break;a++}a<n-2&&e.charCodeAt(a)===58&&(Ce=t+1,we=a,Te=a+1)}},Ae=(e,t,n,r)=>{if(n-t!==r.length)return!1;for(let n=0;n<r.length;n++)if(e.charCodeAt(t+n)!==r.charCodeAt(n))return!1;return!0},je=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Me=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ne=e=>!!e&&!Number.isNaN(Number(e)),Pe=(e,t,n)=>{if(n-t<11||!Ae(e,t,t+10,`@container`))return!1;if(e.charCodeAt(t+10)===47)return n-t>=12;let r=e.charCodeAt(t+11);return r===115&&n-t>=17&&Ae(e,t+10,t+16,`-size/`)||r===110&&n-t>=19&&Ae(e,t+10,t+18,`-normal/`)},Fe=[1,1,1,1,1,1,1,1,2,2,2,2,2,2,2],Ie=`length|number|number weight|family-name|position percentage|length size bg-size|image url|shadow|length|family-name|position percentage|length size bg-size|image url|shadow|number weight`.split(`|`).map(e=>e.split(` `)),Le=[2,3,1,0,0,0,4,5,0,0,0,0,0,1,1],Re=(e,t,n,r)=>{if(e>=10){if(e>=25)return _e[e-25](t.slice(n,r));let i=e-10;if(Se!==Fe[i])return!1;if(Ce>=0){for(let e of Ie[i])if(Ae(t,Ce,we,e))return!0;return!1}switch(Le[i]){case 0:return!1;case 1:return!0;case 2:{let e=t.slice(Te,Ee);return ve.test(e)&&!ye.test(e)}case 3:return Ne(t.slice(Te,Ee));case 4:return xe.test(t.slice(Te,Ee));default:return be.test(t.slice(Te,Ee))}}switch(e){case 0:return!0;case 1:return Se===0;case 2:return Se===1;case 3:return Se===2;case 4:return je.test(t.slice(n,r));case 5:return Ne(t.slice(n,r));case 6:{let e=t.slice(n,r);return!!e&&Number.isInteger(Number(e))}case 7:return r>n&&t.charCodeAt(r-1)===37&&Ne(t.slice(n,r-1));case 8:return Me.test(t.slice(n,r));default:return Pe(t,n,r)}},ze=new Set(typeof x==`string`?x.split(` `):x),Be=(e,t,n,r,i,a)=>{let o=QD(t,n,r)^(i?2654435769:0)|0,s=e.get(o);if(s!==void 0)outer:for(let e=0;e<s.length;e++){let a=s[e];if(a.imp===i&&a.k.length===r-n){for(let e=0;e<a.k.length;e++)if(a.k.charCodeAt(e)!==t.charCodeAt(n+e))continue outer;return a.id}}else e.set(o,s=[]);let c=t.slice(n,r),l=a(c);return s.push({k:c,imp:i,id:l}),l},Ve=new Map,He=new Map,Ue=2,We=4096,Ge=(e,t)=>{let n=[],r=0,i=0,a=0;for(let t=0;t<e.length;t++){let o=e.charCodeAt(t);r===0&&i===0&&o===58?(n.push(e.slice(a,t)),a=t+1):o===91?r++:o===93?r--:o===40?i++:o===41&&i--}n.push(e.slice(a));let o=n[0];if(n.length>1){let e=[],t=[];for(let r of n)r.charCodeAt(0)===91||ze.has(r)?(t.length&&(e.push(...t.sort()),t=[]),e.push(r)):t.push(r);t.length&&e.push(...t.sort()),o=e.join(`:`)}let s=t?o+` !`:o,c=He.get(s);return c===void 0&&He.set(s,c=Ue++),c},Ke=new Map,qe=r,Je=r+4096,Ye=()=>qe++,Xe=2097152,Ze=8192,Qe=new Int32Array(Ze),$e=Array(Ze).fill(null),et=new Int32Array(Ze),tt=new Int32Array(Ze),nt=new Uint8Array(Ze),rt=0,it=(e,t,n,r,i,a,o,s)=>{let c=e;if($e[e]!==null){if($e[e|1]===null)c=e|1;else if(!(rt++&3))c=e|rt>>2&1;else return}$e[c]=t.slice(n,r),Qe[c]=i,et[c]=a,tt[c]=o,nt[c]=s},at=()=>$e.fill(null),ot=256,st=[new Int32Array(ot),new Int32Array(ot),new Int32Array(ot),new Int32Array(ot)],[ct,lt,ut,dt]=st,ft=new Uint8Array(ot),pt=new Uint8Array(ot),mt=()=>{ot*=2,st=st.map(e=>{let t=new Int32Array(ot);return t.set(e),t}),[ct,lt,ut,dt]=st;let e=new Uint8Array(ot);e.set(ft),ft=e,pt=new Uint8Array(ot)},ht=64,gt=new Int32Array(ht),_t=new Int32Array(ht),vt=new Int32Array(r),yt=2048,bt=21,xt=new Float64Array(yt),St=new Int32Array(yt),Ct=0,wt=(e,t)=>{if(e===0&&t<r)return vt[t]===Ct?1:(vt[t]=Ct,0);let n=e*2097152+t+1,i=Math.imul(n,2654435761)>>>bt;for(;St[i]===Ct;){if(xt[i]===n)return 1;i=i+1&yt-1}return xt[i]=n,St[i]=Ct,0},Tt=(e,t,n,r,i)=>{if(n-t>=2&&e.charCodeAt(t)===91&&e.charCodeAt(n-1)===93){let r=-1;for(let i=t+1;i<n-1;i++)if(e.charCodeAt(i)===58){r=i;break}return r===-1||r===t+1?XD:Be(Ke,e,t+1,r,0,Ye)}if(r>=0&&c[r]>=0)return c[r];for(let t=i-1;t>=0;t--){let r=_t[t];if(r>n)continue;let i=gt[t],a=n-r;if(ce[i]===1&&a>0&&a<=T){let t=e.charCodeAt(r);if(le===!1||t!==91&&t!==40){let t=fe(i,e,r,n);if(t>=0)return t}}let o=l[i];if(o<0)continue;let s=f[o],c=u[s],m=u[s+1];if(c===m)continue;ke(e,r,n);let h=C[o]-c;for(let t=c;t<m;t++)if(Re(d[t],e,r,n))return p[h+t]}return XD},Et=e=>{let t=e.length,n=0,c=0,u=!1;(Ue>We||Ve.size>We)&&(Ve=new Map,He=new Map,Ue=2,at()),qe>Je&&(Ke=new Map,qe=r,at());let d=0;for(;d<t;){let f=e.charCodeAt(d);if(f===32||f>=9&&f<=13||f>=160&&Oe(f)){f!==32&&(u=!0),d++;continue}let p=d,m=0;for(;d<t;){if(f=e.charCodeAt(d),f<=32){if(f===32)break;if(f>=9&&f<=13){u=!0;break}}else if(f>=160&&Oe(f)){u=!0;break}m=Math.imul(m^f,16777619),d++}let h=d,g=h-p;n===ot&&mt();let _=n++;ct[_]=p,lt[_]=h,c+=g,m^=Math.imul(g,2654435761);let v=m^m>>>15|0,y=v&8190;{let t=-1;if(Qe[y]===v&&$e[y]!==null&&$e[y].length===g?t=y:Qe[y|1]===v&&$e[y|1]!==null&&$e[y|1].length===g&&(t=y|1),t>=0){let n=$e[t],r=!0;for(let t=0;t<g;t++)if(n.charCodeAt(t)!==e.charCodeAt(p+t)){r=!1;break}if(r){ut[_]=et[t],dt[_]=tt[t],ft[_]=nt[t];continue}}}let b=p;if(ge!==0){if(h-p<=ge||!e.startsWith(he,p)){ut[_]=XD,it(y,e,p,h,v,XD,0,0);continue}b=p+ge}let ee=0,te=0,ne=-1,re=-1;for(let t=b;t<h;t++){let n=e.charCodeAt(t);if(ee===0&&te===0){if(n===58){ne=t;continue}if(n===47){re=t;continue}}n===91?ee++:n===93?ee--:n===40?te++:n===41&&te--}let ie=ne>=b?ne+1:b,x=ie,S=h,ae=!1,oe=0;S>x&&e.charCodeAt(S-1)===33?(ae=!0,S--):S>x&&e.charCodeAt(x)===33&&(ae=!0,x++,oe=1);let C=-1;re>ie&&(C=re+oe,C>=S&&(C=-1));let se=x;S-x>1&&e.charCodeAt(x)===45&&(se=x+1);let T=0,le=0,ue=0,de=-1,fe=0;(l[0]>=0||ce[0]===1)&&(gt[0]=0,_t[0]=se,fe=1);let pe=ZD,me=0;for(let t=se;t<S;t++)if(t===C&&(pe=le<ue?ZD:T,me=fe),T!==ZD){let n=e.charCodeAt(t),r=-1;if(le<ue)o.charCodeAt(le)===n?(le++,le===ue&&(r=T=de)):T=ZD;else{let e=i[T],t=i[T+1],c=ZD;for(let i=e;i<t;i++){let e=a[i];if(o.charCodeAt(e)===n){a[i+1]-e===1?r=c=s[i]:(le=e+1,ue=a[i+1],de=s[i],c=T);break}}T=c}if(r>=0&&(l[r]>=0||ce[r]===1)&&t+1<S&&e.charCodeAt(t+1)===45){if(fe===ht){ht*=2;let e=new Int32Array(ht);e.set(gt),gt=e;let t=new Int32Array(ht);t.set(_t),_t=t}gt[fe]=r,_t[fe]=t+2,fe++}}C===S&&(pe=le<ue?ZD:T,me=fe);let _e=le<ue?ZD:T,ve,ye=!1;if(C>=0){if(ye=!0,ve=Tt(e,x,C,pe,me),ve!==XD&&ve<r&&w[ve]){let t=Tt(e,x,S,_e,fe);t!==XD&&t!==ve&&(ve=t,ye=!1)}else ve===XD&&(ve=Tt(e,x,S,_e,fe),ye=!1)}else ve=Tt(e,x,S,_e,fe);let be=0,xe=0;ve===XD?ut[_]=XD:(xe=+!!ye,be=b>=ne?+!!ae:Be(Ve,e,b,ne,+!!ae,e=>Ge(e,ae)),ut[_]=ve,ft[_]=xe,dt[_]=be),it(y,e,p,h,v,ve,be,xe)}if(n===0)return``;if(n===1)return ct[0]===0&&lt[0]===t?e:e.slice(ct[0],lt[0]);if(n*oe>yt){for(;n*oe>yt;)yt<<=1,bt--;xt=new Float64Array(yt),St=new Int32Array(yt)}if(Ue>=Xe||qe>=Xe)throw Error(`cn: too many distinct classes in one merge`);Ct=Ct+1|0,Ct===0&&(vt.fill(0),St.fill(0),Ct=1);let f=!1;for(let e=n-1;e>=0;e--){let t=ut[e];if(t===XD){pt[e]=1;continue}let n=dt[e];if(wt(n,t)===1){pt[e]=0,f=!0;continue}if(pt[e]=1,t<r){let r=S[t];if(r>=0)for(let e=b[r];e<b[r+1];e++)wt(n,ee[e]);if(ft[e]&1)for(let e=0;e<te.length;e++)te[e]===t&&wt(n,ne[e])}}if(!f&&!u&&t===c+n-1)return e;let p=``,m=0;for(;m<n;){if(!pt[m]){m++;continue}let t=ct[m],r=lt[m],i=m+1;for(;i<n&&pt[i]&&ct[i]===r+1&&e.charCodeAt(r)===32;)r=lt[i],i++;p.length>0&&(p+=` `),p+=e.slice(t,r),m=i}return p},Dt=16384,Ot=new Int32Array(Dt*2),kt=0,At=1,jt=Object.create(null),Mt=Object.create(null),Nt=new Map,Pt=new Map,Ft=0,It=0,Lt=()=>{kt^=Dt,At=At+1|0,It=0},Rt=e=>{let t=jt[e];if(t!==void 0)return t;let n=$D(e,0,e.length),r=(n&16383)+kt,i=Ot[r]===(n^At)||Ot[r^Dt]===(n^At-1);return i&&(t=Mt[e],t!==void 0)?(jt[e]=t,t):(t=Et(e),i?(jt[e]=t,++Ft>pe&&(Ft=0,Mt=jt,jt=Object.create(null),Lt())):(Ot[r]=n^At,++It>Dt&&Lt()),t)},zt=e=>{let t=Nt.get(e);if(t!==void 0)return t;let n=$D(e,0,e.length),r=(n&16383)+kt,i=Ot[r]===(n^At)||Ot[r^Dt]===(n^At-1);return i&&(t=Pt.get(e),t!==void 0)?(Nt.set(e,t),t):(t=Et(e),i?(Nt.set(e,t),++Ft>pe&&(Ft=0,Pt=Nt,Nt=new Map,Lt())):(Ot[r]=n^At,++It>Dt&&Lt()),t)},E=e=>{let t=$D(e,0,e.length),n=(t&16383)+kt;return Ot[n]===(t^At)||Ot[n^Dt]===(t^At-1)||(Ot[n]=t^At,++It>Dt&&Lt(),!1)},Bt=pe===0?Et:YD?e=>{let t=Nt.get(e);return t===void 0?zt(e):t}:Rt;return{merge:function(){return arguments.length===1&&typeof arguments[0]==`string`?Bt(arguments[0]):Bt(rO.apply(null,arguments))},mergeString:Bt,seenBefore:pe===0?()=>!1:E,mergeUncached:Et}},tO=(e,t)=>{if(!e)return``;if(typeof e==`string`)return e;let n=``;if(typeof e.length==`number`&&(!t||Array.isArray(e))){let r=e;for(let e=0;e<r.length;e++){let i=r[e];if(!i)continue;let a=typeof i==`string`?i:tO(i,t);a&&(n&&(n+=` `),n+=a)}return n}if(t){if(typeof e==`number`)return``+e;if(typeof e==`object`)for(let t in e)e[t]&&(n&&(n+=` `),n+=t)}return n},nO=(e,t)=>{let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(!i)continue;let a=typeof i==`string`?i:tO(i,t);a&&(n&&(n+=` `),n+=a)}return n},rO=function(){return nO(arguments,!1)},iO=(e,t)=>{let n=t===void 0?()=>!0:t.seenBefore,r=t===void 0?e:t.mergeUncached,i=new Map,a=new Map,o=0,s=null,c=(e,t,n,r)=>{let i=0;if(t){if(t!==e.a0)return!1;i=1}if(n){if(n!==(i===0?e.a0:e.a1))return!1;i++}if(r){if(r!==(i===0?e.a0:i===1?e.a1:e.a2))return!1;i++}return i===e.t},l=(e,t)=>{let n=e.a,r=0;for(let e=0;e<t.length;e++){let i=t[e];if(i){if(i!==n[r])return!1;r++}}return r===e.t},u=(t,c)=>{let u=t.length,d=s===null?null:s.n;if(!c){if(d!==null&&l(d,t))return s=d,d.r;if(s!==null&&s!==d&&l(s,t))return s.r}let f=``,p=-1,m=0,h=!1;for(let e=0;e<u;e++){let n=t[e];if(n){if(typeof n!=`string`){if(n=t[e]=tO(n,!0),!n)continue;h=!0}p<0&&(f=n,p=e),m++}}if(m===0)return``;if(m===1)return e(f);if(h){if(d!==null&&l(d,t))return s=d,d.r;if(s!==null&&s!==d&&l(s,t))return s.r}let g=i.get(f);g===void 0&&(g=a.get(f),g!==void 0&&i.set(f,g));let _=null;if(g!==void 0)outer:for(let e=0;e<g.length;e++){let n=g[e];if(n.t!==m)continue;let r=n.a,i=1;for(let e=p+1;e<u;e++){let n=t[e];if(n&&n!==r[i++])continue outer}_=n;break}if(_===null){let s=f,c=[f];for(let e=p+1;e<u;e++){let n=t[e];n&&(s+=` `+n,c.push(n))}if(!n(s))return r(s);_={r:e(s),t:c.length,a0:c[0],a1:c[1],a2:c[2]??``,a:c,n:null},g===void 0&&i.set(f,g=[]),g.length>=256&&g.shift(),g.push(_),++o>1e3&&(o=0,a=i,i=new Map)}return s!==null&&s!==_&&(s.n=_),s=_,_.r},d=t=>Array.isArray(t)?u(t.slice(),!1):e(tO(t,!0));return function(t,n,r){let i=arguments.length;if((i|1)==3){let e=s;if(e!==null){let i=e.n;if(i!==null&&c(i,t,n,r))return s=i,i.r;if(e!==i&&c(e,t,n,r))return e.r}return u([t,n,r],!0)}if(i===1)return typeof t==`string`?e(t):d(t);let a=s;if(a!==null){let e=a.n;if(e!==null){let t=e.a,n=0,r=!0;for(let e=0;e<i;e++){let i=arguments[e];if(i){if(i!==t[n]){r=!1;break}n++}}if(r&&n===e.t)return s=e,e.r}if(a!==e){let e=a.a,t=0,n=!0;for(let r=0;r<i;r++){let i=arguments[r];if(i){if(i!==e[t]){n=!1;break}t++}}if(n&&t===a.t)return a.r}}let o=[];for(let e=0;e<i;e++)o.push(arguments[e]);return u(o,!0)}},aO=`{"theme":{"animate":[{"$v":"isAny"}],"aspect":["video"],"blur":[{"$v":"isTshirtSize"}],"breakpoint":[{"$v":"isTshirtSize"}],"color":[{"$v":"isAny"}],"container":[{"$v":"isTshirtSize"}],"drop-shadow":[{"$v":"isTshirtSize"}],"ease":["in","out","in-out"],"font":[{"$v":"isAnyNonArbitrary"}],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[{"$v":"isTshirtSize"}],"leading":["none","tight","snug","normal","relaxed","loose"],"perspective":["dramatic","near","normal","midrange","distant","none"],"radius":[{"$v":"isTshirtSize"}],"shadow":[{"$v":"isTshirtSize"}],"spacing":["px",{"$v":"isNumber"}],"text":[{"$v":"isTshirtSize"}],"text-shadow":[{"$v":"isTshirtSize"}],"tracking":["tighter","tight","normal","wide","wider","widest"]},"classGroups":{"aspect":[{"aspect":["auto","square",{"$v":"isFraction"},{"$v":"isArbitraryValue"},{"$v":"isArbitraryVariable"},{"$t":"aspect"}]}],"container":["container"],"container-type":[{"@container":["","normal","size",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"container-named":[{"$v":"isNamedContainerQuery"}],"columns":[{"columns":[{"$v":"isNumber"},{"$v":"isArbitraryValue"},{"$v":"isArbitraryVariable"},{"$t":"container"}]},"columns-auto"],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"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":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"overflow":[{"overflow":["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],"overscroll":[{"overscroll":["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],"position":["static","fixed","absolute","relative","sticky"],"inset":[{"inset":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"inset-x":[{"inset-x":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"inset-y":[{"inset-y":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"start":[{"inset-s":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}],"start":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"end":[{"inset-e":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}],"end":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"inset-bs":[{"inset-bs":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"inset-be":[{"inset-be":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"top":[{"top":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"right":[{"right":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"bottom":[{"bottom":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"left":[{"left":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"visibility":["visible","invisible","collapse"],"z":[{"z":[{"$v":"isInteger"},"auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"basis":[{"basis":[{"$v":"isFraction"},"full","auto",{"$t":"container"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"flex-direction":[{"flex":["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{"flex":["nowrap","wrap","wrap-reverse"]}],"flex":[{"flex":[{"$v":"isNumber"},{"$v":"isFraction"},"auto","initial","none",{"$v":"isArbitraryValue"}]}],"grow":[{"grow":["",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"shrink":[{"shrink":["",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"order":[{"order":[{"$v":"isInteger"},"first","last","none",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"grid-cols":[{"grid-cols":[{"$v":"isInteger"},"none","subgrid",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"col-start-end":[{"col":["auto",{"span":["full",{"$v":"isInteger"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]},{"$v":"isInteger"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"col-start":[{"col-start":[{"$v":"isInteger"},"auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"col-end":[{"col-end":[{"$v":"isInteger"},"auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"grid-rows":[{"grid-rows":[{"$v":"isInteger"},"none","subgrid",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"row-start-end":[{"row":["auto",{"span":["full",{"$v":"isInteger"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]},{"$v":"isInteger"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"row-start":[{"row-start":[{"$v":"isInteger"},"auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"row-end":[{"row-end":[{"$v":"isInteger"},"auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]},{"auto-cols":[{"$t":"spacing"}]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]},{"auto-rows":[{"$t":"spacing"}]}],"gap":[{"gap":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"gap-x":[{"gap-x":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"gap-y":[{"gap-y":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"justify-content":[{"justify":["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe","normal"]}],"justify-items":[{"justify-items":["start","end","center","stretch","center-safe","end-safe","normal"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],"align-content":[{"content":["normal","start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"align-items":[{"items":["start","end","center","stretch","center-safe","end-safe",{"baseline":["","last"]}]}],"align-self":[{"self":["auto","start","end","center","stretch","center-safe","end-safe",{"baseline":["","last"]}]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"place-items":[{"place-items":["start","end","center","stretch","center-safe","end-safe","baseline"]}],"place-self":[{"place-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],"p":[{"p":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"px":[{"px":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"py":[{"py":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"ps":[{"ps":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"pe":[{"pe":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"pbs":[{"pbs":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"pbe":[{"pbe":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"pt":[{"pt":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"pr":[{"pr":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"pb":[{"pb":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"pl":[{"pl":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"m":[{"m":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"mx":[{"mx":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"my":[{"my":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"ms":[{"ms":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"me":[{"me":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"mbs":[{"mbs":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"mbe":[{"mbe":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"mt":[{"mt":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"mr":[{"mr":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"mb":[{"mb":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"ml":[{"ml":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"space-x":[{"space-x":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"space-y-reverse":["space-y-reverse"],"size":[{"size":[{"$v":"isFraction"},"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"inline-size":[{"inline":["auto",{"$v":"isFraction"},"screen","full","dvw","lvw","svw","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]},{"inline":[{"$t":"container"}]}],"min-inline-size":[{"min-inline":["auto",{"$v":"isFraction"},"screen","full","dvw","lvw","svw","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]},{"min-inline":[{"$t":"container"}]}],"max-inline-size":[{"max-inline":["none",{"$v":"isFraction"},"screen","full","dvw","lvw","svw","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]},{"max-inline":[{"$t":"container"}]}],"block-size":[{"block":["auto",{"$v":"isFraction"},"screen","full","lh","dvh","lvh","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"min-block-size":[{"min-block":["auto",{"$v":"isFraction"},"screen","full","lh","dvh","lvh","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"max-block-size":[{"max-block":["none",{"$v":"isFraction"},"screen","full","lh","dvh","lvh","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"w":[{"w":[{"$t":"container"},"screen",{"$v":"isFraction"},"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"min-w":[{"min-w":[{"$t":"container"},"screen","none",{"$v":"isFraction"},"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"max-w":[{"max-w":[{"$t":"container"},"screen","none","prose",{"screen":[{"$t":"breakpoint"}]},{"$v":"isFraction"},"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"h":[{"h":["screen","lh",{"$v":"isFraction"},"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"min-h":[{"min-h":["screen","lh","none",{"$v":"isFraction"},"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"max-h":[{"max-h":["screen","lh",{"$v":"isFraction"},"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]},"max-h-none"],"font-size":[{"text":["base",{"$t":"text"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{"font":[{"$t":"font-weight"},{"$v":"isArbitraryVariableWeight"},{"$v":"isArbitraryWeight"}]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",{"$v":"isPercent"},{"$v":"isArbitraryValue"}]}],"font-family":[{"font":[{"$v":"isArbitraryVariableFamilyName"},{"$v":"isArbitraryFamilyName"},{"$t":"font"}]}],"font-features":[{"font-features":[{"$v":"isArbitraryValue"}]}],"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":[{"$t":"tracking"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"line-clamp":[{"line-clamp":[{"$v":"isNumber"},"none",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryNumber"}]}],"leading":[{"leading":[{"$t":"leading"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"list-image":[{"list-image":["none",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"list-style-position":[{"list":["inside","outside"]}],"list-style-type":[{"list":["disc","decimal","none",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"text-alignment":[{"text":["left","center","right","justify","start","end"]}],"placeholder-color":[{"placeholder":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"text-color":[{"text":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{"decoration":["solid","dashed","dotted","double","wavy"]}],"text-decoration-thickness":[{"decoration":[{"$v":"isNumber"},"from-font","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryLength"}]}],"text-decoration-color":[{"decoration":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"underline-offset":[{"underline-offset":[{"$v":"isNumber"},"auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{"text":["wrap","nowrap","balance","pretty"]}],"indent":[{"indent":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"tab-size":[{"tab":[{"$v":"isInteger"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"vertical-align":[{"align":["baseline","top","middle","bottom","text-top","text-bottom","sub","super",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"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",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"bg-attachment":[{"bg":["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{"bg":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"},{"position":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}]}],"bg-repeat":[{"bg":["no-repeat",{"repeat":["","x","y","space","round"]}]}],"bg-size":[{"bg":["auto","cover","contain",{"$v":"isArbitraryVariableSize"},{"$v":"isArbitrarySize"},{"size":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}]}],"bg-image":[{"bg":["none",{"linear":[{"to":["t","tr","r","br","b","bl","l","tl"]},{"$v":"isInteger"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}],"radial":["",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}],"conic":[{"$v":"isInteger"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]},{"$v":"isArbitraryVariableImage"},{"$v":"isArbitraryImage"}]},{"bg-gradient-to":["t","tr","r","br","b","bl","l","tl"]},"bg-conic"],"bg-color":[{"bg":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"gradient-from-pos":[{"from":[{"$v":"isPercent"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"gradient-via-pos":[{"via":[{"$v":"isPercent"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"gradient-to-pos":[{"to":[{"$v":"isPercent"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"gradient-from":[{"from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"gradient-via":[{"via":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"gradient-to":[{"to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded":[{"rounded":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-s":[{"rounded-s":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-e":[{"rounded-e":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-t":[{"rounded-t":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-r":[{"rounded-r":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-b":[{"rounded-b":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-l":[{"rounded-l":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-ss":[{"rounded-ss":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-se":[{"rounded-se":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-ee":[{"rounded-ee":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-es":[{"rounded-es":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-tl":[{"rounded-tl":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-tr":[{"rounded-tr":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-br":[{"rounded-br":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-bl":[{"rounded-bl":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-w":[{"border":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-x":[{"border-x":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-y":[{"border-y":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-s":[{"border-s":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-e":[{"border-e":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-bs":[{"border-bs":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-be":[{"border-be":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-t":[{"border-t":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-r":[{"border-r":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-b":[{"border-b":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-l":[{"border-l":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"divide-x":[{"divide-x":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{"border":["solid","dashed","dotted","double","hidden","none"]}],"divide-style":[{"divide":["solid","dashed","dotted","double","hidden","none"]}],"border-color":[{"border":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-x":[{"border-x":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-y":[{"border-y":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-s":[{"border-s":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-e":[{"border-e":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-bs":[{"border-bs":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-be":[{"border-be":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-t":[{"border-t":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-r":[{"border-r":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-b":[{"border-b":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-l":[{"border-l":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"divide-color":[{"divide":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"outline-style":[{"outline":["solid","dashed","dotted","double","none","hidden"]}],"outline-offset":[{"outline-offset":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"outline-w":[{"outline":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"outline-color":[{"outline":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"shadow":[{"shadow":["","none",{"$t":"shadow"},{"$v":"isArbitraryVariableShadow"},{"$v":"isArbitraryShadow"}]},"shadow-inner"],"shadow-color":[{"shadow":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"inset-shadow":[{"inset-shadow":["none",{"$t":"inset-shadow"},{"$v":"isArbitraryVariableShadow"},{"$v":"isArbitraryShadow"}]}],"inset-shadow-color":[{"inset-shadow":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"ring-w":[{"ring":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"ring-w-inset":["ring-inset"],"ring-color":[{"ring":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"ring-offset-w":[{"ring-offset":[{"$v":"isNumber"},{"$v":"isArbitraryLength"}]}],"ring-offset-color":[{"ring-offset":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"inset-ring-w":[{"inset-ring":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"inset-ring-color":[{"inset-ring":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"text-shadow":[{"text-shadow":["none",{"$t":"text-shadow"},{"$v":"isArbitraryVariableShadow"},{"$v":"isArbitraryShadow"}]}],"text-shadow-color":[{"text-shadow":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"opacity":[{"opacity":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],"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":[{"$v":"isNumber"}]}],"mask-image-linear-from-pos":[{"mask-linear-from":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-linear-to-pos":[{"mask-linear-to":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-linear-from-color":[{"mask-linear-from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-linear-to-color":[{"mask-linear-to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-t-from-pos":[{"mask-t-from":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-t-to-pos":[{"mask-t-to":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-t-from-color":[{"mask-t-from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-t-to-color":[{"mask-t-to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-r-from-pos":[{"mask-r-from":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-r-to-pos":[{"mask-r-to":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-r-from-color":[{"mask-r-from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-r-to-color":[{"mask-r-to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-b-from-pos":[{"mask-b-from":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-b-to-pos":[{"mask-b-to":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-b-from-color":[{"mask-b-from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-b-to-color":[{"mask-b-to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-l-from-pos":[{"mask-l-from":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-l-to-pos":[{"mask-l-to":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-l-from-color":[{"mask-l-from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-l-to-color":[{"mask-l-to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-x-from-pos":[{"mask-x-from":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-x-to-pos":[{"mask-x-to":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-x-from-color":[{"mask-x-from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-x-to-color":[{"mask-x-to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-y-from-pos":[{"mask-y-from":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-y-to-pos":[{"mask-y-to":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-y-from-color":[{"mask-y-from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-y-to-color":[{"mask-y-to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-radial":[{"mask-radial":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-radial-from-pos":[{"mask-radial-from":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-radial-to-pos":[{"mask-radial-to":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-radial-from-color":[{"mask-radial-from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-radial-to-color":[{"mask-radial-to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"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":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"]}],"mask-image-conic-pos":[{"mask-conic":[{"$v":"isNumber"}]}],"mask-image-conic-from-pos":[{"mask-conic-from":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-conic-to-pos":[{"mask-conic-to":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-conic-from-color":[{"mask-conic-from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-conic-to-color":[{"mask-conic-to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-mode":[{"mask":["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{"mask":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"},{"position":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}]}],"mask-repeat":[{"mask":["no-repeat",{"repeat":["","x","y","space","round"]}]}],"mask-size":[{"mask":["auto","cover","contain",{"$v":"isArbitraryVariableSize"},{"$v":"isArbitrarySize"},{"size":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}]}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{"mask":["none",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"filter":[{"filter":["","none",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"blur":[{"blur":["","none",{"$t":"blur"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"brightness":[{"brightness":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"contrast":[{"contrast":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"drop-shadow":[{"drop-shadow":["","none",{"$t":"drop-shadow"},{"$v":"isArbitraryVariableShadow"},{"$v":"isArbitraryShadow"}]}],"drop-shadow-color":[{"drop-shadow":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"grayscale":[{"grayscale":["",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"hue-rotate":[{"hue-rotate":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"invert":[{"invert":["",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"saturate":[{"saturate":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"sepia":[{"sepia":["",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-filter":[{"backdrop-filter":["","none",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-blur":[{"backdrop-blur":["","none",{"$t":"blur"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-brightness":[{"backdrop-brightness":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-contrast":[{"backdrop-contrast":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-grayscale":[{"backdrop-grayscale":["",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-invert":[{"backdrop-invert":["",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-opacity":[{"backdrop-opacity":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-saturate":[{"backdrop-saturate":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-sepia":[{"backdrop-sepia":["",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-collapse":[{"border":["collapse","separate"]}],"border-spacing":[{"border-spacing":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"border-spacing-x":[{"border-spacing-x":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"border-spacing-y":[{"border-spacing-y":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"table-layout":[{"table":["auto","fixed"]}],"caption":[{"caption":["top","bottom"]}],"transition":[{"transition":["","all","colors","opacity","shadow","transform","none",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"transition-behavior":[{"transition":["normal","discrete"]}],"duration":[{"duration":[{"$v":"isNumber"},"initial",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"ease":[{"ease":["linear","initial",{"$t":"ease"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"delay":[{"delay":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"animate":[{"animate":["none",{"$t":"animate"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backface":[{"backface":["hidden","visible"]}],"perspective":[{"perspective":[{"$t":"perspective"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"perspective-origin":[{"perspective-origin":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rotate":[{"rotate":["none",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rotate-x":[{"rotate-x":["none",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rotate-y":[{"rotate-y":["none",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rotate-z":[{"rotate-z":["none",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"scale":[{"scale":["none",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"scale-x":[{"scale-x":["none",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"scale-y":[{"scale-y":["none",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"scale-z":[{"scale-z":["none",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"scale-3d":["scale-3d"],"skew":[{"skew":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"skew-x":[{"skew-x":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"skew-y":[{"skew-y":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"transform":[{"transform":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},"","none","gpu","cpu"]}],"transform-origin":[{"origin":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"transform-style":[{"transform":["3d","flat"]}],"translate":[{"translate":[{"$v":"isFraction"},"full",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"translate-x":[{"translate-x":[{"$v":"isFraction"},"full",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"translate-y":[{"translate-y":[{"$v":"isFraction"},"full",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"translate-z":[{"translate-z":[{"$v":"isFraction"},"full",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"translate-none":["translate-none"],"zoom":[{"zoom":[{"$v":"isInteger"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"accent":[{"accent":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"appearance":[{"appearance":["none","auto"]}],"caret-color":[{"caret":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"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",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"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":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"scrollbar-track-color":[{"scrollbar-track":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{"scrollbar":["auto","thin","none"]}],"scroll-m":[{"scroll-m":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-mx":[{"scroll-mx":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-my":[{"scroll-my":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-ms":[{"scroll-ms":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-me":[{"scroll-me":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-mbs":[{"scroll-mbs":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-mbe":[{"scroll-mbe":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-mt":[{"scroll-mt":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-mr":[{"scroll-mr":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-mb":[{"scroll-mb":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-ml":[{"scroll-ml":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-p":[{"scroll-p":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-px":[{"scroll-px":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-py":[{"scroll-py":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-ps":[{"scroll-ps":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-pe":[{"scroll-pe":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-pbs":[{"scroll-pbs":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-pbe":[{"scroll-pbe":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-pt":[{"scroll-pt":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-pr":[{"scroll-pr":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-pb":[{"scroll-pb":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-pl":[{"scroll-pl":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"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",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"fill":[{"fill":["none",{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"stroke-w":[{"stroke":[{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"},{"$v":"isArbitraryNumber"}]}],"stroke":[{"stroke":["none",{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}],"contain":[{"contain":["none","content","strict",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"contain-size":[{"contain":["size","inline-size"]}],"contain-layout":["contain-layout"],"contain-paint":["contain-paint"],"contain-style":["contain-style"]},"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":["right","left"],"inset-y":["top","bottom"],"flex":["basis","grow","shrink"],"gap":["gap-x","gap-y"],"p":["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],"px":["pr","pl"],"py":["pt","pb"],"m":["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],"mx":["mr","ml"],"my":["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-r","border-w-l"],"border-w-y":["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-r","border-color-l"],"border-color-y":["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-mr","scroll-ml"],"scroll-my":["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-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],"touch":["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"],"contain":["contain-size","contain-layout","contain-paint","contain-style"],"contain-size":["contain"],"contain-layout":["contain"],"contain-paint":["contain"],"contain-style":["contain"]},"conflictingClassGroupModifiers":{"font-size":["leading"]},"orderSensitiveModifiers":["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"],"postfixLookupClassGroups":["container-type"]}`,oO=()=>JSON.parse(aO),sO=e=>`classGroups`in e&&`theme`in e&&`conflictingClassGroups`in e,cO=e=>e===void 0?{config:oO()}:typeof e==`function`?{config:e(oO())}:sO(e)?{config:e}:{config:LD(oO(),e),cacheSize:e.cacheSize},lO=e=>{let{config:t,cacheSize:n}=cO(e),{tables:r,validatorImpls:i,prefix:a}=JD(t);return eO(r,i,{cacheSize:n,prefix:a})},uO=(e=>{let t=null,n=()=>t??=lO(e);return iO(e=>n().mergeString(e),{seenBefore:e=>n().seenBefore(e),mergeUncached:e=>n().mergeUncached(e)})})({extend:{theme:{spacing:[...NE]}}});function dO(e,t){return typeof e==`function`?e(t):e}function fO(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function pO(...e){return t=>{let n=!1,r=e.map(e=>{let r=fO(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():fO(e[t],null)}}}}function mO(...e){return P.useCallback(pO(...e),e)}function hO(e){let t=P.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];CO(r)&&typeof DO==`function`&&(r=DO(r._payload)),P.Children.forEach(r,e=>{if(xO(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;CO(n)&&typeof DO==`function`&&(n=DO(n._payload)),a=vO(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=P.cloneElement(a,void 0,s):!o&&P.Children.count(r)===1&&P.isValidElement(r)&&(a=r);let c=a?bO(a):void 0,l=mO(n,c);if(!a){if(r||r===0)throw Error(o?EO(e):TO(e));return r}let u=yO(i,a.props??{});return a.type!==P.Fragment&&(u.ref=n?l:c),P.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}var gO=hO(`Slot`),_O=Symbol.for(`radix.slottable`),vO=(e,t)=>{if(`child`in e.props){let t=e.props.child;return P.isValidElement(t)?P.cloneElement(t,void 0,e.props.children(t.props.children)):null}return P.isValidElement(t)?t:null};function yO(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function bO(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function xO(e){return P.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===_O}var SO=Symbol.for(`react.lazy`);function CO(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===SO&&`_payload`in e&&wO(e._payload)}function wO(e){return typeof e==`object`&&!!e&&`then`in e}var TO=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,EO=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,DO=P.use,OO=Object.freeze({reduced:!1,squish:90,fast:120,normal:180,slow:280,springDuration:320,bounce:.3,stretch:.28,distance:4,stagger:24,blur:0,shake:3,steps:0,fuse:1,pressDepth:.5,pressScale:1,ease:`cubic-bezier(0.2, 0, 0, 1)`,easeExit:`cubic-bezier(0.4, 0, 1, 1)`}),kO=`(prefers-reduced-motion: reduce)`;function AO(e){let t=e.ownerDocument.defaultView;if(!t)return OO;let n=t.getComputedStyle(e),r=(e,t)=>{let r=n.getPropertyValue(e).trim(),i=Number.parseFloat(r);return Number.isFinite(i)?Math.max(0,i):t},i=(e,t)=>{let i=n.getPropertyValue(e).trim();return r(e,t)*(i.endsWith(`s`)&&!i.endsWith(`ms`)?1e3:1)},a=t.matchMedia?.(kO).matches??!1,o=(e,t)=>a?120:i(`--stipe-motion-${e}`,t),s=(e,t)=>a?0:r(`--stipe-motion-${e}`,t);return{reduced:a,squish:o(`squish`,OO.squish),fast:o(`fast`,OO.fast),normal:o(`normal`,OO.normal),slow:o(`slow`,OO.slow),springDuration:o(`spring-duration`,OO.springDuration),bounce:Math.min(1,s(`bounce`,OO.bounce)),stretch:s(`stretch`,OO.stretch),distance:s(`distance`,OO.distance),stagger:a?0:i(`--stipe-motion-stagger`,OO.stagger),blur:s(`blur`,OO.blur),shake:s(`shake`,OO.shake),steps:Math.floor(s(`steps`,OO.steps)),fuse:r(`--stipe-motion-fuse`,OO.fuse),pressDepth:a?0:r(`--stipe-press-depth`,OO.pressDepth),pressScale:a?1:r(`--stipe-press-scale`,OO.pressScale),ease:n.getPropertyValue(`--stipe-motion-ease`).trim()||OO.ease,easeExit:n.getPropertyValue(`--stipe-motion-ease-exit`).trim()||OO.easeExit}}function jO(e){let[t,n]=(0,P.useState)(()=>({...OO,reduced:!0}));return(0,P.useLayoutEffect)(()=>{let t=e.current,r=t?.ownerDocument.defaultView;if(!t||!r)return;let i=()=>{let e=AO(t);n(t=>JSON.stringify(t)===JSON.stringify(e)?t:e)};i();let a=new r.MutationObserver(i);for(let e=t;e;e=e.parentElement)a.observe(e,{attributes:!0,attributeFilter:[`data-theme`,`class`,`style`]});let o=r.matchMedia?.(kO);return o?.addEventListener(`change`,i),()=>{a.disconnect(),o?.removeEventListener(`change`,i)}},[e]),t}function MO(e,t){return e.reduced?0:Math.round(t*e.normal/OO.normal)}function NO(e,t){if(e.reduced)return 0;let n=t*e.bounce/OO.bounce;return Math.min(.9,Math.max(0,n))}function PO(e,t){return e.reduced?0:Math.round(t*e.springDuration/OO.springDuration)}function FO(e,t){return e.steps>0?`steps(${String(e.steps)}, end)`:t}function IO(e){return`animate`in e}var LO=globalThis;function RO(){return LO.matchMedia?.(kO).matches??!1}function zO(e){let t=LO.matchMedia?.(kO);return t?.addEventListener(`change`,e),()=>{t?.removeEventListener(`change`,e)}}function BO(){return!0}function VO(){return(0,P.useSyncExternalStore)(zO,RO,BO)}var HO=(0,P.forwardRef)(function({asChild:e=!1,className:t,...n},r){let i=uO(`absolute h-px w-px overflow-hidden whitespace-nowrap border-0 p-0 [clip:rect(0,0,0,0)]`,t);return e?(0,X.jsx)(gO,{...n,className:i,ref:r}):(0,X.jsx)(`span`,{...n,className:i,ref:r})}),UO=(0,P.forwardRef)(function({id:e,transform:t},n){return(0,X.jsxs)(`radialGradient`,{ref:n,id:e,gradientUnits:`userSpaceOnUse`,cx:`-1.2`,cy:`-1.6`,r:`5.6`,gradientTransform:t,children:[(0,X.jsx)(`stop`,{offset:`0`,stopColor:`color-mix(in oklab, var(--color-white) calc(var(--depth) * 50%), currentColor)`}),(0,X.jsx)(`stop`,{offset:`1`,stopColor:`currentColor`})]})});function WO({id:e}){return(0,X.jsx)(`filter`,{id:e,x:`-50%`,y:`-50%`,width:`200%`,height:`200%`,children:(0,X.jsx)(`feDropShadow`,{dx:`0`,dy:`1.5`,stdDeviation:`1`,floodColor:`currentColor`,style:{floodOpacity:`calc(var(--depth) * 0.6)`}})})}function GO({id:e}){return(0,X.jsxs)(`filter`,{id:e,x:`-10%`,y:`-10%`,width:`120%`,height:`120%`,colorInterpolationFilters:`sRGB`,children:[(0,X.jsx)(`feGaussianBlur`,{in:`SourceAlpha`,stdDeviation:`0.3`,result:`soft-edge`}),(0,X.jsx)(`feOffset`,{in:`soft-edge`,dx:`0.25`,dy:`0.45`,result:`lower-edge`}),(0,X.jsx)(`feComposite`,{in:`SourceAlpha`,in2:`lower-edge`,operator:`out`,result:`inner-shadow`}),(0,X.jsx)(`feFlood`,{floodColor:`var(--color-black)`,floodOpacity:`calc(var(--depth) * 0.28)`}),(0,X.jsx)(`feComposite`,{in2:`inner-shadow`,operator:`in`,result:`shade`}),(0,X.jsx)(`feOffset`,{in:`soft-edge`,dx:`-0.2`,dy:`-0.35`,result:`upper-edge`}),(0,X.jsx)(`feComposite`,{in:`SourceAlpha`,in2:`upper-edge`,operator:`out`,result:`inner-highlight`}),(0,X.jsx)(`feFlood`,{floodColor:`var(--color-white)`,floodOpacity:`calc(var(--depth) * 0.7)`}),(0,X.jsx)(`feComposite`,{in2:`inner-highlight`,operator:`in`,result:`highlight`}),(0,X.jsxs)(`feMerge`,{children:[(0,X.jsx)(`feMergeNode`,{in:`SourceGraphic`}),(0,X.jsx)(`feMergeNode`,{in:`shade`}),(0,X.jsx)(`feMergeNode`,{in:`highlight`})]})]})}var KO=Object.freeze({alphaIntercept:-8,alphaSlope:18,blurStdDeviation:2});function qO({id:e,values:t=ME}){return(0,X.jsxs)(`filter`,{id:e,x:`-50%`,y:`-50%`,width:`200%`,height:`200%`,children:[(0,X.jsx)(`feGaussianBlur`,{in:`SourceGraphic`,stdDeviation:t.blurStdDeviation,result:`blur`}),(0,X.jsx)(`feColorMatrix`,{in:`blur`,values:`1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 ${String(t.alphaSlope)} ${String(t.alphaIntercept)}`,result:`gooey`}),(0,X.jsx)(`feComposite`,{in:`SourceGraphic`,in2:`gooey`,operator:`atop`})]})}function JO(e,t){let n=e.ownerDocument,r=!0,i=()=>{t(r&&!n.hidden)},a=globalThis,o=`IntersectionObserver`in globalThis&&a.IntersectionObserver?new a.IntersectionObserver(t=>{let n=t.find(t=>t.target===e);n&&(r=n.isIntersecting,i())}):void 0;return o?.observe(e),n.addEventListener(`visibilitychange`,i),i(),()=>{o?.disconnect(),n.removeEventListener(`visibilitychange`,i)}}function YO(e){let t=Math.max(0,Math.min(1,e));return t*t*(3-2*t)}function XO(e,t){let n=Math.max(0,Math.min(1,(t-(e-1)*.085)/.68));return Math.sin(n*Math.PI)**2}function ZO(e,t,n){let r=n*Math.PI*2,i=t*2.1,a=Math.sin(r*2+i)*.15,o={rx:4*(1+a),ry:4/(1+a)};if(e===`line`){let e=7.5+4*Math.cos(r+(t===2?-.45:0));return{cx:(t-1)*e,cy:Math.sin(r+i)*.7,...o}}if(e===`square`){let e=4.7+2.7*Math.cos(r);return{cx:(t%2?1:-1)*e,cy:(t<2?-1:1)*e,...o}}if(e===`donut`){let e=YO(n/.66)*Math.PI*2,o=Math.min(e,t*Math.PI/8)-Math.PI/2,s=YO((n-.79)/.21),c=8+Math.sin(r*2+i)*.35*Math.sin(n*Math.PI);return{cx:Math.cos(o)*c*(1-s),cy:Math.sin(o)*c*(1-s)-8*s,rx:3.6*(1+a*Math.sin(n*Math.PI)),ry:3.6/(1+a*Math.sin(n*Math.PI))}}if(e===`bloom`){if(t===0){let e=[1,2,3,4].reduce((e,t)=>e+XO(t,n),0),t=Math.sqrt(49-e*4);return{cx:Math.sin(r)*.4,cy:Math.sin(r*2)*.4,rx:t*(1+a),ry:t/(1+a)}}let e=XO(t,n),i=(t-1)*Math.PI/2-Math.PI/4+Math.sin(r)*.22;return{cx:Math.cos(i)*14*e,cy:Math.sin(i)*14*e,rx:3.2*(1+a),ry:3.2/(1+a)}}return{cx:Math.sin(r+i)*6+Math.sin(r*3+i)*2.5,cy:Math.cos(r*2+i)*6,...o}}var QO={line:1700,square:1900,donut:3e3,wander:4600,bloom:2800},$O=2;function ek({variant:e,pace:t=`working`}){let r=`caps-loader-${(0,P.useId)().replaceAll(`:`,``)}`,i=(0,P.useRef)(null),a=(0,P.useRef)(null),o=jO(a),{reduced:s}=o,c=e===`donut`?16:e===`bloom`?5:e===`square`?4:3;return(0,P.useLayoutEffect)(()=>{if(!i.current||!a.current||s&&t===`idle`)return;let r=s?[n(i.current,{opacity:[.55,1],duration:o.slow*10,ease:`inOutSine`,alternate:!0,loop:!0})]:[...i.current.querySelectorAll(`ellipse`)].map((r,i)=>n(r,{keyframes:Array.from({length:48},(n,r)=>({...ZO(e,i,(r+1)/48),duration:MO(o,QO[e]*(t===`idle`?$O:1))/48})),ease:`linear`,loop:!0})),c=JO(a.current,e=>{for(let t of r)e?t.resume():t.pause()});return()=>{c();for(let e of r)e.revert()}},[e,t,s,o]),(0,X.jsxs)(`svg`,{ref:a,"aria-hidden":`true`,focusable:`false`,viewBox:e===`line`?`-20 -10 40 20`:`-20 -20 40 40`,children:[(0,X.jsxs)(`defs`,{children:[(0,X.jsx)(qO,{id:r,values:KO}),(0,X.jsx)(UO,{id:`${r}-surface`,transform:e===`line`?`matrix(3.4 0 0 1.4 0 0)`:`matrix(3 0 0 3 0 0)`}),(0,X.jsx)(WO,{id:`${r}-shadow`}),(0,X.jsx)(`mask`,{id:`${r}-mask`,maskUnits:`userSpaceOnUse`,x:`-20`,y:`-20`,width:`40`,height:`40`,style:{maskType:`alpha`},children:(0,X.jsx)(`g`,{ref:i,fill:`currentColor`,filter:`url(#${r})`,children:Array.from({length:c},(t,n)=>(0,X.jsx)(`ellipse`,{...ZO(e,n,0)},n))})})]}),(0,X.jsx)(`g`,{filter:`url(#${r}-shadow)`,children:(0,X.jsx)(`rect`,{x:`-20`,y:`-20`,width:`40`,height:`40`,fill:`url(#${r}-surface)`,mask:`url(#${r}-mask)`})})]})}var tk={sm:`caps-loader-sm`,md:`caps-loader-md`,lg:`caps-loader-lg`,fill:`caps-loader-fill`},nk={neutral:`text-base-content`,accent:`text-accent`,primary:`text-primary`,success:`text-success`,current:`text-current`},rk=(0,P.forwardRef)(function({"aria-label":e,"aria-labelledby":t,className:n,decorative:r=!1,label:i=`Loading`,size:a=`md`,variant:o=`line`,pace:s=`working`,tone:c=`neutral`,...l},u){let d=`${(0,P.useId)()}-label`,f=!r&&e===void 0&&t===void 0;return(0,X.jsxs)(`span`,{...l,"aria-label":r?void 0:e,"aria-hidden":r||void 0,"aria-labelledby":r?void 0:t??(e===void 0?d:void 0),className:uO(`caps-loader`,tk[a],nk[c],n),"data-variant":o,"data-pace":s,role:r?void 0:`status`,ref:u,children:[(0,X.jsx)(ek,{variant:o,pace:s}),f?(0,X.jsx)(HO,{id:d,children:i}):null]})}),ik=`disabled:bg-base-200 disabled:text-base-content disabled:outline-1 disabled:outline-solid disabled:outline-base-content/25 aria-disabled:bg-base-200 aria-disabled:text-base-content aria-disabled:outline-1 aria-disabled:outline-solid aria-disabled:outline-base-content/25`,ak=RE(`btn caps-button disabled:pointer-events-none`,{variants:{variant:{primary:`btn-primary caps-button-filled`,secondary:`btn-secondary caps-button-filled`,accent:`btn-accent caps-button-filled`,destructive:`btn-error caps-button-filled`,outline:`btn-outline ${ik}`,ghost:`btn-ghost`,"ghost-destructive":`btn-ghost caps-button-ghost-destructive`,link:`btn-link ${ik}`},size:{xs:`btn-xs`,sm:`btn-sm`,default:`btn-md`,lg:`btn-lg`,icon:`btn-square btn-md`,menubar:`caps-button-menubar`}},defaultVariants:{variant:`primary`,size:`default`}}),ok=(0,P.forwardRef)(function({asChild:e=!1,children:t,className:n,disabled:r,loading:i=!1,result:a,resultLabel:o,onResultEnd:s,size:c=`default`,variant:l=`primary`,...u},d){let f=uO(ak({size:c,variant:l}),n),p=(0,P.useRef)(a).current,m=(0,P.useRef)(null);return(0,P.useImperativeHandle)(d,()=>m.current),sk(m,i,a),e?(0,X.jsx)(gO,{...u,"aria-busy":i?!0:u[`aria-busy`],"aria-disabled":r===!0||i?!0:void 0,className:f,ref:m,children:t}):(0,X.jsx)(`button`,{...u,"aria-busy":i?!0:u[`aria-busy`],className:f,disabled:r===!0||i,ref:m,type:u.type??`button`,children:a===void 0&&o===void 0?(0,X.jsxs)(X.Fragment,{children:[i?(0,X.jsx)(rk,{decorative:!0,size:`sm`,tone:`current`,variant:`wander`}):null,t]}):(0,X.jsx)(fk,{label:o,loading:i,onResultEnd:s,result:a,settled:p,children:t})})});function sk(e,t,n){let r=(0,P.useRef)(null),i=(0,P.useRef)(null),a=(0,P.useRef)(null);(0,P.useLayoutEffect)(()=>{let o=e.current;if(!o)return;let s=JSON.stringify([t,n??null,o.textContent]),c=s!==i.current;i.current=s;let l=a.current;if(!c&&l)return;let u=l?o.offsetWidth:r.current;l&&(a.current=null,l.cancel(),o.style.removeProperty(`overflow`),o.style.removeProperty(`white-space`));let d=o.offsetWidth;if(r.current=d>0?d:null,!c||u===null||d===0||Math.abs(u-d)<1||!IO(o))return;let f=AO(o);if(f.reduced)return;let p=o.animate([{width:`${String(u)}px`},{width:`${String(d)}px`}],{duration:f.normal,easing:FO(f,f.ease)});a.current=p,o.style.overflow=`clip`,o.style.whiteSpace=`nowrap`;let m=()=>{a.current===p&&(a.current=null,o.style.removeProperty(`overflow`),o.style.removeProperty(`white-space`))};p.onfinish=m,p.oncancel=m})}var ck=1100;function lk(e,t){let n=t.bounce/.3,r=1+.05*Math.min(1.4,.4+n),i=1-.02*Math.min(1.4,n);return e.animate([{transform:`scale(1)`},{transform:`scale(${String(r)})`,offset:.35},{transform:`scale(${String(i)})`,offset:.7},{transform:`scale(1)`}],{duration:t.springDuration,easing:FO(t,`ease-out`)})}function uk(e,t){let n=t.shake;return e.animate([{transform:`none`},{transform:`translateX(${String(-n)}px)`},{transform:`translateX(${String(n)}px)`},{transform:`translateX(${String(-n*.6)}px)`},{transform:`translateX(${String(n*.3)}px)`},{transform:`none`}],{duration:t.slow*1.3,easing:FO(t,`linear`)})}function dk(e,t,n){let r=n.distance+2,i=`blur(${String(n.blur)}px)`;return[e.animate([{opacity:1,transform:`none`,filter:`blur(0px)`},{opacity:0,transform:`translateY(${String(-r)}px)`,filter:i}],{duration:n.fast,easing:FO(n,n.ease)}),t.animate([{opacity:0,transform:`translateY(${String(r)}px)`,filter:i},{opacity:1,transform:`none`,filter:`blur(0px)`}],{duration:n.normal,easing:FO(n,n.ease),fill:`backwards`})]}function fk({children:e,label:t,loading:n,onResultEnd:r,result:i,settled:a}){let o=(0,P.useRef)(null),s=VO(),[c,l]=(0,P.useState)(!1),[u,d]=(0,P.useState)(!1);c&&!u&&d(!0);let f=(0,P.useRef)(a),p=(0,P.useRef)(r);(0,P.useEffect)(()=>{p.current=r},[r]),(0,P.useLayoutEffect)(()=>{let e=f.current;if(f.current=i,i===e)return;if(i===`done`){l(!0);let e=setTimeout(()=>{p.current?p.current():l(!1)},ck);return()=>{clearTimeout(e)}}l(!1);let t=o.current;if(i!==`failed`||!t||!IO(t))return;let n=AO(t);if(n.shake<=0)return;let r=uk(t,n);return()=>{r.cancel()}},[i,s]);let m=(0,P.useRef)(c);return(0,P.useLayoutEffect)(()=>{let e=o.current;if(!e||m.current===c)return;m.current=c;let t=e.querySelector(`[data-face="label"]`),n=e.querySelector(`[data-face="result"]`);if(!t||!n||!IO(e)){c||d(!1);return}let r=AO(e),i=c?dk(t,n,r):dk(n,t,r);if(c||i[0]?.addEventListener(`finish`,()=>{d(!1)}),c&&!r.reduced){i.push(lk(e.closest(`button`)??e,r));let t=n.querySelector(`path`);t&&i.push(t.animate([{strokeDashoffset:1},{strokeDashoffset:0}],{duration:r.normal*1.4,delay:r.fast/2,easing:FO(r,r.ease),fill:`backwards`}))}return()=>{for(let e of i)e.cancel()}},[c,s]),(0,X.jsxs)(`span`,{ref:o,className:`caps-button-faces`,"data-showing":c?`result`:`label`,children:[(0,X.jsxs)(`span`,{className:`caps-button-face`,"data-face":`label`,"aria-hidden":c?!0:void 0,children:[n||c?(0,X.jsx)(rk,{decorative:!0,size:`sm`,tone:`current`,variant:`wander`}):null,e]}),u?(0,X.jsxs)(`span`,{className:`caps-button-face`,"data-face":`result`,"aria-hidden":!c||void 0,children:[(0,X.jsx)(`svg`,{className:`caps-button-check`,viewBox:`0 0 24 24`,"aria-hidden":`true`,focusable:`false`,children:(0,X.jsx)(`path`,{d:`M4.5 12.5 9.5 17.5 19.5 6.5`,pathLength:1})}),t===void 0?e:t]}):null]})}var pk={xs:`size-3`,sm:`size-[var(--stipe-icon-size-sm)]`,md:`size-[var(--stipe-icon-size-md)]`,lg:`size-[var(--stipe-icon-size-lg)]`},mk=(0,P.forwardRef)(function({active:e=!1,icon:t,iconSize:n=`xs`,className:r,reveal:i=!1,size:a=`xs`,tone:o=`default`,variant:s=`ghost`,...c},l){let u=a===`responsive`;return(0,X.jsx)(ok,{...c,resultLabel:c.result===void 0?void 0:null,ref:l,size:u?`sm`:a,variant:s,className:uO(`caps-icon-button btn-circle`,u&&`caps-icon-button-responsive md:btn-xs`,e&&`text-accent`,i&&`scale-0 transition-transform group-hover:scale-100 focus-visible:scale-100`,o===`destructive`&&`hover:text-error`,r),children:(0,X.jsx)(`span`,{"aria-hidden":`true`,className:uO(`inline-flex shrink-0 [&>svg]:size-full [&>svg]:[stroke-width:var(--stipe-icon-stroke)]`,pk[n]),children:t})})}),hk=(0,P.forwardRef)(function({tone:e=`neutral`,size:t=`md`,pressed:n=!1,touch:r,className:i,...a},o){return(0,X.jsx)(`kbd`,{...a,ref:o,className:uO(`caps-keycap`,i),"data-tone":e,"data-size":t,"data-pressed":n,"data-touch":r})}),gk=(0,P.forwardRef)(function({label:e,shortcut:t,icon:n,readout:r,tone:i=`neutral`,density:a=`regular`,pressed:o,expanded:s,className:c,type:l=`button`,...u},d){let f=o??s;return(0,X.jsxs)(`button`,{...u,ref:d,type:l,className:uO(`caps-keycap-button`,c),"data-tone":i,"data-density":a===`compact`?a:void 0,"aria-pressed":o,"aria-expanded":s,"aria-keyshortcuts":u[`aria-keyshortcuts`]??t,children:[f===void 0?null:(0,X.jsx)(`span`,{className:`caps-keycap-led`,"data-lit":f,"aria-hidden":`true`}),n?(0,X.jsx)(`span`,{className:`caps-keycap-button-icon`,"aria-hidden":`true`,children:n}):null,e===null?null:(0,X.jsx)(`span`,{className:`caps-keycap-button-label`,children:e}),r,t?(0,X.jsx)(hk,{size:`sm`,tone:`neutral`,touch:`hide`,"aria-hidden":`true`,children:t}):null]})}),_k=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),vk=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),yk={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},bk=(0,P.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,P.createElement)(`svg`,{ref:c,...yk,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:vk(`lucide`,i),...s},[...o.map(([e,t])=>(0,P.createElement)(e,t)),...Array.isArray(a)?a:[a]])),xk=(e,t)=>{let n=(0,P.forwardRef)(({className:n,...r},i)=>(0,P.createElement)(bk,{ref:i,iconNode:t,className:vk(`lucide-${_k(e)}`,n),...r}));return n.displayName=`${e}`,n},Sk=function(e,t,n){if(t!=null){if(typeof t!=`object`&&typeof t!=`function`)throw TypeError(`Object expected.`);var r,i;if(n){if(!Symbol.asyncDispose)throw TypeError(`Symbol.asyncDispose is not defined.`);r=t[Symbol.asyncDispose]}if(r===void 0){if(!Symbol.dispose)throw TypeError(`Symbol.dispose is not defined.`);r=t[Symbol.dispose],n&&(i=r)}if(typeof r!=`function`)throw TypeError(`Object not disposable.`);i&&(r=function(){try{i.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:r,async:n})}else n&&e.stack.push({async:!0});return t},Ck=(function(e){return function(t){function n(n){t.error=t.hasError?new e(n,t.error,`An error was suppressed during disposal.`):n,t.hasError=!0}var r,i=0;function a(){for(;r=t.stack.pop();)try{if(!r.async&&i===1)return i=0,t.stack.push(r),Promise.resolve().then(a);if(r.dispose){var e=r.dispose.call(r.value);if(r.async)return i|=2,Promise.resolve(e).then(a,function(e){return n(e),a()})}else i|=1}catch(e){n(e)}if(i===1)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}return a()}})(typeof SuppressedError==`function`?SuppressedError:function(e,t,n){var r=Error(n);return r.name=`SuppressedError`,r.error=e,r.suppressed=t,r}),wk=class extends Y{stage;provider;constructor(e){super(e.message,{code:e.code,retryable:e.retryable,...e.need!==void 0&&{need:e.need}}),this.stage=e.stage??null,this.provider=e.provider}},Tk=e=>ix.pipe(J(Mx(1)),J(Fx(e))),Ek=G({requestId:Tk(256),computerId:Tk(256)}),Dk=ax.pipe(J(Ax()),J(gx(Number.isSafeInteger,{message:`Expected a safe integer`}))),Ok=Dk.pipe(J(Ex(0))),kk=Dk.pipe(J(Dx(0))),Ak=q([`first-frame`,`last-frame`,`reference`]),jk=q([`480p`,`720p`,`768p`,`1080p`,`4k`]),Mk=q([`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`,`9:21`]),Nk=G({computerId:V(Tk(256)),path:Tk(4096),role:V(Ak)}),Pk=G({path:Tk(4096),role:Ak}),Fk=G({computerId:Tk(256),path:Tk(4096)}),Ik=G({defaultHeight:Ok,defaultSteps:ux(kk),defaultWidth:Ok,dimensions:q([`none`,`own`]),maxDimension:ux(Ok),maxDimensionDocumented:W,maxReferences:kk,maxSteps:ux(Ok),referenceDimension:ux(Ok),referenceField:ux(Tk(256)),referenceFormat:q([`png`,`webp`]),steps:q([`steps`,`num_steps`,`fixed`]),transport:q([`json`,`multipart`])}),Lk=G({minSeconds:Ok,maxSeconds:Ok,defaultSeconds:Ok,durations:K(Ok),provider:q([`seedance`,`veo`,`minimax`]),formats:K(G({resolution:jk,aspectRatio:Mk,width:Ok,height:Ok})),defaultResolution:jk,defaultAspectRatio:Mk,supportsAudio:W,defaultGenerateAudio:ux(W),referenceRoles:K(Ak),maxReferenceImages:kk,referenceResolutions:K(jk),prices:K(G({resolution:jk,silentMilliunitsPerSecond:Ok,audioMilliunitsPerSecond:Ok}))}),Rk=K(G({id:Tk(256),input:Ik,kind:q([`image`,`video`]),label:Tk(512),maxPromptLength:Ok,tier:q([`draft`,`balanced`,`premium`,`max`]),outputFormats:K(q([`png`,`jpeg`,`webp`])).pipe(J(Fx(3))),sizes:ux(K(ix.pipe(J(yx(/^\d+x\d+$/u))))),video:ux(Lk)})),zk=G({[Symbol.dispose]:V(U),computerId:Tk(256),models:Rk,canGenerate:W}),Bk=G({model:Tk(256),prompt:Tk(2048),width:Ok.pipe(J(Ox(5040))),height:Ok.pipe(J(Ox(5040))),steps:V(Ok),durationSeconds:V(Ok),resolution:V(jk),aspectRatio:V(Mk),generateAudio:V(W),references:V(K(Nk).pipe(J(Fx(16))))});G({model:Tk(256),prompt:Tk(2048),resolution:V(jk),aspectRatio:V(Mk),durationSeconds:V(Ok.pipe(J(Dx(4)),J(Ox(15)))),generateAudio:V(W),references:V(K(Pk).pipe(J(Fx(4))))});var Vk=[`admission`,`generation-authorization`,`settings`,`estimate`,`billing`,`operation`,`provider`,`normalization`,`artifact`,`destination-authorization`,`destination-write`],Hk=G({destination:G({path:Tk(4096)}),settings:U}),Uk=G({[Symbol.dispose]:V(U),bytes:Ok,costMilliunits:kk,destination:Fk,format:q([`png`,`jpeg`,`gif`,`webp`,`mp4`]),height:Ok,model:Tk(256),width:Ok});G({...Uk.fields,format:H(`mp4`)});var Wk=G({message:Tk(512),stage:V(q(Vk)),provider:V(Yx),code:q([`CANCELLED`,`CAPABILITY_DENIED`,`CAPABILITY_REVOKED`,`DAILY_LIMIT_REACHED`,`DISCONNECTED`,`HOST_FAILURE`,`IDENTITY`,`INSUFFICIENT_CREDIT`,`INVALID_ARGUMENT`,`MEDIA_PROVIDER_FAILURE`,`MEDIA_PROVIDER_FAILURE_UNCHARGED`,`PROTOCOL`,`SAFETY_FILTER_REFUSED`,`SETUP_REQUIRED`,`TIMEOUT`]),retryable:W,need:V(Gx)}),Gk=lx([G({[Symbol.dispose]:V(U),kind:H(`succeeded`),result:Uk}),G({[Symbol.dispose]:V(U),kind:H(`failed`),failure:Wk})]),Kk=OE({reference:AE(kE(Za().transform(e=>$b(Ek)(e)))),generate:AE(kE(Za().transform(e=>{let t=$b(Gk,{onExcessProperty:`error`})(e);return t.kind===`succeeded`?{kind:t.kind,result:{bytes:t.result.bytes,costMilliunits:t.result.costMilliunits,destination:t.result.destination,format:t.result.format,height:t.result.height,model:t.result.model,width:t.result.width}}:{kind:t.kind,failure:t.failure}})))}),qk=DE(`media.generation`,5,Ho(()=>OE({describe:AE(kE(Za().transform(e=>{let{computerId:t,canGenerate:n,models:r}=$b(zk,{onExcessProperty:`error`})(e);return{computerId:t,canGenerate:n,models:r}}))),quote:AE(kE(ao({costMilliunits:Ua().int().nonnegative().max(2**53-1)}))).optional(),createAttempt:AE(Kk),restoreAttempt:AE(Kk),cancelAttempt:jE}))),Jk=co([ao({shared:N(!1)}),ao({shared:N(!0),url:Ea(),showPrompt:qa()})]);ao({requestId:A().min(1).max(256),showPrompt:qa()});var Yk=DE(`media.share`,1,Ho(()=>OE({status:AE(kE(Jk)),share:AE(kE(Jk)),stop:AE(kE(Jk))})));function Xk(e,t){try{return $b(e,{onExcessProperty:`error`})(t)}catch(e){throw new Y(`The Media capability returned malformed data`,{cause:e,code:`PROTOCOL`,retryable:!1})}}function Zk(e){return e instanceof Y?e:new Y(`The Media capability failed`,{cause:e,code:`HOST_FAILURE`,retryable:!0})}function Qk(e){if(e?.aborted)throw new Y(`Media generation was cancelled`,{code:`CANCELLED`,retryable:!1})}function $k(e){let t;try{t=$b(Hk,{onExcessProperty:`error`})(e)}catch(e){throw new Y(`Media generation input is invalid`,{cause:e,code:`INVALID_ARGUMENT`,retryable:!1})}let n;try{n=tA($b(Bk,{onExcessProperty:`error`})(t.settings))}catch(e){throw new Y(`Media generation settings are invalid`,{cause:e,code:`INVALID_ARGUMENT`,retryable:!1})}let r={path:t.destination.path.trim()};if(r.path.length===0)throw new Y(`Media generation destination is invalid`,{code:`INVALID_ARGUMENT`,retryable:!1});return Object.freeze({destination:Object.freeze(r),settings:n})}function eA(e){try{return tA($b(Bk,{onExcessProperty:`error`})(e))}catch(e){throw new Y(`Media generation settings are invalid`,{cause:e,code:`INVALID_ARGUMENT`,retryable:!1})}}function tA(e){let t=(e,t)=>{let n=e.trim();if(n.length===0)throw Error(`${t} must not be blank`);return n},n={model:t(e.model,`model`),prompt:t(e.prompt,`prompt`),width:e.width,height:e.height};return e.steps!==void 0&&(n.steps=e.steps),e.durationSeconds!==void 0&&(n.durationSeconds=e.durationSeconds),e.resolution!==void 0&&(n.resolution=e.resolution),e.aspectRatio!==void 0&&(n.aspectRatio=e.aspectRatio),e.generateAudio!==void 0&&(n.generateAudio=e.generateAudio),e.references!==void 0&&(n.references=Object.freeze(e.references.map(e=>Object.freeze({...e,path:t(e.path,`reference`)})))),Object.freeze(n)}function nA(e){let t=Xk(Rk,e),n=new Set;for(let e of t){if(n.has(e.id))throw new Y(`The Media capability repeated a model`,{code:`PROTOCOL`,retryable:!1});n.add(e.id)}return Object.freeze(t.map(e=>Object.freeze(e)))}function rA(e,t,n){let r=Xk(Uk,e);if(r.model!==t.settings.model||r.destination.computerId!==n||r.destination.path!==t.destination.path||r.width!==t.settings.width||r.height!==t.settings.height)throw new Y(`The Media capability returned an unrelated result`,{code:`PROTOCOL`,retryable:!1});return Object.freeze({bytes:r.bytes,costMilliunits:r.costMilliunits,destination:Object.freeze({...r.destination}),format:r.format,height:r.height,model:r.model,width:r.width})}async function iA(e){try{let t=e.require(qk);{let e={stack:[],error:void 0,hasError:!1};try{let n=Xk(zk,Sk(e,CE(await t.describe()),!1).value),r=n.computerId.trim();if(r.length===0)throw new Y(`The Media capability returned no Computer`,{code:`PROTOCOL`,retryable:!1});let i=nA(n.models),a=t.quote?.bind(t),o=async e=>{let n=CE(e),i;try{{let t={stack:[],error:void 0,hasError:!1};try{let n=Sk(t,CE(await e.reference()),!1),a=Xk(G({...Ek.fields,[Symbol.dispose]:V(U)}),n.value);if(i={requestId:a.requestId,computerId:a.computerId},i.computerId!==r)throw new Y(`Media attempt belongs to another Computer`,{code:`IDENTITY`,retryable:!1})}catch(e){t.error=e,t.hasError=!0}finally{Ck(t)}}}catch(e){throw n[Symbol.dispose](),Zk(e)}let a=!1;return{reference:Object.freeze(i),async generate(n,o={}){if(a)throw new Y(`Media generation attempt is closed`,{code:`CAPABILITY_DENIED`,retryable:!1});Qk(o.signal);let s=$k(n),c=o.signal,l,u,d=()=>(u??=t.cancelAttempt(i),u);try{let t=e.generate(s),n=c===void 0?await t:await Promise.race([t,new Promise((e,t)=>{l=()=>{d().then(()=>{t(new Y(`Media generation was cancelled`,{code:`CANCELLED`,retryable:!1}))},t)},c.addEventListener(`abort`,l,{once:!0}),c.aborted&&l()})]);c?.aborted&&(await d(),Qk(c)),Qk(c);{let e={stack:[],error:void 0,hasError:!1};try{let t=Xk(Gk,Sk(e,CE(n),!1).value);if(t.kind===`failed`)throw new wk(t.failure);return rA(t.result,s,r)}catch(t){e.error=t,e.hasError=!0}finally{Ck(e)}}}catch(e){throw c?.aborted&&(await d(),Qk(c)),Zk(e)}finally{l!==void 0&&c?.removeEventListener(`abort`,l)}},[Symbol.dispose](){a||(a=!0,n[Symbol.dispose]())}}};return Object.freeze({computerId:r,canGenerate:n.canGenerate,models:i,async quote(e){let t={stack:[],error:void 0,hasError:!1};try{let n=eA(e);if(a===void 0)return null;let r=Sk(t,CE(await a(n)),!1);return Object.freeze({costMilliunits:r.value.costMilliunits})}catch(e){t.error=e,t.hasError=!0}finally{Ck(t)}},async createAttempt(){return o(await t.createAttempt())},async restoreAttempt(e){let n=Xk(Ek,e);if(n.computerId!==r)throw new Y(`Select the original Computer to retry this generation`,{code:`IDENTITY`,retryable:!1});let i=await o(await t.restoreAttempt(n));if(i.reference.requestId!==n.requestId)throw i[Symbol.dispose](),new Y(`Media restore changed the request identity`,{code:`PROTOCOL`,retryable:!1});return i}})}catch(t){e.error=t,e.hasError=!0}finally{Ck(e)}}}catch(e){throw Zk(e)}}function aA(e,t){console.error(`Prints operation failed`,JSON.stringify({operation:e,errorKind:t instanceof Error?`error`:`non-error`,stage:t instanceof wk?t.stage:null,provider:t instanceof wk?t.provider:void 0}),hh(t))}export{jT as $,Bg as $n,ur as $r,NS as $t,dO as A,Qb as An,io as Ar,WS as At,CT as B,Mx as Bn,Jo as Br,MS as Bt,FO as C,rx as Cn,no as Cr,xw as Ct,jO as D,J as Dn,bo as Dr,JS as Dt,AO as E,fx as En,vo as Er,ZS as Et,jE as F,kx as Fn,so as Fr,LS as Ft,wT as G,Wx as Gn,Ua as Gr,_S as Gt,uE as H,gx as Hn,Ho as Hr,yS as Ht,DE as I,Ex as In,yo as Ir,IS as It,DT as J,Hg as Jn,ao as Jr,bS as Jt,TT as K,Jb as Kn,M as Kr,gS as Kt,bE as L,Dx as Ln,Zo as Lr,PS as Lt,kE as M,zx as Mn,Lo as Mr,HS as Mt,OE as N,mx as Nn,ba as Nr,VS as Nt,VO as O,Vb as On,Do as Or,qS as Ot,AE as P,Yb as Pn,k as Pr,RS as Pt,ZT as Q,Kg as Qn,wa as Qr,CS as Qt,SE as R,Ax as Rn,ro as Rr,kS as Rt,NO as S,Vx as Sn,rs as Sr,Tw as St,MO as T,lx as Tn,ko as Tr,Cw as Tt,_E as U,V as Un,N as Ur,vS as Ut,GT as V,yx as Vn,Qo as Vr,fS as Vt,vE as W,tx as Wn,oo as Wr,pS as Wt,kT as X,Lg as Xn,co as Xr,SS as Xt,OT as Y,Ug as Yn,A as Yr,OS as Yt,AT as Z,Vg as Zn,Za as Zr,hS as Zt,WO as _,ux as _n,Ks as _r,fE as _t,Ek as a,Me as ai,rS as an,Pv as ar,VT as at,HO as b,ix as bn,vs as br,Dw as bt,$k as c,v as ci,tS as cn,Lu as cr,KT as ct,mk as d,i as di,bx as dn,Mu as dr,qT as dt,Bn as ei,jS as en,Rg as er,$T as et,ok as f,jx as fn,Nu as fr,mE as ft,GO as g,nx as gn,ju as gr,YT as gt,qO as h,Lx as hn,ku as hr,JT as ht,Hk as i,Ae as ii,aS as in,Qv as ir,WT as it,RE as j,$b as jn,Co as jr,KS as jt,uO as k,Zb as kn,Ha as kr,GS as kt,xk as l,w as li,K as ln,Ru as lr,dE as lt,JO as m,q as mn,Pu as mr,PT as mt,wk as n,E as ni,cS as nn,Zv as nr,NT as nt,Yk as o,Pe as oi,Y as on,eg as or,HT as ot,rk as p,H as pn,Ou as pr,FT as pt,ET as q,Gg as qn,_o as qr,dS as qt,qk as r,Oe as ri,oS as rn,$v as rr,IT as rt,iA as s,C as si,Xx as sn,hh as sr,pE as st,aA as t,En as ti,mS as tn,qg as tr,MT as tt,gk as u,o as ui,W as un,Au as ur,XT as ut,UO as v,ax as vn,Xs as vr,kw as vt,PO as w,dx as wn,Ka as wr,Sw as wt,IO as x,G as xn,as as xr,Ew as xt,KO as y,sx as yn,qs as yr,Ow as yt,yE as z,Fx as zn,qa as zr,AS as zt};
71
+ `)},Zf=(e,t)=>{let n=t?.get(Hl.key);return n&&(e=`${e}\n${$f(n)}`),e},Qf=(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(Ul.key);n.push(` at fiber (${t})`),r&&n.push($f(r))}return n.join(`
72
+ `)},$f=e=>{let t=[],n=e,r=0;for(;n&&r<10;){let e=n.stack();if(e){let r=e.matchAll(Yf),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(`
73
+ `)},ep=e=>Kf(e).map(tp).join(`
74
+ `),tp=e=>e.cause?`${e.stack} {\n${np(e.cause,` `)}\n}`:e.stack,np=(e,t)=>{let n=e.stack.split(`
75
+ `),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${np(e.cause,`${t} `)}\n${t}}`),r},rp=`~effect/Fiber`,ip={_A:Os,_E:Os},ap={id:0},op=(()=>{try{return globalThis.process?.getBuiltinModule?.(`node:async_hooks`)?.AsyncResource}catch{return}})(),sp=()=>op===void 0?void 0:new op(`effect/Fiber`),cp=()=>globalThis[Vc],lp=class{constructor(e,t=!0){this.setContext(e),this.id=++ap.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[rp](){return ip}get currentDispatcher(){return this._dispatcher??=this.cache.scheduler.makeDispatcher()}getRef(e){return Rd(this.context,e)}addObserver(e){return this._exit?(e(this._exit),Ns):(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=Hf(e);this.cache.stackFrame&&(n=Nl(n,Pd(Hl,this.cache.stackFrame))),t&&(n=Nl(n,t)),this._interruptedCause=this._interruptedCause?kl(this._interruptedCause,n):n,this.interruptible&&(this._running?this._deferredInterrupt=!0:this.evaluate(vp(this._interruptedCause)))}pollUnsafe(){return this._exit}evaluate(e){if(this._exit)return;if(this._asyncContext!==void 0){let t=this._asyncContext;return this._asyncContext=void 0,t.runInAsyncScope(this.evaluate,this,e)}if(this._yielded!==void 0){let e=this._yielded;this._yielded=void 0,e()}let t=this.runLoop(e);if(t===hl){this._asyncContext=sp();return}let n=pp.interruptChildren&&pp.interruptChildren(this);if(n!==void 0)return this.evaluate(Wp(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=Md()}runLoop(e){let t=globalThis[Vc];globalThis[Vc]=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=vp(this._interruptedCause)),this.currentOpCount++;let e=this.cache;if(!r&&!e.preventYield&&e.scheduler.shouldYield(this)){r=!0;let e=i;i=Wp(Cp,()=>e)}if(i=e.tracerContext?e.tracerContext(i,this):i[dl](this),i===hl){let e=this._yielded;if(cl in e)return this._deferredInterrupt=!1,this._yielded=void 0,e;if(this._deferredInterrupt){this._yielded=void 0,e();continue}return hl}}catch(e){if(!$s(i,dl))return Kl(`Fiber.runLoop: Not a valid effect: ${String(i)}`);i=Kl(e)}}finally{this._running=n,globalThis[Vc]=t}}getCont(e){if(this._deferredInterrupt)return this._deferredInterrupt=!1,dp;for(;;){let t=this._stack.pop();if(!t)return;let n=t[ml];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&fp-1))return Vl(e);let t=this.getCont(fl);return t?t[fl](e,this):this.yieldWith(Vl(e))}yieldWith(e){return this._yielded=e,hl}children(){return this._children??=new Set}pipe(){return Ts(this,arguments)}setContext(e){let t=this.context;if(this.context=e,t!==void 0&&kd(t,e))return;let n=e.cacheRoot,r=n._fiberCache??=up(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}},up=e=>{let t=Ld(e,Ff);return{scheduler:Rd(e,Sf),tracer:t,tracerContext:t?t.context:void 0,tracerEnabled:Rd(e,Rf),span:Ld(e,Pf),logLevel:Rd(e,zf),minimumLogLevel:Rd(e,Bf),stackFrame:Rd(e,Lf),runtimeMetrics:Ld(e,If),maxOpsBeforeYield:Rd(e,kf),preventYield:Rd(e,Af)}},dp={[fl](e,t){return vp(t._interruptedCause)},[pl](e,t){return vp(t._interruptedCause)}},fp=32,pp={interruptChildren:void 0},mp=e=>{if(!e.cache.stackFrame)return;let t=new Map;return t.set(Ul.key,e.cache.stackFrame),Dd(t)},hp=e=>jp(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();continue}i=e.value.addObserver(e=>{r.push(e),a()});return}t(_p(r))}return a(),bp(()=>i?.())}),gp=e=>ql(t=>{let n=mp(t),r=Ku();for(let i of e)i.interruptUnsafe(t.id,n),r.push(i);return Up(hp(r))}),_p=Vl,vp=Wl,yp=Gl,bp=zl({op:`Sync`,[dl](e){let t=this[R](),n=e.getCont(fl);return n?n[fl](t,e):e.yieldWith(Vl(t))}}),xp=zl({op:`Suspend`,[dl](e){return this[R]()}}),Sp=Vu({onFailure:yp,onSuccess:_p}),Cp=zl({op:`Yield`,[dl](e){let t=!1;return e.currentDispatcher.scheduleTask(()=>{t||e.evaluate(Zp)},this[R]??0),e.yieldWith(()=>{t=!0})}})(0),wp=e=>xp(()=>vp(e())),Tp=e=>Kl(e),Ep=e=>xp(()=>yp(e())),Dp=_p(void 0),Op=e=>{let t=typeof e==`function`?e:e.try,n=typeof e==`function`?e=>new Tm(e,`An error occurred in Effect.try`):e.catch;return xp(()=>{try{return _p(t())}catch(e){return yp(n(e))}})},kp=function(){let e=Rl({op:`Async`,[dl](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._yielded=()=>{t=!0},r===void 0&&i===void 0||e._stack.push(Ap(()=>(t=!0,r?.abort(),i??Zp))),hl):n}}),t=function(e,t){this.register=e,this.withSignal=t};return t.prototype=e,function(e,n){return new t(e,n)}}(),Ap=zl({op:`AsyncFinalizer`,[ml](e){e.interruptible&&(e.interruptible=!1,e._stack.push(pm))},[pl](e,t){return Wf(e)?Wp(dm(Wl(e),this[R]()),()=>vp(e)):vp(e)}}),jp=e=>kp(e,e.length>=2),Mp=(e,t)=>Object.defineProperty(t,"length",{value:e,configurable:!0}),Np=(e,...t)=>Mp(e.length,t.length===0?function(){return Pp(()=>e.apply(this,arguments))}:function(){let n=Pp(()=>e.apply(this,arguments));for(let e of t)n=e(n,...arguments);return n}),Pp=e=>{try{let t=e(),n;for(;;){let r=t.next(n);if(r.done)return _p(r.value);let i=r.value;if(i&&i._tag===`Success`){n=i.value;continue}if(i&&i._tag===`Failure`)return r.value;{let n=!0;return xp(()=>n?(n=!1,Wp(r.value,e=>Fp(t,e))):xp(()=>Fp(e())))}}}catch(e){return Tp(e)}},Fp=function(){let e=Rl({op:`Iterator`,[fl](e,t){let n=this.iterator;for(;;){let r=n.next(e);if(r.done)return _p(r.value);if(!Gp(r.value))return t._stack.push(this),r.value;if(r.value._tag===`Failure`)return r.value;e=r.value.value}},[dl](e){return this[fl](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)}}(),Ip=function(e){return e._stack.push(this),this[R]},Lp=Rl({op:`OnSuccess`,[dl]:Ip}),Rp=function(e,t,n){this[R]=e,this[fl]=t,this.payload=n};Rp.prototype=Lp;var zp=function(){return this.payload},Bp=(()=>{let e=`~effect/Effect/stackProbe`;return{[e]:function(){return Error().stack}}[e]()?.includes(`[as `+e+`]`)===!0})(),Vp=function(e,t){let n=this.payload;return t.succeedWith(Bp?n(e):ol(()=>n(e)))},Hp=function(e){let t=this.payload;return t(e)},Up=e=>new Rp(e,zp,Zp),Wp=F(2,(e,t)=>new Rp(e,Hp,t)),Gp=e=>e[cl]!==void 0,Kp=F(2,(e,t)=>Gp(e)?e._tag===`Success`?t(e.value):e:Wp(e,t)),qp=F(2,(e,t)=>new Rp(e,Vp,t)),Jp=F(2,(e,t)=>Gp(e)?Qp(e,t):qp(e,t)),Yp=F(2,(e,t)=>Gp(e)?$p(e,t):am(e,t)),Xp=e=>e._tag===`Success`,Zp=Vl(void 0),Qp=F(2,(e,t)=>e._tag===`Success`?Vl(t(e.value)):e),$p=F(2,(e,t)=>{if(e._tag===`Success`)return e;let n=Uf(e.cause);return Ru(n)?e:Gl(t(n.success))}),em=F(2,(e,t)=>new nm(e,t.length===1?t:e=>t(e))),tm=Rl({op:`OnFailure`,[dl]:Ip}),nm=function(e,t){this[R]=e,this[pl]=t};nm.prototype=tm;var rm=F(3,(e,t,n)=>em(e,e=>{let r=t(e);return Ru(r)?vp(r.failure):n(r.success,e)})),im=F(2,(e,t)=>rm(e,Uf,e=>t(e))),am=F(2,(e,t)=>im(e,e=>Ep(()=>t(e)))),om=function(e,t){let n=this.payload;return t.succeedWith(Bp?n.onSuccess(e):ol(()=>n.onSuccess(e)))},sm=((e,t)=>{let n=Rl({op:e,[dl]:Ip,[fl]:om,[pl]:t}),r=function(e,t){this[R]=e,this.payload=t};return r.prototype=n,r})(`Match`,function(e,t){let n=e.reasons.find(Pl);if(n===void 0)return vp(e);let r=this.payload;return t.succeedWith(Bp?r.onFailure(n.error):ol(()=>r.onFailure(n.error)))}),cm=F(2,(e,t)=>new sm(e,t)),lm=e=>Gp(e)?Vl(e):um(e),um=zl({op:`Exit`,[dl](e){return e._stack.push(this),this[R]},[fl](e,t,n){return t.succeedWith(n??Vl(e))},[pl](e,t,n){return t.succeedWith(n??Wl(e))}}),dm=(e,t)=>Xp(e)?t:em(t,t=>vp(kl(e.cause,t))),fm=e=>ql(t=>t.interruptible?(t.interruptible=!1,t._stack.push(pm),e):e),pm=zl({op:`SetInterruptible`,[ml](e){if(e.interruptible=this[R],e._interruptedCause&&e.interruptible)return()=>vp(e._interruptedCause)}})(!0),mm=e=>e===`unbounded`?1/0:Math.max(1,e??1),hm=()=>e=>{let t=e.onItem,n=e.step,r=(e,t,r,a,o)=>Wp(lm(o),o=>n(e,t[r],o,r)??i(e,t,r+1,a)??Dp),i=(e,i,a=0,o=i.length)=>{for(;a<o;a++){let s=i[a],c=t(e,s,a);if(!Gp(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},gm=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=Kl(e);return f=t,c=!0,u&&u.size>0?Wp(fm(gp(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(Gp(g)){if(f=n(e,o,g,a),f)break}else if(l){p=void 0;let t=vm(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=Dl(e);f=Wl(f._tag===`Failure`?kl(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??Dp)}catch(e){d(m(e))}}),u.size<s)continue;i=!0,a++;return}else return jp(e=>{l=cp(),u=new Set,p=g,d=e;let t;try{t=h()}catch(t){return e(m(t))}return t?e(t):xp(()=>(f??=Zp,Wp(u?gp(u):Dp,()=>f?._tag===`Failure`?f:Dp)))})}if(c=!0,f){if(u&&u.size>0){let e=mp(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(Dp);else return Zp}};return h()}},_m=()=>e=>gm(e),vm=(e,t,n=!1,r=!1,i=!1)=>{let a=e,o=i===`inherit`?a.interruptible:!i,s=new lp(a.context,o);return r||(a.children().add(s),s._parent=a),n?s.evaluate(t):(s._asyncContext=sp(),a.currentDispatcher.scheduleTask(()=>s.evaluate(t),0)),s},ym=e=>(t,n)=>{let r=new lp(n?.scheduler?Fd(e,Sf,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},bm=ym(Md()),xm=(e=>{let t=ym(e);return e=>{if(Gp(e))return e;let n=new Df(`sync`),r=t(e,{scheduler:n});return r._dispatcher?.flush(),r._exit??Kl(new Cm(r))}})(Md());Xl(`TimeoutError`),Xl(`IllegalArgumentError`),Xl(`ExceededCapacityError`);var Sm=`~effect/Cause/AsyncFiberError`,Cm=class extends Xl(`AsyncFiberError`){[Sm]=Sm;constructor(e){super({message:`An asynchronous Effect was executed with Effect.runSync`,fiber:e})}},wm=`~effect/Cause/UnknownError`,Tm=class extends Xl(`UnknownError`){[wm]=wm;constructor(e,t){super({message:t,cause:e})}},Em={bold:`1`,red:`31`,green:`32`,yellow:`33`,blue:`34`,cyan:`36`,white:`37`,gray:`90`,black:`30`,bgBrightRed:`101`};Em.gray,Em.blue,Em.green,Em.yellow,Em.red,Em.bgBrightRed,Em.black;var Dm=Pl,Om=Ml,km=Gf,Am=ep;hd()(`effect/Cause/StackTrace`),hd()(`effect/Cause/InterruptorStackTrace`);var jm=Vl,Mm=Wl,Nm=Gl,Pm=Zp,Fm=Xp,Im=`~effect/DateTime`,Lm=`~effect/DateTime/TimeZone`,Rm={[Im]:Im,pipe(){return Ts(this,arguments)},[$c](){return this.toString()},toJSON(){return Bm(this).toJSON()}};({...Rm}),{...Rm};var zm={[Lm]:Lm,[$c](){return this.toString()}};({...zm}),{...zm};var Bm=e=>new Date(e.epochMilliseconds);globalThis.String;var Vm=e=>e.trim(),Hm=_p,Um=xp,Wm=yp,Gm=wp,Km=Tp,qm=Op,Jm=Sp,Ym=Wp,Xm=lm,Zm=em,Qm=cm,$m=bm,eh=xm;hd()(`effect/Effect/Transaction`);var th=Jp,nh=Yp,rh=Kp,ih=Np;hd()(`effect/DateTime/CurrentTimeZone`);var ah=e=>sh(typeof e==`string`?ch.encode(e):e),oh=e=>{let t=lh(e),n=t.length;if(n%4!=0)return Lu(new Nf({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 Lu(new Nf({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=fh(t.charCodeAt(e))<<18|fh(t.charCodeAt(e+1))<<12|fh(t.charCodeAt(e+2))<<6|fh(t.charCodeAt(e+3));r[i]=n>>16,r[i+1]=n>>8&255,r[i+2]=n&255}return Iu(r)}catch(e){return Lu(new Nf({kind:`Decode`,module:`Base64`,input:t,message:e instanceof Error?e.message:`Invalid input`}))}},sh=e=>{let t=e.length,n=``,r;for(r=2;r<t;r+=3)n+=uh[e[r-2]>>2],n+=uh[(e[r-2]&3)<<4|e[r-1]>>4],n+=uh[(e[r-1]&15)<<2|e[r]>>6],n+=uh[e[r]&63];return r===t+1&&(n+=uh[e[r-2]>>2],n+=uh[(e[r-2]&3)<<4],n+=`==`),r===t&&(n+=uh[e[r-2]>>2],n+=uh[(e[r-2]&3)<<4|e[r-1]>>4],n+=uh[(e[r-1]&15)<<2],n+=`=`),n},ch=new TextEncoder,lh=e=>e.replace(/[\n\r]/g,``),uh=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,dh=new Uint8Array(123).fill(255);for(let e=0;e<64;e++)dh[uh.charCodeAt(e)]=e;dh[61]=0;var fh=e=>{if(e>=dh.length||dh[e]===255)throw TypeError(`Invalid character ${String.fromCharCode(e)}`);return dh[e]};jf(`CookiesError`),{...tl},{...tl};var ph=new WeakMap,mh=`~effect/Redacted`,hh=e=>$s(e,mh),gh=(e,t)=>{let n=Object.create(_h);return t?.label&&(n.label=t.label),ph.set(n,e),n},_h={[mh]:{_A:e=>e},label:void 0,...gl,toJSON(){return this.toString()},toString(){return`<redacted${Hs(this.label)?`:`+this.label:``}>`},[ec](){return I(ph.get(this))},[vc](e){return hh(e)&&yc(ph.get(this),ph.get(e))}};({...gl});function vh(e){return e.checks?e.checks[e.checks.length-1].annotations:e.annotations}function yh(e){return t=>vh(t)?.[e]}var bh=`~structural`,xh=`~identifier`,Sh=`~sentinels`,Ch=`~constructor`,wh=[`title`,`description`,`default`,`examples`,`readOnly`,`writeOnly`,`format`,`contentEncoding`,`contentMediaType`,`contentSchema`],Th=yh(`identifier`),Eh=yh(xh),Dh=yh(`title`),Oh=yh(`description`),kh=Fs(e=>{let t=vh(e)?.identifier;return typeof t==`string`?t:e.getExpected(kh)}),Ah=new Set([Sh,bh,`representation`,`arbitraryConstraint`,`toJsonSchema`,`toCode`,`toEquivalence`,`toFormatter`,`toCodec`,`toCodecJson`,`toCodecStringTree`,`toCodecIso`,`toCodecArbitrary`]),z=Symbol(),jh=jm,Mh=jh(z),Nh=jh(z),Ph=e=>e===z?Eu():Du(e),Fh=e=>e._tag===`None`?Mh:jh(e.value),Ih=`~effect/SchemaIssue/Issue`;function Lh(e){return $s(e,Ih)&&e[Ih]===Ih}function Rh(e){return Object.hasOwn(e,`input`)}var zh=class{[Ih]=Ih;constructor(e,t){t?.reportInput===!0&&e!==z&&(this.input=e)}},Bh=class extends zh{_tag=`Filter`;filter;issue;constructor(e,t,n,r){super(n,r),this.filter=e,this.issue=t}},Vh=class extends zh{_tag=`Encoding`;ast;issue;constructor(e,t,n,r){super(n,r),this.ast=e,this.issue=t}},Hh=class extends zh{_tag=`Pointer`;path;issue;constructor(e,t){super(),this.path=e,this.issue=t}},Uh=class extends zh{_tag=`MissingKey`;annotations;constructor(e){super(),this.annotations=e}},Wh=class extends zh{_tag=`UnexpectedKey`;ast;constructor(e,t,n){super(t,n),this.ast=e}},Gh=class extends zh{_tag=`Composite`;ast;issues;constructor(e,t,n,r){super(n,r),this.ast=e,this.issues=t}},Kh=class extends zh{_tag=`InvalidType`;ast;constructor(e,t,n){super(t,n),this.ast=e}},qh=class extends zh{_tag=`InvalidValue`;annotations;constructor(e,t,n){super(t,n),this.annotations=e}},Jh=class extends zh{_tag=`AnyOf`;ast;issues;constructor(e,t,n,r){super(n,r),this.ast=e,this.issues=t}},Yh=class extends zh{_tag=`OneOf`;ast;successes;constructor(e,t,n,r){super(n,r),this.ast=e,this.successes=t}};function Xh(e,t,n){if(Lh(e))return e;if(typeof e==`string`)return new qh({message:e},t,n);let r=typeof e.issue==`string`?new qh({message:e.issue},t,n):e.issue;return new Hh(e.path,r)}function Zh(e,t,n){if(e!==void 0)return typeof e==`boolean`?e?void 0:new qh(void 0,t,n):Xh(e,t,n)}function Qh(e,t,n,r){return Array.isArray(t)?Gu(t)?t.length===1?Xh(t[0],n,r):new Gh(e,qu(t,e=>Xh(e,n,r)),n,r):void 0:Zh(t,n,r)}var $h=e=>{let t=ug(e);if(t!==void 0)return t;switch(e._tag){case`InvalidType`:return ig(kh(e.ast),e);case`InvalidValue`:{let t=rg(e);if(t!==void 0)return ig(t,e);let n=ng(e);return n===void 0?`Expected a valid value`:`Invalid data ${n}`}case`MissingKey`:return`Missing key`;case`UnexpectedKey`:{let t=ng(e);return t===void 0?`Expected no excess property`:`Unexpected key with value ${t}`}case`Forbidden`:return`Forbidden operation`;case`OneOf`:{let t=ng(e);return t===void 0?`Expected exactly one member to match`:`Expected exactly one member to match the input ${t}`}}},eg=e=>ug(e.issue)??ug(e);function tg(e){return t=>({issues:ag(t,[],e?.leafHook??$h,e?.checkHook??eg)})}function ng(e){return Rh(e)?L(e.input):void 0}function rg(e){let t=e.annotations?.expected;return typeof t==`string`?t:void 0}function ig(e,t){let n=ng(t);return n===void 0?`Expected ${e}`:`Expected ${e}, got ${n}`}function ag(e,t,n,r){switch(e._tag){case`Filter`:{let i=r(e);if(i!==void 0)return[{path:t,message:i}];if(e.issue._tag!==`InvalidValue`)return ag(e.issue,t,n,r);let a=rg(e.issue);return[{path:t,message:a===void 0?ig(og(e.filter),e):ig(a,e.issue)}]}case`Encoding`:return ag(e.issue,t,n,r);case`Pointer`:return ag(e.issue,[...t,...e.path],n,r);case`Composite`:return e.issues.flatMap(e=>ag(e,t,n,r));case`AnyOf`:return e.issues.length===0?[{path:t,message:ug(e)??ig(kh(e.ast),e)}]:e.issues.flatMap(e=>ag(e,t,n,r));default:return[{path:t,message:n(e)}]}}function og(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=>og(e)).join(` & `)}}function sg(){return e=>lg(e,``)}var cg=sg();function lg(e,t){let n;switch(e._tag){case`Filter`:{let r=eg(e);if(r!==void 0)n=r;else{if(e.issue._tag!==`InvalidValue`)return lg(e.issue,t);let r=rg(e.issue);n=r===void 0?ig(og(e.filter),e):ig(r,e.issue)}break}case`Encoding`:return lg(e.issue,t);case`Pointer`:return lg(e.issue,t+Kc(e.path));case`Composite`:case`AnyOf`:if(e._tag===`Composite`||e.issues.length>0)return e.issues.map(e=>lg(e,t)).join(`
76
+ `);n=ug(e)??ig(kh(e.ast),e);break;default:n=$h(e)}return t?`${n}\n at ${t}`:n}function ug(e){if(e._tag===`Pointer`)return;if(e._tag===`Encoding`)return ug(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 dg(e){let t;for(let n of e.reasons){if(!Dm(n)||!Lh(n.error))return;t??=n.error}return t}function fg(e,t){let n=dg(e);if(n===void 0)throw Error(t,{cause:e});return n}var pg=e=>Object.assign(Object.create(Es),e),mg=pg({_tag:`Passthrough`});function hg(){return mg}function gg(e){return pg({_tag:`Transform`,transform:e})}function _g(e){return pg({_tag:`TransformEffect`,transform:e})}function vg(){return gg(globalThis.String)}function yg(){return gg(globalThis.Number)}function bg(){return gg(Vm)}function xg(e){return _g((t,n)=>qm({try:()=>JSON.parse(t,e?.reviver),catch:()=>new qh({expected:`a valid JSON string`},t,n)}))}function Sg(e){return _g((t,n)=>qm({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 qh({expected:`a JSON-serializable value`},t,n)}))}function Cg(){return gg(ah)}function wg(){return _g((e,t)=>nh(Jm(oh(e)),()=>new qh({expected:`a valid Base64 string`},e,t)))}var Tg=class extends Ds{_tag=`Middleware`;decode;encode;constructor(e,t){super(),this.decode=e,this.encode=t}flip(){return new Tg(this.encode,this.decode)}},Eg=`~effect/SchemaTransformation/Transformation`,Dg=class extends Ds{[Eg]=Eg;_tag=`Transformation`;decode;encode;constructor(e,t){super(),this.decode=e,this.encode=t}flip(){return new Dg(this.encode,this.decode)}};function Og(e){return $s(e,Eg)&&e[Eg]===Eg}var kg=e=>Og(e)?e:new Dg(e.decode,e.encode);function Ag(){return new Dg(bg(),hg())}var jg=new Dg(hg(),hg());function Mg(){return jg}var Ng=new Dg(yg(),vg()),Pg=new Dg(wg(),Cg());function Fg(e){return new Dg(xg(e??{}),Sg(e))}function Ig(e){return t=>t._tag===e}var Lg=Ig(`Declaration`),Rg=Ig(`Null`),zg=Ig(`Undefined`),Bg=Ig(`Never`),Vg=Ig(`String`),Hg=Ig(`Number`),Ug=Ig(`Boolean`),Wg=Ig(`Literal`),Gg=Ig(`UniqueSymbol`),Kg=Ig(`Arrays`),qg=Ig(`Objects`),Jg=Ig(`Union`),Yg=Ig(`Suspend`),Xg=class{to;transformation;constructor(e,t){this.to=e,this.transformation=t}},Zg={},Qg=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}},$g=`~effect/Schema`,e_=class{[$g]=$g;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}>`}},t_=class extends e_{_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)=>t===z?Mh:(e??=this.run(this.typeParameters))(t,this,n)}_rebuild(e,t,n,r,i){let a=xv(this.typeParameters,e);return a===this.typeParameters&&t===this.checks&&n===this.encodingChecks&&r===this.run&&i===this.encodingRun?this:new t_(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>`}},n_=new class extends e_{_tag=`Null`;getParser(){return zv(this,null)}getExpected(){return`null`}},r_=class extends e_{_tag=`Undefined`;getParser(){return zv(this,void 0)}toCodecJson(){return lv(this,[i_])}getExpected(){return`undefined`}},i_=new Xg(n_,new Dg(gg(()=>void 0),gg(()=>null))),a_=new r_,o_=new class extends e_{_tag=`Unknown`;getParser(){return Bv(this,Xs)}getExpected(){return`unknown`}},s_=class extends e_{_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 ${L(e)}`);this.literal=e}getParser(){return zv(this,this.literal)}matchPart(e,t){return e===globalThis.String(this.literal)?this.literal:void 0}toCodecJson(){return typeof this.literal==`bigint`?c_(this):this}toCodecStringTree(){return typeof this.literal==`string`?this:c_(this)}getExpected(){return typeof this.literal==`string`?JSON.stringify(this.literal):globalThis.String(this.literal)}};function c_(e){let t=globalThis.String(e.literal);return lv(e,[new Xg(new s_(t),new Dg(gg(()=>e.literal),gg(()=>t)))])}var l_=new class extends e_{_tag=`String`;getParser(){return Bv(this,Hs)}matchPart(e,t){let n=this.checks;return n&&!t.disableChecks&&Xv(n,e,void 0,this,t)?void 0:e}getExpected(){return`string`}},u_=class extends e_{_tag=`Number`;getParser(){return Bv(this,Us)}matchKey(e,t){return this._match(Gv,e,t)}matchPart(e,t){return this._match(Wv,e,t)}_match(e,t,n){if(!e.test(t))return;let r=globalThis.Number(t);return n.disableChecks||!this.checks?r:Xv(this.checks,r,void 0,this,n)?void 0:r}toCodecJson(){return this.checks&&(d_(this.checks,`effect/schema/isFinite`)||d_(this.checks,`effect/schema/isInt`))?this:lv(this,[iv])}toCodecStringTree(){return this.toCodecJson()===this?lv(this,[Jv]):lv(this,[Yv])}getExpected(){return`number`}};function d_(e,t){return e.some(e=>e.annotations?.representation?.id===t||e._tag===`FilterGroup`&&d_(e.checks,t))}var f_=new u_,p_=new class extends e_{_tag=`Boolean`;getParser(){return Bv(this,Ws)}getExpected(){return`boolean`}},m_=class extends e_{_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(kv(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(kv(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 Wh(n,t[o],i),a=new Hh([o],r);if(i.errors===`all`)e.issues?e.issues.push(a):e.issues=[a];else return Wm(new Gh(n,[a],t,i))}return e.issues?Wm(new Gh(n,e.issues,t,i)):jh(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:new globalThis.Array(r),issues:void 0,options:t},u=n.rest.length===0?a:Math.max(r,a+o),d=t.concurrency===void 0?1:mm(t.concurrency),f=d===1?__(i,e,0,u):v_(i,e,{concurrency:d,end:u});if(!f)return c(i);if(Gp(f))return rh(f,()=>c(i));let p=!0;return Um(()=>p?(p=!1,Ym(f,()=>c(i))):l(e,t))};return(e,a)=>{if(e===z)return Mh;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)):Wm(new Kh(n,e,a))}catch(e){return Km(e)}}}_rebuild(e,t,n){let r=xv(this.elements,e),i=xv(this.rest,e);return r===this.elements&&i===this.rest&&t===this.checks&&n===this.encodingChecks?this:new m_(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 h_(e,t,n,r){if(n._tag===`Failure`)return y_(e,e.ast,r,n);let i=n===Nh?t:n[R];if(i!==z)e.output[r]=i;else{let t=e.getParser(e.tailThreshold,r);if(kv(t.ast))return;let n=new Hh([r],new Uh(t.ast.context?.annotations));if(e.options.errors===`all`)e.issues?e.issues.push(n):e.issues=[n];else return Nm(new Gh(e.ast,[n],e.input,e.options))}}var g_={onItem(e,t,n){let r=n<e.len?t:z;return e.getParser(e.tailThreshold,n).parser(r,e.options)},step:h_},__=hm()(g_),v_=_m()(g_),y_=(e,t,n,r)=>{if(r.cause.reasons.length===0)return r;let i=dg(r.cause);if(i===void 0)return Mm(km(r.cause,r=>new Gh(t,[new Hh([n],r)],e.input,e.options)));let a=new Hh([n],i);if(e.options.errors===`all`)e.issues?e.issues.push(a):e.issues=[a];else return Nm(new Gh(t,[a],e.input,e.options))},b_=`[+-]?\\d*\\.?\\d+(?:[Ee][+-]?\\d+)?`;function x_(e,t,n=Zg){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(Vv(Fv(t)))}var S_=class{name;type;constructor(e,t){this.name=e,this.type=t}};function C_(e){switch(e._tag){case`String`:case`Number`:case`Symbol`:case`TemplateLiteral`:return!0;case`Union`:return e.types.every(C_);default:return!1}}function w_(e){let t=dv(e);switch(t._tag){case`String`:case`Number`:case`Symbol`:case`TemplateLiteral`:return!0;case`Union`:return t.types.every(w_);default:return!1}}function T_(e){return C_(e)&&w_(e)}var E_=class{parameter;type;constructor(e,t){if(!T_(e))throw Error(`Invalid index signature parameter ${e._tag}`);if(this.parameter=e,this.type=t,kv(t)&&!Rv(t))throw Error("Cannot use `Schema.optionalKey` with index signatures, use `Schema.optional` instead.")}},D_=class extends e_{_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 Bv(n,Ys);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(Vv(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 y_(t,n,i,s)??Pm;let c=s===Nh?o:s[R];if(a!==z&&c!==z){if(r&&(e.has(i)||e.has(typeof a==`number`?globalThis.String(a):a)))return Pm;Fc(t.out,a,c)}return Pm},c=(e,r,i,a)=>{if(!a){let t=i.parserKey(r,e.options);if(!Gp(t))return Ym(Xm(t),t=>c(e,r,i,t));a=t}if(a._tag===`Failure`)return y_(e,n,r,a)??Pm;let o=a===Nh?r:a[R],s=e.input[r],l=i.parserValue(s,e.options);return Gp(l)?t(e,r,o,s,l):Ym(Xm(l),n=>t(e,r,o,s,n))},l=(e,n,r)=>{let i=e.input[n],a=r.parserValue(i,e.options);return Gp(a)?t(e,n,n,i,a):Ym(Xm(a),r=>t(e,n,n,i,r))},u=i?_m()({onItem:(e,[t,n])=>n.is.parameter===l_?l(e,t,n):c(e,t,n),step:(e,t,n)=>n._tag===`Failure`?n:void 0}):void 0;return ih(function*(t,d){if(t===z)return z;if(!(typeof t==`object`&&t&&!Array.isArray(t)))return yield*Wm(new Kh(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:mm(d.concurrency),v=i&&g?n.indexSignatures.map(e=>x_(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 Wh(n,f[a],d),r=new Hh([a],e);if(h){m.issues?m.issues.push(r):m.issues=[r];continue}return yield*Wm(new Gh(n,[r],t,d))}}}if(r){let e=_===1?A_(m,a):j_(m,a,{concurrency:_});e&&(yield*e)}if(i&&_===1)for(let e=0;e<i;e++){let t=o[e],n=t.is.parameter===l_?l:c,r=v?.[e]??(t.is.parameter===l_?Object.keys(f):x_(f,t.is.parameter,d));for(let e=0;e<r.length;e++){let i=n(m,r[e],t);if(!Gp(i))yield*i;else if(i._tag===`Failure`)return yield*i}}else if(u){let e=Ku();for(let t=0;t<i;t++){let n=o[t],r=v?.[t]??(n.is.parameter===l_?Object.keys(f):x_(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*Wm(new Gh(n,m.issues,t,d)):p})};if(i)return c();let l,u=(e,t,n)=>{let r=a[t];return Ym(Xm(n),n=>{let i=O_(e,r,n);if(i)return i;let o=()=>jh(e.out),s=A_(e,a.slice(t+1));return s?rh(s,o):o()})};return(e,t)=>{if(e===z)return Mh;if(t.errors===`all`||t.onExcessProperty!==void 0||t.concurrency!==void 0&&mm(t.concurrency)!==1)return(l??=c())(e,t);if(!(typeof e==`object`&&e&&!Array.isArray(e)))return Wm(new Kh(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=H_(i,s),l=c?i[s]:z,d=n.parser(l,t);if(!Gp(d))return u(o,e,d);if(d===Nh){c&&Fc(a,s,l);continue}let f=O_(o,n,d);if(f)return f}}catch(e){return Km(e)}return jh(a)}}_rebuild(e,t,n,r){let i=xv(this.propertySignatures,t=>{let n=e(t.type);return n===t.type?t:new S_(t.name,n)}),a=xv(this.indexSignatures,n=>{let r=t(n.parameter),i=e(n.type);return r===n.parameter&&i===n.type?n:new E_(r,i)});return i===this.propertySignatures&&a===this.indexSignatures&&n===this.checks&&r===this.encodingChecks?this:new D_(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 O_(e,t,n){if(n._tag===`Failure`)return y_(e,e.ast,t.name,n);if(n===Nh)return;let r=n[R];if(r!==z){Fc(e.out,t.name,r);return}if(delete e.out[t.name],!kv(t.type)){let n=new Hh([t.name],new Uh(t.type.context?.annotations));if(e.options.errors===`all`){e.issues?e.issues.push(n):e.issues=[n];return}return Nm(new Gh(e.ast,[n],e.input,e.options))}}var k_={onItem(e,t){if(!H_(e.input,t.name))return t.parser(z,e.options);let n=e.input[t.name];return Fc(e.out,t.name,n),t.parser(n,e.options)},step:O_},A_=hm()(k_),j_=_m()(k_);function M_(e,t){return e?t?[...e,...t]:e:t}function N_(e,t,n){return new D_(Reflect.ownKeys(e).map(t=>new S_(t,e[t].ast)),[],n,t)}function P_(e){return e.ast}function F_(e,t,n){return new W_(e.map(P_),t,void 0,n)}var I_=Is(e=>{for(;;){if(Yg(e))return o_;let t=e.encoding;if(!t)return e.recur?.(I_,Os)??e;if(t.some(e=>e.transformation._tag===`Middleware`&&e.transformation.decode!==Os))return o_;e=t[t.length-1].to}});function L_(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(L_)));default:return[`null`,`undefined`,`string`,`number`,`boolean`,`symbol`,`bigint`,`object`,`array`,`function`]}}function R_(e){switch(e._tag){default:return[];case`Declaration`:{let t=e.annotations?.[Sh];return Array.isArray(t)?t:[]}case`Objects`:return e.propertySignatures.flatMap(e=>{let t=e.type;if(!kv(t)){if(Wg(t))return[{key:e.name,literal:t.literal}];if(Gg(t))return[{key:e.name,literal:t.symbol}]}return[]});case`Arrays`:return e.elements.flatMap((e,t)=>{if(!kv(e)){if(Wg(e))return[{key:t,literal:e.literal}];if(Gg(e))return[{key:t,literal:e.symbol}]}return[]});case`Union`:{if(e.types.length===0)return[];let t=e.types.map(e=>R_(I_(e)));return t[0].filter(e=>t.every(t=>t.some(t=>t.key===e.key&&t.literal===e.literal)))}case`Suspend`:return R_(e.thunk())}}var z_=new WeakMap,B_=Object.freeze([]),V_=e=>e===null?`null`:Array.isArray(e)?`array`:typeof e,H_=(e,t)=>t===`__proto__`?Object.hasOwn(e,t):t in e;function U_(e){let t=z_.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=I_(c);if(Bg(l))continue;if(Wg(l)||Gg(l)){a??=new Map;let e=Wg(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=R_(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=L_(l);for(let n of e)(i[n]??=[]).push(t)}}let c={},l=e=>c[e]??=Object.freeze(i?.[e]??B_);if(o&&a)a.forEach(Object.freeze),t=e=>a.get(e)??B_;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(Qs(e)){let n=H_(e,r)?e[r]:void 0;if(n!==void 0)return a.get(n)??B_;if(t)return o}return B_}}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=V_(t);if(!Qs(t))return l(a);let o=new Set(i?.[a]),s;if(e){let[n,[i]]=e,c=H_(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=H_(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=H_(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(V_(e));return a?t.filter(t=>s[t]===void 0||s[t]===e):t};return z_.set(e,t),t}var W_=class extends e_{_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===z)return Mh;let i=(o??=U_(n.types))(e,r);if(i.length===0)return Wm(new Jh(n,[],e,t));if(i.length===1){let r=a(i[0])(e,t);return r._tag===`Success`?r:Gp(r)?G_(n,r.cause,e,t):K_(n,r,e,t)}return q_(n,a,i,e,t)}}_rebuild(e,t,n){let r=xv(this.types,e);return r===this.types&&t===this.checks&&n===this.encodingChecks?this:new W_(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=Fv(t);switch(n._tag){case`Arrays`:{let t=n.elements.filter(Wg);if(t.length>0)return`${Z_(n.isMutable)}[ ${t.map(t=>e(t)+Q_(t.context?.isOptional)).join(`, `)}, ... ]`;break}case`Objects`:{let t=n.propertySignatures.filter(e=>Wg(e.type));if(t.length>0)return`{ ${t.map(t=>`${Z_(t.type.context?.isMutable)}${Gc(t.name)}${Q_(t.type.context?.isOptional)}: ${e(t.type)}`).join(`, `)}, ... }`;break}}return e(n)});return Array.from(new Set(n)).join(` | `)}};function G_(e,t,n,r){let i=dg(t);return i?Nm(new Jh(e,[i],n,r)):Mm(t)}function K_(e,t,n,r){return Zm(t,t=>G_(e,t,n,r))}function q_(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=Y_(a,n);if(!o)return a.out?a.out:Wm(new Jh(e,a.issues??[],r,i));if(Gp(o))return J_(o,a);let s=!0;return Um(()=>s?(s=!1,J_(o,a)):q_(e,t,n,r,i))}function J_(e,t){return rh(e,e=>t.out===Nh?Hm(t.input):t.out?t.out:Wm(new Jh(t.ast,t.issues??[],t.input,t.options)))}var Y_=hm()({onItem(e,t){return e.parser(t)(e.input,e.options)},step(e,t,n){if(n._tag===`Failure`){let t=dg(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]),Nm(new Yh(e.ast,e.successes,e.input,e.options));if(e.out=n,e.successes)e.successes.push(e.ast.types[t]);else return Pm}}}),X_=new W_([new s_(`Infinity`),new s_(`-Infinity`),new s_(`NaN`)]);function Z_(e){return e?``:`readonly `}function Q_(e){return e?`?`:``}var $_=class extends Ds{_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 $_(this.run,{...this.annotations,...e},this.aborted)}abort(){return new $_(this.run,this.annotations,!0)}and(e,t){return new ev([this,e],t)}},ev=class extends Ds{_tag=`FilterGroup`;checks;annotations;constructor(e,t=void 0){super(),this.checks=e,this.annotations=t}annotate(e){return new ev(this.checks,{...this.annotations,...e})}and(e,t){return new ev([this,e],t)}};function tv(e,t,n=!1){return new $_((t,n,r)=>Qh(n,e(t,n,r),t,r),t,n)}function nv(e){return tv(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 rv=mv(f_,[nv()]),iv=new Xg(new W_([rv,X_]),new Dg(yg(),gg(e=>globalThis.Number.isFinite(e)?e:globalThis.String(e))));function av(e,t){let n=new globalThis.RegExp(e),r={source:n.source,flags:n.flags};return tv(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 ov=new WeakMap;function sv(e,t){let n=Object.assign(Object.create(Object.getPrototypeOf(e)),e,t);return Reflect.ownKeys(t).every(e=>e===`context`||e===`encoding`)&&ov.set(n,cv(e)),n}function cv(e){let t=ov.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 ov.set(e,n),n}function lv(e,t){return e.encoding===t?e:sv(e,{encoding:t})}function uv(e,t){if(e.context===t)return e;let n=cv(e);return n.context===t&&n.encoding===e.encoding?n:sv(e,{context:t})}function dv(e){return e.encoding?dv(e.encoding[e.encoding.length-1].to):e}function fv(e,t){if(e.checks){let n=e.checks[e.checks.length-1];return pv(e,Uu(e.checks.slice(0,-1),n.annotate(t)))}return sv(e,{annotations:{...e.annotations,...t}})}function pv(e,t){if(e._tag===`Suspend`&&t)throw Error(`Cannot add checks to Suspend`);return e.checks===t?e:sv(e,{checks:t})}function mv(e,t){return pv(e,M_(e.checks,t))}function hv(e,t){let n=t(e.to);return n===e.to?e:new Xg(n,e.transformation)}function gv(e,t){let n=e,r=n[n.length-1],i=hv(r,t);return i===r?e:Uu(e.slice(0,e.length-1),i)}function _v(e){return t=>t.encoding?lv(t,gv(t.encoding,e)):t}function vv(e,t){return _v(e=>uv(e,t))(e)}function yv(e,t){function n(r){if(r.encoding){let e=r.encoding[r.encoding.length-1];return t?.stopAt?.(e)?r:lv(r,gv(r.encoding,n))}return e(r)}return Is(n)}function bv(e,t,n){let r=new Xg(e,t);return lv(n,n.encoding?[...n.encoding,r]:[r])}function xv(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 Sv(e,t){return uv(e,e.context?new Qg(e.context.isOptional,e.context.isMutable,e.context.constructorDefault,{...e.context.annotations,...t}):new Qg(!1,!1,void 0,t))}var Cv=Is(e=>wv(uv(e,e.context?e.context.isOptional===!1?new Qg(!0,e.context.isMutable,e.context.constructorDefault,e.context.annotations):e.context:new Qg(!0,!1)))),wv=_v(Cv),Tv=Fs(e=>Cv(new W_([e,a_])));function Ev(e,t,n){return bv(e,n,t)}function Dv(e){let t=[],n=[];function r(e){switch(e._tag){case`Literal`:Ks(e.literal)&&!t.includes(e.literal)&&t.push(e.literal);return;case`UniqueSymbol`:t.includes(e.symbol)||t.push(e.symbol);return;case`Never`:return;case`Union`:for(let t=0;t<e.types.length;t++)r(e.types[t]);return;default:n.push(e)}}return r(e),{literals:t,parameters:n}}function Ov(e,t){let{literals:n,parameters:r}=Dv(e);return new D_(n.map(e=>new S_(e,t)),r.map(e=>new E_(e,t)))}function kv(e){return e.context?.isOptional??!1}function Av(e){return e.context?.isMutable??!1}function jv(e){return e.annotations?.[`~structural`]===!0||e._tag===`FilterGroup`&&e.checks.every(jv)}function Mv(e){function t(e){return jv(e)?[e]:e._tag===`FilterGroup`?e.checks.flatMap(t):[]}let n=e.flatMap(t);return Wu(n)?n:void 0}function Nv(e){let t=!0;function n(e){return t=t&&!e.encoding&&!Yg(e),t&&`recur`in e&&e.recur(n),e}return`recur`in e&&e.recur(n),t}var Pv=Is(e=>{let t=cv(e);if(t!==e){let n=Pv(t);return n===t&&e.encoding===void 0?e:uv(n,e.context)}let n=`recur`in e?e.recur(Pv):e;if(`encodingChecks`in n&&n.encodingChecks){let t=Nv(e)?n.encodingChecks:Kg(n)||qg(n)||Lg(n)&&n.typeParameters.length>0?Mv(n.encodingChecks):void 0;return sv(n,{encodingChecks:void 0,checks:M_(n.checks,t)})}return n}),Fv=Is(e=>Pv(Lv(e)));function Iv(e,t){let n=t,r=n.length,i=n[r-1],a=[new Xg(Lv(lv(e,void 0)),n[0].transformation.flip())];for(let e=1;e<r;e++)a.unshift(new Xg(Lv(n[e-1].to),n[e].transformation.flip()));let o=Lv(i.to);return o.encoding?lv(o,[...o.encoding,...a]):lv(o,a)}var Lv=Fs(e=>{if(e.encoding)return Iv(e,e.encoding);let t=cv(e);if(t!==e){let n=Lv(t);return n===t?e:uv(n,e.context)}return`flip`in e?e.flip(Lv):`recur`in e?e.recur(Lv):e});function Rv(e){switch(e._tag){case`Undefined`:return!0;case`Union`:return e.types.some(Rv);default:return!1}}function zv(e,t){let n=t===0?Nh:jh(t);return(r,i)=>r===z?Mh:r===t?n:Wm(new Kh(e,r,i))}function Bv(e,t){return(n,r)=>n===z?Mh:t(n)?Nh:Wm(new Kh(e,n,r))}var Vv=yv(e=>{switch(e._tag){default:return e;case`Number`:return e.toCodecStringTree();case`Union`:return e.recur(Vv)}}),Hv=yv(e=>{switch(e._tag){default:return e;case`Symbol`:case`UniqueSymbol`:return e.toCodecStringTree();case`Union`:return e.recur(Hv)}}),Uv=`[\\s\\S]*?`,Wv=new globalThis.RegExp(`^${b_}$`),Gv=new globalThis.RegExp(`^(?:${b_}|Infinity|-Infinity|NaN)$`);function Kv(e){return av(Wv,{expected:`a string representing a finite number`,representation:{id:`effect/schema/isStringFinite`,payload:null},toJsonSchema:()=>({pattern:Wv.source}),...e})}var qv=mv(l_,[Kv()]),Jv=new Xg(qv,Ng),Yv=new Xg(new W_([qv,X_]),Ng);function Xv(e,t,n,r,i){for(let a=0;a<e.length;a++){let o=e[a];if(o._tag===`FilterGroup`){if(n=Xv(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 Bh(o,e,t,i);if(n?n.push(r):n=[r],i.errors!==`all`||o.aborted)return n}}}return n}function Zv(e){if(!Lg(e))return;let t=e.annotations?.[Ch];return qs(t)?t(e.typeParameters):void 0}var Qv=vh,$v=Dh,ey=Oh;function ty(e){return e===null||typeof e==`string`||typeof e==`boolean`||typeof e==`number`&&globalThis.Number.isFinite(e)}function ny(e){return e===void 0||typeof e==`string`}function ry(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 iy(e){return ry(e,ty)}var ay=new t_([],()=>(e,t,n)=>iy(e)?Nh:Wm(new Kh(t,e,n)),{representation:{id:`effect/schema/Json`,payload:null},expected:`JSON value`,toCodecJson:()=>void 0,toCodecStringTree:()=>ly}),oy=new Xg(ay,Mg()),sy=new Xg(new W_([new m_(!1,[],[ay]),new D_([],[new E_(l_,ay)])]),Mg());function cy(e){return ry(e,ny)}var ly=new Xg(new t_([],()=>(e,t,n)=>cy(e)?Nh:Wm(new Kh(t,e,n)),{expected:`StringTree`,toCodecStringTree:()=>void 0}),Mg()),uy=(e,t,n)=>e===Nh?n(t):rh(e,n);function dy(e){if(e._tag===`Middleware`)return(t,n,r)=>fy(t===Nh?e.decode(jh(Ph(n)),r):e.decode(th(t,Ph),r));let t=e.decode;switch(t._tag){case`Passthrough`:return(e,t)=>e===Nh?jh(t):e;case`Transform`:{let e=e=>e===z?Mh:jh(t.transform(e));return(t,n)=>uy(t,n,e)}case`TransformOptional`:{let e=e=>Fh(t.transform(Ph(e)));return(t,n)=>uy(t,n,e)}case`TransformEffect`:return(e,n,r)=>uy(e,n,e=>e===z?Mh:t.transform(e,r));case`TransformOptionalEffect`:return(e,n,r)=>uy(e,n,e=>fy(t.transform(Ph(e),r)))}}var fy=e=>rh(e,Fh),py=(e,t,n,r)=>Zm(r,r=>Gm(()=>km(r,r=>new Vh(e,r,t,n))));function my(e,t){let n=dy(e.link.transformation),r;return(i,a)=>{if(i===z)return Mh;if(e.isConstructed(i))return Nh;let o=(r??=t(e.link.to))(i,a);return n(o,i,a)}}function hy(e,t){let n=e.context.constructorDefault;return(r,i)=>{if(r!==z&&r!==void 0)return t(r,i);let a=n;if(Gp(a)&&a._tag===`Success`){let e=t(a[R],i);return e===Nh?a:e}return rh(py(e,r,i,a),e=>{let n=t(e,i);return n===Nh?jh(e):n})}}function gy(e,t){let n=t(e);return e.context?.constructorDefault===void 0?n:hy(e,n)}function _y(e,t,n,r,i){if(e._tag===`Declaration`)for(let n of e.typeParameters)t(n);let a=n?Zv(e):void 0,o=a?my(a,t):r??e.getParser(t,n),s=e.checks,c=e.encoding,l=c?.map(e=>dy(e.transformation)),u=e.encodingChecks;if(!c&&!s&&!u)return o;let d,f=(t,n)=>{let r=o(t,n);if(u&&!n.disableChecks){if(Gp(r)){if(r._tag===`Success`){let i=r===Nh?t:r[R];if(t!==z&&i!==z){let i=Xv(u,t,void 0,e,n);i&&(r=Wm(new Gh(e,i,t,n)))}}}else r=Ym(r,r=>{if(t!==z&&r!==z){let r=Xv(u,t,void 0,e,n);if(r)return Wm(new Gh(e,r,t,n))}return Hm(r)})}if(s&&!n.disableChecks){if(Gp(r)){if(r._tag===`Success`){let i=r===Nh?t:r[R];if(i===z)return r;let a=Xv(s,i,void 0,e,n);a&&(r=Wm(new Gh(e,a,i,n)))}}else r=Ym(r,t=>{if(t!==z){let r=Xv(s,t,void 0,e,n);if(r)return Wm(new Gh(e,r,t,n))}return Hm(t)})}return r},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[R],o=t(a,r)):o=rh(o,e=>{let n=t(e,r);return n===Nh?jh(e):n})}if(o._tag===`Success`){let e=o[R],t=p(e,r);return t===Nh?o:t}return o=py(e,n,r,o),rh(o,e=>{let t=p(e,r);return t===Nh?jh(e):t})}:p}var vy=Symbol(),yy=new WeakMap,by=e=>wy(e).parser,xy=e=>wy(e).makeEffect,Sy=e=>gy(e,xy),Cy=class{ast;constructor(e){this.ast=e}get decodeEffect(){return this.cachedDecodeEffect??=_y(this.ast,by)}get parser(){return this.decodeEffect}get makeEffect(){return this.cachedMakeEffect??=_y(this.ast,xy,Sy)}};function wy(e){let t=yy.get(e);if(t!==void 0)return t;let n=new Cy(e);return yy.set(e,n),n}function Ty(e){let t=e.ast,n;return(e,r)=>(n??=Ry(Gy,Pv(t)))(e,r?.disableChecks?r?.parseOptions?{...r.parseOptions,disableChecks:!0}:{disableChecks:!0}:r?.parseOptions)}function Ey(e){let t=Ty(e);return(e,n)=>{let r=eh(t(e,n));return Fm(r)?Du(r.value):(fg(r.cause,`Option adapter can only return none for schema issues`),Eu())}}function Dy(e){return Uy(Pv(e.ast))}function Oy(e){return Ay(e.ast)}function ky(e){{let t=zy(Iy(e));return e=>{let n=t(e,Zg);return Fm(n)?!0:(fg(n.cause,`Type guard adapter can only return false for schema issues`),!1)}}}function Ay(e){let t=Pv(e),n=e=>(n=ky(t),n(e));return e=>n(e)}function jy(e,t){let n=Iy(e.ast);return t===void 0?n:(e,r)=>n(e,Py(t,r))}function My(e,t){return By(jy(e,t))}function Ny(e,t){return Vy(jy(e,t))}var Py=(e,t)=>t?{...e,...t}:e,Fy=e=>e===z?Wm(new qh):Hm(e);function Iy(e){return Ry(Wy,e)}function Ly(e,t){return e===Nh?Hm(t):Gp(e)?e[R]===z?Fy(z):e:rh(e,Fy)}function Ry(e,t){let n;return(r,i)=>{let a=(n??=e(t))(r,i??Zg);return a===Nh?Hm(r):Gp(a)?a[R]===z?Fy(z):a:rh(a,Fy)}}function zy(e){return(t,n)=>eh(e(t,n))}function By(e){let t=zy(e);return(e,n)=>{let r=t(e,n);return Fm(r)?Du(r.value):(fg(r.cause,`Option adapter can only return none for schema issues`),Eu())}}function Vy(e){let t=zy(e);return(e,n)=>{let r=t(e,n);return Fm(r)?Iu(r.value):Lu(fg(r.cause,`Result adapter can only return schema issues`))}}function Hy(e,t){let n=eh(e);if(Fm(n))return n.value;let r=fg(n.cause,t);throw Error(`Schema validation failed`,{cause:r})}function Uy(e){let t,n;return(r,i)=>{t??=wy(e);let a=i?.disableChecks?i.parseOptions?{...i.parseOptions,disableChecks:!0}:{disableChecks:!0}:i?.parseOptions??Zg,o=t.make;if(o!==void 0&&r!==z){let e;try{e=o(r,a)}catch(e){throw fg(Om(e),`Constructor adapter can only throw schema issues`),e}if(e!==vy&&e!==z)return e}return Hy(Ly((n??=t.makeEffect)(r,a),r),`Constructor adapter can only throw schema issues`)}}var Wy=e=>wy(e).parser,Gy=e=>wy(e).makeEffect,Ky=`~effect/Schema/Schema`,qy=Symbol(),Jy={[Ky]:Ky,get make(){let e=Dy(this);return Object.defineProperty(this,"make",{value:e,enumerable:!0}),e},get makeEffect(){let e=Ty(this);return Object.defineProperty(this,"makeEffect",{value:e,enumerable:!0}),e},get makeOption(){let e=Ey(this);return Object.defineProperty(this,"makeOption",{value:e,enumerable:!0}),e},pipe(){return Ts(this,arguments)},annotate(e){return this.rebuild(fv(this.ast,e))},annotateKey(e){return this.rebuild(Sv(this.ast,e))},check(...e){return this.rebuild(mv(this.ast,e))},rebuild(e){return Yy(e,this[qy])}};function Yy(e,t){function n(){}let r=Object.setPrototypeOf(n,Jy);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[qy]=t,r.ast=e,r}function Xy(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function Zy(e){return e.replace(/~1/g,`/`).replace(/~0/g,`~`)}function Qy(e){return encodeURI(Xy(e)).replace(/#/g,`%23`)}function $y(e){if(e.length===0||e===`#`)return``;if(!e.startsWith(`#`))return;let t=e.slice(1);try{if(encodeURI(t).replace(/%25/g,`%`).replace(/#/g,`%23`)!==t)return;let e=decodeURIComponent(t);return e.startsWith(`/`)&&!/~(?:[^01]|$)/.test(e)?e:void 0}catch{return}}function eb(e,t){return n(e,!1,!0);function n(e,r,i=!1){if(!Zs(e))return e;let a=r||!i&&ib(e.$id),o={};for(let t of Object.keys(e)){let r=e[t],i=r;switch(t){case`$defs`:case`properties`:case`patternProperties`:case`dependentSchemas`:i=rb(r,e=>n(e,a))??r;break;case`allOf`:case`anyOf`:case`oneOf`:case`prefixItems`:i=Array.isArray(r)?r.map(e=>n(e,a)):r;break;case`not`:case`additionalProperties`:case`propertyNames`:case`unevaluatedProperties`:case`items`:case`contains`:case`unevaluatedItems`:case`if`:case`then`:case`else`:case`contentSchema`:i=n(r,a)}Fc(o,t,i)}return t(o,a),o}}function tb(e,t){return eb(e,e=>{nb(e,t)})}function nb(e,t){typeof e.$ref==`string`&&Fc(e,`$ref`,t(e.$ref,`$ref`)),typeof e.$dynamicRef==`string`&&Fc(e,`$dynamicRef`,t(e.$dynamicRef,`$dynamicRef`))}function rb(e,t){if(!Zs(e))return;let n={};for(let r of Object.keys(e))Fc(n,r,t(e[r],r));return n}function ib(e){return typeof e==`string`&&e.length>0&&e[0]!==`#`}var ab=[`$anchor`,`$defs`,`$dynamicAnchor`,`$dynamicRef`,`$vocabulary`,`contentSchema`,`dependentRequired`,`dependentSchemas`,`maxContains`,`minContains`,`prefixItems`,`unevaluatedItems`,`unevaluatedProperties`];[...ab],[...ab];var ob=yv(e=>{let t=db(e,ob),n=e.context;return t===e||n===void 0?t:vv(t,sb(n))});function sb(e){return e.constructorDefault===void 0?e:new Qg(e.isOptional,e.isMutable,void 0,e.annotations)}function cb(e){if(e.propertySignatures.some(e=>typeof e.name!=`string`))throw new globalThis.Error(`Objects property names must be strings`,{cause:e})}function lb(e){return t=>{let n=[...t].sort((t,n)=>e(Fv(t))-e(Fv(n)));return n.some((e,n)=>e!==t[n])?n:t}}var ub=lb(e=>{switch(e._tag){case`BigInt`:case`Symbol`:case`UniqueSymbol`:return 0;default:return 1}});function db(e,t){switch(e._tag){case`Declaration`:{let n=e.annotations?.toCodecJson??e.annotations?.toCodec;if(!qs(n))return lv(e,[oy]);let r=n(e.typeParameters.map(e=>Yy(Fv(e))));return r===void 0?e:lv(e,[hv(r,t)])}case`Unknown`:return lv(e,[oy]);case`ObjectKeyword`:return lv(e,[sy]);case`Undefined`:case`Void`:case`Literal`:case`Number`:return e.toCodecJson();case`UniqueSymbol`:case`Symbol`:case`BigInt`:return e.toCodecStringTree();case`Objects`:return cb(e),e.recur(t,Hv);case`Union`:{let n=ub(e.types);return n===e.types?e.recur(t):new W_(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}globalThis.RegExp;var fb=e=>e.replace(/[/\\^$*+?.()|[\]{}]/g,`\\$&`);function pb(e,t){return t.length>0&&(e+=`\n at ${Kc(t)}`),Error(e)}function mb(e){return`#/$defs/${Qy(e)}`}var hb=new Set([...Ah,xh,...wh]);function gb(e,t){if(e===void 0)return;let n={},r=e.title;typeof r==`string`&&(n.title=r);let i=e.description,a=e.expected;typeof i==`string`?n.description=i:t?.generateDescriptions===!0&&typeof a==`string`&&(n.description=a);let o=e.default;iy(o)&&(n.default=o);let s=e.examples;Array.isArray(s)&&iy(s)&&(n.examples=s);let c=e.readOnly;typeof c==`boolean`&&(n.readOnly=c);let l=e.writeOnly;typeof l==`boolean`&&(n.writeOnly=l);let u=e.format;typeof u==`string`&&(n.format=u);let d=e.contentEncoding;typeof d==`string`&&(n.contentEncoding=d);let f=e.contentMediaType;typeof f==`string`&&(n.contentMediaType=f);let p=e.contentSchema;if(iy(p)&&(n.contentSchema=p),t?.includeAnnotationKey!==void 0)for(let[r,i]of Object.entries(e))hb.has(r)||!t.includeAnnotationKey(r)||iy(i)&&Fc(n,r,i);return Object.keys(n).length===0?void 0:n}function _b(e){let t=e.type===`number`||e.type===`integer`?e.type:void 0,n=e;if(t!==void 0&&(n={...e},delete n.type),Array.isArray(n.allOf)){let e=[],r=!1;for(let i of n.allOf){let n=_b(i);n.type!==void 0&&(r=!0,(t===void 0||n.type===`integer`)&&(t=n.type)),Object.keys(n.schema).length>0&&e.push(n.schema)}if(r){let{allOf:t,...r}=n;n=e.length===0?r:{...r,allOf:e}}}return{type:t,schema:n}}function vb(e){if(!Array.isArray(e.anyOf)||e.anyOf.length!==2||e.anyOf[0]?.type!==`number`)return!1;let t=e.anyOf[1];return t?.type===`string`&&Array.isArray(t.enum)&&t.enum.length===3&&t.enum.includes(`NaN`)&&t.enum.includes(`Infinity`)&&t.enum.includes(`-Infinity`)}var yb=`|type|format|pattern|multipleOf|minimum|maximum|exclusiveMinimum|exclusiveMaximum|minLength|maxLength|minItems|maxItems|uniqueItems|minProperties|maxProperties|propertyNames|`;function bb(e,t){return Object.keys(e).every(e=>t.includes(`|${e}|`))}function xb(e,t){return typeof e.$ref!=`string`&&t.every(t=>!Object.hasOwn(e,t))}var Sb=`|title|description|default|examples|readOnly|writeOnly|`,Cb=yb+Sb;function wb(e,t,n){if(Object.keys(e).length===0)return t;let r=Object.keys(t);if(r.length===0)return e;let i=e.type===`number`||e.type===`integer`?e.type:void 0,a=vb(e);if(i!==void 0||a){let r=_b(t);if(r.type!==void 0){let t=i===`integer`||r.type===`integer`?`integer`:`number`,o={...e,type:t};a&&delete o.anyOf;let s=Object.keys(r.schema);return s.length===0?o:bb(r.schema,Sb)&&xb(o,s)?{...o,...r.schema}:wb(o,r.schema,n)}}if(n&&xb(e,r))return{...e,...t};let o=Array.isArray(t.allOf)&&r.length===1?t.allOf:[t];return Array.isArray(e.allOf)?{...e,allOf:[...e.allOf,...o]}:typeof e.$ref==`string`?{allOf:[e,...o]}:{...e,allOf:o}}function Tb(e,t=new Set){return typeof e==`boolean`?e:t.has(e)?!0:(t.add(e),e.every(e=>Tb(e,t)))}function Eb(e){return Array.isArray(e)}function Db(e,t,n,r){let i=new Map,a=new Map,o=new WeakMap,s=new Map,c=new Map,l=Object.keys(n);for(let e of l)m(e,[`references`,e]);let u=qu(e,(e,n)=>v(e,t[n],[]));for(let[e,t]of s.values())if(!Tb(e))for(let e of t)Array.isArray(e.oneOf)&&(e.anyOf=e.oneOf,delete e.oneOf);for(let e of l){let t=n[e],r=g(t);if(r===void 0)continue;let o=i.get(e)[0],s=c.get(r),l=s?.find(e=>yc(i.get(e)[0],o));l===void 0?s===void 0?c.set(r,[e]):s.push(e):a.set(e,l)}let d=qu(u,h),f={};for(let e of l)a.has(e)||Fc(f,e,h(i.get(e)[0]));return{dialect:`draft-2020-12`,schemas:d,definitions:f};function p(e){return Array.isArray(e.oneOf)&&s.get(e.oneOf)?.[1].push(e),e}function m(e,t){if(!Object.hasOwn(n,e))throw pb(`Invalid reference ${e}`,[...t,`$ref`]);let r=i.get(e);if(r!==void 0)return r;let a=[{},[]];return i.set(e,a),a[0]=v(n[e],[`references`,e],a[1]),a}function h(e){return tb(e,e=>{let t=$y(e);if(t===void 0){if(/^#(?:\/|%2f)/i.test(e))throw Error(`Invalid JSON Pointer URI fragment ${JSON.stringify(e)}`);return e}if(!t.startsWith(`/$defs/`))return e;let n=t.indexOf(`/`,7),r=a.get(Zy(t.slice(7,n<0?void 0:n)));return r===void 0?e:e.replace(/^#(?:\/|%2f).*?(?:\/|%2f).*?(?=\/|%2f|$)/i,mb(r))})}function g(e){if(e._tag===`Reference`)return;let t=e.checks.length===0?e.annotations:e.checks[e.checks.length-1].annotations;return typeof t?.identifier!=`string`&&typeof t?.[`~identifier`]==`string`?t[xh]:void 0}function _(e,t,n,i){let a=e.annotations,o=a?.toJsonSchema;if(o!==void 0){let s=o({type:t,schemas:e.representation?.schemas?.map((e,t)=>v(e,[...n,`representation`,`schemas`,t],i))??[]}),c=Eb(s);c&&i.push(!1);let l=c?s[0]:s,u=gb(a,r),d=u===void 0?l:{...l,...u},f=u===void 0?yb:Cb;return[d,e._tag===`Filter`&&bb(d,f)&&(u===void 0||bb(u,Sb))?!0:void 0]}if(e._tag===`Filter`){i.push(!1);return}let s=e.checks.flatMap((e,r)=>{let a=_(e,t,[...n,`checks`,r],i);return a===void 0?[]:[a[0]]});if(s.length===0)return;let c=gb(a,r),l={allOf:s};return[c===void 0?l:{...l,...c}]}function v(e,t,n){if(e._tag===`Reference`)return n.push(m(e.$ref,t)[1]),{$ref:mb(e.$ref)};let i=o.get(e);if(i!==void 0)return n.push(i[1]),i[0];let a=[];n.push(a);let s=y(e,t,a),c=gb(e.annotations,r);c!==void 0&&(s={...s,...c});for(let n=0;n<e.checks.length;n++){let r=typeof s.type==`string`&&Ob(s.type)?s.type:void 0,i=_(e.checks[n],r,[...t,`checks`,n],a);i!==void 0&&(s=wb(s,...i))}return o.set(e,[s,a]),p(s)}function y(e,t,n){switch(e._tag){case`Any`:case`Unknown`:return{};case`ObjectKeyword`:return{anyOf:[{type:`object`},{type:`array`}]};case`Void`:case`Undefined`:case`Null`:return{type:`null`};case`BigInt`:return{type:`string`,allOf:[{pattern:`^-?\\d+$`}]};case`Symbol`:return{type:`string`,allOf:[{pattern:`^Symbol\\(([\\s\\S]*)\\)$`}]};case`UniqueSymbol`:return globalThis.Symbol.keyFor(e.symbol)===void 0?{not:{}}:{type:`string`,enum:[globalThis.String(e.symbol)]};case`Declaration`:return n.push(!1),{};case`Suspend`:return v(e.thunk,[...t,`thunk`],n);case`Never`:return{not:{}};case`String`:return{type:`string`};case`Number`:return{anyOf:[{type:`number`},{type:`string`,enum:[`NaN`,`Infinity`,`-Infinity`]}]};case`Boolean`:return{type:`boolean`};case`Literal`:{let t=e.literal;return typeof t==`bigint`?{type:`string`,enum:[globalThis.String(t)]}:{type:typeof t,enum:[t]}}case`Enum`:{let n=e.enums.map(([e,n],r)=>{if(typeof n==`number`&&!globalThis.Number.isFinite(n))throw pb(`Invalid numeric enum value ${globalThis.String(n)}`,[...t,`enums`,r,1]);return{type:typeof n,enum:[n],title:e}});return n.length===0?{not:{}}:{anyOf:n}}case`TemplateLiteral`:return{type:`string`,pattern:`^${e.parts.map(Ab).join(``)}$`};case`Arrays`:{if(e.rest.length>1)throw pb(`Invalid schema representation document`,[...t,`rest`]);let i={type:`array`},a=e.elements.length,o=e.elements.map((e,i)=>{e.isOptional&&a--;let o=v(e.type,[...t,`elements`,i,`type`],n),s=gb(e.annotations,r);return s===void 0?o:p(wb(o,s))});if(o.length>0?(i.prefixItems=o,i.maxItems=e.elements.length,a>0&&(i.minItems=a)):i.items=!1,e.rest.length===1){delete i.maxItems;let r=v(e.rest[0],[...t,`rest`,0],n);Object.keys(r).length>0?i.items=r:delete i.items}return i}case`Objects`:{if(e.propertySignatures.length===0&&e.indexSignatures.length===0)return{not:{type:`null`}};let i={type:`object`},a={},o=[];for(let i=0;i<e.propertySignatures.length;i++){let s=e.propertySignatures[i];if(typeof s.name!=`string`)throw pb(`Invalid schema representation document`,[...t,`propertySignatures`,i,`name`]);let c=s.name,l=v(s.type,[...t,`propertySignatures`,i,`type`],n),u=gb(s.annotations,r);Fc(a,c,u===void 0?l:p(wb(l,u))),s.isOptional||o.push(c)}e.propertySignatures.length>0&&(i.properties=a),o.length>0&&(i.required=o);let s={},c=[],l=[],u=!1;for(let r=0;r<e.indexSignatures.length;r++){let i=e.indexSignatures[r],a=v(i.type,[...t,`indexSignatures`,r,`type`],n);yc(a,{not:{}})&&(a=!1),l.push(a);let o=b(i.parameter,[...t,`indexSignatures`,r,`parameter`],new Set);if(o===void 0){u=!0,n.push(!1);continue}if(o.length===0)c.push(a);else for(let e of o){let t=s[e];Fc(s,e,t===void 0?a:t===!1||a===!1?!1:p(wb(t,a)))}}let d=Object.keys(s).length>0;if(d&&(i.patternProperties=s),u&&r?.onExcessProperty===`error`){let r=[];e.propertySignatures.length>0&&r.push({enum:Object.keys(a)});for(let i=0;i<e.indexSignatures.length;i++)r.push(v(e.indexSignatures[i].parameter,[...t,`indexSignatures`,i,`parameter`],n));i.propertyNames=r.length===1?r[0]:{anyOf:r},i.additionalProperties=l.length===1?l[0]:{anyOf:l},c.length>0&&(i.allOf=c.map(e=>({type:`object`,additionalProperties:e})))}else c.length===0?i.additionalProperties=u||r?.onExcessProperty!==`error`:c.length===1&&e.propertySignatures.length===0&&!d?i.additionalProperties=c[0]:c.length>0&&(i.allOf=c.map(e=>({type:`object`,additionalProperties:e})));return typeof i.additionalProperties==`object`&&i.additionalProperties!==null&&Object.keys(i.additionalProperties).length===0&&delete i.additionalProperties,i}case`Union`:{let r=[],i=e.types.map((e,n)=>v(e,[...t,`types`,n],r));if(n.push(r),i.length===0)return{not:{}};let a=e.options?.mode??`anyOf`;if(a===`anyOf`&&i.length>1){let e=kb(i);if(e!==void 0)return e}return a===`oneOf`&&s.set(i,[r,[]]),{[a]:i}}}}function b(e,t,r){switch(e._tag){case`Reference`:{if(!Object.hasOwn(n,e.$ref))throw pb(`Invalid reference ${e.$ref}`,[...t,`$ref`]);if(m(e.$ref,t),r.has(e.$ref))return;let i=new Set(r).add(e.$ref);return b(n[e.$ref],[`references`,e.$ref],i)}case`String`:{if(e.checks.length===0)return[];if(e.checks.length!==1||e.checks[0]._tag!==`Filter`||e.checks[0].annotations?.toJsonSchema===void 0)return;let n=[],r=v(e,t,n);return Tb(n)&&r.type===`string`&&typeof r.pattern==`string`&&bb(r,`|type|pattern|title|description|default|examples|readOnly|writeOnly|`)?[r.pattern]:void 0}case`TemplateLiteral`:return e.checks.length===0?[`^${e.parts.map(Ab).join(``)}$`]:void 0;case`Union`:{if(e.types.length===0||e.checks.length>0||e.options?.mode===`oneOf`)return;let n=[];for(let i=0;i<e.types.length;i++){let a=b(e.types[i],[...t,`types`,i],r);if(a===void 0)return;if(a.length===0)return[];n.push(...a)}return n}default:throw pb(`Invalid schema representation document`,t)}}}function Ob(e){return e===`string`||e===`number`||e===`boolean`||e===`array`||e===`object`||e===`null`||e===`integer`}function kb(e){let t,n=[];for(let r of e){if(Object.keys(r).length!==2||r.type===void 0||!Array.isArray(r.enum)||r.enum.length===0)return;if(t===void 0)t=r.type;else if(r.type!==t)return;for(let e of r.enum){if(n.includes(e))return;n.push(e)}}return{type:t,enum:n}}function Ab(e){switch(e._tag){case`Literal`:return fb(globalThis.String(e.literal));case`String`:return Uv;case`Number`:return b_;case`TemplateLiteral`:return e.parts.map(Ab).join(``);case`Union`:return`(?:${e.types.map(Ab).join(`|`)})`;default:throw pb(`Invalid schema representation document`,[])}}function jb(e,t){let n=Db([e.representation],[[`representation`]],e.references,t);return{dialect:n.dialect,schema:n.schemas[0],definitions:n.definitions}}var Mb=({identifier:e})=>e;function Nb(e){return e===void 0?void 0:{annotations:e}}function Pb(e,t){let{references:n,representations:r}=Fb([e],t);return{representation:r[0],references:n}}function Fb(e,t){let n={},r=new Map,i=new Set,a=new Map,o=new Set;for(let t of e)f(t);let s=t?.referencePolicy??Mb;for(let e of a.values())for(let t of e.values()){let e=s({ast:t.ast,occurrences:t.occurrences,identifier:t.identifier});e===void 0?t.isRecursive&&(t.reference=c(`${t.ast._tag}_`,t,``)):t.reference=c(e,t,e===t.identifier||!e.endsWith(`_`)?`_`:``)}return{representations:qu(e,e=>m(e)),references:n};function c(e,t,n=`_`){let i=e,a=0;for(;r.has(i);){if(r.get(i)===t)return i;i=`${e}${n}${++a}`}return r.set(i,t),i}function l(e,t,n){let r=t.fallback;return r===void 0?n===t.identifier?e:fv(e,{identifier:n}):Eh(e)===r?e:fv(e,{[xh]:r})}function u(e,t){if(!Object.hasOwn(n,e)&&!i.has(e)){i.add(e);let r=h(t);i.delete(e),Fc(n,e,r)}return{_tag:`Reference`,$ref:e}}function d(e){let t=dv(e),n=cv(t),r=Th(t),i=r===void 0?(t===e?void 0:Th(e))??Eh(t):void 0;i!==void 0&&(r=`${i}Encoded`);let o=a.get(n);o===void 0&&(o=new Map,a.set(n,o));let s=o.get(r);return s===void 0&&(s={ast:n,identifier:r,fallback:i,occurrences:0,isRecursive:!1,reference:void 0},o.set(r,s)),s}function f(e){let t=d(e),n=t.ast;if(t.occurrences++,o.has(t)){t.isRecursive=!0;return}if(!(t.occurrences>1)){switch(o.add(t),p(n.checks),n._tag){case`Declaration`:case`Arrays`:case`Objects`:case`Union`:n.recur(e=>(f(e),e));break;case`TemplateLiteral`:n.parts.forEach(f);break;case`Suspend`:f(n.thunk())}o.delete(t)}}function p(e){e?.forEach(e=>{e.annotations?.representation?.schemas?.forEach(e=>f(Pv(e))),e._tag===`FilterGroup`&&p(e.checks)})}function m(e){let t=d(e),n=t.ast,r=t.reference;return r===void 0?h(n):u(r,t.identifier===void 0?n:l(n,t,r))}function h(e){let t=g(e.checks);switch(e._tag){case`Declaration`:return{_tag:`Declaration`,typeParameters:e.typeParameters.map(e=>m(e)),checks:t,...v(e.annotations)};case`Null`:case`Undefined`:case`Void`:case`Never`:case`Unknown`:case`Any`:case`String`:case`Boolean`:case`Number`:case`BigInt`:case`Symbol`:case`ObjectKeyword`:return{_tag:e._tag,checks:t,...Nb(e.annotations)};case`Literal`:return{_tag:`Literal`,literal:e.literal,checks:t,...Nb(e.annotations)};case`UniqueSymbol`:return{_tag:`UniqueSymbol`,symbol:e.symbol,checks:t,...Nb(e.annotations)};case`Enum`:return{_tag:`Enum`,enums:e.enums,checks:t,...Nb(e.annotations)};case`TemplateLiteral`:return{_tag:`TemplateLiteral`,parts:e.parts.map(e=>m(e)),checks:t,...Nb(e.annotations)};case`Arrays`:return{_tag:`Arrays`,elements:e.elements.map(e=>{let t=dv(e),n=t.context?.annotations;return{isOptional:kv(t),type:m(e),...Nb(n)}}),rest:e.rest.map(e=>m(e)),checks:t,...Nb(e.annotations)};case`Objects`:return{_tag:`Objects`,propertySignatures:e.propertySignatures.map(e=>{let t=dv(e.type),n=t.context?.annotations;return{name:e.name,type:m(e.type),isOptional:kv(t),isMutable:Av(t),...Nb(n)}}),indexSignatures:e.indexSignatures.map(e=>({parameter:m(e.parameter),type:m(e.type)})),checks:t,...Nb(e.annotations)};case`Union`:return{_tag:`Union`,types:e.types.map(e=>m(e)),...e.options===void 0?{}:{options:e.options},checks:t,...Nb(e.annotations)};case`Suspend`:return{_tag:`Suspend`,checks:[],thunk:m(e.thunk()),...Nb(e.annotations)}}}function g(e){return e?.map(_)??[]}function _(e){switch(e._tag){case`Filter`:return{_tag:`Filter`,aborted:e.aborted,...y(e.annotations)};case`FilterGroup`:return{_tag:`FilterGroup`,checks:qu(e.checks,_),...y(e.annotations)}}}function v(e){if(e===void 0)return;let{representation:t,...n}=e;return{...t===void 0?void 0:{representation:t},...Object.keys(n).length===0?void 0:{annotations:n}}}function y(e){if(e===void 0)return;let{representation:t,...n}=e,r=t===void 0?void 0:t.schemas===void 0?t:{...t,schemas:t.schemas.map(e=>m(Pv(e)))};return{...r===void 0?void 0:{representation:r},...Object.keys(n).length===0?void 0:{annotations:n}}}}function Ib(e){return Fm(e)?e.value:{issues:[{message:Am(e.cause)}]}}function Lb(e,t){let n=jy(e),r={errors:`all`,...t?.parseOptions},i=tg(t),a=e=>{let t=new Df(`sync`),a=$m(Qm(n(e,r),{onFailure:i,onSuccess:e=>({value:e})}),{scheduler:t});a.currentDispatcher?.flush();let o=a.pollUnsafe();return o?Ib(o):new Promise(e=>{a.addObserver(t=>{e(Ib(t))})})};if(Object.hasOwn(e,`~standard`)){let t=e;return`validate`in t[`~standard`]||Object.assign(t[`~standard`],{validate:a}),t}return Object.assign(e,{"~standard":{version:1,vendor:`effect`,validate:a}})}var Rb=e=>e,zb=`~effect/Schema/SchemaError`;function Bb(e){return $s(e,`~effect/Schema/SchemaError`)&&e[`~effect/Schema/SchemaError`]===`~effect/Schema/SchemaError`}function Vb(){return(e,t,n)=>tx(new t_(e.map(P_),e=>t(e.map(e=>tx(e))),n))}function Hb(e,t){return Vb()([],()=>(t,n,r)=>e(t)?Hm(t):Wm(new Kh(n,t,r)),t)}var Ub=class extends jf(`SchemaError`){[zb]=zb;constructor(e){let t=rl();il(0);try{super({issue:e})}finally{il(t)}}get message(){return cg(this.issue)}toString(){return`SchemaError(${this.message})`}};function Wb(e){return Bb(e)}function Gb(e){return Gp(e)?Kb(e):Zm(e,e=>Gm(()=>km(e,e=>new Ub(e))))}function Kb(e){return Fm(e)?e:Mm(km(e.cause,e=>new Ub(e)))}function qb(e,t){let n;for(let r of e.reasons){if(!Dm(r)||!Wb(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 Jb(e){let t=eh(e);if(Fm(t))return t.value;throw qb(t.cause,`Sync adapter can only throw schema errors`)}function Yb(e,t){return Lb(e,t)}var Xb=Oy;function Zb(e,t){let n=jy(e,t);return(e,t)=>Gb(n(e,t))}var Qb=My;function $b(e,t){let n=Ny(e,t);return(e,t)=>Bu(n(e,t),e=>new Ub(e))}function ex(e,t){let n=Zb(e,t);return(e,t)=>Jb(n(e,t))}var tx=Yy,nx=Rb(e=>tx(Cv(e.ast),{schema:e})),B=Rb(e=>{let t=fx(e);return tx(Tv(e.ast),{schema:t})});function V(e){let t=tx(new s_(e),{literal:e,transform(n){return t.pipe(mx(V(n),{decode:gg(()=>n),encode:gg(()=>e)}))}});return t}var H=tx(o_),rx=tx(n_),ix=tx(a_),ax=tx(l_),ox=tx(f_),U=tx(p_);function sx(e,t){return tx(e,{fields:t,mapFields(e,t){let n=e(this.fields);return sx(N_(n,t?.unsafePreserveChecks?this.ast.checks:void 0),n)}})}function W(e){return sx(N_(e,void 0),e)}function cx(e,t){return tx(Ov(e.ast,t.ast),{key:e,value:t})}var G=Rb(e=>tx(new m_(!1,[],[e.ast]),{value:e}));function lx(e,t){return tx(e,{members:t,mapMembers(e,t){let n=e(this.members);return lx(F_(n,this.ast.options,t?.unsafePreserveChecks?this.ast.checks:void 0),n)}})}function ux(e,t){return lx(F_(e,t,void 0),e)}function K(e){let t=e.map(V);return tx(F_(t,void 0,void 0),{literals:e,members:t,mapMembers(e){return ux(e(this.members))},pick(e){return K(e)},transform(e){return ux(t.map((t,n)=>t.transform(e[n])))}})}var dx=Rb(e=>ux([e,rx])),fx=Rb(e=>ux([e,ix]));function q(...e){return t=>t.check(...e)}function px(e){return t=>tx(t.ast,{schema:t,identifier:e})}function mx(e,t){return n=>tx(Ev(n.ast,e.ast,t?kg(t):Mg()),{from:n,to:e})}function hx(e,t){return Hb(t=>t instanceof e,t)}function gx(){return(e,t)=>new Xg(e.ast,kg(t))}var _x=tv,vx=`^\\S[\\s\\S]*\\S$|^\\S$|^$`;function yx(e){let t=new globalThis.RegExp(vx);return _x(e=>e.trim()===e,{expected:`a string with no leading or trailing whitespace`,representation:{id:`effect/schema/isTrimmed`,payload:null},toJsonSchema:()=>({pattern:t.source}),toCode:()=>({runtime:`Schema.isTrimmed()`}),arbitraryConstraint:{patterns:[{source:vx,flags:``}]},...e})}function bx(e,t){let n=e.source,r=e.flags,i=/^[dg]*uy?$/.test(r),a=r===``?`new RegExp(${L(n)})`:`new RegExp(${L(n)}, ${L(r)})`;return av(e,{toJsonSchema:()=>i?{pattern:r.endsWith(`y`)?`^(?:${n})`:n}:[{},!0],toCode:()=>({runtime:`Schema.isPattern(${a})`}),...t})}var xx=tx(rv);function Sx(e){let t=Cu(e.order),n=e.formatter??L;return(r,i)=>_x(e=>t(e,r),{expected:`a value greater than ${n(r)}`,arbitraryConstraint:{order:e.order,minimum:r,exclusiveMinimum:!0},...e.annotate?.(r),...i})}function Cx(e){let t=Tu(e.order),n=e.formatter??L;return(r,i)=>_x(e=>t(e,r),{expected:`a value greater than or equal to ${n(r)}`,arbitraryConstraint:{order:e.order,minimum:r},...e.annotate?.(r),...i})}function wx(e){let t=wu(e.order),n=e.formatter??L;return(r,i)=>_x(e=>t(e,r),{expected:`a value less than or equal to ${n(r)}`,arbitraryConstraint:{order:e.order,maximum:r},...e.annotate?.(r),...i})}function Tx(e){let t=Tu(e.order),n=Cu(e.order),r=wu(e.order),i=Su(e.order),a=e.formatter??L;return(o,s)=>{let c=o.exclusiveMinimum?n:t,l=o.exclusiveMaximum?i:r;return _x(e=>c(e,o.minimum)&&l(e,o.maximum),{expected:`a value between ${a(o.minimum)}${o.exclusiveMinimum?` (excluded)`:``} and ${a(o.maximum)}${o.exclusiveMaximum?` (excluded)`:``}`,arbitraryConstraint:{order:e.order,minimum:o.minimum,maximum:o.maximum,...o.exclusiveMinimum&&{exclusiveMinimum:!0},...o.exclusiveMaximum&&{exclusiveMaximum:!0}},...e.annotate?.(o),...s})}}function Ex(e){if(!globalThis.Number.isFinite(e))throw new globalThis.RangeError(`Expected a finite number, got ${L(e)}`);return e}var Dx=Sx({order:xu,annotate:e=>({representation:{id:`effect/schema/isGreaterThan`,payload:{exclusiveMinimum:Ex(e)}},toJsonSchema:()=>({exclusiveMinimum:e}),toCode:()=>({runtime:`Schema.isGreaterThan(${L(e)})`})})}),Ox=Cx({order:xu,annotate:e=>({representation:{id:`effect/schema/isGreaterThanOrEqualTo`,payload:{minimum:Ex(e)}},toJsonSchema:()=>({minimum:e}),toCode:()=>({runtime:`Schema.isGreaterThanOrEqualTo(${L(e)})`})})}),kx=wx({order:xu,annotate:e=>({representation:{id:`effect/schema/isLessThanOrEqualTo`,payload:{maximum:Ex(e)}},toJsonSchema:()=>({maximum:e}),toCode:()=>({runtime:`Schema.isLessThanOrEqualTo(${L(e)})`})})}),Ax=Tx({order:xu,annotate:e=>{let t=e.exclusiveMinimum?!0:void 0,n=e.exclusiveMaximum?!0:void 0;return{representation:{id:`effect/schema/isBetween`,payload:{minimum:Ex(e.minimum),maximum:Ex(e.maximum),...t&&{exclusiveMinimum:t},...n&&{exclusiveMaximum:n}}},toJsonSchema:()=>({[t?`exclusiveMinimum`:`minimum`]:e.minimum,[n?`exclusiveMaximum`:`maximum`]:e.maximum}),toCode:()=>({runtime:`Schema.isBetween({ minimum: ${L(e.minimum)}, maximum: ${L(e.maximum)}, exclusiveMinimum: ${L(t)}, exclusiveMaximum: ${L(n)} })`})}}});function jx(e){return _x(e=>globalThis.Number.isSafeInteger(e),{expected:`an integer`,representation:{id:`effect/schema/isInt`,payload:null},toJsonSchema:()=>[{type:`integer`},!0],toCode:()=>({runtime:`Schema.isInt()`}),arbitraryConstraint:{number:`integer`},...e})}var Mx=ox.check(jx());function Nx(e,t){return e=Lx(e),Px(e,Math.ceil(e/2),t)}function Px(e,t,n){return _x(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})`}),[bh]:!0,arbitraryConstraint:{minLength:e},...n})}function Fx(e){return Px(1,1,e)}function Ix(e,t){return e=Lx(e),_x(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})`}),[bh]:!0,arbitraryConstraint:{maxLength:e},...t})}function Lx(e){if(!globalThis.Number.isFinite(e))throw new globalThis.RangeError(`Expected a finite number, got ${e}`);return Math.max(0,Math.floor(e))}var Rx=ax.check(Fx());globalThis.RegExp,globalThis.URL;var zx=ax.annotate({expected:`a string that will be decoded as JSON`,contentMediaType:`application/json`});function Bx(e,t){return zx.pipe(mx(e,Fg(t)))}globalThis.File,globalThis.FormData,globalThis.URLSearchParams;var Vx=ax.check(yx()),Hx=ax.annotate({expected:`a string that will be decoded as a trimmed string`}).pipe(mx(Vx,Ag())),Ux=ax.annotate({expected:`a base64 encoded string that will be decoded as Uint8Array`,format:`byte`,contentEncoding:`base64`}),Wx=hx(globalThis.Uint8Array,{representation:{id:`effect/schema/Uint8Array`,payload:null},toCode:()=>({runtime:`Schema.Uint8Array`,Type:`globalThis.Uint8Array`}),expected:`Uint8Array`,toCodecJson:()=>gx()(Ux,Pg)});function Gx(e,t){return jb(Pb(ob(e.ast),t),t)}var Kx=ax.pipe(q(Nx(1)),q(Ix(80))),qx=[`InferenceUpstreamError`,`AiInternalError`,`TypeError`,`AbortError`,`TimeoutError`,`Error`],Jx={minimum:0,maximum:99999},Yx={minimum:0,maximum:599},Xx=ux([W({category:K(qx),code:dx(Mx.check(Ax(Jx))),reason:nx(V(`credits_exhausted`))}),W({category:V(`result_download`),status:Mx.check(Ax(Yx))})]);lo([oo({category:bo(qx),code:Wa().int().min(Jx.minimum).max(Jx.maximum).nullable(),reason:M(`credits_exhausted`).optional()}),oo({category:M(`result_download`),status:Wa().int().min(Yx.minimum).max(Yx.maximum)})]);var Zx=[`CANCELLED`,`CAPABILITY_DENIED`,`CAPABILITY_REVOKED`,`COMMAND_NOT_DECLARED`,`CONFLICT`,`DAILY_LIMIT_REACHED`,`DELIVERY_PENDING`,`DISCONNECTED`,`FILE_TOO_LARGE`,`HOST_FAILURE`,`IDENTITY`,`INSUFFICIENT_CREDIT`,`INVALID_ARGUMENT`,`MEDIA_PROVIDER_FAILURE`,`MEDIA_PROVIDER_FAILURE_UNCHARGED`,`PROTOCOL`,`SAFETY_FILTER_REFUSED`,`SELECTION_CHANGED`,`SETUP_REQUIRED`,`TIMEOUT`],Qx=W({name:V(`AppError`),code:K(Zx),retryable:U,need:B(ax)}),J=class extends Error{code;retryable;need;constructor(e,t){super(e,{cause:t.cause}),this.name=`AppError`,this.code=t.code,this.retryable=t.retryable,this.need=t.need}};function $x(e){return Pu(Qb(Kx)(e))}function eS(e){return`This needs ${e??`setup`} first.`}var tS={CANCELLED:{title:`Request cancelled`,message:`It stopped before it finished. Start it again if you still want it.`},CAPABILITY_DENIED:{title:`Access needed`,message:`This App needs permission to do that.`,action:`grant`},CAPABILITY_REVOKED:{title:`Access changed`,message:`This App no longer has permission to do that.`,action:`grant`},COMMAND_NOT_DECLARED:{title:`Action unavailable`,message:`This App doesn't include that action. It may need an update.`},CONFLICT:{title:`File changed`,message:`This file changed elsewhere. Review it before saving again.`},DAILY_LIMIT_REACHED:{title:`Daily limit reached`,message:`Today's spending limit for this Oyster is used up. It resets at 00:00 UTC.`},DELIVERY_PENDING:{title:`App delivery pending`,message:`The App hasn't finished getting ready. Try opening it again.`},DISCONNECTED:{title:`Connection lost`,message:`Reopen the App to connect again.`,action:`reconnect`},HOST_FAILURE:{title:`Couldn't complete the request`,message:`The host stopped answering. Reopen the App or reload the workspace.`},FILE_TOO_LARGE:{title:`File too large`,message:`Choose a file within the supported size limit.`},IDENTITY:{title:`Couldn't connect`,message:`Reopen the App to connect again.`,action:`reconnect`},INSUFFICIENT_CREDIT:{title:`Something went wrong`,message:`The App couldn't complete this request.`,action:`billing`},INVALID_ARGUMENT:{title:`Request not accepted`,message:`Some of the details weren't usable. Check them and try again.`},MEDIA_PROVIDER_FAILURE:{title:`Generation failed`,message:`The model couldn't complete this generation. Change the prompt or model and send again.`},MEDIA_PROVIDER_FAILURE_UNCHARGED:{title:`Generation failed`,message:`The model couldn't complete this generation. You weren't charged. Change the prompt or model and send again.`},PROTOCOL:{title:`Couldn't read the response`,message:`The host sent something this App doesn't understand. Reload the workspace; if it keeps happening, the App may need an update.`},SAFETY_FILTER_REFUSED:{title:`Generation refused`,message:`The model refused this generation. Change the prompt or reference image and send again.`},SELECTION_CHANGED:{title:`Selection changed`,message:`The selection changed during this request. Reopen the App to continue.`,action:`reconnect`},SETUP_REQUIRED:{title:`Setup needed`,message:eS(void 0),action:`setup`},TIMEOUT:{title:`Still waiting`,message:`The request didn't respond in time. Its outcome isn't known yet.`},UNKNOWN:{title:`Something went wrong`,message:`The App couldn't complete this request.`}};function nS(e,t){let n=Qb(Qx)(e);if(Ou(n))return{...tS.UNKNOWN,retryable:!1};let r=n.value,i=tS[r.code],a=t?.[r.code]??(r.code===`SETUP_REQUIRED`?{title:i.title,message:eS($x(r.need))}:i),o=i.action??(r.retryable?`retry`:void 0),s={title:a.title,message:a.message,retryable:r.retryable};return o?{...s,action:o}:s}var rS=t((e=>{var t=i(),n=Symbol.for(`react.element`),r=Symbol.for(`react.fragment`),a=Object.prototype.hasOwnProperty,o=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,r){var i,c={},l=null,u=null;for(i in r!==void 0&&(l=``+r),t.key!==void 0&&(l=``+t.key),t.ref!==void 0&&(u=t.ref),t)a.call(t,i)&&!s.hasOwnProperty(i)&&(c[i]=t[i]);if(e&&e.defaultProps)for(i in t=e.defaultProps,t)c[i]===void 0&&(c[i]=t[i]);return{$$typeof:n,type:e,key:l,ref:u,props:c,_owner:o.current}}e.Fragment=r,e.jsx=c,e.jsxs=c})),iS=t(((e,t)=>{t.exports=rS()})),Y=iS(),aS=N.createContext(void 0),oS=e=>{let t=N.useContext(aS);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},sS=({client:e,children:t})=>(N.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,Y.jsx)(aS.Provider,{value:e,children:t})),cS={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},lS=new class{#e=cS;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function uS(e){setTimeout(e,0)}var dS=typeof window>`u`||`Deno`in globalThis;function fS(){}function pS(e,t){return typeof e==`function`?e(t):e}function mS(e){return typeof e==`number`&&e>=0&&e!==1/0}function hS(e,t){return Math.max(e+(t||0)-Date.now(),0)}function gS(e,t){return typeof e==`function`?e(t):e}function _S(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==yS(o,t.options))return!1}else if(!xS(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function vS(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(bS(t.options.mutationKey)!==bS(a))return!1}else if(!xS(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function yS(e,t){return(t?.queryKeyHashFn||bS)(e)}function bS(e){return JSON.stringify(e,(e,t)=>ES(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function xS(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){for(let n=0;n<t.length;n++)if(!xS(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!xS(e[r],t[r]))return!1;return!0}return!1}var SS=Object.prototype.hasOwnProperty;function CS(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=TS(e)&&TS(t);if(!r&&!(ES(e)&&ES(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:SS.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=CS(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function wS(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function TS(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ES(e){if(!DS(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!DS(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function DS(e){return Object.prototype.toString.call(e)===`[object Object]`}function OS(e){return new Promise(t=>{lS.setTimeout(t,e)})}function kS(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:CS(e,t)}function AS(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function jS(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var MS=Symbol();function NS(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===MS?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function PS(e,t){return typeof e==`function`?e(...t):!!e}function FS(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var IS=()=>dS,LS=()=>IS(),RS=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},zS=new class extends RS{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},BS=uS;function VS(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=BS,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var HS=VS(),US=new class extends RS{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function WS(e){return Math.min(1e3*2**e,3e4)}function GS(e){return(e??`online`)!==`online`||US.isOnline()}var KS=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function qS(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(fS);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new KS(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>zS.isFocused()&&(e.networkMode===`always`||US.isOnline())&&e.canRun(),p=()=>GS(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=()=>new Promise(t=>{r=e=>{(c()||f())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),_=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(LS()?0:3),a=e.retryDelay??WS,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!s){h(r);return}n++,e.onFail?.(n,r),OS(o).then(()=>f()?void 0:g()).then(()=>{t?h(r):_()})})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g().then(_),s)}}var JS=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),mS(this.gcTime)&&(this.#e=lS.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(LS()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(lS.clearTimeout(this.#e),this.#e=void 0)}},YS=class extends JS{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||XS(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=qS({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),HS.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function XS(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var ZS=class extends RS{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),wS(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&bS(t.mutationKey)!==bS(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??XS();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){HS.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}};function QS(e,t){let n=oS(t),[r]=N.useState(()=>new ZS(n,e));N.useEffect(()=>{r.setOptions(e)},[r,e]);let i=N.useSyncExternalStore(N.useCallback(e=>r.subscribe(HS.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=N.useCallback((...e)=>{r.mutate(e[0],e[1]).catch(fS)},[r]);if(i.error&&PS(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var $S=Symbol(`workers-module`);Symbol.dispose||(Symbol.dispose=Symbol.for(`dispose`)),Symbol.asyncDispose||(Symbol.asyncDispose=Symbol.for(`asyncDispose`)),Promise.withResolvers||(Promise.withResolvers=function(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}});var eC=globalThis[$S],tC=eC?eC.RpcTarget:class{},nC=async function(){}.constructor,rC=typeof Buffer<`u`?Buffer.prototype:void 0;function iC(e){switch(typeof e){case`boolean`:case`number`:case`string`:return`primitive`;case`undefined`:return`undefined`;case`object`:case`function`:break;case`bigint`:return`bigint`;default:return`unsupported`}if(e===null)return`primitive`;let t=Object.getPrototypeOf(e);switch(t){case Object.prototype:return`object`;case Function.prototype:case nC.prototype:return`function`;case Array.prototype:return`array`;case Date.prototype:return`date`;case Uint8Array.prototype:case rC:case ArrayBuffer.prototype:case DataView.prototype:case Int8Array.prototype:case Uint8ClampedArray.prototype:case Int16Array.prototype:case Uint16Array.prototype:case Int32Array.prototype:case Uint32Array.prototype:case BigInt64Array.prototype:case BigUint64Array.prototype:case Float32Array.prototype:case Float64Array.prototype:return`bytes`;case WritableStream.prototype:return`writable`;case ReadableStream.prototype:return`readable`;case URL.prototype:return`url`;case Headers.prototype:return`headers`;case Request.prototype:return`request`;case Response.prototype:return`response`;case Blob.prototype:return`blob`;case gC.prototype:return`stub`;case _C.prototype:return`rpc-promise`;default:if(eC){if(t==eC.RpcStub.prototype||e instanceof eC.ServiceStub)return`rpc-target`;if(t==eC.RpcPromise.prototype||t==eC.RpcProperty.prototype)return`rpc-thenable`}return e instanceof tC?`rpc-target`:e instanceof Error?`error`:`unsupported`}}function aC(){throw Error(`RPC map() implementation was not loaded.`)}var oC={applyMap:aC,sendMap:aC};function sC(){throw Error(`Stream implementation was not loaded.`)}var cC={createWritableStreamHook:sC,createWritableStreamFromHook:sC,createReadableStreamHook:sC},lC=class{stream(e,t){let n=this.call(e,t),r;try{r=n.pull()}catch(e){throw n.dispose(),e}let i;return r instanceof Promise?i=r.then(e=>{e.dispose()}):(r.dispose(),i=Promise.resolve()),{promise:i}}},uC=class extends lC{error;constructor(e){super(),this.error=e}call(e,t){return t.dispose(),this}map(e,t,n){for(let e of t)e.dispose();return this}get(e){return this}dup(){return this}pull(){return Promise.reject(this.error)}ignoreUnhandledRejections(){}dispose(){}onBroken(e){try{e(this.error)}catch(e){Promise.resolve(e)}}},dC=new uC(Error(`Attempted to use RPC stub after it has been disposed.`)),fC=(e,t,n)=>e.call(t,n);function pC(e,t){let n=fC;fC=e;try{return t()}finally{fC=n}}var mC=Symbol(`realStub`),hC={apply(e,t,n){let r=e.raw;return new _C(fC(r.hook,r.pathIfPromise||[],wC.fromAppParams(n)),[])},get(e,t,n){let r=e.raw;if(t===mC)return r;if(t in _C.prototype)return r[t];if(typeof t==`string`)return new _C(r.hook,r.pathIfPromise?[...r.pathIfPromise,t]:[t]);if(t===Symbol.dispose&&(!r.pathIfPromise||r.pathIfPromise.length==0))return()=>{r.hook.dispose(),r.hook=dC}},has(e,t){let n=e.raw;return t===mC?!0:t in _C.prototype?t in n:typeof t==`string`||t===Symbol.dispose&&(!n.pathIfPromise||n.pathIfPromise.length==0)},construct(e,t){throw Error(`An RPC stub cannot be used as a constructor.`)},defineProperty(e,t,n){throw Error(`Can't define properties on RPC stubs.`)},deleteProperty(e,t){throw Error(`Can't delete properties on RPC stubs.`)},getOwnPropertyDescriptor(e,t){},getPrototypeOf(e){return Object.getPrototypeOf(e.raw)},isExtensible(e){return!1},ownKeys(e){return[]},preventExtensions(e){return!0},set(e,t,n,r){throw Error(`Can't assign properties on RPC stubs.`)},setPrototypeOf(e,t){throw Error(`Can't override prototype of RPC stubs.`)}},gC=class e extends tC{constructor(e,t){if(super(),!(e instanceof lC)){let n=e;if(e=n instanceof tC||n instanceof Function?kC.create(n,void 0):new DC(wC.fromAppReturn(n)),t)throw TypeError(`RpcStub constructor expected one argument, received two.`)}this.hook=e,this.pathIfPromise=t;let n=()=>{};return n.raw=this,new Proxy(n,hC)}hook;pathIfPromise;dup(){let t=this[mC];return t.pathIfPromise?new e(t.hook.get(t.pathIfPromise)):new e(t.hook.dup())}onRpcBroken(e){this[mC].hook.onBroken(e)}map(e){let{hook:t,pathIfPromise:n}=this[mC];return oC.sendMap(t,n||[],e)}toString(){return`[object RpcStub]`}},_C=class extends gC{constructor(e,t){if(e instanceof lC)super(e,t??[]);else{if(t!==void 0)throw TypeError(`RpcPromise constructor expected one argument, received two.`);let n=iC(e);if(n===`rpc-promise`){let t=SC(e);if(t.pathIfPromise.length>0)super(t.hook,t.pathIfPromise);else{let e=t.hook;t.hook=dC,super(e,[])}}else if(n===`rpc-thenable`)super(kC.create(e,void 0),[]);else{let t=new AC(Promise.resolve(e).then(e=>new DC(wC.fromAppReturn(e))));t.ignoreUnhandledRejections(),super(t,[])}}}then(e,t){return CC(this).then(...arguments)}catch(e){return CC(this).catch(...arguments)}finally(e){return CC(this).finally(...arguments)}toString(){return`[object RpcPromise]`}};function vC(e){let{hook:t,pathIfPromise:n}=e[mC];return n&&n.length>0?t.get(n):t}function yC(e){let{hook:t,pathIfPromise:n}=e[mC];return n?t.get(n):t.dup()}function bC(e){let{hook:t,pathIfPromise:n}=e[mC];if(!(n&&n.length>0))return t}function xC(e){return e[mC].hook}function SC(e){return e[mC]}async function CC(e){let{hook:t,pathIfPromise:n}=e[mC];return n.length>0&&(t=t.get(n)),(await t.pull()).deliverResolve()}var wC=class e{value;source;hooks;promises;static fromAppParams(t){return new e(t,`params`)}static fromAppReturn(t){return new e(t,`return`)}static fromArray(t){let n=[],r=[],i=[];for(let e of t){e.ensureDeepCopied();for(let t of e.hooks)n.push(t);for(let t of e.promises)t.parent===e&&(t={parent:i,property:i.length,promise:t.promise}),r.push(t);i.push(e.value)}return new e(i,`owned`,n,r)}static forEvaluate(t,n){return new e(null,`owned`,t,n)}static deepCopyFrom(t,n,r){let i=new e(null,`owned`,[],[]);return i.value=i.deepCopy(t,n,`value`,i,!0,r),i}constructor(e,t,n,r){this.value=e,this.source=t,this.hooks=n,this.promises=r}rpcTargets;getHookForRpcTarget(e,t,n=!0){if(this.source===`params`){if(n){let t=e;typeof t.dup==`function`&&(e=t.dup())}return kC.create(e,t)}if(this.source===`return`){let r=this.rpcTargets?.get(e);return r?n?r.dup():(this.rpcTargets?.delete(e),r):(r=kC.create(e,t),n?(this.rpcTargets||=new Map,this.rpcTargets.set(e,r),r.dup()):r)}throw Error(`owned payload shouldn't contain raw RpcTargets`)}getHookForWritableStream(e,t,n=!0){if(this.source===`params`)return cC.createWritableStreamHook(e);if(this.source===`return`){let t=this.rpcTargets?.get(e);return t?n?t.dup():(this.rpcTargets?.delete(e),t):(t=cC.createWritableStreamHook(e),n?(this.rpcTargets||=new Map,this.rpcTargets.set(e,t),t.dup()):t)}throw Error(`owned payload shouldn't contain raw WritableStreams`)}getHookForReadableStream(e,t,n=!0){if(this.source===`params`)return cC.createReadableStreamHook(e);if(this.source===`return`){let t=this.rpcTargets?.get(e);return t?n?t.dup():(this.rpcTargets?.delete(e),t):(t=cC.createReadableStreamHook(e),n?(this.rpcTargets||=new Map,this.rpcTargets.set(e,t),t.dup()):t)}throw Error(`owned payload shouldn't contain raw ReadableStreams`)}deepCopy(e,t,n,r,i,a){switch(iC(e)){case`unsupported`:return e;case`primitive`:case`bigint`:case`date`:case`bytes`:case`blob`:case`url`:case`error`:case`undefined`:return e;case`array`:{let t=e,n=t.length,r=Array(n);for(let e=0;e<n;e++)r[e]=this.deepCopy(t[e],t,e,r,i,a);return r}case`object`:{let t={},n=e;for(let e in n)t[e]=this.deepCopy(n[e],n,e,t,i,a);return t}case`stub`:case`rpc-promise`:{let t=e,a;if(a=i?yC(t):vC(t),t instanceof _C){let e=new _C(a,[]);return this.promises.push({parent:r,property:n,promise:e}),e}return this.hooks.push(a),new gC(a)}case`function`:case`rpc-target`:{let n=e,r;return r=a?a.getHookForRpcTarget(n,t,i):kC.create(n,t),this.hooks.push(r),new gC(r)}case`rpc-thenable`:{let o=e,s;return s=a?new _C(a.getHookForRpcTarget(o,t,i),[]):new _C(kC.create(o,t),[]),this.promises.push({parent:r,property:n,promise:s}),s}case`writable`:{let n=e,r;return r=a?a.getHookForWritableStream(n,t,i):cC.createWritableStreamHook(n),this.hooks.push(r),n}case`readable`:{let n=e,r;return r=a?a.getHookForReadableStream(n,t,i):cC.createReadableStreamHook(n),this.hooks.push(r),n}case`headers`:return new Headers(e);case`request`:{let t=e;return t.body&&this.deepCopy(t.body,t,`body`,t,i,a),new Request(t)}case`response`:{let t=e;return t.body&&this.deepCopy(t.body,t,`body`,t,i,a),new Response(t.body,t)}default:throw Error(`unreachable`)}}ensureDeepCopied(){if(this.source!==`owned`){let e=this.source===`params`;this.hooks=[],this.promises=[];try{this.value=this.deepCopy(this.value,void 0,`value`,this,e,this)}catch(e){throw this.hooks=void 0,this.promises=void 0,e}if(this.source=`owned`,this.rpcTargets&&this.rpcTargets.size>0)throw Error(`Not all rpcTargets were accounted for in deep-copy?`);this.rpcTargets=void 0}}deliverTo(t,n,r){if(this.ensureDeepCopied(),this.value instanceof _C)e.deliverRpcPromiseTo(this.value,t,n,r);else{t[n]=this.value;for(let t of this.promises)e.deliverRpcPromiseTo(t.promise,t.parent,t.property,r)}}static deliverRpcPromiseTo(t,n,r,i){let a=bC(t);if(!a)throw Error(`property promises should have been resolved earlier`);let o=a.pull();o instanceof e?o.deliverTo(n,r,i):i.push(o.then(e=>{let t=[];if(e.deliverTo(n,r,t),t.length>0)return Promise.all(t)}))}async deliverCall(t,n){try{let r=[];this.deliverTo(this,`value`,r),r.length>0&&await Promise.all(r);let i=Function.prototype.apply.call(t,n,this.value);return i instanceof _C?e.fromAppReturn(i):e.fromAppReturn(await i)}finally{this.dispose()}}async deliverStreamWrite(t){try{let n=[];this.deliverTo(this,`value`,n),n.length>0&&await Promise.all(n);let r=this.value[0];return(this.hooks.length>0||this.promises.length>0)&&r instanceof Object?(Symbol.dispose in r||Object.defineProperty(r,Symbol.dispose,{value:()=>this.dispose(),writable:!0,enumerable:!1,configurable:!0}),await t.write(r),e.fromAppReturn(void 0)):(await t.write(r),this.dispose(),e.fromAppReturn(void 0))}catch(e){throw this.dispose(),e}}async deliverResolve(){try{let e=[];this.deliverTo(this,`value`,e),e.length>0&&await Promise.all(e);let t=this.value;return t instanceof Object&&(Symbol.dispose in t||Object.defineProperty(t,Symbol.dispose,{value:()=>this.dispose(),writable:!0,enumerable:!1,configurable:!0})),t}catch(e){throw this.dispose(),e}}dispose(){if(this.source===`owned`)this.hooks.forEach(e=>e.dispose()),this.promises.forEach(e=>e.promise[Symbol.dispose]());else if(this.source===`return`&&(this.disposeImpl(this.value,void 0),this.rpcTargets&&this.rpcTargets.size>0))throw Error(`Not all rpcTargets were accounted for in disposeImpl()?`);this.source=`owned`,this.hooks=[],this.promises=[]}disposeImpl(e,t){switch(iC(e)){case`unsupported`:case`primitive`:case`bigint`:case`bytes`:case`blob`:case`date`:case`url`:case`error`:case`undefined`:return;case`array`:{let t=e,n=t.length;for(let e=0;e<n;e++)this.disposeImpl(t[e],t);return}case`object`:{let t=e;for(let e in t)this.disposeImpl(t[e],t);return}case`stub`:case`rpc-promise`:{let t=bC(e);t&&t.dispose();return}case`function`:case`rpc-target`:{let t=e,n=this.rpcTargets?.get(t);n?(n.dispose(),this.rpcTargets.delete(t)):OC(t);return}case`rpc-thenable`:return;case`headers`:return;case`request`:{let t=e;t.body&&this.disposeImpl(t.body,t);return}case`response`:{let t=e;t.body&&this.disposeImpl(t.body,t);return}case`writable`:{let t=e,n=this.rpcTargets?.get(t);n?this.rpcTargets.delete(t):n=cC.createWritableStreamHook(t),n.dispose();return}case`readable`:{let t=e,n=this.rpcTargets?.get(t);n?this.rpcTargets.delete(t):n=cC.createReadableStreamHook(t),n.dispose();return}default:return}}ignoreUnhandledRejections(){this.hooks?(this.hooks.forEach(e=>{e.ignoreUnhandledRejections()}),this.promises.forEach(e=>xC(e.promise).ignoreUnhandledRejections())):this.ignoreUnhandledRejectionsImpl(this.value)}ignoreUnhandledRejectionsImpl(e){switch(iC(e)){case`unsupported`:case`primitive`:case`bigint`:case`bytes`:case`blob`:case`date`:case`error`:case`undefined`:case`function`:case`rpc-target`:case`writable`:case`readable`:case`url`:case`headers`:case`request`:case`response`:return;case`array`:{let t=e,n=t.length;for(let e=0;e<n;e++)this.ignoreUnhandledRejectionsImpl(t[e]);return}case`object`:{let t=e;for(let e in t)this.ignoreUnhandledRejectionsImpl(t[e]);return}case`stub`:case`rpc-promise`:xC(e).ignoreUnhandledRejections();return;case`rpc-thenable`:e.then(e=>{},e=>{});return;default:return}}};function TC(e,t,n,r){for(let i=0;i<n.length;i++){t=e;let a=n[i];if(a in Object.prototype){e=void 0;continue}switch(iC(e)){case`object`:case`function`:e=Object.hasOwn(e,a)?e[a]:void 0;break;case`array`:e=Number.isInteger(a)&&a>=0?e[a]:void 0;break;case`rpc-target`:case`rpc-thenable`:if(Object.hasOwn(e,a))throw TypeError(`Attempted to access property '${a}', which is an instance property of the RpcTarget. To avoid leaking private internals, instance properties cannot be accessed over RPC. If you want to make this property available over RPC, define it as a method or getter on the class, instead of an instance property.`);e=e[a],r=null;break;case`stub`:case`rpc-promise`:{let{hook:t,pathIfPromise:r}=SC(e);return{hook:t,remainingPath:r?r.concat(n.slice(i)):n.slice(i)}}case`writable`:e=void 0;break;case`readable`:e=void 0;break;case`primitive`:case`bigint`:case`bytes`:case`blob`:case`date`:case`error`:case`url`:case`headers`:case`request`:case`response`:e=void 0;break;case`undefined`:e=e[a];break;case`unsupported`:if(i===0)throw TypeError(`RPC stub points at a non-serializable type.`);{let e=n.slice(0,i).join(`.`),t=n.slice(0,i).join(`.`);throw TypeError(`'${e}' is not a serializable type, so property ${t} cannot be accessed.`)}default:throw TypeError(`unreachable`)}}if(e instanceof _C){let{hook:t,pathIfPromise:n}=SC(e);return{hook:t,remainingPath:n||[]}}return{value:e,parent:t,owner:r}}var EC=class extends lC{call(e,t){let n;try{let{value:t,owner:r}=this.getValue();n=TC(t,void 0,e,r)}catch(e){return t.dispose(),new uC(e)}return n.hook?n.hook.call(n.remainingPath,t):typeof n.value==`function`?new AC(t.deliverCall(n.value,n.parent).then(e=>new DC(e))):(t.dispose(),new uC(TypeError(`'${e.join(`.`)}' is not a function.`)))}map(e,t,n){try{let r;try{let{value:t,owner:n}=this.getValue();r=TC(t,void 0,e,n)}catch(e){for(let e of t)e.dispose();throw e}return r.hook?r.hook.map(r.remainingPath,t,n):oC.applyMap(r.value,r.parent,r.owner,t,n)}catch(e){return new uC(e)}}get(e){try{let{value:t,owner:n}=this.getValue();if(e.length===0&&n===null){if(t instanceof Object&&`then`in t)return this.dup();throw Error(`Can't dup an RpcTarget stub as a promise.`)}let r=TC(t,void 0,e,n);return r.hook?r.hook.get(r.remainingPath):new DC(wC.deepCopyFrom(r.value,r.parent,r.owner))}catch(e){return new uC(e)}}},DC=class e extends EC{constructor(e){super(),this.payload=e}payload;getPayload(){if(this.payload)return this.payload;throw Error(`Attempted to use an RPC StubHook after it was disposed.`)}getValue(){let e=this.getPayload();return{value:e.value,owner:e}}dup(){let t=this.getPayload();return new e(wC.deepCopyFrom(t.value,void 0,t))}pull(){return this.getPayload()}ignoreUnhandledRejections(){this.payload&&this.payload.ignoreUnhandledRejections()}dispose(){this.payload&&=(this.payload.dispose(),void 0)}onBroken(e){this.payload&&this.payload.value instanceof gC&&this.payload.value.onRpcBroken(e)}};function OC(e){if(Symbol.dispose in e)try{e[Symbol.dispose]()}catch(e){Promise.reject(e)}}var kC=class e extends EC{static create(t,n){return typeof t!=`function`&&(n=void 0),new e(t,n)}constructor(e,t,n){super(),this.target=e,this.parent=t,n?n.refcount&&(this.refcount=n.refcount,++this.refcount.count):Symbol.dispose in e&&(this.refcount={count:1})}target;parent;refcount;getTarget(){if(this.target)return this.target;throw Error(`Attempted to use an RPC StubHook after it was disposed.`)}getValue(){return{value:this.getTarget(),owner:null}}dup(){return new e(this.getTarget(),this.parent,this)}pull(){let e=this.getTarget();return`then`in e?Promise.resolve(e).then(e=>wC.fromAppReturn(e)):Promise.reject(Error(`Tried to resolve a non-promise stub.`))}ignoreUnhandledRejections(){}dispose(){this.target&&=(this.refcount&&--this.refcount.count==0&&OC(this.target),void 0)}onBroken(e){let t=this.target;t&&`then`in t&&Promise.resolve(t).then(()=>{},e)}},AC=class e extends lC{promise;resolution;constructor(e){super(),this.promise=e.then(e=>(this.resolution=e,e))}call(t,n){return n.ensureDeepCopied(),new e(this.promise.then(e=>e.call(t,n),e=>{throw n.dispose(),e}))}stream(e,t){return t.ensureDeepCopied(),{promise:this.promise.then(n=>n.stream(e,t).promise,e=>{throw t.dispose(),e})}}map(t,n,r){return new e(this.promise.then(e=>e.map(t,n,r),e=>{for(let e of n)e.dispose();throw e}))}get(t){return new e(this.promise.then(e=>e.get(t)))}dup(){return this.resolution?this.resolution.dup():new e(this.promise.then(e=>e.dup()))}pull(){return this.resolution?this.resolution.pull():this.promise.then(e=>e.pull())}ignoreUnhandledRejections(){this.resolution?this.resolution.ignoreUnhandledRejections():this.promise.then(e=>{e.ignoreUnhandledRejections()},e=>{})}dispose(){this.promise.then(e=>e.dispose(),()=>{})}onBroken(e){this.resolution?this.resolution.onBroken(e):this.promise.then(t=>{t.onBroken(e)},e)}},jC={maxBigIntDigits:16384,maxDepth:256,maxMessageSize:33554432},MC=new Uint8Array(new Uint16Array([1]).buffer)[0]===1,NC=[`ArrayBuffer`,`DataView`,`Int8Array`,`Uint8Array`,`Uint8ClampedArray`,`Int16Array`,`Uint16Array`,`Int32Array`,`Uint32Array`,`BigInt64Array`,`BigUint64Array`,`Float32Array`,`Float64Array`];function PC(e){return NC.includes(e)}var FC={ArrayBuffer:void 0,DataView:void 0,Int8Array:void 0,Uint8Array:void 0,Uint8ClampedArray:void 0,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,BigInt64Array:8,BigUint64Array:8,Float32Array:4,Float64Array:8},IC={ArrayBuffer:ArrayBuffer.prototype,DataView:DataView.prototype,Int8Array:Int8Array.prototype,Uint8ClampedArray:Uint8ClampedArray.prototype,Int16Array:Int16Array.prototype,Uint16Array:Uint16Array.prototype,Int32Array:Int32Array.prototype,Uint32Array:Uint32Array.prototype,BigInt64Array:BigInt64Array.prototype,BigUint64Array:BigUint64Array.prototype,Float32Array:Float32Array.prototype,Float64Array:Float64Array.prototype},LC=new Map;for(let e of Object.keys(IC))LC.set(IC[e],e);function RC(e,t){if(t!==2&&t!==4&&t!==8)throw RangeError(`Unsupported element size: ${t}`);let n=new DataView(e.buffer,e.byteOffset,e.byteLength);for(let r=0;r<e.byteLength;r+=t)switch(t){case 2:n.setUint16(r,n.getUint16(r,!1),!0);break;case 4:n.setUint32(r,n.getUint32(r,!1),!0);break;case 8:n.setBigUint64(r,n.getBigUint64(r,!1),!0)}}var zC=new class{exportStub(e){throw Error(`Cannot serialize RPC stubs without an RPC session.`)}exportPromise(e){throw Error(`Cannot serialize RPC stubs without an RPC session.`)}getImport(e){}unexport(e){}createPipe(e){throw Error(`Cannot create pipes without an RPC session.`)}onSendError(e){}};async function BC(e,t){let n=await new Response(e).blob();return n.type===t?n:n.slice(0,n.size,t)}var VC={__proto__:null,Error,EvalError,RangeError,ReferenceError,SyntaxError,TypeError,URIError,AggregateError},HC=class e{exporter;source;encodingLevel;constructor(e,t,n){this.exporter=e,this.source=t,this.encodingLevel=n}static devaluate(t,n,r=zC,i,a=`string`){let o=new e(r,i,a);try{return o.devaluateImpl(t,n,0)}catch(e){if(o.exports)try{r.unexport(o.exports)}catch{}throw e}}exports;devaluateImpl(e,t,n){if(n>=256)throw Error(`Serialization exceeded maximum allowed depth. (Does the message contain cycles?)`);switch(iC(e)){case`unsupported`:{let t;try{t=`Cannot serialize value: ${e}`}catch{t=`Cannot serialize value: (couldn't stringify value)`}throw TypeError(t)}case`primitive`:return typeof e==`number`&&!isFinite(e)?this.encodingLevel===`structuredClonable`?e:e===1/0?[`inf`]:e===-1/0?[`-inf`]:[`nan`]:e;case`object`:{let t=e,r={};for(let e in t)r[e]=this.devaluateImpl(t[e],t,n+1);return r}case`array`:{let t=e,r=t.length,i=Array(r);for(let e=0;e<r;e++)i[e]=this.devaluateImpl(t[e],t,n+1);return[i]}case`bigint`:return this.encodingLevel===`structuredClonable`?e:[`bigint`,e.toString()];case`date`:{if(this.encodingLevel===`structuredClonable`)return e;let t=e.getTime();return[`date`,Number.isNaN(t)?null:t]}case`bytes`:{let t=LC.get(Object.getPrototypeOf(e)),n;if(t===`ArrayBuffer`)n=new Uint8Array(e);else if(t===void 0)n=e;else{let r=e;n=new Uint8Array(r.buffer,r.byteOffset,r.byteLength);let i=FC[t];!MC&&i&&(n=n.slice(),RC(n,i))}if(this.encodingLevel===`structuredClonable`||this.encodingLevel===`jsonCompatibleWithBytes`)return t===void 0?[`bytes`,n]:[`bytes`,n,t];let r;if(n.toBase64)r=n.toBase64({omitPadding:!0});else if(typeof Buffer<`u`)r=(n instanceof Buffer?n:Buffer.from(n.buffer,n.byteOffset,n.byteLength)).toString(`base64`);else{let e=``;for(let t=0;t<n.length;t++)e+=String.fromCharCode(n[t]);r=btoa(e)}return r=r.replace(/=+$/,``),t===void 0?[`bytes`,r]:[`bytes`,r,t]}case`url`:return[`url`,e.href];case`headers`:return[`headers`,[...e]];case`request`:{let t=e,r={};t.method!==`GET`&&(r.method=t.method);let i=[...t.headers];if(i.length>0&&(r.headers=i),t.body)r.body=this.devaluateImpl(t.body,t,n+1),r.duplex=t.duplex||`half`;else if(t.body===void 0&&![`GET`,`HEAD`,`OPTIONS`,`TRACE`,`DELETE`].includes(t.method)){let e=t.arrayBuffer(),n=new ReadableStream({async start(t){try{t.enqueue(new Uint8Array(await e)),t.close()}catch(e){t.error(e)}}}),i=cC.createReadableStreamHook(n);r.body=[`readable`,this.exporter.createPipe(n,i)],r.duplex=t.duplex||`half`}t.cache&&t.cache!=="default"&&(r.cache=t.cache),t.redirect!==`follow`&&(r.redirect=t.redirect),t.integrity&&(r.integrity=t.integrity),t.mode&&t.mode!==`cors`&&(r.mode=t.mode),t.credentials&&t.credentials!==`same-origin`&&(r.credentials=t.credentials),t.referrer&&t.referrer!==`about:client`&&(r.referrer=t.referrer),t.referrerPolicy&&(r.referrerPolicy=t.referrerPolicy),t.keepalive&&(r.keepalive=t.keepalive);let a=t;return a.cf&&(r.cf=a.cf),a.encodeResponseBody&&a.encodeResponseBody!==`automatic`&&(r.encodeResponseBody=a.encodeResponseBody),[`request`,t.url,r]}case`response`:{let t=e,r=this.devaluateImpl(t.body,t,n+1),i={};t.status!==200&&(i.status=t.status),t.statusText&&(i.statusText=t.statusText);let a=[...t.headers];a.length>0&&(i.headers=a);let o=t;if(o.cf&&(i.cf=o.cf),o.encodeBody&&o.encodeBody!==`automatic`&&(i.encodeBody=o.encodeBody),o.webSocket)throw TypeError(`Can't serialize a Response containing a webSocket.`);return[`response`,r,i]}case`blob`:{let t=e,n=t.stream(),r=cC.createReadableStreamHook(n),i=this.exporter.createPipe(n,r);return[`blob`,t.type,[`readable`,i]]}case`error`:{let t=e,r=this.exporter.onSendError(t);r&&(t=r);let i=t,a,o=(e,r)=>{let i=this.exports?.length??0;try{let i=this.devaluateImpl(r,t,n+1);a||={},a[e]=i}catch{if(this.exports&&this.exports.length>i){let e=this.exports.splice(i);try{this.exporter.unexport(e)}catch{}}}};for(let e of Object.keys(t))e!==`name`&&e!==`message`&&e!==`stack`&&o(e,i[e]);`cause`in t&&o(`cause`,i.cause),t instanceof AggregateError&&o(`errors`,t.errors);let s=[`error`,t.name,t.message];return a?(s.push(r&&r.stack?r.stack:null),s.push(a)):r&&r.stack&&s.push(r.stack),s}case`undefined`:return this.encodingLevel===`structuredClonable`?void 0:[`undefined`];case`stub`:case`rpc-promise`:{if(!this.source)throw Error(`Can't serialize RPC stubs in this context.`);let{hook:t,pathIfPromise:n}=SC(e),r=this.exporter.getImport(t);return r===void 0?(t=n?t.get(n):t.dup(),this.devaluateHook(n?`promise`:`export`,t)):n?n.length>0?[`pipeline`,r,n]:[`pipeline`,r]:[`import`,r]}case`function`:case`rpc-target`:{if(!this.source)throw Error(`Can't serialize RPC stubs in this context.`);let n=this.source.getHookForRpcTarget(e,t);return this.devaluateHook(`export`,n)}case`rpc-thenable`:{if(!this.source)throw Error(`Can't serialize RPC stubs in this context.`);let n=this.source.getHookForRpcTarget(e,t);return this.devaluateHook(`promise`,n)}case`writable`:{if(!this.source)throw Error(`Can't serialize WritableStream in this context.`);let n=this.source.getHookForWritableStream(e,t);return this.devaluateHook(`writable`,n)}case`readable`:{if(!this.source)throw Error(`Can't serialize ReadableStream in this context.`);let n=e,r=this.source.getHookForReadableStream(n,t);return[`readable`,this.exporter.createPipe(n,r)]}default:throw Error(`unreachable`)}}devaluateHook(e,t){this.exports||=[];let n=e===`promise`?this.exporter.exportPromise(t):this.exporter.exportStub(t);return this.exports.push(n),[e,n]}};new class{importStub(e){throw Error(`Cannot deserialize RPC stubs without an RPC session.`)}importPromise(e){throw Error(`Cannot deserialize RPC stubs without an RPC session.`)}getExport(e){}getPipeReadable(e){throw Error(`Cannot retrieve pipe readable without an RPC session.`)}getLimits(){return jC}};function UC(e,t){return new _C(new AC(new Response(t).arrayBuffer().then(t=>{let n=new Uint8Array(t),r=new Request(e,{body:n});return new DC(wC.fromAppReturn(r))})),[])}function WC(e,t){return new _C(new AC(BC(e,t).then(e=>new DC(wC.fromAppReturn(e)))),[])}var GC=class e{importer;encodingLevel;limits;constructor(e,t=`string`){this.importer=e,this.encodingLevel=t,this.limits=e.getLimits()}hooks=[];promises=[];evaluate(e){return this.evaluateWithDepth(e,0)}evaluateWithDepth(e,t){let n=wC.forEvaluate(this.hooks,this.promises);try{return n.value=this.evaluateImpl(e,n,`value`,t),n}catch(e){throw n.dispose(),e}}evaluateCopy(e){return this.evaluate(structuredClone(e))}evaluateImpl(t,n,r,i){let a=this.limits.maxDepth;if(i>=a)throw TypeError(`Deserialization exceeded maximum allowed message depth of ${a}.`);if(this.encodingLevel===`structuredClonable`&&(t instanceof Date||typeof t==`bigint`))return t;if(t instanceof Array){if(t.length==1&&t[0]instanceof Array){let e=t[0];for(let t=0;t<e.length;t++)e[t]=this.evaluateImpl(e[t],e,t,i+1);return e}switch(t[0]){case`bigint`:if(typeof t[1]==`string`){let e=t[1],n=this.limits.maxBigIntDigits;if(e.length>n)throw TypeError(`Deserialized bigint exceeds maximum length of ${n} digits.`);return BigInt(e)}break;case`date`:if(t[1]===null)return new Date(NaN);if(typeof t[1]==`number`)return new Date(t[1]);break;case`bytes`:{let e;if(t[1]instanceof Uint8Array)e=t[1];else if(typeof t[1]==`string`){if(typeof Buffer<`u`)e=Buffer.from(t[1],`base64`);else if(Uint8Array.fromBase64)e=Uint8Array.fromBase64(t[1]);else{let n=atob(t[1]),r=n.length;e=new Uint8Array(r);for(let t=0;t<r;t++)e[t]=n.charCodeAt(t)}}else break;if(t.length===2)return e;if(typeof t[2]!=`string`)throw TypeError(`Unknown bytes type marker type: ${typeof t[2]}`);if(!PC(t[2])){let e=t[2].slice(0,64);throw TypeError(`Unknown bytes type marker: ${e}`)}let n=t[2],r=FC[n];if(r!==void 0&&e.byteLength%r!==0)throw TypeError(`Invalid byte length ${e.byteLength} for ${n}; expected a multiple of ${r}`);let i=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);switch(!MC&&r!==void 0&&RC(new Uint8Array(i),r),n){case`ArrayBuffer`:return i;case`DataView`:return new DataView(i);case`Int8Array`:return new Int8Array(i);case`Uint8Array`:return new Uint8Array(i);case`Uint8ClampedArray`:return new Uint8ClampedArray(i);case`Int16Array`:return new Int16Array(i);case`Uint16Array`:return new Uint16Array(i);case`Int32Array`:return new Int32Array(i);case`Uint32Array`:return new Uint32Array(i);case`BigInt64Array`:return new BigInt64Array(i);case`BigUint64Array`:return new BigUint64Array(i);case`Float32Array`:return new Float32Array(i);case`Float64Array`:return new Float64Array(i)}}case`error`:if(t.length>=3&&typeof t[1]==`string`&&typeof t[2]==`string`){let e=VC[t[1]]||Error,n=e===AggregateError?new e([],t[2]):new e(t[2]);if(typeof t[3]==`string`&&(n.stack=t[3]),t.length>=5){let e=t[4];if(!e||typeof e!=`object`||Array.isArray(e))break;let r=n,a=e;for(let e of Object.keys(a))if(e!==`name`&&e!==`message`&&e!==`stack`){if(e in Object.prototype||e===`toJSON`){this.evaluateImpl(a[e],n,e,i+1);continue}r[e]=this.evaluateImpl(a[e],n,e,i+1)}}return n}break;case`undefined`:if(t.length===1)return;break;case`inf`:return 1/0;case`-inf`:return-1/0;case`nan`:return NaN;case`url`:if(t.length===2&&typeof t[1]==`string`)return new URL(t[1]);break;case`headers`:if(t.length===2&&t[1]instanceof Array)return new Headers(t[1]);break;case`request`:{if(t.length!==3||typeof t[1]!=`string`)break;let e=t[1],a=t[2];if(typeof a!=`object`||!a)break;if(a.body&&(a.body=this.evaluateImpl(a.body,a,`body`,i+1),!(a.body===null||typeof a.body==`string`||a.body instanceof Uint8Array||a.body instanceof ReadableStream)))throw TypeError(`Request body must be of type ReadableStream.`);if(a.signal&&(a.signal=this.evaluateImpl(a.signal,a,`signal`,i+1),!(a.signal instanceof AbortSignal)))throw TypeError(`Request siganl must be of type AbortSignal.`);if(a.headers&&!(a.headers instanceof Array))throw TypeError(`Request headers must be serialized as an array of pairs.`);let o=new Request(e,a);if(a.body instanceof ReadableStream&&o.body===void 0){let e=UC(o,a.body);return this.promises.push({promise:e,parent:n,property:r}),e}return o}case`response`:{if(t.length!==3)break;let e=this.evaluateImpl(t[1],n,r,i+1);if(!(e===null||typeof e==`string`||e instanceof Uint8Array||e instanceof ReadableStream))throw TypeError(`Response body must be of type ReadableStream.`);let a=t[2];if(typeof a!=`object`||!a)break;if(a.webSocket)throw TypeError(`Can't deserialize a Response containing a webSocket.`);if(a.headers&&!(a.headers instanceof Array))throw TypeError(`Request headers must be serialized as an array of pairs.`);return new Response(e,a)}case`blob`:{if(t.length!==3||typeof t[1]!=`string`)break;let e=t[1],a=this.evaluateImpl(t[2],n,r,i+1);if(!(a instanceof ReadableStream))throw TypeError(`Blob content must be serialized as a ReadableStream.`);let o=WC(a,e);return this.promises.push({promise:o,parent:n,property:r}),o}case`import`:case`pipeline`:{if(t.length<2||t.length>4||typeof t[1]!=`number`)break;let a=this.importer.getExport(t[1]);if(!a)throw Error(`no such entry on exports table: ${t[1]}`);let o=t[0]==`pipeline`,s=e=>{if(o){let t=new _C(e,[]);return this.promises.push({promise:t,parent:n,property:r}),t}return this.hooks.push(e),new _C(e,[])};if(t.length==2)return s(o?a.get([]):a.dup());let c=t[2];if(!(c instanceof Array)||!c.every(e=>typeof e==`string`||typeof e==`number`))break;if(t.length==3)return s(a.get(c));let l=t[3];if(!(l instanceof Array))break;return l=new e(this.importer).evaluateWithDepth([l],i),s(a.call(c,l))}case`remap`:{if(t.length!==5||typeof t[1]!=`number`||!(t[2]instanceof Array)||!(t[3]instanceof Array)||!(t[4]instanceof Array))break;let e=this.importer.getExport(t[1]);if(!e)throw Error(`no such entry on exports table: ${t[1]}`);let i=t[2];if(!i.every(e=>typeof e==`string`||typeof e==`number`))break;let a=t[3].map(e=>{if(!(e instanceof Array)||e.length!==2||e[0]!==`import`&&e[0]!==`export`||typeof e[1]!=`number`)throw TypeError(`unknown map capture: ${JSON.stringify(e)}`);if(e[0]===`export`)return this.importer.importStub(e[1]);{let t=this.importer.getExport(e[1]);if(!t)throw Error(`no such entry on exports table: ${e[1]}`);return t.dup()}}),o=t[4],s=new _C(e.map(i,a,o),[]);return this.promises.push({promise:s,parent:n,property:r}),s}case`export`:case`promise`:if(typeof t[1]==`number`){if(t[0]==`promise`){let e=new _C(this.importer.importPromise(t[1]),[]);return this.promises.push({parent:n,property:r,promise:e}),e}{let e=this.importer.importStub(t[1]);return this.hooks.push(e),new gC(e)}}break;case`writable`:if(typeof t[1]==`number`){let e=this.importer.importStub(t[1]),n=cC.createWritableStreamFromHook(e);return this.hooks.push(e),n}break;case`readable`:if(typeof t[1]==`number`){let e=this.importer.getPipeReadable(t[1]),n=cC.createReadableStreamHook(e);return this.hooks.push(n),e}}throw TypeError(`unknown special value: ${JSON.stringify(t)}`)}if(t instanceof Object){let e=t;for(let t in e)t in Object.prototype||t===`toJSON`?(this.evaluateImpl(e[t],e,t,i+1),delete e[t]):e[t]=this.evaluateImpl(e[t],e,t,i+1);return e}return t}},KC=16,qC=8,JC=16,YC=64;function XC(e){return 2+e.length*3}function ZC(e,t,n=0){if(n>=YC)return qC;switch(typeof e){case`string`:return XC(e);case`number`:return 16;case`bigint`:return 16;case`boolean`:return 8;case`undefined`:return 16;case`object`:{if(e===null)return 8;if(ArrayBuffer.isView(e)||e instanceof ArrayBuffer)return JC+e.byteLength;if(typeof Blob<`u`&&e instanceof Blob)return JC+e.size;if(e instanceof Date)return 16;if(t??=new WeakSet,t.has(e))return qC;if(t.add(e),e instanceof Array){let r=KC;for(let i of e)r+=qC+ZC(i,t,n+1);return r}if(e instanceof Error){let r=KC+XC(e.name)+XC(e.message)+XC(e.stack??``);for(let i of Object.keys(e))r+=qC+XC(i)+ZC(e[i],t,n+1);return r}let r=KC;for(let i of Object.keys(e))r+=qC+XC(i)+ZC(e[i],t,n+1);return r}default:return 16}}var QC=class{session;importId;constructor(e,t,n){this.session=e,this.importId=t,n&&(this.activePull=Promise.withResolvers())}localRefcount=0;remoteRefcount=1;activePull;resolution;onBrokenRegistrations;resolve(e){if(this.localRefcount==0){e.dispose();return}if(this.resolution=e,this.sendRelease(),this.onBrokenRegistrations){for(let t of this.onBrokenRegistrations){let n=this.session.onBrokenCallbacks[t],r=this.session.onBrokenCallbacks.length;e.onBroken(n),this.session.onBrokenCallbacks[r]===n?delete this.session.onBrokenCallbacks[r]:delete this.session.onBrokenCallbacks[t]}this.onBrokenRegistrations=void 0}this.activePull&&=(this.activePull.resolve(),void 0)}async awaitResolution(){return this.activePull||=(this.session.sendPull(this.importId),Promise.withResolvers()),await this.activePull.promise,this.resolution.pull()}dispose(){this.resolution?this.resolution.dispose():(this.abort(Error(`RPC was canceled because the RpcPromise was disposed.`)),this.sendRelease())}abort(e){if(!this.resolution){if(this.resolution=new uC(e),this.activePull&&=(this.activePull.reject(e),void 0),this.onBrokenRegistrations)for(let e of this.onBrokenRegistrations)delete this.session.onBrokenCallbacks[e];this.onBrokenRegistrations=void 0}}onBroken(e){if(this.resolution)this.resolution.onBroken(e);else{let t=this.session.onBrokenCallbacks.length;this.session.onBrokenCallbacks.push(e),this.onBrokenRegistrations||=[],this.onBrokenRegistrations.push(t)}}sendRelease(){this.remoteRefcount>0&&(this.session.sendRelease(this.importId,this.remoteRefcount),this.remoteRefcount=0)}},$C=class e extends lC{isPromise;entry;constructor(e,t){super(),this.isPromise=e,++t.localRefcount,this.entry=t}collectPath(e){return this}getEntry(){if(this.entry)return this.entry;throw Error(`This RpcImportHook was already disposed.`)}getEntryTakingOwnership(e){try{return this.getEntry()}catch(t){throw e(),t}}call(e,t){let n=this.getEntryTakingOwnership(()=>t.dispose());return n.resolution?n.resolution.call(e,t):n.session.sendCall(n.importId,e,t)}stream(e,t){let n=this.getEntryTakingOwnership(()=>t.dispose());return n.resolution?n.resolution.stream(e,t):n.session.sendStream(n.importId,e,t)}map(e,t,n){let r=this.getEntryTakingOwnership(()=>{for(let e of t)e.dispose()});return r.resolution?r.resolution.map(e,t,n):r.session.sendMap(r.importId,e,t,n)}get(e){let t=this.getEntry();return t.resolution?t.resolution.get(e):t.session.sendCall(t.importId,e)}dup(){return new e(!1,this.getEntry())}pull(){let e=this.getEntry();if(!this.isPromise)throw Error(`Can't pull this hook because it's not a promise hook.`);return e.resolution?e.resolution.pull():e.awaitResolution()}ignoreUnhandledRejections(){}dispose(){let e=this.entry;this.entry=void 0,e&&--e.localRefcount===0&&e.dispose()}onBroken(e){this.entry&&this.entry.onBroken(e)}},ew=class extends $C{session;constructor(e){super(!1,e),this.session=e.session}dispose(){if(this.session){let e=this.session;this.session=void 0,e.shutdown()}}},tw=class{transport;options;exports=[];reverseExports=new Map;imports=[];abortReason;cancelReadLoop;nextExportId=-1;onBatchDone;pullCount=0;onBrokenCallbacks=[];encodingLevel;limits;constructor(e,t,n){this.transport=e,this.options=n;let r=`string`;if(`encodingLevel`in e){let t=e.encodingLevel;if(t!==void 0){if(t!==`string`&&t!==`jsonCompatible`&&t!==`jsonCompatibleWithBytes`&&t!==`structuredClonable`)throw TypeError(`Unknown transport encodingLevel: ${String(t)}`);r=t}}this.encodingLevel=r,this.limits={...jC,...n.limits},this.exports.push({hook:t,refcount:1}),this.imports.push(new QC(this,0,!1)),this.readLoop().catch(e=>this.abort(e))}getMainImport(){return new ew(this.imports[0])}shutdown(){this.abort(Error(`RPC session was shut down by disposing the main stub`),!1)}exportStub(e){if(this.abortReason)throw this.abortReason;let t=this.reverseExports.get(e);if(t!==void 0)return++this.exports[t].refcount,t;{let t=this.nextExportId--;return this.exports[t]={hook:e,refcount:1},this.reverseExports.set(e,t),this.watchExport(t,e),t}}exportPromise(e){if(this.abortReason)throw this.abortReason;let t=this.nextExportId--;return this.exports[t]={hook:e,refcount:1},this.reverseExports.set(e,t),this.ensureResolvingExport(t),t}unexport(e){for(let t of e)this.releaseExport(t,1)}watchExport(e,t){t.onBroken(n=>{queueMicrotask(()=>{if(this.abortReason===void 0&&this.exports[e]?.hook===t)try{this.send([`reject`,e,HC.devaluate(n,void 0,this,void 0,this.encodingLevel)])}catch(e){this.abort(e)}})})}releaseExport(e,t){let n=this.exports[e];if(!n)throw Error(`no such export ID: ${e}`);if(n.refcount<t)throw Error(`refcount would go negative: ${n.refcount} < ${t}`);n.refcount-=t,n.refcount===0&&(delete this.exports[e],this.reverseExports.delete(n.hook),n.hook.dispose())}onSendError(e){if(this.options.onSendError)return this.options.onSendError(e)}ensureResolvingExport(e){let t=this.exports[e];if(!t)throw Error(`no such export ID: ${e}`);if(!t.pull){let n=async()=>{let e=t.hook;for(;;){let t=await e.pull();if(t.value instanceof gC){let{hook:n,pathIfPromise:r}=SC(t.value);if(r&&r.length==0&&this.getImport(e)===void 0){e=n;continue}}return t}},r=t.autoRelease;++this.pullCount,t.pull=n().then(t=>{let n=HC.devaluate(t.value,void 0,this,t,this.encodingLevel);this.send([`resolve`,e,n]),r&&this.releaseExport(e,1)},t=>{this.send([`reject`,e,HC.devaluate(t,void 0,this,void 0,this.encodingLevel)]),r&&this.releaseExport(e,1)}).catch(t=>{try{this.send([`reject`,e,HC.devaluate(t,void 0,this,void 0,this.encodingLevel)]),r&&this.releaseExport(e,1)}catch(e){this.abort(e)}}).finally(()=>{--this.pullCount===0&&this.onBatchDone&&this.onBatchDone.resolve()})}}getImport(e){if(e instanceof $C&&e.entry&&e.entry.session===this)return e.entry.importId}importStub(e){if(this.abortReason)throw this.abortReason;let t=this.imports[e];return t||(t=new QC(this,e,!1),this.imports[e]=t),new $C(!1,t)}importPromise(e){if(this.abortReason)throw this.abortReason;if(this.imports[e])return new uC(Error(`Bug in RPC system: The peer sent a promise reusing an existing export ID.`));let t=new QC(this,e,!0);return this.imports[e]=t,new $C(!0,t)}getExport(e){return this.exports[e]?.hook}getPipeReadable(e){let t=this.exports[e];if(!t||!t.pipeReadable)throw Error(`Export ${e} is not a pipe or its readable end was already consumed.`);let n=t.pipeReadable;return t.pipeReadable=void 0,n}getLimits(){return this.limits}createPipe(e,t){if(this.abortReason)throw this.abortReason;this.send([`pipe`]);let n=this.imports.length,r=new QC(this,n,!1);this.imports.push(r);let i=new $C(!1,r),a=cC.createWritableStreamFromHook(i);return e.pipeTo(a).catch(()=>{}).finally(()=>t.dispose()),n}send(e){if(this.abortReason!==void 0)return 0;if(this.encodingLevel===`string`){let t;try{t=JSON.stringify(e)}catch(e){try{this.abort(e)}catch{}throw e}try{let e=this.transport.send(t);e!==void 0&&typeof e.catch==`function`&&e.catch(e=>this.abort(e,!1))}catch(e){queueMicrotask(()=>this.abort(e,!1))}return t.length}try{let t=this.transport.send(e);if(typeof t==`number`)return t;let n=t;n&&typeof n.then==`function`&&Promise.resolve(n).catch(e=>this.abort(e,!1));return}catch(e){queueMicrotask(()=>this.abort(e,!1));return}}sendCall(e,t,n){if(this.abortReason)throw n?.dispose(),this.abortReason;let r=[`pipeline`,e,t];if(n){let e;try{e=HC.devaluate(n.value,void 0,this,n,this.encodingLevel)}catch(e){throw n.dispose(),e}r.push(e[0])}this.send([`push`,r]);let i=new QC(this,this.imports.length,!1);return this.imports.push(i),new $C(!0,i)}sendStream(e,t,n){if(this.abortReason)throw n.dispose(),this.abortReason;let r=[`pipeline`,e,t],i;try{i=HC.devaluate(n.value,void 0,this,n,this.encodingLevel)}catch(e){throw n.dispose(),e}r.push(i[0]);let a=[`stream`,r],o=this.send(a);o===void 0&&(o=ZC(a));let s=this.imports.length,c=new QC(this,s,!0);return c.remoteRefcount=0,c.localRefcount=1,this.imports.push(c),{promise:c.awaitResolution().then(e=>{e.dispose(),delete this.imports[s]},e=>{throw delete this.imports[s],e}),size:o}}sendMap(e,t,n,r){if(this.abortReason){for(let e of n)e.dispose();throw this.abortReason}let i=[`remap`,e,t,n.map(e=>{let t=this.getImport(e);return t===void 0?[`export`,this.exportStub(e)]:[`import`,t]}),r];this.send([`push`,i]);let a=new QC(this,this.imports.length,!1);return this.imports.push(a),new $C(!0,a)}sendPull(e){if(this.abortReason)throw this.abortReason;this.send([`pull`,e])}sendRelease(e,t){this.abortReason||(this.send([`release`,e,t]),delete this.imports[e])}abort(e,t=!0){if(this.abortReason===void 0){if(this.cancelReadLoop?.(e),this.cancelReadLoop=void 0,t)try{let t=[`abort`,HC.devaluate(e,void 0,this,void 0,this.encodingLevel)];if(this.encodingLevel===`string`){let e=this.transport.send(JSON.stringify(t));e!==void 0&&typeof e.catch==`function`&&e.catch(e=>{})}else{let e=this.transport.send(t);e&&typeof e.then==`function`&&Promise.resolve(e).catch(e=>{})}}catch{}if(e===void 0&&(e=`undefined`),this.abortReason=e,this.onBatchDone&&this.onBatchDone.reject(e),this.transport.abort)try{this.transport.abort(e)}catch(e){Promise.resolve(e)}for(let t of Object.values(this.onBrokenCallbacks))try{t(e)}catch(e){Promise.resolve(e)}for(let t in this.imports)this.imports[t].abort(e);for(let e in this.exports)this.exports[e].hook.dispose()}}async readLoop(){for(;!this.abortReason;){let e=Promise.withResolvers();this.cancelReadLoop=e.reject;let t;try{t=await Promise.race([this.transport.receive(),e.promise])}finally{this.cancelReadLoop===e.reject&&(this.cancelReadLoop=void 0)}if(this.encodingLevel===`string`&&t.length>this.limits.maxMessageSize)throw TypeError(`Incoming message exceeds maximum size of ${this.limits.maxMessageSize} UTF-16 code units.`);if(this.abortReason)break;let n=this.encodingLevel===`string`?JSON.parse(t):t;if(n instanceof Array)switch(n[0]){case`push`:if(n.length>1){let e=new DC(new GC(this,this.encodingLevel).evaluate(n[1]));e.ignoreUnhandledRejections(),this.exports.push({hook:e,refcount:1});continue}break;case`stream`:if(n.length>1){let e=new DC(new GC(this,this.encodingLevel).evaluate(n[1]));e.ignoreUnhandledRejections();let t=this.exports.length;this.exports.push({hook:e,refcount:1,autoRelease:!0}),this.ensureResolvingExport(t);continue}break;case`pipe`:{let{readable:e,writable:t}=new TransformStream,n=cC.createWritableStreamHook(t),r=this.exports.length;this.exports.push({hook:n,refcount:1,pipeReadable:e}),this.watchExport(r,n);continue}case`pull`:{let e=n[1];if(typeof e==`number`){this.ensureResolvingExport(e);continue}break}case`resolve`:case`reject`:{let e=n[1];if(typeof e==`number`&&n.length>2){let t=this.imports[e];if(t){if(n[0]==`resolve`)t.resolve(new DC(new GC(this,this.encodingLevel).evaluate(n[2])));else{let e=new GC(this,this.encodingLevel).evaluate(n[2]);e.dispose(),t.resolve(new uC(e.value))}}else n[0]==`resolve`&&new GC(this,this.encodingLevel).evaluate(n[2]).dispose();continue}break}case`release`:{let e=n[1],t=n[2];if(typeof e==`number`&&typeof t==`number`){this.releaseExport(e,t);continue}break}case`abort`:{let e=new GC(this,this.encodingLevel).evaluate(n[1]);e.dispose(),this.abort(e.value,!1);break}}throw Error(`bad RPC message: ${JSON.stringify(n)}`)}}async drain(){if(this.abortReason)throw this.abortReason;if(this.pullCount>0){let{promise:e,resolve:t,reject:n}=Promise.withResolvers();this.onBatchDone={resolve:t,reject:n},await e}}getStats(){let e={imports:0,exports:0};for(let t in this.imports)++e.imports;for(let t in this.exports)++e.exports;return e}},nw=class{#e;#t;constructor(e,t,n={}){let r;r=t?new DC(wC.fromAppReturn(t)):new uC(Error(`This connection has no main object.`)),this.#e=new tw(e,r,n),this.#t=new gC(this.#e.getMainImport())}getRemoteMain(){return this.#t}getStats(){return this.#e.getStats()}drain(){return this.#e.drain()}};function rw(e,t,n){return new nw(new iw(e),t,n).getRemoteMain()}var iw=class{encodingLevel=`structuredClonable`;constructor(e){this.#e=e,e.start(),e.addEventListener(`message`,e=>{this.#i||(e.data===null?this.#a(Error(`Peer closed MessagePort connection.`)):this.#t?(this.#t(e.data),this.#t=void 0,this.#n=void 0):this.#r.push(e.data))}),e.addEventListener(`messageerror`,e=>{this.#a(Error(`MessagePort message error.`))})}#e;#t;#n;#r=[];#i;send(e){if(this.#i)throw this.#i;this.#e.postMessage(e)}async receive(){if(this.#r.length>0)return this.#r.shift();if(this.#i)throw this.#i;return new Promise((e,t)=>{this.#t=e,this.#n=t})}abort(e){try{this.#e.postMessage(null)}catch{}this.#e.close(),this.#i||=e}#a(e){this.#i||(this.#i=e,this.#n&&=(this.#n(e),this.#t=void 0,void 0))}},aw,ow=class{context;captureMap=new Map;instructions=[];constructor(e,t){this.context=aw?{parent:aw,captures:[],subject:aw.capture(e),path:t}:{parent:void 0,captures:[],subject:e,path:t},aw=this}unregister(){aw=this.context.parent}makeInput(){return new cw(this,0)}makeOutput(e){let t;try{t=HC.devaluate(e.value,void 0,this,e)}finally{e.dispose()}return this.instructions.push(t),this.context.parent?(this.context.parent.instructions.push([`remap`,this.context.subject,this.context.path,this.context.captures.map(e=>[`import`,e]),this.instructions]),new cw(this.context.parent,this.context.parent.instructions.length)):this.context.subject.map(this.context.path,this.context.captures,this.instructions)}pushCall(e,t,n){let r=HC.devaluate(n.value,void 0,this,n);r=r[0];let i=this.capture(e.dup());return this.instructions.push([`pipeline`,i,t,r]),new cw(this,this.instructions.length)}pushGet(e,t){let n=this.capture(e.dup());return this.instructions.push([`pipeline`,n,t]),new cw(this,this.instructions.length)}capture(e){if(e instanceof cw&&e.mapper===this)return e.idx;let t=this.captureMap.get(e);if(t===void 0){if(this.context.parent){let t=this.context.parent.capture(e);this.context.captures.push(t)}else this.context.captures.push(e);t=-this.context.captures.length,this.captureMap.set(e,t)}return t}exportStub(e){throw Error(`Can't construct an RpcTarget or RPC callback inside a mapper function. Try creating a new RpcStub outside the callback first, then using it inside the callback.`)}exportPromise(e){return this.exportStub(e)}getImport(e){return this.capture(e)}unexport(e){}createPipe(e){throw Error(`Cannot send ReadableStream inside a mapper function.`)}onSendError(e){}};oC.sendMap=(e,t,n)=>{let r=new ow(e,t),i;try{i=wC.fromAppReturn(pC(r.pushCall.bind(r),()=>n(new _C(r.makeInput(),[]))))}finally{r.unregister()}if(i instanceof Promise)throw i.catch(e=>{}),Error(`RPC map() callbacks cannot be async.`);return new _C(r.makeOutput(i),[])};function sw(){throw Error(`Attempted to use an abstract placeholder from a mapper function. Please make sure your map function has no side effects.`)}var cw=class extends lC{mapper;idx;constructor(e,t){super(),this.mapper=e,this.idx=t}dup(){return this}dispose(){}get(e){if(e.length==0)return this;if(aw)return aw.pushGet(this,e);sw()}call(e,t){t.dispose(),sw()}map(e,t,n){for(let e of t)e.dispose();sw()}pull(){sw()}ignoreUnhandledRejections(){}onBroken(e){sw()}},lw=class{captures;variables;constructor(e,t){this.captures=e,this.variables=[t]}dispose(){for(let e of this.variables)e.dispose()}apply(e){try{if(e.length<1)throw Error(`Invalid empty mapper function.`);for(let t of e.slice(0,-1)){let e=new GC(this).evaluateCopy(t);if(e.value instanceof gC){let t=bC(e.value);if(t){this.variables.push(t);continue}}this.variables.push(new DC(e))}return new GC(this).evaluateCopy(e[e.length-1])}finally{for(let e of this.variables)e.dispose()}}importStub(e){throw Error(`A mapper function cannot refer to exports.`)}importPromise(e){return this.importStub(e)}getExport(e){return e<0?this.captures[-e-1]:this.variables[e]}getPipeReadable(e){throw Error(`A mapper function cannot use pipe readables.`)}getLimits(){return jC}};function uw(e,t,n,r,i){let a=new lw(r,new DC(wC.deepCopyFrom(e,t,n)));try{return a.apply(i)}finally{a.dispose()}}oC.applyMap=(e,t,n,r,i)=>{try{let a;if(e instanceof _C)throw Error(`applyMap() can't be called on RpcPromise`);if(e instanceof Array){let t=[];try{for(let a of e)t.push(uw(a,e,n,r,i))}catch(e){for(let e of t)e.dispose();throw e}a=wC.fromArray(t)}else a=e==null?wC.fromAppReturn(e):uw(e,t,n,r,i);return new DC(a)}finally{for(let e of r)e.dispose()}};var dw=class e extends lC{state;static create(t){let n=t.getWriter();return new e({refcount:1,writer:n,closed:!1})}constructor(e,t){super(),this.state=e,t&&++e.refcount}getState(){if(this.state)return this.state;throw Error(`Attempted to use a WritableStreamStubHook after it was disposed.`)}call(e,t){try{let n=this.getState();if(e.length!==1||typeof e[0]!=`string`)throw Error(`WritableStream stub only supports direct method calls`);let r=e[0];if(r!==`write`&&r!==`close`&&r!==`abort`)throw Error(`Unknown WritableStream method: ${r}`);return(r===`close`||r===`abort`)&&(n.closed=!0),new AC((r===`write`?t.deliverStreamWrite(n.writer):t.deliverCall(n.writer[r],n.writer)).then(e=>new DC(e)))}catch(e){return t.dispose(),new uC(e)}}map(e,t,n){for(let e of t)e.dispose();return new uC(Error(`Cannot use map() on a WritableStream`))}get(e){return new uC(Error(`Cannot access properties on a WritableStream stub`))}dup(){let t=this.getState();return new e(t,this)}pull(){return Promise.reject(Error(`Cannot pull a WritableStream stub`))}ignoreUnhandledRejections(){}dispose(){let e=this.state;this.state=void 0,e&&--e.refcount===0&&(e.closed||e.writer.abort(Error(`WritableStream RPC stub was disposed without calling close()`)).catch(()=>{}),e.writer.releaseLock())}onBroken(e){this.getState().writer.closed.then(void 0,e)}},fw=262144,pw=1073741824,mw=65536,hw=2,gw=1.25,_w=.9,vw=3,yw=class{now;window=fw;bytesInFlight=0;inStartupPhase=!0;delivered=0;deliveredTime=0;firstAckTime=0;firstAckDelivered=0;minRtt=1/0;roundsWithoutIncrease=0;lastRoundWindow=0;roundStartTime=0;constructor(e){this.now=e}onSend(e){this.bytesInFlight+=e;let t={sentTime:this.now(),size:e,deliveredAtSend:this.delivered,deliveredTimeAtSend:this.deliveredTime,windowAtSend:this.window,windowFullAtSend:this.bytesInFlight>=this.window};return{token:t,shouldBlock:t.windowFullAtSend}}onError(e){this.bytesInFlight-=e.size}onAck(e){let t=this.now();this.delivered+=e.size,this.deliveredTime=t,this.bytesInFlight-=e.size;let n=t-e.sentTime;if(this.minRtt=Math.min(this.minRtt,n),this.firstAckTime===0)this.firstAckTime=t,this.firstAckDelivered=this.delivered;else{let n,r;e.deliveredTimeAtSend===0?(n=this.firstAckTime,r=this.firstAckDelivered):(n=e.deliveredTimeAtSend,r=e.deliveredAtSend);let i=t-n,a=(this.delivered-r)/i,o=this.inStartupPhase?hw:gw,s=a*this.minRtt*o;s=Math.min(s,e.windowAtSend*o),s=e.windowFullAtSend?Math.max(s,e.windowAtSend*_w):Math.max(s,this.window),this.window=Math.max(Math.min(s,pw),mw),this.inStartupPhase&&e.sentTime>=this.roundStartTime&&(this.window>this.lastRoundWindow*gw?this.roundsWithoutIncrease=0:++this.roundsWithoutIncrease>=vw&&(this.inStartupPhase=!1),this.roundStartTime=t,this.lastRoundWindow=this.window)}return this.bytesInFlight<this.window}};function bw(e){let t,n=!1,r=new yw(()=>performance.now()),i,a,o=()=>{n||(n=!0,e.dispose())};return new WritableStream({start(n){e.onBroken(e=>{t===void 0&&(t=e,n.error(e),o()),a&&=(a(e),i=void 0,void 0)})},write(n,s){if(t!==void 0)throw t;let c=wC.fromAppParams([n]),{promise:l,size:u}=e.stream([`write`],c);if(u===void 0)return l.catch(e=>{throw t===void 0&&(t=e),e});{let{token:e,shouldBlock:n}=r.onSend(u);if(l.then(()=>{r.onAck(e)&&i&&(i(),i=void 0,a=void 0)},n=>{r.onError(e),t===void 0&&(t=n,s.error(n),o()),a&&=(a(n),i=void 0,void 0)}),n)return new Promise((e,t)=>{i=e,a=t})}},async close(){if(t!==void 0)throw o(),t;let{promise:n}=e.stream([`close`],wC.fromAppParams([]));try{await n}catch(e){throw t??e}finally{o()}},abort(n){if(t!==void 0)return;t=n??Error(`WritableStream was aborted`),a&&=(a(t),i=void 0,void 0);let{promise:r}=e.stream([`abort`],wC.fromAppParams([n]));r.then(()=>o(),()=>o())}})}var xw=class e extends lC{state;static create(t){return new e({refcount:1,stream:t,canceled:!1})}constructor(e,t){super(),this.state=e,t&&++e.refcount}call(e,t){return t.dispose(),new uC(Error(`Cannot call methods on a ReadableStream stub`))}map(e,t,n){for(let e of t)e.dispose();return new uC(Error(`Cannot use map() on a ReadableStream`))}get(e){return new uC(Error(`Cannot access properties on a ReadableStream stub`))}dup(){let t=this.state;if(!t)throw Error(`Attempted to dup a ReadableStreamStubHook after it was disposed.`);return new e(t,this)}pull(){return Promise.reject(Error(`Cannot pull a ReadableStream stub`))}ignoreUnhandledRejections(){}dispose(){let e=this.state;this.state=void 0,e&&--e.refcount===0&&(e.canceled||(e.canceled=!0,e.stream.locked||e.stream.cancel(Error(`ReadableStream RPC stub was disposed without being consumed`)).catch(()=>{})))}onBroken(e){}};cC.createWritableStreamHook=dw.create,cC.createWritableStreamFromHook=bw,cC.createReadableStreamHook=xw.create;var Sw=gC,Cw=tC,ww=rw;function Tw(e){return e<32||e>=127&&e<=159||e===1564||e>=8203&&e<=8207||e===8232||e===8233||e>=8234&&e<=8238||e>=8294&&e<=8297||e===65279}function Ew(e,t=80){let n=``;for(let t=0;t<e.length;t+=1){let r=e.charCodeAt(t);n+=Tw(r)?` `:e.charAt(t)}return n=n.replace(/\s+/gu,` `).trim(),n.length<=t?n:`${n.slice(0,Math.max(0,t-1)).trimEnd()}…`}function Dw(e,t){let n=e.find(e=>e.id===t.itemId);if(n===void 0||n.kind===`text`)return!1;if(n.kind===`menu`){let e=n.options.find(e=>e.id===t.optionId);return e!==void 0&&e.disabled!==!0}return t.optionId===void 0?n.kind!==`button`||n.disabled!==!0:!1}Object.freeze({publish:()=>Promise.resolve(),onBack:()=>()=>void 0,onForward:()=>()=>void 0,onActivate:()=>()=>void 0});function Ow(e,t){if(t.kind===`action`){let n=[...e.primary??[],...e.menu??[]].find(e=>e.id===t.actionId);return n!==void 0&&n.disabled!==!0}let n=e.crumbs?.find(e=>e.id===t.crumbId);return n===void 0?!1:t.siblingId===void 0||n.siblings?.some(e=>e.id===t.siblingId)===!0}var kw=`fungi.app.ready`,Aw=`fungi.app.connect`,X=e=>ax.pipe(q(Nx(1)),q(Ix(e))),jw=e=>B(X(e)),Mw=ox.pipe(q(jx()),q(_x(Number.isSafeInteger,{message:`Expected a safe integer`}))),Nw=Mw.pipe(q(Ox(0))),Pw=Mw.pipe(q(Dx(0))),Fw=W({appId:X(160),releaseId:X(160),surfaceId:X(160)}),Iw=W({editing:U,surface:ux([X(160),rx])}),Lw=ux([W({kind:V(`compose`),requestId:X(160),text:X(2e3)}),W({kind:V(`navigate`),requestId:X(160),params:G(W({key:X(64),value:X(4096)})).pipe(q(Ix(16)))})]),Rw=nx(K([`granted`,`missing`])),zw=W({"agent.list":Rw,"agent.manage":Rw,"agent.read":Rw,"agent.send":Rw,"computer.list":Rw,"computer.readFile":Rw,"computer.writeFile":Rw,"computer.execute":Rw,"git.repository":Rw,"workflow.publish":Rw,"workflow.arm":Rw,"workflow.run":Rw,"app.events.emit":Rw,"llm.generation":Rw,"media.generation":Rw,"media.share":Rw}),Bw=K([`ready`,`missing`,`unknown`]),Vw=W({models:Bw,media:Bw,git:Bw,terminal:K([`ready`,`exec-only`,`missing`,`unknown`]),terminalReason:B(ax)}),Hw=K([`model`,`media`,`git`,`computer`]),Uw=K([`opened`,`unavailable`]),Ww=W({computerId:ux([X(256),rx]),teamHasComputers:B(dx(U)),computerAccessGranted:B(U),setup:B(Vw),permissions:B(zw),focus:Iw,openRequest:ux([rx,Lw]),visibility:K([`visible`,`hidden`])}),Gw=K([`connecting`,`connected`,`suspended`,`disconnected`,`disposing`,`disposed`]),Kw=W({altKey:U,ctrlKey:U,id:X(160),key:X(64),metaKey:U,shiftKey:U}),qw=W({action:B(H),availability:B(H),category:X(160),description:jw(512),id:X(160),projections:B(H),title:X(160)}),Jw=W({arguments:B(H),commandId:X(321),origin:K([`agent`,`browser`,`keyboard`,`menu`,`palette`,`programmatic`,`slash`,`terminal`]),requestId:X(160)}),Yw=ux([W({result:B(H),status:V(`handled`)}),W({error:H,status:V(`failed`)})]),Xw=e=>X(e).pipe(q(_x(e=>{for(let t=0;t<e.length;t+=1)if(Tw(e.charCodeAt(t)))return!1;return!0},{message:`Expected one line of plain text`}))),Zw={id:X(64),text:Xw(80),end:nx(U),priority:nx(V(`low`))},Qw=nx(ox.pipe(q(jx()),q(Ax({minimum:0,maximum:9999})))),$w=G(ux([W({...Zw,kind:V(`text`),tone:nx(K([`neutral`,`success`,`warning`,`error`]))}),W({...Zw,kind:V(`button`),icon:nx(K([`folder`,`ports`,`processes`,`access`])),count:Qw,tone:nx(K([`neutral`,`success`,`warning`,`error`])),busy:nx(U),title:nx(Xw(1024)),disabled:nx(U),opens:nx(V(`dialog`)),expanded:nx(U)}),W({...Zw,kind:V(`toggle`),pressed:U}),W({...Zw,kind:V(`menu`),count:Qw,title:nx(Xw(1024)),options:G(W({id:X(64),text:Xw(80),checked:nx(U),disabled:nx(U)})).pipe(q(Ix(16)),q(_x(e=>new Set(e.map(e=>e.id)).size===e.length,{message:`Expected unique status option ids`})))})])).pipe(q(Ix(6)),q(_x(e=>new Set(e.map(e=>e.id)).size===e.length,{message:`Expected unique status item ids`}))),eT=W({computerId:X(256),path:X(1024)}),tT=X(80).pipe(q(_x(e=>e.trim()===e,{message:`Expected a trimmed title`}))),nT=X(64),rT=X(80),iT=e=>new Set(e.map(e=>e.id)).size===e.length,aT=W({id:nT,label:rT,siblings:B(G(W({id:nT,label:rT})).pipe(q(Ix(16)),q(_x(iT,{message:`Expected unique crumb sibling ids`}))))}),oT=W({id:nT,label:rT,icon:B(V(`play`)),variant:B(K([`primary`,`outline`,`ghost`])),tone:B(V(`destructive`)),disabled:B(U)}),sT=e=>G(oT).pipe(q(Ix(e)),q(_x(iT,{message:`Expected unique header command ids`}))),cT={status:B(G(W({id:nT,label:rT,presentation:B(V(`bead`)),tone:B(K([`neutral`,`info`,`warning`,`success`,`error`]))})).pipe(q(Ix(4)),q(_x(iT,{message:`Expected unique header status ids`})))),crumbs:B(G(aT).pipe(q(Ix(8)),q(_x(iT,{message:`Expected unique crumb ids`})))),primary:B(sT(3)),menu:B(sT(12))},lT=W({contractVersion:V(2),canGoBack:U,canGoForward:U,title:B(tT),...cT}),uT=W({canGoBack:U,canGoForward:U,title:B(ax),...cT}),dT=ux([W({kind:V(`crumb`),crumbId:nT,siblingId:B(nT)}),W({kind:V(`action`),actionId:nT})]),fT=dx(W({agentId:X(256),sessionId:X(256)})),pT=e=>B(G(K(e)).pipe(q(Ix(e.length)))),mT=W({agents:B(G(K([`agent.list`,`agent.manage`,`agent.read`,`agent.send`])).pipe(q(Ix(4)))),computers:B(G(K([`computer.list`,`computer.readFile`,`computer.writeFile`,`computer.execute`])).pipe(q(Ix(4)))),git:pT([`git.repository`]),workflows:pT([`workflow.publish`,`workflow.arm`,`workflow.run`]),events:pT([`app.events.emit`]),generation:pT([`llm.generation`,`media.generation`,`media.share`])}),hT=K([`granted`,`declined`,`customize`]),gT=W({message:X(512),tone:B(K([`info`,`success`,`warning`,`error`]))}),_T=K(Zx);W({code:_T.pick([`DELIVERY_PENDING`])});var vT=W({code:_T,message:X(512),retryable:U,need:nx(Kx)}),yT=W({protocolVersion:V(2),type:V(kw)}),bT=W({epoch:X(160),protocolVersion:V(2),type:V(Aw)}),xT=W({epoch:X(160),protocolVersion:V(2)}),ST={[Symbol.dispose]:B(H)},CT=ux([W({...ST,ok:V(!0),value:H}),W({...ST,error:vT,ok:V(!1)})]);function Z(e,t,n=`PROTOCOL`){return Ps($b(e,{onExcessProperty:`error`}),Vu({onFailure:e=>{throw new J(`The peer sent malformed protocol data`,{cause:e,code:n,retryable:!1})},onSuccess:t}))}function Q(e){return Object.freeze(e)}function wT(e,t){let n=e.arguments===void 0?void 0:is(e.arguments),r={origin:e.origin,signal:t};return n!==void 0&&Object.assign(r,{arguments:n}),Q(r)}var TT=Z(qw,e=>{let t={category:e.category,id:e.id,title:e.title};return e.action!==void 0&&Object.assign(t,{action:e.action}),e.availability!==void 0&&Object.assign(t,{availability:e.availability}),e.description!==void 0&&Object.assign(t,{description:e.description}),e.projections!==void 0&&Object.assign(t,{projections:e.projections}),Q(gE(()=>_s(t)))},`INVALID_ARGUMENT`),ET=Z(X(321),e=>e),DT=Z(Jw,e=>{let t=e.arguments===void 0?void 0:is(e.arguments),n={commandId:e.commandId,origin:e.origin,requestId:e.requestId};return t!==void 0&&Object.assign(n,{arguments:t}),Q(n)}),OT=Z(ux([ix,H]),e=>e===void 0?void 0:is(e)),kT=Z(bT,e=>Q(e));Z(xT,e=>Q(e));var AT=Z(Ww,e=>{let t={computerId:e.computerId,focus:Q({...e.focus}),openRequest:e.openRequest===null?null:Q({...e.openRequest}),visibility:e.visibility};return e.teamHasComputers!==void 0&&(t.teamHasComputers=e.teamHasComputers),e.computerAccessGranted!==void 0&&(t.computerAccessGranted=e.computerAccessGranted),e.setup!==void 0&&(t.setup=Q({...e.setup})),e.permissions!==void 0&&(t.permissions=Q({...e.permissions})),Q(t)}),jT=Z(vT,e=>Q({...e})),MT=Z(Iw,e=>Q({...e}),`INVALID_ARGUMENT`),NT=Z(Fw,e=>Q({...e})),PT=Z(Gw,e=>e),FT=Z($w,e=>Q(e.map(e=>e.kind===`menu`?Q({...e,options:Q(e.options.map(e=>Q(e)))}):Q(e))),`INVALID_ARGUMENT`),IT=Z(W({itemId:X(64),optionId:nx(X(64)),anchor:nx(W({start:ox.pipe(q(Ax({minimum:0,maximum:1e5}))),width:ox.pipe(q(Ax({minimum:0,maximum:1e5})))}))}),e=>Q(e.anchor===void 0?{...e}:{...e,anchor:Q({...e.anchor})}),`INVALID_ARGUMENT`),LT=Z(eT,e=>Q({...e}),`INVALID_ARGUMENT`);function RT(e){let t={id:e.id,label:e.label};return e.presentation!==void 0&&(t={...t,presentation:e.presentation}),e.tone!==void 0&&(t={...t,tone:e.tone}),Q(t)}function zT(e){let t={id:e.id,label:e.label};return e.siblings===void 0?Q(t):Q({...t,siblings:Q(e.siblings.map(e=>Q({...e})))})}function BT(e){let t={id:e.id,label:e.label};return e.icon!==void 0&&(t={...t,icon:e.icon}),e.variant!==void 0&&(t={...t,variant:e.variant}),e.tone!==void 0&&(t={...t,tone:e.tone}),e.disabled!==void 0&&(t={...t,disabled:e.disabled}),Q(t)}function VT(e){let t={canGoBack:e.canGoBack,canGoForward:e.canGoForward};return e.title!==void 0&&(t={...t,title:e.title}),e.crumbs!==void 0&&(t={...t,crumbs:Q(e.crumbs.map(zT))}),e.primary!==void 0&&(t={...t,primary:Q(e.primary.map(BT))}),e.menu!==void 0&&(t={...t,menu:Q(e.menu.map(BT))}),e.status!==void 0&&(t={...t,status:Q(e.status.map(RT))}),Q(t)}var HT=Z(lT,VT,`INVALID_ARGUMENT`),UT=Z(uT,e=>{let t=e.title?.trim();return WT({...VT({...e,title:t===void 0||t.length===0?void 0:t}),contractVersion:2})},`INVALID_ARGUMENT`),WT=Z(lT,e=>Q({...VT(e),contractVersion:2}),`INVALID_ARGUMENT`),GT=Z(dT,e=>e.kind===`action`?Q({...e}):Q(e.siblingId===void 0?{kind:e.kind,crumbId:e.crumbId}:e),`INVALID_ARGUMENT`),KT=Z(fT,e=>e===null?null:Q({...e}),`INVALID_ARGUMENT`),qT=Z(mT,e=>Q({agents:Q([...new Set(e.agents??[])]),computers:Q([...new Set(e.computers??[])]),...e.git&&{git:Q([...new Set(e.git)])},...e.workflows&&{workflows:Q([...new Set(e.workflows)])},...e.events&&{events:Q([...new Set(e.events)])},...e.generation&&{generation:Q([...new Set(e.generation)])}}),`INVALID_ARGUMENT`),JT=Z(Hw,e=>e,`INVALID_ARGUMENT`);Z(yT,e=>Q(e));var YT=Z(X(512),e=>e),XT=Z(gT,e=>Q({...e}),`INVALID_ARGUMENT`);Z(W({id:X(160),repeat:U}),e=>Q(e));var ZT=Z(G(Kw).pipe(q(Ix(64))),e=>{if(new Set(e.map(e=>e.id)).size!==e.length)throw new J(`Reserved chords are invalid`,{code:`PROTOCOL`,retryable:!1});return Q(e.map(e=>Q({...e})))});function QT(e){return Z(W({value:H,version:Nw}),t=>Q({value:e(t.value),version:t.version}))}var $T=QT(AT),eE=Z(W({capabilities:G(H).pipe(q(Ix(128))),context:H}),e=>Q({capabilities:Q(e.capabilities.map(e=>oE(e))),context:$T(e.context)})),tE=QT(PT),nE=QT(ZT),rE=QT(YT),iE=Ps(tE,e=>{if(e.value!==`connected`&&e.value!==`suspended`)throw new J(`The host lifecycle is invalid`,{code:`PROTOCOL`,retryable:!1});return Q({value:e.value,version:e.version})});function aE(e){return Z(W({handle:H,id:X(160),version:Pw}),t=>{if(!(t.handle instanceof Sw)&&!(e&&t.handle instanceof Cw))throw new J(`A capability handle is invalid`,{code:`PROTOCOL`,retryable:!1});return Q({handle:t.handle,id:t.id,version:t.version})})}var oE=aE(!1),sE=aE(!0);function cE(e){let t=e?sE:oE;return Z(W({capabilities:G(H).pipe(q(Ix(128))),context:H,identity:H,lifecycle:H,reservedChords:H,theme:H}),e=>Q({capabilities:Q(e.capabilities.map(e=>t(e))),context:$T(e.context),identity:NT(e.identity),lifecycle:iE(e.lifecycle),reservedChords:nE(e.reservedChords),theme:rE(e.theme)}))}var lE=cE(!1);cE(!0);function uE(e){return Z(CT,t=>t.ok?Q({ok:!0,value:e(t.value)}):Q({ok:!1,error:jT(t.error)}))}var dE=uE(lE),fE=uE(Z(W({commandId:X(321)}),e=>Q(e)));uE(Z(Yw,e=>{if(e.status===`failed`)return Q({status:`failed`,error:gE(()=>os(e.error))});let t=e.result===void 0?void 0:is(e.result);return Q(t===void 0?{status:`handled`}:{status:`handled`,result:t})}));var pE=uE(Z(ix,()=>void 0)),mE=uE(Z(hT,e=>e)),hE=uE(Z(Uw,e=>e));uE(Z(U,e=>e)),uE(Z(U,e=>e));function gE(e){try{return e()}catch(e){throw new J(`The command metadata is invalid`,{cause:e,code:`INVALID_ARGUMENT`,retryable:!1})}}var _E=ux([W({kind:V(`saveFile`),name:X(255).pipe(q(bx(/^[^\p{Cc}/\\]+$/u))),mime:X(255),bytes:Wx}),W({kind:V(`copyText`),text:ax})]);function vE(e){let t=$b(_E,{onExcessProperty:`error`})(e);if(Ru(t))return{kind:`refused`,reason:`invalid-request`};let n=t.success;return n.kind===`saveFile`?n.name===`.`||n.name===`..`?{kind:`refused`,reason:`invalid-request`}:n.bytes.byteLength>33554432?{kind:`refused`,reason:`too-large`}:{...n,bytes:new Uint8Array(n.bytes)}:n.text.length>1048576||new TextEncoder().encode(n.text).byteLength>1048576?{kind:`refused`,reason:`too-large`}:n}var yE=uE(Z(ux([W({kind:V(`saved`)}),W({kind:V(`copied`)}),W({kind:V(`refused`),reason:K([`no-user-gesture`,`too-large`,`invalid-request`,`unavailable`,`denied`,`busy`])})]),e=>Q(e)));function bE(e){let t=e,n=new Set;return{get:()=>t,subscribe(e){n.add(e);let t=!0;return()=>{t&&(t=!1,n.delete(e))}},update(e){if(!Object.is(t,e)){t=e;for(let e of Array.from(n))try{e(t)}catch(e){console.warn(`App store subscriber failed`,e)}}}}}function xE(e){let t=new Map,n=bE(0),r=!1,i=e=>{let t=new Map;try{for(let n of e){let e=oE(n),r=EE(e.id,e.version);if(t.has(r))throw CE(e.handle),new J(`Duplicate capability grant`,{code:`PROTOCOL`,retryable:!1});t.set(r,e.handle)}}catch(e){for(let e of t.values())CE(e);throw e}return t};for(let[n,r]of i(e))t.set(n,r);let a=e=>{for(let t of e)CE(t)},o=e=>{if(r)throw new J(`The app connection is disposed`,{code:`DISCONNECTED`,retryable:!0});let n=EE(e.id,e.version);return t.get(n)};return{directory:Object.freeze({get version(){return n.get()},subscribe:e=>n.subscribe(e),has(e){return!!o(e)},require(e){let t=o(e);if(!t)throw new J(`The capability is not granted`,{code:`CAPABILITY_DENIED`,retryable:!1});try{return e.schema.parse(t)}catch(e){throw new J(`The capability interface is malformed`,{cause:e,code:`PROTOCOL`,retryable:!1})}}}),replace(e){if(r)throw new J(`The app connection is disposed`,{code:`DISCONNECTED`,retryable:!0});let o=i(e),s=[...t.values()];t.clear();for(let[e,n]of o)t.set(e,n);a(s.filter(e=>![...o.values()].includes(e))),n.update(n.get()+1)},disconnect(){r||(r=!0,a(t.values()),t.clear(),n.update(n.get()+1))}}}var SE=Qa().transform(e=>{let t=Qo(Object).safeParse(e);if(!t.success)return;let n=Object.create(t.data),r=ex(W({[Symbol.dispose]:B(hx(Function))}))(n);return{owner:t.data,dispose:r[Symbol.dispose]}});function CE(e){try{let t=SE.parse(e);if(t===void 0||TE.has(t.owner))return;TE.add(t.owner),t.dispose?.call(t.owner)}catch(e){console.warn(`RPC value disposal failed`,e)}}function wE(e){return{value:e,[Symbol.dispose](){CE(e)}}}var TE=new WeakSet;function EE(e,t){return`${e}@${String(t)}`}var DE=class{id;version;#e;constructor(e,t,n){this.id=e,this.version=t,this.#e=n,Object.freeze(this)}get schema(){return this.#e}};function OE(e,t,n){return new DE(e,t,n)}function kE(e){let t=j(e),n=Qo(Object),r=j(Object.fromEntries(Object.keys(e).map(e=>[e,Qa().optional()])));return Qa().transform(e=>{let i=n.parse(e),a=Object.create(i),o=r.parse(a),s=Object.fromEntries(Object.entries(o).flatMap(([e,t])=>t===void 0?[]:[[e,qo().parse(t).bind(i)]]));return{...t.parse(s),[Symbol.dispose](){CE(e)}}})}function AE(e){return Qa().transform(t=>{try{return e.parse(t)}catch(e){throw e instanceof J?e:new J(`The capability returned malformed data`,{cause:e,code:`PROTOCOL`,retryable:!1})}finally{CE(t)}})}function jE(e){return qo({output:Go(Qa().transform(t=>{try{return e.parse(t)}catch(e){throw CE(t),e instanceof J?e:new J(`The capability returned a malformed result`,{cause:e,code:`PROTOCOL`,retryable:!1})}}))})}var ME=jE(AE(no()));kE({fetch:jE(Qo(Response)),close:ME});var NE=Object.freeze({alphaIntercept:-9,alphaSlope:19,blurStdDeviation:1.5}),PE=Object.freeze([`2xs`,`xs`,`sm`,`md`,`lg`,`xl`,`2xl`,`3xl`,`4xl`]);Object.freeze(`--stipe-font-synthesis.--stipe-surface-frame-width.--stipe-surface-frame-image.--stipe-surface-molding-contrast.--stipe-shadow-raised.--stipe-shadow-inset.--stipe-shadow-edge.--stipe-display-gasket-face.--stipe-display-texture-image.--stipe-display-text-shadow.--stipe-canvas.--stipe-surface.--stipe-surface-raised.--stipe-surface-selected.--stipe-fg-muted.--stipe-linework.--stipe-hairline.--stipe-hairline-quiet.--stipe-figure-ink.--stipe-density-compact.--stipe-density-comfortable.--stipe-motion-spring.--stipe-motion-squish.--stipe-motion-fast.--stipe-motion-normal.--stipe-motion-slow.--stipe-motion-ease.--stipe-motion-ease-exit.--stipe-motion-bounce.--stipe-motion-spring-duration.--stipe-motion-stretch.--stipe-motion-distance.--stipe-motion-stagger.--stipe-motion-blur.--stipe-motion-shake.--stipe-motion-steps.--stipe-motion-fuse.--stipe-press-depth.--stipe-press-scale.--stipe-layer-desktop.--stipe-layer-windows.--stipe-layer-chrome.--stipe-layer-popover.--stipe-layer-dialog.--stipe-layer-toast.--stipe-layer-tooltip.--stipe-overlay-shadow-outset.--stipe-icon-size-sm.--stipe-icon-size-md.--stipe-icon-size-lg.--stipe-icon-stroke.--stipe-card-rim.--stipe-card-rim-edge.--stipe-card-face.--stipe-card-panel.--stipe-card-ink.--stipe-card-ink-muted.--stipe-card-accent.--stipe-card-shadow.--stipe-card-foil-highlight.--stipe-card-foil-warm.--stipe-card-foil-cool.--stipe-avatar-shadow.--stipe-art-coral.--stipe-art-blue.--stipe-art-mint.--stipe-art-grape.--stipe-art-yellow.--stipe-art-cream.--stipe-art-ink.--stipe-art-inkcap.--stipe-art-graphite.--stipe-sketch-ink`.split(`.`));function FE(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=FE(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function IE(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=FE(e))&&(r&&(r+=` `),r+=t);return r}var LE=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,RE=IE,zE=(e,t)=>n=>{if(t?.variants==null)return RE(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=LE(t)||LE(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 RE(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)},BE=Object.defineProperty,VE=((e,t)=>{let n={};for(var r in e)BE(n,r,{get:e[r],enumerable:!0});return t||BE(n,Symbol.toStringTag,{value:`Module`}),n})({isAny:()=>tD,isAnyNonArbitrary:()=>oD,isArbitraryFamilyName:()=>CD,isArbitraryImage:()=>TD,isArbitraryLength:()=>bD,isArbitraryNumber:()=>xD,isArbitraryPosition:()=>wD,isArbitraryShadow:()=>ED,isArbitrarySize:()=>vD,isArbitraryValue:()=>yD,isArbitraryVariable:()=>DD,isArbitraryVariableFamilyName:()=>kD,isArbitraryVariableImage:()=>MD,isArbitraryVariableLength:()=>OD,isArbitraryVariablePosition:()=>AD,isArbitraryVariableShadow:()=>ND,isArbitraryVariableSize:()=>jD,isArbitraryVariableWeight:()=>PD,isArbitraryWeight:()=>SD,isFraction:()=>XE,isInteger:()=>QE,isNamedContainerQuery:()=>sD,isNumber:()=>ZE,isPercent:()=>$E,isTshirtSize:()=>eD}),HE=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,UE=/^\((?:(\w[\w-]*):)?(.+)\)$/i,WE=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,GE=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,KE=/\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$/,qE=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,JE=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,YE=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,XE=e=>WE.test(e),ZE=e=>!!e&&!Number.isNaN(Number(e)),QE=e=>!!e&&Number.isInteger(Number(e)),$E=e=>e.endsWith(`%`)&&ZE(e.slice(0,-1)),eD=e=>GE.test(e),tD=()=>!0,nD=e=>KE.test(e)&&!qE.test(e),rD=()=>!1,iD=e=>JE.test(e),aD=e=>YE.test(e),oD=e=>!yD(e)&&!DD(e),sD=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)),cD=(e,t,n)=>{let r=HE.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},lD=(e,t,n=!1)=>{let r=UE.exec(e);return r?r[1]?t(r[1]):n:!1},uD=e=>e===`position`||e===`percentage`,dD=e=>e===`image`||e===`url`,fD=e=>e===`length`||e===`size`||e===`bg-size`,pD=e=>e===`length`,mD=e=>e===`number`,hD=e=>e===`family-name`,gD=e=>e===`number`||e===`weight`,_D=e=>e===`shadow`,vD=e=>cD(e,fD,rD),yD=e=>HE.test(e),bD=e=>cD(e,pD,nD),xD=e=>cD(e,mD,ZE),SD=e=>cD(e,gD,tD),CD=e=>cD(e,hD,rD),wD=e=>cD(e,uD,rD),TD=e=>cD(e,dD,aD),ED=e=>cD(e,_D,iD),DD=e=>UE.test(e),OD=e=>lD(e,pD),kD=e=>lD(e,hD),AD=e=>lD(e,uD),jD=e=>lD(e,fD),MD=e=>lD(e,dD),ND=e=>lD(e,_D,!0),PD=e=>lD(e,gD,!0),FD=(e,t)=>{let n=Object.keys(e);return n.length===1&&n[0]===t&&typeof e[t]==`string`},ID=e=>typeof e==`function`&&e.isThemeGetter===!0,LD=e=>({...e,theme:{...e.theme},classGroups:{...e.classGroups},conflictingClassGroups:{...e.conflictingClassGroups},conflictingClassGroupModifiers:{...e.conflictingClassGroupModifiers},orderSensitiveModifiers:[...e.orderSensitiveModifiers],postfixLookupClassGroups:[...e.postfixLookupClassGroups??[]]}),RD=(e,t)=>{let n=LD(e);t.prefix!==void 0&&(n.prefix=t.prefix);let r=(e,t)=>{if(t)for(let n in t)t[n]!==void 0&&(e[n]=t[n])},i=t.override;i&&(i.orderSensitiveModifiers&&(n.orderSensitiveModifiers=[...i.orderSensitiveModifiers]),r(n.theme,i.theme),r(n.classGroups,i.classGroups),r(n.conflictingClassGroups,i.conflictingClassGroups),r(n.conflictingClassGroupModifiers,i.conflictingClassGroupModifiers));let a=(e,t)=>{if(t)for(let n in t){let r=t[n];r&&(e[n]=(e[n]??[]).concat(r))}},o=t.extend;return o&&(o.orderSensitiveModifiers&&(n.orderSensitiveModifiers=[...n.orderSensitiveModifiers,...o.orderSensitiveModifiers]),a(n.theme,o.theme),a(n.classGroups,o.classGroups),a(n.conflictingClassGroups,o.conflictingClassGroups),a(n.conflictingClassGroupModifiers,o.conflictingClassGroupModifiers)),n},zD={isAny:0,isAnyNonArbitrary:1,isArbitraryValue:2,isArbitraryVariable:3,isFraction:4,isNumber:5,isInteger:6,isPercent:7,isTshirtSize:8,isNamedContainerQuery:9,isArbitraryLength:10,isArbitraryNumber:11,isArbitraryWeight:12,isArbitraryFamilyName:13,isArbitraryPosition:14,isArbitrarySize:15,isArbitraryImage:16,isArbitraryShadow:17,isArbitraryVariableLength:18,isArbitraryVariableFamilyName:19,isArbitraryVariablePosition:20,isArbitraryVariableSize:21,isArbitraryVariableImage:22,isArbitraryVariableShadow:23,isArbitraryVariableWeight:24},BD=25,VD=()=>({names:[],idByName:new Map,impls:{},fnName:new Map,classifierFns:new Map}),HD=(e,t,n)=>{let r=e.idByName.get(t);return r===void 0&&(r=e.names.length,e.names.push(t),e.idByName.set(t,r),e.classifierFns.set(t,n)),r},UD=(e,t)=>{if(typeof t==`function`){let n=e.fnName.get(t);return n===void 0&&(n=`$c`+e.fnName.size,e.fnName.set(t,n),e.impls[n]=t),HD(e,n,t)}let n=t.$v,r=VE[n];if(zD[n]===void 0||!r)throw Error(`cn: unknown validator "${n}"`);return HD(e,n,r)},WD=()=>({nextPart:new Map,validators:null,classGroupId:-1,lit:[]}),GD=(e,t)=>e.theme[t]??[],KD=(e,t,n)=>{let r=WD(),i=(e,t)=>{for(let n of t.split(`-`)){let t=e.nextPart.get(n);t||(t=WD(),e.nextPart.set(n,t)),e=t}return e},a=(n,r,o)=>{if(typeof n==`string`){let e=n===``?r:i(r,n);e.classGroupId=o;return}if(typeof n==`function`){if(ID(n)){for(let t of n(e.theme))a(t,r,o);return}(r.validators??=[]).push({validatorId:UD(t,n),groupId:o});return}if(FD(n,`$t`)){for(let t of GD(e,n.$t))a(t,r,o);return}if(FD(n,`$v`)){(r.validators??=[]).push({validatorId:UD(t,n),groupId:o});return}for(let[e,t]of Object.entries(n)){let n=i(r,e);for(let e of t)a(e,n,o)}};for(let[t,i]of Object.entries(e.classGroups)){let e=n(t);for(let t of i)a(t,r,e)}return r},qD=e=>{let t=VD(),n=[],r=new Map,i=e=>{let t=r.get(e);return t===void 0&&(t=n.length,n.push(e),r.set(e,t)),t},a=KD(e,t,i),o=e=>{if(e.validators)return!1;for(let t of e.nextPart.values())if(!o(t))return!1;return!0},s=(e,t,n)=>{e.classGroupId>=0&&n.push({tail:t,gid:e.classGroupId});for(let[r,i]of e.nextPart)s(i,t+`-`+r,n)},c=e=>{for(let[t,n]of[...e.nextPart])o(n)?(s(n,t,e.lit),e.nextPart.delete(t)):c(n)};c(a);let l=[{edges:new Map,groupId:-1,vlist:-1}],u=()=>(l.push({edges:new Map,groupId:-1,vlist:-1}),l.length-1),d=[],f=new Map,p=e=>{let t=e.map(e=>e.validatorId+`:`+e.groupId).join(`,`),n=f.get(t);return n===void 0&&(n=d.length,d.push(e.map(e=>[e.validatorId,e.groupId])),f.set(t,n)),n},m=(e,t)=>{let n=e;for(let e=0;e<t.length;e++){let r=t.charCodeAt(e),i=l[n].edges.get(r);i===void 0&&(i=u(),l[n].edges.set(r,i)),n=i}return n},h=[],g=(e,t,n)=>{e.classGroupId>=0&&(l[t].groupId=e.classGroupId),e.validators&&(l[t].vlist=p(e.validators));for(let{tail:n,gid:r}of e.lit)h.push({anchor:t,tail:n,gid:r});for(let[r,i]of e.nextPart){let e=t;if(!n){let n=l[t].edges.get(45);n===void 0&&(n=u(),l[t].edges.set(45,n)),e=n}let a=m(e,r);g(i,a,!1)}};g(a,0,!0);let _=new Set(h.map(e=>e.anchor)),v=e=>l[e].groupId>=0||l[e].vlist>=0||_.has(e),y=new Map,b=[],ee=e=>{let t=b.length;y.set(e,t);let n={edges:[],groupId:l[e].groupId,vlist:l[e].vlist};b.push(n);let r=[...l[e].edges.entries()].sort((e,t)=>e[0]-t[0]);for(let[e,t]of r){let r=String.fromCharCode(e),i=t;for(;l[i].edges.size===1&&!v(i);){let[[e,t]]=l[i].edges.entries();r+=String.fromCharCode(e),i=t}n.edges.push({label:r,oldTarget:i})}for(let e of n.edges)ee(e.oldTarget);return t};ee(0);let te=b.length,ne=0;for(let e of b)ne+=e.edges.length;let re=new Int32Array(te),ie=new Int32Array(ne),x=``,S=new Int32Array(te),ae=new Int32Array(te),oe=[];{let e=0;for(let t=0;t<te;t++){let n=b[t];re[t]=n.edges.length;for(let t of n.edges)ie[e]=t.label.length,x+=t.label,oe.push(y.get(t.oldTarget)),e++;S[t]=n.groupId,ae[t]=n.vlist}}{let e=new Int32Array(te);for(let t=te-1;t>=0;t--){let n=1,r=t+1;for(let i=0;i<re[t];i++)n+=e[r],r+=e[r];e[t]=n}let t=0;for(let n=0;n<te;n++){let r=n+1;for(let i=0;i<re[n];i++){if(r!==oe[t])throw Error(`cn compiler: edge target mismatch at ${t}`);r+=e[r],t++}}}for(let e of h)e.anchor=y.get(e.anchor);{let e=new Int32Array(d.length).fill(-1),t=[];for(let n=0;n<te;n++){let r=ae[n];r>=0&&(e[r]===-1&&(e[r]=t.length,t.push(d[r])),ae[n]=e[r])}d.length=0,d.push(...t)}let C=0;for(let e of d)C+=e.length;let w=new Int32Array(C),se=new Int32Array(C);{let e=0;for(let t of d)for(let[n,r]of t)w[e]=n,se[e]=r,e++}h.sort((e,t)=>e.anchor-t.anchor||e.gid-t.gid||(e.tail<t.tail?-1:1));let ce=[];for(let e of h){let t=ce[ce.length-1];t&&t.anchor===e.anchor&&t.gid===e.gid?t.tails.push(e.tail):ce.push({anchor:e.anchor,gid:e.gid,tails:[e.tail],set:-1})}let T=new Map,le=[];for(let e of ce){let t=e.tails.join(` `),n=T.get(t);n===void 0&&(n=le.length,T.set(t,n),le.push(e.tails)),e.set=n}for(let e of le.flat())if(e.includes(`|`)||e.includes(` `))throw Error(`cn compiler: tail contains delimiter: `+e);let ue=new Set(le.flat()).size;ce.sort((e,t)=>e.anchor-t.anchor||e.set-t.set);for(let t of Object.values(e.conflictingClassGroups))for(let e of t)i(e);for(let t of Object.values(e.conflictingClassGroupModifiers))for(let e of t)i(e);for(let t of e.postfixLookupClassGroups??[])i(t);let de=n.length,fe=new Int32Array(de).fill(-1),pe=0,me=e=>(fe[e]===-1&&(fe[e]=pe++),fe[e]);for(let e=0;e<se.length;e++)se[e]=me(se[e]);for(let e of ce)e.gid=me(e.gid);for(let e=0;e<S.length;e++)S[e]>=0&&(S[e]=me(S[e]));for(let e=0;e<de;e++)fe[e]===-1&&(fe[e]=pe++);let he=Array(de);for(let e=0;e<de;e++)he[fe[e]]=n[e];let ge=[],_e=[],ve=[],ye=[],be=[];for(let t=0;t<de;t++){let n=he[t],i=(e.conflictingClassGroups[n]??[]).map(e=>fe[r.get(e)]),a=(e.conflictingClassGroupModifiers[n]??[]).map(e=>fe[r.get(e)]);i.length&&(ge.push(t),_e.push(i.length),ve.push(...i));for(let e of a)ye.push(t),be.push(e)}let xe=(e.postfixLookupClassGroups??[]).map(e=>fe[r.get(e)]),Se=[],Ce=new Int32Array(w.length);for(let e=0;e<w.length;e++){let n=t.names[w[e]],r=zD[n];if(r!==void 0)Ce[e]=r;else{let t=Se.indexOf(n);t===-1&&(t=Se.length,Se.push(n)),Ce[e]=BD+t}}let we=new Map,Te=[],Ee=[],De=[];{let e=0;for(let t of d){let n=[];for(let r=0;r<t.length;r++)n.push(Ce[e++]);let r=n.join(`,`),i=we.get(r);i===void 0&&(i=Te.length,we.set(r,i),Te.push(n.length),Ee.push(...n)),De.push(i)}}let Oe={};for(let e of Se)Oe[e]=t.classifierFns.get(e);return{G:de,customNames:Se,impls:Oe,edgeCounts:re,edgeLabelLen:ie,labelText:x,edgeTargetActual:oe,nodeGroup:S,nodeVlist:ae,nodeCount:te,totalEdges:ne,patCounts:Te,patOps:Ee,listPat:De,vlistGroup:se,litEntries:h,sets:le,attachments:ce,uniqueTailCount:ue,adjGid:ge,adjCnt:_e,adjTgt:ve,patGid:ye,patTgt:be,postfixLookup:xe,orderSensitiveModifiers:e.orderSensitiveModifiers.join(` `),prefix:e.prefix}},JD=e=>{let t=new Int32Array(e.length+1);for(let n=0;n<e.length;n++)t[n+1]=t[n]+e[n];return t},YD=e=>{let t=qD(e),n=t.litEntries.length,r=new Int32Array(n),i=new Int32Array(n),a=new Int32Array(n),o=``,s=new Int32Array(t.uniqueTailCount*2);{let e=new Map,n=0,c=0;for(let l of t.attachments)for(let u of t.sets[l.set]){let t=e.get(u);t===void 0&&(t=n++,e.set(u,t),s[t*2]=o.length,s[t*2+1]=u.length,o+=u),r[c]=l.anchor,i[c]=l.gid,a[c]=t,c++}}return{tables:{GROUP_COUNT:t.G,edgeStart:JD(t.edgeCounts),labelStart:JD(t.edgeLabelLen),labelText:t.labelText,edgeTarget:Int32Array.from(t.edgeTargetActual),nodeGroup:t.nodeGroup,nodeVlist:t.nodeVlist,vlistPat:JD(t.patCounts),vlistOps:Int32Array.from(t.patOps),vlistRef:Int32Array.from(t.listPat),vlistGroup:t.vlistGroup,litAnchor:r,litGroup:i,litPool:a,poolOffsets:s,poolText:o,adjGid:Int32Array.from(t.adjGid),adjStart:JD(t.adjCnt),adjTgt:Int32Array.from(t.adjTgt),patGid:Int32Array.from(t.patGid),patTgt:Int32Array.from(t.patTgt),postfixLookupGroups:Int32Array.from(t.postfixLookup),customValidatorNames:t.customNames,orderSensitiveModifiers:t.orderSensitiveModifiers},validatorImpls:t.impls,prefix:t.prefix}},XD=`line`in Error(),ZD=-1,QD=-1,$D=(e,t,n)=>{let r=2166136261;for(let i=t;i<n;i++)r=Math.imul(r^e.charCodeAt(i),16777619);return r},eO=(e,t,n)=>{let r=n-t,i=Math.imul(r,2654435761)^e.charCodeAt(t);if(r>3){let a=r>>2,o=r>>1;i=Math.imul(i^e.charCodeAt(t+1)<<8^e.charCodeAt(t+2)<<16^e.charCodeAt(t+a),2246822507),i=Math.imul(i^e.charCodeAt(t+o)<<8^e.charCodeAt(t+o+a)<<16^e.charCodeAt(n-3),3266489909),i^=e.charCodeAt(n-2)<<8^e.charCodeAt(n-1)<<16;for(let r=t+3,a=n-4;r<t+8&&r<a;r++,a--)i=Math.imul(i^e.charCodeAt(r)^e.charCodeAt(a)<<8,16777619)}return i^i>>>15|0},tO=(e,t,n={})=>{let{GROUP_COUNT:r,edgeStart:i,labelStart:a,labelText:o,edgeTarget:s,nodeGroup:c,nodeVlist:l,vlistPat:u,vlistOps:d,vlistRef:f,vlistGroup:p,litAnchor:m,litGroup:h,litPool:g,poolOffsets:_,poolText:v,adjGid:y,adjStart:b,adjTgt:ee,patGid:te,patTgt:ne,postfixLookupGroups:re,customValidatorNames:ie,orderSensitiveModifiers:x}=e,S=new Int32Array(r).fill(-1);for(let e=0;e<y.length;e++)S[y[e]]=e;let ae=0;for(let e=0;e+1<b.length;e++){let t=b[e+1]-b[e];t>ae&&(ae=t)}let oe=32;for(;oe<2*(1+ae+te.length);)oe<<=1;let C=new Int32Array(f.length+1);for(let e=0;e<f.length;e++)C[e+1]=C[e]+u[f[e]+1]-u[f[e]];let w=new Uint8Array(r);for(let e=0;e<re.length;e++)w[re[e]]=1;let se=i.length-1,ce=new Uint8Array(se),T=0,le=!0;for(let e=0;e<m.length;e++){ce[m[e]]=1;let t=_[g[e]*2+1];t>T&&(T=t);let n=v.charCodeAt(_[g[e]*2]);(n===91||n===40)&&(le=!1)}let ue=1;for(;ue<m.length*2;)ue<<=1;let de=new Int32Array(ue).fill(-1);for(let e=0;e<m.length;e++){let t=_[g[e]*2],n=($D(v,t,t+_[g[e]*2+1])^Math.imul(m[e],2654435761)|0)&ue-1;for(;de[n]!==-1;)n=n+1&ue-1;de[n]=e}let fe=(e,t,n,r)=>{let i=($D(t,n,r)^Math.imul(e,2654435761)|0)&ue-1,a=r-n;for(;;){let r=de[i];if(r===-1)return-1;if(m[r]===e&&_[g[r]*2+1]===a){let e=_[g[r]*2],i=!0;for(let r=0;r<a;r++)if(v.charCodeAt(e+r)!==t.charCodeAt(n+r)){i=!1;break}if(i)return h[r]}i=i+1&ue-1}},pe=n.cacheSize??8192,me=n.prefix??e.prefix??``,he=me===``?``:me+`:`,ge=he.length,_e=(ie??[]).map(e=>{let n=t&&t[e];if(!n)throw Error(`cn: missing validator `+e);return n}),ve=/\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$/,ye=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,be=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,xe=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Se=0,Ce=-1,we=-1,Te=-1,Ee=-1,De=e=>e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57||e===95,Oe=e=>/\s/.test(String.fromCharCode(e)),ke=(e,t,n)=>{if(Se=0,Ce=-1,n-t<3)return;let r=e.charCodeAt(t),i=e.charCodeAt(n-1);if(r===91&&i===93)Se=1;else if(r===40&&i===41)Se=2;else return;Te=t+1,Ee=n-1;let a=t+1;if(De(e.charCodeAt(a))){for(a++;a<n-1;){let t=e.charCodeAt(a);if(!De(t)&&t!==45)break;a++}a<n-2&&e.charCodeAt(a)===58&&(Ce=t+1,we=a,Te=a+1)}},Ae=(e,t,n,r)=>{if(n-t!==r.length)return!1;for(let n=0;n<r.length;n++)if(e.charCodeAt(t+n)!==r.charCodeAt(n))return!1;return!0},je=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Me=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ne=e=>!!e&&!Number.isNaN(Number(e)),Pe=(e,t,n)=>{if(n-t<11||!Ae(e,t,t+10,`@container`))return!1;if(e.charCodeAt(t+10)===47)return n-t>=12;let r=e.charCodeAt(t+11);return r===115&&n-t>=17&&Ae(e,t+10,t+16,`-size/`)||r===110&&n-t>=19&&Ae(e,t+10,t+18,`-normal/`)},Fe=[1,1,1,1,1,1,1,1,2,2,2,2,2,2,2],Ie=`length|number|number weight|family-name|position percentage|length size bg-size|image url|shadow|length|family-name|position percentage|length size bg-size|image url|shadow|number weight`.split(`|`).map(e=>e.split(` `)),Le=[2,3,1,0,0,0,4,5,0,0,0,0,0,1,1],Re=(e,t,n,r)=>{if(e>=10){if(e>=25)return _e[e-25](t.slice(n,r));let i=e-10;if(Se!==Fe[i])return!1;if(Ce>=0){for(let e of Ie[i])if(Ae(t,Ce,we,e))return!0;return!1}switch(Le[i]){case 0:return!1;case 1:return!0;case 2:{let e=t.slice(Te,Ee);return ve.test(e)&&!ye.test(e)}case 3:return Ne(t.slice(Te,Ee));case 4:return xe.test(t.slice(Te,Ee));default:return be.test(t.slice(Te,Ee))}}switch(e){case 0:return!0;case 1:return Se===0;case 2:return Se===1;case 3:return Se===2;case 4:return je.test(t.slice(n,r));case 5:return Ne(t.slice(n,r));case 6:{let e=t.slice(n,r);return!!e&&Number.isInteger(Number(e))}case 7:return r>n&&t.charCodeAt(r-1)===37&&Ne(t.slice(n,r-1));case 8:return Me.test(t.slice(n,r));default:return Pe(t,n,r)}},ze=new Set(typeof x==`string`?x.split(` `):x),Be=(e,t,n,r,i,a)=>{let o=$D(t,n,r)^(i?2654435769:0)|0,s=e.get(o);if(s!==void 0)outer:for(let e=0;e<s.length;e++){let a=s[e];if(a.imp===i&&a.k.length===r-n){for(let e=0;e<a.k.length;e++)if(a.k.charCodeAt(e)!==t.charCodeAt(n+e))continue outer;return a.id}}else e.set(o,s=[]);let c=t.slice(n,r),l=a(c);return s.push({k:c,imp:i,id:l}),l},Ve=new Map,He=new Map,Ue=2,We=4096,Ge=(e,t)=>{let n=[],r=0,i=0,a=0;for(let t=0;t<e.length;t++){let o=e.charCodeAt(t);r===0&&i===0&&o===58?(n.push(e.slice(a,t)),a=t+1):o===91?r++:o===93?r--:o===40?i++:o===41&&i--}n.push(e.slice(a));let o=n[0];if(n.length>1){let e=[],t=[];for(let r of n)r.charCodeAt(0)===91||ze.has(r)?(t.length&&(e.push(...t.sort()),t=[]),e.push(r)):t.push(r);t.length&&e.push(...t.sort()),o=e.join(`:`)}let s=t?o+` !`:o,c=He.get(s);return c===void 0&&He.set(s,c=Ue++),c},Ke=new Map,qe=r,Je=r+4096,Ye=()=>qe++,Xe=2097152,Ze=8192,Qe=new Int32Array(Ze),$e=Array(Ze).fill(null),et=new Int32Array(Ze),tt=new Int32Array(Ze),nt=new Uint8Array(Ze),rt=0,it=(e,t,n,r,i,a,o,s)=>{let c=e;if($e[e]!==null){if($e[e|1]===null)c=e|1;else if(!(rt++&3))c=e|rt>>2&1;else return}$e[c]=t.slice(n,r),Qe[c]=i,et[c]=a,tt[c]=o,nt[c]=s},at=()=>$e.fill(null),ot=256,st=[new Int32Array(ot),new Int32Array(ot),new Int32Array(ot),new Int32Array(ot)],[ct,lt,ut,dt]=st,ft=new Uint8Array(ot),pt=new Uint8Array(ot),mt=()=>{ot*=2,st=st.map(e=>{let t=new Int32Array(ot);return t.set(e),t}),[ct,lt,ut,dt]=st;let e=new Uint8Array(ot);e.set(ft),ft=e,pt=new Uint8Array(ot)},ht=64,gt=new Int32Array(ht),_t=new Int32Array(ht),vt=new Int32Array(r),yt=2048,bt=21,xt=new Float64Array(yt),St=new Int32Array(yt),Ct=0,wt=(e,t)=>{if(e===0&&t<r)return vt[t]===Ct?1:(vt[t]=Ct,0);let n=e*2097152+t+1,i=Math.imul(n,2654435761)>>>bt;for(;St[i]===Ct;){if(xt[i]===n)return 1;i=i+1&yt-1}return xt[i]=n,St[i]=Ct,0},Tt=(e,t,n,r,i)=>{if(n-t>=2&&e.charCodeAt(t)===91&&e.charCodeAt(n-1)===93){let r=-1;for(let i=t+1;i<n-1;i++)if(e.charCodeAt(i)===58){r=i;break}return r===-1||r===t+1?ZD:Be(Ke,e,t+1,r,0,Ye)}if(r>=0&&c[r]>=0)return c[r];for(let t=i-1;t>=0;t--){let r=_t[t];if(r>n)continue;let i=gt[t],a=n-r;if(ce[i]===1&&a>0&&a<=T){let t=e.charCodeAt(r);if(le===!1||t!==91&&t!==40){let t=fe(i,e,r,n);if(t>=0)return t}}let o=l[i];if(o<0)continue;let s=f[o],c=u[s],m=u[s+1];if(c===m)continue;ke(e,r,n);let h=C[o]-c;for(let t=c;t<m;t++)if(Re(d[t],e,r,n))return p[h+t]}return ZD},Et=e=>{let t=e.length,n=0,c=0,u=!1;(Ue>We||Ve.size>We)&&(Ve=new Map,He=new Map,Ue=2,at()),qe>Je&&(Ke=new Map,qe=r,at());let d=0;for(;d<t;){let f=e.charCodeAt(d);if(f===32||f>=9&&f<=13||f>=160&&Oe(f)){f!==32&&(u=!0),d++;continue}let p=d,m=0;for(;d<t;){if(f=e.charCodeAt(d),f<=32){if(f===32)break;if(f>=9&&f<=13){u=!0;break}}else if(f>=160&&Oe(f)){u=!0;break}m=Math.imul(m^f,16777619),d++}let h=d,g=h-p;n===ot&&mt();let _=n++;ct[_]=p,lt[_]=h,c+=g,m^=Math.imul(g,2654435761);let v=m^m>>>15|0,y=v&8190;{let t=-1;if(Qe[y]===v&&$e[y]!==null&&$e[y].length===g?t=y:Qe[y|1]===v&&$e[y|1]!==null&&$e[y|1].length===g&&(t=y|1),t>=0){let n=$e[t],r=!0;for(let t=0;t<g;t++)if(n.charCodeAt(t)!==e.charCodeAt(p+t)){r=!1;break}if(r){ut[_]=et[t],dt[_]=tt[t],ft[_]=nt[t];continue}}}let b=p;if(ge!==0){if(h-p<=ge||!e.startsWith(he,p)){ut[_]=ZD,it(y,e,p,h,v,ZD,0,0);continue}b=p+ge}let ee=0,te=0,ne=-1,re=-1;for(let t=b;t<h;t++){let n=e.charCodeAt(t);if(ee===0&&te===0){if(n===58){ne=t;continue}if(n===47){re=t;continue}}n===91?ee++:n===93?ee--:n===40?te++:n===41&&te--}let ie=ne>=b?ne+1:b,x=ie,S=h,ae=!1,oe=0;S>x&&e.charCodeAt(S-1)===33?(ae=!0,S--):S>x&&e.charCodeAt(x)===33&&(ae=!0,x++,oe=1);let C=-1;re>ie&&(C=re+oe,C>=S&&(C=-1));let se=x;S-x>1&&e.charCodeAt(x)===45&&(se=x+1);let T=0,le=0,ue=0,de=-1,fe=0;(l[0]>=0||ce[0]===1)&&(gt[0]=0,_t[0]=se,fe=1);let pe=QD,me=0;for(let t=se;t<S;t++)if(t===C&&(pe=le<ue?QD:T,me=fe),T!==QD){let n=e.charCodeAt(t),r=-1;if(le<ue)o.charCodeAt(le)===n?(le++,le===ue&&(r=T=de)):T=QD;else{let e=i[T],t=i[T+1],c=QD;for(let i=e;i<t;i++){let e=a[i];if(o.charCodeAt(e)===n){a[i+1]-e===1?r=c=s[i]:(le=e+1,ue=a[i+1],de=s[i],c=T);break}}T=c}if(r>=0&&(l[r]>=0||ce[r]===1)&&t+1<S&&e.charCodeAt(t+1)===45){if(fe===ht){ht*=2;let e=new Int32Array(ht);e.set(gt),gt=e;let t=new Int32Array(ht);t.set(_t),_t=t}gt[fe]=r,_t[fe]=t+2,fe++}}C===S&&(pe=le<ue?QD:T,me=fe);let _e=le<ue?QD:T,ve,ye=!1;if(C>=0){if(ye=!0,ve=Tt(e,x,C,pe,me),ve!==ZD&&ve<r&&w[ve]){let t=Tt(e,x,S,_e,fe);t!==ZD&&t!==ve&&(ve=t,ye=!1)}else ve===ZD&&(ve=Tt(e,x,S,_e,fe),ye=!1)}else ve=Tt(e,x,S,_e,fe);let be=0,xe=0;ve===ZD?ut[_]=ZD:(xe=+!!ye,be=b>=ne?+!!ae:Be(Ve,e,b,ne,+!!ae,e=>Ge(e,ae)),ut[_]=ve,ft[_]=xe,dt[_]=be),it(y,e,p,h,v,ve,be,xe)}if(n===0)return``;if(n===1)return ct[0]===0&&lt[0]===t?e:e.slice(ct[0],lt[0]);if(n*oe>yt){for(;n*oe>yt;)yt<<=1,bt--;xt=new Float64Array(yt),St=new Int32Array(yt)}if(Ue>=Xe||qe>=Xe)throw Error(`cn: too many distinct classes in one merge`);Ct=Ct+1|0,Ct===0&&(vt.fill(0),St.fill(0),Ct=1);let f=!1;for(let e=n-1;e>=0;e--){let t=ut[e];if(t===ZD){pt[e]=1;continue}let n=dt[e];if(wt(n,t)===1){pt[e]=0,f=!0;continue}if(pt[e]=1,t<r){let r=S[t];if(r>=0)for(let e=b[r];e<b[r+1];e++)wt(n,ee[e]);if(ft[e]&1)for(let e=0;e<te.length;e++)te[e]===t&&wt(n,ne[e])}}if(!f&&!u&&t===c+n-1)return e;let p=``,m=0;for(;m<n;){if(!pt[m]){m++;continue}let t=ct[m],r=lt[m],i=m+1;for(;i<n&&pt[i]&&ct[i]===r+1&&e.charCodeAt(r)===32;)r=lt[i],i++;p.length>0&&(p+=` `),p+=e.slice(t,r),m=i}return p},Dt=16384,Ot=new Int32Array(Dt*2),kt=0,At=1,jt=Object.create(null),Mt=Object.create(null),Nt=new Map,Pt=new Map,Ft=0,It=0,Lt=()=>{kt^=Dt,At=At+1|0,It=0},Rt=e=>{let t=jt[e];if(t!==void 0)return t;let n=eO(e,0,e.length),r=(n&16383)+kt,i=Ot[r]===(n^At)||Ot[r^Dt]===(n^At-1);return i&&(t=Mt[e],t!==void 0)?(jt[e]=t,t):(t=Et(e),i?(jt[e]=t,++Ft>pe&&(Ft=0,Mt=jt,jt=Object.create(null),Lt())):(Ot[r]=n^At,++It>Dt&&Lt()),t)},zt=e=>{let t=Nt.get(e);if(t!==void 0)return t;let n=eO(e,0,e.length),r=(n&16383)+kt,i=Ot[r]===(n^At)||Ot[r^Dt]===(n^At-1);return i&&(t=Pt.get(e),t!==void 0)?(Nt.set(e,t),t):(t=Et(e),i?(Nt.set(e,t),++Ft>pe&&(Ft=0,Pt=Nt,Nt=new Map,Lt())):(Ot[r]=n^At,++It>Dt&&Lt()),t)},E=e=>{let t=eO(e,0,e.length),n=(t&16383)+kt;return Ot[n]===(t^At)||Ot[n^Dt]===(t^At-1)||(Ot[n]=t^At,++It>Dt&&Lt(),!1)},Bt=pe===0?Et:XD?e=>{let t=Nt.get(e);return t===void 0?zt(e):t}:Rt;return{merge:function(){return arguments.length===1&&typeof arguments[0]==`string`?Bt(arguments[0]):Bt(iO.apply(null,arguments))},mergeString:Bt,seenBefore:pe===0?()=>!1:E,mergeUncached:Et}},nO=(e,t)=>{if(!e)return``;if(typeof e==`string`)return e;let n=``;if(typeof e.length==`number`&&(!t||Array.isArray(e))){let r=e;for(let e=0;e<r.length;e++){let i=r[e];if(!i)continue;let a=typeof i==`string`?i:nO(i,t);a&&(n&&(n+=` `),n+=a)}return n}if(t){if(typeof e==`number`)return``+e;if(typeof e==`object`)for(let t in e)e[t]&&(n&&(n+=` `),n+=t)}return n},rO=(e,t)=>{let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(!i)continue;let a=typeof i==`string`?i:nO(i,t);a&&(n&&(n+=` `),n+=a)}return n},iO=function(){return rO(arguments,!1)},aO=(e,t)=>{let n=t===void 0?()=>!0:t.seenBefore,r=t===void 0?e:t.mergeUncached,i=new Map,a=new Map,o=0,s=null,c=(e,t,n,r)=>{let i=0;if(t){if(t!==e.a0)return!1;i=1}if(n){if(n!==(i===0?e.a0:e.a1))return!1;i++}if(r){if(r!==(i===0?e.a0:i===1?e.a1:e.a2))return!1;i++}return i===e.t},l=(e,t)=>{let n=e.a,r=0;for(let e=0;e<t.length;e++){let i=t[e];if(i){if(i!==n[r])return!1;r++}}return r===e.t},u=(t,c)=>{let u=t.length,d=s===null?null:s.n;if(!c){if(d!==null&&l(d,t))return s=d,d.r;if(s!==null&&s!==d&&l(s,t))return s.r}let f=``,p=-1,m=0,h=!1;for(let e=0;e<u;e++){let n=t[e];if(n){if(typeof n!=`string`){if(n=t[e]=nO(n,!0),!n)continue;h=!0}p<0&&(f=n,p=e),m++}}if(m===0)return``;if(m===1)return e(f);if(h){if(d!==null&&l(d,t))return s=d,d.r;if(s!==null&&s!==d&&l(s,t))return s.r}let g=i.get(f);g===void 0&&(g=a.get(f),g!==void 0&&i.set(f,g));let _=null;if(g!==void 0)outer:for(let e=0;e<g.length;e++){let n=g[e];if(n.t!==m)continue;let r=n.a,i=1;for(let e=p+1;e<u;e++){let n=t[e];if(n&&n!==r[i++])continue outer}_=n;break}if(_===null){let s=f,c=[f];for(let e=p+1;e<u;e++){let n=t[e];n&&(s+=` `+n,c.push(n))}if(!n(s))return r(s);_={r:e(s),t:c.length,a0:c[0],a1:c[1],a2:c[2]??``,a:c,n:null},g===void 0&&i.set(f,g=[]),g.length>=256&&g.shift(),g.push(_),++o>1e3&&(o=0,a=i,i=new Map)}return s!==null&&s!==_&&(s.n=_),s=_,_.r},d=t=>Array.isArray(t)?u(t.slice(),!1):e(nO(t,!0));return function(t,n,r){let i=arguments.length;if((i|1)==3){let e=s;if(e!==null){let i=e.n;if(i!==null&&c(i,t,n,r))return s=i,i.r;if(e!==i&&c(e,t,n,r))return e.r}return u([t,n,r],!0)}if(i===1)return typeof t==`string`?e(t):d(t);let a=s;if(a!==null){let e=a.n;if(e!==null){let t=e.a,n=0,r=!0;for(let e=0;e<i;e++){let i=arguments[e];if(i){if(i!==t[n]){r=!1;break}n++}}if(r&&n===e.t)return s=e,e.r}if(a!==e){let e=a.a,t=0,n=!0;for(let r=0;r<i;r++){let i=arguments[r];if(i){if(i!==e[t]){n=!1;break}t++}}if(n&&t===a.t)return a.r}}let o=[];for(let e=0;e<i;e++)o.push(arguments[e]);return u(o,!0)}},oO=`{"theme":{"animate":[{"$v":"isAny"}],"aspect":["video"],"blur":[{"$v":"isTshirtSize"}],"breakpoint":[{"$v":"isTshirtSize"}],"color":[{"$v":"isAny"}],"container":[{"$v":"isTshirtSize"}],"drop-shadow":[{"$v":"isTshirtSize"}],"ease":["in","out","in-out"],"font":[{"$v":"isAnyNonArbitrary"}],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[{"$v":"isTshirtSize"}],"leading":["none","tight","snug","normal","relaxed","loose"],"perspective":["dramatic","near","normal","midrange","distant","none"],"radius":[{"$v":"isTshirtSize"}],"shadow":[{"$v":"isTshirtSize"}],"spacing":["px",{"$v":"isNumber"}],"text":[{"$v":"isTshirtSize"}],"text-shadow":[{"$v":"isTshirtSize"}],"tracking":["tighter","tight","normal","wide","wider","widest"]},"classGroups":{"aspect":[{"aspect":["auto","square",{"$v":"isFraction"},{"$v":"isArbitraryValue"},{"$v":"isArbitraryVariable"},{"$t":"aspect"}]}],"container":["container"],"container-type":[{"@container":["","normal","size",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"container-named":[{"$v":"isNamedContainerQuery"}],"columns":[{"columns":[{"$v":"isNumber"},{"$v":"isArbitraryValue"},{"$v":"isArbitraryVariable"},{"$t":"container"}]},"columns-auto"],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"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":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"overflow":[{"overflow":["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],"overscroll":[{"overscroll":["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],"position":["static","fixed","absolute","relative","sticky"],"inset":[{"inset":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"inset-x":[{"inset-x":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"inset-y":[{"inset-y":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"start":[{"inset-s":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}],"start":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"end":[{"inset-e":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}],"end":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"inset-bs":[{"inset-bs":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"inset-be":[{"inset-be":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"top":[{"top":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"right":[{"right":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"bottom":[{"bottom":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"left":[{"left":[{"$v":"isFraction"},"full","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"visibility":["visible","invisible","collapse"],"z":[{"z":[{"$v":"isInteger"},"auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"basis":[{"basis":[{"$v":"isFraction"},"full","auto",{"$t":"container"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"flex-direction":[{"flex":["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{"flex":["nowrap","wrap","wrap-reverse"]}],"flex":[{"flex":[{"$v":"isNumber"},{"$v":"isFraction"},"auto","initial","none",{"$v":"isArbitraryValue"}]}],"grow":[{"grow":["",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"shrink":[{"shrink":["",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"order":[{"order":[{"$v":"isInteger"},"first","last","none",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"grid-cols":[{"grid-cols":[{"$v":"isInteger"},"none","subgrid",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"col-start-end":[{"col":["auto",{"span":["full",{"$v":"isInteger"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]},{"$v":"isInteger"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"col-start":[{"col-start":[{"$v":"isInteger"},"auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"col-end":[{"col-end":[{"$v":"isInteger"},"auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"grid-rows":[{"grid-rows":[{"$v":"isInteger"},"none","subgrid",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"row-start-end":[{"row":["auto",{"span":["full",{"$v":"isInteger"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]},{"$v":"isInteger"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"row-start":[{"row-start":[{"$v":"isInteger"},"auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"row-end":[{"row-end":[{"$v":"isInteger"},"auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]},{"auto-cols":[{"$t":"spacing"}]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]},{"auto-rows":[{"$t":"spacing"}]}],"gap":[{"gap":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"gap-x":[{"gap-x":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"gap-y":[{"gap-y":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"justify-content":[{"justify":["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe","normal"]}],"justify-items":[{"justify-items":["start","end","center","stretch","center-safe","end-safe","normal"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],"align-content":[{"content":["normal","start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"align-items":[{"items":["start","end","center","stretch","center-safe","end-safe",{"baseline":["","last"]}]}],"align-self":[{"self":["auto","start","end","center","stretch","center-safe","end-safe",{"baseline":["","last"]}]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"place-items":[{"place-items":["start","end","center","stretch","center-safe","end-safe","baseline"]}],"place-self":[{"place-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],"p":[{"p":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"px":[{"px":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"py":[{"py":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"ps":[{"ps":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"pe":[{"pe":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"pbs":[{"pbs":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"pbe":[{"pbe":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"pt":[{"pt":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"pr":[{"pr":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"pb":[{"pb":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"pl":[{"pl":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"m":[{"m":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"mx":[{"mx":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"my":[{"my":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"ms":[{"ms":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"me":[{"me":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"mbs":[{"mbs":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"mbe":[{"mbe":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"mt":[{"mt":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"mr":[{"mr":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"mb":[{"mb":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"ml":[{"ml":["auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"space-x":[{"space-x":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"space-y-reverse":["space-y-reverse"],"size":[{"size":[{"$v":"isFraction"},"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"inline-size":[{"inline":["auto",{"$v":"isFraction"},"screen","full","dvw","lvw","svw","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]},{"inline":[{"$t":"container"}]}],"min-inline-size":[{"min-inline":["auto",{"$v":"isFraction"},"screen","full","dvw","lvw","svw","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]},{"min-inline":[{"$t":"container"}]}],"max-inline-size":[{"max-inline":["none",{"$v":"isFraction"},"screen","full","dvw","lvw","svw","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]},{"max-inline":[{"$t":"container"}]}],"block-size":[{"block":["auto",{"$v":"isFraction"},"screen","full","lh","dvh","lvh","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"min-block-size":[{"min-block":["auto",{"$v":"isFraction"},"screen","full","lh","dvh","lvh","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"max-block-size":[{"max-block":["none",{"$v":"isFraction"},"screen","full","lh","dvh","lvh","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"w":[{"w":[{"$t":"container"},"screen",{"$v":"isFraction"},"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"min-w":[{"min-w":[{"$t":"container"},"screen","none",{"$v":"isFraction"},"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"max-w":[{"max-w":[{"$t":"container"},"screen","none","prose",{"screen":[{"$t":"breakpoint"}]},{"$v":"isFraction"},"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"h":[{"h":["screen","lh",{"$v":"isFraction"},"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"min-h":[{"min-h":["screen","lh","none",{"$v":"isFraction"},"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"max-h":[{"max-h":["screen","lh",{"$v":"isFraction"},"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]},"max-h-none"],"font-size":[{"text":["base",{"$t":"text"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{"font":[{"$t":"font-weight"},{"$v":"isArbitraryVariableWeight"},{"$v":"isArbitraryWeight"}]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",{"$v":"isPercent"},{"$v":"isArbitraryValue"}]}],"font-family":[{"font":[{"$v":"isArbitraryVariableFamilyName"},{"$v":"isArbitraryFamilyName"},{"$t":"font"}]}],"font-features":[{"font-features":[{"$v":"isArbitraryValue"}]}],"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":[{"$t":"tracking"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"line-clamp":[{"line-clamp":[{"$v":"isNumber"},"none",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryNumber"}]}],"leading":[{"leading":[{"$t":"leading"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"list-image":[{"list-image":["none",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"list-style-position":[{"list":["inside","outside"]}],"list-style-type":[{"list":["disc","decimal","none",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"text-alignment":[{"text":["left","center","right","justify","start","end"]}],"placeholder-color":[{"placeholder":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"text-color":[{"text":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{"decoration":["solid","dashed","dotted","double","wavy"]}],"text-decoration-thickness":[{"decoration":[{"$v":"isNumber"},"from-font","auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryLength"}]}],"text-decoration-color":[{"decoration":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"underline-offset":[{"underline-offset":[{"$v":"isNumber"},"auto",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{"text":["wrap","nowrap","balance","pretty"]}],"indent":[{"indent":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"tab-size":[{"tab":[{"$v":"isInteger"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"vertical-align":[{"align":["baseline","top","middle","bottom","text-top","text-bottom","sub","super",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"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",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"bg-attachment":[{"bg":["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{"bg":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"},{"position":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}]}],"bg-repeat":[{"bg":["no-repeat",{"repeat":["","x","y","space","round"]}]}],"bg-size":[{"bg":["auto","cover","contain",{"$v":"isArbitraryVariableSize"},{"$v":"isArbitrarySize"},{"size":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}]}],"bg-image":[{"bg":["none",{"linear":[{"to":["t","tr","r","br","b","bl","l","tl"]},{"$v":"isInteger"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}],"radial":["",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}],"conic":[{"$v":"isInteger"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]},{"$v":"isArbitraryVariableImage"},{"$v":"isArbitraryImage"}]},{"bg-gradient-to":["t","tr","r","br","b","bl","l","tl"]},"bg-conic"],"bg-color":[{"bg":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"gradient-from-pos":[{"from":[{"$v":"isPercent"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"gradient-via-pos":[{"via":[{"$v":"isPercent"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"gradient-to-pos":[{"to":[{"$v":"isPercent"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"gradient-from":[{"from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"gradient-via":[{"via":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"gradient-to":[{"to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded":[{"rounded":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-s":[{"rounded-s":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-e":[{"rounded-e":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-t":[{"rounded-t":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-r":[{"rounded-r":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-b":[{"rounded-b":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-l":[{"rounded-l":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-ss":[{"rounded-ss":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-se":[{"rounded-se":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-ee":[{"rounded-ee":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-es":[{"rounded-es":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-tl":[{"rounded-tl":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-tr":[{"rounded-tr":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-br":[{"rounded-br":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rounded-bl":[{"rounded-bl":["","none","full",{"$t":"radius"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-w":[{"border":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-x":[{"border-x":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-y":[{"border-y":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-s":[{"border-s":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-e":[{"border-e":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-bs":[{"border-bs":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-be":[{"border-be":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-t":[{"border-t":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-r":[{"border-r":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-b":[{"border-b":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"border-w-l":[{"border-l":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"divide-x":[{"divide-x":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{"border":["solid","dashed","dotted","double","hidden","none"]}],"divide-style":[{"divide":["solid","dashed","dotted","double","hidden","none"]}],"border-color":[{"border":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-x":[{"border-x":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-y":[{"border-y":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-s":[{"border-s":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-e":[{"border-e":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-bs":[{"border-bs":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-be":[{"border-be":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-t":[{"border-t":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-r":[{"border-r":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-b":[{"border-b":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-color-l":[{"border-l":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"divide-color":[{"divide":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"outline-style":[{"outline":["solid","dashed","dotted","double","none","hidden"]}],"outline-offset":[{"outline-offset":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"outline-w":[{"outline":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"outline-color":[{"outline":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"shadow":[{"shadow":["","none",{"$t":"shadow"},{"$v":"isArbitraryVariableShadow"},{"$v":"isArbitraryShadow"}]},"shadow-inner"],"shadow-color":[{"shadow":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"inset-shadow":[{"inset-shadow":["none",{"$t":"inset-shadow"},{"$v":"isArbitraryVariableShadow"},{"$v":"isArbitraryShadow"}]}],"inset-shadow-color":[{"inset-shadow":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"ring-w":[{"ring":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"ring-w-inset":["ring-inset"],"ring-color":[{"ring":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"ring-offset-w":[{"ring-offset":[{"$v":"isNumber"},{"$v":"isArbitraryLength"}]}],"ring-offset-color":[{"ring-offset":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"inset-ring-w":[{"inset-ring":["",{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"}]}],"inset-ring-color":[{"inset-ring":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"text-shadow":[{"text-shadow":["none",{"$t":"text-shadow"},{"$v":"isArbitraryVariableShadow"},{"$v":"isArbitraryShadow"}]}],"text-shadow-color":[{"text-shadow":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"opacity":[{"opacity":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],"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":[{"$v":"isNumber"}]}],"mask-image-linear-from-pos":[{"mask-linear-from":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-linear-to-pos":[{"mask-linear-to":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-linear-from-color":[{"mask-linear-from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-linear-to-color":[{"mask-linear-to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-t-from-pos":[{"mask-t-from":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-t-to-pos":[{"mask-t-to":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-t-from-color":[{"mask-t-from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-t-to-color":[{"mask-t-to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-r-from-pos":[{"mask-r-from":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-r-to-pos":[{"mask-r-to":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-r-from-color":[{"mask-r-from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-r-to-color":[{"mask-r-to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-b-from-pos":[{"mask-b-from":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-b-to-pos":[{"mask-b-to":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-b-from-color":[{"mask-b-from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-b-to-color":[{"mask-b-to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-l-from-pos":[{"mask-l-from":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-l-to-pos":[{"mask-l-to":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-l-from-color":[{"mask-l-from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-l-to-color":[{"mask-l-to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-x-from-pos":[{"mask-x-from":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-x-to-pos":[{"mask-x-to":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-x-from-color":[{"mask-x-from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-x-to-color":[{"mask-x-to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-y-from-pos":[{"mask-y-from":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-y-to-pos":[{"mask-y-to":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-y-from-color":[{"mask-y-from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-y-to-color":[{"mask-y-to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-radial":[{"mask-radial":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-radial-from-pos":[{"mask-radial-from":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-radial-to-pos":[{"mask-radial-to":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-radial-from-color":[{"mask-radial-from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-radial-to-color":[{"mask-radial-to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"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":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"]}],"mask-image-conic-pos":[{"mask-conic":[{"$v":"isNumber"}]}],"mask-image-conic-from-pos":[{"mask-conic-from":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-conic-to-pos":[{"mask-conic-to":[{"$v":"isNumber"},{"$v":"isPercent"},{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"}]}],"mask-image-conic-from-color":[{"mask-conic-from":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-image-conic-to-color":[{"mask-conic-to":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"mask-mode":[{"mask":["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{"mask":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",{"$v":"isArbitraryVariablePosition"},{"$v":"isArbitraryPosition"},{"position":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}]}],"mask-repeat":[{"mask":["no-repeat",{"repeat":["","x","y","space","round"]}]}],"mask-size":[{"mask":["auto","cover","contain",{"$v":"isArbitraryVariableSize"},{"$v":"isArbitrarySize"},{"size":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}]}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{"mask":["none",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"filter":[{"filter":["","none",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"blur":[{"blur":["","none",{"$t":"blur"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"brightness":[{"brightness":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"contrast":[{"contrast":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"drop-shadow":[{"drop-shadow":["","none",{"$t":"drop-shadow"},{"$v":"isArbitraryVariableShadow"},{"$v":"isArbitraryShadow"}]}],"drop-shadow-color":[{"drop-shadow":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"grayscale":[{"grayscale":["",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"hue-rotate":[{"hue-rotate":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"invert":[{"invert":["",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"saturate":[{"saturate":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"sepia":[{"sepia":["",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-filter":[{"backdrop-filter":["","none",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-blur":[{"backdrop-blur":["","none",{"$t":"blur"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-brightness":[{"backdrop-brightness":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-contrast":[{"backdrop-contrast":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-grayscale":[{"backdrop-grayscale":["",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-invert":[{"backdrop-invert":["",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-opacity":[{"backdrop-opacity":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-saturate":[{"backdrop-saturate":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backdrop-sepia":[{"backdrop-sepia":["",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"border-collapse":[{"border":["collapse","separate"]}],"border-spacing":[{"border-spacing":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"border-spacing-x":[{"border-spacing-x":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"border-spacing-y":[{"border-spacing-y":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"table-layout":[{"table":["auto","fixed"]}],"caption":[{"caption":["top","bottom"]}],"transition":[{"transition":["","all","colors","opacity","shadow","transform","none",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"transition-behavior":[{"transition":["normal","discrete"]}],"duration":[{"duration":[{"$v":"isNumber"},"initial",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"ease":[{"ease":["linear","initial",{"$t":"ease"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"delay":[{"delay":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"animate":[{"animate":["none",{"$t":"animate"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"backface":[{"backface":["hidden","visible"]}],"perspective":[{"perspective":[{"$t":"perspective"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"perspective-origin":[{"perspective-origin":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rotate":[{"rotate":["none",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rotate-x":[{"rotate-x":["none",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rotate-y":[{"rotate-y":["none",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"rotate-z":[{"rotate-z":["none",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"scale":[{"scale":["none",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"scale-x":[{"scale-x":["none",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"scale-y":[{"scale-y":["none",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"scale-z":[{"scale-z":["none",{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"scale-3d":["scale-3d"],"skew":[{"skew":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"skew-x":[{"skew-x":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"skew-y":[{"skew-y":[{"$v":"isNumber"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"transform":[{"transform":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},"","none","gpu","cpu"]}],"transform-origin":[{"origin":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"transform-style":[{"transform":["3d","flat"]}],"translate":[{"translate":[{"$v":"isFraction"},"full",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"translate-x":[{"translate-x":[{"$v":"isFraction"},"full",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"translate-y":[{"translate-y":[{"$v":"isFraction"},"full",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"translate-z":[{"translate-z":[{"$v":"isFraction"},"full",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"translate-none":["translate-none"],"zoom":[{"zoom":[{"$v":"isInteger"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"accent":[{"accent":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"appearance":[{"appearance":["none","auto"]}],"caret-color":[{"caret":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"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",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"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":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"scrollbar-track-color":[{"scrollbar-track":[{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{"scrollbar":["auto","thin","none"]}],"scroll-m":[{"scroll-m":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-mx":[{"scroll-mx":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-my":[{"scroll-my":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-ms":[{"scroll-ms":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-me":[{"scroll-me":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-mbs":[{"scroll-mbs":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-mbe":[{"scroll-mbe":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-mt":[{"scroll-mt":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-mr":[{"scroll-mr":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-mb":[{"scroll-mb":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-ml":[{"scroll-ml":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-p":[{"scroll-p":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-px":[{"scroll-px":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-py":[{"scroll-py":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-ps":[{"scroll-ps":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-pe":[{"scroll-pe":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-pbs":[{"scroll-pbs":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-pbe":[{"scroll-pbe":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-pt":[{"scroll-pt":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-pr":[{"scroll-pr":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-pb":[{"scroll-pb":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"scroll-pl":[{"scroll-pl":[{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"},{"$t":"spacing"}]}],"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",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"fill":[{"fill":["none",{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"stroke-w":[{"stroke":[{"$v":"isNumber"},{"$v":"isArbitraryVariableLength"},{"$v":"isArbitraryLength"},{"$v":"isArbitraryNumber"}]}],"stroke":[{"stroke":["none",{"$t":"color"},{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}],"contain":[{"contain":["none","content","strict",{"$v":"isArbitraryVariable"},{"$v":"isArbitraryValue"}]}],"contain-size":[{"contain":["size","inline-size"]}],"contain-layout":["contain-layout"],"contain-paint":["contain-paint"],"contain-style":["contain-style"]},"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":["right","left"],"inset-y":["top","bottom"],"flex":["basis","grow","shrink"],"gap":["gap-x","gap-y"],"p":["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],"px":["pr","pl"],"py":["pt","pb"],"m":["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],"mx":["mr","ml"],"my":["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-r","border-w-l"],"border-w-y":["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-r","border-color-l"],"border-color-y":["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-mr","scroll-ml"],"scroll-my":["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-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],"touch":["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"],"contain":["contain-size","contain-layout","contain-paint","contain-style"],"contain-size":["contain"],"contain-layout":["contain"],"contain-paint":["contain"],"contain-style":["contain"]},"conflictingClassGroupModifiers":{"font-size":["leading"]},"orderSensitiveModifiers":["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"],"postfixLookupClassGroups":["container-type"]}`,sO=()=>JSON.parse(oO),cO=e=>`classGroups`in e&&`theme`in e&&`conflictingClassGroups`in e,lO=e=>e===void 0?{config:sO()}:typeof e==`function`?{config:e(sO())}:cO(e)?{config:e}:{config:RD(sO(),e),cacheSize:e.cacheSize},uO=e=>{let{config:t,cacheSize:n}=lO(e),{tables:r,validatorImpls:i,prefix:a}=YD(t);return tO(r,i,{cacheSize:n,prefix:a})},dO=(e=>{let t=null,n=()=>t??=uO(e);return aO(e=>n().mergeString(e),{seenBefore:e=>n().seenBefore(e),mergeUncached:e=>n().mergeUncached(e)})})({extend:{theme:{spacing:[...PE]}}});function fO(e,t){return typeof e==`function`?e(t):e}function pO(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function mO(...e){return t=>{let n=!1,r=e.map(e=>{let r=pO(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():pO(e[t],null)}}}}function hO(...e){return N.useCallback(mO(...e),e)}function gO(e){let t=N.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];wO(r)&&typeof OO==`function`&&(r=OO(r._payload)),N.Children.forEach(r,e=>{if(SO(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;wO(n)&&typeof OO==`function`&&(n=OO(n._payload)),a=yO(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=N.cloneElement(a,void 0,s):!o&&N.Children.count(r)===1&&N.isValidElement(r)&&(a=r);let c=a?xO(a):void 0,l=hO(n,c);if(!a){if(r||r===0)throw Error(o?DO(e):EO(e));return r}let u=bO(i,a.props??{});return a.type!==N.Fragment&&(u.ref=n?l:c),N.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}var _O=gO(`Slot`),vO=Symbol.for(`radix.slottable`),yO=(e,t)=>{if(`child`in e.props){let t=e.props.child;return N.isValidElement(t)?N.cloneElement(t,void 0,e.props.children(t.props.children)):null}return N.isValidElement(t)?t:null};function bO(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function xO(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function SO(e){return N.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===vO}var CO=Symbol.for(`react.lazy`);function wO(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===CO&&`_payload`in e&&TO(e._payload)}function TO(e){return typeof e==`object`&&!!e&&`then`in e}var EO=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,DO=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,OO=N.use,kO=Object.freeze({reduced:!1,squish:90,fast:120,normal:180,slow:280,springDuration:320,bounce:.3,stretch:.28,distance:4,stagger:24,blur:0,shake:3,steps:0,fuse:1,pressDepth:.5,pressScale:1,ease:`cubic-bezier(0.2, 0, 0, 1)`,easeExit:`cubic-bezier(0.4, 0, 1, 1)`}),AO=`(prefers-reduced-motion: reduce)`;function jO(e){let t=e.ownerDocument.defaultView;if(!t)return kO;let n=t.getComputedStyle(e),r=(e,t)=>{let r=n.getPropertyValue(e).trim(),i=Number.parseFloat(r);return Number.isFinite(i)?Math.max(0,i):t},i=(e,t)=>{let i=n.getPropertyValue(e).trim();return r(e,t)*(i.endsWith(`s`)&&!i.endsWith(`ms`)?1e3:1)},a=t.matchMedia?.(AO).matches??!1,o=(e,t)=>a?120:i(`--stipe-motion-${e}`,t),s=(e,t)=>a?0:r(`--stipe-motion-${e}`,t);return{reduced:a,squish:o(`squish`,kO.squish),fast:o(`fast`,kO.fast),normal:o(`normal`,kO.normal),slow:o(`slow`,kO.slow),springDuration:o(`spring-duration`,kO.springDuration),bounce:Math.min(1,s(`bounce`,kO.bounce)),stretch:s(`stretch`,kO.stretch),distance:s(`distance`,kO.distance),stagger:a?0:i(`--stipe-motion-stagger`,kO.stagger),blur:s(`blur`,kO.blur),shake:s(`shake`,kO.shake),steps:Math.floor(s(`steps`,kO.steps)),fuse:r(`--stipe-motion-fuse`,kO.fuse),pressDepth:a?0:r(`--stipe-press-depth`,kO.pressDepth),pressScale:a?1:r(`--stipe-press-scale`,kO.pressScale),ease:n.getPropertyValue(`--stipe-motion-ease`).trim()||kO.ease,easeExit:n.getPropertyValue(`--stipe-motion-ease-exit`).trim()||kO.easeExit}}function MO(e){let[t,n]=(0,N.useState)(()=>({...kO,reduced:!0}));return(0,N.useLayoutEffect)(()=>{let t=e.current,r=t?.ownerDocument.defaultView;if(!t||!r)return;let i=()=>{let e=jO(t);n(t=>JSON.stringify(t)===JSON.stringify(e)?t:e)};i();let a=new r.MutationObserver(i);for(let e=t;e;e=e.parentElement)a.observe(e,{attributes:!0,attributeFilter:[`data-theme`,`class`,`style`]});let o=r.matchMedia?.(AO);return o?.addEventListener(`change`,i),()=>{a.disconnect(),o?.removeEventListener(`change`,i)}},[e]),t}function NO(e,t){return e.reduced?0:Math.round(t*e.normal/kO.normal)}function PO(e,t){if(e.reduced)return 0;let n=t*e.bounce/kO.bounce;return Math.min(.9,Math.max(0,n))}function FO(e,t){return e.reduced?0:Math.round(t*e.springDuration/kO.springDuration)}function IO(e,t){return e.steps>0?`steps(${String(e.steps)}, end)`:t}function LO(e){return`animate`in e}var RO=globalThis;function zO(){return RO.matchMedia?.(AO).matches??!1}function BO(e){let t=RO.matchMedia?.(AO);return t?.addEventListener(`change`,e),()=>{t?.removeEventListener(`change`,e)}}function VO(){return!0}function HO(){return(0,N.useSyncExternalStore)(BO,zO,VO)}var UO=(0,N.forwardRef)(function({asChild:e=!1,className:t,...n},r){let i=dO(`absolute h-px w-px overflow-hidden whitespace-nowrap border-0 p-0 [clip:rect(0,0,0,0)]`,t);return e?(0,Y.jsx)(_O,{...n,className:i,ref:r}):(0,Y.jsx)(`span`,{...n,className:i,ref:r})}),WO=(0,N.forwardRef)(function({id:e,transform:t},n){return(0,Y.jsxs)(`radialGradient`,{ref:n,id:e,gradientUnits:`userSpaceOnUse`,cx:`-1.2`,cy:`-1.6`,r:`5.6`,gradientTransform:t,children:[(0,Y.jsx)(`stop`,{offset:`0`,stopColor:`color-mix(in oklab, var(--color-white) calc(var(--depth) * 50%), currentColor)`}),(0,Y.jsx)(`stop`,{offset:`1`,stopColor:`currentColor`})]})});function GO({id:e}){return(0,Y.jsx)(`filter`,{id:e,x:`-50%`,y:`-50%`,width:`200%`,height:`200%`,children:(0,Y.jsx)(`feDropShadow`,{dx:`0`,dy:`1.5`,stdDeviation:`1`,floodColor:`currentColor`,style:{floodOpacity:`calc(var(--depth) * 0.6)`}})})}function KO({id:e}){return(0,Y.jsxs)(`filter`,{id:e,x:`-10%`,y:`-10%`,width:`120%`,height:`120%`,colorInterpolationFilters:`sRGB`,children:[(0,Y.jsx)(`feGaussianBlur`,{in:`SourceAlpha`,stdDeviation:`0.3`,result:`soft-edge`}),(0,Y.jsx)(`feOffset`,{in:`soft-edge`,dx:`0.25`,dy:`0.45`,result:`lower-edge`}),(0,Y.jsx)(`feComposite`,{in:`SourceAlpha`,in2:`lower-edge`,operator:`out`,result:`inner-shadow`}),(0,Y.jsx)(`feFlood`,{floodColor:`var(--color-black)`,floodOpacity:`calc(var(--depth) * 0.28)`}),(0,Y.jsx)(`feComposite`,{in2:`inner-shadow`,operator:`in`,result:`shade`}),(0,Y.jsx)(`feOffset`,{in:`soft-edge`,dx:`-0.2`,dy:`-0.35`,result:`upper-edge`}),(0,Y.jsx)(`feComposite`,{in:`SourceAlpha`,in2:`upper-edge`,operator:`out`,result:`inner-highlight`}),(0,Y.jsx)(`feFlood`,{floodColor:`var(--color-white)`,floodOpacity:`calc(var(--depth) * 0.7)`}),(0,Y.jsx)(`feComposite`,{in2:`inner-highlight`,operator:`in`,result:`highlight`}),(0,Y.jsxs)(`feMerge`,{children:[(0,Y.jsx)(`feMergeNode`,{in:`SourceGraphic`}),(0,Y.jsx)(`feMergeNode`,{in:`shade`}),(0,Y.jsx)(`feMergeNode`,{in:`highlight`})]})]})}var qO=Object.freeze({alphaIntercept:-8,alphaSlope:18,blurStdDeviation:2});function JO({id:e,values:t=NE}){return(0,Y.jsxs)(`filter`,{id:e,x:`-50%`,y:`-50%`,width:`200%`,height:`200%`,children:[(0,Y.jsx)(`feGaussianBlur`,{in:`SourceGraphic`,stdDeviation:t.blurStdDeviation,result:`blur`}),(0,Y.jsx)(`feColorMatrix`,{in:`blur`,values:`1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 ${String(t.alphaSlope)} ${String(t.alphaIntercept)}`,result:`gooey`}),(0,Y.jsx)(`feComposite`,{in:`SourceGraphic`,in2:`gooey`,operator:`atop`})]})}function YO(e,t){let n=e.ownerDocument,r=!0,i=()=>{t(r&&!n.hidden)},a=globalThis,o=`IntersectionObserver`in globalThis&&a.IntersectionObserver?new a.IntersectionObserver(t=>{let n=t.find(t=>t.target===e);n&&(r=n.isIntersecting,i())}):void 0;return o?.observe(e),n.addEventListener(`visibilitychange`,i),i(),()=>{o?.disconnect(),n.removeEventListener(`visibilitychange`,i)}}function XO(e){let t=Math.max(0,Math.min(1,e));return t*t*(3-2*t)}function ZO(e,t){let n=Math.max(0,Math.min(1,(t-(e-1)*.085)/.68));return Math.sin(n*Math.PI)**2}function QO(e,t,n){let r=n*Math.PI*2,i=t*2.1,a=Math.sin(r*2+i)*.15,o={rx:4*(1+a),ry:4/(1+a)};if(e===`line`){let e=7.5+4*Math.cos(r+(t===2?-.45:0));return{cx:(t-1)*e,cy:Math.sin(r+i)*.7,...o}}if(e===`square`){let e=4.7+2.7*Math.cos(r);return{cx:(t%2?1:-1)*e,cy:(t<2?-1:1)*e,...o}}if(e===`donut`){let e=XO(n/.66)*Math.PI*2,o=Math.min(e,t*Math.PI/8)-Math.PI/2,s=XO((n-.79)/.21),c=8+Math.sin(r*2+i)*.35*Math.sin(n*Math.PI);return{cx:Math.cos(o)*c*(1-s),cy:Math.sin(o)*c*(1-s)-8*s,rx:3.6*(1+a*Math.sin(n*Math.PI)),ry:3.6/(1+a*Math.sin(n*Math.PI))}}if(e===`bloom`){if(t===0){let e=[1,2,3,4].reduce((e,t)=>e+ZO(t,n),0),t=Math.sqrt(49-e*4);return{cx:Math.sin(r)*.4,cy:Math.sin(r*2)*.4,rx:t*(1+a),ry:t/(1+a)}}let e=ZO(t,n),i=(t-1)*Math.PI/2-Math.PI/4+Math.sin(r)*.22;return{cx:Math.cos(i)*14*e,cy:Math.sin(i)*14*e,rx:3.2*(1+a),ry:3.2/(1+a)}}return{cx:Math.sin(r+i)*6+Math.sin(r*3+i)*2.5,cy:Math.cos(r*2+i)*6,...o}}var $O={line:1700,square:1900,donut:3e3,wander:4600,bloom:2800},ek=2;function tk({variant:e,pace:t=`working`}){let r=`caps-loader-${(0,N.useId)().replaceAll(`:`,``)}`,i=(0,N.useRef)(null),a=(0,N.useRef)(null),o=MO(a),{reduced:s}=o,c=e===`donut`?16:e===`bloom`?5:e===`square`?4:3;return(0,N.useLayoutEffect)(()=>{if(!i.current||!a.current||s&&t===`idle`)return;let r=s?[n(i.current,{opacity:[.55,1],duration:o.slow*10,ease:`inOutSine`,alternate:!0,loop:!0})]:[...i.current.querySelectorAll(`ellipse`)].map((r,i)=>n(r,{keyframes:Array.from({length:48},(n,r)=>({...QO(e,i,(r+1)/48),duration:NO(o,$O[e]*(t===`idle`?ek:1))/48})),ease:`linear`,loop:!0})),c=YO(a.current,e=>{for(let t of r)e?t.resume():t.pause()});return()=>{c();for(let e of r)e.revert()}},[e,t,s,o]),(0,Y.jsxs)(`svg`,{ref:a,"aria-hidden":`true`,focusable:`false`,viewBox:e===`line`?`-20 -10 40 20`:`-20 -20 40 40`,children:[(0,Y.jsxs)(`defs`,{children:[(0,Y.jsx)(JO,{id:r,values:qO}),(0,Y.jsx)(WO,{id:`${r}-surface`,transform:e===`line`?`matrix(3.4 0 0 1.4 0 0)`:`matrix(3 0 0 3 0 0)`}),(0,Y.jsx)(GO,{id:`${r}-shadow`}),(0,Y.jsx)(`mask`,{id:`${r}-mask`,maskUnits:`userSpaceOnUse`,x:`-20`,y:`-20`,width:`40`,height:`40`,style:{maskType:`alpha`},children:(0,Y.jsx)(`g`,{ref:i,fill:`currentColor`,filter:`url(#${r})`,children:Array.from({length:c},(t,n)=>(0,Y.jsx)(`ellipse`,{...QO(e,n,0)},n))})})]}),(0,Y.jsx)(`g`,{filter:`url(#${r}-shadow)`,children:(0,Y.jsx)(`rect`,{x:`-20`,y:`-20`,width:`40`,height:`40`,fill:`url(#${r}-surface)`,mask:`url(#${r}-mask)`})})]})}var nk={sm:`caps-loader-sm`,md:`caps-loader-md`,lg:`caps-loader-lg`,fill:`caps-loader-fill`},rk={neutral:`text-base-content`,accent:`text-accent`,primary:`text-primary`,success:`text-success`,current:`text-current`},ik=(0,N.forwardRef)(function({"aria-label":e,"aria-labelledby":t,className:n,decorative:r=!1,label:i=`Loading`,size:a=`md`,variant:o=`line`,pace:s=`working`,tone:c=`neutral`,...l},u){let d=`${(0,N.useId)()}-label`,f=!r&&e===void 0&&t===void 0;return(0,Y.jsxs)(`span`,{...l,"aria-label":r?void 0:e,"aria-hidden":r||void 0,"aria-labelledby":r?void 0:t??(e===void 0?d:void 0),className:dO(`caps-loader`,nk[a],rk[c],n),"data-variant":o,"data-pace":s,role:r?void 0:`status`,ref:u,children:[(0,Y.jsx)(tk,{variant:o,pace:s}),f?(0,Y.jsx)(UO,{id:d,children:i}):null]})}),ak=`disabled:bg-base-200 disabled:text-base-content disabled:outline-1 disabled:outline-solid disabled:outline-base-content/25 aria-disabled:bg-base-200 aria-disabled:text-base-content aria-disabled:outline-1 aria-disabled:outline-solid aria-disabled:outline-base-content/25`,ok=zE(`btn caps-button disabled:pointer-events-none`,{variants:{variant:{primary:`btn-primary caps-button-filled`,secondary:`btn-secondary caps-button-filled`,accent:`btn-accent caps-button-filled`,destructive:`btn-error caps-button-filled`,outline:`btn-outline ${ak}`,ghost:`btn-ghost`,"ghost-destructive":`btn-ghost caps-button-ghost-destructive`,link:`btn-link ${ak}`},size:{xs:`btn-xs`,sm:`btn-sm`,default:`btn-md`,lg:`btn-lg`,icon:`btn-square btn-md`,menubar:`caps-button-menubar`}},defaultVariants:{variant:`primary`,size:`default`}}),sk=(0,N.forwardRef)(function({asChild:e=!1,children:t,className:n,disabled:r,loading:i=!1,result:a,resultLabel:o,onResultEnd:s,size:c=`default`,variant:l=`primary`,...u},d){let f=dO(ok({size:c,variant:l}),n),p=(0,N.useRef)(a).current,m=(0,N.useRef)(null);return(0,N.useImperativeHandle)(d,()=>m.current),ck(m,i,a),e?(0,Y.jsx)(_O,{...u,"aria-busy":i?!0:u[`aria-busy`],"aria-disabled":r===!0||i?!0:void 0,className:f,ref:m,children:t}):(0,Y.jsx)(`button`,{...u,"aria-busy":i?!0:u[`aria-busy`],className:f,disabled:r===!0||i,ref:m,type:u.type??`button`,children:a===void 0&&o===void 0?(0,Y.jsxs)(Y.Fragment,{children:[i?(0,Y.jsx)(ik,{decorative:!0,size:`sm`,tone:`current`,variant:`wander`}):null,t]}):(0,Y.jsx)(pk,{label:o,loading:i,onResultEnd:s,result:a,settled:p,children:t})})});function ck(e,t,n){let r=(0,N.useRef)(null),i=(0,N.useRef)(null),a=(0,N.useRef)(null);(0,N.useLayoutEffect)(()=>{let o=e.current;if(!o)return;let s=JSON.stringify([t,n??null,o.textContent]),c=s!==i.current;i.current=s;let l=a.current;if(!c&&l)return;let u=l?o.offsetWidth:r.current;l&&(a.current=null,l.cancel(),o.style.removeProperty(`overflow`),o.style.removeProperty(`white-space`));let d=o.offsetWidth;if(r.current=d>0?d:null,!c||u===null||d===0||Math.abs(u-d)<1||!LO(o))return;let f=jO(o);if(f.reduced)return;let p=o.animate([{width:`${String(u)}px`},{width:`${String(d)}px`}],{duration:f.normal,easing:IO(f,f.ease)});a.current=p,o.style.overflow=`clip`,o.style.whiteSpace=`nowrap`;let m=()=>{a.current===p&&(a.current=null,o.style.removeProperty(`overflow`),o.style.removeProperty(`white-space`))};p.onfinish=m,p.oncancel=m})}var lk=1100;function uk(e,t){let n=t.bounce/.3,r=1+.05*Math.min(1.4,.4+n),i=1-.02*Math.min(1.4,n);return e.animate([{transform:`scale(1)`},{transform:`scale(${String(r)})`,offset:.35},{transform:`scale(${String(i)})`,offset:.7},{transform:`scale(1)`}],{duration:t.springDuration,easing:IO(t,`ease-out`)})}function dk(e,t){let n=t.shake;return e.animate([{transform:`none`},{transform:`translateX(${String(-n)}px)`},{transform:`translateX(${String(n)}px)`},{transform:`translateX(${String(-n*.6)}px)`},{transform:`translateX(${String(n*.3)}px)`},{transform:`none`}],{duration:t.slow*1.3,easing:IO(t,`linear`)})}function fk(e,t,n){let r=n.distance+2,i=`blur(${String(n.blur)}px)`;return[e.animate([{opacity:1,transform:`none`,filter:`blur(0px)`},{opacity:0,transform:`translateY(${String(-r)}px)`,filter:i}],{duration:n.fast,easing:IO(n,n.ease)}),t.animate([{opacity:0,transform:`translateY(${String(r)}px)`,filter:i},{opacity:1,transform:`none`,filter:`blur(0px)`}],{duration:n.normal,easing:IO(n,n.ease),fill:`backwards`})]}function pk({children:e,label:t,loading:n,onResultEnd:r,result:i,settled:a}){let o=(0,N.useRef)(null),s=HO(),[c,l]=(0,N.useState)(!1),[u,d]=(0,N.useState)(!1);c&&!u&&d(!0);let f=(0,N.useRef)(a),p=(0,N.useRef)(r);(0,N.useEffect)(()=>{p.current=r},[r]),(0,N.useLayoutEffect)(()=>{let e=f.current;if(f.current=i,i===e)return;if(i===`done`){l(!0);let e=setTimeout(()=>{p.current?p.current():l(!1)},lk);return()=>{clearTimeout(e)}}l(!1);let t=o.current;if(i!==`failed`||!t||!LO(t))return;let n=jO(t);if(n.shake<=0)return;let r=dk(t,n);return()=>{r.cancel()}},[i,s]);let m=(0,N.useRef)(c);return(0,N.useLayoutEffect)(()=>{let e=o.current;if(!e||m.current===c)return;m.current=c;let t=e.querySelector(`[data-face="label"]`),n=e.querySelector(`[data-face="result"]`);if(!t||!n||!LO(e)){c||d(!1);return}let r=jO(e),i=c?fk(t,n,r):fk(n,t,r);if(c||i[0]?.addEventListener(`finish`,()=>{d(!1)}),c&&!r.reduced){i.push(uk(e.closest(`button`)??e,r));let t=n.querySelector(`path`);t&&i.push(t.animate([{strokeDashoffset:1},{strokeDashoffset:0}],{duration:r.normal*1.4,delay:r.fast/2,easing:IO(r,r.ease),fill:`backwards`}))}return()=>{for(let e of i)e.cancel()}},[c,s]),(0,Y.jsxs)(`span`,{ref:o,className:`caps-button-faces`,"data-showing":c?`result`:`label`,children:[(0,Y.jsxs)(`span`,{className:`caps-button-face`,"data-face":`label`,"aria-hidden":c?!0:void 0,children:[n||c?(0,Y.jsx)(ik,{decorative:!0,size:`sm`,tone:`current`,variant:`wander`}):null,e]}),u?(0,Y.jsxs)(`span`,{className:`caps-button-face`,"data-face":`result`,"aria-hidden":!c||void 0,children:[(0,Y.jsx)(`svg`,{className:`caps-button-check`,viewBox:`0 0 24 24`,"aria-hidden":`true`,focusable:`false`,children:(0,Y.jsx)(`path`,{d:`M4.5 12.5 9.5 17.5 19.5 6.5`,pathLength:1})}),t===void 0?e:t]}):null]})}var mk={xs:`size-3`,sm:`size-[var(--stipe-icon-size-sm)]`,md:`size-[var(--stipe-icon-size-md)]`,lg:`size-[var(--stipe-icon-size-lg)]`},hk=(0,N.forwardRef)(function({active:e=!1,icon:t,iconSize:n=`xs`,className:r,reveal:i=!1,size:a=`xs`,tone:o=`default`,variant:s=`ghost`,...c},l){let u=a===`responsive`;return(0,Y.jsx)(sk,{...c,resultLabel:c.result===void 0?void 0:null,ref:l,size:u?`sm`:a,variant:s,className:dO(`caps-icon-button btn-circle`,u&&`caps-icon-button-responsive md:btn-xs`,e&&`text-accent`,i&&`scale-0 transition-transform group-hover:scale-100 focus-visible:scale-100`,o===`destructive`&&`hover:text-error`,r),children:(0,Y.jsx)(`span`,{"aria-hidden":`true`,className:dO(`inline-flex shrink-0 [&>svg]:size-full [&>svg]:[stroke-width:var(--stipe-icon-stroke)]`,mk[n]),children:t})})}),gk=(0,N.forwardRef)(function({tone:e=`neutral`,size:t=`md`,pressed:n=!1,touch:r,className:i,...a},o){return(0,Y.jsx)(`kbd`,{...a,ref:o,className:dO(`caps-keycap`,i),"data-tone":e,"data-size":t,"data-pressed":n,"data-touch":r})}),_k=(0,N.forwardRef)(function({label:e,shortcut:t,icon:n,readout:r,tone:i=`neutral`,density:a=`regular`,pressed:o,expanded:s,className:c,type:l=`button`,...u},d){let f=o??s;return(0,Y.jsxs)(`button`,{...u,ref:d,type:l,className:dO(`caps-keycap-button`,c),"data-tone":i,"data-density":a===`compact`?a:void 0,"aria-pressed":o,"aria-expanded":s,"aria-keyshortcuts":u[`aria-keyshortcuts`]??t,children:[f===void 0?null:(0,Y.jsx)(`span`,{className:`caps-keycap-led`,"data-lit":f,"aria-hidden":`true`}),n?(0,Y.jsx)(`span`,{className:`caps-keycap-button-icon`,"aria-hidden":`true`,children:n}):null,e===null?null:(0,Y.jsx)(`span`,{className:`caps-keycap-button-label`,children:e}),r,t?(0,Y.jsx)(gk,{size:`sm`,tone:`neutral`,touch:`hide`,"aria-hidden":`true`,children:t}):null]})}),vk=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),yk=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),bk={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},xk=(0,N.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,N.createElement)(`svg`,{ref:c,...bk,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:yk(`lucide`,i),...s},[...o.map(([e,t])=>(0,N.createElement)(e,t)),...Array.isArray(a)?a:[a]])),Sk=(e,t)=>{let n=(0,N.forwardRef)(({className:n,...r},i)=>(0,N.createElement)(xk,{ref:i,iconNode:t,className:yk(`lucide-${vk(e)}`,n),...r}));return n.displayName=`${e}`,n},Ck=function(e,t,n){if(t!=null){if(typeof t!=`object`&&typeof t!=`function`)throw TypeError(`Object expected.`);var r,i;if(n){if(!Symbol.asyncDispose)throw TypeError(`Symbol.asyncDispose is not defined.`);r=t[Symbol.asyncDispose]}if(r===void 0){if(!Symbol.dispose)throw TypeError(`Symbol.dispose is not defined.`);r=t[Symbol.dispose],n&&(i=r)}if(typeof r!=`function`)throw TypeError(`Object not disposable.`);i&&(r=function(){try{i.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:r,async:n})}else n&&e.stack.push({async:!0});return t},wk=(function(e){return function(t){function n(n){t.error=t.hasError?new e(n,t.error,`An error was suppressed during disposal.`):n,t.hasError=!0}var r,i=0;function a(){for(;r=t.stack.pop();)try{if(!r.async&&i===1)return i=0,t.stack.push(r),Promise.resolve().then(a);if(r.dispose){var e=r.dispose.call(r.value);if(r.async)return i|=2,Promise.resolve(e).then(a,function(e){return n(e),a()})}else i|=1}catch(e){n(e)}if(i===1)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}return a()}})(typeof SuppressedError==`function`?SuppressedError:function(e,t,n){var r=Error(n);return r.name=`SuppressedError`,r.error=e,r.suppressed=t,r}),Tk=class extends J{stage;provider;constructor(e){super(e.message,{code:e.code,retryable:e.retryable,...e.need!==void 0&&{need:e.need}}),this.stage=e.stage??null,this.provider=e.provider}},Ek=e=>ax.pipe(q(Nx(1)),q(Ix(e))),Dk=W({requestId:Ek(256),computerId:Ek(256)}),Ok=ox.pipe(q(jx()),q(_x(Number.isSafeInteger,{message:`Expected a safe integer`}))),$=Ok.pipe(q(Dx(0))),kk=Ok.pipe(q(Ox(0))),Ak=K([`first-frame`,`last-frame`,`reference`]),jk=K([`480p`,`720p`,`768p`,`1080p`,`4k`]),Mk=K([`16:9`,`4:3`,`1:1`,`3:4`,`9:16`,`21:9`,`9:21`]),Nk=W({computerId:B(Ek(256)),path:Ek(4096),role:B(Ak)}),Pk=W({path:Ek(4096),role:Ak}),Fk=W({computerId:Ek(256),path:Ek(4096)}),Ik=W({defaultHeight:$,defaultSteps:dx(kk),defaultWidth:$,dimensions:K([`none`,`own`]),maxDimension:dx($),maxDimensionDocumented:U,maxReferences:kk,maxSteps:dx($),referenceDimension:dx($),referenceField:dx(Ek(256)),referenceFormat:K([`png`,`webp`]),steps:K([`steps`,`num_steps`,`fixed`]),transport:K([`json`,`multipart`])}),Lk=W({minSeconds:$,maxSeconds:$,defaultSeconds:$,durations:G($),provider:K([`seedance`,`veo`,`minimax`]),formats:G(W({resolution:jk,aspectRatio:Mk,width:$,height:$})),defaultResolution:jk,defaultAspectRatio:Mk,supportsAudio:U,defaultGenerateAudio:dx(U),referenceRoles:G(Ak),maxReferenceImages:kk,audioReferences:dx(W({max:$,totalSeconds:$})),referenceResolutions:G(jk),prices:G(W({resolution:jk,silentMilliunitsPerSecond:$,audioMilliunitsPerSecond:$}))}),Rk=G(W({id:Ek(256),input:Ik,kind:K([`image`,`video`]),label:Ek(512),maxPromptLength:$,tier:K([`draft`,`balanced`,`premium`,`max`]),outputFormats:G(K([`png`,`jpeg`,`webp`])).pipe(q(Ix(3))),sizes:dx(G(ax.pipe(q(bx(/^\d+x\d+$/u))))),video:dx(Lk),audio:rx})),zk=W({[Symbol.dispose]:B(H),computerId:Ek(256),models:Rk,canGenerate:U}),Bk=W({model:Ek(256),prompt:Ek(2048),width:$.pipe(q(kx(5040))),height:$.pipe(q(kx(5040))),steps:B($),durationSeconds:B($),resolution:B(jk),aspectRatio:B(Mk),generateAudio:B(U),references:B(G(Nk).pipe(q(Ix(16))))});W({model:Ek(256),prompt:Ek(2048),resolution:B(jk),aspectRatio:B(Mk),durationSeconds:B($.pipe(q(Ox(4)),q(kx(15)))),generateAudio:B(U),references:B(G(Pk).pipe(q(Ix(4))))});var Vk=[`admission`,`generation-authorization`,`settings`,`estimate`,`billing`,`operation`,`provider`,`normalization`,`artifact`,`destination-authorization`,`destination-write`],Hk=W({destination:W({path:Ek(4096)}),settings:H}),Uk=W({[Symbol.dispose]:B(H),bytes:$,costMilliunits:kk,destination:Fk,format:K([`png`,`jpeg`,`gif`,`webp`,`mp4`]),height:$,model:Ek(256),width:$});W({...Uk.fields,format:V(`mp4`)});var Wk=W({message:Ek(512),stage:B(K(Vk)),provider:B(Xx),code:K([`CANCELLED`,`CAPABILITY_DENIED`,`CAPABILITY_REVOKED`,`DAILY_LIMIT_REACHED`,`DISCONNECTED`,`HOST_FAILURE`,`IDENTITY`,`INSUFFICIENT_CREDIT`,`INVALID_ARGUMENT`,`MEDIA_PROVIDER_FAILURE`,`MEDIA_PROVIDER_FAILURE_UNCHARGED`,`PROTOCOL`,`SAFETY_FILTER_REFUSED`,`SETUP_REQUIRED`,`TIMEOUT`]),retryable:U,need:B(Kx)}),Gk=ux([W({[Symbol.dispose]:B(H),kind:V(`succeeded`),result:Uk}),W({[Symbol.dispose]:B(H),kind:V(`failed`),failure:Wk})]),Kk=kE({reference:jE(AE(Qa().transform(e=>ex(Dk)(e)))),generate:jE(AE(Qa().transform(e=>{let t=ex(Gk,{onExcessProperty:`error`})(e);return t.kind===`succeeded`?{kind:t.kind,result:{bytes:t.result.bytes,costMilliunits:t.result.costMilliunits,destination:t.result.destination,format:t.result.format,height:t.result.height,model:t.result.model,width:t.result.width}}:{kind:t.kind,failure:t.failure}})))}),qk=OE(`media.generation`,5,Uo(()=>kE({describe:jE(AE(Qa().transform(e=>{let{computerId:t,canGenerate:n,models:r}=ex(zk,{onExcessProperty:`error`})(e);return{computerId:t,canGenerate:n,models:r}}))),quote:jE(AE(oo({costMilliunits:Wa().int().nonnegative().max(2**53-1)}))).optional(),createAttempt:jE(Kk),restoreAttempt:jE(Kk),cancelAttempt:ME}))),Jk=lo([oo({shared:M(!1)}),oo({shared:M(!0),url:Da(),showPrompt:Ja()})]);oo({requestId:A().min(1).max(256),showPrompt:Ja()});var Yk=OE(`media.share`,1,Uo(()=>kE({status:jE(AE(Jk)),share:jE(AE(Jk)),stop:jE(AE(Jk))})));function Xk(e,t){try{return ex(e,{onExcessProperty:`error`})(t)}catch(e){throw new J(`The Media capability returned malformed data`,{cause:e,code:`PROTOCOL`,retryable:!1})}}function Zk(e){return e instanceof J?e:new J(`The Media capability failed`,{cause:e,code:`HOST_FAILURE`,retryable:!0})}function Qk(e){if(e?.aborted)throw new J(`Media generation was cancelled`,{code:`CANCELLED`,retryable:!1})}function $k(e){let t;try{t=ex(Hk,{onExcessProperty:`error`})(e)}catch(e){throw new J(`Media generation input is invalid`,{cause:e,code:`INVALID_ARGUMENT`,retryable:!1})}let n;try{n=tA(ex(Bk,{onExcessProperty:`error`})(t.settings))}catch(e){throw new J(`Media generation settings are invalid`,{cause:e,code:`INVALID_ARGUMENT`,retryable:!1})}let r={path:t.destination.path.trim()};if(r.path.length===0)throw new J(`Media generation destination is invalid`,{code:`INVALID_ARGUMENT`,retryable:!1});return Object.freeze({destination:Object.freeze(r),settings:n})}function eA(e){try{return tA(ex(Bk,{onExcessProperty:`error`})(e))}catch(e){throw new J(`Media generation settings are invalid`,{cause:e,code:`INVALID_ARGUMENT`,retryable:!1})}}function tA(e){let t=(e,t)=>{let n=e.trim();if(n.length===0)throw Error(`${t} must not be blank`);return n},n={model:t(e.model,`model`),prompt:t(e.prompt,`prompt`),width:e.width,height:e.height};return e.steps!==void 0&&(n.steps=e.steps),e.durationSeconds!==void 0&&(n.durationSeconds=e.durationSeconds),e.resolution!==void 0&&(n.resolution=e.resolution),e.aspectRatio!==void 0&&(n.aspectRatio=e.aspectRatio),e.generateAudio!==void 0&&(n.generateAudio=e.generateAudio),e.references!==void 0&&(n.references=Object.freeze(e.references.map(e=>Object.freeze({...e,path:t(e.path,`reference`)})))),Object.freeze(n)}function nA(e){let t=Xk(Rk,e),n=new Set;for(let e of t){if(n.has(e.id))throw new J(`The Media capability repeated a model`,{code:`PROTOCOL`,retryable:!1});n.add(e.id)}return Object.freeze(t.map(e=>Object.freeze(e)))}function rA(e,t,n){let r=Xk(Uk,e);if(r.model!==t.settings.model||r.destination.computerId!==n||r.destination.path!==t.destination.path||r.width!==t.settings.width||r.height!==t.settings.height)throw new J(`The Media capability returned an unrelated result`,{code:`PROTOCOL`,retryable:!1});return Object.freeze({bytes:r.bytes,costMilliunits:r.costMilliunits,destination:Object.freeze({...r.destination}),format:r.format,height:r.height,model:r.model,width:r.width})}async function iA(e){try{let t=e.require(qk);{let e={stack:[],error:void 0,hasError:!1};try{let n=Xk(zk,Ck(e,wE(await t.describe()),!1).value),r=n.computerId.trim();if(r.length===0)throw new J(`The Media capability returned no Computer`,{code:`PROTOCOL`,retryable:!1});let i=nA(n.models),a=t.quote?.bind(t),o=async e=>{let n=wE(e),i;try{{let t={stack:[],error:void 0,hasError:!1};try{let n=Ck(t,wE(await e.reference()),!1),a=Xk(W({...Dk.fields,[Symbol.dispose]:B(H)}),n.value);if(i={requestId:a.requestId,computerId:a.computerId},i.computerId!==r)throw new J(`Media attempt belongs to another Computer`,{code:`IDENTITY`,retryable:!1})}catch(e){t.error=e,t.hasError=!0}finally{wk(t)}}}catch(e){throw n[Symbol.dispose](),Zk(e)}let a=!1;return{reference:Object.freeze(i),async generate(n,o={}){if(a)throw new J(`Media generation attempt is closed`,{code:`CAPABILITY_DENIED`,retryable:!1});Qk(o.signal);let s=$k(n),c=o.signal,l,u,d=()=>(u??=t.cancelAttempt(i),u);try{let t=e.generate(s),n=c===void 0?await t:await Promise.race([t,new Promise((e,t)=>{l=()=>{d().then(()=>{t(new J(`Media generation was cancelled`,{code:`CANCELLED`,retryable:!1}))},t)},c.addEventListener(`abort`,l,{once:!0}),c.aborted&&l()})]);c?.aborted&&(await d(),Qk(c)),Qk(c);{let e={stack:[],error:void 0,hasError:!1};try{let t=Xk(Gk,Ck(e,wE(n),!1).value);if(t.kind===`failed`)throw new Tk(t.failure);return rA(t.result,s,r)}catch(t){e.error=t,e.hasError=!0}finally{wk(e)}}}catch(e){throw c?.aborted&&(await d(),Qk(c)),Zk(e)}finally{l!==void 0&&c?.removeEventListener(`abort`,l)}},[Symbol.dispose](){a||(a=!0,n[Symbol.dispose]())}}};return Object.freeze({computerId:r,canGenerate:n.canGenerate,models:i,async quote(e){let t={stack:[],error:void 0,hasError:!1};try{let n=eA(e);if(a===void 0)return null;let r=Ck(t,wE(await a(n)),!1);return Object.freeze({costMilliunits:r.value.costMilliunits})}catch(e){t.error=e,t.hasError=!0}finally{wk(t)}},async createAttempt(){return o(await t.createAttempt())},async restoreAttempt(e){let n=Xk(Dk,e);if(n.computerId!==r)throw new J(`Select the original Computer to retry this generation`,{code:`IDENTITY`,retryable:!1});let i=await o(await t.restoreAttempt(n));if(i.reference.requestId!==n.requestId)throw i[Symbol.dispose](),new J(`Media restore changed the request identity`,{code:`PROTOCOL`,retryable:!1});return i}})}catch(t){e.error=t,e.hasError=!0}finally{wk(e)}}}catch(e){throw Zk(e)}}function aA(e,t){console.error(`Prints operation failed`,JSON.stringify({operation:e,errorKind:t instanceof Error?`error`:`non-error`,stage:t instanceof Tk?t.stage:null,provider:t instanceof Tk?t.provider:void 0}),gh(t))}export{MT as $,Vg as $n,ur as $r,PS as $t,fO as A,$b as An,ao as Ar,GS as At,wT as B,Nx as Bn,Yo as Br,NS as Bt,IO as C,ix as Cn,ro as Cr,Sw as Ct,MO as D,q as Dn,xo as Dr,YS as Dt,jO as E,px as En,yo as Er,QS as Et,ME as F,Ax as Fn,co as Fr,RS as Ft,TT as G,Gx as Gn,Wa as Gr,vS as Gt,dE as H,_x as Hn,Uo as Hr,bS as Ht,OE as I,Dx as In,bo as Ir,LS as It,OT as J,Ug as Jn,oo as Jr,xS as Jt,ET as K,Yb as Kn,j as Kr,_S as Kt,xE as L,Ox as Ln,Qo as Lr,FS as Lt,AE as M,Bx as Mn,Ro as Mr,US as Mt,kE as N,hx as Nn,ba as Nr,HS as Nt,HO as O,Hb as On,Oo as Or,JS as Ot,jE as P,Xb as Pn,k as Pr,zS as Pt,QT as Q,qg as Qn,Ta as Qr,wS as Qt,CE as R,jx as Rn,io as Rr,AS as Rt,PO as S,Hx as Sn,is as Sr,Ew as St,NO as T,ux as Tn,Ao as Tr,ww as Tt,vE as U,B as Un,M as Ur,yS as Ut,KT as V,bx as Vn,$o as Vr,pS as Vt,yE as W,nx as Wn,so as Wr,mS as Wt,AT as X,Rg as Xn,lo as Xr,CS as Xt,kT as Y,Wg as Yn,A as Yr,kS as Yt,jT as Z,Hg as Zn,Qa as Zr,gS as Zt,GO as _,dx as _n,qs as _r,pE as _t,Dk as a,Me as ai,iS as an,Fv as ar,HT as at,UO as b,ax as bn,ys as br,Ow as bt,$k as c,v as ci,nS as cn,Ru as cr,qT as ct,hk as d,i as di,xx as dn,Nu as dr,JT as dt,Bn as ei,MS as en,zg as er,eE as et,sk as f,Mx as fn,Pu as fr,hE as ft,KO as g,rx as gn,Mu as gr,XT as gt,JO as h,Rx as hn,Au as hr,YT as ht,Hk as i,Ae as ii,oS as in,$v as ir,GT as it,zE as j,ex as jn,wo as jr,qS as jt,dO as k,Qb as kn,Ua as kr,KS as kt,Sk as l,w as li,G as ln,zu as lr,fE as lt,YO as m,K as mn,Fu as mr,FT as mt,Tk as n,E as ni,lS as nn,Qv as nr,PT as nt,Yk as o,Pe as oi,J as on,tg as or,UT as ot,ik as p,V as pn,ku as pr,IT as pt,DT as q,Kg as qn,vo as qr,fS as qt,qk as r,Oe as ri,sS as rn,ey as rr,LT as rt,iA as s,C as si,Zx as sn,gh as sr,mE as st,aA as t,En as ti,hS as tn,Jg as tr,NT as tt,_k as u,o as ui,U as un,ju as ur,ZT as ut,WO as v,ox as vn,Zs as vr,Aw as vt,FO as w,fx as wn,qa as wr,Cw as wt,LO as x,W as xn,os as xr,Dw as xt,qO as y,cx as yn,Js as yr,kw as yt,bE as z,Ix as zn,Ja as zr,jS as zt};