@nsshunt/stsoauth2plugin 0.1.7 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/stsoauth2worker.56b3b966.js +7 -0
- package/dist/stsoauth2plugin.es.js +7500 -0
- package/dist/stsoauth2plugin.umd.js +6 -0
- package/package.json +12 -6
- package/types/Utils/CryptoUtils.d.ts +7 -0
- package/types/Utils/CryptoUtils.d.ts.map +1 -0
- package/types/Utils/QueryParams.d.ts +8 -0
- package/types/Utils/QueryParams.d.ts.map +1 -0
- package/types/index.d.ts +6 -0
- package/types/index.d.ts.map +1 -0
- package/types/index.test.d.ts +1 -0
- package/types/index.test.d.ts.map +1 -0
- package/types/stsStorage.d.ts +22 -0
- package/types/stsStorage.d.ts.map +1 -0
- package/types/stsoauth2manager.d.ts +11 -0
- package/types/stsoauth2manager.d.ts.map +1 -0
- package/types/stsoauth2types.d.ts +89 -0
- package/types/stsoauth2types.d.ts.map +1 -0
- package/types/stsoauth2worker.d.ts +2 -0
- package/types/stsoauth2worker.d.ts.map +1 -0
- package/.eslintrc.json +0 -27
- package/.github/dependabot.yml +0 -13
- package/.github/workflows/npm-publish.yml +0 -54
- package/babel.config.json +0 -6
- package/build.sh +0 -29
- package/tsconfig.json +0 -32
- package/vite.config.ts +0 -92
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
var Fu=Object.defineProperty,Mu=Object.defineProperties;var Uu=Object.getOwnPropertyDescriptors;var Da=Object.getOwnPropertySymbols;var Vu=Object.prototype.hasOwnProperty,zu=Object.prototype.propertyIsEnumerable;var Gn=(B,J,ce)=>J in B?Fu(B,J,{enumerable:!0,configurable:!0,writable:!0,value:ce}):B[J]=ce,Y=(B,J)=>{for(var ce in J||(J={}))Vu.call(J,ce)&&Gn(B,ce,J[ce]);if(Da)for(var ce of Da(J))zu.call(J,ce)&&Gn(B,ce,J[ce]);return B},le=(B,J)=>Mu(B,Uu(J));var nr=(B,J,ce)=>(Gn(B,typeof J!="symbol"?J+"":J,ce),ce),Ia=(B,J,ce)=>{if(!J.has(B))throw TypeError("Cannot "+ce)};var Q=(B,J,ce)=>(Ia(B,J,"read from private field"),ce?ce.call(B):J.get(B)),ge=(B,J,ce)=>{if(J.has(B))throw TypeError("Cannot add the same private member more than once");J instanceof WeakSet?J.add(B):J.set(B,ce)},re=(B,J,ce,ze)=>(Ia(B,J,"write to private field"),ze?ze.call(B,ce):J.set(B,ce),ce),Aa=(B,J,ce,ze)=>({set _(ut){re(B,J,ut,ce)},get _(){return Q(B,J,ze)}});(function(B,J){typeof exports=="object"&&typeof module!="undefined"?J(exports):typeof define=="function"&&define.amd?define(["exports"],J):(B=typeof globalThis!="undefined"?globalThis:B||self,J(B.stsoauth2plugin={}))})(this,function(B){var Dt,gt,mr,It,vt,Zr,xr,At,en,gr,kt,tn,Bt,vr,yt,Qt,_t,$t,yr,it,_r,$r,Er,wr;"use strict";var J=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},ce={exports:{}},ze=1e3,ut=ze*60,zt=ut*60,wt=zt*24,ka=wt*7,Fa=wt*365.25,Ma=function(e,t){t=t||{};var r=typeof e;if(r==="string"&&e.length>0)return Ua(e);if(r==="number"&&isFinite(e))return t.long?za(e):Va(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function Ua(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!!t){var r=parseFloat(t[1]),n=(t[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*Fa;case"weeks":case"week":case"w":return r*ka;case"days":case"day":case"d":return r*wt;case"hours":case"hour":case"hrs":case"hr":case"h":return r*zt;case"minutes":case"minute":case"mins":case"min":case"m":return r*ut;case"seconds":case"second":case"secs":case"sec":case"s":return r*ze;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function Va(e){var t=Math.abs(e);return t>=wt?Math.round(e/wt)+"d":t>=zt?Math.round(e/zt)+"h":t>=ut?Math.round(e/ut)+"m":t>=ze?Math.round(e/ze)+"s":e+"ms"}function za(e){var t=Math.abs(e);return t>=wt?Dr(e,t,wt,"day"):t>=zt?Dr(e,t,zt,"hour"):t>=ut?Dr(e,t,ut,"minute"):t>=ze?Dr(e,t,ze,"second"):e+" ms"}function Dr(e,t,r,n){var s=t>=r*1.5;return Math.round(e/r)+" "+n+(s?"s":"")}function La(e){r.debug=r,r.default=r,r.coerce=g,r.disable=a,r.enable=s,r.enabled=c,r.humanize=Ma,r.destroy=p,Object.keys(e).forEach(u=>{r[u]=e[u]}),r.names=[],r.skips=[],r.formatters={};function t(u){let m=0;for(let b=0;b<u.length;b++)m=(m<<5)-m+u.charCodeAt(b),m|=0;return r.colors[Math.abs(m)%r.colors.length]}r.selectColor=t;function r(u){let m,b=null,I,T;function A(...w){if(!A.enabled)return;const v=A,C=Number(new Date),N=C-(m||C);v.diff=N,v.prev=m,v.curr=C,m=C,w[0]=r.coerce(w[0]),typeof w[0]!="string"&&w.unshift("%O");let j=0;w[0]=w[0].replace(/%([a-zA-Z%])/g,(_,P)=>{if(_==="%%")return"%";j++;const D=r.formatters[P];if(typeof D=="function"){const H=w[j];_=D.call(v,H),w.splice(j,1),j--}return _}),r.formatArgs.call(v,w),(v.log||r.log).apply(v,w)}return A.namespace=u,A.useColors=r.useColors(),A.color=r.selectColor(u),A.extend=n,A.destroy=r.destroy,Object.defineProperty(A,"enabled",{enumerable:!0,configurable:!1,get:()=>b!==null?b:(I!==r.namespaces&&(I=r.namespaces,T=r.enabled(u)),T),set:w=>{b=w}}),typeof r.init=="function"&&r.init(A),A}function n(u,m){const b=r(this.namespace+(typeof m=="undefined"?":":m)+u);return b.log=this.log,b}function s(u){r.save(u),r.namespaces=u,r.names=[],r.skips=[];let m;const b=(typeof u=="string"?u:"").split(/[\s,]+/),I=b.length;for(m=0;m<I;m++)!b[m]||(u=b[m].replace(/\*/g,".*?"),u[0]==="-"?r.skips.push(new RegExp("^"+u.slice(1)+"$")):r.names.push(new RegExp("^"+u+"$")))}function a(){const u=[...r.names.map(h),...r.skips.map(h).map(m=>"-"+m)].join(",");return r.enable(""),u}function c(u){if(u[u.length-1]==="*")return!0;let m,b;for(m=0,b=r.skips.length;m<b;m++)if(r.skips[m].test(u))return!1;for(m=0,b=r.names.length;m<b;m++)if(r.names[m].test(u))return!0;return!1}function h(u){return u.toString().substring(2,u.toString().length-2).replace(/\.\*\?$/,"*")}function g(u){return u instanceof Error?u.stack||u.message:u}function p(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}var Ka=La;(function(e,t){t.formatArgs=n,t.save=s,t.load=a,t.useColors=r,t.storage=c(),t.destroy=(()=>{let g=!1;return()=>{g||(g=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function r(){return typeof window!="undefined"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document!="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function n(g){if(g[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+g[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const p="color: "+this.color;g.splice(1,0,p,"color: inherit");let u=0,m=0;g[0].replace(/%[a-zA-Z%]/g,b=>{b!=="%%"&&(u++,b==="%c"&&(m=u))}),g.splice(m,0,p)}t.log=console.debug||console.log||(()=>{});function s(g){try{g?t.storage.setItem("debug",g):t.storage.removeItem("debug")}catch{}}function a(){let g;try{g=t.storage.getItem("debug")}catch{}return!g&&typeof process!="undefined"&&"env"in process&&(g={}.DEBUG),g}function c(){try{return localStorage}catch{}}e.exports=Ka(t);const{formatters:h}=e.exports;h.j=function(g){try{return JSON.stringify(g)}catch(p){return"[UnexpectedJSONParseError]: "+p.message}}})(ce,ce.exports);var qn=ce.exports,Ir={},Ar={};Object.defineProperty(Ar,"__esModule",{value:!0}),Ar.GetErrorPayload=void 0;function Ha(e,t=null){return{error:e.code,error_description:e.description,timestamp:Date.now(),details:t}}Ar.GetErrorPayload=Ha;var kr={},St={},on={exports:{}},Bn={},He={},Lt={},sr={},ue={},ar={};(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(C){if(super(),!e.IDENTIFIER.test(C))throw new Error("CodeGen: name must be a valid identifier");this.str=C}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=r;class n extends t{constructor(C){super(),this._items=typeof C=="string"?[C]:C}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const C=this._items[0];return C===""||C==='""'}get str(){var C;return(C=this._str)!==null&&C!==void 0?C:this._str=this._items.reduce((N,j)=>`${N}${j}`,"")}get names(){var C;return(C=this._names)!==null&&C!==void 0?C:this._names=this._items.reduce((N,j)=>(j instanceof r&&(N[j.str]=(N[j.str]||0)+1),N),{})}}e._Code=n,e.nil=new n("");function s(v,...C){const N=[v[0]];let j=0;for(;j<C.length;)h(N,C[j]),N.push(v[++j]);return new n(N)}e._=s;const a=new n("+");function c(v,...C){const N=[I(v[0])];let j=0;for(;j<C.length;)N.push(a),h(N,C[j]),N.push(a,I(v[++j]));return g(N),new n(N)}e.str=c;function h(v,C){C instanceof n?v.push(...C._items):C instanceof r?v.push(C):v.push(m(C))}e.addCodeArg=h;function g(v){let C=1;for(;C<v.length-1;){if(v[C]===a){const N=p(v[C-1],v[C+1]);if(N!==void 0){v.splice(C-1,3,N);continue}v[C++]="+"}C++}}function p(v,C){if(C==='""')return v;if(v==='""')return C;if(typeof v=="string")return C instanceof r||v[v.length-1]!=='"'?void 0:typeof C!="string"?`${v.slice(0,-1)}${C}"`:C[0]==='"'?v.slice(0,-1)+C.slice(1):void 0;if(typeof C=="string"&&C[0]==='"'&&!(v instanceof r))return`"${v}${C.slice(1)}`}function u(v,C){return C.emptyStr()?v:v.emptyStr()?C:c`${v}${C}`}e.strConcat=u;function m(v){return typeof v=="number"||typeof v=="boolean"||v===null?v:I(Array.isArray(v)?v.join(","):v)}function b(v){return new n(I(v))}e.stringify=b;function I(v){return JSON.stringify(v).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=I;function T(v){return typeof v=="string"&&e.IDENTIFIER.test(v)?new n(`.${v}`):s`[${v}]`}e.getProperty=T;function A(v){if(typeof v=="string"&&e.IDENTIFIER.test(v))return new n(`${v}`);throw new Error(`CodeGen: invalid export name: ${v}, use explicit $id name mapping`)}e.getEsmExportName=A;function w(v){return new n(v.toString())}e.regexpCode=w})(ar);var cn={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=ar;class r extends Error{constructor(p){super(`CodeGen: "code" for ${p} not defined`),this.value=p.value}}var n;(function(g){g[g.Started=0]="Started",g[g.Completed=1]="Completed"})(n=e.UsedValueState||(e.UsedValueState={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class s{constructor({prefixes:p,parent:u}={}){this._names={},this._prefixes=p,this._parent=u}toName(p){return p instanceof t.Name?p:this.name(p)}name(p){return new t.Name(this._newName(p))}_newName(p){const u=this._names[p]||this._nameGroup(p);return`${p}${u.index++}`}_nameGroup(p){var u,m;if(((m=(u=this._parent)===null||u===void 0?void 0:u._prefixes)===null||m===void 0?void 0:m.has(p))||this._prefixes&&!this._prefixes.has(p))throw new Error(`CodeGen: prefix "${p}" is not allowed in this scope`);return this._names[p]={prefix:p,index:0}}}e.Scope=s;class a extends t.Name{constructor(p,u){super(u),this.prefix=p}setValue(p,{property:u,itemIndex:m}){this.value=p,this.scopePath=(0,t._)`.${new t.Name(u)}[${m}]`}}e.ValueScopeName=a;const c=(0,t._)`\n`;class h extends s{constructor(p){super(p),this._values={},this._scope=p.scope,this.opts=le(Y({},p),{_n:p.lines?c:t.nil})}get(){return this._scope}name(p){return new a(p,this._newName(p))}value(p,u){var m;if(u.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const b=this.toName(p),{prefix:I}=b,T=(m=u.key)!==null&&m!==void 0?m:u.ref;let A=this._values[I];if(A){const C=A.get(T);if(C)return C}else A=this._values[I]=new Map;A.set(T,b);const w=this._scope[I]||(this._scope[I]=[]),v=w.length;return w[v]=u.ref,b.setValue(u,{property:I,itemIndex:v}),b}getValue(p,u){const m=this._values[p];if(!!m)return m.get(u)}scopeRefs(p,u=this._values){return this._reduceValues(u,m=>{if(m.scopePath===void 0)throw new Error(`CodeGen: name "${m}" has no value`);return(0,t._)`${p}${m.scopePath}`})}scopeCode(p=this._values,u,m){return this._reduceValues(p,b=>{if(b.value===void 0)throw new Error(`CodeGen: name "${b}" has no value`);return b.value.code},u,m)}_reduceValues(p,u,m={},b){let I=t.nil;for(const T in p){const A=p[T];if(!A)continue;const w=m[T]=m[T]||new Map;A.forEach(v=>{if(w.has(v))return;w.set(v,n.Started);let C=u(v);if(C){const N=this.opts.es5?e.varKinds.var:e.varKinds.const;I=(0,t._)`${I}${N} ${v} = ${C};${this.opts._n}`}else if(C=b==null?void 0:b(v))I=(0,t._)`${I}${C}${this.opts._n}`;else throw new r(v);w.set(v,n.Completed)})}return I}}e.ValueScope=h})(cn),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=ar,r=cn;var n=ar;Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return n.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return n.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return n.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}});var s=cn;Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return s.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return s.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return s.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return s.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 a{optimizeNodes(){return this}optimizeNames(o,d){return this}}class c extends a{constructor(o,d,R){super(),this.varKind=o,this.name=d,this.rhs=R}render({es5:o,_n:d}){const R=o?r.varKinds.var:this.varKind,F=this.rhs===void 0?"":` = ${this.rhs}`;return`${R} ${this.name}${F};`+d}optimizeNames(o,d){if(!!o[this.name.str])return this.rhs&&(this.rhs=x(this.rhs,o,d)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class h extends a{constructor(o,d,R){super(),this.lhs=o,this.rhs=d,this.sideEffects=R}render({_n:o}){return`${this.lhs} = ${this.rhs};`+o}optimizeNames(o,d){if(!(this.lhs instanceof t.Name&&!o[this.lhs.str]&&!this.sideEffects))return this.rhs=x(this.rhs,o,d),this}get names(){const o=this.lhs instanceof t.Name?{}:Y({},this.lhs.names);return ie(o,this.rhs)}}class g extends h{constructor(o,d,R,F){super(o,R,F),this.op=d}render({_n:o}){return`${this.lhs} ${this.op}= ${this.rhs};`+o}}class p extends a{constructor(o){super(),this.label=o,this.names={}}render({_n:o}){return`${this.label}:`+o}}class u extends a{constructor(o){super(),this.label=o,this.names={}}render({_n:o}){return`break${this.label?` ${this.label}`:""};`+o}}class m extends a{constructor(o){super(),this.error=o}render({_n:o}){return`throw ${this.error};`+o}get names(){return this.error.names}}class b extends a{constructor(o){super(),this.code=o}render({_n:o}){return`${this.code};`+o}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(o,d){return this.code=x(this.code,o,d),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class I extends a{constructor(o=[]){super(),this.nodes=o}render(o){return this.nodes.reduce((d,R)=>d+R.render(o),"")}optimizeNodes(){const{nodes:o}=this;let d=o.length;for(;d--;){const R=o[d].optimizeNodes();Array.isArray(R)?o.splice(d,1,...R):R?o[d]=R:o.splice(d,1)}return o.length>0?this:void 0}optimizeNames(o,d){const{nodes:R}=this;let F=R.length;for(;F--;){const M=R[F];M.optimizeNames(o,d)||(ve(o,M.names),R.splice(F,1))}return R.length>0?this:void 0}get names(){return this.nodes.reduce((o,d)=>Z(o,d.names),{})}}class T extends I{render(o){return"{"+o._n+super.render(o)+"}"+o._n}}class A extends I{}class w extends T{}w.kind="else";class v extends T{constructor(o,d){super(d),this.condition=o}render(o){let d=`if(${this.condition})`+super.render(o);return this.else&&(d+="else "+this.else.render(o)),d}optimizeNodes(){super.optimizeNodes();const o=this.condition;if(o===!0)return this.nodes;let d=this.else;if(d){const R=d.optimizeNodes();d=this.else=Array.isArray(R)?new w(R):R}if(d)return o===!1?d instanceof v?d:d.nodes:this.nodes.length?this:new v($e(o),d instanceof v?[d]:d.nodes);if(!(o===!1||!this.nodes.length))return this}optimizeNames(o,d){var R;if(this.else=(R=this.else)===null||R===void 0?void 0:R.optimizeNames(o,d),!!(super.optimizeNames(o,d)||this.else))return this.condition=x(this.condition,o,d),this}get names(){const o=super.names;return ie(o,this.condition),this.else&&Z(o,this.else.names),o}}v.kind="if";class C extends T{}C.kind="for";class N extends C{constructor(o){super(),this.iteration=o}render(o){return`for(${this.iteration})`+super.render(o)}optimizeNames(o,d){if(!!super.optimizeNames(o,d))return this.iteration=x(this.iteration,o,d),this}get names(){return Z(super.names,this.iteration.names)}}class j extends C{constructor(o,d,R,F){super(),this.varKind=o,this.name=d,this.from=R,this.to=F}render(o){const d=o.es5?r.varKinds.var:this.varKind,{name:R,from:F,to:M}=this;return`for(${d} ${R}=${F}; ${R}<${M}; ${R}++)`+super.render(o)}get names(){const o=ie(super.names,this.from);return ie(o,this.to)}}class K extends C{constructor(o,d,R,F){super(),this.loop=o,this.varKind=d,this.name=R,this.iterable=F}render(o){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(o)}optimizeNames(o,d){if(!!super.optimizeNames(o,d))return this.iterable=x(this.iterable,o,d),this}get names(){return Z(super.names,this.iterable.names)}}class _ extends T{constructor(o,d,R){super(),this.name=o,this.args=d,this.async=R}render(o){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(o)}}_.kind="func";class P extends I{render(o){return"return "+super.render(o)}}P.kind="return";class D extends T{render(o){let d="try"+super.render(o);return this.catch&&(d+=this.catch.render(o)),this.finally&&(d+=this.finally.render(o)),d}optimizeNodes(){var o,d;return super.optimizeNodes(),(o=this.catch)===null||o===void 0||o.optimizeNodes(),(d=this.finally)===null||d===void 0||d.optimizeNodes(),this}optimizeNames(o,d){var R,F;return super.optimizeNames(o,d),(R=this.catch)===null||R===void 0||R.optimizeNames(o,d),(F=this.finally)===null||F===void 0||F.optimizeNames(o,d),this}get names(){const o=super.names;return this.catch&&Z(o,this.catch.names),this.finally&&Z(o,this.finally.names),o}}class H extends T{constructor(o){super(),this.error=o}render(o){return`catch(${this.error})`+super.render(o)}}H.kind="catch";class W extends T{render(o){return"finally"+super.render(o)}}W.kind="finally";class pe{constructor(o,d={}){this._values={},this._blockStarts=[],this._constants={},this.opts=le(Y({},d),{_n:d.lines?`
|
|
2
|
+
`:""}),this._extScope=o,this._scope=new r.Scope({parent:o}),this._nodes=[new A]}toString(){return this._root.render(this.opts)}name(o){return this._scope.name(o)}scopeName(o){return this._extScope.name(o)}scopeValue(o,d){const R=this._extScope.value(o,d);return(this._values[R.prefix]||(this._values[R.prefix]=new Set)).add(R),R}getScopeValue(o,d){return this._extScope.getValue(o,d)}scopeRefs(o){return this._extScope.scopeRefs(o,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(o,d,R,F){const M=this._scope.toName(d);return R!==void 0&&F&&(this._constants[M.str]=R),this._leafNode(new c(o,M,R)),M}const(o,d,R){return this._def(r.varKinds.const,o,d,R)}let(o,d,R){return this._def(r.varKinds.let,o,d,R)}var(o,d,R){return this._def(r.varKinds.var,o,d,R)}assign(o,d,R){return this._leafNode(new h(o,d,R))}add(o,d){return this._leafNode(new g(o,e.operators.ADD,d))}code(o){return typeof o=="function"?o():o!==t.nil&&this._leafNode(new b(o)),this}object(...o){const d=["{"];for(const[R,F]of o)d.length>1&&d.push(","),d.push(R),(R!==F||this.opts.es5)&&(d.push(":"),(0,t.addCodeArg)(d,F));return d.push("}"),new t._Code(d)}if(o,d,R){if(this._blockNode(new v(o)),d&&R)this.code(d).else().code(R).endIf();else if(d)this.code(d).endIf();else if(R)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(o){return this._elseNode(new v(o))}else(){return this._elseNode(new w)}endIf(){return this._endBlockNode(v,w)}_for(o,d){return this._blockNode(o),d&&this.code(d).endFor(),this}for(o,d){return this._for(new N(o),d)}forRange(o,d,R,F,M=this.opts.es5?r.varKinds.var:r.varKinds.let){const ee=this._scope.toName(o);return this._for(new j(M,ee,d,R),()=>F(ee))}forOf(o,d,R,F=r.varKinds.const){const M=this._scope.toName(o);if(this.opts.es5){const ee=d instanceof t.Name?d:this.var("_arr",d);return this.forRange("_i",0,(0,t._)`${ee}.length`,se=>{this.var(M,(0,t._)`${ee}[${se}]`),R(M)})}return this._for(new K("of",F,M,d),()=>R(M))}forIn(o,d,R,F=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(o,(0,t._)`Object.keys(${d})`,R);const M=this._scope.toName(o);return this._for(new K("in",F,M,d),()=>R(M))}endFor(){return this._endBlockNode(C)}label(o){return this._leafNode(new p(o))}break(o){return this._leafNode(new u(o))}return(o){const d=new P;if(this._blockNode(d),this.code(o),d.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(P)}try(o,d,R){if(!d&&!R)throw new Error('CodeGen: "try" without "catch" and "finally"');const F=new D;if(this._blockNode(F),this.code(o),d){const M=this.name("e");this._currNode=F.catch=new H(M),d(M)}return R&&(this._currNode=F.finally=new W,this.code(R)),this._endBlockNode(H,W)}throw(o){return this._leafNode(new m(o))}block(o,d){return this._blockStarts.push(this._nodes.length),o&&this.code(o).endBlock(d),this}endBlock(o){const d=this._blockStarts.pop();if(d===void 0)throw new Error("CodeGen: not in self-balancing block");const R=this._nodes.length-d;if(R<0||o!==void 0&&R!==o)throw new Error(`CodeGen: wrong number of nodes: ${R} vs ${o} expected`);return this._nodes.length=d,this}func(o,d=t.nil,R,F){return this._blockNode(new _(o,d,R)),F&&this.code(F).endFunc(),this}endFunc(){return this._endBlockNode(_)}optimize(o=1){for(;o-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(o){return this._currNode.nodes.push(o),this}_blockNode(o){this._currNode.nodes.push(o),this._nodes.push(o)}_endBlockNode(o,d){const R=this._currNode;if(R instanceof o||d&&R instanceof d)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${d?`${o.kind}/${d.kind}`:o.kind}"`)}_elseNode(o){const d=this._currNode;if(!(d instanceof v))throw new Error('CodeGen: "else" without "if"');return this._currNode=d.else=o,this}get _root(){return this._nodes[0]}get _currNode(){const o=this._nodes;return o[o.length-1]}set _currNode(o){const d=this._nodes;d[d.length-1]=o}}e.CodeGen=pe;function Z($,o){for(const d in o)$[d]=($[d]||0)+(o[d]||0);return $}function ie($,o){return o instanceof t._CodeOrName?Z($,o.names):$}function x($,o,d){if($ instanceof t.Name)return R($);if(!F($))return $;return new t._Code($._items.reduce((M,ee)=>(ee instanceof t.Name&&(ee=R(ee)),ee instanceof t._Code?M.push(...ee._items):M.push(ee),M),[]));function R(M){const ee=d[M.str];return ee===void 0||o[M.str]!==1?M:(delete o[M.str],ee)}function F(M){return M instanceof t._Code&&M._items.some(ee=>ee instanceof t.Name&&o[ee.str]===1&&d[ee.str]!==void 0)}}function ve($,o){for(const d in o)$[d]=($[d]||0)-(o[d]||0)}function $e($){return typeof $=="boolean"||typeof $=="number"||$===null?!$:(0,t._)`!${O($)}`}e.not=$e;const Ce=y(e.operators.AND);function Me(...$){return $.reduce(Ce)}e.and=Me;const Wt=y(e.operators.OR);function k(...$){return $.reduce(Wt)}e.or=k;function y($){return(o,d)=>o===t.nil?d:d===t.nil?o:(0,t._)`${O(o)} ${$} ${O(d)}`}function O($){return $ instanceof t.Name?$:(0,t._)`(${$})`}}(ue);var Pe={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.checkStrictMode=e.getErrorPath=e.Type=e.useFunc=e.setEvaluated=e.evaluatedPropsToName=e.mergeEvaluated=e.eachItem=e.unescapeJsonPointer=e.escapeJsonPointer=e.escapeFragment=e.unescapeFragment=e.schemaRefOrVal=e.schemaHasRulesButRef=e.schemaHasRules=e.checkUnknownRules=e.alwaysValidSchema=e.toHash=void 0;const t=ue,r=ar;function n(_){const P={};for(const D of _)P[D]=!0;return P}e.toHash=n;function s(_,P){return typeof P=="boolean"?P:Object.keys(P).length===0?!0:(a(_,P),!c(P,_.self.RULES.all))}e.alwaysValidSchema=s;function a(_,P=_.schema){const{opts:D,self:H}=_;if(!D.strictSchema||typeof P=="boolean")return;const W=H.RULES.keywords;for(const pe in P)W[pe]||K(_,`unknown keyword: "${pe}"`)}e.checkUnknownRules=a;function c(_,P){if(typeof _=="boolean")return!_;for(const D in _)if(P[D])return!0;return!1}e.schemaHasRules=c;function h(_,P){if(typeof _=="boolean")return!_;for(const D in _)if(D!=="$ref"&&P.all[D])return!0;return!1}e.schemaHasRulesButRef=h;function g({topSchemaRef:_,schemaPath:P},D,H,W){if(!W){if(typeof D=="number"||typeof D=="boolean")return D;if(typeof D=="string")return(0,t._)`${D}`}return(0,t._)`${_}${P}${(0,t.getProperty)(H)}`}e.schemaRefOrVal=g;function p(_){return b(decodeURIComponent(_))}e.unescapeFragment=p;function u(_){return encodeURIComponent(m(_))}e.escapeFragment=u;function m(_){return typeof _=="number"?`${_}`:_.replace(/~/g,"~0").replace(/\//g,"~1")}e.escapeJsonPointer=m;function b(_){return _.replace(/~1/g,"/").replace(/~0/g,"~")}e.unescapeJsonPointer=b;function I(_,P){if(Array.isArray(_))for(const D of _)P(D);else P(_)}e.eachItem=I;function T({mergeNames:_,mergeToName:P,mergeValues:D,resultToName:H}){return(W,pe,Z,ie)=>{const x=Z===void 0?pe:Z instanceof t.Name?(pe instanceof t.Name?_(W,pe,Z):P(W,pe,Z),Z):pe instanceof t.Name?(P(W,Z,pe),pe):D(pe,Z);return ie===t.Name&&!(x instanceof t.Name)?H(W,x):x}}e.mergeEvaluated={props:T({mergeNames:(_,P,D)=>_.if((0,t._)`${D} !== true && ${P} !== undefined`,()=>{_.if((0,t._)`${P} === true`,()=>_.assign(D,!0),()=>_.assign(D,(0,t._)`${D} || {}`).code((0,t._)`Object.assign(${D}, ${P})`))}),mergeToName:(_,P,D)=>_.if((0,t._)`${D} !== true`,()=>{P===!0?_.assign(D,!0):(_.assign(D,(0,t._)`${D} || {}`),w(_,D,P))}),mergeValues:(_,P)=>_===!0?!0:Y(Y({},_),P),resultToName:A}),items:T({mergeNames:(_,P,D)=>_.if((0,t._)`${D} !== true && ${P} !== undefined`,()=>_.assign(D,(0,t._)`${P} === true ? true : ${D} > ${P} ? ${D} : ${P}`)),mergeToName:(_,P,D)=>_.if((0,t._)`${D} !== true`,()=>_.assign(D,P===!0?!0:(0,t._)`${D} > ${P} ? ${D} : ${P}`)),mergeValues:(_,P)=>_===!0?!0:Math.max(_,P),resultToName:(_,P)=>_.var("items",P)})};function A(_,P){if(P===!0)return _.var("props",!0);const D=_.var("props",(0,t._)`{}`);return P!==void 0&&w(_,D,P),D}e.evaluatedPropsToName=A;function w(_,P,D){Object.keys(D).forEach(H=>_.assign((0,t._)`${P}${(0,t.getProperty)(H)}`,!0))}e.setEvaluated=w;const v={};function C(_,P){return _.scopeValue("func",{ref:P,code:v[P.code]||(v[P.code]=new r._Code(P.code))})}e.useFunc=C;var N;(function(_){_[_.Num=0]="Num",_[_.Str=1]="Str"})(N=e.Type||(e.Type={}));function j(_,P,D){if(_ instanceof t.Name){const H=P===N.Num;return D?H?(0,t._)`"[" + ${_} + "]"`:(0,t._)`"['" + ${_} + "']"`:H?(0,t._)`"/" + ${_}`:(0,t._)`"/" + ${_}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return D?(0,t.getProperty)(_).toString():"/"+m(_)}e.getErrorPath=j;function K(_,P,D=_.opts.strictSchema){if(!!D){if(P=`strict mode: ${P}`,D===!0)throw new Error(P);_.self.logger.warn(P)}}e.checkStrictMode=K})(Pe);var Ae={};Object.defineProperty(Ae,"__esModule",{value:!0});const Re=ue,Ja={data:new Re.Name("data"),valCxt:new Re.Name("valCxt"),instancePath:new Re.Name("instancePath"),parentData:new Re.Name("parentData"),parentDataProperty:new Re.Name("parentDataProperty"),rootData:new Re.Name("rootData"),dynamicAnchors:new Re.Name("dynamicAnchors"),vErrors:new Re.Name("vErrors"),errors:new Re.Name("errors"),this:new Re.Name("this"),self:new Re.Name("self"),scope:new Re.Name("scope"),json:new Re.Name("json"),jsonPos:new Re.Name("jsonPos"),jsonLen:new Re.Name("jsonLen"),jsonPart:new Re.Name("jsonPart")};Ae.default=Ja,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=ue,r=Pe,n=Ae;e.keywordError={message:({keyword:w})=>(0,t.str)`must pass "${w}" keyword validation`},e.keyword$DataError={message:({keyword:w,schemaType:v})=>v?(0,t.str)`"${w}" keyword must be ${v} ($data)`:(0,t.str)`"${w}" keyword is invalid ($data)`};function s(w,v=e.keywordError,C,N){const{it:j}=w,{gen:K,compositeRule:_,allErrors:P}=j,D=m(w,v,C);(N!=null?N:_||P)?g(K,D):p(j,(0,t._)`[${D}]`)}e.reportError=s;function a(w,v=e.keywordError,C){const{it:N}=w,{gen:j,compositeRule:K,allErrors:_}=N,P=m(w,v,C);g(j,P),K||_||p(N,n.default.vErrors)}e.reportExtraError=a;function c(w,v){w.assign(n.default.errors,v),w.if((0,t._)`${n.default.vErrors} !== null`,()=>w.if(v,()=>w.assign((0,t._)`${n.default.vErrors}.length`,v),()=>w.assign(n.default.vErrors,null)))}e.resetErrorsCount=c;function h({gen:w,keyword:v,schemaValue:C,data:N,errsCount:j,it:K}){if(j===void 0)throw new Error("ajv implementation error");const _=w.name("err");w.forRange("i",j,n.default.errors,P=>{w.const(_,(0,t._)`${n.default.vErrors}[${P}]`),w.if((0,t._)`${_}.instancePath === undefined`,()=>w.assign((0,t._)`${_}.instancePath`,(0,t.strConcat)(n.default.instancePath,K.errorPath))),w.assign((0,t._)`${_}.schemaPath`,(0,t.str)`${K.errSchemaPath}/${v}`),K.opts.verbose&&(w.assign((0,t._)`${_}.schema`,C),w.assign((0,t._)`${_}.data`,N))})}e.extendErrors=h;function g(w,v){const C=w.const("err",v);w.if((0,t._)`${n.default.vErrors} === null`,()=>w.assign(n.default.vErrors,(0,t._)`[${C}]`),(0,t._)`${n.default.vErrors}.push(${C})`),w.code((0,t._)`${n.default.errors}++`)}function p(w,v){const{gen:C,validateName:N,schemaEnv:j}=w;j.$async?C.throw((0,t._)`new ${w.ValidationError}(${v})`):(C.assign((0,t._)`${N}.errors`,v),C.return(!1))}const u={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 m(w,v,C){const{createErrors:N}=w.it;return N===!1?(0,t._)`{}`:b(w,v,C)}function b(w,v,C={}){const{gen:N,it:j}=w,K=[I(j,C),T(w,C)];return A(w,v,K),N.object(...K)}function I({errorPath:w},{instancePath:v}){const C=v?(0,t.str)`${w}${(0,r.getErrorPath)(v,r.Type.Str)}`:w;return[n.default.instancePath,(0,t.strConcat)(n.default.instancePath,C)]}function T({keyword:w,it:{errSchemaPath:v}},{schemaPath:C,parentSchema:N}){let j=N?v:(0,t.str)`${v}/${w}`;return C&&(j=(0,t.str)`${j}${(0,r.getErrorPath)(C,r.Type.Str)}`),[u.schemaPath,j]}function A(w,{params:v,message:C},N){const{keyword:j,data:K,schemaValue:_,it:P}=w,{opts:D,propertyName:H,topSchemaRef:W,schemaPath:pe}=P;N.push([u.keyword,j],[u.params,typeof v=="function"?v(w):v||(0,t._)`{}`]),D.messages&&N.push([u.message,typeof C=="function"?C(w):C]),D.verbose&&N.push([u.schema,_],[u.parentSchema,(0,t._)`${W}${pe}`],[n.default.data,K]),H&&N.push([u.propertyName,H])}}(sr),Object.defineProperty(Lt,"__esModule",{value:!0}),Lt.boolOrEmptySchema=Lt.topBoolOrEmptySchema=void 0;const Ga=sr,qa=ue,Ba=Ae,Qa={message:"boolean schema is false"};function Wa(e){const{gen:t,schema:r,validateName:n}=e;r===!1?Qn(e,!1):typeof r=="object"&&r.$async===!0?t.return(Ba.default.data):(t.assign((0,qa._)`${n}.errors`,null),t.return(!0))}Lt.topBoolOrEmptySchema=Wa;function Ya(e,t){const{gen:r,schema:n}=e;n===!1?(r.var(t,!1),Qn(e)):r.var(t,!0)}Lt.boolOrEmptySchema=Ya;function Qn(e,t){const{gen:r,data:n}=e,s={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,Ga.reportError)(s,Qa,void 0,t)}var Fr={},bt={};Object.defineProperty(bt,"__esModule",{value:!0}),bt.getRules=bt.isJSONType=void 0;const Xa=["string","number","integer","boolean","null","object","array"],Za=new Set(Xa);function xa(e){return typeof e=="string"&&Za.has(e)}bt.isJSONType=xa;function eo(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:le(Y({},e),{integer:!0,boolean:!0,null:!0}),rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}bt.getRules=eo;var et={};Object.defineProperty(et,"__esModule",{value:!0}),et.shouldUseRule=et.shouldUseGroup=et.schemaHasRulesForType=void 0;function to({schema:e,self:t},r){const n=t.RULES.types[r];return n&&n!==!0&&Wn(e,n)}et.schemaHasRulesForType=to;function Wn(e,t){return t.rules.some(r=>Yn(e,r))}et.shouldUseGroup=Wn;function Yn(e,t){var r;return e[t.keyword]!==void 0||((r=t.definition.implements)===null||r===void 0?void 0:r.some(n=>e[n]!==void 0))}et.shouldUseRule=Yn,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.reportTypeError=e.checkDataTypes=e.checkDataType=e.coerceAndCheckDataType=e.getJSONTypes=e.getSchemaTypes=e.DataType=void 0;const t=bt,r=et,n=sr,s=ue,a=Pe;var c;(function(N){N[N.Correct=0]="Correct",N[N.Wrong=1]="Wrong"})(c=e.DataType||(e.DataType={}));function h(N){const j=g(N.type);if(j.includes("null")){if(N.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!j.length&&N.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');N.nullable===!0&&j.push("null")}return j}e.getSchemaTypes=h;function g(N){const j=Array.isArray(N)?N:N?[N]:[];if(j.every(t.isJSONType))return j;throw new Error("type must be JSONType or JSONType[]: "+j.join(","))}e.getJSONTypes=g;function p(N,j){const{gen:K,data:_,opts:P}=N,D=m(j,P.coerceTypes),H=j.length>0&&!(D.length===0&&j.length===1&&(0,r.schemaHasRulesForType)(N,j[0]));if(H){const W=A(j,_,P.strictNumbers,c.Wrong);K.if(W,()=>{D.length?b(N,j,D):v(N)})}return H}e.coerceAndCheckDataType=p;const u=new Set(["string","number","integer","boolean","null"]);function m(N,j){return j?N.filter(K=>u.has(K)||j==="array"&&K==="array"):[]}function b(N,j,K){const{gen:_,data:P,opts:D}=N,H=_.let("dataType",(0,s._)`typeof ${P}`),W=_.let("coerced",(0,s._)`undefined`);D.coerceTypes==="array"&&_.if((0,s._)`${H} == 'object' && Array.isArray(${P}) && ${P}.length == 1`,()=>_.assign(P,(0,s._)`${P}[0]`).assign(H,(0,s._)`typeof ${P}`).if(A(j,P,D.strictNumbers),()=>_.assign(W,P))),_.if((0,s._)`${W} !== undefined`);for(const Z of K)(u.has(Z)||Z==="array"&&D.coerceTypes==="array")&&pe(Z);_.else(),v(N),_.endIf(),_.if((0,s._)`${W} !== undefined`,()=>{_.assign(P,W),I(N,W)});function pe(Z){switch(Z){case"string":_.elseIf((0,s._)`${H} == "number" || ${H} == "boolean"`).assign(W,(0,s._)`"" + ${P}`).elseIf((0,s._)`${P} === null`).assign(W,(0,s._)`""`);return;case"number":_.elseIf((0,s._)`${H} == "boolean" || ${P} === null
|
|
3
|
+
|| (${H} == "string" && ${P} && ${P} == +${P})`).assign(W,(0,s._)`+${P}`);return;case"integer":_.elseIf((0,s._)`${H} === "boolean" || ${P} === null
|
|
4
|
+
|| (${H} === "string" && ${P} && ${P} == +${P} && !(${P} % 1))`).assign(W,(0,s._)`+${P}`);return;case"boolean":_.elseIf((0,s._)`${P} === "false" || ${P} === 0 || ${P} === null`).assign(W,!1).elseIf((0,s._)`${P} === "true" || ${P} === 1`).assign(W,!0);return;case"null":_.elseIf((0,s._)`${P} === "" || ${P} === 0 || ${P} === false`),_.assign(W,null);return;case"array":_.elseIf((0,s._)`${H} === "string" || ${H} === "number"
|
|
5
|
+
|| ${H} === "boolean" || ${P} === null`).assign(W,(0,s._)`[${P}]`)}}}function I({gen:N,parentData:j,parentDataProperty:K},_){N.if((0,s._)`${j} !== undefined`,()=>N.assign((0,s._)`${j}[${K}]`,_))}function T(N,j,K,_=c.Correct){const P=_===c.Correct?s.operators.EQ:s.operators.NEQ;let D;switch(N){case"null":return(0,s._)`${j} ${P} null`;case"array":D=(0,s._)`Array.isArray(${j})`;break;case"object":D=(0,s._)`${j} && typeof ${j} == "object" && !Array.isArray(${j})`;break;case"integer":D=H((0,s._)`!(${j} % 1) && !isNaN(${j})`);break;case"number":D=H();break;default:return(0,s._)`typeof ${j} ${P} ${N}`}return _===c.Correct?D:(0,s.not)(D);function H(W=s.nil){return(0,s.and)((0,s._)`typeof ${j} == "number"`,W,K?(0,s._)`isFinite(${j})`:s.nil)}}e.checkDataType=T;function A(N,j,K,_){if(N.length===1)return T(N[0],j,K,_);let P;const D=(0,a.toHash)(N);if(D.array&&D.object){const H=(0,s._)`typeof ${j} != "object"`;P=D.null?H:(0,s._)`!${j} || ${H}`,delete D.null,delete D.array,delete D.object}else P=s.nil;D.number&&delete D.integer;for(const H in D)P=(0,s.and)(P,T(H,j,K,_));return P}e.checkDataTypes=A;const w={message:({schema:N})=>`must be ${N}`,params:({schema:N,schemaValue:j})=>typeof N=="string"?(0,s._)`{type: ${N}}`:(0,s._)`{type: ${j}}`};function v(N){const j=C(N);(0,n.reportError)(j,w)}e.reportTypeError=v;function C(N){const{gen:j,data:K,schema:_}=N,P=(0,a.schemaRefOrVal)(N,_,"type");return{gen:j,keyword:"type",data:K,schema:_.type,schemaCode:P,schemaValue:P,parentSchema:_,params:{},it:N}}}(Fr);var Mr={};Object.defineProperty(Mr,"__esModule",{value:!0}),Mr.assignDefaults=void 0;const Kt=ue,ro=Pe;function no(e,t){const{properties:r,items:n}=e.schema;if(t==="object"&&r)for(const s in r)Xn(e,s,r[s].default);else t==="array"&&Array.isArray(n)&&n.forEach((s,a)=>Xn(e,a,s.default))}Mr.assignDefaults=no;function Xn(e,t,r){const{gen:n,compositeRule:s,data:a,opts:c}=e;if(r===void 0)return;const h=(0,Kt._)`${a}${(0,Kt.getProperty)(t)}`;if(s){(0,ro.checkStrictMode)(e,`default is ignored for: ${h}`);return}let g=(0,Kt._)`${h} === undefined`;c.useDefaults==="empty"&&(g=(0,Kt._)`${g} || ${h} === null || ${h} === ""`),n.if(g,(0,Kt._)`${h} = ${(0,Kt.stringify)(r)}`)}var Je={},ae={};Object.defineProperty(ae,"__esModule",{value:!0}),ae.validateUnion=ae.validateArray=ae.usePattern=ae.callValidateCode=ae.schemaProperties=ae.allSchemaProperties=ae.noPropertyInData=ae.propertyInData=ae.isOwnProperty=ae.hasPropFunc=ae.reportMissingProp=ae.checkMissingProp=ae.checkReportMissingProp=void 0;const fe=ue,un=Pe,lt=Ae,so=Pe;function ao(e,t){const{gen:r,data:n,it:s}=e;r.if(dn(r,n,t,s.opts.ownProperties),()=>{e.setParams({missingProperty:(0,fe._)`${t}`},!0),e.error()})}ae.checkReportMissingProp=ao;function oo({gen:e,data:t,it:{opts:r}},n,s){return(0,fe.or)(...n.map(a=>(0,fe.and)(dn(e,t,a,r.ownProperties),(0,fe._)`${s} = ${a}`)))}ae.checkMissingProp=oo;function io(e,t){e.setParams({missingProperty:t},!0),e.error()}ae.reportMissingProp=io;function Zn(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,fe._)`Object.prototype.hasOwnProperty`})}ae.hasPropFunc=Zn;function ln(e,t,r){return(0,fe._)`${Zn(e)}.call(${t}, ${r})`}ae.isOwnProperty=ln;function co(e,t,r,n){const s=(0,fe._)`${t}${(0,fe.getProperty)(r)} !== undefined`;return n?(0,fe._)`${s} && ${ln(e,t,r)}`:s}ae.propertyInData=co;function dn(e,t,r,n){const s=(0,fe._)`${t}${(0,fe.getProperty)(r)} === undefined`;return n?(0,fe.or)(s,(0,fe.not)(ln(e,t,r))):s}ae.noPropertyInData=dn;function xn(e){return e?Object.keys(e).filter(t=>t!=="__proto__"):[]}ae.allSchemaProperties=xn;function uo(e,t){return xn(t).filter(r=>!(0,un.alwaysValidSchema)(e,t[r]))}ae.schemaProperties=uo;function lo({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:s,errorPath:a},it:c},h,g,p){const u=p?(0,fe._)`${e}, ${t}, ${n}${s}`:t,m=[[lt.default.instancePath,(0,fe.strConcat)(lt.default.instancePath,a)],[lt.default.parentData,c.parentData],[lt.default.parentDataProperty,c.parentDataProperty],[lt.default.rootData,lt.default.rootData]];c.opts.dynamicRef&&m.push([lt.default.dynamicAnchors,lt.default.dynamicAnchors]);const b=(0,fe._)`${u}, ${r.object(...m)}`;return g!==fe.nil?(0,fe._)`${h}.call(${g}, ${b})`:(0,fe._)`${h}(${b})`}ae.callValidateCode=lo;const fo=(0,fe._)`new RegExp`;function ho({gen:e,it:{opts:t}},r){const n=t.unicodeRegExp?"u":"",{regExp:s}=t.code,a=s(r,n);return e.scopeValue("pattern",{key:a.toString(),ref:a,code:(0,fe._)`${s.code==="new RegExp"?fo:(0,so.useFunc)(e,s)}(${r}, ${n})`})}ae.usePattern=ho;function po(e){const{gen:t,data:r,keyword:n,it:s}=e,a=t.name("valid");if(s.allErrors){const h=t.let("valid",!0);return c(()=>t.assign(h,!1)),h}return t.var(a,!0),c(()=>t.break()),a;function c(h){const g=t.const("len",(0,fe._)`${r}.length`);t.forRange("i",0,g,p=>{e.subschema({keyword:n,dataProp:p,dataPropType:un.Type.Num},a),t.if((0,fe.not)(a),h)})}}ae.validateArray=po;function mo(e){const{gen:t,schema:r,keyword:n,it:s}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(g=>(0,un.alwaysValidSchema)(s,g))&&!s.opts.unevaluated)return;const c=t.let("valid",!1),h=t.name("_valid");t.block(()=>r.forEach((g,p)=>{const u=e.subschema({keyword:n,schemaProp:p,compositeRule:!0},h);t.assign(c,(0,fe._)`${c} || ${h}`),e.mergeValidEvaluated(u,h)||t.if((0,fe.not)(c))})),e.result(c,()=>e.reset(),()=>e.error(!0))}ae.validateUnion=mo,Object.defineProperty(Je,"__esModule",{value:!0}),Je.validateKeywordUsage=Je.validSchemaType=Je.funcKeywordCode=Je.macroKeywordCode=void 0;const je=ue,Pt=Ae,go=ae,vo=sr;function yo(e,t){const{gen:r,keyword:n,schema:s,parentSchema:a,it:c}=e,h=t.macro.call(c.self,s,a,c),g=ts(r,n,h);c.opts.validateSchema!==!1&&c.self.validateSchema(h,!0);const p=r.name("valid");e.subschema({schema:h,schemaPath:je.nil,errSchemaPath:`${c.errSchemaPath}/${n}`,topSchemaRef:g,compositeRule:!0},p),e.pass(p,()=>e.error(!0))}Je.macroKeywordCode=yo;function _o(e,t){var r;const{gen:n,keyword:s,schema:a,parentSchema:c,$data:h,it:g}=e;Eo(g,t);const p=!h&&t.compile?t.compile.call(g.self,a,c,g):t.validate,u=ts(n,s,p),m=n.let("valid");e.block$data(m,b),e.ok((r=t.valid)!==null&&r!==void 0?r:m);function b(){if(t.errors===!1)A(),t.modifying&&es(e),w(()=>e.error());else{const v=t.async?I():T();t.modifying&&es(e),w(()=>$o(e,v))}}function I(){const v=n.let("ruleErrs",null);return n.try(()=>A((0,je._)`await `),C=>n.assign(m,!1).if((0,je._)`${C} instanceof ${g.ValidationError}`,()=>n.assign(v,(0,je._)`${C}.errors`),()=>n.throw(C))),v}function T(){const v=(0,je._)`${u}.errors`;return n.assign(v,null),A(je.nil),v}function A(v=t.async?(0,je._)`await `:je.nil){const C=g.opts.passContext?Pt.default.this:Pt.default.self,N=!("compile"in t&&!h||t.schema===!1);n.assign(m,(0,je._)`${v}${(0,go.callValidateCode)(e,u,C,N)}`,t.modifying)}function w(v){var C;n.if((0,je.not)((C=t.valid)!==null&&C!==void 0?C:m),v)}}Je.funcKeywordCode=_o;function es(e){const{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,(0,je._)`${n.parentData}[${n.parentDataProperty}]`))}function $o(e,t){const{gen:r}=e;r.if((0,je._)`Array.isArray(${t})`,()=>{r.assign(Pt.default.vErrors,(0,je._)`${Pt.default.vErrors} === null ? ${t} : ${Pt.default.vErrors}.concat(${t})`).assign(Pt.default.errors,(0,je._)`${Pt.default.vErrors}.length`),(0,vo.extendErrors)(e)},()=>e.error())}function Eo({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}function ts(e,t,r){if(r===void 0)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,je.stringify)(r)})}function wo(e,t,r=!1){return!t.length||t.some(n=>n==="array"?Array.isArray(e):n==="object"?e&&typeof e=="object"&&!Array.isArray(e):typeof e==n||r&&typeof e=="undefined")}Je.validSchemaType=wo;function So({schema:e,opts:t,self:r,errSchemaPath:n},s,a){if(Array.isArray(s.keyword)?!s.keyword.includes(a):s.keyword!==a)throw new Error("ajv implementation error");const c=s.dependencies;if(c!=null&&c.some(h=>!Object.prototype.hasOwnProperty.call(e,h)))throw new Error(`parent schema must have dependencies of ${a}: ${c.join(",")}`);if(s.validateSchema&&!s.validateSchema(e[a])){const g=`keyword "${a}" value is invalid at path "${n}": `+r.errorsText(s.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(g);else throw new Error(g)}}Je.validateKeywordUsage=So;var dt={};Object.defineProperty(dt,"__esModule",{value:!0}),dt.extendSubschemaMode=dt.extendSubschemaData=dt.getSubschema=void 0;const Ge=ue,rs=Pe;function bo(e,{keyword:t,schemaProp:r,schema:n,schemaPath:s,errSchemaPath:a,topSchemaRef:c}){if(t!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){const h=e.schema[t];return r===void 0?{schema:h,schemaPath:(0,Ge._)`${e.schemaPath}${(0,Ge.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:h[r],schemaPath:(0,Ge._)`${e.schemaPath}${(0,Ge.getProperty)(t)}${(0,Ge.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,rs.escapeFragment)(r)}`}}if(n!==void 0){if(s===void 0||a===void 0||c===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:s,topSchemaRef:c,errSchemaPath:a}}throw new Error('either "keyword" or "schema" must be passed')}dt.getSubschema=bo;function Po(e,t,{dataProp:r,dataPropType:n,data:s,dataTypes:a,propertyName:c}){if(s!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:h}=t;if(r!==void 0){const{errorPath:p,dataPathArr:u,opts:m}=t,b=h.let("data",(0,Ge._)`${t.data}${(0,Ge.getProperty)(r)}`,!0);g(b),e.errorPath=(0,Ge.str)`${p}${(0,rs.getErrorPath)(r,n,m.jsPropertySyntax)}`,e.parentDataProperty=(0,Ge._)`${r}`,e.dataPathArr=[...u,e.parentDataProperty]}if(s!==void 0){const p=s instanceof Ge.Name?s:h.let("data",s,!0);g(p),c!==void 0&&(e.propertyName=c)}a&&(e.dataTypes=a);function g(p){e.data=p,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,p]}}dt.extendSubschemaData=Po;function Co(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:s,allErrors:a}){n!==void 0&&(e.compositeRule=n),s!==void 0&&(e.createErrors=s),a!==void 0&&(e.allErrors=a),e.jtdDiscriminator=t,e.jtdMetadata=r}dt.extendSubschemaMode=Co;var Ne={},No=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,s,a;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(s=n;s--!==0;)if(!e(t[s],r[s]))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(a=Object.keys(t),n=a.length,n!==Object.keys(r).length)return!1;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(r,a[s]))return!1;for(s=n;s--!==0;){var c=a[s];if(!e(t[c],r[c]))return!1}return!0}return t!==t&&r!==r},ns={exports:{}},ft=ns.exports=function(e,t,r){typeof t=="function"&&(r=t,t={}),r=t.cb||r;var n=typeof r=="function"?r:r.pre||function(){},s=r.post||function(){};Ur(t,n,s,e,"",e)};ft.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},ft.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},ft.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},ft.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function Ur(e,t,r,n,s,a,c,h,g,p){if(n&&typeof n=="object"&&!Array.isArray(n)){t(n,s,a,c,h,g,p);for(var u in n){var m=n[u];if(Array.isArray(m)){if(u in ft.arrayKeywords)for(var b=0;b<m.length;b++)Ur(e,t,r,m[b],s+"/"+u+"/"+b,a,s,u,n,b)}else if(u in ft.propsKeywords){if(m&&typeof m=="object")for(var I in m)Ur(e,t,r,m[I],s+"/"+u+"/"+Ro(I),a,s,u,n,I)}else(u in ft.keywords||e.allKeys&&!(u in ft.skipKeywords))&&Ur(e,t,r,m,s+"/"+u,a,s,u,n)}r(n,s,a,c,h,g,p)}}function Ro(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}Object.defineProperty(Ne,"__esModule",{value:!0}),Ne.getSchemaRefs=Ne.resolveUrl=Ne.normalizeId=Ne._getFullPath=Ne.getFullPath=Ne.inlineRef=void 0;const Oo=Pe,jo=No,To=ns.exports,Do=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function Io(e,t=!0){return typeof e=="boolean"?!0:t===!0?!fn(e):t?ss(e)<=t:!1}Ne.inlineRef=Io;const Ao=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function fn(e){for(const t in e){if(Ao.has(t))return!0;const r=e[t];if(Array.isArray(r)&&r.some(fn)||typeof r=="object"&&fn(r))return!0}return!1}function ss(e){let t=0;for(const r in e){if(r==="$ref")return 1/0;if(t++,!Do.has(r)&&(typeof e[r]=="object"&&(0,Oo.eachItem)(e[r],n=>t+=ss(n)),t===1/0))return 1/0}return t}function as(e,t="",r){r!==!1&&(t=Ht(t));const n=e.parse(t);return os(e,n)}Ne.getFullPath=as;function os(e,t){return e.serialize(t).split("#")[0]+"#"}Ne._getFullPath=os;const ko=/#\/?$/;function Ht(e){return e?e.replace(ko,""):""}Ne.normalizeId=Ht;function Fo(e,t,r){return r=Ht(r),e.resolve(t,r)}Ne.resolveUrl=Fo;const Mo=/^[a-z_][-a-z0-9._]*$/i;function Uo(e,t){if(typeof e=="boolean")return{};const{schemaId:r,uriResolver:n}=this.opts,s=Ht(e[r]||t),a={"":s},c=as(n,s,!1),h={},g=new Set;return To(e,{allKeys:!0},(m,b,I,T)=>{if(T===void 0)return;const A=c+b;let w=a[T];typeof m[r]=="string"&&(w=v.call(this,m[r])),C.call(this,m.$anchor),C.call(this,m.$dynamicAnchor),a[b]=w;function v(N){const j=this.opts.uriResolver.resolve;if(N=Ht(w?j(w,N):N),g.has(N))throw u(N);g.add(N);let K=this.refs[N];return typeof K=="string"&&(K=this.refs[K]),typeof K=="object"?p(m,K.schema,N):N!==Ht(A)&&(N[0]==="#"?(p(m,h[N],N),h[N]=m):this.refs[N]=A),N}function C(N){if(typeof N=="string"){if(!Mo.test(N))throw new Error(`invalid anchor "${N}"`);v.call(this,`#${N}`)}}}),h;function p(m,b,I){if(b!==void 0&&!jo(m,b))throw u(I)}function u(m){return new Error(`reference "${m}" resolves to more than one schema`)}}Ne.getSchemaRefs=Uo,Object.defineProperty(He,"__esModule",{value:!0}),He.getData=He.KeywordCxt=He.validateFunctionCode=void 0;const is=Lt,cs=Fr,hn=et,Vr=Fr,Vo=Mr,or=Je,pn=dt,U=ue,G=Ae,zo=Ne,tt=Pe,ir=sr;function Lo(e){if(fs(e)&&(hs(e),ds(e))){Jo(e);return}us(e,()=>(0,is.topBoolOrEmptySchema)(e))}He.validateFunctionCode=Lo;function us({gen:e,validateName:t,schema:r,schemaEnv:n,opts:s},a){s.code.es5?e.func(t,(0,U._)`${G.default.data}, ${G.default.valCxt}`,n.$async,()=>{e.code((0,U._)`"use strict"; ${ls(r,s)}`),Ho(e,s),e.code(a)}):e.func(t,(0,U._)`${G.default.data}, ${Ko(s)}`,n.$async,()=>e.code(ls(r,s)).code(a))}function Ko(e){return(0,U._)`{${G.default.instancePath}="", ${G.default.parentData}, ${G.default.parentDataProperty}, ${G.default.rootData}=${G.default.data}${e.dynamicRef?(0,U._)`, ${G.default.dynamicAnchors}={}`:U.nil}}={}`}function Ho(e,t){e.if(G.default.valCxt,()=>{e.var(G.default.instancePath,(0,U._)`${G.default.valCxt}.${G.default.instancePath}`),e.var(G.default.parentData,(0,U._)`${G.default.valCxt}.${G.default.parentData}`),e.var(G.default.parentDataProperty,(0,U._)`${G.default.valCxt}.${G.default.parentDataProperty}`),e.var(G.default.rootData,(0,U._)`${G.default.valCxt}.${G.default.rootData}`),t.dynamicRef&&e.var(G.default.dynamicAnchors,(0,U._)`${G.default.valCxt}.${G.default.dynamicAnchors}`)},()=>{e.var(G.default.instancePath,(0,U._)`""`),e.var(G.default.parentData,(0,U._)`undefined`),e.var(G.default.parentDataProperty,(0,U._)`undefined`),e.var(G.default.rootData,G.default.data),t.dynamicRef&&e.var(G.default.dynamicAnchors,(0,U._)`{}`)})}function Jo(e){const{schema:t,opts:r,gen:n}=e;us(e,()=>{r.$comment&&t.$comment&&ms(e),Wo(e),n.let(G.default.vErrors,null),n.let(G.default.errors,0),r.unevaluated&&Go(e),ps(e),Zo(e)})}function Go(e){const{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,U._)`${r}.evaluated`),t.if((0,U._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,U._)`${e.evaluated}.props`,(0,U._)`undefined`)),t.if((0,U._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,U._)`${e.evaluated}.items`,(0,U._)`undefined`))}function ls(e,t){const r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,U._)`/*# sourceURL=${r} */`:U.nil}function qo(e,t){if(fs(e)&&(hs(e),ds(e))){Bo(e,t);return}(0,is.boolOrEmptySchema)(e,t)}function ds({schema:e,self:t}){if(typeof e=="boolean")return!e;for(const r in e)if(t.RULES.all[r])return!0;return!1}function fs(e){return typeof e.schema!="boolean"}function Bo(e,t){const{schema:r,gen:n,opts:s}=e;s.$comment&&r.$comment&&ms(e),Yo(e),Xo(e);const a=n.const("_errs",G.default.errors);ps(e,a),n.var(t,(0,U._)`${a} === ${G.default.errors}`)}function hs(e){(0,tt.checkUnknownRules)(e),Qo(e)}function ps(e,t){if(e.opts.jtd)return gs(e,[],!1,t);const r=(0,cs.getSchemaTypes)(e.schema),n=(0,cs.coerceAndCheckDataType)(e,r);gs(e,r,!n,t)}function Qo(e){const{schema:t,errSchemaPath:r,opts:n,self:s}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,tt.schemaHasRulesButRef)(t,s.RULES)&&s.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function Wo(e){const{schema:t,opts:r}=e;t.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,tt.checkStrictMode)(e,"default is ignored in the schema root")}function Yo(e){const t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,zo.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function Xo(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}function ms({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:s}){const a=r.$comment;if(s.$comment===!0)e.code((0,U._)`${G.default.self}.logger.log(${a})`);else if(typeof s.$comment=="function"){const c=(0,U.str)`${n}/$comment`,h=e.scopeValue("root",{ref:t.root});e.code((0,U._)`${G.default.self}.opts.$comment(${a}, ${c}, ${h}.schema)`)}}function Zo(e){const{gen:t,schemaEnv:r,validateName:n,ValidationError:s,opts:a}=e;r.$async?t.if((0,U._)`${G.default.errors} === 0`,()=>t.return(G.default.data),()=>t.throw((0,U._)`new ${s}(${G.default.vErrors})`)):(t.assign((0,U._)`${n}.errors`,G.default.vErrors),a.unevaluated&&xo(e),t.return((0,U._)`${G.default.errors} === 0`))}function xo({gen:e,evaluated:t,props:r,items:n}){r instanceof U.Name&&e.assign((0,U._)`${t}.props`,r),n instanceof U.Name&&e.assign((0,U._)`${t}.items`,n)}function gs(e,t,r,n){const{gen:s,schema:a,data:c,allErrors:h,opts:g,self:p}=e,{RULES:u}=p;if(a.$ref&&(g.ignoreKeywordsWithRef||!(0,tt.schemaHasRulesButRef)(a,u))){s.block(()=>$s(e,"$ref",u.all.$ref.definition));return}g.jtd||ei(e,t),s.block(()=>{for(const b of u.rules)m(b);m(u.post)});function m(b){!(0,hn.shouldUseGroup)(a,b)||(b.type?(s.if((0,Vr.checkDataType)(b.type,c,g.strictNumbers)),vs(e,b),t.length===1&&t[0]===b.type&&r&&(s.else(),(0,Vr.reportTypeError)(e)),s.endIf()):vs(e,b),h||s.if((0,U._)`${G.default.errors} === ${n||0}`))}}function vs(e,t){const{gen:r,schema:n,opts:{useDefaults:s}}=e;s&&(0,Vo.assignDefaults)(e,t.type),r.block(()=>{for(const a of t.rules)(0,hn.shouldUseRule)(n,a)&&$s(e,a.keyword,a.definition,t.type)})}function ei(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(ti(e,t),e.opts.allowUnionTypes||ri(e,t),ni(e,e.dataTypes))}function ti(e,t){if(!!t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(r=>{ys(e.dataTypes,r)||mn(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),e.dataTypes=e.dataTypes.filter(r=>ys(t,r))}}function ri(e,t){t.length>1&&!(t.length===2&&t.includes("null"))&&mn(e,"use allowUnionTypes to allow union type keyword")}function ni(e,t){const r=e.self.RULES.all;for(const n in r){const s=r[n];if(typeof s=="object"&&(0,hn.shouldUseRule)(e.schema,s)){const{type:a}=s.definition;a.length&&!a.some(c=>si(t,c))&&mn(e,`missing type "${a.join(",")}" for keyword "${n}"`)}}}function si(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function ys(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function mn(e,t){t+=` at "${e.schemaEnv.baseId+e.errSchemaPath}" (strictTypes)`,(0,tt.checkStrictMode)(e,t,e.opts.strictTypes)}class _s{constructor(t,r,n){if((0,or.validateKeywordUsage)(t,r,n),this.gen=t.gen,this.allErrors=t.allErrors,this.keyword=n,this.data=t.data,this.schema=t.schema[n],this.$data=r.$data&&t.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,tt.schemaRefOrVal)(t,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=t.schema,this.params={},this.it=t,this.def=r,this.$data)this.schemaCode=t.gen.const("vSchema",Es(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,or.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=t.gen.const("_errs",G.default.errors))}result(t,r,n){this.failResult((0,U.not)(t),r,n)}failResult(t,r,n){this.gen.if(t),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(t,r){this.failResult((0,U.not)(t),void 0,r)}fail(t){if(t===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(t),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(t){if(!this.$data)return this.fail(t);const{schemaCode:r}=this;this.fail((0,U._)`${r} !== undefined && (${(0,U.or)(this.invalid$data(),t)})`)}error(t,r,n){if(r){this.setParams(r),this._error(t,n),this.setParams({});return}this._error(t,n)}_error(t,r){(t?ir.reportExtraError:ir.reportError)(this,this.def.error,r)}$dataError(){(0,ir.reportError)(this,this.def.$dataError||ir.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,ir.resetErrorsCount)(this.gen,this.errsCount)}ok(t){this.allErrors||this.gen.if(t)}setParams(t,r){r?Object.assign(this.params,t):this.params=t}block$data(t,r,n=U.nil){this.gen.block(()=>{this.check$data(t,n),r()})}check$data(t=U.nil,r=U.nil){if(!this.$data)return;const{gen:n,schemaCode:s,schemaType:a,def:c}=this;n.if((0,U.or)((0,U._)`${s} === undefined`,r)),t!==U.nil&&n.assign(t,!0),(a.length||c.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),t!==U.nil&&n.assign(t,!1)),n.else()}invalid$data(){const{gen:t,schemaCode:r,schemaType:n,def:s,it:a}=this;return(0,U.or)(c(),h());function c(){if(n.length){if(!(r instanceof U.Name))throw new Error("ajv implementation error");const g=Array.isArray(n)?n:[n];return(0,U._)`${(0,Vr.checkDataTypes)(g,r,a.opts.strictNumbers,Vr.DataType.Wrong)}`}return U.nil}function h(){if(s.validateSchema){const g=t.scopeValue("validate$data",{ref:s.validateSchema});return(0,U._)`!${g}(${r})`}return U.nil}}subschema(t,r){const n=(0,pn.getSubschema)(this.it,t);(0,pn.extendSubschemaData)(n,this.it,t),(0,pn.extendSubschemaMode)(n,t);const s=le(Y(Y({},this.it),n),{items:void 0,props:void 0});return qo(s,r),s}mergeEvaluated(t,r){const{it:n,gen:s}=this;!n.opts.unevaluated||(n.props!==!0&&t.props!==void 0&&(n.props=tt.mergeEvaluated.props(s,t.props,n.props,r)),n.items!==!0&&t.items!==void 0&&(n.items=tt.mergeEvaluated.items(s,t.items,n.items,r)))}mergeValidEvaluated(t,r){const{it:n,gen:s}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return s.if(r,()=>this.mergeEvaluated(t,U.Name)),!0}}He.KeywordCxt=_s;function $s(e,t,r,n){const s=new _s(e,r,t);"code"in r?r.code(s,n):s.$data&&r.validate?(0,or.funcKeywordCode)(s,r):"macro"in r?(0,or.macroKeywordCode)(s,r):(r.compile||r.validate)&&(0,or.funcKeywordCode)(s,r)}const ai=/^\/(?:[^~]|~0|~1)*$/,oi=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Es(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let s,a;if(e==="")return G.default.rootData;if(e[0]==="/"){if(!ai.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);s=e,a=G.default.rootData}else{const p=oi.exec(e);if(!p)throw new Error(`Invalid JSON-pointer: ${e}`);const u=+p[1];if(s=p[2],s==="#"){if(u>=t)throw new Error(g("property/index",u));return n[t-u]}if(u>t)throw new Error(g("data",u));if(a=r[t-u],!s)return a}let c=a;const h=s.split("/");for(const p of h)p&&(a=(0,U._)`${a}${(0,U.getProperty)((0,tt.unescapeJsonPointer)(p))}`,c=(0,U._)`${c} && ${a}`);return c;function g(p,u){return`Cannot access ${p} ${u} levels up, current level is ${t}`}}He.getData=Es;var zr={};Object.defineProperty(zr,"__esModule",{value:!0});class ii extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}}zr.default=ii;var Ct={};Object.defineProperty(Ct,"__esModule",{value:!0});const gn=Ne;class ci extends Error{constructor(t,r,n,s){super(s||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,gn.resolveUrl)(t,r,n),this.missingSchema=(0,gn.normalizeId)((0,gn.getFullPath)(t,this.missingRef))}}Ct.default=ci;var Oe={};Object.defineProperty(Oe,"__esModule",{value:!0}),Oe.resolveSchema=Oe.getCompilingSchema=Oe.resolveRef=Oe.compileSchema=Oe.SchemaEnv=void 0;const Le=ue,ui=zr,Nt=Ae,Ke=Ne,ws=Pe,li=He;class Lr{constructor(t){var r;this.refs={},this.dynamicAnchors={};let n;typeof t.schema=="object"&&(n=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=(r=t.baseId)!==null&&r!==void 0?r:(0,Ke.normalizeId)(n==null?void 0:n[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=n==null?void 0:n.$async,this.refs={}}}Oe.SchemaEnv=Lr;function vn(e){const t=Ss.call(this,e);if(t)return t;const r=(0,Ke.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:n,lines:s}=this.opts.code,{ownProperties:a}=this.opts,c=new Le.CodeGen(this.scope,{es5:n,lines:s,ownProperties:a});let h;e.$async&&(h=c.scopeValue("Error",{ref:ui.default,code:(0,Le._)`require("ajv/dist/runtime/validation_error").default`}));const g=c.scopeName("validate");e.validateName=g;const p={gen:c,allErrors:this.opts.allErrors,data:Nt.default.data,parentData:Nt.default.parentData,parentDataProperty:Nt.default.parentDataProperty,dataNames:[Nt.default.data],dataPathArr:[Le.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:c.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:(0,Le.stringify)(e.schema)}:{ref:e.schema}),validateName:g,ValidationError:h,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:Le.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,Le._)`""`,opts:this.opts,self:this};let u;try{this._compilations.add(e),(0,li.validateFunctionCode)(p),c.optimize(this.opts.code.optimize);const m=c.toString();u=`${c.scopeRefs(Nt.default.scope)}return ${m}`,this.opts.code.process&&(u=this.opts.code.process(u,e));const I=new Function(`${Nt.default.self}`,`${Nt.default.scope}`,u)(this,this.scope.get());if(this.scope.value(g,{ref:I}),I.errors=null,I.schema=e.schema,I.schemaEnv=e,e.$async&&(I.$async=!0),this.opts.code.source===!0&&(I.source={validateName:g,validateCode:m,scopeValues:c._values}),this.opts.unevaluated){const{props:T,items:A}=p;I.evaluated={props:T instanceof Le.Name?void 0:T,items:A instanceof Le.Name?void 0:A,dynamicProps:T instanceof Le.Name,dynamicItems:A instanceof Le.Name},I.source&&(I.source.evaluated=(0,Le.stringify)(I.evaluated))}return e.validate=I,e}catch(m){throw delete e.validate,delete e.validateName,u&&this.logger.error("Error compiling schema, function code:",u),m}finally{this._compilations.delete(e)}}Oe.compileSchema=vn;function di(e,t,r){var n;r=(0,Ke.resolveUrl)(this.opts.uriResolver,t,r);const s=e.refs[r];if(s)return s;let a=pi.call(this,e,r);if(a===void 0){const c=(n=e.localRefs)===null||n===void 0?void 0:n[r],{schemaId:h}=this.opts;c&&(a=new Lr({schema:c,schemaId:h,root:e,baseId:t}))}if(a!==void 0)return e.refs[r]=fi.call(this,a)}Oe.resolveRef=di;function fi(e){return(0,Ke.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:vn.call(this,e)}function Ss(e){for(const t of this._compilations)if(hi(t,e))return t}Oe.getCompilingSchema=Ss;function hi(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function pi(e,t){let r;for(;typeof(r=this.refs[t])=="string";)t=r;return r||this.schemas[t]||Kr.call(this,e,t)}function Kr(e,t){const r=this.opts.uriResolver.parse(t),n=(0,Ke._getFullPath)(this.opts.uriResolver,r);let s=(0,Ke.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===s)return yn.call(this,r,e);const a=(0,Ke.normalizeId)(n),c=this.refs[a]||this.schemas[a];if(typeof c=="string"){const h=Kr.call(this,e,c);return typeof(h==null?void 0:h.schema)!="object"?void 0:yn.call(this,r,h)}if(typeof(c==null?void 0:c.schema)=="object"){if(c.validate||vn.call(this,c),a===(0,Ke.normalizeId)(t)){const{schema:h}=c,{schemaId:g}=this.opts,p=h[g];return p&&(s=(0,Ke.resolveUrl)(this.opts.uriResolver,s,p)),new Lr({schema:h,schemaId:g,root:e,baseId:s})}return yn.call(this,r,c)}}Oe.resolveSchema=Kr;const mi=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function yn(e,{baseId:t,schema:r,root:n}){var s;if(((s=e.fragment)===null||s===void 0?void 0:s[0])!=="/")return;for(const h of e.fragment.slice(1).split("/")){if(typeof r=="boolean")return;const g=r[(0,ws.unescapeFragment)(h)];if(g===void 0)return;r=g;const p=typeof r=="object"&&r[this.opts.schemaId];!mi.has(h)&&p&&(t=(0,Ke.resolveUrl)(this.opts.uriResolver,t,p))}let a;if(typeof r!="boolean"&&r.$ref&&!(0,ws.schemaHasRulesButRef)(r,this.RULES)){const h=(0,Ke.resolveUrl)(this.opts.uriResolver,t,r.$ref);a=Kr.call(this,n,h)}const{schemaId:c}=this.opts;if(a=a||new Lr({schema:r,schemaId:c,root:n,baseId:t}),a.schema!==a.root.schema)return a}var gi={$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},_n={},$n={exports:{}};/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */(function(e,t){(function(r,n){n(t)})(J,function(r){function n(){for(var l=arguments.length,i=Array(l),f=0;f<l;f++)i[f]=arguments[f];if(i.length>1){i[0]=i[0].slice(0,-1);for(var S=i.length-1,E=1;E<S;++E)i[E]=i[E].slice(1,-1);return i[S]=i[S].slice(1),i.join("")}else return i[0]}function s(l){return"(?:"+l+")"}function a(l){return l===void 0?"undefined":l===null?"null":Object.prototype.toString.call(l).split(" ").pop().split("]").shift().toLowerCase()}function c(l){return l.toUpperCase()}function h(l){return l!=null?l instanceof Array?l:typeof l.length!="number"||l.split||l.setInterval||l.call?[l]:Array.prototype.slice.call(l):[]}function g(l,i){var f=l;if(i)for(var S in i)f[S]=i[S];return f}function p(l){var i="[A-Za-z]",f="[0-9]",S=n(f,"[A-Fa-f]"),E=s(s("%[EFef]"+S+"%"+S+S+"%"+S+S)+"|"+s("%[89A-Fa-f]"+S+"%"+S+S)+"|"+s("%"+S+S)),z="[\\:\\/\\?\\#\\[\\]\\@]",L="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",oe=n(z,L),me=l?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]",we=l?"[\\uE000-\\uF8FF]":"[]",te=n(i,f,"[\\-\\.\\_\\~]",me);s(i+n(i,f,"[\\+\\-\\.]")+"*"),s(s(E+"|"+n(te,L,"[\\:]"))+"*");var de=s(s("25[0-5]")+"|"+s("2[0-4]"+f)+"|"+s("1"+f+f)+"|"+s("0?[1-9]"+f)+"|0?0?"+f),Se=s(de+"\\."+de+"\\."+de+"\\."+de),q=s(S+"{1,4}"),ye=s(s(q+"\\:"+q)+"|"+Se),be=s(s(q+"\\:")+"{6}"+ye),_e=s("\\:\\:"+s(q+"\\:")+"{5}"+ye),Et=s(s(q)+"?\\:\\:"+s(q+"\\:")+"{4}"+ye),Xe=s(s(s(q+"\\:")+"{0,1}"+q)+"?\\:\\:"+s(q+"\\:")+"{3}"+ye),Ze=s(s(s(q+"\\:")+"{0,2}"+q)+"?\\:\\:"+s(q+"\\:")+"{2}"+ye),rr=s(s(s(q+"\\:")+"{0,3}"+q)+"?\\:\\:"+q+"\\:"+ye),Ut=s(s(s(q+"\\:")+"{0,4}"+q)+"?\\:\\:"+ye),Ve=s(s(s(q+"\\:")+"{0,5}"+q)+"?\\:\\:"+q),xe=s(s(s(q+"\\:")+"{0,6}"+q)+"?\\:\\:"),Vt=s([be,_e,Et,Xe,Ze,rr,Ut,Ve,xe].join("|")),ct=s(s(te+"|"+E)+"+");s("[vV]"+S+"+\\."+n(te,L,"[\\:]")+"+"),s(s(E+"|"+n(te,L))+"*");var jr=s(E+"|"+n(te,L,"[\\:\\@]"));return s(s(E+"|"+n(te,L,"[\\@]"))+"+"),s(s(jr+"|"+n("[\\/\\?]",we))+"*"),{NOT_SCHEME:new RegExp(n("[^]",i,f,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(n("[^\\%\\:]",te,L),"g"),NOT_HOST:new RegExp(n("[^\\%\\[\\]\\:]",te,L),"g"),NOT_PATH:new RegExp(n("[^\\%\\/\\:\\@]",te,L),"g"),NOT_PATH_NOSCHEME:new RegExp(n("[^\\%\\/\\@]",te,L),"g"),NOT_QUERY:new RegExp(n("[^\\%]",te,L,"[\\:\\@\\/\\?]",we),"g"),NOT_FRAGMENT:new RegExp(n("[^\\%]",te,L,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(n("[^]",te,L),"g"),UNRESERVED:new RegExp(te,"g"),OTHER_CHARS:new RegExp(n("[^\\%]",te,oe),"g"),PCT_ENCODED:new RegExp(E,"g"),IPV4ADDRESS:new RegExp("^("+Se+")$"),IPV6ADDRESS:new RegExp("^\\[?("+Vt+")"+s(s("\\%25|\\%(?!"+S+"{2})")+"("+ct+")")+"?\\]?$")}}var u=p(!1),m=p(!0),b=function(){function l(i,f){var S=[],E=!0,z=!1,L=void 0;try{for(var oe=i[Symbol.iterator](),me;!(E=(me=oe.next()).done)&&(S.push(me.value),!(f&&S.length===f));E=!0);}catch(we){z=!0,L=we}finally{try{!E&&oe.return&&oe.return()}finally{if(z)throw L}}return S}return function(i,f){if(Array.isArray(i))return i;if(Symbol.iterator in Object(i))return l(i,f);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),I=function(l){if(Array.isArray(l)){for(var i=0,f=Array(l.length);i<l.length;i++)f[i]=l[i];return f}else return Array.from(l)},T=2147483647,A=36,w=1,v=26,C=38,N=700,j=72,K=128,_="-",P=/^xn--/,D=/[^\0-\x7E]/,H=/[\x2E\u3002\uFF0E\uFF61]/g,W={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},pe=A-w,Z=Math.floor,ie=String.fromCharCode;function x(l){throw new RangeError(W[l])}function ve(l,i){for(var f=[],S=l.length;S--;)f[S]=i(l[S]);return f}function $e(l,i){var f=l.split("@"),S="";f.length>1&&(S=f[0]+"@",l=f[1]),l=l.replace(H,".");var E=l.split("."),z=ve(E,i).join(".");return S+z}function Ce(l){for(var i=[],f=0,S=l.length;f<S;){var E=l.charCodeAt(f++);if(E>=55296&&E<=56319&&f<S){var z=l.charCodeAt(f++);(z&64512)==56320?i.push(((E&1023)<<10)+(z&1023)+65536):(i.push(E),f--)}else i.push(E)}return i}var Me=function(i){return String.fromCodePoint.apply(String,I(i))},Wt=function(i){return i-48<10?i-22:i-65<26?i-65:i-97<26?i-97:A},k=function(i,f){return i+22+75*(i<26)-((f!=0)<<5)},y=function(i,f,S){var E=0;for(i=S?Z(i/N):i>>1,i+=Z(i/f);i>pe*v>>1;E+=A)i=Z(i/pe);return Z(E+(pe+1)*i/(i+C))},O=function(i){var f=[],S=i.length,E=0,z=K,L=j,oe=i.lastIndexOf(_);oe<0&&(oe=0);for(var me=0;me<oe;++me)i.charCodeAt(me)>=128&&x("not-basic"),f.push(i.charCodeAt(me));for(var we=oe>0?oe+1:0;we<S;){for(var te=E,de=1,Se=A;;Se+=A){we>=S&&x("invalid-input");var q=Wt(i.charCodeAt(we++));(q>=A||q>Z((T-E)/de))&&x("overflow"),E+=q*de;var ye=Se<=L?w:Se>=L+v?v:Se-L;if(q<ye)break;var be=A-ye;de>Z(T/be)&&x("overflow"),de*=be}var _e=f.length+1;L=y(E-te,_e,te==0),Z(E/_e)>T-z&&x("overflow"),z+=Z(E/_e),E%=_e,f.splice(E++,0,z)}return String.fromCodePoint.apply(String,f)},$=function(i){var f=[];i=Ce(i);var S=i.length,E=K,z=0,L=j,oe=!0,me=!1,we=void 0;try{for(var te=i[Symbol.iterator](),de;!(oe=(de=te.next()).done);oe=!0){var Se=de.value;Se<128&&f.push(ie(Se))}}catch(Tr){me=!0,we=Tr}finally{try{!oe&&te.return&&te.return()}finally{if(me)throw we}}var q=f.length,ye=q;for(q&&f.push(_);ye<S;){var be=T,_e=!0,Et=!1,Xe=void 0;try{for(var Ze=i[Symbol.iterator](),rr;!(_e=(rr=Ze.next()).done);_e=!0){var Ut=rr.value;Ut>=E&&Ut<be&&(be=Ut)}}catch(Tr){Et=!0,Xe=Tr}finally{try{!_e&&Ze.return&&Ze.return()}finally{if(Et)throw Xe}}var Ve=ye+1;be-E>Z((T-z)/Ve)&&x("overflow"),z+=(be-E)*Ve,E=be;var xe=!0,Vt=!1,ct=void 0;try{for(var jr=i[Symbol.iterator](),Ra;!(xe=(Ra=jr.next()).done);xe=!0){var Oa=Ra.value;if(Oa<E&&++z>T&&x("overflow"),Oa==E){for(var nn=z,sn=A;;sn+=A){var an=sn<=L?w:sn>=L+v?v:sn-L;if(nn<an)break;var ja=nn-an,Ta=A-an;f.push(ie(k(an+ja%Ta,0))),nn=Z(ja/Ta)}f.push(ie(k(nn,0))),L=y(z,Ve,ye==q),z=0,++ye}}}catch(Tr){Vt=!0,ct=Tr}finally{try{!xe&&jr.return&&jr.return()}finally{if(Vt)throw ct}}++z,++E}return f.join("")},o=function(i){return $e(i,function(f){return P.test(f)?O(f.slice(4).toLowerCase()):f})},d=function(i){return $e(i,function(f){return D.test(f)?"xn--"+$(f):f})},R={version:"2.1.0",ucs2:{decode:Ce,encode:Me},decode:O,encode:$,toASCII:d,toUnicode:o},F={};function M(l){var i=l.charCodeAt(0),f=void 0;return i<16?f="%0"+i.toString(16).toUpperCase():i<128?f="%"+i.toString(16).toUpperCase():i<2048?f="%"+(i>>6|192).toString(16).toUpperCase()+"%"+(i&63|128).toString(16).toUpperCase():f="%"+(i>>12|224).toString(16).toUpperCase()+"%"+(i>>6&63|128).toString(16).toUpperCase()+"%"+(i&63|128).toString(16).toUpperCase(),f}function ee(l){for(var i="",f=0,S=l.length;f<S;){var E=parseInt(l.substr(f+1,2),16);if(E<128)i+=String.fromCharCode(E),f+=3;else if(E>=194&&E<224){if(S-f>=6){var z=parseInt(l.substr(f+4,2),16);i+=String.fromCharCode((E&31)<<6|z&63)}else i+=l.substr(f,6);f+=6}else if(E>=224){if(S-f>=9){var L=parseInt(l.substr(f+4,2),16),oe=parseInt(l.substr(f+7,2),16);i+=String.fromCharCode((E&15)<<12|(L&63)<<6|oe&63)}else i+=l.substr(f,9);f+=9}else i+=l.substr(f,3),f+=3}return i}function se(l,i){function f(S){var E=ee(S);return E.match(i.UNRESERVED)?E:S}return l.scheme&&(l.scheme=String(l.scheme).replace(i.PCT_ENCODED,f).toLowerCase().replace(i.NOT_SCHEME,"")),l.userinfo!==void 0&&(l.userinfo=String(l.userinfo).replace(i.PCT_ENCODED,f).replace(i.NOT_USERINFO,M).replace(i.PCT_ENCODED,c)),l.host!==void 0&&(l.host=String(l.host).replace(i.PCT_ENCODED,f).toLowerCase().replace(i.NOT_HOST,M).replace(i.PCT_ENCODED,c)),l.path!==void 0&&(l.path=String(l.path).replace(i.PCT_ENCODED,f).replace(l.scheme?i.NOT_PATH:i.NOT_PATH_NOSCHEME,M).replace(i.PCT_ENCODED,c)),l.query!==void 0&&(l.query=String(l.query).replace(i.PCT_ENCODED,f).replace(i.NOT_QUERY,M).replace(i.PCT_ENCODED,c)),l.fragment!==void 0&&(l.fragment=String(l.fragment).replace(i.PCT_ENCODED,f).replace(i.NOT_FRAGMENT,M).replace(i.PCT_ENCODED,c)),l}function Ee(l){return l.replace(/^0*(.*)/,"$1")||"0"}function Qe(l,i){var f=l.match(i.IPV4ADDRESS)||[],S=b(f,2),E=S[1];return E?E.split(".").map(Ee).join("."):l}function Yt(l,i){var f=l.match(i.IPV6ADDRESS)||[],S=b(f,3),E=S[1],z=S[2];if(E){for(var L=E.toLowerCase().split("::").reverse(),oe=b(L,2),me=oe[0],we=oe[1],te=we?we.split(":").map(Ee):[],de=me.split(":").map(Ee),Se=i.IPV4ADDRESS.test(de[de.length-1]),q=Se?7:8,ye=de.length-q,be=Array(q),_e=0;_e<q;++_e)be[_e]=te[_e]||de[ye+_e]||"";Se&&(be[q-1]=Qe(be[q-1],i));var Et=be.reduce(function(Ve,xe,Vt){if(!xe||xe==="0"){var ct=Ve[Ve.length-1];ct&&ct.index+ct.length===Vt?ct.length++:Ve.push({index:Vt,length:1})}return Ve},[]),Xe=Et.sort(function(Ve,xe){return xe.length-Ve.length})[0],Ze=void 0;if(Xe&&Xe.length>1){var rr=be.slice(0,Xe.index),Ut=be.slice(Xe.index+Xe.length);Ze=rr.join(":")+"::"+Ut.join(":")}else Ze=be.join(":");return z&&(Ze+="%"+z),Ze}else return l}var Sr=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,br="".match(/(){0}/)[1]===void 0;function Ie(l){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},f={},S=i.iri!==!1?m:u;i.reference==="suffix"&&(l=(i.scheme?i.scheme+":":"")+"//"+l);var E=l.match(Sr);if(E){br?(f.scheme=E[1],f.userinfo=E[3],f.host=E[4],f.port=parseInt(E[5],10),f.path=E[6]||"",f.query=E[7],f.fragment=E[8],isNaN(f.port)&&(f.port=E[5])):(f.scheme=E[1]||void 0,f.userinfo=l.indexOf("@")!==-1?E[3]:void 0,f.host=l.indexOf("//")!==-1?E[4]:void 0,f.port=parseInt(E[5],10),f.path=E[6]||"",f.query=l.indexOf("?")!==-1?E[7]:void 0,f.fragment=l.indexOf("#")!==-1?E[8]:void 0,isNaN(f.port)&&(f.port=l.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?E[4]:void 0)),f.host&&(f.host=Yt(Qe(f.host,S),S)),f.scheme===void 0&&f.userinfo===void 0&&f.host===void 0&&f.port===void 0&&!f.path&&f.query===void 0?f.reference="same-document":f.scheme===void 0?f.reference="relative":f.fragment===void 0?f.reference="absolute":f.reference="uri",i.reference&&i.reference!=="suffix"&&i.reference!==f.reference&&(f.error=f.error||"URI is not a "+i.reference+" reference.");var z=F[(i.scheme||f.scheme||"").toLowerCase()];if(!i.unicodeSupport&&(!z||!z.unicodeSupport)){if(f.host&&(i.domainHost||z&&z.domainHost))try{f.host=R.toASCII(f.host.replace(S.PCT_ENCODED,ee).toLowerCase())}catch(L){f.error=f.error||"Host's domain name can not be converted to ASCII via punycode: "+L}se(f,u)}else se(f,S);z&&z.parse&&z.parse(f,i)}else f.error=f.error||"URI can not be parsed.";return f}function Pr(l,i){var f=i.iri!==!1?m:u,S=[];return l.userinfo!==void 0&&(S.push(l.userinfo),S.push("@")),l.host!==void 0&&S.push(Yt(Qe(String(l.host),f),f).replace(f.IPV6ADDRESS,function(E,z,L){return"["+z+(L?"%25"+L:"")+"]"})),(typeof l.port=="number"||typeof l.port=="string")&&(S.push(":"),S.push(String(l.port))),S.length?S.join(""):void 0}var Xt=/^\.\.?\//,Zt=/^\/\.(\/|$)/,xt=/^\/\.\.(\/|$)/,Cr=/^\/?(?:.|\n)*?(?=\/|$)/;function We(l){for(var i=[];l.length;)if(l.match(Xt))l=l.replace(Xt,"");else if(l.match(Zt))l=l.replace(Zt,"/");else if(l.match(xt))l=l.replace(xt,"/"),i.pop();else if(l==="."||l==="..")l="";else{var f=l.match(Cr);if(f){var S=f[0];l=l.slice(S.length),i.push(S)}else throw new Error("Unexpected dot segment condition")}return i.join("")}function De(l){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},f=i.iri?m:u,S=[],E=F[(i.scheme||l.scheme||"").toLowerCase()];if(E&&E.serialize&&E.serialize(l,i),l.host&&!f.IPV6ADDRESS.test(l.host)){if(i.domainHost||E&&E.domainHost)try{l.host=i.iri?R.toUnicode(l.host):R.toASCII(l.host.replace(f.PCT_ENCODED,ee).toLowerCase())}catch(oe){l.error=l.error||"Host's domain name can not be converted to "+(i.iri?"Unicode":"ASCII")+" via punycode: "+oe}}se(l,f),i.reference!=="suffix"&&l.scheme&&(S.push(l.scheme),S.push(":"));var z=Pr(l,i);if(z!==void 0&&(i.reference!=="suffix"&&S.push("//"),S.push(z),l.path&&l.path.charAt(0)!=="/"&&S.push("/")),l.path!==void 0){var L=l.path;!i.absolutePath&&(!E||!E.absolutePath)&&(L=We(L)),z===void 0&&(L=L.replace(/^\/\//,"/%2F")),S.push(L)}return l.query!==void 0&&(S.push("?"),S.push(l.query)),l.fragment!==void 0&&(S.push("#"),S.push(l.fragment)),S.join("")}function er(l,i){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},S=arguments[3],E={};return S||(l=Ie(De(l,f),f),i=Ie(De(i,f),f)),f=f||{},!f.tolerant&&i.scheme?(E.scheme=i.scheme,E.userinfo=i.userinfo,E.host=i.host,E.port=i.port,E.path=We(i.path||""),E.query=i.query):(i.userinfo!==void 0||i.host!==void 0||i.port!==void 0?(E.userinfo=i.userinfo,E.host=i.host,E.port=i.port,E.path=We(i.path||""),E.query=i.query):(i.path?(i.path.charAt(0)==="/"?E.path=We(i.path):((l.userinfo!==void 0||l.host!==void 0||l.port!==void 0)&&!l.path?E.path="/"+i.path:l.path?E.path=l.path.slice(0,l.path.lastIndexOf("/")+1)+i.path:E.path=i.path,E.path=We(E.path)),E.query=i.query):(E.path=l.path,i.query!==void 0?E.query=i.query:E.query=l.query),E.userinfo=l.userinfo,E.host=l.host,E.port=l.port),E.scheme=l.scheme),E.fragment=i.fragment,E}function Nr(l,i,f){var S=g({scheme:"null"},f);return De(er(Ie(l,S),Ie(i,S),S,!0),S)}function Ft(l,i){return typeof l=="string"?l=De(Ie(l,i),i):a(l)==="object"&&(l=Ie(De(l,i),i)),l}function Rr(l,i,f){return typeof l=="string"?l=De(Ie(l,f),f):a(l)==="object"&&(l=De(l,f)),typeof i=="string"?i=De(Ie(i,f),f):a(i)==="object"&&(i=De(i,f)),l===i}function rn(l,i){return l&&l.toString().replace(!i||!i.iri?u.ESCAPE:m.ESCAPE,M)}function Ue(l,i){return l&&l.toString().replace(!i||!i.iri?u.PCT_ENCODED:m.PCT_ENCODED,ee)}var Mt={scheme:"http",domainHost:!0,parse:function(i,f){return i.host||(i.error=i.error||"HTTP URIs must have a host."),i},serialize:function(i,f){var S=String(i.scheme).toLowerCase()==="https";return(i.port===(S?443:80)||i.port==="")&&(i.port=void 0),i.path||(i.path="/"),i}},$a={scheme:"https",domainHost:Mt.domainHost,parse:Mt.parse,serialize:Mt.serialize};function Ea(l){return typeof l.secure=="boolean"?l.secure:String(l.scheme).toLowerCase()==="wss"}var Or={scheme:"ws",domainHost:!0,parse:function(i,f){var S=i;return S.secure=Ea(S),S.resourceName=(S.path||"/")+(S.query?"?"+S.query:""),S.path=void 0,S.query=void 0,S},serialize:function(i,f){if((i.port===(Ea(i)?443:80)||i.port==="")&&(i.port=void 0),typeof i.secure=="boolean"&&(i.scheme=i.secure?"wss":"ws",i.secure=void 0),i.resourceName){var S=i.resourceName.split("?"),E=b(S,2),z=E[0],L=E[1];i.path=z&&z!=="/"?z:void 0,i.query=L,i.resourceName=void 0}return i.fragment=void 0,i}},wa={scheme:"wss",domainHost:Or.domainHost,parse:Or.parse,serialize:Or.serialize},Pu={},Sa="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",Ye="[0-9A-Fa-f]",Cu=s(s("%[EFef]"+Ye+"%"+Ye+Ye+"%"+Ye+Ye)+"|"+s("%[89A-Fa-f]"+Ye+"%"+Ye+Ye)+"|"+s("%"+Ye+Ye)),Nu="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",Ru="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",Ou=n(Ru,'[\\"\\\\]'),ju="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",Tu=new RegExp(Sa,"g"),tr=new RegExp(Cu,"g"),Du=new RegExp(n("[^]",Nu,"[\\.]",'[\\"]',Ou),"g"),ba=new RegExp(n("[^]",Sa,ju),"g"),Iu=ba;function Jn(l){var i=ee(l);return i.match(Tu)?i:l}var Pa={scheme:"mailto",parse:function(i,f){var S=i,E=S.to=S.path?S.path.split(","):[];if(S.path=void 0,S.query){for(var z=!1,L={},oe=S.query.split("&"),me=0,we=oe.length;me<we;++me){var te=oe[me].split("=");switch(te[0]){case"to":for(var de=te[1].split(","),Se=0,q=de.length;Se<q;++Se)E.push(de[Se]);break;case"subject":S.subject=Ue(te[1],f);break;case"body":S.body=Ue(te[1],f);break;default:z=!0,L[Ue(te[0],f)]=Ue(te[1],f);break}}z&&(S.headers=L)}S.query=void 0;for(var ye=0,be=E.length;ye<be;++ye){var _e=E[ye].split("@");if(_e[0]=Ue(_e[0]),f.unicodeSupport)_e[1]=Ue(_e[1],f).toLowerCase();else try{_e[1]=R.toASCII(Ue(_e[1],f).toLowerCase())}catch(Et){S.error=S.error||"Email address's domain name can not be converted to ASCII via punycode: "+Et}E[ye]=_e.join("@")}return S},serialize:function(i,f){var S=i,E=h(i.to);if(E){for(var z=0,L=E.length;z<L;++z){var oe=String(E[z]),me=oe.lastIndexOf("@"),we=oe.slice(0,me).replace(tr,Jn).replace(tr,c).replace(Du,M),te=oe.slice(me+1);try{te=f.iri?R.toUnicode(te):R.toASCII(Ue(te,f).toLowerCase())}catch(ye){S.error=S.error||"Email address's domain name can not be converted to "+(f.iri?"Unicode":"ASCII")+" via punycode: "+ye}E[z]=we+"@"+te}S.path=E.join(",")}var de=i.headers=i.headers||{};i.subject&&(de.subject=i.subject),i.body&&(de.body=i.body);var Se=[];for(var q in de)de[q]!==Pu[q]&&Se.push(q.replace(tr,Jn).replace(tr,c).replace(ba,M)+"="+de[q].replace(tr,Jn).replace(tr,c).replace(Iu,M));return Se.length&&(S.query=Se.join("&")),S}},Au=/^([^\:]+)\:(.*)/,Ca={scheme:"urn",parse:function(i,f){var S=i.path&&i.path.match(Au),E=i;if(S){var z=f.scheme||E.scheme||"urn",L=S[1].toLowerCase(),oe=S[2],me=z+":"+(f.nid||L),we=F[me];E.nid=L,E.nss=oe,E.path=void 0,we&&(E=we.parse(E,f))}else E.error=E.error||"URN can not be parsed.";return E},serialize:function(i,f){var S=f.scheme||i.scheme||"urn",E=i.nid,z=S+":"+(f.nid||E),L=F[z];L&&(i=L.serialize(i,f));var oe=i,me=i.nss;return oe.path=(E||f.nid)+":"+me,oe}},ku=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,Na={scheme:"urn:uuid",parse:function(i,f){var S=i;return S.uuid=S.nss,S.nss=void 0,!f.tolerant&&(!S.uuid||!S.uuid.match(ku))&&(S.error=S.error||"UUID is not valid."),S},serialize:function(i,f){var S=i;return S.nss=(i.uuid||"").toLowerCase(),S}};F[Mt.scheme]=Mt,F[$a.scheme]=$a,F[Or.scheme]=Or,F[wa.scheme]=wa,F[Pa.scheme]=Pa,F[Ca.scheme]=Ca,F[Na.scheme]=Na,r.SCHEMES=F,r.pctEncChar=M,r.pctDecChars=ee,r.parse=Ie,r.removeDotSegments=We,r.serialize=De,r.resolveComponents=er,r.resolve=Nr,r.normalize=Ft,r.equal=Rr,r.escapeComponent=rn,r.unescapeComponent=Ue,Object.defineProperty(r,"__esModule",{value:!0})})})($n,$n.exports),Object.defineProperty(_n,"__esModule",{value:!0});const bs=$n.exports;bs.code='require("ajv/dist/runtime/uri").default',_n.default=bs,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=He;Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=ue;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 n=zr,s=Ct,a=bt,c=Oe,h=ue,g=Ne,p=Fr,u=Pe,m=gi,b=_n,I=(k,y)=>new RegExp(k,y);I.code="new RegExp";const T=["removeAdditional","useDefaults","coerceTypes"],A=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),w={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."},v={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},C=200;function N(k){var y,O,$,o,d,R,F,M,ee,se,Ee,Qe,Yt,Sr,br,Ie,Pr,Xt,Zt,xt,Cr,We,De,er,Nr;const Ft=k.strict,Rr=(y=k.code)===null||y===void 0?void 0:y.optimize,rn=Rr===!0||Rr===void 0?1:Rr||0,Ue=($=(O=k.code)===null||O===void 0?void 0:O.regExp)!==null&&$!==void 0?$:I,Mt=(o=k.uriResolver)!==null&&o!==void 0?o:b.default;return{strictSchema:(R=(d=k.strictSchema)!==null&&d!==void 0?d:Ft)!==null&&R!==void 0?R:!0,strictNumbers:(M=(F=k.strictNumbers)!==null&&F!==void 0?F:Ft)!==null&&M!==void 0?M:!0,strictTypes:(se=(ee=k.strictTypes)!==null&&ee!==void 0?ee:Ft)!==null&&se!==void 0?se:"log",strictTuples:(Qe=(Ee=k.strictTuples)!==null&&Ee!==void 0?Ee:Ft)!==null&&Qe!==void 0?Qe:"log",strictRequired:(Sr=(Yt=k.strictRequired)!==null&&Yt!==void 0?Yt:Ft)!==null&&Sr!==void 0?Sr:!1,code:k.code?le(Y({},k.code),{optimize:rn,regExp:Ue}):{optimize:rn,regExp:Ue},loopRequired:(br=k.loopRequired)!==null&&br!==void 0?br:C,loopEnum:(Ie=k.loopEnum)!==null&&Ie!==void 0?Ie:C,meta:(Pr=k.meta)!==null&&Pr!==void 0?Pr:!0,messages:(Xt=k.messages)!==null&&Xt!==void 0?Xt:!0,inlineRefs:(Zt=k.inlineRefs)!==null&&Zt!==void 0?Zt:!0,schemaId:(xt=k.schemaId)!==null&&xt!==void 0?xt:"$id",addUsedSchema:(Cr=k.addUsedSchema)!==null&&Cr!==void 0?Cr:!0,validateSchema:(We=k.validateSchema)!==null&&We!==void 0?We:!0,validateFormats:(De=k.validateFormats)!==null&&De!==void 0?De:!0,unicodeRegExp:(er=k.unicodeRegExp)!==null&&er!==void 0?er:!0,int32range:(Nr=k.int32range)!==null&&Nr!==void 0?Nr:!0,uriResolver:Mt}}class j{constructor(y={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,y=this.opts=Y(Y({},y),N(y));const{es5:O,lines:$}=this.opts.code;this.scope=new h.ValueScope({scope:{},prefixes:A,es5:O,lines:$}),this.logger=Z(y.logger);const o=y.validateFormats;y.validateFormats=!1,this.RULES=(0,a.getRules)(),K.call(this,w,y,"NOT SUPPORTED"),K.call(this,v,y,"DEPRECATED","warn"),this._metaOpts=W.call(this),y.formats&&D.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),y.keywords&&H.call(this,y.keywords),typeof y.meta=="object"&&this.addMetaSchema(y.meta),P.call(this),y.validateFormats=o}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:y,meta:O,schemaId:$}=this.opts;let o=m;$==="id"&&(o=Y({},m),o.id=o.$id,delete o.$id),O&&y&&this.addMetaSchema(o,o[$],!1)}defaultMeta(){const{meta:y,schemaId:O}=this.opts;return this.opts.defaultMeta=typeof y=="object"?y[O]||y:void 0}validate(y,O){let $;if(typeof y=="string"){if($=this.getSchema(y),!$)throw new Error(`no schema with key or ref "${y}"`)}else $=this.compile(y);const o=$(O);return"$async"in $||(this.errors=$.errors),o}compile(y,O){const $=this._addSchema(y,O);return $.validate||this._compileSchemaEnv($)}compileAsync(y,O){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:$}=this.opts;return o.call(this,y,O);async function o(se,Ee){await d.call(this,se.$schema);const Qe=this._addSchema(se,Ee);return Qe.validate||R.call(this,Qe)}async function d(se){se&&!this.getSchema(se)&&await o.call(this,{$ref:se},!0)}async function R(se){try{return this._compileSchemaEnv(se)}catch(Ee){if(!(Ee instanceof s.default))throw Ee;return F.call(this,Ee),await M.call(this,Ee.missingSchema),R.call(this,se)}}function F({missingSchema:se,missingRef:Ee}){if(this.refs[se])throw new Error(`AnySchema ${se} is loaded but ${Ee} cannot be resolved`)}async function M(se){const Ee=await ee.call(this,se);this.refs[se]||await d.call(this,Ee.$schema),this.refs[se]||this.addSchema(Ee,se,O)}async function ee(se){const Ee=this._loading[se];if(Ee)return Ee;try{return await(this._loading[se]=$(se))}finally{delete this._loading[se]}}}addSchema(y,O,$,o=this.opts.validateSchema){if(Array.isArray(y)){for(const R of y)this.addSchema(R,void 0,$,o);return this}let d;if(typeof y=="object"){const{schemaId:R}=this.opts;if(d=y[R],d!==void 0&&typeof d!="string")throw new Error(`schema ${R} must be string`)}return O=(0,g.normalizeId)(O||d),this._checkUnique(O),this.schemas[O]=this._addSchema(y,$,O,o,!0),this}addMetaSchema(y,O,$=this.opts.validateSchema){return this.addSchema(y,O,!0,$),this}validateSchema(y,O){if(typeof y=="boolean")return!0;let $;if($=y.$schema,$!==void 0&&typeof $!="string")throw new Error("$schema must be a string");if($=$||this.opts.defaultMeta||this.defaultMeta(),!$)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const o=this.validate($,y);if(!o&&O){const d="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(d);else throw new Error(d)}return o}getSchema(y){let O;for(;typeof(O=_.call(this,y))=="string";)y=O;if(O===void 0){const{schemaId:$}=this.opts,o=new c.SchemaEnv({schema:{},schemaId:$});if(O=c.resolveSchema.call(this,o,y),!O)return;this.refs[y]=O}return O.validate||this._compileSchemaEnv(O)}removeSchema(y){if(y instanceof RegExp)return this._removeAllSchemas(this.schemas,y),this._removeAllSchemas(this.refs,y),this;switch(typeof y){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const O=_.call(this,y);return typeof O=="object"&&this._cache.delete(O.schema),delete this.schemas[y],delete this.refs[y],this}case"object":{const O=y;this._cache.delete(O);let $=y[this.opts.schemaId];return $&&($=(0,g.normalizeId)($),delete this.schemas[$],delete this.refs[$]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(y){for(const O of y)this.addKeyword(O);return this}addKeyword(y,O){let $;if(typeof y=="string")$=y,typeof O=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),O.keyword=$);else if(typeof y=="object"&&O===void 0){if(O=y,$=O.keyword,Array.isArray($)&&!$.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(x.call(this,$,O),!O)return(0,u.eachItem)($,d=>ve.call(this,d)),this;Ce.call(this,O);const o=le(Y({},O),{type:(0,p.getJSONTypes)(O.type),schemaType:(0,p.getJSONTypes)(O.schemaType)});return(0,u.eachItem)($,o.type.length===0?d=>ve.call(this,d,o):d=>o.type.forEach(R=>ve.call(this,d,o,R))),this}getKeyword(y){const O=this.RULES.all[y];return typeof O=="object"?O.definition:!!O}removeKeyword(y){const{RULES:O}=this;delete O.keywords[y],delete O.all[y];for(const $ of O.rules){const o=$.rules.findIndex(d=>d.keyword===y);o>=0&&$.rules.splice(o,1)}return this}addFormat(y,O){return typeof O=="string"&&(O=new RegExp(O)),this.formats[y]=O,this}errorsText(y=this.errors,{separator:O=", ",dataVar:$="data"}={}){return!y||y.length===0?"No errors":y.map(o=>`${$}${o.instancePath} ${o.message}`).reduce((o,d)=>o+O+d)}$dataMetaSchema(y,O){const $=this.RULES.all;y=JSON.parse(JSON.stringify(y));for(const o of O){const d=o.split("/").slice(1);let R=y;for(const F of d)R=R[F];for(const F in $){const M=$[F];if(typeof M!="object")continue;const{$data:ee}=M.definition,se=R[F];ee&&se&&(R[F]=Wt(se))}}return y}_removeAllSchemas(y,O){for(const $ in y){const o=y[$];(!O||O.test($))&&(typeof o=="string"?delete y[$]:o&&!o.meta&&(this._cache.delete(o.schema),delete y[$]))}}_addSchema(y,O,$,o=this.opts.validateSchema,d=this.opts.addUsedSchema){let R;const{schemaId:F}=this.opts;if(typeof y=="object")R=y[F];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof y!="boolean")throw new Error("schema must be object or boolean")}let M=this._cache.get(y);if(M!==void 0)return M;$=(0,g.normalizeId)(R||$);const ee=g.getSchemaRefs.call(this,y,$);return M=new c.SchemaEnv({schema:y,schemaId:F,meta:O,baseId:$,localRefs:ee}),this._cache.set(M.schema,M),d&&!$.startsWith("#")&&($&&this._checkUnique($),this.refs[$]=M),o&&this.validateSchema(y,!0),M}_checkUnique(y){if(this.schemas[y]||this.refs[y])throw new Error(`schema with key or id "${y}" already exists`)}_compileSchemaEnv(y){if(y.meta?this._compileMetaSchema(y):c.compileSchema.call(this,y),!y.validate)throw new Error("ajv implementation error");return y.validate}_compileMetaSchema(y){const O=this.opts;this.opts=this._metaOpts;try{c.compileSchema.call(this,y)}finally{this.opts=O}}}e.default=j,j.ValidationError=n.default,j.MissingRefError=s.default;function K(k,y,O,$="error"){for(const o in k){const d=o;d in y&&this.logger[$](`${O}: option ${o}. ${k[d]}`)}}function _(k){return k=(0,g.normalizeId)(k),this.schemas[k]||this.refs[k]}function P(){const k=this.opts.schemas;if(!!k)if(Array.isArray(k))this.addSchema(k);else for(const y in k)this.addSchema(k[y],y)}function D(){for(const k in this.opts.formats){const y=this.opts.formats[k];y&&this.addFormat(k,y)}}function H(k){if(Array.isArray(k)){this.addVocabulary(k);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const y in k){const O=k[y];O.keyword||(O.keyword=y),this.addKeyword(O)}}function W(){const k=Y({},this.opts);for(const y of T)delete k[y];return k}const pe={log(){},warn(){},error(){}};function Z(k){if(k===!1)return pe;if(k===void 0)return console;if(k.log&&k.warn&&k.error)return k;throw new Error("logger must implement log, warn and error methods")}const ie=/^[a-z_$][a-z0-9_$:-]*$/i;function x(k,y){const{RULES:O}=this;if((0,u.eachItem)(k,$=>{if(O.keywords[$])throw new Error(`Keyword ${$} is already defined`);if(!ie.test($))throw new Error(`Keyword ${$} has invalid name`)}),!!y&&y.$data&&!("code"in y||"validate"in y))throw new Error('$data keyword must have "code" or "validate" function')}function ve(k,y,O){var $;const o=y==null?void 0:y.post;if(O&&o)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:d}=this;let R=o?d.post:d.rules.find(({type:M})=>M===O);if(R||(R={type:O,rules:[]},d.rules.push(R)),d.keywords[k]=!0,!y)return;const F={keyword:k,definition:le(Y({},y),{type:(0,p.getJSONTypes)(y.type),schemaType:(0,p.getJSONTypes)(y.schemaType)})};y.before?$e.call(this,R,F,y.before):R.rules.push(F),d.all[k]=F,($=y.implements)===null||$===void 0||$.forEach(M=>this.addKeyword(M))}function $e(k,y,O){const $=k.rules.findIndex(o=>o.keyword===O);$>=0?k.rules.splice($,0,y):(k.rules.push(y),this.logger.warn(`rule ${O} is not defined`))}function Ce(k){let{metaSchema:y}=k;y!==void 0&&(k.$data&&this.opts.$data&&(y=Wt(y)),k.validateSchema=this.compile(y,!0))}const Me={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Wt(k){return{anyOf:[k,Me]}}}(Bn);var En={},Rt={},Ot={};Object.defineProperty(Ot,"__esModule",{value:!0}),Ot.callRef=Ot.getValidate=void 0;const vi=Ct,Ps=ae,Te=ue,Jt=Ae,Cs=Oe,Hr=Pe,yi={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:r,it:n}=e,{baseId:s,schemaEnv:a,validateName:c,opts:h,self:g}=n,{root:p}=a;if((r==="#"||r==="#/")&&s===p.baseId)return m();const u=Cs.resolveRef.call(g,p,s,r);if(u===void 0)throw new vi.default(n.opts.uriResolver,s,r);if(u instanceof Cs.SchemaEnv)return b(u);return I(u);function m(){if(a===p)return Jr(e,c,a,a.$async);const T=t.scopeValue("root",{ref:p});return Jr(e,(0,Te._)`${T}.validate`,p,p.$async)}function b(T){const A=Ns(e,T);Jr(e,A,T,T.$async)}function I(T){const A=t.scopeValue("schema",h.code.source===!0?{ref:T,code:(0,Te.stringify)(T)}:{ref:T}),w=t.name("valid"),v=e.subschema({schema:T,dataTypes:[],schemaPath:Te.nil,topSchemaRef:A,errSchemaPath:r},w);e.mergeEvaluated(v),e.ok(w)}}};function Ns(e,t){const{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,Te._)`${r.scopeValue("wrapper",{ref:t})}.validate`}Ot.getValidate=Ns;function Jr(e,t,r,n){const{gen:s,it:a}=e,{allErrors:c,schemaEnv:h,opts:g}=a,p=g.passContext?Jt.default.this:Te.nil;n?u():m();function u(){if(!h.$async)throw new Error("async schema referenced by sync schema");const T=s.let("valid");s.try(()=>{s.code((0,Te._)`await ${(0,Ps.callValidateCode)(e,t,p)}`),I(t),c||s.assign(T,!0)},A=>{s.if((0,Te._)`!(${A} instanceof ${a.ValidationError})`,()=>s.throw(A)),b(A),c||s.assign(T,!1)}),e.ok(T)}function m(){e.result((0,Ps.callValidateCode)(e,t,p),()=>I(t),()=>b(t))}function b(T){const A=(0,Te._)`${T}.errors`;s.assign(Jt.default.vErrors,(0,Te._)`${Jt.default.vErrors} === null ? ${A} : ${Jt.default.vErrors}.concat(${A})`),s.assign(Jt.default.errors,(0,Te._)`${Jt.default.vErrors}.length`)}function I(T){var A;if(!a.opts.unevaluated)return;const w=(A=r==null?void 0:r.validate)===null||A===void 0?void 0:A.evaluated;if(a.props!==!0)if(w&&!w.dynamicProps)w.props!==void 0&&(a.props=Hr.mergeEvaluated.props(s,w.props,a.props));else{const v=s.var("props",(0,Te._)`${T}.evaluated.props`);a.props=Hr.mergeEvaluated.props(s,v,a.props,Te.Name)}if(a.items!==!0)if(w&&!w.dynamicItems)w.items!==void 0&&(a.items=Hr.mergeEvaluated.items(s,w.items,a.items));else{const v=s.var("items",(0,Te._)`${T}.evaluated.items`);a.items=Hr.mergeEvaluated.items(s,v,a.items,Te.Name)}}}Ot.callRef=Jr,Ot.default=yi;var ke={};Object.defineProperty(ke,"__esModule",{value:!0}),ke.checkMetadata=void 0;const _i=Pe,$i={keyword:"metadata",schemaType:"object",code(e){Rs(e);const{gen:t,schema:r,it:n}=e;if((0,_i.alwaysValidSchema)(n,r))return;const s=t.name("valid");e.subschema({keyword:"metadata",jtdMetadata:!0},s),e.ok(s)}};function Rs({it:e,keyword:t},r){if(e.jtdMetadata!==r)throw new Error(`JTD: "${t}" cannot be used in this schema location`)}ke.checkMetadata=Rs,ke.default=$i,Object.defineProperty(Rt,"__esModule",{value:!0}),Rt.hasRef=void 0;const Os=Oe,cr=ue,Ei=Ct,js=Ae,Ts=Ot,wi=ke,Si={keyword:"ref",schemaType:"string",code(e){(0,wi.checkMetadata)(e);const{gen:t,data:r,schema:n,parentSchema:s,it:a}=e,{schemaEnv:{root:c}}=a,h=t.name("valid");s.nullable?(t.var(h,(0,cr._)`${r} === null`),t.if((0,cr.not)(h),g)):(t.var(h,!1),g()),e.ok(h);function g(){var m;const b=(m=c.schema.definitions)===null||m===void 0?void 0:m[n];if(!b)throw new Ei.default(a.opts.uriResolver,"",n,`No definition ${n}`);wn(b)||!a.opts.inlineRefs?p(b):u(b)}function p(m){const b=Os.compileSchema.call(a.self,new Os.SchemaEnv({schema:m,root:c,schemaPath:`/definitions/${n}`})),I=(0,Ts.getValidate)(e,b),T=t.const("_errs",js.default.errors);(0,Ts.callRef)(e,I,b,b.$async),t.assign(h,(0,cr._)`${T} === ${js.default.errors}`)}function u(m){const b=t.scopeValue("schema",a.opts.code.source===!0?{ref:m,code:(0,cr.stringify)(m)}:{ref:m});e.subschema({schema:m,dataTypes:[],schemaPath:cr.nil,topSchemaRef:b,errSchemaPath:`/definitions/${n}`},h)}}};function wn(e){for(const t in e){let r;if(t==="ref"||typeof(r=e[t])=="object"&&wn(r))return!0}return!1}Rt.hasRef=wn,Rt.default=Si;var Sn={},Gr={};Object.defineProperty(Gr,"__esModule",{value:!0});const bi=/t|\s/i,Pi=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Ci=/^(\d\d):(\d\d):(\d\d)(?:\.\d+)?(?:z|([+-]\d\d)(?::?(\d\d))?)$/i,Ni=[0,31,28,31,30,31,30,31,31,30,31,30,31];function Ds(e,t){const r=e.split(bi);return r.length===2&&Is(r[0])&&Ri(r[1])||t&&r.length===1&&Is(r[0])}Gr.default=Ds;function Is(e){const t=Pi.exec(e);if(!t)return!1;const r=+t[1],n=+t[2],s=+t[3];return n>=1&&n<=12&&s>=1&&(s<=Ni[n]||n===2&&s===29&&(r%100===0?r%400===0:r%4===0))}function Ri(e){const t=Ci.exec(e);if(!t)return!1;const r=+t[1],n=+t[2],s=+t[3],a=+(t[4]||0),c=+(t[5]||0);return r<=23&&n<=59&&s<=59||r-a===23&&n-c===59&&s===60}Ds.code='require("ajv/dist/runtime/timestamp").default';var Fe={};Object.defineProperty(Fe,"__esModule",{value:!0}),Fe.typeErrorParams=Fe.typeErrorMessage=Fe.typeError=void 0;const Oi=ue;function ji(e){return{message:t=>As(t,e),params:t=>ks(t,e)}}Fe.typeError=ji;function As({parentSchema:e},t){return e!=null&&e.nullable?`must be ${t} or null`:`must be ${t}`}Fe.typeErrorMessage=As;function ks({parentSchema:e},t){return(0,Oi._)`{type: ${t}, nullable: ${!!(e!=null&&e.nullable)}}`}Fe.typeErrorParams=ks,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.intRange=void 0;const t=ue,r=Gr,n=Pe,s=ke,a=Fe;e.intRange={int8:[-128,127,3],uint8:[0,255,3],int16:[-32768,32767,5],uint16:[0,65535,5],int32:[-2147483648,2147483647,10],uint32:[0,4294967295,10]};const c={message:p=>(0,a.typeErrorMessage)(p,p.schema),params:p=>(0,a.typeErrorParams)(p,p.schema)};function h(p){const{gen:u,data:m,it:b}=p,{timestamp:I,allowDate:T}=b.opts;if(I==="date")return(0,t._)`${m} instanceof Date `;const A=(0,n.useFunc)(u,r.default),w=T?(0,t._)`, true`:t.nil,v=(0,t._)`typeof ${m} == "string" && ${A}(${m}${w})`;return I==="string"?v:(0,t.or)((0,t._)`${m} instanceof Date`,v)}const g={keyword:"type",schemaType:"string",error:c,code(p){(0,s.checkMetadata)(p);const{data:u,schema:m,parentSchema:b,it:I}=p;let T;switch(m){case"boolean":case"string":T=(0,t._)`typeof ${u} == ${m}`;break;case"timestamp":{T=h(p);break}case"float32":case"float64":T=(0,t._)`typeof ${u} == "number"`;break;default:{const A=m;if(T=(0,t._)`typeof ${u} == "number" && isFinite(${u}) && !(${u} % 1)`,!I.opts.int32range&&(A==="int32"||A==="uint32"))A==="uint32"&&(T=(0,t._)`${T} && ${u} >= 0`);else{const[w,v]=e.intRange[A];T=(0,t._)`${T} && ${u} >= ${w} && ${u} <= ${v}`}}}p.pass(b.nullable?(0,t.or)((0,t._)`${u} === null`,T):T)}};e.default=g}(Sn);var bn={},qe={};Object.defineProperty(qe,"__esModule",{value:!0}),qe.checkNullableObject=qe.checkNullable=void 0;const qr=ue;function Fs({gen:e,data:t,parentSchema:r},n=qr.nil){const s=e.name("valid");return r.nullable?(e.let(s,(0,qr._)`${t} === null`),n=(0,qr.not)(s)):e.let(s,!1),[s,n]}qe.checkNullable=Fs;function Ti(e,t){const[r,n]=Fs(e,t);return[r,(0,qr._)`${n} && typeof ${e.data} == "object" && !Array.isArray(${e.data})`]}qe.checkNullableObject=Ti,Object.defineProperty(bn,"__esModule",{value:!0});const ht=ue,Di=ke,Ii=qe,Ai={keyword:"enum",schemaType:"array",error:{message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,ht._)`{allowedValues: ${e}}`},code(e){(0,Di.checkMetadata)(e);const{gen:t,data:r,schema:n,schemaValue:s,parentSchema:a,it:c}=e;if(n.length===0)throw new Error("enum must have non-empty array");if(n.length!==new Set(n).size)throw new Error("enum items must be unique");let h;const g=(0,ht._)`typeof ${r} == "string"`;if(n.length>=c.opts.loopEnum){let u;[h,u]=(0,Ii.checkNullable)(e,g),t.if(u,p)}else{if(!Array.isArray(n))throw new Error("ajv implementation error");h=(0,ht.and)(g,(0,ht.or)(...n.map(u=>(0,ht._)`${r} === ${u}`))),a.nullable&&(h=(0,ht.or)((0,ht._)`${r} === null`,h))}e.pass(h);function p(){t.forOf("v",s,u=>t.if((0,ht._)`${h} = ${r} === ${u}`,()=>t.break()))}}};bn.default=Ai;var Pn={};Object.defineProperty(Pn,"__esModule",{value:!0});const ki=Pe,Fi=ae,Ms=ue,Mi=ke,Ui=qe,Vi={keyword:"elements",schemaType:"object",error:(0,Fe.typeError)("array"),code(e){(0,Mi.checkMetadata)(e);const{gen:t,data:r,schema:n,it:s}=e;if((0,ki.alwaysValidSchema)(s,n))return;const[a]=(0,Ui.checkNullable)(e);t.if((0,Ms.not)(a),()=>t.if((0,Ms._)`Array.isArray(${r})`,()=>t.assign(a,(0,Fi.validateArray)(e)),()=>e.error())),e.ok(a)}};Pn.default=Vi;var Cn={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateProperties=e.error=void 0;const t=ae,r=Pe,n=ue,s=ke,a=qe,c=Fe;var h;(function(u){u.Additional="additional",u.Missing="missing"})(h||(h={})),e.error={message:u=>{const{params:m}=u;return m.propError?m.propError===h.Additional?"must NOT have additional properties":`must have property '${m.missingProperty}'`:(0,c.typeErrorMessage)(u,"object")},params:u=>{const{params:m}=u;return m.propError?m.propError===h.Additional?(0,n._)`{error: ${m.propError}, additionalProperty: ${m.additionalProperty}}`:(0,n._)`{error: ${m.propError}, missingProperty: ${m.missingProperty}}`:(0,c.typeErrorParams)(u,"object")}};const g={keyword:"properties",schemaType:"object",error:e.error,code:p};function p(u){(0,s.checkMetadata)(u);const{gen:m,data:b,parentSchema:I,it:T}=u,{additionalProperties:A,nullable:w}=I;if(T.jtdDiscriminator&&w)throw new Error("JTD: nullable inside discriminator mapping");if(P())throw new Error("JTD: properties and optionalProperties have common members");const[v,C]=D("properties"),[N,j]=D("optionalProperties");if(C.length===0&&j.length===0&&A)return;const[K,_]=T.jtdDiscriminator===void 0?(0,a.checkNullableObject)(u,b):[m.let("valid",!1),!0];m.if(_,()=>m.assign(K,!0).block(()=>{H(C,"properties",!0),H(j,"optionalProperties"),A||pe()})),u.pass(K);function P(){const ie=I.properties,x=I.optionalProperties;if(!(ie&&x))return!1;for(const ve in ie)if(Object.prototype.hasOwnProperty.call(x,ve))return!0;return!1}function D(ie){const x=I[ie],ve=x?(0,t.allSchemaProperties)(x):[];if(T.jtdDiscriminator&&ve.some(Ce=>Ce===T.jtdDiscriminator))throw new Error(`JTD: discriminator tag used in ${ie}`);const $e=ve.filter(Ce=>!(0,r.alwaysValidSchema)(T,x[Ce]));return[ve,$e]}function H(ie,x,ve){const $e=m.var("valid");for(const Me of ie)m.if((0,t.propertyInData)(m,b,Me,T.opts.ownProperties),()=>W(Me,x,$e),()=>Ce(Me)),u.ok($e);function Ce(Me){ve?(m.assign($e,!1),u.error(!1,{propError:h.Missing,missingProperty:Me},{schemaPath:Me})):m.assign($e,!0)}}function W(ie,x,ve){u.subschema({keyword:x,schemaProp:ie,dataProp:ie},ve)}function pe(){m.forIn("key",b,ie=>{const x=T.jtdDiscriminator===void 0?v:[T.jtdDiscriminator].concat(v),ve=Z(ie,x,"properties"),$e=Z(ie,N,"optionalProperties"),Ce=ve===!0?$e:$e===!0?ve:(0,n.and)(ve,$e);m.if(Ce,()=>{T.opts.removeAdditional?m.code((0,n._)`delete ${b}[${ie}]`):(u.error(!1,{propError:h.Additional,additionalProperty:ie},{instancePath:ie,parentSchema:!0}),T.opts.allErrors||m.break())})})}function Z(ie,x,ve){let $e;if(x.length>8){const Ce=(0,r.schemaRefOrVal)(T,I[ve],ve);$e=(0,n.not)((0,t.isOwnProperty)(m,Ce,ie))}else x.length?$e=(0,n.and)(...x.map(Ce=>(0,n._)`${ie} !== ${Ce}`)):$e=!0;return $e}}e.validateProperties=p,e.default=g})(Cn);var Nn={};Object.defineProperty(Nn,"__esModule",{value:!0});const Us=Cn,zi={keyword:"optionalProperties",schemaType:"object",error:Us.error,code(e){e.parentSchema.properties||(0,Us.validateProperties)(e)}};Nn.default=zi;var Rn={},Vs={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DiscrError=void 0,function(t){t.Tag="tag",t.Mapping="mapping"}(e.DiscrError||(e.DiscrError={}))})(Vs),Object.defineProperty(Rn,"__esModule",{value:!0});const jt=ue,Li=ke,Ki=qe,zs=Fe,Br=Vs,Hi={keyword:"discriminator",schemaType:"string",implements:["mapping"],error:{message:e=>{const{schema:t,params:r}=e;return r.discrError?r.discrError===Br.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in mapping`:(0,zs.typeErrorMessage)(e,"object")},params:e=>{const{schema:t,params:r}=e;return r.discrError?(0,jt._)`{error: ${r.discrError}, tag: ${t}, tagValue: ${r.tag}}`:(0,zs.typeErrorParams)(e,"object")}},code(e){(0,Li.checkMetadata)(e);const{gen:t,data:r,schema:n,parentSchema:s}=e,[a,c]=(0,Ki.checkNullableObject)(e,r);t.if(c),h(),t.elseIf((0,jt.not)(a)),e.error(),t.endIf(),e.ok(a);function h(){const u=t.const("tag",(0,jt._)`${r}${(0,jt.getProperty)(n)}`);t.if((0,jt._)`${u} === undefined`),e.error(!1,{discrError:Br.DiscrError.Tag,tag:u}),t.elseIf((0,jt._)`typeof ${u} == "string"`),g(u),t.else(),e.error(!1,{discrError:Br.DiscrError.Tag,tag:u},{instancePath:n}),t.endIf()}function g(u){t.if(!1);for(const m in s.mapping)t.elseIf((0,jt._)`${u} === ${m}`),t.assign(a,p(m));t.else(),e.error(!1,{discrError:Br.DiscrError.Mapping,tag:u},{instancePath:n,schemaPath:"mapping",parentSchema:!0}),t.endIf()}function p(u){const m=t.name("valid");return e.subschema({keyword:"mapping",schemaProp:u,jtdDiscriminator:n},m),m}}};Rn.default=Hi;var On={};Object.defineProperty(On,"__esModule",{value:!0});const Ls=Pe,Ks=ue,Ji=ke,Gi=qe,qi={keyword:"values",schemaType:"object",error:(0,Fe.typeError)("object"),code(e){(0,Ji.checkMetadata)(e);const{gen:t,data:r,schema:n,it:s}=e;if((0,Ls.alwaysValidSchema)(s,n))return;const[a,c]=(0,Gi.checkNullableObject)(e,r);t.if(c),t.assign(a,h()),t.elseIf((0,Ks.not)(a)),e.error(),t.endIf(),e.ok(a);function h(){const g=t.name("valid");if(s.allErrors){const u=t.let("valid",!0);return p(()=>t.assign(u,!1)),u}return t.var(g,!0),p(()=>t.break()),g;function p(u){t.forIn("key",r,m=>{e.subschema({keyword:"values",dataProp:m,dataPropType:Ls.Type.Str},g),t.if((0,Ks.not)(g),u)})}}}};On.default=qi;var jn={};Object.defineProperty(jn,"__esModule",{value:!0});const Bi={keyword:"union",schemaType:"array",trackErrors:!0,code:ae.validateUnion,error:{message:"must match a schema in union"}};jn.default=Bi,Object.defineProperty(En,"__esModule",{value:!0});const Qi=Rt,Wi=Sn,Yi=bn,Xi=Pn,Zi=Cn,xi=Nn,ec=Rn,tc=On,rc=jn,nc=ke,sc=["definitions",Qi.default,Wi.default,Yi.default,Xi.default,Zi.default,xi.default,ec.default,tc.default,rc.default,nc.default,{keyword:"additionalProperties",schemaType:"boolean"},{keyword:"nullable",schemaType:"boolean"}];En.default=sc;var Tn={};Object.defineProperty(Tn,"__esModule",{value:!0});const rt=e=>{const t={nullable:{type:"boolean"},metadata:{optionalProperties:{union:{elements:{ref:"schema"}}},additionalProperties:!0}};return e&&(t.definitions={values:{ref:"schema"}}),t},ac=e=>({optionalProperties:rt(e)}),oc=e=>({properties:{ref:{type:"string"}},optionalProperties:rt(e)}),ic=e=>({properties:{type:{enum:["boolean","timestamp","string","float32","float64","int8","uint8","int16","uint16","int32","uint32"]}},optionalProperties:rt(e)}),cc=e=>({properties:{enum:{elements:{type:"string"}}},optionalProperties:rt(e)}),uc=e=>({properties:{elements:{ref:"schema"}},optionalProperties:rt(e)}),Hs=e=>({properties:{properties:{values:{ref:"schema"}}},optionalProperties:Y({optionalProperties:{values:{ref:"schema"}},additionalProperties:{type:"boolean"}},rt(e))}),Js=e=>({properties:{optionalProperties:{values:{ref:"schema"}}},optionalProperties:Y({additionalProperties:{type:"boolean"}},rt(e))}),lc=e=>({properties:{discriminator:{type:"string"},mapping:{values:{metadata:{union:[Hs(!1),Js(!1)]}}}},optionalProperties:rt(e)}),dc=e=>({properties:{values:{ref:"schema"}},optionalProperties:rt(e)}),Gs=e=>({metadata:{union:[ac,oc,ic,cc,uc,Hs,Js,lc,dc].map(t=>t(e))}}),fc=Y({definitions:{schema:Gs(!1)}},Gs(!0));Tn.default=fc;var Dn={},ur={};Object.defineProperty(ur,"__esModule",{value:!0}),ur.jtdForms=void 0,ur.jtdForms=["elements","values","discriminator","properties","optionalProperties","enum","type","ref"];var In={};Object.defineProperty(In,"__esModule",{value:!0});const An=/[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,hc={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function qs(e){return An.lastIndex=0,'"'+(An.test(e)?e.replace(An,t=>{const r=hc[t];return typeof r=="string"?r:"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)}):e)+'"'}In.default=qs,qs.code='require("ajv/dist/runtime/quote").default',Object.defineProperty(Dn,"__esModule",{value:!0});const pc=ur,Bs=Oe,ne=ue,mc=Ct,he=Ae,gc=ae,vc=Rt,yc=Pe,_c=In,$c={elements:wc,values:Sc,discriminator:bc,properties:Ys,optionalProperties:Ys,enum:dr,type:Pc,ref:Nc};function Qs(e,t){const r=Bs.getCompilingSchema.call(this,e);if(r)return r;const{es5:n,lines:s}=this.opts.code,{ownProperties:a}=this.opts,c=new ne.CodeGen(this.scope,{es5:n,lines:s,ownProperties:a}),h=c.scopeName("serialize"),g={self:this,gen:c,schema:e.schema,schemaEnv:e,definitions:t,data:he.default.data};let p;try{this._compilations.add(e),e.serializeName=h,c.func(h,he.default.data,!1,()=>{c.let(he.default.json,(0,ne.str)``),lr(g),c.return(he.default.json)}),c.optimize(this.opts.code.optimize);const u=c.toString();p=`${c.scopeRefs(he.default.scope)}return ${u}`;const b=new Function(`${he.default.scope}`,p)(this.scope.get());this.scope.value(h,{ref:b}),e.serialize=b}catch(u){throw p&&this.logger.error("Error compiling serializer, function code:",p),delete e.serialize,delete e.serializeName,u}finally{this._compilations.delete(e)}return e}Dn.default=Qs;function lr(e){let t;for(const r of pc.jtdForms)if(r in e.schema){t=r;break}Ec(e,t?$c[t]:Oc)}function Ec(e,t){const{gen:r,schema:n,data:s}=e;if(!n.nullable)return t(e);r.if((0,ne._)`${s} === undefined || ${s} === null`,()=>r.add(he.default.json,(0,ne._)`"null"`),()=>t(e))}function wc(e){const{gen:t,schema:r,data:n}=e;t.add(he.default.json,(0,ne.str)`[`);const s=t.let("first",!0);t.forOf("el",n,a=>{Zs(e,s),lr(le(Y({},e),{schema:r.elements,data:a}))}),t.add(he.default.json,(0,ne.str)`]`)}function Sc(e){const{gen:t,schema:r,data:n}=e;t.add(he.default.json,(0,ne.str)`{`);const s=t.let("first",!0);t.forIn("key",n,a=>Ws(e,a,r.values,s)),t.add(he.default.json,(0,ne.str)`}`)}function Ws(e,t,r,n){const{gen:s,data:a}=e;Zs(e,n),dr(le(Y({},e),{data:t})),s.add(he.default.json,(0,ne.str)`:`);const c=s.const("value",(0,ne._)`${a}${(0,ne.getProperty)(t)}`);lr(le(Y({},e),{schema:r,data:c}))}function bc(e){const{gen:t,schema:r,data:n}=e,{discriminator:s}=r;t.add(he.default.json,(0,ne.str)`{${JSON.stringify(s)}:`);const a=t.const("tag",(0,ne._)`${n}${(0,ne.getProperty)(s)}`);dr(le(Y({},e),{data:a})),t.if(!1);for(const c in r.mapping){t.elseIf((0,ne._)`${a} === ${c}`);const h=r.mapping[c];Xs(le(Y({},e),{schema:h}),s)}t.endIf(),t.add(he.default.json,(0,ne.str)`}`)}function Ys(e){const{gen:t}=e;t.add(he.default.json,(0,ne.str)`{`),Xs(e),t.add(he.default.json,(0,ne.str)`}`)}function Xs(e,t){const{gen:r,schema:n,data:s}=e,{properties:a,optionalProperties:c}=n,h=m(a),g=m(c),p=b(h.concat(g));let u=!t;for(const w of h)T(w,a[w],I(w));for(const w of g){const v=I(w);r.if((0,ne.and)((0,ne._)`${v} !== undefined`,(0,gc.isOwnProperty)(r,s,w)),()=>T(w,c[w],v))}n.additionalProperties&&r.forIn("key",s,w=>r.if(A(w,p),()=>Ws(e,w,{},r.let("first",u))));function m(w){return w?Object.keys(w):[]}function b(w){if(t&&w.push(t),new Set(w).size!==w.length)throw new Error("JTD: properties/optionalProperties/disciminator overlap");return w}function I(w){return r.const("value",(0,ne._)`${s}${(0,ne.getProperty)(w)}`)}function T(w,v,C){u?u=!1:r.add(he.default.json,(0,ne.str)`,`),r.add(he.default.json,(0,ne.str)`${JSON.stringify(w)}:`),lr(le(Y({},e),{schema:v,data:C}))}function A(w,v){return v.length?(0,ne.and)(...v.map(C=>(0,ne._)`${w} !== ${C}`)):!0}}function Pc(e){const{gen:t,schema:r,data:n}=e;switch(r.type){case"boolean":t.add(he.default.json,(0,ne._)`${n} ? "true" : "false"`);break;case"string":dr(e);break;case"timestamp":t.if((0,ne._)`${n} instanceof Date`,()=>t.add(he.default.json,(0,ne._)`'"' + ${n}.toISOString() + '"'`),()=>dr(e));break;default:Cc(e)}}function dr({gen:e,data:t}){e.add(he.default.json,(0,ne._)`${(0,yc.useFunc)(e,_c.default)}(${t})`)}function Cc({gen:e,data:t}){e.add(he.default.json,(0,ne._)`"" + ${t}`)}function Nc(e){const{gen:t,self:r,data:n,definitions:s,schema:a,schemaEnv:c}=e,{ref:h}=a,g=s[h];if(!g)throw new mc.default(r.opts.uriResolver,"",h,`No definition ${h}`);if(!(0,vc.hasRef)(g))return lr(le(Y({},e),{schema:g}));const{root:p}=c,u=Qs.call(r,new Bs.SchemaEnv({schema:g,root:p}),s);t.add(he.default.json,(0,ne._)`${Rc(t,u)}(${n})`)}function Rc(e,t){return t.serialize?e.scopeValue("serialize",{ref:t.serialize}):(0,ne._)`${e.scopeValue("wrapper",{ref:t})}.serialize`}function Oc({gen:e,data:t}){e.add(he.default.json,(0,ne._)`JSON.stringify(${t})`)}function Zs({gen:e},t){e.if(t,()=>e.assign(t,!1),()=>e.add(he.default.json,(0,ne.str)`,`))}var kn={},pt={};Object.defineProperty(pt,"__esModule",{value:!0}),pt.parseJsonString=pt.parseJsonNumber=pt.parseJson=void 0;const jc=/position\s(\d+)$/;function nt(e,t){let r;nt.message=void 0;let n;t&&(e=e.slice(t));try{return nt.position=t+e.length,JSON.parse(e)}catch(s){if(n=jc.exec(s.message),!n){nt.message="unexpected end";return}r=+n[1];const a=e[r];e=e.slice(0,r),nt.position=t+r;try{return JSON.parse(e)}catch{nt.message=`unexpected token ${a}`;return}}}pt.parseJson=nt,nt.message=void 0,nt.position=0,nt.code='require("ajv/dist/runtime/parseJson").parseJson';function st(e,t,r){let n="",s;if(st.message=void 0,e[t]==="-"&&(n+="-",t++),e[t]==="0")n+="0",t++;else if(!a(r)){c();return}if(r)return st.position=t,+n;if(e[t]==="."&&(n+=".",t++,!a())){c();return}if(s=e[t],(s==="e"||s==="E")&&(n+="e",t++,s=e[t],(s==="+"||s==="-")&&(n+=s,t++),!a())){c();return}return st.position=t,+n;function a(h){let g=!1;for(;s=e[t],s>="0"&&s<="9"&&(h===void 0||h-- >0);)g=!0,n+=s,t++;return g}function c(){st.position=t,st.message=t<e.length?`unexpected token ${e[t]}`:"unexpected end"}}pt.parseJsonNumber=st,st.message=void 0,st.position=0,st.code='require("ajv/dist/runtime/parseJson").parseJsonNumber';const xs={b:"\b",f:"\f",n:`
|
|
6
|
+
`,r:"\r",t:" ",'"':'"',"/":"/","\\":"\\"},Tc="a".charCodeAt(0),Dc="0".charCodeAt(0);function mt(e,t){let r="",n;for(mt.message=void 0;n=e[t++],n!=='"';)if(n==="\\")if(n=e[t],n in xs)r+=xs[n],t++;else if(n==="u"){t++;let a=4,c=0;for(;a--;){if(c<<=4,n=e[t],n===void 0){s("unexpected end");return}if(n=n.toLowerCase(),n>="a"&&n<="f")c+=n.charCodeAt(0)-Tc+10;else if(n>="0"&&n<="9")c+=n.charCodeAt(0)-Dc;else{s(`unexpected token ${n}`);return}t++}r+=String.fromCharCode(c)}else{s(`unexpected token ${n}`);return}else if(n===void 0){s("unexpected end");return}else if(n.charCodeAt(0)>=32)r+=n;else{s(`unexpected token ${n}`);return}return mt.position=t,r;function s(a){mt.position=t,mt.message=a}}pt.parseJsonString=mt,mt.message=void 0,mt.position=0,mt.code='require("ajv/dist/runtime/parseJson").parseJsonString',Object.defineProperty(kn,"__esModule",{value:!0});const Ic=ur,ea=Oe,V=ue,Ac=Ct,X=Ae,kc=ae,Fc=Rt,Mc=Sn,Fn=pt,ta=Pe,Uc=Gr,Vc={elements:Hc,values:Jc,discriminator:qc,properties:sa,optionalProperties:sa,enum:Qc,type:Bc,ref:Wc};function ra(e,t){const r=ea.getCompilingSchema.call(this,e);if(r)return r;const{es5:n,lines:s}=this.opts.code,{ownProperties:a}=this.opts,c=new V.CodeGen(this.scope,{es5:n,lines:s,ownProperties:a}),h=c.scopeName("parse"),g={self:this,gen:c,schema:e.schema,schemaEnv:e,definitions:t,data:X.default.data,parseName:h,char:c.name("c")};let p;try{this._compilations.add(e),e.parseName=h,zc(g),c.optimize(this.opts.code.optimize);const u=c.toString();p=`${c.scopeRefs(X.default.scope)}return ${u}`;const b=new Function(`${X.default.scope}`,p)(this.scope.get());this.scope.value(h,{ref:b}),e.parse=b}catch(u){throw p&&this.logger.error("Error compiling parser, function code:",p),delete e.parse,delete e.parseName,u}finally{this._compilations.delete(e)}return e}kn.default=ra;const Mn=(0,V._)`undefined`;function zc(e){const{gen:t,parseName:r,char:n}=e;t.func(r,(0,V._)`${X.default.json}, ${X.default.jsonPos}, ${X.default.jsonPart}`,!1,()=>{t.let(X.default.data),t.let(n),t.assign((0,V._)`${r}.message`,Mn),t.assign((0,V._)`${r}.position`,Mn),t.assign(X.default.jsonPos,(0,V._)`${X.default.jsonPos} || 0`),t.const(X.default.jsonLen,(0,V._)`${X.default.json}.length`),Qr(e),Kn(e),t.if(X.default.jsonPart,()=>{t.assign((0,V._)`${r}.position`,X.default.jsonPos),t.return(X.default.data)}),t.if((0,V._)`${X.default.jsonPos} === ${X.default.jsonLen}`,()=>t.return(X.default.data)),Gt(e)})}function Qr(e){let t;for(const r of Ic.jtdForms)if(r in e.schema){t=r;break}t?Kc(e,Vc[t]):zn(e)}const Lc=ca(!0,ca(!1,Gt));function Kc(e,t){const{gen:r,schema:n,data:s}=e;if(!n.nullable)return t(e);fr(e,"null",t,()=>r.assign(s,null))}function Hc(e){const{gen:t,schema:r,data:n}=e;Be(e,"[");const s=t.let("i",0);t.assign(n,(0,V._)`[]`),Un(e,"]",()=>{const a=t.let("el");Qr(le(Y({},e),{schema:r.elements,data:a})),t.assign((0,V._)`${n}[${s}++]`,a)})}function Jc(e){const{gen:t,schema:r,data:n}=e;Be(e,"{"),t.assign(n,(0,V._)`{}`),Un(e,"}",()=>Gc(e,r.values))}function Un(e,t,r){na(e,t,r),Be(e,t)}function na(e,t,r){const{gen:n}=e;n.for((0,V._)`;${X.default.jsonPos}<${X.default.jsonLen} && ${Wr(1)}!==${t};`,()=>{r(),fr(e,",",()=>n.break(),s)});function s(){fr(e,t,()=>{},Gt)}}function Gc(e,t){const{gen:r}=e,n=r.let("key");Tt(le(Y({},e),{data:n})),Be(e,":"),ia(e,n,t)}function qc(e){const{gen:t,data:r,schema:n}=e,{discriminator:s,mapping:a}=n;Be(e,"{"),t.assign(r,(0,V._)`{}`);const c=t.const("pos",X.default.jsonPos),h=t.let("value"),g=t.let("tag");na(e,"}",()=>{const p=t.let("key");Tt(le(Y({},e),{data:p})),Be(e,":"),t.if((0,V._)`${p} === ${s}`,()=>{Tt(le(Y({},e),{data:g})),t.assign((0,V._)`${r}[${p}]`,g),t.break()},()=>zn(le(Y({},e),{data:h})))}),t.assign(X.default.jsonPos,c),t.if((0,V._)`${g} === undefined`),at(e,(0,V.str)`discriminator tag not found`);for(const p in a)t.elseIf((0,V._)`${g} === ${p}`),aa(le(Y({},e),{schema:a[p]}),s);t.else(),at(e,(0,V.str)`discriminator value not in schema`),t.endIf()}function sa(e){const{gen:t,data:r}=e;Be(e,"{"),t.assign(r,(0,V._)`{}`),aa(e)}function aa(e,t){const{gen:r,schema:n,data:s}=e,{properties:a,optionalProperties:c,additionalProperties:h}=n;if(Un(e,"}",()=>{const g=r.let("key");if(Tt(le(Y({},e),{data:g})),Be(e,":"),r.if(!1),oa(e,g,a),oa(e,g,c),t){r.elseIf((0,V._)`${g} === ${t}`);const p=r.let("tag");Tt(le(Y({},e),{data:p}))}r.else(),h?zn(le(Y({},e),{data:(0,V._)`${s}[${g}]`})):at(e,(0,V.str)`property ${g} not allowed`),r.endIf()}),a){const g=(0,kc.hasPropFunc)(r),p=(0,V.and)(...Object.keys(a).map(u=>(0,V._)`${g}.call(${s}, ${u})`));r.if((0,V.not)(p),()=>at(e,(0,V.str)`missing required properties`))}}function oa(e,t,r={}){const{gen:n}=e;for(const s in r)n.elseIf((0,V._)`${t} === ${s}`),ia(e,t,r[s])}function ia(e,t,r){Qr(le(Y({},e),{schema:r,data:(0,V._)`${e.data}[${t}]`}))}function Bc(e){const{gen:t,schema:r,data:n,self:s}=e;switch(r.type){case"boolean":Lc(e);break;case"string":Tt(e);break;case"timestamp":{Tt(e);const a=(0,ta.useFunc)(t,Uc.default),{allowDate:c,parseDate:h}=s.opts,g=c?(0,V._)`!${a}(${n}, true)`:(0,V._)`!${a}(${n})`,p=h?(0,V.or)(g,(0,V._)`(${n} = new Date(${n}), false)`,(0,V._)`isNaN(${n}.valueOf())`):g;t.if(p,()=>at(e,(0,V.str)`invalid timestamp`));break}case"float32":case"float64":Vn(e);break;default:{const a=r.type;if(!s.opts.int32range&&(a==="int32"||a==="uint32"))Vn(e,16),a==="uint32"&&t.if((0,V._)`${n} < 0`,()=>at(e,(0,V.str)`integer out of range`));else{const[c,h,g]=Mc.intRange[a];Vn(e,g),t.if((0,V._)`${n} < ${c} || ${n} > ${h}`,()=>at(e,(0,V.str)`integer out of range`))}}}}function Tt(e){Be(e,'"'),Ln(e,Fn.parseJsonString)}function Qc(e){const{gen:t,data:r,schema:n}=e,s=n.enum;Be(e,'"'),t.if(!1);for(const a of s){const c=JSON.stringify(a).slice(1);t.elseIf((0,V._)`${Wr(c.length)} === ${c}`),t.assign(r,(0,V.str)`${a}`),t.add(X.default.jsonPos,c.length)}t.else(),Gt(e),t.endIf()}function Vn(e,t){const{gen:r}=e;Kn(e),r.if((0,V._)`"-0123456789".indexOf(${Wr(1)}) < 0`,()=>Gt(e),()=>Ln(e,Fn.parseJsonNumber,t))}function ca(e,t){return r=>{const{gen:n,data:s}=r;fr(r,`${e}`,()=>t(r),()=>n.assign(s,e))}}function Wc(e){const{gen:t,self:r,definitions:n,schema:s,schemaEnv:a}=e,{ref:c}=s,h=n[c];if(!h)throw new Ac.default(r.opts.uriResolver,"",c,`No definition ${c}`);if(!(0,Fc.hasRef)(h))return Qr(le(Y({},e),{schema:h}));const{root:g}=a,p=ra.call(r,new ea.SchemaEnv({schema:h,root:g}),n);ua(e,Yc(t,p),!0)}function Yc(e,t){return t.parse?e.scopeValue("parse",{ref:t.parse}):(0,V._)`${e.scopeValue("wrapper",{ref:t})}.parse`}function zn(e){Ln(e,Fn.parseJson)}function Ln(e,t,r){ua(e,(0,ta.useFunc)(e.gen,t),r)}function ua(e,t,r){const{gen:n,data:s}=e;n.assign(s,(0,V._)`${t}(${X.default.json}, ${X.default.jsonPos}${r?(0,V._)`, ${r}`:V.nil})`),n.assign(X.default.jsonPos,(0,V._)`${t}.position`),n.if((0,V._)`${s} === undefined`,()=>at(e,(0,V._)`${t}.message`))}function Be(e,t){fr(e,t,Gt)}function fr(e,t,r,n){const{gen:s}=e,a=t.length;Kn(e),s.if((0,V._)`${Wr(a)} === ${t}`,()=>{s.add(X.default.jsonPos,a),n==null||n(e)},()=>r(e))}function Kn({gen:e,char:t}){e.code((0,V._)`while((${t}=${X.default.json}[${X.default.jsonPos}],${t}===" "||${t}==="\\n"||${t}==="\\r"||${t}==="\\t"))${X.default.jsonPos}++;`)}function Wr(e){return e===1?(0,V._)`${X.default.json}[${X.default.jsonPos}]`:(0,V._)`${X.default.json}.slice(${X.default.jsonPos}, ${X.default.jsonPos}+${e})`}function Gt(e){at(e,(0,V._)`"unexpected token " + ${X.default.json}[${X.default.jsonPos}]`)}function at({gen:e,parseName:t},r){e.assign((0,V._)`${t}.message`,r),e.assign((0,V._)`${t}.position`,X.default.jsonPos),e.return(Mn)}(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;const r=Bn,n=En,s=Tn,a=Dn,c=kn,h="JTD-meta-schema";class g extends r.default{constructor(b={}){super(le(Y({},b),{jtd:!0}))}_addVocabularies(){super._addVocabularies(),this.addVocabulary(n.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema(),this.opts.meta&&this.addMetaSchema(s.default,h,!1)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(h)?h:void 0)}compileSerializer(b){const I=this._addSchema(b);return I.serialize||this._compileSerializer(I)}compileParser(b){const I=this._addSchema(b);return I.parse||this._compileParser(I)}_compileSerializer(b){if(a.default.call(this,b,b.schema.definitions||{}),!b.serialize)throw new Error("ajv implementation error");return b.serialize}_compileParser(b){if(c.default.call(this,b,b.schema.definitions||{}),!b.parse)throw new Error("ajv implementation error");return b.parse}}e.exports=t=g,Object.defineProperty(t,"__esModule",{value:!0}),t.default=g;var p=He;Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return p.KeywordCxt}});var u=ue;Object.defineProperty(t,"_",{enumerable:!0,get:function(){return u._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return u.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return u.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return u.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return u.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return u.CodeGen}})})(on,on.exports);var Xc=J&&J.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(St,"__esModule",{value:!0}),St.Validate=St.AddSchema=void 0;const Zc=Xc(on.exports),la=new Zc.default,xc=(e,t)=>e(t)?null:e.errors;function eu(e,t){la.addSchema(t,e)}St.AddSchema=eu;function tu(e,t){const r=la.getSchema(e);if(r)return xc(r,t)}St.Validate=tu,Object.defineProperty(kr,"__esModule",{value:!0}),kr.STSOptionsBase=void 0;const ru=St;class nu{constructor(t=null){nr(this,"_options");this._options=t,t!==null&&(typeof t.validator=="undefined"||(0,ru.Validate)(t.validator,t))}get options(){return this._options}}kr.STSOptionsBase=nu;var qt={};Object.defineProperty(qt,"__esModule",{value:!0}),qt.JestSleep=qt.Sleep=void 0;async function da(e=1e3){return new Promise(t=>setTimeout(t,e))}qt.Sleep=da;async function su(){return da(100)}qt.JestSleep=su;var fa={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.compareParameterTypes=e.OAuth2ParameterErrorType=e.OIDCAddressClaim=e.OIDCStandardClaim=e.OAuth2ParameterType=void 0,function(n){n.AUDIENCE="AUDIENCE",n.CLIENT_ID="client_id",n.CLIENT_SECRET="client_secret",n.RESPONSE_TYPE="response_type",n.SCOPE="scope",n.STATE="state",n.REDIRECT_URI="redirect_uri",n.ERROR="error",n.ERROR_DESCRIPTION="error_description",n.ERROR_CODES="error_codes",n.ERROR_URI="error_uri",n.GRANT_TYPE="grant_type",n.CODE="code",n.ACCESS_TOKEN="access_token",n.TOKEN_TYPE="token_type",n.EXPIRES_IN="expires_in",n.USERNAME="username",n.PASSWORD="password",n.REFRESH_TOKEN="refresh_token",n.RESPONSE_MODE="response_mode",n.TIMESTAMP="timestamp",n.TRACE_ID="trace_id",n.CORRELATION_ID="correlation_id"}(e.OAuth2ParameterType||(e.OAuth2ParameterType={})),function(n){n.SUB="sub",n.NAME="name",n.GIVEN_NAME="given_name",n.FAMILY_NAME="family_name",n.MIDDLE_NAME="middle_name",n.NICKNAME="nickname",n.PREFERRED_USERNAME="preferred_username",n.PROFILE="profile",n.PICTURE="picture",n.WEBSITE="website",n.EMAIL="email",n.EMAIL_VERIFIED="email_verified",n.GENDER="gender",n.BIRTHDATE="birthdate",n.ZONEINFO="zoneinfo",n.LOCALE="locale",n.PHONE_NUMBER="phone_number",n.PHONE_NUMBER_VERIFIED="phone_number_verified",n.ADDRESS="address",n.CLIENT_SECRET="client_secret",n.NONCE="nonce"}(e.OIDCStandardClaim||(e.OIDCStandardClaim={})),function(n){n.FORMATTED="formatted",n.STREET_ADDRESS="street_address",n.LOCALITY="locality",n.REGION="region",n.COUNTRY="country"}(e.OIDCAddressClaim||(e.OIDCAddressClaim={}));class t{}nr(t,"NOT_EQUAL",{code:"STS_OAUTH2_ERR_0001",description:"Parameter values not equal."}),nr(t,"NOT_PRESENT",{code:"STS_OAUTH2_ERR_0002",description:"Parameter not provided."}),nr(t,"INVALID_FORMAT",{code:"STS_OAUTH2_ERR_0003",description:"Parameter value format invalid."}),nr(t,"EXPIRED",{code:"STS_OAUTH2_ERR_0004",description:"Parameter value expired."}),e.OAuth2ParameterErrorType=t;function r(n,s,a){const c=[];for(let h=0;h<a.length;h++){const g=a[h];if(n[h].localeCompare(s[h])!==0){const p={error:t.NOT_EQUAL.code,error_description:t.NOT_EQUAL.description,timestamp:Date.now(),details:`${t.NOT_EQUAL.description}: Parameter: [${g}]`};c.push(p)}}return c}e.compareParameterTypes=r})(fa),function(e){var t=J&&J.__createBinding||(Object.create?function(s,a,c,h){h===void 0&&(h=c);var g=Object.getOwnPropertyDescriptor(a,c);(!g||("get"in g?!a.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return a[c]}}),Object.defineProperty(s,h,g)}:function(s,a,c,h){h===void 0&&(h=c),s[h]=a[c]}),r=J&&J.__exportStar||function(s,a){for(var c in s)c!=="default"&&!Object.prototype.hasOwnProperty.call(a,c)&&t(a,s,c)};Object.defineProperty(e,"__esModule",{value:!0}),e.$stsgdf=e.$stsgd=void 0,r(Ar,e),r(kr,e),r(qt,e),r(St,e),r(fa,e),e.$stsgd={};function n(){return e.$stsgd}e.$stsgdf=n}(Ir);class au{constructor(){this.DigestMessage=async function(t){const n=new TextEncoder().encode(t),s=await crypto.subtle.digest("SHA-256",n),a=Array.from(new Uint8Array(s));return btoa(String.fromCharCode(...a))},this.CreateRandomString=(t=43)=>{const r=Array.from(crypto.getRandomValues(new Uint8Array(t)));return btoa(String.fromCharCode(...r))},this.CreateRandomStringEx=()=>{const t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let r="";return Array.from(crypto.getRandomValues(new Uint8Array(43))).forEach(s=>r+=t[s%t.length]),r}}}class ou{constructor(){this.DecodeQueryParams=t=>{const r={};return Object.keys(t).filter(n=>typeof t[n]!="undefined").map(n=>{r[decodeURIComponent(n)]=decodeURIComponent(t[n])}),r},this.CreateQueryParams=t=>Object.keys(t).filter(r=>typeof t[r]!="undefined").map(r=>Array.isArray(t[r])?encodeURIComponent(r)+"="+encodeURIComponent(t[r].join(" ")):encodeURIComponent(r)+"="+encodeURIComponent(t[r])).join("&"),this._GetQueryParams=t=>{let r={};const n=t.split("?");if(n.length==2){const s=n[1].split("&"),a={};let c="";s.forEach(function(h){c=h.split("="),c.length==2&&(a[c[0]]=c[1])}),r=this.DecodeQueryParams(a)}return r},this.GetQueryParams=()=>this._GetQueryParams(window.location.href)}}var ha=(e=>(e.CODE="code",e.ID_TOKEN="id_token",e.TOKEN="token",e))(ha||{}),pa=(e=>(e.QUERY="query",e.FRAGMENT="fragment",e.FORM_POST="form_post",e))(pa||{}),ma=(e=>(e.CLIENT_CREDENTIALS="client_credentials",e.AUTHORIZATION_CODE="authorization_code",e.REFRESH_TOKEN="refresh_token",e))(ma||{}),ot=(e=>(e.RESTORE_SESSION="RestoreSession",e.AUTHORIZE="Authorize",e.HANDLE_REDIRECT="HandleRedirect",e.LOGOUT="Logout",e.AUTHENTICATE_EVENT="AuthenticateEvent",e.ERROR="Error",e))(ot||{}),hr=J&&J.__assign||function(){return hr=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},hr.apply(this,arguments)};function pr(e,t){if(!t)return"";var r="; "+e;return t===!0?r:r+"="+t}function iu(e){if(typeof e.expires=="number"){var t=new Date;t.setMilliseconds(t.getMilliseconds()+e.expires*864e5),e.expires=t}return pr("Expires",e.expires?e.expires.toUTCString():"")+pr("Domain",e.domain)+pr("Path",e.path)+pr("Secure",e.secure)+pr("SameSite",e.sameSite)}function cu(e,t,r){return encodeURIComponent(e).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/\(/g,"%28").replace(/\)/g,"%29")+"="+encodeURIComponent(t).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent)+iu(r)}function uu(e){for(var t={},r=e?e.split("; "):[],n=/(%[\dA-F]{2})+/gi,s=0;s<r.length;s++){var a=r[s].split("="),c=a.slice(1).join("=");c.charAt(0)==='"'&&(c=c.slice(1,-1));try{var h=a[0].replace(n,decodeURIComponent);t[h]=c.replace(n,decodeURIComponent)}catch{}}return t}function lu(){return uu(document.cookie)}function du(e){return lu()[e]}var fu=du;function ga(e,t,r){document.cookie=cu(e,t,hr({path:"/"},r))}var hu=ga;function pu(e,t){ga(e,"",hr(hr({},t),{expires:-1}))}var mu=pu;const Yr=qn(`proc:${process.pid}:storage.ts`);var va=(e=>(e.LOCAL_STORAGE="LocalStorage",e.SESSION_STORAGE="SessionStorage",e.COOKIE_STORAGE="CookieStorage",e.MEMORY_STORAGE="MemoryStorage",e))(va||{});class gu{constructor(){this.get=t=>{const r=fu(t);return r?JSON.parse(r):null},this.set=(t,r,n={})=>{let s={};window.location.protocol==="https:"&&(s={secure:!0,sameSite:"none"}),n&&n.daysUntilExpire?s.expires=n.daysUntilExpire:s.expires=1,Yr(`CookieStorage.set: key: ${t}, value: [${r}]`),hu(t,JSON.stringify(r),s)},this.remove=t=>{mu(t)}}}class vu{constructor(){this.get=t=>{const r=sessionStorage.getItem(t);return typeof r=="undefined"||r===null?null:JSON.parse(r)},this.set=(t,r)=>{Yr(`SessionStorage.set: key: ${t}, value: [${r}]`),sessionStorage.setItem(t,JSON.stringify(r))},this.remove=t=>{sessionStorage.removeItem(t)}}}class yu{constructor(){this.get=t=>{const r=localStorage.getItem(t);return typeof r=="undefined"||r===null?null:JSON.parse(r)},this.set=(t,r)=>{Yr(`LocalStorage.set: key: ${t}, value: [${r}]`),localStorage.setItem(t,JSON.stringify(r))},this.remove=t=>{localStorage.removeItem(t)}}}class _u{constructor(){ge(this,Dt,void 0);re(this,Dt,{}),this.get=t=>{const r=Q(this,Dt)[t];return typeof r=="undefined"||r===null?null:r},this.set=(t,r)=>{Yr(`MemoryStorage.set: key: ${t}, value: [${r}]`),Q(this,Dt)[t]=r},this.remove=t=>{delete Q(this,Dt)[t]}}}Dt=new WeakMap;class $u{constructor(t){ge(this,gt,null);switch(t.clientStorageType){case"SessionStorage":re(this,gt,new vu);break;case"LocalStorage":re(this,gt,new yu);break;case"CookieStorage":re(this,gt,new gu);break;case"MemoryStorage":re(this,gt,new _u);break;default:throw new Error(`Unknown [${t.clientStorageType}] storage type.`)}}GetStorage(){return Q(this,gt)}}gt=new WeakMap;function Hn(e){this.message=e}Hn.prototype=new Error,Hn.prototype.name="InvalidCharacterError";var ya=typeof window!="undefined"&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new Hn("'atob' failed: The string to be decoded is not correctly encoded.");for(var r,n,s=0,a=0,c="";n=t.charAt(a++);~n&&(r=s%4?64*r+n:n,s++%4)?c+=String.fromCharCode(255&r>>(-2*s&6)):0)n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(n);return c};function Eu(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return function(r){return decodeURIComponent(ya(r).replace(/(.)/g,function(n,s){var a=s.charCodeAt(0).toString(16).toUpperCase();return a.length<2&&(a="0"+a),"%"+a}))}(t)}catch{return ya(t)}}function Xr(e){this.message=e}function wu(e,t){if(typeof e!="string")throw new Xr("Invalid token specified");var r=(t=t||{}).header===!0?0:1;try{return JSON.parse(Eu(e.split(".")[r]))}catch(n){throw new Xr("Invalid token specified: "+n.message)}}Xr.prototype=new Error,Xr.prototype.name="InvalidTokenError";const Su=qn(`proc:${process.pid}:stsoauth2manager.ts`);class _a{constructor(t,r){ge(this,mr,void 0);ge(this,It,void 0);ge(this,vt,void 0);ge(this,Zr,void 0);ge(this,xr,void 0);ge(this,At,void 0);ge(this,en,void 0);ge(this,gr,void 0);ge(this,kt,void 0);ge(this,tn,void 0);ge(this,Bt,void 0);ge(this,vr,void 0);ge(this,yt,void 0);ge(this,Qt,void 0);ge(this,_t,void 0);ge(this,$t,void 0);ge(this,yr,void 0);ge(this,it,void 0);ge(this,_r,void 0);ge(this,$r,void 0);ge(this,Er,void 0);ge(this,wr,void 0);re(this,mr,null),re(this,It,null),re(this,vt,null),re(this,Zr,new au),re(this,xr,new ou),re(this,At,"authorize_options.stsmda.com.au"),re(this,en,"session.stsmda.com.au"),re(this,gr,null),re(this,kt,null),re(this,tn,{}),re(this,vr,0),re(this,yt,{}),re(this,Qt,1e3),re(this,_t,null),re(this,$t,null),re(this,yr,a=>{const c=a.data;if(c.messageId===-1)switch(c.command){case ot.AUTHENTICATE_EVENT:Q(this,$r).call(this,c.payload);break;case ot.ERROR:Q(this,_r).call(this,c.payload);break;default:throw new Error(`ProcessMessageResponse command [${c.command}] not valid.`)}else{const h=Q(this,yt)[c.messageId];if(h)h(c);else throw new Error(`Message: [${c.messageId}] does not exists in callBacks.`)}}),re(this,it,a=>(a.messageId=Aa(this,vr)._++,new Promise((c,h)=>{const g=setTimeout(()=>{delete Q(this,yt)[a.messageId],h(`Message: [${a.messageId}] timeout error after: [${Q(this,Qt)}] ms.`)},Q(this,Qt));Q(this,yt)[a.messageId]=p=>{clearTimeout(g),delete Q(this,yt)[a.messageId],c(p)},Q(this,Bt).postMessage(a)}))),re(this,_r,a=>{Q(this,vt).commit("AuthorizeError",{message:a}),setTimeout(()=>{Q(this,It).replace("/error")},0)}),re(this,$r,a=>{Q(this,kt).authenticateEvent&&Q(this,kt).authenticateEvent(a),Q(this,vt).commit("stsOAuth2SDK/SessionData",a)}),re(this,Er,(a,c)=>{c.beforeEach(async(h,g)=>{const p=a.config.globalProperties.$store,u=a.config.globalProperties.$sts;if(Su(`beforeEach: from: [${g.path}], to: [${h.path}]`),p.getters["stsOAuth2SDK/LoggedIn"]===!1){if(console.log("Not logged in"),h.path.localeCompare("/authorize")===0)return console.log("to = /authorize"),!0;if(h.path.localeCompare("/consent")===0&&typeof p.getters.Session.sessionId!="undefined"||h.path.localeCompare("/logout")===0||h.path.localeCompare("/error")===0||h.path.localeCompare("/logout")===0)return!0;const m=h.query;if(m[Ir.OAuth2ParameterType.CODE]||m[Ir.OAuth2ParameterType.ERROR])return console.log(`#SetupRout:str = [${m}]`),await u.om.HandleRedirect(m)?(setTimeout(()=>{window.history.replaceState({},document.title,window.location.origin+"/")},0),!0):(Q(this,It).replace("/error"),!1);const b=await u.om.RestoreSession();return console.log(`#SetupRoute:sessionRestored [${b}]`),b!==!0?(console.log("Session not restored - Need to Authorize"),u.om.Authorize(),!1):"/"}else return h.path.localeCompare("/consent")===0?"/":h.path.localeCompare("/authorize")===0?(c.replace({path:"/"}),!1):h.path.localeCompare("/logout")===0?(c.replace({path:"/"}),!1):!0})}),re(this,wr,()=>{Q(this,vt).registerModule("stsOAuth2SDK",{namespaced:!0,state(){return{sessionData:{}}},getters:{SessionData(a){return a.sessionData},LoggedIn(a){return!(typeof a.sessionData=="undefined"||a.sessionData===null)},UserDetails(a){if(a.sessionData){const c=a.sessionData;return wu(c)}else return null}},mutations:{SessionData(a,c){a.sessionData=c,console.log(`commit [sessionData]: ${JSON.stringify(c)}`)}}},{preserveState:!0})}),this.RestoreSession=async()=>{try{return(await Q(this,it).call(this,{command:ot.RESTORE_SESSION})).payload}catch(a){return console.log(`RestoreSession Error: ${a}`),!1}},this.Authorize=async()=>{try{const a=await Q(this,it).call(this,{command:ot.AUTHORIZE});Q(this,$t).set(Q(this,At),a.payload.authorizeOptions);const c=a.payload.url;window.location.replace(c)}catch(a){console.log(`Authorize Error: ${a}`)}},this.HandleRedirect=async a=>{try{let c=null;if(a[Ir.OAuth2ParameterType.CODE]){const h=Q(this,$t).get(Q(this,At));Q(this,$t).remove(Q(this,At)),c=await Q(this,it).call(this,{command:ot.HANDLE_REDIRECT,payload:{queryVars:a,authorizeOptions:h}})}else c=await Q(this,it).call(this,{command:ot.HANDLE_REDIRECT,payload:a});return c.payload}catch(c){return console.log(`HandleRedirect Error: ${c}`),!1}},this.Logout=async()=>{try{return(await Q(this,it).call(this,{command:ot.LOGOUT})).payload}catch(a){return console.log(`Logout Error: ${a}`),!1}},re(this,kt,r),re(this,mr,t.config.globalProperties.$sts.storage),re(this,vt,t.config.globalProperties.$store),re(this,gr,t.config.globalProperties.$sts.aic.PrimaryPublishInstrumentController),re(this,It,t.config.globalProperties.$router),re(this,$t,new $u({clientStorageType:va.SESSION_STORAGE}).GetStorage()),re(this,_t,new Worker("/assets/stsoauth2worker.56b3b966.js",{type:"module"})),Q(this,_t).onmessage=a=>{console.log(`this.#worker.onmessage = [${a}]`)},Q(this,_t).onerror=function(a){console.log(`this.#worker.onerror = [${a}]`)};const{port1:n,port2:s}=new MessageChannel;re(this,Bt,n),Q(this,_t).postMessage(s,[s]),Q(this,Bt).onmessage=a=>{Q(this,yr).call(this,a)},Q(this,wr).call(this),Q(this,Er).call(this,t,r.router)}}mr=new WeakMap,It=new WeakMap,vt=new WeakMap,Zr=new WeakMap,xr=new WeakMap,At=new WeakMap,en=new WeakMap,gr=new WeakMap,kt=new WeakMap,tn=new WeakMap,Bt=new WeakMap,vr=new WeakMap,yt=new WeakMap,Qt=new WeakMap,_t=new WeakMap,$t=new WeakMap,yr=new WeakMap,it=new WeakMap,_r=new WeakMap,$r=new WeakMap,Er=new WeakMap,wr=new WeakMap;const bu={install:(e,t)=>{const r=new _a(e,t);e.config.globalProperties.$sts.om=r}};B.AuthorizeOptionsResponseMode=pa,B.AuthorizeOptionsResponseType=ha,B.IOauth2ListenerCommand=ot,B.OAuthGrantTypes=ma,B.STSOAuth2Manager=_a,B.STSOAuth2ManagerPlugin=bu,Object.defineProperties(B,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/package.json
CHANGED
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nsshunt/stsoauth2plugin",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.10",
|
|
4
4
|
"description": "STS OAuth2 VUE Plugin",
|
|
5
|
-
"
|
|
6
|
-
|
|
5
|
+
"files": [
|
|
6
|
+
"dist",
|
|
7
|
+
"src",
|
|
8
|
+
"types"
|
|
9
|
+
],
|
|
10
|
+
"main": "./dist/stsoauth2plugin.umd.js",
|
|
11
|
+
"module": "./dist/stsoauth2plugin.es.js",
|
|
7
12
|
"exports": {
|
|
8
13
|
".": {
|
|
9
|
-
"import": "./dist/
|
|
10
|
-
"require": "./dist/
|
|
14
|
+
"import": "./dist/stsoauth2plugin.es.js",
|
|
15
|
+
"require": "./dist/stsoauth2plugin.umd.js"
|
|
11
16
|
}
|
|
12
17
|
},
|
|
13
18
|
"types": "./types/index.d.ts",
|
|
@@ -15,7 +20,8 @@
|
|
|
15
20
|
"lint": "eslint . --ext js,jsx,ts,tsx --fix",
|
|
16
21
|
"test": "jest --detectOpenHandles --no-cache",
|
|
17
22
|
"testwatch": "jest --watchAll --detectOpenHandles --no-cache",
|
|
18
|
-
"build": "
|
|
23
|
+
"build": "tsc && vite build",
|
|
24
|
+
"build2": "vue-tsc --noEmit && vite build"
|
|
19
25
|
},
|
|
20
26
|
"repository": {
|
|
21
27
|
"type": "git",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CryptoUtils.d.ts","sourceRoot":"","sources":["../../src/Utils/CryptoUtils.ts"],"names":[],"mappings":"AAAA,qBAAa,WAAW;IACvB,aAAa,oCASZ;IAED,kBAAkB,4BAOjB;IAED,oBAAoB,eAOnB;CACD;AAED,eAAe,WAAW,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QueryParams.d.ts","sourceRoot":"","sources":["../../src/Utils/QueryParams.ts"],"names":[],"mappings":"AAEA,cAAM,WAAW;IAChB,iBAAiB,sBAQhB;IAED,iBAAiB,0BAWhB;IAED,eAAe,qBAcd;IAED,cAAc,WAEb;CACD;AAED,eAAe,WAAW,CAAC"}
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,cAAc,kBAAkB,CAAA;AAChC,cAAc,oBAAoB,CAAA;AAElC,eAAO,MAAM,sBAAsB;;CAKlC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=index.test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../src/index.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { JSONObject } from "@nsshunt/stsutils";
|
|
2
|
+
export interface IStsStorage<T> {
|
|
3
|
+
get(key: string): T;
|
|
4
|
+
set(key: string, value: T, options?: JSONObject): void;
|
|
5
|
+
remove(key: string): void;
|
|
6
|
+
}
|
|
7
|
+
export declare enum ClientStorageType {
|
|
8
|
+
LOCAL_STORAGE = "LocalStorage",
|
|
9
|
+
SESSION_STORAGE = "SessionStorage",
|
|
10
|
+
COOKIE_STORAGE = "CookieStorage",
|
|
11
|
+
MEMORY_STORAGE = "MemoryStorage"
|
|
12
|
+
}
|
|
13
|
+
export declare class ClientStorageOptions {
|
|
14
|
+
clientStorageType: ClientStorageType;
|
|
15
|
+
storageOptions?: JSONObject;
|
|
16
|
+
}
|
|
17
|
+
export declare class ClientStorageFactory<T> {
|
|
18
|
+
#private;
|
|
19
|
+
constructor(options: ClientStorageOptions);
|
|
20
|
+
GetStorage(): IStsStorage<T>;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=stsStorage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stsStorage.d.ts","sourceRoot":"","sources":["../src/stsStorage.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,MAAM,WAAW,WAAW,CAAC,CAAC;IAC7B,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,CAAC,CAAA;IACnB,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,CAAC,EAAE,UAAU,GAAG,IAAI,CAAA;IACtD,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;CACzB;AAED,oBAAY,iBAAiB;IAC5B,aAAa,iBAAiB;IAC9B,eAAe,mBAAmB;IAClC,cAAc,kBAAkB;IAChC,cAAc,kBAAkB;CAChC;AA2GD,qBAAa,oBAAoB;IAChC,iBAAiB,EAAE,iBAAiB,CAAoC;IACxE,cAAc,CAAC,EAAE,UAAU,CAAA;CAC3B;AAED,qBAAa,oBAAoB,CAAC,CAAC;;gBAItB,OAAO,EAAE,oBAAoB;IAoBzC,UAAU,IAAI,WAAW,CAAC,CAAC,CAAC;CAI5B"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { JSONObject } from '@nsshunt/stsutils';
|
|
2
|
+
import { ISTSOAuth2ManagerOptions } from './stsoauth2types';
|
|
3
|
+
export declare class STSOAuth2Manager {
|
|
4
|
+
#private;
|
|
5
|
+
constructor(app: any, options: ISTSOAuth2ManagerOptions);
|
|
6
|
+
RestoreSession: () => Promise<boolean>;
|
|
7
|
+
Authorize: () => Promise<void>;
|
|
8
|
+
HandleRedirect: (queryVars: JSONObject) => Promise<boolean>;
|
|
9
|
+
Logout: () => Promise<boolean>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=stsoauth2manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stsoauth2manager.d.ts","sourceRoot":"","sources":["../src/stsoauth2manager.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAuB,MAAM,mBAAmB,CAAC;AAKpE,OAAO,EACN,wBAAwB,EAAkF,MAAM,kBAAkB,CAAA;AAWnI,qBAAa,gBAAgB;;gBAkBhB,GAAG,KAAA,EAAE,OAAO,EAAE,wBAAwB;IA0PlD,cAAc,QAAY,QAAQ,OAAO,CAAC,CAQzC;IAED,SAAS,QAAa,QAAQ,IAAI,CAAC,CASlC;IAED,cAAc,cAAqB,UAAU,KAAG,QAAQ,OAAO,CAAC,CAoB/D;IAED,MAAM,QAAa,QAAQ,OAAO,CAAC,CAQlC;CACD"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { Router } from 'vue-router';
|
|
2
|
+
export declare enum AuthorizeOptionsResponseType {
|
|
3
|
+
CODE = "code",
|
|
4
|
+
ID_TOKEN = "id_token",
|
|
5
|
+
TOKEN = "token"
|
|
6
|
+
}
|
|
7
|
+
export declare enum AuthorizeOptionsResponseMode {
|
|
8
|
+
QUERY = "query",
|
|
9
|
+
FRAGMENT = "fragment",
|
|
10
|
+
FORM_POST = "form_post"
|
|
11
|
+
}
|
|
12
|
+
export interface IAuthorizeOptions {
|
|
13
|
+
client_id: string;
|
|
14
|
+
nonce: string;
|
|
15
|
+
response_type: AuthorizeOptionsResponseType[];
|
|
16
|
+
redirect_uri: string;
|
|
17
|
+
response_mode: AuthorizeOptionsResponseMode;
|
|
18
|
+
scope: string;
|
|
19
|
+
state: string;
|
|
20
|
+
code_challenge: string;
|
|
21
|
+
code_challenge_method: string;
|
|
22
|
+
code_verifier?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface IAuthorizeResponse {
|
|
25
|
+
state: string;
|
|
26
|
+
code: string;
|
|
27
|
+
}
|
|
28
|
+
export interface IAuthorizeErrorResponse {
|
|
29
|
+
error: string;
|
|
30
|
+
error_description: string;
|
|
31
|
+
}
|
|
32
|
+
export declare enum OAuthGrantTypes {
|
|
33
|
+
CLIENT_CREDENTIALS = "client_credentials",
|
|
34
|
+
AUTHORIZATION_CODE = "authorization_code",
|
|
35
|
+
REFRESH_TOKEN = "refresh_token"
|
|
36
|
+
}
|
|
37
|
+
export interface IAuthorizationCodeFlowParameters {
|
|
38
|
+
client_id: string;
|
|
39
|
+
scope: string;
|
|
40
|
+
code: string;
|
|
41
|
+
redirect_uri: string;
|
|
42
|
+
grant_type: OAuthGrantTypes;
|
|
43
|
+
code_verifier: string;
|
|
44
|
+
}
|
|
45
|
+
export interface IRefreshFlowParameters {
|
|
46
|
+
client_id: string;
|
|
47
|
+
scope: string;
|
|
48
|
+
refresh_token: string;
|
|
49
|
+
grant_type: OAuthGrantTypes;
|
|
50
|
+
}
|
|
51
|
+
export interface ITokenResponse {
|
|
52
|
+
access_token: string;
|
|
53
|
+
token_type: string;
|
|
54
|
+
expires_in: number;
|
|
55
|
+
scope: string;
|
|
56
|
+
refresh_token: string;
|
|
57
|
+
id_token: string;
|
|
58
|
+
}
|
|
59
|
+
export interface ITokenErrorResponse {
|
|
60
|
+
error: string;
|
|
61
|
+
error_description: string;
|
|
62
|
+
error_codes: number[];
|
|
63
|
+
timestamp: number;
|
|
64
|
+
details: unknown;
|
|
65
|
+
}
|
|
66
|
+
export declare type AuthenticateEvent = (id_token: string) => void;
|
|
67
|
+
export declare enum IOauth2ListenerCommand {
|
|
68
|
+
RESTORE_SESSION = "RestoreSession",
|
|
69
|
+
AUTHORIZE = "Authorize",
|
|
70
|
+
HANDLE_REDIRECT = "HandleRedirect",
|
|
71
|
+
LOGOUT = "Logout",
|
|
72
|
+
AUTHENTICATE_EVENT = "AuthenticateEvent",
|
|
73
|
+
ERROR = "Error"
|
|
74
|
+
}
|
|
75
|
+
export interface IOauth2ListenerMessage {
|
|
76
|
+
messageId?: number;
|
|
77
|
+
command: IOauth2ListenerCommand;
|
|
78
|
+
payload?: any;
|
|
79
|
+
}
|
|
80
|
+
export interface IOauth2ListenerMessageResponse {
|
|
81
|
+
messageId: number;
|
|
82
|
+
command: IOauth2ListenerCommand;
|
|
83
|
+
payload: any;
|
|
84
|
+
}
|
|
85
|
+
export interface ISTSOAuth2ManagerOptions {
|
|
86
|
+
router: Router;
|
|
87
|
+
authenticateEvent?: AuthenticateEvent;
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=stsoauth2types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stsoauth2types.d.ts","sourceRoot":"","sources":["../src/stsoauth2types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAEnC,oBAAY,4BAA4B;IACvC,IAAI,SAAS;IACb,QAAQ,aAAa;IACrB,KAAK,UAAU;CACf;AAED,oBAAY,4BAA4B;IACvC,KAAK,UAAU;IACf,QAAQ,aAAa;IACrB,SAAS,cAAc;CACvB;AAGD,MAAM,WAAW,iBAAiB;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,4BAA4B,EAAE,CAAC;IAC9C,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,4BAA4B,CAAA;IAC3C,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,CAAC;IACvB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,aAAa,CAAC,EAAE,MAAM,CAAA;CACtB;AAED,MAAM,WAAW,kBAAkB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAA;CACZ;AAED,MAAM,WAAW,uBAAuB;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,iBAAiB,EAAE,MAAM,CAAA;CACzB;AAED,oBAAY,eAAe;IAC1B,kBAAkB,uBAAuB;IACzC,kBAAkB,uBAAuB;IACzC,aAAa,kBAAkB;CAC/B;AAED,MAAM,WAAW,gCAAgC;IAChD,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,eAAe,CAAC;IAC5B,aAAa,EAAE,MAAM,CAAA;CACrB;AAED,MAAM,WAAW,sBAAsB;IACtC,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,eAAe,CAAA;CAC3B;AAED,MAAM,WAAW,cAAc;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,mBAAmB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,iBAAiB,EAAE,MAAM,CAAC;IAC1B,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,OAAO,CAAA;CAGhB;AAED,oBAAY,iBAAiB,GAAG,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;AAI3D,oBAAY,sBAAsB;IACjC,eAAe,mBAAmB;IAClC,SAAS,cAAc;IACvB,eAAe,mBAAmB;IAClC,MAAM,WAAW;IACjB,kBAAkB,sBAAsB;IACxC,KAAK,UAAU;CACf;AAED,MAAM,WAAW,sBAAsB;IACtC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,sBAAsB,CAAA;IAC/B,OAAO,CAAC,EAAE,GAAG,CAAA;CACb;AAED,MAAM,WAAW,8BAA8B;IAC9C,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,sBAAsB,CAAA;IAC/B,OAAO,EAAE,GAAG,CAAA;CACZ;AAED,MAAM,WAAW,wBAAwB;IACxC,MAAM,EAAE,MAAM,CAAA;IACd,iBAAiB,CAAC,EAAE,iBAAiB,CAAA;CACrC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stsoauth2worker.d.ts","sourceRoot":"","sources":["../src/stsoauth2worker.ts"],"names":[],"mappings":""}
|