holosphere 2.0.0-alpha11 → 2.0.0-alpha13
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/dist/{2019-D2OG2idw.js → 2019-CLMqIAfQ.js} +1722 -1668
- package/dist/{2019-D2OG2idw.js.map → 2019-CLMqIAfQ.js.map} +1 -1
- package/dist/2019-Cp3uYhyY.cjs +8 -0
- package/dist/{2019-EION3wKo.cjs.map → 2019-Cp3uYhyY.cjs.map} +1 -1
- package/dist/browser-D6cNVl0v.cjs +2 -0
- package/dist/{browser-Cq59Ij19.cjs.map → browser-D6cNVl0v.cjs.map} +1 -1
- package/dist/{browser-BSniCNqO.js → browser-nUQt1cnB.js} +2 -2
- package/dist/{browser-BSniCNqO.js.map → browser-nUQt1cnB.js.map} +1 -1
- package/dist/cjs/holosphere.cjs +1 -1
- package/dist/esm/holosphere.js +67 -50
- package/dist/{index-D-jZhliX.js → index-BN_uoxQK.js} +20324 -735
- package/dist/index-BN_uoxQK.js.map +1 -0
- package/dist/{index-Bl6rM1NW.js → index-CoAjtqsD.js} +2 -2
- package/dist/{index-Bl6rM1NW.js.map → index-CoAjtqsD.js.map} +1 -1
- package/dist/{index-Bwg3OzRM.cjs → index-Cp3tI53z.cjs} +3 -3
- package/dist/{index-Bwg3OzRM.cjs.map → index-Cp3tI53z.cjs.map} +1 -1
- package/dist/index-DJjGSwXG.cjs +13 -0
- package/dist/index-DJjGSwXG.cjs.map +1 -0
- package/dist/index-V8EHMYEY.cjs +29 -0
- package/dist/index-V8EHMYEY.cjs.map +1 -0
- package/dist/index-Z5TstN1e.js +11663 -0
- package/dist/index-Z5TstN1e.js.map +1 -0
- package/dist/indexeddb-storage-CZK5A7XH.cjs +2 -0
- package/dist/indexeddb-storage-CZK5A7XH.cjs.map +1 -0
- package/dist/{indexeddb-storage-5eiUNsHC.js → indexeddb-storage-bpA01pAU.js} +39 -2
- package/dist/indexeddb-storage-bpA01pAU.js.map +1 -0
- package/dist/{memory-storage-DMt36uZO.cjs → memory-storage-B1k8Jszd.cjs} +2 -2
- package/dist/{memory-storage-DMt36uZO.cjs.map → memory-storage-B1k8Jszd.cjs.map} +1 -1
- package/dist/{memory-storage-CI-gfmuG.js → memory-storage-BqhmytP_.js} +2 -2
- package/dist/{memory-storage-CI-gfmuG.js.map → memory-storage-BqhmytP_.js.map} +1 -1
- package/docs/FEDERATION.md +474 -0
- package/package.json +3 -1
- package/src/crypto/nostr-utils.js +7 -0
- package/src/crypto/secp256k1.js +104 -38
- package/src/federation/capabilities.js +162 -0
- package/src/federation/card-storage.js +376 -0
- package/src/federation/handshake.js +561 -9
- package/src/federation/hologram.js +194 -57
- package/src/federation/holon-registry.js +187 -0
- package/src/federation/index.js +68 -0
- package/src/federation/registry.js +164 -6
- package/src/federation/request-card.js +373 -0
- package/src/hierarchical/upcast.js +19 -3
- package/src/index.js +209 -75
- package/src/lib/federation-methods.js +527 -5
- package/src/storage/indexeddb-storage.js +41 -0
- package/src/storage/nostr-async.js +14 -5
- package/src/storage/nostr-client.js +471 -155
- package/src/storage/nostr-wrapper.js +6 -3
- package/dist/2019-EION3wKo.cjs +0 -8
- package/dist/_commonjsHelpers-C37NGDzP.cjs +0 -2
- package/dist/_commonjsHelpers-C37NGDzP.cjs.map +0 -1
- package/dist/_commonjsHelpers-CUmg6egw.js +0 -7
- package/dist/_commonjsHelpers-CUmg6egw.js.map +0 -1
- package/dist/browser-Cq59Ij19.cjs +0 -2
- package/dist/index-D-jZhliX.js.map +0 -1
- package/dist/index-Dc6Z8Aob.cjs +0 -18
- package/dist/index-Dc6Z8Aob.cjs.map +0 -1
- package/dist/indexeddb-storage-5eiUNsHC.js.map +0 -1
- package/dist/indexeddb-storage-FNFUVvTJ.cjs +0 -2
- package/dist/indexeddb-storage-FNFUVvTJ.cjs.map +0 -1
- package/dist/secp256k1-CEwJNcfV.js +0 -1890
- package/dist/secp256k1-CEwJNcfV.js.map +0 -1
- package/dist/secp256k1-CiEONUnj.cjs +0 -12
- package/dist/secp256k1-CiEONUnj.cjs.map +0 -1
|
@@ -53,11 +53,14 @@ function encodePathComponent(component) {
|
|
|
53
53
|
* @param {Object} client - NostrClient instance
|
|
54
54
|
* @param {string} path - Path
|
|
55
55
|
* @param {Object} data - Data to write
|
|
56
|
+
* @param {Object} [options={}] - Write options
|
|
57
|
+
* @param {string} [options.signingKey] - Private key to sign with (hex format)
|
|
56
58
|
* @returns {Promise<boolean>} Success indicator
|
|
57
59
|
*/
|
|
58
|
-
export async function write(client, path, data) {
|
|
60
|
+
export async function write(client, path, data, options = {}) {
|
|
59
61
|
try {
|
|
60
|
-
const
|
|
62
|
+
const putOptions = options.signingKey ? { signingKey: options.signingKey } : {};
|
|
63
|
+
const result = await nostrPut(client, path, data, putOptions);
|
|
61
64
|
// Check if at least one relay accepted the event
|
|
62
65
|
// If no relays (testing mode), consider it successful if event was created
|
|
63
66
|
const success = result.results.length === 0 ? true : result.results.some(r => r.status === 'fulfilled');
|
|
@@ -208,7 +211,7 @@ export async function subscribe(client, path, callback, options = {}) {
|
|
|
208
211
|
}, options);
|
|
209
212
|
} else {
|
|
210
213
|
// Subscribe to single item
|
|
211
|
-
return nostrSubscribe(client, path, (data) => {
|
|
214
|
+
return await nostrSubscribe(client, path, (data) => {
|
|
212
215
|
callback(data, path.split('/').pop());
|
|
213
216
|
}, options);
|
|
214
217
|
}
|
package/dist/2019-EION3wKo.cjs
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";const e=require("./_commonjsHelpers-C37NGDzP.cjs");function t(e,t){for(var r=0;r<t.length;r++){const s=t[r];if("string"!=typeof s&&!Array.isArray(s))for(const t in s)if("default"!==t&&!(t in e)){const r=Object.getOwnPropertyDescriptor(s,t);r&&Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:()=>s[t]})}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var r={exports:{}},s={},a={},o={},n={},i={},c={};!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(t){if(super(),!e.IDENTIFIER.test(t))throw new Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=r;class s extends t{constructor(e){super(),this._items="string"==typeof e?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const e=this._items[0];return""===e||'""'===e}get str(){var e;return null!==(e=this._str)&&void 0!==e?e:this._str=this._items.reduce((e,t)=>`${e}${t}`,"")}get names(){var e;return null!==(e=this._names)&&void 0!==e?e:this._names=this._items.reduce((e,t)=>(t instanceof r&&(e[t.str]=(e[t.str]||0)+1),e),{})}}function a(e,...t){const r=[e[0]];let a=0;for(;a<t.length;)i(r,t[a]),r.push(e[++a]);return new s(r)}e._Code=s,e.nil=new s(""),e._=a;const o=new s("+");function n(e,...t){const r=[d(e[0])];let a=0;for(;a<t.length;)r.push(o),i(r,t[a]),r.push(o,d(e[++a]));return function(e){let t=1;for(;t<e.length-1;){if(e[t]===o){const r=c(e[t-1],e[t+1]);if(void 0!==r){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}(r),new s(r)}function i(e,t){var a;t instanceof s?e.push(...t._items):t instanceof r?e.push(t):e.push("number"==typeof(a=t)||"boolean"==typeof a||null===a?a:d(Array.isArray(a)?a.join(","):a))}function c(e,t){if('""'===t)return e;if('""'===e)return t;if("string"==typeof e){if(t instanceof r||'"'!==e[e.length-1])return;return"string"!=typeof t?`${e.slice(0,-1)}${t}"`:'"'===t[0]?e.slice(0,-1)+t.slice(1):void 0}return"string"!=typeof t||'"'!==t[0]||e instanceof r?void 0:`"${e}${t.slice(1)}`}function d(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.str=n,e.addCodeArg=i,e.strConcat=function(e,t){return t.emptyStr()?e:e.emptyStr()?t:n`${e}${t}`},e.stringify=function(e){return new s(d(e))},e.safeStringify=d,e.getProperty=function(t){return"string"==typeof t&&e.IDENTIFIER.test(t)?new s(`.${t}`):a`[${t}]`},e.getEsmExportName=function(t){if("string"==typeof t&&e.IDENTIFIER.test(t))return new s(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)},e.regexpCode=function(e){return new s(e.toString())}}(c);var d={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=c;class r extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}}var s,a;(a=s||(e.UsedValueState=s={}))[a.Started=0]="Started",a[a.Completed=1]="Completed",e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class o{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof t.Name?e:this.name(e)}name(e){return new t.Name(this._newName(e))}_newName(e){return`${e}${(this._names[e]||this._nameGroup(e)).index++}`}_nameGroup(e){var t,r;if((null===(r=null===(t=this._parent)||void 0===t?void 0:t._prefixes)||void 0===r?void 0:r.has(e))||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}e.Scope=o;class n extends t.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:r,itemIndex:s}){this.value=e,this.scopePath=t._`.${new t.Name(r)}[${s}]`}}e.ValueScopeName=n;const i=t._`\n`;e.ValueScope=class extends o{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?i:t.nil}}get(){return this._scope}name(e){return new n(e,this._newName(e))}value(e,t){var r;if(void 0===t.ref)throw new Error("CodeGen: ref must be passed in value");const s=this.toName(e),{prefix:a}=s,o=null!==(r=t.key)&&void 0!==r?r:t.ref;let n=this._values[a];if(n){const e=n.get(o);if(e)return e}else n=this._values[a]=new Map;n.set(o,s);const i=this._scope[a]||(this._scope[a]=[]),c=i.length;return i[c]=t.ref,s.setValue(t,{property:a,itemIndex:c}),s}getValue(e,t){const r=this._values[e];if(r)return r.get(t)}scopeRefs(e,r=this._values){return this._reduceValues(r,r=>{if(void 0===r.scopePath)throw new Error(`CodeGen: name "${r}" has no value`);return t._`${e}${r.scopePath}`})}scopeCode(e=this._values,t,r){return this._reduceValues(e,e=>{if(void 0===e.value)throw new Error(`CodeGen: name "${e}" has no value`);return e.value.code},t,r)}_reduceValues(a,o,n={},i){let c=t.nil;for(const d in a){const l=a[d];if(!l)continue;const u=n[d]=n[d]||new Map;l.forEach(a=>{if(u.has(a))return;u.set(a,s.Started);let n=o(a);if(n){const r=this.opts.es5?e.varKinds.var:e.varKinds.const;c=t._`${c}${r} ${a} = ${n};${this.opts._n}`}else{if(!(n=null==i?void 0:i(a)))throw new r(a);c=t._`${c}${n}${this.opts._n}`}u.set(a,s.Completed)})}return c}}}(d),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=c,r=d;var s=c;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return s._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return s.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return s.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return s.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return s.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return s.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return s.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return s.Name}});var a=d;Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return a.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return a.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return a.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return a.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 o{optimizeNodes(){return this}optimizeNames(e,t){return this}}class n extends o{constructor(e,t,r){super(),this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){const s=e?r.varKinds.var:this.varKind,a=void 0===this.rhs?"":` = ${this.rhs}`;return`${s} ${this.name}${a};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=C(this.rhs,e,t)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class i extends o{constructor(e,t,r){super(),this.lhs=e,this.rhs=t,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof t.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=C(this.rhs,e,r),this}get names(){return R(this.lhs instanceof t.Name?{}:{...this.lhs.names},this.rhs)}}class l extends i{constructor(e,t,r,s){super(e,r,s),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class u extends o{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class f extends o{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class h extends o{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class m extends o{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=C(this.code,e,t),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class p extends o{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((t,r)=>t+r.render(e),"")}optimizeNodes(){const{nodes:e}=this;let t=e.length;for(;t--;){const r=e[t].optimizeNodes();Array.isArray(r)?e.splice(t,1,...r):r?e[t]=r:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){const{nodes:r}=this;let s=r.length;for(;s--;){const a=r[s];a.optimizeNames(e,t)||(x(e,a.names),r.splice(s,1))}return r.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>O(e,t.names),{})}}class y extends p{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class v extends p{}class $ extends y{}$.kind="else";class g extends y{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();const e=this.condition;if(!0===e)return this.nodes;let t=this.else;if(t){const e=t.optimizeNodes();t=this.else=Array.isArray(e)?new $(e):e}return t?!1===e?t instanceof g?t:t.nodes:this.nodes.length?this:new g(I(e),t instanceof g?[t]:t.nodes):!1!==e&&this.nodes.length?this:void 0}optimizeNames(e,t){var r;if(this.else=null===(r=this.else)||void 0===r?void 0:r.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=C(this.condition,e,t),this}get names(){const e=super.names;return R(e,this.condition),this.else&&O(e,this.else.names),e}}g.kind="if";class _ extends y{}_.kind="for";class b extends _{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=C(this.iteration,e,t),this}get names(){return O(super.names,this.iteration.names)}}class w extends _{constructor(e,t,r,s){super(),this.varKind=e,this.name=t,this.from=r,this.to=s}render(e){const t=e.es5?r.varKinds.var:this.varKind,{name:s,from:a,to:o}=this;return`for(${t} ${s}=${a}; ${s}<${o}; ${s}++)`+super.render(e)}get names(){const e=R(super.names,this.from);return R(e,this.to)}}class P extends _{constructor(e,t,r,s){super(),this.loop=e,this.varKind=t,this.name=r,this.iterable=s}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=C(this.iterable,e,t),this}get names(){return O(super.names,this.iterable.names)}}class E extends y{constructor(e,t,r){super(),this.name=e,this.args=t,this.async=r}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}E.kind="func";class S extends p{render(e){return"return "+super.render(e)}}S.kind="return";class k extends y{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),null===(e=this.catch)||void 0===e||e.optimizeNodes(),null===(t=this.finally)||void 0===t||t.optimizeNodes(),this}optimizeNames(e,t){var r,s;return super.optimizeNames(e,t),null===(r=this.catch)||void 0===r||r.optimizeNames(e,t),null===(s=this.finally)||void 0===s||s.optimizeNames(e,t),this}get names(){const e=super.names;return this.catch&&O(e,this.catch.names),this.finally&&O(e,this.finally.names),e}}class j extends y{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}j.kind="catch";class N extends y{render(e){return"finally"+super.render(e)}}N.kind="finally";function O(e,t){for(const r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function R(e,r){return r instanceof t._CodeOrName?O(e,r.names):e}function C(e,r,s){return e instanceof t.Name?o(e):(a=e)instanceof t._Code&&a._items.some(e=>e instanceof t.Name&&1===r[e.str]&&void 0!==s[e.str])?new t._Code(e._items.reduce((e,r)=>(r instanceof t.Name&&(r=o(r)),r instanceof t._Code?e.push(...r._items):e.push(r),e),[])):e;var a;function o(e){const t=s[e.str];return void 0===t||1!==r[e.str]?e:(delete r[e.str],t)}}function x(e,t){for(const r in t)e[r]=(e[r]||0)-(t[r]||0)}function I(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:t._`!${D(e)}`}e.CodeGen=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?"\n":""},this._extScope=e,this._scope=new r.Scope({parent:e}),this._nodes=[new v]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){const r=this._extScope.value(e,t);return(this._values[r.prefix]||(this._values[r.prefix]=new Set)).add(r),r}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,r,s){const a=this._scope.toName(t);return void 0!==r&&s&&(this._constants[a.str]=r),this._leafNode(new n(e,a,r)),a}const(e,t,s){return this._def(r.varKinds.const,e,t,s)}let(e,t,s){return this._def(r.varKinds.let,e,t,s)}var(e,t,s){return this._def(r.varKinds.var,e,t,s)}assign(e,t,r){return this._leafNode(new i(e,t,r))}add(t,r){return this._leafNode(new l(t,e.operators.ADD,r))}code(e){return"function"==typeof e?e():e!==t.nil&&this._leafNode(new m(e)),this}object(...e){const r=["{"];for(const[s,a]of e)r.length>1&&r.push(","),r.push(s),(s!==a||this.opts.es5)&&(r.push(":"),(0,t.addCodeArg)(r,a));return r.push("}"),new t._Code(r)}if(e,t,r){if(this._blockNode(new g(e)),t&&r)this.code(t).else().code(r).endIf();else if(t)this.code(t).endIf();else if(r)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new g(e))}else(){return this._elseNode(new $)}endIf(){return this._endBlockNode(g,$)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new b(e),t)}forRange(e,t,s,a,o=(this.opts.es5?r.varKinds.var:r.varKinds.let)){const n=this._scope.toName(e);return this._for(new w(o,n,t,s),()=>a(n))}forOf(e,s,a,o=r.varKinds.const){const n=this._scope.toName(e);if(this.opts.es5){const e=s instanceof t.Name?s:this.var("_arr",s);return this.forRange("_i",0,t._`${e}.length`,r=>{this.var(n,t._`${e}[${r}]`),a(n)})}return this._for(new P("of",o,n,s),()=>a(n))}forIn(e,s,a,o=(this.opts.es5?r.varKinds.var:r.varKinds.const)){if(this.opts.ownProperties)return this.forOf(e,t._`Object.keys(${s})`,a);const n=this._scope.toName(e);return this._for(new P("in",o,n,s),()=>a(n))}endFor(){return this._endBlockNode(_)}label(e){return this._leafNode(new u(e))}break(e){return this._leafNode(new f(e))}return(e){const t=new S;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(S)}try(e,t,r){if(!t&&!r)throw new Error('CodeGen: "try" without "catch" and "finally"');const s=new k;if(this._blockNode(s),this.code(e),t){const e=this.name("e");this._currNode=s.catch=new j(e),t(e)}return r&&(this._currNode=s.finally=new N,this.code(r)),this._endBlockNode(j,N)}throw(e){return this._leafNode(new h(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){const t=this._blockStarts.pop();if(void 0===t)throw new Error("CodeGen: not in self-balancing block");const r=this._nodes.length-t;if(r<0||void 0!==e&&r!==e)throw new Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=t,this}func(e,r=t.nil,s,a){return this._blockNode(new E(e,r,s)),a&&this.code(a).endFunc(),this}endFunc(){return this._endBlockNode(E)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){const r=this._currNode;if(r instanceof e||t&&r instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){const t=this._currNode;if(!(t instanceof g))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){const e=this._nodes;return e[e.length-1]}set _currNode(e){const t=this._nodes;t[t.length-1]=e}},e.not=I;const T=A(e.operators.AND);e.and=function(...e){return e.reduce(T)};const M=A(e.operators.OR);function A(e){return(r,s)=>r===t.nil?s:s===t.nil?r:t._`${D(r)} ${e} ${D(s)}`}function D(e){return e instanceof t.Name?e:t._`(${e})`}e.or=function(...e){return e.reduce(M)}}(i);var l={};Object.defineProperty(l,"__esModule",{value:!0}),l.checkStrictMode=l.getErrorPath=l.Type=l.useFunc=l.setEvaluated=l.evaluatedPropsToName=l.mergeEvaluated=l.eachItem=l.unescapeJsonPointer=l.escapeJsonPointer=l.escapeFragment=l.unescapeFragment=l.schemaRefOrVal=l.schemaHasRulesButRef=l.schemaHasRules=l.checkUnknownRules=l.alwaysValidSchema=l.toHash=void 0;const u=i,f=c;function h(e,t=e.schema){const{opts:r,self:s}=e;if(!r.strictSchema)return;if("boolean"==typeof t)return;const a=s.RULES.keywords;for(const o in t)a[o]||P(e,`unknown keyword: "${o}"`)}function m(e,t){if("boolean"==typeof e)return!e;for(const r in e)if(t[r])return!0;return!1}function p(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function y(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function v({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:s}){return(a,o,n,i)=>{const c=void 0===n?o:n instanceof u.Name?(o instanceof u.Name?e(a,o,n):t(a,o,n),n):o instanceof u.Name?(t(a,n,o),o):r(o,n);return i!==u.Name||c instanceof u.Name?c:s(a,c)}}function $(e,t){if(!0===t)return e.var("props",!0);const r=e.var("props",u._`{}`);return void 0!==t&&g(e,r,t),r}function g(e,t,r){Object.keys(r).forEach(r=>e.assign(u._`${t}${(0,u.getProperty)(r)}`,!0))}l.toHash=function(e){const t={};for(const r of e)t[r]=!0;return t},l.alwaysValidSchema=function(e,t){return"boolean"==typeof t?t:0===Object.keys(t).length||(h(e,t),!m(t,e.self.RULES.all))},l.checkUnknownRules=h,l.schemaHasRules=m,l.schemaHasRulesButRef=function(e,t){if("boolean"==typeof e)return!e;for(const r in e)if("$ref"!==r&&t.all[r])return!0;return!1},l.schemaRefOrVal=function({topSchemaRef:e,schemaPath:t},r,s,a){if(!a){if("number"==typeof r||"boolean"==typeof r)return r;if("string"==typeof r)return u._`${r}`}return u._`${e}${t}${(0,u.getProperty)(s)}`},l.unescapeFragment=function(e){return y(decodeURIComponent(e))},l.escapeFragment=function(e){return encodeURIComponent(p(e))},l.escapeJsonPointer=p,l.unescapeJsonPointer=y,l.eachItem=function(e,t){if(Array.isArray(e))for(const r of e)t(r);else t(e)},l.mergeEvaluated={props:v({mergeNames:(e,t,r)=>e.if(u._`${r} !== true && ${t} !== undefined`,()=>{e.if(u._`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,u._`${r} || {}`).code(u._`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if(u._`${r} !== true`,()=>{!0===t?e.assign(r,!0):(e.assign(r,u._`${r} || {}`),g(e,r,t))}),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:$}),items:v({mergeNames:(e,t,r)=>e.if(u._`${r} !== true && ${t} !== undefined`,()=>e.assign(r,u._`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if(u._`${r} !== true`,()=>e.assign(r,!0===t||u._`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>!0===e||Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})},l.evaluatedPropsToName=$,l.setEvaluated=g;const _={};var b,w;function P(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,!0===r)throw new Error(t);e.self.logger.warn(t)}}l.useFunc=function(e,t){return e.scopeValue("func",{ref:t,code:_[t.code]||(_[t.code]=new f._Code(t.code))})},(w=b||(l.Type=b={}))[w.Num=0]="Num",w[w.Str=1]="Str",l.getErrorPath=function(e,t,r){if(e instanceof u.Name){const s=t===b.Num;return r?s?u._`"[" + ${e} + "]"`:u._`"['" + ${e} + "']"`:s?u._`"/" + ${e}`:u._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,u.getProperty)(e).toString():"/"+p(e)},l.checkStrictMode=P;var E={};Object.defineProperty(E,"__esModule",{value:!0});const S=i,k={data:new S.Name("data"),valCxt:new S.Name("valCxt"),instancePath:new S.Name("instancePath"),parentData:new S.Name("parentData"),parentDataProperty:new S.Name("parentDataProperty"),rootData:new S.Name("rootData"),dynamicAnchors:new S.Name("dynamicAnchors"),vErrors:new S.Name("vErrors"),errors:new S.Name("errors"),this:new S.Name("this"),self:new S.Name("self"),scope:new S.Name("scope"),json:new S.Name("json"),jsonPos:new S.Name("jsonPos"),jsonLen:new S.Name("jsonLen"),jsonPart:new S.Name("jsonPart")};E.default=k,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=i,r=l,s=E;function a(e,r){const a=e.const("err",r);e.if(t._`${s.default.vErrors} === null`,()=>e.assign(s.default.vErrors,t._`[${a}]`),t._`${s.default.vErrors}.push(${a})`),e.code(t._`${s.default.errors}++`)}function o(e,r){const{gen:s,validateName:a,schemaEnv:o}=e;o.$async?s.throw(t._`new ${e.ValidationError}(${r})`):(s.assign(t._`${a}.errors`,r),s.return(!1))}e.keywordError={message:({keyword:e})=>t.str`must pass "${e}" keyword validation`},e.keyword$DataError={message:({keyword:e,schemaType:r})=>r?t.str`"${e}" keyword must be ${r} ($data)`:t.str`"${e}" keyword is invalid ($data)`},e.reportError=function(r,s=e.keywordError,n,i){const{it:d}=r,{gen:l,compositeRule:u,allErrors:f}=d,h=c(r,s,n);(null!=i?i:u||f)?a(l,h):o(d,t._`[${h}]`)},e.reportExtraError=function(t,r=e.keywordError,n){const{it:i}=t,{gen:d,compositeRule:l,allErrors:u}=i;a(d,c(t,r,n)),l||u||o(i,s.default.vErrors)},e.resetErrorsCount=function(e,r){e.assign(s.default.errors,r),e.if(t._`${s.default.vErrors} !== null`,()=>e.if(r,()=>e.assign(t._`${s.default.vErrors}.length`,r),()=>e.assign(s.default.vErrors,null)))},e.extendErrors=function({gen:e,keyword:r,schemaValue:a,data:o,errsCount:n,it:i}){if(void 0===n)throw new Error("ajv implementation error");const c=e.name("err");e.forRange("i",n,s.default.errors,n=>{e.const(c,t._`${s.default.vErrors}[${n}]`),e.if(t._`${c}.instancePath === undefined`,()=>e.assign(t._`${c}.instancePath`,(0,t.strConcat)(s.default.instancePath,i.errorPath))),e.assign(t._`${c}.schemaPath`,t.str`${i.errSchemaPath}/${r}`),i.opts.verbose&&(e.assign(t._`${c}.schema`,a),e.assign(t._`${c}.data`,o))})};const n={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 c(e,r,a){const{createErrors:o}=e.it;return!1===o?t._`{}`:function(e,r,a={}){const{gen:o,it:i}=e,c=[d(i,a),u(e,a)];return function(e,{params:r,message:a},o){const{keyword:i,data:c,schemaValue:d,it:l}=e,{opts:u,propertyName:f,topSchemaRef:h,schemaPath:m}=l;o.push([n.keyword,i],[n.params,"function"==typeof r?r(e):r||t._`{}`]),u.messages&&o.push([n.message,"function"==typeof a?a(e):a]);u.verbose&&o.push([n.schema,d],[n.parentSchema,t._`${h}${m}`],[s.default.data,c]);f&&o.push([n.propertyName,f])}(e,r,c),o.object(...c)}(e,r,a)}function d({errorPath:e},{instancePath:a}){const o=a?t.str`${e}${(0,r.getErrorPath)(a,r.Type.Str)}`:e;return[s.default.instancePath,(0,t.strConcat)(s.default.instancePath,o)]}function u({keyword:e,it:{errSchemaPath:s}},{schemaPath:a,parentSchema:o}){let i=o?s:t.str`${s}/${e}`;return a&&(i=t.str`${i}${(0,r.getErrorPath)(a,r.Type.Str)}`),[n.schemaPath,i]}}(n),Object.defineProperty(o,"__esModule",{value:!0}),o.boolOrEmptySchema=o.topBoolOrEmptySchema=void 0;const j=n,N=i,O=E,R={message:"boolean schema is false"};function C(e,t){const{gen:r,data:s}=e;(0,j.reportError)({gen:r,keyword:"false schema",data:s,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e},R,void 0,t)}o.topBoolOrEmptySchema=function(e){const{gen:t,schema:r,validateName:s}=e;!1===r?C(e,!1):"object"==typeof r&&!0===r.$async?t.return(O.default.data):(t.assign(N._`${s}.errors`,null),t.return(!0))},o.boolOrEmptySchema=function(e,t){const{gen:r,schema:s}=e;!1===s?(r.var(t,!1),C(e)):r.var(t,!0)};var x={},I={};Object.defineProperty(I,"__esModule",{value:!0}),I.getRules=I.isJSONType=void 0;const T=new Set(["string","number","integer","boolean","null","object","array"]);I.isJSONType=function(e){return"string"==typeof e&&T.has(e)},I.getRules=function(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}};var M={};function A(e,t){return t.rules.some(t=>D(e,t))}function D(e,t){var r;return void 0!==e[t.keyword]||(null===(r=t.definition.implements)||void 0===r?void 0:r.some(t=>void 0!==e[t]))}Object.defineProperty(M,"__esModule",{value:!0}),M.shouldUseRule=M.shouldUseGroup=M.schemaHasRulesForType=void 0,M.schemaHasRulesForType=function({schema:e,self:t},r){const s=t.RULES.types[r];return s&&!0!==s&&A(e,s)},M.shouldUseGroup=A,M.shouldUseRule=D,Object.defineProperty(x,"__esModule",{value:!0}),x.reportTypeError=x.checkDataTypes=x.checkDataType=x.coerceAndCheckDataType=x.getJSONTypes=x.getSchemaTypes=x.DataType=void 0;const V=I,z=M,q=n,U=i,K=l;var F,L;function G(e){const t=Array.isArray(e)?e:e?[e]:[];if(t.every(V.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}(L=F||(x.DataType=F={}))[L.Correct=0]="Correct",L[L.Wrong=1]="Wrong",x.getSchemaTypes=function(e){const t=G(e.type);if(t.includes("null")){if(!1===e.nullable)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&void 0!==e.nullable)throw new Error('"nullable" cannot be used without "type"');!0===e.nullable&&t.push("null")}return t},x.getJSONTypes=G,x.coerceAndCheckDataType=function(e,t){const{gen:r,data:s,opts:a}=e,o=function(e,t){return t?e.filter(e=>H.has(e)||"array"===t&&"array"===e):[]}(t,a.coerceTypes),n=t.length>0&&!(0===o.length&&1===t.length&&(0,z.schemaHasRulesForType)(e,t[0]));if(n){const n=B(t,s,a.strictNumbers,F.Wrong);r.if(n,()=>{o.length?function(e,t,r){const{gen:s,data:a,opts:o}=e,n=s.let("dataType",U._`typeof ${a}`),i=s.let("coerced",U._`undefined`);"array"===o.coerceTypes&&s.if(U._`${n} == 'object' && Array.isArray(${a}) && ${a}.length == 1`,()=>s.assign(a,U._`${a}[0]`).assign(n,U._`typeof ${a}`).if(B(t,a,o.strictNumbers),()=>s.assign(i,a)));s.if(U._`${i} !== undefined`);for(const d of r)(H.has(d)||"array"===d&&"array"===o.coerceTypes)&&c(d);function c(e){switch(e){case"string":return void s.elseIf(U._`${n} == "number" || ${n} == "boolean"`).assign(i,U._`"" + ${a}`).elseIf(U._`${a} === null`).assign(i,U._`""`);case"number":return void s.elseIf(U._`${n} == "boolean" || ${a} === null
|
|
2
|
-
|| (${n} == "string" && ${a} && ${a} == +${a})`).assign(i,U._`+${a}`);case"integer":return void s.elseIf(U._`${n} === "boolean" || ${a} === null
|
|
3
|
-
|| (${n} === "string" && ${a} && ${a} == +${a} && !(${a} % 1))`).assign(i,U._`+${a}`);case"boolean":return void s.elseIf(U._`${a} === "false" || ${a} === 0 || ${a} === null`).assign(i,!1).elseIf(U._`${a} === "true" || ${a} === 1`).assign(i,!0);case"null":return s.elseIf(U._`${a} === "" || ${a} === 0 || ${a} === false`),void s.assign(i,null);case"array":s.elseIf(U._`${n} === "string" || ${n} === "number"
|
|
4
|
-
|| ${n} === "boolean" || ${a} === null`).assign(i,U._`[${a}]`)}}s.else(),Q(e),s.endIf(),s.if(U._`${i} !== undefined`,()=>{s.assign(a,i),function({gen:e,parentData:t,parentDataProperty:r},s){e.if(U._`${t} !== undefined`,()=>e.assign(U._`${t}[${r}]`,s))}(e,i)})}(e,t,o):Q(e)})}return n};const H=new Set(["string","number","integer","boolean","null"]);function J(e,t,r,s=F.Correct){const a=s===F.Correct?U.operators.EQ:U.operators.NEQ;let o;switch(e){case"null":return U._`${t} ${a} null`;case"array":o=U._`Array.isArray(${t})`;break;case"object":o=U._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":o=n(U._`!(${t} % 1) && !isNaN(${t})`);break;case"number":o=n();break;default:return U._`typeof ${t} ${a} ${e}`}return s===F.Correct?o:(0,U.not)(o);function n(e=U.nil){return(0,U.and)(U._`typeof ${t} == "number"`,e,r?U._`isFinite(${t})`:U.nil)}}function B(e,t,r,s){if(1===e.length)return J(e[0],t,r,s);let a;const o=(0,K.toHash)(e);if(o.array&&o.object){const e=U._`typeof ${t} != "object"`;a=o.null?e:U._`!${t} || ${e}`,delete o.null,delete o.array,delete o.object}else a=U.nil;o.number&&delete o.integer;for(const n in o)a=(0,U.and)(a,J(n,t,r,s));return a}x.checkDataType=J,x.checkDataTypes=B;const W={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>"string"==typeof e?U._`{type: ${e}}`:U._`{type: ${t}}`};function Q(e){const t=function(e){const{gen:t,data:r,schema:s}=e,a=(0,K.schemaRefOrVal)(e,s,"type");return{gen:t,keyword:"type",data:r,schema:s.type,schemaCode:a,schemaValue:a,parentSchema:s,params:{},it:e}}(e);(0,q.reportError)(t,W)}x.reportTypeError=Q;var Z={};Object.defineProperty(Z,"__esModule",{value:!0}),Z.assignDefaults=void 0;const X=i,Y=l;function ee(e,t,r){const{gen:s,compositeRule:a,data:o,opts:n}=e;if(void 0===r)return;const i=X._`${o}${(0,X.getProperty)(t)}`;if(a)return void(0,Y.checkStrictMode)(e,`default is ignored for: ${i}`);let c=X._`${i} === undefined`;"empty"===n.useDefaults&&(c=X._`${c} || ${i} === null || ${i} === ""`),s.if(c,X._`${i} = ${(0,X.stringify)(r)}`)}Z.assignDefaults=function(e,t){const{properties:r,items:s}=e.schema;if("object"===t&&r)for(const a in r)ee(e,a,r[a].default);else"array"===t&&Array.isArray(s)&&s.forEach((t,r)=>ee(e,r,t.default))};var te={},re={};Object.defineProperty(re,"__esModule",{value:!0}),re.validateUnion=re.validateArray=re.usePattern=re.callValidateCode=re.schemaProperties=re.allSchemaProperties=re.noPropertyInData=re.propertyInData=re.isOwnProperty=re.hasPropFunc=re.reportMissingProp=re.checkMissingProp=re.checkReportMissingProp=void 0;const se=i,ae=l,oe=E,ne=l;function ie(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:se._`Object.prototype.hasOwnProperty`})}function ce(e,t,r){return se._`${ie(e)}.call(${t}, ${r})`}function de(e,t,r,s){const a=se._`${t}${(0,se.getProperty)(r)} === undefined`;return s?(0,se.or)(a,(0,se.not)(ce(e,t,r))):a}function le(e){return e?Object.keys(e).filter(e=>"__proto__"!==e):[]}re.checkReportMissingProp=function(e,t){const{gen:r,data:s,it:a}=e;r.if(de(r,s,t,a.opts.ownProperties),()=>{e.setParams({missingProperty:se._`${t}`},!0),e.error()})},re.checkMissingProp=function({gen:e,data:t,it:{opts:r}},s,a){return(0,se.or)(...s.map(s=>(0,se.and)(de(e,t,s,r.ownProperties),se._`${a} = ${s}`)))},re.reportMissingProp=function(e,t){e.setParams({missingProperty:t},!0),e.error()},re.hasPropFunc=ie,re.isOwnProperty=ce,re.propertyInData=function(e,t,r,s){const a=se._`${t}${(0,se.getProperty)(r)} !== undefined`;return s?se._`${a} && ${ce(e,t,r)}`:a},re.noPropertyInData=de,re.allSchemaProperties=le,re.schemaProperties=function(e,t){return le(t).filter(r=>!(0,ae.alwaysValidSchema)(e,t[r]))},re.callValidateCode=function({schemaCode:e,data:t,it:{gen:r,topSchemaRef:s,schemaPath:a,errorPath:o},it:n},i,c,d){const l=d?se._`${e}, ${t}, ${s}${a}`:t,u=[[oe.default.instancePath,(0,se.strConcat)(oe.default.instancePath,o)],[oe.default.parentData,n.parentData],[oe.default.parentDataProperty,n.parentDataProperty],[oe.default.rootData,oe.default.rootData]];n.opts.dynamicRef&&u.push([oe.default.dynamicAnchors,oe.default.dynamicAnchors]);const f=se._`${l}, ${r.object(...u)}`;return c!==se.nil?se._`${i}.call(${c}, ${f})`:se._`${i}(${f})`};const ue=se._`new RegExp`;re.usePattern=function({gen:e,it:{opts:t}},r){const s=t.unicodeRegExp?"u":"",{regExp:a}=t.code,o=a(r,s);return e.scopeValue("pattern",{key:o.toString(),ref:o,code:se._`${"new RegExp"===a.code?ue:(0,ne.useFunc)(e,a)}(${r}, ${s})`})},re.validateArray=function(e){const{gen:t,data:r,keyword:s,it:a}=e,o=t.name("valid");if(a.allErrors){const e=t.let("valid",!0);return n(()=>t.assign(e,!1)),e}return t.var(o,!0),n(()=>t.break()),o;function n(a){const n=t.const("len",se._`${r}.length`);t.forRange("i",0,n,r=>{e.subschema({keyword:s,dataProp:r,dataPropType:ae.Type.Num},o),t.if((0,se.not)(o),a)})}},re.validateUnion=function(e){const{gen:t,schema:r,keyword:s,it:a}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(e=>(0,ae.alwaysValidSchema)(a,e))&&!a.opts.unevaluated)return;const o=t.let("valid",!1),n=t.name("_valid");t.block(()=>r.forEach((r,a)=>{const i=e.subschema({keyword:s,schemaProp:a,compositeRule:!0},n);t.assign(o,se._`${o} || ${n}`);e.mergeValidEvaluated(i,n)||t.if((0,se.not)(o))})),e.result(o,()=>e.reset(),()=>e.error(!0))},Object.defineProperty(te,"__esModule",{value:!0}),te.validateKeywordUsage=te.validSchemaType=te.funcKeywordCode=te.macroKeywordCode=void 0;const fe=i,he=E,me=re,pe=n;function ye(e){const{gen:t,data:r,it:s}=e;t.if(s.parentData,()=>t.assign(r,fe._`${s.parentData}[${s.parentDataProperty}]`))}function ve(e,t,r){if(void 0===r)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword","function"==typeof r?{ref:r}:{ref:r,code:(0,fe.stringify)(r)})}te.macroKeywordCode=function(e,t){const{gen:r,keyword:s,schema:a,parentSchema:o,it:n}=e,i=t.macro.call(n.self,a,o,n),c=ve(r,s,i);!1!==n.opts.validateSchema&&n.self.validateSchema(i,!0);const d=r.name("valid");e.subschema({schema:i,schemaPath:fe.nil,errSchemaPath:`${n.errSchemaPath}/${s}`,topSchemaRef:c,compositeRule:!0},d),e.pass(d,()=>e.error(!0))},te.funcKeywordCode=function(e,t){var r;const{gen:s,keyword:a,schema:o,parentSchema:n,$data:i,it:c}=e;!function({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}(c,t);const d=!i&&t.compile?t.compile.call(c.self,o,n,c):t.validate,l=ve(s,a,d),u=s.let("valid");function f(r=(t.async?fe._`await `:fe.nil)){const a=c.opts.passContext?he.default.this:he.default.self,o=!("compile"in t&&!i||!1===t.schema);s.assign(u,fe._`${r}${(0,me.callValidateCode)(e,l,a,o)}`,t.modifying)}function h(e){var r;s.if((0,fe.not)(null!==(r=t.valid)&&void 0!==r?r:u),e)}e.block$data(u,function(){if(!1===t.errors)f(),t.modifying&&ye(e),h(()=>e.error());else{const r=t.async?function(){const e=s.let("ruleErrs",null);return s.try(()=>f(fe._`await `),t=>s.assign(u,!1).if(fe._`${t} instanceof ${c.ValidationError}`,()=>s.assign(e,fe._`${t}.errors`),()=>s.throw(t))),e}():function(){const e=fe._`${l}.errors`;return s.assign(e,null),f(fe.nil),e}();t.modifying&&ye(e),h(()=>function(e,t){const{gen:r}=e;r.if(fe._`Array.isArray(${t})`,()=>{r.assign(he.default.vErrors,fe._`${he.default.vErrors} === null ? ${t} : ${he.default.vErrors}.concat(${t})`).assign(he.default.errors,fe._`${he.default.vErrors}.length`),(0,pe.extendErrors)(e)},()=>e.error())}(e,r))}}),e.ok(null!==(r=t.valid)&&void 0!==r?r:u)},te.validSchemaType=function(e,t,r=!1){return!t.length||t.some(t=>"array"===t?Array.isArray(e):"object"===t?e&&"object"==typeof e&&!Array.isArray(e):typeof e==t||r&&void 0===e)},te.validateKeywordUsage=function({schema:e,opts:t,self:r,errSchemaPath:s},a,o){if(Array.isArray(a.keyword)?!a.keyword.includes(o):a.keyword!==o)throw new Error("ajv implementation error");const n=a.dependencies;if(null==n?void 0:n.some(t=>!Object.prototype.hasOwnProperty.call(e,t)))throw new Error(`parent schema must have dependencies of ${o}: ${n.join(",")}`);if(a.validateSchema){if(!a.validateSchema(e[o])){const e=`keyword "${o}" value is invalid at path "${s}": `+r.errorsText(a.validateSchema.errors);if("log"!==t.validateSchema)throw new Error(e);r.logger.error(e)}}};var $e={};Object.defineProperty($e,"__esModule",{value:!0}),$e.extendSubschemaMode=$e.extendSubschemaData=$e.getSubschema=void 0;const ge=i,_e=l;$e.getSubschema=function(e,{keyword:t,schemaProp:r,schema:s,schemaPath:a,errSchemaPath:o,topSchemaRef:n}){if(void 0!==t&&void 0!==s)throw new Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==t){const s=e.schema[t];return void 0===r?{schema:s,schemaPath:ge._`${e.schemaPath}${(0,ge.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:s[r],schemaPath:ge._`${e.schemaPath}${(0,ge.getProperty)(t)}${(0,ge.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,_e.escapeFragment)(r)}`}}if(void 0!==s){if(void 0===a||void 0===o||void 0===n)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:s,schemaPath:a,topSchemaRef:n,errSchemaPath:o}}throw new Error('either "keyword" or "schema" must be passed')},$e.extendSubschemaData=function(e,t,{dataProp:r,dataPropType:s,data:a,dataTypes:o,propertyName:n}){if(void 0!==a&&void 0!==r)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:i}=t;if(void 0!==r){const{errorPath:a,dataPathArr:o,opts:n}=t;c(i.let("data",ge._`${t.data}${(0,ge.getProperty)(r)}`,!0)),e.errorPath=ge.str`${a}${(0,_e.getErrorPath)(r,s,n.jsPropertySyntax)}`,e.parentDataProperty=ge._`${r}`,e.dataPathArr=[...o,e.parentDataProperty]}if(void 0!==a){c(a instanceof ge.Name?a:i.let("data",a,!0)),void 0!==n&&(e.propertyName=n)}function c(r){e.data=r,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,r]}o&&(e.dataTypes=o)},$e.extendSubschemaMode=function(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:s,createErrors:a,allErrors:o}){void 0!==s&&(e.compositeRule=s),void 0!==a&&(e.createErrors=a),void 0!==o&&(e.allErrors=o),e.jtdDiscriminator=t,e.jtdMetadata=r};var be={},we=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;var s,a,o;if(Array.isArray(t)){if((s=t.length)!=r.length)return!1;for(a=s;0!==a--;)if(!e(t[a],r[a]))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=(o=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(a=s;0!==a--;)if(!Object.prototype.hasOwnProperty.call(r,o[a]))return!1;for(a=s;0!==a--;){var n=o[a];if(!e(t[n],r[n]))return!1}return!0}return t!=t&&r!=r},Pe={exports:{}},Ee=Pe.exports=function(e,t,r){"function"==typeof t&&(r=t,t={}),Se(t,"function"==typeof(r=t.cb||r)?r:r.pre||function(){},r.post||function(){},e,"",e)};function Se(e,t,r,s,a,o,n,i,c,d){if(s&&"object"==typeof s&&!Array.isArray(s)){for(var l in t(s,a,o,n,i,c,d),s){var u=s[l];if(Array.isArray(u)){if(l in Ee.arrayKeywords)for(var f=0;f<u.length;f++)Se(e,t,r,u[f],a+"/"+l+"/"+f,o,a,l,s,f)}else if(l in Ee.propsKeywords){if(u&&"object"==typeof u)for(var h in u)Se(e,t,r,u[h],a+"/"+l+"/"+ke(h),o,a,l,s,h)}else(l in Ee.keywords||e.allKeys&&!(l in Ee.skipKeywords))&&Se(e,t,r,u,a+"/"+l,o,a,l,s)}r(s,a,o,n,i,c,d)}}function ke(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}Ee.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},Ee.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},Ee.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},Ee.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};var je=Pe.exports;Object.defineProperty(be,"__esModule",{value:!0}),be.getSchemaRefs=be.resolveUrl=be.normalizeId=be._getFullPath=be.getFullPath=be.inlineRef=void 0;const Ne=l,Oe=we,Re=je,Ce=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);be.inlineRef=function(e,t=!0){return"boolean"==typeof e||(!0===t?!Ie(e):!!t&&Te(e)<=t)};const xe=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Ie(e){for(const t in e){if(xe.has(t))return!0;const r=e[t];if(Array.isArray(r)&&r.some(Ie))return!0;if("object"==typeof r&&Ie(r))return!0}return!1}function Te(e){let t=0;for(const r in e){if("$ref"===r)return 1/0;if(t++,!Ce.has(r)&&("object"==typeof e[r]&&(0,Ne.eachItem)(e[r],e=>t+=Te(e)),t===1/0))return 1/0}return t}function Me(e,t="",r){!1!==r&&(t=Ve(t));const s=e.parse(t);return Ae(e,s)}function Ae(e,t){return e.serialize(t).split("#")[0]+"#"}be.getFullPath=Me,be._getFullPath=Ae;const De=/#\/?$/;function Ve(e){return e?e.replace(De,""):""}be.normalizeId=Ve,be.resolveUrl=function(e,t,r){return r=Ve(r),e.resolve(t,r)};const ze=/^[a-z_][-a-z0-9._]*$/i;be.getSchemaRefs=function(e,t){if("boolean"==typeof e)return{};const{schemaId:r,uriResolver:s}=this.opts,a=Ve(e[r]||t),o={"":a},n=Me(s,a,!1),i={},c=new Set;return Re(e,{allKeys:!0},(e,t,s,a)=>{if(void 0===a)return;const u=n+t;let f=o[a];function h(t){const r=this.opts.uriResolver.resolve;if(t=Ve(f?r(f,t):t),c.has(t))throw l(t);c.add(t);let s=this.refs[t];return"string"==typeof s&&(s=this.refs[s]),"object"==typeof s?d(e,s.schema,t):t!==Ve(u)&&("#"===t[0]?(d(e,i[t],t),i[t]=e):this.refs[t]=u),t}function m(e){if("string"==typeof e){if(!ze.test(e))throw new Error(`invalid anchor "${e}"`);h.call(this,`#${e}`)}}"string"==typeof e[r]&&(f=h.call(this,e[r])),m.call(this,e.$anchor),m.call(this,e.$dynamicAnchor),o[t]=f}),i;function d(e,t,r){if(void 0!==t&&!Oe(e,t))throw l(r)}function l(e){return new Error(`reference "${e}" resolves to more than one schema`)}},Object.defineProperty(a,"__esModule",{value:!0}),a.getData=a.KeywordCxt=a.validateFunctionCode=void 0;const qe=o,Ue=x,Ke=M,Fe=x,Le=Z,Ge=te,He=$e,Je=i,Be=E,We=be,Qe=l,Ze=n;function Xe({gen:e,validateName:t,schema:r,schemaEnv:s,opts:a},o){a.code.es5?e.func(t,Je._`${Be.default.data}, ${Be.default.valCxt}`,s.$async,()=>{e.code(Je._`"use strict"; ${Ye(r,a)}`),function(e,t){e.if(Be.default.valCxt,()=>{e.var(Be.default.instancePath,Je._`${Be.default.valCxt}.${Be.default.instancePath}`),e.var(Be.default.parentData,Je._`${Be.default.valCxt}.${Be.default.parentData}`),e.var(Be.default.parentDataProperty,Je._`${Be.default.valCxt}.${Be.default.parentDataProperty}`),e.var(Be.default.rootData,Je._`${Be.default.valCxt}.${Be.default.rootData}`),t.dynamicRef&&e.var(Be.default.dynamicAnchors,Je._`${Be.default.valCxt}.${Be.default.dynamicAnchors}`)},()=>{e.var(Be.default.instancePath,Je._`""`),e.var(Be.default.parentData,Je._`undefined`),e.var(Be.default.parentDataProperty,Je._`undefined`),e.var(Be.default.rootData,Be.default.data),t.dynamicRef&&e.var(Be.default.dynamicAnchors,Je._`{}`)})}(e,a),e.code(o)}):e.func(t,Je._`${Be.default.data}, ${function(e){return Je._`{${Be.default.instancePath}="", ${Be.default.parentData}, ${Be.default.parentDataProperty}, ${Be.default.rootData}=${Be.default.data}${e.dynamicRef?Je._`, ${Be.default.dynamicAnchors}={}`:Je.nil}}={}`}(a)}`,s.$async,()=>e.code(Ye(r,a)).code(o))}function Ye(e,t){const r="object"==typeof e&&e[t.schemaId];return r&&(t.code.source||t.code.process)?Je._`/*# sourceURL=${r} */`:Je.nil}function et(e,t){rt(e)&&(st(e),tt(e))?function(e,t){const{schema:r,gen:s,opts:a}=e;a.$comment&&r.$comment&&ot(e);(function(e){const t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,We.resolveUrl)(e.opts.uriResolver,e.baseId,t))})(e),function(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}(e);const o=s.const("_errs",Be.default.errors);at(e,o),s.var(t,Je._`${o} === ${Be.default.errors}`)}(e,t):(0,qe.boolOrEmptySchema)(e,t)}function tt({schema:e,self:t}){if("boolean"==typeof e)return!e;for(const r in e)if(t.RULES.all[r])return!0;return!1}function rt(e){return"boolean"!=typeof e.schema}function st(e){(0,Qe.checkUnknownRules)(e),function(e){const{schema:t,errSchemaPath:r,opts:s,self:a}=e;t.$ref&&s.ignoreKeywordsWithRef&&(0,Qe.schemaHasRulesButRef)(t,a.RULES)&&a.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}(e)}function at(e,t){if(e.opts.jtd)return nt(e,[],!1,t);const r=(0,Ue.getSchemaTypes)(e.schema);nt(e,r,!(0,Ue.coerceAndCheckDataType)(e,r),t)}function ot({gen:e,schemaEnv:t,schema:r,errSchemaPath:s,opts:a}){const o=r.$comment;if(!0===a.$comment)e.code(Je._`${Be.default.self}.logger.log(${o})`);else if("function"==typeof a.$comment){const r=Je.str`${s}/$comment`,a=e.scopeValue("root",{ref:t.root});e.code(Je._`${Be.default.self}.opts.$comment(${o}, ${r}, ${a}.schema)`)}}function nt(e,t,r,s){const{gen:a,schema:o,data:n,allErrors:i,opts:c,self:d}=e,{RULES:l}=d;function u(d){(0,Ke.shouldUseGroup)(o,d)&&(d.type?(a.if((0,Fe.checkDataType)(d.type,n,c.strictNumbers)),it(e,d),1===t.length&&t[0]===d.type&&r&&(a.else(),(0,Fe.reportTypeError)(e)),a.endIf()):it(e,d),i||a.if(Je._`${Be.default.errors} === ${s||0}`))}!o.$ref||!c.ignoreKeywordsWithRef&&(0,Qe.schemaHasRulesButRef)(o,l)?(c.jtd||function(e,t){if(e.schemaEnv.meta||!e.opts.strictTypes)return;(function(e,t){if(!t.length)return;if(!e.dataTypes.length)return void(e.dataTypes=t);t.forEach(t=>{dt(e.dataTypes,t)||lt(e,`type "${t}" not allowed by context "${e.dataTypes.join(",")}"`)}),function(e,t){const r=[];for(const s of e.dataTypes)dt(t,s)?r.push(s):t.includes("integer")&&"number"===s&&r.push("integer");e.dataTypes=r}(e,t)})(e,t),e.opts.allowUnionTypes||function(e,t){t.length>1&&(2!==t.length||!t.includes("null"))&<(e,"use allowUnionTypes to allow union type keyword")}(e,t);!function(e,t){const r=e.self.RULES.all;for(const s in r){const a=r[s];if("object"==typeof a&&(0,Ke.shouldUseRule)(e.schema,a)){const{type:r}=a.definition;r.length&&!r.some(e=>ct(t,e))&<(e,`missing type "${r.join(",")}" for keyword "${s}"`)}}}(e,e.dataTypes)}(e,t),a.block(()=>{for(const e of l.rules)u(e);u(l.post)})):a.block(()=>ft(e,"$ref",l.all.$ref.definition))}function it(e,t){const{gen:r,schema:s,opts:{useDefaults:a}}=e;a&&(0,Le.assignDefaults)(e,t.type),r.block(()=>{for(const r of t.rules)(0,Ke.shouldUseRule)(s,r)&&ft(e,r.keyword,r.definition,t.type)})}function ct(e,t){return e.includes(t)||"number"===t&&e.includes("integer")}function dt(e,t){return e.includes(t)||"integer"===t&&e.includes("number")}function lt(e,t){t+=` at "${e.schemaEnv.baseId+e.errSchemaPath}" (strictTypes)`,(0,Qe.checkStrictMode)(e,t,e.opts.strictTypes)}a.validateFunctionCode=function(e){rt(e)&&(st(e),tt(e))?function(e){const{schema:t,opts:r,gen:s}=e;Xe(e,()=>{r.$comment&&t.$comment&&ot(e),function(e){const{schema:t,opts:r}=e;void 0!==t.default&&r.useDefaults&&r.strictSchema&&(0,Qe.checkStrictMode)(e,"default is ignored in the schema root")}(e),s.let(Be.default.vErrors,null),s.let(Be.default.errors,0),r.unevaluated&&function(e){const{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",Je._`${r}.evaluated`),t.if(Je._`${e.evaluated}.dynamicProps`,()=>t.assign(Je._`${e.evaluated}.props`,Je._`undefined`)),t.if(Je._`${e.evaluated}.dynamicItems`,()=>t.assign(Je._`${e.evaluated}.items`,Je._`undefined`))}(e),at(e),function(e){const{gen:t,schemaEnv:r,validateName:s,ValidationError:a,opts:o}=e;r.$async?t.if(Je._`${Be.default.errors} === 0`,()=>t.return(Be.default.data),()=>t.throw(Je._`new ${a}(${Be.default.vErrors})`)):(t.assign(Je._`${s}.errors`,Be.default.vErrors),o.unevaluated&&function({gen:e,evaluated:t,props:r,items:s}){r instanceof Je.Name&&e.assign(Je._`${t}.props`,r);s instanceof Je.Name&&e.assign(Je._`${t}.items`,s)}(e),t.return(Je._`${Be.default.errors} === 0`))}(e)})}(e):Xe(e,()=>(0,qe.topBoolOrEmptySchema)(e))};class ut{constructor(e,t,r){if((0,Ge.validateKeywordUsage)(e,t,r),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=r,this.data=e.data,this.schema=e.schema[r],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,Qe.schemaRefOrVal)(e,this.schema,r,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",pt(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,Ge.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw new Error(`${r} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:!1!==t.errors)&&(this.errsCount=e.gen.const("_errs",Be.default.errors))}result(e,t,r){this.failResult((0,Je.not)(e),t,r)}failResult(e,t,r){this.gen.if(e),r?r():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,Je.not)(e),void 0,t)}fail(e){if(void 0===e)return this.error(),void(this.allErrors||this.gen.if(!1));this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);const{schemaCode:t}=this;this.fail(Je._`${t} !== undefined && (${(0,Je.or)(this.invalid$data(),e)})`)}error(e,t,r){if(t)return this.setParams(t),this._error(e,r),void this.setParams({});this._error(e,r)}_error(e,t){(e?Ze.reportExtraError:Ze.reportError)(this,this.def.error,t)}$dataError(){(0,Ze.reportError)(this,this.def.$dataError||Ze.keyword$DataError)}reset(){if(void 0===this.errsCount)throw new Error('add "trackErrors" to keyword definition');(0,Ze.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,r=Je.nil){this.gen.block(()=>{this.check$data(e,r),t()})}check$data(e=Je.nil,t=Je.nil){if(!this.$data)return;const{gen:r,schemaCode:s,schemaType:a,def:o}=this;r.if((0,Je.or)(Je._`${s} === undefined`,t)),e!==Je.nil&&r.assign(e,!0),(a.length||o.validateSchema)&&(r.elseIf(this.invalid$data()),this.$dataError(),e!==Je.nil&&r.assign(e,!1)),r.else()}invalid$data(){const{gen:e,schemaCode:t,schemaType:r,def:s,it:a}=this;return(0,Je.or)(function(){if(r.length){if(!(t instanceof Je.Name))throw new Error("ajv implementation error");const e=Array.isArray(r)?r:[r];return Je._`${(0,Fe.checkDataTypes)(e,t,a.opts.strictNumbers,Fe.DataType.Wrong)}`}return Je.nil}(),function(){if(s.validateSchema){const r=e.scopeValue("validate$data",{ref:s.validateSchema});return Je._`!${r}(${t})`}return Je.nil}())}subschema(e,t){const r=(0,He.getSubschema)(this.it,e);(0,He.extendSubschemaData)(r,this.it,e),(0,He.extendSubschemaMode)(r,e);const s={...this.it,...r,items:void 0,props:void 0};return et(s,t),s}mergeEvaluated(e,t){const{it:r,gen:s}=this;r.opts.unevaluated&&(!0!==r.props&&void 0!==e.props&&(r.props=Qe.mergeEvaluated.props(s,e.props,r.props,t)),!0!==r.items&&void 0!==e.items&&(r.items=Qe.mergeEvaluated.items(s,e.items,r.items,t)))}mergeValidEvaluated(e,t){const{it:r,gen:s}=this;if(r.opts.unevaluated&&(!0!==r.props||!0!==r.items))return s.if(t,()=>this.mergeEvaluated(e,Je.Name)),!0}}function ft(e,t,r,s){const a=new ut(e,r,t);"code"in r?r.code(a,s):a.$data&&r.validate?(0,Ge.funcKeywordCode)(a,r):"macro"in r?(0,Ge.macroKeywordCode)(a,r):(r.compile||r.validate)&&(0,Ge.funcKeywordCode)(a,r)}a.KeywordCxt=ut;const ht=/^\/(?:[^~]|~0|~1)*$/,mt=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function pt(e,{dataLevel:t,dataNames:r,dataPathArr:s}){let a,o;if(""===e)return Be.default.rootData;if("/"===e[0]){if(!ht.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);a=e,o=Be.default.rootData}else{const n=mt.exec(e);if(!n)throw new Error(`Invalid JSON-pointer: ${e}`);const i=+n[1];if(a=n[2],"#"===a){if(i>=t)throw new Error(c("property/index",i));return s[t-i]}if(i>t)throw new Error(c("data",i));if(o=r[t-i],!a)return o}let n=o;const i=a.split("/");for(const d of i)d&&(o=Je._`${o}${(0,Je.getProperty)((0,Qe.unescapeJsonPointer)(d))}`,n=Je._`${n} && ${o}`);return n;function c(e,r){return`Cannot access ${e} ${r} levels up, current level is ${t}`}}a.getData=pt;var yt={};Object.defineProperty(yt,"__esModule",{value:!0});class vt extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}}yt.default=vt;var $t={};Object.defineProperty($t,"__esModule",{value:!0});const gt=be;class _t extends Error{constructor(e,t,r,s){super(s||`can't resolve reference ${r} from id ${t}`),this.missingRef=(0,gt.resolveUrl)(e,t,r),this.missingSchema=(0,gt.normalizeId)((0,gt.getFullPath)(e,this.missingRef))}}$t.default=_t;var bt={};Object.defineProperty(bt,"__esModule",{value:!0}),bt.resolveSchema=bt.getCompilingSchema=bt.resolveRef=bt.compileSchema=bt.SchemaEnv=void 0;const wt=i,Pt=yt,Et=E,St=be,kt=l,jt=a;class Nt{constructor(e){var t;let r;this.refs={},this.dynamicAnchors={},"object"==typeof e.schema&&(r=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=null!==(t=e.baseId)&&void 0!==t?t:(0,St.normalizeId)(null==r?void 0:r[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=null==r?void 0:r.$async,this.refs={}}}function Ot(e){const t=Ct.call(this,e);if(t)return t;const r=(0,St.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:s,lines:a}=this.opts.code,{ownProperties:o}=this.opts,n=new wt.CodeGen(this.scope,{es5:s,lines:a,ownProperties:o});let i;e.$async&&(i=n.scopeValue("Error",{ref:Pt.default,code:wt._`require("ajv/dist/runtime/validation_error").default`}));const c=n.scopeName("validate");e.validateName=c;const d={gen:n,allErrors:this.opts.allErrors,data:Et.default.data,parentData:Et.default.parentData,parentDataProperty:Et.default.parentDataProperty,dataNames:[Et.default.data],dataPathArr:[wt.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:n.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:(0,wt.stringify)(e.schema)}:{ref:e.schema}),validateName:c,ValidationError:i,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:wt.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:wt._`""`,opts:this.opts,self:this};let l;try{this._compilations.add(e),(0,jt.validateFunctionCode)(d),n.optimize(this.opts.code.optimize);const t=n.toString();l=`${n.scopeRefs(Et.default.scope)}return ${t}`,this.opts.code.process&&(l=this.opts.code.process(l,e));const r=new Function(`${Et.default.self}`,`${Et.default.scope}`,l)(this,this.scope.get());if(this.scope.value(c,{ref:r}),r.errors=null,r.schema=e.schema,r.schemaEnv=e,e.$async&&(r.$async=!0),!0===this.opts.code.source&&(r.source={validateName:c,validateCode:t,scopeValues:n._values}),this.opts.unevaluated){const{props:e,items:t}=d;r.evaluated={props:e instanceof wt.Name?void 0:e,items:t instanceof wt.Name?void 0:t,dynamicProps:e instanceof wt.Name,dynamicItems:t instanceof wt.Name},r.source&&(r.source.evaluated=(0,wt.stringify)(r.evaluated))}return e.validate=r,e}catch(u){throw delete e.validate,delete e.validateName,l&&this.logger.error("Error compiling schema, function code:",l),u}finally{this._compilations.delete(e)}}function Rt(e){return(0,St.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:Ot.call(this,e)}function Ct(e){for(const t of this._compilations)if(xt(t,e))return t}function xt(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function It(e,t){let r;for(;"string"==typeof(r=this.refs[t]);)t=r;return r||this.schemas[t]||Tt.call(this,e,t)}function Tt(e,t){const r=this.opts.uriResolver.parse(t),s=(0,St._getFullPath)(this.opts.uriResolver,r);let a=(0,St.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&s===a)return At.call(this,r,e);const o=(0,St.normalizeId)(s),n=this.refs[o]||this.schemas[o];if("string"==typeof n){const t=Tt.call(this,e,n);if("object"!=typeof(null==t?void 0:t.schema))return;return At.call(this,r,t)}if("object"==typeof(null==n?void 0:n.schema)){if(n.validate||Ot.call(this,n),o===(0,St.normalizeId)(t)){const{schema:t}=n,{schemaId:r}=this.opts,s=t[r];return s&&(a=(0,St.resolveUrl)(this.opts.uriResolver,a,s)),new Nt({schema:t,schemaId:r,root:e,baseId:a})}return At.call(this,r,n)}}bt.SchemaEnv=Nt,bt.compileSchema=Ot,bt.resolveRef=function(e,t,r){var s;r=(0,St.resolveUrl)(this.opts.uriResolver,t,r);const a=e.refs[r];if(a)return a;let o=It.call(this,e,r);if(void 0===o){const a=null===(s=e.localRefs)||void 0===s?void 0:s[r],{schemaId:n}=this.opts;a&&(o=new Nt({schema:a,schemaId:n,root:e,baseId:t}))}return void 0!==o?e.refs[r]=Rt.call(this,o):void 0},bt.getCompilingSchema=Ct,bt.resolveSchema=Tt;const Mt=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function At(e,{baseId:t,schema:r,root:s}){var a;if("/"!==(null===(a=e.fragment)||void 0===a?void 0:a[0]))return;for(const i of e.fragment.slice(1).split("/")){if("boolean"==typeof r)return;const e=r[(0,kt.unescapeFragment)(i)];if(void 0===e)return;const s="object"==typeof(r=e)&&r[this.opts.schemaId];!Mt.has(i)&&s&&(t=(0,St.resolveUrl)(this.opts.uriResolver,t,s))}let o;if("boolean"!=typeof r&&r.$ref&&!(0,kt.schemaHasRulesButRef)(r,this.RULES)){const e=(0,St.resolveUrl)(this.opts.uriResolver,t,r.$ref);o=Tt.call(this,s,e)}const{schemaId:n}=this.opts;return o=o||new Nt({schema:r,schemaId:n,root:s,baseId:t}),o.schema!==o.root.schema?o:void 0}const Dt={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1};var Vt={},zt={exports:{}};const qt=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),Ut=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 Kt(e){let t="",r=0,s=0;for(s=0;s<e.length;s++)if(r=e[s].charCodeAt(0),48!==r){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[s];break}for(s+=1;s<e.length;s++){if(r=e[s].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[s]}return t}function Ft(e){return e.length=0,!0}function Lt(e,t,r){if(e.length){const s=Kt(e);if(""===s)return r.error=!0,!1;t.push(s),e.length=0}return!0}function Gt(e){if(function(e,t){let r=0;for(let s=0;s<e.length;s++)e[s]===t&&r++;return r}(e,":")<2)return{host:e,isIPV6:!1};const t=function(e){let t=0;const r={error:!1,address:"",zone:""},s=[],a=[];let o=!1,n=!1,i=Lt;for(let c=0;c<e.length;c++){const d=e[c];if("["!==d&&"]"!==d)if(":"!==d)if("%"===d){if(!i(a,s,r))break;i=Ft}else a.push(d);else{if(!0===o&&(n=!0),!i(a,s,r))break;if(++t>7){r.error=!0;break}c>0&&":"===e[c-1]&&(o=!0),s.push(":")}}return a.length&&(i===Ft?r.zone=a.join(""):n?s.push(a.join("")):s.push(Kt(a))),r.address=s.join(""),r}(e);if(t.error)return{host:e,isIPV6:!1};{let e=t.address,r=t.address;return t.zone&&(e+="%"+t.zone,r+="%25"+t.zone),{host:e,isIPV6:!0,escapedHost:r}}}var Ht={nonSimpleDomain:RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u),recomposeAuthority:function(e){const t=[];if(void 0!==e.userinfo&&(t.push(e.userinfo),t.push("@")),void 0!==e.host){let r=unescape(e.host);if(!Ut(r)){const t=Gt(r);r=!0===t.isIPV6?`[${t.escapedHost}]`:e.host}t.push(r)}return"number"!=typeof e.port&&"string"!=typeof e.port||(t.push(":"),t.push(String(e.port))),t.length?t.join(""):void 0},normalizeComponentEncoding:function(e,t){const r=!0!==t?escape:unescape;return void 0!==e.scheme&&(e.scheme=r(e.scheme)),void 0!==e.userinfo&&(e.userinfo=r(e.userinfo)),void 0!==e.host&&(e.host=r(e.host)),void 0!==e.path&&(e.path=r(e.path)),void 0!==e.query&&(e.query=r(e.query)),void 0!==e.fragment&&(e.fragment=r(e.fragment)),e},removeDotSegments:function(e){let t=e;const r=[];let s=-1,a=0;for(;a=t.length;){if(1===a){if("."===t)break;if("/"===t){r.push("/");break}r.push(t);break}if(2===a){if("."===t[0]){if("."===t[1])break;if("/"===t[1]){t=t.slice(2);continue}}else if("/"===t[0]&&("."===t[1]||"/"===t[1])){r.push("/");break}}else if(3===a&&"/.."===t){0!==r.length&&r.pop(),r.push("/");break}if("."===t[0]){if("."===t[1]){if("/"===t[2]){t=t.slice(3);continue}}else if("/"===t[1]){t=t.slice(2);continue}}else if("/"===t[0]&&"."===t[1]){if("/"===t[2]){t=t.slice(2);continue}if("."===t[2]&&"/"===t[3]){t=t.slice(3),0!==r.length&&r.pop();continue}}if(-1===(s=t.indexOf("/",1))){r.push(t);break}r.push(t.slice(0,s)),t=t.slice(s)}return r.join("")},isIPv4:Ut,isUUID:qt,normalizeIPv6:Gt};const{isUUID:Jt}=Ht,Bt=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function Wt(e){return!0===e.secure||!1!==e.secure&&(!!e.scheme&&!(3!==e.scheme.length||"w"!==e.scheme[0]&&"W"!==e.scheme[0]||"s"!==e.scheme[1]&&"S"!==e.scheme[1]||"s"!==e.scheme[2]&&"S"!==e.scheme[2]))}function Qt(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function Zt(e){const t="https"===String(e.scheme).toLowerCase();return e.port!==(t?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}const Xt={scheme:"http",domainHost:!0,parse:Qt,serialize:Zt},Yt={scheme:"ws",domainHost:!0,parse:function(e){return e.secure=Wt(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e},serialize:function(e){if(e.port!==(Wt(e)?443:80)&&""!==e.port||(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){const[t,r]=e.resourceName.split("?");e.path=t&&"/"!==t?t:void 0,e.query=r,e.resourceName=void 0}return e.fragment=void 0,e}},er={http:Xt,https:{scheme:"https",domainHost:Xt.domainHost,parse:Qt,serialize:Zt},ws:Yt,wss:{scheme:"wss",domainHost:Yt.domainHost,parse:Yt.parse,serialize:Yt.serialize},urn:{scheme:"urn",parse:function(e,t){if(!e.path)return e.error="URN can not be parsed",e;const r=e.path.match(Bt);if(r){const s=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];const a=tr(`${s}:${t.nid||e.nid}`);e.path=void 0,a&&(e=a.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e},serialize:function(e,t){if(void 0===e.nid)throw new Error("URN without nid cannot be serialized");const r=t.scheme||e.scheme||"urn",s=e.nid.toLowerCase(),a=tr(`${r}:${t.nid||s}`);a&&(e=a.serialize(e,t));const o=e,n=e.nss;return o.path=`${s||t.nid}:${n}`,t.skipEscape=!0,o},skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:function(e,t){const r=e;return r.uuid=r.nss,r.nss=void 0,t.tolerant||r.uuid&&Jt(r.uuid)||(r.error=r.error||"UUID is not valid."),r},serialize:function(e){const t=e;return t.nss=(e.uuid||"").toLowerCase(),t},skipNormalize:!0}};function tr(e){return e&&(er[e]||er[e.toLowerCase()])||void 0}Object.setPrototypeOf(er,null);var rr={SCHEMES:er,getSchemeHandler:tr};const{normalizeIPv6:sr,removeDotSegments:ar,recomposeAuthority:or,normalizeComponentEncoding:nr,isIPv4:ir,nonSimpleDomain:cr}=Ht,{SCHEMES:dr,getSchemeHandler:lr}=rr;function ur(e,t,r,s){const a={};return s||(e=mr(fr(e,r),r),t=mr(fr(t,r),r)),!(r=r||{}).tolerant&&t.scheme?(a.scheme=t.scheme,a.userinfo=t.userinfo,a.host=t.host,a.port=t.port,a.path=ar(t.path||""),a.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(a.userinfo=t.userinfo,a.host=t.host,a.port=t.port,a.path=ar(t.path||""),a.query=t.query):(t.path?("/"===t.path[0]?a.path=ar(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?a.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:a.path=t.path:a.path="/"+t.path,a.path=ar(a.path)),a.query=t.query):(a.path=e.path,void 0!==t.query?a.query=t.query:a.query=e.query),a.userinfo=e.userinfo,a.host=e.host,a.port=e.port),a.scheme=e.scheme),a.fragment=t.fragment,a}function fr(e,t){const r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},s=Object.assign({},t),a=[],o=lr(s.scheme||r.scheme);o&&o.serialize&&o.serialize(r,s),void 0!==r.path&&(s.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),void 0!==r.scheme&&(r.path=r.path.split("%3A").join(":")))),"suffix"!==s.reference&&r.scheme&&a.push(r.scheme,":");const n=or(r);if(void 0!==n&&("suffix"!==s.reference&&a.push("//"),a.push(n),r.path&&"/"!==r.path[0]&&a.push("/")),void 0!==r.path){let e=r.path;s.absolutePath||o&&o.absolutePath||(e=ar(e)),void 0===n&&"/"===e[0]&&"/"===e[1]&&(e="/%2F"+e.slice(2)),a.push(e)}return void 0!==r.query&&a.push("?",r.query),void 0!==r.fragment&&a.push("#",r.fragment),a.join("")}const hr=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function mr(e,t){const r=Object.assign({},t),s={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let a=!1;"suffix"===r.reference&&(e=r.scheme?r.scheme+":"+e:"//"+e);const o=e.match(hr);if(o){if(s.scheme=o[1],s.userinfo=o[3],s.host=o[4],s.port=parseInt(o[5],10),s.path=o[6]||"",s.query=o[7],s.fragment=o[8],isNaN(s.port)&&(s.port=o[5]),s.host){if(!1===ir(s.host)){const e=sr(s.host);s.host=e.host.toLowerCase(),a=e.isIPV6}else a=!0}void 0!==s.scheme||void 0!==s.userinfo||void 0!==s.host||void 0!==s.port||void 0!==s.query||s.path?void 0===s.scheme?s.reference="relative":void 0===s.fragment?s.reference="absolute":s.reference="uri":s.reference="same-document",r.reference&&"suffix"!==r.reference&&r.reference!==s.reference&&(s.error=s.error||"URI is not a "+r.reference+" reference.");const t=lr(r.scheme||s.scheme);if(!(r.unicodeSupport||t&&t.unicodeSupport)&&s.host&&(r.domainHost||t&&t.domainHost)&&!1===a&&cr(s.host))try{s.host=URL.domainToASCII(s.host.toLowerCase())}catch(n){s.error=s.error||"Host's domain name can not be converted to ASCII: "+n}(!t||t&&!t.skipNormalize)&&(-1!==e.indexOf("%")&&(void 0!==s.scheme&&(s.scheme=unescape(s.scheme)),void 0!==s.host&&(s.host=unescape(s.host))),s.path&&(s.path=escape(unescape(s.path))),s.fragment&&(s.fragment=encodeURI(decodeURIComponent(s.fragment)))),t&&t.parse&&t.parse(s,r)}else s.error=s.error||"URI can not be parsed.";return s}const pr={SCHEMES:dr,normalize:function(e,t){return"string"==typeof e?e=fr(mr(e,t),t):"object"==typeof e&&(e=mr(fr(e,t),t)),e},resolve:function(e,t,r){const s=r?Object.assign({scheme:"null"},r):{scheme:"null"},a=ur(mr(e,s),mr(t,s),s,!0);return s.skipEscape=!0,fr(a,s)},resolveComponent:ur,equal:function(e,t,r){return"string"==typeof e?(e=unescape(e),e=fr(nr(mr(e,r),!0),{...r,skipEscape:!0})):"object"==typeof e&&(e=fr(nr(e,!0),{...r,skipEscape:!0})),"string"==typeof t?(t=unescape(t),t=fr(nr(mr(t,r),!0),{...r,skipEscape:!0})):"object"==typeof t&&(t=fr(nr(t,!0),{...r,skipEscape:!0})),e.toLowerCase()===t.toLowerCase()},serialize:fr,parse:mr};zt.exports=pr,zt.exports.default=pr,zt.exports.fastUri=pr;var yr=zt.exports;Object.defineProperty(Vt,"__esModule",{value:!0});const vr=yr;vr.code='require("ajv/dist/runtime/uri").default',Vt.default=vr,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=a;Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=i;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 s=yt,o=$t,n=I,c=bt,d=i,u=be,f=x,h=l,m=Dt,p=Vt,y=(e,t)=>new RegExp(e,t);y.code="new RegExp";const v=["removeAdditional","useDefaults","coerceTypes"],$=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),g={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."},_={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'};function b(e){var t,r,s,a,o,n,i,c,d,l,u,f,h,m,v,$,g,_,b,w,P,E,S,k,j;const N=e.strict,O=null===(t=e.code)||void 0===t?void 0:t.optimize,R=!0===O||void 0===O?1:O||0,C=null!==(s=null===(r=e.code)||void 0===r?void 0:r.regExp)&&void 0!==s?s:y,x=null!==(a=e.uriResolver)&&void 0!==a?a:p.default;return{strictSchema:null===(n=null!==(o=e.strictSchema)&&void 0!==o?o:N)||void 0===n||n,strictNumbers:null===(c=null!==(i=e.strictNumbers)&&void 0!==i?i:N)||void 0===c||c,strictTypes:null!==(l=null!==(d=e.strictTypes)&&void 0!==d?d:N)&&void 0!==l?l:"log",strictTuples:null!==(f=null!==(u=e.strictTuples)&&void 0!==u?u:N)&&void 0!==f?f:"log",strictRequired:null!==(m=null!==(h=e.strictRequired)&&void 0!==h?h:N)&&void 0!==m&&m,code:e.code?{...e.code,optimize:R,regExp:C}:{optimize:R,regExp:C},loopRequired:null!==(v=e.loopRequired)&&void 0!==v?v:200,loopEnum:null!==($=e.loopEnum)&&void 0!==$?$:200,meta:null===(g=e.meta)||void 0===g||g,messages:null===(_=e.messages)||void 0===_||_,inlineRefs:null===(b=e.inlineRefs)||void 0===b||b,schemaId:null!==(w=e.schemaId)&&void 0!==w?w:"$id",addUsedSchema:null===(P=e.addUsedSchema)||void 0===P||P,validateSchema:null===(E=e.validateSchema)||void 0===E||E,validateFormats:null===(S=e.validateFormats)||void 0===S||S,unicodeRegExp:null===(k=e.unicodeRegExp)||void 0===k||k,int32range:null===(j=e.int32range)||void 0===j||j,uriResolver:x}}class w{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...b(e)};const{es5:t,lines:r}=this.opts.code;this.scope=new d.ValueScope({scope:{},prefixes:$,es5:t,lines:r}),this.logger=function(e){if(!1===e)return O;if(void 0===e)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}(e.logger);const s=e.validateFormats;e.validateFormats=!1,this.RULES=(0,n.getRules)(),P.call(this,g,e,"NOT SUPPORTED"),P.call(this,_,e,"DEPRECATED","warn"),this._metaOpts=N.call(this),e.formats&&k.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&j.call(this,e.keywords),"object"==typeof e.meta&&this.addMetaSchema(e.meta),S.call(this),e.validateFormats=s}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:e,meta:t,schemaId:r}=this.opts;let s=m;"id"===r&&(s={...m},s.id=s.$id,delete s.$id),t&&e&&this.addMetaSchema(s,s[r],!1)}defaultMeta(){const{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta="object"==typeof e?e[t]||e:void 0}validate(e,t){let r;if("string"==typeof e){if(r=this.getSchema(e),!r)throw new Error(`no schema with key or ref "${e}"`)}else r=this.compile(e);const s=r(t);return"$async"in r||(this.errors=r.errors),s}compile(e,t){const r=this._addSchema(e,t);return r.validate||this._compileSchemaEnv(r)}compileAsync(e,t){if("function"!=typeof this.opts.loadSchema)throw new Error("options.loadSchema should be a function");const{loadSchema:r}=this.opts;return s.call(this,e,t);async function s(e,t){await a.call(this,e.$schema);const r=this._addSchema(e,t);return r.validate||n.call(this,r)}async function a(e){e&&!this.getSchema(e)&&await s.call(this,{$ref:e},!0)}async function n(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof o.default))throw t;return i.call(this,t),await c.call(this,t.missingSchema),n.call(this,e)}}function i({missingSchema:e,missingRef:t}){if(this.refs[e])throw new Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function c(e){const r=await d.call(this,e);this.refs[e]||await a.call(this,r.$schema),this.refs[e]||this.addSchema(r,e,t)}async function d(e){const t=this._loading[e];if(t)return t;try{return await(this._loading[e]=r(e))}finally{delete this._loading[e]}}}addSchema(e,t,r,s=this.opts.validateSchema){if(Array.isArray(e)){for(const t of e)this.addSchema(t,void 0,r,s);return this}let a;if("object"==typeof e){const{schemaId:t}=this.opts;if(a=e[t],void 0!==a&&"string"!=typeof a)throw new Error(`schema ${t} must be string`)}return t=(0,u.normalizeId)(t||a),this._checkUnique(t),this.schemas[t]=this._addSchema(e,r,t,s,!0),this}addMetaSchema(e,t,r=this.opts.validateSchema){return this.addSchema(e,t,!0,r),this}validateSchema(e,t){if("boolean"==typeof e)return!0;let r;if(r=e.$schema,void 0!==r&&"string"!=typeof r)throw new Error("$schema must be a string");if(r=r||this.opts.defaultMeta||this.defaultMeta(),!r)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const s=this.validate(r,e);if(!s&&t){const e="schema is invalid: "+this.errorsText();if("log"!==this.opts.validateSchema)throw new Error(e);this.logger.error(e)}return s}getSchema(e){let t;for(;"string"==typeof(t=E.call(this,e));)e=t;if(void 0===t){const{schemaId:r}=this.opts,s=new c.SchemaEnv({schema:{},schemaId:r});if(t=c.resolveSchema.call(this,s,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const t=E.call(this,e);return"object"==typeof t&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{const t=e;this._cache.delete(t);let r=e[this.opts.schemaId];return r&&(r=(0,u.normalizeId)(r),delete this.schemas[r],delete this.refs[r]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(const t of e)this.addKeyword(t);return this}addKeyword(e,t){let r;if("string"==typeof e)r=e,"object"==typeof t&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=r);else{if("object"!=typeof e||void 0!==t)throw new Error("invalid addKeywords parameters");if(r=(t=e).keyword,Array.isArray(r)&&!r.length)throw new Error("addKeywords: keyword must be string or non-empty array")}if(C.call(this,r,t),!t)return(0,h.eachItem)(r,e=>T.call(this,e)),this;A.call(this,t);const s={...t,type:(0,f.getJSONTypes)(t.type),schemaType:(0,f.getJSONTypes)(t.schemaType)};return(0,h.eachItem)(r,0===s.type.length?e=>T.call(this,e,s):e=>s.type.forEach(t=>T.call(this,e,s,t))),this}getKeyword(e){const t=this.RULES.all[e];return"object"==typeof t?t.definition:!!t}removeKeyword(e){const{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(const r of t.rules){const t=r.rules.findIndex(t=>t.keyword===e);t>=0&&r.rules.splice(t,1)}return this}addFormat(e,t){return"string"==typeof t&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:r="data"}={}){return e&&0!==e.length?e.map(e=>`${r}${e.instancePath} ${e.message}`).reduce((e,r)=>e+t+r):"No errors"}$dataMetaSchema(e,t){const r=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(const s of t){const t=s.split("/").slice(1);let a=e;for(const e of t)a=a[e];for(const e in r){const t=r[e];if("object"!=typeof t)continue;const{$data:s}=t.definition,o=a[e];s&&o&&(a[e]=V(o))}}return e}_removeAllSchemas(e,t){for(const r in e){const s=e[r];t&&!t.test(r)||("string"==typeof s?delete e[r]:s&&!s.meta&&(this._cache.delete(s.schema),delete e[r]))}}_addSchema(e,t,r,s=this.opts.validateSchema,a=this.opts.addUsedSchema){let o;const{schemaId:n}=this.opts;if("object"==typeof e)o=e[n];else{if(this.opts.jtd)throw new Error("schema must be object");if("boolean"!=typeof e)throw new Error("schema must be object or boolean")}let i=this._cache.get(e);if(void 0!==i)return i;r=(0,u.normalizeId)(o||r);const d=u.getSchemaRefs.call(this,e,r);return i=new c.SchemaEnv({schema:e,schemaId:n,meta:t,baseId:r,localRefs:d}),this._cache.set(i.schema,i),a&&!r.startsWith("#")&&(r&&this._checkUnique(r),this.refs[r]=i),s&&this.validateSchema(e,!0),i}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):c.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){const t=this.opts;this.opts=this._metaOpts;try{c.compileSchema.call(this,e)}finally{this.opts=t}}}function P(e,t,r,s="error"){for(const a in e){const o=a;o in t&&this.logger[s](`${r}: option ${a}. ${e[o]}`)}}function E(e){return e=(0,u.normalizeId)(e),this.schemas[e]||this.refs[e]}function S(){const e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(const t in e)this.addSchema(e[t],t)}function k(){for(const e in this.opts.formats){const t=this.opts.formats[e];t&&this.addFormat(e,t)}}function j(e){if(Array.isArray(e))this.addVocabulary(e);else{this.logger.warn("keywords option as map is deprecated, pass array");for(const t in e){const r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}}function N(){const e={...this.opts};for(const t of v)delete e[t];return e}w.ValidationError=s.default,w.MissingRefError=o.default,e.default=w;const O={log(){},warn(){},error(){}};const R=/^[a-z_$][a-z0-9_$:-]*$/i;function C(e,t){const{RULES:r}=this;if((0,h.eachItem)(e,e=>{if(r.keywords[e])throw new Error(`Keyword ${e} is already defined`);if(!R.test(e))throw new Error(`Keyword ${e} has invalid name`)}),t&&t.$data&&!("code"in t)&&!("validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function T(e,t,r){var s;const a=null==t?void 0:t.post;if(r&&a)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:o}=this;let n=a?o.post:o.rules.find(({type:e})=>e===r);if(n||(n={type:r,rules:[]},o.rules.push(n)),o.keywords[e]=!0,!t)return;const i={keyword:e,definition:{...t,type:(0,f.getJSONTypes)(t.type),schemaType:(0,f.getJSONTypes)(t.schemaType)}};t.before?M.call(this,n,i,t.before):n.rules.push(i),o.all[e]=i,null===(s=t.implements)||void 0===s||s.forEach(e=>this.addKeyword(e))}function M(e,t,r){const s=e.rules.findIndex(e=>e.keyword===r);s>=0?e.rules.splice(s,0,t):(e.rules.push(t),this.logger.warn(`rule ${r} is not defined`))}function A(e){let{metaSchema:t}=e;void 0!==t&&(e.$data&&this.opts.$data&&(t=V(t)),e.validateSchema=this.compile(t,!0))}const D={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function V(e){return{anyOf:[e,D]}}}(s);var $r={},gr={},_r={};Object.defineProperty(_r,"__esModule",{value:!0});const br={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};_r.default=br;var wr={};Object.defineProperty(wr,"__esModule",{value:!0}),wr.callRef=wr.getValidate=void 0;const Pr=$t,Er=re,Sr=i,kr=E,jr=bt,Nr=l,Or={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:r,it:s}=e,{baseId:a,schemaEnv:o,validateName:n,opts:i,self:c}=s,{root:d}=o;if(("#"===r||"#/"===r)&&a===d.baseId)return function(){if(o===d)return Cr(e,n,o,o.$async);const r=t.scopeValue("root",{ref:d});return Cr(e,Sr._`${r}.validate`,d,d.$async)}();const l=jr.resolveRef.call(c,d,a,r);if(void 0===l)throw new Pr.default(s.opts.uriResolver,a,r);return l instanceof jr.SchemaEnv?function(t){const r=Rr(e,t);Cr(e,r,t,t.$async)}(l):function(s){const a=t.scopeValue("schema",!0===i.code.source?{ref:s,code:(0,Sr.stringify)(s)}:{ref:s}),o=t.name("valid"),n=e.subschema({schema:s,dataTypes:[],schemaPath:Sr.nil,topSchemaRef:a,errSchemaPath:r},o);e.mergeEvaluated(n),e.ok(o)}(l)}};function Rr(e,t){const{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):Sr._`${r.scopeValue("wrapper",{ref:t})}.validate`}function Cr(e,t,r,s){const{gen:a,it:o}=e,{allErrors:n,schemaEnv:i,opts:c}=o,d=c.passContext?kr.default.this:Sr.nil;function l(e){const t=Sr._`${e}.errors`;a.assign(kr.default.vErrors,Sr._`${kr.default.vErrors} === null ? ${t} : ${kr.default.vErrors}.concat(${t})`),a.assign(kr.default.errors,Sr._`${kr.default.vErrors}.length`)}function u(e){var t;if(!o.opts.unevaluated)return;const s=null===(t=null==r?void 0:r.validate)||void 0===t?void 0:t.evaluated;if(!0!==o.props)if(s&&!s.dynamicProps)void 0!==s.props&&(o.props=Nr.mergeEvaluated.props(a,s.props,o.props));else{const t=a.var("props",Sr._`${e}.evaluated.props`);o.props=Nr.mergeEvaluated.props(a,t,o.props,Sr.Name)}if(!0!==o.items)if(s&&!s.dynamicItems)void 0!==s.items&&(o.items=Nr.mergeEvaluated.items(a,s.items,o.items));else{const t=a.var("items",Sr._`${e}.evaluated.items`);o.items=Nr.mergeEvaluated.items(a,t,o.items,Sr.Name)}}s?function(){if(!i.$async)throw new Error("async schema referenced by sync schema");const r=a.let("valid");a.try(()=>{a.code(Sr._`await ${(0,Er.callValidateCode)(e,t,d)}`),u(t),n||a.assign(r,!0)},e=>{a.if(Sr._`!(${e} instanceof ${o.ValidationError})`,()=>a.throw(e)),l(e),n||a.assign(r,!1)}),e.ok(r)}():e.result((0,Er.callValidateCode)(e,t,d),()=>u(t),()=>l(t))}wr.getValidate=Rr,wr.callRef=Cr,wr.default=Or,Object.defineProperty(gr,"__esModule",{value:!0});const xr=wr,Ir=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",_r.default,xr.default];gr.default=Ir;var Tr={},Mr={};Object.defineProperty(Mr,"__esModule",{value:!0});const Ar=i,Dr=Ar.operators,Vr={maximum:{okStr:"<=",ok:Dr.LTE,fail:Dr.GT},minimum:{okStr:">=",ok:Dr.GTE,fail:Dr.LT},exclusiveMaximum:{okStr:"<",ok:Dr.LT,fail:Dr.GTE},exclusiveMinimum:{okStr:">",ok:Dr.GT,fail:Dr.LTE}},zr={message:({keyword:e,schemaCode:t})=>Ar.str`must be ${Vr[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>Ar._`{comparison: ${Vr[e].okStr}, limit: ${t}}`},qr={keyword:Object.keys(Vr),type:"number",schemaType:"number",$data:!0,error:zr,code(e){const{keyword:t,data:r,schemaCode:s}=e;e.fail$data(Ar._`${r} ${Vr[t].fail} ${s} || isNaN(${r})`)}};Mr.default=qr;var Ur={};Object.defineProperty(Ur,"__esModule",{value:!0});const Kr=i,Fr={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:e})=>Kr.str`must be multiple of ${e}`,params:({schemaCode:e})=>Kr._`{multipleOf: ${e}}`},code(e){const{gen:t,data:r,schemaCode:s,it:a}=e,o=a.opts.multipleOfPrecision,n=t.let("res"),i=o?Kr._`Math.abs(Math.round(${n}) - ${n}) > 1e-${o}`:Kr._`${n} !== parseInt(${n})`;e.fail$data(Kr._`(${s} === 0 || (${n} = ${r}/${s}, ${i}))`)}};Ur.default=Fr;var Lr={},Gr={};function Hr(e){const t=e.length;let r,s=0,a=0;for(;a<t;)s++,r=e.charCodeAt(a++),r>=55296&&r<=56319&&a<t&&(r=e.charCodeAt(a),56320==(64512&r)&&a++);return s}Object.defineProperty(Gr,"__esModule",{value:!0}),Gr.default=Hr,Hr.code='require("ajv/dist/runtime/ucs2length").default',Object.defineProperty(Lr,"__esModule",{value:!0});const Jr=i,Br=l,Wr=Gr,Qr={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message:({keyword:e,schemaCode:t})=>Jr.str`must NOT have ${"maxLength"===e?"more":"fewer"} than ${t} characters`,params:({schemaCode:e})=>Jr._`{limit: ${e}}`},code(e){const{keyword:t,data:r,schemaCode:s,it:a}=e,o="maxLength"===t?Jr.operators.GT:Jr.operators.LT,n=!1===a.opts.unicode?Jr._`${r}.length`:Jr._`${(0,Br.useFunc)(e.gen,Wr.default)}(${r})`;e.fail$data(Jr._`${n} ${o} ${s}`)}};Lr.default=Qr;var Zr={};Object.defineProperty(Zr,"__esModule",{value:!0});const Xr=re,Yr=i,es={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>Yr.str`must match pattern "${e}"`,params:({schemaCode:e})=>Yr._`{pattern: ${e}}`},code(e){const{data:t,$data:r,schema:s,schemaCode:a,it:o}=e,n=o.opts.unicodeRegExp?"u":"",i=r?Yr._`(new RegExp(${a}, ${n}))`:(0,Xr.usePattern)(e,s);e.fail$data(Yr._`!${i}.test(${t})`)}};Zr.default=es;var ts={};Object.defineProperty(ts,"__esModule",{value:!0});const rs=i,ss={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message:({keyword:e,schemaCode:t})=>rs.str`must NOT have ${"maxProperties"===e?"more":"fewer"} than ${t} properties`,params:({schemaCode:e})=>rs._`{limit: ${e}}`},code(e){const{keyword:t,data:r,schemaCode:s}=e,a="maxProperties"===t?rs.operators.GT:rs.operators.LT;e.fail$data(rs._`Object.keys(${r}).length ${a} ${s}`)}};ts.default=ss;var as={};Object.defineProperty(as,"__esModule",{value:!0});const os=re,ns=i,is=l,cs={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:e}})=>ns.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>ns._`{missingProperty: ${e}}`},code(e){const{gen:t,schema:r,schemaCode:s,data:a,$data:o,it:n}=e,{opts:i}=n;if(!o&&0===r.length)return;const c=r.length>=i.loopRequired;if(n.allErrors?function(){if(c||o)e.block$data(ns.nil,d);else for(const t of r)(0,os.checkReportMissingProp)(e,t)}():function(){const n=t.let("missing");if(c||o){const r=t.let("valid",!0);e.block$data(r,()=>function(r,o){e.setParams({missingProperty:r}),t.forOf(r,s,()=>{t.assign(o,(0,os.propertyInData)(t,a,r,i.ownProperties)),t.if((0,ns.not)(o),()=>{e.error(),t.break()})},ns.nil)}(n,r)),e.ok(r)}else t.if((0,os.checkMissingProp)(e,r,n)),(0,os.reportMissingProp)(e,n),t.else()}(),i.strictRequired){const t=e.parentSchema.properties,{definedProperties:s}=e.it;for(const e of r)if(void 0===(null==t?void 0:t[e])&&!s.has(e)){const t=`required property "${e}" is not defined at "${n.schemaEnv.baseId+n.errSchemaPath}" (strictRequired)`;(0,is.checkStrictMode)(n,t,n.opts.strictRequired)}}function d(){t.forOf("prop",s,r=>{e.setParams({missingProperty:r}),t.if((0,os.noPropertyInData)(t,a,r,i.ownProperties),()=>e.error())})}}};as.default=cs;var ds={};Object.defineProperty(ds,"__esModule",{value:!0});const ls=i,us={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message:({keyword:e,schemaCode:t})=>ls.str`must NOT have ${"maxItems"===e?"more":"fewer"} than ${t} items`,params:({schemaCode:e})=>ls._`{limit: ${e}}`},code(e){const{keyword:t,data:r,schemaCode:s}=e,a="maxItems"===t?ls.operators.GT:ls.operators.LT;e.fail$data(ls._`${r}.length ${a} ${s}`)}};ds.default=us;var fs={},hs={};Object.defineProperty(hs,"__esModule",{value:!0});const ms=we;ms.code='require("ajv/dist/runtime/equal").default',hs.default=ms,Object.defineProperty(fs,"__esModule",{value:!0});const ps=x,ys=i,vs=l,$s=hs,gs={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:e,j:t}})=>ys.str`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>ys._`{i: ${e}, j: ${t}}`},code(e){const{gen:t,data:r,$data:s,schema:a,parentSchema:o,schemaCode:n,it:i}=e;if(!s&&!a)return;const c=t.let("valid"),d=o.items?(0,ps.getSchemaTypes)(o.items):[];function l(s,a){const o=t.name("item"),n=(0,ps.checkDataTypes)(d,o,i.opts.strictNumbers,ps.DataType.Wrong),l=t.const("indices",ys._`{}`);t.for(ys._`;${s}--;`,()=>{t.let(o,ys._`${r}[${s}]`),t.if(n,ys._`continue`),d.length>1&&t.if(ys._`typeof ${o} == "string"`,ys._`${o} += "_"`),t.if(ys._`typeof ${l}[${o}] == "number"`,()=>{t.assign(a,ys._`${l}[${o}]`),e.error(),t.assign(c,!1).break()}).code(ys._`${l}[${o}] = ${s}`)})}function u(s,a){const o=(0,vs.useFunc)(t,$s.default),n=t.name("outer");t.label(n).for(ys._`;${s}--;`,()=>t.for(ys._`${a} = ${s}; ${a}--;`,()=>t.if(ys._`${o}(${r}[${s}], ${r}[${a}])`,()=>{e.error(),t.assign(c,!1).break(n)})))}e.block$data(c,function(){const s=t.let("i",ys._`${r}.length`),a=t.let("j");e.setParams({i:s,j:a}),t.assign(c,!0),t.if(ys._`${s} > 1`,()=>(d.length>0&&!d.some(e=>"object"===e||"array"===e)?l:u)(s,a))},ys._`${n} === false`),e.ok(c)}};fs.default=gs;var _s={};Object.defineProperty(_s,"__esModule",{value:!0});const bs=i,ws=l,Ps=hs,Es={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:e})=>bs._`{allowedValue: ${e}}`},code(e){const{gen:t,data:r,$data:s,schemaCode:a,schema:o}=e;s||o&&"object"==typeof o?e.fail$data(bs._`!${(0,ws.useFunc)(t,Ps.default)}(${r}, ${a})`):e.fail(bs._`${o} !== ${r}`)}};_s.default=Es;var Ss={};Object.defineProperty(Ss,"__esModule",{value:!0});const ks=i,js=l,Ns=hs,Os={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:e})=>ks._`{allowedValues: ${e}}`},code(e){const{gen:t,data:r,$data:s,schema:a,schemaCode:o,it:n}=e;if(!s&&0===a.length)throw new Error("enum must have non-empty array");const i=a.length>=n.opts.loopEnum;let c;const d=()=>null!=c?c:c=(0,js.useFunc)(t,Ns.default);let l;if(i||s)l=t.let("valid"),e.block$data(l,function(){t.assign(l,!1),t.forOf("v",o,e=>t.if(ks._`${d()}(${r}, ${e})`,()=>t.assign(l,!0).break()))});else{if(!Array.isArray(a))throw new Error("ajv implementation error");const e=t.const("vSchema",o);l=(0,ks.or)(...a.map((t,s)=>function(e,t){const s=a[t];return"object"==typeof s&&null!==s?ks._`${d()}(${r}, ${e}[${t}])`:ks._`${r} === ${s}`}(e,s)))}e.pass(l)}};Ss.default=Os,Object.defineProperty(Tr,"__esModule",{value:!0});const Rs=Ur,Cs=Lr,xs=Zr,Is=ts,Ts=as,Ms=ds,As=fs,Ds=_s,Vs=Ss,zs=[Mr.default,Rs.default,Cs.default,xs.default,Is.default,Ts.default,Ms.default,As.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},Ds.default,Vs.default];Tr.default=zs;var qs={},Us={};Object.defineProperty(Us,"__esModule",{value:!0}),Us.validateAdditionalItems=void 0;const Ks=i,Fs=l,Ls={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:e}})=>Ks.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>Ks._`{limit: ${e}}`},code(e){const{parentSchema:t,it:r}=e,{items:s}=t;Array.isArray(s)?Gs(e,s):(0,Fs.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas')}};function Gs(e,t){const{gen:r,schema:s,data:a,keyword:o,it:n}=e;n.items=!0;const i=r.const("len",Ks._`${a}.length`);if(!1===s)e.setParams({len:t.length}),e.pass(Ks._`${i} <= ${t.length}`);else if("object"==typeof s&&!(0,Fs.alwaysValidSchema)(n,s)){const s=r.var("valid",Ks._`${i} <= ${t.length}`);r.if((0,Ks.not)(s),()=>function(s){r.forRange("i",t.length,i,t=>{e.subschema({keyword:o,dataProp:t,dataPropType:Fs.Type.Num},s),n.allErrors||r.if((0,Ks.not)(s),()=>r.break())})}(s)),e.ok(s)}}Us.validateAdditionalItems=Gs,Us.default=Ls;var Hs={},Js={};Object.defineProperty(Js,"__esModule",{value:!0}),Js.validateTuple=void 0;const Bs=i,Ws=l,Qs=re,Zs={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:r}=e;if(Array.isArray(t))return Xs(e,"additionalItems",t);r.items=!0,(0,Ws.alwaysValidSchema)(r,t)||e.ok((0,Qs.validateArray)(e))}};function Xs(e,t,r=e.schema){const{gen:s,parentSchema:a,data:o,keyword:n,it:i}=e;!function(e){const{opts:s,errSchemaPath:a}=i,o=r.length,c=o===e.minItems&&(o===e.maxItems||!1===e[t]);if(s.strictTuples&&!c){const e=`"${n}" is ${o}-tuple, but minItems or maxItems/${t} are not specified or different at path "${a}"`;(0,Ws.checkStrictMode)(i,e,s.strictTuples)}}(a),i.opts.unevaluated&&r.length&&!0!==i.items&&(i.items=Ws.mergeEvaluated.items(s,r.length,i.items));const c=s.name("valid"),d=s.const("len",Bs._`${o}.length`);r.forEach((t,r)=>{(0,Ws.alwaysValidSchema)(i,t)||(s.if(Bs._`${d} > ${r}`,()=>e.subschema({keyword:n,schemaProp:r,dataProp:r},c)),e.ok(c))})}Js.validateTuple=Xs,Js.default=Zs,Object.defineProperty(Hs,"__esModule",{value:!0});const Ys=Js,ea={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,Ys.validateTuple)(e,"items")};Hs.default=ea;var ta={};Object.defineProperty(ta,"__esModule",{value:!0});const ra=i,sa=l,aa=re,oa=Us,na={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:e}})=>ra.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>ra._`{limit: ${e}}`},code(e){const{schema:t,parentSchema:r,it:s}=e,{prefixItems:a}=r;s.items=!0,(0,sa.alwaysValidSchema)(s,t)||(a?(0,oa.validateAdditionalItems)(e,a):e.ok((0,aa.validateArray)(e)))}};ta.default=na;var ia={};Object.defineProperty(ia,"__esModule",{value:!0});const ca=i,da=l,la={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:e,max:t}})=>void 0===t?ca.str`must contain at least ${e} valid item(s)`:ca.str`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>void 0===t?ca._`{minContains: ${e}}`:ca._`{minContains: ${e}, maxContains: ${t}}`},code(e){const{gen:t,schema:r,parentSchema:s,data:a,it:o}=e;let n,i;const{minContains:c,maxContains:d}=s;o.opts.next?(n=void 0===c?1:c,i=d):n=1;const l=t.const("len",ca._`${a}.length`);if(e.setParams({min:n,max:i}),void 0===i&&0===n)return void(0,da.checkStrictMode)(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==i&&n>i)return(0,da.checkStrictMode)(o,'"minContains" > "maxContains" is always invalid'),void e.fail();if((0,da.alwaysValidSchema)(o,r)){let t=ca._`${l} >= ${n}`;return void 0!==i&&(t=ca._`${t} && ${l} <= ${i}`),void e.pass(t)}o.items=!0;const u=t.name("valid");function f(){const e=t.name("_valid"),r=t.let("count",0);h(e,()=>t.if(e,()=>function(e){t.code(ca._`${e}++`),void 0===i?t.if(ca._`${e} >= ${n}`,()=>t.assign(u,!0).break()):(t.if(ca._`${e} > ${i}`,()=>t.assign(u,!1).break()),1===n?t.assign(u,!0):t.if(ca._`${e} >= ${n}`,()=>t.assign(u,!0)))}(r)))}function h(r,s){t.forRange("i",0,l,t=>{e.subschema({keyword:"contains",dataProp:t,dataPropType:da.Type.Num,compositeRule:!0},r),s()})}void 0===i&&1===n?h(u,()=>t.if(u,()=>t.break())):0===n?(t.let(u,!0),void 0!==i&&t.if(ca._`${a}.length > 0`,f)):(t.let(u,!1),f()),e.result(u,()=>e.reset())}};ia.default=la;var ua={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=i,r=l,s=re;e.error={message:({params:{property:e,depsCount:r,deps:s}})=>t.str`must have ${1===r?"property":"properties"} ${s} when property ${e} is present`,params:({params:{property:e,depsCount:r,deps:s,missingProperty:a}})=>t._`{property: ${e},
|
|
5
|
-
missingProperty: ${a},
|
|
6
|
-
depsCount: ${r},
|
|
7
|
-
deps: ${s}}`};const a={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(e){const[t,r]=function({schema:e}){const t={},r={};for(const s in e){if("__proto__"===s)continue;(Array.isArray(e[s])?t:r)[s]=e[s]}return[t,r]}(e);o(e,t),n(e,r)}};function o(e,r=e.schema){const{gen:a,data:o,it:n}=e;if(0===Object.keys(r).length)return;const i=a.let("missing");for(const c in r){const d=r[c];if(0===d.length)continue;const l=(0,s.propertyInData)(a,o,c,n.opts.ownProperties);e.setParams({property:c,depsCount:d.length,deps:d.join(", ")}),n.allErrors?a.if(l,()=>{for(const t of d)(0,s.checkReportMissingProp)(e,t)}):(a.if(t._`${l} && (${(0,s.checkMissingProp)(e,d,i)})`),(0,s.reportMissingProp)(e,i),a.else())}}function n(e,t=e.schema){const{gen:a,data:o,keyword:n,it:i}=e,c=a.name("valid");for(const d in t)(0,r.alwaysValidSchema)(i,t[d])||(a.if((0,s.propertyInData)(a,o,d,i.opts.ownProperties),()=>{const t=e.subschema({keyword:n,schemaProp:d},c);e.mergeValidEvaluated(t,c)},()=>a.var(c,!0)),e.ok(c))}e.validatePropertyDeps=o,e.validateSchemaDeps=n,e.default=a}(ua);var fa={};Object.defineProperty(fa,"__esModule",{value:!0});const ha=i,ma=l,pa={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:e})=>ha._`{propertyName: ${e.propertyName}}`},code(e){const{gen:t,schema:r,data:s,it:a}=e;if((0,ma.alwaysValidSchema)(a,r))return;const o=t.name("valid");t.forIn("key",s,r=>{e.setParams({propertyName:r}),e.subschema({keyword:"propertyNames",data:r,dataTypes:["string"],propertyName:r,compositeRule:!0},o),t.if((0,ha.not)(o),()=>{e.error(!0),a.allErrors||t.break()})}),e.ok(o)}};fa.default=pa;var ya={};Object.defineProperty(ya,"__esModule",{value:!0});const va=re,$a=i,ga=E,_a=l,ba={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:e})=>$a._`{additionalProperty: ${e.additionalProperty}}`},code(e){const{gen:t,schema:r,parentSchema:s,data:a,errsCount:o,it:n}=e;if(!o)throw new Error("ajv implementation error");const{allErrors:i,opts:c}=n;if(n.props=!0,"all"!==c.removeAdditional&&(0,_a.alwaysValidSchema)(n,r))return;const d=(0,va.allSchemaProperties)(s.properties),l=(0,va.allSchemaProperties)(s.patternProperties);function u(e){t.code($a._`delete ${a}[${e}]`)}function f(s){if("all"===c.removeAdditional||c.removeAdditional&&!1===r)u(s);else{if(!1===r)return e.setParams({additionalProperty:s}),e.error(),void(i||t.break());if("object"==typeof r&&!(0,_a.alwaysValidSchema)(n,r)){const r=t.name("valid");"failing"===c.removeAdditional?(h(s,r,!1),t.if((0,$a.not)(r),()=>{e.reset(),u(s)})):(h(s,r),i||t.if((0,$a.not)(r),()=>t.break()))}}}function h(t,r,s){const a={keyword:"additionalProperties",dataProp:t,dataPropType:_a.Type.Str};!1===s&&Object.assign(a,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(a,r)}t.forIn("key",a,r=>{d.length||l.length?t.if(function(r){let a;if(d.length>8){const e=(0,_a.schemaRefOrVal)(n,s.properties,"properties");a=(0,va.isOwnProperty)(t,e,r)}else a=d.length?(0,$a.or)(...d.map(e=>$a._`${r} === ${e}`)):$a.nil;return l.length&&(a=(0,$a.or)(a,...l.map(t=>$a._`${(0,va.usePattern)(e,t)}.test(${r})`))),(0,$a.not)(a)}(r),()=>f(r)):f(r)}),e.ok($a._`${o} === ${ga.default.errors}`)}};ya.default=ba;var wa={};Object.defineProperty(wa,"__esModule",{value:!0});const Pa=a,Ea=re,Sa=l,ka=ya,ja={keyword:"properties",type:"object",schemaType:"object",code(e){const{gen:t,schema:r,parentSchema:s,data:a,it:o}=e;"all"===o.opts.removeAdditional&&void 0===s.additionalProperties&&ka.default.code(new Pa.KeywordCxt(o,ka.default,"additionalProperties"));const n=(0,Ea.allSchemaProperties)(r);for(const u of n)o.definedProperties.add(u);o.opts.unevaluated&&n.length&&!0!==o.props&&(o.props=Sa.mergeEvaluated.props(t,(0,Sa.toHash)(n),o.props));const i=n.filter(e=>!(0,Sa.alwaysValidSchema)(o,r[e]));if(0===i.length)return;const c=t.name("valid");for(const u of i)d(u)?l(u):(t.if((0,Ea.propertyInData)(t,a,u,o.opts.ownProperties)),l(u),o.allErrors||t.else().var(c,!0),t.endIf()),e.it.definedProperties.add(u),e.ok(c);function d(e){return o.opts.useDefaults&&!o.compositeRule&&void 0!==r[e].default}function l(t){e.subschema({keyword:"properties",schemaProp:t,dataProp:t},c)}}};wa.default=ja;var Na={};Object.defineProperty(Na,"__esModule",{value:!0});const Oa=re,Ra=i,Ca=l,xa=l,Ia={keyword:"patternProperties",type:"object",schemaType:"object",code(e){const{gen:t,schema:r,data:s,parentSchema:a,it:o}=e,{opts:n}=o,i=(0,Oa.allSchemaProperties)(r),c=i.filter(e=>(0,Ca.alwaysValidSchema)(o,r[e]));if(0===i.length||c.length===i.length&&(!o.opts.unevaluated||!0===o.props))return;const d=n.strictSchema&&!n.allowMatchingProperties&&a.properties,l=t.name("valid");!0===o.props||o.props instanceof Ra.Name||(o.props=(0,xa.evaluatedPropsToName)(t,o.props));const{props:u}=o;function f(e){for(const t in d)new RegExp(e).test(t)&&(0,Ca.checkStrictMode)(o,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}function h(r){t.forIn("key",s,s=>{t.if(Ra._`${(0,Oa.usePattern)(e,r)}.test(${s})`,()=>{const a=c.includes(r);a||e.subschema({keyword:"patternProperties",schemaProp:r,dataProp:s,dataPropType:xa.Type.Str},l),o.opts.unevaluated&&!0!==u?t.assign(Ra._`${u}[${s}]`,!0):a||o.allErrors||t.if((0,Ra.not)(l),()=>t.break())})})}!function(){for(const e of i)d&&f(e),o.allErrors?h(e):(t.var(l,!0),h(e),t.if(l))}()}};Na.default=Ia;var Ta={};Object.defineProperty(Ta,"__esModule",{value:!0});const Ma=l,Aa={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:r,it:s}=e;if((0,Ma.alwaysValidSchema)(s,r))return void e.fail();const a=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},a),e.failResult(a,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};Ta.default=Aa;var Da={};Object.defineProperty(Da,"__esModule",{value:!0});const Va={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:re.validateUnion,error:{message:"must match a schema in anyOf"}};Da.default=Va;var za={};Object.defineProperty(za,"__esModule",{value:!0});const qa=i,Ua=l,Ka={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:e})=>qa._`{passingSchemas: ${e.passing}}`},code(e){const{gen:t,schema:r,parentSchema:s,it:a}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(a.opts.discriminator&&s.discriminator)return;const o=r,n=t.let("valid",!1),i=t.let("passing",null),c=t.name("_valid");e.setParams({passing:i}),t.block(function(){o.forEach((r,s)=>{let o;(0,Ua.alwaysValidSchema)(a,r)?t.var(c,!0):o=e.subschema({keyword:"oneOf",schemaProp:s,compositeRule:!0},c),s>0&&t.if(qa._`${c} && ${n}`).assign(n,!1).assign(i,qa._`[${i}, ${s}]`).else(),t.if(c,()=>{t.assign(n,!0),t.assign(i,s),o&&e.mergeEvaluated(o,qa.Name)})})}),e.result(n,()=>e.reset(),()=>e.error(!0))}};za.default=Ka;var Fa={};Object.defineProperty(Fa,"__esModule",{value:!0});const La=l,Ga={keyword:"allOf",schemaType:"array",code(e){const{gen:t,schema:r,it:s}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");const a=t.name("valid");r.forEach((t,r)=>{if((0,La.alwaysValidSchema)(s,t))return;const o=e.subschema({keyword:"allOf",schemaProp:r},a);e.ok(a),e.mergeEvaluated(o)})}};Fa.default=Ga;var Ha={};Object.defineProperty(Ha,"__esModule",{value:!0});const Ja=i,Ba=l,Wa={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:e})=>Ja.str`must match "${e.ifClause}" schema`,params:({params:e})=>Ja._`{failingKeyword: ${e.ifClause}}`},code(e){const{gen:t,parentSchema:r,it:s}=e;void 0===r.then&&void 0===r.else&&(0,Ba.checkStrictMode)(s,'"if" without "then" and "else" is ignored');const a=Qa(s,"then"),o=Qa(s,"else");if(!a&&!o)return;const n=t.let("valid",!0),i=t.name("_valid");if(function(){const t=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},i);e.mergeEvaluated(t)}(),e.reset(),a&&o){const r=t.let("ifClause");e.setParams({ifClause:r}),t.if(i,c("then",r),c("else",r))}else a?t.if(i,c("then")):t.if((0,Ja.not)(i),c("else"));function c(r,s){return()=>{const a=e.subschema({keyword:r},i);t.assign(n,i),e.mergeValidEvaluated(a,n),s?t.assign(s,Ja._`${r}`):e.setParams({ifClause:r})}}e.pass(n,()=>e.error(!0))}};function Qa(e,t){const r=e.schema[t];return void 0!==r&&!(0,Ba.alwaysValidSchema)(e,r)}Ha.default=Wa;var Za={};Object.defineProperty(Za,"__esModule",{value:!0});const Xa=l,Ya={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){void 0===t.if&&(0,Xa.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};Za.default=Ya,Object.defineProperty(qs,"__esModule",{value:!0});const eo=Us,to=Hs,ro=Js,so=ta,ao=ia,oo=ua,no=fa,io=ya,co=wa,lo=Na,uo=Ta,fo=Da,ho=za,mo=Fa,po=Ha,yo=Za;qs.default=function(e=!1){const t=[uo.default,fo.default,ho.default,mo.default,po.default,yo.default,no.default,io.default,oo.default,co.default,lo.default];return e?t.push(to.default,so.default):t.push(eo.default,ro.default),t.push(ao.default),t};var vo={},$o={};Object.defineProperty($o,"__esModule",{value:!0});const go=i,_o={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>go.str`must match format "${e}"`,params:({schemaCode:e})=>go._`{format: ${e}}`},code(e,t){const{gen:r,data:s,$data:a,schema:o,schemaCode:n,it:i}=e,{opts:c,errSchemaPath:d,schemaEnv:l,self:u}=i;c.validateFormats&&(a?function(){const a=r.scopeValue("formats",{ref:u.formats,code:c.code.formats}),o=r.const("fDef",go._`${a}[${n}]`),i=r.let("fType"),d=r.let("format");r.if(go._`typeof ${o} == "object" && !(${o} instanceof RegExp)`,()=>r.assign(i,go._`${o}.type || "string"`).assign(d,go._`${o}.validate`),()=>r.assign(i,go._`"string"`).assign(d,o)),e.fail$data((0,go.or)(!1===c.strictSchema?go.nil:go._`${n} && !${d}`,function(){const e=l.$async?go._`(${o}.async ? await ${d}(${s}) : ${d}(${s}))`:go._`${d}(${s})`,r=go._`(typeof ${d} == "function" ? ${e} : ${d}.test(${s}))`;return go._`${d} && ${d} !== true && ${i} === ${t} && !${r}`}()))}():function(){const a=u.formats[o];if(!a)return void function(){if(!1===c.strictSchema)return void u.logger.warn(e());throw new Error(e());function e(){return`unknown format "${o}" ignored in schema at path "${d}"`}}();if(!0===a)return;const[n,i,f]=function(e){const t=e instanceof RegExp?(0,go.regexpCode)(e):c.code.formats?go._`${c.code.formats}${(0,go.getProperty)(o)}`:void 0,s=r.scopeValue("formats",{key:o,ref:e,code:t});if("object"==typeof e&&!(e instanceof RegExp))return[e.type||"string",e.validate,go._`${s}.validate`];return["string",e,s]}(a);n===t&&e.pass(function(){if("object"==typeof a&&!(a instanceof RegExp)&&a.async){if(!l.$async)throw new Error("async format in sync schema");return go._`await ${f}(${s})`}return"function"==typeof i?go._`${f}(${s})`:go._`${f}.test(${s})`}())}())}};$o.default=_o,Object.defineProperty(vo,"__esModule",{value:!0});const bo=[$o.default];vo.default=bo;var wo={};Object.defineProperty(wo,"__esModule",{value:!0}),wo.contentVocabulary=wo.metadataVocabulary=void 0,wo.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],wo.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"],Object.defineProperty($r,"__esModule",{value:!0});const Po=Tr,Eo=qs,So=vo,ko=wo,jo=[gr.default,Po.default,(0,Eo.default)(),So.default,ko.metadataVocabulary,ko.contentVocabulary];$r.default=jo;var No={},Oo={};Object.defineProperty(Oo,"__esModule",{value:!0}),Oo.dynamicAnchor=void 0;const Ro=i,Co=E,xo=bt,Io=wr,To={keyword:"$dynamicAnchor",schemaType:"string",code:e=>Mo(e,e.schema)};function Mo(e,t){const{gen:r,it:s}=e;s.schemaEnv.root.dynamicAnchors[t]=!0;const a=Ro._`${Co.default.dynamicAnchors}${(0,Ro.getProperty)(t)}`,o="#"===s.errSchemaPath?s.validateName:function(e){const{schemaEnv:t,schema:r,self:s}=e.it,{root:a,baseId:o,localRefs:n,meta:i}=t.root,{schemaId:c}=s.opts,d=new xo.SchemaEnv({schema:r,schemaId:c,root:a,baseId:o,localRefs:n,meta:i});return xo.compileSchema.call(s,d),(0,Io.getValidate)(e,d)}(e);r.if(Ro._`!${a}`,()=>r.assign(a,o))}Oo.dynamicAnchor=Mo,Oo.default=To;var Ao={};Object.defineProperty(Ao,"__esModule",{value:!0}),Ao.dynamicRef=void 0;const Do=i,Vo=E,zo=wr,qo={keyword:"$dynamicRef",schemaType:"string",code:e=>Uo(e,e.schema)};function Uo(e,t){const{gen:r,keyword:s,it:a}=e;if("#"!==t[0])throw new Error(`"${s}" only supports hash fragment reference`);const o=t.slice(1);if(a.allErrors)n();else{const t=r.let("valid",!1);n(t),e.ok(t)}function n(e){if(a.schemaEnv.root.dynamicAnchors[o]){const t=r.let("_v",Do._`${Vo.default.dynamicAnchors}${(0,Do.getProperty)(o)}`);r.if(t,i(t,e),i(a.validateName,e))}else i(a.validateName,e)()}function i(t,s){return s?()=>r.block(()=>{(0,zo.callRef)(e,t),r.let(s,!0)}):()=>(0,zo.callRef)(e,t)}}Ao.dynamicRef=Uo,Ao.default=qo;var Ko={};Object.defineProperty(Ko,"__esModule",{value:!0});const Fo=Oo,Lo=l,Go={keyword:"$recursiveAnchor",schemaType:"boolean",code(e){e.schema?(0,Fo.dynamicAnchor)(e,""):(0,Lo.checkStrictMode)(e.it,"$recursiveAnchor: false is ignored")}};Ko.default=Go;var Ho={};Object.defineProperty(Ho,"__esModule",{value:!0});const Jo=Ao,Bo={keyword:"$recursiveRef",schemaType:"string",code:e=>(0,Jo.dynamicRef)(e,e.schema)};Ho.default=Bo,Object.defineProperty(No,"__esModule",{value:!0});const Wo=Ao,Qo=Ko,Zo=Ho,Xo=[Oo.default,Wo.default,Qo.default,Zo.default];No.default=Xo;var Yo={},en={};Object.defineProperty(en,"__esModule",{value:!0});const tn=ua,rn={keyword:"dependentRequired",type:"object",schemaType:"object",error:tn.error,code:e=>(0,tn.validatePropertyDeps)(e)};en.default=rn;var sn={};Object.defineProperty(sn,"__esModule",{value:!0});const an=ua,on={keyword:"dependentSchemas",type:"object",schemaType:"object",code:e=>(0,an.validateSchemaDeps)(e)};sn.default=on;var nn={};Object.defineProperty(nn,"__esModule",{value:!0});const cn=l,dn={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:e,parentSchema:t,it:r}){void 0===t.contains&&(0,cn.checkStrictMode)(r,`"${e}" without "contains" is ignored`)}};nn.default=dn,Object.defineProperty(Yo,"__esModule",{value:!0});const ln=sn,un=nn,fn=[en.default,ln.default,un.default];Yo.default=fn;var hn={},mn={};Object.defineProperty(mn,"__esModule",{value:!0});const pn=i,yn=l,vn=E,$n={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:{message:"must NOT have unevaluated properties",params:({params:e})=>pn._`{unevaluatedProperty: ${e.unevaluatedProperty}}`},code(e){const{gen:t,schema:r,data:s,errsCount:a,it:o}=e;if(!a)throw new Error("ajv implementation error");const{allErrors:n,props:i}=o;function c(s){if(!1===r)return e.setParams({unevaluatedProperty:s}),e.error(),void(n||t.break());if(!(0,yn.alwaysValidSchema)(o,r)){const r=t.name("valid");e.subschema({keyword:"unevaluatedProperties",dataProp:s,dataPropType:yn.Type.Str},r),n||t.if((0,pn.not)(r),()=>t.break())}}i instanceof pn.Name?t.if(pn._`${i} !== true`,()=>t.forIn("key",s,e=>t.if(function(e,t){return pn._`!${e} || !${e}[${t}]`}(i,e),()=>c(e)))):!0!==i&&t.forIn("key",s,e=>void 0===i?c(e):t.if(function(e,t){const r=[];for(const s in e)!0===e[s]&&r.push(pn._`${t} !== ${s}`);return(0,pn.and)(...r)}(i,e),()=>c(e))),o.props=!0,e.ok(pn._`${a} === ${vn.default.errors}`)}};mn.default=$n;var gn={};Object.defineProperty(gn,"__esModule",{value:!0});const _n=i,bn=l,wn={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:{message:({params:{len:e}})=>_n.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>_n._`{limit: ${e}}`},code(e){const{gen:t,schema:r,data:s,it:a}=e,o=a.items||0;if(!0===o)return;const n=t.const("len",_n._`${s}.length`);if(!1===r)e.setParams({len:o}),e.fail(_n._`${n} > ${o}`);else if("object"==typeof r&&!(0,bn.alwaysValidSchema)(a,r)){const r=t.var("valid",_n._`${n} <= ${o}`);t.if((0,_n.not)(r),()=>function(r,s){t.forRange("i",s,n,s=>{e.subschema({keyword:"unevaluatedItems",dataProp:s,dataPropType:bn.Type.Num},r),a.allErrors||t.if((0,_n.not)(r),()=>t.break())})}(r,o)),e.ok(r)}a.items=!0}};gn.default=wn,Object.defineProperty(hn,"__esModule",{value:!0});const Pn=gn,En=[mn.default,Pn.default];hn.default=En;var Sn,kn,jn={},Nn={};Object.defineProperty(Nn,"__esModule",{value:!0}),Nn.DiscrError=void 0,(kn=Sn||(Nn.DiscrError=Sn={})).Tag="tag",kn.Mapping="mapping",Object.defineProperty(jn,"__esModule",{value:!0});const On=i,Rn=Nn,Cn=bt,xn=$t,In=l,Tn={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:e,tagName:t}})=>e===Rn.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>On._`{error: ${e}, tag: ${r}, tagValue: ${t}}`},code(e){const{gen:t,data:r,schema:s,parentSchema:a,it:o}=e,{oneOf:n}=a;if(!o.opts.discriminator)throw new Error("discriminator: requires discriminator option");const i=s.propertyName;if("string"!=typeof i)throw new Error("discriminator: requires propertyName");if(s.mapping)throw new Error("discriminator: mapping is not supported");if(!n)throw new Error("discriminator: requires oneOf keyword");const c=t.let("valid",!1),d=t.const("tag",On._`${r}${(0,On.getProperty)(i)}`);function l(r){const s=t.name("valid"),a=e.subschema({keyword:"oneOf",schemaProp:r},s);return e.mergeEvaluated(a,On.Name),s}t.if(On._`typeof ${d} == "string"`,()=>function(){const r=function(){var e;const t={},r=c(a);let s=!0;for(let a=0;a<n.length;a++){let t=n[a];if((null==t?void 0:t.$ref)&&!(0,In.schemaHasRulesButRef)(t,o.self.RULES)){const e=t.$ref;if(t=Cn.resolveRef.call(o.self,o.schemaEnv.root,o.baseId,e),t instanceof Cn.SchemaEnv&&(t=t.schema),void 0===t)throw new xn.default(o.opts.uriResolver,o.baseId,e)}const l=null===(e=null==t?void 0:t.properties)||void 0===e?void 0:e[i];if("object"!=typeof l)throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${i}"`);s=s&&(r||c(t)),d(l,a)}if(!s)throw new Error(`discriminator: "${i}" must be required`);return t;function c({required:e}){return Array.isArray(e)&&e.includes(i)}function d(e,t){if(e.const)l(e.const,t);else{if(!e.enum)throw new Error(`discriminator: "properties/${i}" must have "const" or "enum"`);for(const r of e.enum)l(r,t)}}function l(e,r){if("string"!=typeof e||e in t)throw new Error(`discriminator: "${i}" values must be unique strings`);t[e]=r}}();t.if(!1);for(const e in r)t.elseIf(On._`${d} === ${e}`),t.assign(c,l(r[e]));t.else(),e.error(!1,{discrError:Rn.DiscrError.Mapping,tag:d,tagName:i}),t.endIf()}(),()=>e.error(!1,{discrError:Rn.DiscrError.Tag,tag:d,tagName:i})),e.ok(c)}};jn.default=Tn;var Mn={};const An={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/schema",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0,"https://json-schema.org/draft/2019-09/vocab/applicator":!0,"https://json-schema.org/draft/2019-09/vocab/validation":!0,"https://json-schema.org/draft/2019-09/vocab/meta-data":!0,"https://json-schema.org/draft/2019-09/vocab/format":!1,"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format"},{$ref:"meta/content"}],type:["object","boolean"],properties:{definitions:{$comment:"While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.",type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},dependencies:{$comment:'"dependencies" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to "dependentSchemas" and "dependentRequired"',type:"object",additionalProperties:{anyOf:[{$recursiveRef:"#"},{$ref:"meta/validation#/$defs/stringArray"}]}}}},Dn={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/applicator":!0},$recursiveAnchor:!0,title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{additionalItems:{$recursiveRef:"#"},unevaluatedItems:{$recursiveRef:"#"},items:{anyOf:[{$recursiveRef:"#"},{$ref:"#/$defs/schemaArray"}]},contains:{$recursiveRef:"#"},additionalProperties:{$recursiveRef:"#"},unevaluatedProperties:{$recursiveRef:"#"},properties:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$recursiveRef:"#"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$recursiveRef:"#"}},propertyNames:{$recursiveRef:"#"},if:{$recursiveRef:"#"},then:{$recursiveRef:"#"},else:{$recursiveRef:"#"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$recursiveRef:"#"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$recursiveRef:"#"}}}},Vn={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/content",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentMediaType:{type:"string"},contentEncoding:{type:"string"},contentSchema:{$recursiveRef:"#"}}},zn={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/core",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0},$recursiveAnchor:!0,title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{type:"string",format:"uri"},$anchor:{type:"string",pattern:"^[A-Za-z][-A-Za-z0-9.:_]*$"},$ref:{type:"string",format:"uri-reference"},$recursiveRef:{type:"string",format:"uri-reference"},$recursiveAnchor:{type:"boolean",default:!1},$vocabulary:{type:"object",propertyNames:{type:"string",format:"uri"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}}}},qn={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/format",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/format":!0},$recursiveAnchor:!0,title:"Format vocabulary meta-schema",type:["object","boolean"],properties:{format:{type:"string"}}},Un={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/meta-data":!0},$recursiveAnchor:!0,title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}},Kn={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/validation",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/validation":!0},$recursiveAnchor:!0,title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}},const:!0,enum:{type:"array",items:!0},type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}};Object.defineProperty(Mn,"__esModule",{value:!0});const Fn=An,Ln=Dn,Gn=Vn,Hn=zn,Jn=qn,Bn=Un,Wn=Kn,Qn=["/properties"];Mn.default=function(e){return[Fn,Ln,Gn,Hn,t(this,Jn),Bn,t(this,Wn)].forEach(e=>this.addMetaSchema(e,void 0,!1)),this;function t(t,r){return e?t.$dataMetaSchema(r,Qn):r}},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.Ajv2019=void 0;const r=s,o=$r,n=No,c=Yo,d=hn,l=jn,u=Mn,f="https://json-schema.org/draft/2019-09/schema";class h extends r.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),this.addVocabulary(n.default),o.default.forEach(e=>this.addVocabulary(e)),this.addVocabulary(c.default),this.addVocabulary(d.default),this.opts.discriminator&&this.addKeyword(l.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();const{$data:e,meta:t}=this.opts;t&&(u.default.call(this,e),this.refs["http://json-schema.org/schema"]=f)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(f)?f:void 0)}}t.Ajv2019=h,e.exports=t=h,e.exports.Ajv2019=h,Object.defineProperty(t,"__esModule",{value:!0}),t.default=h;var m=a;Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return m.KeywordCxt}});var p=i;Object.defineProperty(t,"_",{enumerable:!0,get:function(){return p._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return p.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return p.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return p.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return p.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return p.CodeGen}});var y=yt;Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return y.default}});var v=$t;Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return v.default}})}(r,r.exports);var Zn=r.exports;const Xn=t({__proto__:null,default:e.getDefaultExportFromCjs(Zn)},[Zn]);exports._2019=Xn;
|
|
8
|
-
//# sourceMappingURL=2019-EION3wKo.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_commonjsHelpers-C37NGDzP.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_commonjsHelpers-CUmg6egw.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";const t=require("./_commonjsHelpers-C37NGDzP.cjs");function n(t,n){for(var e=0;e<n.length;e++){const o=n[e];if("string"!=typeof o&&!Array.isArray(o))for(const n in o)if("default"!==n&&!(n in t)){const e=Object.getOwnPropertyDescriptor(o,n);e&&Object.defineProperty(t,n,e.get?e:{enumerable:!0,get:()=>o[n]})}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var e,o={exports:{}};e=o,function(){function t(n,e){return e?function(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}(n):n.slice?t[o(n)]:function(e,i){n(e={exports:{}}),t[o(i)]=e.exports};function o(t){return t.split("/").slice(-1).toString().replace(".js","")}}var n=e;t(function(t){String.random=function(t,n){var e="";for(t=t||24,n=n||"0123456789ABCDEFGHIJKLMNOPQRSTUVWXZabcdefghijklmnopqrstuvwxyz";t-- >0;)e+=n.charAt(Math.floor(Math.random()*n.length));return e},String.match=function(t,n){var e,o;return"string"==typeof t&&("string"==typeof n&&(n={"=":n}),t===(e=(n=n||{})["="]||n["*"]||n[">"]||n["<"])||o===n["="]&&(e=n["*"]||n[">"],t.slice(0,(e||"").length)===e||o===n["*"]&&(o!==n[">"]&&o!==n["<"]?t>=n[">"]&&t<=n["<"]:o!==n[">"]&&t>=n[">"]||o!==n["<"]&&t<=n["<"])))},String.hash=function(t,n){if("string"==typeof t){if(n=n||0,!t.length)return n;for(var e=0,o=t.length;e<o;++e)n=(n<<5)-n+t.charCodeAt(e),n|=0;return n}};var n,e,o,i,r,a,s,u,c=Object.prototype.hasOwnProperty;Object.plain=function(t){return!!t&&(t instanceof Object&&t.constructor===Object||"Object"===Object.prototype.toString.call(t).match(/^\[object (\w+)\]$/)[1])},Object.empty=function(t,n){for(var e in t)if(c.call(t,e)&&(!n||-1==n.indexOf(e)))return!1;return!0},Object.keys=Object.keys||function(t){var n=[];for(var e in t)c.call(t,e)&&n.push(e);return n},i=setTimeout,r=0,a=0,s=typeof setImmediate!=""+n&&setImmediate||(typeof MessageChannel==""+n?i:((e=new MessageChannel).port1.onmessage=function(t){""==t.data&&o()},function(t){o=t,e.port2.postMessage("")})),u=i.check=i.check||typeof performance!=""+n&&performance||{now:function(){return+new Date}},i.hold=i.hold||9,i.poll=i.poll||function(t){i.hold>=u.now()-r&&a++<3333?t():s(function(){r=u.now(),t()},a=0)},function(){var t,n=setTimeout,e=n.turn=n.turn||function(t){1==o.push(t)&&i(a)},o=e.s=[],i=n.poll,r=0,a=function(){(t=o[r++])&&t(),r!=o.length&&99!=r||(o=e.s=o.slice(r),r=0),o.length&&i(a)}}(),function(){var t,n=setTimeout,e=n.turn;(n.each=n.each||function(n,o,i,r){r=r||9,function a(s,u,c){if(u=(s=(n||[]).splice(0,r)).length){for(var f=0;f<u&&t===(c=o(s[f]));f++);if(t===c)return void e(a)}i&&i(c)}()})()}()})(t,"./shim"),t(function(t){t.exports=function t(n,e,o){if(!n)return{to:t};var i="function"==typeof e;if(n=(this.tag||(this.tag={}))[n]||i&&(this.tag[n]={tag:n,to:t._={next:function(t){var n;(n=this.to)&&n.next(t)}}}),i){var r={off:t.off||(t.off=function(){if(this.next===t._.next)return!0;this===this.the.last&&(this.the.last=this.back),this.to.back=this.back,this.next=t._.next,this.back.to=this.to,this.the.last===this.the&&delete this.on.tag[this.the.tag]}),to:t._,next:e,the:n,on:this,as:o};return(r.back=n.last||n).to=r,n.last=r}return(n=n.to)&&void 0!==e&&n.next(e),n}})(t,"./onto"),t(function(t){t.exports=function(t){return null===t||"string"==typeof t||"boolean"==typeof t||"number"==typeof t&&t!=1/0&&t!=-1/0&&t==t||!!t&&"string"==typeof t["#"]&&1===Object.keys(t).length&&t["#"]}})(t,"./valid"),t(function(n){function e(){var t=+new Date;return s<t?(r=0,s=t+e.drift):s=t+(r+=1)/a+e.drift}t("./shim"),e.drift=0;var o,i=-1/0,r=0,a=999,s=i;e.is=function(t,n,e){var o=n&&t&&t._&&t._[">"]||e;if(o)return"number"==typeof(o=o[n])?o:i},e.ify=function(t,n,e,i,r){(t=t||{})._=t._||{},r&&(t._["#"]=r);var a=t._[">"]||(t._[">"]={});return o!==n&&"_"!==n&&("number"==typeof e&&(a[n]=e),o!==i&&(t[n]=i)),t},n.exports=e})(t,"./state"),t(function(n){t("./shim"),n.exports=function(t){var n={s:{}},e=n.s;t=t||{max:999,age:9e3},n.check=function(t){return!!e[t]&&o(t)};var o=n.track=function(i){var r=e[i]||(e[i]={});return r.was=n.now=+new Date,n.to||(n.to=setTimeout(n.drop,t.age+9)),o.ed&&o.ed(i),r};return n.drop=function(o){n.to=null,n.now=+new Date;var i=Object.keys(e);console.STAT&&console.STAT(n.now,+new Date-n.now,"dup drop keys"),setTimeout.each(i,function(i){var r=e[i];r&&(o||t.age)>n.now-r.was||delete e[i]},0,99)},n}})(t,"./dup"),t(function(n){t("./onto"),n.exports=function(t,n){if(this.on){var o=(this.opt||{}).lack||9e3;if("function"!=typeof t){if(!t)return;var i=t["#"]||t,r=(this.tag||"")[i];if(!r)return;return n&&(r=this.on(i,n),clearTimeout(r.err),r.err=setTimeout(function(){r.off()},o)),!0}if(i=n&&n["#"]||e(9),!t)return i;var a=this.on(i,t,n);return a.err=a.err||setTimeout(function(){a.off(),a.next({err:"Error: No ACK yet.",lack:!0})},o),i}};var e=String.random||function(){return Math.random().toString(36).slice(2)}})(t,"./ask"),t(function(e){function o(t){return t instanceof o?(this._={$:this}).$:this instanceof o?o.create(this._={$:this,opt:t}):new o(t)}o.is=function(t){return t instanceof o||t&&t._&&t===t._.$||!1},o.version=.202,o.chain=o.prototype,o.chain.toJSON=function(){},t("./shim"),o.valid=t("./valid"),o.state=t("./state"),o.on=t("./onto"),o.dup=t("./dup"),o.ask=t("./ask"),function(){function t(e){if(e)if(e.out!==t){var i,r=this.as,u=r.at||r,c=u.$,f=u.dup,l=e.DBG;if((i=e["#"])||(i=e["#"]=s(9)),!f.check(i)){if(f.track(i),i=e._,e._="function"==typeof i?i:function(){},e.$&&e.$===(e.$._||"").$||(e.$=c),e["@"]&&!e.put&&function(t){var n,e=t["@"]||"";if(n=e._)n.acks=(n.acks||0)+1,(n.err=t.err)&&(t["@"]=n["#"],a(n)),n.ok=t.ok||n.ok,n.stop||n.crack||(n.crack=n.match&&n.match.push(function(){p(n)})),p(n);else{var o=(o=t.$)&&(o=o._)&&(o=o.root)&&(o=o.dup);if(!(o=o.check(e)))return;t["@"]=o["#"]||t["@"]}}(e),!u.ask(e["@"],e)){if(l&&(l.u=+new Date),e.put)return void n(e);e.get&&o.on.get(e,c)}l&&(l.uc=+new Date),this.to.next(e),l&&(l.ua=+new Date),e.nts||e.NTS||(e.out=t,u.on("out",e),l&&(l.ue=+new Date))}}else this.to.next(e)}function n(n){if(n){var o=n._||"",r=o.root=((o.$=n.$||"")._||"").root;if(n["@"]&&o.faith&&!o.miss)return n.out=t,void r.on("out",n);o.latch=r.hatch,o.match=r.hatch=[];var s=n.put,f=o.DBG=n.DBG,l=+new Date;if(d=d||l,!s["#"]||!s["."]){f&&(f.p=l),o["#"]=n["#"],o.msg=n,o.all=0,o.stun=1;var h=Object.keys(s);console.STAT&&console.STAT(l,((f||o).pk=+new Date)-l,"put sort");var p,y,k,m,_,w,$,j=0;!function t(r){if(p!=j){if(p=j,!(k=h[j]))return console.STAT&&console.STAT(l,((f||o).pd=+new Date)-l,"put"),void a(o);(m=s[k])?($=m._)?k!==$["#"]?w=g+v(k)+"soul not same.":(_=$[">"])||(w=g+v(k)+"no state."):w=g+v(k)+"no meta.":w=g+v(k)+"no node.",y=Object.keys(m||{})}if(w)return n.err=o.err=w,void a(o);var d,x=0;for(r=r||0;r++<9&&(d=y[x++]);)if("_"!==d){var T=m[d],S=_[d];if(i===S){w=g+v(d)+"on"+v(k)+"no state.";break}if(!c(T)){w=g+v(d)+"on"+v(k)+"bad "+typeof T+v(T);break}e(T,d,k,S,n),++b}(y=y.slice(x)).length?u(t):(++j,y=null,t(r))}()}}}function e(t,n,o,i,r){var a,s=r._||"",u=s.root,c=u.graph,l=c[o]||h,p=f(l,n,1),d=l[n],g=s.DBG;(a=console.STAT)&&(c[o]&&d||(a.has=(a.has||0)+1));var v=m();if(i>v)return setTimeout(function(){e(t,n,o,i,r)},(a=i-v)>k?k:a),void(console.STAT&&console.STAT((g||s).Hf=+new Date,a,"future"));if(!(i<p)&&(s.faith||i!==p||!(t===d||y(t)<=y(d))||s.miss)){s.stun++;var b=r["#"]+s.all++,_={toString:function(){return b},_:s};_.toJSON=_.toString,u.dup.track(_)["#"]=r["#"],g&&(g.ph=g.ph||+new Date),u.on("put",{"#":_,"@":r["@"],put:{"#":o,".":n,":":t,">":i},ok:r.ok,_:s})}}function r(t){var n;(n=(t._||"").DBG)&&(n.pa=+new Date,n.pm=n.pm||+new Date);var e,o=this.as,i=o.graph,r=t._,s=t.put,u=s["#"],c=s["."],f=s[":"],h=s[">"];t["#"],(e=r.msg)&&(e=e.put)&&(e=e[u])&&l(e,c,h,f,u),i[u]=l(i[u],c,h,f,u),(e=(o.next||"")[u])&&e.on("in",t),a(r),this.to.next(t)}function a(n,e){var o;if(!n.stop&&(n.err||!(0<--n.stun))&&(n.stop=1,o=n.root)){var i=n.match;i.end=1,i===o.hatch&&(!(i=n.latch)||i.end?delete o.hatch:o.hatch=i),n.hatch&&n.hatch(),setTimeout.each(n.match,function(t){t&&t()}),!(e=n.msg)||n.err||e.err||(e.out=t,n.root.on("out",e),_())}}function p(t){t&&t.root&&(t.stun||t.acks!==t.all||t.root.on("in",{"@":t["#"],err:t.err,ok:t.err?i:t.ok||{"":1}}))}o.create=function(n){n.root=n.root||n,n.graph=n.graph||{},n.on=n.on||o.on,n.ask=n.ask||o.ask,n.dup=n.dup||o.dup();var e=n.$.opt(n.opt);return n.once||(n.on("in",t,n),n.on("out",t,n),n.on("put",r,n),o.on("create",n),n.on("create",n)),n.once=1,e},o.on.put=n;var d,g="Error: Invalid graph!",v=function(t){return" '"+(""+t).slice(0,9)+"...' "},y=JSON.stringify,k=2147483647,m=o.state,b=0,_=function(){b>999&&b/-(d-(d=+new Date))>1&&(o.window&&console.log("Warning: You're syncing 1K+ records a second, faster than DOM can update - consider limiting query."),_=function(){b=0})}}(),function(){function t(t,n){var e=+new Date,o=t._||{},r=o.DBG=t.DBG,a=t["#"],u=s(9),c=Object.keys(n||"").sort(),h=((n||"")._||"")["#"];c.length;var p=t.$._.root,d=n===p.graph[h];console.STAT&&console.STAT(e,((r||o).gk=+new Date)-e,"got keys"),n&&function t(){e=+new Date;for(var o,g,v,y=0,k={};y<9&&(o=c[y++]);)l(k,o,f(n,o),n[o],h);c=c.slice(y),(g={})[h]=k,k=g,d&&((v=function(){}).ram=v.faith=!0),g=c.length,console.STAT&&console.STAT(e,-(e-(e=+new Date)),"got copied some"),r&&(r.ga=+new Date),p.on("in",{"@":a,"#":u,put:k,"%":g?u=s(9):i,$:p.$,_:v,DBG:r,FOO:1}),console.STAT&&console.STAT(e,+new Date-e,"got in"),g&&setTimeout.turn(t)}(),n||p.on("in",{"@":t["#"]})}o.on.get=function(n,e){var o=e._,r=n.get,a=r["#"],s=o.graph[a],u=r["."],c=(o.next||(o.next={}))[a],h=(n._||{}).DBG=n.DBG;if(h&&(h.g=+new Date),!s)return o.on("get",n);if(u){if(("string"!=typeof u||i===s[u])&&!((c||"").next||"")[u])return void o.on("get",n);s=l({},u,f(s,u),s[u],a)}s&&t(n,s),o.on("get",n)},o.on.get.ack=t}(),o.chain.opt=function(t){t=t||{};var n=this._,e=t.peers||t;return Object.plain(t)||(t={}),Object.plain(n.opt)||(n.opt=t),"string"==typeof e&&(e=[e]),Object.plain(n.opt.peers)||(n.opt.peers={}),e instanceof Array&&(t.peers={},e.forEach(function(e){var o={};o.id=o.url=e,t.peers[e]=n.opt.peers[e]=n.opt.peers[e]||o})),a(t,function t(n){var e=this[n];this&&this.hasOwnProperty(n)||"string"==typeof e||Object.empty(e)?this[n]=e:(!e||e.constructor===Object||e instanceof Array)&&a(e,t)}),n.opt.from=t,o.on("opt",n),n.opt.uuid=n.opt.uuid||function(t){return o.state().toString(36).replace(".","")+String.random(t||12)},this};var i,r,a=function(t,n){Object.keys(t).forEach(n,t)},s=String.random,u=setTimeout.turn,c=o.valid,f=o.state.is,l=o.state.ify,h={};o.log=function(){return!o.log.off&&r.log.apply(r,arguments),[].slice.call(arguments).join(" ")},o.log.once=function(t,n,e){return(e=o.log.once)[t]=e[t]||0,e[t]++||o.log(n)},"undefined"!=typeof window&&((window.GUN=window.Gun=o).window=window);try{void 0!==n&&(n.exports=o)}catch(p){}e.exports=o,(o.window||{}).console=(o.window||{}).console||{log:function(){}},(r=console).only=function(t,n){return r.only.i&&t===r.only.i&&r.only.i++&&(r.log.apply(r,arguments)||n)},o.log.once("welcome","Hello wonderful person! :) Thanks for using GUN, please ask for help on http://chat.gun.eco if anything takes you longer than 5min to figure out!")})(t,"./root"),t(function(n){t("./root").chain.back=function(t,n){if(-1===(t=t||1)||1/0===t)return this._.root.$;if(1===t)return(this._.back||this._).$;var i=this._;if("string"==typeof t&&(t=t.split(".")),t instanceof Array){for(var r=0,a=t.length,s=i;r<a;r++)s=(s||o)[t[r]];return e!==s?n?this:s:(s=i.back)?s.$.back(t,n):void 0}if("function"==typeof t){var u;for(s={back:i};(s=s.back)&&e===(u=t(s,n)););return u}return"number"==typeof t?(i.back||i).$.back(t-1):this};var e,o={}})(t,"./back"),t(function(n){var e=t("./root");function o(t,n){if(n=n||this.as||t.$._,(!t.$$||this===e.on)&&t.put&&!n.soul){var o=t.put||"",i=o["="]||o[":"],r=n.root,a=r.$.get(o["#"]).get(o["."])._;if("string"==typeof(i=c(i))){if(!(a.echo||(a.echo={}))[n.id]||(r.pass||"")[n.id]){if(s=r.pass){if(s[i+n.id])return;s[i+n.id]=1}(a.echo||(a.echo={}))[n.id]=n,n.has&&(n.link=i);var s,u=r.$.get(a.link=i)._;(u.echo||(u.echo={}))[a.id]=a,((s=n.ask||"")[""]||n.lex)&&u.on("out",{get:{"#":i}}),setTimeout.each(Object.keys(s),function(t,n){t&&(n=s[t])&&n.on("out",{get:{"#":i,".":t}})},0,99)}}else this===e.on&&((a.echo||(a.echo={}))[n.id]=n)}}function i(t,n){var e,o,r=t.put||"",s=a!==r["="]?r["="]:r[":"],u=n.root;if(a===s){if(n.soul&&a!==n.put)return;if(o=(t.$$||t.$||"")._||"",t["@"]&&(a!==o.put||a!==n.put))return;return(e=n.link||t.linked)&&delete(u.$.get(e)._.echo||"")[n.id],n.has&&(n.link=null),n.put=a,void setTimeout.each(Object.keys(n.next||""),function(t,o){(o=n.next[t])&&(e&&delete(u.$.get(e).get(t)._.echo||"")[o.id],o.on("in",{get:t,put:a,$:o.$}))},0,99)}n.soul||t.$$||(e=c(s),o=t.$._||"",(e!==o.link&&(!n.has||o.link)||(u.pass||"")[n.id]&&"string"!=typeof e)&&(delete(o.echo||"")[n.id],i({get:n.get,put:a,$:t.$,linked:t.linked=t.linked||o.link},n)))}function r(t,n){var o=this.as,i=o.$._;i.root;var r=o.get||"",s=(t.put||"")[r["#"]]||"";if(!t.put||"string"==typeof r["."]&&a===s[r["."]]){if(a!==i.put)return;if(!i.soul&&!i.has)return;return i.ack=(i.ack||0)+1,void i.on("in",{get:i.get,put:i.put=a,$:i.$,"@":t["@"]})}(t._||{}).miss=1,e.on.put(t)}e.chain.chain=function(t){var n,o=this,i=o._,r=new(t||o).constructor(o),a=r._;return a.root=n=i.root,a.id=++n.once,a.back=o._,a.on=e.on,a.on("in",e.on.in,a),a.on("out",e.on.out,a),r},e.on.out=function(t){var n,e,o=this.as,i=o.back,s=o.root;if(t.$||(t.$=o.$),this.to.next(t),!o.err){if(n=t.get){if(s.pass&&(s.pass[o.id]=o),o.lex&&Object.keys(o.lex).forEach(function(t){e[t]=o.lex[t]},e=t.get=t.get||{}),n["#"]||o.soul){if(n["#"]=n["#"]||o.soul,t["#"]||(t["#"]=u(9)),i=s.$.get(n["#"])._,n=n["."]){if(f(i.put,n)&&(e=i.ask&&i.ask[n],(i.ask||(i.ask={}))[n]=i.$.get(n)._,i.on("in",{get:n,put:{"#":i.soul,".":n,":":i.put[n],">":h(s.graph[i.soul],n)}}),e))return}else{if(e=i.ask&&i.ask[""],(i.ask||(i.ask={}))[""]=i,a!==i.put&&(i.on("in",i),e))return;t.$=i.$}return s.ask(r,t),s.on("in",t)}if(n["."])return o.get?(t={get:{".":o.get},$:o.$},(i.ask||(i.ask={}))[o.get]=t.$._,i.on("out",t)):(t={get:o.lex?t.get:{},$:o.$},i.on("out",t));if((o.ask||(o.ask={}))[""]=o,o.get)return n["."]=o.get,(i.ask||(i.ask={}))[o.get]=t.$._,i.on("out",t)}return i.on("out",t)}o.on("in",{put:o.put=a,$:o.$})},e.on.in=function(t,n){var e,r=(n=n||this.as).root,u=t.$||(t.$=n.$),f=(u||"")._||s,l=t.put||"",d=l["#"],g=l["."],v=a!==l["="]?l["="]:l[":"],y=l[">"]||-1/0;if(a!==t.put&&(a===l["#"]||a===l["."]||a===l[":"]&&a===l["="]||a===l[">"]))return c(l)?void n.on("in",{$:f.back.$,put:{"#":d=f.back.soul,".":g=f.has||f.get,"=":l,">":h(f.back.put,g)},via:t}):(d=((l||"")._||"")["#"])?(u=n.root.$.get(d),setTimeout.each(Object.keys(l).sort(),function(e){"_"!=e&&a!==(y=h(l,e))&&n.on("in",{$:u,put:{"#":d,".":e,"=":l[e],">":y},VIA:t})})):void console.log("chain not yet supported for",l,"...",t,n);(t.seen||"")[n.id]||((t.seen||(t.seen=function(){}))[n.id]=n,n!==f&&(Object.keys(t).forEach(function(n){l[n]=t[n]},l={}),l.get=n.get||l.get,n.soul||n.has?f.soul&&(l.$=n.$,l.$$=l.$$||f.$):l.$$$=l.$$$||n.$,t=l),i(t,n),(n.soul||t.$$)&&y>=h(r.graph[d],g)&&((l=r.$.get(d)._).put=p(l.put,g,y,v,d)),!f.soul&&y>=h(r.graph[d],g)&&(e=(r.$.get(d)._.next||"")[g])&&(e.put=v,"string"==typeof(l=c(v))&&(e.put=r.$.get(l)._.put||v)),this.to&&this.to.next(t),n.any&&setTimeout.each(Object.keys(n.any),function(e){(e=n.any[e])&&e(t)},0,99),n.echo&&setTimeout.each(Object.keys(n.echo),function(e){(e=n.echo[e])&&e.on("in",t)},0,99),((t.$$||"")._||f).soul&&(e=n.next)&&(e=e[g])&&(l={},Object.keys(t).forEach(function(n){l[n]=t[n]}),l.$=(t.$$||t.$).get(l.get=g),delete l.$$,delete l.$$$,e.on("in",l)),o(t,n))},e.on.link=o,e.on.unlink=i;var a,s={},u=String.random,c=e.valid,f=function(t,n){return t&&Object.prototype.hasOwnProperty.call(t,n)},l=e.state,h=l.is,p=l.ify})(t,"./chain"),t(function(n){var e=t("./root");function o(t){var n=this.at||this.on;if(!t||n.soul||n.has)return this.off();if(t=(t=(t=t.$||t)._||t).id){var e;if(n.map,(e=this.seen||(this.seen={}))[t])return!0;e[t]=!0}}e.chain.get=function(t,n,s){var u,c;if("string"==typeof t){if(0==t.length)return(u=this.chain())._.err={err:e.log("0 length key!",t)},n&&n.call(u,u._.err),u;(u=((l=this._).next||r)[t])||(u=t&&function(t,n){var e=n._,o=e.next,i=n.chain(),r=i._;return o||(o=e.next={}),o[r.get=t]=r,n===e.root.$?r.soul=t:(e.soul||e.has)&&(r.has=t),r}(t,this)),u=u&&u.$}else{if("function"==typeof t){let r=function(t,n,o){if(!r.stun&&(!(a=p.pass)||a[f])){var a,s=t.$._,u=(t.$$||"")._,c=(u||s).put,g=!s.has&&!s.soul,v={};if((g||i===c)&&(c=i===((a=t.put)||"")["="]?i===(a||"")[":"]?a:a[":"]:a["="]),"string"==typeof(a=e.valid(c))&&(c=i===(a=p.$.get(a)._.put)?h.not?i:c:a),!h.not||i!==c){if(i===h.stun){if((a=p.stun)&&a.on&&(l.$.back(function(t){if(a.on(""+t.id,v={}),(v.run||0)<r.id)return v}),!v.run&&a.on(""+s.id,v={}),!v.run&&u&&a.on(""+u.id,v={}),r.id>v.run&&(v.stun&&!v.stun.end||(v.stun=a.on("stun"),v.stun=v.stun&&v.stun.last),v.stun&&!v.stun.end)))return void((v.stun.add||(v.stun.add={}))[f]=function(){r(t,n,1)});if(i===c&&(o=0),(a=p.hatch)&&!a.end&&i===h.hatch&&!o){if(d[s.$._.id])return;return d[s.$._.id]=1,void a.push(function(){r(t,n,1)})}d={}}if(p.pass){if(p.pass[f+s.id])return;p.pass[f+s.id]=1}h.on?h.ok.call(s.$,c,s.get,t,n||r):h.v2020?h.ok(t,n||r):(Object.keys(t).forEach(function(n){a[n]=t[n]},a={}),(t=a).put=c,h.ok.call(h.as,t,n||r))}}};if(!0===n)return function(t,n,o,r){var a,s=t._,u=0;(a=s.soul||s.link)?n(a,r,s):s.jam?s.jam.push([n,r]):(s.jam=[[n,r]],t.get(function(t,n){if(!(i===t.put&&!s.root.opt.super&&(a=Object.keys(s.root.opt.peers).length)&&++u<=a)){n.rid(t);var o,r=(r=t.$)&&r._||{},c=0;for(a=s.jam,delete s.jam;o=a[c++];){var f=o[0];o=o[1],f&&f(r.link||r.soul||e.valid(t.put)||((t.put||{})._||{})["#"],o,t,n)}}},{out:{get:{".":!0}}}))}(this,t,0,s),this;var f,l=(u=this)._,h=n||{},p=l.root;h.at=l,h.ok=t;var d={};return r.at=l,(l.any||(l.any={}))[f=String.random(7)]=r,r.off=function(){r.stun=1,l.any&&delete l.any[f]},r.rid=o,r.id=h.run||++p.once,c=p.pass,(p.pass={})[f]=1,h.out=h.out||{get:{}},l.on("out",h.out),p.pass=c,u}if("number"==typeof t)return this.get(""+t,n,s);if("string"==typeof(c=a(t)))return this.get(c,n,s);(c=this.get.next)&&(u=c(this,t))}return u?(n&&"function"==typeof n&&u.get(n,s),u):((u=this.chain())._.err={err:e.log("Invalid get request!",t)},n&&n.call(u,u._.err),u)};var i,r={},a=e.valid})(t,"./get"),t(function(n){var e=t("./root");function o(t,n){if(n){n=(n._||"").id||n;var o,i=t.root.stun||(t.root.stun={on:e.on}),r={};t.stun||(t.stun=i.on("stun",function(){})),(o=i.on(""+n))&&o.the.last.next(r),r.run>=t.run||i.on(""+n,function(n){if(t.stun.end)return this.off(),void this.to.next(n);n.run=n.run||t.run,n.stun=n.stun||t.stun})}}function i(t){if(t.err)i.end(t.stun,t.root);else if(!t.todo.length&&!t.end&&Object.empty(t.wait)){t.end=1;var n,o=t.$.back(-1)._,r=o.root,a=o.ask(function(n){r.on("ack",n),n.err&&!n.lack&&e.log(n),++s>(t.acks||0)&&this.off(),t.ack&&t.ack(n,this)},t.opt),s=0,u=t.stun;(n=function(){u&&(i.end(u,r),setTimeout.each(Object.keys(u=u.add||""),function(t){(t=u[t])&&t()}))}).hatch=n,t.ack&&!t.ok&&(t.ok=t.acks||9),t.via._.on("out",{put:t.out=t.graph,ok:t.ok&&{"@":t.ok+1},opt:t.opt,"#":a,_:n})}}e.chain.put=function(t,n,a){var f=this,l=f._,h=l.root;(a=a||{}).root=l.root,a.run||(a.run=h.once),o(a,l.id),a.ack=a.ack||n,a.via=a.via||f,a.data=a.data||t,a.soul||(a.soul=l.soul||"string"==typeof n&&n);var p=a.state=a.state||e.state();return"function"==typeof t?(t(function(t){a.data=t,f.put(r,r,a)}),f):a.soul?(a.$=h.$.get(a.soul),a.todo=[{it:a.data,ref:a.$}],a.turn=a.turn||s,a.ran=a.ran||i,function t(){var n,r,s,f,l,h=a.todo,d=h.pop(),g=d.it;if(d.ref&&d.ref._.id,o(a,d.ref),(f=d.todo)&&(g=g[r=f.pop()],f.length&&h.push(d)),r&&(h.path||(h.path=[])).push(r),!(n=u(g))&&!(l=e.is(g))){if(!Object.plain(g))return void i.err(a,"Invalid data: "+function(t,n){return t&&(n=t.constructor)&&n.name||typeof t}(g)+" at "+(a.via.back(function(t){t.get&&f.push(t.get)},f=[])||f.join("."))+"."+(h.path||[]).join("."));for(var v=a.seen||(a.seen=[]),y=v.length;y--;)if(g===(f=v[y]).it){n=g=f.link;break}}if(r&&n)d.node=c(d.node,r,p,g);else{let t=function(n,e){var i=s.link["#"];e&&(e.off(),e.rid(n));var r=i||n.soul||(f=(n.$$||n.$)._||"").soul||f.link||((f=f.put||"")._||"")["#"]||f["#"]||((f=n.put||"")&&n.$$?f["#"]:(f["="]||f[":"]||"")["#"]);!i&&o(a,n.$),r||d.link["#"]?(r||(r=[],(n.$$||n.$).back(function(t){if(f=t.soul||t.link)return r.push(f);r.push(t.get)}),r=r.reverse().join("/")),s.link["#"]=r,!l&&(((a.graph||(a.graph={}))[r]=s.node||(s.node={_:{}}))._["#"]=r),delete a.wait[k],s.wait&&setTimeout.each(s.wait,function(t){t&&t()}),a.ran(a)):(d.wait||(d.wait=[])).push(function(){t(n,e)})};if(!a.seen)return void i.err(a,"Data at root of graph must be a node (an object).");a.seen.push(s={it:g,link:{},todo:l?[]:Object.keys(g).sort().reverse(),path:(h.path||[]).slice(),up:d}),d.node=c(d.node,r,p,s.link),!l&&s.todo.length&&h.push(s);var k=a.seen.length;(a.wait||(a.wait={}))[k]="",f=(s.ref=l?g:r?d.ref.get(r):d.ref)._,(f=g&&(g._||"")["#"]||f.soul||f.link)?t({soul:f}):s.ref.get(t,{run:a.run,v2020:1,out:{get:{".":" "}}})}if(!h.length)return a.ran(a);a.turn(t)}(),f):(function(t){var n,e=t.via._;t.via=t.via.back(function(e){if(e.soul||!e.get)return e.$;n=t.data,(t.data={})[e.get]=n}),t.via&&t.via._.soul||(t.via=e.root.$.get(((t.data||"")._||"")["#"]||e.$.back("opt.uuid")())),t.via.put(t.data,t.ack,t)}(a),f)},i.end=function(t,n){t.end=a,t.the.to===t&&t===t.the.last&&delete n.stun,t.off()},i.err=function(t,n){(t.ack||a).call(t,t.out={err:t.err=e.log(n)}),t.ran(t)};var r,a=function(){},s=setTimeout.turn,u=e.valid,c=e.state.ify})(t,"./put"),t(function(n){var e=t("./root");t("./chain"),t("./back"),t("./put"),t("./get"),n.exports=e})(t,"./index"),t(function(n){var e,o=t("./index");o.chain.on=function(t,n,e,o){var i,r=this,a=r._;if(a.root,"string"==typeof t)return n?(i=a.on(t,n,e||a,o),e&&e.$&&(e.subs||(e.subs=[])).push(i),r):a.on(t);var s=n;return(s=!0===s?{change:!0}:s||{}).not=1,s.on=1,r.get(t,s),r},o.chain.once=function(t,n){if(n=n||{},!t)return function(t,n,e){return o.log.once("valonce","Chainable val is experimental, its behavior and API may change moving forward. Please play with it and report bugs and ideas on how to improve it."),(e=t.chain())._.nix=t.once(function(t,n){e._.on("in",this._)}),e._.lex=t._.lex,e}(this);var i=this,r=i._,a=r.root;r.put;var s,u=String.random(7);return i.get(function(i,c,f,l){var h=this,p=h._,d=p.one||(p.one={});function g(v){p.has||p.soul||(p={put:i,get:c}),e===(s=p.put)&&(s=((f.$$||"")._||"").put),"string"!=typeof o.valid(s)||(s=a.$.get(s)._.put)!==e||v?l.stun||""!==d[u]&&(d[u]="",(r.soul||r.has)&&l.off(),t.call(h,s,p.get),clearTimeout(d[u])):d[u]=setTimeout(function(){g(1)},n.wait||99)}l.stun||""!==d[u]&&(!0!==(s=o.valid(i))?"string"!=typeof s&&(clearTimeout((r.one||"")[u]),clearTimeout(d[u]),d[u]=setTimeout(g,n.wait||99)):g())},{on:1}),i},o.chain.off=function(){var t,n=this._,e=n.back;if(e)return n.ack=0,(t=e.next)&&t[n.get]&&delete t[n.get],(t=e.any)&&(delete e.any,e.any={}),(t=e.ask)&&delete t[n.get],(t=e.put)&&delete t[n.get],(t=n.soul)&&delete e.root.graph[t],(t=n.map)&&Object.keys(t).forEach(function(n,o){(o=t[n]).link&&e.root.$.get(o.link).off()}),(t=n.next)&&Object.keys(t).forEach(function(n,e){t[n].$.off()}),n.on("off",{}),this}})(t,"./on"),t(function(n){var e=t("./index"),o=e.chain.get.next;function i(t){this.to.next(t);var n,o=this.as,i=t.$._,r=t.put;(i.soul||t.$$)&&((n=o.lex)&&!String.match(t.get||(r||"")["."],n["."]||n["#"]||n)||e.on.link(t,o))}e.chain.get.next=function(t,n){var e;return Object.plain(n)?(e=((e=n["#"])||"")["="]||e)?t.get(e):((e=t.chain()._).lex=n,t.on("in",function(t){String.match(t.get||(t.put||"")["."],n["."]||n["#"]||n)&&e.on("in",t),this.to.next(t)}),e.$):(o||a)(t,n)},e.chain.map=function(t,n,o){var s,u,c=this,f=c._;return Object.plain(t)&&(s=t["."]?t:{".":t},t=r),t?(e.log.once("mapfn","Map functions are experimental, their behavior and API may change moving forward. Please play with it and report bugs and ideas on how to improve it."),u=c.chain(),c.map().on(function(n,o,i,s){var c=(t||a).call(this,n,o,i,s);if(r!==c){if(n===c)return u._.on("in",i);if(e.is(c))return u._.on("in",c._);var f={};Object.keys(i.put).forEach(function(t){f[t]=i.put[t]},f),f["="]=c,u._.on("in",{get:o,put:f})}}),u):((u=f.each)||((f.each=u=c.chain())._.lex=s||u._.lex||f.lex,u._.nix=c.back("nix"),c.on("in",i,u._)),u)};var r,a=function(){}})(t,"./map"),t(function(n){var e=t("./index");e.chain.set=function(t,n,o){var i,r,a=this,s=a.back(-1);return n=n||function(){},(o=o||{}).item=o.item||t,(i=((t||"")._||"")["#"])&&((t={})["#"]=i),"string"==typeof(r=e.valid(t))?a.get(i=r).put(t,n,o):e.is(t)?(a.put(function(o){t.get(function(t,i,s){if(!t)return n.call(a,{err:e.log('Only a node can be linked! Not "'+s.put+'"!')});(r={})[t]={"#":t},o(r)},!0)}),t):(Object.plain(t)&&(t=s.get(i=a.back("opt.uuid")()).put(t)),a.get(i||s.back("opt.uuid")(7)).put(t,n,o))}})(t,"./set"),t(function(n){t("./shim");var e,o=function(){},i=JSON.parseAsync||function(t,n,e){var o=+new Date;try{n(void 0,JSON.parse(t,e),r.sucks(+new Date-o))}catch(i){n(i)}},r=JSON.stringifyAsync||function(t,n,e,o){var i=+new Date;try{n(void 0,JSON.stringify(t,e,o),r.sucks(+new Date-i))}catch(a){n(a)}};r.sucks=function(t){t>99&&(console.log("Warning: JSON blocking CPU detected. Add `gun/lib/yson.js` to fix."),r.sucks=o)};try{n.exports=function(t){var n=function(){},o=t.opt||{};o.log=o.log||console.log,o.gap=o.gap||o.wait||0,o.max=o.max||.3*(o.memory?999*o.memory*999:3e8),o.pack=o.pack||.01*o.max*.01,o.puff=o.puff||9;var a=setTimeout.turn||setTimeout,s=t.dup,u=s.check,c=s.track,f=n.hear=function(t,e){if(t){if(o.max<=t.length)return n.say({dam:"!",err:"Message too big!"},e);n===this&&(f.d+=t.length||0,++f.c);var r,s=e.SH=+new Date,u=t[0];return"["===u?(i(t,function(t,i){if(t||!i)return n.say({dam:"!",err:"DAM JSON parse error."},e);console.STAT&&console.STAT(+new Date,i.length,"# on hear batch");var r=o.puff;!function t(){for(var o,s=+new Date,u=0;u<r&&(o=i[u++]);)n.hear(o,e);i=i.slice(u),console.STAT&&console.STAT(s,+new Date-s,"hear loop"),l(e),i.length&&a(t,0)}()}),void(t="")):"{"===u||(t["#"]||Object.plain(t))&&(r=t)?r?f.one(r,e,s):void i(t,function(t,o){if(t||!o)return n.say({dam:"!",err:"DAM JSON parse error."},e);f.one(o,e,s)}):void 0}};function l(t){var n=t.batch,e="string"==typeof n;if(e&&(n+="]"),t.batch=t.tail=null,n&&!(e?3>n.length:!n.length)){if(!e)try{n=1===n.length?n[0]:JSON.stringify(n)}catch(i){return o.log("DAM JSON stringify error",i)}n&&h(n,t)}}function h(t,e){try{var o=e.wire;e.say?e.say(t):o.send&&o.send(t),n.say.d+=t.length||0,++n.say.c}catch(i){(e.queue=e.queue||[]).push(t)}}return f.one=function(e,o,i){var r,a,f,l,h;if(e.DBG&&(e.DBG=h={DBG:e.DBG}),h&&(h.h=i),h&&(h.hp=+new Date),(r=e["#"])||(r=e["#"]=String.random(9)),!((f=u(r))||(a=e["##"])&&(f=e["@"]||e.get&&r)&&s.check(l=f+a))){if((e._=function(){}).via=n.leap=o,(f=e["><"])&&"string"==typeof f&&f.slice(0,99).split(",").forEach(function(t){this[t]=1},e._.yo={}),f=e.dam)return(f=n.hear[f])&&f(e,o,t),void c(r);(f=e.ok)&&(e._.near=f["/"]),i=+new Date,h&&(h.is=i),o.SI=r,c.ed=function(t){r===t&&(c.ed=0,(t=s.s[r])&&(t.via=o,e.get&&(t.it=e)))},t.on("in",n.last=e),h&&(h.hd=+new Date),console.STAT&&console.STAT(i,+new Date-i,e.get?"msg get":e.put?"msg put":"msg"),c(r),l&&c(l),n.leap=n.last=null}},f.c=f.d=0,function(){var t,i=0;function f(t,n){var e;return n instanceof Object?(Object.keys(n).sort().forEach(p,{to:e={},on:n}),e):n}function p(t){this.to[t]=this.on[t]}n.hash=function(t,e){var o,i,s,u=+new Date;r(t.put,function r(c,f){var l=(i||(i=s=f||"")).slice(0,32768);o=String.hash(l,o),(i=i.slice(32768))?a(r,0):(console.STAT&&console.STAT(u,+new Date-u,"say json+hash"),t._.$put=s,t["##"]=o,n.say(t,e),delete t._.$put)},f)},(n.say=function(r,u){var f;if((f=this)&&(f=f.to)&&f.next&&f.next(r),!r)return!1;var p,d,g,v=r["@"],y=r._||(r._=function(){}),k=r.DBG,m=+new Date;if(y.y=y.y||m,u||k&&(k.y=m),(p=r["#"])||(p=r["#"]=String.random(9)),!t&&c(p),(d=r["##"])||e===r.put||y.via||!v){if(!u&&v&&(u=(f=s.s[v])&&(f.via||(f=f.it)&&(f=f._)&&f.via)||(f=n.last)&&v===f["#"]&&n.leap),!u&&v){if(s.s[v])return;return console.STAT&&console.STAT(+new Date,++i,"total no peer to ack to"),!1}if(v&&!r.put&&!d&&((s.s[v]||"").it||"")["##"])return!1;if(!u&&n.way)return n.way(r);if(k&&(k.yh=+new Date),g=y.raw){if(k&&(k.yr=+new Date),!u||!u.id){if(!Object.plain(u||o.peers))return!1;m=+new Date,o.puff;var b=o.peers,_=Object.keys(u||o.peers||{});return console.STAT&&console.STAT(m,+new Date-m,"peer keys"),void function e(){var o=+new Date;t=1;var i=y.raw;y.raw=g;for(var s,f=0;f<9&&(s=(_||"")[f++]);)(s=b[s]||(u||"")[s])&&n.say(r,s);y.raw=i,t=0,_=_.slice(f),console.STAT&&console.STAT(o,+new Date-o,"say loop"),_.length&&(a(e,0),v&&c(v))}()}if(!u.wire&&n.wire&&n.wire(u),p!==u.last){if(u.last=p,u===y.via)return!1;if((f=y.yo)&&(f[u.url]||f[u.pid]||f[u.id]))return!1;if(console.STAT&&console.STAT(m,((k||y).yp=+new Date)-(y.y||m),"say prep"),!t&&v&&c(v),u.batch){if(u.tail=(f=u.tail||0)+g.length,u.tail<=o.pack)return void(u.batch+=(f?",":"")+g);l(u)}u.batch="[";var w=+new Date;setTimeout(function(){console.STAT&&console.STAT(w,+new Date-w,"0ms TO"),l(u)},o.gap),h(g,u),console.STAT&&v===u.SI&&console.STAT(m,+new Date-u.SH,"say ack")}}else n.raw(r,u)}else n.hash(r,u)}).c=n.say.d=0,n.raw=function(t,i){if(!t)return"";var a,c,f=t._||{};if(c=f.raw)return c;if("string"==typeof t)return t;var l=t["##"],h=t["@"];if(l&&h){if(!f.via&&u(h+l))return!1;if(c=(s.s[h]||"").it){if(l===c["##"])return!1;c["##"]||(c["##"]=l)}}if(!t.dam&&!t["@"]){var p=0,d=[];for(var g in c=o.peers){var v=c[g];if(d.push(v.url||v.pid||v.id),++p>6)break}p>1&&(t["><"]=d.join())}if(t.put&&(c=t.ok)&&(t.ok={"@":(c["@"]||1)-1,"/":c["/"]==t._.near?n.near:c["/"]}),a=f.$put)return c={},Object.keys(t).forEach(function(n){c[n]=t[n]}),c.put=":])([:",void r(c,function(t,n){if(!t){var o=+new Date;c=n.indexOf('"put":":])([:"'),y(e,n=n.slice(0,c+6)+a+n.slice(c+14)),console.STAT&&console.STAT(o,+new Date-o,"say slice")}});function y(e,o){e||(f.raw=o,n.say(t,i))}r(t,y)}}(),n.near=0,n.hi=function(e){var i;e.wire?(e.id?o.peers[e.url||e.id]=e:(i=e.id=e.id||e.url||String.random(9),n.say({dam:"?",pid:t.opt.pid},o.peers[i]=e),delete s.s[e.last]),e.met||(n.near++,e.met=+new Date,t.on("hi",e)),i=e.queue,e.queue=[],setTimeout.each(i||[],function(t){h(t,e)},0,9)):n.wire(e.length&&{url:e,id:e}||e)},n.bye=function(e){e.met&&--n.near,delete e.met,t.on("bye",e);var o=+new Date;o-=e.met||o,n.bye.time=((n.bye.time||o)+o)/2},n.hear["!"]=function(t,n){o.log("Error:",t.err)},n.hear["?"]=function(t,e){t.pid&&(e.pid||(e.pid=t.pid),t["@"])||(n.say({dam:"?",pid:o.pid,"@":t["#"]},e),delete s.s[e.last])},n.hear.mob=function(t,e){if(t.peers){var o=Object.keys(t.peers),i=o[Math.random()*o.length|0];i&&(n.bye(e),n.hi(i))}},t.on("create",function(t){t.opt.pid=t.opt.pid||String.random(9),this.to.next(t),t.on("out",n.say)}),t.on("bye",function(t,n){t=o.peers[t.id||t]||t,this.to.next(t),t.bye?t.bye():(n=t.wire)&&n.close&&n.close(),delete o.peers[t.id],t.wire=null}),t.on("bye",function(t,e){this.to.next(t),(e=console.STAT)&&(e.peers=n.near),(e=t.url)&&setTimeout(function(){},o.lack||9e3)}),t.on("hi",function(e,i){if(this.to.next(e),(i=console.STAT)&&(i.peers=n.near),!o.super){var r=Object.keys(t.next||"");r.length>9999&&!console.SUBS&&console.log(console.SUBS="Warning: You have more than 10K live GETs, which might use more bandwidth than your screen can show - consider `.off()`."),setTimeout.each(r,function(i){var r=t.next[i];o.super||(r.ask||"")[""]?n.say({get:{"#":i}},e):setTimeout.each(Object.keys(r.ask||""),function(o){o&&n.say({"##":String.hash((t.graph[i]||"")[o]),get:{"#":i,".":o}},e)})})}}),n}}catch(a){}})(t,"./mesh"),t(function(n){var e=t("./index");e.Mesh=t("./mesh"),e.on("opt",function(t){if(this.to.next(t),!t.once){var n=t.opt;if(!1!==n.WebSocket){var o=e.window||{},i=n.WebSocket||o.WebSocket||o.webkitWebSocket||o.mozWebSocket;if(i){n.WebSocket=i;var r=n.mesh=n.mesh||e.Mesh(t);r.wire||n.wire,r.wire=n.wire=u,setTimeout(function(){!n.super&&t.on("out",{dam:"hi"})},1);var a=1998,s=""+void 0!=typeof document&&document}}}function u(t){try{if(!t||!t.url)return o&&o(t);var e=t.url.replace(/^http/,"ws"),o=t.wire=new n.WebSocket(e);return o.onclose=function(){c(t),n.mesh.bye(t)},o.onerror=function(n){c(t)},o.onopen=function(){n.mesh.hi(t)},o.onmessage=function(e){e&&n.mesh.hear(e.data||e,t)},o}catch(i){n.mesh.bye(t)}}function c(t){clearTimeout(t.defer),n.peers[t.url]&&(s&&t.retry<=0||(t.retry=(t.retry||n.retry+1||60)-(-t.tried+(t.tried=+new Date)<4*a?1:0),t.defer=setTimeout(function n(){if(s&&s.hidden)return setTimeout(n,a);u(t)},a)))}})})(t,"./websocket"),t(function(t){if("undefined"!=typeof Gun){var n;try{n=(Gun.window||function(){}).localStorage}catch(o){}n||(Gun.log("Warning: No localStorage exists to persist data to!"),n={setItem:function(t,n){this[t]=n},removeItem:function(t){delete this[t]},getItem:function(t){return this[t]}});var e=JSON.stringifyAsync||function(t,n,e,i){try{n(void 0,JSON.stringify(t,e,i))}catch(o){n(o)}};Gun.on("create",function t(i){this.to.next(i);var r=i.opt;i.graph;var a,s,u,c,f=[];if(!1!==r.localStorage){r.prefix=r.file||"gun/";try{a=t[r.prefix]=t[r.prefix]||JSON.parse(u=n.getItem(r.prefix))||{}}catch(o){a=t[r.prefix]={}}u=(u||"").length,i.on("get",function(t){this.to.next(t);var n,e,o,i=t.get;i&&(n=i["#"])&&((e=a[n]||void 0)&&(o=i["."])&&!Object.plain(o)&&(e=Gun.state.ify({},o,Gun.state.is(e,o),e[o],n)),Gun.on.get.ack(t,e))}),i.on("put",function(t){this.to.next(t);var n=t.put,e=n["#"],o=n["."],r=t["#"],h=t.ok||"";(i.next||"")[e]&&(a[e]=Gun.state.ify(a[e],o,n[">"],n[":"],e),c&&u>4999880?i.on("in",{"@":r,err:"localStorage max!"}):(t["@"]||t._.via&&!(Math.random()<h["@"]/h["/"])||f.push(r),s||(s=setTimeout(l,9+u/333))))})}function l(){if(f.length||!((setTimeout.turn||"").s||"").length){var t=f;clearTimeout(s),s=!1,f=[],e(a,function(e,s){try{!e&&n.setItem(r.prefix,s)}catch(o){e=c=o||"localStorage failure"}e&&(Gun.log(e+" Consider using GUN's IndexedDB plugin for RAD for more storage space, https://gun.eco/docs/RAD#install"),i.on("localStorage:error",{err:e,get:r.prefix,put:a})),u=s.length,setTimeout.each(t,function(t){i.on("in",{"@":t,err:e,ok:0})},0,99)})}else setTimeout(l,99)}})}})(t,"./localStorage")}(),function(){if(""+w!=typeof Gun){var t=function(t){console.warn("Warning! Deprecated internal utility will break in next version:",t)},n=Gun;n.fn=n.fn||{is:function(n){return t("fn"),!!n&&"function"==typeof n}},n.bi=n.bi||{is:function(n){return t("bi"),n instanceof Boolean||"boolean"==typeof n}},n.num=n.num||{is:function(n){return t("num"),!o(n)&&(n-parseFloat(n)+1>=0||1/0===n||-1/0===n)}},n.text=n.text||{is:function(n){return t("text"),"string"==typeof n}},n.text.ify=n.text.ify||function(e){return t("text.ify"),n.text.is(e)?e:"undefined"!=typeof JSON?JSON.stringify(e):e&&e.toString?e.toString():e},n.text.random=n.text.random||function(n,e){t("text.random");var o="";for(n=n||24,e=e||"0123456789ABCDEFGHIJKLMNOPQRSTUVWXZabcdefghijklmnopqrstuvwxyz";n>0;)o+=e.charAt(Math.floor(Math.random()*e.length)),n--;return o},n.text.match=n.text.match||function(n,e){var o,i;return t("text.match"),"string"==typeof n&&("string"==typeof e&&(e={"=":e}),n===(o=(e=e||{})["="]||e["*"]||e[">"]||e["<"])||i===e["="]&&(o=e["*"]||e[">"]||e["<"],n.slice(0,(o||"").length)===o||i===e["*"]&&(i!==e[">"]&&i!==e["<"]?n>=e[">"]&&n<=e["<"]:i!==e[">"]&&n>=e[">"]||i!==e["<"]&&n<=e["<"])))},n.text.hash=n.text.hash||function(n,e){if(t("text.hash"),"string"==typeof n){if(e=e||0,!n.length)return e;for(var o=0,i=n.length;o<i;++o)e=(e<<5)-e+n.charCodeAt(o),e|=0;return e}},n.list=n.list||{is:function(n){return t("list"),n instanceof Array}},n.list.slit=n.list.slit||Array.prototype.slice,n.list.sort=n.list.sort||function(n){return t("list.sort"),function(t,e){return t&&e?(t=t[n])<(e=e[n])?-1:t>e?1:0:0}},n.list.map=n.list.map||function(n,e,o){return t("list.map"),a(n,e,o)},n.list.index=1,n.obj=n.boj||{is:function(n){return t("obj"),!!n&&(n instanceof Object&&n.constructor===Object||"Object"===Object.prototype.toString.call(n).match(/^\[object (\w+)\]$/)[1])}},n.obj.put=n.obj.put||function(n,e,o){return t("obj.put"),(n||{})[e]=o,n},n.obj.has=n.obj.has||function(n,e){return t("obj.has"),n&&Object.prototype.hasOwnProperty.call(n,e)},n.obj.del=n.obj.del||function(n,e){if(t("obj.del"),n)return n[e]=null,delete n[e],n},n.obj.as=n.obj.as||function(n,e,o,i){return t("obj.as"),n[e]=n[e]||(i===o?{}:o)},n.obj.ify=n.obj.ify||function(n){if(t("obj.ify"),i(n))return n;try{n=JSON.parse(n)}catch(e){n={}}return n},function(){function e(t,n){r(this,n)&&void 0!==this[n]||(this[n]=t)}n.obj.to=n.obj.to||function(n,o){return t("obj.to"),a(n,e,o=o||{}),o}}(),n.obj.copy=n.obj.copy||function(n){return t("obj.copy"),n?JSON.parse(JSON.stringify(n)):n},function(){function e(t,n){var e=this.n;if(!e||!(n===e||i(e)&&r(e,n)))return void 0!==n||void 0}n.obj.empty=n.obj.empty||function(n,o){return t("obj.empty"),!n||!a(n,e,{n:o})}}(),function(){function e(t,n){if(2===arguments.length)return e.r=e.r||{},void(e.r[t]=n);e.r=e.r||[],e.r.push(t)}var a,s=Object.keys;Object.keys=Object.keys||function(t){return a(t,function(t,n,e){e(n)})},n.obj.map=a=n.obj.map||function(a,u,c){t("obj.map");var f,l,h,p,d,g=0,v="function"==typeof u;if(e.r=f,s&&i(a)&&(p=s(a),d=!0),c=c||{},o(a)||p)for(l=(p||a).length;g<l;g++){var y=g+n.list.index;if(v){if((h=d?u.call(c,a[p[g]],p[g],e):u.call(c,a[g],y,e))!==f)return h}else if(u===a[d?p[g]:g])return p?p[g]:y}else for(g in a)if(v){if(r(a,g)&&(h=c?u.call(c,a[g],g,e):u(a[g],g,e))!==f)return h}else if(u===a[g])return g;return v?e.r:n.list.index?0:-1}}(),n.time=n.time||{},n.time.is=n.time.is||function(n){return t("time"),n?n instanceof Date:+(new Date).getTime()};var e=n.fn.is,o=n.list.is,i=(_=n.obj).is,r=_.has,a=_.map,s={is:function(n){return t("val.is"),n!==w&&(null===n||n!==1/0&&(!!(l(n)||c(n)||f(n))||s.link.is(n)||!1))}};s.link=s.rel={_:"#"},function(){function n(t,n){var e=this;return e.id?e.id=!1:n==u&&l(t)?void(e.id=t):e.id=!1}s.link.is=function(e){if(t("val.link.is"),e&&e[u]&&!e._&&i(e)){var o={};if(a(e,n,o),o.id)return o.id}return!1}}(),s.link.ify=function(n){return t("val.link.ify"),h({},u,n)},n.obj.has._=".";var u=s.link._,c=n.bi.is,f=n.num.is,l=n.text.is,h=(i=(_=n.obj).is,_.put);a=_.map,n.val=n.val||s;var p={_:"_",soul:function(n,e){return t("node.soul"),n&&n._&&n._[e||v]}};p.soul.ify=function(n,e){return t("node.soul.ify"),e="string"==typeof e?{soul:e}:e||{},(n=n||{})._=n._||{},n._[v]=e.soul||n._[v]||g(),n},p.soul._=s.link._,function(){function n(t,n){if(n!==p._)return!s.is(t)||void(this.cb&&this.cb.call(this.as,t,n,this.n,this.s))}p.is=function(e,o,r){var s;return t("node.is"),!!i(e)&&!!(s=p.soul(e))&&!a(e,n,{as:r,cb:o,s:s,n:e})}}(),function(){function n(t,n){var e,o=this.o;o.map?void 0===(e=o.map.call(this.as,t,""+n,o.node))?d(o.node,n):o.node&&(o.node[n]=e):s.is(t)&&(o.node[n]=t)}p.ify=function(e,o,i){return t("node.ify"),o?"string"==typeof o?o={soul:o}:"function"==typeof o&&(o={map:o}):o={},o.map&&(o.node=o.map.call(i,e,w,o.node||{})),(o.node=p.soul.ify(o.node||{},o))&&a(e,n,{o:o,as:i}),o.node}}(),i=(_=n.obj).is;var d=_.del,g=(a=_.map,n.text.random),v=p.soul._;n.node=n.node||p;var y=n.state;y.lex=function(){return t("state.lex"),y().toString(36).replace(".","")},y.to=function(n,e,o){t("state.to");var r=(n||{})[e];return i(r)&&(r=k(r)),y.ify(o,e,y.is(n,e),r,p.soul(n))},function(){function n(t,n){m!==n&&y.ify(this.o,n,this.s)}y.map=function(o,s,u){var c;t("state.map");var l=i(l=o||s)?l:null;return o=e(o=o||s)?o:null,l&&!o?(s=f(s)?s:y(),l[m]=l[m]||{},a(l,n,{o:l,s:s}),l):(u=u||i(s)?s:c,s=f(s)?s:y(),function(t,e,i,a){if(!o)return n.call({o:i,s:s},t,e),t;o.call(u||this||{},t,e,i,a),r(i,e)&&c===i[e]||n.call({o:i,s:s},t,e)})}}(),(_=n.obj).as,r=_.has,i=_.is,a=_.map;var k=_.copy,m=(f=n.num.is,e=n.fn.is,p._),b={};!function(){function n(t,n){if(!t||n!==p.soul(t)||!p.is(t,this.fn,this.as))return!0;this.cb&&(e.n=t,e.as=this.as,this.cb.call(e.as,t,n,e))}function e(t){t&&p.is(e.n,t,e.as)}b.is=function(e,o,r,s){return t("graph.is"),!(!e||!i(e)||$(e)||a(e,n,{cb:o,fn:r,as:s}))}}(),function(){function e(t,n){var e;return(e=function(t,n){for(var e,o=t.seen,i=o.length;i--;)if(e=o[i],n.obj===e.obj)return e;o.push(n)}(t,n))?e:(n.env=t,n.soul=a,p.ify(n.obj,o,n)&&(n.link=n.link||s.link.ify(p.soul(n.node)),n.obj!==t.shell&&(t.graph[s.link.is(n.link)]=n.node)),n)}function o(t,n,o){var i,a,c=this,f=c.env;if(p._===n&&r(t,s.link._))return o._;if(i=u(t,n,o,c,f)){if(n||(c.node=c.node||o||{},r(t,p._)&&p.soul(t)&&(c.node._=k(t._)),c.node=p.soul.ify(c.node,s.link.is(c.link)),c.link=c.link||s.link.ify(p.soul(c.node))),(a=f.map)&&(a.call(f.as||{},t,n,o,c),r(o,n))){if(t=o[n],w===t)return void d(o,n);if(!(i=u(t,n,o,c,f)))return}if(!n)return c.node;if(!0===i)return t;if((a=e(f,{obj:t,path:c.path.concat(n)})).node)return a.link}}function a(t){var n=this,e=s.link.is(n.link),o=n.env.graph;n.link=n.link||s.link.ify(t),n.link[s.link._]=t,n.node&&n.node[p._]&&(n.node[p._][s.link._]=t),r(o,e)&&(o[t]=o[e],d(o,e))}function u(t,e,o,r,a){var c;return!!s.is(t)||(i(t)?1:(c=a.invalid)?u(t=c.call(a.as||{},t,e,o),e,o,r,a):(a.err="Invalid value at '"+r.path.concat(e).join(".")+"'!",void(n.list.is(t)&&(a.err+=" Use `.set(item)` instead of an Array."))))}b.ify=function(n,o,i){t("graph.ify");var r={path:[],obj:n};return o?"string"==typeof o?o={soul:o}:"function"==typeof o&&(o.map=o):o={},"string"==typeof i&&(o.soul=o.soul||i,i=w),o.soul&&(r.link=s.link.ify(o.soul)),o.shell=(i||{}).shell,o.graph=o.graph||{},o.seen=o.seen||[],o.as=o.as||i,e(o,r),o.root=r.node,o.graph}}(),b.node=function(n){t("graph.node");var e=p.soul(n);if(e)return h({},e,n)},function(){function n(t,n){var e,o;if(p._!==n)(e=s.link.is(t))?(o=this.opt.seen[e])?this.obj[n]=o:this.obj[n]=this.opt.seen[e]=b.to(this.graph,e,this.opt):this.obj[n]=t;else{if($(t,s.link._))return;this.obj[n]=k(t)}}b.to=function(e,o,i){if(t("graph.to"),e){var r={};return i=i||{seen:{}},a(e[o],n,{obj:r,graph:e,opt:i}),r}}}(),e=n.fn.is,i=(_=n.obj).is,d=_.del,r=_.has;var _,w,$=_.empty;h=_.put,a=_.map,k=_.copy,n.graph=n.graph||b}}();var i=o.exports;const r=n({__proto__:null,default:t.getDefaultExportFromCjs(i)},[i]);exports.browser=r;
|
|
2
|
-
//# sourceMappingURL=browser-Cq59Ij19.cjs.map
|