@reddb-io/red-skills 3.18.8 → 3.18.9

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.
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);
3
- var gdr=Object.create;var cle=Object.defineProperty;var ydr=Object.getOwnPropertyDescriptor;var Adr=Object.getOwnPropertyNames;var bdr=Object.getPrototypeOf,xdr=Object.prototype.hasOwnProperty;var se=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var h=(e,t)=>()=>(e&&(t=e(e=0)),t);var F=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),mr=(e,t)=>{for(var r in t)cle(e,r,{get:t[r],enumerable:!0})},ale=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Adr(t))!xdr.call(e,o)&&o!==r&&cle(e,o,{get:()=>t[o],enumerable:!(n=ydr(t,o))||n.enumerable});return e},Qz=(e,t,r)=>(ale(e,t,"default"),r&&ale(r,t,"default")),Ui=(e,t,r)=>(r=e!=null?gdr(bdr(e)):{},ale(t||!e||!e.__esModule?cle(r,"default",{value:e,enumerable:!0}):r,e));function Ma(e){let t={app:e,version:Edr(pT("__RED_BUILD_VERSION__",()=>"3.18.8")??"0.0.0-dev"),gitSha:pT("__RED_BUILD_GIT_SHA__",()=>"fbc7b7727876f5bf9f6e8976475dcc9553b71e1d")??"unknown",buildTime:pT("__RED_BUILD_TIME__",()=>"2026-08-14T13:07:44-03:00")??"unknown",bundleAsset:pT("__RED_BUNDLE_ASSET__",()=>"redskilled-mcp.bundle.min.mjs")??"unknown"},r=pT("__REDDB_SDK_VERSION__",()=>""),n=pT("__REDDB_BINARY_TAG__",()=>"");return r&&(t.reddbSdkVersion=r),n&&(t.reddbBinaryTag=n),t}function Edr(e){return e.startsWith("v")?e.slice(1):e}function vKe(e){return`${e.app} ${e.version} ${e.gitSha}`}function pT(e,t){try{let r=t();return typeof r=="string"&&r.length>0?r:void 0}catch{return process.env[e.replace(/^__|__$/g,"")]}}var wA=h(()=>{});var qr,lle,Ze,tg,iF=h(()=>{(function(e){e.assertEqual=o=>{};function t(o){}e.assertIs=t;function r(o){throw new Error}e.assertNever=r,e.arrayToEnum=o=>{let s={};for(let i of o)s[i]=i;return s},e.getValidEnumValues=o=>{let s=e.objectKeys(o).filter(a=>typeof o[o[a]]!="number"),i={};for(let a of s)i[a]=o[a];return e.objectValues(i)},e.objectValues=o=>e.objectKeys(o).map(function(s){return o[s]}),e.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let s=[];for(let i in o)Object.prototype.hasOwnProperty.call(o,i)&&s.push(i);return s},e.find=(o,s)=>{for(let i of o)if(s(i))return i},e.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function n(o,s=" | "){return o.map(i=>typeof i=="string"?`'${i}'`:i).join(s)}e.joinValues=n,e.jsonStringifyReplacer=(o,s)=>typeof s=="bigint"?s.toString():s})(qr||(qr={}));(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(lle||(lle={}));Ze=qr.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),tg=e=>{switch(typeof e){case"undefined":return Ze.undefined;case"string":return Ze.string;case"number":return Number.isNaN(e)?Ze.nan:Ze.number;case"boolean":return Ze.boolean;case"function":return Ze.function;case"bigint":return Ze.bigint;case"symbol":return Ze.symbol;case"object":return Array.isArray(e)?Ze.array:e===null?Ze.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Ze.promise:typeof Map<"u"&&e instanceof Map?Ze.map:typeof Set<"u"&&e instanceof Set?Ze.set:typeof Date<"u"&&e instanceof Date?Ze.date:Ze.object;default:return Ze.unknown}}});var Ie,kdr,iu,Uz=h(()=>{iF();Ie=qr.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),kdr=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),iu=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){let r=t||function(s){return s.message},n={_errors:[]},o=s=>{for(let i of s.issues)if(i.code==="invalid_union")i.unionErrors.map(o);else if(i.code==="invalid_return_type")o(i.returnTypeError);else if(i.code==="invalid_arguments")o(i.argumentsError);else if(i.path.length===0)n._errors.push(r(i));else{let a=n,c=0;for(;c<i.path.length;){let l=i.path[c];c===i.path.length-1?(a[l]=a[l]||{_errors:[]},a[l]._errors.push(r(i))):a[l]=a[l]||{_errors:[]},a=a[l],c++}}};return o(this),n}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,qr.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r={},n=[];for(let o of this.issues)if(o.path.length>0){let s=o.path[0];r[s]=r[s]||[],r[s].push(t(o))}else n.push(t(o));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};iu.create=e=>new iu(e)});var wdr,SA,ule=h(()=>{Uz();iF();wdr=(e,t)=>{let r;switch(e.code){case Ie.invalid_type:e.received===Ze.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case Ie.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,qr.jsonStringifyReplacer)}`;break;case Ie.unrecognized_keys:r=`Unrecognized key(s) in object: ${qr.joinValues(e.keys,", ")}`;break;case Ie.invalid_union:r="Invalid input";break;case Ie.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${qr.joinValues(e.options)}`;break;case Ie.invalid_enum_value:r=`Invalid enum value. Expected ${qr.joinValues(e.options)}, received '${e.received}'`;break;case Ie.invalid_arguments:r="Invalid function arguments";break;case Ie.invalid_return_type:r="Invalid function return type";break;case Ie.invalid_date:r="Invalid date";break;case Ie.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:qr.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case Ie.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case Ie.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case Ie.custom:r="Invalid input";break;case Ie.invalid_intersection_types:r="Intersection results could not be merged";break;case Ie.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case Ie.not_finite:r="Number must be finite";break;default:r=t.defaultError,qr.assertNever(e)}return{message:r}},SA=wdr});function Sdr(e){_Ke=e}function fT(){return _Ke}var _Ke,jz=h(()=>{ule();_Ke=SA});function Ge(e,t){let r=fT(),n=aF({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===SA?void 0:SA].filter(o=>!!o)});e.common.issues.push(n)}var aF,vdr,La,Ht,Uv,Ec,Hz,Wz,vE,mT,dle=h(()=>{jz();ule();aF=e=>{let{data:t,path:r,errorMaps:n,issueData:o}=e,s=[...r,...o.path||[]],i={...o,path:s};if(o.message!==void 0)return{...o,path:s,message:o.message};let a="",c=n.filter(l=>!!l).slice().reverse();for(let l of c)a=l(i,{data:t,defaultError:a}).message;return{...o,path:s,message:a}},vdr=[];La=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let n=[];for(let o of r){if(o.status==="aborted")return Ht;o.status==="dirty"&&t.dirty(),n.push(o.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){let n=[];for(let o of r){let s=await o.key,i=await o.value;n.push({key:s,value:i})}return e.mergeObjectSync(t,n)}static mergeObjectSync(t,r){let n={};for(let o of r){let{key:s,value:i}=o;if(s.status==="aborted"||i.status==="aborted")return Ht;s.status==="dirty"&&t.dirty(),i.status==="dirty"&&t.dirty(),s.value!=="__proto__"&&(typeof i.value<"u"||o.alwaysSet)&&(n[s.value]=i.value)}return{status:t.value,value:n}}},Ht=Object.freeze({status:"aborted"}),Uv=e=>({status:"dirty",value:e}),Ec=e=>({status:"valid",value:e}),Hz=e=>e.status==="aborted",Wz=e=>e.status==="dirty",vE=e=>e.status==="valid",mT=e=>typeof Promise<"u"&&e instanceof Promise});var RKe=h(()=>{});var gt,CKe=h(()=>{(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(gt||(gt={}))});function yr(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:o}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:o}:{errorMap:(i,a)=>{let{message:c}=e;return i.code==="invalid_enum_value"?{message:c??a.defaultError}:typeof a.data>"u"?{message:c??n??a.defaultError}:i.code!=="invalid_type"?{message:a.defaultError}:{message:c??r??a.defaultError}},description:o}}function DKe(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);let r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function jdr(e){return new RegExp(`^${DKe(e)}$`)}function OKe(e){let t=`${PKe}T${DKe(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function Hdr(e,t){return!!((t==="v4"||!t)&&Ndr.test(e)||(t==="v6"||!t)&&Ldr.test(e))}function Wdr(e,t){if(!Pdr.test(e))return!1;try{let[r]=e.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),o=JSON.parse(atob(n));return!(typeof o!="object"||o===null||"typ"in o&&o?.typ!=="JWT"||!o.alg||t&&o.alg!==t)}catch{return!1}}function Gdr(e,t){return!!((t==="v4"||!t)&&Mdr.test(e)||(t==="v6"||!t)&&Fdr.test(e))}function qdr(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,o=r>n?r:n,s=Number.parseInt(e.toFixed(o).replace(".","")),i=Number.parseInt(t.toFixed(o).replace(".",""));return s%i/10**o}function hT(e){if(e instanceof cu){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=au.create(hT(n))}return new cu({...e._def,shape:()=>t})}else return e instanceof RA?new RA({...e._def,type:hT(e.element)}):e instanceof au?au.create(hT(e.unwrap())):e instanceof ng?ng.create(hT(e.unwrap())):e instanceof rg?rg.create(e.items.map(t=>hT(t))):e}function fle(e,t){let r=tg(e),n=tg(t);if(e===t)return{valid:!0,data:e};if(r===Ze.object&&n===Ze.object){let o=qr.objectKeys(t),s=qr.objectKeys(e).filter(a=>o.indexOf(a)!==-1),i={...e,...t};for(let a of s){let c=fle(e[a],t[a]);if(!c.valid)return{valid:!1};i[a]=c.data}return{valid:!0,data:i}}else if(r===Ze.array&&n===Ze.array){if(e.length!==t.length)return{valid:!1};let o=[];for(let s=0;s<e.length;s++){let i=e[s],a=t[s],c=fle(i,a);if(!c.valid)return{valid:!1};o.push(c.data)}return{valid:!0,data:o}}else return r===Ze.date&&n===Ze.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}function BKe(e,t){return new Zv({values:e,typeName:Pe.ZodEnum,...yr(t)})}function TKe(e,t){let r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}function NKe(e,t={},r){return e?RE.create().superRefine((n,o)=>{let s=e(n);if(s instanceof Promise)return s.then(i=>{if(!i){let a=TKe(t,n),c=a.fatal??r??!0;o.addIssue({code:"custom",...a,fatal:c})}});if(!s){let i=TKe(t,n),a=i.fatal??r??!0;o.addIssue({code:"custom",...i,fatal:a})}}):RE.create()}var Ep,IKe,Ir,_dr,Rdr,Cdr,Idr,Tdr,Pdr,Ddr,Odr,Bdr,ple,Ndr,Mdr,Ldr,Fdr,$dr,Qdr,PKe,Udr,_E,jv,Hv,Wv,Gv,gT,qv,zv,RE,_A,cm,yT,RA,cu,Vv,vA,Gz,Jv,rg,qz,AT,bT,zz,Kv,Yv,Zv,Xv,CE,kp,au,ng,e_,t_,xT,zdr,cF,lF,r_,Vdr,Pe,Jdr,MKe,LKe,Kdr,Ydr,FKe,Zdr,Xdr,epr,tpr,rpr,npr,opr,spr,ipr,mle,apr,cpr,lpr,upr,dpr,ppr,fpr,mpr,hpr,gpr,ypr,Apr,bpr,xpr,Epr,kpr,wpr,Spr,vpr,_pr,Rpr,Cpr,Ipr,Tpr,$Ke=h(()=>{Uz();jz();CKe();dle();iF();Ep=class{constructor(t,r,n,o){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},IKe=(e,t)=>{if(vE(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new iu(e.common.issues);return this._error=r,this._error}}};Ir=class{get description(){return this._def.description}_getType(t){return tg(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:tg(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new La,ctx:{common:t.parent.common,data:t.data,parsedType:tg(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(mT(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:tg(t)},o=this._parseSync({data:t,path:n.path,parent:n});return IKe(n,o)}"~validate"(t){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:tg(t)};if(!this["~standard"].async)try{let n=this._parseSync({data:t,path:[],parent:r});return vE(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(n=>vE(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(t,r){let n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:tg(t)},o=this._parse({data:t,path:n.path,parent:n}),s=await(mT(o)?o:Promise.resolve(o));return IKe(n,s)}refine(t,r){let n=o=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(o):r;return this._refinement((o,s)=>{let i=t(o),a=()=>s.addIssue({code:Ie.custom,...n(o)});return typeof Promise<"u"&&i instanceof Promise?i.then(c=>c?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(t,r){return this._refinement((n,o)=>t(n)?!0:(o.addIssue(typeof r=="function"?r(n,o):r),!1))}_refinement(t){return new kp({schema:this,typeName:Pe.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return au.create(this,this._def)}nullable(){return ng.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return RA.create(this)}promise(){return CE.create(this,this._def)}or(t){return Vv.create([this,t],this._def)}and(t){return Jv.create(this,t,this._def)}transform(t){return new kp({...yr(this._def),schema:this,typeName:Pe.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new e_({...yr(this._def),innerType:this,defaultValue:r,typeName:Pe.ZodDefault})}brand(){return new cF({typeName:Pe.ZodBranded,type:this,...yr(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new t_({...yr(this._def),innerType:this,catchValue:r,typeName:Pe.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return lF.create(this,t)}readonly(){return r_.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},_dr=/^c[^\s-]{8,}$/i,Rdr=/^[0-9a-z]+$/,Cdr=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Idr=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Tdr=/^[a-z0-9_-]{21}$/i,Pdr=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Ddr=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Odr=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Bdr="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Ndr=/^(?:(?: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])$/,Mdr=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,Ldr=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Fdr=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,$dr=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Qdr=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,PKe="((\\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])))",Udr=new RegExp(`^${PKe}$`);_E=class e extends Ir{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Ze.string){let s=this._getOrReturnCtx(t);return Ge(s,{code:Ie.invalid_type,expected:Ze.string,received:s.parsedType}),Ht}let n=new La,o;for(let s of this._def.checks)if(s.kind==="min")t.data.length<s.value&&(o=this._getOrReturnCtx(t,o),Ge(o,{code:Ie.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")t.data.length>s.value&&(o=this._getOrReturnCtx(t,o),Ge(o,{code:Ie.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){let i=t.data.length>s.value,a=t.data.length<s.value;(i||a)&&(o=this._getOrReturnCtx(t,o),i?Ge(o,{code:Ie.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&Ge(o,{code:Ie.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")Odr.test(t.data)||(o=this._getOrReturnCtx(t,o),Ge(o,{validation:"email",code:Ie.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")ple||(ple=new RegExp(Bdr,"u")),ple.test(t.data)||(o=this._getOrReturnCtx(t,o),Ge(o,{validation:"emoji",code:Ie.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")Idr.test(t.data)||(o=this._getOrReturnCtx(t,o),Ge(o,{validation:"uuid",code:Ie.invalid_string,message:s.message}),n.dirty());else if(s.kind==="nanoid")Tdr.test(t.data)||(o=this._getOrReturnCtx(t,o),Ge(o,{validation:"nanoid",code:Ie.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")_dr.test(t.data)||(o=this._getOrReturnCtx(t,o),Ge(o,{validation:"cuid",code:Ie.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")Rdr.test(t.data)||(o=this._getOrReturnCtx(t,o),Ge(o,{validation:"cuid2",code:Ie.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")Cdr.test(t.data)||(o=this._getOrReturnCtx(t,o),Ge(o,{validation:"ulid",code:Ie.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),Ge(o,{validation:"url",code:Ie.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(t.data)||(o=this._getOrReturnCtx(t,o),Ge(o,{validation:"regex",code:Ie.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?t.data=t.data.trim():s.kind==="includes"?t.data.includes(s.value,s.position)||(o=this._getOrReturnCtx(t,o),Ge(o,{code:Ie.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?t.data=t.data.toLowerCase():s.kind==="toUpperCase"?t.data=t.data.toUpperCase():s.kind==="startsWith"?t.data.startsWith(s.value)||(o=this._getOrReturnCtx(t,o),Ge(o,{code:Ie.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?t.data.endsWith(s.value)||(o=this._getOrReturnCtx(t,o),Ge(o,{code:Ie.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?OKe(s).test(t.data)||(o=this._getOrReturnCtx(t,o),Ge(o,{code:Ie.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="date"?Udr.test(t.data)||(o=this._getOrReturnCtx(t,o),Ge(o,{code:Ie.invalid_string,validation:"date",message:s.message}),n.dirty()):s.kind==="time"?jdr(s).test(t.data)||(o=this._getOrReturnCtx(t,o),Ge(o,{code:Ie.invalid_string,validation:"time",message:s.message}),n.dirty()):s.kind==="duration"?Ddr.test(t.data)||(o=this._getOrReturnCtx(t,o),Ge(o,{validation:"duration",code:Ie.invalid_string,message:s.message}),n.dirty()):s.kind==="ip"?Hdr(t.data,s.version)||(o=this._getOrReturnCtx(t,o),Ge(o,{validation:"ip",code:Ie.invalid_string,message:s.message}),n.dirty()):s.kind==="jwt"?Wdr(t.data,s.alg)||(o=this._getOrReturnCtx(t,o),Ge(o,{validation:"jwt",code:Ie.invalid_string,message:s.message}),n.dirty()):s.kind==="cidr"?Gdr(t.data,s.version)||(o=this._getOrReturnCtx(t,o),Ge(o,{validation:"cidr",code:Ie.invalid_string,message:s.message}),n.dirty()):s.kind==="base64"?$dr.test(t.data)||(o=this._getOrReturnCtx(t,o),Ge(o,{validation:"base64",code:Ie.invalid_string,message:s.message}),n.dirty()):s.kind==="base64url"?Qdr.test(t.data)||(o=this._getOrReturnCtx(t,o),Ge(o,{validation:"base64url",code:Ie.invalid_string,message:s.message}),n.dirty()):qr.assertNever(s);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(o=>t.test(o),{validation:r,code:Ie.invalid_string,...gt.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...gt.errToObj(t)})}url(t){return this._addCheck({kind:"url",...gt.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...gt.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...gt.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...gt.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...gt.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...gt.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...gt.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...gt.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...gt.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...gt.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...gt.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...gt.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...gt.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...gt.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...gt.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...gt.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...gt.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...gt.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...gt.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...gt.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...gt.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...gt.errToObj(r)})}nonempty(t){return this.min(1,gt.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};_E.create=e=>new _E({checks:[],typeName:Pe.ZodString,coerce:e?.coerce??!1,...yr(e)});jv=class e extends Ir{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Ze.number){let s=this._getOrReturnCtx(t);return Ge(s,{code:Ie.invalid_type,expected:Ze.number,received:s.parsedType}),Ht}let n,o=new La;for(let s of this._def.checks)s.kind==="int"?qr.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),Ge(n,{code:Ie.invalid_type,expected:"integer",received:"float",message:s.message}),o.dirty()):s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(n=this._getOrReturnCtx(t,n),Ge(n,{code:Ie.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(n=this._getOrReturnCtx(t,n),Ge(n,{code:Ie.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="multipleOf"?qdr(t.data,s.value)!==0&&(n=this._getOrReturnCtx(t,n),Ge(n,{code:Ie.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):s.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),Ge(n,{code:Ie.not_finite,message:s.message}),o.dirty()):qr.assertNever(s);return{status:o.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,gt.toString(r))}gt(t,r){return this.setLimit("min",t,!1,gt.toString(r))}lte(t,r){return this.setLimit("max",t,!0,gt.toString(r))}lt(t,r){return this.setLimit("max",t,!1,gt.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:gt.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:gt.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:gt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:gt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:gt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:gt.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:gt.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:gt.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:gt.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:gt.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&qr.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}};jv.create=e=>new jv({checks:[],typeName:Pe.ZodNumber,coerce:e?.coerce||!1,...yr(e)});Hv=class e extends Ir{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==Ze.bigint)return this._getInvalidInput(t);let n,o=new La;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(n=this._getOrReturnCtx(t,n),Ge(n,{code:Ie.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(n=this._getOrReturnCtx(t,n),Ge(n,{code:Ie.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="multipleOf"?t.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),Ge(n,{code:Ie.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):qr.assertNever(s);return{status:o.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return Ge(r,{code:Ie.invalid_type,expected:Ze.bigint,received:r.parsedType}),Ht}gte(t,r){return this.setLimit("min",t,!0,gt.toString(r))}gt(t,r){return this.setLimit("min",t,!1,gt.toString(r))}lte(t,r){return this.setLimit("max",t,!0,gt.toString(r))}lt(t,r){return this.setLimit("max",t,!1,gt.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:gt.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:gt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:gt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:gt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:gt.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:gt.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};Hv.create=e=>new Hv({checks:[],typeName:Pe.ZodBigInt,coerce:e?.coerce??!1,...yr(e)});Wv=class extends Ir{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Ze.boolean){let n=this._getOrReturnCtx(t);return Ge(n,{code:Ie.invalid_type,expected:Ze.boolean,received:n.parsedType}),Ht}return Ec(t.data)}};Wv.create=e=>new Wv({typeName:Pe.ZodBoolean,coerce:e?.coerce||!1,...yr(e)});Gv=class e extends Ir{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Ze.date){let s=this._getOrReturnCtx(t);return Ge(s,{code:Ie.invalid_type,expected:Ze.date,received:s.parsedType}),Ht}if(Number.isNaN(t.data.getTime())){let s=this._getOrReturnCtx(t);return Ge(s,{code:Ie.invalid_date}),Ht}let n=new La,o;for(let s of this._def.checks)s.kind==="min"?t.data.getTime()<s.value&&(o=this._getOrReturnCtx(t,o),Ge(o,{code:Ie.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?t.data.getTime()>s.value&&(o=this._getOrReturnCtx(t,o),Ge(o,{code:Ie.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):qr.assertNever(s);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:gt.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:gt.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};Gv.create=e=>new Gv({checks:[],coerce:e?.coerce||!1,typeName:Pe.ZodDate,...yr(e)});gT=class extends Ir{_parse(t){if(this._getType(t)!==Ze.symbol){let n=this._getOrReturnCtx(t);return Ge(n,{code:Ie.invalid_type,expected:Ze.symbol,received:n.parsedType}),Ht}return Ec(t.data)}};gT.create=e=>new gT({typeName:Pe.ZodSymbol,...yr(e)});qv=class extends Ir{_parse(t){if(this._getType(t)!==Ze.undefined){let n=this._getOrReturnCtx(t);return Ge(n,{code:Ie.invalid_type,expected:Ze.undefined,received:n.parsedType}),Ht}return Ec(t.data)}};qv.create=e=>new qv({typeName:Pe.ZodUndefined,...yr(e)});zv=class extends Ir{_parse(t){if(this._getType(t)!==Ze.null){let n=this._getOrReturnCtx(t);return Ge(n,{code:Ie.invalid_type,expected:Ze.null,received:n.parsedType}),Ht}return Ec(t.data)}};zv.create=e=>new zv({typeName:Pe.ZodNull,...yr(e)});RE=class extends Ir{constructor(){super(...arguments),this._any=!0}_parse(t){return Ec(t.data)}};RE.create=e=>new RE({typeName:Pe.ZodAny,...yr(e)});_A=class extends Ir{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Ec(t.data)}};_A.create=e=>new _A({typeName:Pe.ZodUnknown,...yr(e)});cm=class extends Ir{_parse(t){let r=this._getOrReturnCtx(t);return Ge(r,{code:Ie.invalid_type,expected:Ze.never,received:r.parsedType}),Ht}};cm.create=e=>new cm({typeName:Pe.ZodNever,...yr(e)});yT=class extends Ir{_parse(t){if(this._getType(t)!==Ze.undefined){let n=this._getOrReturnCtx(t);return Ge(n,{code:Ie.invalid_type,expected:Ze.void,received:n.parsedType}),Ht}return Ec(t.data)}};yT.create=e=>new yT({typeName:Pe.ZodVoid,...yr(e)});RA=class e extends Ir{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),o=this._def;if(r.parsedType!==Ze.array)return Ge(r,{code:Ie.invalid_type,expected:Ze.array,received:r.parsedType}),Ht;if(o.exactLength!==null){let i=r.data.length>o.exactLength.value,a=r.data.length<o.exactLength.value;(i||a)&&(Ge(r,{code:i?Ie.too_big:Ie.too_small,minimum:a?o.exactLength.value:void 0,maximum:i?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),n.dirty())}if(o.minLength!==null&&r.data.length<o.minLength.value&&(Ge(r,{code:Ie.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),n.dirty()),o.maxLength!==null&&r.data.length>o.maxLength.value&&(Ge(r,{code:Ie.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((i,a)=>o.type._parseAsync(new Ep(r,i,r.path,a)))).then(i=>La.mergeArray(n,i));let s=[...r.data].map((i,a)=>o.type._parseSync(new Ep(r,i,r.path,a)));return La.mergeArray(n,s)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:gt.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:gt.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:gt.toString(r)}})}nonempty(t){return this.min(1,t)}};RA.create=(e,t)=>new RA({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Pe.ZodArray,...yr(t)});cu=class e extends Ir{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=qr.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==Ze.object){let l=this._getOrReturnCtx(t);return Ge(l,{code:Ie.invalid_type,expected:Ze.object,received:l.parsedType}),Ht}let{status:n,ctx:o}=this._processInputParams(t),{shape:s,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof cm&&this._def.unknownKeys==="strip"))for(let l in o.data)i.includes(l)||a.push(l);let c=[];for(let l of i){let u=s[l],d=o.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new Ep(o,d,o.path,l)),alwaysSet:l in o.data})}if(this._def.catchall instanceof cm){let l=this._def.unknownKeys;if(l==="passthrough")for(let u of a)c.push({key:{status:"valid",value:u},value:{status:"valid",value:o.data[u]}});else if(l==="strict")a.length>0&&(Ge(o,{code:Ie.unrecognized_keys,keys:a}),n.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let u of a){let d=o.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new Ep(o,d,o.path,u)),alwaysSet:u in o.data})}}return o.common.async?Promise.resolve().then(async()=>{let l=[];for(let u of c){let d=await u.key,p=await u.value;l.push({key:d,value:p,alwaysSet:u.alwaysSet})}return l}).then(l=>La.mergeObjectSync(n,l)):La.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(t){return gt.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{let o=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:gt.errToObj(t).message??o}:{message:o}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Pe.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let r={};for(let n of qr.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}omit(t){let r={};for(let n of qr.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}deepPartial(){return hT(this)}partial(t){let r={};for(let n of qr.objectKeys(this.shape)){let o=this.shape[n];t&&!t[n]?r[n]=o:r[n]=o.optional()}return new e({...this._def,shape:()=>r})}required(t){let r={};for(let n of qr.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof au;)s=s._def.innerType;r[n]=s}return new e({...this._def,shape:()=>r})}keyof(){return BKe(qr.objectKeys(this.shape))}};cu.create=(e,t)=>new cu({shape:()=>e,unknownKeys:"strip",catchall:cm.create(),typeName:Pe.ZodObject,...yr(t)});cu.strictCreate=(e,t)=>new cu({shape:()=>e,unknownKeys:"strict",catchall:cm.create(),typeName:Pe.ZodObject,...yr(t)});cu.lazycreate=(e,t)=>new cu({shape:e,unknownKeys:"strip",catchall:cm.create(),typeName:Pe.ZodObject,...yr(t)});Vv=class extends Ir{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function o(s){for(let a of s)if(a.result.status==="valid")return a.result;for(let a of s)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;let i=s.map(a=>new iu(a.ctx.common.issues));return Ge(r,{code:Ie.invalid_union,unionErrors:i}),Ht}if(r.common.async)return Promise.all(n.map(async s=>{let i={...r,common:{...r.common,issues:[]},parent:null};return{result:await s._parseAsync({data:r.data,path:r.path,parent:i}),ctx:i}})).then(o);{let s,i=[];for(let c of n){let l={...r,common:{...r.common,issues:[]},parent:null},u=c._parseSync({data:r.data,path:r.path,parent:l});if(u.status==="valid")return u;u.status==="dirty"&&!s&&(s={result:u,ctx:l}),l.common.issues.length&&i.push(l.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;let a=i.map(c=>new iu(c));return Ge(r,{code:Ie.invalid_union,unionErrors:a}),Ht}}get options(){return this._def.options}};Vv.create=(e,t)=>new Vv({options:e,typeName:Pe.ZodUnion,...yr(t)});vA=e=>e instanceof Kv?vA(e.schema):e instanceof kp?vA(e.innerType()):e instanceof Yv?[e.value]:e instanceof Zv?e.options:e instanceof Xv?qr.objectValues(e.enum):e instanceof e_?vA(e._def.innerType):e instanceof qv?[void 0]:e instanceof zv?[null]:e instanceof au?[void 0,...vA(e.unwrap())]:e instanceof ng?[null,...vA(e.unwrap())]:e instanceof cF||e instanceof r_?vA(e.unwrap()):e instanceof t_?vA(e._def.innerType):[],Gz=class e extends Ir{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==Ze.object)return Ge(r,{code:Ie.invalid_type,expected:Ze.object,received:r.parsedType}),Ht;let n=this.discriminator,o=r.data[n],s=this.optionsMap.get(o);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(Ge(r,{code:Ie.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Ht)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){let o=new Map;for(let s of r){let i=vA(s.shape[t]);if(!i.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let a of i){if(o.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);o.set(a,s)}}return new e({typeName:Pe.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:o,...yr(n)})}};Jv=class extends Ir{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),o=(s,i)=>{if(Hz(s)||Hz(i))return Ht;let a=fle(s.value,i.value);return a.valid?((Wz(s)||Wz(i))&&r.dirty(),{status:r.value,value:a.data}):(Ge(n,{code:Ie.invalid_intersection_types}),Ht)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,i])=>o(s,i)):o(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};Jv.create=(e,t,r)=>new Jv({left:e,right:t,typeName:Pe.ZodIntersection,...yr(r)});rg=class e extends Ir{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==Ze.array)return Ge(n,{code:Ie.invalid_type,expected:Ze.array,received:n.parsedType}),Ht;if(n.data.length<this._def.items.length)return Ge(n,{code:Ie.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ht;!this._def.rest&&n.data.length>this._def.items.length&&(Ge(n,{code:Ie.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let s=[...n.data].map((i,a)=>{let c=this._def.items[a]||this._def.rest;return c?c._parse(new Ep(n,i,n.path,a)):null}).filter(i=>!!i);return n.common.async?Promise.all(s).then(i=>La.mergeArray(r,i)):La.mergeArray(r,s)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};rg.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new rg({items:e,typeName:Pe.ZodTuple,rest:null,...yr(t)})};qz=class e extends Ir{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==Ze.object)return Ge(n,{code:Ie.invalid_type,expected:Ze.object,received:n.parsedType}),Ht;let o=[],s=this._def.keyType,i=this._def.valueType;for(let a in n.data)o.push({key:s._parse(new Ep(n,a,n.path,a)),value:i._parse(new Ep(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?La.mergeObjectAsync(r,o):La.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof Ir?new e({keyType:t,valueType:r,typeName:Pe.ZodRecord,...yr(n)}):new e({keyType:_E.create(),valueType:t,typeName:Pe.ZodRecord,...yr(r)})}},AT=class extends Ir{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==Ze.map)return Ge(n,{code:Ie.invalid_type,expected:Ze.map,received:n.parsedType}),Ht;let o=this._def.keyType,s=this._def.valueType,i=[...n.data.entries()].map(([a,c],l)=>({key:o._parse(new Ep(n,a,n.path,[l,"key"])),value:s._parse(new Ep(n,c,n.path,[l,"value"]))}));if(n.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let c of i){let l=await c.key,u=await c.value;if(l.status==="aborted"||u.status==="aborted")return Ht;(l.status==="dirty"||u.status==="dirty")&&r.dirty(),a.set(l.value,u.value)}return{status:r.value,value:a}})}else{let a=new Map;for(let c of i){let l=c.key,u=c.value;if(l.status==="aborted"||u.status==="aborted")return Ht;(l.status==="dirty"||u.status==="dirty")&&r.dirty(),a.set(l.value,u.value)}return{status:r.value,value:a}}}};AT.create=(e,t,r)=>new AT({valueType:t,keyType:e,typeName:Pe.ZodMap,...yr(r)});bT=class e extends Ir{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==Ze.set)return Ge(n,{code:Ie.invalid_type,expected:Ze.set,received:n.parsedType}),Ht;let o=this._def;o.minSize!==null&&n.data.size<o.minSize.value&&(Ge(n,{code:Ie.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),r.dirty()),o.maxSize!==null&&n.data.size>o.maxSize.value&&(Ge(n,{code:Ie.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),r.dirty());let s=this._def.valueType;function i(c){let l=new Set;for(let u of c){if(u.status==="aborted")return Ht;u.status==="dirty"&&r.dirty(),l.add(u.value)}return{status:r.value,value:l}}let a=[...n.data.values()].map((c,l)=>s._parse(new Ep(n,c,n.path,l)));return n.common.async?Promise.all(a).then(c=>i(c)):i(a)}min(t,r){return new e({...this._def,minSize:{value:t,message:gt.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:gt.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};bT.create=(e,t)=>new bT({valueType:e,minSize:null,maxSize:null,typeName:Pe.ZodSet,...yr(t)});zz=class e extends Ir{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==Ze.function)return Ge(r,{code:Ie.invalid_type,expected:Ze.function,received:r.parsedType}),Ht;function n(a,c){return aF({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,fT(),SA].filter(l=>!!l),issueData:{code:Ie.invalid_arguments,argumentsError:c}})}function o(a,c){return aF({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,fT(),SA].filter(l=>!!l),issueData:{code:Ie.invalid_return_type,returnTypeError:c}})}let s={errorMap:r.common.contextualErrorMap},i=r.data;if(this._def.returns instanceof CE){let a=this;return Ec(async function(...c){let l=new iu([]),u=await a._def.args.parseAsync(c,s).catch(f=>{throw l.addIssue(n(c,f)),l}),d=await Reflect.apply(i,this,u);return await a._def.returns._def.type.parseAsync(d,s).catch(f=>{throw l.addIssue(o(d,f)),l})})}else{let a=this;return Ec(function(...c){let l=a._def.args.safeParse(c,s);if(!l.success)throw new iu([n(c,l.error)]);let u=Reflect.apply(i,this,l.data),d=a._def.returns.safeParse(u,s);if(!d.success)throw new iu([o(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:rg.create(t).rest(_A.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new e({args:t||rg.create([]).rest(_A.create()),returns:r||_A.create(),typeName:Pe.ZodFunction,...yr(n)})}},Kv=class extends Ir{get schema(){return this._def.getter()}_parse(t){let{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};Kv.create=(e,t)=>new Kv({getter:e,typeName:Pe.ZodLazy,...yr(t)});Yv=class extends Ir{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return Ge(r,{received:r.data,code:Ie.invalid_literal,expected:this._def.value}),Ht}return{status:"valid",value:t.data}}get value(){return this._def.value}};Yv.create=(e,t)=>new Yv({value:e,typeName:Pe.ZodLiteral,...yr(t)});Zv=class e extends Ir{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return Ge(r,{expected:qr.joinValues(n),received:r.parsedType,code:Ie.invalid_type}),Ht}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let r=this._getOrReturnCtx(t),n=this._def.values;return Ge(r,{received:r.data,code:Ie.invalid_enum_value,options:n}),Ht}return Ec(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return e.create(t,{...this._def,...r})}exclude(t,r=this._def){return e.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}};Zv.create=BKe;Xv=class extends Ir{_parse(t){let r=qr.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==Ze.string&&n.parsedType!==Ze.number){let o=qr.objectValues(r);return Ge(n,{expected:qr.joinValues(o),received:n.parsedType,code:Ie.invalid_type}),Ht}if(this._cache||(this._cache=new Set(qr.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let o=qr.objectValues(r);return Ge(n,{received:n.data,code:Ie.invalid_enum_value,options:o}),Ht}return Ec(t.data)}get enum(){return this._def.values}};Xv.create=(e,t)=>new Xv({values:e,typeName:Pe.ZodNativeEnum,...yr(t)});CE=class extends Ir{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==Ze.promise&&r.common.async===!1)return Ge(r,{code:Ie.invalid_type,expected:Ze.promise,received:r.parsedType}),Ht;let n=r.parsedType===Ze.promise?r.data:Promise.resolve(r.data);return Ec(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};CE.create=(e,t)=>new CE({type:e,typeName:Pe.ZodPromise,...yr(t)});kp=class extends Ir{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Pe.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:r,ctx:n}=this._processInputParams(t),o=this._def.effect||null,s={addIssue:i=>{Ge(n,i),i.fatal?r.abort():r.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),o.type==="preprocess"){let i=o.transform(n.data,s);if(n.common.async)return Promise.resolve(i).then(async a=>{if(r.value==="aborted")return Ht;let c=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return c.status==="aborted"?Ht:c.status==="dirty"?Uv(c.value):r.value==="dirty"?Uv(c.value):c});{if(r.value==="aborted")return Ht;let a=this._def.schema._parseSync({data:i,path:n.path,parent:n});return a.status==="aborted"?Ht:a.status==="dirty"?Uv(a.value):r.value==="dirty"?Uv(a.value):a}}if(o.type==="refinement"){let i=a=>{let c=o.refinement(a,s);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?Ht:(a.status==="dirty"&&r.dirty(),i(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?Ht:(a.status==="dirty"&&r.dirty(),i(a.value).then(()=>({status:r.value,value:a.value}))))}if(o.type==="transform")if(n.common.async===!1){let i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!vE(i))return Ht;let a=o.transform(i.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(i=>vE(i)?Promise.resolve(o.transform(i.value,s)).then(a=>({status:r.value,value:a})):Ht);qr.assertNever(o)}};kp.create=(e,t,r)=>new kp({schema:e,typeName:Pe.ZodEffects,effect:t,...yr(r)});kp.createWithPreprocess=(e,t,r)=>new kp({schema:t,effect:{type:"preprocess",transform:e},typeName:Pe.ZodEffects,...yr(r)});au=class extends Ir{_parse(t){return this._getType(t)===Ze.undefined?Ec(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};au.create=(e,t)=>new au({innerType:e,typeName:Pe.ZodOptional,...yr(t)});ng=class extends Ir{_parse(t){return this._getType(t)===Ze.null?Ec(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};ng.create=(e,t)=>new ng({innerType:e,typeName:Pe.ZodNullable,...yr(t)});e_=class extends Ir{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===Ze.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};e_.create=(e,t)=>new e_({innerType:e,typeName:Pe.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...yr(t)});t_=class extends Ir{_parse(t){let{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},o=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return mT(o)?o.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new iu(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new iu(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};t_.create=(e,t)=>new t_({innerType:e,typeName:Pe.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...yr(t)});xT=class extends Ir{_parse(t){if(this._getType(t)!==Ze.nan){let n=this._getOrReturnCtx(t);return Ge(n,{code:Ie.invalid_type,expected:Ze.nan,received:n.parsedType}),Ht}return{status:"valid",value:t.data}}};xT.create=e=>new xT({typeName:Pe.ZodNaN,...yr(e)});zdr=Symbol("zod_brand"),cF=class extends Ir{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},lF=class e extends Ir{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{let s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?Ht:s.status==="dirty"?(r.dirty(),Uv(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})})();{let o=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?Ht:o.status==="dirty"?(r.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:n.path,parent:n})}}static create(t,r){return new e({in:t,out:r,typeName:Pe.ZodPipeline})}},r_=class extends Ir{_parse(t){let r=this._def.innerType._parse(t),n=o=>(vE(o)&&(o.value=Object.freeze(o.value)),o);return mT(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}};r_.create=(e,t)=>new r_({innerType:e,typeName:Pe.ZodReadonly,...yr(t)});Vdr={object:cu.lazycreate};(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Pe||(Pe={}));Jdr=(e,t={message:`Input not instance of ${e.name}`})=>NKe(r=>r instanceof e,t),MKe=_E.create,LKe=jv.create,Kdr=xT.create,Ydr=Hv.create,FKe=Wv.create,Zdr=Gv.create,Xdr=gT.create,epr=qv.create,tpr=zv.create,rpr=RE.create,npr=_A.create,opr=cm.create,spr=yT.create,ipr=RA.create,mle=cu.create,apr=cu.strictCreate,cpr=Vv.create,lpr=Gz.create,upr=Jv.create,dpr=rg.create,ppr=qz.create,fpr=AT.create,mpr=bT.create,hpr=zz.create,gpr=Kv.create,ypr=Yv.create,Apr=Zv.create,bpr=Xv.create,xpr=CE.create,Epr=kp.create,kpr=au.create,wpr=ng.create,Spr=kp.createWithPreprocess,vpr=lF.create,_pr=()=>MKe().optional(),Rpr=()=>LKe().optional(),Cpr=()=>FKe().optional(),Ipr={string:e=>_E.create({...e,coerce:!0}),number:e=>jv.create({...e,coerce:!0}),boolean:e=>Wv.create({...e,coerce:!0}),bigint:e=>Hv.create({...e,coerce:!0}),date:e=>Gv.create({...e,coerce:!0})},Tpr=Ht});var Ae={};mr(Ae,{BRAND:()=>zdr,DIRTY:()=>Uv,EMPTY_PATH:()=>vdr,INVALID:()=>Ht,NEVER:()=>Tpr,OK:()=>Ec,ParseStatus:()=>La,Schema:()=>Ir,ZodAny:()=>RE,ZodArray:()=>RA,ZodBigInt:()=>Hv,ZodBoolean:()=>Wv,ZodBranded:()=>cF,ZodCatch:()=>t_,ZodDate:()=>Gv,ZodDefault:()=>e_,ZodDiscriminatedUnion:()=>Gz,ZodEffects:()=>kp,ZodEnum:()=>Zv,ZodError:()=>iu,ZodFirstPartyTypeKind:()=>Pe,ZodFunction:()=>zz,ZodIntersection:()=>Jv,ZodIssueCode:()=>Ie,ZodLazy:()=>Kv,ZodLiteral:()=>Yv,ZodMap:()=>AT,ZodNaN:()=>xT,ZodNativeEnum:()=>Xv,ZodNever:()=>cm,ZodNull:()=>zv,ZodNullable:()=>ng,ZodNumber:()=>jv,ZodObject:()=>cu,ZodOptional:()=>au,ZodParsedType:()=>Ze,ZodPipeline:()=>lF,ZodPromise:()=>CE,ZodReadonly:()=>r_,ZodRecord:()=>qz,ZodSchema:()=>Ir,ZodSet:()=>bT,ZodString:()=>_E,ZodSymbol:()=>gT,ZodTransformer:()=>kp,ZodTuple:()=>rg,ZodType:()=>Ir,ZodUndefined:()=>qv,ZodUnion:()=>Vv,ZodUnknown:()=>_A,ZodVoid:()=>yT,addIssueToContext:()=>Ge,any:()=>rpr,array:()=>ipr,bigint:()=>Ydr,boolean:()=>FKe,coerce:()=>Ipr,custom:()=>NKe,date:()=>Zdr,datetimeRegex:()=>OKe,defaultErrorMap:()=>SA,discriminatedUnion:()=>lpr,effect:()=>Epr,enum:()=>Apr,function:()=>hpr,getErrorMap:()=>fT,getParsedType:()=>tg,instanceof:()=>Jdr,intersection:()=>upr,isAborted:()=>Hz,isAsync:()=>mT,isDirty:()=>Wz,isValid:()=>vE,late:()=>Vdr,lazy:()=>gpr,literal:()=>ypr,makeIssue:()=>aF,map:()=>fpr,nan:()=>Kdr,nativeEnum:()=>bpr,never:()=>opr,null:()=>tpr,nullable:()=>wpr,number:()=>LKe,object:()=>mle,objectUtil:()=>lle,oboolean:()=>Cpr,onumber:()=>Rpr,optional:()=>kpr,ostring:()=>_pr,pipeline:()=>vpr,preprocess:()=>Spr,promise:()=>xpr,quotelessJson:()=>kdr,record:()=>ppr,set:()=>mpr,setErrorMap:()=>Sdr,strictObject:()=>apr,string:()=>MKe,symbol:()=>Xdr,transformer:()=>Epr,tuple:()=>dpr,undefined:()=>epr,union:()=>cpr,unknown:()=>npr,util:()=>qr,void:()=>spr});var Vz=h(()=>{jz();dle();RKe();iF();$Ke();Uz()});var uF=h(()=>{Vz()});function ye(e,t,r){function n(a,c){var l;Object.defineProperty(a,"_zod",{value:a._zod??{},enumerable:!1}),(l=a._zod).traits??(l.traits=new Set),a._zod.traits.add(e),t(a,c);for(let u in i.prototype)u in a||Object.defineProperty(a,u,{value:i.prototype[u].bind(a)});a._zod.constr=i,a._zod.def=c}let o=r?.Parent??Object;class s extends o{}Object.defineProperty(s,"name",{value:e});function i(a){var c;let l=r?.Parent?new s:this;n(l,a),(c=l._zod).deferred??(c.deferred=[]);for(let u of l._zod.deferred)u();return l}return Object.defineProperty(i,"init",{value:n}),Object.defineProperty(i,Symbol.hasInstance,{value:a=>r?.Parent&&a instanceof r.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}function dd(e){return e&&Object.assign(Jz,e),Jz}var Dpr,Opr,CA,Jz,ET=h(()=>{Dpr=Object.freeze({status:"aborted"});Opr=Symbol("zod_brand"),CA=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Jz={}});var Zr={};mr(Zr,{BIGINT_FORMAT_RANGES:()=>UKe,Class:()=>gle,NUMBER_FORMAT_RANGES:()=>wle,aborted:()=>o_,allowsEval:()=>xle,assert:()=>Fpr,assertEqual:()=>Bpr,assertIs:()=>Mpr,assertNever:()=>Lpr,assertNotEqual:()=>Npr,assignProp:()=>ble,cached:()=>fF,captureStackTrace:()=>Yz,cleanEnum:()=>Ypr,cleanRegex:()=>hF,clone:()=>pd,createTransparentProxy:()=>Wpr,defineLazy:()=>Do,esc:()=>n_,escapeRegex:()=>IE,extend:()=>zpr,finalizeIssue:()=>lm,floatSafeRemainder:()=>Ale,getElementAtPath:()=>$pr,getEnumValues:()=>pF,getLengthableOrigin:()=>gF,getParsedType:()=>Hpr,getSizableOrigin:()=>jKe,isObject:()=>kT,isPlainObject:()=>wT,issue:()=>Sle,joinValues:()=>Kz,jsonStringifyReplacer:()=>yle,merge:()=>Vpr,normalizeParams:()=>Wt,nullish:()=>mF,numKeys:()=>jpr,omit:()=>qpr,optionalKeys:()=>kle,partial:()=>Jpr,pick:()=>Gpr,prefixIssues:()=>og,primitiveTypes:()=>QKe,promiseAllObject:()=>Qpr,propertyKeyTypes:()=>Ele,randomString:()=>Upr,required:()=>Kpr,stringifyPrimitive:()=>Zz,unwrapMessage:()=>dF});function Bpr(e){return e}function Npr(e){return e}function Mpr(e){}function Lpr(e){throw new Error}function Fpr(e){}function pF(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 Kz(e,t="|"){return e.map(r=>Zz(r)).join(t)}function yle(e,t){return typeof t=="bigint"?t.toString():t}function fF(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function mF(e){return e==null}function hF(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function Ale(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,o=r>n?r:n,s=Number.parseInt(e.toFixed(o).replace(".","")),i=Number.parseInt(t.toFixed(o).replace(".",""));return s%i/10**o}function Do(e,t,r){Object.defineProperty(e,t,{get(){{let o=r();return e[t]=o,o}throw new Error("cached value already set")},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function ble(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function $pr(e,t){return t?t.reduce((r,n)=>r?.[n],e):e}function Qpr(e){let t=Object.keys(e),r=t.map(n=>e[n]);return Promise.all(r).then(n=>{let o={};for(let s=0;s<t.length;s++)o[t[s]]=n[s];return o})}function Upr(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<e;n++)r+=t[Math.floor(Math.random()*t.length)];return r}function n_(e){return JSON.stringify(e)}function kT(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function wT(e){if(kT(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;let r=t.prototype;return!(kT(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function jpr(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}function IE(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function pd(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function Wt(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Wpr(e){let t;return new Proxy({},{get(r,n,o){return t??(t=e()),Reflect.get(t,n,o)},set(r,n,o,s){return t??(t=e()),Reflect.set(t,n,o,s)},has(r,n){return t??(t=e()),Reflect.has(t,n)},deleteProperty(r,n){return t??(t=e()),Reflect.deleteProperty(t,n)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,n){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,n)},defineProperty(r,n,o){return t??(t=e()),Reflect.defineProperty(t,n,o)}})}function Zz(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function kle(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}function Gpr(e,t){let r={},n=e._zod.def;for(let o in t){if(!(o in n.shape))throw new Error(`Unrecognized key: "${o}"`);t[o]&&(r[o]=n.shape[o])}return pd(e,{...e._zod.def,shape:r,checks:[]})}function qpr(e,t){let r={...e._zod.def.shape},n=e._zod.def;for(let o in t){if(!(o in n.shape))throw new Error(`Unrecognized key: "${o}"`);t[o]&&delete r[o]}return pd(e,{...e._zod.def,shape:r,checks:[]})}function zpr(e,t){if(!wT(t))throw new Error("Invalid input to extend: expected a plain object");let r={...e._zod.def,get shape(){let n={...e._zod.def.shape,...t};return ble(this,"shape",n),n},checks:[]};return pd(e,r)}function Vpr(e,t){return pd(e,{...e._zod.def,get shape(){let r={...e._zod.def.shape,...t._zod.def.shape};return ble(this,"shape",r),r},catchall:t._zod.def.catchall,checks:[]})}function Jpr(e,t,r){let n=t._zod.def.shape,o={...n};if(r)for(let s in r){if(!(s in n))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(o[s]=e?new e({type:"optional",innerType:n[s]}):n[s])}else for(let s in n)o[s]=e?new e({type:"optional",innerType:n[s]}):n[s];return pd(t,{...t._zod.def,shape:o,checks:[]})}function Kpr(e,t,r){let n=t._zod.def.shape,o={...n};if(r)for(let s in r){if(!(s in o))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(o[s]=new e({type:"nonoptional",innerType:n[s]}))}else for(let s in n)o[s]=new e({type:"nonoptional",innerType:n[s]});return pd(t,{...t._zod.def,shape:o,checks:[]})}function o_(e,t=0){for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function og(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function dF(e){return typeof e=="string"?e:e?.message}function lm(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let o=dF(e.inst?._zod.def?.error?.(e))??dF(t?.error?.(e))??dF(r.customError?.(e))??dF(r.localeError?.(e))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function jKe(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function gF(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Sle(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}function Ypr(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}var Yz,xle,Hpr,Ele,QKe,wle,UKe,gle,sg=h(()=>{Yz=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};xle=fF(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});Hpr=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},Ele=new Set(["string","number","symbol"]),QKe=new Set(["string","number","bigint","boolean","symbol","undefined"]);wle={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},UKe={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};gle=class{constructor(...t){}}});function vle(e,t=r=>r.message){let r={},n=[];for(let o of e.issues)o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(t(o))):n.push(t(o));return{formErrors:n,fieldErrors:r}}function _le(e,t){let r=t||function(s){return s.message},n={_errors:[]},o=s=>{for(let i of s.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(a=>o({issues:a}));else if(i.code==="invalid_key")o({issues:i.issues});else if(i.code==="invalid_element")o({issues:i.issues});else if(i.path.length===0)n._errors.push(r(i));else{let a=n,c=0;for(;c<i.path.length;){let l=i.path[c];c===i.path.length-1?(a[l]=a[l]||{_errors:[]},a[l]._errors.push(r(i))):a[l]=a[l]||{_errors:[]},a=a[l],c++}}};return o(e),n}var HKe,Xz,yF,Rle=h(()=>{ET();sg();HKe=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get(){return JSON.stringify(t,yle,2)},enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Xz=ye("$ZodError",HKe),yF=ye("$ZodError",HKe,{Parent:Error})});var Cle,Ile,Tle,Ple,Dle,s_,Ole,i_,Ble=h(()=>{ET();Rle();sg();Cle=e=>(t,r,n,o)=>{let s=n?Object.assign(n,{async:!1}):{async:!1},i=t._zod.run({value:r,issues:[]},s);if(i instanceof Promise)throw new CA;if(i.issues.length){let a=new(o?.Err??e)(i.issues.map(c=>lm(c,s,dd())));throw Yz(a,o?.callee),a}return i.value},Ile=Cle(yF),Tle=e=>async(t,r,n,o)=>{let s=n?Object.assign(n,{async:!0}):{async:!0},i=t._zod.run({value:r,issues:[]},s);if(i instanceof Promise&&(i=await i),i.issues.length){let a=new(o?.Err??e)(i.issues.map(c=>lm(c,s,dd())));throw Yz(a,o?.callee),a}return i.value},Ple=Tle(yF),Dle=e=>(t,r,n)=>{let o=n?{...n,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new CA;return s.issues.length?{success:!1,error:new(e??Xz)(s.issues.map(i=>lm(i,o,dd())))}:{success:!0,data:s.value}},s_=Dle(yF),Ole=e=>async(t,r,n)=>{let o=n?Object.assign(n,{async:!0}):{async:!0},s=t._zod.run({value:r,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(i=>lm(i,o,dd())))}:{success:!0,data:s.value}},i_=Ole(yF)});function XKe(){return new RegExp(Xpr,"u")}function lYe(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function uYe(e){return new RegExp(`^${lYe(e)}$`)}function dYe(e){let t=lYe({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-]\\d{2}:\\d{2})");let n=`${t}(?:${r.join("|")})`;return new RegExp(`^${aYe}T(?:${n})$`)}var WKe,GKe,qKe,zKe,VKe,JKe,KKe,YKe,Nle,ZKe,Xpr,eYe,tYe,rYe,nYe,oYe,Mle,sYe,iYe,aYe,cYe,pYe,fYe,mYe,hYe,gYe,yYe,AYe,tV=h(()=>{WKe=/^[cC][^\s-]{8,}$/,GKe=/^[0-9a-z]+$/,qKe=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,zKe=/^[0-9a-vA-V]{20}$/,VKe=/^[A-Za-z0-9]{27}$/,JKe=/^[a-zA-Z0-9_-]{21}$/,KKe=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,YKe=/^([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})$/,Nle=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,ZKe=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Xpr="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";eYe=/^(?:(?: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])$/,tYe=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,rYe=/^((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])$/,nYe=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,oYe=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Mle=/^[A-Za-z0-9_-]*$/,sYe=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,iYe=/^\+(?:[0-9]){6,14}[0-9]$/,aYe="(?:(?:\\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])))",cYe=new RegExp(`^${aYe}$`);pYe=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},fYe=/^\d+$/,mYe=/^-?\d+(?:\.\d+)?/i,hYe=/true|false/i,gYe=/null/i,yYe=/^[^A-Z]*$/,AYe=/^[^a-z]*$/});var Fa,bYe,Lle,Fle,xYe,EYe,kYe,wYe,SYe,AF,vYe,_Ye,RYe,CYe,IYe,TYe,PYe,rV=h(()=>{ET();tV();sg();Fa=ye("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),bYe={number:"number",bigint:"bigint",object:"date"},Lle=ye("$ZodCheckLessThan",(e,t)=>{Fa.init(e,t);let r=bYe[typeof t.value];e._zod.onattach.push(n=>{let o=n._zod.bag,s=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<s&&(t.inclusive?o.maximum=t.value:o.exclusiveMaximum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:r,code:"too_big",maximum:t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Fle=ye("$ZodCheckGreaterThan",(e,t)=>{Fa.init(e,t);let r=bYe[typeof t.value];e._zod.onattach.push(n=>{let o=n._zod.bag,s=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),xYe=ye("$ZodCheckMultipleOf",(e,t)=>{Fa.init(e,t),e._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):Ale(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),EYe=ye("$ZodCheckNumberFormat",(e,t)=>{Fa.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[o,s]=wle[t.format];e._zod.onattach.push(i=>{let a=i._zod.bag;a.format=t.format,a.minimum=o,a.maximum=s,r&&(a.pattern=fYe)}),e._zod.check=i=>{let a=i.value;if(r){if(!Number.isInteger(a)){i.issues.push({expected:n,format:t.format,code:"invalid_type",input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?i.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,continue:!t.abort}):i.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,continue:!t.abort});return}}a<o&&i.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),a>s&&i.issues.push({origin:"number",input:a,code:"too_big",maximum:s,inst:e})}}),kYe=ye("$ZodCheckMaxLength",(e,t)=>{var r;Fa.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!mF(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{let o=n._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(n._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let o=n.value;if(o.length<=t.maximum)return;let i=gF(o);n.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),wYe=ye("$ZodCheckMinLength",(e,t)=>{var r;Fa.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!mF(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{let o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let o=n.value;if(o.length>=t.minimum)return;let i=gF(o);n.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),SYe=ye("$ZodCheckLengthEquals",(e,t)=>{var r;Fa.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!mF(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{let o=n._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=n=>{let o=n.value,s=o.length;if(s===t.length)return;let i=gF(o),a=s>t.length;n.issues.push({origin:i,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),AF=ye("$ZodCheckStringFormat",(e,t)=>{var r,n;Fa.init(e,t),e._zod.onattach.push(o=>{let s=o._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&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})}):(n=e._zod).check??(n.check=()=>{})}),vYe=ye("$ZodCheckRegex",(e,t)=>{AF.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),_Ye=ye("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=yYe),AF.init(e,t)}),RYe=ye("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=AYe),AF.init(e,t)}),CYe=ye("$ZodCheckIncludes",(e,t)=>{Fa.init(e,t);let r=IE(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=n,e._zod.onattach.push(o=>{let s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),IYe=ye("$ZodCheckStartsWith",(e,t)=>{Fa.init(e,t);let r=new RegExp(`^${IE(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),TYe=ye("$ZodCheckEndsWith",(e,t)=>{Fa.init(e,t);let r=new RegExp(`.*${IE(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),PYe=ye("$ZodCheckOverwrite",(e,t)=>{Fa.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}})});var nV,$le=h(()=>{nV=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let n=t.split(`
3
+ var gdr=Object.create;var cle=Object.defineProperty;var ydr=Object.getOwnPropertyDescriptor;var Adr=Object.getOwnPropertyNames;var bdr=Object.getPrototypeOf,xdr=Object.prototype.hasOwnProperty;var se=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var h=(e,t)=>()=>(e&&(t=e(e=0)),t);var F=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),mr=(e,t)=>{for(var r in t)cle(e,r,{get:t[r],enumerable:!0})},ale=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Adr(t))!xdr.call(e,o)&&o!==r&&cle(e,o,{get:()=>t[o],enumerable:!(n=ydr(t,o))||n.enumerable});return e},Qz=(e,t,r)=>(ale(e,t,"default"),r&&ale(r,t,"default")),Ui=(e,t,r)=>(r=e!=null?gdr(bdr(e)):{},ale(t||!e||!e.__esModule?cle(r,"default",{value:e,enumerable:!0}):r,e));function Ma(e){let t={app:e,version:Edr(pT("__RED_BUILD_VERSION__",()=>"3.18.9")??"0.0.0-dev"),gitSha:pT("__RED_BUILD_GIT_SHA__",()=>"adeb95d390b3751c9b118725cae4dfcd2e260945")??"unknown",buildTime:pT("__RED_BUILD_TIME__",()=>"2026-08-14T17:06:57Z")??"unknown",bundleAsset:pT("__RED_BUNDLE_ASSET__",()=>"redskilled-mcp.bundle.min.mjs")??"unknown"},r=pT("__REDDB_SDK_VERSION__",()=>""),n=pT("__REDDB_BINARY_TAG__",()=>"");return r&&(t.reddbSdkVersion=r),n&&(t.reddbBinaryTag=n),t}function Edr(e){return e.startsWith("v")?e.slice(1):e}function vKe(e){return`${e.app} ${e.version} ${e.gitSha}`}function pT(e,t){try{let r=t();return typeof r=="string"&&r.length>0?r:void 0}catch{return process.env[e.replace(/^__|__$/g,"")]}}var wA=h(()=>{});var qr,lle,Ze,tg,iF=h(()=>{(function(e){e.assertEqual=o=>{};function t(o){}e.assertIs=t;function r(o){throw new Error}e.assertNever=r,e.arrayToEnum=o=>{let s={};for(let i of o)s[i]=i;return s},e.getValidEnumValues=o=>{let s=e.objectKeys(o).filter(a=>typeof o[o[a]]!="number"),i={};for(let a of s)i[a]=o[a];return e.objectValues(i)},e.objectValues=o=>e.objectKeys(o).map(function(s){return o[s]}),e.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let s=[];for(let i in o)Object.prototype.hasOwnProperty.call(o,i)&&s.push(i);return s},e.find=(o,s)=>{for(let i of o)if(s(i))return i},e.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function n(o,s=" | "){return o.map(i=>typeof i=="string"?`'${i}'`:i).join(s)}e.joinValues=n,e.jsonStringifyReplacer=(o,s)=>typeof s=="bigint"?s.toString():s})(qr||(qr={}));(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(lle||(lle={}));Ze=qr.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),tg=e=>{switch(typeof e){case"undefined":return Ze.undefined;case"string":return Ze.string;case"number":return Number.isNaN(e)?Ze.nan:Ze.number;case"boolean":return Ze.boolean;case"function":return Ze.function;case"bigint":return Ze.bigint;case"symbol":return Ze.symbol;case"object":return Array.isArray(e)?Ze.array:e===null?Ze.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Ze.promise:typeof Map<"u"&&e instanceof Map?Ze.map:typeof Set<"u"&&e instanceof Set?Ze.set:typeof Date<"u"&&e instanceof Date?Ze.date:Ze.object;default:return Ze.unknown}}});var Ie,kdr,iu,Uz=h(()=>{iF();Ie=qr.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),kdr=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),iu=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){let r=t||function(s){return s.message},n={_errors:[]},o=s=>{for(let i of s.issues)if(i.code==="invalid_union")i.unionErrors.map(o);else if(i.code==="invalid_return_type")o(i.returnTypeError);else if(i.code==="invalid_arguments")o(i.argumentsError);else if(i.path.length===0)n._errors.push(r(i));else{let a=n,c=0;for(;c<i.path.length;){let l=i.path[c];c===i.path.length-1?(a[l]=a[l]||{_errors:[]},a[l]._errors.push(r(i))):a[l]=a[l]||{_errors:[]},a=a[l],c++}}};return o(this),n}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,qr.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r={},n=[];for(let o of this.issues)if(o.path.length>0){let s=o.path[0];r[s]=r[s]||[],r[s].push(t(o))}else n.push(t(o));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};iu.create=e=>new iu(e)});var wdr,SA,ule=h(()=>{Uz();iF();wdr=(e,t)=>{let r;switch(e.code){case Ie.invalid_type:e.received===Ze.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case Ie.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,qr.jsonStringifyReplacer)}`;break;case Ie.unrecognized_keys:r=`Unrecognized key(s) in object: ${qr.joinValues(e.keys,", ")}`;break;case Ie.invalid_union:r="Invalid input";break;case Ie.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${qr.joinValues(e.options)}`;break;case Ie.invalid_enum_value:r=`Invalid enum value. Expected ${qr.joinValues(e.options)}, received '${e.received}'`;break;case Ie.invalid_arguments:r="Invalid function arguments";break;case Ie.invalid_return_type:r="Invalid function return type";break;case Ie.invalid_date:r="Invalid date";break;case Ie.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:qr.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case Ie.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case Ie.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case Ie.custom:r="Invalid input";break;case Ie.invalid_intersection_types:r="Intersection results could not be merged";break;case Ie.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case Ie.not_finite:r="Number must be finite";break;default:r=t.defaultError,qr.assertNever(e)}return{message:r}},SA=wdr});function Sdr(e){_Ke=e}function fT(){return _Ke}var _Ke,jz=h(()=>{ule();_Ke=SA});function Ge(e,t){let r=fT(),n=aF({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===SA?void 0:SA].filter(o=>!!o)});e.common.issues.push(n)}var aF,vdr,La,Ht,Uv,Ec,Hz,Wz,vE,mT,dle=h(()=>{jz();ule();aF=e=>{let{data:t,path:r,errorMaps:n,issueData:o}=e,s=[...r,...o.path||[]],i={...o,path:s};if(o.message!==void 0)return{...o,path:s,message:o.message};let a="",c=n.filter(l=>!!l).slice().reverse();for(let l of c)a=l(i,{data:t,defaultError:a}).message;return{...o,path:s,message:a}},vdr=[];La=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let n=[];for(let o of r){if(o.status==="aborted")return Ht;o.status==="dirty"&&t.dirty(),n.push(o.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){let n=[];for(let o of r){let s=await o.key,i=await o.value;n.push({key:s,value:i})}return e.mergeObjectSync(t,n)}static mergeObjectSync(t,r){let n={};for(let o of r){let{key:s,value:i}=o;if(s.status==="aborted"||i.status==="aborted")return Ht;s.status==="dirty"&&t.dirty(),i.status==="dirty"&&t.dirty(),s.value!=="__proto__"&&(typeof i.value<"u"||o.alwaysSet)&&(n[s.value]=i.value)}return{status:t.value,value:n}}},Ht=Object.freeze({status:"aborted"}),Uv=e=>({status:"dirty",value:e}),Ec=e=>({status:"valid",value:e}),Hz=e=>e.status==="aborted",Wz=e=>e.status==="dirty",vE=e=>e.status==="valid",mT=e=>typeof Promise<"u"&&e instanceof Promise});var RKe=h(()=>{});var gt,CKe=h(()=>{(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(gt||(gt={}))});function yr(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:o}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:o}:{errorMap:(i,a)=>{let{message:c}=e;return i.code==="invalid_enum_value"?{message:c??a.defaultError}:typeof a.data>"u"?{message:c??n??a.defaultError}:i.code!=="invalid_type"?{message:a.defaultError}:{message:c??r??a.defaultError}},description:o}}function DKe(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);let r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function jdr(e){return new RegExp(`^${DKe(e)}$`)}function OKe(e){let t=`${PKe}T${DKe(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function Hdr(e,t){return!!((t==="v4"||!t)&&Ndr.test(e)||(t==="v6"||!t)&&Ldr.test(e))}function Wdr(e,t){if(!Pdr.test(e))return!1;try{let[r]=e.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),o=JSON.parse(atob(n));return!(typeof o!="object"||o===null||"typ"in o&&o?.typ!=="JWT"||!o.alg||t&&o.alg!==t)}catch{return!1}}function Gdr(e,t){return!!((t==="v4"||!t)&&Mdr.test(e)||(t==="v6"||!t)&&Fdr.test(e))}function qdr(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,o=r>n?r:n,s=Number.parseInt(e.toFixed(o).replace(".","")),i=Number.parseInt(t.toFixed(o).replace(".",""));return s%i/10**o}function hT(e){if(e instanceof cu){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=au.create(hT(n))}return new cu({...e._def,shape:()=>t})}else return e instanceof RA?new RA({...e._def,type:hT(e.element)}):e instanceof au?au.create(hT(e.unwrap())):e instanceof ng?ng.create(hT(e.unwrap())):e instanceof rg?rg.create(e.items.map(t=>hT(t))):e}function fle(e,t){let r=tg(e),n=tg(t);if(e===t)return{valid:!0,data:e};if(r===Ze.object&&n===Ze.object){let o=qr.objectKeys(t),s=qr.objectKeys(e).filter(a=>o.indexOf(a)!==-1),i={...e,...t};for(let a of s){let c=fle(e[a],t[a]);if(!c.valid)return{valid:!1};i[a]=c.data}return{valid:!0,data:i}}else if(r===Ze.array&&n===Ze.array){if(e.length!==t.length)return{valid:!1};let o=[];for(let s=0;s<e.length;s++){let i=e[s],a=t[s],c=fle(i,a);if(!c.valid)return{valid:!1};o.push(c.data)}return{valid:!0,data:o}}else return r===Ze.date&&n===Ze.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}function BKe(e,t){return new Zv({values:e,typeName:Pe.ZodEnum,...yr(t)})}function TKe(e,t){let r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}function NKe(e,t={},r){return e?RE.create().superRefine((n,o)=>{let s=e(n);if(s instanceof Promise)return s.then(i=>{if(!i){let a=TKe(t,n),c=a.fatal??r??!0;o.addIssue({code:"custom",...a,fatal:c})}});if(!s){let i=TKe(t,n),a=i.fatal??r??!0;o.addIssue({code:"custom",...i,fatal:a})}}):RE.create()}var Ep,IKe,Ir,_dr,Rdr,Cdr,Idr,Tdr,Pdr,Ddr,Odr,Bdr,ple,Ndr,Mdr,Ldr,Fdr,$dr,Qdr,PKe,Udr,_E,jv,Hv,Wv,Gv,gT,qv,zv,RE,_A,cm,yT,RA,cu,Vv,vA,Gz,Jv,rg,qz,AT,bT,zz,Kv,Yv,Zv,Xv,CE,kp,au,ng,e_,t_,xT,zdr,cF,lF,r_,Vdr,Pe,Jdr,MKe,LKe,Kdr,Ydr,FKe,Zdr,Xdr,epr,tpr,rpr,npr,opr,spr,ipr,mle,apr,cpr,lpr,upr,dpr,ppr,fpr,mpr,hpr,gpr,ypr,Apr,bpr,xpr,Epr,kpr,wpr,Spr,vpr,_pr,Rpr,Cpr,Ipr,Tpr,$Ke=h(()=>{Uz();jz();CKe();dle();iF();Ep=class{constructor(t,r,n,o){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},IKe=(e,t)=>{if(vE(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new iu(e.common.issues);return this._error=r,this._error}}};Ir=class{get description(){return this._def.description}_getType(t){return tg(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:tg(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new La,ctx:{common:t.parent.common,data:t.data,parsedType:tg(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(mT(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:tg(t)},o=this._parseSync({data:t,path:n.path,parent:n});return IKe(n,o)}"~validate"(t){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:tg(t)};if(!this["~standard"].async)try{let n=this._parseSync({data:t,path:[],parent:r});return vE(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(n=>vE(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(t,r){let n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:tg(t)},o=this._parse({data:t,path:n.path,parent:n}),s=await(mT(o)?o:Promise.resolve(o));return IKe(n,s)}refine(t,r){let n=o=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(o):r;return this._refinement((o,s)=>{let i=t(o),a=()=>s.addIssue({code:Ie.custom,...n(o)});return typeof Promise<"u"&&i instanceof Promise?i.then(c=>c?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(t,r){return this._refinement((n,o)=>t(n)?!0:(o.addIssue(typeof r=="function"?r(n,o):r),!1))}_refinement(t){return new kp({schema:this,typeName:Pe.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return au.create(this,this._def)}nullable(){return ng.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return RA.create(this)}promise(){return CE.create(this,this._def)}or(t){return Vv.create([this,t],this._def)}and(t){return Jv.create(this,t,this._def)}transform(t){return new kp({...yr(this._def),schema:this,typeName:Pe.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new e_({...yr(this._def),innerType:this,defaultValue:r,typeName:Pe.ZodDefault})}brand(){return new cF({typeName:Pe.ZodBranded,type:this,...yr(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new t_({...yr(this._def),innerType:this,catchValue:r,typeName:Pe.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return lF.create(this,t)}readonly(){return r_.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},_dr=/^c[^\s-]{8,}$/i,Rdr=/^[0-9a-z]+$/,Cdr=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Idr=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Tdr=/^[a-z0-9_-]{21}$/i,Pdr=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Ddr=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Odr=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Bdr="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Ndr=/^(?:(?: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])$/,Mdr=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,Ldr=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Fdr=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,$dr=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Qdr=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,PKe="((\\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])))",Udr=new RegExp(`^${PKe}$`);_E=class e extends Ir{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Ze.string){let s=this._getOrReturnCtx(t);return Ge(s,{code:Ie.invalid_type,expected:Ze.string,received:s.parsedType}),Ht}let n=new La,o;for(let s of this._def.checks)if(s.kind==="min")t.data.length<s.value&&(o=this._getOrReturnCtx(t,o),Ge(o,{code:Ie.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")t.data.length>s.value&&(o=this._getOrReturnCtx(t,o),Ge(o,{code:Ie.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){let i=t.data.length>s.value,a=t.data.length<s.value;(i||a)&&(o=this._getOrReturnCtx(t,o),i?Ge(o,{code:Ie.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&Ge(o,{code:Ie.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")Odr.test(t.data)||(o=this._getOrReturnCtx(t,o),Ge(o,{validation:"email",code:Ie.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")ple||(ple=new RegExp(Bdr,"u")),ple.test(t.data)||(o=this._getOrReturnCtx(t,o),Ge(o,{validation:"emoji",code:Ie.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")Idr.test(t.data)||(o=this._getOrReturnCtx(t,o),Ge(o,{validation:"uuid",code:Ie.invalid_string,message:s.message}),n.dirty());else if(s.kind==="nanoid")Tdr.test(t.data)||(o=this._getOrReturnCtx(t,o),Ge(o,{validation:"nanoid",code:Ie.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")_dr.test(t.data)||(o=this._getOrReturnCtx(t,o),Ge(o,{validation:"cuid",code:Ie.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")Rdr.test(t.data)||(o=this._getOrReturnCtx(t,o),Ge(o,{validation:"cuid2",code:Ie.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")Cdr.test(t.data)||(o=this._getOrReturnCtx(t,o),Ge(o,{validation:"ulid",code:Ie.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),Ge(o,{validation:"url",code:Ie.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(t.data)||(o=this._getOrReturnCtx(t,o),Ge(o,{validation:"regex",code:Ie.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?t.data=t.data.trim():s.kind==="includes"?t.data.includes(s.value,s.position)||(o=this._getOrReturnCtx(t,o),Ge(o,{code:Ie.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?t.data=t.data.toLowerCase():s.kind==="toUpperCase"?t.data=t.data.toUpperCase():s.kind==="startsWith"?t.data.startsWith(s.value)||(o=this._getOrReturnCtx(t,o),Ge(o,{code:Ie.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?t.data.endsWith(s.value)||(o=this._getOrReturnCtx(t,o),Ge(o,{code:Ie.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?OKe(s).test(t.data)||(o=this._getOrReturnCtx(t,o),Ge(o,{code:Ie.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="date"?Udr.test(t.data)||(o=this._getOrReturnCtx(t,o),Ge(o,{code:Ie.invalid_string,validation:"date",message:s.message}),n.dirty()):s.kind==="time"?jdr(s).test(t.data)||(o=this._getOrReturnCtx(t,o),Ge(o,{code:Ie.invalid_string,validation:"time",message:s.message}),n.dirty()):s.kind==="duration"?Ddr.test(t.data)||(o=this._getOrReturnCtx(t,o),Ge(o,{validation:"duration",code:Ie.invalid_string,message:s.message}),n.dirty()):s.kind==="ip"?Hdr(t.data,s.version)||(o=this._getOrReturnCtx(t,o),Ge(o,{validation:"ip",code:Ie.invalid_string,message:s.message}),n.dirty()):s.kind==="jwt"?Wdr(t.data,s.alg)||(o=this._getOrReturnCtx(t,o),Ge(o,{validation:"jwt",code:Ie.invalid_string,message:s.message}),n.dirty()):s.kind==="cidr"?Gdr(t.data,s.version)||(o=this._getOrReturnCtx(t,o),Ge(o,{validation:"cidr",code:Ie.invalid_string,message:s.message}),n.dirty()):s.kind==="base64"?$dr.test(t.data)||(o=this._getOrReturnCtx(t,o),Ge(o,{validation:"base64",code:Ie.invalid_string,message:s.message}),n.dirty()):s.kind==="base64url"?Qdr.test(t.data)||(o=this._getOrReturnCtx(t,o),Ge(o,{validation:"base64url",code:Ie.invalid_string,message:s.message}),n.dirty()):qr.assertNever(s);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(o=>t.test(o),{validation:r,code:Ie.invalid_string,...gt.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...gt.errToObj(t)})}url(t){return this._addCheck({kind:"url",...gt.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...gt.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...gt.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...gt.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...gt.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...gt.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...gt.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...gt.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...gt.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...gt.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...gt.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...gt.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...gt.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...gt.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...gt.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...gt.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...gt.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...gt.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...gt.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...gt.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...gt.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...gt.errToObj(r)})}nonempty(t){return this.min(1,gt.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};_E.create=e=>new _E({checks:[],typeName:Pe.ZodString,coerce:e?.coerce??!1,...yr(e)});jv=class e extends Ir{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Ze.number){let s=this._getOrReturnCtx(t);return Ge(s,{code:Ie.invalid_type,expected:Ze.number,received:s.parsedType}),Ht}let n,o=new La;for(let s of this._def.checks)s.kind==="int"?qr.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),Ge(n,{code:Ie.invalid_type,expected:"integer",received:"float",message:s.message}),o.dirty()):s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(n=this._getOrReturnCtx(t,n),Ge(n,{code:Ie.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(n=this._getOrReturnCtx(t,n),Ge(n,{code:Ie.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="multipleOf"?qdr(t.data,s.value)!==0&&(n=this._getOrReturnCtx(t,n),Ge(n,{code:Ie.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):s.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),Ge(n,{code:Ie.not_finite,message:s.message}),o.dirty()):qr.assertNever(s);return{status:o.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,gt.toString(r))}gt(t,r){return this.setLimit("min",t,!1,gt.toString(r))}lte(t,r){return this.setLimit("max",t,!0,gt.toString(r))}lt(t,r){return this.setLimit("max",t,!1,gt.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:gt.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:gt.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:gt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:gt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:gt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:gt.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:gt.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:gt.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:gt.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:gt.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&qr.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}};jv.create=e=>new jv({checks:[],typeName:Pe.ZodNumber,coerce:e?.coerce||!1,...yr(e)});Hv=class e extends Ir{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==Ze.bigint)return this._getInvalidInput(t);let n,o=new La;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(n=this._getOrReturnCtx(t,n),Ge(n,{code:Ie.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(n=this._getOrReturnCtx(t,n),Ge(n,{code:Ie.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="multipleOf"?t.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),Ge(n,{code:Ie.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):qr.assertNever(s);return{status:o.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return Ge(r,{code:Ie.invalid_type,expected:Ze.bigint,received:r.parsedType}),Ht}gte(t,r){return this.setLimit("min",t,!0,gt.toString(r))}gt(t,r){return this.setLimit("min",t,!1,gt.toString(r))}lte(t,r){return this.setLimit("max",t,!0,gt.toString(r))}lt(t,r){return this.setLimit("max",t,!1,gt.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:gt.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:gt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:gt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:gt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:gt.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:gt.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};Hv.create=e=>new Hv({checks:[],typeName:Pe.ZodBigInt,coerce:e?.coerce??!1,...yr(e)});Wv=class extends Ir{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Ze.boolean){let n=this._getOrReturnCtx(t);return Ge(n,{code:Ie.invalid_type,expected:Ze.boolean,received:n.parsedType}),Ht}return Ec(t.data)}};Wv.create=e=>new Wv({typeName:Pe.ZodBoolean,coerce:e?.coerce||!1,...yr(e)});Gv=class e extends Ir{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Ze.date){let s=this._getOrReturnCtx(t);return Ge(s,{code:Ie.invalid_type,expected:Ze.date,received:s.parsedType}),Ht}if(Number.isNaN(t.data.getTime())){let s=this._getOrReturnCtx(t);return Ge(s,{code:Ie.invalid_date}),Ht}let n=new La,o;for(let s of this._def.checks)s.kind==="min"?t.data.getTime()<s.value&&(o=this._getOrReturnCtx(t,o),Ge(o,{code:Ie.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?t.data.getTime()>s.value&&(o=this._getOrReturnCtx(t,o),Ge(o,{code:Ie.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):qr.assertNever(s);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:gt.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:gt.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};Gv.create=e=>new Gv({checks:[],coerce:e?.coerce||!1,typeName:Pe.ZodDate,...yr(e)});gT=class extends Ir{_parse(t){if(this._getType(t)!==Ze.symbol){let n=this._getOrReturnCtx(t);return Ge(n,{code:Ie.invalid_type,expected:Ze.symbol,received:n.parsedType}),Ht}return Ec(t.data)}};gT.create=e=>new gT({typeName:Pe.ZodSymbol,...yr(e)});qv=class extends Ir{_parse(t){if(this._getType(t)!==Ze.undefined){let n=this._getOrReturnCtx(t);return Ge(n,{code:Ie.invalid_type,expected:Ze.undefined,received:n.parsedType}),Ht}return Ec(t.data)}};qv.create=e=>new qv({typeName:Pe.ZodUndefined,...yr(e)});zv=class extends Ir{_parse(t){if(this._getType(t)!==Ze.null){let n=this._getOrReturnCtx(t);return Ge(n,{code:Ie.invalid_type,expected:Ze.null,received:n.parsedType}),Ht}return Ec(t.data)}};zv.create=e=>new zv({typeName:Pe.ZodNull,...yr(e)});RE=class extends Ir{constructor(){super(...arguments),this._any=!0}_parse(t){return Ec(t.data)}};RE.create=e=>new RE({typeName:Pe.ZodAny,...yr(e)});_A=class extends Ir{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Ec(t.data)}};_A.create=e=>new _A({typeName:Pe.ZodUnknown,...yr(e)});cm=class extends Ir{_parse(t){let r=this._getOrReturnCtx(t);return Ge(r,{code:Ie.invalid_type,expected:Ze.never,received:r.parsedType}),Ht}};cm.create=e=>new cm({typeName:Pe.ZodNever,...yr(e)});yT=class extends Ir{_parse(t){if(this._getType(t)!==Ze.undefined){let n=this._getOrReturnCtx(t);return Ge(n,{code:Ie.invalid_type,expected:Ze.void,received:n.parsedType}),Ht}return Ec(t.data)}};yT.create=e=>new yT({typeName:Pe.ZodVoid,...yr(e)});RA=class e extends Ir{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),o=this._def;if(r.parsedType!==Ze.array)return Ge(r,{code:Ie.invalid_type,expected:Ze.array,received:r.parsedType}),Ht;if(o.exactLength!==null){let i=r.data.length>o.exactLength.value,a=r.data.length<o.exactLength.value;(i||a)&&(Ge(r,{code:i?Ie.too_big:Ie.too_small,minimum:a?o.exactLength.value:void 0,maximum:i?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),n.dirty())}if(o.minLength!==null&&r.data.length<o.minLength.value&&(Ge(r,{code:Ie.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),n.dirty()),o.maxLength!==null&&r.data.length>o.maxLength.value&&(Ge(r,{code:Ie.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((i,a)=>o.type._parseAsync(new Ep(r,i,r.path,a)))).then(i=>La.mergeArray(n,i));let s=[...r.data].map((i,a)=>o.type._parseSync(new Ep(r,i,r.path,a)));return La.mergeArray(n,s)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:gt.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:gt.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:gt.toString(r)}})}nonempty(t){return this.min(1,t)}};RA.create=(e,t)=>new RA({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Pe.ZodArray,...yr(t)});cu=class e extends Ir{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=qr.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==Ze.object){let l=this._getOrReturnCtx(t);return Ge(l,{code:Ie.invalid_type,expected:Ze.object,received:l.parsedType}),Ht}let{status:n,ctx:o}=this._processInputParams(t),{shape:s,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof cm&&this._def.unknownKeys==="strip"))for(let l in o.data)i.includes(l)||a.push(l);let c=[];for(let l of i){let u=s[l],d=o.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new Ep(o,d,o.path,l)),alwaysSet:l in o.data})}if(this._def.catchall instanceof cm){let l=this._def.unknownKeys;if(l==="passthrough")for(let u of a)c.push({key:{status:"valid",value:u},value:{status:"valid",value:o.data[u]}});else if(l==="strict")a.length>0&&(Ge(o,{code:Ie.unrecognized_keys,keys:a}),n.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let u of a){let d=o.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new Ep(o,d,o.path,u)),alwaysSet:u in o.data})}}return o.common.async?Promise.resolve().then(async()=>{let l=[];for(let u of c){let d=await u.key,p=await u.value;l.push({key:d,value:p,alwaysSet:u.alwaysSet})}return l}).then(l=>La.mergeObjectSync(n,l)):La.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(t){return gt.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{let o=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:gt.errToObj(t).message??o}:{message:o}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Pe.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let r={};for(let n of qr.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}omit(t){let r={};for(let n of qr.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}deepPartial(){return hT(this)}partial(t){let r={};for(let n of qr.objectKeys(this.shape)){let o=this.shape[n];t&&!t[n]?r[n]=o:r[n]=o.optional()}return new e({...this._def,shape:()=>r})}required(t){let r={};for(let n of qr.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof au;)s=s._def.innerType;r[n]=s}return new e({...this._def,shape:()=>r})}keyof(){return BKe(qr.objectKeys(this.shape))}};cu.create=(e,t)=>new cu({shape:()=>e,unknownKeys:"strip",catchall:cm.create(),typeName:Pe.ZodObject,...yr(t)});cu.strictCreate=(e,t)=>new cu({shape:()=>e,unknownKeys:"strict",catchall:cm.create(),typeName:Pe.ZodObject,...yr(t)});cu.lazycreate=(e,t)=>new cu({shape:e,unknownKeys:"strip",catchall:cm.create(),typeName:Pe.ZodObject,...yr(t)});Vv=class extends Ir{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function o(s){for(let a of s)if(a.result.status==="valid")return a.result;for(let a of s)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;let i=s.map(a=>new iu(a.ctx.common.issues));return Ge(r,{code:Ie.invalid_union,unionErrors:i}),Ht}if(r.common.async)return Promise.all(n.map(async s=>{let i={...r,common:{...r.common,issues:[]},parent:null};return{result:await s._parseAsync({data:r.data,path:r.path,parent:i}),ctx:i}})).then(o);{let s,i=[];for(let c of n){let l={...r,common:{...r.common,issues:[]},parent:null},u=c._parseSync({data:r.data,path:r.path,parent:l});if(u.status==="valid")return u;u.status==="dirty"&&!s&&(s={result:u,ctx:l}),l.common.issues.length&&i.push(l.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;let a=i.map(c=>new iu(c));return Ge(r,{code:Ie.invalid_union,unionErrors:a}),Ht}}get options(){return this._def.options}};Vv.create=(e,t)=>new Vv({options:e,typeName:Pe.ZodUnion,...yr(t)});vA=e=>e instanceof Kv?vA(e.schema):e instanceof kp?vA(e.innerType()):e instanceof Yv?[e.value]:e instanceof Zv?e.options:e instanceof Xv?qr.objectValues(e.enum):e instanceof e_?vA(e._def.innerType):e instanceof qv?[void 0]:e instanceof zv?[null]:e instanceof au?[void 0,...vA(e.unwrap())]:e instanceof ng?[null,...vA(e.unwrap())]:e instanceof cF||e instanceof r_?vA(e.unwrap()):e instanceof t_?vA(e._def.innerType):[],Gz=class e extends Ir{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==Ze.object)return Ge(r,{code:Ie.invalid_type,expected:Ze.object,received:r.parsedType}),Ht;let n=this.discriminator,o=r.data[n],s=this.optionsMap.get(o);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(Ge(r,{code:Ie.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Ht)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){let o=new Map;for(let s of r){let i=vA(s.shape[t]);if(!i.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let a of i){if(o.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);o.set(a,s)}}return new e({typeName:Pe.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:o,...yr(n)})}};Jv=class extends Ir{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),o=(s,i)=>{if(Hz(s)||Hz(i))return Ht;let a=fle(s.value,i.value);return a.valid?((Wz(s)||Wz(i))&&r.dirty(),{status:r.value,value:a.data}):(Ge(n,{code:Ie.invalid_intersection_types}),Ht)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,i])=>o(s,i)):o(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};Jv.create=(e,t,r)=>new Jv({left:e,right:t,typeName:Pe.ZodIntersection,...yr(r)});rg=class e extends Ir{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==Ze.array)return Ge(n,{code:Ie.invalid_type,expected:Ze.array,received:n.parsedType}),Ht;if(n.data.length<this._def.items.length)return Ge(n,{code:Ie.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ht;!this._def.rest&&n.data.length>this._def.items.length&&(Ge(n,{code:Ie.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let s=[...n.data].map((i,a)=>{let c=this._def.items[a]||this._def.rest;return c?c._parse(new Ep(n,i,n.path,a)):null}).filter(i=>!!i);return n.common.async?Promise.all(s).then(i=>La.mergeArray(r,i)):La.mergeArray(r,s)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};rg.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new rg({items:e,typeName:Pe.ZodTuple,rest:null,...yr(t)})};qz=class e extends Ir{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==Ze.object)return Ge(n,{code:Ie.invalid_type,expected:Ze.object,received:n.parsedType}),Ht;let o=[],s=this._def.keyType,i=this._def.valueType;for(let a in n.data)o.push({key:s._parse(new Ep(n,a,n.path,a)),value:i._parse(new Ep(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?La.mergeObjectAsync(r,o):La.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof Ir?new e({keyType:t,valueType:r,typeName:Pe.ZodRecord,...yr(n)}):new e({keyType:_E.create(),valueType:t,typeName:Pe.ZodRecord,...yr(r)})}},AT=class extends Ir{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==Ze.map)return Ge(n,{code:Ie.invalid_type,expected:Ze.map,received:n.parsedType}),Ht;let o=this._def.keyType,s=this._def.valueType,i=[...n.data.entries()].map(([a,c],l)=>({key:o._parse(new Ep(n,a,n.path,[l,"key"])),value:s._parse(new Ep(n,c,n.path,[l,"value"]))}));if(n.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let c of i){let l=await c.key,u=await c.value;if(l.status==="aborted"||u.status==="aborted")return Ht;(l.status==="dirty"||u.status==="dirty")&&r.dirty(),a.set(l.value,u.value)}return{status:r.value,value:a}})}else{let a=new Map;for(let c of i){let l=c.key,u=c.value;if(l.status==="aborted"||u.status==="aborted")return Ht;(l.status==="dirty"||u.status==="dirty")&&r.dirty(),a.set(l.value,u.value)}return{status:r.value,value:a}}}};AT.create=(e,t,r)=>new AT({valueType:t,keyType:e,typeName:Pe.ZodMap,...yr(r)});bT=class e extends Ir{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==Ze.set)return Ge(n,{code:Ie.invalid_type,expected:Ze.set,received:n.parsedType}),Ht;let o=this._def;o.minSize!==null&&n.data.size<o.minSize.value&&(Ge(n,{code:Ie.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),r.dirty()),o.maxSize!==null&&n.data.size>o.maxSize.value&&(Ge(n,{code:Ie.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),r.dirty());let s=this._def.valueType;function i(c){let l=new Set;for(let u of c){if(u.status==="aborted")return Ht;u.status==="dirty"&&r.dirty(),l.add(u.value)}return{status:r.value,value:l}}let a=[...n.data.values()].map((c,l)=>s._parse(new Ep(n,c,n.path,l)));return n.common.async?Promise.all(a).then(c=>i(c)):i(a)}min(t,r){return new e({...this._def,minSize:{value:t,message:gt.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:gt.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};bT.create=(e,t)=>new bT({valueType:e,minSize:null,maxSize:null,typeName:Pe.ZodSet,...yr(t)});zz=class e extends Ir{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==Ze.function)return Ge(r,{code:Ie.invalid_type,expected:Ze.function,received:r.parsedType}),Ht;function n(a,c){return aF({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,fT(),SA].filter(l=>!!l),issueData:{code:Ie.invalid_arguments,argumentsError:c}})}function o(a,c){return aF({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,fT(),SA].filter(l=>!!l),issueData:{code:Ie.invalid_return_type,returnTypeError:c}})}let s={errorMap:r.common.contextualErrorMap},i=r.data;if(this._def.returns instanceof CE){let a=this;return Ec(async function(...c){let l=new iu([]),u=await a._def.args.parseAsync(c,s).catch(f=>{throw l.addIssue(n(c,f)),l}),d=await Reflect.apply(i,this,u);return await a._def.returns._def.type.parseAsync(d,s).catch(f=>{throw l.addIssue(o(d,f)),l})})}else{let a=this;return Ec(function(...c){let l=a._def.args.safeParse(c,s);if(!l.success)throw new iu([n(c,l.error)]);let u=Reflect.apply(i,this,l.data),d=a._def.returns.safeParse(u,s);if(!d.success)throw new iu([o(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:rg.create(t).rest(_A.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new e({args:t||rg.create([]).rest(_A.create()),returns:r||_A.create(),typeName:Pe.ZodFunction,...yr(n)})}},Kv=class extends Ir{get schema(){return this._def.getter()}_parse(t){let{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};Kv.create=(e,t)=>new Kv({getter:e,typeName:Pe.ZodLazy,...yr(t)});Yv=class extends Ir{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return Ge(r,{received:r.data,code:Ie.invalid_literal,expected:this._def.value}),Ht}return{status:"valid",value:t.data}}get value(){return this._def.value}};Yv.create=(e,t)=>new Yv({value:e,typeName:Pe.ZodLiteral,...yr(t)});Zv=class e extends Ir{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return Ge(r,{expected:qr.joinValues(n),received:r.parsedType,code:Ie.invalid_type}),Ht}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let r=this._getOrReturnCtx(t),n=this._def.values;return Ge(r,{received:r.data,code:Ie.invalid_enum_value,options:n}),Ht}return Ec(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return e.create(t,{...this._def,...r})}exclude(t,r=this._def){return e.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}};Zv.create=BKe;Xv=class extends Ir{_parse(t){let r=qr.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==Ze.string&&n.parsedType!==Ze.number){let o=qr.objectValues(r);return Ge(n,{expected:qr.joinValues(o),received:n.parsedType,code:Ie.invalid_type}),Ht}if(this._cache||(this._cache=new Set(qr.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let o=qr.objectValues(r);return Ge(n,{received:n.data,code:Ie.invalid_enum_value,options:o}),Ht}return Ec(t.data)}get enum(){return this._def.values}};Xv.create=(e,t)=>new Xv({values:e,typeName:Pe.ZodNativeEnum,...yr(t)});CE=class extends Ir{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==Ze.promise&&r.common.async===!1)return Ge(r,{code:Ie.invalid_type,expected:Ze.promise,received:r.parsedType}),Ht;let n=r.parsedType===Ze.promise?r.data:Promise.resolve(r.data);return Ec(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};CE.create=(e,t)=>new CE({type:e,typeName:Pe.ZodPromise,...yr(t)});kp=class extends Ir{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Pe.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:r,ctx:n}=this._processInputParams(t),o=this._def.effect||null,s={addIssue:i=>{Ge(n,i),i.fatal?r.abort():r.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),o.type==="preprocess"){let i=o.transform(n.data,s);if(n.common.async)return Promise.resolve(i).then(async a=>{if(r.value==="aborted")return Ht;let c=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return c.status==="aborted"?Ht:c.status==="dirty"?Uv(c.value):r.value==="dirty"?Uv(c.value):c});{if(r.value==="aborted")return Ht;let a=this._def.schema._parseSync({data:i,path:n.path,parent:n});return a.status==="aborted"?Ht:a.status==="dirty"?Uv(a.value):r.value==="dirty"?Uv(a.value):a}}if(o.type==="refinement"){let i=a=>{let c=o.refinement(a,s);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?Ht:(a.status==="dirty"&&r.dirty(),i(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?Ht:(a.status==="dirty"&&r.dirty(),i(a.value).then(()=>({status:r.value,value:a.value}))))}if(o.type==="transform")if(n.common.async===!1){let i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!vE(i))return Ht;let a=o.transform(i.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(i=>vE(i)?Promise.resolve(o.transform(i.value,s)).then(a=>({status:r.value,value:a})):Ht);qr.assertNever(o)}};kp.create=(e,t,r)=>new kp({schema:e,typeName:Pe.ZodEffects,effect:t,...yr(r)});kp.createWithPreprocess=(e,t,r)=>new kp({schema:t,effect:{type:"preprocess",transform:e},typeName:Pe.ZodEffects,...yr(r)});au=class extends Ir{_parse(t){return this._getType(t)===Ze.undefined?Ec(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};au.create=(e,t)=>new au({innerType:e,typeName:Pe.ZodOptional,...yr(t)});ng=class extends Ir{_parse(t){return this._getType(t)===Ze.null?Ec(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};ng.create=(e,t)=>new ng({innerType:e,typeName:Pe.ZodNullable,...yr(t)});e_=class extends Ir{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===Ze.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};e_.create=(e,t)=>new e_({innerType:e,typeName:Pe.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...yr(t)});t_=class extends Ir{_parse(t){let{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},o=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return mT(o)?o.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new iu(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new iu(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};t_.create=(e,t)=>new t_({innerType:e,typeName:Pe.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...yr(t)});xT=class extends Ir{_parse(t){if(this._getType(t)!==Ze.nan){let n=this._getOrReturnCtx(t);return Ge(n,{code:Ie.invalid_type,expected:Ze.nan,received:n.parsedType}),Ht}return{status:"valid",value:t.data}}};xT.create=e=>new xT({typeName:Pe.ZodNaN,...yr(e)});zdr=Symbol("zod_brand"),cF=class extends Ir{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},lF=class e extends Ir{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{let s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?Ht:s.status==="dirty"?(r.dirty(),Uv(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})})();{let o=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?Ht:o.status==="dirty"?(r.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:n.path,parent:n})}}static create(t,r){return new e({in:t,out:r,typeName:Pe.ZodPipeline})}},r_=class extends Ir{_parse(t){let r=this._def.innerType._parse(t),n=o=>(vE(o)&&(o.value=Object.freeze(o.value)),o);return mT(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}};r_.create=(e,t)=>new r_({innerType:e,typeName:Pe.ZodReadonly,...yr(t)});Vdr={object:cu.lazycreate};(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Pe||(Pe={}));Jdr=(e,t={message:`Input not instance of ${e.name}`})=>NKe(r=>r instanceof e,t),MKe=_E.create,LKe=jv.create,Kdr=xT.create,Ydr=Hv.create,FKe=Wv.create,Zdr=Gv.create,Xdr=gT.create,epr=qv.create,tpr=zv.create,rpr=RE.create,npr=_A.create,opr=cm.create,spr=yT.create,ipr=RA.create,mle=cu.create,apr=cu.strictCreate,cpr=Vv.create,lpr=Gz.create,upr=Jv.create,dpr=rg.create,ppr=qz.create,fpr=AT.create,mpr=bT.create,hpr=zz.create,gpr=Kv.create,ypr=Yv.create,Apr=Zv.create,bpr=Xv.create,xpr=CE.create,Epr=kp.create,kpr=au.create,wpr=ng.create,Spr=kp.createWithPreprocess,vpr=lF.create,_pr=()=>MKe().optional(),Rpr=()=>LKe().optional(),Cpr=()=>FKe().optional(),Ipr={string:e=>_E.create({...e,coerce:!0}),number:e=>jv.create({...e,coerce:!0}),boolean:e=>Wv.create({...e,coerce:!0}),bigint:e=>Hv.create({...e,coerce:!0}),date:e=>Gv.create({...e,coerce:!0})},Tpr=Ht});var Ae={};mr(Ae,{BRAND:()=>zdr,DIRTY:()=>Uv,EMPTY_PATH:()=>vdr,INVALID:()=>Ht,NEVER:()=>Tpr,OK:()=>Ec,ParseStatus:()=>La,Schema:()=>Ir,ZodAny:()=>RE,ZodArray:()=>RA,ZodBigInt:()=>Hv,ZodBoolean:()=>Wv,ZodBranded:()=>cF,ZodCatch:()=>t_,ZodDate:()=>Gv,ZodDefault:()=>e_,ZodDiscriminatedUnion:()=>Gz,ZodEffects:()=>kp,ZodEnum:()=>Zv,ZodError:()=>iu,ZodFirstPartyTypeKind:()=>Pe,ZodFunction:()=>zz,ZodIntersection:()=>Jv,ZodIssueCode:()=>Ie,ZodLazy:()=>Kv,ZodLiteral:()=>Yv,ZodMap:()=>AT,ZodNaN:()=>xT,ZodNativeEnum:()=>Xv,ZodNever:()=>cm,ZodNull:()=>zv,ZodNullable:()=>ng,ZodNumber:()=>jv,ZodObject:()=>cu,ZodOptional:()=>au,ZodParsedType:()=>Ze,ZodPipeline:()=>lF,ZodPromise:()=>CE,ZodReadonly:()=>r_,ZodRecord:()=>qz,ZodSchema:()=>Ir,ZodSet:()=>bT,ZodString:()=>_E,ZodSymbol:()=>gT,ZodTransformer:()=>kp,ZodTuple:()=>rg,ZodType:()=>Ir,ZodUndefined:()=>qv,ZodUnion:()=>Vv,ZodUnknown:()=>_A,ZodVoid:()=>yT,addIssueToContext:()=>Ge,any:()=>rpr,array:()=>ipr,bigint:()=>Ydr,boolean:()=>FKe,coerce:()=>Ipr,custom:()=>NKe,date:()=>Zdr,datetimeRegex:()=>OKe,defaultErrorMap:()=>SA,discriminatedUnion:()=>lpr,effect:()=>Epr,enum:()=>Apr,function:()=>hpr,getErrorMap:()=>fT,getParsedType:()=>tg,instanceof:()=>Jdr,intersection:()=>upr,isAborted:()=>Hz,isAsync:()=>mT,isDirty:()=>Wz,isValid:()=>vE,late:()=>Vdr,lazy:()=>gpr,literal:()=>ypr,makeIssue:()=>aF,map:()=>fpr,nan:()=>Kdr,nativeEnum:()=>bpr,never:()=>opr,null:()=>tpr,nullable:()=>wpr,number:()=>LKe,object:()=>mle,objectUtil:()=>lle,oboolean:()=>Cpr,onumber:()=>Rpr,optional:()=>kpr,ostring:()=>_pr,pipeline:()=>vpr,preprocess:()=>Spr,promise:()=>xpr,quotelessJson:()=>kdr,record:()=>ppr,set:()=>mpr,setErrorMap:()=>Sdr,strictObject:()=>apr,string:()=>MKe,symbol:()=>Xdr,transformer:()=>Epr,tuple:()=>dpr,undefined:()=>epr,union:()=>cpr,unknown:()=>npr,util:()=>qr,void:()=>spr});var Vz=h(()=>{jz();dle();RKe();iF();$Ke();Uz()});var uF=h(()=>{Vz()});function ye(e,t,r){function n(a,c){var l;Object.defineProperty(a,"_zod",{value:a._zod??{},enumerable:!1}),(l=a._zod).traits??(l.traits=new Set),a._zod.traits.add(e),t(a,c);for(let u in i.prototype)u in a||Object.defineProperty(a,u,{value:i.prototype[u].bind(a)});a._zod.constr=i,a._zod.def=c}let o=r?.Parent??Object;class s extends o{}Object.defineProperty(s,"name",{value:e});function i(a){var c;let l=r?.Parent?new s:this;n(l,a),(c=l._zod).deferred??(c.deferred=[]);for(let u of l._zod.deferred)u();return l}return Object.defineProperty(i,"init",{value:n}),Object.defineProperty(i,Symbol.hasInstance,{value:a=>r?.Parent&&a instanceof r.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}function dd(e){return e&&Object.assign(Jz,e),Jz}var Dpr,Opr,CA,Jz,ET=h(()=>{Dpr=Object.freeze({status:"aborted"});Opr=Symbol("zod_brand"),CA=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Jz={}});var Zr={};mr(Zr,{BIGINT_FORMAT_RANGES:()=>UKe,Class:()=>gle,NUMBER_FORMAT_RANGES:()=>wle,aborted:()=>o_,allowsEval:()=>xle,assert:()=>Fpr,assertEqual:()=>Bpr,assertIs:()=>Mpr,assertNever:()=>Lpr,assertNotEqual:()=>Npr,assignProp:()=>ble,cached:()=>fF,captureStackTrace:()=>Yz,cleanEnum:()=>Ypr,cleanRegex:()=>hF,clone:()=>pd,createTransparentProxy:()=>Wpr,defineLazy:()=>Do,esc:()=>n_,escapeRegex:()=>IE,extend:()=>zpr,finalizeIssue:()=>lm,floatSafeRemainder:()=>Ale,getElementAtPath:()=>$pr,getEnumValues:()=>pF,getLengthableOrigin:()=>gF,getParsedType:()=>Hpr,getSizableOrigin:()=>jKe,isObject:()=>kT,isPlainObject:()=>wT,issue:()=>Sle,joinValues:()=>Kz,jsonStringifyReplacer:()=>yle,merge:()=>Vpr,normalizeParams:()=>Wt,nullish:()=>mF,numKeys:()=>jpr,omit:()=>qpr,optionalKeys:()=>kle,partial:()=>Jpr,pick:()=>Gpr,prefixIssues:()=>og,primitiveTypes:()=>QKe,promiseAllObject:()=>Qpr,propertyKeyTypes:()=>Ele,randomString:()=>Upr,required:()=>Kpr,stringifyPrimitive:()=>Zz,unwrapMessage:()=>dF});function Bpr(e){return e}function Npr(e){return e}function Mpr(e){}function Lpr(e){throw new Error}function Fpr(e){}function pF(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 Kz(e,t="|"){return e.map(r=>Zz(r)).join(t)}function yle(e,t){return typeof t=="bigint"?t.toString():t}function fF(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function mF(e){return e==null}function hF(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function Ale(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,o=r>n?r:n,s=Number.parseInt(e.toFixed(o).replace(".","")),i=Number.parseInt(t.toFixed(o).replace(".",""));return s%i/10**o}function Do(e,t,r){Object.defineProperty(e,t,{get(){{let o=r();return e[t]=o,o}throw new Error("cached value already set")},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function ble(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function $pr(e,t){return t?t.reduce((r,n)=>r?.[n],e):e}function Qpr(e){let t=Object.keys(e),r=t.map(n=>e[n]);return Promise.all(r).then(n=>{let o={};for(let s=0;s<t.length;s++)o[t[s]]=n[s];return o})}function Upr(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<e;n++)r+=t[Math.floor(Math.random()*t.length)];return r}function n_(e){return JSON.stringify(e)}function kT(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function wT(e){if(kT(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;let r=t.prototype;return!(kT(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function jpr(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}function IE(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function pd(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function Wt(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Wpr(e){let t;return new Proxy({},{get(r,n,o){return t??(t=e()),Reflect.get(t,n,o)},set(r,n,o,s){return t??(t=e()),Reflect.set(t,n,o,s)},has(r,n){return t??(t=e()),Reflect.has(t,n)},deleteProperty(r,n){return t??(t=e()),Reflect.deleteProperty(t,n)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,n){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,n)},defineProperty(r,n,o){return t??(t=e()),Reflect.defineProperty(t,n,o)}})}function Zz(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function kle(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}function Gpr(e,t){let r={},n=e._zod.def;for(let o in t){if(!(o in n.shape))throw new Error(`Unrecognized key: "${o}"`);t[o]&&(r[o]=n.shape[o])}return pd(e,{...e._zod.def,shape:r,checks:[]})}function qpr(e,t){let r={...e._zod.def.shape},n=e._zod.def;for(let o in t){if(!(o in n.shape))throw new Error(`Unrecognized key: "${o}"`);t[o]&&delete r[o]}return pd(e,{...e._zod.def,shape:r,checks:[]})}function zpr(e,t){if(!wT(t))throw new Error("Invalid input to extend: expected a plain object");let r={...e._zod.def,get shape(){let n={...e._zod.def.shape,...t};return ble(this,"shape",n),n},checks:[]};return pd(e,r)}function Vpr(e,t){return pd(e,{...e._zod.def,get shape(){let r={...e._zod.def.shape,...t._zod.def.shape};return ble(this,"shape",r),r},catchall:t._zod.def.catchall,checks:[]})}function Jpr(e,t,r){let n=t._zod.def.shape,o={...n};if(r)for(let s in r){if(!(s in n))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(o[s]=e?new e({type:"optional",innerType:n[s]}):n[s])}else for(let s in n)o[s]=e?new e({type:"optional",innerType:n[s]}):n[s];return pd(t,{...t._zod.def,shape:o,checks:[]})}function Kpr(e,t,r){let n=t._zod.def.shape,o={...n};if(r)for(let s in r){if(!(s in o))throw new Error(`Unrecognized key: "${s}"`);r[s]&&(o[s]=new e({type:"nonoptional",innerType:n[s]}))}else for(let s in n)o[s]=new e({type:"nonoptional",innerType:n[s]});return pd(t,{...t._zod.def,shape:o,checks:[]})}function o_(e,t=0){for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function og(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function dF(e){return typeof e=="string"?e:e?.message}function lm(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let o=dF(e.inst?._zod.def?.error?.(e))??dF(t?.error?.(e))??dF(r.customError?.(e))??dF(r.localeError?.(e))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function jKe(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function gF(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Sle(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}function Ypr(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}var Yz,xle,Hpr,Ele,QKe,wle,UKe,gle,sg=h(()=>{Yz=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};xle=fF(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});Hpr=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},Ele=new Set(["string","number","symbol"]),QKe=new Set(["string","number","bigint","boolean","symbol","undefined"]);wle={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},UKe={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};gle=class{constructor(...t){}}});function vle(e,t=r=>r.message){let r={},n=[];for(let o of e.issues)o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(t(o))):n.push(t(o));return{formErrors:n,fieldErrors:r}}function _le(e,t){let r=t||function(s){return s.message},n={_errors:[]},o=s=>{for(let i of s.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(a=>o({issues:a}));else if(i.code==="invalid_key")o({issues:i.issues});else if(i.code==="invalid_element")o({issues:i.issues});else if(i.path.length===0)n._errors.push(r(i));else{let a=n,c=0;for(;c<i.path.length;){let l=i.path[c];c===i.path.length-1?(a[l]=a[l]||{_errors:[]},a[l]._errors.push(r(i))):a[l]=a[l]||{_errors:[]},a=a[l],c++}}};return o(e),n}var HKe,Xz,yF,Rle=h(()=>{ET();sg();HKe=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get(){return JSON.stringify(t,yle,2)},enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Xz=ye("$ZodError",HKe),yF=ye("$ZodError",HKe,{Parent:Error})});var Cle,Ile,Tle,Ple,Dle,s_,Ole,i_,Ble=h(()=>{ET();Rle();sg();Cle=e=>(t,r,n,o)=>{let s=n?Object.assign(n,{async:!1}):{async:!1},i=t._zod.run({value:r,issues:[]},s);if(i instanceof Promise)throw new CA;if(i.issues.length){let a=new(o?.Err??e)(i.issues.map(c=>lm(c,s,dd())));throw Yz(a,o?.callee),a}return i.value},Ile=Cle(yF),Tle=e=>async(t,r,n,o)=>{let s=n?Object.assign(n,{async:!0}):{async:!0},i=t._zod.run({value:r,issues:[]},s);if(i instanceof Promise&&(i=await i),i.issues.length){let a=new(o?.Err??e)(i.issues.map(c=>lm(c,s,dd())));throw Yz(a,o?.callee),a}return i.value},Ple=Tle(yF),Dle=e=>(t,r,n)=>{let o=n?{...n,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new CA;return s.issues.length?{success:!1,error:new(e??Xz)(s.issues.map(i=>lm(i,o,dd())))}:{success:!0,data:s.value}},s_=Dle(yF),Ole=e=>async(t,r,n)=>{let o=n?Object.assign(n,{async:!0}):{async:!0},s=t._zod.run({value:r,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(i=>lm(i,o,dd())))}:{success:!0,data:s.value}},i_=Ole(yF)});function XKe(){return new RegExp(Xpr,"u")}function lYe(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function uYe(e){return new RegExp(`^${lYe(e)}$`)}function dYe(e){let t=lYe({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-]\\d{2}:\\d{2})");let n=`${t}(?:${r.join("|")})`;return new RegExp(`^${aYe}T(?:${n})$`)}var WKe,GKe,qKe,zKe,VKe,JKe,KKe,YKe,Nle,ZKe,Xpr,eYe,tYe,rYe,nYe,oYe,Mle,sYe,iYe,aYe,cYe,pYe,fYe,mYe,hYe,gYe,yYe,AYe,tV=h(()=>{WKe=/^[cC][^\s-]{8,}$/,GKe=/^[0-9a-z]+$/,qKe=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,zKe=/^[0-9a-vA-V]{20}$/,VKe=/^[A-Za-z0-9]{27}$/,JKe=/^[a-zA-Z0-9_-]{21}$/,KKe=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,YKe=/^([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})$/,Nle=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,ZKe=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Xpr="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";eYe=/^(?:(?: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])$/,tYe=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,rYe=/^((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])$/,nYe=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,oYe=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Mle=/^[A-Za-z0-9_-]*$/,sYe=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,iYe=/^\+(?:[0-9]){6,14}[0-9]$/,aYe="(?:(?:\\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])))",cYe=new RegExp(`^${aYe}$`);pYe=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},fYe=/^\d+$/,mYe=/^-?\d+(?:\.\d+)?/i,hYe=/true|false/i,gYe=/null/i,yYe=/^[^A-Z]*$/,AYe=/^[^a-z]*$/});var Fa,bYe,Lle,Fle,xYe,EYe,kYe,wYe,SYe,AF,vYe,_Ye,RYe,CYe,IYe,TYe,PYe,rV=h(()=>{ET();tV();sg();Fa=ye("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),bYe={number:"number",bigint:"bigint",object:"date"},Lle=ye("$ZodCheckLessThan",(e,t)=>{Fa.init(e,t);let r=bYe[typeof t.value];e._zod.onattach.push(n=>{let o=n._zod.bag,s=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<s&&(t.inclusive?o.maximum=t.value:o.exclusiveMaximum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:r,code:"too_big",maximum:t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Fle=ye("$ZodCheckGreaterThan",(e,t)=>{Fa.init(e,t);let r=bYe[typeof t.value];e._zod.onattach.push(n=>{let o=n._zod.bag,s=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),xYe=ye("$ZodCheckMultipleOf",(e,t)=>{Fa.init(e,t),e._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):Ale(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),EYe=ye("$ZodCheckNumberFormat",(e,t)=>{Fa.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[o,s]=wle[t.format];e._zod.onattach.push(i=>{let a=i._zod.bag;a.format=t.format,a.minimum=o,a.maximum=s,r&&(a.pattern=fYe)}),e._zod.check=i=>{let a=i.value;if(r){if(!Number.isInteger(a)){i.issues.push({expected:n,format:t.format,code:"invalid_type",input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?i.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,continue:!t.abort}):i.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,continue:!t.abort});return}}a<o&&i.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),a>s&&i.issues.push({origin:"number",input:a,code:"too_big",maximum:s,inst:e})}}),kYe=ye("$ZodCheckMaxLength",(e,t)=>{var r;Fa.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!mF(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{let o=n._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(n._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let o=n.value;if(o.length<=t.maximum)return;let i=gF(o);n.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),wYe=ye("$ZodCheckMinLength",(e,t)=>{var r;Fa.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!mF(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{let o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let o=n.value;if(o.length>=t.minimum)return;let i=gF(o);n.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),SYe=ye("$ZodCheckLengthEquals",(e,t)=>{var r;Fa.init(e,t),(r=e._zod.def).when??(r.when=n=>{let o=n.value;return!mF(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{let o=n._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=n=>{let o=n.value,s=o.length;if(s===t.length)return;let i=gF(o),a=s>t.length;n.issues.push({origin:i,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),AF=ye("$ZodCheckStringFormat",(e,t)=>{var r,n;Fa.init(e,t),e._zod.onattach.push(o=>{let s=o._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&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})}):(n=e._zod).check??(n.check=()=>{})}),vYe=ye("$ZodCheckRegex",(e,t)=>{AF.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),_Ye=ye("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=yYe),AF.init(e,t)}),RYe=ye("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=AYe),AF.init(e,t)}),CYe=ye("$ZodCheckIncludes",(e,t)=>{Fa.init(e,t);let r=IE(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=n,e._zod.onattach.push(o=>{let s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),IYe=ye("$ZodCheckStartsWith",(e,t)=>{Fa.init(e,t);let r=new RegExp(`^${IE(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),TYe=ye("$ZodCheckEndsWith",(e,t)=>{Fa.init(e,t);let r=new RegExp(`.*${IE(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),PYe=ye("$ZodCheckOverwrite",(e,t)=>{Fa.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}})});var nV,$le=h(()=>{nV=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let n=t.split(`
4
4
  `).filter(i=>i),o=Math.min(...n.map(i=>i.length-i.trimStart().length)),s=n.map(i=>i.slice(o)).map(i=>" ".repeat(this.indent*2)+i);for(let i of s)this.content.push(i)}compile(){let t=Function,r=this?.args,o=[...(this?.content??[""]).map(s=>` ${s}`)];return new t(...r,o.join(`
5
5
  `))}}});var OYe,Qle=h(()=>{OYe={major:4,minor:0,patch:0}});function zYe(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}function efr(e){if(!Mle.test(e))return!1;let t=e.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return zYe(r)}function tfr(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));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}function BYe(e,t,r){e.issues.length&&t.issues.push(...og(r,e.issues)),t.value[r]=e.value}function oV(e,t,r){e.issues.length&&t.issues.push(...og(r,e.issues)),t.value[r]=e.value}function NYe(e,t,r,n){e.issues.length?n[r]===void 0?r in n?t.value[r]=void 0:t.value[r]=e.value:t.issues.push(...og(r,e.issues)):e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}function MYe(e,t,r,n){for(let o of e)if(o.issues.length===0)return t.value=o.value,t;return t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(o=>o.issues.map(s=>lm(s,n,dd())))}),t}function Ule(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(wT(e)&&wT(t)){let r=Object.keys(t),n=Object.keys(e).filter(s=>r.indexOf(s)!==-1),o={...e,...t};for(let s of n){let i=Ule(e[s],t[s]);if(!i.valid)return{valid:!1,mergeErrorPath:[s,...i.mergeErrorPath]};o[s]=i.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],s=t[n],i=Ule(o,s);if(!i.valid)return{valid:!1,mergeErrorPath:[n,...i.mergeErrorPath]};r.push(i.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function LYe(e,t,r){if(t.issues.length&&e.issues.push(...t.issues),r.issues.length&&e.issues.push(...r.issues),o_(e))return e;let n=Ule(t.value,r.value);if(!n.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(n.mergeErrorPath)}`);return e.value=n.data,e}function FYe(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}function $Ye(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}function QYe(e,t,r){return o_(e)?e:t.out._zod.run({value:e.value,issues:e.issues},r)}function UYe(e){return e.value=Object.freeze(e.value),e}function jYe(e,t,r,n){if(!e){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),t.issues.push(Sle(o))}}var lo,bF,Oo,jle,Hle,Wle,Gle,qle,zle,Vle,Jle,Kle,Yle,Zle,HYe,WYe,GYe,qYe,Xle,eue,tue,rue,nue,oue,sue,iue,sV,aue,cue,lue,uue,due,pue,iV,aV,fue,mue,hue,gue,yue,Aue,bue,xue,Eue,kue,wue,Sue,vue,_ue,Rue,VYe=h(()=>{rV();ET();$le();Ble();tV();sg();Qle();sg();lo=ye("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=OYe;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let o of n)for(let s of o._zod.onattach)s(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let o=(s,i,a)=>{let c=o_(s),l;for(let u of i){if(u._zod.def.when){if(!u._zod.def.when(s))continue}else if(c)continue;let d=s.issues.length,p=u._zod.check(s);if(p instanceof Promise&&a?.async===!1)throw new CA;if(l||p instanceof Promise)l=(l??Promise.resolve()).then(async()=>{await p,s.issues.length!==d&&(c||(c=o_(s,d)))});else{if(s.issues.length===d)continue;c||(c=o_(s,d))}}return l?l.then(()=>s):s};e._zod.run=(s,i)=>{let a=e._zod.parse(s,i);if(a instanceof Promise){if(i.async===!1)throw new CA;return a.then(c=>o(c,n,i))}return o(a,n,i)}}e["~standard"]={validate:o=>{try{let s=s_(e,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return i_(e,o).then(i=>i.success?{value:i.data}:{issues:i.error?.issues})}},vendor:"zod",version:1}}),bF=ye("$ZodString",(e,t)=>{lo.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??pYe(e._zod.bag),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),Oo=ye("$ZodStringFormat",(e,t)=>{AF.init(e,t),bF.init(e,t)}),jle=ye("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=YKe),Oo.init(e,t)}),Hle=ye("$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 new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Nle(n))}else t.pattern??(t.pattern=Nle());Oo.init(e,t)}),Wle=ye("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=ZKe),Oo.init(e,t)}),Gle=ye("$ZodURL",(e,t)=>{Oo.init(e,t),e._zod.check=r=>{try{let n=r.value,o=new URL(n),s=o.href;t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:sYe.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),!n.endsWith("/")&&s.endsWith("/")?r.value=s.slice(0,-1):r.value=s;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),qle=ye("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=XKe()),Oo.init(e,t)}),zle=ye("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=JKe),Oo.init(e,t)}),Vle=ye("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=WKe),Oo.init(e,t)}),Jle=ye("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=GKe),Oo.init(e,t)}),Kle=ye("$ZodULID",(e,t)=>{t.pattern??(t.pattern=qKe),Oo.init(e,t)}),Yle=ye("$ZodXID",(e,t)=>{t.pattern??(t.pattern=zKe),Oo.init(e,t)}),Zle=ye("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=VKe),Oo.init(e,t)}),HYe=ye("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=dYe(t)),Oo.init(e,t)}),WYe=ye("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=cYe),Oo.init(e,t)}),GYe=ye("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=uYe(t)),Oo.init(e,t)}),qYe=ye("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=KKe),Oo.init(e,t)}),Xle=ye("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=eYe),Oo.init(e,t),e._zod.onattach.push(r=>{let n=r._zod.bag;n.format="ipv4"})}),eue=ye("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=tYe),Oo.init(e,t),e._zod.onattach.push(r=>{let n=r._zod.bag;n.format="ipv6"}),e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),tue=ye("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=rYe),Oo.init(e,t)}),rue=ye("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=nYe),Oo.init(e,t),e._zod.check=r=>{let[n,o]=r.value.split("/");try{if(!o)throw new Error;let s=Number(o);if(`${s}`!==o)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});nue=ye("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=oYe),Oo.init(e,t),e._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64"}),e._zod.check=r=>{zYe(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});oue=ye("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Mle),Oo.init(e,t),e._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64url"}),e._zod.check=r=>{efr(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),sue=ye("$ZodE164",(e,t)=>{t.pattern??(t.pattern=iYe),Oo.init(e,t)});iue=ye("$ZodJWT",(e,t)=>{Oo.init(e,t),e._zod.check=r=>{tfr(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),sV=ye("$ZodNumber",(e,t)=>{lo.init(e,t),e._zod.pattern=e._zod.bag.pattern??mYe,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let s=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...s?{received:s}:{}}),r}}),aue=ye("$ZodNumber",(e,t)=>{EYe.init(e,t),sV.init(e,t)}),cue=ye("$ZodBoolean",(e,t)=>{lo.init(e,t),e._zod.pattern=hYe,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}let o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),r}}),lue=ye("$ZodNull",(e,t)=>{lo.init(e,t),e._zod.pattern=gYe,e._zod.values=new Set([null]),e._zod.parse=(r,n)=>{let o=r.value;return o===null||r.issues.push({expected:"null",code:"invalid_type",input:o,inst:e}),r}}),uue=ye("$ZodUnknown",(e,t)=>{lo.init(e,t),e._zod.parse=r=>r}),due=ye("$ZodNever",(e,t)=>{lo.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});pue=ye("$ZodArray",(e,t)=>{lo.init(e,t),e._zod.parse=(r,n)=>{let o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),r;r.value=Array(o.length);let s=[];for(let i=0;i<o.length;i++){let a=o[i],c=t.element._zod.run({value:a,issues:[]},n);c instanceof Promise?s.push(c.then(l=>BYe(l,r,i))):BYe(c,r,i)}return s.length?Promise.all(s).then(()=>r):r}});iV=ye("$ZodObject",(e,t)=>{lo.init(e,t);let r=fF(()=>{let d=Object.keys(t.shape);for(let f of d)if(!(t.shape[f]instanceof lo))throw new Error(`Invalid element at key "${f}": expected a Zod schema`);let p=kle(t.shape);return{shape:t.shape,keys:d,keySet:new Set(d),numKeys:d.length,optionalKeys:new Set(p)}});Do(e._zod,"propValues",()=>{let d=t.shape,p={};for(let f in d){let m=d[f]._zod;if(m.values){p[f]??(p[f]=new Set);for(let g of m.values)p[f].add(g)}}return p});let n=d=>{let p=new nV(["shape","payload","ctx"]),f=r.value,m=b=>{let x=n_(b);return`shape[${x}]._zod.run({ value: input[${x}], issues: [] }, ctx)`};p.write("const input = payload.value;");let g=Object.create(null),y=0;for(let b of f.keys)g[b]=`key_${y++}`;p.write("const newResult = {}");for(let b of f.keys)if(f.optionalKeys.has(b)){let x=g[b];p.write(`const ${x} = ${m(b)};`);let w=n_(b);p.write(`
6
6
  if (${x}.issues.length) {
@@ -157,7 +157,7 @@ ${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.pus
157
157
  `}function Pf(e,t){return t.map(xt).join(e)}function UM(e){if(!Array.isArray(e)||e.length===0)throw Oe(0,"TOONL header requires fields");return e.map(t=>{let r;try{[r]=Mn(String(t),0)}catch(n){throw Ps(n)}if(r==="")throw Oe(0,"TOONL header requires fields");return r})}function Lw(e,t){return e!==null&&e.length===t.length&&e.every((r,n)=>r===t[n])}function Fw(e){if(e!==void 0&&(!Number.isInteger(e)||e<=0))throw Oe(0,"TOONL continuation cadence must be positive")}function qM(e,t,r){return e.continuationEveryRows!==void 0&&t>=e.continuationEveryRows||e.continuationEveryBytes!==void 0&&r>=e.continuationEveryBytes}function Mw(e){if(e===null||typeof e!="object"||Array.isArray(e))throw Oe(0,"TOONL output requires object rows");let t=Object.keys(e);if(t.length===0)throw Oe(0,"TOONL output requires object rows");if(t.some(r=>!ea(e[r])))throw Oe(0,"TOONL rows must be flat objects");return t}function KM(e){return JSON.stringify([...e].sort())}function $w(e,t){let r=KM(e),n=t.get(r);return n!==void 0?n:(t.set(r,e),e)}function Ue({delimiter:e=bn,trailer:t=!0,continuationEveryRows:r,continuationEveryBytes:n}={}){HM(e),Fw(r),Fw(n);let o=null,s="",i=new Map,a=0,l=0,c=0,d=new Map,u=!1,p={continuationEveryRows:r,continuationEveryBytes:n},m=()=>o===null||!t?"":`[=${a}]
158
158
  `,f=()=>qM(p,l,c)?(l=0,c=0,Iw(e,s,!0)):"",g=h=>{Gw(h,0);let w=d.get(h);if(w===void 0){if(d.size>=jw)throw Oe(0,"too many tagged lanes");w={fields:null,fieldsByShape:new Map},d.set(h,w)}return w};return{push(h){if(u)throw Oe(0,"TOONL encoder is closed");let w=$w(Mw(h),i),R="";(o===null||o.length!==w.length||o.some((S,C)=>S!==w[C]))&&(R+=m(),o=w,s=Pf(e,o),a=0,l=0,c=0,R+=Iw(e,s));let E=o.map(S=>St(h[S],e));R+=f();let v=`${E.join(e)}
159
159
  `;return R+=v,a+=1,l+=1,c+=v.length,R},declareLane(h,w){if(u)throw Oe(0,"TOONL encoder is closed");let R=UM(w),E=Pf(bn,R),v=g(h);return Lw(v.fields,R)?"":(v.fields=R,Dw(h,E))},pushTagged(h,w){if(u)throw Oe(0,"TOONL encoder is closed");let R=g(h),E=$w(Mw(w),R.fieldsByShape),v=Pf(bn,E),S=E.map($=>St(w[$],bn)),C="";return Lw(R.fields,E)||(R.fields=E,C+=Dw(h,v)),`${C}${h}:${S.join(bn)}
160
- `},end(){return u?"":(u=!0,m())}}}var mt=vf;function Ls(e){let t={app:e,version:VM(Ds("__RED_BUILD_VERSION__",()=>"3.18.8")??"0.0.0-dev"),gitSha:Ds("__RED_BUILD_GIT_SHA__",()=>"fbc7b7727876f5bf9f6e8976475dcc9553b71e1d")??"unknown",buildTime:Ds("__RED_BUILD_TIME__",()=>"2026-08-14T13:07:44-03:00")??"unknown",bundleAsset:Ds("__RED_BUNDLE_ASSET__",()=>"redskilled.bundle.min.mjs")??"unknown"},r=Ds("__REDDB_SDK_VERSION__",()=>""),n=Ds("__REDDB_BINARY_TAG__",()=>"");return r&&(t.reddbSdkVersion=r),n&&(t.reddbBinaryTag=n),t}function VM(e){return e.startsWith("v")?e.slice(1):e}function Ww(e){return`${e.app} ${e.version} ${e.gitSha}`}function Ds(e,t){try{let r=t();return typeof r=="string"&&r.length>0?r:void 0}catch{return process.env[e.replace(/^__|__$/g,"")]}}var Hw={"=":"data",":=":{to:"data",typed:!0},":":"meta"},zM=/^[a-z][a-z0-9+.-]*:\/\//i;function JM(e,t){return typeof t=="string"?{separator:e,to:t,typed:!1,prefix:!1}:{separator:e,to:t.to,typed:t.typed??!1,prefix:t.prefix??!1}}function YM(e=Hw){return Object.entries(e).map(([t,r])=>JM(t,r)).sort((t,r)=>r.separator.length-t.separator.length)}function QM(e){return/^-\d+(\.\d+)?$/.test(e)}function na(e){return!(!e||e.startsWith("-")&&!QM(e))}function gc(e){if(e==="true")return!0;if(e==="false")return!1;if(e==="null")return null;let t=Number(e);return!Number.isNaN(t)&&Number.isFinite(t)&&e.trim()!==""?t:e}function Uw(e){if(e==="true")return!0;if(e==="false")return!1;if(e==="null")return null;if(e.startsWith("[")&&e.endsWith("]")||e.startsWith("{")&&e.endsWith("}"))try{return JSON.parse(e)}catch{}let t=Number(e);return!Number.isNaN(t)&&Number.isFinite(t)&&e.trim()!==""?t:e.includes(",")?e.split(",").map(r=>Uw(r.trim())):e}function Eo(e,t){switch(t){case"boolean":return XM(e);case"number":return ZM(e);case"array":return e.split(",").map(r=>gc(r.trim()));case"string":default:return e}}function XM(e){let t=e.toLowerCase().trim();return t==="true"||t==="yes"||t==="1"||t==="on"}function ZM(e){if(e.trim()==="")throw new TypeError(`Cannot convert "${e}" to number`);let t=Number(e);if(Number.isNaN(t))throw new TypeError(`Cannot convert "${e}" to number`);return t}function $n(e){return e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'")?e.slice(1,-1):e}function e$(e,t={}){return e.map(r=>{let n=t[r.type];return n?n(r.value):r.value}).join("")}function Be(e,t){return{type:e,value:t}}function t$(e){let t=[],r=n$(e);if(t.push(Be("section-header","Usage:"),Be("text"," "),Be("usage-text",r),Be("newline",`
160
+ `},end(){return u?"":(u=!0,m())}}}var mt=vf;function Ls(e){let t={app:e,version:VM(Ds("__RED_BUILD_VERSION__",()=>"3.18.9")??"0.0.0-dev"),gitSha:Ds("__RED_BUILD_GIT_SHA__",()=>"adeb95d390b3751c9b118725cae4dfcd2e260945")??"unknown",buildTime:Ds("__RED_BUILD_TIME__",()=>"2026-08-14T17:06:57Z")??"unknown",bundleAsset:Ds("__RED_BUNDLE_ASSET__",()=>"redskilled.bundle.min.mjs")??"unknown"},r=Ds("__REDDB_SDK_VERSION__",()=>""),n=Ds("__REDDB_BINARY_TAG__",()=>"");return r&&(t.reddbSdkVersion=r),n&&(t.reddbBinaryTag=n),t}function VM(e){return e.startsWith("v")?e.slice(1):e}function Ww(e){return`${e.app} ${e.version} ${e.gitSha}`}function Ds(e,t){try{let r=t();return typeof r=="string"&&r.length>0?r:void 0}catch{return process.env[e.replace(/^__|__$/g,"")]}}var Hw={"=":"data",":=":{to:"data",typed:!0},":":"meta"},zM=/^[a-z][a-z0-9+.-]*:\/\//i;function JM(e,t){return typeof t=="string"?{separator:e,to:t,typed:!1,prefix:!1}:{separator:e,to:t.to,typed:t.typed??!1,prefix:t.prefix??!1}}function YM(e=Hw){return Object.entries(e).map(([t,r])=>JM(t,r)).sort((t,r)=>r.separator.length-t.separator.length)}function QM(e){return/^-\d+(\.\d+)?$/.test(e)}function na(e){return!(!e||e.startsWith("-")&&!QM(e))}function gc(e){if(e==="true")return!0;if(e==="false")return!1;if(e==="null")return null;let t=Number(e);return!Number.isNaN(t)&&Number.isFinite(t)&&e.trim()!==""?t:e}function Uw(e){if(e==="true")return!0;if(e==="false")return!1;if(e==="null")return null;if(e.startsWith("[")&&e.endsWith("]")||e.startsWith("{")&&e.endsWith("}"))try{return JSON.parse(e)}catch{}let t=Number(e);return!Number.isNaN(t)&&Number.isFinite(t)&&e.trim()!==""?t:e.includes(",")?e.split(",").map(r=>Uw(r.trim())):e}function Eo(e,t){switch(t){case"boolean":return XM(e);case"number":return ZM(e);case"array":return e.split(",").map(r=>gc(r.trim()));case"string":default:return e}}function XM(e){let t=e.toLowerCase().trim();return t==="true"||t==="yes"||t==="1"||t==="on"}function ZM(e){if(e.trim()==="")throw new TypeError(`Cannot convert "${e}" to number`);let t=Number(e);if(Number.isNaN(t))throw new TypeError(`Cannot convert "${e}" to number`);return t}function $n(e){return e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'")?e.slice(1,-1):e}function e$(e,t={}){return e.map(r=>{let n=t[r.type];return n?n(r.value):r.value}).join("")}function Be(e,t){return{type:e,value:t}}function t$(e){let t=[],r=n$(e);if(t.push(Be("section-header","Usage:"),Be("text"," "),Be("usage-text",r),Be("newline",`
161
161
  `),Be("newline",`
162
162
  `)),e.positional&&e.positional.length>0){t.push(Be("section-header","Arguments:"),Be("newline",`
163
163
  `));for(let n of e.positional)if(n.description){let o=n.variadic?`${n.name}...`:n.name;t.push(Be("indent"," "),Be("positional-name",`<${o}>`)),n.required||t.push(Be("positional-optional"," (optional)")),t.push(Be("newline",`
@@ -25,7 +25,7 @@ var SP=Object.create;var qu=Object.defineProperty;var RP=Object.getOwnPropertyDe
25
25
  `;return E+=k,a+=1,c+=1,l+=k.length,E},declareLane(b,y){if(d)throw Y(0,"TOONL encoder is closed");let E=cL(y),w=wd(zt,E),k=g(b);return Xb(k.fields,E)?"":(k.fields=E,Qb(b,w))},pushTagged(b,y){if(d)throw Y(0,"TOONL encoder is closed");let E=g(b),w=tw(ew(y),E.fieldsByShape),k=wd(zt,w),S=w.map(C=>ve(y[C],zt)),T="";return Xb(E.fields,w)||(E.fields=w,T+=Qb(b,k)),`${T}${b}:${S.join(zt)}
26
26
  `},end(){return d?"":(d=!0,f())}}}var rw,nw,sw,_3,E3,iw=_(()=>{Kt();ha();no();rn();rw=[zt,"|"," "],nw=8,sw=/^[A-Za-z0-9_-]+$/,_3=new TextEncoder,E3=new TextDecoder});var z,J=_(()=>{ha();no();Vb();Kt();to();Jb();no();Xs();rn();fa();ha();Kb();iw();z=md});function pL(e){return e==="no-op"?0:e==="usage"?2:1}function ee(e){return Buffer.from(`${M(_d(e))}
27
27
  `)}function _d(e){let t={command:e.command,category:e.category,exit_code:e.exitCode??pL(e.category),error:e.error,help:[e.help]};return e.validFlags&&e.validFlags.length>0&&(t.valid_flags=[...e.validFlags]),e.diagnostics&&(t.diagnostics=fL(e.diagnostics,3)),t}function qe(e,t,r){let s=([r,t].find(i=>i.trim())??"").trim(),o=s.toLowerCase();return/\bgh\b/.test(e)&&Jy(s)?{command:e,category:"transient",error:so(s)||"GitHub API rate limit exceeded",help:Vy,diagnostics:s}:/\bgh\b/.test(e)&&(o.includes("gh_token")||o.includes("not logged in")||o.includes("authentication"))?{command:e,category:"real-error",error:so(s)||"GitHub authentication failed",help:"gh auth login",diagnostics:s}:o.includes("not a git repository")?{command:e,category:"real-error",error:so(s)||"not a git repository",help:"git status",diagnostics:s}:o.includes("repository not found")||o.includes("could not resolve host")?{command:e,category:"real-error",error:so(s)||"repository is unavailable",help:e.startsWith("gh ")?"gh repo view":"git remote -v",diagnostics:s}:{command:e,category:"real-error",error:so(s)||"command failed",help:`${e} --help`,diagnostics:s}}function aw(e,t,r,n){return ee({command:e,category:"usage",error:`unknown flag: ${t}`,help:n,validFlags:r})}function so(e){return e.split(/\r?\n/,1)[0]?.trim()??""}function fL(e,t){return e.split(/\r?\n/).slice(0,t).join(`
28
- `).trim()}var bt=_(()=>{"use strict";Ky();J()});function _a(e){let t={app:e,version:RL(Vn("__RED_BUILD_VERSION__",()=>"3.18.8")??"0.0.0-dev"),gitSha:Vn("__RED_BUILD_GIT_SHA__",()=>"fbc7b7727876f5bf9f6e8976475dcc9553b71e1d")??"unknown",buildTime:Vn("__RED_BUILD_TIME__",()=>"2026-08-14T13:07:44-03:00")??"unknown",bundleAsset:Vn("__RED_BUNDLE_ASSET__",()=>"rsp-core.bundle.min.mjs")??"unknown"},r=Vn("__REDDB_SDK_VERSION__",()=>"1.23.1"),n=Vn("__REDDB_BINARY_TAG__",()=>"v1.23.1");return r&&(t.reddbSdkVersion=r),n&&(t.reddbBinaryTag=n),t}function RL(e){return e.startsWith("v")?e.slice(1):e}function gw(e){return`${e.app} ${e.version} ${e.gitSha}`}function Vn(e,t){try{let r=t();return typeof r=="string"&&r.length>0?r:void 0}catch{return process.env[e.replace(/^__|__$/g,"")]}}var kd=_(()=>{});import{isAbsolute as vL,join as Yt,resolve as Sd}from"node:path";function OL(e){if(!e)throw new Error("root is required");return e.replace(/\/$/,"")}function bw(e){return Yt(OL(e),yw)}function ww(e){return Yt(bw(e),"state")}function _w(e){return Yt(bw(e),"tmp")}function ce(e){return Yt(ww(e),"rsp")}function AL(e){return Yt(ww(e),"red-skills.rdb")}function CL(e){return Yt(_w(e),"red-skills.rdb")}function Sw(e,t){let r=AL(e);if(t(r))return r;let n=CL(e);if(t(n))throw PL();return r}function PL(){return new Error("Legacy shared store found at .red/tmp/red-skills.rdb. Run `rsp setup` to migrate it to .red/state/red-skills.rdb before using rsp, memory, or brain.")}function Rw(e){return Yt(_w(e),"waits")}function vw(e){let t=e.overrideEnvVars??Rd;for(let n of t){let s=e.env[n];if(s)return vL(s)?s:Sd(e.startDir,s)}let r=Sd(e.startDir);for(;;){if(e.exists(Yt(r,yw)))return r;let n=Yt(r,".."),s=Sd(n);if(s===r)break;r=s}return e.startDir}var yw,TL,xL,Rd,Ew,kw,Xe=_(()=>{yw=".red",TL="MEMORY_ROOT",xL="RED_BRAIN_ROOT",Rd=[TL,xL];Ew=".red/state/red-skills.rdb";kw=".red/tmp/red-skills.rdb"});function ge(e){return M(e)}var IL,LL,f4,Qt=_(()=>{J();Xe();IL=[{id:"memory.config",plugin:"memory",legacyPath:".red/memory/config.json",toonPath:".red/memory/config.toon",kind:"toon"}],LL=[{id:"dev.afk-history",plugin:"dev",legacyPath:".red/state/afk-history.jsonl",toonPath:".red/state/castle/history.toonl",kind:"toonl"},{id:"dev.agent-log",plugin:"dev",legacyPath:".red/tmp/agent.log.toonl",toonPath:".red/tmp/agent.log.toonl",kind:"toonl"},{id:"dev.supervisor-firehose",plugin:"dev",legacyPath:".red/tmp/afk-supervisor.log.toonl",toonPath:".red/tmp/supervisors/default/supervisor.log.toonl",kind:"toonl",migration:"sniff-read"},{id:"dev.code-understanding-bench-runs",plugin:"dev",legacyPath:".red/tmp/bench/code-understanding/runs.jsonl",toonPath:".red/tmp/bench/code-understanding/runs.toonl",kind:"toonl"},{id:"dev.attempt-state",plugin:"dev",legacyPath:".red/tmp/{workers,go-workers,scout-workers}/*/*/afk.state.toon",toonPath:".red/tmp/{workers,go-workers,scout-workers}/*/*/afk.state.toon",kind:"toon"},{id:"dev.statusline-count-cache",plugin:"dev",legacyPath:".red/tmp/statusline-cache.json",toonPath:".red/state/statusline/statusline-cache.toon",kind:"toon"},{id:"dev.statusline-repo-cache",plugin:"dev",legacyPath:".red/tmp/statusline-repo-cache.json",toonPath:".red/state/statusline/statusline-repo-cache.toon",kind:"toon"},{id:"dev.rsp-resident-registry",plugin:"dev",legacyPath:".red/state/rsp/rsp-resident.pid.json",toonPath:".red/state/rsp/rsp-resident.pid.toon",kind:"toon"},{id:"dev.rsp-status-summary",plugin:"dev",legacyPath:".red/state/rsp/rsp-status-summary.json",toonPath:".red/state/rsp/rsp-status-summary.toon",kind:"toon"},{id:"dev.rsp-wait-registry",plugin:"dev",legacyPath:".red/tmp/waits/*.json",toonPath:".red/tmp/waits/*.toon",kind:"toon"}],f4=[...IL,...LL]});function oo(e){let{values:t,rest:r}=Qr(e,{query:Tw.query},xw);return{argv:r,query:t.query?.trim()||void 0}}function Ow(e){let{values:t,rest:r}=Qr(e,Tw,xw);return{argv:r,query:t.query?.trim()||void 0,full:t.full===!0}}function GL(e,t){if(!t)return!0;let r=vd(e).toLowerCase();return t.toLowerCase().split(/\s+/).filter(Boolean).every(n=>r.includes(n))}function Le(e,t){return t?e.filter(r=>GL(r,t)):[...e]}function Xt(e,t){return Td(e,t,{includeLegacyHelp:!0})}function Td(e,t,r={}){let n=t.filter(Boolean);return n.length===0?e:{...e,...r.includeLegacyHelp?{help:n}:{},next_steps:n}}function vd(e){return Array.isArray(e)?e.map(vd).join(" "):typeof e=="object"&&e!==null?Object.values(e).map(vd).join(" "):String(e??"")}var Tw,xw,io=_(()=>{"use strict";Vu();Tw={query:{kind:"value",coerce:e=>e},full:{kind:"boolean"}},xw={stopAtSeparator:!1}});var Oa={};se(Oa,{DEFAULT_RSP_MAX_OVERHEAD_MS:()=>Ea,DEFAULT_RSP_MAX_SELF_STATE_BYTES:()=>ka,DEFAULT_RSP_OVERHEAD_CEILING:()=>Zt,DEFAULT_RSP_OVERHEAD_CONSECUTIVE_BREACHES:()=>Ra,DEFAULT_RSP_OVERHEAD_COOLDOWN_MS:()=>va,DEFAULT_RSP_OVERHEAD_NET_LOSS_FLOOR_BYTES:()=>Sa,RSP_OVERHEAD_FAMILIES:()=>jL,RSP_OVERHEAD_LEDGER_FILE:()=>Pw,RSP_OVERHEAD_SCHEMA_VERSION:()=>Iw,classifyOverheadSample:()=>Ad,noteChildProcessMs:()=>Gw,noteSelfStateBytesRead:()=>co,overheadCounters:()=>Gd,overheadFamilyDisabled:()=>qL,overheadHealth:()=>wr,overheadLedgerPath:()=>Cd,overheadMsOf:()=>Lw,overheadTelemetryFields:()=>Ta,readOverheadLedger:()=>ao,readSelfStateFile:()=>xa,readSelfStateFileSync:()=>WL,recordOverheadSample:()=>Pd,resetOverheadCounters:()=>HL,resetOverheadLedger:()=>UL,startChildProcessTimer:()=>Ze});import{existsSync as NL,mkdirSync as DL,readFileSync as Aw,renameSync as $L,writeFileSync as FL}from"node:fs";import{readFile as ML}from"node:fs/promises";import{dirname as BL,join as Cw}from"node:path";function Lw(e){let t=e.wrapperMs-e.childMs;return Number.isFinite(t)?Math.max(0,Od(t)):0}function Ad(e,t=Zt){let r=Lw(e),n=[];return r>t.maxOverheadMs&&n.push("wall-clock-ceiling"),e.selfStateBytesRead>t.maxSelfStateBytes&&n.push("self-state-byte-ceiling"),e.selfStateBytesRead>t.netLossFloorBytes&&e.selfStateBytesRead>e.bytesSaved&&n.push("overhead-exceeds-savings"),{overhead_ms:r,breached:n.length>0,reasons:n}}function Ta(e,t=Zt){let r=Ad(e,t);return{wrapper_ms:Od(e.wrapperMs),overhead_ms:r.overhead_ms,child_ms:Od(Math.max(0,e.childMs)),self_state_bytes_read:Math.max(0,Math.trunc(e.selfStateBytesRead)),bytes_saved:Math.max(0,Math.trunc(e.bytesSaved)),overhead_breached:r.breached,overhead_breach_reasons:r.reasons.join(",")}}function Cd(e){return Cw(ce(e),Pw)}function ao(e){try{let t=Aw(Cd(e),"utf8"),r=zL(t);if(YL(r))return r}catch{}return{version:1,families:{}}}function Pd(e,t,r=Zt,n=Date.now()){let s=ao(e),o=Ad(t,r),i=s.families[t.family]??KL(t.family,n),a=Nd(i,n)?Nw(i):i,c=o.breached?a.consecutive_breaches+1:0,l={...a,family:t.family,invocations:a.invocations+1,breaches:a.breaches+(o.breached?1:0),consecutive_breaches:c,breached:o.breached,reasons:o.reasons,last_overhead_ms:o.overhead_ms,last_self_state_bytes_read:Math.max(0,Math.trunc(t.selfStateBytesRead)),last_bytes_saved:Math.max(0,Math.trunc(t.bytesSaved)),updated_at:new Date(n).toISOString()};return o.breached?c>=r.consecutiveBreaches&&(l.disabled=!0,l.disabled_at=new Date(n).toISOString(),l.disabled_until=new Date(n+r.cooldownMs).toISOString(),l.disabled_reason=VL(t.family,c,o,r)):(l.disabled=!1,l.disabled_at=null,l.disabled_until=null,l.disabled_reason=null),s.families[t.family]=l,Dw(e,s),l}function qL(e,t,r=Date.now()){let n=ao(e).families[t];return!n?.disabled||Nd(n,r)?null:n}function UL(e,t){let r=ao(e);return t?delete r.families[t]:r.families={},Dw(e,r),r}function wr(e,t=Zt,r=Date.now()){let n=Object.values(ao(e).families).map(a=>Nd(a,r)?Nw(a):a).sort((a,c)=>a.family.localeCompare(c.family)),s=n.filter(a=>a.disabled),o=n.filter(a=>a.consecutive_breaches>0),i=s.length>0||o.length>0?"red":"green";return{schema_version:Iw,verdict:i,summary:JL(i,s,o),ceiling:t,breaching_families:o,disabled_families:s,families:n}}function co(e){Number.isFinite(e)&&e>0&&(Id+=e)}function Gw(e){Number.isFinite(e)&&e>0&&(Ld+=e)}function Gd(){return{selfStateBytesRead:Id,childMs:Ld}}function HL(){Id=0,Ld=0}function Ze(){let e=process.hrtime.bigint(),t=!1;return()=>{t||(t=!0,Gw(Number(process.hrtime.bigint()-e)/1e6))}}async function xa(e){let t=await ML(e,"utf8");return co(Buffer.byteLength(t)),t}function WL(e){let t=Aw(e,"utf8");return co(Buffer.byteLength(t)),t}function VL(e,t,r,n){let s=r.reasons.map(o=>o==="wall-clock-ceiling"?`added ${r.overhead_ms}ms > ${n.maxOverheadMs}ms`:o==="self-state-byte-ceiling"?`self-state read > ${n.maxSelfStateBytes}B`:"self-state read exceeded bytes saved").join("; ");return`rsp ${e} exceeded its overhead ceiling on ${t} consecutive invocations (${s}); wrapper self-disabled, commands pass through raw`}function JL(e,t,r){if(e==="green")return"every wrapper family is inside its overhead ceiling";let n=[];return t.length>0&&n.push(`self-disabled: ${t.map(s=>`${s.family} (${s.reasons.join(",")||"ceiling"})`).join(", ")}`),r.length>0&&n.push(`breaching: ${r.map(s=>`${s.family} x${s.consecutive_breaches}`).join(", ")}`),n.join("; ")}function Nd(e,t){if(!e.disabled||!e.disabled_until)return!1;let r=Date.parse(e.disabled_until);return Number.isFinite(r)&&r<=t}function Nw(e){return{...e,disabled:!1,disabled_at:null,disabled_until:null,disabled_reason:null,consecutive_breaches:0,breached:!1,reasons:[]}}function KL(e,t){return{family:e,invocations:0,breaches:0,consecutive_breaches:0,breached:!1,reasons:[],disabled:!1,disabled_at:null,disabled_until:null,disabled_reason:null,last_overhead_ms:0,last_self_state_bytes_read:0,last_bytes_saved:0,updated_at:new Date(t).toISOString()}}function Dw(e,t){try{let r=Cd(e);if(!NL(Cw(e,".red")))return;DL(BL(r),{recursive:!0});let n=`${r}.${process.pid}.tmp`;FL(n,`${M(t)}
28
+ `).trim()}var bt=_(()=>{"use strict";Ky();J()});function _a(e){let t={app:e,version:RL(Vn("__RED_BUILD_VERSION__",()=>"3.18.9")??"0.0.0-dev"),gitSha:Vn("__RED_BUILD_GIT_SHA__",()=>"adeb95d390b3751c9b118725cae4dfcd2e260945")??"unknown",buildTime:Vn("__RED_BUILD_TIME__",()=>"2026-08-14T17:06:57Z")??"unknown",bundleAsset:Vn("__RED_BUNDLE_ASSET__",()=>"rsp-core.bundle.min.mjs")??"unknown"},r=Vn("__REDDB_SDK_VERSION__",()=>"1.23.1"),n=Vn("__REDDB_BINARY_TAG__",()=>"v1.23.1");return r&&(t.reddbSdkVersion=r),n&&(t.reddbBinaryTag=n),t}function RL(e){return e.startsWith("v")?e.slice(1):e}function gw(e){return`${e.app} ${e.version} ${e.gitSha}`}function Vn(e,t){try{let r=t();return typeof r=="string"&&r.length>0?r:void 0}catch{return process.env[e.replace(/^__|__$/g,"")]}}var kd=_(()=>{});import{isAbsolute as vL,join as Yt,resolve as Sd}from"node:path";function OL(e){if(!e)throw new Error("root is required");return e.replace(/\/$/,"")}function bw(e){return Yt(OL(e),yw)}function ww(e){return Yt(bw(e),"state")}function _w(e){return Yt(bw(e),"tmp")}function ce(e){return Yt(ww(e),"rsp")}function AL(e){return Yt(ww(e),"red-skills.rdb")}function CL(e){return Yt(_w(e),"red-skills.rdb")}function Sw(e,t){let r=AL(e);if(t(r))return r;let n=CL(e);if(t(n))throw PL();return r}function PL(){return new Error("Legacy shared store found at .red/tmp/red-skills.rdb. Run `rsp setup` to migrate it to .red/state/red-skills.rdb before using rsp, memory, or brain.")}function Rw(e){return Yt(_w(e),"waits")}function vw(e){let t=e.overrideEnvVars??Rd;for(let n of t){let s=e.env[n];if(s)return vL(s)?s:Sd(e.startDir,s)}let r=Sd(e.startDir);for(;;){if(e.exists(Yt(r,yw)))return r;let n=Yt(r,".."),s=Sd(n);if(s===r)break;r=s}return e.startDir}var yw,TL,xL,Rd,Ew,kw,Xe=_(()=>{yw=".red",TL="MEMORY_ROOT",xL="RED_BRAIN_ROOT",Rd=[TL,xL];Ew=".red/state/red-skills.rdb";kw=".red/tmp/red-skills.rdb"});function ge(e){return M(e)}var IL,LL,f4,Qt=_(()=>{J();Xe();IL=[{id:"memory.config",plugin:"memory",legacyPath:".red/memory/config.json",toonPath:".red/memory/config.toon",kind:"toon"}],LL=[{id:"dev.afk-history",plugin:"dev",legacyPath:".red/state/afk-history.jsonl",toonPath:".red/state/castle/history.toonl",kind:"toonl"},{id:"dev.agent-log",plugin:"dev",legacyPath:".red/tmp/agent.log.toonl",toonPath:".red/tmp/agent.log.toonl",kind:"toonl"},{id:"dev.supervisor-firehose",plugin:"dev",legacyPath:".red/tmp/afk-supervisor.log.toonl",toonPath:".red/tmp/supervisors/default/supervisor.log.toonl",kind:"toonl",migration:"sniff-read"},{id:"dev.code-understanding-bench-runs",plugin:"dev",legacyPath:".red/tmp/bench/code-understanding/runs.jsonl",toonPath:".red/tmp/bench/code-understanding/runs.toonl",kind:"toonl"},{id:"dev.attempt-state",plugin:"dev",legacyPath:".red/tmp/{workers,go-workers,scout-workers}/*/*/afk.state.toon",toonPath:".red/tmp/{workers,go-workers,scout-workers}/*/*/afk.state.toon",kind:"toon"},{id:"dev.statusline-count-cache",plugin:"dev",legacyPath:".red/tmp/statusline-cache.json",toonPath:".red/state/statusline/statusline-cache.toon",kind:"toon"},{id:"dev.statusline-repo-cache",plugin:"dev",legacyPath:".red/tmp/statusline-repo-cache.json",toonPath:".red/state/statusline/statusline-repo-cache.toon",kind:"toon"},{id:"dev.rsp-resident-registry",plugin:"dev",legacyPath:".red/state/rsp/rsp-resident.pid.json",toonPath:".red/state/rsp/rsp-resident.pid.toon",kind:"toon"},{id:"dev.rsp-status-summary",plugin:"dev",legacyPath:".red/state/rsp/rsp-status-summary.json",toonPath:".red/state/rsp/rsp-status-summary.toon",kind:"toon"},{id:"dev.rsp-wait-registry",plugin:"dev",legacyPath:".red/tmp/waits/*.json",toonPath:".red/tmp/waits/*.toon",kind:"toon"}],f4=[...IL,...LL]});function oo(e){let{values:t,rest:r}=Qr(e,{query:Tw.query},xw);return{argv:r,query:t.query?.trim()||void 0}}function Ow(e){let{values:t,rest:r}=Qr(e,Tw,xw);return{argv:r,query:t.query?.trim()||void 0,full:t.full===!0}}function GL(e,t){if(!t)return!0;let r=vd(e).toLowerCase();return t.toLowerCase().split(/\s+/).filter(Boolean).every(n=>r.includes(n))}function Le(e,t){return t?e.filter(r=>GL(r,t)):[...e]}function Xt(e,t){return Td(e,t,{includeLegacyHelp:!0})}function Td(e,t,r={}){let n=t.filter(Boolean);return n.length===0?e:{...e,...r.includeLegacyHelp?{help:n}:{},next_steps:n}}function vd(e){return Array.isArray(e)?e.map(vd).join(" "):typeof e=="object"&&e!==null?Object.values(e).map(vd).join(" "):String(e??"")}var Tw,xw,io=_(()=>{"use strict";Vu();Tw={query:{kind:"value",coerce:e=>e},full:{kind:"boolean"}},xw={stopAtSeparator:!1}});var Oa={};se(Oa,{DEFAULT_RSP_MAX_OVERHEAD_MS:()=>Ea,DEFAULT_RSP_MAX_SELF_STATE_BYTES:()=>ka,DEFAULT_RSP_OVERHEAD_CEILING:()=>Zt,DEFAULT_RSP_OVERHEAD_CONSECUTIVE_BREACHES:()=>Ra,DEFAULT_RSP_OVERHEAD_COOLDOWN_MS:()=>va,DEFAULT_RSP_OVERHEAD_NET_LOSS_FLOOR_BYTES:()=>Sa,RSP_OVERHEAD_FAMILIES:()=>jL,RSP_OVERHEAD_LEDGER_FILE:()=>Pw,RSP_OVERHEAD_SCHEMA_VERSION:()=>Iw,classifyOverheadSample:()=>Ad,noteChildProcessMs:()=>Gw,noteSelfStateBytesRead:()=>co,overheadCounters:()=>Gd,overheadFamilyDisabled:()=>qL,overheadHealth:()=>wr,overheadLedgerPath:()=>Cd,overheadMsOf:()=>Lw,overheadTelemetryFields:()=>Ta,readOverheadLedger:()=>ao,readSelfStateFile:()=>xa,readSelfStateFileSync:()=>WL,recordOverheadSample:()=>Pd,resetOverheadCounters:()=>HL,resetOverheadLedger:()=>UL,startChildProcessTimer:()=>Ze});import{existsSync as NL,mkdirSync as DL,readFileSync as Aw,renameSync as $L,writeFileSync as FL}from"node:fs";import{readFile as ML}from"node:fs/promises";import{dirname as BL,join as Cw}from"node:path";function Lw(e){let t=e.wrapperMs-e.childMs;return Number.isFinite(t)?Math.max(0,Od(t)):0}function Ad(e,t=Zt){let r=Lw(e),n=[];return r>t.maxOverheadMs&&n.push("wall-clock-ceiling"),e.selfStateBytesRead>t.maxSelfStateBytes&&n.push("self-state-byte-ceiling"),e.selfStateBytesRead>t.netLossFloorBytes&&e.selfStateBytesRead>e.bytesSaved&&n.push("overhead-exceeds-savings"),{overhead_ms:r,breached:n.length>0,reasons:n}}function Ta(e,t=Zt){let r=Ad(e,t);return{wrapper_ms:Od(e.wrapperMs),overhead_ms:r.overhead_ms,child_ms:Od(Math.max(0,e.childMs)),self_state_bytes_read:Math.max(0,Math.trunc(e.selfStateBytesRead)),bytes_saved:Math.max(0,Math.trunc(e.bytesSaved)),overhead_breached:r.breached,overhead_breach_reasons:r.reasons.join(",")}}function Cd(e){return Cw(ce(e),Pw)}function ao(e){try{let t=Aw(Cd(e),"utf8"),r=zL(t);if(YL(r))return r}catch{}return{version:1,families:{}}}function Pd(e,t,r=Zt,n=Date.now()){let s=ao(e),o=Ad(t,r),i=s.families[t.family]??KL(t.family,n),a=Nd(i,n)?Nw(i):i,c=o.breached?a.consecutive_breaches+1:0,l={...a,family:t.family,invocations:a.invocations+1,breaches:a.breaches+(o.breached?1:0),consecutive_breaches:c,breached:o.breached,reasons:o.reasons,last_overhead_ms:o.overhead_ms,last_self_state_bytes_read:Math.max(0,Math.trunc(t.selfStateBytesRead)),last_bytes_saved:Math.max(0,Math.trunc(t.bytesSaved)),updated_at:new Date(n).toISOString()};return o.breached?c>=r.consecutiveBreaches&&(l.disabled=!0,l.disabled_at=new Date(n).toISOString(),l.disabled_until=new Date(n+r.cooldownMs).toISOString(),l.disabled_reason=VL(t.family,c,o,r)):(l.disabled=!1,l.disabled_at=null,l.disabled_until=null,l.disabled_reason=null),s.families[t.family]=l,Dw(e,s),l}function qL(e,t,r=Date.now()){let n=ao(e).families[t];return!n?.disabled||Nd(n,r)?null:n}function UL(e,t){let r=ao(e);return t?delete r.families[t]:r.families={},Dw(e,r),r}function wr(e,t=Zt,r=Date.now()){let n=Object.values(ao(e).families).map(a=>Nd(a,r)?Nw(a):a).sort((a,c)=>a.family.localeCompare(c.family)),s=n.filter(a=>a.disabled),o=n.filter(a=>a.consecutive_breaches>0),i=s.length>0||o.length>0?"red":"green";return{schema_version:Iw,verdict:i,summary:JL(i,s,o),ceiling:t,breaching_families:o,disabled_families:s,families:n}}function co(e){Number.isFinite(e)&&e>0&&(Id+=e)}function Gw(e){Number.isFinite(e)&&e>0&&(Ld+=e)}function Gd(){return{selfStateBytesRead:Id,childMs:Ld}}function HL(){Id=0,Ld=0}function Ze(){let e=process.hrtime.bigint(),t=!1;return()=>{t||(t=!0,Gw(Number(process.hrtime.bigint()-e)/1e6))}}async function xa(e){let t=await ML(e,"utf8");return co(Buffer.byteLength(t)),t}function WL(e){let t=Aw(e,"utf8");return co(Buffer.byteLength(t)),t}function VL(e,t,r,n){let s=r.reasons.map(o=>o==="wall-clock-ceiling"?`added ${r.overhead_ms}ms > ${n.maxOverheadMs}ms`:o==="self-state-byte-ceiling"?`self-state read > ${n.maxSelfStateBytes}B`:"self-state read exceeded bytes saved").join("; ");return`rsp ${e} exceeded its overhead ceiling on ${t} consecutive invocations (${s}); wrapper self-disabled, commands pass through raw`}function JL(e,t,r){if(e==="green")return"every wrapper family is inside its overhead ceiling";let n=[];return t.length>0&&n.push(`self-disabled: ${t.map(s=>`${s.family} (${s.reasons.join(",")||"ceiling"})`).join(", ")}`),r.length>0&&n.push(`breaching: ${r.map(s=>`${s.family} x${s.consecutive_breaches}`).join(", ")}`),n.join("; ")}function Nd(e,t){if(!e.disabled||!e.disabled_until)return!1;let r=Date.parse(e.disabled_until);return Number.isFinite(r)&&r<=t}function Nw(e){return{...e,disabled:!1,disabled_at:null,disabled_until:null,disabled_reason:null,consecutive_breaches:0,breached:!1,reasons:[]}}function KL(e,t){return{family:e,invocations:0,breaches:0,consecutive_breaches:0,breached:!1,reasons:[],disabled:!1,disabled_at:null,disabled_until:null,disabled_reason:null,last_overhead_ms:0,last_self_state_bytes_read:0,last_bytes_saved:0,updated_at:new Date(t).toISOString()}}function Dw(e,t){try{let r=Cd(e);if(!NL(Cw(e,".red")))return;DL(BL(r),{recursive:!0});let n=`${r}.${process.pid}.tmp`;FL(n,`${M(t)}
29
29
  `,{encoding:"utf8",mode:384}),$L(n,r)}catch{}}function zL(e){try{return JSON.parse(e)}catch{return z(e)}}function YL(e){return!xd(e)||e.version!==1||!xd(e.families)?!1:Object.values(e.families).every(QL)}function QL(e){return xd(e)&&typeof e.family=="string"&&typeof e.consecutive_breaches=="number"&&typeof e.disabled=="boolean"}function xd(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Od(e){return Number.isFinite(e)?Math.round(e*1e3)/1e3:0}var Pw,Iw,Ea,ka,Sa,Ra,va,jL,Zt,Id,Ld,we=_(()=>{"use strict";Xe();J();Pw="overhead-budget.toon",Iw="red.rsp.overhead.v1",Ea=250,ka=1024*1024,Sa=64*1024,Ra=3,va=6*60*60*1e3,jL=["git","gh","gh-api-json","vitest","cargo","cat","exec","proxy"],Zt={maxOverheadMs:Ea,maxSelfStateBytes:ka,netLossFloorBytes:Sa,consecutiveBreaches:Ra,cooldownMs:va};Id=0,Ld=0});function Mw(e){return e.trimStart().startsWith("{")?"json":"toon"}function $d(e){let t=0;for(;e[t]===`
30
30
  `||e[t]==="\r";)t+=1;let r=e.slice(t);if(r==="")return null;let n=Mw(r);if(n==="json"){let o=r.indexOf(`
31
31
  `);return o<0?null:{frame:r.slice(0,o),dialect:n,rest:r.slice(o+1)}}let s=r.indexOf(`
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);
3
3
  import{spawn as L}from"node:child_process";import{isUtf8 as te}from"node:buffer";async function _(e,n=t=>t){let t=[],r=[];return e.stdout?.on("data",i=>t.push(Buffer.from(i))),e.stderr?.on("data",i=>r.push(Buffer.from(i))),await new Promise(i=>{let c=!1,o=async(a,s)=>{if(c)return;c=!0;let l=Buffer.concat(t),u=l;if(l.length>0&&te(l))try{u=await n(l)}catch{}if(process.stdout.write(u),process.stderr.write(Buffer.concat(r)),s){process.kill(process.pid,s),i(128);return}i(a??0)};e.once("error",a=>{r.push(Buffer.from(`${a instanceof Error?a.message:String(a)}
4
- `)),o(127,null)}),e.once("close",(a,s)=>void o(a,s))})}var re=new Set(["dashboard","stats","gains","show","git","gh","vitest","cargo","cat","exec","wait","doctor","status","sweep","setup","mcp","shell-init","server","warm-resident","gh-api-json","hook"]);function R(e){let n=e[0];if(n==="--full"||n==="--brief"||n==="--terse")return e[1]!=="--"||!e[2]?null:{kind:"argv",argv:[...e.slice(2)],level:n.slice(2)};if(!n||n.startsWith("-"))return n!=="--"||!e[1]?null:{kind:"argv",argv:[...e.slice(1)],level:"automatic"};if(n==="proxy"){if(process.env.RSP_PROXY_FAIL_INTERNAL==="1")return null;let t=e.indexOf("--"),r=t>=0?e.slice(1,t):[];if(r.some(a=>a!=="--full"&&a!=="--brief"&&a!=="--terse"))return null;let i=t>=0?e.slice(t+1):e.slice(1);if(i.length!==1||!i[0]?.trim())return null;let c=i[0];if(ie(c))return null;let o=r.includes("--terse")?"terse":r.includes("--brief")?"brief":r.includes("--full")?"full":"automatic";return{kind:"shell",commandLine:c,level:o}}return re.has(n)?null:{kind:"argv",argv:[...e],level:"automatic"}}async function I(e,n){let t=e.kind==="argv"?L(e.argv[0],e.argv.slice(1),{stdio:["inherit","pipe","pipe"]}):L(e.commandLine,{shell:!0,stdio:["inherit","pipe","pipe"]});return await _(t,n)}function ie(e){return/(?:^|&&|\|\||[;|])\s*(?:(?:[A-Za-z_][A-Za-z0-9_]*=[^\s]+|env)\s+)*(?:git\s+(?:status|log|diff|show|blame|branch\s+-av)(?:\s|$)|gh\s+(?:pr|issue|run)\s+(?:list|view)(?:\s|$)|vitest(?:\s|$)|cargo\s+test(?:\s|$)|(?:cat|head|tail)\s+)/.test(e)}function F(e){let n={app:e,version:oe(x("__RED_BUILD_VERSION__",()=>"3.18.8")??"0.0.0-dev"),gitSha:x("__RED_BUILD_GIT_SHA__",()=>"fbc7b7727876f5bf9f6e8976475dcc9553b71e1d")??"unknown",buildTime:x("__RED_BUILD_TIME__",()=>"2026-08-14T13:07:44-03:00")??"unknown",bundleAsset:x("__RED_BUNDLE_ASSET__",()=>"rsp.bundle.min.mjs")??"unknown"},t=x("__REDDB_SDK_VERSION__",()=>"1.23.1"),r=x("__REDDB_BINARY_TAG__",()=>"v1.23.1");return t&&(n.reddbSdkVersion=t),r&&(n.reddbBinaryTag=r),n}function oe(e){return e.startsWith("v")?e.slice(1):e}function N(e){return`${e.app} ${e.version} ${e.gitSha}`}function x(e,n){try{let t=n();return typeof t=="string"&&t.length>0?t:void 0}catch{return process.env[e.replace(/^__|__$/g,"")]}}var D={"=":"data",":=":{to:"data",typed:!0},":":"meta"},se=/^[a-z][a-z0-9+.-]*:\/\//i;function ce(e,n){return typeof n=="string"?{separator:e,to:n,typed:!1,prefix:!1}:{separator:e,to:n.to,typed:n.typed??!1,prefix:n.prefix??!1}}function ae(e=D){return Object.entries(e).map(([n,t])=>ce(n,t)).sort((n,t)=>t.separator.length-n.separator.length)}function ue(e){return/^-\d+(\.\d+)?$/.test(e)}function O(e){return!(!e||e.startsWith("-")&&!ue(e))}function k(e){if(e==="true")return!0;if(e==="false")return!1;if(e==="null")return null;let n=Number(e);return!Number.isNaN(n)&&Number.isFinite(n)&&e.trim()!==""?n:e}function P(e){if(e==="true")return!0;if(e==="false")return!1;if(e==="null")return null;if(e.startsWith("[")&&e.endsWith("]")||e.startsWith("{")&&e.endsWith("}"))try{return JSON.parse(e)}catch{}let n=Number(e);return!Number.isNaN(n)&&Number.isFinite(n)&&e.trim()!==""?n:e.includes(",")?e.split(",").map(t=>P(t.trim())):e}function w(e,n){switch(n){case"boolean":return le(e);case"number":return fe(e);case"array":return e.split(",").map(t=>k(t.trim()));case"string":default:return e}}function le(e){let n=e.toLowerCase().trim();return n==="true"||n==="yes"||n==="1"||n==="on"}function fe(e){if(e.trim()==="")throw new TypeError(`Cannot convert "${e}" to number`);let n=Number(e);if(Number.isNaN(n))throw new TypeError(`Cannot convert "${e}" to number`);return n}function b(e){return e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'")?e.slice(1,-1):e}function de(e,n={}){return e.map(t=>{let r=n[t.type];return r?r(t.value):t.value}).join("")}function d(e,n){return{type:e,value:n}}function pe(e){let n=[],t=he(e);if(n.push(d("section-header","Usage:"),d("text"," "),d("usage-text",t),d("newline",`
4
+ `)),o(127,null)}),e.once("close",(a,s)=>void o(a,s))})}var re=new Set(["dashboard","stats","gains","show","git","gh","vitest","cargo","cat","exec","wait","doctor","status","sweep","setup","mcp","shell-init","server","warm-resident","gh-api-json","hook"]);function R(e){let n=e[0];if(n==="--full"||n==="--brief"||n==="--terse")return e[1]!=="--"||!e[2]?null:{kind:"argv",argv:[...e.slice(2)],level:n.slice(2)};if(!n||n.startsWith("-"))return n!=="--"||!e[1]?null:{kind:"argv",argv:[...e.slice(1)],level:"automatic"};if(n==="proxy"){if(process.env.RSP_PROXY_FAIL_INTERNAL==="1")return null;let t=e.indexOf("--"),r=t>=0?e.slice(1,t):[];if(r.some(a=>a!=="--full"&&a!=="--brief"&&a!=="--terse"))return null;let i=t>=0?e.slice(t+1):e.slice(1);if(i.length!==1||!i[0]?.trim())return null;let c=i[0];if(ie(c))return null;let o=r.includes("--terse")?"terse":r.includes("--brief")?"brief":r.includes("--full")?"full":"automatic";return{kind:"shell",commandLine:c,level:o}}return re.has(n)?null:{kind:"argv",argv:[...e],level:"automatic"}}async function I(e,n){let t=e.kind==="argv"?L(e.argv[0],e.argv.slice(1),{stdio:["inherit","pipe","pipe"]}):L(e.commandLine,{shell:!0,stdio:["inherit","pipe","pipe"]});return await _(t,n)}function ie(e){return/(?:^|&&|\|\||[;|])\s*(?:(?:[A-Za-z_][A-Za-z0-9_]*=[^\s]+|env)\s+)*(?:git\s+(?:status|log|diff|show|blame|branch\s+-av)(?:\s|$)|gh\s+(?:pr|issue|run)\s+(?:list|view)(?:\s|$)|vitest(?:\s|$)|cargo\s+test(?:\s|$)|(?:cat|head|tail)\s+)/.test(e)}function F(e){let n={app:e,version:oe(x("__RED_BUILD_VERSION__",()=>"3.18.9")??"0.0.0-dev"),gitSha:x("__RED_BUILD_GIT_SHA__",()=>"adeb95d390b3751c9b118725cae4dfcd2e260945")??"unknown",buildTime:x("__RED_BUILD_TIME__",()=>"2026-08-14T17:06:57Z")??"unknown",bundleAsset:x("__RED_BUNDLE_ASSET__",()=>"rsp.bundle.min.mjs")??"unknown"},t=x("__REDDB_SDK_VERSION__",()=>"1.23.1"),r=x("__REDDB_BINARY_TAG__",()=>"v1.23.1");return t&&(n.reddbSdkVersion=t),r&&(n.reddbBinaryTag=r),n}function oe(e){return e.startsWith("v")?e.slice(1):e}function N(e){return`${e.app} ${e.version} ${e.gitSha}`}function x(e,n){try{let t=n();return typeof t=="string"&&t.length>0?t:void 0}catch{return process.env[e.replace(/^__|__$/g,"")]}}var D={"=":"data",":=":{to:"data",typed:!0},":":"meta"},se=/^[a-z][a-z0-9+.-]*:\/\//i;function ce(e,n){return typeof n=="string"?{separator:e,to:n,typed:!1,prefix:!1}:{separator:e,to:n.to,typed:n.typed??!1,prefix:n.prefix??!1}}function ae(e=D){return Object.entries(e).map(([n,t])=>ce(n,t)).sort((n,t)=>t.separator.length-n.separator.length)}function ue(e){return/^-\d+(\.\d+)?$/.test(e)}function O(e){return!(!e||e.startsWith("-")&&!ue(e))}function k(e){if(e==="true")return!0;if(e==="false")return!1;if(e==="null")return null;let n=Number(e);return!Number.isNaN(n)&&Number.isFinite(n)&&e.trim()!==""?n:e}function P(e){if(e==="true")return!0;if(e==="false")return!1;if(e==="null")return null;if(e.startsWith("[")&&e.endsWith("]")||e.startsWith("{")&&e.endsWith("}"))try{return JSON.parse(e)}catch{}let n=Number(e);return!Number.isNaN(n)&&Number.isFinite(n)&&e.trim()!==""?n:e.includes(",")?e.split(",").map(t=>P(t.trim())):e}function w(e,n){switch(n){case"boolean":return le(e);case"number":return fe(e);case"array":return e.split(",").map(t=>k(t.trim()));case"string":default:return e}}function le(e){let n=e.toLowerCase().trim();return n==="true"||n==="yes"||n==="1"||n==="on"}function fe(e){if(e.trim()==="")throw new TypeError(`Cannot convert "${e}" to number`);let n=Number(e);if(Number.isNaN(n))throw new TypeError(`Cannot convert "${e}" to number`);return n}function b(e){return e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'")?e.slice(1,-1):e}function de(e,n={}){return e.map(t=>{let r=n[t.type];return r?r(t.value):t.value}).join("")}function d(e,n){return{type:e,value:n}}function pe(e){let n=[],t=he(e);if(n.push(d("section-header","Usage:"),d("text"," "),d("usage-text",t),d("newline",`
5
5
  `),d("newline",`
6
6
  `)),e.positional&&e.positional.length>0){n.push(d("section-header","Arguments:"),d("newline",`
7
7
  `));for(let r of e.positional)if(r.description){let i=r.variadic?`${r.name}...`:r.name;n.push(d("indent"," "),d("positional-name",`<${i}>`)),r.required||n.push(d("positional-optional"," (optional)")),n.push(d("newline",`