@anov/cic-standard-sdk 0.0.5 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,8 @@
1
- (function(Ee,Se){typeof exports=="object"&&typeof module<"u"?Se(exports):typeof define=="function"&&define.amd?define(["exports"],Se):(Ee=typeof globalThis<"u"?globalThis:Ee||self,Se(Ee.CICSDK={}))})(this,(function(Ee){"use strict";function Se(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var De={exports:{}},Mt={},he={},$e={},At={},Vt={},zt={},tr;function Me(){return tr||(tr=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class a extends t{constructor(r){if(super(),!e.IDENTIFIER.test(r))throw new Error("CodeGen: name must be a valid identifier");this.str=r}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=a;class n extends t{constructor(r){super(),this._items=typeof r=="string"?[r]:r}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const r=this._items[0];return r===""||r==='""'}get str(){var r;return(r=this._str)!==null&&r!==void 0?r:this._str=this._items.reduce((o,h)=>`${o}${h}`,"")}get names(){var r;return(r=this._names)!==null&&r!==void 0?r:this._names=this._items.reduce((o,h)=>(h instanceof a&&(o[h.str]=(o[h.str]||0)+1),o),{})}}e._Code=n,e.nil=new n("");function y(d,...r){const o=[d[0]];let h=0;for(;h<r.length;)u(o,r[h]),o.push(d[++h]);return new n(o)}e._=y;const i=new n("+");function p(d,...r){const o=[g(d[0])];let h=0;for(;h<r.length;)o.push(i),u(o,r[h]),o.push(i,g(d[++h]));return m(o),new n(o)}e.str=p;function u(d,r){r instanceof n?d.push(...r._items):r instanceof a?d.push(r):d.push(S(r))}e.addCodeArg=u;function m(d){let r=1;for(;r<d.length-1;){if(d[r]===i){const o=b(d[r-1],d[r+1]);if(o!==void 0){d.splice(r-1,3,o);continue}d[r++]="+"}r++}}function b(d,r){if(r==='""')return d;if(d==='""')return r;if(typeof d=="string")return r instanceof a||d[d.length-1]!=='"'?void 0:typeof r!="string"?`${d.slice(0,-1)}${r}"`:r[0]==='"'?d.slice(0,-1)+r.slice(1):void 0;if(typeof r=="string"&&r[0]==='"'&&!(d instanceof a))return`"${d}${r.slice(1)}`}function _(d,r){return r.emptyStr()?d:d.emptyStr()?r:p`${d}${r}`}e.strConcat=_;function S(d){return typeof d=="number"||typeof d=="boolean"||d===null?d:g(Array.isArray(d)?d.join(","):d)}function $(d){return new n(g(d))}e.stringify=$;function g(d){return JSON.stringify(d).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=g;function v(d){return typeof d=="string"&&e.IDENTIFIER.test(d)?new n(`.${d}`):y`[${d}]`}e.getProperty=v;function w(d){if(typeof d=="string"&&e.IDENTIFIER.test(d))return new n(`${d}`);throw new Error(`CodeGen: invalid export name: ${d}, use explicit $id name mapping`)}e.getEsmExportName=w;function c(d){return new n(d.toString())}e.regexpCode=c})(zt)),zt}var Ft={},rr;function nr(){return rr||(rr=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=Me();class a extends Error{constructor(b){super(`CodeGen: "code" for ${b} not defined`),this.value=b.value}}var n;(function(m){m[m.Started=0]="Started",m[m.Completed=1]="Completed"})(n||(e.UsedValueState=n={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class y{constructor({prefixes:b,parent:_}={}){this._names={},this._prefixes=b,this._parent=_}toName(b){return b instanceof t.Name?b:this.name(b)}name(b){return new t.Name(this._newName(b))}_newName(b){const _=this._names[b]||this._nameGroup(b);return`${b}${_.index++}`}_nameGroup(b){var _,S;if(!((S=(_=this._parent)===null||_===void 0?void 0:_._prefixes)===null||S===void 0)&&S.has(b)||this._prefixes&&!this._prefixes.has(b))throw new Error(`CodeGen: prefix "${b}" is not allowed in this scope`);return this._names[b]={prefix:b,index:0}}}e.Scope=y;class i extends t.Name{constructor(b,_){super(_),this.prefix=b}setValue(b,{property:_,itemIndex:S}){this.value=b,this.scopePath=(0,t._)`.${new t.Name(_)}[${S}]`}}e.ValueScopeName=i;const p=(0,t._)`\n`;class u extends y{constructor(b){super(b),this._values={},this._scope=b.scope,this.opts={...b,_n:b.lines?p:t.nil}}get(){return this._scope}name(b){return new i(b,this._newName(b))}value(b,_){var S;if(_.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const $=this.toName(b),{prefix:g}=$,v=(S=_.key)!==null&&S!==void 0?S:_.ref;let w=this._values[g];if(w){const r=w.get(v);if(r)return r}else w=this._values[g]=new Map;w.set(v,$);const c=this._scope[g]||(this._scope[g]=[]),d=c.length;return c[d]=_.ref,$.setValue(_,{property:g,itemIndex:d}),$}getValue(b,_){const S=this._values[b];if(S)return S.get(_)}scopeRefs(b,_=this._values){return this._reduceValues(_,S=>{if(S.scopePath===void 0)throw new Error(`CodeGen: name "${S}" has no value`);return(0,t._)`${b}${S.scopePath}`})}scopeCode(b=this._values,_,S){return this._reduceValues(b,$=>{if($.value===void 0)throw new Error(`CodeGen: name "${$}" has no value`);return $.value.code},_,S)}_reduceValues(b,_,S={},$){let g=t.nil;for(const v in b){const w=b[v];if(!w)continue;const c=S[v]=S[v]||new Map;w.forEach(d=>{if(c.has(d))return;c.set(d,n.Started);let r=_(d);if(r){const o=this.opts.es5?e.varKinds.var:e.varKinds.const;g=(0,t._)`${g}${o} ${d} = ${r};${this.opts._n}`}else if(r=$?.(d))g=(0,t._)`${g}${r}${this.opts._n}`;else throw new a(d);c.set(d,n.Completed)})}return g}}e.ValueScope=u})(Ft)),Ft}var ir;function G(){return ir||(ir=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=Me(),a=nr();var n=Me();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return n.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return n.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return n.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}});var y=nr();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return y.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return y.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return y.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return y.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class i{optimizeNodes(){return this}optimizeNames(l,E){return this}}class p extends i{constructor(l,E,O){super(),this.varKind=l,this.name=E,this.rhs=O}render({es5:l,_n:E}){const O=l?a.varKinds.var:this.varKind,U=this.rhs===void 0?"":` = ${this.rhs}`;return`${O} ${this.name}${U};`+E}optimizeNames(l,E){if(l[this.name.str])return this.rhs&&(this.rhs=L(this.rhs,l,E)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class u extends i{constructor(l,E,O){super(),this.lhs=l,this.rhs=E,this.sideEffects=O}render({_n:l}){return`${this.lhs} = ${this.rhs};`+l}optimizeNames(l,E){if(!(this.lhs instanceof t.Name&&!l[this.lhs.str]&&!this.sideEffects))return this.rhs=L(this.rhs,l,E),this}get names(){const l=this.lhs instanceof t.Name?{}:{...this.lhs.names};return F(l,this.rhs)}}class m extends u{constructor(l,E,O,U){super(l,O,U),this.op=E}render({_n:l}){return`${this.lhs} ${this.op}= ${this.rhs};`+l}}class b extends i{constructor(l){super(),this.label=l,this.names={}}render({_n:l}){return`${this.label}:`+l}}class _ extends i{constructor(l){super(),this.label=l,this.names={}}render({_n:l}){return`break${this.label?` ${this.label}`:""};`+l}}class S extends i{constructor(l){super(),this.error=l}render({_n:l}){return`throw ${this.error};`+l}get names(){return this.error.names}}class $ extends i{constructor(l){super(),this.code=l}render({_n:l}){return`${this.code};`+l}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(l,E){return this.code=L(this.code,l,E),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class g extends i{constructor(l=[]){super(),this.nodes=l}render(l){return this.nodes.reduce((E,O)=>E+O.render(l),"")}optimizeNodes(){const{nodes:l}=this;let E=l.length;for(;E--;){const O=l[E].optimizeNodes();Array.isArray(O)?l.splice(E,1,...O):O?l[E]=O:l.splice(E,1)}return l.length>0?this:void 0}optimizeNames(l,E){const{nodes:O}=this;let U=O.length;for(;U--;){const H=O[U];H.optimizeNames(l,E)||(Q(l,H.names),O.splice(U,1))}return O.length>0?this:void 0}get names(){return this.nodes.reduce((l,E)=>V(l,E.names),{})}}class v extends g{render(l){return"{"+l._n+super.render(l)+"}"+l._n}}class w extends g{}class c extends v{}c.kind="else";class d extends v{constructor(l,E){super(E),this.condition=l}render(l){let E=`if(${this.condition})`+super.render(l);return this.else&&(E+="else "+this.else.render(l)),E}optimizeNodes(){super.optimizeNodes();const l=this.condition;if(l===!0)return this.nodes;let E=this.else;if(E){const O=E.optimizeNodes();E=this.else=Array.isArray(O)?new c(O):O}if(E)return l===!1?E instanceof d?E:E.nodes:this.nodes.length?this:new d(ie(l),E instanceof d?[E]:E.nodes);if(!(l===!1||!this.nodes.length))return this}optimizeNames(l,E){var O;if(this.else=(O=this.else)===null||O===void 0?void 0:O.optimizeNames(l,E),!!(super.optimizeNames(l,E)||this.else))return this.condition=L(this.condition,l,E),this}get names(){const l=super.names;return F(l,this.condition),this.else&&V(l,this.else.names),l}}d.kind="if";class r extends v{}r.kind="for";class o extends r{constructor(l){super(),this.iteration=l}render(l){return`for(${this.iteration})`+super.render(l)}optimizeNames(l,E){if(super.optimizeNames(l,E))return this.iteration=L(this.iteration,l,E),this}get names(){return V(super.names,this.iteration.names)}}class h extends r{constructor(l,E,O,U){super(),this.varKind=l,this.name=E,this.from=O,this.to=U}render(l){const E=l.es5?a.varKinds.var:this.varKind,{name:O,from:U,to:H}=this;return`for(${E} ${O}=${U}; ${O}<${H}; ${O}++)`+super.render(l)}get names(){const l=F(super.names,this.from);return F(l,this.to)}}class s extends r{constructor(l,E,O,U){super(),this.loop=l,this.varKind=E,this.name=O,this.iterable=U}render(l){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(l)}optimizeNames(l,E){if(super.optimizeNames(l,E))return this.iterable=L(this.iterable,l,E),this}get names(){return V(super.names,this.iterable.names)}}class f extends v{constructor(l,E,O){super(),this.name=l,this.args=E,this.async=O}render(l){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(l)}}f.kind="func";class P extends g{render(l){return"return "+super.render(l)}}P.kind="return";class N extends v{render(l){let E="try"+super.render(l);return this.catch&&(E+=this.catch.render(l)),this.finally&&(E+=this.finally.render(l)),E}optimizeNodes(){var l,E;return super.optimizeNodes(),(l=this.catch)===null||l===void 0||l.optimizeNodes(),(E=this.finally)===null||E===void 0||E.optimizeNodes(),this}optimizeNames(l,E){var O,U;return super.optimizeNames(l,E),(O=this.catch)===null||O===void 0||O.optimizeNames(l,E),(U=this.finally)===null||U===void 0||U.optimizeNames(l,E),this}get names(){const l=super.names;return this.catch&&V(l,this.catch.names),this.finally&&V(l,this.finally.names),l}}class D extends v{constructor(l){super(),this.error=l}render(l){return`catch(${this.error})`+super.render(l)}}D.kind="catch";class z extends v{render(l){return"finally"+super.render(l)}}z.kind="finally";class q{constructor(l,E={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...E,_n:E.lines?`
2
- `:""},this._extScope=l,this._scope=new a.Scope({parent:l}),this._nodes=[new w]}toString(){return this._root.render(this.opts)}name(l){return this._scope.name(l)}scopeName(l){return this._extScope.name(l)}scopeValue(l,E){const O=this._extScope.value(l,E);return(this._values[O.prefix]||(this._values[O.prefix]=new Set)).add(O),O}getScopeValue(l,E){return this._extScope.getValue(l,E)}scopeRefs(l){return this._extScope.scopeRefs(l,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(l,E,O,U){const H=this._scope.toName(E);return O!==void 0&&U&&(this._constants[H.str]=O),this._leafNode(new p(l,H,O)),H}const(l,E,O){return this._def(a.varKinds.const,l,E,O)}let(l,E,O){return this._def(a.varKinds.let,l,E,O)}var(l,E,O){return this._def(a.varKinds.var,l,E,O)}assign(l,E,O){return this._leafNode(new u(l,E,O))}add(l,E){return this._leafNode(new m(l,e.operators.ADD,E))}code(l){return typeof l=="function"?l():l!==t.nil&&this._leafNode(new $(l)),this}object(...l){const E=["{"];for(const[O,U]of l)E.length>1&&E.push(","),E.push(O),(O!==U||this.opts.es5)&&(E.push(":"),(0,t.addCodeArg)(E,U));return E.push("}"),new t._Code(E)}if(l,E,O){if(this._blockNode(new d(l)),E&&O)this.code(E).else().code(O).endIf();else if(E)this.code(E).endIf();else if(O)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(l){return this._elseNode(new d(l))}else(){return this._elseNode(new c)}endIf(){return this._endBlockNode(d,c)}_for(l,E){return this._blockNode(l),E&&this.code(E).endFor(),this}for(l,E){return this._for(new o(l),E)}forRange(l,E,O,U,H=this.opts.es5?a.varKinds.var:a.varKinds.let){const Z=this._scope.toName(l);return this._for(new h(H,Z,E,O),()=>U(Z))}forOf(l,E,O,U=a.varKinds.const){const H=this._scope.toName(l);if(this.opts.es5){const Z=E instanceof t.Name?E:this.var("_arr",E);return this.forRange("_i",0,(0,t._)`${Z}.length`,B=>{this.var(H,(0,t._)`${Z}[${B}]`),O(H)})}return this._for(new s("of",U,H,E),()=>O(H))}forIn(l,E,O,U=this.opts.es5?a.varKinds.var:a.varKinds.const){if(this.opts.ownProperties)return this.forOf(l,(0,t._)`Object.keys(${E})`,O);const H=this._scope.toName(l);return this._for(new s("in",U,H,E),()=>O(H))}endFor(){return this._endBlockNode(r)}label(l){return this._leafNode(new b(l))}break(l){return this._leafNode(new _(l))}return(l){const E=new P;if(this._blockNode(E),this.code(l),E.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(P)}try(l,E,O){if(!E&&!O)throw new Error('CodeGen: "try" without "catch" and "finally"');const U=new N;if(this._blockNode(U),this.code(l),E){const H=this.name("e");this._currNode=U.catch=new D(H),E(H)}return O&&(this._currNode=U.finally=new z,this.code(O)),this._endBlockNode(D,z)}throw(l){return this._leafNode(new S(l))}block(l,E){return this._blockStarts.push(this._nodes.length),l&&this.code(l).endBlock(E),this}endBlock(l){const E=this._blockStarts.pop();if(E===void 0)throw new Error("CodeGen: not in self-balancing block");const O=this._nodes.length-E;if(O<0||l!==void 0&&O!==l)throw new Error(`CodeGen: wrong number of nodes: ${O} vs ${l} expected`);return this._nodes.length=E,this}func(l,E=t.nil,O,U){return this._blockNode(new f(l,E,O)),U&&this.code(U).endFunc(),this}endFunc(){return this._endBlockNode(f)}optimize(l=1){for(;l-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(l){return this._currNode.nodes.push(l),this}_blockNode(l){this._currNode.nodes.push(l),this._nodes.push(l)}_endBlockNode(l,E){const O=this._currNode;if(O instanceof l||E&&O instanceof E)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${E?`${l.kind}/${E.kind}`:l.kind}"`)}_elseNode(l){const E=this._currNode;if(!(E instanceof d))throw new Error('CodeGen: "else" without "if"');return this._currNode=E.else=l,this}get _root(){return this._nodes[0]}get _currNode(){const l=this._nodes;return l[l.length-1]}set _currNode(l){const E=this._nodes;E[E.length-1]=l}}e.CodeGen=q;function V(R,l){for(const E in l)R[E]=(R[E]||0)+(l[E]||0);return R}function F(R,l){return l instanceof t._CodeOrName?V(R,l.names):R}function L(R,l,E){if(R instanceof t.Name)return O(R);if(!U(R))return R;return new t._Code(R._items.reduce((H,Z)=>(Z instanceof t.Name&&(Z=O(Z)),Z instanceof t._Code?H.push(...Z._items):H.push(Z),H),[]));function O(H){const Z=E[H.str];return Z===void 0||l[H.str]!==1?H:(delete l[H.str],Z)}function U(H){return H instanceof t._Code&&H._items.some(Z=>Z instanceof t.Name&&l[Z.str]===1&&E[Z.str]!==void 0)}}function Q(R,l){for(const E in l)R[E]=(R[E]||0)-(l[E]||0)}function ie(R){return typeof R=="boolean"||typeof R=="number"||R===null?!R:(0,t._)`!${T(R)}`}e.not=ie;const se=k(e.operators.AND);function x(...R){return R.reduce(se)}e.and=x;const pe=k(e.operators.OR);function M(...R){return R.reduce(pe)}e.or=M;function k(R){return(l,E)=>l===t.nil?E:E===t.nil?l:(0,t._)`${T(l)} ${R} ${T(E)}`}function T(R){return R instanceof t.Name?R:(0,t._)`(${R})`}})(Vt)),Vt}var J={},sr;function Y(){if(sr)return J;sr=1,Object.defineProperty(J,"__esModule",{value:!0}),J.checkStrictMode=J.getErrorPath=J.Type=J.useFunc=J.setEvaluated=J.evaluatedPropsToName=J.mergeEvaluated=J.eachItem=J.unescapeJsonPointer=J.escapeJsonPointer=J.escapeFragment=J.unescapeFragment=J.schemaRefOrVal=J.schemaHasRulesButRef=J.schemaHasRules=J.checkUnknownRules=J.alwaysValidSchema=J.toHash=void 0;const e=G(),t=Me();function a(s){const f={};for(const P of s)f[P]=!0;return f}J.toHash=a;function n(s,f){return typeof f=="boolean"?f:Object.keys(f).length===0?!0:(y(s,f),!i(f,s.self.RULES.all))}J.alwaysValidSchema=n;function y(s,f=s.schema){const{opts:P,self:N}=s;if(!P.strictSchema||typeof f=="boolean")return;const D=N.RULES.keywords;for(const z in f)D[z]||h(s,`unknown keyword: "${z}"`)}J.checkUnknownRules=y;function i(s,f){if(typeof s=="boolean")return!s;for(const P in s)if(f[P])return!0;return!1}J.schemaHasRules=i;function p(s,f){if(typeof s=="boolean")return!s;for(const P in s)if(P!=="$ref"&&f.all[P])return!0;return!1}J.schemaHasRulesButRef=p;function u({topSchemaRef:s,schemaPath:f},P,N,D){if(!D){if(typeof P=="number"||typeof P=="boolean")return P;if(typeof P=="string")return(0,e._)`${P}`}return(0,e._)`${s}${f}${(0,e.getProperty)(N)}`}J.schemaRefOrVal=u;function m(s){return S(decodeURIComponent(s))}J.unescapeFragment=m;function b(s){return encodeURIComponent(_(s))}J.escapeFragment=b;function _(s){return typeof s=="number"?`${s}`:s.replace(/~/g,"~0").replace(/\//g,"~1")}J.escapeJsonPointer=_;function S(s){return s.replace(/~1/g,"/").replace(/~0/g,"~")}J.unescapeJsonPointer=S;function $(s,f){if(Array.isArray(s))for(const P of s)f(P);else f(s)}J.eachItem=$;function g({mergeNames:s,mergeToName:f,mergeValues:P,resultToName:N}){return(D,z,q,V)=>{const F=q===void 0?z:q instanceof e.Name?(z instanceof e.Name?s(D,z,q):f(D,z,q),q):z instanceof e.Name?(f(D,q,z),z):P(z,q);return V===e.Name&&!(F instanceof e.Name)?N(D,F):F}}J.mergeEvaluated={props:g({mergeNames:(s,f,P)=>s.if((0,e._)`${P} !== true && ${f} !== undefined`,()=>{s.if((0,e._)`${f} === true`,()=>s.assign(P,!0),()=>s.assign(P,(0,e._)`${P} || {}`).code((0,e._)`Object.assign(${P}, ${f})`))}),mergeToName:(s,f,P)=>s.if((0,e._)`${P} !== true`,()=>{f===!0?s.assign(P,!0):(s.assign(P,(0,e._)`${P} || {}`),w(s,P,f))}),mergeValues:(s,f)=>s===!0?!0:{...s,...f},resultToName:v}),items:g({mergeNames:(s,f,P)=>s.if((0,e._)`${P} !== true && ${f} !== undefined`,()=>s.assign(P,(0,e._)`${f} === true ? true : ${P} > ${f} ? ${P} : ${f}`)),mergeToName:(s,f,P)=>s.if((0,e._)`${P} !== true`,()=>s.assign(P,f===!0?!0:(0,e._)`${P} > ${f} ? ${P} : ${f}`)),mergeValues:(s,f)=>s===!0?!0:Math.max(s,f),resultToName:(s,f)=>s.var("items",f)})};function v(s,f){if(f===!0)return s.var("props",!0);const P=s.var("props",(0,e._)`{}`);return f!==void 0&&w(s,P,f),P}J.evaluatedPropsToName=v;function w(s,f,P){Object.keys(P).forEach(N=>s.assign((0,e._)`${f}${(0,e.getProperty)(N)}`,!0))}J.setEvaluated=w;const c={};function d(s,f){return s.scopeValue("func",{ref:f,code:c[f.code]||(c[f.code]=new t._Code(f.code))})}J.useFunc=d;var r;(function(s){s[s.Num=0]="Num",s[s.Str=1]="Str"})(r||(J.Type=r={}));function o(s,f,P){if(s instanceof e.Name){const N=f===r.Num;return P?N?(0,e._)`"[" + ${s} + "]"`:(0,e._)`"['" + ${s} + "']"`:N?(0,e._)`"/" + ${s}`:(0,e._)`"/" + ${s}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return P?(0,e.getProperty)(s).toString():"/"+_(s)}J.getErrorPath=o;function h(s,f,P=s.opts.strictSchema){if(P){if(f=`strict mode: ${f}`,P===!0)throw new Error(f);s.self.logger.warn(f)}}return J.checkStrictMode=h,J}var Ae={},or;function ve(){if(or)return Ae;or=1,Object.defineProperty(Ae,"__esModule",{value:!0});const e=G(),t={data:new e.Name("data"),valCxt:new e.Name("valCxt"),instancePath:new e.Name("instancePath"),parentData:new e.Name("parentData"),parentDataProperty:new e.Name("parentDataProperty"),rootData:new e.Name("rootData"),dynamicAnchors:new e.Name("dynamicAnchors"),vErrors:new e.Name("vErrors"),errors:new e.Name("errors"),this:new e.Name("this"),self:new e.Name("self"),scope:new e.Name("scope"),json:new e.Name("json"),jsonPos:new e.Name("jsonPos"),jsonLen:new e.Name("jsonLen"),jsonPart:new e.Name("jsonPart")};return Ae.default=t,Ae}var ar;function Ve(){return ar||(ar=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=G(),a=Y(),n=ve();e.keywordError={message:({keyword:c})=>(0,t.str)`must pass "${c}" keyword validation`},e.keyword$DataError={message:({keyword:c,schemaType:d})=>d?(0,t.str)`"${c}" keyword must be ${d} ($data)`:(0,t.str)`"${c}" keyword is invalid ($data)`};function y(c,d=e.keywordError,r,o){const{it:h}=c,{gen:s,compositeRule:f,allErrors:P}=h,N=S(c,d,r);o??(f||P)?m(s,N):b(h,(0,t._)`[${N}]`)}e.reportError=y;function i(c,d=e.keywordError,r){const{it:o}=c,{gen:h,compositeRule:s,allErrors:f}=o,P=S(c,d,r);m(h,P),s||f||b(o,n.default.vErrors)}e.reportExtraError=i;function p(c,d){c.assign(n.default.errors,d),c.if((0,t._)`${n.default.vErrors} !== null`,()=>c.if(d,()=>c.assign((0,t._)`${n.default.vErrors}.length`,d),()=>c.assign(n.default.vErrors,null)))}e.resetErrorsCount=p;function u({gen:c,keyword:d,schemaValue:r,data:o,errsCount:h,it:s}){if(h===void 0)throw new Error("ajv implementation error");const f=c.name("err");c.forRange("i",h,n.default.errors,P=>{c.const(f,(0,t._)`${n.default.vErrors}[${P}]`),c.if((0,t._)`${f}.instancePath === undefined`,()=>c.assign((0,t._)`${f}.instancePath`,(0,t.strConcat)(n.default.instancePath,s.errorPath))),c.assign((0,t._)`${f}.schemaPath`,(0,t.str)`${s.errSchemaPath}/${d}`),s.opts.verbose&&(c.assign((0,t._)`${f}.schema`,r),c.assign((0,t._)`${f}.data`,o))})}e.extendErrors=u;function m(c,d){const r=c.const("err",d);c.if((0,t._)`${n.default.vErrors} === null`,()=>c.assign(n.default.vErrors,(0,t._)`[${r}]`),(0,t._)`${n.default.vErrors}.push(${r})`),c.code((0,t._)`${n.default.errors}++`)}function b(c,d){const{gen:r,validateName:o,schemaEnv:h}=c;h.$async?r.throw((0,t._)`new ${c.ValidationError}(${d})`):(r.assign((0,t._)`${o}.errors`,d),r.return(!1))}const _={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function S(c,d,r){const{createErrors:o}=c.it;return o===!1?(0,t._)`{}`:$(c,d,r)}function $(c,d,r={}){const{gen:o,it:h}=c,s=[g(h,r),v(c,r)];return w(c,d,s),o.object(...s)}function g({errorPath:c},{instancePath:d}){const r=d?(0,t.str)`${c}${(0,a.getErrorPath)(d,a.Type.Str)}`:c;return[n.default.instancePath,(0,t.strConcat)(n.default.instancePath,r)]}function v({keyword:c,it:{errSchemaPath:d}},{schemaPath:r,parentSchema:o}){let h=o?d:(0,t.str)`${d}/${c}`;return r&&(h=(0,t.str)`${h}${(0,a.getErrorPath)(r,a.Type.Str)}`),[_.schemaPath,h]}function w(c,{params:d,message:r},o){const{keyword:h,data:s,schemaValue:f,it:P}=c,{opts:N,propertyName:D,topSchemaRef:z,schemaPath:q}=P;o.push([_.keyword,h],[_.params,typeof d=="function"?d(c):d||(0,t._)`{}`]),N.messages&&o.push([_.message,typeof r=="function"?r(c):r]),N.verbose&&o.push([_.schema,f],[_.parentSchema,(0,t._)`${z}${q}`],[n.default.data,s]),D&&o.push([_.propertyName,D])}})(At)),At}var cr;function Ln(){if(cr)return $e;cr=1,Object.defineProperty($e,"__esModule",{value:!0}),$e.boolOrEmptySchema=$e.topBoolOrEmptySchema=void 0;const e=Ve(),t=G(),a=ve(),n={message:"boolean schema is false"};function y(u){const{gen:m,schema:b,validateName:_}=u;b===!1?p(u,!1):typeof b=="object"&&b.$async===!0?m.return(a.default.data):(m.assign((0,t._)`${_}.errors`,null),m.return(!0))}$e.topBoolOrEmptySchema=y;function i(u,m){const{gen:b,schema:_}=u;_===!1?(b.var(m,!1),p(u)):b.var(m,!0)}$e.boolOrEmptySchema=i;function p(u,m){const{gen:b,data:_}=u,S={gen:b,keyword:"false schema",data:_,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:u};(0,e.reportError)(S,n,void 0,m)}return $e}var ee={},be={},dr;function ur(){if(dr)return be;dr=1,Object.defineProperty(be,"__esModule",{value:!0}),be.getRules=be.isJSONType=void 0;const e=["string","number","integer","boolean","null","object","array"],t=new Set(e);function a(y){return typeof y=="string"&&t.has(y)}be.isJSONType=a;function n(){const y={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...y,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},y.number,y.string,y.array,y.object],post:{rules:[]},all:{},keywords:{}}}return be.getRules=n,be}var ye={},lr;function fr(){if(lr)return ye;lr=1,Object.defineProperty(ye,"__esModule",{value:!0}),ye.shouldUseRule=ye.shouldUseGroup=ye.schemaHasRulesForType=void 0;function e({schema:n,self:y},i){const p=y.RULES.types[i];return p&&p!==!0&&t(n,p)}ye.schemaHasRulesForType=e;function t(n,y){return y.rules.some(i=>a(n,i))}ye.shouldUseGroup=t;function a(n,y){var i;return n[y.keyword]!==void 0||((i=y.definition.implements)===null||i===void 0?void 0:i.some(p=>n[p]!==void 0))}return ye.shouldUseRule=a,ye}var pr;function ze(){if(pr)return ee;pr=1,Object.defineProperty(ee,"__esModule",{value:!0}),ee.reportTypeError=ee.checkDataTypes=ee.checkDataType=ee.coerceAndCheckDataType=ee.getJSONTypes=ee.getSchemaTypes=ee.DataType=void 0;const e=ur(),t=fr(),a=Ve(),n=G(),y=Y();var i;(function(r){r[r.Correct=0]="Correct",r[r.Wrong=1]="Wrong"})(i||(ee.DataType=i={}));function p(r){const o=u(r.type);if(o.includes("null")){if(r.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!o.length&&r.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');r.nullable===!0&&o.push("null")}return o}ee.getSchemaTypes=p;function u(r){const o=Array.isArray(r)?r:r?[r]:[];if(o.every(e.isJSONType))return o;throw new Error("type must be JSONType or JSONType[]: "+o.join(","))}ee.getJSONTypes=u;function m(r,o){const{gen:h,data:s,opts:f}=r,P=_(o,f.coerceTypes),N=o.length>0&&!(P.length===0&&o.length===1&&(0,t.schemaHasRulesForType)(r,o[0]));if(N){const D=v(o,s,f.strictNumbers,i.Wrong);h.if(D,()=>{P.length?S(r,o,P):c(r)})}return N}ee.coerceAndCheckDataType=m;const b=new Set(["string","number","integer","boolean","null"]);function _(r,o){return o?r.filter(h=>b.has(h)||o==="array"&&h==="array"):[]}function S(r,o,h){const{gen:s,data:f,opts:P}=r,N=s.let("dataType",(0,n._)`typeof ${f}`),D=s.let("coerced",(0,n._)`undefined`);P.coerceTypes==="array"&&s.if((0,n._)`${N} == 'object' && Array.isArray(${f}) && ${f}.length == 1`,()=>s.assign(f,(0,n._)`${f}[0]`).assign(N,(0,n._)`typeof ${f}`).if(v(o,f,P.strictNumbers),()=>s.assign(D,f))),s.if((0,n._)`${D} !== undefined`);for(const q of h)(b.has(q)||q==="array"&&P.coerceTypes==="array")&&z(q);s.else(),c(r),s.endIf(),s.if((0,n._)`${D} !== undefined`,()=>{s.assign(f,D),$(r,D)});function z(q){switch(q){case"string":s.elseIf((0,n._)`${N} == "number" || ${N} == "boolean"`).assign(D,(0,n._)`"" + ${f}`).elseIf((0,n._)`${f} === null`).assign(D,(0,n._)`""`);return;case"number":s.elseIf((0,n._)`${N} == "boolean" || ${f} === null
3
- || (${N} == "string" && ${f} && ${f} == +${f})`).assign(D,(0,n._)`+${f}`);return;case"integer":s.elseIf((0,n._)`${N} === "boolean" || ${f} === null
4
- || (${N} === "string" && ${f} && ${f} == +${f} && !(${f} % 1))`).assign(D,(0,n._)`+${f}`);return;case"boolean":s.elseIf((0,n._)`${f} === "false" || ${f} === 0 || ${f} === null`).assign(D,!1).elseIf((0,n._)`${f} === "true" || ${f} === 1`).assign(D,!0);return;case"null":s.elseIf((0,n._)`${f} === "" || ${f} === 0 || ${f} === false`),s.assign(D,null);return;case"array":s.elseIf((0,n._)`${N} === "string" || ${N} === "number"
5
- || ${N} === "boolean" || ${f} === null`).assign(D,(0,n._)`[${f}]`)}}}function $({gen:r,parentData:o,parentDataProperty:h},s){r.if((0,n._)`${o} !== undefined`,()=>r.assign((0,n._)`${o}[${h}]`,s))}function g(r,o,h,s=i.Correct){const f=s===i.Correct?n.operators.EQ:n.operators.NEQ;let P;switch(r){case"null":return(0,n._)`${o} ${f} null`;case"array":P=(0,n._)`Array.isArray(${o})`;break;case"object":P=(0,n._)`${o} && typeof ${o} == "object" && !Array.isArray(${o})`;break;case"integer":P=N((0,n._)`!(${o} % 1) && !isNaN(${o})`);break;case"number":P=N();break;default:return(0,n._)`typeof ${o} ${f} ${r}`}return s===i.Correct?P:(0,n.not)(P);function N(D=n.nil){return(0,n.and)((0,n._)`typeof ${o} == "number"`,D,h?(0,n._)`isFinite(${o})`:n.nil)}}ee.checkDataType=g;function v(r,o,h,s){if(r.length===1)return g(r[0],o,h,s);let f;const P=(0,y.toHash)(r);if(P.array&&P.object){const N=(0,n._)`typeof ${o} != "object"`;f=P.null?N:(0,n._)`!${o} || ${N}`,delete P.null,delete P.array,delete P.object}else f=n.nil;P.number&&delete P.integer;for(const N in P)f=(0,n.and)(f,g(N,o,h,s));return f}ee.checkDataTypes=v;const w={message:({schema:r})=>`must be ${r}`,params:({schema:r,schemaValue:o})=>typeof r=="string"?(0,n._)`{type: ${r}}`:(0,n._)`{type: ${o}}`};function c(r){const o=d(r);(0,a.reportError)(o,w)}ee.reportTypeError=c;function d(r){const{gen:o,data:h,schema:s}=r,f=(0,y.schemaRefOrVal)(r,s,"type");return{gen:o,keyword:"type",data:h,schema:s.type,schemaCode:f,schemaValue:f,parentSchema:s,params:{},it:r}}return ee}var Re={},mr;function Un(){if(mr)return Re;mr=1,Object.defineProperty(Re,"__esModule",{value:!0}),Re.assignDefaults=void 0;const e=G(),t=Y();function a(y,i){const{properties:p,items:u}=y.schema;if(i==="object"&&p)for(const m in p)n(y,m,p[m].default);else i==="array"&&Array.isArray(u)&&u.forEach((m,b)=>n(y,b,m.default))}Re.assignDefaults=a;function n(y,i,p){const{gen:u,compositeRule:m,data:b,opts:_}=y;if(p===void 0)return;const S=(0,e._)`${b}${(0,e.getProperty)(i)}`;if(m){(0,t.checkStrictMode)(y,`default is ignored for: ${S}`);return}let $=(0,e._)`${S} === undefined`;_.useDefaults==="empty"&&($=(0,e._)`${$} || ${S} === null || ${S} === ""`),u.if($,(0,e._)`${S} = ${(0,e.stringify)(p)}`)}return Re}var le={},X={},hr;function fe(){if(hr)return X;hr=1,Object.defineProperty(X,"__esModule",{value:!0}),X.validateUnion=X.validateArray=X.usePattern=X.callValidateCode=X.schemaProperties=X.allSchemaProperties=X.noPropertyInData=X.propertyInData=X.isOwnProperty=X.hasPropFunc=X.reportMissingProp=X.checkMissingProp=X.checkReportMissingProp=void 0;const e=G(),t=Y(),a=ve(),n=Y();function y(r,o){const{gen:h,data:s,it:f}=r;h.if(_(h,s,o,f.opts.ownProperties),()=>{r.setParams({missingProperty:(0,e._)`${o}`},!0),r.error()})}X.checkReportMissingProp=y;function i({gen:r,data:o,it:{opts:h}},s,f){return(0,e.or)(...s.map(P=>(0,e.and)(_(r,o,P,h.ownProperties),(0,e._)`${f} = ${P}`)))}X.checkMissingProp=i;function p(r,o){r.setParams({missingProperty:o},!0),r.error()}X.reportMissingProp=p;function u(r){return r.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,e._)`Object.prototype.hasOwnProperty`})}X.hasPropFunc=u;function m(r,o,h){return(0,e._)`${u(r)}.call(${o}, ${h})`}X.isOwnProperty=m;function b(r,o,h,s){const f=(0,e._)`${o}${(0,e.getProperty)(h)} !== undefined`;return s?(0,e._)`${f} && ${m(r,o,h)}`:f}X.propertyInData=b;function _(r,o,h,s){const f=(0,e._)`${o}${(0,e.getProperty)(h)} === undefined`;return s?(0,e.or)(f,(0,e.not)(m(r,o,h))):f}X.noPropertyInData=_;function S(r){return r?Object.keys(r).filter(o=>o!=="__proto__"):[]}X.allSchemaProperties=S;function $(r,o){return S(o).filter(h=>!(0,t.alwaysValidSchema)(r,o[h]))}X.schemaProperties=$;function g({schemaCode:r,data:o,it:{gen:h,topSchemaRef:s,schemaPath:f,errorPath:P},it:N},D,z,q){const V=q?(0,e._)`${r}, ${o}, ${s}${f}`:o,F=[[a.default.instancePath,(0,e.strConcat)(a.default.instancePath,P)],[a.default.parentData,N.parentData],[a.default.parentDataProperty,N.parentDataProperty],[a.default.rootData,a.default.rootData]];N.opts.dynamicRef&&F.push([a.default.dynamicAnchors,a.default.dynamicAnchors]);const L=(0,e._)`${V}, ${h.object(...F)}`;return z!==e.nil?(0,e._)`${D}.call(${z}, ${L})`:(0,e._)`${D}(${L})`}X.callValidateCode=g;const v=(0,e._)`new RegExp`;function w({gen:r,it:{opts:o}},h){const s=o.unicodeRegExp?"u":"",{regExp:f}=o.code,P=f(h,s);return r.scopeValue("pattern",{key:P.toString(),ref:P,code:(0,e._)`${f.code==="new RegExp"?v:(0,n.useFunc)(r,f)}(${h}, ${s})`})}X.usePattern=w;function c(r){const{gen:o,data:h,keyword:s,it:f}=r,P=o.name("valid");if(f.allErrors){const D=o.let("valid",!0);return N(()=>o.assign(D,!1)),D}return o.var(P,!0),N(()=>o.break()),P;function N(D){const z=o.const("len",(0,e._)`${h}.length`);o.forRange("i",0,z,q=>{r.subschema({keyword:s,dataProp:q,dataPropType:t.Type.Num},P),o.if((0,e.not)(P),D)})}}X.validateArray=c;function d(r){const{gen:o,schema:h,keyword:s,it:f}=r;if(!Array.isArray(h))throw new Error("ajv implementation error");if(h.some(z=>(0,t.alwaysValidSchema)(f,z))&&!f.opts.unevaluated)return;const N=o.let("valid",!1),D=o.name("_valid");o.block(()=>h.forEach((z,q)=>{const V=r.subschema({keyword:s,schemaProp:q,compositeRule:!0},D);o.assign(N,(0,e._)`${N} || ${D}`),r.mergeValidEvaluated(V,D)||o.if((0,e.not)(N))})),r.result(N,()=>r.reset(),()=>r.error(!0))}return X.validateUnion=d,X}var yr;function Kn(){if(yr)return le;yr=1,Object.defineProperty(le,"__esModule",{value:!0}),le.validateKeywordUsage=le.validSchemaType=le.funcKeywordCode=le.macroKeywordCode=void 0;const e=G(),t=ve(),a=fe(),n=Ve();function y($,g){const{gen:v,keyword:w,schema:c,parentSchema:d,it:r}=$,o=g.macro.call(r.self,c,d,r),h=b(v,w,o);r.opts.validateSchema!==!1&&r.self.validateSchema(o,!0);const s=v.name("valid");$.subschema({schema:o,schemaPath:e.nil,errSchemaPath:`${r.errSchemaPath}/${w}`,topSchemaRef:h,compositeRule:!0},s),$.pass(s,()=>$.error(!0))}le.macroKeywordCode=y;function i($,g){var v;const{gen:w,keyword:c,schema:d,parentSchema:r,$data:o,it:h}=$;m(h,g);const s=!o&&g.compile?g.compile.call(h.self,d,r,h):g.validate,f=b(w,c,s),P=w.let("valid");$.block$data(P,N),$.ok((v=g.valid)!==null&&v!==void 0?v:P);function N(){if(g.errors===!1)q(),g.modifying&&p($),V(()=>$.error());else{const F=g.async?D():z();g.modifying&&p($),V(()=>u($,F))}}function D(){const F=w.let("ruleErrs",null);return w.try(()=>q((0,e._)`await `),L=>w.assign(P,!1).if((0,e._)`${L} instanceof ${h.ValidationError}`,()=>w.assign(F,(0,e._)`${L}.errors`),()=>w.throw(L))),F}function z(){const F=(0,e._)`${f}.errors`;return w.assign(F,null),q(e.nil),F}function q(F=g.async?(0,e._)`await `:e.nil){const L=h.opts.passContext?t.default.this:t.default.self,Q=!("compile"in g&&!o||g.schema===!1);w.assign(P,(0,e._)`${F}${(0,a.callValidateCode)($,f,L,Q)}`,g.modifying)}function V(F){var L;w.if((0,e.not)((L=g.valid)!==null&&L!==void 0?L:P),F)}}le.funcKeywordCode=i;function p($){const{gen:g,data:v,it:w}=$;g.if(w.parentData,()=>g.assign(v,(0,e._)`${w.parentData}[${w.parentDataProperty}]`))}function u($,g){const{gen:v}=$;v.if((0,e._)`Array.isArray(${g})`,()=>{v.assign(t.default.vErrors,(0,e._)`${t.default.vErrors} === null ? ${g} : ${t.default.vErrors}.concat(${g})`).assign(t.default.errors,(0,e._)`${t.default.vErrors}.length`),(0,n.extendErrors)($)},()=>$.error())}function m({schemaEnv:$},g){if(g.async&&!$.$async)throw new Error("async keyword in sync schema")}function b($,g,v){if(v===void 0)throw new Error(`keyword "${g}" failed to compile`);return $.scopeValue("keyword",typeof v=="function"?{ref:v}:{ref:v,code:(0,e.stringify)(v)})}function _($,g,v=!1){return!g.length||g.some(w=>w==="array"?Array.isArray($):w==="object"?$&&typeof $=="object"&&!Array.isArray($):typeof $==w||v&&typeof $>"u")}le.validSchemaType=_;function S({schema:$,opts:g,self:v,errSchemaPath:w},c,d){if(Array.isArray(c.keyword)?!c.keyword.includes(d):c.keyword!==d)throw new Error("ajv implementation error");const r=c.dependencies;if(r?.some(o=>!Object.prototype.hasOwnProperty.call($,o)))throw new Error(`parent schema must have dependencies of ${d}: ${r.join(",")}`);if(c.validateSchema&&!c.validateSchema($[d])){const h=`keyword "${d}" value is invalid at path "${w}": `+v.errorsText(c.validateSchema.errors);if(g.validateSchema==="log")v.logger.error(h);else throw new Error(h)}}return le.validateKeywordUsage=S,le}var ge={},gr;function Hn(){if(gr)return ge;gr=1,Object.defineProperty(ge,"__esModule",{value:!0}),ge.extendSubschemaMode=ge.extendSubschemaData=ge.getSubschema=void 0;const e=G(),t=Y();function a(i,{keyword:p,schemaProp:u,schema:m,schemaPath:b,errSchemaPath:_,topSchemaRef:S}){if(p!==void 0&&m!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(p!==void 0){const $=i.schema[p];return u===void 0?{schema:$,schemaPath:(0,e._)`${i.schemaPath}${(0,e.getProperty)(p)}`,errSchemaPath:`${i.errSchemaPath}/${p}`}:{schema:$[u],schemaPath:(0,e._)`${i.schemaPath}${(0,e.getProperty)(p)}${(0,e.getProperty)(u)}`,errSchemaPath:`${i.errSchemaPath}/${p}/${(0,t.escapeFragment)(u)}`}}if(m!==void 0){if(b===void 0||_===void 0||S===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:m,schemaPath:b,topSchemaRef:S,errSchemaPath:_}}throw new Error('either "keyword" or "schema" must be passed')}ge.getSubschema=a;function n(i,p,{dataProp:u,dataPropType:m,data:b,dataTypes:_,propertyName:S}){if(b!==void 0&&u!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:$}=p;if(u!==void 0){const{errorPath:v,dataPathArr:w,opts:c}=p,d=$.let("data",(0,e._)`${p.data}${(0,e.getProperty)(u)}`,!0);g(d),i.errorPath=(0,e.str)`${v}${(0,t.getErrorPath)(u,m,c.jsPropertySyntax)}`,i.parentDataProperty=(0,e._)`${u}`,i.dataPathArr=[...w,i.parentDataProperty]}if(b!==void 0){const v=b instanceof e.Name?b:$.let("data",b,!0);g(v),S!==void 0&&(i.propertyName=S)}_&&(i.dataTypes=_);function g(v){i.data=v,i.dataLevel=p.dataLevel+1,i.dataTypes=[],p.definedProperties=new Set,i.parentData=p.data,i.dataNames=[...p.dataNames,v]}}ge.extendSubschemaData=n;function y(i,{jtdDiscriminator:p,jtdMetadata:u,compositeRule:m,createErrors:b,allErrors:_}){m!==void 0&&(i.compositeRule=m),b!==void 0&&(i.createErrors=b),_!==void 0&&(i.allErrors=_),i.jtdDiscriminator=p,i.jtdMetadata=u}return ge.extendSubschemaMode=y,ge}var ne={},Lt,vr;function _r(){return vr||(vr=1,Lt=function e(t,a){if(t===a)return!0;if(t&&a&&typeof t=="object"&&typeof a=="object"){if(t.constructor!==a.constructor)return!1;var n,y,i;if(Array.isArray(t)){if(n=t.length,n!=a.length)return!1;for(y=n;y--!==0;)if(!e(t[y],a[y]))return!1;return!0}if(t.constructor===RegExp)return t.source===a.source&&t.flags===a.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===a.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===a.toString();if(i=Object.keys(t),n=i.length,n!==Object.keys(a).length)return!1;for(y=n;y--!==0;)if(!Object.prototype.hasOwnProperty.call(a,i[y]))return!1;for(y=n;y--!==0;){var p=i[y];if(!e(t[p],a[p]))return!1}return!0}return t!==t&&a!==a}),Lt}var Ut={exports:{}},$r;function Gn(){if($r)return Ut.exports;$r=1;var e=Ut.exports=function(n,y,i){typeof y=="function"&&(i=y,y={}),i=y.cb||i;var p=typeof i=="function"?i:i.pre||function(){},u=i.post||function(){};t(y,p,u,n,"",n)};e.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},e.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},e.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},e.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 t(n,y,i,p,u,m,b,_,S,$){if(p&&typeof p=="object"&&!Array.isArray(p)){y(p,u,m,b,_,S,$);for(var g in p){var v=p[g];if(Array.isArray(v)){if(g in e.arrayKeywords)for(var w=0;w<v.length;w++)t(n,y,i,v[w],u+"/"+g+"/"+w,m,u,g,p,w)}else if(g in e.propsKeywords){if(v&&typeof v=="object")for(var c in v)t(n,y,i,v[c],u+"/"+g+"/"+a(c),m,u,g,p,c)}else(g in e.keywords||n.allKeys&&!(g in e.skipKeywords))&&t(n,y,i,v,u+"/"+g,m,u,g,p)}i(p,u,m,b,_,S,$)}}function a(n){return n.replace(/~/g,"~0").replace(/\//g,"~1")}return Ut.exports}var br;function Fe(){if(br)return ne;br=1,Object.defineProperty(ne,"__esModule",{value:!0}),ne.getSchemaRefs=ne.resolveUrl=ne.normalizeId=ne._getFullPath=ne.getFullPath=ne.inlineRef=void 0;const e=Y(),t=_r(),a=Gn(),n=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function y(w,c=!0){return typeof w=="boolean"?!0:c===!0?!p(w):c?u(w)<=c:!1}ne.inlineRef=y;const i=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function p(w){for(const c in w){if(i.has(c))return!0;const d=w[c];if(Array.isArray(d)&&d.some(p)||typeof d=="object"&&p(d))return!0}return!1}function u(w){let c=0;for(const d in w){if(d==="$ref")return 1/0;if(c++,!n.has(d)&&(typeof w[d]=="object"&&(0,e.eachItem)(w[d],r=>c+=u(r)),c===1/0))return 1/0}return c}function m(w,c="",d){d!==!1&&(c=S(c));const r=w.parse(c);return b(w,r)}ne.getFullPath=m;function b(w,c){return w.serialize(c).split("#")[0]+"#"}ne._getFullPath=b;const _=/#\/?$/;function S(w){return w?w.replace(_,""):""}ne.normalizeId=S;function $(w,c,d){return d=S(d),w.resolve(c,d)}ne.resolveUrl=$;const g=/^[a-z_][-a-z0-9._]*$/i;function v(w,c){if(typeof w=="boolean")return{};const{schemaId:d,uriResolver:r}=this.opts,o=S(w[d]||c),h={"":o},s=m(r,o,!1),f={},P=new Set;return a(w,{allKeys:!0},(z,q,V,F)=>{if(F===void 0)return;const L=s+q;let Q=h[F];typeof z[d]=="string"&&(Q=ie.call(this,z[d])),se.call(this,z.$anchor),se.call(this,z.$dynamicAnchor),h[q]=Q;function ie(x){const pe=this.opts.uriResolver.resolve;if(x=S(Q?pe(Q,x):x),P.has(x))throw D(x);P.add(x);let M=this.refs[x];return typeof M=="string"&&(M=this.refs[M]),typeof M=="object"?N(z,M.schema,x):x!==S(L)&&(x[0]==="#"?(N(z,f[x],x),f[x]=z):this.refs[x]=L),x}function se(x){if(typeof x=="string"){if(!g.test(x))throw new Error(`invalid anchor "${x}"`);ie.call(this,`#${x}`)}}}),f;function N(z,q,V){if(q!==void 0&&!t(z,q))throw D(V)}function D(z){return new Error(`reference "${z}" resolves to more than one schema`)}}return ne.getSchemaRefs=v,ne}var wr;function Le(){if(wr)return he;wr=1,Object.defineProperty(he,"__esModule",{value:!0}),he.getData=he.KeywordCxt=he.validateFunctionCode=void 0;const e=Ln(),t=ze(),a=fr(),n=ze(),y=Un(),i=Kn(),p=Hn(),u=G(),m=ve(),b=Fe(),_=Y(),S=Ve();function $(j){if(s(j)&&(P(j),h(j))){c(j);return}g(j,()=>(0,e.topBoolOrEmptySchema)(j))}he.validateFunctionCode=$;function g({gen:j,validateName:I,schema:C,schemaEnv:A,opts:K},W){K.code.es5?j.func(I,(0,u._)`${m.default.data}, ${m.default.valCxt}`,A.$async,()=>{j.code((0,u._)`"use strict"; ${r(C,K)}`),w(j,K),j.code(W)}):j.func(I,(0,u._)`${m.default.data}, ${v(K)}`,A.$async,()=>j.code(r(C,K)).code(W))}function v(j){return(0,u._)`{${m.default.instancePath}="", ${m.default.parentData}, ${m.default.parentDataProperty}, ${m.default.rootData}=${m.default.data}${j.dynamicRef?(0,u._)`, ${m.default.dynamicAnchors}={}`:u.nil}}={}`}function w(j,I){j.if(m.default.valCxt,()=>{j.var(m.default.instancePath,(0,u._)`${m.default.valCxt}.${m.default.instancePath}`),j.var(m.default.parentData,(0,u._)`${m.default.valCxt}.${m.default.parentData}`),j.var(m.default.parentDataProperty,(0,u._)`${m.default.valCxt}.${m.default.parentDataProperty}`),j.var(m.default.rootData,(0,u._)`${m.default.valCxt}.${m.default.rootData}`),I.dynamicRef&&j.var(m.default.dynamicAnchors,(0,u._)`${m.default.valCxt}.${m.default.dynamicAnchors}`)},()=>{j.var(m.default.instancePath,(0,u._)`""`),j.var(m.default.parentData,(0,u._)`undefined`),j.var(m.default.parentDataProperty,(0,u._)`undefined`),j.var(m.default.rootData,m.default.data),I.dynamicRef&&j.var(m.default.dynamicAnchors,(0,u._)`{}`)})}function c(j){const{schema:I,opts:C,gen:A}=j;g(j,()=>{C.$comment&&I.$comment&&F(j),z(j),A.let(m.default.vErrors,null),A.let(m.default.errors,0),C.unevaluated&&d(j),N(j),L(j)})}function d(j){const{gen:I,validateName:C}=j;j.evaluated=I.const("evaluated",(0,u._)`${C}.evaluated`),I.if((0,u._)`${j.evaluated}.dynamicProps`,()=>I.assign((0,u._)`${j.evaluated}.props`,(0,u._)`undefined`)),I.if((0,u._)`${j.evaluated}.dynamicItems`,()=>I.assign((0,u._)`${j.evaluated}.items`,(0,u._)`undefined`))}function r(j,I){const C=typeof j=="object"&&j[I.schemaId];return C&&(I.code.source||I.code.process)?(0,u._)`/*# sourceURL=${C} */`:u.nil}function o(j,I){if(s(j)&&(P(j),h(j))){f(j,I);return}(0,e.boolOrEmptySchema)(j,I)}function h({schema:j,self:I}){if(typeof j=="boolean")return!j;for(const C in j)if(I.RULES.all[C])return!0;return!1}function s(j){return typeof j.schema!="boolean"}function f(j,I){const{schema:C,gen:A,opts:K}=j;K.$comment&&C.$comment&&F(j),q(j),V(j);const W=A.const("_errs",m.default.errors);N(j,W),A.var(I,(0,u._)`${W} === ${m.default.errors}`)}function P(j){(0,_.checkUnknownRules)(j),D(j)}function N(j,I){if(j.opts.jtd)return ie(j,[],!1,I);const C=(0,t.getSchemaTypes)(j.schema),A=(0,t.coerceAndCheckDataType)(j,C);ie(j,C,!A,I)}function D(j){const{schema:I,errSchemaPath:C,opts:A,self:K}=j;I.$ref&&A.ignoreKeywordsWithRef&&(0,_.schemaHasRulesButRef)(I,K.RULES)&&K.logger.warn(`$ref: keywords ignored in schema at path "${C}"`)}function z(j){const{schema:I,opts:C}=j;I.default!==void 0&&C.useDefaults&&C.strictSchema&&(0,_.checkStrictMode)(j,"default is ignored in the schema root")}function q(j){const I=j.schema[j.opts.schemaId];I&&(j.baseId=(0,b.resolveUrl)(j.opts.uriResolver,j.baseId,I))}function V(j){if(j.schema.$async&&!j.schemaEnv.$async)throw new Error("async schema in sync schema")}function F({gen:j,schemaEnv:I,schema:C,errSchemaPath:A,opts:K}){const W=C.$comment;if(K.$comment===!0)j.code((0,u._)`${m.default.self}.logger.log(${W})`);else if(typeof K.$comment=="function"){const te=(0,u.str)`${A}/$comment`,me=j.scopeValue("root",{ref:I.root});j.code((0,u._)`${m.default.self}.opts.$comment(${W}, ${te}, ${me}.schema)`)}}function L(j){const{gen:I,schemaEnv:C,validateName:A,ValidationError:K,opts:W}=j;C.$async?I.if((0,u._)`${m.default.errors} === 0`,()=>I.return(m.default.data),()=>I.throw((0,u._)`new ${K}(${m.default.vErrors})`)):(I.assign((0,u._)`${A}.errors`,m.default.vErrors),W.unevaluated&&Q(j),I.return((0,u._)`${m.default.errors} === 0`))}function Q({gen:j,evaluated:I,props:C,items:A}){C instanceof u.Name&&j.assign((0,u._)`${I}.props`,C),A instanceof u.Name&&j.assign((0,u._)`${I}.items`,A)}function ie(j,I,C,A){const{gen:K,schema:W,data:te,allErrors:me,opts:ae,self:ce}=j,{RULES:re}=ce;if(W.$ref&&(ae.ignoreKeywordsWithRef||!(0,_.schemaHasRulesButRef)(W,re))){K.block(()=>U(j,"$ref",re.all.$ref.definition));return}ae.jtd||x(j,I),K.block(()=>{for(const ue of re.rules)Ie(ue);Ie(re.post)});function Ie(ue){(0,a.shouldUseGroup)(W,ue)&&(ue.type?(K.if((0,n.checkDataType)(ue.type,te,ae.strictNumbers)),se(j,ue),I.length===1&&I[0]===ue.type&&C&&(K.else(),(0,n.reportTypeError)(j)),K.endIf()):se(j,ue),me||K.if((0,u._)`${m.default.errors} === ${A||0}`))}}function se(j,I){const{gen:C,schema:A,opts:{useDefaults:K}}=j;K&&(0,y.assignDefaults)(j,I.type),C.block(()=>{for(const W of I.rules)(0,a.shouldUseRule)(A,W)&&U(j,W.keyword,W.definition,I.type)})}function x(j,I){j.schemaEnv.meta||!j.opts.strictTypes||(pe(j,I),j.opts.allowUnionTypes||M(j,I),k(j,j.dataTypes))}function pe(j,I){if(I.length){if(!j.dataTypes.length){j.dataTypes=I;return}I.forEach(C=>{R(j.dataTypes,C)||E(j,`type "${C}" not allowed by context "${j.dataTypes.join(",")}"`)}),l(j,I)}}function M(j,I){I.length>1&&!(I.length===2&&I.includes("null"))&&E(j,"use allowUnionTypes to allow union type keyword")}function k(j,I){const C=j.self.RULES.all;for(const A in C){const K=C[A];if(typeof K=="object"&&(0,a.shouldUseRule)(j.schema,K)){const{type:W}=K.definition;W.length&&!W.some(te=>T(I,te))&&E(j,`missing type "${W.join(",")}" for keyword "${A}"`)}}}function T(j,I){return j.includes(I)||I==="number"&&j.includes("integer")}function R(j,I){return j.includes(I)||I==="integer"&&j.includes("number")}function l(j,I){const C=[];for(const A of j.dataTypes)R(I,A)?C.push(A):I.includes("integer")&&A==="number"&&C.push("integer");j.dataTypes=C}function E(j,I){const C=j.schemaEnv.baseId+j.errSchemaPath;I+=` at "${C}" (strictTypes)`,(0,_.checkStrictMode)(j,I,j.opts.strictTypes)}class O{constructor(I,C,A){if((0,i.validateKeywordUsage)(I,C,A),this.gen=I.gen,this.allErrors=I.allErrors,this.keyword=A,this.data=I.data,this.schema=I.schema[A],this.$data=C.$data&&I.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,_.schemaRefOrVal)(I,this.schema,A,this.$data),this.schemaType=C.schemaType,this.parentSchema=I.schema,this.params={},this.it=I,this.def=C,this.$data)this.schemaCode=I.gen.const("vSchema",B(this.$data,I));else if(this.schemaCode=this.schemaValue,!(0,i.validSchemaType)(this.schema,C.schemaType,C.allowUndefined))throw new Error(`${A} value must be ${JSON.stringify(C.schemaType)}`);("code"in C?C.trackErrors:C.errors!==!1)&&(this.errsCount=I.gen.const("_errs",m.default.errors))}result(I,C,A){this.failResult((0,u.not)(I),C,A)}failResult(I,C,A){this.gen.if(I),A?A():this.error(),C?(this.gen.else(),C(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(I,C){this.failResult((0,u.not)(I),void 0,C)}fail(I){if(I===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(I),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(I){if(!this.$data)return this.fail(I);const{schemaCode:C}=this;this.fail((0,u._)`${C} !== undefined && (${(0,u.or)(this.invalid$data(),I)})`)}error(I,C,A){if(C){this.setParams(C),this._error(I,A),this.setParams({});return}this._error(I,A)}_error(I,C){(I?S.reportExtraError:S.reportError)(this,this.def.error,C)}$dataError(){(0,S.reportError)(this,this.def.$dataError||S.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,S.resetErrorsCount)(this.gen,this.errsCount)}ok(I){this.allErrors||this.gen.if(I)}setParams(I,C){C?Object.assign(this.params,I):this.params=I}block$data(I,C,A=u.nil){this.gen.block(()=>{this.check$data(I,A),C()})}check$data(I=u.nil,C=u.nil){if(!this.$data)return;const{gen:A,schemaCode:K,schemaType:W,def:te}=this;A.if((0,u.or)((0,u._)`${K} === undefined`,C)),I!==u.nil&&A.assign(I,!0),(W.length||te.validateSchema)&&(A.elseIf(this.invalid$data()),this.$dataError(),I!==u.nil&&A.assign(I,!1)),A.else()}invalid$data(){const{gen:I,schemaCode:C,schemaType:A,def:K,it:W}=this;return(0,u.or)(te(),me());function te(){if(A.length){if(!(C instanceof u.Name))throw new Error("ajv implementation error");const ae=Array.isArray(A)?A:[A];return(0,u._)`${(0,n.checkDataTypes)(ae,C,W.opts.strictNumbers,n.DataType.Wrong)}`}return u.nil}function me(){if(K.validateSchema){const ae=I.scopeValue("validate$data",{ref:K.validateSchema});return(0,u._)`!${ae}(${C})`}return u.nil}}subschema(I,C){const A=(0,p.getSubschema)(this.it,I);(0,p.extendSubschemaData)(A,this.it,I),(0,p.extendSubschemaMode)(A,I);const K={...this.it,...A,items:void 0,props:void 0};return o(K,C),K}mergeEvaluated(I,C){const{it:A,gen:K}=this;A.opts.unevaluated&&(A.props!==!0&&I.props!==void 0&&(A.props=_.mergeEvaluated.props(K,I.props,A.props,C)),A.items!==!0&&I.items!==void 0&&(A.items=_.mergeEvaluated.items(K,I.items,A.items,C)))}mergeValidEvaluated(I,C){const{it:A,gen:K}=this;if(A.opts.unevaluated&&(A.props!==!0||A.items!==!0))return K.if(C,()=>this.mergeEvaluated(I,u.Name)),!0}}he.KeywordCxt=O;function U(j,I,C,A){const K=new O(j,C,I);"code"in C?C.code(K,A):K.$data&&C.validate?(0,i.funcKeywordCode)(K,C):"macro"in C?(0,i.macroKeywordCode)(K,C):(C.compile||C.validate)&&(0,i.funcKeywordCode)(K,C)}const H=/^\/(?:[^~]|~0|~1)*$/,Z=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function B(j,{dataLevel:I,dataNames:C,dataPathArr:A}){let K,W;if(j==="")return m.default.rootData;if(j[0]==="/"){if(!H.test(j))throw new Error(`Invalid JSON-pointer: ${j}`);K=j,W=m.default.rootData}else{const ce=Z.exec(j);if(!ce)throw new Error(`Invalid JSON-pointer: ${j}`);const re=+ce[1];if(K=ce[2],K==="#"){if(re>=I)throw new Error(ae("property/index",re));return A[I-re]}if(re>I)throw new Error(ae("data",re));if(W=C[I-re],!K)return W}let te=W;const me=K.split("/");for(const ce of me)ce&&(W=(0,u._)`${W}${(0,u.getProperty)((0,_.unescapeJsonPointer)(ce))}`,te=(0,u._)`${te} && ${W}`);return te;function ae(ce,re){return`Cannot access ${ce} ${re} levels up, current level is ${I}`}}return he.getData=B,he}var Ue={},Pr;function Kt(){if(Pr)return Ue;Pr=1,Object.defineProperty(Ue,"__esModule",{value:!0});class e extends Error{constructor(a){super("validation failed"),this.errors=a,this.ajv=this.validation=!0}}return Ue.default=e,Ue}var Ke={},Er;function He(){if(Er)return Ke;Er=1,Object.defineProperty(Ke,"__esModule",{value:!0});const e=Fe();class t extends Error{constructor(n,y,i,p){super(p||`can't resolve reference ${i} from id ${y}`),this.missingRef=(0,e.resolveUrl)(n,y,i),this.missingSchema=(0,e.normalizeId)((0,e.getFullPath)(n,this.missingRef))}}return Ke.default=t,Ke}var de={},Sr;function Ht(){if(Sr)return de;Sr=1,Object.defineProperty(de,"__esModule",{value:!0}),de.resolveSchema=de.getCompilingSchema=de.resolveRef=de.compileSchema=de.SchemaEnv=void 0;const e=G(),t=Kt(),a=ve(),n=Fe(),y=Y(),i=Le();class p{constructor(d){var r;this.refs={},this.dynamicAnchors={};let o;typeof d.schema=="object"&&(o=d.schema),this.schema=d.schema,this.schemaId=d.schemaId,this.root=d.root||this,this.baseId=(r=d.baseId)!==null&&r!==void 0?r:(0,n.normalizeId)(o?.[d.schemaId||"$id"]),this.schemaPath=d.schemaPath,this.localRefs=d.localRefs,this.meta=d.meta,this.$async=o?.$async,this.refs={}}}de.SchemaEnv=p;function u(c){const d=_.call(this,c);if(d)return d;const r=(0,n.getFullPath)(this.opts.uriResolver,c.root.baseId),{es5:o,lines:h}=this.opts.code,{ownProperties:s}=this.opts,f=new e.CodeGen(this.scope,{es5:o,lines:h,ownProperties:s});let P;c.$async&&(P=f.scopeValue("Error",{ref:t.default,code:(0,e._)`require("ajv/dist/runtime/validation_error").default`}));const N=f.scopeName("validate");c.validateName=N;const D={gen:f,allErrors:this.opts.allErrors,data:a.default.data,parentData:a.default.parentData,parentDataProperty:a.default.parentDataProperty,dataNames:[a.default.data],dataPathArr:[e.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:f.scopeValue("schema",this.opts.code.source===!0?{ref:c.schema,code:(0,e.stringify)(c.schema)}:{ref:c.schema}),validateName:N,ValidationError:P,schema:c.schema,schemaEnv:c,rootId:r,baseId:c.baseId||r,schemaPath:e.nil,errSchemaPath:c.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,e._)`""`,opts:this.opts,self:this};let z;try{this._compilations.add(c),(0,i.validateFunctionCode)(D),f.optimize(this.opts.code.optimize);const q=f.toString();z=`${f.scopeRefs(a.default.scope)}return ${q}`,this.opts.code.process&&(z=this.opts.code.process(z,c));const F=new Function(`${a.default.self}`,`${a.default.scope}`,z)(this,this.scope.get());if(this.scope.value(N,{ref:F}),F.errors=null,F.schema=c.schema,F.schemaEnv=c,c.$async&&(F.$async=!0),this.opts.code.source===!0&&(F.source={validateName:N,validateCode:q,scopeValues:f._values}),this.opts.unevaluated){const{props:L,items:Q}=D;F.evaluated={props:L instanceof e.Name?void 0:L,items:Q instanceof e.Name?void 0:Q,dynamicProps:L instanceof e.Name,dynamicItems:Q instanceof e.Name},F.source&&(F.source.evaluated=(0,e.stringify)(F.evaluated))}return c.validate=F,c}catch(q){throw delete c.validate,delete c.validateName,z&&this.logger.error("Error compiling schema, function code:",z),q}finally{this._compilations.delete(c)}}de.compileSchema=u;function m(c,d,r){var o;r=(0,n.resolveUrl)(this.opts.uriResolver,d,r);const h=c.refs[r];if(h)return h;let s=$.call(this,c,r);if(s===void 0){const f=(o=c.localRefs)===null||o===void 0?void 0:o[r],{schemaId:P}=this.opts;f&&(s=new p({schema:f,schemaId:P,root:c,baseId:d}))}if(s!==void 0)return c.refs[r]=b.call(this,s)}de.resolveRef=m;function b(c){return(0,n.inlineRef)(c.schema,this.opts.inlineRefs)?c.schema:c.validate?c:u.call(this,c)}function _(c){for(const d of this._compilations)if(S(d,c))return d}de.getCompilingSchema=_;function S(c,d){return c.schema===d.schema&&c.root===d.root&&c.baseId===d.baseId}function $(c,d){let r;for(;typeof(r=this.refs[d])=="string";)d=r;return r||this.schemas[d]||g.call(this,c,d)}function g(c,d){const r=this.opts.uriResolver.parse(d),o=(0,n._getFullPath)(this.opts.uriResolver,r);let h=(0,n.getFullPath)(this.opts.uriResolver,c.baseId,void 0);if(Object.keys(c.schema).length>0&&o===h)return w.call(this,r,c);const s=(0,n.normalizeId)(o),f=this.refs[s]||this.schemas[s];if(typeof f=="string"){const P=g.call(this,c,f);return typeof P?.schema!="object"?void 0:w.call(this,r,P)}if(typeof f?.schema=="object"){if(f.validate||u.call(this,f),s===(0,n.normalizeId)(d)){const{schema:P}=f,{schemaId:N}=this.opts,D=P[N];return D&&(h=(0,n.resolveUrl)(this.opts.uriResolver,h,D)),new p({schema:P,schemaId:N,root:c,baseId:h})}return w.call(this,r,f)}}de.resolveSchema=g;const v=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function w(c,{baseId:d,schema:r,root:o}){var h;if(((h=c.fragment)===null||h===void 0?void 0:h[0])!=="/")return;for(const P of c.fragment.slice(1).split("/")){if(typeof r=="boolean")return;const N=r[(0,y.unescapeFragment)(P)];if(N===void 0)return;r=N;const D=typeof r=="object"&&r[this.opts.schemaId];!v.has(P)&&D&&(d=(0,n.resolveUrl)(this.opts.uriResolver,d,D))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,y.schemaHasRulesButRef)(r,this.RULES)){const P=(0,n.resolveUrl)(this.opts.uriResolver,d,r.$ref);s=g.call(this,o,P)}const{schemaId:f}=this.opts;if(s=s||new p({schema:r,schemaId:f,root:o,baseId:d}),s.schema!==s.root.schema)return s}return de}const Jn={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1};var Ge={},Ne={exports:{}},Gt,jr;function kr(){if(jr)return Gt;jr=1;const e=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),t=RegExp.prototype.test.bind(/^(?:(?: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 a($){let g="",v=0,w=0;for(w=0;w<$.length;w++)if(v=$[w].charCodeAt(0),v!==48){if(!(v>=48&&v<=57||v>=65&&v<=70||v>=97&&v<=102))return"";g+=$[w];break}for(w+=1;w<$.length;w++){if(v=$[w].charCodeAt(0),!(v>=48&&v<=57||v>=65&&v<=70||v>=97&&v<=102))return"";g+=$[w]}return g}const n=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function y($){return $.length=0,!0}function i($,g,v){if($.length){const w=a($);if(w!=="")g.push(w);else return v.error=!0,!1;$.length=0}return!0}function p($){let g=0;const v={error:!1,address:"",zone:""},w=[],c=[];let d=!1,r=!1,o=i;for(let h=0;h<$.length;h++){const s=$[h];if(!(s==="["||s==="]"))if(s===":"){if(d===!0&&(r=!0),!o(c,w,v))break;if(++g>7){v.error=!0;break}h>0&&$[h-1]===":"&&(d=!0),w.push(":");continue}else if(s==="%"){if(!o(c,w,v))break;o=y}else{c.push(s);continue}}return c.length&&(o===y?v.zone=c.join(""):r?w.push(c.join("")):w.push(a(c))),v.address=w.join(""),v}function u($){if(m($,":")<2)return{host:$,isIPV6:!1};const g=p($);if(g.error)return{host:$,isIPV6:!1};{let v=g.address,w=g.address;return g.zone&&(v+="%"+g.zone,w+="%25"+g.zone),{host:v,isIPV6:!0,escapedHost:w}}}function m($,g){let v=0;for(let w=0;w<$.length;w++)$[w]===g&&v++;return v}function b($){let g=$;const v=[];let w=-1,c=0;for(;c=g.length;){if(c===1){if(g===".")break;if(g==="/"){v.push("/");break}else{v.push(g);break}}else if(c===2){if(g[0]==="."){if(g[1]===".")break;if(g[1]==="/"){g=g.slice(2);continue}}else if(g[0]==="/"&&(g[1]==="."||g[1]==="/")){v.push("/");break}}else if(c===3&&g==="/.."){v.length!==0&&v.pop(),v.push("/");break}if(g[0]==="."){if(g[1]==="."){if(g[2]==="/"){g=g.slice(3);continue}}else if(g[1]==="/"){g=g.slice(2);continue}}else if(g[0]==="/"&&g[1]==="."){if(g[2]==="/"){g=g.slice(2);continue}else if(g[2]==="."&&g[3]==="/"){g=g.slice(3),v.length!==0&&v.pop();continue}}if((w=g.indexOf("/",1))===-1){v.push(g);break}else v.push(g.slice(0,w)),g=g.slice(w)}return v.join("")}function _($,g){const v=g!==!0?escape:unescape;return $.scheme!==void 0&&($.scheme=v($.scheme)),$.userinfo!==void 0&&($.userinfo=v($.userinfo)),$.host!==void 0&&($.host=v($.host)),$.path!==void 0&&($.path=v($.path)),$.query!==void 0&&($.query=v($.query)),$.fragment!==void 0&&($.fragment=v($.fragment)),$}function S($){const g=[];if($.userinfo!==void 0&&(g.push($.userinfo),g.push("@")),$.host!==void 0){let v=unescape($.host);if(!t(v)){const w=u(v);w.isIPV6===!0?v=`[${w.escapedHost}]`:v=$.host}g.push(v)}return(typeof $.port=="number"||typeof $.port=="string")&&(g.push(":"),g.push(String($.port))),g.length?g.join(""):void 0}return Gt={nonSimpleDomain:n,recomposeAuthority:S,normalizeComponentEncoding:_,removeDotSegments:b,isIPv4:t,isUUID:e,normalizeIPv6:u,stringArrayToHexStripped:a},Gt}var Jt,Ir;function Wn(){if(Ir)return Jt;Ir=1;const{isUUID:e}=kr(),t=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,a=["http","https","ws","wss","urn","urn:uuid"];function n(s){return a.indexOf(s)!==-1}function y(s){return s.secure===!0?!0:s.secure===!1?!1:s.scheme?s.scheme.length===3&&(s.scheme[0]==="w"||s.scheme[0]==="W")&&(s.scheme[1]==="s"||s.scheme[1]==="S")&&(s.scheme[2]==="s"||s.scheme[2]==="S"):!1}function i(s){return s.host||(s.error=s.error||"HTTP URIs must have a host."),s}function p(s){const f=String(s.scheme).toLowerCase()==="https";return(s.port===(f?443:80)||s.port==="")&&(s.port=void 0),s.path||(s.path="/"),s}function u(s){return s.secure=y(s),s.resourceName=(s.path||"/")+(s.query?"?"+s.query:""),s.path=void 0,s.query=void 0,s}function m(s){if((s.port===(y(s)?443:80)||s.port==="")&&(s.port=void 0),typeof s.secure=="boolean"&&(s.scheme=s.secure?"wss":"ws",s.secure=void 0),s.resourceName){const[f,P]=s.resourceName.split("?");s.path=f&&f!=="/"?f:void 0,s.query=P,s.resourceName=void 0}return s.fragment=void 0,s}function b(s,f){if(!s.path)return s.error="URN can not be parsed",s;const P=s.path.match(t);if(P){const N=f.scheme||s.scheme||"urn";s.nid=P[1].toLowerCase(),s.nss=P[2];const D=`${N}:${f.nid||s.nid}`,z=h(D);s.path=void 0,z&&(s=z.parse(s,f))}else s.error=s.error||"URN can not be parsed.";return s}function _(s,f){if(s.nid===void 0)throw new Error("URN without nid cannot be serialized");const P=f.scheme||s.scheme||"urn",N=s.nid.toLowerCase(),D=`${P}:${f.nid||N}`,z=h(D);z&&(s=z.serialize(s,f));const q=s,V=s.nss;return q.path=`${N||f.nid}:${V}`,f.skipEscape=!0,q}function S(s,f){const P=s;return P.uuid=P.nss,P.nss=void 0,!f.tolerant&&(!P.uuid||!e(P.uuid))&&(P.error=P.error||"UUID is not valid."),P}function $(s){const f=s;return f.nss=(s.uuid||"").toLowerCase(),f}const g={scheme:"http",domainHost:!0,parse:i,serialize:p},v={scheme:"https",domainHost:g.domainHost,parse:i,serialize:p},w={scheme:"ws",domainHost:!0,parse:u,serialize:m},c={scheme:"wss",domainHost:w.domainHost,parse:w.parse,serialize:w.serialize},o={http:g,https:v,ws:w,wss:c,urn:{scheme:"urn",parse:b,serialize:_,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:S,serialize:$,skipNormalize:!0}};Object.setPrototypeOf(o,null);function h(s){return s&&(o[s]||o[s.toLowerCase()])||void 0}return Jt={wsIsSecure:y,SCHEMES:o,isValidSchemeName:n,getSchemeHandler:h},Jt}var Rr;function Bn(){if(Rr)return Ne.exports;Rr=1;const{normalizeIPv6:e,removeDotSegments:t,recomposeAuthority:a,normalizeComponentEncoding:n,isIPv4:y,nonSimpleDomain:i}=kr(),{SCHEMES:p,getSchemeHandler:u}=Wn();function m(c,d){return typeof c=="string"?c=$(v(c,d),d):typeof c=="object"&&(c=v($(c,d),d)),c}function b(c,d,r){const o=r?Object.assign({scheme:"null"},r):{scheme:"null"},h=_(v(c,o),v(d,o),o,!0);return o.skipEscape=!0,$(h,o)}function _(c,d,r,o){const h={};return o||(c=v($(c,r),r),d=v($(d,r),r)),r=r||{},!r.tolerant&&d.scheme?(h.scheme=d.scheme,h.userinfo=d.userinfo,h.host=d.host,h.port=d.port,h.path=t(d.path||""),h.query=d.query):(d.userinfo!==void 0||d.host!==void 0||d.port!==void 0?(h.userinfo=d.userinfo,h.host=d.host,h.port=d.port,h.path=t(d.path||""),h.query=d.query):(d.path?(d.path[0]==="/"?h.path=t(d.path):((c.userinfo!==void 0||c.host!==void 0||c.port!==void 0)&&!c.path?h.path="/"+d.path:c.path?h.path=c.path.slice(0,c.path.lastIndexOf("/")+1)+d.path:h.path=d.path,h.path=t(h.path)),h.query=d.query):(h.path=c.path,d.query!==void 0?h.query=d.query:h.query=c.query),h.userinfo=c.userinfo,h.host=c.host,h.port=c.port),h.scheme=c.scheme),h.fragment=d.fragment,h}function S(c,d,r){return typeof c=="string"?(c=unescape(c),c=$(n(v(c,r),!0),{...r,skipEscape:!0})):typeof c=="object"&&(c=$(n(c,!0),{...r,skipEscape:!0})),typeof d=="string"?(d=unescape(d),d=$(n(v(d,r),!0),{...r,skipEscape:!0})):typeof d=="object"&&(d=$(n(d,!0),{...r,skipEscape:!0})),c.toLowerCase()===d.toLowerCase()}function $(c,d){const r={host:c.host,scheme:c.scheme,userinfo:c.userinfo,port:c.port,path:c.path,query:c.query,nid:c.nid,nss:c.nss,uuid:c.uuid,fragment:c.fragment,reference:c.reference,resourceName:c.resourceName,secure:c.secure,error:""},o=Object.assign({},d),h=[],s=u(o.scheme||r.scheme);s&&s.serialize&&s.serialize(r,o),r.path!==void 0&&(o.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),o.reference!=="suffix"&&r.scheme&&h.push(r.scheme,":");const f=a(r);if(f!==void 0&&(o.reference!=="suffix"&&h.push("//"),h.push(f),r.path&&r.path[0]!=="/"&&h.push("/")),r.path!==void 0){let P=r.path;!o.absolutePath&&(!s||!s.absolutePath)&&(P=t(P)),f===void 0&&P[0]==="/"&&P[1]==="/"&&(P="/%2F"+P.slice(2)),h.push(P)}return r.query!==void 0&&h.push("?",r.query),r.fragment!==void 0&&h.push("#",r.fragment),h.join("")}const g=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function v(c,d){const r=Object.assign({},d),o={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let h=!1;r.reference==="suffix"&&(r.scheme?c=r.scheme+":"+c:c="//"+c);const s=c.match(g);if(s){if(o.scheme=s[1],o.userinfo=s[3],o.host=s[4],o.port=parseInt(s[5],10),o.path=s[6]||"",o.query=s[7],o.fragment=s[8],isNaN(o.port)&&(o.port=s[5]),o.host)if(y(o.host)===!1){const N=e(o.host);o.host=N.host.toLowerCase(),h=N.isIPV6}else h=!0;o.scheme===void 0&&o.userinfo===void 0&&o.host===void 0&&o.port===void 0&&o.query===void 0&&!o.path?o.reference="same-document":o.scheme===void 0?o.reference="relative":o.fragment===void 0?o.reference="absolute":o.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==o.reference&&(o.error=o.error||"URI is not a "+r.reference+" reference.");const f=u(r.scheme||o.scheme);if(!r.unicodeSupport&&(!f||!f.unicodeSupport)&&o.host&&(r.domainHost||f&&f.domainHost)&&h===!1&&i(o.host))try{o.host=URL.domainToASCII(o.host.toLowerCase())}catch(P){o.error=o.error||"Host's domain name can not be converted to ASCII: "+P}(!f||f&&!f.skipNormalize)&&(c.indexOf("%")!==-1&&(o.scheme!==void 0&&(o.scheme=unescape(o.scheme)),o.host!==void 0&&(o.host=unescape(o.host))),o.path&&(o.path=escape(unescape(o.path))),o.fragment&&(o.fragment=encodeURI(decodeURIComponent(o.fragment)))),f&&f.parse&&f.parse(o,r)}else o.error=o.error||"URI can not be parsed.";return o}const w={SCHEMES:p,normalize:m,resolve:b,resolveComponent:_,equal:S,serialize:$,parse:v};return Ne.exports=w,Ne.exports.default=w,Ne.exports.fastUri=w,Ne.exports}var Nr;function Yn(){if(Nr)return Ge;Nr=1,Object.defineProperty(Ge,"__esModule",{value:!0});const e=Bn();return e.code='require("ajv/dist/runtime/uri").default',Ge.default=e,Ge}var Or;function Zn(){return Or||(Or=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=Le();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var a=G();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return a._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return a.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return a.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return a.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return a.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return a.CodeGen}});const n=Kt(),y=He(),i=ur(),p=Ht(),u=G(),m=Fe(),b=ze(),_=Y(),S=Jn,$=Yn(),g=(M,k)=>new RegExp(M,k);g.code="new RegExp";const v=["removeAdditional","useDefaults","coerceTypes"],w=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),c={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},d={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},r=200;function o(M){var k,T,R,l,E,O,U,H,Z,B,j,I,C,A,K,W,te,me,ae,ce,re,Ie,ue,Xt,xt;const Te=M.strict,er=(k=M.code)===null||k===void 0?void 0:k.optimize,zn=er===!0||er===void 0?1:er||0,Fn=(R=(T=M.code)===null||T===void 0?void 0:T.regExp)!==null&&R!==void 0?R:g,as=(l=M.uriResolver)!==null&&l!==void 0?l:$.default;return{strictSchema:(O=(E=M.strictSchema)!==null&&E!==void 0?E:Te)!==null&&O!==void 0?O:!0,strictNumbers:(H=(U=M.strictNumbers)!==null&&U!==void 0?U:Te)!==null&&H!==void 0?H:!0,strictTypes:(B=(Z=M.strictTypes)!==null&&Z!==void 0?Z:Te)!==null&&B!==void 0?B:"log",strictTuples:(I=(j=M.strictTuples)!==null&&j!==void 0?j:Te)!==null&&I!==void 0?I:"log",strictRequired:(A=(C=M.strictRequired)!==null&&C!==void 0?C:Te)!==null&&A!==void 0?A:!1,code:M.code?{...M.code,optimize:zn,regExp:Fn}:{optimize:zn,regExp:Fn},loopRequired:(K=M.loopRequired)!==null&&K!==void 0?K:r,loopEnum:(W=M.loopEnum)!==null&&W!==void 0?W:r,meta:(te=M.meta)!==null&&te!==void 0?te:!0,messages:(me=M.messages)!==null&&me!==void 0?me:!0,inlineRefs:(ae=M.inlineRefs)!==null&&ae!==void 0?ae:!0,schemaId:(ce=M.schemaId)!==null&&ce!==void 0?ce:"$id",addUsedSchema:(re=M.addUsedSchema)!==null&&re!==void 0?re:!0,validateSchema:(Ie=M.validateSchema)!==null&&Ie!==void 0?Ie:!0,validateFormats:(ue=M.validateFormats)!==null&&ue!==void 0?ue:!0,unicodeRegExp:(Xt=M.unicodeRegExp)!==null&&Xt!==void 0?Xt:!0,int32range:(xt=M.int32range)!==null&&xt!==void 0?xt:!0,uriResolver:as}}class h{constructor(k={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,k=this.opts={...k,...o(k)};const{es5:T,lines:R}=this.opts.code;this.scope=new u.ValueScope({scope:{},prefixes:w,es5:T,lines:R}),this.logger=V(k.logger);const l=k.validateFormats;k.validateFormats=!1,this.RULES=(0,i.getRules)(),s.call(this,c,k,"NOT SUPPORTED"),s.call(this,d,k,"DEPRECATED","warn"),this._metaOpts=z.call(this),k.formats&&N.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),k.keywords&&D.call(this,k.keywords),typeof k.meta=="object"&&this.addMetaSchema(k.meta),P.call(this),k.validateFormats=l}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:k,meta:T,schemaId:R}=this.opts;let l=S;R==="id"&&(l={...S},l.id=l.$id,delete l.$id),T&&k&&this.addMetaSchema(l,l[R],!1)}defaultMeta(){const{meta:k,schemaId:T}=this.opts;return this.opts.defaultMeta=typeof k=="object"?k[T]||k:void 0}validate(k,T){let R;if(typeof k=="string"){if(R=this.getSchema(k),!R)throw new Error(`no schema with key or ref "${k}"`)}else R=this.compile(k);const l=R(T);return"$async"in R||(this.errors=R.errors),l}compile(k,T){const R=this._addSchema(k,T);return R.validate||this._compileSchemaEnv(R)}compileAsync(k,T){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:R}=this.opts;return l.call(this,k,T);async function l(B,j){await E.call(this,B.$schema);const I=this._addSchema(B,j);return I.validate||O.call(this,I)}async function E(B){B&&!this.getSchema(B)&&await l.call(this,{$ref:B},!0)}async function O(B){try{return this._compileSchemaEnv(B)}catch(j){if(!(j instanceof y.default))throw j;return U.call(this,j),await H.call(this,j.missingSchema),O.call(this,B)}}function U({missingSchema:B,missingRef:j}){if(this.refs[B])throw new Error(`AnySchema ${B} is loaded but ${j} cannot be resolved`)}async function H(B){const j=await Z.call(this,B);this.refs[B]||await E.call(this,j.$schema),this.refs[B]||this.addSchema(j,B,T)}async function Z(B){const j=this._loading[B];if(j)return j;try{return await(this._loading[B]=R(B))}finally{delete this._loading[B]}}}addSchema(k,T,R,l=this.opts.validateSchema){if(Array.isArray(k)){for(const O of k)this.addSchema(O,void 0,R,l);return this}let E;if(typeof k=="object"){const{schemaId:O}=this.opts;if(E=k[O],E!==void 0&&typeof E!="string")throw new Error(`schema ${O} must be string`)}return T=(0,m.normalizeId)(T||E),this._checkUnique(T),this.schemas[T]=this._addSchema(k,R,T,l,!0),this}addMetaSchema(k,T,R=this.opts.validateSchema){return this.addSchema(k,T,!0,R),this}validateSchema(k,T){if(typeof k=="boolean")return!0;let R;if(R=k.$schema,R!==void 0&&typeof R!="string")throw new Error("$schema must be a string");if(R=R||this.opts.defaultMeta||this.defaultMeta(),!R)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const l=this.validate(R,k);if(!l&&T){const E="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(E);else throw new Error(E)}return l}getSchema(k){let T;for(;typeof(T=f.call(this,k))=="string";)k=T;if(T===void 0){const{schemaId:R}=this.opts,l=new p.SchemaEnv({schema:{},schemaId:R});if(T=p.resolveSchema.call(this,l,k),!T)return;this.refs[k]=T}return T.validate||this._compileSchemaEnv(T)}removeSchema(k){if(k instanceof RegExp)return this._removeAllSchemas(this.schemas,k),this._removeAllSchemas(this.refs,k),this;switch(typeof k){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const T=f.call(this,k);return typeof T=="object"&&this._cache.delete(T.schema),delete this.schemas[k],delete this.refs[k],this}case"object":{const T=k;this._cache.delete(T);let R=k[this.opts.schemaId];return R&&(R=(0,m.normalizeId)(R),delete this.schemas[R],delete this.refs[R]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(k){for(const T of k)this.addKeyword(T);return this}addKeyword(k,T){let R;if(typeof k=="string")R=k,typeof T=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),T.keyword=R);else if(typeof k=="object"&&T===void 0){if(T=k,R=T.keyword,Array.isArray(R)&&!R.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(L.call(this,R,T),!T)return(0,_.eachItem)(R,E=>Q.call(this,E)),this;se.call(this,T);const l={...T,type:(0,b.getJSONTypes)(T.type),schemaType:(0,b.getJSONTypes)(T.schemaType)};return(0,_.eachItem)(R,l.type.length===0?E=>Q.call(this,E,l):E=>l.type.forEach(O=>Q.call(this,E,l,O))),this}getKeyword(k){const T=this.RULES.all[k];return typeof T=="object"?T.definition:!!T}removeKeyword(k){const{RULES:T}=this;delete T.keywords[k],delete T.all[k];for(const R of T.rules){const l=R.rules.findIndex(E=>E.keyword===k);l>=0&&R.rules.splice(l,1)}return this}addFormat(k,T){return typeof T=="string"&&(T=new RegExp(T)),this.formats[k]=T,this}errorsText(k=this.errors,{separator:T=", ",dataVar:R="data"}={}){return!k||k.length===0?"No errors":k.map(l=>`${R}${l.instancePath} ${l.message}`).reduce((l,E)=>l+T+E)}$dataMetaSchema(k,T){const R=this.RULES.all;k=JSON.parse(JSON.stringify(k));for(const l of T){const E=l.split("/").slice(1);let O=k;for(const U of E)O=O[U];for(const U in R){const H=R[U];if(typeof H!="object")continue;const{$data:Z}=H.definition,B=O[U];Z&&B&&(O[U]=pe(B))}}return k}_removeAllSchemas(k,T){for(const R in k){const l=k[R];(!T||T.test(R))&&(typeof l=="string"?delete k[R]:l&&!l.meta&&(this._cache.delete(l.schema),delete k[R]))}}_addSchema(k,T,R,l=this.opts.validateSchema,E=this.opts.addUsedSchema){let O;const{schemaId:U}=this.opts;if(typeof k=="object")O=k[U];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof k!="boolean")throw new Error("schema must be object or boolean")}let H=this._cache.get(k);if(H!==void 0)return H;R=(0,m.normalizeId)(O||R);const Z=m.getSchemaRefs.call(this,k,R);return H=new p.SchemaEnv({schema:k,schemaId:U,meta:T,baseId:R,localRefs:Z}),this._cache.set(H.schema,H),E&&!R.startsWith("#")&&(R&&this._checkUnique(R),this.refs[R]=H),l&&this.validateSchema(k,!0),H}_checkUnique(k){if(this.schemas[k]||this.refs[k])throw new Error(`schema with key or id "${k}" already exists`)}_compileSchemaEnv(k){if(k.meta?this._compileMetaSchema(k):p.compileSchema.call(this,k),!k.validate)throw new Error("ajv implementation error");return k.validate}_compileMetaSchema(k){const T=this.opts;this.opts=this._metaOpts;try{p.compileSchema.call(this,k)}finally{this.opts=T}}}h.ValidationError=n.default,h.MissingRefError=y.default,e.default=h;function s(M,k,T,R="error"){for(const l in M){const E=l;E in k&&this.logger[R](`${T}: option ${l}. ${M[E]}`)}}function f(M){return M=(0,m.normalizeId)(M),this.schemas[M]||this.refs[M]}function P(){const M=this.opts.schemas;if(M)if(Array.isArray(M))this.addSchema(M);else for(const k in M)this.addSchema(M[k],k)}function N(){for(const M in this.opts.formats){const k=this.opts.formats[M];k&&this.addFormat(M,k)}}function D(M){if(Array.isArray(M)){this.addVocabulary(M);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const k in M){const T=M[k];T.keyword||(T.keyword=k),this.addKeyword(T)}}function z(){const M={...this.opts};for(const k of v)delete M[k];return M}const q={log(){},warn(){},error(){}};function V(M){if(M===!1)return q;if(M===void 0)return console;if(M.log&&M.warn&&M.error)return M;throw new Error("logger must implement log, warn and error methods")}const F=/^[a-z_$][a-z0-9_$:-]*$/i;function L(M,k){const{RULES:T}=this;if((0,_.eachItem)(M,R=>{if(T.keywords[R])throw new Error(`Keyword ${R} is already defined`);if(!F.test(R))throw new Error(`Keyword ${R} has invalid name`)}),!!k&&k.$data&&!("code"in k||"validate"in k))throw new Error('$data keyword must have "code" or "validate" function')}function Q(M,k,T){var R;const l=k?.post;if(T&&l)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:E}=this;let O=l?E.post:E.rules.find(({type:H})=>H===T);if(O||(O={type:T,rules:[]},E.rules.push(O)),E.keywords[M]=!0,!k)return;const U={keyword:M,definition:{...k,type:(0,b.getJSONTypes)(k.type),schemaType:(0,b.getJSONTypes)(k.schemaType)}};k.before?ie.call(this,O,U,k.before):O.rules.push(U),E.all[M]=U,(R=k.implements)===null||R===void 0||R.forEach(H=>this.addKeyword(H))}function ie(M,k,T){const R=M.rules.findIndex(l=>l.keyword===T);R>=0?M.rules.splice(R,0,k):(M.rules.push(k),this.logger.warn(`rule ${T} is not defined`))}function se(M){let{metaSchema:k}=M;k!==void 0&&(M.$data&&this.opts.$data&&(k=pe(k)),M.validateSchema=this.compile(k,!0))}const x={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function pe(M){return{anyOf:[M,x]}}})(Mt)),Mt}var Je={},We={},Be={},qr;function Qn(){if(qr)return Be;qr=1,Object.defineProperty(Be,"__esModule",{value:!0});const e={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};return Be.default=e,Be}var _e={},Cr;function Xn(){if(Cr)return _e;Cr=1,Object.defineProperty(_e,"__esModule",{value:!0}),_e.callRef=_e.getValidate=void 0;const e=He(),t=fe(),a=G(),n=ve(),y=Ht(),i=Y(),p={keyword:"$ref",schemaType:"string",code(b){const{gen:_,schema:S,it:$}=b,{baseId:g,schemaEnv:v,validateName:w,opts:c,self:d}=$,{root:r}=v;if((S==="#"||S==="#/")&&g===r.baseId)return h();const o=y.resolveRef.call(d,r,g,S);if(o===void 0)throw new e.default($.opts.uriResolver,g,S);if(o instanceof y.SchemaEnv)return s(o);return f(o);function h(){if(v===r)return m(b,w,v,v.$async);const P=_.scopeValue("root",{ref:r});return m(b,(0,a._)`${P}.validate`,r,r.$async)}function s(P){const N=u(b,P);m(b,N,P,P.$async)}function f(P){const N=_.scopeValue("schema",c.code.source===!0?{ref:P,code:(0,a.stringify)(P)}:{ref:P}),D=_.name("valid"),z=b.subschema({schema:P,dataTypes:[],schemaPath:a.nil,topSchemaRef:N,errSchemaPath:S},D);b.mergeEvaluated(z),b.ok(D)}}};function u(b,_){const{gen:S}=b;return _.validate?S.scopeValue("validate",{ref:_.validate}):(0,a._)`${S.scopeValue("wrapper",{ref:_})}.validate`}_e.getValidate=u;function m(b,_,S,$){const{gen:g,it:v}=b,{allErrors:w,schemaEnv:c,opts:d}=v,r=d.passContext?n.default.this:a.nil;$?o():h();function o(){if(!c.$async)throw new Error("async schema referenced by sync schema");const P=g.let("valid");g.try(()=>{g.code((0,a._)`await ${(0,t.callValidateCode)(b,_,r)}`),f(_),w||g.assign(P,!0)},N=>{g.if((0,a._)`!(${N} instanceof ${v.ValidationError})`,()=>g.throw(N)),s(N),w||g.assign(P,!1)}),b.ok(P)}function h(){b.result((0,t.callValidateCode)(b,_,r),()=>f(_),()=>s(_))}function s(P){const N=(0,a._)`${P}.errors`;g.assign(n.default.vErrors,(0,a._)`${n.default.vErrors} === null ? ${N} : ${n.default.vErrors}.concat(${N})`),g.assign(n.default.errors,(0,a._)`${n.default.vErrors}.length`)}function f(P){var N;if(!v.opts.unevaluated)return;const D=(N=S?.validate)===null||N===void 0?void 0:N.evaluated;if(v.props!==!0)if(D&&!D.dynamicProps)D.props!==void 0&&(v.props=i.mergeEvaluated.props(g,D.props,v.props));else{const z=g.var("props",(0,a._)`${P}.evaluated.props`);v.props=i.mergeEvaluated.props(g,z,v.props,a.Name)}if(v.items!==!0)if(D&&!D.dynamicItems)D.items!==void 0&&(v.items=i.mergeEvaluated.items(g,D.items,v.items));else{const z=g.var("items",(0,a._)`${P}.evaluated.items`);v.items=i.mergeEvaluated.items(g,z,v.items,a.Name)}}}return _e.callRef=m,_e.default=p,_e}var Tr;function xn(){if(Tr)return We;Tr=1,Object.defineProperty(We,"__esModule",{value:!0});const e=Qn(),t=Xn(),a=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,t.default];return We.default=a,We}var Ye={},Ze={},Dr;function ei(){if(Dr)return Ze;Dr=1,Object.defineProperty(Ze,"__esModule",{value:!0});const e=G(),t=e.operators,a={maximum:{okStr:"<=",ok:t.LTE,fail:t.GT},minimum:{okStr:">=",ok:t.GTE,fail:t.LT},exclusiveMaximum:{okStr:"<",ok:t.LT,fail:t.GTE},exclusiveMinimum:{okStr:">",ok:t.GT,fail:t.LTE}},n={message:({keyword:i,schemaCode:p})=>(0,e.str)`must be ${a[i].okStr} ${p}`,params:({keyword:i,schemaCode:p})=>(0,e._)`{comparison: ${a[i].okStr}, limit: ${p}}`},y={keyword:Object.keys(a),type:"number",schemaType:"number",$data:!0,error:n,code(i){const{keyword:p,data:u,schemaCode:m}=i;i.fail$data((0,e._)`${u} ${a[p].fail} ${m} || isNaN(${u})`)}};return Ze.default=y,Ze}var Qe={},Mr;function ti(){if(Mr)return Qe;Mr=1,Object.defineProperty(Qe,"__esModule",{value:!0});const e=G(),a={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:n})=>(0,e.str)`must be multiple of ${n}`,params:({schemaCode:n})=>(0,e._)`{multipleOf: ${n}}`},code(n){const{gen:y,data:i,schemaCode:p,it:u}=n,m=u.opts.multipleOfPrecision,b=y.let("res"),_=m?(0,e._)`Math.abs(Math.round(${b}) - ${b}) > 1e-${m}`:(0,e._)`${b} !== parseInt(${b})`;n.fail$data((0,e._)`(${p} === 0 || (${b} = ${i}/${p}, ${_}))`)}};return Qe.default=a,Qe}var Xe={},xe={},Ar;function ri(){if(Ar)return xe;Ar=1,Object.defineProperty(xe,"__esModule",{value:!0});function e(t){const a=t.length;let n=0,y=0,i;for(;y<a;)n++,i=t.charCodeAt(y++),i>=55296&&i<=56319&&y<a&&(i=t.charCodeAt(y),(i&64512)===56320&&y++);return n}return xe.default=e,e.code='require("ajv/dist/runtime/ucs2length").default',xe}var Vr;function ni(){if(Vr)return Xe;Vr=1,Object.defineProperty(Xe,"__esModule",{value:!0});const e=G(),t=Y(),a=ri(),y={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:i,schemaCode:p}){const u=i==="maxLength"?"more":"fewer";return(0,e.str)`must NOT have ${u} than ${p} characters`},params:({schemaCode:i})=>(0,e._)`{limit: ${i}}`},code(i){const{keyword:p,data:u,schemaCode:m,it:b}=i,_=p==="maxLength"?e.operators.GT:e.operators.LT,S=b.opts.unicode===!1?(0,e._)`${u}.length`:(0,e._)`${(0,t.useFunc)(i.gen,a.default)}(${u})`;i.fail$data((0,e._)`${S} ${_} ${m}`)}};return Xe.default=y,Xe}var et={},zr;function ii(){if(zr)return et;zr=1,Object.defineProperty(et,"__esModule",{value:!0});const e=fe(),t=G(),n={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:y})=>(0,t.str)`must match pattern "${y}"`,params:({schemaCode:y})=>(0,t._)`{pattern: ${y}}`},code(y){const{data:i,$data:p,schema:u,schemaCode:m,it:b}=y,_=b.opts.unicodeRegExp?"u":"",S=p?(0,t._)`(new RegExp(${m}, ${_}))`:(0,e.usePattern)(y,u);y.fail$data((0,t._)`!${S}.test(${i})`)}};return et.default=n,et}var tt={},Fr;function si(){if(Fr)return tt;Fr=1,Object.defineProperty(tt,"__esModule",{value:!0});const e=G(),a={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:n,schemaCode:y}){const i=n==="maxProperties"?"more":"fewer";return(0,e.str)`must NOT have ${i} than ${y} properties`},params:({schemaCode:n})=>(0,e._)`{limit: ${n}}`},code(n){const{keyword:y,data:i,schemaCode:p}=n,u=y==="maxProperties"?e.operators.GT:e.operators.LT;n.fail$data((0,e._)`Object.keys(${i}).length ${u} ${p}`)}};return tt.default=a,tt}var rt={},Lr;function oi(){if(Lr)return rt;Lr=1,Object.defineProperty(rt,"__esModule",{value:!0});const e=fe(),t=G(),a=Y(),y={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:i}})=>(0,t.str)`must have required property '${i}'`,params:({params:{missingProperty:i}})=>(0,t._)`{missingProperty: ${i}}`},code(i){const{gen:p,schema:u,schemaCode:m,data:b,$data:_,it:S}=i,{opts:$}=S;if(!_&&u.length===0)return;const g=u.length>=$.loopRequired;if(S.allErrors?v():w(),$.strictRequired){const r=i.parentSchema.properties,{definedProperties:o}=i.it;for(const h of u)if(r?.[h]===void 0&&!o.has(h)){const s=S.schemaEnv.baseId+S.errSchemaPath,f=`required property "${h}" is not defined at "${s}" (strictRequired)`;(0,a.checkStrictMode)(S,f,S.opts.strictRequired)}}function v(){if(g||_)i.block$data(t.nil,c);else for(const r of u)(0,e.checkReportMissingProp)(i,r)}function w(){const r=p.let("missing");if(g||_){const o=p.let("valid",!0);i.block$data(o,()=>d(r,o)),i.ok(o)}else p.if((0,e.checkMissingProp)(i,u,r)),(0,e.reportMissingProp)(i,r),p.else()}function c(){p.forOf("prop",m,r=>{i.setParams({missingProperty:r}),p.if((0,e.noPropertyInData)(p,b,r,$.ownProperties),()=>i.error())})}function d(r,o){i.setParams({missingProperty:r}),p.forOf(r,m,()=>{p.assign(o,(0,e.propertyInData)(p,b,r,$.ownProperties)),p.if((0,t.not)(o),()=>{i.error(),p.break()})},t.nil)}}};return rt.default=y,rt}var nt={},Ur;function ai(){if(Ur)return nt;Ur=1,Object.defineProperty(nt,"__esModule",{value:!0});const e=G(),a={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:n,schemaCode:y}){const i=n==="maxItems"?"more":"fewer";return(0,e.str)`must NOT have ${i} than ${y} items`},params:({schemaCode:n})=>(0,e._)`{limit: ${n}}`},code(n){const{keyword:y,data:i,schemaCode:p}=n,u=y==="maxItems"?e.operators.GT:e.operators.LT;n.fail$data((0,e._)`${i}.length ${u} ${p}`)}};return nt.default=a,nt}var it={},st={},Kr;function Wt(){if(Kr)return st;Kr=1,Object.defineProperty(st,"__esModule",{value:!0});const e=_r();return e.code='require("ajv/dist/runtime/equal").default',st.default=e,st}var Hr;function ci(){if(Hr)return it;Hr=1,Object.defineProperty(it,"__esModule",{value:!0});const e=ze(),t=G(),a=Y(),n=Wt(),i={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:p,j:u}})=>(0,t.str)`must NOT have duplicate items (items ## ${u} and ${p} are identical)`,params:({params:{i:p,j:u}})=>(0,t._)`{i: ${p}, j: ${u}}`},code(p){const{gen:u,data:m,$data:b,schema:_,parentSchema:S,schemaCode:$,it:g}=p;if(!b&&!_)return;const v=u.let("valid"),w=S.items?(0,e.getSchemaTypes)(S.items):[];p.block$data(v,c,(0,t._)`${$} === false`),p.ok(v);function c(){const h=u.let("i",(0,t._)`${m}.length`),s=u.let("j");p.setParams({i:h,j:s}),u.assign(v,!0),u.if((0,t._)`${h} > 1`,()=>(d()?r:o)(h,s))}function d(){return w.length>0&&!w.some(h=>h==="object"||h==="array")}function r(h,s){const f=u.name("item"),P=(0,e.checkDataTypes)(w,f,g.opts.strictNumbers,e.DataType.Wrong),N=u.const("indices",(0,t._)`{}`);u.for((0,t._)`;${h}--;`,()=>{u.let(f,(0,t._)`${m}[${h}]`),u.if(P,(0,t._)`continue`),w.length>1&&u.if((0,t._)`typeof ${f} == "string"`,(0,t._)`${f} += "_"`),u.if((0,t._)`typeof ${N}[${f}] == "number"`,()=>{u.assign(s,(0,t._)`${N}[${f}]`),p.error(),u.assign(v,!1).break()}).code((0,t._)`${N}[${f}] = ${h}`)})}function o(h,s){const f=(0,a.useFunc)(u,n.default),P=u.name("outer");u.label(P).for((0,t._)`;${h}--;`,()=>u.for((0,t._)`${s} = ${h}; ${s}--;`,()=>u.if((0,t._)`${f}(${m}[${h}], ${m}[${s}])`,()=>{p.error(),u.assign(v,!1).break(P)})))}}};return it.default=i,it}var ot={},Gr;function di(){if(Gr)return ot;Gr=1,Object.defineProperty(ot,"__esModule",{value:!0});const e=G(),t=Y(),a=Wt(),y={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:i})=>(0,e._)`{allowedValue: ${i}}`},code(i){const{gen:p,data:u,$data:m,schemaCode:b,schema:_}=i;m||_&&typeof _=="object"?i.fail$data((0,e._)`!${(0,t.useFunc)(p,a.default)}(${u}, ${b})`):i.fail((0,e._)`${_} !== ${u}`)}};return ot.default=y,ot}var at={},Jr;function ui(){if(Jr)return at;Jr=1,Object.defineProperty(at,"__esModule",{value:!0});const e=G(),t=Y(),a=Wt(),y={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:i})=>(0,e._)`{allowedValues: ${i}}`},code(i){const{gen:p,data:u,$data:m,schema:b,schemaCode:_,it:S}=i;if(!m&&b.length===0)throw new Error("enum must have non-empty array");const $=b.length>=S.opts.loopEnum;let g;const v=()=>g??(g=(0,t.useFunc)(p,a.default));let w;if($||m)w=p.let("valid"),i.block$data(w,c);else{if(!Array.isArray(b))throw new Error("ajv implementation error");const r=p.const("vSchema",_);w=(0,e.or)(...b.map((o,h)=>d(r,h)))}i.pass(w);function c(){p.assign(w,!1),p.forOf("v",_,r=>p.if((0,e._)`${v()}(${u}, ${r})`,()=>p.assign(w,!0).break()))}function d(r,o){const h=b[o];return typeof h=="object"&&h!==null?(0,e._)`${v()}(${u}, ${r}[${o}])`:(0,e._)`${u} === ${h}`}}};return at.default=y,at}var Wr;function li(){if(Wr)return Ye;Wr=1,Object.defineProperty(Ye,"__esModule",{value:!0});const e=ei(),t=ti(),a=ni(),n=ii(),y=si(),i=oi(),p=ai(),u=ci(),m=di(),b=ui(),_=[e.default,t.default,a.default,n.default,y.default,i.default,p.default,u.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},m.default,b.default];return Ye.default=_,Ye}var ct={},je={},Br;function Yr(){if(Br)return je;Br=1,Object.defineProperty(je,"__esModule",{value:!0}),je.validateAdditionalItems=void 0;const e=G(),t=Y(),n={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:i}})=>(0,e.str)`must NOT have more than ${i} items`,params:({params:{len:i}})=>(0,e._)`{limit: ${i}}`},code(i){const{parentSchema:p,it:u}=i,{items:m}=p;if(!Array.isArray(m)){(0,t.checkStrictMode)(u,'"additionalItems" is ignored when "items" is not an array of schemas');return}y(i,m)}};function y(i,p){const{gen:u,schema:m,data:b,keyword:_,it:S}=i;S.items=!0;const $=u.const("len",(0,e._)`${b}.length`);if(m===!1)i.setParams({len:p.length}),i.pass((0,e._)`${$} <= ${p.length}`);else if(typeof m=="object"&&!(0,t.alwaysValidSchema)(S,m)){const v=u.var("valid",(0,e._)`${$} <= ${p.length}`);u.if((0,e.not)(v),()=>g(v)),i.ok(v)}function g(v){u.forRange("i",p.length,$,w=>{i.subschema({keyword:_,dataProp:w,dataPropType:t.Type.Num},v),S.allErrors||u.if((0,e.not)(v),()=>u.break())})}}return je.validateAdditionalItems=y,je.default=n,je}var dt={},ke={},Zr;function Qr(){if(Zr)return ke;Zr=1,Object.defineProperty(ke,"__esModule",{value:!0}),ke.validateTuple=void 0;const e=G(),t=Y(),a=fe(),n={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(i){const{schema:p,it:u}=i;if(Array.isArray(p))return y(i,"additionalItems",p);u.items=!0,!(0,t.alwaysValidSchema)(u,p)&&i.ok((0,a.validateArray)(i))}};function y(i,p,u=i.schema){const{gen:m,parentSchema:b,data:_,keyword:S,it:$}=i;w(b),$.opts.unevaluated&&u.length&&$.items!==!0&&($.items=t.mergeEvaluated.items(m,u.length,$.items));const g=m.name("valid"),v=m.const("len",(0,e._)`${_}.length`);u.forEach((c,d)=>{(0,t.alwaysValidSchema)($,c)||(m.if((0,e._)`${v} > ${d}`,()=>i.subschema({keyword:S,schemaProp:d,dataProp:d},g)),i.ok(g))});function w(c){const{opts:d,errSchemaPath:r}=$,o=u.length,h=o===c.minItems&&(o===c.maxItems||c[p]===!1);if(d.strictTuples&&!h){const s=`"${S}" is ${o}-tuple, but minItems or maxItems/${p} are not specified or different at path "${r}"`;(0,t.checkStrictMode)($,s,d.strictTuples)}}}return ke.validateTuple=y,ke.default=n,ke}var Xr;function fi(){if(Xr)return dt;Xr=1,Object.defineProperty(dt,"__esModule",{value:!0});const e=Qr(),t={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:a=>(0,e.validateTuple)(a,"items")};return dt.default=t,dt}var ut={},xr;function pi(){if(xr)return ut;xr=1,Object.defineProperty(ut,"__esModule",{value:!0});const e=G(),t=Y(),a=fe(),n=Yr(),i={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:p}})=>(0,e.str)`must NOT have more than ${p} items`,params:({params:{len:p}})=>(0,e._)`{limit: ${p}}`},code(p){const{schema:u,parentSchema:m,it:b}=p,{prefixItems:_}=m;b.items=!0,!(0,t.alwaysValidSchema)(b,u)&&(_?(0,n.validateAdditionalItems)(p,_):p.ok((0,a.validateArray)(p)))}};return ut.default=i,ut}var lt={},en;function mi(){if(en)return lt;en=1,Object.defineProperty(lt,"__esModule",{value:!0});const e=G(),t=Y(),n={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:y,max:i}})=>i===void 0?(0,e.str)`must contain at least ${y} valid item(s)`:(0,e.str)`must contain at least ${y} and no more than ${i} valid item(s)`,params:({params:{min:y,max:i}})=>i===void 0?(0,e._)`{minContains: ${y}}`:(0,e._)`{minContains: ${y}, maxContains: ${i}}`},code(y){const{gen:i,schema:p,parentSchema:u,data:m,it:b}=y;let _,S;const{minContains:$,maxContains:g}=u;b.opts.next?(_=$===void 0?1:$,S=g):_=1;const v=i.const("len",(0,e._)`${m}.length`);if(y.setParams({min:_,max:S}),S===void 0&&_===0){(0,t.checkStrictMode)(b,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(S!==void 0&&_>S){(0,t.checkStrictMode)(b,'"minContains" > "maxContains" is always invalid'),y.fail();return}if((0,t.alwaysValidSchema)(b,p)){let o=(0,e._)`${v} >= ${_}`;S!==void 0&&(o=(0,e._)`${o} && ${v} <= ${S}`),y.pass(o);return}b.items=!0;const w=i.name("valid");S===void 0&&_===1?d(w,()=>i.if(w,()=>i.break())):_===0?(i.let(w,!0),S!==void 0&&i.if((0,e._)`${m}.length > 0`,c)):(i.let(w,!1),c()),y.result(w,()=>y.reset());function c(){const o=i.name("_valid"),h=i.let("count",0);d(o,()=>i.if(o,()=>r(h)))}function d(o,h){i.forRange("i",0,v,s=>{y.subschema({keyword:"contains",dataProp:s,dataPropType:t.Type.Num,compositeRule:!0},o),h()})}function r(o){i.code((0,e._)`${o}++`),S===void 0?i.if((0,e._)`${o} >= ${_}`,()=>i.assign(w,!0).break()):(i.if((0,e._)`${o} > ${S}`,()=>i.assign(w,!1).break()),_===1?i.assign(w,!0):i.if((0,e._)`${o} >= ${_}`,()=>i.assign(w,!0)))}}};return lt.default=n,lt}var Bt={},tn;function hi(){return tn||(tn=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=G(),a=Y(),n=fe();e.error={message:({params:{property:m,depsCount:b,deps:_}})=>{const S=b===1?"property":"properties";return(0,t.str)`must have ${S} ${_} when property ${m} is present`},params:({params:{property:m,depsCount:b,deps:_,missingProperty:S}})=>(0,t._)`{property: ${m},
6
- missingProperty: ${S},
1
+ (function(ke,Se){typeof exports=="object"&&typeof module<"u"?Se(exports):typeof define=="function"&&define.amd?define(["exports"],Se):(ke=typeof globalThis<"u"?globalThis:ke||self,Se(ke.CICSDK={}))})(this,(function(ke){"use strict";function Se(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Me={exports:{}},Zt={},ge={},we={},Qt={},Xt={},xt={},hr;function Ae(){return hr||(hr=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class n extends t{constructor(r){if(super(),!e.IDENTIFIER.test(r))throw new Error("CodeGen: name must be a valid identifier");this.str=r}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=n;class i extends t{constructor(r){super(),this._items=typeof r=="string"?[r]:r}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const r=this._items[0];return r===""||r==='""'}get str(){var r;return(r=this._str)!==null&&r!==void 0?r:this._str=this._items.reduce((a,y)=>`${a}${y}`,"")}get names(){var r;return(r=this._names)!==null&&r!==void 0?r:this._names=this._items.reduce((a,y)=>(y instanceof n&&(a[y.str]=(a[y.str]||0)+1),a),{})}}e._Code=i,e.nil=new i("");function h(d,...r){const a=[d[0]];let y=0;for(;y<r.length;)u(a,r[y]),a.push(d[++y]);return new i(a)}e._=h;const s=new i("+");function p(d,...r){const a=[g(d[0])];let y=0;for(;y<r.length;)a.push(s),u(a,r[y]),a.push(s,g(d[++y]));return m(a),new i(a)}e.str=p;function u(d,r){r instanceof i?d.push(...r._items):r instanceof n?d.push(r):d.push(k(r))}e.addCodeArg=u;function m(d){let r=1;for(;r<d.length-1;){if(d[r]===s){const a=b(d[r-1],d[r+1]);if(a!==void 0){d.splice(r-1,3,a);continue}d[r++]="+"}r++}}function b(d,r){if(r==='""')return d;if(d==='""')return r;if(typeof d=="string")return r instanceof n||d[d.length-1]!=='"'?void 0:typeof r!="string"?`${d.slice(0,-1)}${r}"`:r[0]==='"'?d.slice(0,-1)+r.slice(1):void 0;if(typeof r=="string"&&r[0]==='"'&&!(d instanceof n))return`"${d}${r.slice(1)}`}function _(d,r){return r.emptyStr()?d:d.emptyStr()?r:p`${d}${r}`}e.strConcat=_;function k(d){return typeof d=="number"||typeof d=="boolean"||d===null?d:g(Array.isArray(d)?d.join(","):d)}function $(d){return new i(g(d))}e.stringify=$;function g(d){return JSON.stringify(d).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=g;function v(d){return typeof d=="string"&&e.IDENTIFIER.test(d)?new i(`.${d}`):h`[${d}]`}e.getProperty=v;function w(d){if(typeof d=="string"&&e.IDENTIFIER.test(d))return new i(`${d}`);throw new Error(`CodeGen: invalid export name: ${d}, use explicit $id name mapping`)}e.getEsmExportName=w;function c(d){return new i(d.toString())}e.regexpCode=c})(xt)),xt}var er={},yr;function gr(){return yr||(yr=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=Ae();class n extends Error{constructor(b){super(`CodeGen: "code" for ${b} not defined`),this.value=b.value}}var i;(function(m){m[m.Started=0]="Started",m[m.Completed=1]="Completed"})(i||(e.UsedValueState=i={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class h{constructor({prefixes:b,parent:_}={}){this._names={},this._prefixes=b,this._parent=_}toName(b){return b instanceof t.Name?b:this.name(b)}name(b){return new t.Name(this._newName(b))}_newName(b){const _=this._names[b]||this._nameGroup(b);return`${b}${_.index++}`}_nameGroup(b){var _,k;if(!((k=(_=this._parent)===null||_===void 0?void 0:_._prefixes)===null||k===void 0)&&k.has(b)||this._prefixes&&!this._prefixes.has(b))throw new Error(`CodeGen: prefix "${b}" is not allowed in this scope`);return this._names[b]={prefix:b,index:0}}}e.Scope=h;class s extends t.Name{constructor(b,_){super(_),this.prefix=b}setValue(b,{property:_,itemIndex:k}){this.value=b,this.scopePath=(0,t._)`.${new t.Name(_)}[${k}]`}}e.ValueScopeName=s;const p=(0,t._)`\n`;class u extends h{constructor(b){super(b),this._values={},this._scope=b.scope,this.opts={...b,_n:b.lines?p:t.nil}}get(){return this._scope}name(b){return new s(b,this._newName(b))}value(b,_){var k;if(_.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const $=this.toName(b),{prefix:g}=$,v=(k=_.key)!==null&&k!==void 0?k:_.ref;let w=this._values[g];if(w){const r=w.get(v);if(r)return r}else w=this._values[g]=new Map;w.set(v,$);const c=this._scope[g]||(this._scope[g]=[]),d=c.length;return c[d]=_.ref,$.setValue(_,{property:g,itemIndex:d}),$}getValue(b,_){const k=this._values[b];if(k)return k.get(_)}scopeRefs(b,_=this._values){return this._reduceValues(_,k=>{if(k.scopePath===void 0)throw new Error(`CodeGen: name "${k}" has no value`);return(0,t._)`${b}${k.scopePath}`})}scopeCode(b=this._values,_,k){return this._reduceValues(b,$=>{if($.value===void 0)throw new Error(`CodeGen: name "${$}" has no value`);return $.value.code},_,k)}_reduceValues(b,_,k={},$){let g=t.nil;for(const v in b){const w=b[v];if(!w)continue;const c=k[v]=k[v]||new Map;w.forEach(d=>{if(c.has(d))return;c.set(d,i.Started);let r=_(d);if(r){const a=this.opts.es5?e.varKinds.var:e.varKinds.const;g=(0,t._)`${g}${a} ${d} = ${r};${this.opts._n}`}else if(r=$?.(d))g=(0,t._)`${g}${r}${this.opts._n}`;else throw new n(d);c.set(d,i.Completed)})}return g}}e.ValueScope=u})(er)),er}var vr;function J(){return vr||(vr=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=Ae(),n=gr();var i=Ae();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return i._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return i.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return i.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return i.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return i.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return i.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return i.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return i.Name}});var h=gr();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return h.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return h.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return h.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return h.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class s{optimizeNodes(){return this}optimizeNames(l,E){return this}}class p extends s{constructor(l,E,O){super(),this.varKind=l,this.name=E,this.rhs=O}render({es5:l,_n:E}){const O=l?n.varKinds.var:this.varKind,U=this.rhs===void 0?"":` = ${this.rhs}`;return`${O} ${this.name}${U};`+E}optimizeNames(l,E){if(l[this.name.str])return this.rhs&&(this.rhs=L(this.rhs,l,E)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class u extends s{constructor(l,E,O){super(),this.lhs=l,this.rhs=E,this.sideEffects=O}render({_n:l}){return`${this.lhs} = ${this.rhs};`+l}optimizeNames(l,E){if(!(this.lhs instanceof t.Name&&!l[this.lhs.str]&&!this.sideEffects))return this.rhs=L(this.rhs,l,E),this}get names(){const l=this.lhs instanceof t.Name?{}:{...this.lhs.names};return F(l,this.rhs)}}class m extends u{constructor(l,E,O,U){super(l,O,U),this.op=E}render({_n:l}){return`${this.lhs} ${this.op}= ${this.rhs};`+l}}class b extends s{constructor(l){super(),this.label=l,this.names={}}render({_n:l}){return`${this.label}:`+l}}class _ extends s{constructor(l){super(),this.label=l,this.names={}}render({_n:l}){return`break${this.label?` ${this.label}`:""};`+l}}class k extends s{constructor(l){super(),this.error=l}render({_n:l}){return`throw ${this.error};`+l}get names(){return this.error.names}}class $ extends s{constructor(l){super(),this.code=l}render({_n:l}){return`${this.code};`+l}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(l,E){return this.code=L(this.code,l,E),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class g extends s{constructor(l=[]){super(),this.nodes=l}render(l){return this.nodes.reduce((E,O)=>E+O.render(l),"")}optimizeNodes(){const{nodes:l}=this;let E=l.length;for(;E--;){const O=l[E].optimizeNodes();Array.isArray(O)?l.splice(E,1,...O):O?l[E]=O:l.splice(E,1)}return l.length>0?this:void 0}optimizeNames(l,E){const{nodes:O}=this;let U=O.length;for(;U--;){const H=O[U];H.optimizeNames(l,E)||(X(l,H.names),O.splice(U,1))}return O.length>0?this:void 0}get names(){return this.nodes.reduce((l,E)=>V(l,E.names),{})}}class v extends g{render(l){return"{"+l._n+super.render(l)+"}"+l._n}}class w extends g{}class c extends v{}c.kind="else";class d extends v{constructor(l,E){super(E),this.condition=l}render(l){let E=`if(${this.condition})`+super.render(l);return this.else&&(E+="else "+this.else.render(l)),E}optimizeNodes(){super.optimizeNodes();const l=this.condition;if(l===!0)return this.nodes;let E=this.else;if(E){const O=E.optimizeNodes();E=this.else=Array.isArray(O)?new c(O):O}if(E)return l===!1?E instanceof d?E:E.nodes:this.nodes.length?this:new d(ae(l),E instanceof d?[E]:E.nodes);if(!(l===!1||!this.nodes.length))return this}optimizeNames(l,E){var O;if(this.else=(O=this.else)===null||O===void 0?void 0:O.optimizeNames(l,E),!!(super.optimizeNames(l,E)||this.else))return this.condition=L(this.condition,l,E),this}get names(){const l=super.names;return F(l,this.condition),this.else&&V(l,this.else.names),l}}d.kind="if";class r extends v{}r.kind="for";class a extends r{constructor(l){super(),this.iteration=l}render(l){return`for(${this.iteration})`+super.render(l)}optimizeNames(l,E){if(super.optimizeNames(l,E))return this.iteration=L(this.iteration,l,E),this}get names(){return V(super.names,this.iteration.names)}}class y extends r{constructor(l,E,O,U){super(),this.varKind=l,this.name=E,this.from=O,this.to=U}render(l){const E=l.es5?n.varKinds.var:this.varKind,{name:O,from:U,to:H}=this;return`for(${E} ${O}=${U}; ${O}<${H}; ${O}++)`+super.render(l)}get names(){const l=F(super.names,this.from);return F(l,this.to)}}class o extends r{constructor(l,E,O,U){super(),this.loop=l,this.varKind=E,this.name=O,this.iterable=U}render(l){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(l)}optimizeNames(l,E){if(super.optimizeNames(l,E))return this.iterable=L(this.iterable,l,E),this}get names(){return V(super.names,this.iterable.names)}}class f extends v{constructor(l,E,O){super(),this.name=l,this.args=E,this.async=O}render(l){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(l)}}f.kind="func";class P extends g{render(l){return"return "+super.render(l)}}P.kind="return";class N extends v{render(l){let E="try"+super.render(l);return this.catch&&(E+=this.catch.render(l)),this.finally&&(E+=this.finally.render(l)),E}optimizeNodes(){var l,E;return super.optimizeNodes(),(l=this.catch)===null||l===void 0||l.optimizeNodes(),(E=this.finally)===null||E===void 0||E.optimizeNodes(),this}optimizeNames(l,E){var O,U;return super.optimizeNames(l,E),(O=this.catch)===null||O===void 0||O.optimizeNames(l,E),(U=this.finally)===null||U===void 0||U.optimizeNames(l,E),this}get names(){const l=super.names;return this.catch&&V(l,this.catch.names),this.finally&&V(l,this.finally.names),l}}class D extends v{constructor(l){super(),this.error=l}render(l){return`catch(${this.error})`+super.render(l)}}D.kind="catch";class z extends v{render(l){return"finally"+super.render(l)}}z.kind="finally";class C{constructor(l,E={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...E,_n:E.lines?`
2
+ `:""},this._extScope=l,this._scope=new n.Scope({parent:l}),this._nodes=[new w]}toString(){return this._root.render(this.opts)}name(l){return this._scope.name(l)}scopeName(l){return this._extScope.name(l)}scopeValue(l,E){const O=this._extScope.value(l,E);return(this._values[O.prefix]||(this._values[O.prefix]=new Set)).add(O),O}getScopeValue(l,E){return this._extScope.getValue(l,E)}scopeRefs(l){return this._extScope.scopeRefs(l,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(l,E,O,U){const H=this._scope.toName(E);return O!==void 0&&U&&(this._constants[H.str]=O),this._leafNode(new p(l,H,O)),H}const(l,E,O){return this._def(n.varKinds.const,l,E,O)}let(l,E,O){return this._def(n.varKinds.let,l,E,O)}var(l,E,O){return this._def(n.varKinds.var,l,E,O)}assign(l,E,O){return this._leafNode(new u(l,E,O))}add(l,E){return this._leafNode(new m(l,e.operators.ADD,E))}code(l){return typeof l=="function"?l():l!==t.nil&&this._leafNode(new $(l)),this}object(...l){const E=["{"];for(const[O,U]of l)E.length>1&&E.push(","),E.push(O),(O!==U||this.opts.es5)&&(E.push(":"),(0,t.addCodeArg)(E,U));return E.push("}"),new t._Code(E)}if(l,E,O){if(this._blockNode(new d(l)),E&&O)this.code(E).else().code(O).endIf();else if(E)this.code(E).endIf();else if(O)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(l){return this._elseNode(new d(l))}else(){return this._elseNode(new c)}endIf(){return this._endBlockNode(d,c)}_for(l,E){return this._blockNode(l),E&&this.code(E).endFor(),this}for(l,E){return this._for(new a(l),E)}forRange(l,E,O,U,H=this.opts.es5?n.varKinds.var:n.varKinds.let){const Q=this._scope.toName(l);return this._for(new y(H,Q,E,O),()=>U(Q))}forOf(l,E,O,U=n.varKinds.const){const H=this._scope.toName(l);if(this.opts.es5){const Q=E instanceof t.Name?E:this.var("_arr",E);return this.forRange("_i",0,(0,t._)`${Q}.length`,Y=>{this.var(H,(0,t._)`${Q}[${Y}]`),O(H)})}return this._for(new o("of",U,H,E),()=>O(H))}forIn(l,E,O,U=this.opts.es5?n.varKinds.var:n.varKinds.const){if(this.opts.ownProperties)return this.forOf(l,(0,t._)`Object.keys(${E})`,O);const H=this._scope.toName(l);return this._for(new o("in",U,H,E),()=>O(H))}endFor(){return this._endBlockNode(r)}label(l){return this._leafNode(new b(l))}break(l){return this._leafNode(new _(l))}return(l){const E=new P;if(this._blockNode(E),this.code(l),E.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(P)}try(l,E,O){if(!E&&!O)throw new Error('CodeGen: "try" without "catch" and "finally"');const U=new N;if(this._blockNode(U),this.code(l),E){const H=this.name("e");this._currNode=U.catch=new D(H),E(H)}return O&&(this._currNode=U.finally=new z,this.code(O)),this._endBlockNode(D,z)}throw(l){return this._leafNode(new k(l))}block(l,E){return this._blockStarts.push(this._nodes.length),l&&this.code(l).endBlock(E),this}endBlock(l){const E=this._blockStarts.pop();if(E===void 0)throw new Error("CodeGen: not in self-balancing block");const O=this._nodes.length-E;if(O<0||l!==void 0&&O!==l)throw new Error(`CodeGen: wrong number of nodes: ${O} vs ${l} expected`);return this._nodes.length=E,this}func(l,E=t.nil,O,U){return this._blockNode(new f(l,E,O)),U&&this.code(U).endFunc(),this}endFunc(){return this._endBlockNode(f)}optimize(l=1){for(;l-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(l){return this._currNode.nodes.push(l),this}_blockNode(l){this._currNode.nodes.push(l),this._nodes.push(l)}_endBlockNode(l,E){const O=this._currNode;if(O instanceof l||E&&O instanceof E)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${E?`${l.kind}/${E.kind}`:l.kind}"`)}_elseNode(l){const E=this._currNode;if(!(E instanceof d))throw new Error('CodeGen: "else" without "if"');return this._currNode=E.else=l,this}get _root(){return this._nodes[0]}get _currNode(){const l=this._nodes;return l[l.length-1]}set _currNode(l){const E=this._nodes;E[E.length-1]=l}}e.CodeGen=C;function V(R,l){for(const E in l)R[E]=(R[E]||0)+(l[E]||0);return R}function F(R,l){return l instanceof t._CodeOrName?V(R,l.names):R}function L(R,l,E){if(R instanceof t.Name)return O(R);if(!U(R))return R;return new t._Code(R._items.reduce((H,Q)=>(Q instanceof t.Name&&(Q=O(Q)),Q instanceof t._Code?H.push(...Q._items):H.push(Q),H),[]));function O(H){const Q=E[H.str];return Q===void 0||l[H.str]!==1?H:(delete l[H.str],Q)}function U(H){return H instanceof t._Code&&H._items.some(Q=>Q instanceof t.Name&&l[Q.str]===1&&E[Q.str]!==void 0)}}function X(R,l){for(const E in l)R[E]=(R[E]||0)-(l[E]||0)}function ae(R){return typeof R=="boolean"||typeof R=="number"||R===null?!R:(0,t._)`!${T(R)}`}e.not=ae;const ce=j(e.operators.AND);function ee(...R){return R.reduce(ce)}e.and=ee;const he=j(e.operators.OR);function M(...R){return R.reduce(he)}e.or=M;function j(R){return(l,E)=>l===t.nil?E:E===t.nil?l:(0,t._)`${T(l)} ${R} ${T(E)}`}function T(R){return R instanceof t.Name?R:(0,t._)`(${R})`}})(Xt)),Xt}var W={},_r;function Z(){if(_r)return W;_r=1,Object.defineProperty(W,"__esModule",{value:!0}),W.checkStrictMode=W.getErrorPath=W.Type=W.useFunc=W.setEvaluated=W.evaluatedPropsToName=W.mergeEvaluated=W.eachItem=W.unescapeJsonPointer=W.escapeJsonPointer=W.escapeFragment=W.unescapeFragment=W.schemaRefOrVal=W.schemaHasRulesButRef=W.schemaHasRules=W.checkUnknownRules=W.alwaysValidSchema=W.toHash=void 0;const e=J(),t=Ae();function n(o){const f={};for(const P of o)f[P]=!0;return f}W.toHash=n;function i(o,f){return typeof f=="boolean"?f:Object.keys(f).length===0?!0:(h(o,f),!s(f,o.self.RULES.all))}W.alwaysValidSchema=i;function h(o,f=o.schema){const{opts:P,self:N}=o;if(!P.strictSchema||typeof f=="boolean")return;const D=N.RULES.keywords;for(const z in f)D[z]||y(o,`unknown keyword: "${z}"`)}W.checkUnknownRules=h;function s(o,f){if(typeof o=="boolean")return!o;for(const P in o)if(f[P])return!0;return!1}W.schemaHasRules=s;function p(o,f){if(typeof o=="boolean")return!o;for(const P in o)if(P!=="$ref"&&f.all[P])return!0;return!1}W.schemaHasRulesButRef=p;function u({topSchemaRef:o,schemaPath:f},P,N,D){if(!D){if(typeof P=="number"||typeof P=="boolean")return P;if(typeof P=="string")return(0,e._)`${P}`}return(0,e._)`${o}${f}${(0,e.getProperty)(N)}`}W.schemaRefOrVal=u;function m(o){return k(decodeURIComponent(o))}W.unescapeFragment=m;function b(o){return encodeURIComponent(_(o))}W.escapeFragment=b;function _(o){return typeof o=="number"?`${o}`:o.replace(/~/g,"~0").replace(/\//g,"~1")}W.escapeJsonPointer=_;function k(o){return o.replace(/~1/g,"/").replace(/~0/g,"~")}W.unescapeJsonPointer=k;function $(o,f){if(Array.isArray(o))for(const P of o)f(P);else f(o)}W.eachItem=$;function g({mergeNames:o,mergeToName:f,mergeValues:P,resultToName:N}){return(D,z,C,V)=>{const F=C===void 0?z:C instanceof e.Name?(z instanceof e.Name?o(D,z,C):f(D,z,C),C):z instanceof e.Name?(f(D,C,z),z):P(z,C);return V===e.Name&&!(F instanceof e.Name)?N(D,F):F}}W.mergeEvaluated={props:g({mergeNames:(o,f,P)=>o.if((0,e._)`${P} !== true && ${f} !== undefined`,()=>{o.if((0,e._)`${f} === true`,()=>o.assign(P,!0),()=>o.assign(P,(0,e._)`${P} || {}`).code((0,e._)`Object.assign(${P}, ${f})`))}),mergeToName:(o,f,P)=>o.if((0,e._)`${P} !== true`,()=>{f===!0?o.assign(P,!0):(o.assign(P,(0,e._)`${P} || {}`),w(o,P,f))}),mergeValues:(o,f)=>o===!0?!0:{...o,...f},resultToName:v}),items:g({mergeNames:(o,f,P)=>o.if((0,e._)`${P} !== true && ${f} !== undefined`,()=>o.assign(P,(0,e._)`${f} === true ? true : ${P} > ${f} ? ${P} : ${f}`)),mergeToName:(o,f,P)=>o.if((0,e._)`${P} !== true`,()=>o.assign(P,f===!0?!0:(0,e._)`${P} > ${f} ? ${P} : ${f}`)),mergeValues:(o,f)=>o===!0?!0:Math.max(o,f),resultToName:(o,f)=>o.var("items",f)})};function v(o,f){if(f===!0)return o.var("props",!0);const P=o.var("props",(0,e._)`{}`);return f!==void 0&&w(o,P,f),P}W.evaluatedPropsToName=v;function w(o,f,P){Object.keys(P).forEach(N=>o.assign((0,e._)`${f}${(0,e.getProperty)(N)}`,!0))}W.setEvaluated=w;const c={};function d(o,f){return o.scopeValue("func",{ref:f,code:c[f.code]||(c[f.code]=new t._Code(f.code))})}W.useFunc=d;var r;(function(o){o[o.Num=0]="Num",o[o.Str=1]="Str"})(r||(W.Type=r={}));function a(o,f,P){if(o instanceof e.Name){const N=f===r.Num;return P?N?(0,e._)`"[" + ${o} + "]"`:(0,e._)`"['" + ${o} + "']"`:N?(0,e._)`"/" + ${o}`:(0,e._)`"/" + ${o}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return P?(0,e.getProperty)(o).toString():"/"+_(o)}W.getErrorPath=a;function y(o,f,P=o.opts.strictSchema){if(P){if(f=`strict mode: ${f}`,P===!0)throw new Error(f);o.self.logger.warn(f)}}return W.checkStrictMode=y,W}var Ve={},$r;function $e(){if($r)return Ve;$r=1,Object.defineProperty(Ve,"__esModule",{value:!0});const e=J(),t={data:new e.Name("data"),valCxt:new e.Name("valCxt"),instancePath:new e.Name("instancePath"),parentData:new e.Name("parentData"),parentDataProperty:new e.Name("parentDataProperty"),rootData:new e.Name("rootData"),dynamicAnchors:new e.Name("dynamicAnchors"),vErrors:new e.Name("vErrors"),errors:new e.Name("errors"),this:new e.Name("this"),self:new e.Name("self"),scope:new e.Name("scope"),json:new e.Name("json"),jsonPos:new e.Name("jsonPos"),jsonLen:new e.Name("jsonLen"),jsonPart:new e.Name("jsonPart")};return Ve.default=t,Ve}var br;function ze(){return br||(br=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=J(),n=Z(),i=$e();e.keywordError={message:({keyword:c})=>(0,t.str)`must pass "${c}" keyword validation`},e.keyword$DataError={message:({keyword:c,schemaType:d})=>d?(0,t.str)`"${c}" keyword must be ${d} ($data)`:(0,t.str)`"${c}" keyword is invalid ($data)`};function h(c,d=e.keywordError,r,a){const{it:y}=c,{gen:o,compositeRule:f,allErrors:P}=y,N=k(c,d,r);a??(f||P)?m(o,N):b(y,(0,t._)`[${N}]`)}e.reportError=h;function s(c,d=e.keywordError,r){const{it:a}=c,{gen:y,compositeRule:o,allErrors:f}=a,P=k(c,d,r);m(y,P),o||f||b(a,i.default.vErrors)}e.reportExtraError=s;function p(c,d){c.assign(i.default.errors,d),c.if((0,t._)`${i.default.vErrors} !== null`,()=>c.if(d,()=>c.assign((0,t._)`${i.default.vErrors}.length`,d),()=>c.assign(i.default.vErrors,null)))}e.resetErrorsCount=p;function u({gen:c,keyword:d,schemaValue:r,data:a,errsCount:y,it:o}){if(y===void 0)throw new Error("ajv implementation error");const f=c.name("err");c.forRange("i",y,i.default.errors,P=>{c.const(f,(0,t._)`${i.default.vErrors}[${P}]`),c.if((0,t._)`${f}.instancePath === undefined`,()=>c.assign((0,t._)`${f}.instancePath`,(0,t.strConcat)(i.default.instancePath,o.errorPath))),c.assign((0,t._)`${f}.schemaPath`,(0,t.str)`${o.errSchemaPath}/${d}`),o.opts.verbose&&(c.assign((0,t._)`${f}.schema`,r),c.assign((0,t._)`${f}.data`,a))})}e.extendErrors=u;function m(c,d){const r=c.const("err",d);c.if((0,t._)`${i.default.vErrors} === null`,()=>c.assign(i.default.vErrors,(0,t._)`[${r}]`),(0,t._)`${i.default.vErrors}.push(${r})`),c.code((0,t._)`${i.default.errors}++`)}function b(c,d){const{gen:r,validateName:a,schemaEnv:y}=c;y.$async?r.throw((0,t._)`new ${c.ValidationError}(${d})`):(r.assign((0,t._)`${a}.errors`,d),r.return(!1))}const _={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function k(c,d,r){const{createErrors:a}=c.it;return a===!1?(0,t._)`{}`:$(c,d,r)}function $(c,d,r={}){const{gen:a,it:y}=c,o=[g(y,r),v(c,r)];return w(c,d,o),a.object(...o)}function g({errorPath:c},{instancePath:d}){const r=d?(0,t.str)`${c}${(0,n.getErrorPath)(d,n.Type.Str)}`:c;return[i.default.instancePath,(0,t.strConcat)(i.default.instancePath,r)]}function v({keyword:c,it:{errSchemaPath:d}},{schemaPath:r,parentSchema:a}){let y=a?d:(0,t.str)`${d}/${c}`;return r&&(y=(0,t.str)`${y}${(0,n.getErrorPath)(r,n.Type.Str)}`),[_.schemaPath,y]}function w(c,{params:d,message:r},a){const{keyword:y,data:o,schemaValue:f,it:P}=c,{opts:N,propertyName:D,topSchemaRef:z,schemaPath:C}=P;a.push([_.keyword,y],[_.params,typeof d=="function"?d(c):d||(0,t._)`{}`]),N.messages&&a.push([_.message,typeof r=="function"?r(c):r]),N.verbose&&a.push([_.schema,f],[_.parentSchema,(0,t._)`${z}${C}`],[i.default.data,o]),D&&a.push([_.propertyName,D])}})(Qt)),Qt}var wr;function xn(){if(wr)return we;wr=1,Object.defineProperty(we,"__esModule",{value:!0}),we.boolOrEmptySchema=we.topBoolOrEmptySchema=void 0;const e=ze(),t=J(),n=$e(),i={message:"boolean schema is false"};function h(u){const{gen:m,schema:b,validateName:_}=u;b===!1?p(u,!1):typeof b=="object"&&b.$async===!0?m.return(n.default.data):(m.assign((0,t._)`${_}.errors`,null),m.return(!0))}we.topBoolOrEmptySchema=h;function s(u,m){const{gen:b,schema:_}=u;_===!1?(b.var(m,!1),p(u)):b.var(m,!0)}we.boolOrEmptySchema=s;function p(u,m){const{gen:b,data:_}=u,k={gen:b,keyword:"false schema",data:_,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:u};(0,e.reportError)(k,i,void 0,m)}return we}var re={},Pe={},Pr;function Er(){if(Pr)return Pe;Pr=1,Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.getRules=Pe.isJSONType=void 0;const e=["string","number","integer","boolean","null","object","array"],t=new Set(e);function n(h){return typeof h=="string"&&t.has(h)}Pe.isJSONType=n;function i(){const h={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...h,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},h.number,h.string,h.array,h.object],post:{rules:[]},all:{},keywords:{}}}return Pe.getRules=i,Pe}var ve={},kr;function Sr(){if(kr)return ve;kr=1,Object.defineProperty(ve,"__esModule",{value:!0}),ve.shouldUseRule=ve.shouldUseGroup=ve.schemaHasRulesForType=void 0;function e({schema:i,self:h},s){const p=h.RULES.types[s];return p&&p!==!0&&t(i,p)}ve.schemaHasRulesForType=e;function t(i,h){return h.rules.some(s=>n(i,s))}ve.shouldUseGroup=t;function n(i,h){var s;return i[h.keyword]!==void 0||((s=h.definition.implements)===null||s===void 0?void 0:s.some(p=>i[p]!==void 0))}return ve.shouldUseRule=n,ve}var jr;function Fe(){if(jr)return re;jr=1,Object.defineProperty(re,"__esModule",{value:!0}),re.reportTypeError=re.checkDataTypes=re.checkDataType=re.coerceAndCheckDataType=re.getJSONTypes=re.getSchemaTypes=re.DataType=void 0;const e=Er(),t=Sr(),n=ze(),i=J(),h=Z();var s;(function(r){r[r.Correct=0]="Correct",r[r.Wrong=1]="Wrong"})(s||(re.DataType=s={}));function p(r){const a=u(r.type);if(a.includes("null")){if(r.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!a.length&&r.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');r.nullable===!0&&a.push("null")}return a}re.getSchemaTypes=p;function u(r){const a=Array.isArray(r)?r:r?[r]:[];if(a.every(e.isJSONType))return a;throw new Error("type must be JSONType or JSONType[]: "+a.join(","))}re.getJSONTypes=u;function m(r,a){const{gen:y,data:o,opts:f}=r,P=_(a,f.coerceTypes),N=a.length>0&&!(P.length===0&&a.length===1&&(0,t.schemaHasRulesForType)(r,a[0]));if(N){const D=v(a,o,f.strictNumbers,s.Wrong);y.if(D,()=>{P.length?k(r,a,P):c(r)})}return N}re.coerceAndCheckDataType=m;const b=new Set(["string","number","integer","boolean","null"]);function _(r,a){return a?r.filter(y=>b.has(y)||a==="array"&&y==="array"):[]}function k(r,a,y){const{gen:o,data:f,opts:P}=r,N=o.let("dataType",(0,i._)`typeof ${f}`),D=o.let("coerced",(0,i._)`undefined`);P.coerceTypes==="array"&&o.if((0,i._)`${N} == 'object' && Array.isArray(${f}) && ${f}.length == 1`,()=>o.assign(f,(0,i._)`${f}[0]`).assign(N,(0,i._)`typeof ${f}`).if(v(a,f,P.strictNumbers),()=>o.assign(D,f))),o.if((0,i._)`${D} !== undefined`);for(const C of y)(b.has(C)||C==="array"&&P.coerceTypes==="array")&&z(C);o.else(),c(r),o.endIf(),o.if((0,i._)`${D} !== undefined`,()=>{o.assign(f,D),$(r,D)});function z(C){switch(C){case"string":o.elseIf((0,i._)`${N} == "number" || ${N} == "boolean"`).assign(D,(0,i._)`"" + ${f}`).elseIf((0,i._)`${f} === null`).assign(D,(0,i._)`""`);return;case"number":o.elseIf((0,i._)`${N} == "boolean" || ${f} === null
3
+ || (${N} == "string" && ${f} && ${f} == +${f})`).assign(D,(0,i._)`+${f}`);return;case"integer":o.elseIf((0,i._)`${N} === "boolean" || ${f} === null
4
+ || (${N} === "string" && ${f} && ${f} == +${f} && !(${f} % 1))`).assign(D,(0,i._)`+${f}`);return;case"boolean":o.elseIf((0,i._)`${f} === "false" || ${f} === 0 || ${f} === null`).assign(D,!1).elseIf((0,i._)`${f} === "true" || ${f} === 1`).assign(D,!0);return;case"null":o.elseIf((0,i._)`${f} === "" || ${f} === 0 || ${f} === false`),o.assign(D,null);return;case"array":o.elseIf((0,i._)`${N} === "string" || ${N} === "number"
5
+ || ${N} === "boolean" || ${f} === null`).assign(D,(0,i._)`[${f}]`)}}}function $({gen:r,parentData:a,parentDataProperty:y},o){r.if((0,i._)`${a} !== undefined`,()=>r.assign((0,i._)`${a}[${y}]`,o))}function g(r,a,y,o=s.Correct){const f=o===s.Correct?i.operators.EQ:i.operators.NEQ;let P;switch(r){case"null":return(0,i._)`${a} ${f} null`;case"array":P=(0,i._)`Array.isArray(${a})`;break;case"object":P=(0,i._)`${a} && typeof ${a} == "object" && !Array.isArray(${a})`;break;case"integer":P=N((0,i._)`!(${a} % 1) && !isNaN(${a})`);break;case"number":P=N();break;default:return(0,i._)`typeof ${a} ${f} ${r}`}return o===s.Correct?P:(0,i.not)(P);function N(D=i.nil){return(0,i.and)((0,i._)`typeof ${a} == "number"`,D,y?(0,i._)`isFinite(${a})`:i.nil)}}re.checkDataType=g;function v(r,a,y,o){if(r.length===1)return g(r[0],a,y,o);let f;const P=(0,h.toHash)(r);if(P.array&&P.object){const N=(0,i._)`typeof ${a} != "object"`;f=P.null?N:(0,i._)`!${a} || ${N}`,delete P.null,delete P.array,delete P.object}else f=i.nil;P.number&&delete P.integer;for(const N in P)f=(0,i.and)(f,g(N,a,y,o));return f}re.checkDataTypes=v;const w={message:({schema:r})=>`must be ${r}`,params:({schema:r,schemaValue:a})=>typeof r=="string"?(0,i._)`{type: ${r}}`:(0,i._)`{type: ${a}}`};function c(r){const a=d(r);(0,n.reportError)(a,w)}re.reportTypeError=c;function d(r){const{gen:a,data:y,schema:o}=r,f=(0,h.schemaRefOrVal)(r,o,"type");return{gen:a,keyword:"type",data:y,schema:o.type,schemaCode:f,schemaValue:f,parentSchema:o,params:{},it:r}}return re}var Ne={},Ir;function es(){if(Ir)return Ne;Ir=1,Object.defineProperty(Ne,"__esModule",{value:!0}),Ne.assignDefaults=void 0;const e=J(),t=Z();function n(h,s){const{properties:p,items:u}=h.schema;if(s==="object"&&p)for(const m in p)i(h,m,p[m].default);else s==="array"&&Array.isArray(u)&&u.forEach((m,b)=>i(h,b,m.default))}Ne.assignDefaults=n;function i(h,s,p){const{gen:u,compositeRule:m,data:b,opts:_}=h;if(p===void 0)return;const k=(0,e._)`${b}${(0,e.getProperty)(s)}`;if(m){(0,t.checkStrictMode)(h,`default is ignored for: ${k}`);return}let $=(0,e._)`${k} === undefined`;_.useDefaults==="empty"&&($=(0,e._)`${$} || ${k} === null || ${k} === ""`),u.if($,(0,e._)`${k} = ${(0,e.stringify)(p)}`)}return Ne}var pe={},x={},Rr;function me(){if(Rr)return x;Rr=1,Object.defineProperty(x,"__esModule",{value:!0}),x.validateUnion=x.validateArray=x.usePattern=x.callValidateCode=x.schemaProperties=x.allSchemaProperties=x.noPropertyInData=x.propertyInData=x.isOwnProperty=x.hasPropFunc=x.reportMissingProp=x.checkMissingProp=x.checkReportMissingProp=void 0;const e=J(),t=Z(),n=$e(),i=Z();function h(r,a){const{gen:y,data:o,it:f}=r;y.if(_(y,o,a,f.opts.ownProperties),()=>{r.setParams({missingProperty:(0,e._)`${a}`},!0),r.error()})}x.checkReportMissingProp=h;function s({gen:r,data:a,it:{opts:y}},o,f){return(0,e.or)(...o.map(P=>(0,e.and)(_(r,a,P,y.ownProperties),(0,e._)`${f} = ${P}`)))}x.checkMissingProp=s;function p(r,a){r.setParams({missingProperty:a},!0),r.error()}x.reportMissingProp=p;function u(r){return r.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,e._)`Object.prototype.hasOwnProperty`})}x.hasPropFunc=u;function m(r,a,y){return(0,e._)`${u(r)}.call(${a}, ${y})`}x.isOwnProperty=m;function b(r,a,y,o){const f=(0,e._)`${a}${(0,e.getProperty)(y)} !== undefined`;return o?(0,e._)`${f} && ${m(r,a,y)}`:f}x.propertyInData=b;function _(r,a,y,o){const f=(0,e._)`${a}${(0,e.getProperty)(y)} === undefined`;return o?(0,e.or)(f,(0,e.not)(m(r,a,y))):f}x.noPropertyInData=_;function k(r){return r?Object.keys(r).filter(a=>a!=="__proto__"):[]}x.allSchemaProperties=k;function $(r,a){return k(a).filter(y=>!(0,t.alwaysValidSchema)(r,a[y]))}x.schemaProperties=$;function g({schemaCode:r,data:a,it:{gen:y,topSchemaRef:o,schemaPath:f,errorPath:P},it:N},D,z,C){const V=C?(0,e._)`${r}, ${a}, ${o}${f}`:a,F=[[n.default.instancePath,(0,e.strConcat)(n.default.instancePath,P)],[n.default.parentData,N.parentData],[n.default.parentDataProperty,N.parentDataProperty],[n.default.rootData,n.default.rootData]];N.opts.dynamicRef&&F.push([n.default.dynamicAnchors,n.default.dynamicAnchors]);const L=(0,e._)`${V}, ${y.object(...F)}`;return z!==e.nil?(0,e._)`${D}.call(${z}, ${L})`:(0,e._)`${D}(${L})`}x.callValidateCode=g;const v=(0,e._)`new RegExp`;function w({gen:r,it:{opts:a}},y){const o=a.unicodeRegExp?"u":"",{regExp:f}=a.code,P=f(y,o);return r.scopeValue("pattern",{key:P.toString(),ref:P,code:(0,e._)`${f.code==="new RegExp"?v:(0,i.useFunc)(r,f)}(${y}, ${o})`})}x.usePattern=w;function c(r){const{gen:a,data:y,keyword:o,it:f}=r,P=a.name("valid");if(f.allErrors){const D=a.let("valid",!0);return N(()=>a.assign(D,!1)),D}return a.var(P,!0),N(()=>a.break()),P;function N(D){const z=a.const("len",(0,e._)`${y}.length`);a.forRange("i",0,z,C=>{r.subschema({keyword:o,dataProp:C,dataPropType:t.Type.Num},P),a.if((0,e.not)(P),D)})}}x.validateArray=c;function d(r){const{gen:a,schema:y,keyword:o,it:f}=r;if(!Array.isArray(y))throw new Error("ajv implementation error");if(y.some(z=>(0,t.alwaysValidSchema)(f,z))&&!f.opts.unevaluated)return;const N=a.let("valid",!1),D=a.name("_valid");a.block(()=>y.forEach((z,C)=>{const V=r.subschema({keyword:o,schemaProp:C,compositeRule:!0},D);a.assign(N,(0,e._)`${N} || ${D}`),r.mergeValidEvaluated(V,D)||a.if((0,e.not)(N))})),r.result(N,()=>r.reset(),()=>r.error(!0))}return x.validateUnion=d,x}var Nr;function ts(){if(Nr)return pe;Nr=1,Object.defineProperty(pe,"__esModule",{value:!0}),pe.validateKeywordUsage=pe.validSchemaType=pe.funcKeywordCode=pe.macroKeywordCode=void 0;const e=J(),t=$e(),n=me(),i=ze();function h($,g){const{gen:v,keyword:w,schema:c,parentSchema:d,it:r}=$,a=g.macro.call(r.self,c,d,r),y=b(v,w,a);r.opts.validateSchema!==!1&&r.self.validateSchema(a,!0);const o=v.name("valid");$.subschema({schema:a,schemaPath:e.nil,errSchemaPath:`${r.errSchemaPath}/${w}`,topSchemaRef:y,compositeRule:!0},o),$.pass(o,()=>$.error(!0))}pe.macroKeywordCode=h;function s($,g){var v;const{gen:w,keyword:c,schema:d,parentSchema:r,$data:a,it:y}=$;m(y,g);const o=!a&&g.compile?g.compile.call(y.self,d,r,y):g.validate,f=b(w,c,o),P=w.let("valid");$.block$data(P,N),$.ok((v=g.valid)!==null&&v!==void 0?v:P);function N(){if(g.errors===!1)C(),g.modifying&&p($),V(()=>$.error());else{const F=g.async?D():z();g.modifying&&p($),V(()=>u($,F))}}function D(){const F=w.let("ruleErrs",null);return w.try(()=>C((0,e._)`await `),L=>w.assign(P,!1).if((0,e._)`${L} instanceof ${y.ValidationError}`,()=>w.assign(F,(0,e._)`${L}.errors`),()=>w.throw(L))),F}function z(){const F=(0,e._)`${f}.errors`;return w.assign(F,null),C(e.nil),F}function C(F=g.async?(0,e._)`await `:e.nil){const L=y.opts.passContext?t.default.this:t.default.self,X=!("compile"in g&&!a||g.schema===!1);w.assign(P,(0,e._)`${F}${(0,n.callValidateCode)($,f,L,X)}`,g.modifying)}function V(F){var L;w.if((0,e.not)((L=g.valid)!==null&&L!==void 0?L:P),F)}}pe.funcKeywordCode=s;function p($){const{gen:g,data:v,it:w}=$;g.if(w.parentData,()=>g.assign(v,(0,e._)`${w.parentData}[${w.parentDataProperty}]`))}function u($,g){const{gen:v}=$;v.if((0,e._)`Array.isArray(${g})`,()=>{v.assign(t.default.vErrors,(0,e._)`${t.default.vErrors} === null ? ${g} : ${t.default.vErrors}.concat(${g})`).assign(t.default.errors,(0,e._)`${t.default.vErrors}.length`),(0,i.extendErrors)($)},()=>$.error())}function m({schemaEnv:$},g){if(g.async&&!$.$async)throw new Error("async keyword in sync schema")}function b($,g,v){if(v===void 0)throw new Error(`keyword "${g}" failed to compile`);return $.scopeValue("keyword",typeof v=="function"?{ref:v}:{ref:v,code:(0,e.stringify)(v)})}function _($,g,v=!1){return!g.length||g.some(w=>w==="array"?Array.isArray($):w==="object"?$&&typeof $=="object"&&!Array.isArray($):typeof $==w||v&&typeof $>"u")}pe.validSchemaType=_;function k({schema:$,opts:g,self:v,errSchemaPath:w},c,d){if(Array.isArray(c.keyword)?!c.keyword.includes(d):c.keyword!==d)throw new Error("ajv implementation error");const r=c.dependencies;if(r?.some(a=>!Object.prototype.hasOwnProperty.call($,a)))throw new Error(`parent schema must have dependencies of ${d}: ${r.join(",")}`);if(c.validateSchema&&!c.validateSchema($[d])){const y=`keyword "${d}" value is invalid at path "${w}": `+v.errorsText(c.validateSchema.errors);if(g.validateSchema==="log")v.logger.error(y);else throw new Error(y)}}return pe.validateKeywordUsage=k,pe}var _e={},Or;function rs(){if(Or)return _e;Or=1,Object.defineProperty(_e,"__esModule",{value:!0}),_e.extendSubschemaMode=_e.extendSubschemaData=_e.getSubschema=void 0;const e=J(),t=Z();function n(s,{keyword:p,schemaProp:u,schema:m,schemaPath:b,errSchemaPath:_,topSchemaRef:k}){if(p!==void 0&&m!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(p!==void 0){const $=s.schema[p];return u===void 0?{schema:$,schemaPath:(0,e._)`${s.schemaPath}${(0,e.getProperty)(p)}`,errSchemaPath:`${s.errSchemaPath}/${p}`}:{schema:$[u],schemaPath:(0,e._)`${s.schemaPath}${(0,e.getProperty)(p)}${(0,e.getProperty)(u)}`,errSchemaPath:`${s.errSchemaPath}/${p}/${(0,t.escapeFragment)(u)}`}}if(m!==void 0){if(b===void 0||_===void 0||k===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:m,schemaPath:b,topSchemaRef:k,errSchemaPath:_}}throw new Error('either "keyword" or "schema" must be passed')}_e.getSubschema=n;function i(s,p,{dataProp:u,dataPropType:m,data:b,dataTypes:_,propertyName:k}){if(b!==void 0&&u!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:$}=p;if(u!==void 0){const{errorPath:v,dataPathArr:w,opts:c}=p,d=$.let("data",(0,e._)`${p.data}${(0,e.getProperty)(u)}`,!0);g(d),s.errorPath=(0,e.str)`${v}${(0,t.getErrorPath)(u,m,c.jsPropertySyntax)}`,s.parentDataProperty=(0,e._)`${u}`,s.dataPathArr=[...w,s.parentDataProperty]}if(b!==void 0){const v=b instanceof e.Name?b:$.let("data",b,!0);g(v),k!==void 0&&(s.propertyName=k)}_&&(s.dataTypes=_);function g(v){s.data=v,s.dataLevel=p.dataLevel+1,s.dataTypes=[],p.definedProperties=new Set,s.parentData=p.data,s.dataNames=[...p.dataNames,v]}}_e.extendSubschemaData=i;function h(s,{jtdDiscriminator:p,jtdMetadata:u,compositeRule:m,createErrors:b,allErrors:_}){m!==void 0&&(s.compositeRule=m),b!==void 0&&(s.createErrors=b),_!==void 0&&(s.allErrors=_),s.jtdDiscriminator=p,s.jtdMetadata=u}return _e.extendSubschemaMode=h,_e}var ie={},tr,Cr;function qr(){return Cr||(Cr=1,tr=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var i,h,s;if(Array.isArray(t)){if(i=t.length,i!=n.length)return!1;for(h=i;h--!==0;)if(!e(t[h],n[h]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(s=Object.keys(t),i=s.length,i!==Object.keys(n).length)return!1;for(h=i;h--!==0;)if(!Object.prototype.hasOwnProperty.call(n,s[h]))return!1;for(h=i;h--!==0;){var p=s[h];if(!e(t[p],n[p]))return!1}return!0}return t!==t&&n!==n}),tr}var rr={exports:{}},Tr;function ns(){if(Tr)return rr.exports;Tr=1;var e=rr.exports=function(i,h,s){typeof h=="function"&&(s=h,h={}),s=h.cb||s;var p=typeof s=="function"?s:s.pre||function(){},u=s.post||function(){};t(h,p,u,i,"",i)};e.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},e.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},e.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},e.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 t(i,h,s,p,u,m,b,_,k,$){if(p&&typeof p=="object"&&!Array.isArray(p)){h(p,u,m,b,_,k,$);for(var g in p){var v=p[g];if(Array.isArray(v)){if(g in e.arrayKeywords)for(var w=0;w<v.length;w++)t(i,h,s,v[w],u+"/"+g+"/"+w,m,u,g,p,w)}else if(g in e.propsKeywords){if(v&&typeof v=="object")for(var c in v)t(i,h,s,v[c],u+"/"+g+"/"+n(c),m,u,g,p,c)}else(g in e.keywords||i.allKeys&&!(g in e.skipKeywords))&&t(i,h,s,v,u+"/"+g,m,u,g,p)}s(p,u,m,b,_,k,$)}}function n(i){return i.replace(/~/g,"~0").replace(/\//g,"~1")}return rr.exports}var Dr;function Le(){if(Dr)return ie;Dr=1,Object.defineProperty(ie,"__esModule",{value:!0}),ie.getSchemaRefs=ie.resolveUrl=ie.normalizeId=ie._getFullPath=ie.getFullPath=ie.inlineRef=void 0;const e=Z(),t=qr(),n=ns(),i=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function h(w,c=!0){return typeof w=="boolean"?!0:c===!0?!p(w):c?u(w)<=c:!1}ie.inlineRef=h;const s=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function p(w){for(const c in w){if(s.has(c))return!0;const d=w[c];if(Array.isArray(d)&&d.some(p)||typeof d=="object"&&p(d))return!0}return!1}function u(w){let c=0;for(const d in w){if(d==="$ref")return 1/0;if(c++,!i.has(d)&&(typeof w[d]=="object"&&(0,e.eachItem)(w[d],r=>c+=u(r)),c===1/0))return 1/0}return c}function m(w,c="",d){d!==!1&&(c=k(c));const r=w.parse(c);return b(w,r)}ie.getFullPath=m;function b(w,c){return w.serialize(c).split("#")[0]+"#"}ie._getFullPath=b;const _=/#\/?$/;function k(w){return w?w.replace(_,""):""}ie.normalizeId=k;function $(w,c,d){return d=k(d),w.resolve(c,d)}ie.resolveUrl=$;const g=/^[a-z_][-a-z0-9._]*$/i;function v(w,c){if(typeof w=="boolean")return{};const{schemaId:d,uriResolver:r}=this.opts,a=k(w[d]||c),y={"":a},o=m(r,a,!1),f={},P=new Set;return n(w,{allKeys:!0},(z,C,V,F)=>{if(F===void 0)return;const L=o+C;let X=y[F];typeof z[d]=="string"&&(X=ae.call(this,z[d])),ce.call(this,z.$anchor),ce.call(this,z.$dynamicAnchor),y[C]=X;function ae(ee){const he=this.opts.uriResolver.resolve;if(ee=k(X?he(X,ee):ee),P.has(ee))throw D(ee);P.add(ee);let M=this.refs[ee];return typeof M=="string"&&(M=this.refs[M]),typeof M=="object"?N(z,M.schema,ee):ee!==k(L)&&(ee[0]==="#"?(N(z,f[ee],ee),f[ee]=z):this.refs[ee]=L),ee}function ce(ee){if(typeof ee=="string"){if(!g.test(ee))throw new Error(`invalid anchor "${ee}"`);ae.call(this,`#${ee}`)}}}),f;function N(z,C,V){if(C!==void 0&&!t(z,C))throw D(V)}function D(z){return new Error(`reference "${z}" resolves to more than one schema`)}}return ie.getSchemaRefs=v,ie}var Mr;function Ue(){if(Mr)return ge;Mr=1,Object.defineProperty(ge,"__esModule",{value:!0}),ge.getData=ge.KeywordCxt=ge.validateFunctionCode=void 0;const e=xn(),t=Fe(),n=Sr(),i=Fe(),h=es(),s=ts(),p=rs(),u=J(),m=$e(),b=Le(),_=Z(),k=ze();function $(S){if(o(S)&&(P(S),y(S))){c(S);return}g(S,()=>(0,e.topBoolOrEmptySchema)(S))}ge.validateFunctionCode=$;function g({gen:S,validateName:I,schema:q,schemaEnv:A,opts:K},B){K.code.es5?S.func(I,(0,u._)`${m.default.data}, ${m.default.valCxt}`,A.$async,()=>{S.code((0,u._)`"use strict"; ${r(q,K)}`),w(S,K),S.code(B)}):S.func(I,(0,u._)`${m.default.data}, ${v(K)}`,A.$async,()=>S.code(r(q,K)).code(B))}function v(S){return(0,u._)`{${m.default.instancePath}="", ${m.default.parentData}, ${m.default.parentDataProperty}, ${m.default.rootData}=${m.default.data}${S.dynamicRef?(0,u._)`, ${m.default.dynamicAnchors}={}`:u.nil}}={}`}function w(S,I){S.if(m.default.valCxt,()=>{S.var(m.default.instancePath,(0,u._)`${m.default.valCxt}.${m.default.instancePath}`),S.var(m.default.parentData,(0,u._)`${m.default.valCxt}.${m.default.parentData}`),S.var(m.default.parentDataProperty,(0,u._)`${m.default.valCxt}.${m.default.parentDataProperty}`),S.var(m.default.rootData,(0,u._)`${m.default.valCxt}.${m.default.rootData}`),I.dynamicRef&&S.var(m.default.dynamicAnchors,(0,u._)`${m.default.valCxt}.${m.default.dynamicAnchors}`)},()=>{S.var(m.default.instancePath,(0,u._)`""`),S.var(m.default.parentData,(0,u._)`undefined`),S.var(m.default.parentDataProperty,(0,u._)`undefined`),S.var(m.default.rootData,m.default.data),I.dynamicRef&&S.var(m.default.dynamicAnchors,(0,u._)`{}`)})}function c(S){const{schema:I,opts:q,gen:A}=S;g(S,()=>{q.$comment&&I.$comment&&F(S),z(S),A.let(m.default.vErrors,null),A.let(m.default.errors,0),q.unevaluated&&d(S),N(S),L(S)})}function d(S){const{gen:I,validateName:q}=S;S.evaluated=I.const("evaluated",(0,u._)`${q}.evaluated`),I.if((0,u._)`${S.evaluated}.dynamicProps`,()=>I.assign((0,u._)`${S.evaluated}.props`,(0,u._)`undefined`)),I.if((0,u._)`${S.evaluated}.dynamicItems`,()=>I.assign((0,u._)`${S.evaluated}.items`,(0,u._)`undefined`))}function r(S,I){const q=typeof S=="object"&&S[I.schemaId];return q&&(I.code.source||I.code.process)?(0,u._)`/*# sourceURL=${q} */`:u.nil}function a(S,I){if(o(S)&&(P(S),y(S))){f(S,I);return}(0,e.boolOrEmptySchema)(S,I)}function y({schema:S,self:I}){if(typeof S=="boolean")return!S;for(const q in S)if(I.RULES.all[q])return!0;return!1}function o(S){return typeof S.schema!="boolean"}function f(S,I){const{schema:q,gen:A,opts:K}=S;K.$comment&&q.$comment&&F(S),C(S),V(S);const B=A.const("_errs",m.default.errors);N(S,B),A.var(I,(0,u._)`${B} === ${m.default.errors}`)}function P(S){(0,_.checkUnknownRules)(S),D(S)}function N(S,I){if(S.opts.jtd)return ae(S,[],!1,I);const q=(0,t.getSchemaTypes)(S.schema),A=(0,t.coerceAndCheckDataType)(S,q);ae(S,q,!A,I)}function D(S){const{schema:I,errSchemaPath:q,opts:A,self:K}=S;I.$ref&&A.ignoreKeywordsWithRef&&(0,_.schemaHasRulesButRef)(I,K.RULES)&&K.logger.warn(`$ref: keywords ignored in schema at path "${q}"`)}function z(S){const{schema:I,opts:q}=S;I.default!==void 0&&q.useDefaults&&q.strictSchema&&(0,_.checkStrictMode)(S,"default is ignored in the schema root")}function C(S){const I=S.schema[S.opts.schemaId];I&&(S.baseId=(0,b.resolveUrl)(S.opts.uriResolver,S.baseId,I))}function V(S){if(S.schema.$async&&!S.schemaEnv.$async)throw new Error("async schema in sync schema")}function F({gen:S,schemaEnv:I,schema:q,errSchemaPath:A,opts:K}){const B=q.$comment;if(K.$comment===!0)S.code((0,u._)`${m.default.self}.logger.log(${B})`);else if(typeof K.$comment=="function"){const ne=(0,u.str)`${A}/$comment`,ye=S.scopeValue("root",{ref:I.root});S.code((0,u._)`${m.default.self}.opts.$comment(${B}, ${ne}, ${ye}.schema)`)}}function L(S){const{gen:I,schemaEnv:q,validateName:A,ValidationError:K,opts:B}=S;q.$async?I.if((0,u._)`${m.default.errors} === 0`,()=>I.return(m.default.data),()=>I.throw((0,u._)`new ${K}(${m.default.vErrors})`)):(I.assign((0,u._)`${A}.errors`,m.default.vErrors),B.unevaluated&&X(S),I.return((0,u._)`${m.default.errors} === 0`))}function X({gen:S,evaluated:I,props:q,items:A}){q instanceof u.Name&&S.assign((0,u._)`${I}.props`,q),A instanceof u.Name&&S.assign((0,u._)`${I}.items`,A)}function ae(S,I,q,A){const{gen:K,schema:B,data:ne,allErrors:ye,opts:de,self:ue}=S,{RULES:se}=ue;if(B.$ref&&(de.ignoreKeywordsWithRef||!(0,_.schemaHasRulesButRef)(B,se))){K.block(()=>U(S,"$ref",se.all.$ref.definition));return}de.jtd||ee(S,I),K.block(()=>{for(const fe of se.rules)Re(fe);Re(se.post)});function Re(fe){(0,n.shouldUseGroup)(B,fe)&&(fe.type?(K.if((0,i.checkDataType)(fe.type,ne,de.strictNumbers)),ce(S,fe),I.length===1&&I[0]===fe.type&&q&&(K.else(),(0,i.reportTypeError)(S)),K.endIf()):ce(S,fe),ye||K.if((0,u._)`${m.default.errors} === ${A||0}`))}}function ce(S,I){const{gen:q,schema:A,opts:{useDefaults:K}}=S;K&&(0,h.assignDefaults)(S,I.type),q.block(()=>{for(const B of I.rules)(0,n.shouldUseRule)(A,B)&&U(S,B.keyword,B.definition,I.type)})}function ee(S,I){S.schemaEnv.meta||!S.opts.strictTypes||(he(S,I),S.opts.allowUnionTypes||M(S,I),j(S,S.dataTypes))}function he(S,I){if(I.length){if(!S.dataTypes.length){S.dataTypes=I;return}I.forEach(q=>{R(S.dataTypes,q)||E(S,`type "${q}" not allowed by context "${S.dataTypes.join(",")}"`)}),l(S,I)}}function M(S,I){I.length>1&&!(I.length===2&&I.includes("null"))&&E(S,"use allowUnionTypes to allow union type keyword")}function j(S,I){const q=S.self.RULES.all;for(const A in q){const K=q[A];if(typeof K=="object"&&(0,n.shouldUseRule)(S.schema,K)){const{type:B}=K.definition;B.length&&!B.some(ne=>T(I,ne))&&E(S,`missing type "${B.join(",")}" for keyword "${A}"`)}}}function T(S,I){return S.includes(I)||I==="number"&&S.includes("integer")}function R(S,I){return S.includes(I)||I==="integer"&&S.includes("number")}function l(S,I){const q=[];for(const A of S.dataTypes)R(I,A)?q.push(A):I.includes("integer")&&A==="number"&&q.push("integer");S.dataTypes=q}function E(S,I){const q=S.schemaEnv.baseId+S.errSchemaPath;I+=` at "${q}" (strictTypes)`,(0,_.checkStrictMode)(S,I,S.opts.strictTypes)}class O{constructor(I,q,A){if((0,s.validateKeywordUsage)(I,q,A),this.gen=I.gen,this.allErrors=I.allErrors,this.keyword=A,this.data=I.data,this.schema=I.schema[A],this.$data=q.$data&&I.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,_.schemaRefOrVal)(I,this.schema,A,this.$data),this.schemaType=q.schemaType,this.parentSchema=I.schema,this.params={},this.it=I,this.def=q,this.$data)this.schemaCode=I.gen.const("vSchema",Y(this.$data,I));else if(this.schemaCode=this.schemaValue,!(0,s.validSchemaType)(this.schema,q.schemaType,q.allowUndefined))throw new Error(`${A} value must be ${JSON.stringify(q.schemaType)}`);("code"in q?q.trackErrors:q.errors!==!1)&&(this.errsCount=I.gen.const("_errs",m.default.errors))}result(I,q,A){this.failResult((0,u.not)(I),q,A)}failResult(I,q,A){this.gen.if(I),A?A():this.error(),q?(this.gen.else(),q(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(I,q){this.failResult((0,u.not)(I),void 0,q)}fail(I){if(I===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(I),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(I){if(!this.$data)return this.fail(I);const{schemaCode:q}=this;this.fail((0,u._)`${q} !== undefined && (${(0,u.or)(this.invalid$data(),I)})`)}error(I,q,A){if(q){this.setParams(q),this._error(I,A),this.setParams({});return}this._error(I,A)}_error(I,q){(I?k.reportExtraError:k.reportError)(this,this.def.error,q)}$dataError(){(0,k.reportError)(this,this.def.$dataError||k.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,k.resetErrorsCount)(this.gen,this.errsCount)}ok(I){this.allErrors||this.gen.if(I)}setParams(I,q){q?Object.assign(this.params,I):this.params=I}block$data(I,q,A=u.nil){this.gen.block(()=>{this.check$data(I,A),q()})}check$data(I=u.nil,q=u.nil){if(!this.$data)return;const{gen:A,schemaCode:K,schemaType:B,def:ne}=this;A.if((0,u.or)((0,u._)`${K} === undefined`,q)),I!==u.nil&&A.assign(I,!0),(B.length||ne.validateSchema)&&(A.elseIf(this.invalid$data()),this.$dataError(),I!==u.nil&&A.assign(I,!1)),A.else()}invalid$data(){const{gen:I,schemaCode:q,schemaType:A,def:K,it:B}=this;return(0,u.or)(ne(),ye());function ne(){if(A.length){if(!(q instanceof u.Name))throw new Error("ajv implementation error");const de=Array.isArray(A)?A:[A];return(0,u._)`${(0,i.checkDataTypes)(de,q,B.opts.strictNumbers,i.DataType.Wrong)}`}return u.nil}function ye(){if(K.validateSchema){const de=I.scopeValue("validate$data",{ref:K.validateSchema});return(0,u._)`!${de}(${q})`}return u.nil}}subschema(I,q){const A=(0,p.getSubschema)(this.it,I);(0,p.extendSubschemaData)(A,this.it,I),(0,p.extendSubschemaMode)(A,I);const K={...this.it,...A,items:void 0,props:void 0};return a(K,q),K}mergeEvaluated(I,q){const{it:A,gen:K}=this;A.opts.unevaluated&&(A.props!==!0&&I.props!==void 0&&(A.props=_.mergeEvaluated.props(K,I.props,A.props,q)),A.items!==!0&&I.items!==void 0&&(A.items=_.mergeEvaluated.items(K,I.items,A.items,q)))}mergeValidEvaluated(I,q){const{it:A,gen:K}=this;if(A.opts.unevaluated&&(A.props!==!0||A.items!==!0))return K.if(q,()=>this.mergeEvaluated(I,u.Name)),!0}}ge.KeywordCxt=O;function U(S,I,q,A){const K=new O(S,q,I);"code"in q?q.code(K,A):K.$data&&q.validate?(0,s.funcKeywordCode)(K,q):"macro"in q?(0,s.macroKeywordCode)(K,q):(q.compile||q.validate)&&(0,s.funcKeywordCode)(K,q)}const H=/^\/(?:[^~]|~0|~1)*$/,Q=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Y(S,{dataLevel:I,dataNames:q,dataPathArr:A}){let K,B;if(S==="")return m.default.rootData;if(S[0]==="/"){if(!H.test(S))throw new Error(`Invalid JSON-pointer: ${S}`);K=S,B=m.default.rootData}else{const ue=Q.exec(S);if(!ue)throw new Error(`Invalid JSON-pointer: ${S}`);const se=+ue[1];if(K=ue[2],K==="#"){if(se>=I)throw new Error(de("property/index",se));return A[I-se]}if(se>I)throw new Error(de("data",se));if(B=q[I-se],!K)return B}let ne=B;const ye=K.split("/");for(const ue of ye)ue&&(B=(0,u._)`${B}${(0,u.getProperty)((0,_.unescapeJsonPointer)(ue))}`,ne=(0,u._)`${ne} && ${B}`);return ne;function de(ue,se){return`Cannot access ${ue} ${se} levels up, current level is ${I}`}}return ge.getData=Y,ge}var Ke={},Ar;function nr(){if(Ar)return Ke;Ar=1,Object.defineProperty(Ke,"__esModule",{value:!0});class e extends Error{constructor(n){super("validation failed"),this.errors=n,this.ajv=this.validation=!0}}return Ke.default=e,Ke}var He={},Vr;function Ge(){if(Vr)return He;Vr=1,Object.defineProperty(He,"__esModule",{value:!0});const e=Le();class t extends Error{constructor(i,h,s,p){super(p||`can't resolve reference ${s} from id ${h}`),this.missingRef=(0,e.resolveUrl)(i,h,s),this.missingSchema=(0,e.normalizeId)((0,e.getFullPath)(i,this.missingRef))}}return He.default=t,He}var le={},zr;function sr(){if(zr)return le;zr=1,Object.defineProperty(le,"__esModule",{value:!0}),le.resolveSchema=le.getCompilingSchema=le.resolveRef=le.compileSchema=le.SchemaEnv=void 0;const e=J(),t=nr(),n=$e(),i=Le(),h=Z(),s=Ue();class p{constructor(d){var r;this.refs={},this.dynamicAnchors={};let a;typeof d.schema=="object"&&(a=d.schema),this.schema=d.schema,this.schemaId=d.schemaId,this.root=d.root||this,this.baseId=(r=d.baseId)!==null&&r!==void 0?r:(0,i.normalizeId)(a?.[d.schemaId||"$id"]),this.schemaPath=d.schemaPath,this.localRefs=d.localRefs,this.meta=d.meta,this.$async=a?.$async,this.refs={}}}le.SchemaEnv=p;function u(c){const d=_.call(this,c);if(d)return d;const r=(0,i.getFullPath)(this.opts.uriResolver,c.root.baseId),{es5:a,lines:y}=this.opts.code,{ownProperties:o}=this.opts,f=new e.CodeGen(this.scope,{es5:a,lines:y,ownProperties:o});let P;c.$async&&(P=f.scopeValue("Error",{ref:t.default,code:(0,e._)`require("ajv/dist/runtime/validation_error").default`}));const N=f.scopeName("validate");c.validateName=N;const D={gen:f,allErrors:this.opts.allErrors,data:n.default.data,parentData:n.default.parentData,parentDataProperty:n.default.parentDataProperty,dataNames:[n.default.data],dataPathArr:[e.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:f.scopeValue("schema",this.opts.code.source===!0?{ref:c.schema,code:(0,e.stringify)(c.schema)}:{ref:c.schema}),validateName:N,ValidationError:P,schema:c.schema,schemaEnv:c,rootId:r,baseId:c.baseId||r,schemaPath:e.nil,errSchemaPath:c.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,e._)`""`,opts:this.opts,self:this};let z;try{this._compilations.add(c),(0,s.validateFunctionCode)(D),f.optimize(this.opts.code.optimize);const C=f.toString();z=`${f.scopeRefs(n.default.scope)}return ${C}`,this.opts.code.process&&(z=this.opts.code.process(z,c));const F=new Function(`${n.default.self}`,`${n.default.scope}`,z)(this,this.scope.get());if(this.scope.value(N,{ref:F}),F.errors=null,F.schema=c.schema,F.schemaEnv=c,c.$async&&(F.$async=!0),this.opts.code.source===!0&&(F.source={validateName:N,validateCode:C,scopeValues:f._values}),this.opts.unevaluated){const{props:L,items:X}=D;F.evaluated={props:L instanceof e.Name?void 0:L,items:X instanceof e.Name?void 0:X,dynamicProps:L instanceof e.Name,dynamicItems:X instanceof e.Name},F.source&&(F.source.evaluated=(0,e.stringify)(F.evaluated))}return c.validate=F,c}catch(C){throw delete c.validate,delete c.validateName,z&&this.logger.error("Error compiling schema, function code:",z),C}finally{this._compilations.delete(c)}}le.compileSchema=u;function m(c,d,r){var a;r=(0,i.resolveUrl)(this.opts.uriResolver,d,r);const y=c.refs[r];if(y)return y;let o=$.call(this,c,r);if(o===void 0){const f=(a=c.localRefs)===null||a===void 0?void 0:a[r],{schemaId:P}=this.opts;f&&(o=new p({schema:f,schemaId:P,root:c,baseId:d}))}if(o!==void 0)return c.refs[r]=b.call(this,o)}le.resolveRef=m;function b(c){return(0,i.inlineRef)(c.schema,this.opts.inlineRefs)?c.schema:c.validate?c:u.call(this,c)}function _(c){for(const d of this._compilations)if(k(d,c))return d}le.getCompilingSchema=_;function k(c,d){return c.schema===d.schema&&c.root===d.root&&c.baseId===d.baseId}function $(c,d){let r;for(;typeof(r=this.refs[d])=="string";)d=r;return r||this.schemas[d]||g.call(this,c,d)}function g(c,d){const r=this.opts.uriResolver.parse(d),a=(0,i._getFullPath)(this.opts.uriResolver,r);let y=(0,i.getFullPath)(this.opts.uriResolver,c.baseId,void 0);if(Object.keys(c.schema).length>0&&a===y)return w.call(this,r,c);const o=(0,i.normalizeId)(a),f=this.refs[o]||this.schemas[o];if(typeof f=="string"){const P=g.call(this,c,f);return typeof P?.schema!="object"?void 0:w.call(this,r,P)}if(typeof f?.schema=="object"){if(f.validate||u.call(this,f),o===(0,i.normalizeId)(d)){const{schema:P}=f,{schemaId:N}=this.opts,D=P[N];return D&&(y=(0,i.resolveUrl)(this.opts.uriResolver,y,D)),new p({schema:P,schemaId:N,root:c,baseId:y})}return w.call(this,r,f)}}le.resolveSchema=g;const v=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function w(c,{baseId:d,schema:r,root:a}){var y;if(((y=c.fragment)===null||y===void 0?void 0:y[0])!=="/")return;for(const P of c.fragment.slice(1).split("/")){if(typeof r=="boolean")return;const N=r[(0,h.unescapeFragment)(P)];if(N===void 0)return;r=N;const D=typeof r=="object"&&r[this.opts.schemaId];!v.has(P)&&D&&(d=(0,i.resolveUrl)(this.opts.uriResolver,d,D))}let o;if(typeof r!="boolean"&&r.$ref&&!(0,h.schemaHasRulesButRef)(r,this.RULES)){const P=(0,i.resolveUrl)(this.opts.uriResolver,d,r.$ref);o=g.call(this,a,P)}const{schemaId:f}=this.opts;if(o=o||new p({schema:r,schemaId:f,root:a,baseId:d}),o.schema!==o.root.schema)return o}return le}const ss={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1};var Je={},Oe={exports:{}},ir,Fr;function Lr(){if(Fr)return ir;Fr=1;const e=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),t=RegExp.prototype.test.bind(/^(?:(?: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 n($){let g="",v=0,w=0;for(w=0;w<$.length;w++)if(v=$[w].charCodeAt(0),v!==48){if(!(v>=48&&v<=57||v>=65&&v<=70||v>=97&&v<=102))return"";g+=$[w];break}for(w+=1;w<$.length;w++){if(v=$[w].charCodeAt(0),!(v>=48&&v<=57||v>=65&&v<=70||v>=97&&v<=102))return"";g+=$[w]}return g}const i=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function h($){return $.length=0,!0}function s($,g,v){if($.length){const w=n($);if(w!=="")g.push(w);else return v.error=!0,!1;$.length=0}return!0}function p($){let g=0;const v={error:!1,address:"",zone:""},w=[],c=[];let d=!1,r=!1,a=s;for(let y=0;y<$.length;y++){const o=$[y];if(!(o==="["||o==="]"))if(o===":"){if(d===!0&&(r=!0),!a(c,w,v))break;if(++g>7){v.error=!0;break}y>0&&$[y-1]===":"&&(d=!0),w.push(":");continue}else if(o==="%"){if(!a(c,w,v))break;a=h}else{c.push(o);continue}}return c.length&&(a===h?v.zone=c.join(""):r?w.push(c.join("")):w.push(n(c))),v.address=w.join(""),v}function u($){if(m($,":")<2)return{host:$,isIPV6:!1};const g=p($);if(g.error)return{host:$,isIPV6:!1};{let v=g.address,w=g.address;return g.zone&&(v+="%"+g.zone,w+="%25"+g.zone),{host:v,isIPV6:!0,escapedHost:w}}}function m($,g){let v=0;for(let w=0;w<$.length;w++)$[w]===g&&v++;return v}function b($){let g=$;const v=[];let w=-1,c=0;for(;c=g.length;){if(c===1){if(g===".")break;if(g==="/"){v.push("/");break}else{v.push(g);break}}else if(c===2){if(g[0]==="."){if(g[1]===".")break;if(g[1]==="/"){g=g.slice(2);continue}}else if(g[0]==="/"&&(g[1]==="."||g[1]==="/")){v.push("/");break}}else if(c===3&&g==="/.."){v.length!==0&&v.pop(),v.push("/");break}if(g[0]==="."){if(g[1]==="."){if(g[2]==="/"){g=g.slice(3);continue}}else if(g[1]==="/"){g=g.slice(2);continue}}else if(g[0]==="/"&&g[1]==="."){if(g[2]==="/"){g=g.slice(2);continue}else if(g[2]==="."&&g[3]==="/"){g=g.slice(3),v.length!==0&&v.pop();continue}}if((w=g.indexOf("/",1))===-1){v.push(g);break}else v.push(g.slice(0,w)),g=g.slice(w)}return v.join("")}function _($,g){const v=g!==!0?escape:unescape;return $.scheme!==void 0&&($.scheme=v($.scheme)),$.userinfo!==void 0&&($.userinfo=v($.userinfo)),$.host!==void 0&&($.host=v($.host)),$.path!==void 0&&($.path=v($.path)),$.query!==void 0&&($.query=v($.query)),$.fragment!==void 0&&($.fragment=v($.fragment)),$}function k($){const g=[];if($.userinfo!==void 0&&(g.push($.userinfo),g.push("@")),$.host!==void 0){let v=unescape($.host);if(!t(v)){const w=u(v);w.isIPV6===!0?v=`[${w.escapedHost}]`:v=$.host}g.push(v)}return(typeof $.port=="number"||typeof $.port=="string")&&(g.push(":"),g.push(String($.port))),g.length?g.join(""):void 0}return ir={nonSimpleDomain:i,recomposeAuthority:k,normalizeComponentEncoding:_,removeDotSegments:b,isIPv4:t,isUUID:e,normalizeIPv6:u,stringArrayToHexStripped:n},ir}var or,Ur;function is(){if(Ur)return or;Ur=1;const{isUUID:e}=Lr(),t=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,n=["http","https","ws","wss","urn","urn:uuid"];function i(o){return n.indexOf(o)!==-1}function h(o){return o.secure===!0?!0:o.secure===!1?!1:o.scheme?o.scheme.length===3&&(o.scheme[0]==="w"||o.scheme[0]==="W")&&(o.scheme[1]==="s"||o.scheme[1]==="S")&&(o.scheme[2]==="s"||o.scheme[2]==="S"):!1}function s(o){return o.host||(o.error=o.error||"HTTP URIs must have a host."),o}function p(o){const f=String(o.scheme).toLowerCase()==="https";return(o.port===(f?443:80)||o.port==="")&&(o.port=void 0),o.path||(o.path="/"),o}function u(o){return o.secure=h(o),o.resourceName=(o.path||"/")+(o.query?"?"+o.query:""),o.path=void 0,o.query=void 0,o}function m(o){if((o.port===(h(o)?443:80)||o.port==="")&&(o.port=void 0),typeof o.secure=="boolean"&&(o.scheme=o.secure?"wss":"ws",o.secure=void 0),o.resourceName){const[f,P]=o.resourceName.split("?");o.path=f&&f!=="/"?f:void 0,o.query=P,o.resourceName=void 0}return o.fragment=void 0,o}function b(o,f){if(!o.path)return o.error="URN can not be parsed",o;const P=o.path.match(t);if(P){const N=f.scheme||o.scheme||"urn";o.nid=P[1].toLowerCase(),o.nss=P[2];const D=`${N}:${f.nid||o.nid}`,z=y(D);o.path=void 0,z&&(o=z.parse(o,f))}else o.error=o.error||"URN can not be parsed.";return o}function _(o,f){if(o.nid===void 0)throw new Error("URN without nid cannot be serialized");const P=f.scheme||o.scheme||"urn",N=o.nid.toLowerCase(),D=`${P}:${f.nid||N}`,z=y(D);z&&(o=z.serialize(o,f));const C=o,V=o.nss;return C.path=`${N||f.nid}:${V}`,f.skipEscape=!0,C}function k(o,f){const P=o;return P.uuid=P.nss,P.nss=void 0,!f.tolerant&&(!P.uuid||!e(P.uuid))&&(P.error=P.error||"UUID is not valid."),P}function $(o){const f=o;return f.nss=(o.uuid||"").toLowerCase(),f}const g={scheme:"http",domainHost:!0,parse:s,serialize:p},v={scheme:"https",domainHost:g.domainHost,parse:s,serialize:p},w={scheme:"ws",domainHost:!0,parse:u,serialize:m},c={scheme:"wss",domainHost:w.domainHost,parse:w.parse,serialize:w.serialize},a={http:g,https:v,ws:w,wss:c,urn:{scheme:"urn",parse:b,serialize:_,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:k,serialize:$,skipNormalize:!0}};Object.setPrototypeOf(a,null);function y(o){return o&&(a[o]||a[o.toLowerCase()])||void 0}return or={wsIsSecure:h,SCHEMES:a,isValidSchemeName:i,getSchemeHandler:y},or}var Kr;function os(){if(Kr)return Oe.exports;Kr=1;const{normalizeIPv6:e,removeDotSegments:t,recomposeAuthority:n,normalizeComponentEncoding:i,isIPv4:h,nonSimpleDomain:s}=Lr(),{SCHEMES:p,getSchemeHandler:u}=is();function m(c,d){return typeof c=="string"?c=$(v(c,d),d):typeof c=="object"&&(c=v($(c,d),d)),c}function b(c,d,r){const a=r?Object.assign({scheme:"null"},r):{scheme:"null"},y=_(v(c,a),v(d,a),a,!0);return a.skipEscape=!0,$(y,a)}function _(c,d,r,a){const y={};return a||(c=v($(c,r),r),d=v($(d,r),r)),r=r||{},!r.tolerant&&d.scheme?(y.scheme=d.scheme,y.userinfo=d.userinfo,y.host=d.host,y.port=d.port,y.path=t(d.path||""),y.query=d.query):(d.userinfo!==void 0||d.host!==void 0||d.port!==void 0?(y.userinfo=d.userinfo,y.host=d.host,y.port=d.port,y.path=t(d.path||""),y.query=d.query):(d.path?(d.path[0]==="/"?y.path=t(d.path):((c.userinfo!==void 0||c.host!==void 0||c.port!==void 0)&&!c.path?y.path="/"+d.path:c.path?y.path=c.path.slice(0,c.path.lastIndexOf("/")+1)+d.path:y.path=d.path,y.path=t(y.path)),y.query=d.query):(y.path=c.path,d.query!==void 0?y.query=d.query:y.query=c.query),y.userinfo=c.userinfo,y.host=c.host,y.port=c.port),y.scheme=c.scheme),y.fragment=d.fragment,y}function k(c,d,r){return typeof c=="string"?(c=unescape(c),c=$(i(v(c,r),!0),{...r,skipEscape:!0})):typeof c=="object"&&(c=$(i(c,!0),{...r,skipEscape:!0})),typeof d=="string"?(d=unescape(d),d=$(i(v(d,r),!0),{...r,skipEscape:!0})):typeof d=="object"&&(d=$(i(d,!0),{...r,skipEscape:!0})),c.toLowerCase()===d.toLowerCase()}function $(c,d){const r={host:c.host,scheme:c.scheme,userinfo:c.userinfo,port:c.port,path:c.path,query:c.query,nid:c.nid,nss:c.nss,uuid:c.uuid,fragment:c.fragment,reference:c.reference,resourceName:c.resourceName,secure:c.secure,error:""},a=Object.assign({},d),y=[],o=u(a.scheme||r.scheme);o&&o.serialize&&o.serialize(r,a),r.path!==void 0&&(a.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),a.reference!=="suffix"&&r.scheme&&y.push(r.scheme,":");const f=n(r);if(f!==void 0&&(a.reference!=="suffix"&&y.push("//"),y.push(f),r.path&&r.path[0]!=="/"&&y.push("/")),r.path!==void 0){let P=r.path;!a.absolutePath&&(!o||!o.absolutePath)&&(P=t(P)),f===void 0&&P[0]==="/"&&P[1]==="/"&&(P="/%2F"+P.slice(2)),y.push(P)}return r.query!==void 0&&y.push("?",r.query),r.fragment!==void 0&&y.push("#",r.fragment),y.join("")}const g=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function v(c,d){const r=Object.assign({},d),a={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let y=!1;r.reference==="suffix"&&(r.scheme?c=r.scheme+":"+c:c="//"+c);const o=c.match(g);if(o){if(a.scheme=o[1],a.userinfo=o[3],a.host=o[4],a.port=parseInt(o[5],10),a.path=o[6]||"",a.query=o[7],a.fragment=o[8],isNaN(a.port)&&(a.port=o[5]),a.host)if(h(a.host)===!1){const N=e(a.host);a.host=N.host.toLowerCase(),y=N.isIPV6}else y=!0;a.scheme===void 0&&a.userinfo===void 0&&a.host===void 0&&a.port===void 0&&a.query===void 0&&!a.path?a.reference="same-document":a.scheme===void 0?a.reference="relative":a.fragment===void 0?a.reference="absolute":a.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==a.reference&&(a.error=a.error||"URI is not a "+r.reference+" reference.");const f=u(r.scheme||a.scheme);if(!r.unicodeSupport&&(!f||!f.unicodeSupport)&&a.host&&(r.domainHost||f&&f.domainHost)&&y===!1&&s(a.host))try{a.host=URL.domainToASCII(a.host.toLowerCase())}catch(P){a.error=a.error||"Host's domain name can not be converted to ASCII: "+P}(!f||f&&!f.skipNormalize)&&(c.indexOf("%")!==-1&&(a.scheme!==void 0&&(a.scheme=unescape(a.scheme)),a.host!==void 0&&(a.host=unescape(a.host))),a.path&&(a.path=escape(unescape(a.path))),a.fragment&&(a.fragment=encodeURI(decodeURIComponent(a.fragment)))),f&&f.parse&&f.parse(a,r)}else a.error=a.error||"URI can not be parsed.";return a}const w={SCHEMES:p,normalize:m,resolve:b,resolveComponent:_,equal:k,serialize:$,parse:v};return Oe.exports=w,Oe.exports.default=w,Oe.exports.fastUri=w,Oe.exports}var Hr;function as(){if(Hr)return Je;Hr=1,Object.defineProperty(Je,"__esModule",{value:!0});const e=os();return e.code='require("ajv/dist/runtime/uri").default',Je.default=e,Je}var Gr;function cs(){return Gr||(Gr=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=Ue();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var n=J();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return n.CodeGen}});const i=nr(),h=Ge(),s=Er(),p=sr(),u=J(),m=Le(),b=Fe(),_=Z(),k=ss,$=as(),g=(M,j)=>new RegExp(M,j);g.code="new RegExp";const v=["removeAdditional","useDefaults","coerceTypes"],w=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),c={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},d={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},r=200;function a(M){var j,T,R,l,E,O,U,H,Q,Y,S,I,q,A,K,B,ne,ye,de,ue,se,Re,fe,fr,pr;const De=M.strict,mr=(j=M.code)===null||j===void 0?void 0:j.optimize,Qn=mr===!0||mr===void 0?1:mr||0,Xn=(R=(T=M.code)===null||T===void 0?void 0:T.regExp)!==null&&R!==void 0?R:g,_i=(l=M.uriResolver)!==null&&l!==void 0?l:$.default;return{strictSchema:(O=(E=M.strictSchema)!==null&&E!==void 0?E:De)!==null&&O!==void 0?O:!0,strictNumbers:(H=(U=M.strictNumbers)!==null&&U!==void 0?U:De)!==null&&H!==void 0?H:!0,strictTypes:(Y=(Q=M.strictTypes)!==null&&Q!==void 0?Q:De)!==null&&Y!==void 0?Y:"log",strictTuples:(I=(S=M.strictTuples)!==null&&S!==void 0?S:De)!==null&&I!==void 0?I:"log",strictRequired:(A=(q=M.strictRequired)!==null&&q!==void 0?q:De)!==null&&A!==void 0?A:!1,code:M.code?{...M.code,optimize:Qn,regExp:Xn}:{optimize:Qn,regExp:Xn},loopRequired:(K=M.loopRequired)!==null&&K!==void 0?K:r,loopEnum:(B=M.loopEnum)!==null&&B!==void 0?B:r,meta:(ne=M.meta)!==null&&ne!==void 0?ne:!0,messages:(ye=M.messages)!==null&&ye!==void 0?ye:!0,inlineRefs:(de=M.inlineRefs)!==null&&de!==void 0?de:!0,schemaId:(ue=M.schemaId)!==null&&ue!==void 0?ue:"$id",addUsedSchema:(se=M.addUsedSchema)!==null&&se!==void 0?se:!0,validateSchema:(Re=M.validateSchema)!==null&&Re!==void 0?Re:!0,validateFormats:(fe=M.validateFormats)!==null&&fe!==void 0?fe:!0,unicodeRegExp:(fr=M.unicodeRegExp)!==null&&fr!==void 0?fr:!0,int32range:(pr=M.int32range)!==null&&pr!==void 0?pr:!0,uriResolver:_i}}class y{constructor(j={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,j=this.opts={...j,...a(j)};const{es5:T,lines:R}=this.opts.code;this.scope=new u.ValueScope({scope:{},prefixes:w,es5:T,lines:R}),this.logger=V(j.logger);const l=j.validateFormats;j.validateFormats=!1,this.RULES=(0,s.getRules)(),o.call(this,c,j,"NOT SUPPORTED"),o.call(this,d,j,"DEPRECATED","warn"),this._metaOpts=z.call(this),j.formats&&N.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),j.keywords&&D.call(this,j.keywords),typeof j.meta=="object"&&this.addMetaSchema(j.meta),P.call(this),j.validateFormats=l}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:j,meta:T,schemaId:R}=this.opts;let l=k;R==="id"&&(l={...k},l.id=l.$id,delete l.$id),T&&j&&this.addMetaSchema(l,l[R],!1)}defaultMeta(){const{meta:j,schemaId:T}=this.opts;return this.opts.defaultMeta=typeof j=="object"?j[T]||j:void 0}validate(j,T){let R;if(typeof j=="string"){if(R=this.getSchema(j),!R)throw new Error(`no schema with key or ref "${j}"`)}else R=this.compile(j);const l=R(T);return"$async"in R||(this.errors=R.errors),l}compile(j,T){const R=this._addSchema(j,T);return R.validate||this._compileSchemaEnv(R)}compileAsync(j,T){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:R}=this.opts;return l.call(this,j,T);async function l(Y,S){await E.call(this,Y.$schema);const I=this._addSchema(Y,S);return I.validate||O.call(this,I)}async function E(Y){Y&&!this.getSchema(Y)&&await l.call(this,{$ref:Y},!0)}async function O(Y){try{return this._compileSchemaEnv(Y)}catch(S){if(!(S instanceof h.default))throw S;return U.call(this,S),await H.call(this,S.missingSchema),O.call(this,Y)}}function U({missingSchema:Y,missingRef:S}){if(this.refs[Y])throw new Error(`AnySchema ${Y} is loaded but ${S} cannot be resolved`)}async function H(Y){const S=await Q.call(this,Y);this.refs[Y]||await E.call(this,S.$schema),this.refs[Y]||this.addSchema(S,Y,T)}async function Q(Y){const S=this._loading[Y];if(S)return S;try{return await(this._loading[Y]=R(Y))}finally{delete this._loading[Y]}}}addSchema(j,T,R,l=this.opts.validateSchema){if(Array.isArray(j)){for(const O of j)this.addSchema(O,void 0,R,l);return this}let E;if(typeof j=="object"){const{schemaId:O}=this.opts;if(E=j[O],E!==void 0&&typeof E!="string")throw new Error(`schema ${O} must be string`)}return T=(0,m.normalizeId)(T||E),this._checkUnique(T),this.schemas[T]=this._addSchema(j,R,T,l,!0),this}addMetaSchema(j,T,R=this.opts.validateSchema){return this.addSchema(j,T,!0,R),this}validateSchema(j,T){if(typeof j=="boolean")return!0;let R;if(R=j.$schema,R!==void 0&&typeof R!="string")throw new Error("$schema must be a string");if(R=R||this.opts.defaultMeta||this.defaultMeta(),!R)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const l=this.validate(R,j);if(!l&&T){const E="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(E);else throw new Error(E)}return l}getSchema(j){let T;for(;typeof(T=f.call(this,j))=="string";)j=T;if(T===void 0){const{schemaId:R}=this.opts,l=new p.SchemaEnv({schema:{},schemaId:R});if(T=p.resolveSchema.call(this,l,j),!T)return;this.refs[j]=T}return T.validate||this._compileSchemaEnv(T)}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 T=f.call(this,j);return typeof T=="object"&&this._cache.delete(T.schema),delete this.schemas[j],delete this.refs[j],this}case"object":{const T=j;this._cache.delete(T);let R=j[this.opts.schemaId];return R&&(R=(0,m.normalizeId)(R),delete this.schemas[R],delete this.refs[R]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(j){for(const T of j)this.addKeyword(T);return this}addKeyword(j,T){let R;if(typeof j=="string")R=j,typeof T=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),T.keyword=R);else if(typeof j=="object"&&T===void 0){if(T=j,R=T.keyword,Array.isArray(R)&&!R.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(L.call(this,R,T),!T)return(0,_.eachItem)(R,E=>X.call(this,E)),this;ce.call(this,T);const l={...T,type:(0,b.getJSONTypes)(T.type),schemaType:(0,b.getJSONTypes)(T.schemaType)};return(0,_.eachItem)(R,l.type.length===0?E=>X.call(this,E,l):E=>l.type.forEach(O=>X.call(this,E,l,O))),this}getKeyword(j){const T=this.RULES.all[j];return typeof T=="object"?T.definition:!!T}removeKeyword(j){const{RULES:T}=this;delete T.keywords[j],delete T.all[j];for(const R of T.rules){const l=R.rules.findIndex(E=>E.keyword===j);l>=0&&R.rules.splice(l,1)}return this}addFormat(j,T){return typeof T=="string"&&(T=new RegExp(T)),this.formats[j]=T,this}errorsText(j=this.errors,{separator:T=", ",dataVar:R="data"}={}){return!j||j.length===0?"No errors":j.map(l=>`${R}${l.instancePath} ${l.message}`).reduce((l,E)=>l+T+E)}$dataMetaSchema(j,T){const R=this.RULES.all;j=JSON.parse(JSON.stringify(j));for(const l of T){const E=l.split("/").slice(1);let O=j;for(const U of E)O=O[U];for(const U in R){const H=R[U];if(typeof H!="object")continue;const{$data:Q}=H.definition,Y=O[U];Q&&Y&&(O[U]=he(Y))}}return j}_removeAllSchemas(j,T){for(const R in j){const l=j[R];(!T||T.test(R))&&(typeof l=="string"?delete j[R]:l&&!l.meta&&(this._cache.delete(l.schema),delete j[R]))}}_addSchema(j,T,R,l=this.opts.validateSchema,E=this.opts.addUsedSchema){let O;const{schemaId:U}=this.opts;if(typeof j=="object")O=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;R=(0,m.normalizeId)(O||R);const Q=m.getSchemaRefs.call(this,j,R);return H=new p.SchemaEnv({schema:j,schemaId:U,meta:T,baseId:R,localRefs:Q}),this._cache.set(H.schema,H),E&&!R.startsWith("#")&&(R&&this._checkUnique(R),this.refs[R]=H),l&&this.validateSchema(j,!0),H}_checkUnique(j){if(this.schemas[j]||this.refs[j])throw new Error(`schema with key or id "${j}" already exists`)}_compileSchemaEnv(j){if(j.meta?this._compileMetaSchema(j):p.compileSchema.call(this,j),!j.validate)throw new Error("ajv implementation error");return j.validate}_compileMetaSchema(j){const T=this.opts;this.opts=this._metaOpts;try{p.compileSchema.call(this,j)}finally{this.opts=T}}}y.ValidationError=i.default,y.MissingRefError=h.default,e.default=y;function o(M,j,T,R="error"){for(const l in M){const E=l;E in j&&this.logger[R](`${T}: option ${l}. ${M[E]}`)}}function f(M){return M=(0,m.normalizeId)(M),this.schemas[M]||this.refs[M]}function P(){const M=this.opts.schemas;if(M)if(Array.isArray(M))this.addSchema(M);else for(const j in M)this.addSchema(M[j],j)}function N(){for(const M in this.opts.formats){const j=this.opts.formats[M];j&&this.addFormat(M,j)}}function D(M){if(Array.isArray(M)){this.addVocabulary(M);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const j in M){const T=M[j];T.keyword||(T.keyword=j),this.addKeyword(T)}}function z(){const M={...this.opts};for(const j of v)delete M[j];return M}const C={log(){},warn(){},error(){}};function V(M){if(M===!1)return C;if(M===void 0)return console;if(M.log&&M.warn&&M.error)return M;throw new Error("logger must implement log, warn and error methods")}const F=/^[a-z_$][a-z0-9_$:-]*$/i;function L(M,j){const{RULES:T}=this;if((0,_.eachItem)(M,R=>{if(T.keywords[R])throw new Error(`Keyword ${R} is already defined`);if(!F.test(R))throw new Error(`Keyword ${R} has invalid name`)}),!!j&&j.$data&&!("code"in j||"validate"in j))throw new Error('$data keyword must have "code" or "validate" function')}function X(M,j,T){var R;const l=j?.post;if(T&&l)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:E}=this;let O=l?E.post:E.rules.find(({type:H})=>H===T);if(O||(O={type:T,rules:[]},E.rules.push(O)),E.keywords[M]=!0,!j)return;const U={keyword:M,definition:{...j,type:(0,b.getJSONTypes)(j.type),schemaType:(0,b.getJSONTypes)(j.schemaType)}};j.before?ae.call(this,O,U,j.before):O.rules.push(U),E.all[M]=U,(R=j.implements)===null||R===void 0||R.forEach(H=>this.addKeyword(H))}function ae(M,j,T){const R=M.rules.findIndex(l=>l.keyword===T);R>=0?M.rules.splice(R,0,j):(M.rules.push(j),this.logger.warn(`rule ${T} is not defined`))}function ce(M){let{metaSchema:j}=M;j!==void 0&&(M.$data&&this.opts.$data&&(j=he(j)),M.validateSchema=this.compile(j,!0))}const ee={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function he(M){return{anyOf:[M,ee]}}})(Zt)),Zt}var We={},Be={},Ye={},Jr;function ds(){if(Jr)return Ye;Jr=1,Object.defineProperty(Ye,"__esModule",{value:!0});const e={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};return Ye.default=e,Ye}var be={},Wr;function us(){if(Wr)return be;Wr=1,Object.defineProperty(be,"__esModule",{value:!0}),be.callRef=be.getValidate=void 0;const e=Ge(),t=me(),n=J(),i=$e(),h=sr(),s=Z(),p={keyword:"$ref",schemaType:"string",code(b){const{gen:_,schema:k,it:$}=b,{baseId:g,schemaEnv:v,validateName:w,opts:c,self:d}=$,{root:r}=v;if((k==="#"||k==="#/")&&g===r.baseId)return y();const a=h.resolveRef.call(d,r,g,k);if(a===void 0)throw new e.default($.opts.uriResolver,g,k);if(a instanceof h.SchemaEnv)return o(a);return f(a);function y(){if(v===r)return m(b,w,v,v.$async);const P=_.scopeValue("root",{ref:r});return m(b,(0,n._)`${P}.validate`,r,r.$async)}function o(P){const N=u(b,P);m(b,N,P,P.$async)}function f(P){const N=_.scopeValue("schema",c.code.source===!0?{ref:P,code:(0,n.stringify)(P)}:{ref:P}),D=_.name("valid"),z=b.subschema({schema:P,dataTypes:[],schemaPath:n.nil,topSchemaRef:N,errSchemaPath:k},D);b.mergeEvaluated(z),b.ok(D)}}};function u(b,_){const{gen:k}=b;return _.validate?k.scopeValue("validate",{ref:_.validate}):(0,n._)`${k.scopeValue("wrapper",{ref:_})}.validate`}be.getValidate=u;function m(b,_,k,$){const{gen:g,it:v}=b,{allErrors:w,schemaEnv:c,opts:d}=v,r=d.passContext?i.default.this:n.nil;$?a():y();function a(){if(!c.$async)throw new Error("async schema referenced by sync schema");const P=g.let("valid");g.try(()=>{g.code((0,n._)`await ${(0,t.callValidateCode)(b,_,r)}`),f(_),w||g.assign(P,!0)},N=>{g.if((0,n._)`!(${N} instanceof ${v.ValidationError})`,()=>g.throw(N)),o(N),w||g.assign(P,!1)}),b.ok(P)}function y(){b.result((0,t.callValidateCode)(b,_,r),()=>f(_),()=>o(_))}function o(P){const N=(0,n._)`${P}.errors`;g.assign(i.default.vErrors,(0,n._)`${i.default.vErrors} === null ? ${N} : ${i.default.vErrors}.concat(${N})`),g.assign(i.default.errors,(0,n._)`${i.default.vErrors}.length`)}function f(P){var N;if(!v.opts.unevaluated)return;const D=(N=k?.validate)===null||N===void 0?void 0:N.evaluated;if(v.props!==!0)if(D&&!D.dynamicProps)D.props!==void 0&&(v.props=s.mergeEvaluated.props(g,D.props,v.props));else{const z=g.var("props",(0,n._)`${P}.evaluated.props`);v.props=s.mergeEvaluated.props(g,z,v.props,n.Name)}if(v.items!==!0)if(D&&!D.dynamicItems)D.items!==void 0&&(v.items=s.mergeEvaluated.items(g,D.items,v.items));else{const z=g.var("items",(0,n._)`${P}.evaluated.items`);v.items=s.mergeEvaluated.items(g,z,v.items,n.Name)}}}return be.callRef=m,be.default=p,be}var Br;function ls(){if(Br)return Be;Br=1,Object.defineProperty(Be,"__esModule",{value:!0});const e=ds(),t=us(),n=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,t.default];return Be.default=n,Be}var Ze={},Qe={},Yr;function fs(){if(Yr)return Qe;Yr=1,Object.defineProperty(Qe,"__esModule",{value:!0});const e=J(),t=e.operators,n={maximum:{okStr:"<=",ok:t.LTE,fail:t.GT},minimum:{okStr:">=",ok:t.GTE,fail:t.LT},exclusiveMaximum:{okStr:"<",ok:t.LT,fail:t.GTE},exclusiveMinimum:{okStr:">",ok:t.GT,fail:t.LTE}},i={message:({keyword:s,schemaCode:p})=>(0,e.str)`must be ${n[s].okStr} ${p}`,params:({keyword:s,schemaCode:p})=>(0,e._)`{comparison: ${n[s].okStr}, limit: ${p}}`},h={keyword:Object.keys(n),type:"number",schemaType:"number",$data:!0,error:i,code(s){const{keyword:p,data:u,schemaCode:m}=s;s.fail$data((0,e._)`${u} ${n[p].fail} ${m} || isNaN(${u})`)}};return Qe.default=h,Qe}var Xe={},Zr;function ps(){if(Zr)return Xe;Zr=1,Object.defineProperty(Xe,"__esModule",{value:!0});const e=J(),n={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:i})=>(0,e.str)`must be multiple of ${i}`,params:({schemaCode:i})=>(0,e._)`{multipleOf: ${i}}`},code(i){const{gen:h,data:s,schemaCode:p,it:u}=i,m=u.opts.multipleOfPrecision,b=h.let("res"),_=m?(0,e._)`Math.abs(Math.round(${b}) - ${b}) > 1e-${m}`:(0,e._)`${b} !== parseInt(${b})`;i.fail$data((0,e._)`(${p} === 0 || (${b} = ${s}/${p}, ${_}))`)}};return Xe.default=n,Xe}var xe={},et={},Qr;function ms(){if(Qr)return et;Qr=1,Object.defineProperty(et,"__esModule",{value:!0});function e(t){const n=t.length;let i=0,h=0,s;for(;h<n;)i++,s=t.charCodeAt(h++),s>=55296&&s<=56319&&h<n&&(s=t.charCodeAt(h),(s&64512)===56320&&h++);return i}return et.default=e,e.code='require("ajv/dist/runtime/ucs2length").default',et}var Xr;function hs(){if(Xr)return xe;Xr=1,Object.defineProperty(xe,"__esModule",{value:!0});const e=J(),t=Z(),n=ms(),h={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:s,schemaCode:p}){const u=s==="maxLength"?"more":"fewer";return(0,e.str)`must NOT have ${u} than ${p} characters`},params:({schemaCode:s})=>(0,e._)`{limit: ${s}}`},code(s){const{keyword:p,data:u,schemaCode:m,it:b}=s,_=p==="maxLength"?e.operators.GT:e.operators.LT,k=b.opts.unicode===!1?(0,e._)`${u}.length`:(0,e._)`${(0,t.useFunc)(s.gen,n.default)}(${u})`;s.fail$data((0,e._)`${k} ${_} ${m}`)}};return xe.default=h,xe}var tt={},xr;function ys(){if(xr)return tt;xr=1,Object.defineProperty(tt,"__esModule",{value:!0});const e=me(),t=J(),i={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:h})=>(0,t.str)`must match pattern "${h}"`,params:({schemaCode:h})=>(0,t._)`{pattern: ${h}}`},code(h){const{data:s,$data:p,schema:u,schemaCode:m,it:b}=h,_=b.opts.unicodeRegExp?"u":"",k=p?(0,t._)`(new RegExp(${m}, ${_}))`:(0,e.usePattern)(h,u);h.fail$data((0,t._)`!${k}.test(${s})`)}};return tt.default=i,tt}var rt={},en;function gs(){if(en)return rt;en=1,Object.defineProperty(rt,"__esModule",{value:!0});const e=J(),n={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:i,schemaCode:h}){const s=i==="maxProperties"?"more":"fewer";return(0,e.str)`must NOT have ${s} than ${h} properties`},params:({schemaCode:i})=>(0,e._)`{limit: ${i}}`},code(i){const{keyword:h,data:s,schemaCode:p}=i,u=h==="maxProperties"?e.operators.GT:e.operators.LT;i.fail$data((0,e._)`Object.keys(${s}).length ${u} ${p}`)}};return rt.default=n,rt}var nt={},tn;function vs(){if(tn)return nt;tn=1,Object.defineProperty(nt,"__esModule",{value:!0});const e=me(),t=J(),n=Z(),h={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:s}})=>(0,t.str)`must have required property '${s}'`,params:({params:{missingProperty:s}})=>(0,t._)`{missingProperty: ${s}}`},code(s){const{gen:p,schema:u,schemaCode:m,data:b,$data:_,it:k}=s,{opts:$}=k;if(!_&&u.length===0)return;const g=u.length>=$.loopRequired;if(k.allErrors?v():w(),$.strictRequired){const r=s.parentSchema.properties,{definedProperties:a}=s.it;for(const y of u)if(r?.[y]===void 0&&!a.has(y)){const o=k.schemaEnv.baseId+k.errSchemaPath,f=`required property "${y}" is not defined at "${o}" (strictRequired)`;(0,n.checkStrictMode)(k,f,k.opts.strictRequired)}}function v(){if(g||_)s.block$data(t.nil,c);else for(const r of u)(0,e.checkReportMissingProp)(s,r)}function w(){const r=p.let("missing");if(g||_){const a=p.let("valid",!0);s.block$data(a,()=>d(r,a)),s.ok(a)}else p.if((0,e.checkMissingProp)(s,u,r)),(0,e.reportMissingProp)(s,r),p.else()}function c(){p.forOf("prop",m,r=>{s.setParams({missingProperty:r}),p.if((0,e.noPropertyInData)(p,b,r,$.ownProperties),()=>s.error())})}function d(r,a){s.setParams({missingProperty:r}),p.forOf(r,m,()=>{p.assign(a,(0,e.propertyInData)(p,b,r,$.ownProperties)),p.if((0,t.not)(a),()=>{s.error(),p.break()})},t.nil)}}};return nt.default=h,nt}var st={},rn;function _s(){if(rn)return st;rn=1,Object.defineProperty(st,"__esModule",{value:!0});const e=J(),n={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:i,schemaCode:h}){const s=i==="maxItems"?"more":"fewer";return(0,e.str)`must NOT have ${s} than ${h} items`},params:({schemaCode:i})=>(0,e._)`{limit: ${i}}`},code(i){const{keyword:h,data:s,schemaCode:p}=i,u=h==="maxItems"?e.operators.GT:e.operators.LT;i.fail$data((0,e._)`${s}.length ${u} ${p}`)}};return st.default=n,st}var it={},ot={},nn;function ar(){if(nn)return ot;nn=1,Object.defineProperty(ot,"__esModule",{value:!0});const e=qr();return e.code='require("ajv/dist/runtime/equal").default',ot.default=e,ot}var sn;function $s(){if(sn)return it;sn=1,Object.defineProperty(it,"__esModule",{value:!0});const e=Fe(),t=J(),n=Z(),i=ar(),s={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:p,j:u}})=>(0,t.str)`must NOT have duplicate items (items ## ${u} and ${p} are identical)`,params:({params:{i:p,j:u}})=>(0,t._)`{i: ${p}, j: ${u}}`},code(p){const{gen:u,data:m,$data:b,schema:_,parentSchema:k,schemaCode:$,it:g}=p;if(!b&&!_)return;const v=u.let("valid"),w=k.items?(0,e.getSchemaTypes)(k.items):[];p.block$data(v,c,(0,t._)`${$} === false`),p.ok(v);function c(){const y=u.let("i",(0,t._)`${m}.length`),o=u.let("j");p.setParams({i:y,j:o}),u.assign(v,!0),u.if((0,t._)`${y} > 1`,()=>(d()?r:a)(y,o))}function d(){return w.length>0&&!w.some(y=>y==="object"||y==="array")}function r(y,o){const f=u.name("item"),P=(0,e.checkDataTypes)(w,f,g.opts.strictNumbers,e.DataType.Wrong),N=u.const("indices",(0,t._)`{}`);u.for((0,t._)`;${y}--;`,()=>{u.let(f,(0,t._)`${m}[${y}]`),u.if(P,(0,t._)`continue`),w.length>1&&u.if((0,t._)`typeof ${f} == "string"`,(0,t._)`${f} += "_"`),u.if((0,t._)`typeof ${N}[${f}] == "number"`,()=>{u.assign(o,(0,t._)`${N}[${f}]`),p.error(),u.assign(v,!1).break()}).code((0,t._)`${N}[${f}] = ${y}`)})}function a(y,o){const f=(0,n.useFunc)(u,i.default),P=u.name("outer");u.label(P).for((0,t._)`;${y}--;`,()=>u.for((0,t._)`${o} = ${y}; ${o}--;`,()=>u.if((0,t._)`${f}(${m}[${y}], ${m}[${o}])`,()=>{p.error(),u.assign(v,!1).break(P)})))}}};return it.default=s,it}var at={},on;function bs(){if(on)return at;on=1,Object.defineProperty(at,"__esModule",{value:!0});const e=J(),t=Z(),n=ar(),h={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:s})=>(0,e._)`{allowedValue: ${s}}`},code(s){const{gen:p,data:u,$data:m,schemaCode:b,schema:_}=s;m||_&&typeof _=="object"?s.fail$data((0,e._)`!${(0,t.useFunc)(p,n.default)}(${u}, ${b})`):s.fail((0,e._)`${_} !== ${u}`)}};return at.default=h,at}var ct={},an;function ws(){if(an)return ct;an=1,Object.defineProperty(ct,"__esModule",{value:!0});const e=J(),t=Z(),n=ar(),h={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:s})=>(0,e._)`{allowedValues: ${s}}`},code(s){const{gen:p,data:u,$data:m,schema:b,schemaCode:_,it:k}=s;if(!m&&b.length===0)throw new Error("enum must have non-empty array");const $=b.length>=k.opts.loopEnum;let g;const v=()=>g??(g=(0,t.useFunc)(p,n.default));let w;if($||m)w=p.let("valid"),s.block$data(w,c);else{if(!Array.isArray(b))throw new Error("ajv implementation error");const r=p.const("vSchema",_);w=(0,e.or)(...b.map((a,y)=>d(r,y)))}s.pass(w);function c(){p.assign(w,!1),p.forOf("v",_,r=>p.if((0,e._)`${v()}(${u}, ${r})`,()=>p.assign(w,!0).break()))}function d(r,a){const y=b[a];return typeof y=="object"&&y!==null?(0,e._)`${v()}(${u}, ${r}[${a}])`:(0,e._)`${u} === ${y}`}}};return ct.default=h,ct}var cn;function Ps(){if(cn)return Ze;cn=1,Object.defineProperty(Ze,"__esModule",{value:!0});const e=fs(),t=ps(),n=hs(),i=ys(),h=gs(),s=vs(),p=_s(),u=$s(),m=bs(),b=ws(),_=[e.default,t.default,n.default,i.default,h.default,s.default,p.default,u.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},m.default,b.default];return Ze.default=_,Ze}var dt={},je={},dn;function un(){if(dn)return je;dn=1,Object.defineProperty(je,"__esModule",{value:!0}),je.validateAdditionalItems=void 0;const e=J(),t=Z(),i={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:s}})=>(0,e.str)`must NOT have more than ${s} items`,params:({params:{len:s}})=>(0,e._)`{limit: ${s}}`},code(s){const{parentSchema:p,it:u}=s,{items:m}=p;if(!Array.isArray(m)){(0,t.checkStrictMode)(u,'"additionalItems" is ignored when "items" is not an array of schemas');return}h(s,m)}};function h(s,p){const{gen:u,schema:m,data:b,keyword:_,it:k}=s;k.items=!0;const $=u.const("len",(0,e._)`${b}.length`);if(m===!1)s.setParams({len:p.length}),s.pass((0,e._)`${$} <= ${p.length}`);else if(typeof m=="object"&&!(0,t.alwaysValidSchema)(k,m)){const v=u.var("valid",(0,e._)`${$} <= ${p.length}`);u.if((0,e.not)(v),()=>g(v)),s.ok(v)}function g(v){u.forRange("i",p.length,$,w=>{s.subschema({keyword:_,dataProp:w,dataPropType:t.Type.Num},v),k.allErrors||u.if((0,e.not)(v),()=>u.break())})}}return je.validateAdditionalItems=h,je.default=i,je}var ut={},Ie={},ln;function fn(){if(ln)return Ie;ln=1,Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.validateTuple=void 0;const e=J(),t=Z(),n=me(),i={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(s){const{schema:p,it:u}=s;if(Array.isArray(p))return h(s,"additionalItems",p);u.items=!0,!(0,t.alwaysValidSchema)(u,p)&&s.ok((0,n.validateArray)(s))}};function h(s,p,u=s.schema){const{gen:m,parentSchema:b,data:_,keyword:k,it:$}=s;w(b),$.opts.unevaluated&&u.length&&$.items!==!0&&($.items=t.mergeEvaluated.items(m,u.length,$.items));const g=m.name("valid"),v=m.const("len",(0,e._)`${_}.length`);u.forEach((c,d)=>{(0,t.alwaysValidSchema)($,c)||(m.if((0,e._)`${v} > ${d}`,()=>s.subschema({keyword:k,schemaProp:d,dataProp:d},g)),s.ok(g))});function w(c){const{opts:d,errSchemaPath:r}=$,a=u.length,y=a===c.minItems&&(a===c.maxItems||c[p]===!1);if(d.strictTuples&&!y){const o=`"${k}" is ${a}-tuple, but minItems or maxItems/${p} are not specified or different at path "${r}"`;(0,t.checkStrictMode)($,o,d.strictTuples)}}}return Ie.validateTuple=h,Ie.default=i,Ie}var pn;function Es(){if(pn)return ut;pn=1,Object.defineProperty(ut,"__esModule",{value:!0});const e=fn(),t={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:n=>(0,e.validateTuple)(n,"items")};return ut.default=t,ut}var lt={},mn;function ks(){if(mn)return lt;mn=1,Object.defineProperty(lt,"__esModule",{value:!0});const e=J(),t=Z(),n=me(),i=un(),s={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:p}})=>(0,e.str)`must NOT have more than ${p} items`,params:({params:{len:p}})=>(0,e._)`{limit: ${p}}`},code(p){const{schema:u,parentSchema:m,it:b}=p,{prefixItems:_}=m;b.items=!0,!(0,t.alwaysValidSchema)(b,u)&&(_?(0,i.validateAdditionalItems)(p,_):p.ok((0,n.validateArray)(p)))}};return lt.default=s,lt}var ft={},hn;function Ss(){if(hn)return ft;hn=1,Object.defineProperty(ft,"__esModule",{value:!0});const e=J(),t=Z(),i={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:h,max:s}})=>s===void 0?(0,e.str)`must contain at least ${h} valid item(s)`:(0,e.str)`must contain at least ${h} and no more than ${s} valid item(s)`,params:({params:{min:h,max:s}})=>s===void 0?(0,e._)`{minContains: ${h}}`:(0,e._)`{minContains: ${h}, maxContains: ${s}}`},code(h){const{gen:s,schema:p,parentSchema:u,data:m,it:b}=h;let _,k;const{minContains:$,maxContains:g}=u;b.opts.next?(_=$===void 0?1:$,k=g):_=1;const v=s.const("len",(0,e._)`${m}.length`);if(h.setParams({min:_,max:k}),k===void 0&&_===0){(0,t.checkStrictMode)(b,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(k!==void 0&&_>k){(0,t.checkStrictMode)(b,'"minContains" > "maxContains" is always invalid'),h.fail();return}if((0,t.alwaysValidSchema)(b,p)){let a=(0,e._)`${v} >= ${_}`;k!==void 0&&(a=(0,e._)`${a} && ${v} <= ${k}`),h.pass(a);return}b.items=!0;const w=s.name("valid");k===void 0&&_===1?d(w,()=>s.if(w,()=>s.break())):_===0?(s.let(w,!0),k!==void 0&&s.if((0,e._)`${m}.length > 0`,c)):(s.let(w,!1),c()),h.result(w,()=>h.reset());function c(){const a=s.name("_valid"),y=s.let("count",0);d(a,()=>s.if(a,()=>r(y)))}function d(a,y){s.forRange("i",0,v,o=>{h.subschema({keyword:"contains",dataProp:o,dataPropType:t.Type.Num,compositeRule:!0},a),y()})}function r(a){s.code((0,e._)`${a}++`),k===void 0?s.if((0,e._)`${a} >= ${_}`,()=>s.assign(w,!0).break()):(s.if((0,e._)`${a} > ${k}`,()=>s.assign(w,!1).break()),_===1?s.assign(w,!0):s.if((0,e._)`${a} >= ${_}`,()=>s.assign(w,!0)))}}};return ft.default=i,ft}var cr={},yn;function js(){return yn||(yn=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=J(),n=Z(),i=me();e.error={message:({params:{property:m,depsCount:b,deps:_}})=>{const k=b===1?"property":"properties";return(0,t.str)`must have ${k} ${_} when property ${m} is present`},params:({params:{property:m,depsCount:b,deps:_,missingProperty:k}})=>(0,t._)`{property: ${m},
6
+ missingProperty: ${k},
7
7
  depsCount: ${b},
8
- deps: ${_}}`};const y={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(m){const[b,_]=i(m);p(m,b),u(m,_)}};function i({schema:m}){const b={},_={};for(const S in m){if(S==="__proto__")continue;const $=Array.isArray(m[S])?b:_;$[S]=m[S]}return[b,_]}function p(m,b=m.schema){const{gen:_,data:S,it:$}=m;if(Object.keys(b).length===0)return;const g=_.let("missing");for(const v in b){const w=b[v];if(w.length===0)continue;const c=(0,n.propertyInData)(_,S,v,$.opts.ownProperties);m.setParams({property:v,depsCount:w.length,deps:w.join(", ")}),$.allErrors?_.if(c,()=>{for(const d of w)(0,n.checkReportMissingProp)(m,d)}):(_.if((0,t._)`${c} && (${(0,n.checkMissingProp)(m,w,g)})`),(0,n.reportMissingProp)(m,g),_.else())}}e.validatePropertyDeps=p;function u(m,b=m.schema){const{gen:_,data:S,keyword:$,it:g}=m,v=_.name("valid");for(const w in b)(0,a.alwaysValidSchema)(g,b[w])||(_.if((0,n.propertyInData)(_,S,w,g.opts.ownProperties),()=>{const c=m.subschema({keyword:$,schemaProp:w},v);m.mergeValidEvaluated(c,v)},()=>_.var(v,!0)),m.ok(v))}e.validateSchemaDeps=u,e.default=y})(Bt)),Bt}var ft={},rn;function yi(){if(rn)return ft;rn=1,Object.defineProperty(ft,"__esModule",{value:!0});const e=G(),t=Y(),n={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:y})=>(0,e._)`{propertyName: ${y.propertyName}}`},code(y){const{gen:i,schema:p,data:u,it:m}=y;if((0,t.alwaysValidSchema)(m,p))return;const b=i.name("valid");i.forIn("key",u,_=>{y.setParams({propertyName:_}),y.subschema({keyword:"propertyNames",data:_,dataTypes:["string"],propertyName:_,compositeRule:!0},b),i.if((0,e.not)(b),()=>{y.error(!0),m.allErrors||i.break()})}),y.ok(b)}};return ft.default=n,ft}var pt={},nn;function sn(){if(nn)return pt;nn=1,Object.defineProperty(pt,"__esModule",{value:!0});const e=fe(),t=G(),a=ve(),n=Y(),i={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:p})=>(0,t._)`{additionalProperty: ${p.additionalProperty}}`},code(p){const{gen:u,schema:m,parentSchema:b,data:_,errsCount:S,it:$}=p;if(!S)throw new Error("ajv implementation error");const{allErrors:g,opts:v}=$;if($.props=!0,v.removeAdditional!=="all"&&(0,n.alwaysValidSchema)($,m))return;const w=(0,e.allSchemaProperties)(b.properties),c=(0,e.allSchemaProperties)(b.patternProperties);d(),p.ok((0,t._)`${S} === ${a.default.errors}`);function d(){u.forIn("key",_,f=>{!w.length&&!c.length?h(f):u.if(r(f),()=>h(f))})}function r(f){let P;if(w.length>8){const N=(0,n.schemaRefOrVal)($,b.properties,"properties");P=(0,e.isOwnProperty)(u,N,f)}else w.length?P=(0,t.or)(...w.map(N=>(0,t._)`${f} === ${N}`)):P=t.nil;return c.length&&(P=(0,t.or)(P,...c.map(N=>(0,t._)`${(0,e.usePattern)(p,N)}.test(${f})`))),(0,t.not)(P)}function o(f){u.code((0,t._)`delete ${_}[${f}]`)}function h(f){if(v.removeAdditional==="all"||v.removeAdditional&&m===!1){o(f);return}if(m===!1){p.setParams({additionalProperty:f}),p.error(),g||u.break();return}if(typeof m=="object"&&!(0,n.alwaysValidSchema)($,m)){const P=u.name("valid");v.removeAdditional==="failing"?(s(f,P,!1),u.if((0,t.not)(P),()=>{p.reset(),o(f)})):(s(f,P),g||u.if((0,t.not)(P),()=>u.break()))}}function s(f,P,N){const D={keyword:"additionalProperties",dataProp:f,dataPropType:n.Type.Str};N===!1&&Object.assign(D,{compositeRule:!0,createErrors:!1,allErrors:!1}),p.subschema(D,P)}}};return pt.default=i,pt}var mt={},on;function gi(){if(on)return mt;on=1,Object.defineProperty(mt,"__esModule",{value:!0});const e=Le(),t=fe(),a=Y(),n=sn(),y={keyword:"properties",type:"object",schemaType:"object",code(i){const{gen:p,schema:u,parentSchema:m,data:b,it:_}=i;_.opts.removeAdditional==="all"&&m.additionalProperties===void 0&&n.default.code(new e.KeywordCxt(_,n.default,"additionalProperties"));const S=(0,t.allSchemaProperties)(u);for(const c of S)_.definedProperties.add(c);_.opts.unevaluated&&S.length&&_.props!==!0&&(_.props=a.mergeEvaluated.props(p,(0,a.toHash)(S),_.props));const $=S.filter(c=>!(0,a.alwaysValidSchema)(_,u[c]));if($.length===0)return;const g=p.name("valid");for(const c of $)v(c)?w(c):(p.if((0,t.propertyInData)(p,b,c,_.opts.ownProperties)),w(c),_.allErrors||p.else().var(g,!0),p.endIf()),i.it.definedProperties.add(c),i.ok(g);function v(c){return _.opts.useDefaults&&!_.compositeRule&&u[c].default!==void 0}function w(c){i.subschema({keyword:"properties",schemaProp:c,dataProp:c},g)}}};return mt.default=y,mt}var ht={},an;function vi(){if(an)return ht;an=1,Object.defineProperty(ht,"__esModule",{value:!0});const e=fe(),t=G(),a=Y(),n=Y(),y={keyword:"patternProperties",type:"object",schemaType:"object",code(i){const{gen:p,schema:u,data:m,parentSchema:b,it:_}=i,{opts:S}=_,$=(0,e.allSchemaProperties)(u),g=$.filter(h=>(0,a.alwaysValidSchema)(_,u[h]));if($.length===0||g.length===$.length&&(!_.opts.unevaluated||_.props===!0))return;const v=S.strictSchema&&!S.allowMatchingProperties&&b.properties,w=p.name("valid");_.props!==!0&&!(_.props instanceof t.Name)&&(_.props=(0,n.evaluatedPropsToName)(p,_.props));const{props:c}=_;d();function d(){for(const h of $)v&&r(h),_.allErrors?o(h):(p.var(w,!0),o(h),p.if(w))}function r(h){for(const s in v)new RegExp(h).test(s)&&(0,a.checkStrictMode)(_,`property ${s} matches pattern ${h} (use allowMatchingProperties)`)}function o(h){p.forIn("key",m,s=>{p.if((0,t._)`${(0,e.usePattern)(i,h)}.test(${s})`,()=>{const f=g.includes(h);f||i.subschema({keyword:"patternProperties",schemaProp:h,dataProp:s,dataPropType:n.Type.Str},w),_.opts.unevaluated&&c!==!0?p.assign((0,t._)`${c}[${s}]`,!0):!f&&!_.allErrors&&p.if((0,t.not)(w),()=>p.break())})})}}};return ht.default=y,ht}var yt={},cn;function _i(){if(cn)return yt;cn=1,Object.defineProperty(yt,"__esModule",{value:!0});const e=Y(),t={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(a){const{gen:n,schema:y,it:i}=a;if((0,e.alwaysValidSchema)(i,y)){a.fail();return}const p=n.name("valid");a.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},p),a.failResult(p,()=>a.reset(),()=>a.error())},error:{message:"must NOT be valid"}};return yt.default=t,yt}var gt={},dn;function $i(){if(dn)return gt;dn=1,Object.defineProperty(gt,"__esModule",{value:!0});const t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:fe().validateUnion,error:{message:"must match a schema in anyOf"}};return gt.default=t,gt}var vt={},un;function bi(){if(un)return vt;un=1,Object.defineProperty(vt,"__esModule",{value:!0});const e=G(),t=Y(),n={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:y})=>(0,e._)`{passingSchemas: ${y.passing}}`},code(y){const{gen:i,schema:p,parentSchema:u,it:m}=y;if(!Array.isArray(p))throw new Error("ajv implementation error");if(m.opts.discriminator&&u.discriminator)return;const b=p,_=i.let("valid",!1),S=i.let("passing",null),$=i.name("_valid");y.setParams({passing:S}),i.block(g),y.result(_,()=>y.reset(),()=>y.error(!0));function g(){b.forEach((v,w)=>{let c;(0,t.alwaysValidSchema)(m,v)?i.var($,!0):c=y.subschema({keyword:"oneOf",schemaProp:w,compositeRule:!0},$),w>0&&i.if((0,e._)`${$} && ${_}`).assign(_,!1).assign(S,(0,e._)`[${S}, ${w}]`).else(),i.if($,()=>{i.assign(_,!0),i.assign(S,w),c&&y.mergeEvaluated(c,e.Name)})})}}};return vt.default=n,vt}var _t={},ln;function wi(){if(ln)return _t;ln=1,Object.defineProperty(_t,"__esModule",{value:!0});const e=Y(),t={keyword:"allOf",schemaType:"array",code(a){const{gen:n,schema:y,it:i}=a;if(!Array.isArray(y))throw new Error("ajv implementation error");const p=n.name("valid");y.forEach((u,m)=>{if((0,e.alwaysValidSchema)(i,u))return;const b=a.subschema({keyword:"allOf",schemaProp:m},p);a.ok(p),a.mergeEvaluated(b)})}};return _t.default=t,_t}var $t={},fn;function Pi(){if(fn)return $t;fn=1,Object.defineProperty($t,"__esModule",{value:!0});const e=G(),t=Y(),n={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:i})=>(0,e.str)`must match "${i.ifClause}" schema`,params:({params:i})=>(0,e._)`{failingKeyword: ${i.ifClause}}`},code(i){const{gen:p,parentSchema:u,it:m}=i;u.then===void 0&&u.else===void 0&&(0,t.checkStrictMode)(m,'"if" without "then" and "else" is ignored');const b=y(m,"then"),_=y(m,"else");if(!b&&!_)return;const S=p.let("valid",!0),$=p.name("_valid");if(g(),i.reset(),b&&_){const w=p.let("ifClause");i.setParams({ifClause:w}),p.if($,v("then",w),v("else",w))}else b?p.if($,v("then")):p.if((0,e.not)($),v("else"));i.pass(S,()=>i.error(!0));function g(){const w=i.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},$);i.mergeEvaluated(w)}function v(w,c){return()=>{const d=i.subschema({keyword:w},$);p.assign(S,$),i.mergeValidEvaluated(d,S),c?p.assign(c,(0,e._)`${w}`):i.setParams({ifClause:w})}}}};function y(i,p){const u=i.schema[p];return u!==void 0&&!(0,t.alwaysValidSchema)(i,u)}return $t.default=n,$t}var bt={},pn;function Ei(){if(pn)return bt;pn=1,Object.defineProperty(bt,"__esModule",{value:!0});const e=Y(),t={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:a,parentSchema:n,it:y}){n.if===void 0&&(0,e.checkStrictMode)(y,`"${a}" without "if" is ignored`)}};return bt.default=t,bt}var mn;function Si(){if(mn)return ct;mn=1,Object.defineProperty(ct,"__esModule",{value:!0});const e=Yr(),t=fi(),a=Qr(),n=pi(),y=mi(),i=hi(),p=yi(),u=sn(),m=gi(),b=vi(),_=_i(),S=$i(),$=bi(),g=wi(),v=Pi(),w=Ei();function c(d=!1){const r=[_.default,S.default,$.default,g.default,v.default,w.default,p.default,u.default,i.default,m.default,b.default];return d?r.push(t.default,n.default):r.push(e.default,a.default),r.push(y.default),r}return ct.default=c,ct}var wt={},Pt={},hn;function ji(){if(hn)return Pt;hn=1,Object.defineProperty(Pt,"__esModule",{value:!0});const e=G(),a={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:n})=>(0,e.str)`must match format "${n}"`,params:({schemaCode:n})=>(0,e._)`{format: ${n}}`},code(n,y){const{gen:i,data:p,$data:u,schema:m,schemaCode:b,it:_}=n,{opts:S,errSchemaPath:$,schemaEnv:g,self:v}=_;if(!S.validateFormats)return;u?w():c();function w(){const d=i.scopeValue("formats",{ref:v.formats,code:S.code.formats}),r=i.const("fDef",(0,e._)`${d}[${b}]`),o=i.let("fType"),h=i.let("format");i.if((0,e._)`typeof ${r} == "object" && !(${r} instanceof RegExp)`,()=>i.assign(o,(0,e._)`${r}.type || "string"`).assign(h,(0,e._)`${r}.validate`),()=>i.assign(o,(0,e._)`"string"`).assign(h,r)),n.fail$data((0,e.or)(s(),f()));function s(){return S.strictSchema===!1?e.nil:(0,e._)`${b} && !${h}`}function f(){const P=g.$async?(0,e._)`(${r}.async ? await ${h}(${p}) : ${h}(${p}))`:(0,e._)`${h}(${p})`,N=(0,e._)`(typeof ${h} == "function" ? ${P} : ${h}.test(${p}))`;return(0,e._)`${h} && ${h} !== true && ${o} === ${y} && !${N}`}}function c(){const d=v.formats[m];if(!d){s();return}if(d===!0)return;const[r,o,h]=f(d);r===y&&n.pass(P());function s(){if(S.strictSchema===!1){v.logger.warn(N());return}throw new Error(N());function N(){return`unknown format "${m}" ignored in schema at path "${$}"`}}function f(N){const D=N instanceof RegExp?(0,e.regexpCode)(N):S.code.formats?(0,e._)`${S.code.formats}${(0,e.getProperty)(m)}`:void 0,z=i.scopeValue("formats",{key:m,ref:N,code:D});return typeof N=="object"&&!(N instanceof RegExp)?[N.type||"string",N.validate,(0,e._)`${z}.validate`]:["string",N,z]}function P(){if(typeof d=="object"&&!(d instanceof RegExp)&&d.async){if(!g.$async)throw new Error("async format in sync schema");return(0,e._)`await ${h}(${p})`}return typeof o=="function"?(0,e._)`${h}(${p})`:(0,e._)`${h}.test(${p})`}}}};return Pt.default=a,Pt}var yn;function ki(){if(yn)return wt;yn=1,Object.defineProperty(wt,"__esModule",{value:!0});const t=[ji().default];return wt.default=t,wt}var we={},gn;function Ii(){return gn||(gn=1,Object.defineProperty(we,"__esModule",{value:!0}),we.contentVocabulary=we.metadataVocabulary=void 0,we.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],we.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]),we}var vn;function Ri(){if(vn)return Je;vn=1,Object.defineProperty(Je,"__esModule",{value:!0});const e=xn(),t=li(),a=Si(),n=ki(),y=Ii(),i=[e.default,t.default,(0,a.default)(),n.default,y.metadataVocabulary,y.contentVocabulary];return Je.default=i,Je}var Et={},Oe={},_n;function Ni(){if(_n)return Oe;_n=1,Object.defineProperty(Oe,"__esModule",{value:!0}),Oe.DiscrError=void 0;var e;return(function(t){t.Tag="tag",t.Mapping="mapping"})(e||(Oe.DiscrError=e={})),Oe}var $n;function Oi(){if($n)return Et;$n=1,Object.defineProperty(Et,"__esModule",{value:!0});const e=G(),t=Ni(),a=Ht(),n=He(),y=Y(),p={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:u,tagName:m}})=>u===t.DiscrError.Tag?`tag "${m}" must be string`:`value of tag "${m}" must be in oneOf`,params:({params:{discrError:u,tag:m,tagName:b}})=>(0,e._)`{error: ${u}, tag: ${b}, tagValue: ${m}}`},code(u){const{gen:m,data:b,schema:_,parentSchema:S,it:$}=u,{oneOf:g}=S;if(!$.opts.discriminator)throw new Error("discriminator: requires discriminator option");const v=_.propertyName;if(typeof v!="string")throw new Error("discriminator: requires propertyName");if(_.mapping)throw new Error("discriminator: mapping is not supported");if(!g)throw new Error("discriminator: requires oneOf keyword");const w=m.let("valid",!1),c=m.const("tag",(0,e._)`${b}${(0,e.getProperty)(v)}`);m.if((0,e._)`typeof ${c} == "string"`,()=>d(),()=>u.error(!1,{discrError:t.DiscrError.Tag,tag:c,tagName:v})),u.ok(w);function d(){const h=o();m.if(!1);for(const s in h)m.elseIf((0,e._)`${c} === ${s}`),m.assign(w,r(h[s]));m.else(),u.error(!1,{discrError:t.DiscrError.Mapping,tag:c,tagName:v}),m.endIf()}function r(h){const s=m.name("valid"),f=u.subschema({keyword:"oneOf",schemaProp:h},s);return u.mergeEvaluated(f,e.Name),s}function o(){var h;const s={},f=N(S);let P=!0;for(let q=0;q<g.length;q++){let V=g[q];if(V?.$ref&&!(0,y.schemaHasRulesButRef)(V,$.self.RULES)){const L=V.$ref;if(V=a.resolveRef.call($.self,$.schemaEnv.root,$.baseId,L),V instanceof a.SchemaEnv&&(V=V.schema),V===void 0)throw new n.default($.opts.uriResolver,$.baseId,L)}const F=(h=V?.properties)===null||h===void 0?void 0:h[v];if(typeof F!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${v}"`);P=P&&(f||N(V)),D(F,q)}if(!P)throw new Error(`discriminator: "${v}" must be required`);return s;function N({required:q}){return Array.isArray(q)&&q.includes(v)}function D(q,V){if(q.const)z(q.const,V);else if(q.enum)for(const F of q.enum)z(F,V);else throw new Error(`discriminator: "properties/${v}" must have "const" or "enum"`)}function z(q,V){if(typeof q!="string"||q in s)throw new Error(`discriminator: "${v}" values must be unique strings`);s[q]=V}}}};return Et.default=p,Et}const qi={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{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:[]}},type:["object","boolean"],properties:{$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:"#"}},default:!0};var bn;function wn(){return bn||(bn=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;const a=Zn(),n=Ri(),y=Oi(),i=qi,p=["/properties"],u="http://json-schema.org/draft-07/schema";class m extends a.default{_addVocabularies(){super._addVocabularies(),n.default.forEach(v=>this.addVocabulary(v)),this.opts.discriminator&&this.addKeyword(y.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const v=this.opts.$data?this.$dataMetaSchema(i,p):i;this.addMetaSchema(v,u,!1),this.refs["http://json-schema.org/schema"]=u}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(u)?u:void 0)}}t.Ajv=m,e.exports=t=m,e.exports.Ajv=m,Object.defineProperty(t,"__esModule",{value:!0}),t.default=m;var b=Le();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return b.KeywordCxt}});var _=G();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return _._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return _.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return _.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return _.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return _.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return _.CodeGen}});var S=Kt();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return S.default}});var $=He();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return $.default}})})(De,De.exports)),De.exports}var Ci=wn();const Pn=Se(Ci);var St={exports:{}},Yt={},En;function Ti(){return En||(En=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(q,V){return{validate:q,compare:V}}e.fullFormats={date:t(i,p),time:t(m(!0),b),"date-time":t($(!0),g),"iso-time":t(m(),_),"iso-date-time":t($(),v),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:d,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:z,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:o,int32:{type:"number",validate:f},int64:{type:"number",validate:P},float:{type:"number",validate:N},double:{type:"number",validate:N},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,p),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,b),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,g),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,_),"iso-date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,v),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);function a(q){return q%4===0&&(q%100!==0||q%400===0)}const n=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,y=[0,31,28,31,30,31,30,31,31,30,31,30,31];function i(q){const V=n.exec(q);if(!V)return!1;const F=+V[1],L=+V[2],Q=+V[3];return L>=1&&L<=12&&Q>=1&&Q<=(L===2&&a(F)?29:y[L])}function p(q,V){if(q&&V)return q>V?1:q<V?-1:0}const u=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function m(q){return function(F){const L=u.exec(F);if(!L)return!1;const Q=+L[1],ie=+L[2],se=+L[3],x=L[4],pe=L[5]==="-"?-1:1,M=+(L[6]||0),k=+(L[7]||0);if(M>23||k>59||q&&!x)return!1;if(Q<=23&&ie<=59&&se<60)return!0;const T=ie-k*pe,R=Q-M*pe-(T<0?1:0);return(R===23||R===-1)&&(T===59||T===-1)&&se<61}}function b(q,V){if(!(q&&V))return;const F=new Date("2020-01-01T"+q).valueOf(),L=new Date("2020-01-01T"+V).valueOf();if(F&&L)return F-L}function _(q,V){if(!(q&&V))return;const F=u.exec(q),L=u.exec(V);if(F&&L)return q=F[1]+F[2]+F[3],V=L[1]+L[2]+L[3],q>V?1:q<V?-1:0}const S=/t|\s/i;function $(q){const V=m(q);return function(L){const Q=L.split(S);return Q.length===2&&i(Q[0])&&V(Q[1])}}function g(q,V){if(!(q&&V))return;const F=new Date(q).valueOf(),L=new Date(V).valueOf();if(F&&L)return F-L}function v(q,V){if(!(q&&V))return;const[F,L]=q.split(S),[Q,ie]=V.split(S),se=p(F,Q);if(se!==void 0)return se||b(L,ie)}const w=/\/|:/,c=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function d(q){return w.test(q)&&c.test(q)}const r=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function o(q){return r.lastIndex=0,r.test(q)}const h=-2147483648,s=2**31-1;function f(q){return Number.isInteger(q)&&q<=s&&q>=h}function P(q){return Number.isInteger(q)}function N(){return!0}const D=/[^\\]\\Z/;function z(q){if(D.test(q))return!1;try{return new RegExp(q),!0}catch{return!1}}})(Yt)),Yt}var Zt={},Sn;function Di(){return Sn||(Sn=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const t=wn(),a=G(),n=a.operators,y={formatMaximum:{okStr:"<=",ok:n.LTE,fail:n.GT},formatMinimum:{okStr:">=",ok:n.GTE,fail:n.LT},formatExclusiveMaximum:{okStr:"<",ok:n.LT,fail:n.GTE},formatExclusiveMinimum:{okStr:">",ok:n.GT,fail:n.LTE}},i={message:({keyword:u,schemaCode:m})=>(0,a.str)`should be ${y[u].okStr} ${m}`,params:({keyword:u,schemaCode:m})=>(0,a._)`{comparison: ${y[u].okStr}, limit: ${m}}`};e.formatLimitDefinition={keyword:Object.keys(y),type:"string",schemaType:"string",$data:!0,error:i,code(u){const{gen:m,data:b,schemaCode:_,keyword:S,it:$}=u,{opts:g,self:v}=$;if(!g.validateFormats)return;const w=new t.KeywordCxt($,v.RULES.all.format.definition,"format");w.$data?c():d();function c(){const o=m.scopeValue("formats",{ref:v.formats,code:g.code.formats}),h=m.const("fmt",(0,a._)`${o}[${w.schemaCode}]`);u.fail$data((0,a.or)((0,a._)`typeof ${h} != "object"`,(0,a._)`${h} instanceof RegExp`,(0,a._)`typeof ${h}.compare != "function"`,r(h)))}function d(){const o=w.schema,h=v.formats[o];if(!h||h===!0)return;if(typeof h!="object"||h instanceof RegExp||typeof h.compare!="function")throw new Error(`"${S}": format "${o}" does not define "compare" function`);const s=m.scopeValue("formats",{key:o,ref:h,code:g.code.formats?(0,a._)`${g.code.formats}${(0,a.getProperty)(o)}`:void 0});u.fail$data(r(s))}function r(o){return(0,a._)`${o}.compare(${b}, ${_}) ${y[S].fail} 0`}},dependencies:["format"]};const p=u=>(u.addKeyword(e.formatLimitDefinition),u);e.default=p})(Zt)),Zt}var jn;function Mi(){return jn||(jn=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const a=Ti(),n=Di(),y=G(),i=new y.Name("fullFormats"),p=new y.Name("fastFormats"),u=(b,_={keywords:!0})=>{if(Array.isArray(_))return m(b,_,a.fullFormats,i),b;const[S,$]=_.mode==="fast"?[a.fastFormats,p]:[a.fullFormats,i],g=_.formats||a.formatNames;return m(b,g,S,$),_.keywords&&(0,n.default)(b),b};u.get=(b,_="full")=>{const $=(_==="fast"?a.fastFormats:a.fullFormats)[b];if(!$)throw new Error(`Unknown format "${b}"`);return $};function m(b,_,S,$){var g,v;(g=(v=b.opts.code).formats)!==null&&g!==void 0||(v.formats=(0,y._)`require("ajv-formats/dist/formats").${$}`);for(const w of _)b.addFormat(w,S[w])}e.exports=t=u,Object.defineProperty(t,"__esModule",{value:!0}),t.default=u})(St,St.exports)),St.exports}var Ai=Mi();const kn=Se(Ai),qe={$schema:"http://json-schema.org/draft-07/schema#",$ref:"#/definitions/CICConfig",definitions:JSON.parse('{"CICConfig":{"type":"object","properties":{"version":{"type":"string"},"meta":{"$ref":"#/definitions/Meta"},"pages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"path":{"type":"string"},"layout":{"$ref":"#/definitions/Layout"},"components":{"type":"array","items":{"$ref":"#/definitions/ComponentInstance"}},"dataSources":{"type":"array","items":{"$ref":"#/definitions/DataSourceItem"}},"extensions":{"type":"object"}},"required":["id","name","path"],"additionalProperties":false,"description":"CIC 页面定义 说明:定义了 CIC 中页面的结构,包含页面 ID、名称、路径、布局、组件等。"}},"registry":{"$ref":"#/definitions/Registry"},"variables":{"$ref":"#/definitions/Variables"},"deps":{"type":"array","items":{"$ref":"#/definitions/Dependency"}},"extensions":{"type":"object"}},"required":["version","meta","pages"],"additionalProperties":false,"description":"CIC 配置定义 说明:定义了 CIC 项目的全局配置,包含版本、元数据、页面、组件、变量、依赖等。"},"Meta":{"type":"object","properties":{"projectId":{"type":"string","description":"项目唯一标识符"},"projectName":{"type":"string","description":"项目名称"},"description":{"type":"string","description":"项目描述"},"layout":{"$ref":"#/definitions/Layout","description":"布局配置"},"language":{"type":"string","description":"语言代码 (e.g. zh-CN, en-US)"},"createTime":{"type":"string","description":"创建时间 (ISO 8601)","format":"date-time"},"updateTime":{"type":"string","description":"更新时间 (ISO 8601)","format":"date-time"},"author":{"type":"string","description":"作者"},"extensions":{"type":"object","description":"扩展字段"}},"additionalProperties":false,"description":"项目元信息 包含项目的基本信息、布局配置、语言、创建时间、更新时间、作者和扩展信息。"},"Layout":{"type":"object","properties":{"type":{"type":"string","enum":["free","grid"],"description":"布局类型: free(自由布局) 或 grid(网格布局)"},"config":{"type":"object","properties":{"width":{"type":"number","description":"设计稿宽度","minimum":1,"default":1920},"height":{"type":"number","description":"设计稿高度","minimum":1,"default":1080},"scaleMode":{"type":"string","enum":["aspectFit","fill"],"description":"缩放模式","default":"aspectFit"}},"required":["width","height","scaleMode"],"additionalProperties":false}},"required":["type","config"],"additionalProperties":false,"description":"布局配置"},"ComponentInstance":{"anyOf":[{"$ref":"#/definitions/ViewComponentInstance"},{"$ref":"#/definitions/ContainerComponentInstance"},{"$ref":"#/definitions/LogicComponentInstanceRef"}],"description":"组件实例(view/container/logic 类型)"},"ViewComponentInstance":{"type":"object","properties":{"id":{"type":"string"},"props":{"type":"object"},"style":{"type":"object","additionalProperties":{"$ref":"#/definitions/StyleValue"}},"events":{"$ref":"#/definitions/CICEventMap"},"data":{"$ref":"#/definitions/Data"},"deps":{"type":"array","items":{"type":"string"}},"extensions":{"type":"object"},"role":{"type":"string","const":"view"},"component":{"$ref":"#/definitions/ComponentRef"}},"required":["component","id","role"],"additionalProperties":false},"StyleValue":{"anyOf":[{"type":"string"},{"type":"number"},{"$ref":"#/definitions/Expr"}],"description":"样式值可以是静态或表达式"},"Expr":{"type":"string","description":"通用表达式(用于条件、模板等)"},"CICEventMap":{"type":"object","additionalProperties":{"type":"array","items":{"$ref":"#/definitions/CICEventWithMeta"}},"description":"某组件的所有事件 说明:定义了 CIC 项目中组件的所有事件,包含事件类型、动作、参数、调度顺序、延迟时间和条件。 (key: 事件名, value: 处理逻辑数组)"},"CICEventWithMeta":{"anyOf":[{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"vars"},"action":{"$ref":"#/definitions/VarsAction"},"params":{"$ref":"#/definitions/VarsParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"navigate"},"action":{"type":"string","const":"internal"},"params":{"$ref":"#/definitions/NavigateInternalParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"navigate"},"action":{"type":"string","const":"external"},"params":{"$ref":"#/definitions/NavigateExternalParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"comp"},"action":{"$ref":"#/definitions/CompAction"},"params":{"$ref":"#/definitions/CompParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"toggle"},"action":{"type":"string","const":"visibility"},"params":{"$ref":"#/definitions/ToggleParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"camera"},"action":{"type":"string","const":"focus"},"params":{"$ref":"#/definitions/CameraFocusParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"material"},"action":{"type":"string","const":"change"},"params":{"$ref":"#/definitions/MaterialChangeParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"custom"},"action":{"type":"string","const":"local"},"params":{"$ref":"#/definitions/CustomLocalParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"custom"},"action":{"type":"string","const":"remote"},"params":{"$ref":"#/definitions/CustomRemoteParams"}},"required":["action","order","params","type"]}],"description":"带调度信息"},"EventCondition":{"anyOf":[{"$ref":"#/definitions/KeyCondition"},{"type":"array","items":{"$ref":"#/definitions/KeyCondition"}},{"$ref":"#/definitions/ExpressionCondition"}],"description":"多条件(AND) + 表达式"},"KeyCondition":{"type":"object","properties":{"key":{"type":"string"},"op":{"$ref":"#/definitions/ConditionOperator"},"value":{}},"required":["key"],"additionalProperties":false},"ConditionOperator":{"type":"string","enum":["eq","neq","gt","gte","lt","lte","in","not-in","exists","not-exists"]},"ExpressionCondition":{"type":"object","properties":{"expression":{"type":"string"}},"required":["expression"],"additionalProperties":false,"description":"表达式条件:支持如 \\"ctx.id === 5 && ctx.level > 1\\""},"VarsAction":{"type":"string","enum":["add","update","delete"],"description":"变量事件动作"},"VarsParams":{"type":"object","properties":{"key":{"type":"string"},"value":{},"exclude":{"type":"array","items":{"type":"string"}}},"required":["key","value"],"additionalProperties":false},"NavigateInternalParams":{"type":"object","properties":{"name":{"type":"string"},"params":{"type":"object"}},"required":["name"],"additionalProperties":false},"NavigateExternalParams":{"type":"object","properties":{"url":{"type":"string"},"openNewTab":{"type":"boolean"}},"required":["url"],"additionalProperties":false},"CompAction":{"type":"string","enum":["add","update","delete"],"description":"组件事件动作"},"CompParams":{"type":"object","properties":{"comps":{"type":"array","items":{"type":"string"}},"props":{"type":"object"}},"required":["comps"],"additionalProperties":false},"ToggleParams":{"type":"object","properties":{"show":{"type":"array","items":{"type":"string"}},"hide":{"type":"array","items":{"type":"string"}}},"additionalProperties":false},"CameraFocusParams":{"type":"object","properties":{"target":{"type":["string","number"]},"duration":{"type":"number"}},"required":["target"],"additionalProperties":false},"MaterialChangeParams":{"type":"object","properties":{"target":{"type":"string"},"materials":{"type":"string"}},"required":["target","materials"],"additionalProperties":false},"CustomLocalParams":{"type":"object","properties":{"code":{"type":"string"},"depends":{"type":"array","items":{"type":"string"}}},"required":["code"],"additionalProperties":false},"CustomRemoteParams":{"type":"object","properties":{"url":{"type":"string"},"depends":{"type":"array","items":{"type":"string"}}},"required":["url"],"additionalProperties":false},"Data":{"type":"object","properties":{"id":{"type":"string","description":"数据ID"},"mapping":{"$ref":"#/definitions/IMapping","description":"字段映射配置"},"converse":{"$ref":"#/definitions/IConverse","description":"转换规则配置"}},"required":["id"],"additionalProperties":false,"description":"数据配置"},"IMapping":{"type":"object","properties":{"use":{"type":"boolean"},"mapFields":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string","description":"源字段名"},"mapField":{"type":"string","description":"目标字段名"},"value":{"description":"映射值或公式"},"type":{"type":"string","enum":["copy","const","formula"],"description":"映射类型:默认(普通映射)、copy(复制) const(常量)、formula(公式)"},"description":{"type":"string","description":"描述"}},"required":["field","mapField"],"additionalProperties":false}}},"required":["use","mapFields"],"additionalProperties":false,"description":"字段映射配置"},"IConverse":{"type":"object","properties":{"use":{"type":"boolean"},"data":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","description":"转换代码"},"depeedVars":{"type":"array","items":{"type":"string"},"description":"依赖变量列表(用于响应式重执行)"}},"required":["code"],"additionalProperties":false}}},"required":["use","data"],"additionalProperties":false,"description":"转换规则配置"},"ComponentRef":{"anyOf":[{"type":"string"},{"type":"object","properties":{"type":{"type":"string","const":"id"},"value":{"type":"string"}},"required":["type","value"],"additionalProperties":false}],"description":"component 引用:字符串或 object 描述"},"ContainerComponentInstance":{"type":"object","properties":{"id":{"type":"string"},"props":{"type":"object"},"style":{"type":"object","additionalProperties":{"$ref":"#/definitions/StyleValue"}},"events":{"$ref":"#/definitions/CICEventMap"},"data":{"$ref":"#/definitions/Data"},"deps":{"type":"array","items":{"type":"string"}},"extensions":{"type":"object"},"role":{"type":"string","const":"container"},"children":{"type":"array","items":{"$ref":"#/definitions/ComponentInstance"}}},"required":["children","id","role"],"additionalProperties":false},"LogicComponentInstanceRef":{"type":"object","properties":{"id":{"type":"string"},"props":{"type":"object"},"style":{"type":"object","additionalProperties":{"$ref":"#/definitions/StyleValue"}},"events":{"$ref":"#/definitions/CICEventMap"},"data":{"$ref":"#/definitions/Data"},"deps":{"type":"array","items":{"type":"string"}},"extensions":{"type":"object"},"role":{"type":"string","const":"logic"},"component":{"$ref":"#/definitions/LogicRef"}},"required":["component","id","role"],"additionalProperties":false},"LogicRef":{"anyOf":[{"type":"string"},{"type":"object","properties":{"type":{"type":"string","enum":["url","code"]},"value":{"type":"string"}},"required":["type","value"],"additionalProperties":false}]},"DataSourceItem":{"anyOf":[{"$ref":"#/definitions/DataSourceRest"},{"$ref":"#/definitions/DataSourceWebSocket"},{"$ref":"#/definitions/DataSourceStatic"},{"$ref":"#/definitions/DataSourceFunction"}],"description":"数据源项(rest/websocket/static/function 类型)"},"DataSourceRest":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"rest"},"order":{"type":"number"},"pollInterval":{"$ref":"#/definitions/Milliseconds"},"transform":{"anyOf":[{"type":"string"},{"$comment":"(res: any) => any","type":"object","properties":{"namedArgs":{"type":"object","properties":{"res":{}},"required":["res"],"additionalProperties":false}}}]},"url":{"type":"string"},"method":{"type":"string","enum":["GET","POST","PUT","DELETE"]},"headers":{"type":"object","additionalProperties":{"type":"string"}},"params":{"type":"object"},"body":{},"timeout":{"$ref":"#/definitions/Milliseconds"}},"required":["id","method","type","url"],"additionalProperties":false},"Milliseconds":{"type":"number"},"DataSourceWebSocket":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"websocket"},"order":{"type":"number"},"pollInterval":{"$ref":"#/definitions/Milliseconds"},"transform":{"anyOf":[{"type":"string"},{"$comment":"(res: any) => any","type":"object","properties":{"namedArgs":{"type":"object","properties":{"res":{}},"required":["res"],"additionalProperties":false}}}]},"url":{"type":"string"},"protocols":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"subscribeMessage":{},"heartbeat":{"type":"object","properties":{"interval":{"$ref":"#/definitions/Milliseconds"},"message":{}},"required":["interval","message"],"additionalProperties":false}},"required":["id","type","url"],"additionalProperties":false},"DataSourceStatic":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"static"},"order":{"type":"number"},"pollInterval":{"$ref":"#/definitions/Milliseconds"},"transform":{"anyOf":[{"type":"string"},{"$comment":"(res: any) => any","type":"object","properties":{"namedArgs":{"type":"object","properties":{"res":{}},"required":["res"],"additionalProperties":false}}}]},"value":{}},"required":["id","type","value"],"additionalProperties":false},"DataSourceFunction":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"function"},"order":{"type":"number"},"pollInterval":{"$ref":"#/definitions/Milliseconds"},"transform":{"anyOf":[{"type":"string"},{"$comment":"(res: any) => any","type":"object","properties":{"namedArgs":{"type":"object","properties":{"res":{}},"required":["res"],"additionalProperties":false}}}]},"code":{"type":"string"},"timeout":{"$ref":"#/definitions/Milliseconds"}},"required":["code","id","type"],"additionalProperties":false},"Registry":{"type":"object","properties":{"components":{"type":"array","items":{"$ref":"#/definitions/RegistryComponents"}},"plugins":{"type":"object","description":"插件后期可扩展"}},"additionalProperties":false,"description":"注册表"},"RegistryComponents":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"version":{"type":"string"},"author":{"type":"string"},"defaultProps":{"type":"object"},"data":{},"deps":{"type":"array","items":{"type":"string"}}},"required":["id"],"additionalProperties":false,"description":"注册中心组件项 说明:定义了 CIC 项目中组件注册中心的组件项,包含组件 ID、类型和配置。"},"Variables":{"type":"object","properties":{"global":{"$ref":"#/definitions/VariablesMap","description":"全局变量,对所有页面和组件均生效。"},"page":{"type":"object","additionalProperties":{"$ref":"#/definitions/VariablesMap"},"description":"页面级变量,键为页面 ID,值为该页面的变量映射。"},"component":{"type":"object","additionalProperties":{"$ref":"#/definitions/VariablesMap"},"description":"组件级变量,键为组件 ID,值为该组件的变量映射。"}},"additionalProperties":false,"description":"变量集合,按作用域组织:global/page/component。"},"VariablesMap":{"type":"object","additionalProperties":{"$ref":"#/definitions/Variable"},"description":"变量映射,键为变量名,值为变量定义。"},"Variable":{"anyOf":[{"$ref":"#/definitions/StringVariable"},{"$ref":"#/definitions/NumberVariable"},{"$ref":"#/definitions/BooleanVariable"},{"$ref":"#/definitions/ArrayVariable"},{"$ref":"#/definitions/FunctionVariable"},{"$ref":"#/definitions/ObjectVariable"}],"description":"变量联合类型,涵盖五类变量定义。"},"StringVariable":{"type":"object","properties":{"type":{"type":"string","const":"string"},"value":{"type":"string"},"default":{"type":"string"},"description":{"type":"string"}},"required":["type","value","default"],"additionalProperties":false,"description":"字符串变量,包含当前值与默认值,可选描述。"},"NumberVariable":{"type":"object","properties":{"type":{"type":"string","const":"number"},"value":{"type":"number"},"default":{"type":"number"},"description":{"type":"string"}},"required":["type","value","default"],"additionalProperties":false,"description":"数字变量,包含当前值与默认值,可选描述。"},"BooleanVariable":{"type":"object","properties":{"type":{"type":"string","const":"boolean"},"value":{"type":"boolean"},"default":{"type":"boolean"},"description":{"type":"string"}},"required":["type","value","default"],"additionalProperties":false,"description":"布尔变量,包含当前值与默认值,可选描述。"},"ArrayVariable":{"type":"object","properties":{"type":{"type":"string","const":"array"},"value":{"type":"array","items":{}},"default":{"type":"array","items":{}},"description":{"type":"string"}},"required":["type","value","default"],"additionalProperties":false,"description":"数组变量,元素类型不做限制,包含当前值与默认值,可选描述。"},"FunctionVariable":{"type":"object","properties":{"type":{"type":"string","const":"function"},"value":{"type":"string"},"default":{"type":"string"},"description":{"type":"string"},"args":{"type":"array","items":{"type":"string"}}},"required":["type","value","default"],"additionalProperties":false,"description":"函数变量,以字符串保存函数实现;支持 `args` 指定入参名列表。"},"ObjectVariable":{"type":"object","properties":{"type":{"type":"string","const":"object"},"value":{"type":"object","additionalProperties":{"$ref":"#/definitions/Variable"}},"default":{"type":"object","additionalProperties":{"$ref":"#/definitions/Variable"}},"description":{"type":"string"}},"required":["type","value","default"],"additionalProperties":false,"description":"对象变量,键到变量的映射;支持递归嵌套。"},"Dependency":{"anyOf":[{"$ref":"#/definitions/JSDependency"},{"$ref":"#/definitions/CSSDependency"},{"$ref":"#/definitions/FontDependency"},{"$ref":"#/definitions/ImageDependency"},{"$ref":"#/definitions/JSONDependency"},{"$ref":"#/definitions/WasmDependency"},{"$ref":"#/definitions/OtherDependency"}],"description":"依赖项"},"JSDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"js"},"format":{"$ref":"#/definitions/JSFormat"},"crossOrigin":{"type":"string","enum":["anonymous","use-credentials"]},"module":{"type":"boolean"}},"required":["format","id","type"],"additionalProperties":false,"description":"JS 资源"},"JSFormat":{"type":"string","enum":["esm","umd","iife","cjs"],"description":"JS 格式"},"CSSDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"css"},"media":{"type":"string"}},"required":["id","type"],"additionalProperties":false,"description":"CSS"},"FontDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"font"},"family":{"type":"string"},"weight":{"type":["number","string"]},"style":{"type":"string","enum":["normal","italic"]}},"required":["id","type"],"additionalProperties":false,"description":"字体"},"ImageDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"image"},"mime":{"type":"string"}},"required":["id","type"],"additionalProperties":false,"description":"图片"},"JSONDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"json"}},"required":["id","type"],"additionalProperties":false,"description":"JSON"},"WasmDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"wasm"},"init":{"type":"string","enum":["async","sync"]}},"required":["id","type"],"additionalProperties":false,"description":"WASM"},"OtherDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"other"},"kind":{"type":"string"}},"required":["id","type"],"additionalProperties":false,"description":"其他"}}')};let jt=null;const In=()=>(jt||(jt=new Pn({allErrors:!0,strict:!1}),kn(jt)),jt),kt=new Map,Rn=JSON.stringify(qe),Vi={CICPage:["#/definitions/CICPage","#/$defs/CICPage","#/properties/pages/items","#/definitions/CICConfig/properties/pages/items"],Meta:["#/definitions/Meta","#/$defs/Meta","#/properties/meta"],Layout:["#/definitions/Layout","#/$defs/Layout","#/properties/meta/properties/layout"],ComponentInstance:["#/definitions/ComponentInstance","#/$defs/ComponentInstance"],DataSourceItem:["#/definitions/DataSourceItem","#/$defs/DataSourceItem"],RegistryComponents:["#/definitions/RegistryComponents","#/$defs/RegistryComponents"],Variables:["#/definitions/Variables","#/$defs/Variables","#/properties/variables"],Dependency:["#/definitions/Dependency","#/$defs/Dependency"],LayoutConfig:["#/definitions/Layout","#/properties/meta/properties/layout"]},Nn=(e,t)=>e.compile({$ref:t,definitions:qe.definitions,properties:qe.properties}),zi=e=>{const t=In(),a=`${e}::${Rn}`,n=kt.get(a);if(n)return n;const y=Nn(t,e);return kt.set(a,y),y},Pe=e=>{const t=In(),a=`type:${e}::${Rn}`,n=kt.get(a);if(n)return n;const y=Vi[e]||[`#/definitions/${e}`,`#/$defs/${e}`];for(const i of y)try{const p=Nn(t,i);return kt.set(a,p),p}catch{}throw new Error(`VALIDATOR_REF_NOT_FOUND:${e}`)},Ce=e=>typeof e=="number"&&isFinite(e)&&e>0,Qt=()=>{const e=globalThis;if(e?.crypto?.randomUUID)return e.crypto.randomUUID();if(e?.crypto?.getRandomValues){const t=new Uint8Array(16);e.crypto.getRandomValues(t),t[6]=t[6]&15|64,t[8]=t[8]&63|128;const a=Array.from(t,n=>n.toString(16).padStart(2,"0"));return`${a[0]}${a[1]}${a[2]}${a[3]}-${a[4]}${a[5]}-${a[6]}${a[7]}-${a[8]}${a[9]}-${a[10]}${a[11]}${a[12]}${a[13]}${a[14]}${a[15]}`}return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const a=Math.random()*16|0;return(t==="x"?a:a&3|8).toString(16)})},Fi=(e,t="https://example.com/resource")=>typeof e=="string"&&/^https?:\/\//.test(e)?e:t,Li=(e,t="wss://example.com/socket")=>typeof e=="string"&&/^wss?:\/\//.test(e)?e:t,It=Pe("DataSourceItem"),Ui=(e,t)=>{const a={...t?.defaults||{}},n={...e};if(t?.generateId&&!n.id&&(n.id=Qt()),!n.type)throw new Error("type is required");return n.type==="rest"?(n.url=Fi(n.url),n.method=n.method||"GET",n.headers=n.headers||{},n.params=n.params||{},n.body=n.body||{},n.pollInterval=Ce(n.pollInterval)?Math.round(n.pollInterval):a.pollInterval??1e3,n.timeout=Ce(n.timeout)?Math.round(n.timeout):a.timeout??1e3):n.type==="websocket"?(n.url=Li(n.url),n.heartbeat&&typeof n.heartbeat=="object"&&(n.heartbeat.interval=Ce(n.heartbeat.interval)?Math.round(n.heartbeat.interval):a.heartbeatInterval??1e3,n.heartbeat.message=n.heartbeat.message??{}),n.pollInterval=Ce(n.pollInterval)?Math.round(n.pollInterval):a.pollInterval??1e3):n.type==="static"?n.value=n.value??{}:n.type==="function"&&(n.code=typeof n.code=="string"?n.code:"export default async function(ctx){ return null }",n.timeout=Ce(n.timeout)?Math.round(n.timeout):a.timeout??1e3),n},Ki=e=>It(e)?{ok:!0}:{ok:!1,errors:It.errors||[]},On=(e,t)=>{debugger;const a=Ui(e,t);return It(a)?{ok:!0,value:a}:{ok:!1,errors:It.errors||[]}},Hi=(e,t)=>{const a=On(e,t);if(!a.ok)throw new Error("VALIDATION_FAILED");return a.value},Rt=Pe("ComponentInstance"),Gi=(e,t)=>{const a={...e};if(t?.generateId&&!a.id&&(a.id=Qt()),!a.role)throw new Error("role is required");if(a.role==="view"){if(!a.component)throw new Error("component is required for view");delete a.children}else if(a.role==="container"){if(!Array.isArray(a.children))throw new Error("children is required for container");delete a.component}else if(a.role==="logic"){if(!a.component)throw new Error("component is required for logic");delete a.children}return a},Ji=e=>Rt(e)?{ok:!0}:{ok:!1,errors:Rt.errors||[]},qn=(e,t)=>{const a=Gi(e,t);return Rt(a)?{ok:!0,value:a}:{ok:!1,errors:Rt.errors||[]}},Wi=(e,t)=>{const a=qn(e,t);if(!a.ok)throw new Error("VALIDATION_FAILED");return a.value},Nt=Pe("CICPage"),Bi=(e,t)=>{const a={...e};return t?.generateId&&!a.id&&(a.id=Qt()),a},Yi=e=>Nt(e)?{ok:!0}:{ok:!1,errors:Nt.errors||[]},Cn=(e,t)=>{const a=Bi(e,t);return Nt(a)?{ok:!0,value:a}:{ok:!1,errors:Nt.errors||[]}},Zi=(e,t)=>{const a=Cn(e,t);if(!a.ok)throw new Error("VALIDATION_FAILED");return a.value},Ot=Pe("Meta"),qt=Pe("Layout"),Qi=e=>Ot(e)?{ok:!0}:{ok:!1,errors:Ot.errors||[]},Xi=e=>qt(e)?{ok:!0}:{ok:!1,errors:qt.errors||[]},Tn=e=>Ot(e)?{ok:!0,value:e}:{ok:!1,errors:Ot.errors||[]},Dn=e=>qt(e)?{ok:!0,value:e}:{ok:!1,errors:qt.errors||[]},xi=e=>{const t=Tn(e);if(!t.ok)throw new Error("VALIDATION_FAILED");return t.value},es=e=>{const t=Dn(e);if(!t.ok)throw new Error("VALIDATION_FAILED");return t.value},Ct=zi("#/definitions/Variables"),ts=e=>Ct(e)?{ok:!0}:{ok:!1,errors:Ct.errors||[]},Mn=e=>Ct(e)?{ok:!0,value:e}:{ok:!1,errors:Ct.errors||[]},rs=e=>{const t=Mn(e);if(!t.ok)throw new Error("VALIDATION_FAILED");return t.value},Tt=Pe("Dependency"),ns=e=>Tt(e)?{ok:!0}:{ok:!1,errors:Tt.errors||[]},An=e=>Tt(e)?{ok:!0,value:e}:{ok:!1,errors:Tt.errors||[]},is=e=>{const t=An(e);if(!t.ok)throw new Error("VALIDATION_FAILED");return t.value},Dt=Pe("RegistryComponents"),ss=e=>Dt(e)?{ok:!0}:{ok:!1,errors:Dt.errors||[]},Vn=e=>Dt(e)?{ok:!0,value:e}:{ok:!1,errors:Dt.errors||[]},os=e=>{const t=Vn(e);if(!t.ok)throw new Error("VALIDATION_FAILED");return t.value};class oe{config;static validator;static validate;static schemaHash;constructor(t){const a=oe.validateConfig(t);if(!a.valid)throw new Error(`Invalid CIC Configuration: ${a.error}`);this.config=t}getConfig(){return this.config}findComponent(t){let a;return this.walkComponents(n=>n.id===t?(a=n,!1):!0),a}findPageByComponent(t){let a;return this.walkComponents((n,y)=>n.id===t?(a=y,!1):!0),a}getVariable(t,a){const n=this.config.variables;if(n){if(t.componentId&&n.component&&n.component[t.componentId]){const y=n.component[t.componentId][a];if(y)return y.value??y.default}if(t.pageId&&n.page&&n.page[t.pageId]){const y=n.page[t.pageId][a];if(y)return y.value??y.default}if(n.global&&n.global[a]){const y=n.global[a];return y.value??y.default}}}getVariableByRef(t){const a=t.match(/^(global|page|component)(?::([^\.]+))?\.(.+)$/);if(!a)return;const[,n,y,i]=a;if(n==="global")return this.getVariable({},i);if(n==="page")return this.getVariable({pageId:y},i);if(n==="component")return this.getVariable({componentId:y},i)}walkComponents(t){if(this.config.pages)for(const a of this.config.pages){const n=[];for(const i of a.components||[])n.push({node:i});let y=!1;for(;n.length>0&&!y;){const{node:i,parent:p}=n.pop();if(t(i,a,p)===!1){y=!0;break}if(i.children&&i.children.length>0)for(let m=i.children.length-1;m>=0;m--)n.push({node:i.children[m],parent:i})}if(y)break}}static validateConfig(t){if(!t)return{valid:!1,error:"Config is null or undefined"};const a=JSON.stringify(qe);return(!oe.validator||oe.schemaHash!==a)&&(oe.validator=new Pn({allErrors:!0,strict:!1}),kn(oe.validator),oe.validator.addFormat("color-hex",/^#[0-9a-fA-F]{6}$/),oe.validate=oe.validator.compile(qe),oe.schemaHash=a),oe.validate(t)?{valid:!0}:{valid:!1,error:oe.validate.errors.map(i=>`${i.instancePath} ${i.message}`).join("; ")}}static getValueByPath(t,a,n){if(t==null||!a)return n;const y=[];a.replace(/\[(\d+)\]/g,".$1").split(".").forEach(p=>{p.trim()&&y.push(p.trim())});let i=t;for(const p of y){if(i==null)return n;i=i[p]}return i===void 0?n:i}static traverseTree(t,a,n){const y=Array.isArray(t)?t:[t];for(const i of y)a(i,n)!==!1&&i.children&&i.children.length>0&&oe.traverseTree(i.children,a,i)}static createDataSource=On;static validateDataSource=Ki;static normalizeDataSource=Hi;static createComponent=qn;static validateComponent=Ji;static normalizeComponent=Wi;static createPage=Cn;static validatePage=Yi;static normalizePage=Zi;static createMeta=Tn;static createLayout=Dn;static validateMeta=Qi;static validateLayout=Xi;static normalizeMeta=xi;static normalizeLayout=es;static createVariables=Mn;static validateVariables=ts;static normalizeVariables=rs;static createDependency=An;static validateDependency=ns;static normalizeDependency=is;static createRegistryComponent=Vn;static validateRegistryComponent=ss;static normalizeRegistryComponent=os}Ee.CICSDK=oe,Object.defineProperty(Ee,Symbol.toStringTag,{value:"Module"})}));
8
+ deps: ${_}}`};const h={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(m){const[b,_]=s(m);p(m,b),u(m,_)}};function s({schema:m}){const b={},_={};for(const k in m){if(k==="__proto__")continue;const $=Array.isArray(m[k])?b:_;$[k]=m[k]}return[b,_]}function p(m,b=m.schema){const{gen:_,data:k,it:$}=m;if(Object.keys(b).length===0)return;const g=_.let("missing");for(const v in b){const w=b[v];if(w.length===0)continue;const c=(0,i.propertyInData)(_,k,v,$.opts.ownProperties);m.setParams({property:v,depsCount:w.length,deps:w.join(", ")}),$.allErrors?_.if(c,()=>{for(const d of w)(0,i.checkReportMissingProp)(m,d)}):(_.if((0,t._)`${c} && (${(0,i.checkMissingProp)(m,w,g)})`),(0,i.reportMissingProp)(m,g),_.else())}}e.validatePropertyDeps=p;function u(m,b=m.schema){const{gen:_,data:k,keyword:$,it:g}=m,v=_.name("valid");for(const w in b)(0,n.alwaysValidSchema)(g,b[w])||(_.if((0,i.propertyInData)(_,k,w,g.opts.ownProperties),()=>{const c=m.subschema({keyword:$,schemaProp:w},v);m.mergeValidEvaluated(c,v)},()=>_.var(v,!0)),m.ok(v))}e.validateSchemaDeps=u,e.default=h})(cr)),cr}var pt={},gn;function Is(){if(gn)return pt;gn=1,Object.defineProperty(pt,"__esModule",{value:!0});const e=J(),t=Z(),i={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:h})=>(0,e._)`{propertyName: ${h.propertyName}}`},code(h){const{gen:s,schema:p,data:u,it:m}=h;if((0,t.alwaysValidSchema)(m,p))return;const b=s.name("valid");s.forIn("key",u,_=>{h.setParams({propertyName:_}),h.subschema({keyword:"propertyNames",data:_,dataTypes:["string"],propertyName:_,compositeRule:!0},b),s.if((0,e.not)(b),()=>{h.error(!0),m.allErrors||s.break()})}),h.ok(b)}};return pt.default=i,pt}var mt={},vn;function _n(){if(vn)return mt;vn=1,Object.defineProperty(mt,"__esModule",{value:!0});const e=me(),t=J(),n=$e(),i=Z(),s={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:p})=>(0,t._)`{additionalProperty: ${p.additionalProperty}}`},code(p){const{gen:u,schema:m,parentSchema:b,data:_,errsCount:k,it:$}=p;if(!k)throw new Error("ajv implementation error");const{allErrors:g,opts:v}=$;if($.props=!0,v.removeAdditional!=="all"&&(0,i.alwaysValidSchema)($,m))return;const w=(0,e.allSchemaProperties)(b.properties),c=(0,e.allSchemaProperties)(b.patternProperties);d(),p.ok((0,t._)`${k} === ${n.default.errors}`);function d(){u.forIn("key",_,f=>{!w.length&&!c.length?y(f):u.if(r(f),()=>y(f))})}function r(f){let P;if(w.length>8){const N=(0,i.schemaRefOrVal)($,b.properties,"properties");P=(0,e.isOwnProperty)(u,N,f)}else w.length?P=(0,t.or)(...w.map(N=>(0,t._)`${f} === ${N}`)):P=t.nil;return c.length&&(P=(0,t.or)(P,...c.map(N=>(0,t._)`${(0,e.usePattern)(p,N)}.test(${f})`))),(0,t.not)(P)}function a(f){u.code((0,t._)`delete ${_}[${f}]`)}function y(f){if(v.removeAdditional==="all"||v.removeAdditional&&m===!1){a(f);return}if(m===!1){p.setParams({additionalProperty:f}),p.error(),g||u.break();return}if(typeof m=="object"&&!(0,i.alwaysValidSchema)($,m)){const P=u.name("valid");v.removeAdditional==="failing"?(o(f,P,!1),u.if((0,t.not)(P),()=>{p.reset(),a(f)})):(o(f,P),g||u.if((0,t.not)(P),()=>u.break()))}}function o(f,P,N){const D={keyword:"additionalProperties",dataProp:f,dataPropType:i.Type.Str};N===!1&&Object.assign(D,{compositeRule:!0,createErrors:!1,allErrors:!1}),p.subschema(D,P)}}};return mt.default=s,mt}var ht={},$n;function Rs(){if($n)return ht;$n=1,Object.defineProperty(ht,"__esModule",{value:!0});const e=Ue(),t=me(),n=Z(),i=_n(),h={keyword:"properties",type:"object",schemaType:"object",code(s){const{gen:p,schema:u,parentSchema:m,data:b,it:_}=s;_.opts.removeAdditional==="all"&&m.additionalProperties===void 0&&i.default.code(new e.KeywordCxt(_,i.default,"additionalProperties"));const k=(0,t.allSchemaProperties)(u);for(const c of k)_.definedProperties.add(c);_.opts.unevaluated&&k.length&&_.props!==!0&&(_.props=n.mergeEvaluated.props(p,(0,n.toHash)(k),_.props));const $=k.filter(c=>!(0,n.alwaysValidSchema)(_,u[c]));if($.length===0)return;const g=p.name("valid");for(const c of $)v(c)?w(c):(p.if((0,t.propertyInData)(p,b,c,_.opts.ownProperties)),w(c),_.allErrors||p.else().var(g,!0),p.endIf()),s.it.definedProperties.add(c),s.ok(g);function v(c){return _.opts.useDefaults&&!_.compositeRule&&u[c].default!==void 0}function w(c){s.subschema({keyword:"properties",schemaProp:c,dataProp:c},g)}}};return ht.default=h,ht}var yt={},bn;function Ns(){if(bn)return yt;bn=1,Object.defineProperty(yt,"__esModule",{value:!0});const e=me(),t=J(),n=Z(),i=Z(),h={keyword:"patternProperties",type:"object",schemaType:"object",code(s){const{gen:p,schema:u,data:m,parentSchema:b,it:_}=s,{opts:k}=_,$=(0,e.allSchemaProperties)(u),g=$.filter(y=>(0,n.alwaysValidSchema)(_,u[y]));if($.length===0||g.length===$.length&&(!_.opts.unevaluated||_.props===!0))return;const v=k.strictSchema&&!k.allowMatchingProperties&&b.properties,w=p.name("valid");_.props!==!0&&!(_.props instanceof t.Name)&&(_.props=(0,i.evaluatedPropsToName)(p,_.props));const{props:c}=_;d();function d(){for(const y of $)v&&r(y),_.allErrors?a(y):(p.var(w,!0),a(y),p.if(w))}function r(y){for(const o in v)new RegExp(y).test(o)&&(0,n.checkStrictMode)(_,`property ${o} matches pattern ${y} (use allowMatchingProperties)`)}function a(y){p.forIn("key",m,o=>{p.if((0,t._)`${(0,e.usePattern)(s,y)}.test(${o})`,()=>{const f=g.includes(y);f||s.subschema({keyword:"patternProperties",schemaProp:y,dataProp:o,dataPropType:i.Type.Str},w),_.opts.unevaluated&&c!==!0?p.assign((0,t._)`${c}[${o}]`,!0):!f&&!_.allErrors&&p.if((0,t.not)(w),()=>p.break())})})}}};return yt.default=h,yt}var gt={},wn;function Os(){if(wn)return gt;wn=1,Object.defineProperty(gt,"__esModule",{value:!0});const e=Z(),t={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(n){const{gen:i,schema:h,it:s}=n;if((0,e.alwaysValidSchema)(s,h)){n.fail();return}const p=i.name("valid");n.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},p),n.failResult(p,()=>n.reset(),()=>n.error())},error:{message:"must NOT be valid"}};return gt.default=t,gt}var vt={},Pn;function Cs(){if(Pn)return vt;Pn=1,Object.defineProperty(vt,"__esModule",{value:!0});const t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:me().validateUnion,error:{message:"must match a schema in anyOf"}};return vt.default=t,vt}var _t={},En;function qs(){if(En)return _t;En=1,Object.defineProperty(_t,"__esModule",{value:!0});const e=J(),t=Z(),i={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:h})=>(0,e._)`{passingSchemas: ${h.passing}}`},code(h){const{gen:s,schema:p,parentSchema:u,it:m}=h;if(!Array.isArray(p))throw new Error("ajv implementation error");if(m.opts.discriminator&&u.discriminator)return;const b=p,_=s.let("valid",!1),k=s.let("passing",null),$=s.name("_valid");h.setParams({passing:k}),s.block(g),h.result(_,()=>h.reset(),()=>h.error(!0));function g(){b.forEach((v,w)=>{let c;(0,t.alwaysValidSchema)(m,v)?s.var($,!0):c=h.subschema({keyword:"oneOf",schemaProp:w,compositeRule:!0},$),w>0&&s.if((0,e._)`${$} && ${_}`).assign(_,!1).assign(k,(0,e._)`[${k}, ${w}]`).else(),s.if($,()=>{s.assign(_,!0),s.assign(k,w),c&&h.mergeEvaluated(c,e.Name)})})}}};return _t.default=i,_t}var $t={},kn;function Ts(){if(kn)return $t;kn=1,Object.defineProperty($t,"__esModule",{value:!0});const e=Z(),t={keyword:"allOf",schemaType:"array",code(n){const{gen:i,schema:h,it:s}=n;if(!Array.isArray(h))throw new Error("ajv implementation error");const p=i.name("valid");h.forEach((u,m)=>{if((0,e.alwaysValidSchema)(s,u))return;const b=n.subschema({keyword:"allOf",schemaProp:m},p);n.ok(p),n.mergeEvaluated(b)})}};return $t.default=t,$t}var bt={},Sn;function Ds(){if(Sn)return bt;Sn=1,Object.defineProperty(bt,"__esModule",{value:!0});const e=J(),t=Z(),i={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:s})=>(0,e.str)`must match "${s.ifClause}" schema`,params:({params:s})=>(0,e._)`{failingKeyword: ${s.ifClause}}`},code(s){const{gen:p,parentSchema:u,it:m}=s;u.then===void 0&&u.else===void 0&&(0,t.checkStrictMode)(m,'"if" without "then" and "else" is ignored');const b=h(m,"then"),_=h(m,"else");if(!b&&!_)return;const k=p.let("valid",!0),$=p.name("_valid");if(g(),s.reset(),b&&_){const w=p.let("ifClause");s.setParams({ifClause:w}),p.if($,v("then",w),v("else",w))}else b?p.if($,v("then")):p.if((0,e.not)($),v("else"));s.pass(k,()=>s.error(!0));function g(){const w=s.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},$);s.mergeEvaluated(w)}function v(w,c){return()=>{const d=s.subschema({keyword:w},$);p.assign(k,$),s.mergeValidEvaluated(d,k),c?p.assign(c,(0,e._)`${w}`):s.setParams({ifClause:w})}}}};function h(s,p){const u=s.schema[p];return u!==void 0&&!(0,t.alwaysValidSchema)(s,u)}return bt.default=i,bt}var wt={},jn;function Ms(){if(jn)return wt;jn=1,Object.defineProperty(wt,"__esModule",{value:!0});const e=Z(),t={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:n,parentSchema:i,it:h}){i.if===void 0&&(0,e.checkStrictMode)(h,`"${n}" without "if" is ignored`)}};return wt.default=t,wt}var In;function As(){if(In)return dt;In=1,Object.defineProperty(dt,"__esModule",{value:!0});const e=un(),t=Es(),n=fn(),i=ks(),h=Ss(),s=js(),p=Is(),u=_n(),m=Rs(),b=Ns(),_=Os(),k=Cs(),$=qs(),g=Ts(),v=Ds(),w=Ms();function c(d=!1){const r=[_.default,k.default,$.default,g.default,v.default,w.default,p.default,u.default,s.default,m.default,b.default];return d?r.push(t.default,i.default):r.push(e.default,n.default),r.push(h.default),r}return dt.default=c,dt}var Pt={},Et={},Rn;function Vs(){if(Rn)return Et;Rn=1,Object.defineProperty(Et,"__esModule",{value:!0});const e=J(),n={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:i})=>(0,e.str)`must match format "${i}"`,params:({schemaCode:i})=>(0,e._)`{format: ${i}}`},code(i,h){const{gen:s,data:p,$data:u,schema:m,schemaCode:b,it:_}=i,{opts:k,errSchemaPath:$,schemaEnv:g,self:v}=_;if(!k.validateFormats)return;u?w():c();function w(){const d=s.scopeValue("formats",{ref:v.formats,code:k.code.formats}),r=s.const("fDef",(0,e._)`${d}[${b}]`),a=s.let("fType"),y=s.let("format");s.if((0,e._)`typeof ${r} == "object" && !(${r} instanceof RegExp)`,()=>s.assign(a,(0,e._)`${r}.type || "string"`).assign(y,(0,e._)`${r}.validate`),()=>s.assign(a,(0,e._)`"string"`).assign(y,r)),i.fail$data((0,e.or)(o(),f()));function o(){return k.strictSchema===!1?e.nil:(0,e._)`${b} && !${y}`}function f(){const P=g.$async?(0,e._)`(${r}.async ? await ${y}(${p}) : ${y}(${p}))`:(0,e._)`${y}(${p})`,N=(0,e._)`(typeof ${y} == "function" ? ${P} : ${y}.test(${p}))`;return(0,e._)`${y} && ${y} !== true && ${a} === ${h} && !${N}`}}function c(){const d=v.formats[m];if(!d){o();return}if(d===!0)return;const[r,a,y]=f(d);r===h&&i.pass(P());function o(){if(k.strictSchema===!1){v.logger.warn(N());return}throw new Error(N());function N(){return`unknown format "${m}" ignored in schema at path "${$}"`}}function f(N){const D=N instanceof RegExp?(0,e.regexpCode)(N):k.code.formats?(0,e._)`${k.code.formats}${(0,e.getProperty)(m)}`:void 0,z=s.scopeValue("formats",{key:m,ref:N,code:D});return typeof N=="object"&&!(N instanceof RegExp)?[N.type||"string",N.validate,(0,e._)`${z}.validate`]:["string",N,z]}function P(){if(typeof d=="object"&&!(d instanceof RegExp)&&d.async){if(!g.$async)throw new Error("async format in sync schema");return(0,e._)`await ${y}(${p})`}return typeof a=="function"?(0,e._)`${y}(${p})`:(0,e._)`${y}.test(${p})`}}}};return Et.default=n,Et}var Nn;function zs(){if(Nn)return Pt;Nn=1,Object.defineProperty(Pt,"__esModule",{value:!0});const t=[Vs().default];return Pt.default=t,Pt}var Ee={},On;function Fs(){return On||(On=1,Object.defineProperty(Ee,"__esModule",{value:!0}),Ee.contentVocabulary=Ee.metadataVocabulary=void 0,Ee.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],Ee.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]),Ee}var Cn;function Ls(){if(Cn)return We;Cn=1,Object.defineProperty(We,"__esModule",{value:!0});const e=ls(),t=Ps(),n=As(),i=zs(),h=Fs(),s=[e.default,t.default,(0,n.default)(),i.default,h.metadataVocabulary,h.contentVocabulary];return We.default=s,We}var kt={},Ce={},qn;function Us(){if(qn)return Ce;qn=1,Object.defineProperty(Ce,"__esModule",{value:!0}),Ce.DiscrError=void 0;var e;return(function(t){t.Tag="tag",t.Mapping="mapping"})(e||(Ce.DiscrError=e={})),Ce}var Tn;function Ks(){if(Tn)return kt;Tn=1,Object.defineProperty(kt,"__esModule",{value:!0});const e=J(),t=Us(),n=sr(),i=Ge(),h=Z(),p={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:u,tagName:m}})=>u===t.DiscrError.Tag?`tag "${m}" must be string`:`value of tag "${m}" must be in oneOf`,params:({params:{discrError:u,tag:m,tagName:b}})=>(0,e._)`{error: ${u}, tag: ${b}, tagValue: ${m}}`},code(u){const{gen:m,data:b,schema:_,parentSchema:k,it:$}=u,{oneOf:g}=k;if(!$.opts.discriminator)throw new Error("discriminator: requires discriminator option");const v=_.propertyName;if(typeof v!="string")throw new Error("discriminator: requires propertyName");if(_.mapping)throw new Error("discriminator: mapping is not supported");if(!g)throw new Error("discriminator: requires oneOf keyword");const w=m.let("valid",!1),c=m.const("tag",(0,e._)`${b}${(0,e.getProperty)(v)}`);m.if((0,e._)`typeof ${c} == "string"`,()=>d(),()=>u.error(!1,{discrError:t.DiscrError.Tag,tag:c,tagName:v})),u.ok(w);function d(){const y=a();m.if(!1);for(const o in y)m.elseIf((0,e._)`${c} === ${o}`),m.assign(w,r(y[o]));m.else(),u.error(!1,{discrError:t.DiscrError.Mapping,tag:c,tagName:v}),m.endIf()}function r(y){const o=m.name("valid"),f=u.subschema({keyword:"oneOf",schemaProp:y},o);return u.mergeEvaluated(f,e.Name),o}function a(){var y;const o={},f=N(k);let P=!0;for(let C=0;C<g.length;C++){let V=g[C];if(V?.$ref&&!(0,h.schemaHasRulesButRef)(V,$.self.RULES)){const L=V.$ref;if(V=n.resolveRef.call($.self,$.schemaEnv.root,$.baseId,L),V instanceof n.SchemaEnv&&(V=V.schema),V===void 0)throw new i.default($.opts.uriResolver,$.baseId,L)}const F=(y=V?.properties)===null||y===void 0?void 0:y[v];if(typeof F!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${v}"`);P=P&&(f||N(V)),D(F,C)}if(!P)throw new Error(`discriminator: "${v}" must be required`);return o;function N({required:C}){return Array.isArray(C)&&C.includes(v)}function D(C,V){if(C.const)z(C.const,V);else if(C.enum)for(const F of C.enum)z(F,V);else throw new Error(`discriminator: "properties/${v}" must have "const" or "enum"`)}function z(C,V){if(typeof C!="string"||C in o)throw new Error(`discriminator: "${v}" values must be unique strings`);o[C]=V}}}};return kt.default=p,kt}const Hs={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{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:[]}},type:["object","boolean"],properties:{$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:"#"}},default:!0};var Dn;function Mn(){return Dn||(Dn=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;const n=cs(),i=Ls(),h=Ks(),s=Hs,p=["/properties"],u="http://json-schema.org/draft-07/schema";class m extends n.default{_addVocabularies(){super._addVocabularies(),i.default.forEach(v=>this.addVocabulary(v)),this.opts.discriminator&&this.addKeyword(h.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const v=this.opts.$data?this.$dataMetaSchema(s,p):s;this.addMetaSchema(v,u,!1),this.refs["http://json-schema.org/schema"]=u}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(u)?u:void 0)}}t.Ajv=m,e.exports=t=m,e.exports.Ajv=m,Object.defineProperty(t,"__esModule",{value:!0}),t.default=m;var b=Ue();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return b.KeywordCxt}});var _=J();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return _._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return _.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return _.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return _.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return _.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return _.CodeGen}});var k=nr();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return k.default}});var $=Ge();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return $.default}})})(Me,Me.exports)),Me.exports}var Gs=Mn();const An=Se(Gs);var St={exports:{}},dr={},Vn;function Js(){return Vn||(Vn=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(C,V){return{validate:C,compare:V}}e.fullFormats={date:t(s,p),time:t(m(!0),b),"date-time":t($(!0),g),"iso-time":t(m(),_),"iso-date-time":t($(),v),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:d,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:z,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:a,int32:{type:"number",validate:f},int64:{type:"number",validate:P},float:{type:"number",validate:N},double:{type:"number",validate:N},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,p),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,b),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,g),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,_),"iso-date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,v),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);function n(C){return C%4===0&&(C%100!==0||C%400===0)}const i=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,h=[0,31,28,31,30,31,30,31,31,30,31,30,31];function s(C){const V=i.exec(C);if(!V)return!1;const F=+V[1],L=+V[2],X=+V[3];return L>=1&&L<=12&&X>=1&&X<=(L===2&&n(F)?29:h[L])}function p(C,V){if(C&&V)return C>V?1:C<V?-1:0}const u=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function m(C){return function(F){const L=u.exec(F);if(!L)return!1;const X=+L[1],ae=+L[2],ce=+L[3],ee=L[4],he=L[5]==="-"?-1:1,M=+(L[6]||0),j=+(L[7]||0);if(M>23||j>59||C&&!ee)return!1;if(X<=23&&ae<=59&&ce<60)return!0;const T=ae-j*he,R=X-M*he-(T<0?1:0);return(R===23||R===-1)&&(T===59||T===-1)&&ce<61}}function b(C,V){if(!(C&&V))return;const F=new Date("2020-01-01T"+C).valueOf(),L=new Date("2020-01-01T"+V).valueOf();if(F&&L)return F-L}function _(C,V){if(!(C&&V))return;const F=u.exec(C),L=u.exec(V);if(F&&L)return C=F[1]+F[2]+F[3],V=L[1]+L[2]+L[3],C>V?1:C<V?-1:0}const k=/t|\s/i;function $(C){const V=m(C);return function(L){const X=L.split(k);return X.length===2&&s(X[0])&&V(X[1])}}function g(C,V){if(!(C&&V))return;const F=new Date(C).valueOf(),L=new Date(V).valueOf();if(F&&L)return F-L}function v(C,V){if(!(C&&V))return;const[F,L]=C.split(k),[X,ae]=V.split(k),ce=p(F,X);if(ce!==void 0)return ce||b(L,ae)}const w=/\/|:/,c=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function d(C){return w.test(C)&&c.test(C)}const r=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function a(C){return r.lastIndex=0,r.test(C)}const y=-2147483648,o=2**31-1;function f(C){return Number.isInteger(C)&&C<=o&&C>=y}function P(C){return Number.isInteger(C)}function N(){return!0}const D=/[^\\]\\Z/;function z(C){if(D.test(C))return!1;try{return new RegExp(C),!0}catch{return!1}}})(dr)),dr}var ur={},zn;function Ws(){return zn||(zn=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const t=Mn(),n=J(),i=n.operators,h={formatMaximum:{okStr:"<=",ok:i.LTE,fail:i.GT},formatMinimum:{okStr:">=",ok:i.GTE,fail:i.LT},formatExclusiveMaximum:{okStr:"<",ok:i.LT,fail:i.GTE},formatExclusiveMinimum:{okStr:">",ok:i.GT,fail:i.LTE}},s={message:({keyword:u,schemaCode:m})=>(0,n.str)`should be ${h[u].okStr} ${m}`,params:({keyword:u,schemaCode:m})=>(0,n._)`{comparison: ${h[u].okStr}, limit: ${m}}`};e.formatLimitDefinition={keyword:Object.keys(h),type:"string",schemaType:"string",$data:!0,error:s,code(u){const{gen:m,data:b,schemaCode:_,keyword:k,it:$}=u,{opts:g,self:v}=$;if(!g.validateFormats)return;const w=new t.KeywordCxt($,v.RULES.all.format.definition,"format");w.$data?c():d();function c(){const a=m.scopeValue("formats",{ref:v.formats,code:g.code.formats}),y=m.const("fmt",(0,n._)`${a}[${w.schemaCode}]`);u.fail$data((0,n.or)((0,n._)`typeof ${y} != "object"`,(0,n._)`${y} instanceof RegExp`,(0,n._)`typeof ${y}.compare != "function"`,r(y)))}function d(){const a=w.schema,y=v.formats[a];if(!y||y===!0)return;if(typeof y!="object"||y instanceof RegExp||typeof y.compare!="function")throw new Error(`"${k}": format "${a}" does not define "compare" function`);const o=m.scopeValue("formats",{key:a,ref:y,code:g.code.formats?(0,n._)`${g.code.formats}${(0,n.getProperty)(a)}`:void 0});u.fail$data(r(o))}function r(a){return(0,n._)`${a}.compare(${b}, ${_}) ${h[k].fail} 0`}},dependencies:["format"]};const p=u=>(u.addKeyword(e.formatLimitDefinition),u);e.default=p})(ur)),ur}var Fn;function Bs(){return Fn||(Fn=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const n=Js(),i=Ws(),h=J(),s=new h.Name("fullFormats"),p=new h.Name("fastFormats"),u=(b,_={keywords:!0})=>{if(Array.isArray(_))return m(b,_,n.fullFormats,s),b;const[k,$]=_.mode==="fast"?[n.fastFormats,p]:[n.fullFormats,s],g=_.formats||n.formatNames;return m(b,g,k,$),_.keywords&&(0,i.default)(b),b};u.get=(b,_="full")=>{const $=(_==="fast"?n.fastFormats:n.fullFormats)[b];if(!$)throw new Error(`Unknown format "${b}"`);return $};function m(b,_,k,$){var g,v;(g=(v=b.opts.code).formats)!==null&&g!==void 0||(v.formats=(0,h._)`require("ajv-formats/dist/formats").${$}`);for(const w of _)b.addFormat(w,k[w])}e.exports=t=u,Object.defineProperty(t,"__esModule",{value:!0}),t.default=u})(St,St.exports)),St.exports}var Ys=Bs();const Ln=Se(Ys),qe={$schema:"http://json-schema.org/draft-07/schema#",$ref:"#/definitions/CICConfig",definitions:JSON.parse('{"CICConfig":{"type":"object","properties":{"version":{"type":"string"},"meta":{"$ref":"#/definitions/Meta"},"pages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"path":{"type":"string"},"layout":{"$ref":"#/definitions/Layout"},"components":{"type":"array","items":{"$ref":"#/definitions/ComponentInstance"}},"dataSources":{"type":"array","items":{"$ref":"#/definitions/DataSourceItem"}},"extensions":{"type":"object"}},"required":["id","name","path"],"additionalProperties":false,"description":"CIC 页面定义 说明:定义了 CIC 中页面的结构,包含页面 ID、名称、路径、布局、组件等。"}},"registry":{"$ref":"#/definitions/Registry"},"variables":{"$ref":"#/definitions/Variables"},"deps":{"type":"array","items":{"$ref":"#/definitions/Dependency"}},"extensions":{"type":"object"}},"required":["version","meta","pages"],"additionalProperties":false,"description":"CIC 配置定义 说明:定义了 CIC 项目的全局配置,包含版本、元数据、页面、组件、变量、依赖等。"},"Meta":{"type":"object","properties":{"projectId":{"type":"string","description":"项目唯一标识符"},"projectName":{"type":"string","description":"项目名称"},"description":{"type":"string","description":"项目描述"},"layout":{"$ref":"#/definitions/Layout","description":"布局配置"},"language":{"type":"string","description":"语言代码 (e.g. zh-CN, en-US)"},"createTime":{"type":"string","description":"创建时间 (ISO 8601)","format":"date-time"},"updateTime":{"type":"string","description":"更新时间 (ISO 8601)","format":"date-time"},"author":{"type":"string","description":"作者"},"extensions":{"type":"object","description":"扩展字段"}},"additionalProperties":false,"description":"项目元信息 包含项目的基本信息、布局配置、语言、创建时间、更新时间、作者和扩展信息。"},"Layout":{"type":"object","properties":{"type":{"type":"string","enum":["free","grid"],"description":"布局类型: free(自由布局) 或 grid(网格布局)"},"config":{"type":"object","properties":{"width":{"type":"number","description":"设计稿宽度","minimum":1,"default":1920},"height":{"type":"number","description":"设计稿高度","minimum":1,"default":1080},"scaleMode":{"type":"string","enum":["aspectFit","fill"],"description":"缩放模式","default":"aspectFit"}},"required":["width","height","scaleMode"],"additionalProperties":false}},"required":["type","config"],"additionalProperties":false,"description":"布局配置"},"ComponentInstance":{"anyOf":[{"$ref":"#/definitions/ViewComponentInstance"},{"$ref":"#/definitions/ContainerComponentInstance"},{"$ref":"#/definitions/LogicComponentInstanceRef"}],"description":"组件实例(view/container/logic 类型)"},"ViewComponentInstance":{"type":"object","properties":{"id":{"type":"string"},"props":{"type":"object"},"style":{"type":"object","additionalProperties":{"$ref":"#/definitions/StyleValue"}},"events":{"$ref":"#/definitions/CICEventMap"},"data":{"$ref":"#/definitions/Data"},"deps":{"type":"array","items":{"type":"string"}},"extensions":{"type":"object"},"role":{"type":"string","const":"view"},"component":{"$ref":"#/definitions/ComponentRef"}},"required":["component","id","role"],"additionalProperties":false},"StyleValue":{"anyOf":[{"type":"string"},{"type":"number"},{"$ref":"#/definitions/Expr"}],"description":"样式值可以是静态或表达式"},"Expr":{"type":"string","description":"通用表达式(用于条件、模板等)"},"CICEventMap":{"type":"object","additionalProperties":{"type":"array","items":{"$ref":"#/definitions/CICEventWithMeta"}},"description":"某组件的所有事件 说明:定义了 CIC 项目中组件的所有事件,包含事件类型、动作、参数、调度顺序、延迟时间和条件。 (key: 事件名, value: 处理逻辑数组)"},"CICEventWithMeta":{"anyOf":[{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"vars"},"action":{"$ref":"#/definitions/VarsAction"},"params":{"$ref":"#/definitions/VarsParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"navigate"},"action":{"type":"string","const":"internal"},"params":{"$ref":"#/definitions/NavigateInternalParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"navigate"},"action":{"type":"string","const":"external"},"params":{"$ref":"#/definitions/NavigateExternalParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"comp"},"action":{"$ref":"#/definitions/CompAction"},"params":{"$ref":"#/definitions/CompParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"toggle"},"action":{"type":"string","const":"visibility"},"params":{"$ref":"#/definitions/ToggleParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"camera"},"action":{"type":"string","const":"focus"},"params":{"$ref":"#/definitions/CameraFocusParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"material"},"action":{"type":"string","const":"change"},"params":{"$ref":"#/definitions/MaterialChangeParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"custom"},"action":{"type":"string","const":"local"},"params":{"$ref":"#/definitions/CustomLocalParams"}},"required":["action","order","params","type"]},{"type":"object","additionalProperties":false,"properties":{"order":{"type":"number"},"delay":{"type":"number"},"condition":{"$ref":"#/definitions/EventCondition"},"type":{"type":"string","const":"custom"},"action":{"type":"string","const":"remote"},"params":{"$ref":"#/definitions/CustomRemoteParams"}},"required":["action","order","params","type"]}],"description":"带调度信息"},"EventCondition":{"anyOf":[{"$ref":"#/definitions/KeyCondition"},{"type":"array","items":{"$ref":"#/definitions/KeyCondition"}},{"$ref":"#/definitions/ExpressionCondition"}],"description":"多条件(AND) + 表达式"},"KeyCondition":{"type":"object","properties":{"key":{"type":"string"},"op":{"$ref":"#/definitions/ConditionOperator"},"value":{}},"required":["key"],"additionalProperties":false},"ConditionOperator":{"type":"string","enum":["eq","neq","gt","gte","lt","lte","in","not-in","exists","not-exists"]},"ExpressionCondition":{"type":"object","properties":{"expression":{"type":"string"}},"required":["expression"],"additionalProperties":false,"description":"表达式条件:支持如 \\"ctx.id === 5 && ctx.level > 1\\""},"VarsAction":{"type":"string","enum":["add","update","delete"],"description":"变量事件动作"},"VarsParams":{"type":"object","properties":{"key":{"type":"string"},"value":{},"exclude":{"type":"array","items":{"type":"string"}}},"required":["key","value"],"additionalProperties":false},"NavigateInternalParams":{"type":"object","properties":{"name":{"type":"string"},"params":{"type":"object"}},"required":["name"],"additionalProperties":false},"NavigateExternalParams":{"type":"object","properties":{"url":{"type":"string"},"openNewTab":{"type":"boolean"}},"required":["url"],"additionalProperties":false},"CompAction":{"type":"string","enum":["add","update","delete"],"description":"组件事件动作"},"CompParams":{"type":"object","properties":{"comps":{"type":"array","items":{"type":"string"}},"props":{"type":"object"}},"required":["comps"],"additionalProperties":false},"ToggleParams":{"type":"object","properties":{"show":{"type":"array","items":{"type":"string"}},"hide":{"type":"array","items":{"type":"string"}}},"additionalProperties":false},"CameraFocusParams":{"type":"object","properties":{"target":{"type":["string","number"]},"duration":{"type":"number"}},"required":["target"],"additionalProperties":false},"MaterialChangeParams":{"type":"object","properties":{"target":{"type":"string"},"materials":{"type":"string"}},"required":["target","materials"],"additionalProperties":false},"CustomLocalParams":{"type":"object","properties":{"code":{"type":"string"},"depends":{"type":"array","items":{"type":"string"}}},"required":["code"],"additionalProperties":false},"CustomRemoteParams":{"type":"object","properties":{"url":{"type":"string"},"depends":{"type":"array","items":{"type":"string"}}},"required":["url"],"additionalProperties":false},"Data":{"type":"object","properties":{"id":{"type":"string","description":"数据ID"},"mapping":{"$ref":"#/definitions/IMapping","description":"字段映射配置"},"converse":{"$ref":"#/definitions/IConverse","description":"转换规则配置"}},"required":["id"],"additionalProperties":false,"description":"数据配置"},"IMapping":{"type":"object","properties":{"use":{"type":"boolean"},"mapFields":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string","description":"源字段名"},"mapField":{"type":"string","description":"目标字段名"},"value":{"description":"映射值或公式"},"type":{"type":"string","enum":["copy","const","formula"],"description":"映射类型:默认(普通映射)、copy(复制) const(常量)、formula(公式)"},"description":{"type":"string","description":"描述"}},"required":["field","mapField"],"additionalProperties":false}}},"required":["use","mapFields"],"additionalProperties":false,"description":"字段映射配置"},"IConverse":{"type":"object","properties":{"use":{"type":"boolean"},"data":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","description":"转换代码"},"depeedVars":{"type":"array","items":{"type":"string"},"description":"依赖变量列表(用于响应式重执行)"}},"required":["code"],"additionalProperties":false}}},"required":["use","data"],"additionalProperties":false,"description":"转换规则配置"},"ComponentRef":{"anyOf":[{"type":"string"},{"type":"object","properties":{"type":{"type":"string","const":"id"},"value":{"type":"string"}},"required":["type","value"],"additionalProperties":false}],"description":"component 引用:字符串或 object 描述"},"ContainerComponentInstance":{"type":"object","properties":{"id":{"type":"string"},"props":{"type":"object"},"style":{"type":"object","additionalProperties":{"$ref":"#/definitions/StyleValue"}},"events":{"$ref":"#/definitions/CICEventMap"},"data":{"$ref":"#/definitions/Data"},"deps":{"type":"array","items":{"type":"string"}},"extensions":{"type":"object"},"role":{"type":"string","const":"container"},"children":{"type":"array","items":{"$ref":"#/definitions/ComponentInstance"}}},"required":["children","id","role"],"additionalProperties":false},"LogicComponentInstanceRef":{"type":"object","properties":{"id":{"type":"string"},"props":{"type":"object"},"style":{"type":"object","additionalProperties":{"$ref":"#/definitions/StyleValue"}},"events":{"$ref":"#/definitions/CICEventMap"},"data":{"$ref":"#/definitions/Data"},"deps":{"type":"array","items":{"type":"string"}},"extensions":{"type":"object"},"role":{"type":"string","const":"logic"},"component":{"$ref":"#/definitions/LogicRef"}},"required":["component","id","role"],"additionalProperties":false},"LogicRef":{"anyOf":[{"type":"string"},{"type":"object","properties":{"type":{"type":"string","enum":["url","code"]},"value":{"type":"string"}},"required":["type","value"],"additionalProperties":false}]},"DataSourceItem":{"anyOf":[{"$ref":"#/definitions/DataSourceRest"},{"$ref":"#/definitions/DataSourceWebSocket"},{"$ref":"#/definitions/DataSourceStatic"},{"$ref":"#/definitions/DataSourceFunction"}],"description":"数据源项(rest/websocket/static/function 类型)"},"DataSourceRest":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"rest"},"order":{"type":"number"},"pollInterval":{"$ref":"#/definitions/Milliseconds"},"transform":{"anyOf":[{"type":"string"},{"$comment":"(res: any) => any","type":"object","properties":{"namedArgs":{"type":"object","properties":{"res":{}},"required":["res"],"additionalProperties":false}}}]},"url":{"type":"string"},"method":{"type":"string","enum":["GET","POST","PUT","DELETE"]},"headers":{"type":"object","additionalProperties":{"type":"string"}},"params":{"type":"object"},"body":{},"timeout":{"$ref":"#/definitions/Milliseconds"}},"required":["id","method","type","url"],"additionalProperties":false},"Milliseconds":{"type":"number"},"DataSourceWebSocket":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"websocket"},"order":{"type":"number"},"pollInterval":{"$ref":"#/definitions/Milliseconds"},"transform":{"anyOf":[{"type":"string"},{"$comment":"(res: any) => any","type":"object","properties":{"namedArgs":{"type":"object","properties":{"res":{}},"required":["res"],"additionalProperties":false}}}]},"url":{"type":"string"},"protocols":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"subscribeMessage":{},"heartbeat":{"type":"object","properties":{"interval":{"$ref":"#/definitions/Milliseconds"},"message":{}},"required":["interval","message"],"additionalProperties":false}},"required":["id","type","url"],"additionalProperties":false},"DataSourceStatic":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"static"},"order":{"type":"number"},"pollInterval":{"$ref":"#/definitions/Milliseconds"},"transform":{"anyOf":[{"type":"string"},{"$comment":"(res: any) => any","type":"object","properties":{"namedArgs":{"type":"object","properties":{"res":{}},"required":["res"],"additionalProperties":false}}}]},"value":{}},"required":["id","type","value"],"additionalProperties":false},"DataSourceFunction":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","const":"function"},"order":{"type":"number"},"pollInterval":{"$ref":"#/definitions/Milliseconds"},"transform":{"anyOf":[{"type":"string"},{"$comment":"(res: any) => any","type":"object","properties":{"namedArgs":{"type":"object","properties":{"res":{}},"required":["res"],"additionalProperties":false}}}]},"code":{"type":"string"},"timeout":{"$ref":"#/definitions/Milliseconds"}},"required":["code","id","type"],"additionalProperties":false},"Registry":{"type":"object","properties":{"components":{"type":"array","items":{"$ref":"#/definitions/RegistryComponents"}},"plugins":{"type":"object","description":"插件后期可扩展"}},"additionalProperties":false,"description":"注册表"},"RegistryComponents":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"version":{"type":"string"},"author":{"type":"string"},"defaultProps":{"type":"object"},"data":{},"deps":{"type":"array","items":{"type":"string"}}},"required":["id"],"additionalProperties":false,"description":"注册中心组件项 说明:定义了 CIC 项目中组件注册中心的组件项,包含组件 ID、类型和配置。"},"Variables":{"type":"object","properties":{"global":{"$ref":"#/definitions/VariablesMap","description":"全局变量,对所有页面和组件均生效。"},"page":{"type":"object","additionalProperties":{"$ref":"#/definitions/VariablesMap"},"description":"页面级变量,键为页面 ID,值为该页面的变量映射。"},"component":{"type":"object","additionalProperties":{"$ref":"#/definitions/VariablesMap"},"description":"组件级变量,键为组件 ID,值为该组件的变量映射。"}},"additionalProperties":false,"description":"变量集合,按作用域组织:global/page/component。"},"VariablesMap":{"type":"object","additionalProperties":{"$ref":"#/definitions/Variable"},"description":"变量映射,键为变量名,值为变量定义。"},"Variable":{"anyOf":[{"$ref":"#/definitions/StringVariable"},{"$ref":"#/definitions/NumberVariable"},{"$ref":"#/definitions/BooleanVariable"},{"$ref":"#/definitions/ArrayVariable"},{"$ref":"#/definitions/FunctionVariable"},{"$ref":"#/definitions/ObjectVariable"}],"description":"变量联合类型,涵盖五类变量定义。"},"StringVariable":{"type":"object","properties":{"type":{"type":"string","const":"string"},"value":{"type":"string"},"default":{"type":"string"},"description":{"type":"string"}},"required":["type","value","default"],"additionalProperties":false,"description":"字符串变量,包含当前值与默认值,可选描述。"},"NumberVariable":{"type":"object","properties":{"type":{"type":"string","const":"number"},"value":{"type":"number"},"default":{"type":"number"},"description":{"type":"string"}},"required":["type","value","default"],"additionalProperties":false,"description":"数字变量,包含当前值与默认值,可选描述。"},"BooleanVariable":{"type":"object","properties":{"type":{"type":"string","const":"boolean"},"value":{"type":"boolean"},"default":{"type":"boolean"},"description":{"type":"string"}},"required":["type","value","default"],"additionalProperties":false,"description":"布尔变量,包含当前值与默认值,可选描述。"},"ArrayVariable":{"type":"object","properties":{"type":{"type":"string","const":"array"},"value":{"type":"array","items":{}},"default":{"type":"array","items":{}},"description":{"type":"string"}},"required":["type","value","default"],"additionalProperties":false,"description":"数组变量,元素类型不做限制,包含当前值与默认值,可选描述。"},"FunctionVariable":{"type":"object","properties":{"type":{"type":"string","const":"function"},"value":{"type":"string"},"default":{"type":"string"},"description":{"type":"string"},"args":{"type":"array","items":{"type":"string"}}},"required":["type","value","default"],"additionalProperties":false,"description":"函数变量,以字符串保存函数实现;支持 `args` 指定入参名列表。"},"ObjectVariable":{"type":"object","properties":{"type":{"type":"string","const":"object"},"value":{"type":"object","additionalProperties":{"$ref":"#/definitions/Variable"}},"default":{"type":"object","additionalProperties":{"$ref":"#/definitions/Variable"}},"description":{"type":"string"}},"required":["type","value","default"],"additionalProperties":false,"description":"对象变量,键到变量的映射;支持递归嵌套。"},"Dependency":{"anyOf":[{"$ref":"#/definitions/JSDependency"},{"$ref":"#/definitions/CSSDependency"},{"$ref":"#/definitions/FontDependency"},{"$ref":"#/definitions/ImageDependency"},{"$ref":"#/definitions/JSONDependency"},{"$ref":"#/definitions/WasmDependency"},{"$ref":"#/definitions/OtherDependency"}],"description":"依赖项"},"JSDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"js"},"format":{"$ref":"#/definitions/JSFormat"},"crossOrigin":{"type":"string","enum":["anonymous","use-credentials"]},"module":{"type":"boolean"}},"required":["format","id","type"],"additionalProperties":false,"description":"JS 资源"},"JSFormat":{"type":"string","enum":["esm","umd","iife","cjs"],"description":"JS 格式"},"CSSDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"css"},"media":{"type":"string"}},"required":["id","type"],"additionalProperties":false,"description":"CSS"},"FontDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"font"},"family":{"type":"string"},"weight":{"type":["number","string"]},"style":{"type":"string","enum":["normal","italic"]}},"required":["id","type"],"additionalProperties":false,"description":"字体"},"ImageDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"image"},"mime":{"type":"string"}},"required":["id","type"],"additionalProperties":false,"description":"图片"},"JSONDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"json"}},"required":["id","type"],"additionalProperties":false,"description":"JSON"},"WasmDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"wasm"},"init":{"type":"string","enum":["async","sync"]}},"required":["id","type"],"additionalProperties":false,"description":"WASM"},"OtherDependency":{"type":"object","properties":{"id":{"type":"string","description":"全局唯一 ID,用于运行时索引"},"name":{"type":"string","description":"可选:人类可读名称(展示用)"},"version":{"type":"string","description":"版本号(语义化版本 / 字体权重皆可)"},"url":{"type":"string","description":"资源 URL,可以是绝对地址或相对地址"},"localPath":{"type":"string","description":"本地路径(构建后使用)"},"group":{"type":"string","description":"分组:方便批量加载"},"strategy":{"type":"object","properties":{"preload":{"anyOf":[{"type":"boolean"},{"type":"string","const":"module"},{"type":"string","const":"style"}],"description":"预加载/预取"},"prefetch":{"type":"boolean"},"async":{"type":"boolean","description":"是否异步加载"},"when":{"type":"string","description":"仅在某些条件下加载(如主题)"}},"additionalProperties":false,"description":"加载策略"},"type":{"type":"string","const":"other"},"kind":{"type":"string"}},"required":["id","type"],"additionalProperties":false,"description":"其他"}}')},Te=e=>typeof e=="number"&&isFinite(e)&&e>0,lr=()=>{const e=globalThis;if(e?.crypto?.randomUUID)return e.crypto.randomUUID();if(e?.crypto?.getRandomValues){const t=new Uint8Array(16);e.crypto.getRandomValues(t),t[6]=t[6]&15|64,t[8]=t[8]&63|128;const n=Array.from(t,i=>i.toString(16).padStart(2,"0"));return`${n[0]}${n[1]}${n[2]}${n[3]}-${n[4]}${n[5]}-${n[6]}${n[7]}-${n[8]}${n[9]}-${n[10]}${n[11]}${n[12]}${n[13]}${n[14]}${n[15]}`}return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const n=Math.random()*16|0;return(t==="x"?n:n&3|8).toString(16)})},G=e=>Array.isArray(e)?e.map(t=>{const n=t.instancePath||"",i=t.keyword,h=t.params||{};let s=t.message||"";if(i==="required"&&h.missingProperty&&(s=`缺少必填字段:${h.missingProperty}`),i==="type"&&t.schema&&(s=`类型必须为:${t.schema}`),i==="enum"){const p=Array.isArray(h.allowedValues)?h.allowedValues:void 0;s=p?`取值必须为枚举之一:${p.join(", ")}`:"取值必须为枚举之一"}if(i==="const"){const p=h.allowedValue;s=p!==void 0?`取值必须为:${JSON.stringify(p)}`:"必须等于常量"}return i==="additionalProperties"&&h.additionalProperty&&(s=`不允许额外字段:${h.additionalProperty}`),{path:n,message:s,keyword:i,params:h}}):[];let jt=null;const Zs=()=>(jt||(jt=new An({allErrors:!0,strict:!1}),Ln(jt)),jt),Un=new Map,Qs=JSON.stringify(qe),Xs={CICPage:["#/definitions/CICPage","#/$defs/CICPage","#/properties/pages/items","#/definitions/CICConfig/properties/pages/items"],Meta:["#/definitions/Meta","#/$defs/Meta","#/properties/meta"],Layout:["#/definitions/Layout","#/$defs/Layout","#/properties/meta/properties/layout"],ComponentInstance:["#/definitions/ComponentInstance","#/$defs/ComponentInstance"],DataSourceItem:["#/definitions/DataSourceItem","#/$defs/DataSourceItem"],RegistryComponents:["#/definitions/RegistryComponents","#/$defs/RegistryComponents"],Variables:["#/definitions/Variables","#/$defs/Variables","#/properties/variables"],Dependency:["#/definitions/Dependency","#/$defs/Dependency"],LayoutConfig:["#/definitions/Layout","#/properties/meta/properties/layout"]},xs=(e,t)=>e.compile({$ref:t,definitions:qe.definitions,properties:qe.properties}),te=e=>{const t=Zs(),n=`type:${e}::${Qs}`,i=Un.get(n);if(i)return i;const h=Xs[e]||[`#/definitions/${e}`,`#/$defs/${e}`];for(const s of h)try{const p=xs(t,s);return Un.set(n,p),p}catch{}throw new Error(`VALIDATOR_REF_NOT_FOUND:${e}`)},It=te("DataSourceItem"),Rt=te("DataSourceRest"),Nt=te("DataSourceWebSocket"),Ot=te("DataSourceStatic"),Ct=te("DataSourceFunction"),ei=(e,t)=>{const n={...e};if(t?.generateId&&!n.id&&(n.id=lr()),!n.type)throw new Error("type is required");return n.type==="rest"?("pollInterval"in n&&Te(n.pollInterval)&&(n.pollInterval=Math.round(n.pollInterval)),"timeout"in n&&Te(n.timeout)&&(n.timeout=Math.round(n.timeout))):n.type==="websocket"?(n.heartbeat&&typeof n.heartbeat=="object"&&"interval"in n.heartbeat&&Te(n.heartbeat.interval)&&(n.heartbeat.interval=Math.round(n.heartbeat.interval)),"pollInterval"in n&&Te(n.pollInterval)&&(n.pollInterval=Math.round(n.pollInterval))):n.type==="static"||n.type==="function"&&"timeout"in n&&Te(n.timeout)&&(n.timeout=Math.round(n.timeout)),n},ti=e=>{const t=e;if(t&&typeof t=="object"&&typeof t.type=="string"){if(t.type==="rest")return Rt(e)?{ok:!0}:{ok:!1,errors:G(Rt.errors||[])};if(t.type==="websocket")return Nt(e)?{ok:!0}:{ok:!1,errors:G(Nt.errors||[])};if(t.type==="static")return Ot(e)?{ok:!0}:{ok:!1,errors:G(Ot.errors||[])};if(t.type==="function")return Ct(e)?{ok:!0}:{ok:!1,errors:G(Ct.errors||[])}}return It(e)?{ok:!0}:{ok:!1,errors:G(It.errors||[])}},Kn=(e,t)=>{const n=ei(e,t);if(n&&typeof n=="object"&&typeof n.type=="string"){if(n.type==="rest")return Rt(n)?{ok:!0,value:n}:{ok:!1,errors:G(Rt.errors||[])};if(n.type==="websocket")return Nt(n)?{ok:!0,value:n}:{ok:!1,errors:G(Nt.errors||[])};if(n.type==="static")return Ot(n)?{ok:!0,value:n}:{ok:!1,errors:G(Ot.errors||[])};if(n.type==="function")return Ct(n)?{ok:!0,value:n}:{ok:!1,errors:G(Ct.errors||[])}}return It(n)?{ok:!0,value:n}:{ok:!1,errors:G(It.errors||[])}},ri=(e,t)=>{const n=Kn(e,t);if(!n.ok)throw new Error("VALIDATION_FAILED");return n.value},qt=te("ComponentInstance"),Tt=te("ViewComponentInstance"),Dt=te("ContainerComponentInstance"),Mt=te("LogicComponentInstanceRef"),ni=(e,t)=>{const n={...e};return t?.generateId&&!n.id&&(n.id=lr()),n.role==="view"?delete n.children:n.role==="container"?delete n.component:n.role==="logic"&&delete n.children,n},si=e=>{const t=e;if(t&&typeof t=="object"&&typeof t.role=="string"){if(t.role==="view")return Tt(e)?{ok:!0}:{ok:!1,errors:G(Tt.errors||[])};if(t.role==="container")return Dt(e)?{ok:!0}:{ok:!1,errors:G(Dt.errors||[])};if(t.role==="logic")return Mt(e)?{ok:!0}:{ok:!1,errors:G(Mt.errors||[])}}return qt(e)?{ok:!0}:{ok:!1,errors:G(qt.errors||[])}},Hn=(e,t)=>{const n=ni(e,t);if(n&&typeof n=="object"&&typeof n.role=="string"){if(n.role==="view")return Tt(n)?{ok:!0,value:n}:{ok:!1,errors:G(Tt.errors||[])};if(n.role==="container")return Dt(n)?{ok:!0,value:n}:{ok:!1,errors:G(Dt.errors||[])};if(n.role==="logic")return Mt(n)?{ok:!0,value:n}:{ok:!1,errors:G(Mt.errors||[])}}return qt(n)?{ok:!0,value:n}:{ok:!1,errors:G(qt.errors||[])}},ii=(e,t)=>{const n=Hn(e,t);if(!n.ok)throw new Error("VALIDATION_FAILED");return n.value},At=te("CICPage"),oi=(e,t)=>{const n={...e};return t?.generateId&&!n.id&&(n.id=lr()),n},ai=e=>At(e)?{ok:!0}:{ok:!1,errors:G(At.errors||[])},Gn=(e,t)=>{const n=oi(e,t);return At(n)?{ok:!0,value:n}:{ok:!1,errors:G(At.errors||[])}},ci=(e,t)=>{const n=Gn(e,t);if(!n.ok)throw new Error("VALIDATION_FAILED");return n.value},Vt=te("Meta"),zt=te("Layout"),di=e=>Vt(e)?{ok:!0}:{ok:!1,errors:G(Vt.errors||[])},ui=e=>zt(e)?{ok:!0}:{ok:!1,errors:G(zt.errors||[])},Jn=e=>Vt(e)?{ok:!0,value:e}:{ok:!1,errors:G(Vt.errors||[])},Wn=e=>zt(e)?{ok:!0,value:e}:{ok:!1,errors:G(zt.errors||[])},li=e=>{const t=Jn(e);if(!t.ok)throw new Error("VALIDATION_FAILED");return t.value},fi=e=>{const t=Wn(e);if(!t.ok)throw new Error("VALIDATION_FAILED");return t.value},Ft=te("Variables"),pi=e=>Ft(e)?{ok:!0}:{ok:!1,errors:G(Ft.errors||[])},Bn=e=>Ft(e)?{ok:!0,value:e}:{ok:!1,errors:G(Ft.errors||[])},mi=e=>{const t=Bn(e);if(!t.ok)throw new Error("VALIDATION_FAILED");return t.value},Lt=te("Dependency"),Ut=te("JSDependency"),Kt=te("CSSDependency"),Ht=te("FontDependency"),Gt=te("ImageDependency"),Jt=te("JSONDependency"),Wt=te("WasmDependency"),Bt=te("OtherDependency"),hi=e=>{const t=e;if(t&&typeof t=="object"&&typeof t.type=="string")switch(t.type){case"js":return Ut(e)?{ok:!0}:{ok:!1,errors:G(Ut.errors||[])};case"css":return Kt(e)?{ok:!0}:{ok:!1,errors:G(Kt.errors||[])};case"font":return Ht(e)?{ok:!0}:{ok:!1,errors:G(Ht.errors||[])};case"image":return Gt(e)?{ok:!0}:{ok:!1,errors:G(Gt.errors||[])};case"json":return Jt(e)?{ok:!0}:{ok:!1,errors:G(Jt.errors||[])};case"wasm":return Wt(e)?{ok:!0}:{ok:!1,errors:G(Wt.errors||[])};case"other":return Bt(e)?{ok:!0}:{ok:!1,errors:G(Bt.errors||[])}}return Lt(e)?{ok:!0}:{ok:!1,errors:G(Lt.errors||[])}},Yn=e=>{const t=e;if(t&&typeof t=="object"&&typeof t.type=="string")switch(t.type){case"js":return Ut(t)?{ok:!0,value:t}:{ok:!1,errors:G(Ut.errors||[])};case"css":return Kt(t)?{ok:!0,value:t}:{ok:!1,errors:G(Kt.errors||[])};case"font":return Ht(t)?{ok:!0,value:t}:{ok:!1,errors:G(Ht.errors||[])};case"image":return Gt(t)?{ok:!0,value:t}:{ok:!1,errors:G(Gt.errors||[])};case"json":return Jt(t)?{ok:!0,value:t}:{ok:!1,errors:G(Jt.errors||[])};case"wasm":return Wt(t)?{ok:!0,value:t}:{ok:!1,errors:G(Wt.errors||[])};case"other":return Bt(t)?{ok:!0,value:t}:{ok:!1,errors:G(Bt.errors||[])}}return Lt(t)?{ok:!0,value:t}:{ok:!1,errors:G(Lt.errors||[])}},yi=e=>{const t=Yn(e);if(!t.ok)throw new Error("VALIDATION_FAILED");return t.value},Yt=te("RegistryComponents"),gi=e=>Yt(e)?{ok:!0}:{ok:!1,errors:G(Yt.errors||[])},Zn=e=>Yt(e)?{ok:!0,value:e}:{ok:!1,errors:G(Yt.errors||[])},vi=e=>{const t=Zn(e);if(!t.ok)throw new Error("VALIDATION_FAILED");return t.value};class oe{config;static validator;static validate;static schemaHash;constructor(t){const n=oe.validateConfig(t);if(!n.valid)throw new Error(`Invalid CIC Configuration: ${n.error}`);this.config=t}getConfig(){return this.config}findComponent(t){let n;return this.walkComponents(i=>i.id===t?(n=i,!1):!0),n}findPageByComponent(t){let n;return this.walkComponents((i,h)=>i.id===t?(n=h,!1):!0),n}getVariable(t,n){const i=this.config.variables;if(i){if(t.componentId&&i.component&&i.component[t.componentId]){const h=i.component[t.componentId][n];if(h)return h.value??h.default}if(t.pageId&&i.page&&i.page[t.pageId]){const h=i.page[t.pageId][n];if(h)return h.value??h.default}if(i.global&&i.global[n]){const h=i.global[n];return h.value??h.default}}}getVariableByRef(t){const n=t.match(/^(global|page|component)(?::([^\.]+))?\.(.+)$/);if(!n)return;const[,i,h,s]=n;if(i==="global")return this.getVariable({},s);if(i==="page")return this.getVariable({pageId:h},s);if(i==="component")return this.getVariable({componentId:h},s)}walkComponents(t){if(this.config.pages)for(const n of this.config.pages){const i=[];for(const s of n.components||[])i.push({node:s});let h=!1;for(;i.length>0&&!h;){const{node:s,parent:p}=i.pop();if(t(s,n,p)===!1){h=!0;break}if(s.children&&s.children.length>0)for(let m=s.children.length-1;m>=0;m--)i.push({node:s.children[m],parent:s})}if(h)break}}static validateConfig(t){if(!t)return{valid:!1,error:"Config is null or undefined"};const n=JSON.stringify(qe);return(!oe.validator||oe.schemaHash!==n)&&(oe.validator=new An({allErrors:!0,strict:!1}),Ln(oe.validator),oe.validator.addFormat("color-hex",/^#[0-9a-fA-F]{6}$/),oe.validate=oe.validator.compile(qe),oe.schemaHash=n),oe.validate(t)?{valid:!0}:{valid:!1,error:oe.validate.errors.map(s=>`${s.instancePath} ${s.message}`).join("; ")}}static getValueByPath(t,n,i){if(t==null||!n)return i;const h=[];n.replace(/\[(\d+)\]/g,".$1").split(".").forEach(p=>{p.trim()&&h.push(p.trim())});let s=t;for(const p of h){if(s==null)return i;s=s[p]}return s===void 0?i:s}static traverseTree(t,n,i){const h=Array.isArray(t)?t:[t];for(const s of h)n(s,i)!==!1&&s.children&&s.children.length>0&&oe.traverseTree(s.children,n,s)}static createDataSource=Kn;static validateDataSource=ti;static normalizeDataSource=ri;static createComponent=Hn;static validateComponent=si;static normalizeComponent=ii;static createPage=Gn;static validatePage=ai;static normalizePage=ci;static createMeta=Jn;static createLayout=Wn;static validateMeta=di;static validateLayout=ui;static normalizeMeta=li;static normalizeLayout=fi;static createVariables=Bn;static validateVariables=pi;static normalizeVariables=mi;static createDependency=Yn;static validateDependency=hi;static normalizeDependency=yi;static createRegistryComponent=Zn;static validateRegistryComponent=gi;static normalizeRegistryComponent=vi}globalThis.CICSDK=oe,ke.CICSDK=oe,Object.defineProperty(ke,Symbol.toStringTag,{value:"Module"})}));