@octavus/agent 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -59,7 +59,7 @@ var rF=Object.create;var pm=Object.defineProperty;var nF=Object.getOwnPropertyDe
59
59
 
60
60
  `)}h.write("payload.value = newResult;"),h.write("return payload;");let w=h.compile();return(k,S)=>w(p,k,S)},i,s=_o,a=!Pa.jitless,c=a&&Mm.value,l=t.catchall,f;e._zod.parse=(p,h)=>{f??(f=o.value);let m=p.value;return s(m)?a&&c&&h?.async===!1&&h.jitless!==!0?(i||(i=n(t.shape)),p=i(p,h),l?Vz([],m,p,h,f,e):p):r(p,h):(p.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),p)}});function Rz(e,t,r,o){for(let i of e)if(i.issues.length===0)return t.value=i.value,t;let n=e.filter(i=>!Pn(i));return n.length===1?(t.value=n[0].value,n[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(s=>xt(s,o,Ne())))}),t)}var Ba=$("$ZodUnion",(e,t)=>{H.init(e,t),Y(e._zod,"optin",()=>t.options.some(n=>n._zod.optin==="optional")?"optional":void 0),Y(e._zod,"optout",()=>t.options.some(n=>n._zod.optout==="optional")?"optional":void 0),Y(e._zod,"values",()=>{if(t.options.every(n=>n._zod.values))return new Set(t.options.flatMap(n=>Array.from(n._zod.values)))}),Y(e._zod,"pattern",()=>{if(t.options.every(n=>n._zod.pattern)){let n=t.options.map(i=>i._zod.pattern);return new RegExp(`^(${n.map(i=>Ca(i.source)).join("|")})$`)}});let r=t.options.length===1,o=t.options[0]._zod.run;e._zod.parse=(n,i)=>{if(r)return o(n,i);let s=!1,a=[];for(let u of t.options){let c=u._zod.run({value:n.value,issues:[]},i);if(c instanceof Promise)a.push(c),s=!0;else{if(c.issues.length===0)return c;a.push(c)}}return s?Promise.all(a).then(u=>Rz(u,n,e,i)):Rz(a,n,e,i)}});function Cz(e,t,r,o){let n=e.filter(i=>i.issues.length===0);return n.length===1?(t.value=n[0].value,t):(n.length===0?t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(s=>xt(s,o,Ne())))}):t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:[],inclusive:!1}),t)}var T_=$("$ZodXor",(e,t)=>{Ba.init(e,t),t.inclusive=!1;let r=t.options.length===1,o=t.options[0]._zod.run;e._zod.parse=(n,i)=>{if(r)return o(n,i);let s=!1,a=[];for(let u of t.options){let c=u._zod.run({value:n.value,issues:[]},i);c instanceof Promise?(a.push(c),s=!0):a.push(c)}return s?Promise.all(a).then(u=>Cz(u,n,e,i)):Cz(a,n,e,i)}}),I_=$("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Ba.init(e,t);let r=e._zod.parse;Y(e._zod,"propValues",()=>{let n={};for(let i of t.options){let s=i._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(let[a,u]of Object.entries(s)){n[a]||(n[a]=new Set);for(let c of u)n[a].add(c)}}return n});let o=bi(()=>{let n=t.options,i=new Map;for(let s of n){let a=s._zod.propValues?.[t.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let u of a){if(i.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);i.set(u,s)}}return i});e._zod.parse=(n,i)=>{let s=n.value;if(!_o(s))return n.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),n;let a=o.value.get(s?.[t.discriminator]);return a?a._zod.run(n,i):t.unionFallback?r(n,i):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:s,path:[t.discriminator],inst:e}),n)}}),P_=$("$ZodIntersection",(e,t)=>{H.init(e,t),e._zod.parse=(r,o)=>{let n=r.value,i=t.left._zod.run({value:n,issues:[]},o),s=t.right._zod.run({value:n,issues:[]},o);return i instanceof Promise||s instanceof Promise?Promise.all([i,s]).then(([u,c])=>Az(r,u,c)):Az(r,i,s)}});function qg(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(In(e)&&In(t)){let r=Object.keys(t),o=Object.keys(e).filter(i=>r.indexOf(i)!==-1),n={...e,...t};for(let i of o){let s=qg(e[i],t[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};n[i]=s.data}return{valid:!0,data:n}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let o=0;o<e.length;o++){let n=e[o],i=t[o],s=qg(n,i);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};r.push(s.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Az(e,t,r){let o=new Map,n;for(let a of t.issues)if(a.code==="unrecognized_keys"){n??(n=a);for(let u of a.keys)o.has(u)||o.set(u,{}),o.get(u).l=!0}else e.issues.push(a);for(let a of r.issues)if(a.code==="unrecognized_keys")for(let u of a.keys)o.has(u)||o.set(u,{}),o.get(u).r=!0;else e.issues.push(a);let i=[...o].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(i.length&&n&&e.issues.push({...n,keys:i}),Pn(e))return e;let s=qg(t.value,r.value);if(!s.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return e.value=s.data,e}var rd=$("$ZodTuple",(e,t)=>{H.init(e,t);let r=t.items;e._zod.parse=(o,n)=>{let i=o.value;if(!Array.isArray(i))return o.issues.push({input:i,inst:e,expected:"tuple",code:"invalid_type"}),o;o.value=[];let s=[],a=[...r].reverse().findIndex(l=>l._zod.optin!=="optional"),u=a===-1?0:r.length-a;if(!t.rest){let l=i.length>r.length,f=i.length<u-1;if(l||f)return o.issues.push({...l?{code:"too_big",maximum:r.length,inclusive:!0}:{code:"too_small",minimum:r.length},input:i,inst:e,origin:"array"}),o}let c=-1;for(let l of r){if(c++,c>=i.length&&c>=u)continue;let f=l._zod.run({value:i[c],issues:[]},n);f instanceof Promise?s.push(f.then(p=>Gl(p,o,c))):Gl(f,o,c)}if(t.rest){let l=i.slice(r.length);for(let f of l){c++;let p=t.rest._zod.run({value:f,issues:[]},n);p instanceof Promise?s.push(p.then(h=>Gl(h,o,c))):Gl(p,o,c)}}return s.length?Promise.all(s).then(()=>o):o}});function Gl(e,t,r){e.issues.length&&t.issues.push(...Ct(r,e.issues)),t.value[r]=e.value}var O_=$("$ZodRecord",(e,t)=>{H.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!In(n))return r.issues.push({expected:"record",code:"invalid_type",input:n,inst:e}),r;let i=[],s=t.keyType._zod.values;if(s){r.value={};let a=new Set;for(let c of s)if(typeof c=="string"||typeof c=="number"||typeof c=="symbol"){a.add(typeof c=="number"?c.toString():c);let l=t.valueType._zod.run({value:n[c],issues:[]},o);l instanceof Promise?i.push(l.then(f=>{f.issues.length&&r.issues.push(...Ct(c,f.issues)),r.value[c]=f.value})):(l.issues.length&&r.issues.push(...Ct(c,l.issues)),r.value[c]=l.value)}let u;for(let c in n)a.has(c)||(u=u??[],u.push(c));u&&u.length>0&&r.issues.push({code:"unrecognized_keys",input:n,inst:e,keys:u})}else{r.value={};for(let a of Reflect.ownKeys(n)){if(a==="__proto__")continue;let u=t.keyType._zod.run({value:a,issues:[]},o);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&Wl.test(a)&&u.issues.length&&u.issues.some(f=>f.code==="invalid_type"&&f.expected==="number")){let f=t.keyType._zod.run({value:Number(a),issues:[]},o);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");f.issues.length===0&&(u=f)}if(u.issues.length){t.mode==="loose"?r.value[a]=n[a]:r.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(f=>xt(f,o,Ne())),input:a,path:[a],inst:e});continue}let l=t.valueType._zod.run({value:n[a],issues:[]},o);l instanceof Promise?i.push(l.then(f=>{f.issues.length&&r.issues.push(...Ct(a,f.issues)),r.value[u.value]=f.value})):(l.issues.length&&r.issues.push(...Ct(a,l.issues)),r.value[u.value]=l.value)}}return i.length?Promise.all(i).then(()=>r):r}}),R_=$("$ZodMap",(e,t)=>{H.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!(n instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:n,inst:e}),r;let i=[];r.value=new Map;for(let[s,a]of n){let u=t.keyType._zod.run({value:s,issues:[]},o),c=t.valueType._zod.run({value:a,issues:[]},o);u instanceof Promise||c instanceof Promise?i.push(Promise.all([u,c]).then(([l,f])=>{Nz(l,f,r,s,n,e,o)})):Nz(u,c,r,s,n,e,o)}return i.length?Promise.all(i).then(()=>r):r}});function Nz(e,t,r,o,n,i,s){e.issues.length&&(Aa.has(typeof o)?r.issues.push(...Ct(o,e.issues)):r.issues.push({code:"invalid_key",origin:"map",input:n,inst:i,issues:e.issues.map(a=>xt(a,s,Ne()))})),t.issues.length&&(Aa.has(typeof o)?r.issues.push(...Ct(o,t.issues)):r.issues.push({origin:"map",code:"invalid_element",input:n,inst:i,key:o,issues:t.issues.map(a=>xt(a,s,Ne()))})),r.value.set(e.value,t.value)}var C_=$("$ZodSet",(e,t)=>{H.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!(n instanceof Set))return r.issues.push({input:n,inst:e,expected:"set",code:"invalid_type"}),r;let i=[];r.value=new Set;for(let s of n){let a=t.valueType._zod.run({value:s,issues:[]},o);a instanceof Promise?i.push(a.then(u=>Dz(u,r))):Dz(a,r)}return i.length?Promise.all(i).then(()=>r):r}});function Dz(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}var A_=$("$ZodEnum",(e,t)=>{H.init(e,t);let r=Ra(t.entries),o=new Set(r);e._zod.values=o,e._zod.pattern=new RegExp(`^(${r.filter(n=>Aa.has(typeof n)).map(n=>typeof n=="string"?Bt(n):n.toString()).join("|")})$`),e._zod.parse=(n,i)=>{let s=n.value;return o.has(s)||n.issues.push({code:"invalid_value",values:r,input:s,inst:e}),n}}),N_=$("$ZodLiteral",(e,t)=>{if(H.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(o=>typeof o=="string"?Bt(o):o?Bt(o.toString()):String(o)).join("|")})$`),e._zod.parse=(o,n)=>{let i=o.value;return r.has(i)||o.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),o}}),D_=$("$ZodFile",(e,t)=>{H.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;return n instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:n,inst:e}),r}}),j_=$("$ZodTransform",(e,t)=>{H.init(e,t),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new En(e.constructor.name);let n=t.transform(r.value,r);if(o.async)return(n instanceof Promise?n:Promise.resolve(n)).then(s=>(r.value=s,r));if(n instanceof Promise)throw new cr;return r.value=n,r}});function jz(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}var nd=$("$ZodOptional",(e,t)=>{H.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Y(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Y(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Ca(r.source)})?$`):void 0}),e._zod.parse=(r,o)=>{if(t.innerType._zod.optin==="optional"){let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>jz(i,r.value)):jz(n,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,o)}}),U_=$("$ZodExactOptional",(e,t)=>{nd.init(e,t),Y(e._zod,"values",()=>t.innerType._zod.values),Y(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,o)=>t.innerType._zod.run(r,o)}),L_=$("$ZodNullable",(e,t)=>{H.init(e,t),Y(e._zod,"optin",()=>t.innerType._zod.optin),Y(e._zod,"optout",()=>t.innerType._zod.optout),Y(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Ca(r.source)}|null)$`):void 0}),Y(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,o)=>r.value===null?r:t.innerType._zod.run(r,o)}),M_=$("$ZodDefault",(e,t)=>{H.init(e,t),e._zod.optin="optional",Y(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);if(r.value===void 0)return r.value=t.defaultValue,r;let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>Uz(i,t)):Uz(n,t)}});function Uz(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Z_=$("$ZodPrefault",(e,t)=>{H.init(e,t),e._zod.optin="optional",Y(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>(o.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,o))}),F_=$("$ZodNonOptional",(e,t)=>{H.init(e,t),Y(e._zod,"values",()=>{let r=t.innerType._zod.values;return r?new Set([...r].filter(o=>o!==void 0)):void 0}),e._zod.parse=(r,o)=>{let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>Lz(i,e)):Lz(n,e)}});function Lz(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 q_=$("$ZodSuccess",(e,t)=>{H.init(e,t),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new En("ZodSuccess");let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>(r.value=i.issues.length===0,r)):(r.value=n.issues.length===0,r)}}),B_=$("$ZodCatch",(e,t)=>{H.init(e,t),Y(e._zod,"optin",()=>t.innerType._zod.optin),Y(e._zod,"optout",()=>t.innerType._zod.optout),Y(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(i=>(r.value=i.value,i.issues.length&&(r.value=t.catchValue({...r,error:{issues:i.issues.map(s=>xt(s,o,Ne()))},input:r.value}),r.issues=[]),r)):(r.value=n.value,n.issues.length&&(r.value=t.catchValue({...r,error:{issues:n.issues.map(i=>xt(i,o,Ne()))},input:r.value}),r.issues=[]),r)}}),V_=$("$ZodNaN",(e,t)=>{H.init(e,t),e._zod.parse=(r,o)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:e,expected:"nan",code:"invalid_type"}),r)}),W_=$("$ZodPipe",(e,t)=>{H.init(e,t),Y(e._zod,"values",()=>t.in._zod.values),Y(e._zod,"optin",()=>t.in._zod.optin),Y(e._zod,"optout",()=>t.out._zod.optout),Y(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,o)=>{if(o.direction==="backward"){let i=t.out._zod.run(r,o);return i instanceof Promise?i.then(s=>Kl(s,t.in,o)):Kl(i,t.in,o)}let n=t.in._zod.run(r,o);return n instanceof Promise?n.then(i=>Kl(i,t.out,o)):Kl(n,t.out,o)}});function Kl(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}var Va=$("$ZodCodec",(e,t)=>{H.init(e,t),Y(e._zod,"values",()=>t.in._zod.values),Y(e._zod,"optin",()=>t.in._zod.optin),Y(e._zod,"optout",()=>t.out._zod.optout),Y(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,o)=>{if((o.direction||"forward")==="forward"){let i=t.in._zod.run(r,o);return i instanceof Promise?i.then(s=>Yl(s,t,o)):Yl(i,t,o)}else{let i=t.out._zod.run(r,o);return i instanceof Promise?i.then(s=>Yl(s,t,o)):Yl(i,t,o)}}});function Yl(e,t,r){if(e.issues.length)return e.aborted=!0,e;if((r.direction||"forward")==="forward"){let n=t.transform(e.value,e);return n instanceof Promise?n.then(i=>Xl(e,i,t.out,r)):Xl(e,n,t.out,r)}else{let n=t.reverseTransform(e.value,e);return n instanceof Promise?n.then(i=>Xl(e,i,t.in,r)):Xl(e,n,t.in,r)}}function Xl(e,t,r,o){return e.issues.length?(e.aborted=!0,e):r._zod.run({value:t,issues:e.issues},o)}var H_=$("$ZodReadonly",(e,t)=>{H.init(e,t),Y(e._zod,"propValues",()=>t.innerType._zod.propValues),Y(e._zod,"values",()=>t.innerType._zod.values),Y(e._zod,"optin",()=>t.innerType?._zod?.optin),Y(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run(r,o);return n instanceof Promise?n.then(Mz):Mz(n)}});function Mz(e){return e.value=Object.freeze(e.value),e}var J_=$("$ZodTemplateLiteral",(e,t)=>{H.init(e,t);let r=[];for(let o of t.parts)if(typeof o=="object"&&o!==null){if(!o._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...o._zod.traits].shift()}`);let n=o._zod.pattern instanceof RegExp?o._zod.pattern.source:o._zod.pattern;if(!n)throw new Error(`Invalid template literal part: ${o._zod.traits}`);let i=n.startsWith("^")?1:0,s=n.endsWith("$")?n.length-1:n.length;r.push(n.slice(i,s))}else if(o===null||Fm.has(typeof o))r.push(Bt(`${o}`));else throw new Error(`Invalid template literal part: ${o}`);e._zod.pattern=new RegExp(`^${r.join("")}$`),e._zod.parse=(o,n)=>typeof o.value!="string"?(o.issues.push({input:o.value,inst:e,expected:"string",code:"invalid_type"}),o):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(o.value)||o.issues.push({input:o.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),o)}),G_=$("$ZodFunction",(e,t)=>(H.init(e,t),e._def=t,e._zod.def=t,e.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return function(...o){let n=e._def.input?Nl(e._def.input,o):o,i=Reflect.apply(r,this,n);return e._def.output?Nl(e._def.output,i):i}},e.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return async function(...o){let n=e._def.input?await Dl(e._def.input,o):o,i=await Reflect.apply(r,this,n);return e._def.output?await Dl(e._def.output,i):i}},e._zod.parse=(r,o)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:e}),r):(e._def.output&&e._def.output._zod.def.type==="promise"?r.value=e.implementAsync(r.value):r.value=e.implement(r.value),r),e.input=(...r)=>{let o=e.constructor;return Array.isArray(r[0])?new o({type:"function",input:new rd({type:"tuple",items:r[0],rest:r[1]}),output:e._def.output}):new o({type:"function",input:r[0],output:e._def.output})},e.output=r=>{let o=e.constructor;return new o({type:"function",input:e._def.input,output:r})},e)),K_=$("$ZodPromise",(e,t)=>{H.init(e,t),e._zod.parse=(r,o)=>Promise.resolve(r.value).then(n=>t.innerType._zod.run({value:n,issues:[]},o))}),Y_=$("$ZodLazy",(e,t)=>{H.init(e,t),Y(e._zod,"innerType",()=>t.getter()),Y(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),Y(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),Y(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),Y(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(r,o)=>e._zod.innerType._zod.run(r,o)}),X_=$("$ZodCustom",(e,t)=>{ge.init(e,t),H.init(e,t),e._zod.parse=(r,o)=>r,e._zod.check=r=>{let o=r.value,n=t.fn(o);if(n instanceof Promise)return n.then(i=>Zz(i,r,o,e));Zz(n,r,o,e)}});function Zz(e,t,r,o){if(!e){let n={code:"custom",input:r,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(n.params=o._zod.def.params),t.issues.push(wi(n))}}var Ha={};Zt(Ha,{ar:()=>Hz,az:()=>Jz,be:()=>Kz,bg:()=>Yz,ca:()=>Xz,cs:()=>Qz,da:()=>eT,de:()=>tT,en:()=>od,eo:()=>rT,es:()=>nT,fa:()=>oT,fi:()=>iT,fr:()=>sT,frCA:()=>aT,he:()=>cT,hu:()=>uT,hy:()=>dT,id:()=>fT,is:()=>pT,it:()=>hT,ja:()=>mT,ka:()=>gT,kh:()=>_T,km:()=>id,ko:()=>vT,lt:()=>bT,mk:()=>wT,ms:()=>xT,nl:()=>ST,no:()=>$T,ota:()=>kT,pl:()=>zT,ps:()=>ET,pt:()=>TT,ru:()=>PT,sl:()=>OT,sv:()=>RT,ta:()=>CT,th:()=>AT,tr:()=>NT,ua:()=>DT,uk:()=>sd,ur:()=>jT,uz:()=>UT,vi:()=>LT,yo:()=>FT,zhCN:()=>MT,zhTW:()=>ZT});var LB=()=>{let e={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function t(n){return e[n]??null}let r={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=O(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 instanceof ${n.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${a}`:`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${i}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${a}`}case"invalid_value":return n.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${P(n.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${i} ${n.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${i} ${n.minimum.toString()} ${s.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${n.prefix}"`:i.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${i.suffix}"`:i.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${i.includes}"`:i.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${i.pattern}`:`${r[i.format]??n.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${n.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${n.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${n.keys.length>1?"\u0629":""}: ${E(n.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${n.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${n.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}};function Hz(){return{localeError:LB()}}var MB=()=>{let e={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function t(n){return e[n]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=O(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${n.expected}, daxil olan ${a}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${i}, daxil olan ${a}`}case"invalid_value":return n.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${P(n.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${i}${n.maximum.toString()} ${s.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${i}${n.minimum.toString()} ${s.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${i.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:i.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${i.suffix}" il\u0259 bitm\u0259lidir`:i.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${i.includes}" daxil olmal\u0131d\u0131r`:i.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${i.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${r[i.format]??n.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${n.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${n.keys.length>1?"lar":""}: ${E(n.keys,", ")}`;case"invalid_key":return`${n.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${n.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}};function Jz(){return{localeError:MB()}}function Gz(e,t,r,o){let n=Math.abs(e),i=n%10,s=n%100;return s>=11&&s<=19?o:i===1?t:i>=2&&i<=4?r:o}var ZB=()=>{let e={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function t(n){return e[n]??null}let r={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"},o={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=O(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${n.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${a}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${i}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${a}`}case"invalid_value":return n.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${P(n.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);if(s){let a=Number(n.maximum),u=Gz(a,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${i}${n.maximum.toString()} ${u}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);if(s){let a=Number(n.minimum),u=Gz(a,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${i}${n.minimum.toString()} ${u}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${i.includes}"`:i.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${n.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${E(n.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${n.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${n.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}};function Kz(){return{localeError:ZB()}}var FB=()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},file:{unit:"\u0431\u0430\u0439\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function t(n){return e[n]??null}let r={regex:"\u0432\u0445\u043E\u0434",email:"\u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0436\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E\u0441\u0442",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"base64-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",base64url:"base64url-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",json_string:"JSON \u043D\u0438\u0437",e164:"E.164 \u043D\u043E\u043C\u0435\u0440",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=O(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${a}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${i}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${a}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${P(n.values[0])}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${i}${n.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${i}${n.minimum.toString()} ${s.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;if(i.format==="starts_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "${i.prefix}"`;if(i.format==="ends_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u0432\u044A\u0440\u0448\u0432\u0430 \u0441 "${i.suffix}"`;if(i.format==="includes")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0432\u043A\u043B\u044E\u0447\u0432\u0430 "${i.includes}"`;if(i.format==="regex")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0441\u044A\u0432\u043F\u0430\u0434\u0430 \u0441 ${i.pattern}`;let s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return i.format==="emoji"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="datetime"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="date"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),i.format==="time"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="duration"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${s} ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${n.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u043E\u0432\u0435":""}: ${E(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434";case"invalid_element":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442 \u0432 ${n.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}};function Yz(){return{localeError:FB()}}var qB=()=>{let e={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function t(n){return e[n]??null}let r={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=O(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${n.expected}, s'ha rebut ${a}`:`Tipus inv\xE0lid: s'esperava ${i}, s'ha rebut ${a}`}case"invalid_value":return n.values.length===1?`Valor inv\xE0lid: s'esperava ${P(n.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${E(n.values," o ")}`;case"too_big":{let i=n.inclusive?"com a m\xE0xim":"menys de",s=t(n.origin);return s?`Massa gran: s'esperava que ${n.origin??"el valor"} contingu\xE9s ${i} ${n.maximum.toString()} ${s.unit??"elements"}`:`Massa gran: s'esperava que ${n.origin??"el valor"} fos ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?"com a m\xEDnim":"m\xE9s de",s=t(n.origin);return s?`Massa petit: s'esperava que ${n.origin} contingu\xE9s ${i} ${n.minimum.toString()} ${s.unit}`:`Massa petit: s'esperava que ${n.origin} fos ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${i.prefix}"`:i.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${i.suffix}"`:i.format==="includes"?`Format inv\xE0lid: ha d'incloure "${i.includes}"`:i.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${i.pattern}`:`Format inv\xE0lid per a ${r[i.format]??n.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${n.divisor}`;case"unrecognized_keys":return`Clau${n.keys.length>1?"s":""} no reconeguda${n.keys.length>1?"s":""}: ${E(n.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${n.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${n.origin}`;default:return"Entrada inv\xE0lida"}}};function Xz(){return{localeError:qB()}}var BB=()=>{let e={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function t(n){return e[n]??null}let r={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"},o={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=O(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${n.expected}, obdr\u017Eeno ${a}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${i}, obdr\u017Eeno ${a}`}case"invalid_value":return n.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${P(n.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${i}${n.maximum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${i}${n.minimum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${i.prefix}"`:i.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${i.suffix}"`:i.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${i.includes}"`:i.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${i.pattern}`:`Neplatn\xFD form\xE1t ${r[i.format]??n.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${n.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${E(n.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${n.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${n.origin}`;default:return"Neplatn\xFD vstup"}}};function Qz(){return{localeError:BB()}}var VB=()=>{let e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function t(n){return e[n]??null}let r={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkesl\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},o={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=O(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Ugyldigt input: forventede instanceof ${n.expected}, fik ${a}`:`Ugyldigt input: forventede ${i}, fik ${a}`}case"invalid_value":return n.values.length===1?`Ugyldig v\xE6rdi: forventede ${P(n.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin),a=o[n.origin]??n.origin;return s?`For stor: forventede ${a??"value"} ${s.verb} ${i} ${n.maximum.toString()} ${s.unit??"elementer"}`:`For stor: forventede ${a??"value"} havde ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin),a=o[n.origin]??n.origin;return s?`For lille: forventede ${a} ${s.verb} ${i} ${n.minimum.toString()} ${s.unit}`:`For lille: forventede ${a} havde ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ugyldig streng: skal starte med "${i.prefix}"`:i.format==="ends_with"?`Ugyldig streng: skal ende med "${i.suffix}"`:i.format==="includes"?`Ugyldig streng: skal indeholde "${i.includes}"`:i.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${i.pattern}`:`Ugyldig ${r[i.format]??n.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${E(n.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${n.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${n.origin}`;default:return"Ugyldigt input"}}};function eT(){return{localeError:VB()}}var WB=()=>{let e={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function t(n){return e[n]??null}let r={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},o={nan:"NaN",number:"Zahl",array:"Array"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=O(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${n.expected}, erhalten ${a}`:`Ung\xFCltige Eingabe: erwartet ${i}, erhalten ${a}`}case"invalid_value":return n.values.length===1?`Ung\xFCltige Eingabe: erwartet ${P(n.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${i}${n.maximum.toString()} ${s.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${i}${n.maximum.toString()} ist`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Zu klein: erwartet, dass ${n.origin} ${i}${n.minimum.toString()} ${s.unit} hat`:`Zu klein: erwartet, dass ${n.origin} ${i}${n.minimum.toString()} ist`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ung\xFCltiger String: muss mit "${i.prefix}" beginnen`:i.format==="ends_with"?`Ung\xFCltiger String: muss mit "${i.suffix}" enden`:i.format==="includes"?`Ung\xFCltiger String: muss "${i.includes}" enthalten`:i.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${i.pattern} entsprechen`:`Ung\xFCltig: ${r[i.format]??n.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${n.divisor} sein`;case"unrecognized_keys":return`${n.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${E(n.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${n.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${n.origin}`;default:return"Ung\xFCltige Eingabe"}}};function tT(){return{localeError:WB()}}var HB=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(n){return e[n]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=O(n.input),a=o[s]??s;return`Invalid input: expected ${i}, received ${a}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${P(n.values[0])}`:`Invalid option: expected one of ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Too big: expected ${n.origin??"value"} to have ${i}${n.maximum.toString()} ${s.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Too small: expected ${n.origin} to have ${i}${n.minimum.toString()} ${s.unit}`:`Too small: expected ${n.origin} to be ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Invalid string: must start with "${i.prefix}"`:i.format==="ends_with"?`Invalid string: must end with "${i.suffix}"`:i.format==="includes"?`Invalid string: must include "${i.includes}"`:i.format==="regex"?`Invalid string: must match pattern ${i.pattern}`:`Invalid ${r[i.format]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${E(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}};function od(){return{localeError:HB()}}var JB=()=>{let e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function t(n){return e[n]??null}let r={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},o={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=O(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${n.expected}, ricevi\u011Dis ${a}`:`Nevalida enigo: atendi\u011Dis ${i}, ricevi\u011Dis ${a}`}case"invalid_value":return n.values.length===1?`Nevalida enigo: atendi\u011Dis ${P(n.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${i}${n.maximum.toString()} ${s.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Tro malgranda: atendi\u011Dis ke ${n.origin} havu ${i}${n.minimum.toString()} ${s.unit}`:`Tro malgranda: atendi\u011Dis ke ${n.origin} estu ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${i.prefix}"`:i.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${i.suffix}"`:i.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${i.includes}"`:i.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${i.pattern}`:`Nevalida ${r[i.format]??n.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${n.divisor}`;case"unrecognized_keys":return`Nekonata${n.keys.length>1?"j":""} \u015Dlosilo${n.keys.length>1?"j":""}: ${E(n.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${n.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${n.origin}`;default:return"Nevalida enigo"}}};function rT(){return{localeError:JB()}}var GB=()=>{let e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function t(n){return e[n]??null}let r={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN",string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=O(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${n.expected}, recibido ${a}`:`Entrada inv\xE1lida: se esperaba ${i}, recibido ${a}`}case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: se esperaba ${P(n.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin),a=o[n.origin]??n.origin;return s?`Demasiado grande: se esperaba que ${a??"valor"} tuviera ${i}${n.maximum.toString()} ${s.unit??"elementos"}`:`Demasiado grande: se esperaba que ${a??"valor"} fuera ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin),a=o[n.origin]??n.origin;return s?`Demasiado peque\xF1o: se esperaba que ${a} tuviera ${i}${n.minimum.toString()} ${s.unit}`:`Demasiado peque\xF1o: se esperaba que ${a} fuera ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${i.prefix}"`:i.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${i.suffix}"`:i.format==="includes"?`Cadena inv\xE1lida: debe incluir "${i.includes}"`:i.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${i.pattern}`:`Inv\xE1lido ${r[i.format]??n.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${n.divisor}`;case"unrecognized_keys":return`Llave${n.keys.length>1?"s":""} desconocida${n.keys.length>1?"s":""}: ${E(n.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${o[n.origin]??n.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${o[n.origin]??n.origin}`;default:return"Entrada inv\xE1lida"}}};function nT(){return{localeError:GB()}}var KB=()=>{let e={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function t(n){return e[n]??null}let r={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"},o={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=O(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${n.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${a} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`:`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${i} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${a} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`}case"invalid_value":return n.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${P(n.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${E(n.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} ${s.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${i.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:i.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${i.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:i.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${i.includes}" \u0628\u0627\u0634\u062F`:i.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${i.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${r[i.format]??n.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${n.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${n.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${E(n.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${n.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${n.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}};function oT(){return{localeError:KB()}}var YB=()=>{let e={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function t(n){return e[n]??null}let r={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=O(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Virheellinen tyyppi: odotettiin instanceof ${n.expected}, oli ${a}`:`Virheellinen tyyppi: odotettiin ${i}, oli ${a}`}case"invalid_value":return n.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${P(n.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Liian suuri: ${s.subject} t\xE4ytyy olla ${i}${n.maximum.toString()} ${s.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Liian pieni: ${s.subject} t\xE4ytyy olla ${i}${n.minimum.toString()} ${s.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${i.prefix}"`:i.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${i.suffix}"`:i.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${i.includes}"`:i.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${i.pattern}`:`Virheellinen ${r[i.format]??n.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${n.divisor} monikerta`;case"unrecognized_keys":return`${n.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${E(n.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}};function iT(){return{localeError:YB()}}var XB=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(n){return e[n]??null}let r={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},o={nan:"NaN",number:"nombre",array:"tableau"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=O(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : instanceof ${n.expected} attendu, ${a} re\xE7u`:`Entr\xE9e invalide : ${i} attendu, ${a} re\xE7u`}case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : ${P(n.values[0])} attendu`:`Option invalide : une valeur parmi ${E(n.values,"|")} attendue`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Trop grand : ${n.origin??"valeur"} doit ${s.verb} ${i}${n.maximum.toString()} ${s.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${n.origin??"valeur"} doit \xEAtre ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Trop petit : ${n.origin} doit ${s.verb} ${i}${n.minimum.toString()} ${s.unit}`:`Trop petit : ${n.origin} doit \xEAtre ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Cha\xEEne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${i.pattern}`:`${r[i.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case"unrecognized_keys":return`Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${E(n.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${n.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entr\xE9e invalide"}}};function sT(){return{localeError:XB()}}var QB=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(n){return e[n]??null}let r={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=O(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : attendu instanceof ${n.expected}, re\xE7u ${a}`:`Entr\xE9e invalide : attendu ${i}, re\xE7u ${a}`}case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : attendu ${P(n.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"\u2264":"<",s=t(n.origin);return s?`Trop grand : attendu que ${n.origin??"la valeur"} ait ${i}${n.maximum.toString()} ${s.unit}`:`Trop grand : attendu que ${n.origin??"la valeur"} soit ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?"\u2265":">",s=t(n.origin);return s?`Trop petit : attendu que ${n.origin} ait ${i}${n.minimum.toString()} ${s.unit}`:`Trop petit : attendu que ${n.origin} soit ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Cha\xEEne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${i.pattern}`:`${r[i.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case"unrecognized_keys":return`Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${E(n.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${n.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entr\xE9e invalide"}}};function aT(){return{localeError:QB()}}var e3=()=>{let e={string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA",gender:"f"},number:{label:"\u05DE\u05E1\u05E4\u05E8",gender:"m"},boolean:{label:"\u05E2\u05E8\u05DA \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA",gender:"m"},array:{label:"\u05DE\u05E2\u05E8\u05DA",gender:"m"},object:{label:"\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8",gender:"m"},null:{label:"\u05E2\u05E8\u05DA \u05E8\u05D9\u05E7 (null)",gender:"m"},undefined:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 (undefined)",gender:"m"},symbol:{label:"\u05E1\u05D9\u05DE\u05D1\u05D5\u05DC (Symbol)",gender:"m"},function:{label:"\u05E4\u05D5\u05E0\u05E7\u05E6\u05D9\u05D4",gender:"f"},map:{label:"\u05DE\u05E4\u05D4 (Map)",gender:"f"},set:{label:"\u05E7\u05D1\u05D5\u05E6\u05D4 (Set)",gender:"f"},file:{label:"\u05E7\u05D5\u05D1\u05E5",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05D9\u05D3\u05D5\u05E2",gender:"m"},value:{label:"\u05E2\u05E8\u05DA",gender:"m"}},t={string:{unit:"\u05EA\u05D5\u05D5\u05D9\u05DD",shortLabel:"\u05E7\u05E6\u05E8",longLabel:"\u05D0\u05E8\u05D5\u05DA"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},number:{unit:"",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"}},r=c=>c?e[c]:void 0,o=c=>{let l=r(c);return l?l.label:c??e.unknown.label},n=c=>`\u05D4${o(c)}`,i=c=>(r(c)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA",s=c=>c?t[c]??null:null,a={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}},u={nan:"NaN"};return c=>{switch(c.code){case"invalid_type":{let l=c.expected,f=u[l??""]??o(l),p=O(c.input),h=u[p]??e[p]?.label??p;return/^[A-Z]/.test(c.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${c.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${h}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${f}, \u05D4\u05EA\u05E7\u05D1\u05DC ${h}`}case"invalid_value":{if(c.values.length===1)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${P(c.values[0])}`;let l=c.values.map(h=>P(h));if(c.values.length===2)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${l[0]} \u05D0\u05D5 ${l[1]}`;let f=l[l.length-1];return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${l.slice(0,-1).join(", ")} \u05D0\u05D5 ${f}`}case"too_big":{let l=s(c.origin),f=n(c.origin??"value");if(c.origin==="string")return`${l?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${f} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${c.maximum.toString()} ${l?.unit??""} ${c.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(c.origin==="number"){let m=c.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${c.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${c.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${f} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${m}`}if(c.origin==="array"||c.origin==="set"){let m=c.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",g=c.inclusive?`${c.maximum} ${l?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${c.maximum} ${l?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${f} ${m} \u05DC\u05D4\u05DB\u05D9\u05DC ${g}`.trim()}let p=c.inclusive?"<=":"<",h=i(c.origin??"value");return l?.unit?`${l.longLabel} \u05DE\u05D3\u05D9: ${f} ${h} ${p}${c.maximum.toString()} ${l.unit}`:`${l?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${f} ${h} ${p}${c.maximum.toString()}`}case"too_small":{let l=s(c.origin),f=n(c.origin??"value");if(c.origin==="string")return`${l?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${f} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${c.minimum.toString()} ${l?.unit??""} ${c.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(c.origin==="number"){let m=c.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${c.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${c.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${f} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${m}`}if(c.origin==="array"||c.origin==="set"){let m=c.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(c.minimum===1&&c.inclusive){let _=(c.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${f} ${m} \u05DC\u05D4\u05DB\u05D9\u05DC ${_}`}let g=c.inclusive?`${c.minimum} ${l?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${c.minimum} ${l?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${f} ${m} \u05DC\u05D4\u05DB\u05D9\u05DC ${g}`.trim()}let p=c.inclusive?">=":">",h=i(c.origin??"value");return l?.unit?`${l.shortLabel} \u05DE\u05D3\u05D9: ${f} ${h} ${p}${c.minimum.toString()} ${l.unit}`:`${l?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${f} ${h} ${p}${c.minimum.toString()}`}case"invalid_format":{let l=c;if(l.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${l.prefix}"`;if(l.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${l.suffix}"`;if(l.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${l.includes}"`;if(l.format==="regex")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${l.pattern}`;let f=a[l.format],p=f?.label??l.format,m=(f?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${p} \u05DC\u05D0 ${m}`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${c.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${c.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${c.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${E(c.keys,", ")}`;case"invalid_key":return"\u05E9\u05D3\u05D4 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8";case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${n(c.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}};function cT(){return{localeError:e3()}}var t3=()=>{let e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function t(n){return e[n]??null}let r={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"},o={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=O(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${n.expected}, a kapott \xE9rt\xE9k ${a}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${i}, a kapott \xE9rt\xE9k ${a}`}case"invalid_value":return n.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${P(n.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`T\xFAl nagy: ${n.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${i}${n.maximum.toString()} ${s.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${n.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} m\xE9rete t\xFAl kicsi ${i}${n.minimum.toString()} ${s.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} t\xFAl kicsi ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\xC9rv\xE9nytelen string: "${i.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:i.format==="ends_with"?`\xC9rv\xE9nytelen string: "${i.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:i.format==="includes"?`\xC9rv\xE9nytelen string: "${i.includes}" \xE9rt\xE9ket kell tartalmaznia`:i.format==="regex"?`\xC9rv\xE9nytelen string: ${i.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${r[i.format]??n.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${n.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${n.keys.length>1?"s":""}: ${E(n.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${n.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${n.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}};function uT(){return{localeError:t3()}}function lT(e,t,r){return Math.abs(e)===1?t:r}function zi(e){if(!e)return"";let t=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],r=e[e.length-1];return e+(t.includes(r)?"\u0576":"\u0568")}var r3=()=>{let e={string:{unit:{one:"\u0576\u0577\u0561\u0576",many:"\u0576\u0577\u0561\u0576\u0576\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},file:{unit:{one:"\u0562\u0561\u0575\u0569",many:"\u0562\u0561\u0575\u0569\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},array:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},set:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"}};function t(n){return e[n]??null}let r={regex:"\u0574\u0578\u0582\u057F\u0584",email:"\u0567\u056C. \u0570\u0561\u057D\u0581\u0565",url:"URL",emoji:"\u0567\u0574\u0578\u057B\u056B",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E \u0587 \u056A\u0561\u0574",date:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E",time:"ISO \u056A\u0561\u0574",duration:"ISO \u057F\u0587\u0578\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576",ipv4:"IPv4 \u0570\u0561\u057D\u0581\u0565",ipv6:"IPv6 \u0570\u0561\u057D\u0581\u0565",cidrv4:"IPv4 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",cidrv6:"IPv6 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",base64:"base64 \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",base64url:"base64url \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",json_string:"JSON \u057F\u0578\u0572",e164:"E.164 \u0570\u0561\u0574\u0561\u0580",jwt:"JWT",template_literal:"\u0574\u0578\u0582\u057F\u0584"},o={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=O(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${n.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${a}`:`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${i}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${a}`}case"invalid_value":return n.values.length===1?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${P(n.values[1])}`:`\u054D\u056D\u0561\u056C \u057F\u0561\u0580\u0562\u0565\u0580\u0561\u056F\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 \u0570\u0565\u057F\u0587\u0575\u0561\u056C\u0576\u0565\u0580\u056B\u0581 \u0574\u0565\u056F\u0568\u055D ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);if(s){let a=Number(n.maximum),u=lT(a,s.unit.one,s.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${zi(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${i}${n.maximum.toString()} ${u}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${zi(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);if(s){let a=Number(n.minimum),u=lT(a,s.unit.one,s.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${zi(n.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${i}${n.minimum.toString()} ${u}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${zi(n.origin)} \u056C\u056B\u0576\u056B ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${i.prefix}"-\u0578\u057E`:i.format==="ends_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${i.suffix}"-\u0578\u057E`:i.format==="includes"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${i.includes}"`:i.format==="regex"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0570\u0561\u0574\u0561\u057A\u0561\u057F\u0561\u057D\u056D\u0561\u0576\u056B ${i.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`:`\u054D\u056D\u0561\u056C ${r[i.format]??n.format}`}case"not_multiple_of":return`\u054D\u056D\u0561\u056C \u0569\u056B\u057E\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0562\u0561\u0566\u0574\u0561\u057A\u0561\u057F\u056B\u056F \u056C\u056B\u0576\u056B ${n.divisor}-\u056B`;case"unrecognized_keys":return`\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${n.keys.length>1?"\u0576\u0565\u0580":""}. ${E(n.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${zi(n.origin)}-\u0578\u0582\u0574`;case"invalid_union":return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574";case"invalid_element":return`\u054D\u056D\u0561\u056C \u0561\u0580\u056A\u0565\u0584 ${zi(n.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}};function dT(){return{localeError:r3()}}var n3=()=>{let e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function t(n){return e[n]??null}let r={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=O(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Input tidak valid: diharapkan instanceof ${n.expected}, diterima ${a}`:`Input tidak valid: diharapkan ${i}, diterima ${a}`}case"invalid_value":return n.values.length===1?`Input tidak valid: diharapkan ${P(n.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Terlalu besar: diharapkan ${n.origin??"value"} memiliki ${i}${n.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: diharapkan ${n.origin??"value"} menjadi ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Terlalu kecil: diharapkan ${n.origin} memiliki ${i}${n.minimum.toString()} ${s.unit}`:`Terlalu kecil: diharapkan ${n.origin} menjadi ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`String tidak valid: harus dimulai dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak valid: harus berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak valid: harus menyertakan "${i.includes}"`:i.format==="regex"?`String tidak valid: harus sesuai pola ${i.pattern}`:`${r[i.format]??n.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${n.keys.length>1?"s":""}: ${E(n.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${n.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${n.origin}`;default:return"Input tidak valid"}}};function fT(){return{localeError:n3()}}var o3=()=>{let e={string:{unit:"stafi",verb:"a\xF0 hafa"},file:{unit:"b\xE6ti",verb:"a\xF0 hafa"},array:{unit:"hluti",verb:"a\xF0 hafa"},set:{unit:"hluti",verb:"a\xF0 hafa"}};function t(n){return e[n]??null}let r={regex:"gildi",email:"netfang",url:"vefsl\xF3\xF0",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og t\xEDmi",date:"ISO dagsetning",time:"ISO t\xEDmi",duration:"ISO t\xEDmalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xF6lugildi",jwt:"JWT",template_literal:"gildi"},o={nan:"NaN",number:"n\xFAmer",array:"fylki"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=O(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${a} \xFEar sem \xE1 a\xF0 vera instanceof ${n.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${a} \xFEar sem \xE1 a\xF0 vera ${i}`}case"invalid_value":return n.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${P(n.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} hafi ${i}${n.maximum.toString()} ${s.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} s\xE9 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} hafi ${i}${n.minimum.toString()} ${s.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} s\xE9 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${i.prefix}"`:i.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${i.suffix}"`:i.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${i.includes}"`:i.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${i.pattern}`:`Rangt ${r[i.format]??n.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${n.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${n.keys.length>1?"ir lyklar":"ur lykill"}: ${E(n.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${n.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${n.origin}`;default:return"Rangt gildi"}}};function pT(){return{localeError:o3()}}var i3=()=>{let e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function t(n){return e[n]??null}let r={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"numero",array:"vettore"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=O(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Input non valido: atteso instanceof ${n.expected}, ricevuto ${a}`:`Input non valido: atteso ${i}, ricevuto ${a}`}case"invalid_value":return n.values.length===1?`Input non valido: atteso ${P(n.values[0])}`:`Opzione non valida: atteso uno tra ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Troppo grande: ${n.origin??"valore"} deve avere ${i}${n.maximum.toString()} ${s.unit??"elementi"}`:`Troppo grande: ${n.origin??"valore"} deve essere ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Troppo piccolo: ${n.origin} deve avere ${i}${n.minimum.toString()} ${s.unit}`:`Troppo piccolo: ${n.origin} deve essere ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Stringa non valida: deve iniziare con "${i.prefix}"`:i.format==="ends_with"?`Stringa non valida: deve terminare con "${i.suffix}"`:i.format==="includes"?`Stringa non valida: deve includere "${i.includes}"`:i.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${i.pattern}`:`Invalid ${r[i.format]??n.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${n.divisor}`;case"unrecognized_keys":return`Chiav${n.keys.length>1?"i":"e"} non riconosciut${n.keys.length>1?"e":"a"}: ${E(n.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${n.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${n.origin}`;default:return"Input non valido"}}};function hT(){return{localeError:i3()}}var s3=()=>{let e={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function t(n){return e[n]??null}let r={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"},o={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=O(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${n.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${a}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${i}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${a}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":return n.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${P(n.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${E(n.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let i=n.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",s=t(n.origin);return s?`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${s.unit??"\u8981\u7D20"}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let i=n.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",s=t(n.origin);return s?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${s.unit}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${i.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${r[i.format]??n.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${n.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${n.keys.length>1?"\u7FA4":""}: ${E(n.keys,"\u3001")}`;case"invalid_key":return`${n.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${n.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}};function mT(){return{localeError:s3()}}var a3=()=>{let e={string:{unit:"\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},file:{unit:"\u10D1\u10D0\u10D8\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},array:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},set:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function t(n){return e[n]??null}let r={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",json_string:"JSON \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},o={nan:"NaN",number:"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",string:"\u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0",array:"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=O(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${n.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${a}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${a}`}case"invalid_value":return n.values.length===1?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${P(n.values[0])}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${E(n.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${s.verb} ${i}${n.maximum.toString()} ${s.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin} ${s.verb} ${i}${n.minimum.toString()} ${s.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin} \u10D8\u10E7\u10DD\u10E1 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${i.prefix}"-\u10D8\u10D7`:i.format==="ends_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${i.suffix}"-\u10D8\u10D7`:i.format==="includes"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${i.includes}"-\u10E1`:i.format==="regex"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${i.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${n.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`;case"unrecognized_keys":return`\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${n.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${E(n.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${n.origin}-\u10E8\u10D8`;case"invalid_union":return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0";case"invalid_element":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ${n.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}};function gT(){return{localeError:a3()}}var c3=()=>{let e={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function t(n){return e[n]??null}let r={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"},o={nan:"NaN",number:"\u179B\u17C1\u1781",array:"\u17A2\u17B6\u179A\u17C1 (Array)",null:"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=O(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A instanceof ${n.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${a}`:`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${a}`}case"invalid_value":return n.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${P(n.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${i} ${n.maximum.toString()} ${s.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${i} ${n.minimum.toString()} ${s.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${i.prefix}"`:i.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${i.suffix}"`:i.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${i.includes}"`:i.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${i.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${n.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${E(n.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${n.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${n.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}};function id(){return{localeError:c3()}}function _T(){return id()}var u3=()=>{let e={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function t(n){return e[n]??null}let r={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=O(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${n.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${a}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${i}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${a}\uC785\uB2C8\uB2E4`}case"invalid_value":return n.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${P(n.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${E(n.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let i=n.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",s=i==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=t(n.origin),u=a?.unit??"\uC694\uC18C";return a?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()}${u} ${i}${s}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()} ${i}${s}`}case"too_small":{let i=n.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",s=i==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=t(n.origin),u=a?.unit??"\uC694\uC18C";return a?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()}${u} ${i}${s}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()} ${i}${s}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:i.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:i.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:i.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${i.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${r[i.format]??n.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${n.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${E(n.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${n.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${n.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}};function vT(){return{localeError:u3()}}var Wa=e=>e.charAt(0).toUpperCase()+e.slice(1);function yT(e){let t=Math.abs(e),r=t%10,o=t%100;return o>=11&&o<=19||r===0?"many":r===1?"one":"few"}var l3=()=>{let e={string:{unit:{one:"simbolis",few:"simboliai",many:"simboli\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne ilgesn\u0117 kaip",notInclusive:"turi b\u016Bti trumpesn\u0117 kaip"},bigger:{inclusive:"turi b\u016Bti ne trumpesn\u0117 kaip",notInclusive:"turi b\u016Bti ilgesn\u0117 kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"bait\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne didesnis kaip",notInclusive:"turi b\u016Bti ma\u017Eesnis kaip"},bigger:{inclusive:"turi b\u016Bti ne ma\u017Eesnis kaip",notInclusive:"turi b\u016Bti didesnis kaip"}}},array:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}},set:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}}};function t(n,i,s,a){let u=e[n]??null;return u===null?u:{unit:u.unit[i],verb:u.verb[a][s?"inclusive":"notInclusive"]}}let r={regex:"\u012Fvestis",email:"el. pa\u0161to adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukm\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",jwt:"JWT",template_literal:"\u012Fvestis"},o={nan:"NaN",number:"skai\u010Dius",bigint:"sveikasis skai\u010Dius",string:"eilut\u0117",boolean:"login\u0117 reik\u0161m\u0117",undefined:"neapibr\u0117\u017Eta reik\u0161m\u0117",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulin\u0117 reik\u0161m\u0117"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=O(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Gautas tipas ${a}, o tik\u0117tasi - instanceof ${n.expected}`:`Gautas tipas ${a}, o tik\u0117tasi - ${i}`}case"invalid_value":return n.values.length===1?`Privalo b\u016Bti ${P(n.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${E(n.values,"|")} pasirinkim\u0173`;case"too_big":{let i=o[n.origin]??n.origin,s=t(n.origin,yT(Number(n.maximum)),n.inclusive??!1,"smaller");if(s?.verb)return`${Wa(i??n.origin??"reik\u0161m\u0117")} ${s.verb} ${n.maximum.toString()} ${s.unit??"element\u0173"}`;let a=n.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${Wa(i??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${n.maximum.toString()} ${s?.unit}`}case"too_small":{let i=o[n.origin]??n.origin,s=t(n.origin,yT(Number(n.minimum)),n.inclusive??!1,"bigger");if(s?.verb)return`${Wa(i??n.origin??"reik\u0161m\u0117")} ${s.verb} ${n.minimum.toString()} ${s.unit??"element\u0173"}`;let a=n.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${Wa(i??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${n.minimum.toString()} ${s?.unit}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${i.prefix}"`:i.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${i.suffix}"`:i.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${i.includes}"`:i.format==="regex"?`Eilut\u0117 privalo atitikti ${i.pattern}`:`Neteisingas ${r[i.format]??n.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${n.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${n.keys.length>1?"i":"as"} rakt${n.keys.length>1?"ai":"as"}: ${E(n.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let i=o[n.origin]??n.origin;return`${Wa(i??n.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}};function bT(){return{localeError:l3()}}var d3=()=>{let e={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function t(n){return e[n]??null}let r={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"},o={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=O(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${n.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${a}`:`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${a}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${P(n.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${i}${n.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0438\u043C\u0430 ${i}${n.minimum.toString()} ${s.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${i.pattern}`:`Invalid ${r[i.format]??n.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${E(n.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${n.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${n.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}};function wT(){return{localeError:d3()}}var f3=()=>{let e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function t(n){return e[n]??null}let r={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"nombor"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=O(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Input tidak sah: dijangka instanceof ${n.expected}, diterima ${a}`:`Input tidak sah: dijangka ${i}, diterima ${a}`}case"invalid_value":return n.values.length===1?`Input tidak sah: dijangka ${P(n.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Terlalu besar: dijangka ${n.origin??"nilai"} ${s.verb} ${i}${n.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: dijangka ${n.origin??"nilai"} adalah ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Terlalu kecil: dijangka ${n.origin} ${s.verb} ${i}${n.minimum.toString()} ${s.unit}`:`Terlalu kecil: dijangka ${n.origin} adalah ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`String tidak sah: mesti bermula dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak sah: mesti mengandungi "${i.includes}"`:i.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${i.pattern}`:`${r[i.format]??n.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${E(n.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${n.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${n.origin}`;default:return"Input tidak sah"}}};function xT(){return{localeError:f3()}}var p3=()=>{let e={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function t(n){return e[n]??null}let r={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},o={nan:"NaN",number:"getal"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=O(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Ongeldige invoer: verwacht instanceof ${n.expected}, ontving ${a}`:`Ongeldige invoer: verwacht ${i}, ontving ${a}`}case"invalid_value":return n.values.length===1?`Ongeldige invoer: verwacht ${P(n.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin),a=n.origin==="date"?"laat":n.origin==="string"?"lang":"groot";return s?`Te ${a}: verwacht dat ${n.origin??"waarde"} ${i}${n.maximum.toString()} ${s.unit??"elementen"} ${s.verb}`:`Te ${a}: verwacht dat ${n.origin??"waarde"} ${i}${n.maximum.toString()} is`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin),a=n.origin==="date"?"vroeg":n.origin==="string"?"kort":"klein";return s?`Te ${a}: verwacht dat ${n.origin} ${i}${n.minimum.toString()} ${s.unit} ${s.verb}`:`Te ${a}: verwacht dat ${n.origin} ${i}${n.minimum.toString()} is`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ongeldige tekst: moet met "${i.prefix}" beginnen`:i.format==="ends_with"?`Ongeldige tekst: moet op "${i.suffix}" eindigen`:i.format==="includes"?`Ongeldige tekst: moet "${i.includes}" bevatten`:i.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${i.pattern}`:`Ongeldig: ${r[i.format]??n.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${n.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${n.keys.length>1?"s":""}: ${E(n.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${n.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${n.origin}`;default:return"Ongeldige invoer"}}};function ST(){return{localeError:p3()}}var h3=()=>{let e={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function t(n){return e[n]??null}let r={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"tall",array:"liste"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=O(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Ugyldig input: forventet instanceof ${n.expected}, fikk ${a}`:`Ugyldig input: forventet ${i}, fikk ${a}`}case"invalid_value":return n.values.length===1?`Ugyldig verdi: forventet ${P(n.values[0])}`:`Ugyldig valg: forventet en av ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${i}${n.maximum.toString()} ${s.unit??"elementer"}`:`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`For lite(n): forventet ${n.origin} til \xE5 ha ${i}${n.minimum.toString()} ${s.unit}`:`For lite(n): forventet ${n.origin} til \xE5 ha ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${i.prefix}"`:i.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${i.suffix}"`:i.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${i.includes}"`:i.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${i.pattern}`:`Ugyldig ${r[i.format]??n.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${E(n.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${n.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${n.origin}`;default:return"Ugyldig input"}}};function $T(){return{localeError:h3()}}var m3=()=>{let e={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function t(n){return e[n]??null}let r={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"},o={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=O(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`F\xE2sit giren: umulan instanceof ${n.expected}, al\u0131nan ${a}`:`F\xE2sit giren: umulan ${i}, al\u0131nan ${a}`}case"invalid_value":return n.values.length===1?`F\xE2sit giren: umulan ${P(n.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${i}${n.maximum.toString()} ${s.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${i}${n.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${i}${n.minimum.toString()} ${s.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${i}${n.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let i=n;return i.format==="starts_with"?`F\xE2sit metin: "${i.prefix}" ile ba\u015Flamal\u0131.`:i.format==="ends_with"?`F\xE2sit metin: "${i.suffix}" ile bitmeli.`:i.format==="includes"?`F\xE2sit metin: "${i.includes}" ihtiv\xE2 etmeli.`:i.format==="regex"?`F\xE2sit metin: ${i.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${r[i.format]??n.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${n.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${n.keys.length>1?"s":""}: ${E(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${n.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}};function kT(){return{localeError:m3()}}var g3=()=>{let e={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function t(n){return e[n]??null}let r={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"},o={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=O(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${n.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${a} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`:`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${i} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${a} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case"invalid_value":return n.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${P(n.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${E(n.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} \u0648\u064A`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} ${s.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} \u0648\u064A`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${i.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:i.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${i.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:i.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${i.includes}" \u0648\u0644\u0631\u064A`:i.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${i.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${r[i.format]??n.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${n.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${n.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${E(n.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${n.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${n.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}};function ET(){return{localeError:g3()}}var _3=()=>{let e={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function t(n){return e[n]??null}let r={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"},o={nan:"NaN",number:"liczba",array:"tablica"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=O(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${n.expected}, otrzymano ${a}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${i}, otrzymano ${a}`}case"invalid_value":return n.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${P(n.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${i}${n.maximum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${i}${n.minimum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${i.prefix}"`:i.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${i.suffix}"`:i.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${i.includes}"`:i.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${i.pattern}`:`Nieprawid\u0142ow(y/a/e) ${r[i.format]??n.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${n.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${n.keys.length>1?"s":""}: ${E(n.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${n.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${n.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}};function zT(){return{localeError:_3()}}var v3=()=>{let e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function t(n){return e[n]??null}let r={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN",number:"n\xFAmero",null:"nulo"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=O(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Tipo inv\xE1lido: esperado instanceof ${n.expected}, recebido ${a}`:`Tipo inv\xE1lido: esperado ${i}, recebido ${a}`}case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: esperado ${P(n.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Muito grande: esperado que ${n.origin??"valor"} tivesse ${i}${n.maximum.toString()} ${s.unit??"elementos"}`:`Muito grande: esperado que ${n.origin??"valor"} fosse ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Muito pequeno: esperado que ${n.origin} tivesse ${i}${n.minimum.toString()} ${s.unit}`:`Muito pequeno: esperado que ${n.origin} fosse ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${i.prefix}"`:i.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${i.suffix}"`:i.format==="includes"?`Texto inv\xE1lido: deve incluir "${i.includes}"`:i.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${i.pattern}`:`${r[i.format]??n.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${n.divisor}`;case"unrecognized_keys":return`Chave${n.keys.length>1?"s":""} desconhecida${n.keys.length>1?"s":""}: ${E(n.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${n.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${n.origin}`;default:return"Campo inv\xE1lido"}}};function TT(){return{localeError:v3()}}function IT(e,t,r,o){let n=Math.abs(e),i=n%10,s=n%100;return s>=11&&s<=19?o:i===1?t:i>=2&&i<=4?r:o}var y3=()=>{let e={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function t(n){return e[n]??null}let r={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=O(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${a}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${i}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${a}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${P(n.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);if(s){let a=Number(n.maximum),u=IT(a,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${i}${n.maximum.toString()} ${u}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);if(s){let a=Number(n.minimum),u=IT(a,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${i}${n.minimum.toString()} ${u}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin} \u0431\u0443\u0434\u0435\u0442 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${n.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0438":""}: ${E(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${n.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}};function PT(){return{localeError:y3()}}var b3=()=>{let e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function t(n){return e[n]??null}let r={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"},o={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=O(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${n.expected}, prejeto ${a}`:`Neveljaven vnos: pri\u010Dakovano ${i}, prejeto ${a}`}case"invalid_value":return n.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${P(n.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} imelo ${i}${n.maximum.toString()} ${s.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Premajhno: pri\u010Dakovano, da bo ${n.origin} imelo ${i}${n.minimum.toString()} ${s.unit}`:`Premajhno: pri\u010Dakovano, da bo ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${i.prefix}"`:i.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${i.suffix}"`:i.format==="includes"?`Neveljaven niz: mora vsebovati "${i.includes}"`:i.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${i.pattern}`:`Neveljaven ${r[i.format]??n.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${n.divisor}`;case"unrecognized_keys":return`Neprepoznan${n.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${E(n.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${n.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${n.origin}`;default:return"Neveljaven vnos"}}};function OT(){return{localeError:b3()}}var w3=()=>{let e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function t(n){return e[n]??null}let r={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},o={nan:"NaN",number:"antal",array:"lista"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=O(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${n.expected}, fick ${a}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${i}, fick ${a}`}case"invalid_value":return n.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${P(n.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`F\xF6r stor(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${i}${n.maximum.toString()} ${s.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${n.origin??"v\xE4rdet"} att ha ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${i}${n.minimum.toString()} ${s.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${i.prefix}"`:i.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${i.suffix}"`:i.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${i.includes}"`:i.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${i.pattern}"`:`Ogiltig(t) ${r[i.format]??n.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${E(n.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${n.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${n.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}};function RT(){return{localeError:w3()}}var x3=()=>{let e={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function t(n){return e[n]??null}let r={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"\u0B8E\u0BA3\u0BCD",array:"\u0B85\u0BA3\u0BBF",null:"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=O(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 instanceof ${n.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${a}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${a}`}case"invalid_value":return n.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${P(n.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${E(n.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${i}${n.maximum.toString()} ${s.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${i}${n.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin} ${i}${n.minimum.toString()} ${s.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin} ${i}${n.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${i.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${n.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${n.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${E(n.keys,", ")}`;case"invalid_key":return`${n.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${n.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}};function CT(){return{localeError:x3()}}var S3=()=>{let e={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function t(n){return e[n]??null}let r={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"},o={nan:"NaN",number:"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",array:"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)",null:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=O(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${n.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${a}`:`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${i} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${a}`}case"invalid_value":return n.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${P(n.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",s=t(n.origin);return s?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.maximum.toString()} ${s.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",s=t(n.origin);return s?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.minimum.toString()} ${s.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${i.prefix}"`:i.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${i.suffix}"`:i.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${i.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:i.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${i.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${r[i.format]??n.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${n.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${E(n.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${n.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${n.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}};function AT(){return{localeError:S3()}}var $3=()=>{let e={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function t(n){return e[n]??null}let r={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=O(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${n.expected}, al\u0131nan ${a}`:`Ge\xE7ersiz de\u011Fer: beklenen ${i}, al\u0131nan ${a}`}case"invalid_value":return n.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${P(n.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${i}${n.maximum.toString()} ${s.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${i}${n.minimum.toString()} ${s.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Ge\xE7ersiz metin: "${i.prefix}" ile ba\u015Flamal\u0131`:i.format==="ends_with"?`Ge\xE7ersiz metin: "${i.suffix}" ile bitmeli`:i.format==="includes"?`Ge\xE7ersiz metin: "${i.includes}" i\xE7ermeli`:i.format==="regex"?`Ge\xE7ersiz metin: ${i.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${r[i.format]??n.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${n.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${n.keys.length>1?"lar":""}: ${E(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${n.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}};function NT(){return{localeError:$3()}}var k3=()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function t(n){return e[n]??null}let r={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=O(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F instanceof ${n.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${a}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${i}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${a}`}case"invalid_value":return n.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${P(n.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${s.verb} ${i}${n.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} ${s.verb} ${i}${n.minimum.toString()} ${s.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} \u0431\u0443\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0456":""}: ${E(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${n.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}};function sd(){return{localeError:k3()}}function DT(){return sd()}var E3=()=>{let e={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function t(n){return e[n]??null}let r={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"},o={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=O(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${n.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${a} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`:`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${i} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${a} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":return n.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${P(n.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${E(n.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${i}${n.maximum.toString()} ${s.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${i}${n.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u06D2 ${i}${n.minimum.toString()} ${s.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u0627 ${i}${n.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${i.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${n.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${n.keys.length>1?"\u0632":""}: ${E(n.keys,"\u060C ")}`;case"invalid_key":return`${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}};function jT(){return{localeError:E3()}}var z3=()=>{let e={string:{unit:"belgi",verb:"bo\u2018lishi kerak"},file:{unit:"bayt",verb:"bo\u2018lishi kerak"},array:{unit:"element",verb:"bo\u2018lishi kerak"},set:{unit:"element",verb:"bo\u2018lishi kerak"}};function t(n){return e[n]??null}let r={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},o={nan:"NaN",number:"raqam",array:"massiv"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=O(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${n.expected}, qabul qilingan ${a}`:`Noto\u2018g\u2018ri kirish: kutilgan ${i}, qabul qilingan ${a}`}case"invalid_value":return n.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${P(n.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Juda katta: kutilgan ${n.origin??"qiymat"} ${i}${n.maximum.toString()} ${s.unit} ${s.verb}`:`Juda katta: kutilgan ${n.origin??"qiymat"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Juda kichik: kutilgan ${n.origin} ${i}${n.minimum.toString()} ${s.unit} ${s.verb}`:`Juda kichik: kutilgan ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Noto\u2018g\u2018ri satr: "${i.prefix}" bilan boshlanishi kerak`:i.format==="ends_with"?`Noto\u2018g\u2018ri satr: "${i.suffix}" bilan tugashi kerak`:i.format==="includes"?`Noto\u2018g\u2018ri satr: "${i.includes}" ni o\u2018z ichiga olishi kerak`:i.format==="regex"?`Noto\u2018g\u2018ri satr: ${i.pattern} shabloniga mos kelishi kerak`:`Noto\u2018g\u2018ri ${r[i.format]??n.format}`}case"not_multiple_of":return`Noto\u2018g\u2018ri raqam: ${n.divisor} ning karralisi bo\u2018lishi kerak`;case"unrecognized_keys":return`Noma\u2019lum kalit${n.keys.length>1?"lar":""}: ${E(n.keys,", ")}`;case"invalid_key":return`${n.origin} dagi kalit noto\u2018g\u2018ri`;case"invalid_union":return"Noto\u2018g\u2018ri kirish";case"invalid_element":return`${n.origin} da noto\u2018g\u2018ri qiymat`;default:return"Noto\u2018g\u2018ri kirish"}}};function UT(){return{localeError:z3()}}var T3=()=>{let e={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function t(n){return e[n]??null}let r={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"},o={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=O(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${n.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${a}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${i}, nh\u1EADn \u0111\u01B0\u1EE3c ${a}`}case"invalid_value":return n.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${P(n.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${s.verb} ${i}${n.maximum.toString()} ${s.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${s.verb} ${i}${n.minimum.toString()} ${s.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${i.prefix}"`:i.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${i.suffix}"`:i.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${i.includes}"`:i.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${i.pattern}`:`${r[i.format]??n.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${n.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${E(n.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${n.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${n.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}};function LT(){return{localeError:T3()}}var I3=()=>{let e={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function t(n){return e[n]??null}let r={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"},o={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=O(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${n.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${a}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${i}\uFF0C\u5B9E\u9645\u63A5\u6536 ${a}`}case"invalid_value":return n.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${P(n.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${i}${n.maximum.toString()} ${s.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${i}${n.minimum.toString()} ${s.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${i.prefix}" \u5F00\u5934`:i.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${i.suffix}" \u7ED3\u5C3E`:i.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${i.includes}"`:i.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${i.pattern}`:`\u65E0\u6548${r[i.format]??n.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${n.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${E(n.keys,", ")}`;case"invalid_key":return`${n.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${n.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}};function MT(){return{localeError:I3()}}var P3=()=>{let e={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function t(n){return e[n]??null}let r={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"},o={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=O(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${n.expected}\uFF0C\u4F46\u6536\u5230 ${a}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${i}\uFF0C\u4F46\u6536\u5230 ${a}`}case"invalid_value":return n.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${P(n.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${i}${n.maximum.toString()} ${s.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${i}${n.minimum.toString()} ${s.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${i.prefix}" \u958B\u982D`:i.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${i.suffix}" \u7D50\u5C3E`:i.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${i.includes}"`:i.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${i.pattern}`:`\u7121\u6548\u7684 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${n.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${n.keys.length>1?"\u5011":""}\uFF1A${E(n.keys,"\u3001")}`;case"invalid_key":return`${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}};function ZT(){return{localeError:P3()}}var O3=()=>{let e={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"}};function t(n){return e[n]??null}let r={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"},o={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return n=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=O(n.input),a=o[s]??s;return/^[A-Z]/.test(n.expected)?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${n.expected}, \xE0m\u1ECD\u0300 a r\xED ${a}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${i}, \xE0m\u1ECD\u0300 a r\xED ${a}`}case"invalid_value":return n.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${P(n.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${E(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);return s?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin??"iye"} ${s.verb} ${i}${n.maximum} ${s.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${i}${n.maximum}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);return s?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin} ${s.verb} ${i}${n.minimum} ${s.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${i}${n.minimum}`}case"invalid_format":{let i=n;return i.format==="starts_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${i.prefix}"`:i.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${i.suffix}"`:i.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${i.includes}"`:i.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${i.pattern}`:`A\u1E63\xEC\u1E63e: ${r[i.format]??n.format}`}case"not_multiple_of":return`N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${n.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${E(n.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${n.origin}`;case"invalid_union":return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";case"invalid_element":return`Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${n.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}};function FT(){return{localeError:O3()}}var qT,Q_=Symbol("ZodOutput"),ev=Symbol("ZodInput"),ad=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let o=r[0];return this._map.set(t,o),o&&typeof o=="object"&&"id"in o&&this._idmap.set(o.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let o={...this.get(r)??{}};delete o.id;let n={...o,...this._map.get(t)};return Object.keys(n).length?n:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function cd(){return new ad}(qT=globalThis).__zod_globalRegistry??(qT.__zod_globalRegistry=cd());var Ge=globalThis.__zod_globalRegistry;function tv(e,t){return new e({type:"string",...A(t)})}function rv(e,t){return new e({type:"string",coerce:!0,...A(t)})}function ud(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...A(t)})}function Ja(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...A(t)})}function ld(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...A(t)})}function dd(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...A(t)})}function fd(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...A(t)})}function pd(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...A(t)})}function Ga(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...A(t)})}function hd(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...A(t)})}function md(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...A(t)})}function gd(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...A(t)})}function _d(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...A(t)})}function vd(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...A(t)})}function yd(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...A(t)})}function bd(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...A(t)})}function wd(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...A(t)})}function xd(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...A(t)})}function nv(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...A(t)})}function Sd(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...A(t)})}function $d(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...A(t)})}function kd(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...A(t)})}function Ed(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...A(t)})}function zd(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...A(t)})}function Td(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...A(t)})}var ov={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function iv(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...A(t)})}function sv(e,t){return new e({type:"string",format:"date",check:"string_format",...A(t)})}function av(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...A(t)})}function cv(e,t){return new e({type:"string",format:"duration",check:"string_format",...A(t)})}function uv(e,t){return new e({type:"number",checks:[],...A(t)})}function lv(e,t){return new e({type:"number",coerce:!0,checks:[],...A(t)})}function dv(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...A(t)})}function fv(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...A(t)})}function pv(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...A(t)})}function hv(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...A(t)})}function mv(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...A(t)})}function gv(e,t){return new e({type:"boolean",...A(t)})}function _v(e,t){return new e({type:"boolean",coerce:!0,...A(t)})}function vv(e,t){return new e({type:"bigint",...A(t)})}function yv(e,t){return new e({type:"bigint",coerce:!0,...A(t)})}function bv(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...A(t)})}function wv(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...A(t)})}function xv(e,t){return new e({type:"symbol",...A(t)})}function Sv(e,t){return new e({type:"undefined",...A(t)})}function $v(e,t){return new e({type:"null",...A(t)})}function kv(e){return new e({type:"any"})}function Ev(e){return new e({type:"unknown"})}function zv(e,t){return new e({type:"never",...A(t)})}function Tv(e,t){return new e({type:"void",...A(t)})}function Iv(e,t){return new e({type:"date",...A(t)})}function Pv(e,t){return new e({type:"date",coerce:!0,...A(t)})}function Ov(e,t){return new e({type:"nan",...A(t)})}function $r(e,t){return new Hl({check:"less_than",...A(t),value:e,inclusive:!1})}function At(e,t){return new Hl({check:"less_than",...A(t),value:e,inclusive:!0})}function kr(e,t){return new Jl({check:"greater_than",...A(t),value:e,inclusive:!1})}function ht(e,t){return new Jl({check:"greater_than",...A(t),value:e,inclusive:!0})}function Id(e){return kr(0,e)}function Pd(e){return $r(0,e)}function Od(e){return At(0,e)}function Rd(e){return ht(0,e)}function On(e,t){return new $g({check:"multiple_of",...A(t),value:e})}function Rn(e,t){return new zg({check:"max_size",...A(t),maximum:e})}function Er(e,t){return new Tg({check:"min_size",...A(t),minimum:e})}function bo(e,t){return new Ig({check:"size_equals",...A(t),size:e})}function wo(e,t){return new Pg({check:"max_length",...A(t),maximum:e})}function Jr(e,t){return new Og({check:"min_length",...A(t),minimum:e})}function xo(e,t){return new Rg({check:"length_equals",...A(t),length:e})}function Ti(e,t){return new Cg({check:"string_format",format:"regex",...A(t),pattern:e})}function Ii(e){return new Ag({check:"string_format",format:"lowercase",...A(e)})}function Pi(e){return new Ng({check:"string_format",format:"uppercase",...A(e)})}function Oi(e,t){return new Dg({check:"string_format",format:"includes",...A(t),includes:e})}function Ri(e,t){return new jg({check:"string_format",format:"starts_with",...A(t),prefix:e})}function Ci(e,t){return new Ug({check:"string_format",format:"ends_with",...A(t),suffix:e})}function Cd(e,t,r){return new Lg({check:"property",property:e,schema:t,...A(r)})}function Ai(e,t){return new Mg({check:"mime_type",mime:e,...A(t)})}function ur(e){return new Zg({check:"overwrite",tx:e})}function Ni(e){return ur(t=>t.normalize(e))}function Di(){return ur(e=>e.trim())}function ji(){return ur(e=>e.toLowerCase())}function Ui(){return ur(e=>e.toUpperCase())}function Li(){return ur(e=>Lm(e))}function Rv(e,t,r){return new e({type:"array",element:t,...A(r)})}function C3(e,t,r){return new e({type:"union",options:t,...A(r)})}function A3(e,t,r){return new e({type:"union",options:t,inclusive:!1,...A(r)})}function N3(e,t,r,o){return new e({type:"union",options:r,discriminator:t,...A(o)})}function D3(e,t,r){return new e({type:"intersection",left:t,right:r})}function j3(e,t,r,o){let n=r instanceof H,i=n?o:r,s=n?r:null;return new e({type:"tuple",items:t,rest:s,...A(i)})}function U3(e,t,r,o){return new e({type:"record",keyType:t,valueType:r,...A(o)})}function L3(e,t,r,o){return new e({type:"map",keyType:t,valueType:r,...A(o)})}function M3(e,t,r){return new e({type:"set",valueType:t,...A(r)})}function Z3(e,t,r){let o=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new e({type:"enum",entries:o,...A(r)})}function F3(e,t,r){return new e({type:"enum",entries:t,...A(r)})}function q3(e,t,r){return new e({type:"literal",values:Array.isArray(t)?t:[t],...A(r)})}function Cv(e,t){return new e({type:"file",...A(t)})}function B3(e,t){return new e({type:"transform",transform:t})}function V3(e,t){return new e({type:"optional",innerType:t})}function W3(e,t){return new e({type:"nullable",innerType:t})}function H3(e,t,r){return new e({type:"default",innerType:t,get defaultValue(){return typeof r=="function"?r():Zm(r)}})}function J3(e,t,r){return new e({type:"nonoptional",innerType:t,...A(r)})}function G3(e,t){return new e({type:"success",innerType:t})}function K3(e,t,r){return new e({type:"catch",innerType:t,catchValue:typeof r=="function"?r:()=>r})}function Y3(e,t,r){return new e({type:"pipe",in:t,out:r})}function X3(e,t){return new e({type:"readonly",innerType:t})}function Q3(e,t,r){return new e({type:"template_literal",parts:t,...A(r)})}function eV(e,t){return new e({type:"lazy",getter:t})}function tV(e,t){return new e({type:"promise",innerType:t})}function Av(e,t,r){let o=A(r);return o.abort??(o.abort=!0),new e({type:"custom",check:"custom",fn:t,...o})}function Nv(e,t,r){return new e({type:"custom",check:"custom",fn:t,...A(r)})}function Dv(e){let t=BT(r=>(r.addIssue=o=>{if(typeof o=="string")r.issues.push(wi(o,r.value,t._zod.def));else{let n=o;n.fatal&&(n.continue=!1),n.code??(n.code="custom"),n.input??(n.input=r.value),n.inst??(n.inst=t),n.continue??(n.continue=!t._zod.def.abort),r.issues.push(wi(n))}},e(r.value,r)));return t}function BT(e,t){let r=new ge({check:"custom",...A(t)});return r._zod.check=e,r}function jv(e){let t=new ge({check:"describe"});return t._zod.onattach=[r=>{let o=Ge.get(r)??{};Ge.add(r,{...o,description:e})}],t._zod.check=()=>{},t}function Uv(e){let t=new ge({check:"meta"});return t._zod.onattach=[r=>{let o=Ge.get(r)??{};Ge.add(r,{...o,...e})}],t._zod.check=()=>{},t}function Lv(e,t){let r=A(t),o=r.truthy??["true","1","yes","on","y","enabled"],n=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(o=o.map(h=>typeof h=="string"?h.toLowerCase():h),n=n.map(h=>typeof h=="string"?h.toLowerCase():h));let i=new Set(o),s=new Set(n),a=e.Codec??Va,u=e.Boolean??qa,c=e.String??yo,l=new c({type:"string",error:r.error}),f=new u({type:"boolean",error:r.error}),p=new a({type:"pipe",in:l,out:f,transform:((h,m)=>{let g=h;return r.case!=="sensitive"&&(g=g.toLowerCase()),i.has(g)?!0:s.has(g)?!1:(m.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...s],input:m.value,inst:p,continue:!1}),{})}),reverseTransform:((h,m)=>h===!0?o[0]||"true":n[0]||"false"),error:r.error});return p}function Mi(e,t,r,o={}){let n=A(o),i={...A(o),check:"string_format",type:"string",format:t,fn:typeof r=="function"?r:a=>r.test(a),...n};return r instanceof RegExp&&(i.pattern=r),new e(i)}function Cn(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??Ge,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 de(e,t,r={path:[],schemaPath:[]}){var o;let n=e._zod.def,i=t.seen.get(e);if(i)return i.count++,r.schemaPath.includes(e)&&(i.cycle=r.path),i.schema;let s={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,s);let a=e._zod.toJSONSchema?.();if(a)s.schema=a;else{let l={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,l);else{let p=s.schema,h=t.processors[n.type];if(!h)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);h(e,t,p,l)}let f=e._zod.parent;f&&(s.ref||(s.ref=f),de(f,t,l),t.seen.get(f).isParent=!0)}let u=t.metadataRegistry.get(e);return u&&Object.assign(s.schema,u),t.io==="input"&&mt(e)&&(delete s.schema.examples,delete s.schema.default),t.io==="input"&&s.schema._prefault&&((o=s.schema).default??(o.default=s.schema._prefault)),delete s.schema._prefault,t.seen.get(e).schema}function An(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=new Map;for(let s of e.seen.entries()){let a=e.metadataRegistry.get(s[0])?.id;if(a){let u=o.get(a);if(u&&u!==s[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(a,s[0])}}let n=s=>{let a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let f=e.external.registry.get(s[0])?.id,p=e.external.uri??(m=>m);if(f)return{ref:p(f)};let h=s[1].defId??s[1].schema.id??`schema${e.counter++}`;return s[1].defId=h,{defId:h,ref:`${p("__shared")}#/${a}/${h}`}}if(s[1]===r)return{ref:"#"};let c=`#/${a}/`,l=s[1].schema.id??`__schema${e.counter++}`;return{defId:l,ref:c+l}},i=s=>{if(s[1].schema.$ref)return;let a=s[1],{ref:u,defId:c}=n(s);a.def={...a.schema},c&&(a.defId=c);let l=a.schema;for(let f in l)delete l[f];l.$ref=u};if(e.cycles==="throw")for(let s of e.seen.entries()){let a=s[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
61
61
 
62
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of e.seen.entries()){let a=s[1];if(t===s[0]){i(s);continue}if(e.external){let c=e.external.registry.get(s[0])?.id;if(t!==s[0]&&c){i(s);continue}}if(e.metadataRegistry.get(s[0])?.id){i(s);continue}if(a.cycle){i(s);continue}if(a.count>1&&e.reused==="ref"){i(s);continue}}}function Nn(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=s=>{let a=e.seen.get(s);if(a.ref===null)return;let u=a.def??a.schema,c={...u},l=a.ref;if(a.ref=null,l){o(l);let p=e.seen.get(l),h=p.schema;if(h.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(h)):Object.assign(u,h),Object.assign(u,c),s._zod.parent===l)for(let g in u)g==="$ref"||g==="allOf"||g in c||delete u[g];if(h.$ref)for(let g in u)g==="$ref"||g==="allOf"||g in p.def&&JSON.stringify(u[g])===JSON.stringify(p.def[g])&&delete u[g]}let f=s._zod.parent;if(f&&f!==l){o(f);let p=e.seen.get(f);if(p?.schema.$ref&&(u.$ref=p.schema.$ref,p.def))for(let h in u)h==="$ref"||h==="allOf"||h in p.def&&JSON.stringify(u[h])===JSON.stringify(p.def[h])&&delete u[h]}e.override({zodSchema:s,jsonSchema:u,path:a.path??[]})};for(let s of[...e.seen.entries()].reverse())o(s[0]);let n={};if(e.target==="draft-2020-12"?n.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?n.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?n.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let s=e.external.registry.get(t)?.id;if(!s)throw new Error("Schema is missing an `id` property");n.$id=e.external.uri(s)}Object.assign(n,r.def??r.schema);let i=e.external?.defs??{};for(let s of e.seen.entries()){let a=s[1];a.def&&a.defId&&(i[a.defId]=a.def)}e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?n.$defs=i:n.definitions=i);try{let s=JSON.parse(JSON.stringify(n));return Object.defineProperty(s,"~standard",{value:{...t["~standard"],jsonSchema:{input:Zi(t,"input",e.processors),output:Zi(t,"output",e.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function mt(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let o=e._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return mt(o.element,r);if(o.type==="set")return mt(o.valueType,r);if(o.type==="lazy")return mt(o.getter(),r);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault")return mt(o.innerType,r);if(o.type==="intersection")return mt(o.left,r)||mt(o.right,r);if(o.type==="record"||o.type==="map")return mt(o.keyType,r)||mt(o.valueType,r);if(o.type==="pipe")return mt(o.in,r)||mt(o.out,r);if(o.type==="object"){for(let n in o.shape)if(mt(o.shape[n],r))return!0;return!1}if(o.type==="union"){for(let n of o.options)if(mt(n,r))return!0;return!1}if(o.type==="tuple"){for(let n of o.items)if(mt(n,r))return!0;return!!(o.rest&&mt(o.rest,r))}return!1}var Mv=(e,t={})=>r=>{let o=Cn({...r,processors:t});return de(e,o),An(o,e),Nn(o,e)},Zi=(e,t,r={})=>o=>{let{libraryOptions:n,target:i}=o??{},s=Cn({...n??{},target:i,io:t,processors:r});return de(e,s),An(s,e),Nn(s,e)};var rV={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Zv=(e,t,r,o)=>{let n=r;n.type="string";let{minimum:i,maximum:s,format:a,patterns:u,contentEncoding:c}=e._zod.bag;if(typeof i=="number"&&(n.minLength=i),typeof s=="number"&&(n.maxLength=s),a&&(n.format=rV[a]??a,n.format===""&&delete n.format,a==="time"&&delete n.format),c&&(n.contentEncoding=c),u&&u.size>0){let l=[...u];l.length===1?n.pattern=l[0].source:l.length>1&&(n.allOf=[...l.map(f=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:f.source}))])}},Fv=(e,t,r,o)=>{let n=r,{minimum:i,maximum:s,format:a,multipleOf:u,exclusiveMaximum:c,exclusiveMinimum:l}=e._zod.bag;typeof a=="string"&&a.includes("int")?n.type="integer":n.type="number",typeof l=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(n.minimum=l,n.exclusiveMinimum=!0):n.exclusiveMinimum=l),typeof i=="number"&&(n.minimum=i,typeof l=="number"&&t.target!=="draft-04"&&(l>=i?delete n.minimum:delete n.exclusiveMinimum)),typeof c=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(n.maximum=c,n.exclusiveMaximum=!0):n.exclusiveMaximum=c),typeof s=="number"&&(n.maximum=s,typeof c=="number"&&t.target!=="draft-04"&&(c<=s?delete n.maximum:delete n.exclusiveMaximum)),typeof u=="number"&&(n.multipleOf=u)},qv=(e,t,r,o)=>{r.type="boolean"},Bv=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},Vv=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},Wv=(e,t,r,o)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},Hv=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},Jv=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},Gv=(e,t,r,o)=>{r.not={}},Kv=(e,t,r,o)=>{},Yv=(e,t,r,o)=>{},Xv=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},Qv=(e,t,r,o)=>{let n=e._zod.def,i=Ra(n.entries);i.every(s=>typeof s=="number")&&(r.type="number"),i.every(s=>typeof s=="string")&&(r.type="string"),r.enum=i},ey=(e,t,r,o)=>{let n=e._zod.def,i=[];for(let s of n.values)if(s===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");i.push(Number(s))}else i.push(s);if(i.length!==0)if(i.length===1){let s=i[0];r.type=s===null?"null":typeof s,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[s]:r.const=s}else i.every(s=>typeof s=="number")&&(r.type="number"),i.every(s=>typeof s=="string")&&(r.type="string"),i.every(s=>typeof s=="boolean")&&(r.type="boolean"),i.every(s=>s===null)&&(r.type="null"),r.enum=i},ty=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},ry=(e,t,r,o)=>{let n=r,i=e._zod.pattern;if(!i)throw new Error("Pattern not found in template literal");n.type="string",n.pattern=i.source},ny=(e,t,r,o)=>{let n=r,i={type:"string",format:"binary",contentEncoding:"binary"},{minimum:s,maximum:a,mime:u}=e._zod.bag;s!==void 0&&(i.minLength=s),a!==void 0&&(i.maxLength=a),u?u.length===1?(i.contentMediaType=u[0],Object.assign(n,i)):(Object.assign(n,i),n.anyOf=u.map(c=>({contentMediaType:c}))):Object.assign(n,i)},oy=(e,t,r,o)=>{r.type="boolean"},iy=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},sy=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},ay=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},cy=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},uy=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},ly=(e,t,r,o)=>{let n=r,i=e._zod.def,{minimum:s,maximum:a}=e._zod.bag;typeof s=="number"&&(n.minItems=s),typeof a=="number"&&(n.maxItems=a),n.type="array",n.items=de(i.element,t,{...o,path:[...o.path,"items"]})},dy=(e,t,r,o)=>{let n=r,i=e._zod.def;n.type="object",n.properties={};let s=i.shape;for(let c in s)n.properties[c]=de(s[c],t,{...o,path:[...o.path,"properties",c]});let a=new Set(Object.keys(s)),u=new Set([...a].filter(c=>{let l=i.shape[c]._zod;return t.io==="input"?l.optin===void 0:l.optout===void 0}));u.size>0&&(n.required=Array.from(u)),i.catchall?._zod.def.type==="never"?n.additionalProperties=!1:i.catchall?i.catchall&&(n.additionalProperties=de(i.catchall,t,{...o,path:[...o.path,"additionalProperties"]})):t.io==="output"&&(n.additionalProperties=!1)},Nd=(e,t,r,o)=>{let n=e._zod.def,i=n.inclusive===!1,s=n.options.map((a,u)=>de(a,t,{...o,path:[...o.path,i?"oneOf":"anyOf",u]}));i?r.oneOf=s:r.anyOf=s},fy=(e,t,r,o)=>{let n=e._zod.def,i=de(n.left,t,{...o,path:[...o.path,"allOf",0]}),s=de(n.right,t,{...o,path:[...o.path,"allOf",1]}),a=c=>"allOf"in c&&Object.keys(c).length===1,u=[...a(i)?i.allOf:[i],...a(s)?s.allOf:[s]];r.allOf=u},py=(e,t,r,o)=>{let n=r,i=e._zod.def;n.type="array";let s=t.target==="draft-2020-12"?"prefixItems":"items",a=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",u=i.items.map((p,h)=>de(p,t,{...o,path:[...o.path,s,h]})),c=i.rest?de(i.rest,t,{...o,path:[...o.path,a,...t.target==="openapi-3.0"?[i.items.length]:[]]}):null;t.target==="draft-2020-12"?(n.prefixItems=u,c&&(n.items=c)):t.target==="openapi-3.0"?(n.items={anyOf:u},c&&n.items.anyOf.push(c),n.minItems=u.length,c||(n.maxItems=u.length)):(n.items=u,c&&(n.additionalItems=c));let{minimum:l,maximum:f}=e._zod.bag;typeof l=="number"&&(n.minItems=l),typeof f=="number"&&(n.maxItems=f)},hy=(e,t,r,o)=>{let n=r,i=e._zod.def;n.type="object";let s=i.keyType,u=s._zod.bag?.patterns;if(i.mode==="loose"&&u&&u.size>0){let l=de(i.valueType,t,{...o,path:[...o.path,"patternProperties","*"]});n.patternProperties={};for(let f of u)n.patternProperties[f.source]=l}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(n.propertyNames=de(i.keyType,t,{...o,path:[...o.path,"propertyNames"]})),n.additionalProperties=de(i.valueType,t,{...o,path:[...o.path,"additionalProperties"]});let c=s._zod.values;if(c){let l=[...c].filter(f=>typeof f=="string"||typeof f=="number");l.length>0&&(n.required=l)}},my=(e,t,r,o)=>{let n=e._zod.def,i=de(n.innerType,t,o),s=t.seen.get(e);t.target==="openapi-3.0"?(s.ref=n.innerType,r.nullable=!0):r.anyOf=[i,{type:"null"}]},gy=(e,t,r,o)=>{let n=e._zod.def;de(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},_y=(e,t,r,o)=>{let n=e._zod.def;de(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,r.default=JSON.parse(JSON.stringify(n.defaultValue))},vy=(e,t,r,o)=>{let n=e._zod.def;de(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(n.defaultValue)))},yy=(e,t,r,o)=>{let n=e._zod.def;de(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType;let s;try{s=n.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=s},by=(e,t,r,o)=>{let n=e._zod.def,i=t.io==="input"?n.in._zod.def.type==="transform"?n.out:n.in:n.out;de(i,t,o);let s=t.seen.get(e);s.ref=i},wy=(e,t,r,o)=>{let n=e._zod.def;de(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,r.readOnly=!0},xy=(e,t,r,o)=>{let n=e._zod.def;de(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},Dd=(e,t,r,o)=>{let n=e._zod.def;de(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},Sy=(e,t,r,o)=>{let n=e._zod.innerType;de(n,t,o);let i=t.seen.get(e);i.ref=n},Ad={string:Zv,number:Fv,boolean:qv,bigint:Bv,symbol:Vv,null:Wv,undefined:Hv,void:Jv,never:Gv,any:Kv,unknown:Yv,date:Xv,enum:Qv,literal:ey,nan:ty,template_literal:ry,file:ny,success:oy,custom:iy,function:sy,transform:ay,map:cy,set:uy,array:ly,object:dy,union:Nd,intersection:fy,tuple:py,record:hy,nullable:my,nonoptional:gy,default:_y,prefault:vy,catch:yy,pipe:by,readonly:wy,promise:xy,optional:Dd,lazy:Sy};function jd(e,t){if("_idmap"in e){let o=e,n=Cn({...t,processors:Ad}),i={};for(let u of o._idmap.entries()){let[c,l]=u;de(l,n)}let s={},a={registry:o,uri:t?.uri,defs:i};n.external=a;for(let u of o._idmap.entries()){let[c,l]=u;An(n,l),s[c]=Nn(n,l)}if(Object.keys(i).length>0){let u=n.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[u]:i}}return{schemas:s}}let r=Cn({...t,processors:Ad});return de(e,r),An(r,e),Nn(r,e)}var Ud=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(t){this.ctx.counter=t}get seen(){return this.ctx.seen}constructor(t){let r=t?.target??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=Cn({processors:Ad,target:r,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}})}process(t,r={path:[],schemaPath:[]}){return de(t,this.ctx,r)}emit(t,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),An(this.ctx,t);let o=Nn(this.ctx,t),{"~standard":n,...i}=o;return i}};var VT={};var Ka={};Zt(Ka,{ZodAny:()=>Hy,ZodArray:()=>Yy,ZodBase64:()=>sf,ZodBase64URL:()=>af,ZodBigInt:()=>Ji,ZodBigIntFormat:()=>lf,ZodBoolean:()=>Hi,ZodCIDRv4:()=>nf,ZodCIDRv6:()=>of,ZodCUID:()=>Kd,ZodCUID2:()=>Yd,ZodCatch:()=>yb,ZodCodec:()=>vf,ZodCustom:()=>ac,ZodCustomStringFormat:()=>Vi,ZodDate:()=>rc,ZodDefault:()=>pb,ZodDiscriminatedUnion:()=>Qy,ZodE164:()=>cf,ZodEmail:()=>Hd,ZodEmoji:()=>Jd,ZodEnum:()=>qi,ZodExactOptional:()=>lb,ZodFile:()=>cb,ZodFunction:()=>Tb,ZodGUID:()=>Ya,ZodIPv4:()=>tf,ZodIPv6:()=>rf,ZodIntersection:()=>eb,ZodJWT:()=>uf,ZodKSUID:()=>ef,ZodLazy:()=>kb,ZodLiteral:()=>ab,ZodMAC:()=>My,ZodMap:()=>ib,ZodNaN:()=>wb,ZodNanoID:()=>Gd,ZodNever:()=>Gy,ZodNonOptional:()=>gf,ZodNull:()=>Vy,ZodNullable:()=>fb,ZodNumber:()=>Wi,ZodNumberFormat:()=>$o,ZodObject:()=>oc,ZodOptional:()=>mf,ZodPipe:()=>_f,ZodPrefault:()=>mb,ZodPromise:()=>zb,ZodReadonly:()=>xb,ZodRecord:()=>sc,ZodSet:()=>sb,ZodString:()=>Bi,ZodStringFormat:()=>pe,ZodSuccess:()=>vb,ZodSymbol:()=>qy,ZodTemplateLiteral:()=>$b,ZodTransform:()=>ub,ZodTuple:()=>rb,ZodType:()=>G,ZodULID:()=>Xd,ZodURL:()=>tc,ZodUUID:()=>zr,ZodUndefined:()=>By,ZodUnion:()=>ic,ZodUnknown:()=>Jy,ZodVoid:()=>Ky,ZodXID:()=>Qd,ZodXor:()=>Xy,_ZodString:()=>Wd,_default:()=>hb,_function:()=>XI,any:()=>PI,array:()=>nc,base64:()=>pI,base64url:()=>hI,bigint:()=>kI,boolean:()=>Fy,catch:()=>bb,check:()=>QI,cidrv4:()=>dI,cidrv6:()=>fI,codec:()=>GI,cuid:()=>nI,cuid2:()=>oI,custom:()=>eP,date:()=>RI,describe:()=>tP,discriminatedUnion:()=>UI,e164:()=>mI,email:()=>HT,emoji:()=>tI,enum:()=>pf,exactOptional:()=>db,file:()=>VI,float32:()=>wI,float64:()=>xI,function:()=>XI,guid:()=>JT,hash:()=>bI,hex:()=>yI,hostname:()=>vI,httpUrl:()=>eI,instanceof:()=>nP,int:()=>Vd,int32:()=>SI,int64:()=>EI,intersection:()=>tb,ipv4:()=>cI,ipv6:()=>lI,json:()=>iP,jwt:()=>gI,keyof:()=>CI,ksuid:()=>aI,lazy:()=>Eb,literal:()=>BI,looseObject:()=>DI,looseRecord:()=>MI,mac:()=>uI,map:()=>ZI,meta:()=>rP,nan:()=>JI,nanoid:()=>rI,nativeEnum:()=>qI,never:()=>df,nonoptional:()=>_b,null:()=>Wy,nullable:()=>Qa,nullish:()=>WI,number:()=>Zy,object:()=>AI,optional:()=>Xa,partialRecord:()=>LI,pipe:()=>ec,prefault:()=>gb,preprocess:()=>sP,promise:()=>YI,readonly:()=>Sb,record:()=>ob,refine:()=>Ib,set:()=>FI,strictObject:()=>NI,string:()=>Bd,stringFormat:()=>_I,stringbool:()=>oP,success:()=>HI,superRefine:()=>Pb,symbol:()=>TI,templateLiteral:()=>KI,transform:()=>hf,tuple:()=>nb,uint32:()=>$I,uint64:()=>zI,ulid:()=>iI,undefined:()=>II,union:()=>ff,unknown:()=>So,url:()=>QT,uuid:()=>GT,uuidv4:()=>KT,uuidv6:()=>YT,uuidv7:()=>XT,void:()=>OI,xid:()=>sI,xor:()=>jI});var Ld={};Zt(Ld,{endsWith:()=>Ci,gt:()=>kr,gte:()=>ht,includes:()=>Oi,length:()=>xo,lowercase:()=>Ii,lt:()=>$r,lte:()=>At,maxLength:()=>wo,maxSize:()=>Rn,mime:()=>Ai,minLength:()=>Jr,minSize:()=>Er,multipleOf:()=>On,negative:()=>Pd,nonnegative:()=>Rd,nonpositive:()=>Od,normalize:()=>Ni,overwrite:()=>ur,positive:()=>Id,property:()=>Cd,regex:()=>Ti,size:()=>bo,slugify:()=>Li,startsWith:()=>Ri,toLowerCase:()=>ji,toUpperCase:()=>Ui,trim:()=>Di,uppercase:()=>Pi});var Fi={};Zt(Fi,{ZodISODate:()=>Zd,ZodISODateTime:()=>Md,ZodISODuration:()=>qd,ZodISOTime:()=>Fd,date:()=>ky,datetime:()=>$y,duration:()=>zy,time:()=>Ey});var Md=$("ZodISODateTime",(e,t)=>{t_.init(e,t),pe.init(e,t)});function $y(e){return iv(Md,e)}var Zd=$("ZodISODate",(e,t)=>{r_.init(e,t),pe.init(e,t)});function ky(e){return sv(Zd,e)}var Fd=$("ZodISOTime",(e,t)=>{n_.init(e,t),pe.init(e,t)});function Ey(e){return av(Fd,e)}var qd=$("ZodISODuration",(e,t)=>{o_.init(e,t),pe.init(e,t)});function zy(e){return cv(qd,e)}var WT=(e,t)=>{ja.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>La(e,r)},flatten:{value:r=>Ua(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,yi,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,yi,2)}},isEmpty:{get(){return e.issues.length===0}}})},oV=$("ZodError",WT),$t=$("ZodError",WT,{Parent:Error});var Ty=xi($t),Iy=Si($t),Py=$i($t),Oy=ki($t),Ry=jl($t),Cy=Ul($t),Ay=Ll($t),Ny=Ml($t),Dy=Zl($t),jy=Fl($t),Uy=ql($t),Ly=Bl($t);var G=$("ZodType",(e,t)=>(H.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Zi(e,"input"),output:Zi(e,"output")}}),e.toJSONSchema=Mv(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone(R.mergeDefs(t,{checks:[...t.checks??[],...r.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]}),{parent:!0}),e.with=e.check,e.clone=(r,o)=>pt(e,r,o),e.brand=()=>e,e.register=((r,o)=>(r.add(e,o),e)),e.parse=(r,o)=>Ty(e,r,o,{callee:e.parse}),e.safeParse=(r,o)=>Py(e,r,o),e.parseAsync=async(r,o)=>Iy(e,r,o,{callee:e.parseAsync}),e.safeParseAsync=async(r,o)=>Oy(e,r,o),e.spa=e.safeParseAsync,e.encode=(r,o)=>Ry(e,r,o),e.decode=(r,o)=>Cy(e,r,o),e.encodeAsync=async(r,o)=>Ay(e,r,o),e.decodeAsync=async(r,o)=>Ny(e,r,o),e.safeEncode=(r,o)=>Dy(e,r,o),e.safeDecode=(r,o)=>jy(e,r,o),e.safeEncodeAsync=async(r,o)=>Uy(e,r,o),e.safeDecodeAsync=async(r,o)=>Ly(e,r,o),e.refine=(r,o)=>e.check(Ib(r,o)),e.superRefine=r=>e.check(Pb(r)),e.overwrite=r=>e.check(ur(r)),e.optional=()=>Xa(e),e.exactOptional=()=>db(e),e.nullable=()=>Qa(e),e.nullish=()=>Xa(Qa(e)),e.nonoptional=r=>_b(e,r),e.array=()=>nc(e),e.or=r=>ff([e,r]),e.and=r=>tb(e,r),e.transform=r=>ec(e,hf(r)),e.default=r=>hb(e,r),e.prefault=r=>gb(e,r),e.catch=r=>bb(e,r),e.pipe=r=>ec(e,r),e.readonly=()=>Sb(e),e.describe=r=>{let o=e.clone();return Ge.add(o,{description:r}),o},Object.defineProperty(e,"description",{get(){return Ge.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return Ge.get(e);let o=e.clone();return Ge.add(o,r[0]),o},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=r=>r(e),e)),Wd=$("_ZodString",(e,t)=>{yo.init(e,t),G.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Zv(e,o,n,i);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...o)=>e.check(Ti(...o)),e.includes=(...o)=>e.check(Oi(...o)),e.startsWith=(...o)=>e.check(Ri(...o)),e.endsWith=(...o)=>e.check(Ci(...o)),e.min=(...o)=>e.check(Jr(...o)),e.max=(...o)=>e.check(wo(...o)),e.length=(...o)=>e.check(xo(...o)),e.nonempty=(...o)=>e.check(Jr(1,...o)),e.lowercase=o=>e.check(Ii(o)),e.uppercase=o=>e.check(Pi(o)),e.trim=()=>e.check(Di()),e.normalize=(...o)=>e.check(Ni(...o)),e.toLowerCase=()=>e.check(ji()),e.toUpperCase=()=>e.check(Ui()),e.slugify=()=>e.check(Li())}),Bi=$("ZodString",(e,t)=>{yo.init(e,t),Wd.init(e,t),e.email=r=>e.check(ud(Hd,r)),e.url=r=>e.check(Ga(tc,r)),e.jwt=r=>e.check(Td(uf,r)),e.emoji=r=>e.check(hd(Jd,r)),e.guid=r=>e.check(Ja(Ya,r)),e.uuid=r=>e.check(ld(zr,r)),e.uuidv4=r=>e.check(dd(zr,r)),e.uuidv6=r=>e.check(fd(zr,r)),e.uuidv7=r=>e.check(pd(zr,r)),e.nanoid=r=>e.check(md(Gd,r)),e.guid=r=>e.check(Ja(Ya,r)),e.cuid=r=>e.check(gd(Kd,r)),e.cuid2=r=>e.check(_d(Yd,r)),e.ulid=r=>e.check(vd(Xd,r)),e.base64=r=>e.check(kd(sf,r)),e.base64url=r=>e.check(Ed(af,r)),e.xid=r=>e.check(yd(Qd,r)),e.ksuid=r=>e.check(bd(ef,r)),e.ipv4=r=>e.check(wd(tf,r)),e.ipv6=r=>e.check(xd(rf,r)),e.cidrv4=r=>e.check(Sd(nf,r)),e.cidrv6=r=>e.check($d(of,r)),e.e164=r=>e.check(zd(cf,r)),e.datetime=r=>e.check($y(r)),e.date=r=>e.check(ky(r)),e.time=r=>e.check(Ey(r)),e.duration=r=>e.check(zy(r))});function Bd(e){return tv(Bi,e)}var pe=$("ZodStringFormat",(e,t)=>{fe.init(e,t),Wd.init(e,t)}),Hd=$("ZodEmail",(e,t)=>{Wg.init(e,t),pe.init(e,t)});function HT(e){return ud(Hd,e)}var Ya=$("ZodGUID",(e,t)=>{Bg.init(e,t),pe.init(e,t)});function JT(e){return Ja(Ya,e)}var zr=$("ZodUUID",(e,t)=>{Vg.init(e,t),pe.init(e,t)});function GT(e){return ld(zr,e)}function KT(e){return dd(zr,e)}function YT(e){return fd(zr,e)}function XT(e){return pd(zr,e)}var tc=$("ZodURL",(e,t)=>{Hg.init(e,t),pe.init(e,t)});function QT(e){return Ga(tc,e)}function eI(e){return Ga(tc,{protocol:/^https?$/,hostname:Vt.domain,...R.normalizeParams(e)})}var Jd=$("ZodEmoji",(e,t)=>{Jg.init(e,t),pe.init(e,t)});function tI(e){return hd(Jd,e)}var Gd=$("ZodNanoID",(e,t)=>{Gg.init(e,t),pe.init(e,t)});function rI(e){return md(Gd,e)}var Kd=$("ZodCUID",(e,t)=>{Kg.init(e,t),pe.init(e,t)});function nI(e){return gd(Kd,e)}var Yd=$("ZodCUID2",(e,t)=>{Yg.init(e,t),pe.init(e,t)});function oI(e){return _d(Yd,e)}var Xd=$("ZodULID",(e,t)=>{Xg.init(e,t),pe.init(e,t)});function iI(e){return vd(Xd,e)}var Qd=$("ZodXID",(e,t)=>{Qg.init(e,t),pe.init(e,t)});function sI(e){return yd(Qd,e)}var ef=$("ZodKSUID",(e,t)=>{e_.init(e,t),pe.init(e,t)});function aI(e){return bd(ef,e)}var tf=$("ZodIPv4",(e,t)=>{i_.init(e,t),pe.init(e,t)});function cI(e){return wd(tf,e)}var My=$("ZodMAC",(e,t)=>{a_.init(e,t),pe.init(e,t)});function uI(e){return nv(My,e)}var rf=$("ZodIPv6",(e,t)=>{s_.init(e,t),pe.init(e,t)});function lI(e){return xd(rf,e)}var nf=$("ZodCIDRv4",(e,t)=>{c_.init(e,t),pe.init(e,t)});function dI(e){return Sd(nf,e)}var of=$("ZodCIDRv6",(e,t)=>{u_.init(e,t),pe.init(e,t)});function fI(e){return $d(of,e)}var sf=$("ZodBase64",(e,t)=>{d_.init(e,t),pe.init(e,t)});function pI(e){return kd(sf,e)}var af=$("ZodBase64URL",(e,t)=>{f_.init(e,t),pe.init(e,t)});function hI(e){return Ed(af,e)}var cf=$("ZodE164",(e,t)=>{p_.init(e,t),pe.init(e,t)});function mI(e){return zd(cf,e)}var uf=$("ZodJWT",(e,t)=>{h_.init(e,t),pe.init(e,t)});function gI(e){return Td(uf,e)}var Vi=$("ZodCustomStringFormat",(e,t)=>{m_.init(e,t),pe.init(e,t)});function _I(e,t,r={}){return Mi(Vi,e,t,r)}function vI(e){return Mi(Vi,"hostname",Vt.hostname,e)}function yI(e){return Mi(Vi,"hex",Vt.hex,e)}function bI(e,t){let r=t?.enc??"hex",o=`${e}_${r}`,n=Vt[o];if(!n)throw new Error(`Unrecognized hash format: ${o}`);return Mi(Vi,o,n,t)}var Wi=$("ZodNumber",(e,t)=>{ed.init(e,t),G.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Fv(e,o,n,i),e.gt=(o,n)=>e.check(kr(o,n)),e.gte=(o,n)=>e.check(ht(o,n)),e.min=(o,n)=>e.check(ht(o,n)),e.lt=(o,n)=>e.check($r(o,n)),e.lte=(o,n)=>e.check(At(o,n)),e.max=(o,n)=>e.check(At(o,n)),e.int=o=>e.check(Vd(o)),e.safe=o=>e.check(Vd(o)),e.positive=o=>e.check(kr(0,o)),e.nonnegative=o=>e.check(ht(0,o)),e.negative=o=>e.check($r(0,o)),e.nonpositive=o=>e.check(At(0,o)),e.multipleOf=(o,n)=>e.check(On(o,n)),e.step=(o,n)=>e.check(On(o,n)),e.finite=()=>e;let r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function Zy(e){return uv(Wi,e)}var $o=$("ZodNumberFormat",(e,t)=>{g_.init(e,t),Wi.init(e,t)});function Vd(e){return dv($o,e)}function wI(e){return fv($o,e)}function xI(e){return pv($o,e)}function SI(e){return hv($o,e)}function $I(e){return mv($o,e)}var Hi=$("ZodBoolean",(e,t)=>{qa.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>qv(e,r,o,n)});function Fy(e){return gv(Hi,e)}var Ji=$("ZodBigInt",(e,t)=>{td.init(e,t),G.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Bv(e,o,n,i),e.gte=(o,n)=>e.check(ht(o,n)),e.min=(o,n)=>e.check(ht(o,n)),e.gt=(o,n)=>e.check(kr(o,n)),e.gte=(o,n)=>e.check(ht(o,n)),e.min=(o,n)=>e.check(ht(o,n)),e.lt=(o,n)=>e.check($r(o,n)),e.lte=(o,n)=>e.check(At(o,n)),e.max=(o,n)=>e.check(At(o,n)),e.positive=o=>e.check(kr(BigInt(0),o)),e.negative=o=>e.check($r(BigInt(0),o)),e.nonpositive=o=>e.check(At(BigInt(0),o)),e.nonnegative=o=>e.check(ht(BigInt(0),o)),e.multipleOf=(o,n)=>e.check(On(o,n));let r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null});function kI(e){return vv(Ji,e)}var lf=$("ZodBigIntFormat",(e,t)=>{__.init(e,t),Ji.init(e,t)});function EI(e){return bv(lf,e)}function zI(e){return wv(lf,e)}var qy=$("ZodSymbol",(e,t)=>{v_.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Vv(e,r,o,n)});function TI(e){return xv(qy,e)}var By=$("ZodUndefined",(e,t)=>{y_.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Hv(e,r,o,n)});function II(e){return Sv(By,e)}var Vy=$("ZodNull",(e,t)=>{b_.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Wv(e,r,o,n)});function Wy(e){return $v(Vy,e)}var Hy=$("ZodAny",(e,t)=>{w_.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Kv(e,r,o,n)});function PI(){return kv(Hy)}var Jy=$("ZodUnknown",(e,t)=>{x_.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Yv(e,r,o,n)});function So(){return Ev(Jy)}var Gy=$("ZodNever",(e,t)=>{S_.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Gv(e,r,o,n)});function df(e){return zv(Gy,e)}var Ky=$("ZodVoid",(e,t)=>{$_.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Jv(e,r,o,n)});function OI(e){return Tv(Ky,e)}var rc=$("ZodDate",(e,t)=>{k_.init(e,t),G.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Xv(e,o,n,i),e.min=(o,n)=>e.check(ht(o,n)),e.max=(o,n)=>e.check(At(o,n));let r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null});function RI(e){return Iv(rc,e)}var Yy=$("ZodArray",(e,t)=>{E_.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ly(e,r,o,n),e.element=t.element,e.min=(r,o)=>e.check(Jr(r,o)),e.nonempty=r=>e.check(Jr(1,r)),e.max=(r,o)=>e.check(wo(r,o)),e.length=(r,o)=>e.check(xo(r,o)),e.unwrap=()=>e.element});function nc(e,t){return Rv(Yy,e,t)}function CI(e){let t=e._zod.def.shape;return pf(Object.keys(t))}var oc=$("ZodObject",(e,t)=>{z_.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>dy(e,r,o,n),R.defineLazy(e,"shape",()=>t.shape),e.keyof=()=>pf(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:So()}),e.loose=()=>e.clone({...e._zod.def,catchall:So()}),e.strict=()=>e.clone({...e._zod.def,catchall:df()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>R.extend(e,r),e.safeExtend=r=>R.safeExtend(e,r),e.merge=r=>R.merge(e,r),e.pick=r=>R.pick(e,r),e.omit=r=>R.omit(e,r),e.partial=(...r)=>R.partial(mf,e,r[0]),e.required=(...r)=>R.required(gf,e,r[0])});function AI(e,t){let r={type:"object",shape:e??{},...R.normalizeParams(t)};return new oc(r)}function NI(e,t){return new oc({type:"object",shape:e,catchall:df(),...R.normalizeParams(t)})}function DI(e,t){return new oc({type:"object",shape:e,catchall:So(),...R.normalizeParams(t)})}var ic=$("ZodUnion",(e,t)=>{Ba.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Nd(e,r,o,n),e.options=t.options});function ff(e,t){return new ic({type:"union",options:e,...R.normalizeParams(t)})}var Xy=$("ZodXor",(e,t)=>{ic.init(e,t),T_.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Nd(e,r,o,n),e.options=t.options});function jI(e,t){return new Xy({type:"union",options:e,inclusive:!1,...R.normalizeParams(t)})}var Qy=$("ZodDiscriminatedUnion",(e,t)=>{ic.init(e,t),I_.init(e,t)});function UI(e,t,r){return new Qy({type:"union",options:t,discriminator:e,...R.normalizeParams(r)})}var eb=$("ZodIntersection",(e,t)=>{P_.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>fy(e,r,o,n)});function tb(e,t){return new eb({type:"intersection",left:e,right:t})}var rb=$("ZodTuple",(e,t)=>{rd.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>py(e,r,o,n),e.rest=r=>e.clone({...e._zod.def,rest:r})});function nb(e,t,r){let o=t instanceof H,n=o?r:t,i=o?t:null;return new rb({type:"tuple",items:e,rest:i,...R.normalizeParams(n)})}var sc=$("ZodRecord",(e,t)=>{O_.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>hy(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType});function ob(e,t,r){return new sc({type:"record",keyType:e,valueType:t,...R.normalizeParams(r)})}function LI(e,t,r){let o=pt(e);return o._zod.values=void 0,new sc({type:"record",keyType:o,valueType:t,...R.normalizeParams(r)})}function MI(e,t,r){return new sc({type:"record",keyType:e,valueType:t,mode:"loose",...R.normalizeParams(r)})}var ib=$("ZodMap",(e,t)=>{R_.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>cy(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...r)=>e.check(Er(...r)),e.nonempty=r=>e.check(Er(1,r)),e.max=(...r)=>e.check(Rn(...r)),e.size=(...r)=>e.check(bo(...r))});function ZI(e,t,r){return new ib({type:"map",keyType:e,valueType:t,...R.normalizeParams(r)})}var sb=$("ZodSet",(e,t)=>{C_.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>uy(e,r,o,n),e.min=(...r)=>e.check(Er(...r)),e.nonempty=r=>e.check(Er(1,r)),e.max=(...r)=>e.check(Rn(...r)),e.size=(...r)=>e.check(bo(...r))});function FI(e,t){return new sb({type:"set",valueType:e,...R.normalizeParams(t)})}var qi=$("ZodEnum",(e,t)=>{A_.init(e,t),G.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Qv(e,o,n,i),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(o,n)=>{let i={};for(let s of o)if(r.has(s))i[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new qi({...t,checks:[],...R.normalizeParams(n),entries:i})},e.exclude=(o,n)=>{let i={...t.entries};for(let s of o)if(r.has(s))delete i[s];else throw new Error(`Key ${s} not found in enum`);return new qi({...t,checks:[],...R.normalizeParams(n),entries:i})}});function pf(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new qi({type:"enum",entries:r,...R.normalizeParams(t)})}function qI(e,t){return new qi({type:"enum",entries:e,...R.normalizeParams(t)})}var ab=$("ZodLiteral",(e,t)=>{N_.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ey(e,r,o,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function BI(e,t){return new ab({type:"literal",values:Array.isArray(e)?e:[e],...R.normalizeParams(t)})}var cb=$("ZodFile",(e,t)=>{D_.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ny(e,r,o,n),e.min=(r,o)=>e.check(Er(r,o)),e.max=(r,o)=>e.check(Rn(r,o)),e.mime=(r,o)=>e.check(Ai(Array.isArray(r)?r:[r],o))});function VI(e){return Cv(cb,e)}var ub=$("ZodTransform",(e,t)=>{j_.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ay(e,r,o,n),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new En(e.constructor.name);r.addIssue=i=>{if(typeof i=="string")r.issues.push(R.issue(i,r.value,t));else{let s=i;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=e),r.issues.push(R.issue(s))}};let n=t.transform(r.value,r);return n instanceof Promise?n.then(i=>(r.value=i,r)):(r.value=n,r)}});function hf(e){return new ub({type:"transform",transform:e})}var mf=$("ZodOptional",(e,t)=>{nd.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Dd(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Xa(e){return new mf({type:"optional",innerType:e})}var lb=$("ZodExactOptional",(e,t)=>{U_.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Dd(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function db(e){return new lb({type:"optional",innerType:e})}var fb=$("ZodNullable",(e,t)=>{L_.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>my(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Qa(e){return new fb({type:"nullable",innerType:e})}function WI(e){return Xa(Qa(e))}var pb=$("ZodDefault",(e,t)=>{M_.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>_y(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function hb(e,t){return new pb({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():R.shallowClone(t)}})}var mb=$("ZodPrefault",(e,t)=>{Z_.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>vy(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function gb(e,t){return new mb({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():R.shallowClone(t)}})}var gf=$("ZodNonOptional",(e,t)=>{F_.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>gy(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function _b(e,t){return new gf({type:"nonoptional",innerType:e,...R.normalizeParams(t)})}var vb=$("ZodSuccess",(e,t)=>{q_.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>oy(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function HI(e){return new vb({type:"success",innerType:e})}var yb=$("ZodCatch",(e,t)=>{B_.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>yy(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function bb(e,t){return new yb({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}var wb=$("ZodNaN",(e,t)=>{V_.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ty(e,r,o,n)});function JI(e){return Ov(wb,e)}var _f=$("ZodPipe",(e,t)=>{W_.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>by(e,r,o,n),e.in=t.in,e.out=t.out});function ec(e,t){return new _f({type:"pipe",in:e,out:t})}var vf=$("ZodCodec",(e,t)=>{_f.init(e,t),Va.init(e,t)});function GI(e,t,r){return new vf({type:"pipe",in:e,out:t,transform:r.decode,reverseTransform:r.encode})}var xb=$("ZodReadonly",(e,t)=>{H_.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>wy(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Sb(e){return new xb({type:"readonly",innerType:e})}var $b=$("ZodTemplateLiteral",(e,t)=>{J_.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ry(e,r,o,n)});function KI(e,t){return new $b({type:"template_literal",parts:e,...R.normalizeParams(t)})}var kb=$("ZodLazy",(e,t)=>{Y_.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Sy(e,r,o,n),e.unwrap=()=>e._zod.def.getter()});function Eb(e){return new kb({type:"lazy",getter:e})}var zb=$("ZodPromise",(e,t)=>{K_.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>xy(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function YI(e){return new zb({type:"promise",innerType:e})}var Tb=$("ZodFunction",(e,t)=>{G_.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>sy(e,r,o,n)});function XI(e){return new Tb({type:"function",input:Array.isArray(e?.input)?nb(e?.input):e?.input??nc(So()),output:e?.output??So()})}var ac=$("ZodCustom",(e,t)=>{X_.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>iy(e,r,o,n)});function QI(e){let t=new ge({check:"custom"});return t._zod.check=e,t}function eP(e,t){return Av(ac,e??(()=>!0),t)}function Ib(e,t={}){return Nv(ac,e,t)}function Pb(e){return Dv(e)}var tP=jv,rP=Uv;function nP(e,t={}){let r=new ac({type:"custom",check:"custom",fn:o=>o instanceof e,abort:!0,...R.normalizeParams(t)});return r._zod.bag.Class=e,r._zod.check=o=>{o.value instanceof e||o.issues.push({code:"invalid_type",expected:e.name,input:o.value,inst:r,path:[...r._zod.def.path??[]]})},r}var oP=(...e)=>Lv({Codec:vf,Boolean:Hi,String:Bi},...e);function iP(e){let t=Eb(()=>ff([Bd(e),Zy(),Fy(),Wy(),nc(t),ob(Bd(),t)]));return t}function sP(e,t){return ec(hf(e),t)}var sV={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function aV(e){Ne({customError:e})}function cV(){return Ne().customError}var Ob;Ob||(Ob={});var L={...Ka,...Ld,iso:Fi},uV=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function lV(e,t){let r=e.$schema;return r==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":r==="http://json-schema.org/draft-07/schema#"?"draft-7":r==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}function dV(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=e.slice(1).split("/").filter(Boolean);if(r.length===0)return t.rootSchema;let o=t.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===o){let n=r[1];if(!n||!t.defs[n])throw new Error(`Reference not found: ${e}`);return t.defs[n]}throw new Error(`Reference not found: ${e}`)}function aP(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return L.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let n=e.$ref;if(t.refs.has(n))return t.refs.get(n);if(t.processing.has(n))return L.lazy(()=>{if(!t.refs.has(n))throw new Error(`Circular reference not resolved: ${n}`);return t.refs.get(n)});t.processing.add(n);let i=dV(n,t),s=st(i,t);return t.refs.set(n,s),t.processing.delete(n),s}if(e.enum!==void 0){let n=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&n.length===1&&n[0]===null)return L.null();if(n.length===0)return L.never();if(n.length===1)return L.literal(n[0]);if(n.every(s=>typeof s=="string"))return L.enum(n);let i=n.map(s=>L.literal(s));return i.length<2?i[0]:L.union([i[0],i[1],...i.slice(2)])}if(e.const!==void 0)return L.literal(e.const);let r=e.type;if(Array.isArray(r)){let n=r.map(i=>{let s={...e,type:i};return aP(s,t)});return n.length===0?L.never():n.length===1?n[0]:L.union(n)}if(!r)return L.any();let o;switch(r){case"string":{let n=L.string();if(e.format){let i=e.format;i==="email"?n=n.check(L.email()):i==="uri"||i==="uri-reference"?n=n.check(L.url()):i==="uuid"||i==="guid"?n=n.check(L.uuid()):i==="date-time"?n=n.check(L.iso.datetime()):i==="date"?n=n.check(L.iso.date()):i==="time"?n=n.check(L.iso.time()):i==="duration"?n=n.check(L.iso.duration()):i==="ipv4"?n=n.check(L.ipv4()):i==="ipv6"?n=n.check(L.ipv6()):i==="mac"?n=n.check(L.mac()):i==="cidr"?n=n.check(L.cidrv4()):i==="cidr-v6"?n=n.check(L.cidrv6()):i==="base64"?n=n.check(L.base64()):i==="base64url"?n=n.check(L.base64url()):i==="e164"?n=n.check(L.e164()):i==="jwt"?n=n.check(L.jwt()):i==="emoji"?n=n.check(L.emoji()):i==="nanoid"?n=n.check(L.nanoid()):i==="cuid"?n=n.check(L.cuid()):i==="cuid2"?n=n.check(L.cuid2()):i==="ulid"?n=n.check(L.ulid()):i==="xid"?n=n.check(L.xid()):i==="ksuid"&&(n=n.check(L.ksuid()))}typeof e.minLength=="number"&&(n=n.min(e.minLength)),typeof e.maxLength=="number"&&(n=n.max(e.maxLength)),e.pattern&&(n=n.regex(new RegExp(e.pattern))),o=n;break}case"number":case"integer":{let n=r==="integer"?L.number().int():L.number();typeof e.minimum=="number"&&(n=n.min(e.minimum)),typeof e.maximum=="number"&&(n=n.max(e.maximum)),typeof e.exclusiveMinimum=="number"?n=n.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(n=n.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?n=n.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(n=n.lt(e.maximum)),typeof e.multipleOf=="number"&&(n=n.multipleOf(e.multipleOf)),o=n;break}case"boolean":{o=L.boolean();break}case"null":{o=L.null();break}case"object":{let n={},i=e.properties||{},s=new Set(e.required||[]);for(let[u,c]of Object.entries(i)){let l=st(c,t);n[u]=s.has(u)?l:l.optional()}if(e.propertyNames){let u=st(e.propertyNames,t),c=e.additionalProperties&&typeof e.additionalProperties=="object"?st(e.additionalProperties,t):L.any();if(Object.keys(n).length===0){o=L.record(u,c);break}let l=L.object(n).passthrough(),f=L.looseRecord(u,c);o=L.intersection(l,f);break}if(e.patternProperties){let u=e.patternProperties,c=Object.keys(u),l=[];for(let p of c){let h=st(u[p],t),m=L.string().regex(new RegExp(p));l.push(L.looseRecord(m,h))}let f=[];if(Object.keys(n).length>0&&f.push(L.object(n).passthrough()),f.push(...l),f.length===0)o=L.object({}).passthrough();else if(f.length===1)o=f[0];else{let p=L.intersection(f[0],f[1]);for(let h=2;h<f.length;h++)p=L.intersection(p,f[h]);o=p}break}let a=L.object(n);e.additionalProperties===!1?o=a.strict():typeof e.additionalProperties=="object"?o=a.catchall(st(e.additionalProperties,t)):o=a.passthrough();break}case"array":{let n=e.prefixItems,i=e.items;if(n&&Array.isArray(n)){let s=n.map(u=>st(u,t)),a=i&&typeof i=="object"&&!Array.isArray(i)?st(i,t):void 0;a?o=L.tuple(s).rest(a):o=L.tuple(s),typeof e.minItems=="number"&&(o=o.check(L.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(L.maxLength(e.maxItems)))}else if(Array.isArray(i)){let s=i.map(u=>st(u,t)),a=e.additionalItems&&typeof e.additionalItems=="object"?st(e.additionalItems,t):void 0;a?o=L.tuple(s).rest(a):o=L.tuple(s),typeof e.minItems=="number"&&(o=o.check(L.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(L.maxLength(e.maxItems)))}else if(i!==void 0){let s=st(i,t),a=L.array(s);typeof e.minItems=="number"&&(a=a.min(e.minItems)),typeof e.maxItems=="number"&&(a=a.max(e.maxItems)),o=a}else o=L.array(L.any());break}default:throw new Error(`Unsupported type: ${r}`)}return e.description&&(o=o.describe(e.description)),e.default!==void 0&&(o=o.default(e.default)),o}function st(e,t){if(typeof e=="boolean")return e?L.any():L.never();let r=aP(e,t),o=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let a=e.anyOf.map(c=>st(c,t)),u=L.union(a);r=o?L.intersection(r,u):u}if(e.oneOf&&Array.isArray(e.oneOf)){let a=e.oneOf.map(c=>st(c,t)),u=L.xor(a);r=o?L.intersection(r,u):u}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)r=o?r:L.any();else{let a=o?r:st(e.allOf[0],t),u=o?0:1;for(let c=u;c<e.allOf.length;c++)a=L.intersection(a,st(e.allOf[c],t));r=a}e.nullable===!0&&t.version==="openapi-3.0"&&(r=L.nullable(r)),e.readOnly===!0&&(r=L.readonly(r));let n={},i=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let a of i)a in e&&(n[a]=e[a]);let s=["contentEncoding","contentMediaType","contentSchema"];for(let a of s)a in e&&(n[a]=e[a]);for(let a of Object.keys(e))uV.has(a)||(n[a]=e[a]);return Object.keys(n).length>0&&t.registry.add(r,n),r}function cP(e,t){if(typeof e=="boolean")return e?L.any():L.never();let r=lV(e,t?.defaultTarget),o=e.$defs||e.definitions||{},n={version:r,defs:o,refs:new Map,processing:new Set,rootSchema:e,registry:t?.registry??Ge};return st(e,n)}var Rb={};Zt(Rb,{bigint:()=>mV,boolean:()=>hV,date:()=>gV,number:()=>pV,string:()=>fV});function fV(e){return rv(Bi,e)}function pV(e){return lv(Wi,e)}function hV(e){return _v(Hi,e)}function mV(e){return yv(Ji,e)}function gV(e){return Pv(rc,e)}Ne(od());var uP=d.enum(["network","computer_unreachable","platform","provider","timeout","transport","unknown","limit","billing"]),_V="octavus.error";function vV(e){if(!(e instanceof Error))return!1;let t=e;return t.__octavusErrorMarker===_V&&typeof t.errorType=="string"&&typeof t.source=="string"}function yf(e){if(!(e instanceof Error))return typeof e=="string"?e:"Unknown error";let t=e.message||e.name||"Error",r=new Set([e]),o=e.cause,n=0;for(;o instanceof Error&&!r.has(o)&&n<3;){r.add(o);let i=o.message?.trim();i&&!t.includes(i)&&(t=`${t}: ${i}`),o=o.cause,n+=1}return t}var yV=["terminated","fetch failed","socket hang up","other side closed","connection closed","econnreset","econnrefused","epipe","etimedout","enotfound","eai_again","und_err_socket","und_err_connect_timeout","und_err_headers_timeout","und_err_body_timeout"];function bV(e){let t=e;for(let r=0;r<5&&!(typeof t!="object"||t===null);r++){let o=t,n=`${typeof o.message=="string"?o.message:""} ${typeof o.code=="string"?o.code:""}`.toLowerCase();if(yV.some(i=>n.includes(i)))return!0;t=o.cause}return!1}function lP(e,t){let r=typeof e?.message=="string"?e.message:"Session ended unexpectedly",o=typeof e?.source=="string"?e.source:void 0,n=typeof e?.errorType=="string"?e.errorType:void 0;return{status:"failed",error:r,errorType:dP(o,n,r),title:t??void 0,retryable:$V(e)}}var wV=new Set(["rate_limit_error","provider_overloaded","provider_timeout","provider_error"]),xV=new Set(["PROVIDER_ACCOUNT_ERROR","FILE_DOWNLOAD_ERROR","FILE_DOWNLOAD_TIMEOUT","NETWORK_ERROR"]),SV=new Set(["CONTENT_FILTER","CONTEXT_OVERFLOW"]);function $V(e){if(!e)return!1;let t=typeof e.errorType=="string"?e.errorType:void 0,r=typeof e.code=="string"?e.code:void 0;return r!==void 0&&SV.has(r)?!1:!!(t!==void 0&&wV.has(t)||r!==void 0&&xV.has(r))}function bf(e){return vV(e)?dP(e.source,e.errorType,e.message):typeof e=="string"?Cb(e):e instanceof Error?bV(e)?"transport":Cb(e.message):"unknown"}function dP(e,t,r){if(t==="quota_exceeded_error")return"billing";if(e==="provider")return"provider";if(typeof t=="string"){if(t==="rate_limit_error"||t==="provider_error"||t==="provider_overloaded")return"provider";if(t==="provider_timeout")return"timeout"}return Cb(r)}function Cb(e){let t=zV(e);if(t.errorType)return t.errorType;let r=e.toLowerCase();return r.includes("fetch failed")||r.includes("econnrefused")||r.includes("econnreset")||r.includes("socket hang up")||r.includes("network request failed")?"network":r.includes("timed out")||r.includes("timeout")?"timeout":"platform"}var kV=/^\[([a-z_]+)\] /,EV=new Set(uP.options);function zV(e){let t=kV.exec(e);return t&&EV.has(t[1])?{errorType:t[1],message:e.slice(t[0].length)}:{errorType:null,message:e}}var TV=d.object({type:d.literal("sync"),octoAgentIds:d.array(d.string().min(1)),activeSessionIds:d.array(d.string().min(1)).optional()}),IV=d.object({type:d.literal("session-event"),sessionId:d.string().min(1),event:d.record(d.string(),d.unknown()),seq:d.number().int().optional()}),PV=d.object({type:d.literal("session-started"),sessionId:d.string().min(1)}),OV=d.object({type:d.literal("session-complete"),sessionId:d.string().min(1),status:d.enum(["completed","failed"]),error:d.string().optional(),errorType:uP.optional(),title:d.string().optional()}),RV=d.object({type:d.literal("session-state"),sessionId:d.string().min(1),events:d.array(d.record(d.string(),d.unknown())),lastSeq:d.number().int()}),CV=d.object({type:d.literal("dispatch-ack"),sessionId:d.string().min(1)}),AV=d.object({type:d.literal("session-title"),sessionId:d.string().min(1),title:d.string().min(1)}),NV=d.enum(["transport-drop","network-error","provider-error"]),DV=d.object({type:d.literal("session-retry"),sessionId:d.string().min(1),attempt:d.number().int().positive(),reason:NV,delayMs:d.number().int().nonnegative()}),jV=d.object({type:d.literal("heartbeat")}),Ufe=d.discriminatedUnion("type",[TV,IV,PV,OV,AV,DV,RV,CV,jV]),UV=d.object({namespace:d.string().min(1),name:d.string().min(1),description:d.string(),command:d.string().min(1),args:d.array(d.string()),env:d.record(d.string(),d.string()),connection:d.enum(["eager","lazy"])}),LV=d.object({slug:d.string().min(1),bundleUrl:d.string().min(1),bundleSha256:d.string().optional(),secrets:d.record(d.string(),d.string())}),MV=d.object({id:d.string().optional(),name:d.string().optional(),image:d.string().optional()}),ZV=d.object({type:d.literal("dispatch"),sessionId:d.string().min(1),operatorToken:d.string().min(1),trigger:d.object({triggerName:d.string().min(1),input:d.record(d.string(),d.unknown()).optional(),sender:MV.optional()}),deviceId:d.string().min(1).optional(),deviceMcpConfigs:d.array(UV).optional(),deviceSkillConfigs:d.array(LV).optional()}),FV=d.object({type:d.literal("stop"),sessionId:d.string().min(1)}),qV=d.object({type:d.literal("request-session-state"),sessionId:d.string().min(1)}),BV=d.object({type:d.literal("heartbeat")}),fP=d.object({type:d.literal("start-screen-stream"),livekitUrl:d.string().min(1),token:d.string().min(1),roomName:d.string().min(1)}),pP=d.object({type:d.literal("device-reconnect")}),hP=d.object({type:d.literal("device-reconnect-agents")}),mP=d.object({type:d.literal("device-restart"),force:d.boolean()}),gP=d.object({type:d.literal("read-slack-prefs"),octoAgentId:d.string().min(1),workspaceHost:d.string().min(1),correlationId:d.string().min(1)}),VV=d.object({uploadUrl:d.string().min(1),mediaType:d.string().min(1)}),Lfe=d.object({fileId:d.string().min(1),key:d.string().min(1),mediaType:d.string().min(1),filename:d.string().min(1)}),_P=d.object({type:d.literal("start-voice-call"),sessionId:d.string().min(1),octoAgentId:d.string().min(1),ephemeralSecret:d.string().min(1),model:d.string().min(1),voiceToken:d.string().min(1),operatorWsUrl:d.string().min(1),recording:VV.optional()}),Mfe=d.discriminatedUnion("type",[fP,pP,hP,mP,_P,gP]),vP=d.discriminatedUnion("type",[ZV,FV,qV,BV,fP,pP,hP,mP,_P,gP]),WV=d.object({speaker:d.enum(["user","agent"]),text:d.string(),at:d.number()}),Zfe=d.object({at:d.number(),kind:d.enum(["ask","answer","cancel","end","silence"]),name:d.string().optional(),callId:d.string().optional(),request:d.string().optional(),answer:d.string().optional(),reason:d.string().optional()}),HV=d.object({audioInputTokens:d.number().int().nonnegative(),cachedAudioInputTokens:d.number().int().nonnegative(),textInputTokens:d.number().int().nonnegative(),cachedTextInputTokens:d.number().int().nonnegative(),audioOutputTokens:d.number().int().nonnegative(),textOutputTokens:d.number().int().nonnegative()}),JV=d.object({type:d.literal("function"),name:d.string(),description:d.string(),parameters:d.record(d.string(),d.unknown())}),GV=d.object({ask:d.string().optional(),cancel:d.string().optional(),end:d.string().optional(),silence:d.string().optional()}),KV=d.object({type:d.string(),eagerness:d.string().optional(),create_response:d.boolean(),interrupt_response:d.boolean()}),YV=d.object({engagementNudgeMs:d.number().int().positive().optional(),recheckNudgeMs:d.number().int().positive().optional(),endNudgeMs:d.number().int().positive().optional(),waitingNudgeMs:d.number().int().positive().optional(),engagementNote:d.string().optional(),recheckNote:d.string().optional(),endNote:d.string().optional(),waitingNote:d.string().optional()}),XV=d.object({tools:d.array(JV),toolChoice:d.enum(["auto","none","required"]),modalities:d.array(d.enum(["audio","text"])).min(1),transcriptionModel:d.string(),transcriptionLanguage:d.string().optional(),transcriptionPrompt:d.string().optional(),turnDetection:KV,noiseReduction:d.enum(["near_field","far_field"]).optional(),filler:d.string(),roles:GV,silence:YV.optional()}),QV=d.object({type:d.literal("ask"),callId:d.string().min(1),request:d.string()}),e9=d.object({type:d.literal("cancel"),callId:d.string().min(1),reason:d.string().optional()}),t9=d.object({type:d.literal("transcript"),entries:d.array(WV).max(200)}),r9=d.object({type:d.literal("usage"),usage:HV}),n9=d.object({type:d.literal("tool-event"),kind:d.enum(["silence"]),reason:d.string().optional()}),o9=d.object({type:d.literal("end"),reason:d.string().optional(),endedByTool:d.boolean().optional()}),Ffe=d.discriminatedUnion("type",[QV,e9,t9,r9,n9,o9]),i9=d.object({type:d.literal("ready"),instructions:d.string(),sessionConfig:XV}),s9=d.object({type:d.literal("observer")}),a9=d.object({type:d.literal("answer"),callId:d.string().min(1),answer:d.string()}),c9=d.object({type:d.literal("ended"),reason:d.string().optional()}),qfe=d.discriminatedUnion("type",[i9,s9,a9,c9]),yP=3e4;var bP=4003,Ab=[2e3,5e3,15e3,3e4,6e4,6e4];var wP="octavus.error",xf=class extends Error{__octavusErrorMarker=wP;errorType;source;retryable;retryAfter;code;provider;tool;constructor(e){super(e.message),this.name="OctavusError",this.errorType=e.errorType,this.source=e.source,this.retryable=e.retryable??!1,this.retryAfter=e.retryAfter,this.code=e.code,this.provider=e.provider,this.tool=e.tool,e.cause instanceof Error&&e.cause.stack&&(this.stack=`${this.stack}
62
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of e.seen.entries()){let a=s[1];if(t===s[0]){i(s);continue}if(e.external){let c=e.external.registry.get(s[0])?.id;if(t!==s[0]&&c){i(s);continue}}if(e.metadataRegistry.get(s[0])?.id){i(s);continue}if(a.cycle){i(s);continue}if(a.count>1&&e.reused==="ref"){i(s);continue}}}function Nn(e,t){let r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=s=>{let a=e.seen.get(s);if(a.ref===null)return;let u=a.def??a.schema,c={...u},l=a.ref;if(a.ref=null,l){o(l);let p=e.seen.get(l),h=p.schema;if(h.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(h)):Object.assign(u,h),Object.assign(u,c),s._zod.parent===l)for(let g in u)g==="$ref"||g==="allOf"||g in c||delete u[g];if(h.$ref)for(let g in u)g==="$ref"||g==="allOf"||g in p.def&&JSON.stringify(u[g])===JSON.stringify(p.def[g])&&delete u[g]}let f=s._zod.parent;if(f&&f!==l){o(f);let p=e.seen.get(f);if(p?.schema.$ref&&(u.$ref=p.schema.$ref,p.def))for(let h in u)h==="$ref"||h==="allOf"||h in p.def&&JSON.stringify(u[h])===JSON.stringify(p.def[h])&&delete u[h]}e.override({zodSchema:s,jsonSchema:u,path:a.path??[]})};for(let s of[...e.seen.entries()].reverse())o(s[0]);let n={};if(e.target==="draft-2020-12"?n.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?n.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?n.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let s=e.external.registry.get(t)?.id;if(!s)throw new Error("Schema is missing an `id` property");n.$id=e.external.uri(s)}Object.assign(n,r.def??r.schema);let i=e.external?.defs??{};for(let s of e.seen.entries()){let a=s[1];a.def&&a.defId&&(i[a.defId]=a.def)}e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?n.$defs=i:n.definitions=i);try{let s=JSON.parse(JSON.stringify(n));return Object.defineProperty(s,"~standard",{value:{...t["~standard"],jsonSchema:{input:Zi(t,"input",e.processors),output:Zi(t,"output",e.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function mt(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let o=e._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return mt(o.element,r);if(o.type==="set")return mt(o.valueType,r);if(o.type==="lazy")return mt(o.getter(),r);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault")return mt(o.innerType,r);if(o.type==="intersection")return mt(o.left,r)||mt(o.right,r);if(o.type==="record"||o.type==="map")return mt(o.keyType,r)||mt(o.valueType,r);if(o.type==="pipe")return mt(o.in,r)||mt(o.out,r);if(o.type==="object"){for(let n in o.shape)if(mt(o.shape[n],r))return!0;return!1}if(o.type==="union"){for(let n of o.options)if(mt(n,r))return!0;return!1}if(o.type==="tuple"){for(let n of o.items)if(mt(n,r))return!0;return!!(o.rest&&mt(o.rest,r))}return!1}var Mv=(e,t={})=>r=>{let o=Cn({...r,processors:t});return de(e,o),An(o,e),Nn(o,e)},Zi=(e,t,r={})=>o=>{let{libraryOptions:n,target:i}=o??{},s=Cn({...n??{},target:i,io:t,processors:r});return de(e,s),An(s,e),Nn(s,e)};var rV={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Zv=(e,t,r,o)=>{let n=r;n.type="string";let{minimum:i,maximum:s,format:a,patterns:u,contentEncoding:c}=e._zod.bag;if(typeof i=="number"&&(n.minLength=i),typeof s=="number"&&(n.maxLength=s),a&&(n.format=rV[a]??a,n.format===""&&delete n.format,a==="time"&&delete n.format),c&&(n.contentEncoding=c),u&&u.size>0){let l=[...u];l.length===1?n.pattern=l[0].source:l.length>1&&(n.allOf=[...l.map(f=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:f.source}))])}},Fv=(e,t,r,o)=>{let n=r,{minimum:i,maximum:s,format:a,multipleOf:u,exclusiveMaximum:c,exclusiveMinimum:l}=e._zod.bag;typeof a=="string"&&a.includes("int")?n.type="integer":n.type="number",typeof l=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(n.minimum=l,n.exclusiveMinimum=!0):n.exclusiveMinimum=l),typeof i=="number"&&(n.minimum=i,typeof l=="number"&&t.target!=="draft-04"&&(l>=i?delete n.minimum:delete n.exclusiveMinimum)),typeof c=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(n.maximum=c,n.exclusiveMaximum=!0):n.exclusiveMaximum=c),typeof s=="number"&&(n.maximum=s,typeof c=="number"&&t.target!=="draft-04"&&(c<=s?delete n.maximum:delete n.exclusiveMaximum)),typeof u=="number"&&(n.multipleOf=u)},qv=(e,t,r,o)=>{r.type="boolean"},Bv=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},Vv=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},Wv=(e,t,r,o)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},Hv=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},Jv=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},Gv=(e,t,r,o)=>{r.not={}},Kv=(e,t,r,o)=>{},Yv=(e,t,r,o)=>{},Xv=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},Qv=(e,t,r,o)=>{let n=e._zod.def,i=Ra(n.entries);i.every(s=>typeof s=="number")&&(r.type="number"),i.every(s=>typeof s=="string")&&(r.type="string"),r.enum=i},ey=(e,t,r,o)=>{let n=e._zod.def,i=[];for(let s of n.values)if(s===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");i.push(Number(s))}else i.push(s);if(i.length!==0)if(i.length===1){let s=i[0];r.type=s===null?"null":typeof s,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[s]:r.const=s}else i.every(s=>typeof s=="number")&&(r.type="number"),i.every(s=>typeof s=="string")&&(r.type="string"),i.every(s=>typeof s=="boolean")&&(r.type="boolean"),i.every(s=>s===null)&&(r.type="null"),r.enum=i},ty=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},ry=(e,t,r,o)=>{let n=r,i=e._zod.pattern;if(!i)throw new Error("Pattern not found in template literal");n.type="string",n.pattern=i.source},ny=(e,t,r,o)=>{let n=r,i={type:"string",format:"binary",contentEncoding:"binary"},{minimum:s,maximum:a,mime:u}=e._zod.bag;s!==void 0&&(i.minLength=s),a!==void 0&&(i.maxLength=a),u?u.length===1?(i.contentMediaType=u[0],Object.assign(n,i)):(Object.assign(n,i),n.anyOf=u.map(c=>({contentMediaType:c}))):Object.assign(n,i)},oy=(e,t,r,o)=>{r.type="boolean"},iy=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},sy=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},ay=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},cy=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},uy=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},ly=(e,t,r,o)=>{let n=r,i=e._zod.def,{minimum:s,maximum:a}=e._zod.bag;typeof s=="number"&&(n.minItems=s),typeof a=="number"&&(n.maxItems=a),n.type="array",n.items=de(i.element,t,{...o,path:[...o.path,"items"]})},dy=(e,t,r,o)=>{let n=r,i=e._zod.def;n.type="object",n.properties={};let s=i.shape;for(let c in s)n.properties[c]=de(s[c],t,{...o,path:[...o.path,"properties",c]});let a=new Set(Object.keys(s)),u=new Set([...a].filter(c=>{let l=i.shape[c]._zod;return t.io==="input"?l.optin===void 0:l.optout===void 0}));u.size>0&&(n.required=Array.from(u)),i.catchall?._zod.def.type==="never"?n.additionalProperties=!1:i.catchall?i.catchall&&(n.additionalProperties=de(i.catchall,t,{...o,path:[...o.path,"additionalProperties"]})):t.io==="output"&&(n.additionalProperties=!1)},Nd=(e,t,r,o)=>{let n=e._zod.def,i=n.inclusive===!1,s=n.options.map((a,u)=>de(a,t,{...o,path:[...o.path,i?"oneOf":"anyOf",u]}));i?r.oneOf=s:r.anyOf=s},fy=(e,t,r,o)=>{let n=e._zod.def,i=de(n.left,t,{...o,path:[...o.path,"allOf",0]}),s=de(n.right,t,{...o,path:[...o.path,"allOf",1]}),a=c=>"allOf"in c&&Object.keys(c).length===1,u=[...a(i)?i.allOf:[i],...a(s)?s.allOf:[s]];r.allOf=u},py=(e,t,r,o)=>{let n=r,i=e._zod.def;n.type="array";let s=t.target==="draft-2020-12"?"prefixItems":"items",a=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",u=i.items.map((p,h)=>de(p,t,{...o,path:[...o.path,s,h]})),c=i.rest?de(i.rest,t,{...o,path:[...o.path,a,...t.target==="openapi-3.0"?[i.items.length]:[]]}):null;t.target==="draft-2020-12"?(n.prefixItems=u,c&&(n.items=c)):t.target==="openapi-3.0"?(n.items={anyOf:u},c&&n.items.anyOf.push(c),n.minItems=u.length,c||(n.maxItems=u.length)):(n.items=u,c&&(n.additionalItems=c));let{minimum:l,maximum:f}=e._zod.bag;typeof l=="number"&&(n.minItems=l),typeof f=="number"&&(n.maxItems=f)},hy=(e,t,r,o)=>{let n=r,i=e._zod.def;n.type="object";let s=i.keyType,u=s._zod.bag?.patterns;if(i.mode==="loose"&&u&&u.size>0){let l=de(i.valueType,t,{...o,path:[...o.path,"patternProperties","*"]});n.patternProperties={};for(let f of u)n.patternProperties[f.source]=l}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(n.propertyNames=de(i.keyType,t,{...o,path:[...o.path,"propertyNames"]})),n.additionalProperties=de(i.valueType,t,{...o,path:[...o.path,"additionalProperties"]});let c=s._zod.values;if(c){let l=[...c].filter(f=>typeof f=="string"||typeof f=="number");l.length>0&&(n.required=l)}},my=(e,t,r,o)=>{let n=e._zod.def,i=de(n.innerType,t,o),s=t.seen.get(e);t.target==="openapi-3.0"?(s.ref=n.innerType,r.nullable=!0):r.anyOf=[i,{type:"null"}]},gy=(e,t,r,o)=>{let n=e._zod.def;de(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},_y=(e,t,r,o)=>{let n=e._zod.def;de(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,r.default=JSON.parse(JSON.stringify(n.defaultValue))},vy=(e,t,r,o)=>{let n=e._zod.def;de(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(n.defaultValue)))},yy=(e,t,r,o)=>{let n=e._zod.def;de(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType;let s;try{s=n.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=s},by=(e,t,r,o)=>{let n=e._zod.def,i=t.io==="input"?n.in._zod.def.type==="transform"?n.out:n.in:n.out;de(i,t,o);let s=t.seen.get(e);s.ref=i},wy=(e,t,r,o)=>{let n=e._zod.def;de(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,r.readOnly=!0},xy=(e,t,r,o)=>{let n=e._zod.def;de(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},Dd=(e,t,r,o)=>{let n=e._zod.def;de(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},Sy=(e,t,r,o)=>{let n=e._zod.innerType;de(n,t,o);let i=t.seen.get(e);i.ref=n},Ad={string:Zv,number:Fv,boolean:qv,bigint:Bv,symbol:Vv,null:Wv,undefined:Hv,void:Jv,never:Gv,any:Kv,unknown:Yv,date:Xv,enum:Qv,literal:ey,nan:ty,template_literal:ry,file:ny,success:oy,custom:iy,function:sy,transform:ay,map:cy,set:uy,array:ly,object:dy,union:Nd,intersection:fy,tuple:py,record:hy,nullable:my,nonoptional:gy,default:_y,prefault:vy,catch:yy,pipe:by,readonly:wy,promise:xy,optional:Dd,lazy:Sy};function jd(e,t){if("_idmap"in e){let o=e,n=Cn({...t,processors:Ad}),i={};for(let u of o._idmap.entries()){let[c,l]=u;de(l,n)}let s={},a={registry:o,uri:t?.uri,defs:i};n.external=a;for(let u of o._idmap.entries()){let[c,l]=u;An(n,l),s[c]=Nn(n,l)}if(Object.keys(i).length>0){let u=n.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[u]:i}}return{schemas:s}}let r=Cn({...t,processors:Ad});return de(e,r),An(r,e),Nn(r,e)}var Ud=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(t){this.ctx.counter=t}get seen(){return this.ctx.seen}constructor(t){let r=t?.target??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=Cn({processors:Ad,target:r,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}})}process(t,r={path:[],schemaPath:[]}){return de(t,this.ctx,r)}emit(t,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),An(this.ctx,t);let o=Nn(this.ctx,t),{"~standard":n,...i}=o;return i}};var VT={};var Ka={};Zt(Ka,{ZodAny:()=>Hy,ZodArray:()=>Yy,ZodBase64:()=>sf,ZodBase64URL:()=>af,ZodBigInt:()=>Ji,ZodBigIntFormat:()=>lf,ZodBoolean:()=>Hi,ZodCIDRv4:()=>nf,ZodCIDRv6:()=>of,ZodCUID:()=>Kd,ZodCUID2:()=>Yd,ZodCatch:()=>yb,ZodCodec:()=>vf,ZodCustom:()=>ac,ZodCustomStringFormat:()=>Vi,ZodDate:()=>rc,ZodDefault:()=>pb,ZodDiscriminatedUnion:()=>Qy,ZodE164:()=>cf,ZodEmail:()=>Hd,ZodEmoji:()=>Jd,ZodEnum:()=>qi,ZodExactOptional:()=>lb,ZodFile:()=>cb,ZodFunction:()=>Tb,ZodGUID:()=>Ya,ZodIPv4:()=>tf,ZodIPv6:()=>rf,ZodIntersection:()=>eb,ZodJWT:()=>uf,ZodKSUID:()=>ef,ZodLazy:()=>kb,ZodLiteral:()=>ab,ZodMAC:()=>My,ZodMap:()=>ib,ZodNaN:()=>wb,ZodNanoID:()=>Gd,ZodNever:()=>Gy,ZodNonOptional:()=>gf,ZodNull:()=>Vy,ZodNullable:()=>fb,ZodNumber:()=>Wi,ZodNumberFormat:()=>$o,ZodObject:()=>oc,ZodOptional:()=>mf,ZodPipe:()=>_f,ZodPrefault:()=>mb,ZodPromise:()=>zb,ZodReadonly:()=>xb,ZodRecord:()=>sc,ZodSet:()=>sb,ZodString:()=>Bi,ZodStringFormat:()=>pe,ZodSuccess:()=>vb,ZodSymbol:()=>qy,ZodTemplateLiteral:()=>$b,ZodTransform:()=>ub,ZodTuple:()=>rb,ZodType:()=>G,ZodULID:()=>Xd,ZodURL:()=>tc,ZodUUID:()=>zr,ZodUndefined:()=>By,ZodUnion:()=>ic,ZodUnknown:()=>Jy,ZodVoid:()=>Ky,ZodXID:()=>Qd,ZodXor:()=>Xy,_ZodString:()=>Wd,_default:()=>hb,_function:()=>XI,any:()=>PI,array:()=>nc,base64:()=>pI,base64url:()=>hI,bigint:()=>kI,boolean:()=>Fy,catch:()=>bb,check:()=>QI,cidrv4:()=>dI,cidrv6:()=>fI,codec:()=>GI,cuid:()=>nI,cuid2:()=>oI,custom:()=>eP,date:()=>RI,describe:()=>tP,discriminatedUnion:()=>UI,e164:()=>mI,email:()=>HT,emoji:()=>tI,enum:()=>pf,exactOptional:()=>db,file:()=>VI,float32:()=>wI,float64:()=>xI,function:()=>XI,guid:()=>JT,hash:()=>bI,hex:()=>yI,hostname:()=>vI,httpUrl:()=>eI,instanceof:()=>nP,int:()=>Vd,int32:()=>SI,int64:()=>EI,intersection:()=>tb,ipv4:()=>cI,ipv6:()=>lI,json:()=>iP,jwt:()=>gI,keyof:()=>CI,ksuid:()=>aI,lazy:()=>Eb,literal:()=>BI,looseObject:()=>DI,looseRecord:()=>MI,mac:()=>uI,map:()=>ZI,meta:()=>rP,nan:()=>JI,nanoid:()=>rI,nativeEnum:()=>qI,never:()=>df,nonoptional:()=>_b,null:()=>Wy,nullable:()=>Qa,nullish:()=>WI,number:()=>Zy,object:()=>AI,optional:()=>Xa,partialRecord:()=>LI,pipe:()=>ec,prefault:()=>gb,preprocess:()=>sP,promise:()=>YI,readonly:()=>Sb,record:()=>ob,refine:()=>Ib,set:()=>FI,strictObject:()=>NI,string:()=>Bd,stringFormat:()=>_I,stringbool:()=>oP,success:()=>HI,superRefine:()=>Pb,symbol:()=>TI,templateLiteral:()=>KI,transform:()=>hf,tuple:()=>nb,uint32:()=>$I,uint64:()=>zI,ulid:()=>iI,undefined:()=>II,union:()=>ff,unknown:()=>So,url:()=>QT,uuid:()=>GT,uuidv4:()=>KT,uuidv6:()=>YT,uuidv7:()=>XT,void:()=>OI,xid:()=>sI,xor:()=>jI});var Ld={};Zt(Ld,{endsWith:()=>Ci,gt:()=>kr,gte:()=>ht,includes:()=>Oi,length:()=>xo,lowercase:()=>Ii,lt:()=>$r,lte:()=>At,maxLength:()=>wo,maxSize:()=>Rn,mime:()=>Ai,minLength:()=>Jr,minSize:()=>Er,multipleOf:()=>On,negative:()=>Pd,nonnegative:()=>Rd,nonpositive:()=>Od,normalize:()=>Ni,overwrite:()=>ur,positive:()=>Id,property:()=>Cd,regex:()=>Ti,size:()=>bo,slugify:()=>Li,startsWith:()=>Ri,toLowerCase:()=>ji,toUpperCase:()=>Ui,trim:()=>Di,uppercase:()=>Pi});var Fi={};Zt(Fi,{ZodISODate:()=>Zd,ZodISODateTime:()=>Md,ZodISODuration:()=>qd,ZodISOTime:()=>Fd,date:()=>ky,datetime:()=>$y,duration:()=>zy,time:()=>Ey});var Md=$("ZodISODateTime",(e,t)=>{t_.init(e,t),pe.init(e,t)});function $y(e){return iv(Md,e)}var Zd=$("ZodISODate",(e,t)=>{r_.init(e,t),pe.init(e,t)});function ky(e){return sv(Zd,e)}var Fd=$("ZodISOTime",(e,t)=>{n_.init(e,t),pe.init(e,t)});function Ey(e){return av(Fd,e)}var qd=$("ZodISODuration",(e,t)=>{o_.init(e,t),pe.init(e,t)});function zy(e){return cv(qd,e)}var WT=(e,t)=>{ja.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>La(e,r)},flatten:{value:r=>Ua(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,yi,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,yi,2)}},isEmpty:{get(){return e.issues.length===0}}})},oV=$("ZodError",WT),$t=$("ZodError",WT,{Parent:Error});var Ty=xi($t),Iy=Si($t),Py=$i($t),Oy=ki($t),Ry=jl($t),Cy=Ul($t),Ay=Ll($t),Ny=Ml($t),Dy=Zl($t),jy=Fl($t),Uy=ql($t),Ly=Bl($t);var G=$("ZodType",(e,t)=>(H.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Zi(e,"input"),output:Zi(e,"output")}}),e.toJSONSchema=Mv(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone(R.mergeDefs(t,{checks:[...t.checks??[],...r.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]}),{parent:!0}),e.with=e.check,e.clone=(r,o)=>pt(e,r,o),e.brand=()=>e,e.register=((r,o)=>(r.add(e,o),e)),e.parse=(r,o)=>Ty(e,r,o,{callee:e.parse}),e.safeParse=(r,o)=>Py(e,r,o),e.parseAsync=async(r,o)=>Iy(e,r,o,{callee:e.parseAsync}),e.safeParseAsync=async(r,o)=>Oy(e,r,o),e.spa=e.safeParseAsync,e.encode=(r,o)=>Ry(e,r,o),e.decode=(r,o)=>Cy(e,r,o),e.encodeAsync=async(r,o)=>Ay(e,r,o),e.decodeAsync=async(r,o)=>Ny(e,r,o),e.safeEncode=(r,o)=>Dy(e,r,o),e.safeDecode=(r,o)=>jy(e,r,o),e.safeEncodeAsync=async(r,o)=>Uy(e,r,o),e.safeDecodeAsync=async(r,o)=>Ly(e,r,o),e.refine=(r,o)=>e.check(Ib(r,o)),e.superRefine=r=>e.check(Pb(r)),e.overwrite=r=>e.check(ur(r)),e.optional=()=>Xa(e),e.exactOptional=()=>db(e),e.nullable=()=>Qa(e),e.nullish=()=>Xa(Qa(e)),e.nonoptional=r=>_b(e,r),e.array=()=>nc(e),e.or=r=>ff([e,r]),e.and=r=>tb(e,r),e.transform=r=>ec(e,hf(r)),e.default=r=>hb(e,r),e.prefault=r=>gb(e,r),e.catch=r=>bb(e,r),e.pipe=r=>ec(e,r),e.readonly=()=>Sb(e),e.describe=r=>{let o=e.clone();return Ge.add(o,{description:r}),o},Object.defineProperty(e,"description",{get(){return Ge.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return Ge.get(e);let o=e.clone();return Ge.add(o,r[0]),o},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=r=>r(e),e)),Wd=$("_ZodString",(e,t)=>{yo.init(e,t),G.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Zv(e,o,n,i);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...o)=>e.check(Ti(...o)),e.includes=(...o)=>e.check(Oi(...o)),e.startsWith=(...o)=>e.check(Ri(...o)),e.endsWith=(...o)=>e.check(Ci(...o)),e.min=(...o)=>e.check(Jr(...o)),e.max=(...o)=>e.check(wo(...o)),e.length=(...o)=>e.check(xo(...o)),e.nonempty=(...o)=>e.check(Jr(1,...o)),e.lowercase=o=>e.check(Ii(o)),e.uppercase=o=>e.check(Pi(o)),e.trim=()=>e.check(Di()),e.normalize=(...o)=>e.check(Ni(...o)),e.toLowerCase=()=>e.check(ji()),e.toUpperCase=()=>e.check(Ui()),e.slugify=()=>e.check(Li())}),Bi=$("ZodString",(e,t)=>{yo.init(e,t),Wd.init(e,t),e.email=r=>e.check(ud(Hd,r)),e.url=r=>e.check(Ga(tc,r)),e.jwt=r=>e.check(Td(uf,r)),e.emoji=r=>e.check(hd(Jd,r)),e.guid=r=>e.check(Ja(Ya,r)),e.uuid=r=>e.check(ld(zr,r)),e.uuidv4=r=>e.check(dd(zr,r)),e.uuidv6=r=>e.check(fd(zr,r)),e.uuidv7=r=>e.check(pd(zr,r)),e.nanoid=r=>e.check(md(Gd,r)),e.guid=r=>e.check(Ja(Ya,r)),e.cuid=r=>e.check(gd(Kd,r)),e.cuid2=r=>e.check(_d(Yd,r)),e.ulid=r=>e.check(vd(Xd,r)),e.base64=r=>e.check(kd(sf,r)),e.base64url=r=>e.check(Ed(af,r)),e.xid=r=>e.check(yd(Qd,r)),e.ksuid=r=>e.check(bd(ef,r)),e.ipv4=r=>e.check(wd(tf,r)),e.ipv6=r=>e.check(xd(rf,r)),e.cidrv4=r=>e.check(Sd(nf,r)),e.cidrv6=r=>e.check($d(of,r)),e.e164=r=>e.check(zd(cf,r)),e.datetime=r=>e.check($y(r)),e.date=r=>e.check(ky(r)),e.time=r=>e.check(Ey(r)),e.duration=r=>e.check(zy(r))});function Bd(e){return tv(Bi,e)}var pe=$("ZodStringFormat",(e,t)=>{fe.init(e,t),Wd.init(e,t)}),Hd=$("ZodEmail",(e,t)=>{Wg.init(e,t),pe.init(e,t)});function HT(e){return ud(Hd,e)}var Ya=$("ZodGUID",(e,t)=>{Bg.init(e,t),pe.init(e,t)});function JT(e){return Ja(Ya,e)}var zr=$("ZodUUID",(e,t)=>{Vg.init(e,t),pe.init(e,t)});function GT(e){return ld(zr,e)}function KT(e){return dd(zr,e)}function YT(e){return fd(zr,e)}function XT(e){return pd(zr,e)}var tc=$("ZodURL",(e,t)=>{Hg.init(e,t),pe.init(e,t)});function QT(e){return Ga(tc,e)}function eI(e){return Ga(tc,{protocol:/^https?$/,hostname:Vt.domain,...R.normalizeParams(e)})}var Jd=$("ZodEmoji",(e,t)=>{Jg.init(e,t),pe.init(e,t)});function tI(e){return hd(Jd,e)}var Gd=$("ZodNanoID",(e,t)=>{Gg.init(e,t),pe.init(e,t)});function rI(e){return md(Gd,e)}var Kd=$("ZodCUID",(e,t)=>{Kg.init(e,t),pe.init(e,t)});function nI(e){return gd(Kd,e)}var Yd=$("ZodCUID2",(e,t)=>{Yg.init(e,t),pe.init(e,t)});function oI(e){return _d(Yd,e)}var Xd=$("ZodULID",(e,t)=>{Xg.init(e,t),pe.init(e,t)});function iI(e){return vd(Xd,e)}var Qd=$("ZodXID",(e,t)=>{Qg.init(e,t),pe.init(e,t)});function sI(e){return yd(Qd,e)}var ef=$("ZodKSUID",(e,t)=>{e_.init(e,t),pe.init(e,t)});function aI(e){return bd(ef,e)}var tf=$("ZodIPv4",(e,t)=>{i_.init(e,t),pe.init(e,t)});function cI(e){return wd(tf,e)}var My=$("ZodMAC",(e,t)=>{a_.init(e,t),pe.init(e,t)});function uI(e){return nv(My,e)}var rf=$("ZodIPv6",(e,t)=>{s_.init(e,t),pe.init(e,t)});function lI(e){return xd(rf,e)}var nf=$("ZodCIDRv4",(e,t)=>{c_.init(e,t),pe.init(e,t)});function dI(e){return Sd(nf,e)}var of=$("ZodCIDRv6",(e,t)=>{u_.init(e,t),pe.init(e,t)});function fI(e){return $d(of,e)}var sf=$("ZodBase64",(e,t)=>{d_.init(e,t),pe.init(e,t)});function pI(e){return kd(sf,e)}var af=$("ZodBase64URL",(e,t)=>{f_.init(e,t),pe.init(e,t)});function hI(e){return Ed(af,e)}var cf=$("ZodE164",(e,t)=>{p_.init(e,t),pe.init(e,t)});function mI(e){return zd(cf,e)}var uf=$("ZodJWT",(e,t)=>{h_.init(e,t),pe.init(e,t)});function gI(e){return Td(uf,e)}var Vi=$("ZodCustomStringFormat",(e,t)=>{m_.init(e,t),pe.init(e,t)});function _I(e,t,r={}){return Mi(Vi,e,t,r)}function vI(e){return Mi(Vi,"hostname",Vt.hostname,e)}function yI(e){return Mi(Vi,"hex",Vt.hex,e)}function bI(e,t){let r=t?.enc??"hex",o=`${e}_${r}`,n=Vt[o];if(!n)throw new Error(`Unrecognized hash format: ${o}`);return Mi(Vi,o,n,t)}var Wi=$("ZodNumber",(e,t)=>{ed.init(e,t),G.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Fv(e,o,n,i),e.gt=(o,n)=>e.check(kr(o,n)),e.gte=(o,n)=>e.check(ht(o,n)),e.min=(o,n)=>e.check(ht(o,n)),e.lt=(o,n)=>e.check($r(o,n)),e.lte=(o,n)=>e.check(At(o,n)),e.max=(o,n)=>e.check(At(o,n)),e.int=o=>e.check(Vd(o)),e.safe=o=>e.check(Vd(o)),e.positive=o=>e.check(kr(0,o)),e.nonnegative=o=>e.check(ht(0,o)),e.negative=o=>e.check($r(0,o)),e.nonpositive=o=>e.check(At(0,o)),e.multipleOf=(o,n)=>e.check(On(o,n)),e.step=(o,n)=>e.check(On(o,n)),e.finite=()=>e;let r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function Zy(e){return uv(Wi,e)}var $o=$("ZodNumberFormat",(e,t)=>{g_.init(e,t),Wi.init(e,t)});function Vd(e){return dv($o,e)}function wI(e){return fv($o,e)}function xI(e){return pv($o,e)}function SI(e){return hv($o,e)}function $I(e){return mv($o,e)}var Hi=$("ZodBoolean",(e,t)=>{qa.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>qv(e,r,o,n)});function Fy(e){return gv(Hi,e)}var Ji=$("ZodBigInt",(e,t)=>{td.init(e,t),G.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Bv(e,o,n,i),e.gte=(o,n)=>e.check(ht(o,n)),e.min=(o,n)=>e.check(ht(o,n)),e.gt=(o,n)=>e.check(kr(o,n)),e.gte=(o,n)=>e.check(ht(o,n)),e.min=(o,n)=>e.check(ht(o,n)),e.lt=(o,n)=>e.check($r(o,n)),e.lte=(o,n)=>e.check(At(o,n)),e.max=(o,n)=>e.check(At(o,n)),e.positive=o=>e.check(kr(BigInt(0),o)),e.negative=o=>e.check($r(BigInt(0),o)),e.nonpositive=o=>e.check(At(BigInt(0),o)),e.nonnegative=o=>e.check(ht(BigInt(0),o)),e.multipleOf=(o,n)=>e.check(On(o,n));let r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null});function kI(e){return vv(Ji,e)}var lf=$("ZodBigIntFormat",(e,t)=>{__.init(e,t),Ji.init(e,t)});function EI(e){return bv(lf,e)}function zI(e){return wv(lf,e)}var qy=$("ZodSymbol",(e,t)=>{v_.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Vv(e,r,o,n)});function TI(e){return xv(qy,e)}var By=$("ZodUndefined",(e,t)=>{y_.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Hv(e,r,o,n)});function II(e){return Sv(By,e)}var Vy=$("ZodNull",(e,t)=>{b_.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Wv(e,r,o,n)});function Wy(e){return $v(Vy,e)}var Hy=$("ZodAny",(e,t)=>{w_.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Kv(e,r,o,n)});function PI(){return kv(Hy)}var Jy=$("ZodUnknown",(e,t)=>{x_.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Yv(e,r,o,n)});function So(){return Ev(Jy)}var Gy=$("ZodNever",(e,t)=>{S_.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Gv(e,r,o,n)});function df(e){return zv(Gy,e)}var Ky=$("ZodVoid",(e,t)=>{$_.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Jv(e,r,o,n)});function OI(e){return Tv(Ky,e)}var rc=$("ZodDate",(e,t)=>{k_.init(e,t),G.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Xv(e,o,n,i),e.min=(o,n)=>e.check(ht(o,n)),e.max=(o,n)=>e.check(At(o,n));let r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null});function RI(e){return Iv(rc,e)}var Yy=$("ZodArray",(e,t)=>{E_.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ly(e,r,o,n),e.element=t.element,e.min=(r,o)=>e.check(Jr(r,o)),e.nonempty=r=>e.check(Jr(1,r)),e.max=(r,o)=>e.check(wo(r,o)),e.length=(r,o)=>e.check(xo(r,o)),e.unwrap=()=>e.element});function nc(e,t){return Rv(Yy,e,t)}function CI(e){let t=e._zod.def.shape;return pf(Object.keys(t))}var oc=$("ZodObject",(e,t)=>{z_.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>dy(e,r,o,n),R.defineLazy(e,"shape",()=>t.shape),e.keyof=()=>pf(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:So()}),e.loose=()=>e.clone({...e._zod.def,catchall:So()}),e.strict=()=>e.clone({...e._zod.def,catchall:df()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>R.extend(e,r),e.safeExtend=r=>R.safeExtend(e,r),e.merge=r=>R.merge(e,r),e.pick=r=>R.pick(e,r),e.omit=r=>R.omit(e,r),e.partial=(...r)=>R.partial(mf,e,r[0]),e.required=(...r)=>R.required(gf,e,r[0])});function AI(e,t){let r={type:"object",shape:e??{},...R.normalizeParams(t)};return new oc(r)}function NI(e,t){return new oc({type:"object",shape:e,catchall:df(),...R.normalizeParams(t)})}function DI(e,t){return new oc({type:"object",shape:e,catchall:So(),...R.normalizeParams(t)})}var ic=$("ZodUnion",(e,t)=>{Ba.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Nd(e,r,o,n),e.options=t.options});function ff(e,t){return new ic({type:"union",options:e,...R.normalizeParams(t)})}var Xy=$("ZodXor",(e,t)=>{ic.init(e,t),T_.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Nd(e,r,o,n),e.options=t.options});function jI(e,t){return new Xy({type:"union",options:e,inclusive:!1,...R.normalizeParams(t)})}var Qy=$("ZodDiscriminatedUnion",(e,t)=>{ic.init(e,t),I_.init(e,t)});function UI(e,t,r){return new Qy({type:"union",options:t,discriminator:e,...R.normalizeParams(r)})}var eb=$("ZodIntersection",(e,t)=>{P_.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>fy(e,r,o,n)});function tb(e,t){return new eb({type:"intersection",left:e,right:t})}var rb=$("ZodTuple",(e,t)=>{rd.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>py(e,r,o,n),e.rest=r=>e.clone({...e._zod.def,rest:r})});function nb(e,t,r){let o=t instanceof H,n=o?r:t,i=o?t:null;return new rb({type:"tuple",items:e,rest:i,...R.normalizeParams(n)})}var sc=$("ZodRecord",(e,t)=>{O_.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>hy(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType});function ob(e,t,r){return new sc({type:"record",keyType:e,valueType:t,...R.normalizeParams(r)})}function LI(e,t,r){let o=pt(e);return o._zod.values=void 0,new sc({type:"record",keyType:o,valueType:t,...R.normalizeParams(r)})}function MI(e,t,r){return new sc({type:"record",keyType:e,valueType:t,mode:"loose",...R.normalizeParams(r)})}var ib=$("ZodMap",(e,t)=>{R_.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>cy(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...r)=>e.check(Er(...r)),e.nonempty=r=>e.check(Er(1,r)),e.max=(...r)=>e.check(Rn(...r)),e.size=(...r)=>e.check(bo(...r))});function ZI(e,t,r){return new ib({type:"map",keyType:e,valueType:t,...R.normalizeParams(r)})}var sb=$("ZodSet",(e,t)=>{C_.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>uy(e,r,o,n),e.min=(...r)=>e.check(Er(...r)),e.nonempty=r=>e.check(Er(1,r)),e.max=(...r)=>e.check(Rn(...r)),e.size=(...r)=>e.check(bo(...r))});function FI(e,t){return new sb({type:"set",valueType:e,...R.normalizeParams(t)})}var qi=$("ZodEnum",(e,t)=>{A_.init(e,t),G.init(e,t),e._zod.processJSONSchema=(o,n,i)=>Qv(e,o,n,i),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(o,n)=>{let i={};for(let s of o)if(r.has(s))i[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new qi({...t,checks:[],...R.normalizeParams(n),entries:i})},e.exclude=(o,n)=>{let i={...t.entries};for(let s of o)if(r.has(s))delete i[s];else throw new Error(`Key ${s} not found in enum`);return new qi({...t,checks:[],...R.normalizeParams(n),entries:i})}});function pf(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new qi({type:"enum",entries:r,...R.normalizeParams(t)})}function qI(e,t){return new qi({type:"enum",entries:e,...R.normalizeParams(t)})}var ab=$("ZodLiteral",(e,t)=>{N_.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ey(e,r,o,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function BI(e,t){return new ab({type:"literal",values:Array.isArray(e)?e:[e],...R.normalizeParams(t)})}var cb=$("ZodFile",(e,t)=>{D_.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ny(e,r,o,n),e.min=(r,o)=>e.check(Er(r,o)),e.max=(r,o)=>e.check(Rn(r,o)),e.mime=(r,o)=>e.check(Ai(Array.isArray(r)?r:[r],o))});function VI(e){return Cv(cb,e)}var ub=$("ZodTransform",(e,t)=>{j_.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ay(e,r,o,n),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new En(e.constructor.name);r.addIssue=i=>{if(typeof i=="string")r.issues.push(R.issue(i,r.value,t));else{let s=i;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=e),r.issues.push(R.issue(s))}};let n=t.transform(r.value,r);return n instanceof Promise?n.then(i=>(r.value=i,r)):(r.value=n,r)}});function hf(e){return new ub({type:"transform",transform:e})}var mf=$("ZodOptional",(e,t)=>{nd.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Dd(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Xa(e){return new mf({type:"optional",innerType:e})}var lb=$("ZodExactOptional",(e,t)=>{U_.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Dd(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function db(e){return new lb({type:"optional",innerType:e})}var fb=$("ZodNullable",(e,t)=>{L_.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>my(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Qa(e){return new fb({type:"nullable",innerType:e})}function WI(e){return Xa(Qa(e))}var pb=$("ZodDefault",(e,t)=>{M_.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>_y(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function hb(e,t){return new pb({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():R.shallowClone(t)}})}var mb=$("ZodPrefault",(e,t)=>{Z_.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>vy(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function gb(e,t){return new mb({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():R.shallowClone(t)}})}var gf=$("ZodNonOptional",(e,t)=>{F_.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>gy(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function _b(e,t){return new gf({type:"nonoptional",innerType:e,...R.normalizeParams(t)})}var vb=$("ZodSuccess",(e,t)=>{q_.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>oy(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function HI(e){return new vb({type:"success",innerType:e})}var yb=$("ZodCatch",(e,t)=>{B_.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>yy(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function bb(e,t){return new yb({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}var wb=$("ZodNaN",(e,t)=>{V_.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ty(e,r,o,n)});function JI(e){return Ov(wb,e)}var _f=$("ZodPipe",(e,t)=>{W_.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>by(e,r,o,n),e.in=t.in,e.out=t.out});function ec(e,t){return new _f({type:"pipe",in:e,out:t})}var vf=$("ZodCodec",(e,t)=>{_f.init(e,t),Va.init(e,t)});function GI(e,t,r){return new vf({type:"pipe",in:e,out:t,transform:r.decode,reverseTransform:r.encode})}var xb=$("ZodReadonly",(e,t)=>{H_.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>wy(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Sb(e){return new xb({type:"readonly",innerType:e})}var $b=$("ZodTemplateLiteral",(e,t)=>{J_.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ry(e,r,o,n)});function KI(e,t){return new $b({type:"template_literal",parts:e,...R.normalizeParams(t)})}var kb=$("ZodLazy",(e,t)=>{Y_.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Sy(e,r,o,n),e.unwrap=()=>e._zod.def.getter()});function Eb(e){return new kb({type:"lazy",getter:e})}var zb=$("ZodPromise",(e,t)=>{K_.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>xy(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function YI(e){return new zb({type:"promise",innerType:e})}var Tb=$("ZodFunction",(e,t)=>{G_.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>sy(e,r,o,n)});function XI(e){return new Tb({type:"function",input:Array.isArray(e?.input)?nb(e?.input):e?.input??nc(So()),output:e?.output??So()})}var ac=$("ZodCustom",(e,t)=>{X_.init(e,t),G.init(e,t),e._zod.processJSONSchema=(r,o,n)=>iy(e,r,o,n)});function QI(e){let t=new ge({check:"custom"});return t._zod.check=e,t}function eP(e,t){return Av(ac,e??(()=>!0),t)}function Ib(e,t={}){return Nv(ac,e,t)}function Pb(e){return Dv(e)}var tP=jv,rP=Uv;function nP(e,t={}){let r=new ac({type:"custom",check:"custom",fn:o=>o instanceof e,abort:!0,...R.normalizeParams(t)});return r._zod.bag.Class=e,r._zod.check=o=>{o.value instanceof e||o.issues.push({code:"invalid_type",expected:e.name,input:o.value,inst:r,path:[...r._zod.def.path??[]]})},r}var oP=(...e)=>Lv({Codec:vf,Boolean:Hi,String:Bi},...e);function iP(e){let t=Eb(()=>ff([Bd(e),Zy(),Fy(),Wy(),nc(t),ob(Bd(),t)]));return t}function sP(e,t){return ec(hf(e),t)}var sV={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function aV(e){Ne({customError:e})}function cV(){return Ne().customError}var Ob;Ob||(Ob={});var L={...Ka,...Ld,iso:Fi},uV=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function lV(e,t){let r=e.$schema;return r==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":r==="http://json-schema.org/draft-07/schema#"?"draft-7":r==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}function dV(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=e.slice(1).split("/").filter(Boolean);if(r.length===0)return t.rootSchema;let o=t.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===o){let n=r[1];if(!n||!t.defs[n])throw new Error(`Reference not found: ${e}`);return t.defs[n]}throw new Error(`Reference not found: ${e}`)}function aP(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return L.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let n=e.$ref;if(t.refs.has(n))return t.refs.get(n);if(t.processing.has(n))return L.lazy(()=>{if(!t.refs.has(n))throw new Error(`Circular reference not resolved: ${n}`);return t.refs.get(n)});t.processing.add(n);let i=dV(n,t),s=st(i,t);return t.refs.set(n,s),t.processing.delete(n),s}if(e.enum!==void 0){let n=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&n.length===1&&n[0]===null)return L.null();if(n.length===0)return L.never();if(n.length===1)return L.literal(n[0]);if(n.every(s=>typeof s=="string"))return L.enum(n);let i=n.map(s=>L.literal(s));return i.length<2?i[0]:L.union([i[0],i[1],...i.slice(2)])}if(e.const!==void 0)return L.literal(e.const);let r=e.type;if(Array.isArray(r)){let n=r.map(i=>{let s={...e,type:i};return aP(s,t)});return n.length===0?L.never():n.length===1?n[0]:L.union(n)}if(!r)return L.any();let o;switch(r){case"string":{let n=L.string();if(e.format){let i=e.format;i==="email"?n=n.check(L.email()):i==="uri"||i==="uri-reference"?n=n.check(L.url()):i==="uuid"||i==="guid"?n=n.check(L.uuid()):i==="date-time"?n=n.check(L.iso.datetime()):i==="date"?n=n.check(L.iso.date()):i==="time"?n=n.check(L.iso.time()):i==="duration"?n=n.check(L.iso.duration()):i==="ipv4"?n=n.check(L.ipv4()):i==="ipv6"?n=n.check(L.ipv6()):i==="mac"?n=n.check(L.mac()):i==="cidr"?n=n.check(L.cidrv4()):i==="cidr-v6"?n=n.check(L.cidrv6()):i==="base64"?n=n.check(L.base64()):i==="base64url"?n=n.check(L.base64url()):i==="e164"?n=n.check(L.e164()):i==="jwt"?n=n.check(L.jwt()):i==="emoji"?n=n.check(L.emoji()):i==="nanoid"?n=n.check(L.nanoid()):i==="cuid"?n=n.check(L.cuid()):i==="cuid2"?n=n.check(L.cuid2()):i==="ulid"?n=n.check(L.ulid()):i==="xid"?n=n.check(L.xid()):i==="ksuid"&&(n=n.check(L.ksuid()))}typeof e.minLength=="number"&&(n=n.min(e.minLength)),typeof e.maxLength=="number"&&(n=n.max(e.maxLength)),e.pattern&&(n=n.regex(new RegExp(e.pattern))),o=n;break}case"number":case"integer":{let n=r==="integer"?L.number().int():L.number();typeof e.minimum=="number"&&(n=n.min(e.minimum)),typeof e.maximum=="number"&&(n=n.max(e.maximum)),typeof e.exclusiveMinimum=="number"?n=n.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(n=n.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?n=n.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(n=n.lt(e.maximum)),typeof e.multipleOf=="number"&&(n=n.multipleOf(e.multipleOf)),o=n;break}case"boolean":{o=L.boolean();break}case"null":{o=L.null();break}case"object":{let n={},i=e.properties||{},s=new Set(e.required||[]);for(let[u,c]of Object.entries(i)){let l=st(c,t);n[u]=s.has(u)?l:l.optional()}if(e.propertyNames){let u=st(e.propertyNames,t),c=e.additionalProperties&&typeof e.additionalProperties=="object"?st(e.additionalProperties,t):L.any();if(Object.keys(n).length===0){o=L.record(u,c);break}let l=L.object(n).passthrough(),f=L.looseRecord(u,c);o=L.intersection(l,f);break}if(e.patternProperties){let u=e.patternProperties,c=Object.keys(u),l=[];for(let p of c){let h=st(u[p],t),m=L.string().regex(new RegExp(p));l.push(L.looseRecord(m,h))}let f=[];if(Object.keys(n).length>0&&f.push(L.object(n).passthrough()),f.push(...l),f.length===0)o=L.object({}).passthrough();else if(f.length===1)o=f[0];else{let p=L.intersection(f[0],f[1]);for(let h=2;h<f.length;h++)p=L.intersection(p,f[h]);o=p}break}let a=L.object(n);e.additionalProperties===!1?o=a.strict():typeof e.additionalProperties=="object"?o=a.catchall(st(e.additionalProperties,t)):o=a.passthrough();break}case"array":{let n=e.prefixItems,i=e.items;if(n&&Array.isArray(n)){let s=n.map(u=>st(u,t)),a=i&&typeof i=="object"&&!Array.isArray(i)?st(i,t):void 0;a?o=L.tuple(s).rest(a):o=L.tuple(s),typeof e.minItems=="number"&&(o=o.check(L.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(L.maxLength(e.maxItems)))}else if(Array.isArray(i)){let s=i.map(u=>st(u,t)),a=e.additionalItems&&typeof e.additionalItems=="object"?st(e.additionalItems,t):void 0;a?o=L.tuple(s).rest(a):o=L.tuple(s),typeof e.minItems=="number"&&(o=o.check(L.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(L.maxLength(e.maxItems)))}else if(i!==void 0){let s=st(i,t),a=L.array(s);typeof e.minItems=="number"&&(a=a.min(e.minItems)),typeof e.maxItems=="number"&&(a=a.max(e.maxItems)),o=a}else o=L.array(L.any());break}default:throw new Error(`Unsupported type: ${r}`)}return e.description&&(o=o.describe(e.description)),e.default!==void 0&&(o=o.default(e.default)),o}function st(e,t){if(typeof e=="boolean")return e?L.any():L.never();let r=aP(e,t),o=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let a=e.anyOf.map(c=>st(c,t)),u=L.union(a);r=o?L.intersection(r,u):u}if(e.oneOf&&Array.isArray(e.oneOf)){let a=e.oneOf.map(c=>st(c,t)),u=L.xor(a);r=o?L.intersection(r,u):u}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)r=o?r:L.any();else{let a=o?r:st(e.allOf[0],t),u=o?0:1;for(let c=u;c<e.allOf.length;c++)a=L.intersection(a,st(e.allOf[c],t));r=a}e.nullable===!0&&t.version==="openapi-3.0"&&(r=L.nullable(r)),e.readOnly===!0&&(r=L.readonly(r));let n={},i=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let a of i)a in e&&(n[a]=e[a]);let s=["contentEncoding","contentMediaType","contentSchema"];for(let a of s)a in e&&(n[a]=e[a]);for(let a of Object.keys(e))uV.has(a)||(n[a]=e[a]);return Object.keys(n).length>0&&t.registry.add(r,n),r}function cP(e,t){if(typeof e=="boolean")return e?L.any():L.never();let r=lV(e,t?.defaultTarget),o=e.$defs||e.definitions||{},n={version:r,defs:o,refs:new Map,processing:new Set,rootSchema:e,registry:t?.registry??Ge};return st(e,n)}var Rb={};Zt(Rb,{bigint:()=>mV,boolean:()=>hV,date:()=>gV,number:()=>pV,string:()=>fV});function fV(e){return rv(Bi,e)}function pV(e){return lv(Wi,e)}function hV(e){return _v(Hi,e)}function mV(e){return yv(Ji,e)}function gV(e){return Pv(rc,e)}Ne(od());var uP=d.enum(["network","computer_unreachable","platform","provider","timeout","transport","unknown","limit","billing"]),_V="octavus.error";function vV(e){if(!(e instanceof Error))return!1;let t=e;return t.__octavusErrorMarker===_V&&typeof t.errorType=="string"&&typeof t.source=="string"}function yf(e){if(!(e instanceof Error))return typeof e=="string"?e:"Unknown error";let t=e.message||e.name||"Error",r=new Set([e]),o=e.cause,n=0;for(;o instanceof Error&&!r.has(o)&&n<3;){r.add(o);let i=o.message?.trim();i&&!t.includes(i)&&(t=`${t}: ${i}`),o=o.cause,n+=1}return t}var yV=["terminated","fetch failed","socket hang up","other side closed","connection closed","econnreset","econnrefused","epipe","etimedout","enotfound","eai_again","und_err_socket","und_err_connect_timeout","und_err_headers_timeout","und_err_body_timeout"];function bV(e){let t=e;for(let r=0;r<5&&!(typeof t!="object"||t===null);r++){let o=t,n=`${typeof o.message=="string"?o.message:""} ${typeof o.code=="string"?o.code:""}`.toLowerCase();if(yV.some(i=>n.includes(i)))return!0;t=o.cause}return!1}function lP(e,t){let r=typeof e?.message=="string"?e.message:"Session ended unexpectedly",o=typeof e?.source=="string"?e.source:void 0,n=typeof e?.errorType=="string"?e.errorType:void 0;return{status:"failed",error:r,errorType:dP(o,n,r),title:t??void 0,retryable:$V(e)}}var wV=new Set(["rate_limit_error","provider_overloaded","provider_timeout","provider_error"]),xV=new Set(["PROVIDER_ACCOUNT_ERROR","FILE_DOWNLOAD_ERROR","FILE_DOWNLOAD_TIMEOUT","NETWORK_ERROR"]),SV=new Set(["CONTENT_FILTER","CONTEXT_OVERFLOW"]);function $V(e){if(!e)return!1;let t=typeof e.errorType=="string"?e.errorType:void 0,r=typeof e.code=="string"?e.code:void 0;return r!==void 0&&SV.has(r)?!1:!!(t!==void 0&&wV.has(t)||r!==void 0&&xV.has(r))}function bf(e){return vV(e)?dP(e.source,e.errorType,e.message):typeof e=="string"?Cb(e):e instanceof Error?bV(e)?"transport":Cb(e.message):"unknown"}function dP(e,t,r){if(t==="quota_exceeded_error")return"billing";if(e==="provider")return"provider";if(typeof t=="string"){if(t==="rate_limit_error"||t==="provider_error"||t==="provider_overloaded")return"provider";if(t==="provider_timeout")return"timeout"}return Cb(r)}function Cb(e){let t=zV(e);if(t.errorType)return t.errorType;let r=e.toLowerCase();return r.includes("fetch failed")||r.includes("econnrefused")||r.includes("econnreset")||r.includes("socket hang up")||r.includes("network request failed")?"network":r.includes("timed out")||r.includes("timeout")?"timeout":"platform"}var kV=/^\[([a-z_]+)\] /,EV=new Set(uP.options);function zV(e){let t=kV.exec(e);return t&&EV.has(t[1])?{errorType:t[1],message:e.slice(t[0].length)}:{errorType:null,message:e}}var TV=d.object({type:d.literal("sync"),octoAgentIds:d.array(d.string().min(1)),activeSessionIds:d.array(d.string().min(1)).optional()}),IV=d.object({type:d.literal("session-event"),sessionId:d.string().min(1),event:d.record(d.string(),d.unknown()),seq:d.number().int().optional()}),PV=d.object({type:d.literal("session-started"),sessionId:d.string().min(1)}),OV=d.object({type:d.literal("session-complete"),sessionId:d.string().min(1),status:d.enum(["completed","failed"]),error:d.string().optional(),errorType:uP.optional(),title:d.string().optional()}),RV=d.object({type:d.literal("session-state"),sessionId:d.string().min(1),events:d.array(d.record(d.string(),d.unknown())),lastSeq:d.number().int()}),CV=d.object({type:d.literal("dispatch-ack"),sessionId:d.string().min(1)}),AV=d.object({type:d.literal("session-title"),sessionId:d.string().min(1),title:d.string().min(1)}),NV=d.enum(["transport-drop","network-error","provider-error"]),DV=d.object({type:d.literal("session-retry"),sessionId:d.string().min(1),attempt:d.number().int().positive(),reason:NV,delayMs:d.number().int().nonnegative()}),jV=d.object({type:d.literal("heartbeat")}),Ufe=d.discriminatedUnion("type",[TV,IV,PV,OV,AV,DV,RV,CV,jV]),UV=d.object({namespace:d.string().min(1),name:d.string().min(1),description:d.string(),command:d.string().min(1),args:d.array(d.string()),env:d.record(d.string(),d.string()),connection:d.enum(["eager","lazy"])}),LV=d.object({slug:d.string().min(1),bundleUrl:d.string().min(1),bundleSha256:d.string().optional(),secrets:d.record(d.string(),d.string())}),MV=d.object({id:d.string().optional(),name:d.string().optional(),image:d.string().optional()}),ZV=d.object({type:d.literal("dispatch"),sessionId:d.string().min(1),operatorToken:d.string().min(1),trigger:d.object({triggerName:d.string().min(1),input:d.record(d.string(),d.unknown()).optional(),sender:MV.optional()}),deviceId:d.string().min(1).optional(),deviceMcpConfigs:d.array(UV).optional(),deviceSkillConfigs:d.array(LV).optional()}),FV=d.object({type:d.literal("stop"),sessionId:d.string().min(1)}),qV=d.object({type:d.literal("request-session-state"),sessionId:d.string().min(1)}),BV=d.object({type:d.literal("heartbeat")}),fP=d.object({type:d.literal("start-screen-stream"),livekitUrl:d.string().min(1),token:d.string().min(1),roomName:d.string().min(1),frameRate:d.number().int().positive().optional()}),pP=d.object({type:d.literal("device-reconnect")}),hP=d.object({type:d.literal("device-reconnect-agents")}),mP=d.object({type:d.literal("device-restart"),force:d.boolean()}),gP=d.object({type:d.literal("read-slack-prefs"),octoAgentId:d.string().min(1),workspaceHost:d.string().min(1),correlationId:d.string().min(1)}),VV=d.object({uploadUrl:d.string().min(1),mediaType:d.string().min(1)}),Lfe=d.object({fileId:d.string().min(1),key:d.string().min(1),mediaType:d.string().min(1),filename:d.string().min(1)}),_P=d.object({type:d.literal("start-voice-call"),sessionId:d.string().min(1),octoAgentId:d.string().min(1),ephemeralSecret:d.string().min(1),model:d.string().min(1),voiceToken:d.string().min(1),operatorWsUrl:d.string().min(1),recording:VV.optional()}),Mfe=d.discriminatedUnion("type",[fP,pP,hP,mP,_P,gP]),vP=d.discriminatedUnion("type",[ZV,FV,qV,BV,fP,pP,hP,mP,_P,gP]),WV=d.object({speaker:d.enum(["user","agent"]),text:d.string(),at:d.number()}),Zfe=d.object({at:d.number(),kind:d.enum(["ask","answer","cancel","end","silence"]),name:d.string().optional(),callId:d.string().optional(),request:d.string().optional(),answer:d.string().optional(),reason:d.string().optional()}),HV=d.object({audioInputTokens:d.number().int().nonnegative(),cachedAudioInputTokens:d.number().int().nonnegative(),textInputTokens:d.number().int().nonnegative(),cachedTextInputTokens:d.number().int().nonnegative(),audioOutputTokens:d.number().int().nonnegative(),textOutputTokens:d.number().int().nonnegative()}),JV=d.object({type:d.literal("function"),name:d.string(),description:d.string(),parameters:d.record(d.string(),d.unknown())}),GV=d.object({ask:d.string().optional(),cancel:d.string().optional(),end:d.string().optional(),silence:d.string().optional()}),KV=d.object({type:d.string(),eagerness:d.string().optional(),create_response:d.boolean(),interrupt_response:d.boolean()}),YV=d.object({engagementNudgeMs:d.number().int().positive().optional(),recheckNudgeMs:d.number().int().positive().optional(),endNudgeMs:d.number().int().positive().optional(),waitingNudgeMs:d.number().int().positive().optional(),engagementNote:d.string().optional(),recheckNote:d.string().optional(),endNote:d.string().optional(),waitingNote:d.string().optional()}),XV=d.object({tools:d.array(JV),toolChoice:d.enum(["auto","none","required"]),modalities:d.array(d.enum(["audio","text"])).min(1),transcriptionModel:d.string(),transcriptionLanguage:d.string().optional(),transcriptionPrompt:d.string().optional(),turnDetection:KV,noiseReduction:d.enum(["near_field","far_field"]).optional(),filler:d.string(),roles:GV,silence:YV.optional()}),QV=d.object({type:d.literal("ask"),callId:d.string().min(1),request:d.string()}),e9=d.object({type:d.literal("cancel"),callId:d.string().min(1),reason:d.string().optional()}),t9=d.object({type:d.literal("transcript"),entries:d.array(WV).max(200)}),r9=d.object({type:d.literal("usage"),usage:HV}),n9=d.object({type:d.literal("tool-event"),kind:d.enum(["silence"]),reason:d.string().optional()}),o9=d.object({type:d.literal("end"),reason:d.string().optional(),endedByTool:d.boolean().optional()}),Ffe=d.discriminatedUnion("type",[QV,e9,t9,r9,n9,o9]),i9=d.object({type:d.literal("ready"),instructions:d.string(),sessionConfig:XV}),s9=d.object({type:d.literal("observer")}),a9=d.object({type:d.literal("answer"),callId:d.string().min(1),answer:d.string()}),c9=d.object({type:d.literal("ended"),reason:d.string().optional()}),qfe=d.discriminatedUnion("type",[i9,s9,a9,c9]),yP=3e4;var bP=4003,Ab=[2e3,5e3,15e3,3e4,6e4,6e4];var wP="octavus.error",xf=class extends Error{__octavusErrorMarker=wP;errorType;source;retryable;retryAfter;code;provider;tool;constructor(e){super(e.message),this.name="OctavusError",this.errorType=e.errorType,this.source=e.source,this.retryable=e.retryable??!1,this.retryAfter=e.retryAfter,this.code=e.code,this.provider=e.provider,this.tool=e.tool,e.cause instanceof Error&&e.cause.stack&&(this.stack=`${this.stack}
63
63
  Caused by: ${e.cause.stack}`)}static isInstance(e){return typeof e=="object"&&e!==null&&"__octavusErrorMarker"in e&&e.__octavusErrorMarker===wP}toJSON(){return{name:this.name,message:this.message,errorType:this.errorType,source:this.source,retryable:this.retryable,retryAfter:this.retryAfter,code:this.code,provider:this.provider,tool:this.tool}}};function Sf(e){return{type:"error",errorType:e.errorType,message:e.message,source:e.source,retryable:e.retryable??!1,retryAfter:e.retryAfter,code:e.code,provider:e.provider,tool:e.tool}}function Nb(e){return Sf({errorType:e.errorType,message:e.message,source:e.source,retryable:e.retryable,retryAfter:e.retryAfter,code:e.code,provider:e.provider,tool:e.tool})}var u9=["terminated","fetch failed","socket hang up","other side closed","connection closed","econnreset","econnrefused","epipe","etimedout","enotfound","eai_again","und_err_socket","und_err_connect_timeout","und_err_headers_timeout","und_err_body_timeout"];function Db(e){let t=e;for(let r=0;r<5&&!(typeof t!="object"||t===null);r++){let o=t,n=`${typeof o.message=="string"?o.message:""} ${typeof o.code=="string"?o.code:""}`.toLowerCase();if(u9.some(i=>n.includes(i)))return!0;t=o.cause}return!1}function Gi(e){return Sf({errorType:"internal_error",message:e,source:"platform",retryable:!1})}function l9(e){switch(e){case 400:return"validation_error";case 401:return"authentication_error";case 402:return"quota_exceeded_error";case 403:return"permission_error";case 404:return"not_found_error";case 429:return"rate_limit_error";case 503:return"provider_overloaded";case 504:return"provider_timeout";default:return e>=500?"internal_error":"unknown_error"}}function $f(e,t){let r=l9(e),o=e===429||e>=500;return Sf({errorType:r,message:t,source:"platform",retryable:o})}function uc(){return`${Date.now()}-${Math.random().toString(36).substring(2,9)}`}function jb(e){return cc(d9(e))}function d9(e){let{allOf:t,anyOf:r,oneOf:o,...n}=e,i=[{jointlyRequired:!0,branches:t},{jointlyRequired:!1,branches:r},{jointlyRequired:!1,branches:o}];if(!i.some(({branches:l})=>Array.isArray(l)))return e;let s={...n},a=typeof s.properties=="object"&&s.properties!==null?{...s.properties}:{},u=new Set(Array.isArray(s.required)?s.required.filter(l=>typeof l=="string"):[]);for(let{jointlyRequired:l,branches:f}of i)if(Array.isArray(f))for(let p of f){if(typeof p!="object"||p===null)continue;let h=p,m=h.properties;if(typeof m=="object"&&m!==null)for(let[g,_]of Object.entries(m))g in a||(a[g]=_);if(l&&Array.isArray(h.required))for(let g of h.required)typeof g=="string"&&u.add(g)}s.type="object",s.properties=a;let c=[...u].filter(l=>l in a);return c.length>0?s.required=c:delete s.required,s}var f9=[/\(\?=/,/\(\?!/,/\(\?<=/,/\(\?<!/,/\\[1-9]/,/\\k[<']/];function p9(e){return f9.some(t=>t.test(e))}var h9=["items","additionalProperties","contains","propertyNames","if","then","else","not","unevaluatedItems","unevaluatedProperties"],m9=["allOf","anyOf","oneOf","prefixItems"],g9=["properties","patternProperties","$defs","definitions","dependentSchemas"];function cc(e){if(Array.isArray(e))return e.map(cc);if(typeof e!="object"||e===null)return e;let t={...e};t.type==="object"&&!("properties"in t)&&(t.properties={}),typeof t.pattern=="string"&&p9(t.pattern)&&delete t.pattern;for(let r of h9)r in t&&(t[r]=cc(t[r]));for(let r of m9){let o=t[r];Array.isArray(o)&&(t[r]=o.map(cc))}for(let r of g9){let o=t[r];if(typeof o=="object"&&o!==null&&!Array.isArray(o)){let n={};for(let[i,s]of Object.entries(o))n[i]=cc(s);t[r]=n}}return t}function Ub(e){return(e instanceof Error||e instanceof DOMException)&&(e.name==="AbortError"||e.name==="ResponseAborted"||e.name==="TimeoutError")}var kf=d.enum(["hidden","name","description","stream","title"]),_9=d.enum(["user","assistant","system"]),v9=d.enum(["pending","streaming","available","error"]),y9=d.enum(["stop","tool-calls","client-tool-calls","length","content-filter","error","other"]),Lb=d.object({id:d.string(),name:d.string(),description:d.string().optional(),arguments:d.record(d.string(),d.unknown()),status:v9,result:d.unknown().optional(),error:d.string().optional(),display:kf.optional()}),b9=d.object({type:d.literal("start"),messageId:d.string().optional(),executionId:d.string().optional(),lastMessageId:d.string().optional(),sessionId:d.string().optional()}),w9=d.object({type:d.literal("finish"),finishReason:y9,executionId:d.string().optional()}),x9=d.enum(["authentication_error","permission_error","validation_error","not_found_error","rate_limit_error","quota_exceeded_error","provider_error","provider_overloaded","provider_timeout","execution_error","tool_error","protocol_error","internal_error","unknown_error"]),S9=d.enum(["platform","provider","tool","client"]),$9=d.object({name:d.string(),model:d.string().optional(),statusCode:d.number().optional(),errorType:d.string().optional(),requestId:d.string().optional()}),k9=d.object({name:d.string(),callId:d.string().optional()}),E9=d.object({type:d.literal("error"),errorType:x9,message:d.string(),retryable:d.boolean(),source:S9,retryAfter:d.number().optional(),code:d.string().optional(),provider:$9.optional(),tool:k9.optional()}),z9=d.object({type:d.literal("text-start"),id:d.string(),responseType:d.string().optional(),workerId:d.string().optional()}),T9=d.object({type:d.literal("text-delta"),id:d.string(),delta:d.string(),workerId:d.string().optional()}),I9=d.object({type:d.literal("text-end"),id:d.string(),workerId:d.string().optional()}),P9=d.object({type:d.literal("reasoning-start"),id:d.string(),workerId:d.string().optional()}),O9=d.object({type:d.literal("reasoning-delta"),id:d.string(),delta:d.string(),workerId:d.string().optional()}),R9=d.object({type:d.literal("reasoning-end"),id:d.string(),workerId:d.string().optional()}),C9=d.object({type:d.literal("tool-input-start"),toolCallId:d.string(),toolName:d.string(),title:d.string().optional(),display:kf.optional(),workerId:d.string().optional()}),A9=d.object({type:d.literal("tool-input-delta"),toolCallId:d.string(),inputTextDelta:d.string(),workerId:d.string().optional()}),N9=d.object({type:d.literal("tool-input-end"),toolCallId:d.string(),workerId:d.string().optional()}),D9=d.object({type:d.literal("tool-input-available"),toolCallId:d.string(),toolName:d.string(),input:d.unknown(),workerId:d.string().optional()}),j9=d.object({type:d.literal("tool-output-available"),toolCallId:d.string(),output:d.unknown(),workerId:d.string().optional()}),U9=d.object({type:d.literal("tool-output-error"),toolCallId:d.string(),error:d.string(),workerId:d.string().optional()}),L9=d.object({type:d.literal("source"),sourceType:d.literal("url"),id:d.string(),url:d.string(),title:d.string().optional(),workerId:d.string().optional()}),M9=d.object({type:d.literal("source"),sourceType:d.literal("document"),id:d.string(),mediaType:d.string(),title:d.string(),filename:d.string().optional(),workerId:d.string().optional()}),Z9=d.discriminatedUnion("sourceType",[L9,M9]),F9=d.object({type:d.literal("block-start"),blockId:d.string(),blockName:d.string(),blockType:d.string(),display:kf,description:d.string().optional(),outputToChat:d.boolean().optional(),thread:d.string().optional(),workerId:d.string().optional()}),q9=d.object({type:d.literal("block-end"),blockId:d.string(),summary:d.string().optional(),workerId:d.string().optional()}),B9=d.object({type:d.literal("resource-update"),name:d.string(),value:d.unknown()}),V9=d.object({id:d.string(),mediaType:d.string(),url:d.string(),filename:d.string().optional(),size:d.number().optional()}),xP=d.object({toolCallId:d.string(),toolName:d.string(),args:d.record(d.string(),d.unknown()),source:d.enum(["llm","block"]).optional(),outputVariable:d.string().optional(),blockIndex:d.number().optional(),thread:d.string().optional(),workerId:d.string().optional()}),W9=d.object({toolCallId:d.string(),toolName:d.string().optional(),result:d.unknown().optional(),error:d.string().optional(),files:d.array(V9).optional(),outputVariable:d.string().optional(),blockIndex:d.number().optional(),thread:d.string().optional(),workerId:d.string().optional()}),H9=d.object({type:d.literal("tool-request"),toolCalls:d.array(xP),workerId:d.string().optional()}),J9=d.object({type:d.literal("client-tool-request"),executionId:d.string(),toolCalls:d.array(xP),serverToolResults:d.array(W9).optional()}),G9=d.object({type:d.literal("file-available"),id:d.string(),mediaType:d.string(),url:d.string(),filename:d.string().optional(),size:d.number().optional(),toolCallId:d.string().optional(),workerId:d.string().optional()}),SP=d.enum(["pending","in_progress","completed","cancelled"]),$P=d.object({id:d.string(),content:d.string(),status:SP}),K9=d.object({type:d.literal("todo-update"),todos:d.array($P),workerId:d.string().optional()}),Y9=d.object({type:d.literal("worker-start"),workerId:d.string(),workerSlug:d.string(),description:d.string().optional(),input:d.record(d.string(),d.unknown()).optional()}),X9=d.object({type:d.literal("worker-result"),workerId:d.string(),output:d.unknown().optional(),error:d.string().optional()}),Q9=d.object({type:d.literal("worker-input-start"),workerId:d.string(),workerSlug:d.string(),description:d.string().optional()}),e8=d.object({type:d.literal("worker-input-delta"),workerId:d.string(),delta:d.string()}),t8=d.object({type:d.literal("worker-input-ready"),workerId:d.string(),input:d.record(d.string(),d.unknown())}),r8=d.object({type:d.literal("usage"),cost:d.object({currency:d.string(),bandwidthFee:d.number(),providerFee:d.number(),totalFee:d.number(),byok:d.boolean(),estimatedProviderFee:d.number().optional()}),tokens:d.object({inputTokens:d.number(),outputTokens:d.number(),totalTokens:d.number()})}),n8=d.union([b9,w9,E9,z9,T9,I9,P9,O9,R9,C9,A9,N9,D9,j9,U9,Z9,K9,F9,q9,B9,H9,J9,G9,Y9,X9,Q9,e8,t8,r8]),o8=d.enum(["text","reasoning","tool-call","step-start","operation","source","file","object","worker","todo"]),i8=d.object({sourceType:d.literal("url"),id:d.string(),url:d.string(),title:d.string().optional()}),s8=d.object({sourceType:d.literal("document"),id:d.string(),mediaType:d.string(),title:d.string(),filename:d.string().optional()}),kP=d.discriminatedUnion("sourceType",[i8,s8]),EP=d.object({id:d.string(),mediaType:d.string(),url:d.string(),filename:d.string().optional(),size:d.number().optional(),toolCallId:d.string().optional()}),zP=d.object({id:d.string(),typeName:d.string(),value:d.unknown()}),TP=d.object({id:d.string(),name:d.string(),operationType:d.string()}),IP=d.object({todos:d.array($P)}),PP=d.record(d.string(),d.record(d.string(),d.unknown())).optional(),a8=d.object({type:d.enum(["text","reasoning","tool-call","operation","source","file","object","todo"]),visible:d.boolean(),content:d.string().optional(),toolCall:Lb.optional(),operation:TP.optional(),source:kP.optional(),file:EP.optional(),object:zP.optional(),todo:IP.optional(),thread:d.string().optional(),providerMetadata:PP}),c8=d.object({workerId:d.string(),workerSlug:d.string(),description:d.string().optional(),input:d.record(d.string(),d.unknown()).optional(),nestedParts:d.array(a8),output:d.unknown().optional(),error:d.string().optional(),cancelled:d.boolean().optional()}),u8=d.object({type:o8,visible:d.boolean(),content:d.string().optional(),toolCall:Lb.optional(),operation:TP.optional(),source:kP.optional(),file:EP.optional(),object:zP.optional(),worker:c8.optional(),todo:IP.optional(),thread:d.string().optional(),providerMetadata:PP}),OP=d.object({id:d.string().optional(),name:d.string().optional(),image:d.string().optional()}),RP=d.object({id:d.string(),role:_9,parts:d.array(u8),createdAt:d.string(),content:d.string(),toolCalls:d.array(Lb).optional(),sender:OP.optional()}),l8=d.enum(["streaming","done"]),Mb=d.enum(["streaming","done"]),d8=d.enum(["pending","running","done","error","cancelled"]),CP=d.object({type:d.literal("text"),text:d.string(),status:Mb,thread:d.string().optional()}),AP=d.object({type:d.literal("reasoning"),text:d.string(),status:Mb,thread:d.string().optional(),providerMetadata:d.record(d.string(),d.unknown()).optional()}),NP=d.object({type:d.literal("tool-call"),toolCallId:d.string(),toolName:d.string(),displayName:d.string().optional(),args:d.record(d.string(),d.unknown()),result:d.unknown().optional(),error:d.string().optional(),status:d8,display:kf.optional(),thread:d.string().optional(),providerMetadata:d.record(d.string(),d.unknown()).optional()}),f8=d.enum(["running","done","cancelled"]),DP=d.object({type:d.literal("operation"),operationId:d.string(),name:d.string(),operationType:d.string(),status:f8,thread:d.string().optional()}),p8=d.object({type:d.literal("source"),sourceType:d.literal("url"),id:d.string(),url:d.string(),title:d.string().optional(),thread:d.string().optional()}),h8=d.object({type:d.literal("source"),sourceType:d.literal("document"),id:d.string(),mediaType:d.string(),title:d.string(),filename:d.string().optional(),thread:d.string().optional()}),jP=d.discriminatedUnion("sourceType",[p8,h8]),UP=d.object({type:d.literal("file"),id:d.string(),mediaType:d.string(),url:d.string(),filename:d.string().optional(),size:d.number().optional(),toolCallId:d.string().optional(),thread:d.string().optional()}),m8=d.enum(["streaming","done","error"]),LP=d.object({type:d.literal("object"),id:d.string(),typeName:d.string(),partial:d.unknown().optional(),object:d.unknown().optional(),status:m8,error:d.string().optional(),thread:d.string().optional()}),g8=d.object({id:d.string(),content:d.string(),status:SP}),MP=d.object({type:d.literal("todo"),todos:d.array(g8),status:Mb,thread:d.string().optional()}),_8=d.enum(["running","done","error","cancelled"]),ZP=d.object({type:d.literal("step-start")}),v8=d.union([CP,AP,NP,DP,jP,UP,LP,MP,ZP]),y8=d.object({type:d.literal("worker"),workerId:d.string(),workerSlug:d.string(),description:d.string().optional(),input:d.record(d.string(),d.unknown()).optional(),parts:d.array(v8),output:d.unknown().optional(),error:d.string().optional(),status:_8}),b8=d.union([CP,AP,NP,DP,jP,UP,LP,y8,MP,ZP]),Ef=d.object({id:d.string(),role:d.enum(["user","assistant"]),parts:d.array(b8),status:l8,createdAt:d.coerce.date(),sender:OP.optional()});function Zb(e){return n8.safeParse(e)}function lc(e){return"getHealth"in e&&"ensureReady"in e}function Ki(e){return"addEntry"in e&&"removeEntry"in e&&"restartEntry"in e&&"hasEntry"in e}var Wt={SKILL_READ:"octavus_skill_read",SKILL_LIST:"octavus_skill_list",SKILL_RUN:"octavus_skill_run",SKILL_SETUP:"octavus_skill_setup",CODE_RUN:"octavus_code_run",FILE_WRITE:"octavus_file_write",FILE_READ:"octavus_file_read",FILE_UPLOAD:"octavus_file_upload",REFERENCE_LIST:"octavus_reference_list",REFERENCE_READ:"octavus_reference_read",MCP_LIST:"octavus_mcp_list",MCP_ACTIVATE:"octavus_mcp_activate",GENERATE_IMAGE:"octavus_generate_image",GENERATE_VIDEO:"octavus_generate_video",GENERATE_SPEECH:"octavus_generate_speech",TRANSCRIBE_AUDIO:"octavus_transcribe_audio",WEB_SEARCH:"octavus_web_search",TODO_WRITE:"octavus_todo_write"};var at={SKILL_READ:Wt.SKILL_READ,SKILL_LIST:Wt.SKILL_LIST,SKILL_RUN:Wt.SKILL_RUN,SKILL_SETUP:Wt.SKILL_SETUP,CODE_RUN:Wt.CODE_RUN,FILE_WRITE:Wt.FILE_WRITE,FILE_READ:Wt.FILE_READ,FILE_UPLOAD:Wt.FILE_UPLOAD};var Fb={MCP_LIST:Wt.MCP_LIST,MCP_ACTIVATE:Wt.MCP_ACTIVATE};var Wfe={REFERENCE_LIST:Wt.REFERENCE_LIST,REFERENCE_READ:Wt.REFERENCE_READ};var w8=new Set(["image","audio","blob"]);function wf(e){if(typeof e!="object"||e===null)return!1;let t=e;return typeof t.type=="string"&&w8.has(t.type)&&typeof t.data=="string"}function FP(e){return e.mimeType?e.mimeType:e.type==="image"?"image/png":"application/octet-stream"}function qP(e){let t=e;if(t.length>=8&&t[0]===137&&t[1]===80&&t[2]===78&&t[3]===71&&t[4]===13&&t[5]===10&&t[6]===26&&t[7]===10)return"image/png";if(t.length>=3&&t[0]===255&&t[1]===216&&t[2]===255)return"image/jpeg";if(t.length>=6&&t[0]===71&&t[1]===73&&t[2]===70&&t[3]===56&&(t[4]===55||t[4]===57)&&t[5]===97)return"image/gif";if(t.length>=12&&t[0]===82&&t[1]===73&&t[2]===70&&t[3]===70&&t[8]===87&&t[9]===69&&t[10]===66&&t[11]===80)return"image/webp"}var BP="This file was reported as an image but its contents are not a valid or supported image, so it was provided as a download link only and not shown to the model as an image. The download likely returned non-image content (for example an HTML error or sign-in page) or a corrupt/unsupported file - verify the source and re-fetch if you need the image.";function VP(e){if(Array.isArray(e))return e.some(wf)?{parts:e,rebuild:t=>t}:null;if(typeof e=="object"&&e!==null){let{content:t}=e;if(Array.isArray(t)&&t.some(wf)){let r=e;return{parts:t,rebuild:o=>({...r,content:o})}}}return null}var x8={"image/png":"png","image/jpeg":"jpg","image/webp":"webp","image/gif":"gif","image/svg+xml":"svg","image/bmp":"bmp","audio/mpeg":"mp3","audio/wav":"wav","audio/ogg":"ogg","audio/flac":"flac","video/mp4":"mp4","video/webm":"webm","video/quicktime":"mov","application/pdf":"pdf","application/zip":"zip"};function WP(e){return x8[e]??"bin"}var S8=d.object({error:d.string().optional(),message:d.string().optional(),code:d.string().optional()}),$8=class extends Error{constructor(e,t,r){super(e),this.status=t,this.code=r,this.name="ApiError"}};async function XP(e,t){let r=`${t}: ${e.statusText}`;try{let o=await e.json(),n=S8.safeParse(o);if(n.success)return{message:n.data.error??n.data.message??r,code:n.data.code}}catch{}return{message:r}}async function ko(e,t){let{message:r,code:o}=await XP(e,t);throw new $8(r,e.status,o)}var Xi=class{config;constructor(e){this.config=e}async httpGet(e,t){let r=await fetch(`${this.config.baseUrl}${e}`,{method:"GET",headers:await this.config.getHeaders()});r.ok||await ko(r,"Request failed");let o=await r.json();return t.parse(o)}async httpPost(e,t,r){let o=await fetch(`${this.config.baseUrl}${e}`,{method:"POST",headers:await this.config.getHeaders(),body:JSON.stringify(t)});o.ok||await ko(o,"Request failed");let n=await o.json();return r.parse(n)}async httpPatch(e,t,r){let o=await fetch(`${this.config.baseUrl}${e}`,{method:"PATCH",headers:await this.config.getHeaders(),body:JSON.stringify(t)});o.ok||await ko(o,"Request failed");let n=await o.json();return r.parse(n)}async httpDelete(e,t){let r=await fetch(`${this.config.baseUrl}${e}`,{method:"DELETE",headers:await this.config.getHeaders()});r.ok||await ko(r,"Request failed");let o=await r.json();return t.parse(o)}},QP=d.enum(["interactive","worker"]),k8=d.object({slug:d.string(),name:d.string(),description:d.string().optional(),format:QP}),E8=d.object({name:d.string(),content:d.string()}),z8=d.object({slug:d.string(),id:d.string(),name:d.string(),description:d.string().nullable(),format:QP,createdAt:d.string(),updatedAt:d.string(),projectId:d.string()}),T8=d.object({agents:d.array(z8)}),I8=d.object({settings:k8,protocol:d.string(),prompts:d.array(E8),id:d.string()}),P8=class extends Xi{async list(){return(await this.httpGet("/api/agents",T8)).agents}async get(e){return await this.httpGet(`/api/agents/${e}`,I8)}},O8=4*1024*1024,R8=256*1024,C8=16*1024,A8=16*1024,N8=new TextEncoder;function Yi(e){return N8.encode(e).length}function Wb(e){return e>=1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:e>=1024?`${Math.round(e/1024)} KB`:`${e} B`}function e1(e){if(typeof e=="string")return e;try{return JSON.stringify(e)??""}catch{return""}}function qb(e){return Yi(JSON.stringify(e))}function D8(e){let t=e.result!==void 0?e1(e.result):e.error??"";return Yi(t)}function j8(e,t){if(e.length<=t)return e;let r=Math.ceil(t*.6),o=t-r,n=e.length-r-o;return`${e.slice(0,r)}
64
64
 
65
65
  ...[Octavus trimmed ${n.toLocaleString()} characters]...
@@ -67,7 +67,7 @@ Caused by: ${e.cause.stack}`)}static isInstance(e){return typeof e=="object"&&e!
67
67
  ${e.slice(e.length-o)}`}function U8(e){let t=-1,r=-1;return e.forEach((o,n)=>{let i=D8(o);i>r&&(r=i,t=n)}),t}function L8(e){let t=e.result!==void 0,r=t?e1(e.result):e.error??"",o=Yi(r);if(o<=C8)return null;if(t&&e.outputVariable){let s=`Result omitted: it was ${Wb(o)}, too large to capture into variable "${e.outputVariable}" and send back. Reduce the output - add filters or a limit, request fewer fields, paginate, or write it to a file and return a reference instead of inline data.`;return e.result=void 0,e.error=s,{toolCallId:e.toolCallId,toolName:e.toolName,originalBytes:o,keptBytes:Yi(s),variableCapture:!0}}let i=`${`[Octavus: this tool result was too large to send (${Wb(o)}), so only the start and end are shown below. To use the full data, reduce the output - add filters or a limit, request fewer fields, paginate, or write it to a file and return a reference instead of inline data.]`}
68
68
 
69
69
  ${j8(r,A8)}`;return t?e.result=i:e.error=i,{toolCallId:e.toolCallId,toolName:e.toolName,originalBytes:o,keptBytes:Yi(i),variableCapture:!1}}function M8(e,t){if(!e||e.length===0)return{results:e,truncations:[],overflow:!1};if(qb(e)<=t)return{results:e,truncations:[],overflow:!1};let r=e.map(i=>({...i})),o=[],n=r.length;for(;n>0&&qb(r)>t;){n-=1;let i=U8(r);if(i<0)break;let s=L8(r[i]);if(!s)break;o.push(s)}return{results:r,truncations:o,overflow:qb(r)>t}}var Z8=2,F8=1e3,HP=8e3,q8=.25,B8=6e4;function V8(e){return e===408||e===429||e===502||e===503||e===504}function W8(e){return e instanceof TypeError}function H8(e){let t=Number(e);if(Number.isFinite(t))return Math.max(0,t*1e3);let r=Date.parse(e);return Number.isFinite(r)?Math.max(0,r-Date.now()):null}async function Bb(e,t,r){let o=t?.headers.get("retry-after"),n=o?H8(o):null,i;if(n!==null)i=Math.min(n,HP);else{let s=Math.min(F8*2**e,HP),a=s*q8*(Math.random()*2-1);i=s+a}r?.aborted||await new Promise((s,a)=>{let u={timer:null},c=()=>{u.timer!==null&&clearTimeout(u.timer),a(r.reason instanceof Error?r.reason:new Error("Aborted"))};u.timer=setTimeout(()=>{r?.removeEventListener("abort",c),s()},i),r?.addEventListener("abort",c,{once:!0})})}async function*Hb(e,t,r){let o=t.toolResults,n=t.executionId,i=!0,s=Math.max(0,e.config.streamIdleTimeoutMs??B8),a=e.config.maxContinuationBytes??O8,u=a-Math.min(R8,Math.floor(a/2));for(;i;){if(r?.aborted){yield{type:"finish",finishReason:"stop"};return}let c=M8(o,u);if(o=c.results,e.onToolResultTruncated)for(let v of c.truncations)e.onToolResultTruncated(v);let l=e.buildBody({executionId:n,toolResults:o});if(c.overflow||Yi(JSON.stringify(l))>a){yield $f(413,`${e.errorContext??"Request"}: the results are too large to send (over ${Wb(a)}) and could not be reduced enough. Return less data - filter, limit, or paginate the results, or write them to a file and return a reference.`);return}let f=Math.max(0,e.config.maxRetries??Z8),p,h=!1,m,g,_=null;try{for(let b=0;b<=f;b++){if(r?.aborted){yield{type:"finish",finishReason:"stop"};return}let T=new AbortController,C=()=>T.abort(r?.reason);r&&(r.aborted?T.abort(r.reason):r.addEventListener("abort",C,{once:!0}));let N=!1,I=s>0?setTimeout(()=>{N=!0,T.abort()},s):void 0,W=!1;try{let U=typeof e.url=="function"?e.url():e.url;if(p=await fetch(U,{method:"POST",headers:await e.config.getHeaders(),body:JSON.stringify(l),signal:T.signal}),V8(p.status)&&b<f){await p.body?.cancel().catch(()=>{}),await Bb(b,p,r);continue}h=!0,W=!0,m=T,g=C;break}catch(U){if(r?.aborted){yield{type:"finish",finishReason:"stop"};return}if(N){if(b<f){await Bb(b,null,r);continue}return}if(b<f&&W8(U)){await Bb(b,null,r);continue}throw U}finally{I&&clearTimeout(I),!W&&r&&r.removeEventListener("abort",C)}}if(!h)return;if(!p.ok){let{message:b}=await XP(p,e.errorContext??"Request failed");yield $f(p.status,b);return}if(!p.body){yield Gi("Response body is not readable");return}e.onResponse?.(p),o=void 0;let v=p.body.getReader(),w=new TextDecoder,k="",S=!1;for(;!S;){if(r?.aborted){v.releaseLock(),yield{type:"finish",finishReason:"stop"};return}let b=v.read(),T,C;try{if(s>0){let U=new Promise(De=>{T=setTimeout(()=>De("idle"),s)});C=await Promise.race([b,U])}else C=await b}catch(U){if(T&&clearTimeout(T),Ub(U)){v.releaseLock(),yield{type:"finish",finishReason:"stop"};return}if(Db(U)){await v.cancel().catch(()=>{});return}throw U}if(T&&clearTimeout(T),C==="idle"){b.then(()=>{},()=>{}),await v.cancel().catch(()=>{});return}let{done:N,value:I}=C;if(N){S=!0;continue}k+=w.decode(I,{stream:!0});let W=k.split(`
70
- `);k=W.pop()??"";for(let U of W)if(U.startsWith("data: ")&&U!=="data: [DONE]")try{let De=Zb(JSON.parse(U.slice(6)));if(!De.success)continue;let xe=De.data;if(xe.type==="start"&&xe.executionId&&(n=xe.executionId),xe.type==="start"&&xe.sessionId&&e.onSessionId?.(xe.sessionId),xe.type==="tool-request"){_=xe.toolCalls;continue}if(xe.type==="finish"){if(xe.finishReason==="tool-calls"&&_)continue;yield xe,i=!1;continue}xe.type==="resource-update"&&e.onResourceUpdate&&e.onResourceUpdate(xe.name,xe.value),yield xe}catch{}}}finally{m&&g&&r&&r.removeEventListener("abort",g)}if(r?.aborted){yield{type:"finish",finishReason:"stop"};return}if(_&&_.length>0){let v=e.getToolHandlers(),w=_.filter(T=>v[T.toolName]),k=_.filter(T=>!v[T.toolName]),S=Promise.all(w.map(async T=>{let C=v[T.toolName];try{let N=await C(T.args);return{toolCallId:T.toolCallId,toolName:T.toolName,result:N,outputVariable:T.outputVariable,blockIndex:T.blockIndex,thread:T.thread,workerId:T.workerId}}catch(N){return{toolCallId:T.toolCallId,toolName:T.toolName,error:N instanceof Error?N.message:"Tool execution failed",outputVariable:T.outputVariable,blockIndex:T.blockIndex,thread:T.thread,workerId:T.workerId}}})),b;if(r&&!r.aborted){let T,C=new Promise(I=>{T=()=>I("aborted"),r.addEventListener("abort",T,{once:!0})}),N;try{N=await Promise.race([S,C])}finally{T&&r.removeEventListener("abort",T)}if(N==="aborted"){yield{type:"finish",finishReason:"stop"};return}b=N}else if(r?.aborted){yield{type:"finish",finishReason:"stop"};return}else b=await S;if(e.onToolResults&&b.length>0&&await e.onToolResults(b),r?.aborted){yield{type:"finish",finishReason:"stop"};return}for(let T of b)T.error?yield{type:"tool-output-error",toolCallId:T.toolCallId,error:T.error}:yield{type:"tool-output-available",toolCallId:T.toolCallId,output:T.result};if(k.length>0)if(e.rejectClientToolCalls){let T=k.map(C=>({toolCallId:C.toolCallId,toolName:C.toolName,error:`Tool "${C.toolName}" is not available. No handler is registered for this tool.`,outputVariable:C.outputVariable,blockIndex:C.blockIndex,thread:C.thread,workerId:C.workerId}));for(let C of T)yield{type:"tool-output-error",toolCallId:C.toolCallId,error:C.error};o=[...b,...T]}else{if(!n){yield Gi("Missing executionId for client-tool-request");return}yield{type:"client-tool-request",executionId:n,toolCalls:k,serverToolResults:b.length>0?b:void 0},yield{type:"finish",finishReason:"client-tool-calls",executionId:n},i=!1}else o=b}else i=!1}}function Jb(e,t,r){let o=new Set,n={...t},i=r?[...r]:[],s=new Set(i.map(a=>a.name));for(let a of e){if(o.has(a.namespace))throw new Error(`Duplicate MCP namespace "${a.namespace}". Each inline MCP server must have a unique namespace.`);o.add(a.namespace);let u=a.toolHandlers(),c=a.toolSchemas();for(let[l,f]of Object.entries(u)){if(n[l])throw new Error(`Tool name collision: "${l}" is already registered. Ensure no overlap between MCP-namespaced tools and static tool handlers.`);n[l]=f}for(let l of c){if(s.has(l.name))throw new Error(`Tool schema name collision: "${l.name}" is already registered as a dynamic tool schema.`);s.add(l.name),i.push(l)}}return{toolHandlers:n,dynamicToolSchemas:i}}function J8(e){let t=e.toolHandlers();return e.toolSchemas().filter(r=>t[r.name]).map(r=>({schema:r,handler:t[r.name]}))}var JP=class{sessionId;config;deferredStart;idempotencyKey;baseHandlers;toolHandlers;resourceMap;mcpToolSchemas=[];dynamicToolSchemas;socketAbortController=null;onToolResults;onToolResultTruncated;rejectClientToolCalls;constructor(e){if(this.sessionId=e.sessionId,this.config=e.config,this.deferredStart=e.deferredStart,this.idempotencyKey=e.deferredStart?e.deferredStart.idempotencyKey??uc():void 0,this.onToolResults=e.onToolResults,this.onToolResultTruncated=e.onToolResultTruncated,this.rejectClientToolCalls=e.rejectClientToolCalls??!1,this.resourceMap=new Map,e.mcpServers!==void 0&&e.mcpServers.length>0){let t=Jb(e.mcpServers,e.tools);this.baseHandlers=t.toolHandlers,this.mcpToolSchemas=t.dynamicToolSchemas}else this.baseHandlers=e.tools??{};this.toolHandlers={...this.baseHandlers};for(let t of e.resources??[])this.resourceMap.set(t.name,t)}async*execute(e,t){if(e.type==="continue"){if(!this.sessionId)throw new Error("Cannot continue a session before it exists. Run a trigger first to create the session.");yield*this.executeStream({executionId:e.executionId,toolResults:e.toolResults},t?.signal)}else yield*this.executeStream({triggerName:e.triggerName,input:e.input,rollbackAfterMessageId:e.rollbackAfterMessageId,sender:e.sender},t?.signal)}getSessionId(){return this.sessionId}setDynamicTools(e){let t=Array.isArray(e)?e:J8(e),r={...this.baseHandlers};for(let o of t)r[o.schema.name]=o.handler;this.toolHandlers=r,this.dynamicToolSchemas=t.map(o=>o.schema)}async handleSocketMessage(e,t){if(e.type==="stop"){this.socketAbortController?.abort();return}this.socketAbortController?.abort(),this.socketAbortController=new AbortController;let r=this.socketAbortController;try{let o=this.execute(e,{signal:r.signal});for await(let n of o){if(r.signal.aborted)break;t.onEvent(n)}!r.signal.aborted&&t.onFinish&&await t.onFinish()}catch(o){if(!r.signal.aborted){let n=Gi(o instanceof Error?o.message:"Unknown error");t.onEvent(n)}}}async*executeStream(e,t){yield*Hb({config:this.config,getToolHandlers:()=>this.toolHandlers,url:()=>this.sessionId?`${this.config.baseUrl}/api/agent-sessions/${this.sessionId}/trigger`:`${this.config.baseUrl}/api/agent-sessions/start`,buildBody:({executionId:r,toolResults:o})=>this.buildRequestBody(e,r,o),onResponse:this.deferredStart?r=>this.latchSessionIdFromHeader(r):void 0,onSessionId:this.deferredStart?r=>this.latchSessionId(r):void 0,onResourceUpdate:(r,o)=>this.handleResourceUpdate(r,o),onToolResults:this.onToolResults,onToolResultTruncated:this.onToolResultTruncated,rejectClientToolCalls:this.rejectClientToolCalls,errorContext:"Failed to trigger"},{executionId:e.executionId,toolResults:e.toolResults},t)}buildRequestBody(e,t,r){let o=this.collectDynamicSchemas();if(this.deferredStart&&this.sessionId===void 0&&t===void 0){let i={};e.triggerName!==void 0&&(i.triggerName=e.triggerName),e.input!==void 0&&(i.input=e.input),e.sender!==void 0&&(i.sender=e.sender),o!==void 0&&(i.dynamicToolSchemas=o);let s={agentId:this.deferredStart.agentId,trigger:i};return this.deferredStart.input!==void 0&&(s.input=this.deferredStart.input),this.idempotencyKey!==void 0&&(s.idempotencyKey=this.idempotencyKey),s}let n={};return e.triggerName!==void 0&&(n.triggerName=e.triggerName),e.input!==void 0&&(n.input=e.input),e.rollbackAfterMessageId!==void 0&&(n.rollbackAfterMessageId=e.rollbackAfterMessageId),e.sender!==void 0&&(n.sender=e.sender),t!==void 0&&(n.executionId=t),r!==void 0&&(n.toolResults=r),o!==void 0&&(n.dynamicToolSchemas=o),n}latchSessionId(e){this.sessionId||(this.sessionId=e,this.deferredStart?.onSessionCreated?.(e))}latchSessionIdFromHeader(e){if(this.sessionId)return;let t=e.headers.get("X-Octavus-Session-Id");t&&this.latchSessionId(t)}handleResourceUpdate(e,t){let r=this.resourceMap.get(e);r&&r.onUpdate(t)}collectDynamicSchemas(){return this.mcpToolSchemas.length===0?this.dynamicToolSchemas:[...this.mcpToolSchemas,...this.dynamicToolSchemas??[]]}},G8=d.object({sessionId:d.string()}),K8=d.object({id:d.string(),agentId:d.string(),input:d.record(d.string(),d.unknown()),variables:d.record(d.string(),d.unknown()),resources:d.record(d.string(),d.unknown()),messages:d.array(RP),status:d.literal("active").optional(),createdAt:d.string(),updatedAt:d.string()}),Y8=d.object({sessionId:d.string(),agentId:d.string(),messages:d.array(Ef),status:d.literal("active").optional()}),Vb=d.object({sessionId:d.string(),agentId:d.string(),status:d.literal("expired"),createdAt:d.string()}),X8=d.object({sessionId:d.string(),restored:d.boolean()}),Q8=d.object({sessionId:d.string(),cleared:d.boolean()}),eW=d.looseObject({id:d.string(),timestamp:d.string(),type:d.string()}),tW=d.object({sessionId:d.string(),entries:d.array(eW),total:d.number().optional(),truncated:d.boolean().optional()}),rW=class extends Xi{async create(e,t){return(await this.httpPost("/api/agent-sessions",{agentId:e,input:t},G8)).sessionId}async get(e){let t=await fetch(`${this.config.baseUrl}/api/agent-sessions/${e}`,{method:"GET",headers:await this.config.getHeaders()});t.ok||await ko(t,"Request failed");let r=await t.json(),o=Vb.safeParse(r);return o.success?o.data:K8.parse(r)}async getMessages(e){let t=await fetch(`${this.config.baseUrl}/api/agent-sessions/${e}?format=ui`,{method:"GET",headers:await this.config.getHeaders()});t.ok||await ko(t,"Request failed");let r=await t.json(),o=Vb.safeParse(r);return o.success?o.data:Y8.parse(r)}async restore(e,t,r){return await this.httpPost(`/api/agent-sessions/${e}/restore`,{messages:t,input:r},X8)}async clear(e){return await this.httpDelete(`/api/agent-sessions/${e}`,Q8)}async getLogs(e,t){let r=new URLSearchParams;t?.excludeModelRequests&&r.set("excludeModelRequests","true");let o=r.toString(),n=`${this.config.baseUrl}/api/agent-sessions/${e}/logs${o?`?${o}`:""}`,i=await fetch(n,{method:"GET",headers:await this.config.getHeaders()});i.ok||await ko(i,"Request failed");let s=await i.json(),a=Vb.safeParse(s);return a.success?a.data:tW.parse(s)}attach(e,t={}){return new JP({sessionId:e,config:this.config,tools:t.tools,resources:t.resources,mcpServers:t.mcpServers,onToolResults:t.onToolResults,onToolResultTruncated:t.onToolResultTruncated,rejectClientToolCalls:t.rejectClientToolCalls})}start(e){return new JP({config:this.config,deferredStart:{agentId:e.agentId,input:e.input,idempotencyKey:e.idempotencyKey,onSessionCreated:e.onSessionCreated},tools:e.tools,resources:e.resources,mcpServers:e.mcpServers,onToolResults:e.onToolResults,onToolResultTruncated:e.onToolResultTruncated,rejectClientToolCalls:e.rejectClientToolCalls})}},Epe=d.object({filename:d.string().min(1).max(255),mediaType:d.string().min(1),size:d.number().int().positive()}),nW=d.object({id:d.string(),uploadUrl:d.url(),downloadUrl:d.url()}),oW=d.object({files:d.array(nW)}),iW=class extends Xi{async getUploadUrls(e,t){return await this.httpPost("/api/files/upload-urls",{sessionId:e,files:t},oW)}},GP=class extends Error{constructor(e,t,r){super(e),this.sessionId=t,this.details=r,this.name="WorkerError"}},sW=class extends Xi{async*execute(e,t,r={}){let o=r.mcpServers,n=o!==void 0&&o.length>0?Jb(o,r.tools,r.dynamicToolSchemas):{toolHandlers:r.tools??{},dynamicToolSchemas:r.dynamicToolSchemas};yield*Hb({config:this.config,getToolHandlers:()=>n.toolHandlers,url:`${this.config.baseUrl}/api/agents/${e}/execute`,buildBody:({executionId:i,toolResults:s})=>i?{type:"continue",executionId:i,toolResults:s}:{type:"start",input:t,...n.dynamicToolSchemas!==void 0&&{dynamicToolSchemas:n.dynamicToolSchemas}},errorContext:"Failed to execute worker"},{},r.signal)}async generate(e,t,r={}){let o,n,i,s,a,u,c;for await(let l of this.execute(e,t,r))l.type==="start"&&l.executionId?o=l.executionId:l.type==="error"?(i=l.message,s={errorType:l.errorType,source:l.source,code:l.code,retryable:l.retryable,retryAfter:l.retryAfter,provider:l.provider}):l.type==="worker-result"?(a=l.workerId,l.error!==void 0?i=i??l.error:n={output:l.output,sessionId:o??l.workerId}):l.type==="usage"&&(u=l.cost,c=l.tokens);if(i!==void 0)throw new GP(i,o??a,s);if(n!==void 0)return u!==void 0&&(n.cost=u),c!==void 0&&(n.tokens=c),n;throw new GP("Worker completed without producing a result",o)}async*continue(e,t,r,o={}){let n=o.mcpServers,i=n!==void 0&&n.length>0?Jb(n,o.tools).toolHandlers:o.tools??{};yield*Hb({config:this.config,getToolHandlers:()=>i,url:`${this.config.baseUrl}/api/agents/${e}/execute`,buildBody:({executionId:s,toolResults:a})=>({type:"continue",executionId:s??t,toolResults:a??r}),errorContext:"Failed to continue worker"},{executionId:t,toolResults:r},o.signal)}},aW=new Set(["completed","failed","cancelled"]);function cW(e){return aW.has(e)}var t1=d.string().transform(e=>e),KP=d.object({threadId:d.string(),status:t1}),uW=d.object({threadId:d.string(),status:t1,failureReason:d.string().nullable(),messages:d.array(Ef)}),lW=3e3,dW=900*1e3,fW=class extends Xi{async dispatch(e,t,r={}){return await this.httpPost(`/api/v1/workforce/agents/${encodeURIComponent(e)}/threads`,{message:t,files:r.files},KP)}async getThread(e,t){return await this.httpGet(`/api/v1/workforce/agents/${encodeURIComponent(e)}/threads/${encodeURIComponent(t)}`,uW)}async followUp(e,t,r,o={}){return await this.httpPost(`/api/v1/workforce/agents/${encodeURIComponent(e)}/threads/${encodeURIComponent(t)}/messages`,{message:r,files:o.files},KP)}async waitForCompletion(e,t,r={}){let o=r.pollIntervalMs??lW,n=r.timeoutMs??dW,i=Date.now()+n;for(;;){let s=await this.getThread(e,t);if(cW(s.status))return s;if(Date.now()+o>=i)throw new Error(`Workforce thread ${t} did not finish within ${n}ms (last status: ${s.status})`);await pW(o,r.signal)}}async run(e,t,r={}){let{threadId:o}=await this.dispatch(e,t,{files:r.files});return await this.waitForCompletion(e,o,r)}};function pW(e,t){return new Promise((r,o)=>{if(t?.aborted){o(YP(t));return}let n=setTimeout(()=>{t?.removeEventListener("abort",i),r()},e);function i(){clearTimeout(n),o(YP(t))}t?.addEventListener("abort",i,{once:!0})})}function YP(e){let t=e?.reason;return t instanceof Error?t:new Error("The wait was aborted")}var Ppe=d.object({agentId:d.string().min(1),sessionId:d.string().min(1).optional(),ttlSeconds:d.number().int().positive().optional()}),hW=d.object({token:d.string(),jti:d.string(),expiresAt:d.string()}),mW=class extends Xi{async mint(e){return await this.httpPost("/api/tokens",e,hW)}async revoke(e){return await this.httpPost("/api/tokens/revoke",{token:e},d.object({revoked:d.boolean(),jti:d.string().optional()}))}},gW="4",Gb=class{agents;agentSessions;files;workers;workforce;tokens;baseUrl;apiKey;traceModelRequests;constructor(e){this.baseUrl=e.baseUrl.replace(/\/$/,""),this.apiKey=e.apiKey,this.traceModelRequests=e.traceModelRequests??!1;let t={baseUrl:this.baseUrl,getHeaders:()=>this.getHeaders(),maxRetries:e.maxRetries,streamIdleTimeoutMs:e.streamIdleTimeoutMs};this.agents=new P8(t),this.agentSessions=new rW(t),this.files=new iW(t),this.workers=new sW(t),this.workforce=new fW(t),this.tokens=new mW(t)}getSessionUrl(e){return`${this.baseUrl}/platform/sessions/${e}`}getAgentUrl(e){return`${this.baseUrl}/platform/agents/${e}`}async getHeaders(){let e={"Content-Type":"application/json","X-Octavus-Sdk-Version":gW},t=typeof this.apiKey=="function"?await this.apiKey():this.apiKey;return t&&(e.Authorization=`Bearer ${t}`),this.traceModelRequests&&(e["X-Octavus-Trace"]="true"),e}};function _W(e){let t=atob(e),r=new ArrayBuffer(t.length),o=new Uint8Array(r);for(let n=0;n<t.length;n++)o[n]=t.charCodeAt(n);return r}async function r1(e,t,r){for(let o of e){if(o.outputVariable)continue;let n=VP(o.result);if(!n)continue;let i=o.files?[...o.files]:[],s=[],a=[],u=[],c=[],l=[];if(n.parts.forEach((g,_)=>{if(!wf(g))return;let v=_W(g.data),w=g.type==="image"?qP(new Uint8Array(v)):void 0,k=g.type==="image"&&w!==void 0,S=w??FP(g);s.push(_),a.push(g.type),u.push(v),l.push(k),c.push({filename:`${g.type}-${uc()}.${WP(S)}`,mediaType:S,size:v.byteLength})}),c.length===0)continue;let f=null;try{f=(await t.getUploadUrls(r,c)).files}catch{f=null}let p=f===null?null:await Promise.allSettled(f.map((g,_)=>fetch(g.uploadUrl,{method:"PUT",body:u[_],headers:{"Content-Type":c[_].mediaType}}))),h=new Map;s.forEach((g,_)=>{let v=a[_],w=c[_].mediaType,k=c[_].filename,S=u[_].byteLength,b=f?.[_],T=p?.[_],C=T?.status==="fulfilled"&&T.value.ok&&b!==void 0,N=l[_];if(C){N&&i.push({id:b.id,mediaType:w,url:b.downloadUrl,filename:k,size:S});let I=v==="image"&&!N;h.set(g,{type:v,mediaType:w,size:S,url:b.downloadUrl,...I&&{error:BP}})}else h.set(g,{type:v,mediaType:w,size:S,error:"Upload failed"})});let m=n.parts.map((g,_)=>h.has(_)?h.get(_):g);o.files=i,o.result=n.rebuild(m)}}function n1(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function vW(e){return n1(e)?typeof e.name=="string"&&(e.path===void 0||typeof e.path=="string")&&typeof e.mediaType=="string"&&typeof e.size=="number"&&typeof e.contentBase64=="string":!1}function yW(e){let t=atob(e),r=new ArrayBuffer(t.length),o=new Uint8Array(r);for(let n=0;n<t.length;n++)o[n]=t.charCodeAt(n);return r}async function o1(e,t,r){for(let o of e){if(o.outputVariable)continue;let n=o.result;if(!n1(n))continue;let i=n.outputFiles;if(!Array.isArray(i)||i.length===0)continue;let s=i.filter(vW);if(s.length===0)continue;let a=[],u=[];for(let h of s){let m=yW(h.contentBase64);a.push(m),u.push({filename:h.name,mediaType:h.mediaType,size:h.size})}let c;try{c=(await t.getUploadUrls(r,u)).files}catch{n.outputFiles=s.map(h=>({name:h.name,...h.path!==void 0?{path:h.path}:{},mediaType:h.mediaType,size:h.size,error:"Upload failed"}));continue}let l=await Promise.allSettled(c.map((h,m)=>fetch(h.uploadUrl,{method:"PUT",body:a[m],headers:{"Content-Type":u[m].mediaType}}))),f=o.files?[...o.files]:[],p=[];for(let h=0;h<s.length;h++){let m=l[h],g=c[h],_=u[h],v=s[h];m.status==="fulfilled"&&m.value.ok?(f.push({id:g.id,mediaType:_.mediaType,url:g.downloadUrl,filename:_.filename,size:_.size}),p.push({name:_.filename,...v.path!==void 0?{path:v.path}:{},mediaType:_.mediaType,size:_.size,url:g.downloadUrl})):p.push({name:_.filename,...v.path!==void 0?{path:v.path}:{},mediaType:_.mediaType,size:_.size,error:"Upload failed"})}o.files=f,n.outputFiles=p}}var OA=We(h1(),1);import{existsSync as Wc,mkdirSync as bp,readdirSync as vp,readFileSync as Fx,renameSync as aK,rmSync as yp,statSync as cK,writeFileSync as IA}from"fs";import{execFile as uK}from"child_process";import{dirname as lK,join as vt,normalize as dK,relative as PA,sep as fK}from"path";import{createHash as pK,randomBytes as zA}from"crypto";var hK={txt:"text/plain",md:"text/markdown",csv:"text/csv",json:"application/json",yaml:"application/yaml",yml:"application/yaml",xml:"application/xml",html:"text/html",htm:"text/html",pdf:"application/pdf",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",pptx:"application/vnd.openxmlformats-officedocument.presentationml.presentation",png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",svg:"image/svg+xml",mp4:"video/mp4",mp3:"audio/mpeg",wav:"audio/wav",py:"text/x-python",js:"text/javascript",ts:"text/typescript",zip:"application/zip"};function Vx(e){let t=e.lastIndexOf(".");if(t<0)return"application/octet-stream";let r=e.slice(t+1).toLowerCase();return hK[r]??"application/octet-stream"}var mK=3e5,gK=10*1024*1024,_K=20*1024*1024,vK=50*1024*1024,yK=20*1024*1024,TA=".octavus-skill.json",bK=new Set(["PATH","HOME","USER","LOGNAME","SHELL","TMPDIR","TEMP","TMP","LANG","LC_ALL","LC_CTYPE","TZ","APPDATA","LOCALAPPDATA","PROGRAMDATA","USERPROFILE","USERNAME","USERDOMAIN","HOMEDRIVE","HOMEPATH","SYSTEMROOT","SYSTEMDRIVE","WINDIR","COMSPEC","PATHEXT","PUBLIC","PROGRAMFILES","PROGRAMFILES(X86)","PROGRAMW6432","COMMONPROGRAMFILES","COMMONPROGRAMFILES(X86)","COMMONPROGRAMW6432","NUMBER_OF_PROCESSORS","PROCESSOR_ARCHITECTURE","OS"]),Wx=class{skills=new Map;extracted=new Map;inflight=new Map;installedSha=new Map;installErrors=new Map;installLocks=new Map;skillsDir;pythonPath;bashPath;turnOutputDir=null;collectedFiles=new Map;constructor(e){this.skillsDir=e.skillsDir,this.pythonPath=e.pythonPath,this.bashPath=e.bashPath,bp(this.skillsDir,{recursive:!0}),this.sweepStagingDirs(),this.reconcileFromDisk();for(let t of e.skills)this.skills.set(t.slug,t)}setSkills(e){this.skills.clear();for(let t of e)this.skills.set(t.slug,t);for(let t of[...this.extracted.keys()]){let r=this.skills.get(t);if(!r){this.extracted.delete(t);continue}let o=this.installedSha.get(t);r.bundleSha256&&o!==r.bundleSha256&&this.extracted.delete(t)}for(let t of[...this.installErrors.keys()])this.skills.has(t)||this.installErrors.delete(t);this.reconcileFromDisk()}reconcileFromDisk(){let e;try{e=vp(this.skillsDir,{withFileTypes:!0})}catch{return}for(let t of e){if(!t.isDirectory())continue;let r=t.name;if(r.startsWith(".")||r.includes(".staging-"))continue;let o=vt(this.skillsDir,r);(Wc(vt(o,"SKILL.md"))||Wc(vt(o,"scripts")))&&(this.skills.has(r)||this.skills.set(r,{slug:r,secrets:{}}),this.installedSha.has(r)||this.installedSha.set(r,this.readInstalledMarker(o)))}}readInstalledMarker(e){try{let t=Fx(vt(e,TA),"utf-8"),r=JSON.parse(t);return typeof r.sha256=="string"?r.sha256:void 0}catch{return}}async setupSkill(e){this.skills.set(e.slug,e),this.extracted.delete(e.slug);try{let t=await this.downloadAndExtract(e.slug,{allowStaleFallback:!1});return t?{installed:!0,path:PA(vt(this.skillsDir,".."),t.dir)||t.dir}:{installed:!1,error:`Skill "${e.slug}" is not configured on this device`}}catch(t){let r=t instanceof Error?t.message:String(t);return this.installErrors.set(e.slug,r),{installed:!1,error:r}}}toolHandlers(){return{octavus_skill_read:e=>this.handleSkillRead(e),octavus_skill_list:e=>this.handleSkillList(e),octavus_skill_run:e=>this.handleSkillRun(e)}}async handleSkillRead(e){let t=Es(e,"skill");if(!t)return{error:"Missing required parameter: skill"};let r=await this.ensureExtracted(t);if(!r)return this.unavailableError(t);let o=Es(e,"file")??"SKILL.md",n=Bx(r.dir,o);if(!n)return{error:`Invalid file path: ${o}`};let i=qx(r);try{return{content:Fx(n,"utf-8"),path:o,...i?{warning:i}:{}}}catch{return{error:`File not found: ${o}`}}}async handleSkillList(e){let t=Es(e,"skill");if(!t)return{error:"Missing required parameter: skill"};let r=await this.ensureExtracted(t);if(!r)return this.unavailableError(t);let o=qx(r),n=vt(r.dir,"scripts");try{let s=vp(n,{withFileTypes:!0}).filter(a=>a.isFile()).map(a=>({name:a.name,path:`scripts/${a.name}`}));return{skill:t,scripts:s,...o?{warning:o}:{}}}catch{return{skill:t,scripts:[],...o?{warning:o}:{}}}}async handleSkillRun(e){let t=Es(e,"skill");if(!t)return{error:"Missing required parameter: skill"};let r=Es(e,"script");if(!r)return{error:"Missing required parameter: script"};let o=await this.ensureExtracted(t);if(!o)return this.unavailableError(t);let n=Bx(o.dir,r);if(!n||!Wc(n))return{error:`Script not found: ${r}`};let i=this.ensureTurnOutputDir(),s=Date.now(),a=wK(e.input)?e.input:void 0,u=this.skills.get(t)?.secrets??{},c={...kK(),...u,OUTPUT_DIR:i,PYTHONUTF8:"1",PYTHONIOENCODING:"utf-8"},l=xK(Es(e,"args"),c),{command:f,prefixArgs:p}=this.resolveInterpreter(n),h=await new Promise(_=>{let v=uK(f,[...p,n,...l],{cwd:o.dir,env:c,timeout:mK,maxBuffer:gK},(w,k,S)=>{_({stdout:k,stderr:S,exitCode:typeof w?.code=="number"?w.code:0,error:w?w.message:void 0})});a&&v.stdin&&(v.stdin.write(JSON.stringify(a)),v.stdin.end())}),m=this.readNewOutputFiles(s),g=qx(o);return{stdout:h.stdout||void 0,stderr:h.stderr||void 0,exitCode:h.exitCode,error:h.error,outputFiles:m.length>0?m:void 0,...g?{warning:g}:{}}}resolveInterpreter(e){return e.endsWith(".py")?{command:this.pythonPath??(process.platform==="win32"?"python":"python3"),prefixArgs:[]}:process.platform==="win32"&&e.endsWith(".ps1")?{command:"powershell.exe",prefixArgs:["-NoProfile","-ExecutionPolicy","Bypass","-File"]}:{command:this.bashPath??"bash",prefixArgs:[]}}unavailableError(e){let t=this.installErrors.get(e);return t?{error:`${t} (install failed - call octavus_skill_setup with skill "${e}" to retry)`}:{error:`Skill "${e}" is not available on this device`}}ensureTurnOutputDir(){if(!this.turnOutputDir){let e=zA(4).toString("hex");this.turnOutputDir=vt(this.skillsDir,".runs",e,"output"),bp(this.turnOutputDir,{recursive:!0})}return this.turnOutputDir}readNewOutputFiles(e){if(!this.turnOutputDir)return[];let t;try{t=vp(this.turnOutputDir,{withFileTypes:!0})}catch{return[]}let r=[],o=0;for(let n of t){if(!n.isFile())continue;let i=vt(this.turnOutputDir,n.name);try{let s=cK(i),a=this.collectedFiles.get(n.name),u=!a,c=a!==void 0&&s.mtimeMs>e;if(!u&&!c)continue;let l=Fx(i);if(l.byteLength>_K)continue;if(o+l.byteLength>vK)break;o+=l.byteLength,r.push({name:n.name,path:i,mediaType:Vx(n.name),size:l.byteLength,contentBase64:l.toString("base64")}),this.collectedFiles.set(n.name,{size:s.size,mtimeMs:s.mtimeMs})}catch{}}return r}cleanupRuns(){let e=vt(this.skillsDir,".runs");try{yp(e,{recursive:!0,force:!0})}catch{}this.turnOutputDir=null,this.collectedFiles.clear()}async ensureExtracted(e){let t=this.extracted.get(e);if(t)return t;let r=this.inflight.get(e);if(r)return await r;let o=this.downloadAndExtract(e,{allowStaleFallback:!0}).catch(n=>(this.installErrors.set(e,n instanceof Error?n.message:String(n)),null)).finally(()=>{this.inflight.delete(e)});return this.inflight.set(e,o),await o}async downloadAndExtract(e,t){let r=this.skills.get(e);if(!r)return null;let o=vt(this.skillsDir,e),n=Wc(vt(o,"SKILL.md"))||Wc(vt(o,"scripts")),i=this.installedSha.get(e),s=r.bundleSha256!==void 0&&i!==r.bundleSha256;if(n&&!s){let u={slug:e,dir:o};return this.extracted.set(e,u),u}try{await this.installBundle(r,o)}catch(u){let c=u instanceof Error?u.message:String(u);if(t.allowStaleFallback&&n){let l={slug:e,dir:o,staleReason:c};return this.extracted.set(e,l),l}throw new Error(`Skill "${e}" bundle error: ${c}`,{cause:u})}this.installedSha.set(e,r.bundleSha256),this.installErrors.delete(e);let a={slug:e,dir:o};return this.extracted.set(e,a),a}async installBundle(e,t){let o=(this.installLocks.get(e.slug)??Promise.resolve()).then(()=>this.performBundleInstall(e,t));this.installLocks.set(e.slug,o.then(()=>{},()=>{})),await o}async performBundleInstall(e,t){if(!e.bundleUrl)throw new Error(`No bundle URL for skill "${e.slug}" - call octavus_skill_setup to (re)install it`);let r=await fetch(e.bundleUrl);if(!r.ok)throw new Error(`Bundle download failed: HTTP ${r.status} ${r.statusText}`);let o=Buffer.from(await r.arrayBuffer());if(e.bundleSha256){let i=pK("sha256").update(o).digest("hex");if(i!==e.bundleSha256)throw new Error(`Bundle SHA-256 mismatch: expected ${e.bundleSha256.slice(0,12)}..., got ${i.slice(0,12)}...`)}let n=`${t}.staging-${zA(4).toString("hex")}`;try{bp(n,{recursive:!0}),await EK(o,n),IA(vt(n,TA),JSON.stringify({sha256:e.bundleSha256??null})),yp(t,{recursive:!0,force:!0}),aK(n,t)}catch(i){throw yp(n,{recursive:!0,force:!0}),i}}sweepStagingDirs(){let e;try{e=vp(this.skillsDir,{withFileTypes:!0})}catch{return}for(let t of e)if(!(!t.isDirectory()||!t.name.includes(".staging-")))try{yp(vt(this.skillsDir,t.name),{recursive:!0,force:!0})}catch{}}};function Es(e,t){let r=e[t];return typeof r=="string"&&r.length>0?r:void 0}function qx(e){return e.staleReason?`Using the previously installed version of "${e.slug}" - the latest bundle failed to install: ${e.staleReason}`:void 0}function wK(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Bx(e,t){let r=dK(vt(e,t)),o=PA(e,r);return o===".."||o.startsWith(`..${fK}`)?null:r}function xK(e,t){return e?process.platform==="win32"?SK(e,t):(0,OA.parse)(e,t).filter(r=>typeof r=="string"):[]}function SK(e,t){let r=[],o="",n=!1,i=!1;for(let s of e){if(s==='"'){n=!n,i=!0;continue}if(!n&&(s===" "||s===" ")){i&&(r.push(o),o="",i=!1);continue}o+=s,i=!0}return i&&r.push(o),r.map(s=>$K(s,t))}function $K(e,t){let r=e.replace(/%([A-Za-z_][A-Za-z0-9_()]*)%/g,(o,n)=>t[n]??o);return r=r.replace(/\$\{([A-Za-z_][A-Za-z0-9_]*)\}/g,(o,n)=>t[n]??""),r=r.replace(/\$([A-Za-z_][A-Za-z0-9_]*)/g,(o,n)=>t[n]??""),r}function kK(){let e={};for(let t of bK){let r=process.env[t];typeof r=="string"&&(e[t]=r)}return e}async function EK(e,t){let o=await(await Promise.resolve().then(()=>We(EA(),1))).default.loadAsync(e),n=Object.keys(o.files).filter(s=>!o.files[s].dir);if(n.length===0)return;let i=zK(n);for(let s of n){if(s.includes("__MACOSX/"))continue;let a=i?s.slice(i.length):s;if(!a)continue;let u=Bx(t,a);if(!u)continue;let l=await o.files[s].async("nodebuffer");if(l.byteLength>yK)throw new Error(`Skill bundle entry too large: ${s}`);bp(lK(u),{recursive:!0}),IA(u,l)}}function zK(e){let t=null;for(let r of e){if(r.startsWith("__MACOSX/"))continue;let o=r.indexOf("/");if(o===-1)return null;let n=r.slice(0,o+1);if(t===null)t=n;else if(t!==n)return null}return t}import{stat as DK,readFile as jK}from"fs/promises";import{basename as UK,resolve as Hx,isAbsolute as jA,relative as LK,sep as MK}from"path";var wp={info(e,t){console.log(JSON.stringify({level:"info",message:e,...t,ts:new Date().toISOString()}))},warn(e,t){console.warn(JSON.stringify({level:"warn",message:e,...t,ts:new Date().toISOString()}))},error(e,t,r){let o=t instanceof Error?{error:t.message,stack:t.stack}:{error:t};console.error(JSON.stringify({level:"error",message:e,...o,...r,ts:new Date().toISOString()}))}},TK=1e3,IK=3e4,PK=.25,OK=60,RA=50,RK=6e4,CK=1e4,AK=45e3,NK=1e4,DA=class{config;log;ws=null;state="disconnected";reconnectAttempts=0;reconnectTimer=null;heartbeatTimer=null;livenessTimer=null;lastPingAt=0;intentionalClose=!1;hadDisconnect=!1;pendingLifecycle=[];constructor(e){this.config=e,this.log=e.logger??wp}getState(){return this.state}connect(){this.state==="connected"||this.state==="connecting"||(this.intentionalClose=!1,this.openWebSocket())}updateToken(e){this.config={...this.config,computerToken:e}}disconnect(){this.intentionalClose=!0,this.hadDisconnect=!1,this.clearTimers(),this.closeSocket("Client disconnect"),this.pendingLifecycle=[],this.setState("disconnected")}async closeGracefully(e=3e3){this.intentionalClose=!0,this.hadDisconnect=!1,this.clearTimers(),this.pendingLifecycle=[],this.setState("disconnected");let t=this.ws;this.ws=null,t&&await new Promise(r=>{let o=!1,n=null,i=()=>{o||(o=!0,n&&clearTimeout(n),r())};t.removeAllListeners(),t.on("close",i),t.on("error",i),t.readyState===kn.OPEN||t.readyState===kn.CONNECTING?(t.close(1e3,"Client disconnect"),n=setTimeout(()=>{try{t.terminate()}catch{}i()},e)):i()})}resetAndReconnect(){this.intentionalClose=!1,this.clearTimers(),this.closeSocket("Reset for reconnect"),this.reconnectAttempts=0,this.openWebSocket()}closeSocket(e){if(!this.ws)return;let t=this.ws;this.ws=null,t.removeAllListeners(),t.on("error",()=>{}),(t.readyState===kn.OPEN||t.readyState===kn.CONNECTING)&&t.close(1e3,e)}sendSessionEvent(e,t,r){this.send({type:"session-event",sessionId:e,event:t,seq:r})}sendSessionState(e,t,r){this.send({type:"session-state",sessionId:e,events:t,lastSeq:r})}sendSessionStarted(e){this.send({type:"session-started",sessionId:e})}sendSessionComplete(e,t,r,o,n){this.send({type:"session-complete",sessionId:e,status:t,error:r,errorType:o,title:n})}sendSessionTitle(e,t){this.send({type:"session-title",sessionId:e,title:t})}sendSessionRetry(e,t){this.send({type:"session-retry",sessionId:e,attempt:t.attempt,reason:t.reason,delayMs:t.delayMs})}sendDispatchAck(e){this.send({type:"dispatch-ack",sessionId:e})}openWebSocket(){this.setState("connecting");let e=new URL("/ws/computer",this.config.operatorWsUrl);e.searchParams.set("token",this.config.computerToken),this.ws=new kn(e.toString(),{handshakeTimeout:CK}),this.ws.on("open",()=>{let t=this.reconnectAttempts>0||this.hadDisconnect;this.reconnectAttempts=0,this.hadDisconnect=!1,this.setState("connected"),this.send({type:"sync",octoAgentIds:[this.config.octoAgentId],activeSessionIds:this.config.getActiveSessionIds?.()}),this.flushPendingLifecycle(),this.startHeartbeat(),this.startPingLiveness(),this.log.info("Connected to operator",{octoAgentId:this.config.octoAgentId,isReconnect:t}),t&&this.config.onReconnected?.()}),this.ws.on("message",t=>{let r=typeof t=="string"?t:Buffer.from(t).toString("utf8");this.handleMessage(r)}),this.ws.on("ping",()=>{this.lastPingAt=Date.now()}),this.ws.on("close",(t,r)=>{this.log.info("WebSocket closed",{octoAgentId:this.config.octoAgentId,code:t,reason:r?.toString()}),this.onDisconnect(t)}),this.ws.on("error",t=>{this.log.error("WebSocket error",t,{octoAgentId:this.config.octoAgentId})})}handleMessage(e){let t;try{t=vP.parse(JSON.parse(e))}catch{this.log.warn("Invalid message from operator",{octoAgentId:this.config.octoAgentId});return}switch(t.type){case"dispatch":this.config.onDispatch(t);break;case"stop":this.config.onStop(t.sessionId);break;case"request-session-state":this.config.onRequestSessionState(t.sessionId);break;case"start-screen-stream":case"device-reconnect":case"device-reconnect-agents":case"device-restart":case"start-voice-call":case"read-slack-prefs":this.config.onDeviceControl?.(t);break;case"heartbeat":break}}onDisconnect(e){if(this.clearTimers(),this.ws=null,this.intentionalClose){this.setState("disconnected");return}if(this.hadDisconnect=!0,e===bP){this.log.info("Connection revoked by operator, not reconnecting",{octoAgentId:this.config.octoAgentId}),this.config.onDisconnected?.({revoked:!0}),this.setState("disconnected");return}if(this.config.onDisconnected?.({revoked:!1}),this.reconnectAttempts>=OK){this.log.error("Max reconnect attempts reached",void 0,{octoAgentId:this.config.octoAgentId,attempts:this.reconnectAttempts}),this.setState("disconnected");return}this.setState("reconnecting"),this.scheduleReconnect()}scheduleReconnect(){let e=Math.min(TK*2**this.reconnectAttempts,IK),t=e*PK*(Math.random()*2-1),r=Math.max(0,e+t);this.reconnectAttempts+=1,this.log.info("Scheduling reconnect",{octoAgentId:this.config.octoAgentId,attempt:this.reconnectAttempts,delayMs:Math.round(r)}),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.openWebSocket()},r)}startHeartbeat(){this.stopHeartbeat(),this.heartbeatTimer=setInterval(()=>{this.send({type:"heartbeat"})},yP)}stopHeartbeat(){this.heartbeatTimer&&(clearInterval(this.heartbeatTimer),this.heartbeatTimer=null)}startPingLiveness(){this.stopPingLiveness(),this.lastPingAt=Date.now(),this.livenessTimer=setInterval(()=>{Date.now()-this.lastPingAt<=AK||(this.log.warn("No ping from operator - terminating stale socket",{octoAgentId:this.config.octoAgentId}),this.ws?.terminate())},NK)}stopPingLiveness(){this.livenessTimer&&(clearInterval(this.livenessTimer),this.livenessTimer=null)}clearTimers(){this.stopHeartbeat(),this.stopPingLiveness(),this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}send(e){this.ws?.readyState===kn.OPEN?this.ws.send(JSON.stringify(e)):(e.type==="session-started"||e.type==="session-complete"||e.type==="dispatch-ack")&&(this.pendingLifecycle.length<RA?(this.pendingLifecycle.push({msg:e,at:Date.now()}),this.log.info("Buffered lifecycle message for reconnect",{type:e.type,sessionId:"sessionId"in e?e.sessionId:void 0,buffered:this.pendingLifecycle.length})):this.log.warn("Lifecycle buffer full, dropping message",{type:e.type,sessionId:"sessionId"in e?e.sessionId:void 0,cap:RA}))}setState(e){this.state!==e&&(this.state=e,this.config.onStateChange?.(e))}flushPendingLifecycle(){if(this.pendingLifecycle.length===0)return;let e=Date.now(),t=this.pendingLifecycle.filter(({at:r})=>e-r<RK);if(this.pendingLifecycle=[],t.length!==0){this.log.info("Flushing buffered lifecycle messages",{count:t.length});for(let{msg:r}of t)this.ws?.readyState===kn.OPEN&&this.ws.send(JSON.stringify(r))}}},UA=1,Gx=600,ZK=d.object({seconds:d.number().min(UA).max(Gx)}),FK=Ab.length+1,qK=800*1e3,Jx=120*1e3,BK=qK+Gx*1e3+Jx+120*1e3,VK=class{config;client;abortController=null;agentSession=null;title=null;eventBuffer=[];nextSeq=0;stalledByWatchdog=!1;stallTimer=null;constructor(e){this.config=e,this.client=new Gb({baseUrl:e.platformUrl,apiKey:e.operatorToken,traceModelRequests:e.traceModelRequests})}get sessionId(){return this.config.sessionId}updateConfig(e){this.config=e,this.client=new Gb({baseUrl:e.platformUrl,apiKey:e.operatorToken,traceModelRequests:e.traceModelRequests}),this.title=null,this.eventBuffer=[],this.nextSeq=0}async execute(){this.abortController=new AbortController,this.stalledByWatchdog=!1;let e;for(let t=0;t<FK;t++){let r=await this.runOnce();if(r.kind==="completed"||r.kind==="hard-error")return r.sessionResult;r.kind==="provider-error"&&(e=r.sessionResult);let o=Ab[t];if(o===void 0||this.abortController.signal.aborted||(this.config.onRetry?.(t+1,r.kind,o),await this.sleepUnlessAborted(o),this.abortController.signal.aborted))break;this.resetForRetry()}return this.abortController.signal.aborted?{status:"completed",title:this.title??void 0}:e||{status:"failed",error:"Lost connection to platform after multiple retry attempts",errorType:"transport",title:this.title??void 0}}async runOnce(){let{sessionId:e,trigger:t,onEvent:r}=this.config;this.agentSession??=this.createAgentSession();try{let o=this.agentSession.execute({type:"trigger",triggerName:t.triggerName,input:t.input,sender:t.sender},{signal:this.abortController.signal}),n=null,i=!1;this.bumpStallWatchdog();for await(let s of o){if(this.abortController.signal.aborted)break;let a=this.nextSeq;this.nextSeq+=1;let u=s;this.eventBuffer.push({seq:a,event:u}),r(e,s,a),this.bumpStallWatchdog(),s.type==="finish"?(this.eventBuffer=[],i=!0):(i=!1,s.type==="error"&&(n=u))}if(i)return{kind:"completed",sessionResult:{status:"completed",title:this.title??void 0}};if(this.stalledByWatchdog)return{kind:"hard-error",sessionResult:this.stallResult()};if(n){let s=lP(n,this.title);return s.retryable?{kind:"provider-error",sessionResult:s}:{kind:"hard-error",sessionResult:s}}return{kind:"transport-drop"}}catch(o){if(this.stalledByWatchdog)return{kind:"hard-error",sessionResult:this.stallResult()};if(this.abortController.signal.aborted)return{kind:"completed",sessionResult:{status:"completed",title:this.title??void 0}};let n=bf(o);if(n==="transport")return{kind:"transport-drop"};let i=yf(o),s=xf.isInstance(o)?o:new xf({errorType:"internal_error",message:i,source:"platform",retryable:!1,cause:o}),a=Nb(s),u=this.nextSeq;return this.nextSeq+=1,this.eventBuffer.push({seq:u,event:a}),r(e,a,u),n==="network"||n==="timeout"?{kind:"network-error"}:{kind:"hard-error",sessionResult:{status:"failed",error:i,errorType:n,title:this.title??void 0}}}finally{this.clearStallWatchdog()}}bumpStallWatchdog(){this.clearStallWatchdog(),this.stallTimer=setTimeout(()=>{this.stallTimer=null,this.stalledByWatchdog=!0,this.abortController?.abort()},BK)}clearStallWatchdog(){this.stallTimer&&(clearTimeout(this.stallTimer),this.stallTimer=null)}stallResult(){return{status:"failed",error:"The run stopped making progress and was ended. Send a message to continue.",errorType:"transport",title:this.title??void 0}}getBufferedEvents(){return{events:this.eventBuffer.map(e=>e.event),lastSeq:this.nextSeq>0?this.nextSeq-1:-1}}stop(){this.abortController?.abort()}createAgentSession(){let{sessionId:e,computer:t,tools:r}=this.config,o=this.client.agentSessions.attach(e,{tools:this.buildStaticToolHandlers(r,t),onToolResults:n=>this.uploadToolResults(n,e),onToolResultTruncated:n=>{(this.config.logger??wp).warn("Tool result too large; reduced to a preview before sending",{sessionId:e,toolName:n.toolName,originalBytes:n.originalBytes,keptBytes:n.keptBytes,variableCapture:n.variableCapture})},rejectClientToolCalls:!0});return o.setDynamicTools(t),o}async uploadToolResults(e,t){this.stallTimer&&this.bumpStallWatchdog();let r=(async()=>{await r1(e,this.client.files,t),await o1(e,this.client.files,t)})(),o,n=new Promise(i=>{o=setTimeout(()=>i("timeout"),Jx)});try{await Promise.race([r.then(()=>"done"),n])==="timeout"&&((this.config.logger??wp).warn("Tool result upload exceeded its time budget; continuing without full offload",{sessionId:t,budgetMs:Jx}),r.catch(()=>{}))}finally{o&&clearTimeout(o)}}resetForRetry(){this.eventBuffer=[],this.agentSession=this.createAgentSession()}sleepUnlessAborted(e){return new Promise(t=>{let r=this.abortController?.signal;if(r?.aborted){t();return}let o=null,n=()=>{o!==null&&clearTimeout(o),t()};o=setTimeout(()=>{r?.removeEventListener("abort",n),t()},e),r?.addEventListener("abort",n,{once:!0})})}buildStaticToolHandlers(e,t){let r=d.object({title:d.string().min(1)}),o={"set-chat-title":n=>{let i=r.safeParse(n);return i.success?(this.title=i.data.title,this.config.onTitleChange?.(this.config.sessionId,i.data.title),Promise.resolve({success:!0,title:i.data.title})):Promise.resolve({success:!1,error:"Title must be a non-empty string"})},wait:n=>this.handleWait(n)};return t&&(o["computer-ensure-ready"]=()=>this.handleEnsureReady(),o["computer-get-status"]=()=>this.handleGetStatus(),o["computer-reset"]=()=>this.handleReset()),e&&Object.assign(o,e),o}async handleEnsureReady(){let e=this.config.computer,{environment:t}=this.config;if(lc(e))try{let r=await e.ensureReady();return this.agentSession?.setDynamicTools(e),{ready:r.healthy,tools:e.toolSchemas().map(o=>o.name),...(r.recovered?.length??0)>0&&{recovered:r.recovered},...(r.failedEntries?.length??0)>0&&{failedEntries:r.failedEntries},...t&&{environment:t}}}catch(r){return{ready:!1,error:r instanceof Error?r.message:String(r)}}return{ready:!0,tools:e.toolSchemas().map(r=>r.name),...t&&{environment:t}}}async handleGetStatus(){let e=this.config.computer;if(lc(e))try{let t=await e.getHealth();return{ready:t.healthy,tools:t.totalTools,entries:t.entries}}catch(t){return{ready:!1,error:t instanceof Error?t.message:String(t)}}return{ready:!0,schemasAvailable:!0,tools:e.toolSchemas().length}}async handleReset(){let{onComputerReset:e}=this.config;if(!e)return{ready:!1,error:"Reset not available"};try{let t=await e();return this.config.computer=t,this.agentSession?.setDynamicTools(t),{ready:lc(t)?(await t.getHealth()).healthy:!0,tools:t.toolSchemas().map(o=>o.name),reset:!0}}catch(t){return{ready:!1,error:t instanceof Error?t.message:String(t)}}}handleWait(e){let t=ZK.safeParse(e);if(!t.success)return Promise.resolve({success:!1,error:`seconds must be a number between ${UA} and ${Gx}`});let r=Math.round(t.data.seconds*1e3),o=this.abortController?.signal;return new Promise(n=>{if(o?.aborted){n({success:!0,waited_ms:0,aborted:!0});return}let i=setTimeout(()=>n({success:!0,waited_ms:r}),r);o?.addEventListener("abort",()=>{clearTimeout(i),n({success:!0,waited_ms:0,aborted:!0})},{once:!0})})}},WK=5e3,HK=10*6e4,JK=6e4,CA=20*1024*1024,AA=4e4;function GK(e){return new Promise(t=>{setTimeout(t,e)})}var KK=d.object({slug:d.string().min(1)}),YK=d.object({command:d.string().min(1),args:d.array(d.string()).optional(),env:d.record(d.string(),d.string()).optional(),connection:d.enum(["eager","lazy"]).optional()});function NA(e){return JSON.stringify({command:e.command,args:e.args,env:e.env,connection:e.connection})}var LA=class{config;log;activeExecutors=new Map;executorCache=new Map;cancelledSessions=new Map;terminalFailures=new Map;connectionLossTimer=null;idleCleanupTimer=null;afterSessionTimer=null;running=!1;resolvedComputer=null;computerPromise=null;currentDeviceMcpFingerprints=new Map;deviceSkillHandler=null;activeToolHandlers=null;oneShotResolvers=new Map;constructor(e){this.config=e,this.log=e.logger??wp}start(){this.running||(this.running=!0,this.idleCleanupTimer=setInterval(()=>this.cleanupIdleExecutors(),6e4))}async stop(){if(this.running=!1,this.cancelConnectionLossTimer(),this.idleCleanupTimer&&(clearInterval(this.idleCleanupTimer),this.idleCleanupTimer=null),this.afterSessionTimer&&(this.cancelAfterSessionTimer(),await this.fireAfterSession()),this.activeExecutors.size>0){for(let t of this.activeExecutors.values())t.stop();let e=Date.now()+WK;for(;this.activeExecutors.size>0&&Date.now()<e;)await GK(200);this.activeExecutors.size>0&&(this.log.warn("Drain timed out, forcing cleanup",{remaining:this.activeExecutors.size}),this.activeExecutors.clear(),this.notifyStateChange())}this.executorCache.clear(),this.cancelledSessions.clear()}getActiveSessions(){return[...this.activeExecutors.keys()].map(e=>({sessionId:e,octoAgentId:this.config.octoAgentId}))}isExecuting(){return this.activeExecutors.size>0}resetComputer(){this.resolvedComputer=null,this.computerPromise=null,this.currentDeviceMcpFingerprints.clear()}handleDispatch(e){return this.running?(this.cancelAfterSessionTimer(),this.activeExecutors.has(e.sessionId)?(this.log.warn("Ignoring duplicate dispatch for active session",{sessionId:e.sessionId}),this.config.connection.sendDispatchAck(e.sessionId),!0):(this.config.connection.sendDispatchAck(e.sessionId),this.executeSession(e).catch(t=>{this.log.error("Session execution threw outside its handler",t,{sessionId:e.sessionId})}),!0)):!1}async runLocalDispatch(e){let t=new Promise(r=>{this.oneShotResolvers.set(e.sessionId,r)});if(!this.handleDispatch(e))throw this.oneShotResolvers.delete(e.sessionId),new Error("SessionManager is not running");return await t}emitSessionComplete(e,t,r,o,n){this.config.connection.sendSessionComplete(e,t,r,o,n);let i=this.oneShotResolvers.get(e);i&&(this.oneShotResolvers.delete(e),i({status:t,error:r,errorType:o,title:n}))}handleStop(e){let t=this.activeExecutors.get(e);t?t.stop():this.cancelledSessions.set(e,Date.now())}handleConnectionLost(e){if(e.revoked){this.cancelConnectionLossTimer(),this.failActiveSessions("Operator connection revoked");return}this.activeExecutors.size!==0&&(this.connectionLossTimer||(this.log.warn("Operator connection lost with active sessions - starting grace window",{activeSessions:this.activeExecutors.size,graceMs:AA}),this.connectionLossTimer=setTimeout(()=>{this.connectionLossTimer=null,this.failActiveSessions("Operator connection lost",{report:!0})},AA)))}handleConnectionRestored(){this.connectionLossTimer&&(this.cancelConnectionLossTimer(),this.log.info("Operator connection restored within grace window - sessions continue"))}cancelConnectionLossTimer(){this.connectionLossTimer&&(clearTimeout(this.connectionLossTimer),this.connectionLossTimer=null)}failActiveSessions(e,t={}){if(this.activeExecutors.size!==0)for(let[r,o]of this.activeExecutors)this.terminalFailures.set(r,{reason:e,report:t.report??!1}),o.stop()}handleRequestSessionState(e){let t=this.activeExecutors.get(e);if(t){let{events:r,lastSeq:o}=t.getBufferedEvents();this.config.connection.sendSessionState(e,r,o)}else this.config.connection.sendSessionState(e,[],-1)}async getComputer(){if(this.resolvedComputer)return this.resolvedComputer;if(!this.computerPromise){let{computer:e}=this.config;this.computerPromise=typeof e=="function"?e():Promise.resolve(e)}return this.resolvedComputer=await this.computerPromise,this.resolvedComputer}consumeCancellation(e){return this.cancelledSessions.has(e)?(this.cancelledSessions.delete(e),this.log.info("Session was cancelled before execution started",{sessionId:e}),this.emitSessionComplete(e,"completed"),!0):!1}async executeSession(e){let{sessionId:t,operatorToken:r,trigger:o}=e;try{let n;try{n=await this.getComputer()}catch(a){let u=yf(a);this.log.error("Computer factory failed",a,{sessionId:t});let c=bf(a);this.emitSessionComplete(t,"failed",u,c==="transport"?"network":c);return}if(this.consumeCancellation(t))return;if(await this.reconcileDeviceMcps(n,e.deviceMcpConfigs),this.reconcileDeviceSkills(e.deviceSkillConfigs),this.config.onBeforeSession)try{await this.config.onBeforeSession()}catch(a){this.log.error("onBeforeSession failed",a)}if(this.consumeCancellation(t))return;let i=this.buildDeviceToolHandlers(n,e),s=this.getOrCreateExecutor(t,r,o,n,i);this.activeExecutors.set(t,s),this.notifyStateChange(),this.config.connection.sendSessionStarted(t);try{let a=await s.execute();if(this.consumeTerminalFailure(t))return;this.emitSessionComplete(t,a.status,a.error,a.errorType,a.title)}catch(a){if(this.consumeTerminalFailure(t))return;this.log.error("Session execution failed unexpectedly",a,{sessionId:t}),this.emitSessionComplete(t,"failed","Internal execution error","platform")}finally{this.deviceSkillHandler?.cleanupRuns(),this.terminalFailures.delete(t),this.activeExecutors.delete(t),this.notifyStateChange(),this.config.onAfterSession&&this.activeExecutors.size===0&&this.scheduleAfterSession()}}finally{let n=this.oneShotResolvers.get(t);n&&(this.oneShotResolvers.delete(t),n({status:"failed",error:"Run ended without completing",errorType:"network"})),this.config.onSessionSettled?.(t)}}consumeTerminalFailure(e){let t=this.terminalFailures.get(e);return t?(this.log.warn("Session aborted after operator disconnect",{sessionId:e,reason:t.reason}),t.report&&this.emitSessionComplete(e,"failed",t.reason,"network"),!0):!1}async reconcileDeviceMcps(e,t){if(!Ki(e)){t&&t.length>0&&this.log.warn("Device MCP configs provided but Computer does not support dynamic entries",{namespaces:t.map(o=>o.namespace)});return}let r=new Map;for(let o of t??[])r.set(o.namespace,o);for(let o of[...this.currentDeviceMcpFingerprints.keys()])if(!r.has(o))try{await e.removeEntry(o),this.currentDeviceMcpFingerprints.delete(o)}catch(n){this.log.warn("Failed to remove device MCP entry",{namespace:o,error:String(n)})}for(let[o,n]of r){let i=NA(n);if(this.currentDeviceMcpFingerprints.get(o)!==i){if(this.currentDeviceMcpFingerprints.has(o)){try{await e.removeEntry(o)}catch(s){this.log.warn("Failed to replace device MCP entry",{namespace:o,error:String(s)})}this.currentDeviceMcpFingerprints.delete(o)}try{await e.addEntry(o,{type:"stdio",command:n.command,args:n.args,env:n.env},{deferred:n.connection==="lazy"}),this.currentDeviceMcpFingerprints.set(o,i)}catch(s){this.log.warn("Failed to add device MCP entry",{namespace:o,error:String(s)})}}}}reconcileDeviceSkills(e){if(!e||e.length===0){this.deviceSkillHandler=null;return}if(!this.config.deviceSkillsDir){this.log.warn("Device skill configs provided but no deviceSkillsDir configured",{slugs:e.map(r=>r.slug)});return}let t=e.map(r=>({slug:r.slug,bundleUrl:r.bundleUrl,bundleSha256:r.bundleSha256,secrets:r.secrets}));this.deviceSkillHandler?this.deviceSkillHandler.setSkills(t):this.deviceSkillHandler=new Wx({skills:t,skillsDir:this.config.deviceSkillsDir,pythonPath:this.config.pythonPath})}buildDeviceToolHandlers(e,t){let r=!!(this.deviceSkillHandler&&(t.deviceSkillConfigs?.length??0)>0),o=(t.deviceMcpConfigs?.length??0)>0&&Ki(e),n=Ki(e),i=!!this.config.deviceSkillsDir,s=!!this.config.agentWorkspaceDir;if(!r&&!o&&!n&&!i&&!s)return this.activeToolHandlers=null,this.config.tools;let a={...this.config.tools??{}};if(this.activeToolHandlers=a,r){let u=this.deviceSkillHandler.toolHandlers();a[at.SKILL_READ]=u[at.SKILL_READ],a[at.SKILL_LIST]=u[at.SKILL_LIST],a[at.SKILL_RUN]=u[at.SKILL_RUN]}if(i&&(a[at.SKILL_SETUP]=u=>this.handleSkillSetup(u)),n&&(a[Fb.MCP_ACTIVATE]=u=>this.handleDeviceMcpActivate(e,u)),s){let u=this.config.agentWorkspaceDir;a[at.FILE_UPLOAD]=c=>this.handleFileUpload(c,u)}return a}async handleSkillSetup(e){let t=typeof e.skill=="string"?e.skill:void 0;if(!t)return{error:"Missing required parameter: skill"};let r=typeof e.bundleUrl=="string"?e.bundleUrl:void 0;if(!r)return{error:`Skill "${t}" could not be resolved - bundleUrl missing`};let o=typeof e.bundleSha256=="string"?e.bundleSha256:void 0,n=typeof e.secrets=="object"&&e.secrets!==null&&!Array.isArray(e.secrets)?e.secrets:{},i={slug:t,bundleUrl:r,bundleSha256:o,secrets:n};if(!this.deviceSkillHandler){if(!this.config.deviceSkillsDir)return{error:"Device skills are not configured on this device"};this.deviceSkillHandler=new Wx({skills:[i],skillsDir:this.config.deviceSkillsDir,pythonPath:this.config.pythonPath})}let s=await this.deviceSkillHandler.setupSkill(i);if(s.installed&&this.activeToolHandlers){let a=this.deviceSkillHandler.toolHandlers();this.activeToolHandlers[at.SKILL_READ]=a[at.SKILL_READ],this.activeToolHandlers[at.SKILL_LIST]=a[at.SKILL_LIST],this.activeToolHandlers[at.SKILL_RUN]=a[at.SKILL_RUN]}return s}async handleDeviceMcpActivate(e,t){let r=KK.safeParse(t);if(!r.success)return{error:"slug is required"};if(!Ki(e))return{error:"This computer does not support dynamic MCP activation"};let{slug:o}=r.data,n=YK.safeParse(t.deviceConfig);if(n.success&&!this.currentDeviceMcpFingerprints.has(o)){let a=n.data;try{let u=a.connection==="eager"?"eager":"lazy",c=a.args??[],l=a.env??{};await e.addEntry(o,{type:"stdio",command:a.command,args:c,env:l},{deferred:u==="lazy"}),this.currentDeviceMcpFingerprints.set(o,NA({namespace:o,name:o,description:"",command:a.command,args:c,env:l,connection:u}))}catch(u){return{error:u instanceof Error?u.message:String(u)}}}if(!this.currentDeviceMcpFingerprints.has(o))return{error:`MCP "${o}" is not registered on this device. Call computer-reset to refresh the device's MCP set.`};try{await e.restartEntry(o)}catch(a){return{error:a instanceof Error?a.message:String(a)}}let i=`${o}__`;return{activated:!0,tools:e.toolSchemas().filter(a=>a.name.startsWith(i))}}async handleFileUpload(e,t){let r=typeof e.path=="string"?e.path.trim():"";if(!r)return{error:"Missing required parameter: path"};let o=Hx(t),n=jA(r)?r:Hx(o,r),i=Hx(n);if(!XK(i,o))return{error:`Path is outside the agent workspace (${o}). Only files inside the workspace can be uploaded.`};let s;try{s=await DK(i)}catch{return{error:`File not found: ${i}`}}if(!s.isFile())return{error:`Path is not a file: ${i}`};if(s.size>CA)return{error:`File exceeds maximum upload size of ${CA/(1024*1024)}MB`};let a;try{a=await jK(i)}catch(l){return{error:l instanceof Error?l.message:"Failed to read file"}}let u=UK(i),c=Vx(u);return{outputFiles:[{name:u,path:i,mediaType:c,size:a.byteLength,contentBase64:a.toString("base64")}]}}getOrCreateExecutor(e,t,r,o,n){let i=(p,h,m)=>{this.config.connection.sendSessionEvent(e,h,m)},s=this.config.onComputerReset,a=s?async()=>{let p=await s();return this.resolvedComputer=p,this.currentDeviceMcpFingerprints.clear(),p}:void 0,u=(p,h)=>{this.config.connection.sendSessionTitle(e,h)},c={sessionId:e,operatorToken:t,trigger:r,platformUrl:this.config.platformUrl,computer:o,onEvent:i,onTitleChange:u,onRetry:(p,h,m)=>{this.log.warn("Retrying session execution",{sessionId:e,attempt:p,reason:h,delayMs:m}),this.config.connection.sendSessionRetry(e,{attempt:p,reason:h,delayMs:m})},tools:n??this.config.tools,onComputerReset:a,traceModelRequests:this.config.traceModelRequests,environment:this.config.environment,logger:this.log},l=this.executorCache.get(e);if(l)return l.lastActiveAt=Date.now(),l.executor.updateConfig(c),this.log.info("Reusing executor for session",{sessionId:e}),l.executor;let f=new VK(c);return this.executorCache.set(e,{executor:f,lastActiveAt:Date.now()}),f}cancelAfterSessionTimer(){this.afterSessionTimer&&(clearTimeout(this.afterSessionTimer),this.afterSessionTimer=null)}scheduleAfterSession(){if(this.cancelAfterSessionTimer(),!this.running)return;let e=this.config.idleTimeoutMs??0;if(e<=0){this.fireAfterSession();return}this.afterSessionTimer=setTimeout(()=>{this.afterSessionTimer=null,this.fireAfterSession()},e)}async fireAfterSession(){if(!(this.activeExecutors.size>0))try{await this.config.onAfterSession?.()}catch(e){this.log.error("onAfterSession failed",e)}}cleanupIdleExecutors(){let e=Date.now();for(let[t,r]of this.executorCache)e-r.lastActiveAt>HK&&!this.activeExecutors.has(t)&&(this.log.info("Removing idle executor cache for session",{sessionId:t}),this.executorCache.delete(t));for(let[t,r]of this.cancelledSessions)e-r>JK&&this.cancelledSessions.delete(t)}notifyStateChange(){this.config.onSessionStateChange?.(this.getActiveSessions())}};function XK(e,t){if(e===t)return!0;let r=LK(t,e);return r===""?!0:r.startsWith("..")||jA(r)?!1:!r.split(MK).includes("..")}import{homedir as QK}from"os";import{join as Hc}from"path";import{mkdirSync as MA,readFileSync as e7,writeFileSync as t7}from"fs";var r7="production",n7={production:"https://octavus.ai",local:"http://localhost:3000"};function Jc(e){let t=(e||process.env.OCTAVUS_ENV||r7).trim();if(!/^[a-zA-Z0-9][a-zA-Z0-9._-]*$/.test(t))throw new Error(`Invalid environment "${t}": use letters, digits, dot, underscore, or hyphen (e.g. production, staging).`);return t}function zs(e){return process.env.OCTAVUS_HOME||Hc(QK(),".octavus",e)}function ZA(e){return Hc(zs(e),"config.json")}function Ts(e){try{let t=e7(ZA(e),"utf8"),r=JSON.parse(t);return typeof r=="object"&&r!==null?r:{}}catch{return{}}}function FA(e,t){let r=zs(e);MA(r,{recursive:!0,mode:448});let o={...Ts(e),...t};return t7(ZA(e),`${JSON.stringify(o,null,2)}
70
+ `);k=W.pop()??"";for(let U of W)if(U.startsWith("data: ")&&U!=="data: [DONE]")try{let De=Zb(JSON.parse(U.slice(6)));if(!De.success)continue;let xe=De.data;if(xe.type==="start"&&xe.executionId&&(n=xe.executionId),xe.type==="start"&&xe.sessionId&&e.onSessionId?.(xe.sessionId),xe.type==="tool-request"){_=xe.toolCalls;continue}if(xe.type==="finish"){if(xe.finishReason==="tool-calls"&&_)continue;yield xe,i=!1;continue}xe.type==="resource-update"&&e.onResourceUpdate&&e.onResourceUpdate(xe.name,xe.value),yield xe}catch{}}}finally{m&&g&&r&&r.removeEventListener("abort",g)}if(r?.aborted){yield{type:"finish",finishReason:"stop"};return}if(_&&_.length>0){let v=e.getToolHandlers(),w=_.filter(T=>v[T.toolName]),k=_.filter(T=>!v[T.toolName]),S=Promise.all(w.map(async T=>{let C=v[T.toolName];try{let N=await C(T.args);return{toolCallId:T.toolCallId,toolName:T.toolName,result:N,outputVariable:T.outputVariable,blockIndex:T.blockIndex,thread:T.thread,workerId:T.workerId}}catch(N){return{toolCallId:T.toolCallId,toolName:T.toolName,error:N instanceof Error?N.message:"Tool execution failed",outputVariable:T.outputVariable,blockIndex:T.blockIndex,thread:T.thread,workerId:T.workerId}}})),b;if(r&&!r.aborted){let T,C=new Promise(I=>{T=()=>I("aborted"),r.addEventListener("abort",T,{once:!0})}),N;try{N=await Promise.race([S,C])}finally{T&&r.removeEventListener("abort",T)}if(N==="aborted"){yield{type:"finish",finishReason:"stop"};return}b=N}else if(r?.aborted){yield{type:"finish",finishReason:"stop"};return}else b=await S;if(e.onToolResults&&b.length>0&&await e.onToolResults(b),r?.aborted){yield{type:"finish",finishReason:"stop"};return}for(let T of b)T.error?yield{type:"tool-output-error",toolCallId:T.toolCallId,error:T.error}:yield{type:"tool-output-available",toolCallId:T.toolCallId,output:T.result};if(k.length>0)if(e.rejectClientToolCalls){let T=k.map(C=>({toolCallId:C.toolCallId,toolName:C.toolName,error:`Tool "${C.toolName}" is not available. No handler is registered for this tool.`,outputVariable:C.outputVariable,blockIndex:C.blockIndex,thread:C.thread,workerId:C.workerId}));for(let C of T)yield{type:"tool-output-error",toolCallId:C.toolCallId,error:C.error};o=[...b,...T]}else{if(!n){yield Gi("Missing executionId for client-tool-request");return}yield{type:"client-tool-request",executionId:n,toolCalls:k,serverToolResults:b.length>0?b:void 0},yield{type:"finish",finishReason:"client-tool-calls",executionId:n},i=!1}else o=b}else i=!1}}function Jb(e,t,r){let o=new Set,n={...t},i=r?[...r]:[],s=new Set(i.map(a=>a.name));for(let a of e){if(o.has(a.namespace))throw new Error(`Duplicate MCP namespace "${a.namespace}". Each inline MCP server must have a unique namespace.`);o.add(a.namespace);let u=a.toolHandlers(),c=a.toolSchemas();for(let[l,f]of Object.entries(u)){if(n[l])throw new Error(`Tool name collision: "${l}" is already registered. Ensure no overlap between MCP-namespaced tools and static tool handlers.`);n[l]=f}for(let l of c){if(s.has(l.name))throw new Error(`Tool schema name collision: "${l.name}" is already registered as a dynamic tool schema.`);s.add(l.name),i.push(l)}}return{toolHandlers:n,dynamicToolSchemas:i}}function J8(e){let t=e.toolHandlers();return e.toolSchemas().filter(r=>t[r.name]).map(r=>({schema:r,handler:t[r.name]}))}var JP=class{sessionId;config;deferredStart;idempotencyKey;baseHandlers;toolHandlers;resourceMap;mcpToolSchemas=[];dynamicToolSchemas;socketAbortController=null;onToolResults;onToolResultTruncated;rejectClientToolCalls;constructor(e){if(this.sessionId=e.sessionId,this.config=e.config,this.deferredStart=e.deferredStart,this.idempotencyKey=e.deferredStart?e.deferredStart.idempotencyKey??uc():void 0,this.onToolResults=e.onToolResults,this.onToolResultTruncated=e.onToolResultTruncated,this.rejectClientToolCalls=e.rejectClientToolCalls??!1,this.resourceMap=new Map,e.mcpServers!==void 0&&e.mcpServers.length>0){let t=Jb(e.mcpServers,e.tools);this.baseHandlers=t.toolHandlers,this.mcpToolSchemas=t.dynamicToolSchemas}else this.baseHandlers=e.tools??{};this.toolHandlers={...this.baseHandlers};for(let t of e.resources??[])this.resourceMap.set(t.name,t)}async*execute(e,t){if(e.type==="continue"){if(!this.sessionId)throw new Error("Cannot continue a session before it exists. Run a trigger first to create the session.");yield*this.executeStream({executionId:e.executionId,toolResults:e.toolResults},t?.signal)}else yield*this.executeStream({triggerName:e.triggerName,input:e.input,rollbackAfterMessageId:e.rollbackAfterMessageId,sender:e.sender},t?.signal)}getSessionId(){return this.sessionId}setDynamicTools(e){let t=Array.isArray(e)?e:J8(e),r={...this.baseHandlers};for(let o of t)r[o.schema.name]=o.handler;this.toolHandlers=r,this.dynamicToolSchemas=t.map(o=>o.schema)}async handleSocketMessage(e,t){if(e.type==="stop"){this.socketAbortController?.abort();return}this.socketAbortController?.abort(),this.socketAbortController=new AbortController;let r=this.socketAbortController;try{let o=this.execute(e,{signal:r.signal});for await(let n of o){if(r.signal.aborted)break;t.onEvent(n)}!r.signal.aborted&&t.onFinish&&await t.onFinish()}catch(o){if(!r.signal.aborted){let n=Gi(o instanceof Error?o.message:"Unknown error");t.onEvent(n)}}}async*executeStream(e,t){yield*Hb({config:this.config,getToolHandlers:()=>this.toolHandlers,url:()=>this.sessionId?`${this.config.baseUrl}/api/agent-sessions/${this.sessionId}/trigger`:`${this.config.baseUrl}/api/agent-sessions/start`,buildBody:({executionId:r,toolResults:o})=>this.buildRequestBody(e,r,o),onResponse:this.deferredStart?r=>this.latchSessionIdFromHeader(r):void 0,onSessionId:this.deferredStart?r=>this.latchSessionId(r):void 0,onResourceUpdate:(r,o)=>this.handleResourceUpdate(r,o),onToolResults:this.onToolResults,onToolResultTruncated:this.onToolResultTruncated,rejectClientToolCalls:this.rejectClientToolCalls,errorContext:"Failed to trigger"},{executionId:e.executionId,toolResults:e.toolResults},t)}buildRequestBody(e,t,r){let o=this.collectDynamicSchemas();if(this.deferredStart&&this.sessionId===void 0&&t===void 0){let i={};e.triggerName!==void 0&&(i.triggerName=e.triggerName),e.input!==void 0&&(i.input=e.input),e.sender!==void 0&&(i.sender=e.sender),o!==void 0&&(i.dynamicToolSchemas=o);let s={agentId:this.deferredStart.agentId,trigger:i};return this.deferredStart.input!==void 0&&(s.input=this.deferredStart.input),this.idempotencyKey!==void 0&&(s.idempotencyKey=this.idempotencyKey),s}let n={};return e.triggerName!==void 0&&(n.triggerName=e.triggerName),e.input!==void 0&&(n.input=e.input),e.rollbackAfterMessageId!==void 0&&(n.rollbackAfterMessageId=e.rollbackAfterMessageId),e.sender!==void 0&&(n.sender=e.sender),t!==void 0&&(n.executionId=t),r!==void 0&&(n.toolResults=r),o!==void 0&&(n.dynamicToolSchemas=o),n}latchSessionId(e){this.sessionId||(this.sessionId=e,this.deferredStart?.onSessionCreated?.(e))}latchSessionIdFromHeader(e){if(this.sessionId)return;let t=e.headers.get("X-Octavus-Session-Id");t&&this.latchSessionId(t)}handleResourceUpdate(e,t){let r=this.resourceMap.get(e);r&&r.onUpdate(t)}collectDynamicSchemas(){return this.mcpToolSchemas.length===0?this.dynamicToolSchemas:[...this.mcpToolSchemas,...this.dynamicToolSchemas??[]]}},G8=d.object({sessionId:d.string()}),K8=d.object({id:d.string(),agentId:d.string(),input:d.record(d.string(),d.unknown()),variables:d.record(d.string(),d.unknown()),resources:d.record(d.string(),d.unknown()),messages:d.array(RP),status:d.literal("active").optional(),createdAt:d.string(),updatedAt:d.string()}),Y8=d.object({sessionId:d.string(),agentId:d.string(),messages:d.array(Ef),status:d.literal("active").optional()}),Vb=d.object({sessionId:d.string(),agentId:d.string(),status:d.literal("expired"),createdAt:d.string()}),X8=d.object({sessionId:d.string(),restored:d.boolean()}),Q8=d.object({sessionId:d.string(),cleared:d.boolean()}),eW=d.looseObject({id:d.string(),timestamp:d.string(),type:d.string()}),tW=d.object({sessionId:d.string(),entries:d.array(eW),total:d.number().optional(),truncated:d.boolean().optional()}),rW=class extends Xi{async create(e,t){return(await this.httpPost("/api/agent-sessions",{agentId:e,input:t},G8)).sessionId}async get(e){let t=await fetch(`${this.config.baseUrl}/api/agent-sessions/${e}`,{method:"GET",headers:await this.config.getHeaders()});t.ok||await ko(t,"Request failed");let r=await t.json(),o=Vb.safeParse(r);return o.success?o.data:K8.parse(r)}async getMessages(e){let t=await fetch(`${this.config.baseUrl}/api/agent-sessions/${e}?format=ui`,{method:"GET",headers:await this.config.getHeaders()});t.ok||await ko(t,"Request failed");let r=await t.json(),o=Vb.safeParse(r);return o.success?o.data:Y8.parse(r)}async restore(e,t,r){return await this.httpPost(`/api/agent-sessions/${e}/restore`,{messages:t,input:r},X8)}async clear(e){return await this.httpDelete(`/api/agent-sessions/${e}`,Q8)}async getLogs(e,t){let r=new URLSearchParams;t?.excludeModelRequests&&r.set("excludeModelRequests","true");let o=r.toString(),n=`${this.config.baseUrl}/api/agent-sessions/${e}/logs${o?`?${o}`:""}`,i=await fetch(n,{method:"GET",headers:await this.config.getHeaders()});i.ok||await ko(i,"Request failed");let s=await i.json(),a=Vb.safeParse(s);return a.success?a.data:tW.parse(s)}attach(e,t={}){return new JP({sessionId:e,config:this.config,tools:t.tools,resources:t.resources,mcpServers:t.mcpServers,onToolResults:t.onToolResults,onToolResultTruncated:t.onToolResultTruncated,rejectClientToolCalls:t.rejectClientToolCalls})}start(e){return new JP({config:this.config,deferredStart:{agentId:e.agentId,input:e.input,idempotencyKey:e.idempotencyKey,onSessionCreated:e.onSessionCreated},tools:e.tools,resources:e.resources,mcpServers:e.mcpServers,onToolResults:e.onToolResults,onToolResultTruncated:e.onToolResultTruncated,rejectClientToolCalls:e.rejectClientToolCalls})}},Epe=d.object({filename:d.string().min(1).max(255),mediaType:d.string().min(1),size:d.number().int().positive()}),nW=d.object({id:d.string(),uploadUrl:d.url(),downloadUrl:d.url()}),oW=d.object({files:d.array(nW)}),iW=class extends Xi{async getUploadUrls(e,t){return await this.httpPost("/api/files/upload-urls",{sessionId:e,files:t},oW)}},GP=class extends Error{constructor(e,t,r){super(e),this.sessionId=t,this.details=r,this.name="WorkerError"}},sW=class extends Xi{async*execute(e,t,r={}){let o=r.mcpServers,n=o!==void 0&&o.length>0?Jb(o,r.tools,r.dynamicToolSchemas):{toolHandlers:r.tools??{},dynamicToolSchemas:r.dynamicToolSchemas};yield*Hb({config:this.config,getToolHandlers:()=>n.toolHandlers,url:`${this.config.baseUrl}/api/agents/${e}/execute`,buildBody:({executionId:i,toolResults:s})=>i?{type:"continue",executionId:i,toolResults:s}:{type:"start",input:t,...n.dynamicToolSchemas!==void 0&&{dynamicToolSchemas:n.dynamicToolSchemas}},errorContext:"Failed to execute worker"},{},r.signal)}async generate(e,t,r={}){let o,n,i,s,a,u,c;for await(let l of this.execute(e,t,r))l.type==="start"&&l.executionId?o=l.executionId:l.type==="error"?(i=l.message,s={errorType:l.errorType,source:l.source,code:l.code,retryable:l.retryable,retryAfter:l.retryAfter,provider:l.provider}):l.type==="worker-result"?(a=l.workerId,l.error!==void 0?i=i??l.error:n={output:l.output,sessionId:o??l.workerId}):l.type==="usage"&&(u=l.cost,c=l.tokens);if(i!==void 0)throw new GP(i,o??a,s);if(n!==void 0)return u!==void 0&&(n.cost=u),c!==void 0&&(n.tokens=c),n;throw new GP("Worker completed without producing a result",o)}async*continue(e,t,r,o={}){let n=o.mcpServers,i=n!==void 0&&n.length>0?Jb(n,o.tools).toolHandlers:o.tools??{};yield*Hb({config:this.config,getToolHandlers:()=>i,url:`${this.config.baseUrl}/api/agents/${e}/execute`,buildBody:({executionId:s,toolResults:a})=>({type:"continue",executionId:s??t,toolResults:a??r}),errorContext:"Failed to continue worker"},{executionId:t,toolResults:r},o.signal)}},aW=new Set(["completed","failed","cancelled"]);function cW(e){return aW.has(e)}var t1=d.string().transform(e=>e),KP=d.object({threadId:d.string(),status:t1}),uW=d.object({threadId:d.string(),status:t1,failureReason:d.string().nullable(),messages:d.array(Ef)}),lW=3e3,dW=900*1e3,fW=class extends Xi{async dispatch(e,t,r={}){return await this.httpPost(`/api/v1/workforce/agents/${encodeURIComponent(e)}/threads`,{message:t,files:r.files},KP)}async getThread(e,t){return await this.httpGet(`/api/v1/workforce/agents/${encodeURIComponent(e)}/threads/${encodeURIComponent(t)}`,uW)}async followUp(e,t,r,o={}){return await this.httpPost(`/api/v1/workforce/agents/${encodeURIComponent(e)}/threads/${encodeURIComponent(t)}/messages`,{message:r,files:o.files},KP)}async waitForCompletion(e,t,r={}){let o=r.pollIntervalMs??lW,n=r.timeoutMs??dW,i=Date.now()+n;for(;;){let s=await this.getThread(e,t);if(cW(s.status))return s;if(Date.now()+o>=i)throw new Error(`Workforce thread ${t} did not finish within ${n}ms (last status: ${s.status})`);await pW(o,r.signal)}}async run(e,t,r={}){let{threadId:o}=await this.dispatch(e,t,{files:r.files});return await this.waitForCompletion(e,o,r)}};function pW(e,t){return new Promise((r,o)=>{if(t?.aborted){o(YP(t));return}let n=setTimeout(()=>{t?.removeEventListener("abort",i),r()},e);function i(){clearTimeout(n),o(YP(t))}t?.addEventListener("abort",i,{once:!0})})}function YP(e){let t=e?.reason;return t instanceof Error?t:new Error("The wait was aborted")}var Ppe=d.object({agentId:d.string().min(1),sessionId:d.string().min(1).optional(),ttlSeconds:d.number().int().positive().optional()}),hW=d.object({token:d.string(),jti:d.string(),expiresAt:d.string()}),mW=class extends Xi{async mint(e){return await this.httpPost("/api/tokens",e,hW)}async revoke(e){return await this.httpPost("/api/tokens/revoke",{token:e},d.object({revoked:d.boolean(),jti:d.string().optional()}))}},gW="4",Gb=class{agents;agentSessions;files;workers;workforce;tokens;baseUrl;apiKey;traceModelRequests;constructor(e){this.baseUrl=e.baseUrl.replace(/\/$/,""),this.apiKey=e.apiKey,this.traceModelRequests=e.traceModelRequests??!1;let t={baseUrl:this.baseUrl,getHeaders:()=>this.getHeaders(),maxRetries:e.maxRetries,streamIdleTimeoutMs:e.streamIdleTimeoutMs};this.agents=new P8(t),this.agentSessions=new rW(t),this.files=new iW(t),this.workers=new sW(t),this.workforce=new fW(t),this.tokens=new mW(t)}getSessionUrl(e){return`${this.baseUrl}/platform/sessions/${e}`}getAgentUrl(e){return`${this.baseUrl}/platform/agents/${e}`}async getHeaders(){let e={"Content-Type":"application/json","X-Octavus-Sdk-Version":gW},t=typeof this.apiKey=="function"?await this.apiKey():this.apiKey;return t&&(e.Authorization=`Bearer ${t}`),this.traceModelRequests&&(e["X-Octavus-Trace"]="true"),e}};function _W(e){let t=atob(e),r=new ArrayBuffer(t.length),o=new Uint8Array(r);for(let n=0;n<t.length;n++)o[n]=t.charCodeAt(n);return r}async function r1(e,t,r){for(let o of e){if(o.outputVariable)continue;let n=VP(o.result);if(!n)continue;let i=o.files?[...o.files]:[],s=[],a=[],u=[],c=[],l=[];if(n.parts.forEach((g,_)=>{if(!wf(g))return;let v=_W(g.data),w=g.type==="image"?qP(new Uint8Array(v)):void 0,k=g.type==="image"&&w!==void 0,S=w??FP(g);s.push(_),a.push(g.type),u.push(v),l.push(k),c.push({filename:`${g.type}-${uc()}.${WP(S)}`,mediaType:S,size:v.byteLength})}),c.length===0)continue;let f=null;try{f=(await t.getUploadUrls(r,c)).files}catch{f=null}let p=f===null?null:await Promise.allSettled(f.map((g,_)=>fetch(g.uploadUrl,{method:"PUT",body:u[_],headers:{"Content-Type":c[_].mediaType}}))),h=new Map;s.forEach((g,_)=>{let v=a[_],w=c[_].mediaType,k=c[_].filename,S=u[_].byteLength,b=f?.[_],T=p?.[_],C=T?.status==="fulfilled"&&T.value.ok&&b!==void 0,N=l[_];if(C){N&&i.push({id:b.id,mediaType:w,url:b.downloadUrl,filename:k,size:S});let I=v==="image"&&!N;h.set(g,{type:v,mediaType:w,size:S,url:b.downloadUrl,...I&&{error:BP}})}else h.set(g,{type:v,mediaType:w,size:S,error:"Upload failed"})});let m=n.parts.map((g,_)=>h.has(_)?h.get(_):g);o.files=i,o.result=n.rebuild(m)}}function n1(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function vW(e){return n1(e)?typeof e.name=="string"&&(e.path===void 0||typeof e.path=="string")&&typeof e.mediaType=="string"&&typeof e.size=="number"&&typeof e.contentBase64=="string":!1}function yW(e){let t=atob(e),r=new ArrayBuffer(t.length),o=new Uint8Array(r);for(let n=0;n<t.length;n++)o[n]=t.charCodeAt(n);return r}async function o1(e,t,r){for(let o of e){if(o.outputVariable)continue;let n=o.result;if(!n1(n))continue;let i=n.outputFiles;if(!Array.isArray(i)||i.length===0)continue;let s=i.filter(vW);if(s.length===0)continue;let a=[],u=[];for(let h of s){let m=yW(h.contentBase64);a.push(m),u.push({filename:h.name,mediaType:h.mediaType,size:h.size})}let c;try{c=(await t.getUploadUrls(r,u)).files}catch{n.outputFiles=s.map(h=>({name:h.name,...h.path!==void 0?{path:h.path}:{},mediaType:h.mediaType,size:h.size,error:"Upload failed"}));continue}let l=await Promise.allSettled(c.map((h,m)=>fetch(h.uploadUrl,{method:"PUT",body:a[m],headers:{"Content-Type":u[m].mediaType}}))),f=o.files?[...o.files]:[],p=[];for(let h=0;h<s.length;h++){let m=l[h],g=c[h],_=u[h],v=s[h];m.status==="fulfilled"&&m.value.ok?(f.push({id:g.id,mediaType:_.mediaType,url:g.downloadUrl,filename:_.filename,size:_.size}),p.push({name:_.filename,...v.path!==void 0?{path:v.path}:{},mediaType:_.mediaType,size:_.size,url:g.downloadUrl})):p.push({name:_.filename,...v.path!==void 0?{path:v.path}:{},mediaType:_.mediaType,size:_.size,error:"Upload failed"})}o.files=f,n.outputFiles=p}}var OA=We(h1(),1);import{existsSync as Wc,mkdirSync as bp,readdirSync as vp,readFileSync as Fx,renameSync as aK,rmSync as yp,statSync as cK,writeFileSync as IA}from"fs";import{execFile as uK}from"child_process";import{dirname as lK,join as vt,normalize as dK,relative as PA,sep as fK}from"path";import{createHash as pK,randomBytes as zA}from"crypto";var hK={txt:"text/plain",md:"text/markdown",csv:"text/csv",json:"application/json",yaml:"application/yaml",yml:"application/yaml",xml:"application/xml",html:"text/html",htm:"text/html",pdf:"application/pdf",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",pptx:"application/vnd.openxmlformats-officedocument.presentationml.presentation",png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",svg:"image/svg+xml",mp4:"video/mp4",mp3:"audio/mpeg",wav:"audio/wav",py:"text/x-python",js:"text/javascript",ts:"text/typescript",zip:"application/zip"};function Vx(e){let t=e.lastIndexOf(".");if(t<0)return"application/octet-stream";let r=e.slice(t+1).toLowerCase();return hK[r]??"application/octet-stream"}var mK=3e5,gK=10*1024*1024,_K=20*1024*1024,vK=50*1024*1024,yK=20*1024*1024,TA=".octavus-skill.json",bK=new Set(["PATH","HOME","USER","LOGNAME","SHELL","TMPDIR","TEMP","TMP","LANG","LC_ALL","LC_CTYPE","TZ","APPDATA","LOCALAPPDATA","PROGRAMDATA","USERPROFILE","USERNAME","USERDOMAIN","HOMEDRIVE","HOMEPATH","SYSTEMROOT","SYSTEMDRIVE","WINDIR","COMSPEC","PATHEXT","PUBLIC","PROGRAMFILES","PROGRAMFILES(X86)","PROGRAMW6432","COMMONPROGRAMFILES","COMMONPROGRAMFILES(X86)","COMMONPROGRAMW6432","NUMBER_OF_PROCESSORS","PROCESSOR_ARCHITECTURE","OS"]),Wx=class{skills=new Map;extracted=new Map;inflight=new Map;installedSha=new Map;installErrors=new Map;installLocks=new Map;skillsDir;pythonPath;bashPath;turnOutputDir=null;collectedFiles=new Map;constructor(e){this.skillsDir=e.skillsDir,this.pythonPath=e.pythonPath,this.bashPath=e.bashPath,bp(this.skillsDir,{recursive:!0}),this.sweepStagingDirs(),this.reconcileFromDisk();for(let t of e.skills)this.skills.set(t.slug,t)}setSkills(e){this.skills.clear();for(let t of e)this.skills.set(t.slug,t);for(let t of[...this.extracted.keys()]){let r=this.skills.get(t);if(!r){this.extracted.delete(t);continue}let o=this.installedSha.get(t);r.bundleSha256&&o!==r.bundleSha256&&this.extracted.delete(t)}for(let t of[...this.installErrors.keys()])this.skills.has(t)||this.installErrors.delete(t);this.reconcileFromDisk()}reconcileFromDisk(){let e;try{e=vp(this.skillsDir,{withFileTypes:!0})}catch{return}for(let t of e){if(!t.isDirectory())continue;let r=t.name;if(r.startsWith(".")||r.includes(".staging-"))continue;let o=vt(this.skillsDir,r);(Wc(vt(o,"SKILL.md"))||Wc(vt(o,"scripts")))&&(this.skills.has(r)||this.skills.set(r,{slug:r,secrets:{}}),this.installedSha.has(r)||this.installedSha.set(r,this.readInstalledMarker(o)))}}readInstalledMarker(e){try{let t=Fx(vt(e,TA),"utf-8"),r=JSON.parse(t);return typeof r.sha256=="string"?r.sha256:void 0}catch{return}}async setupSkill(e){this.skills.set(e.slug,e),this.extracted.delete(e.slug);try{let t=await this.downloadAndExtract(e.slug,{allowStaleFallback:!1});return t?{installed:!0,path:PA(vt(this.skillsDir,".."),t.dir)||t.dir}:{installed:!1,error:`Skill "${e.slug}" is not configured on this device`}}catch(t){let r=t instanceof Error?t.message:String(t);return this.installErrors.set(e.slug,r),{installed:!1,error:r}}}toolHandlers(){return{octavus_skill_read:e=>this.handleSkillRead(e),octavus_skill_list:e=>this.handleSkillList(e),octavus_skill_run:e=>this.handleSkillRun(e)}}async handleSkillRead(e){let t=Es(e,"skill");if(!t)return{error:"Missing required parameter: skill"};let r=await this.ensureExtracted(t);if(!r)return this.unavailableError(t);let o=Es(e,"file")??"SKILL.md",n=Bx(r.dir,o);if(!n)return{error:`Invalid file path: ${o}`};let i=qx(r);try{return{content:Fx(n,"utf-8"),path:o,...i?{warning:i}:{}}}catch{return{error:`File not found: ${o}`}}}async handleSkillList(e){let t=Es(e,"skill");if(!t)return{error:"Missing required parameter: skill"};let r=await this.ensureExtracted(t);if(!r)return this.unavailableError(t);let o=qx(r),n=vt(r.dir,"scripts");try{let s=vp(n,{withFileTypes:!0}).filter(a=>a.isFile()).map(a=>({name:a.name,path:`scripts/${a.name}`}));return{skill:t,scripts:s,...o?{warning:o}:{}}}catch{return{skill:t,scripts:[],...o?{warning:o}:{}}}}async handleSkillRun(e){let t=Es(e,"skill");if(!t)return{error:"Missing required parameter: skill"};let r=Es(e,"script");if(!r)return{error:"Missing required parameter: script"};let o=await this.ensureExtracted(t);if(!o)return this.unavailableError(t);let n=Bx(o.dir,r);if(!n||!Wc(n))return{error:`Script not found: ${r}`};let i=this.ensureTurnOutputDir(),s=Date.now(),a=wK(e.input)?e.input:void 0,u=this.skills.get(t)?.secrets??{},c={...kK(),...u,OUTPUT_DIR:i,PYTHONUTF8:"1",PYTHONIOENCODING:"utf-8"},l=xK(Es(e,"args"),c),{command:f,prefixArgs:p}=this.resolveInterpreter(n),h=await new Promise(_=>{let v=uK(f,[...p,n,...l],{cwd:o.dir,env:c,timeout:mK,maxBuffer:gK},(w,k,S)=>{_({stdout:k,stderr:S,exitCode:typeof w?.code=="number"?w.code:0,error:w?w.message:void 0})});a&&v.stdin&&(v.stdin.write(JSON.stringify(a)),v.stdin.end())}),m=this.readNewOutputFiles(s),g=qx(o);return{stdout:h.stdout||void 0,stderr:h.stderr||void 0,exitCode:h.exitCode,error:h.error,outputFiles:m.length>0?m:void 0,...g?{warning:g}:{}}}resolveInterpreter(e){return e.endsWith(".py")?{command:this.pythonPath??(process.platform==="win32"?"python":"python3"),prefixArgs:[]}:process.platform==="win32"&&e.endsWith(".ps1")?{command:"powershell.exe",prefixArgs:["-NoProfile","-ExecutionPolicy","Bypass","-File"]}:{command:this.bashPath??"bash",prefixArgs:[]}}unavailableError(e){let t=this.installErrors.get(e);return t?{error:`${t} (install failed - call octavus_skill_setup with skill "${e}" to retry)`}:{error:`Skill "${e}" is not available on this device`}}ensureTurnOutputDir(){if(!this.turnOutputDir){let e=zA(4).toString("hex");this.turnOutputDir=vt(this.skillsDir,".runs",e,"output"),bp(this.turnOutputDir,{recursive:!0})}return this.turnOutputDir}readNewOutputFiles(e){if(!this.turnOutputDir)return[];let t;try{t=vp(this.turnOutputDir,{withFileTypes:!0})}catch{return[]}let r=[],o=0;for(let n of t){if(!n.isFile())continue;let i=vt(this.turnOutputDir,n.name);try{let s=cK(i),a=this.collectedFiles.get(n.name),u=!a,c=a!==void 0&&s.mtimeMs>e;if(!u&&!c)continue;let l=Fx(i);if(l.byteLength>_K)continue;if(o+l.byteLength>vK)break;o+=l.byteLength,r.push({name:n.name,path:i,mediaType:Vx(n.name),size:l.byteLength,contentBase64:l.toString("base64")}),this.collectedFiles.set(n.name,{size:s.size,mtimeMs:s.mtimeMs})}catch{}}return r}cleanupRuns(){let e=vt(this.skillsDir,".runs");try{yp(e,{recursive:!0,force:!0})}catch{}this.turnOutputDir=null,this.collectedFiles.clear()}async ensureExtracted(e){let t=this.extracted.get(e);if(t)return t;let r=this.inflight.get(e);if(r)return await r;let o=this.downloadAndExtract(e,{allowStaleFallback:!0}).catch(n=>(this.installErrors.set(e,n instanceof Error?n.message:String(n)),null)).finally(()=>{this.inflight.delete(e)});return this.inflight.set(e,o),await o}async downloadAndExtract(e,t){let r=this.skills.get(e);if(!r)return null;let o=vt(this.skillsDir,e),n=Wc(vt(o,"SKILL.md"))||Wc(vt(o,"scripts")),i=this.installedSha.get(e),s=r.bundleSha256!==void 0&&i!==r.bundleSha256;if(n&&!s){let u={slug:e,dir:o};return this.extracted.set(e,u),u}try{await this.installBundle(r,o)}catch(u){let c=u instanceof Error?u.message:String(u);if(t.allowStaleFallback&&n){let l={slug:e,dir:o,staleReason:c};return this.extracted.set(e,l),l}throw new Error(`Skill "${e}" bundle error: ${c}`,{cause:u})}this.installedSha.set(e,r.bundleSha256),this.installErrors.delete(e);let a={slug:e,dir:o};return this.extracted.set(e,a),a}async installBundle(e,t){let o=(this.installLocks.get(e.slug)??Promise.resolve()).then(()=>this.performBundleInstall(e,t));this.installLocks.set(e.slug,o.then(()=>{},()=>{})),await o}async performBundleInstall(e,t){if(!e.bundleUrl)throw new Error(`No bundle URL for skill "${e.slug}" - call octavus_skill_setup to (re)install it`);let r=await fetch(e.bundleUrl);if(!r.ok)throw new Error(`Bundle download failed: HTTP ${r.status} ${r.statusText}`);let o=Buffer.from(await r.arrayBuffer());if(e.bundleSha256){let i=pK("sha256").update(o).digest("hex");if(i!==e.bundleSha256)throw new Error(`Bundle SHA-256 mismatch: expected ${e.bundleSha256.slice(0,12)}..., got ${i.slice(0,12)}...`)}let n=`${t}.staging-${zA(4).toString("hex")}`;try{bp(n,{recursive:!0}),await EK(o,n),IA(vt(n,TA),JSON.stringify({sha256:e.bundleSha256??null})),yp(t,{recursive:!0,force:!0}),aK(n,t)}catch(i){throw yp(n,{recursive:!0,force:!0}),i}}sweepStagingDirs(){let e;try{e=vp(this.skillsDir,{withFileTypes:!0})}catch{return}for(let t of e)if(!(!t.isDirectory()||!t.name.includes(".staging-")))try{yp(vt(this.skillsDir,t.name),{recursive:!0,force:!0})}catch{}}};function Es(e,t){let r=e[t];return typeof r=="string"&&r.length>0?r:void 0}function qx(e){return e.staleReason?`Using the previously installed version of "${e.slug}" - the latest bundle failed to install: ${e.staleReason}`:void 0}function wK(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Bx(e,t){let r=dK(vt(e,t)),o=PA(e,r);return o===".."||o.startsWith(`..${fK}`)?null:r}function xK(e,t){return e?process.platform==="win32"?SK(e,t):(0,OA.parse)(e,t).filter(r=>typeof r=="string"):[]}function SK(e,t){let r=[],o="",n=!1,i=!1;for(let s of e){if(s==='"'){n=!n,i=!0;continue}if(!n&&(s===" "||s===" ")){i&&(r.push(o),o="",i=!1);continue}o+=s,i=!0}return i&&r.push(o),r.map(s=>$K(s,t))}function $K(e,t){let r=e.replace(/%([A-Za-z_][A-Za-z0-9_()]*)%/g,(o,n)=>t[n]??o);return r=r.replace(/\$\{([A-Za-z_][A-Za-z0-9_]*)\}/g,(o,n)=>t[n]??""),r=r.replace(/\$([A-Za-z_][A-Za-z0-9_]*)/g,(o,n)=>t[n]??""),r}function kK(){let e={};for(let t of bK){let r=process.env[t];typeof r=="string"&&(e[t]=r)}return e}async function EK(e,t){let o=await(await Promise.resolve().then(()=>We(EA(),1))).default.loadAsync(e),n=Object.keys(o.files).filter(s=>!o.files[s].dir);if(n.length===0)return;let i=zK(n);for(let s of n){if(s.includes("__MACOSX/"))continue;let a=i?s.slice(i.length):s;if(!a)continue;let u=Bx(t,a);if(!u)continue;let l=await o.files[s].async("nodebuffer");if(l.byteLength>yK)throw new Error(`Skill bundle entry too large: ${s}`);bp(lK(u),{recursive:!0}),IA(u,l)}}function zK(e){let t=null;for(let r of e){if(r.startsWith("__MACOSX/"))continue;let o=r.indexOf("/");if(o===-1)return null;let n=r.slice(0,o+1);if(t===null)t=n;else if(t!==n)return null}return t}import{stat as DK,readFile as jK}from"fs/promises";import{basename as UK,resolve as Hx,isAbsolute as jA,relative as LK,sep as MK}from"path";var wp={info(e,t){console.log(JSON.stringify({level:"info",message:e,...t,ts:new Date().toISOString()}))},warn(e,t){console.warn(JSON.stringify({level:"warn",message:e,...t,ts:new Date().toISOString()}))},error(e,t,r){let o=t instanceof Error?{error:t.message,stack:t.stack}:{error:t};console.error(JSON.stringify({level:"error",message:e,...o,...r,ts:new Date().toISOString()}))}},TK=1e3,IK=3e4,PK=.25,OK=60,RA=50,RK=6e4,CK=1e4,AK=45e3,NK=1e4,DA=class{config;log;ws=null;state="disconnected";reconnectAttempts=0;reconnectTimer=null;heartbeatTimer=null;livenessTimer=null;lastPingAt=0;intentionalClose=!1;hadDisconnect=!1;pendingLifecycle=[];constructor(e){this.config=e,this.log=e.logger??wp}getState(){return this.state}connect(){this.state==="connected"||this.state==="connecting"||(this.intentionalClose=!1,this.openWebSocket())}updateToken(e){this.config={...this.config,computerToken:e}}disconnect(){this.intentionalClose=!0,this.hadDisconnect=!1,this.clearTimers(),this.closeSocket("Client disconnect"),this.pendingLifecycle=[],this.setState("disconnected")}async closeGracefully(e=3e3){this.intentionalClose=!0,this.hadDisconnect=!1,this.clearTimers(),this.pendingLifecycle=[],this.setState("disconnected");let t=this.ws;this.ws=null,t&&await new Promise(r=>{let o=!1,n=null,i=()=>{o||(o=!0,n&&clearTimeout(n),r())};t.removeAllListeners(),t.on("close",i),t.on("error",i),t.readyState===kn.OPEN||t.readyState===kn.CONNECTING?(t.close(1e3,"Client disconnect"),n=setTimeout(()=>{try{t.terminate()}catch{}i()},e)):i()})}resetAndReconnect(){this.intentionalClose=!1,this.clearTimers(),this.closeSocket("Reset for reconnect"),this.reconnectAttempts=0,this.openWebSocket()}closeSocket(e){if(!this.ws)return;let t=this.ws;this.ws=null,t.removeAllListeners(),t.on("error",()=>{}),(t.readyState===kn.OPEN||t.readyState===kn.CONNECTING)&&t.close(1e3,e)}sendSessionEvent(e,t,r){this.send({type:"session-event",sessionId:e,event:t,seq:r})}sendSessionState(e,t,r){this.send({type:"session-state",sessionId:e,events:t,lastSeq:r})}sendSessionStarted(e){this.send({type:"session-started",sessionId:e})}sendSessionComplete(e,t,r,o,n){this.send({type:"session-complete",sessionId:e,status:t,error:r,errorType:o,title:n})}sendSessionTitle(e,t){this.send({type:"session-title",sessionId:e,title:t})}sendSessionRetry(e,t){this.send({type:"session-retry",sessionId:e,attempt:t.attempt,reason:t.reason,delayMs:t.delayMs})}sendDispatchAck(e){this.send({type:"dispatch-ack",sessionId:e})}openWebSocket(){this.setState("connecting");let e=new URL("/ws/computer",this.config.operatorWsUrl);e.searchParams.set("token",this.config.computerToken),this.ws=new kn(e.toString(),{handshakeTimeout:CK}),this.ws.on("open",()=>{let t=this.reconnectAttempts>0||this.hadDisconnect;this.reconnectAttempts=0,this.hadDisconnect=!1,this.setState("connected"),this.send({type:"sync",octoAgentIds:[this.config.octoAgentId],activeSessionIds:this.config.getActiveSessionIds?.()}),this.flushPendingLifecycle(),this.startHeartbeat(),this.startPingLiveness(),this.log.info("Connected to operator",{octoAgentId:this.config.octoAgentId,isReconnect:t}),t&&this.config.onReconnected?.()}),this.ws.on("message",t=>{let r=typeof t=="string"?t:Buffer.from(t).toString("utf8");this.handleMessage(r)}),this.ws.on("ping",()=>{this.lastPingAt=Date.now()}),this.ws.on("close",(t,r)=>{this.log.info("WebSocket closed",{octoAgentId:this.config.octoAgentId,code:t,reason:r?.toString()}),this.onDisconnect(t)}),this.ws.on("error",t=>{this.log.error("WebSocket error",t,{octoAgentId:this.config.octoAgentId})})}handleMessage(e){let t;try{t=vP.parse(JSON.parse(e))}catch{this.log.warn("Invalid message from operator",{octoAgentId:this.config.octoAgentId});return}switch(t.type){case"dispatch":this.config.onDispatch(t);break;case"stop":this.config.onStop(t.sessionId);break;case"request-session-state":this.config.onRequestSessionState(t.sessionId);break;case"start-screen-stream":case"device-reconnect":case"device-reconnect-agents":case"device-restart":case"start-voice-call":case"read-slack-prefs":this.config.onDeviceControl?.(t);break;case"heartbeat":break}}onDisconnect(e){if(this.clearTimers(),this.ws=null,this.intentionalClose){this.setState("disconnected");return}if(this.hadDisconnect=!0,e===bP){this.log.info("Connection revoked by operator, not reconnecting",{octoAgentId:this.config.octoAgentId}),this.config.onDisconnected?.({revoked:!0}),this.setState("disconnected");return}if(this.config.onDisconnected?.({revoked:!1}),this.reconnectAttempts>=OK){this.log.error("Max reconnect attempts reached",void 0,{octoAgentId:this.config.octoAgentId,attempts:this.reconnectAttempts}),this.setState("disconnected");return}this.setState("reconnecting"),this.scheduleReconnect()}scheduleReconnect(){let e=Math.min(TK*2**this.reconnectAttempts,IK),t=e*PK*(Math.random()*2-1),r=Math.max(0,e+t);this.reconnectAttempts+=1,this.log.info("Scheduling reconnect",{octoAgentId:this.config.octoAgentId,attempt:this.reconnectAttempts,delayMs:Math.round(r)}),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.openWebSocket()},r)}startHeartbeat(){this.stopHeartbeat(),this.heartbeatTimer=setInterval(()=>{this.send({type:"heartbeat"})},yP)}stopHeartbeat(){this.heartbeatTimer&&(clearInterval(this.heartbeatTimer),this.heartbeatTimer=null)}startPingLiveness(){this.stopPingLiveness(),this.lastPingAt=Date.now(),this.livenessTimer=setInterval(()=>{Date.now()-this.lastPingAt<=AK||(this.log.warn("No ping from operator - terminating stale socket",{octoAgentId:this.config.octoAgentId}),this.ws?.terminate())},NK)}stopPingLiveness(){this.livenessTimer&&(clearInterval(this.livenessTimer),this.livenessTimer=null)}clearTimers(){this.stopHeartbeat(),this.stopPingLiveness(),this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}send(e){this.ws?.readyState===kn.OPEN?this.ws.send(JSON.stringify(e)):(e.type==="session-started"||e.type==="session-complete"||e.type==="dispatch-ack")&&(this.pendingLifecycle.length<RA?(this.pendingLifecycle.push({msg:e,at:Date.now()}),this.log.info("Buffered lifecycle message for reconnect",{type:e.type,sessionId:"sessionId"in e?e.sessionId:void 0,buffered:this.pendingLifecycle.length})):this.log.warn("Lifecycle buffer full, dropping message",{type:e.type,sessionId:"sessionId"in e?e.sessionId:void 0,cap:RA}))}setState(e){this.state!==e&&(this.state=e,this.config.onStateChange?.(e))}flushPendingLifecycle(){if(this.pendingLifecycle.length===0)return;let e=Date.now(),t=this.pendingLifecycle.filter(({at:r})=>e-r<RK);if(this.pendingLifecycle=[],t.length!==0){this.log.info("Flushing buffered lifecycle messages",{count:t.length});for(let{msg:r}of t)this.ws?.readyState===kn.OPEN&&this.ws.send(JSON.stringify(r))}}},UA=1,Gx=600,ZK=d.object({seconds:d.number().min(UA).max(Gx)}),FK=Ab.length+1,qK=800*1e3,Jx=120*1e3,BK=qK+Gx*1e3+Jx+120*1e3,VK=class{config;client;abortController=null;agentSession=null;title=null;eventBuffer=[];nextSeq=0;stalledByWatchdog=!1;stallTimer=null;constructor(e){this.config=e,this.client=new Gb({baseUrl:e.platformUrl,apiKey:e.operatorToken,traceModelRequests:e.traceModelRequests})}get sessionId(){return this.config.sessionId}updateConfig(e){this.config=e,this.client=new Gb({baseUrl:e.platformUrl,apiKey:e.operatorToken,traceModelRequests:e.traceModelRequests}),this.title=null,this.eventBuffer=[],this.nextSeq=0}async execute(){this.abortController=new AbortController,this.stalledByWatchdog=!1;let e;for(let t=0;t<FK;t++){let r=await this.runOnce();if(r.kind==="completed"||r.kind==="hard-error")return r.sessionResult;r.kind==="provider-error"&&(e=r.sessionResult);let o=Ab[t];if(o===void 0||this.abortController.signal.aborted||(this.config.onRetry?.(t+1,r.kind,o),await this.sleepUnlessAborted(o),this.abortController.signal.aborted))break;this.resetForRetry()}return this.abortController.signal.aborted?{status:"completed",title:this.title??void 0}:e||{status:"failed",error:"Lost connection to platform after multiple retry attempts",errorType:"transport",title:this.title??void 0}}async runOnce(){let{sessionId:e,trigger:t,onEvent:r}=this.config;this.agentSession??=this.createAgentSession();try{let o=this.agentSession.execute({type:"trigger",triggerName:t.triggerName,input:t.input,sender:t.sender},{signal:this.abortController.signal}),n=null,i=!1;this.bumpStallWatchdog();for await(let s of o){if(this.abortController.signal.aborted)break;let a=this.nextSeq;this.nextSeq+=1;let u=s;this.eventBuffer.push({seq:a,event:u}),r(e,s,a),this.bumpStallWatchdog(),s.type==="finish"?(this.eventBuffer=[],i=!0):(i=!1,s.type==="error"&&(n=u))}if(i)return{kind:"completed",sessionResult:{status:"completed",title:this.title??void 0}};if(this.stalledByWatchdog)return{kind:"hard-error",sessionResult:this.stallResult()};if(n){let s=lP(n,this.title);return s.retryable?{kind:"provider-error",sessionResult:s}:{kind:"hard-error",sessionResult:s}}return{kind:"transport-drop"}}catch(o){if(this.stalledByWatchdog)return{kind:"hard-error",sessionResult:this.stallResult()};if(this.abortController.signal.aborted)return{kind:"completed",sessionResult:{status:"completed",title:this.title??void 0}};let n=bf(o);if(n==="transport")return{kind:"transport-drop"};let i=yf(o),s=xf.isInstance(o)?o:new xf({errorType:"internal_error",message:i,source:"platform",retryable:!1,cause:o}),a=Nb(s),u=this.nextSeq;return this.nextSeq+=1,this.eventBuffer.push({seq:u,event:a}),r(e,a,u),n==="network"||n==="timeout"?{kind:"network-error"}:{kind:"hard-error",sessionResult:{status:"failed",error:i,errorType:n,title:this.title??void 0}}}finally{this.clearStallWatchdog()}}bumpStallWatchdog(){this.clearStallWatchdog(),this.stallTimer=setTimeout(()=>{this.stallTimer=null,this.stalledByWatchdog=!0,this.abortController?.abort()},BK)}clearStallWatchdog(){this.stallTimer&&(clearTimeout(this.stallTimer),this.stallTimer=null)}stallResult(){return{status:"failed",error:"The run stopped making progress and was ended. Send a message to continue.",errorType:"transport",title:this.title??void 0}}getBufferedEvents(){return{events:this.eventBuffer.map(e=>e.event),lastSeq:this.nextSeq>0?this.nextSeq-1:-1}}stop(){this.abortController?.abort()}createAgentSession(){let{sessionId:e,computer:t,tools:r}=this.config,o=this.client.agentSessions.attach(e,{tools:this.buildStaticToolHandlers(r,t),onToolResults:n=>this.uploadToolResults(n,e),onToolResultTruncated:n=>{(this.config.logger??wp).warn("Tool result too large; reduced to a preview before sending",{sessionId:e,toolName:n.toolName,originalBytes:n.originalBytes,keptBytes:n.keptBytes,variableCapture:n.variableCapture})},rejectClientToolCalls:!0});return o.setDynamicTools(t),o}async uploadToolResults(e,t){this.stallTimer&&this.bumpStallWatchdog();let r=(async()=>{await r1(e,this.client.files,t),await o1(e,this.client.files,t)})(),o,n=new Promise(i=>{o=setTimeout(()=>i("timeout"),Jx)});try{await Promise.race([r.then(()=>"done"),n])==="timeout"&&((this.config.logger??wp).warn("Tool result upload exceeded its time budget; continuing without full offload",{sessionId:t,budgetMs:Jx}),r.catch(()=>{}))}finally{o&&clearTimeout(o)}}resetForRetry(){this.eventBuffer=[],this.agentSession=this.createAgentSession()}sleepUnlessAborted(e){return new Promise(t=>{let r=this.abortController?.signal;if(r?.aborted){t();return}let o=null,n=()=>{o!==null&&clearTimeout(o),t()};o=setTimeout(()=>{r?.removeEventListener("abort",n),t()},e),r?.addEventListener("abort",n,{once:!0})})}buildStaticToolHandlers(e,t){let r=d.object({title:d.string().min(1)}),o={"set-chat-title":n=>{let i=r.safeParse(n);return i.success?(this.title=i.data.title,this.config.onTitleChange?.(this.config.sessionId,i.data.title),Promise.resolve({success:!0,title:i.data.title})):Promise.resolve({success:!1,error:"Title must be a non-empty string"})},wait:n=>this.handleWait(n)};return t&&(o["computer-ensure-ready"]=()=>this.handleEnsureReady(),o["computer-get-status"]=()=>this.handleGetStatus(),o["computer-reset"]=()=>this.handleReset()),e&&Object.assign(o,e),o}async handleEnsureReady(){let e=this.config.computer,{environment:t}=this.config;if(lc(e))try{let r=await e.ensureReady();return this.agentSession?.setDynamicTools(e),{ready:r.healthy,tools:e.toolSchemas().map(o=>o.name),...(r.recovered?.length??0)>0&&{recovered:r.recovered},...(r.failedEntries?.length??0)>0&&{failedEntries:r.failedEntries},...t&&{environment:t}}}catch(r){return{ready:!1,error:r instanceof Error?r.message:String(r)}}return{ready:!0,tools:e.toolSchemas().map(r=>r.name),...t&&{environment:t}}}async handleGetStatus(){let e=this.config.computer;if(lc(e))try{let t=await e.getHealth();return{ready:t.healthy,tools:t.totalTools,entries:t.entries}}catch(t){return{ready:!1,error:t instanceof Error?t.message:String(t)}}return{ready:!0,schemasAvailable:!0,tools:e.toolSchemas().length}}async handleReset(){let{onComputerReset:e}=this.config;if(!e)return{ready:!1,error:"Reset not available"};try{let t=await e();return this.config.computer=t,this.agentSession?.setDynamicTools(t),{ready:lc(t)?(await t.getHealth()).healthy:!0,tools:t.toolSchemas().map(o=>o.name),reset:!0}}catch(t){return{ready:!1,error:t instanceof Error?t.message:String(t)}}}handleWait(e){let t=ZK.safeParse(e);if(!t.success)return Promise.resolve({success:!1,error:`seconds must be a number between ${UA} and ${Gx}`});let r=Math.round(t.data.seconds*1e3),o=this.abortController?.signal;return new Promise(n=>{if(o?.aborted){n({success:!0,waited_ms:0,aborted:!0});return}let i=setTimeout(()=>n({success:!0,waited_ms:r}),r);o?.addEventListener("abort",()=>{clearTimeout(i),n({success:!0,waited_ms:0,aborted:!0})},{once:!0})})}},WK=5e3,HK=10*6e4,JK=6e4,CA=20*1024*1024,AA=4e4;function GK(e){return new Promise(t=>{setTimeout(t,e)})}var KK=d.object({slug:d.string().min(1)}),YK=d.object({command:d.string().min(1),args:d.array(d.string()).optional(),env:d.record(d.string(),d.string()).optional(),connection:d.enum(["eager","lazy"]).optional()});function NA(e){return JSON.stringify({command:e.command,args:e.args,env:e.env,connection:e.connection})}var LA=class{config;log;activeExecutors=new Map;executorCache=new Map;cancelledSessions=new Map;stoppedSessions=new Set;terminalFailures=new Map;connectionLossTimer=null;idleCleanupTimer=null;afterSessionTimer=null;running=!1;resolvedComputer=null;computerPromise=null;currentDeviceMcpFingerprints=new Map;deviceSkillHandler=null;activeToolHandlers=null;oneShotResolvers=new Map;constructor(e){this.config=e,this.log=e.logger??wp}start(){this.running||(this.running=!0,this.idleCleanupTimer=setInterval(()=>this.cleanupIdleExecutors(),6e4))}async stop(){if(this.running=!1,this.cancelConnectionLossTimer(),this.idleCleanupTimer&&(clearInterval(this.idleCleanupTimer),this.idleCleanupTimer=null),this.afterSessionTimer&&(this.cancelAfterSessionTimer(),await this.fireAfterSession()),this.activeExecutors.size>0){for(let t of this.activeExecutors.values())t.stop();let e=Date.now()+WK;for(;this.activeExecutors.size>0&&Date.now()<e;)await GK(200);this.activeExecutors.size>0&&(this.log.warn("Drain timed out, forcing cleanup",{remaining:this.activeExecutors.size}),this.activeExecutors.clear(),this.notifyStateChange())}this.executorCache.clear(),this.cancelledSessions.clear(),this.stoppedSessions.clear()}getActiveSessions(){return[...this.activeExecutors.keys()].map(e=>({sessionId:e,octoAgentId:this.config.octoAgentId}))}isExecuting(){return this.activeExecutors.size>0}resetComputer(){this.resolvedComputer=null,this.computerPromise=null,this.currentDeviceMcpFingerprints.clear()}handleDispatch(e){return this.running?(this.cancelAfterSessionTimer(),this.activeExecutors.has(e.sessionId)?(this.log.warn("Ignoring duplicate dispatch for active session",{sessionId:e.sessionId}),this.config.connection.sendDispatchAck(e.sessionId),!0):(this.config.connection.sendDispatchAck(e.sessionId),this.executeSession(e).catch(t=>{this.log.error("Session execution threw outside its handler",t,{sessionId:e.sessionId})}),!0)):!1}async runLocalDispatch(e){let t=new Promise(r=>{this.oneShotResolvers.set(e.sessionId,r)});if(!this.handleDispatch(e))throw this.oneShotResolvers.delete(e.sessionId),new Error("SessionManager is not running");return await t}emitSessionComplete(e,t,r,o,n){this.config.connection.sendSessionComplete(e,t,r,o,n);let i=this.stoppedSessions.delete(e),s=this.oneShotResolvers.get(e);s&&(this.oneShotResolvers.delete(e),s(i&&t==="completed"?{status:"cancelled",title:n}:{status:t,error:r,errorType:o,title:n}))}handleStop(e){this.stoppedSessions.add(e);let t=this.activeExecutors.get(e);t?t.stop():this.cancelledSessions.set(e,Date.now())}handleConnectionLost(e){if(e.revoked){this.cancelConnectionLossTimer(),this.failActiveSessions("Operator connection revoked");return}this.activeExecutors.size!==0&&(this.connectionLossTimer||(this.log.warn("Operator connection lost with active sessions - starting grace window",{activeSessions:this.activeExecutors.size,graceMs:AA}),this.connectionLossTimer=setTimeout(()=>{this.connectionLossTimer=null,this.failActiveSessions("Operator connection lost",{report:!0})},AA)))}handleConnectionRestored(){this.connectionLossTimer&&(this.cancelConnectionLossTimer(),this.log.info("Operator connection restored within grace window - sessions continue"))}cancelConnectionLossTimer(){this.connectionLossTimer&&(clearTimeout(this.connectionLossTimer),this.connectionLossTimer=null)}failActiveSessions(e,t={}){if(this.activeExecutors.size!==0)for(let[r,o]of this.activeExecutors)this.terminalFailures.set(r,{reason:e,report:t.report??!1}),o.stop()}handleRequestSessionState(e){let t=this.activeExecutors.get(e);if(t){let{events:r,lastSeq:o}=t.getBufferedEvents();this.config.connection.sendSessionState(e,r,o)}else this.config.connection.sendSessionState(e,[],-1)}async getComputer(){if(this.resolvedComputer)return this.resolvedComputer;if(!this.computerPromise){let{computer:e}=this.config;this.computerPromise=typeof e=="function"?e():Promise.resolve(e)}return this.resolvedComputer=await this.computerPromise,this.resolvedComputer}consumeCancellation(e){return this.cancelledSessions.has(e)?(this.cancelledSessions.delete(e),this.log.info("Session was cancelled before execution started",{sessionId:e}),this.emitSessionComplete(e,"completed"),!0):!1}async executeSession(e){let{sessionId:t,operatorToken:r,trigger:o}=e;try{let n;try{n=await this.getComputer()}catch(a){let u=yf(a);this.log.error("Computer factory failed",a,{sessionId:t});let c=bf(a);this.emitSessionComplete(t,"failed",u,c==="transport"?"network":c);return}if(this.consumeCancellation(t))return;if(await this.reconcileDeviceMcps(n,e.deviceMcpConfigs),this.reconcileDeviceSkills(e.deviceSkillConfigs),this.config.onBeforeSession)try{await this.config.onBeforeSession()}catch(a){this.log.error("onBeforeSession failed",a)}if(this.consumeCancellation(t))return;let i=this.buildDeviceToolHandlers(n,e),s=this.getOrCreateExecutor(t,r,o,n,i);this.activeExecutors.set(t,s),this.notifyStateChange(),this.config.connection.sendSessionStarted(t);try{let a=await s.execute();if(this.consumeTerminalFailure(t))return;this.emitSessionComplete(t,a.status,a.error,a.errorType,a.title)}catch(a){if(this.consumeTerminalFailure(t))return;this.log.error("Session execution failed unexpectedly",a,{sessionId:t}),this.emitSessionComplete(t,"failed","Internal execution error","platform")}finally{this.deviceSkillHandler?.cleanupRuns(),this.terminalFailures.delete(t),this.activeExecutors.delete(t),this.notifyStateChange(),this.config.onAfterSession&&this.activeExecutors.size===0&&this.scheduleAfterSession()}}finally{let n=this.oneShotResolvers.get(t);n&&(this.oneShotResolvers.delete(t),n({status:"failed",error:"Run ended without completing",errorType:"network"})),this.stoppedSessions.delete(t),this.config.onSessionSettled?.(t)}}consumeTerminalFailure(e){let t=this.terminalFailures.get(e);return t?(this.log.warn("Session aborted after operator disconnect",{sessionId:e,reason:t.reason}),t.report&&this.emitSessionComplete(e,"failed",t.reason,"network"),!0):!1}async reconcileDeviceMcps(e,t){if(!Ki(e)){t&&t.length>0&&this.log.warn("Device MCP configs provided but Computer does not support dynamic entries",{namespaces:t.map(o=>o.namespace)});return}let r=new Map;for(let o of t??[])r.set(o.namespace,o);for(let o of[...this.currentDeviceMcpFingerprints.keys()])if(!r.has(o))try{await e.removeEntry(o),this.currentDeviceMcpFingerprints.delete(o)}catch(n){this.log.warn("Failed to remove device MCP entry",{namespace:o,error:String(n)})}for(let[o,n]of r){let i=NA(n);if(this.currentDeviceMcpFingerprints.get(o)!==i){if(this.currentDeviceMcpFingerprints.has(o)){try{await e.removeEntry(o)}catch(s){this.log.warn("Failed to replace device MCP entry",{namespace:o,error:String(s)})}this.currentDeviceMcpFingerprints.delete(o)}try{await e.addEntry(o,{type:"stdio",command:n.command,args:n.args,env:n.env},{deferred:n.connection==="lazy"}),this.currentDeviceMcpFingerprints.set(o,i)}catch(s){this.log.warn("Failed to add device MCP entry",{namespace:o,error:String(s)})}}}}reconcileDeviceSkills(e){if(!e||e.length===0){this.deviceSkillHandler=null;return}if(!this.config.deviceSkillsDir){this.log.warn("Device skill configs provided but no deviceSkillsDir configured",{slugs:e.map(r=>r.slug)});return}let t=e.map(r=>({slug:r.slug,bundleUrl:r.bundleUrl,bundleSha256:r.bundleSha256,secrets:r.secrets}));this.deviceSkillHandler?this.deviceSkillHandler.setSkills(t):this.deviceSkillHandler=new Wx({skills:t,skillsDir:this.config.deviceSkillsDir,pythonPath:this.config.pythonPath})}buildDeviceToolHandlers(e,t){let r=!!(this.deviceSkillHandler&&(t.deviceSkillConfigs?.length??0)>0),o=(t.deviceMcpConfigs?.length??0)>0&&Ki(e),n=Ki(e),i=!!this.config.deviceSkillsDir,s=!!this.config.agentWorkspaceDir;if(!r&&!o&&!n&&!i&&!s)return this.activeToolHandlers=null,this.config.tools;let a={...this.config.tools??{}};if(this.activeToolHandlers=a,r){let u=this.deviceSkillHandler.toolHandlers();a[at.SKILL_READ]=u[at.SKILL_READ],a[at.SKILL_LIST]=u[at.SKILL_LIST],a[at.SKILL_RUN]=u[at.SKILL_RUN]}if(i&&(a[at.SKILL_SETUP]=u=>this.handleSkillSetup(u)),n&&(a[Fb.MCP_ACTIVATE]=u=>this.handleDeviceMcpActivate(e,u)),s){let u=this.config.agentWorkspaceDir;a[at.FILE_UPLOAD]=c=>this.handleFileUpload(c,u)}return a}async handleSkillSetup(e){let t=typeof e.skill=="string"?e.skill:void 0;if(!t)return{error:"Missing required parameter: skill"};let r=typeof e.bundleUrl=="string"?e.bundleUrl:void 0;if(!r)return{error:`Skill "${t}" could not be resolved - bundleUrl missing`};let o=typeof e.bundleSha256=="string"?e.bundleSha256:void 0,n=typeof e.secrets=="object"&&e.secrets!==null&&!Array.isArray(e.secrets)?e.secrets:{},i={slug:t,bundleUrl:r,bundleSha256:o,secrets:n};if(!this.deviceSkillHandler){if(!this.config.deviceSkillsDir)return{error:"Device skills are not configured on this device"};this.deviceSkillHandler=new Wx({skills:[i],skillsDir:this.config.deviceSkillsDir,pythonPath:this.config.pythonPath})}let s=await this.deviceSkillHandler.setupSkill(i);if(s.installed&&this.activeToolHandlers){let a=this.deviceSkillHandler.toolHandlers();this.activeToolHandlers[at.SKILL_READ]=a[at.SKILL_READ],this.activeToolHandlers[at.SKILL_LIST]=a[at.SKILL_LIST],this.activeToolHandlers[at.SKILL_RUN]=a[at.SKILL_RUN]}return s}async handleDeviceMcpActivate(e,t){let r=KK.safeParse(t);if(!r.success)return{error:"slug is required"};if(!Ki(e))return{error:"This computer does not support dynamic MCP activation"};let{slug:o}=r.data,n=YK.safeParse(t.deviceConfig);if(n.success&&!this.currentDeviceMcpFingerprints.has(o)){let a=n.data;try{let u=a.connection==="eager"?"eager":"lazy",c=a.args??[],l=a.env??{};await e.addEntry(o,{type:"stdio",command:a.command,args:c,env:l},{deferred:u==="lazy"}),this.currentDeviceMcpFingerprints.set(o,NA({namespace:o,name:o,description:"",command:a.command,args:c,env:l,connection:u}))}catch(u){return{error:u instanceof Error?u.message:String(u)}}}if(!this.currentDeviceMcpFingerprints.has(o))return{error:`MCP "${o}" is not registered on this device. Call computer-reset to refresh the device's MCP set.`};try{await e.restartEntry(o)}catch(a){return{error:a instanceof Error?a.message:String(a)}}let i=`${o}__`;return{activated:!0,tools:e.toolSchemas().filter(a=>a.name.startsWith(i))}}async handleFileUpload(e,t){let r=typeof e.path=="string"?e.path.trim():"";if(!r)return{error:"Missing required parameter: path"};let o=Hx(t),n=jA(r)?r:Hx(o,r),i=Hx(n);if(!XK(i,o))return{error:`Path is outside the agent workspace (${o}). Only files inside the workspace can be uploaded.`};let s;try{s=await DK(i)}catch{return{error:`File not found: ${i}`}}if(!s.isFile())return{error:`Path is not a file: ${i}`};if(s.size>CA)return{error:`File exceeds maximum upload size of ${CA/(1024*1024)}MB`};let a;try{a=await jK(i)}catch(l){return{error:l instanceof Error?l.message:"Failed to read file"}}let u=UK(i),c=Vx(u);return{outputFiles:[{name:u,path:i,mediaType:c,size:a.byteLength,contentBase64:a.toString("base64")}]}}getOrCreateExecutor(e,t,r,o,n){let i=(p,h,m)=>{this.config.connection.sendSessionEvent(e,h,m)},s=this.config.onComputerReset,a=s?async()=>{let p=await s();return this.resolvedComputer=p,this.currentDeviceMcpFingerprints.clear(),p}:void 0,u=(p,h)=>{this.config.connection.sendSessionTitle(e,h)},c={sessionId:e,operatorToken:t,trigger:r,platformUrl:this.config.platformUrl,computer:o,onEvent:i,onTitleChange:u,onRetry:(p,h,m)=>{this.log.warn("Retrying session execution",{sessionId:e,attempt:p,reason:h,delayMs:m}),this.config.connection.sendSessionRetry(e,{attempt:p,reason:h,delayMs:m})},tools:n??this.config.tools,onComputerReset:a,traceModelRequests:this.config.traceModelRequests,environment:this.config.environment,logger:this.log},l=this.executorCache.get(e);if(l)return l.lastActiveAt=Date.now(),l.executor.updateConfig(c),this.log.info("Reusing executor for session",{sessionId:e}),l.executor;let f=new VK(c);return this.executorCache.set(e,{executor:f,lastActiveAt:Date.now()}),f}cancelAfterSessionTimer(){this.afterSessionTimer&&(clearTimeout(this.afterSessionTimer),this.afterSessionTimer=null)}scheduleAfterSession(){if(this.cancelAfterSessionTimer(),!this.running)return;let e=this.config.idleTimeoutMs??0;if(e<=0){this.fireAfterSession();return}this.afterSessionTimer=setTimeout(()=>{this.afterSessionTimer=null,this.fireAfterSession()},e)}async fireAfterSession(){if(!(this.activeExecutors.size>0))try{await this.config.onAfterSession?.()}catch(e){this.log.error("onAfterSession failed",e)}}cleanupIdleExecutors(){let e=Date.now();for(let[t,r]of this.executorCache)e-r.lastActiveAt>HK&&!this.activeExecutors.has(t)&&(this.log.info("Removing idle executor cache for session",{sessionId:t}),this.executorCache.delete(t));for(let[t,r]of this.cancelledSessions)e-r>JK&&(this.cancelledSessions.delete(t),this.stoppedSessions.delete(t))}notifyStateChange(){this.config.onSessionStateChange?.(this.getActiveSessions())}};function XK(e,t){if(e===t)return!0;let r=LK(t,e);return r===""?!0:r.startsWith("..")||jA(r)?!1:!r.split(MK).includes("..")}import{homedir as QK}from"os";import{join as Hc}from"path";import{mkdirSync as MA,readFileSync as e7,writeFileSync as t7}from"fs";var r7="production",n7={production:"https://octavus.ai",local:"http://localhost:3000"};function Jc(e){let t=(e||process.env.OCTAVUS_ENV||r7).trim();if(!/^[a-zA-Z0-9][a-zA-Z0-9._-]*$/.test(t))throw new Error(`Invalid environment "${t}": use letters, digits, dot, underscore, or hyphen (e.g. production, staging).`);return t}function zs(e){return process.env.OCTAVUS_HOME||Hc(QK(),".octavus",e)}function ZA(e){return Hc(zs(e),"config.json")}function Ts(e){try{let t=e7(ZA(e),"utf8"),r=JSON.parse(t);return typeof r=="object"&&r!==null?r:{}}catch{return{}}}function FA(e,t){let r=zs(e);MA(r,{recursive:!0,mode:448});let o={...Ts(e),...t};return t7(ZA(e),`${JSON.stringify(o,null,2)}
71
71
  `,{mode:384}),o}function qA(e,t){return t||process.env.OCTAVUS_API_KEY||Ts(e).apiKey}function Gc(e,t){let r=t||process.env.OCTAVUS_PLATFORM_URL||Ts(e).platformUrl||n7[e];return r?r.replace(/\/+$/,""):void 0}function xp(e,t){let r=t||process.env.OCTAVUS_OPERATOR_WS_URL||Ts(e).operatorWsUrl;return r?r.replace(/\/+$/,""):void 0}function BA(e,t){let r=Hc(zs(e),t),o=Hc(r,"browser-profile"),n=Hc(r,"skills");for(let i of[r,o,n])MA(i,{recursive:!0,mode:448});return{base:r,browserProfileDir:o,skillsDir:n}}function o7(e){return e instanceof Error?e.message:String(e)}function VA(e){let t=(r,o,n)=>{let i=n&&Object.keys(n).length>0?` ${JSON.stringify(n)}`:"";process.stderr.write(`[${r}] ${o}${i}
72
72
  `)};return{info:(r,o)=>{e&&t("info",r,o)},warn:(r,o)=>t("warn",r,o),error:(r,o,n)=>t("error",r,{...n,...o==null?{}:{error:o7(o)}})}}import{createRequire as Wce}from"module";import{existsSync as Hce}from"fs";import{dirname as B6,join as wa}from"path";import{fileURLToPath as Jce}from"url";var WA,Kx=Object.freeze({status:"aborted"});function z(e,t,r){function o(a,u){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:u,constr:s,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,u);let c=s.prototype,l=Object.keys(c);for(let f=0;f<l.length;f++){let p=l[f];p in a||(a[p]=c[p].bind(a))}}let n=r?.Parent??Object;class i extends n{}Object.defineProperty(i,"name",{value:e});function s(a){var u;let c=r?.Parent?new i:this;o(c,a),(u=c._zod).deferred??(u.deferred=[]);for(let l of c._zod.deferred)l();return c}return Object.defineProperty(s,"init",{value:o}),Object.defineProperty(s,Symbol.hasInstance,{value:a=>r?.Parent&&a instanceof r.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}var i7=Symbol("zod_brand"),Nr=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Is=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(WA=globalThis).__zod_globalConfig??(WA.__zod_globalConfig={});var Ps=globalThis.__zod_globalConfig;function Et(e){return e&&Object.assign(Ps,e),Ps}var re={};Zt(re,{BIGINT_FORMAT_RANGES:()=>KA,Class:()=>Xx,NUMBER_FORMAT_RANGES:()=>o0,aborted:()=>Gn,allowsEval:()=>t0,assert:()=>l7,assertEqual:()=>s7,assertIs:()=>c7,assertNever:()=>u7,assertNotEqual:()=>a7,assignProp:()=>Hn,base64ToUint8Array:()=>XA,base64urlToUint8Array:()=>z7,cached:()=>Rs,captureStackTrace:()=>kp,cleanEnum:()=>E7,cleanRegex:()=>Qc,clone:()=>Yt,cloneDef:()=>f7,createTransparentProxy:()=>v7,defineLazy:()=>le,esc:()=>$p,escapeRegex:()=>cn,explicitlyAborted:()=>i0,extend:()=>w7,finalizeIssue:()=>Xt,floatSafeRemainder:()=>Qx,getElementAtPath:()=>p7,getEnumValues:()=>Yc,getLengthableOrigin:()=>eu,getParsedType:()=>_7,getSizableOrigin:()=>YA,hexToUint8Array:()=>I7,isObject:()=>Zo,isPlainObject:()=>Jn,issue:()=>Cs,joinValues:()=>Sp,jsonStringifyReplacer:()=>Os,merge:()=>S7,mergeDefs:()=>an,normalizeParams:()=>q,nullish:()=>Xc,numKeys:()=>g7,objectClone:()=>d7,omit:()=>b7,optionalKeys:()=>n0,parsedType:()=>s0,partial:()=>$7,pick:()=>y7,prefixIssues:()=>un,primitiveTypes:()=>GA,promiseAllObject:()=>h7,propertyKeyTypes:()=>r0,randomString:()=>m7,required:()=>k7,safeExtend:()=>x7,shallowClone:()=>JA,slugify:()=>e0,stringifyPrimitive:()=>Ep,uint8ArrayToBase64:()=>QA,uint8ArrayToBase64url:()=>T7,uint8ArrayToHex:()=>P7,unwrapMessage:()=>Kc});function s7(e){return e}function a7(e){return e}function c7(e){}function u7(e){throw new Error("Unexpected value in exhaustive check")}function l7(e){}function Yc(e){let t=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,n])=>t.indexOf(+o)===-1).map(([o,n])=>n)}function Sp(e,t="|"){return e.map(r=>Ep(r)).join(t)}function Os(e,t){return typeof t=="bigint"?t.toString():t}function Rs(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function Xc(e){return e==null}function Qc(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function Qx(e,t){let r=e/t,o=Math.round(r),n=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-o)<n?0:r-o}var HA=Symbol("evaluating");function le(e,t,r){let o;Object.defineProperty(e,t,{get(){if(o!==HA)return o===void 0&&(o=HA,o=r()),o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function d7(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Hn(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function an(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function f7(e){return an(e._zod.def)}function p7(e,t){return t?t.reduce((r,o)=>r?.[o],e):e}function h7(e){let t=Object.keys(e),r=t.map(o=>e[o]);return Promise.all(r).then(o=>{let n={};for(let i=0;i<t.length;i++)n[t[i]]=o[i];return n})}function m7(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let o=0;o<e;o++)r+=t[Math.floor(Math.random()*t.length)];return r}function $p(e){return JSON.stringify(e)}function e0(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var kp="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Zo(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var t0=Rs(()=>{if(Ps.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Jn(e){if(Zo(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Zo(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function JA(e){return Jn(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function g7(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}var _7=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},r0=new Set(["string","number","symbol"]),GA=new Set(["string","number","bigint","boolean","symbol","undefined"]);function cn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Yt(e,t,r){let o=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(o._zod.parent=e),o}function q(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function v7(e){let t;return new Proxy({},{get(r,o,n){return t??(t=e()),Reflect.get(t,o,n)},set(r,o,n,i){return t??(t=e()),Reflect.set(t,o,n,i)},has(r,o){return t??(t=e()),Reflect.has(t,o)},deleteProperty(r,o){return t??(t=e()),Reflect.deleteProperty(t,o)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,o){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,o)},defineProperty(r,o,n){return t??(t=e()),Reflect.defineProperty(t,o,n)}})}function Ep(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function n0(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var o0={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},KA={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function y7(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let i=an(e._zod.def,{get shape(){let s={};for(let a in t){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(s[a]=r.shape[a])}return Hn(this,"shape",s),s},checks:[]});return Yt(e,i)}function b7(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let i=an(e._zod.def,{get shape(){let s={...e._zod.def.shape};for(let a in t){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete s[a]}return Hn(this,"shape",s),s},checks:[]});return Yt(e,i)}function w7(e,t){if(!Jn(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let i=e._zod.def.shape;for(let s in t)if(Object.getOwnPropertyDescriptor(i,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=an(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return Hn(this,"shape",i),i}});return Yt(e,n)}function x7(e,t){if(!Jn(t))throw new Error("Invalid input to safeExtend: expected a plain object");let r=an(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t};return Hn(this,"shape",o),o}});return Yt(e,r)}function S7(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=an(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t._zod.def.shape};return Hn(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return Yt(e,r)}function $7(e,t,r){let n=t._zod.def.checks;if(n&&n.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let s=an(t._zod.def,{get shape(){let a=t._zod.def.shape,u={...a};if(r)for(let c in r){if(!(c in a))throw new Error(`Unrecognized key: "${c}"`);r[c]&&(u[c]=e?new e({type:"optional",innerType:a[c]}):a[c])}else for(let c in a)u[c]=e?new e({type:"optional",innerType:a[c]}):a[c];return Hn(this,"shape",u),u},checks:[]});return Yt(t,s)}function k7(e,t,r){let o=an(t._zod.def,{get shape(){let n=t._zod.def.shape,i={...n};if(r)for(let s in r){if(!(s in i))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(i[s]=new e({type:"nonoptional",innerType:n[s]}))}else for(let s in n)i[s]=new e({type:"nonoptional",innerType:n[s]});return Hn(this,"shape",i),i}});return Yt(t,o)}function Gn(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function i0(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function un(e,t){return t.map(r=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function Kc(e){return typeof e=="string"?e:e?.message}function Xt(e,t,r){let o=e.message?e.message:Kc(e.inst?._zod.def?.error?.(e))??Kc(t?.error?.(e))??Kc(r.customError?.(e))??Kc(r.localeError?.(e))??"Invalid input",{inst:n,continue:i,input:s,...a}=e;return a.path??(a.path=[]),a.message=o,t?.reportInput&&(a.input=s),a}function YA(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function eu(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function s0(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function Cs(...e){let[t,r,o]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:o}:{...t}}function E7(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function XA(e){let t=atob(e),r=new Uint8Array(t.length);for(let o=0;o<t.length;o++)r[o]=t.charCodeAt(o);return r}function QA(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function z7(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return XA(t+r)}function T7(e){return QA(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function I7(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let o=0;o<t.length;o+=2)r[o/2]=Number.parseInt(t.slice(o,o+2),16);return r}function P7(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var Xx=class{constructor(...t){}};var eN=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Os,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},zp=z("$ZodError",eN),a0=z("$ZodError",eN,{Parent:Error});function c0(e,t=r=>r.message){let r={},o=[];for(let n of e.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n))):o.push(t(n));return{formErrors:o,fieldErrors:r}}function u0(e,t=r=>r.message){let r={_errors:[]},o=(n,i=[])=>{for(let s of n.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>o({issues:a},[...i,...s.path]));else if(s.code==="invalid_key")o({issues:s.issues},[...i,...s.path]);else if(s.code==="invalid_element")o({issues:s.issues},[...i,...s.path]);else{let a=[...i,...s.path];if(a.length===0)r._errors.push(t(s));else{let u=r,c=0;for(;c<a.length;){let l=a[c];c===a.length-1?(u[l]=u[l]||{_errors:[]},u[l]._errors.push(t(s))):u[l]=u[l]||{_errors:[]},u=u[l],c++}}}};return o(e),r}var Tp=e=>(t,r,o,n)=>{let i=o?{...o,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise)throw new Nr;if(s.issues.length){let a=new(n?.Err??e)(s.issues.map(u=>Xt(u,i,Et())));throw kp(a,n?.callee),a}return s.value};var Ip=e=>async(t,r,o,n)=>{let i=o?{...o,async:!0}:{async:!0},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise&&(s=await s),s.issues.length){let a=new(n?.Err??e)(s.issues.map(u=>Xt(u,i,Et())));throw kp(a,n?.callee),a}return s.value};var tu=e=>(t,r,o)=>{let n=o?{...o,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},n);if(i instanceof Promise)throw new Nr;return i.issues.length?{success:!1,error:new(e??zp)(i.issues.map(s=>Xt(s,n,Et())))}:{success:!0,data:i.value}},ru=tu(a0),nu=e=>async(t,r,o)=>{let n=o?{...o,async:!0}:{async:!0},i=t._zod.run({value:r,issues:[]},n);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(s=>Xt(s,n,Et())))}:{success:!0,data:i.value}},Pp=nu(a0),tN=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Tp(e)(t,r,n)};var rN=e=>(t,r,o)=>Tp(e)(t,r,o);var nN=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Ip(e)(t,r,n)};var oN=e=>async(t,r,o)=>Ip(e)(t,r,o);var iN=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return tu(e)(t,r,n)};var sN=e=>(t,r,o)=>tu(e)(t,r,o);var aN=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return nu(e)(t,r,n)};var cN=e=>async(t,r,o)=>nu(e)(t,r,o);var uN=/^[cC][0-9a-z]{6,}$/,lN=/^[0-9a-z]+$/,dN=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,fN=/^[0-9a-vA-V]{20}$/,pN=/^[A-Za-z0-9]{27}$/,hN=/^[a-zA-Z0-9_-]{21}$/,mN=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var gN=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,l0=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;var _N=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var R7="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function vN(){return new RegExp(R7,"u")}var yN=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,bN=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;var wN=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,xN=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,SN=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,d0=/^[A-Za-z0-9_-]*$/;var $N=/^https?$/,kN=/^\+[1-9]\d{6,14}$/,EN="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",zN=new RegExp(`^${EN}$`);function TN(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function IN(e){return new RegExp(`^${TN(e)}$`)}function PN(e){let t=TN({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let o=`${t}(?:${r.join("|")})`;return new RegExp(`^${EN}T(?:${o})$`)}var ON=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},RN=/^-?\d+n?$/,CN=/^-?\d+$/,f0=/^-?\d+(?:\.\d+)?$/,AN=/^(?:true|false)$/i,NN=/^null$/i;var DN=/^[^A-Z]*$/,jN=/^[^a-z]*$/;var Xe=z("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),UN={number:"number",bigint:"bigint",object:"date"},p0=z("$ZodCheckLessThan",(e,t)=>{Xe.init(e,t);let r=UN[typeof t.value];e._zod.onattach.push(o=>{let n=o._zod.bag,i=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),h0=z("$ZodCheckGreaterThan",(e,t)=>{Xe.init(e,t);let r=UN[typeof t.value];e._zod.onattach.push(o=>{let n=o._zod.bag,i=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),LN=z("$ZodCheckMultipleOf",(e,t)=>{Xe.init(e,t),e._zod.onattach.push(r=>{var o;(o=r._zod.bag).multipleOf??(o.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):Qx(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),MN=z("$ZodCheckNumberFormat",(e,t)=>{Xe.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[n,i]=o0[t.format];e._zod.onattach.push(s=>{let a=s._zod.bag;a.format=t.format,a.minimum=n,a.maximum=i,r&&(a.pattern=CN)}),e._zod.check=s=>{let a=s.value;if(r){if(!Number.isInteger(a)){s.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});return}}a<n&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),a>i&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}});var ZN=z("$ZodCheckMaxLength",(e,t)=>{var r;Xe.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Xc(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{let n=o.value;if(n.length<=t.maximum)return;let s=eu(n);o.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),FN=z("$ZodCheckMinLength",(e,t)=>{var r;Xe.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Xc(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{let n=o.value;if(n.length>=t.minimum)return;let s=eu(n);o.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),qN=z("$ZodCheckLengthEquals",(e,t)=>{var r;Xe.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!Xc(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=o=>{let n=o.value,i=n.length;if(i===t.length)return;let s=eu(n),a=i>t.length;o.issues.push({origin:s,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),iu=z("$ZodCheckStringFormat",(e,t)=>{var r,o;Xe.init(e,t),e._zod.onattach.push(n=>{let i=n._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),BN=z("$ZodCheckRegex",(e,t)=>{iu.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),VN=z("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=DN),iu.init(e,t)}),WN=z("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=jN),iu.init(e,t)}),HN=z("$ZodCheckIncludes",(e,t)=>{Xe.init(e,t);let r=cn(t.includes),o=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=o,e._zod.onattach.push(n=>{let i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(o)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),JN=z("$ZodCheckStartsWith",(e,t)=>{Xe.init(e,t);let r=new RegExp(`^${cn(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=o=>{o.value.startsWith(t.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),GN=z("$ZodCheckEndsWith",(e,t)=>{Xe.init(e,t);let r=new RegExp(`.*${cn(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=o=>{o.value.endsWith(t.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});var KN=z("$ZodCheckOverwrite",(e,t)=>{Xe.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});var Op=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let o=t.split(`
73
73
  `).filter(s=>s),n=Math.min(...o.map(s=>s.length-s.trimStart().length)),i=o.map(s=>s.slice(n)).map(s=>" ".repeat(this.indent*2)+s);for(let s of i)this.content.push(s)}compile(){let t=Function,r=this?.args,n=[...(this?.content??[""]).map(i=>` ${i}`)];return new t(...r,n.join(`
@@ -147,13 +147,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
147
147
  `+e.slice(-t)}function Ose(e,t,r){return new Promise(o=>{let{shell:n,args:i}=Ise(),s=EZ()==="win32",a=xZ(n,[...i,e],{cwd:t,env:process.env,stdio:["ignore","pipe","pipe"],detached:!s,windowsHide:!0,windowsVerbatimArguments:s}),u="",c="",l=!1,f={},p=h=>{l||(l=!0,f.handle!==void 0&&clearTimeout(f.handle),a.stdout?.destroy(),a.stderr?.destroy(),o(h))};f.handle=setTimeout(()=>{if(a.pid!==void 0)try{s?xZ("taskkill",["/pid",String(a.pid),"/t","/f"]).on("error",()=>{}):process.kill(-a.pid,"SIGKILL")}catch{}p({exitCode:124,stdout:ua(u),stderr:ua(c+`
148
148
  [command timed out]`)})},r),a.stdout.on("data",h=>{u+=h.toString()}),a.stderr.on("data",h=>{c+=h.toString()}),a.on("error",h=>{p({exitCode:1,stdout:ua(u),stderr:ua(h.message)})}),a.on("exit",(h,m)=>{p({exitCode:h??(m?1:-1),stdout:ua(u),stderr:ua(c)})})})}function Rse(e,t){let r=t.timeout??SZ,o=async i=>{let s=i.command;if(!s)return{error:"command is required"};if(!Pse(s,t.mode))return{error:`Command not allowed by safety policy: ${s}`};let a=i.cwd??t.cwd,u=i.timeout??r;return await Ose(s,a,u)},n=`${e}${al}run_command`;return{handlers:{[n]:o},schemas:[{name:n,description:"Run a shell command on the local machine. Commands execute in a login shell with the user's full environment.",inputSchema:{type:"object",properties:{command:{type:"string",description:"The shell command to execute"},cwd:{type:"string",description:"Working directory (optional, defaults to configured directory)"},timeout:{type:"number",description:`Timeout in milliseconds (optional, default ${SZ})`}},required:["command"]}}]}}function Ak(e,t,r,o,n){let i=`${e}${al}status`,s=t==="degraded"?`The ${e} capability is currently unavailable. Call this tool to diagnose the issue and get fix instructions.`:`Check the health of the ${e} capability and list available tools.`;return{handler:()=>t==="degraded"?Promise.resolve({status:"unavailable",error:o??"Unknown error",...n&&n.prerequisites.length>0&&{prerequisites:n.prerequisites},...n&&n.suggestedFixes.length>0&&{suggestedFixes:n.suggestedFixes}}):Promise.resolve({status:"connected",tools:r}),schema:{name:i,description:s,inputSchema:{type:"object",properties:{}}}}}var $Z={darwin:["/Applications/Google Chrome.app/Contents/MacOS/Google Chrome","/Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary","/Applications/Chromium.app/Contents/MacOS/Chromium"],linux:["google-chrome","google-chrome-stable","chromium-browser","chromium"],win32:["C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe","C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe"]};function Use(){let e=Dse(),t=$Z[e]??$Z.linux;for(let r of t)if(r.startsWith("/")||r.startsWith("C:\\")){if(jse(r))return r}else if(Lse(r))return r;throw new Error(`Chrome not found. Searched: ${t.join(", ")}. Install Google Chrome or set the path explicitly.`)}function Lse(e){try{return Ase("which",[e],{stdio:"ignore"}).status===0}catch{return!1}}function Mse(){return new Promise((e,t)=>{let r=Nse();r.listen(0,"127.0.0.1",()=>{let o=r.address();if(o!==null&&typeof o=="object"){let n=o.port;r.close(()=>e(n))}else r.close(()=>t(new Error("Failed to allocate port")))}),r.on("error",t)})}function Zse(e,t=3e4){let r=Date.now();return new Promise((o,n)=>{function i(){if(Date.now()-r>t){n(new Error(`Chrome debugging port ${e} not ready after ${t}ms`));return}fetch(`http://127.0.0.1:${e}/json/version`).then(s=>{s.ok?o():setTimeout(i,200)}).catch(()=>{setTimeout(i,200)})}i()})}async function Fse(e){let t=e.chromePath??Use(),r=e.debuggingPort??await Mse(),o=[`--remote-debugging-port=${r}`,`--user-data-dir=${e.profileDir}`,"--no-first-run","--no-default-browser-check",...e.flags??[]],n=Cse(t,o,{stdio:"ignore",detached:!1});if(n.pid===void 0)throw new Error(`Failed to launch Chrome at ${t}`);return n.on("error",()=>{}),await Zse(r,e.debuggingPortTimeoutMs),{port:r,process:n,pid:n.pid}}var qse=3e3,la=class{config;entries=new Map;started=!1;constructor(e){this.config=e}static stdio(e,t,r){return vse(e,t,r)}static http(e,t){return yse(e,t)}static shell(e){return bse(e)}static launchChrome(e){return Fse(e)}async start(){if(this.started)return{errors:[]};let e=new Set(this.config.deferredEntries??[]);for(let n of e)this.setDegradedEntry(n,"Deferred - connect via restartEntry()");let t=Object.entries(this.config.mcpServers).filter(([n])=>!e.has(n)),r=await Promise.allSettled(t.map(([n,i])=>this.connectEntry(n,i))),o=[];for(let n=0;n<r.length;n++){let i=r[n];if(i.status==="rejected"){let s=t[n][0],a=i.reason instanceof Error?i.reason.message:String(i.reason);o.push(`${s}: ${a}`),this.setDegradedEntry(s,a)}}if(o.length>0&&o.length===t.length)throw new Error(`All MCP connections failed:
149
149
  ${o.join(`
150
- `)}`);return this.started=!0,{errors:o}}async stop(){let e=[];for(let t of this.entries.values())t.connection&&e.push(t.connection.close().catch(()=>{}));if(await Promise.allSettled(e),this.config.managedProcesses)for(let t of this.config.managedProcesses)try{t.process.kill()}catch{}this.entries.clear(),this.started=!1}async retryDegraded(){let e=[],t=[],r=[...this.entries.values()].filter(n=>n.status==="degraded");if(r.length===0)return{recovered:e,stillDegraded:t};let o=await Promise.allSettled(r.map(async n=>(n.connection&&await n.connection.close().catch(()=>{}),await this.connectEntry(n.namespace,this.config.mcpServers[n.namespace]),n.namespace)));for(let n=0;n<o.length;n++){let i=o[n],s=r[n].namespace;if(i.status==="fulfilled")e.push(s);else{let a=i.reason instanceof Error?i.reason.message:String(i.reason);this.setDegradedEntry(s,a),t.push(s)}}return{recovered:e,stillDegraded:t}}async stopEntry(e){let t=this.entries.get(e);t?.connection&&await t.connection.close().catch(()=>{}),this.setDegradedEntry(e,"Entry stopped")}hasEntry(e){return this.config.mcpServers[e]!==void 0}async addEntry(e,t,r){if(this.config.mcpServers[e])throw new Error(`MCP entry "${e}" already exists. Call removeEntry first to replace.`);if(this.config.mcpServers[e]=t,r?.deferred)this.setDegradedEntry(e,"Deferred - connect via restartEntry()");else try{await this.connectEntry(e,t)}catch(o){let n=o instanceof Error?o.message:String(o);this.setDegradedEntry(e,n)}}async removeEntry(e){let t=this.entries.get(e);t?.connection&&await t.connection.close().catch(()=>{}),this.entries.delete(e);let{[e]:r,...o}=this.config.mcpServers;this.config.mcpServers=o}async restartEntry(e){let t=this.config.mcpServers[e];if(!t)return;let r=this.entries.get(e);r?.connection&&await r.connection.close().catch(()=>{});try{await this.connectEntry(e,t)}catch(o){let n=o instanceof Error?o.message:String(o);this.setDegradedEntry(e,n)}}async getHealth(){let e=[...this.entries.values()].map(o=>this.probeEntry(o)),t=await Promise.all(e);return{healthy:t.length>0&&t.every(o=>o.healthy),entries:t,totalTools:this.toolSchemas().length}}async ensureReady(){let e=await this.getHealth();if(e.healthy)return e;let t=e.entries.filter(i=>!i.healthy);await Promise.allSettled(t.map(i=>this.restartEntry(i.name)));let r=await this.getHealth(),o=[],n=[];for(let i of t)r.entries.find(a=>a.name===i.name)?.healthy?o.push(i.name):n.push(i.name);return{...r,recovered:o,failedEntries:n}}toolHandlers(){let e={};for(let t of this.entries.values())Object.assign(e,t.handlers);return e}toolSchemas(){let e=[];for(let t of this.entries.values())e.push(...t.schemas);return e}async probeEntry(e){if(e.status==="degraded")return{name:e.namespace,healthy:!1,error:e.error};if(!e.connection)return{name:e.namespace,healthy:!0};try{return await Promise.race([e.connection.ping(),new Promise((t,r)=>{setTimeout(()=>r(new Error("Health probe timed out")),qse)})]),{name:e.namespace,healthy:!0}}catch(t){let r=t instanceof Error?t.message:String(t);return{name:e.namespace,healthy:!1,error:r}}}setDegradedEntry(e,t){let r=this.config.diagnostics?.[e],o=Ak(e,"degraded",[],t,r);this.entries.set(e,{namespace:e,handlers:{[o.schema.name]:o.handler},schemas:[o.schema],status:"degraded",error:t})}async connectEntry(e,t){if(t.type==="shell"){let i=Rse(e,t),s=i.schemas.map(u=>u.name.split(al)[1]),a=Ak(e,"connected",s);this.entries.set(e,{namespace:e,handlers:{...i.handlers,[a.schema.name]:a.handler},schemas:[...i.schemas,a.schema],status:"connected"});return}let r=t.type==="stdio"?await zse(e,t):await Tse(e,t),o=r.schemas.map(i=>i.name.split(al)[1]),n=Ak(e,"connected",o);this.entries.set(e,{namespace:e,handlers:{...r.handlers,[n.schema.name]:n.handler},schemas:[...r.schemas,n.schema],connection:r,status:"connected"})}};import{spawn as jce,spawnSync as Uce}from"child_process";import{existsSync as Lce}from"fs";import{platform as Mce}from"os";var zZ=Symbol();var TZ=async(e,t=Object.create(null))=>{let{all:r=!1,dot:o=!1}=t,i=(e instanceof Nk?e.raw.headers:e.headers).get("Content-Type");return i?.startsWith("multipart/form-data")||i?.startsWith("application/x-www-form-urlencoded")?Bse(e,{all:r,dot:o}):{}};async function Bse(e,t){let r=await e.formData();return r?Vse(r,t):{}}function Vse(e,t){let r=Object.create(null);return e.forEach((o,n)=>{t.all||n.endsWith("[]")?Wse(r,n,o):r[n]=o}),t.dot&&Object.entries(r).forEach(([o,n])=>{o.includes(".")&&(Hse(r,o,n),delete r[o])}),r}var Wse=(e,t,r)=>{e[t]!==void 0?Array.isArray(e[t])?e[t].push(r):e[t]=[e[t],r]:t.endsWith("[]")?e[t]=[r]:e[t]=r},Hse=(e,t,r)=>{let o=e,n=t.split(".");n.forEach((i,s)=>{s===n.length-1?o[i]=r:((!o[i]||typeof o[i]!="object"||Array.isArray(o[i])||o[i]instanceof File)&&(o[i]=Object.create(null)),o=o[i])})};var jk=(e,t)=>{try{return t(e)}catch{return e.replace(/(?:%[0-9A-Fa-f]{2})+/g,r=>{try{return t(r)}catch{return r}})}};var Dk=e=>/[%+]/.test(e)?(e.indexOf("+")!==-1&&(e=e.replace(/\+/g," ")),e.indexOf("%")!==-1?jk(e,Uk):e):e,IZ=(e,t,r)=>{let o;if(!r&&t&&!/[%+]/.test(t)){let s=e.indexOf("?",8);if(s===-1)return;for(e.startsWith(t,s+1)||(s=e.indexOf(`&${t}`,s+1));s!==-1;){let a=e.charCodeAt(s+t.length+1);if(a===61){let u=s+t.length+2,c=e.indexOf("&",u);return Dk(e.slice(u,c===-1?void 0:c))}else if(a==38||isNaN(a))return"";s=e.indexOf(`&${t}`,s+1)}if(o=/[%+]/.test(e),!o)return}let n={};o??=/[%+]/.test(e);let i=e.indexOf("?",8);for(;i!==-1;){let s=e.indexOf("&",i+1),a=e.indexOf("=",i);a>s&&s!==-1&&(a=-1);let u=e.slice(i+1,a===-1?s===-1?void 0:s:a);if(o&&(u=Dk(u)),i=s,u==="")continue;let c;a===-1?c="":(c=e.slice(a+1,s===-1?void 0:s),o&&(c=Dk(c))),r?(n[u]&&Array.isArray(n[u])||(n[u]=[]),n[u].push(c)):n[u]??=c}return t?n[t]:n},PZ=IZ,OZ=(e,t)=>IZ(e,t,!0),Uk=decodeURIComponent;var RZ=e=>jk(e,Uk),Nk=class{raw;#t;#e;routeIndex=0;path;bodyCache={};constructor(e,t="/",r=[[]]){this.raw=e,this.path=t,this.#e=r,this.#t={}}param(e){return e?this.#o(e):this.#i()}#o(e){let t=this.#e[0][this.routeIndex][1][e],r=this.#n(t);return r&&/\%/.test(r)?RZ(r):r}#i(){let e={},t=Object.keys(this.#e[0][this.routeIndex][1]);for(let r of t){let o=this.#n(this.#e[0][this.routeIndex][1][r]);o!==void 0&&(e[r]=/\%/.test(o)?RZ(o):o)}return e}#n(e){return this.#e[1]?this.#e[1][e]:e}query(e){return PZ(this.url,e)}queries(e){return OZ(this.url,e)}header(e){if(e)return this.raw.headers.get(e)??void 0;let t={};return this.raw.headers.forEach((r,o)=>{t[o]=r}),t}async parseBody(e){return this.bodyCache.parsedBody??=await TZ(this,e)}#r=e=>{let{bodyCache:t,raw:r}=this,o=t[e];if(o)return o;let n=Object.keys(t)[0];return n?t[n].then(i=>(n==="json"&&(i=JSON.stringify(i)),new Response(i)[e]())):t[e]=r[e]()};json(){return this.#r("text").then(e=>JSON.parse(e))}text(){return this.#r("text")}arrayBuffer(){return this.#r("arrayBuffer")}blob(){return this.#r("blob")}formData(){return this.#r("formData")}addValidatedData(e,t){this.#t[e]=t}valid(e){return this.#t[e]}get url(){return this.raw.url}get method(){return this.raw.method}get[zZ](){return this.#e}get matchedRoutes(){return this.#e[0].map(([[,e]])=>e)}get routePath(){return this.#e[0].map(([[,e]])=>e)[this.routeIndex].path}};var BSe=new Set(".\\+*[^]$()");var wce=We(T6(),1),xce=We(rm(),1),Sce=We(pa(),1),$ce=We(Gk(),1),kce=We(Xk(),1),Ece=We(oE(),1),sE=We(sm(),1),zce=We(D6(),1);import{Readable as j6}from"stream";import Nce from"crypto";var Tce=global.Request,uE=class extends Tce{constructor(e,t){typeof e=="object"&&ba in e&&(e=e[ba]()),typeof t?.body?.getReader<"u"&&(t.duplex??="half"),super(e,t)}},Ice=e=>{let t=[],r=e.rawHeaders;for(let o=0;o<r.length;o+=2){let{[o]:n,[o+1]:i}=r;n.charCodeAt(0)!==58&&t.push([n,i])}return new Headers(t)},Pce=Symbol("wrapBodyStream"),Oce=(e,t,r,o,n)=>{let i={method:e,headers:r,signal:n.signal};if(e==="TRACE"){i.method="GET";let s=new uE(t,i);return Object.defineProperty(s,"method",{get(){return"TRACE"}}),s}if(!(e==="GET"||e==="HEAD"))if("rawBody"in o&&o.rawBody instanceof Buffer)i.body=new ReadableStream({start(s){s.enqueue(o.rawBody),s.close()}});else if(o[Pce]){let s;i.body=new ReadableStream({async pull(a){try{s||=j6.toWeb(o).getReader();let{done:u,value:c}=await s.read();u?a.close():a.enqueue(c)}catch(u){a.error(u)}}})}else i.body=j6.toWeb(o);return new uE(t,i)},ba=Symbol("getRequestCache"),Rce=Symbol("requestCache"),aE=Symbol("incomingKey"),U6=Symbol("urlKey"),Cce=Symbol("headersKey"),cE=Symbol("abortControllerKey"),Ace=Symbol("getAbortController"),lE={get method(){return this[aE].method||"GET"},get url(){return this[U6]},get headers(){return this[Cce]||=Ice(this[aE])},[Ace](){return this[ba](),this[cE]},[ba](){return this[cE]||=new AbortController,this[Rce]||=Oce(this.method,this[U6],this.headers,this[aE],this[cE])}};["body","bodyUsed","cache","credentials","destination","integrity","mode","redirect","referrer","referrerPolicy","signal","keepalive"].forEach(e=>{Object.defineProperty(lE,e,{get(){return this[ba]()[e]}})});["arrayBuffer","blob","clone","formData","json","text"].forEach(e=>{Object.defineProperty(lE,e,{value:function(){return this[ba]()[e]()}})});Object.setPrototypeOf(lE,uE.prototype);var L6=Symbol("responseCache"),ya=Symbol("getResponseCache"),cm=Symbol("cache"),dE=global.Response,um=class M6{#t;#e;[ya](){return delete this[cm],this[L6]||=new dE(this.#t,this.#e)}constructor(t,r){let o;if(this.#t=t,r instanceof M6){let n=r[L6];if(n){this.#e=n,this[ya]();return}else this.#e=r.#e,o=new Headers(r.#e.headers)}else this.#e=r;(typeof t=="string"||typeof t?.getReader<"u"||t instanceof Blob||t instanceof Uint8Array)&&(o||=r?.headers||{"content-type":"text/plain; charset=UTF-8"},this[cm]=[r?.status||200,t,o])}get headers(){let t=this[cm];return t?(t[2]instanceof Headers||(t[2]=new Headers(t[2])),t[2]):this[ya]().headers}get status(){return this[cm]?.[0]??this[ya]().status}get ok(){let t=this.status;return t>=200&&t<300}};["body","bodyUsed","redirected","statusText","trailers","type","url"].forEach(e=>{Object.defineProperty(um.prototype,e,{get(){return this[ya]()[e]}})});["arrayBuffer","blob","clone","formData","json","text"].forEach(e=>{Object.defineProperty(um.prototype,e,{value:function(){return this[ya]()[e]()}})});Object.setPrototypeOf(um,dE);Object.setPrototypeOf(um.prototype,dE.prototype);typeof global.crypto>"u"&&(global.crypto=Nce);var oke=Symbol("outgoingEnded");var Dce="browser-extension",cke=`${Dce}__`,Z6={blockedPatterns:[/\bpkill\b[^|;&]*\b(node|entry(\.js)?|chromium?|supervise-entry)\b/,/\bkillall\b[^|;&]*\b(node|chromium?|chrome)\b/,/\bfuser\s+-k\s+.*\b(8080|6080|5900)\b/,/\b(reboot|shutdown|halt|poweroff)\b/,/\binit\s+0\b/]};async function F6(){if(Mce()==="linux"){if(!process.env.DBUS_SESSION_BUS_ADDRESS){console.warn("[atspi] DBUS_SESSION_BUS_ADDRESS unset; skipping AT-SPI bootstrap");return}Fce(),await Bce(400),qce()}}var Zce=["/usr/libexec/at-spi-bus-launcher","/usr/lib/at-spi2-core/at-spi-bus-launcher"];function Fce(){let e=Zce.find(t=>Lce(t));if(e)try{let t=jce(e,["--launch-immediately"],{detached:!0,stdio:"ignore"});t.on("error",r=>console.warn("[atspi] at-spi-bus-launcher failed to start:",r)),t.unref()}catch(t){console.warn("[atspi] Could not start at-spi-bus-launcher:",t)}}function qce(){for(let e of["ScreenReaderEnabled","IsEnabled"]){let t=Uce("dbus-send",["--session","--type=method_call","--dest=org.a11y.Bus","/org/a11y/bus","org.freedesktop.DBus.Properties.Set","string:org.a11y.Status",`string:${e}`,"variant:boolean:true"],{stdio:"ignore",timeout:5e3});(t.error||t.status!==0)&&console.warn(`[atspi] Could not set org.a11y.Status.${e}`)}}function Bce(e){return new Promise(t=>{setTimeout(t,e)})}var pke=20*1024*1024;var hke=process.platform==="win32";var Vce=65536,gke=Buffer.alloc(Vce);var fE=Wce(import.meta.url);function q6(e){return B6(fE.resolve(`${e}/package.json`))}function Gce(){let e=B6(Jce(import.meta.url)),t=wa(e,"browser-extension-mcp.js");return Hce(t)?{browserMcpEntry:t,computerUseMcpEntry:wa(e,"computer-mcp","dist","index.js"),filesystemMcpEntry:wa(e,"filesystem-mcp.mjs"),extensionDir:wa(e,"browser-extension")}:{browserMcpEntry:fE.resolve("@octavus/browser-extension-mcp"),computerUseMcpEntry:fE.resolve("@octavus/computer-use-mcp"),filesystemMcpEntry:wa(q6("@modelcontextprotocol/server-filesystem"),"dist/index.js"),extensionDir:wa(q6("browser-extension"),"dist")}}function V6(e){let{browserMcpEntry:t,computerUseMcpEntry:r,filesystemMcpEntry:o,extensionDir:n}=Gce(),i={};e.display&&(i.DISPLAY=e.display),process.env.DBUS_SESSION_BUS_ADDRESS&&(i.DBUS_SESSION_BUS_ADDRESS=process.env.DBUS_SESSION_BUS_ADDRESS);let s=[t,`--extension-dir=${n}`,`--profile-dir=${e.browserProfileDir}`,`--download-dir=${e.downloadsDir}`,...e.chromePath?[`--chrome-path=${e.chromePath}`]:[],"--durable-profile",...e.fillWindowSize?["--extra-flag=--window-position=0,0",`--extra-flag=--window-size=${e.fillWindowSize.width},${e.fillWindowSize.height}`,"--reset-window-placement"]:[]];return new la({mcpServers:{filesystem:la.stdio("node",[o,e.workspaceDir,e.skillsDir]),shell:la.shell({cwd:e.workspaceDir,mode:Z6}),"computer-use":la.stdio("node",[r],{env:i}),"browser-extension":la.stdio("node",s,{env:i})},deferredEntries:["browser-extension","computer-use"]})}import{spawn as Kce,spawnSync as lm}from"child_process";import{existsSync as Yce}from"fs";import{platform as Xce}from"os";var ml={width:1920,height:1080};function W6(e){return lm("which",[e],{stdio:"ignore"}).status===0}function H6(e){return lm("xdpyinfo",["-display",e],{stdio:"ignore"}).status===0}function Qce(e){let t=lm("xdpyinfo",["-display",e],{encoding:"utf8"}),r=/dimensions:\s+(\d+)x(\d+)\s+pixels/.exec(t.stdout??"");return r?{width:Number(r[1]),height:Number(r[2])}:void 0}function eue(){for(let e=99;e<120;e++)if(!Yce(`/tmp/.X11-unix/X${e}`))return`:${e}`;return":99"}async function tue(e,t){let r=Date.now()+t;for(;Date.now()<r;){if(H6(e))return!0;await new Promise(o=>{setTimeout(o,200)})}return!1}async function J6(e){if(Xce()!=="linux")return{cleanup:()=>{}};let t=[],r,o=!1;if(!process.env.DISPLAY||!H6(process.env.DISPLAY))if(W6("Xvfb")){let n=eue(),i=Kce("Xvfb",[n,"-screen","0",`${ml.width}x${ml.height}x24`,"-ac","-nolisten","tcp"],{stdio:"ignore"});i.unref(),t.push(()=>i.kill()),process.env.DISPLAY=n,r={...ml},o=!0,await tue(n,5e3)?e.info("Started virtual display",{display:n,...ml}):e.warn("Virtual display did not become ready; browser/computer-use may be unavailable",{display:n})}else e.warn("Xvfb not installed; browser and computer-use tools will be unavailable",{hint:"Install xvfb (e.g. apt-get install -y xvfb) or run under an existing DISPLAY."});else r=Qce(process.env.DISPLAY)??{...ml};if(!process.env.DBUS_SESSION_BUS_ADDRESS&&W6("dbus-launch")){let n=lm("dbus-launch",["--sh-syntax"],{encoding:"utf8"}),i=/DBUS_SESSION_BUS_ADDRESS='([^']+)'/.exec(n.stdout??"")?.[1],s=/DBUS_SESSION_BUS_PID=(\d+)/.exec(n.stdout??"")?.[1];i&&(process.env.DBUS_SESSION_BUS_ADDRESS=i,e.info("Started D-Bus session",{pid:s}),s&&t.push(()=>{try{process.kill(Number(s))}catch{}}))}try{await F6()}catch(n){e.warn("AT-SPI bootstrap failed (computer-use labeling may be degraded)",{error:String(n)})}return{display:process.env.DISPLAY,dimensions:r,ownsDisplay:o,cleanup:()=>{for(let n of t)n()}}}import{spawn as rue,spawnSync as nue}from"child_process";import{existsSync as oue}from"fs";import{dirname as iue,join as G6}from"path";import{fileURLToPath as sue}from"url";var aue={width:1920,height:1080};function cue(){let e=iue(sue(import.meta.url)),t=G6(e,"screen-publisher","index.js");return oue(t)?{command:process.execPath,args:[t]}:{command:process.execPath,args:["--import","tsx",G6(e,"screen-publisher","index.ts")]}}var dm=class{constructor(t){this.log=t}child=null;currentRoom=null;warnedNoFfmpeg=!1;start(t){if(!t.display){this.log.warn("Screen stream requested but no display is available; ignoring");return}if(this.child&&this.currentRoom===t.roomName)return;if(nue("which",["ffmpeg"],{stdio:"ignore"}).status!==0){this.warnedNoFfmpeg||(this.log.warn("Screen stream requested but ffmpeg is not installed; skipping",{hint:"Install ffmpeg (e.g. apt-get install -y ffmpeg) to enable the live computer view."}),this.warnedNoFfmpeg=!0);return}this.child&&this.stop();let r=t.dimensions??aue,{command:o,args:n}=cue(),i=rue(o,n,{stdio:["ignore","ignore","inherit"],env:{...process.env,DISPLAY:t.display,LIVEKIT_URL:t.livekitUrl,LIVEKIT_TOKEN:t.token,SCREEN_WIDTH:String(r.width),SCREEN_HEIGHT:String(r.height)}});i.on("exit",s=>{this.child===i&&(this.child=null,this.currentRoom=null),this.log.info("Screen stream publisher exited",{code:s})}),i.on("error",s=>{this.log.warn("Screen stream publisher failed to start",{error:String(s)}),this.child===i&&(this.child=null,this.currentRoom=null)}),this.child=i,this.currentRoom=t.roomName,this.log.info("Screen stream publisher started",{roomName:t.roomName})}stop(){if(this.child){try{this.child.kill("SIGTERM")}catch{}this.child=null,this.currentRoom=null}}};import{createRequire as uue}from"module";var lue=uue(import.meta.url),due=lue("../package.json"),li=due.version;var gl=class extends Error{constructor(r,o,n){super(r);this.status=o;this.code=n;this.name="PlatformError"}};async function K6(e){let t={};try{t=await e.json()}catch{}return new gl(t.error??e.statusText??"Request failed",e.status,t.code)}async function fm(e){let t=await fetch(`${e}/api/cli/version`);if(!t.ok)throw await K6(t);return await t.json()}async function Y6(e,t,r){let o=await fetch(`${e}/api/v1/workforce/cli/sessions`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`,"X-Octavus-CLI-Version":li},body:JSON.stringify(r)});if(!o.ok)throw await K6(o);return await o.json()}import{readFileSync as fue}from"fs";function X6(e){let t=e.configFile?pue(e.configFile):{},r={...t.capabilities??{}};for(let s of e.capabilityFlags??[]){let{slug:a,enabled:u}=mue(s);r[a]=u}let o=e.model??t.model,n=e.backupModel??t.backupModel,i={...o?{model:o}:{},...n?{backupModel:n}:{},...Object.keys(r).length>0?{capabilities:r}:{}};return Object.keys(i).length>0?i:void 0}function pue(e){let t;try{t=fue(e,"utf8")}catch(i){throw new Error(`Could not read --config file "${e}": ${i instanceof Error?i.message:String(i)}`)}let r;try{r=JSON.parse(t)}catch{throw new Error(`--config file "${e}" is not valid JSON.`)}if(typeof r!="object"||r===null||Array.isArray(r))throw new Error(`--config file "${e}" must be a JSON object.`);let o=r,n={};if(o.model!==void 0){if(typeof o.model!="string")throw new Error('--config "model" must be a string.');n.model=o.model}if(o.backupModel!==void 0){if(typeof o.backupModel!="string")throw new Error('--config "backupModel" must be a string.');n.backupModel=o.backupModel}return o.capabilities!==void 0&&(n.capabilities=hue(o.capabilities)),n}function hue(e){if(typeof e!="object"||e===null||Array.isArray(e))throw new Error('--config "capabilities" must be an object of { slug: boolean }.');let t={};for(let[r,o]of Object.entries(e)){if(typeof o!="boolean")throw new Error(`--config capability "${r}" must be true or false.`);t[r]=o}return t}function mue(e){let t=e.indexOf("="),r=(t>=0?e.slice(0,t):e).trim();if(!r)throw new Error(`Invalid --capability "${e}". Use --capability <slug>=<on|off>.`);let o=(t>=0?e.slice(t+1):"on").trim().toLowerCase(),n=gue(o);if(n===void 0)throw new Error(`Invalid --capability value in "${e}". Use on or off (e.g. --capability memory=off).`);return{slug:r,enabled:n}}function gue(e){if(["on","true","yes","1","enabled"].includes(e))return!0;if(["off","false","no","0","disabled"].includes(e))return!1}function xue(e,t){let r=e.split("."),o=t.split("."),n=Math.max(r.length,o.length);for(let i=0;i<n;i+=1){let s=Number(r[i]??"0"),a=Number(o[i]??"0"),u=Number.isNaN(s)?0:s,c=Number.isNaN(a)?0:a;if(u!==c)return u-c}return 0}async function eF(e){let t=VA(!!e.verbose),r=!!e.json,o=(I,W,U)=>(process.stderr.write(`Error: ${I}
150
+ `)}`);return this.started=!0,{errors:o}}async stop(){let e=[];for(let t of this.entries.values())t.connection&&e.push(t.connection.close().catch(()=>{}));if(await Promise.allSettled(e),this.config.managedProcesses)for(let t of this.config.managedProcesses)try{t.process.kill()}catch{}this.entries.clear(),this.started=!1}async retryDegraded(){let e=[],t=[],r=[...this.entries.values()].filter(n=>n.status==="degraded");if(r.length===0)return{recovered:e,stillDegraded:t};let o=await Promise.allSettled(r.map(async n=>(n.connection&&await n.connection.close().catch(()=>{}),await this.connectEntry(n.namespace,this.config.mcpServers[n.namespace]),n.namespace)));for(let n=0;n<o.length;n++){let i=o[n],s=r[n].namespace;if(i.status==="fulfilled")e.push(s);else{let a=i.reason instanceof Error?i.reason.message:String(i.reason);this.setDegradedEntry(s,a),t.push(s)}}return{recovered:e,stillDegraded:t}}async stopEntry(e){let t=this.entries.get(e);t?.connection&&await t.connection.close().catch(()=>{}),this.setDegradedEntry(e,"Entry stopped")}hasEntry(e){return this.config.mcpServers[e]!==void 0}async addEntry(e,t,r){if(this.config.mcpServers[e])throw new Error(`MCP entry "${e}" already exists. Call removeEntry first to replace.`);if(this.config.mcpServers[e]=t,r?.deferred)this.setDegradedEntry(e,"Deferred - connect via restartEntry()");else try{await this.connectEntry(e,t)}catch(o){let n=o instanceof Error?o.message:String(o);this.setDegradedEntry(e,n)}}async removeEntry(e){let t=this.entries.get(e);t?.connection&&await t.connection.close().catch(()=>{}),this.entries.delete(e);let{[e]:r,...o}=this.config.mcpServers;this.config.mcpServers=o}async restartEntry(e){let t=this.config.mcpServers[e];if(!t)return;let r=this.entries.get(e);r?.connection&&await r.connection.close().catch(()=>{});try{await this.connectEntry(e,t)}catch(o){let n=o instanceof Error?o.message:String(o);this.setDegradedEntry(e,n)}}async getHealth(){let e=[...this.entries.values()].map(o=>this.probeEntry(o)),t=await Promise.all(e);return{healthy:t.length>0&&t.every(o=>o.healthy),entries:t,totalTools:this.toolSchemas().length}}async ensureReady(){let e=await this.getHealth();if(e.healthy)return e;let t=e.entries.filter(i=>!i.healthy);await Promise.allSettled(t.map(i=>this.restartEntry(i.name)));let r=await this.getHealth(),o=[],n=[];for(let i of t)r.entries.find(a=>a.name===i.name)?.healthy?o.push(i.name):n.push(i.name);return{...r,recovered:o,failedEntries:n}}toolHandlers(){let e={};for(let t of this.entries.values())Object.assign(e,t.handlers);return e}toolSchemas(){let e=[];for(let t of this.entries.values())e.push(...t.schemas);return e}async probeEntry(e){if(e.status==="degraded")return{name:e.namespace,healthy:!1,error:e.error};if(!e.connection)return{name:e.namespace,healthy:!0};try{return await Promise.race([e.connection.ping(),new Promise((t,r)=>{setTimeout(()=>r(new Error("Health probe timed out")),qse)})]),{name:e.namespace,healthy:!0}}catch(t){let r=t instanceof Error?t.message:String(t);return{name:e.namespace,healthy:!1,error:r}}}setDegradedEntry(e,t){let r=this.config.diagnostics?.[e],o=Ak(e,"degraded",[],t,r);this.entries.set(e,{namespace:e,handlers:{[o.schema.name]:o.handler},schemas:[o.schema],status:"degraded",error:t})}async connectEntry(e,t){if(t.type==="shell"){let i=Rse(e,t),s=i.schemas.map(u=>u.name.split(al)[1]),a=Ak(e,"connected",s);this.entries.set(e,{namespace:e,handlers:{...i.handlers,[a.schema.name]:a.handler},schemas:[...i.schemas,a.schema],status:"connected"});return}let r=t.type==="stdio"?await zse(e,t):await Tse(e,t),o=r.schemas.map(i=>i.name.split(al)[1]),n=Ak(e,"connected",o);this.entries.set(e,{namespace:e,handlers:{...r.handlers,[n.schema.name]:n.handler},schemas:[...r.schemas,n.schema],connection:r,status:"connected"})}};import{spawn as jce,spawnSync as Uce}from"child_process";import{existsSync as Lce}from"fs";import{platform as Mce}from"os";var zZ=Symbol();var TZ=async(e,t=Object.create(null))=>{let{all:r=!1,dot:o=!1}=t,i=(e instanceof Nk?e.raw.headers:e.headers).get("Content-Type");return i?.startsWith("multipart/form-data")||i?.startsWith("application/x-www-form-urlencoded")?Bse(e,{all:r,dot:o}):{}};async function Bse(e,t){let r=await e.formData();return r?Vse(r,t):{}}function Vse(e,t){let r=Object.create(null);return e.forEach((o,n)=>{t.all||n.endsWith("[]")?Wse(r,n,o):r[n]=o}),t.dot&&Object.entries(r).forEach(([o,n])=>{o.includes(".")&&(Hse(r,o,n),delete r[o])}),r}var Wse=(e,t,r)=>{e[t]!==void 0?Array.isArray(e[t])?e[t].push(r):e[t]=[e[t],r]:t.endsWith("[]")?e[t]=[r]:e[t]=r},Hse=(e,t,r)=>{let o=e,n=t.split(".");n.forEach((i,s)=>{s===n.length-1?o[i]=r:((!o[i]||typeof o[i]!="object"||Array.isArray(o[i])||o[i]instanceof File)&&(o[i]=Object.create(null)),o=o[i])})};var jk=(e,t)=>{try{return t(e)}catch{return e.replace(/(?:%[0-9A-Fa-f]{2})+/g,r=>{try{return t(r)}catch{return r}})}};var Dk=e=>/[%+]/.test(e)?(e.indexOf("+")!==-1&&(e=e.replace(/\+/g," ")),e.indexOf("%")!==-1?jk(e,Uk):e):e,IZ=(e,t,r)=>{let o;if(!r&&t&&!/[%+]/.test(t)){let s=e.indexOf("?",8);if(s===-1)return;for(e.startsWith(t,s+1)||(s=e.indexOf(`&${t}`,s+1));s!==-1;){let a=e.charCodeAt(s+t.length+1);if(a===61){let u=s+t.length+2,c=e.indexOf("&",u);return Dk(e.slice(u,c===-1?void 0:c))}else if(a==38||isNaN(a))return"";s=e.indexOf(`&${t}`,s+1)}if(o=/[%+]/.test(e),!o)return}let n={};o??=/[%+]/.test(e);let i=e.indexOf("?",8);for(;i!==-1;){let s=e.indexOf("&",i+1),a=e.indexOf("=",i);a>s&&s!==-1&&(a=-1);let u=e.slice(i+1,a===-1?s===-1?void 0:s:a);if(o&&(u=Dk(u)),i=s,u==="")continue;let c;a===-1?c="":(c=e.slice(a+1,s===-1?void 0:s),o&&(c=Dk(c))),r?(n[u]&&Array.isArray(n[u])||(n[u]=[]),n[u].push(c)):n[u]??=c}return t?n[t]:n},PZ=IZ,OZ=(e,t)=>IZ(e,t,!0),Uk=decodeURIComponent;var RZ=e=>jk(e,Uk),Nk=class{raw;#t;#e;routeIndex=0;path;bodyCache={};constructor(e,t="/",r=[[]]){this.raw=e,this.path=t,this.#e=r,this.#t={}}param(e){return e?this.#o(e):this.#i()}#o(e){let t=this.#e[0][this.routeIndex][1][e],r=this.#n(t);return r&&/\%/.test(r)?RZ(r):r}#i(){let e={},t=Object.keys(this.#e[0][this.routeIndex][1]);for(let r of t){let o=this.#n(this.#e[0][this.routeIndex][1][r]);o!==void 0&&(e[r]=/\%/.test(o)?RZ(o):o)}return e}#n(e){return this.#e[1]?this.#e[1][e]:e}query(e){return PZ(this.url,e)}queries(e){return OZ(this.url,e)}header(e){if(e)return this.raw.headers.get(e)??void 0;let t={};return this.raw.headers.forEach((r,o)=>{t[o]=r}),t}async parseBody(e){return this.bodyCache.parsedBody??=await TZ(this,e)}#r=e=>{let{bodyCache:t,raw:r}=this,o=t[e];if(o)return o;let n=Object.keys(t)[0];return n?t[n].then(i=>(n==="json"&&(i=JSON.stringify(i)),new Response(i)[e]())):t[e]=r[e]()};json(){return this.#r("text").then(e=>JSON.parse(e))}text(){return this.#r("text")}arrayBuffer(){return this.#r("arrayBuffer")}blob(){return this.#r("blob")}formData(){return this.#r("formData")}addValidatedData(e,t){this.#t[e]=t}valid(e){return this.#t[e]}get url(){return this.raw.url}get method(){return this.raw.method}get[zZ](){return this.#e}get matchedRoutes(){return this.#e[0].map(([[,e]])=>e)}get routePath(){return this.#e[0].map(([[,e]])=>e)[this.routeIndex].path}};var BSe=new Set(".\\+*[^]$()");var wce=We(T6(),1),xce=We(rm(),1),Sce=We(pa(),1),$ce=We(Gk(),1),kce=We(Xk(),1),Ece=We(oE(),1),sE=We(sm(),1),zce=We(D6(),1);import{Readable as j6}from"stream";import Nce from"crypto";var Tce=global.Request,uE=class extends Tce{constructor(e,t){typeof e=="object"&&ba in e&&(e=e[ba]()),typeof t?.body?.getReader<"u"&&(t.duplex??="half"),super(e,t)}},Ice=e=>{let t=[],r=e.rawHeaders;for(let o=0;o<r.length;o+=2){let{[o]:n,[o+1]:i}=r;n.charCodeAt(0)!==58&&t.push([n,i])}return new Headers(t)},Pce=Symbol("wrapBodyStream"),Oce=(e,t,r,o,n)=>{let i={method:e,headers:r,signal:n.signal};if(e==="TRACE"){i.method="GET";let s=new uE(t,i);return Object.defineProperty(s,"method",{get(){return"TRACE"}}),s}if(!(e==="GET"||e==="HEAD"))if("rawBody"in o&&o.rawBody instanceof Buffer)i.body=new ReadableStream({start(s){s.enqueue(o.rawBody),s.close()}});else if(o[Pce]){let s;i.body=new ReadableStream({async pull(a){try{s||=j6.toWeb(o).getReader();let{done:u,value:c}=await s.read();u?a.close():a.enqueue(c)}catch(u){a.error(u)}}})}else i.body=j6.toWeb(o);return new uE(t,i)},ba=Symbol("getRequestCache"),Rce=Symbol("requestCache"),aE=Symbol("incomingKey"),U6=Symbol("urlKey"),Cce=Symbol("headersKey"),cE=Symbol("abortControllerKey"),Ace=Symbol("getAbortController"),lE={get method(){return this[aE].method||"GET"},get url(){return this[U6]},get headers(){return this[Cce]||=Ice(this[aE])},[Ace](){return this[ba](),this[cE]},[ba](){return this[cE]||=new AbortController,this[Rce]||=Oce(this.method,this[U6],this.headers,this[aE],this[cE])}};["body","bodyUsed","cache","credentials","destination","integrity","mode","redirect","referrer","referrerPolicy","signal","keepalive"].forEach(e=>{Object.defineProperty(lE,e,{get(){return this[ba]()[e]}})});["arrayBuffer","blob","clone","formData","json","text"].forEach(e=>{Object.defineProperty(lE,e,{value:function(){return this[ba]()[e]()}})});Object.setPrototypeOf(lE,uE.prototype);var L6=Symbol("responseCache"),ya=Symbol("getResponseCache"),cm=Symbol("cache"),dE=global.Response,um=class M6{#t;#e;[ya](){return delete this[cm],this[L6]||=new dE(this.#t,this.#e)}constructor(t,r){let o;if(this.#t=t,r instanceof M6){let n=r[L6];if(n){this.#e=n,this[ya]();return}else this.#e=r.#e,o=new Headers(r.#e.headers)}else this.#e=r;(typeof t=="string"||typeof t?.getReader<"u"||t instanceof Blob||t instanceof Uint8Array)&&(o||=r?.headers||{"content-type":"text/plain; charset=UTF-8"},this[cm]=[r?.status||200,t,o])}get headers(){let t=this[cm];return t?(t[2]instanceof Headers||(t[2]=new Headers(t[2])),t[2]):this[ya]().headers}get status(){return this[cm]?.[0]??this[ya]().status}get ok(){let t=this.status;return t>=200&&t<300}};["body","bodyUsed","redirected","statusText","trailers","type","url"].forEach(e=>{Object.defineProperty(um.prototype,e,{get(){return this[ya]()[e]}})});["arrayBuffer","blob","clone","formData","json","text"].forEach(e=>{Object.defineProperty(um.prototype,e,{value:function(){return this[ya]()[e]()}})});Object.setPrototypeOf(um,dE);Object.setPrototypeOf(um.prototype,dE.prototype);typeof global.crypto>"u"&&(global.crypto=Nce);var oke=Symbol("outgoingEnded");var Dce="browser-extension",cke=`${Dce}__`,Z6={blockedPatterns:[/\bpkill\b[^|;&]*\b(node|entry(\.js)?|chromium?|supervise-entry)\b/,/\bkillall\b[^|;&]*\b(node|chromium?|chrome)\b/,/\bfuser\s+-k\s+.*\b(8080|6080|5900)\b/,/\b(reboot|shutdown|halt|poweroff)\b/,/\binit\s+0\b/]};async function F6(){if(Mce()==="linux"){if(!process.env.DBUS_SESSION_BUS_ADDRESS){console.warn("[atspi] DBUS_SESSION_BUS_ADDRESS unset; skipping AT-SPI bootstrap");return}Fce(),await Bce(400),qce()}}var Zce=["/usr/libexec/at-spi-bus-launcher","/usr/lib/at-spi2-core/at-spi-bus-launcher"];function Fce(){let e=Zce.find(t=>Lce(t));if(e)try{let t=jce(e,["--launch-immediately"],{detached:!0,stdio:"ignore"});t.on("error",r=>console.warn("[atspi] at-spi-bus-launcher failed to start:",r)),t.unref()}catch(t){console.warn("[atspi] Could not start at-spi-bus-launcher:",t)}}function qce(){for(let e of["ScreenReaderEnabled","IsEnabled"]){let t=Uce("dbus-send",["--session","--type=method_call","--dest=org.a11y.Bus","/org/a11y/bus","org.freedesktop.DBus.Properties.Set","string:org.a11y.Status",`string:${e}`,"variant:boolean:true"],{stdio:"ignore",timeout:5e3});(t.error||t.status!==0)&&console.warn(`[atspi] Could not set org.a11y.Status.${e}`)}}function Bce(e){return new Promise(t=>{setTimeout(t,e)})}var pke=20*1024*1024;var hke=process.platform==="win32";var Vce=65536,gke=Buffer.alloc(Vce);var fE=Wce(import.meta.url);function q6(e){return B6(fE.resolve(`${e}/package.json`))}function Gce(){let e=B6(Jce(import.meta.url)),t=wa(e,"browser-extension-mcp.js");return Hce(t)?{browserMcpEntry:t,computerUseMcpEntry:wa(e,"computer-mcp","dist","index.js"),filesystemMcpEntry:wa(e,"filesystem-mcp.mjs"),extensionDir:wa(e,"browser-extension")}:{browserMcpEntry:fE.resolve("@octavus/browser-extension-mcp"),computerUseMcpEntry:fE.resolve("@octavus/computer-use-mcp"),filesystemMcpEntry:wa(q6("@modelcontextprotocol/server-filesystem"),"dist/index.js"),extensionDir:wa(q6("browser-extension"),"dist")}}function V6(e){let{browserMcpEntry:t,computerUseMcpEntry:r,filesystemMcpEntry:o,extensionDir:n}=Gce(),i={};e.display&&(i.DISPLAY=e.display),process.env.DBUS_SESSION_BUS_ADDRESS&&(i.DBUS_SESSION_BUS_ADDRESS=process.env.DBUS_SESSION_BUS_ADDRESS);let s=[t,`--extension-dir=${n}`,`--profile-dir=${e.browserProfileDir}`,`--download-dir=${e.downloadsDir}`,...e.chromePath?[`--chrome-path=${e.chromePath}`]:[],"--durable-profile",...e.fillWindowSize?["--extra-flag=--window-position=0,0",`--extra-flag=--window-size=${e.fillWindowSize.width},${e.fillWindowSize.height}`,"--reset-window-placement"]:[]];return new la({mcpServers:{filesystem:la.stdio("node",[o,e.workspaceDir,e.skillsDir]),shell:la.shell({cwd:e.workspaceDir,mode:Z6}),"computer-use":la.stdio("node",[r],{env:i}),"browser-extension":la.stdio("node",s,{env:i})},deferredEntries:["browser-extension","computer-use"]})}import{spawn as Kce,spawnSync as lm}from"child_process";import{existsSync as Yce}from"fs";import{platform as Xce}from"os";var ml={width:1920,height:1080};function W6(e){return lm("which",[e],{stdio:"ignore"}).status===0}function H6(e){return lm("xdpyinfo",["-display",e],{stdio:"ignore"}).status===0}function Qce(e){let t=lm("xdpyinfo",["-display",e],{encoding:"utf8"}),r=/dimensions:\s+(\d+)x(\d+)\s+pixels/.exec(t.stdout??"");return r?{width:Number(r[1]),height:Number(r[2])}:void 0}function eue(){for(let e=99;e<120;e++)if(!Yce(`/tmp/.X11-unix/X${e}`))return`:${e}`;return":99"}async function tue(e,t){let r=Date.now()+t;for(;Date.now()<r;){if(H6(e))return!0;await new Promise(o=>{setTimeout(o,200)})}return!1}async function J6(e){if(Xce()!=="linux")return{cleanup:()=>{}};let t=[],r,o=!1;if(!process.env.DISPLAY||!H6(process.env.DISPLAY))if(W6("Xvfb")){let n=eue(),i=Kce("Xvfb",[n,"-screen","0",`${ml.width}x${ml.height}x24`,"-ac","-nolisten","tcp"],{stdio:"ignore"});i.unref(),t.push(()=>i.kill()),process.env.DISPLAY=n,r={...ml},o=!0,await tue(n,5e3)?e.info("Started virtual display",{display:n,...ml}):e.warn("Virtual display did not become ready; browser/computer-use may be unavailable",{display:n})}else e.warn("Xvfb not installed; browser and computer-use tools will be unavailable",{hint:"Install xvfb (e.g. apt-get install -y xvfb) or run under an existing DISPLAY."});else r=Qce(process.env.DISPLAY)??{...ml};if(!process.env.DBUS_SESSION_BUS_ADDRESS&&W6("dbus-launch")){let n=lm("dbus-launch",["--sh-syntax"],{encoding:"utf8"}),i=/DBUS_SESSION_BUS_ADDRESS='([^']+)'/.exec(n.stdout??"")?.[1],s=/DBUS_SESSION_BUS_PID=(\d+)/.exec(n.stdout??"")?.[1];i&&(process.env.DBUS_SESSION_BUS_ADDRESS=i,e.info("Started D-Bus session",{pid:s}),s&&t.push(()=>{try{process.kill(Number(s))}catch{}}))}try{await F6()}catch(n){e.warn("AT-SPI bootstrap failed (computer-use labeling may be degraded)",{error:String(n)})}return{display:process.env.DISPLAY,dimensions:r,ownsDisplay:o,cleanup:()=>{for(let n of t)n()}}}import{spawn as rue,spawnSync as nue}from"child_process";import{existsSync as oue}from"fs";import{dirname as iue,join as G6}from"path";import{fileURLToPath as sue}from"url";var aue={width:1920,height:1080};function cue(){let e=iue(sue(import.meta.url)),t=G6(e,"screen-publisher","index.js");return oue(t)?{command:process.execPath,args:[t]}:{command:process.execPath,args:["--import","tsx",G6(e,"screen-publisher","index.ts")]}}var dm=class{constructor(t){this.log=t}child=null;currentRoom=null;currentFrameRate=void 0;warnedNoFfmpeg=!1;start(t){if(!t.display){this.log.warn("Screen stream requested but no display is available; ignoring");return}if(this.child&&this.currentRoom===t.roomName&&this.currentFrameRate===t.frameRate)return;if(nue("which",["ffmpeg"],{stdio:"ignore"}).status!==0){this.warnedNoFfmpeg||(this.log.warn("Screen stream requested but ffmpeg is not installed; skipping",{hint:"Install ffmpeg (e.g. apt-get install -y ffmpeg) to enable the live computer view."}),this.warnedNoFfmpeg=!0);return}this.child&&this.stop();let r=t.dimensions??aue,{command:o,args:n}=cue(),i=rue(o,n,{stdio:["ignore","ignore","inherit"],env:{...process.env,DISPLAY:t.display,LIVEKIT_URL:t.livekitUrl,LIVEKIT_TOKEN:t.token,SCREEN_WIDTH:String(r.width),SCREEN_HEIGHT:String(r.height),...t.frameRate!==void 0?{SCREEN_FRAME_RATE:String(t.frameRate)}:{}}});i.on("exit",s=>{this.child===i&&(this.child=null,this.currentRoom=null,this.currentFrameRate=void 0),this.log.info("Screen stream publisher exited",{code:s})}),i.on("error",s=>{this.log.warn("Screen stream publisher failed to start",{error:String(s)}),this.child===i&&(this.child=null,this.currentRoom=null,this.currentFrameRate=void 0)}),this.child=i,this.currentRoom=t.roomName,this.currentFrameRate=t.frameRate,this.log.info("Screen stream publisher started",{roomName:t.roomName,...t.frameRate!==void 0?{frameRate:t.frameRate}:{}})}stop(){if(this.child){try{this.child.kill("SIGTERM")}catch{}this.child=null,this.currentRoom=null,this.currentFrameRate=void 0}}};import{createRequire as uue}from"module";var lue=uue(import.meta.url),due=lue("../package.json"),li=due.version;var gl=class extends Error{constructor(r,o,n){super(r);this.status=o;this.code=n;this.name="PlatformError"}};async function K6(e){let t={};try{t=await e.json()}catch{}return new gl(t.error??e.statusText??"Request failed",e.status,t.code)}async function fm(e){let t=await fetch(`${e}/api/cli/version`);if(!t.ok)throw await K6(t);return await t.json()}async function Y6(e,t,r){let o=await fetch(`${e}/api/v1/workforce/cli/sessions`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`,"X-Octavus-CLI-Version":li},body:JSON.stringify(r)});if(!o.ok)throw await K6(o);return await o.json()}import{readFileSync as fue}from"fs";function X6(e){let t=e.configFile?pue(e.configFile):{},r={...t.capabilities??{}};for(let u of e.capabilityFlags??[]){let{slug:c,enabled:l}=mue(u);r[c]=l}let o=e.model??t.model,n=e.backupModel??t.backupModel,i=e.record===!0||e.recordPublic===!0||t.record===!0,s=e.recordPublic===!0?"public":t.recordVisibility,a={...o?{model:o}:{},...n?{backupModel:n}:{},...Object.keys(r).length>0?{capabilities:r}:{},...i?{record:!0}:{},...i&&s!==void 0?{recordVisibility:s}:{}};return Object.keys(a).length>0?a:void 0}function pue(e){let t;try{t=fue(e,"utf8")}catch(i){throw new Error(`Could not read --config file "${e}": ${i instanceof Error?i.message:String(i)}`)}let r;try{r=JSON.parse(t)}catch{throw new Error(`--config file "${e}" is not valid JSON.`)}if(typeof r!="object"||r===null||Array.isArray(r))throw new Error(`--config file "${e}" must be a JSON object.`);let o=r,n={};if(o.model!==void 0){if(typeof o.model!="string")throw new Error('--config "model" must be a string.');n.model=o.model}if(o.backupModel!==void 0){if(typeof o.backupModel!="string")throw new Error('--config "backupModel" must be a string.');n.backupModel=o.backupModel}if(o.capabilities!==void 0&&(n.capabilities=hue(o.capabilities)),o.record!==void 0){if(typeof o.record!="boolean")throw new Error('--config "record" must be a boolean.');n.record=o.record}if(o.recordVisibility!==void 0){if(o.recordVisibility!=="private"&&o.recordVisibility!=="public")throw new Error('--config "recordVisibility" must be "private" or "public".');n.recordVisibility=o.recordVisibility}return n}function hue(e){if(typeof e!="object"||e===null||Array.isArray(e))throw new Error('--config "capabilities" must be an object of { slug: boolean }.');let t={};for(let[r,o]of Object.entries(e)){if(typeof o!="boolean")throw new Error(`--config capability "${r}" must be true or false.`);t[r]=o}return t}function mue(e){let t=e.indexOf("="),r=(t>=0?e.slice(0,t):e).trim();if(!r)throw new Error(`Invalid --capability "${e}". Use --capability <slug>=<on|off>.`);let o=(t>=0?e.slice(t+1):"on").trim().toLowerCase(),n=gue(o);if(n===void 0)throw new Error(`Invalid --capability value in "${e}". Use on or off (e.g. --capability memory=off).`);return{slug:r,enabled:n}}function gue(e){if(["on","true","yes","1","enabled"].includes(e))return!0;if(["off","false","no","0","disabled"].includes(e))return!1}function xue(e,t){let r=e.split("."),o=t.split("."),n=Math.max(r.length,o.length);for(let i=0;i<n;i+=1){let s=Number(r[i]??"0"),a=Number(o[i]??"0"),u=Number.isNaN(s)?0:s,c=Number.isNaN(a)?0:a;if(u!==c)return u-c}return 0}async function eF(e){let t=VA(!!e.verbose),r=!!e.json,o=(I,W,U)=>(process.stderr.write(`Error: ${I}
151
151
  `),r&&process.stdout.write(`${JSON.stringify({status:"failed",error:I,...U})}
152
- `),W),n=Gc(e.env,e.platformUrl),i=qA(e.env,e.apiKey),s=xp(e.env,e.operatorUrl);if(!n)return o(`No platform URL for environment "${e.env}". Configure it once with \`octoagent auth --env ${e.env} --platform-url <url> --api-key <oct_agt_...>\`, or pass --platform-url / set OCTAVUS_PLATFORM_URL.`,2);if(!i)return o("No API key configured. Run `octoagent auth --api-key <oct_agt_...>` or pass --api-key.",2);let a=wue(e.workdir??process.cwd());if(!e.force&&(a===Q6()||a==="/"))return o(`Refusing to run with the workspace at ${a}. cd into a project directory, pass --workdir <dir>, or --force to override.`,2);let u;try{u=X6({configFile:e.configFile,model:e.model,backupModel:e.backupModel,capabilityFlags:e.capabilities})}catch(I){return o(I instanceof Error?I.message:String(I),2)}try{let I=await fm(n);if(xue(li,I.minVersion)<0)return o(`This Octavus Agent CLI (${li}) is out of date. Update to ${I.minVersion} or newer to run.`,3)}catch(I){t.warn("Could not check the supported CLI version; continuing",{error:String(I)})}let c;try{c=await Y6(n,i,{prompt:e.prompt,config:u})}catch(I){return I instanceof gl?o(I.message,I.status===426?3:1):o(`Failed to start the run: ${String(I)}`,1)}let l=`${n}/agents/${c.octoAgentId}/chat/${c.threadId}`,f=`Started run. Watch it live: ${l}
153
- `;r?process.stderr.write(f):process.stdout.write(f);let p=BA(e.env,c.octoAgentId),h=bue(a,"downloads");yue(h,{recursive:!0});let m=await J6(t),g=new dm(t),_={os:vue(),arch:_ue(),workingDirectory:a,homeDirectory:Q6(),skillsDirectory:p.skillsDir,downloadsDirectory:h,...m.dimensions?{display:m.dimensions}:{}},v=async()=>{let I=V6({workspaceDir:a,skillsDir:p.skillsDir,browserProfileDir:p.browserProfileDir,downloadsDir:h,chromePath:e.chromePath,display:m.display,fillWindowSize:m.ownsDisplay?m.dimensions:void 0}),{errors:W}=await I.start();return W.length>0&&t.warn("Some computer tools failed to start",{errors:W}),I},w=null,k,S=new Promise(I=>{k=I}),b=new DA({operatorWsUrl:s??c.operator.wsUrl,computerToken:c.operator.computerToken,octoAgentId:c.octoAgentId,onDispatch:()=>{},onDeviceControl:I=>{I.type==="start-screen-stream"&&g.start({livekitUrl:I.livekitUrl,token:I.token,roomName:I.roomName,display:m.display,dimensions:m.dimensions})},onStop:I=>w?.handleStop(I),onRequestSessionState:I=>w?.handleRequestSessionState(I),getActiveSessionIds:()=>w?.getActiveSessions().map(I=>I.sessionId)??[],onDisconnected:I=>w?.handleConnectionLost(I),onReconnected:()=>w?.handleConnectionRestored(),onStateChange:I=>{I==="connected"&&k()},logger:t}),T=new LA({octoAgentId:c.octoAgentId,connection:b,computer:v,platformUrl:n,deviceSkillsDir:p.skillsDir,agentWorkspaceDir:a,environment:_,logger:t,onComputerReset:v});w=T,T.start(),b.connect(),await Promise.race([S,new Promise(I=>{setTimeout(I,2e4)})]),b.getState()!=="connected"&&t.warn("Operator relay not connected; the run still completes, but its live view may lag");let C={type:"dispatch",sessionId:c.sessionId,operatorToken:c.driverToken,trigger:c.trigger,deviceMcpConfigs:c.deviceMcpConfigs,deviceSkillConfigs:c.deviceSkillConfigs},N;try{N=await T.runLocalDispatch(C)}finally{g.stop(),await T.stop(),await b.closeGracefully(),m.cleanup()}return r?(process.stdout.write(`${JSON.stringify({threadId:c.threadId,sessionId:c.sessionId,status:N.status,threadUrl:l,...N.error?{error:N.error}:{}})}
154
- `),N.status==="completed"?0:1):N.status==="completed"?(process.stdout.write(`Run completed. View: ${l}
155
- `),0):(process.stderr.write(`Error: Run ${N.status}${N.error?`: ${N.error}`:""}. View: ${l}
156
- `),1)}var Sue=new Set(["json","force","verbose"]);function $ue(e){let t=[],r={};for(let o=0;o<e.length;o++){let n=e[o];if(n.startsWith("--")){let i=n.slice(2),s=i.indexOf("=");if(s>=0)r[i.slice(0,s)]=i.slice(s+1);else if(Sue.has(i))r[i]=!0;else{let a=e[o+1];a!==void 0&&!a.startsWith("--")?(r[i]=a,o+=1):r[i]=!0}}else t.push(n)}return{positionals:t,flags:r}}function it(e){return typeof e=="string"?e:void 0}function kue(e,t){let r=[];for(let o=0;o<e.length;o+=1){let n=e[o];if(n===`--${t}`){let i=e[o+1];i!==void 0&&!i.startsWith("--")&&(r.push(i),o+=1)}else n.startsWith(`--${t}=`)&&r.push(n.slice(t.length+3))}return r}var tF=`octoagent - run your cloud Octavus Agent on a machine you control
152
+ `),W),n=Gc(e.env,e.platformUrl),i=qA(e.env,e.apiKey),s=xp(e.env,e.operatorUrl);if(!n)return o(`No platform URL for environment "${e.env}". Configure it once with \`octoagent auth --env ${e.env} --platform-url <url> --api-key <oct_agt_...>\`, or pass --platform-url / set OCTAVUS_PLATFORM_URL.`,2);if(!i)return o("No API key configured. Run `octoagent auth --api-key <oct_agt_...>` or pass --api-key.",2);let a=wue(e.workdir??process.cwd());if(!e.force&&(a===Q6()||a==="/"))return o(`Refusing to run with the workspace at ${a}. cd into a project directory, pass --workdir <dir>, or --force to override.`,2);let u;try{u=X6({configFile:e.configFile,model:e.model,backupModel:e.backupModel,capabilityFlags:e.capabilities,record:e.record,recordPublic:e.recordPublic})}catch(I){return o(I instanceof Error?I.message:String(I),2)}try{let I=await fm(n);if(xue(li,I.minVersion)<0)return o(`This Octavus Agent CLI (${li}) is out of date. Update to ${I.minVersion} or newer to run.`,3)}catch(I){t.warn("Could not check the supported CLI version; continuing",{error:String(I)})}let c;try{c=await Y6(n,i,{prompt:e.prompt,config:u})}catch(I){return I instanceof gl?o(I.message,I.status===426?3:1):o(`Failed to start the run: ${String(I)}`,1)}let l=`${n}/agents/${c.octoAgentId}/chat/${c.threadId}`,f=`Started run. Watch it live: ${l}
153
+ `;r?process.stderr.write(f):process.stdout.write(f);let p=BA(e.env,c.octoAgentId),h=bue(a,"downloads");yue(h,{recursive:!0});let m=await J6(t),g=new dm(t),_={os:vue(),arch:_ue(),workingDirectory:a,homeDirectory:Q6(),skillsDirectory:p.skillsDir,downloadsDirectory:h,...m.dimensions?{display:m.dimensions}:{}},v=async()=>{let I=V6({workspaceDir:a,skillsDir:p.skillsDir,browserProfileDir:p.browserProfileDir,downloadsDir:h,chromePath:e.chromePath,display:m.display,fillWindowSize:m.ownsDisplay?m.dimensions:void 0}),{errors:W}=await I.start();return W.length>0&&t.warn("Some computer tools failed to start",{errors:W}),I},w=null,k,S=new Promise(I=>{k=I}),b=new DA({operatorWsUrl:s??c.operator.wsUrl,computerToken:c.operator.computerToken,octoAgentId:c.octoAgentId,onDispatch:()=>{},onDeviceControl:I=>{I.type==="start-screen-stream"&&g.start({livekitUrl:I.livekitUrl,token:I.token,roomName:I.roomName,display:m.display,dimensions:m.dimensions,frameRate:I.frameRate})},onStop:I=>w?.handleStop(I),onRequestSessionState:I=>w?.handleRequestSessionState(I),getActiveSessionIds:()=>w?.getActiveSessions().map(I=>I.sessionId)??[],onDisconnected:I=>w?.handleConnectionLost(I),onReconnected:()=>w?.handleConnectionRestored(),onStateChange:I=>{I==="connected"&&k()},logger:t}),T=new LA({octoAgentId:c.octoAgentId,connection:b,computer:v,platformUrl:n,deviceSkillsDir:p.skillsDir,agentWorkspaceDir:a,environment:_,logger:t,onComputerReset:v});w=T,T.start(),b.connect(),await Promise.race([S,new Promise(I=>{setTimeout(I,2e4)})]),b.getState()!=="connected"&&t.warn("Operator relay not connected; the run still completes, but its live view may lag");let C={type:"dispatch",sessionId:c.sessionId,operatorToken:c.driverToken,trigger:c.trigger,deviceMcpConfigs:c.deviceMcpConfigs,deviceSkillConfigs:c.deviceSkillConfigs},N;try{N=await T.runLocalDispatch(C)}finally{g.stop(),await T.stop(),await b.closeGracefully(),m.cleanup()}return r?(process.stdout.write(`${JSON.stringify({threadId:c.threadId,sessionId:c.sessionId,status:N.status,threadUrl:l,...N.error?{error:N.error}:{}})}
154
+ `),N.status==="completed"?0:N.status==="cancelled"?4:1):N.status==="completed"?(process.stdout.write(`Run completed. View: ${l}
155
+ `),0):N.status==="cancelled"?(process.stdout.write(`Run stopped from the dashboard. View: ${l}
156
+ `),4):(process.stderr.write(`Error: Run ${N.status}${N.error?`: ${N.error}`:""}. View: ${l}
157
+ `),1)}var Sue=new Set(["json","force","verbose","record","record-public"]);function $ue(e){let t=[],r={};for(let o=0;o<e.length;o++){let n=e[o];if(n.startsWith("--")){let i=n.slice(2),s=i.indexOf("=");if(s>=0)r[i.slice(0,s)]=i.slice(s+1);else if(Sue.has(i))r[i]=!0;else{let a=e[o+1];a!==void 0&&!a.startsWith("--")?(r[i]=a,o+=1):r[i]=!0}}else t.push(n)}return{positionals:t,flags:r}}function it(e){return typeof e=="string"?e:void 0}function kue(e,t){let r=[];for(let o=0;o<e.length;o+=1){let n=e[o];if(n===`--${t}`){let i=e[o+1];i!==void 0&&!i.startsWith("--")&&(r.push(i),o+=1)}else n.startsWith(`--${t}=`)&&r.push(n.slice(t.length+3))}return r}var tF=`octoagent - run your cloud Octavus Agent on a machine you control
157
158
 
158
159
  Usage:
159
160
  octoagent run "<prompt>" Run a prompt on the configured agent, in the current directory
@@ -169,6 +170,9 @@ Usage:
169
170
  --capability memory=off). Unlisted inherits the agent default.
170
171
  --config <file> JSON run config { model, backupModel, capabilities } for
171
172
  scripted sweeps. Explicit flags win over the file.
173
+ --record Record this run's execution view (working process + computer)
174
+ to a video, stored privately (played after you sign in)
175
+ --record-public Record this run and store it at a permanent, shareable URL
172
176
  --json Print one JSON result { threadId, sessionId, status, threadUrl }
173
177
  to stdout (for benchmark harnesses); logs go to stderr
174
178
  --force Allow running with the workspace at $HOME or /
@@ -184,7 +188,7 @@ and browser profile under ~/.octavus/<env>/, so staging and production run indep
184
188
  Only production and local have built-in URLs; for any other environment, pass
185
189
  --platform-url once with auth (it's stored per environment).
186
190
 
187
- The agent must have its computer set to "Your own machine (CLI)" in the dashboard.`;async function Eue(){let[e,...t]=process.argv.slice(2),{positionals:r,flags:o}=$ue(t);switch(e){case"run":{let n=(r.join(" ").trim()||it(o.prompt))??"";return n?await eF({prompt:n,env:Jc(it(o.env)),workdir:it(o.workdir),apiKey:it(o["api-key"]),platformUrl:it(o["platform-url"]),operatorUrl:it(o["operator-url"]),chromePath:it(o["chrome-path"]),force:!!o.force,verbose:!!o.verbose,model:it(o.model),backupModel:it(o["backup-model"]),capabilities:kue(t,"capability"),configFile:it(o.config),json:!!o.json}):(process.stderr.write(`A prompt is required: octoagent run "<prompt>"
191
+ The agent must have its computer set to "Your own machine (CLI)" in the dashboard.`;async function Eue(){let[e,...t]=process.argv.slice(2),{positionals:r,flags:o}=$ue(t);switch(e){case"run":{let n=(r.join(" ").trim()||it(o.prompt))??"";return n?await eF({prompt:n,env:Jc(it(o.env)),workdir:it(o.workdir),apiKey:it(o["api-key"]),platformUrl:it(o["platform-url"]),operatorUrl:it(o["operator-url"]),chromePath:it(o["chrome-path"]),force:!!o.force,verbose:!!o.verbose,model:it(o.model),backupModel:it(o["backup-model"]),capabilities:kue(t,"capability"),configFile:it(o.config),record:!!o.record,recordPublic:!!o["record-public"],json:!!o.json}):(process.stderr.write(`A prompt is required: octoagent run "<prompt>"
188
192
  `),2)}case"auth":{let n=it(o["api-key"]);if(!n)return process.stderr.write(`Provide the key: octoagent auth --api-key <oct_agt_...>
189
193
  `),2;let i=Jc(it(o.env)),s=it(o["platform-url"]),a=it(o["operator-url"]);return FA(i,{apiKey:n,...s?{platformUrl:s}:{},...a?{operatorWsUrl:a}:{}}),process.stdout.write(`Saved ${i} credentials to ${zs(i)}/config.json
190
194
  `),0}case"config":{let n=Jc(it(o.env)),i=Ts(n),s=i.apiKey?`${i.apiKey.slice(0,12)}...`:"(none)",a=Gc(n)??"(unset - pass --platform-url with auth)",u=xp(n)??"(from platform per run)";return process.stdout.write(`env: ${n}