biketag-admin
Version:
<h1 align=center>BikeTag-Admin</h1> <div align="center"> <img alt="biketag-admin logo" src="https://raw.githubusercontent.com/keneucker/biketag-website/production/public/img/Tag-Logo-Stacked-V2-medium.png" height="auto" width="200" style="border-radius:25
5 lines • 269 kB
JavaScript
(function($e,Ve){typeof exports=="object"&&typeof module<"u"?Ve(exports,require("biketag"),require("vue"),require("pinia")):typeof define=="function"&&define.amd?define(["exports","biketag","vue","pinia"],Ve):($e=typeof globalThis<"u"?globalThis:$e||self,Ve($e.BikeTag={},$e.BikeTagClient,$e.Vue,$e.pinia))})(this,function($e,Ve,xe,lt){"use strict";var cp=Object.defineProperty;var up=($e,Ve,xe)=>Ve in $e?cp($e,Ve,{enumerable:!0,configurable:!0,writable:!0,value:xe}):$e[Ve]=xe;var _r=($e,Ve,xe)=>(up($e,typeof Ve!="symbol"?Ve+"":Ve,xe),xe);const Qi=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Ae={appId:"com.app.biketag",accessToken:"8b4e2b86a724bf3f39d6766de6e67212",admingEmail:"biketag@biketag.org",gameName:"",host:"biketag.org",hostKey:"ItsABikeTagGame",tagSource:"imgur",gameSource:"sanity",store:"biketag-admin",sanityImagesCDNUrl:"https://cdn.sanity.io/images/",sanityBaseCDNUrl:"https://cdn.sanity.io/images/x37ikhvs/production/",sanityPlayerRoleID:"rol_pcbQ68Q9L0yn1o3O",sanityAmbassadorRoleID:"rol_iET51vzIn8z6Utz0"},Zi={APP_ID:process.env.APP_ID??Ae.appId,ACCESS_TOKEN:process.env.ACCESS_TOKEN??Ae.accessToken,CONTEXT:process.env.CONTEXT??null,ADMIN_EMAIL:process.env.ADMIN_EMAIL??Ae.admingEmail,AMBASSADOR_ROLE:process.env.AMBASSADOR_ROLE??Ae.sanityAmbassadorRoleID,PLAYER_ROLE:process.env.PLAYER_ROLE??Ae.sanityPlayerRoleID,A_AUDIENCE:process.env.A_AUDIENCE??null,A_CID:process.env.A_CID??null,A_DOMAIN:process.env.A_DOMAIN??null,A_M_CS:process.env.A_M_CS??null,A_M_CID:process.env.A_M_CID??null,B_AKEY:process.env.B_AKEY??null,GAME_NAME:process.env.GAME_NAME??null,GAME_SOURCE:process.env.GAME_SOURCE??null,HOST:process.env.HOST??Ae.host,HOST_KEY:process.env.HOST_KEY??Ae.hostKey,BIKETAG_AUTHED:process.env.B_AUTHED??process.env.BIKETAG_AUTHED??null,G_AKEY:process.env.G_AKEY??process.env.GOOGLE_ACCESS_TOKEN??process.env.GOOGLE_API_KEY??null,G_CID:process.env.G_CID??process.env.GOOGLE_CLIENT_ID??null,G_CSECRET:process.env.G_CSECRET??process.env.GOOGLE_CLIENT_SECRET??null,G_EMAIL:process.env.G_EMAIL??process.env.GOOGLE_EMAIL_ADDRESS??null,G_PASS:process.env.G_PASS??process.env.GOOGLE_PASSWORD??null,G_RTOKEN:process.env.G_RTOKEN??process.env.GOOGLE_REFRESH_TOKEN??null,IA_CID:process.env.IA_CID??process.env.IMGUR_ADMIN_CLIENT_ID??null,IA_CSECRET:process.env.IA_CSECRET??process.env.IMGUR_ADMIN_CLIENT_SECRET??null,IA_RTOKEN:process.env.IA_RTOKEN??process.env.IMGUR_ADMIN_REFRESH_TOKEN??null,IA_TOKEN:process.env.IA_TOKEN??process.env.IMGUR_ADMIN_ACCESS_TOKEN??null,I_CID:process.env.I_CID??process.env.IMGUR_CLIENT_ID??null,I_CSECRET:process.env.I_CSECRET??process.env.IMGUR_CLIENT_SECRET??null,I_RTOKEN:process.env.I_RTOKEN??process.env.IMGUR_REFRESH_TOKEN??null,I_TOKEN:process.env.I_TOKEN??process.env.IMGUR_ACCESS_TOKEN??null,SA_CDN_URL:process.env.SA_CDN_URL??Ae.sanityImagesCDNUrl,SA_DSET:process.env.SA_DSET??process.env.SANITY_ADMIN_DATASET??null,SA_PID:process.env.SA_PID??process.env.SANITY_ADMIN_PROJECT_ID??null,SA_TOKEN:process.env.SA_TOKEN??process.env.SANITY_ADMIN_ACCESS_TOKEN??null,S_CURL:process.env.S_CURL??Ae.sanityImagesCDNUrl,S_DSET:process.env.S_DSET??process.env.SANITY_DATASET??null,S_PID:process.env.S_PID??process.env.SANITY_PROJECT_ID??null,S_TOKEN:process.env.S_TOKEN??process.env.SANITY_ACCESS_TOKEN??null};var te=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Mt(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function ec(r){if(r.__esModule)return r;var e=r.default;if(typeof e=="function"){var t=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(r).forEach(function(n){var a=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(t,n,a.get?a:{enumerable:!0,get:function(){return r[n]}})}),t}var Cn={exports:{}},Vo={},Qe={},Wr={},dt={},ae={},ht={};(function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.regexpCode=r.getEsmExportName=r.getProperty=r.safeStringify=r.stringify=r.strConcat=r.addCodeArg=r.str=r._=r.nil=r._Code=r.Name=r.IDENTIFIER=r._CodeOrName=void 0;class e{}r._CodeOrName=e,r.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class t extends e{constructor(l){if(super(),!r.IDENTIFIER.test(l))throw new Error("CodeGen: name must be a valid identifier");this.str=l}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}r.Name=t;class n extends e{constructor(l){super(),this._items=typeof l=="string"?[l]:l}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const l=this._items[0];return l===""||l==='""'}get str(){var l;return(l=this._str)!==null&&l!==void 0?l:this._str=this._items.reduce((_,A)=>`${_}${A}`,"")}get names(){var l;return(l=this._names)!==null&&l!==void 0?l:this._names=this._items.reduce((_,A)=>(A instanceof t&&(_[A.str]=(_[A.str]||0)+1),_),{})}}r._Code=n,r.nil=new n("");function a(d,...l){const _=[d[0]];let A=0;for(;A<l.length;)c(_,l[A]),_.push(d[++A]);return new n(_)}r._=a;const s=new n("+");function p(d,...l){const _=[h(d[0])];let A=0;for(;A<l.length;)_.push(s),c(_,l[A]),_.push(s,h(d[++A]));return x(_),new n(_)}r.str=p;function c(d,l){l instanceof n?d.push(...l._items):l instanceof t?d.push(l):d.push(f(l))}r.addCodeArg=c;function x(d){let l=1;for(;l<d.length-1;){if(d[l]===s){const _=o(d[l-1],d[l+1]);if(_!==void 0){d.splice(l-1,3,_);continue}d[l++]="+"}l++}}function o(d,l){if(l==='""')return d;if(d==='""')return l;if(typeof d=="string")return l instanceof t||d[d.length-1]!=='"'?void 0:typeof l!="string"?`${d.slice(0,-1)}${l}"`:l[0]==='"'?d.slice(0,-1)+l.slice(1):void 0;if(typeof l=="string"&&l[0]==='"'&&!(d instanceof t))return`"${d}${l.slice(1)}`}function i(d,l){return l.emptyStr()?d:d.emptyStr()?l:p`${d}${l}`}r.strConcat=i;function f(d){return typeof d=="number"||typeof d=="boolean"||d===null?d:h(Array.isArray(d)?d.join(","):d)}function u(d){return new n(h(d))}r.stringify=u;function h(d){return JSON.stringify(d).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}r.safeStringify=h;function g(d){return typeof d=="string"&&r.IDENTIFIER.test(d)?new n(`.${d}`):a`[${d}]`}r.getProperty=g;function y(d){if(typeof d=="string"&&r.IDENTIFIER.test(d))return new n(`${d}`);throw new Error(`CodeGen: invalid export name: ${d}, use explicit $id name mapping`)}r.getEsmExportName=y;function v(d){return new n(d.toString())}r.regexpCode=v})(ht);var bn={};(function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.ValueScope=r.ValueScopeName=r.Scope=r.varKinds=r.UsedValueState=void 0;const e=ht;class t extends Error{constructor(o){super(`CodeGen: "code" for ${o} not defined`),this.value=o.value}}var n;(function(x){x[x.Started=0]="Started",x[x.Completed=1]="Completed"})(n=r.UsedValueState||(r.UsedValueState={})),r.varKinds={const:new e.Name("const"),let:new e.Name("let"),var:new e.Name("var")};class a{constructor({prefixes:o,parent:i}={}){this._names={},this._prefixes=o,this._parent=i}toName(o){return o instanceof e.Name?o:this.name(o)}name(o){return new e.Name(this._newName(o))}_newName(o){const i=this._names[o]||this._nameGroup(o);return`${o}${i.index++}`}_nameGroup(o){var i,f;if(!((f=(i=this._parent)===null||i===void 0?void 0:i._prefixes)===null||f===void 0)&&f.has(o)||this._prefixes&&!this._prefixes.has(o))throw new Error(`CodeGen: prefix "${o}" is not allowed in this scope`);return this._names[o]={prefix:o,index:0}}}r.Scope=a;class s extends e.Name{constructor(o,i){super(i),this.prefix=o}setValue(o,{property:i,itemIndex:f}){this.value=o,this.scopePath=(0,e._)`.${new e.Name(i)}[${f}]`}}r.ValueScopeName=s;const p=(0,e._)`\n`;class c extends a{constructor(o){super(o),this._values={},this._scope=o.scope,this.opts={...o,_n:o.lines?p:e.nil}}get(){return this._scope}name(o){return new s(o,this._newName(o))}value(o,i){var f;if(i.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const u=this.toName(o),{prefix:h}=u,g=(f=i.key)!==null&&f!==void 0?f:i.ref;let y=this._values[h];if(y){const l=y.get(g);if(l)return l}else y=this._values[h]=new Map;y.set(g,u);const v=this._scope[h]||(this._scope[h]=[]),d=v.length;return v[d]=i.ref,u.setValue(i,{property:h,itemIndex:d}),u}getValue(o,i){const f=this._values[o];if(f)return f.get(i)}scopeRefs(o,i=this._values){return this._reduceValues(i,f=>{if(f.scopePath===void 0)throw new Error(`CodeGen: name "${f}" has no value`);return(0,e._)`${o}${f.scopePath}`})}scopeCode(o=this._values,i,f){return this._reduceValues(o,u=>{if(u.value===void 0)throw new Error(`CodeGen: name "${u}" has no value`);return u.value.code},i,f)}_reduceValues(o,i,f={},u){let h=e.nil;for(const g in o){const y=o[g];if(!y)continue;const v=f[g]=f[g]||new Map;y.forEach(d=>{if(v.has(d))return;v.set(d,n.Started);let l=i(d);if(l){const _=this.opts.es5?r.varKinds.var:r.varKinds.const;h=(0,e._)`${h}${_} ${d} = ${l};${this.opts._n}`}else if(l=u==null?void 0:u(d))h=(0,e._)`${h}${l}${this.opts._n}`;else throw new t(d);v.set(d,n.Completed)})}return h}}r.ValueScope=c})(bn),function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.or=r.and=r.not=r.CodeGen=r.operators=r.varKinds=r.ValueScopeName=r.ValueScope=r.Scope=r.Name=r.regexpCode=r.stringify=r.getProperty=r.nil=r.strConcat=r.str=r._=void 0;const e=ht,t=bn;var n=ht;Object.defineProperty(r,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(r,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(r,"strConcat",{enumerable:!0,get:function(){return n.strConcat}}),Object.defineProperty(r,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(r,"getProperty",{enumerable:!0,get:function(){return n.getProperty}}),Object.defineProperty(r,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(r,"regexpCode",{enumerable:!0,get:function(){return n.regexpCode}}),Object.defineProperty(r,"Name",{enumerable:!0,get:function(){return n.Name}});var a=bn;Object.defineProperty(r,"Scope",{enumerable:!0,get:function(){return a.Scope}}),Object.defineProperty(r,"ValueScope",{enumerable:!0,get:function(){return a.ValueScope}}),Object.defineProperty(r,"ValueScopeName",{enumerable:!0,get:function(){return a.ValueScopeName}}),Object.defineProperty(r,"varKinds",{enumerable:!0,get:function(){return a.varKinds}}),r.operators={GT:new e._Code(">"),GTE:new e._Code(">="),LT:new e._Code("<"),LTE:new e._Code("<="),EQ:new e._Code("==="),NEQ:new e._Code("!=="),NOT:new e._Code("!"),OR:new e._Code("||"),AND:new e._Code("&&"),ADD:new e._Code("+")};class s{optimizeNodes(){return this}optimizeNames(m,P){return this}}class p extends s{constructor(m,P,I){super(),this.varKind=m,this.name=P,this.rhs=I}render({es5:m,_n:P}){const I=m?t.varKinds.var:this.varKind,z=this.rhs===void 0?"":` = ${this.rhs}`;return`${I} ${this.name}${z};`+P}optimizeNames(m,P){if(m[this.name.str])return this.rhs&&(this.rhs=V(this.rhs,m,P)),this}get names(){return this.rhs instanceof e._CodeOrName?this.rhs.names:{}}}class c extends s{constructor(m,P,I){super(),this.lhs=m,this.rhs=P,this.sideEffects=I}render({_n:m}){return`${this.lhs} = ${this.rhs};`+m}optimizeNames(m,P){if(!(this.lhs instanceof e.Name&&!m[this.lhs.str]&&!this.sideEffects))return this.rhs=V(this.rhs,m,P),this}get names(){const m=this.lhs instanceof e.Name?{}:{...this.lhs.names};return L(m,this.rhs)}}class x extends c{constructor(m,P,I,z){super(m,I,z),this.op=P}render({_n:m}){return`${this.lhs} ${this.op}= ${this.rhs};`+m}}class o extends s{constructor(m){super(),this.label=m,this.names={}}render({_n:m}){return`${this.label}:`+m}}class i extends s{constructor(m){super(),this.label=m,this.names={}}render({_n:m}){return`break${this.label?` ${this.label}`:""};`+m}}class f extends s{constructor(m){super(),this.error=m}render({_n:m}){return`throw ${this.error};`+m}get names(){return this.error.names}}class u extends s{constructor(m){super(),this.code=m}render({_n:m}){return`${this.code};`+m}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(m,P){return this.code=V(this.code,m,P),this}get names(){return this.code instanceof e._CodeOrName?this.code.names:{}}}class h extends s{constructor(m=[]){super(),this.nodes=m}render(m){return this.nodes.reduce((P,I)=>P+I.render(m),"")}optimizeNodes(){const{nodes:m}=this;let P=m.length;for(;P--;){const I=m[P].optimizeNodes();Array.isArray(I)?m.splice(P,1,...I):I?m[P]=I:m.splice(P,1)}return m.length>0?this:void 0}optimizeNames(m,P){const{nodes:I}=this;let z=I.length;for(;z--;){const N=I[z];N.optimizeNames(m,P)||(W(m,N.names),I.splice(z,1))}return I.length>0?this:void 0}get names(){return this.nodes.reduce((m,P)=>j(m,P.names),{})}}class g extends h{render(m){return"{"+m._n+super.render(m)+"}"+m._n}}class y extends h{}class v extends g{}v.kind="else";class d extends g{constructor(m,P){super(P),this.condition=m}render(m){let P=`if(${this.condition})`+super.render(m);return this.else&&(P+="else "+this.else.render(m)),P}optimizeNodes(){super.optimizeNodes();const m=this.condition;if(m===!0)return this.nodes;let P=this.else;if(P){const I=P.optimizeNodes();P=this.else=Array.isArray(I)?new v(I):I}if(P)return m===!1?P instanceof d?P:P.nodes:this.nodes.length?this:new d(Q(m),P instanceof d?[P]:P.nodes);if(!(m===!1||!this.nodes.length))return this}optimizeNames(m,P){var I;if(this.else=(I=this.else)===null||I===void 0?void 0:I.optimizeNames(m,P),!!(super.optimizeNames(m,P)||this.else))return this.condition=V(this.condition,m,P),this}get names(){const m=super.names;return L(m,this.condition),this.else&&j(m,this.else.names),m}}d.kind="if";class l extends g{}l.kind="for";class _ extends l{constructor(m){super(),this.iteration=m}render(m){return`for(${this.iteration})`+super.render(m)}optimizeNames(m,P){if(super.optimizeNames(m,P))return this.iteration=V(this.iteration,m,P),this}get names(){return j(super.names,this.iteration.names)}}class A extends l{constructor(m,P,I,z){super(),this.varKind=m,this.name=P,this.from=I,this.to=z}render(m){const P=m.es5?t.varKinds.var:this.varKind,{name:I,from:z,to:N}=this;return`for(${P} ${I}=${z}; ${I}<${N}; ${I}++)`+super.render(m)}get names(){const m=L(super.names,this.from);return L(m,this.to)}}class F extends l{constructor(m,P,I,z){super(),this.loop=m,this.varKind=P,this.name=I,this.iterable=z}render(m){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(m)}optimizeNames(m,P){if(super.optimizeNames(m,P))return this.iterable=V(this.iterable,m,P),this}get names(){return j(super.names,this.iterable.names)}}class C extends g{constructor(m,P,I){super(),this.name=m,this.args=P,this.async=I}render(m){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(m)}}C.kind="func";class E extends h{render(m){return"return "+super.render(m)}}E.kind="return";class b extends g{render(m){let P="try"+super.render(m);return this.catch&&(P+=this.catch.render(m)),this.finally&&(P+=this.finally.render(m)),P}optimizeNodes(){var m,P;return super.optimizeNodes(),(m=this.catch)===null||m===void 0||m.optimizeNodes(),(P=this.finally)===null||P===void 0||P.optimizeNodes(),this}optimizeNames(m,P){var I,z;return super.optimizeNames(m,P),(I=this.catch)===null||I===void 0||I.optimizeNames(m,P),(z=this.finally)===null||z===void 0||z.optimizeNames(m,P),this}get names(){const m=super.names;return this.catch&&j(m,this.catch.names),this.finally&&j(m,this.finally.names),m}}class D extends g{constructor(m){super(),this.error=m}render(m){return`catch(${this.error})`+super.render(m)}}D.kind="catch";class $ extends g{render(m){return"finally"+super.render(m)}}$.kind="finally";class T{constructor(m,P={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...P,_n:P.lines?`
`:""},this._extScope=m,this._scope=new t.Scope({parent:m}),this._nodes=[new y]}toString(){return this._root.render(this.opts)}name(m){return this._scope.name(m)}scopeName(m){return this._extScope.name(m)}scopeValue(m,P){const I=this._extScope.value(m,P);return(this._values[I.prefix]||(this._values[I.prefix]=new Set)).add(I),I}getScopeValue(m,P){return this._extScope.getValue(m,P)}scopeRefs(m){return this._extScope.scopeRefs(m,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(m,P,I,z){const N=this._scope.toName(P);return I!==void 0&&z&&(this._constants[N.str]=I),this._leafNode(new p(m,N,I)),N}const(m,P,I){return this._def(t.varKinds.const,m,P,I)}let(m,P,I){return this._def(t.varKinds.let,m,P,I)}var(m,P,I){return this._def(t.varKinds.var,m,P,I)}assign(m,P,I){return this._leafNode(new c(m,P,I))}add(m,P){return this._leafNode(new x(m,r.operators.ADD,P))}code(m){return typeof m=="function"?m():m!==e.nil&&this._leafNode(new u(m)),this}object(...m){const P=["{"];for(const[I,z]of m)P.length>1&&P.push(","),P.push(I),(I!==z||this.opts.es5)&&(P.push(":"),(0,e.addCodeArg)(P,z));return P.push("}"),new e._Code(P)}if(m,P,I){if(this._blockNode(new d(m)),P&&I)this.code(P).else().code(I).endIf();else if(P)this.code(P).endIf();else if(I)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(m){return this._elseNode(new d(m))}else(){return this._elseNode(new v)}endIf(){return this._endBlockNode(d,v)}_for(m,P){return this._blockNode(m),P&&this.code(P).endFor(),this}for(m,P){return this._for(new _(m),P)}forRange(m,P,I,z,N=this.opts.es5?t.varKinds.var:t.varKinds.let){const q=this._scope.toName(m);return this._for(new A(N,q,P,I),()=>z(q))}forOf(m,P,I,z=t.varKinds.const){const N=this._scope.toName(m);if(this.opts.es5){const q=P instanceof e.Name?P:this.var("_arr",P);return this.forRange("_i",0,(0,e._)`${q}.length`,K=>{this.var(N,(0,e._)`${q}[${K}]`),I(N)})}return this._for(new F("of",z,N,P),()=>I(N))}forIn(m,P,I,z=this.opts.es5?t.varKinds.var:t.varKinds.const){if(this.opts.ownProperties)return this.forOf(m,(0,e._)`Object.keys(${P})`,I);const N=this._scope.toName(m);return this._for(new F("in",z,N,P),()=>I(N))}endFor(){return this._endBlockNode(l)}label(m){return this._leafNode(new o(m))}break(m){return this._leafNode(new i(m))}return(m){const P=new E;if(this._blockNode(P),this.code(m),P.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(E)}try(m,P,I){if(!P&&!I)throw new Error('CodeGen: "try" without "catch" and "finally"');const z=new b;if(this._blockNode(z),this.code(m),P){const N=this.name("e");this._currNode=z.catch=new D(N),P(N)}return I&&(this._currNode=z.finally=new $,this.code(I)),this._endBlockNode(D,$)}throw(m){return this._leafNode(new f(m))}block(m,P){return this._blockStarts.push(this._nodes.length),m&&this.code(m).endBlock(P),this}endBlock(m){const P=this._blockStarts.pop();if(P===void 0)throw new Error("CodeGen: not in self-balancing block");const I=this._nodes.length-P;if(I<0||m!==void 0&&I!==m)throw new Error(`CodeGen: wrong number of nodes: ${I} vs ${m} expected`);return this._nodes.length=P,this}func(m,P=e.nil,I,z){return this._blockNode(new C(m,P,I)),z&&this.code(z).endFunc(),this}endFunc(){return this._endBlockNode(C)}optimize(m=1){for(;m-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(m){return this._currNode.nodes.push(m),this}_blockNode(m){this._currNode.nodes.push(m),this._nodes.push(m)}_endBlockNode(m,P){const I=this._currNode;if(I instanceof m||P&&I instanceof P)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${P?`${m.kind}/${P.kind}`:m.kind}"`)}_elseNode(m){const P=this._currNode;if(!(P instanceof d))throw new Error('CodeGen: "else" without "if"');return this._currNode=P.else=m,this}get _root(){return this._nodes[0]}get _currNode(){const m=this._nodes;return m[m.length-1]}set _currNode(m){const P=this._nodes;P[P.length-1]=m}}r.CodeGen=T;function j(B,m){for(const P in m)B[P]=(B[P]||0)+(m[P]||0);return B}function L(B,m){return m instanceof e._CodeOrName?j(B,m.names):B}function V(B,m,P){if(B instanceof e.Name)return I(B);if(!z(B))return B;return new e._Code(B._items.reduce((N,q)=>(q instanceof e.Name&&(q=I(q)),q instanceof e._Code?N.push(...q._items):N.push(q),N),[]));function I(N){const q=P[N.str];return q===void 0||m[N.str]!==1?N:(delete m[N.str],q)}function z(N){return N instanceof e._Code&&N._items.some(q=>q instanceof e.Name&&m[q.str]===1&&P[q.str]!==void 0)}}function W(B,m){for(const P in m)B[P]=(B[P]||0)-(m[P]||0)}function Q(B){return typeof B=="boolean"||typeof B=="number"||B===null?!B:(0,e._)`!${k(B)}`}r.not=Q;const ie=S(r.operators.AND);function ne(...B){return B.reduce(ie)}r.and=ne;const se=S(r.operators.OR);function H(...B){return B.reduce(se)}r.or=H;function S(B){return(m,P)=>m===e.nil?P:P===e.nil?m:(0,e._)`${k(m)} ${B} ${k(P)}`}function k(B){return B instanceof e.Name?B:(0,e._)`(${B})`}}(ae);var pe={};(function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.checkStrictMode=r.getErrorPath=r.Type=r.useFunc=r.setEvaluated=r.evaluatedPropsToName=r.mergeEvaluated=r.eachItem=r.unescapeJsonPointer=r.escapeJsonPointer=r.escapeFragment=r.unescapeFragment=r.schemaRefOrVal=r.schemaHasRulesButRef=r.schemaHasRules=r.checkUnknownRules=r.alwaysValidSchema=r.toHash=void 0;const e=ae,t=ht;function n(C){const E={};for(const b of C)E[b]=!0;return E}r.toHash=n;function a(C,E){return typeof E=="boolean"?E:Object.keys(E).length===0?!0:(s(C,E),!p(E,C.self.RULES.all))}r.alwaysValidSchema=a;function s(C,E=C.schema){const{opts:b,self:D}=C;if(!b.strictSchema||typeof E=="boolean")return;const $=D.RULES.keywords;for(const T in E)$[T]||F(C,`unknown keyword: "${T}"`)}r.checkUnknownRules=s;function p(C,E){if(typeof C=="boolean")return!C;for(const b in C)if(E[b])return!0;return!1}r.schemaHasRules=p;function c(C,E){if(typeof C=="boolean")return!C;for(const b in C)if(b!=="$ref"&&E.all[b])return!0;return!1}r.schemaHasRulesButRef=c;function x({topSchemaRef:C,schemaPath:E},b,D,$){if(!$){if(typeof b=="number"||typeof b=="boolean")return b;if(typeof b=="string")return(0,e._)`${b}`}return(0,e._)`${C}${E}${(0,e.getProperty)(D)}`}r.schemaRefOrVal=x;function o(C){return u(decodeURIComponent(C))}r.unescapeFragment=o;function i(C){return encodeURIComponent(f(C))}r.escapeFragment=i;function f(C){return typeof C=="number"?`${C}`:C.replace(/~/g,"~0").replace(/\//g,"~1")}r.escapeJsonPointer=f;function u(C){return C.replace(/~1/g,"/").replace(/~0/g,"~")}r.unescapeJsonPointer=u;function h(C,E){if(Array.isArray(C))for(const b of C)E(b);else E(C)}r.eachItem=h;function g({mergeNames:C,mergeToName:E,mergeValues:b,resultToName:D}){return($,T,j,L)=>{const V=j===void 0?T:j instanceof e.Name?(T instanceof e.Name?C($,T,j):E($,T,j),j):T instanceof e.Name?(E($,j,T),T):b(T,j);return L===e.Name&&!(V instanceof e.Name)?D($,V):V}}r.mergeEvaluated={props:g({mergeNames:(C,E,b)=>C.if((0,e._)`${b} !== true && ${E} !== undefined`,()=>{C.if((0,e._)`${E} === true`,()=>C.assign(b,!0),()=>C.assign(b,(0,e._)`${b} || {}`).code((0,e._)`Object.assign(${b}, ${E})`))}),mergeToName:(C,E,b)=>C.if((0,e._)`${b} !== true`,()=>{E===!0?C.assign(b,!0):(C.assign(b,(0,e._)`${b} || {}`),v(C,b,E))}),mergeValues:(C,E)=>C===!0?!0:{...C,...E},resultToName:y}),items:g({mergeNames:(C,E,b)=>C.if((0,e._)`${b} !== true && ${E} !== undefined`,()=>C.assign(b,(0,e._)`${E} === true ? true : ${b} > ${E} ? ${b} : ${E}`)),mergeToName:(C,E,b)=>C.if((0,e._)`${b} !== true`,()=>C.assign(b,E===!0?!0:(0,e._)`${b} > ${E} ? ${b} : ${E}`)),mergeValues:(C,E)=>C===!0?!0:Math.max(C,E),resultToName:(C,E)=>C.var("items",E)})};function y(C,E){if(E===!0)return C.var("props",!0);const b=C.var("props",(0,e._)`{}`);return E!==void 0&&v(C,b,E),b}r.evaluatedPropsToName=y;function v(C,E,b){Object.keys(b).forEach(D=>C.assign((0,e._)`${E}${(0,e.getProperty)(D)}`,!0))}r.setEvaluated=v;const d={};function l(C,E){return C.scopeValue("func",{ref:E,code:d[E.code]||(d[E.code]=new t._Code(E.code))})}r.useFunc=l;var _;(function(C){C[C.Num=0]="Num",C[C.Str=1]="Str"})(_=r.Type||(r.Type={}));function A(C,E,b){if(C instanceof e.Name){const D=E===_.Num;return b?D?(0,e._)`"[" + ${C} + "]"`:(0,e._)`"['" + ${C} + "']"`:D?(0,e._)`"/" + ${C}`:(0,e._)`"/" + ${C}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return b?(0,e.getProperty)(C).toString():"/"+f(C)}r.getErrorPath=A;function F(C,E,b=C.opts.strictSchema){if(b){if(E=`strict mode: ${E}`,b===!0)throw new Error(E);C.self.logger.warn(E)}}r.checkStrictMode=F})(pe);var sr={};Object.defineProperty(sr,"__esModule",{value:!0});const Ie=ae,rc={data:new Ie.Name("data"),valCxt:new Ie.Name("valCxt"),instancePath:new Ie.Name("instancePath"),parentData:new Ie.Name("parentData"),parentDataProperty:new Ie.Name("parentDataProperty"),rootData:new Ie.Name("rootData"),dynamicAnchors:new Ie.Name("dynamicAnchors"),vErrors:new Ie.Name("vErrors"),errors:new Ie.Name("errors"),this:new Ie.Name("this"),self:new Ie.Name("self"),scope:new Ie.Name("scope"),json:new Ie.Name("json"),jsonPos:new Ie.Name("jsonPos"),jsonLen:new Ie.Name("jsonLen"),jsonPart:new Ie.Name("jsonPart")};sr.default=rc,function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.extendErrors=r.resetErrorsCount=r.reportExtraError=r.reportError=r.keyword$DataError=r.keywordError=void 0;const e=ae,t=pe,n=sr;r.keywordError={message:({keyword:v})=>(0,e.str)`must pass "${v}" keyword validation`},r.keyword$DataError={message:({keyword:v,schemaType:d})=>d?(0,e.str)`"${v}" keyword must be ${d} ($data)`:(0,e.str)`"${v}" keyword is invalid ($data)`};function a(v,d=r.keywordError,l,_){const{it:A}=v,{gen:F,compositeRule:C,allErrors:E}=A,b=f(v,d,l);_??(C||E)?x(F,b):o(A,(0,e._)`[${b}]`)}r.reportError=a;function s(v,d=r.keywordError,l){const{it:_}=v,{gen:A,compositeRule:F,allErrors:C}=_,E=f(v,d,l);x(A,E),F||C||o(_,n.default.vErrors)}r.reportExtraError=s;function p(v,d){v.assign(n.default.errors,d),v.if((0,e._)`${n.default.vErrors} !== null`,()=>v.if(d,()=>v.assign((0,e._)`${n.default.vErrors}.length`,d),()=>v.assign(n.default.vErrors,null)))}r.resetErrorsCount=p;function c({gen:v,keyword:d,schemaValue:l,data:_,errsCount:A,it:F}){if(A===void 0)throw new Error("ajv implementation error");const C=v.name("err");v.forRange("i",A,n.default.errors,E=>{v.const(C,(0,e._)`${n.default.vErrors}[${E}]`),v.if((0,e._)`${C}.instancePath === undefined`,()=>v.assign((0,e._)`${C}.instancePath`,(0,e.strConcat)(n.default.instancePath,F.errorPath))),v.assign((0,e._)`${C}.schemaPath`,(0,e.str)`${F.errSchemaPath}/${d}`),F.opts.verbose&&(v.assign((0,e._)`${C}.schema`,l),v.assign((0,e._)`${C}.data`,_))})}r.extendErrors=c;function x(v,d){const l=v.const("err",d);v.if((0,e._)`${n.default.vErrors} === null`,()=>v.assign(n.default.vErrors,(0,e._)`[${l}]`),(0,e._)`${n.default.vErrors}.push(${l})`),v.code((0,e._)`${n.default.errors}++`)}function o(v,d){const{gen:l,validateName:_,schemaEnv:A}=v;A.$async?l.throw((0,e._)`new ${v.ValidationError}(${d})`):(l.assign((0,e._)`${_}.errors`,d),l.return(!1))}const i={keyword:new e.Name("keyword"),schemaPath:new e.Name("schemaPath"),params:new e.Name("params"),propertyName:new e.Name("propertyName"),message:new e.Name("message"),schema:new e.Name("schema"),parentSchema:new e.Name("parentSchema")};function f(v,d,l){const{createErrors:_}=v.it;return _===!1?(0,e._)`{}`:u(v,d,l)}function u(v,d,l={}){const{gen:_,it:A}=v,F=[h(A,l),g(v,l)];return y(v,d,F),_.object(...F)}function h({errorPath:v},{instancePath:d}){const l=d?(0,e.str)`${v}${(0,t.getErrorPath)(d,t.Type.Str)}`:v;return[n.default.instancePath,(0,e.strConcat)(n.default.instancePath,l)]}function g({keyword:v,it:{errSchemaPath:d}},{schemaPath:l,parentSchema:_}){let A=_?d:(0,e.str)`${d}/${v}`;return l&&(A=(0,e.str)`${A}${(0,t.getErrorPath)(l,t.Type.Str)}`),[i.schemaPath,A]}function y(v,{params:d,message:l},_){const{keyword:A,data:F,schemaValue:C,it:E}=v,{opts:b,propertyName:D,topSchemaRef:$,schemaPath:T}=E;_.push([i.keyword,A],[i.params,typeof d=="function"?d(v):d||(0,e._)`{}`]),b.messages&&_.push([i.message,typeof l=="function"?l(v):l]),b.verbose&&_.push([i.schema,C],[i.parentSchema,(0,e._)`${$}${T}`],[n.default.data,F]),D&&_.push([i.propertyName,D])}}(dt),Object.defineProperty(Wr,"__esModule",{value:!0}),Wr.boolOrEmptySchema=Wr.topBoolOrEmptySchema=void 0;const tc=dt,nc=ae,ac=sr,oc={message:"boolean schema is false"};function sc(r){const{gen:e,schema:t,validateName:n}=r;t===!1?Ko(r,!1):typeof t=="object"&&t.$async===!0?e.return(ac.default.data):(e.assign((0,nc._)`${n}.errors`,null),e.return(!0))}Wr.topBoolOrEmptySchema=sc;function ic(r,e){const{gen:t,schema:n}=r;n===!1?(t.var(e,!1),Ko(r)):t.var(e,!0)}Wr.boolOrEmptySchema=ic;function Ko(r,e){const{gen:t,data:n}=r,a={gen:t,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:r};(0,tc.reportError)(a,oc,void 0,e)}var pt={},Fr={};Object.defineProperty(Fr,"__esModule",{value:!0}),Fr.getRules=Fr.isJSONType=void 0;const cc=["string","number","integer","boolean","null","object","array"],uc=new Set(cc);function fc(r){return typeof r=="string"&&uc.has(r)}Fr.isJSONType=fc;function lc(){const r={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...r,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},r.number,r.string,r.array,r.object],post:{rules:[]},all:{},keywords:{}}}Fr.getRules=lc;var vr={};Object.defineProperty(vr,"__esModule",{value:!0}),vr.shouldUseRule=vr.shouldUseGroup=vr.schemaHasRulesForType=void 0;function dc({schema:r,self:e},t){const n=e.RULES.types[t];return n&&n!==!0&&Wo(r,n)}vr.schemaHasRulesForType=dc;function Wo(r,e){return e.rules.some(t=>Go(r,t))}vr.shouldUseGroup=Wo;function Go(r,e){var t;return r[e.keyword]!==void 0||((t=e.definition.implements)===null||t===void 0?void 0:t.some(n=>r[n]!==void 0))}vr.shouldUseRule=Go,function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.reportTypeError=r.checkDataTypes=r.checkDataType=r.coerceAndCheckDataType=r.getJSONTypes=r.getSchemaTypes=r.DataType=void 0;const e=Fr,t=vr,n=dt,a=ae,s=pe;var p;(function(_){_[_.Correct=0]="Correct",_[_.Wrong=1]="Wrong"})(p=r.DataType||(r.DataType={}));function c(_){const A=x(_.type);if(A.includes("null")){if(_.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!A.length&&_.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');_.nullable===!0&&A.push("null")}return A}r.getSchemaTypes=c;function x(_){const A=Array.isArray(_)?_:_?[_]:[];if(A.every(e.isJSONType))return A;throw new Error("type must be JSONType or JSONType[]: "+A.join(","))}r.getJSONTypes=x;function o(_,A){const{gen:F,data:C,opts:E}=_,b=f(A,E.coerceTypes),D=A.length>0&&!(b.length===0&&A.length===1&&(0,t.schemaHasRulesForType)(_,A[0]));if(D){const $=y(A,C,E.strictNumbers,p.Wrong);F.if($,()=>{b.length?u(_,A,b):d(_)})}return D}r.coerceAndCheckDataType=o;const i=new Set(["string","number","integer","boolean","null"]);function f(_,A){return A?_.filter(F=>i.has(F)||A==="array"&&F==="array"):[]}function u(_,A,F){const{gen:C,data:E,opts:b}=_,D=C.let("dataType",(0,a._)`typeof ${E}`),$=C.let("coerced",(0,a._)`undefined`);b.coerceTypes==="array"&&C.if((0,a._)`${D} == 'object' && Array.isArray(${E}) && ${E}.length == 1`,()=>C.assign(E,(0,a._)`${E}[0]`).assign(D,(0,a._)`typeof ${E}`).if(y(A,E,b.strictNumbers),()=>C.assign($,E))),C.if((0,a._)`${$} !== undefined`);for(const j of F)(i.has(j)||j==="array"&&b.coerceTypes==="array")&&T(j);C.else(),d(_),C.endIf(),C.if((0,a._)`${$} !== undefined`,()=>{C.assign(E,$),h(_,$)});function T(j){switch(j){case"string":C.elseIf((0,a._)`${D} == "number" || ${D} == "boolean"`).assign($,(0,a._)`"" + ${E}`).elseIf((0,a._)`${E} === null`).assign($,(0,a._)`""`);return;case"number":C.elseIf((0,a._)`${D} == "boolean" || ${E} === null
|| (${D} == "string" && ${E} && ${E} == +${E})`).assign($,(0,a._)`+${E}`);return;case"integer":C.elseIf((0,a._)`${D} === "boolean" || ${E} === null
|| (${D} === "string" && ${E} && ${E} == +${E} && !(${E} % 1))`).assign($,(0,a._)`+${E}`);return;case"boolean":C.elseIf((0,a._)`${E} === "false" || ${E} === 0 || ${E} === null`).assign($,!1).elseIf((0,a._)`${E} === "true" || ${E} === 1`).assign($,!0);return;case"null":C.elseIf((0,a._)`${E} === "" || ${E} === 0 || ${E} === false`),C.assign($,null);return;case"array":C.elseIf((0,a._)`${D} === "string" || ${D} === "number"
|| ${D} === "boolean" || ${E} === null`).assign($,(0,a._)`[${E}]`)}}}function h({gen:_,parentData:A,parentDataProperty:F},C){_.if((0,a._)`${A} !== undefined`,()=>_.assign((0,a._)`${A}[${F}]`,C))}function g(_,A,F,C=p.Correct){const E=C===p.Correct?a.operators.EQ:a.operators.NEQ;let b;switch(_){case"null":return(0,a._)`${A} ${E} null`;case"array":b=(0,a._)`Array.isArray(${A})`;break;case"object":b=(0,a._)`${A} && typeof ${A} == "object" && !Array.isArray(${A})`;break;case"integer":b=D((0,a._)`!(${A} % 1) && !isNaN(${A})`);break;case"number":b=D();break;default:return(0,a._)`typeof ${A} ${E} ${_}`}return C===p.Correct?b:(0,a.not)(b);function D($=a.nil){return(0,a.and)((0,a._)`typeof ${A} == "number"`,$,F?(0,a._)`isFinite(${A})`:a.nil)}}r.checkDataType=g;function y(_,A,F,C){if(_.length===1)return g(_[0],A,F,C);let E;const b=(0,s.toHash)(_);if(b.array&&b.object){const D=(0,a._)`typeof ${A} != "object"`;E=b.null?D:(0,a._)`!${A} || ${D}`,delete b.null,delete b.array,delete b.object}else E=a.nil;b.number&&delete b.integer;for(const D in b)E=(0,a.and)(E,g(D,A,F,C));return E}r.checkDataTypes=y;const v={message:({schema:_})=>`must be ${_}`,params:({schema:_,schemaValue:A})=>typeof _=="string"?(0,a._)`{type: ${_}}`:(0,a._)`{type: ${A}}`};function d(_){const A=l(_);(0,n.reportError)(A,v)}r.reportTypeError=d;function l(_){const{gen:A,data:F,schema:C}=_,E=(0,s.schemaRefOrVal)(_,C,"type");return{gen:A,keyword:"type",data:F,schema:C.type,schemaCode:E,schemaValue:E,parentSchema:C,params:{},it:_}}}(pt);var Ut={};Object.defineProperty(Ut,"__esModule",{value:!0}),Ut.assignDefaults=void 0;const Gr=ae,hc=pe;function pc(r,e){const{properties:t,items:n}=r.schema;if(e==="object"&&t)for(const a in t)Xo(r,a,t[a].default);else e==="array"&&Array.isArray(n)&&n.forEach((a,s)=>Xo(r,s,a.default))}Ut.assignDefaults=pc;function Xo(r,e,t){const{gen:n,compositeRule:a,data:s,opts:p}=r;if(t===void 0)return;const c=(0,Gr._)`${s}${(0,Gr.getProperty)(e)}`;if(a){(0,hc.checkStrictMode)(r,`default is ignored for: ${c}`);return}let x=(0,Gr._)`${c} === undefined`;p.useDefaults==="empty"&&(x=(0,Gr._)`${x} || ${c} === null || ${c} === ""`),n.if(x,(0,Gr._)`${c} = ${(0,Gr.stringify)(t)}`)}var ir={},oe={};Object.defineProperty(oe,"__esModule",{value:!0}),oe.validateUnion=oe.validateArray=oe.usePattern=oe.callValidateCode=oe.schemaProperties=oe.allSchemaProperties=oe.noPropertyInData=oe.propertyInData=oe.isOwnProperty=oe.hasPropFunc=oe.reportMissingProp=oe.checkMissingProp=oe.checkReportMissingProp=void 0;const ye=ae,$n=pe,Er=sr,xc=pe;function vc(r,e){const{gen:t,data:n,it:a}=r;t.if(wn(t,n,e,a.opts.ownProperties),()=>{r.setParams({missingProperty:(0,ye._)`${e}`},!0),r.error()})}oe.checkReportMissingProp=vc;function mc({gen:r,data:e,it:{opts:t}},n,a){return(0,ye.or)(...n.map(s=>(0,ye.and)(wn(r,e,s,t.ownProperties),(0,ye._)`${a} = ${s}`)))}oe.checkMissingProp=mc;function yc(r,e){r.setParams({missingProperty:e},!0),r.error()}oe.reportMissingProp=yc;function Jo(r){return r.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,ye._)`Object.prototype.hasOwnProperty`})}oe.hasPropFunc=Jo;function Sn(r,e,t){return(0,ye._)`${Jo(r)}.call(${e}, ${t})`}oe.isOwnProperty=Sn;function gc(r,e,t,n){const a=(0,ye._)`${e}${(0,ye.getProperty)(t)} !== undefined`;return n?(0,ye._)`${a} && ${Sn(r,e,t)}`:a}oe.propertyInData=gc;function wn(r,e,t,n){const a=(0,ye._)`${e}${(0,ye.getProperty)(t)} === undefined`;return n?(0,ye.or)(a,(0,ye.not)(Sn(r,e,t))):a}oe.noPropertyInData=wn;function Yo(r){return r?Object.keys(r).filter(e=>e!=="__proto__"):[]}oe.allSchemaProperties=Yo;function _c(r,e){return Yo(e).filter(t=>!(0,$n.alwaysValidSchema)(r,e[t]))}oe.schemaProperties=_c;function Ec({schemaCode:r,data:e,it:{gen:t,topSchemaRef:n,schemaPath:a,errorPath:s},it:p},c,x,o){const i=o?(0,ye._)`${r}, ${e}, ${n}${a}`:e,f=[[Er.default.instancePath,(0,ye.strConcat)(Er.default.instancePath,s)],[Er.default.parentData,p.parentData],[Er.default.parentDataProperty,p.parentDataProperty],[Er.default.rootData,Er.default.rootData]];p.opts.dynamicRef&&f.push([Er.default.dynamicAnchors,Er.default.dynamicAnchors]);const u=(0,ye._)`${i}, ${t.object(...f)}`;return x!==ye.nil?(0,ye._)`${c}.call(${x}, ${u})`:(0,ye._)`${c}(${u})`}oe.callValidateCode=Ec;const Ac=(0,ye._)`new RegExp`;function Cc({gen:r,it:{opts:e}},t){const n=e.unicodeRegExp?"u":"",{regExp:a}=e.code,s=a(t,n);return r.scopeValue("pattern",{key:s.toString(),ref:s,code:(0,ye._)`${a.code==="new RegExp"?Ac:(0,xc.useFunc)(r,a)}(${t}, ${n})`})}oe.usePattern=Cc;function bc(r){const{gen:e,data:t,keyword:n,it:a}=r,s=e.name("valid");if(a.allErrors){const c=e.let("valid",!0);return p(()=>e.assign(c,!1)),c}return e.var(s,!0),p(()=>e.break()),s;function p(c){const x=e.const("len",(0,ye._)`${t}.length`);e.forRange("i",0,x,o=>{r.subschema({keyword:n,dataProp:o,dataPropType:$n.Type.Num},s),e.if((0,ye.not)(s),c)})}}oe.validateArray=bc;function $c(r){const{gen:e,schema:t,keyword:n,it:a}=r;if(!Array.isArray(t))throw new Error("ajv implementation error");if(t.some(x=>(0,$n.alwaysValidSchema)(a,x))&&!a.opts.unevaluated)return;const p=e.let("valid",!1),c=e.name("_valid");e.block(()=>t.forEach((x,o)=>{const i=r.subschema({keyword:n,schemaProp:o,compositeRule:!0},c);e.assign(p,(0,ye._)`${p} || ${c}`),r.mergeValidEvaluated(i,c)||e.if((0,ye.not)(p))})),r.result(p,()=>r.reset(),()=>r.error(!0))}oe.validateUnion=$c,Object.defineProperty(ir,"__esModule",{value:!0}),ir.validateKeywordUsage=ir.validSchemaType=ir.funcKeywordCode=ir.macroKeywordCode=void 0;const je=ae,Pr=sr,Sc=oe,wc=dt;function Dc(r,e){const{gen:t,keyword:n,schema:a,parentSchema:s,it:p}=r,c=e.macro.call(p.self,a,s,p),x=Zo(t,n,c);p.opts.validateSchema!==!1&&p.self.validateSchema(c,!0);const o=t.name("valid");r.subschema({schema:c,schemaPath:je.nil,errSchemaPath:`${p.errSchemaPath}/${n}`,topSchemaRef:x,compositeRule:!0},o),r.pass(o,()=>r.error(!0))}ir.macroKeywordCode=Dc;function Bc(r,e){var t;const{gen:n,keyword:a,schema:s,parentSchema:p,$data:c,it:x}=r;Pc(x,e);const o=!c&&e.compile?e.compile.call(x.self,s,p,x):e.validate,i=Zo(n,a,o),f=n.let("valid");r.block$data(f,u),r.ok((t=e.valid)!==null&&t!==void 0?t:f);function u(){if(e.errors===!1)y(),e.modifying&&Qo(r),v(()=>r.error());else{const d=e.async?h():g();e.modifying&&Qo(r),v(()=>Fc(r,d))}}function h(){const d=n.let("ruleErrs",null);return n.try(()=>y((0,je._)`await `),l=>n.assign(f,!1).if((0,je._)`${l} instanceof ${x.ValidationError}`,()=>n.assign(d,(0,je._)`${l}.errors`),()=>n.throw(l))),d}function g(){const d=(0,je._)`${i}.errors`;return n.assign(d,null),y(je.nil),d}function y(d=e.async?(0,je._)`await `:je.nil){const l=x.opts.passContext?Pr.default.this:Pr.default.self,_=!("compile"in e&&!c||e.schema===!1);n.assign(f,(0,je._)`${d}${(0,Sc.callValidateCode)(r,i,l,_)}`,e.modifying)}function v(d){var l;n.if((0,je.not)((l=e.valid)!==null&&l!==void 0?l:f),d)}}ir.funcKeywordCode=Bc;function Qo(r){const{gen:e,data:t,it:n}=r;e.if(n.parentData,()=>e.assign(t,(0,je._)`${n.parentData}[${n.parentDataProperty}]`))}function Fc(r,e){const{gen:t}=r;t.if((0,je._)`Array.isArray(${e})`,()=>{t.assign(Pr.default.vErrors,(0,je._)`${Pr.default.vErrors} === null ? ${e} : ${Pr.default.vErrors}.concat(${e})`).assign(Pr.default.errors,(0,je._)`${Pr.default.vErrors}.length`),(0,wc.extendErrors)(r)},()=>r.error())}function Pc({schemaEnv:r},e){if(e.async&&!r.$async)throw new Error("async keyword in sync schema")}function Zo(r,e,t){if(t===void 0)throw new Error(`keyword "${e}" failed to compile`);return r.scopeValue("keyword",typeof t=="function"?{ref:t}:{ref:t,code:(0,je.stringify)(t)})}function Oc(r,e,t=!1){return!e.length||e.some(n=>n==="array"?Array.isArray(r):n==="object"?r&&typeof r=="object"&&!Array.isArray(r):typeof r==n||t&&typeof r>"u")}ir.validSchemaType=Oc;function kc({schema:r,opts:e,self:t,errSchemaPath:n},a,s){if(Array.isArray(a.keyword)?!a.keyword.includes(s):a.keyword!==s)throw new Error("ajv implementation error");const p=a.dependencies;if(p!=null&&p.some(c=>!Object.prototype.hasOwnProperty.call(r,c)))throw new Error(`parent schema must have dependencies of ${s}: ${p.join(",")}`);if(a.validateSchema&&!a.validateSchema(r[s])){const x=`keyword "${s}" value is invalid at path "${n}": `+t.errorsText(a.validateSchema.errors);if(e.validateSchema==="log")t.logger.error(x);else throw new Error(x)}}ir.validateKeywordUsage=kc;var Ar={};Object.defineProperty(Ar,"__esModule",{value:!0}),Ar.extendSubschemaMode=Ar.extendSubschemaData=Ar.getSubschema=void 0;const cr=ae,es=pe;function Rc(r,{keyword:e,schemaProp:t,schema:n,schemaPath:a,errSchemaPath:s,topSchemaRef:p}){if(e!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){const c=r.schema[e];return t===void 0?{schema:c,schemaPath:(0,cr._)`${r.schemaPath}${(0,cr.getProperty)(e)}`,errSchemaPath:`${r.errSchemaPath}/${e}`}:{schema:c[t],schemaPath:(0,cr._)`${r.schemaPath}${(0,cr.getProperty)(e)}${(0,cr.getProperty)(t)}`,errSchemaPath:`${r.errSchemaPath}/${e}/${(0,es.escapeFragment)(t)}`}}if(n!==void 0){if(a===void 0||s===void 0||p===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:a,topSchemaRef:p,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')}Ar.getSubschema=Rc;function Tc(r,e,{dataProp:t,dataPropType:n,data:a,dataTypes:s,propertyName:p}){if(a!==void 0&&t!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:c}=e;if(t!==void 0){const{errorPath:o,dataPathArr:i,opts:f}=e,u=c.let("data",(0,cr._)`${e.data}${(0,cr.getProperty)(t)}`,!0);x(u),r.errorPath=(0,cr.str)`${o}${(0,es.getErrorPath)(t,n,f.jsPropertySyntax)}`,r.parentDataProperty=(0,cr._)`${t}`,r.dataPathArr=[...i,r.parentDataProperty]}if(a!==void 0){const o=a instanceof cr.Name?a:c.let("data",a,!0);x(o),p!==void 0&&(r.propertyName=p)}s&&(r.dataTypes=s);function x(o){r.data=o,r.dataLevel=e.dataLevel+1,r.dataTypes=[],e.definedProperties=new Set,r.parentData=e.data,r.dataNames=[...e.dataNames,o]}}Ar.extendSubschemaData=Tc;function Ic(r,{jtdDiscriminator:e,jtdMetadata:t,compositeRule:n,createErrors:a,allErrors:s}){n!==void 0&&(r.compositeRule=n),a!==void 0&&(r.createErrors=a),s!==void 0&&(r.allErrors=s),r.jtdDiscriminator=e,r.jtdMetadata=t}Ar.extendSubschemaMode=Ic;var Oe={},rs=function r(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,a,s;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(a=n;a--!==0;)if(!r(e[a],t[a]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(a=n;a--!==0;)if(!Object.prototype.hasOwnProperty.call(t,s[a]))return!1;for(a=n;a--!==0;){var p=s[a];if(!r(e[p],t[p]))return!1}return!0}return e!==e&&t!==t},ts={exports:{}},Cr=ts.exports=function(r,e,t){typeof e=="function"&&(t=e,e={}),t=e.cb||t;var n=typeof t=="function"?t:t.pre||function(){},a=t.post||function(){};Lt(e,n,a,r,"",r)};Cr.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},Cr.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},Cr.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},Cr.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 Lt(r,e,t,n,a,s,p,c,x,o){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,a,s,p,c,x,o);for(var i in n){var f=n[i];if(Array.isArray(f)){if(i in Cr.arrayKeywords)for(var u=0;u<f.length;u++)Lt(r,e,t,f[u],a+"/"+i+"/"+u,s,a,i,n,u)}else if(i in Cr.propsKeywords){if(f&&typeof f=="object")for(var h in f)Lt(r,e,t,f[h],a+"/"+i+"/"+Nc(h),s,a,i,n,h)}else(i in Cr.keywords||r.allKeys&&!(i in Cr.skipKeywords))&&Lt(r,e,t,f,a+"/"+i,s,a,i,n)}t(n,a,s,p,c,x,o)}}function Nc(r){return r.replace(/~/g,"~0").replace(/\//g,"~1")}var jc=ts.exports;Object.defineProperty(Oe,"__esModule",{value:!0}),Oe.getSchemaRefs=Oe.resolveUrl=Oe.normalizeId=Oe._getFullPath=Oe.getFullPath=Oe.inlineRef=void 0;const Mc=pe,Uc=rs,Lc=jc,Hc=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function qc(r,e=!0){return typeof r=="boolean"?!0:e===!0?!Dn(r):e?ns(r)<=e:!1}Oe.inlineRef=qc;const zc=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Dn(r){for(const e in r){if(zc.has(e))return!0;const t=r[e];if(Array.isArray(t)&&t.some(Dn)||typeof t=="object"&&Dn(t))return!0}return!1}function ns(r){let e=0;for(const t in r){if(t==="$ref")return 1/0;if(e++,!Hc.has(t)&&(typeof r[t]=="object"&&(0,Mc.eachItem)(r[t],n=>e+=ns(n)),e===1/0))return 1/0}return e}function as(r,e="",t){t!==!1&&(e=Xr(e));const n=r.parse(e);return os(r,n)}Oe.getFullPath=as;function os(r,e){return r.serialize(e).split("#")[0]+"#"}Oe._getFullPath=os;const Vc=/#\/?$/;function Xr(r){return r?r.replace(Vc,""):""}Oe.normalizeId=Xr;function Kc(r,e,t){return t=Xr(t),r.resolve(e,t)}Oe.resolveUrl=Kc;const Wc=/^[a-z_][-a-z0-9._]*$/i;function Gc(r,e){if(typeof r=="boolean")return{};const{schemaId:t,uriResolver:n}=this.opts,a=Xr(r[t]||e),s={"":a},p=as(n,a,!1),c={},x=new Set;return Lc(r,{allKeys:!0},(f,u,h,g)=>{if(g===void 0)return;const y=p+u;let v=s[g];typeof f[t]=="string"&&(v=d.call(this,f[t])),l.call(this,f.$anchor),l.call(this,f.$dynamicAnchor),s[u]=v;function d(_){const A=this.opts.uriResolver.resolve;if(_=Xr(v?A(v,_):_),x.has(_))throw i(_);x.add(_);let F=this.refs[_];return typeof F=="string"&&(F=this.refs[F]),typeof F=="object"?o(f,F.schema,_):_!==Xr(y)&&(_[0]==="#"?(o(f,c[_],_),c[_]=f):this.refs[_]=y),_}function l(_){if(typeof _=="string"){if(!Wc.test(_))throw new Error(`invalid anchor "${_}"`);d.call(this,`#${_}`)}}}),c;function o(f,u,h){if(u!==void 0&&!Uc(f,u))throw i(h)}function i(f){return new Error(`reference "${f}" resolves to more than one schema`)}}Oe.getSchemaRefs=Gc,Object.defineProperty(Qe,"__esModule",{value:!0}),Qe.getData=Qe.KeywordCxt=Qe.validateFunctionCode=void 0;const ss=Wr,is=pt,Bn=vr,Ht=pt,Xc=Ut,xt=ir,Fn=Ar,G=ae,Z=sr,Jc=Oe,mr=pe,vt=dt;function Yc(r){if(ls(r)&&(ds(r),fs(r))){eu(r);return}cs(r,()=>(0,ss.topBoolOrEmptySchema)(r))}Qe.validateFunctionCode=Yc;function cs({gen:r,validateName:e,schema:t,schemaEnv:n,opts:a},s){a.code.es5?r.func(e,(0,G._)`${Z.default.data}, ${Z.default.valCxt}`,n.$async,()=>{r.code((0,G._)`"use strict"; ${us(t,a)}`),Zc(r,a),r.code(s)}):r.func(e,(0,G._)`${Z.default.data}, ${Qc(a)}`,n.$async,()=>r.code(us(t,a)).code(s))}function Qc(r){return(0,G._)`{${Z.default.instancePath}="", ${Z.default.parentData}, ${Z.default.parentDataProperty}, ${Z.default.rootData}=${Z.default.data}${r.dynamicRef?(0,G._)`, ${Z.default.dynamicAnchors}={}`:G.nil}}={}`}function Zc(r,e){r.if(Z.default.valCxt,()=>{r.var(Z.default.instancePath,(0,G._)`${Z.default.valCxt}.${Z.default.instancePath}`),r.var(Z.default.parentData,(0,G._)`${Z.default.valCxt}.${Z.default.parentData}`),r.var(Z.default.parentDataProperty,(0,G._)`${Z.default.valCxt}.${Z.default.parentDataProperty}`),r.var(Z.default.rootData,(0,G._)`${Z.default.valCxt}.${Z.default.rootData}`),e.dynamicRef&&r.var(Z.default.dynamicAnchors,(0,G._)`${Z.default.valCxt}.${Z.default.dynamicAnchors}`)},()=>{r.var(Z.default.instancePath,(0,G._)`""`),r.var(Z.default.parentData,(0,G._)`undefined`),r.var(Z.default.parentDataProperty,(0,G._)`undefined`),r.var(Z.default.rootData,Z.default.data),e.dynamicRef&&r.var(Z.default.dynamicAnchors,(0,G._)`{}`)})}function eu(r){const{schema:e,opts:t,gen:n}=r;cs(r,()=>{t.$comment&&e.$comment&&ps(r),ou(r),n.let(Z.default.vErrors,null),n.let(Z.default.errors,0),t.unevaluated&&ru(r),hs(r),cu(r)})}function ru(r){const{gen:e,validateName:t}=r;r.evaluated=e.const("evaluated",(0,G._)`${t}.evaluated`),e.if((0,G._)`${r.evaluated}.dynamicProps`,()=>e.assign((0,G._)`${r.evaluated}.props`,(0,G._)`undefined`)),e.if((0,G._)`${r.evaluated}.dynamicItems`,()=>e.assign((0,G._)`${r.evaluated}.items`,(0,G._)`undefined`))}function us(r,e){const t=typeof r=="object"&&r[e.schemaId];return t&&(e.code.source||e.code.process)?(0,G._)`/*# sourceURL=${t} */`:G.nil}function tu(r,e){if(ls(r)&&(ds(r),fs(r))){nu(r,e);return}(0,ss.boolOrEmptySchema)(r,e)}function fs({schema:r,self:e}){if(typeof r=="boolean")return!r;for(const t in r)if(e.RULES.all[t])return!0;return!1}function ls(r){return typeof r.schema!="boolean"}function nu(r,e){const{schema:t,gen:n,opts:a}=r;a.$comment&&t.$comment&&ps(r),su(r),iu(r);const s=n.const("_errs",Z.default.errors);hs(r,s),n.var(e,(0,G._)`${s} === ${Z.default.errors}`)}function ds(r){(0,mr.checkUnknownRules)(r),au(r)}function hs(r,e){if(r.opts.jtd)return xs(r,[],!1,e);const t=(0,is.getSchemaTypes)(r.schema),n=(0,is.coerceAndCheckDataType)(r,t);xs(r,t,!n,e)}function au(r){const{schema:e,errSchemaPath:t,opts:n,self:a}=r;e.$ref&&n.ignoreKeywordsWithRef&&(0,mr.schemaHasRulesButRef)(e,a.RULES)&&a.logger.warn(`$ref: keywords ignored in schema at path "${t}"`)}function ou(r){const{schema:e,opts:t}=r;e.default!==void 0&&t.useDefaults&&t.strictSchema&&(0,mr.checkStrictMode)(r,"default is ignored in the schema root")}function su(r){const e=r.schema[r.opts.schemaId];e&&(r.baseId=(0,Jc.resolveUrl)(r.opts.uriResolver,r.baseId,e))}function iu(r){if(r.schema.$async&&!r.schemaEnv.$async)throw new Error("async schema in sync schema")}function ps({gen:r,schemaEnv:e,schema:t,errSchemaPath:n,opts:a}){const s=t.$comment;if(a.$comment===!0)r.code((0,G._)`${Z.default.self}.logger.l