@anov/cic-standard-sdk 0.0.8 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -25
- package/dist/cic-sdk.cjs.js +8 -8
- package/dist/cic-sdk.es.js +3036 -2962
- package/dist/cic-sdk.umd.js +8 -8
- package/dist/sdk/CICSDK.d.ts +6 -18
- package/dist/sdk/generators/cicConfig.d.ts +40 -0
- package/dist/sdk/generators/common.d.ts +10 -0
- package/dist/sdk/generators/component.d.ts +6 -1
- package/dist/sdk/generators/dataSource.d.ts +0 -1
- package/dist/sdk/generators/dependency.d.ts +0 -1
- package/dist/sdk/generators/meta.d.ts +6 -2
- package/dist/sdk/generators/page.d.ts +5 -1
- package/dist/sdk/generators/registry.d.ts +5 -1
- package/dist/sdk/generators/variables.d.ts +5 -1
- package/package.json +1 -1
package/dist/cic-sdk.cjs.js
CHANGED
|
@@ -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
|
-
|| (${
|
|
4
|
-
|| (${
|
|
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},
|
|
6
|
-
missingProperty: ${
|
|
7
|
-
depsCount: ${
|
|
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;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function En(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Me={exports:{}},zt={},ge={},Pe={},Ft={},Lt={},Ut={},or;function wt(){return or||(or=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(s){if(super(),!e.IDENTIFIER.test(s))throw new Error("CodeGen: name must be a valid identifier");this.str=s}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=r;class o extends t{constructor(s){super(),this._items=typeof s=="string"?[s]:s}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const s=this._items[0];return s===""||s==='""'}get str(){var s;return(s=this._str)!==null&&s!==void 0?s:this._str=this._items.reduce((c,y)=>`${c}${y}`,"")}get names(){var s;return(s=this._names)!==null&&s!==void 0?s: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 h(l,...s){const c=[l[0]];let y=0;for(;y<s.length;)i(c,s[y]),c.push(l[++y]);return new o(c)}e._=h;const n=new o("+");function u(l,...s){const c=[_(l[0])];let y=0;for(;y<s.length;)c.push(n),i(c,s[y]),c.push(n,_(l[++y]));return f(c),new o(c)}e.str=u;function i(l,s){s instanceof o?l.push(...s._items):s instanceof r?l.push(s):l.push(E(s))}e.addCodeArg=i;function f(l){let s=1;for(;s<l.length-1;){if(l[s]===n){const c=$(l[s-1],l[s+1]);if(c!==void 0){l.splice(s-1,3,c);continue}l[s++]="+"}s++}}function $(l,s){if(s==='""')return l;if(l==='""')return s;if(typeof l=="string")return s instanceof r||l[l.length-1]!=='"'?void 0:typeof s!="string"?`${l.slice(0,-1)}${s}"`:s[0]==='"'?l.slice(0,-1)+s.slice(1):void 0;if(typeof s=="string"&&s[0]==='"'&&!(l instanceof r))return`"${l}${s.slice(1)}`}function g(l,s){return s.emptyStr()?l:l.emptyStr()?s:u`${l}${s}`}e.strConcat=g;function E(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 b(l){return typeof l=="string"&&e.IDENTIFIER.test(l)?new o(`.${l}`):h`[${l}]`}e.getProperty=b;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 d(l){return new o(l.toString())}e.regexpCode=d})(Ut)),Ut}var Kt={},ar;function cr(){return ar||(ar=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=wt();class r extends Error{constructor($){super(`CodeGen: "code" for ${$} not defined`),this.value=$.value}}var o;(function(f){f[f.Started=0]="Started",f[f.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 h{constructor({prefixes:$,parent:g}={}){this._names={},this._prefixes=$,this._parent=g}toName($){return $ instanceof t.Name?$:this.name($)}name($){return new t.Name(this._newName($))}_newName($){const g=this._names[$]||this._nameGroup($);return`${$}${g.index++}`}_nameGroup($){var g,E;if(!((E=(g=this._parent)===null||g===void 0?void 0:g._prefixes)===null||E===void 0)&&E.has($)||this._prefixes&&!this._prefixes.has($))throw new Error(`CodeGen: prefix "${$}" is not allowed in this scope`);return this._names[$]={prefix:$,index:0}}}e.Scope=h;class n extends t.Name{constructor($,g){super(g),this.prefix=$}setValue($,{property:g,itemIndex:E}){this.value=$,this.scopePath=(0,t._)`.${new t.Name(g)}[${E}]`}}e.ValueScopeName=n;const u=(0,t._)`\n`;class i extends h{constructor($){super($),this._values={},this._scope=$.scope,this.opts={...$,_n:$.lines?u:t.nil}}get(){return this._scope}name($){return new n($,this._newName($))}value($,g){var E;if(g.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const v=this.toName($),{prefix:_}=v,b=(E=g.key)!==null&&E!==void 0?E:g.ref;let w=this._values[_];if(w){const s=w.get(b);if(s)return s}else w=this._values[_]=new Map;w.set(b,v);const d=this._scope[_]||(this._scope[_]=[]),l=d.length;return d[l]=g.ref,v.setValue(g,{property:_,itemIndex:l}),v}getValue($,g){const E=this._values[$];if(E)return E.get(g)}scopeRefs($,g=this._values){return this._reduceValues(g,E=>{if(E.scopePath===void 0)throw new Error(`CodeGen: name "${E}" has no value`);return(0,t._)`${$}${E.scopePath}`})}scopeCode($=this._values,g,E){return this._reduceValues($,v=>{if(v.value===void 0)throw new Error(`CodeGen: name "${v}" has no value`);return v.value.code},g,E)}_reduceValues($,g,E={},v){let _=t.nil;for(const b in $){const w=$[b];if(!w)continue;const d=E[b]=E[b]||new Map;w.forEach(l=>{if(d.has(l))return;d.set(l,o.Started);let s=g(l);if(s){const c=this.opts.es5?e.varKinds.var:e.varKinds.const;_=(0,t._)`${_}${c} ${l} = ${s};${this.opts._n}`}else if(s=v?.(l))_=(0,t._)`${_}${s}${this.opts._n}`;else throw new r(l);d.set(l,o.Completed)})}return _}}e.ValueScope=i})(Kt)),Kt}var dr;function G(){return dr||(dr=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=wt(),r=cr();var o=wt();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 h=cr();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return h.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return h.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return h.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return h.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class n{optimizeNodes(){return this}optimizeNames(p,S){return this}}class u extends n{constructor(p,S,C){super(),this.varKind=p,this.name=S,this.rhs=C}render({es5:p,_n:S}){const C=p?r.varKinds.var:this.varKind,U=this.rhs===void 0?"":` = ${this.rhs}`;return`${C} ${this.name}${U};`+S}optimizeNames(p,S){if(p[this.name.str])return this.rhs&&(this.rhs=L(this.rhs,p,S)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class i extends n{constructor(p,S,C){super(),this.lhs=p,this.rhs=S,this.sideEffects=C}render({_n:p}){return`${this.lhs} = ${this.rhs};`+p}optimizeNames(p,S){if(!(this.lhs instanceof t.Name&&!p[this.lhs.str]&&!this.sideEffects))return this.rhs=L(this.rhs,p,S),this}get names(){const p=this.lhs instanceof t.Name?{}:{...this.lhs.names};return F(p,this.rhs)}}class f extends i{constructor(p,S,C,U){super(p,C,U),this.op=S}render({_n:p}){return`${this.lhs} ${this.op}= ${this.rhs};`+p}}class $ extends n{constructor(p){super(),this.label=p,this.names={}}render({_n:p}){return`${this.label}:`+p}}class g extends n{constructor(p){super(),this.label=p,this.names={}}render({_n:p}){return`break${this.label?` ${this.label}`:""};`+p}}class E extends n{constructor(p){super(),this.error=p}render({_n:p}){return`throw ${this.error};`+p}get names(){return this.error.names}}class v extends n{constructor(p){super(),this.code=p}render({_n:p}){return`${this.code};`+p}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(p,S){return this.code=L(this.code,p,S),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class _ extends n{constructor(p=[]){super(),this.nodes=p}render(p){return this.nodes.reduce((S,C)=>S+C.render(p),"")}optimizeNodes(){const{nodes:p}=this;let S=p.length;for(;S--;){const C=p[S].optimizeNodes();Array.isArray(C)?p.splice(S,1,...C):C?p[S]=C:p.splice(S,1)}return p.length>0?this:void 0}optimizeNames(p,S){const{nodes:C}=this;let U=C.length;for(;U--;){const J=C[U];J.optimizeNames(p,S)||(Q(p,J.names),C.splice(U,1))}return C.length>0?this:void 0}get names(){return this.nodes.reduce((p,S)=>V(p,S.names),{})}}class b extends _{render(p){return"{"+p._n+super.render(p)+"}"+p._n}}class w extends _{}class d extends b{}d.kind="else";class l extends b{constructor(p,S){super(S),this.condition=p}render(p){let S=`if(${this.condition})`+super.render(p);return this.else&&(S+="else "+this.else.render(p)),S}optimizeNodes(){super.optimizeNodes();const p=this.condition;if(p===!0)return this.nodes;let S=this.else;if(S){const C=S.optimizeNodes();S=this.else=Array.isArray(C)?new d(C):C}if(S)return p===!1?S instanceof l?S:S.nodes:this.nodes.length?this:new l(ie(p),S instanceof l?[S]:S.nodes);if(!(p===!1||!this.nodes.length))return this}optimizeNames(p,S){var C;if(this.else=(C=this.else)===null||C===void 0?void 0:C.optimizeNames(p,S),!!(super.optimizeNames(p,S)||this.else))return this.condition=L(this.condition,p,S),this}get names(){const p=super.names;return F(p,this.condition),this.else&&V(p,this.else.names),p}}l.kind="if";class s extends b{}s.kind="for";class c extends s{constructor(p){super(),this.iteration=p}render(p){return`for(${this.iteration})`+super.render(p)}optimizeNames(p,S){if(super.optimizeNames(p,S))return this.iteration=L(this.iteration,p,S),this}get names(){return V(super.names,this.iteration.names)}}class y extends s{constructor(p,S,C,U){super(),this.varKind=p,this.name=S,this.from=C,this.to=U}render(p){const S=p.es5?r.varKinds.var:this.varKind,{name:C,from:U,to:J}=this;return`for(${S} ${C}=${U}; ${C}<${J}; ${C}++)`+super.render(p)}get names(){const p=F(super.names,this.from);return F(p,this.to)}}class a extends s{constructor(p,S,C,U){super(),this.loop=p,this.varKind=S,this.name=C,this.iterable=U}render(p){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(p)}optimizeNames(p,S){if(super.optimizeNames(p,S))return this.iterable=L(this.iterable,p,S),this}get names(){return V(super.names,this.iterable.names)}}class m extends b{constructor(p,S,C){super(),this.name=p,this.args=S,this.async=C}render(p){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(p)}}m.kind="func";class P extends _{render(p){return"return "+super.render(p)}}P.kind="return";class R extends b{render(p){let S="try"+super.render(p);return this.catch&&(S+=this.catch.render(p)),this.finally&&(S+=this.finally.render(p)),S}optimizeNodes(){var p,S;return super.optimizeNodes(),(p=this.catch)===null||p===void 0||p.optimizeNodes(),(S=this.finally)===null||S===void 0||S.optimizeNodes(),this}optimizeNames(p,S){var C,U;return super.optimizeNames(p,S),(C=this.catch)===null||C===void 0||C.optimizeNames(p,S),(U=this.finally)===null||U===void 0||U.optimizeNames(p,S),this}get names(){const p=super.names;return this.catch&&V(p,this.catch.names),this.finally&&V(p,this.finally.names),p}}class T extends b{constructor(p){super(),this.error=p}render(p){return`catch(${this.error})`+super.render(p)}}T.kind="catch";class z extends b{render(p){return"finally"+super.render(p)}}z.kind="finally";class N{constructor(p,S={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...S,_n:S.lines?`
|
|
2
|
+
`:""},this._extScope=p,this._scope=new r.Scope({parent:p}),this._nodes=[new w]}toString(){return this._root.render(this.opts)}name(p){return this._scope.name(p)}scopeName(p){return this._extScope.name(p)}scopeValue(p,S){const C=this._extScope.value(p,S);return(this._values[C.prefix]||(this._values[C.prefix]=new Set)).add(C),C}getScopeValue(p,S){return this._extScope.getValue(p,S)}scopeRefs(p){return this._extScope.scopeRefs(p,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(p,S,C,U){const J=this._scope.toName(S);return C!==void 0&&U&&(this._constants[J.str]=C),this._leafNode(new u(p,J,C)),J}const(p,S,C){return this._def(r.varKinds.const,p,S,C)}let(p,S,C){return this._def(r.varKinds.let,p,S,C)}var(p,S,C){return this._def(r.varKinds.var,p,S,C)}assign(p,S,C){return this._leafNode(new i(p,S,C))}add(p,S){return this._leafNode(new f(p,e.operators.ADD,S))}code(p){return typeof p=="function"?p():p!==t.nil&&this._leafNode(new v(p)),this}object(...p){const S=["{"];for(const[C,U]of p)S.length>1&&S.push(","),S.push(C),(C!==U||this.opts.es5)&&(S.push(":"),(0,t.addCodeArg)(S,U));return S.push("}"),new t._Code(S)}if(p,S,C){if(this._blockNode(new l(p)),S&&C)this.code(S).else().code(C).endIf();else if(S)this.code(S).endIf();else if(C)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(p){return this._elseNode(new l(p))}else(){return this._elseNode(new d)}endIf(){return this._endBlockNode(l,d)}_for(p,S){return this._blockNode(p),S&&this.code(S).endFor(),this}for(p,S){return this._for(new c(p),S)}forRange(p,S,C,U,J=this.opts.es5?r.varKinds.var:r.varKinds.let){const Z=this._scope.toName(p);return this._for(new y(J,Z,S,C),()=>U(Z))}forOf(p,S,C,U=r.varKinds.const){const J=this._scope.toName(p);if(this.opts.es5){const Z=S instanceof t.Name?S:this.var("_arr",S);return this.forRange("_i",0,(0,t._)`${Z}.length`,B=>{this.var(J,(0,t._)`${Z}[${B}]`),C(J)})}return this._for(new a("of",U,J,S),()=>C(J))}forIn(p,S,C,U=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(p,(0,t._)`Object.keys(${S})`,C);const J=this._scope.toName(p);return this._for(new a("in",U,J,S),()=>C(J))}endFor(){return this._endBlockNode(s)}label(p){return this._leafNode(new $(p))}break(p){return this._leafNode(new g(p))}return(p){const S=new P;if(this._blockNode(S),this.code(p),S.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(P)}try(p,S,C){if(!S&&!C)throw new Error('CodeGen: "try" without "catch" and "finally"');const U=new R;if(this._blockNode(U),this.code(p),S){const J=this.name("e");this._currNode=U.catch=new T(J),S(J)}return C&&(this._currNode=U.finally=new z,this.code(C)),this._endBlockNode(T,z)}throw(p){return this._leafNode(new E(p))}block(p,S){return this._blockStarts.push(this._nodes.length),p&&this.code(p).endBlock(S),this}endBlock(p){const S=this._blockStarts.pop();if(S===void 0)throw new Error("CodeGen: not in self-balancing block");const C=this._nodes.length-S;if(C<0||p!==void 0&&C!==p)throw new Error(`CodeGen: wrong number of nodes: ${C} vs ${p} expected`);return this._nodes.length=S,this}func(p,S=t.nil,C,U){return this._blockNode(new m(p,S,C)),U&&this.code(U).endFunc(),this}endFunc(){return this._endBlockNode(m)}optimize(p=1){for(;p-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(p){return this._currNode.nodes.push(p),this}_blockNode(p){this._currNode.nodes.push(p),this._nodes.push(p)}_endBlockNode(p,S){const C=this._currNode;if(C instanceof p||S&&C instanceof S)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${S?`${p.kind}/${S.kind}`:p.kind}"`)}_elseNode(p){const S=this._currNode;if(!(S instanceof l))throw new Error('CodeGen: "else" without "if"');return this._currNode=S.else=p,this}get _root(){return this._nodes[0]}get _currNode(){const p=this._nodes;return p[p.length-1]}set _currNode(p){const S=this._nodes;S[S.length-1]=p}}e.CodeGen=N;function V(O,p){for(const S in p)O[S]=(O[S]||0)+(p[S]||0);return O}function F(O,p){return p instanceof t._CodeOrName?V(O,p.names):O}function L(O,p,S){if(O instanceof t.Name)return C(O);if(!U(O))return O;return new t._Code(O._items.reduce((J,Z)=>(Z instanceof t.Name&&(Z=C(Z)),Z instanceof t._Code?J.push(...Z._items):J.push(Z),J),[]));function C(J){const Z=S[J.str];return Z===void 0||p[J.str]!==1?J:(delete p[J.str],Z)}function U(J){return J instanceof t._Code&&J._items.some(Z=>Z instanceof t.Name&&p[Z.str]===1&&S[Z.str]!==void 0)}}function Q(O,p){for(const S in p)O[S]=(O[S]||0)-(p[S]||0)}function ie(O){return typeof O=="boolean"||typeof O=="number"||O===null?!O:(0,t._)`!${D(O)}`}e.not=ie;const oe=j(e.operators.AND);function x(...O){return O.reduce(oe)}e.and=x;const fe=j(e.operators.OR);function M(...O){return O.reduce(fe)}e.or=M;function j(O){return(p,S)=>p===t.nil?S:S===t.nil?p:(0,t._)`${D(p)} ${O} ${D(S)}`}function D(O){return O instanceof t.Name?O:(0,t._)`(${O})`}})(Lt)),Lt}var H={},ur;function Y(){if(ur)return H;ur=1,Object.defineProperty(H,"__esModule",{value:!0}),H.checkStrictMode=H.getErrorPath=H.Type=H.useFunc=H.setEvaluated=H.evaluatedPropsToName=H.mergeEvaluated=H.eachItem=H.unescapeJsonPointer=H.escapeJsonPointer=H.escapeFragment=H.unescapeFragment=H.schemaRefOrVal=H.schemaHasRulesButRef=H.schemaHasRules=H.checkUnknownRules=H.alwaysValidSchema=H.toHash=void 0;const e=G(),t=wt();function r(a){const m={};for(const P of a)m[P]=!0;return m}H.toHash=r;function o(a,m){return typeof m=="boolean"?m:Object.keys(m).length===0?!0:(h(a,m),!n(m,a.self.RULES.all))}H.alwaysValidSchema=o;function h(a,m=a.schema){const{opts:P,self:R}=a;if(!P.strictSchema||typeof m=="boolean")return;const T=R.RULES.keywords;for(const z in m)T[z]||y(a,`unknown keyword: "${z}"`)}H.checkUnknownRules=h;function n(a,m){if(typeof a=="boolean")return!a;for(const P in a)if(m[P])return!0;return!1}H.schemaHasRules=n;function u(a,m){if(typeof a=="boolean")return!a;for(const P in a)if(P!=="$ref"&&m.all[P])return!0;return!1}H.schemaHasRulesButRef=u;function i({topSchemaRef:a,schemaPath:m},P,R,T){if(!T){if(typeof P=="number"||typeof P=="boolean")return P;if(typeof P=="string")return(0,e._)`${P}`}return(0,e._)`${a}${m}${(0,e.getProperty)(R)}`}H.schemaRefOrVal=i;function f(a){return E(decodeURIComponent(a))}H.unescapeFragment=f;function $(a){return encodeURIComponent(g(a))}H.escapeFragment=$;function g(a){return typeof a=="number"?`${a}`:a.replace(/~/g,"~0").replace(/\//g,"~1")}H.escapeJsonPointer=g;function E(a){return a.replace(/~1/g,"/").replace(/~0/g,"~")}H.unescapeJsonPointer=E;function v(a,m){if(Array.isArray(a))for(const P of a)m(P);else m(a)}H.eachItem=v;function _({mergeNames:a,mergeToName:m,mergeValues:P,resultToName:R}){return(T,z,N,V)=>{const F=N===void 0?z:N instanceof e.Name?(z instanceof e.Name?a(T,z,N):m(T,z,N),N):z instanceof e.Name?(m(T,N,z),z):P(z,N);return V===e.Name&&!(F instanceof e.Name)?R(T,F):F}}H.mergeEvaluated={props:_({mergeNames:(a,m,P)=>a.if((0,e._)`${P} !== true && ${m} !== undefined`,()=>{a.if((0,e._)`${m} === true`,()=>a.assign(P,!0),()=>a.assign(P,(0,e._)`${P} || {}`).code((0,e._)`Object.assign(${P}, ${m})`))}),mergeToName:(a,m,P)=>a.if((0,e._)`${P} !== true`,()=>{m===!0?a.assign(P,!0):(a.assign(P,(0,e._)`${P} || {}`),w(a,P,m))}),mergeValues:(a,m)=>a===!0?!0:{...a,...m},resultToName:b}),items:_({mergeNames:(a,m,P)=>a.if((0,e._)`${P} !== true && ${m} !== undefined`,()=>a.assign(P,(0,e._)`${m} === true ? true : ${P} > ${m} ? ${P} : ${m}`)),mergeToName:(a,m,P)=>a.if((0,e._)`${P} !== true`,()=>a.assign(P,m===!0?!0:(0,e._)`${P} > ${m} ? ${P} : ${m}`)),mergeValues:(a,m)=>a===!0?!0:Math.max(a,m),resultToName:(a,m)=>a.var("items",m)})};function b(a,m){if(m===!0)return a.var("props",!0);const P=a.var("props",(0,e._)`{}`);return m!==void 0&&w(a,P,m),P}H.evaluatedPropsToName=b;function w(a,m,P){Object.keys(P).forEach(R=>a.assign((0,e._)`${m}${(0,e.getProperty)(R)}`,!0))}H.setEvaluated=w;const d={};function l(a,m){return a.scopeValue("func",{ref:m,code:d[m.code]||(d[m.code]=new t._Code(m.code))})}H.useFunc=l;var s;(function(a){a[a.Num=0]="Num",a[a.Str=1]="Str"})(s||(H.Type=s={}));function c(a,m,P){if(a instanceof e.Name){const R=m===s.Num;return P?R?(0,e._)`"[" + ${a} + "]"`:(0,e._)`"['" + ${a} + "']"`:R?(0,e._)`"/" + ${a}`:(0,e._)`"/" + ${a}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return P?(0,e.getProperty)(a).toString():"/"+g(a)}H.getErrorPath=c;function y(a,m,P=a.opts.strictSchema){if(P){if(m=`strict mode: ${m}`,P===!0)throw new Error(m);a.self.logger.warn(m)}}return H.checkStrictMode=y,H}var Ae={},lr;function we(){if(lr)return Ae;lr=1,Object.defineProperty(Ae,"__esModule",{value:!0});const e=G(),t={data:new e.Name("data"),valCxt:new e.Name("valCxt"),instancePath:new e.Name("instancePath"),parentData:new e.Name("parentData"),parentDataProperty:new e.Name("parentDataProperty"),rootData:new e.Name("rootData"),dynamicAnchors:new e.Name("dynamicAnchors"),vErrors:new e.Name("vErrors"),errors:new e.Name("errors"),this:new e.Name("this"),self:new e.Name("self"),scope:new e.Name("scope"),json:new e.Name("json"),jsonPos:new e.Name("jsonPos"),jsonLen:new e.Name("jsonLen"),jsonPart:new e.Name("jsonPart")};return Ae.default=t,Ae}var fr;function Ct(){return fr||(fr=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=G(),r=Y(),o=we();e.keywordError={message:({keyword:d})=>(0,t.str)`must pass "${d}" keyword validation`},e.keyword$DataError={message:({keyword:d,schemaType:l})=>l?(0,t.str)`"${d}" keyword must be ${l} ($data)`:(0,t.str)`"${d}" keyword is invalid ($data)`};function h(d,l=e.keywordError,s,c){const{it:y}=d,{gen:a,compositeRule:m,allErrors:P}=y,R=E(d,l,s);c??(m||P)?f(a,R):$(y,(0,t._)`[${R}]`)}e.reportError=h;function n(d,l=e.keywordError,s){const{it:c}=d,{gen:y,compositeRule:a,allErrors:m}=c,P=E(d,l,s);f(y,P),a||m||$(c,o.default.vErrors)}e.reportExtraError=n;function u(d,l){d.assign(o.default.errors,l),d.if((0,t._)`${o.default.vErrors} !== null`,()=>d.if(l,()=>d.assign((0,t._)`${o.default.vErrors}.length`,l),()=>d.assign(o.default.vErrors,null)))}e.resetErrorsCount=u;function i({gen:d,keyword:l,schemaValue:s,data:c,errsCount:y,it:a}){if(y===void 0)throw new Error("ajv implementation error");const m=d.name("err");d.forRange("i",y,o.default.errors,P=>{d.const(m,(0,t._)`${o.default.vErrors}[${P}]`),d.if((0,t._)`${m}.instancePath === undefined`,()=>d.assign((0,t._)`${m}.instancePath`,(0,t.strConcat)(o.default.instancePath,a.errorPath))),d.assign((0,t._)`${m}.schemaPath`,(0,t.str)`${a.errSchemaPath}/${l}`),a.opts.verbose&&(d.assign((0,t._)`${m}.schema`,s),d.assign((0,t._)`${m}.data`,c))})}e.extendErrors=i;function f(d,l){const s=d.const("err",l);d.if((0,t._)`${o.default.vErrors} === null`,()=>d.assign(o.default.vErrors,(0,t._)`[${s}]`),(0,t._)`${o.default.vErrors}.push(${s})`),d.code((0,t._)`${o.default.errors}++`)}function $(d,l){const{gen:s,validateName:c,schemaEnv:y}=d;y.$async?s.throw((0,t._)`new ${d.ValidationError}(${l})`):(s.assign((0,t._)`${c}.errors`,l),s.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 E(d,l,s){const{createErrors:c}=d.it;return c===!1?(0,t._)`{}`:v(d,l,s)}function v(d,l,s={}){const{gen:c,it:y}=d,a=[_(y,s),b(d,s)];return w(d,l,a),c.object(...a)}function _({errorPath:d},{instancePath:l}){const s=l?(0,t.str)`${d}${(0,r.getErrorPath)(l,r.Type.Str)}`:d;return[o.default.instancePath,(0,t.strConcat)(o.default.instancePath,s)]}function b({keyword:d,it:{errSchemaPath:l}},{schemaPath:s,parentSchema:c}){let y=c?l:(0,t.str)`${l}/${d}`;return s&&(y=(0,t.str)`${y}${(0,r.getErrorPath)(s,r.Type.Str)}`),[g.schemaPath,y]}function w(d,{params:l,message:s},c){const{keyword:y,data:a,schemaValue:m,it:P}=d,{opts:R,propertyName:T,topSchemaRef:z,schemaPath:N}=P;c.push([g.keyword,y],[g.params,typeof l=="function"?l(d):l||(0,t._)`{}`]),R.messages&&c.push([g.message,typeof s=="function"?s(d):s]),R.verbose&&c.push([g.schema,m],[g.parentSchema,(0,t._)`${z}${N}`],[o.default.data,a]),T&&c.push([g.propertyName,T])}})(Ft)),Ft}var pr;function cs(){if(pr)return Pe;pr=1,Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.boolOrEmptySchema=Pe.topBoolOrEmptySchema=void 0;const e=Ct(),t=G(),r=we(),o={message:"boolean schema is false"};function h(i){const{gen:f,schema:$,validateName:g}=i;$===!1?u(i,!1):typeof $=="object"&&$.$async===!0?f.return(r.default.data):(f.assign((0,t._)`${g}.errors`,null),f.return(!0))}Pe.topBoolOrEmptySchema=h;function n(i,f){const{gen:$,schema:g}=i;g===!1?($.var(f,!1),u(i)):$.var(f,!0)}Pe.boolOrEmptySchema=n;function u(i,f){const{gen:$,data:g}=i,E={gen:$,keyword:"false schema",data:g,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:i};(0,e.reportError)(E,o,void 0,f)}return Pe}var se={},Se={},mr;function kn(){if(mr)return Se;mr=1,Object.defineProperty(Se,"__esModule",{value:!0}),Se.getRules=Se.isJSONType=void 0;const e=["string","number","integer","boolean","null","object","array"],t=new Set(e);function r(h){return typeof h=="string"&&t.has(h)}Se.isJSONType=r;function o(){const h={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...h,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},h.number,h.string,h.array,h.object],post:{rules:[]},all:{},keywords:{}}}return Se.getRules=o,Se}var ve={},hr;function jn(){if(hr)return ve;hr=1,Object.defineProperty(ve,"__esModule",{value:!0}),ve.shouldUseRule=ve.shouldUseGroup=ve.schemaHasRulesForType=void 0;function e({schema:o,self:h},n){const u=h.RULES.types[n];return u&&u!==!0&&t(o,u)}ve.schemaHasRulesForType=e;function t(o,h){return h.rules.some(n=>r(o,n))}ve.shouldUseGroup=t;function r(o,h){var n;return o[h.keyword]!==void 0||((n=h.definition.implements)===null||n===void 0?void 0:n.some(u=>o[u]!==void 0))}return ve.shouldUseRule=r,ve}var yr;function Pt(){if(yr)return se;yr=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=kn(),t=jn(),r=Ct(),o=G(),h=Y();var n;(function(s){s[s.Correct=0]="Correct",s[s.Wrong=1]="Wrong"})(n||(se.DataType=n={}));function u(s){const c=i(s.type);if(c.includes("null")){if(s.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!c.length&&s.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');s.nullable===!0&&c.push("null")}return c}se.getSchemaTypes=u;function i(s){const c=Array.isArray(s)?s:s?[s]:[];if(c.every(e.isJSONType))return c;throw new Error("type must be JSONType or JSONType[]: "+c.join(","))}se.getJSONTypes=i;function f(s,c){const{gen:y,data:a,opts:m}=s,P=g(c,m.coerceTypes),R=c.length>0&&!(P.length===0&&c.length===1&&(0,t.schemaHasRulesForType)(s,c[0]));if(R){const T=b(c,a,m.strictNumbers,n.Wrong);y.if(T,()=>{P.length?E(s,c,P):d(s)})}return R}se.coerceAndCheckDataType=f;const $=new Set(["string","number","integer","boolean","null"]);function g(s,c){return c?s.filter(y=>$.has(y)||c==="array"&&y==="array"):[]}function E(s,c,y){const{gen:a,data:m,opts:P}=s,R=a.let("dataType",(0,o._)`typeof ${m}`),T=a.let("coerced",(0,o._)`undefined`);P.coerceTypes==="array"&&a.if((0,o._)`${R} == 'object' && Array.isArray(${m}) && ${m}.length == 1`,()=>a.assign(m,(0,o._)`${m}[0]`).assign(R,(0,o._)`typeof ${m}`).if(b(c,m,P.strictNumbers),()=>a.assign(T,m))),a.if((0,o._)`${T} !== undefined`);for(const N of y)($.has(N)||N==="array"&&P.coerceTypes==="array")&&z(N);a.else(),d(s),a.endIf(),a.if((0,o._)`${T} !== undefined`,()=>{a.assign(m,T),v(s,T)});function z(N){switch(N){case"string":a.elseIf((0,o._)`${R} == "number" || ${R} == "boolean"`).assign(T,(0,o._)`"" + ${m}`).elseIf((0,o._)`${m} === null`).assign(T,(0,o._)`""`);return;case"number":a.elseIf((0,o._)`${R} == "boolean" || ${m} === null
|
|
3
|
+
|| (${R} == "string" && ${m} && ${m} == +${m})`).assign(T,(0,o._)`+${m}`);return;case"integer":a.elseIf((0,o._)`${R} === "boolean" || ${m} === null
|
|
4
|
+
|| (${R} === "string" && ${m} && ${m} == +${m} && !(${m} % 1))`).assign(T,(0,o._)`+${m}`);return;case"boolean":a.elseIf((0,o._)`${m} === "false" || ${m} === 0 || ${m} === null`).assign(T,!1).elseIf((0,o._)`${m} === "true" || ${m} === 1`).assign(T,!0);return;case"null":a.elseIf((0,o._)`${m} === "" || ${m} === 0 || ${m} === false`),a.assign(T,null);return;case"array":a.elseIf((0,o._)`${R} === "string" || ${R} === "number"
|
|
5
|
+
|| ${R} === "boolean" || ${m} === null`).assign(T,(0,o._)`[${m}]`)}}}function v({gen:s,parentData:c,parentDataProperty:y},a){s.if((0,o._)`${c} !== undefined`,()=>s.assign((0,o._)`${c}[${y}]`,a))}function _(s,c,y,a=n.Correct){const m=a===n.Correct?o.operators.EQ:o.operators.NEQ;let P;switch(s){case"null":return(0,o._)`${c} ${m} 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=R((0,o._)`!(${c} % 1) && !isNaN(${c})`);break;case"number":P=R();break;default:return(0,o._)`typeof ${c} ${m} ${s}`}return a===n.Correct?P:(0,o.not)(P);function R(T=o.nil){return(0,o.and)((0,o._)`typeof ${c} == "number"`,T,y?(0,o._)`isFinite(${c})`:o.nil)}}se.checkDataType=_;function b(s,c,y,a){if(s.length===1)return _(s[0],c,y,a);let m;const P=(0,h.toHash)(s);if(P.array&&P.object){const R=(0,o._)`typeof ${c} != "object"`;m=P.null?R:(0,o._)`!${c} || ${R}`,delete P.null,delete P.array,delete P.object}else m=o.nil;P.number&&delete P.integer;for(const R in P)m=(0,o.and)(m,_(R,c,y,a));return m}se.checkDataTypes=b;const w={message:({schema:s})=>`must be ${s}`,params:({schema:s,schemaValue:c})=>typeof s=="string"?(0,o._)`{type: ${s}}`:(0,o._)`{type: ${c}}`};function d(s){const c=l(s);(0,r.reportError)(c,w)}se.reportTypeError=d;function l(s){const{gen:c,data:y,schema:a}=s,m=(0,h.schemaRefOrVal)(s,a,"type");return{gen:c,keyword:"type",data:y,schema:a.type,schemaCode:m,schemaValue:m,parentSchema:a,params:{},it:s}}return se}var Re={},gr;function ds(){if(gr)return Re;gr=1,Object.defineProperty(Re,"__esModule",{value:!0}),Re.assignDefaults=void 0;const e=G(),t=Y();function r(h,n){const{properties:u,items:i}=h.schema;if(n==="object"&&u)for(const f in u)o(h,f,u[f].default);else n==="array"&&Array.isArray(i)&&i.forEach((f,$)=>o(h,$,f.default))}Re.assignDefaults=r;function o(h,n,u){const{gen:i,compositeRule:f,data:$,opts:g}=h;if(u===void 0)return;const E=(0,e._)`${$}${(0,e.getProperty)(n)}`;if(f){(0,t.checkStrictMode)(h,`default is ignored for: ${E}`);return}let v=(0,e._)`${E} === undefined`;g.useDefaults==="empty"&&(v=(0,e._)`${v} || ${E} === null || ${E} === ""`),i.if(v,(0,e._)`${E} = ${(0,e.stringify)(u)}`)}return Re}var me={},X={},vr;function ye(){if(vr)return X;vr=1,Object.defineProperty(X,"__esModule",{value:!0}),X.validateUnion=X.validateArray=X.usePattern=X.callValidateCode=X.schemaProperties=X.allSchemaProperties=X.noPropertyInData=X.propertyInData=X.isOwnProperty=X.hasPropFunc=X.reportMissingProp=X.checkMissingProp=X.checkReportMissingProp=void 0;const e=G(),t=Y(),r=we(),o=Y();function h(s,c){const{gen:y,data:a,it:m}=s;y.if(g(y,a,c,m.opts.ownProperties),()=>{s.setParams({missingProperty:(0,e._)`${c}`},!0),s.error()})}X.checkReportMissingProp=h;function n({gen:s,data:c,it:{opts:y}},a,m){return(0,e.or)(...a.map(P=>(0,e.and)(g(s,c,P,y.ownProperties),(0,e._)`${m} = ${P}`)))}X.checkMissingProp=n;function u(s,c){s.setParams({missingProperty:c},!0),s.error()}X.reportMissingProp=u;function i(s){return s.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,e._)`Object.prototype.hasOwnProperty`})}X.hasPropFunc=i;function f(s,c,y){return(0,e._)`${i(s)}.call(${c}, ${y})`}X.isOwnProperty=f;function $(s,c,y,a){const m=(0,e._)`${c}${(0,e.getProperty)(y)} !== undefined`;return a?(0,e._)`${m} && ${f(s,c,y)}`:m}X.propertyInData=$;function g(s,c,y,a){const m=(0,e._)`${c}${(0,e.getProperty)(y)} === undefined`;return a?(0,e.or)(m,(0,e.not)(f(s,c,y))):m}X.noPropertyInData=g;function E(s){return s?Object.keys(s).filter(c=>c!=="__proto__"):[]}X.allSchemaProperties=E;function v(s,c){return E(c).filter(y=>!(0,t.alwaysValidSchema)(s,c[y]))}X.schemaProperties=v;function _({schemaCode:s,data:c,it:{gen:y,topSchemaRef:a,schemaPath:m,errorPath:P},it:R},T,z,N){const V=N?(0,e._)`${s}, ${c}, ${a}${m}`:c,F=[[r.default.instancePath,(0,e.strConcat)(r.default.instancePath,P)],[r.default.parentData,R.parentData],[r.default.parentDataProperty,R.parentDataProperty],[r.default.rootData,r.default.rootData]];R.opts.dynamicRef&&F.push([r.default.dynamicAnchors,r.default.dynamicAnchors]);const L=(0,e._)`${V}, ${y.object(...F)}`;return z!==e.nil?(0,e._)`${T}.call(${z}, ${L})`:(0,e._)`${T}(${L})`}X.callValidateCode=_;const b=(0,e._)`new RegExp`;function w({gen:s,it:{opts:c}},y){const a=c.unicodeRegExp?"u":"",{regExp:m}=c.code,P=m(y,a);return s.scopeValue("pattern",{key:P.toString(),ref:P,code:(0,e._)`${m.code==="new RegExp"?b:(0,o.useFunc)(s,m)}(${y}, ${a})`})}X.usePattern=w;function d(s){const{gen:c,data:y,keyword:a,it:m}=s,P=c.name("valid");if(m.allErrors){const T=c.let("valid",!0);return R(()=>c.assign(T,!1)),T}return c.var(P,!0),R(()=>c.break()),P;function R(T){const z=c.const("len",(0,e._)`${y}.length`);c.forRange("i",0,z,N=>{s.subschema({keyword:a,dataProp:N,dataPropType:t.Type.Num},P),c.if((0,e.not)(P),T)})}}X.validateArray=d;function l(s){const{gen:c,schema:y,keyword:a,it:m}=s;if(!Array.isArray(y))throw new Error("ajv implementation error");if(y.some(z=>(0,t.alwaysValidSchema)(m,z))&&!m.opts.unevaluated)return;const R=c.let("valid",!1),T=c.name("_valid");c.block(()=>y.forEach((z,N)=>{const V=s.subschema({keyword:a,schemaProp:N,compositeRule:!0},T);c.assign(R,(0,e._)`${R} || ${T}`),s.mergeValidEvaluated(V,T)||c.if((0,e.not)(R))})),s.result(R,()=>s.reset(),()=>s.error(!0))}return X.validateUnion=l,X}var _r;function us(){if(_r)return me;_r=1,Object.defineProperty(me,"__esModule",{value:!0}),me.validateKeywordUsage=me.validSchemaType=me.funcKeywordCode=me.macroKeywordCode=void 0;const e=G(),t=we(),r=ye(),o=Ct();function h(v,_){const{gen:b,keyword:w,schema:d,parentSchema:l,it:s}=v,c=_.macro.call(s.self,d,l,s),y=$(b,w,c);s.opts.validateSchema!==!1&&s.self.validateSchema(c,!0);const a=b.name("valid");v.subschema({schema:c,schemaPath:e.nil,errSchemaPath:`${s.errSchemaPath}/${w}`,topSchemaRef:y,compositeRule:!0},a),v.pass(a,()=>v.error(!0))}me.macroKeywordCode=h;function n(v,_){var b;const{gen:w,keyword:d,schema:l,parentSchema:s,$data:c,it:y}=v;f(y,_);const a=!c&&_.compile?_.compile.call(y.self,l,s,y):_.validate,m=$(w,d,a),P=w.let("valid");v.block$data(P,R),v.ok((b=_.valid)!==null&&b!==void 0?b:P);function R(){if(_.errors===!1)N(),_.modifying&&u(v),V(()=>v.error());else{const F=_.async?T():z();_.modifying&&u(v),V(()=>i(v,F))}}function T(){const F=w.let("ruleErrs",null);return w.try(()=>N((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._)`${m}.errors`;return w.assign(F,null),N(e.nil),F}function N(F=_.async?(0,e._)`await `:e.nil){const L=y.opts.passContext?t.default.this:t.default.self,Q=!("compile"in _&&!c||_.schema===!1);w.assign(P,(0,e._)`${F}${(0,r.callValidateCode)(v,m,L,Q)}`,_.modifying)}function V(F){var L;w.if((0,e.not)((L=_.valid)!==null&&L!==void 0?L:P),F)}}me.funcKeywordCode=n;function u(v){const{gen:_,data:b,it:w}=v;_.if(w.parentData,()=>_.assign(b,(0,e._)`${w.parentData}[${w.parentDataProperty}]`))}function i(v,_){const{gen:b}=v;b.if((0,e._)`Array.isArray(${_})`,()=>{b.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 f({schemaEnv:v},_){if(_.async&&!v.$async)throw new Error("async keyword in sync schema")}function $(v,_,b){if(b===void 0)throw new Error(`keyword "${_}" failed to compile`);return v.scopeValue("keyword",typeof b=="function"?{ref:b}:{ref:b,code:(0,e.stringify)(b)})}function g(v,_,b=!1){return!_.length||_.some(w=>w==="array"?Array.isArray(v):w==="object"?v&&typeof v=="object"&&!Array.isArray(v):typeof v==w||b&&typeof v>"u")}me.validSchemaType=g;function E({schema:v,opts:_,self:b,errSchemaPath:w},d,l){if(Array.isArray(d.keyword)?!d.keyword.includes(l):d.keyword!==l)throw new Error("ajv implementation error");const s=d.dependencies;if(s?.some(c=>!Object.prototype.hasOwnProperty.call(v,c)))throw new Error(`parent schema must have dependencies of ${l}: ${s.join(",")}`);if(d.validateSchema&&!d.validateSchema(v[l])){const y=`keyword "${l}" value is invalid at path "${w}": `+b.errorsText(d.validateSchema.errors);if(_.validateSchema==="log")b.logger.error(y);else throw new Error(y)}}return me.validateKeywordUsage=E,me}var _e={},$r;function ls(){if($r)return _e;$r=1,Object.defineProperty(_e,"__esModule",{value:!0}),_e.extendSubschemaMode=_e.extendSubschemaData=_e.getSubschema=void 0;const e=G(),t=Y();function r(n,{keyword:u,schemaProp:i,schema:f,schemaPath:$,errSchemaPath:g,topSchemaRef:E}){if(u!==void 0&&f!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(u!==void 0){const v=n.schema[u];return i===void 0?{schema:v,schemaPath:(0,e._)`${n.schemaPath}${(0,e.getProperty)(u)}`,errSchemaPath:`${n.errSchemaPath}/${u}`}:{schema:v[i],schemaPath:(0,e._)`${n.schemaPath}${(0,e.getProperty)(u)}${(0,e.getProperty)(i)}`,errSchemaPath:`${n.errSchemaPath}/${u}/${(0,t.escapeFragment)(i)}`}}if(f!==void 0){if($===void 0||g===void 0||E===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:f,schemaPath:$,topSchemaRef:E,errSchemaPath:g}}throw new Error('either "keyword" or "schema" must be passed')}_e.getSubschema=r;function o(n,u,{dataProp:i,dataPropType:f,data:$,dataTypes:g,propertyName:E}){if($!==void 0&&i!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:v}=u;if(i!==void 0){const{errorPath:b,dataPathArr:w,opts:d}=u,l=v.let("data",(0,e._)`${u.data}${(0,e.getProperty)(i)}`,!0);_(l),n.errorPath=(0,e.str)`${b}${(0,t.getErrorPath)(i,f,d.jsPropertySyntax)}`,n.parentDataProperty=(0,e._)`${i}`,n.dataPathArr=[...w,n.parentDataProperty]}if($!==void 0){const b=$ instanceof e.Name?$:v.let("data",$,!0);_(b),E!==void 0&&(n.propertyName=E)}g&&(n.dataTypes=g);function _(b){n.data=b,n.dataLevel=u.dataLevel+1,n.dataTypes=[],u.definedProperties=new Set,n.parentData=u.data,n.dataNames=[...u.dataNames,b]}}_e.extendSubschemaData=o;function h(n,{jtdDiscriminator:u,jtdMetadata:i,compositeRule:f,createErrors:$,allErrors:g}){f!==void 0&&(n.compositeRule=f),$!==void 0&&(n.createErrors=$),g!==void 0&&(n.allErrors=g),n.jtdDiscriminator=u,n.jtdMetadata=i}return _e.extendSubschemaMode=h,_e}var ae={},Jt,br;function In(){return br||(br=1,Jt=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,h,n;if(Array.isArray(t)){if(o=t.length,o!=r.length)return!1;for(h=o;h--!==0;)if(!e(t[h],r[h]))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(n=Object.keys(t),o=n.length,o!==Object.keys(r).length)return!1;for(h=o;h--!==0;)if(!Object.prototype.hasOwnProperty.call(r,n[h]))return!1;for(h=o;h--!==0;){var u=n[h];if(!e(t[u],r[u]))return!1}return!0}return t!==t&&r!==r}),Jt}var Ht={exports:{}},wr;function fs(){if(wr)return Ht.exports;wr=1;var e=Ht.exports=function(o,h,n){typeof h=="function"&&(n=h,h={}),n=h.cb||n;var u=typeof n=="function"?n:n.pre||function(){},i=n.post||function(){};t(h,u,i,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,h,n,u,i,f,$,g,E,v){if(u&&typeof u=="object"&&!Array.isArray(u)){h(u,i,f,$,g,E,v);for(var _ in u){var b=u[_];if(Array.isArray(b)){if(_ in e.arrayKeywords)for(var w=0;w<b.length;w++)t(o,h,n,b[w],i+"/"+_+"/"+w,f,i,_,u,w)}else if(_ in e.propsKeywords){if(b&&typeof b=="object")for(var d in b)t(o,h,n,b[d],i+"/"+_+"/"+r(d),f,i,_,u,d)}else(_ in e.keywords||o.allKeys&&!(_ in e.skipKeywords))&&t(o,h,n,b,i+"/"+_,f,i,_,u)}n(u,i,f,$,g,E,v)}}function r(o){return o.replace(/~/g,"~0").replace(/\//g,"~1")}return Ht.exports}var Pr;function Nt(){if(Pr)return ae;Pr=1,Object.defineProperty(ae,"__esModule",{value:!0}),ae.getSchemaRefs=ae.resolveUrl=ae.normalizeId=ae._getFullPath=ae.getFullPath=ae.inlineRef=void 0;const e=Y(),t=In(),r=fs(),o=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function h(w,d=!0){return typeof w=="boolean"?!0:d===!0?!u(w):d?i(w)<=d:!1}ae.inlineRef=h;const n=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function u(w){for(const d in w){if(n.has(d))return!0;const l=w[d];if(Array.isArray(l)&&l.some(u)||typeof l=="object"&&u(l))return!0}return!1}function i(w){let d=0;for(const l in w){if(l==="$ref")return 1/0;if(d++,!o.has(l)&&(typeof w[l]=="object"&&(0,e.eachItem)(w[l],s=>d+=i(s)),d===1/0))return 1/0}return d}function f(w,d="",l){l!==!1&&(d=E(d));const s=w.parse(d);return $(w,s)}ae.getFullPath=f;function $(w,d){return w.serialize(d).split("#")[0]+"#"}ae._getFullPath=$;const g=/#\/?$/;function E(w){return w?w.replace(g,""):""}ae.normalizeId=E;function v(w,d,l){return l=E(l),w.resolve(d,l)}ae.resolveUrl=v;const _=/^[a-z_][-a-z0-9._]*$/i;function b(w,d){if(typeof w=="boolean")return{};const{schemaId:l,uriResolver:s}=this.opts,c=E(w[l]||d),y={"":c},a=f(s,c,!1),m={},P=new Set;return r(w,{allKeys:!0},(z,N,V,F)=>{if(F===void 0)return;const L=a+N;let Q=y[F];typeof z[l]=="string"&&(Q=ie.call(this,z[l])),oe.call(this,z.$anchor),oe.call(this,z.$dynamicAnchor),y[N]=Q;function ie(x){const fe=this.opts.uriResolver.resolve;if(x=E(Q?fe(Q,x):x),P.has(x))throw T(x);P.add(x);let M=this.refs[x];return typeof M=="string"&&(M=this.refs[M]),typeof M=="object"?R(z,M.schema,x):x!==E(L)&&(x[0]==="#"?(R(z,m[x],x),m[x]=z):this.refs[x]=L),x}function oe(x){if(typeof x=="string"){if(!_.test(x))throw new Error(`invalid anchor "${x}"`);ie.call(this,`#${x}`)}}}),m;function R(z,N,V){if(N!==void 0&&!t(z,N))throw T(V)}function T(z){return new Error(`reference "${z}" resolves to more than one schema`)}}return ae.getSchemaRefs=b,ae}var Sr;function qt(){if(Sr)return ge;Sr=1,Object.defineProperty(ge,"__esModule",{value:!0}),ge.getData=ge.KeywordCxt=ge.validateFunctionCode=void 0;const e=cs(),t=Pt(),r=jn(),o=Pt(),h=ds(),n=us(),u=ls(),i=G(),f=we(),$=Nt(),g=Y(),E=Ct();function v(k){if(a(k)&&(P(k),y(k))){d(k);return}_(k,()=>(0,e.topBoolOrEmptySchema)(k))}ge.validateFunctionCode=v;function _({gen:k,validateName:I,schema:q,schemaEnv:A,opts:K},W){K.code.es5?k.func(I,(0,i._)`${f.default.data}, ${f.default.valCxt}`,A.$async,()=>{k.code((0,i._)`"use strict"; ${s(q,K)}`),w(k,K),k.code(W)}):k.func(I,(0,i._)`${f.default.data}, ${b(K)}`,A.$async,()=>k.code(s(q,K)).code(W))}function b(k){return(0,i._)`{${f.default.instancePath}="", ${f.default.parentData}, ${f.default.parentDataProperty}, ${f.default.rootData}=${f.default.data}${k.dynamicRef?(0,i._)`, ${f.default.dynamicAnchors}={}`:i.nil}}={}`}function w(k,I){k.if(f.default.valCxt,()=>{k.var(f.default.instancePath,(0,i._)`${f.default.valCxt}.${f.default.instancePath}`),k.var(f.default.parentData,(0,i._)`${f.default.valCxt}.${f.default.parentData}`),k.var(f.default.parentDataProperty,(0,i._)`${f.default.valCxt}.${f.default.parentDataProperty}`),k.var(f.default.rootData,(0,i._)`${f.default.valCxt}.${f.default.rootData}`),I.dynamicRef&&k.var(f.default.dynamicAnchors,(0,i._)`${f.default.valCxt}.${f.default.dynamicAnchors}`)},()=>{k.var(f.default.instancePath,(0,i._)`""`),k.var(f.default.parentData,(0,i._)`undefined`),k.var(f.default.parentDataProperty,(0,i._)`undefined`),k.var(f.default.rootData,f.default.data),I.dynamicRef&&k.var(f.default.dynamicAnchors,(0,i._)`{}`)})}function d(k){const{schema:I,opts:q,gen:A}=k;_(k,()=>{q.$comment&&I.$comment&&F(k),z(k),A.let(f.default.vErrors,null),A.let(f.default.errors,0),q.unevaluated&&l(k),R(k),L(k)})}function l(k){const{gen:I,validateName:q}=k;k.evaluated=I.const("evaluated",(0,i._)`${q}.evaluated`),I.if((0,i._)`${k.evaluated}.dynamicProps`,()=>I.assign((0,i._)`${k.evaluated}.props`,(0,i._)`undefined`)),I.if((0,i._)`${k.evaluated}.dynamicItems`,()=>I.assign((0,i._)`${k.evaluated}.items`,(0,i._)`undefined`))}function s(k,I){const q=typeof k=="object"&&k[I.schemaId];return q&&(I.code.source||I.code.process)?(0,i._)`/*# sourceURL=${q} */`:i.nil}function c(k,I){if(a(k)&&(P(k),y(k))){m(k,I);return}(0,e.boolOrEmptySchema)(k,I)}function y({schema:k,self:I}){if(typeof k=="boolean")return!k;for(const q in k)if(I.RULES.all[q])return!0;return!1}function a(k){return typeof k.schema!="boolean"}function m(k,I){const{schema:q,gen:A,opts:K}=k;K.$comment&&q.$comment&&F(k),N(k),V(k);const W=A.const("_errs",f.default.errors);R(k,W),A.var(I,(0,i._)`${W} === ${f.default.errors}`)}function P(k){(0,g.checkUnknownRules)(k),T(k)}function R(k,I){if(k.opts.jtd)return ie(k,[],!1,I);const q=(0,t.getSchemaTypes)(k.schema),A=(0,t.coerceAndCheckDataType)(k,q);ie(k,q,!A,I)}function T(k){const{schema:I,errSchemaPath:q,opts:A,self:K}=k;I.$ref&&A.ignoreKeywordsWithRef&&(0,g.schemaHasRulesButRef)(I,K.RULES)&&K.logger.warn(`$ref: keywords ignored in schema at path "${q}"`)}function z(k){const{schema:I,opts:q}=k;I.default!==void 0&&q.useDefaults&&q.strictSchema&&(0,g.checkStrictMode)(k,"default is ignored in the schema root")}function N(k){const I=k.schema[k.opts.schemaId];I&&(k.baseId=(0,$.resolveUrl)(k.opts.uriResolver,k.baseId,I))}function V(k){if(k.schema.$async&&!k.schemaEnv.$async)throw new Error("async schema in sync schema")}function F({gen:k,schemaEnv:I,schema:q,errSchemaPath:A,opts:K}){const W=q.$comment;if(K.$comment===!0)k.code((0,i._)`${f.default.self}.logger.log(${W})`);else if(typeof K.$comment=="function"){const re=(0,i.str)`${A}/$comment`,pe=k.scopeValue("root",{ref:I.root});k.code((0,i._)`${f.default.self}.opts.$comment(${W}, ${re}, ${pe}.schema)`)}}function L(k){const{gen:I,schemaEnv:q,validateName:A,ValidationError:K,opts:W}=k;q.$async?I.if((0,i._)`${f.default.errors} === 0`,()=>I.return(f.default.data),()=>I.throw((0,i._)`new ${K}(${f.default.vErrors})`)):(I.assign((0,i._)`${A}.errors`,f.default.vErrors),W.unevaluated&&Q(k),I.return((0,i._)`${f.default.errors} === 0`))}function Q({gen:k,evaluated:I,props:q,items:A}){q instanceof i.Name&&k.assign((0,i._)`${I}.props`,q),A instanceof i.Name&&k.assign((0,i._)`${I}.items`,A)}function ie(k,I,q,A){const{gen:K,schema:W,data:re,allErrors:pe,opts:ce,self:de}=k,{RULES:ne}=de;if(W.$ref&&(ce.ignoreKeywordsWithRef||!(0,g.schemaHasRulesButRef)(W,ne))){K.block(()=>U(k,"$ref",ne.all.$ref.definition));return}ce.jtd||x(k,I),K.block(()=>{for(const le of ne.rules)ke(le);ke(ne.post)});function ke(le){(0,r.shouldUseGroup)(W,le)&&(le.type?(K.if((0,o.checkDataType)(le.type,re,ce.strictNumbers)),oe(k,le),I.length===1&&I[0]===le.type&&q&&(K.else(),(0,o.reportTypeError)(k)),K.endIf()):oe(k,le),pe||K.if((0,i._)`${f.default.errors} === ${A||0}`))}}function oe(k,I){const{gen:q,schema:A,opts:{useDefaults:K}}=k;K&&(0,h.assignDefaults)(k,I.type),q.block(()=>{for(const W of I.rules)(0,r.shouldUseRule)(A,W)&&U(k,W.keyword,W.definition,I.type)})}function x(k,I){k.schemaEnv.meta||!k.opts.strictTypes||(fe(k,I),k.opts.allowUnionTypes||M(k,I),j(k,k.dataTypes))}function fe(k,I){if(I.length){if(!k.dataTypes.length){k.dataTypes=I;return}I.forEach(q=>{O(k.dataTypes,q)||S(k,`type "${q}" not allowed by context "${k.dataTypes.join(",")}"`)}),p(k,I)}}function M(k,I){I.length>1&&!(I.length===2&&I.includes("null"))&&S(k,"use allowUnionTypes to allow union type keyword")}function j(k,I){const q=k.self.RULES.all;for(const A in q){const K=q[A];if(typeof K=="object"&&(0,r.shouldUseRule)(k.schema,K)){const{type:W}=K.definition;W.length&&!W.some(re=>D(I,re))&&S(k,`missing type "${W.join(",")}" for keyword "${A}"`)}}}function D(k,I){return k.includes(I)||I==="number"&&k.includes("integer")}function O(k,I){return k.includes(I)||I==="integer"&&k.includes("number")}function p(k,I){const q=[];for(const A of k.dataTypes)O(I,A)?q.push(A):I.includes("integer")&&A==="number"&&q.push("integer");k.dataTypes=q}function S(k,I){const q=k.schemaEnv.baseId+k.errSchemaPath;I+=` at "${q}" (strictTypes)`,(0,g.checkStrictMode)(k,I,k.opts.strictTypes)}class C{constructor(I,q,A){if((0,n.validateKeywordUsage)(I,q,A),this.gen=I.gen,this.allErrors=I.allErrors,this.keyword=A,this.data=I.data,this.schema=I.schema[A],this.$data=q.$data&&I.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,g.schemaRefOrVal)(I,this.schema,A,this.$data),this.schemaType=q.schemaType,this.parentSchema=I.schema,this.params={},this.it=I,this.def=q,this.$data)this.schemaCode=I.gen.const("vSchema",B(this.$data,I));else if(this.schemaCode=this.schemaValue,!(0,n.validSchemaType)(this.schema,q.schemaType,q.allowUndefined))throw new Error(`${A} value must be ${JSON.stringify(q.schemaType)}`);("code"in q?q.trackErrors:q.errors!==!1)&&(this.errsCount=I.gen.const("_errs",f.default.errors))}result(I,q,A){this.failResult((0,i.not)(I),q,A)}failResult(I,q,A){this.gen.if(I),A?A():this.error(),q?(this.gen.else(),q(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(I,q){this.failResult((0,i.not)(I),void 0,q)}fail(I){if(I===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(I),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(I){if(!this.$data)return this.fail(I);const{schemaCode:q}=this;this.fail((0,i._)`${q} !== undefined && (${(0,i.or)(this.invalid$data(),I)})`)}error(I,q,A){if(q){this.setParams(q),this._error(I,A),this.setParams({});return}this._error(I,A)}_error(I,q){(I?E.reportExtraError:E.reportError)(this,this.def.error,q)}$dataError(){(0,E.reportError)(this,this.def.$dataError||E.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,E.resetErrorsCount)(this.gen,this.errsCount)}ok(I){this.allErrors||this.gen.if(I)}setParams(I,q){q?Object.assign(this.params,I):this.params=I}block$data(I,q,A=i.nil){this.gen.block(()=>{this.check$data(I,A),q()})}check$data(I=i.nil,q=i.nil){if(!this.$data)return;const{gen:A,schemaCode:K,schemaType:W,def:re}=this;A.if((0,i.or)((0,i._)`${K} === undefined`,q)),I!==i.nil&&A.assign(I,!0),(W.length||re.validateSchema)&&(A.elseIf(this.invalid$data()),this.$dataError(),I!==i.nil&&A.assign(I,!1)),A.else()}invalid$data(){const{gen:I,schemaCode:q,schemaType:A,def:K,it:W}=this;return(0,i.or)(re(),pe());function re(){if(A.length){if(!(q instanceof i.Name))throw new Error("ajv implementation error");const ce=Array.isArray(A)?A:[A];return(0,i._)`${(0,o.checkDataTypes)(ce,q,W.opts.strictNumbers,o.DataType.Wrong)}`}return i.nil}function pe(){if(K.validateSchema){const ce=I.scopeValue("validate$data",{ref:K.validateSchema});return(0,i._)`!${ce}(${q})`}return i.nil}}subschema(I,q){const A=(0,u.getSubschema)(this.it,I);(0,u.extendSubschemaData)(A,this.it,I),(0,u.extendSubschemaMode)(A,I);const K={...this.it,...A,items:void 0,props:void 0};return c(K,q),K}mergeEvaluated(I,q){const{it:A,gen:K}=this;A.opts.unevaluated&&(A.props!==!0&&I.props!==void 0&&(A.props=g.mergeEvaluated.props(K,I.props,A.props,q)),A.items!==!0&&I.items!==void 0&&(A.items=g.mergeEvaluated.items(K,I.items,A.items,q)))}mergeValidEvaluated(I,q){const{it:A,gen:K}=this;if(A.opts.unevaluated&&(A.props!==!0||A.items!==!0))return K.if(q,()=>this.mergeEvaluated(I,i.Name)),!0}}ge.KeywordCxt=C;function U(k,I,q,A){const K=new C(k,q,I);"code"in q?q.code(K,A):K.$data&&q.validate?(0,n.funcKeywordCode)(K,q):"macro"in q?(0,n.macroKeywordCode)(K,q):(q.compile||q.validate)&&(0,n.funcKeywordCode)(K,q)}const J=/^\/(?:[^~]|~0|~1)*$/,Z=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function B(k,{dataLevel:I,dataNames:q,dataPathArr:A}){let K,W;if(k==="")return f.default.rootData;if(k[0]==="/"){if(!J.test(k))throw new Error(`Invalid JSON-pointer: ${k}`);K=k,W=f.default.rootData}else{const de=Z.exec(k);if(!de)throw new Error(`Invalid JSON-pointer: ${k}`);const ne=+de[1];if(K=de[2],K==="#"){if(ne>=I)throw new Error(ce("property/index",ne));return A[I-ne]}if(ne>I)throw new Error(ce("data",ne));if(W=q[I-ne],!K)return W}let re=W;const pe=K.split("/");for(const de of pe)de&&(W=(0,i._)`${W}${(0,i.getProperty)((0,g.unescapeJsonPointer)(de))}`,re=(0,i._)`${re} && ${W}`);return re;function ce(de,ne){return`Cannot access ${de} ${ne} levels up, current level is ${I}`}}return ge.getData=B,ge}var Ve={},Er;function Xt(){if(Er)return Ve;Er=1,Object.defineProperty(Ve,"__esModule",{value:!0});class e extends Error{constructor(r){super("validation failed"),this.errors=r,this.ajv=this.validation=!0}}return Ve.default=e,Ve}var ze={},kr;function Dt(){if(kr)return ze;kr=1,Object.defineProperty(ze,"__esModule",{value:!0});const e=Nt();class t extends Error{constructor(o,h,n,u){super(u||`can't resolve reference ${n} from id ${h}`),this.missingRef=(0,e.resolveUrl)(o,h,n),this.missingSchema=(0,e.normalizeId)((0,e.getFullPath)(o,this.missingRef))}}return ze.default=t,ze}var ue={},jr;function xt(){if(jr)return ue;jr=1,Object.defineProperty(ue,"__esModule",{value:!0}),ue.resolveSchema=ue.getCompilingSchema=ue.resolveRef=ue.compileSchema=ue.SchemaEnv=void 0;const e=G(),t=Xt(),r=we(),o=Nt(),h=Y(),n=qt();class u{constructor(l){var s;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=(s=l.baseId)!==null&&s!==void 0?s:(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={}}}ue.SchemaEnv=u;function i(d){const l=g.call(this,d);if(l)return l;const s=(0,o.getFullPath)(this.opts.uriResolver,d.root.baseId),{es5:c,lines:y}=this.opts.code,{ownProperties:a}=this.opts,m=new e.CodeGen(this.scope,{es5:c,lines:y,ownProperties:a});let P;d.$async&&(P=m.scopeValue("Error",{ref:t.default,code:(0,e._)`require("ajv/dist/runtime/validation_error").default`}));const R=m.scopeName("validate");d.validateName=R;const T={gen:m,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:m.scopeValue("schema",this.opts.code.source===!0?{ref:d.schema,code:(0,e.stringify)(d.schema)}:{ref:d.schema}),validateName:R,ValidationError:P,schema:d.schema,schemaEnv:d,rootId:s,baseId:d.baseId||s,schemaPath:e.nil,errSchemaPath:d.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,e._)`""`,opts:this.opts,self:this};let z;try{this._compilations.add(d),(0,n.validateFunctionCode)(T),m.optimize(this.opts.code.optimize);const N=m.toString();z=`${m.scopeRefs(r.default.scope)}return ${N}`,this.opts.code.process&&(z=this.opts.code.process(z,d));const F=new Function(`${r.default.self}`,`${r.default.scope}`,z)(this,this.scope.get());if(this.scope.value(R,{ref:F}),F.errors=null,F.schema=d.schema,F.schemaEnv=d,d.$async&&(F.$async=!0),this.opts.code.source===!0&&(F.source={validateName:R,validateCode:N,scopeValues:m._values}),this.opts.unevaluated){const{props:L,items:Q}=T;F.evaluated={props:L instanceof e.Name?void 0:L,items:Q instanceof e.Name?void 0:Q,dynamicProps:L instanceof e.Name,dynamicItems:Q instanceof e.Name},F.source&&(F.source.evaluated=(0,e.stringify)(F.evaluated))}return d.validate=F,d}catch(N){throw delete d.validate,delete d.validateName,z&&this.logger.error("Error compiling schema, function code:",z),N}finally{this._compilations.delete(d)}}ue.compileSchema=i;function f(d,l,s){var c;s=(0,o.resolveUrl)(this.opts.uriResolver,l,s);const y=d.refs[s];if(y)return y;let a=v.call(this,d,s);if(a===void 0){const m=(c=d.localRefs)===null||c===void 0?void 0:c[s],{schemaId:P}=this.opts;m&&(a=new u({schema:m,schemaId:P,root:d,baseId:l}))}if(a!==void 0)return d.refs[s]=$.call(this,a)}ue.resolveRef=f;function $(d){return(0,o.inlineRef)(d.schema,this.opts.inlineRefs)?d.schema:d.validate?d:i.call(this,d)}function g(d){for(const l of this._compilations)if(E(l,d))return l}ue.getCompilingSchema=g;function E(d,l){return d.schema===l.schema&&d.root===l.root&&d.baseId===l.baseId}function v(d,l){let s;for(;typeof(s=this.refs[l])=="string";)l=s;return s||this.schemas[l]||_.call(this,d,l)}function _(d,l){const s=this.opts.uriResolver.parse(l),c=(0,o._getFullPath)(this.opts.uriResolver,s);let y=(0,o.getFullPath)(this.opts.uriResolver,d.baseId,void 0);if(Object.keys(d.schema).length>0&&c===y)return w.call(this,s,d);const a=(0,o.normalizeId)(c),m=this.refs[a]||this.schemas[a];if(typeof m=="string"){const P=_.call(this,d,m);return typeof P?.schema!="object"?void 0:w.call(this,s,P)}if(typeof m?.schema=="object"){if(m.validate||i.call(this,m),a===(0,o.normalizeId)(l)){const{schema:P}=m,{schemaId:R}=this.opts,T=P[R];return T&&(y=(0,o.resolveUrl)(this.opts.uriResolver,y,T)),new u({schema:P,schemaId:R,root:d,baseId:y})}return w.call(this,s,m)}}ue.resolveSchema=_;const b=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function w(d,{baseId:l,schema:s,root:c}){var y;if(((y=d.fragment)===null||y===void 0?void 0:y[0])!=="/")return;for(const P of d.fragment.slice(1).split("/")){if(typeof s=="boolean")return;const R=s[(0,h.unescapeFragment)(P)];if(R===void 0)return;s=R;const T=typeof s=="object"&&s[this.opts.schemaId];!b.has(P)&&T&&(l=(0,o.resolveUrl)(this.opts.uriResolver,l,T))}let a;if(typeof s!="boolean"&&s.$ref&&!(0,h.schemaHasRulesButRef)(s,this.RULES)){const P=(0,o.resolveUrl)(this.opts.uriResolver,l,s.$ref);a=_.call(this,c,P)}const{schemaId:m}=this.opts;if(a=a||new u({schema:s,schemaId:m,root:c,baseId:l}),a.schema!==a.root.schema)return a}return ue}const ps="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",ms="Meta-schema for $data reference (JSON AnySchema extension proposal)",hs="object",ys=["$data"],gs={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},vs=!1,_s={$id:ps,description:ms,type:hs,required:ys,properties:gs,additionalProperties:vs};var Fe={},Ce={exports:{}},Gt,Ir;function On(){if(Ir)return Gt;Ir=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 _="",b=0,w=0;for(w=0;w<v.length;w++)if(b=v[w].charCodeAt(0),b!==48){if(!(b>=48&&b<=57||b>=65&&b<=70||b>=97&&b<=102))return"";_+=v[w];break}for(w+=1;w<v.length;w++){if(b=v[w].charCodeAt(0),!(b>=48&&b<=57||b>=65&&b<=70||b>=97&&b<=102))return"";_+=v[w]}return _}const o=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function h(v){return v.length=0,!0}function n(v,_,b){if(v.length){const w=r(v);if(w!=="")_.push(w);else return b.error=!0,!1;v.length=0}return!0}function u(v){let _=0;const b={error:!1,address:"",zone:""},w=[],d=[];let l=!1,s=!1,c=n;for(let y=0;y<v.length;y++){const a=v[y];if(!(a==="["||a==="]"))if(a===":"){if(l===!0&&(s=!0),!c(d,w,b))break;if(++_>7){b.error=!0;break}y>0&&v[y-1]===":"&&(l=!0),w.push(":");continue}else if(a==="%"){if(!c(d,w,b))break;c=h}else{d.push(a);continue}}return d.length&&(c===h?b.zone=d.join(""):s?w.push(d.join("")):w.push(r(d))),b.address=w.join(""),b}function i(v){if(f(v,":")<2)return{host:v,isIPV6:!1};const _=u(v);if(_.error)return{host:v,isIPV6:!1};{let b=_.address,w=_.address;return _.zone&&(b+="%"+_.zone,w+="%25"+_.zone),{host:b,isIPV6:!0,escapedHost:w}}}function f(v,_){let b=0;for(let w=0;w<v.length;w++)v[w]===_&&b++;return b}function $(v){let _=v;const b=[];let w=-1,d=0;for(;d=_.length;){if(d===1){if(_===".")break;if(_==="/"){b.push("/");break}else{b.push(_);break}}else if(d===2){if(_[0]==="."){if(_[1]===".")break;if(_[1]==="/"){_=_.slice(2);continue}}else if(_[0]==="/"&&(_[1]==="."||_[1]==="/")){b.push("/");break}}else if(d===3&&_==="/.."){b.length!==0&&b.pop(),b.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),b.length!==0&&b.pop();continue}}if((w=_.indexOf("/",1))===-1){b.push(_);break}else b.push(_.slice(0,w)),_=_.slice(w)}return b.join("")}function g(v,_){const b=_!==!0?escape:unescape;return v.scheme!==void 0&&(v.scheme=b(v.scheme)),v.userinfo!==void 0&&(v.userinfo=b(v.userinfo)),v.host!==void 0&&(v.host=b(v.host)),v.path!==void 0&&(v.path=b(v.path)),v.query!==void 0&&(v.query=b(v.query)),v.fragment!==void 0&&(v.fragment=b(v.fragment)),v}function E(v){const _=[];if(v.userinfo!==void 0&&(_.push(v.userinfo),_.push("@")),v.host!==void 0){let b=unescape(v.host);if(!t(b)){const w=i(b);w.isIPV6===!0?b=`[${w.escapedHost}]`:b=v.host}_.push(b)}return(typeof v.port=="number"||typeof v.port=="string")&&(_.push(":"),_.push(String(v.port))),_.length?_.join(""):void 0}return Gt={nonSimpleDomain:o,recomposeAuthority:E,normalizeComponentEncoding:g,removeDotSegments:$,isIPv4:t,isUUID:e,normalizeIPv6:i,stringArrayToHexStripped:r},Gt}var Wt,Or;function $s(){if(Or)return Wt;Or=1;const{isUUID:e}=On(),t=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,r=["http","https","ws","wss","urn","urn:uuid"];function o(a){return r.indexOf(a)!==-1}function h(a){return a.secure===!0?!0:a.secure===!1?!1:a.scheme?a.scheme.length===3&&(a.scheme[0]==="w"||a.scheme[0]==="W")&&(a.scheme[1]==="s"||a.scheme[1]==="S")&&(a.scheme[2]==="s"||a.scheme[2]==="S"):!1}function n(a){return a.host||(a.error=a.error||"HTTP URIs must have a host."),a}function u(a){const m=String(a.scheme).toLowerCase()==="https";return(a.port===(m?443:80)||a.port==="")&&(a.port=void 0),a.path||(a.path="/"),a}function i(a){return a.secure=h(a),a.resourceName=(a.path||"/")+(a.query?"?"+a.query:""),a.path=void 0,a.query=void 0,a}function f(a){if((a.port===(h(a)?443:80)||a.port==="")&&(a.port=void 0),typeof a.secure=="boolean"&&(a.scheme=a.secure?"wss":"ws",a.secure=void 0),a.resourceName){const[m,P]=a.resourceName.split("?");a.path=m&&m!=="/"?m:void 0,a.query=P,a.resourceName=void 0}return a.fragment=void 0,a}function $(a,m){if(!a.path)return a.error="URN can not be parsed",a;const P=a.path.match(t);if(P){const R=m.scheme||a.scheme||"urn";a.nid=P[1].toLowerCase(),a.nss=P[2];const T=`${R}:${m.nid||a.nid}`,z=y(T);a.path=void 0,z&&(a=z.parse(a,m))}else a.error=a.error||"URN can not be parsed.";return a}function g(a,m){if(a.nid===void 0)throw new Error("URN without nid cannot be serialized");const P=m.scheme||a.scheme||"urn",R=a.nid.toLowerCase(),T=`${P}:${m.nid||R}`,z=y(T);z&&(a=z.serialize(a,m));const N=a,V=a.nss;return N.path=`${R||m.nid}:${V}`,m.skipEscape=!0,N}function E(a,m){const P=a;return P.uuid=P.nss,P.nss=void 0,!m.tolerant&&(!P.uuid||!e(P.uuid))&&(P.error=P.error||"UUID is not valid."),P}function v(a){const m=a;return m.nss=(a.uuid||"").toLowerCase(),m}const _={scheme:"http",domainHost:!0,parse:n,serialize:u},b={scheme:"https",domainHost:_.domainHost,parse:n,serialize:u},w={scheme:"ws",domainHost:!0,parse:i,serialize:f},d={scheme:"wss",domainHost:w.domainHost,parse:w.parse,serialize:w.serialize},c={http:_,https:b,ws:w,wss:d,urn:{scheme:"urn",parse:$,serialize:g,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:E,serialize:v,skipNormalize:!0}};Object.setPrototypeOf(c,null);function y(a){return a&&(c[a]||c[a.toLowerCase()])||void 0}return Wt={wsIsSecure:h,SCHEMES:c,isValidSchemeName:o,getSchemeHandler:y},Wt}var Rr;function bs(){if(Rr)return Ce.exports;Rr=1;const{normalizeIPv6:e,removeDotSegments:t,recomposeAuthority:r,normalizeComponentEncoding:o,isIPv4:h,nonSimpleDomain:n}=On(),{SCHEMES:u,getSchemeHandler:i}=$s();function f(d,l){return typeof d=="string"?d=v(b(d,l),l):typeof d=="object"&&(d=b(v(d,l),l)),d}function $(d,l,s){const c=s?Object.assign({scheme:"null"},s):{scheme:"null"},y=g(b(d,c),b(l,c),c,!0);return c.skipEscape=!0,v(y,c)}function g(d,l,s,c){const y={};return c||(d=b(v(d,s),s),l=b(v(l,s),s)),s=s||{},!s.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):((d.userinfo!==void 0||d.host!==void 0||d.port!==void 0)&&!d.path?y.path="/"+l.path:d.path?y.path=d.path.slice(0,d.path.lastIndexOf("/")+1)+l.path:y.path=l.path,y.path=t(y.path)),y.query=l.query):(y.path=d.path,l.query!==void 0?y.query=l.query:y.query=d.query),y.userinfo=d.userinfo,y.host=d.host,y.port=d.port),y.scheme=d.scheme),y.fragment=l.fragment,y}function E(d,l,s){return typeof d=="string"?(d=unescape(d),d=v(o(b(d,s),!0),{...s,skipEscape:!0})):typeof d=="object"&&(d=v(o(d,!0),{...s,skipEscape:!0})),typeof l=="string"?(l=unescape(l),l=v(o(b(l,s),!0),{...s,skipEscape:!0})):typeof l=="object"&&(l=v(o(l,!0),{...s,skipEscape:!0})),d.toLowerCase()===l.toLowerCase()}function v(d,l){const s={host:d.host,scheme:d.scheme,userinfo:d.userinfo,port:d.port,path:d.path,query:d.query,nid:d.nid,nss:d.nss,uuid:d.uuid,fragment:d.fragment,reference:d.reference,resourceName:d.resourceName,secure:d.secure,error:""},c=Object.assign({},l),y=[],a=i(c.scheme||s.scheme);a&&a.serialize&&a.serialize(s,c),s.path!==void 0&&(c.skipEscape?s.path=unescape(s.path):(s.path=escape(s.path),s.scheme!==void 0&&(s.path=s.path.split("%3A").join(":")))),c.reference!=="suffix"&&s.scheme&&y.push(s.scheme,":");const m=r(s);if(m!==void 0&&(c.reference!=="suffix"&&y.push("//"),y.push(m),s.path&&s.path[0]!=="/"&&y.push("/")),s.path!==void 0){let P=s.path;!c.absolutePath&&(!a||!a.absolutePath)&&(P=t(P)),m===void 0&&P[0]==="/"&&P[1]==="/"&&(P="/%2F"+P.slice(2)),y.push(P)}return s.query!==void 0&&y.push("?",s.query),s.fragment!==void 0&&y.push("#",s.fragment),y.join("")}const _=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function b(d,l){const s=Object.assign({},l),c={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let y=!1;s.reference==="suffix"&&(s.scheme?d=s.scheme+":"+d:d="//"+d);const a=d.match(_);if(a){if(c.scheme=a[1],c.userinfo=a[3],c.host=a[4],c.port=parseInt(a[5],10),c.path=a[6]||"",c.query=a[7],c.fragment=a[8],isNaN(c.port)&&(c.port=a[5]),c.host)if(h(c.host)===!1){const R=e(c.host);c.host=R.host.toLowerCase(),y=R.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",s.reference&&s.reference!=="suffix"&&s.reference!==c.reference&&(c.error=c.error||"URI is not a "+s.reference+" reference.");const m=i(s.scheme||c.scheme);if(!s.unicodeSupport&&(!m||!m.unicodeSupport)&&c.host&&(s.domainHost||m&&m.domainHost)&&y===!1&&n(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}(!m||m&&!m.skipNormalize)&&(d.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)))),m&&m.parse&&m.parse(c,s)}else c.error=c.error||"URI can not be parsed.";return c}const w={SCHEMES:u,normalize:f,resolve:$,resolveComponent:g,equal:E,serialize:v,parse:b};return Ce.exports=w,Ce.exports.default=w,Ce.exports.fastUri=w,Ce.exports}var Cr;function ws(){if(Cr)return Fe;Cr=1,Object.defineProperty(Fe,"__esModule",{value:!0});const e=bs();return e.code='require("ajv/dist/runtime/uri").default',Fe.default=e,Fe}var Nr;function Ps(){return Nr||(Nr=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=qt();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=G();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=Xt(),h=Dt(),n=kn(),u=xt(),i=G(),f=Nt(),$=Pt(),g=Y(),E=_s,v=ws(),_=(M,j)=>new RegExp(M,j);_.code="new RegExp";const b=["removeAdditional","useDefaults","coerceTypes"],w=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),d={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.'},s=200;function c(M){var j,D,O,p,S,C,U,J,Z,B,k,I,q,A,K,W,re,pe,ce,de,ne,ke,le,Mt,At;const Oe=M.strict,Vt=(j=M.code)===null||j===void 0?void 0:j.optimize,sr=Vt===!0||Vt===void 0?1:Vt||0,ir=(O=(D=M.code)===null||D===void 0?void 0:D.regExp)!==null&&O!==void 0?O:_,as=(p=M.uriResolver)!==null&&p!==void 0?p:v.default;return{strictSchema:(C=(S=M.strictSchema)!==null&&S!==void 0?S:Oe)!==null&&C!==void 0?C:!0,strictNumbers:(J=(U=M.strictNumbers)!==null&&U!==void 0?U:Oe)!==null&&J!==void 0?J:!0,strictTypes:(B=(Z=M.strictTypes)!==null&&Z!==void 0?Z:Oe)!==null&&B!==void 0?B:"log",strictTuples:(I=(k=M.strictTuples)!==null&&k!==void 0?k:Oe)!==null&&I!==void 0?I:"log",strictRequired:(A=(q=M.strictRequired)!==null&&q!==void 0?q:Oe)!==null&&A!==void 0?A:!1,code:M.code?{...M.code,optimize:sr,regExp:ir}:{optimize:sr,regExp:ir},loopRequired:(K=M.loopRequired)!==null&&K!==void 0?K:s,loopEnum:(W=M.loopEnum)!==null&&W!==void 0?W:s,meta:(re=M.meta)!==null&&re!==void 0?re:!0,messages:(pe=M.messages)!==null&&pe!==void 0?pe:!0,inlineRefs:(ce=M.inlineRefs)!==null&&ce!==void 0?ce:!0,schemaId:(de=M.schemaId)!==null&&de!==void 0?de:"$id",addUsedSchema:(ne=M.addUsedSchema)!==null&&ne!==void 0?ne:!0,validateSchema:(ke=M.validateSchema)!==null&&ke!==void 0?ke:!0,validateFormats:(le=M.validateFormats)!==null&&le!==void 0?le:!0,unicodeRegExp:(Mt=M.unicodeRegExp)!==null&&Mt!==void 0?Mt:!0,int32range:(At=M.int32range)!==null&&At!==void 0?At:!0,uriResolver:as}}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:D,lines:O}=this.opts.code;this.scope=new i.ValueScope({scope:{},prefixes:w,es5:D,lines:O}),this.logger=V(j.logger);const p=j.validateFormats;j.validateFormats=!1,this.RULES=(0,n.getRules)(),a.call(this,d,j,"NOT SUPPORTED"),a.call(this,l,j,"DEPRECATED","warn"),this._metaOpts=z.call(this),j.formats&&R.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),j.keywords&&T.call(this,j.keywords),typeof j.meta=="object"&&this.addMetaSchema(j.meta),P.call(this),j.validateFormats=p}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:j,meta:D,schemaId:O}=this.opts;let p=E;O==="id"&&(p={...E},p.id=p.$id,delete p.$id),D&&j&&this.addMetaSchema(p,p[O],!1)}defaultMeta(){const{meta:j,schemaId:D}=this.opts;return this.opts.defaultMeta=typeof j=="object"?j[D]||j:void 0}validate(j,D){let O;if(typeof j=="string"){if(O=this.getSchema(j),!O)throw new Error(`no schema with key or ref "${j}"`)}else O=this.compile(j);const p=O(D);return"$async"in O||(this.errors=O.errors),p}compile(j,D){const O=this._addSchema(j,D);return O.validate||this._compileSchemaEnv(O)}compileAsync(j,D){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:O}=this.opts;return p.call(this,j,D);async function p(B,k){await S.call(this,B.$schema);const I=this._addSchema(B,k);return I.validate||C.call(this,I)}async function S(B){B&&!this.getSchema(B)&&await p.call(this,{$ref:B},!0)}async function C(B){try{return this._compileSchemaEnv(B)}catch(k){if(!(k instanceof h.default))throw k;return U.call(this,k),await J.call(this,k.missingSchema),C.call(this,B)}}function U({missingSchema:B,missingRef:k}){if(this.refs[B])throw new Error(`AnySchema ${B} is loaded but ${k} cannot be resolved`)}async function J(B){const k=await Z.call(this,B);this.refs[B]||await S.call(this,k.$schema),this.refs[B]||this.addSchema(k,B,D)}async function Z(B){const k=this._loading[B];if(k)return k;try{return await(this._loading[B]=O(B))}finally{delete this._loading[B]}}}addSchema(j,D,O,p=this.opts.validateSchema){if(Array.isArray(j)){for(const C of j)this.addSchema(C,void 0,O,p);return this}let S;if(typeof j=="object"){const{schemaId:C}=this.opts;if(S=j[C],S!==void 0&&typeof S!="string")throw new Error(`schema ${C} must be string`)}return D=(0,f.normalizeId)(D||S),this._checkUnique(D),this.schemas[D]=this._addSchema(j,O,D,p,!0),this}addMetaSchema(j,D,O=this.opts.validateSchema){return this.addSchema(j,D,!0,O),this}validateSchema(j,D){if(typeof j=="boolean")return!0;let O;if(O=j.$schema,O!==void 0&&typeof O!="string")throw new Error("$schema must be a string");if(O=O||this.opts.defaultMeta||this.defaultMeta(),!O)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const p=this.validate(O,j);if(!p&&D){const S="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(S);else throw new Error(S)}return p}getSchema(j){let D;for(;typeof(D=m.call(this,j))=="string";)j=D;if(D===void 0){const{schemaId:O}=this.opts,p=new u.SchemaEnv({schema:{},schemaId:O});if(D=u.resolveSchema.call(this,p,j),!D)return;this.refs[j]=D}return D.validate||this._compileSchemaEnv(D)}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 D=m.call(this,j);return typeof D=="object"&&this._cache.delete(D.schema),delete this.schemas[j],delete this.refs[j],this}case"object":{const D=j;this._cache.delete(D);let O=j[this.opts.schemaId];return O&&(O=(0,f.normalizeId)(O),delete this.schemas[O],delete this.refs[O]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(j){for(const D of j)this.addKeyword(D);return this}addKeyword(j,D){let O;if(typeof j=="string")O=j,typeof D=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),D.keyword=O);else if(typeof j=="object"&&D===void 0){if(D=j,O=D.keyword,Array.isArray(O)&&!O.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(L.call(this,O,D),!D)return(0,g.eachItem)(O,S=>Q.call(this,S)),this;oe.call(this,D);const p={...D,type:(0,$.getJSONTypes)(D.type),schemaType:(0,$.getJSONTypes)(D.schemaType)};return(0,g.eachItem)(O,p.type.length===0?S=>Q.call(this,S,p):S=>p.type.forEach(C=>Q.call(this,S,p,C))),this}getKeyword(j){const D=this.RULES.all[j];return typeof D=="object"?D.definition:!!D}removeKeyword(j){const{RULES:D}=this;delete D.keywords[j],delete D.all[j];for(const O of D.rules){const p=O.rules.findIndex(S=>S.keyword===j);p>=0&&O.rules.splice(p,1)}return this}addFormat(j,D){return typeof D=="string"&&(D=new RegExp(D)),this.formats[j]=D,this}errorsText(j=this.errors,{separator:D=", ",dataVar:O="data"}={}){return!j||j.length===0?"No errors":j.map(p=>`${O}${p.instancePath} ${p.message}`).reduce((p,S)=>p+D+S)}$dataMetaSchema(j,D){const O=this.RULES.all;j=JSON.parse(JSON.stringify(j));for(const p of D){const S=p.split("/").slice(1);let C=j;for(const U of S)C=C[U];for(const U in O){const J=O[U];if(typeof J!="object")continue;const{$data:Z}=J.definition,B=C[U];Z&&B&&(C[U]=fe(B))}}return j}_removeAllSchemas(j,D){for(const O in j){const p=j[O];(!D||D.test(O))&&(typeof p=="string"?delete j[O]:p&&!p.meta&&(this._cache.delete(p.schema),delete j[O]))}}_addSchema(j,D,O,p=this.opts.validateSchema,S=this.opts.addUsedSchema){let C;const{schemaId:U}=this.opts;if(typeof j=="object")C=j[U];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof j!="boolean")throw new Error("schema must be object or boolean")}let J=this._cache.get(j);if(J!==void 0)return J;O=(0,f.normalizeId)(C||O);const Z=f.getSchemaRefs.call(this,j,O);return J=new u.SchemaEnv({schema:j,schemaId:U,meta:D,baseId:O,localRefs:Z}),this._cache.set(J.schema,J),S&&!O.startsWith("#")&&(O&&this._checkUnique(O),this.refs[O]=J),p&&this.validateSchema(j,!0),J}_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):u.compileSchema.call(this,j),!j.validate)throw new Error("ajv implementation error");return j.validate}_compileMetaSchema(j){const D=this.opts;this.opts=this._metaOpts;try{u.compileSchema.call(this,j)}finally{this.opts=D}}}y.ValidationError=o.default,y.MissingRefError=h.default,e.default=y;function a(M,j,D,O="error"){for(const p in M){const S=p;S in j&&this.logger[O](`${D}: option ${p}. ${M[S]}`)}}function m(M){return M=(0,f.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 R(){for(const M in this.opts.formats){const j=this.opts.formats[M];j&&this.addFormat(M,j)}}function T(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 D=M[j];D.keyword||(D.keyword=j),this.addKeyword(D)}}function z(){const M={...this.opts};for(const j of b)delete M[j];return M}const N={log(){},warn(){},error(){}};function V(M){if(M===!1)return N;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:D}=this;if((0,g.eachItem)(M,O=>{if(D.keywords[O])throw new Error(`Keyword ${O} is already defined`);if(!F.test(O))throw new Error(`Keyword ${O} has invalid name`)}),!!j&&j.$data&&!("code"in j||"validate"in j))throw new Error('$data keyword must have "code" or "validate" function')}function Q(M,j,D){var O;const p=j?.post;if(D&&p)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:S}=this;let C=p?S.post:S.rules.find(({type:J})=>J===D);if(C||(C={type:D,rules:[]},S.rules.push(C)),S.keywords[M]=!0,!j)return;const U={keyword:M,definition:{...j,type:(0,$.getJSONTypes)(j.type),schemaType:(0,$.getJSONTypes)(j.schemaType)}};j.before?ie.call(this,C,U,j.before):C.rules.push(U),S.all[M]=U,(O=j.implements)===null||O===void 0||O.forEach(J=>this.addKeyword(J))}function ie(M,j,D){const O=M.rules.findIndex(p=>p.keyword===D);O>=0?M.rules.splice(O,0,j):(M.rules.push(j),this.logger.warn(`rule ${D} is not defined`))}function oe(M){let{metaSchema:j}=M;j!==void 0&&(M.$data&&this.opts.$data&&(j=fe(j)),M.validateSchema=this.compile(j,!0))}const x={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function fe(M){return{anyOf:[M,x]}}})(zt)),zt}var Le={},Ue={},Ke={},qr;function Ss(){if(qr)return Ke;qr=1,Object.defineProperty(Ke,"__esModule",{value:!0});const e={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};return Ke.default=e,Ke}var $e={},Dr;function Es(){if(Dr)return $e;Dr=1,Object.defineProperty($e,"__esModule",{value:!0}),$e.callRef=$e.getValidate=void 0;const e=Dt(),t=ye(),r=G(),o=we(),h=xt(),n=Y(),u={keyword:"$ref",schemaType:"string",code($){const{gen:g,schema:E,it:v}=$,{baseId:_,schemaEnv:b,validateName:w,opts:d,self:l}=v,{root:s}=b;if((E==="#"||E==="#/")&&_===s.baseId)return y();const c=h.resolveRef.call(l,s,_,E);if(c===void 0)throw new e.default(v.opts.uriResolver,_,E);if(c instanceof h.SchemaEnv)return a(c);return m(c);function y(){if(b===s)return f($,w,b,b.$async);const P=g.scopeValue("root",{ref:s});return f($,(0,r._)`${P}.validate`,s,s.$async)}function a(P){const R=i($,P);f($,R,P,P.$async)}function m(P){const R=g.scopeValue("schema",d.code.source===!0?{ref:P,code:(0,r.stringify)(P)}:{ref:P}),T=g.name("valid"),z=$.subschema({schema:P,dataTypes:[],schemaPath:r.nil,topSchemaRef:R,errSchemaPath:E},T);$.mergeEvaluated(z),$.ok(T)}}};function i($,g){const{gen:E}=$;return g.validate?E.scopeValue("validate",{ref:g.validate}):(0,r._)`${E.scopeValue("wrapper",{ref:g})}.validate`}$e.getValidate=i;function f($,g,E,v){const{gen:_,it:b}=$,{allErrors:w,schemaEnv:d,opts:l}=b,s=l.passContext?o.default.this:r.nil;v?c():y();function c(){if(!d.$async)throw new Error("async schema referenced by sync schema");const P=_.let("valid");_.try(()=>{_.code((0,r._)`await ${(0,t.callValidateCode)($,g,s)}`),m(g),w||_.assign(P,!0)},R=>{_.if((0,r._)`!(${R} instanceof ${b.ValidationError})`,()=>_.throw(R)),a(R),w||_.assign(P,!1)}),$.ok(P)}function y(){$.result((0,t.callValidateCode)($,g,s),()=>m(g),()=>a(g))}function a(P){const R=(0,r._)`${P}.errors`;_.assign(o.default.vErrors,(0,r._)`${o.default.vErrors} === null ? ${R} : ${o.default.vErrors}.concat(${R})`),_.assign(o.default.errors,(0,r._)`${o.default.vErrors}.length`)}function m(P){var R;if(!b.opts.unevaluated)return;const T=(R=E?.validate)===null||R===void 0?void 0:R.evaluated;if(b.props!==!0)if(T&&!T.dynamicProps)T.props!==void 0&&(b.props=n.mergeEvaluated.props(_,T.props,b.props));else{const z=_.var("props",(0,r._)`${P}.evaluated.props`);b.props=n.mergeEvaluated.props(_,z,b.props,r.Name)}if(b.items!==!0)if(T&&!T.dynamicItems)T.items!==void 0&&(b.items=n.mergeEvaluated.items(_,T.items,b.items));else{const z=_.var("items",(0,r._)`${P}.evaluated.items`);b.items=n.mergeEvaluated.items(_,z,b.items,r.Name)}}}return $e.callRef=f,$e.default=u,$e}var Tr;function ks(){if(Tr)return Ue;Tr=1,Object.defineProperty(Ue,"__esModule",{value:!0});const e=Ss(),t=Es(),r=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,t.default];return Ue.default=r,Ue}var Je={},He={},Mr;function js(){if(Mr)return He;Mr=1,Object.defineProperty(He,"__esModule",{value:!0});const e=G(),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:n,schemaCode:u})=>(0,e.str)`must be ${r[n].okStr} ${u}`,params:({keyword:n,schemaCode:u})=>(0,e._)`{comparison: ${r[n].okStr}, limit: ${u}}`},h={keyword:Object.keys(r),type:"number",schemaType:"number",$data:!0,error:o,code(n){const{keyword:u,data:i,schemaCode:f}=n;n.fail$data((0,e._)`${i} ${r[u].fail} ${f} || isNaN(${i})`)}};return He.default=h,He}var Ge={},Ar;function Is(){if(Ar)return Ge;Ar=1,Object.defineProperty(Ge,"__esModule",{value:!0});const e=G(),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:h,data:n,schemaCode:u,it:i}=o,f=i.opts.multipleOfPrecision,$=h.let("res"),g=f?(0,e._)`Math.abs(Math.round(${$}) - ${$}) > 1e-${f}`:(0,e._)`${$} !== parseInt(${$})`;o.fail$data((0,e._)`(${u} === 0 || (${$} = ${n}/${u}, ${g}))`)}};return Ge.default=r,Ge}var We={},Be={},Vr;function Os(){if(Vr)return Be;Vr=1,Object.defineProperty(Be,"__esModule",{value:!0});function e(t){const r=t.length;let o=0,h=0,n;for(;h<r;)o++,n=t.charCodeAt(h++),n>=55296&&n<=56319&&h<r&&(n=t.charCodeAt(h),(n&64512)===56320&&h++);return o}return Be.default=e,e.code='require("ajv/dist/runtime/ucs2length").default',Be}var zr;function Rs(){if(zr)return We;zr=1,Object.defineProperty(We,"__esModule",{value:!0});const e=G(),t=Y(),r=Os(),h={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:n,schemaCode:u}){const i=n==="maxLength"?"more":"fewer";return(0,e.str)`must NOT have ${i} than ${u} characters`},params:({schemaCode:n})=>(0,e._)`{limit: ${n}}`},code(n){const{keyword:u,data:i,schemaCode:f,it:$}=n,g=u==="maxLength"?e.operators.GT:e.operators.LT,E=$.opts.unicode===!1?(0,e._)`${i}.length`:(0,e._)`${(0,t.useFunc)(n.gen,r.default)}(${i})`;n.fail$data((0,e._)`${E} ${g} ${f}`)}};return We.default=h,We}var Ye={},Fr;function Cs(){if(Fr)return Ye;Fr=1,Object.defineProperty(Ye,"__esModule",{value:!0});const e=ye(),t=G(),o={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:h})=>(0,t.str)`must match pattern "${h}"`,params:({schemaCode:h})=>(0,t._)`{pattern: ${h}}`},code(h){const{data:n,$data:u,schema:i,schemaCode:f,it:$}=h,g=$.opts.unicodeRegExp?"u":"",E=u?(0,t._)`(new RegExp(${f}, ${g}))`:(0,e.usePattern)(h,i);h.fail$data((0,t._)`!${E}.test(${n})`)}};return Ye.default=o,Ye}var Ze={},Lr;function Ns(){if(Lr)return Ze;Lr=1,Object.defineProperty(Ze,"__esModule",{value:!0});const e=G(),r={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:o,schemaCode:h}){const n=o==="maxProperties"?"more":"fewer";return(0,e.str)`must NOT have ${n} than ${h} properties`},params:({schemaCode:o})=>(0,e._)`{limit: ${o}}`},code(o){const{keyword:h,data:n,schemaCode:u}=o,i=h==="maxProperties"?e.operators.GT:e.operators.LT;o.fail$data((0,e._)`Object.keys(${n}).length ${i} ${u}`)}};return Ze.default=r,Ze}var Qe={},Ur;function qs(){if(Ur)return Qe;Ur=1,Object.defineProperty(Qe,"__esModule",{value:!0});const e=ye(),t=G(),r=Y(),h={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:n}})=>(0,t.str)`must have required property '${n}'`,params:({params:{missingProperty:n}})=>(0,t._)`{missingProperty: ${n}}`},code(n){const{gen:u,schema:i,schemaCode:f,data:$,$data:g,it:E}=n,{opts:v}=E;if(!g&&i.length===0)return;const _=i.length>=v.loopRequired;if(E.allErrors?b():w(),v.strictRequired){const s=n.parentSchema.properties,{definedProperties:c}=n.it;for(const y of i)if(s?.[y]===void 0&&!c.has(y)){const a=E.schemaEnv.baseId+E.errSchemaPath,m=`required property "${y}" is not defined at "${a}" (strictRequired)`;(0,r.checkStrictMode)(E,m,E.opts.strictRequired)}}function b(){if(_||g)n.block$data(t.nil,d);else for(const s of i)(0,e.checkReportMissingProp)(n,s)}function w(){const s=u.let("missing");if(_||g){const c=u.let("valid",!0);n.block$data(c,()=>l(s,c)),n.ok(c)}else u.if((0,e.checkMissingProp)(n,i,s)),(0,e.reportMissingProp)(n,s),u.else()}function d(){u.forOf("prop",f,s=>{n.setParams({missingProperty:s}),u.if((0,e.noPropertyInData)(u,$,s,v.ownProperties),()=>n.error())})}function l(s,c){n.setParams({missingProperty:s}),u.forOf(s,f,()=>{u.assign(c,(0,e.propertyInData)(u,$,s,v.ownProperties)),u.if((0,t.not)(c),()=>{n.error(),u.break()})},t.nil)}}};return Qe.default=h,Qe}var Xe={},Kr;function Ds(){if(Kr)return Xe;Kr=1,Object.defineProperty(Xe,"__esModule",{value:!0});const e=G(),r={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:o,schemaCode:h}){const n=o==="maxItems"?"more":"fewer";return(0,e.str)`must NOT have ${n} than ${h} items`},params:({schemaCode:o})=>(0,e._)`{limit: ${o}}`},code(o){const{keyword:h,data:n,schemaCode:u}=o,i=h==="maxItems"?e.operators.GT:e.operators.LT;o.fail$data((0,e._)`${n}.length ${i} ${u}`)}};return Xe.default=r,Xe}var xe={},et={},Jr;function er(){if(Jr)return et;Jr=1,Object.defineProperty(et,"__esModule",{value:!0});const e=In();return e.code='require("ajv/dist/runtime/equal").default',et.default=e,et}var Hr;function Ts(){if(Hr)return xe;Hr=1,Object.defineProperty(xe,"__esModule",{value:!0});const e=Pt(),t=G(),r=Y(),o=er(),n={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:u,j:i}})=>(0,t.str)`must NOT have duplicate items (items ## ${i} and ${u} are identical)`,params:({params:{i:u,j:i}})=>(0,t._)`{i: ${u}, j: ${i}}`},code(u){const{gen:i,data:f,$data:$,schema:g,parentSchema:E,schemaCode:v,it:_}=u;if(!$&&!g)return;const b=i.let("valid"),w=E.items?(0,e.getSchemaTypes)(E.items):[];u.block$data(b,d,(0,t._)`${v} === false`),u.ok(b);function d(){const y=i.let("i",(0,t._)`${f}.length`),a=i.let("j");u.setParams({i:y,j:a}),i.assign(b,!0),i.if((0,t._)`${y} > 1`,()=>(l()?s:c)(y,a))}function l(){return w.length>0&&!w.some(y=>y==="object"||y==="array")}function s(y,a){const m=i.name("item"),P=(0,e.checkDataTypes)(w,m,_.opts.strictNumbers,e.DataType.Wrong),R=i.const("indices",(0,t._)`{}`);i.for((0,t._)`;${y}--;`,()=>{i.let(m,(0,t._)`${f}[${y}]`),i.if(P,(0,t._)`continue`),w.length>1&&i.if((0,t._)`typeof ${m} == "string"`,(0,t._)`${m} += "_"`),i.if((0,t._)`typeof ${R}[${m}] == "number"`,()=>{i.assign(a,(0,t._)`${R}[${m}]`),u.error(),i.assign(b,!1).break()}).code((0,t._)`${R}[${m}] = ${y}`)})}function c(y,a){const m=(0,r.useFunc)(i,o.default),P=i.name("outer");i.label(P).for((0,t._)`;${y}--;`,()=>i.for((0,t._)`${a} = ${y}; ${a}--;`,()=>i.if((0,t._)`${m}(${f}[${y}], ${f}[${a}])`,()=>{u.error(),i.assign(b,!1).break(P)})))}}};return xe.default=n,xe}var tt={},Gr;function Ms(){if(Gr)return tt;Gr=1,Object.defineProperty(tt,"__esModule",{value:!0});const e=G(),t=Y(),r=er(),h={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:n})=>(0,e._)`{allowedValue: ${n}}`},code(n){const{gen:u,data:i,$data:f,schemaCode:$,schema:g}=n;f||g&&typeof g=="object"?n.fail$data((0,e._)`!${(0,t.useFunc)(u,r.default)}(${i}, ${$})`):n.fail((0,e._)`${g} !== ${i}`)}};return tt.default=h,tt}var rt={},Wr;function As(){if(Wr)return rt;Wr=1,Object.defineProperty(rt,"__esModule",{value:!0});const e=G(),t=Y(),r=er(),h={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:n})=>(0,e._)`{allowedValues: ${n}}`},code(n){const{gen:u,data:i,$data:f,schema:$,schemaCode:g,it:E}=n;if(!f&&$.length===0)throw new Error("enum must have non-empty array");const v=$.length>=E.opts.loopEnum;let _;const b=()=>_??(_=(0,t.useFunc)(u,r.default));let w;if(v||f)w=u.let("valid"),n.block$data(w,d);else{if(!Array.isArray($))throw new Error("ajv implementation error");const s=u.const("vSchema",g);w=(0,e.or)(...$.map((c,y)=>l(s,y)))}n.pass(w);function d(){u.assign(w,!1),u.forOf("v",g,s=>u.if((0,e._)`${b()}(${i}, ${s})`,()=>u.assign(w,!0).break()))}function l(s,c){const y=$[c];return typeof y=="object"&&y!==null?(0,e._)`${b()}(${i}, ${s}[${c}])`:(0,e._)`${i} === ${y}`}}};return rt.default=h,rt}var Br;function Vs(){if(Br)return Je;Br=1,Object.defineProperty(Je,"__esModule",{value:!0});const e=js(),t=Is(),r=Rs(),o=Cs(),h=Ns(),n=qs(),u=Ds(),i=Ts(),f=Ms(),$=As(),g=[e.default,t.default,r.default,o.default,h.default,n.default,u.default,i.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},f.default,$.default];return Je.default=g,Je}var nt={},je={},Yr;function Rn(){if(Yr)return je;Yr=1,Object.defineProperty(je,"__esModule",{value:!0}),je.validateAdditionalItems=void 0;const e=G(),t=Y(),o={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:n}})=>(0,e.str)`must NOT have more than ${n} items`,params:({params:{len:n}})=>(0,e._)`{limit: ${n}}`},code(n){const{parentSchema:u,it:i}=n,{items:f}=u;if(!Array.isArray(f)){(0,t.checkStrictMode)(i,'"additionalItems" is ignored when "items" is not an array of schemas');return}h(n,f)}};function h(n,u){const{gen:i,schema:f,data:$,keyword:g,it:E}=n;E.items=!0;const v=i.const("len",(0,e._)`${$}.length`);if(f===!1)n.setParams({len:u.length}),n.pass((0,e._)`${v} <= ${u.length}`);else if(typeof f=="object"&&!(0,t.alwaysValidSchema)(E,f)){const b=i.var("valid",(0,e._)`${v} <= ${u.length}`);i.if((0,e.not)(b),()=>_(b)),n.ok(b)}function _(b){i.forRange("i",u.length,v,w=>{n.subschema({keyword:g,dataProp:w,dataPropType:t.Type.Num},b),E.allErrors||i.if((0,e.not)(b),()=>i.break())})}}return je.validateAdditionalItems=h,je.default=o,je}var st={},Ie={},Zr;function Cn(){if(Zr)return Ie;Zr=1,Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.validateTuple=void 0;const e=G(),t=Y(),r=ye(),o={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(n){const{schema:u,it:i}=n;if(Array.isArray(u))return h(n,"additionalItems",u);i.items=!0,!(0,t.alwaysValidSchema)(i,u)&&n.ok((0,r.validateArray)(n))}};function h(n,u,i=n.schema){const{gen:f,parentSchema:$,data:g,keyword:E,it:v}=n;w($),v.opts.unevaluated&&i.length&&v.items!==!0&&(v.items=t.mergeEvaluated.items(f,i.length,v.items));const _=f.name("valid"),b=f.const("len",(0,e._)`${g}.length`);i.forEach((d,l)=>{(0,t.alwaysValidSchema)(v,d)||(f.if((0,e._)`${b} > ${l}`,()=>n.subschema({keyword:E,schemaProp:l,dataProp:l},_)),n.ok(_))});function w(d){const{opts:l,errSchemaPath:s}=v,c=i.length,y=c===d.minItems&&(c===d.maxItems||d[u]===!1);if(l.strictTuples&&!y){const a=`"${E}" is ${c}-tuple, but minItems or maxItems/${u} are not specified or different at path "${s}"`;(0,t.checkStrictMode)(v,a,l.strictTuples)}}}return Ie.validateTuple=h,Ie.default=o,Ie}var Qr;function zs(){if(Qr)return st;Qr=1,Object.defineProperty(st,"__esModule",{value:!0});const e=Cn(),t={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:r=>(0,e.validateTuple)(r,"items")};return st.default=t,st}var it={},Xr;function Fs(){if(Xr)return it;Xr=1,Object.defineProperty(it,"__esModule",{value:!0});const e=G(),t=Y(),r=ye(),o=Rn(),n={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:u}})=>(0,e.str)`must NOT have more than ${u} items`,params:({params:{len:u}})=>(0,e._)`{limit: ${u}}`},code(u){const{schema:i,parentSchema:f,it:$}=u,{prefixItems:g}=f;$.items=!0,!(0,t.alwaysValidSchema)($,i)&&(g?(0,o.validateAdditionalItems)(u,g):u.ok((0,r.validateArray)(u)))}};return it.default=n,it}var ot={},xr;function Ls(){if(xr)return ot;xr=1,Object.defineProperty(ot,"__esModule",{value:!0});const e=G(),t=Y(),o={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:h,max:n}})=>n===void 0?(0,e.str)`must contain at least ${h} valid item(s)`:(0,e.str)`must contain at least ${h} and no more than ${n} valid item(s)`,params:({params:{min:h,max:n}})=>n===void 0?(0,e._)`{minContains: ${h}}`:(0,e._)`{minContains: ${h}, maxContains: ${n}}`},code(h){const{gen:n,schema:u,parentSchema:i,data:f,it:$}=h;let g,E;const{minContains:v,maxContains:_}=i;$.opts.next?(g=v===void 0?1:v,E=_):g=1;const b=n.const("len",(0,e._)`${f}.length`);if(h.setParams({min:g,max:E}),E===void 0&&g===0){(0,t.checkStrictMode)($,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(E!==void 0&&g>E){(0,t.checkStrictMode)($,'"minContains" > "maxContains" is always invalid'),h.fail();return}if((0,t.alwaysValidSchema)($,u)){let c=(0,e._)`${b} >= ${g}`;E!==void 0&&(c=(0,e._)`${c} && ${b} <= ${E}`),h.pass(c);return}$.items=!0;const w=n.name("valid");E===void 0&&g===1?l(w,()=>n.if(w,()=>n.break())):g===0?(n.let(w,!0),E!==void 0&&n.if((0,e._)`${f}.length > 0`,d)):(n.let(w,!1),d()),h.result(w,()=>h.reset());function d(){const c=n.name("_valid"),y=n.let("count",0);l(c,()=>n.if(c,()=>s(y)))}function l(c,y){n.forRange("i",0,b,a=>{h.subschema({keyword:"contains",dataProp:a,dataPropType:t.Type.Num,compositeRule:!0},c),y()})}function s(c){n.code((0,e._)`${c}++`),E===void 0?n.if((0,e._)`${c} >= ${g}`,()=>n.assign(w,!0).break()):(n.if((0,e._)`${c} > ${E}`,()=>n.assign(w,!1).break()),g===1?n.assign(w,!0):n.if((0,e._)`${c} >= ${g}`,()=>n.assign(w,!0)))}}};return ot.default=o,ot}var Bt={},en;function Us(){return en||(en=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=G(),r=Y(),o=ye();e.error={message:({params:{property:f,depsCount:$,deps:g}})=>{const E=$===1?"property":"properties";return(0,t.str)`must have ${E} ${g} when property ${f} is present`},params:({params:{property:f,depsCount:$,deps:g,missingProperty:E}})=>(0,t._)`{property: ${f},
|
|
6
|
+
missingProperty: ${E},
|
|
7
|
+
depsCount: ${$},
|
|
8
|
+
deps: ${g}}`};const h={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(f){const[$,g]=n(f);u(f,$),i(f,g)}};function n({schema:f}){const $={},g={};for(const E in f){if(E==="__proto__")continue;const v=Array.isArray(f[E])?$:g;v[E]=f[E]}return[$,g]}function u(f,$=f.schema){const{gen:g,data:E,it:v}=f;if(Object.keys($).length===0)return;const _=g.let("missing");for(const b in $){const w=$[b];if(w.length===0)continue;const d=(0,o.propertyInData)(g,E,b,v.opts.ownProperties);f.setParams({property:b,depsCount:w.length,deps:w.join(", ")}),v.allErrors?g.if(d,()=>{for(const l of w)(0,o.checkReportMissingProp)(f,l)}):(g.if((0,t._)`${d} && (${(0,o.checkMissingProp)(f,w,_)})`),(0,o.reportMissingProp)(f,_),g.else())}}e.validatePropertyDeps=u;function i(f,$=f.schema){const{gen:g,data:E,keyword:v,it:_}=f,b=g.name("valid");for(const w in $)(0,r.alwaysValidSchema)(_,$[w])||(g.if((0,o.propertyInData)(g,E,w,_.opts.ownProperties),()=>{const d=f.subschema({keyword:v,schemaProp:w},b);f.mergeValidEvaluated(d,b)},()=>g.var(b,!0)),f.ok(b))}e.validateSchemaDeps=i,e.default=h})(Bt)),Bt}var at={},tn;function Ks(){if(tn)return at;tn=1,Object.defineProperty(at,"__esModule",{value:!0});const e=G(),t=Y(),o={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:h})=>(0,e._)`{propertyName: ${h.propertyName}}`},code(h){const{gen:n,schema:u,data:i,it:f}=h;if((0,t.alwaysValidSchema)(f,u))return;const $=n.name("valid");n.forIn("key",i,g=>{h.setParams({propertyName:g}),h.subschema({keyword:"propertyNames",data:g,dataTypes:["string"],propertyName:g,compositeRule:!0},$),n.if((0,e.not)($),()=>{h.error(!0),f.allErrors||n.break()})}),h.ok($)}};return at.default=o,at}var ct={},rn;function Nn(){if(rn)return ct;rn=1,Object.defineProperty(ct,"__esModule",{value:!0});const e=ye(),t=G(),r=we(),o=Y(),n={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:u})=>(0,t._)`{additionalProperty: ${u.additionalProperty}}`},code(u){const{gen:i,schema:f,parentSchema:$,data:g,errsCount:E,it:v}=u;if(!E)throw new Error("ajv implementation error");const{allErrors:_,opts:b}=v;if(v.props=!0,b.removeAdditional!=="all"&&(0,o.alwaysValidSchema)(v,f))return;const w=(0,e.allSchemaProperties)($.properties),d=(0,e.allSchemaProperties)($.patternProperties);l(),u.ok((0,t._)`${E} === ${r.default.errors}`);function l(){i.forIn("key",g,m=>{!w.length&&!d.length?y(m):i.if(s(m),()=>y(m))})}function s(m){let P;if(w.length>8){const R=(0,o.schemaRefOrVal)(v,$.properties,"properties");P=(0,e.isOwnProperty)(i,R,m)}else w.length?P=(0,t.or)(...w.map(R=>(0,t._)`${m} === ${R}`)):P=t.nil;return d.length&&(P=(0,t.or)(P,...d.map(R=>(0,t._)`${(0,e.usePattern)(u,R)}.test(${m})`))),(0,t.not)(P)}function c(m){i.code((0,t._)`delete ${g}[${m}]`)}function y(m){if(b.removeAdditional==="all"||b.removeAdditional&&f===!1){c(m);return}if(f===!1){u.setParams({additionalProperty:m}),u.error(),_||i.break();return}if(typeof f=="object"&&!(0,o.alwaysValidSchema)(v,f)){const P=i.name("valid");b.removeAdditional==="failing"?(a(m,P,!1),i.if((0,t.not)(P),()=>{u.reset(),c(m)})):(a(m,P),_||i.if((0,t.not)(P),()=>i.break()))}}function a(m,P,R){const T={keyword:"additionalProperties",dataProp:m,dataPropType:o.Type.Str};R===!1&&Object.assign(T,{compositeRule:!0,createErrors:!1,allErrors:!1}),u.subschema(T,P)}}};return ct.default=n,ct}var dt={},nn;function Js(){if(nn)return dt;nn=1,Object.defineProperty(dt,"__esModule",{value:!0});const e=qt(),t=ye(),r=Y(),o=Nn(),h={keyword:"properties",type:"object",schemaType:"object",code(n){const{gen:u,schema:i,parentSchema:f,data:$,it:g}=n;g.opts.removeAdditional==="all"&&f.additionalProperties===void 0&&o.default.code(new e.KeywordCxt(g,o.default,"additionalProperties"));const E=(0,t.allSchemaProperties)(i);for(const d of E)g.definedProperties.add(d);g.opts.unevaluated&&E.length&&g.props!==!0&&(g.props=r.mergeEvaluated.props(u,(0,r.toHash)(E),g.props));const v=E.filter(d=>!(0,r.alwaysValidSchema)(g,i[d]));if(v.length===0)return;const _=u.name("valid");for(const d of v)b(d)?w(d):(u.if((0,t.propertyInData)(u,$,d,g.opts.ownProperties)),w(d),g.allErrors||u.else().var(_,!0),u.endIf()),n.it.definedProperties.add(d),n.ok(_);function b(d){return g.opts.useDefaults&&!g.compositeRule&&i[d].default!==void 0}function w(d){n.subschema({keyword:"properties",schemaProp:d,dataProp:d},_)}}};return dt.default=h,dt}var ut={},sn;function Hs(){if(sn)return ut;sn=1,Object.defineProperty(ut,"__esModule",{value:!0});const e=ye(),t=G(),r=Y(),o=Y(),h={keyword:"patternProperties",type:"object",schemaType:"object",code(n){const{gen:u,schema:i,data:f,parentSchema:$,it:g}=n,{opts:E}=g,v=(0,e.allSchemaProperties)(i),_=v.filter(y=>(0,r.alwaysValidSchema)(g,i[y]));if(v.length===0||_.length===v.length&&(!g.opts.unevaluated||g.props===!0))return;const b=E.strictSchema&&!E.allowMatchingProperties&&$.properties,w=u.name("valid");g.props!==!0&&!(g.props instanceof t.Name)&&(g.props=(0,o.evaluatedPropsToName)(u,g.props));const{props:d}=g;l();function l(){for(const y of v)b&&s(y),g.allErrors?c(y):(u.var(w,!0),c(y),u.if(w))}function s(y){for(const a in b)new RegExp(y).test(a)&&(0,r.checkStrictMode)(g,`property ${a} matches pattern ${y} (use allowMatchingProperties)`)}function c(y){u.forIn("key",f,a=>{u.if((0,t._)`${(0,e.usePattern)(n,y)}.test(${a})`,()=>{const m=_.includes(y);m||n.subschema({keyword:"patternProperties",schemaProp:y,dataProp:a,dataPropType:o.Type.Str},w),g.opts.unevaluated&&d!==!0?u.assign((0,t._)`${d}[${a}]`,!0):!m&&!g.allErrors&&u.if((0,t.not)(w),()=>u.break())})})}}};return ut.default=h,ut}var lt={},on;function Gs(){if(on)return lt;on=1,Object.defineProperty(lt,"__esModule",{value:!0});const e=Y(),t={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(r){const{gen:o,schema:h,it:n}=r;if((0,e.alwaysValidSchema)(n,h)){r.fail();return}const u=o.name("valid");r.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},u),r.failResult(u,()=>r.reset(),()=>r.error())},error:{message:"must NOT be valid"}};return lt.default=t,lt}var ft={},an;function Ws(){if(an)return ft;an=1,Object.defineProperty(ft,"__esModule",{value:!0});const t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:ye().validateUnion,error:{message:"must match a schema in anyOf"}};return ft.default=t,ft}var pt={},cn;function Bs(){if(cn)return pt;cn=1,Object.defineProperty(pt,"__esModule",{value:!0});const e=G(),t=Y(),o={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:h})=>(0,e._)`{passingSchemas: ${h.passing}}`},code(h){const{gen:n,schema:u,parentSchema:i,it:f}=h;if(!Array.isArray(u))throw new Error("ajv implementation error");if(f.opts.discriminator&&i.discriminator)return;const $=u,g=n.let("valid",!1),E=n.let("passing",null),v=n.name("_valid");h.setParams({passing:E}),n.block(_),h.result(g,()=>h.reset(),()=>h.error(!0));function _(){$.forEach((b,w)=>{let d;(0,t.alwaysValidSchema)(f,b)?n.var(v,!0):d=h.subschema({keyword:"oneOf",schemaProp:w,compositeRule:!0},v),w>0&&n.if((0,e._)`${v} && ${g}`).assign(g,!1).assign(E,(0,e._)`[${E}, ${w}]`).else(),n.if(v,()=>{n.assign(g,!0),n.assign(E,w),d&&h.mergeEvaluated(d,e.Name)})})}}};return pt.default=o,pt}var mt={},dn;function Ys(){if(dn)return mt;dn=1,Object.defineProperty(mt,"__esModule",{value:!0});const e=Y(),t={keyword:"allOf",schemaType:"array",code(r){const{gen:o,schema:h,it:n}=r;if(!Array.isArray(h))throw new Error("ajv implementation error");const u=o.name("valid");h.forEach((i,f)=>{if((0,e.alwaysValidSchema)(n,i))return;const $=r.subschema({keyword:"allOf",schemaProp:f},u);r.ok(u),r.mergeEvaluated($)})}};return mt.default=t,mt}var ht={},un;function Zs(){if(un)return ht;un=1,Object.defineProperty(ht,"__esModule",{value:!0});const e=G(),t=Y(),o={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:n})=>(0,e.str)`must match "${n.ifClause}" schema`,params:({params:n})=>(0,e._)`{failingKeyword: ${n.ifClause}}`},code(n){const{gen:u,parentSchema:i,it:f}=n;i.then===void 0&&i.else===void 0&&(0,t.checkStrictMode)(f,'"if" without "then" and "else" is ignored');const $=h(f,"then"),g=h(f,"else");if(!$&&!g)return;const E=u.let("valid",!0),v=u.name("_valid");if(_(),n.reset(),$&&g){const w=u.let("ifClause");n.setParams({ifClause:w}),u.if(v,b("then",w),b("else",w))}else $?u.if(v,b("then")):u.if((0,e.not)(v),b("else"));n.pass(E,()=>n.error(!0));function _(){const w=n.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},v);n.mergeEvaluated(w)}function b(w,d){return()=>{const l=n.subschema({keyword:w},v);u.assign(E,v),n.mergeValidEvaluated(l,E),d?u.assign(d,(0,e._)`${w}`):n.setParams({ifClause:w})}}}};function h(n,u){const i=n.schema[u];return i!==void 0&&!(0,t.alwaysValidSchema)(n,i)}return ht.default=o,ht}var yt={},ln;function Qs(){if(ln)return yt;ln=1,Object.defineProperty(yt,"__esModule",{value:!0});const e=Y(),t={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:r,parentSchema:o,it:h}){o.if===void 0&&(0,e.checkStrictMode)(h,`"${r}" without "if" is ignored`)}};return yt.default=t,yt}var fn;function Xs(){if(fn)return nt;fn=1,Object.defineProperty(nt,"__esModule",{value:!0});const e=Rn(),t=zs(),r=Cn(),o=Fs(),h=Ls(),n=Us(),u=Ks(),i=Nn(),f=Js(),$=Hs(),g=Gs(),E=Ws(),v=Bs(),_=Ys(),b=Zs(),w=Qs();function d(l=!1){const s=[g.default,E.default,v.default,_.default,b.default,w.default,u.default,i.default,n.default,f.default,$.default];return l?s.push(t.default,o.default):s.push(e.default,r.default),s.push(h.default),s}return nt.default=d,nt}var gt={},vt={},pn;function xs(){if(pn)return vt;pn=1,Object.defineProperty(vt,"__esModule",{value:!0});const e=G(),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,h){const{gen:n,data:u,$data:i,schema:f,schemaCode:$,it:g}=o,{opts:E,errSchemaPath:v,schemaEnv:_,self:b}=g;if(!E.validateFormats)return;i?w():d();function w(){const l=n.scopeValue("formats",{ref:b.formats,code:E.code.formats}),s=n.const("fDef",(0,e._)`${l}[${$}]`),c=n.let("fType"),y=n.let("format");n.if((0,e._)`typeof ${s} == "object" && !(${s} instanceof RegExp)`,()=>n.assign(c,(0,e._)`${s}.type || "string"`).assign(y,(0,e._)`${s}.validate`),()=>n.assign(c,(0,e._)`"string"`).assign(y,s)),o.fail$data((0,e.or)(a(),m()));function a(){return E.strictSchema===!1?e.nil:(0,e._)`${$} && !${y}`}function m(){const P=_.$async?(0,e._)`(${s}.async ? await ${y}(${u}) : ${y}(${u}))`:(0,e._)`${y}(${u})`,R=(0,e._)`(typeof ${y} == "function" ? ${P} : ${y}.test(${u}))`;return(0,e._)`${y} && ${y} !== true && ${c} === ${h} && !${R}`}}function d(){const l=b.formats[f];if(!l){a();return}if(l===!0)return;const[s,c,y]=m(l);s===h&&o.pass(P());function a(){if(E.strictSchema===!1){b.logger.warn(R());return}throw new Error(R());function R(){return`unknown format "${f}" ignored in schema at path "${v}"`}}function m(R){const T=R instanceof RegExp?(0,e.regexpCode)(R):E.code.formats?(0,e._)`${E.code.formats}${(0,e.getProperty)(f)}`:void 0,z=n.scopeValue("formats",{key:f,ref:R,code:T});return typeof R=="object"&&!(R instanceof RegExp)?[R.type||"string",R.validate,(0,e._)`${z}.validate`]:["string",R,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}(${u})`}return typeof c=="function"?(0,e._)`${y}(${u})`:(0,e._)`${y}.test(${u})`}}}};return vt.default=r,vt}var mn;function ei(){if(mn)return gt;mn=1,Object.defineProperty(gt,"__esModule",{value:!0});const t=[xs().default];return gt.default=t,gt}var Ee={},hn;function ti(){return hn||(hn=1,Object.defineProperty(Ee,"__esModule",{value:!0}),Ee.contentVocabulary=Ee.metadataVocabulary=void 0,Ee.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],Ee.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]),Ee}var yn;function ri(){if(yn)return Le;yn=1,Object.defineProperty(Le,"__esModule",{value:!0});const e=ks(),t=Vs(),r=Xs(),o=ei(),h=ti(),n=[e.default,t.default,(0,r.default)(),o.default,h.metadataVocabulary,h.contentVocabulary];return Le.default=n,Le}var _t={},Ne={},gn;function ni(){if(gn)return Ne;gn=1,Object.defineProperty(Ne,"__esModule",{value:!0}),Ne.DiscrError=void 0;var e;return(function(t){t.Tag="tag",t.Mapping="mapping"})(e||(Ne.DiscrError=e={})),Ne}var vn;function si(){if(vn)return _t;vn=1,Object.defineProperty(_t,"__esModule",{value:!0});const e=G(),t=ni(),r=xt(),o=Dt(),h=Y(),u={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:i,tagName:f}})=>i===t.DiscrError.Tag?`tag "${f}" must be string`:`value of tag "${f}" must be in oneOf`,params:({params:{discrError:i,tag:f,tagName:$}})=>(0,e._)`{error: ${i}, tag: ${$}, tagValue: ${f}}`},code(i){const{gen:f,data:$,schema:g,parentSchema:E,it:v}=i,{oneOf:_}=E;if(!v.opts.discriminator)throw new Error("discriminator: requires discriminator option");const b=g.propertyName;if(typeof b!="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=f.let("valid",!1),d=f.const("tag",(0,e._)`${$}${(0,e.getProperty)(b)}`);f.if((0,e._)`typeof ${d} == "string"`,()=>l(),()=>i.error(!1,{discrError:t.DiscrError.Tag,tag:d,tagName:b})),i.ok(w);function l(){const y=c();f.if(!1);for(const a in y)f.elseIf((0,e._)`${d} === ${a}`),f.assign(w,s(y[a]));f.else(),i.error(!1,{discrError:t.DiscrError.Mapping,tag:d,tagName:b}),f.endIf()}function s(y){const a=f.name("valid"),m=i.subschema({keyword:"oneOf",schemaProp:y},a);return i.mergeEvaluated(m,e.Name),a}function c(){var y;const a={},m=R(E);let P=!0;for(let N=0;N<_.length;N++){let V=_[N];if(V?.$ref&&!(0,h.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[b];if(typeof F!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${b}"`);P=P&&(m||R(V)),T(F,N)}if(!P)throw new Error(`discriminator: "${b}" must be required`);return a;function R({required:N}){return Array.isArray(N)&&N.includes(b)}function T(N,V){if(N.const)z(N.const,V);else if(N.enum)for(const F of N.enum)z(F,V);else throw new Error(`discriminator: "properties/${b}" must have "const" or "enum"`)}function z(N,V){if(typeof N!="string"||N in a)throw new Error(`discriminator: "${b}" values must be unique strings`);a[N]=V}}}};return _t.default=u,_t}const ii="http://json-schema.org/draft-07/schema#",oi="http://json-schema.org/draft-07/schema#",ai="Core schema meta-schema",ci={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:[]}},di=["object","boolean"],ui={$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:"#"}},li={$schema:ii,$id:oi,title:ai,definitions:ci,type:di,properties:ui,default:!0};var _n;function qn(){return _n||(_n=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=Ps(),o=ri(),h=si(),n=li,u=["/properties"],i="http://json-schema.org/draft-07/schema";class f extends r.default{_addVocabularies(){super._addVocabularies(),o.default.forEach(b=>this.addVocabulary(b)),this.opts.discriminator&&this.addKeyword(h.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const b=this.opts.$data?this.$dataMetaSchema(n,u):n;this.addMetaSchema(b,i,!1),this.refs["http://json-schema.org/schema"]=i}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(i)?i:void 0)}}t.Ajv=f,e.exports=t=f,e.exports.Ajv=f,Object.defineProperty(t,"__esModule",{value:!0}),t.default=f;var $=qt();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return $.KeywordCxt}});var g=G();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 E=Xt();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return E.default}});var v=Dt();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return v.default}})})(Me,Me.exports)),Me.exports}var fi=qn();const pi=En(fi);var $t={exports:{}},Yt={},$n;function mi(){return $n||($n=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(N,V){return{validate:N,compare:V}}e.fullFormats={date:t(n,u),time:t(f(!0),$),"date-time":t(v(!0),_),"iso-time":t(f(),g),"iso-date-time":t(v(),b),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:m},int64:{type:"number",validate:P},float:{type:"number",validate:R},double:{type:"number",validate:R},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,u),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,$),"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,b),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(N){return N%4===0&&(N%100!==0||N%400===0)}const o=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,h=[0,31,28,31,30,31,30,31,31,30,31,30,31];function n(N){const V=o.exec(N);if(!V)return!1;const F=+V[1],L=+V[2],Q=+V[3];return L>=1&&L<=12&&Q>=1&&Q<=(L===2&&r(F)?29:h[L])}function u(N,V){if(N&&V)return N>V?1:N<V?-1:0}const i=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function f(N){return function(F){const L=i.exec(F);if(!L)return!1;const Q=+L[1],ie=+L[2],oe=+L[3],x=L[4],fe=L[5]==="-"?-1:1,M=+(L[6]||0),j=+(L[7]||0);if(M>23||j>59||N&&!x)return!1;if(Q<=23&&ie<=59&&oe<60)return!0;const D=ie-j*fe,O=Q-M*fe-(D<0?1:0);return(O===23||O===-1)&&(D===59||D===-1)&&oe<61}}function $(N,V){if(!(N&&V))return;const F=new Date("2020-01-01T"+N).valueOf(),L=new Date("2020-01-01T"+V).valueOf();if(F&&L)return F-L}function g(N,V){if(!(N&&V))return;const F=i.exec(N),L=i.exec(V);if(F&&L)return N=F[1]+F[2]+F[3],V=L[1]+L[2]+L[3],N>V?1:N<V?-1:0}const E=/t|\s/i;function v(N){const V=f(N);return function(L){const Q=L.split(E);return Q.length===2&&n(Q[0])&&V(Q[1])}}function _(N,V){if(!(N&&V))return;const F=new Date(N).valueOf(),L=new Date(V).valueOf();if(F&&L)return F-L}function b(N,V){if(!(N&&V))return;const[F,L]=N.split(E),[Q,ie]=V.split(E),oe=u(F,Q);if(oe!==void 0)return oe||$(L,ie)}const w=/\/|:/,d=/^(?:[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(N){return w.test(N)&&d.test(N)}const s=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function c(N){return s.lastIndex=0,s.test(N)}const y=-2147483648,a=2**31-1;function m(N){return Number.isInteger(N)&&N<=a&&N>=y}function P(N){return Number.isInteger(N)}function R(){return!0}const T=/[^\\]\\Z/;function z(N){if(T.test(N))return!1;try{return new RegExp(N),!0}catch{return!1}}})(Yt)),Yt}var Zt={},bn;function hi(){return bn||(bn=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const t=qn(),r=G(),o=r.operators,h={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}},n={message:({keyword:i,schemaCode:f})=>(0,r.str)`should be ${h[i].okStr} ${f}`,params:({keyword:i,schemaCode:f})=>(0,r._)`{comparison: ${h[i].okStr}, limit: ${f}}`};e.formatLimitDefinition={keyword:Object.keys(h),type:"string",schemaType:"string",$data:!0,error:n,code(i){const{gen:f,data:$,schemaCode:g,keyword:E,it:v}=i,{opts:_,self:b}=v;if(!_.validateFormats)return;const w=new t.KeywordCxt(v,b.RULES.all.format.definition,"format");w.$data?d():l();function d(){const c=f.scopeValue("formats",{ref:b.formats,code:_.code.formats}),y=f.const("fmt",(0,r._)`${c}[${w.schemaCode}]`);i.fail$data((0,r.or)((0,r._)`typeof ${y} != "object"`,(0,r._)`${y} instanceof RegExp`,(0,r._)`typeof ${y}.compare != "function"`,s(y)))}function l(){const c=w.schema,y=b.formats[c];if(!y||y===!0)return;if(typeof y!="object"||y instanceof RegExp||typeof y.compare!="function")throw new Error(`"${E}": format "${c}" does not define "compare" function`);const a=f.scopeValue("formats",{key:c,ref:y,code:_.code.formats?(0,r._)`${_.code.formats}${(0,r.getProperty)(c)}`:void 0});i.fail$data(s(a))}function s(c){return(0,r._)`${c}.compare(${$}, ${g}) ${h[E].fail} 0`}},dependencies:["format"]};const u=i=>(i.addKeyword(e.formatLimitDefinition),i);e.default=u})(Zt)),Zt}var wn;function yi(){return wn||(wn=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=mi(),o=hi(),h=G(),n=new h.Name("fullFormats"),u=new h.Name("fastFormats"),i=($,g={keywords:!0})=>{if(Array.isArray(g))return f($,g,r.fullFormats,n),$;const[E,v]=g.mode==="fast"?[r.fastFormats,u]:[r.fullFormats,n],_=g.formats||r.formatNames;return f($,_,E,v),g.keywords&&(0,o.default)($),$};i.get=($,g="full")=>{const v=(g==="fast"?r.fastFormats:r.fullFormats)[$];if(!v)throw new Error(`Unknown format "${$}"`);return v};function f($,g,E,v){var _,b;(_=(b=$.opts.code).formats)!==null&&_!==void 0||(b.formats=(0,h._)`require("ajv-formats/dist/formats").${v}`);for(const w of g)$.addFormat(w,E[w])}e.exports=t=i,Object.defineProperty(t,"__esModule",{value:!0}),t.default=i})($t,$t.exports)),$t.exports}var gi=yi();const vi=En(gi),_i="http://json-schema.org/draft-07/schema#",$i="#/definitions/CICConfig",bi=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:_i,$ref:$i,definitions:bi},qe=e=>typeof e=="number"&&isFinite(e)&&e>0,tr=()=>{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)})},ee=e=>{if(!Array.isArray(e))return[];const t=e.map(i=>{const f=i.path??i.instancePath??"",$=i.keyword,g=i.params||{};let E=i.message||"";if($==="required"&&g.missingProperty&&(E=`缺少必填字段:${g.missingProperty}`),$==="type"&&i.schema&&(E=`类型必须为:${i.schema}`),$==="enum"){const v=Array.isArray(g.allowedValues)?g.allowedValues:void 0;E=v?`取值必须为枚举之一:${v.join(", ")}`:"取值必须为枚举之一"}if($==="const"){const v=g.allowedValue;E=v!==void 0?`取值必须为:${JSON.stringify(v)}`:"必须等于常量"}return $==="additionalProperties"&&g.additionalProperty&&(E=`不允许额外字段:${g.additionalProperty}`),{path:f,message:E,keyword:$,params:g}}),r={},o=[];for(const i of t){const f=i.keyword==="required"?`${i.keyword}|${i.path}|${i.params?.missingProperty}`:`${i.keyword}|${i.path}|${JSON.stringify(i.params||{})}`;r[f]||(r[f]=!0,o.push(i))}const n=o.some(i=>i.keyword!=="anyOf")?o.filter(i=>i.keyword!=="anyOf"):o,u=i=>i.keyword==="required"&&(i.params?.missingProperty==="type"||i.params?.missingProperty==="role")?0:i.keyword==="required"&&i.params?.missingProperty==="id"?1:i.keyword==="required"?2:3;return n.sort((i,f)=>u(i)-u(f)),n},he=(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},be=(e,t)=>!t||!t.length?[]:t.map(r=>({...r,path:`${e}${r.path||""}`})),Qt=e=>{try{return{ok:!0,value:JSON.parse(e)}}catch(t){return{ok:!1,errors:[{path:"",message:`JSON 解析失败:${t?.message||String(t)}`,keyword:"type",params:{}}]}}},Dn=e=>e.map(t=>({path:"",message:`缺少必填字段:${t}`,keyword:"required",params:{missingProperty:t}})),rr=(e,t,r,o)=>{const h=e;if(h&&typeof h=="object"&&typeof h[o]=="string"){const i=r[h[o]];if(i)return i(e)?{ok:!0}:{ok:!1,errors:ee(i.errors||[])}}if(t(e))return{ok:!0};const u=ee(t.errors||[]);if(!h||typeof h!="object"||typeof h[o]!="string"){const i=Dn([o,"id"]);return{ok:!1,errors:ee(i)}}return{ok:!1,errors:u}},nr=(e,t,r,o,h,n,u=[n,"id"])=>{const i=r(e,t);if(i&&typeof i=="object"&&typeof i[n]=="string"){const $=h[i[n]];if($)return $(i)?{ok:!0,value:i}:{ok:!1,errors:ee($.errors||[])}}if(o(i))return{ok:!0,value:i};if(!i||typeof i[n]!="string"){const $=Dn(u);return{ok:!1,errors:ee($)}}return{ok:!1,errors:ee(o.errors||[])}};let bt=null;const Tn=()=>(bt||(bt=new pi({allErrors:!0,strict:!1}),vi(bt)),bt),Pn=new Map,wi=JSON.stringify(Te),Pi={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"],ViewComponentInstance:["#/definitions/ViewComponentInstance","#/$defs/ViewComponentInstance"],ContainerComponentInstance:["#/definitions/ContainerComponentInstance","#/$defs/ContainerComponentInstance"],LogicComponentInstanceRef:["#/definitions/LogicComponentInstanceRef","#/$defs/LogicComponentInstanceRef"],DataSourceItem:["#/definitions/DataSourceItem","#/$defs/DataSourceItem"],DataSourceRest:["#/definitions/DataSourceRest","#/$defs/DataSourceRest"],DataSourceWebSocket:["#/definitions/DataSourceWebSocket","#/$defs/DataSourceWebSocket"],DataSourceStatic:["#/definitions/DataSourceStatic","#/$defs/DataSourceStatic"],DataSourceFunction:["#/definitions/DataSourceFunction","#/$defs/DataSourceFunction"],RegistryComponents:["#/definitions/RegistryComponents","#/$defs/RegistryComponents"],Variables:["#/definitions/Variables","#/$defs/Variables","#/properties/variables"],Dependency:["#/definitions/Dependency","#/$defs/Dependency"],JSDependency:["#/definitions/JSDependency","#/$defs/JSDependency"],CSSDependency:["#/definitions/CSSDependency","#/$defs/CSSDependency"],FontDependency:["#/definitions/FontDependency","#/$defs/FontDependency"],ImageDependency:["#/definitions/ImageDependency","#/$defs/ImageDependency"],JSONDependency:["#/definitions/JSONDependency","#/$defs/JSONDependency"],WasmDependency:["#/definitions/WasmDependency","#/$defs/WasmDependency"],OtherDependency:["#/definitions/OtherDependency","#/$defs/OtherDependency"],LayoutConfig:["#/definitions/Layout","#/properties/meta/properties/layout"]},Si=(e,t)=>e.compile({$ref:t,definitions:Te.definitions,properties:Te.properties}),te=e=>{const t=Tn(),r=`type:${e}::${wi}`,o=Pn.get(r);if(o)return o;const h=Pi[e]||[`#/definitions/${e}`,`#/$defs/${e}`];for(const n of h)try{const u=Si(t,n);return Pn.set(r,u),u}catch{}throw new Error(`VALIDATOR_REF_NOT_FOUND:${e}`)},Mn=te("DataSourceItem"),An=te("DataSourceRest"),Vn=te("DataSourceWebSocket"),zn=te("DataSourceStatic"),Fn=te("DataSourceFunction"),Ei=(e,t)=>{const r={...e};return t?.generateId&&!r.id&&(r.id=tr()),r.type&&(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))),he(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)),he(r,t?.defaults)):r.type==="static"?t?.strict||he(r,t?.defaults):r.type==="function"&&(t?.strict||"timeout"in r&&qe(r.timeout)&&(r.timeout=Math.round(r.timeout)),t?.strict||he(r,t?.defaults))),r},ki=e=>rr(e,Mn,{rest:An,websocket:Vn,static:zn,function:Fn},"type"),Ln=(e,t)=>nr(e,t,Ei,Mn,{rest:An,websocket:Vn,static:zn,function:Fn},"type",["type","id"]),Un=te("ComponentInstance"),Kn=te("ViewComponentInstance"),Jn=te("ContainerComponentInstance"),Hn=te("LogicComponentInstanceRef"),ji=(e,t)=>{const r={...e};return t?.generateId&&!r.id&&(r.id=tr()),t?.strict||(r.role==="view"?delete r.children:r.role==="container"?delete r.component:r.role==="logic"&&delete r.children),he(r,t?.defaults),r},Ii=e=>rr(e,Un,{view:Kn,container:Jn,logic:Hn},"role"),Gn=(e,t)=>nr(e,t,ji,Un,{view:Kn,container:Jn,logic:Hn},"role",["role","id"]),St=te("CICPage"),Oi=(e,t)=>{const r={...e};return t?.generateId&&!r.id&&(r.id=tr()),t?.strict||he(r,t?.defaults),r},Ri=e=>St(e)?{ok:!0}:{ok:!1,errors:ee(St.errors||[])},Wn=(e,t)=>{const r=Oi(e,t);return St(r)?{ok:!0,value:r}:{ok:!1,errors:ee(St.errors||[])}},Et=te("Meta"),kt=te("Layout"),Ci=e=>Et(e)?{ok:!0}:{ok:!1,errors:ee(Et.errors||[])},Ni=e=>kt(e)?{ok:!0}:{ok:!1,errors:ee(kt.errors||[])},Bn=(e,t)=>{const r=t?.strict?e:he(e,t?.defaults);return Et(r)?{ok:!0,value:r}:{ok:!1,errors:ee(Et.errors||[])}},Yn=(e,t)=>{const r=t?.strict?e:he(e,t?.defaults);return kt(r)?{ok:!0,value:r}:{ok:!1,errors:ee(kt.errors||[])}},jt=te("Variables"),qi=e=>jt(e)?{ok:!0}:{ok:!1,errors:ee(jt.errors||[])},Zn=(e,t)=>{const r=t?.strict?e:he(e,t?.defaults);return jt(r)?{ok:!0,value:r}:{ok:!1,errors:ee(jt.errors||[])}},Qn=te("Dependency"),Xn=te("JSDependency"),xn=te("CSSDependency"),es=te("FontDependency"),ts=te("ImageDependency"),rs=te("JSONDependency"),ns=te("WasmDependency"),ss=te("OtherDependency"),Di=e=>rr(e,Qn,{js:Xn,css:xn,font:es,image:ts,json:rs,wasm:ns,other:ss},"type"),is=(e,t)=>nr(e,t,(o,h)=>h?.strict?o:he(o,h?.defaults),Qn,{js:Xn,css:xn,font:es,image:ts,json:rs,wasm:ns,other:ss},"type",["type","id"]),It=te("RegistryComponents"),Ti=e=>It(e)?{ok:!0}:{ok:!1,errors:ee(It.errors||[])},os=(e,t)=>{const r=t?.strict?e:he(e,t?.defaults);return It(r)?{ok:!0,value:r}:{ok:!1,errors:ee(It.errors||[])}};let Ot,Sn;const Mi=()=>{const e=Tn(),t=JSON.stringify(Te);(!Ot||Sn!==t)&&(Ot=e.compile(Te),Sn=t)},Rt=e=>{try{return Mi(),Ot(e)?{ok:!0}:{ok:!1,errors:ee(Ot.errors||[])}}catch(t){const r=[{path:"",message:t?.message||String(t),keyword:"anyOf",params:{}}];return{ok:!1,errors:ee(r)}}},Ai=(e,t)=>{if(e&&typeof e=="object")return De(e,t);const r=(e||"").trim();if(!(r.startsWith("{")||r.startsWith("[")))return{ok:!1,errors:ee([{path:"",message:"非 JSON 字符串输入,请使用 importCICAsync(pathOrUrl) 进行路径/URL 导入",keyword:"type",params:{}}])};const h=Qt(r);return h.ok?De(h.value,t):{ok:!1,errors:h.errors}},Vi=async(e,t)=>{if(e&&typeof e=="object")return De(e,t);const r=(e||"").trim();if(r.startsWith("{")||r.startsWith("[")){const n=Qt(r);return n.ok?De(n.value,t):{ok:!1,errors:n.errors}}if(!(typeof globalThis.fetch=="function"))return{ok:!1,errors:ee([{path:"",message:"当前环境不支持路径/URL 导入(缺少 fetch),请传入 JSON 字符串或对象",keyword:"type",params:{}}])};if(/^file:\/\//i.test(r))return{ok:!1,errors:ee([{path:"",message:"不支持 file:// 方案,请使用 http(s) 或相对/绝对路径(同源)",keyword:"type",params:{}}])};try{const n=await globalThis.fetch(r);if(!n||!n.ok){const f=[{path:"",message:`网络或资源错误:${n?.status} ${n?.statusText||""}`.trim(),keyword:"type",params:{}}];return{ok:!1,errors:ee(f)}}const u=await n.text(),i=Qt(u);return i.ok?De(i.value,t):{ok:!1,errors:i.errors}}catch(n){const u=[{path:"",message:`请求失败:${n?.message||n}`,keyword:"type",params:{}}];return{ok:!1,errors:ee(u)}}},zi=e=>{const t=Rt(e);if(!t.ok)return{ok:!1,errors:t.errors};const r={version:e.version,meta:e.meta,pages:e.pages,registry:e.registry,variables:e.variables,deps:e.deps,extensions:e.extensions};return{ok:!0,value:JSON.stringify(r,null,2)}},De=(e,t)=>{const r=typeof e=="object"?{...e}:e,o=[];if(!r||typeof r!="object")return o.push({path:"",message:"配置必须为对象",keyword:"type",params:{schema:"object"}}),{ok:!1,errors:ee(o)};if(r.version||o.push({path:"/version",message:"缺少必填字段:version",keyword:"required",params:{missingProperty:"version"}}),r.meta||o.push({path:"/meta",message:"缺少必填字段:meta",keyword:"required",params:{missingProperty:"meta"}}),r.pages||o.push({path:"/pages",message:"缺少必填字段:pages",keyword:"required",params:{missingProperty:"pages"}}),o.length)return{ok:!1,errors:ee(o)};const h=Bn(r.meta,t?.meta);if(h.ok||o.push(...be("/meta",h.errors)),r.meta?.layout){const u=Yn(r.meta.layout,t?.layout);u.ok?r.meta.layout=u.value:o.push(...be("/meta/layout",u.errors))}if(h.ok&&(r.meta=h.value),r.variables){const u=Zn(r.variables,t?.variables);u.ok?r.variables=u.value:o.push(...be("/variables",u.errors))}if(r.registry?.components){const u=[];for(let i=0;i<r.registry.components.length;i++){const f=os(r.registry.components[i],t?.registry);f.ok?u.push(f.value):o.push(...be(`/registry/components[${i}]`,f.errors))}r.registry.components=u}if(r.deps){const u=[];for(let i=0;i<r.deps.length;i++){const f=is(r.deps[i],t?.dependency);f.ok?u.push(f.value):o.push(...be(`/deps[${i}]`,f.errors))}r.deps=u}if(Array.isArray(r.pages)){const u=[];for(let i=0;i<r.pages.length;i++){const f=r.pages[i],$=Wn(f,t?.page);if(!$.ok){o.push(...be(`/pages[${i}]`,$.errors));continue}const g=$.value;if(Array.isArray(f.components)){const E=[];for(let v=0;v<f.components.length;v++){const _=Gn(f.components[v],t?.component);_.ok?E.push(_.value):o.push(...be(`/pages[${i}]/components[${v}]`,_.errors))}g.components=E}if(Array.isArray(f.dataSources)){const E=[];for(let v=0;v<f.dataSources.length;v++){const _=Ln(f.dataSources[v],t?.dataSource);_.ok?E.push(_.value):o.push(...be(`/pages[${i}]/dataSources[${v}]`,_.errors))}g.dataSources=E}u.push(g)}r.pages=u}if(o.length)return{ok:!1,errors:ee(o)};const n=Rt(r);return n.ok?{ok:!0,value:r}:{ok:!1,errors:n.errors}};class Tt{config;constructor(t){const r=Rt(t);if(!r.ok)throw new Error(`Invalid CIC Configuration: ${JSON.stringify(r.errors)}`);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,h)=>o.id===t?(r=h,!1):!0),r}getVariable(t,r){const o=this.config.variables;if(o){if(t.componentId&&o.component&&o.component[t.componentId]){const h=o.component[t.componentId][r];if(h)return h.value??h.default}if(t.pageId&&o.page&&o.page[t.pageId]){const h=o.page[t.pageId][r];if(h)return h.value??h.default}if(o.global&&o.global[r]){const h=o.global[r];return h.value??h.default}}}getVariableByRef(t){const r=t.match(/^(global|page|component)(?::([^\.]+))?\.(.+)$/);if(!r)return;const[,o,h,n]=r;if(o==="global")return this.getVariable({},n);if(o==="page")return this.getVariable({pageId:h},n);if(o==="component")return this.getVariable({componentId:h},n)}walkComponents(t){if(this.config.pages)for(const r of this.config.pages){const o=[];for(const n of r.components||[])o.push({node:n});let h=!1;for(;o.length>0&&!h;){const{node:n,parent:u}=o.pop();if(t(n,r,u)===!1){h=!0;break}if(n.children&&n.children.length>0)for(let f=n.children.length-1;f>=0;f--)o.push({node:n.children[f],parent:n})}if(h)break}}static getValueByPath(t,r,o){if(t==null||!r)return o;const h=[];r.replace(/\[(\d+)\]/g,".$1").split(".").forEach(u=>{u.trim()&&h.push(u.trim())});let n=t;for(const u of h){if(n==null)return o;n=n[u]}return n===void 0?o:n}static traverseTree(t,r,o){const h=Array.isArray(t)?t:[t];for(const n of h)r(n,o)!==!1&&n.children&&n.children.length>0&&Tt.traverseTree(n.children,r,n)}static createDataSource=Ln;static validateDataSource=ki;static createComponent=Gn;static validateComponent=Ii;static createPage=Wn;static validatePage=Ri;static createMeta=Bn;static createLayout=Yn;static validateMeta=Ci;static validateLayout=Ni;static createVariables=Zn;static validateVariables=qi;static createDependency=is;static validateDependency=Di;static createRegistryComponent=os;static validateRegistryComponent=Ti;static importCIC=Ai;static exportCIC=zi;static validateCIC=Rt;static importCICAsync=Vi}globalThis.CICSDK=Tt;exports.CICSDK=Tt;
|