@anov/cic-standard-sdk 0.0.8 → 0.0.9

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
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function Tn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var De={exports:{}},Xt={},ve={},Pe={},xt={},er={},tr={},yr;function bt(){return yr||(yr=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 r extends t{constructor(n){if(super(),!e.IDENTIFIER.test(n))throw new Error("CodeGen: name must be a valid identifier");this.str=n}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=r;class i extends t{constructor(n){super(),this._items=typeof n=="string"?[n]:n}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const n=this._items[0];return n===""||n==='""'}get str(){var n;return(n=this._str)!==null&&n!==void 0?n:this._str=this._items.reduce((a,y)=>`${a}${y}`,"")}get names(){var n;return(n=this._names)!==null&&n!==void 0?n:this._names=this._items.reduce((a,y)=>(y instanceof r&&(a[y.str]=(a[y.str]||0)+1),a),{})}}e._Code=i,e.nil=new i("");function m(u,...n){const a=[u[0]];let y=0;for(;y<n.length;)d(a,n[y]),a.push(u[++y]);return new i(a)}e._=m;const s=new i("+");function p(u,...n){const a=[g(u[0])];let y=0;for(;y<n.length;)a.push(s),d(a,n[y]),a.push(s,g(u[++y]));return h(a),new i(a)}e.str=p;function d(u,n){n instanceof i?u.push(...n._items):n instanceof r?u.push(n):u.push(S(n))}e.addCodeArg=d;function h(u){let n=1;for(;n<u.length-1;){if(u[n]===s){const a=b(u[n-1],u[n+1]);if(a!==void 0){u.splice(n-1,3,a);continue}u[n++]="+"}n++}}function b(u,n){if(n==='""')return u;if(u==='""')return n;if(typeof u=="string")return n instanceof r||u[u.length-1]!=='"'?void 0:typeof n!="string"?`${u.slice(0,-1)}${n}"`:n[0]==='"'?u.slice(0,-1)+n.slice(1):void 0;if(typeof n=="string"&&n[0]==='"'&&!(u instanceof r))return`"${u}${n.slice(1)}`}function _(u,n){return n.emptyStr()?u:u.emptyStr()?n:p`${u}${n}`}e.strConcat=_;function S(u){return typeof u=="number"||typeof u=="boolean"||u===null?u:g(Array.isArray(u)?u.join(","):u)}function $(u){return new i(g(u))}e.stringify=$;function g(u){return JSON.stringify(u).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=g;function v(u){return typeof u=="string"&&e.IDENTIFIER.test(u)?new i(`.${u}`):m`[${u}]`}e.getProperty=v;function w(u){if(typeof u=="string"&&e.IDENTIFIER.test(u))return new i(`${u}`);throw new Error(`CodeGen: invalid export name: ${u}, use explicit $id name mapping`)}e.getEsmExportName=w;function c(u){return new i(u.toString())}e.regexpCode=c})(tr)),tr}var rr={},gr;function vr(){return gr||(gr=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=bt();class r extends Error{constructor(b){super(`CodeGen: "code" for ${b} not defined`),this.value=b.value}}var i;(function(h){h[h.Started=0]="Started",h[h.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 m{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=m;class s 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=s;const p=(0,t._)`\n`;class d extends m{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 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 n=w.get(v);if(n)return n}else w=this._values[g]=new Map;w.set(v,$);const c=this._scope[g]||(this._scope[g]=[]),u=c.length;return c[u]=_.ref,$.setValue(_,{property:g,itemIndex:u}),$}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(u=>{if(c.has(u))return;c.set(u,i.Started);let n=_(u);if(n){const a=this.opts.es5?e.varKinds.var:e.varKinds.const;g=(0,t._)`${g}${a} ${u} = ${n};${this.opts._n}`}else if(n=$?.(u))g=(0,t._)`${g}${n}${this.opts._n}`;else throw new r(u);c.set(u,i.Completed)})}return g}}e.ValueScope=d})(rr)),rr}var _r;function W(){return _r||(_r=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=bt(),r=vr();var i=bt();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 m=vr();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return m.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return m.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return m.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return m.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,k){return this}}class p extends s{constructor(l,k,I){super(),this.varKind=l,this.name=k,this.rhs=I}render({es5:l,_n:k}){const I=l?r.varKinds.var:this.varKind,U=this.rhs===void 0?"":` = ${this.rhs}`;return`${I} ${this.name}${U};`+k}optimizeNames(l,k){if(l[this.name.str])return this.rhs&&(this.rhs=L(this.rhs,l,k)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class d extends s{constructor(l,k,I){super(),this.lhs=l,this.rhs=k,this.sideEffects=I}render({_n:l}){return`${this.lhs} = ${this.rhs};`+l}optimizeNames(l,k){if(!(this.lhs instanceof t.Name&&!l[this.lhs.str]&&!this.sideEffects))return this.rhs=L(this.rhs,l,k),this}get names(){const l=this.lhs instanceof t.Name?{}:{...this.lhs.names};return F(l,this.rhs)}}class h extends d{constructor(l,k,I,U){super(l,I,U),this.op=k}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 S 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,k){return this.code=L(this.code,l,k),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((k,I)=>k+I.render(l),"")}optimizeNodes(){const{nodes:l}=this;let k=l.length;for(;k--;){const I=l[k].optimizeNodes();Array.isArray(I)?l.splice(k,1,...I):I?l[k]=I:l.splice(k,1)}return l.length>0?this:void 0}optimizeNames(l,k){const{nodes:I}=this;let U=I.length;for(;U--;){const H=I[U];H.optimizeNames(l,k)||(X(l,H.names),I.splice(U,1))}return I.length>0?this:void 0}get names(){return this.nodes.reduce((l,k)=>V(l,k.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 u extends v{constructor(l,k){super(k),this.condition=l}render(l){let k=`if(${this.condition})`+super.render(l);return this.else&&(k+="else "+this.else.render(l)),k}optimizeNodes(){super.optimizeNodes();const l=this.condition;if(l===!0)return this.nodes;let k=this.else;if(k){const I=k.optimizeNodes();k=this.else=Array.isArray(I)?new c(I):I}if(k)return l===!1?k instanceof u?k:k.nodes:this.nodes.length?this:new u(ie(l),k instanceof u?[k]:k.nodes);if(!(l===!1||!this.nodes.length))return this}optimizeNames(l,k){var I;if(this.else=(I=this.else)===null||I===void 0?void 0:I.optimizeNames(l,k),!!(super.optimizeNames(l,k)||this.else))return this.condition=L(this.condition,l,k),this}get names(){const l=super.names;return F(l,this.condition),this.else&&V(l,this.else.names),l}}u.kind="if";class n extends v{}n.kind="for";class a extends n{constructor(l){super(),this.iteration=l}render(l){return`for(${this.iteration})`+super.render(l)}optimizeNames(l,k){if(super.optimizeNames(l,k))return this.iteration=L(this.iteration,l,k),this}get names(){return V(super.names,this.iteration.names)}}class y extends n{constructor(l,k,I,U){super(),this.varKind=l,this.name=k,this.from=I,this.to=U}render(l){const k=l.es5?r.varKinds.var:this.varKind,{name:I,from:U,to:H}=this;return`for(${k} ${I}=${U}; ${I}<${H}; ${I}++)`+super.render(l)}get names(){const l=F(super.names,this.from);return F(l,this.to)}}class o extends n{constructor(l,k,I,U){super(),this.loop=l,this.varKind=k,this.name=I,this.iterable=U}render(l){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(l)}optimizeNames(l,k){if(super.optimizeNames(l,k))return this.iterable=L(this.iterable,l,k),this}get names(){return V(super.names,this.iterable.names)}}class f extends v{constructor(l,k,I){super(),this.name=l,this.args=k,this.async=I}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 O extends v{render(l){let k="try"+super.render(l);return this.catch&&(k+=this.catch.render(l)),this.finally&&(k+=this.finally.render(l)),k}optimizeNodes(){var l,k;return super.optimizeNodes(),(l=this.catch)===null||l===void 0||l.optimizeNodes(),(k=this.finally)===null||k===void 0||k.optimizeNodes(),this}optimizeNames(l,k){var I,U;return super.optimizeNames(l,k),(I=this.catch)===null||I===void 0||I.optimizeNames(l,k),(U=this.finally)===null||U===void 0||U.optimizeNames(l,k),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,k={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...k,_n:k.lines?`
2
- `:""},this._extScope=l,this._scope=new r.Scope({parent:l}),this._nodes=[new w]}toString(){return this._root.render(this.opts)}name(l){return this._scope.name(l)}scopeName(l){return this._extScope.name(l)}scopeValue(l,k){const I=this._extScope.value(l,k);return(this._values[I.prefix]||(this._values[I.prefix]=new Set)).add(I),I}getScopeValue(l,k){return this._extScope.getValue(l,k)}scopeRefs(l){return this._extScope.scopeRefs(l,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(l,k,I,U){const H=this._scope.toName(k);return I!==void 0&&U&&(this._constants[H.str]=I),this._leafNode(new p(l,H,I)),H}const(l,k,I){return this._def(r.varKinds.const,l,k,I)}let(l,k,I){return this._def(r.varKinds.let,l,k,I)}var(l,k,I){return this._def(r.varKinds.var,l,k,I)}assign(l,k,I){return this._leafNode(new d(l,k,I))}add(l,k){return this._leafNode(new h(l,e.operators.ADD,k))}code(l){return typeof l=="function"?l():l!==t.nil&&this._leafNode(new $(l)),this}object(...l){const k=["{"];for(const[I,U]of l)k.length>1&&k.push(","),k.push(I),(I!==U||this.opts.es5)&&(k.push(":"),(0,t.addCodeArg)(k,U));return k.push("}"),new t._Code(k)}if(l,k,I){if(this._blockNode(new u(l)),k&&I)this.code(k).else().code(I).endIf();else if(k)this.code(k).endIf();else if(I)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(l){return this._elseNode(new u(l))}else(){return this._elseNode(new c)}endIf(){return this._endBlockNode(u,c)}_for(l,k){return this._blockNode(l),k&&this.code(k).endFor(),this}for(l,k){return this._for(new a(l),k)}forRange(l,k,I,U,H=this.opts.es5?r.varKinds.var:r.varKinds.let){const Q=this._scope.toName(l);return this._for(new y(H,Q,k,I),()=>U(Q))}forOf(l,k,I,U=r.varKinds.const){const H=this._scope.toName(l);if(this.opts.es5){const Q=k instanceof t.Name?k:this.var("_arr",k);return this.forRange("_i",0,(0,t._)`${Q}.length`,Y=>{this.var(H,(0,t._)`${Q}[${Y}]`),I(H)})}return this._for(new o("of",U,H,k),()=>I(H))}forIn(l,k,I,U=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(l,(0,t._)`Object.keys(${k})`,I);const H=this._scope.toName(l);return this._for(new o("in",U,H,k),()=>I(H))}endFor(){return this._endBlockNode(n)}label(l){return this._leafNode(new b(l))}break(l){return this._leafNode(new _(l))}return(l){const k=new P;if(this._blockNode(k),this.code(l),k.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(P)}try(l,k,I){if(!k&&!I)throw new Error('CodeGen: "try" without "catch" and "finally"');const U=new O;if(this._blockNode(U),this.code(l),k){const H=this.name("e");this._currNode=U.catch=new D(H),k(H)}return I&&(this._currNode=U.finally=new z,this.code(I)),this._endBlockNode(D,z)}throw(l){return this._leafNode(new S(l))}block(l,k){return this._blockStarts.push(this._nodes.length),l&&this.code(l).endBlock(k),this}endBlock(l){const k=this._blockStarts.pop();if(k===void 0)throw new Error("CodeGen: not in self-balancing block");const I=this._nodes.length-k;if(I<0||l!==void 0&&I!==l)throw new Error(`CodeGen: wrong number of nodes: ${I} vs ${l} expected`);return this._nodes.length=k,this}func(l,k=t.nil,I,U){return this._blockNode(new f(l,k,I)),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,k){const I=this._currNode;if(I instanceof l||k&&I instanceof k)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${k?`${l.kind}/${k.kind}`:l.kind}"`)}_elseNode(l){const k=this._currNode;if(!(k instanceof u))throw new Error('CodeGen: "else" without "if"');return this._currNode=k.else=l,this}get _root(){return this._nodes[0]}get _currNode(){const l=this._nodes;return l[l.length-1]}set _currNode(l){const k=this._nodes;k[k.length-1]=l}}e.CodeGen=C;function V(N,l){for(const k in l)N[k]=(N[k]||0)+(l[k]||0);return N}function F(N,l){return l instanceof t._CodeOrName?V(N,l.names):N}function L(N,l,k){if(N instanceof t.Name)return I(N);if(!U(N))return N;return new t._Code(N._items.reduce((H,Q)=>(Q instanceof t.Name&&(Q=I(Q)),Q instanceof t._Code?H.push(...Q._items):H.push(Q),H),[]));function I(H){const Q=k[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&&k[Q.str]!==void 0)}}function X(N,l){for(const k in l)N[k]=(N[k]||0)-(l[k]||0)}function ie(N){return typeof N=="boolean"||typeof N=="number"||N===null?!N:(0,t._)`!${T(N)}`}e.not=ie;const oe=j(e.operators.AND);function ee(...N){return N.reduce(oe)}e.and=ee;const pe=j(e.operators.OR);function M(...N){return N.reduce(pe)}e.or=M;function j(N){return(l,k)=>l===t.nil?k:k===t.nil?l:(0,t._)`${T(l)} ${N} ${T(k)}`}function T(N){return N instanceof t.Name?N:(0,t._)`(${N})`}})(er)),er}var G={},$r;function Z(){if($r)return G;$r=1,Object.defineProperty(G,"__esModule",{value:!0}),G.checkStrictMode=G.getErrorPath=G.Type=G.useFunc=G.setEvaluated=G.evaluatedPropsToName=G.mergeEvaluated=G.eachItem=G.unescapeJsonPointer=G.escapeJsonPointer=G.escapeFragment=G.unescapeFragment=G.schemaRefOrVal=G.schemaHasRulesButRef=G.schemaHasRules=G.checkUnknownRules=G.alwaysValidSchema=G.toHash=void 0;const e=W(),t=bt();function r(o){const f={};for(const P of o)f[P]=!0;return f}G.toHash=r;function i(o,f){return typeof f=="boolean"?f:Object.keys(f).length===0?!0:(m(o,f),!s(f,o.self.RULES.all))}G.alwaysValidSchema=i;function m(o,f=o.schema){const{opts:P,self:O}=o;if(!P.strictSchema||typeof f=="boolean")return;const D=O.RULES.keywords;for(const z in f)D[z]||y(o,`unknown keyword: "${z}"`)}G.checkUnknownRules=m;function s(o,f){if(typeof o=="boolean")return!o;for(const P in o)if(f[P])return!0;return!1}G.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}G.schemaHasRulesButRef=p;function d({topSchemaRef:o,schemaPath:f},P,O,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)(O)}`}G.schemaRefOrVal=d;function h(o){return S(decodeURIComponent(o))}G.unescapeFragment=h;function b(o){return encodeURIComponent(_(o))}G.escapeFragment=b;function _(o){return typeof o=="number"?`${o}`:o.replace(/~/g,"~0").replace(/\//g,"~1")}G.escapeJsonPointer=_;function S(o){return o.replace(/~1/g,"/").replace(/~0/g,"~")}G.unescapeJsonPointer=S;function $(o,f){if(Array.isArray(o))for(const P of o)f(P);else f(o)}G.eachItem=$;function g({mergeNames:o,mergeToName:f,mergeValues:P,resultToName:O}){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)?O(D,F):F}}G.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}G.evaluatedPropsToName=v;function w(o,f,P){Object.keys(P).forEach(O=>o.assign((0,e._)`${f}${(0,e.getProperty)(O)}`,!0))}G.setEvaluated=w;const c={};function u(o,f){return o.scopeValue("func",{ref:f,code:c[f.code]||(c[f.code]=new t._Code(f.code))})}G.useFunc=u;var n;(function(o){o[o.Num=0]="Num",o[o.Str=1]="Str"})(n||(G.Type=n={}));function a(o,f,P){if(o instanceof e.Name){const O=f===n.Num;return P?O?(0,e._)`"[" + ${o} + "]"`:(0,e._)`"['" + ${o} + "']"`:O?(0,e._)`"/" + ${o}`:(0,e._)`"/" + ${o}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return P?(0,e.getProperty)(o).toString():"/"+_(o)}G.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 G.checkStrictMode=y,G}var Me={},br;function we(){if(br)return Me;br=1,Object.defineProperty(Me,"__esModule",{value:!0});const e=W(),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 Me.default=t,Me}var wr;function Jt(){return wr||(wr=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=W(),r=Z(),i=we();e.keywordError={message:({keyword:c})=>(0,t.str)`must pass "${c}" keyword validation`},e.keyword$DataError={message:({keyword:c,schemaType:u})=>u?(0,t.str)`"${c}" keyword must be ${u} ($data)`:(0,t.str)`"${c}" keyword is invalid ($data)`};function m(c,u=e.keywordError,n,a){const{it:y}=c,{gen:o,compositeRule:f,allErrors:P}=y,O=S(c,u,n);a??(f||P)?h(o,O):b(y,(0,t._)`[${O}]`)}e.reportError=m;function s(c,u=e.keywordError,n){const{it:a}=c,{gen:y,compositeRule:o,allErrors:f}=a,P=S(c,u,n);h(y,P),o||f||b(a,i.default.vErrors)}e.reportExtraError=s;function p(c,u){c.assign(i.default.errors,u),c.if((0,t._)`${i.default.vErrors} !== null`,()=>c.if(u,()=>c.assign((0,t._)`${i.default.vErrors}.length`,u),()=>c.assign(i.default.vErrors,null)))}e.resetErrorsCount=p;function d({gen:c,keyword:u,schemaValue:n,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}/${u}`),o.opts.verbose&&(c.assign((0,t._)`${f}.schema`,n),c.assign((0,t._)`${f}.data`,a))})}e.extendErrors=d;function h(c,u){const n=c.const("err",u);c.if((0,t._)`${i.default.vErrors} === null`,()=>c.assign(i.default.vErrors,(0,t._)`[${n}]`),(0,t._)`${i.default.vErrors}.push(${n})`),c.code((0,t._)`${i.default.errors}++`)}function b(c,u){const{gen:n,validateName:a,schemaEnv:y}=c;y.$async?n.throw((0,t._)`new ${c.ValidationError}(${u})`):(n.assign((0,t._)`${a}.errors`,u),n.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,u,n){const{createErrors:a}=c.it;return a===!1?(0,t._)`{}`:$(c,u,n)}function $(c,u,n={}){const{gen:a,it:y}=c,o=[g(y,n),v(c,n)];return w(c,u,o),a.object(...o)}function g({errorPath:c},{instancePath:u}){const n=u?(0,t.str)`${c}${(0,r.getErrorPath)(u,r.Type.Str)}`:c;return[i.default.instancePath,(0,t.strConcat)(i.default.instancePath,n)]}function v({keyword:c,it:{errSchemaPath:u}},{schemaPath:n,parentSchema:a}){let y=a?u:(0,t.str)`${u}/${c}`;return n&&(y=(0,t.str)`${y}${(0,r.getErrorPath)(n,r.Type.Str)}`),[_.schemaPath,y]}function w(c,{params:u,message:n},a){const{keyword:y,data:o,schemaValue:f,it:P}=c,{opts:O,propertyName:D,topSchemaRef:z,schemaPath:C}=P;a.push([_.keyword,y],[_.params,typeof u=="function"?u(c):u||(0,t._)`{}`]),O.messages&&a.push([_.message,typeof n=="function"?n(c):n]),O.verbose&&a.push([_.schema,f],[_.parentSchema,(0,t._)`${z}${C}`],[i.default.data,o]),D&&a.push([_.propertyName,D])}})(xt)),xt}var Pr;function es(){if(Pr)return Pe;Pr=1,Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.boolOrEmptySchema=Pe.topBoolOrEmptySchema=void 0;const e=Jt(),t=W(),r=we(),i={message:"boolean schema is false"};function m(d){const{gen:h,schema:b,validateName:_}=d;b===!1?p(d,!1):typeof b=="object"&&b.$async===!0?h.return(r.default.data):(h.assign((0,t._)`${_}.errors`,null),h.return(!0))}Pe.topBoolOrEmptySchema=m;function s(d,h){const{gen:b,schema:_}=d;_===!1?(b.var(h,!1),p(d)):b.var(h,!0)}Pe.boolOrEmptySchema=s;function p(d,h){const{gen:b,data:_}=d,S={gen:b,keyword:"false schema",data:_,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:d};(0,e.reportError)(S,i,void 0,h)}return Pe}var se={},ke={},kr;function Dn(){if(kr)return ke;kr=1,Object.defineProperty(ke,"__esModule",{value:!0}),ke.getRules=ke.isJSONType=void 0;const e=["string","number","integer","boolean","null","object","array"],t=new Set(e);function r(m){return typeof m=="string"&&t.has(m)}ke.isJSONType=r;function i(){const m={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...m,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},m.number,m.string,m.array,m.object],post:{rules:[]},all:{},keywords:{}}}return ke.getRules=i,ke}var _e={},Sr;function Mn(){if(Sr)return _e;Sr=1,Object.defineProperty(_e,"__esModule",{value:!0}),_e.shouldUseRule=_e.shouldUseGroup=_e.schemaHasRulesForType=void 0;function e({schema:i,self:m},s){const p=m.RULES.types[s];return p&&p!==!0&&t(i,p)}_e.schemaHasRulesForType=e;function t(i,m){return m.rules.some(s=>r(i,s))}_e.shouldUseGroup=t;function r(i,m){var s;return i[m.keyword]!==void 0||((s=m.definition.implements)===null||s===void 0?void 0:s.some(p=>i[p]!==void 0))}return _e.shouldUseRule=r,_e}var Er;function wt(){if(Er)return se;Er=1,Object.defineProperty(se,"__esModule",{value:!0}),se.reportTypeError=se.checkDataTypes=se.checkDataType=se.coerceAndCheckDataType=se.getJSONTypes=se.getSchemaTypes=se.DataType=void 0;const e=Dn(),t=Mn(),r=Jt(),i=W(),m=Z();var s;(function(n){n[n.Correct=0]="Correct",n[n.Wrong=1]="Wrong"})(s||(se.DataType=s={}));function p(n){const a=d(n.type);if(a.includes("null")){if(n.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!a.length&&n.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');n.nullable===!0&&a.push("null")}return a}se.getSchemaTypes=p;function d(n){const a=Array.isArray(n)?n:n?[n]:[];if(a.every(e.isJSONType))return a;throw new Error("type must be JSONType or JSONType[]: "+a.join(","))}se.getJSONTypes=d;function h(n,a){const{gen:y,data:o,opts:f}=n,P=_(a,f.coerceTypes),O=a.length>0&&!(P.length===0&&a.length===1&&(0,t.schemaHasRulesForType)(n,a[0]));if(O){const D=v(a,o,f.strictNumbers,s.Wrong);y.if(D,()=>{P.length?S(n,a,P):c(n)})}return O}se.coerceAndCheckDataType=h;const b=new Set(["string","number","integer","boolean","null"]);function _(n,a){return a?n.filter(y=>b.has(y)||a==="array"&&y==="array"):[]}function S(n,a,y){const{gen:o,data:f,opts:P}=n,O=o.let("dataType",(0,i._)`typeof ${f}`),D=o.let("coerced",(0,i._)`undefined`);P.coerceTypes==="array"&&o.if((0,i._)`${O} == 'object' && Array.isArray(${f}) && ${f}.length == 1`,()=>o.assign(f,(0,i._)`${f}[0]`).assign(O,(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(n),o.endIf(),o.if((0,i._)`${D} !== undefined`,()=>{o.assign(f,D),$(n,D)});function z(C){switch(C){case"string":o.elseIf((0,i._)`${O} == "number" || ${O} == "boolean"`).assign(D,(0,i._)`"" + ${f}`).elseIf((0,i._)`${f} === null`).assign(D,(0,i._)`""`);return;case"number":o.elseIf((0,i._)`${O} == "boolean" || ${f} === null
3
- || (${O} == "string" && ${f} && ${f} == +${f})`).assign(D,(0,i._)`+${f}`);return;case"integer":o.elseIf((0,i._)`${O} === "boolean" || ${f} === null
4
- || (${O} === "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._)`${O} === "string" || ${O} === "number"
5
- || ${O} === "boolean" || ${f} === null`).assign(D,(0,i._)`[${f}]`)}}}function $({gen:n,parentData:a,parentDataProperty:y},o){n.if((0,i._)`${a} !== undefined`,()=>n.assign((0,i._)`${a}[${y}]`,o))}function g(n,a,y,o=s.Correct){const f=o===s.Correct?i.operators.EQ:i.operators.NEQ;let P;switch(n){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=O((0,i._)`!(${a} % 1) && !isNaN(${a})`);break;case"number":P=O();break;default:return(0,i._)`typeof ${a} ${f} ${n}`}return o===s.Correct?P:(0,i.not)(P);function O(D=i.nil){return(0,i.and)((0,i._)`typeof ${a} == "number"`,D,y?(0,i._)`isFinite(${a})`:i.nil)}}se.checkDataType=g;function v(n,a,y,o){if(n.length===1)return g(n[0],a,y,o);let f;const P=(0,m.toHash)(n);if(P.array&&P.object){const O=(0,i._)`typeof ${a} != "object"`;f=P.null?O:(0,i._)`!${a} || ${O}`,delete P.null,delete P.array,delete P.object}else f=i.nil;P.number&&delete P.integer;for(const O in P)f=(0,i.and)(f,g(O,a,y,o));return f}se.checkDataTypes=v;const w={message:({schema:n})=>`must be ${n}`,params:({schema:n,schemaValue:a})=>typeof n=="string"?(0,i._)`{type: ${n}}`:(0,i._)`{type: ${a}}`};function c(n){const a=u(n);(0,r.reportError)(a,w)}se.reportTypeError=c;function u(n){const{gen:a,data:y,schema:o}=n,f=(0,m.schemaRefOrVal)(n,o,"type");return{gen:a,keyword:"type",data:y,schema:o.type,schemaCode:f,schemaValue:f,parentSchema:o,params:{},it:n}}return se}var Oe={},jr;function ts(){if(jr)return Oe;jr=1,Object.defineProperty(Oe,"__esModule",{value:!0}),Oe.assignDefaults=void 0;const e=W(),t=Z();function r(m,s){const{properties:p,items:d}=m.schema;if(s==="object"&&p)for(const h in p)i(m,h,p[h].default);else s==="array"&&Array.isArray(d)&&d.forEach((h,b)=>i(m,b,h.default))}Oe.assignDefaults=r;function i(m,s,p){const{gen:d,compositeRule:h,data:b,opts:_}=m;if(p===void 0)return;const S=(0,e._)`${b}${(0,e.getProperty)(s)}`;if(h){(0,t.checkStrictMode)(m,`default is ignored for: ${S}`);return}let $=(0,e._)`${S} === undefined`;_.useDefaults==="empty"&&($=(0,e._)`${$} || ${S} === null || ${S} === ""`),d.if($,(0,e._)`${S} = ${(0,e.stringify)(p)}`)}return Oe}var he={},x={},Rr;function ge(){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=W(),t=Z(),r=we(),i=Z();function m(n,a){const{gen:y,data:o,it:f}=n;y.if(_(y,o,a,f.opts.ownProperties),()=>{n.setParams({missingProperty:(0,e._)`${a}`},!0),n.error()})}x.checkReportMissingProp=m;function s({gen:n,data:a,it:{opts:y}},o,f){return(0,e.or)(...o.map(P=>(0,e.and)(_(n,a,P,y.ownProperties),(0,e._)`${f} = ${P}`)))}x.checkMissingProp=s;function p(n,a){n.setParams({missingProperty:a},!0),n.error()}x.reportMissingProp=p;function d(n){return n.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,e._)`Object.prototype.hasOwnProperty`})}x.hasPropFunc=d;function h(n,a,y){return(0,e._)`${d(n)}.call(${a}, ${y})`}x.isOwnProperty=h;function b(n,a,y,o){const f=(0,e._)`${a}${(0,e.getProperty)(y)} !== undefined`;return o?(0,e._)`${f} && ${h(n,a,y)}`:f}x.propertyInData=b;function _(n,a,y,o){const f=(0,e._)`${a}${(0,e.getProperty)(y)} === undefined`;return o?(0,e.or)(f,(0,e.not)(h(n,a,y))):f}x.noPropertyInData=_;function S(n){return n?Object.keys(n).filter(a=>a!=="__proto__"):[]}x.allSchemaProperties=S;function $(n,a){return S(a).filter(y=>!(0,t.alwaysValidSchema)(n,a[y]))}x.schemaProperties=$;function g({schemaCode:n,data:a,it:{gen:y,topSchemaRef:o,schemaPath:f,errorPath:P},it:O},D,z,C){const V=C?(0,e._)`${n}, ${a}, ${o}${f}`:a,F=[[r.default.instancePath,(0,e.strConcat)(r.default.instancePath,P)],[r.default.parentData,O.parentData],[r.default.parentDataProperty,O.parentDataProperty],[r.default.rootData,r.default.rootData]];O.opts.dynamicRef&&F.push([r.default.dynamicAnchors,r.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:n,it:{opts:a}},y){const o=a.unicodeRegExp?"u":"",{regExp:f}=a.code,P=f(y,o);return n.scopeValue("pattern",{key:P.toString(),ref:P,code:(0,e._)`${f.code==="new RegExp"?v:(0,i.useFunc)(n,f)}(${y}, ${o})`})}x.usePattern=w;function c(n){const{gen:a,data:y,keyword:o,it:f}=n,P=a.name("valid");if(f.allErrors){const D=a.let("valid",!0);return O(()=>a.assign(D,!1)),D}return a.var(P,!0),O(()=>a.break()),P;function O(D){const z=a.const("len",(0,e._)`${y}.length`);a.forRange("i",0,z,C=>{n.subschema({keyword:o,dataProp:C,dataPropType:t.Type.Num},P),a.if((0,e.not)(P),D)})}}x.validateArray=c;function u(n){const{gen:a,schema:y,keyword:o,it:f}=n;if(!Array.isArray(y))throw new Error("ajv implementation error");if(y.some(z=>(0,t.alwaysValidSchema)(f,z))&&!f.opts.unevaluated)return;const O=a.let("valid",!1),D=a.name("_valid");a.block(()=>y.forEach((z,C)=>{const V=n.subschema({keyword:o,schemaProp:C,compositeRule:!0},D);a.assign(O,(0,e._)`${O} || ${D}`),n.mergeValidEvaluated(V,D)||a.if((0,e.not)(O))})),n.result(O,()=>n.reset(),()=>n.error(!0))}return x.validateUnion=u,x}var Nr;function rs(){if(Nr)return he;Nr=1,Object.defineProperty(he,"__esModule",{value:!0}),he.validateKeywordUsage=he.validSchemaType=he.funcKeywordCode=he.macroKeywordCode=void 0;const e=W(),t=we(),r=ge(),i=Jt();function m($,g){const{gen:v,keyword:w,schema:c,parentSchema:u,it:n}=$,a=g.macro.call(n.self,c,u,n),y=b(v,w,a);n.opts.validateSchema!==!1&&n.self.validateSchema(a,!0);const o=v.name("valid");$.subschema({schema:a,schemaPath:e.nil,errSchemaPath:`${n.errSchemaPath}/${w}`,topSchemaRef:y,compositeRule:!0},o),$.pass(o,()=>$.error(!0))}he.macroKeywordCode=m;function s($,g){var v;const{gen:w,keyword:c,schema:u,parentSchema:n,$data:a,it:y}=$;h(y,g);const o=!a&&g.compile?g.compile.call(y.self,u,n,y):g.validate,f=b(w,c,o),P=w.let("valid");$.block$data(P,O),$.ok((v=g.valid)!==null&&v!==void 0?v:P);function O(){if(g.errors===!1)C(),g.modifying&&p($),V(()=>$.error());else{const F=g.async?D():z();g.modifying&&p($),V(()=>d($,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,r.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)}}he.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 d($,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 h({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")}he.validSchemaType=_;function S({schema:$,opts:g,self:v,errSchemaPath:w},c,u){if(Array.isArray(c.keyword)?!c.keyword.includes(u):c.keyword!==u)throw new Error("ajv implementation error");const n=c.dependencies;if(n?.some(a=>!Object.prototype.hasOwnProperty.call($,a)))throw new Error(`parent schema must have dependencies of ${u}: ${n.join(",")}`);if(c.validateSchema&&!c.validateSchema($[u])){const y=`keyword "${u}" 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 he.validateKeywordUsage=S,he}var $e={},Or;function ns(){if(Or)return $e;Or=1,Object.defineProperty($e,"__esModule",{value:!0}),$e.extendSubschemaMode=$e.extendSubschemaData=$e.getSubschema=void 0;const e=W(),t=Z();function r(s,{keyword:p,schemaProp:d,schema:h,schemaPath:b,errSchemaPath:_,topSchemaRef:S}){if(p!==void 0&&h!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(p!==void 0){const $=s.schema[p];return d===void 0?{schema:$,schemaPath:(0,e._)`${s.schemaPath}${(0,e.getProperty)(p)}`,errSchemaPath:`${s.errSchemaPath}/${p}`}:{schema:$[d],schemaPath:(0,e._)`${s.schemaPath}${(0,e.getProperty)(p)}${(0,e.getProperty)(d)}`,errSchemaPath:`${s.errSchemaPath}/${p}/${(0,t.escapeFragment)(d)}`}}if(h!==void 0){if(b===void 0||_===void 0||S===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:h,schemaPath:b,topSchemaRef:S,errSchemaPath:_}}throw new Error('either "keyword" or "schema" must be passed')}$e.getSubschema=r;function i(s,p,{dataProp:d,dataPropType:h,data:b,dataTypes:_,propertyName:S}){if(b!==void 0&&d!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:$}=p;if(d!==void 0){const{errorPath:v,dataPathArr:w,opts:c}=p,u=$.let("data",(0,e._)`${p.data}${(0,e.getProperty)(d)}`,!0);g(u),s.errorPath=(0,e.str)`${v}${(0,t.getErrorPath)(d,h,c.jsPropertySyntax)}`,s.parentDataProperty=(0,e._)`${d}`,s.dataPathArr=[...w,s.parentDataProperty]}if(b!==void 0){const v=b instanceof e.Name?b:$.let("data",b,!0);g(v),S!==void 0&&(s.propertyName=S)}_&&(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 m(s,{jtdDiscriminator:p,jtdMetadata:d,compositeRule:h,createErrors:b,allErrors:_}){h!==void 0&&(s.compositeRule=h),b!==void 0&&(s.createErrors=b),_!==void 0&&(s.allErrors=_),s.jtdDiscriminator=p,s.jtdMetadata=d}return $e.extendSubschemaMode=m,$e}var ae={},nr,Ir;function An(){return Ir||(Ir=1,nr=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var i,m,s;if(Array.isArray(t)){if(i=t.length,i!=r.length)return!1;for(m=i;m--!==0;)if(!e(t[m],r[m]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(s=Object.keys(t),i=s.length,i!==Object.keys(r).length)return!1;for(m=i;m--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[m]))return!1;for(m=i;m--!==0;){var p=s[m];if(!e(t[p],r[p]))return!1}return!0}return t!==t&&r!==r}),nr}var sr={exports:{}},Cr;function ss(){if(Cr)return sr.exports;Cr=1;var e=sr.exports=function(i,m,s){typeof m=="function"&&(s=m,m={}),s=m.cb||s;var p=typeof s=="function"?s:s.pre||function(){},d=s.post||function(){};t(m,p,d,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,m,s,p,d,h,b,_,S,$){if(p&&typeof p=="object"&&!Array.isArray(p)){m(p,d,h,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(i,m,s,v[w],d+"/"+g+"/"+w,h,d,g,p,w)}else if(g in e.propsKeywords){if(v&&typeof v=="object")for(var c in v)t(i,m,s,v[c],d+"/"+g+"/"+r(c),h,d,g,p,c)}else(g in e.keywords||i.allKeys&&!(g in e.skipKeywords))&&t(i,m,s,v,d+"/"+g,h,d,g,p)}s(p,d,h,b,_,S,$)}}function r(i){return i.replace(/~/g,"~0").replace(/\//g,"~1")}return sr.exports}var qr;function Gt(){if(qr)return ae;qr=1,Object.defineProperty(ae,"__esModule",{value:!0}),ae.getSchemaRefs=ae.resolveUrl=ae.normalizeId=ae._getFullPath=ae.getFullPath=ae.inlineRef=void 0;const e=Z(),t=An(),r=ss(),i=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function m(w,c=!0){return typeof w=="boolean"?!0:c===!0?!p(w):c?d(w)<=c:!1}ae.inlineRef=m;const s=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function p(w){for(const c in w){if(s.has(c))return!0;const u=w[c];if(Array.isArray(u)&&u.some(p)||typeof u=="object"&&p(u))return!0}return!1}function d(w){let c=0;for(const u in w){if(u==="$ref")return 1/0;if(c++,!i.has(u)&&(typeof w[u]=="object"&&(0,e.eachItem)(w[u],n=>c+=d(n)),c===1/0))return 1/0}return c}function h(w,c="",u){u!==!1&&(c=S(c));const n=w.parse(c);return b(w,n)}ae.getFullPath=h;function b(w,c){return w.serialize(c).split("#")[0]+"#"}ae._getFullPath=b;const _=/#\/?$/;function S(w){return w?w.replace(_,""):""}ae.normalizeId=S;function $(w,c,u){return u=S(u),w.resolve(c,u)}ae.resolveUrl=$;const g=/^[a-z_][-a-z0-9._]*$/i;function v(w,c){if(typeof w=="boolean")return{};const{schemaId:u,uriResolver:n}=this.opts,a=S(w[u]||c),y={"":a},o=h(n,a,!1),f={},P=new Set;return r(w,{allKeys:!0},(z,C,V,F)=>{if(F===void 0)return;const L=o+C;let X=y[F];typeof z[u]=="string"&&(X=ie.call(this,z[u])),oe.call(this,z.$anchor),oe.call(this,z.$dynamicAnchor),y[C]=X;function ie(ee){const pe=this.opts.uriResolver.resolve;if(ee=S(X?pe(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"?O(z,M.schema,ee):ee!==S(L)&&(ee[0]==="#"?(O(z,f[ee],ee),f[ee]=z):this.refs[ee]=L),ee}function oe(ee){if(typeof ee=="string"){if(!g.test(ee))throw new Error(`invalid anchor "${ee}"`);ie.call(this,`#${ee}`)}}}),f;function O(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 ae.getSchemaRefs=v,ae}var Tr;function Wt(){if(Tr)return ve;Tr=1,Object.defineProperty(ve,"__esModule",{value:!0}),ve.getData=ve.KeywordCxt=ve.validateFunctionCode=void 0;const e=es(),t=wt(),r=Mn(),i=wt(),m=ts(),s=rs(),p=ns(),d=W(),h=we(),b=Gt(),_=Z(),S=Jt();function $(E){if(o(E)&&(P(E),y(E))){c(E);return}g(E,()=>(0,e.topBoolOrEmptySchema)(E))}ve.validateFunctionCode=$;function g({gen:E,validateName:R,schema:q,schemaEnv:A,opts:K},B){K.code.es5?E.func(R,(0,d._)`${h.default.data}, ${h.default.valCxt}`,A.$async,()=>{E.code((0,d._)`"use strict"; ${n(q,K)}`),w(E,K),E.code(B)}):E.func(R,(0,d._)`${h.default.data}, ${v(K)}`,A.$async,()=>E.code(n(q,K)).code(B))}function v(E){return(0,d._)`{${h.default.instancePath}="", ${h.default.parentData}, ${h.default.parentDataProperty}, ${h.default.rootData}=${h.default.data}${E.dynamicRef?(0,d._)`, ${h.default.dynamicAnchors}={}`:d.nil}}={}`}function w(E,R){E.if(h.default.valCxt,()=>{E.var(h.default.instancePath,(0,d._)`${h.default.valCxt}.${h.default.instancePath}`),E.var(h.default.parentData,(0,d._)`${h.default.valCxt}.${h.default.parentData}`),E.var(h.default.parentDataProperty,(0,d._)`${h.default.valCxt}.${h.default.parentDataProperty}`),E.var(h.default.rootData,(0,d._)`${h.default.valCxt}.${h.default.rootData}`),R.dynamicRef&&E.var(h.default.dynamicAnchors,(0,d._)`${h.default.valCxt}.${h.default.dynamicAnchors}`)},()=>{E.var(h.default.instancePath,(0,d._)`""`),E.var(h.default.parentData,(0,d._)`undefined`),E.var(h.default.parentDataProperty,(0,d._)`undefined`),E.var(h.default.rootData,h.default.data),R.dynamicRef&&E.var(h.default.dynamicAnchors,(0,d._)`{}`)})}function c(E){const{schema:R,opts:q,gen:A}=E;g(E,()=>{q.$comment&&R.$comment&&F(E),z(E),A.let(h.default.vErrors,null),A.let(h.default.errors,0),q.unevaluated&&u(E),O(E),L(E)})}function u(E){const{gen:R,validateName:q}=E;E.evaluated=R.const("evaluated",(0,d._)`${q}.evaluated`),R.if((0,d._)`${E.evaluated}.dynamicProps`,()=>R.assign((0,d._)`${E.evaluated}.props`,(0,d._)`undefined`)),R.if((0,d._)`${E.evaluated}.dynamicItems`,()=>R.assign((0,d._)`${E.evaluated}.items`,(0,d._)`undefined`))}function n(E,R){const q=typeof E=="object"&&E[R.schemaId];return q&&(R.code.source||R.code.process)?(0,d._)`/*# sourceURL=${q} */`:d.nil}function a(E,R){if(o(E)&&(P(E),y(E))){f(E,R);return}(0,e.boolOrEmptySchema)(E,R)}function y({schema:E,self:R}){if(typeof E=="boolean")return!E;for(const q in E)if(R.RULES.all[q])return!0;return!1}function o(E){return typeof E.schema!="boolean"}function f(E,R){const{schema:q,gen:A,opts:K}=E;K.$comment&&q.$comment&&F(E),C(E),V(E);const B=A.const("_errs",h.default.errors);O(E,B),A.var(R,(0,d._)`${B} === ${h.default.errors}`)}function P(E){(0,_.checkUnknownRules)(E),D(E)}function O(E,R){if(E.opts.jtd)return ie(E,[],!1,R);const q=(0,t.getSchemaTypes)(E.schema),A=(0,t.coerceAndCheckDataType)(E,q);ie(E,q,!A,R)}function D(E){const{schema:R,errSchemaPath:q,opts:A,self:K}=E;R.$ref&&A.ignoreKeywordsWithRef&&(0,_.schemaHasRulesButRef)(R,K.RULES)&&K.logger.warn(`$ref: keywords ignored in schema at path "${q}"`)}function z(E){const{schema:R,opts:q}=E;R.default!==void 0&&q.useDefaults&&q.strictSchema&&(0,_.checkStrictMode)(E,"default is ignored in the schema root")}function C(E){const R=E.schema[E.opts.schemaId];R&&(E.baseId=(0,b.resolveUrl)(E.opts.uriResolver,E.baseId,R))}function V(E){if(E.schema.$async&&!E.schemaEnv.$async)throw new Error("async schema in sync schema")}function F({gen:E,schemaEnv:R,schema:q,errSchemaPath:A,opts:K}){const B=q.$comment;if(K.$comment===!0)E.code((0,d._)`${h.default.self}.logger.log(${B})`);else if(typeof K.$comment=="function"){const re=(0,d.str)`${A}/$comment`,me=E.scopeValue("root",{ref:R.root});E.code((0,d._)`${h.default.self}.opts.$comment(${B}, ${re}, ${me}.schema)`)}}function L(E){const{gen:R,schemaEnv:q,validateName:A,ValidationError:K,opts:B}=E;q.$async?R.if((0,d._)`${h.default.errors} === 0`,()=>R.return(h.default.data),()=>R.throw((0,d._)`new ${K}(${h.default.vErrors})`)):(R.assign((0,d._)`${A}.errors`,h.default.vErrors),B.unevaluated&&X(E),R.return((0,d._)`${h.default.errors} === 0`))}function X({gen:E,evaluated:R,props:q,items:A}){q instanceof d.Name&&E.assign((0,d._)`${R}.props`,q),A instanceof d.Name&&E.assign((0,d._)`${R}.items`,A)}function ie(E,R,q,A){const{gen:K,schema:B,data:re,allErrors:me,opts:ce,self:ue}=E,{RULES:ne}=ue;if(B.$ref&&(ce.ignoreKeywordsWithRef||!(0,_.schemaHasRulesButRef)(B,ne))){K.block(()=>U(E,"$ref",ne.all.$ref.definition));return}ce.jtd||ee(E,R),K.block(()=>{for(const fe of ne.rules)Ee(fe);Ee(ne.post)});function Ee(fe){(0,r.shouldUseGroup)(B,fe)&&(fe.type?(K.if((0,i.checkDataType)(fe.type,re,ce.strictNumbers)),oe(E,fe),R.length===1&&R[0]===fe.type&&q&&(K.else(),(0,i.reportTypeError)(E)),K.endIf()):oe(E,fe),me||K.if((0,d._)`${h.default.errors} === ${A||0}`))}}function oe(E,R){const{gen:q,schema:A,opts:{useDefaults:K}}=E;K&&(0,m.assignDefaults)(E,R.type),q.block(()=>{for(const B of R.rules)(0,r.shouldUseRule)(A,B)&&U(E,B.keyword,B.definition,R.type)})}function ee(E,R){E.schemaEnv.meta||!E.opts.strictTypes||(pe(E,R),E.opts.allowUnionTypes||M(E,R),j(E,E.dataTypes))}function pe(E,R){if(R.length){if(!E.dataTypes.length){E.dataTypes=R;return}R.forEach(q=>{N(E.dataTypes,q)||k(E,`type "${q}" not allowed by context "${E.dataTypes.join(",")}"`)}),l(E,R)}}function M(E,R){R.length>1&&!(R.length===2&&R.includes("null"))&&k(E,"use allowUnionTypes to allow union type keyword")}function j(E,R){const q=E.self.RULES.all;for(const A in q){const K=q[A];if(typeof K=="object"&&(0,r.shouldUseRule)(E.schema,K)){const{type:B}=K.definition;B.length&&!B.some(re=>T(R,re))&&k(E,`missing type "${B.join(",")}" for keyword "${A}"`)}}}function T(E,R){return E.includes(R)||R==="number"&&E.includes("integer")}function N(E,R){return E.includes(R)||R==="integer"&&E.includes("number")}function l(E,R){const q=[];for(const A of E.dataTypes)N(R,A)?q.push(A):R.includes("integer")&&A==="number"&&q.push("integer");E.dataTypes=q}function k(E,R){const q=E.schemaEnv.baseId+E.errSchemaPath;R+=` at "${q}" (strictTypes)`,(0,_.checkStrictMode)(E,R,E.opts.strictTypes)}class I{constructor(R,q,A){if((0,s.validateKeywordUsage)(R,q,A),this.gen=R.gen,this.allErrors=R.allErrors,this.keyword=A,this.data=R.data,this.schema=R.schema[A],this.$data=q.$data&&R.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,_.schemaRefOrVal)(R,this.schema,A,this.$data),this.schemaType=q.schemaType,this.parentSchema=R.schema,this.params={},this.it=R,this.def=q,this.$data)this.schemaCode=R.gen.const("vSchema",Y(this.$data,R));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=R.gen.const("_errs",h.default.errors))}result(R,q,A){this.failResult((0,d.not)(R),q,A)}failResult(R,q,A){this.gen.if(R),A?A():this.error(),q?(this.gen.else(),q(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(R,q){this.failResult((0,d.not)(R),void 0,q)}fail(R){if(R===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(R),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(R){if(!this.$data)return this.fail(R);const{schemaCode:q}=this;this.fail((0,d._)`${q} !== undefined && (${(0,d.or)(this.invalid$data(),R)})`)}error(R,q,A){if(q){this.setParams(q),this._error(R,A),this.setParams({});return}this._error(R,A)}_error(R,q){(R?S.reportExtraError:S.reportError)(this,this.def.error,q)}$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(R){this.allErrors||this.gen.if(R)}setParams(R,q){q?Object.assign(this.params,R):this.params=R}block$data(R,q,A=d.nil){this.gen.block(()=>{this.check$data(R,A),q()})}check$data(R=d.nil,q=d.nil){if(!this.$data)return;const{gen:A,schemaCode:K,schemaType:B,def:re}=this;A.if((0,d.or)((0,d._)`${K} === undefined`,q)),R!==d.nil&&A.assign(R,!0),(B.length||re.validateSchema)&&(A.elseIf(this.invalid$data()),this.$dataError(),R!==d.nil&&A.assign(R,!1)),A.else()}invalid$data(){const{gen:R,schemaCode:q,schemaType:A,def:K,it:B}=this;return(0,d.or)(re(),me());function re(){if(A.length){if(!(q instanceof d.Name))throw new Error("ajv implementation error");const ce=Array.isArray(A)?A:[A];return(0,d._)`${(0,i.checkDataTypes)(ce,q,B.opts.strictNumbers,i.DataType.Wrong)}`}return d.nil}function me(){if(K.validateSchema){const ce=R.scopeValue("validate$data",{ref:K.validateSchema});return(0,d._)`!${ce}(${q})`}return d.nil}}subschema(R,q){const A=(0,p.getSubschema)(this.it,R);(0,p.extendSubschemaData)(A,this.it,R),(0,p.extendSubschemaMode)(A,R);const K={...this.it,...A,items:void 0,props:void 0};return a(K,q),K}mergeEvaluated(R,q){const{it:A,gen:K}=this;A.opts.unevaluated&&(A.props!==!0&&R.props!==void 0&&(A.props=_.mergeEvaluated.props(K,R.props,A.props,q)),A.items!==!0&&R.items!==void 0&&(A.items=_.mergeEvaluated.items(K,R.items,A.items,q)))}mergeValidEvaluated(R,q){const{it:A,gen:K}=this;if(A.opts.unevaluated&&(A.props!==!0||A.items!==!0))return K.if(q,()=>this.mergeEvaluated(R,d.Name)),!0}}ve.KeywordCxt=I;function U(E,R,q,A){const K=new I(E,q,R);"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(E,{dataLevel:R,dataNames:q,dataPathArr:A}){let K,B;if(E==="")return h.default.rootData;if(E[0]==="/"){if(!H.test(E))throw new Error(`Invalid JSON-pointer: ${E}`);K=E,B=h.default.rootData}else{const ue=Q.exec(E);if(!ue)throw new Error(`Invalid JSON-pointer: ${E}`);const ne=+ue[1];if(K=ue[2],K==="#"){if(ne>=R)throw new Error(ce("property/index",ne));return A[R-ne]}if(ne>R)throw new Error(ce("data",ne));if(B=q[R-ne],!K)return B}let re=B;const me=K.split("/");for(const ue of me)ue&&(B=(0,d._)`${B}${(0,d.getProperty)((0,_.unescapeJsonPointer)(ue))}`,re=(0,d._)`${re} && ${B}`);return re;function ce(ue,ne){return`Cannot access ${ue} ${ne} levels up, current level is ${R}`}}return ve.getData=Y,ve}var Ae={},Dr;function dr(){if(Dr)return Ae;Dr=1,Object.defineProperty(Ae,"__esModule",{value:!0});class e extends Error{constructor(r){super("validation failed"),this.errors=r,this.ajv=this.validation=!0}}return Ae.default=e,Ae}var Ve={},Mr;function Bt(){if(Mr)return Ve;Mr=1,Object.defineProperty(Ve,"__esModule",{value:!0});const e=Gt();class t extends Error{constructor(i,m,s,p){super(p||`can't resolve reference ${s} from id ${m}`),this.missingRef=(0,e.resolveUrl)(i,m,s),this.missingSchema=(0,e.normalizeId)((0,e.getFullPath)(i,this.missingRef))}}return Ve.default=t,Ve}var le={},Ar;function lr(){if(Ar)return le;Ar=1,Object.defineProperty(le,"__esModule",{value:!0}),le.resolveSchema=le.getCompilingSchema=le.resolveRef=le.compileSchema=le.SchemaEnv=void 0;const e=W(),t=dr(),r=we(),i=Gt(),m=Z(),s=Wt();class p{constructor(u){var n;this.refs={},this.dynamicAnchors={};let a;typeof u.schema=="object"&&(a=u.schema),this.schema=u.schema,this.schemaId=u.schemaId,this.root=u.root||this,this.baseId=(n=u.baseId)!==null&&n!==void 0?n:(0,i.normalizeId)(a?.[u.schemaId||"$id"]),this.schemaPath=u.schemaPath,this.localRefs=u.localRefs,this.meta=u.meta,this.$async=a?.$async,this.refs={}}}le.SchemaEnv=p;function d(c){const u=_.call(this,c);if(u)return u;const n=(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 O=f.scopeName("validate");c.validateName=O;const D={gen:f,allErrors:this.opts.allErrors,data:r.default.data,parentData:r.default.parentData,parentDataProperty:r.default.parentDataProperty,dataNames:[r.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:O,ValidationError:P,schema:c.schema,schemaEnv:c,rootId:n,baseId:c.baseId||n,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(r.default.scope)}return ${C}`,this.opts.code.process&&(z=this.opts.code.process(z,c));const F=new Function(`${r.default.self}`,`${r.default.scope}`,z)(this,this.scope.get());if(this.scope.value(O,{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:O,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=d;function h(c,u,n){var a;n=(0,i.resolveUrl)(this.opts.uriResolver,u,n);const y=c.refs[n];if(y)return y;let o=$.call(this,c,n);if(o===void 0){const f=(a=c.localRefs)===null||a===void 0?void 0:a[n],{schemaId:P}=this.opts;f&&(o=new p({schema:f,schemaId:P,root:c,baseId:u}))}if(o!==void 0)return c.refs[n]=b.call(this,o)}le.resolveRef=h;function b(c){return(0,i.inlineRef)(c.schema,this.opts.inlineRefs)?c.schema:c.validate?c:d.call(this,c)}function _(c){for(const u of this._compilations)if(S(u,c))return u}le.getCompilingSchema=_;function S(c,u){return c.schema===u.schema&&c.root===u.root&&c.baseId===u.baseId}function $(c,u){let n;for(;typeof(n=this.refs[u])=="string";)u=n;return n||this.schemas[u]||g.call(this,c,u)}function g(c,u){const n=this.opts.uriResolver.parse(u),a=(0,i._getFullPath)(this.opts.uriResolver,n);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,n,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,n,P)}if(typeof f?.schema=="object"){if(f.validate||d.call(this,f),o===(0,i.normalizeId)(u)){const{schema:P}=f,{schemaId:O}=this.opts,D=P[O];return D&&(y=(0,i.resolveUrl)(this.opts.uriResolver,y,D)),new p({schema:P,schemaId:O,root:c,baseId:y})}return w.call(this,n,f)}}le.resolveSchema=g;const v=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function w(c,{baseId:u,schema:n,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 n=="boolean")return;const O=n[(0,m.unescapeFragment)(P)];if(O===void 0)return;n=O;const D=typeof n=="object"&&n[this.opts.schemaId];!v.has(P)&&D&&(u=(0,i.resolveUrl)(this.opts.uriResolver,u,D))}let o;if(typeof n!="boolean"&&n.$ref&&!(0,m.schemaHasRulesButRef)(n,this.RULES)){const P=(0,i.resolveUrl)(this.opts.uriResolver,u,n.$ref);o=g.call(this,a,P)}const{schemaId:f}=this.opts;if(o=o||new p({schema:n,schemaId:f,root:a,baseId:u}),o.schema!==o.root.schema)return o}return le}const is="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",os="Meta-schema for $data reference (JSON AnySchema extension proposal)",as="object",cs=["$data"],us={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},ds=!1,ls={$id:is,description:os,type:as,required:cs,properties:us,additionalProperties:ds};var ze={},Ie={exports:{}},ir,Vr;function Vn(){if(Vr)return ir;Vr=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 r($){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 m($){return $.length=0,!0}function s($,g,v){if($.length){const w=r($);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 u=!1,n=!1,a=s;for(let y=0;y<$.length;y++){const o=$[y];if(!(o==="["||o==="]"))if(o===":"){if(u===!0&&(n=!0),!a(c,w,v))break;if(++g>7){v.error=!0;break}y>0&&$[y-1]===":"&&(u=!0),w.push(":");continue}else if(o==="%"){if(!a(c,w,v))break;a=m}else{c.push(o);continue}}return c.length&&(a===m?v.zone=c.join(""):n?w.push(c.join("")):w.push(r(c))),v.address=w.join(""),v}function d($){if(h($,":")<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 h($,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=d(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:S,normalizeComponentEncoding:_,removeDotSegments:b,isIPv4:t,isUUID:e,normalizeIPv6:d,stringArrayToHexStripped:r},ir}var or,zr;function fs(){if(zr)return or;zr=1;const{isUUID:e}=Vn(),t=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,r=["http","https","ws","wss","urn","urn:uuid"];function i(o){return r.indexOf(o)!==-1}function m(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 d(o){return o.secure=m(o),o.resourceName=(o.path||"/")+(o.query?"?"+o.query:""),o.path=void 0,o.query=void 0,o}function h(o){if((o.port===(m(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 O=f.scheme||o.scheme||"urn";o.nid=P[1].toLowerCase(),o.nss=P[2];const D=`${O}:${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",O=o.nid.toLowerCase(),D=`${P}:${f.nid||O}`,z=y(D);z&&(o=z.serialize(o,f));const C=o,V=o.nss;return C.path=`${O||f.nid}:${V}`,f.skipEscape=!0,C}function S(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:d,serialize:h},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:S,serialize:$,skipNormalize:!0}};Object.setPrototypeOf(a,null);function y(o){return o&&(a[o]||a[o.toLowerCase()])||void 0}return or={wsIsSecure:m,SCHEMES:a,isValidSchemeName:i,getSchemeHandler:y},or}var Fr;function ps(){if(Fr)return Ie.exports;Fr=1;const{normalizeIPv6:e,removeDotSegments:t,recomposeAuthority:r,normalizeComponentEncoding:i,isIPv4:m,nonSimpleDomain:s}=Vn(),{SCHEMES:p,getSchemeHandler:d}=fs();function h(c,u){return typeof c=="string"?c=$(v(c,u),u):typeof c=="object"&&(c=v($(c,u),u)),c}function b(c,u,n){const a=n?Object.assign({scheme:"null"},n):{scheme:"null"},y=_(v(c,a),v(u,a),a,!0);return a.skipEscape=!0,$(y,a)}function _(c,u,n,a){const y={};return a||(c=v($(c,n),n),u=v($(u,n),n)),n=n||{},!n.tolerant&&u.scheme?(y.scheme=u.scheme,y.userinfo=u.userinfo,y.host=u.host,y.port=u.port,y.path=t(u.path||""),y.query=u.query):(u.userinfo!==void 0||u.host!==void 0||u.port!==void 0?(y.userinfo=u.userinfo,y.host=u.host,y.port=u.port,y.path=t(u.path||""),y.query=u.query):(u.path?(u.path[0]==="/"?y.path=t(u.path):((c.userinfo!==void 0||c.host!==void 0||c.port!==void 0)&&!c.path?y.path="/"+u.path:c.path?y.path=c.path.slice(0,c.path.lastIndexOf("/")+1)+u.path:y.path=u.path,y.path=t(y.path)),y.query=u.query):(y.path=c.path,u.query!==void 0?y.query=u.query:y.query=c.query),y.userinfo=c.userinfo,y.host=c.host,y.port=c.port),y.scheme=c.scheme),y.fragment=u.fragment,y}function S(c,u,n){return typeof c=="string"?(c=unescape(c),c=$(i(v(c,n),!0),{...n,skipEscape:!0})):typeof c=="object"&&(c=$(i(c,!0),{...n,skipEscape:!0})),typeof u=="string"?(u=unescape(u),u=$(i(v(u,n),!0),{...n,skipEscape:!0})):typeof u=="object"&&(u=$(i(u,!0),{...n,skipEscape:!0})),c.toLowerCase()===u.toLowerCase()}function $(c,u){const n={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({},u),y=[],o=d(a.scheme||n.scheme);o&&o.serialize&&o.serialize(n,a),n.path!==void 0&&(a.skipEscape?n.path=unescape(n.path):(n.path=escape(n.path),n.scheme!==void 0&&(n.path=n.path.split("%3A").join(":")))),a.reference!=="suffix"&&n.scheme&&y.push(n.scheme,":");const f=r(n);if(f!==void 0&&(a.reference!=="suffix"&&y.push("//"),y.push(f),n.path&&n.path[0]!=="/"&&y.push("/")),n.path!==void 0){let P=n.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 n.query!==void 0&&y.push("?",n.query),n.fragment!==void 0&&y.push("#",n.fragment),y.join("")}const g=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function v(c,u){const n=Object.assign({},u),a={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let y=!1;n.reference==="suffix"&&(n.scheme?c=n.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(m(a.host)===!1){const O=e(a.host);a.host=O.host.toLowerCase(),y=O.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",n.reference&&n.reference!=="suffix"&&n.reference!==a.reference&&(a.error=a.error||"URI is not a "+n.reference+" reference.");const f=d(n.scheme||a.scheme);if(!n.unicodeSupport&&(!f||!f.unicodeSupport)&&a.host&&(n.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,n)}else a.error=a.error||"URI can not be parsed.";return a}const w={SCHEMES:p,normalize:h,resolve:b,resolveComponent:_,equal:S,serialize:$,parse:v};return Ie.exports=w,Ie.exports.default=w,Ie.exports.fastUri=w,Ie.exports}var Lr;function ms(){if(Lr)return ze;Lr=1,Object.defineProperty(ze,"__esModule",{value:!0});const e=ps();return e.code='require("ajv/dist/runtime/uri").default',ze.default=e,ze}var Ur;function hs(){return Ur||(Ur=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=Wt();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=W();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});const i=dr(),m=Bt(),s=Dn(),p=lr(),d=W(),h=Gt(),b=wt(),_=Z(),S=ls,$=ms(),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."},u={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},n=200;function a(M){var j,T,N,l,k,I,U,H,Q,Y,E,R,q,A,K,B,re,me,ce,ue,ne,Ee,fe,Yt,Zt;const Ne=M.strict,Qt=(j=M.code)===null||j===void 0?void 0:j.optimize,mr=Qt===!0||Qt===void 0?1:Qt||0,hr=(N=(T=M.code)===null||T===void 0?void 0:T.regExp)!==null&&N!==void 0?N:g,xn=(l=M.uriResolver)!==null&&l!==void 0?l:$.default;return{strictSchema:(I=(k=M.strictSchema)!==null&&k!==void 0?k:Ne)!==null&&I!==void 0?I:!0,strictNumbers:(H=(U=M.strictNumbers)!==null&&U!==void 0?U:Ne)!==null&&H!==void 0?H:!0,strictTypes:(Y=(Q=M.strictTypes)!==null&&Q!==void 0?Q:Ne)!==null&&Y!==void 0?Y:"log",strictTuples:(R=(E=M.strictTuples)!==null&&E!==void 0?E:Ne)!==null&&R!==void 0?R:"log",strictRequired:(A=(q=M.strictRequired)!==null&&q!==void 0?q:Ne)!==null&&A!==void 0?A:!1,code:M.code?{...M.code,optimize:mr,regExp:hr}:{optimize:mr,regExp:hr},loopRequired:(K=M.loopRequired)!==null&&K!==void 0?K:n,loopEnum:(B=M.loopEnum)!==null&&B!==void 0?B:n,meta:(re=M.meta)!==null&&re!==void 0?re:!0,messages:(me=M.messages)!==null&&me!==void 0?me:!0,inlineRefs:(ce=M.inlineRefs)!==null&&ce!==void 0?ce:!0,schemaId:(ue=M.schemaId)!==null&&ue!==void 0?ue:"$id",addUsedSchema:(ne=M.addUsedSchema)!==null&&ne!==void 0?ne:!0,validateSchema:(Ee=M.validateSchema)!==null&&Ee!==void 0?Ee:!0,validateFormats:(fe=M.validateFormats)!==null&&fe!==void 0?fe:!0,unicodeRegExp:(Yt=M.unicodeRegExp)!==null&&Yt!==void 0?Yt:!0,int32range:(Zt=M.int32range)!==null&&Zt!==void 0?Zt:!0,uriResolver:xn}}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:N}=this.opts.code;this.scope=new d.ValueScope({scope:{},prefixes:w,es5:T,lines:N}),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,u,j,"DEPRECATED","warn"),this._metaOpts=z.call(this),j.formats&&O.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:N}=this.opts;let l=S;N==="id"&&(l={...S},l.id=l.$id,delete l.$id),T&&j&&this.addMetaSchema(l,l[N],!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 N;if(typeof j=="string"){if(N=this.getSchema(j),!N)throw new Error(`no schema with key or ref "${j}"`)}else N=this.compile(j);const l=N(T);return"$async"in N||(this.errors=N.errors),l}compile(j,T){const N=this._addSchema(j,T);return N.validate||this._compileSchemaEnv(N)}compileAsync(j,T){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:N}=this.opts;return l.call(this,j,T);async function l(Y,E){await k.call(this,Y.$schema);const R=this._addSchema(Y,E);return R.validate||I.call(this,R)}async function k(Y){Y&&!this.getSchema(Y)&&await l.call(this,{$ref:Y},!0)}async function I(Y){try{return this._compileSchemaEnv(Y)}catch(E){if(!(E instanceof m.default))throw E;return U.call(this,E),await H.call(this,E.missingSchema),I.call(this,Y)}}function U({missingSchema:Y,missingRef:E}){if(this.refs[Y])throw new Error(`AnySchema ${Y} is loaded but ${E} cannot be resolved`)}async function H(Y){const E=await Q.call(this,Y);this.refs[Y]||await k.call(this,E.$schema),this.refs[Y]||this.addSchema(E,Y,T)}async function Q(Y){const E=this._loading[Y];if(E)return E;try{return await(this._loading[Y]=N(Y))}finally{delete this._loading[Y]}}}addSchema(j,T,N,l=this.opts.validateSchema){if(Array.isArray(j)){for(const I of j)this.addSchema(I,void 0,N,l);return this}let k;if(typeof j=="object"){const{schemaId:I}=this.opts;if(k=j[I],k!==void 0&&typeof k!="string")throw new Error(`schema ${I} must be string`)}return T=(0,h.normalizeId)(T||k),this._checkUnique(T),this.schemas[T]=this._addSchema(j,N,T,l,!0),this}addMetaSchema(j,T,N=this.opts.validateSchema){return this.addSchema(j,T,!0,N),this}validateSchema(j,T){if(typeof j=="boolean")return!0;let N;if(N=j.$schema,N!==void 0&&typeof N!="string")throw new Error("$schema must be a string");if(N=N||this.opts.defaultMeta||this.defaultMeta(),!N)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const l=this.validate(N,j);if(!l&&T){const k="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(k);else throw new Error(k)}return l}getSchema(j){let T;for(;typeof(T=f.call(this,j))=="string";)j=T;if(T===void 0){const{schemaId:N}=this.opts,l=new p.SchemaEnv({schema:{},schemaId:N});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 N=j[this.opts.schemaId];return N&&(N=(0,h.normalizeId)(N),delete this.schemas[N],delete this.refs[N]),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 N;if(typeof j=="string")N=j,typeof T=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),T.keyword=N);else if(typeof j=="object"&&T===void 0){if(T=j,N=T.keyword,Array.isArray(N)&&!N.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(L.call(this,N,T),!T)return(0,_.eachItem)(N,k=>X.call(this,k)),this;oe.call(this,T);const l={...T,type:(0,b.getJSONTypes)(T.type),schemaType:(0,b.getJSONTypes)(T.schemaType)};return(0,_.eachItem)(N,l.type.length===0?k=>X.call(this,k,l):k=>l.type.forEach(I=>X.call(this,k,l,I))),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 N of T.rules){const l=N.rules.findIndex(k=>k.keyword===j);l>=0&&N.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:N="data"}={}){return!j||j.length===0?"No errors":j.map(l=>`${N}${l.instancePath} ${l.message}`).reduce((l,k)=>l+T+k)}$dataMetaSchema(j,T){const N=this.RULES.all;j=JSON.parse(JSON.stringify(j));for(const l of T){const k=l.split("/").slice(1);let I=j;for(const U of k)I=I[U];for(const U in N){const H=N[U];if(typeof H!="object")continue;const{$data:Q}=H.definition,Y=I[U];Q&&Y&&(I[U]=pe(Y))}}return j}_removeAllSchemas(j,T){for(const N in j){const l=j[N];(!T||T.test(N))&&(typeof l=="string"?delete j[N]:l&&!l.meta&&(this._cache.delete(l.schema),delete j[N]))}}_addSchema(j,T,N,l=this.opts.validateSchema,k=this.opts.addUsedSchema){let I;const{schemaId:U}=this.opts;if(typeof j=="object")I=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;N=(0,h.normalizeId)(I||N);const Q=h.getSchemaRefs.call(this,j,N);return H=new p.SchemaEnv({schema:j,schemaId:U,meta:T,baseId:N,localRefs:Q}),this._cache.set(H.schema,H),k&&!N.startsWith("#")&&(N&&this._checkUnique(N),this.refs[N]=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=m.default,e.default=y;function o(M,j,T,N="error"){for(const l in M){const k=l;k in j&&this.logger[N](`${T}: option ${l}. ${M[k]}`)}}function f(M){return M=(0,h.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 O(){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,N=>{if(T.keywords[N])throw new Error(`Keyword ${N} is already defined`);if(!F.test(N))throw new Error(`Keyword ${N} 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 N;const l=j?.post;if(T&&l)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:k}=this;let I=l?k.post:k.rules.find(({type:H})=>H===T);if(I||(I={type:T,rules:[]},k.rules.push(I)),k.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?ie.call(this,I,U,j.before):I.rules.push(U),k.all[M]=U,(N=j.implements)===null||N===void 0||N.forEach(H=>this.addKeyword(H))}function ie(M,j,T){const N=M.rules.findIndex(l=>l.keyword===T);N>=0?M.rules.splice(N,0,j):(M.rules.push(j),this.logger.warn(`rule ${T} is not defined`))}function oe(M){let{metaSchema:j}=M;j!==void 0&&(M.$data&&this.opts.$data&&(j=pe(j)),M.validateSchema=this.compile(j,!0))}const ee={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function pe(M){return{anyOf:[M,ee]}}})(Xt)),Xt}var Fe={},Le={},Ue={},Kr;function ys(){if(Kr)return Ue;Kr=1,Object.defineProperty(Ue,"__esModule",{value:!0});const e={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};return Ue.default=e,Ue}var be={},Hr;function gs(){if(Hr)return be;Hr=1,Object.defineProperty(be,"__esModule",{value:!0}),be.callRef=be.getValidate=void 0;const e=Bt(),t=ge(),r=W(),i=we(),m=lr(),s=Z(),p={keyword:"$ref",schemaType:"string",code(b){const{gen:_,schema:S,it:$}=b,{baseId:g,schemaEnv:v,validateName:w,opts:c,self:u}=$,{root:n}=v;if((S==="#"||S==="#/")&&g===n.baseId)return y();const a=m.resolveRef.call(u,n,g,S);if(a===void 0)throw new e.default($.opts.uriResolver,g,S);if(a instanceof m.SchemaEnv)return o(a);return f(a);function y(){if(v===n)return h(b,w,v,v.$async);const P=_.scopeValue("root",{ref:n});return h(b,(0,r._)`${P}.validate`,n,n.$async)}function o(P){const O=d(b,P);h(b,O,P,P.$async)}function f(P){const O=_.scopeValue("schema",c.code.source===!0?{ref:P,code:(0,r.stringify)(P)}:{ref:P}),D=_.name("valid"),z=b.subschema({schema:P,dataTypes:[],schemaPath:r.nil,topSchemaRef:O,errSchemaPath:S},D);b.mergeEvaluated(z),b.ok(D)}}};function d(b,_){const{gen:S}=b;return _.validate?S.scopeValue("validate",{ref:_.validate}):(0,r._)`${S.scopeValue("wrapper",{ref:_})}.validate`}be.getValidate=d;function h(b,_,S,$){const{gen:g,it:v}=b,{allErrors:w,schemaEnv:c,opts:u}=v,n=u.passContext?i.default.this:r.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,r._)`await ${(0,t.callValidateCode)(b,_,n)}`),f(_),w||g.assign(P,!0)},O=>{g.if((0,r._)`!(${O} instanceof ${v.ValidationError})`,()=>g.throw(O)),o(O),w||g.assign(P,!1)}),b.ok(P)}function y(){b.result((0,t.callValidateCode)(b,_,n),()=>f(_),()=>o(_))}function o(P){const O=(0,r._)`${P}.errors`;g.assign(i.default.vErrors,(0,r._)`${i.default.vErrors} === null ? ${O} : ${i.default.vErrors}.concat(${O})`),g.assign(i.default.errors,(0,r._)`${i.default.vErrors}.length`)}function f(P){var O;if(!v.opts.unevaluated)return;const D=(O=S?.validate)===null||O===void 0?void 0:O.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,r._)`${P}.evaluated.props`);v.props=s.mergeEvaluated.props(g,z,v.props,r.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,r._)`${P}.evaluated.items`);v.items=s.mergeEvaluated.items(g,z,v.items,r.Name)}}}return be.callRef=h,be.default=p,be}var Jr;function vs(){if(Jr)return Le;Jr=1,Object.defineProperty(Le,"__esModule",{value:!0});const e=ys(),t=gs(),r=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,t.default];return Le.default=r,Le}var Ke={},He={},Gr;function _s(){if(Gr)return He;Gr=1,Object.defineProperty(He,"__esModule",{value:!0});const e=W(),t=e.operators,r={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 ${r[s].okStr} ${p}`,params:({keyword:s,schemaCode:p})=>(0,e._)`{comparison: ${r[s].okStr}, limit: ${p}}`},m={keyword:Object.keys(r),type:"number",schemaType:"number",$data:!0,error:i,code(s){const{keyword:p,data:d,schemaCode:h}=s;s.fail$data((0,e._)`${d} ${r[p].fail} ${h} || isNaN(${d})`)}};return He.default=m,He}var Je={},Wr;function $s(){if(Wr)return Je;Wr=1,Object.defineProperty(Je,"__esModule",{value:!0});const e=W(),r={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:m,data:s,schemaCode:p,it:d}=i,h=d.opts.multipleOfPrecision,b=m.let("res"),_=h?(0,e._)`Math.abs(Math.round(${b}) - ${b}) > 1e-${h}`:(0,e._)`${b} !== parseInt(${b})`;i.fail$data((0,e._)`(${p} === 0 || (${b} = ${s}/${p}, ${_}))`)}};return Je.default=r,Je}var Ge={},We={},Br;function bs(){if(Br)return We;Br=1,Object.defineProperty(We,"__esModule",{value:!0});function e(t){const r=t.length;let i=0,m=0,s;for(;m<r;)i++,s=t.charCodeAt(m++),s>=55296&&s<=56319&&m<r&&(s=t.charCodeAt(m),(s&64512)===56320&&m++);return i}return We.default=e,e.code='require("ajv/dist/runtime/ucs2length").default',We}var Yr;function ws(){if(Yr)return Ge;Yr=1,Object.defineProperty(Ge,"__esModule",{value:!0});const e=W(),t=Z(),r=bs(),m={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:s,schemaCode:p}){const d=s==="maxLength"?"more":"fewer";return(0,e.str)`must NOT have ${d} than ${p} characters`},params:({schemaCode:s})=>(0,e._)`{limit: ${s}}`},code(s){const{keyword:p,data:d,schemaCode:h,it:b}=s,_=p==="maxLength"?e.operators.GT:e.operators.LT,S=b.opts.unicode===!1?(0,e._)`${d}.length`:(0,e._)`${(0,t.useFunc)(s.gen,r.default)}(${d})`;s.fail$data((0,e._)`${S} ${_} ${h}`)}};return Ge.default=m,Ge}var Be={},Zr;function Ps(){if(Zr)return Be;Zr=1,Object.defineProperty(Be,"__esModule",{value:!0});const e=ge(),t=W(),i={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:m})=>(0,t.str)`must match pattern "${m}"`,params:({schemaCode:m})=>(0,t._)`{pattern: ${m}}`},code(m){const{data:s,$data:p,schema:d,schemaCode:h,it:b}=m,_=b.opts.unicodeRegExp?"u":"",S=p?(0,t._)`(new RegExp(${h}, ${_}))`:(0,e.usePattern)(m,d);m.fail$data((0,t._)`!${S}.test(${s})`)}};return Be.default=i,Be}var Ye={},Qr;function ks(){if(Qr)return Ye;Qr=1,Object.defineProperty(Ye,"__esModule",{value:!0});const e=W(),r={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:i,schemaCode:m}){const s=i==="maxProperties"?"more":"fewer";return(0,e.str)`must NOT have ${s} than ${m} properties`},params:({schemaCode:i})=>(0,e._)`{limit: ${i}}`},code(i){const{keyword:m,data:s,schemaCode:p}=i,d=m==="maxProperties"?e.operators.GT:e.operators.LT;i.fail$data((0,e._)`Object.keys(${s}).length ${d} ${p}`)}};return Ye.default=r,Ye}var Ze={},Xr;function Ss(){if(Xr)return Ze;Xr=1,Object.defineProperty(Ze,"__esModule",{value:!0});const e=ge(),t=W(),r=Z(),m={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:d,schemaCode:h,data:b,$data:_,it:S}=s,{opts:$}=S;if(!_&&d.length===0)return;const g=d.length>=$.loopRequired;if(S.allErrors?v():w(),$.strictRequired){const n=s.parentSchema.properties,{definedProperties:a}=s.it;for(const y of d)if(n?.[y]===void 0&&!a.has(y)){const o=S.schemaEnv.baseId+S.errSchemaPath,f=`required property "${y}" is not defined at "${o}" (strictRequired)`;(0,r.checkStrictMode)(S,f,S.opts.strictRequired)}}function v(){if(g||_)s.block$data(t.nil,c);else for(const n of d)(0,e.checkReportMissingProp)(s,n)}function w(){const n=p.let("missing");if(g||_){const a=p.let("valid",!0);s.block$data(a,()=>u(n,a)),s.ok(a)}else p.if((0,e.checkMissingProp)(s,d,n)),(0,e.reportMissingProp)(s,n),p.else()}function c(){p.forOf("prop",h,n=>{s.setParams({missingProperty:n}),p.if((0,e.noPropertyInData)(p,b,n,$.ownProperties),()=>s.error())})}function u(n,a){s.setParams({missingProperty:n}),p.forOf(n,h,()=>{p.assign(a,(0,e.propertyInData)(p,b,n,$.ownProperties)),p.if((0,t.not)(a),()=>{s.error(),p.break()})},t.nil)}}};return Ze.default=m,Ze}var Qe={},xr;function Es(){if(xr)return Qe;xr=1,Object.defineProperty(Qe,"__esModule",{value:!0});const e=W(),r={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:i,schemaCode:m}){const s=i==="maxItems"?"more":"fewer";return(0,e.str)`must NOT have ${s} than ${m} items`},params:({schemaCode:i})=>(0,e._)`{limit: ${i}}`},code(i){const{keyword:m,data:s,schemaCode:p}=i,d=m==="maxItems"?e.operators.GT:e.operators.LT;i.fail$data((0,e._)`${s}.length ${d} ${p}`)}};return Qe.default=r,Qe}var Xe={},xe={},en;function fr(){if(en)return xe;en=1,Object.defineProperty(xe,"__esModule",{value:!0});const e=An();return e.code='require("ajv/dist/runtime/equal").default',xe.default=e,xe}var tn;function js(){if(tn)return Xe;tn=1,Object.defineProperty(Xe,"__esModule",{value:!0});const e=wt(),t=W(),r=Z(),i=fr(),s={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:p,j:d}})=>(0,t.str)`must NOT have duplicate items (items ## ${d} and ${p} are identical)`,params:({params:{i:p,j:d}})=>(0,t._)`{i: ${p}, j: ${d}}`},code(p){const{gen:d,data:h,$data:b,schema:_,parentSchema:S,schemaCode:$,it:g}=p;if(!b&&!_)return;const v=d.let("valid"),w=S.items?(0,e.getSchemaTypes)(S.items):[];p.block$data(v,c,(0,t._)`${$} === false`),p.ok(v);function c(){const y=d.let("i",(0,t._)`${h}.length`),o=d.let("j");p.setParams({i:y,j:o}),d.assign(v,!0),d.if((0,t._)`${y} > 1`,()=>(u()?n:a)(y,o))}function u(){return w.length>0&&!w.some(y=>y==="object"||y==="array")}function n(y,o){const f=d.name("item"),P=(0,e.checkDataTypes)(w,f,g.opts.strictNumbers,e.DataType.Wrong),O=d.const("indices",(0,t._)`{}`);d.for((0,t._)`;${y}--;`,()=>{d.let(f,(0,t._)`${h}[${y}]`),d.if(P,(0,t._)`continue`),w.length>1&&d.if((0,t._)`typeof ${f} == "string"`,(0,t._)`${f} += "_"`),d.if((0,t._)`typeof ${O}[${f}] == "number"`,()=>{d.assign(o,(0,t._)`${O}[${f}]`),p.error(),d.assign(v,!1).break()}).code((0,t._)`${O}[${f}] = ${y}`)})}function a(y,o){const f=(0,r.useFunc)(d,i.default),P=d.name("outer");d.label(P).for((0,t._)`;${y}--;`,()=>d.for((0,t._)`${o} = ${y}; ${o}--;`,()=>d.if((0,t._)`${f}(${h}[${y}], ${h}[${o}])`,()=>{p.error(),d.assign(v,!1).break(P)})))}}};return Xe.default=s,Xe}var et={},rn;function Rs(){if(rn)return et;rn=1,Object.defineProperty(et,"__esModule",{value:!0});const e=W(),t=Z(),r=fr(),m={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:s})=>(0,e._)`{allowedValue: ${s}}`},code(s){const{gen:p,data:d,$data:h,schemaCode:b,schema:_}=s;h||_&&typeof _=="object"?s.fail$data((0,e._)`!${(0,t.useFunc)(p,r.default)}(${d}, ${b})`):s.fail((0,e._)`${_} !== ${d}`)}};return et.default=m,et}var tt={},nn;function Ns(){if(nn)return tt;nn=1,Object.defineProperty(tt,"__esModule",{value:!0});const e=W(),t=Z(),r=fr(),m={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:d,$data:h,schema:b,schemaCode:_,it:S}=s;if(!h&&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,r.default));let w;if($||h)w=p.let("valid"),s.block$data(w,c);else{if(!Array.isArray(b))throw new Error("ajv implementation error");const n=p.const("vSchema",_);w=(0,e.or)(...b.map((a,y)=>u(n,y)))}s.pass(w);function c(){p.assign(w,!1),p.forOf("v",_,n=>p.if((0,e._)`${v()}(${d}, ${n})`,()=>p.assign(w,!0).break()))}function u(n,a){const y=b[a];return typeof y=="object"&&y!==null?(0,e._)`${v()}(${d}, ${n}[${a}])`:(0,e._)`${d} === ${y}`}}};return tt.default=m,tt}var sn;function Os(){if(sn)return Ke;sn=1,Object.defineProperty(Ke,"__esModule",{value:!0});const e=_s(),t=$s(),r=ws(),i=Ps(),m=ks(),s=Ss(),p=Es(),d=js(),h=Rs(),b=Ns(),_=[e.default,t.default,r.default,i.default,m.default,s.default,p.default,d.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},h.default,b.default];return Ke.default=_,Ke}var rt={},je={},on;function zn(){if(on)return je;on=1,Object.defineProperty(je,"__esModule",{value:!0}),je.validateAdditionalItems=void 0;const e=W(),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:d}=s,{items:h}=p;if(!Array.isArray(h)){(0,t.checkStrictMode)(d,'"additionalItems" is ignored when "items" is not an array of schemas');return}m(s,h)}};function m(s,p){const{gen:d,schema:h,data:b,keyword:_,it:S}=s;S.items=!0;const $=d.const("len",(0,e._)`${b}.length`);if(h===!1)s.setParams({len:p.length}),s.pass((0,e._)`${$} <= ${p.length}`);else if(typeof h=="object"&&!(0,t.alwaysValidSchema)(S,h)){const v=d.var("valid",(0,e._)`${$} <= ${p.length}`);d.if((0,e.not)(v),()=>g(v)),s.ok(v)}function g(v){d.forRange("i",p.length,$,w=>{s.subschema({keyword:_,dataProp:w,dataPropType:t.Type.Num},v),S.allErrors||d.if((0,e.not)(v),()=>d.break())})}}return je.validateAdditionalItems=m,je.default=i,je}var nt={},Re={},an;function Fn(){if(an)return Re;an=1,Object.defineProperty(Re,"__esModule",{value:!0}),Re.validateTuple=void 0;const e=W(),t=Z(),r=ge(),i={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(s){const{schema:p,it:d}=s;if(Array.isArray(p))return m(s,"additionalItems",p);d.items=!0,!(0,t.alwaysValidSchema)(d,p)&&s.ok((0,r.validateArray)(s))}};function m(s,p,d=s.schema){const{gen:h,parentSchema:b,data:_,keyword:S,it:$}=s;w(b),$.opts.unevaluated&&d.length&&$.items!==!0&&($.items=t.mergeEvaluated.items(h,d.length,$.items));const g=h.name("valid"),v=h.const("len",(0,e._)`${_}.length`);d.forEach((c,u)=>{(0,t.alwaysValidSchema)($,c)||(h.if((0,e._)`${v} > ${u}`,()=>s.subschema({keyword:S,schemaProp:u,dataProp:u},g)),s.ok(g))});function w(c){const{opts:u,errSchemaPath:n}=$,a=d.length,y=a===c.minItems&&(a===c.maxItems||c[p]===!1);if(u.strictTuples&&!y){const o=`"${S}" is ${a}-tuple, but minItems or maxItems/${p} are not specified or different at path "${n}"`;(0,t.checkStrictMode)($,o,u.strictTuples)}}}return Re.validateTuple=m,Re.default=i,Re}var cn;function Is(){if(cn)return nt;cn=1,Object.defineProperty(nt,"__esModule",{value:!0});const e=Fn(),t={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:r=>(0,e.validateTuple)(r,"items")};return nt.default=t,nt}var st={},un;function Cs(){if(un)return st;un=1,Object.defineProperty(st,"__esModule",{value:!0});const e=W(),t=Z(),r=ge(),i=zn(),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:d,parentSchema:h,it:b}=p,{prefixItems:_}=h;b.items=!0,!(0,t.alwaysValidSchema)(b,d)&&(_?(0,i.validateAdditionalItems)(p,_):p.ok((0,r.validateArray)(p)))}};return st.default=s,st}var it={},dn;function qs(){if(dn)return it;dn=1,Object.defineProperty(it,"__esModule",{value:!0});const e=W(),t=Z(),i={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:m,max:s}})=>s===void 0?(0,e.str)`must contain at least ${m} valid item(s)`:(0,e.str)`must contain at least ${m} and no more than ${s} valid item(s)`,params:({params:{min:m,max:s}})=>s===void 0?(0,e._)`{minContains: ${m}}`:(0,e._)`{minContains: ${m}, maxContains: ${s}}`},code(m){const{gen:s,schema:p,parentSchema:d,data:h,it:b}=m;let _,S;const{minContains:$,maxContains:g}=d;b.opts.next?(_=$===void 0?1:$,S=g):_=1;const v=s.const("len",(0,e._)`${h}.length`);if(m.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'),m.fail();return}if((0,t.alwaysValidSchema)(b,p)){let a=(0,e._)`${v} >= ${_}`;S!==void 0&&(a=(0,e._)`${a} && ${v} <= ${S}`),m.pass(a);return}b.items=!0;const w=s.name("valid");S===void 0&&_===1?u(w,()=>s.if(w,()=>s.break())):_===0?(s.let(w,!0),S!==void 0&&s.if((0,e._)`${h}.length > 0`,c)):(s.let(w,!1),c()),m.result(w,()=>m.reset());function c(){const a=s.name("_valid"),y=s.let("count",0);u(a,()=>s.if(a,()=>n(y)))}function u(a,y){s.forRange("i",0,v,o=>{m.subschema({keyword:"contains",dataProp:o,dataPropType:t.Type.Num,compositeRule:!0},a),y()})}function n(a){s.code((0,e._)`${a}++`),S===void 0?s.if((0,e._)`${a} >= ${_}`,()=>s.assign(w,!0).break()):(s.if((0,e._)`${a} > ${S}`,()=>s.assign(w,!1).break()),_===1?s.assign(w,!0):s.if((0,e._)`${a} >= ${_}`,()=>s.assign(w,!0)))}}};return it.default=i,it}var ar={},ln;function Ts(){return ln||(ln=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=W(),r=Z(),i=ge();e.error={message:({params:{property:h,depsCount:b,deps:_}})=>{const S=b===1?"property":"properties";return(0,t.str)`must have ${S} ${_} when property ${h} is present`},params:({params:{property:h,depsCount:b,deps:_,missingProperty:S}})=>(0,t._)`{property: ${h},
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function Tn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var De={exports:{}},Xt={},ve={},Pe={},xt={},er={},tr={},yr;function bt(){return yr||(yr=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 r extends t{constructor(n){if(super(),!e.IDENTIFIER.test(n))throw new Error("CodeGen: name must be a valid identifier");this.str=n}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=r;class o extends t{constructor(n){super(),this._items=typeof n=="string"?[n]:n}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const n=this._items[0];return n===""||n==='""'}get str(){var n;return(n=this._str)!==null&&n!==void 0?n:this._str=this._items.reduce((c,y)=>`${c}${y}`,"")}get names(){var n;return(n=this._names)!==null&&n!==void 0?n:this._names=this._items.reduce((c,y)=>(y instanceof r&&(c[y.str]=(c[y.str]||0)+1),c),{})}}e._Code=o,e.nil=new o("");function d(l,...n){const c=[l[0]];let y=0;for(;y<n.length;)a(c,n[y]),c.push(l[++y]);return new o(c)}e._=d;const s=new o("+");function h(l,...n){const c=[_(l[0])];let y=0;for(;y<n.length;)c.push(s),a(c,n[y]),c.push(s,_(l[++y]));return m(c),new o(c)}e.str=h;function a(l,n){n instanceof o?l.push(...n._items):n instanceof r?l.push(n):l.push(S(n))}e.addCodeArg=a;function m(l){let n=1;for(;n<l.length-1;){if(l[n]===s){const c=b(l[n-1],l[n+1]);if(c!==void 0){l.splice(n-1,3,c);continue}l[n++]="+"}n++}}function b(l,n){if(n==='""')return l;if(l==='""')return n;if(typeof l=="string")return n instanceof r||l[l.length-1]!=='"'?void 0:typeof n!="string"?`${l.slice(0,-1)}${n}"`:n[0]==='"'?l.slice(0,-1)+n.slice(1):void 0;if(typeof n=="string"&&n[0]==='"'&&!(l instanceof r))return`"${l}${n.slice(1)}`}function g(l,n){return n.emptyStr()?l:l.emptyStr()?n:h`${l}${n}`}e.strConcat=g;function S(l){return typeof l=="number"||typeof l=="boolean"||l===null?l:_(Array.isArray(l)?l.join(","):l)}function v(l){return new o(_(l))}e.stringify=v;function _(l){return JSON.stringify(l).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=_;function $(l){return typeof l=="string"&&e.IDENTIFIER.test(l)?new o(`.${l}`):d`[${l}]`}e.getProperty=$;function w(l){if(typeof l=="string"&&e.IDENTIFIER.test(l))return new o(`${l}`);throw new Error(`CodeGen: invalid export name: ${l}, use explicit $id name mapping`)}e.getEsmExportName=w;function u(l){return new o(l.toString())}e.regexpCode=u})(tr)),tr}var rr={},gr;function vr(){return gr||(gr=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=bt();class r extends Error{constructor(b){super(`CodeGen: "code" for ${b} not defined`),this.value=b.value}}var o;(function(m){m[m.Started=0]="Started",m[m.Completed=1]="Completed"})(o||(e.UsedValueState=o={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class d{constructor({prefixes:b,parent:g}={}){this._names={},this._prefixes=b,this._parent=g}toName(b){return b instanceof t.Name?b:this.name(b)}name(b){return new t.Name(this._newName(b))}_newName(b){const g=this._names[b]||this._nameGroup(b);return`${b}${g.index++}`}_nameGroup(b){var g,S;if(!((S=(g=this._parent)===null||g===void 0?void 0:g._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=d;class s extends t.Name{constructor(b,g){super(g),this.prefix=b}setValue(b,{property:g,itemIndex:S}){this.value=b,this.scopePath=(0,t._)`.${new t.Name(g)}[${S}]`}}e.ValueScopeName=s;const h=(0,t._)`\n`;class a extends d{constructor(b){super(b),this._values={},this._scope=b.scope,this.opts={...b,_n:b.lines?h:t.nil}}get(){return this._scope}name(b){return new s(b,this._newName(b))}value(b,g){var S;if(g.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const v=this.toName(b),{prefix:_}=v,$=(S=g.key)!==null&&S!==void 0?S:g.ref;let w=this._values[_];if(w){const n=w.get($);if(n)return n}else w=this._values[_]=new Map;w.set($,v);const u=this._scope[_]||(this._scope[_]=[]),l=u.length;return u[l]=g.ref,v.setValue(g,{property:_,itemIndex:l}),v}getValue(b,g){const S=this._values[b];if(S)return S.get(g)}scopeRefs(b,g=this._values){return this._reduceValues(g,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,g,S){return this._reduceValues(b,v=>{if(v.value===void 0)throw new Error(`CodeGen: name "${v}" has no value`);return v.value.code},g,S)}_reduceValues(b,g,S={},v){let _=t.nil;for(const $ in b){const w=b[$];if(!w)continue;const u=S[$]=S[$]||new Map;w.forEach(l=>{if(u.has(l))return;u.set(l,o.Started);let n=g(l);if(n){const c=this.opts.es5?e.varKinds.var:e.varKinds.const;_=(0,t._)`${_}${c} ${l} = ${n};${this.opts._n}`}else if(n=v?.(l))_=(0,t._)`${_}${n}${this.opts._n}`;else throw new r(l);u.set(l,o.Completed)})}return _}}e.ValueScope=a})(rr)),rr}var _r;function W(){return _r||(_r=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=bt(),r=vr();var o=bt();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return o._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return o.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return o.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return o.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return o.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return o.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return o.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return o.Name}});var d=vr();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return d.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return d.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return d.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return d.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(f,k){return this}}class h extends s{constructor(f,k,I){super(),this.varKind=f,this.name=k,this.rhs=I}render({es5:f,_n:k}){const I=f?r.varKinds.var:this.varKind,U=this.rhs===void 0?"":` = ${this.rhs}`;return`${I} ${this.name}${U};`+k}optimizeNames(f,k){if(f[this.name.str])return this.rhs&&(this.rhs=L(this.rhs,f,k)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class a extends s{constructor(f,k,I){super(),this.lhs=f,this.rhs=k,this.sideEffects=I}render({_n:f}){return`${this.lhs} = ${this.rhs};`+f}optimizeNames(f,k){if(!(this.lhs instanceof t.Name&&!f[this.lhs.str]&&!this.sideEffects))return this.rhs=L(this.rhs,f,k),this}get names(){const f=this.lhs instanceof t.Name?{}:{...this.lhs.names};return F(f,this.rhs)}}class m extends a{constructor(f,k,I,U){super(f,I,U),this.op=k}render({_n:f}){return`${this.lhs} ${this.op}= ${this.rhs};`+f}}class b extends s{constructor(f){super(),this.label=f,this.names={}}render({_n:f}){return`${this.label}:`+f}}class g extends s{constructor(f){super(),this.label=f,this.names={}}render({_n:f}){return`break${this.label?` ${this.label}`:""};`+f}}class S extends s{constructor(f){super(),this.error=f}render({_n:f}){return`throw ${this.error};`+f}get names(){return this.error.names}}class v extends s{constructor(f){super(),this.code=f}render({_n:f}){return`${this.code};`+f}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(f,k){return this.code=L(this.code,f,k),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class _ extends s{constructor(f=[]){super(),this.nodes=f}render(f){return this.nodes.reduce((k,I)=>k+I.render(f),"")}optimizeNodes(){const{nodes:f}=this;let k=f.length;for(;k--;){const I=f[k].optimizeNodes();Array.isArray(I)?f.splice(k,1,...I):I?f[k]=I:f.splice(k,1)}return f.length>0?this:void 0}optimizeNames(f,k){const{nodes:I}=this;let U=I.length;for(;U--;){const H=I[U];H.optimizeNames(f,k)||(X(f,H.names),I.splice(U,1))}return I.length>0?this:void 0}get names(){return this.nodes.reduce((f,k)=>V(f,k.names),{})}}class $ extends _{render(f){return"{"+f._n+super.render(f)+"}"+f._n}}class w extends _{}class u extends ${}u.kind="else";class l extends ${constructor(f,k){super(k),this.condition=f}render(f){let k=`if(${this.condition})`+super.render(f);return this.else&&(k+="else "+this.else.render(f)),k}optimizeNodes(){super.optimizeNodes();const f=this.condition;if(f===!0)return this.nodes;let k=this.else;if(k){const I=k.optimizeNodes();k=this.else=Array.isArray(I)?new u(I):I}if(k)return f===!1?k instanceof l?k:k.nodes:this.nodes.length?this:new l(ie(f),k instanceof l?[k]:k.nodes);if(!(f===!1||!this.nodes.length))return this}optimizeNames(f,k){var I;if(this.else=(I=this.else)===null||I===void 0?void 0:I.optimizeNames(f,k),!!(super.optimizeNames(f,k)||this.else))return this.condition=L(this.condition,f,k),this}get names(){const f=super.names;return F(f,this.condition),this.else&&V(f,this.else.names),f}}l.kind="if";class n extends ${}n.kind="for";class c extends n{constructor(f){super(),this.iteration=f}render(f){return`for(${this.iteration})`+super.render(f)}optimizeNames(f,k){if(super.optimizeNames(f,k))return this.iteration=L(this.iteration,f,k),this}get names(){return V(super.names,this.iteration.names)}}class y extends n{constructor(f,k,I,U){super(),this.varKind=f,this.name=k,this.from=I,this.to=U}render(f){const k=f.es5?r.varKinds.var:this.varKind,{name:I,from:U,to:H}=this;return`for(${k} ${I}=${U}; ${I}<${H}; ${I}++)`+super.render(f)}get names(){const f=F(super.names,this.from);return F(f,this.to)}}class i extends n{constructor(f,k,I,U){super(),this.loop=f,this.varKind=k,this.name=I,this.iterable=U}render(f){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(f)}optimizeNames(f,k){if(super.optimizeNames(f,k))return this.iterable=L(this.iterable,f,k),this}get names(){return V(super.names,this.iterable.names)}}class p extends ${constructor(f,k,I){super(),this.name=f,this.args=k,this.async=I}render(f){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(f)}}p.kind="func";class P extends _{render(f){return"return "+super.render(f)}}P.kind="return";class O extends ${render(f){let k="try"+super.render(f);return this.catch&&(k+=this.catch.render(f)),this.finally&&(k+=this.finally.render(f)),k}optimizeNodes(){var f,k;return super.optimizeNodes(),(f=this.catch)===null||f===void 0||f.optimizeNodes(),(k=this.finally)===null||k===void 0||k.optimizeNodes(),this}optimizeNames(f,k){var I,U;return super.optimizeNames(f,k),(I=this.catch)===null||I===void 0||I.optimizeNames(f,k),(U=this.finally)===null||U===void 0||U.optimizeNames(f,k),this}get names(){const f=super.names;return this.catch&&V(f,this.catch.names),this.finally&&V(f,this.finally.names),f}}class D extends ${constructor(f){super(),this.error=f}render(f){return`catch(${this.error})`+super.render(f)}}D.kind="catch";class z extends ${render(f){return"finally"+super.render(f)}}z.kind="finally";class q{constructor(f,k={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...k,_n:k.lines?`
2
+ `:""},this._extScope=f,this._scope=new r.Scope({parent:f}),this._nodes=[new w]}toString(){return this._root.render(this.opts)}name(f){return this._scope.name(f)}scopeName(f){return this._extScope.name(f)}scopeValue(f,k){const I=this._extScope.value(f,k);return(this._values[I.prefix]||(this._values[I.prefix]=new Set)).add(I),I}getScopeValue(f,k){return this._extScope.getValue(f,k)}scopeRefs(f){return this._extScope.scopeRefs(f,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(f,k,I,U){const H=this._scope.toName(k);return I!==void 0&&U&&(this._constants[H.str]=I),this._leafNode(new h(f,H,I)),H}const(f,k,I){return this._def(r.varKinds.const,f,k,I)}let(f,k,I){return this._def(r.varKinds.let,f,k,I)}var(f,k,I){return this._def(r.varKinds.var,f,k,I)}assign(f,k,I){return this._leafNode(new a(f,k,I))}add(f,k){return this._leafNode(new m(f,e.operators.ADD,k))}code(f){return typeof f=="function"?f():f!==t.nil&&this._leafNode(new v(f)),this}object(...f){const k=["{"];for(const[I,U]of f)k.length>1&&k.push(","),k.push(I),(I!==U||this.opts.es5)&&(k.push(":"),(0,t.addCodeArg)(k,U));return k.push("}"),new t._Code(k)}if(f,k,I){if(this._blockNode(new l(f)),k&&I)this.code(k).else().code(I).endIf();else if(k)this.code(k).endIf();else if(I)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(f){return this._elseNode(new l(f))}else(){return this._elseNode(new u)}endIf(){return this._endBlockNode(l,u)}_for(f,k){return this._blockNode(f),k&&this.code(k).endFor(),this}for(f,k){return this._for(new c(f),k)}forRange(f,k,I,U,H=this.opts.es5?r.varKinds.var:r.varKinds.let){const Q=this._scope.toName(f);return this._for(new y(H,Q,k,I),()=>U(Q))}forOf(f,k,I,U=r.varKinds.const){const H=this._scope.toName(f);if(this.opts.es5){const Q=k instanceof t.Name?k:this.var("_arr",k);return this.forRange("_i",0,(0,t._)`${Q}.length`,Y=>{this.var(H,(0,t._)`${Q}[${Y}]`),I(H)})}return this._for(new i("of",U,H,k),()=>I(H))}forIn(f,k,I,U=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(f,(0,t._)`Object.keys(${k})`,I);const H=this._scope.toName(f);return this._for(new i("in",U,H,k),()=>I(H))}endFor(){return this._endBlockNode(n)}label(f){return this._leafNode(new b(f))}break(f){return this._leafNode(new g(f))}return(f){const k=new P;if(this._blockNode(k),this.code(f),k.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(P)}try(f,k,I){if(!k&&!I)throw new Error('CodeGen: "try" without "catch" and "finally"');const U=new O;if(this._blockNode(U),this.code(f),k){const H=this.name("e");this._currNode=U.catch=new D(H),k(H)}return I&&(this._currNode=U.finally=new z,this.code(I)),this._endBlockNode(D,z)}throw(f){return this._leafNode(new S(f))}block(f,k){return this._blockStarts.push(this._nodes.length),f&&this.code(f).endBlock(k),this}endBlock(f){const k=this._blockStarts.pop();if(k===void 0)throw new Error("CodeGen: not in self-balancing block");const I=this._nodes.length-k;if(I<0||f!==void 0&&I!==f)throw new Error(`CodeGen: wrong number of nodes: ${I} vs ${f} expected`);return this._nodes.length=k,this}func(f,k=t.nil,I,U){return this._blockNode(new p(f,k,I)),U&&this.code(U).endFunc(),this}endFunc(){return this._endBlockNode(p)}optimize(f=1){for(;f-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(f){return this._currNode.nodes.push(f),this}_blockNode(f){this._currNode.nodes.push(f),this._nodes.push(f)}_endBlockNode(f,k){const I=this._currNode;if(I instanceof f||k&&I instanceof k)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${k?`${f.kind}/${k.kind}`:f.kind}"`)}_elseNode(f){const k=this._currNode;if(!(k instanceof l))throw new Error('CodeGen: "else" without "if"');return this._currNode=k.else=f,this}get _root(){return this._nodes[0]}get _currNode(){const f=this._nodes;return f[f.length-1]}set _currNode(f){const k=this._nodes;k[k.length-1]=f}}e.CodeGen=q;function V(N,f){for(const k in f)N[k]=(N[k]||0)+(f[k]||0);return N}function F(N,f){return f instanceof t._CodeOrName?V(N,f.names):N}function L(N,f,k){if(N instanceof t.Name)return I(N);if(!U(N))return N;return new t._Code(N._items.reduce((H,Q)=>(Q instanceof t.Name&&(Q=I(Q)),Q instanceof t._Code?H.push(...Q._items):H.push(Q),H),[]));function I(H){const Q=k[H.str];return Q===void 0||f[H.str]!==1?H:(delete f[H.str],Q)}function U(H){return H instanceof t._Code&&H._items.some(Q=>Q instanceof t.Name&&f[Q.str]===1&&k[Q.str]!==void 0)}}function X(N,f){for(const k in f)N[k]=(N[k]||0)-(f[k]||0)}function ie(N){return typeof N=="boolean"||typeof N=="number"||N===null?!N:(0,t._)`!${T(N)}`}e.not=ie;const oe=j(e.operators.AND);function ee(...N){return N.reduce(oe)}e.and=ee;const pe=j(e.operators.OR);function M(...N){return N.reduce(pe)}e.or=M;function j(N){return(f,k)=>f===t.nil?k:k===t.nil?f:(0,t._)`${T(f)} ${N} ${T(k)}`}function T(N){return N instanceof t.Name?N:(0,t._)`(${N})`}})(er)),er}var G={},$r;function Z(){if($r)return G;$r=1,Object.defineProperty(G,"__esModule",{value:!0}),G.checkStrictMode=G.getErrorPath=G.Type=G.useFunc=G.setEvaluated=G.evaluatedPropsToName=G.mergeEvaluated=G.eachItem=G.unescapeJsonPointer=G.escapeJsonPointer=G.escapeFragment=G.unescapeFragment=G.schemaRefOrVal=G.schemaHasRulesButRef=G.schemaHasRules=G.checkUnknownRules=G.alwaysValidSchema=G.toHash=void 0;const e=W(),t=bt();function r(i){const p={};for(const P of i)p[P]=!0;return p}G.toHash=r;function o(i,p){return typeof p=="boolean"?p:Object.keys(p).length===0?!0:(d(i,p),!s(p,i.self.RULES.all))}G.alwaysValidSchema=o;function d(i,p=i.schema){const{opts:P,self:O}=i;if(!P.strictSchema||typeof p=="boolean")return;const D=O.RULES.keywords;for(const z in p)D[z]||y(i,`unknown keyword: "${z}"`)}G.checkUnknownRules=d;function s(i,p){if(typeof i=="boolean")return!i;for(const P in i)if(p[P])return!0;return!1}G.schemaHasRules=s;function h(i,p){if(typeof i=="boolean")return!i;for(const P in i)if(P!=="$ref"&&p.all[P])return!0;return!1}G.schemaHasRulesButRef=h;function a({topSchemaRef:i,schemaPath:p},P,O,D){if(!D){if(typeof P=="number"||typeof P=="boolean")return P;if(typeof P=="string")return(0,e._)`${P}`}return(0,e._)`${i}${p}${(0,e.getProperty)(O)}`}G.schemaRefOrVal=a;function m(i){return S(decodeURIComponent(i))}G.unescapeFragment=m;function b(i){return encodeURIComponent(g(i))}G.escapeFragment=b;function g(i){return typeof i=="number"?`${i}`:i.replace(/~/g,"~0").replace(/\//g,"~1")}G.escapeJsonPointer=g;function S(i){return i.replace(/~1/g,"/").replace(/~0/g,"~")}G.unescapeJsonPointer=S;function v(i,p){if(Array.isArray(i))for(const P of i)p(P);else p(i)}G.eachItem=v;function _({mergeNames:i,mergeToName:p,mergeValues:P,resultToName:O}){return(D,z,q,V)=>{const F=q===void 0?z:q instanceof e.Name?(z instanceof e.Name?i(D,z,q):p(D,z,q),q):z instanceof e.Name?(p(D,q,z),z):P(z,q);return V===e.Name&&!(F instanceof e.Name)?O(D,F):F}}G.mergeEvaluated={props:_({mergeNames:(i,p,P)=>i.if((0,e._)`${P} !== true && ${p} !== undefined`,()=>{i.if((0,e._)`${p} === true`,()=>i.assign(P,!0),()=>i.assign(P,(0,e._)`${P} || {}`).code((0,e._)`Object.assign(${P}, ${p})`))}),mergeToName:(i,p,P)=>i.if((0,e._)`${P} !== true`,()=>{p===!0?i.assign(P,!0):(i.assign(P,(0,e._)`${P} || {}`),w(i,P,p))}),mergeValues:(i,p)=>i===!0?!0:{...i,...p},resultToName:$}),items:_({mergeNames:(i,p,P)=>i.if((0,e._)`${P} !== true && ${p} !== undefined`,()=>i.assign(P,(0,e._)`${p} === true ? true : ${P} > ${p} ? ${P} : ${p}`)),mergeToName:(i,p,P)=>i.if((0,e._)`${P} !== true`,()=>i.assign(P,p===!0?!0:(0,e._)`${P} > ${p} ? ${P} : ${p}`)),mergeValues:(i,p)=>i===!0?!0:Math.max(i,p),resultToName:(i,p)=>i.var("items",p)})};function $(i,p){if(p===!0)return i.var("props",!0);const P=i.var("props",(0,e._)`{}`);return p!==void 0&&w(i,P,p),P}G.evaluatedPropsToName=$;function w(i,p,P){Object.keys(P).forEach(O=>i.assign((0,e._)`${p}${(0,e.getProperty)(O)}`,!0))}G.setEvaluated=w;const u={};function l(i,p){return i.scopeValue("func",{ref:p,code:u[p.code]||(u[p.code]=new t._Code(p.code))})}G.useFunc=l;var n;(function(i){i[i.Num=0]="Num",i[i.Str=1]="Str"})(n||(G.Type=n={}));function c(i,p,P){if(i instanceof e.Name){const O=p===n.Num;return P?O?(0,e._)`"[" + ${i} + "]"`:(0,e._)`"['" + ${i} + "']"`:O?(0,e._)`"/" + ${i}`:(0,e._)`"/" + ${i}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return P?(0,e.getProperty)(i).toString():"/"+g(i)}G.getErrorPath=c;function y(i,p,P=i.opts.strictSchema){if(P){if(p=`strict mode: ${p}`,P===!0)throw new Error(p);i.self.logger.warn(p)}}return G.checkStrictMode=y,G}var Me={},br;function we(){if(br)return Me;br=1,Object.defineProperty(Me,"__esModule",{value:!0});const e=W(),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 Me.default=t,Me}var wr;function Jt(){return wr||(wr=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=W(),r=Z(),o=we();e.keywordError={message:({keyword:u})=>(0,t.str)`must pass "${u}" keyword validation`},e.keyword$DataError={message:({keyword:u,schemaType:l})=>l?(0,t.str)`"${u}" keyword must be ${l} ($data)`:(0,t.str)`"${u}" keyword is invalid ($data)`};function d(u,l=e.keywordError,n,c){const{it:y}=u,{gen:i,compositeRule:p,allErrors:P}=y,O=S(u,l,n);c??(p||P)?m(i,O):b(y,(0,t._)`[${O}]`)}e.reportError=d;function s(u,l=e.keywordError,n){const{it:c}=u,{gen:y,compositeRule:i,allErrors:p}=c,P=S(u,l,n);m(y,P),i||p||b(c,o.default.vErrors)}e.reportExtraError=s;function h(u,l){u.assign(o.default.errors,l),u.if((0,t._)`${o.default.vErrors} !== null`,()=>u.if(l,()=>u.assign((0,t._)`${o.default.vErrors}.length`,l),()=>u.assign(o.default.vErrors,null)))}e.resetErrorsCount=h;function a({gen:u,keyword:l,schemaValue:n,data:c,errsCount:y,it:i}){if(y===void 0)throw new Error("ajv implementation error");const p=u.name("err");u.forRange("i",y,o.default.errors,P=>{u.const(p,(0,t._)`${o.default.vErrors}[${P}]`),u.if((0,t._)`${p}.instancePath === undefined`,()=>u.assign((0,t._)`${p}.instancePath`,(0,t.strConcat)(o.default.instancePath,i.errorPath))),u.assign((0,t._)`${p}.schemaPath`,(0,t.str)`${i.errSchemaPath}/${l}`),i.opts.verbose&&(u.assign((0,t._)`${p}.schema`,n),u.assign((0,t._)`${p}.data`,c))})}e.extendErrors=a;function m(u,l){const n=u.const("err",l);u.if((0,t._)`${o.default.vErrors} === null`,()=>u.assign(o.default.vErrors,(0,t._)`[${n}]`),(0,t._)`${o.default.vErrors}.push(${n})`),u.code((0,t._)`${o.default.errors}++`)}function b(u,l){const{gen:n,validateName:c,schemaEnv:y}=u;y.$async?n.throw((0,t._)`new ${u.ValidationError}(${l})`):(n.assign((0,t._)`${c}.errors`,l),n.return(!1))}const g={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(u,l,n){const{createErrors:c}=u.it;return c===!1?(0,t._)`{}`:v(u,l,n)}function v(u,l,n={}){const{gen:c,it:y}=u,i=[_(y,n),$(u,n)];return w(u,l,i),c.object(...i)}function _({errorPath:u},{instancePath:l}){const n=l?(0,t.str)`${u}${(0,r.getErrorPath)(l,r.Type.Str)}`:u;return[o.default.instancePath,(0,t.strConcat)(o.default.instancePath,n)]}function $({keyword:u,it:{errSchemaPath:l}},{schemaPath:n,parentSchema:c}){let y=c?l:(0,t.str)`${l}/${u}`;return n&&(y=(0,t.str)`${y}${(0,r.getErrorPath)(n,r.Type.Str)}`),[g.schemaPath,y]}function w(u,{params:l,message:n},c){const{keyword:y,data:i,schemaValue:p,it:P}=u,{opts:O,propertyName:D,topSchemaRef:z,schemaPath:q}=P;c.push([g.keyword,y],[g.params,typeof l=="function"?l(u):l||(0,t._)`{}`]),O.messages&&c.push([g.message,typeof n=="function"?n(u):n]),O.verbose&&c.push([g.schema,p],[g.parentSchema,(0,t._)`${z}${q}`],[o.default.data,i]),D&&c.push([g.propertyName,D])}})(xt)),xt}var Pr;function es(){if(Pr)return Pe;Pr=1,Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.boolOrEmptySchema=Pe.topBoolOrEmptySchema=void 0;const e=Jt(),t=W(),r=we(),o={message:"boolean schema is false"};function d(a){const{gen:m,schema:b,validateName:g}=a;b===!1?h(a,!1):typeof b=="object"&&b.$async===!0?m.return(r.default.data):(m.assign((0,t._)`${g}.errors`,null),m.return(!0))}Pe.topBoolOrEmptySchema=d;function s(a,m){const{gen:b,schema:g}=a;g===!1?(b.var(m,!1),h(a)):b.var(m,!0)}Pe.boolOrEmptySchema=s;function h(a,m){const{gen:b,data:g}=a,S={gen:b,keyword:"false schema",data:g,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:a};(0,e.reportError)(S,o,void 0,m)}return Pe}var se={},ke={},kr;function Dn(){if(kr)return ke;kr=1,Object.defineProperty(ke,"__esModule",{value:!0}),ke.getRules=ke.isJSONType=void 0;const e=["string","number","integer","boolean","null","object","array"],t=new Set(e);function r(d){return typeof d=="string"&&t.has(d)}ke.isJSONType=r;function o(){const d={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...d,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},d.number,d.string,d.array,d.object],post:{rules:[]},all:{},keywords:{}}}return ke.getRules=o,ke}var _e={},Sr;function Mn(){if(Sr)return _e;Sr=1,Object.defineProperty(_e,"__esModule",{value:!0}),_e.shouldUseRule=_e.shouldUseGroup=_e.schemaHasRulesForType=void 0;function e({schema:o,self:d},s){const h=d.RULES.types[s];return h&&h!==!0&&t(o,h)}_e.schemaHasRulesForType=e;function t(o,d){return d.rules.some(s=>r(o,s))}_e.shouldUseGroup=t;function r(o,d){var s;return o[d.keyword]!==void 0||((s=d.definition.implements)===null||s===void 0?void 0:s.some(h=>o[h]!==void 0))}return _e.shouldUseRule=r,_e}var Er;function wt(){if(Er)return se;Er=1,Object.defineProperty(se,"__esModule",{value:!0}),se.reportTypeError=se.checkDataTypes=se.checkDataType=se.coerceAndCheckDataType=se.getJSONTypes=se.getSchemaTypes=se.DataType=void 0;const e=Dn(),t=Mn(),r=Jt(),o=W(),d=Z();var s;(function(n){n[n.Correct=0]="Correct",n[n.Wrong=1]="Wrong"})(s||(se.DataType=s={}));function h(n){const c=a(n.type);if(c.includes("null")){if(n.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!c.length&&n.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');n.nullable===!0&&c.push("null")}return c}se.getSchemaTypes=h;function a(n){const c=Array.isArray(n)?n:n?[n]:[];if(c.every(e.isJSONType))return c;throw new Error("type must be JSONType or JSONType[]: "+c.join(","))}se.getJSONTypes=a;function m(n,c){const{gen:y,data:i,opts:p}=n,P=g(c,p.coerceTypes),O=c.length>0&&!(P.length===0&&c.length===1&&(0,t.schemaHasRulesForType)(n,c[0]));if(O){const D=$(c,i,p.strictNumbers,s.Wrong);y.if(D,()=>{P.length?S(n,c,P):u(n)})}return O}se.coerceAndCheckDataType=m;const b=new Set(["string","number","integer","boolean","null"]);function g(n,c){return c?n.filter(y=>b.has(y)||c==="array"&&y==="array"):[]}function S(n,c,y){const{gen:i,data:p,opts:P}=n,O=i.let("dataType",(0,o._)`typeof ${p}`),D=i.let("coerced",(0,o._)`undefined`);P.coerceTypes==="array"&&i.if((0,o._)`${O} == 'object' && Array.isArray(${p}) && ${p}.length == 1`,()=>i.assign(p,(0,o._)`${p}[0]`).assign(O,(0,o._)`typeof ${p}`).if($(c,p,P.strictNumbers),()=>i.assign(D,p))),i.if((0,o._)`${D} !== undefined`);for(const q of y)(b.has(q)||q==="array"&&P.coerceTypes==="array")&&z(q);i.else(),u(n),i.endIf(),i.if((0,o._)`${D} !== undefined`,()=>{i.assign(p,D),v(n,D)});function z(q){switch(q){case"string":i.elseIf((0,o._)`${O} == "number" || ${O} == "boolean"`).assign(D,(0,o._)`"" + ${p}`).elseIf((0,o._)`${p} === null`).assign(D,(0,o._)`""`);return;case"number":i.elseIf((0,o._)`${O} == "boolean" || ${p} === null
3
+ || (${O} == "string" && ${p} && ${p} == +${p})`).assign(D,(0,o._)`+${p}`);return;case"integer":i.elseIf((0,o._)`${O} === "boolean" || ${p} === null
4
+ || (${O} === "string" && ${p} && ${p} == +${p} && !(${p} % 1))`).assign(D,(0,o._)`+${p}`);return;case"boolean":i.elseIf((0,o._)`${p} === "false" || ${p} === 0 || ${p} === null`).assign(D,!1).elseIf((0,o._)`${p} === "true" || ${p} === 1`).assign(D,!0);return;case"null":i.elseIf((0,o._)`${p} === "" || ${p} === 0 || ${p} === false`),i.assign(D,null);return;case"array":i.elseIf((0,o._)`${O} === "string" || ${O} === "number"
5
+ || ${O} === "boolean" || ${p} === null`).assign(D,(0,o._)`[${p}]`)}}}function v({gen:n,parentData:c,parentDataProperty:y},i){n.if((0,o._)`${c} !== undefined`,()=>n.assign((0,o._)`${c}[${y}]`,i))}function _(n,c,y,i=s.Correct){const p=i===s.Correct?o.operators.EQ:o.operators.NEQ;let P;switch(n){case"null":return(0,o._)`${c} ${p} null`;case"array":P=(0,o._)`Array.isArray(${c})`;break;case"object":P=(0,o._)`${c} && typeof ${c} == "object" && !Array.isArray(${c})`;break;case"integer":P=O((0,o._)`!(${c} % 1) && !isNaN(${c})`);break;case"number":P=O();break;default:return(0,o._)`typeof ${c} ${p} ${n}`}return i===s.Correct?P:(0,o.not)(P);function O(D=o.nil){return(0,o.and)((0,o._)`typeof ${c} == "number"`,D,y?(0,o._)`isFinite(${c})`:o.nil)}}se.checkDataType=_;function $(n,c,y,i){if(n.length===1)return _(n[0],c,y,i);let p;const P=(0,d.toHash)(n);if(P.array&&P.object){const O=(0,o._)`typeof ${c} != "object"`;p=P.null?O:(0,o._)`!${c} || ${O}`,delete P.null,delete P.array,delete P.object}else p=o.nil;P.number&&delete P.integer;for(const O in P)p=(0,o.and)(p,_(O,c,y,i));return p}se.checkDataTypes=$;const w={message:({schema:n})=>`must be ${n}`,params:({schema:n,schemaValue:c})=>typeof n=="string"?(0,o._)`{type: ${n}}`:(0,o._)`{type: ${c}}`};function u(n){const c=l(n);(0,r.reportError)(c,w)}se.reportTypeError=u;function l(n){const{gen:c,data:y,schema:i}=n,p=(0,d.schemaRefOrVal)(n,i,"type");return{gen:c,keyword:"type",data:y,schema:i.type,schemaCode:p,schemaValue:p,parentSchema:i,params:{},it:n}}return se}var Oe={},jr;function ts(){if(jr)return Oe;jr=1,Object.defineProperty(Oe,"__esModule",{value:!0}),Oe.assignDefaults=void 0;const e=W(),t=Z();function r(d,s){const{properties:h,items:a}=d.schema;if(s==="object"&&h)for(const m in h)o(d,m,h[m].default);else s==="array"&&Array.isArray(a)&&a.forEach((m,b)=>o(d,b,m.default))}Oe.assignDefaults=r;function o(d,s,h){const{gen:a,compositeRule:m,data:b,opts:g}=d;if(h===void 0)return;const S=(0,e._)`${b}${(0,e.getProperty)(s)}`;if(m){(0,t.checkStrictMode)(d,`default is ignored for: ${S}`);return}let v=(0,e._)`${S} === undefined`;g.useDefaults==="empty"&&(v=(0,e._)`${v} || ${S} === null || ${S} === ""`),a.if(v,(0,e._)`${S} = ${(0,e.stringify)(h)}`)}return Oe}var he={},x={},Rr;function ge(){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=W(),t=Z(),r=we(),o=Z();function d(n,c){const{gen:y,data:i,it:p}=n;y.if(g(y,i,c,p.opts.ownProperties),()=>{n.setParams({missingProperty:(0,e._)`${c}`},!0),n.error()})}x.checkReportMissingProp=d;function s({gen:n,data:c,it:{opts:y}},i,p){return(0,e.or)(...i.map(P=>(0,e.and)(g(n,c,P,y.ownProperties),(0,e._)`${p} = ${P}`)))}x.checkMissingProp=s;function h(n,c){n.setParams({missingProperty:c},!0),n.error()}x.reportMissingProp=h;function a(n){return n.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,e._)`Object.prototype.hasOwnProperty`})}x.hasPropFunc=a;function m(n,c,y){return(0,e._)`${a(n)}.call(${c}, ${y})`}x.isOwnProperty=m;function b(n,c,y,i){const p=(0,e._)`${c}${(0,e.getProperty)(y)} !== undefined`;return i?(0,e._)`${p} && ${m(n,c,y)}`:p}x.propertyInData=b;function g(n,c,y,i){const p=(0,e._)`${c}${(0,e.getProperty)(y)} === undefined`;return i?(0,e.or)(p,(0,e.not)(m(n,c,y))):p}x.noPropertyInData=g;function S(n){return n?Object.keys(n).filter(c=>c!=="__proto__"):[]}x.allSchemaProperties=S;function v(n,c){return S(c).filter(y=>!(0,t.alwaysValidSchema)(n,c[y]))}x.schemaProperties=v;function _({schemaCode:n,data:c,it:{gen:y,topSchemaRef:i,schemaPath:p,errorPath:P},it:O},D,z,q){const V=q?(0,e._)`${n}, ${c}, ${i}${p}`:c,F=[[r.default.instancePath,(0,e.strConcat)(r.default.instancePath,P)],[r.default.parentData,O.parentData],[r.default.parentDataProperty,O.parentDataProperty],[r.default.rootData,r.default.rootData]];O.opts.dynamicRef&&F.push([r.default.dynamicAnchors,r.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=_;const $=(0,e._)`new RegExp`;function w({gen:n,it:{opts:c}},y){const i=c.unicodeRegExp?"u":"",{regExp:p}=c.code,P=p(y,i);return n.scopeValue("pattern",{key:P.toString(),ref:P,code:(0,e._)`${p.code==="new RegExp"?$:(0,o.useFunc)(n,p)}(${y}, ${i})`})}x.usePattern=w;function u(n){const{gen:c,data:y,keyword:i,it:p}=n,P=c.name("valid");if(p.allErrors){const D=c.let("valid",!0);return O(()=>c.assign(D,!1)),D}return c.var(P,!0),O(()=>c.break()),P;function O(D){const z=c.const("len",(0,e._)`${y}.length`);c.forRange("i",0,z,q=>{n.subschema({keyword:i,dataProp:q,dataPropType:t.Type.Num},P),c.if((0,e.not)(P),D)})}}x.validateArray=u;function l(n){const{gen:c,schema:y,keyword:i,it:p}=n;if(!Array.isArray(y))throw new Error("ajv implementation error");if(y.some(z=>(0,t.alwaysValidSchema)(p,z))&&!p.opts.unevaluated)return;const O=c.let("valid",!1),D=c.name("_valid");c.block(()=>y.forEach((z,q)=>{const V=n.subschema({keyword:i,schemaProp:q,compositeRule:!0},D);c.assign(O,(0,e._)`${O} || ${D}`),n.mergeValidEvaluated(V,D)||c.if((0,e.not)(O))})),n.result(O,()=>n.reset(),()=>n.error(!0))}return x.validateUnion=l,x}var Nr;function rs(){if(Nr)return he;Nr=1,Object.defineProperty(he,"__esModule",{value:!0}),he.validateKeywordUsage=he.validSchemaType=he.funcKeywordCode=he.macroKeywordCode=void 0;const e=W(),t=we(),r=ge(),o=Jt();function d(v,_){const{gen:$,keyword:w,schema:u,parentSchema:l,it:n}=v,c=_.macro.call(n.self,u,l,n),y=b($,w,c);n.opts.validateSchema!==!1&&n.self.validateSchema(c,!0);const i=$.name("valid");v.subschema({schema:c,schemaPath:e.nil,errSchemaPath:`${n.errSchemaPath}/${w}`,topSchemaRef:y,compositeRule:!0},i),v.pass(i,()=>v.error(!0))}he.macroKeywordCode=d;function s(v,_){var $;const{gen:w,keyword:u,schema:l,parentSchema:n,$data:c,it:y}=v;m(y,_);const i=!c&&_.compile?_.compile.call(y.self,l,n,y):_.validate,p=b(w,u,i),P=w.let("valid");v.block$data(P,O),v.ok(($=_.valid)!==null&&$!==void 0?$:P);function O(){if(_.errors===!1)q(),_.modifying&&h(v),V(()=>v.error());else{const F=_.async?D():z();_.modifying&&h(v),V(()=>a(v,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 ${y.ValidationError}`,()=>w.assign(F,(0,e._)`${L}.errors`),()=>w.throw(L))),F}function z(){const F=(0,e._)`${p}.errors`;return w.assign(F,null),q(e.nil),F}function q(F=_.async?(0,e._)`await `:e.nil){const L=y.opts.passContext?t.default.this:t.default.self,X=!("compile"in _&&!c||_.schema===!1);w.assign(P,(0,e._)`${F}${(0,r.callValidateCode)(v,p,L,X)}`,_.modifying)}function V(F){var L;w.if((0,e.not)((L=_.valid)!==null&&L!==void 0?L:P),F)}}he.funcKeywordCode=s;function h(v){const{gen:_,data:$,it:w}=v;_.if(w.parentData,()=>_.assign($,(0,e._)`${w.parentData}[${w.parentDataProperty}]`))}function a(v,_){const{gen:$}=v;$.if((0,e._)`Array.isArray(${_})`,()=>{$.assign(t.default.vErrors,(0,e._)`${t.default.vErrors} === null ? ${_} : ${t.default.vErrors}.concat(${_})`).assign(t.default.errors,(0,e._)`${t.default.vErrors}.length`),(0,o.extendErrors)(v)},()=>v.error())}function m({schemaEnv:v},_){if(_.async&&!v.$async)throw new Error("async keyword in sync schema")}function b(v,_,$){if($===void 0)throw new Error(`keyword "${_}" failed to compile`);return v.scopeValue("keyword",typeof $=="function"?{ref:$}:{ref:$,code:(0,e.stringify)($)})}function g(v,_,$=!1){return!_.length||_.some(w=>w==="array"?Array.isArray(v):w==="object"?v&&typeof v=="object"&&!Array.isArray(v):typeof v==w||$&&typeof v>"u")}he.validSchemaType=g;function S({schema:v,opts:_,self:$,errSchemaPath:w},u,l){if(Array.isArray(u.keyword)?!u.keyword.includes(l):u.keyword!==l)throw new Error("ajv implementation error");const n=u.dependencies;if(n?.some(c=>!Object.prototype.hasOwnProperty.call(v,c)))throw new Error(`parent schema must have dependencies of ${l}: ${n.join(",")}`);if(u.validateSchema&&!u.validateSchema(v[l])){const y=`keyword "${l}" value is invalid at path "${w}": `+$.errorsText(u.validateSchema.errors);if(_.validateSchema==="log")$.logger.error(y);else throw new Error(y)}}return he.validateKeywordUsage=S,he}var $e={},Or;function ns(){if(Or)return $e;Or=1,Object.defineProperty($e,"__esModule",{value:!0}),$e.extendSubschemaMode=$e.extendSubschemaData=$e.getSubschema=void 0;const e=W(),t=Z();function r(s,{keyword:h,schemaProp:a,schema:m,schemaPath:b,errSchemaPath:g,topSchemaRef:S}){if(h!==void 0&&m!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(h!==void 0){const v=s.schema[h];return a===void 0?{schema:v,schemaPath:(0,e._)`${s.schemaPath}${(0,e.getProperty)(h)}`,errSchemaPath:`${s.errSchemaPath}/${h}`}:{schema:v[a],schemaPath:(0,e._)`${s.schemaPath}${(0,e.getProperty)(h)}${(0,e.getProperty)(a)}`,errSchemaPath:`${s.errSchemaPath}/${h}/${(0,t.escapeFragment)(a)}`}}if(m!==void 0){if(b===void 0||g===void 0||S===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:m,schemaPath:b,topSchemaRef:S,errSchemaPath:g}}throw new Error('either "keyword" or "schema" must be passed')}$e.getSubschema=r;function o(s,h,{dataProp:a,dataPropType:m,data:b,dataTypes:g,propertyName:S}){if(b!==void 0&&a!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:v}=h;if(a!==void 0){const{errorPath:$,dataPathArr:w,opts:u}=h,l=v.let("data",(0,e._)`${h.data}${(0,e.getProperty)(a)}`,!0);_(l),s.errorPath=(0,e.str)`${$}${(0,t.getErrorPath)(a,m,u.jsPropertySyntax)}`,s.parentDataProperty=(0,e._)`${a}`,s.dataPathArr=[...w,s.parentDataProperty]}if(b!==void 0){const $=b instanceof e.Name?b:v.let("data",b,!0);_($),S!==void 0&&(s.propertyName=S)}g&&(s.dataTypes=g);function _($){s.data=$,s.dataLevel=h.dataLevel+1,s.dataTypes=[],h.definedProperties=new Set,s.parentData=h.data,s.dataNames=[...h.dataNames,$]}}$e.extendSubschemaData=o;function d(s,{jtdDiscriminator:h,jtdMetadata:a,compositeRule:m,createErrors:b,allErrors:g}){m!==void 0&&(s.compositeRule=m),b!==void 0&&(s.createErrors=b),g!==void 0&&(s.allErrors=g),s.jtdDiscriminator=h,s.jtdMetadata=a}return $e.extendSubschemaMode=d,$e}var ae={},nr,Ir;function An(){return Ir||(Ir=1,nr=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var o,d,s;if(Array.isArray(t)){if(o=t.length,o!=r.length)return!1;for(d=o;d--!==0;)if(!e(t[d],r[d]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(s=Object.keys(t),o=s.length,o!==Object.keys(r).length)return!1;for(d=o;d--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[d]))return!1;for(d=o;d--!==0;){var h=s[d];if(!e(t[h],r[h]))return!1}return!0}return t!==t&&r!==r}),nr}var sr={exports:{}},qr;function ss(){if(qr)return sr.exports;qr=1;var e=sr.exports=function(o,d,s){typeof d=="function"&&(s=d,d={}),s=d.cb||s;var h=typeof s=="function"?s:s.pre||function(){},a=s.post||function(){};t(d,h,a,o,"",o)};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(o,d,s,h,a,m,b,g,S,v){if(h&&typeof h=="object"&&!Array.isArray(h)){d(h,a,m,b,g,S,v);for(var _ in h){var $=h[_];if(Array.isArray($)){if(_ in e.arrayKeywords)for(var w=0;w<$.length;w++)t(o,d,s,$[w],a+"/"+_+"/"+w,m,a,_,h,w)}else if(_ in e.propsKeywords){if($&&typeof $=="object")for(var u in $)t(o,d,s,$[u],a+"/"+_+"/"+r(u),m,a,_,h,u)}else(_ in e.keywords||o.allKeys&&!(_ in e.skipKeywords))&&t(o,d,s,$,a+"/"+_,m,a,_,h)}s(h,a,m,b,g,S,v)}}function r(o){return o.replace(/~/g,"~0").replace(/\//g,"~1")}return sr.exports}var Cr;function Gt(){if(Cr)return ae;Cr=1,Object.defineProperty(ae,"__esModule",{value:!0}),ae.getSchemaRefs=ae.resolveUrl=ae.normalizeId=ae._getFullPath=ae.getFullPath=ae.inlineRef=void 0;const e=Z(),t=An(),r=ss(),o=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function d(w,u=!0){return typeof w=="boolean"?!0:u===!0?!h(w):u?a(w)<=u:!1}ae.inlineRef=d;const s=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function h(w){for(const u in w){if(s.has(u))return!0;const l=w[u];if(Array.isArray(l)&&l.some(h)||typeof l=="object"&&h(l))return!0}return!1}function a(w){let u=0;for(const l in w){if(l==="$ref")return 1/0;if(u++,!o.has(l)&&(typeof w[l]=="object"&&(0,e.eachItem)(w[l],n=>u+=a(n)),u===1/0))return 1/0}return u}function m(w,u="",l){l!==!1&&(u=S(u));const n=w.parse(u);return b(w,n)}ae.getFullPath=m;function b(w,u){return w.serialize(u).split("#")[0]+"#"}ae._getFullPath=b;const g=/#\/?$/;function S(w){return w?w.replace(g,""):""}ae.normalizeId=S;function v(w,u,l){return l=S(l),w.resolve(u,l)}ae.resolveUrl=v;const _=/^[a-z_][-a-z0-9._]*$/i;function $(w,u){if(typeof w=="boolean")return{};const{schemaId:l,uriResolver:n}=this.opts,c=S(w[l]||u),y={"":c},i=m(n,c,!1),p={},P=new Set;return r(w,{allKeys:!0},(z,q,V,F)=>{if(F===void 0)return;const L=i+q;let X=y[F];typeof z[l]=="string"&&(X=ie.call(this,z[l])),oe.call(this,z.$anchor),oe.call(this,z.$dynamicAnchor),y[q]=X;function ie(ee){const pe=this.opts.uriResolver.resolve;if(ee=S(X?pe(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"?O(z,M.schema,ee):ee!==S(L)&&(ee[0]==="#"?(O(z,p[ee],ee),p[ee]=z):this.refs[ee]=L),ee}function oe(ee){if(typeof ee=="string"){if(!_.test(ee))throw new Error(`invalid anchor "${ee}"`);ie.call(this,`#${ee}`)}}}),p;function O(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 ae.getSchemaRefs=$,ae}var Tr;function Wt(){if(Tr)return ve;Tr=1,Object.defineProperty(ve,"__esModule",{value:!0}),ve.getData=ve.KeywordCxt=ve.validateFunctionCode=void 0;const e=es(),t=wt(),r=Mn(),o=wt(),d=ts(),s=rs(),h=ns(),a=W(),m=we(),b=Gt(),g=Z(),S=Jt();function v(E){if(i(E)&&(P(E),y(E))){u(E);return}_(E,()=>(0,e.topBoolOrEmptySchema)(E))}ve.validateFunctionCode=v;function _({gen:E,validateName:R,schema:C,schemaEnv:A,opts:K},B){K.code.es5?E.func(R,(0,a._)`${m.default.data}, ${m.default.valCxt}`,A.$async,()=>{E.code((0,a._)`"use strict"; ${n(C,K)}`),w(E,K),E.code(B)}):E.func(R,(0,a._)`${m.default.data}, ${$(K)}`,A.$async,()=>E.code(n(C,K)).code(B))}function $(E){return(0,a._)`{${m.default.instancePath}="", ${m.default.parentData}, ${m.default.parentDataProperty}, ${m.default.rootData}=${m.default.data}${E.dynamicRef?(0,a._)`, ${m.default.dynamicAnchors}={}`:a.nil}}={}`}function w(E,R){E.if(m.default.valCxt,()=>{E.var(m.default.instancePath,(0,a._)`${m.default.valCxt}.${m.default.instancePath}`),E.var(m.default.parentData,(0,a._)`${m.default.valCxt}.${m.default.parentData}`),E.var(m.default.parentDataProperty,(0,a._)`${m.default.valCxt}.${m.default.parentDataProperty}`),E.var(m.default.rootData,(0,a._)`${m.default.valCxt}.${m.default.rootData}`),R.dynamicRef&&E.var(m.default.dynamicAnchors,(0,a._)`${m.default.valCxt}.${m.default.dynamicAnchors}`)},()=>{E.var(m.default.instancePath,(0,a._)`""`),E.var(m.default.parentData,(0,a._)`undefined`),E.var(m.default.parentDataProperty,(0,a._)`undefined`),E.var(m.default.rootData,m.default.data),R.dynamicRef&&E.var(m.default.dynamicAnchors,(0,a._)`{}`)})}function u(E){const{schema:R,opts:C,gen:A}=E;_(E,()=>{C.$comment&&R.$comment&&F(E),z(E),A.let(m.default.vErrors,null),A.let(m.default.errors,0),C.unevaluated&&l(E),O(E),L(E)})}function l(E){const{gen:R,validateName:C}=E;E.evaluated=R.const("evaluated",(0,a._)`${C}.evaluated`),R.if((0,a._)`${E.evaluated}.dynamicProps`,()=>R.assign((0,a._)`${E.evaluated}.props`,(0,a._)`undefined`)),R.if((0,a._)`${E.evaluated}.dynamicItems`,()=>R.assign((0,a._)`${E.evaluated}.items`,(0,a._)`undefined`))}function n(E,R){const C=typeof E=="object"&&E[R.schemaId];return C&&(R.code.source||R.code.process)?(0,a._)`/*# sourceURL=${C} */`:a.nil}function c(E,R){if(i(E)&&(P(E),y(E))){p(E,R);return}(0,e.boolOrEmptySchema)(E,R)}function y({schema:E,self:R}){if(typeof E=="boolean")return!E;for(const C in E)if(R.RULES.all[C])return!0;return!1}function i(E){return typeof E.schema!="boolean"}function p(E,R){const{schema:C,gen:A,opts:K}=E;K.$comment&&C.$comment&&F(E),q(E),V(E);const B=A.const("_errs",m.default.errors);O(E,B),A.var(R,(0,a._)`${B} === ${m.default.errors}`)}function P(E){(0,g.checkUnknownRules)(E),D(E)}function O(E,R){if(E.opts.jtd)return ie(E,[],!1,R);const C=(0,t.getSchemaTypes)(E.schema),A=(0,t.coerceAndCheckDataType)(E,C);ie(E,C,!A,R)}function D(E){const{schema:R,errSchemaPath:C,opts:A,self:K}=E;R.$ref&&A.ignoreKeywordsWithRef&&(0,g.schemaHasRulesButRef)(R,K.RULES)&&K.logger.warn(`$ref: keywords ignored in schema at path "${C}"`)}function z(E){const{schema:R,opts:C}=E;R.default!==void 0&&C.useDefaults&&C.strictSchema&&(0,g.checkStrictMode)(E,"default is ignored in the schema root")}function q(E){const R=E.schema[E.opts.schemaId];R&&(E.baseId=(0,b.resolveUrl)(E.opts.uriResolver,E.baseId,R))}function V(E){if(E.schema.$async&&!E.schemaEnv.$async)throw new Error("async schema in sync schema")}function F({gen:E,schemaEnv:R,schema:C,errSchemaPath:A,opts:K}){const B=C.$comment;if(K.$comment===!0)E.code((0,a._)`${m.default.self}.logger.log(${B})`);else if(typeof K.$comment=="function"){const re=(0,a.str)`${A}/$comment`,me=E.scopeValue("root",{ref:R.root});E.code((0,a._)`${m.default.self}.opts.$comment(${B}, ${re}, ${me}.schema)`)}}function L(E){const{gen:R,schemaEnv:C,validateName:A,ValidationError:K,opts:B}=E;C.$async?R.if((0,a._)`${m.default.errors} === 0`,()=>R.return(m.default.data),()=>R.throw((0,a._)`new ${K}(${m.default.vErrors})`)):(R.assign((0,a._)`${A}.errors`,m.default.vErrors),B.unevaluated&&X(E),R.return((0,a._)`${m.default.errors} === 0`))}function X({gen:E,evaluated:R,props:C,items:A}){C instanceof a.Name&&E.assign((0,a._)`${R}.props`,C),A instanceof a.Name&&E.assign((0,a._)`${R}.items`,A)}function ie(E,R,C,A){const{gen:K,schema:B,data:re,allErrors:me,opts:ce,self:ue}=E,{RULES:ne}=ue;if(B.$ref&&(ce.ignoreKeywordsWithRef||!(0,g.schemaHasRulesButRef)(B,ne))){K.block(()=>U(E,"$ref",ne.all.$ref.definition));return}ce.jtd||ee(E,R),K.block(()=>{for(const fe of ne.rules)Ee(fe);Ee(ne.post)});function Ee(fe){(0,r.shouldUseGroup)(B,fe)&&(fe.type?(K.if((0,o.checkDataType)(fe.type,re,ce.strictNumbers)),oe(E,fe),R.length===1&&R[0]===fe.type&&C&&(K.else(),(0,o.reportTypeError)(E)),K.endIf()):oe(E,fe),me||K.if((0,a._)`${m.default.errors} === ${A||0}`))}}function oe(E,R){const{gen:C,schema:A,opts:{useDefaults:K}}=E;K&&(0,d.assignDefaults)(E,R.type),C.block(()=>{for(const B of R.rules)(0,r.shouldUseRule)(A,B)&&U(E,B.keyword,B.definition,R.type)})}function ee(E,R){E.schemaEnv.meta||!E.opts.strictTypes||(pe(E,R),E.opts.allowUnionTypes||M(E,R),j(E,E.dataTypes))}function pe(E,R){if(R.length){if(!E.dataTypes.length){E.dataTypes=R;return}R.forEach(C=>{N(E.dataTypes,C)||k(E,`type "${C}" not allowed by context "${E.dataTypes.join(",")}"`)}),f(E,R)}}function M(E,R){R.length>1&&!(R.length===2&&R.includes("null"))&&k(E,"use allowUnionTypes to allow union type keyword")}function j(E,R){const C=E.self.RULES.all;for(const A in C){const K=C[A];if(typeof K=="object"&&(0,r.shouldUseRule)(E.schema,K)){const{type:B}=K.definition;B.length&&!B.some(re=>T(R,re))&&k(E,`missing type "${B.join(",")}" for keyword "${A}"`)}}}function T(E,R){return E.includes(R)||R==="number"&&E.includes("integer")}function N(E,R){return E.includes(R)||R==="integer"&&E.includes("number")}function f(E,R){const C=[];for(const A of E.dataTypes)N(R,A)?C.push(A):R.includes("integer")&&A==="number"&&C.push("integer");E.dataTypes=C}function k(E,R){const C=E.schemaEnv.baseId+E.errSchemaPath;R+=` at "${C}" (strictTypes)`,(0,g.checkStrictMode)(E,R,E.opts.strictTypes)}class I{constructor(R,C,A){if((0,s.validateKeywordUsage)(R,C,A),this.gen=R.gen,this.allErrors=R.allErrors,this.keyword=A,this.data=R.data,this.schema=R.schema[A],this.$data=C.$data&&R.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,g.schemaRefOrVal)(R,this.schema,A,this.$data),this.schemaType=C.schemaType,this.parentSchema=R.schema,this.params={},this.it=R,this.def=C,this.$data)this.schemaCode=R.gen.const("vSchema",Y(this.$data,R));else if(this.schemaCode=this.schemaValue,!(0,s.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=R.gen.const("_errs",m.default.errors))}result(R,C,A){this.failResult((0,a.not)(R),C,A)}failResult(R,C,A){this.gen.if(R),A?A():this.error(),C?(this.gen.else(),C(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(R,C){this.failResult((0,a.not)(R),void 0,C)}fail(R){if(R===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(R),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(R){if(!this.$data)return this.fail(R);const{schemaCode:C}=this;this.fail((0,a._)`${C} !== undefined && (${(0,a.or)(this.invalid$data(),R)})`)}error(R,C,A){if(C){this.setParams(C),this._error(R,A),this.setParams({});return}this._error(R,A)}_error(R,C){(R?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(R){this.allErrors||this.gen.if(R)}setParams(R,C){C?Object.assign(this.params,R):this.params=R}block$data(R,C,A=a.nil){this.gen.block(()=>{this.check$data(R,A),C()})}check$data(R=a.nil,C=a.nil){if(!this.$data)return;const{gen:A,schemaCode:K,schemaType:B,def:re}=this;A.if((0,a.or)((0,a._)`${K} === undefined`,C)),R!==a.nil&&A.assign(R,!0),(B.length||re.validateSchema)&&(A.elseIf(this.invalid$data()),this.$dataError(),R!==a.nil&&A.assign(R,!1)),A.else()}invalid$data(){const{gen:R,schemaCode:C,schemaType:A,def:K,it:B}=this;return(0,a.or)(re(),me());function re(){if(A.length){if(!(C instanceof a.Name))throw new Error("ajv implementation error");const ce=Array.isArray(A)?A:[A];return(0,a._)`${(0,o.checkDataTypes)(ce,C,B.opts.strictNumbers,o.DataType.Wrong)}`}return a.nil}function me(){if(K.validateSchema){const ce=R.scopeValue("validate$data",{ref:K.validateSchema});return(0,a._)`!${ce}(${C})`}return a.nil}}subschema(R,C){const A=(0,h.getSubschema)(this.it,R);(0,h.extendSubschemaData)(A,this.it,R),(0,h.extendSubschemaMode)(A,R);const K={...this.it,...A,items:void 0,props:void 0};return c(K,C),K}mergeEvaluated(R,C){const{it:A,gen:K}=this;A.opts.unevaluated&&(A.props!==!0&&R.props!==void 0&&(A.props=g.mergeEvaluated.props(K,R.props,A.props,C)),A.items!==!0&&R.items!==void 0&&(A.items=g.mergeEvaluated.items(K,R.items,A.items,C)))}mergeValidEvaluated(R,C){const{it:A,gen:K}=this;if(A.opts.unevaluated&&(A.props!==!0||A.items!==!0))return K.if(C,()=>this.mergeEvaluated(R,a.Name)),!0}}ve.KeywordCxt=I;function U(E,R,C,A){const K=new I(E,C,R);"code"in C?C.code(K,A):K.$data&&C.validate?(0,s.funcKeywordCode)(K,C):"macro"in C?(0,s.macroKeywordCode)(K,C):(C.compile||C.validate)&&(0,s.funcKeywordCode)(K,C)}const H=/^\/(?:[^~]|~0|~1)*$/,Q=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Y(E,{dataLevel:R,dataNames:C,dataPathArr:A}){let K,B;if(E==="")return m.default.rootData;if(E[0]==="/"){if(!H.test(E))throw new Error(`Invalid JSON-pointer: ${E}`);K=E,B=m.default.rootData}else{const ue=Q.exec(E);if(!ue)throw new Error(`Invalid JSON-pointer: ${E}`);const ne=+ue[1];if(K=ue[2],K==="#"){if(ne>=R)throw new Error(ce("property/index",ne));return A[R-ne]}if(ne>R)throw new Error(ce("data",ne));if(B=C[R-ne],!K)return B}let re=B;const me=K.split("/");for(const ue of me)ue&&(B=(0,a._)`${B}${(0,a.getProperty)((0,g.unescapeJsonPointer)(ue))}`,re=(0,a._)`${re} && ${B}`);return re;function ce(ue,ne){return`Cannot access ${ue} ${ne} levels up, current level is ${R}`}}return ve.getData=Y,ve}var Ae={},Dr;function dr(){if(Dr)return Ae;Dr=1,Object.defineProperty(Ae,"__esModule",{value:!0});class e extends Error{constructor(r){super("validation failed"),this.errors=r,this.ajv=this.validation=!0}}return Ae.default=e,Ae}var Ve={},Mr;function Bt(){if(Mr)return Ve;Mr=1,Object.defineProperty(Ve,"__esModule",{value:!0});const e=Gt();class t extends Error{constructor(o,d,s,h){super(h||`can't resolve reference ${s} from id ${d}`),this.missingRef=(0,e.resolveUrl)(o,d,s),this.missingSchema=(0,e.normalizeId)((0,e.getFullPath)(o,this.missingRef))}}return Ve.default=t,Ve}var le={},Ar;function lr(){if(Ar)return le;Ar=1,Object.defineProperty(le,"__esModule",{value:!0}),le.resolveSchema=le.getCompilingSchema=le.resolveRef=le.compileSchema=le.SchemaEnv=void 0;const e=W(),t=dr(),r=we(),o=Gt(),d=Z(),s=Wt();class h{constructor(l){var n;this.refs={},this.dynamicAnchors={};let c;typeof l.schema=="object"&&(c=l.schema),this.schema=l.schema,this.schemaId=l.schemaId,this.root=l.root||this,this.baseId=(n=l.baseId)!==null&&n!==void 0?n:(0,o.normalizeId)(c?.[l.schemaId||"$id"]),this.schemaPath=l.schemaPath,this.localRefs=l.localRefs,this.meta=l.meta,this.$async=c?.$async,this.refs={}}}le.SchemaEnv=h;function a(u){const l=g.call(this,u);if(l)return l;const n=(0,o.getFullPath)(this.opts.uriResolver,u.root.baseId),{es5:c,lines:y}=this.opts.code,{ownProperties:i}=this.opts,p=new e.CodeGen(this.scope,{es5:c,lines:y,ownProperties:i});let P;u.$async&&(P=p.scopeValue("Error",{ref:t.default,code:(0,e._)`require("ajv/dist/runtime/validation_error").default`}));const O=p.scopeName("validate");u.validateName=O;const D={gen:p,allErrors:this.opts.allErrors,data:r.default.data,parentData:r.default.parentData,parentDataProperty:r.default.parentDataProperty,dataNames:[r.default.data],dataPathArr:[e.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:p.scopeValue("schema",this.opts.code.source===!0?{ref:u.schema,code:(0,e.stringify)(u.schema)}:{ref:u.schema}),validateName:O,ValidationError:P,schema:u.schema,schemaEnv:u,rootId:n,baseId:u.baseId||n,schemaPath:e.nil,errSchemaPath:u.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,e._)`""`,opts:this.opts,self:this};let z;try{this._compilations.add(u),(0,s.validateFunctionCode)(D),p.optimize(this.opts.code.optimize);const q=p.toString();z=`${p.scopeRefs(r.default.scope)}return ${q}`,this.opts.code.process&&(z=this.opts.code.process(z,u));const F=new Function(`${r.default.self}`,`${r.default.scope}`,z)(this,this.scope.get());if(this.scope.value(O,{ref:F}),F.errors=null,F.schema=u.schema,F.schemaEnv=u,u.$async&&(F.$async=!0),this.opts.code.source===!0&&(F.source={validateName:O,validateCode:q,scopeValues:p._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 u.validate=F,u}catch(q){throw delete u.validate,delete u.validateName,z&&this.logger.error("Error compiling schema, function code:",z),q}finally{this._compilations.delete(u)}}le.compileSchema=a;function m(u,l,n){var c;n=(0,o.resolveUrl)(this.opts.uriResolver,l,n);const y=u.refs[n];if(y)return y;let i=v.call(this,u,n);if(i===void 0){const p=(c=u.localRefs)===null||c===void 0?void 0:c[n],{schemaId:P}=this.opts;p&&(i=new h({schema:p,schemaId:P,root:u,baseId:l}))}if(i!==void 0)return u.refs[n]=b.call(this,i)}le.resolveRef=m;function b(u){return(0,o.inlineRef)(u.schema,this.opts.inlineRefs)?u.schema:u.validate?u:a.call(this,u)}function g(u){for(const l of this._compilations)if(S(l,u))return l}le.getCompilingSchema=g;function S(u,l){return u.schema===l.schema&&u.root===l.root&&u.baseId===l.baseId}function v(u,l){let n;for(;typeof(n=this.refs[l])=="string";)l=n;return n||this.schemas[l]||_.call(this,u,l)}function _(u,l){const n=this.opts.uriResolver.parse(l),c=(0,o._getFullPath)(this.opts.uriResolver,n);let y=(0,o.getFullPath)(this.opts.uriResolver,u.baseId,void 0);if(Object.keys(u.schema).length>0&&c===y)return w.call(this,n,u);const i=(0,o.normalizeId)(c),p=this.refs[i]||this.schemas[i];if(typeof p=="string"){const P=_.call(this,u,p);return typeof P?.schema!="object"?void 0:w.call(this,n,P)}if(typeof p?.schema=="object"){if(p.validate||a.call(this,p),i===(0,o.normalizeId)(l)){const{schema:P}=p,{schemaId:O}=this.opts,D=P[O];return D&&(y=(0,o.resolveUrl)(this.opts.uriResolver,y,D)),new h({schema:P,schemaId:O,root:u,baseId:y})}return w.call(this,n,p)}}le.resolveSchema=_;const $=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function w(u,{baseId:l,schema:n,root:c}){var y;if(((y=u.fragment)===null||y===void 0?void 0:y[0])!=="/")return;for(const P of u.fragment.slice(1).split("/")){if(typeof n=="boolean")return;const O=n[(0,d.unescapeFragment)(P)];if(O===void 0)return;n=O;const D=typeof n=="object"&&n[this.opts.schemaId];!$.has(P)&&D&&(l=(0,o.resolveUrl)(this.opts.uriResolver,l,D))}let i;if(typeof n!="boolean"&&n.$ref&&!(0,d.schemaHasRulesButRef)(n,this.RULES)){const P=(0,o.resolveUrl)(this.opts.uriResolver,l,n.$ref);i=_.call(this,c,P)}const{schemaId:p}=this.opts;if(i=i||new h({schema:n,schemaId:p,root:c,baseId:l}),i.schema!==i.root.schema)return i}return le}const is="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",os="Meta-schema for $data reference (JSON AnySchema extension proposal)",as="object",cs=["$data"],us={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},ds=!1,ls={$id:is,description:os,type:as,required:cs,properties:us,additionalProperties:ds};var ze={},Ie={exports:{}},ir,Vr;function Vn(){if(Vr)return ir;Vr=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 r(v){let _="",$=0,w=0;for(w=0;w<v.length;w++)if($=v[w].charCodeAt(0),$!==48){if(!($>=48&&$<=57||$>=65&&$<=70||$>=97&&$<=102))return"";_+=v[w];break}for(w+=1;w<v.length;w++){if($=v[w].charCodeAt(0),!($>=48&&$<=57||$>=65&&$<=70||$>=97&&$<=102))return"";_+=v[w]}return _}const o=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function d(v){return v.length=0,!0}function s(v,_,$){if(v.length){const w=r(v);if(w!=="")_.push(w);else return $.error=!0,!1;v.length=0}return!0}function h(v){let _=0;const $={error:!1,address:"",zone:""},w=[],u=[];let l=!1,n=!1,c=s;for(let y=0;y<v.length;y++){const i=v[y];if(!(i==="["||i==="]"))if(i===":"){if(l===!0&&(n=!0),!c(u,w,$))break;if(++_>7){$.error=!0;break}y>0&&v[y-1]===":"&&(l=!0),w.push(":");continue}else if(i==="%"){if(!c(u,w,$))break;c=d}else{u.push(i);continue}}return u.length&&(c===d?$.zone=u.join(""):n?w.push(u.join("")):w.push(r(u))),$.address=w.join(""),$}function a(v){if(m(v,":")<2)return{host:v,isIPV6:!1};const _=h(v);if(_.error)return{host:v,isIPV6:!1};{let $=_.address,w=_.address;return _.zone&&($+="%"+_.zone,w+="%25"+_.zone),{host:$,isIPV6:!0,escapedHost:w}}}function m(v,_){let $=0;for(let w=0;w<v.length;w++)v[w]===_&&$++;return $}function b(v){let _=v;const $=[];let w=-1,u=0;for(;u=_.length;){if(u===1){if(_===".")break;if(_==="/"){$.push("/");break}else{$.push(_);break}}else if(u===2){if(_[0]==="."){if(_[1]===".")break;if(_[1]==="/"){_=_.slice(2);continue}}else if(_[0]==="/"&&(_[1]==="."||_[1]==="/")){$.push("/");break}}else if(u===3&&_==="/.."){$.length!==0&&$.pop(),$.push("/");break}if(_[0]==="."){if(_[1]==="."){if(_[2]==="/"){_=_.slice(3);continue}}else if(_[1]==="/"){_=_.slice(2);continue}}else if(_[0]==="/"&&_[1]==="."){if(_[2]==="/"){_=_.slice(2);continue}else if(_[2]==="."&&_[3]==="/"){_=_.slice(3),$.length!==0&&$.pop();continue}}if((w=_.indexOf("/",1))===-1){$.push(_);break}else $.push(_.slice(0,w)),_=_.slice(w)}return $.join("")}function g(v,_){const $=_!==!0?escape:unescape;return v.scheme!==void 0&&(v.scheme=$(v.scheme)),v.userinfo!==void 0&&(v.userinfo=$(v.userinfo)),v.host!==void 0&&(v.host=$(v.host)),v.path!==void 0&&(v.path=$(v.path)),v.query!==void 0&&(v.query=$(v.query)),v.fragment!==void 0&&(v.fragment=$(v.fragment)),v}function S(v){const _=[];if(v.userinfo!==void 0&&(_.push(v.userinfo),_.push("@")),v.host!==void 0){let $=unescape(v.host);if(!t($)){const w=a($);w.isIPV6===!0?$=`[${w.escapedHost}]`:$=v.host}_.push($)}return(typeof v.port=="number"||typeof v.port=="string")&&(_.push(":"),_.push(String(v.port))),_.length?_.join(""):void 0}return ir={nonSimpleDomain:o,recomposeAuthority:S,normalizeComponentEncoding:g,removeDotSegments:b,isIPv4:t,isUUID:e,normalizeIPv6:a,stringArrayToHexStripped:r},ir}var or,zr;function fs(){if(zr)return or;zr=1;const{isUUID:e}=Vn(),t=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,r=["http","https","ws","wss","urn","urn:uuid"];function o(i){return r.indexOf(i)!==-1}function d(i){return i.secure===!0?!0:i.secure===!1?!1:i.scheme?i.scheme.length===3&&(i.scheme[0]==="w"||i.scheme[0]==="W")&&(i.scheme[1]==="s"||i.scheme[1]==="S")&&(i.scheme[2]==="s"||i.scheme[2]==="S"):!1}function s(i){return i.host||(i.error=i.error||"HTTP URIs must have a host."),i}function h(i){const p=String(i.scheme).toLowerCase()==="https";return(i.port===(p?443:80)||i.port==="")&&(i.port=void 0),i.path||(i.path="/"),i}function a(i){return i.secure=d(i),i.resourceName=(i.path||"/")+(i.query?"?"+i.query:""),i.path=void 0,i.query=void 0,i}function m(i){if((i.port===(d(i)?443:80)||i.port==="")&&(i.port=void 0),typeof i.secure=="boolean"&&(i.scheme=i.secure?"wss":"ws",i.secure=void 0),i.resourceName){const[p,P]=i.resourceName.split("?");i.path=p&&p!=="/"?p:void 0,i.query=P,i.resourceName=void 0}return i.fragment=void 0,i}function b(i,p){if(!i.path)return i.error="URN can not be parsed",i;const P=i.path.match(t);if(P){const O=p.scheme||i.scheme||"urn";i.nid=P[1].toLowerCase(),i.nss=P[2];const D=`${O}:${p.nid||i.nid}`,z=y(D);i.path=void 0,z&&(i=z.parse(i,p))}else i.error=i.error||"URN can not be parsed.";return i}function g(i,p){if(i.nid===void 0)throw new Error("URN without nid cannot be serialized");const P=p.scheme||i.scheme||"urn",O=i.nid.toLowerCase(),D=`${P}:${p.nid||O}`,z=y(D);z&&(i=z.serialize(i,p));const q=i,V=i.nss;return q.path=`${O||p.nid}:${V}`,p.skipEscape=!0,q}function S(i,p){const P=i;return P.uuid=P.nss,P.nss=void 0,!p.tolerant&&(!P.uuid||!e(P.uuid))&&(P.error=P.error||"UUID is not valid."),P}function v(i){const p=i;return p.nss=(i.uuid||"").toLowerCase(),p}const _={scheme:"http",domainHost:!0,parse:s,serialize:h},$={scheme:"https",domainHost:_.domainHost,parse:s,serialize:h},w={scheme:"ws",domainHost:!0,parse:a,serialize:m},u={scheme:"wss",domainHost:w.domainHost,parse:w.parse,serialize:w.serialize},c={http:_,https:$,ws:w,wss:u,urn:{scheme:"urn",parse:b,serialize:g,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:S,serialize:v,skipNormalize:!0}};Object.setPrototypeOf(c,null);function y(i){return i&&(c[i]||c[i.toLowerCase()])||void 0}return or={wsIsSecure:d,SCHEMES:c,isValidSchemeName:o,getSchemeHandler:y},or}var Fr;function ps(){if(Fr)return Ie.exports;Fr=1;const{normalizeIPv6:e,removeDotSegments:t,recomposeAuthority:r,normalizeComponentEncoding:o,isIPv4:d,nonSimpleDomain:s}=Vn(),{SCHEMES:h,getSchemeHandler:a}=fs();function m(u,l){return typeof u=="string"?u=v($(u,l),l):typeof u=="object"&&(u=$(v(u,l),l)),u}function b(u,l,n){const c=n?Object.assign({scheme:"null"},n):{scheme:"null"},y=g($(u,c),$(l,c),c,!0);return c.skipEscape=!0,v(y,c)}function g(u,l,n,c){const y={};return c||(u=$(v(u,n),n),l=$(v(l,n),n)),n=n||{},!n.tolerant&&l.scheme?(y.scheme=l.scheme,y.userinfo=l.userinfo,y.host=l.host,y.port=l.port,y.path=t(l.path||""),y.query=l.query):(l.userinfo!==void 0||l.host!==void 0||l.port!==void 0?(y.userinfo=l.userinfo,y.host=l.host,y.port=l.port,y.path=t(l.path||""),y.query=l.query):(l.path?(l.path[0]==="/"?y.path=t(l.path):((u.userinfo!==void 0||u.host!==void 0||u.port!==void 0)&&!u.path?y.path="/"+l.path:u.path?y.path=u.path.slice(0,u.path.lastIndexOf("/")+1)+l.path:y.path=l.path,y.path=t(y.path)),y.query=l.query):(y.path=u.path,l.query!==void 0?y.query=l.query:y.query=u.query),y.userinfo=u.userinfo,y.host=u.host,y.port=u.port),y.scheme=u.scheme),y.fragment=l.fragment,y}function S(u,l,n){return typeof u=="string"?(u=unescape(u),u=v(o($(u,n),!0),{...n,skipEscape:!0})):typeof u=="object"&&(u=v(o(u,!0),{...n,skipEscape:!0})),typeof l=="string"?(l=unescape(l),l=v(o($(l,n),!0),{...n,skipEscape:!0})):typeof l=="object"&&(l=v(o(l,!0),{...n,skipEscape:!0})),u.toLowerCase()===l.toLowerCase()}function v(u,l){const n={host:u.host,scheme:u.scheme,userinfo:u.userinfo,port:u.port,path:u.path,query:u.query,nid:u.nid,nss:u.nss,uuid:u.uuid,fragment:u.fragment,reference:u.reference,resourceName:u.resourceName,secure:u.secure,error:""},c=Object.assign({},l),y=[],i=a(c.scheme||n.scheme);i&&i.serialize&&i.serialize(n,c),n.path!==void 0&&(c.skipEscape?n.path=unescape(n.path):(n.path=escape(n.path),n.scheme!==void 0&&(n.path=n.path.split("%3A").join(":")))),c.reference!=="suffix"&&n.scheme&&y.push(n.scheme,":");const p=r(n);if(p!==void 0&&(c.reference!=="suffix"&&y.push("//"),y.push(p),n.path&&n.path[0]!=="/"&&y.push("/")),n.path!==void 0){let P=n.path;!c.absolutePath&&(!i||!i.absolutePath)&&(P=t(P)),p===void 0&&P[0]==="/"&&P[1]==="/"&&(P="/%2F"+P.slice(2)),y.push(P)}return n.query!==void 0&&y.push("?",n.query),n.fragment!==void 0&&y.push("#",n.fragment),y.join("")}const _=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function $(u,l){const n=Object.assign({},l),c={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let y=!1;n.reference==="suffix"&&(n.scheme?u=n.scheme+":"+u:u="//"+u);const i=u.match(_);if(i){if(c.scheme=i[1],c.userinfo=i[3],c.host=i[4],c.port=parseInt(i[5],10),c.path=i[6]||"",c.query=i[7],c.fragment=i[8],isNaN(c.port)&&(c.port=i[5]),c.host)if(d(c.host)===!1){const O=e(c.host);c.host=O.host.toLowerCase(),y=O.isIPV6}else y=!0;c.scheme===void 0&&c.userinfo===void 0&&c.host===void 0&&c.port===void 0&&c.query===void 0&&!c.path?c.reference="same-document":c.scheme===void 0?c.reference="relative":c.fragment===void 0?c.reference="absolute":c.reference="uri",n.reference&&n.reference!=="suffix"&&n.reference!==c.reference&&(c.error=c.error||"URI is not a "+n.reference+" reference.");const p=a(n.scheme||c.scheme);if(!n.unicodeSupport&&(!p||!p.unicodeSupport)&&c.host&&(n.domainHost||p&&p.domainHost)&&y===!1&&s(c.host))try{c.host=URL.domainToASCII(c.host.toLowerCase())}catch(P){c.error=c.error||"Host's domain name can not be converted to ASCII: "+P}(!p||p&&!p.skipNormalize)&&(u.indexOf("%")!==-1&&(c.scheme!==void 0&&(c.scheme=unescape(c.scheme)),c.host!==void 0&&(c.host=unescape(c.host))),c.path&&(c.path=escape(unescape(c.path))),c.fragment&&(c.fragment=encodeURI(decodeURIComponent(c.fragment)))),p&&p.parse&&p.parse(c,n)}else c.error=c.error||"URI can not be parsed.";return c}const w={SCHEMES:h,normalize:m,resolve:b,resolveComponent:g,equal:S,serialize:v,parse:$};return Ie.exports=w,Ie.exports.default=w,Ie.exports.fastUri=w,Ie.exports}var Lr;function ms(){if(Lr)return ze;Lr=1,Object.defineProperty(ze,"__esModule",{value:!0});const e=ps();return e.code='require("ajv/dist/runtime/uri").default',ze.default=e,ze}var Ur;function hs(){return Ur||(Ur=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=Wt();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=W();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});const o=dr(),d=Bt(),s=Dn(),h=lr(),a=W(),m=Gt(),b=wt(),g=Z(),S=ls,v=ms(),_=(M,j)=>new RegExp(M,j);_.code="new RegExp";const $=["removeAdditional","useDefaults","coerceTypes"],w=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),u={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."},l={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},n=200;function c(M){var j,T,N,f,k,I,U,H,Q,Y,E,R,C,A,K,B,re,me,ce,ue,ne,Ee,fe,Yt,Zt;const Ne=M.strict,Qt=(j=M.code)===null||j===void 0?void 0:j.optimize,mr=Qt===!0||Qt===void 0?1:Qt||0,hr=(N=(T=M.code)===null||T===void 0?void 0:T.regExp)!==null&&N!==void 0?N:_,xn=(f=M.uriResolver)!==null&&f!==void 0?f:v.default;return{strictSchema:(I=(k=M.strictSchema)!==null&&k!==void 0?k:Ne)!==null&&I!==void 0?I:!0,strictNumbers:(H=(U=M.strictNumbers)!==null&&U!==void 0?U:Ne)!==null&&H!==void 0?H:!0,strictTypes:(Y=(Q=M.strictTypes)!==null&&Q!==void 0?Q:Ne)!==null&&Y!==void 0?Y:"log",strictTuples:(R=(E=M.strictTuples)!==null&&E!==void 0?E:Ne)!==null&&R!==void 0?R:"log",strictRequired:(A=(C=M.strictRequired)!==null&&C!==void 0?C:Ne)!==null&&A!==void 0?A:!1,code:M.code?{...M.code,optimize:mr,regExp:hr}:{optimize:mr,regExp:hr},loopRequired:(K=M.loopRequired)!==null&&K!==void 0?K:n,loopEnum:(B=M.loopEnum)!==null&&B!==void 0?B:n,meta:(re=M.meta)!==null&&re!==void 0?re:!0,messages:(me=M.messages)!==null&&me!==void 0?me:!0,inlineRefs:(ce=M.inlineRefs)!==null&&ce!==void 0?ce:!0,schemaId:(ue=M.schemaId)!==null&&ue!==void 0?ue:"$id",addUsedSchema:(ne=M.addUsedSchema)!==null&&ne!==void 0?ne:!0,validateSchema:(Ee=M.validateSchema)!==null&&Ee!==void 0?Ee:!0,validateFormats:(fe=M.validateFormats)!==null&&fe!==void 0?fe:!0,unicodeRegExp:(Yt=M.unicodeRegExp)!==null&&Yt!==void 0?Yt:!0,int32range:(Zt=M.int32range)!==null&&Zt!==void 0?Zt:!0,uriResolver:xn}}class y{constructor(j={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,j=this.opts={...j,...c(j)};const{es5:T,lines:N}=this.opts.code;this.scope=new a.ValueScope({scope:{},prefixes:w,es5:T,lines:N}),this.logger=V(j.logger);const f=j.validateFormats;j.validateFormats=!1,this.RULES=(0,s.getRules)(),i.call(this,u,j,"NOT SUPPORTED"),i.call(this,l,j,"DEPRECATED","warn"),this._metaOpts=z.call(this),j.formats&&O.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=f}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:j,meta:T,schemaId:N}=this.opts;let f=S;N==="id"&&(f={...S},f.id=f.$id,delete f.$id),T&&j&&this.addMetaSchema(f,f[N],!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 N;if(typeof j=="string"){if(N=this.getSchema(j),!N)throw new Error(`no schema with key or ref "${j}"`)}else N=this.compile(j);const f=N(T);return"$async"in N||(this.errors=N.errors),f}compile(j,T){const N=this._addSchema(j,T);return N.validate||this._compileSchemaEnv(N)}compileAsync(j,T){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:N}=this.opts;return f.call(this,j,T);async function f(Y,E){await k.call(this,Y.$schema);const R=this._addSchema(Y,E);return R.validate||I.call(this,R)}async function k(Y){Y&&!this.getSchema(Y)&&await f.call(this,{$ref:Y},!0)}async function I(Y){try{return this._compileSchemaEnv(Y)}catch(E){if(!(E instanceof d.default))throw E;return U.call(this,E),await H.call(this,E.missingSchema),I.call(this,Y)}}function U({missingSchema:Y,missingRef:E}){if(this.refs[Y])throw new Error(`AnySchema ${Y} is loaded but ${E} cannot be resolved`)}async function H(Y){const E=await Q.call(this,Y);this.refs[Y]||await k.call(this,E.$schema),this.refs[Y]||this.addSchema(E,Y,T)}async function Q(Y){const E=this._loading[Y];if(E)return E;try{return await(this._loading[Y]=N(Y))}finally{delete this._loading[Y]}}}addSchema(j,T,N,f=this.opts.validateSchema){if(Array.isArray(j)){for(const I of j)this.addSchema(I,void 0,N,f);return this}let k;if(typeof j=="object"){const{schemaId:I}=this.opts;if(k=j[I],k!==void 0&&typeof k!="string")throw new Error(`schema ${I} must be string`)}return T=(0,m.normalizeId)(T||k),this._checkUnique(T),this.schemas[T]=this._addSchema(j,N,T,f,!0),this}addMetaSchema(j,T,N=this.opts.validateSchema){return this.addSchema(j,T,!0,N),this}validateSchema(j,T){if(typeof j=="boolean")return!0;let N;if(N=j.$schema,N!==void 0&&typeof N!="string")throw new Error("$schema must be a string");if(N=N||this.opts.defaultMeta||this.defaultMeta(),!N)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const f=this.validate(N,j);if(!f&&T){const k="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(k);else throw new Error(k)}return f}getSchema(j){let T;for(;typeof(T=p.call(this,j))=="string";)j=T;if(T===void 0){const{schemaId:N}=this.opts,f=new h.SchemaEnv({schema:{},schemaId:N});if(T=h.resolveSchema.call(this,f,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=p.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 N=j[this.opts.schemaId];return N&&(N=(0,m.normalizeId)(N),delete this.schemas[N],delete this.refs[N]),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 N;if(typeof j=="string")N=j,typeof T=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),T.keyword=N);else if(typeof j=="object"&&T===void 0){if(T=j,N=T.keyword,Array.isArray(N)&&!N.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(L.call(this,N,T),!T)return(0,g.eachItem)(N,k=>X.call(this,k)),this;oe.call(this,T);const f={...T,type:(0,b.getJSONTypes)(T.type),schemaType:(0,b.getJSONTypes)(T.schemaType)};return(0,g.eachItem)(N,f.type.length===0?k=>X.call(this,k,f):k=>f.type.forEach(I=>X.call(this,k,f,I))),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 N of T.rules){const f=N.rules.findIndex(k=>k.keyword===j);f>=0&&N.rules.splice(f,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:N="data"}={}){return!j||j.length===0?"No errors":j.map(f=>`${N}${f.instancePath} ${f.message}`).reduce((f,k)=>f+T+k)}$dataMetaSchema(j,T){const N=this.RULES.all;j=JSON.parse(JSON.stringify(j));for(const f of T){const k=f.split("/").slice(1);let I=j;for(const U of k)I=I[U];for(const U in N){const H=N[U];if(typeof H!="object")continue;const{$data:Q}=H.definition,Y=I[U];Q&&Y&&(I[U]=pe(Y))}}return j}_removeAllSchemas(j,T){for(const N in j){const f=j[N];(!T||T.test(N))&&(typeof f=="string"?delete j[N]:f&&!f.meta&&(this._cache.delete(f.schema),delete j[N]))}}_addSchema(j,T,N,f=this.opts.validateSchema,k=this.opts.addUsedSchema){let I;const{schemaId:U}=this.opts;if(typeof j=="object")I=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;N=(0,m.normalizeId)(I||N);const Q=m.getSchemaRefs.call(this,j,N);return H=new h.SchemaEnv({schema:j,schemaId:U,meta:T,baseId:N,localRefs:Q}),this._cache.set(H.schema,H),k&&!N.startsWith("#")&&(N&&this._checkUnique(N),this.refs[N]=H),f&&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):h.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{h.compileSchema.call(this,j)}finally{this.opts=T}}}y.ValidationError=o.default,y.MissingRefError=d.default,e.default=y;function i(M,j,T,N="error"){for(const f in M){const k=f;k in j&&this.logger[N](`${T}: option ${f}. ${M[k]}`)}}function p(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 O(){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 $)delete M[j];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,j){const{RULES:T}=this;if((0,g.eachItem)(M,N=>{if(T.keywords[N])throw new Error(`Keyword ${N} is already defined`);if(!F.test(N))throw new Error(`Keyword ${N} 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 N;const f=j?.post;if(T&&f)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:k}=this;let I=f?k.post:k.rules.find(({type:H})=>H===T);if(I||(I={type:T,rules:[]},k.rules.push(I)),k.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?ie.call(this,I,U,j.before):I.rules.push(U),k.all[M]=U,(N=j.implements)===null||N===void 0||N.forEach(H=>this.addKeyword(H))}function ie(M,j,T){const N=M.rules.findIndex(f=>f.keyword===T);N>=0?M.rules.splice(N,0,j):(M.rules.push(j),this.logger.warn(`rule ${T} is not defined`))}function oe(M){let{metaSchema:j}=M;j!==void 0&&(M.$data&&this.opts.$data&&(j=pe(j)),M.validateSchema=this.compile(j,!0))}const ee={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function pe(M){return{anyOf:[M,ee]}}})(Xt)),Xt}var Fe={},Le={},Ue={},Kr;function ys(){if(Kr)return Ue;Kr=1,Object.defineProperty(Ue,"__esModule",{value:!0});const e={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};return Ue.default=e,Ue}var be={},Hr;function gs(){if(Hr)return be;Hr=1,Object.defineProperty(be,"__esModule",{value:!0}),be.callRef=be.getValidate=void 0;const e=Bt(),t=ge(),r=W(),o=we(),d=lr(),s=Z(),h={keyword:"$ref",schemaType:"string",code(b){const{gen:g,schema:S,it:v}=b,{baseId:_,schemaEnv:$,validateName:w,opts:u,self:l}=v,{root:n}=$;if((S==="#"||S==="#/")&&_===n.baseId)return y();const c=d.resolveRef.call(l,n,_,S);if(c===void 0)throw new e.default(v.opts.uriResolver,_,S);if(c instanceof d.SchemaEnv)return i(c);return p(c);function y(){if($===n)return m(b,w,$,$.$async);const P=g.scopeValue("root",{ref:n});return m(b,(0,r._)`${P}.validate`,n,n.$async)}function i(P){const O=a(b,P);m(b,O,P,P.$async)}function p(P){const O=g.scopeValue("schema",u.code.source===!0?{ref:P,code:(0,r.stringify)(P)}:{ref:P}),D=g.name("valid"),z=b.subschema({schema:P,dataTypes:[],schemaPath:r.nil,topSchemaRef:O,errSchemaPath:S},D);b.mergeEvaluated(z),b.ok(D)}}};function a(b,g){const{gen:S}=b;return g.validate?S.scopeValue("validate",{ref:g.validate}):(0,r._)`${S.scopeValue("wrapper",{ref:g})}.validate`}be.getValidate=a;function m(b,g,S,v){const{gen:_,it:$}=b,{allErrors:w,schemaEnv:u,opts:l}=$,n=l.passContext?o.default.this:r.nil;v?c():y();function c(){if(!u.$async)throw new Error("async schema referenced by sync schema");const P=_.let("valid");_.try(()=>{_.code((0,r._)`await ${(0,t.callValidateCode)(b,g,n)}`),p(g),w||_.assign(P,!0)},O=>{_.if((0,r._)`!(${O} instanceof ${$.ValidationError})`,()=>_.throw(O)),i(O),w||_.assign(P,!1)}),b.ok(P)}function y(){b.result((0,t.callValidateCode)(b,g,n),()=>p(g),()=>i(g))}function i(P){const O=(0,r._)`${P}.errors`;_.assign(o.default.vErrors,(0,r._)`${o.default.vErrors} === null ? ${O} : ${o.default.vErrors}.concat(${O})`),_.assign(o.default.errors,(0,r._)`${o.default.vErrors}.length`)}function p(P){var O;if(!$.opts.unevaluated)return;const D=(O=S?.validate)===null||O===void 0?void 0:O.evaluated;if($.props!==!0)if(D&&!D.dynamicProps)D.props!==void 0&&($.props=s.mergeEvaluated.props(_,D.props,$.props));else{const z=_.var("props",(0,r._)`${P}.evaluated.props`);$.props=s.mergeEvaluated.props(_,z,$.props,r.Name)}if($.items!==!0)if(D&&!D.dynamicItems)D.items!==void 0&&($.items=s.mergeEvaluated.items(_,D.items,$.items));else{const z=_.var("items",(0,r._)`${P}.evaluated.items`);$.items=s.mergeEvaluated.items(_,z,$.items,r.Name)}}}return be.callRef=m,be.default=h,be}var Jr;function vs(){if(Jr)return Le;Jr=1,Object.defineProperty(Le,"__esModule",{value:!0});const e=ys(),t=gs(),r=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,t.default];return Le.default=r,Le}var Ke={},He={},Gr;function _s(){if(Gr)return He;Gr=1,Object.defineProperty(He,"__esModule",{value:!0});const e=W(),t=e.operators,r={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}},o={message:({keyword:s,schemaCode:h})=>(0,e.str)`must be ${r[s].okStr} ${h}`,params:({keyword:s,schemaCode:h})=>(0,e._)`{comparison: ${r[s].okStr}, limit: ${h}}`},d={keyword:Object.keys(r),type:"number",schemaType:"number",$data:!0,error:o,code(s){const{keyword:h,data:a,schemaCode:m}=s;s.fail$data((0,e._)`${a} ${r[h].fail} ${m} || isNaN(${a})`)}};return He.default=d,He}var Je={},Wr;function $s(){if(Wr)return Je;Wr=1,Object.defineProperty(Je,"__esModule",{value:!0});const e=W(),r={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:o})=>(0,e.str)`must be multiple of ${o}`,params:({schemaCode:o})=>(0,e._)`{multipleOf: ${o}}`},code(o){const{gen:d,data:s,schemaCode:h,it:a}=o,m=a.opts.multipleOfPrecision,b=d.let("res"),g=m?(0,e._)`Math.abs(Math.round(${b}) - ${b}) > 1e-${m}`:(0,e._)`${b} !== parseInt(${b})`;o.fail$data((0,e._)`(${h} === 0 || (${b} = ${s}/${h}, ${g}))`)}};return Je.default=r,Je}var Ge={},We={},Br;function bs(){if(Br)return We;Br=1,Object.defineProperty(We,"__esModule",{value:!0});function e(t){const r=t.length;let o=0,d=0,s;for(;d<r;)o++,s=t.charCodeAt(d++),s>=55296&&s<=56319&&d<r&&(s=t.charCodeAt(d),(s&64512)===56320&&d++);return o}return We.default=e,e.code='require("ajv/dist/runtime/ucs2length").default',We}var Yr;function ws(){if(Yr)return Ge;Yr=1,Object.defineProperty(Ge,"__esModule",{value:!0});const e=W(),t=Z(),r=bs(),d={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:s,schemaCode:h}){const a=s==="maxLength"?"more":"fewer";return(0,e.str)`must NOT have ${a} than ${h} characters`},params:({schemaCode:s})=>(0,e._)`{limit: ${s}}`},code(s){const{keyword:h,data:a,schemaCode:m,it:b}=s,g=h==="maxLength"?e.operators.GT:e.operators.LT,S=b.opts.unicode===!1?(0,e._)`${a}.length`:(0,e._)`${(0,t.useFunc)(s.gen,r.default)}(${a})`;s.fail$data((0,e._)`${S} ${g} ${m}`)}};return Ge.default=d,Ge}var Be={},Zr;function Ps(){if(Zr)return Be;Zr=1,Object.defineProperty(Be,"__esModule",{value:!0});const e=ge(),t=W(),o={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:d})=>(0,t.str)`must match pattern "${d}"`,params:({schemaCode:d})=>(0,t._)`{pattern: ${d}}`},code(d){const{data:s,$data:h,schema:a,schemaCode:m,it:b}=d,g=b.opts.unicodeRegExp?"u":"",S=h?(0,t._)`(new RegExp(${m}, ${g}))`:(0,e.usePattern)(d,a);d.fail$data((0,t._)`!${S}.test(${s})`)}};return Be.default=o,Be}var Ye={},Qr;function ks(){if(Qr)return Ye;Qr=1,Object.defineProperty(Ye,"__esModule",{value:!0});const e=W(),r={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:o,schemaCode:d}){const s=o==="maxProperties"?"more":"fewer";return(0,e.str)`must NOT have ${s} than ${d} properties`},params:({schemaCode:o})=>(0,e._)`{limit: ${o}}`},code(o){const{keyword:d,data:s,schemaCode:h}=o,a=d==="maxProperties"?e.operators.GT:e.operators.LT;o.fail$data((0,e._)`Object.keys(${s}).length ${a} ${h}`)}};return Ye.default=r,Ye}var Ze={},Xr;function Ss(){if(Xr)return Ze;Xr=1,Object.defineProperty(Ze,"__esModule",{value:!0});const e=ge(),t=W(),r=Z(),d={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:h,schema:a,schemaCode:m,data:b,$data:g,it:S}=s,{opts:v}=S;if(!g&&a.length===0)return;const _=a.length>=v.loopRequired;if(S.allErrors?$():w(),v.strictRequired){const n=s.parentSchema.properties,{definedProperties:c}=s.it;for(const y of a)if(n?.[y]===void 0&&!c.has(y)){const i=S.schemaEnv.baseId+S.errSchemaPath,p=`required property "${y}" is not defined at "${i}" (strictRequired)`;(0,r.checkStrictMode)(S,p,S.opts.strictRequired)}}function $(){if(_||g)s.block$data(t.nil,u);else for(const n of a)(0,e.checkReportMissingProp)(s,n)}function w(){const n=h.let("missing");if(_||g){const c=h.let("valid",!0);s.block$data(c,()=>l(n,c)),s.ok(c)}else h.if((0,e.checkMissingProp)(s,a,n)),(0,e.reportMissingProp)(s,n),h.else()}function u(){h.forOf("prop",m,n=>{s.setParams({missingProperty:n}),h.if((0,e.noPropertyInData)(h,b,n,v.ownProperties),()=>s.error())})}function l(n,c){s.setParams({missingProperty:n}),h.forOf(n,m,()=>{h.assign(c,(0,e.propertyInData)(h,b,n,v.ownProperties)),h.if((0,t.not)(c),()=>{s.error(),h.break()})},t.nil)}}};return Ze.default=d,Ze}var Qe={},xr;function Es(){if(xr)return Qe;xr=1,Object.defineProperty(Qe,"__esModule",{value:!0});const e=W(),r={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:o,schemaCode:d}){const s=o==="maxItems"?"more":"fewer";return(0,e.str)`must NOT have ${s} than ${d} items`},params:({schemaCode:o})=>(0,e._)`{limit: ${o}}`},code(o){const{keyword:d,data:s,schemaCode:h}=o,a=d==="maxItems"?e.operators.GT:e.operators.LT;o.fail$data((0,e._)`${s}.length ${a} ${h}`)}};return Qe.default=r,Qe}var Xe={},xe={},en;function fr(){if(en)return xe;en=1,Object.defineProperty(xe,"__esModule",{value:!0});const e=An();return e.code='require("ajv/dist/runtime/equal").default',xe.default=e,xe}var tn;function js(){if(tn)return Xe;tn=1,Object.defineProperty(Xe,"__esModule",{value:!0});const e=wt(),t=W(),r=Z(),o=fr(),s={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:h,j:a}})=>(0,t.str)`must NOT have duplicate items (items ## ${a} and ${h} are identical)`,params:({params:{i:h,j:a}})=>(0,t._)`{i: ${h}, j: ${a}}`},code(h){const{gen:a,data:m,$data:b,schema:g,parentSchema:S,schemaCode:v,it:_}=h;if(!b&&!g)return;const $=a.let("valid"),w=S.items?(0,e.getSchemaTypes)(S.items):[];h.block$data($,u,(0,t._)`${v} === false`),h.ok($);function u(){const y=a.let("i",(0,t._)`${m}.length`),i=a.let("j");h.setParams({i:y,j:i}),a.assign($,!0),a.if((0,t._)`${y} > 1`,()=>(l()?n:c)(y,i))}function l(){return w.length>0&&!w.some(y=>y==="object"||y==="array")}function n(y,i){const p=a.name("item"),P=(0,e.checkDataTypes)(w,p,_.opts.strictNumbers,e.DataType.Wrong),O=a.const("indices",(0,t._)`{}`);a.for((0,t._)`;${y}--;`,()=>{a.let(p,(0,t._)`${m}[${y}]`),a.if(P,(0,t._)`continue`),w.length>1&&a.if((0,t._)`typeof ${p} == "string"`,(0,t._)`${p} += "_"`),a.if((0,t._)`typeof ${O}[${p}] == "number"`,()=>{a.assign(i,(0,t._)`${O}[${p}]`),h.error(),a.assign($,!1).break()}).code((0,t._)`${O}[${p}] = ${y}`)})}function c(y,i){const p=(0,r.useFunc)(a,o.default),P=a.name("outer");a.label(P).for((0,t._)`;${y}--;`,()=>a.for((0,t._)`${i} = ${y}; ${i}--;`,()=>a.if((0,t._)`${p}(${m}[${y}], ${m}[${i}])`,()=>{h.error(),a.assign($,!1).break(P)})))}}};return Xe.default=s,Xe}var et={},rn;function Rs(){if(rn)return et;rn=1,Object.defineProperty(et,"__esModule",{value:!0});const e=W(),t=Z(),r=fr(),d={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:s})=>(0,e._)`{allowedValue: ${s}}`},code(s){const{gen:h,data:a,$data:m,schemaCode:b,schema:g}=s;m||g&&typeof g=="object"?s.fail$data((0,e._)`!${(0,t.useFunc)(h,r.default)}(${a}, ${b})`):s.fail((0,e._)`${g} !== ${a}`)}};return et.default=d,et}var tt={},nn;function Ns(){if(nn)return tt;nn=1,Object.defineProperty(tt,"__esModule",{value:!0});const e=W(),t=Z(),r=fr(),d={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:h,data:a,$data:m,schema:b,schemaCode:g,it:S}=s;if(!m&&b.length===0)throw new Error("enum must have non-empty array");const v=b.length>=S.opts.loopEnum;let _;const $=()=>_??(_=(0,t.useFunc)(h,r.default));let w;if(v||m)w=h.let("valid"),s.block$data(w,u);else{if(!Array.isArray(b))throw new Error("ajv implementation error");const n=h.const("vSchema",g);w=(0,e.or)(...b.map((c,y)=>l(n,y)))}s.pass(w);function u(){h.assign(w,!1),h.forOf("v",g,n=>h.if((0,e._)`${$()}(${a}, ${n})`,()=>h.assign(w,!0).break()))}function l(n,c){const y=b[c];return typeof y=="object"&&y!==null?(0,e._)`${$()}(${a}, ${n}[${c}])`:(0,e._)`${a} === ${y}`}}};return tt.default=d,tt}var sn;function Os(){if(sn)return Ke;sn=1,Object.defineProperty(Ke,"__esModule",{value:!0});const e=_s(),t=$s(),r=ws(),o=Ps(),d=ks(),s=Ss(),h=Es(),a=js(),m=Rs(),b=Ns(),g=[e.default,t.default,r.default,o.default,d.default,s.default,h.default,a.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},m.default,b.default];return Ke.default=g,Ke}var rt={},je={},on;function zn(){if(on)return je;on=1,Object.defineProperty(je,"__esModule",{value:!0}),je.validateAdditionalItems=void 0;const e=W(),t=Z(),o={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:h,it:a}=s,{items:m}=h;if(!Array.isArray(m)){(0,t.checkStrictMode)(a,'"additionalItems" is ignored when "items" is not an array of schemas');return}d(s,m)}};function d(s,h){const{gen:a,schema:m,data:b,keyword:g,it:S}=s;S.items=!0;const v=a.const("len",(0,e._)`${b}.length`);if(m===!1)s.setParams({len:h.length}),s.pass((0,e._)`${v} <= ${h.length}`);else if(typeof m=="object"&&!(0,t.alwaysValidSchema)(S,m)){const $=a.var("valid",(0,e._)`${v} <= ${h.length}`);a.if((0,e.not)($),()=>_($)),s.ok($)}function _($){a.forRange("i",h.length,v,w=>{s.subschema({keyword:g,dataProp:w,dataPropType:t.Type.Num},$),S.allErrors||a.if((0,e.not)($),()=>a.break())})}}return je.validateAdditionalItems=d,je.default=o,je}var nt={},Re={},an;function Fn(){if(an)return Re;an=1,Object.defineProperty(Re,"__esModule",{value:!0}),Re.validateTuple=void 0;const e=W(),t=Z(),r=ge(),o={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(s){const{schema:h,it:a}=s;if(Array.isArray(h))return d(s,"additionalItems",h);a.items=!0,!(0,t.alwaysValidSchema)(a,h)&&s.ok((0,r.validateArray)(s))}};function d(s,h,a=s.schema){const{gen:m,parentSchema:b,data:g,keyword:S,it:v}=s;w(b),v.opts.unevaluated&&a.length&&v.items!==!0&&(v.items=t.mergeEvaluated.items(m,a.length,v.items));const _=m.name("valid"),$=m.const("len",(0,e._)`${g}.length`);a.forEach((u,l)=>{(0,t.alwaysValidSchema)(v,u)||(m.if((0,e._)`${$} > ${l}`,()=>s.subschema({keyword:S,schemaProp:l,dataProp:l},_)),s.ok(_))});function w(u){const{opts:l,errSchemaPath:n}=v,c=a.length,y=c===u.minItems&&(c===u.maxItems||u[h]===!1);if(l.strictTuples&&!y){const i=`"${S}" is ${c}-tuple, but minItems or maxItems/${h} are not specified or different at path "${n}"`;(0,t.checkStrictMode)(v,i,l.strictTuples)}}}return Re.validateTuple=d,Re.default=o,Re}var cn;function Is(){if(cn)return nt;cn=1,Object.defineProperty(nt,"__esModule",{value:!0});const e=Fn(),t={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:r=>(0,e.validateTuple)(r,"items")};return nt.default=t,nt}var st={},un;function qs(){if(un)return st;un=1,Object.defineProperty(st,"__esModule",{value:!0});const e=W(),t=Z(),r=ge(),o=zn(),s={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:h}})=>(0,e.str)`must NOT have more than ${h} items`,params:({params:{len:h}})=>(0,e._)`{limit: ${h}}`},code(h){const{schema:a,parentSchema:m,it:b}=h,{prefixItems:g}=m;b.items=!0,!(0,t.alwaysValidSchema)(b,a)&&(g?(0,o.validateAdditionalItems)(h,g):h.ok((0,r.validateArray)(h)))}};return st.default=s,st}var it={},dn;function Cs(){if(dn)return it;dn=1,Object.defineProperty(it,"__esModule",{value:!0});const e=W(),t=Z(),o={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:d,max:s}})=>s===void 0?(0,e.str)`must contain at least ${d} valid item(s)`:(0,e.str)`must contain at least ${d} and no more than ${s} valid item(s)`,params:({params:{min:d,max:s}})=>s===void 0?(0,e._)`{minContains: ${d}}`:(0,e._)`{minContains: ${d}, maxContains: ${s}}`},code(d){const{gen:s,schema:h,parentSchema:a,data:m,it:b}=d;let g,S;const{minContains:v,maxContains:_}=a;b.opts.next?(g=v===void 0?1:v,S=_):g=1;const $=s.const("len",(0,e._)`${m}.length`);if(d.setParams({min:g,max:S}),S===void 0&&g===0){(0,t.checkStrictMode)(b,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(S!==void 0&&g>S){(0,t.checkStrictMode)(b,'"minContains" > "maxContains" is always invalid'),d.fail();return}if((0,t.alwaysValidSchema)(b,h)){let c=(0,e._)`${$} >= ${g}`;S!==void 0&&(c=(0,e._)`${c} && ${$} <= ${S}`),d.pass(c);return}b.items=!0;const w=s.name("valid");S===void 0&&g===1?l(w,()=>s.if(w,()=>s.break())):g===0?(s.let(w,!0),S!==void 0&&s.if((0,e._)`${m}.length > 0`,u)):(s.let(w,!1),u()),d.result(w,()=>d.reset());function u(){const c=s.name("_valid"),y=s.let("count",0);l(c,()=>s.if(c,()=>n(y)))}function l(c,y){s.forRange("i",0,$,i=>{d.subschema({keyword:"contains",dataProp:i,dataPropType:t.Type.Num,compositeRule:!0},c),y()})}function n(c){s.code((0,e._)`${c}++`),S===void 0?s.if((0,e._)`${c} >= ${g}`,()=>s.assign(w,!0).break()):(s.if((0,e._)`${c} > ${S}`,()=>s.assign(w,!1).break()),g===1?s.assign(w,!0):s.if((0,e._)`${c} >= ${g}`,()=>s.assign(w,!0)))}}};return it.default=o,it}var ar={},ln;function Ts(){return ln||(ln=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=W(),r=Z(),o=ge();e.error={message:({params:{property:m,depsCount:b,deps:g}})=>{const S=b===1?"property":"properties";return(0,t.str)`must have ${S} ${g} when property ${m} is present`},params:({params:{property:m,depsCount:b,deps:g,missingProperty:S}})=>(0,t._)`{property: ${m},
6
6
  missingProperty: ${S},
7
7
  depsCount: ${b},
8
- deps: ${_}}`};const m={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(h){const[b,_]=s(h);p(h,b),d(h,_)}};function s({schema:h}){const b={},_={};for(const S in h){if(S==="__proto__")continue;const $=Array.isArray(h[S])?b:_;$[S]=h[S]}return[b,_]}function p(h,b=h.schema){const{gen:_,data:S,it:$}=h;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)(_,S,v,$.opts.ownProperties);h.setParams({property:v,depsCount:w.length,deps:w.join(", ")}),$.allErrors?_.if(c,()=>{for(const u of w)(0,i.checkReportMissingProp)(h,u)}):(_.if((0,t._)`${c} && (${(0,i.checkMissingProp)(h,w,g)})`),(0,i.reportMissingProp)(h,g),_.else())}}e.validatePropertyDeps=p;function d(h,b=h.schema){const{gen:_,data:S,keyword:$,it:g}=h,v=_.name("valid");for(const w in b)(0,r.alwaysValidSchema)(g,b[w])||(_.if((0,i.propertyInData)(_,S,w,g.opts.ownProperties),()=>{const c=h.subschema({keyword:$,schemaProp:w},v);h.mergeValidEvaluated(c,v)},()=>_.var(v,!0)),h.ok(v))}e.validateSchemaDeps=d,e.default=m})(ar)),ar}var ot={},fn;function Ds(){if(fn)return ot;fn=1,Object.defineProperty(ot,"__esModule",{value:!0});const e=W(),t=Z(),i={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:m})=>(0,e._)`{propertyName: ${m.propertyName}}`},code(m){const{gen:s,schema:p,data:d,it:h}=m;if((0,t.alwaysValidSchema)(h,p))return;const b=s.name("valid");s.forIn("key",d,_=>{m.setParams({propertyName:_}),m.subschema({keyword:"propertyNames",data:_,dataTypes:["string"],propertyName:_,compositeRule:!0},b),s.if((0,e.not)(b),()=>{m.error(!0),h.allErrors||s.break()})}),m.ok(b)}};return ot.default=i,ot}var at={},pn;function Ln(){if(pn)return at;pn=1,Object.defineProperty(at,"__esModule",{value:!0});const e=ge(),t=W(),r=we(),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:d,schema:h,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,i.alwaysValidSchema)($,h))return;const w=(0,e.allSchemaProperties)(b.properties),c=(0,e.allSchemaProperties)(b.patternProperties);u(),p.ok((0,t._)`${S} === ${r.default.errors}`);function u(){d.forIn("key",_,f=>{!w.length&&!c.length?y(f):d.if(n(f),()=>y(f))})}function n(f){let P;if(w.length>8){const O=(0,i.schemaRefOrVal)($,b.properties,"properties");P=(0,e.isOwnProperty)(d,O,f)}else w.length?P=(0,t.or)(...w.map(O=>(0,t._)`${f} === ${O}`)):P=t.nil;return c.length&&(P=(0,t.or)(P,...c.map(O=>(0,t._)`${(0,e.usePattern)(p,O)}.test(${f})`))),(0,t.not)(P)}function a(f){d.code((0,t._)`delete ${_}[${f}]`)}function y(f){if(v.removeAdditional==="all"||v.removeAdditional&&h===!1){a(f);return}if(h===!1){p.setParams({additionalProperty:f}),p.error(),g||d.break();return}if(typeof h=="object"&&!(0,i.alwaysValidSchema)($,h)){const P=d.name("valid");v.removeAdditional==="failing"?(o(f,P,!1),d.if((0,t.not)(P),()=>{p.reset(),a(f)})):(o(f,P),g||d.if((0,t.not)(P),()=>d.break()))}}function o(f,P,O){const D={keyword:"additionalProperties",dataProp:f,dataPropType:i.Type.Str};O===!1&&Object.assign(D,{compositeRule:!0,createErrors:!1,allErrors:!1}),p.subschema(D,P)}}};return at.default=s,at}var ct={},mn;function Ms(){if(mn)return ct;mn=1,Object.defineProperty(ct,"__esModule",{value:!0});const e=Wt(),t=ge(),r=Z(),i=Ln(),m={keyword:"properties",type:"object",schemaType:"object",code(s){const{gen:p,schema:d,parentSchema:h,data:b,it:_}=s;_.opts.removeAdditional==="all"&&h.additionalProperties===void 0&&i.default.code(new e.KeywordCxt(_,i.default,"additionalProperties"));const S=(0,t.allSchemaProperties)(d);for(const c of S)_.definedProperties.add(c);_.opts.unevaluated&&S.length&&_.props!==!0&&(_.props=r.mergeEvaluated.props(p,(0,r.toHash)(S),_.props));const $=S.filter(c=>!(0,r.alwaysValidSchema)(_,d[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&&d[c].default!==void 0}function w(c){s.subschema({keyword:"properties",schemaProp:c,dataProp:c},g)}}};return ct.default=m,ct}var ut={},hn;function As(){if(hn)return ut;hn=1,Object.defineProperty(ut,"__esModule",{value:!0});const e=ge(),t=W(),r=Z(),i=Z(),m={keyword:"patternProperties",type:"object",schemaType:"object",code(s){const{gen:p,schema:d,data:h,parentSchema:b,it:_}=s,{opts:S}=_,$=(0,e.allSchemaProperties)(d),g=$.filter(y=>(0,r.alwaysValidSchema)(_,d[y]));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,i.evaluatedPropsToName)(p,_.props));const{props:c}=_;u();function u(){for(const y of $)v&&n(y),_.allErrors?a(y):(p.var(w,!0),a(y),p.if(w))}function n(y){for(const o in v)new RegExp(y).test(o)&&(0,r.checkStrictMode)(_,`property ${o} matches pattern ${y} (use allowMatchingProperties)`)}function a(y){p.forIn("key",h,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 ut.default=m,ut}var dt={},yn;function Vs(){if(yn)return dt;yn=1,Object.defineProperty(dt,"__esModule",{value:!0});const e=Z(),t={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(r){const{gen:i,schema:m,it:s}=r;if((0,e.alwaysValidSchema)(s,m)){r.fail();return}const p=i.name("valid");r.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},p),r.failResult(p,()=>r.reset(),()=>r.error())},error:{message:"must NOT be valid"}};return dt.default=t,dt}var lt={},gn;function zs(){if(gn)return lt;gn=1,Object.defineProperty(lt,"__esModule",{value:!0});const t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:ge().validateUnion,error:{message:"must match a schema in anyOf"}};return lt.default=t,lt}var ft={},vn;function Fs(){if(vn)return ft;vn=1,Object.defineProperty(ft,"__esModule",{value:!0});const e=W(),t=Z(),i={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:m})=>(0,e._)`{passingSchemas: ${m.passing}}`},code(m){const{gen:s,schema:p,parentSchema:d,it:h}=m;if(!Array.isArray(p))throw new Error("ajv implementation error");if(h.opts.discriminator&&d.discriminator)return;const b=p,_=s.let("valid",!1),S=s.let("passing",null),$=s.name("_valid");m.setParams({passing:S}),s.block(g),m.result(_,()=>m.reset(),()=>m.error(!0));function g(){b.forEach((v,w)=>{let c;(0,t.alwaysValidSchema)(h,v)?s.var($,!0):c=m.subschema({keyword:"oneOf",schemaProp:w,compositeRule:!0},$),w>0&&s.if((0,e._)`${$} && ${_}`).assign(_,!1).assign(S,(0,e._)`[${S}, ${w}]`).else(),s.if($,()=>{s.assign(_,!0),s.assign(S,w),c&&m.mergeEvaluated(c,e.Name)})})}}};return ft.default=i,ft}var pt={},_n;function Ls(){if(_n)return pt;_n=1,Object.defineProperty(pt,"__esModule",{value:!0});const e=Z(),t={keyword:"allOf",schemaType:"array",code(r){const{gen:i,schema:m,it:s}=r;if(!Array.isArray(m))throw new Error("ajv implementation error");const p=i.name("valid");m.forEach((d,h)=>{if((0,e.alwaysValidSchema)(s,d))return;const b=r.subschema({keyword:"allOf",schemaProp:h},p);r.ok(p),r.mergeEvaluated(b)})}};return pt.default=t,pt}var mt={},$n;function Us(){if($n)return mt;$n=1,Object.defineProperty(mt,"__esModule",{value:!0});const e=W(),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:d,it:h}=s;d.then===void 0&&d.else===void 0&&(0,t.checkStrictMode)(h,'"if" without "then" and "else" is ignored');const b=m(h,"then"),_=m(h,"else");if(!b&&!_)return;const S=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(S,()=>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 u=s.subschema({keyword:w},$);p.assign(S,$),s.mergeValidEvaluated(u,S),c?p.assign(c,(0,e._)`${w}`):s.setParams({ifClause:w})}}}};function m(s,p){const d=s.schema[p];return d!==void 0&&!(0,t.alwaysValidSchema)(s,d)}return mt.default=i,mt}var ht={},bn;function Ks(){if(bn)return ht;bn=1,Object.defineProperty(ht,"__esModule",{value:!0});const e=Z(),t={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:r,parentSchema:i,it:m}){i.if===void 0&&(0,e.checkStrictMode)(m,`"${r}" without "if" is ignored`)}};return ht.default=t,ht}var wn;function Hs(){if(wn)return rt;wn=1,Object.defineProperty(rt,"__esModule",{value:!0});const e=zn(),t=Is(),r=Fn(),i=Cs(),m=qs(),s=Ts(),p=Ds(),d=Ln(),h=Ms(),b=As(),_=Vs(),S=zs(),$=Fs(),g=Ls(),v=Us(),w=Ks();function c(u=!1){const n=[_.default,S.default,$.default,g.default,v.default,w.default,p.default,d.default,s.default,h.default,b.default];return u?n.push(t.default,i.default):n.push(e.default,r.default),n.push(m.default),n}return rt.default=c,rt}var yt={},gt={},Pn;function Js(){if(Pn)return gt;Pn=1,Object.defineProperty(gt,"__esModule",{value:!0});const e=W(),r={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,m){const{gen:s,data:p,$data:d,schema:h,schemaCode:b,it:_}=i,{opts:S,errSchemaPath:$,schemaEnv:g,self:v}=_;if(!S.validateFormats)return;d?w():c();function w(){const u=s.scopeValue("formats",{ref:v.formats,code:S.code.formats}),n=s.const("fDef",(0,e._)`${u}[${b}]`),a=s.let("fType"),y=s.let("format");s.if((0,e._)`typeof ${n} == "object" && !(${n} instanceof RegExp)`,()=>s.assign(a,(0,e._)`${n}.type || "string"`).assign(y,(0,e._)`${n}.validate`),()=>s.assign(a,(0,e._)`"string"`).assign(y,n)),i.fail$data((0,e.or)(o(),f()));function o(){return S.strictSchema===!1?e.nil:(0,e._)`${b} && !${y}`}function f(){const P=g.$async?(0,e._)`(${n}.async ? await ${y}(${p}) : ${y}(${p}))`:(0,e._)`${y}(${p})`,O=(0,e._)`(typeof ${y} == "function" ? ${P} : ${y}.test(${p}))`;return(0,e._)`${y} && ${y} !== true && ${a} === ${m} && !${O}`}}function c(){const u=v.formats[h];if(!u){o();return}if(u===!0)return;const[n,a,y]=f(u);n===m&&i.pass(P());function o(){if(S.strictSchema===!1){v.logger.warn(O());return}throw new Error(O());function O(){return`unknown format "${h}" ignored in schema at path "${$}"`}}function f(O){const D=O instanceof RegExp?(0,e.regexpCode)(O):S.code.formats?(0,e._)`${S.code.formats}${(0,e.getProperty)(h)}`:void 0,z=s.scopeValue("formats",{key:h,ref:O,code:D});return typeof O=="object"&&!(O instanceof RegExp)?[O.type||"string",O.validate,(0,e._)`${z}.validate`]:["string",O,z]}function P(){if(typeof u=="object"&&!(u instanceof RegExp)&&u.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 gt.default=r,gt}var kn;function Gs(){if(kn)return yt;kn=1,Object.defineProperty(yt,"__esModule",{value:!0});const t=[Js().default];return yt.default=t,yt}var Se={},Sn;function Ws(){return Sn||(Sn=1,Object.defineProperty(Se,"__esModule",{value:!0}),Se.contentVocabulary=Se.metadataVocabulary=void 0,Se.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],Se.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]),Se}var En;function Bs(){if(En)return Fe;En=1,Object.defineProperty(Fe,"__esModule",{value:!0});const e=vs(),t=Os(),r=Hs(),i=Gs(),m=Ws(),s=[e.default,t.default,(0,r.default)(),i.default,m.metadataVocabulary,m.contentVocabulary];return Fe.default=s,Fe}var vt={},Ce={},jn;function Ys(){if(jn)return Ce;jn=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 Rn;function Zs(){if(Rn)return vt;Rn=1,Object.defineProperty(vt,"__esModule",{value:!0});const e=W(),t=Ys(),r=lr(),i=Bt(),m=Z(),p={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:d,tagName:h}})=>d===t.DiscrError.Tag?`tag "${h}" must be string`:`value of tag "${h}" must be in oneOf`,params:({params:{discrError:d,tag:h,tagName:b}})=>(0,e._)`{error: ${d}, tag: ${b}, tagValue: ${h}}`},code(d){const{gen:h,data:b,schema:_,parentSchema:S,it:$}=d,{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=h.let("valid",!1),c=h.const("tag",(0,e._)`${b}${(0,e.getProperty)(v)}`);h.if((0,e._)`typeof ${c} == "string"`,()=>u(),()=>d.error(!1,{discrError:t.DiscrError.Tag,tag:c,tagName:v})),d.ok(w);function u(){const y=a();h.if(!1);for(const o in y)h.elseIf((0,e._)`${c} === ${o}`),h.assign(w,n(y[o]));h.else(),d.error(!1,{discrError:t.DiscrError.Mapping,tag:c,tagName:v}),h.endIf()}function n(y){const o=h.name("valid"),f=d.subschema({keyword:"oneOf",schemaProp:y},o);return d.mergeEvaluated(f,e.Name),o}function a(){var y;const o={},f=O(S);let P=!0;for(let C=0;C<g.length;C++){let V=g[C];if(V?.$ref&&!(0,m.schemaHasRulesButRef)(V,$.self.RULES)){const L=V.$ref;if(V=r.resolveRef.call($.self,$.schemaEnv.root,$.baseId,L),V instanceof r.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||O(V)),D(F,C)}if(!P)throw new Error(`discriminator: "${v}" must be required`);return o;function O({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 vt.default=p,vt}const Qs="http://json-schema.org/draft-07/schema#",Xs="http://json-schema.org/draft-07/schema#",xs="Core schema meta-schema",ei={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:[]}},ti=["object","boolean"],ri={$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:"#"}},ni={$schema:Qs,$id:Xs,title:xs,definitions:ei,type:ti,properties:ri,default:!0};var Nn;function Un(){return Nn||(Nn=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 r=hs(),i=Bs(),m=Zs(),s=ni,p=["/properties"],d="http://json-schema.org/draft-07/schema";class h extends r.default{_addVocabularies(){super._addVocabularies(),i.default.forEach(v=>this.addVocabulary(v)),this.opts.discriminator&&this.addKeyword(m.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const v=this.opts.$data?this.$dataMetaSchema(s,p):s;this.addMetaSchema(v,d,!1),this.refs["http://json-schema.org/schema"]=d}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(d)?d:void 0)}}t.Ajv=h,e.exports=t=h,e.exports.Ajv=h,Object.defineProperty(t,"__esModule",{value:!0}),t.default=h;var b=Wt();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return b.KeywordCxt}});var _=W();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=dr();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return S.default}});var $=Bt();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return $.default}})})(De,De.exports)),De.exports}var si=Un();const Kn=Tn(si);var _t={exports:{}},cr={},On;function ii(){return On||(On=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(h(!0),b),"date-time":t($(!0),g),"iso-time":t(h(),_),"iso-date-time":t($(),v),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:u,"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:O},double:{type:"number",validate:O},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 r(C){return C%4===0&&(C%100!==0||C%400===0)}const i=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,m=[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&&r(F)?29:m[L])}function p(C,V){if(C&&V)return C>V?1:C<V?-1:0}const d=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function h(C){return function(F){const L=d.exec(F);if(!L)return!1;const X=+L[1],ie=+L[2],oe=+L[3],ee=L[4],pe=L[5]==="-"?-1:1,M=+(L[6]||0),j=+(L[7]||0);if(M>23||j>59||C&&!ee)return!1;if(X<=23&&ie<=59&&oe<60)return!0;const T=ie-j*pe,N=X-M*pe-(T<0?1:0);return(N===23||N===-1)&&(T===59||T===-1)&&oe<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=d.exec(C),L=d.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 S=/t|\s/i;function $(C){const V=h(C);return function(L){const X=L.split(S);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(S),[X,ie]=V.split(S),oe=p(F,X);if(oe!==void 0)return oe||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 u(C){return w.test(C)&&c.test(C)}const n=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function a(C){return n.lastIndex=0,n.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 O(){return!0}const D=/[^\\]\\Z/;function z(C){if(D.test(C))return!1;try{return new RegExp(C),!0}catch{return!1}}})(cr)),cr}var ur={},In;function oi(){return In||(In=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const t=Un(),r=W(),i=r.operators,m={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:d,schemaCode:h})=>(0,r.str)`should be ${m[d].okStr} ${h}`,params:({keyword:d,schemaCode:h})=>(0,r._)`{comparison: ${m[d].okStr}, limit: ${h}}`};e.formatLimitDefinition={keyword:Object.keys(m),type:"string",schemaType:"string",$data:!0,error:s,code(d){const{gen:h,data:b,schemaCode:_,keyword:S,it:$}=d,{opts:g,self:v}=$;if(!g.validateFormats)return;const w=new t.KeywordCxt($,v.RULES.all.format.definition,"format");w.$data?c():u();function c(){const a=h.scopeValue("formats",{ref:v.formats,code:g.code.formats}),y=h.const("fmt",(0,r._)`${a}[${w.schemaCode}]`);d.fail$data((0,r.or)((0,r._)`typeof ${y} != "object"`,(0,r._)`${y} instanceof RegExp`,(0,r._)`typeof ${y}.compare != "function"`,n(y)))}function u(){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(`"${S}": format "${a}" does not define "compare" function`);const o=h.scopeValue("formats",{key:a,ref:y,code:g.code.formats?(0,r._)`${g.code.formats}${(0,r.getProperty)(a)}`:void 0});d.fail$data(n(o))}function n(a){return(0,r._)`${a}.compare(${b}, ${_}) ${m[S].fail} 0`}},dependencies:["format"]};const p=d=>(d.addKeyword(e.formatLimitDefinition),d);e.default=p})(ur)),ur}var Cn;function ai(){return Cn||(Cn=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=ii(),i=oi(),m=W(),s=new m.Name("fullFormats"),p=new m.Name("fastFormats"),d=(b,_={keywords:!0})=>{if(Array.isArray(_))return h(b,_,r.fullFormats,s),b;const[S,$]=_.mode==="fast"?[r.fastFormats,p]:[r.fullFormats,s],g=_.formats||r.formatNames;return h(b,g,S,$),_.keywords&&(0,i.default)(b),b};d.get=(b,_="full")=>{const $=(_==="fast"?r.fastFormats:r.fullFormats)[b];if(!$)throw new Error(`Unknown format "${b}"`);return $};function h(b,_,S,$){var g,v;(g=(v=b.opts.code).formats)!==null&&g!==void 0||(v.formats=(0,m._)`require("ajv-formats/dist/formats").${$}`);for(const w of _)b.addFormat(w,S[w])}e.exports=t=d,Object.defineProperty(t,"__esModule",{value:!0}),t.default=d})(_t,_t.exports)),_t.exports}var ci=ai();const Hn=Tn(ci),ui="http://json-schema.org/draft-07/schema#",di="#/definitions/CICConfig",li=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={$schema:ui,$ref:di,definitions:li},qe=e=>typeof e=="number"&&isFinite(e)&&e>0,pr=()=>{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 r=Array.from(t,i=>i.toString(16).padStart(2,"0"));return`${r[0]}${r[1]}${r[2]}${r[3]}-${r[4]}${r[5]}-${r[6]}${r[7]}-${r[8]}${r[9]}-${r[10]}${r[11]}${r[12]}${r[13]}${r[14]}${r[15]}`}return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const r=Math.random()*16|0;return(t==="x"?r:r&3|8).toString(16)})},J=e=>Array.isArray(e)?e.map(t=>{const r=t.instancePath||"",i=t.keyword,m=t.params||{};let s=t.message||"";if(i==="required"&&m.missingProperty&&(s=`缺少必填字段:${m.missingProperty}`),i==="type"&&t.schema&&(s=`类型必须为:${t.schema}`),i==="enum"){const p=Array.isArray(m.allowedValues)?m.allowedValues:void 0;s=p?`取值必须为枚举之一:${p.join(", ")}`:"取值必须为枚举之一"}if(i==="const"){const p=m.allowedValue;s=p!==void 0?`取值必须为:${JSON.stringify(p)}`:"必须等于常量"}return i==="additionalProperties"&&m.additionalProperty&&(s=`不允许额外字段:${m.additionalProperty}`),{path:r,message:s,keyword:i,params:m}}):[],ye=(e,t)=>{if(!t||typeof t!="object")return e;const r=e||{};for(const i of Object.keys(t))(!(i in r)||r[i]===void 0)&&(r[i]=t[i]);return r};let $t=null;const fi=()=>($t||($t=new Kn({allErrors:!0,strict:!1}),Hn($t)),$t),qn=new Map,pi=JSON.stringify(Te),mi={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"]},hi=(e,t)=>e.compile({$ref:t,definitions:Te.definitions,properties:Te.properties}),te=e=>{const t=fi(),r=`type:${e}::${pi}`,i=qn.get(r);if(i)return i;const m=mi[e]||[`#/definitions/${e}`,`#/$defs/${e}`];for(const s of m)try{const p=hi(t,s);return qn.set(r,p),p}catch{}throw new Error(`VALIDATOR_REF_NOT_FOUND:${e}`)},Pt=te("DataSourceItem"),kt=te("DataSourceRest"),St=te("DataSourceWebSocket"),Et=te("DataSourceStatic"),jt=te("DataSourceFunction"),yi=(e,t)=>{const r={...e};if(t?.generateId&&!r.id&&(r.id=pr()),!r.type)throw new Error("type is required");return r.type==="rest"?(t?.strict||("pollInterval"in r&&qe(r.pollInterval)&&(r.pollInterval=Math.round(r.pollInterval)),"timeout"in r&&qe(r.timeout)&&(r.timeout=Math.round(r.timeout))),ye(r,t?.defaults)):r.type==="websocket"?(r.heartbeat&&typeof r.heartbeat=="object"&&(t?.strict||"interval"in r.heartbeat&&qe(r.heartbeat.interval)&&(r.heartbeat.interval=Math.round(r.heartbeat.interval))),t?.strict||"pollInterval"in r&&qe(r.pollInterval)&&(r.pollInterval=Math.round(r.pollInterval)),ye(r,t?.defaults)):r.type==="static"?ye(r,t?.defaults):r.type==="function"&&(t?.strict||"timeout"in r&&qe(r.timeout)&&(r.timeout=Math.round(r.timeout)),ye(r,t?.defaults)),r},gi=e=>{const t=e;if(t&&typeof t=="object"&&typeof t.type=="string"){if(t.type==="rest")return kt(e)?{ok:!0}:{ok:!1,errors:J(kt.errors||[])};if(t.type==="websocket")return St(e)?{ok:!0}:{ok:!1,errors:J(St.errors||[])};if(t.type==="static")return Et(e)?{ok:!0}:{ok:!1,errors:J(Et.errors||[])};if(t.type==="function")return jt(e)?{ok:!0}:{ok:!1,errors:J(jt.errors||[])}}return Pt(e)?{ok:!0}:{ok:!1,errors:J(Pt.errors||[])}},Jn=(e,t)=>{const r=yi(e,t);if(r&&typeof r=="object"&&typeof r.type=="string"){if(r.type==="rest")return kt(r)?{ok:!0,value:r}:{ok:!1,errors:J(kt.errors||[])};if(r.type==="websocket")return St(r)?{ok:!0,value:r}:{ok:!1,errors:J(St.errors||[])};if(r.type==="static")return Et(r)?{ok:!0,value:r}:{ok:!1,errors:J(Et.errors||[])};if(r.type==="function")return jt(r)?{ok:!0,value:r}:{ok:!1,errors:J(jt.errors||[])}}return Pt(r)?{ok:!0,value:r}:{ok:!1,errors:J(Pt.errors||[])}},vi=(e,t)=>{const r=Jn(e,t);if(!r.ok)throw new Error(JSON.stringify(r.errors));return r.value},Rt=te("ComponentInstance"),Nt=te("ViewComponentInstance"),Ot=te("ContainerComponentInstance"),It=te("LogicComponentInstanceRef"),_i=(e,t)=>{const r={...e};return t?.generateId&&!r.id&&(r.id=pr()),t?.strict||(r.role==="view"?delete r.children:r.role==="container"?delete r.component:r.role==="logic"&&delete r.children),ye(r,t?.defaults),r},$i=e=>{const t=e;if(t&&typeof t=="object"&&typeof t.role=="string"){if(t.role==="view")return Nt(e)?{ok:!0}:{ok:!1,errors:J(Nt.errors||[])};if(t.role==="container")return Ot(e)?{ok:!0}:{ok:!1,errors:J(Ot.errors||[])};if(t.role==="logic")return It(e)?{ok:!0}:{ok:!1,errors:J(It.errors||[])}}return Rt(e)?{ok:!0}:{ok:!1,errors:J(Rt.errors||[])}},Gn=(e,t)=>{const r=_i(e,t);if(r&&typeof r=="object"&&typeof r.role=="string"){if(r.role==="view")return Nt(r)?{ok:!0,value:r}:{ok:!1,errors:J(Nt.errors||[])};if(r.role==="container")return Ot(r)?{ok:!0,value:r}:{ok:!1,errors:J(Ot.errors||[])};if(r.role==="logic")return It(r)?{ok:!0,value:r}:{ok:!1,errors:J(It.errors||[])}}return Rt(r)?{ok:!0,value:r}:{ok:!1,errors:J(Rt.errors||[])}},bi=(e,t)=>{const r=Gn(e,t);if(!r.ok)throw new Error(JSON.stringify(r.errors));return r.value},Ct=te("CICPage"),wi=(e,t)=>{const r={...e};return t?.generateId&&!r.id&&(r.id=pr()),ye(r,t?.defaults),r},Pi=e=>Ct(e)?{ok:!0}:{ok:!1,errors:J(Ct.errors||[])},Wn=(e,t)=>{const r=wi(e,t);return Ct(r)?{ok:!0,value:r}:{ok:!1,errors:J(Ct.errors||[])}},ki=(e,t)=>{const r=Wn(e,t);if(!r.ok)throw new Error(JSON.stringify(r.errors));return r.value},qt=te("Meta"),Tt=te("Layout"),Si=e=>qt(e)?{ok:!0}:{ok:!1,errors:J(qt.errors||[])},Ei=e=>Tt(e)?{ok:!0}:{ok:!1,errors:J(Tt.errors||[])},Bn=(e,t)=>{const r=ye(e,t?.defaults);return qt(r)?{ok:!0,value:r}:{ok:!1,errors:J(qt.errors||[])}},Yn=(e,t)=>{const r=ye(e,t?.defaults);return Tt(r)?{ok:!0,value:r}:{ok:!1,errors:J(Tt.errors||[])}},ji=(e,t)=>{const r=Bn(e,t);if(!r.ok)throw new Error(JSON.stringify(r.errors));return r.value},Ri=(e,t)=>{const r=Yn(e,t);if(!r.ok)throw new Error(JSON.stringify(r.errors));return r.value},Dt=te("Variables"),Ni=e=>Dt(e)?{ok:!0}:{ok:!1,errors:J(Dt.errors||[])},Zn=(e,t)=>{const r=ye(e,t?.defaults);return Dt(r)?{ok:!0,value:r}:{ok:!1,errors:J(Dt.errors||[])}},Oi=(e,t)=>{const r=Zn(e,t);if(!r.ok)throw new Error(JSON.stringify(r.errors));return r.value},Mt=te("Dependency"),At=te("JSDependency"),Vt=te("CSSDependency"),zt=te("FontDependency"),Ft=te("ImageDependency"),Lt=te("JSONDependency"),Ut=te("WasmDependency"),Kt=te("OtherDependency"),Ii=e=>{const t=e;if(t&&typeof t=="object"&&typeof t.type=="string")switch(t.type){case"js":return At(e)?{ok:!0}:{ok:!1,errors:J(At.errors||[])};case"css":return Vt(e)?{ok:!0}:{ok:!1,errors:J(Vt.errors||[])};case"font":return zt(e)?{ok:!0}:{ok:!1,errors:J(zt.errors||[])};case"image":return Ft(e)?{ok:!0}:{ok:!1,errors:J(Ft.errors||[])};case"json":return Lt(e)?{ok:!0}:{ok:!1,errors:J(Lt.errors||[])};case"wasm":return Ut(e)?{ok:!0}:{ok:!1,errors:J(Ut.errors||[])};case"other":return Kt(e)?{ok:!0}:{ok:!1,errors:J(Kt.errors||[])}}return Mt(e)?{ok:!0}:{ok:!1,errors:J(Mt.errors||[])}},Qn=(e,t)=>{const r=ye(e,t?.defaults);if(r&&typeof r=="object"&&typeof r.type=="string")switch(r.type){case"js":return At(r)?{ok:!0,value:r}:{ok:!1,errors:J(At.errors||[])};case"css":return Vt(r)?{ok:!0,value:r}:{ok:!1,errors:J(Vt.errors||[])};case"font":return zt(r)?{ok:!0,value:r}:{ok:!1,errors:J(zt.errors||[])};case"image":return Ft(r)?{ok:!0,value:r}:{ok:!1,errors:J(Ft.errors||[])};case"json":return Lt(r)?{ok:!0,value:r}:{ok:!1,errors:J(Lt.errors||[])};case"wasm":return Ut(r)?{ok:!0,value:r}:{ok:!1,errors:J(Ut.errors||[])};case"other":return Kt(r)?{ok:!0,value:r}:{ok:!1,errors:J(Kt.errors||[])}}return Mt(r)?{ok:!0,value:r}:{ok:!1,errors:J(Mt.errors||[])}},Ci=(e,t)=>{const r=Qn(e,t);if(!r.ok)throw new Error(JSON.stringify(r.errors));return r.value},Ht=te("RegistryComponents"),qi=e=>Ht(e)?{ok:!0}:{ok:!1,errors:J(Ht.errors||[])},Xn=(e,t)=>{const r=ye(e,t?.defaults);return Ht(r)?{ok:!0,value:r}:{ok:!1,errors:J(Ht.errors||[])}},Ti=(e,t)=>{const r=Xn(e,t);if(!r.ok)throw new Error(JSON.stringify(r.errors));return r.value};class de{config;static validator;static validate;static schemaHash;constructor(t){const r=de.validateConfig(t);if(!r.valid)throw new Error(`Invalid CIC Configuration: ${r.error}`);this.config=t}getConfig(){return this.config}findComponent(t){let r;return this.walkComponents(i=>i.id===t?(r=i,!1):!0),r}findPageByComponent(t){let r;return this.walkComponents((i,m)=>i.id===t?(r=m,!1):!0),r}getVariable(t,r){const i=this.config.variables;if(i){if(t.componentId&&i.component&&i.component[t.componentId]){const m=i.component[t.componentId][r];if(m)return m.value??m.default}if(t.pageId&&i.page&&i.page[t.pageId]){const m=i.page[t.pageId][r];if(m)return m.value??m.default}if(i.global&&i.global[r]){const m=i.global[r];return m.value??m.default}}}getVariableByRef(t){const r=t.match(/^(global|page|component)(?::([^\.]+))?\.(.+)$/);if(!r)return;const[,i,m,s]=r;if(i==="global")return this.getVariable({},s);if(i==="page")return this.getVariable({pageId:m},s);if(i==="component")return this.getVariable({componentId:m},s)}walkComponents(t){if(this.config.pages)for(const r of this.config.pages){const i=[];for(const s of r.components||[])i.push({node:s});let m=!1;for(;i.length>0&&!m;){const{node:s,parent:p}=i.pop();if(t(s,r,p)===!1){m=!0;break}if(s.children&&s.children.length>0)for(let h=s.children.length-1;h>=0;h--)i.push({node:s.children[h],parent:s})}if(m)break}}static validateConfig(t){if(!t)return{valid:!1,error:"Config is null or undefined"};const r=JSON.stringify(Te);return(!de.validator||de.schemaHash!==r)&&(de.validator=new Kn({allErrors:!0,strict:!1}),Hn(de.validator),de.validator.addFormat("color-hex",/^#[0-9a-fA-F]{6}$/),de.validate=de.validator.compile(Te),de.schemaHash=r),de.validate(t)?{valid:!0}:{valid:!1,error:de.validate.errors.map(s=>`${s.instancePath} ${s.message}`).join("; ")}}static getValueByPath(t,r,i){if(t==null||!r)return i;const m=[];r.replace(/\[(\d+)\]/g,".$1").split(".").forEach(p=>{p.trim()&&m.push(p.trim())});let s=t;for(const p of m){if(s==null)return i;s=s[p]}return s===void 0?i:s}static traverseTree(t,r,i){const m=Array.isArray(t)?t:[t];for(const s of m)r(s,i)!==!1&&s.children&&s.children.length>0&&de.traverseTree(s.children,r,s)}static createDataSource=Jn;static validateDataSource=gi;static normalizeDataSource=vi;static createComponent=Gn;static validateComponent=$i;static normalizeComponent=bi;static createPage=Wn;static validatePage=Pi;static normalizePage=ki;static createMeta=Bn;static createLayout=Yn;static validateMeta=Si;static validateLayout=Ei;static normalizeMeta=ji;static normalizeLayout=Ri;static createVariables=Zn;static validateVariables=Ni;static normalizeVariables=Oi;static createDependency=Qn;static validateDependency=Ii;static normalizeDependency=Ci;static createRegistryComponent=Xn;static validateRegistryComponent=qi;static normalizeRegistryComponent=Ti}exports.CICSDK=de;
8
+ deps: ${g}}`};const d={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(m){const[b,g]=s(m);h(m,b),a(m,g)}};function s({schema:m}){const b={},g={};for(const S in m){if(S==="__proto__")continue;const v=Array.isArray(m[S])?b:g;v[S]=m[S]}return[b,g]}function h(m,b=m.schema){const{gen:g,data:S,it:v}=m;if(Object.keys(b).length===0)return;const _=g.let("missing");for(const $ in b){const w=b[$];if(w.length===0)continue;const u=(0,o.propertyInData)(g,S,$,v.opts.ownProperties);m.setParams({property:$,depsCount:w.length,deps:w.join(", ")}),v.allErrors?g.if(u,()=>{for(const l of w)(0,o.checkReportMissingProp)(m,l)}):(g.if((0,t._)`${u} && (${(0,o.checkMissingProp)(m,w,_)})`),(0,o.reportMissingProp)(m,_),g.else())}}e.validatePropertyDeps=h;function a(m,b=m.schema){const{gen:g,data:S,keyword:v,it:_}=m,$=g.name("valid");for(const w in b)(0,r.alwaysValidSchema)(_,b[w])||(g.if((0,o.propertyInData)(g,S,w,_.opts.ownProperties),()=>{const u=m.subschema({keyword:v,schemaProp:w},$);m.mergeValidEvaluated(u,$)},()=>g.var($,!0)),m.ok($))}e.validateSchemaDeps=a,e.default=d})(ar)),ar}var ot={},fn;function Ds(){if(fn)return ot;fn=1,Object.defineProperty(ot,"__esModule",{value:!0});const e=W(),t=Z(),o={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:d})=>(0,e._)`{propertyName: ${d.propertyName}}`},code(d){const{gen:s,schema:h,data:a,it:m}=d;if((0,t.alwaysValidSchema)(m,h))return;const b=s.name("valid");s.forIn("key",a,g=>{d.setParams({propertyName:g}),d.subschema({keyword:"propertyNames",data:g,dataTypes:["string"],propertyName:g,compositeRule:!0},b),s.if((0,e.not)(b),()=>{d.error(!0),m.allErrors||s.break()})}),d.ok(b)}};return ot.default=o,ot}var at={},pn;function Ln(){if(pn)return at;pn=1,Object.defineProperty(at,"__esModule",{value:!0});const e=ge(),t=W(),r=we(),o=Z(),s={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:h})=>(0,t._)`{additionalProperty: ${h.additionalProperty}}`},code(h){const{gen:a,schema:m,parentSchema:b,data:g,errsCount:S,it:v}=h;if(!S)throw new Error("ajv implementation error");const{allErrors:_,opts:$}=v;if(v.props=!0,$.removeAdditional!=="all"&&(0,o.alwaysValidSchema)(v,m))return;const w=(0,e.allSchemaProperties)(b.properties),u=(0,e.allSchemaProperties)(b.patternProperties);l(),h.ok((0,t._)`${S} === ${r.default.errors}`);function l(){a.forIn("key",g,p=>{!w.length&&!u.length?y(p):a.if(n(p),()=>y(p))})}function n(p){let P;if(w.length>8){const O=(0,o.schemaRefOrVal)(v,b.properties,"properties");P=(0,e.isOwnProperty)(a,O,p)}else w.length?P=(0,t.or)(...w.map(O=>(0,t._)`${p} === ${O}`)):P=t.nil;return u.length&&(P=(0,t.or)(P,...u.map(O=>(0,t._)`${(0,e.usePattern)(h,O)}.test(${p})`))),(0,t.not)(P)}function c(p){a.code((0,t._)`delete ${g}[${p}]`)}function y(p){if($.removeAdditional==="all"||$.removeAdditional&&m===!1){c(p);return}if(m===!1){h.setParams({additionalProperty:p}),h.error(),_||a.break();return}if(typeof m=="object"&&!(0,o.alwaysValidSchema)(v,m)){const P=a.name("valid");$.removeAdditional==="failing"?(i(p,P,!1),a.if((0,t.not)(P),()=>{h.reset(),c(p)})):(i(p,P),_||a.if((0,t.not)(P),()=>a.break()))}}function i(p,P,O){const D={keyword:"additionalProperties",dataProp:p,dataPropType:o.Type.Str};O===!1&&Object.assign(D,{compositeRule:!0,createErrors:!1,allErrors:!1}),h.subschema(D,P)}}};return at.default=s,at}var ct={},mn;function Ms(){if(mn)return ct;mn=1,Object.defineProperty(ct,"__esModule",{value:!0});const e=Wt(),t=ge(),r=Z(),o=Ln(),d={keyword:"properties",type:"object",schemaType:"object",code(s){const{gen:h,schema:a,parentSchema:m,data:b,it:g}=s;g.opts.removeAdditional==="all"&&m.additionalProperties===void 0&&o.default.code(new e.KeywordCxt(g,o.default,"additionalProperties"));const S=(0,t.allSchemaProperties)(a);for(const u of S)g.definedProperties.add(u);g.opts.unevaluated&&S.length&&g.props!==!0&&(g.props=r.mergeEvaluated.props(h,(0,r.toHash)(S),g.props));const v=S.filter(u=>!(0,r.alwaysValidSchema)(g,a[u]));if(v.length===0)return;const _=h.name("valid");for(const u of v)$(u)?w(u):(h.if((0,t.propertyInData)(h,b,u,g.opts.ownProperties)),w(u),g.allErrors||h.else().var(_,!0),h.endIf()),s.it.definedProperties.add(u),s.ok(_);function $(u){return g.opts.useDefaults&&!g.compositeRule&&a[u].default!==void 0}function w(u){s.subschema({keyword:"properties",schemaProp:u,dataProp:u},_)}}};return ct.default=d,ct}var ut={},hn;function As(){if(hn)return ut;hn=1,Object.defineProperty(ut,"__esModule",{value:!0});const e=ge(),t=W(),r=Z(),o=Z(),d={keyword:"patternProperties",type:"object",schemaType:"object",code(s){const{gen:h,schema:a,data:m,parentSchema:b,it:g}=s,{opts:S}=g,v=(0,e.allSchemaProperties)(a),_=v.filter(y=>(0,r.alwaysValidSchema)(g,a[y]));if(v.length===0||_.length===v.length&&(!g.opts.unevaluated||g.props===!0))return;const $=S.strictSchema&&!S.allowMatchingProperties&&b.properties,w=h.name("valid");g.props!==!0&&!(g.props instanceof t.Name)&&(g.props=(0,o.evaluatedPropsToName)(h,g.props));const{props:u}=g;l();function l(){for(const y of v)$&&n(y),g.allErrors?c(y):(h.var(w,!0),c(y),h.if(w))}function n(y){for(const i in $)new RegExp(y).test(i)&&(0,r.checkStrictMode)(g,`property ${i} matches pattern ${y} (use allowMatchingProperties)`)}function c(y){h.forIn("key",m,i=>{h.if((0,t._)`${(0,e.usePattern)(s,y)}.test(${i})`,()=>{const p=_.includes(y);p||s.subschema({keyword:"patternProperties",schemaProp:y,dataProp:i,dataPropType:o.Type.Str},w),g.opts.unevaluated&&u!==!0?h.assign((0,t._)`${u}[${i}]`,!0):!p&&!g.allErrors&&h.if((0,t.not)(w),()=>h.break())})})}}};return ut.default=d,ut}var dt={},yn;function Vs(){if(yn)return dt;yn=1,Object.defineProperty(dt,"__esModule",{value:!0});const e=Z(),t={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(r){const{gen:o,schema:d,it:s}=r;if((0,e.alwaysValidSchema)(s,d)){r.fail();return}const h=o.name("valid");r.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},h),r.failResult(h,()=>r.reset(),()=>r.error())},error:{message:"must NOT be valid"}};return dt.default=t,dt}var lt={},gn;function zs(){if(gn)return lt;gn=1,Object.defineProperty(lt,"__esModule",{value:!0});const t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:ge().validateUnion,error:{message:"must match a schema in anyOf"}};return lt.default=t,lt}var ft={},vn;function Fs(){if(vn)return ft;vn=1,Object.defineProperty(ft,"__esModule",{value:!0});const e=W(),t=Z(),o={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:d})=>(0,e._)`{passingSchemas: ${d.passing}}`},code(d){const{gen:s,schema:h,parentSchema:a,it:m}=d;if(!Array.isArray(h))throw new Error("ajv implementation error");if(m.opts.discriminator&&a.discriminator)return;const b=h,g=s.let("valid",!1),S=s.let("passing",null),v=s.name("_valid");d.setParams({passing:S}),s.block(_),d.result(g,()=>d.reset(),()=>d.error(!0));function _(){b.forEach(($,w)=>{let u;(0,t.alwaysValidSchema)(m,$)?s.var(v,!0):u=d.subschema({keyword:"oneOf",schemaProp:w,compositeRule:!0},v),w>0&&s.if((0,e._)`${v} && ${g}`).assign(g,!1).assign(S,(0,e._)`[${S}, ${w}]`).else(),s.if(v,()=>{s.assign(g,!0),s.assign(S,w),u&&d.mergeEvaluated(u,e.Name)})})}}};return ft.default=o,ft}var pt={},_n;function Ls(){if(_n)return pt;_n=1,Object.defineProperty(pt,"__esModule",{value:!0});const e=Z(),t={keyword:"allOf",schemaType:"array",code(r){const{gen:o,schema:d,it:s}=r;if(!Array.isArray(d))throw new Error("ajv implementation error");const h=o.name("valid");d.forEach((a,m)=>{if((0,e.alwaysValidSchema)(s,a))return;const b=r.subschema({keyword:"allOf",schemaProp:m},h);r.ok(h),r.mergeEvaluated(b)})}};return pt.default=t,pt}var mt={},$n;function Us(){if($n)return mt;$n=1,Object.defineProperty(mt,"__esModule",{value:!0});const e=W(),t=Z(),o={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:h,parentSchema:a,it:m}=s;a.then===void 0&&a.else===void 0&&(0,t.checkStrictMode)(m,'"if" without "then" and "else" is ignored');const b=d(m,"then"),g=d(m,"else");if(!b&&!g)return;const S=h.let("valid",!0),v=h.name("_valid");if(_(),s.reset(),b&&g){const w=h.let("ifClause");s.setParams({ifClause:w}),h.if(v,$("then",w),$("else",w))}else b?h.if(v,$("then")):h.if((0,e.not)(v),$("else"));s.pass(S,()=>s.error(!0));function _(){const w=s.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},v);s.mergeEvaluated(w)}function $(w,u){return()=>{const l=s.subschema({keyword:w},v);h.assign(S,v),s.mergeValidEvaluated(l,S),u?h.assign(u,(0,e._)`${w}`):s.setParams({ifClause:w})}}}};function d(s,h){const a=s.schema[h];return a!==void 0&&!(0,t.alwaysValidSchema)(s,a)}return mt.default=o,mt}var ht={},bn;function Ks(){if(bn)return ht;bn=1,Object.defineProperty(ht,"__esModule",{value:!0});const e=Z(),t={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:r,parentSchema:o,it:d}){o.if===void 0&&(0,e.checkStrictMode)(d,`"${r}" without "if" is ignored`)}};return ht.default=t,ht}var wn;function Hs(){if(wn)return rt;wn=1,Object.defineProperty(rt,"__esModule",{value:!0});const e=zn(),t=Is(),r=Fn(),o=qs(),d=Cs(),s=Ts(),h=Ds(),a=Ln(),m=Ms(),b=As(),g=Vs(),S=zs(),v=Fs(),_=Ls(),$=Us(),w=Ks();function u(l=!1){const n=[g.default,S.default,v.default,_.default,$.default,w.default,h.default,a.default,s.default,m.default,b.default];return l?n.push(t.default,o.default):n.push(e.default,r.default),n.push(d.default),n}return rt.default=u,rt}var yt={},gt={},Pn;function Js(){if(Pn)return gt;Pn=1,Object.defineProperty(gt,"__esModule",{value:!0});const e=W(),r={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:o})=>(0,e.str)`must match format "${o}"`,params:({schemaCode:o})=>(0,e._)`{format: ${o}}`},code(o,d){const{gen:s,data:h,$data:a,schema:m,schemaCode:b,it:g}=o,{opts:S,errSchemaPath:v,schemaEnv:_,self:$}=g;if(!S.validateFormats)return;a?w():u();function w(){const l=s.scopeValue("formats",{ref:$.formats,code:S.code.formats}),n=s.const("fDef",(0,e._)`${l}[${b}]`),c=s.let("fType"),y=s.let("format");s.if((0,e._)`typeof ${n} == "object" && !(${n} instanceof RegExp)`,()=>s.assign(c,(0,e._)`${n}.type || "string"`).assign(y,(0,e._)`${n}.validate`),()=>s.assign(c,(0,e._)`"string"`).assign(y,n)),o.fail$data((0,e.or)(i(),p()));function i(){return S.strictSchema===!1?e.nil:(0,e._)`${b} && !${y}`}function p(){const P=_.$async?(0,e._)`(${n}.async ? await ${y}(${h}) : ${y}(${h}))`:(0,e._)`${y}(${h})`,O=(0,e._)`(typeof ${y} == "function" ? ${P} : ${y}.test(${h}))`;return(0,e._)`${y} && ${y} !== true && ${c} === ${d} && !${O}`}}function u(){const l=$.formats[m];if(!l){i();return}if(l===!0)return;const[n,c,y]=p(l);n===d&&o.pass(P());function i(){if(S.strictSchema===!1){$.logger.warn(O());return}throw new Error(O());function O(){return`unknown format "${m}" ignored in schema at path "${v}"`}}function p(O){const D=O instanceof RegExp?(0,e.regexpCode)(O):S.code.formats?(0,e._)`${S.code.formats}${(0,e.getProperty)(m)}`:void 0,z=s.scopeValue("formats",{key:m,ref:O,code:D});return typeof O=="object"&&!(O instanceof RegExp)?[O.type||"string",O.validate,(0,e._)`${z}.validate`]:["string",O,z]}function P(){if(typeof l=="object"&&!(l instanceof RegExp)&&l.async){if(!_.$async)throw new Error("async format in sync schema");return(0,e._)`await ${y}(${h})`}return typeof c=="function"?(0,e._)`${y}(${h})`:(0,e._)`${y}.test(${h})`}}}};return gt.default=r,gt}var kn;function Gs(){if(kn)return yt;kn=1,Object.defineProperty(yt,"__esModule",{value:!0});const t=[Js().default];return yt.default=t,yt}var Se={},Sn;function Ws(){return Sn||(Sn=1,Object.defineProperty(Se,"__esModule",{value:!0}),Se.contentVocabulary=Se.metadataVocabulary=void 0,Se.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],Se.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]),Se}var En;function Bs(){if(En)return Fe;En=1,Object.defineProperty(Fe,"__esModule",{value:!0});const e=vs(),t=Os(),r=Hs(),o=Gs(),d=Ws(),s=[e.default,t.default,(0,r.default)(),o.default,d.metadataVocabulary,d.contentVocabulary];return Fe.default=s,Fe}var vt={},qe={},jn;function Ys(){if(jn)return qe;jn=1,Object.defineProperty(qe,"__esModule",{value:!0}),qe.DiscrError=void 0;var e;return(function(t){t.Tag="tag",t.Mapping="mapping"})(e||(qe.DiscrError=e={})),qe}var Rn;function Zs(){if(Rn)return vt;Rn=1,Object.defineProperty(vt,"__esModule",{value:!0});const e=W(),t=Ys(),r=lr(),o=Bt(),d=Z(),h={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:a,tagName:m}})=>a===t.DiscrError.Tag?`tag "${m}" must be string`:`value of tag "${m}" must be in oneOf`,params:({params:{discrError:a,tag:m,tagName:b}})=>(0,e._)`{error: ${a}, tag: ${b}, tagValue: ${m}}`},code(a){const{gen:m,data:b,schema:g,parentSchema:S,it:v}=a,{oneOf:_}=S;if(!v.opts.discriminator)throw new Error("discriminator: requires discriminator option");const $=g.propertyName;if(typeof $!="string")throw new Error("discriminator: requires propertyName");if(g.mapping)throw new Error("discriminator: mapping is not supported");if(!_)throw new Error("discriminator: requires oneOf keyword");const w=m.let("valid",!1),u=m.const("tag",(0,e._)`${b}${(0,e.getProperty)($)}`);m.if((0,e._)`typeof ${u} == "string"`,()=>l(),()=>a.error(!1,{discrError:t.DiscrError.Tag,tag:u,tagName:$})),a.ok(w);function l(){const y=c();m.if(!1);for(const i in y)m.elseIf((0,e._)`${u} === ${i}`),m.assign(w,n(y[i]));m.else(),a.error(!1,{discrError:t.DiscrError.Mapping,tag:u,tagName:$}),m.endIf()}function n(y){const i=m.name("valid"),p=a.subschema({keyword:"oneOf",schemaProp:y},i);return a.mergeEvaluated(p,e.Name),i}function c(){var y;const i={},p=O(S);let P=!0;for(let q=0;q<_.length;q++){let V=_[q];if(V?.$ref&&!(0,d.schemaHasRulesButRef)(V,v.self.RULES)){const L=V.$ref;if(V=r.resolveRef.call(v.self,v.schemaEnv.root,v.baseId,L),V instanceof r.SchemaEnv&&(V=V.schema),V===void 0)throw new o.default(v.opts.uriResolver,v.baseId,L)}const F=(y=V?.properties)===null||y===void 0?void 0:y[$];if(typeof F!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${$}"`);P=P&&(p||O(V)),D(F,q)}if(!P)throw new Error(`discriminator: "${$}" must be required`);return i;function O({required:q}){return Array.isArray(q)&&q.includes($)}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/${$}" must have "const" or "enum"`)}function z(q,V){if(typeof q!="string"||q in i)throw new Error(`discriminator: "${$}" values must be unique strings`);i[q]=V}}}};return vt.default=h,vt}const Qs="http://json-schema.org/draft-07/schema#",Xs="http://json-schema.org/draft-07/schema#",xs="Core schema meta-schema",ei={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:[]}},ti=["object","boolean"],ri={$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:"#"}},ni={$schema:Qs,$id:Xs,title:xs,definitions:ei,type:ti,properties:ri,default:!0};var Nn;function Un(){return Nn||(Nn=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 r=hs(),o=Bs(),d=Zs(),s=ni,h=["/properties"],a="http://json-schema.org/draft-07/schema";class m extends r.default{_addVocabularies(){super._addVocabularies(),o.default.forEach($=>this.addVocabulary($)),this.opts.discriminator&&this.addKeyword(d.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const $=this.opts.$data?this.$dataMetaSchema(s,h):s;this.addMetaSchema($,a,!1),this.refs["http://json-schema.org/schema"]=a}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(a)?a:void 0)}}t.Ajv=m,e.exports=t=m,e.exports.Ajv=m,Object.defineProperty(t,"__esModule",{value:!0}),t.default=m;var b=Wt();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return b.KeywordCxt}});var g=W();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return g._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return g.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return g.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return g.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return g.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return g.CodeGen}});var S=dr();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return S.default}});var v=Bt();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return v.default}})})(De,De.exports)),De.exports}var si=Un();const Kn=Tn(si);var _t={exports:{}},cr={},On;function ii(){return On||(On=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(s,h),time:t(m(!0),b),"date-time":t(v(!0),_),"iso-time":t(m(),g),"iso-date-time":t(v(),$),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:l,"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:c,int32:{type:"number",validate:p},int64:{type:"number",validate:P},float:{type:"number",validate:O},double:{type:"number",validate:O},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,h),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,_),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,g),"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,$),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 r(q){return q%4===0&&(q%100!==0||q%400===0)}const o=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,d=[0,31,28,31,30,31,30,31,31,30,31,30,31];function s(q){const V=o.exec(q);if(!V)return!1;const F=+V[1],L=+V[2],X=+V[3];return L>=1&&L<=12&&X>=1&&X<=(L===2&&r(F)?29:d[L])}function h(q,V){if(q&&V)return q>V?1:q<V?-1:0}const a=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function m(q){return function(F){const L=a.exec(F);if(!L)return!1;const X=+L[1],ie=+L[2],oe=+L[3],ee=L[4],pe=L[5]==="-"?-1:1,M=+(L[6]||0),j=+(L[7]||0);if(M>23||j>59||q&&!ee)return!1;if(X<=23&&ie<=59&&oe<60)return!0;const T=ie-j*pe,N=X-M*pe-(T<0?1:0);return(N===23||N===-1)&&(T===59||T===-1)&&oe<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 g(q,V){if(!(q&&V))return;const F=a.exec(q),L=a.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 v(q){const V=m(q);return function(L){const X=L.split(S);return X.length===2&&s(X[0])&&V(X[1])}}function _(q,V){if(!(q&&V))return;const F=new Date(q).valueOf(),L=new Date(V).valueOf();if(F&&L)return F-L}function $(q,V){if(!(q&&V))return;const[F,L]=q.split(S),[X,ie]=V.split(S),oe=h(F,X);if(oe!==void 0)return oe||b(L,ie)}const w=/\/|:/,u=/^(?:[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 l(q){return w.test(q)&&u.test(q)}const n=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function c(q){return n.lastIndex=0,n.test(q)}const y=-2147483648,i=2**31-1;function p(q){return Number.isInteger(q)&&q<=i&&q>=y}function P(q){return Number.isInteger(q)}function O(){return!0}const D=/[^\\]\\Z/;function z(q){if(D.test(q))return!1;try{return new RegExp(q),!0}catch{return!1}}})(cr)),cr}var ur={},In;function oi(){return In||(In=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const t=Un(),r=W(),o=r.operators,d={formatMaximum:{okStr:"<=",ok:o.LTE,fail:o.GT},formatMinimum:{okStr:">=",ok:o.GTE,fail:o.LT},formatExclusiveMaximum:{okStr:"<",ok:o.LT,fail:o.GTE},formatExclusiveMinimum:{okStr:">",ok:o.GT,fail:o.LTE}},s={message:({keyword:a,schemaCode:m})=>(0,r.str)`should be ${d[a].okStr} ${m}`,params:({keyword:a,schemaCode:m})=>(0,r._)`{comparison: ${d[a].okStr}, limit: ${m}}`};e.formatLimitDefinition={keyword:Object.keys(d),type:"string",schemaType:"string",$data:!0,error:s,code(a){const{gen:m,data:b,schemaCode:g,keyword:S,it:v}=a,{opts:_,self:$}=v;if(!_.validateFormats)return;const w=new t.KeywordCxt(v,$.RULES.all.format.definition,"format");w.$data?u():l();function u(){const c=m.scopeValue("formats",{ref:$.formats,code:_.code.formats}),y=m.const("fmt",(0,r._)`${c}[${w.schemaCode}]`);a.fail$data((0,r.or)((0,r._)`typeof ${y} != "object"`,(0,r._)`${y} instanceof RegExp`,(0,r._)`typeof ${y}.compare != "function"`,n(y)))}function l(){const c=w.schema,y=$.formats[c];if(!y||y===!0)return;if(typeof y!="object"||y instanceof RegExp||typeof y.compare!="function")throw new Error(`"${S}": format "${c}" does not define "compare" function`);const i=m.scopeValue("formats",{key:c,ref:y,code:_.code.formats?(0,r._)`${_.code.formats}${(0,r.getProperty)(c)}`:void 0});a.fail$data(n(i))}function n(c){return(0,r._)`${c}.compare(${b}, ${g}) ${d[S].fail} 0`}},dependencies:["format"]};const h=a=>(a.addKeyword(e.formatLimitDefinition),a);e.default=h})(ur)),ur}var qn;function ai(){return qn||(qn=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=ii(),o=oi(),d=W(),s=new d.Name("fullFormats"),h=new d.Name("fastFormats"),a=(b,g={keywords:!0})=>{if(Array.isArray(g))return m(b,g,r.fullFormats,s),b;const[S,v]=g.mode==="fast"?[r.fastFormats,h]:[r.fullFormats,s],_=g.formats||r.formatNames;return m(b,_,S,v),g.keywords&&(0,o.default)(b),b};a.get=(b,g="full")=>{const v=(g==="fast"?r.fastFormats:r.fullFormats)[b];if(!v)throw new Error(`Unknown format "${b}"`);return v};function m(b,g,S,v){var _,$;(_=($=b.opts.code).formats)!==null&&_!==void 0||($.formats=(0,d._)`require("ajv-formats/dist/formats").${v}`);for(const w of g)b.addFormat(w,S[w])}e.exports=t=a,Object.defineProperty(t,"__esModule",{value:!0}),t.default=a})(_t,_t.exports)),_t.exports}var ci=ai();const Hn=Tn(ci),ui="http://json-schema.org/draft-07/schema#",di="#/definitions/CICConfig",li=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={$schema:ui,$ref:di,definitions:li},Ce=e=>typeof e=="number"&&isFinite(e)&&e>0,pr=()=>{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 r=Array.from(t,o=>o.toString(16).padStart(2,"0"));return`${r[0]}${r[1]}${r[2]}${r[3]}-${r[4]}${r[5]}-${r[6]}${r[7]}-${r[8]}${r[9]}-${r[10]}${r[11]}${r[12]}${r[13]}${r[14]}${r[15]}`}return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const r=Math.random()*16|0;return(t==="x"?r:r&3|8).toString(16)})},J=e=>{if(!Array.isArray(e))return[];const t=e.map(a=>{const m=a.instancePath||"",b=a.keyword,g=a.params||{};let S=a.message||"";if(b==="required"&&g.missingProperty&&(S=`缺少必填字段:${g.missingProperty}`),b==="type"&&a.schema&&(S=`类型必须为:${a.schema}`),b==="enum"){const v=Array.isArray(g.allowedValues)?g.allowedValues:void 0;S=v?`取值必须为枚举之一:${v.join(", ")}`:"取值必须为枚举之一"}if(b==="const"){const v=g.allowedValue;S=v!==void 0?`取值必须为:${JSON.stringify(v)}`:"必须等于常量"}return b==="additionalProperties"&&g.additionalProperty&&(S=`不允许额外字段:${g.additionalProperty}`),{path:m,message:S,keyword:b,params:g}}),r={},o=[];for(const a of t){const m=a.keyword==="required"?`${a.keyword}|${a.path}|${a.params?.missingProperty}`:`${a.keyword}|${a.path}|${JSON.stringify(a.params||{})}`;r[m]||(r[m]=!0,o.push(a))}const s=o.some(a=>a.keyword!=="anyOf")?o.filter(a=>a.keyword!=="anyOf"):o,h=a=>a.keyword==="required"&&(a.params?.missingProperty==="type"||a.params?.missingProperty==="role")?0:a.keyword==="required"&&a.params?.missingProperty==="id"?1:a.keyword==="required"?2:3;return s.sort((a,m)=>h(a)-h(m)),s},ye=(e,t)=>{if(!t||typeof t!="object")return e;const r=e||{};for(const o of Object.keys(t))(!(o in r)||r[o]===void 0)&&(r[o]=t[o]);return r};let $t=null;const fi=()=>($t||($t=new Kn({allErrors:!0,strict:!1}),Hn($t)),$t),Cn=new Map,pi=JSON.stringify(Te),mi={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"]},hi=(e,t)=>e.compile({$ref:t,definitions:Te.definitions,properties:Te.properties}),te=e=>{const t=fi(),r=`type:${e}::${pi}`,o=Cn.get(r);if(o)return o;const d=mi[e]||[`#/definitions/${e}`,`#/$defs/${e}`];for(const s of d)try{const h=hi(t,s);return Cn.set(r,h),h}catch{}throw new Error(`VALIDATOR_REF_NOT_FOUND:${e}`)},Pt=te("DataSourceItem"),kt=te("DataSourceRest"),St=te("DataSourceWebSocket"),Et=te("DataSourceStatic"),jt=te("DataSourceFunction"),yi=(e,t)=>{const r={...e};return t?.generateId&&!r.id&&(r.id=pr()),r.type&&(r.type==="rest"?(t?.strict||("pollInterval"in r&&Ce(r.pollInterval)&&(r.pollInterval=Math.round(r.pollInterval)),"timeout"in r&&Ce(r.timeout)&&(r.timeout=Math.round(r.timeout))),ye(r,t?.defaults)):r.type==="websocket"?(r.heartbeat&&typeof r.heartbeat=="object"&&(t?.strict||"interval"in r.heartbeat&&Ce(r.heartbeat.interval)&&(r.heartbeat.interval=Math.round(r.heartbeat.interval))),t?.strict||"pollInterval"in r&&Ce(r.pollInterval)&&(r.pollInterval=Math.round(r.pollInterval)),ye(r,t?.defaults)):r.type==="static"?ye(r,t?.defaults):r.type==="function"&&(t?.strict||"timeout"in r&&Ce(r.timeout)&&(r.timeout=Math.round(r.timeout)),ye(r,t?.defaults))),r},gi=e=>{const t=e;if(t&&typeof t=="object"&&typeof t.type=="string"){if(t.type==="rest")return kt(e)?{ok:!0}:{ok:!1,errors:J(kt.errors||[])};if(t.type==="websocket")return St(e)?{ok:!0}:{ok:!1,errors:J(St.errors||[])};if(t.type==="static")return Et(e)?{ok:!0}:{ok:!1,errors:J(Et.errors||[])};if(t.type==="function")return jt(e)?{ok:!0}:{ok:!1,errors:J(jt.errors||[])}}if(Pt(e))return{ok:!0};const o=J(Pt.errors||[]);if(!t||typeof t!="object"||typeof t.type!="string"){const d=[];return d.push({path:"",message:"缺少必填字段:type",keyword:"required",params:{missingProperty:"type"}}),t?.id||d.push({path:"",message:"缺少必填字段:id",keyword:"required",params:{missingProperty:"id"}}),{ok:!1,errors:J(d)}}return{ok:!1,errors:o}},Jn=(e,t)=>{const r=yi(e,t);if(r&&typeof r=="object"&&typeof r.type=="string"){if(r.type==="rest")return kt(r)?{ok:!0,value:r}:{ok:!1,errors:J(kt.errors||[])};if(r.type==="websocket")return St(r)?{ok:!0,value:r}:{ok:!1,errors:J(St.errors||[])};if(r.type==="static")return Et(r)?{ok:!0,value:r}:{ok:!1,errors:J(Et.errors||[])};if(r.type==="function")return jt(r)?{ok:!0,value:r}:{ok:!1,errors:J(jt.errors||[])}}if(Pt(r))return{ok:!0,value:r};if(!r||typeof r.type!="string"){const d=[];return d.push({path:"",message:"缺少必填字段:type",keyword:"required",params:{missingProperty:"type"}}),r?.id||d.push({path:"",message:"缺少必填字段:id",keyword:"required",params:{missingProperty:"id"}}),{ok:!1,errors:J(d)}}return{ok:!1,errors:J(Pt.errors||[])}},vi=(e,t)=>{const r=Jn(e,t);if(!r.ok)throw new Error(JSON.stringify(r.errors));return r.value},Rt=te("ComponentInstance"),Nt=te("ViewComponentInstance"),Ot=te("ContainerComponentInstance"),It=te("LogicComponentInstanceRef"),_i=(e,t)=>{const r={...e};return t?.generateId&&!r.id&&(r.id=pr()),t?.strict||(r.role==="view"?delete r.children:r.role==="container"?delete r.component:r.role==="logic"&&delete r.children),ye(r,t?.defaults),r},$i=e=>{const t=e;if(t&&typeof t=="object"&&typeof t.role=="string"){if(t.role==="view")return Nt(e)?{ok:!0}:{ok:!1,errors:J(Nt.errors||[])};if(t.role==="container")return Ot(e)?{ok:!0}:{ok:!1,errors:J(Ot.errors||[])};if(t.role==="logic")return It(e)?{ok:!0}:{ok:!1,errors:J(It.errors||[])}}if(Rt(e))return{ok:!0};const o=J(Rt.errors||[]);if(!t||typeof t!="object"||typeof t.role!="string"){const d=[];return d.push({path:"",message:"缺少必填字段:role",keyword:"required",params:{missingProperty:"role"}}),t?.id||d.push({path:"",message:"缺少必填字段:id",keyword:"required",params:{missingProperty:"id"}}),{ok:!1,errors:J(d)}}return{ok:!1,errors:o}},Gn=(e,t)=>{const r=_i(e,t);if(r&&typeof r=="object"&&typeof r.role=="string"){if(r.role==="view")return Nt(r)?{ok:!0,value:r}:{ok:!1,errors:J(Nt.errors||[])};if(r.role==="container")return Ot(r)?{ok:!0,value:r}:{ok:!1,errors:J(Ot.errors||[])};if(r.role==="logic")return It(r)?{ok:!0,value:r}:{ok:!1,errors:J(It.errors||[])}}if(Rt(r))return{ok:!0,value:r};if(!r||typeof r.role!="string"){const d=[];return d.push({path:"",message:"缺少必填字段:role",keyword:"required",params:{missingProperty:"role"}}),r?.id||d.push({path:"",message:"缺少必填字段:id",keyword:"required",params:{missingProperty:"id"}}),{ok:!1,errors:J(d)}}return{ok:!1,errors:J(Rt.errors||[])}},bi=(e,t)=>{const r=Gn(e,t);if(!r.ok)throw new Error(JSON.stringify(r.errors));return r.value},qt=te("CICPage"),wi=(e,t)=>{const r={...e};return t?.generateId&&!r.id&&(r.id=pr()),ye(r,t?.defaults),r},Pi=e=>qt(e)?{ok:!0}:{ok:!1,errors:J(qt.errors||[])},Wn=(e,t)=>{const r=wi(e,t);return qt(r)?{ok:!0,value:r}:{ok:!1,errors:J(qt.errors||[])}},ki=(e,t)=>{const r=Wn(e,t);if(!r.ok)throw new Error(JSON.stringify(r.errors));return r.value},Ct=te("Meta"),Tt=te("Layout"),Si=e=>Ct(e)?{ok:!0}:{ok:!1,errors:J(Ct.errors||[])},Ei=e=>Tt(e)?{ok:!0}:{ok:!1,errors:J(Tt.errors||[])},Bn=(e,t)=>{const r=ye(e,t?.defaults);return Ct(r)?{ok:!0,value:r}:{ok:!1,errors:J(Ct.errors||[])}},Yn=(e,t)=>{const r=ye(e,t?.defaults);return Tt(r)?{ok:!0,value:r}:{ok:!1,errors:J(Tt.errors||[])}},ji=(e,t)=>{const r=Bn(e,t);if(!r.ok)throw new Error(JSON.stringify(r.errors));return r.value},Ri=(e,t)=>{const r=Yn(e,t);if(!r.ok)throw new Error(JSON.stringify(r.errors));return r.value},Dt=te("Variables"),Ni=e=>Dt(e)?{ok:!0}:{ok:!1,errors:J(Dt.errors||[])},Zn=(e,t)=>{const r=ye(e,t?.defaults);return Dt(r)?{ok:!0,value:r}:{ok:!1,errors:J(Dt.errors||[])}},Oi=(e,t)=>{const r=Zn(e,t);if(!r.ok)throw new Error(JSON.stringify(r.errors));return r.value},Mt=te("Dependency"),At=te("JSDependency"),Vt=te("CSSDependency"),zt=te("FontDependency"),Ft=te("ImageDependency"),Lt=te("JSONDependency"),Ut=te("WasmDependency"),Kt=te("OtherDependency"),Ii=e=>{const t=e;if(t&&typeof t=="object"&&typeof t.type=="string")switch(t.type){case"js":return At(e)?{ok:!0}:{ok:!1,errors:J(At.errors||[])};case"css":return Vt(e)?{ok:!0}:{ok:!1,errors:J(Vt.errors||[])};case"font":return zt(e)?{ok:!0}:{ok:!1,errors:J(zt.errors||[])};case"image":return Ft(e)?{ok:!0}:{ok:!1,errors:J(Ft.errors||[])};case"json":return Lt(e)?{ok:!0}:{ok:!1,errors:J(Lt.errors||[])};case"wasm":return Ut(e)?{ok:!0}:{ok:!1,errors:J(Ut.errors||[])};case"other":return Kt(e)?{ok:!0}:{ok:!1,errors:J(Kt.errors||[])}}if(Mt(e))return{ok:!0};const o=J(Mt.errors||[]);if(!t||typeof t!="object"||typeof t.type!="string"){const d=[];return d.push({path:"",message:"缺少必填字段:type",keyword:"required",params:{missingProperty:"type"}}),t?.id||d.push({path:"",message:"缺少必填字段:id",keyword:"required",params:{missingProperty:"id"}}),{ok:!1,errors:J(d)}}return{ok:!1,errors:o}},Qn=(e,t)=>{const r=ye(e,t?.defaults);if(r&&typeof r=="object"&&typeof r.type=="string")switch(r.type){case"js":return At(r)?{ok:!0,value:r}:{ok:!1,errors:J(At.errors||[])};case"css":return Vt(r)?{ok:!0,value:r}:{ok:!1,errors:J(Vt.errors||[])};case"font":return zt(r)?{ok:!0,value:r}:{ok:!1,errors:J(zt.errors||[])};case"image":return Ft(r)?{ok:!0,value:r}:{ok:!1,errors:J(Ft.errors||[])};case"json":return Lt(r)?{ok:!0,value:r}:{ok:!1,errors:J(Lt.errors||[])};case"wasm":return Ut(r)?{ok:!0,value:r}:{ok:!1,errors:J(Ut.errors||[])};case"other":return Kt(r)?{ok:!0,value:r}:{ok:!1,errors:J(Kt.errors||[])}}if(Mt(r))return{ok:!0,value:r};if(!r||typeof r.type!="string"){const d=[];return d.push({path:"",message:"缺少必填字段:type",keyword:"required",params:{missingProperty:"type"}}),r?.id||d.push({path:"",message:"缺少必填字段:id",keyword:"required",params:{missingProperty:"id"}}),{ok:!1,errors:J(d)}}return{ok:!1,errors:J(Mt.errors||[])}},qi=(e,t)=>{const r=Qn(e,t);if(!r.ok)throw new Error(JSON.stringify(r.errors));return r.value},Ht=te("RegistryComponents"),Ci=e=>Ht(e)?{ok:!0}:{ok:!1,errors:J(Ht.errors||[])},Xn=(e,t)=>{const r=ye(e,t?.defaults);return Ht(r)?{ok:!0,value:r}:{ok:!1,errors:J(Ht.errors||[])}},Ti=(e,t)=>{const r=Xn(e,t);if(!r.ok)throw new Error(JSON.stringify(r.errors));return r.value};class de{config;static validator;static validate;static schemaHash;constructor(t){const r=de.validateConfig(t);if(!r.valid)throw new Error(`Invalid CIC Configuration: ${r.error}`);this.config=t}getConfig(){return this.config}findComponent(t){let r;return this.walkComponents(o=>o.id===t?(r=o,!1):!0),r}findPageByComponent(t){let r;return this.walkComponents((o,d)=>o.id===t?(r=d,!1):!0),r}getVariable(t,r){const o=this.config.variables;if(o){if(t.componentId&&o.component&&o.component[t.componentId]){const d=o.component[t.componentId][r];if(d)return d.value??d.default}if(t.pageId&&o.page&&o.page[t.pageId]){const d=o.page[t.pageId][r];if(d)return d.value??d.default}if(o.global&&o.global[r]){const d=o.global[r];return d.value??d.default}}}getVariableByRef(t){const r=t.match(/^(global|page|component)(?::([^\.]+))?\.(.+)$/);if(!r)return;const[,o,d,s]=r;if(o==="global")return this.getVariable({},s);if(o==="page")return this.getVariable({pageId:d},s);if(o==="component")return this.getVariable({componentId:d},s)}walkComponents(t){if(this.config.pages)for(const r of this.config.pages){const o=[];for(const s of r.components||[])o.push({node:s});let d=!1;for(;o.length>0&&!d;){const{node:s,parent:h}=o.pop();if(t(s,r,h)===!1){d=!0;break}if(s.children&&s.children.length>0)for(let m=s.children.length-1;m>=0;m--)o.push({node:s.children[m],parent:s})}if(d)break}}static validateConfig(t){if(!t)return{valid:!1,error:"Config is null or undefined"};const r=JSON.stringify(Te);return(!de.validator||de.schemaHash!==r)&&(de.validator=new Kn({allErrors:!0,strict:!1}),Hn(de.validator),de.validator.addFormat("color-hex",/^#[0-9a-fA-F]{6}$/),de.validate=de.validator.compile(Te),de.schemaHash=r),de.validate(t)?{valid:!0}:{valid:!1,error:de.validate.errors.map(s=>`${s.instancePath} ${s.message}`).join("; ")}}static getValueByPath(t,r,o){if(t==null||!r)return o;const d=[];r.replace(/\[(\d+)\]/g,".$1").split(".").forEach(h=>{h.trim()&&d.push(h.trim())});let s=t;for(const h of d){if(s==null)return o;s=s[h]}return s===void 0?o:s}static traverseTree(t,r,o){const d=Array.isArray(t)?t:[t];for(const s of d)r(s,o)!==!1&&s.children&&s.children.length>0&&de.traverseTree(s.children,r,s)}static createDataSource=Jn;static validateDataSource=gi;static normalizeDataSource=vi;static createComponent=Gn;static validateComponent=$i;static normalizeComponent=bi;static createPage=Wn;static validatePage=Pi;static normalizePage=ki;static createMeta=Bn;static createLayout=Yn;static validateMeta=Si;static validateLayout=Ei;static normalizeMeta=ji;static normalizeLayout=Ri;static createVariables=Zn;static validateVariables=Ni;static normalizeVariables=Oi;static createDependency=Qn;static validateDependency=Ii;static normalizeDependency=qi;static createRegistryComponent=Xn;static validateRegistryComponent=Ci;static normalizeRegistryComponent=Ti}exports.CICSDK=de;