nemar-cli 0.10.27-PR2000.ef02d3c → 0.10.27-PR2001.0b15c9a

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,40 +1,40 @@
1
1
  #!/usr/bin/env bun
2
2
  // @bun
3
- var hS=Object.create;var{getPrototypeOf:mS,defineProperty:Bo,getOwnPropertyNames:gS}=Object;var od=Object.prototype.hasOwnProperty;function yS(e){return this[e]}var _S,vS,_c=(e,t,r)=>{var n=e!=null&&typeof e==="object";if(n){var s=t?_S??=new WeakMap:vS??=new WeakMap,o=s.get(e);if(o)return o}r=e!=null?hS(mS(e)):{};let i=t||!e||!e.__esModule||!od.call(e,"default")?Bo(r,"default",{value:e,enumerable:!0}):r;if(e&&typeof e==="object"||typeof e==="function"){for(let a of gS(e))if(!od.call(i,a))Bo(i,a,{get:yS.bind(e,a),enumerable:!0})}if(n)s.set(e,i);return i};var g=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var $S=(e)=>e;function ES(e,t){this[e]=$S.bind(null,t)}var _9=(e,t)=>{for(var r in t)Bo(e,r,{get:t[r],enumerable:!0,configurable:!0,set:ES.bind(t,r)})};var F=(e,t,r)=>()=>{if(e)try{t=e(e=0)}catch(n){r=[n]}if(r)throw r[0];return t};var v9=(e,t,r)=>{for(var n in t)Bo(e,n,{get:t[n],set:r[n],enumerable:!0,configurable:!0})},$9=import.meta.require;function Wo(e){let t=[],r="",n="start",s=!1;for(let o of e)switch(o){case"\\":{if(n==="index")throw Error("Invalid character in an index");if(n==="indexEnd")throw Error("Invalid character after an index");if(s)r+=o;n="property",s=!s;break}case".":{if(n==="index")throw Error("Invalid character in an index");if(n==="indexEnd"){n="property";break}if(s){s=!1,r+=o;break}if(vc.has(r))return[];t.push(r),r="",n="property";break}case"[":{if(n==="index")throw Error("Invalid character in an index");if(n==="indexEnd"){n="index";break}if(s){s=!1,r+=o;break}if(n==="property"){if(vc.has(r))return[];t.push(r),r=""}n="index";break}case"]":{if(n==="index"){t.push(Number.parseInt(r,10)),r="",n="indexEnd";break}if(n==="indexEnd")throw Error("Invalid character after an index")}default:{if(n==="index"&&!wS.has(o))throw Error("Invalid character in an index");if(n==="indexEnd")throw Error("Invalid character after an index");if(n==="start")n="property";if(s)s=!1,r+="\\";r+=o}}if(s)r+="\\";switch(n){case"property":{if(vc.has(r))return[];t.push(r);break}case"index":throw Error("Index was not closed");case"start":{t.push("");break}}return t}function $c(e,t){if(typeof t!=="number"&&Array.isArray(e)){let r=Number.parseInt(t,10);return Number.isInteger(r)&&e[r]===e[t]}return!1}function id(e,t){if($c(e,t))throw Error("Cannot use string index")}function ad(e,t,r){if(!yn(e)||typeof t!=="string")return r===void 0?e:r;let n=Wo(t);if(n.length===0)return r;for(let s=0;s<n.length;s++){let o=n[s];if($c(e,o))e=s===n.length-1?void 0:null;else e=e[o];if(e===void 0||e===null){if(s!==n.length-1)return r;break}}return e===void 0?r:e}function Ec(e,t,r){if(!yn(e)||typeof t!=="string")return e;let n=e,s=Wo(t);for(let o=0;o<s.length;o++){let i=s[o];if(id(e,i),o===s.length-1)e[i]=r;else if(!yn(e[i]))e[i]=typeof s[o+1]==="number"?[]:{};e=e[i]}return n}function cd(e,t){if(!yn(e)||typeof t!=="string")return!1;let r=Wo(t);for(let n=0;n<r.length;n++){let s=r[n];if(id(e,s),n===r.length-1)return delete e[s],!0;if(e=e[s],!yn(e))return!1}}function ud(e,t){if(!yn(e)||typeof t!=="string")return!1;let r=Wo(t);if(r.length===0)return!1;for(let n of r){if(!yn(e)||!(n in e)||$c(e,n))return!1;e=e[n]}return!0}var yn=(e)=>{let t=typeof e;return e!==null&&(t==="object"||t==="function")},vc,wS;var ld=F(()=>{vc=new Set(["__proto__","prototype","constructor"]),wS=new Set("0123456789")});import Se from"path";import dd from"os";import wc from"process";function Sc(e,{suffix:t="nodejs"}={}){if(typeof e!=="string")throw TypeError(`Expected a string, got ${typeof e}`);if(t)e+=`-${t}`;if(wc.platform==="darwin")return bS(e);if(wc.platform==="win32")return SS(e);return xS(e)}var Rr,bc,Dn,bS=(e)=>{let t=Se.join(Rr,"Library");return{data:Se.join(t,"Application Support",e),config:Se.join(t,"Preferences",e),cache:Se.join(t,"Caches",e),log:Se.join(t,"Logs",e),temp:Se.join(bc,e)}},SS=(e)=>{let t=Dn.APPDATA||Se.join(Rr,"AppData","Roaming"),r=Dn.LOCALAPPDATA||Se.join(Rr,"AppData","Local");return{data:Se.join(r,e,"Data"),config:Se.join(t,e,"Config"),cache:Se.join(r,e,"Cache"),log:Se.join(r,e,"Log"),temp:Se.join(bc,e)}},xS=(e)=>{let t=Se.basename(Rr);return{data:Se.join(Dn.XDG_DATA_HOME||Se.join(Rr,".local","share"),e),config:Se.join(Dn.XDG_CONFIG_HOME||Se.join(Rr,".config"),e),cache:Se.join(Dn.XDG_CACHE_HOME||Se.join(Rr,".cache"),e),log:Se.join(Dn.XDG_STATE_HOME||Se.join(Rr,".local","state"),e),temp:Se.join(bc,t,e)}};var fd=F(()=>{Rr=dd.homedir(),bc=dd.tmpdir(),{env:Dn}=wc});var RS=(e,t)=>{let{onError:r}=t;return function(...s){return e.apply(void 0,s).catch(r)}},Ct;var pd=F(()=>{Ct=RS});var TS=(e,t)=>{let{onError:r}=t;return function(...s){try{return e.apply(void 0,s)}catch(o){return r(o)}}},Rt;var hd=F(()=>{Rt=TS});var md=250;var gd=()=>{};var kS=(e,t)=>{let{isRetriable:r}=t;return function(s){let{timeout:o}=s,i=s.interval??md,a=Date.now()+o;return function c(...u){return e.apply(void 0,u).catch((d)=>{if(!r(d))throw d;if(Date.now()>=a)throw d;let l=Math.round(i*Math.random());if(l>0)return new Promise((f)=>setTimeout(f,l)).then(()=>c.apply(void 0,u));else return c.apply(void 0,u)})}}},jt;var yd=F(()=>{gd();jt=kS});var OS=(e,t)=>{let{isRetriable:r}=t;return function(s){let{timeout:o}=s,i=Date.now()+o;return function(...c){while(!0)try{return e.apply(void 0,c)}catch(u){if(!r(u))throw u;if(Date.now()>=i)throw u;continue}}}},qt;var _d=F(()=>{qt=OS});var xc=F(()=>{pd();hd();yd();_d()});var zs,Rc;var vd=F(()=>{Tc();zs={isChangeErrorOk:(e)=>{if(!zs.isNodeError(e))return!1;let{code:t}=e;if(t==="ENOSYS")return!0;if(!$d&&(t==="EINVAL"||t==="EPERM"))return!0;return!1},isNodeError:(e)=>e instanceof Error,isRetriableError:(e)=>{if(!zs.isNodeError(e))return!1;let{code:t}=e;if(t==="EMFILE"||t==="ENFILE"||t==="EAGAIN"||t==="EBUSY"||t==="EACCESS"||t==="EACCES"||t==="EACCS"||t==="EPERM")return!0;return!1},onChangeError:(e)=>{if(!zs.isNodeError(e))throw e;if(zs.isChangeErrorOk(e))return;throw e}},Rc=zs});import Ed from"process";var Gs,tt,$d,Fe;var Tc=F(()=>{vd();Gs={onError:Rc.onChangeError},tt={onError:()=>{return}},$d=Ed.getuid?!Ed.getuid():!1,Fe={isRetriable:Rc.isRetriableError}});import ie from"fs";import{promisify as ze}from"util";var AS,De;var kc=F(()=>{xc();xc();Tc();AS={attempt:{chmod:Ct(ze(ie.chmod),Gs),chown:Ct(ze(ie.chown),Gs),close:Ct(ze(ie.close),tt),fsync:Ct(ze(ie.fsync),tt),mkdir:Ct(ze(ie.mkdir),tt),realpath:Ct(ze(ie.realpath),tt),stat:Ct(ze(ie.stat),tt),unlink:Ct(ze(ie.unlink),tt),chmodSync:Rt(ie.chmodSync,Gs),chownSync:Rt(ie.chownSync,Gs),closeSync:Rt(ie.closeSync,tt),existsSync:Rt(ie.existsSync,tt),fsyncSync:Rt(ie.fsync,tt),mkdirSync:Rt(ie.mkdirSync,tt),realpathSync:Rt(ie.realpathSync,tt),statSync:Rt(ie.statSync,tt),unlinkSync:Rt(ie.unlinkSync,tt)},retry:{close:jt(ze(ie.close),Fe),fsync:jt(ze(ie.fsync),Fe),open:jt(ze(ie.open),Fe),readFile:jt(ze(ie.readFile),Fe),rename:jt(ze(ie.rename),Fe),stat:jt(ze(ie.stat),Fe),write:jt(ze(ie.write),Fe),writeFile:jt(ze(ie.writeFile),Fe),closeSync:qt(ie.closeSync,Fe),fsyncSync:qt(ie.fsyncSync,Fe),openSync:qt(ie.openSync,Fe),readFileSync:qt(ie.readFileSync,Fe),renameSync:qt(ie.renameSync,Fe),statSync:qt(ie.statSync,Fe),writeSync:qt(ie.writeSync,Fe),writeFileSync:qt(ie.writeFileSync,Fe)}},De=AS});import _n from"process";var wd="utf8",Oc=438,bd=511,Sd,xd,Rd,Td=1000,kd,X9,Ac=128;var Pc=F(()=>{Sd={},xd=_n.geteuid?_n.geteuid():-1,Rd=_n.getegid?_n.getegid():-1,kd=!!_n.getuid,X9=_n.getuid?!_n.getuid():!1});var Od=(e)=>e instanceof Error&&("code"in e),Nc=(e)=>typeof e==="string",Yo=(e)=>e===void 0;var Ad=()=>{};var Pd=()=>{};import Nd from"process";var Id,Xo;var Ic=F(()=>{Id=Nd.platform==="linux",Xo=Nd.platform==="win32"});var Cc,Cd;var jd=F(()=>{Ic();Cc=["SIGHUP","SIGINT","SIGTERM"];if(!Xo)Cc.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(Id)Cc.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");Cd=Cc});import Mn from"process";class qd{constructor(){this.callbacks=new Set,this.exited=!1,this.exit=(e)=>{if(this.exited)return;this.exited=!0;for(let t of this.callbacks)t();if(e)if(Xo&&(e!=="SIGINT"&&e!=="SIGTERM"&&e!=="SIGKILL"))Mn.kill(Mn.pid,"SIGTERM");else Mn.kill(Mn.pid,e)},this.hook=()=>{Mn.once("exit",()=>this.exit());for(let e of Cd)try{Mn.once(e,()=>this.exit(e))}catch{}},this.register=(e)=>(this.callbacks.add(e),()=>{this.callbacks.delete(e)}),this.hook()}}var Dd;var Md=F(()=>{Ic();jd();Dd=new qd});var PS,Ld;var Ud=F(()=>{Md();PS=Dd.register,Ld=PS});import NS from"path";var dt,Ks;var Fd=F(()=>{kc();Ud();Pc();dt={store:{},create:(e)=>{let t=`000000${Math.floor(Math.random()*16777215).toString(16)}`.slice(-6),r=Date.now().toString().slice(-10),n="tmp-",s=`.tmp-${r}${t}`;return`${e}${s}`},get:(e,t,r=!0)=>{let n=dt.truncate(t(e));if(n in dt.store)return dt.get(e,t,r);return dt.store[n]=r,[n,()=>delete dt.store[n]]},purge:(e)=>{if(!dt.store[e])return;delete dt.store[e],De.attempt.unlink(e)},purgeSync:(e)=>{if(!dt.store[e])return;delete dt.store[e],De.attempt.unlinkSync(e)},purgeSyncAll:()=>{for(let e in dt.store)dt.purgeSync(e)},truncate:(e)=>{let t=NS.basename(e);if(t.length<=Ac)return e;let r=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(t);if(!r)return e;let n=t.length-Ac;return`${e.slice(0,-t.length)}${r[1]}${r[2].slice(0,-n)}${r[3]}`}};Ld(dt.purgeSyncAll);Ks=dt});import IS from"path";function jc(e,t,r=Sd){if(Nc(r))return jc(e,t,{encoding:r});let s={timeout:r.timeout??Td},o=null,i=null,a=null;try{let c=De.attempt.realpathSync(e),u=!!c;e=c||e,[i,o]=Ks.get(e,r.tmpCreate||Ks.create,r.tmpPurge!==!1);let d=kd&&Yo(r.chown),l=Yo(r.mode);if(u&&(d||l)){let p=De.attempt.statSync(e);if(p){if(r={...r},d)r.chown={uid:p.uid,gid:p.gid};if(l)r.mode=p.mode}}if(!u){let p=IS.dirname(e);De.attempt.mkdirSync(p,{mode:bd,recursive:!0})}if(a=De.retry.openSync(s)(i,"w",r.mode||Oc),r.tmpCreated)r.tmpCreated(i);if(Nc(t))De.retry.writeSync(s)(a,t,0,r.encoding||wd);else if(!Yo(t))De.retry.writeSync(s)(a,t,0,t.length,0);if(r.fsync!==!1)if(r.fsyncWait!==!1)De.retry.fsyncSync(s)(a);else De.attempt.fsync(a);if(De.retry.closeSync(s)(a),a=null,r.chown&&(r.chown.uid!==xd||r.chown.gid!==Rd))De.attempt.chownSync(i,r.chown.uid,r.chown.gid);if(r.mode&&r.mode!==Oc)De.attempt.chmodSync(i,r.mode);try{De.retry.renameSync(s)(i,e)}catch(p){if(!Od(p))throw p;if(p.code!=="ENAMETOOLONG")throw p;De.retry.renameSync(s)(i,Ks.truncate(e))}o(),i=null}finally{if(a)De.attempt.closeSync(a);if(i)Ks.purge(i)}}var Vd=F(()=>{kc();Pc();Ad();Pd();Fd()});var Bs=g(function(Kd){Object.defineProperty(Kd,"__esModule",{value:!0});Kd.regexpCode=Kd.getEsmExportName=Kd.getProperty=Kd.safeStringify=Kd.stringify=Kd.strConcat=Kd.addCodeArg=Kd.str=Kd._=Kd.nil=Kd._Code=Kd.Name=Kd.IDENTIFIER=Kd._CodeOrName=void 0;class Jo{}Kd._CodeOrName=Jo;Kd.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class Ln extends Jo{constructor(e){super();if(!Kd.IDENTIFIER.test(e))throw Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}Kd.Name=Ln;class Tt extends Jo{constructor(e){super();this._items=typeof e==="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((t,r)=>`${t}${r}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((t,r)=>{if(r instanceof Ln)t[r.str]=(t[r.str]||0)+1;return t},{})}}Kd._Code=Tt;Kd.nil=new Tt("");function zd(e,...t){let r=[e[0]],n=0;while(n<t.length)Dc(r,t[n]),r.push(e[++n]);return new Tt(r)}Kd._=zd;var qc=new Tt("+");function Gd(e,...t){let r=[Hs(e[0])],n=0;while(n<t.length)r.push(qc),Dc(r,t[n]),r.push(qc,Hs(e[++n]));return CS(r),new Tt(r)}Kd.str=Gd;function Dc(e,t){if(t instanceof Tt)e.push(...t._items);else if(t instanceof Ln)e.push(t);else e.push(DS(t))}Kd.addCodeArg=Dc;function CS(e){let t=1;while(t<e.length-1){if(e[t]===qc){let r=jS(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function jS(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string"){if(t instanceof Ln||e[e.length-1]!=='"')return;if(typeof t!="string")return`${e.slice(0,-1)}${t}"`;if(t[0]==='"')return e.slice(0,-1)+t.slice(1);return}if(typeof t=="string"&&t[0]==='"'&&!(e instanceof Ln))return`"${e}${t.slice(1)}`;return}function qS(e,t){return t.emptyStr()?e:e.emptyStr()?t:Gd`${e}${t}`}Kd.strConcat=qS;function DS(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:Hs(Array.isArray(e)?e.join(","):e)}function MS(e){return new Tt(Hs(e))}Kd.stringify=MS;function Hs(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Kd.safeStringify=Hs;function LS(e){return typeof e=="string"&&Kd.IDENTIFIER.test(e)?new Tt(`.${e}`):zd`[${e}]`}Kd.getProperty=LS;function US(e){if(typeof e=="string"&&Kd.IDENTIFIER.test(e))return new Tt(`${e}`);throw Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}Kd.getEsmExportName=US;function FS(e){return new Tt(e.toString())}Kd.regexpCode=FS});var Fc=g(function(Yd){Object.defineProperty(Yd,"__esModule",{value:!0});Yd.ValueScope=Yd.ValueScopeName=Yd.Scope=Yd.varKinds=Yd.UsedValueState=void 0;var pe=Bs();class Bd extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`);this.value=e.value}}var Zo;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(Zo||(Yd.UsedValueState=Zo={}));Yd.varKinds={const:new pe.Name("const"),let:new pe.Name("let"),var:new pe.Name("var")};class Lc{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof pe.Name?e:this.name(e)}name(e){return new pe.Name(this._newName(e))}_newName(e){let t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){var t,r;if(((r=(t=this._parent)===null||t===void 0?void 0:t._prefixes)===null||r===void 0?void 0:r.has(e))||this._prefixes&&!this._prefixes.has(e))throw Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}Yd.Scope=Lc;class Uc extends pe.Name{constructor(e,t){super(t);this.prefix=e}setValue(e,{property:t,itemIndex:r}){this.value=e,this.scopePath=pe._`.${new pe.Name(t)}[${r}]`}}Yd.ValueScopeName=Uc;var ex=pe._`\n`;class Wd extends Lc{constructor(e){super(e);this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?ex:pe.nil}}get(){return this._scope}name(e){return new Uc(e,this._newName(e))}value(e,t){var r;if(t.ref===void 0)throw Error("CodeGen: ref must be passed in value");let n=this.toName(e),{prefix:s}=n,o=(r=t.key)!==null&&r!==void 0?r:t.ref,i=this._values[s];if(i){let u=i.get(o);if(u)return u}else i=this._values[s]=new Map;i.set(o,n);let a=this._scope[s]||(this._scope[s]=[]),c=a.length;return a[c]=t.ref,n.setValue(t,{property:s,itemIndex:c}),n}getValue(e,t){let r=this._values[e];if(!r)return;return r.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,(r)=>{if(r.scopePath===void 0)throw Error(`CodeGen: name "${r}" has no value`);return pe._`${e}${r.scopePath}`})}scopeCode(e=this._values,t,r){return this._reduceValues(e,(n)=>{if(n.value===void 0)throw Error(`CodeGen: name "${n}" has no value`);return n.value.code},t,r)}_reduceValues(e,t,r={},n){let s=pe.nil;for(let o in e){let i=e[o];if(!i)continue;let a=r[o]=r[o]||new Map;i.forEach((c)=>{if(a.has(c))return;a.set(c,Zo.Started);let u=t(c);if(u){let d=this.opts.es5?Yd.varKinds.var:Yd.varKinds.const;s=pe._`${s}${d} ${c} = ${u};${this.opts._n}`}else if(u=n===null||n===void 0?void 0:n(c))s=pe._`${s}${u}${this.opts._n}`;else throw new Bd(c);a.set(c,Zo.Completed)})}return s}}Yd.ValueScope=Wd});var Y=g(function(rt){Object.defineProperty(rt,"__esModule",{value:!0});rt.or=rt.and=rt.not=rt.CodeGen=rt.operators=rt.varKinds=rt.ValueScopeName=rt.ValueScope=rt.Scope=rt.Name=rt.regexpCode=rt.stringify=rt.getProperty=rt.nil=rt.strConcat=rt.str=rt._=void 0;var A=Bs(),xe=Fc(),Tr=Bs();Object.defineProperty(rt,"_",{enumerable:!0,get:function(){return Tr._}});Object.defineProperty(rt,"str",{enumerable:!0,get:function(){return Tr.str}});Object.defineProperty(rt,"strConcat",{enumerable:!0,get:function(){return Tr.strConcat}});Object.defineProperty(rt,"nil",{enumerable:!0,get:function(){return Tr.nil}});Object.defineProperty(rt,"getProperty",{enumerable:!0,get:function(){return Tr.getProperty}});Object.defineProperty(rt,"stringify",{enumerable:!0,get:function(){return Tr.stringify}});Object.defineProperty(rt,"regexpCode",{enumerable:!0,get:function(){return Tr.regexpCode}});Object.defineProperty(rt,"Name",{enumerable:!0,get:function(){return Tr.Name}});var oi=Fc();Object.defineProperty(rt,"Scope",{enumerable:!0,get:function(){return oi.Scope}});Object.defineProperty(rt,"ValueScope",{enumerable:!0,get:function(){return oi.ValueScope}});Object.defineProperty(rt,"ValueScopeName",{enumerable:!0,get:function(){return oi.ValueScopeName}});Object.defineProperty(rt,"varKinds",{enumerable:!0,get:function(){return oi.varKinds}});rt.operators={GT:new A._Code(">"),GTE:new A._Code(">="),LT:new A._Code("<"),LTE:new A._Code("<="),EQ:new A._Code("==="),NEQ:new A._Code("!=="),NOT:new A._Code("!"),OR:new A._Code("||"),AND:new A._Code("&&"),ADD:new A._Code("+")};class kr{optimizeNodes(){return this}optimizeNames(e,t){return this}}class Jd extends kr{constructor(e,t,r){super();this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){let r=e?xe.varKinds.var:this.varKind,n=this.rhs===void 0?"":` = ${this.rhs}`;return`${r} ${this.name}${n};`+t}optimizeNames(e,t){if(!e[this.name.str])return;if(this.rhs)this.rhs=Fn(this.rhs,e,t);return this}get names(){return this.rhs instanceof A._CodeOrName?this.rhs.names:{}}}class Gc extends kr{constructor(e,t,r){super();this.lhs=e,this.rhs=t,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(this.lhs instanceof A.Name&&!e[this.lhs.str]&&!this.sideEffects)return;return this.rhs=Fn(this.rhs,e,t),this}get names(){let e=this.lhs instanceof A.Name?{}:{...this.lhs.names};return si(e,this.rhs)}}class Qd extends Gc{constructor(e,t,r,n){super(e,r,n);this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class Zd extends kr{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class ef extends kr{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class tf extends kr{constructor(e){super();this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class rf extends kr{constructor(e){super();this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=Fn(this.code,e,t),this}get names(){return this.code instanceof A._CodeOrName?this.code.names:{}}}class ii extends kr{constructor(e=[]){super();this.nodes=e}render(e){return this.nodes.reduce((t,r)=>t+r.render(e),"")}optimizeNodes(){let{nodes:e}=this,t=e.length;while(t--){let r=e[t].optimizeNodes();if(Array.isArray(r))e.splice(t,1,...r);else if(r)e[t]=r;else e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){let{nodes:r}=this,n=r.length;while(n--){let s=r[n];if(s.optimizeNames(e,t))continue;sx(e,s.names),r.splice(n,1)}return r.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>vn(e,t.names),{})}}class Or extends ii{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class nf extends ii{}class Ws extends Or{}Ws.kind="else";class mr extends Or{constructor(e,t){super(t);this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);if(this.else)t+="else "+this.else.render(e);return t}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let t=this.else;if(t){let r=t.optimizeNodes();t=this.else=Array.isArray(r)?new Ws(r):r}if(t){if(e===!1)return t instanceof mr?t:t.nodes;if(this.nodes.length)return this;return new mr(uf(e),t instanceof mr?[t]:t.nodes)}if(e===!1||!this.nodes.length)return;return this}optimizeNames(e,t){var r;if(this.else=(r=this.else)===null||r===void 0?void 0:r.optimizeNames(e,t),!(super.optimizeNames(e,t)||this.else))return;return this.condition=Fn(this.condition,e,t),this}get names(){let e=super.names;if(si(e,this.condition),this.else)vn(e,this.else.names);return e}}mr.kind="if";class Un extends Or{}Un.kind="for";class sf extends Un{constructor(e){super();this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(!super.optimizeNames(e,t))return;return this.iteration=Fn(this.iteration,e,t),this}get names(){return vn(super.names,this.iteration.names)}}class of extends Un{constructor(e,t,r,n){super();this.varKind=e,this.name=t,this.from=r,this.to=n}render(e){let t=e.es5?xe.varKinds.var:this.varKind,{name:r,from:n,to:s}=this;return`for(${t} ${r}=${n}; ${r}<${s}; ${r}++)`+super.render(e)}get names(){let e=si(super.names,this.from);return si(e,this.to)}}class Vc extends Un{constructor(e,t,r,n){super();this.loop=e,this.varKind=t,this.name=r,this.iterable=n}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(!super.optimizeNames(e,t))return;return this.iterable=Fn(this.iterable,e,t),this}get names(){return vn(super.names,this.iterable.names)}}class ei extends Or{constructor(e,t,r){super();this.name=e,this.args=t,this.async=r}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}ei.kind="func";class ti extends ii{render(e){return"return "+super.render(e)}}ti.kind="return";class af extends Or{render(e){let t="try"+super.render(e);if(this.catch)t+=this.catch.render(e);if(this.finally)t+=this.finally.render(e);return t}optimizeNodes(){var e,t;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(t=this.finally)===null||t===void 0||t.optimizeNodes(),this}optimizeNames(e,t){var r,n;return super.optimizeNames(e,t),(r=this.catch)===null||r===void 0||r.optimizeNames(e,t),(n=this.finally)===null||n===void 0||n.optimizeNames(e,t),this}get names(){let e=super.names;if(this.catch)vn(e,this.catch.names);if(this.finally)vn(e,this.finally.names);return e}}class ri extends Or{constructor(e){super();this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}ri.kind="catch";class ni extends Or{render(e){return"finally"+super.render(e)}}ni.kind="finally";class cf{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?`
4
- `:""},this._extScope=e,this._scope=new xe.Scope({parent:e}),this._nodes=[new nf]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){let r=this._extScope.value(e,t);return(this._values[r.prefix]||(this._values[r.prefix]=new Set)).add(r),r}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,r,n){let s=this._scope.toName(t);if(r!==void 0&&n)this._constants[s.str]=r;return this._leafNode(new Jd(e,s,r)),s}const(e,t,r){return this._def(xe.varKinds.const,e,t,r)}let(e,t,r){return this._def(xe.varKinds.let,e,t,r)}var(e,t,r){return this._def(xe.varKinds.var,e,t,r)}assign(e,t,r){return this._leafNode(new Gc(e,t,r))}add(e,t){return this._leafNode(new Qd(e,rt.operators.ADD,t))}code(e){if(typeof e=="function")e();else if(e!==A.nil)this._leafNode(new rf(e));return this}object(...e){let t=["{"];for(let[r,n]of e){if(t.length>1)t.push(",");if(t.push(r),r!==n||this.opts.es5)t.push(":"),A.addCodeArg(t,n)}return t.push("}"),new A._Code(t)}if(e,t,r){if(this._blockNode(new mr(e)),t&&r)this.code(t).else().code(r).endIf();else if(t)this.code(t).endIf();else if(r)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new mr(e))}else(){return this._elseNode(new Ws)}endIf(){return this._endBlockNode(mr,Ws)}_for(e,t){if(this._blockNode(e),t)this.code(t).endFor();return this}for(e,t){return this._for(new sf(e),t)}forRange(e,t,r,n,s=this.opts.es5?xe.varKinds.var:xe.varKinds.let){let o=this._scope.toName(e);return this._for(new of(s,o,t,r),()=>n(o))}forOf(e,t,r,n=xe.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let o=t instanceof A.Name?t:this.var("_arr",t);return this.forRange("_i",0,A._`${o}.length`,(i)=>{this.var(s,A._`${o}[${i}]`),r(s)})}return this._for(new Vc("of",n,s,t),()=>r(s))}forIn(e,t,r,n=this.opts.es5?xe.varKinds.var:xe.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,A._`Object.keys(${t})`,r);let s=this._scope.toName(e);return this._for(new Vc("in",n,s,t),()=>r(s))}endFor(){return this._endBlockNode(Un)}label(e){return this._leafNode(new Zd(e))}break(e){return this._leafNode(new ef(e))}return(e){let t=new ti;if(this._blockNode(t),this.code(e),t.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(ti)}try(e,t,r){if(!t&&!r)throw Error('CodeGen: "try" without "catch" and "finally"');let n=new af;if(this._blockNode(n),this.code(e),t){let s=this.name("e");this._currNode=n.catch=new ri(s),t(s)}if(r)this._currNode=n.finally=new ni,this.code(r);return this._endBlockNode(ri,ni)}throw(e){return this._leafNode(new tf(e))}block(e,t){if(this._blockStarts.push(this._nodes.length),e)this.code(e).endBlock(t);return this}endBlock(e){let t=this._blockStarts.pop();if(t===void 0)throw Error("CodeGen: not in self-balancing block");let r=this._nodes.length-t;if(r<0||e!==void 0&&r!==e)throw Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=A.nil,r,n){if(this._blockNode(new ei(e,t,r)),n)this.code(n).endFunc();return this}endFunc(){return this._endBlockNode(ei)}optimize(e=1){while(e-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){let r=this._currNode;if(r instanceof e||t&&r instanceof t)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){let t=this._currNode;if(!(t instanceof mr))throw Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let t=this._nodes;t[t.length-1]=e}}rt.CodeGen=cf;function vn(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function si(e,t){return t instanceof A._CodeOrName?vn(e,t.names):e}function Fn(e,t,r){if(e instanceof A.Name)return n(e);if(!s(e))return e;return new A._Code(e._items.reduce((o,i)=>{if(i instanceof A.Name)i=n(i);if(i instanceof A._Code)o.push(...i._items);else o.push(i);return o},[]));function n(o){let i=r[o.str];if(i===void 0||t[o.str]!==1)return o;return delete t[o.str],i}function s(o){return o instanceof A._Code&&o._items.some((i)=>i instanceof A.Name&&t[i.str]===1&&r[i.str]!==void 0)}}function sx(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}function uf(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:A._`!${zc(e)}`}rt.not=uf;var ox=lf(rt.operators.AND);function ix(...e){return e.reduce(ox)}rt.and=ix;var ax=lf(rt.operators.OR);function cx(...e){return e.reduce(ax)}rt.or=cx;function lf(e){return(t,r)=>t===A.nil?r:r===A.nil?t:A._`${zc(t)} ${e} ${zc(r)}`}function zc(e){return e instanceof A.Name?e:A._`(${e})`}});var te=g(function($f){Object.defineProperty($f,"__esModule",{value:!0});$f.checkStrictMode=$f.getErrorPath=$f.Type=$f.useFunc=$f.setEvaluated=$f.evaluatedPropsToName=$f.mergeEvaluated=$f.eachItem=$f.unescapeJsonPointer=$f.escapeJsonPointer=$f.escapeFragment=$f.unescapeFragment=$f.schemaRefOrVal=$f.schemaHasRulesButRef=$f.schemaHasRules=$f.checkUnknownRules=$f.alwaysValidSchema=$f.toHash=void 0;var L=Y(),hf=Bs();function fx(e){let t={};for(let r of e)t[r]=!0;return t}$f.toHash=fx;function px(e,t){if(typeof t=="boolean")return t;if(Object.keys(t).length===0)return!0;return mf(e,t),!gf(t,e.self.RULES.all)}$f.alwaysValidSchema=px;function mf(e,t=e.schema){let{opts:r,self:n}=e;if(!r.strictSchema)return;if(typeof t==="boolean")return;let s=n.RULES.keywords;for(let o in t)if(!s[o])vf(e,`unknown keyword: "${o}"`)}$f.checkUnknownRules=mf;function gf(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}$f.schemaHasRules=gf;function hx(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}$f.schemaHasRulesButRef=hx;function mx({topSchemaRef:e,schemaPath:t},r,n,s){if(!s){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return L._`${r}`}return L._`${e}${t}${L.getProperty(n)}`}$f.schemaRefOrVal=mx;function gx(e){return yf(decodeURIComponent(e))}$f.unescapeFragment=gx;function yx(e){return encodeURIComponent(Hc(e))}$f.escapeFragment=yx;function Hc(e){if(typeof e=="number")return`${e}`;return e.replace(/~/g,"~0").replace(/\//g,"~1")}$f.escapeJsonPointer=Hc;function yf(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}$f.unescapeJsonPointer=yf;function _x(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}$f.eachItem=_x;function ff({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(s,o,i,a)=>{let c=i===void 0?o:i instanceof L.Name?(o instanceof L.Name?e(s,o,i):t(s,o,i),i):o instanceof L.Name?(t(s,i,o),o):r(o,i);return a===L.Name&&!(c instanceof L.Name)?n(s,c):c}}$f.mergeEvaluated={props:ff({mergeNames:(e,t,r)=>e.if(L._`${r} !== true && ${t} !== undefined`,()=>{e.if(L._`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,L._`${r} || {}`).code(L._`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if(L._`${r} !== true`,()=>{if(t===!0)e.assign(r,!0);else e.assign(r,L._`${r} || {}`),Bc(e,r,t)}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:_f}),items:ff({mergeNames:(e,t,r)=>e.if(L._`${r} !== true && ${t} !== undefined`,()=>e.assign(r,L._`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if(L._`${r} !== true`,()=>e.assign(r,t===!0?!0:L._`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function _f(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",L._`{}`);if(t!==void 0)Bc(e,r,t);return r}$f.evaluatedPropsToName=_f;function Bc(e,t,r){Object.keys(r).forEach((n)=>e.assign(L._`${t}${L.getProperty(n)}`,!0))}$f.setEvaluated=Bc;var pf={};function vx(e,t){return e.scopeValue("func",{ref:t,code:pf[t.code]||(pf[t.code]=new hf._Code(t.code))})}$f.useFunc=vx;var Kc;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(Kc||($f.Type=Kc={}));function $x(e,t,r){if(e instanceof L.Name){let n=t===Kc.Num;return r?n?L._`"[" + ${e} + "]"`:L._`"['" + ${e} + "']"`:n?L._`"/" + ${e}`:L._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?L.getProperty(e).toString():"/"+Hc(e)}$f.getErrorPath=$x;function vf(e,t,r=e.opts.strictSchema){if(!r)return;if(t=`strict mode: ${t}`,r===!0)throw Error(t);e.self.logger.warn(t)}$f.checkStrictMode=vf});var pt=g(function(wf){Object.defineProperty(wf,"__esModule",{value:!0});var ce=Y(),Mx={data:new ce.Name("data"),valCxt:new ce.Name("valCxt"),instancePath:new ce.Name("instancePath"),parentData:new ce.Name("parentData"),parentDataProperty:new ce.Name("parentDataProperty"),rootData:new ce.Name("rootData"),dynamicAnchors:new ce.Name("dynamicAnchors"),vErrors:new ce.Name("vErrors"),errors:new ce.Name("errors"),this:new ce.Name("this"),self:new ce.Name("self"),scope:new ce.Name("scope"),json:new ce.Name("json"),jsonPos:new ce.Name("jsonPos"),jsonLen:new ce.Name("jsonLen"),jsonPart:new ce.Name("jsonPart")};wf.default=Mx});var Ys=g(function(Rf){Object.defineProperty(Rf,"__esModule",{value:!0});Rf.extendErrors=Rf.resetErrorsCount=Rf.reportExtraError=Rf.reportError=Rf.keyword$DataError=Rf.keywordError=void 0;var I=Y(),Ar=te(),We=pt();Rf.keywordError={message:({keyword:e})=>I.str`must pass "${e}" keyword validation`};Rf.keyword$DataError={message:({keyword:e,schemaType:t})=>t?I.str`"${e}" keyword must be ${t} ($data)`:I.str`"${e}" keyword is invalid ($data)`};function Ux(e,t=Rf.keywordError,r,n){let{it:s}=e,{gen:o,compositeRule:i,allErrors:a}=s,c=xf(e,t,r);if(n!==null&&n!==void 0?n:i||a)bf(o,c);else Sf(s,I._`[${c}]`)}Rf.reportError=Ux;function Fx(e,t=Rf.keywordError,r){let{it:n}=e,{gen:s,compositeRule:o,allErrors:i}=n,a=xf(e,t,r);if(bf(s,a),!(o||i))Sf(n,We.default.vErrors)}Rf.reportExtraError=Fx;function Vx(e,t){e.assign(We.default.errors,t),e.if(I._`${We.default.vErrors} !== null`,()=>e.if(t,()=>e.assign(I._`${We.default.vErrors}.length`,t),()=>e.assign(We.default.vErrors,null)))}Rf.resetErrorsCount=Vx;function zx({gen:e,keyword:t,schemaValue:r,data:n,errsCount:s,it:o}){if(s===void 0)throw Error("ajv implementation error");let i=e.name("err");e.forRange("i",s,We.default.errors,(a)=>{if(e.const(i,I._`${We.default.vErrors}[${a}]`),e.if(I._`${i}.instancePath === undefined`,()=>e.assign(I._`${i}.instancePath`,I.strConcat(We.default.instancePath,o.errorPath))),e.assign(I._`${i}.schemaPath`,I.str`${o.errSchemaPath}/${t}`),o.opts.verbose)e.assign(I._`${i}.schema`,r),e.assign(I._`${i}.data`,n)})}Rf.extendErrors=zx;function bf(e,t){let r=e.const("err",t);e.if(I._`${We.default.vErrors} === null`,()=>e.assign(We.default.vErrors,I._`[${r}]`),I._`${We.default.vErrors}.push(${r})`),e.code(I._`${We.default.errors}++`)}function Sf(e,t){let{gen:r,validateName:n,schemaEnv:s}=e;if(s.$async)r.throw(I._`new ${e.ValidationError}(${t})`);else r.assign(I._`${n}.errors`,t),r.return(!1)}var $n={keyword:new I.Name("keyword"),schemaPath:new I.Name("schemaPath"),params:new I.Name("params"),propertyName:new I.Name("propertyName"),message:new I.Name("message"),schema:new I.Name("schema"),parentSchema:new I.Name("parentSchema")};function xf(e,t,r){let{createErrors:n}=e.it;if(n===!1)return I._`{}`;return Gx(e,t,r)}function Gx(e,t,r={}){let{gen:n,it:s}=e,o=[Kx(s,r),Hx(e,r)];return Bx(e,t,o),n.object(...o)}function Kx({errorPath:e},{instancePath:t}){let r=t?I.str`${e}${Ar.getErrorPath(t,Ar.Type.Str)}`:e;return[We.default.instancePath,I.strConcat(We.default.instancePath,r)]}function Hx({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let s=n?t:I.str`${t}/${e}`;if(r)s=I.str`${s}${Ar.getErrorPath(r,Ar.Type.Str)}`;return[$n.schemaPath,s]}function Bx(e,{params:t,message:r},n){let{keyword:s,data:o,schemaValue:i,it:a}=e,{opts:c,propertyName:u,topSchemaRef:d,schemaPath:l}=a;if(n.push([$n.keyword,s],[$n.params,typeof t=="function"?t(e):t||I._`{}`]),c.messages)n.push([$n.message,typeof r=="function"?r(e):r]);if(c.verbose)n.push([$n.schema,i],[$n.parentSchema,I._`${d}${l}`],[We.default.data,o]);if(u)n.push([$n.propertyName,u])}});var If=g(function(Pf){Object.defineProperty(Pf,"__esModule",{value:!0});Pf.boolOrEmptySchema=Pf.topBoolOrEmptySchema=void 0;var kf=Ys(),Of=Y(),Qx=pt(),Zx={message:"boolean schema is false"};function eR(e){let{gen:t,schema:r,validateName:n}=e;if(r===!1)Af(e,!1);else if(typeof r=="object"&&r.$async===!0)t.return(Qx.default.data);else t.assign(Of._`${n}.errors`,null),t.return(!0)}Pf.topBoolOrEmptySchema=eR;function tR(e,t){let{gen:r,schema:n}=e;if(n===!1)r.var(t,!1),Af(e);else r.var(t,!0)}Pf.boolOrEmptySchema=tR;function Af(e,t){let{gen:r,data:n}=e;kf.reportError({gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e},Zx,void 0,t)}});var Yc=g(function(Cf){Object.defineProperty(Cf,"__esModule",{value:!0});Cf.getRules=Cf.isJSONType=void 0;var nR=["string","number","integer","boolean","null","object","array"],sR=new Set(nR);function oR(e){return typeof e=="string"&&sR.has(e)}Cf.isJSONType=oR;function iR(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}Cf.getRules=iR});var Xc=g(function(Mf){Object.defineProperty(Mf,"__esModule",{value:!0});Mf.shouldUseRule=Mf.shouldUseGroup=Mf.schemaHasRulesForType=void 0;function cR({schema:e,self:t},r){let n=t.RULES.types[r];return n&&n!==!0&&qf(e,n)}Mf.schemaHasRulesForType=cR;function qf(e,t){return t.rules.some((r)=>Df(e,r))}Mf.shouldUseGroup=qf;function Df(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))}Mf.shouldUseRule=Df});var Xs=g(function(Kf){Object.defineProperty(Kf,"__esModule",{value:!0});Kf.reportTypeError=Kf.checkDataTypes=Kf.checkDataType=Kf.coerceAndCheckDataType=Kf.getJSONTypes=Kf.getSchemaTypes=Kf.DataType=void 0;var Uf=Yc(),Ff=Xc(),Vf=Ys(),x=Y(),ci=te(),Vn;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(Vn||(Kf.DataType=Vn={}));function dR(e){let t=zf(e.type);if(t.includes("null")){if(e.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');if(e.nullable===!0)t.push("null")}return t}Kf.getSchemaTypes=dR;function zf(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(Uf.isJSONType))return t;throw Error("type must be JSONType or JSONType[]: "+t.join(","))}Kf.getJSONTypes=zf;function fR(e,t){let{gen:r,data:n,opts:s}=e,o=pR(t,s.coerceTypes),i=t.length>0&&!(o.length===0&&t.length===1&&Ff.schemaHasRulesForType(e,t[0]));if(i){let a=Qc(t,n,s.strictNumbers,Vn.Wrong);r.if(a,()=>{if(o.length)hR(e,t,o);else Zc(e)})}return i}Kf.coerceAndCheckDataType=fR;var Gf=new Set(["string","number","integer","boolean","null"]);function pR(e,t){return t?e.filter((r)=>Gf.has(r)||t==="array"&&r==="array"):[]}function hR(e,t,r){let{gen:n,data:s,opts:o}=e,i=n.let("dataType",x._`typeof ${s}`),a=n.let("coerced",x._`undefined`);if(o.coerceTypes==="array")n.if(x._`${i} == 'object' && Array.isArray(${s}) && ${s}.length == 1`,()=>n.assign(s,x._`${s}[0]`).assign(i,x._`typeof ${s}`).if(Qc(t,s,o.strictNumbers),()=>n.assign(a,s)));n.if(x._`${a} !== undefined`);for(let u of r)if(Gf.has(u)||u==="array"&&o.coerceTypes==="array")c(u);n.else(),Zc(e),n.endIf(),n.if(x._`${a} !== undefined`,()=>{n.assign(s,a),mR(e,a)});function c(u){switch(u){case"string":n.elseIf(x._`${i} == "number" || ${i} == "boolean"`).assign(a,x._`"" + ${s}`).elseIf(x._`${s} === null`).assign(a,x._`""`);return;case"number":n.elseIf(x._`${i} == "boolean" || ${s} === null
3
+ var hS=Object.create;var{getPrototypeOf:mS,defineProperty:Bo,getOwnPropertyNames:gS}=Object;var od=Object.prototype.hasOwnProperty;function yS(e){return this[e]}var _S,vS,_c=(e,t,r)=>{var n=e!=null&&typeof e==="object";if(n){var s=t?_S??=new WeakMap:vS??=new WeakMap,o=s.get(e);if(o)return o}r=e!=null?hS(mS(e)):{};let i=t||!e||!e.__esModule||!od.call(e,"default")?Bo(r,"default",{value:e,enumerable:!0}):r;if(e&&typeof e==="object"||typeof e==="function"){for(let a of gS(e))if(!od.call(i,a))Bo(i,a,{get:yS.bind(e,a),enumerable:!0})}if(n)s.set(e,i);return i};var g=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var $S=(e)=>e;function ES(e,t){this[e]=$S.bind(null,t)}var _9=(e,t)=>{for(var r in t)Bo(e,r,{get:t[r],enumerable:!0,configurable:!0,set:ES.bind(t,r)})};var F=(e,t,r)=>()=>{if(e)try{t=e(e=0)}catch(n){r=[n]}if(r)throw r[0];return t};var v9=(e,t,r)=>{for(var n in t)Bo(e,n,{get:t[n],set:r[n],enumerable:!0,configurable:!0})},$9=import.meta.require;function Wo(e){let t=[],r="",n="start",s=!1;for(let o of e)switch(o){case"\\":{if(n==="index")throw Error("Invalid character in an index");if(n==="indexEnd")throw Error("Invalid character after an index");if(s)r+=o;n="property",s=!s;break}case".":{if(n==="index")throw Error("Invalid character in an index");if(n==="indexEnd"){n="property";break}if(s){s=!1,r+=o;break}if(vc.has(r))return[];t.push(r),r="",n="property";break}case"[":{if(n==="index")throw Error("Invalid character in an index");if(n==="indexEnd"){n="index";break}if(s){s=!1,r+=o;break}if(n==="property"){if(vc.has(r))return[];t.push(r),r=""}n="index";break}case"]":{if(n==="index"){t.push(Number.parseInt(r,10)),r="",n="indexEnd";break}if(n==="indexEnd")throw Error("Invalid character after an index")}default:{if(n==="index"&&!bS.has(o))throw Error("Invalid character in an index");if(n==="indexEnd")throw Error("Invalid character after an index");if(n==="start")n="property";if(s)s=!1,r+="\\";r+=o}}if(s)r+="\\";switch(n){case"property":{if(vc.has(r))return[];t.push(r);break}case"index":throw Error("Index was not closed");case"start":{t.push("");break}}return t}function $c(e,t){if(typeof t!=="number"&&Array.isArray(e)){let r=Number.parseInt(t,10);return Number.isInteger(r)&&e[r]===e[t]}return!1}function id(e,t){if($c(e,t))throw Error("Cannot use string index")}function ad(e,t,r){if(!yn(e)||typeof t!=="string")return r===void 0?e:r;let n=Wo(t);if(n.length===0)return r;for(let s=0;s<n.length;s++){let o=n[s];if($c(e,o))e=s===n.length-1?void 0:null;else e=e[o];if(e===void 0||e===null){if(s!==n.length-1)return r;break}}return e===void 0?r:e}function Ec(e,t,r){if(!yn(e)||typeof t!=="string")return e;let n=e,s=Wo(t);for(let o=0;o<s.length;o++){let i=s[o];if(id(e,i),o===s.length-1)e[i]=r;else if(!yn(e[i]))e[i]=typeof s[o+1]==="number"?[]:{};e=e[i]}return n}function cd(e,t){if(!yn(e)||typeof t!=="string")return!1;let r=Wo(t);for(let n=0;n<r.length;n++){let s=r[n];if(id(e,s),n===r.length-1)return delete e[s],!0;if(e=e[s],!yn(e))return!1}}function ud(e,t){if(!yn(e)||typeof t!=="string")return!1;let r=Wo(t);if(r.length===0)return!1;for(let n of r){if(!yn(e)||!(n in e)||$c(e,n))return!1;e=e[n]}return!0}var yn=(e)=>{let t=typeof e;return e!==null&&(t==="object"||t==="function")},vc,bS;var ld=F(()=>{vc=new Set(["__proto__","prototype","constructor"]),bS=new Set("0123456789")});import Se from"path";import dd from"os";import bc from"process";function Sc(e,{suffix:t="nodejs"}={}){if(typeof e!=="string")throw TypeError(`Expected a string, got ${typeof e}`);if(t)e+=`-${t}`;if(bc.platform==="darwin")return wS(e);if(bc.platform==="win32")return SS(e);return xS(e)}var Rr,wc,Dn,wS=(e)=>{let t=Se.join(Rr,"Library");return{data:Se.join(t,"Application Support",e),config:Se.join(t,"Preferences",e),cache:Se.join(t,"Caches",e),log:Se.join(t,"Logs",e),temp:Se.join(wc,e)}},SS=(e)=>{let t=Dn.APPDATA||Se.join(Rr,"AppData","Roaming"),r=Dn.LOCALAPPDATA||Se.join(Rr,"AppData","Local");return{data:Se.join(r,e,"Data"),config:Se.join(t,e,"Config"),cache:Se.join(r,e,"Cache"),log:Se.join(r,e,"Log"),temp:Se.join(wc,e)}},xS=(e)=>{let t=Se.basename(Rr);return{data:Se.join(Dn.XDG_DATA_HOME||Se.join(Rr,".local","share"),e),config:Se.join(Dn.XDG_CONFIG_HOME||Se.join(Rr,".config"),e),cache:Se.join(Dn.XDG_CACHE_HOME||Se.join(Rr,".cache"),e),log:Se.join(Dn.XDG_STATE_HOME||Se.join(Rr,".local","state"),e),temp:Se.join(wc,t,e)}};var fd=F(()=>{Rr=dd.homedir(),wc=dd.tmpdir(),{env:Dn}=bc});var RS=(e,t)=>{let{onError:r}=t;return function(...s){return e.apply(void 0,s).catch(r)}},Ct;var pd=F(()=>{Ct=RS});var TS=(e,t)=>{let{onError:r}=t;return function(...s){try{return e.apply(void 0,s)}catch(o){return r(o)}}},Rt;var hd=F(()=>{Rt=TS});var md=250;var gd=()=>{};var kS=(e,t)=>{let{isRetriable:r}=t;return function(s){let{timeout:o}=s,i=s.interval??md,a=Date.now()+o;return function c(...u){return e.apply(void 0,u).catch((d)=>{if(!r(d))throw d;if(Date.now()>=a)throw d;let l=Math.round(i*Math.random());if(l>0)return new Promise((f)=>setTimeout(f,l)).then(()=>c.apply(void 0,u));else return c.apply(void 0,u)})}}},jt;var yd=F(()=>{gd();jt=kS});var OS=(e,t)=>{let{isRetriable:r}=t;return function(s){let{timeout:o}=s,i=Date.now()+o;return function(...c){while(!0)try{return e.apply(void 0,c)}catch(u){if(!r(u))throw u;if(Date.now()>=i)throw u;continue}}}},qt;var _d=F(()=>{qt=OS});var xc=F(()=>{pd();hd();yd();_d()});var zs,Rc;var vd=F(()=>{Tc();zs={isChangeErrorOk:(e)=>{if(!zs.isNodeError(e))return!1;let{code:t}=e;if(t==="ENOSYS")return!0;if(!$d&&(t==="EINVAL"||t==="EPERM"))return!0;return!1},isNodeError:(e)=>e instanceof Error,isRetriableError:(e)=>{if(!zs.isNodeError(e))return!1;let{code:t}=e;if(t==="EMFILE"||t==="ENFILE"||t==="EAGAIN"||t==="EBUSY"||t==="EACCESS"||t==="EACCES"||t==="EACCS"||t==="EPERM")return!0;return!1},onChangeError:(e)=>{if(!zs.isNodeError(e))throw e;if(zs.isChangeErrorOk(e))return;throw e}},Rc=zs});import Ed from"process";var Gs,tt,$d,Fe;var Tc=F(()=>{vd();Gs={onError:Rc.onChangeError},tt={onError:()=>{return}},$d=Ed.getuid?!Ed.getuid():!1,Fe={isRetriable:Rc.isRetriableError}});import ie from"fs";import{promisify as ze}from"util";var AS,De;var kc=F(()=>{xc();xc();Tc();AS={attempt:{chmod:Ct(ze(ie.chmod),Gs),chown:Ct(ze(ie.chown),Gs),close:Ct(ze(ie.close),tt),fsync:Ct(ze(ie.fsync),tt),mkdir:Ct(ze(ie.mkdir),tt),realpath:Ct(ze(ie.realpath),tt),stat:Ct(ze(ie.stat),tt),unlink:Ct(ze(ie.unlink),tt),chmodSync:Rt(ie.chmodSync,Gs),chownSync:Rt(ie.chownSync,Gs),closeSync:Rt(ie.closeSync,tt),existsSync:Rt(ie.existsSync,tt),fsyncSync:Rt(ie.fsync,tt),mkdirSync:Rt(ie.mkdirSync,tt),realpathSync:Rt(ie.realpathSync,tt),statSync:Rt(ie.statSync,tt),unlinkSync:Rt(ie.unlinkSync,tt)},retry:{close:jt(ze(ie.close),Fe),fsync:jt(ze(ie.fsync),Fe),open:jt(ze(ie.open),Fe),readFile:jt(ze(ie.readFile),Fe),rename:jt(ze(ie.rename),Fe),stat:jt(ze(ie.stat),Fe),write:jt(ze(ie.write),Fe),writeFile:jt(ze(ie.writeFile),Fe),closeSync:qt(ie.closeSync,Fe),fsyncSync:qt(ie.fsyncSync,Fe),openSync:qt(ie.openSync,Fe),readFileSync:qt(ie.readFileSync,Fe),renameSync:qt(ie.renameSync,Fe),statSync:qt(ie.statSync,Fe),writeSync:qt(ie.writeSync,Fe),writeFileSync:qt(ie.writeFileSync,Fe)}},De=AS});import _n from"process";var bd="utf8",Oc=438,wd=511,Sd,xd,Rd,Td=1000,kd,X9,Ac=128;var Pc=F(()=>{Sd={},xd=_n.geteuid?_n.geteuid():-1,Rd=_n.getegid?_n.getegid():-1,kd=!!_n.getuid,X9=_n.getuid?!_n.getuid():!1});var Od=(e)=>e instanceof Error&&("code"in e),Nc=(e)=>typeof e==="string",Yo=(e)=>e===void 0;var Ad=()=>{};var Pd=()=>{};import Nd from"process";var Id,Xo;var Ic=F(()=>{Id=Nd.platform==="linux",Xo=Nd.platform==="win32"});var Cc,Cd;var jd=F(()=>{Ic();Cc=["SIGHUP","SIGINT","SIGTERM"];if(!Xo)Cc.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(Id)Cc.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");Cd=Cc});import Mn from"process";class qd{constructor(){this.callbacks=new Set,this.exited=!1,this.exit=(e)=>{if(this.exited)return;this.exited=!0;for(let t of this.callbacks)t();if(e)if(Xo&&(e!=="SIGINT"&&e!=="SIGTERM"&&e!=="SIGKILL"))Mn.kill(Mn.pid,"SIGTERM");else Mn.kill(Mn.pid,e)},this.hook=()=>{Mn.once("exit",()=>this.exit());for(let e of Cd)try{Mn.once(e,()=>this.exit(e))}catch{}},this.register=(e)=>(this.callbacks.add(e),()=>{this.callbacks.delete(e)}),this.hook()}}var Dd;var Md=F(()=>{Ic();jd();Dd=new qd});var PS,Ld;var Ud=F(()=>{Md();PS=Dd.register,Ld=PS});import NS from"path";var dt,Ks;var Fd=F(()=>{kc();Ud();Pc();dt={store:{},create:(e)=>{let t=`000000${Math.floor(Math.random()*16777215).toString(16)}`.slice(-6),r=Date.now().toString().slice(-10),n="tmp-",s=`.tmp-${r}${t}`;return`${e}${s}`},get:(e,t,r=!0)=>{let n=dt.truncate(t(e));if(n in dt.store)return dt.get(e,t,r);return dt.store[n]=r,[n,()=>delete dt.store[n]]},purge:(e)=>{if(!dt.store[e])return;delete dt.store[e],De.attempt.unlink(e)},purgeSync:(e)=>{if(!dt.store[e])return;delete dt.store[e],De.attempt.unlinkSync(e)},purgeSyncAll:()=>{for(let e in dt.store)dt.purgeSync(e)},truncate:(e)=>{let t=NS.basename(e);if(t.length<=Ac)return e;let r=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(t);if(!r)return e;let n=t.length-Ac;return`${e.slice(0,-t.length)}${r[1]}${r[2].slice(0,-n)}${r[3]}`}};Ld(dt.purgeSyncAll);Ks=dt});import IS from"path";function jc(e,t,r=Sd){if(Nc(r))return jc(e,t,{encoding:r});let s={timeout:r.timeout??Td},o=null,i=null,a=null;try{let c=De.attempt.realpathSync(e),u=!!c;e=c||e,[i,o]=Ks.get(e,r.tmpCreate||Ks.create,r.tmpPurge!==!1);let d=kd&&Yo(r.chown),l=Yo(r.mode);if(u&&(d||l)){let p=De.attempt.statSync(e);if(p){if(r={...r},d)r.chown={uid:p.uid,gid:p.gid};if(l)r.mode=p.mode}}if(!u){let p=IS.dirname(e);De.attempt.mkdirSync(p,{mode:wd,recursive:!0})}if(a=De.retry.openSync(s)(i,"w",r.mode||Oc),r.tmpCreated)r.tmpCreated(i);if(Nc(t))De.retry.writeSync(s)(a,t,0,r.encoding||bd);else if(!Yo(t))De.retry.writeSync(s)(a,t,0,t.length,0);if(r.fsync!==!1)if(r.fsyncWait!==!1)De.retry.fsyncSync(s)(a);else De.attempt.fsync(a);if(De.retry.closeSync(s)(a),a=null,r.chown&&(r.chown.uid!==xd||r.chown.gid!==Rd))De.attempt.chownSync(i,r.chown.uid,r.chown.gid);if(r.mode&&r.mode!==Oc)De.attempt.chmodSync(i,r.mode);try{De.retry.renameSync(s)(i,e)}catch(p){if(!Od(p))throw p;if(p.code!=="ENAMETOOLONG")throw p;De.retry.renameSync(s)(i,Ks.truncate(e))}o(),i=null}finally{if(a)De.attempt.closeSync(a);if(i)Ks.purge(i)}}var Vd=F(()=>{kc();Pc();Ad();Pd();Fd()});var Bs=g(function(Kd){Object.defineProperty(Kd,"__esModule",{value:!0});Kd.regexpCode=Kd.getEsmExportName=Kd.getProperty=Kd.safeStringify=Kd.stringify=Kd.strConcat=Kd.addCodeArg=Kd.str=Kd._=Kd.nil=Kd._Code=Kd.Name=Kd.IDENTIFIER=Kd._CodeOrName=void 0;class Jo{}Kd._CodeOrName=Jo;Kd.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class Ln extends Jo{constructor(e){super();if(!Kd.IDENTIFIER.test(e))throw Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}Kd.Name=Ln;class Tt extends Jo{constructor(e){super();this._items=typeof e==="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((t,r)=>`${t}${r}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((t,r)=>{if(r instanceof Ln)t[r.str]=(t[r.str]||0)+1;return t},{})}}Kd._Code=Tt;Kd.nil=new Tt("");function zd(e,...t){let r=[e[0]],n=0;while(n<t.length)Dc(r,t[n]),r.push(e[++n]);return new Tt(r)}Kd._=zd;var qc=new Tt("+");function Gd(e,...t){let r=[Hs(e[0])],n=0;while(n<t.length)r.push(qc),Dc(r,t[n]),r.push(qc,Hs(e[++n]));return CS(r),new Tt(r)}Kd.str=Gd;function Dc(e,t){if(t instanceof Tt)e.push(...t._items);else if(t instanceof Ln)e.push(t);else e.push(DS(t))}Kd.addCodeArg=Dc;function CS(e){let t=1;while(t<e.length-1){if(e[t]===qc){let r=jS(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function jS(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string"){if(t instanceof Ln||e[e.length-1]!=='"')return;if(typeof t!="string")return`${e.slice(0,-1)}${t}"`;if(t[0]==='"')return e.slice(0,-1)+t.slice(1);return}if(typeof t=="string"&&t[0]==='"'&&!(e instanceof Ln))return`"${e}${t.slice(1)}`;return}function qS(e,t){return t.emptyStr()?e:e.emptyStr()?t:Gd`${e}${t}`}Kd.strConcat=qS;function DS(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:Hs(Array.isArray(e)?e.join(","):e)}function MS(e){return new Tt(Hs(e))}Kd.stringify=MS;function Hs(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Kd.safeStringify=Hs;function LS(e){return typeof e=="string"&&Kd.IDENTIFIER.test(e)?new Tt(`.${e}`):zd`[${e}]`}Kd.getProperty=LS;function US(e){if(typeof e=="string"&&Kd.IDENTIFIER.test(e))return new Tt(`${e}`);throw Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}Kd.getEsmExportName=US;function FS(e){return new Tt(e.toString())}Kd.regexpCode=FS});var Fc=g(function(Yd){Object.defineProperty(Yd,"__esModule",{value:!0});Yd.ValueScope=Yd.ValueScopeName=Yd.Scope=Yd.varKinds=Yd.UsedValueState=void 0;var pe=Bs();class Bd extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`);this.value=e.value}}var Zo;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(Zo||(Yd.UsedValueState=Zo={}));Yd.varKinds={const:new pe.Name("const"),let:new pe.Name("let"),var:new pe.Name("var")};class Lc{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof pe.Name?e:this.name(e)}name(e){return new pe.Name(this._newName(e))}_newName(e){let t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){var t,r;if(((r=(t=this._parent)===null||t===void 0?void 0:t._prefixes)===null||r===void 0?void 0:r.has(e))||this._prefixes&&!this._prefixes.has(e))throw Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}Yd.Scope=Lc;class Uc extends pe.Name{constructor(e,t){super(t);this.prefix=e}setValue(e,{property:t,itemIndex:r}){this.value=e,this.scopePath=pe._`.${new pe.Name(t)}[${r}]`}}Yd.ValueScopeName=Uc;var ex=pe._`\n`;class Wd extends Lc{constructor(e){super(e);this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?ex:pe.nil}}get(){return this._scope}name(e){return new Uc(e,this._newName(e))}value(e,t){var r;if(t.ref===void 0)throw Error("CodeGen: ref must be passed in value");let n=this.toName(e),{prefix:s}=n,o=(r=t.key)!==null&&r!==void 0?r:t.ref,i=this._values[s];if(i){let u=i.get(o);if(u)return u}else i=this._values[s]=new Map;i.set(o,n);let a=this._scope[s]||(this._scope[s]=[]),c=a.length;return a[c]=t.ref,n.setValue(t,{property:s,itemIndex:c}),n}getValue(e,t){let r=this._values[e];if(!r)return;return r.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,(r)=>{if(r.scopePath===void 0)throw Error(`CodeGen: name "${r}" has no value`);return pe._`${e}${r.scopePath}`})}scopeCode(e=this._values,t,r){return this._reduceValues(e,(n)=>{if(n.value===void 0)throw Error(`CodeGen: name "${n}" has no value`);return n.value.code},t,r)}_reduceValues(e,t,r={},n){let s=pe.nil;for(let o in e){let i=e[o];if(!i)continue;let a=r[o]=r[o]||new Map;i.forEach((c)=>{if(a.has(c))return;a.set(c,Zo.Started);let u=t(c);if(u){let d=this.opts.es5?Yd.varKinds.var:Yd.varKinds.const;s=pe._`${s}${d} ${c} = ${u};${this.opts._n}`}else if(u=n===null||n===void 0?void 0:n(c))s=pe._`${s}${u}${this.opts._n}`;else throw new Bd(c);a.set(c,Zo.Completed)})}return s}}Yd.ValueScope=Wd});var Y=g(function(rt){Object.defineProperty(rt,"__esModule",{value:!0});rt.or=rt.and=rt.not=rt.CodeGen=rt.operators=rt.varKinds=rt.ValueScopeName=rt.ValueScope=rt.Scope=rt.Name=rt.regexpCode=rt.stringify=rt.getProperty=rt.nil=rt.strConcat=rt.str=rt._=void 0;var A=Bs(),xe=Fc(),Tr=Bs();Object.defineProperty(rt,"_",{enumerable:!0,get:function(){return Tr._}});Object.defineProperty(rt,"str",{enumerable:!0,get:function(){return Tr.str}});Object.defineProperty(rt,"strConcat",{enumerable:!0,get:function(){return Tr.strConcat}});Object.defineProperty(rt,"nil",{enumerable:!0,get:function(){return Tr.nil}});Object.defineProperty(rt,"getProperty",{enumerable:!0,get:function(){return Tr.getProperty}});Object.defineProperty(rt,"stringify",{enumerable:!0,get:function(){return Tr.stringify}});Object.defineProperty(rt,"regexpCode",{enumerable:!0,get:function(){return Tr.regexpCode}});Object.defineProperty(rt,"Name",{enumerable:!0,get:function(){return Tr.Name}});var oi=Fc();Object.defineProperty(rt,"Scope",{enumerable:!0,get:function(){return oi.Scope}});Object.defineProperty(rt,"ValueScope",{enumerable:!0,get:function(){return oi.ValueScope}});Object.defineProperty(rt,"ValueScopeName",{enumerable:!0,get:function(){return oi.ValueScopeName}});Object.defineProperty(rt,"varKinds",{enumerable:!0,get:function(){return oi.varKinds}});rt.operators={GT:new A._Code(">"),GTE:new A._Code(">="),LT:new A._Code("<"),LTE:new A._Code("<="),EQ:new A._Code("==="),NEQ:new A._Code("!=="),NOT:new A._Code("!"),OR:new A._Code("||"),AND:new A._Code("&&"),ADD:new A._Code("+")};class kr{optimizeNodes(){return this}optimizeNames(e,t){return this}}class Jd extends kr{constructor(e,t,r){super();this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){let r=e?xe.varKinds.var:this.varKind,n=this.rhs===void 0?"":` = ${this.rhs}`;return`${r} ${this.name}${n};`+t}optimizeNames(e,t){if(!e[this.name.str])return;if(this.rhs)this.rhs=Fn(this.rhs,e,t);return this}get names(){return this.rhs instanceof A._CodeOrName?this.rhs.names:{}}}class Gc extends kr{constructor(e,t,r){super();this.lhs=e,this.rhs=t,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(this.lhs instanceof A.Name&&!e[this.lhs.str]&&!this.sideEffects)return;return this.rhs=Fn(this.rhs,e,t),this}get names(){let e=this.lhs instanceof A.Name?{}:{...this.lhs.names};return si(e,this.rhs)}}class Qd extends Gc{constructor(e,t,r,n){super(e,r,n);this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class Zd extends kr{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class ef extends kr{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class tf extends kr{constructor(e){super();this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class rf extends kr{constructor(e){super();this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=Fn(this.code,e,t),this}get names(){return this.code instanceof A._CodeOrName?this.code.names:{}}}class ii extends kr{constructor(e=[]){super();this.nodes=e}render(e){return this.nodes.reduce((t,r)=>t+r.render(e),"")}optimizeNodes(){let{nodes:e}=this,t=e.length;while(t--){let r=e[t].optimizeNodes();if(Array.isArray(r))e.splice(t,1,...r);else if(r)e[t]=r;else e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){let{nodes:r}=this,n=r.length;while(n--){let s=r[n];if(s.optimizeNames(e,t))continue;sx(e,s.names),r.splice(n,1)}return r.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>vn(e,t.names),{})}}class Or extends ii{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class nf extends ii{}class Ws extends Or{}Ws.kind="else";class mr extends Or{constructor(e,t){super(t);this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);if(this.else)t+="else "+this.else.render(e);return t}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let t=this.else;if(t){let r=t.optimizeNodes();t=this.else=Array.isArray(r)?new Ws(r):r}if(t){if(e===!1)return t instanceof mr?t:t.nodes;if(this.nodes.length)return this;return new mr(uf(e),t instanceof mr?[t]:t.nodes)}if(e===!1||!this.nodes.length)return;return this}optimizeNames(e,t){var r;if(this.else=(r=this.else)===null||r===void 0?void 0:r.optimizeNames(e,t),!(super.optimizeNames(e,t)||this.else))return;return this.condition=Fn(this.condition,e,t),this}get names(){let e=super.names;if(si(e,this.condition),this.else)vn(e,this.else.names);return e}}mr.kind="if";class Un extends Or{}Un.kind="for";class sf extends Un{constructor(e){super();this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(!super.optimizeNames(e,t))return;return this.iteration=Fn(this.iteration,e,t),this}get names(){return vn(super.names,this.iteration.names)}}class of extends Un{constructor(e,t,r,n){super();this.varKind=e,this.name=t,this.from=r,this.to=n}render(e){let t=e.es5?xe.varKinds.var:this.varKind,{name:r,from:n,to:s}=this;return`for(${t} ${r}=${n}; ${r}<${s}; ${r}++)`+super.render(e)}get names(){let e=si(super.names,this.from);return si(e,this.to)}}class Vc extends Un{constructor(e,t,r,n){super();this.loop=e,this.varKind=t,this.name=r,this.iterable=n}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(!super.optimizeNames(e,t))return;return this.iterable=Fn(this.iterable,e,t),this}get names(){return vn(super.names,this.iterable.names)}}class ei extends Or{constructor(e,t,r){super();this.name=e,this.args=t,this.async=r}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}ei.kind="func";class ti extends ii{render(e){return"return "+super.render(e)}}ti.kind="return";class af extends Or{render(e){let t="try"+super.render(e);if(this.catch)t+=this.catch.render(e);if(this.finally)t+=this.finally.render(e);return t}optimizeNodes(){var e,t;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(t=this.finally)===null||t===void 0||t.optimizeNodes(),this}optimizeNames(e,t){var r,n;return super.optimizeNames(e,t),(r=this.catch)===null||r===void 0||r.optimizeNames(e,t),(n=this.finally)===null||n===void 0||n.optimizeNames(e,t),this}get names(){let e=super.names;if(this.catch)vn(e,this.catch.names);if(this.finally)vn(e,this.finally.names);return e}}class ri extends Or{constructor(e){super();this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}ri.kind="catch";class ni extends Or{render(e){return"finally"+super.render(e)}}ni.kind="finally";class cf{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?`
4
+ `:""},this._extScope=e,this._scope=new xe.Scope({parent:e}),this._nodes=[new nf]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){let r=this._extScope.value(e,t);return(this._values[r.prefix]||(this._values[r.prefix]=new Set)).add(r),r}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,r,n){let s=this._scope.toName(t);if(r!==void 0&&n)this._constants[s.str]=r;return this._leafNode(new Jd(e,s,r)),s}const(e,t,r){return this._def(xe.varKinds.const,e,t,r)}let(e,t,r){return this._def(xe.varKinds.let,e,t,r)}var(e,t,r){return this._def(xe.varKinds.var,e,t,r)}assign(e,t,r){return this._leafNode(new Gc(e,t,r))}add(e,t){return this._leafNode(new Qd(e,rt.operators.ADD,t))}code(e){if(typeof e=="function")e();else if(e!==A.nil)this._leafNode(new rf(e));return this}object(...e){let t=["{"];for(let[r,n]of e){if(t.length>1)t.push(",");if(t.push(r),r!==n||this.opts.es5)t.push(":"),A.addCodeArg(t,n)}return t.push("}"),new A._Code(t)}if(e,t,r){if(this._blockNode(new mr(e)),t&&r)this.code(t).else().code(r).endIf();else if(t)this.code(t).endIf();else if(r)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new mr(e))}else(){return this._elseNode(new Ws)}endIf(){return this._endBlockNode(mr,Ws)}_for(e,t){if(this._blockNode(e),t)this.code(t).endFor();return this}for(e,t){return this._for(new sf(e),t)}forRange(e,t,r,n,s=this.opts.es5?xe.varKinds.var:xe.varKinds.let){let o=this._scope.toName(e);return this._for(new of(s,o,t,r),()=>n(o))}forOf(e,t,r,n=xe.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let o=t instanceof A.Name?t:this.var("_arr",t);return this.forRange("_i",0,A._`${o}.length`,(i)=>{this.var(s,A._`${o}[${i}]`),r(s)})}return this._for(new Vc("of",n,s,t),()=>r(s))}forIn(e,t,r,n=this.opts.es5?xe.varKinds.var:xe.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,A._`Object.keys(${t})`,r);let s=this._scope.toName(e);return this._for(new Vc("in",n,s,t),()=>r(s))}endFor(){return this._endBlockNode(Un)}label(e){return this._leafNode(new Zd(e))}break(e){return this._leafNode(new ef(e))}return(e){let t=new ti;if(this._blockNode(t),this.code(e),t.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(ti)}try(e,t,r){if(!t&&!r)throw Error('CodeGen: "try" without "catch" and "finally"');let n=new af;if(this._blockNode(n),this.code(e),t){let s=this.name("e");this._currNode=n.catch=new ri(s),t(s)}if(r)this._currNode=n.finally=new ni,this.code(r);return this._endBlockNode(ri,ni)}throw(e){return this._leafNode(new tf(e))}block(e,t){if(this._blockStarts.push(this._nodes.length),e)this.code(e).endBlock(t);return this}endBlock(e){let t=this._blockStarts.pop();if(t===void 0)throw Error("CodeGen: not in self-balancing block");let r=this._nodes.length-t;if(r<0||e!==void 0&&r!==e)throw Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=A.nil,r,n){if(this._blockNode(new ei(e,t,r)),n)this.code(n).endFunc();return this}endFunc(){return this._endBlockNode(ei)}optimize(e=1){while(e-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){let r=this._currNode;if(r instanceof e||t&&r instanceof t)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){let t=this._currNode;if(!(t instanceof mr))throw Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let t=this._nodes;t[t.length-1]=e}}rt.CodeGen=cf;function vn(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function si(e,t){return t instanceof A._CodeOrName?vn(e,t.names):e}function Fn(e,t,r){if(e instanceof A.Name)return n(e);if(!s(e))return e;return new A._Code(e._items.reduce((o,i)=>{if(i instanceof A.Name)i=n(i);if(i instanceof A._Code)o.push(...i._items);else o.push(i);return o},[]));function n(o){let i=r[o.str];if(i===void 0||t[o.str]!==1)return o;return delete t[o.str],i}function s(o){return o instanceof A._Code&&o._items.some((i)=>i instanceof A.Name&&t[i.str]===1&&r[i.str]!==void 0)}}function sx(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}function uf(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:A._`!${zc(e)}`}rt.not=uf;var ox=lf(rt.operators.AND);function ix(...e){return e.reduce(ox)}rt.and=ix;var ax=lf(rt.operators.OR);function cx(...e){return e.reduce(ax)}rt.or=cx;function lf(e){return(t,r)=>t===A.nil?r:r===A.nil?t:A._`${zc(t)} ${e} ${zc(r)}`}function zc(e){return e instanceof A.Name?e:A._`(${e})`}});var te=g(function($f){Object.defineProperty($f,"__esModule",{value:!0});$f.checkStrictMode=$f.getErrorPath=$f.Type=$f.useFunc=$f.setEvaluated=$f.evaluatedPropsToName=$f.mergeEvaluated=$f.eachItem=$f.unescapeJsonPointer=$f.escapeJsonPointer=$f.escapeFragment=$f.unescapeFragment=$f.schemaRefOrVal=$f.schemaHasRulesButRef=$f.schemaHasRules=$f.checkUnknownRules=$f.alwaysValidSchema=$f.toHash=void 0;var L=Y(),hf=Bs();function fx(e){let t={};for(let r of e)t[r]=!0;return t}$f.toHash=fx;function px(e,t){if(typeof t=="boolean")return t;if(Object.keys(t).length===0)return!0;return mf(e,t),!gf(t,e.self.RULES.all)}$f.alwaysValidSchema=px;function mf(e,t=e.schema){let{opts:r,self:n}=e;if(!r.strictSchema)return;if(typeof t==="boolean")return;let s=n.RULES.keywords;for(let o in t)if(!s[o])vf(e,`unknown keyword: "${o}"`)}$f.checkUnknownRules=mf;function gf(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}$f.schemaHasRules=gf;function hx(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}$f.schemaHasRulesButRef=hx;function mx({topSchemaRef:e,schemaPath:t},r,n,s){if(!s){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return L._`${r}`}return L._`${e}${t}${L.getProperty(n)}`}$f.schemaRefOrVal=mx;function gx(e){return yf(decodeURIComponent(e))}$f.unescapeFragment=gx;function yx(e){return encodeURIComponent(Hc(e))}$f.escapeFragment=yx;function Hc(e){if(typeof e=="number")return`${e}`;return e.replace(/~/g,"~0").replace(/\//g,"~1")}$f.escapeJsonPointer=Hc;function yf(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}$f.unescapeJsonPointer=yf;function _x(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}$f.eachItem=_x;function ff({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(s,o,i,a)=>{let c=i===void 0?o:i instanceof L.Name?(o instanceof L.Name?e(s,o,i):t(s,o,i),i):o instanceof L.Name?(t(s,i,o),o):r(o,i);return a===L.Name&&!(c instanceof L.Name)?n(s,c):c}}$f.mergeEvaluated={props:ff({mergeNames:(e,t,r)=>e.if(L._`${r} !== true && ${t} !== undefined`,()=>{e.if(L._`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,L._`${r} || {}`).code(L._`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if(L._`${r} !== true`,()=>{if(t===!0)e.assign(r,!0);else e.assign(r,L._`${r} || {}`),Bc(e,r,t)}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:_f}),items:ff({mergeNames:(e,t,r)=>e.if(L._`${r} !== true && ${t} !== undefined`,()=>e.assign(r,L._`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if(L._`${r} !== true`,()=>e.assign(r,t===!0?!0:L._`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function _f(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",L._`{}`);if(t!==void 0)Bc(e,r,t);return r}$f.evaluatedPropsToName=_f;function Bc(e,t,r){Object.keys(r).forEach((n)=>e.assign(L._`${t}${L.getProperty(n)}`,!0))}$f.setEvaluated=Bc;var pf={};function vx(e,t){return e.scopeValue("func",{ref:t,code:pf[t.code]||(pf[t.code]=new hf._Code(t.code))})}$f.useFunc=vx;var Kc;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(Kc||($f.Type=Kc={}));function $x(e,t,r){if(e instanceof L.Name){let n=t===Kc.Num;return r?n?L._`"[" + ${e} + "]"`:L._`"['" + ${e} + "']"`:n?L._`"/" + ${e}`:L._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?L.getProperty(e).toString():"/"+Hc(e)}$f.getErrorPath=$x;function vf(e,t,r=e.opts.strictSchema){if(!r)return;if(t=`strict mode: ${t}`,r===!0)throw Error(t);e.self.logger.warn(t)}$f.checkStrictMode=vf});var pt=g(function(bf){Object.defineProperty(bf,"__esModule",{value:!0});var ce=Y(),Mx={data:new ce.Name("data"),valCxt:new ce.Name("valCxt"),instancePath:new ce.Name("instancePath"),parentData:new ce.Name("parentData"),parentDataProperty:new ce.Name("parentDataProperty"),rootData:new ce.Name("rootData"),dynamicAnchors:new ce.Name("dynamicAnchors"),vErrors:new ce.Name("vErrors"),errors:new ce.Name("errors"),this:new ce.Name("this"),self:new ce.Name("self"),scope:new ce.Name("scope"),json:new ce.Name("json"),jsonPos:new ce.Name("jsonPos"),jsonLen:new ce.Name("jsonLen"),jsonPart:new ce.Name("jsonPart")};bf.default=Mx});var Ys=g(function(Rf){Object.defineProperty(Rf,"__esModule",{value:!0});Rf.extendErrors=Rf.resetErrorsCount=Rf.reportExtraError=Rf.reportError=Rf.keyword$DataError=Rf.keywordError=void 0;var I=Y(),Ar=te(),We=pt();Rf.keywordError={message:({keyword:e})=>I.str`must pass "${e}" keyword validation`};Rf.keyword$DataError={message:({keyword:e,schemaType:t})=>t?I.str`"${e}" keyword must be ${t} ($data)`:I.str`"${e}" keyword is invalid ($data)`};function Ux(e,t=Rf.keywordError,r,n){let{it:s}=e,{gen:o,compositeRule:i,allErrors:a}=s,c=xf(e,t,r);if(n!==null&&n!==void 0?n:i||a)wf(o,c);else Sf(s,I._`[${c}]`)}Rf.reportError=Ux;function Fx(e,t=Rf.keywordError,r){let{it:n}=e,{gen:s,compositeRule:o,allErrors:i}=n,a=xf(e,t,r);if(wf(s,a),!(o||i))Sf(n,We.default.vErrors)}Rf.reportExtraError=Fx;function Vx(e,t){e.assign(We.default.errors,t),e.if(I._`${We.default.vErrors} !== null`,()=>e.if(t,()=>e.assign(I._`${We.default.vErrors}.length`,t),()=>e.assign(We.default.vErrors,null)))}Rf.resetErrorsCount=Vx;function zx({gen:e,keyword:t,schemaValue:r,data:n,errsCount:s,it:o}){if(s===void 0)throw Error("ajv implementation error");let i=e.name("err");e.forRange("i",s,We.default.errors,(a)=>{if(e.const(i,I._`${We.default.vErrors}[${a}]`),e.if(I._`${i}.instancePath === undefined`,()=>e.assign(I._`${i}.instancePath`,I.strConcat(We.default.instancePath,o.errorPath))),e.assign(I._`${i}.schemaPath`,I.str`${o.errSchemaPath}/${t}`),o.opts.verbose)e.assign(I._`${i}.schema`,r),e.assign(I._`${i}.data`,n)})}Rf.extendErrors=zx;function wf(e,t){let r=e.const("err",t);e.if(I._`${We.default.vErrors} === null`,()=>e.assign(We.default.vErrors,I._`[${r}]`),I._`${We.default.vErrors}.push(${r})`),e.code(I._`${We.default.errors}++`)}function Sf(e,t){let{gen:r,validateName:n,schemaEnv:s}=e;if(s.$async)r.throw(I._`new ${e.ValidationError}(${t})`);else r.assign(I._`${n}.errors`,t),r.return(!1)}var $n={keyword:new I.Name("keyword"),schemaPath:new I.Name("schemaPath"),params:new I.Name("params"),propertyName:new I.Name("propertyName"),message:new I.Name("message"),schema:new I.Name("schema"),parentSchema:new I.Name("parentSchema")};function xf(e,t,r){let{createErrors:n}=e.it;if(n===!1)return I._`{}`;return Gx(e,t,r)}function Gx(e,t,r={}){let{gen:n,it:s}=e,o=[Kx(s,r),Hx(e,r)];return Bx(e,t,o),n.object(...o)}function Kx({errorPath:e},{instancePath:t}){let r=t?I.str`${e}${Ar.getErrorPath(t,Ar.Type.Str)}`:e;return[We.default.instancePath,I.strConcat(We.default.instancePath,r)]}function Hx({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let s=n?t:I.str`${t}/${e}`;if(r)s=I.str`${s}${Ar.getErrorPath(r,Ar.Type.Str)}`;return[$n.schemaPath,s]}function Bx(e,{params:t,message:r},n){let{keyword:s,data:o,schemaValue:i,it:a}=e,{opts:c,propertyName:u,topSchemaRef:d,schemaPath:l}=a;if(n.push([$n.keyword,s],[$n.params,typeof t=="function"?t(e):t||I._`{}`]),c.messages)n.push([$n.message,typeof r=="function"?r(e):r]);if(c.verbose)n.push([$n.schema,i],[$n.parentSchema,I._`${d}${l}`],[We.default.data,o]);if(u)n.push([$n.propertyName,u])}});var If=g(function(Pf){Object.defineProperty(Pf,"__esModule",{value:!0});Pf.boolOrEmptySchema=Pf.topBoolOrEmptySchema=void 0;var kf=Ys(),Of=Y(),Qx=pt(),Zx={message:"boolean schema is false"};function eR(e){let{gen:t,schema:r,validateName:n}=e;if(r===!1)Af(e,!1);else if(typeof r=="object"&&r.$async===!0)t.return(Qx.default.data);else t.assign(Of._`${n}.errors`,null),t.return(!0)}Pf.topBoolOrEmptySchema=eR;function tR(e,t){let{gen:r,schema:n}=e;if(n===!1)r.var(t,!1),Af(e);else r.var(t,!0)}Pf.boolOrEmptySchema=tR;function Af(e,t){let{gen:r,data:n}=e;kf.reportError({gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e},Zx,void 0,t)}});var Yc=g(function(Cf){Object.defineProperty(Cf,"__esModule",{value:!0});Cf.getRules=Cf.isJSONType=void 0;var nR=["string","number","integer","boolean","null","object","array"],sR=new Set(nR);function oR(e){return typeof e=="string"&&sR.has(e)}Cf.isJSONType=oR;function iR(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}Cf.getRules=iR});var Xc=g(function(Mf){Object.defineProperty(Mf,"__esModule",{value:!0});Mf.shouldUseRule=Mf.shouldUseGroup=Mf.schemaHasRulesForType=void 0;function cR({schema:e,self:t},r){let n=t.RULES.types[r];return n&&n!==!0&&qf(e,n)}Mf.schemaHasRulesForType=cR;function qf(e,t){return t.rules.some((r)=>Df(e,r))}Mf.shouldUseGroup=qf;function Df(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))}Mf.shouldUseRule=Df});var Xs=g(function(Kf){Object.defineProperty(Kf,"__esModule",{value:!0});Kf.reportTypeError=Kf.checkDataTypes=Kf.checkDataType=Kf.coerceAndCheckDataType=Kf.getJSONTypes=Kf.getSchemaTypes=Kf.DataType=void 0;var Uf=Yc(),Ff=Xc(),Vf=Ys(),x=Y(),ci=te(),Vn;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(Vn||(Kf.DataType=Vn={}));function dR(e){let t=zf(e.type);if(t.includes("null")){if(e.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');if(e.nullable===!0)t.push("null")}return t}Kf.getSchemaTypes=dR;function zf(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(Uf.isJSONType))return t;throw Error("type must be JSONType or JSONType[]: "+t.join(","))}Kf.getJSONTypes=zf;function fR(e,t){let{gen:r,data:n,opts:s}=e,o=pR(t,s.coerceTypes),i=t.length>0&&!(o.length===0&&t.length===1&&Ff.schemaHasRulesForType(e,t[0]));if(i){let a=Qc(t,n,s.strictNumbers,Vn.Wrong);r.if(a,()=>{if(o.length)hR(e,t,o);else Zc(e)})}return i}Kf.coerceAndCheckDataType=fR;var Gf=new Set(["string","number","integer","boolean","null"]);function pR(e,t){return t?e.filter((r)=>Gf.has(r)||t==="array"&&r==="array"):[]}function hR(e,t,r){let{gen:n,data:s,opts:o}=e,i=n.let("dataType",x._`typeof ${s}`),a=n.let("coerced",x._`undefined`);if(o.coerceTypes==="array")n.if(x._`${i} == 'object' && Array.isArray(${s}) && ${s}.length == 1`,()=>n.assign(s,x._`${s}[0]`).assign(i,x._`typeof ${s}`).if(Qc(t,s,o.strictNumbers),()=>n.assign(a,s)));n.if(x._`${a} !== undefined`);for(let u of r)if(Gf.has(u)||u==="array"&&o.coerceTypes==="array")c(u);n.else(),Zc(e),n.endIf(),n.if(x._`${a} !== undefined`,()=>{n.assign(s,a),mR(e,a)});function c(u){switch(u){case"string":n.elseIf(x._`${i} == "number" || ${i} == "boolean"`).assign(a,x._`"" + ${s}`).elseIf(x._`${s} === null`).assign(a,x._`""`);return;case"number":n.elseIf(x._`${i} == "boolean" || ${s} === null
5
5
  || (${i} == "string" && ${s} && ${s} == +${s})`).assign(a,x._`+${s}`);return;case"integer":n.elseIf(x._`${i} === "boolean" || ${s} === null
6
6
  || (${i} === "string" && ${s} && ${s} == +${s} && !(${s} % 1))`).assign(a,x._`+${s}`);return;case"boolean":n.elseIf(x._`${s} === "false" || ${s} === 0 || ${s} === null`).assign(a,!1).elseIf(x._`${s} === "true" || ${s} === 1`).assign(a,!0);return;case"null":n.elseIf(x._`${s} === "" || ${s} === 0 || ${s} === false`),n.assign(a,null);return;case"array":n.elseIf(x._`${i} === "string" || ${i} === "number"
7
- || ${i} === "boolean" || ${s} === null`).assign(a,x._`[${s}]`)}}}function mR({gen:e,parentData:t,parentDataProperty:r},n){e.if(x._`${t} !== undefined`,()=>e.assign(x._`${t}[${r}]`,n))}function Jc(e,t,r,n=Vn.Correct){let s=n===Vn.Correct?x.operators.EQ:x.operators.NEQ,o;switch(e){case"null":return x._`${t} ${s} null`;case"array":o=x._`Array.isArray(${t})`;break;case"object":o=x._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":o=i(x._`!(${t} % 1) && !isNaN(${t})`);break;case"number":o=i();break;default:return x._`typeof ${t} ${s} ${e}`}return n===Vn.Correct?o:x.not(o);function i(a=x.nil){return x.and(x._`typeof ${t} == "number"`,a,r?x._`isFinite(${t})`:x.nil)}}Kf.checkDataType=Jc;function Qc(e,t,r,n){if(e.length===1)return Jc(e[0],t,r,n);let s,o=ci.toHash(e);if(o.array&&o.object){let i=x._`typeof ${t} != "object"`;s=o.null?i:x._`!${t} || ${i}`,delete o.null,delete o.array,delete o.object}else s=x.nil;if(o.number)delete o.integer;for(let i in o)s=x.and(s,Jc(i,t,r,n));return s}Kf.checkDataTypes=Qc;var gR={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?x._`{type: ${e}}`:x._`{type: ${t}}`};function Zc(e){let t=yR(e);Vf.reportError(t,gR)}Kf.reportTypeError=Zc;function yR(e){let{gen:t,data:r,schema:n}=e,s=ci.schemaRefOrVal(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:s,schemaValue:s,parentSchema:n,params:{},it:e}}});var Jf=g(function(Yf){Object.defineProperty(Yf,"__esModule",{value:!0});Yf.assignDefaults=void 0;var ht=Y(),Wf=te();function SR(e,t){let{properties:r,items:n}=e.schema;if(t==="object"&&r)for(let s in r)Bf(e,s,r[s].default);else if(t==="array"&&Array.isArray(n))n.forEach((s,o)=>Bf(e,o,s.default))}Yf.assignDefaults=SR;function Bf(e,t,r){let{gen:n,compositeRule:s,data:o,opts:i}=e;if(r===void 0)return;let a=ht._`${o}${ht.getProperty(t)}`;if(s){Wf.checkStrictMode(e,`default is ignored for: ${a}`);return}let c=ht._`${a} === undefined`;if(i.useDefaults==="empty")c=ht._`${c} || ${a} === null || ${a} === ""`;n.if(c,ht._`${a} = ${ht.stringify(r)}`)}});var mt=g(function(tp){Object.defineProperty(tp,"__esModule",{value:!0});tp.validateUnion=tp.validateArray=tp.usePattern=tp.callValidateCode=tp.schemaProperties=tp.allSchemaProperties=tp.noPropertyInData=tp.propertyInData=tp.isOwnProperty=tp.hasPropFunc=tp.reportMissingProp=tp.checkMissingProp=tp.checkReportMissingProp=void 0;var V=Y(),zn=te(),Pr=pt(),Qf=te();function xR(e,t){let{gen:r,data:n,it:s}=e;r.if(tu(r,n,t,s.opts.ownProperties),()=>{e.setParams({missingProperty:V._`${t}`},!0),e.error()})}tp.checkReportMissingProp=xR;function RR({gen:e,data:t,it:{opts:r}},n,s){return V.or(...n.map((o)=>V.and(tu(e,t,o,r.ownProperties),V._`${s} = ${o}`)))}tp.checkMissingProp=RR;function TR(e,t){e.setParams({missingProperty:t},!0),e.error()}tp.reportMissingProp=TR;function Zf(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:V._`Object.prototype.hasOwnProperty`})}tp.hasPropFunc=Zf;function eu(e,t,r){return V._`${Zf(e)}.call(${t}, ${r})`}tp.isOwnProperty=eu;function kR(e,t,r,n){let s=V._`${t}${V.getProperty(r)} !== undefined`;return n?V._`${s} && ${eu(e,t,r)}`:s}tp.propertyInData=kR;function tu(e,t,r,n){let s=V._`${t}${V.getProperty(r)} === undefined`;return n?V.or(s,V.not(eu(e,t,r))):s}tp.noPropertyInData=tu;function ep(e){return e?Object.keys(e).filter((t)=>t!=="__proto__"):[]}tp.allSchemaProperties=ep;function OR(e,t){return ep(t).filter((r)=>!zn.alwaysValidSchema(e,t[r]))}tp.schemaProperties=OR;function AR({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:s,errorPath:o},it:i},a,c,u){let d=u?V._`${e}, ${t}, ${n}${s}`:t,l=[[Pr.default.instancePath,V.strConcat(Pr.default.instancePath,o)],[Pr.default.parentData,i.parentData],[Pr.default.parentDataProperty,i.parentDataProperty],[Pr.default.rootData,Pr.default.rootData]];if(i.opts.dynamicRef)l.push([Pr.default.dynamicAnchors,Pr.default.dynamicAnchors]);let p=V._`${d}, ${r.object(...l)}`;return c!==V.nil?V._`${a}.call(${c}, ${p})`:V._`${a}(${p})`}tp.callValidateCode=AR;var PR=V._`new RegExp`;function NR({gen:e,it:{opts:t}},r){let n=t.unicodeRegExp?"u":"",{regExp:s}=t.code,o=s(r,n);return e.scopeValue("pattern",{key:o.toString(),ref:o,code:V._`${s.code==="new RegExp"?PR:Qf.useFunc(e,s)}(${r}, ${n})`})}tp.usePattern=NR;function IR(e){let{gen:t,data:r,keyword:n,it:s}=e,o=t.name("valid");if(s.allErrors){let a=t.let("valid",!0);return i(()=>t.assign(a,!1)),a}return t.var(o,!0),i(()=>t.break()),o;function i(a){let c=t.const("len",V._`${r}.length`);t.forRange("i",0,c,(u)=>{e.subschema({keyword:n,dataProp:u,dataPropType:zn.Type.Num},o),t.if(V.not(o),a)})}}tp.validateArray=IR;function CR(e){let{gen:t,schema:r,keyword:n,it:s}=e;if(!Array.isArray(r))throw Error("ajv implementation error");if(r.some((c)=>zn.alwaysValidSchema(s,c))&&!s.opts.unevaluated)return;let i=t.let("valid",!1),a=t.name("_valid");t.block(()=>r.forEach((c,u)=>{let d=e.subschema({keyword:n,schemaProp:u,compositeRule:!0},a);if(t.assign(i,V._`${i} || ${a}`),!e.mergeValidEvaluated(d,a))t.if(V.not(i))})),e.result(i,()=>e.reset(),()=>e.error(!0))}tp.validateUnion=CR});var up=g(function(ap){Object.defineProperty(ap,"__esModule",{value:!0});ap.validateKeywordUsage=ap.validSchemaType=ap.funcKeywordCode=ap.macroKeywordCode=void 0;var le=Y(),En=pt(),sp=mt(),op=Ys();function BR(e,t){let{gen:r,keyword:n,schema:s,parentSchema:o,it:i}=e,a=t.macro.call(i.self,s,o,i),c=ip(r,n,a);if(i.opts.validateSchema!==!1)i.self.validateSchema(a,!0);let u=r.name("valid");e.subschema({schema:a,schemaPath:le.nil,errSchemaPath:`${i.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},u),e.pass(u,()=>e.error(!0))}ap.macroKeywordCode=BR;function WR(e,t){var r;let{gen:n,keyword:s,schema:o,parentSchema:i,$data:a,it:c}=e;XR(c,t);let u=!a&&t.compile?t.compile.call(c.self,o,i,c):t.validate,d=ip(n,s,u),l=n.let("valid");e.block$data(l,p),e.ok((r=t.valid)!==null&&r!==void 0?r:l);function p(){if(t.errors===!1){if(m(),t.modifying)np(e);y(()=>e.error())}else{let _=t.async?f():h();if(t.modifying)np(e);y(()=>YR(e,_))}}function f(){let _=n.let("ruleErrs",null);return n.try(()=>m(le._`await `),(O)=>n.assign(l,!1).if(le._`${O} instanceof ${c.ValidationError}`,()=>n.assign(_,le._`${O}.errors`),()=>n.throw(O))),_}function h(){let _=le._`${d}.errors`;return n.assign(_,null),m(le.nil),_}function m(_=t.async?le._`await `:le.nil){let O=c.opts.passContext?En.default.this:En.default.self,T=!(("compile"in t)&&!a||t.schema===!1);n.assign(l,le._`${_}${sp.callValidateCode(e,d,O,T)}`,t.modifying)}function y(_){var O;n.if(le.not((O=t.valid)!==null&&O!==void 0?O:l),_)}}ap.funcKeywordCode=WR;function np(e){let{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,le._`${n.parentData}[${n.parentDataProperty}]`))}function YR(e,t){let{gen:r}=e;r.if(le._`Array.isArray(${t})`,()=>{r.assign(En.default.vErrors,le._`${En.default.vErrors} === null ? ${t} : ${En.default.vErrors}.concat(${t})`).assign(En.default.errors,le._`${En.default.vErrors}.length`),op.extendErrors(e)},()=>e.error())}function XR({schemaEnv:e},t){if(t.async&&!e.$async)throw Error("async keyword in sync schema")}function ip(e,t,r){if(r===void 0)throw Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:le.stringify(r)})}function JR(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>"u")}ap.validSchemaType=JR;function QR({schema:e,opts:t,self:r,errSchemaPath:n},s,o){if(Array.isArray(s.keyword)?!s.keyword.includes(o):s.keyword!==o)throw Error("ajv implementation error");let i=s.dependencies;if(i===null||i===void 0?void 0:i.some((a)=>!Object.prototype.hasOwnProperty.call(e,a)))throw Error(`parent schema must have dependencies of ${o}: ${i.join(",")}`);if(s.validateSchema){if(!s.validateSchema(e[o])){let c=`keyword "${o}" value is invalid at path "${n}": `+r.errorsText(s.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(c);else throw Error(c)}}}ap.validateKeywordUsage=QR});var fp=g(function(lp){Object.defineProperty(lp,"__esModule",{value:!0});lp.extendSubschemaMode=lp.extendSubschemaData=lp.getSubschema=void 0;var je=Y(),ui=te();function rT(e,{keyword:t,schemaProp:r,schema:n,schemaPath:s,errSchemaPath:o,topSchemaRef:i}){if(t!==void 0&&n!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){let a=e.schema[t];return r===void 0?{schema:a,schemaPath:je._`${e.schemaPath}${je.getProperty(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:a[r],schemaPath:je._`${e.schemaPath}${je.getProperty(t)}${je.getProperty(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${ui.escapeFragment(r)}`}}if(n!==void 0){if(s===void 0||o===void 0||i===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:s,topSchemaRef:i,errSchemaPath:o}}throw Error('either "keyword" or "schema" must be passed')}lp.getSubschema=rT;function nT(e,t,{dataProp:r,dataPropType:n,data:s,dataTypes:o,propertyName:i}){if(s!==void 0&&r!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=t;if(r!==void 0){let{errorPath:u,dataPathArr:d,opts:l}=t,p=a.let("data",je._`${t.data}${je.getProperty(r)}`,!0);c(p),e.errorPath=je.str`${u}${ui.getErrorPath(r,n,l.jsPropertySyntax)}`,e.parentDataProperty=je._`${r}`,e.dataPathArr=[...d,e.parentDataProperty]}if(s!==void 0){let u=s instanceof je.Name?s:a.let("data",s,!0);if(c(u),i!==void 0)e.propertyName=i}if(o)e.dataTypes=o;function c(u){e.data=u,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,u]}}lp.extendSubschemaData=nT;function sT(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:s,allErrors:o}){if(n!==void 0)e.compositeRule=n;if(s!==void 0)e.createErrors=s;if(o!==void 0)e.allErrors=o;e.jtdDiscriminator=t,e.jtdMetadata=r}lp.extendSubschemaMode=sT});var Js=g(function(Zz,pp){pp.exports=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,o;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(o=Object.keys(t),n=o.length,n!==Object.keys(r).length)return!1;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[s]))return!1;for(s=n;s--!==0;){var i=o[s];if(!e(t[i],r[i]))return!1}return!0}return t!==t&&r!==r}});var ru=g(function(e4,hp){var Nr=hp.exports=function(e,t,r){if(typeof t=="function")r=t,t={};r=t.cb||r;var n=typeof r=="function"?r:r.pre||function(){},s=r.post||function(){};li(t,n,s,e,"",e)};Nr.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Nr.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Nr.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Nr.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 li(e,t,r,n,s,o,i,a,c,u){if(n&&typeof n=="object"&&!Array.isArray(n)){t(n,s,o,i,a,c,u);for(var d in n){var l=n[d];if(Array.isArray(l)){if(d in Nr.arrayKeywords)for(var p=0;p<l.length;p++)li(e,t,r,l[p],s+"/"+d+"/"+p,o,s,d,n,p)}else if(d in Nr.propsKeywords){if(l&&typeof l=="object")for(var f in l)li(e,t,r,l[f],s+"/"+d+"/"+aT(f),o,s,d,n,f)}else if(d in Nr.keywords||e.allKeys&&!(d in Nr.skipKeywords))li(e,t,r,l,s+"/"+d,o,s,d,n)}r(n,s,o,i,a,c,u)}}function aT(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}});var Qs=g(function(vp){Object.defineProperty(vp,"__esModule",{value:!0});vp.getSchemaRefs=vp.resolveUrl=vp.normalizeId=vp._getFullPath=vp.getFullPath=vp.inlineRef=void 0;var mp=te(),cT=Js(),uT=ru(),lT=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function dT(e,t=!0){if(typeof e=="boolean")return!0;if(t===!0)return!nu(e);if(!t)return!1;return gp(e)<=t}vp.inlineRef=dT;var fT=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function nu(e){for(let t in e){if(fT.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(nu))return!0;if(typeof r=="object"&&nu(r))return!0}return!1}function gp(e){let t=0;for(let r in e){if(r==="$ref")return 1/0;if(t++,lT.has(r))continue;if(typeof e[r]=="object")mp.eachItem(e[r],(n)=>t+=gp(n));if(t===1/0)return 1/0}return t}function yp(e,t="",r){if(r!==!1)t=Gn(t);let n=e.parse(t);return _p(e,n)}vp.getFullPath=yp;function _p(e,t){return e.serialize(t).split("#")[0]+"#"}vp._getFullPath=_p;var pT=/#\/?$/;function Gn(e){return e?e.replace(pT,""):""}vp.normalizeId=Gn;function hT(e,t,r){return r=Gn(r),e.resolve(t,r)}vp.resolveUrl=hT;var mT=/^[a-z_][-a-z0-9._]*$/i;function gT(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,s=Gn(e[r]||t),o={"":s},i=yp(n,s,!1),a={},c=new Set;return uT(e,{allKeys:!0},(l,p,f,h)=>{if(h===void 0)return;let m=i+p,y=o[h];if(typeof l[r]=="string")y=_.call(this,l[r]);O.call(this,l.$anchor),O.call(this,l.$dynamicAnchor),o[p]=y;function _(T){let M=this.opts.uriResolver.resolve;if(T=Gn(y?M(y,T):T),c.has(T))throw d(T);c.add(T);let S=this.refs[T];if(typeof S=="string")S=this.refs[S];if(typeof S=="object")u(l,S.schema,T);else if(T!==Gn(m))if(T[0]==="#")u(l,a[T],T),a[T]=l;else this.refs[T]=m;return T}function O(T){if(typeof T=="string"){if(!mT.test(T))throw Error(`invalid anchor "${T}"`);_.call(this,`#${T}`)}}}),a;function u(l,p,f){if(p!==void 0&&!cT(l,p))throw d(f)}function d(l){return Error(`reference "${l}" resolves to more than one schema`)}}vp.getSchemaRefs=gT});var Zs=g(function(jp){Object.defineProperty(jp,"__esModule",{value:!0});jp.getData=jp.KeywordCxt=jp.validateFunctionCode=void 0;var fi=If(),di=Xs(),Hn=Xc(),Ir=Xs(),Sp=Jf(),Mt=up(),Kn=fp(),E=Y(),H=pt(),xp=Qs(),Me=te(),Dt=Ys();function wT(e){if(kp(e)){if(Op(e),Tp(e)){xT(e);return}}Rp(e,()=>fi.topBoolOrEmptySchema(e))}jp.validateFunctionCode=wT;function Rp({gen:e,validateName:t,schema:r,schemaEnv:n,opts:s},o){if(s.code.es5)e.func(t,E._`${H.default.data}, ${H.default.valCxt}`,n.$async,()=>{e.code(E._`"use strict"; ${Ep(r,s)}`),ST(e,s),e.code(o)});else e.func(t,E._`${H.default.data}, ${bT(s)}`,n.$async,()=>e.code(Ep(r,s)).code(o))}function bT(e){return E._`{${H.default.instancePath}="", ${H.default.parentData}, ${H.default.parentDataProperty}, ${H.default.rootData}=${H.default.data}${e.dynamicRef?E._`, ${H.default.dynamicAnchors}={}`:E.nil}}={}`}function ST(e,t){e.if(H.default.valCxt,()=>{if(e.var(H.default.instancePath,E._`${H.default.valCxt}.${H.default.instancePath}`),e.var(H.default.parentData,E._`${H.default.valCxt}.${H.default.parentData}`),e.var(H.default.parentDataProperty,E._`${H.default.valCxt}.${H.default.parentDataProperty}`),e.var(H.default.rootData,E._`${H.default.valCxt}.${H.default.rootData}`),t.dynamicRef)e.var(H.default.dynamicAnchors,E._`${H.default.valCxt}.${H.default.dynamicAnchors}`)},()=>{if(e.var(H.default.instancePath,E._`""`),e.var(H.default.parentData,E._`undefined`),e.var(H.default.parentDataProperty,E._`undefined`),e.var(H.default.rootData,H.default.data),t.dynamicRef)e.var(H.default.dynamicAnchors,E._`{}`)})}function xT(e){let{schema:t,opts:r,gen:n}=e;Rp(e,()=>{if(r.$comment&&t.$comment)Pp(e);if(AT(e),n.let(H.default.vErrors,null),n.let(H.default.errors,0),r.unevaluated)RT(e);Ap(e),IT(e)});return}function RT(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",E._`${r}.evaluated`),t.if(E._`${e.evaluated}.dynamicProps`,()=>t.assign(E._`${e.evaluated}.props`,E._`undefined`)),t.if(E._`${e.evaluated}.dynamicItems`,()=>t.assign(E._`${e.evaluated}.items`,E._`undefined`))}function Ep(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?E._`/*# sourceURL=${r} */`:E.nil}function TT(e,t){if(kp(e)){if(Op(e),Tp(e)){kT(e,t);return}}fi.boolOrEmptySchema(e,t)}function Tp({schema:e,self:t}){if(typeof e=="boolean")return!e;for(let r in e)if(t.RULES.all[r])return!0;return!1}function kp(e){return typeof e.schema!="boolean"}function kT(e,t){let{schema:r,gen:n,opts:s}=e;if(s.$comment&&r.$comment)Pp(e);PT(e),NT(e);let o=n.const("_errs",H.default.errors);Ap(e,o),n.var(t,E._`${o} === ${H.default.errors}`)}function Op(e){Me.checkUnknownRules(e),OT(e)}function Ap(e,t){if(e.opts.jtd)return wp(e,[],!1,t);let r=di.getSchemaTypes(e.schema),n=di.coerceAndCheckDataType(e,r);wp(e,r,!n,t)}function OT(e){let{schema:t,errSchemaPath:r,opts:n,self:s}=e;if(t.$ref&&n.ignoreKeywordsWithRef&&Me.schemaHasRulesButRef(t,s.RULES))s.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function AT(e){let{schema:t,opts:r}=e;if(t.default!==void 0&&r.useDefaults&&r.strictSchema)Me.checkStrictMode(e,"default is ignored in the schema root")}function PT(e){let t=e.schema[e.opts.schemaId];if(t)e.baseId=xp.resolveUrl(e.opts.uriResolver,e.baseId,t)}function NT(e){if(e.schema.$async&&!e.schemaEnv.$async)throw Error("async schema in sync schema")}function Pp({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:s}){let o=r.$comment;if(s.$comment===!0)e.code(E._`${H.default.self}.logger.log(${o})`);else if(typeof s.$comment=="function"){let i=E.str`${n}/$comment`,a=e.scopeValue("root",{ref:t.root});e.code(E._`${H.default.self}.opts.$comment(${o}, ${i}, ${a}.schema)`)}}function IT(e){let{gen:t,schemaEnv:r,validateName:n,ValidationError:s,opts:o}=e;if(r.$async)t.if(E._`${H.default.errors} === 0`,()=>t.return(H.default.data),()=>t.throw(E._`new ${s}(${H.default.vErrors})`));else{if(t.assign(E._`${n}.errors`,H.default.vErrors),o.unevaluated)CT(e);t.return(E._`${H.default.errors} === 0`)}}function CT({gen:e,evaluated:t,props:r,items:n}){if(r instanceof E.Name)e.assign(E._`${t}.props`,r);if(n instanceof E.Name)e.assign(E._`${t}.items`,n)}function wp(e,t,r,n){let{gen:s,schema:o,data:i,allErrors:a,opts:c,self:u}=e,{RULES:d}=u;if(o.$ref&&(c.ignoreKeywordsWithRef||!Me.schemaHasRulesButRef(o,d))){s.block(()=>Ip(e,"$ref",d.all.$ref.definition));return}if(!c.jtd)jT(e,t);s.block(()=>{for(let p of d.rules)l(p);l(d.post)});function l(p){if(!Hn.shouldUseGroup(o,p))return;if(p.type){if(s.if(Ir.checkDataType(p.type,i,c.strictNumbers)),bp(e,p),t.length===1&&t[0]===p.type&&r)s.else(),Ir.reportTypeError(e);s.endIf()}else bp(e,p);if(!a)s.if(E._`${H.default.errors} === ${n||0}`)}}function bp(e,t){let{gen:r,schema:n,opts:{useDefaults:s}}=e;if(s)Sp.assignDefaults(e,t.type);r.block(()=>{for(let o of t.rules)if(Hn.shouldUseRule(n,o))Ip(e,o.keyword,o.definition,t.type)})}function jT(e,t){if(e.schemaEnv.meta||!e.opts.strictTypes)return;if(qT(e,t),!e.opts.allowUnionTypes)DT(e,t);MT(e,e.dataTypes)}function qT(e,t){if(!t.length)return;if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach((r)=>{if(!Np(e.dataTypes,r))su(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),UT(e,t)}function DT(e,t){if(t.length>1&&!(t.length===2&&t.includes("null")))su(e,"use allowUnionTypes to allow union type keyword")}function MT(e,t){let r=e.self.RULES.all;for(let n in r){let s=r[n];if(typeof s=="object"&&Hn.shouldUseRule(e.schema,s)){let{type:o}=s.definition;if(o.length&&!o.some((i)=>LT(t,i)))su(e,`missing type "${o.join(",")}" for keyword "${n}"`)}}}function LT(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function Np(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function UT(e,t){let r=[];for(let n of e.dataTypes)if(Np(t,n))r.push(n);else if(t.includes("integer")&&n==="number")r.push("integer");e.dataTypes=r}function su(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,Me.checkStrictMode(e,t,e.opts.strictTypes)}class ou{constructor(e,t,r){if(Mt.validateKeywordUsage(e,t,r),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=r,this.data=e.data,this.schema=e.schema[r],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=Me.schemaRefOrVal(e,this.schema,r,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",Cp(this.$data,e));else if(this.schemaCode=this.schemaValue,!Mt.validSchemaType(this.schema,t.schemaType,t.allowUndefined))throw Error(`${r} value must be ${JSON.stringify(t.schemaType)}`);if("code"in t?t.trackErrors:t.errors!==!1)this.errsCount=e.gen.const("_errs",H.default.errors)}result(e,t,r){this.failResult(E.not(e),t,r)}failResult(e,t,r){if(this.gen.if(e),r)r();else this.error();if(t){if(this.gen.else(),t(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass(e,t){this.failResult(E.not(e),void 0,t)}fail(e){if(e===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if(e),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:t}=this;this.fail(E._`${t} !== undefined && (${E.or(this.invalid$data(),e)})`)}error(e,t,r){if(t){this.setParams(t),this._error(e,r),this.setParams({});return}this._error(e,r)}_error(e,t){(e?Dt.reportExtraError:Dt.reportError)(this,this.def.error,t)}$dataError(){Dt.reportError(this,this.def.$dataError||Dt.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');Dt.resetErrorsCount(this.gen,this.errsCount)}ok(e){if(!this.allErrors)this.gen.if(e)}setParams(e,t){if(t)Object.assign(this.params,e);else this.params=e}block$data(e,t,r=E.nil){this.gen.block(()=>{this.check$data(e,r),t()})}check$data(e=E.nil,t=E.nil){if(!this.$data)return;let{gen:r,schemaCode:n,schemaType:s,def:o}=this;if(r.if(E.or(E._`${n} === undefined`,t)),e!==E.nil)r.assign(e,!0);if(s.length||o.validateSchema){if(r.elseIf(this.invalid$data()),this.$dataError(),e!==E.nil)r.assign(e,!1)}r.else()}invalid$data(){let{gen:e,schemaCode:t,schemaType:r,def:n,it:s}=this;return E.or(o(),i());function o(){if(r.length){if(!(t instanceof E.Name))throw Error("ajv implementation error");let a=Array.isArray(r)?r:[r];return E._`${Ir.checkDataTypes(a,t,s.opts.strictNumbers,Ir.DataType.Wrong)}`}return E.nil}function i(){if(n.validateSchema){let a=e.scopeValue("validate$data",{ref:n.validateSchema});return E._`!${a}(${t})`}return E.nil}}subschema(e,t){let r=Kn.getSubschema(this.it,e);Kn.extendSubschemaData(r,this.it,e),Kn.extendSubschemaMode(r,e);let n={...this.it,...r,items:void 0,props:void 0};return TT(n,t),n}mergeEvaluated(e,t){let{it:r,gen:n}=this;if(!r.opts.unevaluated)return;if(r.props!==!0&&e.props!==void 0)r.props=Me.mergeEvaluated.props(n,e.props,r.props,t);if(r.items!==!0&&e.items!==void 0)r.items=Me.mergeEvaluated.items(n,e.items,r.items,t)}mergeValidEvaluated(e,t){let{it:r,gen:n}=this;if(r.opts.unevaluated&&(r.props!==!0||r.items!==!0))return n.if(t,()=>this.mergeEvaluated(e,E.Name)),!0}}jp.KeywordCxt=ou;function Ip(e,t,r,n){let s=new ou(e,r,t);if("code"in r)r.code(s,n);else if(s.$data&&r.validate)Mt.funcKeywordCode(s,r);else if("macro"in r)Mt.macroKeywordCode(s,r);else if(r.compile||r.validate)Mt.funcKeywordCode(s,r)}var FT=/^\/(?:[^~]|~0|~1)*$/,VT=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Cp(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let s,o;if(e==="")return H.default.rootData;if(e[0]==="/"){if(!FT.test(e))throw Error(`Invalid JSON-pointer: ${e}`);s=e,o=H.default.rootData}else{let u=VT.exec(e);if(!u)throw Error(`Invalid JSON-pointer: ${e}`);let d=+u[1];if(s=u[2],s==="#"){if(d>=t)throw Error(c("property/index",d));return n[t-d]}if(d>t)throw Error(c("data",d));if(o=r[t-d],!s)return o}let i=o,a=s.split("/");for(let u of a)if(u)o=E._`${o}${E.getProperty(Me.unescapeJsonPointer(u))}`,i=E._`${i} && ${o}`;return i;function c(u,d){return`Cannot access ${u} ${d} levels up, current level is ${t}`}}jp.getData=Cp});var pi=g(function(Mp){Object.defineProperty(Mp,"__esModule",{value:!0});class Dp extends Error{constructor(e){super("validation failed");this.errors=e,this.ajv=this.validation=!0}}Mp.default=Dp});var eo=g(function(Up){Object.defineProperty(Up,"__esModule",{value:!0});var Bn=Qs();class Lp extends Error{constructor(e,t,r,n){super(n||`can't resolve reference ${r} from id ${t}`);this.missingRef=Bn.resolveUrl(e,t,r),this.missingSchema=Bn.normalizeId(Bn.getFullPath(e,this.missingRef))}}Up.default=Lp});var ro=g(function(zp){Object.defineProperty(zp,"__esModule",{value:!0});zp.resolveSchema=zp.getCompilingSchema=zp.resolveRef=zp.compileSchema=zp.SchemaEnv=void 0;var Re=Y(),BT=pi(),wn=pt(),Te=Qs(),hi=te(),Fp=Zs();class to{constructor(e){var t;this.refs={},this.dynamicAnchors={};let r;if(typeof e.schema=="object")r=e.schema;this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(t=e.baseId)!==null&&t!==void 0?t:Te.normalizeId(r===null||r===void 0?void 0:r[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=r===null||r===void 0?void 0:r.$async,this.refs={}}}zp.SchemaEnv=to;function au(e){let t=Vp.call(this,e);if(t)return t;let r=Te.getFullPath(this.opts.uriResolver,e.root.baseId),{es5:n,lines:s}=this.opts.code,{ownProperties:o}=this.opts,i=new Re.CodeGen(this.scope,{es5:n,lines:s,ownProperties:o}),a;if(e.$async)a=i.scopeValue("Error",{ref:BT.default,code:Re._`require("ajv/dist/runtime/validation_error").default`});let c=i.scopeName("validate");e.validateName=c;let u={gen:i,allErrors:this.opts.allErrors,data:wn.default.data,parentData:wn.default.parentData,parentDataProperty:wn.default.parentDataProperty,dataNames:[wn.default.data],dataPathArr:[Re.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:i.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:Re.stringify(e.schema)}:{ref:e.schema}),validateName:c,ValidationError:a,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:Re.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:Re._`""`,opts:this.opts,self:this},d;try{this._compilations.add(e),Fp.validateFunctionCode(u),i.optimize(this.opts.code.optimize);let l=i.toString();if(d=`${i.scopeRefs(wn.default.scope)}return ${l}`,this.opts.code.process)d=this.opts.code.process(d,e);let f=Function(`${wn.default.self}`,`${wn.default.scope}`,d)(this,this.scope.get());if(this.scope.value(c,{ref:f}),f.errors=null,f.schema=e.schema,f.schemaEnv=e,e.$async)f.$async=!0;if(this.opts.code.source===!0)f.source={validateName:c,validateCode:l,scopeValues:i._values};if(this.opts.unevaluated){let{props:h,items:m}=u;if(f.evaluated={props:h instanceof Re.Name?void 0:h,items:m instanceof Re.Name?void 0:m,dynamicProps:h instanceof Re.Name,dynamicItems:m instanceof Re.Name},f.source)f.source.evaluated=Re.stringify(f.evaluated)}return e.validate=f,e}catch(l){if(delete e.validate,delete e.validateName,d)this.logger.error("Error compiling schema, function code:",d);throw l}finally{this._compilations.delete(e)}}zp.compileSchema=au;function WT(e,t,r){var n;r=Te.resolveUrl(this.opts.uriResolver,t,r);let s=e.refs[r];if(s)return s;let o=JT.call(this,e,r);if(o===void 0){let i=(n=e.localRefs)===null||n===void 0?void 0:n[r],{schemaId:a}=this.opts;if(i)o=new to({schema:i,schemaId:a,root:e,baseId:t})}if(o===void 0)return;return e.refs[r]=YT.call(this,o)}zp.resolveRef=WT;function YT(e){if(Te.inlineRef(e.schema,this.opts.inlineRefs))return e.schema;return e.validate?e:au.call(this,e)}function Vp(e){for(let t of this._compilations)if(XT(t,e))return t}zp.getCompilingSchema=Vp;function XT(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function JT(e,t){let r;while(typeof(r=this.refs[t])=="string")t=r;return r||this.schemas[t]||mi.call(this,e,t)}function mi(e,t){let r=this.opts.uriResolver.parse(t),n=Te._getFullPath(this.opts.uriResolver,r),s=Te.getFullPath(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===s)return iu.call(this,r,e);let o=Te.normalizeId(n),i=this.refs[o]||this.schemas[o];if(typeof i=="string"){let a=mi.call(this,e,i);if(typeof(a===null||a===void 0?void 0:a.schema)!=="object")return;return iu.call(this,r,a)}if(typeof(i===null||i===void 0?void 0:i.schema)!=="object")return;if(!i.validate)au.call(this,i);if(o===Te.normalizeId(t)){let{schema:a}=i,{schemaId:c}=this.opts,u=a[c];if(u)s=Te.resolveUrl(this.opts.uriResolver,s,u);return new to({schema:a,schemaId:c,root:e,baseId:s})}return iu.call(this,r,i)}zp.resolveSchema=mi;var QT=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function iu(e,{baseId:t,schema:r,root:n}){var s;if(((s=e.fragment)===null||s===void 0?void 0:s[0])!=="/")return;for(let a of e.fragment.slice(1).split("/")){if(typeof r==="boolean")return;let c=r[hi.unescapeFragment(a)];if(c===void 0)return;r=c;let u=typeof r==="object"&&r[this.opts.schemaId];if(!QT.has(a)&&u)t=Te.resolveUrl(this.opts.uriResolver,t,u)}let o;if(typeof r!="boolean"&&r.$ref&&!hi.schemaHasRulesButRef(r,this.RULES)){let a=Te.resolveUrl(this.opts.uriResolver,t,r.$ref);o=mi.call(this,n,a)}let{schemaId:i}=this.opts;if(o=o||new to({schema:r,schemaId:i,root:n,baseId:t}),o.schema!==o.root.schema)return o;return}});var Kp=g(function(i4,nk){nk.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var uu=g(function(a4,Yp){var sk=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),Bp=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function cu(e){let t="",r=0,n=0;for(n=0;n<e.length;n++){if(r=e[n].charCodeAt(0),r===48)continue;if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n];break}for(n+=1;n<e.length;n++){if(r=e[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n]}return t}var ok=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function Hp(e){return e.length=0,!0}function ik(e,t,r){if(e.length){let n=cu(e);if(n!=="")t.push(n);else return r.error=!0,!1;e.length=0}return!0}function ak(e){let t=0,r={error:!1,address:"",zone:""},n=[],s=[],o=!1,i=!1,a=ik;for(let c=0;c<e.length;c++){let u=e[c];if(u==="["||u==="]")continue;if(u===":"){if(o===!0)i=!0;if(!a(s,n,r))break;if(++t>7){r.error=!0;break}if(c>0&&e[c-1]===":")o=!0;n.push(":");continue}else if(u==="%"){if(!a(s,n,r))break;a=Hp}else{s.push(u);continue}}if(s.length)if(a===Hp)r.zone=s.join("");else if(i)n.push(s.join(""));else n.push(cu(s));return r.address=n.join(""),r}function Wp(e){if(ck(e,":")<2)return{host:e,isIPV6:!1};let t=ak(e);if(!t.error){let{address:r,address:n}=t;if(t.zone)r+="%"+t.zone,n+="%25"+t.zone;return{host:r,isIPV6:!0,escapedHost:n}}else return{host:e,isIPV6:!1}}function ck(e,t){let r=0;for(let n=0;n<e.length;n++)if(e[n]===t)r++;return r}function uk(e){let t=e,r=[],n=-1,s=0;while(s=t.length){if(s===1)if(t===".")break;else if(t==="/"){r.push("/");break}else{r.push(t);break}else if(s===2){if(t[0]==="."){if(t[1]===".")break;else if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"){if(t[1]==="."||t[1]==="/"){r.push("/");break}}}else if(s===3){if(t==="/.."){if(r.length!==0)r.pop();r.push("/");break}}if(t[0]==="."){if(t[1]==="."){if(t[2]==="/"){t=t.slice(3);continue}}else if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"){if(t[1]==="."){if(t[2]==="/"){t=t.slice(2);continue}else if(t[2]==="."){if(t[3]==="/"){if(t=t.slice(3),r.length!==0)r.pop();continue}}}}if((n=t.indexOf("/",1))===-1){r.push(t);break}else r.push(t.slice(0,n)),t=t.slice(n)}return r.join("")}function lk(e,t){let r=t!==!0?escape:unescape;if(e.scheme!==void 0)e.scheme=r(e.scheme);if(e.userinfo!==void 0)e.userinfo=r(e.userinfo);if(e.host!==void 0)e.host=r(e.host);if(e.path!==void 0)e.path=r(e.path);if(e.query!==void 0)e.query=r(e.query);if(e.fragment!==void 0)e.fragment=r(e.fragment);return e}function dk(e){let t=[];if(e.userinfo!==void 0)t.push(e.userinfo),t.push("@");if(e.host!==void 0){let r=unescape(e.host);if(!Bp(r)){let n=Wp(r);if(n.isIPV6===!0)r=`[${n.escapedHost}]`;else r=e.host}t.push(r)}if(typeof e.port==="number"||typeof e.port==="string")t.push(":"),t.push(String(e.port));return t.length?t.join(""):void 0}Yp.exports={nonSimpleDomain:ok,recomposeAuthority:dk,normalizeComponentEncoding:lk,removeDotSegments:uk,isIPv4:Bp,isUUID:sk,normalizeIPv6:Wp,stringArrayToHexStripped:cu}});var eh=g(function(c4,Zp){var{isUUID:fk}=uu(),pk=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,hk=["http","https","ws","wss","urn","urn:uuid"];function mk(e){return hk.indexOf(e)!==-1}function lu(e){if(e.secure===!0)return!0;else if(e.secure===!1)return!1;else if(e.scheme)return e.scheme.length===3&&(e.scheme[0]==="w"||e.scheme[0]==="W")&&(e.scheme[1]==="s"||e.scheme[1]==="S")&&(e.scheme[2]==="s"||e.scheme[2]==="S");else return!1}function Xp(e){if(!e.host)e.error=e.error||"HTTP URIs must have a host.";return e}function Jp(e){let t=String(e.scheme).toLowerCase()==="https";if(e.port===(t?443:80)||e.port==="")e.port=void 0;if(!e.path)e.path="/";return e}function gk(e){return e.secure=lu(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function yk(e){if(e.port===(lu(e)?443:80)||e.port==="")e.port=void 0;if(typeof e.secure==="boolean")e.scheme=e.secure?"wss":"ws",e.secure=void 0;if(e.resourceName){let[t,r]=e.resourceName.split("?");e.path=t&&t!=="/"?t:void 0,e.query=r,e.resourceName=void 0}return e.fragment=void 0,e}function _k(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match(pk);if(r){let n=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];let s=`${n}:${t.nid||e.nid}`,o=du(s);if(e.path=void 0,o)e=o.parse(e,t)}else e.error=e.error||"URN can not be parsed.";return e}function vk(e,t){if(e.nid===void 0)throw Error("URN without nid cannot be serialized");let r=t.scheme||e.scheme||"urn",n=e.nid.toLowerCase(),s=`${r}:${t.nid||n}`,o=du(s);if(o)e=o.serialize(e,t);let i=e,a=e.nss;return i.path=`${n||t.nid}:${a}`,t.skipEscape=!0,i}function $k(e,t){let r=e;if(r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!fk(r.uuid)))r.error=r.error||"UUID is not valid.";return r}function Ek(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}var Qp={scheme:"http",domainHost:!0,parse:Xp,serialize:Jp},wk={scheme:"https",domainHost:Qp.domainHost,parse:Xp,serialize:Jp},gi={scheme:"ws",domainHost:!0,parse:gk,serialize:yk},bk={scheme:"wss",domainHost:gi.domainHost,parse:gi.parse,serialize:gi.serialize},Sk={scheme:"urn",parse:_k,serialize:vk,skipNormalize:!0},xk={scheme:"urn:uuid",parse:$k,serialize:Ek,skipNormalize:!0},yi={http:Qp,https:wk,ws:gi,wss:bk,urn:Sk,"urn:uuid":xk};Object.setPrototypeOf(yi,null);function du(e){return e&&(yi[e]||yi[e.toLowerCase()])||void 0}Zp.exports={wsIsSecure:lu,SCHEMES:yi,isValidSchemeName:mk,getSchemeHandler:du}});var pu=g(function(u4,vi){var{normalizeIPv6:Rk,removeDotSegments:no,recomposeAuthority:Tk,normalizeComponentEncoding:_i,isIPv4:kk,nonSimpleDomain:Ok}=uu(),{SCHEMES:Ak,getSchemeHandler:th}=eh();function Pk(e,t){if(typeof e==="string")e=Lt(gr(e,t),t);else if(typeof e==="object")e=gr(Lt(e,t),t);return e}function Nk(e,t,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},s=rh(gr(e,n),gr(t,n),n,!0);return n.skipEscape=!0,Lt(s,n)}function rh(e,t,r,n){let s={};if(!n)e=gr(Lt(e,r),r),t=gr(Lt(t,r),r);if(r=r||{},!r.tolerant&&t.scheme)s.scheme=t.scheme,s.userinfo=t.userinfo,s.host=t.host,s.port=t.port,s.path=no(t.path||""),s.query=t.query;else{if(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)s.userinfo=t.userinfo,s.host=t.host,s.port=t.port,s.path=no(t.path||""),s.query=t.query;else{if(!t.path)if(s.path=e.path,t.query!==void 0)s.query=t.query;else s.query=e.query;else{if(t.path[0]==="/")s.path=no(t.path);else{if((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path)s.path="/"+t.path;else if(!e.path)s.path=t.path;else s.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path;s.path=no(s.path)}s.query=t.query}s.userinfo=e.userinfo,s.host=e.host,s.port=e.port}s.scheme=e.scheme}return s.fragment=t.fragment,s}function Ik(e,t,r){if(typeof e==="string")e=unescape(e),e=Lt(_i(gr(e,r),!0),{...r,skipEscape:!0});else if(typeof e==="object")e=Lt(_i(e,!0),{...r,skipEscape:!0});if(typeof t==="string")t=unescape(t),t=Lt(_i(gr(t,r),!0),{...r,skipEscape:!0});else if(typeof t==="object")t=Lt(_i(t,!0),{...r,skipEscape:!0});return e.toLowerCase()===t.toLowerCase()}function Lt(e,t){let r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},n=Object.assign({},t),s=[],o=th(n.scheme||r.scheme);if(o&&o.serialize)o.serialize(r,n);if(r.path!==void 0)if(!n.skipEscape){if(r.path=escape(r.path),r.scheme!==void 0)r.path=r.path.split("%3A").join(":")}else r.path=unescape(r.path);if(n.reference!=="suffix"&&r.scheme)s.push(r.scheme,":");let i=Tk(r);if(i!==void 0){if(n.reference!=="suffix")s.push("//");if(s.push(i),r.path&&r.path[0]!=="/")s.push("/")}if(r.path!==void 0){let a=r.path;if(!n.absolutePath&&(!o||!o.absolutePath))a=no(a);if(i===void 0&&a[0]==="/"&&a[1]==="/")a="/%2F"+a.slice(2);s.push(a)}if(r.query!==void 0)s.push("?",r.query);if(r.fragment!==void 0)s.push("#",r.fragment);return s.join("")}var Ck=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function gr(e,t){let r=Object.assign({},t),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},s=!1;if(r.reference==="suffix")if(r.scheme)e=r.scheme+":"+e;else e="//"+e;let o=e.match(Ck);if(o){if(n.scheme=o[1],n.userinfo=o[3],n.host=o[4],n.port=parseInt(o[5],10),n.path=o[6]||"",n.query=o[7],n.fragment=o[8],isNaN(n.port))n.port=o[5];if(n.host)if(kk(n.host)===!1){let c=Rk(n.host);n.host=c.host.toLowerCase(),s=c.isIPV6}else s=!0;if(n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path)n.reference="same-document";else if(n.scheme===void 0)n.reference="relative";else if(n.fragment===void 0)n.reference="absolute";else n.reference="uri";if(r.reference&&r.reference!=="suffix"&&r.reference!==n.reference)n.error=n.error||"URI is not a "+r.reference+" reference.";let i=th(r.scheme||n.scheme);if(!r.unicodeSupport&&(!i||!i.unicodeSupport)){if(n.host&&(r.domainHost||i&&i.domainHost)&&s===!1&&Ok(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(a){n.error=n.error||"Host's domain name can not be converted to ASCII: "+a}}if(!i||i&&!i.skipNormalize){if(e.indexOf("%")!==-1){if(n.scheme!==void 0)n.scheme=unescape(n.scheme);if(n.host!==void 0)n.host=unescape(n.host)}if(n.path)n.path=escape(unescape(n.path));if(n.fragment)n.fragment=encodeURI(decodeURIComponent(n.fragment))}if(i&&i.parse)i.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return n}var fu={SCHEMES:Ak,normalize:Pk,resolve:Nk,resolveComponent:rh,equal:Ik,serialize:Lt,parse:gr};vi.exports=fu;vi.exports.default=fu;vi.exports.fastUri=fu});var oh=g(function(sh){Object.defineProperty(sh,"__esModule",{value:!0});var nh=pu();nh.code='require("ajv/dist/runtime/uri").default';sh.default=nh});var mh=g(function(yr){Object.defineProperty(yr,"__esModule",{value:!0});yr.CodeGen=yr.Name=yr.nil=yr.stringify=yr.str=yr._=yr.KeywordCxt=void 0;var qk=Zs();Object.defineProperty(yr,"KeywordCxt",{enumerable:!0,get:function(){return qk.KeywordCxt}});var Yn=Y();Object.defineProperty(yr,"_",{enumerable:!0,get:function(){return Yn._}});Object.defineProperty(yr,"str",{enumerable:!0,get:function(){return Yn.str}});Object.defineProperty(yr,"stringify",{enumerable:!0,get:function(){return Yn.stringify}});Object.defineProperty(yr,"nil",{enumerable:!0,get:function(){return Yn.nil}});Object.defineProperty(yr,"Name",{enumerable:!0,get:function(){return Yn.Name}});Object.defineProperty(yr,"CodeGen",{enumerable:!0,get:function(){return Yn.CodeGen}});var Dk=pi(),lh=eo(),dh=Yc(),Ut=ro(),fh=Y(),Ft=Qs(),Cr=Xs(),Wn=te(),ih=Kp(),Mk=oh(),ph=(e,t)=>new RegExp(e,t);ph.code="new RegExp";var Lk=["removeAdditional","useDefaults","coerceTypes"],Uk=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),Fk={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."},Vk={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},ah=200;function zk(e){var t,r,n,s,o,i,a,c,u,d,l,p,f,h,m,y,_,O,T,M,S,_e,ve,xt,hr;let et=e.strict,gn=(t=e.code)===null||t===void 0?void 0:t.optimize,Fs=gn===!0||gn===void 0?1:gn||0,Vs=(n=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:ph,yc=(s=e.uriResolver)!==null&&s!==void 0?s:Mk.default;return{strictSchema:(i=(o=e.strictSchema)!==null&&o!==void 0?o:et)!==null&&i!==void 0?i:!0,strictNumbers:(c=(a=e.strictNumbers)!==null&&a!==void 0?a:et)!==null&&c!==void 0?c:!0,strictTypes:(d=(u=e.strictTypes)!==null&&u!==void 0?u:et)!==null&&d!==void 0?d:"log",strictTuples:(p=(l=e.strictTuples)!==null&&l!==void 0?l:et)!==null&&p!==void 0?p:"log",strictRequired:(h=(f=e.strictRequired)!==null&&f!==void 0?f:et)!==null&&h!==void 0?h:!1,code:e.code?{...e.code,optimize:Fs,regExp:Vs}:{optimize:Fs,regExp:Vs},loopRequired:(m=e.loopRequired)!==null&&m!==void 0?m:ah,loopEnum:(y=e.loopEnum)!==null&&y!==void 0?y:ah,meta:(_=e.meta)!==null&&_!==void 0?_:!0,messages:(O=e.messages)!==null&&O!==void 0?O:!0,inlineRefs:(T=e.inlineRefs)!==null&&T!==void 0?T:!0,schemaId:(M=e.schemaId)!==null&&M!==void 0?M:"$id",addUsedSchema:(S=e.addUsedSchema)!==null&&S!==void 0?S:!0,validateSchema:(_e=e.validateSchema)!==null&&_e!==void 0?_e:!0,validateFormats:(ve=e.validateFormats)!==null&&ve!==void 0?ve:!0,unicodeRegExp:(xt=e.unicodeRegExp)!==null&&xt!==void 0?xt:!0,int32range:(hr=e.int32range)!==null&&hr!==void 0?hr:!0,uriResolver:yc}}class $i{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...zk(e)};let{es5:t,lines:r}=this.opts.code;this.scope=new fh.ValueScope({scope:{},prefixes:Uk,es5:t,lines:r}),this.logger=Yk(e.logger);let n=e.validateFormats;if(e.validateFormats=!1,this.RULES=dh.getRules(),ch.call(this,Fk,e,"NOT SUPPORTED"),ch.call(this,Vk,e,"DEPRECATED","warn"),this._metaOpts=Bk.call(this),e.formats)Kk.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords)Hk.call(this,e.keywords);if(typeof e.meta=="object")this.addMetaSchema(e.meta);Gk.call(this),e.validateFormats=n}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:r}=this.opts,n=ih;if(r==="id")n={...ih},n.id=n.$id,delete n.$id;if(t&&e)this.addMetaSchema(n,n[r],!1)}defaultMeta(){let{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[t]||e:void 0}validate(e,t){let r;if(typeof e=="string"){if(r=this.getSchema(e),!r)throw Error(`no schema with key or ref "${e}"`)}else r=this.compile(e);let n=r(t);if(!("$async"in r))this.errors=r.errors;return n}compile(e,t){let r=this._addSchema(e,t);return r.validate||this._compileSchemaEnv(r)}compileAsync(e,t){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:r}=this.opts;return n.call(this,e,t);async function n(u,d){await s.call(this,u.$schema);let l=this._addSchema(u,d);return l.validate||o.call(this,l)}async function s(u){if(u&&!this.getSchema(u))await n.call(this,{$ref:u},!0)}async function o(u){try{return this._compileSchemaEnv(u)}catch(d){if(!(d instanceof lh.default))throw d;return i.call(this,d),await a.call(this,d.missingSchema),o.call(this,u)}}function i({missingSchema:u,missingRef:d}){if(this.refs[u])throw Error(`AnySchema ${u} is loaded but ${d} cannot be resolved`)}async function a(u){let d=await c.call(this,u);if(!this.refs[u])await s.call(this,d.$schema);if(!this.refs[u])this.addSchema(d,u,t)}async function c(u){let d=this._loading[u];if(d)return d;try{return await(this._loading[u]=r(u))}finally{delete this._loading[u]}}}addSchema(e,t,r,n=this.opts.validateSchema){if(Array.isArray(e)){for(let o of e)this.addSchema(o,void 0,r,n);return this}let s;if(typeof e==="object"){let{schemaId:o}=this.opts;if(s=e[o],s!==void 0&&typeof s!="string")throw Error(`schema ${o} must be string`)}return t=Ft.normalizeId(t||s),this._checkUnique(t),this.schemas[t]=this._addSchema(e,r,t,n,!0),this}addMetaSchema(e,t,r=this.opts.validateSchema){return this.addSchema(e,t,!0,r),this}validateSchema(e,t){if(typeof e=="boolean")return!0;let r;if(r=e.$schema,r!==void 0&&typeof r!="string")throw Error("$schema must be a string");if(r=r||this.opts.defaultMeta||this.defaultMeta(),!r)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let n=this.validate(r,e);if(!n&&t){let s="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(s);else throw Error(s)}return n}getSchema(e){let t;while(typeof(t=uh.call(this,e))=="string")e=t;if(t===void 0){let{schemaId:r}=this.opts,n=new Ut.SchemaEnv({schema:{},schemaId:r});if(t=Ut.resolveSchema.call(this,n,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let t=uh.call(this,e);if(typeof t=="object")this._cache.delete(t.schema);return delete this.schemas[e],delete this.refs[e],this}case"object":{let t=e;this._cache.delete(t);let r=e[this.opts.schemaId];if(r)r=Ft.normalizeId(r),delete this.schemas[r],delete this.refs[r];return this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let t of e)this.addKeyword(t);return this}addKeyword(e,t){let r;if(typeof e=="string"){if(r=e,typeof t=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=r}else if(typeof e=="object"&&t===void 0){if(t=e,r=t.keyword,Array.isArray(r)&&!r.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(Jk.call(this,r,t),!t)return Wn.eachItem(r,(s)=>hu.call(this,s)),this;Zk.call(this,t);let n={...t,type:Cr.getJSONTypes(t.type),schemaType:Cr.getJSONTypes(t.schemaType)};return Wn.eachItem(r,n.type.length===0?(s)=>hu.call(this,s,n):(s)=>n.type.forEach((o)=>hu.call(this,s,n,o))),this}getKeyword(e){let t=this.RULES.all[e];return typeof t=="object"?t.definition:!!t}removeKeyword(e){let{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(let r of t.rules){let n=r.rules.findIndex((s)=>s.keyword===e);if(n>=0)r.rules.splice(n,1)}return this}addFormat(e,t){if(typeof t=="string")t=new RegExp(t);return this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:r="data"}={}){if(!e||e.length===0)return"No errors";return e.map((n)=>`${r}${n.instancePath} ${n.message}`).reduce((n,s)=>n+t+s)}$dataMetaSchema(e,t){let r=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let n of t){let s=n.split("/").slice(1),o=e;for(let i of s)o=o[i];for(let i in r){let a=r[i];if(typeof a!="object")continue;let{$data:c}=a.definition,u=o[i];if(c&&u)o[i]=hh(u)}}return e}_removeAllSchemas(e,t){for(let r in e){let n=e[r];if(!t||t.test(r)){if(typeof n=="string")delete e[r];else if(n&&!n.meta)this._cache.delete(n.schema),delete e[r]}}}_addSchema(e,t,r,n=this.opts.validateSchema,s=this.opts.addUsedSchema){let o,{schemaId:i}=this.opts;if(typeof e=="object")o=e[i];else if(this.opts.jtd)throw Error("schema must be object");else if(typeof e!="boolean")throw Error("schema must be object or boolean");let a=this._cache.get(e);if(a!==void 0)return a;r=Ft.normalizeId(o||r);let c=Ft.getSchemaRefs.call(this,e,r);if(a=new Ut.SchemaEnv({schema:e,schemaId:i,meta:t,baseId:r,localRefs:c}),this._cache.set(a.schema,a),s&&!r.startsWith("#")){if(r)this._checkUnique(r);this.refs[r]=a}if(n)this.validateSchema(e,!0);return a}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta)this._compileMetaSchema(e);else Ut.compileSchema.call(this,e);if(!e.validate)throw Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let t=this.opts;this.opts=this._metaOpts;try{Ut.compileSchema.call(this,e)}finally{this.opts=t}}}$i.ValidationError=Dk.default;$i.MissingRefError=lh.default;yr.default=$i;function ch(e,t,r,n="error"){for(let s in e){let o=s;if(o in t)this.logger[n](`${r}: option ${s}. ${e[o]}`)}}function uh(e){return e=Ft.normalizeId(e),this.schemas[e]||this.refs[e]}function Gk(){let e=this.opts.schemas;if(!e)return;if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}function Kk(){for(let e in this.opts.formats){let t=this.opts.formats[e];if(t)this.addFormat(e,t)}}function Hk(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let t in e){let r=e[t];if(!r.keyword)r.keyword=t;this.addKeyword(r)}}function Bk(){let e={...this.opts};for(let t of Lk)delete e[t];return e}var Wk={log(){},warn(){},error(){}};function Yk(e){if(e===!1)return Wk;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw Error("logger must implement log, warn and error methods")}var Xk=/^[a-z_$][a-z0-9_$:-]*$/i;function Jk(e,t){let{RULES:r}=this;if(Wn.eachItem(e,(n)=>{if(r.keywords[n])throw Error(`Keyword ${n} is already defined`);if(!Xk.test(n))throw Error(`Keyword ${n} has invalid name`)}),!t)return;if(t.$data&&!(("code"in t)||("validate"in t)))throw Error('$data keyword must have "code" or "validate" function')}function hu(e,t,r){var n;let s=t===null||t===void 0?void 0:t.post;if(r&&s)throw Error('keyword with "post" flag cannot have "type"');let{RULES:o}=this,i=s?o.post:o.rules.find(({type:c})=>c===r);if(!i)i={type:r,rules:[]},o.rules.push(i);if(o.keywords[e]=!0,!t)return;let a={keyword:e,definition:{...t,type:Cr.getJSONTypes(t.type),schemaType:Cr.getJSONTypes(t.schemaType)}};if(t.before)Qk.call(this,i,a,t.before);else i.rules.push(a);o.all[e]=a,(n=t.implements)===null||n===void 0||n.forEach((c)=>this.addKeyword(c))}function Qk(e,t,r){let n=e.rules.findIndex((s)=>s.keyword===r);if(n>=0)e.rules.splice(n,0,t);else e.rules.push(t),this.logger.warn(`rule ${r} is not defined`)}function Zk(e){let{metaSchema:t}=e;if(t===void 0)return;if(e.$data&&this.opts.$data)t=hh(t);e.validateSchema=this.compile(t,!0)}var eO={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function hh(e){return{anyOf:[e,eO]}}});var yh=g(function(gh){Object.defineProperty(gh,"__esModule",{value:!0});var nO={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};gh.default=nO});var Si=g(function(vh){Object.defineProperty(vh,"__esModule",{value:!0});vh.callRef=vh.getValidate=void 0;var oO=eo(),wi=mt(),he=Y(),Xn=pt(),bi=ro(),jr=te(),iO={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:r,it:n}=e,{baseId:s,schemaEnv:o,validateName:i,opts:a,self:c}=n,{root:u}=o;if((r==="#"||r==="#/")&&s===u.baseId)return l();let d=bi.resolveRef.call(c,u,s,r);if(d===void 0)throw new oO.default(n.opts.uriResolver,s,r);if(d instanceof bi.SchemaEnv)return p(d);return f(d);function l(){if(o===u)return Ei(e,i,o,o.$async);let h=t.scopeValue("root",{ref:u});return Ei(e,he._`${h}.validate`,u,u.$async)}function p(h){let m=_h(e,h);Ei(e,m,h,h.$async)}function f(h){let m=t.scopeValue("schema",a.code.source===!0?{ref:h,code:he.stringify(h)}:{ref:h}),y=t.name("valid"),_=e.subschema({schema:h,dataTypes:[],schemaPath:he.nil,topSchemaRef:m,errSchemaPath:r},y);e.mergeEvaluated(_),e.ok(y)}}};function _h(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):he._`${r.scopeValue("wrapper",{ref:t})}.validate`}vh.getValidate=_h;function Ei(e,t,r,n){let{gen:s,it:o}=e,{allErrors:i,schemaEnv:a,opts:c}=o,u=c.passContext?Xn.default.this:he.nil;if(n)d();else l();function d(){if(!a.$async)throw Error("async schema referenced by sync schema");let h=s.let("valid");s.try(()=>{if(s.code(he._`await ${wi.callValidateCode(e,t,u)}`),f(t),!i)s.assign(h,!0)},(m)=>{if(s.if(he._`!(${m} instanceof ${o.ValidationError})`,()=>s.throw(m)),p(m),!i)s.assign(h,!1)}),e.ok(h)}function l(){e.result(wi.callValidateCode(e,t,u),()=>f(t),()=>p(t))}function p(h){let m=he._`${h}.errors`;s.assign(Xn.default.vErrors,he._`${Xn.default.vErrors} === null ? ${m} : ${Xn.default.vErrors}.concat(${m})`),s.assign(Xn.default.errors,he._`${Xn.default.vErrors}.length`)}function f(h){var m;if(!o.opts.unevaluated)return;let y=(m=r===null||r===void 0?void 0:r.validate)===null||m===void 0?void 0:m.evaluated;if(o.props!==!0)if(y&&!y.dynamicProps){if(y.props!==void 0)o.props=jr.mergeEvaluated.props(s,y.props,o.props)}else{let _=s.var("props",he._`${h}.evaluated.props`);o.props=jr.mergeEvaluated.props(s,_,o.props,he.Name)}if(o.items!==!0)if(y&&!y.dynamicItems){if(y.items!==void 0)o.items=jr.mergeEvaluated.items(s,y.items,o.items)}else{let _=s.var("items",he._`${h}.evaluated.items`);o.items=jr.mergeEvaluated.items(s,_,o.items,he.Name)}}}vh.callRef=Ei;vh.default=iO});var wh=g(function(Eh){Object.defineProperty(Eh,"__esModule",{value:!0});var uO=yh(),lO=Si(),dO=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",uO.default,lO.default];Eh.default=dO});var Sh=g(function(bh){Object.defineProperty(bh,"__esModule",{value:!0});var Dr=Y(),qr=Dr.operators,xi={maximum:{okStr:"<=",ok:qr.LTE,fail:qr.GT},minimum:{okStr:">=",ok:qr.GTE,fail:qr.LT},exclusiveMaximum:{okStr:"<",ok:qr.LT,fail:qr.GTE},exclusiveMinimum:{okStr:">",ok:qr.GT,fail:qr.LTE}},pO={message:({keyword:e,schemaCode:t})=>Dr.str`must be ${xi[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>Dr._`{comparison: ${xi[e].okStr}, limit: ${t}}`},hO={keyword:Object.keys(xi),type:"number",schemaType:"number",$data:!0,error:pO,code(e){let{keyword:t,data:r,schemaCode:n}=e;e.fail$data(Dr._`${r} ${xi[t].fail} ${n} || isNaN(${r})`)}};bh.default=hO});var Rh=g(function(xh){Object.defineProperty(xh,"__esModule",{value:!0});var Vt=Y(),gO={message:({schemaCode:e})=>Vt.str`must be multiple of ${e}`,params:({schemaCode:e})=>Vt._`{multipleOf: ${e}}`},yO={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:gO,code(e){let{gen:t,data:r,schemaCode:n,it:s}=e,o=s.opts.multipleOfPrecision,i=t.let("res"),a=o?Vt._`Math.abs(Math.round(${i}) - ${i}) > 1e-${o}`:Vt._`${i} !== parseInt(${i})`;e.fail$data(Vt._`(${n} === 0 || (${i} = ${r}/${n}, ${a}))`)}};xh.default=yO});var Oh=g(function(kh){Object.defineProperty(kh,"__esModule",{value:!0});function Th(e){let t=e.length,r=0,n=0,s;while(n<t)if(r++,s=e.charCodeAt(n++),s>=55296&&s<=56319&&n<t){if(s=e.charCodeAt(n),(s&64512)===56320)n++}return r}kh.default=Th;Th.code='require("ajv/dist/runtime/ucs2length").default'});var Nh=g(function(Ph){Object.defineProperty(Ph,"__esModule",{value:!0});var nt=Y(),Ah=te(),$O=Oh(),EO={message({keyword:e,schemaCode:t}){return nt.str`must NOT have ${e==="maxLength"?"more":"fewer"} than ${t} characters`},params:({schemaCode:e})=>nt._`{limit: ${e}}`},wO={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:EO,code(e){let{keyword:t,data:r,schemaCode:n,it:s}=e,o=t==="maxLength"?nt.operators.GT:nt.operators.LT,i=s.opts.unicode===!1?nt._`${r}.length`:nt._`${Ah.useFunc(e.gen,$O.default)}(${r})`;e.fail$data(nt._`${i} ${o} ${n}`)}};Ph.default=wO});var jh=g(function(Ch){Object.defineProperty(Ch,"__esModule",{value:!0});var Ih=mt(),Mr=Y(),SO={message:({schemaCode:e})=>Mr.str`must match pattern "${e}"`,params:({schemaCode:e})=>Mr._`{pattern: ${e}}`},xO={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:SO,code(e){let{data:t,$data:r,schema:n,schemaCode:s,it:o}=e,i=o.opts.unicodeRegExp?"u":"",a=r?Mr._`(new RegExp(${s}, ${i}))`:Ih.usePattern(e,n);e.fail$data(Mr._`!${a}.test(${t})`)}};Ch.default=xO});var Dh=g(function(qh){Object.defineProperty(qh,"__esModule",{value:!0});var zt=Y(),TO={message({keyword:e,schemaCode:t}){return zt.str`must NOT have ${e==="maxProperties"?"more":"fewer"} than ${t} properties`},params:({schemaCode:e})=>zt._`{limit: ${e}}`},kO={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:TO,code(e){let{keyword:t,data:r,schemaCode:n}=e,s=t==="maxProperties"?zt.operators.GT:zt.operators.LT;e.fail$data(zt._`Object.keys(${r}).length ${s} ${n}`)}};qh.default=kO});var Uh=g(function(Lh){Object.defineProperty(Lh,"__esModule",{value:!0});var Gt=mt(),Kt=Y(),Mh=te(),AO={message:({params:{missingProperty:e}})=>Kt.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>Kt._`{missingProperty: ${e}}`},PO={keyword:"required",type:"object",schemaType:"array",$data:!0,error:AO,code(e){let{gen:t,schema:r,schemaCode:n,data:s,$data:o,it:i}=e,{opts:a}=i;if(!o&&r.length===0)return;let c=r.length>=a.loopRequired;if(i.allErrors)u();else d();if(a.strictRequired){let f=e.parentSchema.properties,{definedProperties:h}=e.it;for(let m of r)if((f===null||f===void 0?void 0:f[m])===void 0&&!h.has(m)){let y=i.schemaEnv.baseId+i.errSchemaPath,_=`required property "${m}" is not defined at "${y}" (strictRequired)`;Mh.checkStrictMode(i,_,i.opts.strictRequired)}}function u(){if(c||o)e.block$data(Kt.nil,l);else for(let f of r)Gt.checkReportMissingProp(e,f)}function d(){let f=t.let("missing");if(c||o){let h=t.let("valid",!0);e.block$data(h,()=>p(f,h)),e.ok(h)}else t.if(Gt.checkMissingProp(e,r,f)),Gt.reportMissingProp(e,f),t.else()}function l(){t.forOf("prop",n,(f)=>{e.setParams({missingProperty:f}),t.if(Gt.noPropertyInData(t,s,f,a.ownProperties),()=>e.error())})}function p(f,h){e.setParams({missingProperty:f}),t.forOf(f,n,()=>{t.assign(h,Gt.propertyInData(t,s,f,a.ownProperties)),t.if(Kt.not(h),()=>{e.error(),t.break()})},Kt.nil)}}};Lh.default=PO});var Vh=g(function(Fh){Object.defineProperty(Fh,"__esModule",{value:!0});var Ht=Y(),IO={message({keyword:e,schemaCode:t}){return Ht.str`must NOT have ${e==="maxItems"?"more":"fewer"} than ${t} items`},params:({schemaCode:e})=>Ht._`{limit: ${e}}`},CO={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:IO,code(e){let{keyword:t,data:r,schemaCode:n}=e,s=t==="maxItems"?Ht.operators.GT:Ht.operators.LT;e.fail$data(Ht._`${r}.length ${s} ${n}`)}};Fh.default=CO});var Ri=g(function(Gh){Object.defineProperty(Gh,"__esModule",{value:!0});var zh=Js();zh.code='require("ajv/dist/runtime/equal").default';Gh.default=zh});var Bh=g(function(Hh){Object.defineProperty(Hh,"__esModule",{value:!0});var Jn=Xs(),se=Y(),Kh=te(),DO=Ri(),MO={message:({params:{i:e,j:t}})=>se.str`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>se._`{i: ${e}, j: ${t}}`},LO={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:MO,code(e){let{gen:t,data:r,$data:n,schema:s,parentSchema:o,schemaCode:i,it:a}=e;if(!n&&!s)return;let c=t.let("valid"),u=o.items?Jn.getSchemaTypes(o.items):[];e.block$data(c,d,se._`${i} === false`),e.ok(c);function d(){let h=t.let("i",se._`${r}.length`),m=t.let("j");e.setParams({i:h,j:m}),t.assign(c,!0),t.if(se._`${h} > 1`,()=>(l()?p:f)(h,m))}function l(){return u.length>0&&!u.some((h)=>h==="object"||h==="array")}function p(h,m){let y=t.name("item"),_=Jn.checkDataTypes(u,y,a.opts.strictNumbers,Jn.DataType.Wrong),O=t.const("indices",se._`{}`);t.for(se._`;${h}--;`,()=>{if(t.let(y,se._`${r}[${h}]`),t.if(_,se._`continue`),u.length>1)t.if(se._`typeof ${y} == "string"`,se._`${y} += "_"`);t.if(se._`typeof ${O}[${y}] == "number"`,()=>{t.assign(m,se._`${O}[${y}]`),e.error(),t.assign(c,!1).break()}).code(se._`${O}[${y}] = ${h}`)})}function f(h,m){let y=Kh.useFunc(t,DO.default),_=t.name("outer");t.label(_).for(se._`;${h}--;`,()=>t.for(se._`${m} = ${h}; ${m}--;`,()=>t.if(se._`${y}(${r}[${h}], ${r}[${m}])`,()=>{e.error(),t.assign(c,!1).break(_)})))}}};Hh.default=LO});var Xh=g(function(Yh){Object.defineProperty(Yh,"__esModule",{value:!0});var Qn=Y(),Wh=te(),FO=Ri(),VO={message:"must be equal to constant",params:({schemaCode:e})=>Qn._`{allowedValue: ${e}}`},zO={keyword:"const",$data:!0,error:VO,code(e){let{gen:t,data:r,$data:n,schemaCode:s,schema:o}=e;if(n||o&&typeof o=="object")e.fail$data(Qn._`!${Wh.useFunc(t,FO.default)}(${r}, ${s})`);else e.fail(Qn._`${o} !== ${r}`)}};Yh.default=zO});var Zh=g(function(Qh){Object.defineProperty(Qh,"__esModule",{value:!0});var Bt=Y(),Jh=te(),KO=Ri(),HO={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>Bt._`{allowedValues: ${e}}`},BO={keyword:"enum",schemaType:"array",$data:!0,error:HO,code(e){let{gen:t,data:r,$data:n,schema:s,schemaCode:o,it:i}=e;if(!n&&s.length===0)throw Error("enum must have non-empty array");let a=s.length>=i.opts.loopEnum,c,u=()=>c!==null&&c!==void 0?c:c=Jh.useFunc(t,KO.default),d;if(a||n)d=t.let("valid"),e.block$data(d,l);else{if(!Array.isArray(s))throw Error("ajv implementation error");let f=t.const("vSchema",o);d=Bt.or(...s.map((h,m)=>p(f,m)))}e.pass(d);function l(){t.assign(d,!1),t.forOf("v",o,(f)=>t.if(Bt._`${u()}(${r}, ${f})`,()=>t.assign(d,!0).break()))}function p(f,h){let m=s[h];return typeof m==="object"&&m!==null?Bt._`${u()}(${r}, ${f}[${h}])`:Bt._`${r} === ${m}`}}};Qh.default=BO});var tm=g(function(em){Object.defineProperty(em,"__esModule",{value:!0});var YO=Sh(),XO=Rh(),JO=Nh(),QO=jh(),ZO=Dh(),eA=Uh(),tA=Vh(),rA=Bh(),nA=Xh(),sA=Zh(),oA=[YO.default,XO.default,JO.default,QO.default,ZO.default,eA.default,tA.default,rA.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},nA.default,sA.default];em.default=oA});var mu=g(function(nm){Object.defineProperty(nm,"__esModule",{value:!0});nm.validateAdditionalItems=void 0;var st=Y(),Zn=te(),aA={message:({params:{len:e}})=>st.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>st._`{limit: ${e}}`},cA={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:aA,code(e){let{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){Zn.checkStrictMode(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}rm(e,n)}};function rm(e,t){let{gen:r,schema:n,data:s,keyword:o,it:i}=e;i.items=!0;let a=r.const("len",st._`${s}.length`);if(n===!1)e.setParams({len:t.length}),e.pass(st._`${a} <= ${t.length}`);else if(typeof n=="object"&&!Zn.alwaysValidSchema(i,n)){let u=r.var("valid",st._`${a} <= ${t.length}`);r.if(st.not(u),()=>c(u)),e.ok(u)}function c(u){r.forRange("i",t.length,a,(d)=>{if(e.subschema({keyword:o,dataProp:d,dataPropType:Zn.Type.Num},u),!i.allErrors)r.if(st.not(u),()=>r.break())})}}nm.validateAdditionalItems=rm;nm.default=cA});var gu=g(function(am){Object.defineProperty(am,"__esModule",{value:!0});am.validateTuple=void 0;var Ti=Y(),Lr=te(),om=mt(),lA={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return im(e,"additionalItems",t);if(r.items=!0,Lr.alwaysValidSchema(r,t))return;e.ok(om.validateArray(e))}};function im(e,t,r=e.schema){let{gen:n,parentSchema:s,data:o,keyword:i,it:a}=e;if(d(s),a.opts.unevaluated&&r.length&&a.items!==!0)a.items=Lr.mergeEvaluated.items(n,r.length,a.items);let c=n.name("valid"),u=n.const("len",Ti._`${o}.length`);r.forEach((l,p)=>{if(Lr.alwaysValidSchema(a,l))return;n.if(Ti._`${u} > ${p}`,()=>e.subschema({keyword:i,schemaProp:p,dataProp:p},c)),e.ok(c)});function d(l){let{opts:p,errSchemaPath:f}=a,h=r.length,m=h===l.minItems&&(h===l.maxItems||l[t]===!1);if(p.strictTuples&&!m){let y=`"${i}" is ${h}-tuple, but minItems or maxItems/${t} are not specified or different at path "${f}"`;Lr.checkStrictMode(a,y,p.strictTuples)}}}am.validateTuple=im;am.default=lA});var dm=g(function(lm){Object.defineProperty(lm,"__esModule",{value:!0});var um=gu(),fA={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(e)=>um.validateTuple(e,"items")};lm.default=fA});var gm=g(function(mm){Object.defineProperty(mm,"__esModule",{value:!0});var ki=Y(),fm=te(),pm=mt(),hm=mu(),hA={message:({params:{len:e}})=>ki.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>ki._`{limit: ${e}}`},mA={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:hA,code(e){let{schema:t,parentSchema:r,it:n}=e,{prefixItems:s}=r;if(n.items=!0,fm.alwaysValidSchema(n,t))return;if(s)hm.validateAdditionalItems(e,s);else e.ok(pm.validateArray(e))}};mm.default=mA});var _m=g(function(ym){Object.defineProperty(ym,"__esModule",{value:!0});var $e=Y(),Ur=te(),yA={message:({params:{min:e,max:t}})=>t===void 0?$e.str`must contain at least ${e} valid item(s)`:$e.str`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?$e._`{minContains: ${e}}`:$e._`{minContains: ${e}, maxContains: ${t}}`},_A={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:yA,code(e){let{gen:t,schema:r,parentSchema:n,data:s,it:o}=e,i,a,{minContains:c,maxContains:u}=n;if(o.opts.next)i=c===void 0?1:c,a=u;else i=1;let d=t.const("len",$e._`${s}.length`);if(e.setParams({min:i,max:a}),a===void 0&&i===0){Ur.checkStrictMode(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&i>a){Ur.checkStrictMode(o,'"minContains" > "maxContains" is always invalid'),e.fail();return}if(Ur.alwaysValidSchema(o,r)){let m=$e._`${d} >= ${i}`;if(a!==void 0)m=$e._`${m} && ${d} <= ${a}`;e.pass(m);return}o.items=!0;let l=t.name("valid");if(a===void 0&&i===1)f(l,()=>t.if(l,()=>t.break()));else if(i===0){if(t.let(l,!0),a!==void 0)t.if($e._`${s}.length > 0`,p)}else t.let(l,!1),p();e.result(l,()=>e.reset());function p(){let m=t.name("_valid"),y=t.let("count",0);f(m,()=>t.if(m,()=>h(y)))}function f(m,y){t.forRange("i",0,d,(_)=>{e.subschema({keyword:"contains",dataProp:_,dataPropType:Ur.Type.Num,compositeRule:!0},m),y()})}function h(m){if(t.code($e._`${m}++`),a===void 0)t.if($e._`${m} >= ${i}`,()=>t.assign(l,!0).break());else if(t.if($e._`${m} > ${a}`,()=>t.assign(l,!1).break()),i===1)t.assign(l,!0);else t.if($e._`${m} >= ${i}`,()=>t.assign(l,!0))}}};ym.default=_A});var Oi=g(function(wm){Object.defineProperty(wm,"__esModule",{value:!0});wm.validateSchemaDeps=wm.validatePropertyDeps=wm.error=void 0;var es=Y(),vm=te(),Wt=mt();wm.error={message:({params:{property:e,depsCount:t,deps:r}})=>es.str`must have ${t===1?"property":"properties"} ${r} when property ${e} is present`,params:({params:{property:e,depsCount:t,deps:r,missingProperty:n}})=>es._`{property: ${e},
7
+ || ${i} === "boolean" || ${s} === null`).assign(a,x._`[${s}]`)}}}function mR({gen:e,parentData:t,parentDataProperty:r},n){e.if(x._`${t} !== undefined`,()=>e.assign(x._`${t}[${r}]`,n))}function Jc(e,t,r,n=Vn.Correct){let s=n===Vn.Correct?x.operators.EQ:x.operators.NEQ,o;switch(e){case"null":return x._`${t} ${s} null`;case"array":o=x._`Array.isArray(${t})`;break;case"object":o=x._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":o=i(x._`!(${t} % 1) && !isNaN(${t})`);break;case"number":o=i();break;default:return x._`typeof ${t} ${s} ${e}`}return n===Vn.Correct?o:x.not(o);function i(a=x.nil){return x.and(x._`typeof ${t} == "number"`,a,r?x._`isFinite(${t})`:x.nil)}}Kf.checkDataType=Jc;function Qc(e,t,r,n){if(e.length===1)return Jc(e[0],t,r,n);let s,o=ci.toHash(e);if(o.array&&o.object){let i=x._`typeof ${t} != "object"`;s=o.null?i:x._`!${t} || ${i}`,delete o.null,delete o.array,delete o.object}else s=x.nil;if(o.number)delete o.integer;for(let i in o)s=x.and(s,Jc(i,t,r,n));return s}Kf.checkDataTypes=Qc;var gR={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?x._`{type: ${e}}`:x._`{type: ${t}}`};function Zc(e){let t=yR(e);Vf.reportError(t,gR)}Kf.reportTypeError=Zc;function yR(e){let{gen:t,data:r,schema:n}=e,s=ci.schemaRefOrVal(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:s,schemaValue:s,parentSchema:n,params:{},it:e}}});var Jf=g(function(Yf){Object.defineProperty(Yf,"__esModule",{value:!0});Yf.assignDefaults=void 0;var ht=Y(),Wf=te();function SR(e,t){let{properties:r,items:n}=e.schema;if(t==="object"&&r)for(let s in r)Bf(e,s,r[s].default);else if(t==="array"&&Array.isArray(n))n.forEach((s,o)=>Bf(e,o,s.default))}Yf.assignDefaults=SR;function Bf(e,t,r){let{gen:n,compositeRule:s,data:o,opts:i}=e;if(r===void 0)return;let a=ht._`${o}${ht.getProperty(t)}`;if(s){Wf.checkStrictMode(e,`default is ignored for: ${a}`);return}let c=ht._`${a} === undefined`;if(i.useDefaults==="empty")c=ht._`${c} || ${a} === null || ${a} === ""`;n.if(c,ht._`${a} = ${ht.stringify(r)}`)}});var mt=g(function(tp){Object.defineProperty(tp,"__esModule",{value:!0});tp.validateUnion=tp.validateArray=tp.usePattern=tp.callValidateCode=tp.schemaProperties=tp.allSchemaProperties=tp.noPropertyInData=tp.propertyInData=tp.isOwnProperty=tp.hasPropFunc=tp.reportMissingProp=tp.checkMissingProp=tp.checkReportMissingProp=void 0;var V=Y(),zn=te(),Pr=pt(),Qf=te();function xR(e,t){let{gen:r,data:n,it:s}=e;r.if(tu(r,n,t,s.opts.ownProperties),()=>{e.setParams({missingProperty:V._`${t}`},!0),e.error()})}tp.checkReportMissingProp=xR;function RR({gen:e,data:t,it:{opts:r}},n,s){return V.or(...n.map((o)=>V.and(tu(e,t,o,r.ownProperties),V._`${s} = ${o}`)))}tp.checkMissingProp=RR;function TR(e,t){e.setParams({missingProperty:t},!0),e.error()}tp.reportMissingProp=TR;function Zf(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:V._`Object.prototype.hasOwnProperty`})}tp.hasPropFunc=Zf;function eu(e,t,r){return V._`${Zf(e)}.call(${t}, ${r})`}tp.isOwnProperty=eu;function kR(e,t,r,n){let s=V._`${t}${V.getProperty(r)} !== undefined`;return n?V._`${s} && ${eu(e,t,r)}`:s}tp.propertyInData=kR;function tu(e,t,r,n){let s=V._`${t}${V.getProperty(r)} === undefined`;return n?V.or(s,V.not(eu(e,t,r))):s}tp.noPropertyInData=tu;function ep(e){return e?Object.keys(e).filter((t)=>t!=="__proto__"):[]}tp.allSchemaProperties=ep;function OR(e,t){return ep(t).filter((r)=>!zn.alwaysValidSchema(e,t[r]))}tp.schemaProperties=OR;function AR({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:s,errorPath:o},it:i},a,c,u){let d=u?V._`${e}, ${t}, ${n}${s}`:t,l=[[Pr.default.instancePath,V.strConcat(Pr.default.instancePath,o)],[Pr.default.parentData,i.parentData],[Pr.default.parentDataProperty,i.parentDataProperty],[Pr.default.rootData,Pr.default.rootData]];if(i.opts.dynamicRef)l.push([Pr.default.dynamicAnchors,Pr.default.dynamicAnchors]);let p=V._`${d}, ${r.object(...l)}`;return c!==V.nil?V._`${a}.call(${c}, ${p})`:V._`${a}(${p})`}tp.callValidateCode=AR;var PR=V._`new RegExp`;function NR({gen:e,it:{opts:t}},r){let n=t.unicodeRegExp?"u":"",{regExp:s}=t.code,o=s(r,n);return e.scopeValue("pattern",{key:o.toString(),ref:o,code:V._`${s.code==="new RegExp"?PR:Qf.useFunc(e,s)}(${r}, ${n})`})}tp.usePattern=NR;function IR(e){let{gen:t,data:r,keyword:n,it:s}=e,o=t.name("valid");if(s.allErrors){let a=t.let("valid",!0);return i(()=>t.assign(a,!1)),a}return t.var(o,!0),i(()=>t.break()),o;function i(a){let c=t.const("len",V._`${r}.length`);t.forRange("i",0,c,(u)=>{e.subschema({keyword:n,dataProp:u,dataPropType:zn.Type.Num},o),t.if(V.not(o),a)})}}tp.validateArray=IR;function CR(e){let{gen:t,schema:r,keyword:n,it:s}=e;if(!Array.isArray(r))throw Error("ajv implementation error");if(r.some((c)=>zn.alwaysValidSchema(s,c))&&!s.opts.unevaluated)return;let i=t.let("valid",!1),a=t.name("_valid");t.block(()=>r.forEach((c,u)=>{let d=e.subschema({keyword:n,schemaProp:u,compositeRule:!0},a);if(t.assign(i,V._`${i} || ${a}`),!e.mergeValidEvaluated(d,a))t.if(V.not(i))})),e.result(i,()=>e.reset(),()=>e.error(!0))}tp.validateUnion=CR});var up=g(function(ap){Object.defineProperty(ap,"__esModule",{value:!0});ap.validateKeywordUsage=ap.validSchemaType=ap.funcKeywordCode=ap.macroKeywordCode=void 0;var le=Y(),En=pt(),sp=mt(),op=Ys();function BR(e,t){let{gen:r,keyword:n,schema:s,parentSchema:o,it:i}=e,a=t.macro.call(i.self,s,o,i),c=ip(r,n,a);if(i.opts.validateSchema!==!1)i.self.validateSchema(a,!0);let u=r.name("valid");e.subschema({schema:a,schemaPath:le.nil,errSchemaPath:`${i.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},u),e.pass(u,()=>e.error(!0))}ap.macroKeywordCode=BR;function WR(e,t){var r;let{gen:n,keyword:s,schema:o,parentSchema:i,$data:a,it:c}=e;XR(c,t);let u=!a&&t.compile?t.compile.call(c.self,o,i,c):t.validate,d=ip(n,s,u),l=n.let("valid");e.block$data(l,p),e.ok((r=t.valid)!==null&&r!==void 0?r:l);function p(){if(t.errors===!1){if(m(),t.modifying)np(e);y(()=>e.error())}else{let _=t.async?f():h();if(t.modifying)np(e);y(()=>YR(e,_))}}function f(){let _=n.let("ruleErrs",null);return n.try(()=>m(le._`await `),(O)=>n.assign(l,!1).if(le._`${O} instanceof ${c.ValidationError}`,()=>n.assign(_,le._`${O}.errors`),()=>n.throw(O))),_}function h(){let _=le._`${d}.errors`;return n.assign(_,null),m(le.nil),_}function m(_=t.async?le._`await `:le.nil){let O=c.opts.passContext?En.default.this:En.default.self,T=!(("compile"in t)&&!a||t.schema===!1);n.assign(l,le._`${_}${sp.callValidateCode(e,d,O,T)}`,t.modifying)}function y(_){var O;n.if(le.not((O=t.valid)!==null&&O!==void 0?O:l),_)}}ap.funcKeywordCode=WR;function np(e){let{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,le._`${n.parentData}[${n.parentDataProperty}]`))}function YR(e,t){let{gen:r}=e;r.if(le._`Array.isArray(${t})`,()=>{r.assign(En.default.vErrors,le._`${En.default.vErrors} === null ? ${t} : ${En.default.vErrors}.concat(${t})`).assign(En.default.errors,le._`${En.default.vErrors}.length`),op.extendErrors(e)},()=>e.error())}function XR({schemaEnv:e},t){if(t.async&&!e.$async)throw Error("async keyword in sync schema")}function ip(e,t,r){if(r===void 0)throw Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:le.stringify(r)})}function JR(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>"u")}ap.validSchemaType=JR;function QR({schema:e,opts:t,self:r,errSchemaPath:n},s,o){if(Array.isArray(s.keyword)?!s.keyword.includes(o):s.keyword!==o)throw Error("ajv implementation error");let i=s.dependencies;if(i===null||i===void 0?void 0:i.some((a)=>!Object.prototype.hasOwnProperty.call(e,a)))throw Error(`parent schema must have dependencies of ${o}: ${i.join(",")}`);if(s.validateSchema){if(!s.validateSchema(e[o])){let c=`keyword "${o}" value is invalid at path "${n}": `+r.errorsText(s.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(c);else throw Error(c)}}}ap.validateKeywordUsage=QR});var fp=g(function(lp){Object.defineProperty(lp,"__esModule",{value:!0});lp.extendSubschemaMode=lp.extendSubschemaData=lp.getSubschema=void 0;var je=Y(),ui=te();function rT(e,{keyword:t,schemaProp:r,schema:n,schemaPath:s,errSchemaPath:o,topSchemaRef:i}){if(t!==void 0&&n!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){let a=e.schema[t];return r===void 0?{schema:a,schemaPath:je._`${e.schemaPath}${je.getProperty(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:a[r],schemaPath:je._`${e.schemaPath}${je.getProperty(t)}${je.getProperty(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${ui.escapeFragment(r)}`}}if(n!==void 0){if(s===void 0||o===void 0||i===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:s,topSchemaRef:i,errSchemaPath:o}}throw Error('either "keyword" or "schema" must be passed')}lp.getSubschema=rT;function nT(e,t,{dataProp:r,dataPropType:n,data:s,dataTypes:o,propertyName:i}){if(s!==void 0&&r!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=t;if(r!==void 0){let{errorPath:u,dataPathArr:d,opts:l}=t,p=a.let("data",je._`${t.data}${je.getProperty(r)}`,!0);c(p),e.errorPath=je.str`${u}${ui.getErrorPath(r,n,l.jsPropertySyntax)}`,e.parentDataProperty=je._`${r}`,e.dataPathArr=[...d,e.parentDataProperty]}if(s!==void 0){let u=s instanceof je.Name?s:a.let("data",s,!0);if(c(u),i!==void 0)e.propertyName=i}if(o)e.dataTypes=o;function c(u){e.data=u,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,u]}}lp.extendSubschemaData=nT;function sT(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:s,allErrors:o}){if(n!==void 0)e.compositeRule=n;if(s!==void 0)e.createErrors=s;if(o!==void 0)e.allErrors=o;e.jtdDiscriminator=t,e.jtdMetadata=r}lp.extendSubschemaMode=sT});var Js=g(function(Zz,pp){pp.exports=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,o;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(o=Object.keys(t),n=o.length,n!==Object.keys(r).length)return!1;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[s]))return!1;for(s=n;s--!==0;){var i=o[s];if(!e(t[i],r[i]))return!1}return!0}return t!==t&&r!==r}});var ru=g(function(e4,hp){var Nr=hp.exports=function(e,t,r){if(typeof t=="function")r=t,t={};r=t.cb||r;var n=typeof r=="function"?r:r.pre||function(){},s=r.post||function(){};li(t,n,s,e,"",e)};Nr.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Nr.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Nr.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Nr.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 li(e,t,r,n,s,o,i,a,c,u){if(n&&typeof n=="object"&&!Array.isArray(n)){t(n,s,o,i,a,c,u);for(var d in n){var l=n[d];if(Array.isArray(l)){if(d in Nr.arrayKeywords)for(var p=0;p<l.length;p++)li(e,t,r,l[p],s+"/"+d+"/"+p,o,s,d,n,p)}else if(d in Nr.propsKeywords){if(l&&typeof l=="object")for(var f in l)li(e,t,r,l[f],s+"/"+d+"/"+aT(f),o,s,d,n,f)}else if(d in Nr.keywords||e.allKeys&&!(d in Nr.skipKeywords))li(e,t,r,l,s+"/"+d,o,s,d,n)}r(n,s,o,i,a,c,u)}}function aT(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}});var Qs=g(function(vp){Object.defineProperty(vp,"__esModule",{value:!0});vp.getSchemaRefs=vp.resolveUrl=vp.normalizeId=vp._getFullPath=vp.getFullPath=vp.inlineRef=void 0;var mp=te(),cT=Js(),uT=ru(),lT=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function dT(e,t=!0){if(typeof e=="boolean")return!0;if(t===!0)return!nu(e);if(!t)return!1;return gp(e)<=t}vp.inlineRef=dT;var fT=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function nu(e){for(let t in e){if(fT.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(nu))return!0;if(typeof r=="object"&&nu(r))return!0}return!1}function gp(e){let t=0;for(let r in e){if(r==="$ref")return 1/0;if(t++,lT.has(r))continue;if(typeof e[r]=="object")mp.eachItem(e[r],(n)=>t+=gp(n));if(t===1/0)return 1/0}return t}function yp(e,t="",r){if(r!==!1)t=Gn(t);let n=e.parse(t);return _p(e,n)}vp.getFullPath=yp;function _p(e,t){return e.serialize(t).split("#")[0]+"#"}vp._getFullPath=_p;var pT=/#\/?$/;function Gn(e){return e?e.replace(pT,""):""}vp.normalizeId=Gn;function hT(e,t,r){return r=Gn(r),e.resolve(t,r)}vp.resolveUrl=hT;var mT=/^[a-z_][-a-z0-9._]*$/i;function gT(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,s=Gn(e[r]||t),o={"":s},i=yp(n,s,!1),a={},c=new Set;return uT(e,{allKeys:!0},(l,p,f,h)=>{if(h===void 0)return;let m=i+p,y=o[h];if(typeof l[r]=="string")y=_.call(this,l[r]);O.call(this,l.$anchor),O.call(this,l.$dynamicAnchor),o[p]=y;function _(T){let M=this.opts.uriResolver.resolve;if(T=Gn(y?M(y,T):T),c.has(T))throw d(T);c.add(T);let S=this.refs[T];if(typeof S=="string")S=this.refs[S];if(typeof S=="object")u(l,S.schema,T);else if(T!==Gn(m))if(T[0]==="#")u(l,a[T],T),a[T]=l;else this.refs[T]=m;return T}function O(T){if(typeof T=="string"){if(!mT.test(T))throw Error(`invalid anchor "${T}"`);_.call(this,`#${T}`)}}}),a;function u(l,p,f){if(p!==void 0&&!cT(l,p))throw d(f)}function d(l){return Error(`reference "${l}" resolves to more than one schema`)}}vp.getSchemaRefs=gT});var Zs=g(function(jp){Object.defineProperty(jp,"__esModule",{value:!0});jp.getData=jp.KeywordCxt=jp.validateFunctionCode=void 0;var fi=If(),di=Xs(),Hn=Xc(),Ir=Xs(),Sp=Jf(),Mt=up(),Kn=fp(),E=Y(),H=pt(),xp=Qs(),Me=te(),Dt=Ys();function bT(e){if(kp(e)){if(Op(e),Tp(e)){xT(e);return}}Rp(e,()=>fi.topBoolOrEmptySchema(e))}jp.validateFunctionCode=bT;function Rp({gen:e,validateName:t,schema:r,schemaEnv:n,opts:s},o){if(s.code.es5)e.func(t,E._`${H.default.data}, ${H.default.valCxt}`,n.$async,()=>{e.code(E._`"use strict"; ${Ep(r,s)}`),ST(e,s),e.code(o)});else e.func(t,E._`${H.default.data}, ${wT(s)}`,n.$async,()=>e.code(Ep(r,s)).code(o))}function wT(e){return E._`{${H.default.instancePath}="", ${H.default.parentData}, ${H.default.parentDataProperty}, ${H.default.rootData}=${H.default.data}${e.dynamicRef?E._`, ${H.default.dynamicAnchors}={}`:E.nil}}={}`}function ST(e,t){e.if(H.default.valCxt,()=>{if(e.var(H.default.instancePath,E._`${H.default.valCxt}.${H.default.instancePath}`),e.var(H.default.parentData,E._`${H.default.valCxt}.${H.default.parentData}`),e.var(H.default.parentDataProperty,E._`${H.default.valCxt}.${H.default.parentDataProperty}`),e.var(H.default.rootData,E._`${H.default.valCxt}.${H.default.rootData}`),t.dynamicRef)e.var(H.default.dynamicAnchors,E._`${H.default.valCxt}.${H.default.dynamicAnchors}`)},()=>{if(e.var(H.default.instancePath,E._`""`),e.var(H.default.parentData,E._`undefined`),e.var(H.default.parentDataProperty,E._`undefined`),e.var(H.default.rootData,H.default.data),t.dynamicRef)e.var(H.default.dynamicAnchors,E._`{}`)})}function xT(e){let{schema:t,opts:r,gen:n}=e;Rp(e,()=>{if(r.$comment&&t.$comment)Pp(e);if(AT(e),n.let(H.default.vErrors,null),n.let(H.default.errors,0),r.unevaluated)RT(e);Ap(e),IT(e)});return}function RT(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",E._`${r}.evaluated`),t.if(E._`${e.evaluated}.dynamicProps`,()=>t.assign(E._`${e.evaluated}.props`,E._`undefined`)),t.if(E._`${e.evaluated}.dynamicItems`,()=>t.assign(E._`${e.evaluated}.items`,E._`undefined`))}function Ep(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?E._`/*# sourceURL=${r} */`:E.nil}function TT(e,t){if(kp(e)){if(Op(e),Tp(e)){kT(e,t);return}}fi.boolOrEmptySchema(e,t)}function Tp({schema:e,self:t}){if(typeof e=="boolean")return!e;for(let r in e)if(t.RULES.all[r])return!0;return!1}function kp(e){return typeof e.schema!="boolean"}function kT(e,t){let{schema:r,gen:n,opts:s}=e;if(s.$comment&&r.$comment)Pp(e);PT(e),NT(e);let o=n.const("_errs",H.default.errors);Ap(e,o),n.var(t,E._`${o} === ${H.default.errors}`)}function Op(e){Me.checkUnknownRules(e),OT(e)}function Ap(e,t){if(e.opts.jtd)return bp(e,[],!1,t);let r=di.getSchemaTypes(e.schema),n=di.coerceAndCheckDataType(e,r);bp(e,r,!n,t)}function OT(e){let{schema:t,errSchemaPath:r,opts:n,self:s}=e;if(t.$ref&&n.ignoreKeywordsWithRef&&Me.schemaHasRulesButRef(t,s.RULES))s.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function AT(e){let{schema:t,opts:r}=e;if(t.default!==void 0&&r.useDefaults&&r.strictSchema)Me.checkStrictMode(e,"default is ignored in the schema root")}function PT(e){let t=e.schema[e.opts.schemaId];if(t)e.baseId=xp.resolveUrl(e.opts.uriResolver,e.baseId,t)}function NT(e){if(e.schema.$async&&!e.schemaEnv.$async)throw Error("async schema in sync schema")}function Pp({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:s}){let o=r.$comment;if(s.$comment===!0)e.code(E._`${H.default.self}.logger.log(${o})`);else if(typeof s.$comment=="function"){let i=E.str`${n}/$comment`,a=e.scopeValue("root",{ref:t.root});e.code(E._`${H.default.self}.opts.$comment(${o}, ${i}, ${a}.schema)`)}}function IT(e){let{gen:t,schemaEnv:r,validateName:n,ValidationError:s,opts:o}=e;if(r.$async)t.if(E._`${H.default.errors} === 0`,()=>t.return(H.default.data),()=>t.throw(E._`new ${s}(${H.default.vErrors})`));else{if(t.assign(E._`${n}.errors`,H.default.vErrors),o.unevaluated)CT(e);t.return(E._`${H.default.errors} === 0`)}}function CT({gen:e,evaluated:t,props:r,items:n}){if(r instanceof E.Name)e.assign(E._`${t}.props`,r);if(n instanceof E.Name)e.assign(E._`${t}.items`,n)}function bp(e,t,r,n){let{gen:s,schema:o,data:i,allErrors:a,opts:c,self:u}=e,{RULES:d}=u;if(o.$ref&&(c.ignoreKeywordsWithRef||!Me.schemaHasRulesButRef(o,d))){s.block(()=>Ip(e,"$ref",d.all.$ref.definition));return}if(!c.jtd)jT(e,t);s.block(()=>{for(let p of d.rules)l(p);l(d.post)});function l(p){if(!Hn.shouldUseGroup(o,p))return;if(p.type){if(s.if(Ir.checkDataType(p.type,i,c.strictNumbers)),wp(e,p),t.length===1&&t[0]===p.type&&r)s.else(),Ir.reportTypeError(e);s.endIf()}else wp(e,p);if(!a)s.if(E._`${H.default.errors} === ${n||0}`)}}function wp(e,t){let{gen:r,schema:n,opts:{useDefaults:s}}=e;if(s)Sp.assignDefaults(e,t.type);r.block(()=>{for(let o of t.rules)if(Hn.shouldUseRule(n,o))Ip(e,o.keyword,o.definition,t.type)})}function jT(e,t){if(e.schemaEnv.meta||!e.opts.strictTypes)return;if(qT(e,t),!e.opts.allowUnionTypes)DT(e,t);MT(e,e.dataTypes)}function qT(e,t){if(!t.length)return;if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach((r)=>{if(!Np(e.dataTypes,r))su(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),UT(e,t)}function DT(e,t){if(t.length>1&&!(t.length===2&&t.includes("null")))su(e,"use allowUnionTypes to allow union type keyword")}function MT(e,t){let r=e.self.RULES.all;for(let n in r){let s=r[n];if(typeof s=="object"&&Hn.shouldUseRule(e.schema,s)){let{type:o}=s.definition;if(o.length&&!o.some((i)=>LT(t,i)))su(e,`missing type "${o.join(",")}" for keyword "${n}"`)}}}function LT(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function Np(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function UT(e,t){let r=[];for(let n of e.dataTypes)if(Np(t,n))r.push(n);else if(t.includes("integer")&&n==="number")r.push("integer");e.dataTypes=r}function su(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,Me.checkStrictMode(e,t,e.opts.strictTypes)}class ou{constructor(e,t,r){if(Mt.validateKeywordUsage(e,t,r),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=r,this.data=e.data,this.schema=e.schema[r],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=Me.schemaRefOrVal(e,this.schema,r,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",Cp(this.$data,e));else if(this.schemaCode=this.schemaValue,!Mt.validSchemaType(this.schema,t.schemaType,t.allowUndefined))throw Error(`${r} value must be ${JSON.stringify(t.schemaType)}`);if("code"in t?t.trackErrors:t.errors!==!1)this.errsCount=e.gen.const("_errs",H.default.errors)}result(e,t,r){this.failResult(E.not(e),t,r)}failResult(e,t,r){if(this.gen.if(e),r)r();else this.error();if(t){if(this.gen.else(),t(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass(e,t){this.failResult(E.not(e),void 0,t)}fail(e){if(e===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if(e),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:t}=this;this.fail(E._`${t} !== undefined && (${E.or(this.invalid$data(),e)})`)}error(e,t,r){if(t){this.setParams(t),this._error(e,r),this.setParams({});return}this._error(e,r)}_error(e,t){(e?Dt.reportExtraError:Dt.reportError)(this,this.def.error,t)}$dataError(){Dt.reportError(this,this.def.$dataError||Dt.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');Dt.resetErrorsCount(this.gen,this.errsCount)}ok(e){if(!this.allErrors)this.gen.if(e)}setParams(e,t){if(t)Object.assign(this.params,e);else this.params=e}block$data(e,t,r=E.nil){this.gen.block(()=>{this.check$data(e,r),t()})}check$data(e=E.nil,t=E.nil){if(!this.$data)return;let{gen:r,schemaCode:n,schemaType:s,def:o}=this;if(r.if(E.or(E._`${n} === undefined`,t)),e!==E.nil)r.assign(e,!0);if(s.length||o.validateSchema){if(r.elseIf(this.invalid$data()),this.$dataError(),e!==E.nil)r.assign(e,!1)}r.else()}invalid$data(){let{gen:e,schemaCode:t,schemaType:r,def:n,it:s}=this;return E.or(o(),i());function o(){if(r.length){if(!(t instanceof E.Name))throw Error("ajv implementation error");let a=Array.isArray(r)?r:[r];return E._`${Ir.checkDataTypes(a,t,s.opts.strictNumbers,Ir.DataType.Wrong)}`}return E.nil}function i(){if(n.validateSchema){let a=e.scopeValue("validate$data",{ref:n.validateSchema});return E._`!${a}(${t})`}return E.nil}}subschema(e,t){let r=Kn.getSubschema(this.it,e);Kn.extendSubschemaData(r,this.it,e),Kn.extendSubschemaMode(r,e);let n={...this.it,...r,items:void 0,props:void 0};return TT(n,t),n}mergeEvaluated(e,t){let{it:r,gen:n}=this;if(!r.opts.unevaluated)return;if(r.props!==!0&&e.props!==void 0)r.props=Me.mergeEvaluated.props(n,e.props,r.props,t);if(r.items!==!0&&e.items!==void 0)r.items=Me.mergeEvaluated.items(n,e.items,r.items,t)}mergeValidEvaluated(e,t){let{it:r,gen:n}=this;if(r.opts.unevaluated&&(r.props!==!0||r.items!==!0))return n.if(t,()=>this.mergeEvaluated(e,E.Name)),!0}}jp.KeywordCxt=ou;function Ip(e,t,r,n){let s=new ou(e,r,t);if("code"in r)r.code(s,n);else if(s.$data&&r.validate)Mt.funcKeywordCode(s,r);else if("macro"in r)Mt.macroKeywordCode(s,r);else if(r.compile||r.validate)Mt.funcKeywordCode(s,r)}var FT=/^\/(?:[^~]|~0|~1)*$/,VT=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Cp(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let s,o;if(e==="")return H.default.rootData;if(e[0]==="/"){if(!FT.test(e))throw Error(`Invalid JSON-pointer: ${e}`);s=e,o=H.default.rootData}else{let u=VT.exec(e);if(!u)throw Error(`Invalid JSON-pointer: ${e}`);let d=+u[1];if(s=u[2],s==="#"){if(d>=t)throw Error(c("property/index",d));return n[t-d]}if(d>t)throw Error(c("data",d));if(o=r[t-d],!s)return o}let i=o,a=s.split("/");for(let u of a)if(u)o=E._`${o}${E.getProperty(Me.unescapeJsonPointer(u))}`,i=E._`${i} && ${o}`;return i;function c(u,d){return`Cannot access ${u} ${d} levels up, current level is ${t}`}}jp.getData=Cp});var pi=g(function(Mp){Object.defineProperty(Mp,"__esModule",{value:!0});class Dp extends Error{constructor(e){super("validation failed");this.errors=e,this.ajv=this.validation=!0}}Mp.default=Dp});var eo=g(function(Up){Object.defineProperty(Up,"__esModule",{value:!0});var Bn=Qs();class Lp extends Error{constructor(e,t,r,n){super(n||`can't resolve reference ${r} from id ${t}`);this.missingRef=Bn.resolveUrl(e,t,r),this.missingSchema=Bn.normalizeId(Bn.getFullPath(e,this.missingRef))}}Up.default=Lp});var ro=g(function(zp){Object.defineProperty(zp,"__esModule",{value:!0});zp.resolveSchema=zp.getCompilingSchema=zp.resolveRef=zp.compileSchema=zp.SchemaEnv=void 0;var Re=Y(),BT=pi(),bn=pt(),Te=Qs(),hi=te(),Fp=Zs();class to{constructor(e){var t;this.refs={},this.dynamicAnchors={};let r;if(typeof e.schema=="object")r=e.schema;this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(t=e.baseId)!==null&&t!==void 0?t:Te.normalizeId(r===null||r===void 0?void 0:r[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=r===null||r===void 0?void 0:r.$async,this.refs={}}}zp.SchemaEnv=to;function au(e){let t=Vp.call(this,e);if(t)return t;let r=Te.getFullPath(this.opts.uriResolver,e.root.baseId),{es5:n,lines:s}=this.opts.code,{ownProperties:o}=this.opts,i=new Re.CodeGen(this.scope,{es5:n,lines:s,ownProperties:o}),a;if(e.$async)a=i.scopeValue("Error",{ref:BT.default,code:Re._`require("ajv/dist/runtime/validation_error").default`});let c=i.scopeName("validate");e.validateName=c;let u={gen:i,allErrors:this.opts.allErrors,data:bn.default.data,parentData:bn.default.parentData,parentDataProperty:bn.default.parentDataProperty,dataNames:[bn.default.data],dataPathArr:[Re.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:i.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:Re.stringify(e.schema)}:{ref:e.schema}),validateName:c,ValidationError:a,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:Re.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:Re._`""`,opts:this.opts,self:this},d;try{this._compilations.add(e),Fp.validateFunctionCode(u),i.optimize(this.opts.code.optimize);let l=i.toString();if(d=`${i.scopeRefs(bn.default.scope)}return ${l}`,this.opts.code.process)d=this.opts.code.process(d,e);let f=Function(`${bn.default.self}`,`${bn.default.scope}`,d)(this,this.scope.get());if(this.scope.value(c,{ref:f}),f.errors=null,f.schema=e.schema,f.schemaEnv=e,e.$async)f.$async=!0;if(this.opts.code.source===!0)f.source={validateName:c,validateCode:l,scopeValues:i._values};if(this.opts.unevaluated){let{props:h,items:m}=u;if(f.evaluated={props:h instanceof Re.Name?void 0:h,items:m instanceof Re.Name?void 0:m,dynamicProps:h instanceof Re.Name,dynamicItems:m instanceof Re.Name},f.source)f.source.evaluated=Re.stringify(f.evaluated)}return e.validate=f,e}catch(l){if(delete e.validate,delete e.validateName,d)this.logger.error("Error compiling schema, function code:",d);throw l}finally{this._compilations.delete(e)}}zp.compileSchema=au;function WT(e,t,r){var n;r=Te.resolveUrl(this.opts.uriResolver,t,r);let s=e.refs[r];if(s)return s;let o=JT.call(this,e,r);if(o===void 0){let i=(n=e.localRefs)===null||n===void 0?void 0:n[r],{schemaId:a}=this.opts;if(i)o=new to({schema:i,schemaId:a,root:e,baseId:t})}if(o===void 0)return;return e.refs[r]=YT.call(this,o)}zp.resolveRef=WT;function YT(e){if(Te.inlineRef(e.schema,this.opts.inlineRefs))return e.schema;return e.validate?e:au.call(this,e)}function Vp(e){for(let t of this._compilations)if(XT(t,e))return t}zp.getCompilingSchema=Vp;function XT(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function JT(e,t){let r;while(typeof(r=this.refs[t])=="string")t=r;return r||this.schemas[t]||mi.call(this,e,t)}function mi(e,t){let r=this.opts.uriResolver.parse(t),n=Te._getFullPath(this.opts.uriResolver,r),s=Te.getFullPath(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===s)return iu.call(this,r,e);let o=Te.normalizeId(n),i=this.refs[o]||this.schemas[o];if(typeof i=="string"){let a=mi.call(this,e,i);if(typeof(a===null||a===void 0?void 0:a.schema)!=="object")return;return iu.call(this,r,a)}if(typeof(i===null||i===void 0?void 0:i.schema)!=="object")return;if(!i.validate)au.call(this,i);if(o===Te.normalizeId(t)){let{schema:a}=i,{schemaId:c}=this.opts,u=a[c];if(u)s=Te.resolveUrl(this.opts.uriResolver,s,u);return new to({schema:a,schemaId:c,root:e,baseId:s})}return iu.call(this,r,i)}zp.resolveSchema=mi;var QT=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function iu(e,{baseId:t,schema:r,root:n}){var s;if(((s=e.fragment)===null||s===void 0?void 0:s[0])!=="/")return;for(let a of e.fragment.slice(1).split("/")){if(typeof r==="boolean")return;let c=r[hi.unescapeFragment(a)];if(c===void 0)return;r=c;let u=typeof r==="object"&&r[this.opts.schemaId];if(!QT.has(a)&&u)t=Te.resolveUrl(this.opts.uriResolver,t,u)}let o;if(typeof r!="boolean"&&r.$ref&&!hi.schemaHasRulesButRef(r,this.RULES)){let a=Te.resolveUrl(this.opts.uriResolver,t,r.$ref);o=mi.call(this,n,a)}let{schemaId:i}=this.opts;if(o=o||new to({schema:r,schemaId:i,root:n,baseId:t}),o.schema!==o.root.schema)return o;return}});var Kp=g(function(i4,nk){nk.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var uu=g(function(a4,Yp){var sk=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),Bp=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function cu(e){let t="",r=0,n=0;for(n=0;n<e.length;n++){if(r=e[n].charCodeAt(0),r===48)continue;if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n];break}for(n+=1;n<e.length;n++){if(r=e[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n]}return t}var ok=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function Hp(e){return e.length=0,!0}function ik(e,t,r){if(e.length){let n=cu(e);if(n!=="")t.push(n);else return r.error=!0,!1;e.length=0}return!0}function ak(e){let t=0,r={error:!1,address:"",zone:""},n=[],s=[],o=!1,i=!1,a=ik;for(let c=0;c<e.length;c++){let u=e[c];if(u==="["||u==="]")continue;if(u===":"){if(o===!0)i=!0;if(!a(s,n,r))break;if(++t>7){r.error=!0;break}if(c>0&&e[c-1]===":")o=!0;n.push(":");continue}else if(u==="%"){if(!a(s,n,r))break;a=Hp}else{s.push(u);continue}}if(s.length)if(a===Hp)r.zone=s.join("");else if(i)n.push(s.join(""));else n.push(cu(s));return r.address=n.join(""),r}function Wp(e){if(ck(e,":")<2)return{host:e,isIPV6:!1};let t=ak(e);if(!t.error){let{address:r,address:n}=t;if(t.zone)r+="%"+t.zone,n+="%25"+t.zone;return{host:r,isIPV6:!0,escapedHost:n}}else return{host:e,isIPV6:!1}}function ck(e,t){let r=0;for(let n=0;n<e.length;n++)if(e[n]===t)r++;return r}function uk(e){let t=e,r=[],n=-1,s=0;while(s=t.length){if(s===1)if(t===".")break;else if(t==="/"){r.push("/");break}else{r.push(t);break}else if(s===2){if(t[0]==="."){if(t[1]===".")break;else if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"){if(t[1]==="."||t[1]==="/"){r.push("/");break}}}else if(s===3){if(t==="/.."){if(r.length!==0)r.pop();r.push("/");break}}if(t[0]==="."){if(t[1]==="."){if(t[2]==="/"){t=t.slice(3);continue}}else if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"){if(t[1]==="."){if(t[2]==="/"){t=t.slice(2);continue}else if(t[2]==="."){if(t[3]==="/"){if(t=t.slice(3),r.length!==0)r.pop();continue}}}}if((n=t.indexOf("/",1))===-1){r.push(t);break}else r.push(t.slice(0,n)),t=t.slice(n)}return r.join("")}function lk(e,t){let r=t!==!0?escape:unescape;if(e.scheme!==void 0)e.scheme=r(e.scheme);if(e.userinfo!==void 0)e.userinfo=r(e.userinfo);if(e.host!==void 0)e.host=r(e.host);if(e.path!==void 0)e.path=r(e.path);if(e.query!==void 0)e.query=r(e.query);if(e.fragment!==void 0)e.fragment=r(e.fragment);return e}function dk(e){let t=[];if(e.userinfo!==void 0)t.push(e.userinfo),t.push("@");if(e.host!==void 0){let r=unescape(e.host);if(!Bp(r)){let n=Wp(r);if(n.isIPV6===!0)r=`[${n.escapedHost}]`;else r=e.host}t.push(r)}if(typeof e.port==="number"||typeof e.port==="string")t.push(":"),t.push(String(e.port));return t.length?t.join(""):void 0}Yp.exports={nonSimpleDomain:ok,recomposeAuthority:dk,normalizeComponentEncoding:lk,removeDotSegments:uk,isIPv4:Bp,isUUID:sk,normalizeIPv6:Wp,stringArrayToHexStripped:cu}});var eh=g(function(c4,Zp){var{isUUID:fk}=uu(),pk=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,hk=["http","https","ws","wss","urn","urn:uuid"];function mk(e){return hk.indexOf(e)!==-1}function lu(e){if(e.secure===!0)return!0;else if(e.secure===!1)return!1;else if(e.scheme)return e.scheme.length===3&&(e.scheme[0]==="w"||e.scheme[0]==="W")&&(e.scheme[1]==="s"||e.scheme[1]==="S")&&(e.scheme[2]==="s"||e.scheme[2]==="S");else return!1}function Xp(e){if(!e.host)e.error=e.error||"HTTP URIs must have a host.";return e}function Jp(e){let t=String(e.scheme).toLowerCase()==="https";if(e.port===(t?443:80)||e.port==="")e.port=void 0;if(!e.path)e.path="/";return e}function gk(e){return e.secure=lu(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function yk(e){if(e.port===(lu(e)?443:80)||e.port==="")e.port=void 0;if(typeof e.secure==="boolean")e.scheme=e.secure?"wss":"ws",e.secure=void 0;if(e.resourceName){let[t,r]=e.resourceName.split("?");e.path=t&&t!=="/"?t:void 0,e.query=r,e.resourceName=void 0}return e.fragment=void 0,e}function _k(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match(pk);if(r){let n=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];let s=`${n}:${t.nid||e.nid}`,o=du(s);if(e.path=void 0,o)e=o.parse(e,t)}else e.error=e.error||"URN can not be parsed.";return e}function vk(e,t){if(e.nid===void 0)throw Error("URN without nid cannot be serialized");let r=t.scheme||e.scheme||"urn",n=e.nid.toLowerCase(),s=`${r}:${t.nid||n}`,o=du(s);if(o)e=o.serialize(e,t);let i=e,a=e.nss;return i.path=`${n||t.nid}:${a}`,t.skipEscape=!0,i}function $k(e,t){let r=e;if(r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!fk(r.uuid)))r.error=r.error||"UUID is not valid.";return r}function Ek(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}var Qp={scheme:"http",domainHost:!0,parse:Xp,serialize:Jp},bk={scheme:"https",domainHost:Qp.domainHost,parse:Xp,serialize:Jp},gi={scheme:"ws",domainHost:!0,parse:gk,serialize:yk},wk={scheme:"wss",domainHost:gi.domainHost,parse:gi.parse,serialize:gi.serialize},Sk={scheme:"urn",parse:_k,serialize:vk,skipNormalize:!0},xk={scheme:"urn:uuid",parse:$k,serialize:Ek,skipNormalize:!0},yi={http:Qp,https:bk,ws:gi,wss:wk,urn:Sk,"urn:uuid":xk};Object.setPrototypeOf(yi,null);function du(e){return e&&(yi[e]||yi[e.toLowerCase()])||void 0}Zp.exports={wsIsSecure:lu,SCHEMES:yi,isValidSchemeName:mk,getSchemeHandler:du}});var pu=g(function(u4,vi){var{normalizeIPv6:Rk,removeDotSegments:no,recomposeAuthority:Tk,normalizeComponentEncoding:_i,isIPv4:kk,nonSimpleDomain:Ok}=uu(),{SCHEMES:Ak,getSchemeHandler:th}=eh();function Pk(e,t){if(typeof e==="string")e=Lt(gr(e,t),t);else if(typeof e==="object")e=gr(Lt(e,t),t);return e}function Nk(e,t,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},s=rh(gr(e,n),gr(t,n),n,!0);return n.skipEscape=!0,Lt(s,n)}function rh(e,t,r,n){let s={};if(!n)e=gr(Lt(e,r),r),t=gr(Lt(t,r),r);if(r=r||{},!r.tolerant&&t.scheme)s.scheme=t.scheme,s.userinfo=t.userinfo,s.host=t.host,s.port=t.port,s.path=no(t.path||""),s.query=t.query;else{if(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)s.userinfo=t.userinfo,s.host=t.host,s.port=t.port,s.path=no(t.path||""),s.query=t.query;else{if(!t.path)if(s.path=e.path,t.query!==void 0)s.query=t.query;else s.query=e.query;else{if(t.path[0]==="/")s.path=no(t.path);else{if((e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path)s.path="/"+t.path;else if(!e.path)s.path=t.path;else s.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path;s.path=no(s.path)}s.query=t.query}s.userinfo=e.userinfo,s.host=e.host,s.port=e.port}s.scheme=e.scheme}return s.fragment=t.fragment,s}function Ik(e,t,r){if(typeof e==="string")e=unescape(e),e=Lt(_i(gr(e,r),!0),{...r,skipEscape:!0});else if(typeof e==="object")e=Lt(_i(e,!0),{...r,skipEscape:!0});if(typeof t==="string")t=unescape(t),t=Lt(_i(gr(t,r),!0),{...r,skipEscape:!0});else if(typeof t==="object")t=Lt(_i(t,!0),{...r,skipEscape:!0});return e.toLowerCase()===t.toLowerCase()}function Lt(e,t){let r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},n=Object.assign({},t),s=[],o=th(n.scheme||r.scheme);if(o&&o.serialize)o.serialize(r,n);if(r.path!==void 0)if(!n.skipEscape){if(r.path=escape(r.path),r.scheme!==void 0)r.path=r.path.split("%3A").join(":")}else r.path=unescape(r.path);if(n.reference!=="suffix"&&r.scheme)s.push(r.scheme,":");let i=Tk(r);if(i!==void 0){if(n.reference!=="suffix")s.push("//");if(s.push(i),r.path&&r.path[0]!=="/")s.push("/")}if(r.path!==void 0){let a=r.path;if(!n.absolutePath&&(!o||!o.absolutePath))a=no(a);if(i===void 0&&a[0]==="/"&&a[1]==="/")a="/%2F"+a.slice(2);s.push(a)}if(r.query!==void 0)s.push("?",r.query);if(r.fragment!==void 0)s.push("#",r.fragment);return s.join("")}var Ck=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function gr(e,t){let r=Object.assign({},t),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},s=!1;if(r.reference==="suffix")if(r.scheme)e=r.scheme+":"+e;else e="//"+e;let o=e.match(Ck);if(o){if(n.scheme=o[1],n.userinfo=o[3],n.host=o[4],n.port=parseInt(o[5],10),n.path=o[6]||"",n.query=o[7],n.fragment=o[8],isNaN(n.port))n.port=o[5];if(n.host)if(kk(n.host)===!1){let c=Rk(n.host);n.host=c.host.toLowerCase(),s=c.isIPV6}else s=!0;if(n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path)n.reference="same-document";else if(n.scheme===void 0)n.reference="relative";else if(n.fragment===void 0)n.reference="absolute";else n.reference="uri";if(r.reference&&r.reference!=="suffix"&&r.reference!==n.reference)n.error=n.error||"URI is not a "+r.reference+" reference.";let i=th(r.scheme||n.scheme);if(!r.unicodeSupport&&(!i||!i.unicodeSupport)){if(n.host&&(r.domainHost||i&&i.domainHost)&&s===!1&&Ok(n.host))try{n.host=URL.domainToASCII(n.host.toLowerCase())}catch(a){n.error=n.error||"Host's domain name can not be converted to ASCII: "+a}}if(!i||i&&!i.skipNormalize){if(e.indexOf("%")!==-1){if(n.scheme!==void 0)n.scheme=unescape(n.scheme);if(n.host!==void 0)n.host=unescape(n.host)}if(n.path)n.path=escape(unescape(n.path));if(n.fragment)n.fragment=encodeURI(decodeURIComponent(n.fragment))}if(i&&i.parse)i.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return n}var fu={SCHEMES:Ak,normalize:Pk,resolve:Nk,resolveComponent:rh,equal:Ik,serialize:Lt,parse:gr};vi.exports=fu;vi.exports.default=fu;vi.exports.fastUri=fu});var oh=g(function(sh){Object.defineProperty(sh,"__esModule",{value:!0});var nh=pu();nh.code='require("ajv/dist/runtime/uri").default';sh.default=nh});var mh=g(function(yr){Object.defineProperty(yr,"__esModule",{value:!0});yr.CodeGen=yr.Name=yr.nil=yr.stringify=yr.str=yr._=yr.KeywordCxt=void 0;var qk=Zs();Object.defineProperty(yr,"KeywordCxt",{enumerable:!0,get:function(){return qk.KeywordCxt}});var Yn=Y();Object.defineProperty(yr,"_",{enumerable:!0,get:function(){return Yn._}});Object.defineProperty(yr,"str",{enumerable:!0,get:function(){return Yn.str}});Object.defineProperty(yr,"stringify",{enumerable:!0,get:function(){return Yn.stringify}});Object.defineProperty(yr,"nil",{enumerable:!0,get:function(){return Yn.nil}});Object.defineProperty(yr,"Name",{enumerable:!0,get:function(){return Yn.Name}});Object.defineProperty(yr,"CodeGen",{enumerable:!0,get:function(){return Yn.CodeGen}});var Dk=pi(),lh=eo(),dh=Yc(),Ut=ro(),fh=Y(),Ft=Qs(),Cr=Xs(),Wn=te(),ih=Kp(),Mk=oh(),ph=(e,t)=>new RegExp(e,t);ph.code="new RegExp";var Lk=["removeAdditional","useDefaults","coerceTypes"],Uk=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),Fk={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."},Vk={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},ah=200;function zk(e){var t,r,n,s,o,i,a,c,u,d,l,p,f,h,m,y,_,O,T,M,S,_e,ve,xt,hr;let et=e.strict,gn=(t=e.code)===null||t===void 0?void 0:t.optimize,Fs=gn===!0||gn===void 0?1:gn||0,Vs=(n=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:ph,yc=(s=e.uriResolver)!==null&&s!==void 0?s:Mk.default;return{strictSchema:(i=(o=e.strictSchema)!==null&&o!==void 0?o:et)!==null&&i!==void 0?i:!0,strictNumbers:(c=(a=e.strictNumbers)!==null&&a!==void 0?a:et)!==null&&c!==void 0?c:!0,strictTypes:(d=(u=e.strictTypes)!==null&&u!==void 0?u:et)!==null&&d!==void 0?d:"log",strictTuples:(p=(l=e.strictTuples)!==null&&l!==void 0?l:et)!==null&&p!==void 0?p:"log",strictRequired:(h=(f=e.strictRequired)!==null&&f!==void 0?f:et)!==null&&h!==void 0?h:!1,code:e.code?{...e.code,optimize:Fs,regExp:Vs}:{optimize:Fs,regExp:Vs},loopRequired:(m=e.loopRequired)!==null&&m!==void 0?m:ah,loopEnum:(y=e.loopEnum)!==null&&y!==void 0?y:ah,meta:(_=e.meta)!==null&&_!==void 0?_:!0,messages:(O=e.messages)!==null&&O!==void 0?O:!0,inlineRefs:(T=e.inlineRefs)!==null&&T!==void 0?T:!0,schemaId:(M=e.schemaId)!==null&&M!==void 0?M:"$id",addUsedSchema:(S=e.addUsedSchema)!==null&&S!==void 0?S:!0,validateSchema:(_e=e.validateSchema)!==null&&_e!==void 0?_e:!0,validateFormats:(ve=e.validateFormats)!==null&&ve!==void 0?ve:!0,unicodeRegExp:(xt=e.unicodeRegExp)!==null&&xt!==void 0?xt:!0,int32range:(hr=e.int32range)!==null&&hr!==void 0?hr:!0,uriResolver:yc}}class $i{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...zk(e)};let{es5:t,lines:r}=this.opts.code;this.scope=new fh.ValueScope({scope:{},prefixes:Uk,es5:t,lines:r}),this.logger=Yk(e.logger);let n=e.validateFormats;if(e.validateFormats=!1,this.RULES=dh.getRules(),ch.call(this,Fk,e,"NOT SUPPORTED"),ch.call(this,Vk,e,"DEPRECATED","warn"),this._metaOpts=Bk.call(this),e.formats)Kk.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords)Hk.call(this,e.keywords);if(typeof e.meta=="object")this.addMetaSchema(e.meta);Gk.call(this),e.validateFormats=n}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:r}=this.opts,n=ih;if(r==="id")n={...ih},n.id=n.$id,delete n.$id;if(t&&e)this.addMetaSchema(n,n[r],!1)}defaultMeta(){let{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[t]||e:void 0}validate(e,t){let r;if(typeof e=="string"){if(r=this.getSchema(e),!r)throw Error(`no schema with key or ref "${e}"`)}else r=this.compile(e);let n=r(t);if(!("$async"in r))this.errors=r.errors;return n}compile(e,t){let r=this._addSchema(e,t);return r.validate||this._compileSchemaEnv(r)}compileAsync(e,t){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:r}=this.opts;return n.call(this,e,t);async function n(u,d){await s.call(this,u.$schema);let l=this._addSchema(u,d);return l.validate||o.call(this,l)}async function s(u){if(u&&!this.getSchema(u))await n.call(this,{$ref:u},!0)}async function o(u){try{return this._compileSchemaEnv(u)}catch(d){if(!(d instanceof lh.default))throw d;return i.call(this,d),await a.call(this,d.missingSchema),o.call(this,u)}}function i({missingSchema:u,missingRef:d}){if(this.refs[u])throw Error(`AnySchema ${u} is loaded but ${d} cannot be resolved`)}async function a(u){let d=await c.call(this,u);if(!this.refs[u])await s.call(this,d.$schema);if(!this.refs[u])this.addSchema(d,u,t)}async function c(u){let d=this._loading[u];if(d)return d;try{return await(this._loading[u]=r(u))}finally{delete this._loading[u]}}}addSchema(e,t,r,n=this.opts.validateSchema){if(Array.isArray(e)){for(let o of e)this.addSchema(o,void 0,r,n);return this}let s;if(typeof e==="object"){let{schemaId:o}=this.opts;if(s=e[o],s!==void 0&&typeof s!="string")throw Error(`schema ${o} must be string`)}return t=Ft.normalizeId(t||s),this._checkUnique(t),this.schemas[t]=this._addSchema(e,r,t,n,!0),this}addMetaSchema(e,t,r=this.opts.validateSchema){return this.addSchema(e,t,!0,r),this}validateSchema(e,t){if(typeof e=="boolean")return!0;let r;if(r=e.$schema,r!==void 0&&typeof r!="string")throw Error("$schema must be a string");if(r=r||this.opts.defaultMeta||this.defaultMeta(),!r)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let n=this.validate(r,e);if(!n&&t){let s="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(s);else throw Error(s)}return n}getSchema(e){let t;while(typeof(t=uh.call(this,e))=="string")e=t;if(t===void 0){let{schemaId:r}=this.opts,n=new Ut.SchemaEnv({schema:{},schemaId:r});if(t=Ut.resolveSchema.call(this,n,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let t=uh.call(this,e);if(typeof t=="object")this._cache.delete(t.schema);return delete this.schemas[e],delete this.refs[e],this}case"object":{let t=e;this._cache.delete(t);let r=e[this.opts.schemaId];if(r)r=Ft.normalizeId(r),delete this.schemas[r],delete this.refs[r];return this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let t of e)this.addKeyword(t);return this}addKeyword(e,t){let r;if(typeof e=="string"){if(r=e,typeof t=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=r}else if(typeof e=="object"&&t===void 0){if(t=e,r=t.keyword,Array.isArray(r)&&!r.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(Jk.call(this,r,t),!t)return Wn.eachItem(r,(s)=>hu.call(this,s)),this;Zk.call(this,t);let n={...t,type:Cr.getJSONTypes(t.type),schemaType:Cr.getJSONTypes(t.schemaType)};return Wn.eachItem(r,n.type.length===0?(s)=>hu.call(this,s,n):(s)=>n.type.forEach((o)=>hu.call(this,s,n,o))),this}getKeyword(e){let t=this.RULES.all[e];return typeof t=="object"?t.definition:!!t}removeKeyword(e){let{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(let r of t.rules){let n=r.rules.findIndex((s)=>s.keyword===e);if(n>=0)r.rules.splice(n,1)}return this}addFormat(e,t){if(typeof t=="string")t=new RegExp(t);return this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:r="data"}={}){if(!e||e.length===0)return"No errors";return e.map((n)=>`${r}${n.instancePath} ${n.message}`).reduce((n,s)=>n+t+s)}$dataMetaSchema(e,t){let r=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let n of t){let s=n.split("/").slice(1),o=e;for(let i of s)o=o[i];for(let i in r){let a=r[i];if(typeof a!="object")continue;let{$data:c}=a.definition,u=o[i];if(c&&u)o[i]=hh(u)}}return e}_removeAllSchemas(e,t){for(let r in e){let n=e[r];if(!t||t.test(r)){if(typeof n=="string")delete e[r];else if(n&&!n.meta)this._cache.delete(n.schema),delete e[r]}}}_addSchema(e,t,r,n=this.opts.validateSchema,s=this.opts.addUsedSchema){let o,{schemaId:i}=this.opts;if(typeof e=="object")o=e[i];else if(this.opts.jtd)throw Error("schema must be object");else if(typeof e!="boolean")throw Error("schema must be object or boolean");let a=this._cache.get(e);if(a!==void 0)return a;r=Ft.normalizeId(o||r);let c=Ft.getSchemaRefs.call(this,e,r);if(a=new Ut.SchemaEnv({schema:e,schemaId:i,meta:t,baseId:r,localRefs:c}),this._cache.set(a.schema,a),s&&!r.startsWith("#")){if(r)this._checkUnique(r);this.refs[r]=a}if(n)this.validateSchema(e,!0);return a}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta)this._compileMetaSchema(e);else Ut.compileSchema.call(this,e);if(!e.validate)throw Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let t=this.opts;this.opts=this._metaOpts;try{Ut.compileSchema.call(this,e)}finally{this.opts=t}}}$i.ValidationError=Dk.default;$i.MissingRefError=lh.default;yr.default=$i;function ch(e,t,r,n="error"){for(let s in e){let o=s;if(o in t)this.logger[n](`${r}: option ${s}. ${e[o]}`)}}function uh(e){return e=Ft.normalizeId(e),this.schemas[e]||this.refs[e]}function Gk(){let e=this.opts.schemas;if(!e)return;if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}function Kk(){for(let e in this.opts.formats){let t=this.opts.formats[e];if(t)this.addFormat(e,t)}}function Hk(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let t in e){let r=e[t];if(!r.keyword)r.keyword=t;this.addKeyword(r)}}function Bk(){let e={...this.opts};for(let t of Lk)delete e[t];return e}var Wk={log(){},warn(){},error(){}};function Yk(e){if(e===!1)return Wk;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw Error("logger must implement log, warn and error methods")}var Xk=/^[a-z_$][a-z0-9_$:-]*$/i;function Jk(e,t){let{RULES:r}=this;if(Wn.eachItem(e,(n)=>{if(r.keywords[n])throw Error(`Keyword ${n} is already defined`);if(!Xk.test(n))throw Error(`Keyword ${n} has invalid name`)}),!t)return;if(t.$data&&!(("code"in t)||("validate"in t)))throw Error('$data keyword must have "code" or "validate" function')}function hu(e,t,r){var n;let s=t===null||t===void 0?void 0:t.post;if(r&&s)throw Error('keyword with "post" flag cannot have "type"');let{RULES:o}=this,i=s?o.post:o.rules.find(({type:c})=>c===r);if(!i)i={type:r,rules:[]},o.rules.push(i);if(o.keywords[e]=!0,!t)return;let a={keyword:e,definition:{...t,type:Cr.getJSONTypes(t.type),schemaType:Cr.getJSONTypes(t.schemaType)}};if(t.before)Qk.call(this,i,a,t.before);else i.rules.push(a);o.all[e]=a,(n=t.implements)===null||n===void 0||n.forEach((c)=>this.addKeyword(c))}function Qk(e,t,r){let n=e.rules.findIndex((s)=>s.keyword===r);if(n>=0)e.rules.splice(n,0,t);else e.rules.push(t),this.logger.warn(`rule ${r} is not defined`)}function Zk(e){let{metaSchema:t}=e;if(t===void 0)return;if(e.$data&&this.opts.$data)t=hh(t);e.validateSchema=this.compile(t,!0)}var eO={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function hh(e){return{anyOf:[e,eO]}}});var yh=g(function(gh){Object.defineProperty(gh,"__esModule",{value:!0});var nO={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};gh.default=nO});var Si=g(function(vh){Object.defineProperty(vh,"__esModule",{value:!0});vh.callRef=vh.getValidate=void 0;var oO=eo(),bi=mt(),he=Y(),Xn=pt(),wi=ro(),jr=te(),iO={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:r,it:n}=e,{baseId:s,schemaEnv:o,validateName:i,opts:a,self:c}=n,{root:u}=o;if((r==="#"||r==="#/")&&s===u.baseId)return l();let d=wi.resolveRef.call(c,u,s,r);if(d===void 0)throw new oO.default(n.opts.uriResolver,s,r);if(d instanceof wi.SchemaEnv)return p(d);return f(d);function l(){if(o===u)return Ei(e,i,o,o.$async);let h=t.scopeValue("root",{ref:u});return Ei(e,he._`${h}.validate`,u,u.$async)}function p(h){let m=_h(e,h);Ei(e,m,h,h.$async)}function f(h){let m=t.scopeValue("schema",a.code.source===!0?{ref:h,code:he.stringify(h)}:{ref:h}),y=t.name("valid"),_=e.subschema({schema:h,dataTypes:[],schemaPath:he.nil,topSchemaRef:m,errSchemaPath:r},y);e.mergeEvaluated(_),e.ok(y)}}};function _h(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):he._`${r.scopeValue("wrapper",{ref:t})}.validate`}vh.getValidate=_h;function Ei(e,t,r,n){let{gen:s,it:o}=e,{allErrors:i,schemaEnv:a,opts:c}=o,u=c.passContext?Xn.default.this:he.nil;if(n)d();else l();function d(){if(!a.$async)throw Error("async schema referenced by sync schema");let h=s.let("valid");s.try(()=>{if(s.code(he._`await ${bi.callValidateCode(e,t,u)}`),f(t),!i)s.assign(h,!0)},(m)=>{if(s.if(he._`!(${m} instanceof ${o.ValidationError})`,()=>s.throw(m)),p(m),!i)s.assign(h,!1)}),e.ok(h)}function l(){e.result(bi.callValidateCode(e,t,u),()=>f(t),()=>p(t))}function p(h){let m=he._`${h}.errors`;s.assign(Xn.default.vErrors,he._`${Xn.default.vErrors} === null ? ${m} : ${Xn.default.vErrors}.concat(${m})`),s.assign(Xn.default.errors,he._`${Xn.default.vErrors}.length`)}function f(h){var m;if(!o.opts.unevaluated)return;let y=(m=r===null||r===void 0?void 0:r.validate)===null||m===void 0?void 0:m.evaluated;if(o.props!==!0)if(y&&!y.dynamicProps){if(y.props!==void 0)o.props=jr.mergeEvaluated.props(s,y.props,o.props)}else{let _=s.var("props",he._`${h}.evaluated.props`);o.props=jr.mergeEvaluated.props(s,_,o.props,he.Name)}if(o.items!==!0)if(y&&!y.dynamicItems){if(y.items!==void 0)o.items=jr.mergeEvaluated.items(s,y.items,o.items)}else{let _=s.var("items",he._`${h}.evaluated.items`);o.items=jr.mergeEvaluated.items(s,_,o.items,he.Name)}}}vh.callRef=Ei;vh.default=iO});var bh=g(function(Eh){Object.defineProperty(Eh,"__esModule",{value:!0});var uO=yh(),lO=Si(),dO=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",uO.default,lO.default];Eh.default=dO});var Sh=g(function(wh){Object.defineProperty(wh,"__esModule",{value:!0});var Dr=Y(),qr=Dr.operators,xi={maximum:{okStr:"<=",ok:qr.LTE,fail:qr.GT},minimum:{okStr:">=",ok:qr.GTE,fail:qr.LT},exclusiveMaximum:{okStr:"<",ok:qr.LT,fail:qr.GTE},exclusiveMinimum:{okStr:">",ok:qr.GT,fail:qr.LTE}},pO={message:({keyword:e,schemaCode:t})=>Dr.str`must be ${xi[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>Dr._`{comparison: ${xi[e].okStr}, limit: ${t}}`},hO={keyword:Object.keys(xi),type:"number",schemaType:"number",$data:!0,error:pO,code(e){let{keyword:t,data:r,schemaCode:n}=e;e.fail$data(Dr._`${r} ${xi[t].fail} ${n} || isNaN(${r})`)}};wh.default=hO});var Rh=g(function(xh){Object.defineProperty(xh,"__esModule",{value:!0});var Vt=Y(),gO={message:({schemaCode:e})=>Vt.str`must be multiple of ${e}`,params:({schemaCode:e})=>Vt._`{multipleOf: ${e}}`},yO={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:gO,code(e){let{gen:t,data:r,schemaCode:n,it:s}=e,o=s.opts.multipleOfPrecision,i=t.let("res"),a=o?Vt._`Math.abs(Math.round(${i}) - ${i}) > 1e-${o}`:Vt._`${i} !== parseInt(${i})`;e.fail$data(Vt._`(${n} === 0 || (${i} = ${r}/${n}, ${a}))`)}};xh.default=yO});var Oh=g(function(kh){Object.defineProperty(kh,"__esModule",{value:!0});function Th(e){let t=e.length,r=0,n=0,s;while(n<t)if(r++,s=e.charCodeAt(n++),s>=55296&&s<=56319&&n<t){if(s=e.charCodeAt(n),(s&64512)===56320)n++}return r}kh.default=Th;Th.code='require("ajv/dist/runtime/ucs2length").default'});var Nh=g(function(Ph){Object.defineProperty(Ph,"__esModule",{value:!0});var nt=Y(),Ah=te(),$O=Oh(),EO={message({keyword:e,schemaCode:t}){return nt.str`must NOT have ${e==="maxLength"?"more":"fewer"} than ${t} characters`},params:({schemaCode:e})=>nt._`{limit: ${e}}`},bO={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:EO,code(e){let{keyword:t,data:r,schemaCode:n,it:s}=e,o=t==="maxLength"?nt.operators.GT:nt.operators.LT,i=s.opts.unicode===!1?nt._`${r}.length`:nt._`${Ah.useFunc(e.gen,$O.default)}(${r})`;e.fail$data(nt._`${i} ${o} ${n}`)}};Ph.default=bO});var jh=g(function(Ch){Object.defineProperty(Ch,"__esModule",{value:!0});var Ih=mt(),Mr=Y(),SO={message:({schemaCode:e})=>Mr.str`must match pattern "${e}"`,params:({schemaCode:e})=>Mr._`{pattern: ${e}}`},xO={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:SO,code(e){let{data:t,$data:r,schema:n,schemaCode:s,it:o}=e,i=o.opts.unicodeRegExp?"u":"",a=r?Mr._`(new RegExp(${s}, ${i}))`:Ih.usePattern(e,n);e.fail$data(Mr._`!${a}.test(${t})`)}};Ch.default=xO});var Dh=g(function(qh){Object.defineProperty(qh,"__esModule",{value:!0});var zt=Y(),TO={message({keyword:e,schemaCode:t}){return zt.str`must NOT have ${e==="maxProperties"?"more":"fewer"} than ${t} properties`},params:({schemaCode:e})=>zt._`{limit: ${e}}`},kO={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:TO,code(e){let{keyword:t,data:r,schemaCode:n}=e,s=t==="maxProperties"?zt.operators.GT:zt.operators.LT;e.fail$data(zt._`Object.keys(${r}).length ${s} ${n}`)}};qh.default=kO});var Uh=g(function(Lh){Object.defineProperty(Lh,"__esModule",{value:!0});var Gt=mt(),Kt=Y(),Mh=te(),AO={message:({params:{missingProperty:e}})=>Kt.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>Kt._`{missingProperty: ${e}}`},PO={keyword:"required",type:"object",schemaType:"array",$data:!0,error:AO,code(e){let{gen:t,schema:r,schemaCode:n,data:s,$data:o,it:i}=e,{opts:a}=i;if(!o&&r.length===0)return;let c=r.length>=a.loopRequired;if(i.allErrors)u();else d();if(a.strictRequired){let f=e.parentSchema.properties,{definedProperties:h}=e.it;for(let m of r)if((f===null||f===void 0?void 0:f[m])===void 0&&!h.has(m)){let y=i.schemaEnv.baseId+i.errSchemaPath,_=`required property "${m}" is not defined at "${y}" (strictRequired)`;Mh.checkStrictMode(i,_,i.opts.strictRequired)}}function u(){if(c||o)e.block$data(Kt.nil,l);else for(let f of r)Gt.checkReportMissingProp(e,f)}function d(){let f=t.let("missing");if(c||o){let h=t.let("valid",!0);e.block$data(h,()=>p(f,h)),e.ok(h)}else t.if(Gt.checkMissingProp(e,r,f)),Gt.reportMissingProp(e,f),t.else()}function l(){t.forOf("prop",n,(f)=>{e.setParams({missingProperty:f}),t.if(Gt.noPropertyInData(t,s,f,a.ownProperties),()=>e.error())})}function p(f,h){e.setParams({missingProperty:f}),t.forOf(f,n,()=>{t.assign(h,Gt.propertyInData(t,s,f,a.ownProperties)),t.if(Kt.not(h),()=>{e.error(),t.break()})},Kt.nil)}}};Lh.default=PO});var Vh=g(function(Fh){Object.defineProperty(Fh,"__esModule",{value:!0});var Ht=Y(),IO={message({keyword:e,schemaCode:t}){return Ht.str`must NOT have ${e==="maxItems"?"more":"fewer"} than ${t} items`},params:({schemaCode:e})=>Ht._`{limit: ${e}}`},CO={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:IO,code(e){let{keyword:t,data:r,schemaCode:n}=e,s=t==="maxItems"?Ht.operators.GT:Ht.operators.LT;e.fail$data(Ht._`${r}.length ${s} ${n}`)}};Fh.default=CO});var Ri=g(function(Gh){Object.defineProperty(Gh,"__esModule",{value:!0});var zh=Js();zh.code='require("ajv/dist/runtime/equal").default';Gh.default=zh});var Bh=g(function(Hh){Object.defineProperty(Hh,"__esModule",{value:!0});var Jn=Xs(),se=Y(),Kh=te(),DO=Ri(),MO={message:({params:{i:e,j:t}})=>se.str`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>se._`{i: ${e}, j: ${t}}`},LO={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:MO,code(e){let{gen:t,data:r,$data:n,schema:s,parentSchema:o,schemaCode:i,it:a}=e;if(!n&&!s)return;let c=t.let("valid"),u=o.items?Jn.getSchemaTypes(o.items):[];e.block$data(c,d,se._`${i} === false`),e.ok(c);function d(){let h=t.let("i",se._`${r}.length`),m=t.let("j");e.setParams({i:h,j:m}),t.assign(c,!0),t.if(se._`${h} > 1`,()=>(l()?p:f)(h,m))}function l(){return u.length>0&&!u.some((h)=>h==="object"||h==="array")}function p(h,m){let y=t.name("item"),_=Jn.checkDataTypes(u,y,a.opts.strictNumbers,Jn.DataType.Wrong),O=t.const("indices",se._`{}`);t.for(se._`;${h}--;`,()=>{if(t.let(y,se._`${r}[${h}]`),t.if(_,se._`continue`),u.length>1)t.if(se._`typeof ${y} == "string"`,se._`${y} += "_"`);t.if(se._`typeof ${O}[${y}] == "number"`,()=>{t.assign(m,se._`${O}[${y}]`),e.error(),t.assign(c,!1).break()}).code(se._`${O}[${y}] = ${h}`)})}function f(h,m){let y=Kh.useFunc(t,DO.default),_=t.name("outer");t.label(_).for(se._`;${h}--;`,()=>t.for(se._`${m} = ${h}; ${m}--;`,()=>t.if(se._`${y}(${r}[${h}], ${r}[${m}])`,()=>{e.error(),t.assign(c,!1).break(_)})))}}};Hh.default=LO});var Xh=g(function(Yh){Object.defineProperty(Yh,"__esModule",{value:!0});var Qn=Y(),Wh=te(),FO=Ri(),VO={message:"must be equal to constant",params:({schemaCode:e})=>Qn._`{allowedValue: ${e}}`},zO={keyword:"const",$data:!0,error:VO,code(e){let{gen:t,data:r,$data:n,schemaCode:s,schema:o}=e;if(n||o&&typeof o=="object")e.fail$data(Qn._`!${Wh.useFunc(t,FO.default)}(${r}, ${s})`);else e.fail(Qn._`${o} !== ${r}`)}};Yh.default=zO});var Zh=g(function(Qh){Object.defineProperty(Qh,"__esModule",{value:!0});var Bt=Y(),Jh=te(),KO=Ri(),HO={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>Bt._`{allowedValues: ${e}}`},BO={keyword:"enum",schemaType:"array",$data:!0,error:HO,code(e){let{gen:t,data:r,$data:n,schema:s,schemaCode:o,it:i}=e;if(!n&&s.length===0)throw Error("enum must have non-empty array");let a=s.length>=i.opts.loopEnum,c,u=()=>c!==null&&c!==void 0?c:c=Jh.useFunc(t,KO.default),d;if(a||n)d=t.let("valid"),e.block$data(d,l);else{if(!Array.isArray(s))throw Error("ajv implementation error");let f=t.const("vSchema",o);d=Bt.or(...s.map((h,m)=>p(f,m)))}e.pass(d);function l(){t.assign(d,!1),t.forOf("v",o,(f)=>t.if(Bt._`${u()}(${r}, ${f})`,()=>t.assign(d,!0).break()))}function p(f,h){let m=s[h];return typeof m==="object"&&m!==null?Bt._`${u()}(${r}, ${f}[${h}])`:Bt._`${r} === ${m}`}}};Qh.default=BO});var tm=g(function(em){Object.defineProperty(em,"__esModule",{value:!0});var YO=Sh(),XO=Rh(),JO=Nh(),QO=jh(),ZO=Dh(),eA=Uh(),tA=Vh(),rA=Bh(),nA=Xh(),sA=Zh(),oA=[YO.default,XO.default,JO.default,QO.default,ZO.default,eA.default,tA.default,rA.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},nA.default,sA.default];em.default=oA});var mu=g(function(nm){Object.defineProperty(nm,"__esModule",{value:!0});nm.validateAdditionalItems=void 0;var st=Y(),Zn=te(),aA={message:({params:{len:e}})=>st.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>st._`{limit: ${e}}`},cA={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:aA,code(e){let{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){Zn.checkStrictMode(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}rm(e,n)}};function rm(e,t){let{gen:r,schema:n,data:s,keyword:o,it:i}=e;i.items=!0;let a=r.const("len",st._`${s}.length`);if(n===!1)e.setParams({len:t.length}),e.pass(st._`${a} <= ${t.length}`);else if(typeof n=="object"&&!Zn.alwaysValidSchema(i,n)){let u=r.var("valid",st._`${a} <= ${t.length}`);r.if(st.not(u),()=>c(u)),e.ok(u)}function c(u){r.forRange("i",t.length,a,(d)=>{if(e.subschema({keyword:o,dataProp:d,dataPropType:Zn.Type.Num},u),!i.allErrors)r.if(st.not(u),()=>r.break())})}}nm.validateAdditionalItems=rm;nm.default=cA});var gu=g(function(am){Object.defineProperty(am,"__esModule",{value:!0});am.validateTuple=void 0;var Ti=Y(),Lr=te(),om=mt(),lA={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return im(e,"additionalItems",t);if(r.items=!0,Lr.alwaysValidSchema(r,t))return;e.ok(om.validateArray(e))}};function im(e,t,r=e.schema){let{gen:n,parentSchema:s,data:o,keyword:i,it:a}=e;if(d(s),a.opts.unevaluated&&r.length&&a.items!==!0)a.items=Lr.mergeEvaluated.items(n,r.length,a.items);let c=n.name("valid"),u=n.const("len",Ti._`${o}.length`);r.forEach((l,p)=>{if(Lr.alwaysValidSchema(a,l))return;n.if(Ti._`${u} > ${p}`,()=>e.subschema({keyword:i,schemaProp:p,dataProp:p},c)),e.ok(c)});function d(l){let{opts:p,errSchemaPath:f}=a,h=r.length,m=h===l.minItems&&(h===l.maxItems||l[t]===!1);if(p.strictTuples&&!m){let y=`"${i}" is ${h}-tuple, but minItems or maxItems/${t} are not specified or different at path "${f}"`;Lr.checkStrictMode(a,y,p.strictTuples)}}}am.validateTuple=im;am.default=lA});var dm=g(function(lm){Object.defineProperty(lm,"__esModule",{value:!0});var um=gu(),fA={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(e)=>um.validateTuple(e,"items")};lm.default=fA});var gm=g(function(mm){Object.defineProperty(mm,"__esModule",{value:!0});var ki=Y(),fm=te(),pm=mt(),hm=mu(),hA={message:({params:{len:e}})=>ki.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>ki._`{limit: ${e}}`},mA={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:hA,code(e){let{schema:t,parentSchema:r,it:n}=e,{prefixItems:s}=r;if(n.items=!0,fm.alwaysValidSchema(n,t))return;if(s)hm.validateAdditionalItems(e,s);else e.ok(pm.validateArray(e))}};mm.default=mA});var _m=g(function(ym){Object.defineProperty(ym,"__esModule",{value:!0});var $e=Y(),Ur=te(),yA={message:({params:{min:e,max:t}})=>t===void 0?$e.str`must contain at least ${e} valid item(s)`:$e.str`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?$e._`{minContains: ${e}}`:$e._`{minContains: ${e}, maxContains: ${t}}`},_A={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:yA,code(e){let{gen:t,schema:r,parentSchema:n,data:s,it:o}=e,i,a,{minContains:c,maxContains:u}=n;if(o.opts.next)i=c===void 0?1:c,a=u;else i=1;let d=t.const("len",$e._`${s}.length`);if(e.setParams({min:i,max:a}),a===void 0&&i===0){Ur.checkStrictMode(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&i>a){Ur.checkStrictMode(o,'"minContains" > "maxContains" is always invalid'),e.fail();return}if(Ur.alwaysValidSchema(o,r)){let m=$e._`${d} >= ${i}`;if(a!==void 0)m=$e._`${m} && ${d} <= ${a}`;e.pass(m);return}o.items=!0;let l=t.name("valid");if(a===void 0&&i===1)f(l,()=>t.if(l,()=>t.break()));else if(i===0){if(t.let(l,!0),a!==void 0)t.if($e._`${s}.length > 0`,p)}else t.let(l,!1),p();e.result(l,()=>e.reset());function p(){let m=t.name("_valid"),y=t.let("count",0);f(m,()=>t.if(m,()=>h(y)))}function f(m,y){t.forRange("i",0,d,(_)=>{e.subschema({keyword:"contains",dataProp:_,dataPropType:Ur.Type.Num,compositeRule:!0},m),y()})}function h(m){if(t.code($e._`${m}++`),a===void 0)t.if($e._`${m} >= ${i}`,()=>t.assign(l,!0).break());else if(t.if($e._`${m} > ${a}`,()=>t.assign(l,!1).break()),i===1)t.assign(l,!0);else t.if($e._`${m} >= ${i}`,()=>t.assign(l,!0))}}};ym.default=_A});var Oi=g(function(bm){Object.defineProperty(bm,"__esModule",{value:!0});bm.validateSchemaDeps=bm.validatePropertyDeps=bm.error=void 0;var es=Y(),vm=te(),Wt=mt();bm.error={message:({params:{property:e,depsCount:t,deps:r}})=>es.str`must have ${t===1?"property":"properties"} ${r} when property ${e} is present`,params:({params:{property:e,depsCount:t,deps:r,missingProperty:n}})=>es._`{property: ${e},
8
8
  missingProperty: ${n},
9
9
  depsCount: ${t},
10
- deps: ${r}}`};var $A={keyword:"dependencies",type:"object",schemaType:"object",error:wm.error,code(e){let[t,r]=EA(e);$m(e,t),Em(e,r)}};function EA({schema:e}){let t={},r={};for(let n in e){if(n==="__proto__")continue;let s=Array.isArray(e[n])?t:r;s[n]=e[n]}return[t,r]}function $m(e,t=e.schema){let{gen:r,data:n,it:s}=e;if(Object.keys(t).length===0)return;let o=r.let("missing");for(let i in t){let a=t[i];if(a.length===0)continue;let c=Wt.propertyInData(r,n,i,s.opts.ownProperties);if(e.setParams({property:i,depsCount:a.length,deps:a.join(", ")}),s.allErrors)r.if(c,()=>{for(let u of a)Wt.checkReportMissingProp(e,u)});else r.if(es._`${c} && (${Wt.checkMissingProp(e,a,o)})`),Wt.reportMissingProp(e,o),r.else()}}wm.validatePropertyDeps=$m;function Em(e,t=e.schema){let{gen:r,data:n,keyword:s,it:o}=e,i=r.name("valid");for(let a in t){if(vm.alwaysValidSchema(o,t[a]))continue;r.if(Wt.propertyInData(r,n,a,o.opts.ownProperties),()=>{let c=e.subschema({keyword:s,schemaProp:a},i);e.mergeValidEvaluated(c,i)},()=>r.var(i,!0)),e.ok(i)}}wm.validateSchemaDeps=Em;wm.default=$A});var Tm=g(function(Rm){Object.defineProperty(Rm,"__esModule",{value:!0});var Ai=Y(),xm=te(),SA={message:"property name must be valid",params:({params:e})=>Ai._`{propertyName: ${e.propertyName}}`},xA={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:SA,code(e){let{gen:t,schema:r,data:n,it:s}=e;if(xm.alwaysValidSchema(s,r))return;let o=t.name("valid");t.forIn("key",n,(i)=>{e.setParams({propertyName:i}),e.subschema({keyword:"propertyNames",data:i,dataTypes:["string"],propertyName:i,compositeRule:!0},o),t.if(Ai.not(o),()=>{if(e.error(!0),!s.allErrors)t.break()})}),e.ok(o)}};Rm.default=xA});var yu=g(function(km){Object.defineProperty(km,"__esModule",{value:!0});var Fr=mt(),ke=Y(),TA=pt(),Vr=te(),kA={message:"must NOT have additional properties",params:({params:e})=>ke._`{additionalProperty: ${e.additionalProperty}}`},OA={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:kA,code(e){let{gen:t,schema:r,parentSchema:n,data:s,errsCount:o,it:i}=e;if(!o)throw Error("ajv implementation error");let{allErrors:a,opts:c}=i;if(i.props=!0,c.removeAdditional!=="all"&&Vr.alwaysValidSchema(i,r))return;let u=Fr.allSchemaProperties(n.properties),d=Fr.allSchemaProperties(n.patternProperties);l(),e.ok(ke._`${o} === ${TA.default.errors}`);function l(){t.forIn("key",s,(y)=>{if(!u.length&&!d.length)h(y);else t.if(p(y),()=>h(y))})}function p(y){let _;if(u.length>8){let O=Vr.schemaRefOrVal(i,n.properties,"properties");_=Fr.isOwnProperty(t,O,y)}else if(u.length)_=ke.or(...u.map((O)=>ke._`${y} === ${O}`));else _=ke.nil;if(d.length)_=ke.or(_,...d.map((O)=>ke._`${Fr.usePattern(e,O)}.test(${y})`));return ke.not(_)}function f(y){t.code(ke._`delete ${s}[${y}]`)}function h(y){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){f(y);return}if(r===!1){if(e.setParams({additionalProperty:y}),e.error(),!a)t.break();return}if(typeof r=="object"&&!Vr.alwaysValidSchema(i,r)){let _=t.name("valid");if(c.removeAdditional==="failing")m(y,_,!1),t.if(ke.not(_),()=>{e.reset(),f(y)});else if(m(y,_),!a)t.if(ke.not(_),()=>t.break())}}function m(y,_,O){let T={keyword:"additionalProperties",dataProp:y,dataPropType:Vr.Type.Str};if(O===!1)Object.assign(T,{compositeRule:!0,createErrors:!1,allErrors:!1});e.subschema(T,_)}}};km.default=OA});var Nm=g(function(Pm){Object.defineProperty(Pm,"__esModule",{value:!0});var Am=Zs(),Pi=mt(),ts=te(),Om=yu(),PA={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,parentSchema:n,data:s,it:o}=e;if(o.opts.removeAdditional==="all"&&n.additionalProperties===void 0)Om.default.code(new Am.KeywordCxt(o,Om.default,"additionalProperties"));let i=Pi.allSchemaProperties(r);for(let l of i)o.definedProperties.add(l);if(o.opts.unevaluated&&i.length&&o.props!==!0)o.props=ts.mergeEvaluated.props(t,ts.toHash(i),o.props);let a=i.filter((l)=>!ts.alwaysValidSchema(o,r[l]));if(a.length===0)return;let c=t.name("valid");for(let l of a){if(u(l))d(l);else{if(t.if(Pi.propertyInData(t,s,l,o.opts.ownProperties)),d(l),!o.allErrors)t.else().var(c,!0);t.endIf()}e.it.definedProperties.add(l),e.ok(c)}function u(l){return o.opts.useDefaults&&!o.compositeRule&&r[l].default!==void 0}function d(l){e.subschema({keyword:"properties",schemaProp:l,dataProp:l},c)}}};Pm.default=PA});var Cm=g(function(Im){Object.defineProperty(Im,"__esModule",{value:!0});var Ni=mt(),zr=Y(),Ii=te(),Ci=te(),IA={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:n,parentSchema:s,it:o}=e,{opts:i}=o,a=Ni.allSchemaProperties(r),c=a.filter((m)=>Ii.alwaysValidSchema(o,r[m]));if(a.length===0||c.length===a.length&&(!o.opts.unevaluated||o.props===!0))return;let u=i.strictSchema&&!i.allowMatchingProperties&&s.properties,d=t.name("valid");if(o.props!==!0&&!(o.props instanceof zr.Name))o.props=Ci.evaluatedPropsToName(t,o.props);let{props:l}=o;p();function p(){for(let m of a){if(u)f(m);if(o.allErrors)h(m);else t.var(d,!0),h(m),t.if(d)}}function f(m){for(let y in u)if(new RegExp(m).test(y))Ii.checkStrictMode(o,`property ${y} matches pattern ${m} (use allowMatchingProperties)`)}function h(m){t.forIn("key",n,(y)=>{t.if(zr._`${Ni.usePattern(e,m)}.test(${y})`,()=>{let _=c.includes(m);if(!_)e.subschema({keyword:"patternProperties",schemaProp:m,dataProp:y,dataPropType:Ci.Type.Str},d);if(o.opts.unevaluated&&l!==!0)t.assign(zr._`${l}[${y}]`,!0);else if(!_&&!o.allErrors)t.if(zr.not(d),()=>t.break())})})}}};Im.default=IA});var Dm=g(function(qm){Object.defineProperty(qm,"__esModule",{value:!0});var jm=te(),jA={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:n}=e;if(jm.alwaysValidSchema(n,r)){e.fail();return}let s=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},s),e.failResult(s,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};qm.default=jA});var Um=g(function(Lm){Object.defineProperty(Lm,"__esModule",{value:!0});var Mm=mt(),DA={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Mm.validateUnion,error:{message:"must match a schema in anyOf"}};Lm.default=DA});var zm=g(function(Vm){Object.defineProperty(Vm,"__esModule",{value:!0});var Gr=Y(),Fm=te(),LA={message:"must match exactly one schema in oneOf",params:({params:e})=>Gr._`{passingSchemas: ${e.passing}}`},UA={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:LA,code(e){let{gen:t,schema:r,parentSchema:n,it:s}=e;if(!Array.isArray(r))throw Error("ajv implementation error");if(s.opts.discriminator&&n.discriminator)return;let o=r,i=t.let("valid",!1),a=t.let("passing",null),c=t.name("_valid");e.setParams({passing:a}),t.block(u),e.result(i,()=>e.reset(),()=>e.error(!0));function u(){o.forEach((d,l)=>{let p;if(Fm.alwaysValidSchema(s,d))t.var(c,!0);else p=e.subschema({keyword:"oneOf",schemaProp:l,compositeRule:!0},c);if(l>0)t.if(Gr._`${c} && ${i}`).assign(i,!1).assign(a,Gr._`[${a}, ${l}]`).else();t.if(c,()=>{if(t.assign(i,!0),t.assign(a,l),p)e.mergeEvaluated(p,Gr.Name)})})}}};Vm.default=UA});var Hm=g(function(Km){Object.defineProperty(Km,"__esModule",{value:!0});var Gm=te(),VA={keyword:"allOf",schemaType:"array",code(e){let{gen:t,schema:r,it:n}=e;if(!Array.isArray(r))throw Error("ajv implementation error");let s=t.name("valid");r.forEach((o,i)=>{if(Gm.alwaysValidSchema(n,o))return;let a=e.subschema({keyword:"allOf",schemaProp:i},s);e.ok(s),e.mergeEvaluated(a)})}};Km.default=VA});var Ym=g(function(Wm){Object.defineProperty(Wm,"__esModule",{value:!0});var Kr=Y(),ji=te(),GA={message:({params:e})=>Kr.str`must match "${e.ifClause}" schema`,params:({params:e})=>Kr._`{failingKeyword: ${e.ifClause}}`},KA={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:GA,code(e){let{gen:t,parentSchema:r,it:n}=e;if(r.then===void 0&&r.else===void 0)ji.checkStrictMode(n,'"if" without "then" and "else" is ignored');let s=Bm(n,"then"),o=Bm(n,"else");if(!s&&!o)return;let i=t.let("valid",!0),a=t.name("_valid");if(c(),e.reset(),s&&o){let d=t.let("ifClause");e.setParams({ifClause:d}),t.if(a,u("then",d),u("else",d))}else if(s)t.if(a,u("then"));else t.if(Kr.not(a),u("else"));e.pass(i,()=>e.error(!0));function c(){let d=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);e.mergeEvaluated(d)}function u(d,l){return()=>{let p=e.subschema({keyword:d},a);if(t.assign(i,a),e.mergeValidEvaluated(p,i),l)t.assign(l,Kr._`${d}`);else e.setParams({ifClause:d})}}}};function Bm(e,t){let r=e.schema[t];return r!==void 0&&!ji.alwaysValidSchema(e,r)}Wm.default=KA});var Qm=g(function(Jm){Object.defineProperty(Jm,"__esModule",{value:!0});var Xm=te(),BA={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){if(t.if===void 0)Xm.checkStrictMode(r,`"${e}" without "if" is ignored`)}};Jm.default=BA});var eg=g(function(Zm){Object.defineProperty(Zm,"__esModule",{value:!0});var YA=mu(),XA=dm(),JA=gu(),QA=gm(),ZA=_m(),eP=Oi(),tP=Tm(),rP=yu(),nP=Nm(),sP=Cm(),oP=Dm(),iP=Um(),aP=zm(),cP=Hm(),uP=Ym(),lP=Qm();function dP(e=!1){let t=[oP.default,iP.default,aP.default,cP.default,uP.default,lP.default,tP.default,rP.default,eP.default,nP.default,sP.default];if(e)t.push(XA.default,QA.default);else t.push(YA.default,JA.default);return t.push(ZA.default),t}Zm.default=dP});var _u=g(function(ng){Object.defineProperty(ng,"__esModule",{value:!0});ng.dynamicAnchor=void 0;var rs=Y(),pP=pt(),qi=ro(),tg=Si(),hP={keyword:"$dynamicAnchor",schemaType:"string",code:(e)=>rg(e,e.schema)};function rg(e,t){let{gen:r,it:n}=e;n.schemaEnv.root.dynamicAnchors[t]=!0;let s=rs._`${pP.default.dynamicAnchors}${rs.getProperty(t)}`,o=n.errSchemaPath==="#"?n.validateName:mP(e);r.if(rs._`!${s}`,()=>r.assign(s,o))}ng.dynamicAnchor=rg;function mP(e){let{schemaEnv:t,schema:r,self:n}=e.it,{root:s,baseId:o,localRefs:i,meta:a}=t.root,{schemaId:c}=n.opts,u=new qi.SchemaEnv({schema:r,schemaId:c,root:s,baseId:o,localRefs:i,meta:a});return qi.compileSchema.call(n,u),tg.getValidate(e,u)}ng.default=hP});var vu=g(function(ig){Object.defineProperty(ig,"__esModule",{value:!0});ig.dynamicRef=void 0;var Di=Y(),yP=pt(),Mi=Si(),_P={keyword:"$dynamicRef",schemaType:"string",code:(e)=>og(e,e.schema)};function og(e,t){let{gen:r,keyword:n,it:s}=e;if(t[0]!=="#")throw Error(`"${n}" only supports hash fragment reference`);let o=t.slice(1);if(s.allErrors)i();else{let c=r.let("valid",!1);i(c),e.ok(c)}function i(c){if(s.schemaEnv.root.dynamicAnchors[o]){let u=r.let("_v",Di._`${yP.default.dynamicAnchors}${Di.getProperty(o)}`);r.if(u,a(u,c),a(s.validateName,c))}else a(s.validateName,c)()}function a(c,u){return u?()=>r.block(()=>{Mi.callRef(e,c),r.let(u,!0)}):()=>Mi.callRef(e,c)}}ig.dynamicRef=og;ig.default=_P});var dg=g(function(lg){Object.defineProperty(lg,"__esModule",{value:!0});var cg=_u(),ug=te(),$P={keyword:"$recursiveAnchor",schemaType:"boolean",code(e){if(e.schema)cg.dynamicAnchor(e,"");else ug.checkStrictMode(e.it,"$recursiveAnchor: false is ignored")}};lg.default=$P});var hg=g(function(pg){Object.defineProperty(pg,"__esModule",{value:!0});var fg=vu(),wP={keyword:"$recursiveRef",schemaType:"string",code:(e)=>fg.dynamicRef(e,e.schema)};pg.default=wP});var gg=g(function(mg){Object.defineProperty(mg,"__esModule",{value:!0});var SP=_u(),xP=vu(),RP=dg(),TP=hg(),kP=[SP.default,xP.default,RP.default,TP.default];mg.default=kP});var _g=g(function(yg){Object.defineProperty(yg,"__esModule",{value:!0});var Li=Oi(),AP={keyword:"dependentRequired",type:"object",schemaType:"object",error:Li.error,code:(e)=>Li.validatePropertyDeps(e)};yg.default=AP});var Eg=g(function($g){Object.defineProperty($g,"__esModule",{value:!0});var vg=Oi(),NP={keyword:"dependentSchemas",type:"object",schemaType:"object",code:(e)=>vg.validateSchemaDeps(e)};$g.default=NP});var Sg=g(function(bg){Object.defineProperty(bg,"__esModule",{value:!0});var wg=te(),CP={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:e,parentSchema:t,it:r}){if(t.contains===void 0)wg.checkStrictMode(r,`"${e}" without "contains" is ignored`)}};bg.default=CP});var Rg=g(function(xg){Object.defineProperty(xg,"__esModule",{value:!0});var qP=_g(),DP=Eg(),MP=Sg(),LP=[qP.default,DP.default,MP.default];xg.default=LP});var kg=g(function(Tg){Object.defineProperty(Tg,"__esModule",{value:!0});var Ge=Y(),Ui=te(),FP=pt(),VP={message:"must NOT have unevaluated properties",params:({params:e})=>Ge._`{unevaluatedProperty: ${e.unevaluatedProperty}}`},zP={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:VP,code(e){let{gen:t,schema:r,data:n,errsCount:s,it:o}=e;if(!s)throw Error("ajv implementation error");let{allErrors:i,props:a}=o;if(a instanceof Ge.Name)t.if(Ge._`${a} !== true`,()=>t.forIn("key",n,(l)=>t.if(u(a,l),()=>c(l))));else if(a!==!0)t.forIn("key",n,(l)=>a===void 0?c(l):t.if(d(a,l),()=>c(l)));o.props=!0,e.ok(Ge._`${s} === ${FP.default.errors}`);function c(l){if(r===!1){if(e.setParams({unevaluatedProperty:l}),e.error(),!i)t.break();return}if(!Ui.alwaysValidSchema(o,r)){let p=t.name("valid");if(e.subschema({keyword:"unevaluatedProperties",dataProp:l,dataPropType:Ui.Type.Str},p),!i)t.if(Ge.not(p),()=>t.break())}}function u(l,p){return Ge._`!${l} || !${l}[${p}]`}function d(l,p){let f=[];for(let h in l)if(l[h]===!0)f.push(Ge._`${p} !== ${h}`);return Ge.and(...f)}}};Tg.default=zP});var Ag=g(function(Og){Object.defineProperty(Og,"__esModule",{value:!0});var ot=Y(),Fi=te(),KP={message:({params:{len:e}})=>ot.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>ot._`{limit: ${e}}`},HP={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:KP,code(e){let{gen:t,schema:r,data:n,it:s}=e,o=s.items||0;if(o===!0)return;let i=t.const("len",ot._`${n}.length`);if(r===!1)e.setParams({len:o}),e.fail(ot._`${i} > ${o}`);else if(typeof r=="object"&&!Fi.alwaysValidSchema(s,r)){let c=t.var("valid",ot._`${i} <= ${o}`);t.if(ot.not(c),()=>a(c,o)),e.ok(c)}s.items=!0;function a(c,u){t.forRange("i",u,i,(d)=>{if(e.subschema({keyword:"unevaluatedItems",dataProp:d,dataPropType:Fi.Type.Num},c),!s.allErrors)t.if(ot.not(c),()=>t.break())})}}};Og.default=HP});var Ng=g(function(Pg){Object.defineProperty(Pg,"__esModule",{value:!0});var WP=kg(),YP=Ag(),XP=[WP.default,YP.default];Pg.default=XP});var Cg=g(function(Ig){Object.defineProperty(Ig,"__esModule",{value:!0});var X=Y(),QP={message:({schemaCode:e})=>X.str`must match format "${e}"`,params:({schemaCode:e})=>X._`{format: ${e}}`},ZP={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:QP,code(e,t){let{gen:r,data:n,$data:s,schema:o,schemaCode:i,it:a}=e,{opts:c,errSchemaPath:u,schemaEnv:d,self:l}=a;if(!c.validateFormats)return;if(s)p();else f();function p(){let h=r.scopeValue("formats",{ref:l.formats,code:c.code.formats}),m=r.const("fDef",X._`${h}[${i}]`),y=r.let("fType"),_=r.let("format");r.if(X._`typeof ${m} == "object" && !(${m} instanceof RegExp)`,()=>r.assign(y,X._`${m}.type || "string"`).assign(_,X._`${m}.validate`),()=>r.assign(y,X._`"string"`).assign(_,m)),e.fail$data(X.or(O(),T()));function O(){if(c.strictSchema===!1)return X.nil;return X._`${i} && !${_}`}function T(){let M=d.$async?X._`(${m}.async ? await ${_}(${n}) : ${_}(${n}))`:X._`${_}(${n})`,S=X._`(typeof ${_} == "function" ? ${M} : ${_}.test(${n}))`;return X._`${_} && ${_} !== true && ${y} === ${t} && !${S}`}}function f(){let h=l.formats[o];if(!h){O();return}if(h===!0)return;let[m,y,_]=T(h);if(m===t)e.pass(M());function O(){if(c.strictSchema===!1){l.logger.warn(S());return}throw Error(S());function S(){return`unknown format "${o}" ignored in schema at path "${u}"`}}function T(S){let _e=S instanceof RegExp?X.regexpCode(S):c.code.formats?X._`${c.code.formats}${X.getProperty(o)}`:void 0,ve=r.scopeValue("formats",{key:o,ref:S,code:_e});if(typeof S=="object"&&!(S instanceof RegExp))return[S.type||"string",S.validate,X._`${ve}.validate`];return["string",S,ve]}function M(){if(typeof h=="object"&&!(h instanceof RegExp)&&h.async){if(!d.$async)throw Error("async format in sync schema");return X._`await ${_}(${n})`}return typeof y=="function"?X._`${_}(${n})`:X._`${_}.test(${n})`}}}};Ig.default=ZP});var qg=g(function(jg){Object.defineProperty(jg,"__esModule",{value:!0});var tN=Cg(),rN=[tN.default];jg.default=rN});var Lg=g(function(Dg){Object.defineProperty(Dg,"__esModule",{value:!0});Dg.contentVocabulary=Dg.metadataVocabulary=void 0;Dg.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Dg.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var Fg=g(function(Ug){Object.defineProperty(Ug,"__esModule",{value:!0});var oN=wh(),iN=tm(),aN=eg(),cN=gg(),uN=Rg(),lN=Ng(),dN=qg(),Vi=Lg(),fN=[cN.default,oN.default,iN.default,(0,aN.default)(!0),dN.default,Vi.metadataVocabulary,Vi.contentVocabulary,uN.default,lN.default];Ug.default=fN});var Kg=g(function(zg){Object.defineProperty(zg,"__esModule",{value:!0});zg.DiscrError=void 0;var Vg;(function(e){e.Tag="tag",e.Mapping="mapping"})(Vg||(zg.DiscrError=Vg={}))});var Wg=g(function(Bg){Object.defineProperty(Bg,"__esModule",{value:!0});var gt=Y(),ns=Kg(),zi=ro(),hN=eo(),Hg=te(),mN={message:({params:{discrError:e,tagName:t}})=>e===ns.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>gt._`{error: ${e}, tag: ${r}, tagValue: ${t}}`},gN={keyword:"discriminator",type:"object",schemaType:"object",error:mN,code(e){let{gen:t,data:r,schema:n,parentSchema:s,it:o}=e,{oneOf:i}=s;if(!o.opts.discriminator)throw Error("discriminator: requires discriminator option");let a=n.propertyName;if(typeof a!="string")throw Error("discriminator: requires propertyName");if(n.mapping)throw Error("discriminator: mapping is not supported");if(!i)throw Error("discriminator: requires oneOf keyword");let c=t.let("valid",!1),u=t.const("tag",gt._`${r}${gt.getProperty(a)}`);t.if(gt._`typeof ${u} == "string"`,()=>d(),()=>e.error(!1,{discrError:ns.DiscrError.Tag,tag:u,tagName:a})),e.ok(c);function d(){let f=p();t.if(!1);for(let h in f)t.elseIf(gt._`${u} === ${h}`),t.assign(c,l(f[h]));t.else(),e.error(!1,{discrError:ns.DiscrError.Mapping,tag:u,tagName:a}),t.endIf()}function l(f){let h=t.name("valid"),m=e.subschema({keyword:"oneOf",schemaProp:f},h);return e.mergeEvaluated(m,gt.Name),h}function p(){var f;let h={},m=_(s),y=!0;for(let M=0;M<i.length;M++){let S=i[M];if((S===null||S===void 0?void 0:S.$ref)&&!Hg.schemaHasRulesButRef(S,o.self.RULES)){let ve=S.$ref;if(S=zi.resolveRef.call(o.self,o.schemaEnv.root,o.baseId,ve),S instanceof zi.SchemaEnv)S=S.schema;if(S===void 0)throw new hN.default(o.opts.uriResolver,o.baseId,ve)}let _e=(f=S===null||S===void 0?void 0:S.properties)===null||f===void 0?void 0:f[a];if(typeof _e!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);y=y&&(m||_(S)),O(_e,M)}if(!y)throw Error(`discriminator: "${a}" must be required`);return h;function _({required:M}){return Array.isArray(M)&&M.includes(a)}function O(M,S){if(M.const)T(M.const,S);else if(M.enum)for(let _e of M.enum)T(_e,S);else throw Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function T(M,S){if(typeof M!="string"||M in h)throw Error(`discriminator: "${a}" values must be unique strings`);h[M]=S}}}};Bg.default=gN});var Yg=g(function(mG,_N){_N.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/schema",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],type:["object","boolean"],$comment:"This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",properties:{definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:!0,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',type:"object",additionalProperties:{anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs/stringArray"}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:!0},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:!0}}}});var Xg=g(function(gG,vN){vN.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/applicator":!0},$dynamicAnchor:"meta",title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"#meta"},properties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$dynamicRef:"#meta"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}}}});var Jg=g(function(yG,$N){$N.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/unevaluated",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},$dynamicAnchor:"meta",title:"Unevaluated applicator vocabulary meta-schema",type:["object","boolean"],properties:{unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}}}});var Qg=g(function(_G,EN){EN.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/content",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}}}});var Zg=g(function(vG,wN){wN.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/core",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0},$dynamicAnchor:"meta",title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},$defs:{anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}}}});var ey=g(function($G,bN){bN.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/format-annotation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},$dynamicAnchor:"meta",title:"Format vocabulary meta-schema for annotation results",type:["object","boolean"],properties:{format:{type:"string"}}}});var ty=g(function(EG,SN){SN.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},$dynamicAnchor:"meta",title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}});var ry=g(function(wG,xN){xN.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/validation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/validation":!0},$dynamicAnchor:"meta",title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}});var sy=g(function(ny){Object.defineProperty(ny,"__esModule",{value:!0});var RN=Yg(),TN=Xg(),kN=Jg(),ON=Qg(),AN=Zg(),PN=ey(),NN=ty(),IN=ry(),CN=["/properties"];function jN(e){return[RN,TN,kN,ON,AN,t(this,PN),NN,t(this,IN)].forEach((r)=>this.addMetaSchema(r,void 0,!1)),this;function t(r,n){return e?r.$dataMetaSchema(n,CN):n}}ny.default=jN});var oy=g(function(it,Eu){Object.defineProperty(it,"__esModule",{value:!0});it.MissingRefError=it.ValidationError=it.CodeGen=it.Name=it.nil=it.stringify=it.str=it._=it.KeywordCxt=it.Ajv2020=void 0;var DN=mh(),MN=Fg(),LN=Wg(),UN=sy(),$u="https://json-schema.org/draft/2020-12/schema";class so extends DN.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),MN.default.forEach((e)=>this.addVocabulary(e)),this.opts.discriminator)this.addKeyword(LN.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:e,meta:t}=this.opts;if(!t)return;UN.default.call(this,e),this.refs["http://json-schema.org/schema"]=$u}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema($u)?$u:void 0)}}it.Ajv2020=so;Eu.exports=it=so;Eu.exports.Ajv2020=so;Object.defineProperty(it,"__esModule",{value:!0});it.default=so;var FN=Zs();Object.defineProperty(it,"KeywordCxt",{enumerable:!0,get:function(){return FN.KeywordCxt}});var ss=Y();Object.defineProperty(it,"_",{enumerable:!0,get:function(){return ss._}});Object.defineProperty(it,"str",{enumerable:!0,get:function(){return ss.str}});Object.defineProperty(it,"stringify",{enumerable:!0,get:function(){return ss.stringify}});Object.defineProperty(it,"nil",{enumerable:!0,get:function(){return ss.nil}});Object.defineProperty(it,"Name",{enumerable:!0,get:function(){return ss.Name}});Object.defineProperty(it,"CodeGen",{enumerable:!0,get:function(){return ss.CodeGen}});var VN=pi();Object.defineProperty(it,"ValidationError",{enumerable:!0,get:function(){return VN.default}});var zN=eo();Object.defineProperty(it,"MissingRefError",{enumerable:!0,get:function(){return zN.default}})});var my=g(function(py){Object.defineProperty(py,"__esModule",{value:!0});py.formatNames=py.fastFormats=py.fullFormats=void 0;function Yt(e,t){return{validate:e,compare:t}}py.fullFormats={date:Yt(uy,xu),time:Yt(bu(!0),Ru),"date-time":Yt(iy(!0),dy),"iso-time":Yt(bu(),ly),"iso-date-time":Yt(iy(),fy),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:JN,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:sI,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:QN,int32:{type:"number",validate:tI},int64:{type:"number",validate:rI},float:{type:"number",validate:cy},double:{type:"number",validate:cy},password:!0,binary:!0};py.fastFormats={...py.fullFormats,date:Yt(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,xu),time:Yt(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,Ru),"date-time":Yt(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,dy),"iso-time":Yt(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,ly),"iso-date-time":Yt(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,fy),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};py.formatNames=Object.keys(py.fullFormats);function HN(e){return e%4===0&&(e%100!==0||e%400===0)}var BN=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,WN=[0,31,28,31,30,31,30,31,31,30,31,30,31];function uy(e){let t=BN.exec(e);if(!t)return!1;let r=+t[1],n=+t[2],s=+t[3];return n>=1&&n<=12&&s>=1&&s<=(n===2&&HN(r)?29:WN[n])}function xu(e,t){if(!(e&&t))return;if(e>t)return 1;if(e<t)return-1;return 0}var wu=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function bu(e){return function(r){let n=wu.exec(r);if(!n)return!1;let s=+n[1],o=+n[2],i=+n[3],a=n[4],c=n[5]==="-"?-1:1,u=+(n[6]||0),d=+(n[7]||0);if(u>23||d>59||e&&!a)return!1;if(s<=23&&o<=59&&i<60)return!0;let l=o-d*c,p=s-u*c-(l<0?1:0);return(p===23||p===-1)&&(l===59||l===-1)&&i<61}}function Ru(e,t){if(!(e&&t))return;let r=new Date("2020-01-01T"+e).valueOf(),n=new Date("2020-01-01T"+t).valueOf();if(!(r&&n))return;return r-n}function ly(e,t){if(!(e&&t))return;let r=wu.exec(e),n=wu.exec(t);if(!(r&&n))return;if(e=r[1]+r[2]+r[3],t=n[1]+n[2]+n[3],e>t)return 1;if(e<t)return-1;return 0}var Su=/t|\s/i;function iy(e){let t=bu(e);return function(n){let s=n.split(Su);return s.length===2&&uy(s[0])&&t(s[1])}}function dy(e,t){if(!(e&&t))return;let r=new Date(e).valueOf(),n=new Date(t).valueOf();if(!(r&&n))return;return r-n}function fy(e,t){if(!(e&&t))return;let[r,n]=e.split(Su),[s,o]=t.split(Su),i=xu(r,s);if(i===void 0)return;return i||Ru(n,o)}var YN=/\/|:/,XN=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function JN(e){return YN.test(e)&&XN.test(e)}var ay=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function QN(e){return ay.lastIndex=0,ay.test(e)}var ZN=-2147483648,eI=2147483647;function tI(e){return Number.isInteger(e)&&e<=eI&&e>=ZN}function rI(e){return Number.isInteger(e)}function cy(){return!0}var nI=/[^\\]\\Z/;function sI(e){if(nI.test(e))return!1;try{return new RegExp(e),!0}catch(t){return!1}}});var io=g(function(_y){Object.defineProperty(_y,"__esModule",{value:!0});_y.regexpCode=_y.getEsmExportName=_y.getProperty=_y.safeStringify=_y.stringify=_y.strConcat=_y.addCodeArg=_y.str=_y._=_y.nil=_y._Code=_y.Name=_y.IDENTIFIER=_y._CodeOrName=void 0;class Gi{}_y._CodeOrName=Gi;_y.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class os extends Gi{constructor(e){super();if(!_y.IDENTIFIER.test(e))throw Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}_y.Name=os;class kt extends Gi{constructor(e){super();this._items=typeof e==="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((t,r)=>`${t}${r}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((t,r)=>{if(r instanceof os)t[r.str]=(t[r.str]||0)+1;return t},{})}}_y._Code=kt;_y.nil=new kt("");function gy(e,...t){let r=[e[0]],n=0;while(n<t.length)Ou(r,t[n]),r.push(e[++n]);return new kt(r)}_y._=gy;var ku=new kt("+");function yy(e,...t){let r=[oo(e[0])],n=0;while(n<t.length)r.push(ku),Ou(r,t[n]),r.push(ku,oo(e[++n]));return iI(r),new kt(r)}_y.str=yy;function Ou(e,t){if(t instanceof kt)e.push(...t._items);else if(t instanceof os)e.push(t);else e.push(uI(t))}_y.addCodeArg=Ou;function iI(e){let t=1;while(t<e.length-1){if(e[t]===ku){let r=aI(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function aI(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string"){if(t instanceof os||e[e.length-1]!=='"')return;if(typeof t!="string")return`${e.slice(0,-1)}${t}"`;if(t[0]==='"')return e.slice(0,-1)+t.slice(1);return}if(typeof t=="string"&&t[0]==='"'&&!(e instanceof os))return`"${e}${t.slice(1)}`;return}function cI(e,t){return t.emptyStr()?e:e.emptyStr()?t:yy`${e}${t}`}_y.strConcat=cI;function uI(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:oo(Array.isArray(e)?e.join(","):e)}function lI(e){return new kt(oo(e))}_y.stringify=lI;function oo(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}_y.safeStringify=oo;function dI(e){return typeof e=="string"&&_y.IDENTIFIER.test(e)?new kt(`.${e}`):gy`[${e}]`}_y.getProperty=dI;function fI(e){if(typeof e=="string"&&_y.IDENTIFIER.test(e))return new kt(`${e}`);throw Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}_y.getEsmExportName=fI;function pI(e){return new kt(e.toString())}_y.regexpCode=pI});var Iu=g(function(wy){Object.defineProperty(wy,"__esModule",{value:!0});wy.ValueScope=wy.ValueScopeName=wy.Scope=wy.varKinds=wy.UsedValueState=void 0;var me=io();class $y extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`);this.value=e.value}}var Hi;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(Hi||(wy.UsedValueState=Hi={}));wy.varKinds={const:new me.Name("const"),let:new me.Name("let"),var:new me.Name("var")};class Pu{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof me.Name?e:this.name(e)}name(e){return new me.Name(this._newName(e))}_newName(e){let t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){var t,r;if(((r=(t=this._parent)===null||t===void 0?void 0:t._prefixes)===null||r===void 0?void 0:r.has(e))||this._prefixes&&!this._prefixes.has(e))throw Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}wy.Scope=Pu;class Nu extends me.Name{constructor(e,t){super(t);this.prefix=e}setValue(e,{property:t,itemIndex:r}){this.value=e,this.scopePath=me._`.${new me.Name(t)}[${r}]`}}wy.ValueScopeName=Nu;var RI=me._`\n`;class Ey extends Pu{constructor(e){super(e);this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?RI:me.nil}}get(){return this._scope}name(e){return new Nu(e,this._newName(e))}value(e,t){var r;if(t.ref===void 0)throw Error("CodeGen: ref must be passed in value");let n=this.toName(e),{prefix:s}=n,o=(r=t.key)!==null&&r!==void 0?r:t.ref,i=this._values[s];if(i){let u=i.get(o);if(u)return u}else i=this._values[s]=new Map;i.set(o,n);let a=this._scope[s]||(this._scope[s]=[]),c=a.length;return a[c]=t.ref,n.setValue(t,{property:s,itemIndex:c}),n}getValue(e,t){let r=this._values[e];if(!r)return;return r.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,(r)=>{if(r.scopePath===void 0)throw Error(`CodeGen: name "${r}" has no value`);return me._`${e}${r.scopePath}`})}scopeCode(e=this._values,t,r){return this._reduceValues(e,(n)=>{if(n.value===void 0)throw Error(`CodeGen: name "${n}" has no value`);return n.value.code},t,r)}_reduceValues(e,t,r={},n){let s=me.nil;for(let o in e){let i=e[o];if(!i)continue;let a=r[o]=r[o]||new Map;i.forEach((c)=>{if(a.has(c))return;a.set(c,Hi.Started);let u=t(c);if(u){let d=this.opts.es5?wy.varKinds.var:wy.varKinds.const;s=me._`${s}${d} ${c} = ${u};${this.opts._n}`}else if(u=n===null||n===void 0?void 0:n(c))s=me._`${s}${u}${this.opts._n}`;else throw new $y(c);a.set(c,Hi.Completed)})}return s}}wy.ValueScope=Ey});var Z=g(function(at){Object.defineProperty(at,"__esModule",{value:!0});at.or=at.and=at.not=at.CodeGen=at.operators=at.varKinds=at.ValueScopeName=at.ValueScope=at.Scope=at.Name=at.regexpCode=at.stringify=at.getProperty=at.nil=at.strConcat=at.str=at._=void 0;var P=io(),Oe=Iu(),Hr=io();Object.defineProperty(at,"_",{enumerable:!0,get:function(){return Hr._}});Object.defineProperty(at,"str",{enumerable:!0,get:function(){return Hr.str}});Object.defineProperty(at,"strConcat",{enumerable:!0,get:function(){return Hr.strConcat}});Object.defineProperty(at,"nil",{enumerable:!0,get:function(){return Hr.nil}});Object.defineProperty(at,"getProperty",{enumerable:!0,get:function(){return Hr.getProperty}});Object.defineProperty(at,"stringify",{enumerable:!0,get:function(){return Hr.stringify}});Object.defineProperty(at,"regexpCode",{enumerable:!0,get:function(){return Hr.regexpCode}});Object.defineProperty(at,"Name",{enumerable:!0,get:function(){return Hr.Name}});var Qi=Iu();Object.defineProperty(at,"Scope",{enumerable:!0,get:function(){return Qi.Scope}});Object.defineProperty(at,"ValueScope",{enumerable:!0,get:function(){return Qi.ValueScope}});Object.defineProperty(at,"ValueScopeName",{enumerable:!0,get:function(){return Qi.ValueScopeName}});Object.defineProperty(at,"varKinds",{enumerable:!0,get:function(){return Qi.varKinds}});at.operators={GT:new P._Code(">"),GTE:new P._Code(">="),LT:new P._Code("<"),LTE:new P._Code("<="),EQ:new P._Code("==="),NEQ:new P._Code("!=="),NOT:new P._Code("!"),OR:new P._Code("||"),AND:new P._Code("&&"),ADD:new P._Code("+")};class Br{optimizeNodes(){return this}optimizeNames(e,t){return this}}class Sy extends Br{constructor(e,t,r){super();this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){let r=e?Oe.varKinds.var:this.varKind,n=this.rhs===void 0?"":` = ${this.rhs}`;return`${r} ${this.name}${n};`+t}optimizeNames(e,t){if(!e[this.name.str])return;if(this.rhs)this.rhs=as(this.rhs,e,t);return this}get names(){return this.rhs instanceof P._CodeOrName?this.rhs.names:{}}}class qu extends Br{constructor(e,t,r){super();this.lhs=e,this.rhs=t,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(this.lhs instanceof P.Name&&!e[this.lhs.str]&&!this.sideEffects)return;return this.rhs=as(this.rhs,e,t),this}get names(){let e=this.lhs instanceof P.Name?{}:{...this.lhs.names};return Ji(e,this.rhs)}}class xy extends qu{constructor(e,t,r,n){super(e,r,n);this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class Ry extends Br{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class Ty extends Br{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class ky extends Br{constructor(e){super();this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class Oy extends Br{constructor(e){super();this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=as(this.code,e,t),this}get names(){return this.code instanceof P._CodeOrName?this.code.names:{}}}class Zi extends Br{constructor(e=[]){super();this.nodes=e}render(e){return this.nodes.reduce((t,r)=>t+r.render(e),"")}optimizeNodes(){let{nodes:e}=this,t=e.length;while(t--){let r=e[t].optimizeNodes();if(Array.isArray(r))e.splice(t,1,...r);else if(r)e[t]=r;else e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){let{nodes:r}=this,n=r.length;while(n--){let s=r[n];if(s.optimizeNames(e,t))continue;AI(e,s.names),r.splice(n,1)}return r.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>bn(e,t.names),{})}}class Wr extends Zi{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class Ay extends Zi{}class ao extends Wr{}ao.kind="else";class _r extends Wr{constructor(e,t){super(t);this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);if(this.else)t+="else "+this.else.render(e);return t}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let t=this.else;if(t){let r=t.optimizeNodes();t=this.else=Array.isArray(r)?new ao(r):r}if(t){if(e===!1)return t instanceof _r?t:t.nodes;if(this.nodes.length)return this;return new _r(jy(e),t instanceof _r?[t]:t.nodes)}if(e===!1||!this.nodes.length)return;return this}optimizeNames(e,t){var r;if(this.else=(r=this.else)===null||r===void 0?void 0:r.optimizeNames(e,t),!(super.optimizeNames(e,t)||this.else))return;return this.condition=as(this.condition,e,t),this}get names(){let e=super.names;if(Ji(e,this.condition),this.else)bn(e,this.else.names);return e}}_r.kind="if";class is extends Wr{}is.kind="for";class Py extends is{constructor(e){super();this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(!super.optimizeNames(e,t))return;return this.iteration=as(this.iteration,e,t),this}get names(){return bn(super.names,this.iteration.names)}}class Ny extends is{constructor(e,t,r,n){super();this.varKind=e,this.name=t,this.from=r,this.to=n}render(e){let t=e.es5?Oe.varKinds.var:this.varKind,{name:r,from:n,to:s}=this;return`for(${t} ${r}=${n}; ${r}<${s}; ${r}++)`+super.render(e)}get names(){let e=Ji(super.names,this.from);return Ji(e,this.to)}}class Cu extends is{constructor(e,t,r,n){super();this.loop=e,this.varKind=t,this.name=r,this.iterable=n}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(!super.optimizeNames(e,t))return;return this.iterable=as(this.iterable,e,t),this}get names(){return bn(super.names,this.iterable.names)}}class Bi extends Wr{constructor(e,t,r){super();this.name=e,this.args=t,this.async=r}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}Bi.kind="func";class Wi extends Zi{render(e){return"return "+super.render(e)}}Wi.kind="return";class Iy extends Wr{render(e){let t="try"+super.render(e);if(this.catch)t+=this.catch.render(e);if(this.finally)t+=this.finally.render(e);return t}optimizeNodes(){var e,t;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(t=this.finally)===null||t===void 0||t.optimizeNodes(),this}optimizeNames(e,t){var r,n;return super.optimizeNames(e,t),(r=this.catch)===null||r===void 0||r.optimizeNames(e,t),(n=this.finally)===null||n===void 0||n.optimizeNames(e,t),this}get names(){let e=super.names;if(this.catch)bn(e,this.catch.names);if(this.finally)bn(e,this.finally.names);return e}}class Yi extends Wr{constructor(e){super();this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}Yi.kind="catch";class Xi extends Wr{render(e){return"finally"+super.render(e)}}Xi.kind="finally";class Cy{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?`
11
- `:""},this._extScope=e,this._scope=new Oe.Scope({parent:e}),this._nodes=[new Ay]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){let r=this._extScope.value(e,t);return(this._values[r.prefix]||(this._values[r.prefix]=new Set)).add(r),r}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,r,n){let s=this._scope.toName(t);if(r!==void 0&&n)this._constants[s.str]=r;return this._leafNode(new Sy(e,s,r)),s}const(e,t,r){return this._def(Oe.varKinds.const,e,t,r)}let(e,t,r){return this._def(Oe.varKinds.let,e,t,r)}var(e,t,r){return this._def(Oe.varKinds.var,e,t,r)}assign(e,t,r){return this._leafNode(new qu(e,t,r))}add(e,t){return this._leafNode(new xy(e,at.operators.ADD,t))}code(e){if(typeof e=="function")e();else if(e!==P.nil)this._leafNode(new Oy(e));return this}object(...e){let t=["{"];for(let[r,n]of e){if(t.length>1)t.push(",");if(t.push(r),r!==n||this.opts.es5)t.push(":"),P.addCodeArg(t,n)}return t.push("}"),new P._Code(t)}if(e,t,r){if(this._blockNode(new _r(e)),t&&r)this.code(t).else().code(r).endIf();else if(t)this.code(t).endIf();else if(r)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new _r(e))}else(){return this._elseNode(new ao)}endIf(){return this._endBlockNode(_r,ao)}_for(e,t){if(this._blockNode(e),t)this.code(t).endFor();return this}for(e,t){return this._for(new Py(e),t)}forRange(e,t,r,n,s=this.opts.es5?Oe.varKinds.var:Oe.varKinds.let){let o=this._scope.toName(e);return this._for(new Ny(s,o,t,r),()=>n(o))}forOf(e,t,r,n=Oe.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let o=t instanceof P.Name?t:this.var("_arr",t);return this.forRange("_i",0,P._`${o}.length`,(i)=>{this.var(s,P._`${o}[${i}]`),r(s)})}return this._for(new Cu("of",n,s,t),()=>r(s))}forIn(e,t,r,n=this.opts.es5?Oe.varKinds.var:Oe.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,P._`Object.keys(${t})`,r);let s=this._scope.toName(e);return this._for(new Cu("in",n,s,t),()=>r(s))}endFor(){return this._endBlockNode(is)}label(e){return this._leafNode(new Ry(e))}break(e){return this._leafNode(new Ty(e))}return(e){let t=new Wi;if(this._blockNode(t),this.code(e),t.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(Wi)}try(e,t,r){if(!t&&!r)throw Error('CodeGen: "try" without "catch" and "finally"');let n=new Iy;if(this._blockNode(n),this.code(e),t){let s=this.name("e");this._currNode=n.catch=new Yi(s),t(s)}if(r)this._currNode=n.finally=new Xi,this.code(r);return this._endBlockNode(Yi,Xi)}throw(e){return this._leafNode(new ky(e))}block(e,t){if(this._blockStarts.push(this._nodes.length),e)this.code(e).endBlock(t);return this}endBlock(e){let t=this._blockStarts.pop();if(t===void 0)throw Error("CodeGen: not in self-balancing block");let r=this._nodes.length-t;if(r<0||e!==void 0&&r!==e)throw Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=P.nil,r,n){if(this._blockNode(new Bi(e,t,r)),n)this.code(n).endFunc();return this}endFunc(){return this._endBlockNode(Bi)}optimize(e=1){while(e-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){let r=this._currNode;if(r instanceof e||t&&r instanceof t)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){let t=this._currNode;if(!(t instanceof _r))throw Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let t=this._nodes;t[t.length-1]=e}}at.CodeGen=Cy;function bn(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function Ji(e,t){return t instanceof P._CodeOrName?bn(e,t.names):e}function as(e,t,r){if(e instanceof P.Name)return n(e);if(!s(e))return e;return new P._Code(e._items.reduce((o,i)=>{if(i instanceof P.Name)i=n(i);if(i instanceof P._Code)o.push(...i._items);else o.push(i);return o},[]));function n(o){let i=r[o.str];if(i===void 0||t[o.str]!==1)return o;return delete t[o.str],i}function s(o){return o instanceof P._Code&&o._items.some((i)=>i instanceof P.Name&&t[i.str]===1&&r[i.str]!==void 0)}}function AI(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}function jy(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:P._`!${ju(e)}`}at.not=jy;var PI=qy(at.operators.AND);function NI(...e){return e.reduce(PI)}at.and=NI;var II=qy(at.operators.OR);function CI(...e){return e.reduce(II)}at.or=CI;function qy(e){return(t,r)=>t===P.nil?r:r===P.nil?t:P._`${ju(t)} ${e} ${ju(r)}`}function ju(e){return e instanceof P.Name?e:P._`(${e})`}});var ae=g(function(Hy){Object.defineProperty(Hy,"__esModule",{value:!0});Hy.checkStrictMode=Hy.getErrorPath=Hy.Type=Hy.useFunc=Hy.setEvaluated=Hy.evaluatedPropsToName=Hy.mergeEvaluated=Hy.eachItem=Hy.unescapeJsonPointer=Hy.escapeJsonPointer=Hy.escapeFragment=Hy.unescapeFragment=Hy.schemaRefOrVal=Hy.schemaHasRulesButRef=Hy.schemaHasRules=Hy.checkUnknownRules=Hy.alwaysValidSchema=Hy.toHash=void 0;var U=Z(),Uy=io();function MI(e){let t={};for(let r of e)t[r]=!0;return t}Hy.toHash=MI;function LI(e,t){if(typeof t=="boolean")return t;if(Object.keys(t).length===0)return!0;return Fy(e,t),!Vy(t,e.self.RULES.all)}Hy.alwaysValidSchema=LI;function Fy(e,t=e.schema){let{opts:r,self:n}=e;if(!r.strictSchema)return;if(typeof t==="boolean")return;let s=n.RULES.keywords;for(let o in t)if(!s[o])Ky(e,`unknown keyword: "${o}"`)}Hy.checkUnknownRules=Fy;function Vy(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}Hy.schemaHasRules=Vy;function UI(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}Hy.schemaHasRulesButRef=UI;function FI({topSchemaRef:e,schemaPath:t},r,n,s){if(!s){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return U._`${r}`}return U._`${e}${t}${U.getProperty(n)}`}Hy.schemaRefOrVal=FI;function VI(e){return zy(decodeURIComponent(e))}Hy.unescapeFragment=VI;function zI(e){return encodeURIComponent(Mu(e))}Hy.escapeFragment=zI;function Mu(e){if(typeof e=="number")return`${e}`;return e.replace(/~/g,"~0").replace(/\//g,"~1")}Hy.escapeJsonPointer=Mu;function zy(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}Hy.unescapeJsonPointer=zy;function GI(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}Hy.eachItem=GI;function My({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(s,o,i,a)=>{let c=i===void 0?o:i instanceof U.Name?(o instanceof U.Name?e(s,o,i):t(s,o,i),i):o instanceof U.Name?(t(s,i,o),o):r(o,i);return a===U.Name&&!(c instanceof U.Name)?n(s,c):c}}Hy.mergeEvaluated={props:My({mergeNames:(e,t,r)=>e.if(U._`${r} !== true && ${t} !== undefined`,()=>{e.if(U._`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,U._`${r} || {}`).code(U._`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if(U._`${r} !== true`,()=>{if(t===!0)e.assign(r,!0);else e.assign(r,U._`${r} || {}`),Lu(e,r,t)}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:Gy}),items:My({mergeNames:(e,t,r)=>e.if(U._`${r} !== true && ${t} !== undefined`,()=>e.assign(r,U._`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if(U._`${r} !== true`,()=>e.assign(r,t===!0?!0:U._`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function Gy(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",U._`{}`);if(t!==void 0)Lu(e,r,t);return r}Hy.evaluatedPropsToName=Gy;function Lu(e,t,r){Object.keys(r).forEach((n)=>e.assign(U._`${t}${U.getProperty(n)}`,!0))}Hy.setEvaluated=Lu;var Ly={};function KI(e,t){return e.scopeValue("func",{ref:t,code:Ly[t.code]||(Ly[t.code]=new Uy._Code(t.code))})}Hy.useFunc=KI;var Du;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(Du||(Hy.Type=Du={}));function HI(e,t,r){if(e instanceof U.Name){let n=t===Du.Num;return r?n?U._`"[" + ${e} + "]"`:U._`"['" + ${e} + "']"`:n?U._`"/" + ${e}`:U._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?U.getProperty(e).toString():"/"+Mu(e)}Hy.getErrorPath=HI;function Ky(e,t,r=e.opts.strictSchema){if(!r)return;if(t=`strict mode: ${t}`,r===!0)throw Error(t);e.self.logger.warn(t)}Hy.checkStrictMode=Ky});var vr=g(function(Wy){Object.defineProperty(Wy,"__esModule",{value:!0});var ue=Z(),l1={data:new ue.Name("data"),valCxt:new ue.Name("valCxt"),instancePath:new ue.Name("instancePath"),parentData:new ue.Name("parentData"),parentDataProperty:new ue.Name("parentDataProperty"),rootData:new ue.Name("rootData"),dynamicAnchors:new ue.Name("dynamicAnchors"),vErrors:new ue.Name("vErrors"),errors:new ue.Name("errors"),this:new ue.Name("this"),self:new ue.Name("self"),scope:new ue.Name("scope"),json:new ue.Name("json"),jsonPos:new ue.Name("jsonPos"),jsonLen:new ue.Name("jsonLen"),jsonPart:new ue.Name("jsonPart")};Wy.default=l1});var co=g(function(Qy){Object.defineProperty(Qy,"__esModule",{value:!0});Qy.extendErrors=Qy.resetErrorsCount=Qy.reportExtraError=Qy.reportError=Qy.keyword$DataError=Qy.keywordError=void 0;var C=Z(),Yr=ae(),Ye=vr();Qy.keywordError={message:({keyword:e})=>C.str`must pass "${e}" keyword validation`};Qy.keyword$DataError={message:({keyword:e,schemaType:t})=>t?C.str`"${e}" keyword must be ${t} ($data)`:C.str`"${e}" keyword is invalid ($data)`};function f1(e,t=Qy.keywordError,r,n){let{it:s}=e,{gen:o,compositeRule:i,allErrors:a}=s,c=Jy(e,t,r);if(n!==null&&n!==void 0?n:i||a)Yy(o,c);else Xy(s,C._`[${c}]`)}Qy.reportError=f1;function p1(e,t=Qy.keywordError,r){let{it:n}=e,{gen:s,compositeRule:o,allErrors:i}=n,a=Jy(e,t,r);if(Yy(s,a),!(o||i))Xy(n,Ye.default.vErrors)}Qy.reportExtraError=p1;function h1(e,t){e.assign(Ye.default.errors,t),e.if(C._`${Ye.default.vErrors} !== null`,()=>e.if(t,()=>e.assign(C._`${Ye.default.vErrors}.length`,t),()=>e.assign(Ye.default.vErrors,null)))}Qy.resetErrorsCount=h1;function m1({gen:e,keyword:t,schemaValue:r,data:n,errsCount:s,it:o}){if(s===void 0)throw Error("ajv implementation error");let i=e.name("err");e.forRange("i",s,Ye.default.errors,(a)=>{if(e.const(i,C._`${Ye.default.vErrors}[${a}]`),e.if(C._`${i}.instancePath === undefined`,()=>e.assign(C._`${i}.instancePath`,C.strConcat(Ye.default.instancePath,o.errorPath))),e.assign(C._`${i}.schemaPath`,C.str`${o.errSchemaPath}/${t}`),o.opts.verbose)e.assign(C._`${i}.schema`,r),e.assign(C._`${i}.data`,n)})}Qy.extendErrors=m1;function Yy(e,t){let r=e.const("err",t);e.if(C._`${Ye.default.vErrors} === null`,()=>e.assign(Ye.default.vErrors,C._`[${r}]`),C._`${Ye.default.vErrors}.push(${r})`),e.code(C._`${Ye.default.errors}++`)}function Xy(e,t){let{gen:r,validateName:n,schemaEnv:s}=e;if(s.$async)r.throw(C._`new ${e.ValidationError}(${t})`);else r.assign(C._`${n}.errors`,t),r.return(!1)}var Sn={keyword:new C.Name("keyword"),schemaPath:new C.Name("schemaPath"),params:new C.Name("params"),propertyName:new C.Name("propertyName"),message:new C.Name("message"),schema:new C.Name("schema"),parentSchema:new C.Name("parentSchema")};function Jy(e,t,r){let{createErrors:n}=e.it;if(n===!1)return C._`{}`;return g1(e,t,r)}function g1(e,t,r={}){let{gen:n,it:s}=e,o=[y1(s,r),_1(e,r)];return v1(e,t,o),n.object(...o)}function y1({errorPath:e},{instancePath:t}){let r=t?C.str`${e}${Yr.getErrorPath(t,Yr.Type.Str)}`:e;return[Ye.default.instancePath,C.strConcat(Ye.default.instancePath,r)]}function _1({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let s=n?t:C.str`${t}/${e}`;if(r)s=C.str`${s}${Yr.getErrorPath(r,Yr.Type.Str)}`;return[Sn.schemaPath,s]}function v1(e,{params:t,message:r},n){let{keyword:s,data:o,schemaValue:i,it:a}=e,{opts:c,propertyName:u,topSchemaRef:d,schemaPath:l}=a;if(n.push([Sn.keyword,s],[Sn.params,typeof t=="function"?t(e):t||C._`{}`]),c.messages)n.push([Sn.message,typeof r=="function"?r(e):r]);if(c.verbose)n.push([Sn.schema,i],[Sn.parentSchema,C._`${d}${l}`],[Ye.default.data,o]);if(u)n.push([Sn.propertyName,u])}});var o_=g(function(n_){Object.defineProperty(n_,"__esModule",{value:!0});n_.boolOrEmptySchema=n_.topBoolOrEmptySchema=void 0;var e_=co(),t_=Z(),S1=vr(),x1={message:"boolean schema is false"};function R1(e){let{gen:t,schema:r,validateName:n}=e;if(r===!1)r_(e,!1);else if(typeof r=="object"&&r.$async===!0)t.return(S1.default.data);else t.assign(t_._`${n}.errors`,null),t.return(!0)}n_.topBoolOrEmptySchema=R1;function T1(e,t){let{gen:r,schema:n}=e;if(n===!1)r.var(t,!1),r_(e);else r.var(t,!0)}n_.boolOrEmptySchema=T1;function r_(e,t){let{gen:r,data:n}=e;e_.reportError({gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e},x1,void 0,t)}});var Fu=g(function(i_){Object.defineProperty(i_,"__esModule",{value:!0});i_.getRules=i_.isJSONType=void 0;var O1=["string","number","integer","boolean","null","object","array"],A1=new Set(O1);function P1(e){return typeof e=="string"&&A1.has(e)}i_.isJSONType=P1;function N1(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}i_.getRules=N1});var Vu=g(function(l_){Object.defineProperty(l_,"__esModule",{value:!0});l_.shouldUseRule=l_.shouldUseGroup=l_.schemaHasRulesForType=void 0;function C1({schema:e,self:t},r){let n=t.RULES.types[r];return n&&n!==!0&&c_(e,n)}l_.schemaHasRulesForType=C1;function c_(e,t){return t.rules.some((r)=>u_(e,r))}l_.shouldUseGroup=c_;function u_(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))}l_.shouldUseRule=u_});var uo=g(function(y_){Object.defineProperty(y_,"__esModule",{value:!0});y_.reportTypeError=y_.checkDataTypes=y_.checkDataType=y_.coerceAndCheckDataType=y_.getJSONTypes=y_.getSchemaTypes=y_.DataType=void 0;var f_=Fu(),p_=Vu(),h_=co(),R=Z(),ta=ae(),cs;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(cs||(y_.DataType=cs={}));function D1(e){let t=m_(e.type);if(t.includes("null")){if(e.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');if(e.nullable===!0)t.push("null")}return t}y_.getSchemaTypes=D1;function m_(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(f_.isJSONType))return t;throw Error("type must be JSONType or JSONType[]: "+t.join(","))}y_.getJSONTypes=m_;function M1(e,t){let{gen:r,data:n,opts:s}=e,o=L1(t,s.coerceTypes),i=t.length>0&&!(o.length===0&&t.length===1&&p_.schemaHasRulesForType(e,t[0]));if(i){let a=Gu(t,n,s.strictNumbers,cs.Wrong);r.if(a,()=>{if(o.length)U1(e,t,o);else Ku(e)})}return i}y_.coerceAndCheckDataType=M1;var g_=new Set(["string","number","integer","boolean","null"]);function L1(e,t){return t?e.filter((r)=>g_.has(r)||t==="array"&&r==="array"):[]}function U1(e,t,r){let{gen:n,data:s,opts:o}=e,i=n.let("dataType",R._`typeof ${s}`),a=n.let("coerced",R._`undefined`);if(o.coerceTypes==="array")n.if(R._`${i} == 'object' && Array.isArray(${s}) && ${s}.length == 1`,()=>n.assign(s,R._`${s}[0]`).assign(i,R._`typeof ${s}`).if(Gu(t,s,o.strictNumbers),()=>n.assign(a,s)));n.if(R._`${a} !== undefined`);for(let u of r)if(g_.has(u)||u==="array"&&o.coerceTypes==="array")c(u);n.else(),Ku(e),n.endIf(),n.if(R._`${a} !== undefined`,()=>{n.assign(s,a),F1(e,a)});function c(u){switch(u){case"string":n.elseIf(R._`${i} == "number" || ${i} == "boolean"`).assign(a,R._`"" + ${s}`).elseIf(R._`${s} === null`).assign(a,R._`""`);return;case"number":n.elseIf(R._`${i} == "boolean" || ${s} === null
10
+ deps: ${r}}`};var $A={keyword:"dependencies",type:"object",schemaType:"object",error:bm.error,code(e){let[t,r]=EA(e);$m(e,t),Em(e,r)}};function EA({schema:e}){let t={},r={};for(let n in e){if(n==="__proto__")continue;let s=Array.isArray(e[n])?t:r;s[n]=e[n]}return[t,r]}function $m(e,t=e.schema){let{gen:r,data:n,it:s}=e;if(Object.keys(t).length===0)return;let o=r.let("missing");for(let i in t){let a=t[i];if(a.length===0)continue;let c=Wt.propertyInData(r,n,i,s.opts.ownProperties);if(e.setParams({property:i,depsCount:a.length,deps:a.join(", ")}),s.allErrors)r.if(c,()=>{for(let u of a)Wt.checkReportMissingProp(e,u)});else r.if(es._`${c} && (${Wt.checkMissingProp(e,a,o)})`),Wt.reportMissingProp(e,o),r.else()}}bm.validatePropertyDeps=$m;function Em(e,t=e.schema){let{gen:r,data:n,keyword:s,it:o}=e,i=r.name("valid");for(let a in t){if(vm.alwaysValidSchema(o,t[a]))continue;r.if(Wt.propertyInData(r,n,a,o.opts.ownProperties),()=>{let c=e.subschema({keyword:s,schemaProp:a},i);e.mergeValidEvaluated(c,i)},()=>r.var(i,!0)),e.ok(i)}}bm.validateSchemaDeps=Em;bm.default=$A});var Tm=g(function(Rm){Object.defineProperty(Rm,"__esModule",{value:!0});var Ai=Y(),xm=te(),SA={message:"property name must be valid",params:({params:e})=>Ai._`{propertyName: ${e.propertyName}}`},xA={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:SA,code(e){let{gen:t,schema:r,data:n,it:s}=e;if(xm.alwaysValidSchema(s,r))return;let o=t.name("valid");t.forIn("key",n,(i)=>{e.setParams({propertyName:i}),e.subschema({keyword:"propertyNames",data:i,dataTypes:["string"],propertyName:i,compositeRule:!0},o),t.if(Ai.not(o),()=>{if(e.error(!0),!s.allErrors)t.break()})}),e.ok(o)}};Rm.default=xA});var yu=g(function(km){Object.defineProperty(km,"__esModule",{value:!0});var Fr=mt(),ke=Y(),TA=pt(),Vr=te(),kA={message:"must NOT have additional properties",params:({params:e})=>ke._`{additionalProperty: ${e.additionalProperty}}`},OA={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:kA,code(e){let{gen:t,schema:r,parentSchema:n,data:s,errsCount:o,it:i}=e;if(!o)throw Error("ajv implementation error");let{allErrors:a,opts:c}=i;if(i.props=!0,c.removeAdditional!=="all"&&Vr.alwaysValidSchema(i,r))return;let u=Fr.allSchemaProperties(n.properties),d=Fr.allSchemaProperties(n.patternProperties);l(),e.ok(ke._`${o} === ${TA.default.errors}`);function l(){t.forIn("key",s,(y)=>{if(!u.length&&!d.length)h(y);else t.if(p(y),()=>h(y))})}function p(y){let _;if(u.length>8){let O=Vr.schemaRefOrVal(i,n.properties,"properties");_=Fr.isOwnProperty(t,O,y)}else if(u.length)_=ke.or(...u.map((O)=>ke._`${y} === ${O}`));else _=ke.nil;if(d.length)_=ke.or(_,...d.map((O)=>ke._`${Fr.usePattern(e,O)}.test(${y})`));return ke.not(_)}function f(y){t.code(ke._`delete ${s}[${y}]`)}function h(y){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){f(y);return}if(r===!1){if(e.setParams({additionalProperty:y}),e.error(),!a)t.break();return}if(typeof r=="object"&&!Vr.alwaysValidSchema(i,r)){let _=t.name("valid");if(c.removeAdditional==="failing")m(y,_,!1),t.if(ke.not(_),()=>{e.reset(),f(y)});else if(m(y,_),!a)t.if(ke.not(_),()=>t.break())}}function m(y,_,O){let T={keyword:"additionalProperties",dataProp:y,dataPropType:Vr.Type.Str};if(O===!1)Object.assign(T,{compositeRule:!0,createErrors:!1,allErrors:!1});e.subschema(T,_)}}};km.default=OA});var Nm=g(function(Pm){Object.defineProperty(Pm,"__esModule",{value:!0});var Am=Zs(),Pi=mt(),ts=te(),Om=yu(),PA={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,parentSchema:n,data:s,it:o}=e;if(o.opts.removeAdditional==="all"&&n.additionalProperties===void 0)Om.default.code(new Am.KeywordCxt(o,Om.default,"additionalProperties"));let i=Pi.allSchemaProperties(r);for(let l of i)o.definedProperties.add(l);if(o.opts.unevaluated&&i.length&&o.props!==!0)o.props=ts.mergeEvaluated.props(t,ts.toHash(i),o.props);let a=i.filter((l)=>!ts.alwaysValidSchema(o,r[l]));if(a.length===0)return;let c=t.name("valid");for(let l of a){if(u(l))d(l);else{if(t.if(Pi.propertyInData(t,s,l,o.opts.ownProperties)),d(l),!o.allErrors)t.else().var(c,!0);t.endIf()}e.it.definedProperties.add(l),e.ok(c)}function u(l){return o.opts.useDefaults&&!o.compositeRule&&r[l].default!==void 0}function d(l){e.subschema({keyword:"properties",schemaProp:l,dataProp:l},c)}}};Pm.default=PA});var Cm=g(function(Im){Object.defineProperty(Im,"__esModule",{value:!0});var Ni=mt(),zr=Y(),Ii=te(),Ci=te(),IA={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:n,parentSchema:s,it:o}=e,{opts:i}=o,a=Ni.allSchemaProperties(r),c=a.filter((m)=>Ii.alwaysValidSchema(o,r[m]));if(a.length===0||c.length===a.length&&(!o.opts.unevaluated||o.props===!0))return;let u=i.strictSchema&&!i.allowMatchingProperties&&s.properties,d=t.name("valid");if(o.props!==!0&&!(o.props instanceof zr.Name))o.props=Ci.evaluatedPropsToName(t,o.props);let{props:l}=o;p();function p(){for(let m of a){if(u)f(m);if(o.allErrors)h(m);else t.var(d,!0),h(m),t.if(d)}}function f(m){for(let y in u)if(new RegExp(m).test(y))Ii.checkStrictMode(o,`property ${y} matches pattern ${m} (use allowMatchingProperties)`)}function h(m){t.forIn("key",n,(y)=>{t.if(zr._`${Ni.usePattern(e,m)}.test(${y})`,()=>{let _=c.includes(m);if(!_)e.subschema({keyword:"patternProperties",schemaProp:m,dataProp:y,dataPropType:Ci.Type.Str},d);if(o.opts.unevaluated&&l!==!0)t.assign(zr._`${l}[${y}]`,!0);else if(!_&&!o.allErrors)t.if(zr.not(d),()=>t.break())})})}}};Im.default=IA});var Dm=g(function(qm){Object.defineProperty(qm,"__esModule",{value:!0});var jm=te(),jA={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:n}=e;if(jm.alwaysValidSchema(n,r)){e.fail();return}let s=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},s),e.failResult(s,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};qm.default=jA});var Um=g(function(Lm){Object.defineProperty(Lm,"__esModule",{value:!0});var Mm=mt(),DA={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Mm.validateUnion,error:{message:"must match a schema in anyOf"}};Lm.default=DA});var zm=g(function(Vm){Object.defineProperty(Vm,"__esModule",{value:!0});var Gr=Y(),Fm=te(),LA={message:"must match exactly one schema in oneOf",params:({params:e})=>Gr._`{passingSchemas: ${e.passing}}`},UA={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:LA,code(e){let{gen:t,schema:r,parentSchema:n,it:s}=e;if(!Array.isArray(r))throw Error("ajv implementation error");if(s.opts.discriminator&&n.discriminator)return;let o=r,i=t.let("valid",!1),a=t.let("passing",null),c=t.name("_valid");e.setParams({passing:a}),t.block(u),e.result(i,()=>e.reset(),()=>e.error(!0));function u(){o.forEach((d,l)=>{let p;if(Fm.alwaysValidSchema(s,d))t.var(c,!0);else p=e.subschema({keyword:"oneOf",schemaProp:l,compositeRule:!0},c);if(l>0)t.if(Gr._`${c} && ${i}`).assign(i,!1).assign(a,Gr._`[${a}, ${l}]`).else();t.if(c,()=>{if(t.assign(i,!0),t.assign(a,l),p)e.mergeEvaluated(p,Gr.Name)})})}}};Vm.default=UA});var Hm=g(function(Km){Object.defineProperty(Km,"__esModule",{value:!0});var Gm=te(),VA={keyword:"allOf",schemaType:"array",code(e){let{gen:t,schema:r,it:n}=e;if(!Array.isArray(r))throw Error("ajv implementation error");let s=t.name("valid");r.forEach((o,i)=>{if(Gm.alwaysValidSchema(n,o))return;let a=e.subschema({keyword:"allOf",schemaProp:i},s);e.ok(s),e.mergeEvaluated(a)})}};Km.default=VA});var Ym=g(function(Wm){Object.defineProperty(Wm,"__esModule",{value:!0});var Kr=Y(),ji=te(),GA={message:({params:e})=>Kr.str`must match "${e.ifClause}" schema`,params:({params:e})=>Kr._`{failingKeyword: ${e.ifClause}}`},KA={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:GA,code(e){let{gen:t,parentSchema:r,it:n}=e;if(r.then===void 0&&r.else===void 0)ji.checkStrictMode(n,'"if" without "then" and "else" is ignored');let s=Bm(n,"then"),o=Bm(n,"else");if(!s&&!o)return;let i=t.let("valid",!0),a=t.name("_valid");if(c(),e.reset(),s&&o){let d=t.let("ifClause");e.setParams({ifClause:d}),t.if(a,u("then",d),u("else",d))}else if(s)t.if(a,u("then"));else t.if(Kr.not(a),u("else"));e.pass(i,()=>e.error(!0));function c(){let d=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);e.mergeEvaluated(d)}function u(d,l){return()=>{let p=e.subschema({keyword:d},a);if(t.assign(i,a),e.mergeValidEvaluated(p,i),l)t.assign(l,Kr._`${d}`);else e.setParams({ifClause:d})}}}};function Bm(e,t){let r=e.schema[t];return r!==void 0&&!ji.alwaysValidSchema(e,r)}Wm.default=KA});var Qm=g(function(Jm){Object.defineProperty(Jm,"__esModule",{value:!0});var Xm=te(),BA={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){if(t.if===void 0)Xm.checkStrictMode(r,`"${e}" without "if" is ignored`)}};Jm.default=BA});var eg=g(function(Zm){Object.defineProperty(Zm,"__esModule",{value:!0});var YA=mu(),XA=dm(),JA=gu(),QA=gm(),ZA=_m(),eP=Oi(),tP=Tm(),rP=yu(),nP=Nm(),sP=Cm(),oP=Dm(),iP=Um(),aP=zm(),cP=Hm(),uP=Ym(),lP=Qm();function dP(e=!1){let t=[oP.default,iP.default,aP.default,cP.default,uP.default,lP.default,tP.default,rP.default,eP.default,nP.default,sP.default];if(e)t.push(XA.default,QA.default);else t.push(YA.default,JA.default);return t.push(ZA.default),t}Zm.default=dP});var _u=g(function(ng){Object.defineProperty(ng,"__esModule",{value:!0});ng.dynamicAnchor=void 0;var rs=Y(),pP=pt(),qi=ro(),tg=Si(),hP={keyword:"$dynamicAnchor",schemaType:"string",code:(e)=>rg(e,e.schema)};function rg(e,t){let{gen:r,it:n}=e;n.schemaEnv.root.dynamicAnchors[t]=!0;let s=rs._`${pP.default.dynamicAnchors}${rs.getProperty(t)}`,o=n.errSchemaPath==="#"?n.validateName:mP(e);r.if(rs._`!${s}`,()=>r.assign(s,o))}ng.dynamicAnchor=rg;function mP(e){let{schemaEnv:t,schema:r,self:n}=e.it,{root:s,baseId:o,localRefs:i,meta:a}=t.root,{schemaId:c}=n.opts,u=new qi.SchemaEnv({schema:r,schemaId:c,root:s,baseId:o,localRefs:i,meta:a});return qi.compileSchema.call(n,u),tg.getValidate(e,u)}ng.default=hP});var vu=g(function(ig){Object.defineProperty(ig,"__esModule",{value:!0});ig.dynamicRef=void 0;var Di=Y(),yP=pt(),Mi=Si(),_P={keyword:"$dynamicRef",schemaType:"string",code:(e)=>og(e,e.schema)};function og(e,t){let{gen:r,keyword:n,it:s}=e;if(t[0]!=="#")throw Error(`"${n}" only supports hash fragment reference`);let o=t.slice(1);if(s.allErrors)i();else{let c=r.let("valid",!1);i(c),e.ok(c)}function i(c){if(s.schemaEnv.root.dynamicAnchors[o]){let u=r.let("_v",Di._`${yP.default.dynamicAnchors}${Di.getProperty(o)}`);r.if(u,a(u,c),a(s.validateName,c))}else a(s.validateName,c)()}function a(c,u){return u?()=>r.block(()=>{Mi.callRef(e,c),r.let(u,!0)}):()=>Mi.callRef(e,c)}}ig.dynamicRef=og;ig.default=_P});var dg=g(function(lg){Object.defineProperty(lg,"__esModule",{value:!0});var cg=_u(),ug=te(),$P={keyword:"$recursiveAnchor",schemaType:"boolean",code(e){if(e.schema)cg.dynamicAnchor(e,"");else ug.checkStrictMode(e.it,"$recursiveAnchor: false is ignored")}};lg.default=$P});var hg=g(function(pg){Object.defineProperty(pg,"__esModule",{value:!0});var fg=vu(),bP={keyword:"$recursiveRef",schemaType:"string",code:(e)=>fg.dynamicRef(e,e.schema)};pg.default=bP});var gg=g(function(mg){Object.defineProperty(mg,"__esModule",{value:!0});var SP=_u(),xP=vu(),RP=dg(),TP=hg(),kP=[SP.default,xP.default,RP.default,TP.default];mg.default=kP});var _g=g(function(yg){Object.defineProperty(yg,"__esModule",{value:!0});var Li=Oi(),AP={keyword:"dependentRequired",type:"object",schemaType:"object",error:Li.error,code:(e)=>Li.validatePropertyDeps(e)};yg.default=AP});var Eg=g(function($g){Object.defineProperty($g,"__esModule",{value:!0});var vg=Oi(),NP={keyword:"dependentSchemas",type:"object",schemaType:"object",code:(e)=>vg.validateSchemaDeps(e)};$g.default=NP});var Sg=g(function(wg){Object.defineProperty(wg,"__esModule",{value:!0});var bg=te(),CP={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:e,parentSchema:t,it:r}){if(t.contains===void 0)bg.checkStrictMode(r,`"${e}" without "contains" is ignored`)}};wg.default=CP});var Rg=g(function(xg){Object.defineProperty(xg,"__esModule",{value:!0});var qP=_g(),DP=Eg(),MP=Sg(),LP=[qP.default,DP.default,MP.default];xg.default=LP});var kg=g(function(Tg){Object.defineProperty(Tg,"__esModule",{value:!0});var Ge=Y(),Ui=te(),FP=pt(),VP={message:"must NOT have unevaluated properties",params:({params:e})=>Ge._`{unevaluatedProperty: ${e.unevaluatedProperty}}`},zP={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:VP,code(e){let{gen:t,schema:r,data:n,errsCount:s,it:o}=e;if(!s)throw Error("ajv implementation error");let{allErrors:i,props:a}=o;if(a instanceof Ge.Name)t.if(Ge._`${a} !== true`,()=>t.forIn("key",n,(l)=>t.if(u(a,l),()=>c(l))));else if(a!==!0)t.forIn("key",n,(l)=>a===void 0?c(l):t.if(d(a,l),()=>c(l)));o.props=!0,e.ok(Ge._`${s} === ${FP.default.errors}`);function c(l){if(r===!1){if(e.setParams({unevaluatedProperty:l}),e.error(),!i)t.break();return}if(!Ui.alwaysValidSchema(o,r)){let p=t.name("valid");if(e.subschema({keyword:"unevaluatedProperties",dataProp:l,dataPropType:Ui.Type.Str},p),!i)t.if(Ge.not(p),()=>t.break())}}function u(l,p){return Ge._`!${l} || !${l}[${p}]`}function d(l,p){let f=[];for(let h in l)if(l[h]===!0)f.push(Ge._`${p} !== ${h}`);return Ge.and(...f)}}};Tg.default=zP});var Ag=g(function(Og){Object.defineProperty(Og,"__esModule",{value:!0});var ot=Y(),Fi=te(),KP={message:({params:{len:e}})=>ot.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>ot._`{limit: ${e}}`},HP={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:KP,code(e){let{gen:t,schema:r,data:n,it:s}=e,o=s.items||0;if(o===!0)return;let i=t.const("len",ot._`${n}.length`);if(r===!1)e.setParams({len:o}),e.fail(ot._`${i} > ${o}`);else if(typeof r=="object"&&!Fi.alwaysValidSchema(s,r)){let c=t.var("valid",ot._`${i} <= ${o}`);t.if(ot.not(c),()=>a(c,o)),e.ok(c)}s.items=!0;function a(c,u){t.forRange("i",u,i,(d)=>{if(e.subschema({keyword:"unevaluatedItems",dataProp:d,dataPropType:Fi.Type.Num},c),!s.allErrors)t.if(ot.not(c),()=>t.break())})}}};Og.default=HP});var Ng=g(function(Pg){Object.defineProperty(Pg,"__esModule",{value:!0});var WP=kg(),YP=Ag(),XP=[WP.default,YP.default];Pg.default=XP});var Cg=g(function(Ig){Object.defineProperty(Ig,"__esModule",{value:!0});var X=Y(),QP={message:({schemaCode:e})=>X.str`must match format "${e}"`,params:({schemaCode:e})=>X._`{format: ${e}}`},ZP={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:QP,code(e,t){let{gen:r,data:n,$data:s,schema:o,schemaCode:i,it:a}=e,{opts:c,errSchemaPath:u,schemaEnv:d,self:l}=a;if(!c.validateFormats)return;if(s)p();else f();function p(){let h=r.scopeValue("formats",{ref:l.formats,code:c.code.formats}),m=r.const("fDef",X._`${h}[${i}]`),y=r.let("fType"),_=r.let("format");r.if(X._`typeof ${m} == "object" && !(${m} instanceof RegExp)`,()=>r.assign(y,X._`${m}.type || "string"`).assign(_,X._`${m}.validate`),()=>r.assign(y,X._`"string"`).assign(_,m)),e.fail$data(X.or(O(),T()));function O(){if(c.strictSchema===!1)return X.nil;return X._`${i} && !${_}`}function T(){let M=d.$async?X._`(${m}.async ? await ${_}(${n}) : ${_}(${n}))`:X._`${_}(${n})`,S=X._`(typeof ${_} == "function" ? ${M} : ${_}.test(${n}))`;return X._`${_} && ${_} !== true && ${y} === ${t} && !${S}`}}function f(){let h=l.formats[o];if(!h){O();return}if(h===!0)return;let[m,y,_]=T(h);if(m===t)e.pass(M());function O(){if(c.strictSchema===!1){l.logger.warn(S());return}throw Error(S());function S(){return`unknown format "${o}" ignored in schema at path "${u}"`}}function T(S){let _e=S instanceof RegExp?X.regexpCode(S):c.code.formats?X._`${c.code.formats}${X.getProperty(o)}`:void 0,ve=r.scopeValue("formats",{key:o,ref:S,code:_e});if(typeof S=="object"&&!(S instanceof RegExp))return[S.type||"string",S.validate,X._`${ve}.validate`];return["string",S,ve]}function M(){if(typeof h=="object"&&!(h instanceof RegExp)&&h.async){if(!d.$async)throw Error("async format in sync schema");return X._`await ${_}(${n})`}return typeof y=="function"?X._`${_}(${n})`:X._`${_}.test(${n})`}}}};Ig.default=ZP});var qg=g(function(jg){Object.defineProperty(jg,"__esModule",{value:!0});var tN=Cg(),rN=[tN.default];jg.default=rN});var Lg=g(function(Dg){Object.defineProperty(Dg,"__esModule",{value:!0});Dg.contentVocabulary=Dg.metadataVocabulary=void 0;Dg.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Dg.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var Fg=g(function(Ug){Object.defineProperty(Ug,"__esModule",{value:!0});var oN=bh(),iN=tm(),aN=eg(),cN=gg(),uN=Rg(),lN=Ng(),dN=qg(),Vi=Lg(),fN=[cN.default,oN.default,iN.default,(0,aN.default)(!0),dN.default,Vi.metadataVocabulary,Vi.contentVocabulary,uN.default,lN.default];Ug.default=fN});var Kg=g(function(zg){Object.defineProperty(zg,"__esModule",{value:!0});zg.DiscrError=void 0;var Vg;(function(e){e.Tag="tag",e.Mapping="mapping"})(Vg||(zg.DiscrError=Vg={}))});var Wg=g(function(Bg){Object.defineProperty(Bg,"__esModule",{value:!0});var gt=Y(),ns=Kg(),zi=ro(),hN=eo(),Hg=te(),mN={message:({params:{discrError:e,tagName:t}})=>e===ns.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>gt._`{error: ${e}, tag: ${r}, tagValue: ${t}}`},gN={keyword:"discriminator",type:"object",schemaType:"object",error:mN,code(e){let{gen:t,data:r,schema:n,parentSchema:s,it:o}=e,{oneOf:i}=s;if(!o.opts.discriminator)throw Error("discriminator: requires discriminator option");let a=n.propertyName;if(typeof a!="string")throw Error("discriminator: requires propertyName");if(n.mapping)throw Error("discriminator: mapping is not supported");if(!i)throw Error("discriminator: requires oneOf keyword");let c=t.let("valid",!1),u=t.const("tag",gt._`${r}${gt.getProperty(a)}`);t.if(gt._`typeof ${u} == "string"`,()=>d(),()=>e.error(!1,{discrError:ns.DiscrError.Tag,tag:u,tagName:a})),e.ok(c);function d(){let f=p();t.if(!1);for(let h in f)t.elseIf(gt._`${u} === ${h}`),t.assign(c,l(f[h]));t.else(),e.error(!1,{discrError:ns.DiscrError.Mapping,tag:u,tagName:a}),t.endIf()}function l(f){let h=t.name("valid"),m=e.subschema({keyword:"oneOf",schemaProp:f},h);return e.mergeEvaluated(m,gt.Name),h}function p(){var f;let h={},m=_(s),y=!0;for(let M=0;M<i.length;M++){let S=i[M];if((S===null||S===void 0?void 0:S.$ref)&&!Hg.schemaHasRulesButRef(S,o.self.RULES)){let ve=S.$ref;if(S=zi.resolveRef.call(o.self,o.schemaEnv.root,o.baseId,ve),S instanceof zi.SchemaEnv)S=S.schema;if(S===void 0)throw new hN.default(o.opts.uriResolver,o.baseId,ve)}let _e=(f=S===null||S===void 0?void 0:S.properties)===null||f===void 0?void 0:f[a];if(typeof _e!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);y=y&&(m||_(S)),O(_e,M)}if(!y)throw Error(`discriminator: "${a}" must be required`);return h;function _({required:M}){return Array.isArray(M)&&M.includes(a)}function O(M,S){if(M.const)T(M.const,S);else if(M.enum)for(let _e of M.enum)T(_e,S);else throw Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function T(M,S){if(typeof M!="string"||M in h)throw Error(`discriminator: "${a}" values must be unique strings`);h[M]=S}}}};Bg.default=gN});var Yg=g(function(mG,_N){_N.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/schema",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],type:["object","boolean"],$comment:"This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",properties:{definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:!0,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',type:"object",additionalProperties:{anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs/stringArray"}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:!0},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:!0}}}});var Xg=g(function(gG,vN){vN.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/applicator":!0},$dynamicAnchor:"meta",title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"#meta"},properties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$dynamicRef:"#meta"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}}}});var Jg=g(function(yG,$N){$N.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/unevaluated",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},$dynamicAnchor:"meta",title:"Unevaluated applicator vocabulary meta-schema",type:["object","boolean"],properties:{unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}}}});var Qg=g(function(_G,EN){EN.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/content",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}}}});var Zg=g(function(vG,bN){bN.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/core",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0},$dynamicAnchor:"meta",title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},$defs:{anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}}}});var ey=g(function($G,wN){wN.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/format-annotation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},$dynamicAnchor:"meta",title:"Format vocabulary meta-schema for annotation results",type:["object","boolean"],properties:{format:{type:"string"}}}});var ty=g(function(EG,SN){SN.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},$dynamicAnchor:"meta",title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}});var ry=g(function(bG,xN){xN.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/validation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/validation":!0},$dynamicAnchor:"meta",title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}});var sy=g(function(ny){Object.defineProperty(ny,"__esModule",{value:!0});var RN=Yg(),TN=Xg(),kN=Jg(),ON=Qg(),AN=Zg(),PN=ey(),NN=ty(),IN=ry(),CN=["/properties"];function jN(e){return[RN,TN,kN,ON,AN,t(this,PN),NN,t(this,IN)].forEach((r)=>this.addMetaSchema(r,void 0,!1)),this;function t(r,n){return e?r.$dataMetaSchema(n,CN):n}}ny.default=jN});var oy=g(function(it,Eu){Object.defineProperty(it,"__esModule",{value:!0});it.MissingRefError=it.ValidationError=it.CodeGen=it.Name=it.nil=it.stringify=it.str=it._=it.KeywordCxt=it.Ajv2020=void 0;var DN=mh(),MN=Fg(),LN=Wg(),UN=sy(),$u="https://json-schema.org/draft/2020-12/schema";class so extends DN.default{constructor(e={}){super({...e,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),MN.default.forEach((e)=>this.addVocabulary(e)),this.opts.discriminator)this.addKeyword(LN.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:e,meta:t}=this.opts;if(!t)return;UN.default.call(this,e),this.refs["http://json-schema.org/schema"]=$u}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema($u)?$u:void 0)}}it.Ajv2020=so;Eu.exports=it=so;Eu.exports.Ajv2020=so;Object.defineProperty(it,"__esModule",{value:!0});it.default=so;var FN=Zs();Object.defineProperty(it,"KeywordCxt",{enumerable:!0,get:function(){return FN.KeywordCxt}});var ss=Y();Object.defineProperty(it,"_",{enumerable:!0,get:function(){return ss._}});Object.defineProperty(it,"str",{enumerable:!0,get:function(){return ss.str}});Object.defineProperty(it,"stringify",{enumerable:!0,get:function(){return ss.stringify}});Object.defineProperty(it,"nil",{enumerable:!0,get:function(){return ss.nil}});Object.defineProperty(it,"Name",{enumerable:!0,get:function(){return ss.Name}});Object.defineProperty(it,"CodeGen",{enumerable:!0,get:function(){return ss.CodeGen}});var VN=pi();Object.defineProperty(it,"ValidationError",{enumerable:!0,get:function(){return VN.default}});var zN=eo();Object.defineProperty(it,"MissingRefError",{enumerable:!0,get:function(){return zN.default}})});var my=g(function(py){Object.defineProperty(py,"__esModule",{value:!0});py.formatNames=py.fastFormats=py.fullFormats=void 0;function Yt(e,t){return{validate:e,compare:t}}py.fullFormats={date:Yt(uy,xu),time:Yt(wu(!0),Ru),"date-time":Yt(iy(!0),dy),"iso-time":Yt(wu(),ly),"iso-date-time":Yt(iy(),fy),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:JN,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:sI,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:QN,int32:{type:"number",validate:tI},int64:{type:"number",validate:rI},float:{type:"number",validate:cy},double:{type:"number",validate:cy},password:!0,binary:!0};py.fastFormats={...py.fullFormats,date:Yt(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,xu),time:Yt(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,Ru),"date-time":Yt(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,dy),"iso-time":Yt(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,ly),"iso-date-time":Yt(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,fy),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};py.formatNames=Object.keys(py.fullFormats);function HN(e){return e%4===0&&(e%100!==0||e%400===0)}var BN=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,WN=[0,31,28,31,30,31,30,31,31,30,31,30,31];function uy(e){let t=BN.exec(e);if(!t)return!1;let r=+t[1],n=+t[2],s=+t[3];return n>=1&&n<=12&&s>=1&&s<=(n===2&&HN(r)?29:WN[n])}function xu(e,t){if(!(e&&t))return;if(e>t)return 1;if(e<t)return-1;return 0}var bu=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function wu(e){return function(r){let n=bu.exec(r);if(!n)return!1;let s=+n[1],o=+n[2],i=+n[3],a=n[4],c=n[5]==="-"?-1:1,u=+(n[6]||0),d=+(n[7]||0);if(u>23||d>59||e&&!a)return!1;if(s<=23&&o<=59&&i<60)return!0;let l=o-d*c,p=s-u*c-(l<0?1:0);return(p===23||p===-1)&&(l===59||l===-1)&&i<61}}function Ru(e,t){if(!(e&&t))return;let r=new Date("2020-01-01T"+e).valueOf(),n=new Date("2020-01-01T"+t).valueOf();if(!(r&&n))return;return r-n}function ly(e,t){if(!(e&&t))return;let r=bu.exec(e),n=bu.exec(t);if(!(r&&n))return;if(e=r[1]+r[2]+r[3],t=n[1]+n[2]+n[3],e>t)return 1;if(e<t)return-1;return 0}var Su=/t|\s/i;function iy(e){let t=wu(e);return function(n){let s=n.split(Su);return s.length===2&&uy(s[0])&&t(s[1])}}function dy(e,t){if(!(e&&t))return;let r=new Date(e).valueOf(),n=new Date(t).valueOf();if(!(r&&n))return;return r-n}function fy(e,t){if(!(e&&t))return;let[r,n]=e.split(Su),[s,o]=t.split(Su),i=xu(r,s);if(i===void 0)return;return i||Ru(n,o)}var YN=/\/|:/,XN=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function JN(e){return YN.test(e)&&XN.test(e)}var ay=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function QN(e){return ay.lastIndex=0,ay.test(e)}var ZN=-2147483648,eI=2147483647;function tI(e){return Number.isInteger(e)&&e<=eI&&e>=ZN}function rI(e){return Number.isInteger(e)}function cy(){return!0}var nI=/[^\\]\\Z/;function sI(e){if(nI.test(e))return!1;try{return new RegExp(e),!0}catch(t){return!1}}});var io=g(function(_y){Object.defineProperty(_y,"__esModule",{value:!0});_y.regexpCode=_y.getEsmExportName=_y.getProperty=_y.safeStringify=_y.stringify=_y.strConcat=_y.addCodeArg=_y.str=_y._=_y.nil=_y._Code=_y.Name=_y.IDENTIFIER=_y._CodeOrName=void 0;class Gi{}_y._CodeOrName=Gi;_y.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class os extends Gi{constructor(e){super();if(!_y.IDENTIFIER.test(e))throw Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}_y.Name=os;class kt extends Gi{constructor(e){super();this._items=typeof e==="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((t,r)=>`${t}${r}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((t,r)=>{if(r instanceof os)t[r.str]=(t[r.str]||0)+1;return t},{})}}_y._Code=kt;_y.nil=new kt("");function gy(e,...t){let r=[e[0]],n=0;while(n<t.length)Ou(r,t[n]),r.push(e[++n]);return new kt(r)}_y._=gy;var ku=new kt("+");function yy(e,...t){let r=[oo(e[0])],n=0;while(n<t.length)r.push(ku),Ou(r,t[n]),r.push(ku,oo(e[++n]));return iI(r),new kt(r)}_y.str=yy;function Ou(e,t){if(t instanceof kt)e.push(...t._items);else if(t instanceof os)e.push(t);else e.push(uI(t))}_y.addCodeArg=Ou;function iI(e){let t=1;while(t<e.length-1){if(e[t]===ku){let r=aI(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function aI(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string"){if(t instanceof os||e[e.length-1]!=='"')return;if(typeof t!="string")return`${e.slice(0,-1)}${t}"`;if(t[0]==='"')return e.slice(0,-1)+t.slice(1);return}if(typeof t=="string"&&t[0]==='"'&&!(e instanceof os))return`"${e}${t.slice(1)}`;return}function cI(e,t){return t.emptyStr()?e:e.emptyStr()?t:yy`${e}${t}`}_y.strConcat=cI;function uI(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:oo(Array.isArray(e)?e.join(","):e)}function lI(e){return new kt(oo(e))}_y.stringify=lI;function oo(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}_y.safeStringify=oo;function dI(e){return typeof e=="string"&&_y.IDENTIFIER.test(e)?new kt(`.${e}`):gy`[${e}]`}_y.getProperty=dI;function fI(e){if(typeof e=="string"&&_y.IDENTIFIER.test(e))return new kt(`${e}`);throw Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}_y.getEsmExportName=fI;function pI(e){return new kt(e.toString())}_y.regexpCode=pI});var Iu=g(function(by){Object.defineProperty(by,"__esModule",{value:!0});by.ValueScope=by.ValueScopeName=by.Scope=by.varKinds=by.UsedValueState=void 0;var me=io();class $y extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`);this.value=e.value}}var Hi;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(Hi||(by.UsedValueState=Hi={}));by.varKinds={const:new me.Name("const"),let:new me.Name("let"),var:new me.Name("var")};class Pu{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof me.Name?e:this.name(e)}name(e){return new me.Name(this._newName(e))}_newName(e){let t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){var t,r;if(((r=(t=this._parent)===null||t===void 0?void 0:t._prefixes)===null||r===void 0?void 0:r.has(e))||this._prefixes&&!this._prefixes.has(e))throw Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}by.Scope=Pu;class Nu extends me.Name{constructor(e,t){super(t);this.prefix=e}setValue(e,{property:t,itemIndex:r}){this.value=e,this.scopePath=me._`.${new me.Name(t)}[${r}]`}}by.ValueScopeName=Nu;var RI=me._`\n`;class Ey extends Pu{constructor(e){super(e);this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?RI:me.nil}}get(){return this._scope}name(e){return new Nu(e,this._newName(e))}value(e,t){var r;if(t.ref===void 0)throw Error("CodeGen: ref must be passed in value");let n=this.toName(e),{prefix:s}=n,o=(r=t.key)!==null&&r!==void 0?r:t.ref,i=this._values[s];if(i){let u=i.get(o);if(u)return u}else i=this._values[s]=new Map;i.set(o,n);let a=this._scope[s]||(this._scope[s]=[]),c=a.length;return a[c]=t.ref,n.setValue(t,{property:s,itemIndex:c}),n}getValue(e,t){let r=this._values[e];if(!r)return;return r.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,(r)=>{if(r.scopePath===void 0)throw Error(`CodeGen: name "${r}" has no value`);return me._`${e}${r.scopePath}`})}scopeCode(e=this._values,t,r){return this._reduceValues(e,(n)=>{if(n.value===void 0)throw Error(`CodeGen: name "${n}" has no value`);return n.value.code},t,r)}_reduceValues(e,t,r={},n){let s=me.nil;for(let o in e){let i=e[o];if(!i)continue;let a=r[o]=r[o]||new Map;i.forEach((c)=>{if(a.has(c))return;a.set(c,Hi.Started);let u=t(c);if(u){let d=this.opts.es5?by.varKinds.var:by.varKinds.const;s=me._`${s}${d} ${c} = ${u};${this.opts._n}`}else if(u=n===null||n===void 0?void 0:n(c))s=me._`${s}${u}${this.opts._n}`;else throw new $y(c);a.set(c,Hi.Completed)})}return s}}by.ValueScope=Ey});var Z=g(function(at){Object.defineProperty(at,"__esModule",{value:!0});at.or=at.and=at.not=at.CodeGen=at.operators=at.varKinds=at.ValueScopeName=at.ValueScope=at.Scope=at.Name=at.regexpCode=at.stringify=at.getProperty=at.nil=at.strConcat=at.str=at._=void 0;var P=io(),Oe=Iu(),Hr=io();Object.defineProperty(at,"_",{enumerable:!0,get:function(){return Hr._}});Object.defineProperty(at,"str",{enumerable:!0,get:function(){return Hr.str}});Object.defineProperty(at,"strConcat",{enumerable:!0,get:function(){return Hr.strConcat}});Object.defineProperty(at,"nil",{enumerable:!0,get:function(){return Hr.nil}});Object.defineProperty(at,"getProperty",{enumerable:!0,get:function(){return Hr.getProperty}});Object.defineProperty(at,"stringify",{enumerable:!0,get:function(){return Hr.stringify}});Object.defineProperty(at,"regexpCode",{enumerable:!0,get:function(){return Hr.regexpCode}});Object.defineProperty(at,"Name",{enumerable:!0,get:function(){return Hr.Name}});var Qi=Iu();Object.defineProperty(at,"Scope",{enumerable:!0,get:function(){return Qi.Scope}});Object.defineProperty(at,"ValueScope",{enumerable:!0,get:function(){return Qi.ValueScope}});Object.defineProperty(at,"ValueScopeName",{enumerable:!0,get:function(){return Qi.ValueScopeName}});Object.defineProperty(at,"varKinds",{enumerable:!0,get:function(){return Qi.varKinds}});at.operators={GT:new P._Code(">"),GTE:new P._Code(">="),LT:new P._Code("<"),LTE:new P._Code("<="),EQ:new P._Code("==="),NEQ:new P._Code("!=="),NOT:new P._Code("!"),OR:new P._Code("||"),AND:new P._Code("&&"),ADD:new P._Code("+")};class Br{optimizeNodes(){return this}optimizeNames(e,t){return this}}class Sy extends Br{constructor(e,t,r){super();this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){let r=e?Oe.varKinds.var:this.varKind,n=this.rhs===void 0?"":` = ${this.rhs}`;return`${r} ${this.name}${n};`+t}optimizeNames(e,t){if(!e[this.name.str])return;if(this.rhs)this.rhs=as(this.rhs,e,t);return this}get names(){return this.rhs instanceof P._CodeOrName?this.rhs.names:{}}}class qu extends Br{constructor(e,t,r){super();this.lhs=e,this.rhs=t,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(this.lhs instanceof P.Name&&!e[this.lhs.str]&&!this.sideEffects)return;return this.rhs=as(this.rhs,e,t),this}get names(){let e=this.lhs instanceof P.Name?{}:{...this.lhs.names};return Ji(e,this.rhs)}}class xy extends qu{constructor(e,t,r,n){super(e,r,n);this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class Ry extends Br{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class Ty extends Br{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class ky extends Br{constructor(e){super();this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class Oy extends Br{constructor(e){super();this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=as(this.code,e,t),this}get names(){return this.code instanceof P._CodeOrName?this.code.names:{}}}class Zi extends Br{constructor(e=[]){super();this.nodes=e}render(e){return this.nodes.reduce((t,r)=>t+r.render(e),"")}optimizeNodes(){let{nodes:e}=this,t=e.length;while(t--){let r=e[t].optimizeNodes();if(Array.isArray(r))e.splice(t,1,...r);else if(r)e[t]=r;else e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){let{nodes:r}=this,n=r.length;while(n--){let s=r[n];if(s.optimizeNames(e,t))continue;AI(e,s.names),r.splice(n,1)}return r.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>wn(e,t.names),{})}}class Wr extends Zi{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class Ay extends Zi{}class ao extends Wr{}ao.kind="else";class _r extends Wr{constructor(e,t){super(t);this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);if(this.else)t+="else "+this.else.render(e);return t}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let t=this.else;if(t){let r=t.optimizeNodes();t=this.else=Array.isArray(r)?new ao(r):r}if(t){if(e===!1)return t instanceof _r?t:t.nodes;if(this.nodes.length)return this;return new _r(jy(e),t instanceof _r?[t]:t.nodes)}if(e===!1||!this.nodes.length)return;return this}optimizeNames(e,t){var r;if(this.else=(r=this.else)===null||r===void 0?void 0:r.optimizeNames(e,t),!(super.optimizeNames(e,t)||this.else))return;return this.condition=as(this.condition,e,t),this}get names(){let e=super.names;if(Ji(e,this.condition),this.else)wn(e,this.else.names);return e}}_r.kind="if";class is extends Wr{}is.kind="for";class Py extends is{constructor(e){super();this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(!super.optimizeNames(e,t))return;return this.iteration=as(this.iteration,e,t),this}get names(){return wn(super.names,this.iteration.names)}}class Ny extends is{constructor(e,t,r,n){super();this.varKind=e,this.name=t,this.from=r,this.to=n}render(e){let t=e.es5?Oe.varKinds.var:this.varKind,{name:r,from:n,to:s}=this;return`for(${t} ${r}=${n}; ${r}<${s}; ${r}++)`+super.render(e)}get names(){let e=Ji(super.names,this.from);return Ji(e,this.to)}}class Cu extends is{constructor(e,t,r,n){super();this.loop=e,this.varKind=t,this.name=r,this.iterable=n}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(!super.optimizeNames(e,t))return;return this.iterable=as(this.iterable,e,t),this}get names(){return wn(super.names,this.iterable.names)}}class Bi extends Wr{constructor(e,t,r){super();this.name=e,this.args=t,this.async=r}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}Bi.kind="func";class Wi extends Zi{render(e){return"return "+super.render(e)}}Wi.kind="return";class Iy extends Wr{render(e){let t="try"+super.render(e);if(this.catch)t+=this.catch.render(e);if(this.finally)t+=this.finally.render(e);return t}optimizeNodes(){var e,t;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(t=this.finally)===null||t===void 0||t.optimizeNodes(),this}optimizeNames(e,t){var r,n;return super.optimizeNames(e,t),(r=this.catch)===null||r===void 0||r.optimizeNames(e,t),(n=this.finally)===null||n===void 0||n.optimizeNames(e,t),this}get names(){let e=super.names;if(this.catch)wn(e,this.catch.names);if(this.finally)wn(e,this.finally.names);return e}}class Yi extends Wr{constructor(e){super();this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}Yi.kind="catch";class Xi extends Wr{render(e){return"finally"+super.render(e)}}Xi.kind="finally";class Cy{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?`
11
+ `:""},this._extScope=e,this._scope=new Oe.Scope({parent:e}),this._nodes=[new Ay]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){let r=this._extScope.value(e,t);return(this._values[r.prefix]||(this._values[r.prefix]=new Set)).add(r),r}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,r,n){let s=this._scope.toName(t);if(r!==void 0&&n)this._constants[s.str]=r;return this._leafNode(new Sy(e,s,r)),s}const(e,t,r){return this._def(Oe.varKinds.const,e,t,r)}let(e,t,r){return this._def(Oe.varKinds.let,e,t,r)}var(e,t,r){return this._def(Oe.varKinds.var,e,t,r)}assign(e,t,r){return this._leafNode(new qu(e,t,r))}add(e,t){return this._leafNode(new xy(e,at.operators.ADD,t))}code(e){if(typeof e=="function")e();else if(e!==P.nil)this._leafNode(new Oy(e));return this}object(...e){let t=["{"];for(let[r,n]of e){if(t.length>1)t.push(",");if(t.push(r),r!==n||this.opts.es5)t.push(":"),P.addCodeArg(t,n)}return t.push("}"),new P._Code(t)}if(e,t,r){if(this._blockNode(new _r(e)),t&&r)this.code(t).else().code(r).endIf();else if(t)this.code(t).endIf();else if(r)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new _r(e))}else(){return this._elseNode(new ao)}endIf(){return this._endBlockNode(_r,ao)}_for(e,t){if(this._blockNode(e),t)this.code(t).endFor();return this}for(e,t){return this._for(new Py(e),t)}forRange(e,t,r,n,s=this.opts.es5?Oe.varKinds.var:Oe.varKinds.let){let o=this._scope.toName(e);return this._for(new Ny(s,o,t,r),()=>n(o))}forOf(e,t,r,n=Oe.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let o=t instanceof P.Name?t:this.var("_arr",t);return this.forRange("_i",0,P._`${o}.length`,(i)=>{this.var(s,P._`${o}[${i}]`),r(s)})}return this._for(new Cu("of",n,s,t),()=>r(s))}forIn(e,t,r,n=this.opts.es5?Oe.varKinds.var:Oe.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,P._`Object.keys(${t})`,r);let s=this._scope.toName(e);return this._for(new Cu("in",n,s,t),()=>r(s))}endFor(){return this._endBlockNode(is)}label(e){return this._leafNode(new Ry(e))}break(e){return this._leafNode(new Ty(e))}return(e){let t=new Wi;if(this._blockNode(t),this.code(e),t.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(Wi)}try(e,t,r){if(!t&&!r)throw Error('CodeGen: "try" without "catch" and "finally"');let n=new Iy;if(this._blockNode(n),this.code(e),t){let s=this.name("e");this._currNode=n.catch=new Yi(s),t(s)}if(r)this._currNode=n.finally=new Xi,this.code(r);return this._endBlockNode(Yi,Xi)}throw(e){return this._leafNode(new ky(e))}block(e,t){if(this._blockStarts.push(this._nodes.length),e)this.code(e).endBlock(t);return this}endBlock(e){let t=this._blockStarts.pop();if(t===void 0)throw Error("CodeGen: not in self-balancing block");let r=this._nodes.length-t;if(r<0||e!==void 0&&r!==e)throw Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=P.nil,r,n){if(this._blockNode(new Bi(e,t,r)),n)this.code(n).endFunc();return this}endFunc(){return this._endBlockNode(Bi)}optimize(e=1){while(e-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){let r=this._currNode;if(r instanceof e||t&&r instanceof t)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){let t=this._currNode;if(!(t instanceof _r))throw Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let t=this._nodes;t[t.length-1]=e}}at.CodeGen=Cy;function wn(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function Ji(e,t){return t instanceof P._CodeOrName?wn(e,t.names):e}function as(e,t,r){if(e instanceof P.Name)return n(e);if(!s(e))return e;return new P._Code(e._items.reduce((o,i)=>{if(i instanceof P.Name)i=n(i);if(i instanceof P._Code)o.push(...i._items);else o.push(i);return o},[]));function n(o){let i=r[o.str];if(i===void 0||t[o.str]!==1)return o;return delete t[o.str],i}function s(o){return o instanceof P._Code&&o._items.some((i)=>i instanceof P.Name&&t[i.str]===1&&r[i.str]!==void 0)}}function AI(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}function jy(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:P._`!${ju(e)}`}at.not=jy;var PI=qy(at.operators.AND);function NI(...e){return e.reduce(PI)}at.and=NI;var II=qy(at.operators.OR);function CI(...e){return e.reduce(II)}at.or=CI;function qy(e){return(t,r)=>t===P.nil?r:r===P.nil?t:P._`${ju(t)} ${e} ${ju(r)}`}function ju(e){return e instanceof P.Name?e:P._`(${e})`}});var ae=g(function(Hy){Object.defineProperty(Hy,"__esModule",{value:!0});Hy.checkStrictMode=Hy.getErrorPath=Hy.Type=Hy.useFunc=Hy.setEvaluated=Hy.evaluatedPropsToName=Hy.mergeEvaluated=Hy.eachItem=Hy.unescapeJsonPointer=Hy.escapeJsonPointer=Hy.escapeFragment=Hy.unescapeFragment=Hy.schemaRefOrVal=Hy.schemaHasRulesButRef=Hy.schemaHasRules=Hy.checkUnknownRules=Hy.alwaysValidSchema=Hy.toHash=void 0;var U=Z(),Uy=io();function MI(e){let t={};for(let r of e)t[r]=!0;return t}Hy.toHash=MI;function LI(e,t){if(typeof t=="boolean")return t;if(Object.keys(t).length===0)return!0;return Fy(e,t),!Vy(t,e.self.RULES.all)}Hy.alwaysValidSchema=LI;function Fy(e,t=e.schema){let{opts:r,self:n}=e;if(!r.strictSchema)return;if(typeof t==="boolean")return;let s=n.RULES.keywords;for(let o in t)if(!s[o])Ky(e,`unknown keyword: "${o}"`)}Hy.checkUnknownRules=Fy;function Vy(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}Hy.schemaHasRules=Vy;function UI(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}Hy.schemaHasRulesButRef=UI;function FI({topSchemaRef:e,schemaPath:t},r,n,s){if(!s){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return U._`${r}`}return U._`${e}${t}${U.getProperty(n)}`}Hy.schemaRefOrVal=FI;function VI(e){return zy(decodeURIComponent(e))}Hy.unescapeFragment=VI;function zI(e){return encodeURIComponent(Mu(e))}Hy.escapeFragment=zI;function Mu(e){if(typeof e=="number")return`${e}`;return e.replace(/~/g,"~0").replace(/\//g,"~1")}Hy.escapeJsonPointer=Mu;function zy(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}Hy.unescapeJsonPointer=zy;function GI(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}Hy.eachItem=GI;function My({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(s,o,i,a)=>{let c=i===void 0?o:i instanceof U.Name?(o instanceof U.Name?e(s,o,i):t(s,o,i),i):o instanceof U.Name?(t(s,i,o),o):r(o,i);return a===U.Name&&!(c instanceof U.Name)?n(s,c):c}}Hy.mergeEvaluated={props:My({mergeNames:(e,t,r)=>e.if(U._`${r} !== true && ${t} !== undefined`,()=>{e.if(U._`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,U._`${r} || {}`).code(U._`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if(U._`${r} !== true`,()=>{if(t===!0)e.assign(r,!0);else e.assign(r,U._`${r} || {}`),Lu(e,r,t)}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:Gy}),items:My({mergeNames:(e,t,r)=>e.if(U._`${r} !== true && ${t} !== undefined`,()=>e.assign(r,U._`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if(U._`${r} !== true`,()=>e.assign(r,t===!0?!0:U._`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function Gy(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",U._`{}`);if(t!==void 0)Lu(e,r,t);return r}Hy.evaluatedPropsToName=Gy;function Lu(e,t,r){Object.keys(r).forEach((n)=>e.assign(U._`${t}${U.getProperty(n)}`,!0))}Hy.setEvaluated=Lu;var Ly={};function KI(e,t){return e.scopeValue("func",{ref:t,code:Ly[t.code]||(Ly[t.code]=new Uy._Code(t.code))})}Hy.useFunc=KI;var Du;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(Du||(Hy.Type=Du={}));function HI(e,t,r){if(e instanceof U.Name){let n=t===Du.Num;return r?n?U._`"[" + ${e} + "]"`:U._`"['" + ${e} + "']"`:n?U._`"/" + ${e}`:U._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?U.getProperty(e).toString():"/"+Mu(e)}Hy.getErrorPath=HI;function Ky(e,t,r=e.opts.strictSchema){if(!r)return;if(t=`strict mode: ${t}`,r===!0)throw Error(t);e.self.logger.warn(t)}Hy.checkStrictMode=Ky});var vr=g(function(Wy){Object.defineProperty(Wy,"__esModule",{value:!0});var ue=Z(),l1={data:new ue.Name("data"),valCxt:new ue.Name("valCxt"),instancePath:new ue.Name("instancePath"),parentData:new ue.Name("parentData"),parentDataProperty:new ue.Name("parentDataProperty"),rootData:new ue.Name("rootData"),dynamicAnchors:new ue.Name("dynamicAnchors"),vErrors:new ue.Name("vErrors"),errors:new ue.Name("errors"),this:new ue.Name("this"),self:new ue.Name("self"),scope:new ue.Name("scope"),json:new ue.Name("json"),jsonPos:new ue.Name("jsonPos"),jsonLen:new ue.Name("jsonLen"),jsonPart:new ue.Name("jsonPart")};Wy.default=l1});var co=g(function(Qy){Object.defineProperty(Qy,"__esModule",{value:!0});Qy.extendErrors=Qy.resetErrorsCount=Qy.reportExtraError=Qy.reportError=Qy.keyword$DataError=Qy.keywordError=void 0;var C=Z(),Yr=ae(),Ye=vr();Qy.keywordError={message:({keyword:e})=>C.str`must pass "${e}" keyword validation`};Qy.keyword$DataError={message:({keyword:e,schemaType:t})=>t?C.str`"${e}" keyword must be ${t} ($data)`:C.str`"${e}" keyword is invalid ($data)`};function f1(e,t=Qy.keywordError,r,n){let{it:s}=e,{gen:o,compositeRule:i,allErrors:a}=s,c=Jy(e,t,r);if(n!==null&&n!==void 0?n:i||a)Yy(o,c);else Xy(s,C._`[${c}]`)}Qy.reportError=f1;function p1(e,t=Qy.keywordError,r){let{it:n}=e,{gen:s,compositeRule:o,allErrors:i}=n,a=Jy(e,t,r);if(Yy(s,a),!(o||i))Xy(n,Ye.default.vErrors)}Qy.reportExtraError=p1;function h1(e,t){e.assign(Ye.default.errors,t),e.if(C._`${Ye.default.vErrors} !== null`,()=>e.if(t,()=>e.assign(C._`${Ye.default.vErrors}.length`,t),()=>e.assign(Ye.default.vErrors,null)))}Qy.resetErrorsCount=h1;function m1({gen:e,keyword:t,schemaValue:r,data:n,errsCount:s,it:o}){if(s===void 0)throw Error("ajv implementation error");let i=e.name("err");e.forRange("i",s,Ye.default.errors,(a)=>{if(e.const(i,C._`${Ye.default.vErrors}[${a}]`),e.if(C._`${i}.instancePath === undefined`,()=>e.assign(C._`${i}.instancePath`,C.strConcat(Ye.default.instancePath,o.errorPath))),e.assign(C._`${i}.schemaPath`,C.str`${o.errSchemaPath}/${t}`),o.opts.verbose)e.assign(C._`${i}.schema`,r),e.assign(C._`${i}.data`,n)})}Qy.extendErrors=m1;function Yy(e,t){let r=e.const("err",t);e.if(C._`${Ye.default.vErrors} === null`,()=>e.assign(Ye.default.vErrors,C._`[${r}]`),C._`${Ye.default.vErrors}.push(${r})`),e.code(C._`${Ye.default.errors}++`)}function Xy(e,t){let{gen:r,validateName:n,schemaEnv:s}=e;if(s.$async)r.throw(C._`new ${e.ValidationError}(${t})`);else r.assign(C._`${n}.errors`,t),r.return(!1)}var Sn={keyword:new C.Name("keyword"),schemaPath:new C.Name("schemaPath"),params:new C.Name("params"),propertyName:new C.Name("propertyName"),message:new C.Name("message"),schema:new C.Name("schema"),parentSchema:new C.Name("parentSchema")};function Jy(e,t,r){let{createErrors:n}=e.it;if(n===!1)return C._`{}`;return g1(e,t,r)}function g1(e,t,r={}){let{gen:n,it:s}=e,o=[y1(s,r),_1(e,r)];return v1(e,t,o),n.object(...o)}function y1({errorPath:e},{instancePath:t}){let r=t?C.str`${e}${Yr.getErrorPath(t,Yr.Type.Str)}`:e;return[Ye.default.instancePath,C.strConcat(Ye.default.instancePath,r)]}function _1({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let s=n?t:C.str`${t}/${e}`;if(r)s=C.str`${s}${Yr.getErrorPath(r,Yr.Type.Str)}`;return[Sn.schemaPath,s]}function v1(e,{params:t,message:r},n){let{keyword:s,data:o,schemaValue:i,it:a}=e,{opts:c,propertyName:u,topSchemaRef:d,schemaPath:l}=a;if(n.push([Sn.keyword,s],[Sn.params,typeof t=="function"?t(e):t||C._`{}`]),c.messages)n.push([Sn.message,typeof r=="function"?r(e):r]);if(c.verbose)n.push([Sn.schema,i],[Sn.parentSchema,C._`${d}${l}`],[Ye.default.data,o]);if(u)n.push([Sn.propertyName,u])}});var o_=g(function(n_){Object.defineProperty(n_,"__esModule",{value:!0});n_.boolOrEmptySchema=n_.topBoolOrEmptySchema=void 0;var e_=co(),t_=Z(),S1=vr(),x1={message:"boolean schema is false"};function R1(e){let{gen:t,schema:r,validateName:n}=e;if(r===!1)r_(e,!1);else if(typeof r=="object"&&r.$async===!0)t.return(S1.default.data);else t.assign(t_._`${n}.errors`,null),t.return(!0)}n_.topBoolOrEmptySchema=R1;function T1(e,t){let{gen:r,schema:n}=e;if(n===!1)r.var(t,!1),r_(e);else r.var(t,!0)}n_.boolOrEmptySchema=T1;function r_(e,t){let{gen:r,data:n}=e;e_.reportError({gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e},x1,void 0,t)}});var Fu=g(function(i_){Object.defineProperty(i_,"__esModule",{value:!0});i_.getRules=i_.isJSONType=void 0;var O1=["string","number","integer","boolean","null","object","array"],A1=new Set(O1);function P1(e){return typeof e=="string"&&A1.has(e)}i_.isJSONType=P1;function N1(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}i_.getRules=N1});var Vu=g(function(l_){Object.defineProperty(l_,"__esModule",{value:!0});l_.shouldUseRule=l_.shouldUseGroup=l_.schemaHasRulesForType=void 0;function C1({schema:e,self:t},r){let n=t.RULES.types[r];return n&&n!==!0&&c_(e,n)}l_.schemaHasRulesForType=C1;function c_(e,t){return t.rules.some((r)=>u_(e,r))}l_.shouldUseGroup=c_;function u_(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))}l_.shouldUseRule=u_});var uo=g(function(y_){Object.defineProperty(y_,"__esModule",{value:!0});y_.reportTypeError=y_.checkDataTypes=y_.checkDataType=y_.coerceAndCheckDataType=y_.getJSONTypes=y_.getSchemaTypes=y_.DataType=void 0;var f_=Fu(),p_=Vu(),h_=co(),R=Z(),ta=ae(),cs;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(cs||(y_.DataType=cs={}));function D1(e){let t=m_(e.type);if(t.includes("null")){if(e.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');if(e.nullable===!0)t.push("null")}return t}y_.getSchemaTypes=D1;function m_(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(f_.isJSONType))return t;throw Error("type must be JSONType or JSONType[]: "+t.join(","))}y_.getJSONTypes=m_;function M1(e,t){let{gen:r,data:n,opts:s}=e,o=L1(t,s.coerceTypes),i=t.length>0&&!(o.length===0&&t.length===1&&p_.schemaHasRulesForType(e,t[0]));if(i){let a=Gu(t,n,s.strictNumbers,cs.Wrong);r.if(a,()=>{if(o.length)U1(e,t,o);else Ku(e)})}return i}y_.coerceAndCheckDataType=M1;var g_=new Set(["string","number","integer","boolean","null"]);function L1(e,t){return t?e.filter((r)=>g_.has(r)||t==="array"&&r==="array"):[]}function U1(e,t,r){let{gen:n,data:s,opts:o}=e,i=n.let("dataType",R._`typeof ${s}`),a=n.let("coerced",R._`undefined`);if(o.coerceTypes==="array")n.if(R._`${i} == 'object' && Array.isArray(${s}) && ${s}.length == 1`,()=>n.assign(s,R._`${s}[0]`).assign(i,R._`typeof ${s}`).if(Gu(t,s,o.strictNumbers),()=>n.assign(a,s)));n.if(R._`${a} !== undefined`);for(let u of r)if(g_.has(u)||u==="array"&&o.coerceTypes==="array")c(u);n.else(),Ku(e),n.endIf(),n.if(R._`${a} !== undefined`,()=>{n.assign(s,a),F1(e,a)});function c(u){switch(u){case"string":n.elseIf(R._`${i} == "number" || ${i} == "boolean"`).assign(a,R._`"" + ${s}`).elseIf(R._`${s} === null`).assign(a,R._`""`);return;case"number":n.elseIf(R._`${i} == "boolean" || ${s} === null
12
12
  || (${i} == "string" && ${s} && ${s} == +${s})`).assign(a,R._`+${s}`);return;case"integer":n.elseIf(R._`${i} === "boolean" || ${s} === null
13
13
  || (${i} === "string" && ${s} && ${s} == +${s} && !(${s} % 1))`).assign(a,R._`+${s}`);return;case"boolean":n.elseIf(R._`${s} === "false" || ${s} === 0 || ${s} === null`).assign(a,!1).elseIf(R._`${s} === "true" || ${s} === 1`).assign(a,!0);return;case"null":n.elseIf(R._`${s} === "" || ${s} === 0 || ${s} === false`),n.assign(a,null);return;case"array":n.elseIf(R._`${i} === "string" || ${i} === "number"
14
- || ${i} === "boolean" || ${s} === null`).assign(a,R._`[${s}]`)}}}function F1({gen:e,parentData:t,parentDataProperty:r},n){e.if(R._`${t} !== undefined`,()=>e.assign(R._`${t}[${r}]`,n))}function zu(e,t,r,n=cs.Correct){let s=n===cs.Correct?R.operators.EQ:R.operators.NEQ,o;switch(e){case"null":return R._`${t} ${s} null`;case"array":o=R._`Array.isArray(${t})`;break;case"object":o=R._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":o=i(R._`!(${t} % 1) && !isNaN(${t})`);break;case"number":o=i();break;default:return R._`typeof ${t} ${s} ${e}`}return n===cs.Correct?o:R.not(o);function i(a=R.nil){return R.and(R._`typeof ${t} == "number"`,a,r?R._`isFinite(${t})`:R.nil)}}y_.checkDataType=zu;function Gu(e,t,r,n){if(e.length===1)return zu(e[0],t,r,n);let s,o=ta.toHash(e);if(o.array&&o.object){let i=R._`typeof ${t} != "object"`;s=o.null?i:R._`!${t} || ${i}`,delete o.null,delete o.array,delete o.object}else s=R.nil;if(o.number)delete o.integer;for(let i in o)s=R.and(s,zu(i,t,r,n));return s}y_.checkDataTypes=Gu;var V1={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?R._`{type: ${e}}`:R._`{type: ${t}}`};function Ku(e){let t=z1(e);h_.reportError(t,V1)}y_.reportTypeError=Ku;function z1(e){let{gen:t,data:r,schema:n}=e,s=ta.schemaRefOrVal(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:s,schemaValue:s,parentSchema:n,params:{},it:e}}});var b_=g(function(E_){Object.defineProperty(E_,"__esModule",{value:!0});E_.assignDefaults=void 0;var yt=Z(),$_=ae();function X1(e,t){let{properties:r,items:n}=e.schema;if(t==="object"&&r)for(let s in r)v_(e,s,r[s].default);else if(t==="array"&&Array.isArray(n))n.forEach((s,o)=>v_(e,o,s.default))}E_.assignDefaults=X1;function v_(e,t,r){let{gen:n,compositeRule:s,data:o,opts:i}=e;if(r===void 0)return;let a=yt._`${o}${yt.getProperty(t)}`;if(s){$_.checkStrictMode(e,`default is ignored for: ${a}`);return}let c=yt._`${a} === undefined`;if(i.useDefaults==="empty")c=yt._`${c} || ${a} === null || ${a} === ""`;n.if(c,yt._`${a} = ${yt.stringify(r)}`)}});var _t=g(function(T_){Object.defineProperty(T_,"__esModule",{value:!0});T_.validateUnion=T_.validateArray=T_.usePattern=T_.callValidateCode=T_.schemaProperties=T_.allSchemaProperties=T_.noPropertyInData=T_.propertyInData=T_.isOwnProperty=T_.hasPropFunc=T_.reportMissingProp=T_.checkMissingProp=T_.checkReportMissingProp=void 0;var z=Z(),us=ae(),Xr=vr(),S_=ae();function J1(e,t){let{gen:r,data:n,it:s}=e;r.if(Bu(r,n,t,s.opts.ownProperties),()=>{e.setParams({missingProperty:z._`${t}`},!0),e.error()})}T_.checkReportMissingProp=J1;function Q1({gen:e,data:t,it:{opts:r}},n,s){return z.or(...n.map((o)=>z.and(Bu(e,t,o,r.ownProperties),z._`${s} = ${o}`)))}T_.checkMissingProp=Q1;function Z1(e,t){e.setParams({missingProperty:t},!0),e.error()}T_.reportMissingProp=Z1;function x_(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:z._`Object.prototype.hasOwnProperty`})}T_.hasPropFunc=x_;function Hu(e,t,r){return z._`${x_(e)}.call(${t}, ${r})`}T_.isOwnProperty=Hu;function eC(e,t,r,n){let s=z._`${t}${z.getProperty(r)} !== undefined`;return n?z._`${s} && ${Hu(e,t,r)}`:s}T_.propertyInData=eC;function Bu(e,t,r,n){let s=z._`${t}${z.getProperty(r)} === undefined`;return n?z.or(s,z.not(Hu(e,t,r))):s}T_.noPropertyInData=Bu;function R_(e){return e?Object.keys(e).filter((t)=>t!=="__proto__"):[]}T_.allSchemaProperties=R_;function tC(e,t){return R_(t).filter((r)=>!us.alwaysValidSchema(e,t[r]))}T_.schemaProperties=tC;function rC({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:s,errorPath:o},it:i},a,c,u){let d=u?z._`${e}, ${t}, ${n}${s}`:t,l=[[Xr.default.instancePath,z.strConcat(Xr.default.instancePath,o)],[Xr.default.parentData,i.parentData],[Xr.default.parentDataProperty,i.parentDataProperty],[Xr.default.rootData,Xr.default.rootData]];if(i.opts.dynamicRef)l.push([Xr.default.dynamicAnchors,Xr.default.dynamicAnchors]);let p=z._`${d}, ${r.object(...l)}`;return c!==z.nil?z._`${a}.call(${c}, ${p})`:z._`${a}(${p})`}T_.callValidateCode=rC;var nC=z._`new RegExp`;function sC({gen:e,it:{opts:t}},r){let n=t.unicodeRegExp?"u":"",{regExp:s}=t.code,o=s(r,n);return e.scopeValue("pattern",{key:o.toString(),ref:o,code:z._`${s.code==="new RegExp"?nC:S_.useFunc(e,s)}(${r}, ${n})`})}T_.usePattern=sC;function oC(e){let{gen:t,data:r,keyword:n,it:s}=e,o=t.name("valid");if(s.allErrors){let a=t.let("valid",!0);return i(()=>t.assign(a,!1)),a}return t.var(o,!0),i(()=>t.break()),o;function i(a){let c=t.const("len",z._`${r}.length`);t.forRange("i",0,c,(u)=>{e.subschema({keyword:n,dataProp:u,dataPropType:us.Type.Num},o),t.if(z.not(o),a)})}}T_.validateArray=oC;function iC(e){let{gen:t,schema:r,keyword:n,it:s}=e;if(!Array.isArray(r))throw Error("ajv implementation error");if(r.some((c)=>us.alwaysValidSchema(s,c))&&!s.opts.unevaluated)return;let i=t.let("valid",!1),a=t.name("_valid");t.block(()=>r.forEach((c,u)=>{let d=e.subschema({keyword:n,schemaProp:u,compositeRule:!0},a);if(t.assign(i,z._`${i} || ${a}`),!e.mergeValidEvaluated(d,a))t.if(z.not(i))})),e.result(i,()=>e.reset(),()=>e.error(!0))}T_.validateUnion=iC});var j_=g(function(I_){Object.defineProperty(I_,"__esModule",{value:!0});I_.validateKeywordUsage=I_.validSchemaType=I_.funcKeywordCode=I_.macroKeywordCode=void 0;var de=Z(),xn=vr(),A_=_t(),P_=co();function vC(e,t){let{gen:r,keyword:n,schema:s,parentSchema:o,it:i}=e,a=t.macro.call(i.self,s,o,i),c=N_(r,n,a);if(i.opts.validateSchema!==!1)i.self.validateSchema(a,!0);let u=r.name("valid");e.subschema({schema:a,schemaPath:de.nil,errSchemaPath:`${i.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},u),e.pass(u,()=>e.error(!0))}I_.macroKeywordCode=vC;function $C(e,t){var r;let{gen:n,keyword:s,schema:o,parentSchema:i,$data:a,it:c}=e;wC(c,t);let u=!a&&t.compile?t.compile.call(c.self,o,i,c):t.validate,d=N_(n,s,u),l=n.let("valid");e.block$data(l,p),e.ok((r=t.valid)!==null&&r!==void 0?r:l);function p(){if(t.errors===!1){if(m(),t.modifying)O_(e);y(()=>e.error())}else{let _=t.async?f():h();if(t.modifying)O_(e);y(()=>EC(e,_))}}function f(){let _=n.let("ruleErrs",null);return n.try(()=>m(de._`await `),(O)=>n.assign(l,!1).if(de._`${O} instanceof ${c.ValidationError}`,()=>n.assign(_,de._`${O}.errors`),()=>n.throw(O))),_}function h(){let _=de._`${d}.errors`;return n.assign(_,null),m(de.nil),_}function m(_=t.async?de._`await `:de.nil){let O=c.opts.passContext?xn.default.this:xn.default.self,T=!(("compile"in t)&&!a||t.schema===!1);n.assign(l,de._`${_}${A_.callValidateCode(e,d,O,T)}`,t.modifying)}function y(_){var O;n.if(de.not((O=t.valid)!==null&&O!==void 0?O:l),_)}}I_.funcKeywordCode=$C;function O_(e){let{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,de._`${n.parentData}[${n.parentDataProperty}]`))}function EC(e,t){let{gen:r}=e;r.if(de._`Array.isArray(${t})`,()=>{r.assign(xn.default.vErrors,de._`${xn.default.vErrors} === null ? ${t} : ${xn.default.vErrors}.concat(${t})`).assign(xn.default.errors,de._`${xn.default.vErrors}.length`),P_.extendErrors(e)},()=>e.error())}function wC({schemaEnv:e},t){if(t.async&&!e.$async)throw Error("async keyword in sync schema")}function N_(e,t,r){if(r===void 0)throw Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:de.stringify(r)})}function bC(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>"u")}I_.validSchemaType=bC;function SC({schema:e,opts:t,self:r,errSchemaPath:n},s,o){if(Array.isArray(s.keyword)?!s.keyword.includes(o):s.keyword!==o)throw Error("ajv implementation error");let i=s.dependencies;if(i===null||i===void 0?void 0:i.some((a)=>!Object.prototype.hasOwnProperty.call(e,a)))throw Error(`parent schema must have dependencies of ${o}: ${i.join(",")}`);if(s.validateSchema){if(!s.validateSchema(e[o])){let c=`keyword "${o}" value is invalid at path "${n}": `+r.errorsText(s.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(c);else throw Error(c)}}}I_.validateKeywordUsage=SC});var M_=g(function(q_){Object.defineProperty(q_,"__esModule",{value:!0});q_.extendSubschemaMode=q_.extendSubschemaData=q_.getSubschema=void 0;var qe=Z(),ra=ae();function kC(e,{keyword:t,schemaProp:r,schema:n,schemaPath:s,errSchemaPath:o,topSchemaRef:i}){if(t!==void 0&&n!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){let a=e.schema[t];return r===void 0?{schema:a,schemaPath:qe._`${e.schemaPath}${qe.getProperty(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:a[r],schemaPath:qe._`${e.schemaPath}${qe.getProperty(t)}${qe.getProperty(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${ra.escapeFragment(r)}`}}if(n!==void 0){if(s===void 0||o===void 0||i===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:s,topSchemaRef:i,errSchemaPath:o}}throw Error('either "keyword" or "schema" must be passed')}q_.getSubschema=kC;function OC(e,t,{dataProp:r,dataPropType:n,data:s,dataTypes:o,propertyName:i}){if(s!==void 0&&r!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=t;if(r!==void 0){let{errorPath:u,dataPathArr:d,opts:l}=t,p=a.let("data",qe._`${t.data}${qe.getProperty(r)}`,!0);c(p),e.errorPath=qe.str`${u}${ra.getErrorPath(r,n,l.jsPropertySyntax)}`,e.parentDataProperty=qe._`${r}`,e.dataPathArr=[...d,e.parentDataProperty]}if(s!==void 0){let u=s instanceof qe.Name?s:a.let("data",s,!0);if(c(u),i!==void 0)e.propertyName=i}if(o)e.dataTypes=o;function c(u){e.data=u,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,u]}}q_.extendSubschemaData=OC;function AC(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:s,allErrors:o}){if(n!==void 0)e.compositeRule=n;if(s!==void 0)e.createErrors=s;if(o!==void 0)e.allErrors=o;e.jtdDiscriminator=t,e.jtdMetadata=r}q_.extendSubschemaMode=AC});var lo=g(function(z_){Object.defineProperty(z_,"__esModule",{value:!0});z_.getSchemaRefs=z_.resolveUrl=z_.normalizeId=z_._getFullPath=z_.getFullPath=z_.inlineRef=void 0;var L_=ae(),IC=Js(),CC=ru(),jC=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function qC(e,t=!0){if(typeof e=="boolean")return!0;if(t===!0)return!Wu(e);if(!t)return!1;return U_(e)<=t}z_.inlineRef=qC;var DC=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Wu(e){for(let t in e){if(DC.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(Wu))return!0;if(typeof r=="object"&&Wu(r))return!0}return!1}function U_(e){let t=0;for(let r in e){if(r==="$ref")return 1/0;if(t++,jC.has(r))continue;if(typeof e[r]=="object")L_.eachItem(e[r],(n)=>t+=U_(n));if(t===1/0)return 1/0}return t}function F_(e,t="",r){if(r!==!1)t=ls(t);let n=e.parse(t);return V_(e,n)}z_.getFullPath=F_;function V_(e,t){return e.serialize(t).split("#")[0]+"#"}z_._getFullPath=V_;var MC=/#\/?$/;function ls(e){return e?e.replace(MC,""):""}z_.normalizeId=ls;function LC(e,t,r){return r=ls(r),e.resolve(t,r)}z_.resolveUrl=LC;var UC=/^[a-z_][-a-z0-9._]*$/i;function FC(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,s=ls(e[r]||t),o={"":s},i=F_(n,s,!1),a={},c=new Set;return CC(e,{allKeys:!0},(l,p,f,h)=>{if(h===void 0)return;let m=i+p,y=o[h];if(typeof l[r]=="string")y=_.call(this,l[r]);O.call(this,l.$anchor),O.call(this,l.$dynamicAnchor),o[p]=y;function _(T){let M=this.opts.uriResolver.resolve;if(T=ls(y?M(y,T):T),c.has(T))throw d(T);c.add(T);let S=this.refs[T];if(typeof S=="string")S=this.refs[S];if(typeof S=="object")u(l,S.schema,T);else if(T!==ls(m))if(T[0]==="#")u(l,a[T],T),a[T]=l;else this.refs[T]=m;return T}function O(T){if(typeof T=="string"){if(!UC.test(T))throw Error(`invalid anchor "${T}"`);_.call(this,`#${T}`)}}}),a;function u(l,p,f){if(p!==void 0&&!IC(l,p))throw d(f)}function d(l){return Error(`reference "${l}" resolves to more than one schema`)}}z_.getSchemaRefs=FC});var fo=g(function(ov){Object.defineProperty(ov,"__esModule",{value:!0});ov.getData=ov.KeywordCxt=ov.validateFunctionCode=void 0;var sa=o_(),na=uo(),fs=Vu(),Jr=uo(),W_=b_(),Jt=j_(),ds=M_(),w=Z(),B=vr(),Y_=lo(),Le=ae(),Xt=co();function BC(e){if(Q_(e)){if(Z_(e),J_(e)){XC(e);return}}X_(e,()=>sa.topBoolOrEmptySchema(e))}ov.validateFunctionCode=BC;function X_({gen:e,validateName:t,schema:r,schemaEnv:n,opts:s},o){if(s.code.es5)e.func(t,w._`${B.default.data}, ${B.default.valCxt}`,n.$async,()=>{e.code(w._`"use strict"; ${K_(r,s)}`),YC(e,s),e.code(o)});else e.func(t,w._`${B.default.data}, ${WC(s)}`,n.$async,()=>e.code(K_(r,s)).code(o))}function WC(e){return w._`{${B.default.instancePath}="", ${B.default.parentData}, ${B.default.parentDataProperty}, ${B.default.rootData}=${B.default.data}${e.dynamicRef?w._`, ${B.default.dynamicAnchors}={}`:w.nil}}={}`}function YC(e,t){e.if(B.default.valCxt,()=>{if(e.var(B.default.instancePath,w._`${B.default.valCxt}.${B.default.instancePath}`),e.var(B.default.parentData,w._`${B.default.valCxt}.${B.default.parentData}`),e.var(B.default.parentDataProperty,w._`${B.default.valCxt}.${B.default.parentDataProperty}`),e.var(B.default.rootData,w._`${B.default.valCxt}.${B.default.rootData}`),t.dynamicRef)e.var(B.default.dynamicAnchors,w._`${B.default.valCxt}.${B.default.dynamicAnchors}`)},()=>{if(e.var(B.default.instancePath,w._`""`),e.var(B.default.parentData,w._`undefined`),e.var(B.default.parentDataProperty,w._`undefined`),e.var(B.default.rootData,B.default.data),t.dynamicRef)e.var(B.default.dynamicAnchors,w._`{}`)})}function XC(e){let{schema:t,opts:r,gen:n}=e;X_(e,()=>{if(r.$comment&&t.$comment)tv(e);if(tj(e),n.let(B.default.vErrors,null),n.let(B.default.errors,0),r.unevaluated)JC(e);ev(e),sj(e)});return}function JC(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",w._`${r}.evaluated`),t.if(w._`${e.evaluated}.dynamicProps`,()=>t.assign(w._`${e.evaluated}.props`,w._`undefined`)),t.if(w._`${e.evaluated}.dynamicItems`,()=>t.assign(w._`${e.evaluated}.items`,w._`undefined`))}function K_(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?w._`/*# sourceURL=${r} */`:w.nil}function QC(e,t){if(Q_(e)){if(Z_(e),J_(e)){ZC(e,t);return}}sa.boolOrEmptySchema(e,t)}function J_({schema:e,self:t}){if(typeof e=="boolean")return!e;for(let r in e)if(t.RULES.all[r])return!0;return!1}function Q_(e){return typeof e.schema!="boolean"}function ZC(e,t){let{schema:r,gen:n,opts:s}=e;if(s.$comment&&r.$comment)tv(e);rj(e),nj(e);let o=n.const("_errs",B.default.errors);ev(e,o),n.var(t,w._`${o} === ${B.default.errors}`)}function Z_(e){Le.checkUnknownRules(e),ej(e)}function ev(e,t){if(e.opts.jtd)return H_(e,[],!1,t);let r=na.getSchemaTypes(e.schema),n=na.coerceAndCheckDataType(e,r);H_(e,r,!n,t)}function ej(e){let{schema:t,errSchemaPath:r,opts:n,self:s}=e;if(t.$ref&&n.ignoreKeywordsWithRef&&Le.schemaHasRulesButRef(t,s.RULES))s.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function tj(e){let{schema:t,opts:r}=e;if(t.default!==void 0&&r.useDefaults&&r.strictSchema)Le.checkStrictMode(e,"default is ignored in the schema root")}function rj(e){let t=e.schema[e.opts.schemaId];if(t)e.baseId=Y_.resolveUrl(e.opts.uriResolver,e.baseId,t)}function nj(e){if(e.schema.$async&&!e.schemaEnv.$async)throw Error("async schema in sync schema")}function tv({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:s}){let o=r.$comment;if(s.$comment===!0)e.code(w._`${B.default.self}.logger.log(${o})`);else if(typeof s.$comment=="function"){let i=w.str`${n}/$comment`,a=e.scopeValue("root",{ref:t.root});e.code(w._`${B.default.self}.opts.$comment(${o}, ${i}, ${a}.schema)`)}}function sj(e){let{gen:t,schemaEnv:r,validateName:n,ValidationError:s,opts:o}=e;if(r.$async)t.if(w._`${B.default.errors} === 0`,()=>t.return(B.default.data),()=>t.throw(w._`new ${s}(${B.default.vErrors})`));else{if(t.assign(w._`${n}.errors`,B.default.vErrors),o.unevaluated)oj(e);t.return(w._`${B.default.errors} === 0`)}}function oj({gen:e,evaluated:t,props:r,items:n}){if(r instanceof w.Name)e.assign(w._`${t}.props`,r);if(n instanceof w.Name)e.assign(w._`${t}.items`,n)}function H_(e,t,r,n){let{gen:s,schema:o,data:i,allErrors:a,opts:c,self:u}=e,{RULES:d}=u;if(o.$ref&&(c.ignoreKeywordsWithRef||!Le.schemaHasRulesButRef(o,d))){s.block(()=>nv(e,"$ref",d.all.$ref.definition));return}if(!c.jtd)ij(e,t);s.block(()=>{for(let p of d.rules)l(p);l(d.post)});function l(p){if(!fs.shouldUseGroup(o,p))return;if(p.type){if(s.if(Jr.checkDataType(p.type,i,c.strictNumbers)),B_(e,p),t.length===1&&t[0]===p.type&&r)s.else(),Jr.reportTypeError(e);s.endIf()}else B_(e,p);if(!a)s.if(w._`${B.default.errors} === ${n||0}`)}}function B_(e,t){let{gen:r,schema:n,opts:{useDefaults:s}}=e;if(s)W_.assignDefaults(e,t.type);r.block(()=>{for(let o of t.rules)if(fs.shouldUseRule(n,o))nv(e,o.keyword,o.definition,t.type)})}function ij(e,t){if(e.schemaEnv.meta||!e.opts.strictTypes)return;if(aj(e,t),!e.opts.allowUnionTypes)cj(e,t);uj(e,e.dataTypes)}function aj(e,t){if(!t.length)return;if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach((r)=>{if(!rv(e.dataTypes,r))Yu(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),dj(e,t)}function cj(e,t){if(t.length>1&&!(t.length===2&&t.includes("null")))Yu(e,"use allowUnionTypes to allow union type keyword")}function uj(e,t){let r=e.self.RULES.all;for(let n in r){let s=r[n];if(typeof s=="object"&&fs.shouldUseRule(e.schema,s)){let{type:o}=s.definition;if(o.length&&!o.some((i)=>lj(t,i)))Yu(e,`missing type "${o.join(",")}" for keyword "${n}"`)}}}function lj(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function rv(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function dj(e,t){let r=[];for(let n of e.dataTypes)if(rv(t,n))r.push(n);else if(t.includes("integer")&&n==="number")r.push("integer");e.dataTypes=r}function Yu(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,Le.checkStrictMode(e,t,e.opts.strictTypes)}class Xu{constructor(e,t,r){if(Jt.validateKeywordUsage(e,t,r),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=r,this.data=e.data,this.schema=e.schema[r],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=Le.schemaRefOrVal(e,this.schema,r,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",sv(this.$data,e));else if(this.schemaCode=this.schemaValue,!Jt.validSchemaType(this.schema,t.schemaType,t.allowUndefined))throw Error(`${r} value must be ${JSON.stringify(t.schemaType)}`);if("code"in t?t.trackErrors:t.errors!==!1)this.errsCount=e.gen.const("_errs",B.default.errors)}result(e,t,r){this.failResult(w.not(e),t,r)}failResult(e,t,r){if(this.gen.if(e),r)r();else this.error();if(t){if(this.gen.else(),t(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass(e,t){this.failResult(w.not(e),void 0,t)}fail(e){if(e===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if(e),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:t}=this;this.fail(w._`${t} !== undefined && (${w.or(this.invalid$data(),e)})`)}error(e,t,r){if(t){this.setParams(t),this._error(e,r),this.setParams({});return}this._error(e,r)}_error(e,t){(e?Xt.reportExtraError:Xt.reportError)(this,this.def.error,t)}$dataError(){Xt.reportError(this,this.def.$dataError||Xt.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');Xt.resetErrorsCount(this.gen,this.errsCount)}ok(e){if(!this.allErrors)this.gen.if(e)}setParams(e,t){if(t)Object.assign(this.params,e);else this.params=e}block$data(e,t,r=w.nil){this.gen.block(()=>{this.check$data(e,r),t()})}check$data(e=w.nil,t=w.nil){if(!this.$data)return;let{gen:r,schemaCode:n,schemaType:s,def:o}=this;if(r.if(w.or(w._`${n} === undefined`,t)),e!==w.nil)r.assign(e,!0);if(s.length||o.validateSchema){if(r.elseIf(this.invalid$data()),this.$dataError(),e!==w.nil)r.assign(e,!1)}r.else()}invalid$data(){let{gen:e,schemaCode:t,schemaType:r,def:n,it:s}=this;return w.or(o(),i());function o(){if(r.length){if(!(t instanceof w.Name))throw Error("ajv implementation error");let a=Array.isArray(r)?r:[r];return w._`${Jr.checkDataTypes(a,t,s.opts.strictNumbers,Jr.DataType.Wrong)}`}return w.nil}function i(){if(n.validateSchema){let a=e.scopeValue("validate$data",{ref:n.validateSchema});return w._`!${a}(${t})`}return w.nil}}subschema(e,t){let r=ds.getSubschema(this.it,e);ds.extendSubschemaData(r,this.it,e),ds.extendSubschemaMode(r,e);let n={...this.it,...r,items:void 0,props:void 0};return QC(n,t),n}mergeEvaluated(e,t){let{it:r,gen:n}=this;if(!r.opts.unevaluated)return;if(r.props!==!0&&e.props!==void 0)r.props=Le.mergeEvaluated.props(n,e.props,r.props,t);if(r.items!==!0&&e.items!==void 0)r.items=Le.mergeEvaluated.items(n,e.items,r.items,t)}mergeValidEvaluated(e,t){let{it:r,gen:n}=this;if(r.opts.unevaluated&&(r.props!==!0||r.items!==!0))return n.if(t,()=>this.mergeEvaluated(e,w.Name)),!0}}ov.KeywordCxt=Xu;function nv(e,t,r,n){let s=new Xu(e,r,t);if("code"in r)r.code(s,n);else if(s.$data&&r.validate)Jt.funcKeywordCode(s,r);else if("macro"in r)Jt.macroKeywordCode(s,r);else if(r.compile||r.validate)Jt.funcKeywordCode(s,r)}var fj=/^\/(?:[^~]|~0|~1)*$/,pj=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function sv(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let s,o;if(e==="")return B.default.rootData;if(e[0]==="/"){if(!fj.test(e))throw Error(`Invalid JSON-pointer: ${e}`);s=e,o=B.default.rootData}else{let u=pj.exec(e);if(!u)throw Error(`Invalid JSON-pointer: ${e}`);let d=+u[1];if(s=u[2],s==="#"){if(d>=t)throw Error(c("property/index",d));return n[t-d]}if(d>t)throw Error(c("data",d));if(o=r[t-d],!s)return o}let i=o,a=s.split("/");for(let u of a)if(u)o=w._`${o}${w.getProperty(Le.unescapeJsonPointer(u))}`,i=w._`${i} && ${o}`;return i;function c(u,d){return`Cannot access ${u} ${d} levels up, current level is ${t}`}}ov.getData=sv});var oa=g(function(cv){Object.defineProperty(cv,"__esModule",{value:!0});class av extends Error{constructor(e){super("validation failed");this.errors=e,this.ajv=this.validation=!0}}cv.default=av});var po=g(function(lv){Object.defineProperty(lv,"__esModule",{value:!0});var ps=lo();class uv extends Error{constructor(e,t,r,n){super(n||`can't resolve reference ${r} from id ${t}`);this.missingRef=ps.resolveUrl(e,t,r),this.missingSchema=ps.normalizeId(ps.getFullPath(e,this.missingRef))}}lv.default=uv});var ca=g(function(pv){Object.defineProperty(pv,"__esModule",{value:!0});pv.resolveSchema=pv.getCompilingSchema=pv.resolveRef=pv.compileSchema=pv.SchemaEnv=void 0;var Ae=Z(),_j=oa(),Rn=vr(),Pe=lo(),ia=ae(),dv=fo();class ho{constructor(e){var t;this.refs={},this.dynamicAnchors={};let r;if(typeof e.schema=="object")r=e.schema;this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(t=e.baseId)!==null&&t!==void 0?t:Pe.normalizeId(r===null||r===void 0?void 0:r[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=r===null||r===void 0?void 0:r.$async,this.refs={}}}pv.SchemaEnv=ho;function Qu(e){let t=fv.call(this,e);if(t)return t;let r=Pe.getFullPath(this.opts.uriResolver,e.root.baseId),{es5:n,lines:s}=this.opts.code,{ownProperties:o}=this.opts,i=new Ae.CodeGen(this.scope,{es5:n,lines:s,ownProperties:o}),a;if(e.$async)a=i.scopeValue("Error",{ref:_j.default,code:Ae._`require("ajv/dist/runtime/validation_error").default`});let c=i.scopeName("validate");e.validateName=c;let u={gen:i,allErrors:this.opts.allErrors,data:Rn.default.data,parentData:Rn.default.parentData,parentDataProperty:Rn.default.parentDataProperty,dataNames:[Rn.default.data],dataPathArr:[Ae.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:i.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:Ae.stringify(e.schema)}:{ref:e.schema}),validateName:c,ValidationError:a,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:Ae.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:Ae._`""`,opts:this.opts,self:this},d;try{this._compilations.add(e),dv.validateFunctionCode(u),i.optimize(this.opts.code.optimize);let l=i.toString();if(d=`${i.scopeRefs(Rn.default.scope)}return ${l}`,this.opts.code.process)d=this.opts.code.process(d,e);let f=Function(`${Rn.default.self}`,`${Rn.default.scope}`,d)(this,this.scope.get());if(this.scope.value(c,{ref:f}),f.errors=null,f.schema=e.schema,f.schemaEnv=e,e.$async)f.$async=!0;if(this.opts.code.source===!0)f.source={validateName:c,validateCode:l,scopeValues:i._values};if(this.opts.unevaluated){let{props:h,items:m}=u;if(f.evaluated={props:h instanceof Ae.Name?void 0:h,items:m instanceof Ae.Name?void 0:m,dynamicProps:h instanceof Ae.Name,dynamicItems:m instanceof Ae.Name},f.source)f.source.evaluated=Ae.stringify(f.evaluated)}return e.validate=f,e}catch(l){if(delete e.validate,delete e.validateName,d)this.logger.error("Error compiling schema, function code:",d);throw l}finally{this._compilations.delete(e)}}pv.compileSchema=Qu;function vj(e,t,r){var n;r=Pe.resolveUrl(this.opts.uriResolver,t,r);let s=e.refs[r];if(s)return s;let o=wj.call(this,e,r);if(o===void 0){let i=(n=e.localRefs)===null||n===void 0?void 0:n[r],{schemaId:a}=this.opts;if(i)o=new ho({schema:i,schemaId:a,root:e,baseId:t})}if(o===void 0)return;return e.refs[r]=$j.call(this,o)}pv.resolveRef=vj;function $j(e){if(Pe.inlineRef(e.schema,this.opts.inlineRefs))return e.schema;return e.validate?e:Qu.call(this,e)}function fv(e){for(let t of this._compilations)if(Ej(t,e))return t}pv.getCompilingSchema=fv;function Ej(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function wj(e,t){let r;while(typeof(r=this.refs[t])=="string")t=r;return r||this.schemas[t]||aa.call(this,e,t)}function aa(e,t){let r=this.opts.uriResolver.parse(t),n=Pe._getFullPath(this.opts.uriResolver,r),s=Pe.getFullPath(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===s)return Ju.call(this,r,e);let o=Pe.normalizeId(n),i=this.refs[o]||this.schemas[o];if(typeof i=="string"){let a=aa.call(this,e,i);if(typeof(a===null||a===void 0?void 0:a.schema)!=="object")return;return Ju.call(this,r,a)}if(typeof(i===null||i===void 0?void 0:i.schema)!=="object")return;if(!i.validate)Qu.call(this,i);if(o===Pe.normalizeId(t)){let{schema:a}=i,{schemaId:c}=this.opts,u=a[c];if(u)s=Pe.resolveUrl(this.opts.uriResolver,s,u);return new ho({schema:a,schemaId:c,root:e,baseId:s})}return Ju.call(this,r,i)}pv.resolveSchema=aa;var bj=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Ju(e,{baseId:t,schema:r,root:n}){var s;if(((s=e.fragment)===null||s===void 0?void 0:s[0])!=="/")return;for(let a of e.fragment.slice(1).split("/")){if(typeof r==="boolean")return;let c=r[ia.unescapeFragment(a)];if(c===void 0)return;r=c;let u=typeof r==="object"&&r[this.opts.schemaId];if(!bj.has(a)&&u)t=Pe.resolveUrl(this.opts.uriResolver,t,u)}let o;if(typeof r!="boolean"&&r.$ref&&!ia.schemaHasRulesButRef(r,this.RULES)){let a=Pe.resolveUrl(this.opts.uriResolver,t,r.$ref);o=aa.call(this,n,a)}let{schemaId:i}=this.opts;if(o=o||new ho({schema:r,schemaId:i,root:n,baseId:t}),o.schema!==o.root.schema)return o;return}});var mv=g(function(lK,kj){kj.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var _v=g(function(yv){Object.defineProperty(yv,"__esModule",{value:!0});var gv=pu();gv.code='require("ajv/dist/runtime/uri").default';yv.default=gv});var kv=g(function($r){Object.defineProperty($r,"__esModule",{value:!0});$r.CodeGen=$r.Name=$r.nil=$r.stringify=$r.str=$r._=$r.KeywordCxt=void 0;var Aj=fo();Object.defineProperty($r,"KeywordCxt",{enumerable:!0,get:function(){return Aj.KeywordCxt}});var ms=Z();Object.defineProperty($r,"_",{enumerable:!0,get:function(){return ms._}});Object.defineProperty($r,"str",{enumerable:!0,get:function(){return ms.str}});Object.defineProperty($r,"stringify",{enumerable:!0,get:function(){return ms.stringify}});Object.defineProperty($r,"nil",{enumerable:!0,get:function(){return ms.nil}});Object.defineProperty($r,"Name",{enumerable:!0,get:function(){return ms.Name}});Object.defineProperty($r,"CodeGen",{enumerable:!0,get:function(){return ms.CodeGen}});var Pj=oa(),bv=po(),Sv=Fu(),Qt=ca(),xv=Z(),Zt=lo(),Qr=uo(),hs=ae(),vv=mv(),Nj=_v(),Rv=(e,t)=>new RegExp(e,t);Rv.code="new RegExp";var Ij=["removeAdditional","useDefaults","coerceTypes"],Cj=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),jj={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."},qj={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},$v=200;function Dj(e){var t,r,n,s,o,i,a,c,u,d,l,p,f,h,m,y,_,O,T,M,S,_e,ve,xt,hr;let et=e.strict,gn=(t=e.code)===null||t===void 0?void 0:t.optimize,Fs=gn===!0||gn===void 0?1:gn||0,Vs=(n=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:Rv,yc=(s=e.uriResolver)!==null&&s!==void 0?s:Nj.default;return{strictSchema:(i=(o=e.strictSchema)!==null&&o!==void 0?o:et)!==null&&i!==void 0?i:!0,strictNumbers:(c=(a=e.strictNumbers)!==null&&a!==void 0?a:et)!==null&&c!==void 0?c:!0,strictTypes:(d=(u=e.strictTypes)!==null&&u!==void 0?u:et)!==null&&d!==void 0?d:"log",strictTuples:(p=(l=e.strictTuples)!==null&&l!==void 0?l:et)!==null&&p!==void 0?p:"log",strictRequired:(h=(f=e.strictRequired)!==null&&f!==void 0?f:et)!==null&&h!==void 0?h:!1,code:e.code?{...e.code,optimize:Fs,regExp:Vs}:{optimize:Fs,regExp:Vs},loopRequired:(m=e.loopRequired)!==null&&m!==void 0?m:$v,loopEnum:(y=e.loopEnum)!==null&&y!==void 0?y:$v,meta:(_=e.meta)!==null&&_!==void 0?_:!0,messages:(O=e.messages)!==null&&O!==void 0?O:!0,inlineRefs:(T=e.inlineRefs)!==null&&T!==void 0?T:!0,schemaId:(M=e.schemaId)!==null&&M!==void 0?M:"$id",addUsedSchema:(S=e.addUsedSchema)!==null&&S!==void 0?S:!0,validateSchema:(_e=e.validateSchema)!==null&&_e!==void 0?_e:!0,validateFormats:(ve=e.validateFormats)!==null&&ve!==void 0?ve:!0,unicodeRegExp:(xt=e.unicodeRegExp)!==null&&xt!==void 0?xt:!0,int32range:(hr=e.int32range)!==null&&hr!==void 0?hr:!0,uriResolver:yc}}class ua{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...Dj(e)};let{es5:t,lines:r}=this.opts.code;this.scope=new xv.ValueScope({scope:{},prefixes:Cj,es5:t,lines:r}),this.logger=zj(e.logger);let n=e.validateFormats;if(e.validateFormats=!1,this.RULES=Sv.getRules(),Ev.call(this,jj,e,"NOT SUPPORTED"),Ev.call(this,qj,e,"DEPRECATED","warn"),this._metaOpts=Fj.call(this),e.formats)Lj.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords)Uj.call(this,e.keywords);if(typeof e.meta=="object")this.addMetaSchema(e.meta);Mj.call(this),e.validateFormats=n}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:r}=this.opts,n=vv;if(r==="id")n={...vv},n.id=n.$id,delete n.$id;if(t&&e)this.addMetaSchema(n,n[r],!1)}defaultMeta(){let{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[t]||e:void 0}validate(e,t){let r;if(typeof e=="string"){if(r=this.getSchema(e),!r)throw Error(`no schema with key or ref "${e}"`)}else r=this.compile(e);let n=r(t);if(!("$async"in r))this.errors=r.errors;return n}compile(e,t){let r=this._addSchema(e,t);return r.validate||this._compileSchemaEnv(r)}compileAsync(e,t){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:r}=this.opts;return n.call(this,e,t);async function n(u,d){await s.call(this,u.$schema);let l=this._addSchema(u,d);return l.validate||o.call(this,l)}async function s(u){if(u&&!this.getSchema(u))await n.call(this,{$ref:u},!0)}async function o(u){try{return this._compileSchemaEnv(u)}catch(d){if(!(d instanceof bv.default))throw d;return i.call(this,d),await a.call(this,d.missingSchema),o.call(this,u)}}function i({missingSchema:u,missingRef:d}){if(this.refs[u])throw Error(`AnySchema ${u} is loaded but ${d} cannot be resolved`)}async function a(u){let d=await c.call(this,u);if(!this.refs[u])await s.call(this,d.$schema);if(!this.refs[u])this.addSchema(d,u,t)}async function c(u){let d=this._loading[u];if(d)return d;try{return await(this._loading[u]=r(u))}finally{delete this._loading[u]}}}addSchema(e,t,r,n=this.opts.validateSchema){if(Array.isArray(e)){for(let o of e)this.addSchema(o,void 0,r,n);return this}let s;if(typeof e==="object"){let{schemaId:o}=this.opts;if(s=e[o],s!==void 0&&typeof s!="string")throw Error(`schema ${o} must be string`)}return t=Zt.normalizeId(t||s),this._checkUnique(t),this.schemas[t]=this._addSchema(e,r,t,n,!0),this}addMetaSchema(e,t,r=this.opts.validateSchema){return this.addSchema(e,t,!0,r),this}validateSchema(e,t){if(typeof e=="boolean")return!0;let r;if(r=e.$schema,r!==void 0&&typeof r!="string")throw Error("$schema must be a string");if(r=r||this.opts.defaultMeta||this.defaultMeta(),!r)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let n=this.validate(r,e);if(!n&&t){let s="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(s);else throw Error(s)}return n}getSchema(e){let t;while(typeof(t=wv.call(this,e))=="string")e=t;if(t===void 0){let{schemaId:r}=this.opts,n=new Qt.SchemaEnv({schema:{},schemaId:r});if(t=Qt.resolveSchema.call(this,n,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let t=wv.call(this,e);if(typeof t=="object")this._cache.delete(t.schema);return delete this.schemas[e],delete this.refs[e],this}case"object":{let t=e;this._cache.delete(t);let r=e[this.opts.schemaId];if(r)r=Zt.normalizeId(r),delete this.schemas[r],delete this.refs[r];return this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let t of e)this.addKeyword(t);return this}addKeyword(e,t){let r;if(typeof e=="string"){if(r=e,typeof t=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=r}else if(typeof e=="object"&&t===void 0){if(t=e,r=t.keyword,Array.isArray(r)&&!r.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(Kj.call(this,r,t),!t)return hs.eachItem(r,(s)=>Zu.call(this,s)),this;Bj.call(this,t);let n={...t,type:Qr.getJSONTypes(t.type),schemaType:Qr.getJSONTypes(t.schemaType)};return hs.eachItem(r,n.type.length===0?(s)=>Zu.call(this,s,n):(s)=>n.type.forEach((o)=>Zu.call(this,s,n,o))),this}getKeyword(e){let t=this.RULES.all[e];return typeof t=="object"?t.definition:!!t}removeKeyword(e){let{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(let r of t.rules){let n=r.rules.findIndex((s)=>s.keyword===e);if(n>=0)r.rules.splice(n,1)}return this}addFormat(e,t){if(typeof t=="string")t=new RegExp(t);return this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:r="data"}={}){if(!e||e.length===0)return"No errors";return e.map((n)=>`${r}${n.instancePath} ${n.message}`).reduce((n,s)=>n+t+s)}$dataMetaSchema(e,t){let r=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let n of t){let s=n.split("/").slice(1),o=e;for(let i of s)o=o[i];for(let i in r){let a=r[i];if(typeof a!="object")continue;let{$data:c}=a.definition,u=o[i];if(c&&u)o[i]=Tv(u)}}return e}_removeAllSchemas(e,t){for(let r in e){let n=e[r];if(!t||t.test(r)){if(typeof n=="string")delete e[r];else if(n&&!n.meta)this._cache.delete(n.schema),delete e[r]}}}_addSchema(e,t,r,n=this.opts.validateSchema,s=this.opts.addUsedSchema){let o,{schemaId:i}=this.opts;if(typeof e=="object")o=e[i];else if(this.opts.jtd)throw Error("schema must be object");else if(typeof e!="boolean")throw Error("schema must be object or boolean");let a=this._cache.get(e);if(a!==void 0)return a;r=Zt.normalizeId(o||r);let c=Zt.getSchemaRefs.call(this,e,r);if(a=new Qt.SchemaEnv({schema:e,schemaId:i,meta:t,baseId:r,localRefs:c}),this._cache.set(a.schema,a),s&&!r.startsWith("#")){if(r)this._checkUnique(r);this.refs[r]=a}if(n)this.validateSchema(e,!0);return a}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta)this._compileMetaSchema(e);else Qt.compileSchema.call(this,e);if(!e.validate)throw Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let t=this.opts;this.opts=this._metaOpts;try{Qt.compileSchema.call(this,e)}finally{this.opts=t}}}ua.ValidationError=Pj.default;ua.MissingRefError=bv.default;$r.default=ua;function Ev(e,t,r,n="error"){for(let s in e){let o=s;if(o in t)this.logger[n](`${r}: option ${s}. ${e[o]}`)}}function wv(e){return e=Zt.normalizeId(e),this.schemas[e]||this.refs[e]}function Mj(){let e=this.opts.schemas;if(!e)return;if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}function Lj(){for(let e in this.opts.formats){let t=this.opts.formats[e];if(t)this.addFormat(e,t)}}function Uj(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let t in e){let r=e[t];if(!r.keyword)r.keyword=t;this.addKeyword(r)}}function Fj(){let e={...this.opts};for(let t of Ij)delete e[t];return e}var Vj={log(){},warn(){},error(){}};function zj(e){if(e===!1)return Vj;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw Error("logger must implement log, warn and error methods")}var Gj=/^[a-z_$][a-z0-9_$:-]*$/i;function Kj(e,t){let{RULES:r}=this;if(hs.eachItem(e,(n)=>{if(r.keywords[n])throw Error(`Keyword ${n} is already defined`);if(!Gj.test(n))throw Error(`Keyword ${n} has invalid name`)}),!t)return;if(t.$data&&!(("code"in t)||("validate"in t)))throw Error('$data keyword must have "code" or "validate" function')}function Zu(e,t,r){var n;let s=t===null||t===void 0?void 0:t.post;if(r&&s)throw Error('keyword with "post" flag cannot have "type"');let{RULES:o}=this,i=s?o.post:o.rules.find(({type:c})=>c===r);if(!i)i={type:r,rules:[]},o.rules.push(i);if(o.keywords[e]=!0,!t)return;let a={keyword:e,definition:{...t,type:Qr.getJSONTypes(t.type),schemaType:Qr.getJSONTypes(t.schemaType)}};if(t.before)Hj.call(this,i,a,t.before);else i.rules.push(a);o.all[e]=a,(n=t.implements)===null||n===void 0||n.forEach((c)=>this.addKeyword(c))}function Hj(e,t,r){let n=e.rules.findIndex((s)=>s.keyword===r);if(n>=0)e.rules.splice(n,0,t);else e.rules.push(t),this.logger.warn(`rule ${r} is not defined`)}function Bj(e){let{metaSchema:t}=e;if(t===void 0)return;if(e.$data&&this.opts.$data)t=Tv(t);e.validateSchema=this.compile(t,!0)}var Wj={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Tv(e){return{anyOf:[e,Wj]}}});var Av=g(function(Ov){Object.defineProperty(Ov,"__esModule",{value:!0});var Jj={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};Ov.default=Jj});var Cv=g(function(Nv){Object.defineProperty(Nv,"__esModule",{value:!0});Nv.callRef=Nv.getValidate=void 0;var Zj=po(),da=_t(),ge=Z(),gs=vr(),fa=ca(),Zr=ae(),eq={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:r,it:n}=e,{baseId:s,schemaEnv:o,validateName:i,opts:a,self:c}=n,{root:u}=o;if((r==="#"||r==="#/")&&s===u.baseId)return l();let d=fa.resolveRef.call(c,u,s,r);if(d===void 0)throw new Zj.default(n.opts.uriResolver,s,r);if(d instanceof fa.SchemaEnv)return p(d);return f(d);function l(){if(o===u)return la(e,i,o,o.$async);let h=t.scopeValue("root",{ref:u});return la(e,ge._`${h}.validate`,u,u.$async)}function p(h){let m=Pv(e,h);la(e,m,h,h.$async)}function f(h){let m=t.scopeValue("schema",a.code.source===!0?{ref:h,code:ge.stringify(h)}:{ref:h}),y=t.name("valid"),_=e.subschema({schema:h,dataTypes:[],schemaPath:ge.nil,topSchemaRef:m,errSchemaPath:r},y);e.mergeEvaluated(_),e.ok(y)}}};function Pv(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):ge._`${r.scopeValue("wrapper",{ref:t})}.validate`}Nv.getValidate=Pv;function la(e,t,r,n){let{gen:s,it:o}=e,{allErrors:i,schemaEnv:a,opts:c}=o,u=c.passContext?gs.default.this:ge.nil;if(n)d();else l();function d(){if(!a.$async)throw Error("async schema referenced by sync schema");let h=s.let("valid");s.try(()=>{if(s.code(ge._`await ${da.callValidateCode(e,t,u)}`),f(t),!i)s.assign(h,!0)},(m)=>{if(s.if(ge._`!(${m} instanceof ${o.ValidationError})`,()=>s.throw(m)),p(m),!i)s.assign(h,!1)}),e.ok(h)}function l(){e.result(da.callValidateCode(e,t,u),()=>f(t),()=>p(t))}function p(h){let m=ge._`${h}.errors`;s.assign(gs.default.vErrors,ge._`${gs.default.vErrors} === null ? ${m} : ${gs.default.vErrors}.concat(${m})`),s.assign(gs.default.errors,ge._`${gs.default.vErrors}.length`)}function f(h){var m;if(!o.opts.unevaluated)return;let y=(m=r===null||r===void 0?void 0:r.validate)===null||m===void 0?void 0:m.evaluated;if(o.props!==!0)if(y&&!y.dynamicProps){if(y.props!==void 0)o.props=Zr.mergeEvaluated.props(s,y.props,o.props)}else{let _=s.var("props",ge._`${h}.evaluated.props`);o.props=Zr.mergeEvaluated.props(s,_,o.props,ge.Name)}if(o.items!==!0)if(y&&!y.dynamicItems){if(y.items!==void 0)o.items=Zr.mergeEvaluated.items(s,y.items,o.items)}else{let _=s.var("items",ge._`${h}.evaluated.items`);o.items=Zr.mergeEvaluated.items(s,_,o.items,ge.Name)}}}Nv.callRef=la;Nv.default=eq});var qv=g(function(jv){Object.defineProperty(jv,"__esModule",{value:!0});var nq=Av(),sq=Cv(),oq=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",nq.default,sq.default];jv.default=oq});var Mv=g(function(Dv){Object.defineProperty(Dv,"__esModule",{value:!0});var tn=Z(),en=tn.operators,pa={maximum:{okStr:"<=",ok:en.LTE,fail:en.GT},minimum:{okStr:">=",ok:en.GTE,fail:en.LT},exclusiveMaximum:{okStr:"<",ok:en.LT,fail:en.GTE},exclusiveMinimum:{okStr:">",ok:en.GT,fail:en.LTE}},aq={message:({keyword:e,schemaCode:t})=>tn.str`must be ${pa[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>tn._`{comparison: ${pa[e].okStr}, limit: ${t}}`},cq={keyword:Object.keys(pa),type:"number",schemaType:"number",$data:!0,error:aq,code(e){let{keyword:t,data:r,schemaCode:n}=e;e.fail$data(tn._`${r} ${pa[t].fail} ${n} || isNaN(${r})`)}};Dv.default=cq});var Uv=g(function(Lv){Object.defineProperty(Lv,"__esModule",{value:!0});var er=Z(),lq={message:({schemaCode:e})=>er.str`must be multiple of ${e}`,params:({schemaCode:e})=>er._`{multipleOf: ${e}}`},dq={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:lq,code(e){let{gen:t,data:r,schemaCode:n,it:s}=e,o=s.opts.multipleOfPrecision,i=t.let("res"),a=o?er._`Math.abs(Math.round(${i}) - ${i}) > 1e-${o}`:er._`${i} !== parseInt(${i})`;e.fail$data(er._`(${n} === 0 || (${i} = ${r}/${n}, ${a}))`)}};Lv.default=dq});var zv=g(function(Vv){Object.defineProperty(Vv,"__esModule",{value:!0});function Fv(e){let t=e.length,r=0,n=0,s;while(n<t)if(r++,s=e.charCodeAt(n++),s>=55296&&s<=56319&&n<t){if(s=e.charCodeAt(n),(s&64512)===56320)n++}return r}Vv.default=Fv;Fv.code='require("ajv/dist/runtime/ucs2length").default'});var Hv=g(function(Kv){Object.defineProperty(Kv,"__esModule",{value:!0});var ct=Z(),Gv=ae(),hq=zv(),mq={message({keyword:e,schemaCode:t}){return ct.str`must NOT have ${e==="maxLength"?"more":"fewer"} than ${t} characters`},params:({schemaCode:e})=>ct._`{limit: ${e}}`},gq={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:mq,code(e){let{keyword:t,data:r,schemaCode:n,it:s}=e,o=t==="maxLength"?ct.operators.GT:ct.operators.LT,i=s.opts.unicode===!1?ct._`${r}.length`:ct._`${Gv.useFunc(e.gen,hq.default)}(${r})`;e.fail$data(ct._`${i} ${o} ${n}`)}};Kv.default=gq});var Yv=g(function(Wv){Object.defineProperty(Wv,"__esModule",{value:!0});var Bv=_t(),rn=Z(),_q={message:({schemaCode:e})=>rn.str`must match pattern "${e}"`,params:({schemaCode:e})=>rn._`{pattern: ${e}}`},vq={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:_q,code(e){let{data:t,$data:r,schema:n,schemaCode:s,it:o}=e,i=o.opts.unicodeRegExp?"u":"",a=r?rn._`(new RegExp(${s}, ${i}))`:Bv.usePattern(e,n);e.fail$data(rn._`!${a}.test(${t})`)}};Wv.default=vq});var Jv=g(function(Xv){Object.defineProperty(Xv,"__esModule",{value:!0});var tr=Z(),Eq={message({keyword:e,schemaCode:t}){return tr.str`must NOT have ${e==="maxProperties"?"more":"fewer"} than ${t} properties`},params:({schemaCode:e})=>tr._`{limit: ${e}}`},wq={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:Eq,code(e){let{keyword:t,data:r,schemaCode:n}=e,s=t==="maxProperties"?tr.operators.GT:tr.operators.LT;e.fail$data(tr._`Object.keys(${r}).length ${s} ${n}`)}};Xv.default=wq});var e0=g(function(Zv){Object.defineProperty(Zv,"__esModule",{value:!0});var rr=_t(),nr=Z(),Qv=ae(),Sq={message:({params:{missingProperty:e}})=>nr.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>nr._`{missingProperty: ${e}}`},xq={keyword:"required",type:"object",schemaType:"array",$data:!0,error:Sq,code(e){let{gen:t,schema:r,schemaCode:n,data:s,$data:o,it:i}=e,{opts:a}=i;if(!o&&r.length===0)return;let c=r.length>=a.loopRequired;if(i.allErrors)u();else d();if(a.strictRequired){let f=e.parentSchema.properties,{definedProperties:h}=e.it;for(let m of r)if((f===null||f===void 0?void 0:f[m])===void 0&&!h.has(m)){let y=i.schemaEnv.baseId+i.errSchemaPath,_=`required property "${m}" is not defined at "${y}" (strictRequired)`;Qv.checkStrictMode(i,_,i.opts.strictRequired)}}function u(){if(c||o)e.block$data(nr.nil,l);else for(let f of r)rr.checkReportMissingProp(e,f)}function d(){let f=t.let("missing");if(c||o){let h=t.let("valid",!0);e.block$data(h,()=>p(f,h)),e.ok(h)}else t.if(rr.checkMissingProp(e,r,f)),rr.reportMissingProp(e,f),t.else()}function l(){t.forOf("prop",n,(f)=>{e.setParams({missingProperty:f}),t.if(rr.noPropertyInData(t,s,f,a.ownProperties),()=>e.error())})}function p(f,h){e.setParams({missingProperty:f}),t.forOf(f,n,()=>{t.assign(h,rr.propertyInData(t,s,f,a.ownProperties)),t.if(nr.not(h),()=>{e.error(),t.break()})},nr.nil)}}};Zv.default=xq});var r0=g(function(t0){Object.defineProperty(t0,"__esModule",{value:!0});var sr=Z(),Tq={message({keyword:e,schemaCode:t}){return sr.str`must NOT have ${e==="maxItems"?"more":"fewer"} than ${t} items`},params:({schemaCode:e})=>sr._`{limit: ${e}}`},kq={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:Tq,code(e){let{keyword:t,data:r,schemaCode:n}=e,s=t==="maxItems"?sr.operators.GT:sr.operators.LT;e.fail$data(sr._`${r}.length ${s} ${n}`)}};t0.default=kq});var ha=g(function(s0){Object.defineProperty(s0,"__esModule",{value:!0});var n0=Js();n0.code='require("ajv/dist/runtime/equal").default';s0.default=n0});var a0=g(function(i0){Object.defineProperty(i0,"__esModule",{value:!0});var ys=uo(),oe=Z(),o0=ae(),Pq=ha(),Nq={message:({params:{i:e,j:t}})=>oe.str`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>oe._`{i: ${e}, j: ${t}}`},Iq={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:Nq,code(e){let{gen:t,data:r,$data:n,schema:s,parentSchema:o,schemaCode:i,it:a}=e;if(!n&&!s)return;let c=t.let("valid"),u=o.items?ys.getSchemaTypes(o.items):[];e.block$data(c,d,oe._`${i} === false`),e.ok(c);function d(){let h=t.let("i",oe._`${r}.length`),m=t.let("j");e.setParams({i:h,j:m}),t.assign(c,!0),t.if(oe._`${h} > 1`,()=>(l()?p:f)(h,m))}function l(){return u.length>0&&!u.some((h)=>h==="object"||h==="array")}function p(h,m){let y=t.name("item"),_=ys.checkDataTypes(u,y,a.opts.strictNumbers,ys.DataType.Wrong),O=t.const("indices",oe._`{}`);t.for(oe._`;${h}--;`,()=>{if(t.let(y,oe._`${r}[${h}]`),t.if(_,oe._`continue`),u.length>1)t.if(oe._`typeof ${y} == "string"`,oe._`${y} += "_"`);t.if(oe._`typeof ${O}[${y}] == "number"`,()=>{t.assign(m,oe._`${O}[${y}]`),e.error(),t.assign(c,!1).break()}).code(oe._`${O}[${y}] = ${h}`)})}function f(h,m){let y=o0.useFunc(t,Pq.default),_=t.name("outer");t.label(_).for(oe._`;${h}--;`,()=>t.for(oe._`${m} = ${h}; ${m}--;`,()=>t.if(oe._`${y}(${r}[${h}], ${r}[${m}])`,()=>{e.error(),t.assign(c,!1).break(_)})))}}};i0.default=Iq});var l0=g(function(u0){Object.defineProperty(u0,"__esModule",{value:!0});var _s=Z(),c0=ae(),jq=ha(),qq={message:"must be equal to constant",params:({schemaCode:e})=>_s._`{allowedValue: ${e}}`},Dq={keyword:"const",$data:!0,error:qq,code(e){let{gen:t,data:r,$data:n,schemaCode:s,schema:o}=e;if(n||o&&typeof o=="object")e.fail$data(_s._`!${c0.useFunc(t,jq.default)}(${r}, ${s})`);else e.fail(_s._`${o} !== ${r}`)}};u0.default=Dq});var p0=g(function(f0){Object.defineProperty(f0,"__esModule",{value:!0});var or=Z(),d0=ae(),Lq=ha(),Uq={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>or._`{allowedValues: ${e}}`},Fq={keyword:"enum",schemaType:"array",$data:!0,error:Uq,code(e){let{gen:t,data:r,$data:n,schema:s,schemaCode:o,it:i}=e;if(!n&&s.length===0)throw Error("enum must have non-empty array");let a=s.length>=i.opts.loopEnum,c,u=()=>c!==null&&c!==void 0?c:c=d0.useFunc(t,Lq.default),d;if(a||n)d=t.let("valid"),e.block$data(d,l);else{if(!Array.isArray(s))throw Error("ajv implementation error");let f=t.const("vSchema",o);d=or.or(...s.map((h,m)=>p(f,m)))}e.pass(d);function l(){t.assign(d,!1),t.forOf("v",o,(f)=>t.if(or._`${u()}(${r}, ${f})`,()=>t.assign(d,!0).break()))}function p(f,h){let m=s[h];return typeof m==="object"&&m!==null?or._`${u()}(${r}, ${f}[${h}])`:or._`${r} === ${m}`}}};f0.default=Fq});var m0=g(function(h0){Object.defineProperty(h0,"__esModule",{value:!0});var zq=Mv(),Gq=Uv(),Kq=Hv(),Hq=Yv(),Bq=Jv(),Wq=e0(),Yq=r0(),Xq=a0(),Jq=l0(),Qq=p0(),Zq=[zq.default,Gq.default,Kq.default,Hq.default,Bq.default,Wq.default,Yq.default,Xq.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},Jq.default,Qq.default];h0.default=Zq});var el=g(function(y0){Object.defineProperty(y0,"__esModule",{value:!0});y0.validateAdditionalItems=void 0;var ut=Z(),vs=ae(),tD={message:({params:{len:e}})=>ut.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>ut._`{limit: ${e}}`},rD={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:tD,code(e){let{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){vs.checkStrictMode(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}g0(e,n)}};function g0(e,t){let{gen:r,schema:n,data:s,keyword:o,it:i}=e;i.items=!0;let a=r.const("len",ut._`${s}.length`);if(n===!1)e.setParams({len:t.length}),e.pass(ut._`${a} <= ${t.length}`);else if(typeof n=="object"&&!vs.alwaysValidSchema(i,n)){let u=r.var("valid",ut._`${a} <= ${t.length}`);r.if(ut.not(u),()=>c(u)),e.ok(u)}function c(u){r.forRange("i",t.length,a,(d)=>{if(e.subschema({keyword:o,dataProp:d,dataPropType:vs.Type.Num},u),!i.allErrors)r.if(ut.not(u),()=>r.break())})}}y0.validateAdditionalItems=g0;y0.default=rD});var tl=g(function(E0){Object.defineProperty(E0,"__esModule",{value:!0});E0.validateTuple=void 0;var ma=Z(),nn=ae(),v0=_t(),sD={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return $0(e,"additionalItems",t);if(r.items=!0,nn.alwaysValidSchema(r,t))return;e.ok(v0.validateArray(e))}};function $0(e,t,r=e.schema){let{gen:n,parentSchema:s,data:o,keyword:i,it:a}=e;if(d(s),a.opts.unevaluated&&r.length&&a.items!==!0)a.items=nn.mergeEvaluated.items(n,r.length,a.items);let c=n.name("valid"),u=n.const("len",ma._`${o}.length`);r.forEach((l,p)=>{if(nn.alwaysValidSchema(a,l))return;n.if(ma._`${u} > ${p}`,()=>e.subschema({keyword:i,schemaProp:p,dataProp:p},c)),e.ok(c)});function d(l){let{opts:p,errSchemaPath:f}=a,h=r.length,m=h===l.minItems&&(h===l.maxItems||l[t]===!1);if(p.strictTuples&&!m){let y=`"${i}" is ${h}-tuple, but minItems or maxItems/${t} are not specified or different at path "${f}"`;nn.checkStrictMode(a,y,p.strictTuples)}}}E0.validateTuple=$0;E0.default=sD});var x0=g(function(S0){Object.defineProperty(S0,"__esModule",{value:!0});var b0=tl(),iD={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(e)=>b0.validateTuple(e,"items")};S0.default=iD});var A0=g(function(O0){Object.defineProperty(O0,"__esModule",{value:!0});var ga=Z(),R0=ae(),T0=_t(),k0=el(),cD={message:({params:{len:e}})=>ga.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>ga._`{limit: ${e}}`},uD={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:cD,code(e){let{schema:t,parentSchema:r,it:n}=e,{prefixItems:s}=r;if(n.items=!0,R0.alwaysValidSchema(n,t))return;if(s)k0.validateAdditionalItems(e,s);else e.ok(T0.validateArray(e))}};O0.default=uD});var N0=g(function(P0){Object.defineProperty(P0,"__esModule",{value:!0});var Ee=Z(),sn=ae(),dD={message:({params:{min:e,max:t}})=>t===void 0?Ee.str`must contain at least ${e} valid item(s)`:Ee.str`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?Ee._`{minContains: ${e}}`:Ee._`{minContains: ${e}, maxContains: ${t}}`},fD={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:dD,code(e){let{gen:t,schema:r,parentSchema:n,data:s,it:o}=e,i,a,{minContains:c,maxContains:u}=n;if(o.opts.next)i=c===void 0?1:c,a=u;else i=1;let d=t.const("len",Ee._`${s}.length`);if(e.setParams({min:i,max:a}),a===void 0&&i===0){sn.checkStrictMode(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&i>a){sn.checkStrictMode(o,'"minContains" > "maxContains" is always invalid'),e.fail();return}if(sn.alwaysValidSchema(o,r)){let m=Ee._`${d} >= ${i}`;if(a!==void 0)m=Ee._`${m} && ${d} <= ${a}`;e.pass(m);return}o.items=!0;let l=t.name("valid");if(a===void 0&&i===1)f(l,()=>t.if(l,()=>t.break()));else if(i===0){if(t.let(l,!0),a!==void 0)t.if(Ee._`${s}.length > 0`,p)}else t.let(l,!1),p();e.result(l,()=>e.reset());function p(){let m=t.name("_valid"),y=t.let("count",0);f(m,()=>t.if(m,()=>h(y)))}function f(m,y){t.forRange("i",0,d,(_)=>{e.subschema({keyword:"contains",dataProp:_,dataPropType:sn.Type.Num,compositeRule:!0},m),y()})}function h(m){if(t.code(Ee._`${m}++`),a===void 0)t.if(Ee._`${m} >= ${i}`,()=>t.assign(l,!0).break());else if(t.if(Ee._`${m} > ${a}`,()=>t.assign(l,!1).break()),i===1)t.assign(l,!0);else t.if(Ee._`${m} >= ${i}`,()=>t.assign(l,!0))}}};P0.default=fD});var L0=g(function(q0){Object.defineProperty(q0,"__esModule",{value:!0});q0.validateSchemaDeps=q0.validatePropertyDeps=q0.error=void 0;var $s=Z(),I0=ae(),ir=_t();q0.error={message:({params:{property:e,depsCount:t,deps:r}})=>$s.str`must have ${t===1?"property":"properties"} ${r} when property ${e} is present`,params:({params:{property:e,depsCount:t,deps:r,missingProperty:n}})=>$s._`{property: ${e},
14
+ || ${i} === "boolean" || ${s} === null`).assign(a,R._`[${s}]`)}}}function F1({gen:e,parentData:t,parentDataProperty:r},n){e.if(R._`${t} !== undefined`,()=>e.assign(R._`${t}[${r}]`,n))}function zu(e,t,r,n=cs.Correct){let s=n===cs.Correct?R.operators.EQ:R.operators.NEQ,o;switch(e){case"null":return R._`${t} ${s} null`;case"array":o=R._`Array.isArray(${t})`;break;case"object":o=R._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":o=i(R._`!(${t} % 1) && !isNaN(${t})`);break;case"number":o=i();break;default:return R._`typeof ${t} ${s} ${e}`}return n===cs.Correct?o:R.not(o);function i(a=R.nil){return R.and(R._`typeof ${t} == "number"`,a,r?R._`isFinite(${t})`:R.nil)}}y_.checkDataType=zu;function Gu(e,t,r,n){if(e.length===1)return zu(e[0],t,r,n);let s,o=ta.toHash(e);if(o.array&&o.object){let i=R._`typeof ${t} != "object"`;s=o.null?i:R._`!${t} || ${i}`,delete o.null,delete o.array,delete o.object}else s=R.nil;if(o.number)delete o.integer;for(let i in o)s=R.and(s,zu(i,t,r,n));return s}y_.checkDataTypes=Gu;var V1={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e=="string"?R._`{type: ${e}}`:R._`{type: ${t}}`};function Ku(e){let t=z1(e);h_.reportError(t,V1)}y_.reportTypeError=Ku;function z1(e){let{gen:t,data:r,schema:n}=e,s=ta.schemaRefOrVal(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:s,schemaValue:s,parentSchema:n,params:{},it:e}}});var w_=g(function(E_){Object.defineProperty(E_,"__esModule",{value:!0});E_.assignDefaults=void 0;var yt=Z(),$_=ae();function X1(e,t){let{properties:r,items:n}=e.schema;if(t==="object"&&r)for(let s in r)v_(e,s,r[s].default);else if(t==="array"&&Array.isArray(n))n.forEach((s,o)=>v_(e,o,s.default))}E_.assignDefaults=X1;function v_(e,t,r){let{gen:n,compositeRule:s,data:o,opts:i}=e;if(r===void 0)return;let a=yt._`${o}${yt.getProperty(t)}`;if(s){$_.checkStrictMode(e,`default is ignored for: ${a}`);return}let c=yt._`${a} === undefined`;if(i.useDefaults==="empty")c=yt._`${c} || ${a} === null || ${a} === ""`;n.if(c,yt._`${a} = ${yt.stringify(r)}`)}});var _t=g(function(T_){Object.defineProperty(T_,"__esModule",{value:!0});T_.validateUnion=T_.validateArray=T_.usePattern=T_.callValidateCode=T_.schemaProperties=T_.allSchemaProperties=T_.noPropertyInData=T_.propertyInData=T_.isOwnProperty=T_.hasPropFunc=T_.reportMissingProp=T_.checkMissingProp=T_.checkReportMissingProp=void 0;var z=Z(),us=ae(),Xr=vr(),S_=ae();function J1(e,t){let{gen:r,data:n,it:s}=e;r.if(Bu(r,n,t,s.opts.ownProperties),()=>{e.setParams({missingProperty:z._`${t}`},!0),e.error()})}T_.checkReportMissingProp=J1;function Q1({gen:e,data:t,it:{opts:r}},n,s){return z.or(...n.map((o)=>z.and(Bu(e,t,o,r.ownProperties),z._`${s} = ${o}`)))}T_.checkMissingProp=Q1;function Z1(e,t){e.setParams({missingProperty:t},!0),e.error()}T_.reportMissingProp=Z1;function x_(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:z._`Object.prototype.hasOwnProperty`})}T_.hasPropFunc=x_;function Hu(e,t,r){return z._`${x_(e)}.call(${t}, ${r})`}T_.isOwnProperty=Hu;function eC(e,t,r,n){let s=z._`${t}${z.getProperty(r)} !== undefined`;return n?z._`${s} && ${Hu(e,t,r)}`:s}T_.propertyInData=eC;function Bu(e,t,r,n){let s=z._`${t}${z.getProperty(r)} === undefined`;return n?z.or(s,z.not(Hu(e,t,r))):s}T_.noPropertyInData=Bu;function R_(e){return e?Object.keys(e).filter((t)=>t!=="__proto__"):[]}T_.allSchemaProperties=R_;function tC(e,t){return R_(t).filter((r)=>!us.alwaysValidSchema(e,t[r]))}T_.schemaProperties=tC;function rC({schemaCode:e,data:t,it:{gen:r,topSchemaRef:n,schemaPath:s,errorPath:o},it:i},a,c,u){let d=u?z._`${e}, ${t}, ${n}${s}`:t,l=[[Xr.default.instancePath,z.strConcat(Xr.default.instancePath,o)],[Xr.default.parentData,i.parentData],[Xr.default.parentDataProperty,i.parentDataProperty],[Xr.default.rootData,Xr.default.rootData]];if(i.opts.dynamicRef)l.push([Xr.default.dynamicAnchors,Xr.default.dynamicAnchors]);let p=z._`${d}, ${r.object(...l)}`;return c!==z.nil?z._`${a}.call(${c}, ${p})`:z._`${a}(${p})`}T_.callValidateCode=rC;var nC=z._`new RegExp`;function sC({gen:e,it:{opts:t}},r){let n=t.unicodeRegExp?"u":"",{regExp:s}=t.code,o=s(r,n);return e.scopeValue("pattern",{key:o.toString(),ref:o,code:z._`${s.code==="new RegExp"?nC:S_.useFunc(e,s)}(${r}, ${n})`})}T_.usePattern=sC;function oC(e){let{gen:t,data:r,keyword:n,it:s}=e,o=t.name("valid");if(s.allErrors){let a=t.let("valid",!0);return i(()=>t.assign(a,!1)),a}return t.var(o,!0),i(()=>t.break()),o;function i(a){let c=t.const("len",z._`${r}.length`);t.forRange("i",0,c,(u)=>{e.subschema({keyword:n,dataProp:u,dataPropType:us.Type.Num},o),t.if(z.not(o),a)})}}T_.validateArray=oC;function iC(e){let{gen:t,schema:r,keyword:n,it:s}=e;if(!Array.isArray(r))throw Error("ajv implementation error");if(r.some((c)=>us.alwaysValidSchema(s,c))&&!s.opts.unevaluated)return;let i=t.let("valid",!1),a=t.name("_valid");t.block(()=>r.forEach((c,u)=>{let d=e.subschema({keyword:n,schemaProp:u,compositeRule:!0},a);if(t.assign(i,z._`${i} || ${a}`),!e.mergeValidEvaluated(d,a))t.if(z.not(i))})),e.result(i,()=>e.reset(),()=>e.error(!0))}T_.validateUnion=iC});var j_=g(function(I_){Object.defineProperty(I_,"__esModule",{value:!0});I_.validateKeywordUsage=I_.validSchemaType=I_.funcKeywordCode=I_.macroKeywordCode=void 0;var de=Z(),xn=vr(),A_=_t(),P_=co();function vC(e,t){let{gen:r,keyword:n,schema:s,parentSchema:o,it:i}=e,a=t.macro.call(i.self,s,o,i),c=N_(r,n,a);if(i.opts.validateSchema!==!1)i.self.validateSchema(a,!0);let u=r.name("valid");e.subschema({schema:a,schemaPath:de.nil,errSchemaPath:`${i.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},u),e.pass(u,()=>e.error(!0))}I_.macroKeywordCode=vC;function $C(e,t){var r;let{gen:n,keyword:s,schema:o,parentSchema:i,$data:a,it:c}=e;bC(c,t);let u=!a&&t.compile?t.compile.call(c.self,o,i,c):t.validate,d=N_(n,s,u),l=n.let("valid");e.block$data(l,p),e.ok((r=t.valid)!==null&&r!==void 0?r:l);function p(){if(t.errors===!1){if(m(),t.modifying)O_(e);y(()=>e.error())}else{let _=t.async?f():h();if(t.modifying)O_(e);y(()=>EC(e,_))}}function f(){let _=n.let("ruleErrs",null);return n.try(()=>m(de._`await `),(O)=>n.assign(l,!1).if(de._`${O} instanceof ${c.ValidationError}`,()=>n.assign(_,de._`${O}.errors`),()=>n.throw(O))),_}function h(){let _=de._`${d}.errors`;return n.assign(_,null),m(de.nil),_}function m(_=t.async?de._`await `:de.nil){let O=c.opts.passContext?xn.default.this:xn.default.self,T=!(("compile"in t)&&!a||t.schema===!1);n.assign(l,de._`${_}${A_.callValidateCode(e,d,O,T)}`,t.modifying)}function y(_){var O;n.if(de.not((O=t.valid)!==null&&O!==void 0?O:l),_)}}I_.funcKeywordCode=$C;function O_(e){let{gen:t,data:r,it:n}=e;t.if(n.parentData,()=>t.assign(r,de._`${n.parentData}[${n.parentDataProperty}]`))}function EC(e,t){let{gen:r}=e;r.if(de._`Array.isArray(${t})`,()=>{r.assign(xn.default.vErrors,de._`${xn.default.vErrors} === null ? ${t} : ${xn.default.vErrors}.concat(${t})`).assign(xn.default.errors,de._`${xn.default.vErrors}.length`),P_.extendErrors(e)},()=>e.error())}function bC({schemaEnv:e},t){if(t.async&&!e.$async)throw Error("async keyword in sync schema")}function N_(e,t,r){if(r===void 0)throw Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:de.stringify(r)})}function wC(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>"u")}I_.validSchemaType=wC;function SC({schema:e,opts:t,self:r,errSchemaPath:n},s,o){if(Array.isArray(s.keyword)?!s.keyword.includes(o):s.keyword!==o)throw Error("ajv implementation error");let i=s.dependencies;if(i===null||i===void 0?void 0:i.some((a)=>!Object.prototype.hasOwnProperty.call(e,a)))throw Error(`parent schema must have dependencies of ${o}: ${i.join(",")}`);if(s.validateSchema){if(!s.validateSchema(e[o])){let c=`keyword "${o}" value is invalid at path "${n}": `+r.errorsText(s.validateSchema.errors);if(t.validateSchema==="log")r.logger.error(c);else throw Error(c)}}}I_.validateKeywordUsage=SC});var M_=g(function(q_){Object.defineProperty(q_,"__esModule",{value:!0});q_.extendSubschemaMode=q_.extendSubschemaData=q_.getSubschema=void 0;var qe=Z(),ra=ae();function kC(e,{keyword:t,schemaProp:r,schema:n,schemaPath:s,errSchemaPath:o,topSchemaRef:i}){if(t!==void 0&&n!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){let a=e.schema[t];return r===void 0?{schema:a,schemaPath:qe._`${e.schemaPath}${qe.getProperty(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:a[r],schemaPath:qe._`${e.schemaPath}${qe.getProperty(t)}${qe.getProperty(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${ra.escapeFragment(r)}`}}if(n!==void 0){if(s===void 0||o===void 0||i===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:s,topSchemaRef:i,errSchemaPath:o}}throw Error('either "keyword" or "schema" must be passed')}q_.getSubschema=kC;function OC(e,t,{dataProp:r,dataPropType:n,data:s,dataTypes:o,propertyName:i}){if(s!==void 0&&r!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=t;if(r!==void 0){let{errorPath:u,dataPathArr:d,opts:l}=t,p=a.let("data",qe._`${t.data}${qe.getProperty(r)}`,!0);c(p),e.errorPath=qe.str`${u}${ra.getErrorPath(r,n,l.jsPropertySyntax)}`,e.parentDataProperty=qe._`${r}`,e.dataPathArr=[...d,e.parentDataProperty]}if(s!==void 0){let u=s instanceof qe.Name?s:a.let("data",s,!0);if(c(u),i!==void 0)e.propertyName=i}if(o)e.dataTypes=o;function c(u){e.data=u,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,u]}}q_.extendSubschemaData=OC;function AC(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:s,allErrors:o}){if(n!==void 0)e.compositeRule=n;if(s!==void 0)e.createErrors=s;if(o!==void 0)e.allErrors=o;e.jtdDiscriminator=t,e.jtdMetadata=r}q_.extendSubschemaMode=AC});var lo=g(function(z_){Object.defineProperty(z_,"__esModule",{value:!0});z_.getSchemaRefs=z_.resolveUrl=z_.normalizeId=z_._getFullPath=z_.getFullPath=z_.inlineRef=void 0;var L_=ae(),IC=Js(),CC=ru(),jC=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function qC(e,t=!0){if(typeof e=="boolean")return!0;if(t===!0)return!Wu(e);if(!t)return!1;return U_(e)<=t}z_.inlineRef=qC;var DC=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Wu(e){for(let t in e){if(DC.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(Wu))return!0;if(typeof r=="object"&&Wu(r))return!0}return!1}function U_(e){let t=0;for(let r in e){if(r==="$ref")return 1/0;if(t++,jC.has(r))continue;if(typeof e[r]=="object")L_.eachItem(e[r],(n)=>t+=U_(n));if(t===1/0)return 1/0}return t}function F_(e,t="",r){if(r!==!1)t=ls(t);let n=e.parse(t);return V_(e,n)}z_.getFullPath=F_;function V_(e,t){return e.serialize(t).split("#")[0]+"#"}z_._getFullPath=V_;var MC=/#\/?$/;function ls(e){return e?e.replace(MC,""):""}z_.normalizeId=ls;function LC(e,t,r){return r=ls(r),e.resolve(t,r)}z_.resolveUrl=LC;var UC=/^[a-z_][-a-z0-9._]*$/i;function FC(e,t){if(typeof e=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,s=ls(e[r]||t),o={"":s},i=F_(n,s,!1),a={},c=new Set;return CC(e,{allKeys:!0},(l,p,f,h)=>{if(h===void 0)return;let m=i+p,y=o[h];if(typeof l[r]=="string")y=_.call(this,l[r]);O.call(this,l.$anchor),O.call(this,l.$dynamicAnchor),o[p]=y;function _(T){let M=this.opts.uriResolver.resolve;if(T=ls(y?M(y,T):T),c.has(T))throw d(T);c.add(T);let S=this.refs[T];if(typeof S=="string")S=this.refs[S];if(typeof S=="object")u(l,S.schema,T);else if(T!==ls(m))if(T[0]==="#")u(l,a[T],T),a[T]=l;else this.refs[T]=m;return T}function O(T){if(typeof T=="string"){if(!UC.test(T))throw Error(`invalid anchor "${T}"`);_.call(this,`#${T}`)}}}),a;function u(l,p,f){if(p!==void 0&&!IC(l,p))throw d(f)}function d(l){return Error(`reference "${l}" resolves to more than one schema`)}}z_.getSchemaRefs=FC});var fo=g(function(ov){Object.defineProperty(ov,"__esModule",{value:!0});ov.getData=ov.KeywordCxt=ov.validateFunctionCode=void 0;var sa=o_(),na=uo(),fs=Vu(),Jr=uo(),W_=w_(),Jt=j_(),ds=M_(),b=Z(),B=vr(),Y_=lo(),Le=ae(),Xt=co();function BC(e){if(Q_(e)){if(Z_(e),J_(e)){XC(e);return}}X_(e,()=>sa.topBoolOrEmptySchema(e))}ov.validateFunctionCode=BC;function X_({gen:e,validateName:t,schema:r,schemaEnv:n,opts:s},o){if(s.code.es5)e.func(t,b._`${B.default.data}, ${B.default.valCxt}`,n.$async,()=>{e.code(b._`"use strict"; ${K_(r,s)}`),YC(e,s),e.code(o)});else e.func(t,b._`${B.default.data}, ${WC(s)}`,n.$async,()=>e.code(K_(r,s)).code(o))}function WC(e){return b._`{${B.default.instancePath}="", ${B.default.parentData}, ${B.default.parentDataProperty}, ${B.default.rootData}=${B.default.data}${e.dynamicRef?b._`, ${B.default.dynamicAnchors}={}`:b.nil}}={}`}function YC(e,t){e.if(B.default.valCxt,()=>{if(e.var(B.default.instancePath,b._`${B.default.valCxt}.${B.default.instancePath}`),e.var(B.default.parentData,b._`${B.default.valCxt}.${B.default.parentData}`),e.var(B.default.parentDataProperty,b._`${B.default.valCxt}.${B.default.parentDataProperty}`),e.var(B.default.rootData,b._`${B.default.valCxt}.${B.default.rootData}`),t.dynamicRef)e.var(B.default.dynamicAnchors,b._`${B.default.valCxt}.${B.default.dynamicAnchors}`)},()=>{if(e.var(B.default.instancePath,b._`""`),e.var(B.default.parentData,b._`undefined`),e.var(B.default.parentDataProperty,b._`undefined`),e.var(B.default.rootData,B.default.data),t.dynamicRef)e.var(B.default.dynamicAnchors,b._`{}`)})}function XC(e){let{schema:t,opts:r,gen:n}=e;X_(e,()=>{if(r.$comment&&t.$comment)tv(e);if(tj(e),n.let(B.default.vErrors,null),n.let(B.default.errors,0),r.unevaluated)JC(e);ev(e),sj(e)});return}function JC(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",b._`${r}.evaluated`),t.if(b._`${e.evaluated}.dynamicProps`,()=>t.assign(b._`${e.evaluated}.props`,b._`undefined`)),t.if(b._`${e.evaluated}.dynamicItems`,()=>t.assign(b._`${e.evaluated}.items`,b._`undefined`))}function K_(e,t){let r=typeof e=="object"&&e[t.schemaId];return r&&(t.code.source||t.code.process)?b._`/*# sourceURL=${r} */`:b.nil}function QC(e,t){if(Q_(e)){if(Z_(e),J_(e)){ZC(e,t);return}}sa.boolOrEmptySchema(e,t)}function J_({schema:e,self:t}){if(typeof e=="boolean")return!e;for(let r in e)if(t.RULES.all[r])return!0;return!1}function Q_(e){return typeof e.schema!="boolean"}function ZC(e,t){let{schema:r,gen:n,opts:s}=e;if(s.$comment&&r.$comment)tv(e);rj(e),nj(e);let o=n.const("_errs",B.default.errors);ev(e,o),n.var(t,b._`${o} === ${B.default.errors}`)}function Z_(e){Le.checkUnknownRules(e),ej(e)}function ev(e,t){if(e.opts.jtd)return H_(e,[],!1,t);let r=na.getSchemaTypes(e.schema),n=na.coerceAndCheckDataType(e,r);H_(e,r,!n,t)}function ej(e){let{schema:t,errSchemaPath:r,opts:n,self:s}=e;if(t.$ref&&n.ignoreKeywordsWithRef&&Le.schemaHasRulesButRef(t,s.RULES))s.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function tj(e){let{schema:t,opts:r}=e;if(t.default!==void 0&&r.useDefaults&&r.strictSchema)Le.checkStrictMode(e,"default is ignored in the schema root")}function rj(e){let t=e.schema[e.opts.schemaId];if(t)e.baseId=Y_.resolveUrl(e.opts.uriResolver,e.baseId,t)}function nj(e){if(e.schema.$async&&!e.schemaEnv.$async)throw Error("async schema in sync schema")}function tv({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:s}){let o=r.$comment;if(s.$comment===!0)e.code(b._`${B.default.self}.logger.log(${o})`);else if(typeof s.$comment=="function"){let i=b.str`${n}/$comment`,a=e.scopeValue("root",{ref:t.root});e.code(b._`${B.default.self}.opts.$comment(${o}, ${i}, ${a}.schema)`)}}function sj(e){let{gen:t,schemaEnv:r,validateName:n,ValidationError:s,opts:o}=e;if(r.$async)t.if(b._`${B.default.errors} === 0`,()=>t.return(B.default.data),()=>t.throw(b._`new ${s}(${B.default.vErrors})`));else{if(t.assign(b._`${n}.errors`,B.default.vErrors),o.unevaluated)oj(e);t.return(b._`${B.default.errors} === 0`)}}function oj({gen:e,evaluated:t,props:r,items:n}){if(r instanceof b.Name)e.assign(b._`${t}.props`,r);if(n instanceof b.Name)e.assign(b._`${t}.items`,n)}function H_(e,t,r,n){let{gen:s,schema:o,data:i,allErrors:a,opts:c,self:u}=e,{RULES:d}=u;if(o.$ref&&(c.ignoreKeywordsWithRef||!Le.schemaHasRulesButRef(o,d))){s.block(()=>nv(e,"$ref",d.all.$ref.definition));return}if(!c.jtd)ij(e,t);s.block(()=>{for(let p of d.rules)l(p);l(d.post)});function l(p){if(!fs.shouldUseGroup(o,p))return;if(p.type){if(s.if(Jr.checkDataType(p.type,i,c.strictNumbers)),B_(e,p),t.length===1&&t[0]===p.type&&r)s.else(),Jr.reportTypeError(e);s.endIf()}else B_(e,p);if(!a)s.if(b._`${B.default.errors} === ${n||0}`)}}function B_(e,t){let{gen:r,schema:n,opts:{useDefaults:s}}=e;if(s)W_.assignDefaults(e,t.type);r.block(()=>{for(let o of t.rules)if(fs.shouldUseRule(n,o))nv(e,o.keyword,o.definition,t.type)})}function ij(e,t){if(e.schemaEnv.meta||!e.opts.strictTypes)return;if(aj(e,t),!e.opts.allowUnionTypes)cj(e,t);uj(e,e.dataTypes)}function aj(e,t){if(!t.length)return;if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach((r)=>{if(!rv(e.dataTypes,r))Yu(e,`type "${r}" not allowed by context "${e.dataTypes.join(",")}"`)}),dj(e,t)}function cj(e,t){if(t.length>1&&!(t.length===2&&t.includes("null")))Yu(e,"use allowUnionTypes to allow union type keyword")}function uj(e,t){let r=e.self.RULES.all;for(let n in r){let s=r[n];if(typeof s=="object"&&fs.shouldUseRule(e.schema,s)){let{type:o}=s.definition;if(o.length&&!o.some((i)=>lj(t,i)))Yu(e,`missing type "${o.join(",")}" for keyword "${n}"`)}}}function lj(e,t){return e.includes(t)||t==="number"&&e.includes("integer")}function rv(e,t){return e.includes(t)||t==="integer"&&e.includes("number")}function dj(e,t){let r=[];for(let n of e.dataTypes)if(rv(t,n))r.push(n);else if(t.includes("integer")&&n==="number")r.push("integer");e.dataTypes=r}function Yu(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,Le.checkStrictMode(e,t,e.opts.strictTypes)}class Xu{constructor(e,t,r){if(Jt.validateKeywordUsage(e,t,r),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=r,this.data=e.data,this.schema=e.schema[r],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=Le.schemaRefOrVal(e,this.schema,r,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",sv(this.$data,e));else if(this.schemaCode=this.schemaValue,!Jt.validSchemaType(this.schema,t.schemaType,t.allowUndefined))throw Error(`${r} value must be ${JSON.stringify(t.schemaType)}`);if("code"in t?t.trackErrors:t.errors!==!1)this.errsCount=e.gen.const("_errs",B.default.errors)}result(e,t,r){this.failResult(b.not(e),t,r)}failResult(e,t,r){if(this.gen.if(e),r)r();else this.error();if(t){if(this.gen.else(),t(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass(e,t){this.failResult(b.not(e),void 0,t)}fail(e){if(e===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if(e),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:t}=this;this.fail(b._`${t} !== undefined && (${b.or(this.invalid$data(),e)})`)}error(e,t,r){if(t){this.setParams(t),this._error(e,r),this.setParams({});return}this._error(e,r)}_error(e,t){(e?Xt.reportExtraError:Xt.reportError)(this,this.def.error,t)}$dataError(){Xt.reportError(this,this.def.$dataError||Xt.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');Xt.resetErrorsCount(this.gen,this.errsCount)}ok(e){if(!this.allErrors)this.gen.if(e)}setParams(e,t){if(t)Object.assign(this.params,e);else this.params=e}block$data(e,t,r=b.nil){this.gen.block(()=>{this.check$data(e,r),t()})}check$data(e=b.nil,t=b.nil){if(!this.$data)return;let{gen:r,schemaCode:n,schemaType:s,def:o}=this;if(r.if(b.or(b._`${n} === undefined`,t)),e!==b.nil)r.assign(e,!0);if(s.length||o.validateSchema){if(r.elseIf(this.invalid$data()),this.$dataError(),e!==b.nil)r.assign(e,!1)}r.else()}invalid$data(){let{gen:e,schemaCode:t,schemaType:r,def:n,it:s}=this;return b.or(o(),i());function o(){if(r.length){if(!(t instanceof b.Name))throw Error("ajv implementation error");let a=Array.isArray(r)?r:[r];return b._`${Jr.checkDataTypes(a,t,s.opts.strictNumbers,Jr.DataType.Wrong)}`}return b.nil}function i(){if(n.validateSchema){let a=e.scopeValue("validate$data",{ref:n.validateSchema});return b._`!${a}(${t})`}return b.nil}}subschema(e,t){let r=ds.getSubschema(this.it,e);ds.extendSubschemaData(r,this.it,e),ds.extendSubschemaMode(r,e);let n={...this.it,...r,items:void 0,props:void 0};return QC(n,t),n}mergeEvaluated(e,t){let{it:r,gen:n}=this;if(!r.opts.unevaluated)return;if(r.props!==!0&&e.props!==void 0)r.props=Le.mergeEvaluated.props(n,e.props,r.props,t);if(r.items!==!0&&e.items!==void 0)r.items=Le.mergeEvaluated.items(n,e.items,r.items,t)}mergeValidEvaluated(e,t){let{it:r,gen:n}=this;if(r.opts.unevaluated&&(r.props!==!0||r.items!==!0))return n.if(t,()=>this.mergeEvaluated(e,b.Name)),!0}}ov.KeywordCxt=Xu;function nv(e,t,r,n){let s=new Xu(e,r,t);if("code"in r)r.code(s,n);else if(s.$data&&r.validate)Jt.funcKeywordCode(s,r);else if("macro"in r)Jt.macroKeywordCode(s,r);else if(r.compile||r.validate)Jt.funcKeywordCode(s,r)}var fj=/^\/(?:[^~]|~0|~1)*$/,pj=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function sv(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let s,o;if(e==="")return B.default.rootData;if(e[0]==="/"){if(!fj.test(e))throw Error(`Invalid JSON-pointer: ${e}`);s=e,o=B.default.rootData}else{let u=pj.exec(e);if(!u)throw Error(`Invalid JSON-pointer: ${e}`);let d=+u[1];if(s=u[2],s==="#"){if(d>=t)throw Error(c("property/index",d));return n[t-d]}if(d>t)throw Error(c("data",d));if(o=r[t-d],!s)return o}let i=o,a=s.split("/");for(let u of a)if(u)o=b._`${o}${b.getProperty(Le.unescapeJsonPointer(u))}`,i=b._`${i} && ${o}`;return i;function c(u,d){return`Cannot access ${u} ${d} levels up, current level is ${t}`}}ov.getData=sv});var oa=g(function(cv){Object.defineProperty(cv,"__esModule",{value:!0});class av extends Error{constructor(e){super("validation failed");this.errors=e,this.ajv=this.validation=!0}}cv.default=av});var po=g(function(lv){Object.defineProperty(lv,"__esModule",{value:!0});var ps=lo();class uv extends Error{constructor(e,t,r,n){super(n||`can't resolve reference ${r} from id ${t}`);this.missingRef=ps.resolveUrl(e,t,r),this.missingSchema=ps.normalizeId(ps.getFullPath(e,this.missingRef))}}lv.default=uv});var ca=g(function(pv){Object.defineProperty(pv,"__esModule",{value:!0});pv.resolveSchema=pv.getCompilingSchema=pv.resolveRef=pv.compileSchema=pv.SchemaEnv=void 0;var Ae=Z(),_j=oa(),Rn=vr(),Pe=lo(),ia=ae(),dv=fo();class ho{constructor(e){var t;this.refs={},this.dynamicAnchors={};let r;if(typeof e.schema=="object")r=e.schema;this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(t=e.baseId)!==null&&t!==void 0?t:Pe.normalizeId(r===null||r===void 0?void 0:r[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=r===null||r===void 0?void 0:r.$async,this.refs={}}}pv.SchemaEnv=ho;function Qu(e){let t=fv.call(this,e);if(t)return t;let r=Pe.getFullPath(this.opts.uriResolver,e.root.baseId),{es5:n,lines:s}=this.opts.code,{ownProperties:o}=this.opts,i=new Ae.CodeGen(this.scope,{es5:n,lines:s,ownProperties:o}),a;if(e.$async)a=i.scopeValue("Error",{ref:_j.default,code:Ae._`require("ajv/dist/runtime/validation_error").default`});let c=i.scopeName("validate");e.validateName=c;let u={gen:i,allErrors:this.opts.allErrors,data:Rn.default.data,parentData:Rn.default.parentData,parentDataProperty:Rn.default.parentDataProperty,dataNames:[Rn.default.data],dataPathArr:[Ae.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:i.scopeValue("schema",this.opts.code.source===!0?{ref:e.schema,code:Ae.stringify(e.schema)}:{ref:e.schema}),validateName:c,ValidationError:a,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:Ae.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:Ae._`""`,opts:this.opts,self:this},d;try{this._compilations.add(e),dv.validateFunctionCode(u),i.optimize(this.opts.code.optimize);let l=i.toString();if(d=`${i.scopeRefs(Rn.default.scope)}return ${l}`,this.opts.code.process)d=this.opts.code.process(d,e);let f=Function(`${Rn.default.self}`,`${Rn.default.scope}`,d)(this,this.scope.get());if(this.scope.value(c,{ref:f}),f.errors=null,f.schema=e.schema,f.schemaEnv=e,e.$async)f.$async=!0;if(this.opts.code.source===!0)f.source={validateName:c,validateCode:l,scopeValues:i._values};if(this.opts.unevaluated){let{props:h,items:m}=u;if(f.evaluated={props:h instanceof Ae.Name?void 0:h,items:m instanceof Ae.Name?void 0:m,dynamicProps:h instanceof Ae.Name,dynamicItems:m instanceof Ae.Name},f.source)f.source.evaluated=Ae.stringify(f.evaluated)}return e.validate=f,e}catch(l){if(delete e.validate,delete e.validateName,d)this.logger.error("Error compiling schema, function code:",d);throw l}finally{this._compilations.delete(e)}}pv.compileSchema=Qu;function vj(e,t,r){var n;r=Pe.resolveUrl(this.opts.uriResolver,t,r);let s=e.refs[r];if(s)return s;let o=bj.call(this,e,r);if(o===void 0){let i=(n=e.localRefs)===null||n===void 0?void 0:n[r],{schemaId:a}=this.opts;if(i)o=new ho({schema:i,schemaId:a,root:e,baseId:t})}if(o===void 0)return;return e.refs[r]=$j.call(this,o)}pv.resolveRef=vj;function $j(e){if(Pe.inlineRef(e.schema,this.opts.inlineRefs))return e.schema;return e.validate?e:Qu.call(this,e)}function fv(e){for(let t of this._compilations)if(Ej(t,e))return t}pv.getCompilingSchema=fv;function Ej(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function bj(e,t){let r;while(typeof(r=this.refs[t])=="string")t=r;return r||this.schemas[t]||aa.call(this,e,t)}function aa(e,t){let r=this.opts.uriResolver.parse(t),n=Pe._getFullPath(this.opts.uriResolver,r),s=Pe.getFullPath(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===s)return Ju.call(this,r,e);let o=Pe.normalizeId(n),i=this.refs[o]||this.schemas[o];if(typeof i=="string"){let a=aa.call(this,e,i);if(typeof(a===null||a===void 0?void 0:a.schema)!=="object")return;return Ju.call(this,r,a)}if(typeof(i===null||i===void 0?void 0:i.schema)!=="object")return;if(!i.validate)Qu.call(this,i);if(o===Pe.normalizeId(t)){let{schema:a}=i,{schemaId:c}=this.opts,u=a[c];if(u)s=Pe.resolveUrl(this.opts.uriResolver,s,u);return new ho({schema:a,schemaId:c,root:e,baseId:s})}return Ju.call(this,r,i)}pv.resolveSchema=aa;var wj=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Ju(e,{baseId:t,schema:r,root:n}){var s;if(((s=e.fragment)===null||s===void 0?void 0:s[0])!=="/")return;for(let a of e.fragment.slice(1).split("/")){if(typeof r==="boolean")return;let c=r[ia.unescapeFragment(a)];if(c===void 0)return;r=c;let u=typeof r==="object"&&r[this.opts.schemaId];if(!wj.has(a)&&u)t=Pe.resolveUrl(this.opts.uriResolver,t,u)}let o;if(typeof r!="boolean"&&r.$ref&&!ia.schemaHasRulesButRef(r,this.RULES)){let a=Pe.resolveUrl(this.opts.uriResolver,t,r.$ref);o=aa.call(this,n,a)}let{schemaId:i}=this.opts;if(o=o||new ho({schema:r,schemaId:i,root:n,baseId:t}),o.schema!==o.root.schema)return o;return}});var mv=g(function(lK,kj){kj.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var _v=g(function(yv){Object.defineProperty(yv,"__esModule",{value:!0});var gv=pu();gv.code='require("ajv/dist/runtime/uri").default';yv.default=gv});var kv=g(function($r){Object.defineProperty($r,"__esModule",{value:!0});$r.CodeGen=$r.Name=$r.nil=$r.stringify=$r.str=$r._=$r.KeywordCxt=void 0;var Aj=fo();Object.defineProperty($r,"KeywordCxt",{enumerable:!0,get:function(){return Aj.KeywordCxt}});var ms=Z();Object.defineProperty($r,"_",{enumerable:!0,get:function(){return ms._}});Object.defineProperty($r,"str",{enumerable:!0,get:function(){return ms.str}});Object.defineProperty($r,"stringify",{enumerable:!0,get:function(){return ms.stringify}});Object.defineProperty($r,"nil",{enumerable:!0,get:function(){return ms.nil}});Object.defineProperty($r,"Name",{enumerable:!0,get:function(){return ms.Name}});Object.defineProperty($r,"CodeGen",{enumerable:!0,get:function(){return ms.CodeGen}});var Pj=oa(),wv=po(),Sv=Fu(),Qt=ca(),xv=Z(),Zt=lo(),Qr=uo(),hs=ae(),vv=mv(),Nj=_v(),Rv=(e,t)=>new RegExp(e,t);Rv.code="new RegExp";var Ij=["removeAdditional","useDefaults","coerceTypes"],Cj=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),jj={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."},qj={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},$v=200;function Dj(e){var t,r,n,s,o,i,a,c,u,d,l,p,f,h,m,y,_,O,T,M,S,_e,ve,xt,hr;let et=e.strict,gn=(t=e.code)===null||t===void 0?void 0:t.optimize,Fs=gn===!0||gn===void 0?1:gn||0,Vs=(n=(r=e.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:Rv,yc=(s=e.uriResolver)!==null&&s!==void 0?s:Nj.default;return{strictSchema:(i=(o=e.strictSchema)!==null&&o!==void 0?o:et)!==null&&i!==void 0?i:!0,strictNumbers:(c=(a=e.strictNumbers)!==null&&a!==void 0?a:et)!==null&&c!==void 0?c:!0,strictTypes:(d=(u=e.strictTypes)!==null&&u!==void 0?u:et)!==null&&d!==void 0?d:"log",strictTuples:(p=(l=e.strictTuples)!==null&&l!==void 0?l:et)!==null&&p!==void 0?p:"log",strictRequired:(h=(f=e.strictRequired)!==null&&f!==void 0?f:et)!==null&&h!==void 0?h:!1,code:e.code?{...e.code,optimize:Fs,regExp:Vs}:{optimize:Fs,regExp:Vs},loopRequired:(m=e.loopRequired)!==null&&m!==void 0?m:$v,loopEnum:(y=e.loopEnum)!==null&&y!==void 0?y:$v,meta:(_=e.meta)!==null&&_!==void 0?_:!0,messages:(O=e.messages)!==null&&O!==void 0?O:!0,inlineRefs:(T=e.inlineRefs)!==null&&T!==void 0?T:!0,schemaId:(M=e.schemaId)!==null&&M!==void 0?M:"$id",addUsedSchema:(S=e.addUsedSchema)!==null&&S!==void 0?S:!0,validateSchema:(_e=e.validateSchema)!==null&&_e!==void 0?_e:!0,validateFormats:(ve=e.validateFormats)!==null&&ve!==void 0?ve:!0,unicodeRegExp:(xt=e.unicodeRegExp)!==null&&xt!==void 0?xt:!0,int32range:(hr=e.int32range)!==null&&hr!==void 0?hr:!0,uriResolver:yc}}class ua{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...Dj(e)};let{es5:t,lines:r}=this.opts.code;this.scope=new xv.ValueScope({scope:{},prefixes:Cj,es5:t,lines:r}),this.logger=zj(e.logger);let n=e.validateFormats;if(e.validateFormats=!1,this.RULES=Sv.getRules(),Ev.call(this,jj,e,"NOT SUPPORTED"),Ev.call(this,qj,e,"DEPRECATED","warn"),this._metaOpts=Fj.call(this),e.formats)Lj.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords)Uj.call(this,e.keywords);if(typeof e.meta=="object")this.addMetaSchema(e.meta);Mj.call(this),e.validateFormats=n}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:r}=this.opts,n=vv;if(r==="id")n={...vv},n.id=n.$id,delete n.$id;if(t&&e)this.addMetaSchema(n,n[r],!1)}defaultMeta(){let{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[t]||e:void 0}validate(e,t){let r;if(typeof e=="string"){if(r=this.getSchema(e),!r)throw Error(`no schema with key or ref "${e}"`)}else r=this.compile(e);let n=r(t);if(!("$async"in r))this.errors=r.errors;return n}compile(e,t){let r=this._addSchema(e,t);return r.validate||this._compileSchemaEnv(r)}compileAsync(e,t){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:r}=this.opts;return n.call(this,e,t);async function n(u,d){await s.call(this,u.$schema);let l=this._addSchema(u,d);return l.validate||o.call(this,l)}async function s(u){if(u&&!this.getSchema(u))await n.call(this,{$ref:u},!0)}async function o(u){try{return this._compileSchemaEnv(u)}catch(d){if(!(d instanceof wv.default))throw d;return i.call(this,d),await a.call(this,d.missingSchema),o.call(this,u)}}function i({missingSchema:u,missingRef:d}){if(this.refs[u])throw Error(`AnySchema ${u} is loaded but ${d} cannot be resolved`)}async function a(u){let d=await c.call(this,u);if(!this.refs[u])await s.call(this,d.$schema);if(!this.refs[u])this.addSchema(d,u,t)}async function c(u){let d=this._loading[u];if(d)return d;try{return await(this._loading[u]=r(u))}finally{delete this._loading[u]}}}addSchema(e,t,r,n=this.opts.validateSchema){if(Array.isArray(e)){for(let o of e)this.addSchema(o,void 0,r,n);return this}let s;if(typeof e==="object"){let{schemaId:o}=this.opts;if(s=e[o],s!==void 0&&typeof s!="string")throw Error(`schema ${o} must be string`)}return t=Zt.normalizeId(t||s),this._checkUnique(t),this.schemas[t]=this._addSchema(e,r,t,n,!0),this}addMetaSchema(e,t,r=this.opts.validateSchema){return this.addSchema(e,t,!0,r),this}validateSchema(e,t){if(typeof e=="boolean")return!0;let r;if(r=e.$schema,r!==void 0&&typeof r!="string")throw Error("$schema must be a string");if(r=r||this.opts.defaultMeta||this.defaultMeta(),!r)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let n=this.validate(r,e);if(!n&&t){let s="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(s);else throw Error(s)}return n}getSchema(e){let t;while(typeof(t=bv.call(this,e))=="string")e=t;if(t===void 0){let{schemaId:r}=this.opts,n=new Qt.SchemaEnv({schema:{},schemaId:r});if(t=Qt.resolveSchema.call(this,n,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let t=bv.call(this,e);if(typeof t=="object")this._cache.delete(t.schema);return delete this.schemas[e],delete this.refs[e],this}case"object":{let t=e;this._cache.delete(t);let r=e[this.opts.schemaId];if(r)r=Zt.normalizeId(r),delete this.schemas[r],delete this.refs[r];return this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let t of e)this.addKeyword(t);return this}addKeyword(e,t){let r;if(typeof e=="string"){if(r=e,typeof t=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=r}else if(typeof e=="object"&&t===void 0){if(t=e,r=t.keyword,Array.isArray(r)&&!r.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(Kj.call(this,r,t),!t)return hs.eachItem(r,(s)=>Zu.call(this,s)),this;Bj.call(this,t);let n={...t,type:Qr.getJSONTypes(t.type),schemaType:Qr.getJSONTypes(t.schemaType)};return hs.eachItem(r,n.type.length===0?(s)=>Zu.call(this,s,n):(s)=>n.type.forEach((o)=>Zu.call(this,s,n,o))),this}getKeyword(e){let t=this.RULES.all[e];return typeof t=="object"?t.definition:!!t}removeKeyword(e){let{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(let r of t.rules){let n=r.rules.findIndex((s)=>s.keyword===e);if(n>=0)r.rules.splice(n,1)}return this}addFormat(e,t){if(typeof t=="string")t=new RegExp(t);return this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:r="data"}={}){if(!e||e.length===0)return"No errors";return e.map((n)=>`${r}${n.instancePath} ${n.message}`).reduce((n,s)=>n+t+s)}$dataMetaSchema(e,t){let r=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let n of t){let s=n.split("/").slice(1),o=e;for(let i of s)o=o[i];for(let i in r){let a=r[i];if(typeof a!="object")continue;let{$data:c}=a.definition,u=o[i];if(c&&u)o[i]=Tv(u)}}return e}_removeAllSchemas(e,t){for(let r in e){let n=e[r];if(!t||t.test(r)){if(typeof n=="string")delete e[r];else if(n&&!n.meta)this._cache.delete(n.schema),delete e[r]}}}_addSchema(e,t,r,n=this.opts.validateSchema,s=this.opts.addUsedSchema){let o,{schemaId:i}=this.opts;if(typeof e=="object")o=e[i];else if(this.opts.jtd)throw Error("schema must be object");else if(typeof e!="boolean")throw Error("schema must be object or boolean");let a=this._cache.get(e);if(a!==void 0)return a;r=Zt.normalizeId(o||r);let c=Zt.getSchemaRefs.call(this,e,r);if(a=new Qt.SchemaEnv({schema:e,schemaId:i,meta:t,baseId:r,localRefs:c}),this._cache.set(a.schema,a),s&&!r.startsWith("#")){if(r)this._checkUnique(r);this.refs[r]=a}if(n)this.validateSchema(e,!0);return a}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta)this._compileMetaSchema(e);else Qt.compileSchema.call(this,e);if(!e.validate)throw Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let t=this.opts;this.opts=this._metaOpts;try{Qt.compileSchema.call(this,e)}finally{this.opts=t}}}ua.ValidationError=Pj.default;ua.MissingRefError=wv.default;$r.default=ua;function Ev(e,t,r,n="error"){for(let s in e){let o=s;if(o in t)this.logger[n](`${r}: option ${s}. ${e[o]}`)}}function bv(e){return e=Zt.normalizeId(e),this.schemas[e]||this.refs[e]}function Mj(){let e=this.opts.schemas;if(!e)return;if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}function Lj(){for(let e in this.opts.formats){let t=this.opts.formats[e];if(t)this.addFormat(e,t)}}function Uj(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let t in e){let r=e[t];if(!r.keyword)r.keyword=t;this.addKeyword(r)}}function Fj(){let e={...this.opts};for(let t of Ij)delete e[t];return e}var Vj={log(){},warn(){},error(){}};function zj(e){if(e===!1)return Vj;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw Error("logger must implement log, warn and error methods")}var Gj=/^[a-z_$][a-z0-9_$:-]*$/i;function Kj(e,t){let{RULES:r}=this;if(hs.eachItem(e,(n)=>{if(r.keywords[n])throw Error(`Keyword ${n} is already defined`);if(!Gj.test(n))throw Error(`Keyword ${n} has invalid name`)}),!t)return;if(t.$data&&!(("code"in t)||("validate"in t)))throw Error('$data keyword must have "code" or "validate" function')}function Zu(e,t,r){var n;let s=t===null||t===void 0?void 0:t.post;if(r&&s)throw Error('keyword with "post" flag cannot have "type"');let{RULES:o}=this,i=s?o.post:o.rules.find(({type:c})=>c===r);if(!i)i={type:r,rules:[]},o.rules.push(i);if(o.keywords[e]=!0,!t)return;let a={keyword:e,definition:{...t,type:Qr.getJSONTypes(t.type),schemaType:Qr.getJSONTypes(t.schemaType)}};if(t.before)Hj.call(this,i,a,t.before);else i.rules.push(a);o.all[e]=a,(n=t.implements)===null||n===void 0||n.forEach((c)=>this.addKeyword(c))}function Hj(e,t,r){let n=e.rules.findIndex((s)=>s.keyword===r);if(n>=0)e.rules.splice(n,0,t);else e.rules.push(t),this.logger.warn(`rule ${r} is not defined`)}function Bj(e){let{metaSchema:t}=e;if(t===void 0)return;if(e.$data&&this.opts.$data)t=Tv(t);e.validateSchema=this.compile(t,!0)}var Wj={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Tv(e){return{anyOf:[e,Wj]}}});var Av=g(function(Ov){Object.defineProperty(Ov,"__esModule",{value:!0});var Jj={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};Ov.default=Jj});var Cv=g(function(Nv){Object.defineProperty(Nv,"__esModule",{value:!0});Nv.callRef=Nv.getValidate=void 0;var Zj=po(),da=_t(),ge=Z(),gs=vr(),fa=ca(),Zr=ae(),eq={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:r,it:n}=e,{baseId:s,schemaEnv:o,validateName:i,opts:a,self:c}=n,{root:u}=o;if((r==="#"||r==="#/")&&s===u.baseId)return l();let d=fa.resolveRef.call(c,u,s,r);if(d===void 0)throw new Zj.default(n.opts.uriResolver,s,r);if(d instanceof fa.SchemaEnv)return p(d);return f(d);function l(){if(o===u)return la(e,i,o,o.$async);let h=t.scopeValue("root",{ref:u});return la(e,ge._`${h}.validate`,u,u.$async)}function p(h){let m=Pv(e,h);la(e,m,h,h.$async)}function f(h){let m=t.scopeValue("schema",a.code.source===!0?{ref:h,code:ge.stringify(h)}:{ref:h}),y=t.name("valid"),_=e.subschema({schema:h,dataTypes:[],schemaPath:ge.nil,topSchemaRef:m,errSchemaPath:r},y);e.mergeEvaluated(_),e.ok(y)}}};function Pv(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):ge._`${r.scopeValue("wrapper",{ref:t})}.validate`}Nv.getValidate=Pv;function la(e,t,r,n){let{gen:s,it:o}=e,{allErrors:i,schemaEnv:a,opts:c}=o,u=c.passContext?gs.default.this:ge.nil;if(n)d();else l();function d(){if(!a.$async)throw Error("async schema referenced by sync schema");let h=s.let("valid");s.try(()=>{if(s.code(ge._`await ${da.callValidateCode(e,t,u)}`),f(t),!i)s.assign(h,!0)},(m)=>{if(s.if(ge._`!(${m} instanceof ${o.ValidationError})`,()=>s.throw(m)),p(m),!i)s.assign(h,!1)}),e.ok(h)}function l(){e.result(da.callValidateCode(e,t,u),()=>f(t),()=>p(t))}function p(h){let m=ge._`${h}.errors`;s.assign(gs.default.vErrors,ge._`${gs.default.vErrors} === null ? ${m} : ${gs.default.vErrors}.concat(${m})`),s.assign(gs.default.errors,ge._`${gs.default.vErrors}.length`)}function f(h){var m;if(!o.opts.unevaluated)return;let y=(m=r===null||r===void 0?void 0:r.validate)===null||m===void 0?void 0:m.evaluated;if(o.props!==!0)if(y&&!y.dynamicProps){if(y.props!==void 0)o.props=Zr.mergeEvaluated.props(s,y.props,o.props)}else{let _=s.var("props",ge._`${h}.evaluated.props`);o.props=Zr.mergeEvaluated.props(s,_,o.props,ge.Name)}if(o.items!==!0)if(y&&!y.dynamicItems){if(y.items!==void 0)o.items=Zr.mergeEvaluated.items(s,y.items,o.items)}else{let _=s.var("items",ge._`${h}.evaluated.items`);o.items=Zr.mergeEvaluated.items(s,_,o.items,ge.Name)}}}Nv.callRef=la;Nv.default=eq});var qv=g(function(jv){Object.defineProperty(jv,"__esModule",{value:!0});var nq=Av(),sq=Cv(),oq=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",nq.default,sq.default];jv.default=oq});var Mv=g(function(Dv){Object.defineProperty(Dv,"__esModule",{value:!0});var tn=Z(),en=tn.operators,pa={maximum:{okStr:"<=",ok:en.LTE,fail:en.GT},minimum:{okStr:">=",ok:en.GTE,fail:en.LT},exclusiveMaximum:{okStr:"<",ok:en.LT,fail:en.GTE},exclusiveMinimum:{okStr:">",ok:en.GT,fail:en.LTE}},aq={message:({keyword:e,schemaCode:t})=>tn.str`must be ${pa[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>tn._`{comparison: ${pa[e].okStr}, limit: ${t}}`},cq={keyword:Object.keys(pa),type:"number",schemaType:"number",$data:!0,error:aq,code(e){let{keyword:t,data:r,schemaCode:n}=e;e.fail$data(tn._`${r} ${pa[t].fail} ${n} || isNaN(${r})`)}};Dv.default=cq});var Uv=g(function(Lv){Object.defineProperty(Lv,"__esModule",{value:!0});var er=Z(),lq={message:({schemaCode:e})=>er.str`must be multiple of ${e}`,params:({schemaCode:e})=>er._`{multipleOf: ${e}}`},dq={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:lq,code(e){let{gen:t,data:r,schemaCode:n,it:s}=e,o=s.opts.multipleOfPrecision,i=t.let("res"),a=o?er._`Math.abs(Math.round(${i}) - ${i}) > 1e-${o}`:er._`${i} !== parseInt(${i})`;e.fail$data(er._`(${n} === 0 || (${i} = ${r}/${n}, ${a}))`)}};Lv.default=dq});var zv=g(function(Vv){Object.defineProperty(Vv,"__esModule",{value:!0});function Fv(e){let t=e.length,r=0,n=0,s;while(n<t)if(r++,s=e.charCodeAt(n++),s>=55296&&s<=56319&&n<t){if(s=e.charCodeAt(n),(s&64512)===56320)n++}return r}Vv.default=Fv;Fv.code='require("ajv/dist/runtime/ucs2length").default'});var Hv=g(function(Kv){Object.defineProperty(Kv,"__esModule",{value:!0});var ct=Z(),Gv=ae(),hq=zv(),mq={message({keyword:e,schemaCode:t}){return ct.str`must NOT have ${e==="maxLength"?"more":"fewer"} than ${t} characters`},params:({schemaCode:e})=>ct._`{limit: ${e}}`},gq={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:mq,code(e){let{keyword:t,data:r,schemaCode:n,it:s}=e,o=t==="maxLength"?ct.operators.GT:ct.operators.LT,i=s.opts.unicode===!1?ct._`${r}.length`:ct._`${Gv.useFunc(e.gen,hq.default)}(${r})`;e.fail$data(ct._`${i} ${o} ${n}`)}};Kv.default=gq});var Yv=g(function(Wv){Object.defineProperty(Wv,"__esModule",{value:!0});var Bv=_t(),rn=Z(),_q={message:({schemaCode:e})=>rn.str`must match pattern "${e}"`,params:({schemaCode:e})=>rn._`{pattern: ${e}}`},vq={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:_q,code(e){let{data:t,$data:r,schema:n,schemaCode:s,it:o}=e,i=o.opts.unicodeRegExp?"u":"",a=r?rn._`(new RegExp(${s}, ${i}))`:Bv.usePattern(e,n);e.fail$data(rn._`!${a}.test(${t})`)}};Wv.default=vq});var Jv=g(function(Xv){Object.defineProperty(Xv,"__esModule",{value:!0});var tr=Z(),Eq={message({keyword:e,schemaCode:t}){return tr.str`must NOT have ${e==="maxProperties"?"more":"fewer"} than ${t} properties`},params:({schemaCode:e})=>tr._`{limit: ${e}}`},bq={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:Eq,code(e){let{keyword:t,data:r,schemaCode:n}=e,s=t==="maxProperties"?tr.operators.GT:tr.operators.LT;e.fail$data(tr._`Object.keys(${r}).length ${s} ${n}`)}};Xv.default=bq});var e0=g(function(Zv){Object.defineProperty(Zv,"__esModule",{value:!0});var rr=_t(),nr=Z(),Qv=ae(),Sq={message:({params:{missingProperty:e}})=>nr.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>nr._`{missingProperty: ${e}}`},xq={keyword:"required",type:"object",schemaType:"array",$data:!0,error:Sq,code(e){let{gen:t,schema:r,schemaCode:n,data:s,$data:o,it:i}=e,{opts:a}=i;if(!o&&r.length===0)return;let c=r.length>=a.loopRequired;if(i.allErrors)u();else d();if(a.strictRequired){let f=e.parentSchema.properties,{definedProperties:h}=e.it;for(let m of r)if((f===null||f===void 0?void 0:f[m])===void 0&&!h.has(m)){let y=i.schemaEnv.baseId+i.errSchemaPath,_=`required property "${m}" is not defined at "${y}" (strictRequired)`;Qv.checkStrictMode(i,_,i.opts.strictRequired)}}function u(){if(c||o)e.block$data(nr.nil,l);else for(let f of r)rr.checkReportMissingProp(e,f)}function d(){let f=t.let("missing");if(c||o){let h=t.let("valid",!0);e.block$data(h,()=>p(f,h)),e.ok(h)}else t.if(rr.checkMissingProp(e,r,f)),rr.reportMissingProp(e,f),t.else()}function l(){t.forOf("prop",n,(f)=>{e.setParams({missingProperty:f}),t.if(rr.noPropertyInData(t,s,f,a.ownProperties),()=>e.error())})}function p(f,h){e.setParams({missingProperty:f}),t.forOf(f,n,()=>{t.assign(h,rr.propertyInData(t,s,f,a.ownProperties)),t.if(nr.not(h),()=>{e.error(),t.break()})},nr.nil)}}};Zv.default=xq});var r0=g(function(t0){Object.defineProperty(t0,"__esModule",{value:!0});var sr=Z(),Tq={message({keyword:e,schemaCode:t}){return sr.str`must NOT have ${e==="maxItems"?"more":"fewer"} than ${t} items`},params:({schemaCode:e})=>sr._`{limit: ${e}}`},kq={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:Tq,code(e){let{keyword:t,data:r,schemaCode:n}=e,s=t==="maxItems"?sr.operators.GT:sr.operators.LT;e.fail$data(sr._`${r}.length ${s} ${n}`)}};t0.default=kq});var ha=g(function(s0){Object.defineProperty(s0,"__esModule",{value:!0});var n0=Js();n0.code='require("ajv/dist/runtime/equal").default';s0.default=n0});var a0=g(function(i0){Object.defineProperty(i0,"__esModule",{value:!0});var ys=uo(),oe=Z(),o0=ae(),Pq=ha(),Nq={message:({params:{i:e,j:t}})=>oe.str`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>oe._`{i: ${e}, j: ${t}}`},Iq={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:Nq,code(e){let{gen:t,data:r,$data:n,schema:s,parentSchema:o,schemaCode:i,it:a}=e;if(!n&&!s)return;let c=t.let("valid"),u=o.items?ys.getSchemaTypes(o.items):[];e.block$data(c,d,oe._`${i} === false`),e.ok(c);function d(){let h=t.let("i",oe._`${r}.length`),m=t.let("j");e.setParams({i:h,j:m}),t.assign(c,!0),t.if(oe._`${h} > 1`,()=>(l()?p:f)(h,m))}function l(){return u.length>0&&!u.some((h)=>h==="object"||h==="array")}function p(h,m){let y=t.name("item"),_=ys.checkDataTypes(u,y,a.opts.strictNumbers,ys.DataType.Wrong),O=t.const("indices",oe._`{}`);t.for(oe._`;${h}--;`,()=>{if(t.let(y,oe._`${r}[${h}]`),t.if(_,oe._`continue`),u.length>1)t.if(oe._`typeof ${y} == "string"`,oe._`${y} += "_"`);t.if(oe._`typeof ${O}[${y}] == "number"`,()=>{t.assign(m,oe._`${O}[${y}]`),e.error(),t.assign(c,!1).break()}).code(oe._`${O}[${y}] = ${h}`)})}function f(h,m){let y=o0.useFunc(t,Pq.default),_=t.name("outer");t.label(_).for(oe._`;${h}--;`,()=>t.for(oe._`${m} = ${h}; ${m}--;`,()=>t.if(oe._`${y}(${r}[${h}], ${r}[${m}])`,()=>{e.error(),t.assign(c,!1).break(_)})))}}};i0.default=Iq});var l0=g(function(u0){Object.defineProperty(u0,"__esModule",{value:!0});var _s=Z(),c0=ae(),jq=ha(),qq={message:"must be equal to constant",params:({schemaCode:e})=>_s._`{allowedValue: ${e}}`},Dq={keyword:"const",$data:!0,error:qq,code(e){let{gen:t,data:r,$data:n,schemaCode:s,schema:o}=e;if(n||o&&typeof o=="object")e.fail$data(_s._`!${c0.useFunc(t,jq.default)}(${r}, ${s})`);else e.fail(_s._`${o} !== ${r}`)}};u0.default=Dq});var p0=g(function(f0){Object.defineProperty(f0,"__esModule",{value:!0});var or=Z(),d0=ae(),Lq=ha(),Uq={message:"must be equal to one of the allowed values",params:({schemaCode:e})=>or._`{allowedValues: ${e}}`},Fq={keyword:"enum",schemaType:"array",$data:!0,error:Uq,code(e){let{gen:t,data:r,$data:n,schema:s,schemaCode:o,it:i}=e;if(!n&&s.length===0)throw Error("enum must have non-empty array");let a=s.length>=i.opts.loopEnum,c,u=()=>c!==null&&c!==void 0?c:c=d0.useFunc(t,Lq.default),d;if(a||n)d=t.let("valid"),e.block$data(d,l);else{if(!Array.isArray(s))throw Error("ajv implementation error");let f=t.const("vSchema",o);d=or.or(...s.map((h,m)=>p(f,m)))}e.pass(d);function l(){t.assign(d,!1),t.forOf("v",o,(f)=>t.if(or._`${u()}(${r}, ${f})`,()=>t.assign(d,!0).break()))}function p(f,h){let m=s[h];return typeof m==="object"&&m!==null?or._`${u()}(${r}, ${f}[${h}])`:or._`${r} === ${m}`}}};f0.default=Fq});var m0=g(function(h0){Object.defineProperty(h0,"__esModule",{value:!0});var zq=Mv(),Gq=Uv(),Kq=Hv(),Hq=Yv(),Bq=Jv(),Wq=e0(),Yq=r0(),Xq=a0(),Jq=l0(),Qq=p0(),Zq=[zq.default,Gq.default,Kq.default,Hq.default,Bq.default,Wq.default,Yq.default,Xq.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},Jq.default,Qq.default];h0.default=Zq});var el=g(function(y0){Object.defineProperty(y0,"__esModule",{value:!0});y0.validateAdditionalItems=void 0;var ut=Z(),vs=ae(),tD={message:({params:{len:e}})=>ut.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>ut._`{limit: ${e}}`},rD={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:tD,code(e){let{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){vs.checkStrictMode(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}g0(e,n)}};function g0(e,t){let{gen:r,schema:n,data:s,keyword:o,it:i}=e;i.items=!0;let a=r.const("len",ut._`${s}.length`);if(n===!1)e.setParams({len:t.length}),e.pass(ut._`${a} <= ${t.length}`);else if(typeof n=="object"&&!vs.alwaysValidSchema(i,n)){let u=r.var("valid",ut._`${a} <= ${t.length}`);r.if(ut.not(u),()=>c(u)),e.ok(u)}function c(u){r.forRange("i",t.length,a,(d)=>{if(e.subschema({keyword:o,dataProp:d,dataPropType:vs.Type.Num},u),!i.allErrors)r.if(ut.not(u),()=>r.break())})}}y0.validateAdditionalItems=g0;y0.default=rD});var tl=g(function(E0){Object.defineProperty(E0,"__esModule",{value:!0});E0.validateTuple=void 0;var ma=Z(),nn=ae(),v0=_t(),sD={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return $0(e,"additionalItems",t);if(r.items=!0,nn.alwaysValidSchema(r,t))return;e.ok(v0.validateArray(e))}};function $0(e,t,r=e.schema){let{gen:n,parentSchema:s,data:o,keyword:i,it:a}=e;if(d(s),a.opts.unevaluated&&r.length&&a.items!==!0)a.items=nn.mergeEvaluated.items(n,r.length,a.items);let c=n.name("valid"),u=n.const("len",ma._`${o}.length`);r.forEach((l,p)=>{if(nn.alwaysValidSchema(a,l))return;n.if(ma._`${u} > ${p}`,()=>e.subschema({keyword:i,schemaProp:p,dataProp:p},c)),e.ok(c)});function d(l){let{opts:p,errSchemaPath:f}=a,h=r.length,m=h===l.minItems&&(h===l.maxItems||l[t]===!1);if(p.strictTuples&&!m){let y=`"${i}" is ${h}-tuple, but minItems or maxItems/${t} are not specified or different at path "${f}"`;nn.checkStrictMode(a,y,p.strictTuples)}}}E0.validateTuple=$0;E0.default=sD});var x0=g(function(S0){Object.defineProperty(S0,"__esModule",{value:!0});var w0=tl(),iD={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(e)=>w0.validateTuple(e,"items")};S0.default=iD});var A0=g(function(O0){Object.defineProperty(O0,"__esModule",{value:!0});var ga=Z(),R0=ae(),T0=_t(),k0=el(),cD={message:({params:{len:e}})=>ga.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>ga._`{limit: ${e}}`},uD={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:cD,code(e){let{schema:t,parentSchema:r,it:n}=e,{prefixItems:s}=r;if(n.items=!0,R0.alwaysValidSchema(n,t))return;if(s)k0.validateAdditionalItems(e,s);else e.ok(T0.validateArray(e))}};O0.default=uD});var N0=g(function(P0){Object.defineProperty(P0,"__esModule",{value:!0});var Ee=Z(),sn=ae(),dD={message:({params:{min:e,max:t}})=>t===void 0?Ee.str`must contain at least ${e} valid item(s)`:Ee.str`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>t===void 0?Ee._`{minContains: ${e}}`:Ee._`{minContains: ${e}, maxContains: ${t}}`},fD={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:dD,code(e){let{gen:t,schema:r,parentSchema:n,data:s,it:o}=e,i,a,{minContains:c,maxContains:u}=n;if(o.opts.next)i=c===void 0?1:c,a=u;else i=1;let d=t.const("len",Ee._`${s}.length`);if(e.setParams({min:i,max:a}),a===void 0&&i===0){sn.checkStrictMode(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&i>a){sn.checkStrictMode(o,'"minContains" > "maxContains" is always invalid'),e.fail();return}if(sn.alwaysValidSchema(o,r)){let m=Ee._`${d} >= ${i}`;if(a!==void 0)m=Ee._`${m} && ${d} <= ${a}`;e.pass(m);return}o.items=!0;let l=t.name("valid");if(a===void 0&&i===1)f(l,()=>t.if(l,()=>t.break()));else if(i===0){if(t.let(l,!0),a!==void 0)t.if(Ee._`${s}.length > 0`,p)}else t.let(l,!1),p();e.result(l,()=>e.reset());function p(){let m=t.name("_valid"),y=t.let("count",0);f(m,()=>t.if(m,()=>h(y)))}function f(m,y){t.forRange("i",0,d,(_)=>{e.subschema({keyword:"contains",dataProp:_,dataPropType:sn.Type.Num,compositeRule:!0},m),y()})}function h(m){if(t.code(Ee._`${m}++`),a===void 0)t.if(Ee._`${m} >= ${i}`,()=>t.assign(l,!0).break());else if(t.if(Ee._`${m} > ${a}`,()=>t.assign(l,!1).break()),i===1)t.assign(l,!0);else t.if(Ee._`${m} >= ${i}`,()=>t.assign(l,!0))}}};P0.default=fD});var L0=g(function(q0){Object.defineProperty(q0,"__esModule",{value:!0});q0.validateSchemaDeps=q0.validatePropertyDeps=q0.error=void 0;var $s=Z(),I0=ae(),ir=_t();q0.error={message:({params:{property:e,depsCount:t,deps:r}})=>$s.str`must have ${t===1?"property":"properties"} ${r} when property ${e} is present`,params:({params:{property:e,depsCount:t,deps:r,missingProperty:n}})=>$s._`{property: ${e},
15
15
  missingProperty: ${n},
16
16
  depsCount: ${t},
17
- deps: ${r}}`};var hD={keyword:"dependencies",type:"object",schemaType:"object",error:q0.error,code(e){let[t,r]=mD(e);C0(e,t),j0(e,r)}};function mD({schema:e}){let t={},r={};for(let n in e){if(n==="__proto__")continue;let s=Array.isArray(e[n])?t:r;s[n]=e[n]}return[t,r]}function C0(e,t=e.schema){let{gen:r,data:n,it:s}=e;if(Object.keys(t).length===0)return;let o=r.let("missing");for(let i in t){let a=t[i];if(a.length===0)continue;let c=ir.propertyInData(r,n,i,s.opts.ownProperties);if(e.setParams({property:i,depsCount:a.length,deps:a.join(", ")}),s.allErrors)r.if(c,()=>{for(let u of a)ir.checkReportMissingProp(e,u)});else r.if($s._`${c} && (${ir.checkMissingProp(e,a,o)})`),ir.reportMissingProp(e,o),r.else()}}q0.validatePropertyDeps=C0;function j0(e,t=e.schema){let{gen:r,data:n,keyword:s,it:o}=e,i=r.name("valid");for(let a in t){if(I0.alwaysValidSchema(o,t[a]))continue;r.if(ir.propertyInData(r,n,a,o.opts.ownProperties),()=>{let c=e.subschema({keyword:s,schemaProp:a},i);e.mergeValidEvaluated(c,i)},()=>r.var(i,!0)),e.ok(i)}}q0.validateSchemaDeps=j0;q0.default=hD});var V0=g(function(F0){Object.defineProperty(F0,"__esModule",{value:!0});var ya=Z(),U0=ae(),_D={message:"property name must be valid",params:({params:e})=>ya._`{propertyName: ${e.propertyName}}`},vD={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:_D,code(e){let{gen:t,schema:r,data:n,it:s}=e;if(U0.alwaysValidSchema(s,r))return;let o=t.name("valid");t.forIn("key",n,(i)=>{e.setParams({propertyName:i}),e.subschema({keyword:"propertyNames",data:i,dataTypes:["string"],propertyName:i,compositeRule:!0},o),t.if(ya.not(o),()=>{if(e.error(!0),!s.allErrors)t.break()})}),e.ok(o)}};F0.default=vD});var rl=g(function(z0){Object.defineProperty(z0,"__esModule",{value:!0});var on=_t(),Ne=Z(),ED=vr(),an=ae(),wD={message:"must NOT have additional properties",params:({params:e})=>Ne._`{additionalProperty: ${e.additionalProperty}}`},bD={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:wD,code(e){let{gen:t,schema:r,parentSchema:n,data:s,errsCount:o,it:i}=e;if(!o)throw Error("ajv implementation error");let{allErrors:a,opts:c}=i;if(i.props=!0,c.removeAdditional!=="all"&&an.alwaysValidSchema(i,r))return;let u=on.allSchemaProperties(n.properties),d=on.allSchemaProperties(n.patternProperties);l(),e.ok(Ne._`${o} === ${ED.default.errors}`);function l(){t.forIn("key",s,(y)=>{if(!u.length&&!d.length)h(y);else t.if(p(y),()=>h(y))})}function p(y){let _;if(u.length>8){let O=an.schemaRefOrVal(i,n.properties,"properties");_=on.isOwnProperty(t,O,y)}else if(u.length)_=Ne.or(...u.map((O)=>Ne._`${y} === ${O}`));else _=Ne.nil;if(d.length)_=Ne.or(_,...d.map((O)=>Ne._`${on.usePattern(e,O)}.test(${y})`));return Ne.not(_)}function f(y){t.code(Ne._`delete ${s}[${y}]`)}function h(y){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){f(y);return}if(r===!1){if(e.setParams({additionalProperty:y}),e.error(),!a)t.break();return}if(typeof r=="object"&&!an.alwaysValidSchema(i,r)){let _=t.name("valid");if(c.removeAdditional==="failing")m(y,_,!1),t.if(Ne.not(_),()=>{e.reset(),f(y)});else if(m(y,_),!a)t.if(Ne.not(_),()=>t.break())}}function m(y,_,O){let T={keyword:"additionalProperties",dataProp:y,dataPropType:an.Type.Str};if(O===!1)Object.assign(T,{compositeRule:!0,createErrors:!1,allErrors:!1});e.subschema(T,_)}}};z0.default=bD});var B0=g(function(H0){Object.defineProperty(H0,"__esModule",{value:!0});var K0=fo(),_a=_t(),Es=ae(),G0=rl(),xD={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,parentSchema:n,data:s,it:o}=e;if(o.opts.removeAdditional==="all"&&n.additionalProperties===void 0)G0.default.code(new K0.KeywordCxt(o,G0.default,"additionalProperties"));let i=_a.allSchemaProperties(r);for(let l of i)o.definedProperties.add(l);if(o.opts.unevaluated&&i.length&&o.props!==!0)o.props=Es.mergeEvaluated.props(t,Es.toHash(i),o.props);let a=i.filter((l)=>!Es.alwaysValidSchema(o,r[l]));if(a.length===0)return;let c=t.name("valid");for(let l of a){if(u(l))d(l);else{if(t.if(_a.propertyInData(t,s,l,o.opts.ownProperties)),d(l),!o.allErrors)t.else().var(c,!0);t.endIf()}e.it.definedProperties.add(l),e.ok(c)}function u(l){return o.opts.useDefaults&&!o.compositeRule&&r[l].default!==void 0}function d(l){e.subschema({keyword:"properties",schemaProp:l,dataProp:l},c)}}};H0.default=xD});var Y0=g(function(W0){Object.defineProperty(W0,"__esModule",{value:!0});var va=_t(),cn=Z(),$a=ae(),Ea=ae(),TD={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:n,parentSchema:s,it:o}=e,{opts:i}=o,a=va.allSchemaProperties(r),c=a.filter((m)=>$a.alwaysValidSchema(o,r[m]));if(a.length===0||c.length===a.length&&(!o.opts.unevaluated||o.props===!0))return;let u=i.strictSchema&&!i.allowMatchingProperties&&s.properties,d=t.name("valid");if(o.props!==!0&&!(o.props instanceof cn.Name))o.props=Ea.evaluatedPropsToName(t,o.props);let{props:l}=o;p();function p(){for(let m of a){if(u)f(m);if(o.allErrors)h(m);else t.var(d,!0),h(m),t.if(d)}}function f(m){for(let y in u)if(new RegExp(m).test(y))$a.checkStrictMode(o,`property ${y} matches pattern ${m} (use allowMatchingProperties)`)}function h(m){t.forIn("key",n,(y)=>{t.if(cn._`${va.usePattern(e,m)}.test(${y})`,()=>{let _=c.includes(m);if(!_)e.subschema({keyword:"patternProperties",schemaProp:m,dataProp:y,dataPropType:Ea.Type.Str},d);if(o.opts.unevaluated&&l!==!0)t.assign(cn._`${l}[${y}]`,!0);else if(!_&&!o.allErrors)t.if(cn.not(d),()=>t.break())})})}}};W0.default=TD});var Q0=g(function(J0){Object.defineProperty(J0,"__esModule",{value:!0});var X0=ae(),OD={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:n}=e;if(X0.alwaysValidSchema(n,r)){e.fail();return}let s=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},s),e.failResult(s,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};J0.default=OD});var t$=g(function(e$){Object.defineProperty(e$,"__esModule",{value:!0});var Z0=_t(),PD={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Z0.validateUnion,error:{message:"must match a schema in anyOf"}};e$.default=PD});var s$=g(function(n$){Object.defineProperty(n$,"__esModule",{value:!0});var un=Z(),r$=ae(),ID={message:"must match exactly one schema in oneOf",params:({params:e})=>un._`{passingSchemas: ${e.passing}}`},CD={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:ID,code(e){let{gen:t,schema:r,parentSchema:n,it:s}=e;if(!Array.isArray(r))throw Error("ajv implementation error");if(s.opts.discriminator&&n.discriminator)return;let o=r,i=t.let("valid",!1),a=t.let("passing",null),c=t.name("_valid");e.setParams({passing:a}),t.block(u),e.result(i,()=>e.reset(),()=>e.error(!0));function u(){o.forEach((d,l)=>{let p;if(r$.alwaysValidSchema(s,d))t.var(c,!0);else p=e.subschema({keyword:"oneOf",schemaProp:l,compositeRule:!0},c);if(l>0)t.if(un._`${c} && ${i}`).assign(i,!1).assign(a,un._`[${a}, ${l}]`).else();t.if(c,()=>{if(t.assign(i,!0),t.assign(a,l),p)e.mergeEvaluated(p,un.Name)})})}}};n$.default=CD});var a$=g(function(i$){Object.defineProperty(i$,"__esModule",{value:!0});var o$=ae(),qD={keyword:"allOf",schemaType:"array",code(e){let{gen:t,schema:r,it:n}=e;if(!Array.isArray(r))throw Error("ajv implementation error");let s=t.name("valid");r.forEach((o,i)=>{if(o$.alwaysValidSchema(n,o))return;let a=e.subschema({keyword:"allOf",schemaProp:i},s);e.ok(s),e.mergeEvaluated(a)})}};i$.default=qD});var l$=g(function(u$){Object.defineProperty(u$,"__esModule",{value:!0});var ln=Z(),wa=ae(),MD={message:({params:e})=>ln.str`must match "${e.ifClause}" schema`,params:({params:e})=>ln._`{failingKeyword: ${e.ifClause}}`},LD={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:MD,code(e){let{gen:t,parentSchema:r,it:n}=e;if(r.then===void 0&&r.else===void 0)wa.checkStrictMode(n,'"if" without "then" and "else" is ignored');let s=c$(n,"then"),o=c$(n,"else");if(!s&&!o)return;let i=t.let("valid",!0),a=t.name("_valid");if(c(),e.reset(),s&&o){let d=t.let("ifClause");e.setParams({ifClause:d}),t.if(a,u("then",d),u("else",d))}else if(s)t.if(a,u("then"));else t.if(ln.not(a),u("else"));e.pass(i,()=>e.error(!0));function c(){let d=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);e.mergeEvaluated(d)}function u(d,l){return()=>{let p=e.subschema({keyword:d},a);if(t.assign(i,a),e.mergeValidEvaluated(p,i),l)t.assign(l,ln._`${d}`);else e.setParams({ifClause:d})}}}};function c$(e,t){let r=e.schema[t];return r!==void 0&&!wa.alwaysValidSchema(e,r)}u$.default=LD});var p$=g(function(f$){Object.defineProperty(f$,"__esModule",{value:!0});var d$=ae(),FD={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){if(t.if===void 0)d$.checkStrictMode(r,`"${e}" without "if" is ignored`)}};f$.default=FD});var m$=g(function(h$){Object.defineProperty(h$,"__esModule",{value:!0});var zD=el(),GD=x0(),KD=tl(),HD=A0(),BD=N0(),WD=L0(),YD=V0(),XD=rl(),JD=B0(),QD=Y0(),ZD=Q0(),eM=t$(),tM=s$(),rM=a$(),nM=l$(),sM=p$();function oM(e=!1){let t=[ZD.default,eM.default,tM.default,rM.default,nM.default,sM.default,YD.default,XD.default,WD.default,JD.default,QD.default];if(e)t.push(GD.default,HD.default);else t.push(zD.default,KD.default);return t.push(BD.default),t}h$.default=oM});var y$=g(function(g$){Object.defineProperty(g$,"__esModule",{value:!0});var J=Z(),aM={message:({schemaCode:e})=>J.str`must match format "${e}"`,params:({schemaCode:e})=>J._`{format: ${e}}`},cM={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:aM,code(e,t){let{gen:r,data:n,$data:s,schema:o,schemaCode:i,it:a}=e,{opts:c,errSchemaPath:u,schemaEnv:d,self:l}=a;if(!c.validateFormats)return;if(s)p();else f();function p(){let h=r.scopeValue("formats",{ref:l.formats,code:c.code.formats}),m=r.const("fDef",J._`${h}[${i}]`),y=r.let("fType"),_=r.let("format");r.if(J._`typeof ${m} == "object" && !(${m} instanceof RegExp)`,()=>r.assign(y,J._`${m}.type || "string"`).assign(_,J._`${m}.validate`),()=>r.assign(y,J._`"string"`).assign(_,m)),e.fail$data(J.or(O(),T()));function O(){if(c.strictSchema===!1)return J.nil;return J._`${i} && !${_}`}function T(){let M=d.$async?J._`(${m}.async ? await ${_}(${n}) : ${_}(${n}))`:J._`${_}(${n})`,S=J._`(typeof ${_} == "function" ? ${M} : ${_}.test(${n}))`;return J._`${_} && ${_} !== true && ${y} === ${t} && !${S}`}}function f(){let h=l.formats[o];if(!h){O();return}if(h===!0)return;let[m,y,_]=T(h);if(m===t)e.pass(M());function O(){if(c.strictSchema===!1){l.logger.warn(S());return}throw Error(S());function S(){return`unknown format "${o}" ignored in schema at path "${u}"`}}function T(S){let _e=S instanceof RegExp?J.regexpCode(S):c.code.formats?J._`${c.code.formats}${J.getProperty(o)}`:void 0,ve=r.scopeValue("formats",{key:o,ref:S,code:_e});if(typeof S=="object"&&!(S instanceof RegExp))return[S.type||"string",S.validate,J._`${ve}.validate`];return["string",S,ve]}function M(){if(typeof h=="object"&&!(h instanceof RegExp)&&h.async){if(!d.$async)throw Error("async format in sync schema");return J._`await ${_}(${n})`}return typeof y=="function"?J._`${_}(${n})`:J._`${_}.test(${n})`}}}};g$.default=cM});var v$=g(function(_$){Object.defineProperty(_$,"__esModule",{value:!0});var lM=y$(),dM=[lM.default];_$.default=dM});var w$=g(function($$){Object.defineProperty($$,"__esModule",{value:!0});$$.contentVocabulary=$$.metadataVocabulary=void 0;$$.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];$$.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var S$=g(function(b$){Object.defineProperty(b$,"__esModule",{value:!0});var hM=qv(),mM=m0(),gM=m$(),yM=v$(),ba=w$(),_M=[hM.default,mM.default,(0,gM.default)(),yM.default,ba.metadataVocabulary,ba.contentVocabulary];b$.default=_M});var k$=g(function(R$){Object.defineProperty(R$,"__esModule",{value:!0});R$.DiscrError=void 0;var x$;(function(e){e.Tag="tag",e.Mapping="mapping"})(x$||(R$.DiscrError=x$={}))});var P$=g(function(A$){Object.defineProperty(A$,"__esModule",{value:!0});var vt=Z(),ws=k$(),Sa=ca(),$M=po(),O$=ae(),EM={message:({params:{discrError:e,tagName:t}})=>e===ws.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>vt._`{error: ${e}, tag: ${r}, tagValue: ${t}}`},wM={keyword:"discriminator",type:"object",schemaType:"object",error:EM,code(e){let{gen:t,data:r,schema:n,parentSchema:s,it:o}=e,{oneOf:i}=s;if(!o.opts.discriminator)throw Error("discriminator: requires discriminator option");let a=n.propertyName;if(typeof a!="string")throw Error("discriminator: requires propertyName");if(n.mapping)throw Error("discriminator: mapping is not supported");if(!i)throw Error("discriminator: requires oneOf keyword");let c=t.let("valid",!1),u=t.const("tag",vt._`${r}${vt.getProperty(a)}`);t.if(vt._`typeof ${u} == "string"`,()=>d(),()=>e.error(!1,{discrError:ws.DiscrError.Tag,tag:u,tagName:a})),e.ok(c);function d(){let f=p();t.if(!1);for(let h in f)t.elseIf(vt._`${u} === ${h}`),t.assign(c,l(f[h]));t.else(),e.error(!1,{discrError:ws.DiscrError.Mapping,tag:u,tagName:a}),t.endIf()}function l(f){let h=t.name("valid"),m=e.subschema({keyword:"oneOf",schemaProp:f},h);return e.mergeEvaluated(m,vt.Name),h}function p(){var f;let h={},m=_(s),y=!0;for(let M=0;M<i.length;M++){let S=i[M];if((S===null||S===void 0?void 0:S.$ref)&&!O$.schemaHasRulesButRef(S,o.self.RULES)){let ve=S.$ref;if(S=Sa.resolveRef.call(o.self,o.schemaEnv.root,o.baseId,ve),S instanceof Sa.SchemaEnv)S=S.schema;if(S===void 0)throw new $M.default(o.opts.uriResolver,o.baseId,ve)}let _e=(f=S===null||S===void 0?void 0:S.properties)===null||f===void 0?void 0:f[a];if(typeof _e!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);y=y&&(m||_(S)),O(_e,M)}if(!y)throw Error(`discriminator: "${a}" must be required`);return h;function _({required:M}){return Array.isArray(M)&&M.includes(a)}function O(M,S){if(M.const)T(M.const,S);else if(M.enum)for(let _e of M.enum)T(_e,S);else throw Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function T(M,S){if(typeof M!="string"||M in h)throw Error(`discriminator: "${a}" values must be unique strings`);h[M]=S}}}};A$.default=wM});var N$=g(function(sH,SM){SM.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var C$=g(function(lt,nl){Object.defineProperty(lt,"__esModule",{value:!0});lt.MissingRefError=lt.ValidationError=lt.CodeGen=lt.Name=lt.nil=lt.stringify=lt.str=lt._=lt.KeywordCxt=lt.Ajv=void 0;var xM=kv(),RM=S$(),TM=P$(),I$=N$(),kM=["/properties"],xa="http://json-schema.org/draft-07/schema";class mo extends xM.default{_addVocabularies(){if(super._addVocabularies(),RM.default.forEach((e)=>this.addVocabulary(e)),this.opts.discriminator)this.addKeyword(TM.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(I$,kM):I$;this.addMetaSchema(e,xa,!1),this.refs["http://json-schema.org/schema"]=xa}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(xa)?xa:void 0)}}lt.Ajv=mo;nl.exports=lt=mo;nl.exports.Ajv=mo;Object.defineProperty(lt,"__esModule",{value:!0});lt.default=mo;var OM=fo();Object.defineProperty(lt,"KeywordCxt",{enumerable:!0,get:function(){return OM.KeywordCxt}});var bs=Z();Object.defineProperty(lt,"_",{enumerable:!0,get:function(){return bs._}});Object.defineProperty(lt,"str",{enumerable:!0,get:function(){return bs.str}});Object.defineProperty(lt,"stringify",{enumerable:!0,get:function(){return bs.stringify}});Object.defineProperty(lt,"nil",{enumerable:!0,get:function(){return bs.nil}});Object.defineProperty(lt,"Name",{enumerable:!0,get:function(){return bs.Name}});Object.defineProperty(lt,"CodeGen",{enumerable:!0,get:function(){return bs.CodeGen}});var AM=oa();Object.defineProperty(lt,"ValidationError",{enumerable:!0,get:function(){return AM.default}});var PM=po();Object.defineProperty(lt,"MissingRefError",{enumerable:!0,get:function(){return PM.default}})});var D$=g(function(q$){Object.defineProperty(q$,"__esModule",{value:!0});q$.formatLimitDefinition=void 0;var j$=C$(),Ie=Z(),dn=Ie.operators,Ra={formatMaximum:{okStr:"<=",ok:dn.LTE,fail:dn.GT},formatMinimum:{okStr:">=",ok:dn.GTE,fail:dn.LT},formatExclusiveMaximum:{okStr:"<",ok:dn.LT,fail:dn.GTE},formatExclusiveMinimum:{okStr:">",ok:dn.GT,fail:dn.LTE}},CM={message:({keyword:e,schemaCode:t})=>Ie.str`should be ${Ra[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>Ie._`{comparison: ${Ra[e].okStr}, limit: ${t}}`};q$.formatLimitDefinition={keyword:Object.keys(Ra),type:"string",schemaType:"string",$data:!0,error:CM,code(e){let{gen:t,data:r,schemaCode:n,keyword:s,it:o}=e,{opts:i,self:a}=o;if(!i.validateFormats)return;let c=new j$.KeywordCxt(o,a.RULES.all.format.definition,"format");if(c.$data)u();else d();function u(){let p=t.scopeValue("formats",{ref:a.formats,code:i.code.formats}),f=t.const("fmt",Ie._`${p}[${c.schemaCode}]`);e.fail$data(Ie.or(Ie._`typeof ${f} != "object"`,Ie._`${f} instanceof RegExp`,Ie._`typeof ${f}.compare != "function"`,l(f)))}function d(){let p=c.schema,f=a.formats[p];if(!f||f===!0)return;if(typeof f!="object"||f instanceof RegExp||typeof f.compare!="function")throw Error(`"${s}": format "${p}" does not define "compare" function`);let h=t.scopeValue("formats",{key:p,ref:f,code:i.code.formats?Ie._`${i.code.formats}${Ie.getProperty(p)}`:void 0});e.fail$data(l(h))}function l(p){return Ie._`${p}.compare(${r}, ${n}) ${Ra[s].fail} 0`}},dependencies:["format"]};var jM=(e)=>(e.addKeyword(q$.formatLimitDefinition),e);q$.default=jM});var F$=g(function(go,U$){Object.defineProperty(go,"__esModule",{value:!0});var $t=my(),DM=D$(),Ss=Z(),M$=new Ss.Name("fullFormats"),MM=new Ss.Name("fastFormats"),ol=(e,t={keywords:!0})=>{if(Array.isArray(t))return L$(e,t,$t.fullFormats,M$),e;let[r,n]=t.mode==="fast"?[$t.fastFormats,MM]:[$t.fullFormats,M$],s=t.formats||$t.formatNames;if(L$(e,s,r,n),t.keywords)(0,DM.default)(e);return e};ol.get=(e,t="full")=>{let n=(t==="fast"?$t.fastFormats:$t.fullFormats)[e];if(!n)throw Error(`Unknown format "${e}"`);return n};function L$(e,t,r,n){var s,o;(s=(o=e.opts.code).formats)!==null&&s!==void 0||(o.formats=Ss._`require("ajv-formats/dist/formats").${n}`);for(let i of t)e.addFormat(i,r[i])}U$.exports=go=ol;Object.defineProperty(go,"__esModule",{value:!0});go.default=ol});function il(e,t,{ignoreNonConfigurable:r=!1}={}){let{name:n}=e;for(let s of Reflect.ownKeys(t))LM(e,t,s,r);return FM(e,t),KM(e,t,n),e}var LM=(e,t,r,n)=>{if(r==="length"||r==="prototype")return;if(r==="arguments"||r==="caller")return;let s=Object.getOwnPropertyDescriptor(e,r),o=Object.getOwnPropertyDescriptor(t,r);if(!UM(s,o)&&n)return;Object.defineProperty(e,r,o)},UM=function(e,t){return e===void 0||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},FM=(e,t)=>{let r=Object.getPrototypeOf(t);if(r===Object.getPrototypeOf(e))return;Object.setPrototypeOf(e,r)},VM=(e,t)=>`/* Wrapped ${e}*/
18
- ${t}`,zM,GM,KM=(e,t,r)=>{let n=r===""?"":`with ${r.trim()}() `,s=VM.bind(null,n,t.toString());Object.defineProperty(s,"name",GM);let{writable:o,enumerable:i,configurable:a}=zM;Object.defineProperty(e,"toString",{value:s,writable:o,enumerable:i,configurable:a})};var V$=F(()=>{zM=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),GM=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name")});var HM=(e,t={})=>{if(typeof e!=="function")throw TypeError(`Expected the first argument to be a function, got \`${typeof e}\``);let{wait:r=0,maxWait:n=Number.POSITIVE_INFINITY,before:s=!1,after:o=!0}=t;if(r<0||n<0)throw RangeError("`wait` and `maxWait` must not be negative.");if(!s&&!o)throw Error("Both `before` and `after` are false, function wouldn't be called.");let i,a,c,u=function(...d){let l=this,p=()=>{if(i=void 0,a)clearTimeout(a),a=void 0;if(o)c=e.apply(l,d)},f=()=>{if(a=void 0,i)clearTimeout(i),i=void 0;if(o)c=e.apply(l,d)},h=s&&!i;if(clearTimeout(i),i=setTimeout(p,r),n>0&&n!==Number.POSITIVE_INFINITY&&!a)a=setTimeout(f,n);if(h)c=e.apply(l,d);return c};return il(u,e),u.cancel=()=>{if(i)clearTimeout(i),i=void 0;if(a)clearTimeout(a),a=void 0},u},al;var z$=F(()=>{V$();al=HM});var yo=g(function(yH,G$){var BM=Number.MAX_SAFE_INTEGER||9007199254740991,WM=["major","premajor","minor","preminor","patch","prepatch","prerelease"];G$.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:BM,RELEASE_TYPES:WM,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var _o=g(function(_H,K$){var YM=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};K$.exports=YM});var xs=g(function(ar,H$){var{MAX_SAFE_COMPONENT_LENGTH:cl,MAX_SAFE_BUILD_LENGTH:XM,MAX_LENGTH:JM}=yo(),QM=_o();ar=H$.exports={};var ZM=ar.re=[],eL=ar.safeRe=[],j=ar.src=[],tL=ar.safeSrc=[],q=ar.t={},rL=0,ul="[a-zA-Z0-9-]",nL=[["\\s",1],["\\d",JM],[ul,XM]],sL=(e)=>{for(let[t,r]of nL)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e},W=(e,t,r)=>{let n=sL(t),s=rL++;QM(e,s,t),q[e]=s,j[s]=t,tL[s]=n,ZM[s]=new RegExp(t,r?"g":void 0),eL[s]=new RegExp(n,r?"g":void 0)};W("NUMERICIDENTIFIER","0|[1-9]\\d*");W("NUMERICIDENTIFIERLOOSE","\\d+");W("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${ul}*`);W("MAINVERSION",`(${j[q.NUMERICIDENTIFIER]})\\.(${j[q.NUMERICIDENTIFIER]})\\.(${j[q.NUMERICIDENTIFIER]})`);W("MAINVERSIONLOOSE",`(${j[q.NUMERICIDENTIFIERLOOSE]})\\.(${j[q.NUMERICIDENTIFIERLOOSE]})\\.(${j[q.NUMERICIDENTIFIERLOOSE]})`);W("PRERELEASEIDENTIFIER",`(?:${j[q.NONNUMERICIDENTIFIER]}|${j[q.NUMERICIDENTIFIER]})`);W("PRERELEASEIDENTIFIERLOOSE",`(?:${j[q.NONNUMERICIDENTIFIER]}|${j[q.NUMERICIDENTIFIERLOOSE]})`);W("PRERELEASE",`(?:-(${j[q.PRERELEASEIDENTIFIER]}(?:\\.${j[q.PRERELEASEIDENTIFIER]})*))`);W("PRERELEASELOOSE",`(?:-?(${j[q.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${j[q.PRERELEASEIDENTIFIERLOOSE]})*))`);W("BUILDIDENTIFIER",`${ul}+`);W("BUILD",`(?:\\+(${j[q.BUILDIDENTIFIER]}(?:\\.${j[q.BUILDIDENTIFIER]})*))`);W("FULLPLAIN",`v?${j[q.MAINVERSION]}${j[q.PRERELEASE]}?${j[q.BUILD]}?`);W("FULL",`^${j[q.FULLPLAIN]}$`);W("LOOSEPLAIN",`[v=\\s]*${j[q.MAINVERSIONLOOSE]}${j[q.PRERELEASELOOSE]}?${j[q.BUILD]}?`);W("LOOSE",`^${j[q.LOOSEPLAIN]}$`);W("GTLT","((?:<|>)?=?)");W("XRANGEIDENTIFIERLOOSE",`${j[q.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);W("XRANGEIDENTIFIER",`${j[q.NUMERICIDENTIFIER]}|x|X|\\*`);W("XRANGEPLAIN",`[v=\\s]*(${j[q.XRANGEIDENTIFIER]})(?:\\.(${j[q.XRANGEIDENTIFIER]})(?:\\.(${j[q.XRANGEIDENTIFIER]})(?:${j[q.PRERELEASE]})?${j[q.BUILD]}?)?)?`);W("XRANGEPLAINLOOSE",`[v=\\s]*(${j[q.XRANGEIDENTIFIERLOOSE]})(?:\\.(${j[q.XRANGEIDENTIFIERLOOSE]})(?:\\.(${j[q.XRANGEIDENTIFIERLOOSE]})(?:${j[q.PRERELEASELOOSE]})?${j[q.BUILD]}?)?)?`);W("XRANGE",`^${j[q.GTLT]}\\s*${j[q.XRANGEPLAIN]}$`);W("XRANGELOOSE",`^${j[q.GTLT]}\\s*${j[q.XRANGEPLAINLOOSE]}$`);W("COERCEPLAIN",`(^|[^\\d])(\\d{1,${cl}})(?:\\.(\\d{1,${cl}}))?(?:\\.(\\d{1,${cl}}))?`);W("COERCE",`${j[q.COERCEPLAIN]}(?:$|[^\\d])`);W("COERCEFULL",j[q.COERCEPLAIN]+`(?:${j[q.PRERELEASE]})?(?:${j[q.BUILD]})?(?:$|[^\\d])`);W("COERCERTL",j[q.COERCE],!0);W("COERCERTLFULL",j[q.COERCEFULL],!0);W("LONETILDE","(?:~>?)");W("TILDETRIM",`(\\s*)${j[q.LONETILDE]}\\s+`,!0);ar.tildeTrimReplace="$1~";W("TILDE",`^${j[q.LONETILDE]}${j[q.XRANGEPLAIN]}$`);W("TILDELOOSE",`^${j[q.LONETILDE]}${j[q.XRANGEPLAINLOOSE]}$`);W("LONECARET","(?:\\^)");W("CARETTRIM",`(\\s*)${j[q.LONECARET]}\\s+`,!0);ar.caretTrimReplace="$1^";W("CARET",`^${j[q.LONECARET]}${j[q.XRANGEPLAIN]}$`);W("CARETLOOSE",`^${j[q.LONECARET]}${j[q.XRANGEPLAINLOOSE]}$`);W("COMPARATORLOOSE",`^${j[q.GTLT]}\\s*(${j[q.LOOSEPLAIN]})$|^$`);W("COMPARATOR",`^${j[q.GTLT]}\\s*(${j[q.FULLPLAIN]})$|^$`);W("COMPARATORTRIM",`(\\s*)${j[q.GTLT]}\\s*(${j[q.LOOSEPLAIN]}|${j[q.XRANGEPLAIN]})`,!0);ar.comparatorTrimReplace="$1$2$3";W("HYPHENRANGE",`^\\s*(${j[q.XRANGEPLAIN]})\\s+-\\s+(${j[q.XRANGEPLAIN]})\\s*$`);W("HYPHENRANGELOOSE",`^\\s*(${j[q.XRANGEPLAINLOOSE]})\\s+-\\s+(${j[q.XRANGEPLAINLOOSE]})\\s*$`);W("STAR","(<|>)?=?\\s*\\*");W("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");W("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Ta=g(function(vH,B$){var oL=Object.freeze({loose:!0}),iL=Object.freeze({}),aL=(e)=>{if(!e)return iL;if(typeof e!=="object")return oL;return e};B$.exports=aL});var ll=g(function($H,X$){var W$=/^[0-9]+$/,Y$=(e,t)=>{if(typeof e==="number"&&typeof t==="number")return e===t?0:e<t?-1:1;let r=W$.test(e),n=W$.test(t);if(r&&n)e=+e,t=+t;return e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},cL=(e,t)=>Y$(t,e);X$.exports={compareIdentifiers:Y$,rcompareIdentifiers:cL}});var Ke=g(function(EH,Q$){var ka=_o(),{MAX_LENGTH:J$,MAX_SAFE_INTEGER:Oa}=yo(),{safeRe:Aa,t:Pa}=xs(),uL=Ta(),{compareIdentifiers:dl}=ll();class Ot{constructor(e,t){if(t=uL(t),e instanceof Ot)if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;else e=e.version;else if(typeof e!=="string")throw TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>J$)throw TypeError(`version is longer than ${J$} characters`);ka("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let r=e.trim().match(t.loose?Aa[Pa.LOOSE]:Aa[Pa.FULL]);if(!r)throw TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>Oa||this.major<0)throw TypeError("Invalid major version");if(this.minor>Oa||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>Oa||this.patch<0)throw TypeError("Invalid patch version");if(!r[4])this.prerelease=[];else this.prerelease=r[4].split(".").map((n)=>{if(/^[0-9]+$/.test(n)){let s=+n;if(s>=0&&s<Oa)return s}return n});this.build=r[5]?r[5].split("."):[],this.format()}format(){if(this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length)this.version+=`-${this.prerelease.join(".")}`;return this.version}toString(){return this.version}compare(e){if(ka("SemVer.compare",this.version,this.options,e),!(e instanceof Ot)){if(typeof e==="string"&&e===this.version)return 0;e=new Ot(e,this.options)}if(e.version===this.version)return 0;return this.compareMain(e)||this.comparePre(e)}compareMain(e){if(!(e instanceof Ot))e=new Ot(e,this.options);if(this.major<e.major)return-1;if(this.major>e.major)return 1;if(this.minor<e.minor)return-1;if(this.minor>e.minor)return 1;if(this.patch<e.patch)return-1;if(this.patch>e.patch)return 1;return 0}comparePre(e){if(!(e instanceof Ot))e=new Ot(e,this.options);if(this.prerelease.length&&!e.prerelease.length)return-1;else if(!this.prerelease.length&&e.prerelease.length)return 1;else if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let r=this.prerelease[t],n=e.prerelease[t];if(ka("prerelease compare",t,r,n),r===void 0&&n===void 0)return 0;else if(n===void 0)return 1;else if(r===void 0)return-1;else if(r===n)continue;else return dl(r,n)}while(++t)}compareBuild(e){if(!(e instanceof Ot))e=new Ot(e,this.options);let t=0;do{let r=this.build[t],n=e.build[t];if(ka("build compare",t,r,n),r===void 0&&n===void 0)return 0;else if(n===void 0)return 1;else if(r===void 0)return-1;else if(r===n)continue;else return dl(r,n)}while(++t)}inc(e,t,r){if(e.startsWith("pre")){if(!t&&r===!1)throw Error("invalid increment argument: identifier is empty");if(t){let n=`-${t}`.match(this.options.loose?Aa[Pa.PRERELEASELOOSE]:Aa[Pa.PRERELEASE]);if(!n||n[1]!==t)throw Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":if(this.prerelease.length===0)this.inc("patch",t,r);this.inc("pre",t,r);break;case"release":if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0)this.major++;this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0)this.minor++;this.patch=0,this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":{let n=Number(r)?1:0;if(this.prerelease.length===0)this.prerelease=[n];else{let s=this.prerelease.length;while(--s>=0)if(typeof this.prerelease[s]==="number")this.prerelease[s]++,s=-2;if(s===-1){if(t===this.prerelease.join(".")&&r===!1)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(n)}}if(t){let s=[t,n];if(r===!1)s=[t];if(dl(this.prerelease[0],t)===0){if(isNaN(this.prerelease[1]))this.prerelease=s}else this.prerelease=s}break}default:throw Error(`invalid increment argument: ${e}`)}if(this.raw=this.format(),this.build.length)this.raw+=`+${this.build.join(".")}`;return this}}Q$.exports=Ot});var Tn=g(function(wH,eE){var Z$=Ke(),lL=(e,t,r=!1)=>{if(e instanceof Z$)return e;try{return new Z$(e,t)}catch(n){if(!r)return null;throw n}};eE.exports=lL});var rE=g(function(bH,tE){var dL=Tn(),fL=(e,t)=>{let r=dL(e,t);return r?r.version:null};tE.exports=fL});var sE=g(function(SH,nE){var pL=Tn(),hL=(e,t)=>{let r=pL(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};nE.exports=hL});var aE=g(function(xH,iE){var oE=Ke(),mL=(e,t,r,n,s)=>{if(typeof r==="string")s=n,n=r,r=void 0;try{return new oE(e instanceof oE?e.version:e,r).inc(t,n,s).version}catch(o){return null}};iE.exports=mL});var lE=g(function(RH,uE){var cE=Tn(),gL=(e,t)=>{let r=cE(e,null,!0),n=cE(t,null,!0),s=r.compare(n);if(s===0)return null;let o=s>0,i=o?r:n,a=o?n:r,c=!!i.prerelease.length;if(!!a.prerelease.length&&!c){if(!a.patch&&!a.minor)return"major";if(a.compareMain(i)===0){if(a.minor&&!a.patch)return"minor";return"patch"}}let d=c?"pre":"";if(r.major!==n.major)return d+"major";if(r.minor!==n.minor)return d+"minor";if(r.patch!==n.patch)return d+"patch";return"prerelease"};uE.exports=gL});var fE=g(function(TH,dE){var yL=Ke(),_L=(e,t)=>new yL(e,t).major;dE.exports=_L});var hE=g(function(kH,pE){var vL=Ke(),$L=(e,t)=>new vL(e,t).minor;pE.exports=$L});var gE=g(function(OH,mE){var EL=Ke(),wL=(e,t)=>new EL(e,t).patch;mE.exports=wL});var _E=g(function(AH,yE){var bL=Tn(),SL=(e,t)=>{let r=bL(e,t);return r&&r.prerelease.length?r.prerelease:null};yE.exports=SL});var Et=g(function(PH,$E){var vE=Ke(),xL=(e,t,r)=>new vE(e,r).compare(new vE(t,r));$E.exports=xL});var wE=g(function(NH,EE){var RL=Et(),TL=(e,t,r)=>RL(t,e,r);EE.exports=TL});var SE=g(function(IH,bE){var kL=Et(),OL=(e,t)=>kL(e,t,!0);bE.exports=OL});var Na=g(function(CH,RE){var xE=Ke(),AL=(e,t,r)=>{let n=new xE(e,r),s=new xE(t,r);return n.compare(s)||n.compareBuild(s)};RE.exports=AL});var kE=g(function(jH,TE){var PL=Na(),NL=(e,t)=>e.sort((r,n)=>PL(r,n,t));TE.exports=NL});var AE=g(function(qH,OE){var IL=Na(),CL=(e,t)=>e.sort((r,n)=>IL(n,r,t));OE.exports=CL});var vo=g(function(DH,PE){var jL=Et(),qL=(e,t,r)=>jL(e,t,r)>0;PE.exports=qL});var Ia=g(function(MH,NE){var DL=Et(),ML=(e,t,r)=>DL(e,t,r)<0;NE.exports=ML});var fl=g(function(LH,IE){var LL=Et(),UL=(e,t,r)=>LL(e,t,r)===0;IE.exports=UL});var pl=g(function(UH,CE){var FL=Et(),VL=(e,t,r)=>FL(e,t,r)!==0;CE.exports=VL});var Ca=g(function(FH,jE){var zL=Et(),GL=(e,t,r)=>zL(e,t,r)>=0;jE.exports=GL});var ja=g(function(VH,qE){var KL=Et(),HL=(e,t,r)=>KL(e,t,r)<=0;qE.exports=HL});var hl=g(function(zH,DE){var BL=fl(),WL=pl(),YL=vo(),XL=Ca(),JL=Ia(),QL=ja(),ZL=(e,t,r,n)=>{switch(t){case"===":if(typeof e==="object")e=e.version;if(typeof r==="object")r=r.version;return e===r;case"!==":if(typeof e==="object")e=e.version;if(typeof r==="object")r=r.version;return e!==r;case"":case"=":case"==":return BL(e,r,n);case"!=":return WL(e,r,n);case">":return YL(e,r,n);case">=":return XL(e,r,n);case"<":return JL(e,r,n);case"<=":return QL(e,r,n);default:throw TypeError(`Invalid operator: ${t}`)}};DE.exports=ZL});var LE=g(function(GH,ME){var eU=Ke(),tU=Tn(),{safeRe:qa,t:Da}=xs(),rU=(e,t)=>{if(e instanceof eU)return e;if(typeof e==="number")e=String(e);if(typeof e!=="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(t.includePrerelease?qa[Da.COERCEFULL]:qa[Da.COERCE]);else{let c=t.includePrerelease?qa[Da.COERCERTLFULL]:qa[Da.COERCERTL],u;while((u=c.exec(e))&&(!r||r.index+r[0].length!==e.length)){if(!r||u.index+u[0].length!==r.index+r[0].length)r=u;c.lastIndex=u.index+u[1].length+u[2].length}c.lastIndex=-1}if(r===null)return null;let n=r[2],s=r[3]||"0",o=r[4]||"0",i=t.includePrerelease&&r[5]?`-${r[5]}`:"",a=t.includePrerelease&&r[6]?`+${r[6]}`:"";return tU(`${n}.${s}.${o}${i}${a}`,t)};ME.exports=rU});var VE=g(function(KH,FE){class UE{constructor(){this.max=1000,this.map=new Map}get(e){let t=this.map.get(e);if(t===void 0)return;else return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let n=this.map.keys().next().value;this.delete(n)}this.map.set(e,t)}return this}}FE.exports=UE});var wt=g(function(HH,HE){var nU=/\s+/g;class $o{constructor(e,t){if(t=oU(t),e instanceof $o)if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;else return new $o(e.raw,t);if(e instanceof Ma)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(nU," "),this.set=this.raw.split("||").map((r)=>this.parseRange(r.trim())).filter((r)=>r.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let r=this.set[0];if(this.set=this.set.filter((n)=>!GE(n[0])),this.set.length===0)this.set=[r];else if(this.set.length>1){for(let n of this.set)if(n.length===1&&fU(n[0])){this.set=[n];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){if(e>0)this.formatted+="||";let t=this.set[e];for(let r=0;r<t.length;r++){if(r>0)this.formatted+=" ";this.formatted+=t[r].toString().trim()}}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let r=((this.options.includePrerelease&&lU)|(this.options.loose&&dU))+":"+e,n=zE.get(r);if(n)return n;let s=this.options.loose,o=s?Xe[He.HYPHENRANGELOOSE]:Xe[He.HYPHENRANGE];e=e.replace(o,wU(this.options.includePrerelease)),ye("hyphen replace",e),e=e.replace(Xe[He.COMPARATORTRIM],aU),ye("comparator trim",e),e=e.replace(Xe[He.TILDETRIM],cU),ye("tilde trim",e),e=e.replace(Xe[He.CARETTRIM],uU),ye("caret trim",e);let i=e.split(" ").map((d)=>pU(d,this.options)).join(" ").split(/\s+/).map((d)=>EU(d,this.options));if(s)i=i.filter((d)=>(ye("loose invalid filter",d,this.options),!!d.match(Xe[He.COMPARATORLOOSE])));ye("range list",i);let a=new Map,c=i.map((d)=>new Ma(d,this.options));for(let d of c){if(GE(d))return[d];a.set(d.value,d)}if(a.size>1&&a.has(""))a.delete("");let u=[...a.values()];return zE.set(r,u),u}intersects(e,t){if(!(e instanceof $o))throw TypeError("a Range is required");return this.set.some((r)=>KE(r,t)&&e.set.some((n)=>KE(n,t)&&r.every((s)=>n.every((o)=>s.intersects(o,t)))))}test(e){if(!e)return!1;if(typeof e==="string")try{e=new iU(e,this.options)}catch(t){return!1}for(let t=0;t<this.set.length;t++)if(bU(this.set[t],e,this.options))return!0;return!1}}HE.exports=$o;var sU=VE(),zE=new sU,oU=Ta(),Ma=Eo(),ye=_o(),iU=Ke(),{safeRe:Xe,t:He,comparatorTrimReplace:aU,tildeTrimReplace:cU,caretTrimReplace:uU}=xs(),{FLAG_INCLUDE_PRERELEASE:lU,FLAG_LOOSE:dU}=yo(),GE=(e)=>e.value==="<0.0.0-0",fU=(e)=>e.value==="",KE=(e,t)=>{let r=!0,n=e.slice(),s=n.pop();while(r&&n.length)r=n.every((o)=>s.intersects(o,t)),s=n.pop();return r},pU=(e,t)=>(e=e.replace(Xe[He.BUILD],""),ye("comp",e,t),e=gU(e,t),ye("caret",e),e=hU(e,t),ye("tildes",e),e=_U(e,t),ye("xrange",e),e=$U(e,t),ye("stars",e),e),Je=(e)=>!e||e.toLowerCase()==="x"||e==="*",hU=(e,t)=>e.trim().split(/\s+/).map((r)=>mU(r,t)).join(" "),mU=(e,t)=>{let r=t.loose?Xe[He.TILDELOOSE]:Xe[He.TILDE];return e.replace(r,(n,s,o,i,a)=>{ye("tilde",e,n,s,o,i,a);let c;if(Je(s))c="";else if(Je(o))c=`>=${s}.0.0 <${+s+1}.0.0-0`;else if(Je(i))c=`>=${s}.${o}.0 <${s}.${+o+1}.0-0`;else if(a)ye("replaceTilde pr",a),c=`>=${s}.${o}.${i}-${a} <${s}.${+o+1}.0-0`;else c=`>=${s}.${o}.${i} <${s}.${+o+1}.0-0`;return ye("tilde return",c),c})},gU=(e,t)=>e.trim().split(/\s+/).map((r)=>yU(r,t)).join(" "),yU=(e,t)=>{ye("caret",e,t);let r=t.loose?Xe[He.CARETLOOSE]:Xe[He.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,(s,o,i,a,c)=>{ye("caret",e,s,o,i,a,c);let u;if(Je(o))u="";else if(Je(i))u=`>=${o}.0.0${n} <${+o+1}.0.0-0`;else if(Je(a))if(o==="0")u=`>=${o}.${i}.0${n} <${o}.${+i+1}.0-0`;else u=`>=${o}.${i}.0${n} <${+o+1}.0.0-0`;else if(c)if(ye("replaceCaret pr",c),o==="0")if(i==="0")u=`>=${o}.${i}.${a}-${c} <${o}.${i}.${+a+1}-0`;else u=`>=${o}.${i}.${a}-${c} <${o}.${+i+1}.0-0`;else u=`>=${o}.${i}.${a}-${c} <${+o+1}.0.0-0`;else if(ye("no pr"),o==="0")if(i==="0")u=`>=${o}.${i}.${a}${n} <${o}.${i}.${+a+1}-0`;else u=`>=${o}.${i}.${a}${n} <${o}.${+i+1}.0-0`;else u=`>=${o}.${i}.${a} <${+o+1}.0.0-0`;return ye("caret return",u),u})},_U=(e,t)=>(ye("replaceXRanges",e,t),e.split(/\s+/).map((r)=>vU(r,t)).join(" ")),vU=(e,t)=>{e=e.trim();let r=t.loose?Xe[He.XRANGELOOSE]:Xe[He.XRANGE];return e.replace(r,(n,s,o,i,a,c)=>{ye("xRange",e,n,s,o,i,a,c);let u=Je(o),d=u||Je(i),l=d||Je(a),p=l;if(s==="="&&p)s="";if(c=t.includePrerelease?"-0":"",u)if(s===">"||s==="<")n="<0.0.0-0";else n="*";else if(s&&p){if(d)i=0;if(a=0,s===">")if(s=">=",d)o=+o+1,i=0,a=0;else i=+i+1,a=0;else if(s==="<=")if(s="<",d)o=+o+1;else i=+i+1;if(s==="<")c="-0";n=`${s+o}.${i}.${a}${c}`}else if(d)n=`>=${o}.0.0${c} <${+o+1}.0.0-0`;else if(l)n=`>=${o}.${i}.0${c} <${o}.${+i+1}.0-0`;return ye("xRange return",n),n})},$U=(e,t)=>(ye("replaceStars",e,t),e.trim().replace(Xe[He.STAR],"")),EU=(e,t)=>(ye("replaceGTE0",e,t),e.trim().replace(Xe[t.includePrerelease?He.GTE0PRE:He.GTE0],"")),wU=(e)=>(t,r,n,s,o,i,a,c,u,d,l,p)=>{if(Je(n))r="";else if(Je(s))r=`>=${n}.0.0${e?"-0":""}`;else if(Je(o))r=`>=${n}.${s}.0${e?"-0":""}`;else if(i)r=`>=${r}`;else r=`>=${r}${e?"-0":""}`;if(Je(u))c="";else if(Je(d))c=`<${+u+1}.0.0-0`;else if(Je(l))c=`<${u}.${+d+1}.0-0`;else if(p)c=`<=${u}.${d}.${l}-${p}`;else if(e)c=`<${u}.${d}.${+l+1}-0`;else c=`<=${c}`;return`${r} ${c}`.trim()},bU=(e,t,r)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let n=0;n<e.length;n++){if(ye(e[n].semver),e[n].semver===Ma.ANY)continue;if(e[n].semver.prerelease.length>0){let s=e[n].semver;if(s.major===t.major&&s.minor===t.minor&&s.patch===t.patch)return!0}}return!1}return!0}});var Eo=g(function(BH,QE){var wo=Symbol("SemVer ANY");class La{static get ANY(){return wo}constructor(e,t){if(t=BE(t),e instanceof La)if(e.loose===!!t.loose)return e;else e=e.value;if(e=e.trim().split(/\s+/).join(" "),gl("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===wo)this.value="";else this.value=this.operator+this.semver.version;gl("comp",this)}parse(e){let t=this.options.loose?WE[YE.COMPARATORLOOSE]:WE[YE.COMPARATOR],r=e.match(t);if(!r)throw TypeError(`Invalid comparator: ${e}`);if(this.operator=r[1]!==void 0?r[1]:"",this.operator==="=")this.operator="";if(!r[2])this.semver=wo;else this.semver=new XE(r[2],this.options.loose)}toString(){return this.value}test(e){if(gl("Comparator.test",e,this.options.loose),this.semver===wo||e===wo)return!0;if(typeof e==="string")try{e=new XE(e,this.options)}catch(t){return!1}return ml(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof La))throw TypeError("a Comparator is required");if(this.operator===""){if(this.value==="")return!0;return new JE(e.value,t).test(this.value)}else if(e.operator===""){if(e.value==="")return!0;return new JE(this.value,t).test(e.semver)}if(t=BE(t),t.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0"))return!1;if(!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))return!1;if(this.operator.startsWith(">")&&e.operator.startsWith(">"))return!0;if(this.operator.startsWith("<")&&e.operator.startsWith("<"))return!0;if(this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("="))return!0;if(ml(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))return!0;if(ml(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">"))return!0;return!1}}QE.exports=La;var BE=Ta(),{safeRe:WE,t:YE}=xs(),ml=hl(),gl=_o(),XE=Ke(),JE=wt()});var bo=g(function(WH,ZE){var SU=wt(),xU=(e,t,r)=>{try{t=new SU(t,r)}catch(n){return!1}return t.test(e)};ZE.exports=xU});var tw=g(function(YH,ew){var RU=wt(),TU=(e,t)=>new RU(e,t).set.map((r)=>r.map((n)=>n.value).join(" ").trim().split(" "));ew.exports=TU});var nw=g(function(XH,rw){var kU=Ke(),OU=wt(),AU=(e,t,r)=>{let n=null,s=null,o=null;try{o=new OU(t,r)}catch(i){return null}return e.forEach((i)=>{if(o.test(i)){if(!n||s.compare(i)===-1)n=i,s=new kU(n,r)}}),n};rw.exports=AU});var ow=g(function(JH,sw){var PU=Ke(),NU=wt(),IU=(e,t,r)=>{let n=null,s=null,o=null;try{o=new NU(t,r)}catch(i){return null}return e.forEach((i)=>{if(o.test(i)){if(!n||s.compare(i)===1)n=i,s=new PU(n,r)}}),n};sw.exports=IU});var cw=g(function(QH,aw){var yl=Ke(),CU=wt(),iw=vo(),jU=(e,t)=>{e=new CU(e,t);let r=new yl("0.0.0");if(e.test(r))return r;if(r=new yl("0.0.0-0"),e.test(r))return r;r=null;for(let n=0;n<e.set.length;++n){let s=e.set[n],o=null;if(s.forEach((i)=>{let a=new yl(i.semver.version);switch(i.operator){case">":if(a.prerelease.length===0)a.patch++;else a.prerelease.push(0);a.raw=a.format();case"":case">=":if(!o||iw(a,o))o=a;break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${i.operator}`)}}),o&&(!r||iw(r,o)))r=o}if(r&&e.test(r))return r;return null};aw.exports=jU});var lw=g(function(ZH,uw){var qU=wt(),DU=(e,t)=>{try{return new qU(e,t).range||"*"}catch(r){return null}};uw.exports=DU});var Ua=g(function(e5,hw){var MU=Ke(),pw=Eo(),{ANY:LU}=pw,UU=wt(),FU=bo(),dw=vo(),fw=Ia(),VU=ja(),zU=Ca(),GU=(e,t,r,n)=>{e=new MU(e,n),t=new UU(t,n);let s,o,i,a,c;switch(r){case">":s=dw,o=VU,i=fw,a=">",c=">=";break;case"<":s=fw,o=zU,i=dw,a="<",c="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(FU(e,t,n))return!1;for(let u=0;u<t.set.length;++u){let d=t.set[u],l=null,p=null;if(d.forEach((f)=>{if(f.semver===LU)f=new pw(">=0.0.0");if(l=l||f,p=p||f,s(f.semver,l.semver,n))l=f;else if(i(f.semver,p.semver,n))p=f}),l.operator===a||l.operator===c)return!1;if((!p.operator||p.operator===a)&&o(e,p.semver))return!1;else if(p.operator===c&&i(e,p.semver))return!1}return!0};hw.exports=GU});var gw=g(function(t5,mw){var KU=Ua(),HU=(e,t,r)=>KU(e,t,">",r);mw.exports=HU});var _w=g(function(r5,yw){var BU=Ua(),WU=(e,t,r)=>BU(e,t,"<",r);yw.exports=WU});var Ew=g(function(n5,$w){var vw=wt(),YU=(e,t,r)=>(e=new vw(e,r),t=new vw(t,r),e.intersects(t,r));$w.exports=YU});var bw=g(function(s5,ww){var XU=bo(),JU=Et();ww.exports=(e,t,r)=>{let n=[],s=null,o=null,i=e.sort((d,l)=>JU(d,l,r));for(let d of i)if(XU(d,t,r)){if(o=d,!s)s=d}else{if(o)n.push([s,o]);o=null,s=null}if(s)n.push([s,null]);let a=[];for(let[d,l]of n)if(d===l)a.push(d);else if(!l&&d===i[0])a.push("*");else if(!l)a.push(`>=${d}`);else if(d===i[0])a.push(`<=${l}`);else a.push(`${d} - ${l}`);let c=a.join(" || "),u=typeof t.raw==="string"?t.raw:String(t);return c.length<u.length?c:t}});var Ow=g(function(o5,kw){var Sw=wt(),vl=Eo(),{ANY:_l}=vl,So=bo(),$l=Et(),QU=(e,t,r={})=>{if(e===t)return!0;e=new Sw(e,r),t=new Sw(t,r);let n=!1;e:for(let s of e.set){for(let o of t.set){let i=e2(s,o,r);if(n=n||i!==null,i)continue e}if(n)return!1}return!0},ZU=[new vl(">=0.0.0-0")],xw=[new vl(">=0.0.0")],e2=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===_l)if(t.length===1&&t[0].semver===_l)return!0;else if(r.includePrerelease)e=ZU;else e=xw;if(t.length===1&&t[0].semver===_l)if(r.includePrerelease)return!0;else t=xw;let n=new Set,s,o;for(let f of e)if(f.operator===">"||f.operator===">=")s=Rw(s,f,r);else if(f.operator==="<"||f.operator==="<=")o=Tw(o,f,r);else n.add(f.semver);if(n.size>1)return null;let i;if(s&&o){if(i=$l(s.semver,o.semver,r),i>0)return null;else if(i===0&&(s.operator!==">="||o.operator!=="<="))return null}for(let f of n){if(s&&!So(f,String(s),r))return null;if(o&&!So(f,String(o),r))return null;for(let h of t)if(!So(f,String(h),r))return!1;return!0}let a,c,u,d,l=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1,p=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1;if(l&&l.prerelease.length===1&&o.operator==="<"&&l.prerelease[0]===0)l=!1;for(let f of t){if(d=d||f.operator===">"||f.operator===">=",u=u||f.operator==="<"||f.operator==="<=",s){if(p){if(f.semver.prerelease&&f.semver.prerelease.length&&f.semver.major===p.major&&f.semver.minor===p.minor&&f.semver.patch===p.patch)p=!1}if(f.operator===">"||f.operator===">="){if(a=Rw(s,f,r),a===f&&a!==s)return!1}else if(s.operator===">="&&!So(s.semver,String(f),r))return!1}if(o){if(l){if(f.semver.prerelease&&f.semver.prerelease.length&&f.semver.major===l.major&&f.semver.minor===l.minor&&f.semver.patch===l.patch)l=!1}if(f.operator==="<"||f.operator==="<="){if(c=Tw(o,f,r),c===f&&c!==o)return!1}else if(o.operator==="<="&&!So(o.semver,String(f),r))return!1}if(!f.operator&&(o||s)&&i!==0)return!1}if(s&&u&&!o&&i!==0)return!1;if(o&&d&&!s&&i!==0)return!1;if(p||l)return!1;return!0},Rw=(e,t,r)=>{if(!e)return t;let n=$l(e.semver,t.semver,r);return n>0?e:n<0?t:t.operator===">"&&e.operator===">="?t:e},Tw=(e,t,r)=>{if(!e)return t;let n=$l(e.semver,t.semver,r);return n<0?e:n>0?t:t.operator==="<"&&e.operator==="<="?t:e};kw.exports=QU});var Pw=g(function(i5,Aw){var Rs=xs(),Fa=yo(),t2=Ke(),Va=ll(),r2=Tn(),n2=rE(),s2=sE(),o2=aE(),i2=lE(),a2=fE(),c2=hE(),u2=gE(),l2=_E(),d2=Et(),f2=wE(),p2=SE(),h2=Na(),m2=kE(),g2=AE(),y2=vo(),_2=Ia(),v2=fl(),$2=pl(),E2=Ca(),w2=ja(),b2=hl(),S2=LE(),x2=Eo(),R2=wt(),T2=bo(),k2=tw(),O2=nw(),A2=ow(),P2=cw(),N2=lw(),I2=Ua(),C2=gw(),j2=_w(),q2=Ew(),D2=bw(),M2=Ow();Aw.exports={parse:r2,valid:n2,clean:s2,inc:o2,diff:i2,major:a2,minor:c2,patch:u2,prerelease:l2,compare:d2,rcompare:f2,compareLoose:p2,compareBuild:h2,sort:m2,rsort:g2,gt:y2,lt:_2,eq:v2,neq:$2,gte:E2,lte:w2,cmp:b2,coerce:S2,Comparator:x2,Range:R2,satisfies:T2,toComparators:k2,maxSatisfying:O2,minSatisfying:A2,minVersion:P2,validRange:N2,outside:I2,gtr:C2,ltr:j2,intersects:q2,simplifyRange:D2,subset:M2,SemVer:t2,re:Rs.re,src:Rs.src,tokens:Rs.t,SEMVER_SPEC_VERSION:Fa.SEMVER_SPEC_VERSION,RELEASE_TYPES:Fa.RELEASE_TYPES,compareIdentifiers:Va.compareIdentifiers,rcompareIdentifiers:Va.rcompareIdentifiers}});function Iw(e,t,r){if(!e)return!1;if(e.constructor===t)return!0;return L2.call(e)===r}function Cw(e){return Iw(e,Uint8Array,"[object Uint8Array]")}function U2(e){return Iw(e,ArrayBuffer,"[object ArrayBuffer]")}function F2(e){return Cw(e)||U2(e)}function V2(e){if(!Cw(e))throw TypeError(`Expected \`Uint8Array\`, got \`${typeof e}\``)}function z2(e){if(!F2(e))throw TypeError(`Expected \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof e}\``)}function El(e,t){if(e.length===0)return new Uint8Array(0);t??=e.reduce((s,o)=>s+o.length,0);let r=new Uint8Array(t),n=0;for(let s of e)V2(s),r.set(s,n),n+=s.length;return r}function wl(e,t="utf8"){return z2(e),Nw[t]??=new globalThis.TextDecoder(t),Nw[t].decode(e)}function G2(e){if(typeof e!=="string")throw TypeError(`Expected \`string\`, got \`${typeof e}\``)}function za(e){return G2(e),K2.encode(e)}var L2,Nw,K2,a5;var jw=F(()=>{L2=Object.prototype.toString;Nw={utf8:new globalThis.TextDecoder("utf8")};K2=new globalThis.TextEncoder;a5=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"))});import{isDeepStrictEqual as H2}from"util";import qw from"process";import kn from"fs";import Dw from"path";import xo from"crypto";import B2 from"assert";var Lw,Uw,On,W2,Mw="aes-256-cbc",Ts=()=>Object.create(null),Y2=(e)=>e!==void 0&&e!==null,X2=(e,t)=>{let r=new Set(["undefined","symbol","function"]),n=typeof t;if(r.has(n))throw TypeError(`Setting a value of type \`${n}\` for key \`${e}\` is not allowed as it's not supported by JSON`)},Ga="__internal__",bl,Ka;var Fw=F(()=>{ld();fd();Vd();z$();jw();Lw=_c(oy(),1),Uw=_c(F$(),1),On=_c(Pw(),1),W2=Uw.default.default,bl=`${Ga}.migrations.version`;Ka=class Ka{path;events;#n;#t;#e;#r={};constructor(e={}){let t={configName:"config",fileExtension:"json",projectSuffix:"nodejs",clearInvalidConfig:!1,accessPropertiesByDotNotation:!0,configFileMode:438,...e};if(!t.cwd){if(!t.projectName)throw Error("Please specify the `projectName` option.");t.cwd=Sc(t.projectName,{suffix:t.projectSuffix}).config}if(this.#e=t,t.schema??t.ajvOptions??t.rootSchema){if(t.schema&&typeof t.schema!=="object")throw TypeError("The `schema` option must be an object.");let o=new Lw.Ajv2020({allErrors:!0,useDefaults:!0,...t.ajvOptions});W2(o);let i={...t.rootSchema,type:"object",properties:t.schema};this.#n=o.compile(i);for(let[a,c]of Object.entries(t.schema??{}))if(c?.default)this.#r[a]=c.default}if(t.defaults)this.#r={...this.#r,...t.defaults};if(t.serialize)this._serialize=t.serialize;if(t.deserialize)this._deserialize=t.deserialize;this.events=new EventTarget,this.#t=t.encryptionKey;let r=t.fileExtension?`.${t.fileExtension}`:"";this.path=Dw.resolve(t.cwd,`${t.configName??"config"}${r}`);let n=this.store,s=Object.assign(Ts(),t.defaults,n);if(t.migrations){if(!t.projectVersion)throw Error("Please specify the `projectVersion` option.");this._migrate(t.migrations,t.projectVersion,t.beforeEachMigration)}this._validate(s);try{B2.deepEqual(n,s)}catch{this.store=s}if(t.watch)this._watch()}get(e,t){if(this.#e.accessPropertiesByDotNotation)return this._get(e,t);let{store:r}=this;return e in r?r[e]:t}set(e,t){if(typeof e!=="string"&&typeof e!=="object")throw TypeError(`Expected \`key\` to be of type \`string\` or \`object\`, got ${typeof e}`);if(typeof e!=="object"&&t===void 0)throw TypeError("Use `delete()` to clear values");if(this._containsReservedKey(e))throw TypeError(`Please don't use the ${Ga} key, as it's used to manage this module internal operations.`);let{store:r}=this,n=(s,o)=>{if(X2(s,o),this.#e.accessPropertiesByDotNotation)Ec(r,s,o);else r[s]=o};if(typeof e==="object"){let s=e;for(let[o,i]of Object.entries(s))n(o,i)}else n(e,t);this.store=r}has(e){if(this.#e.accessPropertiesByDotNotation)return ud(this.store,e);return e in this.store}reset(...e){for(let t of e)if(Y2(this.#r[t]))this.set(t,this.#r[t])}delete(e){let{store:t}=this;if(this.#e.accessPropertiesByDotNotation)cd(t,e);else delete t[e];this.store=t}clear(){this.store=Ts();for(let e of Object.keys(this.#r))this.reset(e)}onDidChange(e,t){if(typeof e!=="string")throw TypeError(`Expected \`key\` to be of type \`string\`, got ${typeof e}`);if(typeof t!=="function")throw TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof t}`);return this._handleChange(()=>this.get(e),t)}onDidAnyChange(e){if(typeof e!=="function")throw TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof e}`);return this._handleChange(()=>this.store,e)}get size(){return Object.keys(this.store).length}get store(){try{let e=kn.readFileSync(this.path,this.#t?null:"utf8"),t=this._encryptData(e),r=this._deserialize(t);return this._validate(r),Object.assign(Ts(),r)}catch(e){if(e?.code==="ENOENT")return this._ensureDirectory(),Ts();if(this.#e.clearInvalidConfig&&e.name==="SyntaxError")return Ts();throw e}}set store(e){this._ensureDirectory(),this._validate(e),this._write(e),this.events.dispatchEvent(new Event("change"))}*[Symbol.iterator](){for(let[e,t]of Object.entries(this.store))yield[e,t]}_encryptData(e){if(!this.#t)return typeof e==="string"?e:wl(e);try{let t=e.slice(0,16),r=xo.pbkdf2Sync(this.#t,t.toString(),1e4,32,"sha512"),n=xo.createDecipheriv(Mw,r,t),s=e.slice(17),o=typeof s==="string"?za(s):s;return wl(El([n.update(o),n.final()]))}catch{}return e.toString()}_handleChange(e,t){let r=e(),n=()=>{let s=r,o=e();if(H2(o,s))return;r=o,t.call(this,o,s)};return this.events.addEventListener("change",n),()=>{this.events.removeEventListener("change",n)}}_deserialize=(e)=>JSON.parse(e);_serialize=(e)=>JSON.stringify(e,void 0,"\t");_validate(e){if(!this.#n)return;if(this.#n(e)||!this.#n.errors)return;let r=this.#n.errors.map(({instancePath:n,message:s=""})=>`\`${n.slice(1)}\` ${s}`);throw Error("Config schema violation: "+r.join("; "))}_ensureDirectory(){kn.mkdirSync(Dw.dirname(this.path),{recursive:!0})}_write(e){let t=this._serialize(e);if(this.#t){let r=xo.randomBytes(16),n=xo.pbkdf2Sync(this.#t,r.toString(),1e4,32,"sha512"),s=xo.createCipheriv(Mw,n,r);t=El([r,za(":"),s.update(za(t)),s.final()])}if(qw.env.SNAP)kn.writeFileSync(this.path,t,{mode:this.#e.configFileMode});else try{jc(this.path,t,{mode:this.#e.configFileMode})}catch(r){if(r?.code==="EXDEV"){kn.writeFileSync(this.path,t,{mode:this.#e.configFileMode});return}throw r}}_watch(){if(this._ensureDirectory(),!kn.existsSync(this.path))this._write(Ts());if(qw.platform==="win32")kn.watch(this.path,{persistent:!1},al(()=>{this.events.dispatchEvent(new Event("change"))},{wait:100}));else kn.watchFile(this.path,{persistent:!1},al(()=>{this.events.dispatchEvent(new Event("change"))},{wait:5000}))}_migrate(e,t,r){let n=this._get(bl,"0.0.0"),s=Object.keys(e).filter((i)=>this._shouldPerformMigration(i,n,t)),o={...this.store};for(let i of s)try{if(r)r(this,{fromVersion:n,toVersion:i,finalVersion:t,versions:s});let a=e[i];a?.(this),this._set(bl,i),n=i,o={...this.store}}catch(a){throw this.store=o,Error(`Something went wrong during the migration! Changes applied to the store until this failed migration will be restored. ${a}`)}if(this._isVersionInRangeFormat(n)||!On.default.eq(n,t))this._set(bl,t)}_containsReservedKey(e){if(typeof e==="object"){if(Object.keys(e)[0]===Ga)return!0}if(typeof e!=="string")return!1;if(this.#e.accessPropertiesByDotNotation){if(e.startsWith(`${Ga}.`))return!0;return!1}return!1}_isVersionInRangeFormat(e){return On.default.clean(e)===null}_shouldPerformMigration(e,t,r){if(this._isVersionInRangeFormat(e)){if(t!=="0.0.0"&&On.default.satisfies(t,e))return!1;return On.default.satisfies(r,e)}if(On.default.lte(e,t))return!1;if(On.default.gt(e,r))return!1;return!0}_get(e,t){return ad(this.store,e,t)}_set(e,t){let{store:r}=this;Ec(r,e,t),this.store=r}}});var re,Vw,N,Er=(e)=>{switch(typeof e){case"undefined":return N.undefined;case"string":return N.string;case"number":return Number.isNaN(e)?N.nan:N.number;case"boolean":return N.boolean;case"function":return N.function;case"bigint":return N.bigint;case"symbol":return N.symbol;case"object":if(Array.isArray(e))return N.array;if(e===null)return N.null;if(e.then&&typeof e.then==="function"&&e.catch&&typeof e.catch==="function")return N.promise;if(typeof Map<"u"&&e instanceof Map)return N.map;if(typeof Set<"u"&&e instanceof Set)return N.set;if(typeof Date<"u"&&e instanceof Date)return N.date;return N.object;default:return N.unknown}};var Ro=F(()=>{(function(e){e.assertEqual=(s)=>{};function t(s){}e.assertIs=t;function r(s){throw Error()}e.assertNever=r,e.arrayToEnum=(s)=>{let o={};for(let i of s)o[i]=i;return o},e.getValidEnumValues=(s)=>{let o=e.objectKeys(s).filter((a)=>typeof s[s[a]]!=="number"),i={};for(let a of o)i[a]=s[a];return e.objectValues(i)},e.objectValues=(s)=>e.objectKeys(s).map(function(o){return s[o]}),e.objectKeys=typeof Object.keys==="function"?(s)=>Object.keys(s):(s)=>{let o=[];for(let i in s)if(Object.prototype.hasOwnProperty.call(s,i))o.push(i);return o},e.find=(s,o)=>{for(let i of s)if(o(i))return i;return},e.isInteger=typeof Number.isInteger==="function"?(s)=>Number.isInteger(s):(s)=>typeof s==="number"&&Number.isFinite(s)&&Math.floor(s)===s;function n(s,o=" | "){return s.map((i)=>typeof i==="string"?`'${i}'`:i).join(o)}e.joinValues=n,e.jsonStringifyReplacer=(s,o)=>{if(typeof o==="bigint")return o.toString();return o}})(re||(re={}));(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(Vw||(Vw={}));N=re.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"])});var b,ft;var Ha=F(()=>{Ro();b=re.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);ft=class ft extends Error{get errors(){return this.issues}constructor(e){super();this.issues=[],this.addIssue=(r)=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};let t=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,t);else this.__proto__=t;this.name="ZodError",this.issues=e}format(e){let t=e||function(s){return s.message},r={_errors:[]},n=(s)=>{for(let o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(n);else if(o.code==="invalid_return_type")n(o.returnTypeError);else if(o.code==="invalid_arguments")n(o.argumentsError);else if(o.path.length===0)r._errors.push(t(o));else{let i=r,a=0;while(a<o.path.length){let c=o.path[a];if(a!==o.path.length-1)i[c]=i[c]||{_errors:[]};else i[c]=i[c]||{_errors:[]},i[c]._errors.push(t(o));i=i[c],a++}}};return n(this),r}static assert(e){if(!(e instanceof ft))throw Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,re.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=(t)=>t.message){let t={},r=[];for(let n of this.issues)if(n.path.length>0){let s=n.path[0];t[s]=t[s]||[],t[s].push(e(n))}else r.push(e(n));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}};ft.create=(e)=>new ft(e)});var J2=(e,t)=>{let r;switch(e.code){case b.invalid_type:if(e.received===N.undefined)r="Required";else r=`Expected ${e.expected}, received ${e.received}`;break;case b.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,re.jsonStringifyReplacer)}`;break;case b.unrecognized_keys:r=`Unrecognized key(s) in object: ${re.joinValues(e.keys,", ")}`;break;case b.invalid_union:r="Invalid input";break;case b.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${re.joinValues(e.options)}`;break;case b.invalid_enum_value:r=`Invalid enum value. Expected ${re.joinValues(e.options)}, received '${e.received}'`;break;case b.invalid_arguments:r="Invalid function arguments";break;case b.invalid_return_type:r="Invalid function return type";break;case b.invalid_date:r="Invalid date";break;case b.invalid_string:if(typeof e.validation==="object")if("includes"in e.validation){if(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position==="number")r=`${r} at one or more positions greater than or equal to ${e.validation.position}`}else if("startsWith"in e.validation)r=`Invalid input: must start with "${e.validation.startsWith}"`;else if("endsWith"in e.validation)r=`Invalid input: must end with "${e.validation.endsWith}"`;else re.assertNever(e.validation);else if(e.validation!=="regex")r=`Invalid ${e.validation}`;else r="Invalid";break;case b.too_small:if(e.type==="array")r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`;else if(e.type==="string")r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`;else if(e.type==="number")r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`;else if(e.type==="bigint")r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`;else if(e.type==="date")r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`;else r="Invalid input";break;case b.too_big:if(e.type==="array")r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`;else if(e.type==="string")r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`;else if(e.type==="number")r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`;else if(e.type==="bigint")r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`;else if(e.type==="date")r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`;else r="Invalid input";break;case b.custom:r="Invalid input";break;case b.invalid_intersection_types:r="Intersection results could not be merged";break;case b.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case b.not_finite:r="Number must be finite";break;default:r=t.defaultError,re.assertNever(e)}return{message:r}},fn;var Sl=F(()=>{Ha();Ro();fn=J2});function To(){return Q2}var Q2;var Ba=F(()=>{Sl();Q2=fn});function k(e,t){let r=To(),n=Wa({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===fn?void 0:fn].filter((s)=>!!s)});e.common.issues.push(n)}class Be{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray(e,t){let r=[];for(let n of t){if(n.status==="aborted")return G;if(n.status==="dirty")e.dirty();r.push(n.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){let r=[];for(let n of t){let s=await n.key,o=await n.value;r.push({key:s,value:o})}return Be.mergeObjectSync(e,r)}static mergeObjectSync(e,t){let r={};for(let n of t){let{key:s,value:o}=n;if(s.status==="aborted")return G;if(o.status==="aborted")return G;if(s.status==="dirty")e.dirty();if(o.status==="dirty")e.dirty();if(s.value!=="__proto__"&&(typeof o.value<"u"||n.alwaysSet))r[s.value]=o.value}return{status:e.value,value:r}}}var Wa=(e)=>{let{data:t,path:r,errorMaps:n,issueData:s}=e,o=[...r,...s.path||[]],i={...s,path:o};if(s.message!==void 0)return{...s,path:o,message:s.message};let a="",c=n.filter((u)=>!!u).slice().reverse();for(let u of c)a=u(i,{data:t,defaultError:a}).message;return{...s,path:o,message:a}},G,ks=(e)=>({status:"dirty",value:e}),Qe=(e)=>({status:"valid",value:e}),xl=(e)=>e.status==="aborted",Rl=(e)=>e.status==="dirty",An=(e)=>e.status==="valid",ko=(e)=>typeof Promise<"u"&&e instanceof Promise;var Tl=F(()=>{Ba();Sl();G=Object.freeze({status:"aborted"})});var zw=()=>{};var D;var Gw=F(()=>{(function(e){e.errToObj=(t)=>typeof t==="string"?{message:t}:t||{},e.toString=(t)=>typeof t==="string"?t:t?.message})(D||(D={}))});class At{constructor(e,t,r,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=n}get path(){if(!this._cachedPath.length)if(Array.isArray(this._key))this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}function Q(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:s}=e;if(t&&(r||n))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(t)return{errorMap:t,description:s};return{errorMap:(i,a)=>{let{message:c}=e;if(i.code==="invalid_enum_value")return{message:c??a.defaultError};if(typeof a.data>"u")return{message:c??n??a.defaultError};if(i.code!=="invalid_type")return{message:a.defaultError};return{message:c??r??a.defaultError}},description:s}}class ee{get description(){return this._def.description}_getType(e){return Er(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Er(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Be,ctx:{common:e.parent.common,data:e.data,parsedType:Er(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(ko(t))throw Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){let r={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Er(e)},n=this._parseSync({data:e,path:r.path,parent:r});return Kw(r,n)}"~validate"(e){let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Er(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:t});return An(r)?{value:r.value}:{issues:t.common.issues}}catch(r){if(r?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then((r)=>An(r)?{value:r.value}:{issues:t.common.issues})}async parseAsync(e,t){let r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){let r={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Er(e)},n=this._parse({data:e,path:r.path,parent:r}),s=await(ko(n)?n:Promise.resolve(n));return Kw(r,s)}refine(e,t){let r=(n)=>{if(typeof t==="string"||typeof t>"u")return{message:t};else if(typeof t==="function")return t(n);else return t};return this._refinement((n,s)=>{let o=e(n),i=()=>s.addIssue({code:b.custom,...r(n)});if(typeof Promise<"u"&&o instanceof Promise)return o.then((a)=>{if(!a)return i(),!1;else return!0});if(!o)return i(),!1;else return!0})}refinement(e,t){return this._refinement((r,n)=>{if(!e(r))return n.addIssue(typeof t==="function"?t(r,n):t),!1;else return!0})}_refinement(e){return new lr({schema:this,typeName:K.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:(t)=>this["~validate"](t)}}optional(){return ur.create(this,this._def)}nullable(){return pn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return cr.create(this)}promise(){return Is.create(this,this._def)}or(e){return Io.create([this,e],this._def)}and(e){return Co.create(this,e,this._def)}transform(e){return new lr({...Q(this._def),schema:this,typeName:K.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e==="function"?e:()=>e;return new Mo({...Q(this._def),innerType:this,defaultValue:t,typeName:K.ZodDefault})}brand(){return new Pl({typeName:K.ZodBranded,type:this,...Q(this._def)})}catch(e){let t=typeof e==="function"?e:()=>e;return new Lo({...Q(this._def),innerType:this,catchValue:t,typeName:K.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return rc.create(this,e)}readonly(){return Uo.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}function Bw(e){let t="[0-5]\\d";if(e.precision)t=`${t}\\.\\d{${e.precision}}`;else if(e.precision==null)t=`${t}(\\.\\d+)?`;let r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function mF(e){return new RegExp(`^${Bw(e)}$`)}function gF(e){let t=`${Hw}T${Bw(e)}`,r=[];if(r.push(e.local?"Z?":"Z"),e.offset)r.push("([+-]\\d{2}:?\\d{2})");return t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function yF(e,t){if((t==="v4"||!t)&&cF.test(e))return!0;if((t==="v6"||!t)&&lF.test(e))return!0;return!1}function _F(e,t){if(!sF.test(e))return!1;try{let[r]=e.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),s=JSON.parse(atob(n));if(typeof s!=="object"||s===null)return!1;if("typ"in s&&s?.typ!=="JWT")return!1;if(!s.alg)return!1;if(t&&s.alg!==t)return!1;return!0}catch{return!1}}function vF(e,t){if((t==="v4"||!t)&&uF.test(e))return!0;if((t==="v6"||!t)&&dF.test(e))return!0;return!1}function $F(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,s=r>n?r:n,o=Number.parseInt(e.toFixed(s).replace(".","")),i=Number.parseInt(t.toFixed(s).replace(".",""));return o%i/10**s}function Os(e){if(e instanceof Ce){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=ur.create(Os(n))}return new Ce({...e._def,shape:()=>t})}else if(e instanceof cr)return new cr({...e._def,type:Os(e.element)});else if(e instanceof ur)return ur.create(Os(e.unwrap()));else if(e instanceof pn)return pn.create(Os(e.unwrap()));else if(e instanceof xr)return xr.create(e.items.map((t)=>Os(t)));else return e}function Ol(e,t){let r=Er(e),n=Er(t);if(e===t)return{valid:!0,data:e};else if(r===N.object&&n===N.object){let s=re.objectKeys(t),o=re.objectKeys(e).filter((a)=>s.indexOf(a)!==-1),i={...e,...t};for(let a of o){let c=Ol(e[a],t[a]);if(!c.valid)return{valid:!1};i[a]=c.data}return{valid:!0,data:i}}else if(r===N.array&&n===N.array){if(e.length!==t.length)return{valid:!1};let s=[];for(let o=0;o<e.length;o++){let i=e[o],a=t[o],c=Ol(i,a);if(!c.valid)return{valid:!1};s.push(c.data)}return{valid:!0,data:s}}else if(r===N.date&&n===N.date&&+e===+t)return{valid:!0,data:e};else return{valid:!1}}function Ww(e,t){return new Nn({values:e,typeName:K.ZodEnum,...Q(t)})}var Kw=(e,t)=>{if(An(t))return{success:!0,data:t.value};else{if(!e.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new ft(e.common.issues);return this._error=r,this._error}}}},Z2,eF,tF,rF,nF,sF,oF,iF,aF="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",kl,cF,uF,lF,dF,fF,pF,Hw="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",hF,br,As,Ps,Ya,Ao,Xa,Po,No,Ja,Pn,Sr,Qa,cr,Ce,Io,wr=(e)=>{if(e instanceof jo)return wr(e.schema);else if(e instanceof lr)return wr(e.innerType());else if(e instanceof qo)return[e.value];else if(e instanceof Nn)return e.options;else if(e instanceof Do)return re.objectValues(e.enum);else if(e instanceof Mo)return wr(e._def.innerType);else if(e instanceof Po)return[void 0];else if(e instanceof No)return[null];else if(e instanceof ur)return[void 0,...wr(e.unwrap())];else if(e instanceof pn)return[null,...wr(e.unwrap())];else if(e instanceof Pl)return wr(e.unwrap());else if(e instanceof Uo)return wr(e.unwrap());else if(e instanceof Lo)return wr(e._def.innerType);else return[]},Al,Co,xr,Za,ec,Ns,Oo,jo,qo,Nn,Do,Is,lr,ur,pn,Mo,Lo,tc,M5,Pl,rc,Uo,L5,K,v,fe,U5,F5,Ue,V5,z5,G5,K5,H5,B5,W5,Y5,Ze,ne,X5,EF,Yw,J5,Q5,wF,Z5,e3,t3,r3,In,Ve,n3,s3,o3,i3,a3,c3,u3;var Xw=F(()=>{Ha();Ba();Gw();Tl();Ro();Z2=/^c[^\s-]{8,}$/i,eF=/^[0-9a-z]+$/,tF=/^[0-9A-HJKMNP-TV-Z]{26}$/i,rF=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,nF=/^[a-z0-9_-]{21}$/i,sF=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,oF=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,iF=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,cF=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,uF=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,lF=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,dF=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,fF=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,pF=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,hF=new RegExp(`^${Hw}$`);br=class br extends ee{_parse(e){if(this._def.coerce)e.data=String(e.data);if(this._getType(e)!==N.string){let s=this._getOrReturnCtx(e);return k(s,{code:b.invalid_type,expected:N.string,received:s.parsedType}),G}let r=new Be,n=void 0;for(let s of this._def.checks)if(s.kind==="min"){if(e.data.length<s.value)n=this._getOrReturnCtx(e,n),k(n,{code:b.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty()}else if(s.kind==="max"){if(e.data.length>s.value)n=this._getOrReturnCtx(e,n),k(n,{code:b.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty()}else if(s.kind==="length"){let o=e.data.length>s.value,i=e.data.length<s.value;if(o||i){if(n=this._getOrReturnCtx(e,n),o)k(n,{code:b.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message});else if(i)k(n,{code:b.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message});r.dirty()}}else if(s.kind==="email"){if(!iF.test(e.data))n=this._getOrReturnCtx(e,n),k(n,{validation:"email",code:b.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="emoji"){if(!kl)kl=new RegExp(aF,"u");if(!kl.test(e.data))n=this._getOrReturnCtx(e,n),k(n,{validation:"emoji",code:b.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="uuid"){if(!rF.test(e.data))n=this._getOrReturnCtx(e,n),k(n,{validation:"uuid",code:b.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="nanoid"){if(!nF.test(e.data))n=this._getOrReturnCtx(e,n),k(n,{validation:"nanoid",code:b.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="cuid"){if(!Z2.test(e.data))n=this._getOrReturnCtx(e,n),k(n,{validation:"cuid",code:b.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="cuid2"){if(!eF.test(e.data))n=this._getOrReturnCtx(e,n),k(n,{validation:"cuid2",code:b.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="ulid"){if(!tF.test(e.data))n=this._getOrReturnCtx(e,n),k(n,{validation:"ulid",code:b.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),k(n,{validation:"url",code:b.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="regex"){if(s.regex.lastIndex=0,!s.regex.test(e.data))n=this._getOrReturnCtx(e,n),k(n,{validation:"regex",code:b.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="trim")e.data=e.data.trim();else if(s.kind==="includes"){if(!e.data.includes(s.value,s.position))n=this._getOrReturnCtx(e,n),k(n,{code:b.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),r.dirty()}else if(s.kind==="toLowerCase")e.data=e.data.toLowerCase();else if(s.kind==="toUpperCase")e.data=e.data.toUpperCase();else if(s.kind==="startsWith"){if(!e.data.startsWith(s.value))n=this._getOrReturnCtx(e,n),k(n,{code:b.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()}else if(s.kind==="endsWith"){if(!e.data.endsWith(s.value))n=this._getOrReturnCtx(e,n),k(n,{code:b.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()}else if(s.kind==="datetime"){if(!gF(s).test(e.data))n=this._getOrReturnCtx(e,n),k(n,{code:b.invalid_string,validation:"datetime",message:s.message}),r.dirty()}else if(s.kind==="date"){if(!hF.test(e.data))n=this._getOrReturnCtx(e,n),k(n,{code:b.invalid_string,validation:"date",message:s.message}),r.dirty()}else if(s.kind==="time"){if(!mF(s).test(e.data))n=this._getOrReturnCtx(e,n),k(n,{code:b.invalid_string,validation:"time",message:s.message}),r.dirty()}else if(s.kind==="duration"){if(!oF.test(e.data))n=this._getOrReturnCtx(e,n),k(n,{validation:"duration",code:b.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="ip"){if(!yF(e.data,s.version))n=this._getOrReturnCtx(e,n),k(n,{validation:"ip",code:b.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="jwt"){if(!_F(e.data,s.alg))n=this._getOrReturnCtx(e,n),k(n,{validation:"jwt",code:b.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="cidr"){if(!vF(e.data,s.version))n=this._getOrReturnCtx(e,n),k(n,{validation:"cidr",code:b.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="base64"){if(!fF.test(e.data))n=this._getOrReturnCtx(e,n),k(n,{validation:"base64",code:b.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="base64url"){if(!pF.test(e.data))n=this._getOrReturnCtx(e,n),k(n,{validation:"base64url",code:b.invalid_string,message:s.message}),r.dirty()}else re.assertNever(s);return{status:r.value,value:e.data}}_regex(e,t,r){return this.refinement((n)=>e.test(n),{validation:t,code:b.invalid_string,...D.errToObj(r)})}_addCheck(e){return new br({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...D.errToObj(e)})}url(e){return this._addCheck({kind:"url",...D.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...D.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...D.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...D.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...D.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...D.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...D.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...D.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...D.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...D.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...D.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...D.errToObj(e)})}datetime(e){if(typeof e==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e});return this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...D.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){if(typeof e==="string")return this._addCheck({kind:"time",precision:null,message:e});return this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...D.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...D.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...D.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...D.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...D.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...D.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...D.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...D.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...D.errToObj(t)})}nonempty(e){return this.min(1,D.errToObj(e))}trim(){return new br({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new br({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new br({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e)=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find((e)=>e.kind==="date")}get isTime(){return!!this._def.checks.find((e)=>e.kind==="time")}get isDuration(){return!!this._def.checks.find((e)=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find((e)=>e.kind==="email")}get isURL(){return!!this._def.checks.find((e)=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find((e)=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find((e)=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find((e)=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find((e)=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find((e)=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find((e)=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find((e)=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find((e)=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find((e)=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find((e)=>e.kind==="base64url")}get minLength(){let e=null;for(let t of this._def.checks)if(t.kind==="min"){if(e===null||t.value>e)e=t.value}return e}get maxLength(){let e=null;for(let t of this._def.checks)if(t.kind==="max"){if(e===null||t.value<e)e=t.value}return e}};br.create=(e)=>new br({checks:[],typeName:K.ZodString,coerce:e?.coerce??!1,...Q(e)});As=class As extends ee{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce)e.data=Number(e.data);if(this._getType(e)!==N.number){let s=this._getOrReturnCtx(e);return k(s,{code:b.invalid_type,expected:N.number,received:s.parsedType}),G}let r=void 0,n=new Be;for(let s of this._def.checks)if(s.kind==="int"){if(!re.isInteger(e.data))r=this._getOrReturnCtx(e,r),k(r,{code:b.invalid_type,expected:"integer",received:"float",message:s.message}),n.dirty()}else if(s.kind==="min"){if(s.inclusive?e.data<s.value:e.data<=s.value)r=this._getOrReturnCtx(e,r),k(r,{code:b.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),n.dirty()}else if(s.kind==="max"){if(s.inclusive?e.data>s.value:e.data>=s.value)r=this._getOrReturnCtx(e,r),k(r,{code:b.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),n.dirty()}else if(s.kind==="multipleOf"){if($F(e.data,s.value)!==0)r=this._getOrReturnCtx(e,r),k(r,{code:b.not_multiple_of,multipleOf:s.value,message:s.message}),n.dirty()}else if(s.kind==="finite"){if(!Number.isFinite(e.data))r=this._getOrReturnCtx(e,r),k(r,{code:b.not_finite,message:s.message}),n.dirty()}else re.assertNever(s);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,D.toString(t))}gt(e,t){return this.setLimit("min",e,!1,D.toString(t))}lte(e,t){return this.setLimit("max",e,!0,D.toString(t))}lt(e,t){return this.setLimit("max",e,!1,D.toString(t))}setLimit(e,t,r,n){return new As({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:D.toString(n)}]})}_addCheck(e){return new As({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:D.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:D.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:D.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:D.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:D.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:D.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:D.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:D.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:D.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)if(t.kind==="min"){if(e===null||t.value>e)e=t.value}return e}get maxValue(){let e=null;for(let t of this._def.checks)if(t.kind==="max"){if(e===null||t.value<e)e=t.value}return e}get isInt(){return!!this._def.checks.find((e)=>e.kind==="int"||e.kind==="multipleOf"&&re.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let r of this._def.checks)if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;else if(r.kind==="min"){if(t===null||r.value>t)t=r.value}else if(r.kind==="max"){if(e===null||r.value<e)e=r.value}return Number.isFinite(t)&&Number.isFinite(e)}};As.create=(e)=>new As({checks:[],typeName:K.ZodNumber,coerce:e?.coerce||!1,...Q(e)});Ps=class Ps extends ee{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==N.bigint)return this._getInvalidInput(e);let r=void 0,n=new Be;for(let s of this._def.checks)if(s.kind==="min"){if(s.inclusive?e.data<s.value:e.data<=s.value)r=this._getOrReturnCtx(e,r),k(r,{code:b.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),n.dirty()}else if(s.kind==="max"){if(s.inclusive?e.data>s.value:e.data>=s.value)r=this._getOrReturnCtx(e,r),k(r,{code:b.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),n.dirty()}else if(s.kind==="multipleOf"){if(e.data%s.value!==BigInt(0))r=this._getOrReturnCtx(e,r),k(r,{code:b.not_multiple_of,multipleOf:s.value,message:s.message}),n.dirty()}else re.assertNever(s);return{status:n.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return k(t,{code:b.invalid_type,expected:N.bigint,received:t.parsedType}),G}gte(e,t){return this.setLimit("min",e,!0,D.toString(t))}gt(e,t){return this.setLimit("min",e,!1,D.toString(t))}lte(e,t){return this.setLimit("max",e,!0,D.toString(t))}lt(e,t){return this.setLimit("max",e,!1,D.toString(t))}setLimit(e,t,r,n){return new Ps({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:D.toString(n)}]})}_addCheck(e){return new Ps({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:D.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:D.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:D.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:D.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:D.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)if(t.kind==="min"){if(e===null||t.value>e)e=t.value}return e}get maxValue(){let e=null;for(let t of this._def.checks)if(t.kind==="max"){if(e===null||t.value<e)e=t.value}return e}};Ps.create=(e)=>new Ps({checks:[],typeName:K.ZodBigInt,coerce:e?.coerce??!1,...Q(e)});Ya=class Ya extends ee{_parse(e){if(this._def.coerce)e.data=Boolean(e.data);if(this._getType(e)!==N.boolean){let r=this._getOrReturnCtx(e);return k(r,{code:b.invalid_type,expected:N.boolean,received:r.parsedType}),G}return Qe(e.data)}};Ya.create=(e)=>new Ya({typeName:K.ZodBoolean,coerce:e?.coerce||!1,...Q(e)});Ao=class Ao extends ee{_parse(e){if(this._def.coerce)e.data=new Date(e.data);if(this._getType(e)!==N.date){let s=this._getOrReturnCtx(e);return k(s,{code:b.invalid_type,expected:N.date,received:s.parsedType}),G}if(Number.isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return k(s,{code:b.invalid_date}),G}let r=new Be,n=void 0;for(let s of this._def.checks)if(s.kind==="min"){if(e.data.getTime()<s.value)n=this._getOrReturnCtx(e,n),k(n,{code:b.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()}else if(s.kind==="max"){if(e.data.getTime()>s.value)n=this._getOrReturnCtx(e,n),k(n,{code:b.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()}else re.assertNever(s);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Ao({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:D.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:D.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)if(t.kind==="min"){if(e===null||t.value>e)e=t.value}return e!=null?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)if(t.kind==="max"){if(e===null||t.value<e)e=t.value}return e!=null?new Date(e):null}};Ao.create=(e)=>new Ao({checks:[],coerce:e?.coerce||!1,typeName:K.ZodDate,...Q(e)});Xa=class Xa extends ee{_parse(e){if(this._getType(e)!==N.symbol){let r=this._getOrReturnCtx(e);return k(r,{code:b.invalid_type,expected:N.symbol,received:r.parsedType}),G}return Qe(e.data)}};Xa.create=(e)=>new Xa({typeName:K.ZodSymbol,...Q(e)});Po=class Po extends ee{_parse(e){if(this._getType(e)!==N.undefined){let r=this._getOrReturnCtx(e);return k(r,{code:b.invalid_type,expected:N.undefined,received:r.parsedType}),G}return Qe(e.data)}};Po.create=(e)=>new Po({typeName:K.ZodUndefined,...Q(e)});No=class No extends ee{_parse(e){if(this._getType(e)!==N.null){let r=this._getOrReturnCtx(e);return k(r,{code:b.invalid_type,expected:N.null,received:r.parsedType}),G}return Qe(e.data)}};No.create=(e)=>new No({typeName:K.ZodNull,...Q(e)});Ja=class Ja extends ee{constructor(){super(...arguments);this._any=!0}_parse(e){return Qe(e.data)}};Ja.create=(e)=>new Ja({typeName:K.ZodAny,...Q(e)});Pn=class Pn extends ee{constructor(){super(...arguments);this._unknown=!0}_parse(e){return Qe(e.data)}};Pn.create=(e)=>new Pn({typeName:K.ZodUnknown,...Q(e)});Sr=class Sr extends ee{_parse(e){let t=this._getOrReturnCtx(e);return k(t,{code:b.invalid_type,expected:N.never,received:t.parsedType}),G}};Sr.create=(e)=>new Sr({typeName:K.ZodNever,...Q(e)});Qa=class Qa extends ee{_parse(e){if(this._getType(e)!==N.undefined){let r=this._getOrReturnCtx(e);return k(r,{code:b.invalid_type,expected:N.void,received:r.parsedType}),G}return Qe(e.data)}};Qa.create=(e)=>new Qa({typeName:K.ZodVoid,...Q(e)});cr=class cr extends ee{_parse(e){let{ctx:t,status:r}=this._processInputParams(e),n=this._def;if(t.parsedType!==N.array)return k(t,{code:b.invalid_type,expected:N.array,received:t.parsedType}),G;if(n.exactLength!==null){let o=t.data.length>n.exactLength.value,i=t.data.length<n.exactLength.value;if(o||i)k(t,{code:o?b.too_big:b.too_small,minimum:i?n.exactLength.value:void 0,maximum:o?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),r.dirty()}if(n.minLength!==null){if(t.data.length<n.minLength.value)k(t,{code:b.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),r.dirty()}if(n.maxLength!==null){if(t.data.length>n.maxLength.value)k(t,{code:b.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),r.dirty()}if(t.common.async)return Promise.all([...t.data].map((o,i)=>n.type._parseAsync(new At(t,o,t.path,i)))).then((o)=>Be.mergeArray(r,o));let s=[...t.data].map((o,i)=>n.type._parseSync(new At(t,o,t.path,i)));return Be.mergeArray(r,s)}get element(){return this._def.type}min(e,t){return new cr({...this._def,minLength:{value:e,message:D.toString(t)}})}max(e,t){return new cr({...this._def,maxLength:{value:e,message:D.toString(t)}})}length(e,t){return new cr({...this._def,exactLength:{value:e,message:D.toString(t)}})}nonempty(e){return this.min(1,e)}};cr.create=(e,t)=>new cr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:K.ZodArray,...Q(t)});Ce=class Ce extends ee{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=re.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==N.object){let c=this._getOrReturnCtx(e);return k(c,{code:b.invalid_type,expected:N.object,received:c.parsedType}),G}let{status:r,ctx:n}=this._processInputParams(e),{shape:s,keys:o}=this._getCached(),i=[];if(!(this._def.catchall instanceof Sr&&this._def.unknownKeys==="strip")){for(let c in n.data)if(!o.includes(c))i.push(c)}let a=[];for(let c of o){let u=s[c],d=n.data[c];a.push({key:{status:"valid",value:c},value:u._parse(new At(n,d,n.path,c)),alwaysSet:c in n.data})}if(this._def.catchall instanceof Sr){let c=this._def.unknownKeys;if(c==="passthrough")for(let u of i)a.push({key:{status:"valid",value:u},value:{status:"valid",value:n.data[u]}});else if(c==="strict"){if(i.length>0)k(n,{code:b.unrecognized_keys,keys:i}),r.dirty()}else if(c==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let u of i){let d=n.data[u];a.push({key:{status:"valid",value:u},value:c._parse(new At(n,d,n.path,u)),alwaysSet:u in n.data})}}if(n.common.async)return Promise.resolve().then(async()=>{let c=[];for(let u of a){let d=await u.key,l=await u.value;c.push({key:d,value:l,alwaysSet:u.alwaysSet})}return c}).then((c)=>Be.mergeObjectSync(r,c));else return Be.mergeObjectSync(r,a)}get shape(){return this._def.shape()}strict(e){return D.errToObj,new Ce({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,r)=>{let n=this._def.errorMap?.(t,r).message??r.defaultError;if(t.code==="unrecognized_keys")return{message:D.errToObj(e).message??n};return{message:n}}}:{}})}strip(){return new Ce({...this._def,unknownKeys:"strip"})}passthrough(){return new Ce({...this._def,unknownKeys:"passthrough"})}extend(e){return new Ce({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Ce({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:K.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Ce({...this._def,catchall:e})}pick(e){let t={};for(let r of re.objectKeys(e))if(e[r]&&this.shape[r])t[r]=this.shape[r];return new Ce({...this._def,shape:()=>t})}omit(e){let t={};for(let r of re.objectKeys(this.shape))if(!e[r])t[r]=this.shape[r];return new Ce({...this._def,shape:()=>t})}deepPartial(){return Os(this)}partial(e){let t={};for(let r of re.objectKeys(this.shape)){let n=this.shape[r];if(e&&!e[r])t[r]=n;else t[r]=n.optional()}return new Ce({...this._def,shape:()=>t})}required(e){let t={};for(let r of re.objectKeys(this.shape))if(e&&!e[r])t[r]=this.shape[r];else{let s=this.shape[r];while(s instanceof ur)s=s._def.innerType;t[r]=s}return new Ce({...this._def,shape:()=>t})}keyof(){return Ww(re.objectKeys(this.shape))}};Ce.create=(e,t)=>new Ce({shape:()=>e,unknownKeys:"strip",catchall:Sr.create(),typeName:K.ZodObject,...Q(t)});Ce.strictCreate=(e,t)=>new Ce({shape:()=>e,unknownKeys:"strict",catchall:Sr.create(),typeName:K.ZodObject,...Q(t)});Ce.lazycreate=(e,t)=>new Ce({shape:e,unknownKeys:"strip",catchall:Sr.create(),typeName:K.ZodObject,...Q(t)});Io=class Io extends ee{_parse(e){let{ctx:t}=this._processInputParams(e),r=this._def.options;function n(s){for(let i of s)if(i.result.status==="valid")return i.result;for(let i of s)if(i.result.status==="dirty")return t.common.issues.push(...i.ctx.common.issues),i.result;let o=s.map((i)=>new ft(i.ctx.common.issues));return k(t,{code:b.invalid_union,unionErrors:o}),G}if(t.common.async)return Promise.all(r.map(async(s)=>{let o={...t,common:{...t.common,issues:[]},parent:null};return{result:await s._parseAsync({data:t.data,path:t.path,parent:o}),ctx:o}})).then(n);else{let s=void 0,o=[];for(let a of r){let c={...t,common:{...t.common,issues:[]},parent:null},u=a._parseSync({data:t.data,path:t.path,parent:c});if(u.status==="valid")return u;else if(u.status==="dirty"&&!s)s={result:u,ctx:c};if(c.common.issues.length)o.push(c.common.issues)}if(s)return t.common.issues.push(...s.ctx.common.issues),s.result;let i=o.map((a)=>new ft(a));return k(t,{code:b.invalid_union,unionErrors:i}),G}}get options(){return this._def.options}};Io.create=(e,t)=>new Io({options:e,typeName:K.ZodUnion,...Q(t)});Al=class Al extends ee{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==N.object)return k(t,{code:b.invalid_type,expected:N.object,received:t.parsedType}),G;let r=this.discriminator,n=t.data[r],s=this.optionsMap.get(n);if(!s)return k(t,{code:b.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),G;if(t.common.async)return s._parseAsync({data:t.data,path:t.path,parent:t});else return s._parseSync({data:t.data,path:t.path,parent:t})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){let n=new Map;for(let s of t){let o=wr(s.shape[e]);if(!o.length)throw Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let i of o){if(n.has(i))throw Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);n.set(i,s)}}return new Al({typeName:K.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...Q(r)})}};Co=class Co extends ee{_parse(e){let{status:t,ctx:r}=this._processInputParams(e),n=(s,o)=>{if(xl(s)||xl(o))return G;let i=Ol(s.value,o.value);if(!i.valid)return k(r,{code:b.invalid_intersection_types}),G;if(Rl(s)||Rl(o))t.dirty();return{status:t.value,value:i.data}};if(r.common.async)return Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,o])=>n(s,o));else return n(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};Co.create=(e,t,r)=>new Co({left:e,right:t,typeName:K.ZodIntersection,...Q(r)});xr=class xr extends ee{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==N.array)return k(r,{code:b.invalid_type,expected:N.array,received:r.parsedType}),G;if(r.data.length<this._def.items.length)return k(r,{code:b.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),G;if(!this._def.rest&&r.data.length>this._def.items.length)k(r,{code:b.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty();let s=[...r.data].map((o,i)=>{let a=this._def.items[i]||this._def.rest;if(!a)return null;return a._parse(new At(r,o,r.path,i))}).filter((o)=>!!o);if(r.common.async)return Promise.all(s).then((o)=>Be.mergeArray(t,o));else return Be.mergeArray(t,s)}get items(){return this._def.items}rest(e){return new xr({...this._def,rest:e})}};xr.create=(e,t)=>{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new xr({items:e,typeName:K.ZodTuple,rest:null,...Q(t)})};Za=class Za extends ee{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==N.object)return k(r,{code:b.invalid_type,expected:N.object,received:r.parsedType}),G;let n=[],s=this._def.keyType,o=this._def.valueType;for(let i in r.data)n.push({key:s._parse(new At(r,i,r.path,i)),value:o._parse(new At(r,r.data[i],r.path,i)),alwaysSet:i in r.data});if(r.common.async)return Be.mergeObjectAsync(t,n);else return Be.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,r){if(t instanceof ee)return new Za({keyType:e,valueType:t,typeName:K.ZodRecord,...Q(r)});return new Za({keyType:br.create(),valueType:e,typeName:K.ZodRecord,...Q(t)})}};ec=class ec extends ee{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==N.map)return k(r,{code:b.invalid_type,expected:N.map,received:r.parsedType}),G;let n=this._def.keyType,s=this._def.valueType,o=[...r.data.entries()].map(([i,a],c)=>({key:n._parse(new At(r,i,r.path,[c,"key"])),value:s._parse(new At(r,a,r.path,[c,"value"]))}));if(r.common.async){let i=new Map;return Promise.resolve().then(async()=>{for(let a of o){let c=await a.key,u=await a.value;if(c.status==="aborted"||u.status==="aborted")return G;if(c.status==="dirty"||u.status==="dirty")t.dirty();i.set(c.value,u.value)}return{status:t.value,value:i}})}else{let i=new Map;for(let a of o){let{key:c,value:u}=a;if(c.status==="aborted"||u.status==="aborted")return G;if(c.status==="dirty"||u.status==="dirty")t.dirty();i.set(c.value,u.value)}return{status:t.value,value:i}}}};ec.create=(e,t,r)=>new ec({valueType:t,keyType:e,typeName:K.ZodMap,...Q(r)});Ns=class Ns extends ee{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==N.set)return k(r,{code:b.invalid_type,expected:N.set,received:r.parsedType}),G;let n=this._def;if(n.minSize!==null){if(r.data.size<n.minSize.value)k(r,{code:b.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()}if(n.maxSize!==null){if(r.data.size>n.maxSize.value)k(r,{code:b.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty()}let s=this._def.valueType;function o(a){let c=new Set;for(let u of a){if(u.status==="aborted")return G;if(u.status==="dirty")t.dirty();c.add(u.value)}return{status:t.value,value:c}}let i=[...r.data.values()].map((a,c)=>s._parse(new At(r,a,r.path,c)));if(r.common.async)return Promise.all(i).then((a)=>o(a));else return o(i)}min(e,t){return new Ns({...this._def,minSize:{value:e,message:D.toString(t)}})}max(e,t){return new Ns({...this._def,maxSize:{value:e,message:D.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};Ns.create=(e,t)=>new Ns({valueType:e,minSize:null,maxSize:null,typeName:K.ZodSet,...Q(t)});Oo=class Oo extends ee{constructor(){super(...arguments);this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==N.function)return k(t,{code:b.invalid_type,expected:N.function,received:t.parsedType}),G;function r(i,a){return Wa({data:i,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,To(),fn].filter((c)=>!!c),issueData:{code:b.invalid_arguments,argumentsError:a}})}function n(i,a){return Wa({data:i,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,To(),fn].filter((c)=>!!c),issueData:{code:b.invalid_return_type,returnTypeError:a}})}let s={errorMap:t.common.contextualErrorMap},o=t.data;if(this._def.returns instanceof Is){let i=this;return Qe(async function(...a){let c=new ft([]),u=await i._def.args.parseAsync(a,s).catch((p)=>{throw c.addIssue(r(a,p)),c}),d=await Reflect.apply(o,this,u);return await i._def.returns._def.type.parseAsync(d,s).catch((p)=>{throw c.addIssue(n(d,p)),c})})}else{let i=this;return Qe(function(...a){let c=i._def.args.safeParse(a,s);if(!c.success)throw new ft([r(a,c.error)]);let u=Reflect.apply(o,this,c.data),d=i._def.returns.safeParse(u,s);if(!d.success)throw new ft([n(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Oo({...this._def,args:xr.create(e).rest(Pn.create())})}returns(e){return new Oo({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new Oo({args:e?e:xr.create([]).rest(Pn.create()),returns:t||Pn.create(),typeName:K.ZodFunction,...Q(r)})}};jo=class jo extends ee{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};jo.create=(e,t)=>new jo({getter:e,typeName:K.ZodLazy,...Q(t)});qo=class qo extends ee{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return k(t,{received:t.data,code:b.invalid_literal,expected:this._def.value}),G}return{status:"valid",value:e.data}}get value(){return this._def.value}};qo.create=(e,t)=>new qo({value:e,typeName:K.ZodLiteral,...Q(t)});Nn=class Nn extends ee{_parse(e){if(typeof e.data!=="string"){let t=this._getOrReturnCtx(e),r=this._def.values;return k(t,{expected:re.joinValues(r),received:t.parsedType,code:b.invalid_type}),G}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),r=this._def.values;return k(t,{received:t.data,code:b.invalid_enum_value,options:r}),G}return Qe(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return Nn.create(e,{...this._def,...t})}exclude(e,t=this._def){return Nn.create(this.options.filter((r)=>!e.includes(r)),{...this._def,...t})}};Nn.create=Ww;Do=class Do extends ee{_parse(e){let t=re.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==N.string&&r.parsedType!==N.number){let n=re.objectValues(t);return k(r,{expected:re.joinValues(n),received:r.parsedType,code:b.invalid_type}),G}if(!this._cache)this._cache=new Set(re.getValidEnumValues(this._def.values));if(!this._cache.has(e.data)){let n=re.objectValues(t);return k(r,{received:r.data,code:b.invalid_enum_value,options:n}),G}return Qe(e.data)}get enum(){return this._def.values}};Do.create=(e,t)=>new Do({values:e,typeName:K.ZodNativeEnum,...Q(t)});Is=class Is extends ee{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==N.promise&&t.common.async===!1)return k(t,{code:b.invalid_type,expected:N.promise,received:t.parsedType}),G;let r=t.parsedType===N.promise?t.data:Promise.resolve(t.data);return Qe(r.then((n)=>this._def.type.parseAsync(n,{path:t.path,errorMap:t.common.contextualErrorMap})))}};Is.create=(e,t)=>new Is({type:e,typeName:K.ZodPromise,...Q(t)});lr=class lr extends ee{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===K.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:r}=this._processInputParams(e),n=this._def.effect||null,s={addIssue:(o)=>{if(k(r,o),o.fatal)t.abort();else t.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),n.type==="preprocess"){let o=n.transform(r.data,s);if(r.common.async)return Promise.resolve(o).then(async(i)=>{if(t.value==="aborted")return G;let a=await this._def.schema._parseAsync({data:i,path:r.path,parent:r});if(a.status==="aborted")return G;if(a.status==="dirty")return ks(a.value);if(t.value==="dirty")return ks(a.value);return a});else{if(t.value==="aborted")return G;let i=this._def.schema._parseSync({data:o,path:r.path,parent:r});if(i.status==="aborted")return G;if(i.status==="dirty")return ks(i.value);if(t.value==="dirty")return ks(i.value);return i}}if(n.type==="refinement"){let o=(i)=>{let a=n.refinement(i,s);if(r.common.async)return Promise.resolve(a);if(a instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return i};if(r.common.async===!1){let i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(i.status==="aborted")return G;if(i.status==="dirty")t.dirty();return o(i.value),{status:t.value,value:i.value}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((i)=>{if(i.status==="aborted")return G;if(i.status==="dirty")t.dirty();return o(i.value).then(()=>({status:t.value,value:i.value}))})}if(n.type==="transform")if(r.common.async===!1){let o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!An(o))return G;let i=n.transform(o.value,s);if(i instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:i}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((o)=>{if(!An(o))return G;return Promise.resolve(n.transform(o.value,s)).then((i)=>({status:t.value,value:i}))});re.assertNever(n)}};lr.create=(e,t,r)=>new lr({schema:e,typeName:K.ZodEffects,effect:t,...Q(r)});lr.createWithPreprocess=(e,t,r)=>new lr({schema:t,effect:{type:"preprocess",transform:e},typeName:K.ZodEffects,...Q(r)});ur=class ur extends ee{_parse(e){if(this._getType(e)===N.undefined)return Qe(void 0);return this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};ur.create=(e,t)=>new ur({innerType:e,typeName:K.ZodOptional,...Q(t)});pn=class pn extends ee{_parse(e){if(this._getType(e)===N.null)return Qe(null);return this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};pn.create=(e,t)=>new pn({innerType:e,typeName:K.ZodNullable,...Q(t)});Mo=class Mo extends ee{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;if(t.parsedType===N.undefined)r=this._def.defaultValue();return this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};Mo.create=(e,t)=>new Mo({innerType:e,typeName:K.ZodDefault,defaultValue:typeof t.default==="function"?t.default:()=>t.default,...Q(t)});Lo=class Lo extends ee{_parse(e){let{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});if(ko(n))return n.then((s)=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new ft(r.common.issues)},input:r.data})}));else return{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new ft(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};Lo.create=(e,t)=>new Lo({innerType:e,typeName:K.ZodCatch,catchValue:typeof t.catch==="function"?t.catch:()=>t.catch,...Q(t)});tc=class tc extends ee{_parse(e){if(this._getType(e)!==N.nan){let r=this._getOrReturnCtx(e);return k(r,{code:b.invalid_type,expected:N.nan,received:r.parsedType}),G}return{status:"valid",value:e.data}}};tc.create=(e)=>new tc({typeName:K.ZodNaN,...Q(e)});M5=Symbol("zod_brand");Pl=class Pl extends ee{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}};rc=class rc extends ee{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{let s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});if(s.status==="aborted")return G;if(s.status==="dirty")return t.dirty(),ks(s.value);else return this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();else{let n=this._def.in._parseSync({data:r.data,path:r.path,parent:r});if(n.status==="aborted")return G;if(n.status==="dirty")return t.dirty(),{status:"dirty",value:n.value};else return this._def.out._parseSync({data:n.value,path:r.path,parent:r})}}static create(e,t){return new rc({in:e,out:t,typeName:K.ZodPipeline})}};Uo=class Uo extends ee{_parse(e){let t=this._def.innerType._parse(e),r=(n)=>{if(An(n))n.value=Object.freeze(n.value);return n};return ko(t)?t.then((n)=>r(n)):r(t)}unwrap(){return this._def.innerType}};Uo.create=(e,t)=>new Uo({innerType:e,typeName:K.ZodReadonly,...Q(t)});L5={object:Ce.lazycreate};(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(K||(K={}));v=br.create,fe=As.create,U5=tc.create,F5=Ps.create,Ue=Ya.create,V5=Ao.create,z5=Xa.create,G5=Po.create,K5=No.create,H5=Ja.create,B5=Pn.create,W5=Sr.create,Y5=Qa.create,Ze=cr.create,ne=Ce.create,X5=Ce.strictCreate,EF=Io.create,Yw=Al.create,J5=Co.create,Q5=xr.create,wF=Za.create,Z5=ec.create,e3=Ns.create,t3=Oo.create,r3=jo.create,In=qo.create,Ve=Nn.create,n3=Do.create,s3=Is.create,o3=lr.create,i3=ur.create,a3=pn.create,c3=lr.createWithPreprocess,u3=rc.create});var Nl=F(()=>{Ba();Tl();zw();Ro();Xw();Ha()});var jn=F(()=>{Nl();Nl()});function $3(e){return SF.includes(e)}var bF,qn,SF,E3,xF,Jw,RF,Qw,TF,kF,w3,OF,b3,S3,x3,R3,AF,Zw,PF,eb,T3=20,k3=500,NF,O3;var nc=F(()=>{jn();bF=Ve(["pending","verified","approved","revoked"]),qn=Ve(["person","service","test"]),SF=qn.options;E3={nemarOwner:"service",nemarAdmin:"service","test-admin":"service","test-owner":"service","cool-vibers":"test","test-user":"test","test-pending":"test","test-verified":"test","test-revoked":"test"},xF=Ve(["same_kind","orcid_linked","own_account","kind_changed_concurrently"]),Jw=xF.options,RF=Ve(["active","pending","revoked"]),Qw=ne({field:v(),blocks:Ze(v()).optional(),set_on:Ze(v()).optional()}).passthrough(),TF=ne({id:fe().int(),username:v().nullable(),email:v(),github_username:v().nullable(),role:v(),orcid:v().nullable().optional(),created_at:v().optional(),approved_at:v().nullable().optional(),dataset_count:fe().int().optional(),sandbox_completed:Ue().optional(),sandbox_completed_at:v().nullable().optional(),sandbox_dataset_id:v().nullable().optional(),service_access:Ue().optional(),status:bF.optional(),email_verified:Ue().optional(),orcid_verified:Ue().optional(),given_name:v().nullable().optional(),family_name:v().nullable().optional(),profile_gaps:Ze(Qw).optional(),username_auto_assigned:Ue().optional(),account_kind:qn.optional()}).passthrough(),kF=ne({prefix:v(),created_at:v(),last_used_at:v().nullable()}).passthrough().nullable(),w3=ne({user:TF,token:kF.optional()}).passthrough(),OF=ne({id:fe().int(),username:v().nullable(),email:v(),github_username:v().nullable(),status:v(),email_verified:fe().int().nullable().optional(),role:v().nullable(),created_at:v(),approved_at:v().nullable().optional(),revoked_at:v().nullable().optional(),signup_source:v().nullable().optional(),service_access:fe().int().nullable().optional(),service_access_granted_at:v().nullable().optional(),given_name:v().nullable().optional(),family_name:v().nullable().optional(),orcid:v().nullable().optional(),upload_access_requested_at:v().nullable().optional(),account_kind:qn.optional(),matched_in:Ze(v()).optional(),match_kind:v().optional()}).passthrough(),b3=ne({users:Ze(OF),count:fe().int()}).passthrough(),S3=Ve(["assigned","would_assign","single_name","no_name","lookup_failed","conflict","exhausted","write_failed"]),x3=Ve(["sent","already_verified","skipped_fence","rate_limited","failed","not_attempted"]),R3=ne({suggestion:v().nullable(),based_on:Ve(["name","unavailable","exhausted"])}).passthrough(),AF=Ve(["why_required","email_not_verified","profile_incomplete","github_username_unverified","github_unavailable","already_approved"]),Zw=AF.options,PF=Ve(["invalid_github_username","city_required","country_required","empty_patch","username_too_short","username_too_long","username_charset","given_name_required","family_name_required","username_taken","username_locked","name_is_orcid_canonical","account_revoked","github_unavailable","same_email","code_expired","code_incorrect","orcid_already_have","orcid_unavailable"]),eb=PF.options,NF=ne({id:fe().int(),email:v(),username:v().nullable(),role:v(),status:RF,email_verified:Ue(),given_name:v().nullable(),family_name:v().nullable(),orcid:v().nullable(),orcid_verified:Ue(),github_username:v().nullable(),city:v().nullable(),country:v().nullable(),affiliation:v().nullable(),service_access:Ue(),service_access_granted_at:v().nullable(),upload_access_requested_at:v().nullable(),profile_gaps:Ze(Qw),username_auto_assigned:Ue()}).passthrough(),O3=ne({user:NF.nullable()}).passthrough()});function dr(e){if(e instanceof Error)return e.message;return String(e)}function P3(e){if(!(e instanceof fr)||e.statusCode!==404)return!1;let t=e.rawBody;return typeof t==="object"&&t!==null&&t.error==="Not Found"&&typeof t.message==="string"}var fr,Il;var Cl=F(()=>{fr=class fr extends Error{statusCode;details;step;blockReason;missing;code;reason;rawBody;constructor(e,t,r,n,s,o){super(t);this.statusCode=e;this.details=r;this.step=n;this.blockReason=s;this.missing=o;this.name="ApiError"}};Il=class Il extends fr{mode;eta;constructor(e,t,r,n){super(503,t,n);this.mode=e;this.eta=r;this.name="MaintenanceError"}}});function jF(){let e=new Map;for(let[t,r]of Object.entries(we)){for(let[n,s]of Object.entries(r))we[n]={open:`\x1B[${s[0]}m`,close:`\x1B[${s[1]}m`},r[n]=we[n],e.set(s[0],s[1]);Object.defineProperty(we,t,{value:r,enumerable:!1})}return Object.defineProperty(we,"codes",{value:e,enumerable:!1}),we.color.close="\x1B[39m",we.bgColor.close="\x1B[49m",we.color.ansi=tb(),we.color.ansi256=rb(),we.color.ansi16m=nb(),we.bgColor.ansi=tb(10),we.bgColor.ansi256=rb(10),we.bgColor.ansi16m=nb(10),Object.defineProperties(we,{rgbToAnsi256:{value(t,r,n){if(t===r&&r===n){if(t<8)return 16;if(t>248)return 231;return Math.round((t-8)/247*24)+232}return 16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(t){let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!r)return[0,0,0];let[n]=r;if(n.length===3)n=[...n].map((o)=>o+o).join("");let s=Number.parseInt(n,16);return[s>>16&255,s>>8&255,s&255]},enumerable:!1},hexToAnsi256:{value:(t)=>we.rgbToAnsi256(...we.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value(t){if(t<8)return 30+t;if(t<16)return 90+(t-8);let r,n,s;if(t>=232)r=((t-232)*10+8)/255,n=r,s=r;else{t-=16;let a=t%36;r=Math.floor(t/36)/5,n=Math.floor(a/6)/5,s=a%6/5}let o=Math.max(r,n,s)*2;if(o===0)return 30;let i=30+(Math.round(s)<<2|Math.round(n)<<1|Math.round(r));if(o===2)i+=60;return i},enumerable:!1},rgbToAnsi:{value:(t,r,n)=>we.ansi256ToAnsi(we.rgbToAnsi256(t,r,n)),enumerable:!1},hexToAnsi:{value:(t)=>we.ansi256ToAnsi(we.hexToAnsi256(t)),enumerable:!1}}),we}var tb=(e=0)=>(t)=>`\x1B[${t+e}m`,rb=(e=0)=>(t)=>`\x1B[${38+e};5;${t}m`,nb=(e=0)=>(t,r,n)=>`\x1B[${38+e};2;${t};${r};${n}m`,we,I3,IF,CF,C3,qF,Pt;var sb=F(()=>{we={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},I3=Object.keys(we.modifier),IF=Object.keys(we.color),CF=Object.keys(we.bgColor),C3=[...IF,...CF];qF=jF(),Pt=qF});import jl from"process";import DF from"os";import ob from"tty";function bt(e,t=globalThis.Deno?globalThis.Deno.args:jl.argv){let r=e.startsWith("-")?"":e.length===1?"-":"--",n=t.indexOf(r+e),s=t.indexOf("--");return n!==-1&&(s===-1||n<s)}function MF(){if("FORCE_COLOR"in be){if(be.FORCE_COLOR==="true")return 1;if(be.FORCE_COLOR==="false")return 0;return be.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(be.FORCE_COLOR,10),3)}}function LF(e){if(e===0)return!1;return{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function UF(e,{streamIsTTY:t,sniffFlags:r=!0}={}){let n=MF();if(n!==void 0)sc=n;let s=r?sc:n;if(s===0)return 0;if(r){if(bt("color=16m")||bt("color=full")||bt("color=truecolor"))return 3;if(bt("color=256"))return 2}if("TF_BUILD"in be&&"AGENT_NAME"in be)return 1;if(e&&!t&&s===void 0)return 0;let o=s||0;if(be.TERM==="dumb")return o;if(jl.platform==="win32"){let i=DF.release().split(".");if(Number(i[0])>=10&&Number(i[2])>=10586)return Number(i[2])>=14931?3:2;return 1}if("CI"in be){if(["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some((i)=>(i in be)))return 3;if(["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some((i)=>(i in be))||be.CI_NAME==="codeship")return 1;return o}if("TEAMCITY_VERSION"in be)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(be.TEAMCITY_VERSION)?1:0;if(be.COLORTERM==="truecolor")return 3;if(be.TERM==="xterm-kitty")return 3;if(be.TERM==="xterm-ghostty")return 3;if(be.TERM==="wezterm")return 3;if("TERM_PROGRAM"in be){let i=Number.parseInt((be.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(be.TERM_PROGRAM){case"iTerm.app":return i>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(be.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(be.TERM))return 1;if("COLORTERM"in be)return 1;return o}function ib(e,t={}){let r=UF(e,{streamIsTTY:e&&e.isTTY,...t});return LF(r)}var be,sc,FF,ab;var cb=F(()=>{({env:be}=jl);if(bt("no-color")||bt("no-colors")||bt("color=false")||bt("color=never"))sc=0;else if(bt("color")||bt("colors")||bt("color=true")||bt("color=always"))sc=1;FF={stdout:ib({isTTY:ob.isatty(1)}),stderr:ib({isTTY:ob.isatty(2)})},ab=FF});function ub(e,t,r){let n=e.indexOf(t);if(n===-1)return e;let s=t.length,o=0,i="";do i+=e.slice(o,n)+t+r,o=n+s,n=e.indexOf(t,o);while(n!==-1);return i+=e.slice(o),i}function lb(e,t,r,n){let s=0,o="";do{let i=e[n-1]==="\r";o+=e.slice(s,i?n-1:n)+t+(i?`\r
17
+ deps: ${r}}`};var hD={keyword:"dependencies",type:"object",schemaType:"object",error:q0.error,code(e){let[t,r]=mD(e);C0(e,t),j0(e,r)}};function mD({schema:e}){let t={},r={};for(let n in e){if(n==="__proto__")continue;let s=Array.isArray(e[n])?t:r;s[n]=e[n]}return[t,r]}function C0(e,t=e.schema){let{gen:r,data:n,it:s}=e;if(Object.keys(t).length===0)return;let o=r.let("missing");for(let i in t){let a=t[i];if(a.length===0)continue;let c=ir.propertyInData(r,n,i,s.opts.ownProperties);if(e.setParams({property:i,depsCount:a.length,deps:a.join(", ")}),s.allErrors)r.if(c,()=>{for(let u of a)ir.checkReportMissingProp(e,u)});else r.if($s._`${c} && (${ir.checkMissingProp(e,a,o)})`),ir.reportMissingProp(e,o),r.else()}}q0.validatePropertyDeps=C0;function j0(e,t=e.schema){let{gen:r,data:n,keyword:s,it:o}=e,i=r.name("valid");for(let a in t){if(I0.alwaysValidSchema(o,t[a]))continue;r.if(ir.propertyInData(r,n,a,o.opts.ownProperties),()=>{let c=e.subschema({keyword:s,schemaProp:a},i);e.mergeValidEvaluated(c,i)},()=>r.var(i,!0)),e.ok(i)}}q0.validateSchemaDeps=j0;q0.default=hD});var V0=g(function(F0){Object.defineProperty(F0,"__esModule",{value:!0});var ya=Z(),U0=ae(),_D={message:"property name must be valid",params:({params:e})=>ya._`{propertyName: ${e.propertyName}}`},vD={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:_D,code(e){let{gen:t,schema:r,data:n,it:s}=e;if(U0.alwaysValidSchema(s,r))return;let o=t.name("valid");t.forIn("key",n,(i)=>{e.setParams({propertyName:i}),e.subschema({keyword:"propertyNames",data:i,dataTypes:["string"],propertyName:i,compositeRule:!0},o),t.if(ya.not(o),()=>{if(e.error(!0),!s.allErrors)t.break()})}),e.ok(o)}};F0.default=vD});var rl=g(function(z0){Object.defineProperty(z0,"__esModule",{value:!0});var on=_t(),Ne=Z(),ED=vr(),an=ae(),bD={message:"must NOT have additional properties",params:({params:e})=>Ne._`{additionalProperty: ${e.additionalProperty}}`},wD={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:bD,code(e){let{gen:t,schema:r,parentSchema:n,data:s,errsCount:o,it:i}=e;if(!o)throw Error("ajv implementation error");let{allErrors:a,opts:c}=i;if(i.props=!0,c.removeAdditional!=="all"&&an.alwaysValidSchema(i,r))return;let u=on.allSchemaProperties(n.properties),d=on.allSchemaProperties(n.patternProperties);l(),e.ok(Ne._`${o} === ${ED.default.errors}`);function l(){t.forIn("key",s,(y)=>{if(!u.length&&!d.length)h(y);else t.if(p(y),()=>h(y))})}function p(y){let _;if(u.length>8){let O=an.schemaRefOrVal(i,n.properties,"properties");_=on.isOwnProperty(t,O,y)}else if(u.length)_=Ne.or(...u.map((O)=>Ne._`${y} === ${O}`));else _=Ne.nil;if(d.length)_=Ne.or(_,...d.map((O)=>Ne._`${on.usePattern(e,O)}.test(${y})`));return Ne.not(_)}function f(y){t.code(Ne._`delete ${s}[${y}]`)}function h(y){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){f(y);return}if(r===!1){if(e.setParams({additionalProperty:y}),e.error(),!a)t.break();return}if(typeof r=="object"&&!an.alwaysValidSchema(i,r)){let _=t.name("valid");if(c.removeAdditional==="failing")m(y,_,!1),t.if(Ne.not(_),()=>{e.reset(),f(y)});else if(m(y,_),!a)t.if(Ne.not(_),()=>t.break())}}function m(y,_,O){let T={keyword:"additionalProperties",dataProp:y,dataPropType:an.Type.Str};if(O===!1)Object.assign(T,{compositeRule:!0,createErrors:!1,allErrors:!1});e.subschema(T,_)}}};z0.default=wD});var B0=g(function(H0){Object.defineProperty(H0,"__esModule",{value:!0});var K0=fo(),_a=_t(),Es=ae(),G0=rl(),xD={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,parentSchema:n,data:s,it:o}=e;if(o.opts.removeAdditional==="all"&&n.additionalProperties===void 0)G0.default.code(new K0.KeywordCxt(o,G0.default,"additionalProperties"));let i=_a.allSchemaProperties(r);for(let l of i)o.definedProperties.add(l);if(o.opts.unevaluated&&i.length&&o.props!==!0)o.props=Es.mergeEvaluated.props(t,Es.toHash(i),o.props);let a=i.filter((l)=>!Es.alwaysValidSchema(o,r[l]));if(a.length===0)return;let c=t.name("valid");for(let l of a){if(u(l))d(l);else{if(t.if(_a.propertyInData(t,s,l,o.opts.ownProperties)),d(l),!o.allErrors)t.else().var(c,!0);t.endIf()}e.it.definedProperties.add(l),e.ok(c)}function u(l){return o.opts.useDefaults&&!o.compositeRule&&r[l].default!==void 0}function d(l){e.subschema({keyword:"properties",schemaProp:l,dataProp:l},c)}}};H0.default=xD});var Y0=g(function(W0){Object.defineProperty(W0,"__esModule",{value:!0});var va=_t(),cn=Z(),$a=ae(),Ea=ae(),TD={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:n,parentSchema:s,it:o}=e,{opts:i}=o,a=va.allSchemaProperties(r),c=a.filter((m)=>$a.alwaysValidSchema(o,r[m]));if(a.length===0||c.length===a.length&&(!o.opts.unevaluated||o.props===!0))return;let u=i.strictSchema&&!i.allowMatchingProperties&&s.properties,d=t.name("valid");if(o.props!==!0&&!(o.props instanceof cn.Name))o.props=Ea.evaluatedPropsToName(t,o.props);let{props:l}=o;p();function p(){for(let m of a){if(u)f(m);if(o.allErrors)h(m);else t.var(d,!0),h(m),t.if(d)}}function f(m){for(let y in u)if(new RegExp(m).test(y))$a.checkStrictMode(o,`property ${y} matches pattern ${m} (use allowMatchingProperties)`)}function h(m){t.forIn("key",n,(y)=>{t.if(cn._`${va.usePattern(e,m)}.test(${y})`,()=>{let _=c.includes(m);if(!_)e.subschema({keyword:"patternProperties",schemaProp:m,dataProp:y,dataPropType:Ea.Type.Str},d);if(o.opts.unevaluated&&l!==!0)t.assign(cn._`${l}[${y}]`,!0);else if(!_&&!o.allErrors)t.if(cn.not(d),()=>t.break())})})}}};W0.default=TD});var Q0=g(function(J0){Object.defineProperty(J0,"__esModule",{value:!0});var X0=ae(),OD={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:n}=e;if(X0.alwaysValidSchema(n,r)){e.fail();return}let s=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},s),e.failResult(s,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};J0.default=OD});var t$=g(function(e$){Object.defineProperty(e$,"__esModule",{value:!0});var Z0=_t(),PD={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Z0.validateUnion,error:{message:"must match a schema in anyOf"}};e$.default=PD});var s$=g(function(n$){Object.defineProperty(n$,"__esModule",{value:!0});var un=Z(),r$=ae(),ID={message:"must match exactly one schema in oneOf",params:({params:e})=>un._`{passingSchemas: ${e.passing}}`},CD={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:ID,code(e){let{gen:t,schema:r,parentSchema:n,it:s}=e;if(!Array.isArray(r))throw Error("ajv implementation error");if(s.opts.discriminator&&n.discriminator)return;let o=r,i=t.let("valid",!1),a=t.let("passing",null),c=t.name("_valid");e.setParams({passing:a}),t.block(u),e.result(i,()=>e.reset(),()=>e.error(!0));function u(){o.forEach((d,l)=>{let p;if(r$.alwaysValidSchema(s,d))t.var(c,!0);else p=e.subschema({keyword:"oneOf",schemaProp:l,compositeRule:!0},c);if(l>0)t.if(un._`${c} && ${i}`).assign(i,!1).assign(a,un._`[${a}, ${l}]`).else();t.if(c,()=>{if(t.assign(i,!0),t.assign(a,l),p)e.mergeEvaluated(p,un.Name)})})}}};n$.default=CD});var a$=g(function(i$){Object.defineProperty(i$,"__esModule",{value:!0});var o$=ae(),qD={keyword:"allOf",schemaType:"array",code(e){let{gen:t,schema:r,it:n}=e;if(!Array.isArray(r))throw Error("ajv implementation error");let s=t.name("valid");r.forEach((o,i)=>{if(o$.alwaysValidSchema(n,o))return;let a=e.subschema({keyword:"allOf",schemaProp:i},s);e.ok(s),e.mergeEvaluated(a)})}};i$.default=qD});var l$=g(function(u$){Object.defineProperty(u$,"__esModule",{value:!0});var ln=Z(),ba=ae(),MD={message:({params:e})=>ln.str`must match "${e.ifClause}" schema`,params:({params:e})=>ln._`{failingKeyword: ${e.ifClause}}`},LD={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:MD,code(e){let{gen:t,parentSchema:r,it:n}=e;if(r.then===void 0&&r.else===void 0)ba.checkStrictMode(n,'"if" without "then" and "else" is ignored');let s=c$(n,"then"),o=c$(n,"else");if(!s&&!o)return;let i=t.let("valid",!0),a=t.name("_valid");if(c(),e.reset(),s&&o){let d=t.let("ifClause");e.setParams({ifClause:d}),t.if(a,u("then",d),u("else",d))}else if(s)t.if(a,u("then"));else t.if(ln.not(a),u("else"));e.pass(i,()=>e.error(!0));function c(){let d=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);e.mergeEvaluated(d)}function u(d,l){return()=>{let p=e.subschema({keyword:d},a);if(t.assign(i,a),e.mergeValidEvaluated(p,i),l)t.assign(l,ln._`${d}`);else e.setParams({ifClause:d})}}}};function c$(e,t){let r=e.schema[t];return r!==void 0&&!ba.alwaysValidSchema(e,r)}u$.default=LD});var p$=g(function(f$){Object.defineProperty(f$,"__esModule",{value:!0});var d$=ae(),FD={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){if(t.if===void 0)d$.checkStrictMode(r,`"${e}" without "if" is ignored`)}};f$.default=FD});var m$=g(function(h$){Object.defineProperty(h$,"__esModule",{value:!0});var zD=el(),GD=x0(),KD=tl(),HD=A0(),BD=N0(),WD=L0(),YD=V0(),XD=rl(),JD=B0(),QD=Y0(),ZD=Q0(),eM=t$(),tM=s$(),rM=a$(),nM=l$(),sM=p$();function oM(e=!1){let t=[ZD.default,eM.default,tM.default,rM.default,nM.default,sM.default,YD.default,XD.default,WD.default,JD.default,QD.default];if(e)t.push(GD.default,HD.default);else t.push(zD.default,KD.default);return t.push(BD.default),t}h$.default=oM});var y$=g(function(g$){Object.defineProperty(g$,"__esModule",{value:!0});var J=Z(),aM={message:({schemaCode:e})=>J.str`must match format "${e}"`,params:({schemaCode:e})=>J._`{format: ${e}}`},cM={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:aM,code(e,t){let{gen:r,data:n,$data:s,schema:o,schemaCode:i,it:a}=e,{opts:c,errSchemaPath:u,schemaEnv:d,self:l}=a;if(!c.validateFormats)return;if(s)p();else f();function p(){let h=r.scopeValue("formats",{ref:l.formats,code:c.code.formats}),m=r.const("fDef",J._`${h}[${i}]`),y=r.let("fType"),_=r.let("format");r.if(J._`typeof ${m} == "object" && !(${m} instanceof RegExp)`,()=>r.assign(y,J._`${m}.type || "string"`).assign(_,J._`${m}.validate`),()=>r.assign(y,J._`"string"`).assign(_,m)),e.fail$data(J.or(O(),T()));function O(){if(c.strictSchema===!1)return J.nil;return J._`${i} && !${_}`}function T(){let M=d.$async?J._`(${m}.async ? await ${_}(${n}) : ${_}(${n}))`:J._`${_}(${n})`,S=J._`(typeof ${_} == "function" ? ${M} : ${_}.test(${n}))`;return J._`${_} && ${_} !== true && ${y} === ${t} && !${S}`}}function f(){let h=l.formats[o];if(!h){O();return}if(h===!0)return;let[m,y,_]=T(h);if(m===t)e.pass(M());function O(){if(c.strictSchema===!1){l.logger.warn(S());return}throw Error(S());function S(){return`unknown format "${o}" ignored in schema at path "${u}"`}}function T(S){let _e=S instanceof RegExp?J.regexpCode(S):c.code.formats?J._`${c.code.formats}${J.getProperty(o)}`:void 0,ve=r.scopeValue("formats",{key:o,ref:S,code:_e});if(typeof S=="object"&&!(S instanceof RegExp))return[S.type||"string",S.validate,J._`${ve}.validate`];return["string",S,ve]}function M(){if(typeof h=="object"&&!(h instanceof RegExp)&&h.async){if(!d.$async)throw Error("async format in sync schema");return J._`await ${_}(${n})`}return typeof y=="function"?J._`${_}(${n})`:J._`${_}.test(${n})`}}}};g$.default=cM});var v$=g(function(_$){Object.defineProperty(_$,"__esModule",{value:!0});var lM=y$(),dM=[lM.default];_$.default=dM});var b$=g(function($$){Object.defineProperty($$,"__esModule",{value:!0});$$.contentVocabulary=$$.metadataVocabulary=void 0;$$.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];$$.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var S$=g(function(w$){Object.defineProperty(w$,"__esModule",{value:!0});var hM=qv(),mM=m0(),gM=m$(),yM=v$(),wa=b$(),_M=[hM.default,mM.default,(0,gM.default)(),yM.default,wa.metadataVocabulary,wa.contentVocabulary];w$.default=_M});var k$=g(function(R$){Object.defineProperty(R$,"__esModule",{value:!0});R$.DiscrError=void 0;var x$;(function(e){e.Tag="tag",e.Mapping="mapping"})(x$||(R$.DiscrError=x$={}))});var P$=g(function(A$){Object.defineProperty(A$,"__esModule",{value:!0});var vt=Z(),bs=k$(),Sa=ca(),$M=po(),O$=ae(),EM={message:({params:{discrError:e,tagName:t}})=>e===bs.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>vt._`{error: ${e}, tag: ${r}, tagValue: ${t}}`},bM={keyword:"discriminator",type:"object",schemaType:"object",error:EM,code(e){let{gen:t,data:r,schema:n,parentSchema:s,it:o}=e,{oneOf:i}=s;if(!o.opts.discriminator)throw Error("discriminator: requires discriminator option");let a=n.propertyName;if(typeof a!="string")throw Error("discriminator: requires propertyName");if(n.mapping)throw Error("discriminator: mapping is not supported");if(!i)throw Error("discriminator: requires oneOf keyword");let c=t.let("valid",!1),u=t.const("tag",vt._`${r}${vt.getProperty(a)}`);t.if(vt._`typeof ${u} == "string"`,()=>d(),()=>e.error(!1,{discrError:bs.DiscrError.Tag,tag:u,tagName:a})),e.ok(c);function d(){let f=p();t.if(!1);for(let h in f)t.elseIf(vt._`${u} === ${h}`),t.assign(c,l(f[h]));t.else(),e.error(!1,{discrError:bs.DiscrError.Mapping,tag:u,tagName:a}),t.endIf()}function l(f){let h=t.name("valid"),m=e.subschema({keyword:"oneOf",schemaProp:f},h);return e.mergeEvaluated(m,vt.Name),h}function p(){var f;let h={},m=_(s),y=!0;for(let M=0;M<i.length;M++){let S=i[M];if((S===null||S===void 0?void 0:S.$ref)&&!O$.schemaHasRulesButRef(S,o.self.RULES)){let ve=S.$ref;if(S=Sa.resolveRef.call(o.self,o.schemaEnv.root,o.baseId,ve),S instanceof Sa.SchemaEnv)S=S.schema;if(S===void 0)throw new $M.default(o.opts.uriResolver,o.baseId,ve)}let _e=(f=S===null||S===void 0?void 0:S.properties)===null||f===void 0?void 0:f[a];if(typeof _e!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);y=y&&(m||_(S)),O(_e,M)}if(!y)throw Error(`discriminator: "${a}" must be required`);return h;function _({required:M}){return Array.isArray(M)&&M.includes(a)}function O(M,S){if(M.const)T(M.const,S);else if(M.enum)for(let _e of M.enum)T(_e,S);else throw Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function T(M,S){if(typeof M!="string"||M in h)throw Error(`discriminator: "${a}" values must be unique strings`);h[M]=S}}}};A$.default=bM});var N$=g(function(sH,SM){SM.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var C$=g(function(lt,nl){Object.defineProperty(lt,"__esModule",{value:!0});lt.MissingRefError=lt.ValidationError=lt.CodeGen=lt.Name=lt.nil=lt.stringify=lt.str=lt._=lt.KeywordCxt=lt.Ajv=void 0;var xM=kv(),RM=S$(),TM=P$(),I$=N$(),kM=["/properties"],xa="http://json-schema.org/draft-07/schema";class mo extends xM.default{_addVocabularies(){if(super._addVocabularies(),RM.default.forEach((e)=>this.addVocabulary(e)),this.opts.discriminator)this.addKeyword(TM.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(I$,kM):I$;this.addMetaSchema(e,xa,!1),this.refs["http://json-schema.org/schema"]=xa}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(xa)?xa:void 0)}}lt.Ajv=mo;nl.exports=lt=mo;nl.exports.Ajv=mo;Object.defineProperty(lt,"__esModule",{value:!0});lt.default=mo;var OM=fo();Object.defineProperty(lt,"KeywordCxt",{enumerable:!0,get:function(){return OM.KeywordCxt}});var ws=Z();Object.defineProperty(lt,"_",{enumerable:!0,get:function(){return ws._}});Object.defineProperty(lt,"str",{enumerable:!0,get:function(){return ws.str}});Object.defineProperty(lt,"stringify",{enumerable:!0,get:function(){return ws.stringify}});Object.defineProperty(lt,"nil",{enumerable:!0,get:function(){return ws.nil}});Object.defineProperty(lt,"Name",{enumerable:!0,get:function(){return ws.Name}});Object.defineProperty(lt,"CodeGen",{enumerable:!0,get:function(){return ws.CodeGen}});var AM=oa();Object.defineProperty(lt,"ValidationError",{enumerable:!0,get:function(){return AM.default}});var PM=po();Object.defineProperty(lt,"MissingRefError",{enumerable:!0,get:function(){return PM.default}})});var D$=g(function(q$){Object.defineProperty(q$,"__esModule",{value:!0});q$.formatLimitDefinition=void 0;var j$=C$(),Ie=Z(),dn=Ie.operators,Ra={formatMaximum:{okStr:"<=",ok:dn.LTE,fail:dn.GT},formatMinimum:{okStr:">=",ok:dn.GTE,fail:dn.LT},formatExclusiveMaximum:{okStr:"<",ok:dn.LT,fail:dn.GTE},formatExclusiveMinimum:{okStr:">",ok:dn.GT,fail:dn.LTE}},CM={message:({keyword:e,schemaCode:t})=>Ie.str`should be ${Ra[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>Ie._`{comparison: ${Ra[e].okStr}, limit: ${t}}`};q$.formatLimitDefinition={keyword:Object.keys(Ra),type:"string",schemaType:"string",$data:!0,error:CM,code(e){let{gen:t,data:r,schemaCode:n,keyword:s,it:o}=e,{opts:i,self:a}=o;if(!i.validateFormats)return;let c=new j$.KeywordCxt(o,a.RULES.all.format.definition,"format");if(c.$data)u();else d();function u(){let p=t.scopeValue("formats",{ref:a.formats,code:i.code.formats}),f=t.const("fmt",Ie._`${p}[${c.schemaCode}]`);e.fail$data(Ie.or(Ie._`typeof ${f} != "object"`,Ie._`${f} instanceof RegExp`,Ie._`typeof ${f}.compare != "function"`,l(f)))}function d(){let p=c.schema,f=a.formats[p];if(!f||f===!0)return;if(typeof f!="object"||f instanceof RegExp||typeof f.compare!="function")throw Error(`"${s}": format "${p}" does not define "compare" function`);let h=t.scopeValue("formats",{key:p,ref:f,code:i.code.formats?Ie._`${i.code.formats}${Ie.getProperty(p)}`:void 0});e.fail$data(l(h))}function l(p){return Ie._`${p}.compare(${r}, ${n}) ${Ra[s].fail} 0`}},dependencies:["format"]};var jM=(e)=>(e.addKeyword(q$.formatLimitDefinition),e);q$.default=jM});var F$=g(function(go,U$){Object.defineProperty(go,"__esModule",{value:!0});var $t=my(),DM=D$(),Ss=Z(),M$=new Ss.Name("fullFormats"),MM=new Ss.Name("fastFormats"),ol=(e,t={keywords:!0})=>{if(Array.isArray(t))return L$(e,t,$t.fullFormats,M$),e;let[r,n]=t.mode==="fast"?[$t.fastFormats,MM]:[$t.fullFormats,M$],s=t.formats||$t.formatNames;if(L$(e,s,r,n),t.keywords)(0,DM.default)(e);return e};ol.get=(e,t="full")=>{let n=(t==="fast"?$t.fastFormats:$t.fullFormats)[e];if(!n)throw Error(`Unknown format "${e}"`);return n};function L$(e,t,r,n){var s,o;(s=(o=e.opts.code).formats)!==null&&s!==void 0||(o.formats=Ss._`require("ajv-formats/dist/formats").${n}`);for(let i of t)e.addFormat(i,r[i])}U$.exports=go=ol;Object.defineProperty(go,"__esModule",{value:!0});go.default=ol});function il(e,t,{ignoreNonConfigurable:r=!1}={}){let{name:n}=e;for(let s of Reflect.ownKeys(t))LM(e,t,s,r);return FM(e,t),KM(e,t,n),e}var LM=(e,t,r,n)=>{if(r==="length"||r==="prototype")return;if(r==="arguments"||r==="caller")return;let s=Object.getOwnPropertyDescriptor(e,r),o=Object.getOwnPropertyDescriptor(t,r);if(!UM(s,o)&&n)return;Object.defineProperty(e,r,o)},UM=function(e,t){return e===void 0||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},FM=(e,t)=>{let r=Object.getPrototypeOf(t);if(r===Object.getPrototypeOf(e))return;Object.setPrototypeOf(e,r)},VM=(e,t)=>`/* Wrapped ${e}*/
18
+ ${t}`,zM,GM,KM=(e,t,r)=>{let n=r===""?"":`with ${r.trim()}() `,s=VM.bind(null,n,t.toString());Object.defineProperty(s,"name",GM);let{writable:o,enumerable:i,configurable:a}=zM;Object.defineProperty(e,"toString",{value:s,writable:o,enumerable:i,configurable:a})};var V$=F(()=>{zM=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),GM=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name")});var HM=(e,t={})=>{if(typeof e!=="function")throw TypeError(`Expected the first argument to be a function, got \`${typeof e}\``);let{wait:r=0,maxWait:n=Number.POSITIVE_INFINITY,before:s=!1,after:o=!0}=t;if(r<0||n<0)throw RangeError("`wait` and `maxWait` must not be negative.");if(!s&&!o)throw Error("Both `before` and `after` are false, function wouldn't be called.");let i,a,c,u=function(...d){let l=this,p=()=>{if(i=void 0,a)clearTimeout(a),a=void 0;if(o)c=e.apply(l,d)},f=()=>{if(a=void 0,i)clearTimeout(i),i=void 0;if(o)c=e.apply(l,d)},h=s&&!i;if(clearTimeout(i),i=setTimeout(p,r),n>0&&n!==Number.POSITIVE_INFINITY&&!a)a=setTimeout(f,n);if(h)c=e.apply(l,d);return c};return il(u,e),u.cancel=()=>{if(i)clearTimeout(i),i=void 0;if(a)clearTimeout(a),a=void 0},u},al;var z$=F(()=>{V$();al=HM});var yo=g(function(yH,G$){var BM=Number.MAX_SAFE_INTEGER||9007199254740991,WM=["major","premajor","minor","preminor","patch","prepatch","prerelease"];G$.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:BM,RELEASE_TYPES:WM,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var _o=g(function(_H,K$){var YM=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};K$.exports=YM});var xs=g(function(ar,H$){var{MAX_SAFE_COMPONENT_LENGTH:cl,MAX_SAFE_BUILD_LENGTH:XM,MAX_LENGTH:JM}=yo(),QM=_o();ar=H$.exports={};var ZM=ar.re=[],eL=ar.safeRe=[],j=ar.src=[],tL=ar.safeSrc=[],q=ar.t={},rL=0,ul="[a-zA-Z0-9-]",nL=[["\\s",1],["\\d",JM],[ul,XM]],sL=(e)=>{for(let[t,r]of nL)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e},W=(e,t,r)=>{let n=sL(t),s=rL++;QM(e,s,t),q[e]=s,j[s]=t,tL[s]=n,ZM[s]=new RegExp(t,r?"g":void 0),eL[s]=new RegExp(n,r?"g":void 0)};W("NUMERICIDENTIFIER","0|[1-9]\\d*");W("NUMERICIDENTIFIERLOOSE","\\d+");W("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${ul}*`);W("MAINVERSION",`(${j[q.NUMERICIDENTIFIER]})\\.(${j[q.NUMERICIDENTIFIER]})\\.(${j[q.NUMERICIDENTIFIER]})`);W("MAINVERSIONLOOSE",`(${j[q.NUMERICIDENTIFIERLOOSE]})\\.(${j[q.NUMERICIDENTIFIERLOOSE]})\\.(${j[q.NUMERICIDENTIFIERLOOSE]})`);W("PRERELEASEIDENTIFIER",`(?:${j[q.NONNUMERICIDENTIFIER]}|${j[q.NUMERICIDENTIFIER]})`);W("PRERELEASEIDENTIFIERLOOSE",`(?:${j[q.NONNUMERICIDENTIFIER]}|${j[q.NUMERICIDENTIFIERLOOSE]})`);W("PRERELEASE",`(?:-(${j[q.PRERELEASEIDENTIFIER]}(?:\\.${j[q.PRERELEASEIDENTIFIER]})*))`);W("PRERELEASELOOSE",`(?:-?(${j[q.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${j[q.PRERELEASEIDENTIFIERLOOSE]})*))`);W("BUILDIDENTIFIER",`${ul}+`);W("BUILD",`(?:\\+(${j[q.BUILDIDENTIFIER]}(?:\\.${j[q.BUILDIDENTIFIER]})*))`);W("FULLPLAIN",`v?${j[q.MAINVERSION]}${j[q.PRERELEASE]}?${j[q.BUILD]}?`);W("FULL",`^${j[q.FULLPLAIN]}$`);W("LOOSEPLAIN",`[v=\\s]*${j[q.MAINVERSIONLOOSE]}${j[q.PRERELEASELOOSE]}?${j[q.BUILD]}?`);W("LOOSE",`^${j[q.LOOSEPLAIN]}$`);W("GTLT","((?:<|>)?=?)");W("XRANGEIDENTIFIERLOOSE",`${j[q.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);W("XRANGEIDENTIFIER",`${j[q.NUMERICIDENTIFIER]}|x|X|\\*`);W("XRANGEPLAIN",`[v=\\s]*(${j[q.XRANGEIDENTIFIER]})(?:\\.(${j[q.XRANGEIDENTIFIER]})(?:\\.(${j[q.XRANGEIDENTIFIER]})(?:${j[q.PRERELEASE]})?${j[q.BUILD]}?)?)?`);W("XRANGEPLAINLOOSE",`[v=\\s]*(${j[q.XRANGEIDENTIFIERLOOSE]})(?:\\.(${j[q.XRANGEIDENTIFIERLOOSE]})(?:\\.(${j[q.XRANGEIDENTIFIERLOOSE]})(?:${j[q.PRERELEASELOOSE]})?${j[q.BUILD]}?)?)?`);W("XRANGE",`^${j[q.GTLT]}\\s*${j[q.XRANGEPLAIN]}$`);W("XRANGELOOSE",`^${j[q.GTLT]}\\s*${j[q.XRANGEPLAINLOOSE]}$`);W("COERCEPLAIN",`(^|[^\\d])(\\d{1,${cl}})(?:\\.(\\d{1,${cl}}))?(?:\\.(\\d{1,${cl}}))?`);W("COERCE",`${j[q.COERCEPLAIN]}(?:$|[^\\d])`);W("COERCEFULL",j[q.COERCEPLAIN]+`(?:${j[q.PRERELEASE]})?(?:${j[q.BUILD]})?(?:$|[^\\d])`);W("COERCERTL",j[q.COERCE],!0);W("COERCERTLFULL",j[q.COERCEFULL],!0);W("LONETILDE","(?:~>?)");W("TILDETRIM",`(\\s*)${j[q.LONETILDE]}\\s+`,!0);ar.tildeTrimReplace="$1~";W("TILDE",`^${j[q.LONETILDE]}${j[q.XRANGEPLAIN]}$`);W("TILDELOOSE",`^${j[q.LONETILDE]}${j[q.XRANGEPLAINLOOSE]}$`);W("LONECARET","(?:\\^)");W("CARETTRIM",`(\\s*)${j[q.LONECARET]}\\s+`,!0);ar.caretTrimReplace="$1^";W("CARET",`^${j[q.LONECARET]}${j[q.XRANGEPLAIN]}$`);W("CARETLOOSE",`^${j[q.LONECARET]}${j[q.XRANGEPLAINLOOSE]}$`);W("COMPARATORLOOSE",`^${j[q.GTLT]}\\s*(${j[q.LOOSEPLAIN]})$|^$`);W("COMPARATOR",`^${j[q.GTLT]}\\s*(${j[q.FULLPLAIN]})$|^$`);W("COMPARATORTRIM",`(\\s*)${j[q.GTLT]}\\s*(${j[q.LOOSEPLAIN]}|${j[q.XRANGEPLAIN]})`,!0);ar.comparatorTrimReplace="$1$2$3";W("HYPHENRANGE",`^\\s*(${j[q.XRANGEPLAIN]})\\s+-\\s+(${j[q.XRANGEPLAIN]})\\s*$`);W("HYPHENRANGELOOSE",`^\\s*(${j[q.XRANGEPLAINLOOSE]})\\s+-\\s+(${j[q.XRANGEPLAINLOOSE]})\\s*$`);W("STAR","(<|>)?=?\\s*\\*");W("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");W("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Ta=g(function(vH,B$){var oL=Object.freeze({loose:!0}),iL=Object.freeze({}),aL=(e)=>{if(!e)return iL;if(typeof e!=="object")return oL;return e};B$.exports=aL});var ll=g(function($H,X$){var W$=/^[0-9]+$/,Y$=(e,t)=>{if(typeof e==="number"&&typeof t==="number")return e===t?0:e<t?-1:1;let r=W$.test(e),n=W$.test(t);if(r&&n)e=+e,t=+t;return e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},cL=(e,t)=>Y$(t,e);X$.exports={compareIdentifiers:Y$,rcompareIdentifiers:cL}});var Ke=g(function(EH,Q$){var ka=_o(),{MAX_LENGTH:J$,MAX_SAFE_INTEGER:Oa}=yo(),{safeRe:Aa,t:Pa}=xs(),uL=Ta(),{compareIdentifiers:dl}=ll();class Ot{constructor(e,t){if(t=uL(t),e instanceof Ot)if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;else e=e.version;else if(typeof e!=="string")throw TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>J$)throw TypeError(`version is longer than ${J$} characters`);ka("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let r=e.trim().match(t.loose?Aa[Pa.LOOSE]:Aa[Pa.FULL]);if(!r)throw TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>Oa||this.major<0)throw TypeError("Invalid major version");if(this.minor>Oa||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>Oa||this.patch<0)throw TypeError("Invalid patch version");if(!r[4])this.prerelease=[];else this.prerelease=r[4].split(".").map((n)=>{if(/^[0-9]+$/.test(n)){let s=+n;if(s>=0&&s<Oa)return s}return n});this.build=r[5]?r[5].split("."):[],this.format()}format(){if(this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length)this.version+=`-${this.prerelease.join(".")}`;return this.version}toString(){return this.version}compare(e){if(ka("SemVer.compare",this.version,this.options,e),!(e instanceof Ot)){if(typeof e==="string"&&e===this.version)return 0;e=new Ot(e,this.options)}if(e.version===this.version)return 0;return this.compareMain(e)||this.comparePre(e)}compareMain(e){if(!(e instanceof Ot))e=new Ot(e,this.options);if(this.major<e.major)return-1;if(this.major>e.major)return 1;if(this.minor<e.minor)return-1;if(this.minor>e.minor)return 1;if(this.patch<e.patch)return-1;if(this.patch>e.patch)return 1;return 0}comparePre(e){if(!(e instanceof Ot))e=new Ot(e,this.options);if(this.prerelease.length&&!e.prerelease.length)return-1;else if(!this.prerelease.length&&e.prerelease.length)return 1;else if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let r=this.prerelease[t],n=e.prerelease[t];if(ka("prerelease compare",t,r,n),r===void 0&&n===void 0)return 0;else if(n===void 0)return 1;else if(r===void 0)return-1;else if(r===n)continue;else return dl(r,n)}while(++t)}compareBuild(e){if(!(e instanceof Ot))e=new Ot(e,this.options);let t=0;do{let r=this.build[t],n=e.build[t];if(ka("build compare",t,r,n),r===void 0&&n===void 0)return 0;else if(n===void 0)return 1;else if(r===void 0)return-1;else if(r===n)continue;else return dl(r,n)}while(++t)}inc(e,t,r){if(e.startsWith("pre")){if(!t&&r===!1)throw Error("invalid increment argument: identifier is empty");if(t){let n=`-${t}`.match(this.options.loose?Aa[Pa.PRERELEASELOOSE]:Aa[Pa.PRERELEASE]);if(!n||n[1]!==t)throw Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":if(this.prerelease.length===0)this.inc("patch",t,r);this.inc("pre",t,r);break;case"release":if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0)this.major++;this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0)this.minor++;this.patch=0,this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":{let n=Number(r)?1:0;if(this.prerelease.length===0)this.prerelease=[n];else{let s=this.prerelease.length;while(--s>=0)if(typeof this.prerelease[s]==="number")this.prerelease[s]++,s=-2;if(s===-1){if(t===this.prerelease.join(".")&&r===!1)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(n)}}if(t){let s=[t,n];if(r===!1)s=[t];if(dl(this.prerelease[0],t)===0){if(isNaN(this.prerelease[1]))this.prerelease=s}else this.prerelease=s}break}default:throw Error(`invalid increment argument: ${e}`)}if(this.raw=this.format(),this.build.length)this.raw+=`+${this.build.join(".")}`;return this}}Q$.exports=Ot});var Tn=g(function(bH,eE){var Z$=Ke(),lL=(e,t,r=!1)=>{if(e instanceof Z$)return e;try{return new Z$(e,t)}catch(n){if(!r)return null;throw n}};eE.exports=lL});var rE=g(function(wH,tE){var dL=Tn(),fL=(e,t)=>{let r=dL(e,t);return r?r.version:null};tE.exports=fL});var sE=g(function(SH,nE){var pL=Tn(),hL=(e,t)=>{let r=pL(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};nE.exports=hL});var aE=g(function(xH,iE){var oE=Ke(),mL=(e,t,r,n,s)=>{if(typeof r==="string")s=n,n=r,r=void 0;try{return new oE(e instanceof oE?e.version:e,r).inc(t,n,s).version}catch(o){return null}};iE.exports=mL});var lE=g(function(RH,uE){var cE=Tn(),gL=(e,t)=>{let r=cE(e,null,!0),n=cE(t,null,!0),s=r.compare(n);if(s===0)return null;let o=s>0,i=o?r:n,a=o?n:r,c=!!i.prerelease.length;if(!!a.prerelease.length&&!c){if(!a.patch&&!a.minor)return"major";if(a.compareMain(i)===0){if(a.minor&&!a.patch)return"minor";return"patch"}}let d=c?"pre":"";if(r.major!==n.major)return d+"major";if(r.minor!==n.minor)return d+"minor";if(r.patch!==n.patch)return d+"patch";return"prerelease"};uE.exports=gL});var fE=g(function(TH,dE){var yL=Ke(),_L=(e,t)=>new yL(e,t).major;dE.exports=_L});var hE=g(function(kH,pE){var vL=Ke(),$L=(e,t)=>new vL(e,t).minor;pE.exports=$L});var gE=g(function(OH,mE){var EL=Ke(),bL=(e,t)=>new EL(e,t).patch;mE.exports=bL});var _E=g(function(AH,yE){var wL=Tn(),SL=(e,t)=>{let r=wL(e,t);return r&&r.prerelease.length?r.prerelease:null};yE.exports=SL});var Et=g(function(PH,$E){var vE=Ke(),xL=(e,t,r)=>new vE(e,r).compare(new vE(t,r));$E.exports=xL});var bE=g(function(NH,EE){var RL=Et(),TL=(e,t,r)=>RL(t,e,r);EE.exports=TL});var SE=g(function(IH,wE){var kL=Et(),OL=(e,t)=>kL(e,t,!0);wE.exports=OL});var Na=g(function(CH,RE){var xE=Ke(),AL=(e,t,r)=>{let n=new xE(e,r),s=new xE(t,r);return n.compare(s)||n.compareBuild(s)};RE.exports=AL});var kE=g(function(jH,TE){var PL=Na(),NL=(e,t)=>e.sort((r,n)=>PL(r,n,t));TE.exports=NL});var AE=g(function(qH,OE){var IL=Na(),CL=(e,t)=>e.sort((r,n)=>IL(n,r,t));OE.exports=CL});var vo=g(function(DH,PE){var jL=Et(),qL=(e,t,r)=>jL(e,t,r)>0;PE.exports=qL});var Ia=g(function(MH,NE){var DL=Et(),ML=(e,t,r)=>DL(e,t,r)<0;NE.exports=ML});var fl=g(function(LH,IE){var LL=Et(),UL=(e,t,r)=>LL(e,t,r)===0;IE.exports=UL});var pl=g(function(UH,CE){var FL=Et(),VL=(e,t,r)=>FL(e,t,r)!==0;CE.exports=VL});var Ca=g(function(FH,jE){var zL=Et(),GL=(e,t,r)=>zL(e,t,r)>=0;jE.exports=GL});var ja=g(function(VH,qE){var KL=Et(),HL=(e,t,r)=>KL(e,t,r)<=0;qE.exports=HL});var hl=g(function(zH,DE){var BL=fl(),WL=pl(),YL=vo(),XL=Ca(),JL=Ia(),QL=ja(),ZL=(e,t,r,n)=>{switch(t){case"===":if(typeof e==="object")e=e.version;if(typeof r==="object")r=r.version;return e===r;case"!==":if(typeof e==="object")e=e.version;if(typeof r==="object")r=r.version;return e!==r;case"":case"=":case"==":return BL(e,r,n);case"!=":return WL(e,r,n);case">":return YL(e,r,n);case">=":return XL(e,r,n);case"<":return JL(e,r,n);case"<=":return QL(e,r,n);default:throw TypeError(`Invalid operator: ${t}`)}};DE.exports=ZL});var LE=g(function(GH,ME){var eU=Ke(),tU=Tn(),{safeRe:qa,t:Da}=xs(),rU=(e,t)=>{if(e instanceof eU)return e;if(typeof e==="number")e=String(e);if(typeof e!=="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(t.includePrerelease?qa[Da.COERCEFULL]:qa[Da.COERCE]);else{let c=t.includePrerelease?qa[Da.COERCERTLFULL]:qa[Da.COERCERTL],u;while((u=c.exec(e))&&(!r||r.index+r[0].length!==e.length)){if(!r||u.index+u[0].length!==r.index+r[0].length)r=u;c.lastIndex=u.index+u[1].length+u[2].length}c.lastIndex=-1}if(r===null)return null;let n=r[2],s=r[3]||"0",o=r[4]||"0",i=t.includePrerelease&&r[5]?`-${r[5]}`:"",a=t.includePrerelease&&r[6]?`+${r[6]}`:"";return tU(`${n}.${s}.${o}${i}${a}`,t)};ME.exports=rU});var VE=g(function(KH,FE){class UE{constructor(){this.max=1000,this.map=new Map}get(e){let t=this.map.get(e);if(t===void 0)return;else return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let n=this.map.keys().next().value;this.delete(n)}this.map.set(e,t)}return this}}FE.exports=UE});var bt=g(function(HH,HE){var nU=/\s+/g;class $o{constructor(e,t){if(t=oU(t),e instanceof $o)if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;else return new $o(e.raw,t);if(e instanceof Ma)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(nU," "),this.set=this.raw.split("||").map((r)=>this.parseRange(r.trim())).filter((r)=>r.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let r=this.set[0];if(this.set=this.set.filter((n)=>!GE(n[0])),this.set.length===0)this.set=[r];else if(this.set.length>1){for(let n of this.set)if(n.length===1&&fU(n[0])){this.set=[n];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){if(e>0)this.formatted+="||";let t=this.set[e];for(let r=0;r<t.length;r++){if(r>0)this.formatted+=" ";this.formatted+=t[r].toString().trim()}}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let r=((this.options.includePrerelease&&lU)|(this.options.loose&&dU))+":"+e,n=zE.get(r);if(n)return n;let s=this.options.loose,o=s?Xe[He.HYPHENRANGELOOSE]:Xe[He.HYPHENRANGE];e=e.replace(o,bU(this.options.includePrerelease)),ye("hyphen replace",e),e=e.replace(Xe[He.COMPARATORTRIM],aU),ye("comparator trim",e),e=e.replace(Xe[He.TILDETRIM],cU),ye("tilde trim",e),e=e.replace(Xe[He.CARETTRIM],uU),ye("caret trim",e);let i=e.split(" ").map((d)=>pU(d,this.options)).join(" ").split(/\s+/).map((d)=>EU(d,this.options));if(s)i=i.filter((d)=>(ye("loose invalid filter",d,this.options),!!d.match(Xe[He.COMPARATORLOOSE])));ye("range list",i);let a=new Map,c=i.map((d)=>new Ma(d,this.options));for(let d of c){if(GE(d))return[d];a.set(d.value,d)}if(a.size>1&&a.has(""))a.delete("");let u=[...a.values()];return zE.set(r,u),u}intersects(e,t){if(!(e instanceof $o))throw TypeError("a Range is required");return this.set.some((r)=>KE(r,t)&&e.set.some((n)=>KE(n,t)&&r.every((s)=>n.every((o)=>s.intersects(o,t)))))}test(e){if(!e)return!1;if(typeof e==="string")try{e=new iU(e,this.options)}catch(t){return!1}for(let t=0;t<this.set.length;t++)if(wU(this.set[t],e,this.options))return!0;return!1}}HE.exports=$o;var sU=VE(),zE=new sU,oU=Ta(),Ma=Eo(),ye=_o(),iU=Ke(),{safeRe:Xe,t:He,comparatorTrimReplace:aU,tildeTrimReplace:cU,caretTrimReplace:uU}=xs(),{FLAG_INCLUDE_PRERELEASE:lU,FLAG_LOOSE:dU}=yo(),GE=(e)=>e.value==="<0.0.0-0",fU=(e)=>e.value==="",KE=(e,t)=>{let r=!0,n=e.slice(),s=n.pop();while(r&&n.length)r=n.every((o)=>s.intersects(o,t)),s=n.pop();return r},pU=(e,t)=>(e=e.replace(Xe[He.BUILD],""),ye("comp",e,t),e=gU(e,t),ye("caret",e),e=hU(e,t),ye("tildes",e),e=_U(e,t),ye("xrange",e),e=$U(e,t),ye("stars",e),e),Je=(e)=>!e||e.toLowerCase()==="x"||e==="*",hU=(e,t)=>e.trim().split(/\s+/).map((r)=>mU(r,t)).join(" "),mU=(e,t)=>{let r=t.loose?Xe[He.TILDELOOSE]:Xe[He.TILDE];return e.replace(r,(n,s,o,i,a)=>{ye("tilde",e,n,s,o,i,a);let c;if(Je(s))c="";else if(Je(o))c=`>=${s}.0.0 <${+s+1}.0.0-0`;else if(Je(i))c=`>=${s}.${o}.0 <${s}.${+o+1}.0-0`;else if(a)ye("replaceTilde pr",a),c=`>=${s}.${o}.${i}-${a} <${s}.${+o+1}.0-0`;else c=`>=${s}.${o}.${i} <${s}.${+o+1}.0-0`;return ye("tilde return",c),c})},gU=(e,t)=>e.trim().split(/\s+/).map((r)=>yU(r,t)).join(" "),yU=(e,t)=>{ye("caret",e,t);let r=t.loose?Xe[He.CARETLOOSE]:Xe[He.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,(s,o,i,a,c)=>{ye("caret",e,s,o,i,a,c);let u;if(Je(o))u="";else if(Je(i))u=`>=${o}.0.0${n} <${+o+1}.0.0-0`;else if(Je(a))if(o==="0")u=`>=${o}.${i}.0${n} <${o}.${+i+1}.0-0`;else u=`>=${o}.${i}.0${n} <${+o+1}.0.0-0`;else if(c)if(ye("replaceCaret pr",c),o==="0")if(i==="0")u=`>=${o}.${i}.${a}-${c} <${o}.${i}.${+a+1}-0`;else u=`>=${o}.${i}.${a}-${c} <${o}.${+i+1}.0-0`;else u=`>=${o}.${i}.${a}-${c} <${+o+1}.0.0-0`;else if(ye("no pr"),o==="0")if(i==="0")u=`>=${o}.${i}.${a}${n} <${o}.${i}.${+a+1}-0`;else u=`>=${o}.${i}.${a}${n} <${o}.${+i+1}.0-0`;else u=`>=${o}.${i}.${a} <${+o+1}.0.0-0`;return ye("caret return",u),u})},_U=(e,t)=>(ye("replaceXRanges",e,t),e.split(/\s+/).map((r)=>vU(r,t)).join(" ")),vU=(e,t)=>{e=e.trim();let r=t.loose?Xe[He.XRANGELOOSE]:Xe[He.XRANGE];return e.replace(r,(n,s,o,i,a,c)=>{ye("xRange",e,n,s,o,i,a,c);let u=Je(o),d=u||Je(i),l=d||Je(a),p=l;if(s==="="&&p)s="";if(c=t.includePrerelease?"-0":"",u)if(s===">"||s==="<")n="<0.0.0-0";else n="*";else if(s&&p){if(d)i=0;if(a=0,s===">")if(s=">=",d)o=+o+1,i=0,a=0;else i=+i+1,a=0;else if(s==="<=")if(s="<",d)o=+o+1;else i=+i+1;if(s==="<")c="-0";n=`${s+o}.${i}.${a}${c}`}else if(d)n=`>=${o}.0.0${c} <${+o+1}.0.0-0`;else if(l)n=`>=${o}.${i}.0${c} <${o}.${+i+1}.0-0`;return ye("xRange return",n),n})},$U=(e,t)=>(ye("replaceStars",e,t),e.trim().replace(Xe[He.STAR],"")),EU=(e,t)=>(ye("replaceGTE0",e,t),e.trim().replace(Xe[t.includePrerelease?He.GTE0PRE:He.GTE0],"")),bU=(e)=>(t,r,n,s,o,i,a,c,u,d,l,p)=>{if(Je(n))r="";else if(Je(s))r=`>=${n}.0.0${e?"-0":""}`;else if(Je(o))r=`>=${n}.${s}.0${e?"-0":""}`;else if(i)r=`>=${r}`;else r=`>=${r}${e?"-0":""}`;if(Je(u))c="";else if(Je(d))c=`<${+u+1}.0.0-0`;else if(Je(l))c=`<${u}.${+d+1}.0-0`;else if(p)c=`<=${u}.${d}.${l}-${p}`;else if(e)c=`<${u}.${d}.${+l+1}-0`;else c=`<=${c}`;return`${r} ${c}`.trim()},wU=(e,t,r)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let n=0;n<e.length;n++){if(ye(e[n].semver),e[n].semver===Ma.ANY)continue;if(e[n].semver.prerelease.length>0){let s=e[n].semver;if(s.major===t.major&&s.minor===t.minor&&s.patch===t.patch)return!0}}return!1}return!0}});var Eo=g(function(BH,QE){var bo=Symbol("SemVer ANY");class La{static get ANY(){return bo}constructor(e,t){if(t=BE(t),e instanceof La)if(e.loose===!!t.loose)return e;else e=e.value;if(e=e.trim().split(/\s+/).join(" "),gl("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===bo)this.value="";else this.value=this.operator+this.semver.version;gl("comp",this)}parse(e){let t=this.options.loose?WE[YE.COMPARATORLOOSE]:WE[YE.COMPARATOR],r=e.match(t);if(!r)throw TypeError(`Invalid comparator: ${e}`);if(this.operator=r[1]!==void 0?r[1]:"",this.operator==="=")this.operator="";if(!r[2])this.semver=bo;else this.semver=new XE(r[2],this.options.loose)}toString(){return this.value}test(e){if(gl("Comparator.test",e,this.options.loose),this.semver===bo||e===bo)return!0;if(typeof e==="string")try{e=new XE(e,this.options)}catch(t){return!1}return ml(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof La))throw TypeError("a Comparator is required");if(this.operator===""){if(this.value==="")return!0;return new JE(e.value,t).test(this.value)}else if(e.operator===""){if(e.value==="")return!0;return new JE(this.value,t).test(e.semver)}if(t=BE(t),t.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0"))return!1;if(!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))return!1;if(this.operator.startsWith(">")&&e.operator.startsWith(">"))return!0;if(this.operator.startsWith("<")&&e.operator.startsWith("<"))return!0;if(this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("="))return!0;if(ml(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))return!0;if(ml(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">"))return!0;return!1}}QE.exports=La;var BE=Ta(),{safeRe:WE,t:YE}=xs(),ml=hl(),gl=_o(),XE=Ke(),JE=bt()});var wo=g(function(WH,ZE){var SU=bt(),xU=(e,t,r)=>{try{t=new SU(t,r)}catch(n){return!1}return t.test(e)};ZE.exports=xU});var tb=g(function(YH,eb){var RU=bt(),TU=(e,t)=>new RU(e,t).set.map((r)=>r.map((n)=>n.value).join(" ").trim().split(" "));eb.exports=TU});var nb=g(function(XH,rb){var kU=Ke(),OU=bt(),AU=(e,t,r)=>{let n=null,s=null,o=null;try{o=new OU(t,r)}catch(i){return null}return e.forEach((i)=>{if(o.test(i)){if(!n||s.compare(i)===-1)n=i,s=new kU(n,r)}}),n};rb.exports=AU});var ob=g(function(JH,sb){var PU=Ke(),NU=bt(),IU=(e,t,r)=>{let n=null,s=null,o=null;try{o=new NU(t,r)}catch(i){return null}return e.forEach((i)=>{if(o.test(i)){if(!n||s.compare(i)===1)n=i,s=new PU(n,r)}}),n};sb.exports=IU});var cb=g(function(QH,ab){var yl=Ke(),CU=bt(),ib=vo(),jU=(e,t)=>{e=new CU(e,t);let r=new yl("0.0.0");if(e.test(r))return r;if(r=new yl("0.0.0-0"),e.test(r))return r;r=null;for(let n=0;n<e.set.length;++n){let s=e.set[n],o=null;if(s.forEach((i)=>{let a=new yl(i.semver.version);switch(i.operator){case">":if(a.prerelease.length===0)a.patch++;else a.prerelease.push(0);a.raw=a.format();case"":case">=":if(!o||ib(a,o))o=a;break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${i.operator}`)}}),o&&(!r||ib(r,o)))r=o}if(r&&e.test(r))return r;return null};ab.exports=jU});var lb=g(function(ZH,ub){var qU=bt(),DU=(e,t)=>{try{return new qU(e,t).range||"*"}catch(r){return null}};ub.exports=DU});var Ua=g(function(e5,hb){var MU=Ke(),pb=Eo(),{ANY:LU}=pb,UU=bt(),FU=wo(),db=vo(),fb=Ia(),VU=ja(),zU=Ca(),GU=(e,t,r,n)=>{e=new MU(e,n),t=new UU(t,n);let s,o,i,a,c;switch(r){case">":s=db,o=VU,i=fb,a=">",c=">=";break;case"<":s=fb,o=zU,i=db,a="<",c="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(FU(e,t,n))return!1;for(let u=0;u<t.set.length;++u){let d=t.set[u],l=null,p=null;if(d.forEach((f)=>{if(f.semver===LU)f=new pb(">=0.0.0");if(l=l||f,p=p||f,s(f.semver,l.semver,n))l=f;else if(i(f.semver,p.semver,n))p=f}),l.operator===a||l.operator===c)return!1;if((!p.operator||p.operator===a)&&o(e,p.semver))return!1;else if(p.operator===c&&i(e,p.semver))return!1}return!0};hb.exports=GU});var gb=g(function(t5,mb){var KU=Ua(),HU=(e,t,r)=>KU(e,t,">",r);mb.exports=HU});var _b=g(function(r5,yb){var BU=Ua(),WU=(e,t,r)=>BU(e,t,"<",r);yb.exports=WU});var Eb=g(function(n5,$b){var vb=bt(),YU=(e,t,r)=>(e=new vb(e,r),t=new vb(t,r),e.intersects(t,r));$b.exports=YU});var wb=g(function(s5,bb){var XU=wo(),JU=Et();bb.exports=(e,t,r)=>{let n=[],s=null,o=null,i=e.sort((d,l)=>JU(d,l,r));for(let d of i)if(XU(d,t,r)){if(o=d,!s)s=d}else{if(o)n.push([s,o]);o=null,s=null}if(s)n.push([s,null]);let a=[];for(let[d,l]of n)if(d===l)a.push(d);else if(!l&&d===i[0])a.push("*");else if(!l)a.push(`>=${d}`);else if(d===i[0])a.push(`<=${l}`);else a.push(`${d} - ${l}`);let c=a.join(" || "),u=typeof t.raw==="string"?t.raw:String(t);return c.length<u.length?c:t}});var Ob=g(function(o5,kb){var Sb=bt(),vl=Eo(),{ANY:_l}=vl,So=wo(),$l=Et(),QU=(e,t,r={})=>{if(e===t)return!0;e=new Sb(e,r),t=new Sb(t,r);let n=!1;e:for(let s of e.set){for(let o of t.set){let i=e2(s,o,r);if(n=n||i!==null,i)continue e}if(n)return!1}return!0},ZU=[new vl(">=0.0.0-0")],xb=[new vl(">=0.0.0")],e2=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===_l)if(t.length===1&&t[0].semver===_l)return!0;else if(r.includePrerelease)e=ZU;else e=xb;if(t.length===1&&t[0].semver===_l)if(r.includePrerelease)return!0;else t=xb;let n=new Set,s,o;for(let f of e)if(f.operator===">"||f.operator===">=")s=Rb(s,f,r);else if(f.operator==="<"||f.operator==="<=")o=Tb(o,f,r);else n.add(f.semver);if(n.size>1)return null;let i;if(s&&o){if(i=$l(s.semver,o.semver,r),i>0)return null;else if(i===0&&(s.operator!==">="||o.operator!=="<="))return null}for(let f of n){if(s&&!So(f,String(s),r))return null;if(o&&!So(f,String(o),r))return null;for(let h of t)if(!So(f,String(h),r))return!1;return!0}let a,c,u,d,l=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1,p=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1;if(l&&l.prerelease.length===1&&o.operator==="<"&&l.prerelease[0]===0)l=!1;for(let f of t){if(d=d||f.operator===">"||f.operator===">=",u=u||f.operator==="<"||f.operator==="<=",s){if(p){if(f.semver.prerelease&&f.semver.prerelease.length&&f.semver.major===p.major&&f.semver.minor===p.minor&&f.semver.patch===p.patch)p=!1}if(f.operator===">"||f.operator===">="){if(a=Rb(s,f,r),a===f&&a!==s)return!1}else if(s.operator===">="&&!So(s.semver,String(f),r))return!1}if(o){if(l){if(f.semver.prerelease&&f.semver.prerelease.length&&f.semver.major===l.major&&f.semver.minor===l.minor&&f.semver.patch===l.patch)l=!1}if(f.operator==="<"||f.operator==="<="){if(c=Tb(o,f,r),c===f&&c!==o)return!1}else if(o.operator==="<="&&!So(o.semver,String(f),r))return!1}if(!f.operator&&(o||s)&&i!==0)return!1}if(s&&u&&!o&&i!==0)return!1;if(o&&d&&!s&&i!==0)return!1;if(p||l)return!1;return!0},Rb=(e,t,r)=>{if(!e)return t;let n=$l(e.semver,t.semver,r);return n>0?e:n<0?t:t.operator===">"&&e.operator===">="?t:e},Tb=(e,t,r)=>{if(!e)return t;let n=$l(e.semver,t.semver,r);return n<0?e:n>0?t:t.operator==="<"&&e.operator==="<="?t:e};kb.exports=QU});var Pb=g(function(i5,Ab){var Rs=xs(),Fa=yo(),t2=Ke(),Va=ll(),r2=Tn(),n2=rE(),s2=sE(),o2=aE(),i2=lE(),a2=fE(),c2=hE(),u2=gE(),l2=_E(),d2=Et(),f2=bE(),p2=SE(),h2=Na(),m2=kE(),g2=AE(),y2=vo(),_2=Ia(),v2=fl(),$2=pl(),E2=Ca(),b2=ja(),w2=hl(),S2=LE(),x2=Eo(),R2=bt(),T2=wo(),k2=tb(),O2=nb(),A2=ob(),P2=cb(),N2=lb(),I2=Ua(),C2=gb(),j2=_b(),q2=Eb(),D2=wb(),M2=Ob();Ab.exports={parse:r2,valid:n2,clean:s2,inc:o2,diff:i2,major:a2,minor:c2,patch:u2,prerelease:l2,compare:d2,rcompare:f2,compareLoose:p2,compareBuild:h2,sort:m2,rsort:g2,gt:y2,lt:_2,eq:v2,neq:$2,gte:E2,lte:b2,cmp:w2,coerce:S2,Comparator:x2,Range:R2,satisfies:T2,toComparators:k2,maxSatisfying:O2,minSatisfying:A2,minVersion:P2,validRange:N2,outside:I2,gtr:C2,ltr:j2,intersects:q2,simplifyRange:D2,subset:M2,SemVer:t2,re:Rs.re,src:Rs.src,tokens:Rs.t,SEMVER_SPEC_VERSION:Fa.SEMVER_SPEC_VERSION,RELEASE_TYPES:Fa.RELEASE_TYPES,compareIdentifiers:Va.compareIdentifiers,rcompareIdentifiers:Va.rcompareIdentifiers}});function Ib(e,t,r){if(!e)return!1;if(e.constructor===t)return!0;return L2.call(e)===r}function Cb(e){return Ib(e,Uint8Array,"[object Uint8Array]")}function U2(e){return Ib(e,ArrayBuffer,"[object ArrayBuffer]")}function F2(e){return Cb(e)||U2(e)}function V2(e){if(!Cb(e))throw TypeError(`Expected \`Uint8Array\`, got \`${typeof e}\``)}function z2(e){if(!F2(e))throw TypeError(`Expected \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof e}\``)}function El(e,t){if(e.length===0)return new Uint8Array(0);t??=e.reduce((s,o)=>s+o.length,0);let r=new Uint8Array(t),n=0;for(let s of e)V2(s),r.set(s,n),n+=s.length;return r}function bl(e,t="utf8"){return z2(e),Nb[t]??=new globalThis.TextDecoder(t),Nb[t].decode(e)}function G2(e){if(typeof e!=="string")throw TypeError(`Expected \`string\`, got \`${typeof e}\``)}function za(e){return G2(e),K2.encode(e)}var L2,Nb,K2,a5;var jb=F(()=>{L2=Object.prototype.toString;Nb={utf8:new globalThis.TextDecoder("utf8")};K2=new globalThis.TextEncoder;a5=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"))});import{isDeepStrictEqual as H2}from"util";import qb from"process";import kn from"fs";import Db from"path";import xo from"crypto";import B2 from"assert";var Lb,Ub,On,W2,Mb="aes-256-cbc",Ts=()=>Object.create(null),Y2=(e)=>e!==void 0&&e!==null,X2=(e,t)=>{let r=new Set(["undefined","symbol","function"]),n=typeof t;if(r.has(n))throw TypeError(`Setting a value of type \`${n}\` for key \`${e}\` is not allowed as it's not supported by JSON`)},Ga="__internal__",wl,Ka;var Fb=F(()=>{ld();fd();Vd();z$();jb();Lb=_c(oy(),1),Ub=_c(F$(),1),On=_c(Pb(),1),W2=Ub.default.default,wl=`${Ga}.migrations.version`;Ka=class Ka{path;events;#n;#t;#e;#r={};constructor(e={}){let t={configName:"config",fileExtension:"json",projectSuffix:"nodejs",clearInvalidConfig:!1,accessPropertiesByDotNotation:!0,configFileMode:438,...e};if(!t.cwd){if(!t.projectName)throw Error("Please specify the `projectName` option.");t.cwd=Sc(t.projectName,{suffix:t.projectSuffix}).config}if(this.#e=t,t.schema??t.ajvOptions??t.rootSchema){if(t.schema&&typeof t.schema!=="object")throw TypeError("The `schema` option must be an object.");let o=new Lb.Ajv2020({allErrors:!0,useDefaults:!0,...t.ajvOptions});W2(o);let i={...t.rootSchema,type:"object",properties:t.schema};this.#n=o.compile(i);for(let[a,c]of Object.entries(t.schema??{}))if(c?.default)this.#r[a]=c.default}if(t.defaults)this.#r={...this.#r,...t.defaults};if(t.serialize)this._serialize=t.serialize;if(t.deserialize)this._deserialize=t.deserialize;this.events=new EventTarget,this.#t=t.encryptionKey;let r=t.fileExtension?`.${t.fileExtension}`:"";this.path=Db.resolve(t.cwd,`${t.configName??"config"}${r}`);let n=this.store,s=Object.assign(Ts(),t.defaults,n);if(t.migrations){if(!t.projectVersion)throw Error("Please specify the `projectVersion` option.");this._migrate(t.migrations,t.projectVersion,t.beforeEachMigration)}this._validate(s);try{B2.deepEqual(n,s)}catch{this.store=s}if(t.watch)this._watch()}get(e,t){if(this.#e.accessPropertiesByDotNotation)return this._get(e,t);let{store:r}=this;return e in r?r[e]:t}set(e,t){if(typeof e!=="string"&&typeof e!=="object")throw TypeError(`Expected \`key\` to be of type \`string\` or \`object\`, got ${typeof e}`);if(typeof e!=="object"&&t===void 0)throw TypeError("Use `delete()` to clear values");if(this._containsReservedKey(e))throw TypeError(`Please don't use the ${Ga} key, as it's used to manage this module internal operations.`);let{store:r}=this,n=(s,o)=>{if(X2(s,o),this.#e.accessPropertiesByDotNotation)Ec(r,s,o);else r[s]=o};if(typeof e==="object"){let s=e;for(let[o,i]of Object.entries(s))n(o,i)}else n(e,t);this.store=r}has(e){if(this.#e.accessPropertiesByDotNotation)return ud(this.store,e);return e in this.store}reset(...e){for(let t of e)if(Y2(this.#r[t]))this.set(t,this.#r[t])}delete(e){let{store:t}=this;if(this.#e.accessPropertiesByDotNotation)cd(t,e);else delete t[e];this.store=t}clear(){this.store=Ts();for(let e of Object.keys(this.#r))this.reset(e)}onDidChange(e,t){if(typeof e!=="string")throw TypeError(`Expected \`key\` to be of type \`string\`, got ${typeof e}`);if(typeof t!=="function")throw TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof t}`);return this._handleChange(()=>this.get(e),t)}onDidAnyChange(e){if(typeof e!=="function")throw TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof e}`);return this._handleChange(()=>this.store,e)}get size(){return Object.keys(this.store).length}get store(){try{let e=kn.readFileSync(this.path,this.#t?null:"utf8"),t=this._encryptData(e),r=this._deserialize(t);return this._validate(r),Object.assign(Ts(),r)}catch(e){if(e?.code==="ENOENT")return this._ensureDirectory(),Ts();if(this.#e.clearInvalidConfig&&e.name==="SyntaxError")return Ts();throw e}}set store(e){this._ensureDirectory(),this._validate(e),this._write(e),this.events.dispatchEvent(new Event("change"))}*[Symbol.iterator](){for(let[e,t]of Object.entries(this.store))yield[e,t]}_encryptData(e){if(!this.#t)return typeof e==="string"?e:bl(e);try{let t=e.slice(0,16),r=xo.pbkdf2Sync(this.#t,t.toString(),1e4,32,"sha512"),n=xo.createDecipheriv(Mb,r,t),s=e.slice(17),o=typeof s==="string"?za(s):s;return bl(El([n.update(o),n.final()]))}catch{}return e.toString()}_handleChange(e,t){let r=e(),n=()=>{let s=r,o=e();if(H2(o,s))return;r=o,t.call(this,o,s)};return this.events.addEventListener("change",n),()=>{this.events.removeEventListener("change",n)}}_deserialize=(e)=>JSON.parse(e);_serialize=(e)=>JSON.stringify(e,void 0,"\t");_validate(e){if(!this.#n)return;if(this.#n(e)||!this.#n.errors)return;let r=this.#n.errors.map(({instancePath:n,message:s=""})=>`\`${n.slice(1)}\` ${s}`);throw Error("Config schema violation: "+r.join("; "))}_ensureDirectory(){kn.mkdirSync(Db.dirname(this.path),{recursive:!0})}_write(e){let t=this._serialize(e);if(this.#t){let r=xo.randomBytes(16),n=xo.pbkdf2Sync(this.#t,r.toString(),1e4,32,"sha512"),s=xo.createCipheriv(Mb,n,r);t=El([r,za(":"),s.update(za(t)),s.final()])}if(qb.env.SNAP)kn.writeFileSync(this.path,t,{mode:this.#e.configFileMode});else try{jc(this.path,t,{mode:this.#e.configFileMode})}catch(r){if(r?.code==="EXDEV"){kn.writeFileSync(this.path,t,{mode:this.#e.configFileMode});return}throw r}}_watch(){if(this._ensureDirectory(),!kn.existsSync(this.path))this._write(Ts());if(qb.platform==="win32")kn.watch(this.path,{persistent:!1},al(()=>{this.events.dispatchEvent(new Event("change"))},{wait:100}));else kn.watchFile(this.path,{persistent:!1},al(()=>{this.events.dispatchEvent(new Event("change"))},{wait:5000}))}_migrate(e,t,r){let n=this._get(wl,"0.0.0"),s=Object.keys(e).filter((i)=>this._shouldPerformMigration(i,n,t)),o={...this.store};for(let i of s)try{if(r)r(this,{fromVersion:n,toVersion:i,finalVersion:t,versions:s});let a=e[i];a?.(this),this._set(wl,i),n=i,o={...this.store}}catch(a){throw this.store=o,Error(`Something went wrong during the migration! Changes applied to the store until this failed migration will be restored. ${a}`)}if(this._isVersionInRangeFormat(n)||!On.default.eq(n,t))this._set(wl,t)}_containsReservedKey(e){if(typeof e==="object"){if(Object.keys(e)[0]===Ga)return!0}if(typeof e!=="string")return!1;if(this.#e.accessPropertiesByDotNotation){if(e.startsWith(`${Ga}.`))return!0;return!1}return!1}_isVersionInRangeFormat(e){return On.default.clean(e)===null}_shouldPerformMigration(e,t,r){if(this._isVersionInRangeFormat(e)){if(t!=="0.0.0"&&On.default.satisfies(t,e))return!1;return On.default.satisfies(r,e)}if(On.default.lte(e,t))return!1;if(On.default.gt(e,r))return!1;return!0}_get(e,t){return ad(this.store,e,t)}_set(e,t){let{store:r}=this;Ec(r,e,t),this.store=r}}});var re,Vb,N,Er=(e)=>{switch(typeof e){case"undefined":return N.undefined;case"string":return N.string;case"number":return Number.isNaN(e)?N.nan:N.number;case"boolean":return N.boolean;case"function":return N.function;case"bigint":return N.bigint;case"symbol":return N.symbol;case"object":if(Array.isArray(e))return N.array;if(e===null)return N.null;if(e.then&&typeof e.then==="function"&&e.catch&&typeof e.catch==="function")return N.promise;if(typeof Map<"u"&&e instanceof Map)return N.map;if(typeof Set<"u"&&e instanceof Set)return N.set;if(typeof Date<"u"&&e instanceof Date)return N.date;return N.object;default:return N.unknown}};var Ro=F(()=>{(function(e){e.assertEqual=(s)=>{};function t(s){}e.assertIs=t;function r(s){throw Error()}e.assertNever=r,e.arrayToEnum=(s)=>{let o={};for(let i of s)o[i]=i;return o},e.getValidEnumValues=(s)=>{let o=e.objectKeys(s).filter((a)=>typeof s[s[a]]!=="number"),i={};for(let a of o)i[a]=s[a];return e.objectValues(i)},e.objectValues=(s)=>e.objectKeys(s).map(function(o){return s[o]}),e.objectKeys=typeof Object.keys==="function"?(s)=>Object.keys(s):(s)=>{let o=[];for(let i in s)if(Object.prototype.hasOwnProperty.call(s,i))o.push(i);return o},e.find=(s,o)=>{for(let i of s)if(o(i))return i;return},e.isInteger=typeof Number.isInteger==="function"?(s)=>Number.isInteger(s):(s)=>typeof s==="number"&&Number.isFinite(s)&&Math.floor(s)===s;function n(s,o=" | "){return s.map((i)=>typeof i==="string"?`'${i}'`:i).join(o)}e.joinValues=n,e.jsonStringifyReplacer=(s,o)=>{if(typeof o==="bigint")return o.toString();return o}})(re||(re={}));(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(Vb||(Vb={}));N=re.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"])});var w,ft;var Ha=F(()=>{Ro();w=re.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);ft=class ft extends Error{get errors(){return this.issues}constructor(e){super();this.issues=[],this.addIssue=(r)=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};let t=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,t);else this.__proto__=t;this.name="ZodError",this.issues=e}format(e){let t=e||function(s){return s.message},r={_errors:[]},n=(s)=>{for(let o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(n);else if(o.code==="invalid_return_type")n(o.returnTypeError);else if(o.code==="invalid_arguments")n(o.argumentsError);else if(o.path.length===0)r._errors.push(t(o));else{let i=r,a=0;while(a<o.path.length){let c=o.path[a];if(a!==o.path.length-1)i[c]=i[c]||{_errors:[]};else i[c]=i[c]||{_errors:[]},i[c]._errors.push(t(o));i=i[c],a++}}};return n(this),r}static assert(e){if(!(e instanceof ft))throw Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,re.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=(t)=>t.message){let t={},r=[];for(let n of this.issues)if(n.path.length>0){let s=n.path[0];t[s]=t[s]||[],t[s].push(e(n))}else r.push(e(n));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}};ft.create=(e)=>new ft(e)});var J2=(e,t)=>{let r;switch(e.code){case w.invalid_type:if(e.received===N.undefined)r="Required";else r=`Expected ${e.expected}, received ${e.received}`;break;case w.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,re.jsonStringifyReplacer)}`;break;case w.unrecognized_keys:r=`Unrecognized key(s) in object: ${re.joinValues(e.keys,", ")}`;break;case w.invalid_union:r="Invalid input";break;case w.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${re.joinValues(e.options)}`;break;case w.invalid_enum_value:r=`Invalid enum value. Expected ${re.joinValues(e.options)}, received '${e.received}'`;break;case w.invalid_arguments:r="Invalid function arguments";break;case w.invalid_return_type:r="Invalid function return type";break;case w.invalid_date:r="Invalid date";break;case w.invalid_string:if(typeof e.validation==="object")if("includes"in e.validation){if(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position==="number")r=`${r} at one or more positions greater than or equal to ${e.validation.position}`}else if("startsWith"in e.validation)r=`Invalid input: must start with "${e.validation.startsWith}"`;else if("endsWith"in e.validation)r=`Invalid input: must end with "${e.validation.endsWith}"`;else re.assertNever(e.validation);else if(e.validation!=="regex")r=`Invalid ${e.validation}`;else r="Invalid";break;case w.too_small:if(e.type==="array")r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`;else if(e.type==="string")r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`;else if(e.type==="number")r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`;else if(e.type==="bigint")r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`;else if(e.type==="date")r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`;else r="Invalid input";break;case w.too_big:if(e.type==="array")r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`;else if(e.type==="string")r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`;else if(e.type==="number")r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`;else if(e.type==="bigint")r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`;else if(e.type==="date")r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`;else r="Invalid input";break;case w.custom:r="Invalid input";break;case w.invalid_intersection_types:r="Intersection results could not be merged";break;case w.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case w.not_finite:r="Number must be finite";break;default:r=t.defaultError,re.assertNever(e)}return{message:r}},fn;var Sl=F(()=>{Ha();Ro();fn=J2});function To(){return Q2}var Q2;var Ba=F(()=>{Sl();Q2=fn});function k(e,t){let r=To(),n=Wa({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===fn?void 0:fn].filter((s)=>!!s)});e.common.issues.push(n)}class Be{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray(e,t){let r=[];for(let n of t){if(n.status==="aborted")return G;if(n.status==="dirty")e.dirty();r.push(n.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){let r=[];for(let n of t){let s=await n.key,o=await n.value;r.push({key:s,value:o})}return Be.mergeObjectSync(e,r)}static mergeObjectSync(e,t){let r={};for(let n of t){let{key:s,value:o}=n;if(s.status==="aborted")return G;if(o.status==="aborted")return G;if(s.status==="dirty")e.dirty();if(o.status==="dirty")e.dirty();if(s.value!=="__proto__"&&(typeof o.value<"u"||n.alwaysSet))r[s.value]=o.value}return{status:e.value,value:r}}}var Wa=(e)=>{let{data:t,path:r,errorMaps:n,issueData:s}=e,o=[...r,...s.path||[]],i={...s,path:o};if(s.message!==void 0)return{...s,path:o,message:s.message};let a="",c=n.filter((u)=>!!u).slice().reverse();for(let u of c)a=u(i,{data:t,defaultError:a}).message;return{...s,path:o,message:a}},G,ks=(e)=>({status:"dirty",value:e}),Qe=(e)=>({status:"valid",value:e}),xl=(e)=>e.status==="aborted",Rl=(e)=>e.status==="dirty",An=(e)=>e.status==="valid",ko=(e)=>typeof Promise<"u"&&e instanceof Promise;var Tl=F(()=>{Ba();Sl();G=Object.freeze({status:"aborted"})});var zb=()=>{};var D;var Gb=F(()=>{(function(e){e.errToObj=(t)=>typeof t==="string"?{message:t}:t||{},e.toString=(t)=>typeof t==="string"?t:t?.message})(D||(D={}))});class At{constructor(e,t,r,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=n}get path(){if(!this._cachedPath.length)if(Array.isArray(this._key))this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}function Q(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:s}=e;if(t&&(r||n))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(t)return{errorMap:t,description:s};return{errorMap:(i,a)=>{let{message:c}=e;if(i.code==="invalid_enum_value")return{message:c??a.defaultError};if(typeof a.data>"u")return{message:c??n??a.defaultError};if(i.code!=="invalid_type")return{message:a.defaultError};return{message:c??r??a.defaultError}},description:s}}class ee{get description(){return this._def.description}_getType(e){return Er(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Er(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Be,ctx:{common:e.parent.common,data:e.data,parsedType:Er(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(ko(t))throw Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){let r={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Er(e)},n=this._parseSync({data:e,path:r.path,parent:r});return Kb(r,n)}"~validate"(e){let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Er(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:t});return An(r)?{value:r.value}:{issues:t.common.issues}}catch(r){if(r?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then((r)=>An(r)?{value:r.value}:{issues:t.common.issues})}async parseAsync(e,t){let r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){let r={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Er(e)},n=this._parse({data:e,path:r.path,parent:r}),s=await(ko(n)?n:Promise.resolve(n));return Kb(r,s)}refine(e,t){let r=(n)=>{if(typeof t==="string"||typeof t>"u")return{message:t};else if(typeof t==="function")return t(n);else return t};return this._refinement((n,s)=>{let o=e(n),i=()=>s.addIssue({code:w.custom,...r(n)});if(typeof Promise<"u"&&o instanceof Promise)return o.then((a)=>{if(!a)return i(),!1;else return!0});if(!o)return i(),!1;else return!0})}refinement(e,t){return this._refinement((r,n)=>{if(!e(r))return n.addIssue(typeof t==="function"?t(r,n):t),!1;else return!0})}_refinement(e){return new lr({schema:this,typeName:K.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:(t)=>this["~validate"](t)}}optional(){return ur.create(this,this._def)}nullable(){return pn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return cr.create(this)}promise(){return Is.create(this,this._def)}or(e){return Io.create([this,e],this._def)}and(e){return Co.create(this,e,this._def)}transform(e){return new lr({...Q(this._def),schema:this,typeName:K.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e==="function"?e:()=>e;return new Mo({...Q(this._def),innerType:this,defaultValue:t,typeName:K.ZodDefault})}brand(){return new Pl({typeName:K.ZodBranded,type:this,...Q(this._def)})}catch(e){let t=typeof e==="function"?e:()=>e;return new Lo({...Q(this._def),innerType:this,catchValue:t,typeName:K.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return rc.create(this,e)}readonly(){return Uo.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}function Bb(e){let t="[0-5]\\d";if(e.precision)t=`${t}\\.\\d{${e.precision}}`;else if(e.precision==null)t=`${t}(\\.\\d+)?`;let r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function mF(e){return new RegExp(`^${Bb(e)}$`)}function gF(e){let t=`${Hb}T${Bb(e)}`,r=[];if(r.push(e.local?"Z?":"Z"),e.offset)r.push("([+-]\\d{2}:?\\d{2})");return t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function yF(e,t){if((t==="v4"||!t)&&cF.test(e))return!0;if((t==="v6"||!t)&&lF.test(e))return!0;return!1}function _F(e,t){if(!sF.test(e))return!1;try{let[r]=e.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),s=JSON.parse(atob(n));if(typeof s!=="object"||s===null)return!1;if("typ"in s&&s?.typ!=="JWT")return!1;if(!s.alg)return!1;if(t&&s.alg!==t)return!1;return!0}catch{return!1}}function vF(e,t){if((t==="v4"||!t)&&uF.test(e))return!0;if((t==="v6"||!t)&&dF.test(e))return!0;return!1}function $F(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,s=r>n?r:n,o=Number.parseInt(e.toFixed(s).replace(".","")),i=Number.parseInt(t.toFixed(s).replace(".",""));return o%i/10**s}function Os(e){if(e instanceof Ce){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=ur.create(Os(n))}return new Ce({...e._def,shape:()=>t})}else if(e instanceof cr)return new cr({...e._def,type:Os(e.element)});else if(e instanceof ur)return ur.create(Os(e.unwrap()));else if(e instanceof pn)return pn.create(Os(e.unwrap()));else if(e instanceof xr)return xr.create(e.items.map((t)=>Os(t)));else return e}function Ol(e,t){let r=Er(e),n=Er(t);if(e===t)return{valid:!0,data:e};else if(r===N.object&&n===N.object){let s=re.objectKeys(t),o=re.objectKeys(e).filter((a)=>s.indexOf(a)!==-1),i={...e,...t};for(let a of o){let c=Ol(e[a],t[a]);if(!c.valid)return{valid:!1};i[a]=c.data}return{valid:!0,data:i}}else if(r===N.array&&n===N.array){if(e.length!==t.length)return{valid:!1};let s=[];for(let o=0;o<e.length;o++){let i=e[o],a=t[o],c=Ol(i,a);if(!c.valid)return{valid:!1};s.push(c.data)}return{valid:!0,data:s}}else if(r===N.date&&n===N.date&&+e===+t)return{valid:!0,data:e};else return{valid:!1}}function Wb(e,t){return new Nn({values:e,typeName:K.ZodEnum,...Q(t)})}var Kb=(e,t)=>{if(An(t))return{success:!0,data:t.value};else{if(!e.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new ft(e.common.issues);return this._error=r,this._error}}}},Z2,eF,tF,rF,nF,sF,oF,iF,aF="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",kl,cF,uF,lF,dF,fF,pF,Hb="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",hF,wr,As,Ps,Ya,Ao,Xa,Po,No,Ja,Pn,Sr,Qa,cr,Ce,Io,br=(e)=>{if(e instanceof jo)return br(e.schema);else if(e instanceof lr)return br(e.innerType());else if(e instanceof qo)return[e.value];else if(e instanceof Nn)return e.options;else if(e instanceof Do)return re.objectValues(e.enum);else if(e instanceof Mo)return br(e._def.innerType);else if(e instanceof Po)return[void 0];else if(e instanceof No)return[null];else if(e instanceof ur)return[void 0,...br(e.unwrap())];else if(e instanceof pn)return[null,...br(e.unwrap())];else if(e instanceof Pl)return br(e.unwrap());else if(e instanceof Uo)return br(e.unwrap());else if(e instanceof Lo)return br(e._def.innerType);else return[]},Al,Co,xr,Za,ec,Ns,Oo,jo,qo,Nn,Do,Is,lr,ur,pn,Mo,Lo,tc,M5,Pl,rc,Uo,L5,K,v,fe,U5,F5,Ue,V5,z5,G5,K5,H5,B5,W5,Y5,Ze,ne,X5,EF,Yb,J5,Q5,bF,Z5,e3,t3,r3,In,Ve,n3,s3,o3,i3,a3,c3,u3;var Xb=F(()=>{Ha();Ba();Gb();Tl();Ro();Z2=/^c[^\s-]{8,}$/i,eF=/^[0-9a-z]+$/,tF=/^[0-9A-HJKMNP-TV-Z]{26}$/i,rF=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,nF=/^[a-z0-9_-]{21}$/i,sF=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,oF=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,iF=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,cF=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,uF=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,lF=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,dF=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,fF=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,pF=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,hF=new RegExp(`^${Hb}$`);wr=class wr extends ee{_parse(e){if(this._def.coerce)e.data=String(e.data);if(this._getType(e)!==N.string){let s=this._getOrReturnCtx(e);return k(s,{code:w.invalid_type,expected:N.string,received:s.parsedType}),G}let r=new Be,n=void 0;for(let s of this._def.checks)if(s.kind==="min"){if(e.data.length<s.value)n=this._getOrReturnCtx(e,n),k(n,{code:w.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty()}else if(s.kind==="max"){if(e.data.length>s.value)n=this._getOrReturnCtx(e,n),k(n,{code:w.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty()}else if(s.kind==="length"){let o=e.data.length>s.value,i=e.data.length<s.value;if(o||i){if(n=this._getOrReturnCtx(e,n),o)k(n,{code:w.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message});else if(i)k(n,{code:w.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message});r.dirty()}}else if(s.kind==="email"){if(!iF.test(e.data))n=this._getOrReturnCtx(e,n),k(n,{validation:"email",code:w.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="emoji"){if(!kl)kl=new RegExp(aF,"u");if(!kl.test(e.data))n=this._getOrReturnCtx(e,n),k(n,{validation:"emoji",code:w.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="uuid"){if(!rF.test(e.data))n=this._getOrReturnCtx(e,n),k(n,{validation:"uuid",code:w.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="nanoid"){if(!nF.test(e.data))n=this._getOrReturnCtx(e,n),k(n,{validation:"nanoid",code:w.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="cuid"){if(!Z2.test(e.data))n=this._getOrReturnCtx(e,n),k(n,{validation:"cuid",code:w.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="cuid2"){if(!eF.test(e.data))n=this._getOrReturnCtx(e,n),k(n,{validation:"cuid2",code:w.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="ulid"){if(!tF.test(e.data))n=this._getOrReturnCtx(e,n),k(n,{validation:"ulid",code:w.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),k(n,{validation:"url",code:w.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="regex"){if(s.regex.lastIndex=0,!s.regex.test(e.data))n=this._getOrReturnCtx(e,n),k(n,{validation:"regex",code:w.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="trim")e.data=e.data.trim();else if(s.kind==="includes"){if(!e.data.includes(s.value,s.position))n=this._getOrReturnCtx(e,n),k(n,{code:w.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),r.dirty()}else if(s.kind==="toLowerCase")e.data=e.data.toLowerCase();else if(s.kind==="toUpperCase")e.data=e.data.toUpperCase();else if(s.kind==="startsWith"){if(!e.data.startsWith(s.value))n=this._getOrReturnCtx(e,n),k(n,{code:w.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()}else if(s.kind==="endsWith"){if(!e.data.endsWith(s.value))n=this._getOrReturnCtx(e,n),k(n,{code:w.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()}else if(s.kind==="datetime"){if(!gF(s).test(e.data))n=this._getOrReturnCtx(e,n),k(n,{code:w.invalid_string,validation:"datetime",message:s.message}),r.dirty()}else if(s.kind==="date"){if(!hF.test(e.data))n=this._getOrReturnCtx(e,n),k(n,{code:w.invalid_string,validation:"date",message:s.message}),r.dirty()}else if(s.kind==="time"){if(!mF(s).test(e.data))n=this._getOrReturnCtx(e,n),k(n,{code:w.invalid_string,validation:"time",message:s.message}),r.dirty()}else if(s.kind==="duration"){if(!oF.test(e.data))n=this._getOrReturnCtx(e,n),k(n,{validation:"duration",code:w.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="ip"){if(!yF(e.data,s.version))n=this._getOrReturnCtx(e,n),k(n,{validation:"ip",code:w.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="jwt"){if(!_F(e.data,s.alg))n=this._getOrReturnCtx(e,n),k(n,{validation:"jwt",code:w.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="cidr"){if(!vF(e.data,s.version))n=this._getOrReturnCtx(e,n),k(n,{validation:"cidr",code:w.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="base64"){if(!fF.test(e.data))n=this._getOrReturnCtx(e,n),k(n,{validation:"base64",code:w.invalid_string,message:s.message}),r.dirty()}else if(s.kind==="base64url"){if(!pF.test(e.data))n=this._getOrReturnCtx(e,n),k(n,{validation:"base64url",code:w.invalid_string,message:s.message}),r.dirty()}else re.assertNever(s);return{status:r.value,value:e.data}}_regex(e,t,r){return this.refinement((n)=>e.test(n),{validation:t,code:w.invalid_string,...D.errToObj(r)})}_addCheck(e){return new wr({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...D.errToObj(e)})}url(e){return this._addCheck({kind:"url",...D.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...D.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...D.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...D.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...D.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...D.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...D.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...D.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...D.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...D.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...D.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...D.errToObj(e)})}datetime(e){if(typeof e==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e});return this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...D.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){if(typeof e==="string")return this._addCheck({kind:"time",precision:null,message:e});return this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...D.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...D.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...D.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...D.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...D.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...D.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...D.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...D.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...D.errToObj(t)})}nonempty(e){return this.min(1,D.errToObj(e))}trim(){return new wr({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new wr({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new wr({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e)=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find((e)=>e.kind==="date")}get isTime(){return!!this._def.checks.find((e)=>e.kind==="time")}get isDuration(){return!!this._def.checks.find((e)=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find((e)=>e.kind==="email")}get isURL(){return!!this._def.checks.find((e)=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find((e)=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find((e)=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find((e)=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find((e)=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find((e)=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find((e)=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find((e)=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find((e)=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find((e)=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find((e)=>e.kind==="base64url")}get minLength(){let e=null;for(let t of this._def.checks)if(t.kind==="min"){if(e===null||t.value>e)e=t.value}return e}get maxLength(){let e=null;for(let t of this._def.checks)if(t.kind==="max"){if(e===null||t.value<e)e=t.value}return e}};wr.create=(e)=>new wr({checks:[],typeName:K.ZodString,coerce:e?.coerce??!1,...Q(e)});As=class As extends ee{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce)e.data=Number(e.data);if(this._getType(e)!==N.number){let s=this._getOrReturnCtx(e);return k(s,{code:w.invalid_type,expected:N.number,received:s.parsedType}),G}let r=void 0,n=new Be;for(let s of this._def.checks)if(s.kind==="int"){if(!re.isInteger(e.data))r=this._getOrReturnCtx(e,r),k(r,{code:w.invalid_type,expected:"integer",received:"float",message:s.message}),n.dirty()}else if(s.kind==="min"){if(s.inclusive?e.data<s.value:e.data<=s.value)r=this._getOrReturnCtx(e,r),k(r,{code:w.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),n.dirty()}else if(s.kind==="max"){if(s.inclusive?e.data>s.value:e.data>=s.value)r=this._getOrReturnCtx(e,r),k(r,{code:w.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),n.dirty()}else if(s.kind==="multipleOf"){if($F(e.data,s.value)!==0)r=this._getOrReturnCtx(e,r),k(r,{code:w.not_multiple_of,multipleOf:s.value,message:s.message}),n.dirty()}else if(s.kind==="finite"){if(!Number.isFinite(e.data))r=this._getOrReturnCtx(e,r),k(r,{code:w.not_finite,message:s.message}),n.dirty()}else re.assertNever(s);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,D.toString(t))}gt(e,t){return this.setLimit("min",e,!1,D.toString(t))}lte(e,t){return this.setLimit("max",e,!0,D.toString(t))}lt(e,t){return this.setLimit("max",e,!1,D.toString(t))}setLimit(e,t,r,n){return new As({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:D.toString(n)}]})}_addCheck(e){return new As({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:D.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:D.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:D.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:D.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:D.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:D.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:D.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:D.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:D.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)if(t.kind==="min"){if(e===null||t.value>e)e=t.value}return e}get maxValue(){let e=null;for(let t of this._def.checks)if(t.kind==="max"){if(e===null||t.value<e)e=t.value}return e}get isInt(){return!!this._def.checks.find((e)=>e.kind==="int"||e.kind==="multipleOf"&&re.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let r of this._def.checks)if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;else if(r.kind==="min"){if(t===null||r.value>t)t=r.value}else if(r.kind==="max"){if(e===null||r.value<e)e=r.value}return Number.isFinite(t)&&Number.isFinite(e)}};As.create=(e)=>new As({checks:[],typeName:K.ZodNumber,coerce:e?.coerce||!1,...Q(e)});Ps=class Ps extends ee{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==N.bigint)return this._getInvalidInput(e);let r=void 0,n=new Be;for(let s of this._def.checks)if(s.kind==="min"){if(s.inclusive?e.data<s.value:e.data<=s.value)r=this._getOrReturnCtx(e,r),k(r,{code:w.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),n.dirty()}else if(s.kind==="max"){if(s.inclusive?e.data>s.value:e.data>=s.value)r=this._getOrReturnCtx(e,r),k(r,{code:w.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),n.dirty()}else if(s.kind==="multipleOf"){if(e.data%s.value!==BigInt(0))r=this._getOrReturnCtx(e,r),k(r,{code:w.not_multiple_of,multipleOf:s.value,message:s.message}),n.dirty()}else re.assertNever(s);return{status:n.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return k(t,{code:w.invalid_type,expected:N.bigint,received:t.parsedType}),G}gte(e,t){return this.setLimit("min",e,!0,D.toString(t))}gt(e,t){return this.setLimit("min",e,!1,D.toString(t))}lte(e,t){return this.setLimit("max",e,!0,D.toString(t))}lt(e,t){return this.setLimit("max",e,!1,D.toString(t))}setLimit(e,t,r,n){return new Ps({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:D.toString(n)}]})}_addCheck(e){return new Ps({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:D.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:D.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:D.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:D.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:D.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)if(t.kind==="min"){if(e===null||t.value>e)e=t.value}return e}get maxValue(){let e=null;for(let t of this._def.checks)if(t.kind==="max"){if(e===null||t.value<e)e=t.value}return e}};Ps.create=(e)=>new Ps({checks:[],typeName:K.ZodBigInt,coerce:e?.coerce??!1,...Q(e)});Ya=class Ya extends ee{_parse(e){if(this._def.coerce)e.data=Boolean(e.data);if(this._getType(e)!==N.boolean){let r=this._getOrReturnCtx(e);return k(r,{code:w.invalid_type,expected:N.boolean,received:r.parsedType}),G}return Qe(e.data)}};Ya.create=(e)=>new Ya({typeName:K.ZodBoolean,coerce:e?.coerce||!1,...Q(e)});Ao=class Ao extends ee{_parse(e){if(this._def.coerce)e.data=new Date(e.data);if(this._getType(e)!==N.date){let s=this._getOrReturnCtx(e);return k(s,{code:w.invalid_type,expected:N.date,received:s.parsedType}),G}if(Number.isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return k(s,{code:w.invalid_date}),G}let r=new Be,n=void 0;for(let s of this._def.checks)if(s.kind==="min"){if(e.data.getTime()<s.value)n=this._getOrReturnCtx(e,n),k(n,{code:w.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()}else if(s.kind==="max"){if(e.data.getTime()>s.value)n=this._getOrReturnCtx(e,n),k(n,{code:w.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()}else re.assertNever(s);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Ao({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:D.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:D.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)if(t.kind==="min"){if(e===null||t.value>e)e=t.value}return e!=null?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)if(t.kind==="max"){if(e===null||t.value<e)e=t.value}return e!=null?new Date(e):null}};Ao.create=(e)=>new Ao({checks:[],coerce:e?.coerce||!1,typeName:K.ZodDate,...Q(e)});Xa=class Xa extends ee{_parse(e){if(this._getType(e)!==N.symbol){let r=this._getOrReturnCtx(e);return k(r,{code:w.invalid_type,expected:N.symbol,received:r.parsedType}),G}return Qe(e.data)}};Xa.create=(e)=>new Xa({typeName:K.ZodSymbol,...Q(e)});Po=class Po extends ee{_parse(e){if(this._getType(e)!==N.undefined){let r=this._getOrReturnCtx(e);return k(r,{code:w.invalid_type,expected:N.undefined,received:r.parsedType}),G}return Qe(e.data)}};Po.create=(e)=>new Po({typeName:K.ZodUndefined,...Q(e)});No=class No extends ee{_parse(e){if(this._getType(e)!==N.null){let r=this._getOrReturnCtx(e);return k(r,{code:w.invalid_type,expected:N.null,received:r.parsedType}),G}return Qe(e.data)}};No.create=(e)=>new No({typeName:K.ZodNull,...Q(e)});Ja=class Ja extends ee{constructor(){super(...arguments);this._any=!0}_parse(e){return Qe(e.data)}};Ja.create=(e)=>new Ja({typeName:K.ZodAny,...Q(e)});Pn=class Pn extends ee{constructor(){super(...arguments);this._unknown=!0}_parse(e){return Qe(e.data)}};Pn.create=(e)=>new Pn({typeName:K.ZodUnknown,...Q(e)});Sr=class Sr extends ee{_parse(e){let t=this._getOrReturnCtx(e);return k(t,{code:w.invalid_type,expected:N.never,received:t.parsedType}),G}};Sr.create=(e)=>new Sr({typeName:K.ZodNever,...Q(e)});Qa=class Qa extends ee{_parse(e){if(this._getType(e)!==N.undefined){let r=this._getOrReturnCtx(e);return k(r,{code:w.invalid_type,expected:N.void,received:r.parsedType}),G}return Qe(e.data)}};Qa.create=(e)=>new Qa({typeName:K.ZodVoid,...Q(e)});cr=class cr extends ee{_parse(e){let{ctx:t,status:r}=this._processInputParams(e),n=this._def;if(t.parsedType!==N.array)return k(t,{code:w.invalid_type,expected:N.array,received:t.parsedType}),G;if(n.exactLength!==null){let o=t.data.length>n.exactLength.value,i=t.data.length<n.exactLength.value;if(o||i)k(t,{code:o?w.too_big:w.too_small,minimum:i?n.exactLength.value:void 0,maximum:o?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),r.dirty()}if(n.minLength!==null){if(t.data.length<n.minLength.value)k(t,{code:w.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),r.dirty()}if(n.maxLength!==null){if(t.data.length>n.maxLength.value)k(t,{code:w.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),r.dirty()}if(t.common.async)return Promise.all([...t.data].map((o,i)=>n.type._parseAsync(new At(t,o,t.path,i)))).then((o)=>Be.mergeArray(r,o));let s=[...t.data].map((o,i)=>n.type._parseSync(new At(t,o,t.path,i)));return Be.mergeArray(r,s)}get element(){return this._def.type}min(e,t){return new cr({...this._def,minLength:{value:e,message:D.toString(t)}})}max(e,t){return new cr({...this._def,maxLength:{value:e,message:D.toString(t)}})}length(e,t){return new cr({...this._def,exactLength:{value:e,message:D.toString(t)}})}nonempty(e){return this.min(1,e)}};cr.create=(e,t)=>new cr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:K.ZodArray,...Q(t)});Ce=class Ce extends ee{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=re.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==N.object){let c=this._getOrReturnCtx(e);return k(c,{code:w.invalid_type,expected:N.object,received:c.parsedType}),G}let{status:r,ctx:n}=this._processInputParams(e),{shape:s,keys:o}=this._getCached(),i=[];if(!(this._def.catchall instanceof Sr&&this._def.unknownKeys==="strip")){for(let c in n.data)if(!o.includes(c))i.push(c)}let a=[];for(let c of o){let u=s[c],d=n.data[c];a.push({key:{status:"valid",value:c},value:u._parse(new At(n,d,n.path,c)),alwaysSet:c in n.data})}if(this._def.catchall instanceof Sr){let c=this._def.unknownKeys;if(c==="passthrough")for(let u of i)a.push({key:{status:"valid",value:u},value:{status:"valid",value:n.data[u]}});else if(c==="strict"){if(i.length>0)k(n,{code:w.unrecognized_keys,keys:i}),r.dirty()}else if(c==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let u of i){let d=n.data[u];a.push({key:{status:"valid",value:u},value:c._parse(new At(n,d,n.path,u)),alwaysSet:u in n.data})}}if(n.common.async)return Promise.resolve().then(async()=>{let c=[];for(let u of a){let d=await u.key,l=await u.value;c.push({key:d,value:l,alwaysSet:u.alwaysSet})}return c}).then((c)=>Be.mergeObjectSync(r,c));else return Be.mergeObjectSync(r,a)}get shape(){return this._def.shape()}strict(e){return D.errToObj,new Ce({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,r)=>{let n=this._def.errorMap?.(t,r).message??r.defaultError;if(t.code==="unrecognized_keys")return{message:D.errToObj(e).message??n};return{message:n}}}:{}})}strip(){return new Ce({...this._def,unknownKeys:"strip"})}passthrough(){return new Ce({...this._def,unknownKeys:"passthrough"})}extend(e){return new Ce({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Ce({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:K.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Ce({...this._def,catchall:e})}pick(e){let t={};for(let r of re.objectKeys(e))if(e[r]&&this.shape[r])t[r]=this.shape[r];return new Ce({...this._def,shape:()=>t})}omit(e){let t={};for(let r of re.objectKeys(this.shape))if(!e[r])t[r]=this.shape[r];return new Ce({...this._def,shape:()=>t})}deepPartial(){return Os(this)}partial(e){let t={};for(let r of re.objectKeys(this.shape)){let n=this.shape[r];if(e&&!e[r])t[r]=n;else t[r]=n.optional()}return new Ce({...this._def,shape:()=>t})}required(e){let t={};for(let r of re.objectKeys(this.shape))if(e&&!e[r])t[r]=this.shape[r];else{let s=this.shape[r];while(s instanceof ur)s=s._def.innerType;t[r]=s}return new Ce({...this._def,shape:()=>t})}keyof(){return Wb(re.objectKeys(this.shape))}};Ce.create=(e,t)=>new Ce({shape:()=>e,unknownKeys:"strip",catchall:Sr.create(),typeName:K.ZodObject,...Q(t)});Ce.strictCreate=(e,t)=>new Ce({shape:()=>e,unknownKeys:"strict",catchall:Sr.create(),typeName:K.ZodObject,...Q(t)});Ce.lazycreate=(e,t)=>new Ce({shape:e,unknownKeys:"strip",catchall:Sr.create(),typeName:K.ZodObject,...Q(t)});Io=class Io extends ee{_parse(e){let{ctx:t}=this._processInputParams(e),r=this._def.options;function n(s){for(let i of s)if(i.result.status==="valid")return i.result;for(let i of s)if(i.result.status==="dirty")return t.common.issues.push(...i.ctx.common.issues),i.result;let o=s.map((i)=>new ft(i.ctx.common.issues));return k(t,{code:w.invalid_union,unionErrors:o}),G}if(t.common.async)return Promise.all(r.map(async(s)=>{let o={...t,common:{...t.common,issues:[]},parent:null};return{result:await s._parseAsync({data:t.data,path:t.path,parent:o}),ctx:o}})).then(n);else{let s=void 0,o=[];for(let a of r){let c={...t,common:{...t.common,issues:[]},parent:null},u=a._parseSync({data:t.data,path:t.path,parent:c});if(u.status==="valid")return u;else if(u.status==="dirty"&&!s)s={result:u,ctx:c};if(c.common.issues.length)o.push(c.common.issues)}if(s)return t.common.issues.push(...s.ctx.common.issues),s.result;let i=o.map((a)=>new ft(a));return k(t,{code:w.invalid_union,unionErrors:i}),G}}get options(){return this._def.options}};Io.create=(e,t)=>new Io({options:e,typeName:K.ZodUnion,...Q(t)});Al=class Al extends ee{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==N.object)return k(t,{code:w.invalid_type,expected:N.object,received:t.parsedType}),G;let r=this.discriminator,n=t.data[r],s=this.optionsMap.get(n);if(!s)return k(t,{code:w.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),G;if(t.common.async)return s._parseAsync({data:t.data,path:t.path,parent:t});else return s._parseSync({data:t.data,path:t.path,parent:t})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){let n=new Map;for(let s of t){let o=br(s.shape[e]);if(!o.length)throw Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let i of o){if(n.has(i))throw Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);n.set(i,s)}}return new Al({typeName:K.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...Q(r)})}};Co=class Co extends ee{_parse(e){let{status:t,ctx:r}=this._processInputParams(e),n=(s,o)=>{if(xl(s)||xl(o))return G;let i=Ol(s.value,o.value);if(!i.valid)return k(r,{code:w.invalid_intersection_types}),G;if(Rl(s)||Rl(o))t.dirty();return{status:t.value,value:i.data}};if(r.common.async)return Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,o])=>n(s,o));else return n(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};Co.create=(e,t,r)=>new Co({left:e,right:t,typeName:K.ZodIntersection,...Q(r)});xr=class xr extends ee{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==N.array)return k(r,{code:w.invalid_type,expected:N.array,received:r.parsedType}),G;if(r.data.length<this._def.items.length)return k(r,{code:w.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),G;if(!this._def.rest&&r.data.length>this._def.items.length)k(r,{code:w.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty();let s=[...r.data].map((o,i)=>{let a=this._def.items[i]||this._def.rest;if(!a)return null;return a._parse(new At(r,o,r.path,i))}).filter((o)=>!!o);if(r.common.async)return Promise.all(s).then((o)=>Be.mergeArray(t,o));else return Be.mergeArray(t,s)}get items(){return this._def.items}rest(e){return new xr({...this._def,rest:e})}};xr.create=(e,t)=>{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new xr({items:e,typeName:K.ZodTuple,rest:null,...Q(t)})};Za=class Za extends ee{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==N.object)return k(r,{code:w.invalid_type,expected:N.object,received:r.parsedType}),G;let n=[],s=this._def.keyType,o=this._def.valueType;for(let i in r.data)n.push({key:s._parse(new At(r,i,r.path,i)),value:o._parse(new At(r,r.data[i],r.path,i)),alwaysSet:i in r.data});if(r.common.async)return Be.mergeObjectAsync(t,n);else return Be.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,r){if(t instanceof ee)return new Za({keyType:e,valueType:t,typeName:K.ZodRecord,...Q(r)});return new Za({keyType:wr.create(),valueType:e,typeName:K.ZodRecord,...Q(t)})}};ec=class ec extends ee{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==N.map)return k(r,{code:w.invalid_type,expected:N.map,received:r.parsedType}),G;let n=this._def.keyType,s=this._def.valueType,o=[...r.data.entries()].map(([i,a],c)=>({key:n._parse(new At(r,i,r.path,[c,"key"])),value:s._parse(new At(r,a,r.path,[c,"value"]))}));if(r.common.async){let i=new Map;return Promise.resolve().then(async()=>{for(let a of o){let c=await a.key,u=await a.value;if(c.status==="aborted"||u.status==="aborted")return G;if(c.status==="dirty"||u.status==="dirty")t.dirty();i.set(c.value,u.value)}return{status:t.value,value:i}})}else{let i=new Map;for(let a of o){let{key:c,value:u}=a;if(c.status==="aborted"||u.status==="aborted")return G;if(c.status==="dirty"||u.status==="dirty")t.dirty();i.set(c.value,u.value)}return{status:t.value,value:i}}}};ec.create=(e,t,r)=>new ec({valueType:t,keyType:e,typeName:K.ZodMap,...Q(r)});Ns=class Ns extends ee{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==N.set)return k(r,{code:w.invalid_type,expected:N.set,received:r.parsedType}),G;let n=this._def;if(n.minSize!==null){if(r.data.size<n.minSize.value)k(r,{code:w.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()}if(n.maxSize!==null){if(r.data.size>n.maxSize.value)k(r,{code:w.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty()}let s=this._def.valueType;function o(a){let c=new Set;for(let u of a){if(u.status==="aborted")return G;if(u.status==="dirty")t.dirty();c.add(u.value)}return{status:t.value,value:c}}let i=[...r.data.values()].map((a,c)=>s._parse(new At(r,a,r.path,c)));if(r.common.async)return Promise.all(i).then((a)=>o(a));else return o(i)}min(e,t){return new Ns({...this._def,minSize:{value:e,message:D.toString(t)}})}max(e,t){return new Ns({...this._def,maxSize:{value:e,message:D.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};Ns.create=(e,t)=>new Ns({valueType:e,minSize:null,maxSize:null,typeName:K.ZodSet,...Q(t)});Oo=class Oo extends ee{constructor(){super(...arguments);this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==N.function)return k(t,{code:w.invalid_type,expected:N.function,received:t.parsedType}),G;function r(i,a){return Wa({data:i,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,To(),fn].filter((c)=>!!c),issueData:{code:w.invalid_arguments,argumentsError:a}})}function n(i,a){return Wa({data:i,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,To(),fn].filter((c)=>!!c),issueData:{code:w.invalid_return_type,returnTypeError:a}})}let s={errorMap:t.common.contextualErrorMap},o=t.data;if(this._def.returns instanceof Is){let i=this;return Qe(async function(...a){let c=new ft([]),u=await i._def.args.parseAsync(a,s).catch((p)=>{throw c.addIssue(r(a,p)),c}),d=await Reflect.apply(o,this,u);return await i._def.returns._def.type.parseAsync(d,s).catch((p)=>{throw c.addIssue(n(d,p)),c})})}else{let i=this;return Qe(function(...a){let c=i._def.args.safeParse(a,s);if(!c.success)throw new ft([r(a,c.error)]);let u=Reflect.apply(o,this,c.data),d=i._def.returns.safeParse(u,s);if(!d.success)throw new ft([n(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Oo({...this._def,args:xr.create(e).rest(Pn.create())})}returns(e){return new Oo({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new Oo({args:e?e:xr.create([]).rest(Pn.create()),returns:t||Pn.create(),typeName:K.ZodFunction,...Q(r)})}};jo=class jo extends ee{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};jo.create=(e,t)=>new jo({getter:e,typeName:K.ZodLazy,...Q(t)});qo=class qo extends ee{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return k(t,{received:t.data,code:w.invalid_literal,expected:this._def.value}),G}return{status:"valid",value:e.data}}get value(){return this._def.value}};qo.create=(e,t)=>new qo({value:e,typeName:K.ZodLiteral,...Q(t)});Nn=class Nn extends ee{_parse(e){if(typeof e.data!=="string"){let t=this._getOrReturnCtx(e),r=this._def.values;return k(t,{expected:re.joinValues(r),received:t.parsedType,code:w.invalid_type}),G}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),r=this._def.values;return k(t,{received:t.data,code:w.invalid_enum_value,options:r}),G}return Qe(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return Nn.create(e,{...this._def,...t})}exclude(e,t=this._def){return Nn.create(this.options.filter((r)=>!e.includes(r)),{...this._def,...t})}};Nn.create=Wb;Do=class Do extends ee{_parse(e){let t=re.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==N.string&&r.parsedType!==N.number){let n=re.objectValues(t);return k(r,{expected:re.joinValues(n),received:r.parsedType,code:w.invalid_type}),G}if(!this._cache)this._cache=new Set(re.getValidEnumValues(this._def.values));if(!this._cache.has(e.data)){let n=re.objectValues(t);return k(r,{received:r.data,code:w.invalid_enum_value,options:n}),G}return Qe(e.data)}get enum(){return this._def.values}};Do.create=(e,t)=>new Do({values:e,typeName:K.ZodNativeEnum,...Q(t)});Is=class Is extends ee{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==N.promise&&t.common.async===!1)return k(t,{code:w.invalid_type,expected:N.promise,received:t.parsedType}),G;let r=t.parsedType===N.promise?t.data:Promise.resolve(t.data);return Qe(r.then((n)=>this._def.type.parseAsync(n,{path:t.path,errorMap:t.common.contextualErrorMap})))}};Is.create=(e,t)=>new Is({type:e,typeName:K.ZodPromise,...Q(t)});lr=class lr extends ee{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===K.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:r}=this._processInputParams(e),n=this._def.effect||null,s={addIssue:(o)=>{if(k(r,o),o.fatal)t.abort();else t.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),n.type==="preprocess"){let o=n.transform(r.data,s);if(r.common.async)return Promise.resolve(o).then(async(i)=>{if(t.value==="aborted")return G;let a=await this._def.schema._parseAsync({data:i,path:r.path,parent:r});if(a.status==="aborted")return G;if(a.status==="dirty")return ks(a.value);if(t.value==="dirty")return ks(a.value);return a});else{if(t.value==="aborted")return G;let i=this._def.schema._parseSync({data:o,path:r.path,parent:r});if(i.status==="aborted")return G;if(i.status==="dirty")return ks(i.value);if(t.value==="dirty")return ks(i.value);return i}}if(n.type==="refinement"){let o=(i)=>{let a=n.refinement(i,s);if(r.common.async)return Promise.resolve(a);if(a instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return i};if(r.common.async===!1){let i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(i.status==="aborted")return G;if(i.status==="dirty")t.dirty();return o(i.value),{status:t.value,value:i.value}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((i)=>{if(i.status==="aborted")return G;if(i.status==="dirty")t.dirty();return o(i.value).then(()=>({status:t.value,value:i.value}))})}if(n.type==="transform")if(r.common.async===!1){let o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!An(o))return G;let i=n.transform(o.value,s);if(i instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:i}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((o)=>{if(!An(o))return G;return Promise.resolve(n.transform(o.value,s)).then((i)=>({status:t.value,value:i}))});re.assertNever(n)}};lr.create=(e,t,r)=>new lr({schema:e,typeName:K.ZodEffects,effect:t,...Q(r)});lr.createWithPreprocess=(e,t,r)=>new lr({schema:t,effect:{type:"preprocess",transform:e},typeName:K.ZodEffects,...Q(r)});ur=class ur extends ee{_parse(e){if(this._getType(e)===N.undefined)return Qe(void 0);return this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};ur.create=(e,t)=>new ur({innerType:e,typeName:K.ZodOptional,...Q(t)});pn=class pn extends ee{_parse(e){if(this._getType(e)===N.null)return Qe(null);return this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};pn.create=(e,t)=>new pn({innerType:e,typeName:K.ZodNullable,...Q(t)});Mo=class Mo extends ee{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;if(t.parsedType===N.undefined)r=this._def.defaultValue();return this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};Mo.create=(e,t)=>new Mo({innerType:e,typeName:K.ZodDefault,defaultValue:typeof t.default==="function"?t.default:()=>t.default,...Q(t)});Lo=class Lo extends ee{_parse(e){let{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});if(ko(n))return n.then((s)=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new ft(r.common.issues)},input:r.data})}));else return{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new ft(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};Lo.create=(e,t)=>new Lo({innerType:e,typeName:K.ZodCatch,catchValue:typeof t.catch==="function"?t.catch:()=>t.catch,...Q(t)});tc=class tc extends ee{_parse(e){if(this._getType(e)!==N.nan){let r=this._getOrReturnCtx(e);return k(r,{code:w.invalid_type,expected:N.nan,received:r.parsedType}),G}return{status:"valid",value:e.data}}};tc.create=(e)=>new tc({typeName:K.ZodNaN,...Q(e)});M5=Symbol("zod_brand");Pl=class Pl extends ee{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}};rc=class rc extends ee{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{let s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});if(s.status==="aborted")return G;if(s.status==="dirty")return t.dirty(),ks(s.value);else return this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();else{let n=this._def.in._parseSync({data:r.data,path:r.path,parent:r});if(n.status==="aborted")return G;if(n.status==="dirty")return t.dirty(),{status:"dirty",value:n.value};else return this._def.out._parseSync({data:n.value,path:r.path,parent:r})}}static create(e,t){return new rc({in:e,out:t,typeName:K.ZodPipeline})}};Uo=class Uo extends ee{_parse(e){let t=this._def.innerType._parse(e),r=(n)=>{if(An(n))n.value=Object.freeze(n.value);return n};return ko(t)?t.then((n)=>r(n)):r(t)}unwrap(){return this._def.innerType}};Uo.create=(e,t)=>new Uo({innerType:e,typeName:K.ZodReadonly,...Q(t)});L5={object:Ce.lazycreate};(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(K||(K={}));v=wr.create,fe=As.create,U5=tc.create,F5=Ps.create,Ue=Ya.create,V5=Ao.create,z5=Xa.create,G5=Po.create,K5=No.create,H5=Ja.create,B5=Pn.create,W5=Sr.create,Y5=Qa.create,Ze=cr.create,ne=Ce.create,X5=Ce.strictCreate,EF=Io.create,Yb=Al.create,J5=Co.create,Q5=xr.create,bF=Za.create,Z5=ec.create,e3=Ns.create,t3=Oo.create,r3=jo.create,In=qo.create,Ve=Nn.create,n3=Do.create,s3=Is.create,o3=lr.create,i3=ur.create,a3=pn.create,c3=lr.createWithPreprocess,u3=rc.create});var Nl=F(()=>{Ba();Tl();zb();Ro();Xb();Ha()});var jn=F(()=>{Nl();Nl()});function $3(e){return SF.includes(e)}var wF,qn,SF,E3,xF,Jb,RF,Qb,TF,kF,b3,OF,w3,S3,x3,R3,AF,Zb,PF,ew,T3=20,k3=500,NF,O3;var nc=F(()=>{jn();wF=Ve(["pending","verified","approved","revoked"]),qn=Ve(["person","service","test"]),SF=qn.options;E3={nemarOwner:"service",nemarAdmin:"service","test-admin":"service","test-owner":"service","cool-vibers":"test","test-user":"test","test-pending":"test","test-verified":"test","test-revoked":"test"},xF=Ve(["same_kind","orcid_linked","own_account","kind_changed_concurrently"]),Jb=xF.options,RF=Ve(["active","pending","revoked"]),Qb=ne({field:v(),blocks:Ze(v()).optional(),set_on:Ze(v()).optional()}).passthrough(),TF=ne({id:fe().int(),username:v().nullable(),email:v(),github_username:v().nullable(),role:v(),orcid:v().nullable().optional(),created_at:v().optional(),approved_at:v().nullable().optional(),dataset_count:fe().int().optional(),sandbox_completed:Ue().optional(),sandbox_completed_at:v().nullable().optional(),sandbox_dataset_id:v().nullable().optional(),service_access:Ue().optional(),status:wF.optional(),email_verified:Ue().optional(),orcid_verified:Ue().optional(),given_name:v().nullable().optional(),family_name:v().nullable().optional(),profile_gaps:Ze(Qb).optional(),username_auto_assigned:Ue().optional(),account_kind:qn.optional()}).passthrough(),kF=ne({prefix:v(),created_at:v(),last_used_at:v().nullable()}).passthrough().nullable(),b3=ne({user:TF,token:kF.optional()}).passthrough(),OF=ne({id:fe().int(),username:v().nullable(),email:v(),github_username:v().nullable(),status:v(),email_verified:fe().int().nullable().optional(),role:v().nullable(),created_at:v(),approved_at:v().nullable().optional(),revoked_at:v().nullable().optional(),signup_source:v().nullable().optional(),service_access:fe().int().nullable().optional(),service_access_granted_at:v().nullable().optional(),given_name:v().nullable().optional(),family_name:v().nullable().optional(),orcid:v().nullable().optional(),upload_access_requested_at:v().nullable().optional(),account_kind:qn.optional(),matched_in:Ze(v()).optional(),match_kind:v().optional()}).passthrough(),w3=ne({users:Ze(OF),count:fe().int()}).passthrough(),S3=Ve(["assigned","would_assign","single_name","no_name","lookup_failed","conflict","exhausted","write_failed"]),x3=Ve(["sent","already_verified","skipped_fence","rate_limited","failed","not_attempted"]),R3=ne({suggestion:v().nullable(),based_on:Ve(["name","unavailable","exhausted"])}).passthrough(),AF=Ve(["why_required","email_not_verified","profile_incomplete","github_username_unverified","github_unavailable","already_approved"]),Zb=AF.options,PF=Ve(["invalid_github_username","city_required","country_required","empty_patch","username_too_short","username_too_long","username_charset","given_name_required","family_name_required","username_taken","username_locked","name_is_orcid_canonical","account_revoked","github_unavailable","same_email","code_expired","code_incorrect","orcid_already_have","orcid_unavailable"]),ew=PF.options,NF=ne({id:fe().int(),email:v(),username:v().nullable(),role:v(),status:RF,email_verified:Ue(),given_name:v().nullable(),family_name:v().nullable(),orcid:v().nullable(),orcid_verified:Ue(),github_username:v().nullable(),city:v().nullable(),country:v().nullable(),affiliation:v().nullable(),service_access:Ue(),service_access_granted_at:v().nullable(),upload_access_requested_at:v().nullable(),profile_gaps:Ze(Qb),username_auto_assigned:Ue()}).passthrough(),O3=ne({user:NF.nullable()}).passthrough()});function dr(e){if(e instanceof Error)return e.message;return String(e)}function P3(e){if(!(e instanceof fr)||e.statusCode!==404)return!1;let t=e.rawBody;return typeof t==="object"&&t!==null&&t.error==="Not Found"&&typeof t.message==="string"}var fr,Il;var Cl=F(()=>{fr=class fr extends Error{statusCode;details;step;blockReason;missing;code;reason;rawBody;constructor(e,t,r,n,s,o){super(t);this.statusCode=e;this.details=r;this.step=n;this.blockReason=s;this.missing=o;this.name="ApiError"}};Il=class Il extends fr{mode;eta;constructor(e,t,r,n){super(503,t,n);this.mode=e;this.eta=r;this.name="MaintenanceError"}}});function jF(){let e=new Map;for(let[t,r]of Object.entries(be)){for(let[n,s]of Object.entries(r))be[n]={open:`\x1B[${s[0]}m`,close:`\x1B[${s[1]}m`},r[n]=be[n],e.set(s[0],s[1]);Object.defineProperty(be,t,{value:r,enumerable:!1})}return Object.defineProperty(be,"codes",{value:e,enumerable:!1}),be.color.close="\x1B[39m",be.bgColor.close="\x1B[49m",be.color.ansi=tw(),be.color.ansi256=rw(),be.color.ansi16m=nw(),be.bgColor.ansi=tw(10),be.bgColor.ansi256=rw(10),be.bgColor.ansi16m=nw(10),Object.defineProperties(be,{rgbToAnsi256:{value(t,r,n){if(t===r&&r===n){if(t<8)return 16;if(t>248)return 231;return Math.round((t-8)/247*24)+232}return 16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(t){let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!r)return[0,0,0];let[n]=r;if(n.length===3)n=[...n].map((o)=>o+o).join("");let s=Number.parseInt(n,16);return[s>>16&255,s>>8&255,s&255]},enumerable:!1},hexToAnsi256:{value:(t)=>be.rgbToAnsi256(...be.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value(t){if(t<8)return 30+t;if(t<16)return 90+(t-8);let r,n,s;if(t>=232)r=((t-232)*10+8)/255,n=r,s=r;else{t-=16;let a=t%36;r=Math.floor(t/36)/5,n=Math.floor(a/6)/5,s=a%6/5}let o=Math.max(r,n,s)*2;if(o===0)return 30;let i=30+(Math.round(s)<<2|Math.round(n)<<1|Math.round(r));if(o===2)i+=60;return i},enumerable:!1},rgbToAnsi:{value:(t,r,n)=>be.ansi256ToAnsi(be.rgbToAnsi256(t,r,n)),enumerable:!1},hexToAnsi:{value:(t)=>be.ansi256ToAnsi(be.hexToAnsi256(t)),enumerable:!1}}),be}var tw=(e=0)=>(t)=>`\x1B[${t+e}m`,rw=(e=0)=>(t)=>`\x1B[${38+e};5;${t}m`,nw=(e=0)=>(t,r,n)=>`\x1B[${38+e};2;${t};${r};${n}m`,be,I3,IF,CF,C3,qF,Pt;var sw=F(()=>{be={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},I3=Object.keys(be.modifier),IF=Object.keys(be.color),CF=Object.keys(be.bgColor),C3=[...IF,...CF];qF=jF(),Pt=qF});import jl from"process";import DF from"os";import ow from"tty";function wt(e,t=globalThis.Deno?globalThis.Deno.args:jl.argv){let r=e.startsWith("-")?"":e.length===1?"-":"--",n=t.indexOf(r+e),s=t.indexOf("--");return n!==-1&&(s===-1||n<s)}function MF(){if("FORCE_COLOR"in we){if(we.FORCE_COLOR==="true")return 1;if(we.FORCE_COLOR==="false")return 0;return we.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(we.FORCE_COLOR,10),3)}}function LF(e){if(e===0)return!1;return{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function UF(e,{streamIsTTY:t,sniffFlags:r=!0}={}){let n=MF();if(n!==void 0)sc=n;let s=r?sc:n;if(s===0)return 0;if(r){if(wt("color=16m")||wt("color=full")||wt("color=truecolor"))return 3;if(wt("color=256"))return 2}if("TF_BUILD"in we&&"AGENT_NAME"in we)return 1;if(e&&!t&&s===void 0)return 0;let o=s||0;if(we.TERM==="dumb")return o;if(jl.platform==="win32"){let i=DF.release().split(".");if(Number(i[0])>=10&&Number(i[2])>=10586)return Number(i[2])>=14931?3:2;return 1}if("CI"in we){if(["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some((i)=>(i in we)))return 3;if(["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some((i)=>(i in we))||we.CI_NAME==="codeship")return 1;return o}if("TEAMCITY_VERSION"in we)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(we.TEAMCITY_VERSION)?1:0;if(we.COLORTERM==="truecolor")return 3;if(we.TERM==="xterm-kitty")return 3;if(we.TERM==="xterm-ghostty")return 3;if(we.TERM==="wezterm")return 3;if("TERM_PROGRAM"in we){let i=Number.parseInt((we.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(we.TERM_PROGRAM){case"iTerm.app":return i>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(we.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(we.TERM))return 1;if("COLORTERM"in we)return 1;return o}function iw(e,t={}){let r=UF(e,{streamIsTTY:e&&e.isTTY,...t});return LF(r)}var we,sc,FF,aw;var cw=F(()=>{({env:we}=jl);if(wt("no-color")||wt("no-colors")||wt("color=false")||wt("color=never"))sc=0;else if(wt("color")||wt("colors")||wt("color=true")||wt("color=always"))sc=1;FF={stdout:iw({isTTY:ow.isatty(1)}),stderr:iw({isTTY:ow.isatty(2)})},aw=FF});function uw(e,t,r){let n=e.indexOf(t);if(n===-1)return e;let s=t.length,o=0,i="";do i+=e.slice(o,n)+t+r,o=n+s,n=e.indexOf(t,o);while(n!==-1);return i+=e.slice(o),i}function lw(e,t,r,n){let s=0,o="";do{let i=e[n-1]==="\r";o+=e.slice(s,i?n-1:n)+t+(i?`\r
19
19
  `:`
20
20
  `)+r,s=n+1,n=e.indexOf(`
21
- `,s)}while(n!==-1);return o+=e.slice(s),o}function Vo(e){return zF(e)}var db,fb,Dl,Cs,Fo,pb,js,VF=(e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw Error("The `level` option should be an integer from 0 to 3");let r=db?db.level:0;e.level=t.level===void 0?r:t.level},zF=(e)=>{let t=(...r)=>r.join(" ");return VF(t,e),Object.setPrototypeOf(t,Vo.prototype),t},Ml=(e,t,r,...n)=>{if(e==="rgb"){if(t==="ansi16m")return Pt[r].ansi16m(...n);if(t==="ansi256")return Pt[r].ansi256(Pt.rgbToAnsi256(...n));return Pt[r].ansi(Pt.rgbToAnsi(...n))}if(e==="hex")return Ml("rgb",t,r,...Pt.hexToRgb(...n));return Pt[r][e](...n)},GF,KF,Ll=(e,t,r)=>{let n,s;if(r===void 0)n=e,s=t;else n=r.openAll+e,s=t+r.closeAll;return{open:e,close:t,openAll:n,closeAll:s,parent:r}},oc=(e,t,r)=>{let n=(...s)=>HF(n,s.length===1?""+s[0]:s.join(" "));return Object.setPrototypeOf(n,KF),n[Dl]=e,n[Cs]=t,n[Fo]=r,n},HF=(e,t)=>{if(e.level<=0||!t)return e[Fo]?"":t;let r=e[Cs];if(r===void 0)return t;let{openAll:n,closeAll:s}=r;if(t.includes("\x1B"))while(r!==void 0)t=ub(t,r.close,r.open),r=r.parent;let o=t.indexOf(`
22
- `);if(o!==-1)t=lb(t,s,n,o);return n+t+s},BF,G3,Nt;var Ul=F(()=>{sb();cb();({stdout:db,stderr:fb}=ab),Dl=Symbol("GENERATOR"),Cs=Symbol("STYLER"),Fo=Symbol("IS_EMPTY"),pb=["ansi","ansi","ansi256","ansi16m"],js=Object.create(null);Object.setPrototypeOf(Vo.prototype,Function.prototype);for(let[e,t]of Object.entries(Pt))js[e]={get(){let r=oc(this,Ll(t.open,t.close,this[Cs]),this[Fo]);return Object.defineProperty(this,e,{value:r}),r}};js.visible={get(){let e=oc(this,this[Cs],!0);return Object.defineProperty(this,"visible",{value:e}),e}};GF=["rgb","hex","ansi256"];for(let e of GF){js[e]={get(){let{level:r}=this;return function(...n){let s=Ll(Ml(e,pb[r],"color",...n),Pt.color.close,this[Cs]);return oc(this,s,this[Fo])}}};let t="bg"+e[0].toUpperCase()+e.slice(1);js[t]={get(){let{level:r}=this;return function(...n){let s=Ll(Ml(e,pb[r],"bgColor",...n),Pt.bgColor.close,this[Cs]);return oc(this,s,this[Fo])}}}}KF=Object.defineProperties(()=>{},{...js,level:{enumerable:!0,get(){return this[Dl].level},set(e){this[Dl].level=e}}});Object.defineProperties(Vo.prototype,js);BF=Vo(),G3=Vo({level:fb?fb.level:0}),Nt=BF});function H3(e){Fl=e}function ic(){return Fl}function qs(e){if(Fl)process.stderr.write(`${e}
23
- `)}var Fl=!1;var{spawn:WF}=globalThis.Bun;function Vl(e,t=[]){let r=e.replace(YF,'("$1","<redacted>")');for(let n of t)if(n.length>=XF)r=r.split(n).join("<redacted>");return r}function QF(e){let t=["AWS_SESSION_TOKEN","AWS_SECRET_ACCESS_KEY","AWS_ACCESS_KEY_ID"],r=new Set;for(let n of[process.env,e??{}])for(let s of t){let o=n[s];if(typeof o==="string"&&o.length>0)r.add(o)}return[...r]}async function hb(e,t){let r=e.getReader(),n=new TextDecoder,s="";while(!0){let{done:o,value:i}=await r.read();if(o)break;if(i.byteLength===0)continue;t(),s+=n.decode(i,{stream:!0})}return s+n.decode()}async function mb(e,t={}){let r={...process.env,GIT_TERMINAL_PROMPT:"0",...t.env};for(let y of t.unsetEnv??[])delete r[y];let n=WF({cmd:e,cwd:t.cwd,...t.stdin===void 0?{}:{stdin:new TextEncoder().encode(t.stdin)},stdout:"pipe",stderr:"pipe",env:r}),s=!1,o,i,a=performance.now(),c=()=>{if(i!==void 0)clearTimeout(i),i=void 0},u=()=>{if(!t.onInactivityWarning)return;c(),i=setTimeout(()=>{i=void 0;try{t.onInactivityWarning?.(performance.now()-a)}catch{console.error("Could not display subprocess inactivity warning; the child result is unaffected.")}},t.inactivityWarningAfterMs??JF)};if(u(),t.timeout)o=setTimeout(()=>{s=!0,c(),n.kill()},t.timeout);let d=ic()?[...QF(r),...t.redact??[]]:[];if(ic()){let y=t.cwd?` (cwd=${t.cwd})`:"";qs(Nt.dim(Vl(`$ ${e.join(" ")}${y}`,d)))}let l=()=>{a=performance.now(),u()},p,f,h,m=n.exited.then((y)=>(c(),y));try{[p,f,h]=await Promise.all([hb(n.stdout,l),hb(n.stderr,l),m])}finally{if(c(),o)clearTimeout(o)}if(ic()){if(t.sensitiveOutput)qs(Nt.dim("[sensitive subprocess output suppressed]"));else{if(p.trim())qs(Nt.dim(Vl(p.trimEnd(),d)));if(f.trim())qs(Nt.yellow(Vl(f.trimEnd(),d)))}qs(Nt.dim(`(exit ${h})`))}if(s)return{stdout:p,stderr:f||`Command timed out after ${Math.round(t.timeout/1000)}s`,exitCode:h??1,timedOut:!0};return{stdout:p,stderr:f,exitCode:h,timedOut:!1}}var YF,XF=8,JF=120000;var gb=F(()=>{Ul();YF=/\(\s*"((?:x-amz-)[^"]*|authorization|proxy-authorization)"\s*,\s*"[^"]*"\s*\)/gi});function eV(){if(process.platform==="darwin")return"macos";if(process.platform==="win32")return"windows";return"linux"}function _b(e,t=eV()){return e.installInstructions[t]}function tV(e){let t=e.match(/(\d+\.\d+(?:\.\d+)?)/);return t?t[1]:void 0}function nV(){let e=Number(process.env.TEST_PROBE_TIMEOUT_MS);return Number.isFinite(e)&&e>0?e:rV}async function vb(e){try{let{exitCode:t,stdout:r,timedOut:n}=await mb(e.cmd,{timeout:nV()});if(n)return{available:!1,timedOut:!0};if(t!==0)return{available:!1};return{available:!0,version:tV(r)}}catch(t){let r=t instanceof Error?t.message:String(t);if(!r.includes("ENOENT")&&!r.includes("not found"))console.error(` Warning: ${e.name} check failed unexpectedly: ${r}`);return{available:!1}}}async function zl(){let e=Object.entries(yb);return Promise.all(e.map(async([t,r])=>{let{available:n,version:s,timedOut:o}=await vb(r);return{key:t,name:r.name,purpose:r.purpose,required:r.required,available:n,version:s,timedOut:o,installInstruction:_b(r)}}))}async function Z3(){let t=(await zl()).filter((r)=>r.required&&!r.available);if(t.length===0)return[];console.warn(`
24
- Heads up: some tools NEMAR needs for uploading/validating aren't installed yet:`);for(let r of t)console.warn(` - ${r.name} (${r.purpose})`),console.warn(` Install: ${r.installInstruction}`);return console.warn("Run `nemar doctor` anytime to re-check. You can finish signup without them.\n"),t}async function eB(e){let r=ZF[e].map((i)=>yb[i]).filter(Boolean),n=await Promise.all(r.map(async(i)=>{let a=await vb(i);return{check:i,available:a.available,timedOut:a.timedOut}}));for(let i of n)if(i.timedOut&&i.check.required)console.warn(`Warning: ${i.check.name} did not respond to a version check in time; continuing anyway.`);let s=n.filter((i)=>!i.available&&!i.timedOut&&i.check.required).map((i)=>({tool:i.check.name,installInstruction:_b(i.check)}));if(s.length===0)return;let o=[`
21
+ `,s)}while(n!==-1);return o+=e.slice(s),o}function Vo(e){return zF(e)}var dw,fw,Dl,Cs,Fo,pw,js,VF=(e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw Error("The `level` option should be an integer from 0 to 3");let r=dw?dw.level:0;e.level=t.level===void 0?r:t.level},zF=(e)=>{let t=(...r)=>r.join(" ");return VF(t,e),Object.setPrototypeOf(t,Vo.prototype),t},Ml=(e,t,r,...n)=>{if(e==="rgb"){if(t==="ansi16m")return Pt[r].ansi16m(...n);if(t==="ansi256")return Pt[r].ansi256(Pt.rgbToAnsi256(...n));return Pt[r].ansi(Pt.rgbToAnsi(...n))}if(e==="hex")return Ml("rgb",t,r,...Pt.hexToRgb(...n));return Pt[r][e](...n)},GF,KF,Ll=(e,t,r)=>{let n,s;if(r===void 0)n=e,s=t;else n=r.openAll+e,s=t+r.closeAll;return{open:e,close:t,openAll:n,closeAll:s,parent:r}},oc=(e,t,r)=>{let n=(...s)=>HF(n,s.length===1?""+s[0]:s.join(" "));return Object.setPrototypeOf(n,KF),n[Dl]=e,n[Cs]=t,n[Fo]=r,n},HF=(e,t)=>{if(e.level<=0||!t)return e[Fo]?"":t;let r=e[Cs];if(r===void 0)return t;let{openAll:n,closeAll:s}=r;if(t.includes("\x1B"))while(r!==void 0)t=uw(t,r.close,r.open),r=r.parent;let o=t.indexOf(`
22
+ `);if(o!==-1)t=lw(t,s,n,o);return n+t+s},BF,G3,Nt;var Ul=F(()=>{sw();cw();({stdout:dw,stderr:fw}=aw),Dl=Symbol("GENERATOR"),Cs=Symbol("STYLER"),Fo=Symbol("IS_EMPTY"),pw=["ansi","ansi","ansi256","ansi16m"],js=Object.create(null);Object.setPrototypeOf(Vo.prototype,Function.prototype);for(let[e,t]of Object.entries(Pt))js[e]={get(){let r=oc(this,Ll(t.open,t.close,this[Cs]),this[Fo]);return Object.defineProperty(this,e,{value:r}),r}};js.visible={get(){let e=oc(this,this[Cs],!0);return Object.defineProperty(this,"visible",{value:e}),e}};GF=["rgb","hex","ansi256"];for(let e of GF){js[e]={get(){let{level:r}=this;return function(...n){let s=Ll(Ml(e,pw[r],"color",...n),Pt.color.close,this[Cs]);return oc(this,s,this[Fo])}}};let t="bg"+e[0].toUpperCase()+e.slice(1);js[t]={get(){let{level:r}=this;return function(...n){let s=Ll(Ml(e,pw[r],"bgColor",...n),Pt.bgColor.close,this[Cs]);return oc(this,s,this[Fo])}}}}KF=Object.defineProperties(()=>{},{...js,level:{enumerable:!0,get(){return this[Dl].level},set(e){this[Dl].level=e}}});Object.defineProperties(Vo.prototype,js);BF=Vo(),G3=Vo({level:fw?fw.level:0}),Nt=BF});function H3(e){Fl=e}function ic(){return Fl}function qs(e){if(Fl)process.stderr.write(`${e}
23
+ `)}var Fl=!1;var{spawn:WF}=globalThis.Bun;function Vl(e,t=[]){let r=e.replace(YF,'("$1","<redacted>")');for(let n of t)if(n.length>=XF)r=r.split(n).join("<redacted>");return r}function QF(e){let t=["AWS_SESSION_TOKEN","AWS_SECRET_ACCESS_KEY","AWS_ACCESS_KEY_ID"],r=new Set;for(let n of[process.env,e??{}])for(let s of t){let o=n[s];if(typeof o==="string"&&o.length>0)r.add(o)}return[...r]}async function hw(e,t){let r=e.getReader(),n=new TextDecoder,s="";while(!0){let{done:o,value:i}=await r.read();if(o)break;if(i.byteLength===0)continue;t(),s+=n.decode(i,{stream:!0})}return s+n.decode()}async function mw(e,t={}){let r={...process.env,GIT_TERMINAL_PROMPT:"0",...t.env};for(let y of t.unsetEnv??[])delete r[y];let n=WF({cmd:e,cwd:t.cwd,...t.stdin===void 0?{}:{stdin:new TextEncoder().encode(t.stdin)},stdout:"pipe",stderr:"pipe",env:r}),s=!1,o,i,a=performance.now(),c=()=>{if(i!==void 0)clearTimeout(i),i=void 0},u=()=>{if(!t.onInactivityWarning)return;c(),i=setTimeout(()=>{i=void 0;try{t.onInactivityWarning?.(performance.now()-a)}catch{console.error("Could not display subprocess inactivity warning; the child result is unaffected.")}},t.inactivityWarningAfterMs??JF)};if(u(),t.timeout)o=setTimeout(()=>{s=!0,c(),n.kill()},t.timeout);let d=ic()?[...QF(r),...t.redact??[]]:[];if(ic()){let y=t.cwd?` (cwd=${t.cwd})`:"";qs(Nt.dim(Vl(`$ ${e.join(" ")}${y}`,d)))}let l=()=>{a=performance.now(),u()},p,f,h,m=n.exited.then((y)=>(c(),y));try{[p,f,h]=await Promise.all([hw(n.stdout,l),hw(n.stderr,l),m])}finally{if(c(),o)clearTimeout(o)}if(ic()){if(t.sensitiveOutput)qs(Nt.dim("[sensitive subprocess output suppressed]"));else{if(p.trim())qs(Nt.dim(Vl(p.trimEnd(),d)));if(f.trim())qs(Nt.yellow(Vl(f.trimEnd(),d)))}qs(Nt.dim(`(exit ${h})`))}if(s)return{stdout:p,stderr:f||`Command timed out after ${Math.round(t.timeout/1000)}s`,exitCode:h??1,timedOut:!0};return{stdout:p,stderr:f,exitCode:h,timedOut:!1}}var YF,XF=8,JF=120000;var gw=F(()=>{Ul();YF=/\(\s*"((?:x-amz-)[^"]*|authorization|proxy-authorization)"\s*,\s*"[^"]*"\s*\)/gi});function eV(){if(process.platform==="darwin")return"macos";if(process.platform==="win32")return"windows";return"linux"}function _w(e,t=eV()){return e.installInstructions[t]}function tV(e){let t=e.match(/(\d+\.\d+(?:\.\d+)?)/);return t?t[1]:void 0}function nV(){let e=Number(process.env.TEST_PROBE_TIMEOUT_MS);return Number.isFinite(e)&&e>0?e:rV}async function vw(e){try{let{exitCode:t,stdout:r,timedOut:n}=await mw(e.cmd,{timeout:nV()});if(n)return{available:!1,timedOut:!0};if(t!==0)return{available:!1};return{available:!0,version:tV(r)}}catch(t){let r=t instanceof Error?t.message:String(t);if(!r.includes("ENOENT")&&!r.includes("not found"))console.error(` Warning: ${e.name} check failed unexpectedly: ${r}`);return{available:!1}}}async function zl(){let e=Object.entries(yw);return Promise.all(e.map(async([t,r])=>{let{available:n,version:s,timedOut:o}=await vw(r);return{key:t,name:r.name,purpose:r.purpose,required:r.required,available:n,version:s,timedOut:o,installInstruction:_w(r)}}))}async function Z3(){let t=(await zl()).filter((r)=>r.required&&!r.available);if(t.length===0)return[];console.warn(`
24
+ Heads up: some tools NEMAR needs for uploading/validating aren't installed yet:`);for(let r of t)console.warn(` - ${r.name} (${r.purpose})`),console.warn(` Install: ${r.installInstruction}`);return console.warn("Run `nemar doctor` anytime to re-check. You can finish signup without them.\n"),t}async function eB(e){let r=ZF[e].map((i)=>yw[i]).filter(Boolean),n=await Promise.all(r.map(async(i)=>{let a=await vw(i);return{check:i,available:a.available,timedOut:a.timedOut}}));for(let i of n)if(i.timedOut&&i.check.required)console.warn(`Warning: ${i.check.name} did not respond to a version check in time; continuing anyway.`);let s=n.filter((i)=>!i.available&&!i.timedOut&&i.check.required).map((i)=>({tool:i.check.name,installInstruction:_w(i.check)}));if(s.length===0)return;let o=[`
25
25
  Missing required tools:`];for(let i of s)o.push(` ${i.tool} not installed`),o.push(` Install: ${i.installInstruction}`);throw Error(o.join(`
26
- `))}var yb,ZF,rV=4000;var $b=F(()=>{gb();yb={git:{name:"git",purpose:"version control for dataset metadata",cmd:["git","--version"],required:!0,installInstructions:{macos:"brew install git (or install Xcode Command Line Tools)",linux:"sudo apt-get install git OR sudo dnf install git",windows:"winget install Git.Git (or https://git-scm.com/download/win)"}},"git-annex":{name:"git-annex",purpose:"large-file data transfer (upload/download)",cmd:["git-annex","version"],required:!0,installInstructions:{macos:"brew install git-annex",linux:"sudo apt-get install git-annex OR sudo dnf install git-annex",windows:"Download the installer from https://git-annex.branchable.com/install/Windows/"}},gh:{name:"GitHub CLI (gh)",purpose:"GitHub authentication + repository operations",cmd:["gh","--version"],required:!0,installInstructions:{macos:"brew install gh",linux:"See https://cli.github.com/manual/installation",windows:"winget install GitHub.cli (or: scoop install gh)"}},aws:{name:"AWS CLI",purpose:"S3 data upload/download",cmd:["aws","--version"],required:!0,installInstructions:{macos:"brew install awscli",linux:"pip install awscli OR sudo snap install aws-cli --classic",windows:"winget install Amazon.AWSCLI (or the MSI from https://aws.amazon.com/cli/)"}},deno:{name:"Deno",purpose:"BIDS validation",cmd:["deno","--version"],required:!0,installInstructions:{macos:"brew install deno (or: curl -fsSL https://deno.land/install.sh | sh)",linux:"curl -fsSL https://deno.land/install.sh | sh",windows:"winget install DenoLand.Deno (or: irm https://deno.land/install.ps1 | iex)"}}},ZF={upload:["git-annex","gh","aws","deno"],download:["gh"],clone:["git","gh"],push:["git-annex","gh"],publish:["gh","aws"],update:["git","gh"],release:["git","gh"]}});var wb;var Eb=F(()=>{wb={name:"nemar-cli",packageManager:"bun@1.4.3",version:"0.10.27-PR2000.ef02d3c",description:"CLI for NEMAR (Neuroelectromagnetic Data Archive and Tools Resource) dataset management",type:"module",main:"dist/index.js",bin:{nemar:"dist/index.js","git-annex-remote-nemar":"dist/git-annex-remote-nemar.js"},scripts:{dev:"bun run src/index.ts",build:"bun build src/index.ts src/git-annex-remote-nemar.ts --outdir dist --target bun --minify && sed '1s|#!/usr/bin/env node|#!/usr/bin/env bun|' dist/index.js > dist/index.js.tmp && mv dist/index.js.tmp dist/index.js",test:"bun test",lint:"biome check src/","lint:scrub":"biome check scripts/scrub shared/identifier-scrub.ts test/scrub","test:scrub":"bun test --preload ./test/scrub/helpers/temp-dirs-preload.ts --path-ignore-patterns='__run_every_scrub_suite__' test/scrub test/identifier-scan.test.ts test/identifier-scrub.test.ts test/identifier-dates.test.ts test/identifier-fleet.test.ts","migrations:d1-check":"bun run scripts/d1-migration-check.ts","zarr:geometry-check":"bun run backend/scripts/zarr-geometry-conformance.ts","lint:fix":"biome check --fix src/",format:"biome format --write src/",typecheck:"tsc --noEmit && tsc --noEmit -p backend","generate-openapi":"bun run scripts/generate-openapi.ts",prepublishOnly:"bun run build",prepare:"husky",postinstall:"bun scripts/postinstall-check.mjs",deploy:"wrangler deploy",preview:"wrangler dev"},keywords:["nemar","bids","neuroimaging","eeg","emg","datalad","cli"],author:"NEMAR Team",license:"CC-BY-NC-ND-4.0",repository:{type:"git",url:"git+https://github.com/nemarOrg/nemar-cli.git"},bugs:{url:"https://github.com/nemarOrg/nemar-cli/issues"},homepage:"https://docs.nemar.org",engines:{bun:">=1.0.0"},files:["dist","scripts/postinstall-check.mjs","scripts/recover-datasets.json","scripts/withdrawn-datasets.json","README.md","LICENSE"],dependencies:{chalk:"^5.3.0",commander:"^12.1.0",conf:"^13.0.1",inquirer:"^9.2.15",ora:"^8.0.1",semver:"^7.8.5",zod:"^3.23.8"},"lint-staged":{"src/**/*.{ts,tsx}":["biome check --fix"],"backend/src/**/*.{ts,tsx}":["biome check --fix"]},trustedDependencies:["@biomejs/biome"],devDependencies:{"@anthropic-ai/sdk":"^0.132.1","@asteasolutions/zod-to-openapi":"^7.3.4","@biomejs/biome":"1.9.4","@types/bun":"latest","@types/inquirer":"^9.0.7","@types/semver":"^7.8.0",ajv:"^8.20.0","ajv-formats":"^3.0.1",husky:"^9.1.7","lint-staged":"^16.3.2",typescript:"^5.5.4",wrangler:"^4.70.0",yaml:"^2.8.4"}}});var ac;var Gl=F(()=>{Eb();ac=wb.version});import{mkdirSync as oV,readdirSync as iV,unlinkSync as aV,writeFileSync as cV}from"fs";import{join as Kl}from"path";function dB(){Ds=!0}function lc(){return Ds}function fB(e,t=process.env){return e.includes("--debug")||t.NEMAR_DEBUG==="1"}function pB(e){Tb=e,pr(`Step: ${e}`)}function hB(){xb=!0}function mB(){return xb}function gB(){if(Rb)return;Bl=!0}function yB(){Bl=!1,Rb=!0}function _B(){return Bl}function pr(e){if(Ds)process.stderr.write(`[debug] ${e}
27
- `)}function fV(e){let t={};for(let[r,n]of Object.entries(e))t[r]=dV.has(r.toLowerCase())?"[REDACTED]":n;return t}function Ob(e){let t=e.indexOf("@");if(t<=0)return"***";return`${e[0]}***${e.slice(t)}`}function Hl(e,t,r=0){if(r>hV)return"[REDACTED: depth]";if(Array.isArray(t))return t.map((n)=>Hl(e,n,r+1));if(t&&typeof t==="object"){let n={};for(let[s,o]of Object.entries(t))n[s]=Hl(s,o,r+1);return n}if(typeof t==="string"){if(pV.test(e))return"[REDACTED]";return t.replace(kb,Ob)}return t}function Wl(e){return e.replace(mV,"Bearer [REDACTED]").replace(gV,"[REDACTED_AWS_KEY]").replace(yV,"$1[REDACTED]").replace(_V,"$1$2=[REDACTED]").replace(kb,Ob)}function vV(e){return Wl(e)}function bb(e,t=lV){if(e===void 0)return;let r=e;try{let n=JSON.parse(e);r=JSON.stringify(Hl("",n))}catch{}if(r=Wl(r),Buffer.byteLength(r,"utf8")>t)r=`${Buffer.from(r,"utf8").subarray(0,t).toString("utf8")}... [truncated]`;return r}function dc(e){if(!Ds)return;let t=vV(e.url);try{let r={...e,url:t,requestHeaders:e.requestHeaders?fV(e.requestHeaders):void 0,requestBody:bb(e.requestBody),responseBody:bb(e.responseBody)};uc.push(r),pr(`${e.method} ${t} -> ${e.status??"ERROR"} (${e.durationMs}ms)`)}catch(r){let n=dr(r);uc.push({method:e.method,url:t,status:e.status,durationMs:e.durationMs,note:`redaction failed: ${n}`}),pr(`redaction failed for ${e.method} ${t}: ${n}`)}}async function $V(){let e=[];try{let t=process.versions.bun?`Bun ${process.versions.bun}`:`Node ${process.version}`;e.push(`CLI version: ${ac}`),e.push(`OS/Arch: ${process.platform}/${process.arch}`),e.push(`Runtime: ${t}`)}catch(t){e.push(`(could not read CLI/OS/runtime info: ${dr(t)})`)}e.push(""),e.push("Active account:");try{let t=hn();if(t.apiKey){if(t.username)e.push(` Username: ${t.username}`);if(e.push(` API URL: ${t.apiUrl}`),t.role)e.push(` Role: ${t.role}`);e.push(` Sandbox completed: ${!!t.sandboxCompleted}`)}else e.push(" (not authenticated)")}catch(t){e.push(` (could not read account config: ${dr(t)})`)}e.push(""),e.push("External tools:");try{let t=await zl();for(let r of t){let n=r.available?r.version??"installed":r.timedOut?"(timed out)":"not installed";e.push(` ${r.name}: ${n}`)}}catch(t){e.push(` (could not probe external tools: ${dr(t)})`)}return e}async function EV(){return(await $V()).join(`
28
- `)}async function vB(){if(!Ds||cc!==void 0)return;try{cc=await EV()}catch(e){let t=dr(e);cc=`(could not build environment report: ${t})`,pr(`environment snapshot failed: ${t}`)}}function Ab(e){if(Sb.has(e))return{flag:e};for(let t of Sb){if(!e.startsWith(t)||e.length<=t.length)continue;if(t.length===2)return{flag:t,kind:"short-attached"};if(e[t.length]==="=")return{flag:t,kind:"long-eq"}}return null}function wV(e){let t=[];for(let r=0;r<e.length;r++){let n=e[r],s=Ab(n);if(!s){t.push(n);continue}if(s.kind==="long-eq")t.push(`${s.flag}=[REDACTED]`);else if(s.kind==="short-attached")t.push(`${s.flag}[REDACTED]`);else if(t.push(n),r+1<e.length)t.push("[REDACTED]"),r++}return t}function bV(e){let t=[];for(let r=0;r<e.length;r++){let n=e[r],s=Ab(n);if(!s){t.push(n);continue}if(!s.kind&&r+1<e.length)r++}return t}function SV(e){let t=[];for(let n of bV(e)){if(n.startsWith("-"))continue;if(t.push(n),t.length===2)break}return(t.length>0?t.join("-"):"nemar").replace(/[^a-zA-Z0-9_-]/g,"_")}function xV(e,t){let r=[];if(r.push("NEMAR CLI Debug Log"),r.push(`Generated: ${new Date().toISOString()}`),r.push(`Command: nemar ${Wl(wV(e).join(" "))}`),r.push(""),r.push(cc??"(environment snapshot unavailable)"),r.push(""),r.push("HTTP requests:"),uc.length===0)r.push(" (none)");else uc.forEach((n,s)=>{if(r.push(` [${s+1}] ${n.method} ${n.url} -> ${n.status??"ERROR"} (${n.durationMs}ms)`),n.error)r.push(` Error: ${n.error}`);if(n.note)r.push(` Note: ${n.note}`);if(n.requestHeaders)r.push(` Request headers: ${JSON.stringify(n.requestHeaders)}`);if(n.requestBody)r.push(` Request body: ${n.requestBody}`);if(n.responseBody)r.push(` Response body: ${n.responseBody}`)});return r.push(""),r.push(`Failing step: ${Tb??"(none recorded)"}`),r.push(`Exit code: ${t}`),`${r.join(`
26
+ `))}var yw,ZF,rV=4000;var $w=F(()=>{gw();yw={git:{name:"git",purpose:"version control for dataset metadata",cmd:["git","--version"],required:!0,installInstructions:{macos:"brew install git (or install Xcode Command Line Tools)",linux:"sudo apt-get install git OR sudo dnf install git",windows:"winget install Git.Git (or https://git-scm.com/download/win)"}},"git-annex":{name:"git-annex",purpose:"large-file data transfer (upload/download)",cmd:["git-annex","version"],required:!0,installInstructions:{macos:"brew install git-annex",linux:"sudo apt-get install git-annex OR sudo dnf install git-annex",windows:"Download the installer from https://git-annex.branchable.com/install/Windows/"}},gh:{name:"GitHub CLI (gh)",purpose:"GitHub authentication + repository operations",cmd:["gh","--version"],required:!0,installInstructions:{macos:"brew install gh",linux:"See https://cli.github.com/manual/installation",windows:"winget install GitHub.cli (or: scoop install gh)"}},aws:{name:"AWS CLI",purpose:"S3 data upload/download",cmd:["aws","--version"],required:!0,installInstructions:{macos:"brew install awscli",linux:"pip install awscli OR sudo snap install aws-cli --classic",windows:"winget install Amazon.AWSCLI (or the MSI from https://aws.amazon.com/cli/)"}},deno:{name:"Deno",purpose:"BIDS validation",cmd:["deno","--version"],required:!0,installInstructions:{macos:"brew install deno (or: curl -fsSL https://deno.land/install.sh | sh)",linux:"curl -fsSL https://deno.land/install.sh | sh",windows:"winget install DenoLand.Deno (or: irm https://deno.land/install.ps1 | iex)"}}},ZF={upload:["git-annex","gh","aws","deno"],download:["gh"],clone:["git","gh"],push:["git-annex","gh"],publish:["gh","aws"],update:["git","gh"],release:["git","gh"]}});var bw;var Ew=F(()=>{bw={name:"nemar-cli",packageManager:"bun@1.4.3",version:"0.10.27-PR2001.0b15c9a",description:"CLI for NEMAR (Neuroelectromagnetic Data Archive and Tools Resource) dataset management",type:"module",main:"dist/index.js",bin:{nemar:"dist/index.js","git-annex-remote-nemar":"dist/git-annex-remote-nemar.js"},scripts:{dev:"bun run src/index.ts",build:"bun build src/index.ts src/git-annex-remote-nemar.ts --outdir dist --target bun --minify && sed '1s|#!/usr/bin/env node|#!/usr/bin/env bun|' dist/index.js > dist/index.js.tmp && mv dist/index.js.tmp dist/index.js",test:"bun test",lint:"biome check src/","lint:scrub":"biome check scripts/scrub shared/identifier-scrub.ts test/scrub","test:scrub":"bun test --preload ./test/scrub/helpers/temp-dirs-preload.ts --path-ignore-patterns='__run_every_scrub_suite__' test/scrub test/identifier-scan.test.ts test/identifier-scrub.test.ts test/identifier-dates.test.ts test/identifier-fleet.test.ts","migrations:d1-check":"bun run scripts/d1-migration-check.ts","zarr:geometry-check":"bun run backend/scripts/zarr-geometry-conformance.ts","lint:fix":"biome check --fix src/",format:"biome format --write src/",typecheck:"tsc --noEmit && tsc --noEmit -p backend","generate-openapi":"bun run scripts/generate-openapi.ts",prepublishOnly:"bun run build",prepare:"husky",postinstall:"bun scripts/postinstall-check.mjs",deploy:"wrangler deploy",preview:"wrangler dev"},keywords:["nemar","bids","neuroimaging","eeg","emg","datalad","cli"],author:"NEMAR Team",license:"CC-BY-NC-ND-4.0",repository:{type:"git",url:"git+https://github.com/nemarOrg/nemar-cli.git"},bugs:{url:"https://github.com/nemarOrg/nemar-cli/issues"},homepage:"https://docs.nemar.org",engines:{bun:">=1.0.0"},files:["dist","scripts/postinstall-check.mjs","scripts/recover-datasets.json","scripts/withdrawn-datasets.json","README.md","LICENSE"],dependencies:{chalk:"^5.3.0",commander:"^12.1.0",conf:"^13.0.1",inquirer:"^9.2.15",ora:"^8.0.1",semver:"^7.8.5",zod:"^3.23.8"},"lint-staged":{"src/**/*.{ts,tsx}":["biome check --fix"],"backend/src/**/*.{ts,tsx}":["biome check --fix"]},trustedDependencies:["@biomejs/biome"],devDependencies:{"@anthropic-ai/sdk":"^0.132.1","@asteasolutions/zod-to-openapi":"^7.3.4","@biomejs/biome":"1.9.4","@types/bun":"latest","@types/inquirer":"^9.0.7","@types/semver":"^7.8.0",ajv:"^8.20.0","ajv-formats":"^3.0.1",husky:"^9.1.7","lint-staged":"^16.3.2",typescript:"^5.5.4",wrangler:"^4.70.0",yaml:"^2.8.4"}}});var ac;var Gl=F(()=>{Ew();ac=bw.version});import{mkdirSync as oV,readdirSync as iV,unlinkSync as aV,writeFileSync as cV}from"fs";import{join as Kl}from"path";function dB(){Ds=!0}function lc(){return Ds}function fB(e,t=process.env){return e.includes("--debug")||t.NEMAR_DEBUG==="1"}function pB(e){Tw=e,pr(`Step: ${e}`)}function hB(){xw=!0}function mB(){return xw}function gB(){if(Rw)return;Bl=!0}function yB(){Bl=!1,Rw=!0}function _B(){return Bl}function pr(e){if(Ds)process.stderr.write(`[debug] ${e}
27
+ `)}function fV(e){let t={};for(let[r,n]of Object.entries(e))t[r]=dV.has(r.toLowerCase())?"[REDACTED]":n;return t}function Ow(e){let t=e.indexOf("@");if(t<=0)return"***";return`${e[0]}***${e.slice(t)}`}function Hl(e,t,r=0){if(r>hV)return"[REDACTED: depth]";if(Array.isArray(t))return t.map((n)=>Hl(e,n,r+1));if(t&&typeof t==="object"){let n={};for(let[s,o]of Object.entries(t))n[s]=Hl(s,o,r+1);return n}if(typeof t==="string"){if(pV.test(e))return"[REDACTED]";return t.replace(kw,Ow)}return t}function Wl(e){return e.replace(mV,"Bearer [REDACTED]").replace(gV,"[REDACTED_AWS_KEY]").replace(yV,"$1[REDACTED]").replace(_V,"$1$2=[REDACTED]").replace(kw,Ow)}function vV(e){return Wl(e)}function ww(e,t=lV){if(e===void 0)return;let r=e;try{let n=JSON.parse(e);r=JSON.stringify(Hl("",n))}catch{}if(r=Wl(r),Buffer.byteLength(r,"utf8")>t)r=`${Buffer.from(r,"utf8").subarray(0,t).toString("utf8")}... [truncated]`;return r}function dc(e){if(!Ds)return;let t=vV(e.url);try{let r={...e,url:t,requestHeaders:e.requestHeaders?fV(e.requestHeaders):void 0,requestBody:ww(e.requestBody),responseBody:ww(e.responseBody)};uc.push(r),pr(`${e.method} ${t} -> ${e.status??"ERROR"} (${e.durationMs}ms)`)}catch(r){let n=dr(r);uc.push({method:e.method,url:t,status:e.status,durationMs:e.durationMs,note:`redaction failed: ${n}`}),pr(`redaction failed for ${e.method} ${t}: ${n}`)}}async function $V(){let e=[];try{let t=process.versions.bun?`Bun ${process.versions.bun}`:`Node ${process.version}`;e.push(`CLI version: ${ac}`),e.push(`OS/Arch: ${process.platform}/${process.arch}`),e.push(`Runtime: ${t}`)}catch(t){e.push(`(could not read CLI/OS/runtime info: ${dr(t)})`)}e.push(""),e.push("Active account:");try{let t=hn();if(t.apiKey){if(t.username)e.push(` Username: ${t.username}`);if(e.push(` API URL: ${t.apiUrl}`),t.role)e.push(` Role: ${t.role}`);e.push(` Sandbox completed: ${!!t.sandboxCompleted}`)}else e.push(" (not authenticated)")}catch(t){e.push(` (could not read account config: ${dr(t)})`)}e.push(""),e.push("External tools:");try{let t=await zl();for(let r of t){let n=r.available?r.version??"installed":r.timedOut?"(timed out)":"not installed";e.push(` ${r.name}: ${n}`)}}catch(t){e.push(` (could not probe external tools: ${dr(t)})`)}return e}async function EV(){return(await $V()).join(`
28
+ `)}async function vB(){if(!Ds||cc!==void 0)return;try{cc=await EV()}catch(e){let t=dr(e);cc=`(could not build environment report: ${t})`,pr(`environment snapshot failed: ${t}`)}}function Aw(e){if(Sw.has(e))return{flag:e};for(let t of Sw){if(!e.startsWith(t)||e.length<=t.length)continue;if(t.length===2)return{flag:t,kind:"short-attached"};if(e[t.length]==="=")return{flag:t,kind:"long-eq"}}return null}function bV(e){let t=[];for(let r=0;r<e.length;r++){let n=e[r],s=Aw(n);if(!s){t.push(n);continue}if(s.kind==="long-eq")t.push(`${s.flag}=[REDACTED]`);else if(s.kind==="short-attached")t.push(`${s.flag}[REDACTED]`);else if(t.push(n),r+1<e.length)t.push("[REDACTED]"),r++}return t}function wV(e){let t=[];for(let r=0;r<e.length;r++){let n=e[r],s=Aw(n);if(!s){t.push(n);continue}if(!s.kind&&r+1<e.length)r++}return t}function SV(e){let t=[];for(let n of wV(e)){if(n.startsWith("-"))continue;if(t.push(n),t.length===2)break}return(t.length>0?t.join("-"):"nemar").replace(/[^a-zA-Z0-9_-]/g,"_")}function xV(e,t){let r=[];if(r.push("NEMAR CLI Debug Log"),r.push(`Generated: ${new Date().toISOString()}`),r.push(`Command: nemar ${Wl(bV(e).join(" "))}`),r.push(""),r.push(cc??"(environment snapshot unavailable)"),r.push(""),r.push("HTTP requests:"),uc.length===0)r.push(" (none)");else uc.forEach((n,s)=>{if(r.push(` [${s+1}] ${n.method} ${n.url} -> ${n.status??"ERROR"} (${n.durationMs}ms)`),n.error)r.push(` Error: ${n.error}`);if(n.note)r.push(` Note: ${n.note}`);if(n.requestHeaders)r.push(` Request headers: ${JSON.stringify(n.requestHeaders)}`);if(n.requestBody)r.push(` Request body: ${n.requestBody}`);if(n.responseBody)r.push(` Response body: ${n.responseBody}`)});return r.push(""),r.push(`Failing step: ${Tw??"(none recorded)"}`),r.push(`Exit code: ${t}`),`${r.join(`
29
29
  `)}
30
- `}function RV(e,t){let r;try{r=iV(e).filter((s)=>s.startsWith("nemar-")&&s.endsWith(".log"))}catch(s){if(s.code!=="ENOENT")pr(`could not list ${e} for log rotation: ${dr(s)}`);return}r.sort();let n=r.length-t;for(let s=0;s<n;s++)try{aV(Kl(e,r[s]))}catch(o){if(o.code!=="ENOENT")pr(`could not remove old log ${r[s]}: ${dr(o)}`)}}function $B(){return zo}function EB(e,t){if(!Ds)return null;let r=Kl(Xl(),"logs");try{oV(r,{recursive:!0})}catch(i){return zo=dr(i),pr(`could not create log directory ${r}: ${zo}`),null}let s=`nemar-${new Date().toISOString().replace(/[:.]/g,"-")}-${SV(e)}.log`,o=Kl(r,s);try{cV(o,xV(e,t),"utf8")}catch(i){return zo=dr(i),pr(`could not write log file ${o}: ${zo}`),null}return RV(r,uV),o}var uV=10,lV=2048,Ds=!1,xb=!1,Bl=!1,Rb=!1,Tb,cc,uc,dV,pV,kb,hV=32,mV,gV,yV,_V,Sb,zo;var Yl=F(()=>{Cl();fc();$b();Gl();uc=[];dV=new Set(["authorization","cookie","set-cookie","x-api-key","x-approval-dispatch-token"]);pV=/^(api[_-]?key|apikey|password|token|secret|access[_-]?key(_id)?|secret[_-]?access[_-]?key|session|session[_-]?token|authorization|ssh[_-]?key|private[_-]?key|device[_-]?code|dispatch[_-]?token)$/i,kb=/[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/g;mV=/Bearer\s+[A-Za-z0-9\-._~+/=]+/gi,gV=/\b(?:AKIA|ASIA)[0-9A-Z]{16}\b/g,yV=/((?:aws_)?secret_access_key["']?\s*[:=]\s*["']?)[A-Za-z0-9/+=]{20,}/gi,_V=/([?&])(X-Amz-Signature|X-Amz-Security-Token|X-Amz-Credential|Signature|AWSAccessKeyId)=[^&\s"']+/gi;Sb=new Set(["-k","--key","--password","--api-key"])});import{chmodSync as TV,copyFileSync as kV,existsSync as Jl,mkdirSync as OV,statSync as AV}from"fs";import{homedir as pc}from"os";import{join as Ms}from"path";function NV(e){let t=e.trim().replace(/\/+$/,"");try{let r=new URL(t);return r.protocol=r.protocol.toLowerCase(),r.host=r.host.toLowerCase(),r.toString().replace(/\/+$/,"")}catch{return console.error(`[nemar] could not parse stored apiUrl ${JSON.stringify(e)}; leaving as-is`),t}}function Xl(){return process.env.NEMAR_CONFIG_DIR||Ms(pc(),".config","nemar")}function CV(e){if(process.env.NEMAR_CONFIG_DIR)return;let t=Ms(e,"config.json");if(Jl(t))return;let r=[];if(process.platform==="darwin")r.push(Ms(pc(),"Library","Preferences","nemar-nodejs","config.json"));if(process.platform==="win32"){let n=process.env.APPDATA||Ms(pc(),"AppData","Roaming");r.push(Ms(n,"nemar-nodejs","config.json"))}r.push(Ms(pc(),".config","nemar-nodejs","config.json"));for(let n of r)if(Jl(n))try{OV(e,{recursive:!0}),kV(n,t),console.error(`[nemar] Config migrated from ${n} to ${t}
30
+ `}function RV(e,t){let r;try{r=iV(e).filter((s)=>s.startsWith("nemar-")&&s.endsWith(".log"))}catch(s){if(s.code!=="ENOENT")pr(`could not list ${e} for log rotation: ${dr(s)}`);return}r.sort();let n=r.length-t;for(let s=0;s<n;s++)try{aV(Kl(e,r[s]))}catch(o){if(o.code!=="ENOENT")pr(`could not remove old log ${r[s]}: ${dr(o)}`)}}function $B(){return zo}function EB(e,t){if(!Ds)return null;let r=Kl(Xl(),"logs");try{oV(r,{recursive:!0})}catch(i){return zo=dr(i),pr(`could not create log directory ${r}: ${zo}`),null}let s=`nemar-${new Date().toISOString().replace(/[:.]/g,"-")}-${SV(e)}.log`,o=Kl(r,s);try{cV(o,xV(e,t),"utf8")}catch(i){return zo=dr(i),pr(`could not write log file ${o}: ${zo}`),null}return RV(r,uV),o}var uV=10,lV=2048,Ds=!1,xw=!1,Bl=!1,Rw=!1,Tw,cc,uc,dV,pV,kw,hV=32,mV,gV,yV,_V,Sw,zo;var Yl=F(()=>{Cl();fc();$w();Gl();uc=[];dV=new Set(["authorization","cookie","set-cookie","x-api-key","x-approval-dispatch-token"]);pV=/^(api[_-]?key|apikey|password|token|secret|access[_-]?key(_id)?|secret[_-]?access[_-]?key|session|session[_-]?token|authorization|ssh[_-]?key|private[_-]?key|device[_-]?code|dispatch[_-]?token)$/i,kw=/[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/g;mV=/Bearer\s+[A-Za-z0-9\-._~+/=]+/gi,gV=/\b(?:AKIA|ASIA)[0-9A-Z]{16}\b/g,yV=/((?:aws_)?secret_access_key["']?\s*[:=]\s*["']?)[A-Za-z0-9/+=]{20,}/gi,_V=/([?&])(X-Amz-Signature|X-Amz-Security-Token|X-Amz-Credential|Signature|AWSAccessKeyId)=[^&\s"']+/gi;Sw=new Set(["-k","--key","--password","--api-key"])});import{chmodSync as TV,copyFileSync as kV,existsSync as Jl,mkdirSync as OV,statSync as AV}from"fs";import{homedir as pc}from"os";import{join as Ms}from"path";function NV(e){let t=e.trim().replace(/\/+$/,"");try{let r=new URL(t);return r.protocol=r.protocol.toLowerCase(),r.host=r.host.toLowerCase(),r.toString().replace(/\/+$/,"")}catch{return console.error(`[nemar] could not parse stored apiUrl ${JSON.stringify(e)}; leaving as-is`),t}}function Xl(){return process.env.NEMAR_CONFIG_DIR||Ms(pc(),".config","nemar")}function CV(e){if(process.env.NEMAR_CONFIG_DIR)return;let t=Ms(e,"config.json");if(Jl(t))return;let r=[];if(process.platform==="darwin")r.push(Ms(pc(),"Library","Preferences","nemar-nodejs","config.json"));if(process.platform==="win32"){let n=process.env.APPDATA||Ms(pc(),"AppData","Roaming");r.push(Ms(n,"nemar-nodejs","config.json"))}r.push(Ms(pc(),".config","nemar-nodejs","config.json"));for(let n of r)if(Jl(n))try{OV(e,{recursive:!0}),kV(n,t),console.error(`[nemar] Config migrated from ${n} to ${t}
31
31
  [nemar] You can safely remove the old file.`);return}catch(s){console.error(`[nemar] Failed to migrate config from ${n}:`,s,`
32
- [nemar] You can manually copy ${n} to ${t}`)}}function St(){let e=Xl();if(Go&&Pb===e)return Go;if(CV(e),Go=new Ka({projectName:"nemar",configFileMode:Ql,schema:{activeAccount:{type:"string"},accounts:{type:"object"},apiKey:{type:"string"},apiUrl:{type:"string"},username:{type:"string"},email:{type:"string"},githubUsername:{type:"string"},sandboxCompleted:{type:"boolean"},sandboxDatasetId:{type:"string"}},cwd:e}),Pb=e,!Nb.has(e))Nb.add(e),jV(Go.path),DV(),MV();return Go}function jV(e){if(process.platform==="win32")return;if(!Jl(e))return;try{if((AV(e).mode&511)!==Ql)TV(e,Ql)}catch(t){console.error(`[nemar] could not secure config file permissions for ${e}:`,t)}}function DV(){let e=St(),t=e.get("accounts");if(t&&Object.keys(t).length>0)return;let r=e.get("apiKey"),n=e.get("username");if(!r&&!n)return;try{let s=n||"default",o={};for(let i of qV){let a=e.get(i);if(a!==void 0)o[i]=a}e.store={activeAccount:s,accounts:{[s]:o}}}catch(s){console.error("Config migration failed (legacy config preserved):",s)}}function MV(){let e=St(),t=e.store,r=t.accounts,n=!1;if(r)for(let[o,i]of Object.entries(r)){let a=i?.apiUrl;if(!a)continue;if(PV.has(NV(a)))r[o]={...i,apiUrl:Ls},console.error(`[nemar] migrated stored apiUrl for account "${o}": ${a} -> ${Ls}`),n=!0}let s=t.apiUrl;if(r&&Object.keys(r).length>0&&s!==void 0){let{apiUrl:o,...i}=t;try{e.store=i,console.error(`[nemar] removed stale top-level apiUrl from config (was: ${s})`),n=!1}catch(a){console.error("API URL cleanup failed (config file unchanged):",a)}}if(n)try{e.store={...e.store,accounts:r}}catch(o){console.error("API URL migration failed (config file unchanged):",o)}}function Ko(){return St().get("activeAccount")}function mn(){return St().get("accounts")||{}}function hn(){let e={apiUrl:Ls},t=Ko();if(!t)return e;return mn()[t]||e}function PB(e,t){let r=St(),n=r.get("activeAccount")||"default",s=r.get("accounts")||{};if(!s[n])s[n]={apiUrl:Ls};s[n][e]=t,r.store={...r.store,accounts:s,activeAccount:n}}function NB(e){let t=Ko();if(!t)return;let r=mn();if(r[t])delete r[t][e],St().set("accounts",r)}function IB(){let e=St(),t=Ko();if(!t){e.clear();return}let r=mn();delete r[t];let n=Object.keys(r);if(n.length>0)e.store={...e.store,accounts:r,activeAccount:n[0]};else e.clear()}function CB(){St().clear()}function jB(){return!!hn().apiKey}function qB(){return St().path}function DB(){let e=mn(),t=Ko();return Object.entries(e).map(([r,n])=>({key:r,username:n.username,email:n.email,githubUsername:n.githubUsername,active:r===t,keySource:n.keySource}))}function MB(e){return e.username?.trim()||e.email}function LV(e){let t=e.trim().toLowerCase();if(!t)return;let r=Object.entries(mn()).filter(([,n])=>n.email&&n.email.toLowerCase()===t).map(([n])=>n);if(r.length>1){pr(`findAccountKeyByEmail: ${r.length} accounts share email ${t}: ${r.join(", ")}`);return}return r[0]}function LB(e,t){let r=St(),n=mn(),s;if(n[e])s=e;else if(t.email)s=LV(t.email);let o=s?n[s]:void 0,i={...o??{apiUrl:Ls},...t};if(s&&s!==e)delete n[s];return n[e]=i,r.store={...r.store,accounts:n,activeAccount:e},{key:e,previous:o}}function UB(e){let t=e.trim();if(!t)return"unchanged";let r=St(),n=Ko();if(!n||n===t)return"unchanged";let s=mn(),o=s[n];if(!o)return"unchanged";if(s[t])return"key_taken";return delete s[n],s[t]={...o,username:t},r.store={...r.store,accounts:s,activeAccount:t},"renamed"}function FB(e){let t=St(),r=mn();if(r[e])return t.store={...t.store,activeAccount:e},r[e];for(let[n,s]of Object.entries(r))if(s.githubUsername===e)return t.store={...t.store,activeAccount:n},s;return null}var Ls="https://api.nemar.org",Ql=384,PV,IV,AB,Go=null,Pb=null,Nb,qV;var fc=F(()=>{Fw();jn();nc();Yl();PV=new Set(["https://api.osc.earth/nemar","https://nemar-api.neuromechanist.workers.dev","https://nemar-api-dev.shirazi-10f.workers.dev"]);IV=ne({field:v(),blocks:Ze(v()).optional(),set_on:Ze(v()).optional()}).passthrough(),AB=ne({apiKey:v().optional(),apiUrl:v().url().default(Ls),username:v().optional(),email:v().email().optional(),githubUsername:v().optional(),sandboxCompleted:Ue().optional(),sandboxDatasetId:v().optional(),dismissedNoticeIds:Ze(fe()).optional(),serviceAccess:Ue().optional(),profileGaps:Ze(IV).optional(),orcidVerified:Ue().optional(),role:v().optional(),accountKind:qn.optional(),pendingEmailChange:v().email().optional()});Nb=new Set;qV=["apiKey","apiUrl","username","email","githubUsername","sandboxCompleted","sandboxDatasetId","dismissedNoticeIds"]});var UV,FV,KB,VV,HB,zV,Ib,BB,WB=8,YB=100,Cb,XB,GV,JB;var jb=F(()=>{jn();nc();UV=["given_name","family_name","affiliation","city","country"],FV=["username","github_username","email","orcid"],KB=[...UV,...FV],VV={given_name:v().max(200).optional(),family_name:v().max(200).optional(),affiliation:v().max(500).optional(),city:v().max(200).optional(),country:v().max(200).optional(),username:v().max(100).optional(),github_username:v().max(100).optional(),email:v().max(320).optional(),orcid:v().max(40).optional()},HB=ne(VV),zV=Ve(["field_not_editable","owner_only_field","edit_own_account","owner_account","system_account","invalid_edit","orcid_already_proven","invalid_search","invalid_user_id"]),Ib=zV.options,BB=["exact","name","prefix","substring","fuzzy"],Cb=ne({id:fe().int(),username:v().nullable(),email:v(),github_username:v().nullable(),status:v(),role:v().nullable(),account_kind:qn.optional(),email_verified:fe().int().nullable().optional(),orcid:v().nullable().optional(),orcid_verified:fe().int().nullable().optional(),given_name:v().nullable().optional(),family_name:v().nullable().optional(),affiliation:v().nullable().optional(),city:v().nullable().optional(),country:v().nullable().optional(),description:v().nullable().optional(),signup_source:v().nullable().optional(),created_at:v(),updated_at:v().nullable().optional(),approved_at:v().nullable().optional(),revoked_at:v().nullable().optional(),deleted_at:v().nullable().optional(),service_access:fe().int().nullable().optional(),service_access_granted_at:v().nullable().optional(),service_access_granted_by:fe().int().nullable().optional(),upload_access_requested_at:v().nullable().optional(),upload_access_notified_at:v().nullable().optional(),identity_conflict:fe().int().nullable().optional(),username_auto_assigned:fe().int().nullable().optional(),sandbox_completed:fe().int().nullable().optional(),sandbox_completed_at:v().nullable().optional(),sandbox_dataset_id:v().nullable().optional(),aws_iam_username:v().nullable().optional(),dataset_count:fe().int().optional(),active_tokens:fe().int().optional(),linked_identities:Ze(v()).optional()}).passthrough(),XB=ne({user:Cb}).passthrough(),GV=ne({from:v().nullable(),to:v().nullable()}),JB=ne({message:v(),changed:wF(v(),GV),notes:Ze(v()).optional(),old_address_notified:Ue().optional(),user:Cb}).passthrough()});var e6=120,t6=64,r6="unnamed machine",KV=25,qb,n6,Us,Db,s6,o6,i6,HV,BV,a6,Zl,c6,u6,l6,d6,f6;var Mb=F(()=>{jn();qb=Ve(["authorization_pending","slow_down","expired_token","access_denied","invalid_grant"]),n6={authorization_pending:"Waiting for you to authorize this machine in the browser.",slow_down:"Polling too quickly; the CLI will slow down automatically.",expired_token:"The code expired. Run `nemar auth login` again for a new one.",access_denied:"This sign-in was declined in the browser. Run `nemar auth login` again if that was a mistake.",invalid_grant:"That code is no longer valid. Run `nemar auth login` again for a new one."},Us=Ve(["device_code_unknown","device_code_expired","device_code_used","device_code_denied","account_pending","account_revoked","identity_conflict","service_account","person_account","too_many_keys","key_not_found"]),Db=Us.options,s6={device_code_unknown:"That code was not found. Check the code shown in your terminal, or run `nemar auth login` again for a new one.",device_code_expired:"The code expired. Run `nemar auth login` again for a new one.",device_code_used:"That code has already been used. Run `nemar auth login` again for a new one.",device_code_denied:"This sign-in was declined in the browser. Run `nemar auth login` again if that was a mistake.",account_pending:"Verify your email address first. Check your inbox for the NEMAR verification code, then authorize again.",account_revoked:"Your NEMAR account access has been revoked. Contact the NEMAR team if you think this is a mistake.",identity_conflict:"This account shares an identifier with another NEMAR account and cannot sign in until that is resolved. Fix it in Settings on nemar.org or contact the NEMAR team.",service_account:"This is a service or test account, and it cannot sign in this way. Ask an owner to create a key for it with `nemar admin keys create`.",person_account:"This account belongs to a person. A person creates their own keys with `nemar auth login` or in Settings on nemar.org.",too_many_keys:`This account already has ${KV} active keys. Revoke one in Settings on nemar.org or with \`nemar auth keys\`, then try again.`,key_not_found:"That key was not found on this account, or it is already revoked. Run `nemar auth keys` to see the active ones."},o6=ne({error:Us,message:v()}).passthrough(),i6=ne({device_code:v(),user_code:v(),verification_uri:v(),verification_uri_complete:v(),expires_in:fe().int(),interval:fe().int()}).passthrough(),HV=Yw("error",[ne({error:In("authorization_pending"),message:v()}).passthrough(),ne({error:In("slow_down"),message:v()}).passthrough()]),BV=Yw("error",[ne({error:In("expired_token"),reason:Us,message:v()}).passthrough(),ne({error:In("access_denied"),reason:Us,message:v()}).passthrough(),ne({error:In("invalid_grant"),reason:Us,message:v()}).passthrough()]),a6=EF([HV,BV]),Zl=ne({id:fe().int(),name:v().nullable(),prefix:v(),created_at:v(),last_used_at:v().nullable(),current:Ue()}).passthrough(),c6=ne({api_key:v(),key:Zl,user:ne({username:v().nullable(),email:v(),github_username:v().nullable(),role:v(),sandbox_completed:Ue(),sandbox_dataset_id:v().nullable()}).passthrough()}).passthrough(),u6=ne({user_code:v(),machine_name:v(),requested_at:v(),expires_in:fe().int(),account:ne({username:v().nullable(),email_masked:v()}).passthrough(),refusal:ne({code:Us,message:v()}).passthrough().nullable()}).passthrough(),l6=ne({ok:In(!0),machine_name:v()}).passthrough(),d6=ne({keys:Ze(Zl)}).passthrough(),f6=ne({api_key:v(),key:Zl}).passthrough()});var WV,Lb,Ho="https://nemar.org/settings",m6,YV,XV,JV,g6,y6;var Ub=F(()=>{jn();WV=Ve(["orcid_in_use","orcid_already_linked","orcid_linked_other","email_in_use","github_in_use","identity_conflict_remains"]),Lb=WV.options,m6={orcid_in_use:`That ORCID iD already belongs to a NEMAR account. Sign in to that account instead; if you want the iD on a different account, unlink it there first (Settings, ${Ho}).`,orcid_already_linked:`That ORCID iD already belongs to a NEMAR account. Sign in to that account instead; if you want the iD on a different account, unlink it there first (Settings, ${Ho}).`,orcid_linked_other:`That ORCID iD is linked to a different NEMAR account. Unlink it there first (Settings, ${Ho}), then link it here.`,email_in_use:`That email address already belongs to a NEMAR account. Sign in to that account instead, or change its address first (Settings, ${Ho}).`,github_in_use:`That GitHub account is already linked to a NEMAR account. Sign in to that account instead, or change its GitHub username first (Settings, ${Ho}).`,identity_conflict_remains:"The collision that flagged this account is still there. Resolve it on the other account first (change its email or GitHub username, or unlink its ORCID iD), or delete that account, then clear the flag."},YV=Ve(["orcid","email","github"]),XV=ne({id:fe().int(),username:v().nullable(),email:v(),created_at:v(),has_oauth_identity:Ue(),dataset_count:fe().int(),identity_conflict:fe().int(),canonical:Ue()}).passthrough(),JV=ne({kind:YV,value:v(),canonical_user_id:fe().int(),accounts:Ze(XV)}).passthrough(),g6=ne({groups:Ze(JV),group_count:fe().int(),flagged_count:fe().int()}).passthrough(),y6=ne({ok:In(!0),id:fe().int(),cleared:Ue()}).passthrough()});function b6(e){return typeof e==="string"&&ZV.includes(e)}var QV,$6,E6,w6,ZV,e9="ci_check_unavailable",Fb,Vb,zb,S6="X-Approval-Dispatch-Token",x6;var Gb=F(()=>{jn();QV=/^\d{4}-\d{4}-\d{4}-\d{3}[\dX]$/,$6=v().regex(QV,"ORCID must be in format 0000-0000-0000-000X"),E6=Ve(["found","no_public_name","lookup_failed"]),w6=Ve(["bids_validation_failed","bids_validation_pending","bids_validation_in_progress","prescreen_failed","min_requirements_failed","owner_name_missing","identifier_screen_findings"]),ZV=["bids_validation_pending","bids_validation_in_progress"];Fb=[e9],Vb=["identifier_screen_pending","identifier_screen_not_clear","identifier_screen_not_applicable"],zb=["publication_review_not_clear","request_blocked","request_changed","request_mismatch","dispatch_superseded","dispatch_expired","decision_with_dispatch_token","approval_in_flight","deny_after_publishing","invalid_dataset_id","approval_closed_during_run"],x6=Ve(["filled","would_fill","no_public_name","lookup_failed","write_failed"])});function Hb(e){if(Kb)return;Kb=!0;let t=Nt.yellow("\u2500".repeat(60)),r=Nt.yellow.bold("[MAINTENANCE]"),n=Nt.dim(`mode: ${e.mode}`),s=e.eta?`
32
+ [nemar] You can manually copy ${n} to ${t}`)}}function St(){let e=Xl();if(Go&&Pw===e)return Go;if(CV(e),Go=new Ka({projectName:"nemar",configFileMode:Ql,schema:{activeAccount:{type:"string"},accounts:{type:"object"},apiKey:{type:"string"},apiUrl:{type:"string"},username:{type:"string"},email:{type:"string"},githubUsername:{type:"string"},sandboxCompleted:{type:"boolean"},sandboxDatasetId:{type:"string"}},cwd:e}),Pw=e,!Nw.has(e))Nw.add(e),jV(Go.path),DV(),MV();return Go}function jV(e){if(process.platform==="win32")return;if(!Jl(e))return;try{if((AV(e).mode&511)!==Ql)TV(e,Ql)}catch(t){console.error(`[nemar] could not secure config file permissions for ${e}:`,t)}}function DV(){let e=St(),t=e.get("accounts");if(t&&Object.keys(t).length>0)return;let r=e.get("apiKey"),n=e.get("username");if(!r&&!n)return;try{let s=n||"default",o={};for(let i of qV){let a=e.get(i);if(a!==void 0)o[i]=a}e.store={activeAccount:s,accounts:{[s]:o}}}catch(s){console.error("Config migration failed (legacy config preserved):",s)}}function MV(){let e=St(),t=e.store,r=t.accounts,n=!1;if(r)for(let[o,i]of Object.entries(r)){let a=i?.apiUrl;if(!a)continue;if(PV.has(NV(a)))r[o]={...i,apiUrl:Ls},console.error(`[nemar] migrated stored apiUrl for account "${o}": ${a} -> ${Ls}`),n=!0}let s=t.apiUrl;if(r&&Object.keys(r).length>0&&s!==void 0){let{apiUrl:o,...i}=t;try{e.store=i,console.error(`[nemar] removed stale top-level apiUrl from config (was: ${s})`),n=!1}catch(a){console.error("API URL cleanup failed (config file unchanged):",a)}}if(n)try{e.store={...e.store,accounts:r}}catch(o){console.error("API URL migration failed (config file unchanged):",o)}}function Ko(){return St().get("activeAccount")}function mn(){return St().get("accounts")||{}}function hn(){let e={apiUrl:Ls},t=Ko();if(!t)return e;return mn()[t]||e}function PB(e,t){let r=St(),n=r.get("activeAccount")||"default",s=r.get("accounts")||{};if(!s[n])s[n]={apiUrl:Ls};s[n][e]=t,r.store={...r.store,accounts:s,activeAccount:n}}function NB(e){let t=Ko();if(!t)return;let r=mn();if(r[t])delete r[t][e],St().set("accounts",r)}function IB(){let e=St(),t=Ko();if(!t){e.clear();return}let r=mn();delete r[t];let n=Object.keys(r);if(n.length>0)e.store={...e.store,accounts:r,activeAccount:n[0]};else e.clear()}function CB(){St().clear()}function jB(){return!!hn().apiKey}function qB(){return St().path}function DB(){let e=mn(),t=Ko();return Object.entries(e).map(([r,n])=>({key:r,username:n.username,email:n.email,githubUsername:n.githubUsername,active:r===t,keySource:n.keySource}))}function MB(e){return e.username?.trim()||e.email}function LV(e){let t=e.trim().toLowerCase();if(!t)return;let r=Object.entries(mn()).filter(([,n])=>n.email&&n.email.toLowerCase()===t).map(([n])=>n);if(r.length>1){pr(`findAccountKeyByEmail: ${r.length} accounts share email ${t}: ${r.join(", ")}`);return}return r[0]}function LB(e,t){let r=St(),n=mn(),s;if(n[e])s=e;else if(t.email)s=LV(t.email);let o=s?n[s]:void 0,i={...o??{apiUrl:Ls},...t};if(s&&s!==e)delete n[s];return n[e]=i,r.store={...r.store,accounts:n,activeAccount:e},{key:e,previous:o}}function UB(e){let t=e.trim();if(!t)return"unchanged";let r=St(),n=Ko();if(!n||n===t)return"unchanged";let s=mn(),o=s[n];if(!o)return"unchanged";if(s[t])return"key_taken";return delete s[n],s[t]={...o,username:t},r.store={...r.store,accounts:s,activeAccount:t},"renamed"}function FB(e){let t=St(),r=mn();if(r[e])return t.store={...t.store,activeAccount:e},r[e];for(let[n,s]of Object.entries(r))if(s.githubUsername===e)return t.store={...t.store,activeAccount:n},s;return null}var Ls="https://api.nemar.org",Ql=384,PV,IV,AB,Go=null,Pw=null,Nw,qV;var fc=F(()=>{Fb();jn();nc();Yl();PV=new Set(["https://api.osc.earth/nemar","https://nemar-api.neuromechanist.workers.dev","https://nemar-api-dev.shirazi-10f.workers.dev"]);IV=ne({field:v(),blocks:Ze(v()).optional(),set_on:Ze(v()).optional()}).passthrough(),AB=ne({apiKey:v().optional(),apiUrl:v().url().default(Ls),username:v().optional(),email:v().email().optional(),githubUsername:v().optional(),sandboxCompleted:Ue().optional(),sandboxDatasetId:v().optional(),dismissedNoticeIds:Ze(fe()).optional(),serviceAccess:Ue().optional(),profileGaps:Ze(IV).optional(),orcidVerified:Ue().optional(),role:v().optional(),accountKind:qn.optional(),pendingEmailChange:v().email().optional()});Nw=new Set;qV=["apiKey","apiUrl","username","email","githubUsername","sandboxCompleted","sandboxDatasetId","dismissedNoticeIds"]});var UV,FV,KB,VV,HB,zV,Iw,BB,WB=8,YB=100,Cw,XB,GV,JB;var jw=F(()=>{jn();nc();UV=["given_name","family_name","affiliation","city","country"],FV=["username","github_username","email","orcid"],KB=[...UV,...FV],VV={given_name:v().max(200).optional(),family_name:v().max(200).optional(),affiliation:v().max(500).optional(),city:v().max(200).optional(),country:v().max(200).optional(),username:v().max(100).optional(),github_username:v().max(100).optional(),email:v().max(320).optional(),orcid:v().max(40).optional()},HB=ne(VV),zV=Ve(["field_not_editable","owner_only_field","edit_own_account","owner_account","system_account","invalid_edit","orcid_already_proven","invalid_search","invalid_user_id"]),Iw=zV.options,BB=["exact","name","prefix","substring","fuzzy"],Cw=ne({id:fe().int(),username:v().nullable(),email:v(),github_username:v().nullable(),status:v(),role:v().nullable(),account_kind:qn.optional(),email_verified:fe().int().nullable().optional(),orcid:v().nullable().optional(),orcid_verified:fe().int().nullable().optional(),given_name:v().nullable().optional(),family_name:v().nullable().optional(),affiliation:v().nullable().optional(),city:v().nullable().optional(),country:v().nullable().optional(),description:v().nullable().optional(),signup_source:v().nullable().optional(),created_at:v(),updated_at:v().nullable().optional(),approved_at:v().nullable().optional(),revoked_at:v().nullable().optional(),deleted_at:v().nullable().optional(),service_access:fe().int().nullable().optional(),service_access_granted_at:v().nullable().optional(),service_access_granted_by:fe().int().nullable().optional(),upload_access_requested_at:v().nullable().optional(),upload_access_notified_at:v().nullable().optional(),identity_conflict:fe().int().nullable().optional(),username_auto_assigned:fe().int().nullable().optional(),sandbox_completed:fe().int().nullable().optional(),sandbox_completed_at:v().nullable().optional(),sandbox_dataset_id:v().nullable().optional(),aws_iam_username:v().nullable().optional(),dataset_count:fe().int().optional(),active_tokens:fe().int().optional(),linked_identities:Ze(v()).optional()}).passthrough(),XB=ne({user:Cw}).passthrough(),GV=ne({from:v().nullable(),to:v().nullable()}),JB=ne({message:v(),changed:bF(v(),GV),notes:Ze(v()).optional(),old_address_notified:Ue().optional(),user:Cw}).passthrough()});var e6=120,t6=64,r6="unnamed machine",KV=25,qw,n6,Us,Dw,s6,o6,i6,HV,BV,a6,Zl,c6,u6,l6,d6,f6;var Mw=F(()=>{jn();qw=Ve(["authorization_pending","slow_down","expired_token","access_denied","invalid_grant"]),n6={authorization_pending:"Waiting for you to authorize this machine in the browser.",slow_down:"Polling too quickly; the CLI will slow down automatically.",expired_token:"The code expired. Run `nemar auth login` again for a new one.",access_denied:"This sign-in was declined in the browser. Run `nemar auth login` again if that was a mistake.",invalid_grant:"That code is no longer valid. Run `nemar auth login` again for a new one."},Us=Ve(["device_code_unknown","device_code_expired","device_code_used","device_code_denied","account_pending","account_revoked","identity_conflict","service_account","person_account","too_many_keys","key_not_found"]),Dw=Us.options,s6={device_code_unknown:"That code was not found. Check the code shown in your terminal, or run `nemar auth login` again for a new one.",device_code_expired:"The code expired. Run `nemar auth login` again for a new one.",device_code_used:"That code has already been used. Run `nemar auth login` again for a new one.",device_code_denied:"This sign-in was declined in the browser. Run `nemar auth login` again if that was a mistake.",account_pending:"Verify your email address first. Check your inbox for the NEMAR verification code, then authorize again.",account_revoked:"Your NEMAR account access has been revoked. Contact the NEMAR team if you think this is a mistake.",identity_conflict:"This account shares an identifier with another NEMAR account and cannot sign in until that is resolved. Fix it in Settings on nemar.org or contact the NEMAR team.",service_account:"This is a service or test account, and it cannot sign in this way. Ask an owner to create a key for it with `nemar admin keys create`.",person_account:"This account belongs to a person. A person creates their own keys with `nemar auth login` or in Settings on nemar.org.",too_many_keys:`This account already has ${KV} active keys. Revoke one in Settings on nemar.org or with \`nemar auth keys\`, then try again.`,key_not_found:"That key was not found on this account, or it is already revoked. Run `nemar auth keys` to see the active ones."},o6=ne({error:Us,message:v()}).passthrough(),i6=ne({device_code:v(),user_code:v(),verification_uri:v(),verification_uri_complete:v(),expires_in:fe().int(),interval:fe().int()}).passthrough(),HV=Yb("error",[ne({error:In("authorization_pending"),message:v()}).passthrough(),ne({error:In("slow_down"),message:v()}).passthrough()]),BV=Yb("error",[ne({error:In("expired_token"),reason:Us,message:v()}).passthrough(),ne({error:In("access_denied"),reason:Us,message:v()}).passthrough(),ne({error:In("invalid_grant"),reason:Us,message:v()}).passthrough()]),a6=EF([HV,BV]),Zl=ne({id:fe().int(),name:v().nullable(),prefix:v(),created_at:v(),last_used_at:v().nullable(),current:Ue()}).passthrough(),c6=ne({api_key:v(),key:Zl,user:ne({username:v().nullable(),email:v(),github_username:v().nullable(),role:v(),sandbox_completed:Ue(),sandbox_dataset_id:v().nullable()}).passthrough()}).passthrough(),u6=ne({user_code:v(),machine_name:v(),requested_at:v(),expires_in:fe().int(),account:ne({username:v().nullable(),email_masked:v()}).passthrough(),refusal:ne({code:Us,message:v()}).passthrough().nullable()}).passthrough(),l6=ne({ok:In(!0),machine_name:v()}).passthrough(),d6=ne({keys:Ze(Zl)}).passthrough(),f6=ne({api_key:v(),key:Zl}).passthrough()});var WV,Lw,Ho="https://nemar.org/settings",m6,YV,XV,JV,g6,y6;var Uw=F(()=>{jn();WV=Ve(["orcid_in_use","orcid_already_linked","orcid_linked_other","email_in_use","github_in_use","identity_conflict_remains"]),Lw=WV.options,m6={orcid_in_use:`That ORCID iD already belongs to a NEMAR account. Sign in to that account instead; if you want the iD on a different account, unlink it there first (Settings, ${Ho}).`,orcid_already_linked:`That ORCID iD already belongs to a NEMAR account. Sign in to that account instead; if you want the iD on a different account, unlink it there first (Settings, ${Ho}).`,orcid_linked_other:`That ORCID iD is linked to a different NEMAR account. Unlink it there first (Settings, ${Ho}), then link it here.`,email_in_use:`That email address already belongs to a NEMAR account. Sign in to that account instead, or change its address first (Settings, ${Ho}).`,github_in_use:`That GitHub account is already linked to a NEMAR account. Sign in to that account instead, or change its GitHub username first (Settings, ${Ho}).`,identity_conflict_remains:"The collision that flagged this account is still there. Resolve it on the other account first (change its email or GitHub username, or unlink its ORCID iD), or delete that account, then clear the flag."},YV=Ve(["orcid","email","github"]),XV=ne({id:fe().int(),username:v().nullable(),email:v(),created_at:v(),has_oauth_identity:Ue(),dataset_count:fe().int(),identity_conflict:fe().int(),canonical:Ue()}).passthrough(),JV=ne({kind:YV,value:v(),canonical_user_id:fe().int(),accounts:Ze(XV)}).passthrough(),g6=ne({groups:Ze(JV),group_count:fe().int(),flagged_count:fe().int()}).passthrough(),y6=ne({ok:In(!0),id:fe().int(),cleared:Ue()}).passthrough()});function w6(e){return typeof e==="string"&&ZV.includes(e)}var QV,$6,E6,b6,ZV,e9="ci_check_unavailable",Fw,Vw,zw,S6="X-Approval-Dispatch-Token",x6;var Gw=F(()=>{jn();QV=/^\d{4}-\d{4}-\d{4}-\d{3}[\dX]$/,$6=v().regex(QV,"ORCID must be in format 0000-0000-0000-000X"),E6=Ve(["found","no_public_name","lookup_failed"]),b6=Ve(["bids_validation_failed","bids_validation_pending","bids_validation_in_progress","prescreen_failed","min_requirements_failed","owner_name_missing","identifier_screen_findings"]),ZV=["bids_validation_pending","bids_validation_in_progress"];Fw=[e9],Vw=["identifier_screen_pending","identifier_screen_not_clear","identifier_screen_not_applicable"],zw=["publication_review_not_clear","request_blocked","request_changed","request_mismatch","dispatch_superseded","dispatch_expired","decision_with_dispatch_token","approval_in_flight","deny_after_publishing","invalid_dataset_id","approval_closed_during_run"],x6=Ve(["filled","would_fill","no_public_name","lookup_failed","write_failed"])});function Hw(e){if(Kw)return;Kw=!0;let t=Nt.yellow("\u2500".repeat(60)),r=Nt.yellow.bold("[MAINTENANCE]"),n=Nt.dim(`mode: ${e.mode}`),s=e.eta?`
33
33
  ${Nt.dim(`eta: ${e.eta}`)}`:"";process.stderr.write(`${t}
34
34
  ${r} ${e.message}
35
35
  ${n}${s}
36
36
  ${t}
37
- `)}var Kb=!1;var Bb=F(()=>{Ul()});function Wb(){if(process.env.TEST_API_URL)return process.env.TEST_API_URL;if(td)return ed;return hn().apiUrl||ed}async function L6(e,t={},r=!1,n){let s=`${Wb()}${e}`,o={"Content-Type":"application/json","X-CLI-Version":ac,...t.headers};if(r){let p=hn();if(!p.apiKey&&r===!0)throw new fr(401,"Not authenticated. Run 'nemar auth login' first.");if(p.apiKey)o.Authorization=`Bearer ${p.apiKey}`}let i=t.method||"GET",a=typeof t.body==="string"?t.body:void 0,c=Date.now(),u;try{u=await fetch(s,{...t,headers:o})}catch(p){if(lc())dc({method:i,url:s,status:null,durationMs:Date.now()-c,requestHeaders:o,requestBody:a,error:p instanceof Error?p.message:String(p)});throw new fr(0,`Network error: Could not connect to ${Wb()}`,{originalError:p instanceof Error?p.message:String(p)})}let d;try{d=await u.text()}catch(p){if(lc())dc({method:i,url:s,status:u.status,durationMs:Date.now()-c,requestHeaders:o,requestBody:a,error:p instanceof Error?p.message:String(p)});throw new fr(0,"Failed to read response body",{httpStatus:u.status,originalError:p instanceof Error?p.message:String(p)})}if(lc())dc({method:i,url:s,status:u.status,durationMs:Date.now()-c,requestHeaders:o,requestBody:a,responseBody:d});let l;try{l=JSON.parse(d)}catch{throw new fr(u.status,`Invalid response from server (status ${u.status})`)}if(!u.ok){if(u.status===503&&(l.mode==="read-only"||l.mode==="full")){let xt=typeof l.message==="string"?l.message:"NEMAR is in maintenance mode. Please retry shortly.",hr=typeof l.eta==="string"?l.eta:null,et=new Il(l.mode,xt,hr,l.details);throw Hb(et),et}let p=typeof l.block_reason==="string",f=Array.isArray(l.missing)?l.missing.filter((xt)=>typeof xt==="string"):void 0,h=typeof l.error==="string"&&(eb.includes(l.error)||Lb.includes(l.error)),m=typeof l.error==="string"&&(qb.options.includes(l.error)||Db.includes(l.error)),y=typeof l.error==="string"&&Jw.includes(l.error),_=typeof l.error==="string"&&Ib.includes(l.error),O=typeof l.error==="string"&&Vb.includes(l.error),T=typeof l.error==="string"&&Fb.includes(l.error),M=typeof l.error==="string"&&zb.includes(l.error),_e=p||T||M||h||m||y||_||O||f!==void 0&&typeof l.error==="string"&&Zw.includes(l.error)?l.message||l.error:l.error||l.message;if(u.status===404&&l.error==="Not Found"&&typeof l.message==="string")_e=`${l.message}. This NEMAR backend does not support this command yet.`;let ve=new fr(u.status,_e||"Request failed",l.details,typeof l.step==="string"?l.step:void 0,p?l.block_reason:void 0,f);if(typeof l.error==="string")ve.code=l.error;if(typeof l.reason==="string")ve.reason=l.reason;throw ve.rawBody=l,ve}if(n){let p=n.safeParse(l);if(!p.success)throw new fr(u.status,`Response for ${e} did not match the expected NEMAR contract`,{issues:p.error.issues});return p.data}return l}var ed="https://api.nemar.org",td;var Yb=F(()=>{jb();Mb();Ub();Gb();nc();fc();Yl();Bb();Gl();Cl();td=ed.includes("workers.dev")});fc();import{open as c9,rm as u9}from"fs/promises";Yb();var Xb="NEMAR_DATA_HOSTS",t9="NEMAR_DATA_HOSTS_ONLY",r9="https://private.nemar.org",n9="https://private-test.nemar.org",s9=/^[a-z]{2,3}[0-9]{6}$/;function Jb(e){return s9.test(e)}function o9(e){return e}function Qb(e){return e==="127.0.0.1"||e==="localhost"||e==="[::1]"}function Zb(e){let t=e.trim();if(t===""||/[?#@]/.test(t))return null;let r;try{r=new URL(t)}catch{return null}if(r.username!==""||r.password!=="")return null;if(r.pathname!=="/")return null;if(r.protocol==="https:")return r.origin;if(r.protocol==="http:"&&Qb(r.hostname))return r.origin;return null}function eS(e){let t=[],r=[];for(let n of(e??"").split(",")){let s=n.trim();if(s==="")continue;let o=Zb(s);if(o===null)r.push(s);else if(!t.includes(o))t.push(o)}return{origins:t,rejected:r}}function tS(e){return e.env??process.env}function i9(e={}){let t=tS(e),r=e.isDevBuild??td,n=t[t9]==="1"?[]:[r?n9:r9],{origins:s}=eS(t[Xb]);return[...n,...s.filter((o)=>!n.includes(o))].map(o9)}function V6(e={}){return eS(tS(e)[Xb]).rejected}function hc(e,t={}){let r=Zb(e);if(r===null)return null;return i9(t).find((n)=>n===r)??null}function rS(e,t={}){return hc(e,t)!==null}function z6(e,t={}){let r;try{r=new URL(e)}catch{return null}if(r.username!==""||r.password!=="")return null;return hc(r.origin,t)}function nS(e,t){if(e.protocol==="https:")return!0;return e.protocol==="http:"&&Qb(e.hostname)&&new URL(t).protocol==="http:"}var a9="NEMAR_DATA_HOST_TIMEOUT_MS";function rd(e,t=process.env){let r=t[a9];if(r===void 0||!/^[0-9]+$/.test(r))return e;let n=Number(r);return n>0&&n<e?n:e}function nd(e){if(!(e instanceof Error))return"error";let t=e.code;return typeof t==="string"&&/^[A-Z][A-Z0-9_]+$/.test(t)?`${e.name} ${t}`:e.name}var sS=3,iS=60000,l9=262144,aS=255,cS=/^[A-Z0-9][A-Z0-9_]*-s([0-9]{1,16})(?:-S([0-9]{1,16})-C([0-9]{1,16}))?--[A-Za-z0-9._-]+$/;function uS(e){return e.length<=aS&&cS.test(e)}function d9(e){if(e.length>aS)return null;let t=cS.exec(e);if(!t||t[2]!==void 0)return null;let r=Number(t[1]);return Number.isSafeInteger(r)?r:null}function f9(e,t,r={}){if(!e)return{ok:!1,message:"The remote has no host setting."};if(!t)return{ok:!1,message:"The remote has no dataset setting."};if(!Jb(t))return{ok:!1,message:"The dataset setting is not a dataset id (two or three letters and six digits)."};let n=hc(e,r);if(n===null)return{ok:!1,message:`The host setting ${It(e)} is not an https origin on this CLI's list of data hosts. The remote's host setting is part of the repository, so it cannot add one.`};return{ok:!0,settings:{origin:n,dataset:t,options:r}}}function It(e,t=200){let r=e.replace(/[^\x20-\x7e]/g,"?");return r.length>t?`${r.slice(0,t)}...`:r}function p9(e,t){return new URL(`${e.origin}/o/${encodeURIComponent(e.dataset)}/${encodeURIComponent(t)}`)}function lS(e,t){if(t)return`The storage address was refused (status ${e}).`;if(e===401)return"The data host refused the API key. Run 'nemar auth login' to sign in again.";if(e===404)return"The data host has no such object, or this account has no access to the dataset.";if(e===429)return"The data host is limiting requests; try again shortly.";return`The data host answered status ${e}.`}async function dS(e,t,r,n,s,o){if(!rS(e.origin,e.options))return{kind:"failed",message:"The host is not on this CLI's list of data hosts."};let i=p9(e,t),a=!1;for(let c=0;;c++){let u={"Accept-Encoding":"identity"};if(i.origin===e.origin)u.Authorization=`Bearer ${r}`;let d;try{d=await fetch(i,{method:n,headers:u,redirect:"manual",signal:o})}catch(f){if(o.aborted)return{kind:"failed",message:"The request timed out."};return{kind:"failed",message:`Could not reach the host (${nd(f)}).`}}if(d.status<300||d.status>=400)return{kind:"response",response:d,redirected:a};if(await d.body?.cancel().catch(()=>{}),!s)return{kind:"response",response:d,redirected:a};if(c>=sS)return{kind:"failed",message:`More than ${sS} redirects.`};let l=d.headers.get("location");if(!l)return{kind:"failed",message:"A redirect named no address."};let p;try{p=new URL(l,i)}catch{return{kind:"failed",message:"A redirect named an address that is not a URL."}}if(!nS(p,e.origin))return{kind:"failed",message:"A redirect named an address that is not https."};i=p,a=!0}}async function fS(e,t){let r=new AbortController,n=setTimeout(()=>r.abort(),e),s=()=>{clearTimeout(n),n=setTimeout(()=>r.abort(),e)};try{return await t(r.signal,s)}finally{clearTimeout(n)}}async function h9(e,t,r,n,s){if(!uS(t))return{ok:!1,message:"The key is not one a data host serves."};let o=d9(t);return fS(rd(iS,e.options?.env),async(i,a)=>{let c=await dS(e,t,r,"GET",!0,i);if(c.kind==="failed")return{ok:!1,message:c.message};let{response:u,redirected:d}=c;if(u.status!==200||!u.body)return await u.body?.cancel().catch(()=>{}),{ok:!1,message:lS(u.status,d)};let l=u.headers.get("content-length");if(o!==null&&l!==null&&Number(l)!==o)return await u.body.cancel().catch(()=>{}),{ok:!1,message:`The object is ${It(l,20)} bytes but its key says ${o}.`};a();let p,f=0,h=0;try{p=await c9(n,"w");let m=u.body.getReader();while(!0){let{done:y,value:_}=await m.read();if(y)break;if(a(),f+=_.byteLength,o!==null&&f>o)throw await m.cancel().catch(()=>{}),new mc(`More bytes arrived than the key's ${o}.`);if(await p.write(_),f-h>=l9)h=f,s(f)}if(await p.close(),p=void 0,o!==null&&f!==o)throw new mc(`The object ended after ${f} bytes; its key says ${o}.`);if(f!==h)s(f);return{ok:!0,bytes:f}}catch(m){if(await p?.close().catch(()=>{}),await u9(n,{force:!0}).catch(()=>{}),m instanceof mc)return{ok:!1,message:m.message};if(i.aborted)return{ok:!1,message:"The transfer stalled and timed out."};return{ok:!1,message:`The transfer failed (${nd(m)}).`}}})}class mc extends Error{constructor(e){super(e);this.name="SizeError"}}async function m9(e,t,r){if(!uS(t))return{state:"unknown",message:"The key is not one a data host serves."};return fS(rd(iS,e.options?.env),async(n)=>{let s=await dS(e,t,r,"HEAD",!1,n);if(s.kind==="failed")return{state:"unknown",message:s.message};let{status:o}=s.response;if(await s.response.body?.cancel().catch(()=>{}),o===200)return{state:"present"};if(o===404)return{state:"absent"};return{state:"unknown",message:lS(o,!1)}})}class gc extends Error{constructor(e){super(e);this.name="ProtocolAbort"}}async function pS(e,t){let r=e.lines[Symbol.asyncIterator](),n=[],s=null,o=null,i=async()=>{let d=n.shift();if(d!==void 0)return d;let l=await r.next();return l.done?null:l.value},a=async(d)=>{await e.send(`GETCONFIG ${d}`);while(!0){let l=await r.next();if(l.done)throw new gc("git-annex closed the connection");let p=l.value;if(p==="VALUE"||p.startsWith("VALUE ")){let f=p.slice(5).trimStart();return f===""?void 0:f}if(p.startsWith("ERROR"))throw new gc(p);n.push(p)}},c=async()=>{let d=await a("host"),l=await a("dataset");return f9(d,l,t.options)},u=async(d,l)=>{if(!s||!o){await e.send(`TRANSFER-FAILURE RETRIEVE ${It(d)} The remote has not been prepared.`);return}let p=Promise.resolve(),f=await h9(s,d,o,l,(h)=>{p=p.then(()=>e.send(`PROGRESS ${h}`))});if(await p,f.ok)await e.send(`TRANSFER-SUCCESS RETRIEVE ${d}`);else await e.send(`TRANSFER-FAILURE RETRIEVE ${It(d)} ${It(f.message)}`)};await e.send("VERSION 1");while(!0){let d=await i();if(d===null)return 0;if(d.trim()==="")continue;let[l,...p]=oS(d,1),f=p[0]??"";try{switch(l){case"EXTENSIONS":await e.send("EXTENSIONS");break;case"INITREMOTE":{let h=await c();await e.send(h.ok?"INITREMOTE-SUCCESS":`INITREMOTE-FAILURE ${It(h.message)}`);break}case"PREPARE":{let h=await c();if(!h.ok){s=null,await e.send(`PREPARE-FAILURE ${It(h.message)}`);break}let m=t.loadApiKey();if(!m){s=null,await e.send("PREPARE-FAILURE No NEMAR API key is stored. Run 'nemar auth login' first.");break}s=h.settings,o=m,await e.send("PREPARE-SUCCESS");break}case"LISTCONFIGS":await e.send("CONFIG host The https origin of the NEMAR data host"),await e.send("CONFIG dataset The dataset id on that host"),await e.send("CONFIGEND");break;case"GETCOST":await e.send("COST 200");break;case"GETAVAILABILITY":await e.send("AVAILABILITY GLOBAL");break;case"GETINFO":if(s)await e.send("INFOFIELD host"),await e.send(`INFOVALUE ${s.origin}`),await e.send("INFOFIELD dataset"),await e.send(`INFOVALUE ${s.dataset}`);await e.send("INFOEND");break;case"EXPORTSUPPORTED":await e.send("EXPORTSUPPORTED-FAILURE");break;case"IMPORTSUPPORTED":await e.send("IMPORTSUPPORTED-FAILURE");break;case"WHEREIS":await e.send("WHEREIS-FAILURE");break;case"CLAIMURL":await e.send("CLAIMURL-FAILURE");break;case"CHECKURL":await e.send("CHECKURL-FAILURE");break;case"TRANSFER":{let[h,m,...y]=oS(f,2);if(h==="STORE")await e.send(`TRANSFER-FAILURE STORE ${It(m??"")} This remote is read-only for now.`);else if(h==="RETRIEVE"&&m&&y[0])await u(m,y[0]);else await e.send("UNSUPPORTED-REQUEST");break}case"CHECKPRESENT":{if(!f){await e.send("UNSUPPORTED-REQUEST");break}if(!s||!o){await e.send(`CHECKPRESENT-UNKNOWN ${It(f)} The remote has not been prepared.`);break}let h=await m9(s,f,o);if(h.state==="present")await e.send(`CHECKPRESENT-SUCCESS ${f}`);else if(h.state==="absent")await e.send(`CHECKPRESENT-FAILURE ${f}`);else await e.send(`CHECKPRESENT-UNKNOWN ${It(f)} ${h.message}`);break}case"REMOVE":await e.send(`REMOVE-FAILURE ${It(f)} This remote is read-only for now.`);break;case"ERROR":return 1;case"VALUE":break;default:await e.send("UNSUPPORTED-REQUEST")}}catch(h){if(h instanceof gc)return 1;throw h}}}function oS(e,t){let r=[],n=e;for(let s=0;s<t;s++){let o=n.indexOf(" ");if(o<0)break;r.push(n.slice(0,o)),n=n.slice(o+1)}return r.push(n),r}async function*g9(){let e=new TextDecoder,t="";for await(let r of Bun.stdin.stream()){t+=e.decode(r,{stream:!0});let n=t.indexOf(`
37
+ `)}var Kw=!1;var Bw=F(()=>{Ul()});function Ww(){if(process.env.TEST_API_URL)return process.env.TEST_API_URL;if(td)return ed;return hn().apiUrl||ed}async function L6(e,t={},r=!1,n){let s=`${Ww()}${e}`,o={"Content-Type":"application/json","X-CLI-Version":ac,...t.headers};if(r){let p=hn();if(!p.apiKey&&r===!0)throw new fr(401,"Not authenticated. Run 'nemar auth login' first.");if(p.apiKey)o.Authorization=`Bearer ${p.apiKey}`}let i=t.method||"GET",a=typeof t.body==="string"?t.body:void 0,c=Date.now(),u;try{u=await fetch(s,{...t,headers:o})}catch(p){if(lc())dc({method:i,url:s,status:null,durationMs:Date.now()-c,requestHeaders:o,requestBody:a,error:p instanceof Error?p.message:String(p)});throw new fr(0,`Network error: Could not connect to ${Ww()}`,{originalError:p instanceof Error?p.message:String(p)})}let d;try{d=await u.text()}catch(p){if(lc())dc({method:i,url:s,status:u.status,durationMs:Date.now()-c,requestHeaders:o,requestBody:a,error:p instanceof Error?p.message:String(p)});throw new fr(0,"Failed to read response body",{httpStatus:u.status,originalError:p instanceof Error?p.message:String(p)})}if(lc())dc({method:i,url:s,status:u.status,durationMs:Date.now()-c,requestHeaders:o,requestBody:a,responseBody:d});let l;try{l=JSON.parse(d)}catch{throw new fr(u.status,`Invalid response from server (status ${u.status})`)}if(!u.ok){if(u.status===503&&(l.mode==="read-only"||l.mode==="full")){let xt=typeof l.message==="string"?l.message:"NEMAR is in maintenance mode. Please retry shortly.",hr=typeof l.eta==="string"?l.eta:null,et=new Il(l.mode,xt,hr,l.details);throw Hw(et),et}let p=typeof l.block_reason==="string",f=Array.isArray(l.missing)?l.missing.filter((xt)=>typeof xt==="string"):void 0,h=typeof l.error==="string"&&(ew.includes(l.error)||Lw.includes(l.error)),m=typeof l.error==="string"&&(qw.options.includes(l.error)||Dw.includes(l.error)),y=typeof l.error==="string"&&Jb.includes(l.error),_=typeof l.error==="string"&&Iw.includes(l.error),O=typeof l.error==="string"&&Vw.includes(l.error),T=typeof l.error==="string"&&Fw.includes(l.error),M=typeof l.error==="string"&&zw.includes(l.error),_e=p||T||M||h||m||y||_||O||f!==void 0&&typeof l.error==="string"&&Zb.includes(l.error)?l.message||l.error:l.error||l.message;if(u.status===404&&l.error==="Not Found"&&typeof l.message==="string")_e=`${l.message}. This NEMAR backend does not support this command yet.`;let ve=new fr(u.status,_e||"Request failed",l.details,typeof l.step==="string"?l.step:void 0,p?l.block_reason:void 0,f);if(typeof l.error==="string")ve.code=l.error;if(typeof l.reason==="string")ve.reason=l.reason;throw ve.rawBody=l,ve}if(n){let p=n.safeParse(l);if(!p.success)throw new fr(u.status,`Response for ${e} did not match the expected NEMAR contract`,{issues:p.error.issues});return p.data}return l}var ed="https://api.nemar.org",td;var Yw=F(()=>{jw();Mw();Uw();Gw();nc();fc();Yl();Bw();Gl();Cl();td=ed.includes("workers.dev")});fc();import{open as c9,rm as u9}from"fs/promises";Yw();var Xw="NEMAR_DATA_HOSTS",t9="NEMAR_DATA_HOSTS_ONLY",r9="https://private.nemar.org",n9="https://private-test.nemar.org",s9=/^[a-z]{2,3}[0-9]{6}$/;function Jw(e){return s9.test(e)}function o9(e){return e}function Qw(e){return e==="127.0.0.1"||e==="localhost"||e==="[::1]"}function Zw(e){let t=e.trim();if(t===""||/[?#@]/.test(t))return null;let r;try{r=new URL(t)}catch{return null}if(r.username!==""||r.password!=="")return null;if(r.pathname!=="/")return null;if(r.protocol==="https:")return r.origin;if(r.protocol==="http:"&&Qw(r.hostname))return r.origin;return null}function eS(e){let t=[],r=[];for(let n of(e??"").split(",")){let s=n.trim();if(s==="")continue;let o=Zw(s);if(o===null)r.push(s);else if(!t.includes(o))t.push(o)}return{origins:t,rejected:r}}function tS(e){return e.env??process.env}function i9(e={}){let t=tS(e),r=e.isDevBuild??td,n=t[t9]==="1"?[]:[r?n9:r9],{origins:s}=eS(t[Xw]);return[...n,...s.filter((o)=>!n.includes(o))].map(o9)}function V6(e={}){return eS(tS(e)[Xw]).rejected}function hc(e,t={}){let r=Zw(e);if(r===null)return null;return i9(t).find((n)=>n===r)??null}function rS(e,t={}){return hc(e,t)!==null}function z6(e,t={}){let r;try{r=new URL(e)}catch{return null}if(r.username!==""||r.password!=="")return null;return hc(r.origin,t)}function nS(e,t){if(e.protocol==="https:")return!0;return e.protocol==="http:"&&Qw(e.hostname)&&new URL(t).protocol==="http:"}var a9="NEMAR_DATA_HOST_TIMEOUT_MS";function rd(e,t=process.env){let r=t[a9];if(r===void 0||!/^[0-9]+$/.test(r))return e;let n=Number(r);return n>0&&n<e?n:e}function nd(e){if(!(e instanceof Error))return"error";let t=e.code;return typeof t==="string"&&/^[A-Z][A-Z0-9_]+$/.test(t)?`${e.name} ${t}`:e.name}var sS=3,iS=60000,l9=262144,aS=255,cS=/^[A-Z0-9][A-Z0-9_]*-s([0-9]{1,16})(?:-S([0-9]{1,16})-C([0-9]{1,16}))?--[A-Za-z0-9._-]+$/;function uS(e){return e.length<=aS&&cS.test(e)}function d9(e){if(e.length>aS)return null;let t=cS.exec(e);if(!t||t[2]!==void 0)return null;let r=Number(t[1]);return Number.isSafeInteger(r)?r:null}function f9(e,t,r={}){if(!e)return{ok:!1,message:"The remote has no host setting."};if(!t)return{ok:!1,message:"The remote has no dataset setting."};if(!Jw(t))return{ok:!1,message:"The dataset setting is not a dataset id (two or three letters and six digits)."};let n=hc(e,r);if(n===null)return{ok:!1,message:`The host setting ${It(e)} is not an https origin on this CLI's list of data hosts. The remote's host setting is part of the repository, so it cannot add one.`};return{ok:!0,settings:{origin:n,dataset:t,options:r}}}function It(e,t=200){let r=e.replace(/[^\x20-\x7e]/g,"?");return r.length>t?`${r.slice(0,t)}...`:r}function p9(e,t){return new URL(`${e.origin}/o/${encodeURIComponent(e.dataset)}/${encodeURIComponent(t)}`)}function lS(e,t){if(t)return`The storage address was refused (status ${e}).`;if(e===401)return"The data host refused the API key. Run 'nemar auth login' to sign in again.";if(e===404)return"The data host has no such object, or this account has no access to the dataset.";if(e===429)return"The data host is limiting requests; try again shortly.";return`The data host answered status ${e}.`}async function dS(e,t,r,n,s,o){if(!rS(e.origin,e.options))return{kind:"failed",message:"The host is not on this CLI's list of data hosts."};let i=p9(e,t),a=!1;for(let c=0;;c++){let u={"Accept-Encoding":"identity"};if(i.origin===e.origin)u.Authorization=`Bearer ${r}`;let d;try{d=await fetch(i,{method:n,headers:u,redirect:"manual",signal:o})}catch(f){if(o.aborted)return{kind:"failed",message:"The request timed out."};return{kind:"failed",message:`Could not reach the host (${nd(f)}).`}}if(d.status<300||d.status>=400)return{kind:"response",response:d,redirected:a};if(await d.body?.cancel().catch(()=>{}),!s)return{kind:"response",response:d,redirected:a};if(c>=sS)return{kind:"failed",message:`More than ${sS} redirects.`};let l=d.headers.get("location");if(!l)return{kind:"failed",message:"A redirect named no address."};let p;try{p=new URL(l,i)}catch{return{kind:"failed",message:"A redirect named an address that is not a URL."}}if(!nS(p,e.origin))return{kind:"failed",message:"A redirect named an address that is not https."};i=p,a=!0}}async function fS(e,t){let r=new AbortController,n=setTimeout(()=>r.abort(),e),s=()=>{clearTimeout(n),n=setTimeout(()=>r.abort(),e)};try{return await t(r.signal,s)}finally{clearTimeout(n)}}async function h9(e,t,r,n,s){if(!uS(t))return{ok:!1,message:"The key is not one a data host serves."};let o=d9(t);return fS(rd(iS,e.options?.env),async(i,a)=>{let c=await dS(e,t,r,"GET",!0,i);if(c.kind==="failed")return{ok:!1,message:c.message};let{response:u,redirected:d}=c;if(u.status!==200||!u.body)return await u.body?.cancel().catch(()=>{}),{ok:!1,message:lS(u.status,d)};let l=u.headers.get("content-length");if(o!==null&&l!==null&&Number(l)!==o)return await u.body.cancel().catch(()=>{}),{ok:!1,message:`The object is ${It(l,20)} bytes but its key says ${o}.`};a();let p,f=0,h=0;try{p=await c9(n,"w");let m=u.body.getReader();while(!0){let{done:y,value:_}=await m.read();if(y)break;if(a(),f+=_.byteLength,o!==null&&f>o)throw await m.cancel().catch(()=>{}),new mc(`More bytes arrived than the key's ${o}.`);if(await p.write(_),f-h>=l9)h=f,s(f)}if(await p.close(),p=void 0,o!==null&&f!==o)throw new mc(`The object ended after ${f} bytes; its key says ${o}.`);if(f!==h)s(f);return{ok:!0,bytes:f}}catch(m){if(await p?.close().catch(()=>{}),await u9(n,{force:!0}).catch(()=>{}),m instanceof mc)return{ok:!1,message:m.message};if(i.aborted)return{ok:!1,message:"The transfer stalled and timed out."};return{ok:!1,message:`The transfer failed (${nd(m)}).`}}})}class mc extends Error{constructor(e){super(e);this.name="SizeError"}}async function m9(e,t,r){if(!uS(t))return{state:"unknown",message:"The key is not one a data host serves."};return fS(rd(iS,e.options?.env),async(n)=>{let s=await dS(e,t,r,"HEAD",!1,n);if(s.kind==="failed")return{state:"unknown",message:s.message};let{status:o}=s.response;if(await s.response.body?.cancel().catch(()=>{}),o===200)return{state:"present"};if(o===404)return{state:"absent"};return{state:"unknown",message:lS(o,!1)}})}class gc extends Error{constructor(e){super(e);this.name="ProtocolAbort"}}async function pS(e,t){let r=e.lines[Symbol.asyncIterator](),n=[],s=null,o=null,i=async()=>{let d=n.shift();if(d!==void 0)return d;let l=await r.next();return l.done?null:l.value},a=async(d)=>{await e.send(`GETCONFIG ${d}`);while(!0){let l=await r.next();if(l.done)throw new gc("git-annex closed the connection");let p=l.value;if(p==="VALUE"||p.startsWith("VALUE ")){let f=p.slice(5).trimStart();return f===""?void 0:f}if(p.startsWith("ERROR"))throw new gc(p);n.push(p)}},c=async()=>{let d=await a("host"),l=await a("dataset");return f9(d,l,t.options)},u=async(d,l)=>{if(!s||!o){await e.send(`TRANSFER-FAILURE RETRIEVE ${It(d)} The remote has not been prepared.`);return}let p=Promise.resolve(),f=await h9(s,d,o,l,(h)=>{p=p.then(()=>e.send(`PROGRESS ${h}`))});if(await p,f.ok)await e.send(`TRANSFER-SUCCESS RETRIEVE ${d}`);else await e.send(`TRANSFER-FAILURE RETRIEVE ${It(d)} ${It(f.message)}`)};await e.send("VERSION 1");while(!0){let d=await i();if(d===null)return 0;if(d.trim()==="")continue;let[l,...p]=oS(d,1),f=p[0]??"";try{switch(l){case"EXTENSIONS":await e.send("EXTENSIONS");break;case"INITREMOTE":{let h=await c();await e.send(h.ok?"INITREMOTE-SUCCESS":`INITREMOTE-FAILURE ${It(h.message)}`);break}case"PREPARE":{let h=await c();if(!h.ok){s=null,await e.send(`PREPARE-FAILURE ${It(h.message)}`);break}let m=t.loadApiKey();if(!m){s=null,await e.send("PREPARE-FAILURE No NEMAR API key is stored. Run 'nemar auth login' first.");break}s=h.settings,o=m,await e.send("PREPARE-SUCCESS");break}case"LISTCONFIGS":await e.send("CONFIG host The https origin of the NEMAR data host"),await e.send("CONFIG dataset The dataset id on that host"),await e.send("CONFIGEND");break;case"GETCOST":await e.send("COST 200");break;case"GETAVAILABILITY":await e.send("AVAILABILITY GLOBAL");break;case"GETINFO":if(s)await e.send("INFOFIELD host"),await e.send(`INFOVALUE ${s.origin}`),await e.send("INFOFIELD dataset"),await e.send(`INFOVALUE ${s.dataset}`);await e.send("INFOEND");break;case"EXPORTSUPPORTED":await e.send("EXPORTSUPPORTED-FAILURE");break;case"IMPORTSUPPORTED":await e.send("IMPORTSUPPORTED-FAILURE");break;case"WHEREIS":await e.send("WHEREIS-FAILURE");break;case"CLAIMURL":await e.send("CLAIMURL-FAILURE");break;case"CHECKURL":await e.send("CHECKURL-FAILURE");break;case"TRANSFER":{let[h,m,...y]=oS(f,2);if(h==="STORE")await e.send(`TRANSFER-FAILURE STORE ${It(m??"")} This remote is read-only for now.`);else if(h==="RETRIEVE"&&m&&y[0])await u(m,y[0]);else await e.send("UNSUPPORTED-REQUEST");break}case"CHECKPRESENT":{if(!f){await e.send("UNSUPPORTED-REQUEST");break}if(!s||!o){await e.send(`CHECKPRESENT-UNKNOWN ${It(f)} The remote has not been prepared.`);break}let h=await m9(s,f,o);if(h.state==="present")await e.send(`CHECKPRESENT-SUCCESS ${f}`);else if(h.state==="absent")await e.send(`CHECKPRESENT-FAILURE ${f}`);else await e.send(`CHECKPRESENT-UNKNOWN ${It(f)} ${h.message}`);break}case"REMOVE":await e.send(`REMOVE-FAILURE ${It(f)} This remote is read-only for now.`);break;case"ERROR":return 1;case"VALUE":break;default:await e.send("UNSUPPORTED-REQUEST")}}catch(h){if(h instanceof gc)return 1;throw h}}}function oS(e,t){let r=[],n=e;for(let s=0;s<t;s++){let o=n.indexOf(" ");if(o<0)break;r.push(n.slice(0,o)),n=n.slice(o+1)}return r.push(n),r}async function*g9(){let e=new TextDecoder,t="";for await(let r of Bun.stdin.stream()){t+=e.decode(r,{stream:!0});let n=t.indexOf(`
38
38
  `);while(n>=0)yield t.slice(0,n).replace(/\r$/,""),t=t.slice(n+1),n=t.indexOf(`
39
39
  `)}if(t+=e.decode(),t!=="")yield t}var sd=Bun.stdout.writer(),y9=await pS({lines:g9(),send:async(e)=>{sd.write(`${e}
40
40
  `),await sd.flush()}},{loadApiKey:()=>hn().apiKey||void 0});await sd.end();process.exit(y9);