@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
@@ -1 +1 @@
1
- {"name":"@highstate/designer-prod","version":"0.7.11","type":"module","private":true,"dependencies":{"@babel/parser":"7.27.0","@trpc/server":"11.0.1","@vue/compiler-core":"3.5.13","@vue/compiler-dom":"3.5.13","@vue/compiler-ssr":"3.5.13","@vue/reactivity":"3.5.13","@vue/runtime-core":"3.5.13","@vue/runtime-dom":"3.5.13","@vue/server-renderer":"3.5.13","@vue/shared":"3.5.13","devalue":"5.1.1","entities":"4.5.0","estree-walker":"2.0.2","hookable":"5.5.3","source-map-js":"1.2.1","ufo":"1.5.4","unhead":"2.0.2","vue":"3.5.13","vue-bundle-renderer":"2.1.1","ws":"8.18.1","zod":"3.24.2"}}
1
+ {"name":"@highstate/designer-prod","version":"0.9.0","type":"module","private":true,"dependencies":{"@babel/parser":"7.27.0","@trpc/server":"11.0.1","@vue/compiler-core":"3.5.13","@vue/compiler-dom":"3.5.13","@vue/compiler-ssr":"3.5.13","@vue/reactivity":"3.5.13","@vue/runtime-core":"3.5.13","@vue/runtime-dom":"3.5.13","@vue/server-renderer":"3.5.13","@vue/shared":"3.5.13","devalue":"5.1.1","entities":"4.5.0","estree-walker":"2.0.2","hookable":"5.5.3","source-map-js":"1.2.1","ufo":"1.5.4","unhead":"2.0.2","vue":"3.5.13","vue-bundle-renderer":"2.1.1","ws":"8.18.1","zod":"3.24.2"}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@highstate/designer",
3
- "version": "0.8.0",
3
+ "version": "0.9.1",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
@@ -20,8 +20,8 @@
20
20
  "@codemirror/theme-one-dark": "^6.1.2",
21
21
  "@dagrejs/dagre": "^1.1.4",
22
22
  "@guolao/vue-monaco-editor": "^1.5.5",
23
- "@highstate/backend": "^0.8.0",
24
- "@highstate/contract": "^0.8.0",
23
+ "@highstate/backend": "^0.9.1",
24
+ "@highstate/contract": "^0.9.1",
25
25
  "@iconify/vue": "^4.1.2",
26
26
  "@mdi/font": "5",
27
27
  "@nuxt/eslint": "0.7.2",
@@ -77,5 +77,5 @@
77
77
  "dependencies": {
78
78
  "monaco-yaml": "^5.3.1"
79
79
  },
80
- "gitHead": "8590eea089a016c9b4b797299fc94ddc9afe10ba"
80
+ "gitHead": "2f9fdd9542fbdd11d4337fb59ac4f5728535fa0c"
81
81
  }
@@ -1 +0,0 @@
1
- {"id":"b669e4f8-ac13-4649-8aa2-1ae645243b1e","timestamp":1745512635426,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}
@@ -1,8 +0,0 @@
1
- var ne;(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})(ne||(ne={}));var Kr;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(Kr||(Kr={}));const z=ne.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),qe=t=>{switch(typeof t){case"undefined":return z.undefined;case"string":return z.string;case"number":return isNaN(t)?z.nan:z.number;case"boolean":return z.boolean;case"function":return z.function;case"bigint":return z.bigint;case"symbol":return z.symbol;case"object":return Array.isArray(t)?z.array:t===null?z.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?z.promise:typeof Map<"u"&&t instanceof Map?z.map:typeof Set<"u"&&t instanceof Set?z.set:typeof Date<"u"&&t instanceof Date?z.date:z.object;default:return z.unknown}},x=ne.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"]),Xs=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class $e 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 h=c.path[u];u===c.path.length-1?(o[h]=o[h]||{_errors:[]},o[h]._errors.push(r(c))):o[h]=o[h]||{_errors:[]},o=o[h],u++}}};return a(this),n}static assert(e){if(!(e instanceof $e))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ne.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()}}$e.create=t=>new $e(t);const ot=(t,e)=>{let r;switch(t.code){case x.invalid_type:t.received===z.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case x.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,ne.jsonStringifyReplacer)}`;break;case x.unrecognized_keys:r=`Unrecognized key(s) in object: ${ne.joinValues(t.keys,", ")}`;break;case x.invalid_union:r="Invalid input";break;case x.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${ne.joinValues(t.options)}`;break;case x.invalid_enum_value:r=`Invalid enum value. Expected ${ne.joinValues(t.options)}, received '${t.received}'`;break;case x.invalid_arguments:r="Invalid function arguments";break;case x.invalid_return_type:r="Invalid function return type";break;case x.invalid_date:r="Invalid date";break;case x.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}"`:ne.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case x.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 x.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 x.custom:r="Invalid input";break;case x.invalid_intersection_types:r="Intersection results could not be merged";break;case x.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case x.not_finite:r="Number must be finite";break;default:r=e.defaultError,ne.assertNever(t)}return{message:r}};let Ns=ot;function Qs(t){Ns=t}function pr(){return Ns}const mr=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(h=>!!h).slice().reverse();for(const h of u)o=h(c,{data:e,defaultError:o}).message;return{...a,path:s,message:o}},ea=[];function V(t,e){const r=pr(),n=mr({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 pe{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 J;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 pe.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 J;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 J=Object.freeze({status:"aborted"}),st=t=>({status:"dirty",value:t}),ye=t=>({status:"valid",value:t}),Hr=t=>t.status==="aborted",Gr=t=>t.status==="dirty",We=t=>t.status==="valid",yt=t=>typeof Promise<"u"&&t instanceof Promise;function yr(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 Is(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 L;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(L||(L={}));var pt,mt;class Te{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 sn=(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 $e(t.common.issues);return this._error=r,this._error}}};function Y(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,h;const{message:p}=t;return c.code==="invalid_enum_value"?{message:p??o.defaultError}:typeof o.data>"u"?{message:(u=p??n)!==null&&u!==void 0?u:o.defaultError}:c.code!=="invalid_type"?{message:o.defaultError}:{message:(h=p??r)!==null&&h!==void 0?h:o.defaultError}},description:a}}class X{get description(){return this._def.description}_getType(e){return qe(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:qe(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new pe,ctx:{common:e.parent.common,data:e.data,parsedType:qe(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const r=this._parse(e);if(yt(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:qe(e)},s=this._parseSync({data:e,path:a.path,parent:a});return sn(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:qe(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:qe(e)},a=this._parse({data:e,path:n.path,parent:n}),s=await(yt(a)?a:Promise.resolve(a));return sn(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:x.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 Pe({schema:this,typeName:B.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 je.create(this,this._def)}nullable(){return Fe.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ee.create(this)}promise(){return ut.create(this,this._def)}or(e){return $t.create([this,e],this._def)}and(e){return bt.create(this,e,this._def)}transform(e){return new Pe({...Y(this._def),schema:this,typeName:B.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const r=typeof e=="function"?e:()=>e;return new Pt({...Y(this._def),innerType:this,defaultValue:r,typeName:B.ZodDefault})}brand(){return new Jr({typeName:B.ZodBranded,type:this,...Y(this._def)})}catch(e){const r=typeof e=="function"?e:()=>e;return new Nt({...Y(this._def),innerType:this,catchValue:r,typeName:B.ZodCatch})}describe(e){const r=this.constructor;return new r({...this._def,description:e})}pipe(e){return jt.create(this,e)}readonly(){return It.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const ta=/^c[^\s-]{8,}$/i,ra=/^[0-9a-z]+$/,na=/^[0-9A-HJKMNP-TV-Z]{26}$/i,sa=/^[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,aa=/^[a-z0-9_-]{21}$/i,ia=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,oa=/^[-+]?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)?)??$/,ca=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,ua="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Cr;const da=/^(?:(?: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])$/,la=/^(?:(?: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])$/,fa=/^(([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]))$/,ha=/^(([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])$/,pa=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,ma=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,js="((\\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])))",ya=new RegExp(`^${js}$`);function Ts(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 va(t){return new RegExp(`^${Ts(t)}$`)}function Os(t){let e=`${js}T${Ts(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 ga(t,e){return!!((e==="v4"||!e)&&da.test(t)||(e==="v6"||!e)&&fa.test(t))}function _a(t,e){if(!ia.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 $a(t,e){return!!((e==="v4"||!e)&&la.test(t)||(e==="v6"||!e)&&ha.test(t))}class Se extends X{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==z.string){const s=this._getOrReturnCtx(e);return V(s,{code:x.invalid_type,expected:z.string,received:s.parsedType}),J}const n=new pe;let a;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(a=this._getOrReturnCtx(e,a),V(a,{code:x.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),V(a,{code:x.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?V(a,{code:x.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):o&&V(a,{code:x.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")ca.test(e.data)||(a=this._getOrReturnCtx(e,a),V(a,{validation:"email",code:x.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")Cr||(Cr=new RegExp(ua,"u")),Cr.test(e.data)||(a=this._getOrReturnCtx(e,a),V(a,{validation:"emoji",code:x.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")sa.test(e.data)||(a=this._getOrReturnCtx(e,a),V(a,{validation:"uuid",code:x.invalid_string,message:s.message}),n.dirty());else if(s.kind==="nanoid")aa.test(e.data)||(a=this._getOrReturnCtx(e,a),V(a,{validation:"nanoid",code:x.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")ta.test(e.data)||(a=this._getOrReturnCtx(e,a),V(a,{validation:"cuid",code:x.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")ra.test(e.data)||(a=this._getOrReturnCtx(e,a),V(a,{validation:"cuid2",code:x.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")na.test(e.data)||(a=this._getOrReturnCtx(e,a),V(a,{validation:"ulid",code:x.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{a=this._getOrReturnCtx(e,a),V(a,{validation:"url",code:x.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),V(a,{validation:"regex",code:x.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),V(a,{code:x.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),V(a,{code:x.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(a=this._getOrReturnCtx(e,a),V(a,{code:x.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?Os(s).test(e.data)||(a=this._getOrReturnCtx(e,a),V(a,{code:x.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="date"?ya.test(e.data)||(a=this._getOrReturnCtx(e,a),V(a,{code:x.invalid_string,validation:"date",message:s.message}),n.dirty()):s.kind==="time"?va(s).test(e.data)||(a=this._getOrReturnCtx(e,a),V(a,{code:x.invalid_string,validation:"time",message:s.message}),n.dirty()):s.kind==="duration"?oa.test(e.data)||(a=this._getOrReturnCtx(e,a),V(a,{validation:"duration",code:x.invalid_string,message:s.message}),n.dirty()):s.kind==="ip"?ga(e.data,s.version)||(a=this._getOrReturnCtx(e,a),V(a,{validation:"ip",code:x.invalid_string,message:s.message}),n.dirty()):s.kind==="jwt"?_a(e.data,s.alg)||(a=this._getOrReturnCtx(e,a),V(a,{validation:"jwt",code:x.invalid_string,message:s.message}),n.dirty()):s.kind==="cidr"?$a(e.data,s.version)||(a=this._getOrReturnCtx(e,a),V(a,{validation:"cidr",code:x.invalid_string,message:s.message}),n.dirty()):s.kind==="base64"?pa.test(e.data)||(a=this._getOrReturnCtx(e,a),V(a,{validation:"base64",code:x.invalid_string,message:s.message}),n.dirty()):s.kind==="base64url"?ma.test(e.data)||(a=this._getOrReturnCtx(e,a),V(a,{validation:"base64url",code:x.invalid_string,message:s.message}),n.dirty()):ne.assertNever(s);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(a=>e.test(a),{validation:r,code:x.invalid_string,...L.errToObj(n)})}_addCheck(e){return new Se({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...L.errToObj(e)})}url(e){return this._addCheck({kind:"url",...L.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...L.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...L.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...L.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...L.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...L.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...L.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...L.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...L.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...L.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...L.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...L.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,...L.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,...L.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...L.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...L.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...L.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...L.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...L.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...L.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...L.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...L.errToObj(r)})}nonempty(e){return this.min(1,L.errToObj(e))}trim(){return new Se({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Se({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Se({...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}}Se.create=t=>{var e;return new Se({checks:[],typeName:B.ZodString,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...Y(t)})};function ba(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 X{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)!==z.number){const s=this._getOrReturnCtx(e);return V(s,{code:x.invalid_type,expected:z.number,received:s.parsedType}),J}let n;const a=new pe;for(const s of this._def.checks)s.kind==="int"?ne.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),V(n,{code:x.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),V(n,{code:x.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),V(n,{code:x.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):s.kind==="multipleOf"?ba(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),V(n,{code:x.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),V(n,{code:x.not_finite,message:s.message}),a.dirty()):ne.assertNever(s);return{status:a.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,L.toString(r))}gt(e,r){return this.setLimit("min",e,!1,L.toString(r))}lte(e,r){return this.setLimit("max",e,!0,L.toString(r))}lt(e,r){return this.setLimit("max",e,!1,L.toString(r))}setLimit(e,r,n,a){return new Ze({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:L.toString(a)}]})}_addCheck(e){return new Ze({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:L.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:L.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:L.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:L.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:L.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:L.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:L.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:L.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:L.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"&&ne.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:B.ZodNumber,coerce:t?.coerce||!1,...Y(t)});class Ue extends X{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)!==z.bigint)return this._getInvalidInput(e);let n;const a=new pe;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),V(n,{code:x.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),V(n,{code:x.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),V(n,{code:x.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):ne.assertNever(s);return{status:a.value,value:e.data}}_getInvalidInput(e){const r=this._getOrReturnCtx(e);return V(r,{code:x.invalid_type,expected:z.bigint,received:r.parsedType}),J}gte(e,r){return this.setLimit("min",e,!0,L.toString(r))}gt(e,r){return this.setLimit("min",e,!1,L.toString(r))}lte(e,r){return this.setLimit("max",e,!0,L.toString(r))}lt(e,r){return this.setLimit("max",e,!1,L.toString(r))}setLimit(e,r,n,a){return new Ue({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:L.toString(a)}]})}_addCheck(e){return new Ue({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:L.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:L.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:L.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:L.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:L.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}}Ue.create=t=>{var e;return new Ue({checks:[],typeName:B.ZodBigInt,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...Y(t)})};class vt extends X{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==z.boolean){const n=this._getOrReturnCtx(e);return V(n,{code:x.invalid_type,expected:z.boolean,received:n.parsedType}),J}return ye(e.data)}}vt.create=t=>new vt({typeName:B.ZodBoolean,coerce:t?.coerce||!1,...Y(t)});class Ye extends X{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==z.date){const s=this._getOrReturnCtx(e);return V(s,{code:x.invalid_type,expected:z.date,received:s.parsedType}),J}if(isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return V(s,{code:x.invalid_date}),J}const n=new pe;let a;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(a=this._getOrReturnCtx(e,a),V(a,{code:x.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),V(a,{code:x.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):ne.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:L.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:L.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:B.ZodDate,...Y(t)});class vr extends X{_parse(e){if(this._getType(e)!==z.symbol){const n=this._getOrReturnCtx(e);return V(n,{code:x.invalid_type,expected:z.symbol,received:n.parsedType}),J}return ye(e.data)}}vr.create=t=>new vr({typeName:B.ZodSymbol,...Y(t)});class gt extends X{_parse(e){if(this._getType(e)!==z.undefined){const n=this._getOrReturnCtx(e);return V(n,{code:x.invalid_type,expected:z.undefined,received:n.parsedType}),J}return ye(e.data)}}gt.create=t=>new gt({typeName:B.ZodUndefined,...Y(t)});class _t extends X{_parse(e){if(this._getType(e)!==z.null){const n=this._getOrReturnCtx(e);return V(n,{code:x.invalid_type,expected:z.null,received:n.parsedType}),J}return ye(e.data)}}_t.create=t=>new _t({typeName:B.ZodNull,...Y(t)});class ct extends X{constructor(){super(...arguments),this._any=!0}_parse(e){return ye(e.data)}}ct.create=t=>new ct({typeName:B.ZodAny,...Y(t)});class Je extends X{constructor(){super(...arguments),this._unknown=!0}_parse(e){return ye(e.data)}}Je.create=t=>new Je({typeName:B.ZodUnknown,...Y(t)});class De extends X{_parse(e){const r=this._getOrReturnCtx(e);return V(r,{code:x.invalid_type,expected:z.never,received:r.parsedType}),J}}De.create=t=>new De({typeName:B.ZodNever,...Y(t)});class gr extends X{_parse(e){if(this._getType(e)!==z.undefined){const n=this._getOrReturnCtx(e);return V(n,{code:x.invalid_type,expected:z.void,received:n.parsedType}),J}return ye(e.data)}}gr.create=t=>new gr({typeName:B.ZodVoid,...Y(t)});class Ee extends X{_parse(e){const{ctx:r,status:n}=this._processInputParams(e),a=this._def;if(r.parsedType!==z.array)return V(r,{code:x.invalid_type,expected:z.array,received:r.parsedType}),J;if(a.exactLength!==null){const c=r.data.length>a.exactLength.value,o=r.data.length<a.exactLength.value;(c||o)&&(V(r,{code:c?x.too_big:x.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&&(V(r,{code:x.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&&(V(r,{code:x.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 Te(r,c,r.path,o)))).then(c=>pe.mergeArray(n,c));const s=[...r.data].map((c,o)=>a.type._parseSync(new Te(r,c,r.path,o)));return pe.mergeArray(n,s)}get element(){return this._def.type}min(e,r){return new Ee({...this._def,minLength:{value:e,message:L.toString(r)}})}max(e,r){return new Ee({...this._def,maxLength:{value:e,message:L.toString(r)}})}length(e,r){return new Ee({...this._def,exactLength:{value:e,message:L.toString(r)}})}nonempty(e){return this.min(1,e)}}Ee.create=(t,e)=>new Ee({type:t,minLength:null,maxLength:null,exactLength:null,typeName:B.ZodArray,...Y(e)});function nt(t){if(t instanceof ue){const e={};for(const r in t.shape){const n=t.shape[r];e[r]=je.create(nt(n))}return new ue({...t._def,shape:()=>e})}else return t instanceof Ee?new Ee({...t._def,type:nt(t.element)}):t instanceof je?je.create(nt(t.unwrap())):t instanceof Fe?Fe.create(nt(t.unwrap())):t instanceof Oe?Oe.create(t.items.map(e=>nt(e))):t}class ue extends X{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=ne.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==z.object){const h=this._getOrReturnCtx(e);return V(h,{code:x.invalid_type,expected:z.object,received:h.parsedType}),J}const{status:n,ctx:a}=this._processInputParams(e),{shape:s,keys:c}=this._getCached(),o=[];if(!(this._def.catchall instanceof De&&this._def.unknownKeys==="strip"))for(const h in a.data)c.includes(h)||o.push(h);const u=[];for(const h of c){const p=s[h],$=a.data[h];u.push({key:{status:"valid",value:h},value:p._parse(new Te(a,$,a.path,h)),alwaysSet:h in a.data})}if(this._def.catchall instanceof De){const h=this._def.unknownKeys;if(h==="passthrough")for(const p of o)u.push({key:{status:"valid",value:p},value:{status:"valid",value:a.data[p]}});else if(h==="strict")o.length>0&&(V(a,{code:x.unrecognized_keys,keys:o}),n.dirty());else if(h!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const h=this._def.catchall;for(const p of o){const $=a.data[p];u.push({key:{status:"valid",value:p},value:h._parse(new Te(a,$,a.path,p)),alwaysSet:p in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const h=[];for(const p of u){const $=await p.key,w=await p.value;h.push({key:$,value:w,alwaysSet:p.alwaysSet})}return h}).then(h=>pe.mergeObjectSync(n,h)):pe.mergeObjectSync(n,u)}get shape(){return this._def.shape()}strict(e){return L.errToObj,new ue({...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=L.errToObj(e).message)!==null&&o!==void 0?o:u}:{message:u}}}:{}})}strip(){return new ue({...this._def,unknownKeys:"strip"})}passthrough(){return new ue({...this._def,unknownKeys:"passthrough"})}extend(e){return new ue({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ue({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:B.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new ue({...this._def,catchall:e})}pick(e){const r={};return ne.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new ue({...this._def,shape:()=>r})}omit(e){const r={};return ne.objectKeys(this.shape).forEach(n=>{e[n]||(r[n]=this.shape[n])}),new ue({...this._def,shape:()=>r})}deepPartial(){return nt(this)}partial(e){const r={};return ne.objectKeys(this.shape).forEach(n=>{const a=this.shape[n];e&&!e[n]?r[n]=a:r[n]=a.optional()}),new ue({...this._def,shape:()=>r})}required(e){const r={};return ne.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])r[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof je;)s=s._def.innerType;r[n]=s}}),new ue({...this._def,shape:()=>r})}keyof(){return Rs(ne.objectKeys(this.shape))}}ue.create=(t,e)=>new ue({shape:()=>t,unknownKeys:"strip",catchall:De.create(),typeName:B.ZodObject,...Y(e)});ue.strictCreate=(t,e)=>new ue({shape:()=>t,unknownKeys:"strict",catchall:De.create(),typeName:B.ZodObject,...Y(e)});ue.lazycreate=(t,e)=>new ue({shape:t,unknownKeys:"strip",catchall:De.create(),typeName:B.ZodObject,...Y(e)});class $t extends X{_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 $e(o.ctx.common.issues));return V(r,{code:x.invalid_union,unionErrors:c}),J}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 h={...r,common:{...r.common,issues:[]},parent:null},p=u._parseSync({data:r.data,path:r.path,parent:h});if(p.status==="valid")return p;p.status==="dirty"&&!s&&(s={result:p,ctx:h}),h.common.issues.length&&c.push(h.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;const o=c.map(u=>new $e(u));return V(r,{code:x.invalid_union,unionErrors:o}),J}}get options(){return this._def.options}}$t.create=(t,e)=>new $t({options:t,typeName:B.ZodUnion,...Y(e)});const Me=t=>t instanceof kt?Me(t.schema):t instanceof Pe?Me(t.innerType()):t instanceof St?[t.value]:t instanceof Le?t.options:t instanceof Et?ne.objectValues(t.enum):t instanceof Pt?Me(t._def.innerType):t instanceof gt?[void 0]:t instanceof _t?[null]:t instanceof je?[void 0,...Me(t.unwrap())]:t instanceof Fe?[null,...Me(t.unwrap())]:t instanceof Jr||t instanceof It?Me(t.unwrap()):t instanceof Nt?Me(t._def.innerType):[];class Er extends X{_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==z.object)return V(r,{code:x.invalid_type,expected:z.object,received:r.parsedType}),J;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}):(V(r,{code:x.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),J)}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=Me(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 Er({typeName:B.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:a,...Y(n)})}}function Br(t,e){const r=qe(t),n=qe(e);if(t===e)return{valid:!0,data:t};if(r===z.object&&n===z.object){const a=ne.objectKeys(e),s=ne.objectKeys(t).filter(o=>a.indexOf(o)!==-1),c={...t,...e};for(const o of s){const u=Br(t[o],e[o]);if(!u.valid)return{valid:!1};c[o]=u.data}return{valid:!0,data:c}}else if(r===z.array&&n===z.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=Br(c,o);if(!u.valid)return{valid:!1};a.push(u.data)}return{valid:!0,data:a}}else return r===z.date&&n===z.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class bt extends X{_parse(e){const{status:r,ctx:n}=this._processInputParams(e),a=(s,c)=>{if(Hr(s)||Hr(c))return J;const o=Br(s.value,c.value);return o.valid?((Gr(s)||Gr(c))&&r.dirty(),{status:r.value,value:o.data}):(V(n,{code:x.invalid_intersection_types}),J)};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}))}}bt.create=(t,e,r)=>new bt({left:t,right:e,typeName:B.ZodIntersection,...Y(r)});class Oe extends X{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==z.array)return V(n,{code:x.invalid_type,expected:z.array,received:n.parsedType}),J;if(n.data.length<this._def.items.length)return V(n,{code:x.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),J;!this._def.rest&&n.data.length>this._def.items.length&&(V(n,{code:x.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 Te(n,c,n.path,o)):null}).filter(c=>!!c);return n.common.async?Promise.all(s).then(c=>pe.mergeArray(r,c)):pe.mergeArray(r,s)}get items(){return this._def.items}rest(e){return new Oe({...this._def,rest:e})}}Oe.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Oe({items:t,typeName:B.ZodTuple,rest:null,...Y(e)})};class wt extends X{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!==z.object)return V(n,{code:x.invalid_type,expected:z.object,received:n.parsedType}),J;const a=[],s=this._def.keyType,c=this._def.valueType;for(const o in n.data)a.push({key:s._parse(new Te(n,o,n.path,o)),value:c._parse(new Te(n,n.data[o],n.path,o)),alwaysSet:o in n.data});return n.common.async?pe.mergeObjectAsync(r,a):pe.mergeObjectSync(r,a)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof X?new wt({keyType:e,valueType:r,typeName:B.ZodRecord,...Y(n)}):new wt({keyType:Se.create(),valueType:e,typeName:B.ZodRecord,...Y(r)})}}class _r extends X{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!==z.map)return V(n,{code:x.invalid_type,expected:z.map,received:n.parsedType}),J;const a=this._def.keyType,s=this._def.valueType,c=[...n.data.entries()].map(([o,u],h)=>({key:a._parse(new Te(n,o,n.path,[h,"key"])),value:s._parse(new Te(n,u,n.path,[h,"value"]))}));if(n.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const u of c){const h=await u.key,p=await u.value;if(h.status==="aborted"||p.status==="aborted")return J;(h.status==="dirty"||p.status==="dirty")&&r.dirty(),o.set(h.value,p.value)}return{status:r.value,value:o}})}else{const o=new Map;for(const u of c){const h=u.key,p=u.value;if(h.status==="aborted"||p.status==="aborted")return J;(h.status==="dirty"||p.status==="dirty")&&r.dirty(),o.set(h.value,p.value)}return{status:r.value,value:o}}}}_r.create=(t,e,r)=>new _r({valueType:e,keyType:t,typeName:B.ZodMap,...Y(r)});class Xe extends X{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==z.set)return V(n,{code:x.invalid_type,expected:z.set,received:n.parsedType}),J;const a=this._def;a.minSize!==null&&n.data.size<a.minSize.value&&(V(n,{code:x.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&&(V(n,{code:x.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 h=new Set;for(const p of u){if(p.status==="aborted")return J;p.status==="dirty"&&r.dirty(),h.add(p.value)}return{status:r.value,value:h}}const o=[...n.data.values()].map((u,h)=>s._parse(new Te(n,u,n.path,h)));return n.common.async?Promise.all(o).then(u=>c(u)):c(o)}min(e,r){return new Xe({...this._def,minSize:{value:e,message:L.toString(r)}})}max(e,r){return new Xe({...this._def,maxSize:{value:e,message:L.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}}Xe.create=(t,e)=>new Xe({valueType:t,minSize:null,maxSize:null,typeName:B.ZodSet,...Y(e)});class at extends X{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==z.function)return V(r,{code:x.invalid_type,expected:z.function,received:r.parsedType}),J;function n(o,u){return mr({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,pr(),ot].filter(h=>!!h),issueData:{code:x.invalid_arguments,argumentsError:u}})}function a(o,u){return mr({data:o,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,pr(),ot].filter(h=>!!h),issueData:{code:x.invalid_return_type,returnTypeError:u}})}const s={errorMap:r.common.contextualErrorMap},c=r.data;if(this._def.returns instanceof ut){const o=this;return ye(async function(...u){const h=new $e([]),p=await o._def.args.parseAsync(u,s).catch(b=>{throw h.addIssue(n(u,b)),h}),$=await Reflect.apply(c,this,p);return await o._def.returns._def.type.parseAsync($,s).catch(b=>{throw h.addIssue(a($,b)),h})})}else{const o=this;return ye(function(...u){const h=o._def.args.safeParse(u,s);if(!h.success)throw new $e([n(u,h.error)]);const p=Reflect.apply(c,this,h.data),$=o._def.returns.safeParse(p,s);if(!$.success)throw new $e([a(p,$.error)]);return $.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new at({...this._def,args:Oe.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||Oe.create([]).rest(Je.create()),returns:r||Je.create(),typeName:B.ZodFunction,...Y(n)})}}class kt extends X{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})}}kt.create=(t,e)=>new kt({getter:t,typeName:B.ZodLazy,...Y(e)});class St extends X{_parse(e){if(e.data!==this._def.value){const r=this._getOrReturnCtx(e);return V(r,{received:r.data,code:x.invalid_literal,expected:this._def.value}),J}return{status:"valid",value:e.data}}get value(){return this._def.value}}St.create=(t,e)=>new St({value:t,typeName:B.ZodLiteral,...Y(e)});function Rs(t,e){return new Le({values:t,typeName:B.ZodEnum,...Y(e)})}class Le extends X{constructor(){super(...arguments),pt.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const r=this._getOrReturnCtx(e),n=this._def.values;return V(r,{expected:ne.joinValues(n),received:r.parsedType,code:x.invalid_type}),J}if(yr(this,pt)||Is(this,pt,new Set(this._def.values)),!yr(this,pt).has(e.data)){const r=this._getOrReturnCtx(e),n=this._def.values;return V(r,{received:r.data,code:x.invalid_enum_value,options:n}),J}return ye(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 Le.create(e,{...this._def,...r})}exclude(e,r=this._def){return Le.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}}pt=new WeakMap;Le.create=Rs;class Et extends X{constructor(){super(...arguments),mt.set(this,void 0)}_parse(e){const r=ne.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==z.string&&n.parsedType!==z.number){const a=ne.objectValues(r);return V(n,{expected:ne.joinValues(a),received:n.parsedType,code:x.invalid_type}),J}if(yr(this,mt)||Is(this,mt,new Set(ne.getValidEnumValues(this._def.values))),!yr(this,mt).has(e.data)){const a=ne.objectValues(r);return V(n,{received:n.data,code:x.invalid_enum_value,options:a}),J}return ye(e.data)}get enum(){return this._def.values}}mt=new WeakMap;Et.create=(t,e)=>new Et({values:t,typeName:B.ZodNativeEnum,...Y(e)});class ut extends X{unwrap(){return this._def.type}_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==z.promise&&r.common.async===!1)return V(r,{code:x.invalid_type,expected:z.promise,received:r.parsedType}),J;const n=r.parsedType===z.promise?r.data:Promise.resolve(r.data);return ye(n.then(a=>this._def.type.parseAsync(a,{path:r.path,errorMap:r.common.contextualErrorMap})))}}ut.create=(t,e)=>new ut({type:t,typeName:B.ZodPromise,...Y(e)});class Pe extends X{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===B.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=>{V(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 J;const u=await this._def.schema._parseAsync({data:o,path:n.path,parent:n});return u.status==="aborted"?J:u.status==="dirty"||r.value==="dirty"?st(u.value):u});{if(r.value==="aborted")return J;const o=this._def.schema._parseSync({data:c,path:n.path,parent:n});return o.status==="aborted"?J: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"?J:(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"?J:(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);ne.assertNever(a)}}Pe.create=(t,e,r)=>new Pe({schema:t,typeName:B.ZodEffects,effect:e,...Y(r)});Pe.createWithPreprocess=(t,e,r)=>new Pe({schema:e,effect:{type:"preprocess",transform:t},typeName:B.ZodEffects,...Y(r)});class je extends X{_parse(e){return this._getType(e)===z.undefined?ye(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}je.create=(t,e)=>new je({innerType:t,typeName:B.ZodOptional,...Y(e)});class Fe extends X{_parse(e){return this._getType(e)===z.null?ye(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Fe.create=(t,e)=>new Fe({innerType:t,typeName:B.ZodNullable,...Y(e)});class Pt extends X{_parse(e){const{ctx:r}=this._processInputParams(e);let n=r.data;return r.parsedType===z.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}Pt.create=(t,e)=>new Pt({innerType:t,typeName:B.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Y(e)});class Nt extends X{_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 yt(a)?a.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new $e(n.common.issues)},input:n.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new $e(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}Nt.create=(t,e)=>new Nt({innerType:t,typeName:B.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Y(e)});class $r extends X{_parse(e){if(this._getType(e)!==z.nan){const n=this._getOrReturnCtx(e);return V(n,{code:x.invalid_type,expected:z.nan,received:n.parsedType}),J}return{status:"valid",value:e.data}}}$r.create=t=>new $r({typeName:B.ZodNaN,...Y(t)});const wa=Symbol("zod_brand");class Jr extends X{_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 jt extends X{_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"?J: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"?J: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 jt({in:e,out:r,typeName:B.ZodPipeline})}}class It extends X{_parse(e){const r=this._def.innerType._parse(e),n=a=>(We(a)&&(a.value=Object.freeze(a.value)),a);return yt(r)?r.then(a=>n(a)):n(r)}unwrap(){return this._def.innerType}}It.create=(t,e)=>new It({innerType:t,typeName:B.ZodReadonly,...Y(e)});function an(t,e){const r=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof r=="string"?{message:r}:r}function Cs(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 h,p;if(!u){const $=an(e,n),w=(p=(h=$.fatal)!==null&&h!==void 0?h:r)!==null&&p!==void 0?p:!0;a.addIssue({code:"custom",...$,fatal:w})}});if(!o){const u=an(e,n),h=(c=(s=u.fatal)!==null&&s!==void 0?s:r)!==null&&c!==void 0?c:!0;a.addIssue({code:"custom",...u,fatal:h})}}):ct.create()}const ka={object:ue.lazycreate};var B;(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"})(B||(B={}));const Sa=(t,e={message:`Input not instance of ${t.name}`})=>Cs(r=>r instanceof t,e),As=Se.create,xs=Ze.create,Ea=$r.create,Pa=Ue.create,Ms=vt.create,Na=Ye.create,Ia=vr.create,ja=gt.create,Ta=_t.create,Oa=ct.create,Ra=Je.create,Ca=De.create,Aa=gr.create,xa=Ee.create,Ma=ue.create,qa=ue.strictCreate,Da=$t.create,Va=Er.create,za=bt.create,Za=Oe.create,Ua=wt.create,La=_r.create,Fa=Xe.create,Ka=at.create,Ha=kt.create,Ga=St.create,Ba=Le.create,Ja=Et.create,Wa=ut.create,on=Pe.create,Ya=je.create,Xa=Fe.create,Qa=Pe.createWithPreprocess,ei=jt.create,ti=()=>As().optional(),ri=()=>xs().optional(),ni=()=>Ms().optional(),si={string:t=>Se.create({...t,coerce:!0}),number:t=>Ze.create({...t,coerce:!0}),boolean:t=>vt.create({...t,coerce:!0}),bigint:t=>Ue.create({...t,coerce:!0}),date:t=>Ye.create({...t,coerce:!0})},ai=J;var j=Object.freeze({__proto__:null,defaultErrorMap:ot,setErrorMap:Qs,getErrorMap:pr,makeIssue:mr,EMPTY_PATH:ea,addIssueToContext:V,ParseStatus:pe,INVALID:J,DIRTY:st,OK:ye,isAborted:Hr,isDirty:Gr,isValid:We,isAsync:yt,get util(){return ne},get objectUtil(){return Kr},ZodParsedType:z,getParsedType:qe,ZodType:X,datetimeRegex:Os,ZodString:Se,ZodNumber:Ze,ZodBigInt:Ue,ZodBoolean:vt,ZodDate:Ye,ZodSymbol:vr,ZodUndefined:gt,ZodNull:_t,ZodAny:ct,ZodUnknown:Je,ZodNever:De,ZodVoid:gr,ZodArray:Ee,ZodObject:ue,ZodUnion:$t,ZodDiscriminatedUnion:Er,ZodIntersection:bt,ZodTuple:Oe,ZodRecord:wt,ZodMap:_r,ZodSet:Xe,ZodFunction:at,ZodLazy:kt,ZodLiteral:St,ZodEnum:Le,ZodNativeEnum:Et,ZodPromise:ut,ZodEffects:Pe,ZodTransformer:Pe,ZodOptional:je,ZodNullable:Fe,ZodDefault:Pt,ZodCatch:Nt,ZodNaN:$r,BRAND:wa,ZodBranded:Jr,ZodPipeline:jt,ZodReadonly:It,custom:Cs,Schema:X,ZodSchema:X,late:ka,get ZodFirstPartyTypeKind(){return B},coerce:si,any:Oa,array:xa,bigint:Pa,boolean:Ms,date:Na,discriminatedUnion:Va,effect:on,enum:Ba,function:Ka,instanceof:Sa,intersection:za,lazy:Ha,literal:Ga,map:La,nan:Ea,nativeEnum:Ja,never:Ca,null:Ta,nullable:Xa,number:xs,object:Ma,oboolean:ni,onumber:ri,optional:Ya,ostring:ti,pipeline:ei,preprocess:Qa,promise:Wa,record:Ua,set:Fa,strictObject:qa,string:As,symbol:Ia,transformer:on,tuple:Za,undefined:ja,union:Da,unknown:Ra,void:Aa,NEVER:ai,ZodIssueCode:x,quotelessJson:Xs,ZodError:$e});const Wr=j.object({x:j.number(),y:j.number()}),it=j.object({instanceId:j.string(),output:j.string()}),br=j.object({hubId:j.string()}),ii=j.object({args:j.record(j.unknown()).optional(),inputs:j.record(j.array(it)).optional(),hubInputs:j.record(j.array(br)).optional(),injectionInputs:j.array(br).optional(),position:Wr.optional()}),cn=j.object({id:j.string(),type:j.string(),name:j.string(),...ii.shape,resolvedInputs:j.record(j.array(it)).optional(),parentId:j.string().optional(),outputs:j.record(j.array(it)).optional(),resolvedOutputs:j.record(j.array(it)).optional()});j.object({instance:cn,children:j.array(cn),inputHash:j.string().optional()});j.object({position:Wr.optional(),inputs:j.array(it).optional(),injectionInputs:j.array(br).optional()});j.object({id:j.string().nanoid(),position:Wr,inputs:j.array(it).optional(),injectionInputs:j.array(br).optional()});var qs={done:!1,hasNext:!1};function un(t,...e){let r=t,n=e.map(s=>"lazy"in s?oi(s):void 0),a=0;for(;a<e.length;){if(n[a]===void 0||!ci(r)){let u=e[a];r=u(r),a+=1;continue}let s=[];for(let u=a;u<e.length;u++){let h=n[u];if(h===void 0||(s.push(h),h.isSingle))break}let c=[];for(let u of r)if(Ds(u,c,s))break;let{isSingle:o}=s.at(-1);r=o?c[0]:c,a+=s.length}return r}function Ds(t,e,r){if(r.length===0)return e.push(t),!1;let n=t,a=qs,s=!1;for(let[c,o]of r.entries()){let{index:u,items:h}=o;if(h.push(n),a=o(n,u,h),o.index+=1,a.hasNext){if(a.hasMany??!1){for(let p of a.next)if(Ds(p,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 oi(t){let{lazy:e,lazyArgs:r}=t,n=e(...r);return Object.assign(n,{isSingle:e.single??!1,index:0,items:[]})}function ci(t){return typeof t=="string"||typeof t=="object"&&t!==null&&Symbol.iterator in t}function ui(t,e){let r=e.length-t.length;if(r===1){let[n,...a]=e;return un(n,{lazy:t,lazyArgs:a})}if(r===0){let n={lazy:t,lazyArgs:e};return Object.assign(a=>un(a,n),n)}throw new Error("Wrong number of arguments")}function di(t,e,r){let n=a=>t(a,...e);return r===void 0?n:Object.assign(n,{lazy:r,lazyArgs:e})}function Vs(t,e,r){let n=t.length-e.length;if(n===0)return t(...e);if(n===1)return di(t,e,r);throw new Error("Wrong number of arguments")}function li(...t){return ui(fi,t)}function fi(){let t=new Set;return e=>t.has(e)?qs:(t.add(e),{done:!1,hasNext:!0,next:e})}function hi(...t){return Vs(pi,t)}function pi(t,e){let r={};for(let[n,a]of Object.entries(t)){let s=e(a,n,t);r[n]=s}return r}function mi(...t){return Vs(Object.fromEntries,t)}const yi=j.enum(["not_created","updating","previewing","destroying","refreshing","created","error","pending","unknown"]),vi=j.object({name:j.string(),value:j.string().optional(),displayName:j.string().optional(),sensitive:j.boolean().optional(),url:j.string().optional(),complementaryTo:j.string().optional()}),Yr=j.object({name:j.string(),contentType:j.string(),size:j.number(),isBinary:j.boolean().optional()});j.object({meta:Yr,content:j.string()});const gi=j.union([j.object({type:j.literal("markdown"),content:j.string()}),j.object({type:j.literal("qr"),content:j.string(),showContent:j.coerce.boolean(),language:j.string().optional()}),j.object({type:j.literal("file"),fileMeta:Yr})]),zs=j.object({name:j.string(),title:j.string()});j.object({...zs.shape,content:j.array(gi)});const Zs=j.object({name:j.string(),title:j.string(),description:j.string().optional()}),_i=j.object({content:j.string().optional(),isBinary:j.boolean().optional(),mode:j.number().optional()});j.object({...Zs.shape,image:j.string(),command:j.string().array(),cwd:j.string().optional(),env:j.record(j.string()).optional(),files:j.record(_i).optional()});const $i=j.union([j.object({type:j.literal("before-destroy")}),j.object({type:j.literal("schedule"),schedule:j.string()})]),bi=j.object({name:j.string(),title:j.string(),description:j.string().optional(),spec:$i});j.object({name:j.string()});const wi=j.object({id:j.string(),parentId:j.string().nullable().default(null),status:yi,dependencyIds:j.array(j.string()).default(()=>[]),latestOperationId:j.string().nullable().default(null),currentResourceCount:j.number().nullable().default(null),totalResourceCount:j.number().nullable().default(null),inputHash:j.string().nullable().default(null),outputHash:j.string().nullable().default(null),error:j.string().nullable().default(null),evaluationError:j.string().nullable().default(null),statusFields:j.array(vi).default(()=>[]),files:j.array(Yr).default(()=>[]),pages:j.array(zs).default(()=>[]),terminals:j.array(Zs).default(()=>[]),triggers:j.array(bi).default(()=>[])});j.object({...wi.shape,secrets:j.record(j.string()).nullable(),logLine:j.string().nullable()}).partial();const Us=j.enum(["update","preview","destroy","recreate","refresh"]),ki=j.enum(["pending","running","completed","failed","cancelled"]),Ls=j.object({forceUpdateDependencies:j.boolean().default(!1),destroyDependentInstances:j.boolean().default(!0),invokeDestroyTriggers:j.boolean().default(!0),deleteUnreachableResources:j.boolean().default(!1),refresh:j.boolean().default(!1)});j.object({projectId:j.string(),type:Us,instanceIds:j.array(j.string()),options:Ls.partial().optional()});j.object({id:j.string().uuid(),status:ki,projectId:j.string(),type:Us,instanceIds:j.array(j.string()),affectedInstanceIds:j.array(j.string()).default(()=>[]),options:Ls.default(()=>({})),error:j.string().nullable(),startedAt:j.number(),completedAt:j.number().nullable()});class Si extends Error{constructor(e){super(`Circular dependency detected: ${e.join(" -> ")}`),this.name="CircularDependencyError"}}function Ei(){return{promiseCache:new Map}}function Xr(t){const e=(r,n,a)=>{a??=Ei(),n=n.child({resolver:t.name});const s=new Map,c=(o,u)=>{n.trace({itemId:o},"resolving item");const h=a.promiseCache.get(o);if(h)return h;if(u.includes(o))throw new Si([...u,o]);const p=r.get(o);if(!p)return Promise.resolve(void 0);const w=(async()=>{const b=li(t.getNodeDependencies(p));a.setDependencies?.(o,b),n.trace({itemId:o,dependencies:b},"resolving item dependencies");const E=[...u,o];for(const v of b)await c(v,E);return await t.process(p,s,n)})().then(b=>(a.promiseCache.get(o)===w&&(a.setOutput?.(o,b),s.set(o,b)),b));return a.promiseCache.set(o,w),w};return o=>c(o,[])};return e.factoryName=t.name,e}var Tt={exports:{}},Ar={},Ce={},He={},xr={},Mr={},qr={},dn;function wr(){return dn||(dn=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((l,y)=>`${l}${y}`,"")}get names(){var i;return(i=this._names)!==null&&i!==void 0?i:this._names=this._items.reduce((l,y)=>(y instanceof r&&(l[y.str]=(l[y.str]||0)+1),l),{})}}t._Code=n,t.nil=new n("");function a(d,...i){const l=[d[0]];let y=0;for(;y<i.length;)o(l,i[y]),l.push(d[++y]);return new n(l)}t._=a;const s=new n("+");function c(d,...i){const l=[b(d[0])];let y=0;for(;y<i.length;)l.push(s),o(l,i[y]),l.push(s,b(d[++y]));return u(l),new n(l)}t.str=c;function o(d,i){i instanceof n?d.push(...i._items):i instanceof r?d.push(i):d.push($(i))}t.addCodeArg=o;function u(d){let i=1;for(;i<d.length-1;){if(d[i]===s){const l=h(d[i-1],d[i+1]);if(l!==void 0){d.splice(i-1,3,l);continue}d[i++]="+"}i++}}function h(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 p(d,i){return i.emptyStr()?d:d.emptyStr()?i:c`${d}${i}`}t.strConcat=p;function $(d){return typeof d=="number"||typeof d=="boolean"||d===null?d:b(Array.isArray(d)?d.join(","):d)}function w(d){return new n(b(d))}t.stringify=w;function b(d){return JSON.stringify(d).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}t.safeStringify=b;function E(d){return typeof d=="string"&&t.IDENTIFIER.test(d)?new n(`.${d}`):a`[${d}]`}t.getProperty=E;function v(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=v;function f(d){return new n(d.toString())}t.regexpCode=f}(qr)),qr}var Dr={},ln;function fn(){return ln||(ln=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;const e=wr();class r extends Error{constructor(h){super(`CodeGen: "code" for ${h} not defined`),this.value=h.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:h,parent:p}={}){this._names={},this._prefixes=h,this._parent=p}toName(h){return h instanceof e.Name?h:this.name(h)}name(h){return new e.Name(this._newName(h))}_newName(h){const p=this._names[h]||this._nameGroup(h);return`${h}${p.index++}`}_nameGroup(h){var p,$;if(!(($=(p=this._parent)===null||p===void 0?void 0:p._prefixes)===null||$===void 0)&&$.has(h)||this._prefixes&&!this._prefixes.has(h))throw new Error(`CodeGen: prefix "${h}" is not allowed in this scope`);return this._names[h]={prefix:h,index:0}}}t.Scope=a;class s extends e.Name{constructor(h,p){super(p),this.prefix=h}setValue(h,{property:p,itemIndex:$}){this.value=h,this.scopePath=(0,e._)`.${new e.Name(p)}[${$}]`}}t.ValueScopeName=s;const c=(0,e._)`\n`;class o extends a{constructor(h){super(h),this._values={},this._scope=h.scope,this.opts={...h,_n:h.lines?c:e.nil}}get(){return this._scope}name(h){return new s(h,this._newName(h))}value(h,p){var $;if(p.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const w=this.toName(h),{prefix:b}=w,E=($=p.key)!==null&&$!==void 0?$:p.ref;let v=this._values[b];if(v){const i=v.get(E);if(i)return i}else v=this._values[b]=new Map;v.set(E,w);const f=this._scope[b]||(this._scope[b]=[]),d=f.length;return f[d]=p.ref,w.setValue(p,{property:b,itemIndex:d}),w}getValue(h,p){const $=this._values[h];if($)return $.get(p)}scopeRefs(h,p=this._values){return this._reduceValues(p,$=>{if($.scopePath===void 0)throw new Error(`CodeGen: name "${$}" has no value`);return(0,e._)`${h}${$.scopePath}`})}scopeCode(h=this._values,p,$){return this._reduceValues(h,w=>{if(w.value===void 0)throw new Error(`CodeGen: name "${w}" has no value`);return w.value.code},p,$)}_reduceValues(h,p,$={},w){let b=e.nil;for(const E in h){const v=h[E];if(!v)continue;const f=$[E]=$[E]||new Map;v.forEach(d=>{if(f.has(d))return;f.set(d,n.Started);let i=p(d);if(i){const l=this.opts.es5?t.varKinds.var:t.varKinds.const;b=(0,e._)`${b}${l} ${d} = ${i};${this.opts._n}`}else if(i=w?.(d))b=(0,e._)`${b}${i}${this.opts._n}`;else throw new r(d);f.set(d,n.Completed)})}return b}}t.ValueScope=o}(Dr)),Dr}var hn;function te(){return hn||(hn=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=wr(),r=fn();var n=wr();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=fn();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(m,S){return this}}class c extends s{constructor(m,S,R){super(),this.varKind=m,this.name=S,this.rhs=R}render({es5:m,_n:S}){const R=m?r.varKinds.var:this.varKind,U=this.rhs===void 0?"":` = ${this.rhs}`;return`${R} ${this.name}${U};`+S}optimizeNames(m,S){if(m[this.name.str])return this.rhs&&(this.rhs=se(this.rhs,m,S)),this}get names(){return this.rhs instanceof e._CodeOrName?this.rhs.names:{}}}class o extends s{constructor(m,S,R){super(),this.lhs=m,this.rhs=S,this.sideEffects=R}render({_n:m}){return`${this.lhs} = ${this.rhs};`+m}optimizeNames(m,S){if(!(this.lhs instanceof e.Name&&!m[this.lhs.str]&&!this.sideEffects))return this.rhs=se(this.rhs,m,S),this}get names(){const m=this.lhs instanceof e.Name?{}:{...this.lhs.names};return G(m,this.rhs)}}class u extends o{constructor(m,S,R,U){super(m,R,U),this.op=S}render({_n:m}){return`${this.lhs} ${this.op}= ${this.rhs};`+m}}class h extends s{constructor(m){super(),this.label=m,this.names={}}render({_n:m}){return`${this.label}:`+m}}class p extends s{constructor(m){super(),this.label=m,this.names={}}render({_n:m}){return`break${this.label?` ${this.label}`:""};`+m}}class $ extends s{constructor(m){super(),this.error=m}render({_n:m}){return`throw ${this.error};`+m}get names(){return this.error.names}}class w extends s{constructor(m){super(),this.code=m}render({_n:m}){return`${this.code};`+m}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(m,S){return this.code=se(this.code,m,S),this}get names(){return this.code instanceof e._CodeOrName?this.code.names:{}}}class b extends s{constructor(m=[]){super(),this.nodes=m}render(m){return this.nodes.reduce((S,R)=>S+R.render(m),"")}optimizeNodes(){const{nodes:m}=this;let S=m.length;for(;S--;){const R=m[S].optimizeNodes();Array.isArray(R)?m.splice(S,1,...R):R?m[S]=R:m.splice(S,1)}return m.length>0?this:void 0}optimizeNames(m,S){const{nodes:R}=this;let U=R.length;for(;U--;){const H=R[U];H.optimizeNames(m,S)||(de(m,H.names),R.splice(U,1))}return R.length>0?this:void 0}get names(){return this.nodes.reduce((m,S)=>W(m,S.names),{})}}class E extends b{render(m){return"{"+m._n+super.render(m)+"}"+m._n}}class v extends b{}class f extends E{}f.kind="else";class d extends E{constructor(m,S){super(S),this.condition=m}render(m){let S=`if(${this.condition})`+super.render(m);return this.else&&(S+="else "+this.else.render(m)),S}optimizeNodes(){super.optimizeNodes();const m=this.condition;if(m===!0)return this.nodes;let S=this.else;if(S){const R=S.optimizeNodes();S=this.else=Array.isArray(R)?new f(R):R}if(S)return m===!1?S instanceof d?S:S.nodes:this.nodes.length?this:new d(Ie(m),S instanceof d?[S]:S.nodes);if(!(m===!1||!this.nodes.length))return this}optimizeNames(m,S){var R;if(this.else=(R=this.else)===null||R===void 0?void 0:R.optimizeNames(m,S),!!(super.optimizeNames(m,S)||this.else))return this.condition=se(this.condition,m,S),this}get names(){const m=super.names;return G(m,this.condition),this.else&&W(m,this.else.names),m}}d.kind="if";class i extends E{}i.kind="for";class l extends i{constructor(m){super(),this.iteration=m}render(m){return`for(${this.iteration})`+super.render(m)}optimizeNames(m,S){if(super.optimizeNames(m,S))return this.iteration=se(this.iteration,m,S),this}get names(){return W(super.names,this.iteration.names)}}class y extends i{constructor(m,S,R,U){super(),this.varKind=m,this.name=S,this.from=R,this.to=U}render(m){const S=m.es5?r.varKinds.var:this.varKind,{name:R,from:U,to:H}=this;return`for(${S} ${R}=${U}; ${R}<${H}; ${R}++)`+super.render(m)}get names(){const m=G(super.names,this.from);return G(m,this.to)}}class _ extends i{constructor(m,S,R,U){super(),this.loop=m,this.varKind=S,this.name=R,this.iterable=U}render(m){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(m)}optimizeNames(m,S){if(super.optimizeNames(m,S))return this.iterable=se(this.iterable,m,S),this}get names(){return W(super.names,this.iterable.names)}}class g extends E{constructor(m,S,R){super(),this.name=m,this.args=S,this.async=R}render(m){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(m)}}g.kind="func";class k extends b{render(m){return"return "+super.render(m)}}k.kind="return";class O extends E{render(m){let S="try"+super.render(m);return this.catch&&(S+=this.catch.render(m)),this.finally&&(S+=this.finally.render(m)),S}optimizeNodes(){var m,S;return super.optimizeNodes(),(m=this.catch)===null||m===void 0||m.optimizeNodes(),(S=this.finally)===null||S===void 0||S.optimizeNodes(),this}optimizeNames(m,S){var R,U;return super.optimizeNames(m,S),(R=this.catch)===null||R===void 0||R.optimizeNames(m,S),(U=this.finally)===null||U===void 0||U.optimizeNames(m,S),this}get names(){const m=super.names;return this.catch&&W(m,this.catch.names),this.finally&&W(m,this.finally.names),m}}class M extends E{constructor(m){super(),this.error=m}render(m){return`catch(${this.error})`+super.render(m)}}M.kind="catch";class Z extends E{render(m){return"finally"+super.render(m)}}Z.kind="finally";class F{constructor(m,S={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...S,_n:S.lines?`
2
- `:""},this._extScope=m,this._scope=new r.Scope({parent:m}),this._nodes=[new v]}toString(){return this._root.render(this.opts)}name(m){return this._scope.name(m)}scopeName(m){return this._extScope.name(m)}scopeValue(m,S){const R=this._extScope.value(m,S);return(this._values[R.prefix]||(this._values[R.prefix]=new Set)).add(R),R}getScopeValue(m,S){return this._extScope.getValue(m,S)}scopeRefs(m){return this._extScope.scopeRefs(m,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(m,S,R,U){const H=this._scope.toName(S);return R!==void 0&&U&&(this._constants[H.str]=R),this._leafNode(new c(m,H,R)),H}const(m,S,R){return this._def(r.varKinds.const,m,S,R)}let(m,S,R){return this._def(r.varKinds.let,m,S,R)}var(m,S,R){return this._def(r.varKinds.var,m,S,R)}assign(m,S,R){return this._leafNode(new o(m,S,R))}add(m,S){return this._leafNode(new u(m,t.operators.ADD,S))}code(m){return typeof m=="function"?m():m!==e.nil&&this._leafNode(new w(m)),this}object(...m){const S=["{"];for(const[R,U]of m)S.length>1&&S.push(","),S.push(R),(R!==U||this.opts.es5)&&(S.push(":"),(0,e.addCodeArg)(S,U));return S.push("}"),new e._Code(S)}if(m,S,R){if(this._blockNode(new d(m)),S&&R)this.code(S).else().code(R).endIf();else if(S)this.code(S).endIf();else if(R)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(m){return this._elseNode(new d(m))}else(){return this._elseNode(new f)}endIf(){return this._endBlockNode(d,f)}_for(m,S){return this._blockNode(m),S&&this.code(S).endFor(),this}for(m,S){return this._for(new l(m),S)}forRange(m,S,R,U,H=this.opts.es5?r.varKinds.var:r.varKinds.let){const ie=this._scope.toName(m);return this._for(new y(H,ie,S,R),()=>U(ie))}forOf(m,S,R,U=r.varKinds.const){const H=this._scope.toName(m);if(this.opts.es5){const ie=S instanceof e.Name?S:this.var("_arr",S);return this.forRange("_i",0,(0,e._)`${ie}.length`,re=>{this.var(H,(0,e._)`${ie}[${re}]`),R(H)})}return this._for(new _("of",U,H,S),()=>R(H))}forIn(m,S,R,U=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(m,(0,e._)`Object.keys(${S})`,R);const H=this._scope.toName(m);return this._for(new _("in",U,H,S),()=>R(H))}endFor(){return this._endBlockNode(i)}label(m){return this._leafNode(new h(m))}break(m){return this._leafNode(new p(m))}return(m){const S=new k;if(this._blockNode(S),this.code(m),S.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(k)}try(m,S,R){if(!S&&!R)throw new Error('CodeGen: "try" without "catch" and "finally"');const U=new O;if(this._blockNode(U),this.code(m),S){const H=this.name("e");this._currNode=U.catch=new M(H),S(H)}return R&&(this._currNode=U.finally=new Z,this.code(R)),this._endBlockNode(M,Z)}throw(m){return this._leafNode(new $(m))}block(m,S){return this._blockStarts.push(this._nodes.length),m&&this.code(m).endBlock(S),this}endBlock(m){const S=this._blockStarts.pop();if(S===void 0)throw new Error("CodeGen: not in self-balancing block");const R=this._nodes.length-S;if(R<0||m!==void 0&&R!==m)throw new Error(`CodeGen: wrong number of nodes: ${R} vs ${m} expected`);return this._nodes.length=S,this}func(m,S=e.nil,R,U){return this._blockNode(new g(m,S,R)),U&&this.code(U).endFunc(),this}endFunc(){return this._endBlockNode(g)}optimize(m=1){for(;m-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(m){return this._currNode.nodes.push(m),this}_blockNode(m){this._currNode.nodes.push(m),this._nodes.push(m)}_endBlockNode(m,S){const R=this._currNode;if(R instanceof m||S&&R instanceof S)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${S?`${m.kind}/${S.kind}`:m.kind}"`)}_elseNode(m){const S=this._currNode;if(!(S instanceof d))throw new Error('CodeGen: "else" without "if"');return this._currNode=S.else=m,this}get _root(){return this._nodes[0]}get _currNode(){const m=this._nodes;return m[m.length-1]}set _currNode(m){const S=this._nodes;S[S.length-1]=m}}t.CodeGen=F;function W(T,m){for(const S in m)T[S]=(T[S]||0)+(m[S]||0);return T}function G(T,m){return m instanceof e._CodeOrName?W(T,m.names):T}function se(T,m,S){if(T instanceof e.Name)return R(T);if(!U(T))return T;return new e._Code(T._items.reduce((H,ie)=>(ie instanceof e.Name&&(ie=R(ie)),ie instanceof e._Code?H.push(...ie._items):H.push(ie),H),[]));function R(H){const ie=S[H.str];return ie===void 0||m[H.str]!==1?H:(delete m[H.str],ie)}function U(H){return H instanceof e._Code&&H._items.some(ie=>ie instanceof e.Name&&m[ie.str]===1&&S[ie.str]!==void 0)}}function de(T,m){for(const S in m)T[S]=(T[S]||0)-(m[S]||0)}function Ie(T){return typeof T=="boolean"||typeof T=="number"||T===null?!T:(0,e._)`!${A(T)}`}t.not=Ie;const Re=N(t.operators.AND);function ce(...T){return T.reduce(Re)}t.and=ce;const Ve=N(t.operators.OR);function q(...T){return T.reduce(Ve)}t.or=q;function N(T){return(m,S)=>m===e.nil?S:S===e.nil?m:(0,e._)`${A(m)} ${T} ${A(S)}`}function A(T){return T instanceof e.Name?T:(0,e._)`(${T})`}}(Mr)),Mr}var Q={},pn;function ae(){if(pn)return Q;pn=1,Object.defineProperty(Q,"__esModule",{value:!0}),Q.checkStrictMode=Q.getErrorPath=Q.Type=Q.useFunc=Q.setEvaluated=Q.evaluatedPropsToName=Q.mergeEvaluated=Q.eachItem=Q.unescapeJsonPointer=Q.escapeJsonPointer=Q.escapeFragment=Q.unescapeFragment=Q.schemaRefOrVal=Q.schemaHasRulesButRef=Q.schemaHasRules=Q.checkUnknownRules=Q.alwaysValidSchema=Q.toHash=void 0;const t=te(),e=wr();function r(_){const g={};for(const k of _)g[k]=!0;return g}Q.toHash=r;function n(_,g){return typeof g=="boolean"?g:Object.keys(g).length===0?!0:(a(_,g),!s(g,_.self.RULES.all))}Q.alwaysValidSchema=n;function a(_,g=_.schema){const{opts:k,self:O}=_;if(!k.strictSchema||typeof g=="boolean")return;const M=O.RULES.keywords;for(const Z in g)M[Z]||y(_,`unknown keyword: "${Z}"`)}Q.checkUnknownRules=a;function s(_,g){if(typeof _=="boolean")return!_;for(const k in _)if(g[k])return!0;return!1}Q.schemaHasRules=s;function c(_,g){if(typeof _=="boolean")return!_;for(const k in _)if(k!=="$ref"&&g.all[k])return!0;return!1}Q.schemaHasRulesButRef=c;function o({topSchemaRef:_,schemaPath:g},k,O,M){if(!M){if(typeof k=="number"||typeof k=="boolean")return k;if(typeof k=="string")return(0,t._)`${k}`}return(0,t._)`${_}${g}${(0,t.getProperty)(O)}`}Q.schemaRefOrVal=o;function u(_){return $(decodeURIComponent(_))}Q.unescapeFragment=u;function h(_){return encodeURIComponent(p(_))}Q.escapeFragment=h;function p(_){return typeof _=="number"?`${_}`:_.replace(/~/g,"~0").replace(/\//g,"~1")}Q.escapeJsonPointer=p;function $(_){return _.replace(/~1/g,"/").replace(/~0/g,"~")}Q.unescapeJsonPointer=$;function w(_,g){if(Array.isArray(_))for(const k of _)g(k);else g(_)}Q.eachItem=w;function b({mergeNames:_,mergeToName:g,mergeValues:k,resultToName:O}){return(M,Z,F,W)=>{const G=F===void 0?Z:F instanceof t.Name?(Z instanceof t.Name?_(M,Z,F):g(M,Z,F),F):Z instanceof t.Name?(g(M,F,Z),Z):k(Z,F);return W===t.Name&&!(G instanceof t.Name)?O(M,G):G}}Q.mergeEvaluated={props:b({mergeNames:(_,g,k)=>_.if((0,t._)`${k} !== true && ${g} !== undefined`,()=>{_.if((0,t._)`${g} === true`,()=>_.assign(k,!0),()=>_.assign(k,(0,t._)`${k} || {}`).code((0,t._)`Object.assign(${k}, ${g})`))}),mergeToName:(_,g,k)=>_.if((0,t._)`${k} !== true`,()=>{g===!0?_.assign(k,!0):(_.assign(k,(0,t._)`${k} || {}`),v(_,k,g))}),mergeValues:(_,g)=>_===!0?!0:{..._,...g},resultToName:E}),items:b({mergeNames:(_,g,k)=>_.if((0,t._)`${k} !== true && ${g} !== undefined`,()=>_.assign(k,(0,t._)`${g} === true ? true : ${k} > ${g} ? ${k} : ${g}`)),mergeToName:(_,g,k)=>_.if((0,t._)`${k} !== true`,()=>_.assign(k,g===!0?!0:(0,t._)`${k} > ${g} ? ${k} : ${g}`)),mergeValues:(_,g)=>_===!0?!0:Math.max(_,g),resultToName:(_,g)=>_.var("items",g)})};function E(_,g){if(g===!0)return _.var("props",!0);const k=_.var("props",(0,t._)`{}`);return g!==void 0&&v(_,k,g),k}Q.evaluatedPropsToName=E;function v(_,g,k){Object.keys(k).forEach(O=>_.assign((0,t._)`${g}${(0,t.getProperty)(O)}`,!0))}Q.setEvaluated=v;const f={};function d(_,g){return _.scopeValue("func",{ref:g,code:f[g.code]||(f[g.code]=new e._Code(g.code))})}Q.useFunc=d;var i;(function(_){_[_.Num=0]="Num",_[_.Str=1]="Str"})(i||(Q.Type=i={}));function l(_,g,k){if(_ instanceof t.Name){const O=g===i.Num;return k?O?(0,t._)`"[" + ${_} + "]"`:(0,t._)`"['" + ${_} + "']"`:O?(0,t._)`"/" + ${_}`:(0,t._)`"/" + ${_}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return k?(0,t.getProperty)(_).toString():"/"+p(_)}Q.getErrorPath=l;function y(_,g,k=_.opts.strictSchema){if(k){if(g=`strict mode: ${g}`,k===!0)throw new Error(g);_.self.logger.warn(g)}}return Q.checkStrictMode=y,Q}var Ot={},mn;function Ke(){if(mn)return Ot;mn=1,Object.defineProperty(Ot,"__esModule",{value:!0});const t=te(),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 Ot.default=e,Ot}var yn;function Pr(){return yn||(yn=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=te(),r=ae(),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,l){const{it:y}=f,{gen:_,compositeRule:g,allErrors:k}=y,O=$(f,d,i);l??(g||k)?u(_,O):h(y,(0,e._)`[${O}]`)}t.reportError=a;function s(f,d=t.keywordError,i){const{it:l}=f,{gen:y,compositeRule:_,allErrors:g}=l,k=$(f,d,i);u(y,k),_||g||h(l,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:l,errsCount:y,it:_}){if(y===void 0)throw new Error("ajv implementation error");const g=f.name("err");f.forRange("i",y,n.default.errors,k=>{f.const(g,(0,e._)`${n.default.vErrors}[${k}]`),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`,l))})}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 h(f,d){const{gen:i,validateName:l,schemaEnv:y}=f;y.$async?i.throw((0,e._)`new ${f.ValidationError}(${d})`):(i.assign((0,e._)`${l}.errors`,d),i.return(!1))}const p={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 $(f,d,i){const{createErrors:l}=f.it;return l===!1?(0,e._)`{}`:w(f,d,i)}function w(f,d,i={}){const{gen:l,it:y}=f,_=[b(y,i),E(f,i)];return v(f,d,_),l.object(..._)}function b({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 E({keyword:f,it:{errSchemaPath:d}},{schemaPath:i,parentSchema:l}){let y=l?d:(0,e.str)`${d}/${f}`;return i&&(y=(0,e.str)`${y}${(0,r.getErrorPath)(i,r.Type.Str)}`),[p.schemaPath,y]}function v(f,{params:d,message:i},l){const{keyword:y,data:_,schemaValue:g,it:k}=f,{opts:O,propertyName:M,topSchemaRef:Z,schemaPath:F}=k;l.push([p.keyword,y],[p.params,typeof d=="function"?d(f):d||(0,e._)`{}`]),O.messages&&l.push([p.message,typeof i=="function"?i(f):i]),O.verbose&&l.push([p.schema,g],[p.parentSchema,(0,e._)`${Z}${F}`],[n.default.data,_]),M&&l.push([p.propertyName,M])}}(xr)),xr}var vn;function Pi(){if(vn)return He;vn=1,Object.defineProperty(He,"__esModule",{value:!0}),He.boolOrEmptySchema=He.topBoolOrEmptySchema=void 0;const t=Pr(),e=te(),r=Ke(),n={message:"boolean schema is false"};function a(o){const{gen:u,schema:h,validateName:p}=o;h===!1?c(o,!1):typeof h=="object"&&h.$async===!0?u.return(r.default.data):(u.assign((0,e._)`${p}.errors`,null),u.return(!0))}He.topBoolOrEmptySchema=a;function s(o,u){const{gen:h,schema:p}=o;p===!1?(h.var(u,!1),c(o)):h.var(u,!0)}He.boolOrEmptySchema=s;function c(o,u){const{gen:h,data:p}=o,$={gen:h,keyword:"false schema",data:p,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:o};(0,t.reportError)($,n,void 0,u)}return He}var he={},Ge={},gn;function Fs(){if(gn)return Ge;gn=1,Object.defineProperty(Ge,"__esModule",{value:!0}),Ge.getRules=Ge.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)}Ge.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 Ge.getRules=n,Ge}var Ae={},_n;function Ks(){if(_n)return Ae;_n=1,Object.defineProperty(Ae,"__esModule",{value:!0}),Ae.shouldUseRule=Ae.shouldUseGroup=Ae.schemaHasRulesForType=void 0;function t({schema:n,self:a},s){const c=a.RULES.types[s];return c&&c!==!0&&e(n,c)}Ae.schemaHasRulesForType=t;function e(n,a){return a.rules.some(s=>r(n,s))}Ae.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 Ae.shouldUseRule=r,Ae}var $n;function kr(){if($n)return he;$n=1,Object.defineProperty(he,"__esModule",{value:!0}),he.reportTypeError=he.checkDataTypes=he.checkDataType=he.coerceAndCheckDataType=he.getJSONTypes=he.getSchemaTypes=he.DataType=void 0;const t=Fs(),e=Ks(),r=Pr(),n=te(),a=ae();var s;(function(i){i[i.Correct=0]="Correct",i[i.Wrong=1]="Wrong"})(s||(he.DataType=s={}));function c(i){const l=o(i.type);if(l.includes("null")){if(i.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!l.length&&i.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');i.nullable===!0&&l.push("null")}return l}he.getSchemaTypes=c;function o(i){const l=Array.isArray(i)?i:i?[i]:[];if(l.every(t.isJSONType))return l;throw new Error("type must be JSONType or JSONType[]: "+l.join(","))}he.getJSONTypes=o;function u(i,l){const{gen:y,data:_,opts:g}=i,k=p(l,g.coerceTypes),O=l.length>0&&!(k.length===0&&l.length===1&&(0,e.schemaHasRulesForType)(i,l[0]));if(O){const M=E(l,_,g.strictNumbers,s.Wrong);y.if(M,()=>{k.length?$(i,l,k):f(i)})}return O}he.coerceAndCheckDataType=u;const h=new Set(["string","number","integer","boolean","null"]);function p(i,l){return l?i.filter(y=>h.has(y)||l==="array"&&y==="array"):[]}function $(i,l,y){const{gen:_,data:g,opts:k}=i,O=_.let("dataType",(0,n._)`typeof ${g}`),M=_.let("coerced",(0,n._)`undefined`);k.coerceTypes==="array"&&_.if((0,n._)`${O} == 'object' && Array.isArray(${g}) && ${g}.length == 1`,()=>_.assign(g,(0,n._)`${g}[0]`).assign(O,(0,n._)`typeof ${g}`).if(E(l,g,k.strictNumbers),()=>_.assign(M,g))),_.if((0,n._)`${M} !== undefined`);for(const F of y)(h.has(F)||F==="array"&&k.coerceTypes==="array")&&Z(F);_.else(),f(i),_.endIf(),_.if((0,n._)`${M} !== undefined`,()=>{_.assign(g,M),w(i,M)});function Z(F){switch(F){case"string":_.elseIf((0,n._)`${O} == "number" || ${O} == "boolean"`).assign(M,(0,n._)`"" + ${g}`).elseIf((0,n._)`${g} === null`).assign(M,(0,n._)`""`);return;case"number":_.elseIf((0,n._)`${O} == "boolean" || ${g} === null
3
- || (${O} == "string" && ${g} && ${g} == +${g})`).assign(M,(0,n._)`+${g}`);return;case"integer":_.elseIf((0,n._)`${O} === "boolean" || ${g} === null
4
- || (${O} === "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._)`${O} === "string" || ${O} === "number"
5
- || ${O} === "boolean" || ${g} === null`).assign(M,(0,n._)`[${g}]`)}}}function w({gen:i,parentData:l,parentDataProperty:y},_){i.if((0,n._)`${l} !== undefined`,()=>i.assign((0,n._)`${l}[${y}]`,_))}function b(i,l,y,_=s.Correct){const g=_===s.Correct?n.operators.EQ:n.operators.NEQ;let k;switch(i){case"null":return(0,n._)`${l} ${g} null`;case"array":k=(0,n._)`Array.isArray(${l})`;break;case"object":k=(0,n._)`${l} && typeof ${l} == "object" && !Array.isArray(${l})`;break;case"integer":k=O((0,n._)`!(${l} % 1) && !isNaN(${l})`);break;case"number":k=O();break;default:return(0,n._)`typeof ${l} ${g} ${i}`}return _===s.Correct?k:(0,n.not)(k);function O(M=n.nil){return(0,n.and)((0,n._)`typeof ${l} == "number"`,M,y?(0,n._)`isFinite(${l})`:n.nil)}}he.checkDataType=b;function E(i,l,y,_){if(i.length===1)return b(i[0],l,y,_);let g;const k=(0,a.toHash)(i);if(k.array&&k.object){const O=(0,n._)`typeof ${l} != "object"`;g=k.null?O:(0,n._)`!${l} || ${O}`,delete k.null,delete k.array,delete k.object}else g=n.nil;k.number&&delete k.integer;for(const O in k)g=(0,n.and)(g,b(O,l,y,_));return g}he.checkDataTypes=E;const v={message:({schema:i})=>`must be ${i}`,params:({schema:i,schemaValue:l})=>typeof i=="string"?(0,n._)`{type: ${i}}`:(0,n._)`{type: ${l}}`};function f(i){const l=d(i);(0,r.reportError)(l,v)}he.reportTypeError=f;function d(i){const{gen:l,data:y,schema:_}=i,g=(0,a.schemaRefOrVal)(i,_,"type");return{gen:l,keyword:"type",data:y,schema:_.type,schemaCode:g,schemaValue:g,parentSchema:_,params:{},it:i}}return he}var lt={},bn;function Ni(){if(bn)return lt;bn=1,Object.defineProperty(lt,"__esModule",{value:!0}),lt.assignDefaults=void 0;const t=te(),e=ae();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,h)=>n(a,h,u.default))}lt.assignDefaults=r;function n(a,s,c){const{gen:o,compositeRule:u,data:h,opts:p}=a;if(c===void 0)return;const $=(0,t._)`${h}${(0,t.getProperty)(s)}`;if(u){(0,e.checkStrictMode)(a,`default is ignored for: ${$}`);return}let w=(0,t._)`${$} === undefined`;p.useDefaults==="empty"&&(w=(0,t._)`${w} || ${$} === null || ${$} === ""`),o.if(w,(0,t._)`${$} = ${(0,t.stringify)(c)}`)}return lt}var ke={},oe={},wn;function Ne(){if(wn)return oe;wn=1,Object.defineProperty(oe,"__esModule",{value:!0}),oe.validateUnion=oe.validateArray=oe.usePattern=oe.callValidateCode=oe.schemaProperties=oe.allSchemaProperties=oe.noPropertyInData=oe.propertyInData=oe.isOwnProperty=oe.hasPropFunc=oe.reportMissingProp=oe.checkMissingProp=oe.checkReportMissingProp=void 0;const t=te(),e=ae(),r=Ke(),n=ae();function a(i,l){const{gen:y,data:_,it:g}=i;y.if(p(y,_,l,g.opts.ownProperties),()=>{i.setParams({missingProperty:(0,t._)`${l}`},!0),i.error()})}oe.checkReportMissingProp=a;function s({gen:i,data:l,it:{opts:y}},_,g){return(0,t.or)(..._.map(k=>(0,t.and)(p(i,l,k,y.ownProperties),(0,t._)`${g} = ${k}`)))}oe.checkMissingProp=s;function c(i,l){i.setParams({missingProperty:l},!0),i.error()}oe.reportMissingProp=c;function o(i){return i.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,t._)`Object.prototype.hasOwnProperty`})}oe.hasPropFunc=o;function u(i,l,y){return(0,t._)`${o(i)}.call(${l}, ${y})`}oe.isOwnProperty=u;function h(i,l,y,_){const g=(0,t._)`${l}${(0,t.getProperty)(y)} !== undefined`;return _?(0,t._)`${g} && ${u(i,l,y)}`:g}oe.propertyInData=h;function p(i,l,y,_){const g=(0,t._)`${l}${(0,t.getProperty)(y)} === undefined`;return _?(0,t.or)(g,(0,t.not)(u(i,l,y))):g}oe.noPropertyInData=p;function $(i){return i?Object.keys(i).filter(l=>l!=="__proto__"):[]}oe.allSchemaProperties=$;function w(i,l){return $(l).filter(y=>!(0,e.alwaysValidSchema)(i,l[y]))}oe.schemaProperties=w;function b({schemaCode:i,data:l,it:{gen:y,topSchemaRef:_,schemaPath:g,errorPath:k},it:O},M,Z,F){const W=F?(0,t._)`${i}, ${l}, ${_}${g}`:l,G=[[r.default.instancePath,(0,t.strConcat)(r.default.instancePath,k)],[r.default.parentData,O.parentData],[r.default.parentDataProperty,O.parentDataProperty],[r.default.rootData,r.default.rootData]];O.opts.dynamicRef&&G.push([r.default.dynamicAnchors,r.default.dynamicAnchors]);const se=(0,t._)`${W}, ${y.object(...G)}`;return Z!==t.nil?(0,t._)`${M}.call(${Z}, ${se})`:(0,t._)`${M}(${se})`}oe.callValidateCode=b;const E=(0,t._)`new RegExp`;function v({gen:i,it:{opts:l}},y){const _=l.unicodeRegExp?"u":"",{regExp:g}=l.code,k=g(y,_);return i.scopeValue("pattern",{key:k.toString(),ref:k,code:(0,t._)`${g.code==="new RegExp"?E:(0,n.useFunc)(i,g)}(${y}, ${_})`})}oe.usePattern=v;function f(i){const{gen:l,data:y,keyword:_,it:g}=i,k=l.name("valid");if(g.allErrors){const M=l.let("valid",!0);return O(()=>l.assign(M,!1)),M}return l.var(k,!0),O(()=>l.break()),k;function O(M){const Z=l.const("len",(0,t._)`${y}.length`);l.forRange("i",0,Z,F=>{i.subschema({keyword:_,dataProp:F,dataPropType:e.Type.Num},k),l.if((0,t.not)(k),M)})}}oe.validateArray=f;function d(i){const{gen:l,schema:y,keyword:_,it:g}=i;if(!Array.isArray(y))throw new Error("ajv implementation error");if(y.some(Z=>(0,e.alwaysValidSchema)(g,Z))&&!g.opts.unevaluated)return;const O=l.let("valid",!1),M=l.name("_valid");l.block(()=>y.forEach((Z,F)=>{const W=i.subschema({keyword:_,schemaProp:F,compositeRule:!0},M);l.assign(O,(0,t._)`${O} || ${M}`),i.mergeValidEvaluated(W,M)||l.if((0,t.not)(O))})),i.result(O,()=>i.reset(),()=>i.error(!0))}return oe.validateUnion=d,oe}var kn;function Ii(){if(kn)return ke;kn=1,Object.defineProperty(ke,"__esModule",{value:!0}),ke.validateKeywordUsage=ke.validSchemaType=ke.funcKeywordCode=ke.macroKeywordCode=void 0;const t=te(),e=Ke(),r=Ne(),n=Pr();function a(w,b){const{gen:E,keyword:v,schema:f,parentSchema:d,it:i}=w,l=b.macro.call(i.self,f,d,i),y=h(E,v,l);i.opts.validateSchema!==!1&&i.self.validateSchema(l,!0);const _=E.name("valid");w.subschema({schema:l,schemaPath:t.nil,errSchemaPath:`${i.errSchemaPath}/${v}`,topSchemaRef:y,compositeRule:!0},_),w.pass(_,()=>w.error(!0))}ke.macroKeywordCode=a;function s(w,b){var E;const{gen:v,keyword:f,schema:d,parentSchema:i,$data:l,it:y}=w;u(y,b);const _=!l&&b.compile?b.compile.call(y.self,d,i,y):b.validate,g=h(v,f,_),k=v.let("valid");w.block$data(k,O),w.ok((E=b.valid)!==null&&E!==void 0?E:k);function O(){if(b.errors===!1)F(),b.modifying&&c(w),W(()=>w.error());else{const G=b.async?M():Z();b.modifying&&c(w),W(()=>o(w,G))}}function M(){const G=v.let("ruleErrs",null);return v.try(()=>F((0,t._)`await `),se=>v.assign(k,!1).if((0,t._)`${se} instanceof ${y.ValidationError}`,()=>v.assign(G,(0,t._)`${se}.errors`),()=>v.throw(se))),G}function Z(){const G=(0,t._)`${g}.errors`;return v.assign(G,null),F(t.nil),G}function F(G=b.async?(0,t._)`await `:t.nil){const se=y.opts.passContext?e.default.this:e.default.self,de=!("compile"in b&&!l||b.schema===!1);v.assign(k,(0,t._)`${G}${(0,r.callValidateCode)(w,g,se,de)}`,b.modifying)}function W(G){var se;v.if((0,t.not)((se=b.valid)!==null&&se!==void 0?se:k),G)}}ke.funcKeywordCode=s;function c(w){const{gen:b,data:E,it:v}=w;b.if(v.parentData,()=>b.assign(E,(0,t._)`${v.parentData}[${v.parentDataProperty}]`))}function o(w,b){const{gen:E}=w;E.if((0,t._)`Array.isArray(${b})`,()=>{E.assign(e.default.vErrors,(0,t._)`${e.default.vErrors} === null ? ${b} : ${e.default.vErrors}.concat(${b})`).assign(e.default.errors,(0,t._)`${e.default.vErrors}.length`),(0,n.extendErrors)(w)},()=>w.error())}function u({schemaEnv:w},b){if(b.async&&!w.$async)throw new Error("async keyword in sync schema")}function h(w,b,E){if(E===void 0)throw new Error(`keyword "${b}" failed to compile`);return w.scopeValue("keyword",typeof E=="function"?{ref:E}:{ref:E,code:(0,t.stringify)(E)})}function p(w,b,E=!1){return!b.length||b.some(v=>v==="array"?Array.isArray(w):v==="object"?w&&typeof w=="object"&&!Array.isArray(w):typeof w==v||E&&typeof w>"u")}ke.validSchemaType=p;function $({schema:w,opts:b,self:E,errSchemaPath:v},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(l=>!Object.prototype.hasOwnProperty.call(w,l)))throw new Error(`parent schema must have dependencies of ${d}: ${i.join(",")}`);if(f.validateSchema&&!f.validateSchema(w[d])){const y=`keyword "${d}" value is invalid at path "${v}": `+E.errorsText(f.validateSchema.errors);if(b.validateSchema==="log")E.logger.error(y);else throw new Error(y)}}return ke.validateKeywordUsage=$,ke}var xe={},Sn;function ji(){if(Sn)return xe;Sn=1,Object.defineProperty(xe,"__esModule",{value:!0}),xe.extendSubschemaMode=xe.extendSubschemaData=xe.getSubschema=void 0;const t=te(),e=ae();function r(s,{keyword:c,schemaProp:o,schema:u,schemaPath:h,errSchemaPath:p,topSchemaRef:$}){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(h===void 0||p===void 0||$===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:u,schemaPath:h,topSchemaRef:$,errSchemaPath:p}}throw new Error('either "keyword" or "schema" must be passed')}xe.getSubschema=r;function n(s,c,{dataProp:o,dataPropType:u,data:h,dataTypes:p,propertyName:$}){if(h!==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:E,dataPathArr:v,opts:f}=c,d=w.let("data",(0,t._)`${c.data}${(0,t.getProperty)(o)}`,!0);b(d),s.errorPath=(0,t.str)`${E}${(0,e.getErrorPath)(o,u,f.jsPropertySyntax)}`,s.parentDataProperty=(0,t._)`${o}`,s.dataPathArr=[...v,s.parentDataProperty]}if(h!==void 0){const E=h instanceof t.Name?h:w.let("data",h,!0);b(E),$!==void 0&&(s.propertyName=$)}p&&(s.dataTypes=p);function b(E){s.data=E,s.dataLevel=c.dataLevel+1,s.dataTypes=[],c.definedProperties=new Set,s.parentData=c.data,s.dataNames=[...c.dataNames,E]}}xe.extendSubschemaData=n;function a(s,{jtdDiscriminator:c,jtdMetadata:o,compositeRule:u,createErrors:h,allErrors:p}){u!==void 0&&(s.compositeRule=u),h!==void 0&&(s.createErrors=h),p!==void 0&&(s.allErrors=p),s.jtdDiscriminator=c,s.jtdMetadata=o}return xe.extendSubschemaMode=a,xe}var me={},Vr,En;function Hs(){return En||(En=1,Vr=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}),Vr}var zr={exports:{}},Pn;function Ti(){if(Pn)return zr.exports;Pn=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,h,p,$,w){if(c&&typeof c=="object"&&!Array.isArray(c)){a(c,o,u,h,p,$,w);for(var b in c){var E=c[b];if(Array.isArray(E)){if(b in t.arrayKeywords)for(var v=0;v<E.length;v++)e(n,a,s,E[v],o+"/"+b+"/"+v,u,o,b,c,v)}else if(b in t.propsKeywords){if(E&&typeof E=="object")for(var f in E)e(n,a,s,E[f],o+"/"+b+"/"+r(f),u,o,b,c,f)}else(b in t.keywords||n.allKeys&&!(b in t.skipKeywords))&&e(n,a,s,E,o+"/"+b,u,o,b,c)}s(c,o,u,h,p,$,w)}}function r(n){return n.replace(/~/g,"~0").replace(/\//g,"~1")}return zr.exports}var Nn;function Nr(){if(Nn)return me;Nn=1,Object.defineProperty(me,"__esModule",{value:!0}),me.getSchemaRefs=me.resolveUrl=me.normalizeId=me._getFullPath=me.getFullPath=me.inlineRef=void 0;const t=ae(),e=Hs(),r=Ti(),n=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function a(v,f=!0){return typeof v=="boolean"?!0:f===!0?!c(v):f?o(v)<=f:!1}me.inlineRef=a;const s=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function c(v){for(const f in v){if(s.has(f))return!0;const d=v[f];if(Array.isArray(d)&&d.some(c)||typeof d=="object"&&c(d))return!0}return!1}function o(v){let f=0;for(const d in v){if(d==="$ref")return 1/0;if(f++,!n.has(d)&&(typeof v[d]=="object"&&(0,t.eachItem)(v[d],i=>f+=o(i)),f===1/0))return 1/0}return f}function u(v,f="",d){d!==!1&&(f=$(f));const i=v.parse(f);return h(v,i)}me.getFullPath=u;function h(v,f){return v.serialize(f).split("#")[0]+"#"}me._getFullPath=h;const p=/#\/?$/;function $(v){return v?v.replace(p,""):""}me.normalizeId=$;function w(v,f,d){return d=$(d),v.resolve(f,d)}me.resolveUrl=w;const b=/^[a-z_][-a-z0-9._]*$/i;function E(v,f){if(typeof v=="boolean")return{};const{schemaId:d,uriResolver:i}=this.opts,l=$(v[d]||f),y={"":l},_=u(i,l,!1),g={},k=new Set;return r(v,{allKeys:!0},(Z,F,W,G)=>{if(G===void 0)return;const se=_+F;let de=y[G];typeof Z[d]=="string"&&(de=Ie.call(this,Z[d])),Re.call(this,Z.$anchor),Re.call(this,Z.$dynamicAnchor),y[F]=de;function Ie(ce){const Ve=this.opts.uriResolver.resolve;if(ce=$(de?Ve(de,ce):ce),k.has(ce))throw M(ce);k.add(ce);let q=this.refs[ce];return typeof q=="string"&&(q=this.refs[q]),typeof q=="object"?O(Z,q.schema,ce):ce!==$(se)&&(ce[0]==="#"?(O(Z,g[ce],ce),g[ce]=Z):this.refs[ce]=se),ce}function Re(ce){if(typeof ce=="string"){if(!b.test(ce))throw new Error(`invalid anchor "${ce}"`);Ie.call(this,`#${ce}`)}}}),g;function O(Z,F,W){if(F!==void 0&&!e(Z,F))throw M(W)}function M(Z){return new Error(`reference "${Z}" resolves to more than one schema`)}}return me.getSchemaRefs=E,me}var In;function Ir(){if(In)return Ce;In=1,Object.defineProperty(Ce,"__esModule",{value:!0}),Ce.getData=Ce.KeywordCxt=Ce.validateFunctionCode=void 0;const t=Pi(),e=kr(),r=Ks(),n=kr(),a=Ni(),s=Ii(),c=ji(),o=te(),u=Ke(),h=Nr(),p=ae(),$=Pr();function w(P){if(_(P)&&(k(P),y(P))){f(P);return}b(P,()=>(0,t.topBoolOrEmptySchema)(P))}Ce.validateFunctionCode=w;function b({gen:P,validateName:I,schema:C,schemaEnv:D,opts:K},ee){K.code.es5?P.func(I,(0,o._)`${u.default.data}, ${u.default.valCxt}`,D.$async,()=>{P.code((0,o._)`"use strict"; ${i(C,K)}`),v(P,K),P.code(ee)}):P.func(I,(0,o._)`${u.default.data}, ${E(K)}`,D.$async,()=>P.code(i(C,K)).code(ee))}function E(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 v(P,I){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}`),I.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),I.dynamicRef&&P.var(u.default.dynamicAnchors,(0,o._)`{}`)})}function f(P){const{schema:I,opts:C,gen:D}=P;b(P,()=>{C.$comment&&I.$comment&&G(P),Z(P),D.let(u.default.vErrors,null),D.let(u.default.errors,0),C.unevaluated&&d(P),O(P),se(P)})}function d(P){const{gen:I,validateName:C}=P;P.evaluated=I.const("evaluated",(0,o._)`${C}.evaluated`),I.if((0,o._)`${P.evaluated}.dynamicProps`,()=>I.assign((0,o._)`${P.evaluated}.props`,(0,o._)`undefined`)),I.if((0,o._)`${P.evaluated}.dynamicItems`,()=>I.assign((0,o._)`${P.evaluated}.items`,(0,o._)`undefined`))}function i(P,I){const C=typeof P=="object"&&P[I.schemaId];return C&&(I.code.source||I.code.process)?(0,o._)`/*# sourceURL=${C} */`:o.nil}function l(P,I){if(_(P)&&(k(P),y(P))){g(P,I);return}(0,t.boolOrEmptySchema)(P,I)}function y({schema:P,self:I}){if(typeof P=="boolean")return!P;for(const C in P)if(I.RULES.all[C])return!0;return!1}function _(P){return typeof P.schema!="boolean"}function g(P,I){const{schema:C,gen:D,opts:K}=P;K.$comment&&C.$comment&&G(P),F(P),W(P);const ee=D.const("_errs",u.default.errors);O(P,ee),D.var(I,(0,o._)`${ee} === ${u.default.errors}`)}function k(P){(0,p.checkUnknownRules)(P),M(P)}function O(P,I){if(P.opts.jtd)return Ie(P,[],!1,I);const C=(0,e.getSchemaTypes)(P.schema),D=(0,e.coerceAndCheckDataType)(P,C);Ie(P,C,!D,I)}function M(P){const{schema:I,errSchemaPath:C,opts:D,self:K}=P;I.$ref&&D.ignoreKeywordsWithRef&&(0,p.schemaHasRulesButRef)(I,K.RULES)&&K.logger.warn(`$ref: keywords ignored in schema at path "${C}"`)}function Z(P){const{schema:I,opts:C}=P;I.default!==void 0&&C.useDefaults&&C.strictSchema&&(0,p.checkStrictMode)(P,"default is ignored in the schema root")}function F(P){const I=P.schema[P.opts.schemaId];I&&(P.baseId=(0,h.resolveUrl)(P.opts.uriResolver,P.baseId,I))}function W(P){if(P.schema.$async&&!P.schemaEnv.$async)throw new Error("async schema in sync schema")}function G({gen:P,schemaEnv:I,schema:C,errSchemaPath:D,opts:K}){const ee=C.$comment;if(K.$comment===!0)P.code((0,o._)`${u.default.self}.logger.log(${ee})`);else if(typeof K.$comment=="function"){const le=(0,o.str)`${D}/$comment`,we=P.scopeValue("root",{ref:I.root});P.code((0,o._)`${u.default.self}.opts.$comment(${ee}, ${le}, ${we}.schema)`)}}function se(P){const{gen:I,schemaEnv:C,validateName:D,ValidationError:K,opts:ee}=P;C.$async?I.if((0,o._)`${u.default.errors} === 0`,()=>I.return(u.default.data),()=>I.throw((0,o._)`new ${K}(${u.default.vErrors})`)):(I.assign((0,o._)`${D}.errors`,u.default.vErrors),ee.unevaluated&&de(P),I.return((0,o._)`${u.default.errors} === 0`))}function de({gen:P,evaluated:I,props:C,items:D}){C instanceof o.Name&&P.assign((0,o._)`${I}.props`,C),D instanceof o.Name&&P.assign((0,o._)`${I}.items`,D)}function Ie(P,I,C,D){const{gen:K,schema:ee,data:le,allErrors:we,opts:ve,self:ge}=P,{RULES:fe}=ge;if(ee.$ref&&(ve.ignoreKeywordsWithRef||!(0,p.schemaHasRulesButRef)(ee,fe))){K.block(()=>U(P,"$ref",fe.all.$ref.definition));return}ve.jtd||ce(P,I),K.block(()=>{for(const be of fe.rules)et(be);et(fe.post)});function et(be){(0,r.shouldUseGroup)(ee,be)&&(be.type?(K.if((0,n.checkDataType)(be.type,le,ve.strictNumbers)),Re(P,be),I.length===1&&I[0]===be.type&&C&&(K.else(),(0,n.reportTypeError)(P)),K.endIf()):Re(P,be),we||K.if((0,o._)`${u.default.errors} === ${D||0}`))}}function Re(P,I){const{gen:C,schema:D,opts:{useDefaults:K}}=P;K&&(0,a.assignDefaults)(P,I.type),C.block(()=>{for(const ee of I.rules)(0,r.shouldUseRule)(D,ee)&&U(P,ee.keyword,ee.definition,I.type)})}function ce(P,I){P.schemaEnv.meta||!P.opts.strictTypes||(Ve(P,I),P.opts.allowUnionTypes||q(P,I),N(P,P.dataTypes))}function Ve(P,I){if(I.length){if(!P.dataTypes.length){P.dataTypes=I;return}I.forEach(C=>{T(P.dataTypes,C)||S(P,`type "${C}" not allowed by context "${P.dataTypes.join(",")}"`)}),m(P,I)}}function q(P,I){I.length>1&&!(I.length===2&&I.includes("null"))&&S(P,"use allowUnionTypes to allow union type keyword")}function N(P,I){const C=P.self.RULES.all;for(const D in C){const K=C[D];if(typeof K=="object"&&(0,r.shouldUseRule)(P.schema,K)){const{type:ee}=K.definition;ee.length&&!ee.some(le=>A(I,le))&&S(P,`missing type "${ee.join(",")}" for keyword "${D}"`)}}}function A(P,I){return P.includes(I)||I==="number"&&P.includes("integer")}function T(P,I){return P.includes(I)||I==="integer"&&P.includes("number")}function m(P,I){const C=[];for(const D of P.dataTypes)T(I,D)?C.push(D):I.includes("integer")&&D==="number"&&C.push("integer");P.dataTypes=C}function S(P,I){const C=P.schemaEnv.baseId+P.errSchemaPath;I+=` at "${C}" (strictTypes)`,(0,p.checkStrictMode)(P,I,P.opts.strictTypes)}class R{constructor(I,C,D){if((0,s.validateKeywordUsage)(I,C,D),this.gen=I.gen,this.allErrors=I.allErrors,this.keyword=D,this.data=I.data,this.schema=I.schema[D],this.$data=C.$data&&I.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,p.schemaRefOrVal)(I,this.schema,D,this.$data),this.schemaType=C.schemaType,this.parentSchema=I.schema,this.params={},this.it=I,this.def=C,this.$data)this.schemaCode=I.gen.const("vSchema",re(this.$data,I));else if(this.schemaCode=this.schemaValue,!(0,s.validSchemaType)(this.schema,C.schemaType,C.allowUndefined))throw new Error(`${D} value must be ${JSON.stringify(C.schemaType)}`);("code"in C?C.trackErrors:C.errors!==!1)&&(this.errsCount=I.gen.const("_errs",u.default.errors))}result(I,C,D){this.failResult((0,o.not)(I),C,D)}failResult(I,C,D){this.gen.if(I),D?D():this.error(),C?(this.gen.else(),C(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(I,C){this.failResult((0,o.not)(I),void 0,C)}fail(I){if(I===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(I),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(I){if(!this.$data)return this.fail(I);const{schemaCode:C}=this;this.fail((0,o._)`${C} !== undefined && (${(0,o.or)(this.invalid$data(),I)})`)}error(I,C,D){if(C){this.setParams(C),this._error(I,D),this.setParams({});return}this._error(I,D)}_error(I,C){(I?$.reportExtraError:$.reportError)(this,this.def.error,C)}$dataError(){(0,$.reportError)(this,this.def.$dataError||$.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,$.resetErrorsCount)(this.gen,this.errsCount)}ok(I){this.allErrors||this.gen.if(I)}setParams(I,C){C?Object.assign(this.params,I):this.params=I}block$data(I,C,D=o.nil){this.gen.block(()=>{this.check$data(I,D),C()})}check$data(I=o.nil,C=o.nil){if(!this.$data)return;const{gen:D,schemaCode:K,schemaType:ee,def:le}=this;D.if((0,o.or)((0,o._)`${K} === undefined`,C)),I!==o.nil&&D.assign(I,!0),(ee.length||le.validateSchema)&&(D.elseIf(this.invalid$data()),this.$dataError(),I!==o.nil&&D.assign(I,!1)),D.else()}invalid$data(){const{gen:I,schemaCode:C,schemaType:D,def:K,it:ee}=this;return(0,o.or)(le(),we());function le(){if(D.length){if(!(C instanceof o.Name))throw new Error("ajv implementation error");const ve=Array.isArray(D)?D:[D];return(0,o._)`${(0,n.checkDataTypes)(ve,C,ee.opts.strictNumbers,n.DataType.Wrong)}`}return o.nil}function we(){if(K.validateSchema){const ve=I.scopeValue("validate$data",{ref:K.validateSchema});return(0,o._)`!${ve}(${C})`}return o.nil}}subschema(I,C){const D=(0,c.getSubschema)(this.it,I);(0,c.extendSubschemaData)(D,this.it,I),(0,c.extendSubschemaMode)(D,I);const K={...this.it,...D,items:void 0,props:void 0};return l(K,C),K}mergeEvaluated(I,C){const{it:D,gen:K}=this;D.opts.unevaluated&&(D.props!==!0&&I.props!==void 0&&(D.props=p.mergeEvaluated.props(K,I.props,D.props,C)),D.items!==!0&&I.items!==void 0&&(D.items=p.mergeEvaluated.items(K,I.items,D.items,C)))}mergeValidEvaluated(I,C){const{it:D,gen:K}=this;if(D.opts.unevaluated&&(D.props!==!0||D.items!==!0))return K.if(C,()=>this.mergeEvaluated(I,o.Name)),!0}}Ce.KeywordCxt=R;function U(P,I,C,D){const K=new R(P,C,I);"code"in C?C.code(K,D):K.$data&&C.validate?(0,s.funcKeywordCode)(K,C):"macro"in C?(0,s.macroKeywordCode)(K,C):(C.compile||C.validate)&&(0,s.funcKeywordCode)(K,C)}const H=/^\/(?:[^~]|~0|~1)*$/,ie=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function re(P,{dataLevel:I,dataNames:C,dataPathArr:D}){let K,ee;if(P==="")return u.default.rootData;if(P[0]==="/"){if(!H.test(P))throw new Error(`Invalid JSON-pointer: ${P}`);K=P,ee=u.default.rootData}else{const ge=ie.exec(P);if(!ge)throw new Error(`Invalid JSON-pointer: ${P}`);const fe=+ge[1];if(K=ge[2],K==="#"){if(fe>=I)throw new Error(ve("property/index",fe));return D[I-fe]}if(fe>I)throw new Error(ve("data",fe));if(ee=C[I-fe],!K)return ee}let le=ee;const we=K.split("/");for(const ge of we)ge&&(ee=(0,o._)`${ee}${(0,o.getProperty)((0,p.unescapeJsonPointer)(ge))}`,le=(0,o._)`${le} && ${ee}`);return le;function ve(ge,fe){return`Cannot access ${ge} ${fe} levels up, current level is ${I}`}}return Ce.getData=re,Ce}var Rt={},jn;function Qr(){if(jn)return Rt;jn=1,Object.defineProperty(Rt,"__esModule",{value:!0});class t extends Error{constructor(r){super("validation failed"),this.errors=r,this.ajv=this.validation=!0}}return Rt.default=t,Rt}var Ct={},Tn;function jr(){if(Tn)return Ct;Tn=1,Object.defineProperty(Ct,"__esModule",{value:!0});const t=Nr();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 Ct.default=e,Ct}var _e={},On;function en(){if(On)return _e;On=1,Object.defineProperty(_e,"__esModule",{value:!0}),_e.resolveSchema=_e.getCompilingSchema=_e.resolveRef=_e.compileSchema=_e.SchemaEnv=void 0;const t=te(),e=Qr(),r=Ke(),n=Nr(),a=ae(),s=Ir();class c{constructor(d){var i;this.refs={},this.dynamicAnchors={};let l;typeof d.schema=="object"&&(l=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)(l?.[d.schemaId||"$id"]),this.schemaPath=d.schemaPath,this.localRefs=d.localRefs,this.meta=d.meta,this.$async=l?.$async,this.refs={}}}_e.SchemaEnv=c;function o(f){const d=p.call(this,f);if(d)return d;const i=(0,n.getFullPath)(this.opts.uriResolver,f.root.baseId),{es5:l,lines:y}=this.opts.code,{ownProperties:_}=this.opts,g=new t.CodeGen(this.scope,{es5:l,lines:y,ownProperties:_});let k;f.$async&&(k=g.scopeValue("Error",{ref:e.default,code:(0,t._)`require("ajv/dist/runtime/validation_error").default`}));const O=g.scopeName("validate");f.validateName=O;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:O,ValidationError:k,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 Z;try{this._compilations.add(f),(0,s.validateFunctionCode)(M),g.optimize(this.opts.code.optimize);const F=g.toString();Z=`${g.scopeRefs(r.default.scope)}return ${F}`,this.opts.code.process&&(Z=this.opts.code.process(Z,f));const G=new Function(`${r.default.self}`,`${r.default.scope}`,Z)(this,this.scope.get());if(this.scope.value(O,{ref:G}),G.errors=null,G.schema=f.schema,G.schemaEnv=f,f.$async&&(G.$async=!0),this.opts.code.source===!0&&(G.source={validateName:O,validateCode:F,scopeValues:g._values}),this.opts.unevaluated){const{props:se,items:de}=M;G.evaluated={props:se instanceof t.Name?void 0:se,items:de instanceof t.Name?void 0:de,dynamicProps:se instanceof t.Name,dynamicItems:de instanceof t.Name},G.source&&(G.source.evaluated=(0,t.stringify)(G.evaluated))}return f.validate=G,f}catch(F){throw delete f.validate,delete f.validateName,Z&&this.logger.error("Error compiling schema, function code:",Z),F}finally{this._compilations.delete(f)}}_e.compileSchema=o;function u(f,d,i){var l;i=(0,n.resolveUrl)(this.opts.uriResolver,d,i);const y=f.refs[i];if(y)return y;let _=w.call(this,f,i);if(_===void 0){const g=(l=f.localRefs)===null||l===void 0?void 0:l[i],{schemaId:k}=this.opts;g&&(_=new c({schema:g,schemaId:k,root:f,baseId:d}))}if(_!==void 0)return f.refs[i]=h.call(this,_)}_e.resolveRef=u;function h(f){return(0,n.inlineRef)(f.schema,this.opts.inlineRefs)?f.schema:f.validate?f:o.call(this,f)}function p(f){for(const d of this._compilations)if($(d,f))return d}_e.getCompilingSchema=p;function $(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]||b.call(this,f,d)}function b(f,d){const i=this.opts.uriResolver.parse(d),l=(0,n._getFullPath)(this.opts.uriResolver,i);let y=(0,n.getFullPath)(this.opts.uriResolver,f.baseId,void 0);if(Object.keys(f.schema).length>0&&l===y)return v.call(this,i,f);const _=(0,n.normalizeId)(l),g=this.refs[_]||this.schemas[_];if(typeof g=="string"){const k=b.call(this,f,g);return typeof k?.schema!="object"?void 0:v.call(this,i,k)}if(typeof g?.schema=="object"){if(g.validate||o.call(this,g),_===(0,n.normalizeId)(d)){const{schema:k}=g,{schemaId:O}=this.opts,M=k[O];return M&&(y=(0,n.resolveUrl)(this.opts.uriResolver,y,M)),new c({schema:k,schemaId:O,root:f,baseId:y})}return v.call(this,i,g)}}_e.resolveSchema=b;const E=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function v(f,{baseId:d,schema:i,root:l}){var y;if(((y=f.fragment)===null||y===void 0?void 0:y[0])!=="/")return;for(const k of f.fragment.slice(1).split("/")){if(typeof i=="boolean")return;const O=i[(0,a.unescapeFragment)(k)];if(O===void 0)return;i=O;const M=typeof i=="object"&&i[this.opts.schemaId];!E.has(k)&&M&&(d=(0,n.resolveUrl)(this.opts.uriResolver,d,M))}let _;if(typeof i!="boolean"&&i.$ref&&!(0,a.schemaHasRulesButRef)(i,this.RULES)){const k=(0,n.resolveUrl)(this.opts.uriResolver,d,i.$ref);_=b.call(this,l,k)}const{schemaId:g}=this.opts;if(_=_||new c({schema:i,schemaId:g,root:l,baseId:d}),_.schema!==_.root.schema)return _}return _e}const Oi="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",Ri="Meta-schema for $data reference (JSON AnySchema extension proposal)",Ci="object",Ai=["$data"],xi={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},Mi=!1;var qi={$id:Oi,description:Ri,type:Ci,required:Ai,properties:xi,additionalProperties:Mi},At={},ft={exports:{}},Zr,Rn;function Di(){return Rn||(Rn=1,Zr={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}}),Zr}var Ur,Cn;function Vi(){if(Cn)return Ur;Cn=1;const{HEX:t}=Di(),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(v){if(o(v,".")<3)return{host:v,isIPV4:!1};const f=v.match(e)||[],[d]=f;return d?{host:c(d,"."),isIPV4:!0}:{host:v,isIPV4:!1}}function n(v,f=!1){let d="",i=!0;for(const l of v){if(t[l]===void 0)return;l!=="0"&&i===!0&&(i=!1),i||(d+=l)}return f&&d.length===0&&(d="0"),d}function a(v){let f=0;const d={error:!1,address:"",zone:""},i=[],l=[];let y=!1,_=!1,g=!1;function k(){if(l.length){if(y===!1){const O=n(l);if(O!==void 0)i.push(O);else return d.error=!0,!1}l.length=0}return!0}for(let O=0;O<v.length;O++){const M=v[O];if(!(M==="["||M==="]"))if(M===":"){if(_===!0&&(g=!0),!k())break;if(f++,i.push(":"),f>7){d.error=!0;break}O-1>=0&&v[O-1]===":"&&(_=!0);continue}else if(M==="%"){if(!k())break;y=!0}else{l.push(M);continue}}return l.length&&(y?d.zone=l.join(""):g?i.push(l.join("")):i.push(n(l))),d.address=i.join(""),d}function s(v){if(o(v,":")<2)return{host:v,isIPV6:!1};const f=a(v);if(f.error)return{host:v,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(v,f){let d="",i=!0;const l=v.length;for(let y=0;y<l;y++){const _=v[y];_==="0"&&i?(y+1<=l&&v[y+1]===f||y+1===l)&&(d+=_,i=!1):(_===f?i=!0:i=!1,d+=_)}return d}function o(v,f){let d=0;for(let i=0;i<v.length;i++)v[i]===f&&d++;return d}const u=/^\.\.?\//u,h=/^\/\.(?:\/|$)/u,p=/^\/\.\.(?:\/|$)/u,$=/^\/?(?:.|\n)*?(?=\/|$)/u;function w(v){const f=[];for(;v.length;)if(v.match(u))v=v.replace(u,"");else if(v.match(h))v=v.replace(h,"/");else if(v.match(p))v=v.replace(p,"/"),f.pop();else if(v==="."||v==="..")v="";else{const d=v.match($);if(d){const i=d[0];v=v.slice(i.length),f.push(i)}else throw new Error("Unexpected dot segment condition")}return f.join("")}function b(v,f){const d=f!==!0?escape:unescape;return v.scheme!==void 0&&(v.scheme=d(v.scheme)),v.userinfo!==void 0&&(v.userinfo=d(v.userinfo)),v.host!==void 0&&(v.host=d(v.host)),v.path!==void 0&&(v.path=d(v.path)),v.query!==void 0&&(v.query=d(v.query)),v.fragment!==void 0&&(v.fragment=d(v.fragment)),v}function E(v){const f=[];if(v.userinfo!==void 0&&(f.push(v.userinfo),f.push("@")),v.host!==void 0){let d=unescape(v.host);const i=r(d);if(i.isIPV4)d=i.host;else{const l=s(i.host);l.isIPV6===!0?d=`[${l.escapedHost}]`:d=v.host}f.push(d)}return(typeof v.port=="number"||typeof v.port=="string")&&(f.push(":"),f.push(String(v.port))),f.length?f.join(""):void 0}return Ur={recomposeAuthority:E,normalizeComponentEncoding:b,removeDotSegments:w,normalizeIPv4:r,normalizeIPv6:s,stringArrayToHexStripped:n},Ur}var Lr,An;function zi(){if(An)return Lr;An=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 l=String(i.scheme).toLowerCase()==="https";return(i.port===(l?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[l,y]=i.resourceName.split("?");i.path=l&&l!=="/"?l:void 0,i.query=y,i.resourceName=void 0}return i.fragment=void 0,i}function o(i,l){if(!i.path)return i.error="URN can not be parsed",i;const y=i.path.match(e);if(y){const _=l.scheme||i.scheme||"urn";i.nid=y[1].toLowerCase(),i.nss=y[2];const g=`${_}:${l.nid||i.nid}`,k=d[g];i.path=void 0,k&&(i=k.parse(i,l))}else i.error=i.error||"URN can not be parsed.";return i}function u(i,l){const y=l.scheme||i.scheme||"urn",_=i.nid.toLowerCase(),g=`${y}:${l.nid||_}`,k=d[g];k&&(i=k.serialize(i,l));const O=i,M=i.nss;return O.path=`${_||l.nid}:${M}`,l.skipEscape=!0,O}function h(i,l){const y=i;return y.uuid=y.nss,y.nss=void 0,!l.tolerant&&(!y.uuid||!t.test(y.uuid))&&(y.error=y.error||"UUID is not valid."),y}function p(i){const l=i;return l.nss=(i.uuid||"").toLowerCase(),l}const $={scheme:"http",domainHost:!0,parse:n,serialize:a},w={scheme:"https",domainHost:$.domainHost,parse:n,serialize:a},b={scheme:"ws",domainHost:!0,parse:s,serialize:c},E={scheme:"wss",domainHost:b.domainHost,parse:b.parse,serialize:b.serialize},d={http:$,https:w,ws:b,wss:E,urn:{scheme:"urn",parse:o,serialize:u,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:h,serialize:p,skipNormalize:!0}};return Lr=d,Lr}var xn;function Zi(){if(xn)return ft.exports;xn=1;const{normalizeIPv6:t,normalizeIPv4:e,removeDotSegments:r,recomposeAuthority:n,normalizeComponentEncoding:a}=Vi(),s=zi();function c(f,d){return typeof f=="string"?f=p(E(f,d),d):typeof f=="object"&&(f=E(p(f,d),d)),f}function o(f,d,i){const l=Object.assign({scheme:"null"},i),y=u(E(f,l),E(d,l),l,!0);return p(y,{...l,skipEscape:!0})}function u(f,d,i,l){const y={};return l||(f=E(p(f,i),i),d=E(p(d,i),i)),i=i||{},!i.tolerant&&d.scheme?(y.scheme=d.scheme,y.userinfo=d.userinfo,y.host=d.host,y.port=d.port,y.path=r(d.path||""),y.query=d.query):(d.userinfo!==void 0||d.host!==void 0||d.port!==void 0?(y.userinfo=d.userinfo,y.host=d.host,y.port=d.port,y.path=r(d.path||""),y.query=d.query):(d.path?(d.path.charAt(0)==="/"?y.path=r(d.path):((f.userinfo!==void 0||f.host!==void 0||f.port!==void 0)&&!f.path?y.path="/"+d.path:f.path?y.path=f.path.slice(0,f.path.lastIndexOf("/")+1)+d.path:y.path=d.path,y.path=r(y.path)),y.query=d.query):(y.path=f.path,d.query!==void 0?y.query=d.query:y.query=f.query),y.userinfo=f.userinfo,y.host=f.host,y.port=f.port),y.scheme=f.scheme),y.fragment=d.fragment,y}function h(f,d,i){return typeof f=="string"?(f=unescape(f),f=p(a(E(f,i),!0),{...i,skipEscape:!0})):typeof f=="object"&&(f=p(a(f,!0),{...i,skipEscape:!0})),typeof d=="string"?(d=unescape(d),d=p(a(E(d,i),!0),{...i,skipEscape:!0})):typeof d=="object"&&(d=p(a(d,!0),{...i,skipEscape:!0})),f.toLowerCase()===d.toLowerCase()}function p(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:""},l=Object.assign({},d),y=[],_=s[(l.scheme||i.scheme||"").toLowerCase()];_&&_.serialize&&_.serialize(i,l),i.path!==void 0&&(l.skipEscape?i.path=unescape(i.path):(i.path=escape(i.path),i.scheme!==void 0&&(i.path=i.path.split("%3A").join(":")))),l.reference!=="suffix"&&i.scheme&&y.push(i.scheme,":");const g=n(i);if(g!==void 0&&(l.reference!=="suffix"&&y.push("//"),y.push(g),i.path&&i.path.charAt(0)!=="/"&&y.push("/")),i.path!==void 0){let k=i.path;!l.absolutePath&&(!_||!_.absolutePath)&&(k=r(k)),g===void 0&&(k=k.replace(/^\/\//u,"/%2F")),y.push(k)}return i.query!==void 0&&y.push("?",i.query),i.fragment!==void 0&&y.push("#",i.fragment),y.join("")}const $=Array.from({length:127},(f,d)=>/[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(d)));function w(f){let d=0;for(let i=0,l=f.length;i<l;++i)if(d=f.charCodeAt(i),d>126||$[d])return!0;return!1}const b=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function E(f,d){const i=Object.assign({},d),l={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},y=f.indexOf("%")!==-1;let _=!1;i.reference==="suffix"&&(f=(i.scheme?i.scheme+":":"")+"//"+f);const g=f.match(b);if(g){if(l.scheme=g[1],l.userinfo=g[3],l.host=g[4],l.port=parseInt(g[5],10),l.path=g[6]||"",l.query=g[7],l.fragment=g[8],isNaN(l.port)&&(l.port=g[5]),l.host){const O=e(l.host);if(O.isIPV4===!1){const M=t(O.host);l.host=M.host.toLowerCase(),_=M.isIPV6}else l.host=O.host,_=!0}l.scheme===void 0&&l.userinfo===void 0&&l.host===void 0&&l.port===void 0&&l.query===void 0&&!l.path?l.reference="same-document":l.scheme===void 0?l.reference="relative":l.fragment===void 0?l.reference="absolute":l.reference="uri",i.reference&&i.reference!=="suffix"&&i.reference!==l.reference&&(l.error=l.error||"URI is not a "+i.reference+" reference.");const k=s[(i.scheme||l.scheme||"").toLowerCase()];if(!i.unicodeSupport&&(!k||!k.unicodeSupport)&&l.host&&(i.domainHost||k&&k.domainHost)&&_===!1&&w(l.host))try{l.host=URL.domainToASCII(l.host.toLowerCase())}catch(O){l.error=l.error||"Host's domain name can not be converted to ASCII: "+O}(!k||k&&!k.skipNormalize)&&(y&&l.scheme!==void 0&&(l.scheme=unescape(l.scheme)),y&&l.host!==void 0&&(l.host=unescape(l.host)),l.path&&(l.path=escape(unescape(l.path))),l.fragment&&(l.fragment=encodeURI(decodeURIComponent(l.fragment)))),k&&k.parse&&k.parse(l,i)}else l.error=l.error||"URI can not be parsed.";return l}const v={SCHEMES:s,normalize:c,resolve:o,resolveComponents:u,equal:h,serialize:p,parse:E};return ft.exports=v,ft.exports.default=v,ft.exports.fastUri=v,ft.exports}var Mn;function Ui(){if(Mn)return At;Mn=1,Object.defineProperty(At,"__esModule",{value:!0});const t=Zi();return t.code='require("ajv/dist/runtime/uri").default',At.default=t,At}var qn;function Li(){return qn||(qn=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=Ir();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return e.KeywordCxt}});var r=te();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=Qr(),a=jr(),s=Fs(),c=en(),o=te(),u=Nr(),h=kr(),p=ae(),$=qi,w=Ui(),b=(q,N)=>new RegExp(q,N);b.code="new RegExp";const E=["removeAdditional","useDefaults","coerceTypes"],v=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 l(q){var N,A,T,m,S,R,U,H,ie,re,P,I,C,D,K,ee,le,we,ve,ge,fe,et,be,Tr,Or;const dt=q.strict,Rr=(N=q.code)===null||N===void 0?void 0:N.optimize,rn=Rr===!0||Rr===void 0?1:Rr||0,nn=(T=(A=q.code)===null||A===void 0?void 0:A.regExp)!==null&&T!==void 0?T:b,Ys=(m=q.uriResolver)!==null&&m!==void 0?m:w.default;return{strictSchema:(R=(S=q.strictSchema)!==null&&S!==void 0?S:dt)!==null&&R!==void 0?R:!0,strictNumbers:(H=(U=q.strictNumbers)!==null&&U!==void 0?U:dt)!==null&&H!==void 0?H:!0,strictTypes:(re=(ie=q.strictTypes)!==null&&ie!==void 0?ie:dt)!==null&&re!==void 0?re:"log",strictTuples:(I=(P=q.strictTuples)!==null&&P!==void 0?P:dt)!==null&&I!==void 0?I:"log",strictRequired:(D=(C=q.strictRequired)!==null&&C!==void 0?C:dt)!==null&&D!==void 0?D:!1,code:q.code?{...q.code,optimize:rn,regExp:nn}:{optimize:rn,regExp:nn},loopRequired:(K=q.loopRequired)!==null&&K!==void 0?K:i,loopEnum:(ee=q.loopEnum)!==null&&ee!==void 0?ee:i,meta:(le=q.meta)!==null&&le!==void 0?le:!0,messages:(we=q.messages)!==null&&we!==void 0?we:!0,inlineRefs:(ve=q.inlineRefs)!==null&&ve!==void 0?ve:!0,schemaId:(ge=q.schemaId)!==null&&ge!==void 0?ge:"$id",addUsedSchema:(fe=q.addUsedSchema)!==null&&fe!==void 0?fe:!0,validateSchema:(et=q.validateSchema)!==null&&et!==void 0?et:!0,validateFormats:(be=q.validateFormats)!==null&&be!==void 0?be:!0,unicodeRegExp:(Tr=q.unicodeRegExp)!==null&&Tr!==void 0?Tr:!0,int32range:(Or=q.int32range)!==null&&Or!==void 0?Or:!0,uriResolver:Ys}}class y{constructor(N={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,N=this.opts={...N,...l(N)};const{es5:A,lines:T}=this.opts.code;this.scope=new o.ValueScope({scope:{},prefixes:v,es5:A,lines:T}),this.logger=W(N.logger);const m=N.validateFormats;N.validateFormats=!1,this.RULES=(0,s.getRules)(),_.call(this,f,N,"NOT SUPPORTED"),_.call(this,d,N,"DEPRECATED","warn"),this._metaOpts=Z.call(this),N.formats&&O.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),N.keywords&&M.call(this,N.keywords),typeof N.meta=="object"&&this.addMetaSchema(N.meta),k.call(this),N.validateFormats=m}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:N,meta:A,schemaId:T}=this.opts;let m=$;T==="id"&&(m={...$},m.id=m.$id,delete m.$id),A&&N&&this.addMetaSchema(m,m[T],!1)}defaultMeta(){const{meta:N,schemaId:A}=this.opts;return this.opts.defaultMeta=typeof N=="object"?N[A]||N:void 0}validate(N,A){let T;if(typeof N=="string"){if(T=this.getSchema(N),!T)throw new Error(`no schema with key or ref "${N}"`)}else T=this.compile(N);const m=T(A);return"$async"in T||(this.errors=T.errors),m}compile(N,A){const T=this._addSchema(N,A);return T.validate||this._compileSchemaEnv(T)}compileAsync(N,A){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:T}=this.opts;return m.call(this,N,A);async function m(re,P){await S.call(this,re.$schema);const I=this._addSchema(re,P);return I.validate||R.call(this,I)}async function S(re){re&&!this.getSchema(re)&&await m.call(this,{$ref:re},!0)}async function R(re){try{return this._compileSchemaEnv(re)}catch(P){if(!(P instanceof a.default))throw P;return U.call(this,P),await H.call(this,P.missingSchema),R.call(this,re)}}function U({missingSchema:re,missingRef:P}){if(this.refs[re])throw new Error(`AnySchema ${re} is loaded but ${P} cannot be resolved`)}async function H(re){const P=await ie.call(this,re);this.refs[re]||await S.call(this,P.$schema),this.refs[re]||this.addSchema(P,re,A)}async function ie(re){const P=this._loading[re];if(P)return P;try{return await(this._loading[re]=T(re))}finally{delete this._loading[re]}}}addSchema(N,A,T,m=this.opts.validateSchema){if(Array.isArray(N)){for(const R of N)this.addSchema(R,void 0,T,m);return this}let S;if(typeof N=="object"){const{schemaId:R}=this.opts;if(S=N[R],S!==void 0&&typeof S!="string")throw new Error(`schema ${R} must be string`)}return A=(0,u.normalizeId)(A||S),this._checkUnique(A),this.schemas[A]=this._addSchema(N,T,A,m,!0),this}addMetaSchema(N,A,T=this.opts.validateSchema){return this.addSchema(N,A,!0,T),this}validateSchema(N,A){if(typeof N=="boolean")return!0;let T;if(T=N.$schema,T!==void 0&&typeof T!="string")throw new Error("$schema must be a string");if(T=T||this.opts.defaultMeta||this.defaultMeta(),!T)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const m=this.validate(T,N);if(!m&&A){const S="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(S);else throw new Error(S)}return m}getSchema(N){let A;for(;typeof(A=g.call(this,N))=="string";)N=A;if(A===void 0){const{schemaId:T}=this.opts,m=new c.SchemaEnv({schema:{},schemaId:T});if(A=c.resolveSchema.call(this,m,N),!A)return;this.refs[N]=A}return A.validate||this._compileSchemaEnv(A)}removeSchema(N){if(N instanceof RegExp)return this._removeAllSchemas(this.schemas,N),this._removeAllSchemas(this.refs,N),this;switch(typeof N){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const A=g.call(this,N);return typeof A=="object"&&this._cache.delete(A.schema),delete this.schemas[N],delete this.refs[N],this}case"object":{const A=N;this._cache.delete(A);let T=N[this.opts.schemaId];return T&&(T=(0,u.normalizeId)(T),delete this.schemas[T],delete this.refs[T]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(N){for(const A of N)this.addKeyword(A);return this}addKeyword(N,A){let T;if(typeof N=="string")T=N,typeof A=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),A.keyword=T);else if(typeof N=="object"&&A===void 0){if(A=N,T=A.keyword,Array.isArray(T)&&!T.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(se.call(this,T,A),!A)return(0,p.eachItem)(T,S=>de.call(this,S)),this;Re.call(this,A);const m={...A,type:(0,h.getJSONTypes)(A.type),schemaType:(0,h.getJSONTypes)(A.schemaType)};return(0,p.eachItem)(T,m.type.length===0?S=>de.call(this,S,m):S=>m.type.forEach(R=>de.call(this,S,m,R))),this}getKeyword(N){const A=this.RULES.all[N];return typeof A=="object"?A.definition:!!A}removeKeyword(N){const{RULES:A}=this;delete A.keywords[N],delete A.all[N];for(const T of A.rules){const m=T.rules.findIndex(S=>S.keyword===N);m>=0&&T.rules.splice(m,1)}return this}addFormat(N,A){return typeof A=="string"&&(A=new RegExp(A)),this.formats[N]=A,this}errorsText(N=this.errors,{separator:A=", ",dataVar:T="data"}={}){return!N||N.length===0?"No errors":N.map(m=>`${T}${m.instancePath} ${m.message}`).reduce((m,S)=>m+A+S)}$dataMetaSchema(N,A){const T=this.RULES.all;N=JSON.parse(JSON.stringify(N));for(const m of A){const S=m.split("/").slice(1);let R=N;for(const U of S)R=R[U];for(const U in T){const H=T[U];if(typeof H!="object")continue;const{$data:ie}=H.definition,re=R[U];ie&&re&&(R[U]=Ve(re))}}return N}_removeAllSchemas(N,A){for(const T in N){const m=N[T];(!A||A.test(T))&&(typeof m=="string"?delete N[T]:m&&!m.meta&&(this._cache.delete(m.schema),delete N[T]))}}_addSchema(N,A,T,m=this.opts.validateSchema,S=this.opts.addUsedSchema){let R;const{schemaId:U}=this.opts;if(typeof N=="object")R=N[U];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof N!="boolean")throw new Error("schema must be object or boolean")}let H=this._cache.get(N);if(H!==void 0)return H;T=(0,u.normalizeId)(R||T);const ie=u.getSchemaRefs.call(this,N,T);return H=new c.SchemaEnv({schema:N,schemaId:U,meta:A,baseId:T,localRefs:ie}),this._cache.set(H.schema,H),S&&!T.startsWith("#")&&(T&&this._checkUnique(T),this.refs[T]=H),m&&this.validateSchema(N,!0),H}_checkUnique(N){if(this.schemas[N]||this.refs[N])throw new Error(`schema with key or id "${N}" already exists`)}_compileSchemaEnv(N){if(N.meta?this._compileMetaSchema(N):c.compileSchema.call(this,N),!N.validate)throw new Error("ajv implementation error");return N.validate}_compileMetaSchema(N){const A=this.opts;this.opts=this._metaOpts;try{c.compileSchema.call(this,N)}finally{this.opts=A}}}y.ValidationError=n.default,y.MissingRefError=a.default,t.default=y;function _(q,N,A,T="error"){for(const m in q){const S=m;S in N&&this.logger[T](`${A}: option ${m}. ${q[S]}`)}}function g(q){return q=(0,u.normalizeId)(q),this.schemas[q]||this.refs[q]}function k(){const q=this.opts.schemas;if(q)if(Array.isArray(q))this.addSchema(q);else for(const N in q)this.addSchema(q[N],N)}function O(){for(const q in this.opts.formats){const N=this.opts.formats[q];N&&this.addFormat(q,N)}}function M(q){if(Array.isArray(q)){this.addVocabulary(q);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const N in q){const A=q[N];A.keyword||(A.keyword=N),this.addKeyword(A)}}function Z(){const q={...this.opts};for(const N of E)delete q[N];return q}const F={log(){},warn(){},error(){}};function W(q){if(q===!1)return F;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 G=/^[a-z_$][a-z0-9_$:-]*$/i;function se(q,N){const{RULES:A}=this;if((0,p.eachItem)(q,T=>{if(A.keywords[T])throw new Error(`Keyword ${T} is already defined`);if(!G.test(T))throw new Error(`Keyword ${T} has invalid name`)}),!!N&&N.$data&&!("code"in N||"validate"in N))throw new Error('$data keyword must have "code" or "validate" function')}function de(q,N,A){var T;const m=N?.post;if(A&&m)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:S}=this;let R=m?S.post:S.rules.find(({type:H})=>H===A);if(R||(R={type:A,rules:[]},S.rules.push(R)),S.keywords[q]=!0,!N)return;const U={keyword:q,definition:{...N,type:(0,h.getJSONTypes)(N.type),schemaType:(0,h.getJSONTypes)(N.schemaType)}};N.before?Ie.call(this,R,U,N.before):R.rules.push(U),S.all[q]=U,(T=N.implements)===null||T===void 0||T.forEach(H=>this.addKeyword(H))}function Ie(q,N,A){const T=q.rules.findIndex(m=>m.keyword===A);T>=0?q.rules.splice(T,0,N):(q.rules.push(N),this.logger.warn(`rule ${A} is not defined`))}function Re(q){let{metaSchema:N}=q;N!==void 0&&(q.$data&&this.opts.$data&&(N=Ve(N)),q.validateSchema=this.compile(N,!0))}const ce={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Ve(q){return{anyOf:[q,ce]}}}(Ar)),Ar}var xt={},Mt={},qt={},Dn;function Fi(){if(Dn)return qt;Dn=1,Object.defineProperty(qt,"__esModule",{value:!0});const t={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};return qt.default=t,qt}var ze={},Vn;function Ki(){if(Vn)return ze;Vn=1,Object.defineProperty(ze,"__esModule",{value:!0}),ze.callRef=ze.getValidate=void 0;const t=jr(),e=Ne(),r=te(),n=Ke(),a=en(),s=ae(),c={keyword:"$ref",schemaType:"string",code(h){const{gen:p,schema:$,it:w}=h,{baseId:b,schemaEnv:E,validateName:v,opts:f,self:d}=w,{root:i}=E;if(($==="#"||$==="#/")&&b===i.baseId)return y();const l=a.resolveRef.call(d,i,b,$);if(l===void 0)throw new t.default(w.opts.uriResolver,b,$);if(l instanceof a.SchemaEnv)return _(l);return g(l);function y(){if(E===i)return u(h,v,E,E.$async);const k=p.scopeValue("root",{ref:i});return u(h,(0,r._)`${k}.validate`,i,i.$async)}function _(k){const O=o(h,k);u(h,O,k,k.$async)}function g(k){const O=p.scopeValue("schema",f.code.source===!0?{ref:k,code:(0,r.stringify)(k)}:{ref:k}),M=p.name("valid"),Z=h.subschema({schema:k,dataTypes:[],schemaPath:r.nil,topSchemaRef:O,errSchemaPath:$},M);h.mergeEvaluated(Z),h.ok(M)}}};function o(h,p){const{gen:$}=h;return p.validate?$.scopeValue("validate",{ref:p.validate}):(0,r._)`${$.scopeValue("wrapper",{ref:p})}.validate`}ze.getValidate=o;function u(h,p,$,w){const{gen:b,it:E}=h,{allErrors:v,schemaEnv:f,opts:d}=E,i=d.passContext?n.default.this:r.nil;w?l():y();function l(){if(!f.$async)throw new Error("async schema referenced by sync schema");const k=b.let("valid");b.try(()=>{b.code((0,r._)`await ${(0,e.callValidateCode)(h,p,i)}`),g(p),v||b.assign(k,!0)},O=>{b.if((0,r._)`!(${O} instanceof ${E.ValidationError})`,()=>b.throw(O)),_(O),v||b.assign(k,!1)}),h.ok(k)}function y(){h.result((0,e.callValidateCode)(h,p,i),()=>g(p),()=>_(p))}function _(k){const O=(0,r._)`${k}.errors`;b.assign(n.default.vErrors,(0,r._)`${n.default.vErrors} === null ? ${O} : ${n.default.vErrors}.concat(${O})`),b.assign(n.default.errors,(0,r._)`${n.default.vErrors}.length`)}function g(k){var O;if(!E.opts.unevaluated)return;const M=(O=$?.validate)===null||O===void 0?void 0:O.evaluated;if(E.props!==!0)if(M&&!M.dynamicProps)M.props!==void 0&&(E.props=s.mergeEvaluated.props(b,M.props,E.props));else{const Z=b.var("props",(0,r._)`${k}.evaluated.props`);E.props=s.mergeEvaluated.props(b,Z,E.props,r.Name)}if(E.items!==!0)if(M&&!M.dynamicItems)M.items!==void 0&&(E.items=s.mergeEvaluated.items(b,M.items,E.items));else{const Z=b.var("items",(0,r._)`${k}.evaluated.items`);E.items=s.mergeEvaluated.items(b,Z,E.items,r.Name)}}}return ze.callRef=u,ze.default=c,ze}var zn;function Hi(){if(zn)return Mt;zn=1,Object.defineProperty(Mt,"__esModule",{value:!0});const t=Fi(),e=Ki(),r=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",t.default,e.default];return Mt.default=r,Mt}var Dt={},Vt={},Zn;function Gi(){if(Zn)return Vt;Zn=1,Object.defineProperty(Vt,"__esModule",{value:!0});const t=te(),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 Vt.default=a,Vt}var zt={},Un;function Bi(){if(Un)return zt;Un=1,Object.defineProperty(zt,"__esModule",{value:!0});const t=te(),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,h=a.let("res"),p=u?(0,t._)`Math.abs(Math.round(${h}) - ${h}) > 1e-${u}`:(0,t._)`${h} !== parseInt(${h})`;n.fail$data((0,t._)`(${c} === 0 || (${h} = ${s}/${c}, ${p}))`)}};return zt.default=r,zt}var Zt={},Ut={},Ln;function Ji(){if(Ln)return Ut;Ln=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 Fn;function Wi(){if(Fn)return Zt;Fn=1,Object.defineProperty(Zt,"__esModule",{value:!0});const t=te(),e=ae(),r=Ji(),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:h}=s,p=c==="maxLength"?t.operators.GT:t.operators.LT,$=h.opts.unicode===!1?(0,t._)`${o}.length`:(0,t._)`${(0,e.useFunc)(s.gen,r.default)}(${o})`;s.fail$data((0,t._)`${$} ${p} ${u}`)}};return Zt.default=a,Zt}var Lt={},Kn;function Yi(){if(Kn)return Lt;Kn=1,Object.defineProperty(Lt,"__esModule",{value:!0});const t=Ne(),e=te(),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:h}=a,p=h.opts.unicodeRegExp?"u":"",$=c?(0,e._)`(new RegExp(${u}, ${p}))`:(0,t.usePattern)(a,o);a.fail$data((0,e._)`!${$}.test(${s})`)}};return Lt.default=n,Lt}var Ft={},Hn;function Xi(){if(Hn)return Ft;Hn=1,Object.defineProperty(Ft,"__esModule",{value:!0});const t=te(),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 Ft.default=r,Ft}var Kt={},Gn;function Qi(){if(Gn)return Kt;Gn=1,Object.defineProperty(Kt,"__esModule",{value:!0});const t=Ne(),e=te(),r=ae(),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:h,$data:p,it:$}=s,{opts:w}=$;if(!p&&o.length===0)return;const b=o.length>=w.loopRequired;if($.allErrors?E():v(),w.strictRequired){const i=s.parentSchema.properties,{definedProperties:l}=s.it;for(const y of o)if(i?.[y]===void 0&&!l.has(y)){const _=$.schemaEnv.baseId+$.errSchemaPath,g=`required property "${y}" is not defined at "${_}" (strictRequired)`;(0,r.checkStrictMode)($,g,$.opts.strictRequired)}}function E(){if(b||p)s.block$data(e.nil,f);else for(const i of o)(0,t.checkReportMissingProp)(s,i)}function v(){const i=c.let("missing");if(b||p){const l=c.let("valid",!0);s.block$data(l,()=>d(i,l)),s.ok(l)}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,h,i,w.ownProperties),()=>s.error())})}function d(i,l){s.setParams({missingProperty:i}),c.forOf(i,u,()=>{c.assign(l,(0,t.propertyInData)(c,h,i,w.ownProperties)),c.if((0,e.not)(l),()=>{s.error(),c.break()})},e.nil)}}};return Kt.default=a,Kt}var Ht={},Bn;function eo(){if(Bn)return Ht;Bn=1,Object.defineProperty(Ht,"__esModule",{value:!0});const t=te(),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 Ht.default=r,Ht}var Gt={},Bt={},Jn;function tn(){if(Jn)return Bt;Jn=1,Object.defineProperty(Bt,"__esModule",{value:!0});const t=Hs();return t.code='require("ajv/dist/runtime/equal").default',Bt.default=t,Bt}var Wn;function to(){if(Wn)return Gt;Wn=1,Object.defineProperty(Gt,"__esModule",{value:!0});const t=kr(),e=te(),r=ae(),n=tn(),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:h,schema:p,parentSchema:$,schemaCode:w,it:b}=c;if(!h&&!p)return;const E=o.let("valid"),v=$.items?(0,t.getSchemaTypes)($.items):[];c.block$data(E,f,(0,e._)`${w} === false`),c.ok(E);function f(){const y=o.let("i",(0,e._)`${u}.length`),_=o.let("j");c.setParams({i:y,j:_}),o.assign(E,!0),o.if((0,e._)`${y} > 1`,()=>(d()?i:l)(y,_))}function d(){return v.length>0&&!v.some(y=>y==="object"||y==="array")}function i(y,_){const g=o.name("item"),k=(0,t.checkDataTypes)(v,g,b.opts.strictNumbers,t.DataType.Wrong),O=o.const("indices",(0,e._)`{}`);o.for((0,e._)`;${y}--;`,()=>{o.let(g,(0,e._)`${u}[${y}]`),o.if(k,(0,e._)`continue`),v.length>1&&o.if((0,e._)`typeof ${g} == "string"`,(0,e._)`${g} += "_"`),o.if((0,e._)`typeof ${O}[${g}] == "number"`,()=>{o.assign(_,(0,e._)`${O}[${g}]`),c.error(),o.assign(E,!1).break()}).code((0,e._)`${O}[${g}] = ${y}`)})}function l(y,_){const g=(0,r.useFunc)(o,n.default),k=o.name("outer");o.label(k).for((0,e._)`;${y}--;`,()=>o.for((0,e._)`${_} = ${y}; ${_}--;`,()=>o.if((0,e._)`${g}(${u}[${y}], ${u}[${_}])`,()=>{c.error(),o.assign(E,!1).break(k)})))}}};return Gt.default=s,Gt}var Jt={},Yn;function ro(){if(Yn)return Jt;Yn=1,Object.defineProperty(Jt,"__esModule",{value:!0});const t=te(),e=ae(),r=tn(),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:h,schema:p}=s;u||p&&typeof p=="object"?s.fail$data((0,t._)`!${(0,e.useFunc)(c,r.default)}(${o}, ${h})`):s.fail((0,t._)`${p} !== ${o}`)}};return Jt.default=a,Jt}var Wt={},Xn;function no(){if(Xn)return Wt;Xn=1,Object.defineProperty(Wt,"__esModule",{value:!0});const t=te(),e=ae(),r=tn(),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:h,schemaCode:p,it:$}=s;if(!u&&h.length===0)throw new Error("enum must have non-empty array");const w=h.length>=$.opts.loopEnum;let b;const E=()=>b??(b=(0,e.useFunc)(c,r.default));let v;if(w||u)v=c.let("valid"),s.block$data(v,f);else{if(!Array.isArray(h))throw new Error("ajv implementation error");const i=c.const("vSchema",p);v=(0,t.or)(...h.map((l,y)=>d(i,y)))}s.pass(v);function f(){c.assign(v,!1),c.forOf("v",p,i=>c.if((0,t._)`${E()}(${o}, ${i})`,()=>c.assign(v,!0).break()))}function d(i,l){const y=h[l];return typeof y=="object"&&y!==null?(0,t._)`${E()}(${o}, ${i}[${l}])`:(0,t._)`${o} === ${y}`}}};return Wt.default=a,Wt}var Qn;function so(){if(Qn)return Dt;Qn=1,Object.defineProperty(Dt,"__esModule",{value:!0});const t=Gi(),e=Bi(),r=Wi(),n=Yi(),a=Xi(),s=Qi(),c=eo(),o=to(),u=ro(),h=no(),p=[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,h.default];return Dt.default=p,Dt}var Yt={},tt={},es;function Gs(){if(es)return tt;es=1,Object.defineProperty(tt,"__esModule",{value:!0}),tt.validateAdditionalItems=void 0;const t=te(),e=ae(),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:h,keyword:p,it:$}=s;$.items=!0;const w=o.const("len",(0,t._)`${h}.length`);if(u===!1)s.setParams({len:c.length}),s.pass((0,t._)`${w} <= ${c.length}`);else if(typeof u=="object"&&!(0,e.alwaysValidSchema)($,u)){const E=o.var("valid",(0,t._)`${w} <= ${c.length}`);o.if((0,t.not)(E),()=>b(E)),s.ok(E)}function b(E){o.forRange("i",c.length,w,v=>{s.subschema({keyword:p,dataProp:v,dataPropType:e.Type.Num},E),$.allErrors||o.if((0,t.not)(E),()=>o.break())})}}return tt.validateAdditionalItems=a,tt.default=n,tt}var Xt={},rt={},ts;function Bs(){if(ts)return rt;ts=1,Object.defineProperty(rt,"__esModule",{value:!0}),rt.validateTuple=void 0;const t=te(),e=ae(),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:h,data:p,keyword:$,it:w}=s;v(h),w.opts.unevaluated&&o.length&&w.items!==!0&&(w.items=e.mergeEvaluated.items(u,o.length,w.items));const b=u.name("valid"),E=u.const("len",(0,t._)`${p}.length`);o.forEach((f,d)=>{(0,e.alwaysValidSchema)(w,f)||(u.if((0,t._)`${E} > ${d}`,()=>s.subschema({keyword:$,schemaProp:d,dataProp:d},b)),s.ok(b))});function v(f){const{opts:d,errSchemaPath:i}=w,l=o.length,y=l===f.minItems&&(l===f.maxItems||f[c]===!1);if(d.strictTuples&&!y){const _=`"${$}" is ${l}-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 rs;function ao(){if(rs)return Xt;rs=1,Object.defineProperty(Xt,"__esModule",{value:!0});const t=Bs(),e={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:r=>(0,t.validateTuple)(r,"items")};return Xt.default=e,Xt}var Qt={},ns;function io(){if(ns)return Qt;ns=1,Object.defineProperty(Qt,"__esModule",{value:!0});const t=te(),e=ae(),r=Ne(),n=Gs(),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:h}=c,{prefixItems:p}=u;h.items=!0,!(0,e.alwaysValidSchema)(h,o)&&(p?(0,n.validateAdditionalItems)(c,p):c.ok((0,r.validateArray)(c)))}};return Qt.default=s,Qt}var er={},ss;function oo(){if(ss)return er;ss=1,Object.defineProperty(er,"__esModule",{value:!0});const t=te(),e=ae(),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:h}=a;let p,$;const{minContains:w,maxContains:b}=o;h.opts.next?(p=w===void 0?1:w,$=b):p=1;const E=s.const("len",(0,t._)`${u}.length`);if(a.setParams({min:p,max:$}),$===void 0&&p===0){(0,e.checkStrictMode)(h,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if($!==void 0&&p>$){(0,e.checkStrictMode)(h,'"minContains" > "maxContains" is always invalid'),a.fail();return}if((0,e.alwaysValidSchema)(h,c)){let l=(0,t._)`${E} >= ${p}`;$!==void 0&&(l=(0,t._)`${l} && ${E} <= ${$}`),a.pass(l);return}h.items=!0;const v=s.name("valid");$===void 0&&p===1?d(v,()=>s.if(v,()=>s.break())):p===0?(s.let(v,!0),$!==void 0&&s.if((0,t._)`${u}.length > 0`,f)):(s.let(v,!1),f()),a.result(v,()=>a.reset());function f(){const l=s.name("_valid"),y=s.let("count",0);d(l,()=>s.if(l,()=>i(y)))}function d(l,y){s.forRange("i",0,E,_=>{a.subschema({keyword:"contains",dataProp:_,dataPropType:e.Type.Num,compositeRule:!0},l),y()})}function i(l){s.code((0,t._)`${l}++`),$===void 0?s.if((0,t._)`${l} >= ${p}`,()=>s.assign(v,!0).break()):(s.if((0,t._)`${l} > ${$}`,()=>s.assign(v,!1).break()),p===1?s.assign(v,!0):s.if((0,t._)`${l} >= ${p}`,()=>s.assign(v,!0)))}}};return er.default=n,er}var Fr={},as;function co(){return as||(as=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;const e=te(),r=ae(),n=Ne();t.error={message:({params:{property:u,depsCount:h,deps:p}})=>{const $=h===1?"property":"properties";return(0,e.str)`must have ${$} ${p} when property ${u} is present`},params:({params:{property:u,depsCount:h,deps:p,missingProperty:$}})=>(0,e._)`{property: ${u},
6
- missingProperty: ${$},
7
- depsCount: ${h},
8
- deps: ${p}}`};const a={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(u){const[h,p]=s(u);c(u,h),o(u,p)}};function s({schema:u}){const h={},p={};for(const $ in u){if($==="__proto__")continue;const w=Array.isArray(u[$])?h:p;w[$]=u[$]}return[h,p]}function c(u,h=u.schema){const{gen:p,data:$,it:w}=u;if(Object.keys(h).length===0)return;const b=p.let("missing");for(const E in h){const v=h[E];if(v.length===0)continue;const f=(0,n.propertyInData)(p,$,E,w.opts.ownProperties);u.setParams({property:E,depsCount:v.length,deps:v.join(", ")}),w.allErrors?p.if(f,()=>{for(const d of v)(0,n.checkReportMissingProp)(u,d)}):(p.if((0,e._)`${f} && (${(0,n.checkMissingProp)(u,v,b)})`),(0,n.reportMissingProp)(u,b),p.else())}}t.validatePropertyDeps=c;function o(u,h=u.schema){const{gen:p,data:$,keyword:w,it:b}=u,E=p.name("valid");for(const v in h)(0,r.alwaysValidSchema)(b,h[v])||(p.if((0,n.propertyInData)(p,$,v,b.opts.ownProperties),()=>{const f=u.subschema({keyword:w,schemaProp:v},E);u.mergeValidEvaluated(f,E)},()=>p.var(E,!0)),u.ok(E))}t.validateSchemaDeps=o,t.default=a}(Fr)),Fr}var tr={},is;function uo(){if(is)return tr;is=1,Object.defineProperty(tr,"__esModule",{value:!0});const t=te(),e=ae(),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 h=s.name("valid");s.forIn("key",o,p=>{a.setParams({propertyName:p}),a.subschema({keyword:"propertyNames",data:p,dataTypes:["string"],propertyName:p,compositeRule:!0},h),s.if((0,t.not)(h),()=>{a.error(!0),u.allErrors||s.break()})}),a.ok(h)}};return tr.default=n,tr}var rr={},os;function Js(){if(os)return rr;os=1,Object.defineProperty(rr,"__esModule",{value:!0});const t=Ne(),e=te(),r=Ke(),n=ae(),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:h,data:p,errsCount:$,it:w}=c;if(!$)throw new Error("ajv implementation error");const{allErrors:b,opts:E}=w;if(w.props=!0,E.removeAdditional!=="all"&&(0,n.alwaysValidSchema)(w,u))return;const v=(0,t.allSchemaProperties)(h.properties),f=(0,t.allSchemaProperties)(h.patternProperties);d(),c.ok((0,e._)`${$} === ${r.default.errors}`);function d(){o.forIn("key",p,g=>{!v.length&&!f.length?y(g):o.if(i(g),()=>y(g))})}function i(g){let k;if(v.length>8){const O=(0,n.schemaRefOrVal)(w,h.properties,"properties");k=(0,t.isOwnProperty)(o,O,g)}else v.length?k=(0,e.or)(...v.map(O=>(0,e._)`${g} === ${O}`)):k=e.nil;return f.length&&(k=(0,e.or)(k,...f.map(O=>(0,e._)`${(0,t.usePattern)(c,O)}.test(${g})`))),(0,e.not)(k)}function l(g){o.code((0,e._)`delete ${p}[${g}]`)}function y(g){if(E.removeAdditional==="all"||E.removeAdditional&&u===!1){l(g);return}if(u===!1){c.setParams({additionalProperty:g}),c.error(),b||o.break();return}if(typeof u=="object"&&!(0,n.alwaysValidSchema)(w,u)){const k=o.name("valid");E.removeAdditional==="failing"?(_(g,k,!1),o.if((0,e.not)(k),()=>{c.reset(),l(g)})):(_(g,k),b||o.if((0,e.not)(k),()=>o.break()))}}function _(g,k,O){const M={keyword:"additionalProperties",dataProp:g,dataPropType:n.Type.Str};O===!1&&Object.assign(M,{compositeRule:!0,createErrors:!1,allErrors:!1}),c.subschema(M,k)}}};return rr.default=s,rr}var nr={},cs;function lo(){if(cs)return nr;cs=1,Object.defineProperty(nr,"__esModule",{value:!0});const t=Ir(),e=Ne(),r=ae(),n=Js(),a={keyword:"properties",type:"object",schemaType:"object",code(s){const{gen:c,schema:o,parentSchema:u,data:h,it:p}=s;p.opts.removeAdditional==="all"&&u.additionalProperties===void 0&&n.default.code(new t.KeywordCxt(p,n.default,"additionalProperties"));const $=(0,e.allSchemaProperties)(o);for(const f of $)p.definedProperties.add(f);p.opts.unevaluated&&$.length&&p.props!==!0&&(p.props=r.mergeEvaluated.props(c,(0,r.toHash)($),p.props));const w=$.filter(f=>!(0,r.alwaysValidSchema)(p,o[f]));if(w.length===0)return;const b=c.name("valid");for(const f of w)E(f)?v(f):(c.if((0,e.propertyInData)(c,h,f,p.opts.ownProperties)),v(f),p.allErrors||c.else().var(b,!0),c.endIf()),s.it.definedProperties.add(f),s.ok(b);function E(f){return p.opts.useDefaults&&!p.compositeRule&&o[f].default!==void 0}function v(f){s.subschema({keyword:"properties",schemaProp:f,dataProp:f},b)}}};return nr.default=a,nr}var sr={},us;function fo(){if(us)return sr;us=1,Object.defineProperty(sr,"__esModule",{value:!0});const t=Ne(),e=te(),r=ae(),n=ae(),a={keyword:"patternProperties",type:"object",schemaType:"object",code(s){const{gen:c,schema:o,data:u,parentSchema:h,it:p}=s,{opts:$}=p,w=(0,t.allSchemaProperties)(o),b=w.filter(y=>(0,r.alwaysValidSchema)(p,o[y]));if(w.length===0||b.length===w.length&&(!p.opts.unevaluated||p.props===!0))return;const E=$.strictSchema&&!$.allowMatchingProperties&&h.properties,v=c.name("valid");p.props!==!0&&!(p.props instanceof e.Name)&&(p.props=(0,n.evaluatedPropsToName)(c,p.props));const{props:f}=p;d();function d(){for(const y of w)E&&i(y),p.allErrors?l(y):(c.var(v,!0),l(y),c.if(v))}function i(y){for(const _ in E)new RegExp(y).test(_)&&(0,r.checkStrictMode)(p,`property ${_} matches pattern ${y} (use allowMatchingProperties)`)}function l(y){c.forIn("key",u,_=>{c.if((0,e._)`${(0,t.usePattern)(s,y)}.test(${_})`,()=>{const g=b.includes(y);g||s.subschema({keyword:"patternProperties",schemaProp:y,dataProp:_,dataPropType:n.Type.Str},v),p.opts.unevaluated&&f!==!0?c.assign((0,e._)`${f}[${_}]`,!0):!g&&!p.allErrors&&c.if((0,e.not)(v),()=>c.break())})})}}};return sr.default=a,sr}var ar={},ds;function ho(){if(ds)return ar;ds=1,Object.defineProperty(ar,"__esModule",{value:!0});const t=ae(),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 ar.default=e,ar}var ir={},ls;function po(){if(ls)return ir;ls=1,Object.defineProperty(ir,"__esModule",{value:!0});const e={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Ne().validateUnion,error:{message:"must match a schema in anyOf"}};return ir.default=e,ir}var or={},fs;function mo(){if(fs)return or;fs=1,Object.defineProperty(or,"__esModule",{value:!0});const t=te(),e=ae(),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 h=c,p=s.let("valid",!1),$=s.let("passing",null),w=s.name("_valid");a.setParams({passing:$}),s.block(b),a.result(p,()=>a.reset(),()=>a.error(!0));function b(){h.forEach((E,v)=>{let f;(0,e.alwaysValidSchema)(u,E)?s.var(w,!0):f=a.subschema({keyword:"oneOf",schemaProp:v,compositeRule:!0},w),v>0&&s.if((0,t._)`${w} && ${p}`).assign(p,!1).assign($,(0,t._)`[${$}, ${v}]`).else(),s.if(w,()=>{s.assign(p,!0),s.assign($,v),f&&a.mergeEvaluated(f,t.Name)})})}}};return or.default=n,or}var cr={},hs;function yo(){if(hs)return cr;hs=1,Object.defineProperty(cr,"__esModule",{value:!0});const t=ae(),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 h=r.subschema({keyword:"allOf",schemaProp:u},c);r.ok(c),r.mergeEvaluated(h)})}};return cr.default=e,cr}var ur={},ps;function vo(){if(ps)return ur;ps=1,Object.defineProperty(ur,"__esModule",{value:!0});const t=te(),e=ae(),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 h=a(u,"then"),p=a(u,"else");if(!h&&!p)return;const $=c.let("valid",!0),w=c.name("_valid");if(b(),s.reset(),h&&p){const v=c.let("ifClause");s.setParams({ifClause:v}),c.if(w,E("then",v),E("else",v))}else h?c.if(w,E("then")):c.if((0,t.not)(w),E("else"));s.pass($,()=>s.error(!0));function b(){const v=s.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},w);s.mergeEvaluated(v)}function E(v,f){return()=>{const d=s.subschema({keyword:v},w);c.assign($,w),s.mergeValidEvaluated(d,$),f?c.assign(f,(0,t._)`${v}`):s.setParams({ifClause:v})}}}};function a(s,c){const o=s.schema[c];return o!==void 0&&!(0,e.alwaysValidSchema)(s,o)}return ur.default=n,ur}var dr={},ms;function go(){if(ms)return dr;ms=1,Object.defineProperty(dr,"__esModule",{value:!0});const t=ae(),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 dr.default=e,dr}var ys;function _o(){if(ys)return Yt;ys=1,Object.defineProperty(Yt,"__esModule",{value:!0});const t=Gs(),e=ao(),r=Bs(),n=io(),a=oo(),s=co(),c=uo(),o=Js(),u=lo(),h=fo(),p=ho(),$=po(),w=mo(),b=yo(),E=vo(),v=go();function f(d=!1){const i=[p.default,$.default,w.default,b.default,E.default,v.default,c.default,o.default,s.default,u.default,h.default];return d?i.push(e.default,n.default):i.push(t.default,r.default),i.push(a.default),i}return Yt.default=f,Yt}var lr={},fr={},vs;function $o(){if(vs)return fr;vs=1,Object.defineProperty(fr,"__esModule",{value:!0});const t=te(),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:h,it:p}=n,{opts:$,errSchemaPath:w,schemaEnv:b,self:E}=p;if(!$.validateFormats)return;o?v():f();function v(){const d=s.scopeValue("formats",{ref:E.formats,code:$.code.formats}),i=s.const("fDef",(0,t._)`${d}[${h}]`),l=s.let("fType"),y=s.let("format");s.if((0,t._)`typeof ${i} == "object" && !(${i} instanceof RegExp)`,()=>s.assign(l,(0,t._)`${i}.type || "string"`).assign(y,(0,t._)`${i}.validate`),()=>s.assign(l,(0,t._)`"string"`).assign(y,i)),n.fail$data((0,t.or)(_(),g()));function _(){return $.strictSchema===!1?t.nil:(0,t._)`${h} && !${y}`}function g(){const k=b.$async?(0,t._)`(${i}.async ? await ${y}(${c}) : ${y}(${c}))`:(0,t._)`${y}(${c})`,O=(0,t._)`(typeof ${y} == "function" ? ${k} : ${y}.test(${c}))`;return(0,t._)`${y} && ${y} !== true && ${l} === ${a} && !${O}`}}function f(){const d=E.formats[u];if(!d){_();return}if(d===!0)return;const[i,l,y]=g(d);i===a&&n.pass(k());function _(){if($.strictSchema===!1){E.logger.warn(O());return}throw new Error(O());function O(){return`unknown format "${u}" ignored in schema at path "${w}"`}}function g(O){const M=O instanceof RegExp?(0,t.regexpCode)(O):$.code.formats?(0,t._)`${$.code.formats}${(0,t.getProperty)(u)}`:void 0,Z=s.scopeValue("formats",{key:u,ref:O,code:M});return typeof O=="object"&&!(O instanceof RegExp)?[O.type||"string",O.validate,(0,t._)`${Z}.validate`]:["string",O,Z]}function k(){if(typeof d=="object"&&!(d instanceof RegExp)&&d.async){if(!b.$async)throw new Error("async format in sync schema");return(0,t._)`await ${y}(${c})`}return typeof l=="function"?(0,t._)`${y}(${c})`:(0,t._)`${y}.test(${c})`}}}};return fr.default=r,fr}var gs;function bo(){if(gs)return lr;gs=1,Object.defineProperty(lr,"__esModule",{value:!0});const e=[$o().default];return lr.default=e,lr}var Be={},_s;function wo(){return _s||(_s=1,Object.defineProperty(Be,"__esModule",{value:!0}),Be.contentVocabulary=Be.metadataVocabulary=void 0,Be.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],Be.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]),Be}var $s;function ko(){if($s)return xt;$s=1,Object.defineProperty(xt,"__esModule",{value:!0});const t=Hi(),e=so(),r=_o(),n=bo(),a=wo(),s=[t.default,e.default,(0,r.default)(),n.default,a.metadataVocabulary,a.contentVocabulary];return xt.default=s,xt}var hr={},ht={},bs;function So(){if(bs)return ht;bs=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 ws;function Eo(){if(ws)return hr;ws=1,Object.defineProperty(hr,"__esModule",{value:!0});const t=te(),e=So(),r=en(),n=jr(),a=ae(),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:h}})=>(0,t._)`{error: ${o}, tag: ${h}, tagValue: ${u}}`},code(o){const{gen:u,data:h,schema:p,parentSchema:$,it:w}=o,{oneOf:b}=$;if(!w.opts.discriminator)throw new Error("discriminator: requires discriminator option");const E=p.propertyName;if(typeof E!="string")throw new Error("discriminator: requires propertyName");if(p.mapping)throw new Error("discriminator: mapping is not supported");if(!b)throw new Error("discriminator: requires oneOf keyword");const v=u.let("valid",!1),f=u.const("tag",(0,t._)`${h}${(0,t.getProperty)(E)}`);u.if((0,t._)`typeof ${f} == "string"`,()=>d(),()=>o.error(!1,{discrError:e.DiscrError.Tag,tag:f,tagName:E})),o.ok(v);function d(){const y=l();u.if(!1);for(const _ in y)u.elseIf((0,t._)`${f} === ${_}`),u.assign(v,i(y[_]));u.else(),o.error(!1,{discrError:e.DiscrError.Mapping,tag:f,tagName:E}),u.endIf()}function i(y){const _=u.name("valid"),g=o.subschema({keyword:"oneOf",schemaProp:y},_);return o.mergeEvaluated(g,t.Name),_}function l(){var y;const _={},g=O($);let k=!0;for(let F=0;F<b.length;F++){let W=b[F];if(W?.$ref&&!(0,a.schemaHasRulesButRef)(W,w.self.RULES)){const se=W.$ref;if(W=r.resolveRef.call(w.self,w.schemaEnv.root,w.baseId,se),W instanceof r.SchemaEnv&&(W=W.schema),W===void 0)throw new n.default(w.opts.uriResolver,w.baseId,se)}const G=(y=W?.properties)===null||y===void 0?void 0:y[E];if(typeof G!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${E}"`);k=k&&(g||O(W)),M(G,F)}if(!k)throw new Error(`discriminator: "${E}" must be required`);return _;function O({required:F}){return Array.isArray(F)&&F.includes(E)}function M(F,W){if(F.const)Z(F.const,W);else if(F.enum)for(const G of F.enum)Z(G,W);else throw new Error(`discriminator: "properties/${E}" must have "const" or "enum"`)}function Z(F,W){if(typeof F!="string"||F in _)throw new Error(`discriminator: "${E}" values must be unique strings`);_[F]=W}}}};return hr.default=c,hr}const Po="http://json-schema.org/draft-07/schema#",No="http://json-schema.org/draft-07/schema#",Io="Core schema meta-schema",jo={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:[]}},To=["object","boolean"],Oo={$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 Ro={$schema:Po,$id:No,title:Io,definitions:jo,type:To,properties:Oo,default:!0},ks;function Co(){return ks||(ks=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=Li(),n=ko(),a=Eo(),s=Ro,c=["/properties"],o="http://json-schema.org/draft-07/schema";class u extends r.default{_addVocabularies(){super._addVocabularies(),n.default.forEach(E=>this.addVocabulary(E)),this.opts.discriminator&&this.addKeyword(a.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const E=this.opts.$data?this.$dataMetaSchema(s,c):s;this.addMetaSchema(E,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 h=Ir();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return h.KeywordCxt}});var p=te();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return p._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return p.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return p.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return p.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return p.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return p.CodeGen}});var $=Qr();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return $.default}});var w=jr();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return w.default}})}(Tt,Tt.exports)),Tt.exports}var Ws=Co();new Ws.Ajv({strict:!1});function Ao(t){return"source"in t}const Ss=Xr({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=$=>{const w=e.get(`hub:${$.hubId}`);if(!w)return{resolvedInputs:[]};if(w.kind!=="hub")throw new Error("Expected hub node");return w},a=$=>{const w=e.get(`instance:${$.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[$.output]??[],resolvedOutputs:w.resolvedOutputs[$.output]??[]}};if(t.kind==="hub"){const $=new Map,w=b=>{$.set(`${b.input.instanceId}:${b.input.output}`,b)};for(const b of t.hub.inputs??[]){const{component:E}=a(b),v=E?.outputs[b.output];if(!v){r.warn({msg:"output not found in the component",input:b,component:E});continue}w({input:b,type:v.type})}for(const b of t.hub.injectionInputs??[]){const{resolvedInputs:E}=n(b);for(const v of E)w(v)}return{kind:"hub",resolvedInputs:Array.from($.values())}}if(t.instance.resolvedInputs)return{kind:"instance",component:t.component,resolvedInputs:hi(t.instance.resolvedInputs,($,w)=>{const b=t.component.inputs[w];return b?$.map(E=>({input:E,type:b.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=($,w)=>{let b=s.get($);b||(b=new Map,s.set($,b)),b.set(`${w.input.instanceId}:${w.input.output}`,w)},o=($,w)=>{const b=t.component.inputs[$];if(!b){r.warn({msg:"input not found in the component",input:w,component:t.component});return}const{component:E,resolvedOutputs:v}=a(w);if(!E){r.warn({instanceId:t.instance.id,input:w},"no output found for the input");return}if(Ao(E)){c($,{input:w,type:b.type});return}for(const f of v)c($,{input:f,type:b.type})};for(const[$,w]of Object.entries(t.instance.inputs??{}))for(const b of w)o($,b);const u=new Map,h=new Map;for(const $ of t.instance.injectionInputs??[]){const{resolvedInputs:w}=n($);for(const b of w)u.set(`${b.input.instanceId}:${b.input.output}`,b)}for(const[$,w]of Object.entries(t.component.inputs??{})){const b=new Map(u),E=t.instance.hubInputs?.[$]??[];for(const v of E){const{resolvedInputs:f}=n(v);for(const d of f)b.set(`${d.input.instanceId}:${d.input.output}`,d)}for(const v of b.values())if(v.type===w.type){o($,v.input);const f=`${v.input.instanceId}:${v.input.output}`;u.has(f)&&h.set(f,v)}}const p=mi(Array.from(s.entries()).map(([$,w])=>[$,Array.from(w.values())]));return{kind:"instance",component:t.component,resolvedInputs:p,resolvedOutputs:t.instance.resolvedOutputs??{},resolvedInjectionInputs:Array.from(u.values()),matchedInjectionInputs:Array.from(h.values())}}}),xo=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},Mo=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"?xo(n):n},qo=Mo("SHA-256"),Es=Xr({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],[h])=>u.localeCompare(h));for(const[u,h]of o){if(Object.keys(h).length===0)continue;c+=u;const p=h.map($=>$.input.instanceId);p.sort();for(const $ of p){const w=s.get($);w&&(c+=w.inputHash,c+=w.outputHash)}}return{inputHash:await qo(c),outputHash:a?.outputHash??""}}}),Ps=Xr({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 Ws.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"}}}),Do={[Ss.factoryName]:Ss,[Es.factoryName]:Es,[Ps.factoryName]:Ps};j.object({id:j.string().nanoid(),projectId:j.string(),instanceId:j.string(),terminalName:j.string(),terminalTitle:j.string(),createdAt:j.coerce.date(),finishedAt:j.coerce.date().optional()});const Sr=t=>{self.postMessage(t)},Qe=new Map,Vo=(t,e,r)=>{const n=Do[r];if(!n)throw new Error(`Unknown resolver type: ${r}`);if(Qe.has(e)){console.warn(`state with id "${e}" already exists`);return}const a=globalLogger.child({stateId:e,factoryName:r}),s=new Map,o=n(t,a,{promiseCache:s,setDependencies(u,h){Sr({type:"dependencies",stateId:e,nodeId:u,dependencies:h})},setOutput(u,h){Sr({type:"output",stateId:e,nodeId:u,value:h})}});Qe.set(e,{nodes:t,resolver:o,promiseCache:s,logger:a})},zo=(t,e,r)=>{const n=Qe.get(t);if(!n)throw new Error(`Unknown state: ${t}`);n.nodes.set(e,r),n.promiseCache.delete(e)},Zo=(t,e)=>{const r=Qe.get(t);if(!r)throw new Error(`Unknown state: ${t}`);r.nodes.delete(e),r.promiseCache.delete(e)},Uo=(t,e)=>{const r=Qe.get(t);if(!r)throw new Error(`Unknown state: ${t}`);r.promiseCache.delete(e)},Lo=async(t,e)=>{const r=Qe.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)},Fo=t=>{Qe.delete(t)};self.onmessage=t=>{const e=t.data;switch(e.type){case"create-state":{const r=new Map(Object.entries(e.nodes));Vo(r,e.stateId,e.factoryName),Sr({type:"state-ready",stateId:e.stateId});break}case"update-input":{zo(e.stateId,e.nodeId,e.node);break}case"delete-input":{Zo(e.stateId,e.nodeId);break}case"invalidate":{Uo(e.stateId,e.nodeId);break}case"process":{Lo(e.stateId,e.nodeIds);break}case"dispose-state":{Fo(e.stateId);break}}};Sr({type:"ready"});