@skyramp/testbot-core 0.13.3-v3.554 → 0.13.3-v3.555

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.
@@ -139,7 +139,7 @@ ${i}
139
139
  `),`
140
140
  `,t)}o(Lj,"boundedFailureText");function ha(e){return no(Vie(e),[]).trim()}o(ha,"commandFailureText");var zie=/^(.*?:\s*)?Command failed: (?:git|gh)\b.*$/;function sp(e,t=qh){let[n="",...i]=e.split(`
141
141
  `).map(a=>a.trim()).filter(Boolean),r=i.length?zie.exec(n):null,s=r?[`${r[1]??""}${i[0]}`,...i.slice(1)]:[n,...i];return Mj(s," ",t,Math.floor(t*2/3))}o(sp,"failureReason");function yu(e){return e.replace(new RegExp("\x1B\\[[0-9;]*m","g"),"")}o(yu,"stripAnsi");function qie(e){let t=/^(yarn run v|info Visit|error Command failed|npm ERR!|husky\b|\$ )/i,n=yu(e).split(`
142
- `).map(a=>a.trim()).filter(Boolean),i=n.filter(a=>!t.test(a)),r=i.length?i:n;return[...r].reverse().find(a=>/(error|warning|problem|✖|✗|✘|fail|not listed|cannot|denied)/i.test(a))??r[r.length-1]??"(no output)"}o(qie,"hookSummary");function jj(e){if(!/\bhook\b|husky|pre-commit|lint-staged/i.test(e))return;let t=qie(e),n=ue().staged.commitHook(/husky\s*[->]\s*([\w-]+)\s+(?:script|hook)\b/i.exec(yu(e))?.[1]);return/\(code 127\)|exit code 127/i.test(e)||/command not found|: not found$/i.test(t)?ue().staged.commitHookCouldNotRun(n,t):ue().staged.commitRefusedByHook(n,t)}o(jj,"hookRefusal");var d={};ei(d,{BRAND:()=>yse,DIRTY:()=>ma,EMPTY_PATH:()=>Wie,INVALID:()=>Ce,NEVER:()=>noe,OK:()=>vn,ParseStatus:()=>un,Schema:()=>Ve,ZodAny:()=>so,ZodArray:()=>As,ZodBigInt:()=>Ea,ZodBoolean:()=>ba,ZodBranded:()=>ap,ZodCatch:()=>$a,ZodDate:()=>va,ZodDefault:()=>Qa,ZodDiscriminatedUnion:()=>Yh,ZodEffects:()=>Mr,ZodEnum:()=>Ra,ZodError:()=>Wn,ZodFirstPartyTypeKind:()=>xe,ZodFunction:()=>Zh,ZodIntersection:()=>Sa,ZodIssueCode:()=>G,ZodLazy:()=>ka,ZodLiteral:()=>Ba,ZodMap:()=>Cu,ZodNaN:()=>ku,ZodNativeEnum:()=>xa,ZodNever:()=>li,ZodNull:()=>wa,ZodNullable:()=>Pi,ZodNumber:()=>ya,ZodObject:()=>Zn,ZodOptional:()=>Fr,ZodParsedType:()=>re,ZodPipeline:()=>cp,ZodPromise:()=>oo,ZodReadonly:()=>Ta,ZodRecord:()=>Wh,ZodSchema:()=>Ve,ZodSet:()=>Su,ZodString:()=>io,ZodSymbol:()=>Iu,ZodTransformer:()=>Mr,ZodTuple:()=>Ni,ZodType:()=>Ve,ZodUndefined:()=>Ia,ZodUnion:()=>Ca,ZodUnknown:()=>gs,ZodVoid:()=>wu,addIssueToContext:()=>X,any:()=>Bse,array:()=>$se,bigint:()=>Ise,boolean:()=>Xj,coerce:()=>toe,custom:()=>Wj,date:()=>wse,datetimeRegex:()=>Jj,defaultErrorMap:()=>ps,discriminatedUnion:()=>Nse,effect:()=>Hse,enum:()=>Vse,function:()=>Lse,getErrorMap:()=>Eu,getParsedType:()=>_i,instanceof:()=>bse,intersection:()=>Pse,isAborted:()=>Hh,isAsync:()=>bu,isDirty:()=>Jh,isValid:()=>ro,late:()=>Ese,lazy:()=>jse,literal:()=>Gse,makeIssue:()=>op,map:()=>Ose,nan:()=>vse,nativeEnum:()=>zse,never:()=>xse,null:()=>kse,nullable:()=>Yse,number:()=>Kj,object:()=>Tse,objectUtil:()=>BC,oboolean:()=>eoe,onumber:()=>Xse,optional:()=>Jse,ostring:()=>Kse,pipeline:()=>Zse,preprocess:()=>Wse,promise:()=>qse,quotelessJson:()=>Hie,record:()=>Fse,set:()=>Mse,setErrorMap:()=>Yie,strictObject:()=>Dse,string:()=>Zj,symbol:()=>Cse,transformer:()=>Hse,tuple:()=>Use,undefined:()=>Sse,union:()=>_se,unknown:()=>Rse,util:()=>Ye,void:()=>Qse});var Ye;(function(e){e.assertEqual=r=>{};function t(r){}o(t,"assertIs"),e.assertIs=t;function n(r){throw new Error}o(n,"assertNever"),e.assertNever=n,e.arrayToEnum=r=>{let s={};for(let a of r)s[a]=a;return s},e.getValidEnumValues=r=>{let s=e.objectKeys(r).filter(c=>typeof r[r[c]]!="number"),a={};for(let c of s)a[c]=r[c];return e.objectValues(a)},e.objectValues=r=>e.objectKeys(r).map(function(s){return r[s]}),e.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{let s=[];for(let a in r)Object.prototype.hasOwnProperty.call(r,a)&&s.push(a);return s},e.find=(r,s)=>{for(let a of r)if(s(a))return a},e.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function i(r,s=" | "){return r.map(a=>typeof a=="string"?`'${a}'`:a).join(s)}o(i,"joinValues"),e.joinValues=i,e.jsonStringifyReplacer=(r,s)=>typeof s=="bigint"?s.toString():s})(Ye||(Ye={}));var BC;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(BC||(BC={}));var re=Ye.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),_i=o(e=>{switch(typeof e){case"undefined":return re.undefined;case"string":return re.string;case"number":return Number.isNaN(e)?re.nan:re.number;case"boolean":return re.boolean;case"function":return re.function;case"bigint":return re.bigint;case"symbol":return re.symbol;case"object":return Array.isArray(e)?re.array:e===null?re.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?re.promise:typeof Map<"u"&&e instanceof Map?re.map:typeof Set<"u"&&e instanceof Set?re.set:typeof Date<"u"&&e instanceof Date?re.date:re.object;default:return re.unknown}},"getParsedType");var G=Ye.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"]),Hie=o(e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),Wn=class e extends Error{static{o(this,"ZodError")}get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){let n=t||function(s){return s.message},i={_errors:[]},r=o(s=>{for(let a of s.issues)if(a.code==="invalid_union")a.unionErrors.map(r);else if(a.code==="invalid_return_type")r(a.returnTypeError);else if(a.code==="invalid_arguments")r(a.argumentsError);else if(a.path.length===0)i._errors.push(n(a));else{let c=i,u=0;for(;u<a.path.length;){let l=a.path[u],p=u===a.path.length-1;if(l==="_errors"){p&&c._errors.push(n(a)),u++;continue}Object.prototype.hasOwnProperty.call(c,l)||(l==="__proto__"?Object.defineProperty(c,l,{value:{_errors:[]},writable:!0,enumerable:!0,configurable:!0}):c[l]={_errors:[]}),c=c[l],p&&c._errors.push(n(a)),u++}}},"processError");return r(this),i}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,Ye.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){let n=Object.create(null),i=[];for(let r of this.issues)if(r.path.length>0){let s=r.path[0];n[s]=n[s]||[],n[s].push(t(r))}else i.push(t(r));return{formErrors:i,fieldErrors:n}}get formErrors(){return this.flatten()}};Wn.create=e=>new Wn(e);var Jie=o((e,t)=>{let n;switch(e.code){case G.invalid_type:e.received===re.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case G.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Ye.jsonStringifyReplacer)}`;break;case G.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ye.joinValues(e.keys,", ")}`;break;case G.invalid_union:n="Invalid input";break;case G.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ye.joinValues(e.options)}`;break;case G.invalid_enum_value:n=`Invalid enum value. Expected ${Ye.joinValues(e.options)}, received '${e.received}'`;break;case G.invalid_arguments:n="Invalid function arguments";break;case G.invalid_return_type:n="Invalid function return type";break;case G.invalid_date:n="Invalid date";break;case G.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Ye.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case G.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case G.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case G.custom:n="Invalid input";break;case G.invalid_intersection_types:n="Intersection results could not be merged";break;case G.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case G.not_finite:n="Number must be finite";break;default:n=t.defaultError,Ye.assertNever(e)}return{message:n}},"errorMap"),ps=Jie;var Gj=ps;function Yie(e){Gj=e}o(Yie,"setErrorMap");function Eu(){return Gj}o(Eu,"getErrorMap");var op=o(e=>{let{data:t,path:n,errorMaps:i,issueData:r}=e,s=[...n,...r.path||[]],a={...r,path:s};if(r.message!==void 0)return{...r,path:s,message:r.message};let c="",u=i.filter(l=>!!l).slice().reverse();for(let l of u)c=l(a,{data:t,defaultError:c}).message;return{...r,path:s,message:c}},"makeIssue"),Wie=[];function X(e,t){let n=Eu(),i=op({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===ps?void 0:ps].filter(r=>!!r)});e.common.issues.push(i)}o(X,"addIssueToContext");var un=class e{static{o(this,"ParseStatus")}constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){let i=[];for(let r of n){if(r.status==="aborted")return Ce;r.status==="dirty"&&t.dirty(),i.push(r.value)}return{status:t.value,value:i}}static async mergeObjectAsync(t,n){let i=[];for(let r of n){let s=await r.key,a=await r.value;i.push({key:s,value:a})}return e.mergeObjectSync(t,i)}static mergeObjectSync(t,n){let i={};for(let r of n){let{key:s,value:a}=r;if(s.status==="aborted"||a.status==="aborted")return Ce;s.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),s.value!=="__proto__"&&(typeof a.value<"u"||r.alwaysSet)&&(i[s.value]=a.value)}return{status:t.value,value:i}}},Ce=Object.freeze({status:"aborted"}),ma=o(e=>({status:"dirty",value:e}),"DIRTY"),vn=o(e=>({status:"valid",value:e}),"OK"),Hh=o(e=>e.status==="aborted","isAborted"),Jh=o(e=>e.status==="dirty","isDirty"),ro=o(e=>e.status==="valid","isValid"),bu=o(e=>typeof Promise<"u"&&e instanceof Promise,"isAsync");var de;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(de||(de={}));var Or=class{static{o(this,"ParseInputLazyPath")}constructor(t,n,i,r){this._cachedPath=[],this.parent=t,this.data=n,this._path=i,this._key=r}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}},Vj=o((e,t)=>{if(ro(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 n=new Wn(e.common.issues);return this._error=n,this._error}}},"handleResult");function Fe(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:i,description:r}=e;if(t&&(n||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:r}:{errorMap:o((a,c)=>{let{message:u}=e;return a.code==="invalid_enum_value"?{message:u??c.defaultError}:typeof c.data>"u"?{message:u??i??c.defaultError}:a.code!=="invalid_type"?{message:c.defaultError}:{message:u??n??c.defaultError}},"customMap"),description:r}}o(Fe,"processCreateParams");var Ve=class{static{o(this,"ZodType")}get description(){return this._def.description}_getType(t){return _i(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:_i(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new un,ctx:{common:t.parent.common,data:t.data,parsedType:_i(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let n=this._parse(t);if(bu(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){let n=this._parse(t);return Promise.resolve(n)}parse(t,n){let i=this.safeParse(t,n);if(i.success)return i.data;throw i.error}safeParse(t,n){let i={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:_i(t)},r=this._parseSync({data:t,path:i.path,parent:i});return Vj(i,r)}"~validate"(t){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:_i(t)};if(!this["~standard"].async)try{let i=this._parseSync({data:t,path:[],parent:n});return ro(i)?{value:i.value}:{issues:n.common.issues}}catch(i){i?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(i=>ro(i)?{value:i.value}:{issues:n.common.issues})}async parseAsync(t,n){let i=await this.safeParseAsync(t,n);if(i.success)return i.data;throw i.error}async safeParseAsync(t,n){let i={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:_i(t)},r=this._parse({data:t,path:i.path,parent:i}),s=await(bu(r)?r:Promise.resolve(r));return Vj(i,s)}refine(t,n){let i=o(r=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(r):n,"getIssueProperties");return this._refinement((r,s)=>{let a=t(r),c=o(()=>s.addIssue({code:G.custom,...i(r)}),"setError");return typeof Promise<"u"&&a instanceof Promise?a.then(u=>u?!0:(c(),!1)):a?!0:(c(),!1)})}refinement(t,n){return this._refinement((i,r)=>t(i)?!0:(r.addIssue(typeof n=="function"?n(i,r):n),!1))}_refinement(t){return new Mr({schema:this,typeName:xe.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:o(n=>this["~validate"](n),"validate")}}optional(){return Fr.create(this,this._def)}nullable(){return Pi.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return As.create(this)}promise(){return oo.create(this,this._def)}or(t){return Ca.create([this,t],this._def)}and(t){return Sa.create(this,t,this._def)}transform(t){return new Mr({...Fe(this._def),schema:this,typeName:xe.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let n=typeof t=="function"?t:()=>t;return new Qa({...Fe(this._def),innerType:this,defaultValue:n,typeName:xe.ZodDefault})}brand(){return new ap({typeName:xe.ZodBranded,type:this,...Fe(this._def)})}catch(t){let n=typeof t=="function"?t:()=>t;return new $a({...Fe(this._def),innerType:this,catchValue:n,typeName:xe.ZodCatch})}describe(t){let n=this.constructor;return new n({...this._def,description:t})}pipe(t){return cp.create(this,t)}readonly(){return Ta.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Zie=/^c[^\s-]{8,}$/i,Kie=/^[0-9a-z]+$/,Xie=/^[0-9A-HJKMNP-TV-Z]{26}$/i,ese=/^[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,tse=/^[a-z0-9_-]{21}$/i,nse=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,rse=/^[-+]?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)?)??$/,ise=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,sse="^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$",RC,ose=/^(?:(?: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])$/,ase=/^(?:(?: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])$/,cse=/^(([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]))$/,use=/^(([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])$/,lse=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,dse=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,qj="((\\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])))",pse=new RegExp(`^${qj}$`);function Hj(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);let n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}o(Hj,"timeRegexSource");function fse(e){return new RegExp(`^${Hj(e)}$`)}o(fse,"timeRegex");function Jj(e){let t=`${qj}T${Hj(e)}`,n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}o(Jj,"datetimeRegex");function gse(e,t){return!!((t==="v4"||!t)&&ose.test(e)||(t==="v6"||!t)&&cse.test(e))}o(gse,"isValidIP");function Ase(e,t){if(!nse.test(e))return!1;try{let[n]=e.split(".");if(!n)return!1;let i=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),r=JSON.parse(atob(i));return!(typeof r!="object"||r===null||"typ"in r&&r?.typ!=="JWT"||!r.alg||t&&r.alg!==t)}catch{return!1}}o(Ase,"isValidJWT");function hse(e,t){return!!((t==="v4"||!t)&&ase.test(e)||(t==="v6"||!t)&&use.test(e))}o(hse,"isValidCidr");var io=class e extends Ve{static{o(this,"ZodString")}_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==re.string){let s=this._getOrReturnCtx(t);return X(s,{code:G.invalid_type,expected:re.string,received:s.parsedType}),Ce}let i=new un,r;for(let s of this._def.checks)if(s.kind==="min")t.data.length<s.value&&(r=this._getOrReturnCtx(t,r),X(r,{code:G.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),i.dirty());else if(s.kind==="max")t.data.length>s.value&&(r=this._getOrReturnCtx(t,r),X(r,{code:G.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),i.dirty());else if(s.kind==="length"){let a=t.data.length>s.value,c=t.data.length<s.value;(a||c)&&(r=this._getOrReturnCtx(t,r),a?X(r,{code:G.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):c&&X(r,{code:G.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),i.dirty())}else if(s.kind==="email")ise.test(t.data)||(r=this._getOrReturnCtx(t,r),X(r,{validation:"email",code:G.invalid_string,message:s.message}),i.dirty());else if(s.kind==="emoji")RC||(RC=new RegExp(sse,"u")),RC.test(t.data)||(r=this._getOrReturnCtx(t,r),X(r,{validation:"emoji",code:G.invalid_string,message:s.message}),i.dirty());else if(s.kind==="uuid")ese.test(t.data)||(r=this._getOrReturnCtx(t,r),X(r,{validation:"uuid",code:G.invalid_string,message:s.message}),i.dirty());else if(s.kind==="nanoid")tse.test(t.data)||(r=this._getOrReturnCtx(t,r),X(r,{validation:"nanoid",code:G.invalid_string,message:s.message}),i.dirty());else if(s.kind==="cuid")Zie.test(t.data)||(r=this._getOrReturnCtx(t,r),X(r,{validation:"cuid",code:G.invalid_string,message:s.message}),i.dirty());else if(s.kind==="cuid2")Kie.test(t.data)||(r=this._getOrReturnCtx(t,r),X(r,{validation:"cuid2",code:G.invalid_string,message:s.message}),i.dirty());else if(s.kind==="ulid")Xie.test(t.data)||(r=this._getOrReturnCtx(t,r),X(r,{validation:"ulid",code:G.invalid_string,message:s.message}),i.dirty());else if(s.kind==="url")try{new URL(t.data)}catch{r=this._getOrReturnCtx(t,r),X(r,{validation:"url",code:G.invalid_string,message:s.message}),i.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(t.data)||(r=this._getOrReturnCtx(t,r),X(r,{validation:"regex",code:G.invalid_string,message:s.message}),i.dirty())):s.kind==="trim"?t.data=t.data.trim():s.kind==="includes"?t.data.includes(s.value,s.position)||(r=this._getOrReturnCtx(t,r),X(r,{code:G.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),i.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)||(r=this._getOrReturnCtx(t,r),X(r,{code:G.invalid_string,validation:{startsWith:s.value},message:s.message}),i.dirty()):s.kind==="endsWith"?t.data.endsWith(s.value)||(r=this._getOrReturnCtx(t,r),X(r,{code:G.invalid_string,validation:{endsWith:s.value},message:s.message}),i.dirty()):s.kind==="datetime"?Jj(s).test(t.data)||(r=this._getOrReturnCtx(t,r),X(r,{code:G.invalid_string,validation:"datetime",message:s.message}),i.dirty()):s.kind==="date"?pse.test(t.data)||(r=this._getOrReturnCtx(t,r),X(r,{code:G.invalid_string,validation:"date",message:s.message}),i.dirty()):s.kind==="time"?fse(s).test(t.data)||(r=this._getOrReturnCtx(t,r),X(r,{code:G.invalid_string,validation:"time",message:s.message}),i.dirty()):s.kind==="duration"?rse.test(t.data)||(r=this._getOrReturnCtx(t,r),X(r,{validation:"duration",code:G.invalid_string,message:s.message}),i.dirty()):s.kind==="ip"?gse(t.data,s.version)||(r=this._getOrReturnCtx(t,r),X(r,{validation:"ip",code:G.invalid_string,message:s.message}),i.dirty()):s.kind==="jwt"?Ase(t.data,s.alg)||(r=this._getOrReturnCtx(t,r),X(r,{validation:"jwt",code:G.invalid_string,message:s.message}),i.dirty()):s.kind==="cidr"?hse(t.data,s.version)||(r=this._getOrReturnCtx(t,r),X(r,{validation:"cidr",code:G.invalid_string,message:s.message}),i.dirty()):s.kind==="base64"?lse.test(t.data)||(r=this._getOrReturnCtx(t,r),X(r,{validation:"base64",code:G.invalid_string,message:s.message}),i.dirty()):s.kind==="base64url"?dse.test(t.data)||(r=this._getOrReturnCtx(t,r),X(r,{validation:"base64url",code:G.invalid_string,message:s.message}),i.dirty()):Ye.assertNever(s);return{status:i.value,value:t.data}}_regex(t,n,i){return this.refinement(r=>t.test(r),{validation:n,code:G.invalid_string,...de.errToObj(i)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...de.errToObj(t)})}url(t){return this._addCheck({kind:"url",...de.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...de.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...de.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...de.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...de.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...de.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...de.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...de.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...de.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...de.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...de.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...de.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,...de.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,...de.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...de.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...de.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...de.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...de.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...de.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...de.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...de.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...de.errToObj(n)})}nonempty(t){return this.min(1,de.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 n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}};io.create=e=>new io({checks:[],typeName:xe.ZodString,coerce:e?.coerce??!1,...Fe(e)});function mse(e,t){let n=(e.toString().split(".")[1]||"").length,i=(t.toString().split(".")[1]||"").length,r=n>i?n:i,s=Number.parseInt(e.toFixed(r).replace(".","")),a=Number.parseInt(t.toFixed(r).replace(".",""));return s%a/10**r}o(mse,"floatSafeRemainder");var ya=class e extends Ve{static{o(this,"ZodNumber")}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)!==re.number){let s=this._getOrReturnCtx(t);return X(s,{code:G.invalid_type,expected:re.number,received:s.parsedType}),Ce}let i,r=new un;for(let s of this._def.checks)s.kind==="int"?Ye.isInteger(t.data)||(i=this._getOrReturnCtx(t,i),X(i,{code:G.invalid_type,expected:"integer",received:"float",message:s.message}),r.dirty()):s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(i=this._getOrReturnCtx(t,i),X(i,{code:G.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),r.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(i=this._getOrReturnCtx(t,i),X(i,{code:G.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),r.dirty()):s.kind==="multipleOf"?mse(t.data,s.value)!==0&&(i=this._getOrReturnCtx(t,i),X(i,{code:G.not_multiple_of,multipleOf:s.value,message:s.message}),r.dirty()):s.kind==="finite"?Number.isFinite(t.data)||(i=this._getOrReturnCtx(t,i),X(i,{code:G.not_finite,message:s.message}),r.dirty()):Ye.assertNever(s);return{status:r.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,de.toString(n))}gt(t,n){return this.setLimit("min",t,!1,de.toString(n))}lte(t,n){return this.setLimit("max",t,!0,de.toString(n))}lt(t,n){return this.setLimit("max",t,!1,de.toString(n))}setLimit(t,n,i,r){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:i,message:de.toString(r)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:de.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:de.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:de.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:de.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:de.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:de.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:de.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:de.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:de.toString(t)})}get minValue(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Ye.isInteger(t.value))}get isFinite(){let t=null,n=null;for(let i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(n===null||i.value>n)&&(n=i.value):i.kind==="max"&&(t===null||i.value<t)&&(t=i.value)}return Number.isFinite(n)&&Number.isFinite(t)}};ya.create=e=>new ya({checks:[],typeName:xe.ZodNumber,coerce:e?.coerce||!1,...Fe(e)});var Ea=class e extends Ve{static{o(this,"ZodBigInt")}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)!==re.bigint)return this._getInvalidInput(t);let i,r=new un;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(i=this._getOrReturnCtx(t,i),X(i,{code:G.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),r.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(i=this._getOrReturnCtx(t,i),X(i,{code:G.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),r.dirty()):s.kind==="multipleOf"?t.data%s.value!==BigInt(0)&&(i=this._getOrReturnCtx(t,i),X(i,{code:G.not_multiple_of,multipleOf:s.value,message:s.message}),r.dirty()):Ye.assertNever(s);return{status:r.value,value:t.data}}_getInvalidInput(t){let n=this._getOrReturnCtx(t);return X(n,{code:G.invalid_type,expected:re.bigint,received:n.parsedType}),Ce}gte(t,n){return this.setLimit("min",t,!0,de.toString(n))}gt(t,n){return this.setLimit("min",t,!1,de.toString(n))}lte(t,n){return this.setLimit("max",t,!0,de.toString(n))}lt(t,n){return this.setLimit("max",t,!1,de.toString(n))}setLimit(t,n,i,r){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:i,message:de.toString(r)}]})}_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:de.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:de.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:de.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:de.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:de.toString(n)})}get minValue(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}};Ea.create=e=>new Ea({checks:[],typeName:xe.ZodBigInt,coerce:e?.coerce??!1,...Fe(e)});var ba=class extends Ve{static{o(this,"ZodBoolean")}_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==re.boolean){let i=this._getOrReturnCtx(t);return X(i,{code:G.invalid_type,expected:re.boolean,received:i.parsedType}),Ce}return vn(t.data)}};ba.create=e=>new ba({typeName:xe.ZodBoolean,coerce:e?.coerce||!1,...Fe(e)});var va=class e extends Ve{static{o(this,"ZodDate")}_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==re.date){let s=this._getOrReturnCtx(t);return X(s,{code:G.invalid_type,expected:re.date,received:s.parsedType}),Ce}if(Number.isNaN(t.data.getTime())){let s=this._getOrReturnCtx(t);return X(s,{code:G.invalid_date}),Ce}let i=new un,r;for(let s of this._def.checks)s.kind==="min"?t.data.getTime()<s.value&&(r=this._getOrReturnCtx(t,r),X(r,{code:G.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),i.dirty()):s.kind==="max"?t.data.getTime()>s.value&&(r=this._getOrReturnCtx(t,r),X(r,{code:G.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),i.dirty()):Ye.assertNever(s);return{status:i.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:de.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:de.toString(n)})}get minDate(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}};va.create=e=>new va({checks:[],coerce:e?.coerce||!1,typeName:xe.ZodDate,...Fe(e)});var Iu=class extends Ve{static{o(this,"ZodSymbol")}_parse(t){if(this._getType(t)!==re.symbol){let i=this._getOrReturnCtx(t);return X(i,{code:G.invalid_type,expected:re.symbol,received:i.parsedType}),Ce}return vn(t.data)}};Iu.create=e=>new Iu({typeName:xe.ZodSymbol,...Fe(e)});var Ia=class extends Ve{static{o(this,"ZodUndefined")}_parse(t){if(this._getType(t)!==re.undefined){let i=this._getOrReturnCtx(t);return X(i,{code:G.invalid_type,expected:re.undefined,received:i.parsedType}),Ce}return vn(t.data)}};Ia.create=e=>new Ia({typeName:xe.ZodUndefined,...Fe(e)});var wa=class extends Ve{static{o(this,"ZodNull")}_parse(t){if(this._getType(t)!==re.null){let i=this._getOrReturnCtx(t);return X(i,{code:G.invalid_type,expected:re.null,received:i.parsedType}),Ce}return vn(t.data)}};wa.create=e=>new wa({typeName:xe.ZodNull,...Fe(e)});var so=class extends Ve{static{o(this,"ZodAny")}constructor(){super(...arguments),this._any=!0}_parse(t){return vn(t.data)}};so.create=e=>new so({typeName:xe.ZodAny,...Fe(e)});var gs=class extends Ve{static{o(this,"ZodUnknown")}constructor(){super(...arguments),this._unknown=!0}_parse(t){return vn(t.data)}};gs.create=e=>new gs({typeName:xe.ZodUnknown,...Fe(e)});var li=class extends Ve{static{o(this,"ZodNever")}_parse(t){let n=this._getOrReturnCtx(t);return X(n,{code:G.invalid_type,expected:re.never,received:n.parsedType}),Ce}};li.create=e=>new li({typeName:xe.ZodNever,...Fe(e)});var wu=class extends Ve{static{o(this,"ZodVoid")}_parse(t){if(this._getType(t)!==re.undefined){let i=this._getOrReturnCtx(t);return X(i,{code:G.invalid_type,expected:re.void,received:i.parsedType}),Ce}return vn(t.data)}};wu.create=e=>new wu({typeName:xe.ZodVoid,...Fe(e)});var As=class e extends Ve{static{o(this,"ZodArray")}_parse(t){let{ctx:n,status:i}=this._processInputParams(t),r=this._def;if(n.parsedType!==re.array)return X(n,{code:G.invalid_type,expected:re.array,received:n.parsedType}),Ce;if(r.exactLength!==null){let a=n.data.length>r.exactLength.value,c=n.data.length<r.exactLength.value;(a||c)&&(X(n,{code:a?G.too_big:G.too_small,minimum:c?r.exactLength.value:void 0,maximum:a?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),i.dirty())}if(r.minLength!==null&&n.data.length<r.minLength.value&&(X(n,{code:G.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),i.dirty()),r.maxLength!==null&&n.data.length>r.maxLength.value&&(X(n,{code:G.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),i.dirty()),n.common.async)return Promise.all([...n.data].map((a,c)=>r.type._parseAsync(new Or(n,a,n.path,c)))).then(a=>un.mergeArray(i,a));let s=[...n.data].map((a,c)=>r.type._parseSync(new Or(n,a,n.path,c)));return un.mergeArray(i,s)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:de.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:de.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:de.toString(n)}})}nonempty(t){return this.min(1,t)}};As.create=(e,t)=>new As({type:e,minLength:null,maxLength:null,exactLength:null,typeName:xe.ZodArray,...Fe(t)});function vu(e){if(e instanceof Zn){let t={};for(let n in e.shape){let i=e.shape[n];t[n]=Fr.create(vu(i))}return new Zn({...e._def,shape:o(()=>t,"shape")})}else return e instanceof As?new As({...e._def,type:vu(e.element)}):e instanceof Fr?Fr.create(vu(e.unwrap())):e instanceof Pi?Pi.create(vu(e.unwrap())):e instanceof Ni?Ni.create(e.items.map(t=>vu(t))):e}o(vu,"deepPartialify");var Zn=class e extends Ve{static{o(this,"ZodObject")}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(),n=Ye.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==re.object){let l=this._getOrReturnCtx(t);return X(l,{code:G.invalid_type,expected:re.object,received:l.parsedType}),Ce}let{status:i,ctx:r}=this._processInputParams(t),{shape:s,keys:a}=this._getCached(),c=[];if(!(this._def.catchall instanceof li&&this._def.unknownKeys==="strip"))for(let l in r.data)a.includes(l)||c.push(l);let u=[];for(let l of a){let p=s[l],f=r.data[l];u.push({key:{status:"valid",value:l},value:p._parse(new Or(r,f,r.path,l)),alwaysSet:l in r.data})}if(this._def.catchall instanceof li){let l=this._def.unknownKeys;if(l==="passthrough")for(let p of c)u.push({key:{status:"valid",value:p},value:{status:"valid",value:r.data[p]}});else if(l==="strict")c.length>0&&(X(r,{code:G.unrecognized_keys,keys:c}),i.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let p of c){let f=r.data[p];u.push({key:{status:"valid",value:p},value:l._parse(new Or(r,f,r.path,p)),alwaysSet:p in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let l=[];for(let p of u){let f=await p.key,A=await p.value;l.push({key:f,value:A,alwaysSet:p.alwaysSet})}return l}).then(l=>un.mergeObjectSync(i,l)):un.mergeObjectSync(i,u)}get shape(){return this._def.shape()}strict(t){return de.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:o((n,i)=>{let r=this._def.errorMap?.(n,i).message??i.defaultError;return n.code==="unrecognized_keys"?{message:de.errToObj(t).message??r}:{message:r}},"errorMap")}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:o(()=>({...this._def.shape(),...t}),"shape")})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:o(()=>({...this._def.shape(),...t._def.shape()}),"shape"),typeName:xe.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};for(let i of Ye.objectKeys(t))t[i]&&this.shape[i]&&(n[i]=this.shape[i]);return new e({...this._def,shape:o(()=>n,"shape")})}omit(t){let n={};for(let i of Ye.objectKeys(this.shape))t[i]||(n[i]=this.shape[i]);return new e({...this._def,shape:o(()=>n,"shape")})}deepPartial(){return vu(this)}partial(t){let n={};for(let i of Ye.objectKeys(this.shape)){let r=this.shape[i];t&&!t[i]?n[i]=r:n[i]=r.optional()}return new e({...this._def,shape:o(()=>n,"shape")})}required(t){let n={};for(let i of Ye.objectKeys(this.shape))if(t&&!t[i])n[i]=this.shape[i];else{let s=this.shape[i];for(;s instanceof Fr;)s=s._def.innerType;n[i]=s}return new e({...this._def,shape:o(()=>n,"shape")})}keyof(){return Yj(Ye.objectKeys(this.shape))}};Zn.create=(e,t)=>new Zn({shape:o(()=>e,"shape"),unknownKeys:"strip",catchall:li.create(),typeName:xe.ZodObject,...Fe(t)});Zn.strictCreate=(e,t)=>new Zn({shape:o(()=>e,"shape"),unknownKeys:"strict",catchall:li.create(),typeName:xe.ZodObject,...Fe(t)});Zn.lazycreate=(e,t)=>new Zn({shape:e,unknownKeys:"strip",catchall:li.create(),typeName:xe.ZodObject,...Fe(t)});var Ca=class extends Ve{static{o(this,"ZodUnion")}_parse(t){let{ctx:n}=this._processInputParams(t),i=this._def.options;function r(s){for(let c of s)if(c.result.status==="valid")return c.result;for(let c of s)if(c.result.status==="dirty")return n.common.issues.push(...c.ctx.common.issues),c.result;let a=s.map(c=>new Wn(c.ctx.common.issues));return X(n,{code:G.invalid_union,unionErrors:a}),Ce}if(o(r,"handleResults"),n.common.async)return Promise.all(i.map(async s=>{let a={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(r);{let s,a=[];for(let u of i){let l={...n,common:{...n.common,issues:[]},parent:null},p=u._parseSync({data:n.data,path:n.path,parent:l});if(p.status==="valid")return p;p.status==="dirty"&&!s&&(s={result:p,ctx:l}),l.common.issues.length&&a.push(l.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;let c=a.map(u=>new Wn(u));return X(n,{code:G.invalid_union,unionErrors:c}),Ce}}get options(){return this._def.options}};Ca.create=(e,t)=>new Ca({options:e,typeName:xe.ZodUnion,...Fe(t)});var fs=o(e=>e instanceof ka?fs(e.schema):e instanceof Mr?fs(e.innerType()):e instanceof Ba?[e.value]:e instanceof Ra?e.options:e instanceof xa?Ye.objectValues(e.enum):e instanceof Qa?fs(e._def.innerType):e instanceof Ia?[void 0]:e instanceof wa?[null]:e instanceof Fr?[void 0,...fs(e.unwrap())]:e instanceof Pi?[null,...fs(e.unwrap())]:e instanceof ap||e instanceof Ta?fs(e.unwrap()):e instanceof $a?fs(e._def.innerType):[],"getDiscriminator"),Yh=class e extends Ve{static{o(this,"ZodDiscriminatedUnion")}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==re.object)return X(n,{code:G.invalid_type,expected:re.object,received:n.parsedType}),Ce;let i=this.discriminator,r=n.data[i],s=this.optionsMap.get(r);return s?n.common.async?s._parseAsync({data:n.data,path:n.path,parent:n}):s._parseSync({data:n.data,path:n.path,parent:n}):(X(n,{code:G.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),Ce)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,i){let r=new Map;for(let s of n){let a=fs(s.shape[t]);if(!a.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let c of a){if(r.has(c))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(c)}`);r.set(c,s)}}return new e({typeName:xe.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:r,...Fe(i)})}};function xC(e,t){let n=_i(e),i=_i(t);if(e===t)return{valid:!0,data:e};if(n===re.object&&i===re.object){let r=Ye.objectKeys(t),s=Ye.objectKeys(e).filter(c=>r.indexOf(c)!==-1),a={...e,...t};Object.prototype.hasOwnProperty.call(a,"__proto__")&&delete a.__proto__;for(let c of s){if(c==="__proto__")continue;let u=xC(e[c],t[c]);if(!u.valid)return{valid:!1};a[c]=u.data}return{valid:!0,data:a}}else if(n===re.array&&i===re.array){if(e.length!==t.length)return{valid:!1};let r=[];for(let s=0;s<e.length;s++){let a=e[s],c=t[s],u=xC(a,c);if(!u.valid)return{valid:!1};r.push(u.data)}return{valid:!0,data:r}}else return n===re.date&&i===re.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}o(xC,"mergeValues");var Sa=class extends Ve{static{o(this,"ZodIntersection")}_parse(t){let{status:n,ctx:i}=this._processInputParams(t),r=o((s,a)=>{if(Hh(s)||Hh(a))return Ce;let c=xC(s.value,a.value);return c.valid?((Jh(s)||Jh(a))&&n.dirty(),{status:n.value,value:c.data}):(X(i,{code:G.invalid_intersection_types}),Ce)},"handleParsed");return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([s,a])=>r(s,a)):r(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}};Sa.create=(e,t,n)=>new Sa({left:e,right:t,typeName:xe.ZodIntersection,...Fe(n)});var Ni=class e extends Ve{static{o(this,"ZodTuple")}_parse(t){let{status:n,ctx:i}=this._processInputParams(t);if(i.parsedType!==re.array)return X(i,{code:G.invalid_type,expected:re.array,received:i.parsedType}),Ce;if(i.data.length<this._def.items.length)return X(i,{code:G.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ce;!this._def.rest&&i.data.length>this._def.items.length&&(X(i,{code:G.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let s=[...i.data].map((a,c)=>{let u=this._def.items[c]||this._def.rest;return u?u._parse(new Or(i,a,i.path,c)):null}).filter(a=>!!a);return i.common.async?Promise.all(s).then(a=>un.mergeArray(n,a)):un.mergeArray(n,s)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};Ni.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ni({items:e,typeName:xe.ZodTuple,rest:null,...Fe(t)})};var Wh=class e extends Ve{static{o(this,"ZodRecord")}get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:i}=this._processInputParams(t);if(i.parsedType!==re.object)return X(i,{code:G.invalid_type,expected:re.object,received:i.parsedType}),Ce;let r=[],s=this._def.keyType,a=this._def.valueType;for(let c in i.data)r.push({key:s._parse(new Or(i,c,i.path,c)),value:a._parse(new Or(i,i.data[c],i.path,c)),alwaysSet:c in i.data});return i.common.async?un.mergeObjectAsync(n,r):un.mergeObjectSync(n,r)}get element(){return this._def.valueType}static create(t,n,i){return n instanceof Ve?new e({keyType:t,valueType:n,typeName:xe.ZodRecord,...Fe(i)}):new e({keyType:io.create(),valueType:t,typeName:xe.ZodRecord,...Fe(n)})}},Cu=class extends Ve{static{o(this,"ZodMap")}get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:i}=this._processInputParams(t);if(i.parsedType!==re.map)return X(i,{code:G.invalid_type,expected:re.map,received:i.parsedType}),Ce;let r=this._def.keyType,s=this._def.valueType,a=[...i.data.entries()].map(([c,u],l)=>({key:r._parse(new Or(i,c,i.path,[l,"key"])),value:s._parse(new Or(i,u,i.path,[l,"value"]))}));if(i.common.async){let c=new Map;return Promise.resolve().then(async()=>{for(let u of a){let l=await u.key,p=await u.value;if(l.status==="aborted"||p.status==="aborted")return Ce;(l.status==="dirty"||p.status==="dirty")&&n.dirty(),c.set(l.value,p.value)}return{status:n.value,value:c}})}else{let c=new Map;for(let u of a){let l=u.key,p=u.value;if(l.status==="aborted"||p.status==="aborted")return Ce;(l.status==="dirty"||p.status==="dirty")&&n.dirty(),c.set(l.value,p.value)}return{status:n.value,value:c}}}};Cu.create=(e,t,n)=>new Cu({valueType:t,keyType:e,typeName:xe.ZodMap,...Fe(n)});var Su=class e extends Ve{static{o(this,"ZodSet")}_parse(t){let{status:n,ctx:i}=this._processInputParams(t);if(i.parsedType!==re.set)return X(i,{code:G.invalid_type,expected:re.set,received:i.parsedType}),Ce;let r=this._def;r.minSize!==null&&i.data.size<r.minSize.value&&(X(i,{code:G.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),n.dirty()),r.maxSize!==null&&i.data.size>r.maxSize.value&&(X(i,{code:G.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),n.dirty());let s=this._def.valueType;function a(u){let l=new Set;for(let p of u){if(p.status==="aborted")return Ce;p.status==="dirty"&&n.dirty(),l.add(p.value)}return{status:n.value,value:l}}o(a,"finalizeSet");let c=[...i.data.values()].map((u,l)=>s._parse(new Or(i,u,i.path,l)));return i.common.async?Promise.all(c).then(u=>a(u)):a(c)}min(t,n){return new e({...this._def,minSize:{value:t,message:de.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:de.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}};Su.create=(e,t)=>new Su({valueType:e,minSize:null,maxSize:null,typeName:xe.ZodSet,...Fe(t)});var Zh=class e extends Ve{static{o(this,"ZodFunction")}constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==re.function)return X(n,{code:G.invalid_type,expected:re.function,received:n.parsedType}),Ce;function i(c,u){return op({data:c,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Eu(),ps].filter(l=>!!l),issueData:{code:G.invalid_arguments,argumentsError:u}})}o(i,"makeArgsIssue");function r(c,u){return op({data:c,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Eu(),ps].filter(l=>!!l),issueData:{code:G.invalid_return_type,returnTypeError:u}})}o(r,"makeReturnsIssue");let s={errorMap:n.common.contextualErrorMap},a=n.data;if(this._def.returns instanceof oo){let c=this;return vn(async function(...u){let l=new Wn([]),p=await c._def.args.parseAsync(u,s).catch(h=>{throw l.addIssue(i(u,h)),l}),f=await Reflect.apply(a,this,p);return await c._def.returns._def.type.parseAsync(f,s).catch(h=>{throw l.addIssue(r(f,h)),l})})}else{let c=this;return vn(function(...u){let l=c._def.args.safeParse(u,s);if(!l.success)throw new Wn([i(u,l.error)]);let p=Reflect.apply(a,this,l.data),f=c._def.returns.safeParse(p,s);if(!f.success)throw new Wn([r(p,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:Ni.create(t).rest(gs.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,n,i){return new e({args:t||Ni.create([]).rest(gs.create()),returns:n||gs.create(),typeName:xe.ZodFunction,...Fe(i)})}},ka=class extends Ve{static{o(this,"ZodLazy")}get schema(){return this._def.getter()}_parse(t){let{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};ka.create=(e,t)=>new ka({getter:e,typeName:xe.ZodLazy,...Fe(t)});var Ba=class extends Ve{static{o(this,"ZodLiteral")}_parse(t){if(t.data!==this._def.value){let n=this._getOrReturnCtx(t);return X(n,{received:n.data,code:G.invalid_literal,expected:this._def.value}),Ce}return{status:"valid",value:t.data}}get value(){return this._def.value}};Ba.create=(e,t)=>new Ba({value:e,typeName:xe.ZodLiteral,...Fe(t)});function Yj(e,t){return new Ra({values:e,typeName:xe.ZodEnum,...Fe(t)})}o(Yj,"createZodEnum");var Ra=class e extends Ve{static{o(this,"ZodEnum")}_parse(t){if(typeof t.data!="string"){let n=this._getOrReturnCtx(t),i=this._def.values;return X(n,{expected:Ye.joinValues(i),received:n.parsedType,code:G.invalid_type}),Ce}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let n=this._getOrReturnCtx(t),i=this._def.values;return X(n,{received:n.data,code:G.invalid_enum_value,options:i}),Ce}return vn(t.data)}get options(){return this._def.values}get enum(){let t={};for(let n of this._def.values)t[n]=n;return t}get Values(){let t={};for(let n of this._def.values)t[n]=n;return t}get Enum(){let t={};for(let n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter(i=>!t.includes(i)),{...this._def,...n})}};Ra.create=Yj;var xa=class extends Ve{static{o(this,"ZodNativeEnum")}_parse(t){let n=Ye.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(t);if(i.parsedType!==re.string&&i.parsedType!==re.number){let r=Ye.objectValues(n);return X(i,{expected:Ye.joinValues(r),received:i.parsedType,code:G.invalid_type}),Ce}if(this._cache||(this._cache=new Set(Ye.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let r=Ye.objectValues(n);return X(i,{received:i.data,code:G.invalid_enum_value,options:r}),Ce}return vn(t.data)}get enum(){return this._def.values}};xa.create=(e,t)=>new xa({values:e,typeName:xe.ZodNativeEnum,...Fe(t)});var oo=class extends Ve{static{o(this,"ZodPromise")}unwrap(){return this._def.type}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==re.promise&&n.common.async===!1)return X(n,{code:G.invalid_type,expected:re.promise,received:n.parsedType}),Ce;let i=n.parsedType===re.promise?n.data:Promise.resolve(n.data);return vn(i.then(r=>this._def.type.parseAsync(r,{path:n.path,errorMap:n.common.contextualErrorMap})))}};oo.create=(e,t)=>new oo({type:e,typeName:xe.ZodPromise,...Fe(t)});var Mr=class extends Ve{static{o(this,"ZodEffects")}innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===xe.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:n,ctx:i}=this._processInputParams(t),r=this._def.effect||null,s={addIssue:o(a=>{X(i,a),a.fatal?n.abort():n.dirty()},"addIssue"),get path(){return i.path}};if(s.addIssue=s.addIssue.bind(s),r.type==="preprocess"){let a=r.transform(i.data,s);if(i.common.async)return Promise.resolve(a).then(async c=>{if(n.value==="aborted")return Ce;let u=await this._def.schema._parseAsync({data:c,path:i.path,parent:i});return u.status==="aborted"?Ce:u.status==="dirty"?ma(u.value):n.value==="dirty"?ma(u.value):u});{if(n.value==="aborted")return Ce;let c=this._def.schema._parseSync({data:a,path:i.path,parent:i});return c.status==="aborted"?Ce:c.status==="dirty"?ma(c.value):n.value==="dirty"?ma(c.value):c}}if(r.type==="refinement"){let a=o(c=>{let u=r.refinement(c,s);if(i.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c},"executeRefinement");if(i.common.async===!1){let c=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return c.status==="aborted"?Ce:(c.status==="dirty"&&n.dirty(),a(c.value),{status:n.value,value:c.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(c=>c.status==="aborted"?Ce:(c.status==="dirty"&&n.dirty(),a(c.value).then(()=>({status:n.value,value:c.value}))))}if(r.type==="transform")if(i.common.async===!1){let a=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!ro(a))return Ce;let c=r.transform(a.value,s);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:c}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(a=>ro(a)?Promise.resolve(r.transform(a.value,s)).then(c=>({status:n.value,value:c})):Ce);Ye.assertNever(r)}};Mr.create=(e,t,n)=>new Mr({schema:e,typeName:xe.ZodEffects,effect:t,...Fe(n)});Mr.createWithPreprocess=(e,t,n)=>new Mr({schema:t,effect:{type:"preprocess",transform:e},typeName:xe.ZodEffects,...Fe(n)});var Fr=class extends Ve{static{o(this,"ZodOptional")}_parse(t){return this._getType(t)===re.undefined?vn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Fr.create=(e,t)=>new Fr({innerType:e,typeName:xe.ZodOptional,...Fe(t)});var Pi=class extends Ve{static{o(this,"ZodNullable")}_parse(t){return this._getType(t)===re.null?vn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Pi.create=(e,t)=>new Pi({innerType:e,typeName:xe.ZodNullable,...Fe(t)});var Qa=class extends Ve{static{o(this,"ZodDefault")}_parse(t){let{ctx:n}=this._processInputParams(t),i=n.data;return n.parsedType===re.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};Qa.create=(e,t)=>new Qa({innerType:e,typeName:xe.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Fe(t)});var $a=class extends Ve{static{o(this,"ZodCatch")}_parse(t){let{ctx:n}=this._processInputParams(t),i={...n,common:{...n.common,issues:[]}},r=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return bu(r)?r.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Wn(i.common.issues)},input:i.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new Wn(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}};$a.create=(e,t)=>new $a({innerType:e,typeName:xe.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Fe(t)});var ku=class extends Ve{static{o(this,"ZodNaN")}_parse(t){if(this._getType(t)!==re.nan){let i=this._getOrReturnCtx(t);return X(i,{code:G.invalid_type,expected:re.nan,received:i.parsedType}),Ce}return{status:"valid",value:t.data}}};ku.create=e=>new ku({typeName:xe.ZodNaN,...Fe(e)});var yse=Symbol("zod_brand"),ap=class extends Ve{static{o(this,"ZodBranded")}_parse(t){let{ctx:n}=this._processInputParams(t),i=n.data;return this._def.type._parse({data:i,path:n.path,parent:n})}unwrap(){return this._def.type}},cp=class e extends Ve{static{o(this,"ZodPipeline")}_parse(t){let{status:n,ctx:i}=this._processInputParams(t);if(i.common.async)return o(async()=>{let s=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return s.status==="aborted"?Ce:s.status==="dirty"?(n.dirty(),ma(s.value)):this._def.out._parseAsync({data:s.value,path:i.path,parent:i})},"handleAsync")();{let r=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return r.status==="aborted"?Ce:r.status==="dirty"?(n.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:i.path,parent:i})}}static create(t,n){return new e({in:t,out:n,typeName:xe.ZodPipeline})}},Ta=class extends Ve{static{o(this,"ZodReadonly")}_parse(t){let n=this._def.innerType._parse(t),i=o(r=>(ro(r)&&(r.value=Object.freeze(r.value)),r),"freeze");return bu(n)?n.then(r=>i(r)):i(n)}unwrap(){return this._def.innerType}};Ta.create=(e,t)=>new Ta({innerType:e,typeName:xe.ZodReadonly,...Fe(t)});function zj(e,t){let n=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof n=="string"?{message:n}:n}o(zj,"cleanParams");function Wj(e,t={},n){return e?so.create().superRefine((i,r)=>{let s=e(i);if(s instanceof Promise)return s.then(a=>{if(!a){let c=zj(t,i),u=c.fatal??n??!0;r.addIssue({code:"custom",...c,fatal:u})}});if(!s){let a=zj(t,i),c=a.fatal??n??!0;r.addIssue({code:"custom",...a,fatal:c})}}):so.create()}o(Wj,"custom");var Ese={object:Zn.lazycreate},xe;(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"})(xe||(xe={}));var bse=o((e,t={message:`Input not instance of ${e.name}`})=>Wj(n=>n instanceof e,t),"instanceOfType"),Zj=io.create,Kj=ya.create,vse=ku.create,Ise=Ea.create,Xj=ba.create,wse=va.create,Cse=Iu.create,Sse=Ia.create,kse=wa.create,Bse=so.create,Rse=gs.create,xse=li.create,Qse=wu.create,$se=As.create,Tse=Zn.create,Dse=Zn.strictCreate,_se=Ca.create,Nse=Yh.create,Pse=Sa.create,Use=Ni.create,Fse=Wh.create,Ose=Cu.create,Mse=Su.create,Lse=Zh.create,jse=ka.create,Gse=Ba.create,Vse=Ra.create,zse=xa.create,qse=oo.create,Hse=Mr.create,Jse=Fr.create,Yse=Pi.create,Wse=Mr.createWithPreprocess,Zse=cp.create,Kse=o(()=>Zj().optional(),"ostring"),Xse=o(()=>Kj().optional(),"onumber"),eoe=o(()=>Xj().optional(),"oboolean"),toe={string:o((e=>io.create({...e,coerce:!0})),"string"),number:o((e=>ya.create({...e,coerce:!0})),"number"),boolean:o((e=>ba.create({...e,coerce:!0})),"boolean"),bigint:o((e=>Ea.create({...e,coerce:!0})),"bigint"),date:o((e=>va.create({...e,coerce:!0})),"date")};var noe=Ce;var up=(r=>(r.ModelProvider="model_provider",r.SutAccess="sut_access",r.Skyramp="skyramp",r.Other="other",r))(up||{}),QC=(i=>(i.Ready="ready",i.Blocked="blocked",i.NeedsInputs="needs_inputs",i))(QC||{});var Kh=300,dt=d.string().trim().min(1),roe=d.object({action:d.enum(["start","run","wait"]),text:dt,source:d.enum(["file","notes","testbot"]).describe("file: a file in the repository; notes: the Target's notes; testbot: Testbot's own finding"),file:dt.nullable().describe("the file the step came from, relative to the component's repository; null unless source is file")}).strict().refine(e=>e.source==="file"==(e.file!==null),{path:["file"],message:"a file exactly when the step came from one"}),lp=/^[A-Za-z_][A-Za-z0-9_]*$/,Kn=/^(?!GITHUB_)(?!SKYRAMP_RUNNER_)[A-Z][A-Z0-9_]{0,99}$/,Bu=(a=>(a.VersionEndpoint="version_endpoint",a.DeployWorkflow="deploy_workflow",a.KubernetesLabels="kubernetes_labels",a.Command="command",a.Api="api",a.NotTracked="not_tracked",a))(Bu||{}),Ui="shared",ioe=dt.refine(e=>{try{let t=new URL(e);return["http:","https:"].includes(t.protocol)&&!t.username&&!t.password}catch{return!1}},"an http(s) URL with no login in it"),Ru=d.object({address:ioe,readyWhen:dt.nullable(),credentials:d.array(d.string().regex(Kn)).max(50),revisionSources:d.array(d.object({method:d.nativeEnum(Bu),detail:dt.describe("what Testbot reads, such as GET /version or the deploy workflow's name; for not_tracked, why nothing shows it"),components:d.array(dt).min(1).describe("the components it tells the revision of, by name")}).strict()).max(50)}).strict(),$C={steps:d.array(roe).max(20).optional().describe("how it starts, in order"),kind:d.enum(["web_app","service","database","external_service"]).optional(),from:d.object({file:dt,service:dt.nullable()}).strict().optional(),credentials:d.array(d.string().max(100).regex(lp)).max(50).optional().describe("the Target's credentials this component's recipe uses: a sign-in (a test user, password or token) or an API key, which the workflow supplies from a GitHub Actions secret as the environment variable of the credential's name; give each name exactly as the recipe reads it. Names only, never a value, and not a secret the recipe generates itself")},TC=d.object({name:dt,repository:dt.describe("owner/repo of the Target repository the component is built or started from, such as the one whose compose file starts its database"),healthy:d.boolean(),...$C,deployed:dt.nullable().optional().describe('only with "environment": the revision the component runs, as you read it from its revision source, or null when you could not tell')}),soe=d.object({name:d.string().regex(Kn).describe("the credential's environment variable name, as the recipe reads it and the credentials event names it"),purpose:d.enum(["sut_access","other"]).describe("sut_access: it signs in to or calls the SUT or a service it needs; other: anything else"),required:d.boolean().describe("false only when the SUT starts without it, with less working"),how:dt.max(Kh).describe('one short sentence: what the value is and where a person gets it, such as "A Mattermost Enterprise licence key, from the customer portal"; never a value')}),DC=d.object({name:dt.describe("the credential's environment variable name, as listed above; never its value"),component:dt.describe("the component that refused it"),status:d.number().int().min(400).max(599).optional().describe("the HTTP status it got, such as 401 or 403; leave it out when the refusal was not an HTTP answer"),evidence:dt.describe("the request or command you tested it with and what came back, never the value")}),ooe=400,e1=o((e,t)=>dt.max(ooe).optional().describe(`one or two plain sentences: ${e}, such as "${t}"; never the value`),"credentialExplanation"),aoe=DC.extend({name:d.string().regex(Kn).describe("the credential's environment variable name, as the SUT input lists it; never its value"),explanation:e1("what the component did with the value and why it is wrong","The app checks the licence key at startup and exits: the value this run has does not match the licence it expects.")}),coe=d.object({name:d.string().regex(Kn).describe("the credential's environment variable name, as the SUT input lists it"),component:dt.describe("the component that cannot come up or work without it"),evidence:dt.describe("the command you ran and what came back that shows it needs a value, never a value"),explanation:e1("what the component needs the value for and what it does without one","The app reads the licence key at startup and exits when it is empty.")}),uoe=d.object({component:dt,problem:dt,evidence:dt.describe("the exact command and output that shows it"),fix:dt.describe("what the user must provide, and where")}),loe=d.object({framework:dt,file:dt.describe("the test file run, relative to its repository root"),result:d.enum(["pass","fail","error"])}),doe=d.object({input:dt.describe("the part of the user's SUT input, as given"),reason:dt}),sRe=d.object({schemaVersion:d.literal(1),status:d.nativeEnum(QC).describe("ready only if every component came up healthy and the recipe is written; needs_inputs when the recipe is written but a component cannot start without a credential this run has no value for"),components:d.array(TC),suites:d.array(loe).default([]).describe("one run per test suite the Target's repositories have; empty when they have none"),inputsUsed:d.array(dt).default([]).describe("the parts of the user's SUT input the recipe used as given"),inputsUsedHow:d.array(d.object({input:dt.describe("exactly as written in inputsUsed; an entry that is not there is left out"),how:dt.describe("what the recipe did with it")})).optional(),inputsNotUsed:d.array(doe).default([]).describe("the parts it did not use, and why. A part that is wrong goes here, with what was wrong, even when the recipe does something like it instead: one the repositories or the app show is wrong, such as a file, command, port, route or setting that is not there. Something outside them that does not answer is not one: that is a blocker"),blockers:d.array(uoe).describe("required (non-empty) when status is blocked, unless credentialsRefused or credentialsWithoutValue says why; never one for a credential either of them names"),inputs:d.array(soe).max(50).optional().describe("required (non-empty) when status is needs_inputs, else left out: each credential the candidate recipe needs a value for"),credentialsRefused:d.array(aoe).max(50).optional().describe("only with status blocked: each credential the SUT input lists that the SUT still refused after a person confirmed it, or when no other credential worked. Testbot writes its blocker"),credentialsWithoutValue:d.array(coe).max(50).optional().describe("only with status blocked: each credential the SUT input lists as empty in this run that a component cannot come up or work without. Testbot writes its blocker"),environment:Ru.optional().describe("only when the whole SUT is an existing deployment you tested where it runs, building and starting nothing: its address, what says it is ready, the credentials that reach it, and how to read what each component runs. Leave it out when any part was built or started on the runner, or reaching it needed something there (a tunnel, port-forward or proxy; a client certificate is named in .skyramp/sut/client-cert.json instead)")});var _C=64*1024,NC=512*1024,t1=/[\u0000-\u0008\u000b\u000e-\u001f\u007f]|[\ud800-\udbff](?![\udc00-\udfff])|(?<![\ud800-\udbff])[\udc00-\udfff]/;var Fi=(r=>(r.Clean="clean",r.RecipeDrift="recipe-drift",r.ChangeBrokeBringup="change-broke-bringup",r.BringupFailed="bringup-failed",r))(Fi||{}),ao=d.string().trim().min(1),poe=d.object({url:d.string().optional().describe("the URL probed, if the check is an HTTP request"),command:d.string().optional().describe("the command run, if the check is a script \u2014 preferred when auth is needed"),headers:d.record(d.string()).optional(),status:d.union([d.number(),d.string()]).optional().describe("expected HTTP status for a url check (default 200)"),output:ao.describe("what the check returned, VERBATIM \u2014 the bytes, nothing appended; this gate RE-RUNS the check")}),PC=d.array(d.object({component:ao.describe("a shared component listed above"),url:ao.describe("the URL on the component's own origin (scheme, host and port) that answers with its deployed commit"),output:ao.describe("what the URL returned, VERBATIM; this gate FETCHES each url")})).describe("only when shared components are listed above: one check per component whose deployed commit you found"),n1=d.object({schemaVersion:d.literal(1),baseUrls:d.record(d.string()).optional().describe("service \u2192 base URL of the running app; omit on a failed bring-up, never invent one"),health:poe.optional(),teardown:ao.describe("command that tears the SUT down"),dependencies:d.record(d.boolean()).optional().describe("EVERY backing service: true = really deployed, false = mocked; REQUIRED when the app came up"),outcome:d.nativeEnum(Fi).describe("clean | recipe-drift (you corrected the recipe) | change-broke-bringup (the PR broke it) | bringup-failed (environment, not the PR)"),recipeFixes:d.array(d.string()).optional().describe("required when outcome is recipe-drift: what was corrected"),bringupError:d.object({command:ao,output:ao}).optional().describe("required when bring-up failed: the exact failing command and what it printed"),suspectFiles:d.array(d.string()).optional().describe("required for change-broke-bringup: files THIS PR changed that the failure points at, relative to your working directory (a file in another checkout of the run: its absolute path)"),seeded:d.boolean(),startedAt:ao.describe("ISO timestamp"),revisions:PC.optional(),missingSecrets:d.array(d.string().regex(lp)).optional().describe("bringup-failed only: each secret the app cannot start without that this run has no value for, by its environment variable name; never a value"),credentialsRefused:d.array(DC).optional().describe("only for credentials the prompt lists to test: each that was refused when you tested it, such as with a 401 or 403; leave it out when none was, or when none is listed"),recipeRecorded:d.boolean().optional().describe("[derived] whether the checkout had a recorded recipe before bring-up")});var T1=require("node:crypto");var Da=(s=>(s.NotFound="not_found",s.NoAccess="no_access",s.Unavailable="unavailable",s.AccessLost="access_lost",s.CannotOpen="cannot_open",s))(Da||{});var UC=o(e=>`${e.source}:${e.site??""}:${e.key}`,"requirementItemId");var dp=/^pasted-[0-9a-f]{16}$/,hs=/^file-[0-9a-f]{16}$/,pp=(r=>(r.Pdf="application/pdf",r.Csv="text/csv",r.Docx="application/vnd.openxmlformats-officedocument.wordprocessingml.document",r.Xlsx="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",r))(pp||{}),_a=o(e=>e.trim().toUpperCase(),"normalKey"),r1=o((e,t)=>{let n=e.trim();return dp.test(n.toLowerCase())?"Pasted text":hs.test(n.toLowerCase())?t?.get(_a(n))??"Uploaded document":/^\d+$/.test(n)?`Confluence page ${n}`:n.toUpperCase()},"itemName");var Xh=(i=>(i.New="new",i.Updated="updated",i.Existing="existing",i))(Xh||{}),Oi=(i=>(i.Sufficient="sufficient",i.Insufficient="insufficient",i.NoChange="no_change",i))(Oi||{}),xu=(v=>(v.RelatedChangeConflict="related_change_conflict",v.ReferenceOutsideTarget="reference_outside_target",v.SourceAccessLost="source_access_lost",v.ConfigurationIncomplete="configuration_incomplete",v.CredentialUnavailable="credential_unavailable",v.WorkflowBindingUnverified="workflow_binding_unverified",v.WorkflowRefUnprotected="workflow_ref_unprotected",v.BedrockWorkflowRequired="bedrock_workflow_required",v.DeploymentReview="deployment_review",v.SutRevisionMismatch="sut_revision_mismatch",v.IsolationUnavailable="isolation_unavailable",v.EvidenceInsufficient="evidence_insufficient",v.ConfigurationUnresolved="configuration_unresolved",v.ModelProviderDenied="model_provider_denied",v.ModelProviderUnavailable="model_provider_unavailable",v.RunnerProviderNotReady="runner_provider_not_ready",v.MergeConflict="merge_conflict",v))(xu||{}),co=(s=>(s.CiCheck="ci_check",s.TestReport="test_report",s.StaticAnalysis="static_analysis",s.CodeReview="code_review",s.Other="other",s))(co||{}),fp=(i=>(i.Application="application",i.Environment="environment",i.TestDefect="test_defect",i))(fp||{}),gp=(c=>(c.AuthToken="auth_token",c.Secret="secret",c.DataConnection="data_connection",c.AppNotStarted="app_not_started",c.Login="login",c.ExternalDependency="external_dependency",c.RecordingReplay="recording_replay",c))(gp||{});var em=(n=>(n.Probe="probe",n.Agent="agent",n))(em||{}),Ap=(i=>(i.Seed="seed",i.RuntimeMock="runtime_mock",i.EnvOverride="env_override",i))(Ap||{}),tm=(i=>(i.TestCode="test_code",i.SkyrampMocker="skyramp_mocker",i.RecipeOverride="recipe_override",i))(tm||{});function nm(e){return e==="failed"?2:e==="unknown"?1:0}o(nm,"cleanupShortfall");var hp=(n=>(n.Skyramp="skyramp",n.Llm="llm",n))(hp||{}),Mi=d.string().trim().min(1),foe=d.object({case:Mi.describe("recommend id this assertion enforces"),evidence:Mi.describe("the exact assertion line from the file that checks that case's observable")});var i1=d.object({route:d.literal("persistence"),url:d.string().url()}).strict(),mp=d.object({kind:d.nativeEnum(Ap).describe("seed: data the test creates in the app; runtime_mock: a mock on a Skyramp worker, which other tests reach too; env_override: an env value the app runs with. A stub inside the test's own process, such as a browser page's route, is none of these"),target:Mi.describe("the dependency, endpoint or data it affects"),mechanism:d.nativeEnum(tm).describe("test_code: the test applies and undoes it; skyramp_mocker: a mock the test applies on a Skyramp worker; recipe_override: the mocker cannot reach the dependency (its URL is fixed in the build)"),detail:Mi.describe("what it sets up"),worker:Mi.optional().describe("skyramp_mocker: host:port of the worker the test applies the mock to (default localhost:35142)"),safety:i1.optional().describe("shared seed that keeps its data only because the environment permits it: the persistence route and the exact endpoint; Testbot checks the current permission just before it runs the test"),cleanup:Mi.optional().describe("seed: when its data can be removed, a command that removes it if the test does not; otherwise declare leftBehind instead. Run as written and without a shell: give real values, not a placeholder such as <id>, single-quote an argument that holds shell syntax, or put the logic in a script in the repository and run that"),leftBehind:Mi.optional().describe("seed: the records the test creates and cannot remove from the app, and how to find them")}).refine(e=>!e.leftBehind||e.kind==="seed",{message:"leftBehind is for a seed only: a runtime mock or an env override creates no records",path:["leftBehind"]}),goe=d.object({file:Mi.describe("staged path under .skyramp/staged/"),source:d.nativeEnum(hp),language:Mi,covers:d.array(d.string()).min(1,"must be a non-empty array of recommend ids").describe("recommend ids this test covers"),assertions:d.array(foe).min(1,"must be a non-empty array").describe("one per case covered, citing the real line"),context:d.array(mp).optional().describe("what the test sets up against the running app, in order: data it seeds, Skyramp mocks it applies, env overrides; omit when none")}),FC=d.object({schemaVersion:d.literal(1),tests:d.array(goe),deferredUi:d.array(d.string()).describe("recommend ui ids left for the UI stage (generate) \u2014 [] for generate-ui"),summary:Mi.describe("one paragraph")});var ms=(a=>(a.Place="place",a.Update="update",a.Regenerate="regenerate",a.Delete="delete",a.Verify="verify",a.None="none",a))(ms||{}),Tn=(i=>(i.Pass="pass",i.Fail="fail",i.Skip="skip",i))(Tn||{}),$n=d.string().trim().min(1),OC=(r=>(r.Setup="setup",r.Expectation="expectation",r.Locator="locator",r.Other="other",r))(OC||{}),rm=d.object({kind:d.nativeEnum(OC),reason:$n.describe("what in the test is wrong, with the evidence: the setup error it raised, or the requirement or changed line its expectation contradicts")}),yp=d.array(d.string().url().max(2048).regex(/^https?:\/\//i)).max(50),s1=d.object({case:$n.describe("a covers id \u2014 the recommend case this test realizes"),status:d.nativeEnum(Tn),runtimeTargets:yp.optional().describe("HTTP(S) URLs this case actually exercised in its current run; omit for in-process or mocked checks, never infer from test type"),environmentRestriction:$n.optional().describe("for a skipped case: what this run lacks to execute it; the test is still written"),fromJourney:d.boolean().optional(),testProblem:rm.optional().describe("[derived] write's reading of a failing case: the test, not the app, is at fault"),defect:d.boolean().optional().describe("[derived] write's reading of a failing case: true when the app is wrong and the test is right"),failure:d.string().optional().describe("[derived] for a failing case: the runner's failure for it, as printed")}).refine(e=>!e.environmentRestriction||e.status==="skip"&&!e.runtimeTargets?.length,{message:"an environment-restricted case must be skipped and have no runtimeTargets"}),o1=d.object({started:d.boolean().optional().describe("with exit null: true if the test command started (it was interrupted or timed out), false if it never started. Left out, Testbot counts it as possibly started, with its cleanup unknown"),exit:d.number({invalid_type_error:"must be a number or null"}).nullable().describe("process exit of the re-run; null when no SUT was available"),details:d.string().optional().describe("what failed, or why a file was not run \u2014 required on any non-zero exit"),tests:d.array(s1).optional().describe("ONE ENTRY PER CASE the file covers, its own result; must agree with exit (0 \u2192 no fail; non-zero \u2192 at least one, or the non-test reason in details). The report reads the file by these where they are given")}),a1=d.object({context:d.array(mp).optional().describe("[derived] setup declarations retained for every executed test, including maintained tests"),from:d.string().optional().describe("staged path \u2014 required for placements"),file:$n.describe("final path relative to its repository, inside that checkout, with a source-file extension"),repository:$n.optional().describe("owner/repo the file lives in, when the run has several checkouts; omit for the working checkout"),action:d.nativeEnum(ms),covers:d.array(d.string()).optional().describe("recommend ids a placed test covers"),repro:d.boolean().optional().describe("this test is MEANT to fail \u2014 it reproduces a reported bug"),finding:d.boolean().optional().describe("a non-repro test that failed on a REAL product bug"),placementBroken:d.boolean().optional().describe('placement/harness problem one repair could not fix \u2014 every reran.tests entry is then "skip"'),keptReason:$n.optional().describe("why a planned delete/regenerate was declined and the file kept"),isolatedRun:$n.optional().describe('only for a test marked "runs alone": the command, from its checkout root and without a shell, that runs only this file and writes its JUnit XML into $SKYRAMP_RESULTS_DIR (named by its path: no shell expands it) \u2014 the harness runs it, so leave reran.exit null'),reran:o1,assertionCount:d.number().int().nonnegative().optional().describe("[derived] assertions reachable from the file, counted at write time"),addedOnly:d.boolean().optional().describe("[derived] an existing test file the run only added to: every line it had is still there"),added:d.array($n).optional().describe("[derived] the cases of the test functions the run added to an existing file: functions it did not have"),staleOnBase:d.boolean().optional().describe("[derived] an existing test that fails the same way on the base branch: its failure is the test's own")}).refine(e=>e.action!=="place"||typeof e.from=="string"&&e.from.trim().length>0,{message:'is a place but has no "from" staged path',path:[]}),c1=(n=>(n.Junit="junit",n.Converter="converter",n))(c1||{}),Aoe=$n.optional().describe("the items[].file this test is in \u2014 needed only when two of this suite's files cover the same case id"),hoe=d.object({results:$n.describe("the JUnit XML file this run wrote, a plain file name inside $SKYRAMP_RESULTS_DIR (e.g. backend.xml)"),source:d.nativeEnum(c1),run:$n.describe("the command you ran that wrote it, exactly as you ran it (with any converter)"),files:d.array($n).min(1).describe("the items[].file paths this run covered"),cases:d.array(d.object({test:$n.describe("the test's name as the runner reports it, qualified by its class or file (e.g. tests/test_a.py::test_x) when the bare name repeats"),case:$n.describe("the covers id it realizes"),file:Aoe})).describe("map each reported test name to the case it covers")}),moe=d.object({suites:d.array(hoe).min(1)}),MC=d.object({schemaVersion:d.literal(1),items:d.array(a1),runnerResults:moe.optional().describe("the JUnit XML your test runs wrote into $SKYRAMP_RESULTS_DIR, so the harness reads each test's result from the runner \u2014 omit only when no SUT is available"),ignored:d.array(d.string()).describe("existing tests assessed and deliberately left untouched"),summary:$n.describe("one paragraph")});mu();SC();function u1(e){return e.toUpperCase().replace(/[^A-Z0-9]+/g,"_").replace(/^_+|_+$/g,"")}o(u1,"credentialKeyFromRole");var l1=ee(require("path"));var nn=d.string().trim().min(1),im=nn,LC=(n=>(n.TestbotManaged="testbot_managed",n.CustomerDeployed="customer_deployed",n))(LC||{}),jC=[".skyramp/sut/setup.sh",".skyramp/sut/teardown.sh"],d1=(n=>(n.Refused="refused",n.NoValue="no_value",n))(d1||{}),yoe=d.object({name:d.string().regex(Kn),kind:d.nativeEnum(d1),explanation:nn.optional()}).strict(),p1=d.object({schemaVersion:d.literal(1),type:d.nativeEnum(LC).optional(),repository:im.optional().describe("namespace/name of the source whose checkout the recipe was written and proven in (SKYR-5380); a run replays it from there. Never on a customer_deployed plan"),status:d.enum(["ready","blocked"]),environment:Ru.optional(),components:d.array(d.object({name:nn,repository:nn.describe(`owner/repo, or "${Ui}" for a customer-deployed component no repository builds`),healthy:d.boolean(),url:d.string().min(1).nullable(),...$C,credentials:d.array(d.string().regex(Kn)).max(50).optional(),deployed:nn.nullable().optional().describe("customer_deployed only: the revision the component runs, as setup read it (WF-SETUP-22's Deployed now), or null when it could not tell")}).strict()),suites:d.array(d.object({framework:nn,file:nn,result:d.enum(["pass","fail","error"])}).strict()),inputsUsed:d.array(nn),inputsUsedHow:d.array(d.object({input:nn,how:nn}).strict()).optional(),inputsNotUsed:d.array(d.object({input:nn,reason:nn}).strict()),blockers:d.array(d.object({component:nn,problem:nn,evidence:nn,fix:nn,credential:yoe.optional()}).strict()),replay:d.object({outcome:nn,durationSeconds:d.number().nonnegative().nullable()}).strict().nullable(),files:d.array(d.object({path:nn,content:d.string()}).strict())}).strict().superRefine((e,t)=>{e.inputsUsedHow?.forEach((r,s)=>{e.inputsUsed.includes(r.input)||t.addIssue({code:d.ZodIssueCode.custom,path:["inputsUsedHow",s,"input"],message:"not one of inputsUsed"})}),e.components.forEach((r,s)=>{r.credentials&&new Set(r.credentials).size!==r.credentials.length&&t.addIssue({code:d.ZodIssueCode.custom,path:["components",s,"credentials"],message:"names a credential twice"})});let n=e.type==="customer_deployed";n!==(e.environment!==void 0)&&t.addIssue({code:d.ZodIssueCode.custom,path:["environment"],message:"an environment exactly when the plan's type is customer_deployed"}),n&&e.repository!==void 0&&t.addIssue({code:d.ZodIssueCode.custom,path:["repository"],message:"a customer_deployed plan names no repository"}),e.environment&&new Set(e.environment.credentials).size!==e.environment.credentials.length&&t.addIssue({code:d.ZodIssueCode.custom,path:["environment","credentials"],message:"names a credential twice"});let i=new Set(e.components.map(r=>r.name));if(e.environment?.revisionSources.forEach((r,s)=>{r.components.forEach((a,c)=>{i.has(a)||t.addIssue({code:d.ZodIssueCode.custom,path:["environment","revisionSources",s,"components",c],message:"not one of components"})})}),e.components.forEach((r,s)=>{r.deployed!==void 0!==n&&t.addIssue({code:d.ZodIssueCode.custom,path:["components",s,"deployed"],message:"what a component runs exactly when the plan is customer_deployed"}),r.repository===Ui&&!n&&t.addIssue({code:d.ZodIssueCode.custom,path:["components",s,"repository"],message:`only a customer_deployed component is ${Ui}`})}),n&&(e.components.forEach((r,s)=>{e.components.findIndex(a=>a.name===r.name)!==s&&t.addIssue({code:d.ZodIssueCode.custom,path:["components",s,"name"],message:"names a component twice"})}),e.replay!==null&&t.addIssue({code:d.ZodIssueCode.custom,path:["replay"],message:"a customer_deployed plan is never replayed"}),e.files.forEach((r,s)=>{jC.includes(r.path)&&t.addIssue({code:d.ZodIssueCode.custom,path:["files",s,"path"],message:"a customer_deployed plan has no script that starts or stops the system"})})),n&&e.status==="ready"){let r=new Set(e.environment?.revisionSources.flatMap(s=>s.components));e.components.forEach((s,a)=>{s.repository!==Ui&&!r.has(s.name)&&t.addIssue({code:d.ZodIssueCode.custom,path:["components",a,"name"],message:"a ready customer_deployed plan reads what every component a repository builds runs"})})}});var $Re=["clean","recipe-drift"];function Ep(e){let t=l1.posix.normalize(e);return t===e&&(t===".skyramp/workspace.yml"||t.startsWith(".skyramp/sut/")&&t.length>13)}o(Ep,"isRuntimePlanFile");var bp=d.string().uuid(),vp=d.object({environmentId:d.string().uuid(),allowed:d.boolean(),revision:bp,updatedAt:d.string().datetime(),updatedBy:d.string().uuid()}).strict();var Ip=(a=>(a.NoEnvironment="no_environment",a.NoRecordedGrant="no_recorded_grant",a.Unavailable="unavailable",a.Changed="changed",a.Denied="denied",a.OutOfScope="out_of_scope",a))(Ip||{});function wp(e){switch(e){case"no_environment":return"the run has no selected Test Environment address";case"no_recorded_grant":return"the run's configuration did not record permission to keep test data in this environment";case"unavailable":return"the current permission to keep test data could not be read";case"changed":return"the permission to keep test data changed after the run started";case"denied":return"the environment does not permit test data to stay";case"out_of_scope":return"the request is outside the environment's address"}}o(wp,"persistenceRefusalText");function sm(e,t,n){let i=vp.safeParse(t);return!i.success||!i.data.allowed||!e.environmentId||i.data.environmentId!==e.environmentId||!e.environmentAddress||e.persistentDataPolicy&&e.persistentDataPolicy.revision!==i.data.revision?!1:uo(e.environmentAddress,n)}o(sm,"persistentDataPolicyApplies");function uo(e,t){try{let n=new URL(t),i=new URL(e);if(i.search||i.hash)return!1;let r=/%(?:2f|5c|2e|25)/i;if(t.includes("\\")||e.includes("\\")||r.test(n.pathname)||r.test(i.pathname))return!1;let s=i.pathname.replace(/\/$/,"");return["https:","http:"].includes(i.protocol)&&n.origin===i.origin&&(n.pathname===s||n.pathname.startsWith(`${s}/`))}catch{return!1}}o(uo,"environmentContainsUrl");var GC="delivery-persistence.json",f1=d.object({environmentId:d.string().uuid(),environmentAddress:d.string().url(),revision:bp}).strict(),g1=d.object({refusal:d.nativeEnum(Ip)}).strict();var D1=d.unknown().optional(),_1={handshake:"/api/v1/runner/runs/:runId/attempts",report:"/api/v1/runner/attempts/:attemptId/report",end:"/api/v1/runner/attempts/:attemptId/end",configuration:"/api/v1/runner/attempts/:attemptId/configuration",progress:"/api/v1/runner/attempts/:attemptId/progress",sutRecipe:"/api/v1/runner/attempts/:attemptId/sut-recipe",runtimePlan:"/api/v1/runner/attempts/:attemptId/runtime-plan",persistentDataPolicy:"/api/v1/runner/attempts/:attemptId/persistent-data-policy",heartbeat:"/api/v1/runner/attempts/:attemptId/heartbeat",setupEvents:"/api/v1/runner/attempts/:attemptId/setup-events",runEvents:"/api/v1/runner/attempts/:attemptId/run-events",requirements:"/api/v1/runner/attempts/:attemptId/requirements",requirementFile:"/api/v1/runner/attempts/:attemptId/requirements/:key/file",deployedRevisions:"/api/v1/runner/attempts/:attemptId/deployed-revisions"},Pa=(n=>(n.GitHub="github",n.AzureDevOps="azure-devops",n))(Pa||{}),dm=(s=>(s.Trigger="TRIGGER",s.Baseline="BASELINE",s.AuthoritativeRelatedChange="AUTHORITATIVE_RELATED_CHANGE",s.ConfiguredSharedDependency="CONFIGURED_SHARED_DEPENDENCY",s.ManualOverride="MANUAL_OVERRIDE",s))(dm||{}),pm=(a=>(a.PullRequest="pull_request",a.ReadyForReview="ready_for_review",a.Schedule="schedule",a.Manual="manual",a.SutSetup="sut_setup",a.RevisionRead="revision_read",a))(pm||{}),Eoe=["sut_setup"],boe=["sut_setup","schedule","revision_read"],voe=["sut_setup"],HC=(t=>(t.PullRequest="pull_request",t))(HC||{}),JC=(n=>(n.PullRequest="pull_request",n.Branch="branch",n))(JC||{}),A1=["TRIGGER","AUTHORITATIVE_RELATED_CHANGE","MANUAL_OVERRIDE"];var fm=(r=>(r.None="none",r.Delivered="delivered",r.Partial="partial",r.Failed="failed",r))(fm||{}),kp=(s=>(s.ReportUploaded="report_uploaded",s.NoReport="no_report",s.Cancelled="cancelled",s.RecipeUploaded="recipe_uploaded",s.RevisionsUploaded="revisions_uploaded",s))(kp||{}),N1=(n=>(n.Running="running",n.Ended="ended",n))(N1||{}),Bp=(A=>(A.TimedOut="timed_out",A.AgentFailed="agent_failed",A.SetupFailed="setup_failed",A.CredentialMissing="credential_missing",A.RunnerLost="runner_lost",A.CheckoutFailed="checkout_failed",A.EnvironmentUnverified="environment_unverified",A.ModelProviderDenied="model_provider_denied",A.ModelProviderUnavailable="model_provider_unavailable",A.RunnerProviderNotReady="runner_provider_not_ready",A.MergeConflict="merge_conflict",A.EnvironmentUnavailable="environment_unavailable",A))(Bp||{}),P1=(i=>(i.Onboard="onboard",i.Deploy="deploy",i.Recheck="recheck",i))(P1||{}),YC=(n=>(n.Started="started",n.Finished="finished",n))(YC||{}),U1=(i=>(i.Passed="passed",i.Failed="failed",i.Skipped="skipped",i))(U1||{});var F1=(i=>(i.ChooseCredential="choose_credential",i.FreeText="free_text",i.ChooseSource="choose_source",i))(F1||{});var O1=(r=>(r.Answered="answered",r.Followed="followed",r.NotFollowed="not_followed",r.TooLate="too_late",r))(O1||{}),WC=(i=>(i.Discover="discover",i.Start="start",i.Check="check",i))(WC||{}),VC=(r=>(r.ValidationPlan="validation_plan",r.TestEnvironment="test_environment",r.TestConditions="test_conditions",r.Tests="tests",r))(VC||{});var ZC=(r=>(r.Found="found",r.Starting="starting",r.Up="up",r.OutOfScope="out_of_scope",r))(ZC||{}),Lr=d.string().regex(/^[1-9][0-9]{0,18}$/),jr=d.string().regex(/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/),zC=d.string().regex(/^(?!.*\.\.)(?!\/)(?!.*\/$)[A-Za-z0-9._/-]{1,255}$/),Du=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function M1(e,t){return`${e.replace(/\/+$/,"")}/runs/${t}`}o(M1,"skyrampRunPageUrl");var In=d.string().regex(Du),Dn=d.string().regex(/^[0-9a-f]{64}$/),lm=d.object({id:In,revision:Lr}).strict(),gm={provider:d.literal("github"),providerAccountId:Lr,providerRepositoryId:Lr},Am={provider:d.literal("azure-devops"),providerAccountId:In,providerRepositoryId:In},Ir=d.discriminatedUnion("provider",[d.object(gm).strict(),d.object(Am).strict()]),KC=d.discriminatedUnion("provider",[d.object(gm).passthrough(),d.object(Am).passthrough()]),ji=o(e=>`${e.provider}:${e.providerRepositoryId}`,"sourceKey"),h1={namespace:d.string().min(1),name:d.string().min(1)},L1=d.discriminatedUnion("provider",[d.object({...gm,...h1}).strict(),d.object({...Am,...h1}).strict()]),m1=d.object({ref:d.string().min(1),revision:jr}).strict(),Ioe=d.object({kind:d.nativeEnum(JC),number:Lr.optional(),ref:d.string().min(1),revision:jr,reason:d.nativeEnum(dm)}).strict(),woe=d.object({repository:L1,revision:jr,ref:d.string().nullable(),reason:d.nativeEnum(dm),change:d.object({kind:d.nativeEnum(HC),number:Lr,base:m1.optional()}).strict().nullable(),compareWith:m1.optional(),merge:d.array(Ioe).min(2).optional()}).strict();function Coe(e){let t=e.merge;if(!t)return null;if(e.change||e.compareWith)return{path:["merge"],message:"a merged source names no change and no compareWith"};if(e.ref===null)return{path:["ref"],message:"a merged source names its baseline branch"};let n=new Set,i=new Set;for(let[s,a]of t.entries()){if(a.kind==="pull_request"!=(a.number!==void 0))return{path:["merge",s,"number"],message:"a pull request names its number, and a branch none"};if(!A1.includes(a.reason))return{path:["merge",s,"reason"],message:`${a.reason} does not select a merged revision`};if(a.kind==="branch"&&a.reason!=="MANUAL_OVERRIDE")return{path:["merge",s,"reason"],message:"only a person chooses a branch to merge"};if(a.ref===e.ref)return{path:["merge",s,"ref"],message:"the baseline branch is what the source merges onto"};if(a.number!==void 0&&n.has(a.number)||i.has(a.ref))return{path:["merge",s],message:"names a revision the source already merges"};a.number!==void 0&&n.add(a.number),i.add(a.ref)}let r=A1.find(s=>t.some(a=>a.reason===s));return e.reason!==r?{path:["reason"],message:`a source that merges these revisions is ${r}`}:null}o(Coe,"mergedSourceIssue");function Soe(e){if(e.trigger.kind==="revision_read"!=!e.baseline)return e.baseline?"a revision_read run names no baseline":"names its baseline";if(!e.baseline)return null;let{confirmedRunId:t,initialBaselineId:n,comparisonBaselineId:i,sources:r}=e.baseline;if([t,n,i].filter(l=>l!=null).length>1)return"a run compares with one baseline";let s=e.trigger.kind==="schedule"&&t!==null||n!==void 0||i!==void 0;if(!r)return s?"names every source of the snapshot, once":null;if(t===null&&n===void 0&&i===void 0)return"a run with no Confirmed Baseline names no baseline sources";let a=new Set(e.sources.map(l=>ji(l.repository))),c=new Set(r.map(l=>ji(l.repository)));return c.size===r.length&&c.size===a.size&&[...c].every(l=>a.has(l))?null:"names every source of the snapshot, once"}o(Soe,"baselineSourcesIssue");var j1=/^[A-Z][A-Z0-9_]+-[1-9][0-9]*$/,G1=/^[1-9][0-9]{0,18}$/,y1=new RegExp(`${j1.source}|${G1.source}`),E1=/^https:\/\/[a-z0-9-]+(\.[a-z0-9-]+)+$/,koe=d.union([d.object({source:d.literal("jira"),site:d.string().regex(E1),key:d.string().regex(j1),updated:d.string().datetime(),contentHash:Dn}).strict(),d.object({source:d.literal("confluence"),site:d.string().regex(E1),key:d.string().regex(G1),version:d.number().int().positive(),contentHash:Dn}).strict(),d.object({source:d.literal("other"),key:d.string().regex(dp),contentHash:Dn}).strict(),d.object({source:d.literal("other"),key:d.string().regex(hs),contentHash:Dn,fileName:d.string().min(1).max(255),mediaType:d.nativeEnum(pp)}).strict()]),b1=d.union([d.literal("jira"),d.literal("confluence")]),Boe=d.object({schemaVersion:d.literal(1),items:d.array(d.union([d.object({source:b1,site:d.string(),key:d.string().regex(y1),state:d.literal("read"),text:d.string(),version:d.string().min(1),contentMatches:d.boolean()}).strict(),d.object({source:b1,site:d.string(),key:d.string().regex(y1),state:d.literal("not_read"),reason:d.nativeEnum(Da)}).strict(),d.object({source:d.literal("other"),key:d.string().regex(dp),state:d.literal("read"),text:d.string(),version:d.string().min(1),contentMatches:d.boolean()}).strict(),d.object({source:d.literal("other"),key:d.string().regex(dp),state:d.literal("not_read"),reason:d.nativeEnum(Da)}).strict(),d.object({source:d.literal("other"),key:d.string().regex(hs),state:d.literal("read"),version:Dn,fileName:d.string().min(1).max(255),mediaType:d.nativeEnum(pp)}).strict(),d.object({source:d.literal("other"),key:d.string().regex(hs),state:d.literal("not_read"),reason:d.nativeEnum(Da)}).strict()])),instructions:d.array(d.string()).optional()}).strict(),Roe=d.object({resultId:d.string().min(1),repository:d.string().min(1),testType:d.string().min(1),path:d.string(),finding:d.string().min(1)}).strict(),xoe=d.object({schemaVersion:d.literal(1),runId:In,skyrampOrgId:In,target:lm,policy:lm.nullable(),trigger:d.object({kind:d.nativeEnum(pm),requestedAt:d.string().datetime()}).strict(),configuration:d.object({captureId:In,revision:Lr.nullable(),hash:Dn}).strict(),baseline:d.object({confirmedRunId:In.nullable(),initialBaselineId:In.optional(),comparisonBaselineId:In.optional(),knownFailures:d.array(Roe).optional(),sources:d.array(d.object({repository:Ir,revision:jr}).strict()).optional()}).strict().optional(),sources:d.array(woe).min(1).max(1e3),execution:d.object({provider:d.nativeEnum(Pa),repository:L1,workflowPath:d.string(),ref:d.string()}).strict(),credentials:d.array(d.object({name:d.string(),purpose:d.nativeEnum(up),required:d.boolean()}).strict()),requirements:d.array(koe).min(1).optional(),instructions:d.object({contentHash:Dn}).strict().optional(),deployedRevisions:d.array(d.object({repository:Ir,revision:jr}).strict()).min(1).optional()}).strict().superRefine((e,t)=>{let n=new Set;(e.requirements??[]).forEach((u,l)=>{let p="fileName"in u?"file":"pasted";u.source==="other"&&u.key!==`${p}-${u.contentHash.slice(0,16)}`&&t.addIssue({code:d.ZodIssueCode.custom,message:"is not the key of its content hash",path:["requirements",l,"key"]});let f=UC({source:u.source,key:u.key});n.has(f)&&t.addIssue({code:d.ZodIssueCode.custom,message:"names an item that the run already names",path:["requirements",l,"key"]}),n.add(f)});let i=e.trigger.kind,r=Eoe.includes(i);r!==(e.policy===null)&&t.addIssue({code:d.ZodIssueCode.custom,path:["policy"],message:r?`a ${i} run has no policy`:"names the policy revision"}),e.baseline?.knownFailures&&!e.baseline.comparisonBaselineId&&t.addIssue({code:d.ZodIssueCode.custom,path:["baseline","knownFailures"],message:"known failures require a chosen comparison checkpoint"});let s=Soe(e);s&&t.addIssue({code:d.ZodIssueCode.custom,path:e.baseline?["baseline","sources"]:["baseline"],message:s}),boe.includes(i)&&e.sources.forEach((u,l)=>{u.reason!=="BASELINE"&&t.addIssue({code:d.ZodIssueCode.custom,path:["sources",l,"reason"],message:`a ${i} run selects only BASELINE sources`})}),e.deployedRevisions&&i!=="manual"&&t.addIssue({code:d.ZodIssueCode.custom,path:["deployedRevisions"],message:"only a manual run pins deployed revisions"});let a=new Set(e.sources.map(u=>ji(u.repository))),c=new Set;(e.deployedRevisions??[]).forEach((u,l)=>{let p=ji(u.repository);a.has(p)?c.has(p)&&t.addIssue({code:d.ZodIssueCode.custom,path:["deployedRevisions",l,"repository"],message:"repository appears twice"}):t.addIssue({code:d.ZodIssueCode.custom,path:["deployedRevisions",l,"repository"],message:"names a repository outside the snapshot"}),c.add(p)}),e.sources.forEach((u,l)=>{u.compareWith&&(u.reason!=="MANUAL_OVERRIDE"||u.change)&&t.addIssue({code:d.ZodIssueCode.custom,path:["sources",l,"compareWith"],message:"only a MANUAL_OVERRIDE source without a change names a revision to compare with"}),e.baseline?.comparisonBaselineId&&(u.change?.base||u.compareWith||u.merge)&&t.addIssue({code:d.ZodIssueCode.custom,path:["sources",l],message:"a chosen checkpoint cannot be combined with a source comparison base or merge"});let p=Coe(u);p&&t.addIssue({code:d.ZodIssueCode.custom,path:["sources",l,...p.path],message:p.message})})});var XC=(n=>(n.Person="person",n.Policy="policy",n))(XC||{}),Qoe=d.object({kind:d.nativeEnum(XC),name:d.string().min(1).max(256)}).strict(),$oe=d.object({mcp:d.discriminatedUnion("source",[d.object({source:d.literal("npm"),version:d.string().regex(/^[A-Za-z0-9][A-Za-z0-9.+_-]{0,63}$/).nullable()}).strict(),d.object({source:d.literal("github"),ref:d.string().regex(/^[A-Za-z0-9._/-]{1,255}$/)}).strict()]),bedrock:d.object({region:d.string().regex(/^[a-z]{2}(-[a-z]+)+-[0-9]$/),roleArn:d.string().regex(/^arn:aws(-[a-z]+)*:iam::[0-9]{12}:role\/[\w+=,.@/-]{1,512}$/)}).strict().nullable()}).strict(),Toe=d.object({schemaVersion:d.literal(1),attempt:d.object({id:In,number:d.number().int().positive(),deadlineAt:d.string().datetime()}).strict(),manifest:xoe,manifestHash:Dn,entitlements:d.array(d.string()).optional(),runToken:d.string().min(1).optional(),requestedBy:Qoe.nullable().optional(),writeAllowed:d.boolean().optional(),claudeCodeVersion:d.string().regex(/^[0-9]+\.[0-9]+\.[0-9]+$/,"an exact version, such as 2.1.290").nullable().optional(),deployedRevisions:d.array(d.object({repository:Ir,revision:jr}).strict()).optional(),statedRevisions:d.array(d.object({repository:Ir,revision:jr}).strict()).optional(),runSettings:$oe.optional()}).strict(),v1={providerRunAttempt:d.number().int().positive(),workflowRef:d.string().min(1)},Doe=d.string().regex(/^[^/]+\/[^/]+\/[1-9][0-9]{0,15}\/[1-9][0-9]{0,15}$/),_oe=d.object({schemaVersion:d.literal(1),runId:In,execution:d.discriminatedUnion("provider",[d.object({...v1,provider:d.literal("github"),repository:d.object(gm).strict(),providerRunId:Lr}).strict(),d.object({...v1,provider:d.literal("azure-devops"),repository:d.object(Am).strict(),providerRunId:Doe}).strict()]),requester:d.literal(!0).optional(),writeCheck:d.literal(!0).optional(),claudeCodePin:d.literal(!0).optional(),deployedPins:d.literal(!0).optional(),statedPins:d.literal(!0).optional(),runSettings:d.literal(!0).optional(),credentialKinds:d.literal(!0).optional(),credentialBlockers:d.literal(!0).optional()}).strict(),I1=d.object({repository:Ir,number:Lr,commitSha:jr.optional()}).strict(),om=d.array(d.object({repository:Ir,reason:d.string().max(4096).regex(/\S/)}).strict()).max(1e3).optional(),V1=d.object({branch:zC.optional(),commitSha:jr.optional()}).strict(),hm=4096,z1=d.array(d.object({file:d.string().max(4096).regex(/\S/),dependsOn:d.array(d.string().max(2048).regex(/\S/)).max(100)}).strict()).min(1).max(500),w1=d.object({repository:Ir,message:d.string().max(hm),...V1.shape,heldBack:z1.optional()}).strict(),Noe=d.discriminatedUnion("status",[d.object({status:d.literal("none"),noTests:om}).strict(),d.object({status:d.literal("delivered"),noTests:om,pullRequests:d.array(I1).min(1)}).strict(),d.object({status:d.literal("partial"),noTests:om,pullRequests:d.array(I1).min(1),failures:d.array(w1).min(1)}).strict(),d.object({status:d.literal("failed"),message:d.string().max(hm),noTests:om,failures:d.array(w1).min(1).optional()}).strict()]),eS=1024*1024,q1=16*1024*1024,Cp={id:4096,text:16384,businessCase:65536},Rp={id:Cp.id,statement:Cp.text,rows:1e3},C1=d.string().min(1).max(Cp.id),cm=d.string().max(Cp.text),am=o((e,t)=>d.array(d.object({[e]:cm}).strict()).max(t).optional(),"texts"),tS=d.object({language:d.custom(e=>e==="ja","Invalid"),businessCaseAnalysis:d.string().max(Cp.businessCase),validation:d.object({rationale:cm.min(1),gaps:d.array(d.string().min(1).max(4096)).max(200)}).strict().optional(),changes:d.array(d.object({id:C1,text:cm}).strict()).max(1e3).optional(),requirements:d.array(d.object({id:C1,statement:cm}).strict()).max(Rp.rows).optional(),issuesFound:am("description",5e3),newTestsCreated:am("description",5e3),testResults:am("details",5e3),caveats:am("text",100)}).strict(),Poe=d.object({blockedPreflight:d.object({file:d.string().min(1),repository:d.string().min(1).optional(),reason:d.string().min(1).max(300),evidence:d.string().min(1).max(400)}).strict().optional(),sufficiency:d.nativeEnum(Oi),rationale:d.string().min(1),gaps:d.array(d.string().min(1)),acceptedEvidence:d.array(d.object({kind:d.nativeEnum(co),repository:d.string().min(1),revision:jr,reference:d.string().min(1),summary:d.string().min(1)}).strict()),actionRequired:d.array(d.nativeEnum(xu))}).strict().superRefine((e,t)=>{e.sufficiency==="insufficient"!=e.gaps.length>0&&t.addIssue({code:d.ZodIssueCode.custom,path:["gaps"],message:"only insufficient evidence names gaps, and it names at least one"}),new Set(e.actionRequired).size!==e.actionRequired.length&&t.addIssue({code:d.ZodIssueCode.custom,path:["actionRequired"],message:"a reason appears twice"})}),um=500,H1=2048,J1=1e3,Uoe=/[\\/:*?"<>|;#$*{},+=[\]%\p{Cc}\p{Cf}]/u,S1=o(e=>e.length>0&&e.length<=64&&e===e.trim()&&!Uoe.test(e)&&!/[^\S ]/u.test(e)&&!/^[._]/.test(e)&&!e.endsWith("."),"isAzureName"),Y1=o(e=>{if(/^[A-Za-z0-9._-]{1,100}\/[A-Za-z0-9._-]{1,100}$/.test(e))return!0;let[t,n,i,...r]=e.split("/");return e.length<=201&&r.length===0&&i!==void 0&&/^[A-Za-z0-9](?:[A-Za-z0-9-]{0,48}[A-Za-z0-9])?$/.test(t)&&S1(n)&&S1(i)},"isResultRepository"),Foe=d.object({testResults:d.array(d.object({resultId:d.string().regex(/^[^\u0000-\u001f]{1,512}$/),repository:d.string().refine(Y1,"Invalid"),testType:d.string(),runtimeTargets:yp.optional(),endpoint:d.string(),status:d.enum(["Pass","Fail","Skipped"]),details:d.string(),fileName:d.string().optional(),testId:d.string().regex(/^[^\u0000-\u001f]{1,512}$/).optional(),failureCause:d.object({kind:d.nativeEnum(fp),family:d.nativeEnum(gp).optional()}).strict().optional(),origin:d.nativeEnum(Xh).optional()}).strict()),validation:Poe,changes:d.array(d.object({id:d.string().min(1).max(512),text:d.string().max(16384),source:d.string().max(H1),testedBy:d.array(d.string().min(1).max(1024)).max(um),writtenBy:d.array(d.string().min(1).max(1024)).max(um),maintainedBy:d.array(d.string().min(1).max(1024)).max(um)}).strict()).max(J1).optional(),traceVersion:d.literal(1),display:tS.optional()}).passthrough().superRefine((e,t)=>{let n=e.display,i={issuesFound:e.issuesFound,newTestsCreated:e.newTestsCreated,testResults:e.testResults,caveats:e.caveats};for(let s of["issuesFound","newTestsCreated","testResults","caveats"]){let a=n?.[s];a&&a.length!==(Array.isArray(i[s])?i[s].length:0)&&t.addIssue({code:d.ZodIssueCode.custom,path:["display",s],message:`has not one row per ${s} row`})}n?.validation&&n.validation.gaps.length!==e.validation.gaps.length&&t.addIssue({code:d.ZodIssueCode.custom,path:["display","validation","gaps"],message:"has not one gap per validation gap"});let r=new Set;e.testResults.forEach((s,a)=>{let c=s.failureCause;c&&s.status==="Pass"&&t.addIssue({code:d.ZodIssueCode.custom,path:["testResults",a,"failureCause"],message:"a passing result has no failure cause"}),c&&c.kind==="environment"!=(c.family!==void 0)&&t.addIssue({code:d.ZodIssueCode.custom,path:["testResults",a,"failureCause"],message:"an environment cause names its family, and no other cause does"});let u=["testResults",a,"resultId"],l=s.resultId.slice(`${s.repository}:${s.testType}:`.length);(!s.resultId.startsWith(`${s.repository}:${s.testType}:`)||l===""||l.startsWith("/")||l.startsWith("#"))&&t.addIssue({code:d.ZodIssueCode.custom,path:u,message:"is not repository:testType:path for this result"}),r.has(s.resultId)&&t.addIssue({code:d.ZodIssueCode.custom,path:u,message:"stable identity repeated"}),r.add(s.resultId)})}),k1=o(e=>e.replace(/[%:#]/g,t=>encodeURIComponent(t)),"encodeIdPart");function nS(e,t,n,i){let r=n.replace(/\\/g,"/"),s=r.split("/").filter(u=>u!==""&&u!==".");if(r.startsWith("/")||/^[A-Za-z]:/.test(r)||s.length===0||s.includes(".."))throw new Error(`testResultId needs a path relative to the repository root, got "${n}"`);let a=s.join("/"),c=`${e}:${t}:${k1(a)}`;return i?`${c}#${k1(i)}`:c}o(nS,"testResultId");var mm=(i=>(i.BranchPushed="branch_pushed",i.PullRequestOpened="pull_request_opened",i.PullRequestEdited="pull_request_edited",i))(mm||{}),W1=50,Z1=d.discriminatedUnion("kind",[d.object({kind:d.literal("branch_pushed"),repository:Ir,branch:zC,commit:jr}).strict(),d.object({kind:d.enum(["pull_request_opened","pull_request_edited"]),repository:Ir,number:Lr,branch:zC}).strict()]),Ooe=100,Moe=2048,zRe=d.object({records:d.array(d.string().regex(/^https?:\/\/[^\s/?#@]+(\/[^\s?#]*)?$/).max(Moe)).max(Ooe),unlisted:d.number().int().nonnegative()}).strict().refine(e=>e.records.length+e.unlisted>0,"names at least one create"),K1=d.object({schemaVersion:d.literal(1),run:d.object({runId:In,attemptNumber:d.number().int().positive(),manifestHash:Dn}).strict(),target:lm,policy:lm,provenance:d.object({sources:d.array(d.object({repository:Ir,revision:jr}).strict()),firstQualification:d.literal(!0).optional()}).strict(),delivery:d.object({generatedTests:Noe}).strict(),producer:d.object({testbot:d.string().regex(/^[0-9A-Za-z.+-]{1,64}$/),mcp:d.string().regex(/^[0-9A-Za-z.+-]{1,64}$/)}).strict(),report:Foe,githubWrites:d.array(Z1).max(W1).optional()}).strict(),rS=(r=>(r.Recipe="recipe",r.CredentialRejected="credential_rejected",r.Environment="environment",r.Unknown="unknown",r))(rS||{}),iS=200,Loe=d.object({cause:d.nativeEnum(rS),credential:d.string().regex(Kn).optional(),reason:d.string().trim().min(1).max(iS).optional()}).strict().refine(e=>e.cause==="credential_rejected"==(e.credential!==void 0&&e.reason!==void 0),{message:"a credential_rejected check, and only one, names the credential and why"}),joe=d.object({name:d.string().regex(Kn),purpose:d.enum(["sut_access","other"]),required:d.boolean(),how:d.string().trim().min(1).max(Kh)}).strict(),qRe=K1.pick({schemaVersion:!0,run:!0,target:!0,provenance:!0,producer:!0}).extend({recipe:p1,check:Loe.optional(),inputs:d.array(joe).min(1).max(50).optional()}).strict().superRefine(({recipe:e},t)=>{let n=o((s,a)=>t.addIssue({code:d.ZodIssueCode.custom,path:["recipe",...s],message:a}),"issue");e.status==="blocked"&&e.blockers.length===0&&n(["blockers"],"a blocked recipe names at least one blocker");let i=new Set,r=0;e.files.forEach((s,a)=>{Ep(s.path)||n(["files",a,"path"],"is not a file under .skyramp/sut/, or the .skyramp/workspace.yml a recipe stored before SKYR-5829 carries"),i.has(s.path)&&n(["files",a,"path"],"file repeated"),i.add(s.path),t1.test(s.content)&&n(["files",a,"content"],"is not text");let c=Buffer.byteLength(s.content,"utf8");r+=c,c>_C&&n(["files",a,"content"],`larger than ${_C} bytes`)}),r>NC&&n(["files"],`recipe text over ${NC} bytes in total`)}),HRe=d.object({components:d.array(d.object({name:d.string().min(1),repository:d.string().refine(Y1,"Invalid"),observedRevision:d.string().regex(/^[0-9a-f]{7,64}$/).nullable(),source:d.nativeEnum(em),evidence:d.string()}).strict().refine(e=>e.source!=="agent"||e.observedRevision===null,{path:["observedRevision"],message:"a component only an agent session can read names no revision"}))}).strict();function X1(e){return e.trigger.kind==="schedule"||e.trigger.kind==="manual"&&e.sources.every(t=>t.reason==="BASELINE")}o(X1,"readsDeployedState");var Goe=d.object({schemaVersion:d.literal(1),stage:d.nativeEnum(P1),event:d.nativeEnum(YC),status:d.nativeEnum(U1).optional()}).strict().refine(e=>e.status===void 0||e.event==="finished",{path:["status"],message:"only a finished stage has a status"}),ym=100,Voe=5e3,Na=2e3,B1=100,eG=/^[A-Za-z0-9_-]{1,64}$/,zoe=20,qoe=200,Hoe=100,Joe=100,Yoe=200,R1="[^/\\s](?:(?:[^/\\s]| )*[^/\\s])?",Woe=new RegExp(`^(?:[^/\\s]+/[^/\\s]+|[^/\\s]+/${R1}/${R1})$`),Zoe=500,x1=50,Koe=10,Xoe=/^[A-Za-z0-9](?:[A-Za-z0-9 _-]{0,48}[A-Za-z0-9])?$/,tG=/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]|[\ud800-\udbff](?![\udc00-\udfff])|(?<![\ud800-\udbff])[\udc00-\udfff]/,vr=o(e=>d.string().max(e).refine(t=>t.trim().length>0&&!tG.test(t),"blank, or not text"),"setupText"),Li={sequence:d.number().int().min(1).max(Voe),at:d.string().regex(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,6})?Z$/)},nG=d.object({...Li,kind:d.literal("reply"),to:d.string().uuid(),outcome:d.nativeEnum(O1),accepted:d.boolean(),text:vr(Na),note:d.object({source:d.enum(["target","environment"]),quote:vr(Na)}).strict().optional(),kept:vr(Na).optional()}).strict();function rG(e,t){if(e.kind!=="reply")return;let n=e;n.accepted!==(n.outcome==="answered"||n.outcome==="followed")&&t.addIssue({code:d.ZodIssueCode.custom,path:["accepted"],message:"accepted exactly when answered or followed"}),n.note&&n.outcome!=="not_followed"&&t.addIssue({code:d.ZodIssueCode.custom,path:["note"],message:"a note only when not_followed"}),n.kept&&n.outcome!=="followed"&&t.addIssue({code:d.ZodIssueCode.custom,path:["kept"],message:"kept only when followed"})}o(rG,"checkReply");var eae=d.discriminatedUnion("kind",[d.object({...Li,kind:d.literal("log"),phase:d.nativeEnum(WC),text:vr(Na)}).strict(),d.object({...Li,kind:d.literal("component"),name:vr(B1),repository:vr(Yoe).refine(e=>Woe.test(e)||e===Ui,"not owner/name"),file:vr(Zoe).nullable(),status:d.nativeEnum(ZC),version:vr(Joe).optional()}).strict(),nG,d.object({...Li,kind:d.literal("question"),id:d.string().regex(eG),type:d.nativeEnum(F1),text:vr(Na),component:vr(B1).nullable(),choices:d.array(vr(qoe)).max(zoe),placeholder:vr(Hoe).optional()}).strict(),d.object({...Li,kind:d.literal("delivered"),ids:d.array(d.string().uuid()).max(ym)}).strict(),d.object({...Li,kind:d.literal("credentials"),names:d.array(d.string().regex(Kn)).min(1).max(x1),logins:d.array(d.object({key:d.string().regex(Xoe),usernameVariable:d.string().regex(Kn),passwordVariable:d.string().regex(Kn)}).strict()).min(1).max(Koe).optional(),variables:d.array(d.string().regex(Kn)).min(1).max(x1).optional()}).strict()]).superRefine((e,t)=>{if(rG(e,t),e.kind==="credentials"&&new Set(e.names).size!==e.names.length&&t.addIssue({code:d.ZodIssueCode.custom,path:["names"],message:"a name twice"}),e.kind==="credentials"&&e.logins){let n=e.logins.map(i=>u1(i.key));new Set(n).size!==n.length&&t.addIssue({code:d.ZodIssueCode.custom,path:["logins"],message:"a key twice"}),e.logins.forEach((i,r)=>{for(let s of["usernameVariable","passwordVariable"])e.names.includes(i[s])||t.addIssue({code:d.ZodIssueCode.custom,path:["logins",r,s],message:"not one of the names"})})}e.kind==="credentials"&&e.variables&&(new Set(e.variables).size!==e.variables.length&&t.addIssue({code:d.ZodIssueCode.custom,path:["variables"],message:"a name twice"}),e.variables.forEach((n,i)=>{e.names.includes(n)||t.addIssue({code:d.ZodIssueCode.custom,path:["variables",i],message:"not one of the names"})})),e.kind==="question"&&(e.type==="free_text"!=(e.choices.length===0)&&t.addIssue({code:d.ZodIssueCode.custom,path:["choices"],message:"choices exactly when the question is not free_text"}),new Set(e.choices).size!==e.choices.length&&t.addIssue({code:d.ZodIssueCode.custom,path:["choices"],message:"a choice twice"}))}),tae=d.object({schemaVersion:d.literal(1),events:d.array(eae).max(ym)}).strict(),nae=d.discriminatedUnion("kind",[d.object({...Li,kind:d.literal("log"),stage:d.nativeEnum(VC),text:vr(Na)}).strict(),nG,d.object({...Li,kind:d.literal("delivered"),ids:d.array(d.string().uuid()).max(ym)}).strict(),d.object({...Li,kind:d.literal("stage"),stage:d.nativeEnum(VC),event:d.nativeEnum(YC)}).strict(),d.object({...Li,kind:d.literal("test"),resultId:d.string().regex(/^[^\u0000-\u001f]{1,512}$/),status:d.enum(["Pass","Fail","Skipped"]),details:d.string().max(Na).refine(e=>!tG.test(e),"not text")}).strict()]).superRefine(rG),rae=d.object({schemaVersion:d.literal(1),events:d.array(nae).max(ym)}).strict(),Q1={id:d.string().uuid(),text:d.string(),by:d.string().nullable(),at:d.string(),replied:d.literal(!0).optional()},iG=d.discriminatedUnion("kind",[d.object({...Q1,kind:d.literal("instruction"),question:d.null()}),d.object({...Q1,kind:d.literal("answer"),question:d.string().regex(eG)})]),sG=d.string().regex(/^[A-Za-z0-9+/]{43}=$/),iae=d.object({id:d.string().uuid(),revision:d.string(),by:d.string().nullable(),at:d.string(),target:d.string(),own:d.object({source:d.enum(["policy","test_environment"]),text:d.string()}).nullable()}),sae=d.object({schemaVersion:d.literal(1),leftOut:d.array(d.string()),messages:d.array(iG).optional(),stop:d.object({key:sG}).optional(),notes:iae.optional()}),oae=d.object({schemaVersion:d.literal(1),messages:d.array(iG).optional()});var aae=500*1024*1024,oG=d.object({id:Lr,name:d.string().regex(/^[A-Za-z0-9._-]{1,200}$/),providerRunId:Lr,expiresAt:d.string().datetime()}).strict(),cae=d.object({schemaVersion:d.literal(1),artifact:oG,sessionId:In,contentHash:Dn,bytes:d.number().int().min(1).max(aae)}).strict(),uae=d.object({schemaVersion:d.literal(1),checkpoint:d.object({artifact:oG,repository:d.object({namespace:d.string().min(1),name:d.string().min(1)}).strict(),sessionId:In,contentHash:Dn,key:sG}).strict().nullable()}).strict(),lae=200,Qu=100,aG=(i=>(i.Resume="resume",i.Retry="retry",i.Update="update",i))(aG||{}),dae=d.object({kind:d.nativeEnum(aG),setup:d.object({runId:In,endedAt:d.string().nullable(),outcome:d.string().nullable()}).strict(),components:d.array(d.object({name:d.string().min(1),repository:d.string().min(1),status:d.nativeEnum(ZC)}).strict()).max(Qu),credentials:d.array(d.string().min(1)).max(Qu),answers:d.array(d.object({question:d.string(),answer:d.string().nullable()}).strict()).max(Qu),instructions:d.array(d.object({text:d.string(),reply:d.string().nullable()}).strict()).max(Qu),log:d.array(d.object({phase:d.nativeEnum(WC),text:d.string()}).strict()).max(lae),recipe:d.object({files:d.array(d.object({path:d.string().min(1),content:d.string()}).strict()).max(Qu),blockers:d.array(d.object({component:d.string(),problem:d.string(),evidence:d.string(),fix:d.string()}).strict()).max(Qu)}).strict().optional()}).strict(),pae=d.object({schemaVersion:d.literal(1),context:dae.nullable()}).strict(),fae=d.object({schemaVersion:d.literal(1),configuration:d.object({captureId:In,revision:Lr.nullable(),hash:Dn}).strict(),capture:d.object({schemaVersion:d.literal(1),settings:d.object({target:d.object({environment:d.unknown()}).passthrough(),timeoutMinutes:d.number().int().positive(),answerWaitMinutes:d.number().int().positive().optional(),testEnvironment:d.object({name:d.string().min(1),address:d.string().min(1).optional(),readyWhen:d.string().min(1).optional(),environmentId:d.string().uuid().optional(),persistentDataPolicy:D1}).passthrough().optional()}).passthrough(),provenance:d.object({}).passthrough(),hash:Dn}).strict()}).strict(),cG=d.object({schemaVersion:d.literal(1),environmentId:d.string().uuid().nullable(),environmentAddress:d.string().url().nullable(),persistentDataPolicy:vp.nullable()}).strict(),gae=Ru.extend({environmentId:d.string().uuid().optional(),persistentDataPolicy:D1,version:d.number().int().positive(),components:d.array(d.object({name:d.string().min(1),repository:d.string().min(1)}).strict()),contentHash:Dn.optional(),files:d.array(d.object({path:d.string().refine(e=>Ep(e)&&!jC.includes(e),"not a file of a customer_deployed plan"),content:d.string()}).strict()).optional()}).strict(),Aae=d.object({schemaVersion:d.literal(1),testEnvironment:gae.nullable().optional(),runtimePlan:d.object({version:d.number().int().positive(),contentHash:Dn,files:d.array(d.object({path:d.string().refine(Ep,"not a recipe file path"),content:d.string()}).strict()).min(1),repository:im.optional(),recipeRepository:im.optional(),recipe:d.record(d.unknown()).optional()}).strict().nullable()}).strict().refine(e=>!(e.runtimePlan&&e.testEnvironment),{message:"a run pins a recipe or a customer's Test Environment, never both",path:["testEnvironment"]}),uG=d.object({schemaVersion:d.literal(1),state:d.nativeEnum(N1),ending:d.nativeEnum(kp).nullable(),cause:d.nativeEnum(Bp).nullable(),deadlineAt:d.string().datetime()}).strict();function lG(e,t){return e.state==="ended"?e.ending==="cancelled"?"cancelled":e.cause==="runner_lost"?"expired":"ended":t.getTime()>=Date.parse(e.deadlineAt)?"expired":null}o(lG,"attemptClosure");var dG=50,JRe=d.object({repository:Ir,revisions:d.array(d.number().int().nonnegative()).min(1).max(2).refine(e=>e.length<2||e[0]<e[1],"two revisions name the earlier first"),files:d.array(d.string().min(1)).min(1).max(dG)}).strict();function qC(e){if(typeof e=="number"&&!Number.isFinite(e))throw new TypeError("Canonical JSON requires JSON values");if(Array.isArray(e))return`[${e.map(qC).join(",")}]`;if(e!==null&&typeof e=="object"){let n=e;return`{${Object.keys(n).sort().map(i=>`${JSON.stringify(i)}:${qC(n[i])}`).join(",")}}`}let t=JSON.stringify(e);if(t===void 0)throw new TypeError("Canonical JSON requires JSON values");return t}o(qC,"canonicalJson");function pG(e){return(0,T1.createHash)("sha256").update(qC(e),"utf8").digest("hex")}o(pG,"manifestHash");var $u=o(e=>({provider:e.provider,providerAccountId:e.providerAccountId,providerRepositoryId:e.providerRepositoryId}),"toSourceRef");function sS(e,t,{statedPins:n=!0,credentialKinds:i=!0,credentialBlockers:r=!0}={}){return _oe.parse({schemaVersion:1,runId:e,execution:t.execution(),requester:!0,writeCheck:!0,claudeCodePin:!0,deployedPins:!0,...n?{statedPins:!0}:{},...t.runSettingsFromApp?{runSettings:!0}:{},...i?{credentialKinds:!0}:{},...r?{credentialBlockers:!0}:{}})}o(sS,"handshakeRequest");function fG(e){let t=Toe.parse(e);if(pG(t.manifest)!==t.manifestHash)throw new Error("The handshake manifest hash does not match its manifest");return t}o(fG,"parseHandshakeResponse");function hae(e){let t=o(r=>r.map(s=>({repository:$u(s.repository),number:s.number,...s.commitSha===void 0?{}:{commitSha:s.commitSha}})),"pullRequests"),n=e.noTests?{noTests:e.noTests.map(r=>({repository:$u(r.repository),reason:r.reason}))}:{};if(e.status==="delivered")return{status:e.status,...n,pullRequests:t(e.pullRequests)};let i=o(r=>r.map(s=>({repository:$u(s.repository),message:s.message,...s.branch===void 0?{}:{branch:s.branch},...s.commitSha===void 0?{}:{commitSha:s.commitSha},...s.heldBack===void 0?{}:{heldBack:s.heldBack}})),"failures");return e.status==="partial"?{status:e.status,...n,pullRequests:t(e.pullRequests),failures:i(e.failures)}:e.status==="failed"&&e.failures?{...e,...n,failures:i(e.failures)}:{...e,...n}}o(hae,"toDelivery");function mae(e){return e.issues.map(t=>`${t.path.map((i,r)=>typeof i=="number"?`[${i}]`:r===0?i:`.${i}`).join("")}: ${t.message}`).join("; ")}o(mae,"describeIssues");function gG(e){let{manifest:t}=e;if(voe.includes(t.trigger.kind))throw new Error(`The report upload is invalid: a ${t.trigger.kind} run uploads its SUT recipe, never a report`);if(t.trigger.kind==="revision_read")throw new Error("The report upload is invalid: a revision_read run uploads what each component runs, never a report");if(e.firstQualification&&!t.baseline?.sources)throw new Error("The report upload is invalid: only a run whose manifest names baseline sources can be a first qualification");let n=K1.safeParse({schemaVersion:1,run:{runId:t.runId,attemptNumber:e.attemptNumber,manifestHash:pG(t)},target:{id:t.target.id,revision:t.target.revision},policy:t.policy&&{id:t.policy.id,revision:t.policy.revision},provenance:{sources:e.checkedOut.map(i=>({repository:$u(i.repository),revision:i.revision})),...e.firstQualification?{firstQualification:!0}:{}},delivery:{generatedTests:hae(e.generatedTests)},producer:e.producer,report:e.report,...e.githubWrites?.length?{githubWrites:e.githubWrites.map(i=>({...i,repository:$u(i.repository)}))}:{}});if(!n.success)throw new Error(`The report upload is invalid: ${mae(n.error)}`);return yae(n.data,t,e.checkedOut),n.data}o(gG,"buildReportUpload");function yae(e,t,n){let i=o(s=>n.find(a=>ji(a.repository)===ji(s.repository))?.revision??s.revision,"revisionOf"),r=new Map(t.sources.map(s=>[`${s.repository.namespace}/${s.repository.name}`.toLowerCase(),i(s)]));e.report.validation.acceptedEvidence.forEach((s,a)=>{let c=`report.validation.acceptedEvidence[${a}]`,u=r.get(s.repository.toLowerCase());if(!u)throw new Error(`${c}.repository: ${s.repository} is outside the run's snapshot`);if(s.revision!==u)throw new Error(`${c}.revision: evidence is not from the checked-out revision ${u}`)})}o(yae,"assertEvidenceFromSnapshot");function AG(e){if(e.reportUploaded)return{schemaVersion:1,reason:"report_uploaded",cause:null};if(e.recipeUploaded)return{schemaVersion:1,reason:"recipe_uploaded",cause:null};if(e.revisionsUploaded)return{schemaVersion:1,reason:"revisions_uploaded",cause:null};let t=e.githubWrites?.length?{githubWrites:e.githubWrites.map(i=>({...i,repository:$u(i.repository)}))}:{},n=e.sharedEnvironmentRecords?{sharedEnvironmentRecords:e.sharedEnvironmentRecords}:{};return e.cancelled?{schemaVersion:1,reason:"cancelled",cause:null,...t,...n}:e.mergeConflict&&$1(e)==="merge_conflict"?{schemaVersion:1,reason:"no_report",cause:"merge_conflict",conflict:e.mergeConflict,...t,...n}:{schemaVersion:1,reason:"no_report",cause:$1({...e,mergeConflict:void 0}),...t,...n}}o(AG,"attemptEndFor");function $1(e){return e.runnerProviderNotReady?"runner_provider_not_ready":e.credentialMissing?"credential_missing":e.mergeConflict?"merge_conflict":e.checkoutFailed?"checkout_failed":e.environmentUnverified?"environment_unverified":e.setupFailed?"setup_failed":e.timedOut?"timed_out":e.modelProviderDenied?"model_provider_denied":e.modelProviderUnavailable?"model_provider_unavailable":e.environmentUnavailable?"environment_unavailable":"agent_failed"}o($1,"noReportCause");var nxe=["clean","recipe-drift"];var lo=ee(require("path"));var oxe={"application/pdf":"PDF","text/csv":"CSV","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"DOCX","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"XLSX"};var oS=o(e=>new Map((e??[]).flatMap(t=>t.file?[[_a(t.key),t.file.name]]:[])),"itemNames"),vae=10*1024*1024,mG=o(e=>e?.mediaType==="application/vnd.openxmlformats-officedocument.wordprocessingml.document"||e?.mediaType==="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","needsExtraction"),yG=o((e,t)=>lo.join(lo.dirname(e),`${lo.basename(e,lo.extname(e))}${t}`),"besideFile"),EG=o(e=>yG(e,".extracted.txt"),"extractedTextPath");var Iae=o(e=>yG(e,".quotes.txt"),"confirmedQuotesPath");function bG(e){return mG(e.file)?EG(e.path):e.file?.mediaType==="application/pdf"?Iae(e.path):e.path}o(bG,"itemTextPath");var xp=ee(require("fs")),Ua=ee(require("path"));var wae=8;function ln(e,t,n={}){let i=t.slice(0,wae),r=t.length-i.length;return{name:e,passed:!1,details:i.join("; ")+(r>0?`; \u2026and ${r} more`:""),...n.fatal?{fatal:!0}:{}}}o(ln,"fail");function Gi(e){if(xp.existsSync(e))try{return JSON.parse(xp.readFileSync(e,"utf-8"))}catch{return}}o(Gi,"readJsonFile");function ve(e,t){return Gi(Ua.join(e.outputsDir,t))}o(ve,"readArtifact");function Xn(e,t){return{name:e,verify(n,i){let{errors:r}=t(n,i);return r.length===0?{name:this.name,passed:!0}:ln(this.name,r,{fatal:!0})}}}o(Xn,"schemaGate");function di(e,t){return Ua.relative(e,Ua.resolve(e,t)).replace(/\/+$/,"")}o(di,"relNorm");function Qp(e){return e.replace(/\s+/g," ").trim()}o(Qp,"normalizeCode");var $p=new RegExp("(^|/)("+["test_[^/]+\\.py","[^/]+_test\\.py","[^/]+\\.(spec|test)\\.[cm]?[jt]sx?","[^/]+\\.e2e-(spec|test)\\.[cm]?[jt]sx?","[^/]+_test\\.go","[^/]+Tests?\\.(java|kts?)","[^/]+_(test|spec)\\.rb","[^/]+\\.feature","[^/]+Tests?\\.cs","[^/]+_test\\.rs","tests/[^/]+\\.rs","[^/]+Test\\.php","[^/]+(Test|Spec|Suite)\\.scala","[^/]+Tests?\\.swift","[^/]+_test\\.exs","[^/]+_test\\.dart","[^/]+_test\\.(c|cc|cpp|cxx)","test_[^/]+\\.(c|cc|cpp|cxx)","[^/]+(Spec|Test)\\.groovy"].join("|")+")$","i");function Nt(e){let t=Math.max(0,...(e.match(/`+/g)??[]).map(r=>r.length)),n="`".repeat(t+1),i=e.startsWith("`")||e.endsWith("`")?" ":"";return`${n}${i}${e}${i}${n}`}o(Nt,"codeSpan");var vG=ee(require("path"));var aS="outputs/preflight.json",Fa="pr-diff.txt",cS="related-diffs";function uS(e){return vG.join(cS,`${e.toLowerCase().replace(/\//g,"__").replace(/[^a-z0-9._-]/g,"_")}.diff`)}o(uS,"relatedDiffArtifact");var ys=ee(require("path"));var Tp=ee(require("path"));var po="Skyramp Testbot",Oa="test-bot@skyramp.dev";var _u=o(e=>e.slice(0,12),"shortCommit");var Cae=o((e,t)=>Vt(t,{cwd:e,encoding:"utf-8",stdio:["ignore","pipe","ignore"]}).trim(),"git");function IG(e){let t="";try{t=Cae(e,["remote","get-url","origin"])}catch{}let n=/[:/]([A-Za-z0-9._-]+)\/([A-Za-z0-9._-]+?)(?:\.git)?\/?$/.exec(t);return n&&!t.startsWith("/")&&!t.startsWith(".")?`${n[1]}/${n[2]}`:`local/${Tp.basename(Tp.resolve(e)).replace(/[^A-Za-z0-9._-]/g,"-")||"repo"}`}o(IG,"repositorySlug");var Rxe=new Set(Object.values(co));var xxe=d.object({checks:d.array(d.object({repository:d.string().optional(),name:d.string().min(1),headSha:d.string().regex(/^[0-9a-f]{40}$|^[0-9a-f]{64}$/i),status:d.string().default("completed"),conclusion:d.string().nullable().optional(),url:d.string().optional(),summary:d.string().optional()}))});var Sae=["generate-unit","native-run"],Dxe=["preflight","plan","write",...Sae,"report","deliver"];var Em=(i=>(i.Unit="unit",i.Integration="integration",i.E2e="e2e",i))(Em||{}),kae=Object.values(Em);var wG=8e3;function CG(e,t){return(e.contextRepositories??[]).some(n=>pi(n,t))}o(CG,"pinnedForContext");var lS=new Map;function Rae(e){return e.repositorySlug?e.repositorySlug:(lS.has(e.repositoryPath)||lS.set(e.repositoryPath,IG(e.repositoryPath)),lS.get(e.repositoryPath))}o(Rae,"workingSlug");function Jt(e){let t=Rae(e);return[{slug:t,path:e.repositoryPath,writable:!CG(e,t),working:!0},...(e.relatedRepos??[]).map(n=>({slug:n.slug,path:n.path,writable:n.writable===!0,working:!1}))]}o(Jt,"runSources");var pi=o((e,t)=>e.toLowerCase()===t.toLowerCase(),"sameSlug");function Nu(e,t){return t?.trim()?e.find(n=>pi(n.slug,t.trim())):e[0]}o(Nu,"findSource");function wr(e,t){return Nu(Jt(e),t)}o(wr,"resolveSource");var xae=o((e,t)=>`${t} is not a repository of this run (${Jt(e).map(n=>n.slug).join(", ")})`,"notARepository");function Es(e,t){let n=wr(e,t);return n?n.writable?{source:n}:{error:`${n.slug} is read-only in this run: tests are written only to ${Jt(e).filter(i=>i.writable).map(i=>i.slug).join(", ")}`}:{error:xae(e,t)}}o(Es,"writableSource");function fi(e,t){return SG(Jt(e),t)}o(fi,"checkoutLabel");var dS=o(e=>ys.basename(ys.resolve(e.path)),"relatedDirName");function SG(e,t){return e.length<2?"":`${Nu(e,t)?.slug??t}: `}o(SG,"labelAmong");var Hxe={focused:"Focused",impacted_critical:"Impacted and critical",broad:"Broad"};var Uu=o(e=>!!e.inputs?.scheduledValidation?.comparisonBaselineId,"retestsKnownFailures");var hb=ee(require("fs")),Dt=ee(require("path"));var Br=ee(require("fs")),Sq=require("child_process"),kq=require("module"),Bq=ee(require("os")),yi=ee(require("path"));var pe={};ei(pe,{$brand:()=>kS,$input:()=>ix,$output:()=>rx,INVALID:()=>Pn,NEVER:()=>SS,TimePrecision:()=>hx,ZodAny:()=>r$,ZodArray:()=>a$,ZodBase64:()=>pE,ZodBase64URL:()=>fE,ZodBigInt:()=>vl,ZodBigIntFormat:()=>hE,ZodBoolean:()=>bl,ZodCIDRv4:()=>lE,ZodCIDRv6:()=>dE,ZodCUID:()=>rE,ZodCUID2:()=>iE,ZodCatch:()=>R$,ZodCodec:()=>$f,ZodCompileAsyncError:()=>Ai,ZodCompileUnsupportedError:()=>He,ZodCreditCard:()=>YQ,ZodCustom:()=>Tf,ZodCustomStringFormat:()=>nc,ZodDate:()=>Sf,ZodDefault:()=>I$,ZodDiscriminatedUnion:()=>u$,ZodE164:()=>gE,ZodEmail:()=>Xy,ZodEmoji:()=>tE,ZodEnum:()=>ml,ZodError:()=>Yde,ZodExactOptional:()=>bE,ZodFile:()=>y$,ZodFirstPartyTypeKind:()=>j$,ZodFunction:()=>F$,ZodGUID:()=>eE,ZodIBAN:()=>WQ,ZodIPv4:()=>cE,ZodIPv6:()=>uE,ZodISODate:()=>Co,ZodISODateTime:()=>wo,ZodISODuration:()=>ko,ZodISOTime:()=>So,ZodInstanceOf:()=>L$,ZodIntersection:()=>l$,ZodIssueCode:()=>Kde,ZodJWT:()=>AE,ZodKSUID:()=>aE,ZodLazy:()=>N$,ZodLiteral:()=>m$,ZodMAC:()=>JQ,ZodMap:()=>A$,ZodNaN:()=>Q$,ZodNanoID:()=>nE,ZodNever:()=>s$,ZodNonOptional:()=>vE,ZodNull:()=>t$,ZodNullable:()=>v$,ZodNumber:()=>El,ZodNumberFormat:()=>rc,ZodObject:()=>Bf,ZodOptional:()=>xf,ZodPipe:()=>Qf,ZodPrefault:()=>C$,ZodPreprocess:()=>$$,ZodPromise:()=>U$,ZodReadonly:()=>T$,ZodRealError:()=>ir,ZodRecord:()=>hl,ZodSet:()=>h$,ZodString:()=>yl,ZodStringFormat:()=>pt,ZodSuccess:()=>B$,ZodSymbol:()=>XQ,ZodTemplateLiteral:()=>_$,ZodTransform:()=>E$,ZodTuple:()=>p$,ZodType:()=>Oe,ZodULID:()=>sE,ZodURL:()=>Cf,ZodUUID:()=>Hi,ZodUndefined:()=>e$,ZodUnion:()=>Rf,ZodUnknown:()=>i$,ZodVoid:()=>o$,ZodXID:()=>oE,ZodXor:()=>c$,_ZodString:()=>Ky,_default:()=>w$,_function:()=>Xz,any:()=>Qz,array:()=>kf,base64:()=>lz,base64url:()=>dz,bigint:()=>Sz,boolean:()=>KQ,catch:()=>x$,check:()=>eq,cidrv4:()=>cz,cidrv6:()=>uz,clone:()=>st,codec:()=>Yz,coerce:()=>V$,compile:()=>cx,config:()=>Pt,core:()=>Cs,creditCard:()=>fz,cuid:()=>ez,cuid2:()=>tz,currencyCode:()=>Ez,custom:()=>tq,date:()=>Tz,decode:()=>LQ,decodeAsync:()=>GQ,deepPartial:()=>gq,describe:()=>nq,discriminatedUnion:()=>Fz,e164:()=>pz,email:()=>VV,emoji:()=>KV,encode:()=>MQ,encodeAsync:()=>jQ,endsWith:()=>sl,enum:()=>yE,exactOptional:()=>b$,file:()=>zz,flattenError:()=>Gp,float32:()=>vz,float64:()=>Iz,formatError:()=>Vp,fromJSONSchema:()=>pq,function:()=>Xz,getDiscriminatedOption:()=>SB,getErrorMap:()=>epe,globalRegistry:()=>pn,gt:()=>zi,gte:()=>Sr,guid:()=>zV,hash:()=>bz,hex:()=>yz,hostname:()=>mz,httpUrl:()=>ZV,iban:()=>gz,includes:()=>rl,input:()=>hq,instanceof:()=>iq,int:()=>Wy,int32:()=>wz,int64:()=>kz,intersection:()=>d$,invertCodec:()=>Wz,ipv4:()=>sz,ipv6:()=>az,iso:()=>Df,json:()=>oq,jwt:()=>Az,keyof:()=>Dz,ksuid:()=>iz,lazy:()=>P$,length:()=>Za,literal:()=>Vz,locales:()=>gf,looseObject:()=>Pz,looseRecord:()=>Mz,lowercase:()=>tl,lt:()=>Vi,lte:()=>Cr,mac:()=>oz,map:()=>Lz,maxLength:()=>Wa,maxSize:()=>Eo,memoizer:()=>uf,meta:()=>rq,mime:()=>al,minLength:()=>ws,minSize:()=>qi,multipleOf:()=>yo,nan:()=>Jz,nanoid:()=>XV,nativeEnum:()=>Gz,negative:()=>Oy,never:()=>mE,nonnegative:()=>Ly,nonoptional:()=>k$,nonpositive:()=>My,normalize:()=>cl,null:()=>n$,nullable:()=>wf,nullish:()=>qz,number:()=>ZQ,object:()=>_z,optional:()=>ec,output:()=>mq,overwrite:()=>hi,parse:()=>PQ,parseAsync:()=>UQ,partialRecord:()=>Oz,pipe:()=>Zy,positive:()=>Fy,prefault:()=>S$,preprocess:()=>aq,prettifyError:()=>$S,promise:()=>Kz,properties:()=>ol,property:()=>jy,readonly:()=>D$,record:()=>g$,refine:()=>O$,regex:()=>el,regexes:()=>zr,registry:()=>fy,safeDecode:()=>zQ,safeDecodeAsync:()=>HQ,safeEncode:()=>VQ,safeEncodeAsync:()=>qQ,safeParse:()=>FQ,safeParseAsync:()=>OQ,set:()=>jz,setErrorMap:()=>Xde,size:()=>Ya,slugify:()=>pl,startsWith:()=>il,strictObject:()=>Nz,string:()=>If,stringFormat:()=>hz,stringbool:()=>sq,success:()=>Hz,superRefine:()=>M$,symbol:()=>Rz,templateLiteral:()=>Zz,toJSONSchema:()=>qy,toLowerCase:()=>ll,toUpperCase:()=>dl,toZod:()=>Dp,transform:()=>EE,treeifyError:()=>QS,trim:()=>ul,tuple:()=>f$,uint32:()=>Cz,uint64:()=>Bz,ulid:()=>nz,undefined:()=>xz,union:()=>Il,unknown:()=>Xa,uppercase:()=>nl,url:()=>WV,util:()=>N,uuid:()=>qV,uuidv4:()=>HV,uuidv6:()=>JV,uuidv7:()=>YV,validate:()=>zp,validateAsync:()=>qp,void:()=>$z,withParser:()=>gy,xid:()=>rz,xor:()=>Uz});var Cs={};ei(Cs,{$ZodAny:()=>hB,$ZodArray:()=>IB,$ZodAsyncError:()=>nr,$ZodBase64:()=>iB,$ZodBase64URL:()=>sB,$ZodBigInt:()=>ny,$ZodBigIntFormat:()=>pB,$ZodBoolean:()=>nf,$ZodCIDRv4:()=>nB,$ZodCIDRv6:()=>rB,$ZodCUID:()=>Vk,$ZodCUID2:()=>zk,$ZodCatch:()=>LB,$ZodCheck:()=>yt,$ZodCheckBigIntFormat:()=>mk,$ZodCheckEndsWith:()=>xk,$ZodCheckGreaterThan:()=>Mm,$ZodCheckIncludes:()=>Bk,$ZodCheckLengthEquals:()=>wk,$ZodCheckLessThan:()=>Om,$ZodCheckLowerCase:()=>Sk,$ZodCheckMaxLength:()=>vk,$ZodCheckMaxSize:()=>yk,$ZodCheckMimeType:()=>Tk,$ZodCheckMinLength:()=>Ik,$ZodCheckMinSize:()=>Ek,$ZodCheckMultipleOf:()=>Ak,$ZodCheckNumberFormat:()=>hk,$ZodCheckOverwrite:()=>Dk,$ZodCheckProperties:()=>$k,$ZodCheckProperty:()=>Qk,$ZodCheckRegex:()=>Ck,$ZodCheckSizeEquals:()=>bk,$ZodCheckStartsWith:()=>Rk,$ZodCheckStringFormat:()=>Yu,$ZodCheckUpperCase:()=>kk,$ZodCodec:()=>sf,$ZodCreditCard:()=>aB,$ZodCustom:()=>JB,$ZodCustomStringFormat:()=>lB,$ZodCyclicError:()=>uy,$ZodDate:()=>bB,$ZodDefault:()=>UB,$ZodDiscriminatedUnion:()=>kB,$ZodE164:()=>oB,$ZodEmail:()=>Fk,$ZodEmoji:()=>jk,$ZodEncodeError:()=>ho,$ZodEnum:()=>$B,$ZodError:()=>xS,$ZodExactOptional:()=>NB,$ZodFile:()=>DB,$ZodFunction:()=>qB,$ZodGUID:()=>Pk,$ZodIBAN:()=>cB,$ZodIPv4:()=>Xk,$ZodIPv6:()=>eB,$ZodISODate:()=>Wk,$ZodISODateTime:()=>Yk,$ZodISODuration:()=>Kk,$ZodISOTime:()=>Zk,$ZodIntersection:()=>BB,$ZodJWT:()=>uB,$ZodKSUID:()=>Jk,$ZodLazy:()=>of,$ZodLiteral:()=>TB,$ZodMAC:()=>tB,$ZodMap:()=>xB,$ZodNaN:()=>jB,$ZodNanoID:()=>Gk,$ZodNever:()=>yB,$ZodNonOptional:()=>OB,$ZodNull:()=>AB,$ZodNullable:()=>PB,$ZodNumber:()=>ty,$ZodNumberFormat:()=>dB,$ZodObject:()=>oV,$ZodObjectJIT:()=>wB,$ZodOptional:()=>iy,$ZodPipe:()=>sy,$ZodPrefault:()=>FB,$ZodPreprocess:()=>GB,$ZodPromise:()=>HB,$ZodReadonly:()=>VB,$ZodRealError:()=>rr,$ZodRecord:()=>RB,$ZodRegistry:()=>py,$ZodSet:()=>QB,$ZodString:()=>za,$ZodStringFormat:()=>ot,$ZodSuccess:()=>MB,$ZodSymbol:()=>fB,$ZodTemplateLiteral:()=>zB,$ZodTransform:()=>_B,$ZodTuple:()=>ry,$ZodType:()=>De,$ZodULID:()=>qk,$ZodURL:()=>Lk,$ZodUUID:()=>Uk,$ZodUndefined:()=>gB,$ZodUnion:()=>rf,$ZodUnknown:()=>mB,$ZodVoid:()=>EB,$ZodXID:()=>Hk,$ZodXor:()=>CB,$brand:()=>kS,$constructor:()=>S,$input:()=>ix,$output:()=>rx,Doc:()=>Va,INVALID:()=>Pn,JSONSchema:()=>LV,JSONSchemaGenerator:()=>Hy,NEVER:()=>SS,TimePrecision:()=>hx,URL_BAD_FORMAT:()=>Ok,URL_UNPARSEABLE:()=>Zp,ZodCompileAsyncError:()=>Ai,ZodCompileUnsupportedError:()=>He,_any:()=>Dx,_array:()=>Mx,_base64:()=>_y,_base64url:()=>Ny,_bigint:()=>kx,_boolean:()=>Cx,_catch:()=>Ude,_check:()=>SV,_cidrv4:()=>Ty,_cidrv6:()=>Dy,_coercedBigint:()=>Bx,_coercedBoolean:()=>Sx,_coercedDate:()=>Fx,_coercedNumber:()=>yx,_coercedString:()=>px,_creditCard:()=>gx,_cuid:()=>Sy,_cuid2:()=>ky,_custom:()=>jx,_date:()=>Ux,_decode:()=>Rm,_decodeAsync:()=>Qm,_default:()=>_de,_discriminatedUnion:()=>Ide,_e164:()=>Py,_email:()=>my,_emoji:()=>wy,_encode:()=>Bm,_encodeAsync:()=>xm,_endsWith:()=>sl,_enum:()=>Rde,_file:()=>Lx,_float32:()=>bx,_float64:()=>vx,_gt:()=>zi,_gte:()=>Sr,_guid:()=>yy,_iban:()=>Ax,_includes:()=>rl,_int:()=>Ex,_int32:()=>Ix,_int64:()=>Rx,_intersection:()=>wde,_ipv4:()=>Qy,_ipv6:()=>$y,_isoDate:()=>mf,_isoDateTime:()=>hf,_isoDuration:()=>Ef,_isoTime:()=>yf,_jwt:()=>Uy,_ksuid:()=>xy,_lazy:()=>Lde,_length:()=>Za,_literal:()=>Qde,_lowercase:()=>tl,_lt:()=>Vi,_lte:()=>Cr,_mac:()=>fx,_map:()=>kde,_max:()=>Cr,_maxLength:()=>Wa,_maxSize:()=>Eo,_mime:()=>al,_min:()=>Sr,_minLength:()=>ws,_minSize:()=>qi,_multipleOf:()=>yo,_nan:()=>Ox,_nanoid:()=>Cy,_nativeEnum:()=>xde,_negative:()=>Oy,_never:()=>Nx,_nonnegative:()=>Ly,_nonoptional:()=>Nde,_nonpositive:()=>My,_normalize:()=>cl,_null:()=>Tx,_nullable:()=>Dde,_number:()=>mx,_optional:()=>Tde,_overwrite:()=>hi,_parse:()=>zu,_parseAsync:()=>qu,_pipe:()=>Fde,_positive:()=>Fy,_promise:()=>jde,_properties:()=>ol,_property:()=>jy,_readonly:()=>Ode,_record:()=>Sde,_refine:()=>Gx,_regex:()=>el,_safeDecode:()=>Tm,_safeDecodeAsync:()=>_m,_safeEncode:()=>$m,_safeEncodeAsync:()=>Dm,_safeParse:()=>Hu,_safeParseAsync:()=>Ju,_set:()=>Bde,_size:()=>Ya,_slugify:()=>pl,_startsWith:()=>il,_string:()=>dx,_stringFormat:()=>Ka,_stringbool:()=>Hx,_success:()=>Pde,_superRefine:()=>Vx,_symbol:()=>Qx,_templateLiteral:()=>Mde,_toLowerCase:()=>ll,_toUpperCase:()=>dl,_transform:()=>$de,_trim:()=>ul,_tuple:()=>Cde,_uint32:()=>wx,_uint64:()=>xx,_ulid:()=>By,_undefined:()=>$x,_union:()=>bde,_unknown:()=>_x,_uppercase:()=>nl,_url:()=>Af,_uuid:()=>Ey,_uuidv4:()=>by,_uuidv6:()=>vy,_uuidv7:()=>Iy,_void:()=>Px,_xid:()=>Ry,_xor:()=>vde,base64Charset:()=>Wm,base64urlCharset:()=>tf,canParseURL:()=>Mk,clone:()=>st,compile:()=>cx,compileFn:()=>Ay,config:()=>Pt,createStandardJSONSchemaMethod:()=>fl,createToJSONSchemaMethod:()=>Yx,decode:()=>vce,decodeAsync:()=>wce,describe:()=>zx,encode:()=>bce,encodeAsync:()=>Ice,extractDefs:()=>vo,finalize:()=>Io,flattenError:()=>Gp,formatError:()=>Vp,getDiscriminatedOption:()=>SB,globalConfig:()=>rn,globalRegistry:()=>pn,handleUnrepresentable:()=>Yt,initializeContext:()=>bo,isBackEdge:()=>dy,isRecursiveSchema:()=>ly,isValidBase64:()=>ef,isValidBase64URL:()=>Zm,isValidCIDRv6:()=>Ym,isValidCreditCard:()=>Km,isValidIBAN:()=>Xm,isValidIPv6:()=>Xp,isValidJWT:()=>ey,locales:()=>gf,memoizer:()=>uf,mergeValues:()=>Wu,meta:()=>qx,parse:()=>Sm,parseAsync:()=>km,parseURLObject:()=>rV,prettifyError:()=>$S,process:()=>at,processSchema:()=>at,regexes:()=>zr,registry:()=>fy,safeDecode:()=>Sce,safeDecodeAsync:()=>Bce,safeEncode:()=>Cce,safeEncodeAsync:()=>kce,safeParse:()=>Ace,safeParseAsync:()=>hce,standardProps:()=>zm,stripTabAndNewline:()=>Kp,toDotPath:()=>PG,toJSONSchema:()=>qy,toZod:()=>Dp,treeifyError:()=>QS,urlHostnameOk:()=>Hm,urlProtocolOk:()=>Jm,util:()=>N,validate:()=>zp,validateAsync:()=>qp,validateURL:()=>qm,version:()=>_k,withParser:()=>gy});var N={};ei(N,{BIGINT_FORMAT_RANGES:()=>Fp,CONSTANT_CATCH:()=>wm,Class:()=>AS,NUMBER_FORMAT_RANGES:()=>Up,aborted:()=>Nn,allowsEval:()=>yS,assert:()=>Nae,assertEqual:()=>$ae,assertIs:()=>Dae,assertNever:()=>_ae,assertNotEqual:()=>Tae,assignProp:()=>dn,attachSchema:()=>Op,base64ToUint8Array:()=>QG,base64urlToUint8Array:()=>ece,cached:()=>Lu,captureStackTrace:()=>vm,cleanEnum:()=>Xae,cleanRegex:()=>vs,clone:()=>st,cloneDef:()=>Fae,codePointLength:()=>ja,constantCatch:()=>wS,createTransparentProxy:()=>Vae,defineLazy:()=>hS,defineLazyInternal:()=>Ge,derived:()=>ice,esc:()=>_n,escapeRegex:()=>Vr,explicitlyAborted:()=>vS,extend:()=>Hae,finalizeIssue:()=>tr,floatSafeRemainder:()=>_p,getElementAtPath:()=>Oae,getEnumValues:()=>Ou,getLengthableOrigin:()=>Lp,getParsedType:()=>Gae,getSizableOrigin:()=>Mp,hexToUint8Array:()=>nce,hide:()=>jp,installLazyProp:()=>cce,isObject:()=>La,isPlainObject:()=>Gr,issue:()=>Vu,joinValues:()=>k,jsonStringifyReplacer:()=>Mu,members:()=>IS,merge:()=>Yae,mergeDefs:()=>gi,normalizeParams:()=>q,nullish:()=>bm,numKeys:()=>jae,objectClone:()=>Pae,omit:()=>qae,optionalKeys:()=>bS,own:()=>Ao,parsedType:()=>U,partial:()=>Wae,pick:()=>zae,prefixIssues:()=>er,primitiveTypes:()=>ES,promiseAllObject:()=>Mae,propertyKeyTypes:()=>Pp,randomString:()=>Lae,rawShape:()=>ju,required:()=>Zae,safeExtend:()=>Jae,shallowClone:()=>Np,sizeCaps:()=>Gu,slugify:()=>mS,stringifyPrimitive:()=>P,toZod:()=>Dp,uint8ArrayToBase64:()=>$G,uint8ArrayToBase64url:()=>tce,uint8ArrayToHex:()=>rce,unwrapMessage:()=>Fu});function $ae(e){return e}o($ae,"assertEqual");function Tae(e){return e}o(Tae,"assertNotEqual");function Dp(){return e=>e}o(Dp,"toZod");function Dae(e){}o(Dae,"assertIs");function _ae(e){throw new Error("Unexpected value in exhaustive check")}o(_ae,"assertNever");function Nae(e){}o(Nae,"assert");function Ou(e){let t=Object.values(e).filter(i=>typeof i=="number");return Object.entries(e).filter(([i,r])=>t.indexOf(+i)===-1).map(([i,r])=>r)}o(Ou,"getEnumValues");function k(e,t="|"){return e.map(n=>P(n)).join(t)}o(k,"joinValues");function Mu(e,t){return typeof t=="bigint"?t.toString():t}o(Mu,"jsonStringifyReplacer");var gS=class{static{o(this,"Cached")}constructor(t){this._getter=t,this._value=void 0}get value(){let t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}};function Lu(e){return new gS(e)}o(Lu,"cached");function bm(e){return e==null}o(bm,"nullish");function vs(e){let t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}o(vs,"cleanRegex");function _p(e,t){let n=e/t,i=Math.round(n),r=4*Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-i)<r?0:n-i}o(_p,"floatSafeRemainder");var kG=Symbol("evaluating");function hS(e,t,n){let i;Object.defineProperty(e,t,{get(){if(i!==kG)return i===void 0&&(i=kG,i=n()),i},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}o(hS,"defineLazy");function Pae(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}o(Pae,"objectClone");function dn(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}o(dn,"assignProp");function ju(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}o(ju,"rawShape");function bs(e){return ju(e._zod.def)??e._zod.def.shape}o(bs,"sourceShape");function BG(e,t,n){Object.defineProperty(e,t,{get(){let i=n();return dn(this,t,i),i},enumerable:!0,configurable:!0})}o(BG,"deferProp");function RG(e,t,n){t in e?dn(e,t,n):e[t]=n}o(RG,"putProp");function Ma(e,t,n,i){let r=bs(t);for(let s of n){let a=Object.getOwnPropertyDescriptor(r,s);a.enumerable&&(a.get?BG(e,s,()=>{let c=t._zod.def.shape[s];return i?i(c,s):c}):RG(e,s,i?i(a.value,s):a.value))}}o(Ma,"mirrorShape");function Uae(e,t){for(let n of Reflect.ownKeys(t)){let i=Object.getOwnPropertyDescriptor(t,n);i.enumerable&&(i.get?BG(e,n,()=>t[n]):RG(e,n,i.value))}}o(Uae,"mirrorProps");function gi(...e){let t={};for(let n of e){let i=Object.getOwnPropertyDescriptors(n);Object.assign(t,i)}return Object.defineProperties({},t)}o(gi,"mergeDefs");function Fae(e){return gi(e._zod.def)}o(Fae,"cloneDef");function Oae(e,t){return t?t.reduce((n,i)=>n?.[i],e):e}o(Oae,"getElementAtPath");function Mae(e){let t=Object.keys(e),n=t.map(i=>e[i]);return Promise.all(n).then(i=>{let r={};for(let s=0;s<t.length;s++)r[t[s]]=i[s];return r})}o(Mae,"promiseAllObject");function Lae(e=10){let t="abcdefghijklmnopqrstuvwxyz",n="";for(let i=0;i<e;i++)n+=t[Math.floor(Math.random()*t.length)];return n}o(Lae,"randomString");function _n(e){return JSON.stringify(e)}o(_n,"esc");function mS(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}o(mS,"slugify");var vm="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function La(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(La,"isObject");var yS=Lu(()=>{if(rn.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Gr(e){if(La(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let n=t.prototype;return!(La(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}o(Gr,"isPlainObject");function Np(e){return Gr(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}o(Np,"shallowClone");function jae(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}o(jae,"numKeys");var Gae=o(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}`)}},"getParsedType"),Pp=new Set(["string","number","symbol"]),ES=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Vr(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(Vr,"escapeRegex");function st(e,t,n){let i=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(i._zod.parent=e),i}o(st,"clone");function q(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:o(()=>t,"error")};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:o(()=>t.error,"error")}:t}o(q,"normalizeParams");function Vae(e){let t;return new Proxy({},{get(n,i,r){return t??(t=e()),Reflect.get(t,i,r)},set(n,i,r,s){return t??(t=e()),Reflect.set(t,i,r,s)},has(n,i){return t??(t=e()),Reflect.has(t,i)},deleteProperty(n,i){return t??(t=e()),Reflect.deleteProperty(t,i)},ownKeys(n){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,i){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,i)},defineProperty(n,i,r){return t??(t=e()),Reflect.defineProperty(t,i,r)}})}o(Vae,"createTransparentProxy");function P(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}o(P,"stringifyPrimitive");function bS(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}o(bS,"optionalKeys");var Up={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]},Fp={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function zae(e,t){let n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let s={};return Ma(s,e,Im(e,t)),st(e,gi(n,{shape:s,checks:[]}))}o(zae,"pick");function Im(e,t){let n=bs(e),i=[];for(let r of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,r)?.enumerable)throw new Error(`Unrecognized key: "${String(r)}"`);t[r]&&i.push(r)}return i}o(Im,"maskedKeys");function qae(e,t){let n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let s=new Set(Im(e,t)),a={};return Ma(a,e,Reflect.ownKeys(bs(e)).filter(c=>!s.has(c))),st(e,gi(n,{shape:a,checks:[]}))}o(qae,"omit");function Hae(e,t){if(!Gr(t))throw new Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0){let r=bs(e);for(let s of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(r,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return st(e,gi(e._zod.def,{shape:xG(e,t)}))}o(Hae,"extend");function xG(e,t){let n={};return Ma(n,e,Reflect.ownKeys(bs(e))),Uae(n,t),n}o(xG,"extended");function Jae(e,t){if(!Gr(t))throw new Error("Invalid input to safeExtend: expected a plain object");return st(e,gi(e._zod.def,{shape:xG(e,t)}))}o(Jae,"safeExtend");function Yae(e,t){if(!t?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let n={};Ma(n,e,Reflect.ownKeys(bs(e))),Ma(n,t,Reflect.ownKeys(bs(t)));let i=gi(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return st(e,i)}o(Yae,"merge");function Wae(e,t,n,i="partial"){let s=t._zod.def.checks;if(s&&s.length>0)throw new Error(`.${i}() cannot be used on object schemas containing refinements`);let c=n?new Set(Im(t,n)):void 0,u={};return Ma(u,t,Reflect.ownKeys(bs(t)),e&&((l,p)=>c&&!c.has(p)?l:new e({type:"optional",innerType:l}))),st(t,gi(t._zod.def,{shape:u,checks:[]}))}o(Wae,"partial");function Zae(e,t,n){let i=n?new Set(Im(t,n)):void 0,r={};return Ma(r,t,Reflect.ownKeys(bs(t)),(s,a)=>i&&!i.has(a)?s:new e({type:"nonoptional",innerType:s})),st(t,gi(t._zod.def,{shape:r}))}o(Zae,"required");function Nn(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}o(Nn,"aborted");function vS(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}o(vS,"explicitlyAborted");function er(e,t){return t.map(n=>{var i;return(i=n).path??(i.path=[]),n.path.unshift(e),n})}o(er,"prefixIssues");function Fu(e){return typeof e=="string"?e:e?.message}o(Fu,"unwrapMessage");function Gu(e){let t=[];for(let n of e??[]){let i=n._zod.def;if(!/_(length|size)$|_equals$/.test(i.check))break;let r=i.maximum??i.length??i.size;r>=0&&t.push([r,n])}return t}o(Gu,"sizeCaps");function Op(e,t,n){var i;for(let r=t;r<e.length;r++)(i=e[r]).schema??(i.schema=n)}o(Op,"attachSchema");function tr(e,t,n){var i;let r=e.inst?._zod?.traits;r?.has("$ZodType")&&(r.has("$ZodCheck")?(i=e).schema??(i.schema=e.inst):e.schema=e.inst);let s=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,a=e.message?e.message:Fu(e.inst?._zod.def?.error?.(e))??Fu(s?.(e))??Fu(t?.error?.(e))??Fu(n.customError?.(e))??Fu(n.localeError?.(e))??"Invalid input",c={};for(let u of Object.keys(e))u==="inst"||u==="schema"||u==="continue"||u==="input"||u==="__proto__"||(c[u]=e[u]);return c.path??(c.path=[]),c.message=a,t?.reportInput&&(c.input=e.input),c}o(tr,"finalizeIssue");function Mp(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}o(Mp,"getSizableOrigin");var Kae=/[\uD800-\uDBFF]/;function ja(e){let t=e.length;if(!Kae.test(e))return t;let n=t;for(let i=0;i<t-1;i++)(e.charCodeAt(i)&64512)===55296&&(e.charCodeAt(i+1)&64512)===56320&&(n--,i++);return n}o(ja,"codePointLength");function Lp(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}o(Lp,"getLengthableOrigin");function U(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let n=e;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&"constructor"in n&&n.constructor)return n.constructor.name}}return t}o(U,"parsedType");function Vu(...e){let[t,n,i]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:i}:{...t}}o(Vu,"issue");function Xae(e){return Object.entries(e).filter(([t,n])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}o(Xae,"cleanEnum");function QG(e){let t=atob(e),n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=t.charCodeAt(i);return n}o(QG,"base64ToUint8Array");function $G(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}o($G,"uint8ArrayToBase64");function ece(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-t.length%4)%4);return QG(t+n)}o(ece,"base64urlToUint8Array");function tce(e){return $G(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}o(tce,"uint8ArrayToBase64url");function nce(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let n=new Uint8Array(t.length/2);for(let i=0;i<t.length;i+=2)n[i/2]=Number.parseInt(t.slice(i,i+2),16);return n}o(nce,"hexToUint8Array");function rce(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}o(rce,"uint8ArrayToHex");var AS=class{static{o(this,"Class")}constructor(...t){}};function IS(e,t){for(let n in t){let i=Object.getOwnPropertyDescriptor(t,n);i.get?Object.defineProperty(e,n,{...i,enumerable:!1}):sce(e,n,i.value)}}o(IS,"members");function Ao(e,t,n,i=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:i,value:n}),n}o(Ao,"own");function jp(e,t,n){return Ao(e,t,n,!1)}o(jp,"hide");function ice(e,t){for(let n in e){let i=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return Ao(this,n,i(this))},set(r){Ao(this,n,r)}})}return t}o(ice,"derived");function sce(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:Ao(this,t,n.bind(this))},set(i){Ao(this,t,i)}})}o(sce,"defineBound");function oce(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}o(oce,"claim");var fS,go=!1,ace={configurable:!0,get(){go=!0}};function Ge(e,t,n){let i=Object.getPrototypeOf(e._zod);if(t in i&&fS!==e._zod){fS=void 0;return}fS=e._zod,Object.defineProperty(i,t,{configurable:!0,get(){Object.defineProperty(this,t,ace);let r=go;go=!1;try{let s=n(this);return go?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:s}),go=go||r,s}catch(s){throw delete this[t],go=go||r,s}},set(r){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r})}})}o(Ge,"defineLazyInternal");function cce(e,t,n,i){let r=oce(e,t);r&&Object.defineProperty(r,t,{configurable:!0,get(){let s={configurable:!0,writable:!0,enumerable:i,value:void 0};return Object.defineProperty(this,t,s),s.value=n(this),Object.defineProperty(this,t,s),s.value},set(s){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:i,value:s})}})}o(cce,"installLazyProp");var wm="~constantCatch";function wS(e){let t=o(()=>e,"fn");return t[wm]=!0,t}o(wS,"constantCatch");var TG,SS=Object.freeze({status:"aborted"}),CS={value:void 0,enumerable:!1},DG="captureStackTrace"in Error?Error:null;function uce(e){let t=DG;if(t){let n=t.stackTraceLimit;if(typeof n=="number"){try{t.stackTraceLimit=0}catch{return DG=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}o(uce,"newError");function S(e,t,n,i){let r={};function s(A){this.def=A,this.constr=f,this.traits=new Set}o(s,"Internals"),s.prototype=r;let a=n,c=a&&new WeakSet;function u(A,h){if(A._zod){if(A._zod.traits.has(e))return}else{CS.value=new s(h);try{Object.defineProperty(A,"_zod",CS)}finally{CS.value=void 0}}if(A._zod.traits.add(e),t(A,h),c){let E=Object.getPrototypeOf(A),b=A._zod.constr.prototype,v=E;for(;v&&v!==b;)v=Object.getPrototypeOf(v);let I=v??E;c.has(I)||(c.add(I),IS(I,a))}let m=f.prototype;for(let E in m)Object.prototype.hasOwnProperty.call(m,E)&&(E in A||(A[E]=m[E].bind(A)))}o(u,"init");let l=i?.Parent??Object;class p extends l{static{o(this,"Definition")}}Object.defineProperty(p,"name",{value:e});function f(A){let h=i?.Parent?uce(p):this;u(h,A);let m=h._zod.deferred;if(m){for(let b of m)b();h._zod.deferred=void 0}let E=globalThis.__zod_globalConfig?.postProcessor;return E&&E(h),h}return o(f,"_"),Object.defineProperty(f,"init",{value:u}),Object.defineProperty(f,Symbol.hasInstance,{value:o(A=>i?.Parent&&A instanceof i.Parent?!0:A?._zod?.traits?.has(e),"value")}),Object.defineProperty(f,"name",{value:e}),f}o(S,"$constructor");var kS=Symbol("zod_brand"),nr=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},ho=class extends Error{static{o(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(TG=globalThis).__zod_globalConfig??(TG.__zod_globalConfig={});var rn=globalThis.__zod_globalConfig;function Pt(e){return e&&Object.assign(rn,e),rn}o(Pt,"config");function lce(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,Mu,2)),e.message}o(lce,"_getMessage");function dce(e){this._zod.message=e}o(dce,"_setMessage");var pce={get:lce,set:dce,enumerable:!0,configurable:!0},RS={value:void 0,enumerable:!1},_G=new WeakSet([Object.prototype,Error.prototype]),NG=o((e,t)=>{e.name="$ZodError",RS.value=t,Object.defineProperty(e,"issues",RS),RS.value=void 0,Object.defineProperty(e,"message",pce);let n=Object.getPrototypeOf(e);_G.has(n)||(_G.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let i=o(()=>this.message,"value");return Object.defineProperty(this,"toString",{value:i,configurable:!0,writable:!0}),i},set(i){Object.defineProperty(this,"toString",{value:i,configurable:!0,writable:!0})}}))},"initializer"),xS=S("$ZodError",NG),rr=S("$ZodError",NG,void 0,{Parent:Error});function fce(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t==="__proto__"?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}o(fce,"node");function Gp(e,t=n=>n.message){let n={},i=[];for(let r of e.issues)r.path.length>0?fce(n,r.path[0],()=>[]).push(t(r)):i.push(t(r));return{formErrors:i,fieldErrors:n}}o(Gp,"flattenError");function Vp(e,t=n=>n.message){let n={_errors:[]},i=o((r,s=[])=>{for(let a of r.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(c=>i({issues:c},[...s,...a.path]));else if(a.code==="invalid_key")i({issues:a.issues},[...s,...a.path]);else if(a.code==="invalid_element")i({issues:a.issues},[...s,...a.path]);else{let c=[...s,...a.path];if(c.length===0)n._errors.push(t(a));else{let u=n,l=0;for(;l<c.length;){let p=c[l],f=l===c.length-1;if(p==="_errors"){f&&u._errors.push(t(a)),l++;continue}Object.prototype.hasOwnProperty.call(u,p)||Object.defineProperty(u,p,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let A=u[p];f&&A._errors.push(t(a)),u=A,l++}}}},"processError");return i(e),n}o(Vp,"formatError");function QS(e,t=n=>n.message){let n={errors:[]},i=o((r,s=[])=>{var a;for(let c of r.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(u=>i({issues:u},[...s,...c.path]));else if(c.code==="invalid_key")i({issues:c.issues},[...s,...c.path]);else if(c.code==="invalid_element")i({issues:c.issues},[...s,...c.path]);else{let u=[...s,...c.path];if(u.length===0){n.errors.push(t(c));continue}let l=n,p=0;for(;p<u.length;){let f=u[p],A=p===u.length-1;typeof f=="string"?(l.properties??(l.properties={}),Object.prototype.hasOwnProperty.call(l.properties,f)||Object.defineProperty(l.properties,f,{value:{errors:[]},enumerable:!0,writable:!0,configurable:!0}),l=l.properties[f]):(l.items??(l.items=[]),(a=l.items)[f]??(a[f]={errors:[]}),l=l.items[f]),A&&l.errors.push(t(c)),p++}}},"processError");return i(e),n}o(QS,"treeifyError");function PG(e){let t=[],n=e.map(i=>typeof i=="object"?i.key:i);for(let i of n)typeof i=="number"?t.push(`[${i}]`):typeof i=="symbol"?t.push(`[${JSON.stringify(String(i))}]`):/[^\w$]/.test(i)?t.push(`[${JSON.stringify(i)}]`):(t.length&&t.push("."),t.push(i));return t.join("")}o(PG,"toDotPath");function $S(e){let t=[],n=[...e.issues].sort((i,r)=>(i.path??[]).length-(r.path??[]).length);for(let i of n)t.push(`\u2716 ${i.message}`),i.path?.length&&t.push(` \u2192 at ${PG(i.path)}`);return t.join(`
142
+ `).map(a=>a.trim()).filter(Boolean),i=n.filter(a=>!t.test(a)),r=i.length?i:n;return[...r].reverse().find(a=>/(error|warning|problem|✖|✗|✘|fail|not listed|cannot|denied)/i.test(a))??r[r.length-1]??"(no output)"}o(qie,"hookSummary");function jj(e){if(!/\bhook\b|husky|pre-commit|lint-staged/i.test(e))return;let t=qie(e),n=ue().staged.commitHook(/husky\s*[->]\s*([\w-]+)\s+(?:script|hook)\b/i.exec(yu(e))?.[1]);return/\(code 127\)|exit code 127/i.test(e)||/command not found|: not found$/i.test(t)?ue().staged.commitHookCouldNotRun(n,t):ue().staged.commitRefusedByHook(n,t)}o(jj,"hookRefusal");var d={};ei(d,{BRAND:()=>yse,DIRTY:()=>ma,EMPTY_PATH:()=>Wie,INVALID:()=>Ce,NEVER:()=>noe,OK:()=>vn,ParseStatus:()=>un,Schema:()=>Ve,ZodAny:()=>so,ZodArray:()=>As,ZodBigInt:()=>Ea,ZodBoolean:()=>ba,ZodBranded:()=>ap,ZodCatch:()=>$a,ZodDate:()=>va,ZodDefault:()=>Qa,ZodDiscriminatedUnion:()=>Yh,ZodEffects:()=>Mr,ZodEnum:()=>Ra,ZodError:()=>Wn,ZodFirstPartyTypeKind:()=>xe,ZodFunction:()=>Zh,ZodIntersection:()=>Sa,ZodIssueCode:()=>G,ZodLazy:()=>ka,ZodLiteral:()=>Ba,ZodMap:()=>Cu,ZodNaN:()=>ku,ZodNativeEnum:()=>xa,ZodNever:()=>li,ZodNull:()=>wa,ZodNullable:()=>Pi,ZodNumber:()=>ya,ZodObject:()=>Zn,ZodOptional:()=>Fr,ZodParsedType:()=>re,ZodPipeline:()=>cp,ZodPromise:()=>oo,ZodReadonly:()=>Ta,ZodRecord:()=>Wh,ZodSchema:()=>Ve,ZodSet:()=>Su,ZodString:()=>io,ZodSymbol:()=>Iu,ZodTransformer:()=>Mr,ZodTuple:()=>Ni,ZodType:()=>Ve,ZodUndefined:()=>Ia,ZodUnion:()=>Ca,ZodUnknown:()=>gs,ZodVoid:()=>wu,addIssueToContext:()=>X,any:()=>Bse,array:()=>$se,bigint:()=>Ise,boolean:()=>Xj,coerce:()=>toe,custom:()=>Wj,date:()=>wse,datetimeRegex:()=>Jj,defaultErrorMap:()=>ps,discriminatedUnion:()=>Nse,effect:()=>Hse,enum:()=>Vse,function:()=>Lse,getErrorMap:()=>Eu,getParsedType:()=>_i,instanceof:()=>bse,intersection:()=>Pse,isAborted:()=>Hh,isAsync:()=>bu,isDirty:()=>Jh,isValid:()=>ro,late:()=>Ese,lazy:()=>jse,literal:()=>Gse,makeIssue:()=>op,map:()=>Ose,nan:()=>vse,nativeEnum:()=>zse,never:()=>xse,null:()=>kse,nullable:()=>Yse,number:()=>Kj,object:()=>Tse,objectUtil:()=>BC,oboolean:()=>eoe,onumber:()=>Xse,optional:()=>Jse,ostring:()=>Kse,pipeline:()=>Zse,preprocess:()=>Wse,promise:()=>qse,quotelessJson:()=>Hie,record:()=>Fse,set:()=>Mse,setErrorMap:()=>Yie,strictObject:()=>Dse,string:()=>Zj,symbol:()=>Cse,transformer:()=>Hse,tuple:()=>Use,undefined:()=>Sse,union:()=>_se,unknown:()=>Rse,util:()=>Ye,void:()=>Qse});var Ye;(function(e){e.assertEqual=r=>{};function t(r){}o(t,"assertIs"),e.assertIs=t;function n(r){throw new Error}o(n,"assertNever"),e.assertNever=n,e.arrayToEnum=r=>{let s={};for(let a of r)s[a]=a;return s},e.getValidEnumValues=r=>{let s=e.objectKeys(r).filter(c=>typeof r[r[c]]!="number"),a={};for(let c of s)a[c]=r[c];return e.objectValues(a)},e.objectValues=r=>e.objectKeys(r).map(function(s){return r[s]}),e.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{let s=[];for(let a in r)Object.prototype.hasOwnProperty.call(r,a)&&s.push(a);return s},e.find=(r,s)=>{for(let a of r)if(s(a))return a},e.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function i(r,s=" | "){return r.map(a=>typeof a=="string"?`'${a}'`:a).join(s)}o(i,"joinValues"),e.joinValues=i,e.jsonStringifyReplacer=(r,s)=>typeof s=="bigint"?s.toString():s})(Ye||(Ye={}));var BC;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(BC||(BC={}));var re=Ye.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),_i=o(e=>{switch(typeof e){case"undefined":return re.undefined;case"string":return re.string;case"number":return Number.isNaN(e)?re.nan:re.number;case"boolean":return re.boolean;case"function":return re.function;case"bigint":return re.bigint;case"symbol":return re.symbol;case"object":return Array.isArray(e)?re.array:e===null?re.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?re.promise:typeof Map<"u"&&e instanceof Map?re.map:typeof Set<"u"&&e instanceof Set?re.set:typeof Date<"u"&&e instanceof Date?re.date:re.object;default:return re.unknown}},"getParsedType");var G=Ye.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"]),Hie=o(e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),Wn=class e extends Error{static{o(this,"ZodError")}get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){let n=t||function(s){return s.message},i={_errors:[]},r=o(s=>{for(let a of s.issues)if(a.code==="invalid_union")a.unionErrors.map(r);else if(a.code==="invalid_return_type")r(a.returnTypeError);else if(a.code==="invalid_arguments")r(a.argumentsError);else if(a.path.length===0)i._errors.push(n(a));else{let c=i,u=0;for(;u<a.path.length;){let l=a.path[u],p=u===a.path.length-1;if(l==="_errors"){p&&c._errors.push(n(a)),u++;continue}Object.prototype.hasOwnProperty.call(c,l)||(l==="__proto__"?Object.defineProperty(c,l,{value:{_errors:[]},writable:!0,enumerable:!0,configurable:!0}):c[l]={_errors:[]}),c=c[l],p&&c._errors.push(n(a)),u++}}},"processError");return r(this),i}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,Ye.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){let n=Object.create(null),i=[];for(let r of this.issues)if(r.path.length>0){let s=r.path[0];n[s]=n[s]||[],n[s].push(t(r))}else i.push(t(r));return{formErrors:i,fieldErrors:n}}get formErrors(){return this.flatten()}};Wn.create=e=>new Wn(e);var Jie=o((e,t)=>{let n;switch(e.code){case G.invalid_type:e.received===re.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case G.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Ye.jsonStringifyReplacer)}`;break;case G.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ye.joinValues(e.keys,", ")}`;break;case G.invalid_union:n="Invalid input";break;case G.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ye.joinValues(e.options)}`;break;case G.invalid_enum_value:n=`Invalid enum value. Expected ${Ye.joinValues(e.options)}, received '${e.received}'`;break;case G.invalid_arguments:n="Invalid function arguments";break;case G.invalid_return_type:n="Invalid function return type";break;case G.invalid_date:n="Invalid date";break;case G.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Ye.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case G.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case G.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case G.custom:n="Invalid input";break;case G.invalid_intersection_types:n="Intersection results could not be merged";break;case G.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case G.not_finite:n="Number must be finite";break;default:n=t.defaultError,Ye.assertNever(e)}return{message:n}},"errorMap"),ps=Jie;var Gj=ps;function Yie(e){Gj=e}o(Yie,"setErrorMap");function Eu(){return Gj}o(Eu,"getErrorMap");var op=o(e=>{let{data:t,path:n,errorMaps:i,issueData:r}=e,s=[...n,...r.path||[]],a={...r,path:s};if(r.message!==void 0)return{...r,path:s,message:r.message};let c="",u=i.filter(l=>!!l).slice().reverse();for(let l of u)c=l(a,{data:t,defaultError:c}).message;return{...r,path:s,message:c}},"makeIssue"),Wie=[];function X(e,t){let n=Eu(),i=op({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===ps?void 0:ps].filter(r=>!!r)});e.common.issues.push(i)}o(X,"addIssueToContext");var un=class e{static{o(this,"ParseStatus")}constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){let i=[];for(let r of n){if(r.status==="aborted")return Ce;r.status==="dirty"&&t.dirty(),i.push(r.value)}return{status:t.value,value:i}}static async mergeObjectAsync(t,n){let i=[];for(let r of n){let s=await r.key,a=await r.value;i.push({key:s,value:a})}return e.mergeObjectSync(t,i)}static mergeObjectSync(t,n){let i={};for(let r of n){let{key:s,value:a}=r;if(s.status==="aborted"||a.status==="aborted")return Ce;s.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),s.value!=="__proto__"&&(typeof a.value<"u"||r.alwaysSet)&&(i[s.value]=a.value)}return{status:t.value,value:i}}},Ce=Object.freeze({status:"aborted"}),ma=o(e=>({status:"dirty",value:e}),"DIRTY"),vn=o(e=>({status:"valid",value:e}),"OK"),Hh=o(e=>e.status==="aborted","isAborted"),Jh=o(e=>e.status==="dirty","isDirty"),ro=o(e=>e.status==="valid","isValid"),bu=o(e=>typeof Promise<"u"&&e instanceof Promise,"isAsync");var de;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(de||(de={}));var Or=class{static{o(this,"ParseInputLazyPath")}constructor(t,n,i,r){this._cachedPath=[],this.parent=t,this.data=n,this._path=i,this._key=r}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}},Vj=o((e,t)=>{if(ro(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 n=new Wn(e.common.issues);return this._error=n,this._error}}},"handleResult");function Fe(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:i,description:r}=e;if(t&&(n||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:r}:{errorMap:o((a,c)=>{let{message:u}=e;return a.code==="invalid_enum_value"?{message:u??c.defaultError}:typeof c.data>"u"?{message:u??i??c.defaultError}:a.code!=="invalid_type"?{message:c.defaultError}:{message:u??n??c.defaultError}},"customMap"),description:r}}o(Fe,"processCreateParams");var Ve=class{static{o(this,"ZodType")}get description(){return this._def.description}_getType(t){return _i(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:_i(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new un,ctx:{common:t.parent.common,data:t.data,parsedType:_i(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let n=this._parse(t);if(bu(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){let n=this._parse(t);return Promise.resolve(n)}parse(t,n){let i=this.safeParse(t,n);if(i.success)return i.data;throw i.error}safeParse(t,n){let i={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:_i(t)},r=this._parseSync({data:t,path:i.path,parent:i});return Vj(i,r)}"~validate"(t){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:_i(t)};if(!this["~standard"].async)try{let i=this._parseSync({data:t,path:[],parent:n});return ro(i)?{value:i.value}:{issues:n.common.issues}}catch(i){i?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(i=>ro(i)?{value:i.value}:{issues:n.common.issues})}async parseAsync(t,n){let i=await this.safeParseAsync(t,n);if(i.success)return i.data;throw i.error}async safeParseAsync(t,n){let i={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:_i(t)},r=this._parse({data:t,path:i.path,parent:i}),s=await(bu(r)?r:Promise.resolve(r));return Vj(i,s)}refine(t,n){let i=o(r=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(r):n,"getIssueProperties");return this._refinement((r,s)=>{let a=t(r),c=o(()=>s.addIssue({code:G.custom,...i(r)}),"setError");return typeof Promise<"u"&&a instanceof Promise?a.then(u=>u?!0:(c(),!1)):a?!0:(c(),!1)})}refinement(t,n){return this._refinement((i,r)=>t(i)?!0:(r.addIssue(typeof n=="function"?n(i,r):n),!1))}_refinement(t){return new Mr({schema:this,typeName:xe.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:o(n=>this["~validate"](n),"validate")}}optional(){return Fr.create(this,this._def)}nullable(){return Pi.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return As.create(this)}promise(){return oo.create(this,this._def)}or(t){return Ca.create([this,t],this._def)}and(t){return Sa.create(this,t,this._def)}transform(t){return new Mr({...Fe(this._def),schema:this,typeName:xe.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let n=typeof t=="function"?t:()=>t;return new Qa({...Fe(this._def),innerType:this,defaultValue:n,typeName:xe.ZodDefault})}brand(){return new ap({typeName:xe.ZodBranded,type:this,...Fe(this._def)})}catch(t){let n=typeof t=="function"?t:()=>t;return new $a({...Fe(this._def),innerType:this,catchValue:n,typeName:xe.ZodCatch})}describe(t){let n=this.constructor;return new n({...this._def,description:t})}pipe(t){return cp.create(this,t)}readonly(){return Ta.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Zie=/^c[^\s-]{8,}$/i,Kie=/^[0-9a-z]+$/,Xie=/^[0-9A-HJKMNP-TV-Z]{26}$/i,ese=/^[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,tse=/^[a-z0-9_-]{21}$/i,nse=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,rse=/^[-+]?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)?)??$/,ise=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,sse="^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$",RC,ose=/^(?:(?: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])$/,ase=/^(?:(?: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])$/,cse=/^(([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]))$/,use=/^(([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])$/,lse=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,dse=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,qj="((\\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])))",pse=new RegExp(`^${qj}$`);function Hj(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);let n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}o(Hj,"timeRegexSource");function fse(e){return new RegExp(`^${Hj(e)}$`)}o(fse,"timeRegex");function Jj(e){let t=`${qj}T${Hj(e)}`,n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}o(Jj,"datetimeRegex");function gse(e,t){return!!((t==="v4"||!t)&&ose.test(e)||(t==="v6"||!t)&&cse.test(e))}o(gse,"isValidIP");function Ase(e,t){if(!nse.test(e))return!1;try{let[n]=e.split(".");if(!n)return!1;let i=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),r=JSON.parse(atob(i));return!(typeof r!="object"||r===null||"typ"in r&&r?.typ!=="JWT"||!r.alg||t&&r.alg!==t)}catch{return!1}}o(Ase,"isValidJWT");function hse(e,t){return!!((t==="v4"||!t)&&ase.test(e)||(t==="v6"||!t)&&use.test(e))}o(hse,"isValidCidr");var io=class e extends Ve{static{o(this,"ZodString")}_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==re.string){let s=this._getOrReturnCtx(t);return X(s,{code:G.invalid_type,expected:re.string,received:s.parsedType}),Ce}let i=new un,r;for(let s of this._def.checks)if(s.kind==="min")t.data.length<s.value&&(r=this._getOrReturnCtx(t,r),X(r,{code:G.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),i.dirty());else if(s.kind==="max")t.data.length>s.value&&(r=this._getOrReturnCtx(t,r),X(r,{code:G.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),i.dirty());else if(s.kind==="length"){let a=t.data.length>s.value,c=t.data.length<s.value;(a||c)&&(r=this._getOrReturnCtx(t,r),a?X(r,{code:G.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):c&&X(r,{code:G.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),i.dirty())}else if(s.kind==="email")ise.test(t.data)||(r=this._getOrReturnCtx(t,r),X(r,{validation:"email",code:G.invalid_string,message:s.message}),i.dirty());else if(s.kind==="emoji")RC||(RC=new RegExp(sse,"u")),RC.test(t.data)||(r=this._getOrReturnCtx(t,r),X(r,{validation:"emoji",code:G.invalid_string,message:s.message}),i.dirty());else if(s.kind==="uuid")ese.test(t.data)||(r=this._getOrReturnCtx(t,r),X(r,{validation:"uuid",code:G.invalid_string,message:s.message}),i.dirty());else if(s.kind==="nanoid")tse.test(t.data)||(r=this._getOrReturnCtx(t,r),X(r,{validation:"nanoid",code:G.invalid_string,message:s.message}),i.dirty());else if(s.kind==="cuid")Zie.test(t.data)||(r=this._getOrReturnCtx(t,r),X(r,{validation:"cuid",code:G.invalid_string,message:s.message}),i.dirty());else if(s.kind==="cuid2")Kie.test(t.data)||(r=this._getOrReturnCtx(t,r),X(r,{validation:"cuid2",code:G.invalid_string,message:s.message}),i.dirty());else if(s.kind==="ulid")Xie.test(t.data)||(r=this._getOrReturnCtx(t,r),X(r,{validation:"ulid",code:G.invalid_string,message:s.message}),i.dirty());else if(s.kind==="url")try{new URL(t.data)}catch{r=this._getOrReturnCtx(t,r),X(r,{validation:"url",code:G.invalid_string,message:s.message}),i.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(t.data)||(r=this._getOrReturnCtx(t,r),X(r,{validation:"regex",code:G.invalid_string,message:s.message}),i.dirty())):s.kind==="trim"?t.data=t.data.trim():s.kind==="includes"?t.data.includes(s.value,s.position)||(r=this._getOrReturnCtx(t,r),X(r,{code:G.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),i.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)||(r=this._getOrReturnCtx(t,r),X(r,{code:G.invalid_string,validation:{startsWith:s.value},message:s.message}),i.dirty()):s.kind==="endsWith"?t.data.endsWith(s.value)||(r=this._getOrReturnCtx(t,r),X(r,{code:G.invalid_string,validation:{endsWith:s.value},message:s.message}),i.dirty()):s.kind==="datetime"?Jj(s).test(t.data)||(r=this._getOrReturnCtx(t,r),X(r,{code:G.invalid_string,validation:"datetime",message:s.message}),i.dirty()):s.kind==="date"?pse.test(t.data)||(r=this._getOrReturnCtx(t,r),X(r,{code:G.invalid_string,validation:"date",message:s.message}),i.dirty()):s.kind==="time"?fse(s).test(t.data)||(r=this._getOrReturnCtx(t,r),X(r,{code:G.invalid_string,validation:"time",message:s.message}),i.dirty()):s.kind==="duration"?rse.test(t.data)||(r=this._getOrReturnCtx(t,r),X(r,{validation:"duration",code:G.invalid_string,message:s.message}),i.dirty()):s.kind==="ip"?gse(t.data,s.version)||(r=this._getOrReturnCtx(t,r),X(r,{validation:"ip",code:G.invalid_string,message:s.message}),i.dirty()):s.kind==="jwt"?Ase(t.data,s.alg)||(r=this._getOrReturnCtx(t,r),X(r,{validation:"jwt",code:G.invalid_string,message:s.message}),i.dirty()):s.kind==="cidr"?hse(t.data,s.version)||(r=this._getOrReturnCtx(t,r),X(r,{validation:"cidr",code:G.invalid_string,message:s.message}),i.dirty()):s.kind==="base64"?lse.test(t.data)||(r=this._getOrReturnCtx(t,r),X(r,{validation:"base64",code:G.invalid_string,message:s.message}),i.dirty()):s.kind==="base64url"?dse.test(t.data)||(r=this._getOrReturnCtx(t,r),X(r,{validation:"base64url",code:G.invalid_string,message:s.message}),i.dirty()):Ye.assertNever(s);return{status:i.value,value:t.data}}_regex(t,n,i){return this.refinement(r=>t.test(r),{validation:n,code:G.invalid_string,...de.errToObj(i)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...de.errToObj(t)})}url(t){return this._addCheck({kind:"url",...de.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...de.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...de.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...de.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...de.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...de.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...de.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...de.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...de.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...de.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...de.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...de.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,...de.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,...de.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...de.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...de.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...de.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...de.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...de.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...de.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...de.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...de.errToObj(n)})}nonempty(t){return this.min(1,de.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 n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}};io.create=e=>new io({checks:[],typeName:xe.ZodString,coerce:e?.coerce??!1,...Fe(e)});function mse(e,t){let n=(e.toString().split(".")[1]||"").length,i=(t.toString().split(".")[1]||"").length,r=n>i?n:i,s=Number.parseInt(e.toFixed(r).replace(".","")),a=Number.parseInt(t.toFixed(r).replace(".",""));return s%a/10**r}o(mse,"floatSafeRemainder");var ya=class e extends Ve{static{o(this,"ZodNumber")}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)!==re.number){let s=this._getOrReturnCtx(t);return X(s,{code:G.invalid_type,expected:re.number,received:s.parsedType}),Ce}let i,r=new un;for(let s of this._def.checks)s.kind==="int"?Ye.isInteger(t.data)||(i=this._getOrReturnCtx(t,i),X(i,{code:G.invalid_type,expected:"integer",received:"float",message:s.message}),r.dirty()):s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(i=this._getOrReturnCtx(t,i),X(i,{code:G.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),r.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(i=this._getOrReturnCtx(t,i),X(i,{code:G.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),r.dirty()):s.kind==="multipleOf"?mse(t.data,s.value)!==0&&(i=this._getOrReturnCtx(t,i),X(i,{code:G.not_multiple_of,multipleOf:s.value,message:s.message}),r.dirty()):s.kind==="finite"?Number.isFinite(t.data)||(i=this._getOrReturnCtx(t,i),X(i,{code:G.not_finite,message:s.message}),r.dirty()):Ye.assertNever(s);return{status:r.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,de.toString(n))}gt(t,n){return this.setLimit("min",t,!1,de.toString(n))}lte(t,n){return this.setLimit("max",t,!0,de.toString(n))}lt(t,n){return this.setLimit("max",t,!1,de.toString(n))}setLimit(t,n,i,r){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:i,message:de.toString(r)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:de.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:de.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:de.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:de.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:de.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:de.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:de.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:de.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:de.toString(t)})}get minValue(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Ye.isInteger(t.value))}get isFinite(){let t=null,n=null;for(let i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(n===null||i.value>n)&&(n=i.value):i.kind==="max"&&(t===null||i.value<t)&&(t=i.value)}return Number.isFinite(n)&&Number.isFinite(t)}};ya.create=e=>new ya({checks:[],typeName:xe.ZodNumber,coerce:e?.coerce||!1,...Fe(e)});var Ea=class e extends Ve{static{o(this,"ZodBigInt")}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)!==re.bigint)return this._getInvalidInput(t);let i,r=new un;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(i=this._getOrReturnCtx(t,i),X(i,{code:G.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),r.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(i=this._getOrReturnCtx(t,i),X(i,{code:G.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),r.dirty()):s.kind==="multipleOf"?t.data%s.value!==BigInt(0)&&(i=this._getOrReturnCtx(t,i),X(i,{code:G.not_multiple_of,multipleOf:s.value,message:s.message}),r.dirty()):Ye.assertNever(s);return{status:r.value,value:t.data}}_getInvalidInput(t){let n=this._getOrReturnCtx(t);return X(n,{code:G.invalid_type,expected:re.bigint,received:n.parsedType}),Ce}gte(t,n){return this.setLimit("min",t,!0,de.toString(n))}gt(t,n){return this.setLimit("min",t,!1,de.toString(n))}lte(t,n){return this.setLimit("max",t,!0,de.toString(n))}lt(t,n){return this.setLimit("max",t,!1,de.toString(n))}setLimit(t,n,i,r){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:i,message:de.toString(r)}]})}_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:de.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:de.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:de.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:de.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:de.toString(n)})}get minValue(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}};Ea.create=e=>new Ea({checks:[],typeName:xe.ZodBigInt,coerce:e?.coerce??!1,...Fe(e)});var ba=class extends Ve{static{o(this,"ZodBoolean")}_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==re.boolean){let i=this._getOrReturnCtx(t);return X(i,{code:G.invalid_type,expected:re.boolean,received:i.parsedType}),Ce}return vn(t.data)}};ba.create=e=>new ba({typeName:xe.ZodBoolean,coerce:e?.coerce||!1,...Fe(e)});var va=class e extends Ve{static{o(this,"ZodDate")}_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==re.date){let s=this._getOrReturnCtx(t);return X(s,{code:G.invalid_type,expected:re.date,received:s.parsedType}),Ce}if(Number.isNaN(t.data.getTime())){let s=this._getOrReturnCtx(t);return X(s,{code:G.invalid_date}),Ce}let i=new un,r;for(let s of this._def.checks)s.kind==="min"?t.data.getTime()<s.value&&(r=this._getOrReturnCtx(t,r),X(r,{code:G.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),i.dirty()):s.kind==="max"?t.data.getTime()>s.value&&(r=this._getOrReturnCtx(t,r),X(r,{code:G.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),i.dirty()):Ye.assertNever(s);return{status:i.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:de.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:de.toString(n)})}get minDate(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}};va.create=e=>new va({checks:[],coerce:e?.coerce||!1,typeName:xe.ZodDate,...Fe(e)});var Iu=class extends Ve{static{o(this,"ZodSymbol")}_parse(t){if(this._getType(t)!==re.symbol){let i=this._getOrReturnCtx(t);return X(i,{code:G.invalid_type,expected:re.symbol,received:i.parsedType}),Ce}return vn(t.data)}};Iu.create=e=>new Iu({typeName:xe.ZodSymbol,...Fe(e)});var Ia=class extends Ve{static{o(this,"ZodUndefined")}_parse(t){if(this._getType(t)!==re.undefined){let i=this._getOrReturnCtx(t);return X(i,{code:G.invalid_type,expected:re.undefined,received:i.parsedType}),Ce}return vn(t.data)}};Ia.create=e=>new Ia({typeName:xe.ZodUndefined,...Fe(e)});var wa=class extends Ve{static{o(this,"ZodNull")}_parse(t){if(this._getType(t)!==re.null){let i=this._getOrReturnCtx(t);return X(i,{code:G.invalid_type,expected:re.null,received:i.parsedType}),Ce}return vn(t.data)}};wa.create=e=>new wa({typeName:xe.ZodNull,...Fe(e)});var so=class extends Ve{static{o(this,"ZodAny")}constructor(){super(...arguments),this._any=!0}_parse(t){return vn(t.data)}};so.create=e=>new so({typeName:xe.ZodAny,...Fe(e)});var gs=class extends Ve{static{o(this,"ZodUnknown")}constructor(){super(...arguments),this._unknown=!0}_parse(t){return vn(t.data)}};gs.create=e=>new gs({typeName:xe.ZodUnknown,...Fe(e)});var li=class extends Ve{static{o(this,"ZodNever")}_parse(t){let n=this._getOrReturnCtx(t);return X(n,{code:G.invalid_type,expected:re.never,received:n.parsedType}),Ce}};li.create=e=>new li({typeName:xe.ZodNever,...Fe(e)});var wu=class extends Ve{static{o(this,"ZodVoid")}_parse(t){if(this._getType(t)!==re.undefined){let i=this._getOrReturnCtx(t);return X(i,{code:G.invalid_type,expected:re.void,received:i.parsedType}),Ce}return vn(t.data)}};wu.create=e=>new wu({typeName:xe.ZodVoid,...Fe(e)});var As=class e extends Ve{static{o(this,"ZodArray")}_parse(t){let{ctx:n,status:i}=this._processInputParams(t),r=this._def;if(n.parsedType!==re.array)return X(n,{code:G.invalid_type,expected:re.array,received:n.parsedType}),Ce;if(r.exactLength!==null){let a=n.data.length>r.exactLength.value,c=n.data.length<r.exactLength.value;(a||c)&&(X(n,{code:a?G.too_big:G.too_small,minimum:c?r.exactLength.value:void 0,maximum:a?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),i.dirty())}if(r.minLength!==null&&n.data.length<r.minLength.value&&(X(n,{code:G.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),i.dirty()),r.maxLength!==null&&n.data.length>r.maxLength.value&&(X(n,{code:G.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),i.dirty()),n.common.async)return Promise.all([...n.data].map((a,c)=>r.type._parseAsync(new Or(n,a,n.path,c)))).then(a=>un.mergeArray(i,a));let s=[...n.data].map((a,c)=>r.type._parseSync(new Or(n,a,n.path,c)));return un.mergeArray(i,s)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:de.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:de.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:de.toString(n)}})}nonempty(t){return this.min(1,t)}};As.create=(e,t)=>new As({type:e,minLength:null,maxLength:null,exactLength:null,typeName:xe.ZodArray,...Fe(t)});function vu(e){if(e instanceof Zn){let t={};for(let n in e.shape){let i=e.shape[n];t[n]=Fr.create(vu(i))}return new Zn({...e._def,shape:o(()=>t,"shape")})}else return e instanceof As?new As({...e._def,type:vu(e.element)}):e instanceof Fr?Fr.create(vu(e.unwrap())):e instanceof Pi?Pi.create(vu(e.unwrap())):e instanceof Ni?Ni.create(e.items.map(t=>vu(t))):e}o(vu,"deepPartialify");var Zn=class e extends Ve{static{o(this,"ZodObject")}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(),n=Ye.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==re.object){let l=this._getOrReturnCtx(t);return X(l,{code:G.invalid_type,expected:re.object,received:l.parsedType}),Ce}let{status:i,ctx:r}=this._processInputParams(t),{shape:s,keys:a}=this._getCached(),c=[];if(!(this._def.catchall instanceof li&&this._def.unknownKeys==="strip"))for(let l in r.data)a.includes(l)||c.push(l);let u=[];for(let l of a){let p=s[l],f=r.data[l];u.push({key:{status:"valid",value:l},value:p._parse(new Or(r,f,r.path,l)),alwaysSet:l in r.data})}if(this._def.catchall instanceof li){let l=this._def.unknownKeys;if(l==="passthrough")for(let p of c)u.push({key:{status:"valid",value:p},value:{status:"valid",value:r.data[p]}});else if(l==="strict")c.length>0&&(X(r,{code:G.unrecognized_keys,keys:c}),i.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let p of c){let f=r.data[p];u.push({key:{status:"valid",value:p},value:l._parse(new Or(r,f,r.path,p)),alwaysSet:p in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let l=[];for(let p of u){let f=await p.key,A=await p.value;l.push({key:f,value:A,alwaysSet:p.alwaysSet})}return l}).then(l=>un.mergeObjectSync(i,l)):un.mergeObjectSync(i,u)}get shape(){return this._def.shape()}strict(t){return de.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:o((n,i)=>{let r=this._def.errorMap?.(n,i).message??i.defaultError;return n.code==="unrecognized_keys"?{message:de.errToObj(t).message??r}:{message:r}},"errorMap")}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:o(()=>({...this._def.shape(),...t}),"shape")})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:o(()=>({...this._def.shape(),...t._def.shape()}),"shape"),typeName:xe.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};for(let i of Ye.objectKeys(t))t[i]&&this.shape[i]&&(n[i]=this.shape[i]);return new e({...this._def,shape:o(()=>n,"shape")})}omit(t){let n={};for(let i of Ye.objectKeys(this.shape))t[i]||(n[i]=this.shape[i]);return new e({...this._def,shape:o(()=>n,"shape")})}deepPartial(){return vu(this)}partial(t){let n={};for(let i of Ye.objectKeys(this.shape)){let r=this.shape[i];t&&!t[i]?n[i]=r:n[i]=r.optional()}return new e({...this._def,shape:o(()=>n,"shape")})}required(t){let n={};for(let i of Ye.objectKeys(this.shape))if(t&&!t[i])n[i]=this.shape[i];else{let s=this.shape[i];for(;s instanceof Fr;)s=s._def.innerType;n[i]=s}return new e({...this._def,shape:o(()=>n,"shape")})}keyof(){return Yj(Ye.objectKeys(this.shape))}};Zn.create=(e,t)=>new Zn({shape:o(()=>e,"shape"),unknownKeys:"strip",catchall:li.create(),typeName:xe.ZodObject,...Fe(t)});Zn.strictCreate=(e,t)=>new Zn({shape:o(()=>e,"shape"),unknownKeys:"strict",catchall:li.create(),typeName:xe.ZodObject,...Fe(t)});Zn.lazycreate=(e,t)=>new Zn({shape:e,unknownKeys:"strip",catchall:li.create(),typeName:xe.ZodObject,...Fe(t)});var Ca=class extends Ve{static{o(this,"ZodUnion")}_parse(t){let{ctx:n}=this._processInputParams(t),i=this._def.options;function r(s){for(let c of s)if(c.result.status==="valid")return c.result;for(let c of s)if(c.result.status==="dirty")return n.common.issues.push(...c.ctx.common.issues),c.result;let a=s.map(c=>new Wn(c.ctx.common.issues));return X(n,{code:G.invalid_union,unionErrors:a}),Ce}if(o(r,"handleResults"),n.common.async)return Promise.all(i.map(async s=>{let a={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(r);{let s,a=[];for(let u of i){let l={...n,common:{...n.common,issues:[]},parent:null},p=u._parseSync({data:n.data,path:n.path,parent:l});if(p.status==="valid")return p;p.status==="dirty"&&!s&&(s={result:p,ctx:l}),l.common.issues.length&&a.push(l.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;let c=a.map(u=>new Wn(u));return X(n,{code:G.invalid_union,unionErrors:c}),Ce}}get options(){return this._def.options}};Ca.create=(e,t)=>new Ca({options:e,typeName:xe.ZodUnion,...Fe(t)});var fs=o(e=>e instanceof ka?fs(e.schema):e instanceof Mr?fs(e.innerType()):e instanceof Ba?[e.value]:e instanceof Ra?e.options:e instanceof xa?Ye.objectValues(e.enum):e instanceof Qa?fs(e._def.innerType):e instanceof Ia?[void 0]:e instanceof wa?[null]:e instanceof Fr?[void 0,...fs(e.unwrap())]:e instanceof Pi?[null,...fs(e.unwrap())]:e instanceof ap||e instanceof Ta?fs(e.unwrap()):e instanceof $a?fs(e._def.innerType):[],"getDiscriminator"),Yh=class e extends Ve{static{o(this,"ZodDiscriminatedUnion")}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==re.object)return X(n,{code:G.invalid_type,expected:re.object,received:n.parsedType}),Ce;let i=this.discriminator,r=n.data[i],s=this.optionsMap.get(r);return s?n.common.async?s._parseAsync({data:n.data,path:n.path,parent:n}):s._parseSync({data:n.data,path:n.path,parent:n}):(X(n,{code:G.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[i]}),Ce)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,i){let r=new Map;for(let s of n){let a=fs(s.shape[t]);if(!a.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let c of a){if(r.has(c))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(c)}`);r.set(c,s)}}return new e({typeName:xe.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:r,...Fe(i)})}};function xC(e,t){let n=_i(e),i=_i(t);if(e===t)return{valid:!0,data:e};if(n===re.object&&i===re.object){let r=Ye.objectKeys(t),s=Ye.objectKeys(e).filter(c=>r.indexOf(c)!==-1),a={...e,...t};Object.prototype.hasOwnProperty.call(a,"__proto__")&&delete a.__proto__;for(let c of s){if(c==="__proto__")continue;let u=xC(e[c],t[c]);if(!u.valid)return{valid:!1};a[c]=u.data}return{valid:!0,data:a}}else if(n===re.array&&i===re.array){if(e.length!==t.length)return{valid:!1};let r=[];for(let s=0;s<e.length;s++){let a=e[s],c=t[s],u=xC(a,c);if(!u.valid)return{valid:!1};r.push(u.data)}return{valid:!0,data:r}}else return n===re.date&&i===re.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}o(xC,"mergeValues");var Sa=class extends Ve{static{o(this,"ZodIntersection")}_parse(t){let{status:n,ctx:i}=this._processInputParams(t),r=o((s,a)=>{if(Hh(s)||Hh(a))return Ce;let c=xC(s.value,a.value);return c.valid?((Jh(s)||Jh(a))&&n.dirty(),{status:n.value,value:c.data}):(X(i,{code:G.invalid_intersection_types}),Ce)},"handleParsed");return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([s,a])=>r(s,a)):r(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}};Sa.create=(e,t,n)=>new Sa({left:e,right:t,typeName:xe.ZodIntersection,...Fe(n)});var Ni=class e extends Ve{static{o(this,"ZodTuple")}_parse(t){let{status:n,ctx:i}=this._processInputParams(t);if(i.parsedType!==re.array)return X(i,{code:G.invalid_type,expected:re.array,received:i.parsedType}),Ce;if(i.data.length<this._def.items.length)return X(i,{code:G.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ce;!this._def.rest&&i.data.length>this._def.items.length&&(X(i,{code:G.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let s=[...i.data].map((a,c)=>{let u=this._def.items[c]||this._def.rest;return u?u._parse(new Or(i,a,i.path,c)):null}).filter(a=>!!a);return i.common.async?Promise.all(s).then(a=>un.mergeArray(n,a)):un.mergeArray(n,s)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};Ni.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ni({items:e,typeName:xe.ZodTuple,rest:null,...Fe(t)})};var Wh=class e extends Ve{static{o(this,"ZodRecord")}get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:i}=this._processInputParams(t);if(i.parsedType!==re.object)return X(i,{code:G.invalid_type,expected:re.object,received:i.parsedType}),Ce;let r=[],s=this._def.keyType,a=this._def.valueType;for(let c in i.data)r.push({key:s._parse(new Or(i,c,i.path,c)),value:a._parse(new Or(i,i.data[c],i.path,c)),alwaysSet:c in i.data});return i.common.async?un.mergeObjectAsync(n,r):un.mergeObjectSync(n,r)}get element(){return this._def.valueType}static create(t,n,i){return n instanceof Ve?new e({keyType:t,valueType:n,typeName:xe.ZodRecord,...Fe(i)}):new e({keyType:io.create(),valueType:t,typeName:xe.ZodRecord,...Fe(n)})}},Cu=class extends Ve{static{o(this,"ZodMap")}get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:i}=this._processInputParams(t);if(i.parsedType!==re.map)return X(i,{code:G.invalid_type,expected:re.map,received:i.parsedType}),Ce;let r=this._def.keyType,s=this._def.valueType,a=[...i.data.entries()].map(([c,u],l)=>({key:r._parse(new Or(i,c,i.path,[l,"key"])),value:s._parse(new Or(i,u,i.path,[l,"value"]))}));if(i.common.async){let c=new Map;return Promise.resolve().then(async()=>{for(let u of a){let l=await u.key,p=await u.value;if(l.status==="aborted"||p.status==="aborted")return Ce;(l.status==="dirty"||p.status==="dirty")&&n.dirty(),c.set(l.value,p.value)}return{status:n.value,value:c}})}else{let c=new Map;for(let u of a){let l=u.key,p=u.value;if(l.status==="aborted"||p.status==="aborted")return Ce;(l.status==="dirty"||p.status==="dirty")&&n.dirty(),c.set(l.value,p.value)}return{status:n.value,value:c}}}};Cu.create=(e,t,n)=>new Cu({valueType:t,keyType:e,typeName:xe.ZodMap,...Fe(n)});var Su=class e extends Ve{static{o(this,"ZodSet")}_parse(t){let{status:n,ctx:i}=this._processInputParams(t);if(i.parsedType!==re.set)return X(i,{code:G.invalid_type,expected:re.set,received:i.parsedType}),Ce;let r=this._def;r.minSize!==null&&i.data.size<r.minSize.value&&(X(i,{code:G.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),n.dirty()),r.maxSize!==null&&i.data.size>r.maxSize.value&&(X(i,{code:G.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),n.dirty());let s=this._def.valueType;function a(u){let l=new Set;for(let p of u){if(p.status==="aborted")return Ce;p.status==="dirty"&&n.dirty(),l.add(p.value)}return{status:n.value,value:l}}o(a,"finalizeSet");let c=[...i.data.values()].map((u,l)=>s._parse(new Or(i,u,i.path,l)));return i.common.async?Promise.all(c).then(u=>a(u)):a(c)}min(t,n){return new e({...this._def,minSize:{value:t,message:de.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:de.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}};Su.create=(e,t)=>new Su({valueType:e,minSize:null,maxSize:null,typeName:xe.ZodSet,...Fe(t)});var Zh=class e extends Ve{static{o(this,"ZodFunction")}constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==re.function)return X(n,{code:G.invalid_type,expected:re.function,received:n.parsedType}),Ce;function i(c,u){return op({data:c,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Eu(),ps].filter(l=>!!l),issueData:{code:G.invalid_arguments,argumentsError:u}})}o(i,"makeArgsIssue");function r(c,u){return op({data:c,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Eu(),ps].filter(l=>!!l),issueData:{code:G.invalid_return_type,returnTypeError:u}})}o(r,"makeReturnsIssue");let s={errorMap:n.common.contextualErrorMap},a=n.data;if(this._def.returns instanceof oo){let c=this;return vn(async function(...u){let l=new Wn([]),p=await c._def.args.parseAsync(u,s).catch(h=>{throw l.addIssue(i(u,h)),l}),f=await Reflect.apply(a,this,p);return await c._def.returns._def.type.parseAsync(f,s).catch(h=>{throw l.addIssue(r(f,h)),l})})}else{let c=this;return vn(function(...u){let l=c._def.args.safeParse(u,s);if(!l.success)throw new Wn([i(u,l.error)]);let p=Reflect.apply(a,this,l.data),f=c._def.returns.safeParse(p,s);if(!f.success)throw new Wn([r(p,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:Ni.create(t).rest(gs.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,n,i){return new e({args:t||Ni.create([]).rest(gs.create()),returns:n||gs.create(),typeName:xe.ZodFunction,...Fe(i)})}},ka=class extends Ve{static{o(this,"ZodLazy")}get schema(){return this._def.getter()}_parse(t){let{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};ka.create=(e,t)=>new ka({getter:e,typeName:xe.ZodLazy,...Fe(t)});var Ba=class extends Ve{static{o(this,"ZodLiteral")}_parse(t){if(t.data!==this._def.value){let n=this._getOrReturnCtx(t);return X(n,{received:n.data,code:G.invalid_literal,expected:this._def.value}),Ce}return{status:"valid",value:t.data}}get value(){return this._def.value}};Ba.create=(e,t)=>new Ba({value:e,typeName:xe.ZodLiteral,...Fe(t)});function Yj(e,t){return new Ra({values:e,typeName:xe.ZodEnum,...Fe(t)})}o(Yj,"createZodEnum");var Ra=class e extends Ve{static{o(this,"ZodEnum")}_parse(t){if(typeof t.data!="string"){let n=this._getOrReturnCtx(t),i=this._def.values;return X(n,{expected:Ye.joinValues(i),received:n.parsedType,code:G.invalid_type}),Ce}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let n=this._getOrReturnCtx(t),i=this._def.values;return X(n,{received:n.data,code:G.invalid_enum_value,options:i}),Ce}return vn(t.data)}get options(){return this._def.values}get enum(){let t={};for(let n of this._def.values)t[n]=n;return t}get Values(){let t={};for(let n of this._def.values)t[n]=n;return t}get Enum(){let t={};for(let n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter(i=>!t.includes(i)),{...this._def,...n})}};Ra.create=Yj;var xa=class extends Ve{static{o(this,"ZodNativeEnum")}_parse(t){let n=Ye.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(t);if(i.parsedType!==re.string&&i.parsedType!==re.number){let r=Ye.objectValues(n);return X(i,{expected:Ye.joinValues(r),received:i.parsedType,code:G.invalid_type}),Ce}if(this._cache||(this._cache=new Set(Ye.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let r=Ye.objectValues(n);return X(i,{received:i.data,code:G.invalid_enum_value,options:r}),Ce}return vn(t.data)}get enum(){return this._def.values}};xa.create=(e,t)=>new xa({values:e,typeName:xe.ZodNativeEnum,...Fe(t)});var oo=class extends Ve{static{o(this,"ZodPromise")}unwrap(){return this._def.type}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==re.promise&&n.common.async===!1)return X(n,{code:G.invalid_type,expected:re.promise,received:n.parsedType}),Ce;let i=n.parsedType===re.promise?n.data:Promise.resolve(n.data);return vn(i.then(r=>this._def.type.parseAsync(r,{path:n.path,errorMap:n.common.contextualErrorMap})))}};oo.create=(e,t)=>new oo({type:e,typeName:xe.ZodPromise,...Fe(t)});var Mr=class extends Ve{static{o(this,"ZodEffects")}innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===xe.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:n,ctx:i}=this._processInputParams(t),r=this._def.effect||null,s={addIssue:o(a=>{X(i,a),a.fatal?n.abort():n.dirty()},"addIssue"),get path(){return i.path}};if(s.addIssue=s.addIssue.bind(s),r.type==="preprocess"){let a=r.transform(i.data,s);if(i.common.async)return Promise.resolve(a).then(async c=>{if(n.value==="aborted")return Ce;let u=await this._def.schema._parseAsync({data:c,path:i.path,parent:i});return u.status==="aborted"?Ce:u.status==="dirty"?ma(u.value):n.value==="dirty"?ma(u.value):u});{if(n.value==="aborted")return Ce;let c=this._def.schema._parseSync({data:a,path:i.path,parent:i});return c.status==="aborted"?Ce:c.status==="dirty"?ma(c.value):n.value==="dirty"?ma(c.value):c}}if(r.type==="refinement"){let a=o(c=>{let u=r.refinement(c,s);if(i.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c},"executeRefinement");if(i.common.async===!1){let c=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return c.status==="aborted"?Ce:(c.status==="dirty"&&n.dirty(),a(c.value),{status:n.value,value:c.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(c=>c.status==="aborted"?Ce:(c.status==="dirty"&&n.dirty(),a(c.value).then(()=>({status:n.value,value:c.value}))))}if(r.type==="transform")if(i.common.async===!1){let a=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!ro(a))return Ce;let c=r.transform(a.value,s);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:c}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(a=>ro(a)?Promise.resolve(r.transform(a.value,s)).then(c=>({status:n.value,value:c})):Ce);Ye.assertNever(r)}};Mr.create=(e,t,n)=>new Mr({schema:e,typeName:xe.ZodEffects,effect:t,...Fe(n)});Mr.createWithPreprocess=(e,t,n)=>new Mr({schema:t,effect:{type:"preprocess",transform:e},typeName:xe.ZodEffects,...Fe(n)});var Fr=class extends Ve{static{o(this,"ZodOptional")}_parse(t){return this._getType(t)===re.undefined?vn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Fr.create=(e,t)=>new Fr({innerType:e,typeName:xe.ZodOptional,...Fe(t)});var Pi=class extends Ve{static{o(this,"ZodNullable")}_parse(t){return this._getType(t)===re.null?vn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Pi.create=(e,t)=>new Pi({innerType:e,typeName:xe.ZodNullable,...Fe(t)});var Qa=class extends Ve{static{o(this,"ZodDefault")}_parse(t){let{ctx:n}=this._processInputParams(t),i=n.data;return n.parsedType===re.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};Qa.create=(e,t)=>new Qa({innerType:e,typeName:xe.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Fe(t)});var $a=class extends Ve{static{o(this,"ZodCatch")}_parse(t){let{ctx:n}=this._processInputParams(t),i={...n,common:{...n.common,issues:[]}},r=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return bu(r)?r.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Wn(i.common.issues)},input:i.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new Wn(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}};$a.create=(e,t)=>new $a({innerType:e,typeName:xe.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Fe(t)});var ku=class extends Ve{static{o(this,"ZodNaN")}_parse(t){if(this._getType(t)!==re.nan){let i=this._getOrReturnCtx(t);return X(i,{code:G.invalid_type,expected:re.nan,received:i.parsedType}),Ce}return{status:"valid",value:t.data}}};ku.create=e=>new ku({typeName:xe.ZodNaN,...Fe(e)});var yse=Symbol("zod_brand"),ap=class extends Ve{static{o(this,"ZodBranded")}_parse(t){let{ctx:n}=this._processInputParams(t),i=n.data;return this._def.type._parse({data:i,path:n.path,parent:n})}unwrap(){return this._def.type}},cp=class e extends Ve{static{o(this,"ZodPipeline")}_parse(t){let{status:n,ctx:i}=this._processInputParams(t);if(i.common.async)return o(async()=>{let s=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return s.status==="aborted"?Ce:s.status==="dirty"?(n.dirty(),ma(s.value)):this._def.out._parseAsync({data:s.value,path:i.path,parent:i})},"handleAsync")();{let r=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return r.status==="aborted"?Ce:r.status==="dirty"?(n.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:i.path,parent:i})}}static create(t,n){return new e({in:t,out:n,typeName:xe.ZodPipeline})}},Ta=class extends Ve{static{o(this,"ZodReadonly")}_parse(t){let n=this._def.innerType._parse(t),i=o(r=>(ro(r)&&(r.value=Object.freeze(r.value)),r),"freeze");return bu(n)?n.then(r=>i(r)):i(n)}unwrap(){return this._def.innerType}};Ta.create=(e,t)=>new Ta({innerType:e,typeName:xe.ZodReadonly,...Fe(t)});function zj(e,t){let n=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof n=="string"?{message:n}:n}o(zj,"cleanParams");function Wj(e,t={},n){return e?so.create().superRefine((i,r)=>{let s=e(i);if(s instanceof Promise)return s.then(a=>{if(!a){let c=zj(t,i),u=c.fatal??n??!0;r.addIssue({code:"custom",...c,fatal:u})}});if(!s){let a=zj(t,i),c=a.fatal??n??!0;r.addIssue({code:"custom",...a,fatal:c})}}):so.create()}o(Wj,"custom");var Ese={object:Zn.lazycreate},xe;(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"})(xe||(xe={}));var bse=o((e,t={message:`Input not instance of ${e.name}`})=>Wj(n=>n instanceof e,t),"instanceOfType"),Zj=io.create,Kj=ya.create,vse=ku.create,Ise=Ea.create,Xj=ba.create,wse=va.create,Cse=Iu.create,Sse=Ia.create,kse=wa.create,Bse=so.create,Rse=gs.create,xse=li.create,Qse=wu.create,$se=As.create,Tse=Zn.create,Dse=Zn.strictCreate,_se=Ca.create,Nse=Yh.create,Pse=Sa.create,Use=Ni.create,Fse=Wh.create,Ose=Cu.create,Mse=Su.create,Lse=Zh.create,jse=ka.create,Gse=Ba.create,Vse=Ra.create,zse=xa.create,qse=oo.create,Hse=Mr.create,Jse=Fr.create,Yse=Pi.create,Wse=Mr.createWithPreprocess,Zse=cp.create,Kse=o(()=>Zj().optional(),"ostring"),Xse=o(()=>Kj().optional(),"onumber"),eoe=o(()=>Xj().optional(),"oboolean"),toe={string:o((e=>io.create({...e,coerce:!0})),"string"),number:o((e=>ya.create({...e,coerce:!0})),"number"),boolean:o((e=>ba.create({...e,coerce:!0})),"boolean"),bigint:o((e=>Ea.create({...e,coerce:!0})),"bigint"),date:o((e=>va.create({...e,coerce:!0})),"date")};var noe=Ce;var up=(r=>(r.ModelProvider="model_provider",r.SutAccess="sut_access",r.Skyramp="skyramp",r.Other="other",r))(up||{}),QC=(i=>(i.Ready="ready",i.Blocked="blocked",i.NeedsInputs="needs_inputs",i))(QC||{});var Kh=300,dt=d.string().trim().min(1),roe=d.object({action:d.enum(["start","run","wait"]),text:dt,source:d.enum(["file","notes","testbot"]).describe("file: a file in the repository; notes: the Target's notes; testbot: Testbot's own finding"),file:dt.nullable().describe("the file the step came from, relative to the component's repository; null unless source is file")}).strict().refine(e=>e.source==="file"==(e.file!==null),{path:["file"],message:"a file exactly when the step came from one"}),lp=/^[A-Za-z_][A-Za-z0-9_]*$/,Kn=/^(?!GITHUB_)(?!SKYRAMP_RUNNER_)[A-Z][A-Z0-9_]{0,99}$/,Bu=(a=>(a.VersionEndpoint="version_endpoint",a.DeployWorkflow="deploy_workflow",a.KubernetesLabels="kubernetes_labels",a.Command="command",a.Api="api",a.NotTracked="not_tracked",a))(Bu||{}),Ui="shared",ioe=dt.refine(e=>{try{let t=new URL(e);return["http:","https:"].includes(t.protocol)&&!t.username&&!t.password}catch{return!1}},"an http(s) URL with no login in it"),Ru=d.object({address:ioe,readyWhen:dt.nullable(),credentials:d.array(d.string().regex(Kn)).max(50),revisionSources:d.array(d.object({method:d.nativeEnum(Bu),detail:dt.describe("what Testbot reads, such as GET /version or the deploy workflow's name; for not_tracked, why nothing shows it"),components:d.array(dt).min(1).describe("the components it tells the revision of, by name")}).strict()).max(50)}).strict(),$C={steps:d.array(roe).max(20).optional().describe("how it starts, in order"),kind:d.enum(["web_app","service","database","external_service"]).optional(),from:d.object({file:dt,service:dt.nullable()}).strict().optional(),credentials:d.array(d.string().max(100).regex(lp)).max(50).optional().describe("the Target's credentials this component's recipe uses: a sign-in (a test user, password or token) or an API key, which the workflow supplies from a GitHub Actions secret as the environment variable of the credential's name; give each name exactly as the recipe reads it. Names only, never a value, and not a secret the recipe generates itself")},TC=d.object({name:dt,repository:dt.describe("owner/repo of the Target repository the component is built or started from, such as the one whose compose file starts its database"),healthy:d.boolean(),...$C,deployed:dt.nullable().optional().describe('only with "environment": the revision the component runs, as you read it from its revision source, or null when you could not tell')}),soe=d.object({name:d.string().regex(Kn).describe("the credential's environment variable name, as the recipe reads it and the credentials event names it"),purpose:d.enum(["sut_access","other"]).describe("sut_access: it signs in to or calls the SUT or a service it needs; other: anything else"),required:d.boolean().describe("false only when the SUT starts without it, with less working"),how:dt.max(Kh).describe('one short sentence: what the value is and where a person gets it, such as "A Mattermost Enterprise licence key, from the customer portal"; never a value')}),DC=d.object({name:dt.describe("the credential's environment variable name, as listed above; never its value"),component:dt.describe("the component that refused it"),status:d.number().int().min(400).max(599).optional().describe("the HTTP status it got, such as 401 or 403; leave it out when the refusal was not an HTTP answer"),evidence:dt.describe("the request or command you tested it with and what came back, never the value")}),ooe=400,e1=o((e,t)=>dt.max(ooe).optional().describe(`one or two plain sentences: ${e}, such as "${t}"; never the value`),"credentialExplanation"),aoe=DC.extend({name:d.string().regex(Kn).describe("the credential's environment variable name, as the SUT input lists it; never its value"),explanation:e1("what the component did with the value and why it is wrong","The app checks the licence key at startup and exits: the value this run has does not match the licence it expects.")}),coe=d.object({name:d.string().regex(Kn).describe("the credential's environment variable name, as the SUT input lists it"),component:dt.describe("the component that cannot come up or work without it"),evidence:dt.describe("the command you ran and what came back that shows it needs a value, never a value"),explanation:e1("what the component needs the value for and what it does without one","The app reads the licence key at startup and exits when it is empty.")}),uoe=d.object({component:dt,problem:dt,evidence:dt.describe("the exact command and output that shows it"),fix:dt.describe("what the user must provide, and where; never a change to a file under .skyramp/sut/")}),loe=d.object({framework:dt,file:dt.describe("the test file run, relative to its repository root"),result:d.enum(["pass","fail","error"])}),doe=d.object({input:dt.describe("the part of the user's SUT input, as given"),reason:dt}),sRe=d.object({schemaVersion:d.literal(1),status:d.nativeEnum(QC).describe("ready only if every component came up healthy and the recipe is written; needs_inputs when the recipe is written but a component cannot start without a credential this run has no value for"),components:d.array(TC),suites:d.array(loe).default([]).describe("one run per test suite the Target's repositories have; empty when they have none"),inputsUsed:d.array(dt).default([]).describe("the parts of the user's SUT input the recipe used as given"),inputsUsedHow:d.array(d.object({input:dt.describe("exactly as written in inputsUsed; an entry that is not there is left out"),how:dt.describe("what the recipe did with it")})).optional(),inputsNotUsed:d.array(doe).default([]).describe("the parts it did not use, and why. A part that is wrong goes here, with what was wrong, even when the recipe does something like it instead: one the repositories or the app show is wrong, such as a file, command, port, route or setting that is not there. Something outside them that does not answer is not one: that is a blocker"),blockers:d.array(uoe).describe("required (non-empty) when status is blocked, unless credentialsRefused or credentialsWithoutValue says why; never one for a credential either of them names"),inputs:d.array(soe).max(50).optional().describe("required (non-empty) when status is needs_inputs, else left out: each credential the candidate recipe needs a value for"),credentialsRefused:d.array(aoe).max(50).optional().describe("only with status blocked: each credential the SUT input lists that the SUT still refused after a person confirmed it, or when no other credential worked. Testbot writes its blocker"),credentialsWithoutValue:d.array(coe).max(50).optional().describe("only with status blocked: each credential the SUT input lists as empty in this run that a component cannot come up or work without. Testbot writes its blocker"),environment:Ru.optional().describe("only when the whole SUT is an existing deployment you tested where it runs, building and starting nothing: its address, what says it is ready, the credentials that reach it, and how to read what each component runs. Leave it out when any part was built or started on the runner, or reaching it needed something there (a tunnel, port-forward or proxy; a client certificate is named in .skyramp/sut/client-cert.json instead)")});var _C=64*1024,NC=512*1024,t1=/[\u0000-\u0008\u000b\u000e-\u001f\u007f]|[\ud800-\udbff](?![\udc00-\udfff])|(?<![\ud800-\udbff])[\udc00-\udfff]/;var Fi=(r=>(r.Clean="clean",r.RecipeDrift="recipe-drift",r.ChangeBrokeBringup="change-broke-bringup",r.BringupFailed="bringup-failed",r))(Fi||{}),ao=d.string().trim().min(1),poe=d.object({url:d.string().optional().describe("the URL probed, if the check is an HTTP request"),command:d.string().optional().describe("the command run, if the check is a script \u2014 preferred when auth is needed"),headers:d.record(d.string()).optional(),status:d.union([d.number(),d.string()]).optional().describe("expected HTTP status for a url check (default 200)"),output:ao.describe("what the check returned, VERBATIM \u2014 the bytes, nothing appended; this gate RE-RUNS the check")}),PC=d.array(d.object({component:ao.describe("a shared component listed above"),url:ao.describe("the URL on the component's own origin (scheme, host and port) that answers with its deployed commit"),output:ao.describe("what the URL returned, VERBATIM; this gate FETCHES each url")})).describe("only when shared components are listed above: one check per component whose deployed commit you found"),n1=d.object({schemaVersion:d.literal(1),baseUrls:d.record(d.string()).optional().describe("service \u2192 base URL of the running app; omit on a failed bring-up, never invent one"),health:poe.optional(),teardown:ao.describe("command that tears the SUT down"),dependencies:d.record(d.boolean()).optional().describe("EVERY backing service: true = really deployed, false = mocked; REQUIRED when the app came up"),outcome:d.nativeEnum(Fi).describe("clean | recipe-drift (you corrected the recipe) | change-broke-bringup (the PR broke it) | bringup-failed (environment, not the PR)"),recipeFixes:d.array(d.string()).optional().describe("required when outcome is recipe-drift: what was corrected"),bringupError:d.object({command:ao,output:ao}).optional().describe("required when bring-up failed: the exact failing command and what it printed"),suspectFiles:d.array(d.string()).optional().describe("required for change-broke-bringup: files THIS PR changed that the failure points at, relative to your working directory (a file in another checkout of the run: its absolute path)"),seeded:d.boolean(),startedAt:ao.describe("ISO timestamp"),revisions:PC.optional(),missingSecrets:d.array(d.string().regex(lp)).optional().describe("bringup-failed only: each secret the app cannot start without that this run has no value for, by its environment variable name; never a value"),credentialsRefused:d.array(DC).optional().describe("only for credentials the prompt lists to test: each that was refused when you tested it, such as with a 401 or 403; leave it out when none was, or when none is listed"),recipeRecorded:d.boolean().optional().describe("[derived] whether the checkout had a recorded recipe before bring-up")});var T1=require("node:crypto");var Da=(s=>(s.NotFound="not_found",s.NoAccess="no_access",s.Unavailable="unavailable",s.AccessLost="access_lost",s.CannotOpen="cannot_open",s))(Da||{});var UC=o(e=>`${e.source}:${e.site??""}:${e.key}`,"requirementItemId");var dp=/^pasted-[0-9a-f]{16}$/,hs=/^file-[0-9a-f]{16}$/,pp=(r=>(r.Pdf="application/pdf",r.Csv="text/csv",r.Docx="application/vnd.openxmlformats-officedocument.wordprocessingml.document",r.Xlsx="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",r))(pp||{}),_a=o(e=>e.trim().toUpperCase(),"normalKey"),r1=o((e,t)=>{let n=e.trim();return dp.test(n.toLowerCase())?"Pasted text":hs.test(n.toLowerCase())?t?.get(_a(n))??"Uploaded document":/^\d+$/.test(n)?`Confluence page ${n}`:n.toUpperCase()},"itemName");var Xh=(i=>(i.New="new",i.Updated="updated",i.Existing="existing",i))(Xh||{}),Oi=(i=>(i.Sufficient="sufficient",i.Insufficient="insufficient",i.NoChange="no_change",i))(Oi||{}),xu=(v=>(v.RelatedChangeConflict="related_change_conflict",v.ReferenceOutsideTarget="reference_outside_target",v.SourceAccessLost="source_access_lost",v.ConfigurationIncomplete="configuration_incomplete",v.CredentialUnavailable="credential_unavailable",v.WorkflowBindingUnverified="workflow_binding_unverified",v.WorkflowRefUnprotected="workflow_ref_unprotected",v.BedrockWorkflowRequired="bedrock_workflow_required",v.DeploymentReview="deployment_review",v.SutRevisionMismatch="sut_revision_mismatch",v.IsolationUnavailable="isolation_unavailable",v.EvidenceInsufficient="evidence_insufficient",v.ConfigurationUnresolved="configuration_unresolved",v.ModelProviderDenied="model_provider_denied",v.ModelProviderUnavailable="model_provider_unavailable",v.RunnerProviderNotReady="runner_provider_not_ready",v.MergeConflict="merge_conflict",v))(xu||{}),co=(s=>(s.CiCheck="ci_check",s.TestReport="test_report",s.StaticAnalysis="static_analysis",s.CodeReview="code_review",s.Other="other",s))(co||{}),fp=(i=>(i.Application="application",i.Environment="environment",i.TestDefect="test_defect",i))(fp||{}),gp=(c=>(c.AuthToken="auth_token",c.Secret="secret",c.DataConnection="data_connection",c.AppNotStarted="app_not_started",c.Login="login",c.ExternalDependency="external_dependency",c.RecordingReplay="recording_replay",c))(gp||{});var em=(n=>(n.Probe="probe",n.Agent="agent",n))(em||{}),Ap=(i=>(i.Seed="seed",i.RuntimeMock="runtime_mock",i.EnvOverride="env_override",i))(Ap||{}),tm=(i=>(i.TestCode="test_code",i.SkyrampMocker="skyramp_mocker",i.RecipeOverride="recipe_override",i))(tm||{});function nm(e){return e==="failed"?2:e==="unknown"?1:0}o(nm,"cleanupShortfall");var hp=(n=>(n.Skyramp="skyramp",n.Llm="llm",n))(hp||{}),Mi=d.string().trim().min(1),foe=d.object({case:Mi.describe("recommend id this assertion enforces"),evidence:Mi.describe("the exact assertion line from the file that checks that case's observable")});var i1=d.object({route:d.literal("persistence"),url:d.string().url()}).strict(),mp=d.object({kind:d.nativeEnum(Ap).describe("seed: data the test creates in the app; runtime_mock: a mock on a Skyramp worker, which other tests reach too; env_override: an env value the app runs with. A stub inside the test's own process, such as a browser page's route, is none of these"),target:Mi.describe("the dependency, endpoint or data it affects"),mechanism:d.nativeEnum(tm).describe("test_code: the test applies and undoes it; skyramp_mocker: a mock the test applies on a Skyramp worker; recipe_override: the mocker cannot reach the dependency (its URL is fixed in the build)"),detail:Mi.describe("what it sets up"),worker:Mi.optional().describe("skyramp_mocker: host:port of the worker the test applies the mock to (default localhost:35142)"),safety:i1.optional().describe("shared seed that keeps its data only because the environment permits it: the persistence route and the exact endpoint; Testbot checks the current permission just before it runs the test"),cleanup:Mi.optional().describe("seed: when its data can be removed, a command that removes it if the test does not; otherwise declare leftBehind instead. Run as written and without a shell: give real values, not a placeholder such as <id>, single-quote an argument that holds shell syntax, or put the logic in a script in the repository and run that"),leftBehind:Mi.optional().describe("seed: the records the test creates and cannot remove from the app, and how to find them")}).refine(e=>!e.leftBehind||e.kind==="seed",{message:"leftBehind is for a seed only: a runtime mock or an env override creates no records",path:["leftBehind"]}),goe=d.object({file:Mi.describe("staged path under .skyramp/staged/"),source:d.nativeEnum(hp),language:Mi,covers:d.array(d.string()).min(1,"must be a non-empty array of recommend ids").describe("recommend ids this test covers"),assertions:d.array(foe).min(1,"must be a non-empty array").describe("one per case covered, citing the real line"),context:d.array(mp).optional().describe("what the test sets up against the running app, in order: data it seeds, Skyramp mocks it applies, env overrides; omit when none")}),FC=d.object({schemaVersion:d.literal(1),tests:d.array(goe),deferredUi:d.array(d.string()).describe("recommend ui ids left for the UI stage (generate) \u2014 [] for generate-ui"),summary:Mi.describe("one paragraph")});var ms=(a=>(a.Place="place",a.Update="update",a.Regenerate="regenerate",a.Delete="delete",a.Verify="verify",a.None="none",a))(ms||{}),Tn=(i=>(i.Pass="pass",i.Fail="fail",i.Skip="skip",i))(Tn||{}),$n=d.string().trim().min(1),OC=(r=>(r.Setup="setup",r.Expectation="expectation",r.Locator="locator",r.Other="other",r))(OC||{}),rm=d.object({kind:d.nativeEnum(OC),reason:$n.describe("what in the test is wrong, with the evidence: the setup error it raised, or the requirement or changed line its expectation contradicts")}),yp=d.array(d.string().url().max(2048).regex(/^https?:\/\//i)).max(50),s1=d.object({case:$n.describe("a covers id \u2014 the recommend case this test realizes"),status:d.nativeEnum(Tn),runtimeTargets:yp.optional().describe("HTTP(S) URLs this case actually exercised in its current run; omit for in-process or mocked checks, never infer from test type"),environmentRestriction:$n.optional().describe("for a skipped case: what this run lacks to execute it; the test is still written"),fromJourney:d.boolean().optional(),testProblem:rm.optional().describe("[derived] write's reading of a failing case: the test, not the app, is at fault"),defect:d.boolean().optional().describe("[derived] write's reading of a failing case: true when the app is wrong and the test is right"),failure:d.string().optional().describe("[derived] for a failing case: the runner's failure for it, as printed")}).refine(e=>!e.environmentRestriction||e.status==="skip"&&!e.runtimeTargets?.length,{message:"an environment-restricted case must be skipped and have no runtimeTargets"}),o1=d.object({started:d.boolean().optional().describe("with exit null: true if the test command started (it was interrupted or timed out), false if it never started. Left out, Testbot counts it as possibly started, with its cleanup unknown"),exit:d.number({invalid_type_error:"must be a number or null"}).nullable().describe("process exit of the re-run; null when no SUT was available"),details:d.string().optional().describe("what failed, or why a file was not run \u2014 required on any non-zero exit"),tests:d.array(s1).optional().describe("ONE ENTRY PER CASE the file covers, its own result; must agree with exit (0 \u2192 no fail; non-zero \u2192 at least one, or the non-test reason in details). The report reads the file by these where they are given")}),a1=d.object({context:d.array(mp).optional().describe("[derived] setup declarations retained for every executed test, including maintained tests"),from:d.string().optional().describe("staged path \u2014 required for placements"),file:$n.describe("final path relative to its repository, inside that checkout, with a source-file extension"),repository:$n.optional().describe("owner/repo the file lives in, when the run has several checkouts; omit for the working checkout"),action:d.nativeEnum(ms),covers:d.array(d.string()).optional().describe("recommend ids a placed test covers"),repro:d.boolean().optional().describe("this test is MEANT to fail \u2014 it reproduces a reported bug"),finding:d.boolean().optional().describe("a non-repro test that failed on a REAL product bug"),placementBroken:d.boolean().optional().describe('placement/harness problem one repair could not fix \u2014 every reran.tests entry is then "skip"'),keptReason:$n.optional().describe("why a planned delete/regenerate was declined and the file kept"),isolatedRun:$n.optional().describe('only for a test marked "runs alone": the command, from its checkout root and without a shell, that runs only this file and writes its JUnit XML into $SKYRAMP_RESULTS_DIR (named by its path: no shell expands it) \u2014 the harness runs it, so leave reran.exit null'),reran:o1,assertionCount:d.number().int().nonnegative().optional().describe("[derived] assertions reachable from the file, counted at write time"),addedOnly:d.boolean().optional().describe("[derived] an existing test file the run only added to: every line it had is still there"),added:d.array($n).optional().describe("[derived] the cases of the test functions the run added to an existing file: functions it did not have"),staleOnBase:d.boolean().optional().describe("[derived] an existing test that fails the same way on the base branch: its failure is the test's own")}).refine(e=>e.action!=="place"||typeof e.from=="string"&&e.from.trim().length>0,{message:'is a place but has no "from" staged path',path:[]}),c1=(n=>(n.Junit="junit",n.Converter="converter",n))(c1||{}),Aoe=$n.optional().describe("the items[].file this test is in \u2014 needed only when two of this suite's files cover the same case id"),hoe=d.object({results:$n.describe("the JUnit XML file this run wrote, a plain file name inside $SKYRAMP_RESULTS_DIR (e.g. backend.xml)"),source:d.nativeEnum(c1),run:$n.describe("the command you ran that wrote it, exactly as you ran it (with any converter)"),files:d.array($n).min(1).describe("the items[].file paths this run covered"),cases:d.array(d.object({test:$n.describe("the test's name as the runner reports it, qualified by its class or file (e.g. tests/test_a.py::test_x) when the bare name repeats"),case:$n.describe("the covers id it realizes"),file:Aoe})).describe("map each reported test name to the case it covers")}),moe=d.object({suites:d.array(hoe).min(1)}),MC=d.object({schemaVersion:d.literal(1),items:d.array(a1),runnerResults:moe.optional().describe("the JUnit XML your test runs wrote into $SKYRAMP_RESULTS_DIR, so the harness reads each test's result from the runner \u2014 omit only when no SUT is available"),ignored:d.array(d.string()).describe("existing tests assessed and deliberately left untouched"),summary:$n.describe("one paragraph")});mu();SC();function u1(e){return e.toUpperCase().replace(/[^A-Z0-9]+/g,"_").replace(/^_+|_+$/g,"")}o(u1,"credentialKeyFromRole");var l1=ee(require("path"));var nn=d.string().trim().min(1),im=nn,LC=(n=>(n.TestbotManaged="testbot_managed",n.CustomerDeployed="customer_deployed",n))(LC||{}),jC=[".skyramp/sut/setup.sh",".skyramp/sut/teardown.sh"],d1=(n=>(n.Refused="refused",n.NoValue="no_value",n))(d1||{}),yoe=d.object({name:d.string().regex(Kn),kind:d.nativeEnum(d1),explanation:nn.optional()}).strict(),p1=d.object({schemaVersion:d.literal(1),type:d.nativeEnum(LC).optional(),repository:im.optional().describe("namespace/name of the source whose checkout the recipe was written and proven in (SKYR-5380); a run replays it from there. Never on a customer_deployed plan"),status:d.enum(["ready","blocked"]),environment:Ru.optional(),components:d.array(d.object({name:nn,repository:nn.describe(`owner/repo, or "${Ui}" for a customer-deployed component no repository builds`),healthy:d.boolean(),url:d.string().min(1).nullable(),...$C,credentials:d.array(d.string().regex(Kn)).max(50).optional(),deployed:nn.nullable().optional().describe("customer_deployed only: the revision the component runs, as setup read it (WF-SETUP-22's Deployed now), or null when it could not tell")}).strict()),suites:d.array(d.object({framework:nn,file:nn,result:d.enum(["pass","fail","error"])}).strict()),inputsUsed:d.array(nn),inputsUsedHow:d.array(d.object({input:nn,how:nn}).strict()).optional(),inputsNotUsed:d.array(d.object({input:nn,reason:nn}).strict()),blockers:d.array(d.object({component:nn,problem:nn,evidence:nn,fix:nn,credential:yoe.optional()}).strict()),replay:d.object({outcome:nn,durationSeconds:d.number().nonnegative().nullable()}).strict().nullable(),files:d.array(d.object({path:nn,content:d.string()}).strict())}).strict().superRefine((e,t)=>{e.inputsUsedHow?.forEach((r,s)=>{e.inputsUsed.includes(r.input)||t.addIssue({code:d.ZodIssueCode.custom,path:["inputsUsedHow",s,"input"],message:"not one of inputsUsed"})}),e.components.forEach((r,s)=>{r.credentials&&new Set(r.credentials).size!==r.credentials.length&&t.addIssue({code:d.ZodIssueCode.custom,path:["components",s,"credentials"],message:"names a credential twice"})});let n=e.type==="customer_deployed";n!==(e.environment!==void 0)&&t.addIssue({code:d.ZodIssueCode.custom,path:["environment"],message:"an environment exactly when the plan's type is customer_deployed"}),n&&e.repository!==void 0&&t.addIssue({code:d.ZodIssueCode.custom,path:["repository"],message:"a customer_deployed plan names no repository"}),e.environment&&new Set(e.environment.credentials).size!==e.environment.credentials.length&&t.addIssue({code:d.ZodIssueCode.custom,path:["environment","credentials"],message:"names a credential twice"});let i=new Set(e.components.map(r=>r.name));if(e.environment?.revisionSources.forEach((r,s)=>{r.components.forEach((a,c)=>{i.has(a)||t.addIssue({code:d.ZodIssueCode.custom,path:["environment","revisionSources",s,"components",c],message:"not one of components"})})}),e.components.forEach((r,s)=>{r.deployed!==void 0!==n&&t.addIssue({code:d.ZodIssueCode.custom,path:["components",s,"deployed"],message:"what a component runs exactly when the plan is customer_deployed"}),r.repository===Ui&&!n&&t.addIssue({code:d.ZodIssueCode.custom,path:["components",s,"repository"],message:`only a customer_deployed component is ${Ui}`})}),n&&(e.components.forEach((r,s)=>{e.components.findIndex(a=>a.name===r.name)!==s&&t.addIssue({code:d.ZodIssueCode.custom,path:["components",s,"name"],message:"names a component twice"})}),e.replay!==null&&t.addIssue({code:d.ZodIssueCode.custom,path:["replay"],message:"a customer_deployed plan is never replayed"}),e.files.forEach((r,s)=>{jC.includes(r.path)&&t.addIssue({code:d.ZodIssueCode.custom,path:["files",s,"path"],message:"a customer_deployed plan has no script that starts or stops the system"})})),n&&e.status==="ready"){let r=new Set(e.environment?.revisionSources.flatMap(s=>s.components));e.components.forEach((s,a)=>{s.repository!==Ui&&!r.has(s.name)&&t.addIssue({code:d.ZodIssueCode.custom,path:["components",a,"name"],message:"a ready customer_deployed plan reads what every component a repository builds runs"})})}});var $Re=["clean","recipe-drift"];function Ep(e){let t=l1.posix.normalize(e);return t===e&&(t===".skyramp/workspace.yml"||t.startsWith(".skyramp/sut/")&&t.length>13)}o(Ep,"isRuntimePlanFile");var bp=d.string().uuid(),vp=d.object({environmentId:d.string().uuid(),allowed:d.boolean(),revision:bp,updatedAt:d.string().datetime(),updatedBy:d.string().uuid()}).strict();var Ip=(a=>(a.NoEnvironment="no_environment",a.NoRecordedGrant="no_recorded_grant",a.Unavailable="unavailable",a.Changed="changed",a.Denied="denied",a.OutOfScope="out_of_scope",a))(Ip||{});function wp(e){switch(e){case"no_environment":return"the run has no selected Test Environment address";case"no_recorded_grant":return"the run's configuration did not record permission to keep test data in this environment";case"unavailable":return"the current permission to keep test data could not be read";case"changed":return"the permission to keep test data changed after the run started";case"denied":return"the environment does not permit test data to stay";case"out_of_scope":return"the request is outside the environment's address"}}o(wp,"persistenceRefusalText");function sm(e,t,n){let i=vp.safeParse(t);return!i.success||!i.data.allowed||!e.environmentId||i.data.environmentId!==e.environmentId||!e.environmentAddress||e.persistentDataPolicy&&e.persistentDataPolicy.revision!==i.data.revision?!1:uo(e.environmentAddress,n)}o(sm,"persistentDataPolicyApplies");function uo(e,t){try{let n=new URL(t),i=new URL(e);if(i.search||i.hash)return!1;let r=/%(?:2f|5c|2e|25)/i;if(t.includes("\\")||e.includes("\\")||r.test(n.pathname)||r.test(i.pathname))return!1;let s=i.pathname.replace(/\/$/,"");return["https:","http:"].includes(i.protocol)&&n.origin===i.origin&&(n.pathname===s||n.pathname.startsWith(`${s}/`))}catch{return!1}}o(uo,"environmentContainsUrl");var GC="delivery-persistence.json",f1=d.object({environmentId:d.string().uuid(),environmentAddress:d.string().url(),revision:bp}).strict(),g1=d.object({refusal:d.nativeEnum(Ip)}).strict();var D1=d.unknown().optional(),_1={handshake:"/api/v1/runner/runs/:runId/attempts",report:"/api/v1/runner/attempts/:attemptId/report",end:"/api/v1/runner/attempts/:attemptId/end",configuration:"/api/v1/runner/attempts/:attemptId/configuration",progress:"/api/v1/runner/attempts/:attemptId/progress",sutRecipe:"/api/v1/runner/attempts/:attemptId/sut-recipe",runtimePlan:"/api/v1/runner/attempts/:attemptId/runtime-plan",persistentDataPolicy:"/api/v1/runner/attempts/:attemptId/persistent-data-policy",heartbeat:"/api/v1/runner/attempts/:attemptId/heartbeat",setupEvents:"/api/v1/runner/attempts/:attemptId/setup-events",runEvents:"/api/v1/runner/attempts/:attemptId/run-events",requirements:"/api/v1/runner/attempts/:attemptId/requirements",requirementFile:"/api/v1/runner/attempts/:attemptId/requirements/:key/file",deployedRevisions:"/api/v1/runner/attempts/:attemptId/deployed-revisions"},Pa=(n=>(n.GitHub="github",n.AzureDevOps="azure-devops",n))(Pa||{}),dm=(s=>(s.Trigger="TRIGGER",s.Baseline="BASELINE",s.AuthoritativeRelatedChange="AUTHORITATIVE_RELATED_CHANGE",s.ConfiguredSharedDependency="CONFIGURED_SHARED_DEPENDENCY",s.ManualOverride="MANUAL_OVERRIDE",s))(dm||{}),pm=(a=>(a.PullRequest="pull_request",a.ReadyForReview="ready_for_review",a.Schedule="schedule",a.Manual="manual",a.SutSetup="sut_setup",a.RevisionRead="revision_read",a))(pm||{}),Eoe=["sut_setup"],boe=["sut_setup","schedule","revision_read"],voe=["sut_setup"],HC=(t=>(t.PullRequest="pull_request",t))(HC||{}),JC=(n=>(n.PullRequest="pull_request",n.Branch="branch",n))(JC||{}),A1=["TRIGGER","AUTHORITATIVE_RELATED_CHANGE","MANUAL_OVERRIDE"];var fm=(r=>(r.None="none",r.Delivered="delivered",r.Partial="partial",r.Failed="failed",r))(fm||{}),kp=(s=>(s.ReportUploaded="report_uploaded",s.NoReport="no_report",s.Cancelled="cancelled",s.RecipeUploaded="recipe_uploaded",s.RevisionsUploaded="revisions_uploaded",s))(kp||{}),N1=(n=>(n.Running="running",n.Ended="ended",n))(N1||{}),Bp=(A=>(A.TimedOut="timed_out",A.AgentFailed="agent_failed",A.SetupFailed="setup_failed",A.CredentialMissing="credential_missing",A.RunnerLost="runner_lost",A.CheckoutFailed="checkout_failed",A.EnvironmentUnverified="environment_unverified",A.ModelProviderDenied="model_provider_denied",A.ModelProviderUnavailable="model_provider_unavailable",A.RunnerProviderNotReady="runner_provider_not_ready",A.MergeConflict="merge_conflict",A.EnvironmentUnavailable="environment_unavailable",A))(Bp||{}),P1=(i=>(i.Onboard="onboard",i.Deploy="deploy",i.Recheck="recheck",i))(P1||{}),YC=(n=>(n.Started="started",n.Finished="finished",n))(YC||{}),U1=(i=>(i.Passed="passed",i.Failed="failed",i.Skipped="skipped",i))(U1||{});var F1=(i=>(i.ChooseCredential="choose_credential",i.FreeText="free_text",i.ChooseSource="choose_source",i))(F1||{});var O1=(r=>(r.Answered="answered",r.Followed="followed",r.NotFollowed="not_followed",r.TooLate="too_late",r))(O1||{}),WC=(i=>(i.Discover="discover",i.Start="start",i.Check="check",i))(WC||{}),VC=(r=>(r.ValidationPlan="validation_plan",r.TestEnvironment="test_environment",r.TestConditions="test_conditions",r.Tests="tests",r))(VC||{});var ZC=(r=>(r.Found="found",r.Starting="starting",r.Up="up",r.OutOfScope="out_of_scope",r))(ZC||{}),Lr=d.string().regex(/^[1-9][0-9]{0,18}$/),jr=d.string().regex(/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/),zC=d.string().regex(/^(?!.*\.\.)(?!\/)(?!.*\/$)[A-Za-z0-9._/-]{1,255}$/),Du=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function M1(e,t){return`${e.replace(/\/+$/,"")}/runs/${t}`}o(M1,"skyrampRunPageUrl");var In=d.string().regex(Du),Dn=d.string().regex(/^[0-9a-f]{64}$/),lm=d.object({id:In,revision:Lr}).strict(),gm={provider:d.literal("github"),providerAccountId:Lr,providerRepositoryId:Lr},Am={provider:d.literal("azure-devops"),providerAccountId:In,providerRepositoryId:In},Ir=d.discriminatedUnion("provider",[d.object(gm).strict(),d.object(Am).strict()]),KC=d.discriminatedUnion("provider",[d.object(gm).passthrough(),d.object(Am).passthrough()]),ji=o(e=>`${e.provider}:${e.providerRepositoryId}`,"sourceKey"),h1={namespace:d.string().min(1),name:d.string().min(1)},L1=d.discriminatedUnion("provider",[d.object({...gm,...h1}).strict(),d.object({...Am,...h1}).strict()]),m1=d.object({ref:d.string().min(1),revision:jr}).strict(),Ioe=d.object({kind:d.nativeEnum(JC),number:Lr.optional(),ref:d.string().min(1),revision:jr,reason:d.nativeEnum(dm)}).strict(),woe=d.object({repository:L1,revision:jr,ref:d.string().nullable(),reason:d.nativeEnum(dm),change:d.object({kind:d.nativeEnum(HC),number:Lr,base:m1.optional()}).strict().nullable(),compareWith:m1.optional(),merge:d.array(Ioe).min(2).optional()}).strict();function Coe(e){let t=e.merge;if(!t)return null;if(e.change||e.compareWith)return{path:["merge"],message:"a merged source names no change and no compareWith"};if(e.ref===null)return{path:["ref"],message:"a merged source names its baseline branch"};let n=new Set,i=new Set;for(let[s,a]of t.entries()){if(a.kind==="pull_request"!=(a.number!==void 0))return{path:["merge",s,"number"],message:"a pull request names its number, and a branch none"};if(!A1.includes(a.reason))return{path:["merge",s,"reason"],message:`${a.reason} does not select a merged revision`};if(a.kind==="branch"&&a.reason!=="MANUAL_OVERRIDE")return{path:["merge",s,"reason"],message:"only a person chooses a branch to merge"};if(a.ref===e.ref)return{path:["merge",s,"ref"],message:"the baseline branch is what the source merges onto"};if(a.number!==void 0&&n.has(a.number)||i.has(a.ref))return{path:["merge",s],message:"names a revision the source already merges"};a.number!==void 0&&n.add(a.number),i.add(a.ref)}let r=A1.find(s=>t.some(a=>a.reason===s));return e.reason!==r?{path:["reason"],message:`a source that merges these revisions is ${r}`}:null}o(Coe,"mergedSourceIssue");function Soe(e){if(e.trigger.kind==="revision_read"!=!e.baseline)return e.baseline?"a revision_read run names no baseline":"names its baseline";if(!e.baseline)return null;let{confirmedRunId:t,initialBaselineId:n,comparisonBaselineId:i,sources:r}=e.baseline;if([t,n,i].filter(l=>l!=null).length>1)return"a run compares with one baseline";let s=e.trigger.kind==="schedule"&&t!==null||n!==void 0||i!==void 0;if(!r)return s?"names every source of the snapshot, once":null;if(t===null&&n===void 0&&i===void 0)return"a run with no Confirmed Baseline names no baseline sources";let a=new Set(e.sources.map(l=>ji(l.repository))),c=new Set(r.map(l=>ji(l.repository)));return c.size===r.length&&c.size===a.size&&[...c].every(l=>a.has(l))?null:"names every source of the snapshot, once"}o(Soe,"baselineSourcesIssue");var j1=/^[A-Z][A-Z0-9_]+-[1-9][0-9]*$/,G1=/^[1-9][0-9]{0,18}$/,y1=new RegExp(`${j1.source}|${G1.source}`),E1=/^https:\/\/[a-z0-9-]+(\.[a-z0-9-]+)+$/,koe=d.union([d.object({source:d.literal("jira"),site:d.string().regex(E1),key:d.string().regex(j1),updated:d.string().datetime(),contentHash:Dn}).strict(),d.object({source:d.literal("confluence"),site:d.string().regex(E1),key:d.string().regex(G1),version:d.number().int().positive(),contentHash:Dn}).strict(),d.object({source:d.literal("other"),key:d.string().regex(dp),contentHash:Dn}).strict(),d.object({source:d.literal("other"),key:d.string().regex(hs),contentHash:Dn,fileName:d.string().min(1).max(255),mediaType:d.nativeEnum(pp)}).strict()]),b1=d.union([d.literal("jira"),d.literal("confluence")]),Boe=d.object({schemaVersion:d.literal(1),items:d.array(d.union([d.object({source:b1,site:d.string(),key:d.string().regex(y1),state:d.literal("read"),text:d.string(),version:d.string().min(1),contentMatches:d.boolean()}).strict(),d.object({source:b1,site:d.string(),key:d.string().regex(y1),state:d.literal("not_read"),reason:d.nativeEnum(Da)}).strict(),d.object({source:d.literal("other"),key:d.string().regex(dp),state:d.literal("read"),text:d.string(),version:d.string().min(1),contentMatches:d.boolean()}).strict(),d.object({source:d.literal("other"),key:d.string().regex(dp),state:d.literal("not_read"),reason:d.nativeEnum(Da)}).strict(),d.object({source:d.literal("other"),key:d.string().regex(hs),state:d.literal("read"),version:Dn,fileName:d.string().min(1).max(255),mediaType:d.nativeEnum(pp)}).strict(),d.object({source:d.literal("other"),key:d.string().regex(hs),state:d.literal("not_read"),reason:d.nativeEnum(Da)}).strict()])),instructions:d.array(d.string()).optional()}).strict(),Roe=d.object({resultId:d.string().min(1),repository:d.string().min(1),testType:d.string().min(1),path:d.string(),finding:d.string().min(1)}).strict(),xoe=d.object({schemaVersion:d.literal(1),runId:In,skyrampOrgId:In,target:lm,policy:lm.nullable(),trigger:d.object({kind:d.nativeEnum(pm),requestedAt:d.string().datetime()}).strict(),configuration:d.object({captureId:In,revision:Lr.nullable(),hash:Dn}).strict(),baseline:d.object({confirmedRunId:In.nullable(),initialBaselineId:In.optional(),comparisonBaselineId:In.optional(),knownFailures:d.array(Roe).optional(),sources:d.array(d.object({repository:Ir,revision:jr}).strict()).optional()}).strict().optional(),sources:d.array(woe).min(1).max(1e3),execution:d.object({provider:d.nativeEnum(Pa),repository:L1,workflowPath:d.string(),ref:d.string()}).strict(),credentials:d.array(d.object({name:d.string(),purpose:d.nativeEnum(up),required:d.boolean()}).strict()),requirements:d.array(koe).min(1).optional(),instructions:d.object({contentHash:Dn}).strict().optional(),deployedRevisions:d.array(d.object({repository:Ir,revision:jr}).strict()).min(1).optional()}).strict().superRefine((e,t)=>{let n=new Set;(e.requirements??[]).forEach((u,l)=>{let p="fileName"in u?"file":"pasted";u.source==="other"&&u.key!==`${p}-${u.contentHash.slice(0,16)}`&&t.addIssue({code:d.ZodIssueCode.custom,message:"is not the key of its content hash",path:["requirements",l,"key"]});let f=UC({source:u.source,key:u.key});n.has(f)&&t.addIssue({code:d.ZodIssueCode.custom,message:"names an item that the run already names",path:["requirements",l,"key"]}),n.add(f)});let i=e.trigger.kind,r=Eoe.includes(i);r!==(e.policy===null)&&t.addIssue({code:d.ZodIssueCode.custom,path:["policy"],message:r?`a ${i} run has no policy`:"names the policy revision"}),e.baseline?.knownFailures&&!e.baseline.comparisonBaselineId&&t.addIssue({code:d.ZodIssueCode.custom,path:["baseline","knownFailures"],message:"known failures require a chosen comparison checkpoint"});let s=Soe(e);s&&t.addIssue({code:d.ZodIssueCode.custom,path:e.baseline?["baseline","sources"]:["baseline"],message:s}),boe.includes(i)&&e.sources.forEach((u,l)=>{u.reason!=="BASELINE"&&t.addIssue({code:d.ZodIssueCode.custom,path:["sources",l,"reason"],message:`a ${i} run selects only BASELINE sources`})}),e.deployedRevisions&&i!=="manual"&&t.addIssue({code:d.ZodIssueCode.custom,path:["deployedRevisions"],message:"only a manual run pins deployed revisions"});let a=new Set(e.sources.map(u=>ji(u.repository))),c=new Set;(e.deployedRevisions??[]).forEach((u,l)=>{let p=ji(u.repository);a.has(p)?c.has(p)&&t.addIssue({code:d.ZodIssueCode.custom,path:["deployedRevisions",l,"repository"],message:"repository appears twice"}):t.addIssue({code:d.ZodIssueCode.custom,path:["deployedRevisions",l,"repository"],message:"names a repository outside the snapshot"}),c.add(p)}),e.sources.forEach((u,l)=>{u.compareWith&&(u.reason!=="MANUAL_OVERRIDE"||u.change)&&t.addIssue({code:d.ZodIssueCode.custom,path:["sources",l,"compareWith"],message:"only a MANUAL_OVERRIDE source without a change names a revision to compare with"}),e.baseline?.comparisonBaselineId&&(u.change?.base||u.compareWith||u.merge)&&t.addIssue({code:d.ZodIssueCode.custom,path:["sources",l],message:"a chosen checkpoint cannot be combined with a source comparison base or merge"});let p=Coe(u);p&&t.addIssue({code:d.ZodIssueCode.custom,path:["sources",l,...p.path],message:p.message})})});var XC=(n=>(n.Person="person",n.Policy="policy",n))(XC||{}),Qoe=d.object({kind:d.nativeEnum(XC),name:d.string().min(1).max(256)}).strict(),$oe=d.object({mcp:d.discriminatedUnion("source",[d.object({source:d.literal("npm"),version:d.string().regex(/^[A-Za-z0-9][A-Za-z0-9.+_-]{0,63}$/).nullable()}).strict(),d.object({source:d.literal("github"),ref:d.string().regex(/^[A-Za-z0-9._/-]{1,255}$/)}).strict()]),bedrock:d.object({region:d.string().regex(/^[a-z]{2}(-[a-z]+)+-[0-9]$/),roleArn:d.string().regex(/^arn:aws(-[a-z]+)*:iam::[0-9]{12}:role\/[\w+=,.@/-]{1,512}$/)}).strict().nullable()}).strict(),Toe=d.object({schemaVersion:d.literal(1),attempt:d.object({id:In,number:d.number().int().positive(),deadlineAt:d.string().datetime()}).strict(),manifest:xoe,manifestHash:Dn,entitlements:d.array(d.string()).optional(),runToken:d.string().min(1).optional(),requestedBy:Qoe.nullable().optional(),writeAllowed:d.boolean().optional(),claudeCodeVersion:d.string().regex(/^[0-9]+\.[0-9]+\.[0-9]+$/,"an exact version, such as 2.1.290").nullable().optional(),deployedRevisions:d.array(d.object({repository:Ir,revision:jr}).strict()).optional(),statedRevisions:d.array(d.object({repository:Ir,revision:jr}).strict()).optional(),runSettings:$oe.optional()}).strict(),v1={providerRunAttempt:d.number().int().positive(),workflowRef:d.string().min(1)},Doe=d.string().regex(/^[^/]+\/[^/]+\/[1-9][0-9]{0,15}\/[1-9][0-9]{0,15}$/),_oe=d.object({schemaVersion:d.literal(1),runId:In,execution:d.discriminatedUnion("provider",[d.object({...v1,provider:d.literal("github"),repository:d.object(gm).strict(),providerRunId:Lr}).strict(),d.object({...v1,provider:d.literal("azure-devops"),repository:d.object(Am).strict(),providerRunId:Doe}).strict()]),requester:d.literal(!0).optional(),writeCheck:d.literal(!0).optional(),claudeCodePin:d.literal(!0).optional(),deployedPins:d.literal(!0).optional(),statedPins:d.literal(!0).optional(),runSettings:d.literal(!0).optional(),credentialKinds:d.literal(!0).optional(),credentialBlockers:d.literal(!0).optional()}).strict(),I1=d.object({repository:Ir,number:Lr,commitSha:jr.optional()}).strict(),om=d.array(d.object({repository:Ir,reason:d.string().max(4096).regex(/\S/)}).strict()).max(1e3).optional(),V1=d.object({branch:zC.optional(),commitSha:jr.optional()}).strict(),hm=4096,z1=d.array(d.object({file:d.string().max(4096).regex(/\S/),dependsOn:d.array(d.string().max(2048).regex(/\S/)).max(100)}).strict()).min(1).max(500),w1=d.object({repository:Ir,message:d.string().max(hm),...V1.shape,heldBack:z1.optional()}).strict(),Noe=d.discriminatedUnion("status",[d.object({status:d.literal("none"),noTests:om}).strict(),d.object({status:d.literal("delivered"),noTests:om,pullRequests:d.array(I1).min(1)}).strict(),d.object({status:d.literal("partial"),noTests:om,pullRequests:d.array(I1).min(1),failures:d.array(w1).min(1)}).strict(),d.object({status:d.literal("failed"),message:d.string().max(hm),noTests:om,failures:d.array(w1).min(1).optional()}).strict()]),eS=1024*1024,q1=16*1024*1024,Cp={id:4096,text:16384,businessCase:65536},Rp={id:Cp.id,statement:Cp.text,rows:1e3},C1=d.string().min(1).max(Cp.id),cm=d.string().max(Cp.text),am=o((e,t)=>d.array(d.object({[e]:cm}).strict()).max(t).optional(),"texts"),tS=d.object({language:d.custom(e=>e==="ja","Invalid"),businessCaseAnalysis:d.string().max(Cp.businessCase),validation:d.object({rationale:cm.min(1),gaps:d.array(d.string().min(1).max(4096)).max(200)}).strict().optional(),changes:d.array(d.object({id:C1,text:cm}).strict()).max(1e3).optional(),requirements:d.array(d.object({id:C1,statement:cm}).strict()).max(Rp.rows).optional(),issuesFound:am("description",5e3),newTestsCreated:am("description",5e3),testResults:am("details",5e3),caveats:am("text",100)}).strict(),Poe=d.object({blockedPreflight:d.object({file:d.string().min(1),repository:d.string().min(1).optional(),reason:d.string().min(1).max(300),evidence:d.string().min(1).max(400)}).strict().optional(),sufficiency:d.nativeEnum(Oi),rationale:d.string().min(1),gaps:d.array(d.string().min(1)),acceptedEvidence:d.array(d.object({kind:d.nativeEnum(co),repository:d.string().min(1),revision:jr,reference:d.string().min(1),summary:d.string().min(1)}).strict()),actionRequired:d.array(d.nativeEnum(xu))}).strict().superRefine((e,t)=>{e.sufficiency==="insufficient"!=e.gaps.length>0&&t.addIssue({code:d.ZodIssueCode.custom,path:["gaps"],message:"only insufficient evidence names gaps, and it names at least one"}),new Set(e.actionRequired).size!==e.actionRequired.length&&t.addIssue({code:d.ZodIssueCode.custom,path:["actionRequired"],message:"a reason appears twice"})}),um=500,H1=2048,J1=1e3,Uoe=/[\\/:*?"<>|;#$*{},+=[\]%\p{Cc}\p{Cf}]/u,S1=o(e=>e.length>0&&e.length<=64&&e===e.trim()&&!Uoe.test(e)&&!/[^\S ]/u.test(e)&&!/^[._]/.test(e)&&!e.endsWith("."),"isAzureName"),Y1=o(e=>{if(/^[A-Za-z0-9._-]{1,100}\/[A-Za-z0-9._-]{1,100}$/.test(e))return!0;let[t,n,i,...r]=e.split("/");return e.length<=201&&r.length===0&&i!==void 0&&/^[A-Za-z0-9](?:[A-Za-z0-9-]{0,48}[A-Za-z0-9])?$/.test(t)&&S1(n)&&S1(i)},"isResultRepository"),Foe=d.object({testResults:d.array(d.object({resultId:d.string().regex(/^[^\u0000-\u001f]{1,512}$/),repository:d.string().refine(Y1,"Invalid"),testType:d.string(),runtimeTargets:yp.optional(),endpoint:d.string(),status:d.enum(["Pass","Fail","Skipped"]),details:d.string(),fileName:d.string().optional(),testId:d.string().regex(/^[^\u0000-\u001f]{1,512}$/).optional(),failureCause:d.object({kind:d.nativeEnum(fp),family:d.nativeEnum(gp).optional()}).strict().optional(),origin:d.nativeEnum(Xh).optional()}).strict()),validation:Poe,changes:d.array(d.object({id:d.string().min(1).max(512),text:d.string().max(16384),source:d.string().max(H1),testedBy:d.array(d.string().min(1).max(1024)).max(um),writtenBy:d.array(d.string().min(1).max(1024)).max(um),maintainedBy:d.array(d.string().min(1).max(1024)).max(um)}).strict()).max(J1).optional(),traceVersion:d.literal(1),display:tS.optional()}).passthrough().superRefine((e,t)=>{let n=e.display,i={issuesFound:e.issuesFound,newTestsCreated:e.newTestsCreated,testResults:e.testResults,caveats:e.caveats};for(let s of["issuesFound","newTestsCreated","testResults","caveats"]){let a=n?.[s];a&&a.length!==(Array.isArray(i[s])?i[s].length:0)&&t.addIssue({code:d.ZodIssueCode.custom,path:["display",s],message:`has not one row per ${s} row`})}n?.validation&&n.validation.gaps.length!==e.validation.gaps.length&&t.addIssue({code:d.ZodIssueCode.custom,path:["display","validation","gaps"],message:"has not one gap per validation gap"});let r=new Set;e.testResults.forEach((s,a)=>{let c=s.failureCause;c&&s.status==="Pass"&&t.addIssue({code:d.ZodIssueCode.custom,path:["testResults",a,"failureCause"],message:"a passing result has no failure cause"}),c&&c.kind==="environment"!=(c.family!==void 0)&&t.addIssue({code:d.ZodIssueCode.custom,path:["testResults",a,"failureCause"],message:"an environment cause names its family, and no other cause does"});let u=["testResults",a,"resultId"],l=s.resultId.slice(`${s.repository}:${s.testType}:`.length);(!s.resultId.startsWith(`${s.repository}:${s.testType}:`)||l===""||l.startsWith("/")||l.startsWith("#"))&&t.addIssue({code:d.ZodIssueCode.custom,path:u,message:"is not repository:testType:path for this result"}),r.has(s.resultId)&&t.addIssue({code:d.ZodIssueCode.custom,path:u,message:"stable identity repeated"}),r.add(s.resultId)})}),k1=o(e=>e.replace(/[%:#]/g,t=>encodeURIComponent(t)),"encodeIdPart");function nS(e,t,n,i){let r=n.replace(/\\/g,"/"),s=r.split("/").filter(u=>u!==""&&u!==".");if(r.startsWith("/")||/^[A-Za-z]:/.test(r)||s.length===0||s.includes(".."))throw new Error(`testResultId needs a path relative to the repository root, got "${n}"`);let a=s.join("/"),c=`${e}:${t}:${k1(a)}`;return i?`${c}#${k1(i)}`:c}o(nS,"testResultId");var mm=(i=>(i.BranchPushed="branch_pushed",i.PullRequestOpened="pull_request_opened",i.PullRequestEdited="pull_request_edited",i))(mm||{}),W1=50,Z1=d.discriminatedUnion("kind",[d.object({kind:d.literal("branch_pushed"),repository:Ir,branch:zC,commit:jr}).strict(),d.object({kind:d.enum(["pull_request_opened","pull_request_edited"]),repository:Ir,number:Lr,branch:zC}).strict()]),Ooe=100,Moe=2048,zRe=d.object({records:d.array(d.string().regex(/^https?:\/\/[^\s/?#@]+(\/[^\s?#]*)?$/).max(Moe)).max(Ooe),unlisted:d.number().int().nonnegative()}).strict().refine(e=>e.records.length+e.unlisted>0,"names at least one create"),K1=d.object({schemaVersion:d.literal(1),run:d.object({runId:In,attemptNumber:d.number().int().positive(),manifestHash:Dn}).strict(),target:lm,policy:lm,provenance:d.object({sources:d.array(d.object({repository:Ir,revision:jr}).strict()),firstQualification:d.literal(!0).optional()}).strict(),delivery:d.object({generatedTests:Noe}).strict(),producer:d.object({testbot:d.string().regex(/^[0-9A-Za-z.+-]{1,64}$/),mcp:d.string().regex(/^[0-9A-Za-z.+-]{1,64}$/)}).strict(),report:Foe,githubWrites:d.array(Z1).max(W1).optional()}).strict(),rS=(r=>(r.Recipe="recipe",r.CredentialRejected="credential_rejected",r.Environment="environment",r.Unknown="unknown",r))(rS||{}),iS=200,Loe=d.object({cause:d.nativeEnum(rS),credential:d.string().regex(Kn).optional(),reason:d.string().trim().min(1).max(iS).optional()}).strict().refine(e=>e.cause==="credential_rejected"==(e.credential!==void 0&&e.reason!==void 0),{message:"a credential_rejected check, and only one, names the credential and why"}),joe=d.object({name:d.string().regex(Kn),purpose:d.enum(["sut_access","other"]),required:d.boolean(),how:d.string().trim().min(1).max(Kh)}).strict(),qRe=K1.pick({schemaVersion:!0,run:!0,target:!0,provenance:!0,producer:!0}).extend({recipe:p1,check:Loe.optional(),inputs:d.array(joe).min(1).max(50).optional()}).strict().superRefine(({recipe:e},t)=>{let n=o((s,a)=>t.addIssue({code:d.ZodIssueCode.custom,path:["recipe",...s],message:a}),"issue");e.status==="blocked"&&e.blockers.length===0&&n(["blockers"],"a blocked recipe names at least one blocker");let i=new Set,r=0;e.files.forEach((s,a)=>{Ep(s.path)||n(["files",a,"path"],"is not a file under .skyramp/sut/, or the .skyramp/workspace.yml a recipe stored before SKYR-5829 carries"),i.has(s.path)&&n(["files",a,"path"],"file repeated"),i.add(s.path),t1.test(s.content)&&n(["files",a,"content"],"is not text");let c=Buffer.byteLength(s.content,"utf8");r+=c,c>_C&&n(["files",a,"content"],`larger than ${_C} bytes`)}),r>NC&&n(["files"],`recipe text over ${NC} bytes in total`)}),HRe=d.object({components:d.array(d.object({name:d.string().min(1),repository:d.string().refine(Y1,"Invalid"),observedRevision:d.string().regex(/^[0-9a-f]{7,64}$/).nullable(),source:d.nativeEnum(em),evidence:d.string()}).strict().refine(e=>e.source!=="agent"||e.observedRevision===null,{path:["observedRevision"],message:"a component only an agent session can read names no revision"}))}).strict();function X1(e){return e.trigger.kind==="schedule"||e.trigger.kind==="manual"&&e.sources.every(t=>t.reason==="BASELINE")}o(X1,"readsDeployedState");var Goe=d.object({schemaVersion:d.literal(1),stage:d.nativeEnum(P1),event:d.nativeEnum(YC),status:d.nativeEnum(U1).optional()}).strict().refine(e=>e.status===void 0||e.event==="finished",{path:["status"],message:"only a finished stage has a status"}),ym=100,Voe=5e3,Na=2e3,B1=100,eG=/^[A-Za-z0-9_-]{1,64}$/,zoe=20,qoe=200,Hoe=100,Joe=100,Yoe=200,R1="[^/\\s](?:(?:[^/\\s]| )*[^/\\s])?",Woe=new RegExp(`^(?:[^/\\s]+/[^/\\s]+|[^/\\s]+/${R1}/${R1})$`),Zoe=500,x1=50,Koe=10,Xoe=/^[A-Za-z0-9](?:[A-Za-z0-9 _-]{0,48}[A-Za-z0-9])?$/,tG=/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]|[\ud800-\udbff](?![\udc00-\udfff])|(?<![\ud800-\udbff])[\udc00-\udfff]/,vr=o(e=>d.string().max(e).refine(t=>t.trim().length>0&&!tG.test(t),"blank, or not text"),"setupText"),Li={sequence:d.number().int().min(1).max(Voe),at:d.string().regex(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,6})?Z$/)},nG=d.object({...Li,kind:d.literal("reply"),to:d.string().uuid(),outcome:d.nativeEnum(O1),accepted:d.boolean(),text:vr(Na),note:d.object({source:d.enum(["target","environment"]),quote:vr(Na)}).strict().optional(),kept:vr(Na).optional()}).strict();function rG(e,t){if(e.kind!=="reply")return;let n=e;n.accepted!==(n.outcome==="answered"||n.outcome==="followed")&&t.addIssue({code:d.ZodIssueCode.custom,path:["accepted"],message:"accepted exactly when answered or followed"}),n.note&&n.outcome!=="not_followed"&&t.addIssue({code:d.ZodIssueCode.custom,path:["note"],message:"a note only when not_followed"}),n.kept&&n.outcome!=="followed"&&t.addIssue({code:d.ZodIssueCode.custom,path:["kept"],message:"kept only when followed"})}o(rG,"checkReply");var eae=d.discriminatedUnion("kind",[d.object({...Li,kind:d.literal("log"),phase:d.nativeEnum(WC),text:vr(Na)}).strict(),d.object({...Li,kind:d.literal("component"),name:vr(B1),repository:vr(Yoe).refine(e=>Woe.test(e)||e===Ui,"not owner/name"),file:vr(Zoe).nullable(),status:d.nativeEnum(ZC),version:vr(Joe).optional()}).strict(),nG,d.object({...Li,kind:d.literal("question"),id:d.string().regex(eG),type:d.nativeEnum(F1),text:vr(Na),component:vr(B1).nullable(),choices:d.array(vr(qoe)).max(zoe),placeholder:vr(Hoe).optional()}).strict(),d.object({...Li,kind:d.literal("delivered"),ids:d.array(d.string().uuid()).max(ym)}).strict(),d.object({...Li,kind:d.literal("credentials"),names:d.array(d.string().regex(Kn)).min(1).max(x1),logins:d.array(d.object({key:d.string().regex(Xoe),usernameVariable:d.string().regex(Kn),passwordVariable:d.string().regex(Kn)}).strict()).min(1).max(Koe).optional(),variables:d.array(d.string().regex(Kn)).min(1).max(x1).optional()}).strict()]).superRefine((e,t)=>{if(rG(e,t),e.kind==="credentials"&&new Set(e.names).size!==e.names.length&&t.addIssue({code:d.ZodIssueCode.custom,path:["names"],message:"a name twice"}),e.kind==="credentials"&&e.logins){let n=e.logins.map(i=>u1(i.key));new Set(n).size!==n.length&&t.addIssue({code:d.ZodIssueCode.custom,path:["logins"],message:"a key twice"}),e.logins.forEach((i,r)=>{for(let s of["usernameVariable","passwordVariable"])e.names.includes(i[s])||t.addIssue({code:d.ZodIssueCode.custom,path:["logins",r,s],message:"not one of the names"})})}e.kind==="credentials"&&e.variables&&(new Set(e.variables).size!==e.variables.length&&t.addIssue({code:d.ZodIssueCode.custom,path:["variables"],message:"a name twice"}),e.variables.forEach((n,i)=>{e.names.includes(n)||t.addIssue({code:d.ZodIssueCode.custom,path:["variables",i],message:"not one of the names"})})),e.kind==="question"&&(e.type==="free_text"!=(e.choices.length===0)&&t.addIssue({code:d.ZodIssueCode.custom,path:["choices"],message:"choices exactly when the question is not free_text"}),new Set(e.choices).size!==e.choices.length&&t.addIssue({code:d.ZodIssueCode.custom,path:["choices"],message:"a choice twice"}))}),tae=d.object({schemaVersion:d.literal(1),events:d.array(eae).max(ym)}).strict(),nae=d.discriminatedUnion("kind",[d.object({...Li,kind:d.literal("log"),stage:d.nativeEnum(VC),text:vr(Na)}).strict(),nG,d.object({...Li,kind:d.literal("delivered"),ids:d.array(d.string().uuid()).max(ym)}).strict(),d.object({...Li,kind:d.literal("stage"),stage:d.nativeEnum(VC),event:d.nativeEnum(YC)}).strict(),d.object({...Li,kind:d.literal("test"),resultId:d.string().regex(/^[^\u0000-\u001f]{1,512}$/),status:d.enum(["Pass","Fail","Skipped"]),details:d.string().max(Na).refine(e=>!tG.test(e),"not text")}).strict()]).superRefine(rG),rae=d.object({schemaVersion:d.literal(1),events:d.array(nae).max(ym)}).strict(),Q1={id:d.string().uuid(),text:d.string(),by:d.string().nullable(),at:d.string(),replied:d.literal(!0).optional()},iG=d.discriminatedUnion("kind",[d.object({...Q1,kind:d.literal("instruction"),question:d.null()}),d.object({...Q1,kind:d.literal("answer"),question:d.string().regex(eG)})]),sG=d.string().regex(/^[A-Za-z0-9+/]{43}=$/),iae=d.object({id:d.string().uuid(),revision:d.string(),by:d.string().nullable(),at:d.string(),target:d.string(),own:d.object({source:d.enum(["policy","test_environment"]),text:d.string()}).nullable()}),sae=d.object({schemaVersion:d.literal(1),leftOut:d.array(d.string()),messages:d.array(iG).optional(),stop:d.object({key:sG}).optional(),notes:iae.optional()}),oae=d.object({schemaVersion:d.literal(1),messages:d.array(iG).optional()});var aae=500*1024*1024,oG=d.object({id:Lr,name:d.string().regex(/^[A-Za-z0-9._-]{1,200}$/),providerRunId:Lr,expiresAt:d.string().datetime()}).strict(),cae=d.object({schemaVersion:d.literal(1),artifact:oG,sessionId:In,contentHash:Dn,bytes:d.number().int().min(1).max(aae)}).strict(),uae=d.object({schemaVersion:d.literal(1),checkpoint:d.object({artifact:oG,repository:d.object({namespace:d.string().min(1),name:d.string().min(1)}).strict(),sessionId:In,contentHash:Dn,key:sG}).strict().nullable()}).strict(),lae=200,Qu=100,aG=(i=>(i.Resume="resume",i.Retry="retry",i.Update="update",i))(aG||{}),dae=d.object({kind:d.nativeEnum(aG),setup:d.object({runId:In,endedAt:d.string().nullable(),outcome:d.string().nullable()}).strict(),components:d.array(d.object({name:d.string().min(1),repository:d.string().min(1),status:d.nativeEnum(ZC)}).strict()).max(Qu),credentials:d.array(d.string().min(1)).max(Qu),answers:d.array(d.object({question:d.string(),answer:d.string().nullable()}).strict()).max(Qu),instructions:d.array(d.object({text:d.string(),reply:d.string().nullable()}).strict()).max(Qu),log:d.array(d.object({phase:d.nativeEnum(WC),text:d.string()}).strict()).max(lae),recipe:d.object({files:d.array(d.object({path:d.string().min(1),content:d.string()}).strict()).max(Qu),blockers:d.array(d.object({component:d.string(),problem:d.string(),evidence:d.string(),fix:d.string()}).strict()).max(Qu)}).strict().optional()}).strict(),pae=d.object({schemaVersion:d.literal(1),context:dae.nullable()}).strict(),fae=d.object({schemaVersion:d.literal(1),configuration:d.object({captureId:In,revision:Lr.nullable(),hash:Dn}).strict(),capture:d.object({schemaVersion:d.literal(1),settings:d.object({target:d.object({environment:d.unknown()}).passthrough(),timeoutMinutes:d.number().int().positive(),answerWaitMinutes:d.number().int().positive().optional(),testEnvironment:d.object({name:d.string().min(1),address:d.string().min(1).optional(),readyWhen:d.string().min(1).optional(),environmentId:d.string().uuid().optional(),persistentDataPolicy:D1}).passthrough().optional()}).passthrough(),provenance:d.object({}).passthrough(),hash:Dn}).strict()}).strict(),cG=d.object({schemaVersion:d.literal(1),environmentId:d.string().uuid().nullable(),environmentAddress:d.string().url().nullable(),persistentDataPolicy:vp.nullable()}).strict(),gae=Ru.extend({environmentId:d.string().uuid().optional(),persistentDataPolicy:D1,version:d.number().int().positive(),components:d.array(d.object({name:d.string().min(1),repository:d.string().min(1)}).strict()),contentHash:Dn.optional(),files:d.array(d.object({path:d.string().refine(e=>Ep(e)&&!jC.includes(e),"not a file of a customer_deployed plan"),content:d.string()}).strict()).optional()}).strict(),Aae=d.object({schemaVersion:d.literal(1),testEnvironment:gae.nullable().optional(),runtimePlan:d.object({version:d.number().int().positive(),contentHash:Dn,files:d.array(d.object({path:d.string().refine(Ep,"not a recipe file path"),content:d.string()}).strict()).min(1),repository:im.optional(),recipeRepository:im.optional(),recipe:d.record(d.unknown()).optional()}).strict().nullable()}).strict().refine(e=>!(e.runtimePlan&&e.testEnvironment),{message:"a run pins a recipe or a customer's Test Environment, never both",path:["testEnvironment"]}),uG=d.object({schemaVersion:d.literal(1),state:d.nativeEnum(N1),ending:d.nativeEnum(kp).nullable(),cause:d.nativeEnum(Bp).nullable(),deadlineAt:d.string().datetime()}).strict();function lG(e,t){return e.state==="ended"?e.ending==="cancelled"?"cancelled":e.cause==="runner_lost"?"expired":"ended":t.getTime()>=Date.parse(e.deadlineAt)?"expired":null}o(lG,"attemptClosure");var dG=50,JRe=d.object({repository:Ir,revisions:d.array(d.number().int().nonnegative()).min(1).max(2).refine(e=>e.length<2||e[0]<e[1],"two revisions name the earlier first"),files:d.array(d.string().min(1)).min(1).max(dG)}).strict();function qC(e){if(typeof e=="number"&&!Number.isFinite(e))throw new TypeError("Canonical JSON requires JSON values");if(Array.isArray(e))return`[${e.map(qC).join(",")}]`;if(e!==null&&typeof e=="object"){let n=e;return`{${Object.keys(n).sort().map(i=>`${JSON.stringify(i)}:${qC(n[i])}`).join(",")}}`}let t=JSON.stringify(e);if(t===void 0)throw new TypeError("Canonical JSON requires JSON values");return t}o(qC,"canonicalJson");function pG(e){return(0,T1.createHash)("sha256").update(qC(e),"utf8").digest("hex")}o(pG,"manifestHash");var $u=o(e=>({provider:e.provider,providerAccountId:e.providerAccountId,providerRepositoryId:e.providerRepositoryId}),"toSourceRef");function sS(e,t,{statedPins:n=!0,credentialKinds:i=!0,credentialBlockers:r=!0}={}){return _oe.parse({schemaVersion:1,runId:e,execution:t.execution(),requester:!0,writeCheck:!0,claudeCodePin:!0,deployedPins:!0,...n?{statedPins:!0}:{},...t.runSettingsFromApp?{runSettings:!0}:{},...i?{credentialKinds:!0}:{},...r?{credentialBlockers:!0}:{}})}o(sS,"handshakeRequest");function fG(e){let t=Toe.parse(e);if(pG(t.manifest)!==t.manifestHash)throw new Error("The handshake manifest hash does not match its manifest");return t}o(fG,"parseHandshakeResponse");function hae(e){let t=o(r=>r.map(s=>({repository:$u(s.repository),number:s.number,...s.commitSha===void 0?{}:{commitSha:s.commitSha}})),"pullRequests"),n=e.noTests?{noTests:e.noTests.map(r=>({repository:$u(r.repository),reason:r.reason}))}:{};if(e.status==="delivered")return{status:e.status,...n,pullRequests:t(e.pullRequests)};let i=o(r=>r.map(s=>({repository:$u(s.repository),message:s.message,...s.branch===void 0?{}:{branch:s.branch},...s.commitSha===void 0?{}:{commitSha:s.commitSha},...s.heldBack===void 0?{}:{heldBack:s.heldBack}})),"failures");return e.status==="partial"?{status:e.status,...n,pullRequests:t(e.pullRequests),failures:i(e.failures)}:e.status==="failed"&&e.failures?{...e,...n,failures:i(e.failures)}:{...e,...n}}o(hae,"toDelivery");function mae(e){return e.issues.map(t=>`${t.path.map((i,r)=>typeof i=="number"?`[${i}]`:r===0?i:`.${i}`).join("")}: ${t.message}`).join("; ")}o(mae,"describeIssues");function gG(e){let{manifest:t}=e;if(voe.includes(t.trigger.kind))throw new Error(`The report upload is invalid: a ${t.trigger.kind} run uploads its SUT recipe, never a report`);if(t.trigger.kind==="revision_read")throw new Error("The report upload is invalid: a revision_read run uploads what each component runs, never a report");if(e.firstQualification&&!t.baseline?.sources)throw new Error("The report upload is invalid: only a run whose manifest names baseline sources can be a first qualification");let n=K1.safeParse({schemaVersion:1,run:{runId:t.runId,attemptNumber:e.attemptNumber,manifestHash:pG(t)},target:{id:t.target.id,revision:t.target.revision},policy:t.policy&&{id:t.policy.id,revision:t.policy.revision},provenance:{sources:e.checkedOut.map(i=>({repository:$u(i.repository),revision:i.revision})),...e.firstQualification?{firstQualification:!0}:{}},delivery:{generatedTests:hae(e.generatedTests)},producer:e.producer,report:e.report,...e.githubWrites?.length?{githubWrites:e.githubWrites.map(i=>({...i,repository:$u(i.repository)}))}:{}});if(!n.success)throw new Error(`The report upload is invalid: ${mae(n.error)}`);return yae(n.data,t,e.checkedOut),n.data}o(gG,"buildReportUpload");function yae(e,t,n){let i=o(s=>n.find(a=>ji(a.repository)===ji(s.repository))?.revision??s.revision,"revisionOf"),r=new Map(t.sources.map(s=>[`${s.repository.namespace}/${s.repository.name}`.toLowerCase(),i(s)]));e.report.validation.acceptedEvidence.forEach((s,a)=>{let c=`report.validation.acceptedEvidence[${a}]`,u=r.get(s.repository.toLowerCase());if(!u)throw new Error(`${c}.repository: ${s.repository} is outside the run's snapshot`);if(s.revision!==u)throw new Error(`${c}.revision: evidence is not from the checked-out revision ${u}`)})}o(yae,"assertEvidenceFromSnapshot");function AG(e){if(e.reportUploaded)return{schemaVersion:1,reason:"report_uploaded",cause:null};if(e.recipeUploaded)return{schemaVersion:1,reason:"recipe_uploaded",cause:null};if(e.revisionsUploaded)return{schemaVersion:1,reason:"revisions_uploaded",cause:null};let t=e.githubWrites?.length?{githubWrites:e.githubWrites.map(i=>({...i,repository:$u(i.repository)}))}:{},n=e.sharedEnvironmentRecords?{sharedEnvironmentRecords:e.sharedEnvironmentRecords}:{};return e.cancelled?{schemaVersion:1,reason:"cancelled",cause:null,...t,...n}:e.mergeConflict&&$1(e)==="merge_conflict"?{schemaVersion:1,reason:"no_report",cause:"merge_conflict",conflict:e.mergeConflict,...t,...n}:{schemaVersion:1,reason:"no_report",cause:$1({...e,mergeConflict:void 0}),...t,...n}}o(AG,"attemptEndFor");function $1(e){return e.runnerProviderNotReady?"runner_provider_not_ready":e.credentialMissing?"credential_missing":e.mergeConflict?"merge_conflict":e.checkoutFailed?"checkout_failed":e.environmentUnverified?"environment_unverified":e.setupFailed?"setup_failed":e.timedOut?"timed_out":e.modelProviderDenied?"model_provider_denied":e.modelProviderUnavailable?"model_provider_unavailable":e.environmentUnavailable?"environment_unavailable":"agent_failed"}o($1,"noReportCause");var nxe=["clean","recipe-drift"];var lo=ee(require("path"));var oxe={"application/pdf":"PDF","text/csv":"CSV","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"DOCX","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"XLSX"};var oS=o(e=>new Map((e??[]).flatMap(t=>t.file?[[_a(t.key),t.file.name]]:[])),"itemNames"),vae=10*1024*1024,mG=o(e=>e?.mediaType==="application/vnd.openxmlformats-officedocument.wordprocessingml.document"||e?.mediaType==="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","needsExtraction"),yG=o((e,t)=>lo.join(lo.dirname(e),`${lo.basename(e,lo.extname(e))}${t}`),"besideFile"),EG=o(e=>yG(e,".extracted.txt"),"extractedTextPath");var Iae=o(e=>yG(e,".quotes.txt"),"confirmedQuotesPath");function bG(e){return mG(e.file)?EG(e.path):e.file?.mediaType==="application/pdf"?Iae(e.path):e.path}o(bG,"itemTextPath");var xp=ee(require("fs")),Ua=ee(require("path"));var wae=8;function ln(e,t,n={}){let i=t.slice(0,wae),r=t.length-i.length;return{name:e,passed:!1,details:i.join("; ")+(r>0?`; \u2026and ${r} more`:""),...n.fatal?{fatal:!0}:{}}}o(ln,"fail");function Gi(e){if(xp.existsSync(e))try{return JSON.parse(xp.readFileSync(e,"utf-8"))}catch{return}}o(Gi,"readJsonFile");function ve(e,t){return Gi(Ua.join(e.outputsDir,t))}o(ve,"readArtifact");function Xn(e,t){return{name:e,verify(n,i){let{errors:r}=t(n,i);return r.length===0?{name:this.name,passed:!0}:ln(this.name,r,{fatal:!0})}}}o(Xn,"schemaGate");function di(e,t){return Ua.relative(e,Ua.resolve(e,t)).replace(/\/+$/,"")}o(di,"relNorm");function Qp(e){return e.replace(/\s+/g," ").trim()}o(Qp,"normalizeCode");var $p=new RegExp("(^|/)("+["test_[^/]+\\.py","[^/]+_test\\.py","[^/]+\\.(spec|test)\\.[cm]?[jt]sx?","[^/]+\\.e2e-(spec|test)\\.[cm]?[jt]sx?","[^/]+_test\\.go","[^/]+Tests?\\.(java|kts?)","[^/]+_(test|spec)\\.rb","[^/]+\\.feature","[^/]+Tests?\\.cs","[^/]+_test\\.rs","tests/[^/]+\\.rs","[^/]+Test\\.php","[^/]+(Test|Spec|Suite)\\.scala","[^/]+Tests?\\.swift","[^/]+_test\\.exs","[^/]+_test\\.dart","[^/]+_test\\.(c|cc|cpp|cxx)","test_[^/]+\\.(c|cc|cpp|cxx)","[^/]+(Spec|Test)\\.groovy"].join("|")+")$","i");function Nt(e){let t=Math.max(0,...(e.match(/`+/g)??[]).map(r=>r.length)),n="`".repeat(t+1),i=e.startsWith("`")||e.endsWith("`")?" ":"";return`${n}${i}${e}${i}${n}`}o(Nt,"codeSpan");var vG=ee(require("path"));var aS="outputs/preflight.json",Fa="pr-diff.txt",cS="related-diffs";function uS(e){return vG.join(cS,`${e.toLowerCase().replace(/\//g,"__").replace(/[^a-z0-9._-]/g,"_")}.diff`)}o(uS,"relatedDiffArtifact");var ys=ee(require("path"));var Tp=ee(require("path"));var po="Skyramp Testbot",Oa="test-bot@skyramp.dev";var _u=o(e=>e.slice(0,12),"shortCommit");var Cae=o((e,t)=>Vt(t,{cwd:e,encoding:"utf-8",stdio:["ignore","pipe","ignore"]}).trim(),"git");function IG(e){let t="";try{t=Cae(e,["remote","get-url","origin"])}catch{}let n=/[:/]([A-Za-z0-9._-]+)\/([A-Za-z0-9._-]+?)(?:\.git)?\/?$/.exec(t);return n&&!t.startsWith("/")&&!t.startsWith(".")?`${n[1]}/${n[2]}`:`local/${Tp.basename(Tp.resolve(e)).replace(/[^A-Za-z0-9._-]/g,"-")||"repo"}`}o(IG,"repositorySlug");var Rxe=new Set(Object.values(co));var xxe=d.object({checks:d.array(d.object({repository:d.string().optional(),name:d.string().min(1),headSha:d.string().regex(/^[0-9a-f]{40}$|^[0-9a-f]{64}$/i),status:d.string().default("completed"),conclusion:d.string().nullable().optional(),url:d.string().optional(),summary:d.string().optional()}))});var Sae=["generate-unit","native-run"],Dxe=["preflight","plan","write",...Sae,"report","deliver"];var Em=(i=>(i.Unit="unit",i.Integration="integration",i.E2e="e2e",i))(Em||{}),kae=Object.values(Em);var wG=8e3;function CG(e,t){return(e.contextRepositories??[]).some(n=>pi(n,t))}o(CG,"pinnedForContext");var lS=new Map;function Rae(e){return e.repositorySlug?e.repositorySlug:(lS.has(e.repositoryPath)||lS.set(e.repositoryPath,IG(e.repositoryPath)),lS.get(e.repositoryPath))}o(Rae,"workingSlug");function Jt(e){let t=Rae(e);return[{slug:t,path:e.repositoryPath,writable:!CG(e,t),working:!0},...(e.relatedRepos??[]).map(n=>({slug:n.slug,path:n.path,writable:n.writable===!0,working:!1}))]}o(Jt,"runSources");var pi=o((e,t)=>e.toLowerCase()===t.toLowerCase(),"sameSlug");function Nu(e,t){return t?.trim()?e.find(n=>pi(n.slug,t.trim())):e[0]}o(Nu,"findSource");function wr(e,t){return Nu(Jt(e),t)}o(wr,"resolveSource");var xae=o((e,t)=>`${t} is not a repository of this run (${Jt(e).map(n=>n.slug).join(", ")})`,"notARepository");function Es(e,t){let n=wr(e,t);return n?n.writable?{source:n}:{error:`${n.slug} is read-only in this run: tests are written only to ${Jt(e).filter(i=>i.writable).map(i=>i.slug).join(", ")}`}:{error:xae(e,t)}}o(Es,"writableSource");function fi(e,t){return SG(Jt(e),t)}o(fi,"checkoutLabel");var dS=o(e=>ys.basename(ys.resolve(e.path)),"relatedDirName");function SG(e,t){return e.length<2?"":`${Nu(e,t)?.slug??t}: `}o(SG,"labelAmong");var Hxe={focused:"Focused",impacted_critical:"Impacted and critical",broad:"Broad"};var Uu=o(e=>!!e.inputs?.scheduledValidation?.comparisonBaselineId,"retestsKnownFailures");var hb=ee(require("fs")),Dt=ee(require("path"));var Br=ee(require("fs")),Sq=require("child_process"),kq=require("module"),Bq=ee(require("os")),yi=ee(require("path"));var pe={};ei(pe,{$brand:()=>kS,$input:()=>ix,$output:()=>rx,INVALID:()=>Pn,NEVER:()=>SS,TimePrecision:()=>hx,ZodAny:()=>r$,ZodArray:()=>a$,ZodBase64:()=>pE,ZodBase64URL:()=>fE,ZodBigInt:()=>vl,ZodBigIntFormat:()=>hE,ZodBoolean:()=>bl,ZodCIDRv4:()=>lE,ZodCIDRv6:()=>dE,ZodCUID:()=>rE,ZodCUID2:()=>iE,ZodCatch:()=>R$,ZodCodec:()=>$f,ZodCompileAsyncError:()=>Ai,ZodCompileUnsupportedError:()=>He,ZodCreditCard:()=>YQ,ZodCustom:()=>Tf,ZodCustomStringFormat:()=>nc,ZodDate:()=>Sf,ZodDefault:()=>I$,ZodDiscriminatedUnion:()=>u$,ZodE164:()=>gE,ZodEmail:()=>Xy,ZodEmoji:()=>tE,ZodEnum:()=>ml,ZodError:()=>Yde,ZodExactOptional:()=>bE,ZodFile:()=>y$,ZodFirstPartyTypeKind:()=>j$,ZodFunction:()=>F$,ZodGUID:()=>eE,ZodIBAN:()=>WQ,ZodIPv4:()=>cE,ZodIPv6:()=>uE,ZodISODate:()=>Co,ZodISODateTime:()=>wo,ZodISODuration:()=>ko,ZodISOTime:()=>So,ZodInstanceOf:()=>L$,ZodIntersection:()=>l$,ZodIssueCode:()=>Kde,ZodJWT:()=>AE,ZodKSUID:()=>aE,ZodLazy:()=>N$,ZodLiteral:()=>m$,ZodMAC:()=>JQ,ZodMap:()=>A$,ZodNaN:()=>Q$,ZodNanoID:()=>nE,ZodNever:()=>s$,ZodNonOptional:()=>vE,ZodNull:()=>t$,ZodNullable:()=>v$,ZodNumber:()=>El,ZodNumberFormat:()=>rc,ZodObject:()=>Bf,ZodOptional:()=>xf,ZodPipe:()=>Qf,ZodPrefault:()=>C$,ZodPreprocess:()=>$$,ZodPromise:()=>U$,ZodReadonly:()=>T$,ZodRealError:()=>ir,ZodRecord:()=>hl,ZodSet:()=>h$,ZodString:()=>yl,ZodStringFormat:()=>pt,ZodSuccess:()=>B$,ZodSymbol:()=>XQ,ZodTemplateLiteral:()=>_$,ZodTransform:()=>E$,ZodTuple:()=>p$,ZodType:()=>Oe,ZodULID:()=>sE,ZodURL:()=>Cf,ZodUUID:()=>Hi,ZodUndefined:()=>e$,ZodUnion:()=>Rf,ZodUnknown:()=>i$,ZodVoid:()=>o$,ZodXID:()=>oE,ZodXor:()=>c$,_ZodString:()=>Ky,_default:()=>w$,_function:()=>Xz,any:()=>Qz,array:()=>kf,base64:()=>lz,base64url:()=>dz,bigint:()=>Sz,boolean:()=>KQ,catch:()=>x$,check:()=>eq,cidrv4:()=>cz,cidrv6:()=>uz,clone:()=>st,codec:()=>Yz,coerce:()=>V$,compile:()=>cx,config:()=>Pt,core:()=>Cs,creditCard:()=>fz,cuid:()=>ez,cuid2:()=>tz,currencyCode:()=>Ez,custom:()=>tq,date:()=>Tz,decode:()=>LQ,decodeAsync:()=>GQ,deepPartial:()=>gq,describe:()=>nq,discriminatedUnion:()=>Fz,e164:()=>pz,email:()=>VV,emoji:()=>KV,encode:()=>MQ,encodeAsync:()=>jQ,endsWith:()=>sl,enum:()=>yE,exactOptional:()=>b$,file:()=>zz,flattenError:()=>Gp,float32:()=>vz,float64:()=>Iz,formatError:()=>Vp,fromJSONSchema:()=>pq,function:()=>Xz,getDiscriminatedOption:()=>SB,getErrorMap:()=>epe,globalRegistry:()=>pn,gt:()=>zi,gte:()=>Sr,guid:()=>zV,hash:()=>bz,hex:()=>yz,hostname:()=>mz,httpUrl:()=>ZV,iban:()=>gz,includes:()=>rl,input:()=>hq,instanceof:()=>iq,int:()=>Wy,int32:()=>wz,int64:()=>kz,intersection:()=>d$,invertCodec:()=>Wz,ipv4:()=>sz,ipv6:()=>az,iso:()=>Df,json:()=>oq,jwt:()=>Az,keyof:()=>Dz,ksuid:()=>iz,lazy:()=>P$,length:()=>Za,literal:()=>Vz,locales:()=>gf,looseObject:()=>Pz,looseRecord:()=>Mz,lowercase:()=>tl,lt:()=>Vi,lte:()=>Cr,mac:()=>oz,map:()=>Lz,maxLength:()=>Wa,maxSize:()=>Eo,memoizer:()=>uf,meta:()=>rq,mime:()=>al,minLength:()=>ws,minSize:()=>qi,multipleOf:()=>yo,nan:()=>Jz,nanoid:()=>XV,nativeEnum:()=>Gz,negative:()=>Oy,never:()=>mE,nonnegative:()=>Ly,nonoptional:()=>k$,nonpositive:()=>My,normalize:()=>cl,null:()=>n$,nullable:()=>wf,nullish:()=>qz,number:()=>ZQ,object:()=>_z,optional:()=>ec,output:()=>mq,overwrite:()=>hi,parse:()=>PQ,parseAsync:()=>UQ,partialRecord:()=>Oz,pipe:()=>Zy,positive:()=>Fy,prefault:()=>S$,preprocess:()=>aq,prettifyError:()=>$S,promise:()=>Kz,properties:()=>ol,property:()=>jy,readonly:()=>D$,record:()=>g$,refine:()=>O$,regex:()=>el,regexes:()=>zr,registry:()=>fy,safeDecode:()=>zQ,safeDecodeAsync:()=>HQ,safeEncode:()=>VQ,safeEncodeAsync:()=>qQ,safeParse:()=>FQ,safeParseAsync:()=>OQ,set:()=>jz,setErrorMap:()=>Xde,size:()=>Ya,slugify:()=>pl,startsWith:()=>il,strictObject:()=>Nz,string:()=>If,stringFormat:()=>hz,stringbool:()=>sq,success:()=>Hz,superRefine:()=>M$,symbol:()=>Rz,templateLiteral:()=>Zz,toJSONSchema:()=>qy,toLowerCase:()=>ll,toUpperCase:()=>dl,toZod:()=>Dp,transform:()=>EE,treeifyError:()=>QS,trim:()=>ul,tuple:()=>f$,uint32:()=>Cz,uint64:()=>Bz,ulid:()=>nz,undefined:()=>xz,union:()=>Il,unknown:()=>Xa,uppercase:()=>nl,url:()=>WV,util:()=>N,uuid:()=>qV,uuidv4:()=>HV,uuidv6:()=>JV,uuidv7:()=>YV,validate:()=>zp,validateAsync:()=>qp,void:()=>$z,withParser:()=>gy,xid:()=>rz,xor:()=>Uz});var Cs={};ei(Cs,{$ZodAny:()=>hB,$ZodArray:()=>IB,$ZodAsyncError:()=>nr,$ZodBase64:()=>iB,$ZodBase64URL:()=>sB,$ZodBigInt:()=>ny,$ZodBigIntFormat:()=>pB,$ZodBoolean:()=>nf,$ZodCIDRv4:()=>nB,$ZodCIDRv6:()=>rB,$ZodCUID:()=>Vk,$ZodCUID2:()=>zk,$ZodCatch:()=>LB,$ZodCheck:()=>yt,$ZodCheckBigIntFormat:()=>mk,$ZodCheckEndsWith:()=>xk,$ZodCheckGreaterThan:()=>Mm,$ZodCheckIncludes:()=>Bk,$ZodCheckLengthEquals:()=>wk,$ZodCheckLessThan:()=>Om,$ZodCheckLowerCase:()=>Sk,$ZodCheckMaxLength:()=>vk,$ZodCheckMaxSize:()=>yk,$ZodCheckMimeType:()=>Tk,$ZodCheckMinLength:()=>Ik,$ZodCheckMinSize:()=>Ek,$ZodCheckMultipleOf:()=>Ak,$ZodCheckNumberFormat:()=>hk,$ZodCheckOverwrite:()=>Dk,$ZodCheckProperties:()=>$k,$ZodCheckProperty:()=>Qk,$ZodCheckRegex:()=>Ck,$ZodCheckSizeEquals:()=>bk,$ZodCheckStartsWith:()=>Rk,$ZodCheckStringFormat:()=>Yu,$ZodCheckUpperCase:()=>kk,$ZodCodec:()=>sf,$ZodCreditCard:()=>aB,$ZodCustom:()=>JB,$ZodCustomStringFormat:()=>lB,$ZodCyclicError:()=>uy,$ZodDate:()=>bB,$ZodDefault:()=>UB,$ZodDiscriminatedUnion:()=>kB,$ZodE164:()=>oB,$ZodEmail:()=>Fk,$ZodEmoji:()=>jk,$ZodEncodeError:()=>ho,$ZodEnum:()=>$B,$ZodError:()=>xS,$ZodExactOptional:()=>NB,$ZodFile:()=>DB,$ZodFunction:()=>qB,$ZodGUID:()=>Pk,$ZodIBAN:()=>cB,$ZodIPv4:()=>Xk,$ZodIPv6:()=>eB,$ZodISODate:()=>Wk,$ZodISODateTime:()=>Yk,$ZodISODuration:()=>Kk,$ZodISOTime:()=>Zk,$ZodIntersection:()=>BB,$ZodJWT:()=>uB,$ZodKSUID:()=>Jk,$ZodLazy:()=>of,$ZodLiteral:()=>TB,$ZodMAC:()=>tB,$ZodMap:()=>xB,$ZodNaN:()=>jB,$ZodNanoID:()=>Gk,$ZodNever:()=>yB,$ZodNonOptional:()=>OB,$ZodNull:()=>AB,$ZodNullable:()=>PB,$ZodNumber:()=>ty,$ZodNumberFormat:()=>dB,$ZodObject:()=>oV,$ZodObjectJIT:()=>wB,$ZodOptional:()=>iy,$ZodPipe:()=>sy,$ZodPrefault:()=>FB,$ZodPreprocess:()=>GB,$ZodPromise:()=>HB,$ZodReadonly:()=>VB,$ZodRealError:()=>rr,$ZodRecord:()=>RB,$ZodRegistry:()=>py,$ZodSet:()=>QB,$ZodString:()=>za,$ZodStringFormat:()=>ot,$ZodSuccess:()=>MB,$ZodSymbol:()=>fB,$ZodTemplateLiteral:()=>zB,$ZodTransform:()=>_B,$ZodTuple:()=>ry,$ZodType:()=>De,$ZodULID:()=>qk,$ZodURL:()=>Lk,$ZodUUID:()=>Uk,$ZodUndefined:()=>gB,$ZodUnion:()=>rf,$ZodUnknown:()=>mB,$ZodVoid:()=>EB,$ZodXID:()=>Hk,$ZodXor:()=>CB,$brand:()=>kS,$constructor:()=>S,$input:()=>ix,$output:()=>rx,Doc:()=>Va,INVALID:()=>Pn,JSONSchema:()=>LV,JSONSchemaGenerator:()=>Hy,NEVER:()=>SS,TimePrecision:()=>hx,URL_BAD_FORMAT:()=>Ok,URL_UNPARSEABLE:()=>Zp,ZodCompileAsyncError:()=>Ai,ZodCompileUnsupportedError:()=>He,_any:()=>Dx,_array:()=>Mx,_base64:()=>_y,_base64url:()=>Ny,_bigint:()=>kx,_boolean:()=>Cx,_catch:()=>Ude,_check:()=>SV,_cidrv4:()=>Ty,_cidrv6:()=>Dy,_coercedBigint:()=>Bx,_coercedBoolean:()=>Sx,_coercedDate:()=>Fx,_coercedNumber:()=>yx,_coercedString:()=>px,_creditCard:()=>gx,_cuid:()=>Sy,_cuid2:()=>ky,_custom:()=>jx,_date:()=>Ux,_decode:()=>Rm,_decodeAsync:()=>Qm,_default:()=>_de,_discriminatedUnion:()=>Ide,_e164:()=>Py,_email:()=>my,_emoji:()=>wy,_encode:()=>Bm,_encodeAsync:()=>xm,_endsWith:()=>sl,_enum:()=>Rde,_file:()=>Lx,_float32:()=>bx,_float64:()=>vx,_gt:()=>zi,_gte:()=>Sr,_guid:()=>yy,_iban:()=>Ax,_includes:()=>rl,_int:()=>Ex,_int32:()=>Ix,_int64:()=>Rx,_intersection:()=>wde,_ipv4:()=>Qy,_ipv6:()=>$y,_isoDate:()=>mf,_isoDateTime:()=>hf,_isoDuration:()=>Ef,_isoTime:()=>yf,_jwt:()=>Uy,_ksuid:()=>xy,_lazy:()=>Lde,_length:()=>Za,_literal:()=>Qde,_lowercase:()=>tl,_lt:()=>Vi,_lte:()=>Cr,_mac:()=>fx,_map:()=>kde,_max:()=>Cr,_maxLength:()=>Wa,_maxSize:()=>Eo,_mime:()=>al,_min:()=>Sr,_minLength:()=>ws,_minSize:()=>qi,_multipleOf:()=>yo,_nan:()=>Ox,_nanoid:()=>Cy,_nativeEnum:()=>xde,_negative:()=>Oy,_never:()=>Nx,_nonnegative:()=>Ly,_nonoptional:()=>Nde,_nonpositive:()=>My,_normalize:()=>cl,_null:()=>Tx,_nullable:()=>Dde,_number:()=>mx,_optional:()=>Tde,_overwrite:()=>hi,_parse:()=>zu,_parseAsync:()=>qu,_pipe:()=>Fde,_positive:()=>Fy,_promise:()=>jde,_properties:()=>ol,_property:()=>jy,_readonly:()=>Ode,_record:()=>Sde,_refine:()=>Gx,_regex:()=>el,_safeDecode:()=>Tm,_safeDecodeAsync:()=>_m,_safeEncode:()=>$m,_safeEncodeAsync:()=>Dm,_safeParse:()=>Hu,_safeParseAsync:()=>Ju,_set:()=>Bde,_size:()=>Ya,_slugify:()=>pl,_startsWith:()=>il,_string:()=>dx,_stringFormat:()=>Ka,_stringbool:()=>Hx,_success:()=>Pde,_superRefine:()=>Vx,_symbol:()=>Qx,_templateLiteral:()=>Mde,_toLowerCase:()=>ll,_toUpperCase:()=>dl,_transform:()=>$de,_trim:()=>ul,_tuple:()=>Cde,_uint32:()=>wx,_uint64:()=>xx,_ulid:()=>By,_undefined:()=>$x,_union:()=>bde,_unknown:()=>_x,_uppercase:()=>nl,_url:()=>Af,_uuid:()=>Ey,_uuidv4:()=>by,_uuidv6:()=>vy,_uuidv7:()=>Iy,_void:()=>Px,_xid:()=>Ry,_xor:()=>vde,base64Charset:()=>Wm,base64urlCharset:()=>tf,canParseURL:()=>Mk,clone:()=>st,compile:()=>cx,compileFn:()=>Ay,config:()=>Pt,createStandardJSONSchemaMethod:()=>fl,createToJSONSchemaMethod:()=>Yx,decode:()=>vce,decodeAsync:()=>wce,describe:()=>zx,encode:()=>bce,encodeAsync:()=>Ice,extractDefs:()=>vo,finalize:()=>Io,flattenError:()=>Gp,formatError:()=>Vp,getDiscriminatedOption:()=>SB,globalConfig:()=>rn,globalRegistry:()=>pn,handleUnrepresentable:()=>Yt,initializeContext:()=>bo,isBackEdge:()=>dy,isRecursiveSchema:()=>ly,isValidBase64:()=>ef,isValidBase64URL:()=>Zm,isValidCIDRv6:()=>Ym,isValidCreditCard:()=>Km,isValidIBAN:()=>Xm,isValidIPv6:()=>Xp,isValidJWT:()=>ey,locales:()=>gf,memoizer:()=>uf,mergeValues:()=>Wu,meta:()=>qx,parse:()=>Sm,parseAsync:()=>km,parseURLObject:()=>rV,prettifyError:()=>$S,process:()=>at,processSchema:()=>at,regexes:()=>zr,registry:()=>fy,safeDecode:()=>Sce,safeDecodeAsync:()=>Bce,safeEncode:()=>Cce,safeEncodeAsync:()=>kce,safeParse:()=>Ace,safeParseAsync:()=>hce,standardProps:()=>zm,stripTabAndNewline:()=>Kp,toDotPath:()=>PG,toJSONSchema:()=>qy,toZod:()=>Dp,treeifyError:()=>QS,urlHostnameOk:()=>Hm,urlProtocolOk:()=>Jm,util:()=>N,validate:()=>zp,validateAsync:()=>qp,validateURL:()=>qm,version:()=>_k,withParser:()=>gy});var N={};ei(N,{BIGINT_FORMAT_RANGES:()=>Fp,CONSTANT_CATCH:()=>wm,Class:()=>AS,NUMBER_FORMAT_RANGES:()=>Up,aborted:()=>Nn,allowsEval:()=>yS,assert:()=>Nae,assertEqual:()=>$ae,assertIs:()=>Dae,assertNever:()=>_ae,assertNotEqual:()=>Tae,assignProp:()=>dn,attachSchema:()=>Op,base64ToUint8Array:()=>QG,base64urlToUint8Array:()=>ece,cached:()=>Lu,captureStackTrace:()=>vm,cleanEnum:()=>Xae,cleanRegex:()=>vs,clone:()=>st,cloneDef:()=>Fae,codePointLength:()=>ja,constantCatch:()=>wS,createTransparentProxy:()=>Vae,defineLazy:()=>hS,defineLazyInternal:()=>Ge,derived:()=>ice,esc:()=>_n,escapeRegex:()=>Vr,explicitlyAborted:()=>vS,extend:()=>Hae,finalizeIssue:()=>tr,floatSafeRemainder:()=>_p,getElementAtPath:()=>Oae,getEnumValues:()=>Ou,getLengthableOrigin:()=>Lp,getParsedType:()=>Gae,getSizableOrigin:()=>Mp,hexToUint8Array:()=>nce,hide:()=>jp,installLazyProp:()=>cce,isObject:()=>La,isPlainObject:()=>Gr,issue:()=>Vu,joinValues:()=>k,jsonStringifyReplacer:()=>Mu,members:()=>IS,merge:()=>Yae,mergeDefs:()=>gi,normalizeParams:()=>q,nullish:()=>bm,numKeys:()=>jae,objectClone:()=>Pae,omit:()=>qae,optionalKeys:()=>bS,own:()=>Ao,parsedType:()=>U,partial:()=>Wae,pick:()=>zae,prefixIssues:()=>er,primitiveTypes:()=>ES,promiseAllObject:()=>Mae,propertyKeyTypes:()=>Pp,randomString:()=>Lae,rawShape:()=>ju,required:()=>Zae,safeExtend:()=>Jae,shallowClone:()=>Np,sizeCaps:()=>Gu,slugify:()=>mS,stringifyPrimitive:()=>P,toZod:()=>Dp,uint8ArrayToBase64:()=>$G,uint8ArrayToBase64url:()=>tce,uint8ArrayToHex:()=>rce,unwrapMessage:()=>Fu});function $ae(e){return e}o($ae,"assertEqual");function Tae(e){return e}o(Tae,"assertNotEqual");function Dp(){return e=>e}o(Dp,"toZod");function Dae(e){}o(Dae,"assertIs");function _ae(e){throw new Error("Unexpected value in exhaustive check")}o(_ae,"assertNever");function Nae(e){}o(Nae,"assert");function Ou(e){let t=Object.values(e).filter(i=>typeof i=="number");return Object.entries(e).filter(([i,r])=>t.indexOf(+i)===-1).map(([i,r])=>r)}o(Ou,"getEnumValues");function k(e,t="|"){return e.map(n=>P(n)).join(t)}o(k,"joinValues");function Mu(e,t){return typeof t=="bigint"?t.toString():t}o(Mu,"jsonStringifyReplacer");var gS=class{static{o(this,"Cached")}constructor(t){this._getter=t,this._value=void 0}get value(){let t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}};function Lu(e){return new gS(e)}o(Lu,"cached");function bm(e){return e==null}o(bm,"nullish");function vs(e){let t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}o(vs,"cleanRegex");function _p(e,t){let n=e/t,i=Math.round(n),r=4*Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-i)<r?0:n-i}o(_p,"floatSafeRemainder");var kG=Symbol("evaluating");function hS(e,t,n){let i;Object.defineProperty(e,t,{get(){if(i!==kG)return i===void 0&&(i=kG,i=n()),i},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}o(hS,"defineLazy");function Pae(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}o(Pae,"objectClone");function dn(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}o(dn,"assignProp");function ju(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}o(ju,"rawShape");function bs(e){return ju(e._zod.def)??e._zod.def.shape}o(bs,"sourceShape");function BG(e,t,n){Object.defineProperty(e,t,{get(){let i=n();return dn(this,t,i),i},enumerable:!0,configurable:!0})}o(BG,"deferProp");function RG(e,t,n){t in e?dn(e,t,n):e[t]=n}o(RG,"putProp");function Ma(e,t,n,i){let r=bs(t);for(let s of n){let a=Object.getOwnPropertyDescriptor(r,s);a.enumerable&&(a.get?BG(e,s,()=>{let c=t._zod.def.shape[s];return i?i(c,s):c}):RG(e,s,i?i(a.value,s):a.value))}}o(Ma,"mirrorShape");function Uae(e,t){for(let n of Reflect.ownKeys(t)){let i=Object.getOwnPropertyDescriptor(t,n);i.enumerable&&(i.get?BG(e,n,()=>t[n]):RG(e,n,i.value))}}o(Uae,"mirrorProps");function gi(...e){let t={};for(let n of e){let i=Object.getOwnPropertyDescriptors(n);Object.assign(t,i)}return Object.defineProperties({},t)}o(gi,"mergeDefs");function Fae(e){return gi(e._zod.def)}o(Fae,"cloneDef");function Oae(e,t){return t?t.reduce((n,i)=>n?.[i],e):e}o(Oae,"getElementAtPath");function Mae(e){let t=Object.keys(e),n=t.map(i=>e[i]);return Promise.all(n).then(i=>{let r={};for(let s=0;s<t.length;s++)r[t[s]]=i[s];return r})}o(Mae,"promiseAllObject");function Lae(e=10){let t="abcdefghijklmnopqrstuvwxyz",n="";for(let i=0;i<e;i++)n+=t[Math.floor(Math.random()*t.length)];return n}o(Lae,"randomString");function _n(e){return JSON.stringify(e)}o(_n,"esc");function mS(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}o(mS,"slugify");var vm="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function La(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(La,"isObject");var yS=Lu(()=>{if(rn.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function Gr(e){if(La(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let n=t.prototype;return!(La(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}o(Gr,"isPlainObject");function Np(e){return Gr(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}o(Np,"shallowClone");function jae(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}o(jae,"numKeys");var Gae=o(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}`)}},"getParsedType"),Pp=new Set(["string","number","symbol"]),ES=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Vr(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(Vr,"escapeRegex");function st(e,t,n){let i=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(i._zod.parent=e),i}o(st,"clone");function q(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:o(()=>t,"error")};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:o(()=>t.error,"error")}:t}o(q,"normalizeParams");function Vae(e){let t;return new Proxy({},{get(n,i,r){return t??(t=e()),Reflect.get(t,i,r)},set(n,i,r,s){return t??(t=e()),Reflect.set(t,i,r,s)},has(n,i){return t??(t=e()),Reflect.has(t,i)},deleteProperty(n,i){return t??(t=e()),Reflect.deleteProperty(t,i)},ownKeys(n){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,i){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,i)},defineProperty(n,i,r){return t??(t=e()),Reflect.defineProperty(t,i,r)}})}o(Vae,"createTransparentProxy");function P(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}o(P,"stringifyPrimitive");function bS(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}o(bS,"optionalKeys");var Up={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]},Fp={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function zae(e,t){let n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let s={};return Ma(s,e,Im(e,t)),st(e,gi(n,{shape:s,checks:[]}))}o(zae,"pick");function Im(e,t){let n=bs(e),i=[];for(let r of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,r)?.enumerable)throw new Error(`Unrecognized key: "${String(r)}"`);t[r]&&i.push(r)}return i}o(Im,"maskedKeys");function qae(e,t){let n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let s=new Set(Im(e,t)),a={};return Ma(a,e,Reflect.ownKeys(bs(e)).filter(c=>!s.has(c))),st(e,gi(n,{shape:a,checks:[]}))}o(qae,"omit");function Hae(e,t){if(!Gr(t))throw new Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0){let r=bs(e);for(let s of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(r,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return st(e,gi(e._zod.def,{shape:xG(e,t)}))}o(Hae,"extend");function xG(e,t){let n={};return Ma(n,e,Reflect.ownKeys(bs(e))),Uae(n,t),n}o(xG,"extended");function Jae(e,t){if(!Gr(t))throw new Error("Invalid input to safeExtend: expected a plain object");return st(e,gi(e._zod.def,{shape:xG(e,t)}))}o(Jae,"safeExtend");function Yae(e,t){if(!t?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let n={};Ma(n,e,Reflect.ownKeys(bs(e))),Ma(n,t,Reflect.ownKeys(bs(t)));let i=gi(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return st(e,i)}o(Yae,"merge");function Wae(e,t,n,i="partial"){let s=t._zod.def.checks;if(s&&s.length>0)throw new Error(`.${i}() cannot be used on object schemas containing refinements`);let c=n?new Set(Im(t,n)):void 0,u={};return Ma(u,t,Reflect.ownKeys(bs(t)),e&&((l,p)=>c&&!c.has(p)?l:new e({type:"optional",innerType:l}))),st(t,gi(t._zod.def,{shape:u,checks:[]}))}o(Wae,"partial");function Zae(e,t,n){let i=n?new Set(Im(t,n)):void 0,r={};return Ma(r,t,Reflect.ownKeys(bs(t)),(s,a)=>i&&!i.has(a)?s:new e({type:"nonoptional",innerType:s})),st(t,gi(t._zod.def,{shape:r}))}o(Zae,"required");function Nn(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}o(Nn,"aborted");function vS(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}o(vS,"explicitlyAborted");function er(e,t){return t.map(n=>{var i;return(i=n).path??(i.path=[]),n.path.unshift(e),n})}o(er,"prefixIssues");function Fu(e){return typeof e=="string"?e:e?.message}o(Fu,"unwrapMessage");function Gu(e){let t=[];for(let n of e??[]){let i=n._zod.def;if(!/_(length|size)$|_equals$/.test(i.check))break;let r=i.maximum??i.length??i.size;r>=0&&t.push([r,n])}return t}o(Gu,"sizeCaps");function Op(e,t,n){var i;for(let r=t;r<e.length;r++)(i=e[r]).schema??(i.schema=n)}o(Op,"attachSchema");function tr(e,t,n){var i;let r=e.inst?._zod?.traits;r?.has("$ZodType")&&(r.has("$ZodCheck")?(i=e).schema??(i.schema=e.inst):e.schema=e.inst);let s=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,a=e.message?e.message:Fu(e.inst?._zod.def?.error?.(e))??Fu(s?.(e))??Fu(t?.error?.(e))??Fu(n.customError?.(e))??Fu(n.localeError?.(e))??"Invalid input",c={};for(let u of Object.keys(e))u==="inst"||u==="schema"||u==="continue"||u==="input"||u==="__proto__"||(c[u]=e[u]);return c.path??(c.path=[]),c.message=a,t?.reportInput&&(c.input=e.input),c}o(tr,"finalizeIssue");function Mp(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}o(Mp,"getSizableOrigin");var Kae=/[\uD800-\uDBFF]/;function ja(e){let t=e.length;if(!Kae.test(e))return t;let n=t;for(let i=0;i<t-1;i++)(e.charCodeAt(i)&64512)===55296&&(e.charCodeAt(i+1)&64512)===56320&&(n--,i++);return n}o(ja,"codePointLength");function Lp(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}o(Lp,"getLengthableOrigin");function U(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let n=e;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&"constructor"in n&&n.constructor)return n.constructor.name}}return t}o(U,"parsedType");function Vu(...e){let[t,n,i]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:i}:{...t}}o(Vu,"issue");function Xae(e){return Object.entries(e).filter(([t,n])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}o(Xae,"cleanEnum");function QG(e){let t=atob(e),n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=t.charCodeAt(i);return n}o(QG,"base64ToUint8Array");function $G(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}o($G,"uint8ArrayToBase64");function ece(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-t.length%4)%4);return QG(t+n)}o(ece,"base64urlToUint8Array");function tce(e){return $G(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}o(tce,"uint8ArrayToBase64url");function nce(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let n=new Uint8Array(t.length/2);for(let i=0;i<t.length;i+=2)n[i/2]=Number.parseInt(t.slice(i,i+2),16);return n}o(nce,"hexToUint8Array");function rce(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}o(rce,"uint8ArrayToHex");var AS=class{static{o(this,"Class")}constructor(...t){}};function IS(e,t){for(let n in t){let i=Object.getOwnPropertyDescriptor(t,n);i.get?Object.defineProperty(e,n,{...i,enumerable:!1}):sce(e,n,i.value)}}o(IS,"members");function Ao(e,t,n,i=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:i,value:n}),n}o(Ao,"own");function jp(e,t,n){return Ao(e,t,n,!1)}o(jp,"hide");function ice(e,t){for(let n in e){let i=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return Ao(this,n,i(this))},set(r){Ao(this,n,r)}})}return t}o(ice,"derived");function sce(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:Ao(this,t,n.bind(this))},set(i){Ao(this,t,i)}})}o(sce,"defineBound");function oce(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}o(oce,"claim");var fS,go=!1,ace={configurable:!0,get(){go=!0}};function Ge(e,t,n){let i=Object.getPrototypeOf(e._zod);if(t in i&&fS!==e._zod){fS=void 0;return}fS=e._zod,Object.defineProperty(i,t,{configurable:!0,get(){Object.defineProperty(this,t,ace);let r=go;go=!1;try{let s=n(this);return go?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:s}),go=go||r,s}catch(s){throw delete this[t],go=go||r,s}},set(r){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r})}})}o(Ge,"defineLazyInternal");function cce(e,t,n,i){let r=oce(e,t);r&&Object.defineProperty(r,t,{configurable:!0,get(){let s={configurable:!0,writable:!0,enumerable:i,value:void 0};return Object.defineProperty(this,t,s),s.value=n(this),Object.defineProperty(this,t,s),s.value},set(s){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:i,value:s})}})}o(cce,"installLazyProp");var wm="~constantCatch";function wS(e){let t=o(()=>e,"fn");return t[wm]=!0,t}o(wS,"constantCatch");var TG,SS=Object.freeze({status:"aborted"}),CS={value:void 0,enumerable:!1},DG="captureStackTrace"in Error?Error:null;function uce(e){let t=DG;if(t){let n=t.stackTraceLimit;if(typeof n=="number"){try{t.stackTraceLimit=0}catch{return DG=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}o(uce,"newError");function S(e,t,n,i){let r={};function s(A){this.def=A,this.constr=f,this.traits=new Set}o(s,"Internals"),s.prototype=r;let a=n,c=a&&new WeakSet;function u(A,h){if(A._zod){if(A._zod.traits.has(e))return}else{CS.value=new s(h);try{Object.defineProperty(A,"_zod",CS)}finally{CS.value=void 0}}if(A._zod.traits.add(e),t(A,h),c){let E=Object.getPrototypeOf(A),b=A._zod.constr.prototype,v=E;for(;v&&v!==b;)v=Object.getPrototypeOf(v);let I=v??E;c.has(I)||(c.add(I),IS(I,a))}let m=f.prototype;for(let E in m)Object.prototype.hasOwnProperty.call(m,E)&&(E in A||(A[E]=m[E].bind(A)))}o(u,"init");let l=i?.Parent??Object;class p extends l{static{o(this,"Definition")}}Object.defineProperty(p,"name",{value:e});function f(A){let h=i?.Parent?uce(p):this;u(h,A);let m=h._zod.deferred;if(m){for(let b of m)b();h._zod.deferred=void 0}let E=globalThis.__zod_globalConfig?.postProcessor;return E&&E(h),h}return o(f,"_"),Object.defineProperty(f,"init",{value:u}),Object.defineProperty(f,Symbol.hasInstance,{value:o(A=>i?.Parent&&A instanceof i.Parent?!0:A?._zod?.traits?.has(e),"value")}),Object.defineProperty(f,"name",{value:e}),f}o(S,"$constructor");var kS=Symbol("zod_brand"),nr=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},ho=class extends Error{static{o(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(TG=globalThis).__zod_globalConfig??(TG.__zod_globalConfig={});var rn=globalThis.__zod_globalConfig;function Pt(e){return e&&Object.assign(rn,e),rn}o(Pt,"config");function lce(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,Mu,2)),e.message}o(lce,"_getMessage");function dce(e){this._zod.message=e}o(dce,"_setMessage");var pce={get:lce,set:dce,enumerable:!0,configurable:!0},RS={value:void 0,enumerable:!1},_G=new WeakSet([Object.prototype,Error.prototype]),NG=o((e,t)=>{e.name="$ZodError",RS.value=t,Object.defineProperty(e,"issues",RS),RS.value=void 0,Object.defineProperty(e,"message",pce);let n=Object.getPrototypeOf(e);_G.has(n)||(_G.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let i=o(()=>this.message,"value");return Object.defineProperty(this,"toString",{value:i,configurable:!0,writable:!0}),i},set(i){Object.defineProperty(this,"toString",{value:i,configurable:!0,writable:!0})}}))},"initializer"),xS=S("$ZodError",NG),rr=S("$ZodError",NG,void 0,{Parent:Error});function fce(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t==="__proto__"?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}o(fce,"node");function Gp(e,t=n=>n.message){let n={},i=[];for(let r of e.issues)r.path.length>0?fce(n,r.path[0],()=>[]).push(t(r)):i.push(t(r));return{formErrors:i,fieldErrors:n}}o(Gp,"flattenError");function Vp(e,t=n=>n.message){let n={_errors:[]},i=o((r,s=[])=>{for(let a of r.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(c=>i({issues:c},[...s,...a.path]));else if(a.code==="invalid_key")i({issues:a.issues},[...s,...a.path]);else if(a.code==="invalid_element")i({issues:a.issues},[...s,...a.path]);else{let c=[...s,...a.path];if(c.length===0)n._errors.push(t(a));else{let u=n,l=0;for(;l<c.length;){let p=c[l],f=l===c.length-1;if(p==="_errors"){f&&u._errors.push(t(a)),l++;continue}Object.prototype.hasOwnProperty.call(u,p)||Object.defineProperty(u,p,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let A=u[p];f&&A._errors.push(t(a)),u=A,l++}}}},"processError");return i(e),n}o(Vp,"formatError");function QS(e,t=n=>n.message){let n={errors:[]},i=o((r,s=[])=>{var a;for(let c of r.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(u=>i({issues:u},[...s,...c.path]));else if(c.code==="invalid_key")i({issues:c.issues},[...s,...c.path]);else if(c.code==="invalid_element")i({issues:c.issues},[...s,...c.path]);else{let u=[...s,...c.path];if(u.length===0){n.errors.push(t(c));continue}let l=n,p=0;for(;p<u.length;){let f=u[p],A=p===u.length-1;typeof f=="string"?(l.properties??(l.properties={}),Object.prototype.hasOwnProperty.call(l.properties,f)||Object.defineProperty(l.properties,f,{value:{errors:[]},enumerable:!0,writable:!0,configurable:!0}),l=l.properties[f]):(l.items??(l.items=[]),(a=l.items)[f]??(a[f]={errors:[]}),l=l.items[f]),A&&l.errors.push(t(c)),p++}}},"processError");return i(e),n}o(QS,"treeifyError");function PG(e){let t=[],n=e.map(i=>typeof i=="object"?i.key:i);for(let i of n)typeof i=="number"?t.push(`[${i}]`):typeof i=="symbol"?t.push(`[${JSON.stringify(String(i))}]`):/[^\w$]/.test(i)?t.push(`[${JSON.stringify(i)}]`):(t.length&&t.push("."),t.push(i));return t.join("")}o(PG,"toDotPath");function $S(e){let t=[],n=[...e.issues].sort((i,r)=>(i.path??[]).length-(r.path??[]).length);for(let i of n)t.push(`\u2716 ${i.message}`),i.path?.length&&t.push(` \u2192 at ${PG(i.path)}`);return t.join(`
143
143
  `)}o($S,"prettifyError");function Cm(e,t){return{callee:t?.callee??e,Err:t?.Err}}o(Cm,"finalizeParams");var zu=o(e=>{let t=o((n,i,r,s)=>{let a=r?{...r,async:!1}:{async:!1},c=n._zod.run({value:i,issues:[]},a);if(c instanceof Promise)throw new nr;if(c.issues.length){let u=new(s?.Err??e)(c.issues.map(l=>tr(l,a,Pt())));throw vm(u,s?.callee??t),u}return c.value},"fn");return t},"_parse"),Sm=zu(rr),qu=o(e=>{let t=o(async(n,i,r,s)=>{let a=r?{...r,async:!0}:{async:!0},c=n._zod.run({value:i,issues:[]},a);if(c instanceof Promise&&(c=await c),c.issues.length){let u=new(s?.Err??e)(c.issues.map(l=>tr(l,a,Pt())));throw vm(u,s?.callee??t),u}return c.value},"fn");return t},"_parseAsync"),km=qu(rr),Hu=o(e=>(t,n,i)=>{let r=i?{...i,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},r);if(s instanceof Promise)throw new nr;return s.issues.length?UG(e,s.issues,r):{success:!0,data:s.value}},"_safeParse"),Ace=Hu(rr);function UG(e,t,n){let i;return{success:!1,get error(){return i||(i=new e(t.map(r=>tr(r,n,Pt()))),t=void 0,n=void 0),i},set error(r){i=r,t=void 0,n=void 0}}}o(UG,"failure");var Ju=o(e=>async(t,n,i)=>{let r=i?{...i,async:!0}:{async:!0},s=t._zod.run({value:n,issues:[]},r);return s instanceof Promise&&(s=await s),s.issues.length?UG(e,s.issues,r):{success:!0,data:s.value}},"_safeParseAsync"),hce=Ju(rr),mce=Symbol.for("zod.compile.invalid"),yce=Symbol.for("zod.compile.fallback"),zp=o(((e,t,n)=>{let i=e._zod.bag.validator;if(i!==void 0){if(i(t)!==mce)return!0;if(i.definite===!0&&n===void 0)return!1}return Ece(e,t,n)}),"validate");function Ece(e,t,n){let i=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},r=e._zod.bag.fallbackRun,s;if(r?(i[yce]=!0,s=r({value:t,issues:[]},i)):s=e._zod.run({value:t,issues:[]},i),s instanceof Promise)throw new nr;return s.issues.length===0}o(Ece,"validateFallback");var qp=o(async(e,t,n)=>{let i=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},r=e._zod.run({value:t,issues:[]},i);return r instanceof Promise&&(r=await r),r.issues.length===0},"validateAsync"),Bm=o(e=>{let t=zu(e),n=o((i,r,s,a)=>{let c=s?{...s,direction:"backward"}:{direction:"backward"};return t(i,r,c,Cm(n,a))},"fn");return n},"_encode"),bce=Bm(rr),Rm=o(e=>{let t=zu(e),n=o((i,r,s,a)=>t(i,r,s,Cm(n,a)),"fn");return n},"_decode"),vce=Rm(rr),xm=o(e=>{let t=qu(e),n=o(async(i,r,s,a)=>{let c=s?{...s,direction:"backward"}:{direction:"backward"};return await t(i,r,c,Cm(n,a))},"fn");return n},"_encodeAsync"),Ice=xm(rr),Qm=o(e=>{let t=qu(e),n=o(async(i,r,s,a)=>await t(i,r,s,Cm(n,a)),"fn");return n},"_decodeAsync"),wce=Qm(rr),$m=o(e=>(t,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return Hu(e)(t,n,r)},"_safeEncode"),Cce=$m(rr),Tm=o(e=>(t,n,i)=>Hu(e)(t,n,i),"_safeDecode"),Sce=Tm(rr),Dm=o(e=>async(t,n,i)=>{let r=i?{...i,direction:"backward"}:{direction:"backward"};return Ju(e)(t,n,r)},"_safeEncodeAsync"),kce=Dm(rr),_m=o(e=>async(t,n,i)=>Ju(e)(t,n,i),"_safeDecodeAsync"),Bce=_m(rr);var zr={};ei(zr,{anyString:()=>ik,base64:()=>YS,base64url:()=>WS,bigint:()=>ok,boolean:()=>ak,browserEmail:()=>Nce,cidrv4:()=>HS,cidrv6:()=>JS,creditCard:()=>Nm,cuid:()=>DS,cuid2:()=>_S,currencyCode:()=>ek,date:()=>tk,datetime:()=>rk,domain:()=>KS,duration:()=>MS,e164:()=>XS,email:()=>jS,emoji:()=>GS,extendedDuration:()=>Rce,guid:()=>LS,hex:()=>pk,hostname:()=>ZS,html5Email:()=>Tce,httpProtocol:()=>Hp,iban:()=>Pm,idnEmail:()=>_ce,integer:()=>Jp,ipv4:()=>VS,ipv6:()=>zS,ksuid:()=>US,lowercase:()=>lk,mac:()=>qS,md5_base64:()=>Oce,md5_base64url:()=>Mce,md5_hex:()=>Fce,nanoid:()=>FS,nanoidOfLength:()=>OS,null:()=>ck,number:()=>Is,rfc5322Email:()=>Dce,sha1_base64:()=>jce,sha1_base64url:()=>Gce,sha1_hex:()=>Lce,sha256_base64:()=>zce,sha256_base64url:()=>qce,sha256_hex:()=>Vce,sha384_base64:()=>Jce,sha384_base64url:()=>Yce,sha384_hex:()=>Hce,sha512_base64:()=>Zce,sha512_base64url:()=>Kce,sha512_hex:()=>Wce,string:()=>sk,time:()=>nk,ulid:()=>NS,undefined:()=>uk,unicodeEmail:()=>FG,uppercase:()=>dk,uuid:()=>Ga,uuid4:()=>xce,uuid6:()=>Qce,uuid7:()=>$ce,xid:()=>PS});var DS=/^[cC][0-9a-z]{6,}$/,_S=/^[0-9a-z]+$/,NS=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,PS=/^[0-9a-vA-V]{20}$/,US=/^[A-Za-z0-9]{27}$/,FS=/^[a-zA-Z0-9_-]{21}$/;function OS(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}o(OS,"nanoidOfLength");var MS=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Rce=/^[-+]?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)?)??$/,LS=/^([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})$/,Ga=o(e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,"uuid"),xce=Ga(4),Qce=Ga(6),$ce=Ga(7),jS=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Tce=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Dce=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,FG=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,_ce=FG,Nce=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Pce="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function GS(){return new RegExp(Pce,"u")}o(GS,"emoji");var VS=/^(?:(?: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])$/,zS=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,qS=o(e=>{let t=Vr(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},"mac"),HS=/^((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])$/,JS=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,YS=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,WS=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,ZS=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,KS=/^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/,Hp=/^https?$/,XS=/^\+[1-9]\d{6,14}$/,Nm=/^\d(?:[ -]?\d){11,18}$/,ek=/^(?:AED|AFN|ALL|AMD|AOA|ARS|AUD|AWG|AZN|BAM|BBD|BDT|BHD|BIF|BMD|BND|BOB|BOV|BRL|BSD|BTN|BWP|BYN|BZD|CAD|CDF|CHE|CHF|CHW|CLF|CLP|CNY|COP|COU|CRC|CUP|CVE|CZK|DJF|DKK|DOP|DZD|EGP|ERN|ETB|EUR|FJD|FKP|GBP|GEL|GHS|GIP|GMD|GNF|GTQ|GYD|HKD|HNL|HTG|HUF|IDR|ILS|INR|IQD|IRR|ISK|JMD|JOD|JPY|KES|KGS|KHR|KMF|KPW|KRW|KWD|KYD|KZT|LAK|LBP|LKR|LRD|LSL|LYD|MAD|MDL|MGA|MKD|MMK|MNT|MOP|MRU|MUR|MVR|MWK|MXN|MXV|MYR|MZN|NAD|NGN|NIO|NOK|NPR|NZD|OMR|PAB|PEN|PGK|PHP|PKR|PLN|PYG|QAR|RON|RSD|RUB|RWF|SAR|SBD|SCR|SDG|SEK|SGD|SHP|SLE|SOS|SRD|SSP|STN|SVC|SYP|SZL|THB|TJS|TMT|TND|TOP|TRY|TTD|TWD|TZS|UAH|UGX|USD|USN|UYI|UYU|UYW|UZS|VED|VES|VND|VUV|WST|XAD|XAF|XAG|XAU|XBA|XBB|XBC|XBD|XCD|XCG|XDR|XOF|XPD|XPF|XPT|XSU|XTS|XUA|XXX|YER|ZAR|ZMW|ZWG)$/,Pm=/^[A-Z]{2}(?!00|01|99)\d{2}[A-Z0-9]{11,30}$/,OG="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))";function Uce(e){return new RegExp(`^${e}$`)}o(Uce,"anchor");var tk=Uce(OG);function TS(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}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}o(TS,"timeSource");function nk(e){return new RegExp(`^${TS(e)}$`)}o(nk,"time");function rk(e){let t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let n=`${TS({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,i=e.local?`${n}|${TS({precision:e.precision})}`:n;return new RegExp(`^${OG}T(?:${i})$`)}o(rk,"datetime");var ik=/^[\s\S]{0,}$/,sk=o(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),ok=/^-?\d+n?$/,Jp=/^-?\d+$/,Is=/^-?\d+(?:\.\d+)?$/,ak=/^(?:true|false)$/i,ck=/^null$/i;var uk=/^undefined$/i;var lk=/^[^A-Z]*$/,dk=/^[^a-z]*$/,pk=/^[0-9a-fA-F]*$/;function Yp(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}o(Yp,"fixedBase64");function Wp(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}o(Wp,"fixedBase64url");var Fce=/^[0-9a-fA-F]{32}$/,Oce=Yp(22,"=="),Mce=Wp(22),Lce=/^[0-9a-fA-F]{40}$/,jce=Yp(27,"="),Gce=Wp(27),Vce=/^[0-9a-fA-F]{64}$/,zce=Yp(43,"="),qce=Wp(43),Hce=/^[0-9a-fA-F]{96}$/,Jce=Yp(64,""),Yce=Wp(64),Wce=/^[0-9a-fA-F]{128}$/,Zce=Yp(86,"=="),Kce=Wp(86);var yt=S("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),fk=o(e=>{let t=e.value;return!bm(t)&&t.size!==void 0},"_whenHasSize"),gk=o(e=>{let t=e.value;return!bm(t)&&t.length!==void 0},"_whenHasLength"),Um={number:"number",bigint:"bigint",object:"date"},Om=S("$ZodCheckLessThan",(e,t)=>{yt.init(e,t);let n=Um[typeof t.value];e._zod.check=i=>{(t.inclusive?i.value<=t.value:i.value<t.value)||i.issues.push({origin:Um[typeof i.value]??n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Mm=S("$ZodCheckGreaterThan",(e,t)=>{yt.init(e,t);let n=Um[typeof t.value];e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:Um[typeof i.value]??n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ak=S("$ZodCheckMultipleOf",(e,t)=>{yt.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):_p(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),hk=S("$ZodCheckNumberFormat",(e,t)=>{yt.init(e,t),t.format=t.format||"float64";let n=t.format?.includes("int"),i=n?"int":"number",[r,s]=Up[t.format];e._zod.check=a=>{let c=a.value;if(n){if(!Number.isInteger(c)){a.issues.push({expected:i,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?a.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort}):a.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:i,inclusive:!0,continue:!t.abort});return}}c<r&&a.issues.push({origin:"number",input:c,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),c>s&&a.issues.push({origin:"number",input:c,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}}),mk=S("$ZodCheckBigIntFormat",(e,t)=>{yt.init(e,t);let[n,i]=Fp[t.format];e._zod.check=r=>{let s=r.value;s<n&&r.issues.push({origin:"bigint",input:s,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),s>i&&r.issues.push({origin:"bigint",input:s,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),yk=S("$ZodCheckMaxSize",(e,t)=>{var n;yt.init(e,t),(n=e._zod.def).when??(n.when=fk),e._zod.check=i=>{let r=i.value;r.size<=t.maximum||i.issues.push({origin:Mp(r),code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Ek=S("$ZodCheckMinSize",(e,t)=>{var n;yt.init(e,t),(n=e._zod.def).when??(n.when=fk),e._zod.check=i=>{let r=i.value;r.size>=t.minimum||i.issues.push({origin:Mp(r),code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),bk=S("$ZodCheckSizeEquals",(e,t)=>{var n;yt.init(e,t),(n=e._zod.def).when??(n.when=fk),e._zod.check=i=>{let r=i.value,s=r.size;if(s===t.size)return;let a=s>t.size;i.issues.push({origin:Mp(r),...a?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),vk=S("$ZodCheckMaxLength",(e,t)=>{var n;yt.init(e,t),(n=e._zod.def).when??(n.when=gk),e._zod.check=i=>{let r=i.value,s=r.length;if((typeof r=="string"&&s>t.maximum?ja(r):s)<=t.maximum)return;let c=Lp(r);i.issues.push({origin:c,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Ik=S("$ZodCheckMinLength",(e,t)=>{var n;yt.init(e,t),(n=e._zod.def).when??(n.when=gk),e._zod.check=i=>{let r=i.value,s=r.length;if((typeof r=="string"&&s>=t.minimum&&s<t.minimum*2?ja(r):s)>=t.minimum)return;let c=Lp(r);i.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),wk=S("$ZodCheckLengthEquals",(e,t)=>{var n;yt.init(e,t),(n=e._zod.def).when??(n.when=gk),e._zod.check=i=>{let r=i.value,s=r.length,a=typeof r=="string"&&s>=t.length&&s<=t.length*2?ja(r):s;if(a===t.length)return;let c=Lp(r),u=a>t.length;i.issues.push({origin:c,...u?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),Yu=S("$ZodCheckStringFormat",(e,t)=>{var n,i;yt.init(e,t),t.pattern?(n=e._zod).check??(n.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(i=e._zod).check??(i.check=()=>{})}),Ck=S("$ZodCheckRegex",(e,t)=>{Yu.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Sk=S("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=lk),Yu.init(e,t)}),kk=S("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=dk),Yu.init(e,t)}),Bk=S("$ZodCheckIncludes",(e,t)=>{yt.init(e,t);let n=Vr(t.includes),i=new RegExp(typeof t.position=="number"?`^.{${t.position},}${n}`:n);t.pattern=i,e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),Rk=S("$ZodCheckStartsWith",(e,t)=>{yt.init(e,t);let n=new RegExp(`^${Vr(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.check=i=>{i.value.startsWith(t.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:i.value,inst:e,continue:!t.abort})}}),xk=S("$ZodCheckEndsWith",(e,t)=>{yt.init(e,t);let n=new RegExp(`.*${Vr(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.check=i=>{i.value.endsWith(t.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:i.value,inst:e,continue:!t.abort})}});function Fm(e,t,n){e.issues.length&&t.issues.push(...er(n,e.issues))}o(Fm,"handleCheckPropertyResult");var Qk=S("$ZodCheckProperty",(e,t)=>{yt.init(e,t),e._zod.check=n=>{let i=t.schema._zod.run({value:n.value[t.property],issues:[]},{});if(i instanceof Promise)return i.then(r=>Fm(r,n,t.property));Fm(i,n,t.property)}}),$k=S("$ZodCheckProperties",(e,t)=>{yt.init(e,t),jp(e,Symbol.iterator,function*(){yield e});let n;e._zod.check=i=>{if(i.value==null){i.issues.push({expected:"object",code:"invalid_type",input:i.value,inst:e});return}n??(n=Reflect.ownKeys(t.shape).map(a=>[a,t.shape[a]]));let r=i.value,s;for(let[a,c]of n){let u=c._zod.run({value:r[a],issues:[]},{});u instanceof Promise?(s??(s=[]),s.push(u.then(l=>Fm(l,i,a)))):Fm(u,i,a)}if(s)return Promise.all(s).then(()=>{})}}),Tk=S("$ZodCheckMimeType",(e,t)=>{yt.init(e,t);let n=new Set(t.mime);e._zod.check=i=>{n.has(i.value.type)||i.issues.push({code:"invalid_value",values:t.mime,input:i.value.type,inst:e,continue:!t.abort})}}),Dk=S("$ZodCheckOverwrite",(e,t)=>{yt.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});var Va=class{static{o(this,"Doc")}constructor(t=[],n={}){this.content=[],this.indent=0,this.args=t,this.closed=n}indented(t){this.indent+=1;try{t(this)}finally{this.indent-=1}}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let i=t.split(`
144
144
  `).filter(a=>a),r=Math.min(...i.map(a=>a.length-a.trimStart().length)),s=i.map(a=>a.slice(r)).map(a=>" ".repeat(this.indent*2)+a);for(let a of s)this.content.push(a)}compile(){let t=Function,n=this?.content??[""];return new t(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
145
145
  ${n.join(`