game-dev-cli-darwin-arm64 0.25.9 → 0.25.11
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/bin/ai-game-dev +2 -2
- package/package.json +3 -3
- package/runtime/app/daemon/coordinator.cjs +455 -0
- package/runtime/app/daemon/daemon-engine-worker.cjs +385 -0
- package/runtime/app/daemon/daemon-entry.cjs +1819 -0
- package/runtime/app/daemon/daemon-extension-host.cjs +64 -0
- package/runtime/app/daemon/daemon-git-action-worker.cjs +59 -0
- package/runtime/app/daemon/daemon-git-blob-worker.cjs +60 -0
- package/runtime/app/daemon/daemon-git-read-worker.cjs +59 -0
- package/runtime/app/daemon/daemon-git-status-worker.cjs +59 -0
- package/runtime/app/daemon/daemon-project-create-worker.cjs +669 -0
- package/runtime/app/daemon/daemon-replacement-worker.cjs +59 -0
- package/runtime/app/daemon/daemon-search-worker.cjs +59 -0
- package/runtime/app/daemon/daemon-token.cjs +1213 -0
- package/runtime/manifest.json +1 -0
- package/runtime/runtime.json +9 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
var __aigdRuntimeUrl=require("node:url").pathToFileURL(__filename).href;
|
|
2
|
+
var Bs=require("node:child_process"),Js=require("node:path");function xe(e){let t=Object.values(e).filter((n)=>typeof n==="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}function dt(e,t="|"){return e.map((r)=>gt(r)).join(t)}function ye(e,t){if(typeof t==="bigint")return t.toString();return t}class ur{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;if(e!==void 0)this._value=e(),this._getter=void 0;return this._value}}function Ie(e){return new ur(e)}function ar(e){return e===null||e===void 0}function Ee(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function lr(e,t){let r=e/t,n=Math.round(r),o=4*Number.EPSILON*Math.max(Math.abs(r),1);if(Math.abs(r-n)<o)return 0;return r-n}function B(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Ae(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function W(e){return Ae(e._zod.def)??e._zod.def.shape}function pr(e,t,r){Object.defineProperty(e,t,{get(){let n=r();return B(this,t,n),n},enumerable:!0,configurable:!0})}function fr(e,t,r){if(t in e)B(e,t,r);else e[t]=r}function ce(e,t,r,n){let o=W(t);for(let i of r){let s=Object.getOwnPropertyDescriptor(o,i);if(!s.enumerable)continue;if(s.get)pr(e,i,()=>{let c=t._zod.def.shape[i];return n?n(c,i):c});else fr(e,i,n?n(s.value,i):s.value)}}function Ks(e,t){for(let r of Reflect.ownKeys(t)){let n=Object.getOwnPropertyDescriptor(t,r);if(!n.enumerable)continue;if(n.get)pr(e,r,()=>t[r]);else fr(e,r,n.value)}}function T(...e){let t={};for(let r of e){let n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}function dr(e){return JSON.stringify(e)}function mr(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var mt="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function _e(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}var hr=Ie(()=>{if(N.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function fe(e){if(_e(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;if(typeof t!=="function")return!0;let r=t.prototype;if(_e(r)===!1)return!1;if(Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)return!1;return!0}function ht(e){if(fe(e))return{...e};if(Array.isArray(e))return[...e];if(e instanceof Map)return new Map(e);if(e instanceof Set)return new Set(e);return e}var gr=new Set(["string","number","symbol"]);function te(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function J(e,t,r){let n=new e._zod.constr(t??e._zod.def);if(!t||r?.parent)n._zod.parent=e;return n}function g(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 Error("Cannot specify both `message` and `error` params");t.error=t.message}if(delete t.message,typeof t.error==="string")return{...t,error:()=>t.error};return t}function gt(e){if(typeof e==="bigint")return e.toString()+"n";if(typeof e==="string")return`"${e}"`;return`${e}`}function _r(e){return Object.keys(e).filter((t)=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var Te=(()=>({safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]}))(),_t={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Vs(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let i={};return ce(i,e,Ne(e,t)),J(e,T(r,{shape:i,checks:[]}))}function Ne(e,t){let r=W(e),n=[];for(let o of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(r,o)?.enumerable)throw Error(`Unrecognized key: "${String(o)}"`);if(t[o])n.push(o)}return n}function Ws(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let i=new Set(Ne(e,t)),s={};return ce(s,e,Reflect.ownKeys(W(e)).filter((c)=>!i.has(c))),J(e,T(r,{shape:s,checks:[]}))}function Xs(e,t){if(!fe(t))throw Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let o=W(e);for(let i of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(o,i)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return J(e,T(e._zod.def,{shape:xr(e,t)}))}function xr(e,t){let r={};return ce(r,e,Reflect.ownKeys(W(e))),Ks(r,t),r}function Hs(e,t){if(!fe(t))throw Error("Invalid input to safeExtend: expected a plain object");return J(e,T(e._zod.def,{shape:xr(e,t)}))}function Ys(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r={};ce(r,e,Reflect.ownKeys(W(e))),ce(r,t,Reflect.ownKeys(W(t)));let n=T(e._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return J(e,n)}function yr(e,t,r,n="partial"){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${n}() cannot be used on object schemas containing refinements`);let c=r?new Set(Ne(t,r)):void 0,u={};return ce(u,t,Reflect.ownKeys(W(t)),e&&((a,l)=>c&&!c.has(l)?a:new e({type:"optional",innerType:a}))),J(t,T(t._zod.def,{shape:u,checks:[]}))}function qs(e,t,r){let n=r?new Set(Ne(t,r)):void 0,o={};return ce(o,t,Reflect.ownKeys(W(t)),(i,s)=>n&&!n.has(s)?i:new e({type:"nonoptional",innerType:i})),J(t,T(t._zod.def,{shape:o}))}function G(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 br(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 Ce(e,t){return t.map((r)=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function ge(e){return typeof e==="string"?e:e?.message}function xt(e){let t=[];for(let r of e??[]){let n=r._zod.def;if(!/_(length|size)$|_equals$/.test(n.check))break;let o=n.maximum??n.length??n.size;if(o>=0)t.push([o,r])}return t}function Re(e,t,r){var n;for(let o=t;o<e.length;o++)(n=e[o]).schema??(n.schema=r)}function re(e,t,r){var n;let o=e.inst?._zod?.traits;if(o?.has("$ZodType"))if(o.has("$ZodCheck"))(n=e).schema??(n.schema=e.inst);else e.schema=e.inst;let i=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,s=e.message?e.message:ge(e.inst?._zod.def?.error?.(e))??ge(i?.(e))??ge(t?.error?.(e))??ge(r.customError?.(e))??ge(r.localeError?.(e))??"Invalid input",c={};for(let u of Object.keys(e)){if(u==="inst"||u==="schema"||u==="continue"||u==="input"||u==="__proto__")continue;c[u]=e[u]}if(c.path??(c.path=[]),c.message=s,t?.reportInput)c.input=e.input;return c}var Qs=/[\uD800-\uDBFF]/;function De(e){let t=e.length;if(!Qs.test(e))return t;let r=t;for(let n=0;n<t-1;n++)if((e.charCodeAt(n)&64512)===55296&&(e.charCodeAt(n+1)&64512)===56320)r--,n++;return r}function je(e){if(Array.isArray(e))return"array";if(typeof e==="string")return"string";return"unknown"}function vr(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 ue(...e){let[t,r,n]=e;if(typeof t==="string")return{message:t,code:"custom",input:r,inst:n};return{...t}}function zr(e,t){for(let r in t){let n=Object.getOwnPropertyDescriptor(t,r);if(n.get)Object.defineProperty(e,r,{...n,enumerable:!1});else ec(e,r,n.value)}}function X(e,t,r,n=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:n,value:r}),r}function Le(e,t,r){return X(e,t,r,!1)}function $r(e,t){for(let r in e){let n=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,get(){return X(this,r,n(this))},set(o){X(this,r,o)}})}return t}function ec(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:X(this,t,r.bind(this))},set(n){X(this,t,n)}})}function tc(e,t){let r=Object.getPrototypeOf(e);return t in r?void 0:r}var ft,ee=!1,rc={configurable:!0,get(){ee=!0;return}};function y(e,t,r){let n=Object.getPrototypeOf(e._zod);if(t in n&&ft!==e._zod){ft=void 0;return}ft=e._zod,Object.defineProperty(n,t,{configurable:!0,get(){Object.defineProperty(this,t,rc);let o=ee;ee=!1;try{let i=r(this);if(ee)delete this[t];else Object.defineProperty(this,t,{configurable:!0,writable:!0,value:i});return ee=ee||o,i}catch(i){throw delete this[t],ee=ee||o,i}},set(o){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:o})}})}function nc(e,t,r,n){let o=tc(e,t);if(!o)return;Object.defineProperty(o,t,{configurable:!0,get(){let i={configurable:!0,writable:!0,enumerable:n,value:void 0};return Object.defineProperty(this,t,i),i.value=r(this),Object.defineProperty(this,t,i),i.value},set(i){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:n,value:i})}})}var oc="~constantCatch";function wr(e){let t=()=>e;return t[oc]=!0,t}var kr;var yt={value:void 0,enumerable:!1},Zr="captureStackTrace"in Error?Error:null;function ic(e){let t=Zr;if(t){let r=t.stackTraceLimit;if(typeof r==="number"){try{t.stackTraceLimit=0}catch{return Zr=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}function p(e,t,r,n){let o={};function i(d){this.def=d,this.constr=f,this.traits=new Set}i.prototype=o;let s=r,c=s&&new WeakSet;function u(d,m){if(!d._zod){yt.value=new i(m);try{Object.defineProperty(d,"_zod",yt)}finally{yt.value=void 0}}else if(d._zod.traits.has(e))return;if(d._zod.traits.add(e),t(d,m),c){let x=Object.getPrototypeOf(d),_=d._zod.constr.prototype,b=x;while(b&&b!==_)b=Object.getPrototypeOf(b);let E=b??x;if(!c.has(E))c.add(E),zr(E,s)}let h=f.prototype;for(let x in h){if(!Object.prototype.hasOwnProperty.call(h,x))continue;if(!(x in d))d[x]=h[x].bind(d)}}let a=n?.Parent??Object;class l extends a{}Object.defineProperty(l,"name",{value:e});function f(d){let m=n?.Parent?ic(l):this;u(m,d);let h=m._zod.deferred;if(h){for(let _ of h)_();m._zod.deferred=void 0}let x=globalThis.__zod_globalConfig?.postProcessor;if(x)x(m);return m}return Object.defineProperty(f,"init",{value:u}),Object.defineProperty(f,Symbol.hasInstance,{value:(d)=>{if(n?.Parent&&d instanceof n.Parent)return!0;return d?._zod?.traits?.has(e)}}),Object.defineProperty(f,"name",{value:e}),f}class K extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class be extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`);this.name="ZodEncodeError"}}(kr=globalThis).__zod_globalConfig??(kr.__zod_globalConfig={});var N=globalThis.__zod_globalConfig;function M(e){if(e)Object.assign(N,e);return N}function sc(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,ye,2)),e.message}function cc(e){this._zod.message=e}var uc={get:sc,set:cc,enumerable:!0,configurable:!0},vt={value:void 0,enumerable:!1},Pr=new WeakSet([Object.prototype,Error.prototype]),Sr=(e,t)=>{e.name="$ZodError",vt.value=t,Object.defineProperty(e,"issues",vt),vt.value=void 0,Object.defineProperty(e,"message",uc);let r=Object.getPrototypeOf(e);if(!Pr.has(r))Pr.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){let n=()=>this.message;return Object.defineProperty(this,"toString",{value:n,configurable:!0,writable:!0}),n},set(n){Object.defineProperty(this,"toString",{value:n,configurable:!0,writable:!0})}})},Or=p("$ZodError",Sr),oa=p("$ZodError",Sr,void 0,{Parent:Error});function ac(e,t,r){if(!Object.prototype.hasOwnProperty.call(e,t))if(t==="__proto__")Object.defineProperty(e,t,{value:r(),writable:!0,enumerable:!0,configurable:!0});else e[t]=r();return e[t]}function Ir(e,t=(r)=>r.message){let r={},n=[];for(let o of e.issues)if(o.path.length>0)ac(r,o.path[0],()=>[]).push(t(o));else n.push(t(o));return{formErrors:n,fieldErrors:r}}function Er(e,t=(r)=>r.message){let r={_errors:[]},n=(o,i=[])=>{for(let s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map((c)=>n({issues:c},[...i,...s.path]));else if(s.code==="invalid_key")n({issues:s.issues},[...i,...s.path]);else if(s.code==="invalid_element")n({issues:s.issues},[...i,...s.path]);else{let c=[...i,...s.path];if(c.length===0)r._errors.push(t(s));else{let u=r,a=0;while(a<c.length){let l=c[a],f=a===c.length-1;if(l==="_errors"){if(f)u._errors.push(t(s));a++;continue}if(!Object.prototype.hasOwnProperty.call(u,l))Object.defineProperty(u,l,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let d=u[l];if(f)d._errors.push(t(s));u=d,a++}}}};return n(e),r}function Me(e,t){return{callee:t?.callee??e,Err:t?.Err}}var Fe=(e)=>{let t=(r,n,o,i)=>{let s=o?{...o,async:!1}:{async:!1},c=r._zod.run({value:n,issues:[]},s);if(c instanceof Promise)throw new K;if(c.issues.length){let u=new(i?.Err??e)(c.issues.map((a)=>re(a,s,M())));throw mt(u,i?.callee??t),u}return c.value};return t};var Ue=(e)=>{let t=async(r,n,o,i)=>{let s=o?{...o,async:!0}:{async:!0},c=r._zod.run({value:n,issues:[]},s);if(c instanceof Promise)c=await c;if(c.issues.length){let u=new(i?.Err??e)(c.issues.map((a)=>re(a,s,M())));throw mt(u,i?.callee??t),u}return c.value};return t};var Be=(e)=>(t,r,n)=>{let o=n?{...n,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise)throw new K;return i.issues.length?Ar(e,i.issues,o):{success:!0,data:i.value}};function Ar(e,t,r){let n;return{success:!1,get error(){if(!n)n=new e(t.map((o)=>re(o,r,M()))),t=void 0,r=void 0;return n},set error(o){n=o,t=void 0,r=void 0}}}var Je=(e)=>async(t,r,n)=>{let o=n?{...n,async:!0}:{async:!0},i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise)i=await i;return i.issues.length?Ar(e,i.issues,o):{success:!0,data:i.value}};var lc=Symbol.for("zod.compile.invalid"),pc=Symbol.for("zod.compile.fallback"),zt=(e,t,r)=>{let n=e._zod.bag.validator;if(n!==void 0){if(n(t)!==lc)return!0;if(n.definite===!0&&r===void 0)return!1}return fc(e,t,r)};function fc(e,t,r){let n=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},o=e._zod.bag.fallbackRun,i;if(o)n[pc]=!0,i=o({value:t,issues:[]},n);else i=e._zod.run({value:t,issues:[]},n);if(i instanceof Promise)throw new K;return i.issues.length===0}var $t=async(e,t,r)=>{let n=r?{...r,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},o=e._zod.run({value:t,issues:[]},n);if(o instanceof Promise)o=await o;return o.issues.length===0},Tr=(e)=>{let t=Fe(e),r=(n,o,i,s)=>{let c=i?{...i,direction:"backward"}:{direction:"backward"};return t(n,o,c,Me(r,s))};return r};var Nr=(e)=>{let t=Fe(e),r=(n,o,i,s)=>t(n,o,i,Me(r,s));return r};var Cr=(e)=>{let t=Ue(e),r=async(n,o,i,s)=>{let c=i?{...i,direction:"backward"}:{direction:"backward"};return await t(n,o,c,Me(r,s))};return r};var Rr=(e)=>{let t=Ue(e),r=async(n,o,i,s)=>await t(n,o,i,Me(r,s));return r};var Dr=(e)=>(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return Be(e)(t,r,o)};var jr=(e)=>(t,r,n)=>Be(e)(t,r,n);var Lr=(e)=>async(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return Je(e)(t,r,o)};var Mr=(e)=>async(t,r,n)=>Je(e)(t,r,n);var Fr=/^[cC][0-9a-z]{6,}$/,Ur=/^[0-9a-z]+$/,Br=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Jr=/^[0-9a-vA-V]{20}$/,Gr=/^[A-Za-z0-9]{27}$/,Kr=/^[a-zA-Z0-9_-]{21}$/;function Vr(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var Wr=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var Xr=/^([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})$/,kt=(e)=>{if(!e)return/^([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)$/;return 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})$`)};var Hr=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var dc="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function Yr(){return new RegExp(dc,"u")}var qr=/^(?:(?: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])$/,Qr=/^(([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 en=/^((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])$/,tn=/^(([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}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,rn=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,nn=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/;var on=/^https?$/,sn=/^\+[1-9]\d{6,14}$/;var cn="(?:(?:\\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])))";function mc(e){return new RegExp(`^${e}$`)}var un=mc(cn);function wt(e){return typeof e.precision==="number"?e.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":e.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?":"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function an(e){return new RegExp(`^${wt(e)}$`)}function ln(e){let t=["Z"];if(e.offset)t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${wt({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,n=e.local?`${r}|${wt({precision:e.precision})}`:r;return new RegExp(`^${cn}T(?:${n})$`)}var pn=/^[\s\S]{0,}$/;var Zt=/^-?\d+(?:\.\d+)?$/,fn=/^(?:true|false)$/i;var dn=/^[^A-Z]*$/,mn=/^[^a-z]*$/;var O=p("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var Pt=(e)=>{let t=e.value;return!ar(t)&&t.length!==void 0},Ge={number:"number",bigint:"bigint",object:"date"},St=p("$ZodCheckLessThan",(e,t)=>{O.init(e,t);let r=Ge[typeof t.value];e._zod.check=(n)=>{if(t.inclusive?n.value<=t.value:n.value<t.value)return;n.issues.push({origin:Ge[typeof n.value]??r,code:"too_big",maximum:typeof t.value==="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ot=p("$ZodCheckGreaterThan",(e,t)=>{O.init(e,t);let r=Ge[typeof t.value];e._zod.check=(n)=>{if(t.inclusive?n.value>=t.value:n.value>t.value)return;n.issues.push({origin:Ge[typeof n.value]??r,code:"too_small",minimum:typeof t.value==="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),hn=p("$ZodCheckMultipleOf",(e,t)=>{O.init(e,t),e._zod.check=(r)=>{if(typeof r.value!==typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof r.value==="bigint"?t.value!==BigInt(0)&&r.value%t.value===BigInt(0):lr(r.value,t.value)===0)return;r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),gn=p("$ZodCheckNumberFormat",(e,t)=>{O.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[o,i]=Te[t.format];e._zod.check=(s)=>{let c=s.value;if(r){if(!Number.isInteger(c)){s.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){if(c>0)s.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});else s.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}if(c<o)s.issues.push({origin:"number",input:c,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort});if(c>i)s.issues.push({origin:"number",input:c,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}});var _n=p("$ZodCheckMaxLength",(e,t)=>{var r;O.init(e,t),(r=e._zod.def).when??(r.when=Pt),e._zod.check=(n)=>{let o=n.value,i=o.length;if((typeof o==="string"&&i>t.maximum?De(o):i)<=t.maximum)return;let c=je(o);n.issues.push({origin:c,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),xn=p("$ZodCheckMinLength",(e,t)=>{var r;O.init(e,t),(r=e._zod.def).when??(r.when=Pt),e._zod.check=(n)=>{let o=n.value,i=o.length;if((typeof o==="string"&&i>=t.minimum&&i<t.minimum*2?De(o):i)>=t.minimum)return;let c=je(o);n.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),yn=p("$ZodCheckLengthEquals",(e,t)=>{var r;O.init(e,t),(r=e._zod.def).when??(r.when=Pt),e._zod.check=(n)=>{let o=n.value,i=o.length,s=typeof o==="string"&&i>=t.length&&i<=t.length*2?De(o):i;if(s===t.length)return;let c=je(o),u=s>t.length;n.issues.push({origin:c,...u?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),ze=p("$ZodCheckStringFormat",(e,t)=>{var r,n;if(O.init(e,t),t.pattern)(r=e._zod).check??(r.check=(o)=>{if(t.pattern.lastIndex=0,t.pattern.test(o.value))return;o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})});else(n=e._zod).check??(n.check=()=>{})}),bn=p("$ZodCheckRegex",(e,t)=>{ze.init(e,t),e._zod.check=(r)=>{if(t.pattern.lastIndex=0,t.pattern.test(r.value))return;r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),vn=p("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=dn),ze.init(e,t)}),zn=p("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=mn),ze.init(e,t)}),$n=p("$ZodCheckIncludes",(e,t)=>{O.init(e,t);let r=te(t.includes),n=new RegExp(typeof t.position==="number"?`^.{${t.position},}${r}`:r);t.pattern=n,e._zod.check=(o)=>{if(o.value.includes(t.includes,t.position))return;o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),wn=p("$ZodCheckStartsWith",(e,t)=>{O.init(e,t);let r=new RegExp(`^${te(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.check=(n)=>{if(n.value.startsWith(t.prefix))return;n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),kn=p("$ZodCheckEndsWith",(e,t)=>{O.init(e,t);let r=new RegExp(`.*${te(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.check=(n)=>{if(n.value.endsWith(t.suffix))return;n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});var Zn=p("$ZodCheckOverwrite",(e,t)=>{O.init(e,t),e._zod.check=(r)=>{r.value=t.tx(r.value)}});class It{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{this.indent-=1}}write(e){if(typeof e==="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let r=e.split(`
|
|
3
|
+
`).filter((i)=>i),n=Math.min(...r.map((i)=>i.length-i.trimStart().length)),o=r.map((i)=>i.slice(n)).map((i)=>" ".repeat(this.indent*2)+i);for(let i of o)this.content.push(i)}compile(){let e=Function,t=this?.content??[""];return new e(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
|
|
4
|
+
${t.join(`
|
|
5
|
+
`)}
|
|
6
|
+
};`)(...Object.values(this.closed))}}var Sn={major:4,minor:6,patch:7};var k=p("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Sn;let n=e._zod.def.checks,o=e._zod.traits.has("$ZodCheck")?[e,...n??[]]:n?.length?[...n]:[];for(let i of o)for(let s of i._zod.onattach)s(e);if(o.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=(c,u,a)=>{if(c.memo)return c;let l=G(c),f;for(let d of u){if(d._zod.def.when){if(br(c))continue;if(!d._zod.def.when(c))continue}else if(l)continue;let m=c.issues.length,h=d._zod.check(c);if(h instanceof Promise&&a?.async===!1)throw new K;if(f||h instanceof Promise)f=(f??Promise.resolve()).then(async()=>{if(await h,c.issues.length===m)return;if(Re(c.issues,m,e),!l)l=G(c,m)});else{if(c.issues.length===m)continue;if(Re(c.issues,m,e),!l)l=G(c,m)}}if(f)return f.then(()=>c);return c},s=(c,u,a)=>{if(G(c))return c.aborted=!0,c;let l=i(u,o,a);if(l instanceof Promise){if(a.async===!1)throw new K;return l.then((f)=>e._zod.parse(f,a))}return e._zod.parse(l,a)};e._zod.run=(c,u)=>{if(u.skipChecks)return e._zod.parse(c,u);if(u.direction==="backward"){let l=e._zod.parse({value:c.value,issues:[]},{...u,skipChecks:!0});if(l instanceof Promise)return l.then((f)=>s(f,c,u));return s(l,c,u)}let a=e._zod.parse(c,u);if(a instanceof Promise){if(u.async===!1)throw new K;return a.then((l)=>i(l,o,u))}return i(a,o,u)}}},{get "~standard"(){return Le(this,"~standard",At(this))},set "~standard"(e){X(this,"~standard",e)}}),Ln=(e,t)=>e.issues.length?{issues:e.issues.map((r)=>re(r,t,M()))}:{value:e.value};async function gc(e,t){let r={async:!0};return Ln(await e._zod.run({value:t,issues:[]},r),r)}function At(e){return{validate:(t)=>{let r={async:!1};try{let n=e._zod.run({value:t,issues:[]},r);if(!(n instanceof Promise))return Ln(n,r)}catch(n){}return gc(e,t)},vendor:"zod",version:1}}var Xe=p("$ZodString",(e,t)=>{k.init(e,t),e._zod.pattern=t.pattern??pn,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch(o){}if(typeof r.value==="string")return r;return r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),w=p("$ZodStringFormat",(e,t)=>{ze.init(e,t),Xe.init(e,t)}),Mn=p("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Xr),w.init(e,t)}),Fn=p("$ZodUUID",(e,t)=>{if(t.version){let n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(n===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=kt(n))}else t.pattern??(t.pattern=kt());w.init(e,t)}),Un=p("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Hr),w.init(e,t)}),Bn=1,Ve=2;function Jn(e){try{if(typeof URL<"u"&&typeof URL.canParse==="function")return URL.canParse(e);return new URL(e),!0}catch{return!1}}function _c(e,t){if(!("normalize"in t)&&!("hostname"in t)&&!("protocol"in t))return Jn(e)||Ve;return xc(e,t)}function xc(e,t){if(!t.normalize&&t.protocol?.source===on.source&&!/^https?:\/\//i.test(e))return Bn;try{if(typeof URL<"u"){let r=URL;if(typeof r.parse==="function")return r.parse(e)??Ve}return new URL(e)}catch{return Ve}}var yc=/[\t\n\r]/g;function On(e){return e.replace(yc,"")}function bc(e,t){return t.lastIndex=0,t.test(e.hostname)}function vc(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}var Gn=p("$ZodURL",(e,t)=>{w.init(e,t),e._zod.check=(r)=>{try{let n=r.value.trim(),o=_c(n,t);if(o===Bn){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}if(o===Ve){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort});return}if(o===!0){r.value=On(n);return}if(t.hostname&&!bc(o,t.hostname))r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort});if(t.protocol&&!vc(o,t.protocol))r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort});r.value=t.normalize?o.href:On(n);return}catch(n){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),Kn=p("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Yr()),w.init(e,t)}),Vn=p("$ZodNanoID",(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=t.length===void 0?Kr:Vr(t.length)),w.init(e,t)}),Wn=p("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Fr),w.init(e,t)}),Xn=p("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Ur),w.init(e,t)}),Hn=p("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Br),w.init(e,t)}),Yn=p("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Jr),w.init(e,t)}),qn=p("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Gr),w.init(e,t)}),Qn=p("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=ln(t)),w.init(e,t)}),eo=p("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=un),w.init(e,t)}),to=p("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=an(t)),w.init(e,t)}),ro=p("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Wr),w.init(e,t)}),no=p("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=qr),w.init(e,t)}),zc=/^[0-9a-fA-F:.]+$/;function oo(e){if(!zc.test(e))return!1;return Jn(`http://[${e}]`)}var io=p("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Qr),w.init(e,t),e._zod.check=(r)=>{if(!oo(r.value))r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}});var so=p("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=en),w.init(e,t)});function $c(e){let t=e.split("/");if(t.length!==2)return!1;let[r,n]=t;if(!n)return!1;let o=Number(n);if(`${o}`!==n)return!1;if(o<0||o>128)return!1;return oo(r)}var co=p("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=tn),w.init(e,t),e._zod.check=(r)=>{if(!$c(r.value))r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}});function uo(e){if(e==="")return!0;if(/\s/.test(e))return!1;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var Tt=/^[0-9a-zA-Z+/]*={0,2}$/,ao=p("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Tt),w.init(e,t),e._zod.check=(r)=>{if(uo(r.value))return;r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}}),He=/^[A-Za-z0-9_-]*$/;function wc(e){if(!He.test(e))return!1;let t=e.replace(/[-_]/g,(n)=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return uo(r)}var lo=p("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=He),w.init(e,t),e._zod.check=(r)=>{if(wc(r.value))return;r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),po=p("$ZodE164",(e,t)=>{t.pattern??(t.pattern=sn),w.init(e,t)});function kc(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[n]=r;if(!n)return!1;let o=JSON.parse(atob(n));if("typ"in o&&o?.typ!=="JWT")return!1;if(!o.alg)return!1;if(t&&(!("alg"in o)||o.alg!==t))return!1;return!0}catch{return!1}}var fo=p("$ZodJWT",(e,t)=>{w.init(e,t),e._zod.check=(r)=>{if(kc(r.value,t.alg))return;r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}});var Nt=p("$ZodNumber",(e,t)=>{k.init(e,t),e._zod.pattern=Zt,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch(s){}let o=r.value;if(typeof o==="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let i=typeof o==="number"?Number.isNaN(o)?"NaN":!Number.isFinite(o)?String(o):void 0:void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...i?{received:i}:{}}),r}}),mo=p("$ZodNumberFormat",(e,t)=>{gn.init(e,t),Nt.init(e,t)}),ho=p("$ZodBoolean",(e,t)=>{k.init(e,t),e._zod.pattern=fn,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Boolean(r.value)}catch(i){}let o=r.value;if(typeof o==="boolean")return r;return r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),r}});var go=p("$ZodUnknown",(e,t)=>{k.init(e,t),e._zod.parse=(r)=>r}),_o=p("$ZodNever",(e,t)=>{k.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function Zc(e,t){let r=xt(e._zod.def.checks);if(!r.length)return;let n=Math.min(...r.map((i)=>i[0])),o=e._zod.parse;e._zod.parse=(i,s)=>{let c=t(i.value);if(c>n&&!s?.skipChecks&&s?.direction!=="backward"){for(let[u,a]of xt(e._zod.def.checks))if(c>u&&a._zod.def.when(i)){let l=i.issues.length;return a._zod.check(i),i.issues[l].continue=!1,Re(i.issues,l,e),i}}return o(i,s)}}var Pc=(e)=>Array.isArray(e)?e.length:-1;function In(e,t,r){if(e.issues.length)t.issues.push(...Ce(r,e.issues));t.value[r]=e.value}var xo=p("$ZodArray",(e,t)=>{k.init(e,t);let r=N.memoizer;r?.attach(e),e._zod.parse=(n,o)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=r?r.alloc(e,n,Array(i.length),o):Array(i.length);let s=[],c=o?.abortEarly;for(let u=0;u<i.length;u++){let a=i[u],l=t.element._zod.run({value:a,issues:[]},o);if(l instanceof Promise)s.push(l.then((f)=>In(f,n,u)));else if(In(l,n,u),c&&l.issues.length!==0&&G(l))break}if(s.length)return Promise.all(s).then(()=>n);return n},Zc(e,Pc)});function We(e,t,r,n,o,i){let s=r in n,c=i==="optional";if(!s&&c&&o==="optional")return;if(e.issues.length){if(o!==void 0&&c&&!s)return;t.issues.push(...Ce(r,e.issues))}if(!s&&o===void 0){if(!e.issues.length)t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}if(e.value===void 0){if(s||o==="defaulted"&&!c)t.value[r]=void 0}else t.value[r]=e.value}var Sc=[];function yo(e){let t=Object.keys(e.shape),r=Object.getOwnPropertySymbols(e.shape),n=r.length?r:Sc,o=n.length?[...t,...n]:t;for(let s of o)if(!e.shape?.[s]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${String(s)}": expected a Zod schema`);let i=_r(e.shape);return{...e,allKeys:o,symbolKeys:n,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(i)}}function bo(e,t,r,n,o,i,s){let c=[],u=o.keySet,a=o.catchall._zod,l=a.def.type,{optin:f,optout:d}=a,m=0;for(let h in t){if(s&&r.issues.length!==m){if(G(r,m))break;m=r.issues.length}if(u.has(h))continue;if(h==="__proto__"){if(l==="never")c.push(h);continue}if(l==="never"){c.push(h);continue}let x=a.run({value:t[h],issues:[]},n);if(x instanceof Promise)e.push(x.then((_)=>We(_,r,h,t,f,d)));else We(x,r,h,t,f,d)}if(c.length)r.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:i,continue:!0});if(!e.length)return r;return Promise.all(e).then(()=>r)}var Oc=p("$ZodObject",(e,t)=>{k.init(e,t);let r=Object.getOwnPropertyDescriptor(t,"shape"),n=r?.get?r.get.raw:t.shape??{};if(n){let a=()=>{let l={...n};return Object.defineProperty(t,"shape",{value:l}),a.raw=l,l};a.raw=n,Object.defineProperty(t,"shape",{get:a})}let o=Ie(()=>yo(t));y(e,"propValues",(a)=>{let l=a.def.shape,f={};for(let d in l){let m=l[d]._zod;if(m.values){if(!Object.prototype.hasOwnProperty.call(f,d))B(f,d,new Set);for(let h of m.values)f[d].add(h);if(m.optin!==void 0)f[d].add(void 0)}}return f});let i=_e,s=t.catchall,c,u=N.memoizer;u?.attach(e),e._zod.parse=(a,l)=>{c??(c=o.value);let f=a.value;if(!i(f))return a.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),a;a.value=u?u.alloc(e,a,{},l):{};let d=[],m=c.shape,h=l?.abortEarly,x=a.issues.length;for(let _ of c.allKeys){if(h&&a.issues.length!==x){if(G(a,x))break;x=a.issues.length}if(_==="__proto__")continue;let b=m[_],E=b._zod.optin,q=b._zod.optout,Q=b._zod.run({value:f[_],issues:[]},l);if(Q instanceof Promise)d.push(Q.then((z)=>We(z,a,_,f,E,q)));else We(Q,a,_,f,E,q)}if(!s)return d.length?Promise.all(d).then(()=>a):a;return bo(d,f,a,l,o.value,e,h===!0)}}),vo=p("$ZodObjectJIT",(e,t)=>{Oc.init(e,t);let r=e._zod.parse,n=Ie(()=>yo(t)),o=N.memoizer,i=(m)=>{let h=n.value,x=h.symbolKeys,_=new It(["payload","ctx"],{shape:m,inst:e,memo:o,syms:x}),b=(z)=>`shape[${z}]._zod.run({ value: input[${z}], issues: [] }, ctx)`,E=(z,v)=>`
|
|
7
|
+
let ${z}_ab = false;
|
|
8
|
+
for (let i = 0; i < ${z}.issues.length; i++) {
|
|
9
|
+
const iss = ${z}.issues[i];
|
|
10
|
+
iss.path = iss.path ? [${v}, ...iss.path] : [${v}];
|
|
11
|
+
payload.issues.push(iss);
|
|
12
|
+
if (iss.continue !== true) ${z}_ab = true;
|
|
13
|
+
}
|
|
14
|
+
if (${z}_ab && ctx && ctx.abortEarly) {
|
|
15
|
+
payload.value = newResult;
|
|
16
|
+
return payload;
|
|
17
|
+
}`;_.write("const input = payload.value;");let q=Object.create(null),Q=0;for(let z of h.allKeys)q[z]=`key_${Q++}`;_.write(o?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(let z of h.allKeys){if(z==="__proto__")continue;let v=q[z],A=typeof z==="symbol"?`syms[${x.indexOf(z)}]`:dr(z),pe=`${A} in input`,j=m[z],U=j?._zod?.optin,se=U!==void 0,Oe=j?._zod?.optout==="optional";if(_.write(`const ${v} = ${b(A)};`),se&&Oe){let pt=U==="optional"?`${v}_present`:`${v}.value !== undefined || ${v}_present`;_.write(`
|
|
18
|
+
const ${v}_present = ${pe};
|
|
19
|
+
if (!${v}.issues.length || ${v}_present) {
|
|
20
|
+
if (${v}.issues.length) {${E(v,A)}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if (${pt}) {
|
|
24
|
+
newResult[${A}] = ${v}.value;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
`)}else if(!se)_.write(`
|
|
29
|
+
const ${v}_present = ${pe};
|
|
30
|
+
if (${v}.issues.length) {${E(v,A)}
|
|
31
|
+
}
|
|
32
|
+
if (!${v}_present && !${v}.issues.length) {
|
|
33
|
+
payload.issues.push({
|
|
34
|
+
code: "invalid_type",
|
|
35
|
+
expected: "nonoptional",
|
|
36
|
+
input: undefined,
|
|
37
|
+
path: [${A}]
|
|
38
|
+
});
|
|
39
|
+
if (ctx && ctx.abortEarly) {
|
|
40
|
+
payload.value = newResult;
|
|
41
|
+
return payload;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (${v}_present) {
|
|
46
|
+
newResult[${A}] = ${v}.value;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
`);else if(_.write(`
|
|
50
|
+
if (${v}.issues.length) {${E(v,A)}
|
|
51
|
+
}
|
|
52
|
+
`),U==="defaulted")_.write(`newResult[${A}] = ${v}.value;`);else _.write(`
|
|
53
|
+
if (${v}.value !== undefined || ${pe}) {
|
|
54
|
+
newResult[${A}] = ${v}.value;
|
|
55
|
+
}
|
|
56
|
+
`)}return _.write("payload.value = newResult;"),_.write("return payload;"),_.compile()},s,c=_e,u=!N.jitless,l=u&&hr.value,f=t.catchall,d;e._zod.parse=(m,h)=>{d??(d=n.value);let x=m.value;if(!c(x))return m.issues.push({expected:"object",code:"invalid_type",input:x,inst:e}),m;if(u&&l&&h?.async===!1&&h.jitless!==!0){if(!s)s=i(t.shape);if(m=s(m,h),!f)return m;return bo([],x,m,h,d,e,h?.abortEarly===!0)}return r(m,h)}});function En(e,t,r,n){for(let i of e)if(i.issues.length===0)return t.value=i.value,t;let o=e.filter((i)=>!G(i));if(o.length===1)return t.value=o[0].value,o[0];return t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map((i)=>i.issues.map((s)=>re(s,n,M())))}),t}var zo=p("$ZodUnion",(e,t)=>{k.init(e,t),y(e,"optin",(n)=>n.def.options.some((o)=>o._zod.optin==="defaulted")?"defaulted":n.def.options.some((o)=>o._zod.optin!==void 0)?"optional":void 0),y(e,"optout",(n)=>n.def.options.some((o)=>o._zod.optout==="optional")?"optional":void 0),y(e,"values",(n)=>{if(n.def.options.every((o)=>o._zod.values))return new Set(n.def.options.flatMap((o)=>Array.from(o._zod.values)));return}),y(e,"pattern",(n)=>{if(n.def.options.every((o)=>o._zod.pattern)){let o=n.def.options.map((i)=>i._zod.pattern);return new RegExp(`^(${o.map((i)=>Ee(i.source)).join("|")})$`)}return});let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(n,o)=>{if(r)return r(n,o);let i=!1,s=[];for(let c of t.options){let u=c._zod.run({value:n.value,issues:[]},o);if(u instanceof Promise)s.push(u),i=!0;else{if(u.issues.length===0)return u;s.push(u)}}if(!i)return En(s,n,e,o);return Promise.all(s).then((c)=>En(c,n,e,o))}});var $o=p("$ZodIntersection",(e,t)=>{k.init(e,t),e._zod.parse=(r,n)=>{let o=r.value,i=t.left._zod.run({value:o,issues:[]},n),s=t.right._zod.run({value:o,issues:[]},n);if(i instanceof Promise||s instanceof Promise)return Promise.all([i,s]).then(([u,a])=>An(r,u,a));return An(r,i,s)}});function Et(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(fe(e)&&fe(t)){let r=Object.keys(t),n=Object.keys(e).filter((i)=>r.indexOf(i)!==-1),o={...e,...t};if(Object.prototype.hasOwnProperty.call(o,"__proto__"))delete o.__proto__;for(let i of n){if(i==="__proto__")continue;let s=Et(e[i],t[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};o[i]=s.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let n=0;n<e.length;n++){let o=e[n],i=t[n],s=Et(o,i);if(!s.valid)return{valid:!1,mergeErrorPath:[n,...s.mergeErrorPath]};r.push(s.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function An(e,t,r){let n=new Map,o,i=new Map,s=(a,l)=>{let f;if(a.code==="unrecognized_keys"&&!a.path?.length)o??(o=a),f=a.keys;else if(a.code==="invalid_key"&&a.origin==="record"&&a.path?.length===1){let d=String(a.path[0]);if(!i.has(d))i.set(d,a);f=[d]}else return!1;for(let d of f){if(!n.has(d))n.set(d,{});n.get(d)[l]=!0}return!0};for(let a of t.issues)if(!s(a,"l"))e.issues.push(a);for(let a of r.issues)if(!s(a,"r"))e.issues.push(a);let c=[...n].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(c.length){let a=o?c.filter((l)=>o.keys.includes(l)):[];if(a.length)e.issues.push({...o,keys:a});for(let l of c)if(!a.includes(l)&&i.has(l))e.issues.push(i.get(l))}let u=Et(t.value,r.value);if(!u.valid){if(G(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(u.mergeErrorPath)}`)}return e.value=u.data,e}var wo=p("$ZodEnum",(e,t)=>{k.init(e,t);let r=xe(t.entries),n=new Set(r);e._zod.values=n,y(e,"pattern",(o)=>{let i=xe(o.def.entries).filter((s)=>gr.has(typeof s));return new RegExp(i.length?`^(${i.map((s)=>te(s.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(o,i)=>{let s=o.value;if(n.has(s))return o;return o.issues.push({code:"invalid_value",values:r,input:s,inst:e}),o}}),ko=p("$ZodLiteral",(e,t)=>{k.init(e,t);let r=new Set(t.values);e._zod.values=r,y(e,"pattern",(n)=>{let o=n.def.values;return new RegExp(o.length?`^(${o.map((i)=>typeof i==="string"?te(i):i?te(i.toString()):String(i)).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(n,o)=>{let i=n.value;if(r.has(i))return n;return n.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),n}});var Zo=p("$ZodTransform",(e,t)=>{k.init(e,t),e._zod.optin="optional",N.memoizer?.guard(e),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new be(e.constructor.name);let o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then((s)=>(r.value=s,r));if(o instanceof Promise)throw new K;return r.value=o,r}});function Tn(e,t){return e.value=t.issues.length?void 0:t.value,e}var Ct=p("$ZodOptional",(e,t)=>{k.init(e,t),y(e,"optin",(r)=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",y(e,"values",(r)=>{let n=r.def.innerType._zod.values;return n?new Set([...n,void 0]):void 0}),y(e,"pattern",(r)=>{let n=r.def.innerType._zod.pattern;return n?new RegExp(`^(${Ee(n.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(r.value===void 0){if(t.innerType._zod.optin!=="defaulted")return r;let o=t.innerType._zod.run({value:r.value,issues:[]},n);if(o instanceof Promise)return o.then((i)=>Tn(r,i));return Tn(r,o)}return t.innerType._zod.run(r,n)}}),Po=p("$ZodExactOptional",(e,t)=>{Ct.init(e,t),y(e,"values",(r)=>r.def.innerType._zod.values),y(e,"pattern",(r)=>r.def.innerType._zod.pattern),e._zod.parse=(r,n)=>t.innerType._zod.run(r,n)}),So=p("$ZodNullable",(e,t)=>{k.init(e,t),y(e,"optin",(r)=>r.def.innerType._zod.optin),y(e,"optout",(r)=>r.def.innerType._zod.optout),y(e,"pattern",(r)=>{let n=r.def.innerType._zod.pattern;return n?new RegExp(`^(${Ee(n.source)}|null)$`):void 0}),y(e,"values",(r)=>r.def.innerType._zod.values?new Set([...r.def.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>{if(r.value===null)return r;return t.innerType._zod.run(r,n)}}),Oo=p("$ZodDefault",(e,t)=>{k.init(e,t),e._zod.optin="defaulted",y(e,"values",(r)=>r.def.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)return r.value=t.defaultValue,r;let o=t.innerType._zod.run(r,n);if(o instanceof Promise)return o.then((i)=>Nn(i,t));return Nn(o,t)}});function Nn(e,t){if(e.value===void 0)e.value=t.defaultValue;return e}var Io=p("$ZodPrefault",(e,t)=>{k.init(e,t),e._zod.optin="defaulted",y(e,"values",(r)=>r.def.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)r.value=t.defaultValue;return t.innerType._zod.run(r,n)}}),Eo=p("$ZodNonOptional",(e,t)=>{k.init(e,t),y(e,"values",(r)=>{let n=r.def.innerType._zod.values;return n?new Set([...n].filter((o)=>o!==void 0)):void 0}),e._zod.parse=(r,n)=>{let o=t.innerType._zod.run(r,n);if(o instanceof Promise)return o.then((i)=>Cn(i,e));return Cn(o,e)}});function Cn(e,t){if(!e.issues.length&&e.value===void 0)e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t});return e}function Rn(e,t,r,n){if(!t.issues.length){if(e.value=t.value,t.memo)e.memo=!0;return e}return e.value=r.catchValue({...t,value:e.value,error:{issues:t.issues.map((o)=>re(o,n,M()))},input:e.value}),e}var Ao=p("$ZodCatch",(e,t)=>{k.init(e,t),y(e,"optin",(r)=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),y(e,"optout",(r)=>r.def.innerType._zod.optout),y(e,"values",(r)=>r.def.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);let o=t.innerType._zod.run({value:r.value,issues:[]},n);if(o instanceof Promise)return o.then((i)=>Rn(r,i,t,n));return Rn(r,o,t,n)}});var To=p("$ZodPipe",(e,t)=>{k.init(e,t),y(e,"values",(r)=>r.def.in._zod.values),y(e,"optin",(r)=>r.def.in._zod.optin),y(e,"optout",(r)=>r.def.out._zod.optout),y(e,"propValues",(r)=>r.def.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let i=t.out._zod.run(r,n);if(i instanceof Promise)return i.then((s)=>Ke(s,t.in,n));return Ke(i,t.in,n)}let o=t.in._zod.run(r,n);if(o instanceof Promise)return o.then((i)=>Ke(i,t.out,n));return Ke(o,t.out,n)}});function Ke(e,t,r){if(e.issues.some((n)=>n.code!=="unrecognized_keys"))return e.aborted=!0,e;return t._zod.run({value:e.value,issues:e.issues},r)}var No=p("$ZodReadonly",(e,t)=>{k.init(e,t),y(e,"propValues",(r)=>r.def.innerType._zod.propValues),y(e,"values",(r)=>r.def.innerType._zod.values),y(e,"optin",(r)=>r.def.innerType?._zod?.optin),y(e,"optout",(r)=>r.def.innerType?._zod?.optout),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);let o=t.innerType._zod.run(r,n);if(o instanceof Promise)return o.then(Dn);return Dn(o)}});function Dn(e){if(!e.memo)e.value=Object.freeze(e.value);return e}var Co=p("$ZodCustom",(e,t)=>{O.init(e,t),k.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=(r)=>{let n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then((i)=>jn(i,r,n,e));jn(o,r,n,e);return}});function jn(e,t,r,n){if(!e){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};if(n._zod.def.params)o.params=n._zod.def.params;t.issues.push(ue(o))}}class Do extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform");this.name="ZodCyclicError"}}var Dt="~memo",Ro=[];function jo(e){return e!==null&&typeof e==="object"}function Rt(e){return e.map((t)=>t.path?{...t,path:t.path.slice()}:{...t})}var Lo=new WeakMap,$e=0,Qe=1,we=2;function et(e,t,r){let n=Lo.get(e);if(n!==void 0)return n?we:$e;if(t.has(e))return we;t.add(e);let o=$e,i=(l)=>{if(o!==we&&l?._zod){let f=et(l,t,r);if(f>o)o=f}},s=(l,f)=>{let d=$e;for(let m of Reflect.ownKeys(l)){let h=Object.getOwnPropertyDescriptor(l,m);if(f&&!h.enumerable)continue;let x=h.get?Qe:h.value?._zod?et(h.value,t,r):$e;if(x>d)d=x}return d},c=(l)=>{if(l>o)o=l},u=e._zod.def,a=u.type;switch(a){case"object":{let l=Ae(u);c(l?s(l,!0):Qe),i(u.catchall);break}case"array":i(u.element);break;case"tuple":for(let l of u.items)i(l);i(u.rest);break;case"record":case"map":i(u.keyType),i(u.valueType);break;case"set":i(u.valueType);break;case"union":for(let l of u.options)i(l);break;case"intersection":i(u.left),i(u.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":i(u.innerType);break;case"pipe":i(u.in),i(u.out);break;case"function":i(u.input),i(u.output);break;case"lazy":{let l=u._cachedInner??(r?e._zod.innerType:void 0);c(l?et(l,t,!1):Qe);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(let l in u){let f=Object.getOwnPropertyDescriptor(u,l);if(!f||f.get)continue;let d=f.value;if(!d||typeof d!=="object")continue;if(d._zod)i(d);else if(Array.isArray(d))for(let m of d)i(m)}}return t.delete(e),Ic(e,o)}function Ic(e,t){if(t!==Qe)Lo.set(e,t===we);return t}function Ec(e,t){let r=e.buckets.get(t);if(!r)r=new WeakMap,e.buckets.set(t,r);return r}var Ye,qe=[],Ac={alloc(e,t,r){let n=Ye;if(!n)return r;Ye=void 0;let o={value:r,issues:null};return n.set(t.value,o),qe.push(o),r},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let r=e._zod.parse,n=(o,i)=>{if(i.direction!=="backward"&&Tc(i,o.value))throw new Do;return r(o,i)};if(e._zod.parse=n,e._zod.run===r)e._zod.run=n})},attach(e){var t;let r,n=!1,o,i;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let s=e._zod.parse,c=(u,a)=>{if(r===void 0){let b=et(e,new Set,!1);if(b===$e){if(e._zod.parse=s,e._zod.run===c)e._zod.run=s;return s(u,a)}if(b===we||n)r=!0;else n=!0}let l=u.value;if(!jo(l))return s(u,a);let f=a[Dt];if(!f)f={buckets:new WeakMap,backEdges:void 0},a[Dt]=f;let d;if(o===a)d=i;else d=Ec(f,e),o=a,i=d;let m=d.get(l);if(m){if(u.value=m.value,m.issues){if(m.issues.length)u.issues.push(...Rt(m.issues))}else u.memo=!0,f.backEdges??(f.backEdges=new WeakSet),f.backEdges.add(m.value);return u}Ye=d;let h=qe.length,x=s(u,a);Ye=void 0;let _=qe.length>h?qe.pop():void 0;if(x instanceof Promise)return x.then((b)=>{if(_)_.issues=b.issues.length?Rt(b.issues):Ro;return b});if(_)_.issues=x.issues.length?Rt(x.issues):Ro;return x};if(e._zod.parse=c,e._zod.run===s)e._zod.run=c})}};function Mo(){return Ac}function Tc(e,t){let r=e[Dt]?.backEdges;return r!==void 0&&jo(t)&&r.has(t)}var Nc=()=>{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(i){return e[i]??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",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};function o(i,s){if(i==="number"&&typeof s==="number"&&!Number.isFinite(s))return String(s);return n[i]??i}return(i)=>{switch(i.code){case"invalid_type":{let s=o(i.expected),c=vr(i.input),u=o(c,i.input);return`Invalid input: expected ${s}, received ${u}`}case"invalid_value":if(i.values.length===1)return`Invalid input: expected ${gt(i.values[0])}`;return`Invalid option: expected one of ${dt(i.values,"|")}`;case"too_big":{let s=i.exact?"exactly ":i.inclusive?"<=":"<",c=t(i.origin);if(c)return`Too big: expected ${i.origin??"value"} to have ${s}${i.maximum.toString()} ${c.unit??"elements"}`;return`Too big: expected ${i.origin??"value"} to be ${s}${i.maximum.toString()}`}case"too_small":{let s=i.exact?"exactly ":i.inclusive?">=":">",c=t(i.origin);if(c)return`Too small: expected ${i.origin} to have ${s}${i.minimum.toString()} ${c.unit}`;return`Too small: expected ${i.origin} to be ${s}${i.minimum.toString()}`}case"invalid_format":{let s=i;if(s.format==="starts_with")return`Invalid string: must start with "${s.prefix}"`;if(s.format==="ends_with")return`Invalid string: must end with "${s.suffix}"`;if(s.format==="includes")return`Invalid string: must include "${s.includes}"`;if(s.format==="regex")return`Invalid string: must match pattern ${s.pattern}`;return`Invalid ${r[s.format]??i.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${i.divisor}`;case"unrecognized_keys":return`Unrecognized key${i.keys.length>1?"s":""}: ${dt(i.keys,", ")}`;case"invalid_key":return`Invalid key in ${i.origin}`;case"invalid_union":if(i.options&&Array.isArray(i.options)&&i.options.length>0)return`Invalid discriminator value. Expected ${i.options.map((c)=>`'${c}'`).join(" | ")}`;if(i.inclusive===!1)return"Invalid input: more than one option matched";return"Invalid input";case"invalid_element":return`Invalid value in ${i.origin}`;default:return"Invalid input"}}};function jt(){return{localeError:Nc()}}var Fo;class Uo{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let r=t[0];if(this._map.set(e,r),r&&typeof r==="object"&&"id"in r)this._idmap.set(r.id,e);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);if(t&&typeof t==="object"&&"id"in t)this._idmap.delete(t.id);return this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let r={...this.get(t)??{}};delete r.id;let n={...r,...this._map.get(e)};return Object.keys(n).length?n:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function Cc(){return new Uo}(Fo=globalThis).__zod_globalRegistry??(Fo.__zod_globalRegistry=Cc());var ae=globalThis.__zod_globalRegistry;function Bo(e){if(e.checks)e.checks=[...e.checks];return e}function Jo(e,t){return new e(Bo({type:"string",...g(t)}))}function Go(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...g(t)})}function Ko(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...g(t)})}function Vo(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...g(t)})}function Wo(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...g(t)})}function Xo(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...g(t)})}function Ho(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...g(t)})}function Yo(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...g(t)})}function qo(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...g(t)})}function Qo(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...g(t)})}function ei(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...g(t)})}function ti(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...g(t)})}function ri(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...g(t)})}function ni(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...g(t)})}function oi(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...g(t)})}function ii(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...g(t)})}function si(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...g(t)})}function ci(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...g(t)})}function ui(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...g(t)})}function ai(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...g(t)})}function li(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...g(t)})}function pi(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...g(t)})}function fi(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...g(t)})}function di(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...g(t)})}function mi(e,t){return new e({type:"string",format:"date",check:"string_format",...g(t)})}function hi(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...g(t)})}function gi(e,t){return new e({type:"string",format:"duration",check:"string_format",...g(t)})}function _i(e,t){return new e(Bo({type:"number",checks:[],...g(t)}))}function xi(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...g(t)})}function yi(e,t){return new e({type:"boolean",...g(t)})}function bi(e){return new e({type:"unknown"})}function vi(e,t){return new e({type:"never",...g(t)})}function tt(e,t){return new St({check:"less_than",...g(t),value:e,inclusive:!1})}function ke(e,t){return new St({check:"less_than",...g(t),value:e,inclusive:!0})}function rt(e,t){return new Ot({check:"greater_than",...g(t),value:e,inclusive:!1})}function Ze(e,t){return new Ot({check:"greater_than",...g(t),value:e,inclusive:!0})}function nt(e,t){return new hn({check:"multiple_of",...g(t),value:e})}function ot(e,t){return new _n({check:"max_length",...g(t),maximum:e})}function de(e,t){return new xn({check:"min_length",...g(t),minimum:e})}function it(e,t){return new yn({check:"length_equals",...g(t),length:e})}function Lt(e,t){return new bn({check:"string_format",format:"regex",...g(t),pattern:e})}function Mt(e){return new vn({check:"string_format",format:"lowercase",...g(e)})}function Ft(e){return new zn({check:"string_format",format:"uppercase",...g(e)})}function Ut(e,t){return new $n({check:"string_format",format:"includes",...g(t),includes:e})}function Bt(e,t){return new wn({check:"string_format",format:"starts_with",...g(t),prefix:e})}function Jt(e,t){return new kn({check:"string_format",format:"ends_with",...g(t),suffix:e})}function ne(e){return new Zn({check:"overwrite",tx:e})}function Gt(e){return ne((t)=>t.normalize(e))}function Kt(){return ne((e)=>e.trim())}function Vt(){return ne((e)=>e.toLowerCase())}function Wt(){return ne((e)=>e.toUpperCase())}function Xt(){return ne((e)=>mr(e))}function zi(e,t,r){return new e({type:"array",element:t,...g(r)})}function $i(e,t,r){return new e({type:"custom",check:"custom",fn:t,...g(r)})}function wi(e,t){let r=Rc((n)=>(n.addIssue=(o)=>{if(typeof o==="string")n.issues.push(ue(o,n.value,r._zod.def));else{let i=o;if(i.fatal)i.continue=!1;if(i.code??(i.code="custom"),!("input"in i))i.input=n.value;i.inst??(i.inst=r),i.continue??(i.continue=!r._zod.def.abort),n.issues.push(ue(i))}},e(n.value,n)),t);return r}function Rc(e,t){let r=new O({check:"custom",...g(t)});return r._zod.check=e,r}function Pe(e,...t){for(let r of t)for(let n of Reflect.ownKeys(r))if(Object.prototype.propertyIsEnumerable.call(r,n))B(e,n,r[n]);return e}function Yt(e){let t=e?.target??"draft-2020-12";if(t==="draft-4")t="draft-04";if(t==="draft-7")t="draft-07";return{processors:e.processors??{},metadataRegistry:e?.metadata??ae,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function H(e,t,r,n,o){let i=typeof t.unrepresentable==="function"?t.unrepresentable({zodSchema:e,path:n.path,message:o}):t.unrepresentable;if(i==="any")return!1;if(i===void 0||i==="throw")throw Error(o);return Object.assign(r,i),!0}function S(e,t,r={path:[],schemaPath:[]}){var n;let o=e._zod.def,i=t.seen.get(e);if(i){if(i.count++,r.schemaPath.includes(e))i.cycle=r.path;return i.schema}let s={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,s),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let c=e._zod.toJSONSchema?.();if(c)s.schema=c;else{let l={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,l);else{let d=s.schema,m=t.processors[o.type];if(!m)throw Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);m(e,t,d,l)}let f=e._zod.parent;if(f){if(!s.ref)s.ref=f;S(f,t,l),t.seen.get(f).isParent=!0}}let u=t.metadataRegistry.get(e);if(u)Pe(s.schema,u);if(t.io==="input"&&I(e))delete s.schema.examples,delete s.schema.default;if(t.io==="input"&&"_prefault"in s.schema)(n=s.schema).default??(n.default=s.schema._prefault);return delete s.schema._prefault,t.seen.get(e).schema}function ki(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function qt(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;let n=new Map;for(let s of e.seen.entries()){let c=e.metadataRegistry.get(s[0])?.id;if(c){let u=n.get(c);if(u&&u!==s[0])throw Error(`Duplicate schema id "${c}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(c,s[0])}}let o=(s)=>{let c=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let f=e.external.registry.get(s[0])?.id,d=e.external.uri??((h)=>h);if(f)return{ref:d(f)};let m=s[1].defId??s[1].schema.id??`schema${e.counter++}`;return s[1].defId=m,{defId:m,ref:`${d("__shared")}#/${c}/${ki(m)}`}}let u="#",a=`${u}/${c}/`;if(s[1]===r&&!s[1].schema.id)return{ref:u};let l=s[1].schema.id??`__schema${e.counter++}`;return{defId:l,ref:a+ki(l)}},i=(s)=>{if(s[1].schema.$ref)return;let c=s[1],{ref:u,defId:a}=o(s);if(c.def={...c.schema},a)c.defId=a;let l=c.schema;for(let f in l)delete l[f];l.$ref=u};if(e.cycles==="throw")for(let s of e.seen.entries()){let c=s[1];if(c.cycle)throw Error(`Cycle detected: #/${c.cycle?.join("/")}/<root>
|
|
57
|
+
|
|
58
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of e.seen.entries()){let c=s[1];if(t===s[0]){i(s);continue}if(e.external){let a=e.external.registry.get(s[0])?.id;if(t!==s[0]&&a){i(s);continue}}if(e.metadataRegistry.get(s[0])?.id){i(s);continue}if(c.cycle){i(s);continue}if(c.count>1){if(e.reused==="ref")i(s)}}if(e.external)e.sharedDefsExtractedFor=e.external}function Si(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let r=[];for(let n of t){if(!n||typeof n!=="object")return;Si(n);let o=Object.keys(n);if(o.length!==1||o[0]!=="type")return;let i=n.type;for(let s of Array.isArray(i)?i:[i]){if(typeof s!=="string")return;if(!r.includes(s))r.push(s)}}delete e.anyOf,e.type=r.length===1?r[0]:r}var Oi=new Set(["type","properties","required","additionalProperties"]),Zi=["oneOf","anyOf"];function Pi(e){let t=e.additionalProperties;if(t===void 0||t===!1||typeof t!=="object"||t===null)return null;return Object.keys(t).length?t:null}function Ht(e){let t=[];for(let i of e){if(typeof i!=="object"||i.type!=="object")return null;for(let s in i)if(!Oi.has(s))return null;t.push(i)}let r={},n=new Set;for(let i of t){for(let s in i.properties){if(Object.prototype.hasOwnProperty.call(r,s))continue;let c=[];for(let a of t){let l=a.properties?.[s]??Pi(a);if(l===null||l===void 0)continue;if(!c.some((f)=>JSON.stringify(f)===JSON.stringify(l)))c.push(l)}let u=c.length===1?c[0]:Ht(c)??{allOf:c};B(r,s,u)}for(let s of i.required??[])n.add(s)}let o={type:"object",properties:r};if(n.size)o.required=[...n];if(t.every((i)=>i.additionalProperties===!1))o.additionalProperties=!1;else{let i=[];for(let s of t){let c=Pi(s);if(c&&!i.some((u)=>JSON.stringify(u)===JSON.stringify(c)))i.push(c)}if(i.length===1)o.additionalProperties=i[0];else if(i.length>1)o.additionalProperties={allOf:i}}return o}function Dc(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let o of Oi)if(o in e)return;let r=t.filter((o)=>Zi.some((i)=>Array.isArray(o[i]))),n=null;if(!r.length)n=Ht(t);else{let o=r[0],i=Zi.find((u)=>Array.isArray(o[u]));if(Object.keys(o).length!==1)return;let s=t.filter((u)=>u!==o),c=o[i].map((u)=>Ht([...s,u]));if(c.some((u)=>!u))return;n={[i]:c}}if(!n)return;delete e.allOf,Pe(e,n)}function Qt(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let n=(c)=>{let u=e.seen.get(c);if(u.ref===null)return;let a=u.def??u.schema,l={...a},f=u.ref;if(u.ref=null,f){n(f);let m=e.seen.get(f),h=m.schema;if(h.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"))a.allOf=a.allOf??[],a.allOf.push(h);else Pe(a,h);if(Pe(a,l),c._zod.parent===f)for(let _ in a){if(_==="$ref"||_==="allOf")continue;if(!(_ in l))delete a[_]}if(h.$ref&&m.def)for(let _ in a){if(_==="$ref"||_==="allOf")continue;if(_ in m.def&&JSON.stringify(a[_])===JSON.stringify(m.def[_]))delete a[_]}}let d=c._zod.parent;if(d&&d!==f){n(d);let m=e.seen.get(d);if(m?.schema.$ref){if(a.$ref=m.schema.$ref,m.def)for(let h in a){if(h==="$ref"||h==="allOf")continue;if(h in m.def&&JSON.stringify(a[h])===JSON.stringify(m.def[h]))delete a[h]}}}e.override({zodSchema:c,jsonSchema:a,path:u.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let c of[...e.seen.entries()].reverse())n(c[0]);if(e.target!=="openapi-3.0")for(let c of e.seen.entries())Si(c[1].def??c[1].schema);for(let c of e.deferred)c();if(e.intersections.length){let c=new Map;for(let u of e.seen.values())for(let a of[u.schema,u.def]){let l=a?.allOf;if(!Array.isArray(l))continue;let f=c.get(l);if(f)f.push(a);else c.set(l,[a])}for(let u of e.intersections)for(let a of c.get(u)??[])Dc(a)}}let o={};if(e.target==="draft-2020-12")o.$schema="https://json-schema.org/draft/2020-12/schema";else if(e.target==="draft-07")o.$schema="http://json-schema.org/draft-07/schema#";else if(e.target==="draft-04")o.$schema="http://json-schema.org/draft-04/schema#";else if(e.target==="openapi-3.0");if(e.external?.uri){let c=e.external.registry.get(t)?.id;if(!c)throw Error("Schema is missing an `id` property");o.$id=e.external.uri(c)}Pe(o,r.defId?r.schema:r.def??r.schema);let i=e.metadataRegistry.get(t)?.id;if(i!==void 0&&o.id===i)delete o.id;let s=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let c of e.seen.entries()){let u=c[1];if(u.def&&u.defId){if(u.def.id===u.defId)delete u.def.id;B(s,u.defId,u.def)}}if(e.external)e.sharedEmitDoneFor=e.external;if(e.external);else if(Object.keys(s).length>0)if(e.target==="draft-2020-12")o.$defs=s;else o.definitions=s;try{let c=JSON.parse(JSON.stringify(o));return Object.defineProperty(c,"~standard",{value:{...t["~standard"],jsonSchema:{input:Se(t,"input",e.processors),output:Se(t,"output",e.processors)}},enumerable:!1,writable:!1}),c}catch(c){throw Error("Error converting schema to JSON.")}}function I(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let n=e._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return I(n.element,r);if(n.type==="set")return I(n.valueType,r);if(n.type==="lazy")return I(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault"||n.type==="catch")return I(n.innerType,r);if(n.type==="intersection")return I(n.left,r)||I(n.right,r);if(n.type==="record"||n.type==="map")return I(n.keyType,r)||I(n.valueType,r);if(n.type==="pipe"){if(e._zod.traits.has("$ZodCodec"))return!0;return I(n.in,r)||I(n.out,r)}if(n.type==="object"){for(let o in n.shape)if(I(n.shape[o],r))return!0;return!1}if(n.type==="union"){for(let o of n.options)if(I(o,r))return!0;return!1}if(n.type==="tuple"){for(let o of n.items)if(I(o,r))return!0;if(n.rest&&I(n.rest,r))return!0;return!1}return!1}var Ii=(e,t={})=>(r)=>{let n=Yt({...r,processors:t});return S(e,n),qt(n,e),Qt(n,e)},Se=(e,t,r={})=>(n)=>{let{libraryOptions:o,target:i}=n??{},s=Yt({...o??{},target:i,io:t,processors:r});return S(e,s),qt(s,e),Qt(s,e)};var me=(e,t,r)=>{if(e[t]===void 0||r>e[t])e[t]=r},he=(e,t,r)=>{if(e[t]===void 0||r<e[t])e[t]=r},Ei=(e,t)=>{me(e,"minimum",t),he(e,"maximum",t)},Ci=(e,t)=>{if(e.multipleOf??(e.multipleOf=[]),!e.multipleOf.includes(t))e.multipleOf.push(t)},Ri=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},Di=(e,t)=>{e.mime=e.mime?e.mime.filter((r)=>t.includes(r)):[...t]},ji=(e,t)=>{if(e.format=t,t.includes("int"))e.isInt=!0},Ai=(e,t)=>me(e,"minimum",t.minimum),Ti=(e,t)=>he(e,"maximum",t.maximum),Ni=(e)=>(t,r)=>{ji(t,r.format);let[n,o]=e[r.format];me(t,"minimum",n),he(t,"maximum",o)},jc={greater_than:(e,t)=>me(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>he(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>Ci(e,t.value),number_format:Ni(Te),bigint_format:Ni(_t),min_length:Ai,max_length:Ti,length_equals:(e,t)=>Ei(e,t.length),min_size:Ai,max_size:Ti,size_equals:(e,t)=>Ei(e,t.size),string_format:(e,t)=>{if(ji(e,t.format),t.pattern)Ri(e,t.pattern);if(t.format==="base64"||t.format==="base64url")e.contentEncoding=t.format;if(t.local||t.precision===-1)e.laxFormat=!0},mime_type:(e,t)=>Di(e,t.mime)};function F(e){let t={},r=e._zod.def,n=e._zod.traits.has("$ZodCheck")?[e,...r.checks??[]]:r.checks??[];for(let i of n)jc[i._zod.def.check]?.(t,i._zod.def);let o=e._zod.bag;if(o.minimum!==void 0)me(t,"minimum",o.minimum);if(o.exclusiveMinimum!==void 0)me(t,"exclusiveMinimum",o.exclusiveMinimum);if(o.maximum!==void 0)he(t,"maximum",o.maximum);if(o.exclusiveMaximum!==void 0)he(t,"exclusiveMaximum",o.exclusiveMaximum);if(o.multipleOf!==void 0)Ci(t,o.multipleOf);if(o.format!==void 0){if(t.format??(t.format=o.format),o.format.includes("int"))t.isInt=!0}if(o.mime)Di(t,o.mime);for(let i of o.patterns??[])Ri(t,i);return t}var Lc={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Mc=new Map([[Tt,rn],[He,nn]]),Fc=(e)=>Mc.get(e)??e,Li=(e,t,r,n)=>{let o=r;o.type="string";let{minimum:i,maximum:s,format:c,patterns:u,contentEncoding:a,laxFormat:l}=F(e);if(typeof i==="number")o.minLength=i;if(typeof s==="number")o.maxLength=s;if(c){if(o.format=Lc[c]??c,o.format==="")delete o.format;if(c==="time"||l)delete o.format}if(a)o.contentEncoding=a;if(u&&u.size>0){let f=[...u].map(Fc);if(f.length===1)o.pattern=f[0].source;else if(f.length>1)o.allOf=[...f.map((d)=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))]}},Mi=(e,t,r,n)=>{let o=r,{minimum:i,maximum:s,multipleOf:c,exclusiveMaximum:u,exclusiveMinimum:a,isInt:l}=F(e);o.type=l?"integer":"number";let f=typeof a==="number"&&a>=(i??Number.NEGATIVE_INFINITY),d=typeof u==="number"&&u<=(s??Number.POSITIVE_INFINITY),m=t.target==="draft-04"||t.target==="openapi-3.0";if(f)if(m)o.minimum=a,o.exclusiveMinimum=!0;else o.exclusiveMinimum=a;else if(typeof i==="number")o.minimum=i;if(d)if(m)o.maximum=u,o.exclusiveMaximum=!0;else o.exclusiveMaximum=u;else if(typeof s==="number")o.maximum=s;if(c){let h=new Set;for(let b of c)if(Number.isFinite(b)&&b!==0)h.add(Math.abs(b));else H(e,t,o,n,`A multipleOf divisor of ${b} cannot be represented in JSON Schema`);let[x,..._]=h;if(x!==void 0)o.multipleOf=x;if(_.length)o.allOf=[...o.allOf??[],..._.map((b)=>({multipleOf:b}))]}},Fi=(e,t,r,n)=>{r.type="boolean"};var Ui=(e,t,r,n)=>{r.not={}};var Bi=(e,t,r,n)=>{};var Ji=(e,t,r,n)=>{let o=e._zod.def,i=xe(o.entries);if(i.length===0){r.not={};return}if(i.every((s)=>typeof s==="number"))r.type="number";if(i.every((s)=>typeof s==="string"))r.type="string";r.enum=i},Gi=(e,t,r,n)=>{let o=e._zod.def;if(o.values.length===0){r.not={};return}let i=[];for(let s of o.values)if(s===void 0){if(H(e,t,r,n,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof s==="bigint"){if(H(e,t,r,n,"BigInt literals cannot be represented in JSON Schema"))return;i.push(Number(s))}else i.push(s);if(i.length===0);else if(i.length===1){let s=i[0];if(r.type=s===null?"null":typeof s,t.target==="draft-04"||t.target==="openapi-3.0")r.enum=[s];else r.const=s}else{if(i.every((s)=>typeof s==="number"))r.type="number";if(i.every((s)=>typeof s==="string"))r.type="string";if(i.every((s)=>typeof s==="boolean"))r.type="boolean";if(i.every((s)=>s===null))r.type="null";r.enum=i}};var Ki=(e,t,r,n)=>{H(e,t,r,n,"Custom types cannot be represented in JSON Schema")};var Vi=(e,t,r,n)=>{H(e,t,r,n,"Transforms cannot be represented in JSON Schema")};var Wi=(e,t,r,n)=>{let o=r,i=e._zod.def,{minimum:s,maximum:c}=F(e);if(typeof s==="number")o.minItems=s;if(typeof c==="number")o.maxItems=c;o.type="array",o.items=S(i.element,t,{...n,path:[...n.path,"items"]})};function er(e){let t=e._zod.def;if(t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform"))return er(t.out);if(t.type==="catch")return er(t.innerType);return e._zod.optin}var Xi=(e,t,r,n)=>{let o=r,i=e._zod.def,s=i.shape;if(Object.getOwnPropertySymbols(s).length&&H(e,t,o,n,"Symbol keys cannot be represented in JSON Schema"))return;o.type="object",o.properties={};for(let a in s)B(o.properties,a,S(s[a],t,{...n,path:[...n.path,"properties",a]}));let u=[];for(let a of Object.keys(s)){let l=i.shape[a];if(t.io==="input"?er(l)===void 0:l._zod.optout===void 0)u.push(a)}if(u.length>0)o.required=u;if(i.catchall?._zod.def.type==="never")o.additionalProperties=!1;else if(!i.catchall){if(t.io==="output")o.additionalProperties=!1}else if(i.catchall)o.additionalProperties=S(i.catchall,t,{...n,path:[...n.path,"additionalProperties"]})},Hi=(e,t,r,n)=>{let o=e._zod.def,i=o.inclusive===!1,s=o.options.map((c,u)=>S(c,t,{...n,path:[...n.path,i?"oneOf":"anyOf",u]}));if(i)r.oneOf=s;else r.anyOf=s},Yi=(e,t,r,n)=>{let o=e._zod.def,i=S(o.left,t,{...n,path:[...n.path,"allOf",0]}),s=S(o.right,t,{...n,path:[...n.path,"allOf",1]}),c=(a)=>("allOf"in a)&&Object.keys(a).length===1,u=[...c(i)?i.allOf:[i],...c(s)?s.allOf:[s]];r.allOf=u,t.intersections.push(u)};var qi=(e,t,r,n)=>{let o=e._zod.def,i=S(o.innerType,t,n),s=t.seen.get(e);if(t.target==="openapi-3.0")s.ref=o.innerType,r.nullable=!0;else r.anyOf=[i,{type:"null"}]},Qi=(e,t,r,n)=>{let o=e._zod.def;S(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType},tr=Symbol();function es(e,t,r,n,o){let i=!1,s=JSON.stringify(e,(c,u)=>{if(typeof u!=="bigint")return u;return i=!0,null});if(!i)return JSON.parse(s);return H(t,r,n,o,"BigInt defaults cannot be represented in JSON Schema"),tr}var ts=(e,t,r,n)=>{let o=e._zod.def;S(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType;let s=es(o.defaultValue,e,t,r,n);if(s!==tr)r.default=s},rs=(e,t,r,n)=>{let o=e._zod.def;S(o.innerType,t,n);let i=t.seen.get(e);if(i.ref=o.innerType,t.io!=="input")return;let s=es(o.defaultValue,e,t,r,n);if(s!==tr)r._prefault=s},ns=(e,t,r,n)=>{let o=e._zod.def;S(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType;let s;try{s=o.catchValue(void 0)}catch{H(e,t,r,n,"Dynamic catch values are not supported in JSON Schema");return}r.default=s},os=(e,t,r,n)=>{let o=e._zod.def,i=o.in._zod.traits.has("$ZodTransform"),s=t.io==="input"?i?o.out:o.in:o.out;S(s,t,n);let c=t.seen.get(e);c.ref=s},is=(e,t,r,n)=>{let o=e._zod.def;S(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType,r.readOnly=!0};var rr=(e,t,r,n)=>{let o=e._zod.def;S(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType};var ss=new WeakSet([Object.prototype,Error.prototype]);function st(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let n=r(this);return Object.defineProperty(this,t,{value:n,configurable:!0,writable:!0}),n},set(n){Object.defineProperty(this,t,{value:n,configurable:!0,writable:!0})}})}var Xc=(e,t)=>{Or.init(e,t),e.name="ZodError";let r=Object.getPrototypeOf(e);if(ss.has(r))return;ss.add(r),st(r,"format",(n)=>(o)=>Er(n,o)),st(r,"flatten",(n)=>(o)=>Ir(n,o)),st(r,"addIssue",(n)=>(o)=>{n.issues.push(o),n.message=JSON.stringify(n.issues,ye,2)}),st(r,"addIssues",(n)=>(o)=>{n.issues.push(...o),n.message=JSON.stringify(n.issues,ye,2)}),Object.defineProperty(r,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}})};var C=p("ZodError",Xc,void 0,{Parent:Error});var cs=Fe(C),us=Ue(C),as=Be(C),ls=Je(C),ps=Tr(C),fs=Nr(C),ds=Cr(C),ms=Rr(C),hs=Dr(C),gs=jr(C),_s=Lr(C),xs=Mr(C);function Yc(){if(!N.localeError)M(jt())}function ir(){if(!N.memoizer)M({memoizer:Mo()})}var P=p("ZodType",(e,t)=>(Yc(),k.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(T(t,{checks:[...t.checks??[],...e.map((r)=>typeof r==="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return J(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Wu(e,t))},superRefine(e,t){return this.check(Xu(e,t))},overwrite(e){return this.check(ne(e))},optional(){return vs(this)},exactOptional(){return Cu(this)},nullable(){return zs(this)},nullish(){return vs(zs(this))},nonoptional(e){return Fu(this,e)},array(){return Pu(this)},or(e){return Zs([this,e])},and(e){return Eu(this,e)},transform(e){return $s(this,Nu(e))},default(e){return ju(this,e)},prefault(e){return Mu(this,e)},catch(e){return Bu(this,e)},pipe(e){return $s(this,e)},readonly(){return Ku(this)},describe(e){let t=this.clone();return ae.add(t,{description:e}),t},meta(...e){if(e.length===0)return ae.get(this);let t=this.clone();return ae.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get "~standard"(){return Le(this,"~standard",{...At(this),jsonSchema:{input:Se(this,"input"),output:Se(this,"output")}})},set "~standard"(e){X(this,"~standard",e)},parse:function e(t,r){return cs(this,t,r,{callee:e})},parseAsync:async function e(t,r){return await us(this,t,r,{callee:e})},safeParse(e,t){return as(this,e,t)},async safeParseAsync(e,t){return ls(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){X(this,"spa",e)},validate(e,t){return zt(this,e,t)},validateAsync(e,t){return $t(this,e,t)},encode:function e(t,r){return ps(this,t,r,{callee:e})},decode:function e(t,r){return fs(this,t,r,{callee:e})},encodeAsync:async function e(t,r){return await ds(this,t,r,{callee:e})},decodeAsync:async function e(t,r){return await ms(this,t,r,{callee:e})},safeEncode(e,t){return hs(this,e,t)},safeDecode(e,t){return gs(this,e,t)},async safeEncodeAsync(e,t){return _s(this,e,t)},async safeDecodeAsync(e,t){return xs(this,e,t)},toJSONSchema(e){return Ii(this,{})(e)},get description(){return ae.get(this)?.description},get _def(){return this._zod.def}}),ws=p("_ZodString",(e,t)=>{Xe.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Li(e,r,n,o)},$r({format:(e)=>F(e).format??null,minLength:(e)=>F(e).minimum??null,maxLength:(e)=>F(e).maximum??null},{regex(...e){return this.check(Lt(...e))},includes(...e){return this.check(Ut(...e))},startsWith(...e){return this.check(Bt(...e))},endsWith(...e){return this.check(Jt(...e))},min(...e){return this.check(de(...e))},max(...e){return this.check(ot(...e))},length(...e){return this.check(it(...e))},nonempty(...e){return this.check(de(1,...e))},lowercase(e){return this.check(Mt(e))},uppercase(e){return this.check(Ft(e))},trim(){return this.check(Kt())},normalize(...e){return this.check(Gt(...e))},toLowerCase(){return this.check(Vt())},toUpperCase(){return this.check(Wt())},slugify(){return this.check(Xt())}})),qc=p("ZodString",(e,t)=>{Xe.init(e,t),ws.init(e,t)},{email(e){return this.check(Go(nu,e))},url(e){return this.check(Yo(iu,e))},jwt(e){return this.check(fi(bu,e))},emoji(e){return this.check(qo(su,e))},guid(e){return this.check(Ko(ou,e))},uuid(e){return this.check(Vo(ct,e))},uuidv4(e){return this.check(Wo(ct,e))},uuidv6(e){return this.check(Xo(ct,e))},uuidv7(e){return this.check(Ho(ct,e))},nanoid(e){return this.check(Qo(cu,e))},cuid(e){return this.check(ei(uu,e))},cuid2(e){return this.check(ti(au,e))},ulid(e){return this.check(ri(lu,e))},base64(e){return this.check(ai(_u,e))},base64url(e){return this.check(li(xu,e))},xid(e){return this.check(ni(pu,e))},ksuid(e){return this.check(oi(fu,e))},ipv4(e){return this.check(ii(du,e))},ipv6(e){return this.check(si(mu,e))},cidrv4(e){return this.check(ci(hu,e))},cidrv6(e){return this.check(ui(gu,e))},e164(e){return this.check(pi(yu,e))},datetime(e){return this.check(di(Qc,e))},date(e){return this.check(mi(eu,e))},time(e){return this.check(hi(tu,e))},duration(e){return this.check(gi(ru,e))}});function V(e){return Jo(qc,e)}var Z=p("ZodStringFormat",(e,t)=>{w.init(e,t),ws.init(e,t)}),Qc=p("ZodISODateTime",(e,t)=>{Qn.init(e,t),Z.init(e,t)}),eu=p("ZodISODate",(e,t)=>{eo.init(e,t),Z.init(e,t)}),tu=p("ZodISOTime",(e,t)=>{to.init(e,t),Z.init(e,t)}),ru=p("ZodISODuration",(e,t)=>{ro.init(e,t),Z.init(e,t)}),nu=p("ZodEmail",(e,t)=>{Un.init(e,t),Z.init(e,t)});var ou=p("ZodGUID",(e,t)=>{Mn.init(e,t),Z.init(e,t)});var ct=p("ZodUUID",(e,t)=>{Fn.init(e,t),Z.init(e,t)});var iu=p("ZodURL",(e,t)=>{Gn.init(e,t),Z.init(e,t)});var su=p("ZodEmoji",(e,t)=>{Kn.init(e,t),Z.init(e,t)});var cu=p("ZodNanoID",(e,t)=>{Vn.init(e,t),Z.init(e,t)});var uu=p("ZodCUID",(e,t)=>{Wn.init(e,t),Z.init(e,t)});var au=p("ZodCUID2",(e,t)=>{Xn.init(e,t),Z.init(e,t)});var lu=p("ZodULID",(e,t)=>{Hn.init(e,t),Z.init(e,t)});var pu=p("ZodXID",(e,t)=>{Yn.init(e,t),Z.init(e,t)});var fu=p("ZodKSUID",(e,t)=>{qn.init(e,t),Z.init(e,t)});var du=p("ZodIPv4",(e,t)=>{no.init(e,t),Z.init(e,t)});var mu=p("ZodIPv6",(e,t)=>{io.init(e,t),Z.init(e,t)});var hu=p("ZodCIDRv4",(e,t)=>{so.init(e,t),Z.init(e,t)});var gu=p("ZodCIDRv6",(e,t)=>{co.init(e,t),Z.init(e,t)});var _u=p("ZodBase64",(e,t)=>{ao.init(e,t),Z.init(e,t)});var xu=p("ZodBase64URL",(e,t)=>{lo.init(e,t),Z.init(e,t)});var yu=p("ZodE164",(e,t)=>{po.init(e,t),Z.init(e,t)});var bu=p("ZodJWT",(e,t)=>{fo.init(e,t),Z.init(e,t)});var ks=p("ZodNumber",(e,t)=>{Nt.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Mi(e,r,n,o),e.isFinite=!0},$r({minValue:(e)=>{let{minimum:t,exclusiveMinimum:r}=F(e);return Math.max(t??Number.NEGATIVE_INFINITY,r??Number.NEGATIVE_INFINITY)},maxValue:(e)=>{let{maximum:t,exclusiveMaximum:r}=F(e);return Math.min(t??Number.POSITIVE_INFINITY,r??Number.POSITIVE_INFINITY)},isInt:(e)=>{let{isInt:t,multipleOf:r}=F(e);return!!t||!!r?.some(Number.isSafeInteger)},format:(e)=>F(e).format??null},{gt(e,t){return this.check(rt(e,t))},gte(e,t){return this.check(Ze(e,t))},min(e,t){return this.check(Ze(e,t))},lt(e,t){return this.check(tt(e,t))},lte(e,t){return this.check(ke(e,t))},max(e,t){return this.check(ke(e,t))},int(e){return this.check(ys(e))},safe(e){return this.check(ys(e))},positive(e){return this.check(rt(0,e))},nonnegative(e){return this.check(Ze(0,e))},negative(e){return this.check(tt(0,e))},nonpositive(e){return this.check(ke(0,e))},multipleOf(e,t){return this.check(nt(e,t))},step(e,t){return this.check(nt(e,t))},finite(){return this}}));function D(e){return _i(ks,e)}var vu=p("ZodNumberFormat",(e,t)=>{mo.init(e,t),ks.init(e,t)});function ys(e){return xi(vu,e)}var zu=p("ZodBoolean",(e,t)=>{ho.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Fi(e,r,n,o)});function R(e){return yi(zu,e)}var $u=p("ZodUnknown",(e,t)=>{go.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Bi(e,r,n,o)});function bs(){return bi($u)}var wu=p("ZodNever",(e,t)=>{_o.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ui(e,r,n,o)});function ku(e){return vi(wu,e)}var Zu=p("ZodArray",(e,t)=>{ir(),xo.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Wi(e,r,n,o),e.element=t.element},{min(e,t){return this.check(de(e,t))},nonempty(e){return this.check(de(1,e))},max(e,t){return this.check(ot(e,t))},length(e,t){return this.check(it(e,t))},unwrap(){return this.element}});function Pu(e,t){return zi(Zu,e,t)}var Su=p("ZodObject",(e,t)=>{ir(),vo.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Xi(e,r,n,o),nc(e,"shape",(r)=>r._zod.def.shape,!1)},{keyof(){return ut(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(T(this._zod.def,{catchall:e}))},passthrough(){return this.clone(T(this._zod.def,{catchall:bs()}))},loose(){return this.clone(T(this._zod.def,{catchall:bs()}))},strict(){return this.clone(T(this._zod.def,{catchall:ku()}))},strip(){return this.clone(T(this._zod.def,{catchall:void 0}))},extend(e){return Xs(this,e)},safeExtend(e){return Hs(this,e)},merge(e){return Ys(this,e)},pick(e){return Vs(this,e)},omit(e){return Ws(this,e)},partial(...e){return yr(Ps,this,e[0])},exactPartial(...e){return yr(Ss,this,e[0],"exactPartial")},required(...e){return qs(Os,this,e[0])}});function Y(e,t){let r={type:"object",shape:e??{},...g(t)};return new Su(r)}var Ou=p("ZodUnion",(e,t)=>{zo.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Hi(e,r,n,o),e.options=t.options});function Zs(e,t){return new Ou({type:"union",options:e,...g(t)})}var Iu=p("ZodIntersection",(e,t)=>{$o.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Yi(e,r,n,o)});function Eu(e,t){return new Iu({type:"intersection",left:e,right:t})}var or=p("ZodEnum",(e,t)=>{wo.init(e,t),P.init(e,t),e._zod.processJSONSchema=(n,o,i)=>Ji(e,n,o,i),e.enum=t.entries,e.options=[...e._zod.values];let r=new Set(Object.keys(t.entries));e.extract=(n,o)=>{let i={};for(let s of n)if(r.has(s))i[s]=t.entries[s];else throw Error(`Key ${s} not found in enum`);return new or({...t,checks:[],...g(o),entries:i})},e.exclude=(n,o)=>{let i={...t.entries};for(let s of n)if(r.has(s))delete i[s];else throw Error(`Key ${s} not found in enum`);return new or({...t,checks:[],...g(o),entries:i})}});function ut(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map((n)=>[n,n])):e;return new or({type:"enum",entries:r,...g(t)})}var Au=p("ZodLiteral",(e,t)=>{ko.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Gi(e,r,n,o),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function le(e,t){return new Au({type:"literal",values:Array.isArray(e)?e:[e],...g(t)})}var Tu=p("ZodTransform",(e,t)=>{ir(),Zo.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Vi(e,r,n,o),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new be(e.constructor.name);r.addIssue=(i)=>{if(typeof i==="string")r.issues.push(ue(i,r.value,t));else{let s=i;if(s.fatal)s.continue=!1;if(s.code??(s.code="custom"),!("input"in s))s.input=r.value;s.inst??(s.inst=e),r.issues.push(ue(s))}};let o=t.transform(r.value,r);if(o instanceof Promise)return o.then((i)=>(r.value=i,r));return r.value=o,r}});function Nu(e){return new Tu({type:"transform",transform:e})}var Ps=p("ZodOptional",(e,t)=>{Ct.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>rr(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function vs(e){return new Ps({type:"optional",innerType:e})}var Ss=p("ZodExactOptional",(e,t)=>{Po.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>rr(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Cu(e){return new Ss({type:"optional",innerType:e})}var Ru=p("ZodNullable",(e,t)=>{So.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>qi(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function zs(e){return new Ru({type:"nullable",innerType:e})}var Du=p("ZodDefault",(e,t)=>{Oo.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ts(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function ju(e,t){return new Du({type:"default",innerType:e,get defaultValue(){return typeof t==="function"?t():ht(t)}})}var Lu=p("ZodPrefault",(e,t)=>{Io.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>rs(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Mu(e,t){return new Lu({type:"prefault",innerType:e,get defaultValue(){return typeof t==="function"?t():ht(t)}})}var Os=p("ZodNonOptional",(e,t)=>{Eo.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Qi(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Fu(e,t){return new Os({type:"nonoptional",innerType:e,...g(t)})}var Uu=p("ZodCatch",(e,t)=>{Ao.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ns(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Bu(e,t){return new Uu({type:"catch",innerType:e,catchValue:typeof t==="function"?t:wr(t)})}var Ju=p("ZodPipe",(e,t)=>{To.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>os(e,r,n,o),e.in=t.in,e.out=t.out});function $s(e,t){return new Ju({type:"pipe",in:e,out:t})}var Gu=p("ZodReadonly",(e,t)=>{No.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>is(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Ku(e){return new Gu({type:"readonly",innerType:e})}var Vu=p("ZodCustom",(e,t)=>{Co.init(e,t),P.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ki(e,r,n,o)});function Wu(e,t={}){return $i(Vu,e,t)}function Xu(e,t){return wi(e,t)}var Hu=ut(["version","top","git-directory","common-directory","head","remotes","numstat-head","numstat-cached","status","index-identity","refs-identity","config-identity"]),Es={version:["--version"],top:["rev-parse","--show-toplevel"],"git-directory":["rev-parse","--absolute-git-dir"],"common-directory":["rev-parse","--path-format=absolute","--git-common-dir"],head:["rev-parse","--verify","--quiet","HEAD"],remotes:["remote"],"numstat-head":["diff","--numstat","HEAD"],"numstat-cached":["diff","--numstat","--cached"],status:["status","--porcelain=v1","-z","--branch","--ignored=traditional"],"index-identity":["ls-files","--stage","-z","--"],"refs-identity":["for-each-ref","--format=%(refname) %(objectname) %(symref)"],"config-identity":["config","--null","--list","--includes","--show-origin"]},sr=Y({directory:V().min(1).max(4096),gitDirectory:V().min(1).max(4096),commonDirectory:V().min(1).max(4096)}).strict(),Ep=Y({type:le("git-status-run-v1"),id:D().int().positive().max(Number.MAX_SAFE_INTEGER),operation:Hu,directory:V().min(1).max(4096),executable:V().min(1).max(4096),repository:sr.optional()}).strict(),Ap=Y({type:le("git-status-abort-v1"),id:D().int().positive().max(Number.MAX_SAFE_INTEGER)}).strict(),Tp=Y({type:le("git-status-result-v1"),id:D().int().positive(),code:D().int(),stdout:V().max(3145728),truncated:R(),cancelled:R(),timedOut:R(),notRepository:R(),stderrPresent:R()}).strict();var at=100663296;var As={type:le("git-blob-run-v1"),id:D().int().positive().max(Number.MAX_SAFE_INTEGER),directory:V().min(1).max(4096),executable:V().min(1).max(4096)},Yu=ut(["version","top","git-directory","common-directory"]),qu=V().min(1).max(4096).refine((e)=>!e.includes("\x00")&&!e.startsWith("/")&&e.split("/").every((t)=>t!==""&&t!=="."&&t!=="..")),Ts=Zs([Y({...As,operation:Yu}).strict(),Y({...As,operation:ut(["show-head","show-index","show-ours"]),repository:sr,path:qu,maxBytes:D().int().positive().max(at)}).strict()]),Ns=Y({type:le("git-blob-abort-v1"),id:D().int().positive().max(Number.MAX_SAFE_INTEGER)}).strict(),Cs=D().int().positive().max(Number.MAX_SAFE_INTEGER),Lp=Y({type:le("git-blob-chunk-v1"),id:Cs,offset:D().int().nonnegative().max(at),bytes:V().min(4).max(87384).regex(/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/)}).strict(),Mp=Y({type:le("git-blob-result-v1"),id:Cs,code:D().int(),size:D().int().nonnegative().max(Number.MAX_SAFE_INTEGER),kept:D().int().nonnegative().max(at),cancelled:R(),timedOut:R(),overflow:R(),spawnFailed:R(),notRepository:R(),absent:R(),missingStageZero:R(),stderrPresent:R()}).strict();var Rs=["--no-pager","-c","core.fsmonitor=false","-c","gc.auto=0","-c","maintenance.auto=false"],Ds=(e)=>e?[`--git-dir=${e.gitDirectory}`,`--work-tree=${e.directory}`]:[];function js(e){let t=/^git version (\d+)\.(\d+)/.exec(e);return!!t&&(+t[1]>2||+t[1]===2&&+t[2]>=36)}var Qu=(e="1")=>({GIT_OPTIONAL_LOCKS:"0",GIT_LITERAL_PATHSPECS:e,GIT_TERMINAL_PROMPT:"0",GIT_PAGER:"cat",LC_ALL:"C"});function Ls(e,t){let r={...process.env,...Qu()};for(let n of e)delete r[n];if(t)r.GIT_COMMON_DIR=t.commonDirectory;return r}function Ms(e){let t;return{terminate(){if(e.exitCode!==null||e.signalCode!==null)return;if(e.kill("SIGTERM"),t===void 0)t=setTimeout(()=>e.kill("SIGKILL"),500),t.unref()},clear(){if(t!==void 0)clearTimeout(t)}}}function Fs(e,t,r){let n=Buffer.alloc(0);return(o)=>{if(n=Buffer.concat([n,o]),n.length>e){t();return}for(;;){let i=n.indexOf(10);if(i<0)return;let s=n.subarray(0,i);n=n.subarray(i+1);let c;try{c=JSON.parse(s.toString("utf8"))}catch{t();return}if(r(c)===!1)return}}}var lt=!1,cr,Us=!1,oe,Gs=()=>process.stdout.write("",()=>process.exit(0)),ie=()=>{if(lt=!0,oe?.child.stdout.resume(),oe?.cancel(),!oe)Gs()};process.on("SIGTERM",ie);process.on("SIGINT",ie);process.stdin.on("end",ie);process.stdin.on("error",ie);process.stdout.on("error",ie);var ea=Fs(65536,ie,(e)=>{let t=Ns.safeParse(e);if(t.success){if(oe?.id===t.data.id)oe.cancel();return}let r=Ts.safeParse(e);if(!r.success||oe)return ie(),!1;let n=r.data,o="repository"in n?n.repository:void 0;if(![n.directory,n.executable,...Object.values(o??{})].every(Js.isAbsolute)||cr!==void 0&&cr!==n.executable||n.operation!=="version"&&!Us)return ie(),!1;cr=n.executable;let i=Ls(["GIT_DIR","GIT_WORK_TREE","GIT_COMMON_DIR"],o),s="path"in n,c=s?`${n.operation==="show-head"?"HEAD":n.operation==="show-ours"?":2":""}:${n.path}`:void 0,u=s?["show","--no-textconv","--no-ext-diff",c]:[...Es[n.operation]],a=[...Rs,...Ds(o),...u],l=Bs.spawn(n.executable,a,{cwd:n.directory,env:{...i,HOME:process.env.HOME,USERPROFILE:process.env.USERPROFILE},windowsHide:!0,stdio:["pipe","pipe","pipe"]});l.stdin.on("error",()=>{return}),l.stdin.end();let f=0,d=0,m=Buffer.alloc(0),h=Buffer.alloc(0),x=!1,_=!1,b=!1,E=!1,q=!1,Q=Ms(l),z=Q.terminate,v=setTimeout(()=>{_=!0,l.stdout.resume(),z()},s?30000:1e4);v.unref(),oe={id:n.id,child:l,cancel(){x=!0,l.stdout.resume(),z()}};let A=s?n.maxBytes:65536;l.stdout.on("data",(j)=>{if(f+=j.length,!Number.isSafeInteger(f)){b=!0,z();return}if(n.operation==="version"&&h.length<65536)h=Buffer.concat([h,j.subarray(0,65536-h.length)]);if(lt)return;let U=j.subarray(0,Math.max(0,A-d));for(let se=0;se<U.length;se+=65536){let Oe=U.subarray(se,se+65536),pt=JSON.stringify({type:"git-blob-chunk-v1",id:n.id,offset:d,bytes:Oe.toString("base64")})+`
|
|
59
|
+
`;if(d+=Oe.length,!process.stdout.write(pt))l.stdout.pause(),process.stdout.once("drain",()=>l.stdout.resume())}if(!s&&f>A)b=!0,z()}),l.stderr.on("data",(j)=>{if(m.length<65536)m=Buffer.concat([m,j.subarray(0,65536-m.length)])});let pe=()=>{q=!0,l.stdout.resume(),z()};l.stdout.on("error",pe),l.stderr.on("error",pe),l.on("error",()=>{E=!0}),l.on("close",(j)=>{if(clearTimeout(v),Q.clear(),n.operation==="version"&&j===0&&!b&&!_&&!x)Us=js(h.toString("utf8"));let U=m.toString("utf8");if(process.stdout.write(JSON.stringify({type:"git-blob-result-v1",id:n.id,code:q?127:j??127,size:f,kept:d,cancelled:x,timedOut:_,overflow:b,spawnFailed:E,notRepository:/not a git repository/i.test(U),absent:/does not exist|exists on disk, but not in|not in the index|invalid object name|bad revision|unknown revision/i.test(U),missingStageZero:/not at stage 0/i.test(U),stderrPresent:m.length>0})+`
|
|
60
|
+
`),oe=void 0,lt)Gs()})});process.stdin.on("data",(e)=>{if(!lt)ea(e)});
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
var __aigdRuntimeUrl=require("node:url").pathToFileURL(__filename).href;
|
|
2
|
+
var Cs=require("node:child_process"),er=require("node:path");function ue(e){let t=Object.values(e).filter((n)=>typeof n==="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}function ot(e,t="|"){return e.map((r)=>ct(r)).join(t)}function ae(e,t){if(typeof t==="bigint")return t.toString();return t}class or{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;if(e!==void 0)this._value=e(),this._getter=void 0;return this._value}}function be(e){return new or(e)}function ir(e){return e===null||e===void 0}function ve(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function sr(e,t){let r=e/t,n=Math.round(r),o=4*Number.EPSILON*Math.max(Math.abs(r),1);if(Math.abs(r-n)<o)return 0;return r-n}function L(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function ze(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function B(e){return ze(e._zod.def)??e._zod.def.shape}function cr(e,t,r){Object.defineProperty(e,t,{get(){let n=r();return L(this,t,n),n},enumerable:!0,configurable:!0})}function ur(e,t,r){if(t in e)L(e,t,r);else e[t]=r}function Y(e,t,r,n){let o=B(t);for(let i of r){let s=Object.getOwnPropertyDescriptor(o,i);if(!s.enumerable)continue;if(s.get)cr(e,i,()=>{let c=t._zod.def.shape[i];return n?n(c,i):c});else ur(e,i,n?n(s.value,i):s.value)}}function js(e,t){for(let r of Reflect.ownKeys(t)){let n=Object.getOwnPropertyDescriptor(t,r);if(!n.enumerable)continue;if(n.get)cr(e,r,()=>t[r]);else ur(e,r,n.value)}}function A(...e){let t={};for(let r of e){let n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}function ar(e){return JSON.stringify(e)}function lr(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var it="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ce(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}var pr=be(()=>{if(E.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function ee(e){if(ce(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;if(typeof t!=="function")return!0;let r=t.prototype;if(ce(r)===!1)return!1;if(Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)return!1;return!0}function st(e){if(ee(e))return{...e};if(Array.isArray(e))return[...e];if(e instanceof Map)return new Map(e);if(e instanceof Set)return new Set(e);return e}var fr=new Set(["string","number","symbol"]);function W(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function F(e,t,r){let n=new e._zod.constr(t??e._zod.def);if(!t||r?.parent)n._zod.parent=e;return n}function g(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 Error("Cannot specify both `message` and `error` params");t.error=t.message}if(delete t.message,typeof t.error==="string")return{...t,error:()=>t.error};return t}function ct(e){if(typeof e==="bigint")return e.toString()+"n";if(typeof e==="string")return`"${e}"`;return`${e}`}function dr(e){return Object.keys(e).filter((t)=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var $e=(()=>({safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]}))(),ut={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Ls(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let i={};return Y(i,e,we(e,t)),F(e,A(r,{shape:i,checks:[]}))}function we(e,t){let r=B(e),n=[];for(let o of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(r,o)?.enumerable)throw Error(`Unrecognized key: "${String(o)}"`);if(t[o])n.push(o)}return n}function Fs(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let i=new Set(we(e,t)),s={};return Y(s,e,Reflect.ownKeys(B(e)).filter((c)=>!i.has(c))),F(e,A(r,{shape:s,checks:[]}))}function Ms(e,t){if(!ee(t))throw Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let o=B(e);for(let i of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(o,i)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return F(e,A(e._zod.def,{shape:mr(e,t)}))}function mr(e,t){let r={};return Y(r,e,Reflect.ownKeys(B(e))),js(r,t),r}function Us(e,t){if(!ee(t))throw Error("Invalid input to safeExtend: expected a plain object");return F(e,A(e._zod.def,{shape:mr(e,t)}))}function Bs(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r={};Y(r,e,Reflect.ownKeys(B(e))),Y(r,t,Reflect.ownKeys(B(t)));let n=A(e._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return F(e,n)}function hr(e,t,r,n="partial"){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${n}() cannot be used on object schemas containing refinements`);let c=r?new Set(we(t,r)):void 0,u={};return Y(u,t,Reflect.ownKeys(B(t)),e&&((a,p)=>c&&!c.has(p)?a:new e({type:"optional",innerType:a}))),F(t,A(t._zod.def,{shape:u,checks:[]}))}function Js(e,t,r){let n=r?new Set(we(t,r)):void 0,o={};return Y(o,t,Reflect.ownKeys(B(t)),(i,s)=>n&&!n.has(s)?i:new e({type:"nonoptional",innerType:i})),F(t,A(t._zod.def,{shape:o}))}function M(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 gr(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 ke(e,t){return t.map((r)=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function se(e){return typeof e==="string"?e:e?.message}function at(e){let t=[];for(let r of e??[]){let n=r._zod.def;if(!/_(length|size)$|_equals$/.test(n.check))break;let o=n.maximum??n.length??n.size;if(o>=0)t.push([o,r])}return t}function Ze(e,t,r){var n;for(let o=t;o<e.length;o++)(n=e[o]).schema??(n.schema=r)}function X(e,t,r){var n;let o=e.inst?._zod?.traits;if(o?.has("$ZodType"))if(o.has("$ZodCheck"))(n=e).schema??(n.schema=e.inst);else e.schema=e.inst;let i=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,s=e.message?e.message:se(e.inst?._zod.def?.error?.(e))??se(i?.(e))??se(t?.error?.(e))??se(r.customError?.(e))??se(r.localeError?.(e))??"Invalid input",c={};for(let u of Object.keys(e)){if(u==="inst"||u==="schema"||u==="continue"||u==="input"||u==="__proto__")continue;c[u]=e[u]}if(c.path??(c.path=[]),c.message=s,t?.reportInput)c.input=e.input;return c}var Ks=/[\uD800-\uDBFF]/;function Pe(e){let t=e.length;if(!Ks.test(e))return t;let r=t;for(let n=0;n<t-1;n++)if((e.charCodeAt(n)&64512)===55296&&(e.charCodeAt(n+1)&64512)===56320)r--,n++;return r}function Se(e){if(Array.isArray(e))return"array";if(typeof e==="string")return"string";return"unknown"}function _r(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 q(...e){let[t,r,n]=e;if(typeof t==="string")return{message:t,code:"custom",input:r,inst:n};return{...t}}function xr(e,t){for(let r in t){let n=Object.getOwnPropertyDescriptor(t,r);if(n.get)Object.defineProperty(e,r,{...n,enumerable:!1});else Vs(e,r,n.value)}}function J(e,t,r,n=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:n,value:r}),r}function Oe(e,t,r){return J(e,t,r,!1)}function yr(e,t){for(let r in e){let n=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,get(){return J(this,r,n(this))},set(o){J(this,r,o)}})}return t}function Vs(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:J(this,t,r.bind(this))},set(n){J(this,t,n)}})}function Gs(e,t){let r=Object.getPrototypeOf(e);return t in r?void 0:r}var nt,G=!1,Ws={configurable:!0,get(){G=!0;return}};function y(e,t,r){let n=Object.getPrototypeOf(e._zod);if(t in n&&nt!==e._zod){nt=void 0;return}nt=e._zod,Object.defineProperty(n,t,{configurable:!0,get(){Object.defineProperty(this,t,Ws);let o=G;G=!1;try{let i=r(this);if(G)delete this[t];else Object.defineProperty(this,t,{configurable:!0,writable:!0,value:i});return G=G||o,i}catch(i){throw delete this[t],G=G||o,i}},set(o){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:o})}})}function Xs(e,t,r,n){let o=Gs(e,t);if(!o)return;Object.defineProperty(o,t,{configurable:!0,get(){let i={configurable:!0,writable:!0,enumerable:n,value:void 0};return Object.defineProperty(this,t,i),i.value=r(this),Object.defineProperty(this,t,i),i.value},set(i){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:n,value:i})}})}var Hs="~constantCatch";function br(e){let t=()=>e;return t[Hs]=!0,t}var vr;var lt={value:void 0,enumerable:!1},zr="captureStackTrace"in Error?Error:null;function Ys(e){let t=zr;if(t){let r=t.stackTraceLimit;if(typeof r==="number"){try{t.stackTraceLimit=0}catch{return zr=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}function l(e,t,r,n){let o={};function i(d){this.def=d,this.constr=f,this.traits=new Set}i.prototype=o;let s=r,c=s&&new WeakSet;function u(d,m){if(!d._zod){lt.value=new i(m);try{Object.defineProperty(d,"_zod",lt)}finally{lt.value=void 0}}else if(d._zod.traits.has(e))return;if(d._zod.traits.add(e),t(d,m),c){let _=Object.getPrototypeOf(d),x=d._zod.constr.prototype,b=_;while(b&&b!==x)b=Object.getPrototypeOf(b);let D=b??_;if(!c.has(D))c.add(D),xr(D,s)}let h=f.prototype;for(let _ in h){if(!Object.prototype.hasOwnProperty.call(h,_))continue;if(!(_ in d))d[_]=h[_].bind(d)}}let a=n?.Parent??Object;class p extends a{}Object.defineProperty(p,"name",{value:e});function f(d){let m=n?.Parent?Ys(p):this;u(m,d);let h=m._zod.deferred;if(h){for(let x of h)x();m._zod.deferred=void 0}let _=globalThis.__zod_globalConfig?.postProcessor;if(_)_(m);return m}return Object.defineProperty(f,"init",{value:u}),Object.defineProperty(f,Symbol.hasInstance,{value:(d)=>{if(n?.Parent&&d instanceof n.Parent)return!0;return d?._zod?.traits?.has(e)}}),Object.defineProperty(f,"name",{value:e}),f}class U extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class le extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`);this.name="ZodEncodeError"}}(vr=globalThis).__zod_globalConfig??(vr.__zod_globalConfig={});var E=globalThis.__zod_globalConfig;function C(e){if(e)Object.assign(E,e);return E}function qs(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,ae,2)),e.message}function Qs(e){this._zod.message=e}var ec={get:qs,set:Qs,enumerable:!0,configurable:!0},ft={value:void 0,enumerable:!1},$r=new WeakSet([Object.prototype,Error.prototype]),wr=(e,t)=>{e.name="$ZodError",ft.value=t,Object.defineProperty(e,"issues",ft),ft.value=void 0,Object.defineProperty(e,"message",ec);let r=Object.getPrototypeOf(e);if(!$r.has(r))$r.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){let n=()=>this.message;return Object.defineProperty(this,"toString",{value:n,configurable:!0,writable:!0}),n},set(n){Object.defineProperty(this,"toString",{value:n,configurable:!0,writable:!0})}})},kr=l("$ZodError",wr),Wu=l("$ZodError",wr,void 0,{Parent:Error});function tc(e,t,r){if(!Object.prototype.hasOwnProperty.call(e,t))if(t==="__proto__")Object.defineProperty(e,t,{value:r(),writable:!0,enumerable:!0,configurable:!0});else e[t]=r();return e[t]}function Zr(e,t=(r)=>r.message){let r={},n=[];for(let o of e.issues)if(o.path.length>0)tc(r,o.path[0],()=>[]).push(t(o));else n.push(t(o));return{formErrors:n,fieldErrors:r}}function Pr(e,t=(r)=>r.message){let r={_errors:[]},n=(o,i=[])=>{for(let s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map((c)=>n({issues:c},[...i,...s.path]));else if(s.code==="invalid_key")n({issues:s.issues},[...i,...s.path]);else if(s.code==="invalid_element")n({issues:s.issues},[...i,...s.path]);else{let c=[...i,...s.path];if(c.length===0)r._errors.push(t(s));else{let u=r,a=0;while(a<c.length){let p=c[a],f=a===c.length-1;if(p==="_errors"){if(f)u._errors.push(t(s));a++;continue}if(!Object.prototype.hasOwnProperty.call(u,p))Object.defineProperty(u,p,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let d=u[p];if(f)d._errors.push(t(s));u=d,a++}}}};return n(e),r}function Ie(e,t){return{callee:t?.callee??e,Err:t?.Err}}var Ae=(e)=>{let t=(r,n,o,i)=>{let s=o?{...o,async:!1}:{async:!1},c=r._zod.run({value:n,issues:[]},s);if(c instanceof Promise)throw new U;if(c.issues.length){let u=new(i?.Err??e)(c.issues.map((a)=>X(a,s,C())));throw it(u,i?.callee??t),u}return c.value};return t};var Ee=(e)=>{let t=async(r,n,o,i)=>{let s=o?{...o,async:!0}:{async:!0},c=r._zod.run({value:n,issues:[]},s);if(c instanceof Promise)c=await c;if(c.issues.length){let u=new(i?.Err??e)(c.issues.map((a)=>X(a,s,C())));throw it(u,i?.callee??t),u}return c.value};return t};var Te=(e)=>(t,r,n)=>{let o=n?{...n,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise)throw new U;return i.issues.length?Sr(e,i.issues,o):{success:!0,data:i.value}};function Sr(e,t,r){let n;return{success:!1,get error(){if(!n)n=new e(t.map((o)=>X(o,r,C()))),t=void 0,r=void 0;return n},set error(o){n=o,t=void 0,r=void 0}}}var Ne=(e)=>async(t,r,n)=>{let o=n?{...n,async:!0}:{async:!0},i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise)i=await i;return i.issues.length?Sr(e,i.issues,o):{success:!0,data:i.value}};var rc=Symbol.for("zod.compile.invalid"),nc=Symbol.for("zod.compile.fallback"),dt=(e,t,r)=>{let n=e._zod.bag.validator;if(n!==void 0){if(n(t)!==rc)return!0;if(n.definite===!0&&r===void 0)return!1}return oc(e,t,r)};function oc(e,t,r){let n=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},o=e._zod.bag.fallbackRun,i;if(o)n[nc]=!0,i=o({value:t,issues:[]},n);else i=e._zod.run({value:t,issues:[]},n);if(i instanceof Promise)throw new U;return i.issues.length===0}var mt=async(e,t,r)=>{let n=r?{...r,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},o=e._zod.run({value:t,issues:[]},n);if(o instanceof Promise)o=await o;return o.issues.length===0},Or=(e)=>{let t=Ae(e),r=(n,o,i,s)=>{let c=i?{...i,direction:"backward"}:{direction:"backward"};return t(n,o,c,Ie(r,s))};return r};var Ir=(e)=>{let t=Ae(e),r=(n,o,i,s)=>t(n,o,i,Ie(r,s));return r};var Ar=(e)=>{let t=Ee(e),r=async(n,o,i,s)=>{let c=i?{...i,direction:"backward"}:{direction:"backward"};return await t(n,o,c,Ie(r,s))};return r};var Er=(e)=>{let t=Ee(e),r=async(n,o,i,s)=>await t(n,o,i,Ie(r,s));return r};var Tr=(e)=>(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return Te(e)(t,r,o)};var Nr=(e)=>(t,r,n)=>Te(e)(t,r,n);var Cr=(e)=>async(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return Ne(e)(t,r,o)};var Rr=(e)=>async(t,r,n)=>Ne(e)(t,r,n);var Dr=/^[cC][0-9a-z]{6,}$/,jr=/^[0-9a-z]+$/,Lr=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Fr=/^[0-9a-vA-V]{20}$/,Mr=/^[A-Za-z0-9]{27}$/,Ur=/^[a-zA-Z0-9_-]{21}$/;function Br(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var Jr=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var Kr=/^([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})$/,gt=(e)=>{if(!e)return/^([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)$/;return 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})$`)};var Vr=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var ic="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function Gr(){return new RegExp(ic,"u")}var Wr=/^(?:(?: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])$/,Xr=/^(([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 Hr=/^((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])$/,Yr=/^(([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}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,qr=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Qr=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/;var en=/^https?$/,tn=/^\+[1-9]\d{6,14}$/;var rn="(?:(?:\\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])))";function sc(e){return new RegExp(`^${e}$`)}var nn=sc(rn);function ht(e){return typeof e.precision==="number"?e.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":e.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?":"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function on(e){return new RegExp(`^${ht(e)}$`)}function sn(e){let t=["Z"];if(e.offset)t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${ht({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,n=e.local?`${r}|${ht({precision:e.precision})}`:r;return new RegExp(`^${rn}T(?:${n})$`)}var cn=/^[\s\S]{0,}$/;var _t=/^-?\d+(?:\.\d+)?$/,un=/^(?:true|false)$/i;var an=/^[^A-Z]*$/,ln=/^[^a-z]*$/;var O=l("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var xt=(e)=>{let t=e.value;return!ir(t)&&t.length!==void 0},Ce={number:"number",bigint:"bigint",object:"date"},yt=l("$ZodCheckLessThan",(e,t)=>{O.init(e,t);let r=Ce[typeof t.value];e._zod.check=(n)=>{if(t.inclusive?n.value<=t.value:n.value<t.value)return;n.issues.push({origin:Ce[typeof n.value]??r,code:"too_big",maximum:typeof t.value==="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),bt=l("$ZodCheckGreaterThan",(e,t)=>{O.init(e,t);let r=Ce[typeof t.value];e._zod.check=(n)=>{if(t.inclusive?n.value>=t.value:n.value>t.value)return;n.issues.push({origin:Ce[typeof n.value]??r,code:"too_small",minimum:typeof t.value==="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),pn=l("$ZodCheckMultipleOf",(e,t)=>{O.init(e,t),e._zod.check=(r)=>{if(typeof r.value!==typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof r.value==="bigint"?t.value!==BigInt(0)&&r.value%t.value===BigInt(0):sr(r.value,t.value)===0)return;r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),fn=l("$ZodCheckNumberFormat",(e,t)=>{O.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[o,i]=$e[t.format];e._zod.check=(s)=>{let c=s.value;if(r){if(!Number.isInteger(c)){s.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){if(c>0)s.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});else s.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}if(c<o)s.issues.push({origin:"number",input:c,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort});if(c>i)s.issues.push({origin:"number",input:c,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}});var dn=l("$ZodCheckMaxLength",(e,t)=>{var r;O.init(e,t),(r=e._zod.def).when??(r.when=xt),e._zod.check=(n)=>{let o=n.value,i=o.length;if((typeof o==="string"&&i>t.maximum?Pe(o):i)<=t.maximum)return;let c=Se(o);n.issues.push({origin:c,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),mn=l("$ZodCheckMinLength",(e,t)=>{var r;O.init(e,t),(r=e._zod.def).when??(r.when=xt),e._zod.check=(n)=>{let o=n.value,i=o.length;if((typeof o==="string"&&i>=t.minimum&&i<t.minimum*2?Pe(o):i)>=t.minimum)return;let c=Se(o);n.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),hn=l("$ZodCheckLengthEquals",(e,t)=>{var r;O.init(e,t),(r=e._zod.def).when??(r.when=xt),e._zod.check=(n)=>{let o=n.value,i=o.length,s=typeof o==="string"&&i>=t.length&&i<=t.length*2?Pe(o):i;if(s===t.length)return;let c=Se(o),u=s>t.length;n.issues.push({origin:c,...u?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),fe=l("$ZodCheckStringFormat",(e,t)=>{var r,n;if(O.init(e,t),t.pattern)(r=e._zod).check??(r.check=(o)=>{if(t.pattern.lastIndex=0,t.pattern.test(o.value))return;o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})});else(n=e._zod).check??(n.check=()=>{})}),gn=l("$ZodCheckRegex",(e,t)=>{fe.init(e,t),e._zod.check=(r)=>{if(t.pattern.lastIndex=0,t.pattern.test(r.value))return;r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),_n=l("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=an),fe.init(e,t)}),xn=l("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=ln),fe.init(e,t)}),yn=l("$ZodCheckIncludes",(e,t)=>{O.init(e,t);let r=W(t.includes),n=new RegExp(typeof t.position==="number"?`^.{${t.position},}${r}`:r);t.pattern=n,e._zod.check=(o)=>{if(o.value.includes(t.includes,t.position))return;o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),bn=l("$ZodCheckStartsWith",(e,t)=>{O.init(e,t);let r=new RegExp(`^${W(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.check=(n)=>{if(n.value.startsWith(t.prefix))return;n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),vn=l("$ZodCheckEndsWith",(e,t)=>{O.init(e,t);let r=new RegExp(`.*${W(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.check=(n)=>{if(n.value.endsWith(t.suffix))return;n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});var zn=l("$ZodCheckOverwrite",(e,t)=>{O.init(e,t),e._zod.check=(r)=>{r.value=t.tx(r.value)}});class vt{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{this.indent-=1}}write(e){if(typeof e==="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let r=e.split(`
|
|
3
|
+
`).filter((i)=>i),n=Math.min(...r.map((i)=>i.length-i.trimStart().length)),o=r.map((i)=>i.slice(n)).map((i)=>" ".repeat(this.indent*2)+i);for(let i of o)this.content.push(i)}compile(){let e=Function,t=this?.content??[""];return new e(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
|
|
4
|
+
${t.join(`
|
|
5
|
+
`)}
|
|
6
|
+
};`)(...Object.values(this.closed))}}var wn={major:4,minor:6,patch:7};var w=l("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=wn;let n=e._zod.def.checks,o=e._zod.traits.has("$ZodCheck")?[e,...n??[]]:n?.length?[...n]:[];for(let i of o)for(let s of i._zod.onattach)s(e);if(o.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=(c,u,a)=>{if(c.memo)return c;let p=M(c),f;for(let d of u){if(d._zod.def.when){if(gr(c))continue;if(!d._zod.def.when(c))continue}else if(p)continue;let m=c.issues.length,h=d._zod.check(c);if(h instanceof Promise&&a?.async===!1)throw new U;if(f||h instanceof Promise)f=(f??Promise.resolve()).then(async()=>{if(await h,c.issues.length===m)return;if(Ze(c.issues,m,e),!p)p=M(c,m)});else{if(c.issues.length===m)continue;if(Ze(c.issues,m,e),!p)p=M(c,m)}}if(f)return f.then(()=>c);return c},s=(c,u,a)=>{if(M(c))return c.aborted=!0,c;let p=i(u,o,a);if(p instanceof Promise){if(a.async===!1)throw new U;return p.then((f)=>e._zod.parse(f,a))}return e._zod.parse(p,a)};e._zod.run=(c,u)=>{if(u.skipChecks)return e._zod.parse(c,u);if(u.direction==="backward"){let p=e._zod.parse({value:c.value,issues:[]},{...u,skipChecks:!0});if(p instanceof Promise)return p.then((f)=>s(f,c,u));return s(p,c,u)}let a=e._zod.parse(c,u);if(a instanceof Promise){if(u.async===!1)throw new U;return a.then((p)=>i(p,o,u))}return i(a,o,u)}}},{get "~standard"(){return Oe(this,"~standard",$t(this))},set "~standard"(e){J(this,"~standard",e)}}),Cn=(e,t)=>e.issues.length?{issues:e.issues.map((r)=>X(r,t,C()))}:{value:e.value};async function uc(e,t){let r={async:!0};return Cn(await e._zod.run({value:t,issues:[]},r),r)}function $t(e){return{validate:(t)=>{let r={async:!1};try{let n=e._zod.run({value:t,issues:[]},r);if(!(n instanceof Promise))return Cn(n,r)}catch(n){}return uc(e,t)},vendor:"zod",version:1}}var Le=l("$ZodString",(e,t)=>{w.init(e,t),e._zod.pattern=t.pattern??cn,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch(o){}if(typeof r.value==="string")return r;return r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),z=l("$ZodStringFormat",(e,t)=>{fe.init(e,t),Le.init(e,t)}),Rn=l("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Kr),z.init(e,t)}),Dn=l("$ZodUUID",(e,t)=>{if(t.version){let n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(n===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=gt(n))}else t.pattern??(t.pattern=gt());z.init(e,t)}),jn=l("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Vr),z.init(e,t)}),Ln=1,De=2;function Fn(e){try{if(typeof URL<"u"&&typeof URL.canParse==="function")return URL.canParse(e);return new URL(e),!0}catch{return!1}}function ac(e,t){if(!("normalize"in t)&&!("hostname"in t)&&!("protocol"in t))return Fn(e)||De;return lc(e,t)}function lc(e,t){if(!t.normalize&&t.protocol?.source===en.source&&!/^https?:\/\//i.test(e))return Ln;try{if(typeof URL<"u"){let r=URL;if(typeof r.parse==="function")return r.parse(e)??De}return new URL(e)}catch{return De}}var pc=/[\t\n\r]/g;function kn(e){return e.replace(pc,"")}function fc(e,t){return t.lastIndex=0,t.test(e.hostname)}function dc(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}var Mn=l("$ZodURL",(e,t)=>{z.init(e,t),e._zod.check=(r)=>{try{let n=r.value.trim(),o=ac(n,t);if(o===Ln){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}if(o===De){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort});return}if(o===!0){r.value=kn(n);return}if(t.hostname&&!fc(o,t.hostname))r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort});if(t.protocol&&!dc(o,t.protocol))r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort});r.value=t.normalize?o.href:kn(n);return}catch(n){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),Un=l("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Gr()),z.init(e,t)}),Bn=l("$ZodNanoID",(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=t.length===void 0?Ur:Br(t.length)),z.init(e,t)}),Jn=l("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Dr),z.init(e,t)}),Kn=l("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=jr),z.init(e,t)}),Vn=l("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Lr),z.init(e,t)}),Gn=l("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Fr),z.init(e,t)}),Wn=l("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Mr),z.init(e,t)}),Xn=l("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=sn(t)),z.init(e,t)}),Hn=l("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=nn),z.init(e,t)}),Yn=l("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=on(t)),z.init(e,t)}),qn=l("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Jr),z.init(e,t)}),Qn=l("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Wr),z.init(e,t)}),mc=/^[0-9a-fA-F:.]+$/;function eo(e){if(!mc.test(e))return!1;return Fn(`http://[${e}]`)}var to=l("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Xr),z.init(e,t),e._zod.check=(r)=>{if(!eo(r.value))r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}});var ro=l("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Hr),z.init(e,t)});function hc(e){let t=e.split("/");if(t.length!==2)return!1;let[r,n]=t;if(!n)return!1;let o=Number(n);if(`${o}`!==n)return!1;if(o<0||o>128)return!1;return eo(r)}var no=l("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Yr),z.init(e,t),e._zod.check=(r)=>{if(!hc(r.value))r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}});function oo(e){if(e==="")return!0;if(/\s/.test(e))return!1;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var wt=/^[0-9a-zA-Z+/]*={0,2}$/,io=l("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=wt),z.init(e,t),e._zod.check=(r)=>{if(oo(r.value))return;r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}}),Fe=/^[A-Za-z0-9_-]*$/;function gc(e){if(!Fe.test(e))return!1;let t=e.replace(/[-_]/g,(n)=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return oo(r)}var so=l("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Fe),z.init(e,t),e._zod.check=(r)=>{if(gc(r.value))return;r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),co=l("$ZodE164",(e,t)=>{t.pattern??(t.pattern=tn),z.init(e,t)});function _c(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[n]=r;if(!n)return!1;let o=JSON.parse(atob(n));if("typ"in o&&o?.typ!=="JWT")return!1;if(!o.alg)return!1;if(t&&(!("alg"in o)||o.alg!==t))return!1;return!0}catch{return!1}}var uo=l("$ZodJWT",(e,t)=>{z.init(e,t),e._zod.check=(r)=>{if(_c(r.value,t.alg))return;r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}});var kt=l("$ZodNumber",(e,t)=>{w.init(e,t),e._zod.pattern=_t,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch(s){}let o=r.value;if(typeof o==="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let i=typeof o==="number"?Number.isNaN(o)?"NaN":!Number.isFinite(o)?String(o):void 0:void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...i?{received:i}:{}}),r}}),ao=l("$ZodNumberFormat",(e,t)=>{fn.init(e,t),kt.init(e,t)}),lo=l("$ZodBoolean",(e,t)=>{w.init(e,t),e._zod.pattern=un,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Boolean(r.value)}catch(i){}let o=r.value;if(typeof o==="boolean")return r;return r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),r}});var po=l("$ZodUnknown",(e,t)=>{w.init(e,t),e._zod.parse=(r)=>r}),fo=l("$ZodNever",(e,t)=>{w.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function xc(e,t){let r=at(e._zod.def.checks);if(!r.length)return;let n=Math.min(...r.map((i)=>i[0])),o=e._zod.parse;e._zod.parse=(i,s)=>{let c=t(i.value);if(c>n&&!s?.skipChecks&&s?.direction!=="backward"){for(let[u,a]of at(e._zod.def.checks))if(c>u&&a._zod.def.when(i)){let p=i.issues.length;return a._zod.check(i),i.issues[p].continue=!1,Ze(i.issues,p,e),i}}return o(i,s)}}var yc=(e)=>Array.isArray(e)?e.length:-1;function Zn(e,t,r){if(e.issues.length)t.issues.push(...ke(r,e.issues));t.value[r]=e.value}var mo=l("$ZodArray",(e,t)=>{w.init(e,t);let r=E.memoizer;r?.attach(e),e._zod.parse=(n,o)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=r?r.alloc(e,n,Array(i.length),o):Array(i.length);let s=[],c=o?.abortEarly;for(let u=0;u<i.length;u++){let a=i[u],p=t.element._zod.run({value:a,issues:[]},o);if(p instanceof Promise)s.push(p.then((f)=>Zn(f,n,u)));else if(Zn(p,n,u),c&&p.issues.length!==0&&M(p))break}if(s.length)return Promise.all(s).then(()=>n);return n},xc(e,yc)});function je(e,t,r,n,o,i){let s=r in n,c=i==="optional";if(!s&&c&&o==="optional")return;if(e.issues.length){if(o!==void 0&&c&&!s)return;t.issues.push(...ke(r,e.issues))}if(!s&&o===void 0){if(!e.issues.length)t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}if(e.value===void 0){if(s||o==="defaulted"&&!c)t.value[r]=void 0}else t.value[r]=e.value}var bc=[];function ho(e){let t=Object.keys(e.shape),r=Object.getOwnPropertySymbols(e.shape),n=r.length?r:bc,o=n.length?[...t,...n]:t;for(let s of o)if(!e.shape?.[s]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${String(s)}": expected a Zod schema`);let i=dr(e.shape);return{...e,allKeys:o,symbolKeys:n,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(i)}}function go(e,t,r,n,o,i,s){let c=[],u=o.keySet,a=o.catchall._zod,p=a.def.type,{optin:f,optout:d}=a,m=0;for(let h in t){if(s&&r.issues.length!==m){if(M(r,m))break;m=r.issues.length}if(u.has(h))continue;if(h==="__proto__"){if(p==="never")c.push(h);continue}if(p==="never"){c.push(h);continue}let _=a.run({value:t[h],issues:[]},n);if(_ instanceof Promise)e.push(_.then((x)=>je(x,r,h,t,f,d)));else je(_,r,h,t,f,d)}if(c.length)r.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:i,continue:!0});if(!e.length)return r;return Promise.all(e).then(()=>r)}var vc=l("$ZodObject",(e,t)=>{w.init(e,t);let r=Object.getOwnPropertyDescriptor(t,"shape"),n=r?.get?r.get.raw:t.shape??{};if(n){let a=()=>{let p={...n};return Object.defineProperty(t,"shape",{value:p}),a.raw=p,p};a.raw=n,Object.defineProperty(t,"shape",{get:a})}let o=be(()=>ho(t));y(e,"propValues",(a)=>{let p=a.def.shape,f={};for(let d in p){let m=p[d]._zod;if(m.values){if(!Object.prototype.hasOwnProperty.call(f,d))L(f,d,new Set);for(let h of m.values)f[d].add(h);if(m.optin!==void 0)f[d].add(void 0)}}return f});let i=ce,s=t.catchall,c,u=E.memoizer;u?.attach(e),e._zod.parse=(a,p)=>{c??(c=o.value);let f=a.value;if(!i(f))return a.issues.push({expected:"object",code:"invalid_type",input:f,inst:e}),a;a.value=u?u.alloc(e,a,{},p):{};let d=[],m=c.shape,h=p?.abortEarly,_=a.issues.length;for(let x of c.allKeys){if(h&&a.issues.length!==_){if(M(a,_))break;_=a.issues.length}if(x==="__proto__")continue;let b=m[x],D=b._zod.optin,oe=b._zod.optout,ie=b._zod.run({value:f[x],issues:[]},p);if(ie instanceof Promise)d.push(ie.then((P)=>je(P,a,x,f,D,oe)));else je(ie,a,x,f,D,oe)}if(!s)return d.length?Promise.all(d).then(()=>a):a;return go(d,f,a,p,o.value,e,h===!0)}}),_o=l("$ZodObjectJIT",(e,t)=>{vc.init(e,t);let r=e._zod.parse,n=be(()=>ho(t)),o=E.memoizer,i=(m)=>{let h=n.value,_=h.symbolKeys,x=new vt(["payload","ctx"],{shape:m,inst:e,memo:o,syms:_}),b=(P)=>`shape[${P}]._zod.run({ value: input[${P}], issues: [] }, ctx)`,D=(P,v)=>`
|
|
7
|
+
let ${P}_ab = false;
|
|
8
|
+
for (let i = 0; i < ${P}.issues.length; i++) {
|
|
9
|
+
const iss = ${P}.issues[i];
|
|
10
|
+
iss.path = iss.path ? [${v}, ...iss.path] : [${v}];
|
|
11
|
+
payload.issues.push(iss);
|
|
12
|
+
if (iss.continue !== true) ${P}_ab = true;
|
|
13
|
+
}
|
|
14
|
+
if (${P}_ab && ctx && ctx.abortEarly) {
|
|
15
|
+
payload.value = newResult;
|
|
16
|
+
return payload;
|
|
17
|
+
}`;x.write("const input = payload.value;");let oe=Object.create(null),ie=0;for(let P of h.allKeys)oe[P]=`key_${ie++}`;x.write(o?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(let P of h.allKeys){if(P==="__proto__")continue;let v=oe[P],j=typeof P==="symbol"?`syms[${_.indexOf(P)}]`:ar(P),tt=`${j} in input`,rr=m[P],rt=rr?._zod?.optin,nr=rt!==void 0,Rs=rr?._zod?.optout==="optional";if(x.write(`const ${v} = ${b(j)};`),nr&&Rs){let Ds=rt==="optional"?`${v}_present`:`${v}.value !== undefined || ${v}_present`;x.write(`
|
|
18
|
+
const ${v}_present = ${tt};
|
|
19
|
+
if (!${v}.issues.length || ${v}_present) {
|
|
20
|
+
if (${v}.issues.length) {${D(v,j)}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if (${Ds}) {
|
|
24
|
+
newResult[${j}] = ${v}.value;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
`)}else if(!nr)x.write(`
|
|
29
|
+
const ${v}_present = ${tt};
|
|
30
|
+
if (${v}.issues.length) {${D(v,j)}
|
|
31
|
+
}
|
|
32
|
+
if (!${v}_present && !${v}.issues.length) {
|
|
33
|
+
payload.issues.push({
|
|
34
|
+
code: "invalid_type",
|
|
35
|
+
expected: "nonoptional",
|
|
36
|
+
input: undefined,
|
|
37
|
+
path: [${j}]
|
|
38
|
+
});
|
|
39
|
+
if (ctx && ctx.abortEarly) {
|
|
40
|
+
payload.value = newResult;
|
|
41
|
+
return payload;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (${v}_present) {
|
|
46
|
+
newResult[${j}] = ${v}.value;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
`);else if(x.write(`
|
|
50
|
+
if (${v}.issues.length) {${D(v,j)}
|
|
51
|
+
}
|
|
52
|
+
`),rt==="defaulted")x.write(`newResult[${j}] = ${v}.value;`);else x.write(`
|
|
53
|
+
if (${v}.value !== undefined || ${tt}) {
|
|
54
|
+
newResult[${j}] = ${v}.value;
|
|
55
|
+
}
|
|
56
|
+
`)}return x.write("payload.value = newResult;"),x.write("return payload;"),x.compile()},s,c=ce,u=!E.jitless,p=u&&pr.value,f=t.catchall,d;e._zod.parse=(m,h)=>{d??(d=n.value);let _=m.value;if(!c(_))return m.issues.push({expected:"object",code:"invalid_type",input:_,inst:e}),m;if(u&&p&&h?.async===!1&&h.jitless!==!0){if(!s)s=i(t.shape);if(m=s(m,h),!f)return m;return go([],_,m,h,d,e,h?.abortEarly===!0)}return r(m,h)}});function Pn(e,t,r,n){for(let i of e)if(i.issues.length===0)return t.value=i.value,t;let o=e.filter((i)=>!M(i));if(o.length===1)return t.value=o[0].value,o[0];return t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map((i)=>i.issues.map((s)=>X(s,n,C())))}),t}var xo=l("$ZodUnion",(e,t)=>{w.init(e,t),y(e,"optin",(n)=>n.def.options.some((o)=>o._zod.optin==="defaulted")?"defaulted":n.def.options.some((o)=>o._zod.optin!==void 0)?"optional":void 0),y(e,"optout",(n)=>n.def.options.some((o)=>o._zod.optout==="optional")?"optional":void 0),y(e,"values",(n)=>{if(n.def.options.every((o)=>o._zod.values))return new Set(n.def.options.flatMap((o)=>Array.from(o._zod.values)));return}),y(e,"pattern",(n)=>{if(n.def.options.every((o)=>o._zod.pattern)){let o=n.def.options.map((i)=>i._zod.pattern);return new RegExp(`^(${o.map((i)=>ve(i.source)).join("|")})$`)}return});let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(n,o)=>{if(r)return r(n,o);let i=!1,s=[];for(let c of t.options){let u=c._zod.run({value:n.value,issues:[]},o);if(u instanceof Promise)s.push(u),i=!0;else{if(u.issues.length===0)return u;s.push(u)}}if(!i)return Pn(s,n,e,o);return Promise.all(s).then((c)=>Pn(c,n,e,o))}});var yo=l("$ZodIntersection",(e,t)=>{w.init(e,t),e._zod.parse=(r,n)=>{let o=r.value,i=t.left._zod.run({value:o,issues:[]},n),s=t.right._zod.run({value:o,issues:[]},n);if(i instanceof Promise||s instanceof Promise)return Promise.all([i,s]).then(([u,a])=>Sn(r,u,a));return Sn(r,i,s)}});function zt(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(ee(e)&&ee(t)){let r=Object.keys(t),n=Object.keys(e).filter((i)=>r.indexOf(i)!==-1),o={...e,...t};if(Object.prototype.hasOwnProperty.call(o,"__proto__"))delete o.__proto__;for(let i of n){if(i==="__proto__")continue;let s=zt(e[i],t[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};o[i]=s.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let n=0;n<e.length;n++){let o=e[n],i=t[n],s=zt(o,i);if(!s.valid)return{valid:!1,mergeErrorPath:[n,...s.mergeErrorPath]};r.push(s.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Sn(e,t,r){let n=new Map,o,i=new Map,s=(a,p)=>{let f;if(a.code==="unrecognized_keys"&&!a.path?.length)o??(o=a),f=a.keys;else if(a.code==="invalid_key"&&a.origin==="record"&&a.path?.length===1){let d=String(a.path[0]);if(!i.has(d))i.set(d,a);f=[d]}else return!1;for(let d of f){if(!n.has(d))n.set(d,{});n.get(d)[p]=!0}return!0};for(let a of t.issues)if(!s(a,"l"))e.issues.push(a);for(let a of r.issues)if(!s(a,"r"))e.issues.push(a);let c=[...n].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(c.length){let a=o?c.filter((p)=>o.keys.includes(p)):[];if(a.length)e.issues.push({...o,keys:a});for(let p of c)if(!a.includes(p)&&i.has(p))e.issues.push(i.get(p))}let u=zt(t.value,r.value);if(!u.valid){if(M(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(u.mergeErrorPath)}`)}return e.value=u.data,e}var bo=l("$ZodEnum",(e,t)=>{w.init(e,t);let r=ue(t.entries),n=new Set(r);e._zod.values=n,y(e,"pattern",(o)=>{let i=ue(o.def.entries).filter((s)=>fr.has(typeof s));return new RegExp(i.length?`^(${i.map((s)=>W(s.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(o,i)=>{let s=o.value;if(n.has(s))return o;return o.issues.push({code:"invalid_value",values:r,input:s,inst:e}),o}}),vo=l("$ZodLiteral",(e,t)=>{w.init(e,t);let r=new Set(t.values);e._zod.values=r,y(e,"pattern",(n)=>{let o=n.def.values;return new RegExp(o.length?`^(${o.map((i)=>typeof i==="string"?W(i):i?W(i.toString()):String(i)).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(n,o)=>{let i=n.value;if(r.has(i))return n;return n.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),n}});var zo=l("$ZodTransform",(e,t)=>{w.init(e,t),e._zod.optin="optional",E.memoizer?.guard(e),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new le(e.constructor.name);let o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then((s)=>(r.value=s,r));if(o instanceof Promise)throw new U;return r.value=o,r}});function On(e,t){return e.value=t.issues.length?void 0:t.value,e}var Zt=l("$ZodOptional",(e,t)=>{w.init(e,t),y(e,"optin",(r)=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",y(e,"values",(r)=>{let n=r.def.innerType._zod.values;return n?new Set([...n,void 0]):void 0}),y(e,"pattern",(r)=>{let n=r.def.innerType._zod.pattern;return n?new RegExp(`^(${ve(n.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(r.value===void 0){if(t.innerType._zod.optin!=="defaulted")return r;let o=t.innerType._zod.run({value:r.value,issues:[]},n);if(o instanceof Promise)return o.then((i)=>On(r,i));return On(r,o)}return t.innerType._zod.run(r,n)}}),$o=l("$ZodExactOptional",(e,t)=>{Zt.init(e,t),y(e,"values",(r)=>r.def.innerType._zod.values),y(e,"pattern",(r)=>r.def.innerType._zod.pattern),e._zod.parse=(r,n)=>t.innerType._zod.run(r,n)}),wo=l("$ZodNullable",(e,t)=>{w.init(e,t),y(e,"optin",(r)=>r.def.innerType._zod.optin),y(e,"optout",(r)=>r.def.innerType._zod.optout),y(e,"pattern",(r)=>{let n=r.def.innerType._zod.pattern;return n?new RegExp(`^(${ve(n.source)}|null)$`):void 0}),y(e,"values",(r)=>r.def.innerType._zod.values?new Set([...r.def.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>{if(r.value===null)return r;return t.innerType._zod.run(r,n)}}),ko=l("$ZodDefault",(e,t)=>{w.init(e,t),e._zod.optin="defaulted",y(e,"values",(r)=>r.def.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)return r.value=t.defaultValue,r;let o=t.innerType._zod.run(r,n);if(o instanceof Promise)return o.then((i)=>In(i,t));return In(o,t)}});function In(e,t){if(e.value===void 0)e.value=t.defaultValue;return e}var Zo=l("$ZodPrefault",(e,t)=>{w.init(e,t),e._zod.optin="defaulted",y(e,"values",(r)=>r.def.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)r.value=t.defaultValue;return t.innerType._zod.run(r,n)}}),Po=l("$ZodNonOptional",(e,t)=>{w.init(e,t),y(e,"values",(r)=>{let n=r.def.innerType._zod.values;return n?new Set([...n].filter((o)=>o!==void 0)):void 0}),e._zod.parse=(r,n)=>{let o=t.innerType._zod.run(r,n);if(o instanceof Promise)return o.then((i)=>An(i,e));return An(o,e)}});function An(e,t){if(!e.issues.length&&e.value===void 0)e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t});return e}function En(e,t,r,n){if(!t.issues.length){if(e.value=t.value,t.memo)e.memo=!0;return e}return e.value=r.catchValue({...t,value:e.value,error:{issues:t.issues.map((o)=>X(o,n,C()))},input:e.value}),e}var So=l("$ZodCatch",(e,t)=>{w.init(e,t),y(e,"optin",(r)=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),y(e,"optout",(r)=>r.def.innerType._zod.optout),y(e,"values",(r)=>r.def.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);let o=t.innerType._zod.run({value:r.value,issues:[]},n);if(o instanceof Promise)return o.then((i)=>En(r,i,t,n));return En(r,o,t,n)}});var Oo=l("$ZodPipe",(e,t)=>{w.init(e,t),y(e,"values",(r)=>r.def.in._zod.values),y(e,"optin",(r)=>r.def.in._zod.optin),y(e,"optout",(r)=>r.def.out._zod.optout),y(e,"propValues",(r)=>r.def.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let i=t.out._zod.run(r,n);if(i instanceof Promise)return i.then((s)=>Re(s,t.in,n));return Re(i,t.in,n)}let o=t.in._zod.run(r,n);if(o instanceof Promise)return o.then((i)=>Re(i,t.out,n));return Re(o,t.out,n)}});function Re(e,t,r){if(e.issues.some((n)=>n.code!=="unrecognized_keys"))return e.aborted=!0,e;return t._zod.run({value:e.value,issues:e.issues},r)}var Io=l("$ZodReadonly",(e,t)=>{w.init(e,t),y(e,"propValues",(r)=>r.def.innerType._zod.propValues),y(e,"values",(r)=>r.def.innerType._zod.values),y(e,"optin",(r)=>r.def.innerType?._zod?.optin),y(e,"optout",(r)=>r.def.innerType?._zod?.optout),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);let o=t.innerType._zod.run(r,n);if(o instanceof Promise)return o.then(Tn);return Tn(o)}});function Tn(e){if(!e.memo)e.value=Object.freeze(e.value);return e}var Ao=l("$ZodCustom",(e,t)=>{O.init(e,t),w.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=(r)=>{let n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then((i)=>Nn(i,r,n,e));Nn(o,r,n,e);return}});function Nn(e,t,r,n){if(!e){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};if(n._zod.def.params)o.params=n._zod.def.params;t.issues.push(q(o))}}class To extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform");this.name="ZodCyclicError"}}var St="~memo",Eo=[];function No(e){return e!==null&&typeof e==="object"}function Pt(e){return e.map((t)=>t.path?{...t,path:t.path.slice()}:{...t})}var Co=new WeakMap,de=0,Be=1,me=2;function Je(e,t,r){let n=Co.get(e);if(n!==void 0)return n?me:de;if(t.has(e))return me;t.add(e);let o=de,i=(p)=>{if(o!==me&&p?._zod){let f=Je(p,t,r);if(f>o)o=f}},s=(p,f)=>{let d=de;for(let m of Reflect.ownKeys(p)){let h=Object.getOwnPropertyDescriptor(p,m);if(f&&!h.enumerable)continue;let _=h.get?Be:h.value?._zod?Je(h.value,t,r):de;if(_>d)d=_}return d},c=(p)=>{if(p>o)o=p},u=e._zod.def,a=u.type;switch(a){case"object":{let p=ze(u);c(p?s(p,!0):Be),i(u.catchall);break}case"array":i(u.element);break;case"tuple":for(let p of u.items)i(p);i(u.rest);break;case"record":case"map":i(u.keyType),i(u.valueType);break;case"set":i(u.valueType);break;case"union":for(let p of u.options)i(p);break;case"intersection":i(u.left),i(u.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":i(u.innerType);break;case"pipe":i(u.in),i(u.out);break;case"function":i(u.input),i(u.output);break;case"lazy":{let p=u._cachedInner??(r?e._zod.innerType:void 0);c(p?Je(p,t,!1):Be);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(let p in u){let f=Object.getOwnPropertyDescriptor(u,p);if(!f||f.get)continue;let d=f.value;if(!d||typeof d!=="object")continue;if(d._zod)i(d);else if(Array.isArray(d))for(let m of d)i(m)}}return t.delete(e),zc(e,o)}function zc(e,t){if(t!==Be)Co.set(e,t===me);return t}function $c(e,t){let r=e.buckets.get(t);if(!r)r=new WeakMap,e.buckets.set(t,r);return r}var Me,Ue=[],wc={alloc(e,t,r){let n=Me;if(!n)return r;Me=void 0;let o={value:r,issues:null};return n.set(t.value,o),Ue.push(o),r},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let r=e._zod.parse,n=(o,i)=>{if(i.direction!=="backward"&&kc(i,o.value))throw new To;return r(o,i)};if(e._zod.parse=n,e._zod.run===r)e._zod.run=n})},attach(e){var t;let r,n=!1,o,i;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let s=e._zod.parse,c=(u,a)=>{if(r===void 0){let b=Je(e,new Set,!1);if(b===de){if(e._zod.parse=s,e._zod.run===c)e._zod.run=s;return s(u,a)}if(b===me||n)r=!0;else n=!0}let p=u.value;if(!No(p))return s(u,a);let f=a[St];if(!f)f={buckets:new WeakMap,backEdges:void 0},a[St]=f;let d;if(o===a)d=i;else d=$c(f,e),o=a,i=d;let m=d.get(p);if(m){if(u.value=m.value,m.issues){if(m.issues.length)u.issues.push(...Pt(m.issues))}else u.memo=!0,f.backEdges??(f.backEdges=new WeakSet),f.backEdges.add(m.value);return u}Me=d;let h=Ue.length,_=s(u,a);Me=void 0;let x=Ue.length>h?Ue.pop():void 0;if(_ instanceof Promise)return _.then((b)=>{if(x)x.issues=b.issues.length?Pt(b.issues):Eo;return b});if(x)x.issues=_.issues.length?Pt(_.issues):Eo;return _};if(e._zod.parse=c,e._zod.run===s)e._zod.run=c})}};function Ro(){return wc}function kc(e,t){let r=e[St]?.backEdges;return r!==void 0&&No(t)&&r.has(t)}var Zc=()=>{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(i){return e[i]??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",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};function o(i,s){if(i==="number"&&typeof s==="number"&&!Number.isFinite(s))return String(s);return n[i]??i}return(i)=>{switch(i.code){case"invalid_type":{let s=o(i.expected),c=_r(i.input),u=o(c,i.input);return`Invalid input: expected ${s}, received ${u}`}case"invalid_value":if(i.values.length===1)return`Invalid input: expected ${ct(i.values[0])}`;return`Invalid option: expected one of ${ot(i.values,"|")}`;case"too_big":{let s=i.exact?"exactly ":i.inclusive?"<=":"<",c=t(i.origin);if(c)return`Too big: expected ${i.origin??"value"} to have ${s}${i.maximum.toString()} ${c.unit??"elements"}`;return`Too big: expected ${i.origin??"value"} to be ${s}${i.maximum.toString()}`}case"too_small":{let s=i.exact?"exactly ":i.inclusive?">=":">",c=t(i.origin);if(c)return`Too small: expected ${i.origin} to have ${s}${i.minimum.toString()} ${c.unit}`;return`Too small: expected ${i.origin} to be ${s}${i.minimum.toString()}`}case"invalid_format":{let s=i;if(s.format==="starts_with")return`Invalid string: must start with "${s.prefix}"`;if(s.format==="ends_with")return`Invalid string: must end with "${s.suffix}"`;if(s.format==="includes")return`Invalid string: must include "${s.includes}"`;if(s.format==="regex")return`Invalid string: must match pattern ${s.pattern}`;return`Invalid ${r[s.format]??i.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${i.divisor}`;case"unrecognized_keys":return`Unrecognized key${i.keys.length>1?"s":""}: ${ot(i.keys,", ")}`;case"invalid_key":return`Invalid key in ${i.origin}`;case"invalid_union":if(i.options&&Array.isArray(i.options)&&i.options.length>0)return`Invalid discriminator value. Expected ${i.options.map((c)=>`'${c}'`).join(" | ")}`;if(i.inclusive===!1)return"Invalid input: more than one option matched";return"Invalid input";case"invalid_element":return`Invalid value in ${i.origin}`;default:return"Invalid input"}}};function Ot(){return{localeError:Zc()}}var Do;class jo{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let r=t[0];if(this._map.set(e,r),r&&typeof r==="object"&&"id"in r)this._idmap.set(r.id,e);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);if(t&&typeof t==="object"&&"id"in t)this._idmap.delete(t.id);return this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let r={...this.get(t)??{}};delete r.id;let n={...r,...this._map.get(e)};return Object.keys(n).length?n:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function Pc(){return new jo}(Do=globalThis).__zod_globalRegistry??(Do.__zod_globalRegistry=Pc());var Q=globalThis.__zod_globalRegistry;function Lo(e){if(e.checks)e.checks=[...e.checks];return e}function Fo(e,t){return new e(Lo({type:"string",...g(t)}))}function Mo(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...g(t)})}function Uo(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...g(t)})}function Bo(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...g(t)})}function Jo(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...g(t)})}function Ko(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...g(t)})}function Vo(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...g(t)})}function Go(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...g(t)})}function Wo(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...g(t)})}function Xo(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...g(t)})}function Ho(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...g(t)})}function Yo(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...g(t)})}function qo(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...g(t)})}function Qo(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...g(t)})}function ei(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...g(t)})}function ti(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...g(t)})}function ri(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...g(t)})}function ni(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...g(t)})}function oi(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...g(t)})}function ii(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...g(t)})}function si(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...g(t)})}function ci(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...g(t)})}function ui(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...g(t)})}function ai(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...g(t)})}function li(e,t){return new e({type:"string",format:"date",check:"string_format",...g(t)})}function pi(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...g(t)})}function fi(e,t){return new e({type:"string",format:"duration",check:"string_format",...g(t)})}function di(e,t){return new e(Lo({type:"number",checks:[],...g(t)}))}function mi(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...g(t)})}function hi(e,t){return new e({type:"boolean",...g(t)})}function gi(e){return new e({type:"unknown"})}function _i(e,t){return new e({type:"never",...g(t)})}function Ke(e,t){return new yt({check:"less_than",...g(t),value:e,inclusive:!1})}function he(e,t){return new yt({check:"less_than",...g(t),value:e,inclusive:!0})}function Ve(e,t){return new bt({check:"greater_than",...g(t),value:e,inclusive:!1})}function ge(e,t){return new bt({check:"greater_than",...g(t),value:e,inclusive:!0})}function Ge(e,t){return new pn({check:"multiple_of",...g(t),value:e})}function We(e,t){return new dn({check:"max_length",...g(t),maximum:e})}function te(e,t){return new mn({check:"min_length",...g(t),minimum:e})}function Xe(e,t){return new hn({check:"length_equals",...g(t),length:e})}function It(e,t){return new gn({check:"string_format",format:"regex",...g(t),pattern:e})}function At(e){return new _n({check:"string_format",format:"lowercase",...g(e)})}function Et(e){return new xn({check:"string_format",format:"uppercase",...g(e)})}function Tt(e,t){return new yn({check:"string_format",format:"includes",...g(t),includes:e})}function Nt(e,t){return new bn({check:"string_format",format:"starts_with",...g(t),prefix:e})}function Ct(e,t){return new vn({check:"string_format",format:"ends_with",...g(t),suffix:e})}function H(e){return new zn({check:"overwrite",tx:e})}function Rt(e){return H((t)=>t.normalize(e))}function Dt(){return H((e)=>e.trim())}function jt(){return H((e)=>e.toLowerCase())}function Lt(){return H((e)=>e.toUpperCase())}function Ft(){return H((e)=>lr(e))}function xi(e,t,r){return new e({type:"array",element:t,...g(r)})}function yi(e,t,r){return new e({type:"custom",check:"custom",fn:t,...g(r)})}function bi(e,t){let r=Sc((n)=>(n.addIssue=(o)=>{if(typeof o==="string")n.issues.push(q(o,n.value,r._zod.def));else{let i=o;if(i.fatal)i.continue=!1;if(i.code??(i.code="custom"),!("input"in i))i.input=n.value;i.inst??(i.inst=r),i.continue??(i.continue=!r._zod.def.abort),n.issues.push(q(i))}},e(n.value,n)),t);return r}function Sc(e,t){let r=new O({check:"custom",...g(t)});return r._zod.check=e,r}function _e(e,...t){for(let r of t)for(let n of Reflect.ownKeys(r))if(Object.prototype.propertyIsEnumerable.call(r,n))L(e,n,r[n]);return e}function Ut(e){let t=e?.target??"draft-2020-12";if(t==="draft-4")t="draft-04";if(t==="draft-7")t="draft-07";return{processors:e.processors??{},metadataRegistry:e?.metadata??Q,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function K(e,t,r,n,o){let i=typeof t.unrepresentable==="function"?t.unrepresentable({zodSchema:e,path:n.path,message:o}):t.unrepresentable;if(i==="any")return!1;if(i===void 0||i==="throw")throw Error(o);return Object.assign(r,i),!0}function S(e,t,r={path:[],schemaPath:[]}){var n;let o=e._zod.def,i=t.seen.get(e);if(i){if(i.count++,r.schemaPath.includes(e))i.cycle=r.path;return i.schema}let s={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,s),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let c=e._zod.toJSONSchema?.();if(c)s.schema=c;else{let p={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,p);else{let d=s.schema,m=t.processors[o.type];if(!m)throw Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);m(e,t,d,p)}let f=e._zod.parent;if(f){if(!s.ref)s.ref=f;S(f,t,p),t.seen.get(f).isParent=!0}}let u=t.metadataRegistry.get(e);if(u)_e(s.schema,u);if(t.io==="input"&&I(e))delete s.schema.examples,delete s.schema.default;if(t.io==="input"&&"_prefault"in s.schema)(n=s.schema).default??(n.default=s.schema._prefault);return delete s.schema._prefault,t.seen.get(e).schema}function vi(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function Bt(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;let n=new Map;for(let s of e.seen.entries()){let c=e.metadataRegistry.get(s[0])?.id;if(c){let u=n.get(c);if(u&&u!==s[0])throw Error(`Duplicate schema id "${c}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(c,s[0])}}let o=(s)=>{let c=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let f=e.external.registry.get(s[0])?.id,d=e.external.uri??((h)=>h);if(f)return{ref:d(f)};let m=s[1].defId??s[1].schema.id??`schema${e.counter++}`;return s[1].defId=m,{defId:m,ref:`${d("__shared")}#/${c}/${vi(m)}`}}let u="#",a=`${u}/${c}/`;if(s[1]===r&&!s[1].schema.id)return{ref:u};let p=s[1].schema.id??`__schema${e.counter++}`;return{defId:p,ref:a+vi(p)}},i=(s)=>{if(s[1].schema.$ref)return;let c=s[1],{ref:u,defId:a}=o(s);if(c.def={...c.schema},a)c.defId=a;let p=c.schema;for(let f in p)delete p[f];p.$ref=u};if(e.cycles==="throw")for(let s of e.seen.entries()){let c=s[1];if(c.cycle)throw Error(`Cycle detected: #/${c.cycle?.join("/")}/<root>
|
|
57
|
+
|
|
58
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of e.seen.entries()){let c=s[1];if(t===s[0]){i(s);continue}if(e.external){let a=e.external.registry.get(s[0])?.id;if(t!==s[0]&&a){i(s);continue}}if(e.metadataRegistry.get(s[0])?.id){i(s);continue}if(c.cycle){i(s);continue}if(c.count>1){if(e.reused==="ref")i(s)}}if(e.external)e.sharedDefsExtractedFor=e.external}function wi(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let r=[];for(let n of t){if(!n||typeof n!=="object")return;wi(n);let o=Object.keys(n);if(o.length!==1||o[0]!=="type")return;let i=n.type;for(let s of Array.isArray(i)?i:[i]){if(typeof s!=="string")return;if(!r.includes(s))r.push(s)}}delete e.anyOf,e.type=r.length===1?r[0]:r}var ki=new Set(["type","properties","required","additionalProperties"]),zi=["oneOf","anyOf"];function $i(e){let t=e.additionalProperties;if(t===void 0||t===!1||typeof t!=="object"||t===null)return null;return Object.keys(t).length?t:null}function Mt(e){let t=[];for(let i of e){if(typeof i!=="object"||i.type!=="object")return null;for(let s in i)if(!ki.has(s))return null;t.push(i)}let r={},n=new Set;for(let i of t){for(let s in i.properties){if(Object.prototype.hasOwnProperty.call(r,s))continue;let c=[];for(let a of t){let p=a.properties?.[s]??$i(a);if(p===null||p===void 0)continue;if(!c.some((f)=>JSON.stringify(f)===JSON.stringify(p)))c.push(p)}let u=c.length===1?c[0]:Mt(c)??{allOf:c};L(r,s,u)}for(let s of i.required??[])n.add(s)}let o={type:"object",properties:r};if(n.size)o.required=[...n];if(t.every((i)=>i.additionalProperties===!1))o.additionalProperties=!1;else{let i=[];for(let s of t){let c=$i(s);if(c&&!i.some((u)=>JSON.stringify(u)===JSON.stringify(c)))i.push(c)}if(i.length===1)o.additionalProperties=i[0];else if(i.length>1)o.additionalProperties={allOf:i}}return o}function Oc(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let o of ki)if(o in e)return;let r=t.filter((o)=>zi.some((i)=>Array.isArray(o[i]))),n=null;if(!r.length)n=Mt(t);else{let o=r[0],i=zi.find((u)=>Array.isArray(o[u]));if(Object.keys(o).length!==1)return;let s=t.filter((u)=>u!==o),c=o[i].map((u)=>Mt([...s,u]));if(c.some((u)=>!u))return;n={[i]:c}}if(!n)return;delete e.allOf,_e(e,n)}function Jt(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let n=(c)=>{let u=e.seen.get(c);if(u.ref===null)return;let a=u.def??u.schema,p={...a},f=u.ref;if(u.ref=null,f){n(f);let m=e.seen.get(f),h=m.schema;if(h.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"))a.allOf=a.allOf??[],a.allOf.push(h);else _e(a,h);if(_e(a,p),c._zod.parent===f)for(let x in a){if(x==="$ref"||x==="allOf")continue;if(!(x in p))delete a[x]}if(h.$ref&&m.def)for(let x in a){if(x==="$ref"||x==="allOf")continue;if(x in m.def&&JSON.stringify(a[x])===JSON.stringify(m.def[x]))delete a[x]}}let d=c._zod.parent;if(d&&d!==f){n(d);let m=e.seen.get(d);if(m?.schema.$ref){if(a.$ref=m.schema.$ref,m.def)for(let h in a){if(h==="$ref"||h==="allOf")continue;if(h in m.def&&JSON.stringify(a[h])===JSON.stringify(m.def[h]))delete a[h]}}}e.override({zodSchema:c,jsonSchema:a,path:u.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let c of[...e.seen.entries()].reverse())n(c[0]);if(e.target!=="openapi-3.0")for(let c of e.seen.entries())wi(c[1].def??c[1].schema);for(let c of e.deferred)c();if(e.intersections.length){let c=new Map;for(let u of e.seen.values())for(let a of[u.schema,u.def]){let p=a?.allOf;if(!Array.isArray(p))continue;let f=c.get(p);if(f)f.push(a);else c.set(p,[a])}for(let u of e.intersections)for(let a of c.get(u)??[])Oc(a)}}let o={};if(e.target==="draft-2020-12")o.$schema="https://json-schema.org/draft/2020-12/schema";else if(e.target==="draft-07")o.$schema="http://json-schema.org/draft-07/schema#";else if(e.target==="draft-04")o.$schema="http://json-schema.org/draft-04/schema#";else if(e.target==="openapi-3.0");if(e.external?.uri){let c=e.external.registry.get(t)?.id;if(!c)throw Error("Schema is missing an `id` property");o.$id=e.external.uri(c)}_e(o,r.defId?r.schema:r.def??r.schema);let i=e.metadataRegistry.get(t)?.id;if(i!==void 0&&o.id===i)delete o.id;let s=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let c of e.seen.entries()){let u=c[1];if(u.def&&u.defId){if(u.def.id===u.defId)delete u.def.id;L(s,u.defId,u.def)}}if(e.external)e.sharedEmitDoneFor=e.external;if(e.external);else if(Object.keys(s).length>0)if(e.target==="draft-2020-12")o.$defs=s;else o.definitions=s;try{let c=JSON.parse(JSON.stringify(o));return Object.defineProperty(c,"~standard",{value:{...t["~standard"],jsonSchema:{input:xe(t,"input",e.processors),output:xe(t,"output",e.processors)}},enumerable:!1,writable:!1}),c}catch(c){throw Error("Error converting schema to JSON.")}}function I(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let n=e._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return I(n.element,r);if(n.type==="set")return I(n.valueType,r);if(n.type==="lazy")return I(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault"||n.type==="catch")return I(n.innerType,r);if(n.type==="intersection")return I(n.left,r)||I(n.right,r);if(n.type==="record"||n.type==="map")return I(n.keyType,r)||I(n.valueType,r);if(n.type==="pipe"){if(e._zod.traits.has("$ZodCodec"))return!0;return I(n.in,r)||I(n.out,r)}if(n.type==="object"){for(let o in n.shape)if(I(n.shape[o],r))return!0;return!1}if(n.type==="union"){for(let o of n.options)if(I(o,r))return!0;return!1}if(n.type==="tuple"){for(let o of n.items)if(I(o,r))return!0;if(n.rest&&I(n.rest,r))return!0;return!1}return!1}var Zi=(e,t={})=>(r)=>{let n=Ut({...r,processors:t});return S(e,n),Bt(n,e),Jt(n,e)},xe=(e,t,r={})=>(n)=>{let{libraryOptions:o,target:i}=n??{},s=Ut({...o??{},target:i,io:t,processors:r});return S(e,s),Bt(s,e),Jt(s,e)};var re=(e,t,r)=>{if(e[t]===void 0||r>e[t])e[t]=r},ne=(e,t,r)=>{if(e[t]===void 0||r<e[t])e[t]=r},Pi=(e,t)=>{re(e,"minimum",t),ne(e,"maximum",t)},Ai=(e,t)=>{if(e.multipleOf??(e.multipleOf=[]),!e.multipleOf.includes(t))e.multipleOf.push(t)},Ei=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},Ti=(e,t)=>{e.mime=e.mime?e.mime.filter((r)=>t.includes(r)):[...t]},Ni=(e,t)=>{if(e.format=t,t.includes("int"))e.isInt=!0},Si=(e,t)=>re(e,"minimum",t.minimum),Oi=(e,t)=>ne(e,"maximum",t.maximum),Ii=(e)=>(t,r)=>{Ni(t,r.format);let[n,o]=e[r.format];re(t,"minimum",n),ne(t,"maximum",o)},Ic={greater_than:(e,t)=>re(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>ne(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>Ai(e,t.value),number_format:Ii($e),bigint_format:Ii(ut),min_length:Si,max_length:Oi,length_equals:(e,t)=>Pi(e,t.length),min_size:Si,max_size:Oi,size_equals:(e,t)=>Pi(e,t.size),string_format:(e,t)=>{if(Ni(e,t.format),t.pattern)Ei(e,t.pattern);if(t.format==="base64"||t.format==="base64url")e.contentEncoding=t.format;if(t.local||t.precision===-1)e.laxFormat=!0},mime_type:(e,t)=>Ti(e,t.mime)};function R(e){let t={},r=e._zod.def,n=e._zod.traits.has("$ZodCheck")?[e,...r.checks??[]]:r.checks??[];for(let i of n)Ic[i._zod.def.check]?.(t,i._zod.def);let o=e._zod.bag;if(o.minimum!==void 0)re(t,"minimum",o.minimum);if(o.exclusiveMinimum!==void 0)re(t,"exclusiveMinimum",o.exclusiveMinimum);if(o.maximum!==void 0)ne(t,"maximum",o.maximum);if(o.exclusiveMaximum!==void 0)ne(t,"exclusiveMaximum",o.exclusiveMaximum);if(o.multipleOf!==void 0)Ai(t,o.multipleOf);if(o.format!==void 0){if(t.format??(t.format=o.format),o.format.includes("int"))t.isInt=!0}if(o.mime)Ti(t,o.mime);for(let i of o.patterns??[])Ei(t,i);return t}var Ac={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Ec=new Map([[wt,qr],[Fe,Qr]]),Tc=(e)=>Ec.get(e)??e,Ci=(e,t,r,n)=>{let o=r;o.type="string";let{minimum:i,maximum:s,format:c,patterns:u,contentEncoding:a,laxFormat:p}=R(e);if(typeof i==="number")o.minLength=i;if(typeof s==="number")o.maxLength=s;if(c){if(o.format=Ac[c]??c,o.format==="")delete o.format;if(c==="time"||p)delete o.format}if(a)o.contentEncoding=a;if(u&&u.size>0){let f=[...u].map(Tc);if(f.length===1)o.pattern=f[0].source;else if(f.length>1)o.allOf=[...f.map((d)=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))]}},Ri=(e,t,r,n)=>{let o=r,{minimum:i,maximum:s,multipleOf:c,exclusiveMaximum:u,exclusiveMinimum:a,isInt:p}=R(e);o.type=p?"integer":"number";let f=typeof a==="number"&&a>=(i??Number.NEGATIVE_INFINITY),d=typeof u==="number"&&u<=(s??Number.POSITIVE_INFINITY),m=t.target==="draft-04"||t.target==="openapi-3.0";if(f)if(m)o.minimum=a,o.exclusiveMinimum=!0;else o.exclusiveMinimum=a;else if(typeof i==="number")o.minimum=i;if(d)if(m)o.maximum=u,o.exclusiveMaximum=!0;else o.exclusiveMaximum=u;else if(typeof s==="number")o.maximum=s;if(c){let h=new Set;for(let b of c)if(Number.isFinite(b)&&b!==0)h.add(Math.abs(b));else K(e,t,o,n,`A multipleOf divisor of ${b} cannot be represented in JSON Schema`);let[_,...x]=h;if(_!==void 0)o.multipleOf=_;if(x.length)o.allOf=[...o.allOf??[],...x.map((b)=>({multipleOf:b}))]}},Di=(e,t,r,n)=>{r.type="boolean"};var ji=(e,t,r,n)=>{r.not={}};var Li=(e,t,r,n)=>{};var Fi=(e,t,r,n)=>{let o=e._zod.def,i=ue(o.entries);if(i.length===0){r.not={};return}if(i.every((s)=>typeof s==="number"))r.type="number";if(i.every((s)=>typeof s==="string"))r.type="string";r.enum=i},Mi=(e,t,r,n)=>{let o=e._zod.def;if(o.values.length===0){r.not={};return}let i=[];for(let s of o.values)if(s===void 0){if(K(e,t,r,n,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof s==="bigint"){if(K(e,t,r,n,"BigInt literals cannot be represented in JSON Schema"))return;i.push(Number(s))}else i.push(s);if(i.length===0);else if(i.length===1){let s=i[0];if(r.type=s===null?"null":typeof s,t.target==="draft-04"||t.target==="openapi-3.0")r.enum=[s];else r.const=s}else{if(i.every((s)=>typeof s==="number"))r.type="number";if(i.every((s)=>typeof s==="string"))r.type="string";if(i.every((s)=>typeof s==="boolean"))r.type="boolean";if(i.every((s)=>s===null))r.type="null";r.enum=i}};var Ui=(e,t,r,n)=>{K(e,t,r,n,"Custom types cannot be represented in JSON Schema")};var Bi=(e,t,r,n)=>{K(e,t,r,n,"Transforms cannot be represented in JSON Schema")};var Ji=(e,t,r,n)=>{let o=r,i=e._zod.def,{minimum:s,maximum:c}=R(e);if(typeof s==="number")o.minItems=s;if(typeof c==="number")o.maxItems=c;o.type="array",o.items=S(i.element,t,{...n,path:[...n.path,"items"]})};function Kt(e){let t=e._zod.def;if(t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform"))return Kt(t.out);if(t.type==="catch")return Kt(t.innerType);return e._zod.optin}var Ki=(e,t,r,n)=>{let o=r,i=e._zod.def,s=i.shape;if(Object.getOwnPropertySymbols(s).length&&K(e,t,o,n,"Symbol keys cannot be represented in JSON Schema"))return;o.type="object",o.properties={};for(let a in s)L(o.properties,a,S(s[a],t,{...n,path:[...n.path,"properties",a]}));let u=[];for(let a of Object.keys(s)){let p=i.shape[a];if(t.io==="input"?Kt(p)===void 0:p._zod.optout===void 0)u.push(a)}if(u.length>0)o.required=u;if(i.catchall?._zod.def.type==="never")o.additionalProperties=!1;else if(!i.catchall){if(t.io==="output")o.additionalProperties=!1}else if(i.catchall)o.additionalProperties=S(i.catchall,t,{...n,path:[...n.path,"additionalProperties"]})},Vi=(e,t,r,n)=>{let o=e._zod.def,i=o.inclusive===!1,s=o.options.map((c,u)=>S(c,t,{...n,path:[...n.path,i?"oneOf":"anyOf",u]}));if(i)r.oneOf=s;else r.anyOf=s},Gi=(e,t,r,n)=>{let o=e._zod.def,i=S(o.left,t,{...n,path:[...n.path,"allOf",0]}),s=S(o.right,t,{...n,path:[...n.path,"allOf",1]}),c=(a)=>("allOf"in a)&&Object.keys(a).length===1,u=[...c(i)?i.allOf:[i],...c(s)?s.allOf:[s]];r.allOf=u,t.intersections.push(u)};var Wi=(e,t,r,n)=>{let o=e._zod.def,i=S(o.innerType,t,n),s=t.seen.get(e);if(t.target==="openapi-3.0")s.ref=o.innerType,r.nullable=!0;else r.anyOf=[i,{type:"null"}]},Xi=(e,t,r,n)=>{let o=e._zod.def;S(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType},Vt=Symbol();function Hi(e,t,r,n,o){let i=!1,s=JSON.stringify(e,(c,u)=>{if(typeof u!=="bigint")return u;return i=!0,null});if(!i)return JSON.parse(s);return K(t,r,n,o,"BigInt defaults cannot be represented in JSON Schema"),Vt}var Yi=(e,t,r,n)=>{let o=e._zod.def;S(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType;let s=Hi(o.defaultValue,e,t,r,n);if(s!==Vt)r.default=s},qi=(e,t,r,n)=>{let o=e._zod.def;S(o.innerType,t,n);let i=t.seen.get(e);if(i.ref=o.innerType,t.io!=="input")return;let s=Hi(o.defaultValue,e,t,r,n);if(s!==Vt)r._prefault=s},Qi=(e,t,r,n)=>{let o=e._zod.def;S(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType;let s;try{s=o.catchValue(void 0)}catch{K(e,t,r,n,"Dynamic catch values are not supported in JSON Schema");return}r.default=s},es=(e,t,r,n)=>{let o=e._zod.def,i=o.in._zod.traits.has("$ZodTransform"),s=t.io==="input"?i?o.out:o.in:o.out;S(s,t,n);let c=t.seen.get(e);c.ref=s},ts=(e,t,r,n)=>{let o=e._zod.def;S(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType,r.readOnly=!0};var Gt=(e,t,r,n)=>{let o=e._zod.def;S(o.innerType,t,n);let i=t.seen.get(e);i.ref=o.innerType};var rs=new WeakSet([Object.prototype,Error.prototype]);function He(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let n=r(this);return Object.defineProperty(this,t,{value:n,configurable:!0,writable:!0}),n},set(n){Object.defineProperty(this,t,{value:n,configurable:!0,writable:!0})}})}var Mc=(e,t)=>{kr.init(e,t),e.name="ZodError";let r=Object.getPrototypeOf(e);if(rs.has(r))return;rs.add(r),He(r,"format",(n)=>(o)=>Pr(n,o)),He(r,"flatten",(n)=>(o)=>Zr(n,o)),He(r,"addIssue",(n)=>(o)=>{n.issues.push(o),n.message=JSON.stringify(n.issues,ae,2)}),He(r,"addIssues",(n)=>(o)=>{n.issues.push(...o),n.message=JSON.stringify(n.issues,ae,2)}),Object.defineProperty(r,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}})};var T=l("ZodError",Mc,void 0,{Parent:Error});var ns=Ae(T),os=Ee(T),is=Te(T),ss=Ne(T),cs=Or(T),us=Ir(T),as=Ar(T),ls=Er(T),ps=Tr(T),fs=Nr(T),ds=Cr(T),ms=Rr(T);function Bc(){if(!E.localeError)C(Ot())}function Ht(){if(!E.memoizer)C({memoizer:Ro()})}var Z=l("ZodType",(e,t)=>(Bc(),w.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(A(t,{checks:[...t.checks??[],...e.map((r)=>typeof r==="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return F(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Mu(e,t))},superRefine(e,t){return this.check(Uu(e,t))},overwrite(e){return this.check(H(e))},optional(){return _s(this)},exactOptional(){return Su(this)},nullable(){return xs(this)},nullish(){return _s(xs(this))},nonoptional(e){return Nu(this,e)},array(){return yu(this)},or(e){return zu([this,e])},and(e){return wu(this,e)},transform(e){return ys(this,Pu(e))},default(e){return Au(this,e)},prefault(e){return Tu(this,e)},catch(e){return Ru(this,e)},pipe(e){return ys(this,e)},readonly(){return Lu(this)},describe(e){let t=this.clone();return Q.add(t,{description:e}),t},meta(...e){if(e.length===0)return Q.get(this);let t=this.clone();return Q.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get "~standard"(){return Oe(this,"~standard",{...$t(this),jsonSchema:{input:xe(this,"input"),output:xe(this,"output")}})},set "~standard"(e){J(this,"~standard",e)},parse:function e(t,r){return ns(this,t,r,{callee:e})},parseAsync:async function e(t,r){return await os(this,t,r,{callee:e})},safeParse(e,t){return is(this,e,t)},async safeParseAsync(e,t){return ss(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){J(this,"spa",e)},validate(e,t){return dt(this,e,t)},validateAsync(e,t){return mt(this,e,t)},encode:function e(t,r){return cs(this,t,r,{callee:e})},decode:function e(t,r){return us(this,t,r,{callee:e})},encodeAsync:async function e(t,r){return await as(this,t,r,{callee:e})},decodeAsync:async function e(t,r){return await ls(this,t,r,{callee:e})},safeEncode(e,t){return ps(this,e,t)},safeDecode(e,t){return fs(this,e,t)},async safeEncodeAsync(e,t){return ds(this,e,t)},async safeDecodeAsync(e,t){return ms(this,e,t)},toJSONSchema(e){return Zi(this,{})(e)},get description(){return Q.get(this)?.description},get _def(){return this._zod.def}}),bs=l("_ZodString",(e,t)=>{Le.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ci(e,r,n,o)},yr({format:(e)=>R(e).format??null,minLength:(e)=>R(e).minimum??null,maxLength:(e)=>R(e).maximum??null},{regex(...e){return this.check(It(...e))},includes(...e){return this.check(Tt(...e))},startsWith(...e){return this.check(Nt(...e))},endsWith(...e){return this.check(Ct(...e))},min(...e){return this.check(te(...e))},max(...e){return this.check(We(...e))},length(...e){return this.check(Xe(...e))},nonempty(...e){return this.check(te(1,...e))},lowercase(e){return this.check(At(e))},uppercase(e){return this.check(Et(e))},trim(){return this.check(Dt())},normalize(...e){return this.check(Rt(...e))},toLowerCase(){return this.check(jt())},toUpperCase(){return this.check(Lt())},slugify(){return this.check(Ft())}})),Jc=l("ZodString",(e,t)=>{Le.init(e,t),bs.init(e,t)},{email(e){return this.check(Mo(Xc,e))},url(e){return this.check(Go(Yc,e))},jwt(e){return this.check(ui(fu,e))},emoji(e){return this.check(Wo(qc,e))},guid(e){return this.check(Uo(Hc,e))},uuid(e){return this.check(Bo(Ye,e))},uuidv4(e){return this.check(Jo(Ye,e))},uuidv6(e){return this.check(Ko(Ye,e))},uuidv7(e){return this.check(Vo(Ye,e))},nanoid(e){return this.check(Xo(Qc,e))},cuid(e){return this.check(Ho(eu,e))},cuid2(e){return this.check(Yo(tu,e))},ulid(e){return this.check(qo(ru,e))},base64(e){return this.check(ii(au,e))},base64url(e){return this.check(si(lu,e))},xid(e){return this.check(Qo(nu,e))},ksuid(e){return this.check(ei(ou,e))},ipv4(e){return this.check(ti(iu,e))},ipv6(e){return this.check(ri(su,e))},cidrv4(e){return this.check(ni(cu,e))},cidrv6(e){return this.check(oi(uu,e))},e164(e){return this.check(ci(pu,e))},datetime(e){return this.check(ai(Kc,e))},date(e){return this.check(li(Vc,e))},time(e){return this.check(pi(Gc,e))},duration(e){return this.check(fi(Wc,e))}});function Yt(e){return Fo(Jc,e)}var k=l("ZodStringFormat",(e,t)=>{z.init(e,t),bs.init(e,t)}),Kc=l("ZodISODateTime",(e,t)=>{Xn.init(e,t),k.init(e,t)}),Vc=l("ZodISODate",(e,t)=>{Hn.init(e,t),k.init(e,t)}),Gc=l("ZodISOTime",(e,t)=>{Yn.init(e,t),k.init(e,t)}),Wc=l("ZodISODuration",(e,t)=>{qn.init(e,t),k.init(e,t)}),Xc=l("ZodEmail",(e,t)=>{jn.init(e,t),k.init(e,t)});var Hc=l("ZodGUID",(e,t)=>{Rn.init(e,t),k.init(e,t)});var Ye=l("ZodUUID",(e,t)=>{Dn.init(e,t),k.init(e,t)});var Yc=l("ZodURL",(e,t)=>{Mn.init(e,t),k.init(e,t)});var qc=l("ZodEmoji",(e,t)=>{Un.init(e,t),k.init(e,t)});var Qc=l("ZodNanoID",(e,t)=>{Bn.init(e,t),k.init(e,t)});var eu=l("ZodCUID",(e,t)=>{Jn.init(e,t),k.init(e,t)});var tu=l("ZodCUID2",(e,t)=>{Kn.init(e,t),k.init(e,t)});var ru=l("ZodULID",(e,t)=>{Vn.init(e,t),k.init(e,t)});var nu=l("ZodXID",(e,t)=>{Gn.init(e,t),k.init(e,t)});var ou=l("ZodKSUID",(e,t)=>{Wn.init(e,t),k.init(e,t)});var iu=l("ZodIPv4",(e,t)=>{Qn.init(e,t),k.init(e,t)});var su=l("ZodIPv6",(e,t)=>{to.init(e,t),k.init(e,t)});var cu=l("ZodCIDRv4",(e,t)=>{ro.init(e,t),k.init(e,t)});var uu=l("ZodCIDRv6",(e,t)=>{no.init(e,t),k.init(e,t)});var au=l("ZodBase64",(e,t)=>{io.init(e,t),k.init(e,t)});var lu=l("ZodBase64URL",(e,t)=>{so.init(e,t),k.init(e,t)});var pu=l("ZodE164",(e,t)=>{co.init(e,t),k.init(e,t)});var fu=l("ZodJWT",(e,t)=>{uo.init(e,t),k.init(e,t)});var vs=l("ZodNumber",(e,t)=>{kt.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ri(e,r,n,o),e.isFinite=!0},yr({minValue:(e)=>{let{minimum:t,exclusiveMinimum:r}=R(e);return Math.max(t??Number.NEGATIVE_INFINITY,r??Number.NEGATIVE_INFINITY)},maxValue:(e)=>{let{maximum:t,exclusiveMaximum:r}=R(e);return Math.min(t??Number.POSITIVE_INFINITY,r??Number.POSITIVE_INFINITY)},isInt:(e)=>{let{isInt:t,multipleOf:r}=R(e);return!!t||!!r?.some(Number.isSafeInteger)},format:(e)=>R(e).format??null},{gt(e,t){return this.check(Ve(e,t))},gte(e,t){return this.check(ge(e,t))},min(e,t){return this.check(ge(e,t))},lt(e,t){return this.check(Ke(e,t))},lte(e,t){return this.check(he(e,t))},max(e,t){return this.check(he(e,t))},int(e){return this.check(hs(e))},safe(e){return this.check(hs(e))},positive(e){return this.check(Ve(0,e))},nonnegative(e){return this.check(ge(0,e))},negative(e){return this.check(Ke(0,e))},nonpositive(e){return this.check(he(0,e))},multipleOf(e,t){return this.check(Ge(e,t))},step(e,t){return this.check(Ge(e,t))},finite(){return this}}));function qe(e){return di(vs,e)}var du=l("ZodNumberFormat",(e,t)=>{ao.init(e,t),vs.init(e,t)});function hs(e){return mi(du,e)}var mu=l("ZodBoolean",(e,t)=>{lo.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Di(e,r,n,o)});function Qe(e){return hi(mu,e)}var hu=l("ZodUnknown",(e,t)=>{po.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Li(e,r,n,o)});function gs(){return gi(hu)}var gu=l("ZodNever",(e,t)=>{fo.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ji(e,r,n,o)});function _u(e){return _i(gu,e)}var xu=l("ZodArray",(e,t)=>{Ht(),mo.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ji(e,r,n,o),e.element=t.element},{min(e,t){return this.check(te(e,t))},nonempty(e){return this.check(te(1,e))},max(e,t){return this.check(We(e,t))},length(e,t){return this.check(Xe(e,t))},unwrap(){return this.element}});function yu(e,t){return xi(xu,e,t)}var bu=l("ZodObject",(e,t)=>{Ht(),_o.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ki(e,r,n,o),Xs(e,"shape",(r)=>r._zod.def.shape,!1)},{keyof(){return zs(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(A(this._zod.def,{catchall:e}))},passthrough(){return this.clone(A(this._zod.def,{catchall:gs()}))},loose(){return this.clone(A(this._zod.def,{catchall:gs()}))},strict(){return this.clone(A(this._zod.def,{catchall:_u()}))},strip(){return this.clone(A(this._zod.def,{catchall:void 0}))},extend(e){return Ms(this,e)},safeExtend(e){return Us(this,e)},merge(e){return Bs(this,e)},pick(e){return Ls(this,e)},omit(e){return Fs(this,e)},partial(...e){return hr(ws,this,e[0])},exactPartial(...e){return hr(ks,this,e[0],"exactPartial")},required(...e){return Js(Zs,this,e[0])}});function qt(e,t){let r={type:"object",shape:e??{},...g(t)};return new bu(r)}var vu=l("ZodUnion",(e,t)=>{xo.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Vi(e,r,n,o),e.options=t.options});function zu(e,t){return new vu({type:"union",options:e,...g(t)})}var $u=l("ZodIntersection",(e,t)=>{yo.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Gi(e,r,n,o)});function wu(e,t){return new $u({type:"intersection",left:e,right:t})}var Xt=l("ZodEnum",(e,t)=>{bo.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(n,o,i)=>Fi(e,n,o,i),e.enum=t.entries,e.options=[...e._zod.values];let r=new Set(Object.keys(t.entries));e.extract=(n,o)=>{let i={};for(let s of n)if(r.has(s))i[s]=t.entries[s];else throw Error(`Key ${s} not found in enum`);return new Xt({...t,checks:[],...g(o),entries:i})},e.exclude=(n,o)=>{let i={...t.entries};for(let s of n)if(r.has(s))delete i[s];else throw Error(`Key ${s} not found in enum`);return new Xt({...t,checks:[],...g(o),entries:i})}});function zs(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map((n)=>[n,n])):e;return new Xt({type:"enum",entries:r,...g(t)})}var ku=l("ZodLiteral",(e,t)=>{vo.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Mi(e,r,n,o),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function $s(e,t){return new ku({type:"literal",values:Array.isArray(e)?e:[e],...g(t)})}var Zu=l("ZodTransform",(e,t)=>{Ht(),zo.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Bi(e,r,n,o),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new le(e.constructor.name);r.addIssue=(i)=>{if(typeof i==="string")r.issues.push(q(i,r.value,t));else{let s=i;if(s.fatal)s.continue=!1;if(s.code??(s.code="custom"),!("input"in s))s.input=r.value;s.inst??(s.inst=e),r.issues.push(q(s))}};let o=t.transform(r.value,r);if(o instanceof Promise)return o.then((i)=>(r.value=i,r));return r.value=o,r}});function Pu(e){return new Zu({type:"transform",transform:e})}var ws=l("ZodOptional",(e,t)=>{Zt.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Gt(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function _s(e){return new ws({type:"optional",innerType:e})}var ks=l("ZodExactOptional",(e,t)=>{$o.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Gt(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Su(e){return new ks({type:"optional",innerType:e})}var Ou=l("ZodNullable",(e,t)=>{wo.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Wi(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function xs(e){return new Ou({type:"nullable",innerType:e})}var Iu=l("ZodDefault",(e,t)=>{ko.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Yi(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Au(e,t){return new Iu({type:"default",innerType:e,get defaultValue(){return typeof t==="function"?t():st(t)}})}var Eu=l("ZodPrefault",(e,t)=>{Zo.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>qi(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Tu(e,t){return new Eu({type:"prefault",innerType:e,get defaultValue(){return typeof t==="function"?t():st(t)}})}var Zs=l("ZodNonOptional",(e,t)=>{Po.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Xi(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Nu(e,t){return new Zs({type:"nonoptional",innerType:e,...g(t)})}var Cu=l("ZodCatch",(e,t)=>{So.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Qi(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Ru(e,t){return new Cu({type:"catch",innerType:e,catchValue:typeof t==="function"?t:br(t)})}var Du=l("ZodPipe",(e,t)=>{Oo.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>es(e,r,n,o),e.in=t.in,e.out=t.out});function ys(e,t){return new Du({type:"pipe",in:e,out:t})}var ju=l("ZodReadonly",(e,t)=>{Io.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>ts(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Lu(e){return new ju({type:"readonly",innerType:e})}var Fu=l("ZodCustom",(e,t)=>{Ao.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ui(e,r,n,o)});function Mu(e,t={}){return yi(Fu,e,t)}function Uu(e,t){return bi(e,t)}var Ps=qt({type:$s("run"),id:qe().int().positive().max(Number.MAX_SAFE_INTEGER),operation:zs(["version","root","root-ignored","tracked","ignored"]),directory:Yt().min(1).max(4096),executable:Yt().min(1).max(4096)}).strict(),Ss=qt({type:$s("abort"),id:qe().int().positive().max(Number.MAX_SAFE_INTEGER)}).strict(),vp=qt({id:qe().int().positive(),code:qe().int(),stdout:Yt().max(3145728),truncated:Qe(),cancelled:Qe(),timedOut:Qe(),notRepository:Qe()}).strict();var Os=["--no-pager","-c","core.fsmonitor=false","-c","gc.auto=0","-c","maintenance.auto=false"];function Is(e){let t=/^git version (\d+)\.(\d+)/.exec(e);return!!t&&(+t[1]>2||+t[1]===2&&+t[2]>=36)}var As=(e="1")=>({GIT_OPTIONAL_LOCKS:"0",GIT_LITERAL_PATHSPECS:e,GIT_TERMINAL_PROMPT:"0",GIT_PAGER:"cat",LC_ALL:"C"});function Es(e){let t;return{terminate(){if(e.exitCode!==null||e.signalCode!==null)return;if(e.kill("SIGTERM"),t===void 0)t=setTimeout(()=>e.kill("SIGKILL"),500),t.unref()},clear(){if(t!==void 0)clearTimeout(t)}}}function Ts(e,t,r){let n=Buffer.alloc(0);return(o)=>{if(n=Buffer.concat([n,o]),n.length>e){t();return}for(;;){let i=n.indexOf(10);if(i<0)return;let s=n.subarray(0,i);n=n.subarray(i+1);let c;try{c=JSON.parse(s.toString("utf8"))}catch{t();return}if(r(c)===!1)return}}}var et=!1,Qt,Ns=!1,V,tr=()=>process.stdout.write("",()=>process.exit(0)),ye=()=>{if(et=!0,V?.cancel(),!V)tr()};process.stdin.on("error",ye);process.stdout.on("error",ye);process.stdin.on("end",()=>{if(et=!0,V?.cancel(),!V)tr()});var Ju=Ts(65536,ye,(e)=>{let t=Ss.safeParse(e);if(t.success){if(V?.id===t.data.id)V.cancel();return}let r=Ps.safeParse(e);if(!r.success||V||!er.isAbsolute(r.data.directory)||!er.isAbsolute(r.data.executable))return ye(),!1;let n=r.data;if(Qt!==void 0&&n.executable!==Qt||n.operation!=="version"&&!Ns)return ye(),!1;Qt=n.executable;let o=n.operation==="version"?["--version"]:n.operation==="root"?["rev-parse","--show-toplevel"]:n.operation==="root-ignored"?["check-ignore","--no-index","--quiet","--","."]:n.operation==="tracked"?["ls-files","--stage","-z","--","."]:["ls-files","--others","--ignored","--exclude-standard","--directory","-z","--","."],i=Cs.spawn(n.executable,[...Os,...o],{cwd:n.directory,env:{...process.env,...As(n.operation==="root-ignored"?"0":"1")},stdio:["pipe","pipe","pipe"],windowsHide:!0});i.stdin.on("error",()=>{return}),i.stdin.end();let s=Buffer.alloc(0),c=Buffer.alloc(0),u=!1,a=!1,p=!1,f=!1,d=Es(i),m=d.terminate,h=setTimeout(()=>{p=!0,m()},1e4);h.unref(),i.stdout.on("error",()=>{f=!0,m()}),i.stderr.on("error",()=>{f=!0,m()}),V={id:n.id,child:i,cancel(){a=!0,m()}},i.stdout.on("data",(_)=>{if(s.length+_.length>2097152){let x=2097152-s.length;s=Buffer.concat([s,_.subarray(0,x)]),u=!0,m()}else s=Buffer.concat([s,_])}),i.stderr.on("data",(_)=>{if(c.length<65536)c=Buffer.concat([c,_.subarray(0,65536-c.length)])}),i.on("error",()=>{return}),i.on("close",(_)=>{if(clearTimeout(h),d.clear(),n.operation==="version"&&_===0&&!u&&!a&&!p)Ns=Is(s.toString("utf8"));if(process.stdout.write(JSON.stringify({id:n.id,code:f?127:_??127,stdout:s.toString("base64"),truncated:u,cancelled:a,timedOut:p,notRepository:/not a git repository/i.test(c.toString("utf8"))})+`
|
|
59
|
+
`),V=void 0,et)tr()})});process.stdin.on("data",(e)=>{if(!et)Ju(e)});
|