@highstate/designer 0.8.0 → 0.9.1

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.
Files changed (29) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/_nuxt/{49Byon_C.js → 71DWnp3w.js} +1 -1
  3. package/.output/public/_nuxt/{AC-cbere.js → B9Wk0_zF.js} +1 -1
  4. package/.output/public/_nuxt/{BBbUbsmH.js → BG6GxCJR.js} +1 -1
  5. package/.output/public/_nuxt/{zXTedGBg.js → BbK_ajct.js} +1 -1
  6. package/.output/public/_nuxt/{D3U7RFHT.js → C3UGTNZQ.js} +1 -1
  7. package/.output/public/_nuxt/{__nihD3z.js → C5WOBMna.js} +1 -1
  8. package/.output/public/_nuxt/{DJxFwZ8e.js → CNdW-337.js} +1 -1
  9. package/.output/public/_nuxt/{C_n9LE99.js → Cl5t2I-P.js} +1 -1
  10. package/.output/public/_nuxt/{hcK6w2WN.js → CrxtFyJB.js} +242 -242
  11. package/.output/public/_nuxt/{CODnyShH.js → D3NDyH_4.js} +1 -1
  12. package/.output/public/_nuxt/{stTwOcRx.js → DWvcuTbA.js} +1 -1
  13. package/.output/public/_nuxt/{BYgEQs-R.js → Deh1XDdt.js} +1 -1
  14. package/.output/public/_nuxt/{MPrxSj4v.js → Eu9bCW6_.js} +1 -1
  15. package/.output/public/_nuxt/{D8NOhxV1.js → JXjzidi6.js} +1 -1
  16. package/.output/public/_nuxt/{bxb_NGy4.js → SDZL1Ln2.js} +1 -1
  17. package/.output/public/_nuxt/{B2xWwrcf.js → XDaPkSr7.js} +1 -1
  18. package/.output/public/_nuxt/builds/latest.json +1 -1
  19. package/.output/public/_nuxt/builds/meta/e6de3e0a-acf9-44f4-b7aa-b827d5bdfe85.json +1 -0
  20. package/.output/public/_nuxt/{entry.ClkVUmUZ.css → entry.DfmVQ5lK.css} +1 -1
  21. package/.output/public/_nuxt/graph-resolver-CUk_wyie.js +8 -0
  22. package/.output/public/_nuxt/{DNegoBzK.js → tFLxhK-g.js} +1 -1
  23. package/.output/public/_nuxt/{CBnxroLO.js → vj6pa4vE.js} +1 -1
  24. package/.output/public/_nuxt/{CIrl0N3t.js → wLgi3sdh.js} +1 -1
  25. package/.output/server/index.mjs +546 -546
  26. package/.output/server/package.json +1 -1
  27. package/package.json +4 -4
  28. package/.output/public/_nuxt/builds/meta/b669e4f8-ac13-4649-8aa2-1ae645243b1e.json +0 -1
  29. package/.output/public/_nuxt/graph-resolver-CY8ix4Bk.js +0 -8
@@ -0,0 +1,8 @@
1
+ var de;(function(t){t.assertEqual=a=>a;function e(a){}t.assertIs=e;function r(a){throw new Error}t.assertNever=r,t.arrayToEnum=a=>{const s={};for(const c of a)s[c]=c;return s},t.getValidEnumValues=a=>{const s=t.objectKeys(a).filter(o=>typeof a[a[o]]!="number"),c={};for(const o of s)c[o]=a[o];return t.objectValues(c)},t.objectValues=a=>t.objectKeys(a).map(function(s){return a[s]}),t.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const s=[];for(const c in a)Object.prototype.hasOwnProperty.call(a,c)&&s.push(c);return s},t.find=(a,s)=>{for(const c of a)if(s(c))return c},t.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&isFinite(a)&&Math.floor(a)===a;function n(a,s=" | "){return a.map(c=>typeof c=="string"?`'${c}'`:c).join(s)}t.joinValues=n,t.jsonStringifyReplacer=(a,s)=>typeof s=="bigint"?s.toString():s})(de||(de={}));var Br;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(Br||(Br={}));const L=de.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),De=t=>{switch(typeof t){case"undefined":return L.undefined;case"string":return L.string;case"number":return isNaN(t)?L.nan:L.number;case"boolean":return L.boolean;case"function":return L.function;case"bigint":return L.bigint;case"symbol":return L.symbol;case"object":return Array.isArray(t)?L.array:t===null?L.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?L.promise:typeof Map<"u"&&t instanceof Map?L.map:typeof Set<"u"&&t instanceof Set?L.set:typeof Date<"u"&&t instanceof Date?L.date:L.object;default:return L.unknown}},D=de.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"]),ra=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class Ee extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){const r=e||function(s){return s.message},n={_errors:[]},a=s=>{for(const c of s.issues)if(c.code==="invalid_union")c.unionErrors.map(a);else if(c.code==="invalid_return_type")a(c.returnTypeError);else if(c.code==="invalid_arguments")a(c.argumentsError);else if(c.path.length===0)n._errors.push(r(c));else{let o=n,u=0;for(;u<c.path.length;){const p=c.path[u];u===c.path.length-1?(o[p]=o[p]||{_errors:[]},o[p]._errors.push(r(c))):o[p]=o[p]||{_errors:[]},o=o[p],u++}}};return a(this),n}static assert(e){if(!(e instanceof Ee))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,de.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){const r={},n=[];for(const a of this.issues)a.path.length>0?(r[a.path[0]]=r[a.path[0]]||[],r[a.path[0]].push(e(a))):n.push(e(a));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}Ee.create=t=>new Ee(t);const ot=(t,e)=>{let r;switch(t.code){case D.invalid_type:t.received===L.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case D.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,de.jsonStringifyReplacer)}`;break;case D.unrecognized_keys:r=`Unrecognized key(s) in object: ${de.joinValues(t.keys,", ")}`;break;case D.invalid_union:r="Invalid input";break;case D.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${de.joinValues(t.options)}`;break;case D.invalid_enum_value:r=`Invalid enum value. Expected ${de.joinValues(t.options)}, received '${t.received}'`;break;case D.invalid_arguments:r="Invalid function arguments";break;case D.invalid_return_type:r="Invalid function return type";break;case D.invalid_date:r="Invalid date";break;case D.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:de.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case D.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case D.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case D.custom:r="Invalid input";break;case D.invalid_intersection_types:r="Intersection results could not be merged";break;case D.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case D.not_finite:r="Number must be finite";break;default:r=e.defaultError,de.assertNever(t)}return{message:r}};let Is=ot;function na(t){Is=t}function mr(){return Is}const yr=t=>{const{data:e,path:r,errorMaps:n,issueData:a}=t,s=[...r,...a.path||[]],c={...a,path:s};if(a.message!==void 0)return{...a,path:s,message:a.message};let o="";const u=n.filter(p=>!!p).slice().reverse();for(const p of u)o=p(c,{data:e,defaultError:o}).message;return{...a,path:s,message:o}},sa=[];function z(t,e){const r=mr(),n=yr({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===ot?void 0:ot].filter(a=>!!a)});t.common.issues.push(n)}class ge{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){const n=[];for(const a of r){if(a.status==="aborted")return X;a.status==="dirty"&&e.dirty(),n.push(a.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){const n=[];for(const a of r){const s=await a.key,c=await a.value;n.push({key:s,value:c})}return ge.mergeObjectSync(e,n)}static mergeObjectSync(e,r){const n={};for(const a of r){const{key:s,value:c}=a;if(s.status==="aborted"||c.status==="aborted")return X;s.status==="dirty"&&e.dirty(),c.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof c.value<"u"||a.alwaysSet)&&(n[s.value]=c.value)}return{status:e.value,value:n}}}const X=Object.freeze({status:"aborted"}),st=t=>({status:"dirty",value:t}),be=t=>({status:"valid",value:t}),Gr=t=>t.status==="aborted",Jr=t=>t.status==="dirty",We=t=>t.status==="valid",vt=t=>typeof Promise<"u"&&t instanceof Promise;function vr(t,e,r,n){if(typeof e=="function"?t!==e||!0:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}function Rs(t,e,r,n,a){if(typeof e=="function"?t!==e||!0:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,r),r}var G;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(G||(G={}));var mt,yt;class Re{constructor(e,r,n,a){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=a}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const on=(t,e)=>{if(We(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new Ee(t.common.issues);return this._error=r,this._error}}};function re(t){if(!t)return{};const{errorMap:e,invalid_type_error:r,required_error:n,description:a}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:a}:{errorMap:(c,o)=>{var u,p;const{message:m}=t;return c.code==="invalid_enum_value"?{message:m??o.defaultError}:typeof o.data>"u"?{message:(u=m??n)!==null&&u!==void 0?u:o.defaultError}:c.code!=="invalid_type"?{message:o.defaultError}:{message:(p=m??r)!==null&&p!==void 0?p:o.defaultError}},description:a}}class ae{get description(){return this._def.description}_getType(e){return De(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:De(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ge,ctx:{common:e.parent.common,data:e.data,parsedType:De(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const r=this._parse(e);if(vt(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){const r=this._parse(e);return Promise.resolve(r)}parse(e,r){const n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){var n;const a={common:{issues:[],async:(n=r?.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:De(e)},s=this._parseSync({data:e,path:a.path,parent:a});return on(a,s)}"~validate"(e){var r,n;const a={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:De(e)};if(!this["~standard"].async)try{const s=this._parseSync({data:e,path:[],parent:a});return We(s)?{value:s.value}:{issues:a.common.issues}}catch(s){!((n=(r=s?.message)===null||r===void 0?void 0:r.toLowerCase())===null||n===void 0)&&n.includes("encountered")&&(this["~standard"].async=!0),a.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:a}).then(s=>We(s)?{value:s.value}:{issues:a.common.issues})}async parseAsync(e,r){const n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){const n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:De(e)},a=this._parse({data:e,path:n.path,parent:n}),s=await(vt(a)?a:Promise.resolve(a));return on(n,s)}refine(e,r){const n=a=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(a):r;return this._refinement((a,s)=>{const c=e(a),o=()=>s.addIssue({code:D.custom,...n(a)});return typeof Promise<"u"&&c instanceof Promise?c.then(u=>u?!0:(o(),!1)):c?!0:(o(),!1)})}refinement(e,r){return this._refinement((n,a)=>e(n)?!0:(a.addIssue(typeof r=="function"?r(n,a):r),!1))}_refinement(e){return new Te({schema:this,typeName:Q.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return Ie.create(this,this._def)}nullable(){return Fe.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Oe.create(this)}promise(){return ut.create(this,this._def)}or(e){return $t.create([this,e],this._def)}and(e){return wt.create(this,e,this._def)}transform(e){return new Te({...re(this._def),schema:this,typeName:Q.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const r=typeof e=="function"?e:()=>e;return new jt({...re(this._def),innerType:this,defaultValue:r,typeName:Q.ZodDefault})}brand(){return new Yr({typeName:Q.ZodBranded,type:this,...re(this._def)})}catch(e){const r=typeof e=="function"?e:()=>e;return new Ot({...re(this._def),innerType:this,catchValue:r,typeName:Q.ZodCatch})}describe(e){const r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Nt.create(this,e)}readonly(){return Tt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const aa=/^c[^\s-]{8,}$/i,ia=/^[0-9a-z]+$/,oa=/^[0-9A-HJKMNP-TV-Z]{26}$/i,ca=/^[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,ua=/^[a-z0-9_-]{21}$/i,da=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,la=/^[-+]?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)?)??$/,fa=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,ha="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Ar;const pa=/^(?:(?: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])$/,ma=/^(?:(?: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])$/,ya=/^(([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]))$/,va=/^(([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])$/,ga=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,_a=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Cs="((\\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])))",ba=new RegExp(`^${Cs}$`);function As(t){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`),e}function $a(t){return new RegExp(`^${As(t)}$`)}function xs(t){let e=`${Cs}T${As(t)}`;const r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function wa(t,e){return!!((e==="v4"||!e)&&pa.test(t)||(e==="v6"||!e)&&ya.test(t))}function ka(t,e){if(!da.test(t))return!1;try{const[r]=t.split("."),n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),a=JSON.parse(atob(n));return!(typeof a!="object"||a===null||!a.typ||!a.alg||e&&a.alg!==e)}catch{return!1}}function Ea(t,e){return!!((e==="v4"||!e)&&ma.test(t)||(e==="v6"||!e)&&va.test(t))}class je extends ae{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==L.string){const s=this._getOrReturnCtx(e);return z(s,{code:D.invalid_type,expected:L.string,received:s.parsedType}),X}const n=new ge;let a;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(a=this._getOrReturnCtx(e,a),z(a,{code:D.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")e.data.length>s.value&&(a=this._getOrReturnCtx(e,a),z(a,{code:D.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){const c=e.data.length>s.value,o=e.data.length<s.value;(c||o)&&(a=this._getOrReturnCtx(e,a),c?z(a,{code:D.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):o&&z(a,{code:D.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")fa.test(e.data)||(a=this._getOrReturnCtx(e,a),z(a,{validation:"email",code:D.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")Ar||(Ar=new RegExp(ha,"u")),Ar.test(e.data)||(a=this._getOrReturnCtx(e,a),z(a,{validation:"emoji",code:D.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")ca.test(e.data)||(a=this._getOrReturnCtx(e,a),z(a,{validation:"uuid",code:D.invalid_string,message:s.message}),n.dirty());else if(s.kind==="nanoid")ua.test(e.data)||(a=this._getOrReturnCtx(e,a),z(a,{validation:"nanoid",code:D.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")aa.test(e.data)||(a=this._getOrReturnCtx(e,a),z(a,{validation:"cuid",code:D.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")ia.test(e.data)||(a=this._getOrReturnCtx(e,a),z(a,{validation:"cuid2",code:D.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")oa.test(e.data)||(a=this._getOrReturnCtx(e,a),z(a,{validation:"ulid",code:D.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{a=this._getOrReturnCtx(e,a),z(a,{validation:"url",code:D.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),z(a,{validation:"regex",code:D.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(a=this._getOrReturnCtx(e,a),z(a,{code:D.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(a=this._getOrReturnCtx(e,a),z(a,{code:D.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(a=this._getOrReturnCtx(e,a),z(a,{code:D.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?xs(s).test(e.data)||(a=this._getOrReturnCtx(e,a),z(a,{code:D.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="date"?ba.test(e.data)||(a=this._getOrReturnCtx(e,a),z(a,{code:D.invalid_string,validation:"date",message:s.message}),n.dirty()):s.kind==="time"?$a(s).test(e.data)||(a=this._getOrReturnCtx(e,a),z(a,{code:D.invalid_string,validation:"time",message:s.message}),n.dirty()):s.kind==="duration"?la.test(e.data)||(a=this._getOrReturnCtx(e,a),z(a,{validation:"duration",code:D.invalid_string,message:s.message}),n.dirty()):s.kind==="ip"?wa(e.data,s.version)||(a=this._getOrReturnCtx(e,a),z(a,{validation:"ip",code:D.invalid_string,message:s.message}),n.dirty()):s.kind==="jwt"?ka(e.data,s.alg)||(a=this._getOrReturnCtx(e,a),z(a,{validation:"jwt",code:D.invalid_string,message:s.message}),n.dirty()):s.kind==="cidr"?Ea(e.data,s.version)||(a=this._getOrReturnCtx(e,a),z(a,{validation:"cidr",code:D.invalid_string,message:s.message}),n.dirty()):s.kind==="base64"?ga.test(e.data)||(a=this._getOrReturnCtx(e,a),z(a,{validation:"base64",code:D.invalid_string,message:s.message}),n.dirty()):s.kind==="base64url"?_a.test(e.data)||(a=this._getOrReturnCtx(e,a),z(a,{validation:"base64url",code:D.invalid_string,message:s.message}),n.dirty()):de.assertNever(s);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(a=>e.test(a),{validation:r,code:D.invalid_string,...G.errToObj(n)})}_addCheck(e){return new je({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...G.errToObj(e)})}url(e){return this._addCheck({kind:"url",...G.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...G.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...G.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...G.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...G.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...G.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...G.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...G.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...G.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...G.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...G.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...G.errToObj(e)})}datetime(e){var r,n;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(r=e?.offset)!==null&&r!==void 0?r:!1,local:(n=e?.local)!==null&&n!==void 0?n:!1,...G.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...G.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...G.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...G.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...G.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...G.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...G.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...G.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...G.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...G.errToObj(r)})}nonempty(e){return this.min(1,G.errToObj(e))}trim(){return new je({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new je({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new je({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}je.create=t=>{var e;return new je({checks:[],typeName:Q.ZodString,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...re(t)})};function Sa(t,e){const r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,a=r>n?r:n,s=parseInt(t.toFixed(a).replace(".","")),c=parseInt(e.toFixed(a).replace(".",""));return s%c/Math.pow(10,a)}class Ze extends ae{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==L.number){const s=this._getOrReturnCtx(e);return z(s,{code:D.invalid_type,expected:L.number,received:s.parsedType}),X}let n;const a=new ge;for(const s of this._def.checks)s.kind==="int"?de.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),z(n,{code:D.invalid_type,expected:"integer",received:"float",message:s.message}),a.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),z(n,{code:D.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),z(n,{code:D.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):s.kind==="multipleOf"?Sa(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),z(n,{code:D.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),z(n,{code:D.not_finite,message:s.message}),a.dirty()):de.assertNever(s);return{status:a.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,G.toString(r))}gt(e,r){return this.setLimit("min",e,!1,G.toString(r))}lte(e,r){return this.setLimit("max",e,!0,G.toString(r))}lt(e,r){return this.setLimit("max",e,!1,G.toString(r))}setLimit(e,r,n,a){return new Ze({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:G.toString(a)}]})}_addCheck(e){return new Ze({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:G.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:G.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:G.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:G.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:G.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:G.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:G.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:G.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:G.toString(e)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&de.isInteger(e.value))}get isFinite(){let e=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}}Ze.create=t=>new Ze({checks:[],typeName:Q.ZodNumber,coerce:t?.coerce||!1,...re(t)});class Le extends ae{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==L.bigint)return this._getInvalidInput(e);let n;const a=new ge;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),z(n,{code:D.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),a.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),z(n,{code:D.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),a.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),z(n,{code:D.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):de.assertNever(s);return{status:a.value,value:e.data}}_getInvalidInput(e){const r=this._getOrReturnCtx(e);return z(r,{code:D.invalid_type,expected:L.bigint,received:r.parsedType}),X}gte(e,r){return this.setLimit("min",e,!0,G.toString(r))}gt(e,r){return this.setLimit("min",e,!1,G.toString(r))}lte(e,r){return this.setLimit("max",e,!0,G.toString(r))}lt(e,r){return this.setLimit("max",e,!1,G.toString(r))}setLimit(e,r,n,a){return new Le({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:G.toString(a)}]})}_addCheck(e){return new Le({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:G.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:G.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:G.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:G.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:G.toString(r)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}Le.create=t=>{var e;return new Le({checks:[],typeName:Q.ZodBigInt,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...re(t)})};class gt extends ae{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==L.boolean){const n=this._getOrReturnCtx(e);return z(n,{code:D.invalid_type,expected:L.boolean,received:n.parsedType}),X}return be(e.data)}}gt.create=t=>new gt({typeName:Q.ZodBoolean,coerce:t?.coerce||!1,...re(t)});class Ye extends ae{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==L.date){const s=this._getOrReturnCtx(e);return z(s,{code:D.invalid_type,expected:L.date,received:s.parsedType}),X}if(isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return z(s,{code:D.invalid_date}),X}const n=new ge;let a;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(a=this._getOrReturnCtx(e,a),z(a,{code:D.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(a=this._getOrReturnCtx(e,a),z(a,{code:D.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):de.assertNever(s);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Ye({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:G.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:G.toString(r)})}get minDate(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}}Ye.create=t=>new Ye({checks:[],coerce:t?.coerce||!1,typeName:Q.ZodDate,...re(t)});class gr extends ae{_parse(e){if(this._getType(e)!==L.symbol){const n=this._getOrReturnCtx(e);return z(n,{code:D.invalid_type,expected:L.symbol,received:n.parsedType}),X}return be(e.data)}}gr.create=t=>new gr({typeName:Q.ZodSymbol,...re(t)});class _t extends ae{_parse(e){if(this._getType(e)!==L.undefined){const n=this._getOrReturnCtx(e);return z(n,{code:D.invalid_type,expected:L.undefined,received:n.parsedType}),X}return be(e.data)}}_t.create=t=>new _t({typeName:Q.ZodUndefined,...re(t)});class bt extends ae{_parse(e){if(this._getType(e)!==L.null){const n=this._getOrReturnCtx(e);return z(n,{code:D.invalid_type,expected:L.null,received:n.parsedType}),X}return be(e.data)}}bt.create=t=>new bt({typeName:Q.ZodNull,...re(t)});class ct extends ae{constructor(){super(...arguments),this._any=!0}_parse(e){return be(e.data)}}ct.create=t=>new ct({typeName:Q.ZodAny,...re(t)});class Je extends ae{constructor(){super(...arguments),this._unknown=!0}_parse(e){return be(e.data)}}Je.create=t=>new Je({typeName:Q.ZodUnknown,...re(t)});class Ve extends ae{_parse(e){const r=this._getOrReturnCtx(e);return z(r,{code:D.invalid_type,expected:L.never,received:r.parsedType}),X}}Ve.create=t=>new Ve({typeName:Q.ZodNever,...re(t)});class _r extends ae{_parse(e){if(this._getType(e)!==L.undefined){const n=this._getOrReturnCtx(e);return z(n,{code:D.invalid_type,expected:L.void,received:n.parsedType}),X}return be(e.data)}}_r.create=t=>new _r({typeName:Q.ZodVoid,...re(t)});class Oe extends ae{_parse(e){const{ctx:r,status:n}=this._processInputParams(e),a=this._def;if(r.parsedType!==L.array)return z(r,{code:D.invalid_type,expected:L.array,received:r.parsedType}),X;if(a.exactLength!==null){const c=r.data.length>a.exactLength.value,o=r.data.length<a.exactLength.value;(c||o)&&(z(r,{code:c?D.too_big:D.too_small,minimum:o?a.exactLength.value:void 0,maximum:c?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),n.dirty())}if(a.minLength!==null&&r.data.length<a.minLength.value&&(z(r,{code:D.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),n.dirty()),a.maxLength!==null&&r.data.length>a.maxLength.value&&(z(r,{code:D.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((c,o)=>a.type._parseAsync(new Re(r,c,r.path,o)))).then(c=>ge.mergeArray(n,c));const s=[...r.data].map((c,o)=>a.type._parseSync(new Re(r,c,r.path,o)));return ge.mergeArray(n,s)}get element(){return this._def.type}min(e,r){return new Oe({...this._def,minLength:{value:e,message:G.toString(r)}})}max(e,r){return new Oe({...this._def,maxLength:{value:e,message:G.toString(r)}})}length(e,r){return new Oe({...this._def,exactLength:{value:e,message:G.toString(r)}})}nonempty(e){return this.min(1,e)}}Oe.create=(t,e)=>new Oe({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Q.ZodArray,...re(e)});function nt(t){if(t instanceof pe){const e={};for(const r in t.shape){const n=t.shape[r];e[r]=Ie.create(nt(n))}return new pe({...t._def,shape:()=>e})}else return t instanceof Oe?new Oe({...t._def,type:nt(t.element)}):t instanceof Ie?Ie.create(nt(t.unwrap())):t instanceof Fe?Fe.create(nt(t.unwrap())):t instanceof Ce?Ce.create(t.items.map(e=>nt(e))):t}class pe extends ae{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),r=de.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==L.object){const p=this._getOrReturnCtx(e);return z(p,{code:D.invalid_type,expected:L.object,received:p.parsedType}),X}const{status:n,ctx:a}=this._processInputParams(e),{shape:s,keys:c}=this._getCached(),o=[];if(!(this._def.catchall instanceof Ve&&this._def.unknownKeys==="strip"))for(const p in a.data)c.includes(p)||o.push(p);const u=[];for(const p of c){const m=s[p],b=a.data[p];u.push({key:{status:"valid",value:p},value:m._parse(new Re(a,b,a.path,p)),alwaysSet:p in a.data})}if(this._def.catchall instanceof Ve){const p=this._def.unknownKeys;if(p==="passthrough")for(const m of o)u.push({key:{status:"valid",value:m},value:{status:"valid",value:a.data[m]}});else if(p==="strict")o.length>0&&(z(a,{code:D.unrecognized_keys,keys:o}),n.dirty());else if(p!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const p=this._def.catchall;for(const m of o){const b=a.data[m];u.push({key:{status:"valid",value:m},value:p._parse(new Re(a,b,a.path,m)),alwaysSet:m in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const p=[];for(const m of u){const b=await m.key,w=await m.value;p.push({key:b,value:w,alwaysSet:m.alwaysSet})}return p}).then(p=>ge.mergeObjectSync(n,p)):ge.mergeObjectSync(n,u)}get shape(){return this._def.shape()}strict(e){return G.errToObj,new pe({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{var a,s,c,o;const u=(c=(s=(a=this._def).errorMap)===null||s===void 0?void 0:s.call(a,r,n).message)!==null&&c!==void 0?c:n.defaultError;return r.code==="unrecognized_keys"?{message:(o=G.errToObj(e).message)!==null&&o!==void 0?o:u}:{message:u}}}:{}})}strip(){return new pe({...this._def,unknownKeys:"strip"})}passthrough(){return new pe({...this._def,unknownKeys:"passthrough"})}extend(e){return new pe({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new pe({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Q.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new pe({...this._def,catchall:e})}pick(e){const r={};return de.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new pe({...this._def,shape:()=>r})}omit(e){const r={};return de.objectKeys(this.shape).forEach(n=>{e[n]||(r[n]=this.shape[n])}),new pe({...this._def,shape:()=>r})}deepPartial(){return nt(this)}partial(e){const r={};return de.objectKeys(this.shape).forEach(n=>{const a=this.shape[n];e&&!e[n]?r[n]=a:r[n]=a.optional()}),new pe({...this._def,shape:()=>r})}required(e){const r={};return de.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])r[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof Ie;)s=s._def.innerType;r[n]=s}}),new pe({...this._def,shape:()=>r})}keyof(){return Ms(de.objectKeys(this.shape))}}pe.create=(t,e)=>new pe({shape:()=>t,unknownKeys:"strip",catchall:Ve.create(),typeName:Q.ZodObject,...re(e)});pe.strictCreate=(t,e)=>new pe({shape:()=>t,unknownKeys:"strict",catchall:Ve.create(),typeName:Q.ZodObject,...re(e)});pe.lazycreate=(t,e)=>new pe({shape:t,unknownKeys:"strip",catchall:Ve.create(),typeName:Q.ZodObject,...re(e)});class $t extends ae{_parse(e){const{ctx:r}=this._processInputParams(e),n=this._def.options;function a(s){for(const o of s)if(o.result.status==="valid")return o.result;for(const o of s)if(o.result.status==="dirty")return r.common.issues.push(...o.ctx.common.issues),o.result;const c=s.map(o=>new Ee(o.ctx.common.issues));return z(r,{code:D.invalid_union,unionErrors:c}),X}if(r.common.async)return Promise.all(n.map(async s=>{const c={...r,common:{...r.common,issues:[]},parent:null};return{result:await s._parseAsync({data:r.data,path:r.path,parent:c}),ctx:c}})).then(a);{let s;const c=[];for(const u of n){const p={...r,common:{...r.common,issues:[]},parent:null},m=u._parseSync({data:r.data,path:r.path,parent:p});if(m.status==="valid")return m;m.status==="dirty"&&!s&&(s={result:m,ctx:p}),p.common.issues.length&&c.push(p.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;const o=c.map(u=>new Ee(u));return z(r,{code:D.invalid_union,unionErrors:o}),X}}get options(){return this._def.options}}$t.create=(t,e)=>new $t({options:t,typeName:Q.ZodUnion,...re(e)});const qe=t=>t instanceof Et?qe(t.schema):t instanceof Te?qe(t.innerType()):t instanceof St?[t.value]:t instanceof Ue?t.options:t instanceof Pt?de.objectValues(t.enum):t instanceof jt?qe(t._def.innerType):t instanceof _t?[void 0]:t instanceof bt?[null]:t instanceof Ie?[void 0,...qe(t.unwrap())]:t instanceof Fe?[null,...qe(t.unwrap())]:t instanceof Yr||t instanceof Tt?qe(t.unwrap()):t instanceof Ot?qe(t._def.innerType):[];class Pr extends ae{_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==L.object)return z(r,{code:D.invalid_type,expected:L.object,received:r.parsedType}),X;const n=this.discriminator,a=r.data[n],s=this.optionsMap.get(a);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(z(r,{code:D.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),X)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){const a=new Map;for(const s of r){const c=qe(s.shape[e]);if(!c.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const o of c){if(a.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);a.set(o,s)}}return new Pr({typeName:Q.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:a,...re(n)})}}function Wr(t,e){const r=De(t),n=De(e);if(t===e)return{valid:!0,data:t};if(r===L.object&&n===L.object){const a=de.objectKeys(e),s=de.objectKeys(t).filter(o=>a.indexOf(o)!==-1),c={...t,...e};for(const o of s){const u=Wr(t[o],e[o]);if(!u.valid)return{valid:!1};c[o]=u.data}return{valid:!0,data:c}}else if(r===L.array&&n===L.array){if(t.length!==e.length)return{valid:!1};const a=[];for(let s=0;s<t.length;s++){const c=t[s],o=e[s],u=Wr(c,o);if(!u.valid)return{valid:!1};a.push(u.data)}return{valid:!0,data:a}}else return r===L.date&&n===L.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class wt extends ae{_parse(e){const{status:r,ctx:n}=this._processInputParams(e),a=(s,c)=>{if(Gr(s)||Gr(c))return X;const o=Wr(s.value,c.value);return o.valid?((Jr(s)||Jr(c))&&r.dirty(),{status:r.value,value:o.data}):(z(n,{code:D.invalid_intersection_types}),X)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,c])=>a(s,c)):a(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}wt.create=(t,e,r)=>new wt({left:t,right:e,typeName:Q.ZodIntersection,...re(r)});class Ce extends ae{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==L.array)return z(n,{code:D.invalid_type,expected:L.array,received:n.parsedType}),X;if(n.data.length<this._def.items.length)return z(n,{code:D.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),X;!this._def.rest&&n.data.length>this._def.items.length&&(z(n,{code:D.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const s=[...n.data].map((c,o)=>{const u=this._def.items[o]||this._def.rest;return u?u._parse(new Re(n,c,n.path,o)):null}).filter(c=>!!c);return n.common.async?Promise.all(s).then(c=>ge.mergeArray(r,c)):ge.mergeArray(r,s)}get items(){return this._def.items}rest(e){return new Ce({...this._def,rest:e})}}Ce.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ce({items:t,typeName:Q.ZodTuple,rest:null,...re(e)})};class kt extends ae{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==L.object)return z(n,{code:D.invalid_type,expected:L.object,received:n.parsedType}),X;const a=[],s=this._def.keyType,c=this._def.valueType;for(const o in n.data)a.push({key:s._parse(new Re(n,o,n.path,o)),value:c._parse(new Re(n,n.data[o],n.path,o)),alwaysSet:o in n.data});return n.common.async?ge.mergeObjectAsync(r,a):ge.mergeObjectSync(r,a)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof ae?new kt({keyType:e,valueType:r,typeName:Q.ZodRecord,...re(n)}):new kt({keyType:je.create(),valueType:e,typeName:Q.ZodRecord,...re(r)})}}class br extends ae{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==L.map)return z(n,{code:D.invalid_type,expected:L.map,received:n.parsedType}),X;const a=this._def.keyType,s=this._def.valueType,c=[...n.data.entries()].map(([o,u],p)=>({key:a._parse(new Re(n,o,n.path,[p,"key"])),value:s._parse(new Re(n,u,n.path,[p,"value"]))}));if(n.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const u of c){const p=await u.key,m=await u.value;if(p.status==="aborted"||m.status==="aborted")return X;(p.status==="dirty"||m.status==="dirty")&&r.dirty(),o.set(p.value,m.value)}return{status:r.value,value:o}})}else{const o=new Map;for(const u of c){const p=u.key,m=u.value;if(p.status==="aborted"||m.status==="aborted")return X;(p.status==="dirty"||m.status==="dirty")&&r.dirty(),o.set(p.value,m.value)}return{status:r.value,value:o}}}}br.create=(t,e,r)=>new br({valueType:e,keyType:t,typeName:Q.ZodMap,...re(r)});class Qe extends ae{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==L.set)return z(n,{code:D.invalid_type,expected:L.set,received:n.parsedType}),X;const a=this._def;a.minSize!==null&&n.data.size<a.minSize.value&&(z(n,{code:D.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),r.dirty()),a.maxSize!==null&&n.data.size>a.maxSize.value&&(z(n,{code:D.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),r.dirty());const s=this._def.valueType;function c(u){const p=new Set;for(const m of u){if(m.status==="aborted")return X;m.status==="dirty"&&r.dirty(),p.add(m.value)}return{status:r.value,value:p}}const o=[...n.data.values()].map((u,p)=>s._parse(new Re(n,u,n.path,p)));return n.common.async?Promise.all(o).then(u=>c(u)):c(o)}min(e,r){return new Qe({...this._def,minSize:{value:e,message:G.toString(r)}})}max(e,r){return new Qe({...this._def,maxSize:{value:e,message:G.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}}Qe.create=(t,e)=>new Qe({valueType:t,minSize:null,maxSize:null,typeName:Q.ZodSet,...re(e)});class at extends ae{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==L.function)return z(r,{code:D.invalid_type,expected:L.function,received:r.parsedType}),X;function n(o,u){return yr({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,mr(),ot].filter(p=>!!p),issueData:{code:D.invalid_arguments,argumentsError:u}})}function a(o,u){return yr({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,mr(),ot].filter(p=>!!p),issueData:{code:D.invalid_return_type,returnTypeError:u}})}const s={errorMap:r.common.contextualErrorMap},c=r.data;if(this._def.returns instanceof ut){const o=this;return be(async function(...u){const p=new Ee([]),m=await o._def.args.parseAsync(u,s).catch($=>{throw p.addIssue(n(u,$)),p}),b=await Reflect.apply(c,this,m);return await o._def.returns._def.type.parseAsync(b,s).catch($=>{throw p.addIssue(a(b,$)),p})})}else{const o=this;return be(function(...u){const p=o._def.args.safeParse(u,s);if(!p.success)throw new Ee([n(u,p.error)]);const m=Reflect.apply(c,this,p.data),b=o._def.returns.safeParse(m,s);if(!b.success)throw new Ee([a(m,b.error)]);return b.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new at({...this._def,args:Ce.create(e).rest(Je.create())})}returns(e){return new at({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new at({args:e||Ce.create([]).rest(Je.create()),returns:r||Je.create(),typeName:Q.ZodFunction,...re(n)})}}class Et extends ae{get schema(){return this._def.getter()}_parse(e){const{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}Et.create=(t,e)=>new Et({getter:t,typeName:Q.ZodLazy,...re(e)});class St extends ae{_parse(e){if(e.data!==this._def.value){const r=this._getOrReturnCtx(e);return z(r,{received:r.data,code:D.invalid_literal,expected:this._def.value}),X}return{status:"valid",value:e.data}}get value(){return this._def.value}}St.create=(t,e)=>new St({value:t,typeName:Q.ZodLiteral,...re(e)});function Ms(t,e){return new Ue({values:t,typeName:Q.ZodEnum,...re(e)})}class Ue extends ae{constructor(){super(...arguments),mt.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const r=this._getOrReturnCtx(e),n=this._def.values;return z(r,{expected:de.joinValues(n),received:r.parsedType,code:D.invalid_type}),X}if(vr(this,mt)||Rs(this,mt,new Set(this._def.values)),!vr(this,mt).has(e.data)){const r=this._getOrReturnCtx(e),n=this._def.values;return z(r,{received:r.data,code:D.invalid_enum_value,options:n}),X}return be(e.data)}get options(){return this._def.values}get enum(){const e={};for(const r of this._def.values)e[r]=r;return e}get Values(){const e={};for(const r of this._def.values)e[r]=r;return e}get Enum(){const e={};for(const r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return Ue.create(e,{...this._def,...r})}exclude(e,r=this._def){return Ue.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}}mt=new WeakMap;Ue.create=Ms;class Pt extends ae{constructor(){super(...arguments),yt.set(this,void 0)}_parse(e){const r=de.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==L.string&&n.parsedType!==L.number){const a=de.objectValues(r);return z(n,{expected:de.joinValues(a),received:n.parsedType,code:D.invalid_type}),X}if(vr(this,yt)||Rs(this,yt,new Set(de.getValidEnumValues(this._def.values))),!vr(this,yt).has(e.data)){const a=de.objectValues(r);return z(n,{received:n.data,code:D.invalid_enum_value,options:a}),X}return be(e.data)}get enum(){return this._def.values}}yt=new WeakMap;Pt.create=(t,e)=>new Pt({values:t,typeName:Q.ZodNativeEnum,...re(e)});class ut extends ae{unwrap(){return this._def.type}_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==L.promise&&r.common.async===!1)return z(r,{code:D.invalid_type,expected:L.promise,received:r.parsedType}),X;const n=r.parsedType===L.promise?r.data:Promise.resolve(r.data);return be(n.then(a=>this._def.type.parseAsync(a,{path:r.path,errorMap:r.common.contextualErrorMap})))}}ut.create=(t,e)=>new ut({type:t,typeName:Q.ZodPromise,...re(e)});class Te extends ae{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Q.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:r,ctx:n}=this._processInputParams(e),a=this._def.effect||null,s={addIssue:c=>{z(n,c),c.fatal?r.abort():r.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),a.type==="preprocess"){const c=a.transform(n.data,s);if(n.common.async)return Promise.resolve(c).then(async o=>{if(r.value==="aborted")return X;const u=await this._def.schema._parseAsync({data:o,path:n.path,parent:n});return u.status==="aborted"?X:u.status==="dirty"||r.value==="dirty"?st(u.value):u});{if(r.value==="aborted")return X;const o=this._def.schema._parseSync({data:c,path:n.path,parent:n});return o.status==="aborted"?X:o.status==="dirty"||r.value==="dirty"?st(o.value):o}}if(a.type==="refinement"){const c=o=>{const u=a.refinement(o,s);if(n.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?X:(o.status==="dirty"&&r.dirty(),c(o.value),{status:r.value,value:o.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>o.status==="aborted"?X:(o.status==="dirty"&&r.dirty(),c(o.value).then(()=>({status:r.value,value:o.value}))))}if(a.type==="transform")if(n.common.async===!1){const c=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!We(c))return c;const o=a.transform(c.value,s);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:o}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(c=>We(c)?Promise.resolve(a.transform(c.value,s)).then(o=>({status:r.value,value:o})):c);de.assertNever(a)}}Te.create=(t,e,r)=>new Te({schema:t,typeName:Q.ZodEffects,effect:e,...re(r)});Te.createWithPreprocess=(t,e,r)=>new Te({schema:e,effect:{type:"preprocess",transform:t},typeName:Q.ZodEffects,...re(r)});class Ie extends ae{_parse(e){return this._getType(e)===L.undefined?be(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ie.create=(t,e)=>new Ie({innerType:t,typeName:Q.ZodOptional,...re(e)});class Fe extends ae{_parse(e){return this._getType(e)===L.null?be(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Fe.create=(t,e)=>new Fe({innerType:t,typeName:Q.ZodNullable,...re(e)});class jt extends ae{_parse(e){const{ctx:r}=this._processInputParams(e);let n=r.data;return r.parsedType===L.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}jt.create=(t,e)=>new jt({innerType:t,typeName:Q.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...re(e)});class Ot extends ae{_parse(e){const{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},a=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return vt(a)?a.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Ee(n.common.issues)},input:n.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Ee(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}Ot.create=(t,e)=>new Ot({innerType:t,typeName:Q.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...re(e)});class $r extends ae{_parse(e){if(this._getType(e)!==L.nan){const n=this._getOrReturnCtx(e);return z(n,{code:D.invalid_type,expected:L.nan,received:n.parsedType}),X}return{status:"valid",value:e.data}}}$r.create=t=>new $r({typeName:Q.ZodNaN,...re(t)});const Pa=Symbol("zod_brand");class Yr extends ae{_parse(e){const{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class Nt extends ae{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?X:s.status==="dirty"?(r.dirty(),st(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})})();{const a=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?X:a.status==="dirty"?(r.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:n.path,parent:n})}}static create(e,r){return new Nt({in:e,out:r,typeName:Q.ZodPipeline})}}class Tt extends ae{_parse(e){const r=this._def.innerType._parse(e),n=a=>(We(a)&&(a.value=Object.freeze(a.value)),a);return vt(r)?r.then(a=>n(a)):n(r)}unwrap(){return this._def.innerType}}Tt.create=(t,e)=>new Tt({innerType:t,typeName:Q.ZodReadonly,...re(e)});function cn(t,e){const r=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof r=="string"?{message:r}:r}function qs(t,e={},r){return t?ct.create().superRefine((n,a)=>{var s,c;const o=t(n);if(o instanceof Promise)return o.then(u=>{var p,m;if(!u){const b=cn(e,n),w=(m=(p=b.fatal)!==null&&p!==void 0?p:r)!==null&&m!==void 0?m:!0;a.addIssue({code:"custom",...b,fatal:w})}});if(!o){const u=cn(e,n),p=(c=(s=u.fatal)!==null&&s!==void 0?s:r)!==null&&c!==void 0?c:!0;a.addIssue({code:"custom",...u,fatal:p})}}):ct.create()}const ja={object:pe.lazycreate};var Q;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(Q||(Q={}));const Oa=(t,e={message:`Input not instance of ${t.name}`})=>qs(r=>r instanceof t,e),Ds=je.create,Vs=Ze.create,Ta=$r.create,Na=Le.create,zs=gt.create,Ia=Ye.create,Ra=gr.create,Ca=_t.create,Aa=bt.create,xa=ct.create,Ma=Je.create,qa=Ve.create,Da=_r.create,Va=Oe.create,za=pe.create,Za=pe.strictCreate,La=$t.create,Ua=Pr.create,Fa=wt.create,Ka=Ce.create,Ha=kt.create,Ba=br.create,Ga=Qe.create,Ja=at.create,Wa=Et.create,Ya=St.create,Qa=Ue.create,Xa=Pt.create,ei=ut.create,un=Te.create,ti=Ie.create,ri=Fe.create,ni=Te.createWithPreprocess,si=Nt.create,ai=()=>Ds().optional(),ii=()=>Vs().optional(),oi=()=>zs().optional(),ci={string:t=>je.create({...t,coerce:!0}),number:t=>Ze.create({...t,coerce:!0}),boolean:t=>gt.create({...t,coerce:!0}),bigint:t=>Le.create({...t,coerce:!0}),date:t=>Ye.create({...t,coerce:!0})},ui=X;var N=Object.freeze({__proto__:null,defaultErrorMap:ot,setErrorMap:na,getErrorMap:mr,makeIssue:yr,EMPTY_PATH:sa,addIssueToContext:z,ParseStatus:ge,INVALID:X,DIRTY:st,OK:be,isAborted:Gr,isDirty:Jr,isValid:We,isAsync:vt,get util(){return de},get objectUtil(){return Br},ZodParsedType:L,getParsedType:De,ZodType:ae,datetimeRegex:xs,ZodString:je,ZodNumber:Ze,ZodBigInt:Le,ZodBoolean:gt,ZodDate:Ye,ZodSymbol:gr,ZodUndefined:_t,ZodNull:bt,ZodAny:ct,ZodUnknown:Je,ZodNever:Ve,ZodVoid:_r,ZodArray:Oe,ZodObject:pe,ZodUnion:$t,ZodDiscriminatedUnion:Pr,ZodIntersection:wt,ZodTuple:Ce,ZodRecord:kt,ZodMap:br,ZodSet:Qe,ZodFunction:at,ZodLazy:Et,ZodLiteral:St,ZodEnum:Ue,ZodNativeEnum:Pt,ZodPromise:ut,ZodEffects:Te,ZodTransformer:Te,ZodOptional:Ie,ZodNullable:Fe,ZodDefault:jt,ZodCatch:Ot,ZodNaN:$r,BRAND:Pa,ZodBranded:Yr,ZodPipeline:Nt,ZodReadonly:Tt,custom:qs,Schema:ae,ZodSchema:ae,late:ja,get ZodFirstPartyTypeKind(){return Q},coerce:ci,any:xa,array:Va,bigint:Na,boolean:zs,date:Ia,discriminatedUnion:Ua,effect:un,enum:Qa,function:Ja,instanceof:Oa,intersection:Fa,lazy:Wa,literal:Ya,map:Ba,nan:Ta,nativeEnum:Xa,never:qa,null:Aa,nullable:ri,number:Vs,object:za,oboolean:oi,onumber:ii,optional:ti,ostring:ai,pipeline:si,preprocess:ni,promise:ei,record:Ha,set:Ga,strictObject:Za,string:Ds,symbol:Ra,transformer:un,tuple:Ka,undefined:Ca,union:La,unknown:Ma,void:Da,NEVER:ui,ZodIssueCode:D,quotelessJson:ra,ZodError:Ee});const Qr=N.object({x:N.number(),y:N.number()}),it=N.object({instanceId:N.string(),output:N.string()}),wr=N.object({hubId:N.string()}),di=N.object({args:N.record(N.unknown()).optional(),inputs:N.record(N.array(it)).optional(),hubInputs:N.record(N.array(wr)).optional(),injectionInputs:N.array(wr).optional(),position:Qr.optional()}),dn=N.object({id:N.string(),type:N.string(),name:N.string(),...di.shape,resolvedInputs:N.record(N.array(it)).optional(),parentId:N.string().optional(),outputs:N.record(N.array(it)).optional(),resolvedOutputs:N.record(N.array(it)).optional()});N.object({instance:dn,children:N.array(dn),inputHash:N.string().optional()});N.object({position:Qr.optional(),inputs:N.array(it).optional(),injectionInputs:N.array(wr).optional()});N.object({id:N.string().nanoid(),position:Qr,inputs:N.array(it).optional(),injectionInputs:N.array(wr).optional()});var Zs={done:!1,hasNext:!1};function ln(t,...e){let r=t,n=e.map(s=>"lazy"in s?li(s):void 0),a=0;for(;a<e.length;){if(n[a]===void 0||!fi(r)){let u=e[a];r=u(r),a+=1;continue}let s=[];for(let u=a;u<e.length;u++){let p=n[u];if(p===void 0||(s.push(p),p.isSingle))break}let c=[];for(let u of r)if(Ls(u,c,s))break;let{isSingle:o}=s.at(-1);r=o?c[0]:c,a+=s.length}return r}function Ls(t,e,r){if(r.length===0)return e.push(t),!1;let n=t,a=Zs,s=!1;for(let[c,o]of r.entries()){let{index:u,items:p}=o;if(p.push(n),a=o(n,u,p),o.index+=1,a.hasNext){if(a.hasMany??!1){for(let m of a.next)if(Ls(m,e,r.slice(c+1)))return!0;return s}n=a.next}if(!a.hasNext)break;a.done&&(s=!0)}return a.hasNext&&e.push(n),s}function li(t){let{lazy:e,lazyArgs:r}=t,n=e(...r);return Object.assign(n,{isSingle:e.single??!1,index:0,items:[]})}function fi(t){return typeof t=="string"||typeof t=="object"&&t!==null&&Symbol.iterator in t}function hi(t,e){let r=e.length-t.length;if(r===1){let[n,...a]=e;return ln(n,{lazy:t,lazyArgs:a})}if(r===0){let n={lazy:t,lazyArgs:e};return Object.assign(a=>ln(a,n),n)}throw new Error("Wrong number of arguments")}function pi(t,e,r){let n=a=>t(a,...e);return r===void 0?n:Object.assign(n,{lazy:r,lazyArgs:e})}function Us(t,e,r){let n=t.length-e.length;if(n===0)return t(...e);if(n===1)return pi(t,e,r);throw new Error("Wrong number of arguments")}function mi(...t){return hi(yi,t)}function yi(){let t=new Set;return e=>t.has(e)?Zs:(t.add(e),{done:!1,hasNext:!0,next:e})}function vi(...t){return Us(gi,t)}function gi(t,e){let r={};for(let[n,a]of Object.entries(t)){let s=e(a,n,t);r[n]=s}return r}function _i(...t){return Us(Object.fromEntries,t)}const bi=N.enum(["not_created","updating","previewing","destroying","refreshing","created","error","pending","unknown"]),$i=N.object({name:N.string(),value:N.string().optional(),displayName:N.string().optional(),sensitive:N.boolean().optional(),url:N.string().optional(),complementaryTo:N.string().optional()}),Xr=N.object({name:N.string(),contentType:N.string(),size:N.number(),isBinary:N.boolean().optional()});N.object({meta:Xr,content:N.string()});const wi=N.union([N.object({type:N.literal("markdown"),content:N.string()}),N.object({type:N.literal("qr"),content:N.string(),showContent:N.coerce.boolean(),language:N.string().optional()}),N.object({type:N.literal("file"),fileMeta:Xr})]),Fs=N.object({name:N.string(),title:N.string()});N.object({...Fs.shape,content:N.array(wi)});const Ks=N.object({name:N.string(),title:N.string(),description:N.string().optional()}),ki=N.object({content:N.string().optional(),isBinary:N.boolean().optional(),mode:N.number().optional()});N.object({...Ks.shape,image:N.string(),command:N.string().array(),cwd:N.string().optional(),env:N.record(N.string()).optional(),files:N.record(ki).optional()});const Ei=N.union([N.object({type:N.literal("before-destroy")}),N.object({type:N.literal("schedule"),schedule:N.string()})]),Si=N.object({name:N.string(),title:N.string(),description:N.string().optional(),spec:Ei});N.object({name:N.string()});const Pi=N.object({id:N.string(),parentId:N.string().nullable().default(null),status:bi,dependencyIds:N.array(N.string()).default(()=>[]),latestOperationId:N.string().nullable().default(null),currentResourceCount:N.number().nullable().default(null),totalResourceCount:N.number().nullable().default(null),inputHash:N.string().nullable().default(null),outputHash:N.string().nullable().default(null),error:N.string().nullable().default(null),evaluationError:N.string().nullable().default(null),statusFields:N.array($i).default(()=>[]),files:N.array(Xr).default(()=>[]),pages:N.array(Fs).default(()=>[]),terminals:N.array(Ks).default(()=>[]),triggers:N.array(Si).default(()=>[])});N.object({...Pi.shape,secrets:N.record(N.string()).nullable(),logLine:N.string().nullable()}).partial();const Hs=N.enum(["update","preview","destroy","recreate","refresh"]),ji=N.enum(["pending","running","completed","failed","cancelled"]),Bs=N.object({forceUpdateDependencies:N.boolean().default(!1),destroyDependentInstances:N.boolean().default(!0),invokeDestroyTriggers:N.boolean().default(!0),deleteUnreachableResources:N.boolean().default(!1),forceDeleteState:N.boolean().default(!1),refresh:N.boolean().default(!1)});N.object({projectId:N.string(),type:Hs,instanceIds:N.array(N.string()),options:Bs.partial().optional()});N.object({id:N.string().uuid(),status:ji,projectId:N.string(),type:Hs,instanceIds:N.array(N.string()),affectedInstanceIds:N.array(N.string()).default(()=>[]),options:Bs.default(()=>({})),error:N.string().nullable(),startedAt:N.number(),completedAt:N.number().nullable()});class Oi extends Error{constructor(e){super(`Circular dependency detected: ${e.join(" -> ")}`),this.name="CircularDependencyError"}}function Ti(){return{promiseCache:new Map}}function en(t){const e=(r,n,a)=>{a??=Ti(),n=n.child({resolver:t.name});const s=new Map,c=(o,u)=>{n.trace({itemId:o},"resolving item");const p=a.promiseCache.get(o);if(p)return p;if(u.includes(o))throw new Oi([...u,o]);const m=r.get(o);if(!m)return Promise.resolve(void 0);const w=(async()=>{const $=mi(t.getNodeDependencies(m));a.setDependencies?.(o,$),n.trace({itemId:o,dependencies:$},"resolving item dependencies");const S=[...u,o];for(const y of $)await c(y,S);return await t.process(m,s,n)})().then($=>(a.promiseCache.get(o)===w&&(a.setOutput?.(o,$),s.set(o,$)),$));return a.promiseCache.set(o,w),w};return o=>c(o,[])};return e.factoryName=t.name,e}var It={exports:{}},xr={},Ae={},He={},Mr={},qr={},Dr={},fn;function kr(){return fn||(fn=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.regexpCode=t.getEsmExportName=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;class e{}t._CodeOrName=e,t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends e{constructor(i){if(super(),!t.IDENTIFIER.test(i))throw new Error("CodeGen: name must be a valid identifier");this.str=i}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}t.Name=r;class n extends e{constructor(i){super(),this._items=typeof i=="string"?[i]:i}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const i=this._items[0];return i===""||i==='""'}get str(){var i;return(i=this._str)!==null&&i!==void 0?i:this._str=this._items.reduce((h,v)=>`${h}${v}`,"")}get names(){var i;return(i=this._names)!==null&&i!==void 0?i:this._names=this._items.reduce((h,v)=>(v instanceof r&&(h[v.str]=(h[v.str]||0)+1),h),{})}}t._Code=n,t.nil=new n("");function a(d,...i){const h=[d[0]];let v=0;for(;v<i.length;)o(h,i[v]),h.push(d[++v]);return new n(h)}t._=a;const s=new n("+");function c(d,...i){const h=[$(d[0])];let v=0;for(;v<i.length;)h.push(s),o(h,i[v]),h.push(s,$(d[++v]));return u(h),new n(h)}t.str=c;function o(d,i){i instanceof n?d.push(...i._items):i instanceof r?d.push(i):d.push(b(i))}t.addCodeArg=o;function u(d){let i=1;for(;i<d.length-1;){if(d[i]===s){const h=p(d[i-1],d[i+1]);if(h!==void 0){d.splice(i-1,3,h);continue}d[i++]="+"}i++}}function p(d,i){if(i==='""')return d;if(d==='""')return i;if(typeof d=="string")return i instanceof r||d[d.length-1]!=='"'?void 0:typeof i!="string"?`${d.slice(0,-1)}${i}"`:i[0]==='"'?d.slice(0,-1)+i.slice(1):void 0;if(typeof i=="string"&&i[0]==='"'&&!(d instanceof r))return`"${d}${i.slice(1)}`}function m(d,i){return i.emptyStr()?d:d.emptyStr()?i:c`${d}${i}`}t.strConcat=m;function b(d){return typeof d=="number"||typeof d=="boolean"||d===null?d:$(Array.isArray(d)?d.join(","):d)}function w(d){return new n($(d))}t.stringify=w;function $(d){return JSON.stringify(d).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}t.safeStringify=$;function S(d){return typeof d=="string"&&t.IDENTIFIER.test(d)?new n(`.${d}`):a`[${d}]`}t.getProperty=S;function y(d){if(typeof d=="string"&&t.IDENTIFIER.test(d))return new n(`${d}`);throw new Error(`CodeGen: invalid export name: ${d}, use explicit $id name mapping`)}t.getEsmExportName=y;function f(d){return new n(d.toString())}t.regexpCode=f}(Dr)),Dr}var Vr={},hn;function pn(){return hn||(hn=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;const e=kr();class r extends Error{constructor(p){super(`CodeGen: "code" for ${p} not defined`),this.value=p.value}}var n;(function(u){u[u.Started=0]="Started",u[u.Completed=1]="Completed"})(n||(t.UsedValueState=n={})),t.varKinds={const:new e.Name("const"),let:new e.Name("let"),var:new e.Name("var")};class a{constructor({prefixes:p,parent:m}={}){this._names={},this._prefixes=p,this._parent=m}toName(p){return p instanceof e.Name?p:this.name(p)}name(p){return new e.Name(this._newName(p))}_newName(p){const m=this._names[p]||this._nameGroup(p);return`${p}${m.index++}`}_nameGroup(p){var m,b;if(!((b=(m=this._parent)===null||m===void 0?void 0:m._prefixes)===null||b===void 0)&&b.has(p)||this._prefixes&&!this._prefixes.has(p))throw new Error(`CodeGen: prefix "${p}" is not allowed in this scope`);return this._names[p]={prefix:p,index:0}}}t.Scope=a;class s extends e.Name{constructor(p,m){super(m),this.prefix=p}setValue(p,{property:m,itemIndex:b}){this.value=p,this.scopePath=(0,e._)`.${new e.Name(m)}[${b}]`}}t.ValueScopeName=s;const c=(0,e._)`\n`;class o extends a{constructor(p){super(p),this._values={},this._scope=p.scope,this.opts={...p,_n:p.lines?c:e.nil}}get(){return this._scope}name(p){return new s(p,this._newName(p))}value(p,m){var b;if(m.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const w=this.toName(p),{prefix:$}=w,S=(b=m.key)!==null&&b!==void 0?b:m.ref;let y=this._values[$];if(y){const i=y.get(S);if(i)return i}else y=this._values[$]=new Map;y.set(S,w);const f=this._scope[$]||(this._scope[$]=[]),d=f.length;return f[d]=m.ref,w.setValue(m,{property:$,itemIndex:d}),w}getValue(p,m){const b=this._values[p];if(b)return b.get(m)}scopeRefs(p,m=this._values){return this._reduceValues(m,b=>{if(b.scopePath===void 0)throw new Error(`CodeGen: name "${b}" has no value`);return(0,e._)`${p}${b.scopePath}`})}scopeCode(p=this._values,m,b){return this._reduceValues(p,w=>{if(w.value===void 0)throw new Error(`CodeGen: name "${w}" has no value`);return w.value.code},m,b)}_reduceValues(p,m,b={},w){let $=e.nil;for(const S in p){const y=p[S];if(!y)continue;const f=b[S]=b[S]||new Map;y.forEach(d=>{if(f.has(d))return;f.set(d,n.Started);let i=m(d);if(i){const h=this.opts.es5?t.varKinds.var:t.varKinds.const;$=(0,e._)`${$}${h} ${d} = ${i};${this.opts._n}`}else if(i=w?.(d))$=(0,e._)`${$}${i}${this.opts._n}`;else throw new r(d);f.set(d,n.Completed)})}return $}}t.ValueScope=o}(Vr)),Vr}var mn;function oe(){return mn||(mn=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;const e=kr(),r=pn();var n=kr();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(t,"strConcat",{enumerable:!0,get:function(){return n.strConcat}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(t,"getProperty",{enumerable:!0,get:function(){return n.getProperty}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(t,"regexpCode",{enumerable:!0,get:function(){return n.regexpCode}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return n.Name}});var a=pn();Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return a.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:function(){return a.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:function(){return a.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:function(){return a.varKinds}}),t.operators={GT:new e._Code(">"),GTE:new e._Code(">="),LT:new e._Code("<"),LTE:new e._Code("<="),EQ:new e._Code("==="),NEQ:new e._Code("!=="),NOT:new e._Code("!"),OR:new e._Code("||"),AND:new e._Code("&&"),ADD:new e._Code("+")};class s{optimizeNodes(){return this}optimizeNames(l,k){return this}}class c extends s{constructor(l,k,C){super(),this.varKind=l,this.name=k,this.rhs=C}render({es5:l,_n:k}){const C=l?r.varKinds.var:this.varKind,U=this.rhs===void 0?"":` = ${this.rhs}`;return`${C} ${this.name}${U};`+k}optimizeNames(l,k){if(l[this.name.str])return this.rhs&&(this.rhs=ce(this.rhs,l,k)),this}get names(){return this.rhs instanceof e._CodeOrName?this.rhs.names:{}}}class o extends s{constructor(l,k,C){super(),this.lhs=l,this.rhs=k,this.sideEffects=C}render({_n:l}){return`${this.lhs} = ${this.rhs};`+l}optimizeNames(l,k){if(!(this.lhs instanceof e.Name&&!l[this.lhs.str]&&!this.sideEffects))return this.rhs=ce(this.rhs,l,k),this}get names(){const l=this.lhs instanceof e.Name?{}:{...this.lhs.names};return Y(l,this.rhs)}}class u extends o{constructor(l,k,C,U){super(l,C,U),this.op=k}render({_n:l}){return`${this.lhs} ${this.op}= ${this.rhs};`+l}}class p extends s{constructor(l){super(),this.label=l,this.names={}}render({_n:l}){return`${this.label}:`+l}}class m extends s{constructor(l){super(),this.label=l,this.names={}}render({_n:l}){return`break${this.label?` ${this.label}`:""};`+l}}class b extends s{constructor(l){super(),this.error=l}render({_n:l}){return`throw ${this.error};`+l}get names(){return this.error.names}}class w extends s{constructor(l){super(),this.code=l}render({_n:l}){return`${this.code};`+l}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(l,k){return this.code=ce(this.code,l,k),this}get names(){return this.code instanceof e._CodeOrName?this.code.names:{}}}class $ extends s{constructor(l=[]){super(),this.nodes=l}render(l){return this.nodes.reduce((k,C)=>k+C.render(l),"")}optimizeNodes(){const{nodes:l}=this;let k=l.length;for(;k--;){const C=l[k].optimizeNodes();Array.isArray(C)?l.splice(k,1,...C):C?l[k]=C:l.splice(k,1)}return l.length>0?this:void 0}optimizeNames(l,k){const{nodes:C}=this;let U=C.length;for(;U--;){const H=C[U];H.optimizeNames(l,k)||(R(l,H.names),C.splice(U,1))}return C.length>0?this:void 0}get names(){return this.nodes.reduce((l,k)=>ee(l,k.names),{})}}class S extends ${render(l){return"{"+l._n+super.render(l)+"}"+l._n}}class y extends ${}class f extends S{}f.kind="else";class d extends S{constructor(l,k){super(k),this.condition=l}render(l){let k=`if(${this.condition})`+super.render(l);return this.else&&(k+="else "+this.else.render(l)),k}optimizeNodes(){super.optimizeNodes();const l=this.condition;if(l===!0)return this.nodes;let k=this.else;if(k){const C=k.optimizeNodes();k=this.else=Array.isArray(C)?new f(C):C}if(k)return l===!1?k instanceof d?k:k.nodes:this.nodes.length?this:new d(Z(l),k instanceof d?[k]:k.nodes);if(!(l===!1||!this.nodes.length))return this}optimizeNames(l,k){var C;if(this.else=(C=this.else)===null||C===void 0?void 0:C.optimizeNames(l,k),!!(super.optimizeNames(l,k)||this.else))return this.condition=ce(this.condition,l,k),this}get names(){const l=super.names;return Y(l,this.condition),this.else&&ee(l,this.else.names),l}}d.kind="if";class i extends S{}i.kind="for";class h extends i{constructor(l){super(),this.iteration=l}render(l){return`for(${this.iteration})`+super.render(l)}optimizeNames(l,k){if(super.optimizeNames(l,k))return this.iteration=ce(this.iteration,l,k),this}get names(){return ee(super.names,this.iteration.names)}}class v extends i{constructor(l,k,C,U){super(),this.varKind=l,this.name=k,this.from=C,this.to=U}render(l){const k=l.es5?r.varKinds.var:this.varKind,{name:C,from:U,to:H}=this;return`for(${k} ${C}=${U}; ${C}<${H}; ${C}++)`+super.render(l)}get names(){const l=Y(super.names,this.from);return Y(l,this.to)}}class _ extends i{constructor(l,k,C,U){super(),this.loop=l,this.varKind=k,this.name=C,this.iterable=U}render(l){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(l)}optimizeNames(l,k){if(super.optimizeNames(l,k))return this.iterable=ce(this.iterable,l,k),this}get names(){return ee(super.names,this.iterable.names)}}class g extends S{constructor(l,k,C){super(),this.name=l,this.args=k,this.async=C}render(l){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(l)}}g.kind="func";class E extends ${render(l){return"return "+super.render(l)}}E.kind="return";class I extends S{render(l){let k="try"+super.render(l);return this.catch&&(k+=this.catch.render(l)),this.finally&&(k+=this.finally.render(l)),k}optimizeNodes(){var l,k;return super.optimizeNodes(),(l=this.catch)===null||l===void 0||l.optimizeNodes(),(k=this.finally)===null||k===void 0||k.optimizeNodes(),this}optimizeNames(l,k){var C,U;return super.optimizeNames(l,k),(C=this.catch)===null||C===void 0||C.optimizeNames(l,k),(U=this.finally)===null||U===void 0||U.optimizeNames(l,k),this}get names(){const l=super.names;return this.catch&&ee(l,this.catch.names),this.finally&&ee(l,this.finally.names),l}}class M extends S{constructor(l){super(),this.error=l}render(l){return`catch(${this.error})`+super.render(l)}}M.kind="catch";class F extends S{render(l){return"finally"+super.render(l)}}F.kind="finally";class K{constructor(l,k={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...k,_n:k.lines?`
2
+ `:""},this._extScope=l,this._scope=new r.Scope({parent:l}),this._nodes=[new y]}toString(){return this._root.render(this.opts)}name(l){return this._scope.name(l)}scopeName(l){return this._extScope.name(l)}scopeValue(l,k){const C=this._extScope.value(l,k);return(this._values[C.prefix]||(this._values[C.prefix]=new Set)).add(C),C}getScopeValue(l,k){return this._extScope.getValue(l,k)}scopeRefs(l){return this._extScope.scopeRefs(l,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(l,k,C,U){const H=this._scope.toName(k);return C!==void 0&&U&&(this._constants[H.str]=C),this._leafNode(new c(l,H,C)),H}const(l,k,C){return this._def(r.varKinds.const,l,k,C)}let(l,k,C){return this._def(r.varKinds.let,l,k,C)}var(l,k,C){return this._def(r.varKinds.var,l,k,C)}assign(l,k,C){return this._leafNode(new o(l,k,C))}add(l,k){return this._leafNode(new u(l,t.operators.ADD,k))}code(l){return typeof l=="function"?l():l!==e.nil&&this._leafNode(new w(l)),this}object(...l){const k=["{"];for(const[C,U]of l)k.length>1&&k.push(","),k.push(C),(C!==U||this.opts.es5)&&(k.push(":"),(0,e.addCodeArg)(k,U));return k.push("}"),new e._Code(k)}if(l,k,C){if(this._blockNode(new d(l)),k&&C)this.code(k).else().code(C).endIf();else if(k)this.code(k).endIf();else if(C)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(l){return this._elseNode(new d(l))}else(){return this._elseNode(new f)}endIf(){return this._endBlockNode(d,f)}_for(l,k){return this._blockNode(l),k&&this.code(k).endFor(),this}for(l,k){return this._for(new h(l),k)}forRange(l,k,C,U,H=this.opts.es5?r.varKinds.var:r.varKinds.let){const ue=this._scope.toName(l);return this._for(new v(H,ue,k,C),()=>U(ue))}forOf(l,k,C,U=r.varKinds.const){const H=this._scope.toName(l);if(this.opts.es5){const ue=k instanceof e.Name?k:this.var("_arr",k);return this.forRange("_i",0,(0,e._)`${ue}.length`,te=>{this.var(H,(0,e._)`${ue}[${te}]`),C(H)})}return this._for(new _("of",U,H,k),()=>C(H))}forIn(l,k,C,U=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(l,(0,e._)`Object.keys(${k})`,C);const H=this._scope.toName(l);return this._for(new _("in",U,H,k),()=>C(H))}endFor(){return this._endBlockNode(i)}label(l){return this._leafNode(new p(l))}break(l){return this._leafNode(new m(l))}return(l){const k=new E;if(this._blockNode(k),this.code(l),k.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(E)}try(l,k,C){if(!k&&!C)throw new Error('CodeGen: "try" without "catch" and "finally"');const U=new I;if(this._blockNode(U),this.code(l),k){const H=this.name("e");this._currNode=U.catch=new M(H),k(H)}return C&&(this._currNode=U.finally=new F,this.code(C)),this._endBlockNode(M,F)}throw(l){return this._leafNode(new b(l))}block(l,k){return this._blockStarts.push(this._nodes.length),l&&this.code(l).endBlock(k),this}endBlock(l){const k=this._blockStarts.pop();if(k===void 0)throw new Error("CodeGen: not in self-balancing block");const C=this._nodes.length-k;if(C<0||l!==void 0&&C!==l)throw new Error(`CodeGen: wrong number of nodes: ${C} vs ${l} expected`);return this._nodes.length=k,this}func(l,k=e.nil,C,U){return this._blockNode(new g(l,k,C)),U&&this.code(U).endFunc(),this}endFunc(){return this._endBlockNode(g)}optimize(l=1){for(;l-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(l){return this._currNode.nodes.push(l),this}_blockNode(l){this._currNode.nodes.push(l),this._nodes.push(l)}_endBlockNode(l,k){const C=this._currNode;if(C instanceof l||k&&C instanceof k)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${k?`${l.kind}/${k.kind}`:l.kind}"`)}_elseNode(l){const k=this._currNode;if(!(k instanceof d))throw new Error('CodeGen: "else" without "if"');return this._currNode=k.else=l,this}get _root(){return this._nodes[0]}get _currNode(){const l=this._nodes;return l[l.length-1]}set _currNode(l){const k=this._nodes;k[k.length-1]=l}}t.CodeGen=K;function ee(O,l){for(const k in l)O[k]=(O[k]||0)+(l[k]||0);return O}function Y(O,l){return l instanceof e._CodeOrName?ee(O,l.names):O}function ce(O,l,k){if(O instanceof e.Name)return C(O);if(!U(O))return O;return new e._Code(O._items.reduce((H,ue)=>(ue instanceof e.Name&&(ue=C(ue)),ue instanceof e._Code?H.push(...ue._items):H.push(ue),H),[]));function C(H){const ue=k[H.str];return ue===void 0||l[H.str]!==1?H:(delete l[H.str],ue)}function U(H){return H instanceof e._Code&&H._items.some(ue=>ue instanceof e.Name&&l[ue.str]===1&&k[ue.str]!==void 0)}}function R(O,l){for(const k in l)O[k]=(O[k]||0)-(l[k]||0)}function Z(O){return typeof O=="boolean"||typeof O=="number"||O===null?!O:(0,e._)`!${A(O)}`}t.not=Z;const W=j(t.operators.AND);function J(...O){return O.reduce(W)}t.and=J;const se=j(t.operators.OR);function q(...O){return O.reduce(se)}t.or=q;function j(O){return(l,k)=>l===e.nil?k:k===e.nil?l:(0,e._)`${A(l)} ${O} ${A(k)}`}function A(O){return O instanceof e.Name?O:(0,e._)`(${O})`}}(qr)),qr}var ie={},yn;function le(){if(yn)return ie;yn=1,Object.defineProperty(ie,"__esModule",{value:!0}),ie.checkStrictMode=ie.getErrorPath=ie.Type=ie.useFunc=ie.setEvaluated=ie.evaluatedPropsToName=ie.mergeEvaluated=ie.eachItem=ie.unescapeJsonPointer=ie.escapeJsonPointer=ie.escapeFragment=ie.unescapeFragment=ie.schemaRefOrVal=ie.schemaHasRulesButRef=ie.schemaHasRules=ie.checkUnknownRules=ie.alwaysValidSchema=ie.toHash=void 0;const t=oe(),e=kr();function r(_){const g={};for(const E of _)g[E]=!0;return g}ie.toHash=r;function n(_,g){return typeof g=="boolean"?g:Object.keys(g).length===0?!0:(a(_,g),!s(g,_.self.RULES.all))}ie.alwaysValidSchema=n;function a(_,g=_.schema){const{opts:E,self:I}=_;if(!E.strictSchema||typeof g=="boolean")return;const M=I.RULES.keywords;for(const F in g)M[F]||v(_,`unknown keyword: "${F}"`)}ie.checkUnknownRules=a;function s(_,g){if(typeof _=="boolean")return!_;for(const E in _)if(g[E])return!0;return!1}ie.schemaHasRules=s;function c(_,g){if(typeof _=="boolean")return!_;for(const E in _)if(E!=="$ref"&&g.all[E])return!0;return!1}ie.schemaHasRulesButRef=c;function o({topSchemaRef:_,schemaPath:g},E,I,M){if(!M){if(typeof E=="number"||typeof E=="boolean")return E;if(typeof E=="string")return(0,t._)`${E}`}return(0,t._)`${_}${g}${(0,t.getProperty)(I)}`}ie.schemaRefOrVal=o;function u(_){return b(decodeURIComponent(_))}ie.unescapeFragment=u;function p(_){return encodeURIComponent(m(_))}ie.escapeFragment=p;function m(_){return typeof _=="number"?`${_}`:_.replace(/~/g,"~0").replace(/\//g,"~1")}ie.escapeJsonPointer=m;function b(_){return _.replace(/~1/g,"/").replace(/~0/g,"~")}ie.unescapeJsonPointer=b;function w(_,g){if(Array.isArray(_))for(const E of _)g(E);else g(_)}ie.eachItem=w;function $({mergeNames:_,mergeToName:g,mergeValues:E,resultToName:I}){return(M,F,K,ee)=>{const Y=K===void 0?F:K instanceof t.Name?(F instanceof t.Name?_(M,F,K):g(M,F,K),K):F instanceof t.Name?(g(M,K,F),F):E(F,K);return ee===t.Name&&!(Y instanceof t.Name)?I(M,Y):Y}}ie.mergeEvaluated={props:$({mergeNames:(_,g,E)=>_.if((0,t._)`${E} !== true && ${g} !== undefined`,()=>{_.if((0,t._)`${g} === true`,()=>_.assign(E,!0),()=>_.assign(E,(0,t._)`${E} || {}`).code((0,t._)`Object.assign(${E}, ${g})`))}),mergeToName:(_,g,E)=>_.if((0,t._)`${E} !== true`,()=>{g===!0?_.assign(E,!0):(_.assign(E,(0,t._)`${E} || {}`),y(_,E,g))}),mergeValues:(_,g)=>_===!0?!0:{..._,...g},resultToName:S}),items:$({mergeNames:(_,g,E)=>_.if((0,t._)`${E} !== true && ${g} !== undefined`,()=>_.assign(E,(0,t._)`${g} === true ? true : ${E} > ${g} ? ${E} : ${g}`)),mergeToName:(_,g,E)=>_.if((0,t._)`${E} !== true`,()=>_.assign(E,g===!0?!0:(0,t._)`${E} > ${g} ? ${E} : ${g}`)),mergeValues:(_,g)=>_===!0?!0:Math.max(_,g),resultToName:(_,g)=>_.var("items",g)})};function S(_,g){if(g===!0)return _.var("props",!0);const E=_.var("props",(0,t._)`{}`);return g!==void 0&&y(_,E,g),E}ie.evaluatedPropsToName=S;function y(_,g,E){Object.keys(E).forEach(I=>_.assign((0,t._)`${g}${(0,t.getProperty)(I)}`,!0))}ie.setEvaluated=y;const f={};function d(_,g){return _.scopeValue("func",{ref:g,code:f[g.code]||(f[g.code]=new e._Code(g.code))})}ie.useFunc=d;var i;(function(_){_[_.Num=0]="Num",_[_.Str=1]="Str"})(i||(ie.Type=i={}));function h(_,g,E){if(_ instanceof t.Name){const I=g===i.Num;return E?I?(0,t._)`"[" + ${_} + "]"`:(0,t._)`"['" + ${_} + "']"`:I?(0,t._)`"/" + ${_}`:(0,t._)`"/" + ${_}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return E?(0,t.getProperty)(_).toString():"/"+m(_)}ie.getErrorPath=h;function v(_,g,E=_.opts.strictSchema){if(E){if(g=`strict mode: ${g}`,E===!0)throw new Error(g);_.self.logger.warn(g)}}return ie.checkStrictMode=v,ie}var Rt={},vn;function Ke(){if(vn)return Rt;vn=1,Object.defineProperty(Rt,"__esModule",{value:!0});const t=oe(),e={data:new t.Name("data"),valCxt:new t.Name("valCxt"),instancePath:new t.Name("instancePath"),parentData:new t.Name("parentData"),parentDataProperty:new t.Name("parentDataProperty"),rootData:new t.Name("rootData"),dynamicAnchors:new t.Name("dynamicAnchors"),vErrors:new t.Name("vErrors"),errors:new t.Name("errors"),this:new t.Name("this"),self:new t.Name("self"),scope:new t.Name("scope"),json:new t.Name("json"),jsonPos:new t.Name("jsonPos"),jsonLen:new t.Name("jsonLen"),jsonPart:new t.Name("jsonPart")};return Rt.default=e,Rt}var gn;function jr(){return gn||(gn=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;const e=oe(),r=le(),n=Ke();t.keywordError={message:({keyword:f})=>(0,e.str)`must pass "${f}" keyword validation`},t.keyword$DataError={message:({keyword:f,schemaType:d})=>d?(0,e.str)`"${f}" keyword must be ${d} ($data)`:(0,e.str)`"${f}" keyword is invalid ($data)`};function a(f,d=t.keywordError,i,h){const{it:v}=f,{gen:_,compositeRule:g,allErrors:E}=v,I=b(f,d,i);h??(g||E)?u(_,I):p(v,(0,e._)`[${I}]`)}t.reportError=a;function s(f,d=t.keywordError,i){const{it:h}=f,{gen:v,compositeRule:_,allErrors:g}=h,E=b(f,d,i);u(v,E),_||g||p(h,n.default.vErrors)}t.reportExtraError=s;function c(f,d){f.assign(n.default.errors,d),f.if((0,e._)`${n.default.vErrors} !== null`,()=>f.if(d,()=>f.assign((0,e._)`${n.default.vErrors}.length`,d),()=>f.assign(n.default.vErrors,null)))}t.resetErrorsCount=c;function o({gen:f,keyword:d,schemaValue:i,data:h,errsCount:v,it:_}){if(v===void 0)throw new Error("ajv implementation error");const g=f.name("err");f.forRange("i",v,n.default.errors,E=>{f.const(g,(0,e._)`${n.default.vErrors}[${E}]`),f.if((0,e._)`${g}.instancePath === undefined`,()=>f.assign((0,e._)`${g}.instancePath`,(0,e.strConcat)(n.default.instancePath,_.errorPath))),f.assign((0,e._)`${g}.schemaPath`,(0,e.str)`${_.errSchemaPath}/${d}`),_.opts.verbose&&(f.assign((0,e._)`${g}.schema`,i),f.assign((0,e._)`${g}.data`,h))})}t.extendErrors=o;function u(f,d){const i=f.const("err",d);f.if((0,e._)`${n.default.vErrors} === null`,()=>f.assign(n.default.vErrors,(0,e._)`[${i}]`),(0,e._)`${n.default.vErrors}.push(${i})`),f.code((0,e._)`${n.default.errors}++`)}function p(f,d){const{gen:i,validateName:h,schemaEnv:v}=f;v.$async?i.throw((0,e._)`new ${f.ValidationError}(${d})`):(i.assign((0,e._)`${h}.errors`,d),i.return(!1))}const m={keyword:new e.Name("keyword"),schemaPath:new e.Name("schemaPath"),params:new e.Name("params"),propertyName:new e.Name("propertyName"),message:new e.Name("message"),schema:new e.Name("schema"),parentSchema:new e.Name("parentSchema")};function b(f,d,i){const{createErrors:h}=f.it;return h===!1?(0,e._)`{}`:w(f,d,i)}function w(f,d,i={}){const{gen:h,it:v}=f,_=[$(v,i),S(f,i)];return y(f,d,_),h.object(..._)}function $({errorPath:f},{instancePath:d}){const i=d?(0,e.str)`${f}${(0,r.getErrorPath)(d,r.Type.Str)}`:f;return[n.default.instancePath,(0,e.strConcat)(n.default.instancePath,i)]}function S({keyword:f,it:{errSchemaPath:d}},{schemaPath:i,parentSchema:h}){let v=h?d:(0,e.str)`${d}/${f}`;return i&&(v=(0,e.str)`${v}${(0,r.getErrorPath)(i,r.Type.Str)}`),[m.schemaPath,v]}function y(f,{params:d,message:i},h){const{keyword:v,data:_,schemaValue:g,it:E}=f,{opts:I,propertyName:M,topSchemaRef:F,schemaPath:K}=E;h.push([m.keyword,v],[m.params,typeof d=="function"?d(f):d||(0,e._)`{}`]),I.messages&&h.push([m.message,typeof i=="function"?i(f):i]),I.verbose&&h.push([m.schema,g],[m.parentSchema,(0,e._)`${F}${K}`],[n.default.data,_]),M&&h.push([m.propertyName,M])}}(Mr)),Mr}var _n;function Ni(){if(_n)return He;_n=1,Object.defineProperty(He,"__esModule",{value:!0}),He.boolOrEmptySchema=He.topBoolOrEmptySchema=void 0;const t=jr(),e=oe(),r=Ke(),n={message:"boolean schema is false"};function a(o){const{gen:u,schema:p,validateName:m}=o;p===!1?c(o,!1):typeof p=="object"&&p.$async===!0?u.return(r.default.data):(u.assign((0,e._)`${m}.errors`,null),u.return(!0))}He.topBoolOrEmptySchema=a;function s(o,u){const{gen:p,schema:m}=o;m===!1?(p.var(u,!1),c(o)):p.var(u,!0)}He.boolOrEmptySchema=s;function c(o,u){const{gen:p,data:m}=o,b={gen:p,keyword:"false schema",data:m,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:o};(0,t.reportError)(b,n,void 0,u)}return He}var ye={},Be={},bn;function Gs(){if(bn)return Be;bn=1,Object.defineProperty(Be,"__esModule",{value:!0}),Be.getRules=Be.isJSONType=void 0;const t=["string","number","integer","boolean","null","object","array"],e=new Set(t);function r(a){return typeof a=="string"&&e.has(a)}Be.isJSONType=r;function n(){const a={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...a,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},a.number,a.string,a.array,a.object],post:{rules:[]},all:{},keywords:{}}}return Be.getRules=n,Be}var xe={},$n;function Js(){if($n)return xe;$n=1,Object.defineProperty(xe,"__esModule",{value:!0}),xe.shouldUseRule=xe.shouldUseGroup=xe.schemaHasRulesForType=void 0;function t({schema:n,self:a},s){const c=a.RULES.types[s];return c&&c!==!0&&e(n,c)}xe.schemaHasRulesForType=t;function e(n,a){return a.rules.some(s=>r(n,s))}xe.shouldUseGroup=e;function r(n,a){var s;return n[a.keyword]!==void 0||((s=a.definition.implements)===null||s===void 0?void 0:s.some(c=>n[c]!==void 0))}return xe.shouldUseRule=r,xe}var wn;function Er(){if(wn)return ye;wn=1,Object.defineProperty(ye,"__esModule",{value:!0}),ye.reportTypeError=ye.checkDataTypes=ye.checkDataType=ye.coerceAndCheckDataType=ye.getJSONTypes=ye.getSchemaTypes=ye.DataType=void 0;const t=Gs(),e=Js(),r=jr(),n=oe(),a=le();var s;(function(i){i[i.Correct=0]="Correct",i[i.Wrong=1]="Wrong"})(s||(ye.DataType=s={}));function c(i){const h=o(i.type);if(h.includes("null")){if(i.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!h.length&&i.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');i.nullable===!0&&h.push("null")}return h}ye.getSchemaTypes=c;function o(i){const h=Array.isArray(i)?i:i?[i]:[];if(h.every(t.isJSONType))return h;throw new Error("type must be JSONType or JSONType[]: "+h.join(","))}ye.getJSONTypes=o;function u(i,h){const{gen:v,data:_,opts:g}=i,E=m(h,g.coerceTypes),I=h.length>0&&!(E.length===0&&h.length===1&&(0,e.schemaHasRulesForType)(i,h[0]));if(I){const M=S(h,_,g.strictNumbers,s.Wrong);v.if(M,()=>{E.length?b(i,h,E):f(i)})}return I}ye.coerceAndCheckDataType=u;const p=new Set(["string","number","integer","boolean","null"]);function m(i,h){return h?i.filter(v=>p.has(v)||h==="array"&&v==="array"):[]}function b(i,h,v){const{gen:_,data:g,opts:E}=i,I=_.let("dataType",(0,n._)`typeof ${g}`),M=_.let("coerced",(0,n._)`undefined`);E.coerceTypes==="array"&&_.if((0,n._)`${I} == 'object' && Array.isArray(${g}) && ${g}.length == 1`,()=>_.assign(g,(0,n._)`${g}[0]`).assign(I,(0,n._)`typeof ${g}`).if(S(h,g,E.strictNumbers),()=>_.assign(M,g))),_.if((0,n._)`${M} !== undefined`);for(const K of v)(p.has(K)||K==="array"&&E.coerceTypes==="array")&&F(K);_.else(),f(i),_.endIf(),_.if((0,n._)`${M} !== undefined`,()=>{_.assign(g,M),w(i,M)});function F(K){switch(K){case"string":_.elseIf((0,n._)`${I} == "number" || ${I} == "boolean"`).assign(M,(0,n._)`"" + ${g}`).elseIf((0,n._)`${g} === null`).assign(M,(0,n._)`""`);return;case"number":_.elseIf((0,n._)`${I} == "boolean" || ${g} === null
3
+ || (${I} == "string" && ${g} && ${g} == +${g})`).assign(M,(0,n._)`+${g}`);return;case"integer":_.elseIf((0,n._)`${I} === "boolean" || ${g} === null
4
+ || (${I} === "string" && ${g} && ${g} == +${g} && !(${g} % 1))`).assign(M,(0,n._)`+${g}`);return;case"boolean":_.elseIf((0,n._)`${g} === "false" || ${g} === 0 || ${g} === null`).assign(M,!1).elseIf((0,n._)`${g} === "true" || ${g} === 1`).assign(M,!0);return;case"null":_.elseIf((0,n._)`${g} === "" || ${g} === 0 || ${g} === false`),_.assign(M,null);return;case"array":_.elseIf((0,n._)`${I} === "string" || ${I} === "number"
5
+ || ${I} === "boolean" || ${g} === null`).assign(M,(0,n._)`[${g}]`)}}}function w({gen:i,parentData:h,parentDataProperty:v},_){i.if((0,n._)`${h} !== undefined`,()=>i.assign((0,n._)`${h}[${v}]`,_))}function $(i,h,v,_=s.Correct){const g=_===s.Correct?n.operators.EQ:n.operators.NEQ;let E;switch(i){case"null":return(0,n._)`${h} ${g} null`;case"array":E=(0,n._)`Array.isArray(${h})`;break;case"object":E=(0,n._)`${h} && typeof ${h} == "object" && !Array.isArray(${h})`;break;case"integer":E=I((0,n._)`!(${h} % 1) && !isNaN(${h})`);break;case"number":E=I();break;default:return(0,n._)`typeof ${h} ${g} ${i}`}return _===s.Correct?E:(0,n.not)(E);function I(M=n.nil){return(0,n.and)((0,n._)`typeof ${h} == "number"`,M,v?(0,n._)`isFinite(${h})`:n.nil)}}ye.checkDataType=$;function S(i,h,v,_){if(i.length===1)return $(i[0],h,v,_);let g;const E=(0,a.toHash)(i);if(E.array&&E.object){const I=(0,n._)`typeof ${h} != "object"`;g=E.null?I:(0,n._)`!${h} || ${I}`,delete E.null,delete E.array,delete E.object}else g=n.nil;E.number&&delete E.integer;for(const I in E)g=(0,n.and)(g,$(I,h,v,_));return g}ye.checkDataTypes=S;const y={message:({schema:i})=>`must be ${i}`,params:({schema:i,schemaValue:h})=>typeof i=="string"?(0,n._)`{type: ${i}}`:(0,n._)`{type: ${h}}`};function f(i){const h=d(i);(0,r.reportError)(h,y)}ye.reportTypeError=f;function d(i){const{gen:h,data:v,schema:_}=i,g=(0,a.schemaRefOrVal)(i,_,"type");return{gen:h,keyword:"type",data:v,schema:_.type,schemaCode:g,schemaValue:g,parentSchema:_,params:{},it:i}}return ye}var lt={},kn;function Ii(){if(kn)return lt;kn=1,Object.defineProperty(lt,"__esModule",{value:!0}),lt.assignDefaults=void 0;const t=oe(),e=le();function r(a,s){const{properties:c,items:o}=a.schema;if(s==="object"&&c)for(const u in c)n(a,u,c[u].default);else s==="array"&&Array.isArray(o)&&o.forEach((u,p)=>n(a,p,u.default))}lt.assignDefaults=r;function n(a,s,c){const{gen:o,compositeRule:u,data:p,opts:m}=a;if(c===void 0)return;const b=(0,t._)`${p}${(0,t.getProperty)(s)}`;if(u){(0,e.checkStrictMode)(a,`default is ignored for: ${b}`);return}let w=(0,t._)`${b} === undefined`;m.useDefaults==="empty"&&(w=(0,t._)`${w} || ${b} === null || ${b} === ""`),o.if(w,(0,t._)`${b} = ${(0,t.stringify)(c)}`)}return lt}var Pe={},fe={},En;function Ne(){if(En)return fe;En=1,Object.defineProperty(fe,"__esModule",{value:!0}),fe.validateUnion=fe.validateArray=fe.usePattern=fe.callValidateCode=fe.schemaProperties=fe.allSchemaProperties=fe.noPropertyInData=fe.propertyInData=fe.isOwnProperty=fe.hasPropFunc=fe.reportMissingProp=fe.checkMissingProp=fe.checkReportMissingProp=void 0;const t=oe(),e=le(),r=Ke(),n=le();function a(i,h){const{gen:v,data:_,it:g}=i;v.if(m(v,_,h,g.opts.ownProperties),()=>{i.setParams({missingProperty:(0,t._)`${h}`},!0),i.error()})}fe.checkReportMissingProp=a;function s({gen:i,data:h,it:{opts:v}},_,g){return(0,t.or)(..._.map(E=>(0,t.and)(m(i,h,E,v.ownProperties),(0,t._)`${g} = ${E}`)))}fe.checkMissingProp=s;function c(i,h){i.setParams({missingProperty:h},!0),i.error()}fe.reportMissingProp=c;function o(i){return i.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,t._)`Object.prototype.hasOwnProperty`})}fe.hasPropFunc=o;function u(i,h,v){return(0,t._)`${o(i)}.call(${h}, ${v})`}fe.isOwnProperty=u;function p(i,h,v,_){const g=(0,t._)`${h}${(0,t.getProperty)(v)} !== undefined`;return _?(0,t._)`${g} && ${u(i,h,v)}`:g}fe.propertyInData=p;function m(i,h,v,_){const g=(0,t._)`${h}${(0,t.getProperty)(v)} === undefined`;return _?(0,t.or)(g,(0,t.not)(u(i,h,v))):g}fe.noPropertyInData=m;function b(i){return i?Object.keys(i).filter(h=>h!=="__proto__"):[]}fe.allSchemaProperties=b;function w(i,h){return b(h).filter(v=>!(0,e.alwaysValidSchema)(i,h[v]))}fe.schemaProperties=w;function $({schemaCode:i,data:h,it:{gen:v,topSchemaRef:_,schemaPath:g,errorPath:E},it:I},M,F,K){const ee=K?(0,t._)`${i}, ${h}, ${_}${g}`:h,Y=[[r.default.instancePath,(0,t.strConcat)(r.default.instancePath,E)],[r.default.parentData,I.parentData],[r.default.parentDataProperty,I.parentDataProperty],[r.default.rootData,r.default.rootData]];I.opts.dynamicRef&&Y.push([r.default.dynamicAnchors,r.default.dynamicAnchors]);const ce=(0,t._)`${ee}, ${v.object(...Y)}`;return F!==t.nil?(0,t._)`${M}.call(${F}, ${ce})`:(0,t._)`${M}(${ce})`}fe.callValidateCode=$;const S=(0,t._)`new RegExp`;function y({gen:i,it:{opts:h}},v){const _=h.unicodeRegExp?"u":"",{regExp:g}=h.code,E=g(v,_);return i.scopeValue("pattern",{key:E.toString(),ref:E,code:(0,t._)`${g.code==="new RegExp"?S:(0,n.useFunc)(i,g)}(${v}, ${_})`})}fe.usePattern=y;function f(i){const{gen:h,data:v,keyword:_,it:g}=i,E=h.name("valid");if(g.allErrors){const M=h.let("valid",!0);return I(()=>h.assign(M,!1)),M}return h.var(E,!0),I(()=>h.break()),E;function I(M){const F=h.const("len",(0,t._)`${v}.length`);h.forRange("i",0,F,K=>{i.subschema({keyword:_,dataProp:K,dataPropType:e.Type.Num},E),h.if((0,t.not)(E),M)})}}fe.validateArray=f;function d(i){const{gen:h,schema:v,keyword:_,it:g}=i;if(!Array.isArray(v))throw new Error("ajv implementation error");if(v.some(F=>(0,e.alwaysValidSchema)(g,F))&&!g.opts.unevaluated)return;const I=h.let("valid",!1),M=h.name("_valid");h.block(()=>v.forEach((F,K)=>{const ee=i.subschema({keyword:_,schemaProp:K,compositeRule:!0},M);h.assign(I,(0,t._)`${I} || ${M}`),i.mergeValidEvaluated(ee,M)||h.if((0,t.not)(I))})),i.result(I,()=>i.reset(),()=>i.error(!0))}return fe.validateUnion=d,fe}var Sn;function Ri(){if(Sn)return Pe;Sn=1,Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.validateKeywordUsage=Pe.validSchemaType=Pe.funcKeywordCode=Pe.macroKeywordCode=void 0;const t=oe(),e=Ke(),r=Ne(),n=jr();function a(w,$){const{gen:S,keyword:y,schema:f,parentSchema:d,it:i}=w,h=$.macro.call(i.self,f,d,i),v=p(S,y,h);i.opts.validateSchema!==!1&&i.self.validateSchema(h,!0);const _=S.name("valid");w.subschema({schema:h,schemaPath:t.nil,errSchemaPath:`${i.errSchemaPath}/${y}`,topSchemaRef:v,compositeRule:!0},_),w.pass(_,()=>w.error(!0))}Pe.macroKeywordCode=a;function s(w,$){var S;const{gen:y,keyword:f,schema:d,parentSchema:i,$data:h,it:v}=w;u(v,$);const _=!h&&$.compile?$.compile.call(v.self,d,i,v):$.validate,g=p(y,f,_),E=y.let("valid");w.block$data(E,I),w.ok((S=$.valid)!==null&&S!==void 0?S:E);function I(){if($.errors===!1)K(),$.modifying&&c(w),ee(()=>w.error());else{const Y=$.async?M():F();$.modifying&&c(w),ee(()=>o(w,Y))}}function M(){const Y=y.let("ruleErrs",null);return y.try(()=>K((0,t._)`await `),ce=>y.assign(E,!1).if((0,t._)`${ce} instanceof ${v.ValidationError}`,()=>y.assign(Y,(0,t._)`${ce}.errors`),()=>y.throw(ce))),Y}function F(){const Y=(0,t._)`${g}.errors`;return y.assign(Y,null),K(t.nil),Y}function K(Y=$.async?(0,t._)`await `:t.nil){const ce=v.opts.passContext?e.default.this:e.default.self,R=!("compile"in $&&!h||$.schema===!1);y.assign(E,(0,t._)`${Y}${(0,r.callValidateCode)(w,g,ce,R)}`,$.modifying)}function ee(Y){var ce;y.if((0,t.not)((ce=$.valid)!==null&&ce!==void 0?ce:E),Y)}}Pe.funcKeywordCode=s;function c(w){const{gen:$,data:S,it:y}=w;$.if(y.parentData,()=>$.assign(S,(0,t._)`${y.parentData}[${y.parentDataProperty}]`))}function o(w,$){const{gen:S}=w;S.if((0,t._)`Array.isArray(${$})`,()=>{S.assign(e.default.vErrors,(0,t._)`${e.default.vErrors} === null ? ${$} : ${e.default.vErrors}.concat(${$})`).assign(e.default.errors,(0,t._)`${e.default.vErrors}.length`),(0,n.extendErrors)(w)},()=>w.error())}function u({schemaEnv:w},$){if($.async&&!w.$async)throw new Error("async keyword in sync schema")}function p(w,$,S){if(S===void 0)throw new Error(`keyword "${$}" failed to compile`);return w.scopeValue("keyword",typeof S=="function"?{ref:S}:{ref:S,code:(0,t.stringify)(S)})}function m(w,$,S=!1){return!$.length||$.some(y=>y==="array"?Array.isArray(w):y==="object"?w&&typeof w=="object"&&!Array.isArray(w):typeof w==y||S&&typeof w>"u")}Pe.validSchemaType=m;function b({schema:w,opts:$,self:S,errSchemaPath:y},f,d){if(Array.isArray(f.keyword)?!f.keyword.includes(d):f.keyword!==d)throw new Error("ajv implementation error");const i=f.dependencies;if(i?.some(h=>!Object.prototype.hasOwnProperty.call(w,h)))throw new Error(`parent schema must have dependencies of ${d}: ${i.join(",")}`);if(f.validateSchema&&!f.validateSchema(w[d])){const v=`keyword "${d}" value is invalid at path "${y}": `+S.errorsText(f.validateSchema.errors);if($.validateSchema==="log")S.logger.error(v);else throw new Error(v)}}return Pe.validateKeywordUsage=b,Pe}var Me={},Pn;function Ci(){if(Pn)return Me;Pn=1,Object.defineProperty(Me,"__esModule",{value:!0}),Me.extendSubschemaMode=Me.extendSubschemaData=Me.getSubschema=void 0;const t=oe(),e=le();function r(s,{keyword:c,schemaProp:o,schema:u,schemaPath:p,errSchemaPath:m,topSchemaRef:b}){if(c!==void 0&&u!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(c!==void 0){const w=s.schema[c];return o===void 0?{schema:w,schemaPath:(0,t._)`${s.schemaPath}${(0,t.getProperty)(c)}`,errSchemaPath:`${s.errSchemaPath}/${c}`}:{schema:w[o],schemaPath:(0,t._)`${s.schemaPath}${(0,t.getProperty)(c)}${(0,t.getProperty)(o)}`,errSchemaPath:`${s.errSchemaPath}/${c}/${(0,e.escapeFragment)(o)}`}}if(u!==void 0){if(p===void 0||m===void 0||b===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:u,schemaPath:p,topSchemaRef:b,errSchemaPath:m}}throw new Error('either "keyword" or "schema" must be passed')}Me.getSubschema=r;function n(s,c,{dataProp:o,dataPropType:u,data:p,dataTypes:m,propertyName:b}){if(p!==void 0&&o!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:w}=c;if(o!==void 0){const{errorPath:S,dataPathArr:y,opts:f}=c,d=w.let("data",(0,t._)`${c.data}${(0,t.getProperty)(o)}`,!0);$(d),s.errorPath=(0,t.str)`${S}${(0,e.getErrorPath)(o,u,f.jsPropertySyntax)}`,s.parentDataProperty=(0,t._)`${o}`,s.dataPathArr=[...y,s.parentDataProperty]}if(p!==void 0){const S=p instanceof t.Name?p:w.let("data",p,!0);$(S),b!==void 0&&(s.propertyName=b)}m&&(s.dataTypes=m);function $(S){s.data=S,s.dataLevel=c.dataLevel+1,s.dataTypes=[],c.definedProperties=new Set,s.parentData=c.data,s.dataNames=[...c.dataNames,S]}}Me.extendSubschemaData=n;function a(s,{jtdDiscriminator:c,jtdMetadata:o,compositeRule:u,createErrors:p,allErrors:m}){u!==void 0&&(s.compositeRule=u),p!==void 0&&(s.createErrors=p),m!==void 0&&(s.allErrors=m),s.jtdDiscriminator=c,s.jtdMetadata=o}return Me.extendSubschemaMode=a,Me}var _e={},zr,jn;function Ws(){return jn||(jn=1,zr=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,a,s;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(a=n;a--!==0;)if(!t(e[a],r[a]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(s=Object.keys(e),n=s.length,n!==Object.keys(r).length)return!1;for(a=n;a--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[a]))return!1;for(a=n;a--!==0;){var c=s[a];if(!t(e[c],r[c]))return!1}return!0}return e!==e&&r!==r}),zr}var Zr={exports:{}},On;function Ai(){if(On)return Zr.exports;On=1;var t=Zr.exports=function(n,a,s){typeof a=="function"&&(s=a,a={}),s=a.cb||s;var c=typeof s=="function"?s:s.pre||function(){},o=s.post||function(){};e(a,c,o,n,"",n)};t.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},t.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},t.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},t.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function e(n,a,s,c,o,u,p,m,b,w){if(c&&typeof c=="object"&&!Array.isArray(c)){a(c,o,u,p,m,b,w);for(var $ in c){var S=c[$];if(Array.isArray(S)){if($ in t.arrayKeywords)for(var y=0;y<S.length;y++)e(n,a,s,S[y],o+"/"+$+"/"+y,u,o,$,c,y)}else if($ in t.propsKeywords){if(S&&typeof S=="object")for(var f in S)e(n,a,s,S[f],o+"/"+$+"/"+r(f),u,o,$,c,f)}else($ in t.keywords||n.allKeys&&!($ in t.skipKeywords))&&e(n,a,s,S,o+"/"+$,u,o,$,c)}s(c,o,u,p,m,b,w)}}function r(n){return n.replace(/~/g,"~0").replace(/\//g,"~1")}return Zr.exports}var Tn;function Or(){if(Tn)return _e;Tn=1,Object.defineProperty(_e,"__esModule",{value:!0}),_e.getSchemaRefs=_e.resolveUrl=_e.normalizeId=_e._getFullPath=_e.getFullPath=_e.inlineRef=void 0;const t=le(),e=Ws(),r=Ai(),n=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function a(y,f=!0){return typeof y=="boolean"?!0:f===!0?!c(y):f?o(y)<=f:!1}_e.inlineRef=a;const s=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function c(y){for(const f in y){if(s.has(f))return!0;const d=y[f];if(Array.isArray(d)&&d.some(c)||typeof d=="object"&&c(d))return!0}return!1}function o(y){let f=0;for(const d in y){if(d==="$ref")return 1/0;if(f++,!n.has(d)&&(typeof y[d]=="object"&&(0,t.eachItem)(y[d],i=>f+=o(i)),f===1/0))return 1/0}return f}function u(y,f="",d){d!==!1&&(f=b(f));const i=y.parse(f);return p(y,i)}_e.getFullPath=u;function p(y,f){return y.serialize(f).split("#")[0]+"#"}_e._getFullPath=p;const m=/#\/?$/;function b(y){return y?y.replace(m,""):""}_e.normalizeId=b;function w(y,f,d){return d=b(d),y.resolve(f,d)}_e.resolveUrl=w;const $=/^[a-z_][-a-z0-9._]*$/i;function S(y,f){if(typeof y=="boolean")return{};const{schemaId:d,uriResolver:i}=this.opts,h=b(y[d]||f),v={"":h},_=u(i,h,!1),g={},E=new Set;return r(y,{allKeys:!0},(F,K,ee,Y)=>{if(Y===void 0)return;const ce=_+K;let R=v[Y];typeof F[d]=="string"&&(R=Z.call(this,F[d])),W.call(this,F.$anchor),W.call(this,F.$dynamicAnchor),v[K]=R;function Z(J){const se=this.opts.uriResolver.resolve;if(J=b(R?se(R,J):J),E.has(J))throw M(J);E.add(J);let q=this.refs[J];return typeof q=="string"&&(q=this.refs[q]),typeof q=="object"?I(F,q.schema,J):J!==b(ce)&&(J[0]==="#"?(I(F,g[J],J),g[J]=F):this.refs[J]=ce),J}function W(J){if(typeof J=="string"){if(!$.test(J))throw new Error(`invalid anchor "${J}"`);Z.call(this,`#${J}`)}}}),g;function I(F,K,ee){if(K!==void 0&&!e(F,K))throw M(ee)}function M(F){return new Error(`reference "${F}" resolves to more than one schema`)}}return _e.getSchemaRefs=S,_e}var Nn;function Tr(){if(Nn)return Ae;Nn=1,Object.defineProperty(Ae,"__esModule",{value:!0}),Ae.getData=Ae.KeywordCxt=Ae.validateFunctionCode=void 0;const t=Ni(),e=Er(),r=Js(),n=Er(),a=Ii(),s=Ri(),c=Ci(),o=oe(),u=Ke(),p=Or(),m=le(),b=jr();function w(P){if(_(P)&&(E(P),v(P))){f(P);return}$(P,()=>(0,t.topBoolOrEmptySchema)(P))}Ae.validateFunctionCode=w;function $({gen:P,validateName:T,schema:x,schemaEnv:V,opts:B},ne){B.code.es5?P.func(T,(0,o._)`${u.default.data}, ${u.default.valCxt}`,V.$async,()=>{P.code((0,o._)`"use strict"; ${i(x,B)}`),y(P,B),P.code(ne)}):P.func(T,(0,o._)`${u.default.data}, ${S(B)}`,V.$async,()=>P.code(i(x,B)).code(ne))}function S(P){return(0,o._)`{${u.default.instancePath}="", ${u.default.parentData}, ${u.default.parentDataProperty}, ${u.default.rootData}=${u.default.data}${P.dynamicRef?(0,o._)`, ${u.default.dynamicAnchors}={}`:o.nil}}={}`}function y(P,T){P.if(u.default.valCxt,()=>{P.var(u.default.instancePath,(0,o._)`${u.default.valCxt}.${u.default.instancePath}`),P.var(u.default.parentData,(0,o._)`${u.default.valCxt}.${u.default.parentData}`),P.var(u.default.parentDataProperty,(0,o._)`${u.default.valCxt}.${u.default.parentDataProperty}`),P.var(u.default.rootData,(0,o._)`${u.default.valCxt}.${u.default.rootData}`),T.dynamicRef&&P.var(u.default.dynamicAnchors,(0,o._)`${u.default.valCxt}.${u.default.dynamicAnchors}`)},()=>{P.var(u.default.instancePath,(0,o._)`""`),P.var(u.default.parentData,(0,o._)`undefined`),P.var(u.default.parentDataProperty,(0,o._)`undefined`),P.var(u.default.rootData,u.default.data),T.dynamicRef&&P.var(u.default.dynamicAnchors,(0,o._)`{}`)})}function f(P){const{schema:T,opts:x,gen:V}=P;$(P,()=>{x.$comment&&T.$comment&&Y(P),F(P),V.let(u.default.vErrors,null),V.let(u.default.errors,0),x.unevaluated&&d(P),I(P),ce(P)})}function d(P){const{gen:T,validateName:x}=P;P.evaluated=T.const("evaluated",(0,o._)`${x}.evaluated`),T.if((0,o._)`${P.evaluated}.dynamicProps`,()=>T.assign((0,o._)`${P.evaluated}.props`,(0,o._)`undefined`)),T.if((0,o._)`${P.evaluated}.dynamicItems`,()=>T.assign((0,o._)`${P.evaluated}.items`,(0,o._)`undefined`))}function i(P,T){const x=typeof P=="object"&&P[T.schemaId];return x&&(T.code.source||T.code.process)?(0,o._)`/*# sourceURL=${x} */`:o.nil}function h(P,T){if(_(P)&&(E(P),v(P))){g(P,T);return}(0,t.boolOrEmptySchema)(P,T)}function v({schema:P,self:T}){if(typeof P=="boolean")return!P;for(const x in P)if(T.RULES.all[x])return!0;return!1}function _(P){return typeof P.schema!="boolean"}function g(P,T){const{schema:x,gen:V,opts:B}=P;B.$comment&&x.$comment&&Y(P),K(P),ee(P);const ne=V.const("_errs",u.default.errors);I(P,ne),V.var(T,(0,o._)`${ne} === ${u.default.errors}`)}function E(P){(0,m.checkUnknownRules)(P),M(P)}function I(P,T){if(P.opts.jtd)return Z(P,[],!1,T);const x=(0,e.getSchemaTypes)(P.schema),V=(0,e.coerceAndCheckDataType)(P,x);Z(P,x,!V,T)}function M(P){const{schema:T,errSchemaPath:x,opts:V,self:B}=P;T.$ref&&V.ignoreKeywordsWithRef&&(0,m.schemaHasRulesButRef)(T,B.RULES)&&B.logger.warn(`$ref: keywords ignored in schema at path "${x}"`)}function F(P){const{schema:T,opts:x}=P;T.default!==void 0&&x.useDefaults&&x.strictSchema&&(0,m.checkStrictMode)(P,"default is ignored in the schema root")}function K(P){const T=P.schema[P.opts.schemaId];T&&(P.baseId=(0,p.resolveUrl)(P.opts.uriResolver,P.baseId,T))}function ee(P){if(P.schema.$async&&!P.schemaEnv.$async)throw new Error("async schema in sync schema")}function Y({gen:P,schemaEnv:T,schema:x,errSchemaPath:V,opts:B}){const ne=x.$comment;if(B.$comment===!0)P.code((0,o._)`${u.default.self}.logger.log(${ne})`);else if(typeof B.$comment=="function"){const he=(0,o.str)`${V}/$comment`,ve=P.scopeValue("root",{ref:T.root});P.code((0,o._)`${u.default.self}.opts.$comment(${ne}, ${he}, ${ve}.schema)`)}}function ce(P){const{gen:T,schemaEnv:x,validateName:V,ValidationError:B,opts:ne}=P;x.$async?T.if((0,o._)`${u.default.errors} === 0`,()=>T.return(u.default.data),()=>T.throw((0,o._)`new ${B}(${u.default.vErrors})`)):(T.assign((0,o._)`${V}.errors`,u.default.vErrors),ne.unevaluated&&R(P),T.return((0,o._)`${u.default.errors} === 0`))}function R({gen:P,evaluated:T,props:x,items:V}){x instanceof o.Name&&P.assign((0,o._)`${T}.props`,x),V instanceof o.Name&&P.assign((0,o._)`${T}.items`,V)}function Z(P,T,x,V){const{gen:B,schema:ne,data:he,allErrors:ve,opts:$e,self:we}=P,{RULES:me}=we;if(ne.$ref&&($e.ignoreKeywordsWithRef||!(0,m.schemaHasRulesButRef)(ne,me))){B.block(()=>U(P,"$ref",me.all.$ref.definition));return}$e.jtd||J(P,T),B.block(()=>{for(const Se of me.rules)et(Se);et(me.post)});function et(Se){(0,r.shouldUseGroup)(ne,Se)&&(Se.type?(B.if((0,n.checkDataType)(Se.type,he,$e.strictNumbers)),W(P,Se),T.length===1&&T[0]===Se.type&&x&&(B.else(),(0,n.reportTypeError)(P)),B.endIf()):W(P,Se),ve||B.if((0,o._)`${u.default.errors} === ${V||0}`))}}function W(P,T){const{gen:x,schema:V,opts:{useDefaults:B}}=P;B&&(0,a.assignDefaults)(P,T.type),x.block(()=>{for(const ne of T.rules)(0,r.shouldUseRule)(V,ne)&&U(P,ne.keyword,ne.definition,T.type)})}function J(P,T){P.schemaEnv.meta||!P.opts.strictTypes||(se(P,T),P.opts.allowUnionTypes||q(P,T),j(P,P.dataTypes))}function se(P,T){if(T.length){if(!P.dataTypes.length){P.dataTypes=T;return}T.forEach(x=>{O(P.dataTypes,x)||k(P,`type "${x}" not allowed by context "${P.dataTypes.join(",")}"`)}),l(P,T)}}function q(P,T){T.length>1&&!(T.length===2&&T.includes("null"))&&k(P,"use allowUnionTypes to allow union type keyword")}function j(P,T){const x=P.self.RULES.all;for(const V in x){const B=x[V];if(typeof B=="object"&&(0,r.shouldUseRule)(P.schema,B)){const{type:ne}=B.definition;ne.length&&!ne.some(he=>A(T,he))&&k(P,`missing type "${ne.join(",")}" for keyword "${V}"`)}}}function A(P,T){return P.includes(T)||T==="number"&&P.includes("integer")}function O(P,T){return P.includes(T)||T==="integer"&&P.includes("number")}function l(P,T){const x=[];for(const V of P.dataTypes)O(T,V)?x.push(V):T.includes("integer")&&V==="number"&&x.push("integer");P.dataTypes=x}function k(P,T){const x=P.schemaEnv.baseId+P.errSchemaPath;T+=` at "${x}" (strictTypes)`,(0,m.checkStrictMode)(P,T,P.opts.strictTypes)}class C{constructor(T,x,V){if((0,s.validateKeywordUsage)(T,x,V),this.gen=T.gen,this.allErrors=T.allErrors,this.keyword=V,this.data=T.data,this.schema=T.schema[V],this.$data=x.$data&&T.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,m.schemaRefOrVal)(T,this.schema,V,this.$data),this.schemaType=x.schemaType,this.parentSchema=T.schema,this.params={},this.it=T,this.def=x,this.$data)this.schemaCode=T.gen.const("vSchema",te(this.$data,T));else if(this.schemaCode=this.schemaValue,!(0,s.validSchemaType)(this.schema,x.schemaType,x.allowUndefined))throw new Error(`${V} value must be ${JSON.stringify(x.schemaType)}`);("code"in x?x.trackErrors:x.errors!==!1)&&(this.errsCount=T.gen.const("_errs",u.default.errors))}result(T,x,V){this.failResult((0,o.not)(T),x,V)}failResult(T,x,V){this.gen.if(T),V?V():this.error(),x?(this.gen.else(),x(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(T,x){this.failResult((0,o.not)(T),void 0,x)}fail(T){if(T===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(T),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(T){if(!this.$data)return this.fail(T);const{schemaCode:x}=this;this.fail((0,o._)`${x} !== undefined && (${(0,o.or)(this.invalid$data(),T)})`)}error(T,x,V){if(x){this.setParams(x),this._error(T,V),this.setParams({});return}this._error(T,V)}_error(T,x){(T?b.reportExtraError:b.reportError)(this,this.def.error,x)}$dataError(){(0,b.reportError)(this,this.def.$dataError||b.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,b.resetErrorsCount)(this.gen,this.errsCount)}ok(T){this.allErrors||this.gen.if(T)}setParams(T,x){x?Object.assign(this.params,T):this.params=T}block$data(T,x,V=o.nil){this.gen.block(()=>{this.check$data(T,V),x()})}check$data(T=o.nil,x=o.nil){if(!this.$data)return;const{gen:V,schemaCode:B,schemaType:ne,def:he}=this;V.if((0,o.or)((0,o._)`${B} === undefined`,x)),T!==o.nil&&V.assign(T,!0),(ne.length||he.validateSchema)&&(V.elseIf(this.invalid$data()),this.$dataError(),T!==o.nil&&V.assign(T,!1)),V.else()}invalid$data(){const{gen:T,schemaCode:x,schemaType:V,def:B,it:ne}=this;return(0,o.or)(he(),ve());function he(){if(V.length){if(!(x instanceof o.Name))throw new Error("ajv implementation error");const $e=Array.isArray(V)?V:[V];return(0,o._)`${(0,n.checkDataTypes)($e,x,ne.opts.strictNumbers,n.DataType.Wrong)}`}return o.nil}function ve(){if(B.validateSchema){const $e=T.scopeValue("validate$data",{ref:B.validateSchema});return(0,o._)`!${$e}(${x})`}return o.nil}}subschema(T,x){const V=(0,c.getSubschema)(this.it,T);(0,c.extendSubschemaData)(V,this.it,T),(0,c.extendSubschemaMode)(V,T);const B={...this.it,...V,items:void 0,props:void 0};return h(B,x),B}mergeEvaluated(T,x){const{it:V,gen:B}=this;V.opts.unevaluated&&(V.props!==!0&&T.props!==void 0&&(V.props=m.mergeEvaluated.props(B,T.props,V.props,x)),V.items!==!0&&T.items!==void 0&&(V.items=m.mergeEvaluated.items(B,T.items,V.items,x)))}mergeValidEvaluated(T,x){const{it:V,gen:B}=this;if(V.opts.unevaluated&&(V.props!==!0||V.items!==!0))return B.if(x,()=>this.mergeEvaluated(T,o.Name)),!0}}Ae.KeywordCxt=C;function U(P,T,x,V){const B=new C(P,x,T);"code"in x?x.code(B,V):B.$data&&x.validate?(0,s.funcKeywordCode)(B,x):"macro"in x?(0,s.macroKeywordCode)(B,x):(x.compile||x.validate)&&(0,s.funcKeywordCode)(B,x)}const H=/^\/(?:[^~]|~0|~1)*$/,ue=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function te(P,{dataLevel:T,dataNames:x,dataPathArr:V}){let B,ne;if(P==="")return u.default.rootData;if(P[0]==="/"){if(!H.test(P))throw new Error(`Invalid JSON-pointer: ${P}`);B=P,ne=u.default.rootData}else{const we=ue.exec(P);if(!we)throw new Error(`Invalid JSON-pointer: ${P}`);const me=+we[1];if(B=we[2],B==="#"){if(me>=T)throw new Error($e("property/index",me));return V[T-me]}if(me>T)throw new Error($e("data",me));if(ne=x[T-me],!B)return ne}let he=ne;const ve=B.split("/");for(const we of ve)we&&(ne=(0,o._)`${ne}${(0,o.getProperty)((0,m.unescapeJsonPointer)(we))}`,he=(0,o._)`${he} && ${ne}`);return he;function $e(we,me){return`Cannot access ${we} ${me} levels up, current level is ${T}`}}return Ae.getData=te,Ae}var Ct={},In;function tn(){if(In)return Ct;In=1,Object.defineProperty(Ct,"__esModule",{value:!0});class t extends Error{constructor(r){super("validation failed"),this.errors=r,this.ajv=this.validation=!0}}return Ct.default=t,Ct}var At={},Rn;function Nr(){if(Rn)return At;Rn=1,Object.defineProperty(At,"__esModule",{value:!0});const t=Or();class e extends Error{constructor(n,a,s,c){super(c||`can't resolve reference ${s} from id ${a}`),this.missingRef=(0,t.resolveUrl)(n,a,s),this.missingSchema=(0,t.normalizeId)((0,t.getFullPath)(n,this.missingRef))}}return At.default=e,At}var ke={},Cn;function rn(){if(Cn)return ke;Cn=1,Object.defineProperty(ke,"__esModule",{value:!0}),ke.resolveSchema=ke.getCompilingSchema=ke.resolveRef=ke.compileSchema=ke.SchemaEnv=void 0;const t=oe(),e=tn(),r=Ke(),n=Or(),a=le(),s=Tr();class c{constructor(d){var i;this.refs={},this.dynamicAnchors={};let h;typeof d.schema=="object"&&(h=d.schema),this.schema=d.schema,this.schemaId=d.schemaId,this.root=d.root||this,this.baseId=(i=d.baseId)!==null&&i!==void 0?i:(0,n.normalizeId)(h?.[d.schemaId||"$id"]),this.schemaPath=d.schemaPath,this.localRefs=d.localRefs,this.meta=d.meta,this.$async=h?.$async,this.refs={}}}ke.SchemaEnv=c;function o(f){const d=m.call(this,f);if(d)return d;const i=(0,n.getFullPath)(this.opts.uriResolver,f.root.baseId),{es5:h,lines:v}=this.opts.code,{ownProperties:_}=this.opts,g=new t.CodeGen(this.scope,{es5:h,lines:v,ownProperties:_});let E;f.$async&&(E=g.scopeValue("Error",{ref:e.default,code:(0,t._)`require("ajv/dist/runtime/validation_error").default`}));const I=g.scopeName("validate");f.validateName=I;const M={gen:g,allErrors:this.opts.allErrors,data:r.default.data,parentData:r.default.parentData,parentDataProperty:r.default.parentDataProperty,dataNames:[r.default.data],dataPathArr:[t.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:g.scopeValue("schema",this.opts.code.source===!0?{ref:f.schema,code:(0,t.stringify)(f.schema)}:{ref:f.schema}),validateName:I,ValidationError:E,schema:f.schema,schemaEnv:f,rootId:i,baseId:f.baseId||i,schemaPath:t.nil,errSchemaPath:f.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,t._)`""`,opts:this.opts,self:this};let F;try{this._compilations.add(f),(0,s.validateFunctionCode)(M),g.optimize(this.opts.code.optimize);const K=g.toString();F=`${g.scopeRefs(r.default.scope)}return ${K}`,this.opts.code.process&&(F=this.opts.code.process(F,f));const Y=new Function(`${r.default.self}`,`${r.default.scope}`,F)(this,this.scope.get());if(this.scope.value(I,{ref:Y}),Y.errors=null,Y.schema=f.schema,Y.schemaEnv=f,f.$async&&(Y.$async=!0),this.opts.code.source===!0&&(Y.source={validateName:I,validateCode:K,scopeValues:g._values}),this.opts.unevaluated){const{props:ce,items:R}=M;Y.evaluated={props:ce instanceof t.Name?void 0:ce,items:R instanceof t.Name?void 0:R,dynamicProps:ce instanceof t.Name,dynamicItems:R instanceof t.Name},Y.source&&(Y.source.evaluated=(0,t.stringify)(Y.evaluated))}return f.validate=Y,f}catch(K){throw delete f.validate,delete f.validateName,F&&this.logger.error("Error compiling schema, function code:",F),K}finally{this._compilations.delete(f)}}ke.compileSchema=o;function u(f,d,i){var h;i=(0,n.resolveUrl)(this.opts.uriResolver,d,i);const v=f.refs[i];if(v)return v;let _=w.call(this,f,i);if(_===void 0){const g=(h=f.localRefs)===null||h===void 0?void 0:h[i],{schemaId:E}=this.opts;g&&(_=new c({schema:g,schemaId:E,root:f,baseId:d}))}if(_!==void 0)return f.refs[i]=p.call(this,_)}ke.resolveRef=u;function p(f){return(0,n.inlineRef)(f.schema,this.opts.inlineRefs)?f.schema:f.validate?f:o.call(this,f)}function m(f){for(const d of this._compilations)if(b(d,f))return d}ke.getCompilingSchema=m;function b(f,d){return f.schema===d.schema&&f.root===d.root&&f.baseId===d.baseId}function w(f,d){let i;for(;typeof(i=this.refs[d])=="string";)d=i;return i||this.schemas[d]||$.call(this,f,d)}function $(f,d){const i=this.opts.uriResolver.parse(d),h=(0,n._getFullPath)(this.opts.uriResolver,i);let v=(0,n.getFullPath)(this.opts.uriResolver,f.baseId,void 0);if(Object.keys(f.schema).length>0&&h===v)return y.call(this,i,f);const _=(0,n.normalizeId)(h),g=this.refs[_]||this.schemas[_];if(typeof g=="string"){const E=$.call(this,f,g);return typeof E?.schema!="object"?void 0:y.call(this,i,E)}if(typeof g?.schema=="object"){if(g.validate||o.call(this,g),_===(0,n.normalizeId)(d)){const{schema:E}=g,{schemaId:I}=this.opts,M=E[I];return M&&(v=(0,n.resolveUrl)(this.opts.uriResolver,v,M)),new c({schema:E,schemaId:I,root:f,baseId:v})}return y.call(this,i,g)}}ke.resolveSchema=$;const S=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function y(f,{baseId:d,schema:i,root:h}){var v;if(((v=f.fragment)===null||v===void 0?void 0:v[0])!=="/")return;for(const E of f.fragment.slice(1).split("/")){if(typeof i=="boolean")return;const I=i[(0,a.unescapeFragment)(E)];if(I===void 0)return;i=I;const M=typeof i=="object"&&i[this.opts.schemaId];!S.has(E)&&M&&(d=(0,n.resolveUrl)(this.opts.uriResolver,d,M))}let _;if(typeof i!="boolean"&&i.$ref&&!(0,a.schemaHasRulesButRef)(i,this.RULES)){const E=(0,n.resolveUrl)(this.opts.uriResolver,d,i.$ref);_=$.call(this,h,E)}const{schemaId:g}=this.opts;if(_=_||new c({schema:i,schemaId:g,root:h,baseId:d}),_.schema!==_.root.schema)return _}return ke}const xi="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",Mi="Meta-schema for $data reference (JSON AnySchema extension proposal)",qi="object",Di=["$data"],Vi={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},zi=!1;var Zi={$id:xi,description:Mi,type:qi,required:Di,properties:Vi,additionalProperties:zi},xt={},ft={exports:{}},Lr,An;function Li(){return An||(An=1,Lr={HEX:{0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15}}),Lr}var Ur,xn;function Ui(){if(xn)return Ur;xn=1;const{HEX:t}=Li(),e=/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u;function r(y){if(o(y,".")<3)return{host:y,isIPV4:!1};const f=y.match(e)||[],[d]=f;return d?{host:c(d,"."),isIPV4:!0}:{host:y,isIPV4:!1}}function n(y,f=!1){let d="",i=!0;for(const h of y){if(t[h]===void 0)return;h!=="0"&&i===!0&&(i=!1),i||(d+=h)}return f&&d.length===0&&(d="0"),d}function a(y){let f=0;const d={error:!1,address:"",zone:""},i=[],h=[];let v=!1,_=!1,g=!1;function E(){if(h.length){if(v===!1){const I=n(h);if(I!==void 0)i.push(I);else return d.error=!0,!1}h.length=0}return!0}for(let I=0;I<y.length;I++){const M=y[I];if(!(M==="["||M==="]"))if(M===":"){if(_===!0&&(g=!0),!E())break;if(f++,i.push(":"),f>7){d.error=!0;break}I-1>=0&&y[I-1]===":"&&(_=!0);continue}else if(M==="%"){if(!E())break;v=!0}else{h.push(M);continue}}return h.length&&(v?d.zone=h.join(""):g?i.push(h.join("")):i.push(n(h))),d.address=i.join(""),d}function s(y){if(o(y,":")<2)return{host:y,isIPV6:!1};const f=a(y);if(f.error)return{host:y,isIPV6:!1};{let d=f.address,i=f.address;return f.zone&&(d+="%"+f.zone,i+="%25"+f.zone),{host:d,escapedHost:i,isIPV6:!0}}}function c(y,f){let d="",i=!0;const h=y.length;for(let v=0;v<h;v++){const _=y[v];_==="0"&&i?(v+1<=h&&y[v+1]===f||v+1===h)&&(d+=_,i=!1):(_===f?i=!0:i=!1,d+=_)}return d}function o(y,f){let d=0;for(let i=0;i<y.length;i++)y[i]===f&&d++;return d}const u=/^\.\.?\//u,p=/^\/\.(?:\/|$)/u,m=/^\/\.\.(?:\/|$)/u,b=/^\/?(?:.|\n)*?(?=\/|$)/u;function w(y){const f=[];for(;y.length;)if(y.match(u))y=y.replace(u,"");else if(y.match(p))y=y.replace(p,"/");else if(y.match(m))y=y.replace(m,"/"),f.pop();else if(y==="."||y==="..")y="";else{const d=y.match(b);if(d){const i=d[0];y=y.slice(i.length),f.push(i)}else throw new Error("Unexpected dot segment condition")}return f.join("")}function $(y,f){const d=f!==!0?escape:unescape;return y.scheme!==void 0&&(y.scheme=d(y.scheme)),y.userinfo!==void 0&&(y.userinfo=d(y.userinfo)),y.host!==void 0&&(y.host=d(y.host)),y.path!==void 0&&(y.path=d(y.path)),y.query!==void 0&&(y.query=d(y.query)),y.fragment!==void 0&&(y.fragment=d(y.fragment)),y}function S(y){const f=[];if(y.userinfo!==void 0&&(f.push(y.userinfo),f.push("@")),y.host!==void 0){let d=unescape(y.host);const i=r(d);if(i.isIPV4)d=i.host;else{const h=s(i.host);h.isIPV6===!0?d=`[${h.escapedHost}]`:d=y.host}f.push(d)}return(typeof y.port=="number"||typeof y.port=="string")&&(f.push(":"),f.push(String(y.port))),f.length?f.join(""):void 0}return Ur={recomposeAuthority:S,normalizeComponentEncoding:$,removeDotSegments:w,normalizeIPv4:r,normalizeIPv6:s,stringArrayToHexStripped:n},Ur}var Fr,Mn;function Fi(){if(Mn)return Fr;Mn=1;const t=/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu,e=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function r(i){return typeof i.secure=="boolean"?i.secure:String(i.scheme).toLowerCase()==="wss"}function n(i){return i.host||(i.error=i.error||"HTTP URIs must have a host."),i}function a(i){const h=String(i.scheme).toLowerCase()==="https";return(i.port===(h?443:80)||i.port==="")&&(i.port=void 0),i.path||(i.path="/"),i}function s(i){return i.secure=r(i),i.resourceName=(i.path||"/")+(i.query?"?"+i.query:""),i.path=void 0,i.query=void 0,i}function c(i){if((i.port===(r(i)?443:80)||i.port==="")&&(i.port=void 0),typeof i.secure=="boolean"&&(i.scheme=i.secure?"wss":"ws",i.secure=void 0),i.resourceName){const[h,v]=i.resourceName.split("?");i.path=h&&h!=="/"?h:void 0,i.query=v,i.resourceName=void 0}return i.fragment=void 0,i}function o(i,h){if(!i.path)return i.error="URN can not be parsed",i;const v=i.path.match(e);if(v){const _=h.scheme||i.scheme||"urn";i.nid=v[1].toLowerCase(),i.nss=v[2];const g=`${_}:${h.nid||i.nid}`,E=d[g];i.path=void 0,E&&(i=E.parse(i,h))}else i.error=i.error||"URN can not be parsed.";return i}function u(i,h){const v=h.scheme||i.scheme||"urn",_=i.nid.toLowerCase(),g=`${v}:${h.nid||_}`,E=d[g];E&&(i=E.serialize(i,h));const I=i,M=i.nss;return I.path=`${_||h.nid}:${M}`,h.skipEscape=!0,I}function p(i,h){const v=i;return v.uuid=v.nss,v.nss=void 0,!h.tolerant&&(!v.uuid||!t.test(v.uuid))&&(v.error=v.error||"UUID is not valid."),v}function m(i){const h=i;return h.nss=(i.uuid||"").toLowerCase(),h}const b={scheme:"http",domainHost:!0,parse:n,serialize:a},w={scheme:"https",domainHost:b.domainHost,parse:n,serialize:a},$={scheme:"ws",domainHost:!0,parse:s,serialize:c},S={scheme:"wss",domainHost:$.domainHost,parse:$.parse,serialize:$.serialize},d={http:b,https:w,ws:$,wss:S,urn:{scheme:"urn",parse:o,serialize:u,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:p,serialize:m,skipNormalize:!0}};return Fr=d,Fr}var qn;function Ki(){if(qn)return ft.exports;qn=1;const{normalizeIPv6:t,normalizeIPv4:e,removeDotSegments:r,recomposeAuthority:n,normalizeComponentEncoding:a}=Ui(),s=Fi();function c(f,d){return typeof f=="string"?f=m(S(f,d),d):typeof f=="object"&&(f=S(m(f,d),d)),f}function o(f,d,i){const h=Object.assign({scheme:"null"},i),v=u(S(f,h),S(d,h),h,!0);return m(v,{...h,skipEscape:!0})}function u(f,d,i,h){const v={};return h||(f=S(m(f,i),i),d=S(m(d,i),i)),i=i||{},!i.tolerant&&d.scheme?(v.scheme=d.scheme,v.userinfo=d.userinfo,v.host=d.host,v.port=d.port,v.path=r(d.path||""),v.query=d.query):(d.userinfo!==void 0||d.host!==void 0||d.port!==void 0?(v.userinfo=d.userinfo,v.host=d.host,v.port=d.port,v.path=r(d.path||""),v.query=d.query):(d.path?(d.path.charAt(0)==="/"?v.path=r(d.path):((f.userinfo!==void 0||f.host!==void 0||f.port!==void 0)&&!f.path?v.path="/"+d.path:f.path?v.path=f.path.slice(0,f.path.lastIndexOf("/")+1)+d.path:v.path=d.path,v.path=r(v.path)),v.query=d.query):(v.path=f.path,d.query!==void 0?v.query=d.query:v.query=f.query),v.userinfo=f.userinfo,v.host=f.host,v.port=f.port),v.scheme=f.scheme),v.fragment=d.fragment,v}function p(f,d,i){return typeof f=="string"?(f=unescape(f),f=m(a(S(f,i),!0),{...i,skipEscape:!0})):typeof f=="object"&&(f=m(a(f,!0),{...i,skipEscape:!0})),typeof d=="string"?(d=unescape(d),d=m(a(S(d,i),!0),{...i,skipEscape:!0})):typeof d=="object"&&(d=m(a(d,!0),{...i,skipEscape:!0})),f.toLowerCase()===d.toLowerCase()}function m(f,d){const i={host:f.host,scheme:f.scheme,userinfo:f.userinfo,port:f.port,path:f.path,query:f.query,nid:f.nid,nss:f.nss,uuid:f.uuid,fragment:f.fragment,reference:f.reference,resourceName:f.resourceName,secure:f.secure,error:""},h=Object.assign({},d),v=[],_=s[(h.scheme||i.scheme||"").toLowerCase()];_&&_.serialize&&_.serialize(i,h),i.path!==void 0&&(h.skipEscape?i.path=unescape(i.path):(i.path=escape(i.path),i.scheme!==void 0&&(i.path=i.path.split("%3A").join(":")))),h.reference!=="suffix"&&i.scheme&&v.push(i.scheme,":");const g=n(i);if(g!==void 0&&(h.reference!=="suffix"&&v.push("//"),v.push(g),i.path&&i.path.charAt(0)!=="/"&&v.push("/")),i.path!==void 0){let E=i.path;!h.absolutePath&&(!_||!_.absolutePath)&&(E=r(E)),g===void 0&&(E=E.replace(/^\/\//u,"/%2F")),v.push(E)}return i.query!==void 0&&v.push("?",i.query),i.fragment!==void 0&&v.push("#",i.fragment),v.join("")}const b=Array.from({length:127},(f,d)=>/[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(d)));function w(f){let d=0;for(let i=0,h=f.length;i<h;++i)if(d=f.charCodeAt(i),d>126||b[d])return!0;return!1}const $=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function S(f,d){const i=Object.assign({},d),h={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},v=f.indexOf("%")!==-1;let _=!1;i.reference==="suffix"&&(f=(i.scheme?i.scheme+":":"")+"//"+f);const g=f.match($);if(g){if(h.scheme=g[1],h.userinfo=g[3],h.host=g[4],h.port=parseInt(g[5],10),h.path=g[6]||"",h.query=g[7],h.fragment=g[8],isNaN(h.port)&&(h.port=g[5]),h.host){const I=e(h.host);if(I.isIPV4===!1){const M=t(I.host);h.host=M.host.toLowerCase(),_=M.isIPV6}else h.host=I.host,_=!0}h.scheme===void 0&&h.userinfo===void 0&&h.host===void 0&&h.port===void 0&&h.query===void 0&&!h.path?h.reference="same-document":h.scheme===void 0?h.reference="relative":h.fragment===void 0?h.reference="absolute":h.reference="uri",i.reference&&i.reference!=="suffix"&&i.reference!==h.reference&&(h.error=h.error||"URI is not a "+i.reference+" reference.");const E=s[(i.scheme||h.scheme||"").toLowerCase()];if(!i.unicodeSupport&&(!E||!E.unicodeSupport)&&h.host&&(i.domainHost||E&&E.domainHost)&&_===!1&&w(h.host))try{h.host=URL.domainToASCII(h.host.toLowerCase())}catch(I){h.error=h.error||"Host's domain name can not be converted to ASCII: "+I}(!E||E&&!E.skipNormalize)&&(v&&h.scheme!==void 0&&(h.scheme=unescape(h.scheme)),v&&h.host!==void 0&&(h.host=unescape(h.host)),h.path&&(h.path=escape(unescape(h.path))),h.fragment&&(h.fragment=encodeURI(decodeURIComponent(h.fragment)))),E&&E.parse&&E.parse(h,i)}else h.error=h.error||"URI can not be parsed.";return h}const y={SCHEMES:s,normalize:c,resolve:o,resolveComponents:u,equal:p,serialize:m,parse:S};return ft.exports=y,ft.exports.default=y,ft.exports.fastUri=y,ft.exports}var Dn;function Hi(){if(Dn)return xt;Dn=1,Object.defineProperty(xt,"__esModule",{value:!0});const t=Ki();return t.code='require("ajv/dist/runtime/uri").default',xt.default=t,xt}var Vn;function Bi(){return Vn||(Vn=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var e=Tr();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return e.KeywordCxt}});var r=oe();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});const n=tn(),a=Nr(),s=Gs(),c=rn(),o=oe(),u=Or(),p=Er(),m=le(),b=Zi,w=Hi(),$=(q,j)=>new RegExp(q,j);$.code="new RegExp";const S=["removeAdditional","useDefaults","coerceTypes"],y=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),f={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},d={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},i=200;function h(q){var j,A,O,l,k,C,U,H,ue,te,P,T,x,V,B,ne,he,ve,$e,we,me,et,Se,Ir,Rr;const dt=q.strict,Cr=(j=q.code)===null||j===void 0?void 0:j.optimize,sn=Cr===!0||Cr===void 0?1:Cr||0,an=(O=(A=q.code)===null||A===void 0?void 0:A.regExp)!==null&&O!==void 0?O:$,ta=(l=q.uriResolver)!==null&&l!==void 0?l:w.default;return{strictSchema:(C=(k=q.strictSchema)!==null&&k!==void 0?k:dt)!==null&&C!==void 0?C:!0,strictNumbers:(H=(U=q.strictNumbers)!==null&&U!==void 0?U:dt)!==null&&H!==void 0?H:!0,strictTypes:(te=(ue=q.strictTypes)!==null&&ue!==void 0?ue:dt)!==null&&te!==void 0?te:"log",strictTuples:(T=(P=q.strictTuples)!==null&&P!==void 0?P:dt)!==null&&T!==void 0?T:"log",strictRequired:(V=(x=q.strictRequired)!==null&&x!==void 0?x:dt)!==null&&V!==void 0?V:!1,code:q.code?{...q.code,optimize:sn,regExp:an}:{optimize:sn,regExp:an},loopRequired:(B=q.loopRequired)!==null&&B!==void 0?B:i,loopEnum:(ne=q.loopEnum)!==null&&ne!==void 0?ne:i,meta:(he=q.meta)!==null&&he!==void 0?he:!0,messages:(ve=q.messages)!==null&&ve!==void 0?ve:!0,inlineRefs:($e=q.inlineRefs)!==null&&$e!==void 0?$e:!0,schemaId:(we=q.schemaId)!==null&&we!==void 0?we:"$id",addUsedSchema:(me=q.addUsedSchema)!==null&&me!==void 0?me:!0,validateSchema:(et=q.validateSchema)!==null&&et!==void 0?et:!0,validateFormats:(Se=q.validateFormats)!==null&&Se!==void 0?Se:!0,unicodeRegExp:(Ir=q.unicodeRegExp)!==null&&Ir!==void 0?Ir:!0,int32range:(Rr=q.int32range)!==null&&Rr!==void 0?Rr:!0,uriResolver:ta}}class v{constructor(j={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,j=this.opts={...j,...h(j)};const{es5:A,lines:O}=this.opts.code;this.scope=new o.ValueScope({scope:{},prefixes:y,es5:A,lines:O}),this.logger=ee(j.logger);const l=j.validateFormats;j.validateFormats=!1,this.RULES=(0,s.getRules)(),_.call(this,f,j,"NOT SUPPORTED"),_.call(this,d,j,"DEPRECATED","warn"),this._metaOpts=F.call(this),j.formats&&I.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),j.keywords&&M.call(this,j.keywords),typeof j.meta=="object"&&this.addMetaSchema(j.meta),E.call(this),j.validateFormats=l}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:j,meta:A,schemaId:O}=this.opts;let l=b;O==="id"&&(l={...b},l.id=l.$id,delete l.$id),A&&j&&this.addMetaSchema(l,l[O],!1)}defaultMeta(){const{meta:j,schemaId:A}=this.opts;return this.opts.defaultMeta=typeof j=="object"?j[A]||j:void 0}validate(j,A){let O;if(typeof j=="string"){if(O=this.getSchema(j),!O)throw new Error(`no schema with key or ref "${j}"`)}else O=this.compile(j);const l=O(A);return"$async"in O||(this.errors=O.errors),l}compile(j,A){const O=this._addSchema(j,A);return O.validate||this._compileSchemaEnv(O)}compileAsync(j,A){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:O}=this.opts;return l.call(this,j,A);async function l(te,P){await k.call(this,te.$schema);const T=this._addSchema(te,P);return T.validate||C.call(this,T)}async function k(te){te&&!this.getSchema(te)&&await l.call(this,{$ref:te},!0)}async function C(te){try{return this._compileSchemaEnv(te)}catch(P){if(!(P instanceof a.default))throw P;return U.call(this,P),await H.call(this,P.missingSchema),C.call(this,te)}}function U({missingSchema:te,missingRef:P}){if(this.refs[te])throw new Error(`AnySchema ${te} is loaded but ${P} cannot be resolved`)}async function H(te){const P=await ue.call(this,te);this.refs[te]||await k.call(this,P.$schema),this.refs[te]||this.addSchema(P,te,A)}async function ue(te){const P=this._loading[te];if(P)return P;try{return await(this._loading[te]=O(te))}finally{delete this._loading[te]}}}addSchema(j,A,O,l=this.opts.validateSchema){if(Array.isArray(j)){for(const C of j)this.addSchema(C,void 0,O,l);return this}let k;if(typeof j=="object"){const{schemaId:C}=this.opts;if(k=j[C],k!==void 0&&typeof k!="string")throw new Error(`schema ${C} must be string`)}return A=(0,u.normalizeId)(A||k),this._checkUnique(A),this.schemas[A]=this._addSchema(j,O,A,l,!0),this}addMetaSchema(j,A,O=this.opts.validateSchema){return this.addSchema(j,A,!0,O),this}validateSchema(j,A){if(typeof j=="boolean")return!0;let O;if(O=j.$schema,O!==void 0&&typeof O!="string")throw new Error("$schema must be a string");if(O=O||this.opts.defaultMeta||this.defaultMeta(),!O)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const l=this.validate(O,j);if(!l&&A){const k="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(k);else throw new Error(k)}return l}getSchema(j){let A;for(;typeof(A=g.call(this,j))=="string";)j=A;if(A===void 0){const{schemaId:O}=this.opts,l=new c.SchemaEnv({schema:{},schemaId:O});if(A=c.resolveSchema.call(this,l,j),!A)return;this.refs[j]=A}return A.validate||this._compileSchemaEnv(A)}removeSchema(j){if(j instanceof RegExp)return this._removeAllSchemas(this.schemas,j),this._removeAllSchemas(this.refs,j),this;switch(typeof j){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const A=g.call(this,j);return typeof A=="object"&&this._cache.delete(A.schema),delete this.schemas[j],delete this.refs[j],this}case"object":{const A=j;this._cache.delete(A);let O=j[this.opts.schemaId];return O&&(O=(0,u.normalizeId)(O),delete this.schemas[O],delete this.refs[O]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(j){for(const A of j)this.addKeyword(A);return this}addKeyword(j,A){let O;if(typeof j=="string")O=j,typeof A=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),A.keyword=O);else if(typeof j=="object"&&A===void 0){if(A=j,O=A.keyword,Array.isArray(O)&&!O.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(ce.call(this,O,A),!A)return(0,m.eachItem)(O,k=>R.call(this,k)),this;W.call(this,A);const l={...A,type:(0,p.getJSONTypes)(A.type),schemaType:(0,p.getJSONTypes)(A.schemaType)};return(0,m.eachItem)(O,l.type.length===0?k=>R.call(this,k,l):k=>l.type.forEach(C=>R.call(this,k,l,C))),this}getKeyword(j){const A=this.RULES.all[j];return typeof A=="object"?A.definition:!!A}removeKeyword(j){const{RULES:A}=this;delete A.keywords[j],delete A.all[j];for(const O of A.rules){const l=O.rules.findIndex(k=>k.keyword===j);l>=0&&O.rules.splice(l,1)}return this}addFormat(j,A){return typeof A=="string"&&(A=new RegExp(A)),this.formats[j]=A,this}errorsText(j=this.errors,{separator:A=", ",dataVar:O="data"}={}){return!j||j.length===0?"No errors":j.map(l=>`${O}${l.instancePath} ${l.message}`).reduce((l,k)=>l+A+k)}$dataMetaSchema(j,A){const O=this.RULES.all;j=JSON.parse(JSON.stringify(j));for(const l of A){const k=l.split("/").slice(1);let C=j;for(const U of k)C=C[U];for(const U in O){const H=O[U];if(typeof H!="object")continue;const{$data:ue}=H.definition,te=C[U];ue&&te&&(C[U]=se(te))}}return j}_removeAllSchemas(j,A){for(const O in j){const l=j[O];(!A||A.test(O))&&(typeof l=="string"?delete j[O]:l&&!l.meta&&(this._cache.delete(l.schema),delete j[O]))}}_addSchema(j,A,O,l=this.opts.validateSchema,k=this.opts.addUsedSchema){let C;const{schemaId:U}=this.opts;if(typeof j=="object")C=j[U];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof j!="boolean")throw new Error("schema must be object or boolean")}let H=this._cache.get(j);if(H!==void 0)return H;O=(0,u.normalizeId)(C||O);const ue=u.getSchemaRefs.call(this,j,O);return H=new c.SchemaEnv({schema:j,schemaId:U,meta:A,baseId:O,localRefs:ue}),this._cache.set(H.schema,H),k&&!O.startsWith("#")&&(O&&this._checkUnique(O),this.refs[O]=H),l&&this.validateSchema(j,!0),H}_checkUnique(j){if(this.schemas[j]||this.refs[j])throw new Error(`schema with key or id "${j}" already exists`)}_compileSchemaEnv(j){if(j.meta?this._compileMetaSchema(j):c.compileSchema.call(this,j),!j.validate)throw new Error("ajv implementation error");return j.validate}_compileMetaSchema(j){const A=this.opts;this.opts=this._metaOpts;try{c.compileSchema.call(this,j)}finally{this.opts=A}}}v.ValidationError=n.default,v.MissingRefError=a.default,t.default=v;function _(q,j,A,O="error"){for(const l in q){const k=l;k in j&&this.logger[O](`${A}: option ${l}. ${q[k]}`)}}function g(q){return q=(0,u.normalizeId)(q),this.schemas[q]||this.refs[q]}function E(){const q=this.opts.schemas;if(q)if(Array.isArray(q))this.addSchema(q);else for(const j in q)this.addSchema(q[j],j)}function I(){for(const q in this.opts.formats){const j=this.opts.formats[q];j&&this.addFormat(q,j)}}function M(q){if(Array.isArray(q)){this.addVocabulary(q);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const j in q){const A=q[j];A.keyword||(A.keyword=j),this.addKeyword(A)}}function F(){const q={...this.opts};for(const j of S)delete q[j];return q}const K={log(){},warn(){},error(){}};function ee(q){if(q===!1)return K;if(q===void 0)return console;if(q.log&&q.warn&&q.error)return q;throw new Error("logger must implement log, warn and error methods")}const Y=/^[a-z_$][a-z0-9_$:-]*$/i;function ce(q,j){const{RULES:A}=this;if((0,m.eachItem)(q,O=>{if(A.keywords[O])throw new Error(`Keyword ${O} is already defined`);if(!Y.test(O))throw new Error(`Keyword ${O} has invalid name`)}),!!j&&j.$data&&!("code"in j||"validate"in j))throw new Error('$data keyword must have "code" or "validate" function')}function R(q,j,A){var O;const l=j?.post;if(A&&l)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:k}=this;let C=l?k.post:k.rules.find(({type:H})=>H===A);if(C||(C={type:A,rules:[]},k.rules.push(C)),k.keywords[q]=!0,!j)return;const U={keyword:q,definition:{...j,type:(0,p.getJSONTypes)(j.type),schemaType:(0,p.getJSONTypes)(j.schemaType)}};j.before?Z.call(this,C,U,j.before):C.rules.push(U),k.all[q]=U,(O=j.implements)===null||O===void 0||O.forEach(H=>this.addKeyword(H))}function Z(q,j,A){const O=q.rules.findIndex(l=>l.keyword===A);O>=0?q.rules.splice(O,0,j):(q.rules.push(j),this.logger.warn(`rule ${A} is not defined`))}function W(q){let{metaSchema:j}=q;j!==void 0&&(q.$data&&this.opts.$data&&(j=se(j)),q.validateSchema=this.compile(j,!0))}const J={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function se(q){return{anyOf:[q,J]}}}(xr)),xr}var Mt={},qt={},Dt={},zn;function Gi(){if(zn)return Dt;zn=1,Object.defineProperty(Dt,"__esModule",{value:!0});const t={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};return Dt.default=t,Dt}var ze={},Zn;function Ji(){if(Zn)return ze;Zn=1,Object.defineProperty(ze,"__esModule",{value:!0}),ze.callRef=ze.getValidate=void 0;const t=Nr(),e=Ne(),r=oe(),n=Ke(),a=rn(),s=le(),c={keyword:"$ref",schemaType:"string",code(p){const{gen:m,schema:b,it:w}=p,{baseId:$,schemaEnv:S,validateName:y,opts:f,self:d}=w,{root:i}=S;if((b==="#"||b==="#/")&&$===i.baseId)return v();const h=a.resolveRef.call(d,i,$,b);if(h===void 0)throw new t.default(w.opts.uriResolver,$,b);if(h instanceof a.SchemaEnv)return _(h);return g(h);function v(){if(S===i)return u(p,y,S,S.$async);const E=m.scopeValue("root",{ref:i});return u(p,(0,r._)`${E}.validate`,i,i.$async)}function _(E){const I=o(p,E);u(p,I,E,E.$async)}function g(E){const I=m.scopeValue("schema",f.code.source===!0?{ref:E,code:(0,r.stringify)(E)}:{ref:E}),M=m.name("valid"),F=p.subschema({schema:E,dataTypes:[],schemaPath:r.nil,topSchemaRef:I,errSchemaPath:b},M);p.mergeEvaluated(F),p.ok(M)}}};function o(p,m){const{gen:b}=p;return m.validate?b.scopeValue("validate",{ref:m.validate}):(0,r._)`${b.scopeValue("wrapper",{ref:m})}.validate`}ze.getValidate=o;function u(p,m,b,w){const{gen:$,it:S}=p,{allErrors:y,schemaEnv:f,opts:d}=S,i=d.passContext?n.default.this:r.nil;w?h():v();function h(){if(!f.$async)throw new Error("async schema referenced by sync schema");const E=$.let("valid");$.try(()=>{$.code((0,r._)`await ${(0,e.callValidateCode)(p,m,i)}`),g(m),y||$.assign(E,!0)},I=>{$.if((0,r._)`!(${I} instanceof ${S.ValidationError})`,()=>$.throw(I)),_(I),y||$.assign(E,!1)}),p.ok(E)}function v(){p.result((0,e.callValidateCode)(p,m,i),()=>g(m),()=>_(m))}function _(E){const I=(0,r._)`${E}.errors`;$.assign(n.default.vErrors,(0,r._)`${n.default.vErrors} === null ? ${I} : ${n.default.vErrors}.concat(${I})`),$.assign(n.default.errors,(0,r._)`${n.default.vErrors}.length`)}function g(E){var I;if(!S.opts.unevaluated)return;const M=(I=b?.validate)===null||I===void 0?void 0:I.evaluated;if(S.props!==!0)if(M&&!M.dynamicProps)M.props!==void 0&&(S.props=s.mergeEvaluated.props($,M.props,S.props));else{const F=$.var("props",(0,r._)`${E}.evaluated.props`);S.props=s.mergeEvaluated.props($,F,S.props,r.Name)}if(S.items!==!0)if(M&&!M.dynamicItems)M.items!==void 0&&(S.items=s.mergeEvaluated.items($,M.items,S.items));else{const F=$.var("items",(0,r._)`${E}.evaluated.items`);S.items=s.mergeEvaluated.items($,F,S.items,r.Name)}}}return ze.callRef=u,ze.default=c,ze}var Ln;function Wi(){if(Ln)return qt;Ln=1,Object.defineProperty(qt,"__esModule",{value:!0});const t=Gi(),e=Ji(),r=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",t.default,e.default];return qt.default=r,qt}var Vt={},zt={},Un;function Yi(){if(Un)return zt;Un=1,Object.defineProperty(zt,"__esModule",{value:!0});const t=oe(),e=t.operators,r={maximum:{okStr:"<=",ok:e.LTE,fail:e.GT},minimum:{okStr:">=",ok:e.GTE,fail:e.LT},exclusiveMaximum:{okStr:"<",ok:e.LT,fail:e.GTE},exclusiveMinimum:{okStr:">",ok:e.GT,fail:e.LTE}},n={message:({keyword:s,schemaCode:c})=>(0,t.str)`must be ${r[s].okStr} ${c}`,params:({keyword:s,schemaCode:c})=>(0,t._)`{comparison: ${r[s].okStr}, limit: ${c}}`},a={keyword:Object.keys(r),type:"number",schemaType:"number",$data:!0,error:n,code(s){const{keyword:c,data:o,schemaCode:u}=s;s.fail$data((0,t._)`${o} ${r[c].fail} ${u} || isNaN(${o})`)}};return zt.default=a,zt}var Zt={},Fn;function Qi(){if(Fn)return Zt;Fn=1,Object.defineProperty(Zt,"__esModule",{value:!0});const t=oe(),r={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:n})=>(0,t.str)`must be multiple of ${n}`,params:({schemaCode:n})=>(0,t._)`{multipleOf: ${n}}`},code(n){const{gen:a,data:s,schemaCode:c,it:o}=n,u=o.opts.multipleOfPrecision,p=a.let("res"),m=u?(0,t._)`Math.abs(Math.round(${p}) - ${p}) > 1e-${u}`:(0,t._)`${p} !== parseInt(${p})`;n.fail$data((0,t._)`(${c} === 0 || (${p} = ${s}/${c}, ${m}))`)}};return Zt.default=r,Zt}var Lt={},Ut={},Kn;function Xi(){if(Kn)return Ut;Kn=1,Object.defineProperty(Ut,"__esModule",{value:!0});function t(e){const r=e.length;let n=0,a=0,s;for(;a<r;)n++,s=e.charCodeAt(a++),s>=55296&&s<=56319&&a<r&&(s=e.charCodeAt(a),(s&64512)===56320&&a++);return n}return Ut.default=t,t.code='require("ajv/dist/runtime/ucs2length").default',Ut}var Hn;function eo(){if(Hn)return Lt;Hn=1,Object.defineProperty(Lt,"__esModule",{value:!0});const t=oe(),e=le(),r=Xi(),a={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:s,schemaCode:c}){const o=s==="maxLength"?"more":"fewer";return(0,t.str)`must NOT have ${o} than ${c} characters`},params:({schemaCode:s})=>(0,t._)`{limit: ${s}}`},code(s){const{keyword:c,data:o,schemaCode:u,it:p}=s,m=c==="maxLength"?t.operators.GT:t.operators.LT,b=p.opts.unicode===!1?(0,t._)`${o}.length`:(0,t._)`${(0,e.useFunc)(s.gen,r.default)}(${o})`;s.fail$data((0,t._)`${b} ${m} ${u}`)}};return Lt.default=a,Lt}var Ft={},Bn;function to(){if(Bn)return Ft;Bn=1,Object.defineProperty(Ft,"__esModule",{value:!0});const t=Ne(),e=oe(),n={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:a})=>(0,e.str)`must match pattern "${a}"`,params:({schemaCode:a})=>(0,e._)`{pattern: ${a}}`},code(a){const{data:s,$data:c,schema:o,schemaCode:u,it:p}=a,m=p.opts.unicodeRegExp?"u":"",b=c?(0,e._)`(new RegExp(${u}, ${m}))`:(0,t.usePattern)(a,o);a.fail$data((0,e._)`!${b}.test(${s})`)}};return Ft.default=n,Ft}var Kt={},Gn;function ro(){if(Gn)return Kt;Gn=1,Object.defineProperty(Kt,"__esModule",{value:!0});const t=oe(),r={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:n,schemaCode:a}){const s=n==="maxProperties"?"more":"fewer";return(0,t.str)`must NOT have ${s} than ${a} properties`},params:({schemaCode:n})=>(0,t._)`{limit: ${n}}`},code(n){const{keyword:a,data:s,schemaCode:c}=n,o=a==="maxProperties"?t.operators.GT:t.operators.LT;n.fail$data((0,t._)`Object.keys(${s}).length ${o} ${c}`)}};return Kt.default=r,Kt}var Ht={},Jn;function no(){if(Jn)return Ht;Jn=1,Object.defineProperty(Ht,"__esModule",{value:!0});const t=Ne(),e=oe(),r=le(),a={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:s}})=>(0,e.str)`must have required property '${s}'`,params:({params:{missingProperty:s}})=>(0,e._)`{missingProperty: ${s}}`},code(s){const{gen:c,schema:o,schemaCode:u,data:p,$data:m,it:b}=s,{opts:w}=b;if(!m&&o.length===0)return;const $=o.length>=w.loopRequired;if(b.allErrors?S():y(),w.strictRequired){const i=s.parentSchema.properties,{definedProperties:h}=s.it;for(const v of o)if(i?.[v]===void 0&&!h.has(v)){const _=b.schemaEnv.baseId+b.errSchemaPath,g=`required property "${v}" is not defined at "${_}" (strictRequired)`;(0,r.checkStrictMode)(b,g,b.opts.strictRequired)}}function S(){if($||m)s.block$data(e.nil,f);else for(const i of o)(0,t.checkReportMissingProp)(s,i)}function y(){const i=c.let("missing");if($||m){const h=c.let("valid",!0);s.block$data(h,()=>d(i,h)),s.ok(h)}else c.if((0,t.checkMissingProp)(s,o,i)),(0,t.reportMissingProp)(s,i),c.else()}function f(){c.forOf("prop",u,i=>{s.setParams({missingProperty:i}),c.if((0,t.noPropertyInData)(c,p,i,w.ownProperties),()=>s.error())})}function d(i,h){s.setParams({missingProperty:i}),c.forOf(i,u,()=>{c.assign(h,(0,t.propertyInData)(c,p,i,w.ownProperties)),c.if((0,e.not)(h),()=>{s.error(),c.break()})},e.nil)}}};return Ht.default=a,Ht}var Bt={},Wn;function so(){if(Wn)return Bt;Wn=1,Object.defineProperty(Bt,"__esModule",{value:!0});const t=oe(),r={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:n,schemaCode:a}){const s=n==="maxItems"?"more":"fewer";return(0,t.str)`must NOT have ${s} than ${a} items`},params:({schemaCode:n})=>(0,t._)`{limit: ${n}}`},code(n){const{keyword:a,data:s,schemaCode:c}=n,o=a==="maxItems"?t.operators.GT:t.operators.LT;n.fail$data((0,t._)`${s}.length ${o} ${c}`)}};return Bt.default=r,Bt}var Gt={},Jt={},Yn;function nn(){if(Yn)return Jt;Yn=1,Object.defineProperty(Jt,"__esModule",{value:!0});const t=Ws();return t.code='require("ajv/dist/runtime/equal").default',Jt.default=t,Jt}var Qn;function ao(){if(Qn)return Gt;Qn=1,Object.defineProperty(Gt,"__esModule",{value:!0});const t=Er(),e=oe(),r=le(),n=nn(),s={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:c,j:o}})=>(0,e.str)`must NOT have duplicate items (items ## ${o} and ${c} are identical)`,params:({params:{i:c,j:o}})=>(0,e._)`{i: ${c}, j: ${o}}`},code(c){const{gen:o,data:u,$data:p,schema:m,parentSchema:b,schemaCode:w,it:$}=c;if(!p&&!m)return;const S=o.let("valid"),y=b.items?(0,t.getSchemaTypes)(b.items):[];c.block$data(S,f,(0,e._)`${w} === false`),c.ok(S);function f(){const v=o.let("i",(0,e._)`${u}.length`),_=o.let("j");c.setParams({i:v,j:_}),o.assign(S,!0),o.if((0,e._)`${v} > 1`,()=>(d()?i:h)(v,_))}function d(){return y.length>0&&!y.some(v=>v==="object"||v==="array")}function i(v,_){const g=o.name("item"),E=(0,t.checkDataTypes)(y,g,$.opts.strictNumbers,t.DataType.Wrong),I=o.const("indices",(0,e._)`{}`);o.for((0,e._)`;${v}--;`,()=>{o.let(g,(0,e._)`${u}[${v}]`),o.if(E,(0,e._)`continue`),y.length>1&&o.if((0,e._)`typeof ${g} == "string"`,(0,e._)`${g} += "_"`),o.if((0,e._)`typeof ${I}[${g}] == "number"`,()=>{o.assign(_,(0,e._)`${I}[${g}]`),c.error(),o.assign(S,!1).break()}).code((0,e._)`${I}[${g}] = ${v}`)})}function h(v,_){const g=(0,r.useFunc)(o,n.default),E=o.name("outer");o.label(E).for((0,e._)`;${v}--;`,()=>o.for((0,e._)`${_} = ${v}; ${_}--;`,()=>o.if((0,e._)`${g}(${u}[${v}], ${u}[${_}])`,()=>{c.error(),o.assign(S,!1).break(E)})))}}};return Gt.default=s,Gt}var Wt={},Xn;function io(){if(Xn)return Wt;Xn=1,Object.defineProperty(Wt,"__esModule",{value:!0});const t=oe(),e=le(),r=nn(),a={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:s})=>(0,t._)`{allowedValue: ${s}}`},code(s){const{gen:c,data:o,$data:u,schemaCode:p,schema:m}=s;u||m&&typeof m=="object"?s.fail$data((0,t._)`!${(0,e.useFunc)(c,r.default)}(${o}, ${p})`):s.fail((0,t._)`${m} !== ${o}`)}};return Wt.default=a,Wt}var Yt={},es;function oo(){if(es)return Yt;es=1,Object.defineProperty(Yt,"__esModule",{value:!0});const t=oe(),e=le(),r=nn(),a={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:s})=>(0,t._)`{allowedValues: ${s}}`},code(s){const{gen:c,data:o,$data:u,schema:p,schemaCode:m,it:b}=s;if(!u&&p.length===0)throw new Error("enum must have non-empty array");const w=p.length>=b.opts.loopEnum;let $;const S=()=>$??($=(0,e.useFunc)(c,r.default));let y;if(w||u)y=c.let("valid"),s.block$data(y,f);else{if(!Array.isArray(p))throw new Error("ajv implementation error");const i=c.const("vSchema",m);y=(0,t.or)(...p.map((h,v)=>d(i,v)))}s.pass(y);function f(){c.assign(y,!1),c.forOf("v",m,i=>c.if((0,t._)`${S()}(${o}, ${i})`,()=>c.assign(y,!0).break()))}function d(i,h){const v=p[h];return typeof v=="object"&&v!==null?(0,t._)`${S()}(${o}, ${i}[${h}])`:(0,t._)`${o} === ${v}`}}};return Yt.default=a,Yt}var ts;function co(){if(ts)return Vt;ts=1,Object.defineProperty(Vt,"__esModule",{value:!0});const t=Yi(),e=Qi(),r=eo(),n=to(),a=ro(),s=no(),c=so(),o=ao(),u=io(),p=oo(),m=[t.default,e.default,r.default,n.default,a.default,s.default,c.default,o.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},u.default,p.default];return Vt.default=m,Vt}var Qt={},tt={},rs;function Ys(){if(rs)return tt;rs=1,Object.defineProperty(tt,"__esModule",{value:!0}),tt.validateAdditionalItems=void 0;const t=oe(),e=le(),n={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:s}})=>(0,t.str)`must NOT have more than ${s} items`,params:({params:{len:s}})=>(0,t._)`{limit: ${s}}`},code(s){const{parentSchema:c,it:o}=s,{items:u}=c;if(!Array.isArray(u)){(0,e.checkStrictMode)(o,'"additionalItems" is ignored when "items" is not an array of schemas');return}a(s,u)}};function a(s,c){const{gen:o,schema:u,data:p,keyword:m,it:b}=s;b.items=!0;const w=o.const("len",(0,t._)`${p}.length`);if(u===!1)s.setParams({len:c.length}),s.pass((0,t._)`${w} <= ${c.length}`);else if(typeof u=="object"&&!(0,e.alwaysValidSchema)(b,u)){const S=o.var("valid",(0,t._)`${w} <= ${c.length}`);o.if((0,t.not)(S),()=>$(S)),s.ok(S)}function $(S){o.forRange("i",c.length,w,y=>{s.subschema({keyword:m,dataProp:y,dataPropType:e.Type.Num},S),b.allErrors||o.if((0,t.not)(S),()=>o.break())})}}return tt.validateAdditionalItems=a,tt.default=n,tt}var Xt={},rt={},ns;function Qs(){if(ns)return rt;ns=1,Object.defineProperty(rt,"__esModule",{value:!0}),rt.validateTuple=void 0;const t=oe(),e=le(),r=Ne(),n={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(s){const{schema:c,it:o}=s;if(Array.isArray(c))return a(s,"additionalItems",c);o.items=!0,!(0,e.alwaysValidSchema)(o,c)&&s.ok((0,r.validateArray)(s))}};function a(s,c,o=s.schema){const{gen:u,parentSchema:p,data:m,keyword:b,it:w}=s;y(p),w.opts.unevaluated&&o.length&&w.items!==!0&&(w.items=e.mergeEvaluated.items(u,o.length,w.items));const $=u.name("valid"),S=u.const("len",(0,t._)`${m}.length`);o.forEach((f,d)=>{(0,e.alwaysValidSchema)(w,f)||(u.if((0,t._)`${S} > ${d}`,()=>s.subschema({keyword:b,schemaProp:d,dataProp:d},$)),s.ok($))});function y(f){const{opts:d,errSchemaPath:i}=w,h=o.length,v=h===f.minItems&&(h===f.maxItems||f[c]===!1);if(d.strictTuples&&!v){const _=`"${b}" is ${h}-tuple, but minItems or maxItems/${c} are not specified or different at path "${i}"`;(0,e.checkStrictMode)(w,_,d.strictTuples)}}}return rt.validateTuple=a,rt.default=n,rt}var ss;function uo(){if(ss)return Xt;ss=1,Object.defineProperty(Xt,"__esModule",{value:!0});const t=Qs(),e={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:r=>(0,t.validateTuple)(r,"items")};return Xt.default=e,Xt}var er={},as;function lo(){if(as)return er;as=1,Object.defineProperty(er,"__esModule",{value:!0});const t=oe(),e=le(),r=Ne(),n=Ys(),s={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:c}})=>(0,t.str)`must NOT have more than ${c} items`,params:({params:{len:c}})=>(0,t._)`{limit: ${c}}`},code(c){const{schema:o,parentSchema:u,it:p}=c,{prefixItems:m}=u;p.items=!0,!(0,e.alwaysValidSchema)(p,o)&&(m?(0,n.validateAdditionalItems)(c,m):c.ok((0,r.validateArray)(c)))}};return er.default=s,er}var tr={},is;function fo(){if(is)return tr;is=1,Object.defineProperty(tr,"__esModule",{value:!0});const t=oe(),e=le(),n={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:a,max:s}})=>s===void 0?(0,t.str)`must contain at least ${a} valid item(s)`:(0,t.str)`must contain at least ${a} and no more than ${s} valid item(s)`,params:({params:{min:a,max:s}})=>s===void 0?(0,t._)`{minContains: ${a}}`:(0,t._)`{minContains: ${a}, maxContains: ${s}}`},code(a){const{gen:s,schema:c,parentSchema:o,data:u,it:p}=a;let m,b;const{minContains:w,maxContains:$}=o;p.opts.next?(m=w===void 0?1:w,b=$):m=1;const S=s.const("len",(0,t._)`${u}.length`);if(a.setParams({min:m,max:b}),b===void 0&&m===0){(0,e.checkStrictMode)(p,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(b!==void 0&&m>b){(0,e.checkStrictMode)(p,'"minContains" > "maxContains" is always invalid'),a.fail();return}if((0,e.alwaysValidSchema)(p,c)){let h=(0,t._)`${S} >= ${m}`;b!==void 0&&(h=(0,t._)`${h} && ${S} <= ${b}`),a.pass(h);return}p.items=!0;const y=s.name("valid");b===void 0&&m===1?d(y,()=>s.if(y,()=>s.break())):m===0?(s.let(y,!0),b!==void 0&&s.if((0,t._)`${u}.length > 0`,f)):(s.let(y,!1),f()),a.result(y,()=>a.reset());function f(){const h=s.name("_valid"),v=s.let("count",0);d(h,()=>s.if(h,()=>i(v)))}function d(h,v){s.forRange("i",0,S,_=>{a.subschema({keyword:"contains",dataProp:_,dataPropType:e.Type.Num,compositeRule:!0},h),v()})}function i(h){s.code((0,t._)`${h}++`),b===void 0?s.if((0,t._)`${h} >= ${m}`,()=>s.assign(y,!0).break()):(s.if((0,t._)`${h} > ${b}`,()=>s.assign(y,!1).break()),m===1?s.assign(y,!0):s.if((0,t._)`${h} >= ${m}`,()=>s.assign(y,!0)))}}};return tr.default=n,tr}var Kr={},os;function ho(){return os||(os=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;const e=oe(),r=le(),n=Ne();t.error={message:({params:{property:u,depsCount:p,deps:m}})=>{const b=p===1?"property":"properties";return(0,e.str)`must have ${b} ${m} when property ${u} is present`},params:({params:{property:u,depsCount:p,deps:m,missingProperty:b}})=>(0,e._)`{property: ${u},
6
+ missingProperty: ${b},
7
+ depsCount: ${p},
8
+ deps: ${m}}`};const a={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(u){const[p,m]=s(u);c(u,p),o(u,m)}};function s({schema:u}){const p={},m={};for(const b in u){if(b==="__proto__")continue;const w=Array.isArray(u[b])?p:m;w[b]=u[b]}return[p,m]}function c(u,p=u.schema){const{gen:m,data:b,it:w}=u;if(Object.keys(p).length===0)return;const $=m.let("missing");for(const S in p){const y=p[S];if(y.length===0)continue;const f=(0,n.propertyInData)(m,b,S,w.opts.ownProperties);u.setParams({property:S,depsCount:y.length,deps:y.join(", ")}),w.allErrors?m.if(f,()=>{for(const d of y)(0,n.checkReportMissingProp)(u,d)}):(m.if((0,e._)`${f} && (${(0,n.checkMissingProp)(u,y,$)})`),(0,n.reportMissingProp)(u,$),m.else())}}t.validatePropertyDeps=c;function o(u,p=u.schema){const{gen:m,data:b,keyword:w,it:$}=u,S=m.name("valid");for(const y in p)(0,r.alwaysValidSchema)($,p[y])||(m.if((0,n.propertyInData)(m,b,y,$.opts.ownProperties),()=>{const f=u.subschema({keyword:w,schemaProp:y},S);u.mergeValidEvaluated(f,S)},()=>m.var(S,!0)),u.ok(S))}t.validateSchemaDeps=o,t.default=a}(Kr)),Kr}var rr={},cs;function po(){if(cs)return rr;cs=1,Object.defineProperty(rr,"__esModule",{value:!0});const t=oe(),e=le(),n={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:a})=>(0,t._)`{propertyName: ${a.propertyName}}`},code(a){const{gen:s,schema:c,data:o,it:u}=a;if((0,e.alwaysValidSchema)(u,c))return;const p=s.name("valid");s.forIn("key",o,m=>{a.setParams({propertyName:m}),a.subschema({keyword:"propertyNames",data:m,dataTypes:["string"],propertyName:m,compositeRule:!0},p),s.if((0,t.not)(p),()=>{a.error(!0),u.allErrors||s.break()})}),a.ok(p)}};return rr.default=n,rr}var nr={},us;function Xs(){if(us)return nr;us=1,Object.defineProperty(nr,"__esModule",{value:!0});const t=Ne(),e=oe(),r=Ke(),n=le(),s={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:c})=>(0,e._)`{additionalProperty: ${c.additionalProperty}}`},code(c){const{gen:o,schema:u,parentSchema:p,data:m,errsCount:b,it:w}=c;if(!b)throw new Error("ajv implementation error");const{allErrors:$,opts:S}=w;if(w.props=!0,S.removeAdditional!=="all"&&(0,n.alwaysValidSchema)(w,u))return;const y=(0,t.allSchemaProperties)(p.properties),f=(0,t.allSchemaProperties)(p.patternProperties);d(),c.ok((0,e._)`${b} === ${r.default.errors}`);function d(){o.forIn("key",m,g=>{!y.length&&!f.length?v(g):o.if(i(g),()=>v(g))})}function i(g){let E;if(y.length>8){const I=(0,n.schemaRefOrVal)(w,p.properties,"properties");E=(0,t.isOwnProperty)(o,I,g)}else y.length?E=(0,e.or)(...y.map(I=>(0,e._)`${g} === ${I}`)):E=e.nil;return f.length&&(E=(0,e.or)(E,...f.map(I=>(0,e._)`${(0,t.usePattern)(c,I)}.test(${g})`))),(0,e.not)(E)}function h(g){o.code((0,e._)`delete ${m}[${g}]`)}function v(g){if(S.removeAdditional==="all"||S.removeAdditional&&u===!1){h(g);return}if(u===!1){c.setParams({additionalProperty:g}),c.error(),$||o.break();return}if(typeof u=="object"&&!(0,n.alwaysValidSchema)(w,u)){const E=o.name("valid");S.removeAdditional==="failing"?(_(g,E,!1),o.if((0,e.not)(E),()=>{c.reset(),h(g)})):(_(g,E),$||o.if((0,e.not)(E),()=>o.break()))}}function _(g,E,I){const M={keyword:"additionalProperties",dataProp:g,dataPropType:n.Type.Str};I===!1&&Object.assign(M,{compositeRule:!0,createErrors:!1,allErrors:!1}),c.subschema(M,E)}}};return nr.default=s,nr}var sr={},ds;function mo(){if(ds)return sr;ds=1,Object.defineProperty(sr,"__esModule",{value:!0});const t=Tr(),e=Ne(),r=le(),n=Xs(),a={keyword:"properties",type:"object",schemaType:"object",code(s){const{gen:c,schema:o,parentSchema:u,data:p,it:m}=s;m.opts.removeAdditional==="all"&&u.additionalProperties===void 0&&n.default.code(new t.KeywordCxt(m,n.default,"additionalProperties"));const b=(0,e.allSchemaProperties)(o);for(const f of b)m.definedProperties.add(f);m.opts.unevaluated&&b.length&&m.props!==!0&&(m.props=r.mergeEvaluated.props(c,(0,r.toHash)(b),m.props));const w=b.filter(f=>!(0,r.alwaysValidSchema)(m,o[f]));if(w.length===0)return;const $=c.name("valid");for(const f of w)S(f)?y(f):(c.if((0,e.propertyInData)(c,p,f,m.opts.ownProperties)),y(f),m.allErrors||c.else().var($,!0),c.endIf()),s.it.definedProperties.add(f),s.ok($);function S(f){return m.opts.useDefaults&&!m.compositeRule&&o[f].default!==void 0}function y(f){s.subschema({keyword:"properties",schemaProp:f,dataProp:f},$)}}};return sr.default=a,sr}var ar={},ls;function yo(){if(ls)return ar;ls=1,Object.defineProperty(ar,"__esModule",{value:!0});const t=Ne(),e=oe(),r=le(),n=le(),a={keyword:"patternProperties",type:"object",schemaType:"object",code(s){const{gen:c,schema:o,data:u,parentSchema:p,it:m}=s,{opts:b}=m,w=(0,t.allSchemaProperties)(o),$=w.filter(v=>(0,r.alwaysValidSchema)(m,o[v]));if(w.length===0||$.length===w.length&&(!m.opts.unevaluated||m.props===!0))return;const S=b.strictSchema&&!b.allowMatchingProperties&&p.properties,y=c.name("valid");m.props!==!0&&!(m.props instanceof e.Name)&&(m.props=(0,n.evaluatedPropsToName)(c,m.props));const{props:f}=m;d();function d(){for(const v of w)S&&i(v),m.allErrors?h(v):(c.var(y,!0),h(v),c.if(y))}function i(v){for(const _ in S)new RegExp(v).test(_)&&(0,r.checkStrictMode)(m,`property ${_} matches pattern ${v} (use allowMatchingProperties)`)}function h(v){c.forIn("key",u,_=>{c.if((0,e._)`${(0,t.usePattern)(s,v)}.test(${_})`,()=>{const g=$.includes(v);g||s.subschema({keyword:"patternProperties",schemaProp:v,dataProp:_,dataPropType:n.Type.Str},y),m.opts.unevaluated&&f!==!0?c.assign((0,e._)`${f}[${_}]`,!0):!g&&!m.allErrors&&c.if((0,e.not)(y),()=>c.break())})})}}};return ar.default=a,ar}var ir={},fs;function vo(){if(fs)return ir;fs=1,Object.defineProperty(ir,"__esModule",{value:!0});const t=le(),e={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(r){const{gen:n,schema:a,it:s}=r;if((0,t.alwaysValidSchema)(s,a)){r.fail();return}const c=n.name("valid");r.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},c),r.failResult(c,()=>r.reset(),()=>r.error())},error:{message:"must NOT be valid"}};return ir.default=e,ir}var or={},hs;function go(){if(hs)return or;hs=1,Object.defineProperty(or,"__esModule",{value:!0});const e={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Ne().validateUnion,error:{message:"must match a schema in anyOf"}};return or.default=e,or}var cr={},ps;function _o(){if(ps)return cr;ps=1,Object.defineProperty(cr,"__esModule",{value:!0});const t=oe(),e=le(),n={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:a})=>(0,t._)`{passingSchemas: ${a.passing}}`},code(a){const{gen:s,schema:c,parentSchema:o,it:u}=a;if(!Array.isArray(c))throw new Error("ajv implementation error");if(u.opts.discriminator&&o.discriminator)return;const p=c,m=s.let("valid",!1),b=s.let("passing",null),w=s.name("_valid");a.setParams({passing:b}),s.block($),a.result(m,()=>a.reset(),()=>a.error(!0));function $(){p.forEach((S,y)=>{let f;(0,e.alwaysValidSchema)(u,S)?s.var(w,!0):f=a.subschema({keyword:"oneOf",schemaProp:y,compositeRule:!0},w),y>0&&s.if((0,t._)`${w} && ${m}`).assign(m,!1).assign(b,(0,t._)`[${b}, ${y}]`).else(),s.if(w,()=>{s.assign(m,!0),s.assign(b,y),f&&a.mergeEvaluated(f,t.Name)})})}}};return cr.default=n,cr}var ur={},ms;function bo(){if(ms)return ur;ms=1,Object.defineProperty(ur,"__esModule",{value:!0});const t=le(),e={keyword:"allOf",schemaType:"array",code(r){const{gen:n,schema:a,it:s}=r;if(!Array.isArray(a))throw new Error("ajv implementation error");const c=n.name("valid");a.forEach((o,u)=>{if((0,t.alwaysValidSchema)(s,o))return;const p=r.subschema({keyword:"allOf",schemaProp:u},c);r.ok(c),r.mergeEvaluated(p)})}};return ur.default=e,ur}var dr={},ys;function $o(){if(ys)return dr;ys=1,Object.defineProperty(dr,"__esModule",{value:!0});const t=oe(),e=le(),n={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:s})=>(0,t.str)`must match "${s.ifClause}" schema`,params:({params:s})=>(0,t._)`{failingKeyword: ${s.ifClause}}`},code(s){const{gen:c,parentSchema:o,it:u}=s;o.then===void 0&&o.else===void 0&&(0,e.checkStrictMode)(u,'"if" without "then" and "else" is ignored');const p=a(u,"then"),m=a(u,"else");if(!p&&!m)return;const b=c.let("valid",!0),w=c.name("_valid");if($(),s.reset(),p&&m){const y=c.let("ifClause");s.setParams({ifClause:y}),c.if(w,S("then",y),S("else",y))}else p?c.if(w,S("then")):c.if((0,t.not)(w),S("else"));s.pass(b,()=>s.error(!0));function $(){const y=s.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},w);s.mergeEvaluated(y)}function S(y,f){return()=>{const d=s.subschema({keyword:y},w);c.assign(b,w),s.mergeValidEvaluated(d,b),f?c.assign(f,(0,t._)`${y}`):s.setParams({ifClause:y})}}}};function a(s,c){const o=s.schema[c];return o!==void 0&&!(0,e.alwaysValidSchema)(s,o)}return dr.default=n,dr}var lr={},vs;function wo(){if(vs)return lr;vs=1,Object.defineProperty(lr,"__esModule",{value:!0});const t=le(),e={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:r,parentSchema:n,it:a}){n.if===void 0&&(0,t.checkStrictMode)(a,`"${r}" without "if" is ignored`)}};return lr.default=e,lr}var gs;function ko(){if(gs)return Qt;gs=1,Object.defineProperty(Qt,"__esModule",{value:!0});const t=Ys(),e=uo(),r=Qs(),n=lo(),a=fo(),s=ho(),c=po(),o=Xs(),u=mo(),p=yo(),m=vo(),b=go(),w=_o(),$=bo(),S=$o(),y=wo();function f(d=!1){const i=[m.default,b.default,w.default,$.default,S.default,y.default,c.default,o.default,s.default,u.default,p.default];return d?i.push(e.default,n.default):i.push(t.default,r.default),i.push(a.default),i}return Qt.default=f,Qt}var fr={},hr={},_s;function Eo(){if(_s)return hr;_s=1,Object.defineProperty(hr,"__esModule",{value:!0});const t=oe(),r={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:n})=>(0,t.str)`must match format "${n}"`,params:({schemaCode:n})=>(0,t._)`{format: ${n}}`},code(n,a){const{gen:s,data:c,$data:o,schema:u,schemaCode:p,it:m}=n,{opts:b,errSchemaPath:w,schemaEnv:$,self:S}=m;if(!b.validateFormats)return;o?y():f();function y(){const d=s.scopeValue("formats",{ref:S.formats,code:b.code.formats}),i=s.const("fDef",(0,t._)`${d}[${p}]`),h=s.let("fType"),v=s.let("format");s.if((0,t._)`typeof ${i} == "object" && !(${i} instanceof RegExp)`,()=>s.assign(h,(0,t._)`${i}.type || "string"`).assign(v,(0,t._)`${i}.validate`),()=>s.assign(h,(0,t._)`"string"`).assign(v,i)),n.fail$data((0,t.or)(_(),g()));function _(){return b.strictSchema===!1?t.nil:(0,t._)`${p} && !${v}`}function g(){const E=$.$async?(0,t._)`(${i}.async ? await ${v}(${c}) : ${v}(${c}))`:(0,t._)`${v}(${c})`,I=(0,t._)`(typeof ${v} == "function" ? ${E} : ${v}.test(${c}))`;return(0,t._)`${v} && ${v} !== true && ${h} === ${a} && !${I}`}}function f(){const d=S.formats[u];if(!d){_();return}if(d===!0)return;const[i,h,v]=g(d);i===a&&n.pass(E());function _(){if(b.strictSchema===!1){S.logger.warn(I());return}throw new Error(I());function I(){return`unknown format "${u}" ignored in schema at path "${w}"`}}function g(I){const M=I instanceof RegExp?(0,t.regexpCode)(I):b.code.formats?(0,t._)`${b.code.formats}${(0,t.getProperty)(u)}`:void 0,F=s.scopeValue("formats",{key:u,ref:I,code:M});return typeof I=="object"&&!(I instanceof RegExp)?[I.type||"string",I.validate,(0,t._)`${F}.validate`]:["string",I,F]}function E(){if(typeof d=="object"&&!(d instanceof RegExp)&&d.async){if(!$.$async)throw new Error("async format in sync schema");return(0,t._)`await ${v}(${c})`}return typeof h=="function"?(0,t._)`${v}(${c})`:(0,t._)`${v}.test(${c})`}}}};return hr.default=r,hr}var bs;function So(){if(bs)return fr;bs=1,Object.defineProperty(fr,"__esModule",{value:!0});const e=[Eo().default];return fr.default=e,fr}var Ge={},$s;function Po(){return $s||($s=1,Object.defineProperty(Ge,"__esModule",{value:!0}),Ge.contentVocabulary=Ge.metadataVocabulary=void 0,Ge.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],Ge.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]),Ge}var ws;function jo(){if(ws)return Mt;ws=1,Object.defineProperty(Mt,"__esModule",{value:!0});const t=Wi(),e=co(),r=ko(),n=So(),a=Po(),s=[t.default,e.default,(0,r.default)(),n.default,a.metadataVocabulary,a.contentVocabulary];return Mt.default=s,Mt}var pr={},ht={},ks;function Oo(){if(ks)return ht;ks=1,Object.defineProperty(ht,"__esModule",{value:!0}),ht.DiscrError=void 0;var t;return function(e){e.Tag="tag",e.Mapping="mapping"}(t||(ht.DiscrError=t={})),ht}var Es;function To(){if(Es)return pr;Es=1,Object.defineProperty(pr,"__esModule",{value:!0});const t=oe(),e=Oo(),r=rn(),n=Nr(),a=le(),c={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:o,tagName:u}})=>o===e.DiscrError.Tag?`tag "${u}" must be string`:`value of tag "${u}" must be in oneOf`,params:({params:{discrError:o,tag:u,tagName:p}})=>(0,t._)`{error: ${o}, tag: ${p}, tagValue: ${u}}`},code(o){const{gen:u,data:p,schema:m,parentSchema:b,it:w}=o,{oneOf:$}=b;if(!w.opts.discriminator)throw new Error("discriminator: requires discriminator option");const S=m.propertyName;if(typeof S!="string")throw new Error("discriminator: requires propertyName");if(m.mapping)throw new Error("discriminator: mapping is not supported");if(!$)throw new Error("discriminator: requires oneOf keyword");const y=u.let("valid",!1),f=u.const("tag",(0,t._)`${p}${(0,t.getProperty)(S)}`);u.if((0,t._)`typeof ${f} == "string"`,()=>d(),()=>o.error(!1,{discrError:e.DiscrError.Tag,tag:f,tagName:S})),o.ok(y);function d(){const v=h();u.if(!1);for(const _ in v)u.elseIf((0,t._)`${f} === ${_}`),u.assign(y,i(v[_]));u.else(),o.error(!1,{discrError:e.DiscrError.Mapping,tag:f,tagName:S}),u.endIf()}function i(v){const _=u.name("valid"),g=o.subschema({keyword:"oneOf",schemaProp:v},_);return o.mergeEvaluated(g,t.Name),_}function h(){var v;const _={},g=I(b);let E=!0;for(let K=0;K<$.length;K++){let ee=$[K];if(ee?.$ref&&!(0,a.schemaHasRulesButRef)(ee,w.self.RULES)){const ce=ee.$ref;if(ee=r.resolveRef.call(w.self,w.schemaEnv.root,w.baseId,ce),ee instanceof r.SchemaEnv&&(ee=ee.schema),ee===void 0)throw new n.default(w.opts.uriResolver,w.baseId,ce)}const Y=(v=ee?.properties)===null||v===void 0?void 0:v[S];if(typeof Y!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${S}"`);E=E&&(g||I(ee)),M(Y,K)}if(!E)throw new Error(`discriminator: "${S}" must be required`);return _;function I({required:K}){return Array.isArray(K)&&K.includes(S)}function M(K,ee){if(K.const)F(K.const,ee);else if(K.enum)for(const Y of K.enum)F(Y,ee);else throw new Error(`discriminator: "properties/${S}" must have "const" or "enum"`)}function F(K,ee){if(typeof K!="string"||K in _)throw new Error(`discriminator: "${S}" values must be unique strings`);_[K]=ee}}}};return pr.default=c,pr}const No="http://json-schema.org/draft-07/schema#",Io="http://json-schema.org/draft-07/schema#",Ro="Core schema meta-schema",Co={schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},Ao=["object","boolean"],xo={$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}};var Mo={$schema:No,$id:Io,title:Ro,definitions:Co,type:Ao,properties:xo,default:!0},Ss;function qo(){return Ss||(Ss=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv=void 0;const r=Bi(),n=jo(),a=To(),s=Mo,c=["/properties"],o="http://json-schema.org/draft-07/schema";class u extends r.default{_addVocabularies(){super._addVocabularies(),n.default.forEach(S=>this.addVocabulary(S)),this.opts.discriminator&&this.addKeyword(a.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const S=this.opts.$data?this.$dataMetaSchema(s,c):s;this.addMetaSchema(S,o,!1),this.refs["http://json-schema.org/schema"]=o}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(o)?o:void 0)}}e.Ajv=u,t.exports=e=u,t.exports.Ajv=u,Object.defineProperty(e,"__esModule",{value:!0}),e.default=u;var p=Tr();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return p.KeywordCxt}});var m=oe();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return m._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return m.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return m.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return m.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return m.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return m.CodeGen}});var b=tn();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return b.default}});var w=Nr();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return w.default}})}(It,It.exports)),It.exports}var ea=qo();new ea.Ajv({strict:!1});function Do(t){return"source"in t}const Ps=en({name:"input-resolver",getNodeId(t){return t.kind==="hub"?`hub:${t.hub.id}`:`instance:${t.instance.id}`},getNodeDependencies(t){const e=[];if(t.kind==="hub"){for(const r of t.hub.inputs??[])e.push(`instance:${r.instanceId}`);for(const r of t.hub.injectionInputs??[])e.push(`hub:${r.hubId}`);return e}for(const r of Object.values(t.instance.inputs??{}))for(const n of r)e.push(`instance:${n.instanceId}`);for(const r of Object.values(t.instance.hubInputs??{}))for(const n of r)e.push(`hub:${n.hubId}`);for(const r of t.instance.injectionInputs??[])e.push(`hub:${r.hubId}`);return e},process(t,e,r){const n=b=>{const w=e.get(`hub:${b.hubId}`);if(!w)return{resolvedInputs:[]};if(w.kind!=="hub")throw new Error("Expected hub node");return w},a=b=>{const w=e.get(`instance:${b.instanceId}`);if(!w)return{component:null,resolvedInputs:[],resolvedOutputs:[]};if(w.kind!=="instance")throw new Error("Expected instance node");return{component:w.component,resolvedInputs:w.resolvedInputs[b.output]??[],resolvedOutputs:w.resolvedOutputs?.[b.output]}};if(t.kind==="hub"){const b=new Map,w=$=>{b.set(`${$.input.instanceId}:${$.input.output}`,$)};for(const $ of t.hub.inputs??[]){const{component:S}=a($),y=S?.outputs[$.output];if(!y){r.warn({msg:"output not found in the component",input:$,component:S});continue}w({input:$,type:y.type})}for(const $ of t.hub.injectionInputs??[]){const{resolvedInputs:S}=n($);for(const y of S)w(y)}return{kind:"hub",resolvedInputs:Array.from(b.values())}}if(t.instance.resolvedInputs)return{kind:"instance",component:t.component,resolvedInputs:vi(t.instance.resolvedInputs,(b,w)=>{const $=t.component.inputs[w];return $?b.map(S=>({input:S,type:$.type})):(r.warn({msg:"input not found in the component",inputName:w,component:t.component}),[])}),resolvedOutputs:t.instance.resolvedOutputs??{},resolvedInjectionInputs:[],matchedInjectionInputs:[]};const s=new Map,c=(b,w)=>{let $=s.get(b);$||($=new Map,s.set(b,$)),$.set(`${w.input.instanceId}:${w.input.output}`,w)},o=(b,w)=>{const $=t.component.inputs[b];if(!$){r.warn({msg:"input not found in the component",input:w,component:t.component});return}const{component:S,resolvedOutputs:y}=a(w);if(!S){r.warn({instanceId:t.instance.id,input:w},"no output found for the input");return}if(Do(S)){c(b,{input:w,type:$.type});return}if(y)for(const f of y)c(b,{input:f,type:$.type});else c(b,{input:w,type:$.type})};for(const[b,w]of Object.entries(t.instance.inputs??{}))for(const $ of w)o(b,$);const u=new Map,p=new Map;for(const b of t.instance.injectionInputs??[]){const{resolvedInputs:w}=n(b);for(const $ of w)u.set(`${$.input.instanceId}:${$.input.output}`,$)}for(const[b,w]of Object.entries(t.component.inputs??{})){const $=new Map(u),S=t.instance.hubInputs?.[b]??[];for(const y of S){const{resolvedInputs:f}=n(y);for(const d of f)$.set(`${d.input.instanceId}:${d.input.output}`,d)}for(const y of $.values())if(y.type===w.type){o(b,y.input);const f=`${y.input.instanceId}:${y.input.output}`;u.has(f)&&p.set(f,y)}}const m=_i(Array.from(s.entries()).map(([b,w])=>[b,Array.from(w.values())]));return{kind:"instance",component:t.component,resolvedInputs:m,resolvedOutputs:t.instance.resolvedOutputs,resolvedInjectionInputs:Array.from(u.values()),matchedInjectionInputs:Array.from(p.values())}}}),Vo=t=>{const e=new DataView(t);let r="";for(let n=0;n<e.byteLength;n+=4)r+=e.getUint32(n).toString(16).padStart(8,"0");return r},zo=t=>async(e,{outputFormat:r="hex"}={})=>{typeof e=="string"&&(e=new globalThis.TextEncoder().encode(e));const n=await globalThis.crypto.subtle.digest(t,e);return r==="hex"?Vo(n):n},Zo=zo("SHA-256"),js=en({name:"input-hash-resolver",getNodeId:t=>t.instance.id,getNodeDependencies({resolvedInputs:t}){const e=[];for(const r of Object.values(t??{}))for(const n of r)e.push(n.input.instanceId);return e},async process({instance:t,component:e,resolvedInputs:r,sourceHash:n,state:a},s){let c=e.definitionHash+JSON.stringify(t.args??{});n&&(c+=n);const o=Object.entries(r).sort(([u],[p])=>u.localeCompare(p));for(const[u,p]of o){if(Object.keys(p).length===0)continue;c+=u;const m=p.map(b=>b.input.instanceId);m.sort();for(const b of m){const w=s.get(b);w&&(c+=w.inputHash,c+=w.outputHash)}}return{inputHash:await Zo(c),outputHash:a?.outputHash??""}}}),Os=en({name:"validation-resolver",getNodeId:t=>t.instance.id,getNodeDependencies({resolvedInputs:t}){const e=[];for(const r of Object.values(t))for(const n of r)e.push(n.input.instanceId);return e},process({instance:t,component:e,resolvedInputs:r},n,a){const s=new ea.Ajv({strict:!1});a.debug({instanceId:t.id},"validating instance");for(const[c,o]of Object.entries(e.args))if(!(!o.required&&!t.args?.[c])&&!s.validate(o.schema,t.args?.[c]))return a.debug({instanceId:t.id,argumentName:c},"invalid argument"),{status:"invalid-args",errorText:s.errorsText()};for(const c of Object.values(r))for(const o of c)if(n.get(o.input.instanceId)?.status!=="ok")return{status:"invalid-inputs",errorText:`instance "${o.input.instanceId}" is invalid`};for(const[c,o]of Object.entries(e.inputs))if(!(!o.required||o.multiple)&&(!r[c]||!r[c].length))return{status:"missing-inputs",errorText:`input "${c}" is missing`};return{status:"ok"}}}),Lo={[Ps.factoryName]:Ps,[js.factoryName]:js,[Os.factoryName]:Os};N.object({id:N.string().nanoid(),projectId:N.string(),instanceId:N.string(),terminalName:N.string(),terminalTitle:N.string(),createdAt:N.coerce.date(),finishedAt:N.coerce.date().optional()});var pt={exports:{}},Hr,Ts;function Uo(){if(Ts)return Hr;Ts=1;function t(r){try{return JSON.stringify(r)}catch{return'"[Circular]"'}}Hr=e;function e(r,n,a){var s=a&&a.stringify||t,c=1;if(typeof r=="object"&&r!==null){var o=n.length+c;if(o===1)return r;var u=new Array(o);u[0]=s(r);for(var p=1;p<o;p++)u[p]=s(n[p]);return u.join(" ")}if(typeof r!="string")return r;var m=n.length;if(m===0)return r;for(var b="",w=1-c,$=-1,S=r&&r.length||0,y=0;y<S;){if(r.charCodeAt(y)===37&&y+1<S){switch($=$>-1?$:0,r.charCodeAt(y+1)){case 100:case 102:if(w>=m||n[w]==null)break;$<y&&(b+=r.slice($,y)),b+=Number(n[w]),$=y+2,y++;break;case 105:if(w>=m||n[w]==null)break;$<y&&(b+=r.slice($,y)),b+=Math.floor(Number(n[w])),$=y+2,y++;break;case 79:case 111:case 106:if(w>=m||n[w]===void 0)break;$<y&&(b+=r.slice($,y));var f=typeof n[w];if(f==="string"){b+="'"+n[w]+"'",$=y+2,y++;break}if(f==="function"){b+=n[w].name||"<anonymous>",$=y+2,y++;break}b+=s(n[w]),$=y+2,y++;break;case 115:if(w>=m)break;$<y&&(b+=r.slice($,y)),b+=String(n[w]),$=y+2,y++;break;case 37:$<y&&(b+=r.slice($,y)),b+="%",$=y+2,y++,w--;break}++w}++y}return $===-1?r:($<S&&(b+=r.slice($)),b)}return Hr}var Ns;function Fo(){if(Ns)return pt.exports;Ns=1;const t=Uo();pt.exports=m;const e=ce().console||{},r={mapHttpRequest:E,mapHttpResponse:E,wrapRequestSerializer:I,wrapResponseSerializer:I,wrapErrorSerializer:I,req:E,res:E,err:_,errWithCause:_};function n(R,Z){return R==="silent"?1/0:Z.levels.values[R]}const a=Symbol("pino.logFuncs"),s=Symbol("pino.hierarchy"),c={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function o(R,Z){const W={logger:Z,parent:R[s]};Z[s]=W}function u(R,Z,W){const J={};Z.forEach(se=>{J[se]=W[se]?W[se]:e[se]||e[c[se]||"log"]||M}),R[a]=J}function p(R,Z){return Array.isArray(R)?R.filter(function(J){return J!=="!stdSerializers.err"}):R===!0?Object.keys(Z):!1}function m(R){R=R||{},R.browser=R.browser||{};const Z=R.browser.transmit;if(Z&&typeof Z.send!="function")throw Error("pino: transmit option must have a send function");const W=R.browser.write||e;R.browser.write&&(R.browser.asObject=!0);const J=R.serializers||{},se=p(R.browser.serialize,J);let q=R.browser.serialize;Array.isArray(R.browser.serialize)&&R.browser.serialize.indexOf("!stdSerializers.err")>-1&&(q=!1);const j=Object.keys(R.customLevels||{}),A=["error","fatal","warn","info","debug","trace"].concat(j);typeof W=="function"&&A.forEach(function(te){W[te]=W}),(R.enabled===!1||R.browser.disabled)&&(R.level="silent");const O=R.level||"info",l=Object.create(W);l.log||(l.log=M),u(l,A,W),o({},l),Object.defineProperty(l,"levelVal",{get:C}),Object.defineProperty(l,"level",{get:U,set:H});const k={transmit:Z,serialize:se,asObject:R.browser.asObject,formatters:R.browser.formatters,levels:A,timestamp:g(R),messageKey:R.messageKey||"msg",onChild:R.onChild||M};l.levels=b(R),l.level=O,l.setMaxListeners=l.getMaxListeners=l.emit=l.addListener=l.on=l.prependListener=l.once=l.prependOnceListener=l.removeListener=l.removeAllListeners=l.listeners=l.listenerCount=l.eventNames=l.write=l.flush=M,l.serializers=J,l._serialize=se,l._stdErrSerialize=q,l.child=function(...te){return ue.call(this,k,...te)},Z&&(l._logEvent=v());function C(){return n(this.level,this)}function U(){return this._level}function H(te){if(te!=="silent"&&!this.levels.values[te])throw Error("unknown level "+te);this._level=te,S(this,k,l,"error"),S(this,k,l,"fatal"),S(this,k,l,"warn"),S(this,k,l,"info"),S(this,k,l,"debug"),S(this,k,l,"trace"),j.forEach(P=>{S(this,k,l,P)})}function ue(te,P,T){if(!P)throw new Error("missing bindings for child Pino");T=T||{},se&&P.serializers&&(T.serializers=P.serializers);const x=T.serializers;if(se&&x){var V=Object.assign({},J,x),B=R.browser.serialize===!0?Object.keys(V):se;delete P.serializers,i([P],B,V,this._stdErrSerialize)}function ne(ve){this._childLevel=(ve._childLevel|0)+1,this.bindings=P,V&&(this.serializers=V,this._serialize=B),Z&&(this._logEvent=v([].concat(ve._logEvent.bindings,P)))}ne.prototype=this;const he=new ne(this);return o(this,he),he.child=function(...ve){return ue.call(this,te,...ve)},he.level=T.level||this.level,te.onChild(he),he}return l}function b(R){const Z=R.customLevels||{},W=Object.assign({},m.levels.values,Z),J=Object.assign({},m.levels.labels,w(Z));return{values:W,labels:J}}function w(R){const Z={};return Object.keys(R).forEach(function(W){Z[R[W]]=W}),Z}m.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}},m.stdSerializers=r,m.stdTimeFunctions=Object.assign({},{nullTime:F,epochTime:K,unixTime:ee,isoTime:Y});function $(R){const Z=[];R.bindings&&Z.push(R.bindings);let W=R[s];for(;W.parent;)W=W.parent,W.logger.bindings&&Z.push(W.logger.bindings);return Z.reverse()}function S(R,Z,W,J){if(Object.defineProperty(R,J,{value:n(R.level,W)>n(J,W)?M:W[a][J],writable:!0,enumerable:!0,configurable:!0}),R[J]===M){if(!Z.transmit)return;const q=Z.transmit.level||R.level,j=n(q,W);if(n(J,W)<j)return}R[J]=f(R,Z,W,J);const se=$(R);se.length!==0&&(R[J]=y(se,R[J]))}function y(R,Z){return function(){return Z.apply(this,[...R,...arguments])}}function f(R,Z,W,J){return function(se){return function(){const j=Z.timestamp(),A=new Array(arguments.length),O=Object.getPrototypeOf&&Object.getPrototypeOf(this)===e?e:this;for(var l=0;l<A.length;l++)A[l]=arguments[l];var k=!1;if(Z.serialize&&(i(A,this._serialize,this.serializers,this._stdErrSerialize),k=!0),Z.asObject||Z.formatters?se.call(O,d(this,J,A,j,Z)):se.apply(O,A),Z.transmit){const C=Z.transmit.level||R._level,U=n(C,W),H=n(J,W);if(H<U)return;h(this,{ts:j,methodLevel:J,methodValue:H,transmitValue:W.levels.values[Z.transmit.level||R._level],send:Z.transmit.send,val:n(R._level,W)},A,k)}}}(R[a][J])}function d(R,Z,W,J,se){const{level:q,log:j=U=>U}=se.formatters||{},A=W.slice();let O=A[0];const l={};if(J&&(l.time=J),q){const U=q(Z,R.levels.values[Z]);Object.assign(l,U)}else l.level=R.levels.values[Z];let k=(R._childLevel|0)+1;if(k<1&&(k=1),O!==null&&typeof O=="object"){for(;k--&&typeof A[0]=="object";)Object.assign(l,A.shift());O=A.length?t(A.shift(),A):void 0}else typeof O=="string"&&(O=t(A.shift(),A));return O!==void 0&&(l[se.messageKey]=O),j(l)}function i(R,Z,W,J){for(const se in R)if(J&&R[se]instanceof Error)R[se]=m.stdSerializers.err(R[se]);else if(typeof R[se]=="object"&&!Array.isArray(R[se])&&Z)for(const q in R[se])Z.indexOf(q)>-1&&q in W&&(R[se][q]=W[q](R[se][q]))}function h(R,Z,W,J=!1){const se=Z.send,q=Z.ts,j=Z.methodLevel,A=Z.methodValue,O=Z.val,l=R._logEvent.bindings;J||i(W,R._serialize||Object.keys(R.serializers),R.serializers,R._stdErrSerialize===void 0?!0:R._stdErrSerialize),R._logEvent.ts=q,R._logEvent.messages=W.filter(function(k){return l.indexOf(k)===-1}),R._logEvent.level.label=j,R._logEvent.level.value=A,se(j,R._logEvent,O),R._logEvent=v(l)}function v(R){return{ts:0,messages:[],bindings:R||[],level:{label:"",value:0}}}function _(R){const Z={type:R.constructor.name,msg:R.message,stack:R.stack};for(const W in R)Z[W]===void 0&&(Z[W]=R[W]);return Z}function g(R){return typeof R.timestamp=="function"?R.timestamp:R.timestamp===!1?F:K}function E(){return{}}function I(R){return R}function M(){}function F(){return!1}function K(){return Date.now()}function ee(){return Math.round(Date.now()/1e3)}function Y(){return new Date(Date.now()).toISOString()}function ce(){function R(Z){return typeof Z<"u"&&Z}try{return typeof globalThis<"u"||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch{return R(self)||R(window)||R(this)||{}}}return pt.exports.default=m,pt.exports.pino=m,pt.exports}var Ko=Fo();const Sr=t=>{self.postMessage(t)},Xe=new Map,Ho=(t,e,r)=>{const n=Lo[r];if(!n)throw new Error(`Unknown resolver type: ${r}`);if(Xe.has(e)){console.warn(`state with id "${e}" already exists`);return}const a=Ko.pino({level:"info"}).child({stateId:e,factoryName:r}),s=new Map,o=n(t,a,{promiseCache:s,setDependencies(u,p){Sr({type:"dependencies",stateId:e,nodeId:u,dependencies:p})},setOutput(u,p){Sr({type:"output",stateId:e,nodeId:u,value:p})}});Xe.set(e,{nodes:t,resolver:o,promiseCache:s,logger:a})},Bo=(t,e,r)=>{const n=Xe.get(t);if(!n)throw new Error(`Unknown state: ${t}`);n.nodes.set(e,r),n.promiseCache.delete(e)},Go=(t,e)=>{const r=Xe.get(t);if(!r)throw new Error(`Unknown state: ${t}`);r.nodes.delete(e),r.promiseCache.delete(e)},Jo=(t,e)=>{const r=Xe.get(t);if(!r)throw new Error(`Unknown state: ${t}`);r.promiseCache.delete(e)},Wo=async(t,e)=>{const r=Xe.get(t);if(!r)throw new Error(`Unknown state: ${t}`);r.logger.debug({nodes:r.nodes,nodeIds:e},"processing nodes");for(const n of e)r.resolver(n)},Yo=t=>{Xe.delete(t)};self.onmessage=t=>{const e=t.data;switch(e.type){case"create-state":{const r=new Map(Object.entries(e.nodes));Ho(r,e.stateId,e.factoryName),Sr({type:"state-ready",stateId:e.stateId});break}case"update-input":{Bo(e.stateId,e.nodeId,e.node);break}case"delete-input":{Go(e.stateId,e.nodeId);break}case"invalidate":{Jo(e.stateId,e.nodeId);break}case"process":{Wo(e.stateId,e.nodeIds);break}case"dispose-state":{Yo(e.stateId);break}}};Sr({type:"ready"});
@@ -1,4 +1,4 @@
1
- import{H as l}from"./hcK6w2WN.js";/*!-----------------------------------------------------------------------------
1
+ import{H as l}from"./CrxtFyJB.js";/*!-----------------------------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
3
  * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
4
4
  * Released under the MIT license
@@ -1,4 +1,4 @@
1
- import{I as L,H as O}from"./hcK6w2WN.js";/*!-----------------------------------------------------------------------------
1
+ import{I as L,H as O}from"./CrxtFyJB.js";/*!-----------------------------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
3
  * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
4
4
  * Released under the MIT license
@@ -1,4 +1,4 @@
1
- import{H as f}from"./hcK6w2WN.js";/*!-----------------------------------------------------------------------------
1
+ import{H as f}from"./CrxtFyJB.js";/*!-----------------------------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
3
  * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
4
4
  * Released under the MIT license