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